[add] first

This commit is contained in:
2023-10-05 17:54:38 +08:00
commit c4d00abb85
24 changed files with 20631 additions and 0 deletions

22
src/App.vue Normal file
View File

@@ -0,0 +1,22 @@
<script setup lang="ts">
import LP_Casino_Deeplink from './components/LP_Casino_Deeplink.vue';
</script>
<template>
<LP_Casino_Deeplink />
</template>
<style>
@import url('../src/assets/fonts.css');
@import url('../src/assets/mystyle.css');
#app {
font-family: Avenir, Helvetica, Arial, sans-serif;
-webkit-font-smoothing: antialiased;
-moz-osx-font-smoothing: grayscale;
/* text-align: center; */
color: #2671d4;
margin-top: 0px;
font-family: 'Zen Maru Gothic', sans-serif;
}
</style>

13
src/assets/fonts.css Normal file
View File

@@ -0,0 +1,13 @@
@font-face {
/* 重命名字体名 */
font-family: 'Zen Maru Gothic';
src: url('./fonts/ZenMaruGothic-Regular.ttf');
font-weight: normal;
font-style: normal;
}
.btn {
font-size: 25px;
/* width: 200px; */
/* height: 60px; */
}

Binary file not shown.

BIN
src/assets/icon.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 593 KiB

BIN
src/assets/logo.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.7 KiB

62
src/assets/mystyle.css Normal file
View File

@@ -0,0 +1,62 @@
/* The switch - the box around the slider */
.switch {
position: relative;
display: inline-block;
width: 60px;
height: 34px;
}
/* Hide default HTML checkbox */
.switch input {
opacity: 0;
width: 0;
height: 0;
}
/* The slider */
.slider {
position: absolute;
cursor: pointer;
top: 0;
left: 0;
right: 0;
bottom: 0;
background-color: #ccc;
-webkit-transition: .4s;
transition: .4s;
}
.slider:before {
position: absolute;
content: "";
height: 26px;
width: 26px;
left: 4px;
bottom: 4px;
background-color: white;
-webkit-transition: .4s;
transition: .4s;
}
input:checked + .slider {
background-color: #2196F3;
}
input:focus + .slider {
box-shadow: 0 0 1px #2196F3;
}
input:checked + .slider:before {
-webkit-transform: translateX(26px);
-ms-transform: translateX(26px);
transform: translateX(26px);
}
/* Rounded sliders */
.slider.round {
border-radius: 34px;
}
.slider.round:before {
border-radius: 50%;
}

View File

@@ -0,0 +1,106 @@
<script setup lang="ts">
import { ElDialog } from 'element-plus';
import { ref } from "vue";
import { LP2_Casino_Deeplink } from "../script/LP2_Casino_Deeplink";
import Popup from './Popup.vue';
const linetypeDefault = ref('')
const servertypeDefault = ref('')
const hostportDefault = ref('')
const patchDefault = ref('')
const linetype = ref(0)
const servertype = ref(0)
const hostport = ref(0)
const patch = ref(0)
const iscustom = ref(false)
const PopupVisible = ref(false)
const PopupCallback = ref(Function)
const PopupInfo = ref('')
const input3 = ref('')
const self = {
linetypeDefault: linetypeDefault,
servertypeDefault: servertypeDefault,
hostportDefault: hostportDefault,
patchDefault: patchDefault,
linetype: linetype,
servertype: servertype,
hostport: hostport,
patch: patch,
iscustom: iscustom,
PopupVisible: PopupVisible,
PopupCallback: PopupCallback,
PopupInfo: PopupInfo,
Script: null
}
const Script = new LP2_Casino_Deeplink(self);
self.Script = Script;
const LinetypeData = Script.GetLineType();
const ServertypeData = Script.GetServerType();
const HostportData = Script.GetHostport();
const Patch = Script.GetPatch();
</script>
<template>
<el-dialog v-model="PopupVisible" width="30%" :show-close="false">
<Popup :APP="self" />
</el-dialog>
<div>
<h1>
<div>
linetype:
<el-select v-model="linetypeDefault" filterable @change="(data: any) => { Script.SelectLinetype(data) }">
<el-option v-for="(item, index) in LinetypeData" :key="item.value" :label="item.label"
:value="item.value" />
</el-select>
</div>
<div>
servertype:
<el-select v-model="servertypeDefault" filterable
@change="(data: any) => { Script.SelectServertype(data) }">
<el-option v-for="(item, index) in ServertypeData" :key="item.value" :label="item.label"
:value="item.value" />
</el-select>
</div>
<div>
hostport:
<el-select v-model="hostportDefault" filterable @change="(data: any) => { Script.SelectHostport(data) }">
<el-option v-for="(item, index) in HostportData" :key="item.value" :label="item.label"
:value="item.value" />
</el-select>
</div>
<div>
patch:
<el-select v-model="patchDefault" filterable @change="(data: any) => { Script.SelectPatch(data) }">
<el-option v-for="(item, index) in Patch" :key="item.value" :label="item.label" :value="item.value" />
</el-select>
</div>
<div>
使用自己帶進來的URL參數
<label class="switch">
<input type="checkbox" id="iscustom">
<span class="slider"></span>
</label>
</div>
<el-button type="success" @click.native="() => { Script.OnclickOpen() }" size="large" round>開啟遊戲&gt;&gt;
</el-button>
<!-- <div>
<el-button type="warning" @click.native="() => { Script.Install_InternalTest(+input3) }" size="large" round>
前往
</el-button>
<el-input v-model="input3" placeholder="Google Play商店(內部測試) 版本號" class="input-with-select"
style="width:25%; font-size:25px; text-align">
</el-input>
Google Play商店(內部測試) 版本號
</div> -->
<br>
<a href="https://liff.line.me/2000222870-MOkW3vgO/?fid=10000000008">跟建喵做朋友&gt;&gt;</a>
<br><br>
<!-- <a href="bjcasino://get/message?GetOtherUserProfile=100000157">跟豆豆做朋友&gt;&gt;</a>
<br><br>
<a href="bjcasino://get/message?GetOtherUserProfile=100000148">跟柏威做朋友&gt;&gt;</a>
<br><br>
<a href="bjcasino://get/message?OnClickChatAndChat=100000157">跟豆豆聊聊天&gt;&gt;</a>
<br><br> -->
</h1>
</div>
</template>

20
src/components/Popup.vue Normal file
View File

@@ -0,0 +1,20 @@
<script setup lang="ts">
import { ref } from 'vue';
const props = defineProps<{ APP: any }>()
const input = ref('')
const APP = props.APP
function Send(content: string) {
APP.PopupVisible.value = false;
APP.PopupCallback.value(content);
}
const info = APP.PopupInfo
</script>
<template>
{{ info }}
<el-input v-model="input" />
<el-button type="primary" @click.native="() => { Send(input) }" size="large" round>確定
</el-button>
</template>

8
src/env.d.ts vendored Normal file
View File

@@ -0,0 +1,8 @@
/// <reference types="vite/client" />
declare module '*.vue' {
import type { DefineComponent } from 'vue'
// eslint-disable-next-line @typescript-eslint/no-explicit-any, @typescript-eslint/ban-types
const component: DefineComponent<{}, {}, any>
export default component
}

10
src/main.ts Normal file
View File

@@ -0,0 +1,10 @@
import "bootstrap";
import "bootstrap/dist/css/bootstrap.min.css";
import ElementPlus from "element-plus";
import "element-plus/dist/index.css";
import locale from "element-plus/lib/locale/lang/zh-tw";
import { createApp } from "vue";
import App from "./App.vue";
createApp(App).use(ElementPlus, { locale }).mount("#app");

View File

@@ -0,0 +1,382 @@
export class LP2_Casino_Deeplink {
//#region public
public Linetype: any[] = [4, ["外版", "B2B", "Test", "QA", "內版"]];
public Servertype: any[] = [5, ["不選擇版本", "外版", "B2B", "Test", "QA", "內版"]];
public Hostport: any[] = [5, ["不選擇版本", "外版", "B2B", "Test", "QA", "內版"]];
public Patch: any[] = [5, [
"不選擇版本",
"外版",
"B2B",
"Test",
"QA",
"內版",
"建喵-內版",
"建喵-Test",
"建喵-B2B",
"建喵-外版",
]];
//#endregion
//#region private
private _client: any;
private _u = navigator.userAgent;
private _isAndroid = this._u.indexOf("Android") > -1 || this._u.indexOf("Adr") > -1;
private _isiOS = !!this._u.match(/\(i[^;]+;( U;)? CPU.+Mac OS X/);
//#endregion
//#region Lifecycle
/**
*
*/
constructor(client: any) {
this._client = client;
this.onLoad();
}
public onLoad() {
this._client.linetype.value = this.Linetype[0];
this._client.servertype.value = this.Servertype[0];
this._client.hostport.value = this.Hostport[0];
this._client.patch.value = this.Patch[0];
this._client.linetypeDefault.value = this.Linetype[1][this._client.linetype.value];
this._client.servertypeDefault.value = this.Servertype[1][this._client.servertype.value];
this._client.hostportDefault.value = this.Hostport[1][this._client.hostport.value];
this._client.patchDefault.value = this.Patch[1][this._client.patch.value];
// this.GetLanIP();
// if (!this._isAndroid && !this._isiOS) {
// this._client.isBtn_WanOpen.value = true;
// }
}
//#endregion
//#region Get Data
public SelectLinetype(data: any) {
// data为el-option上:value绑定的对象
this._client.linetype.value = data;
let select: string = this.Linetype[1][data];
if (select) {
let servertype: number;
for (let i = 0; i < this.Servertype[1].length; i++) {
const servertypetName = this.Servertype[1][i];
if (servertypetName === select) {
servertype = i;
}
}
this._client.servertype.value = servertype;
this._client.servertypeDefault.value = this.Servertype[1][this._client.servertype.value];
let hostport: number;
for (let i = 0; i < this.Hostport[1].length; i++) {
const hostportName = this.Hostport[1][i];
if (hostportName === select) {
hostport = i;
}
}
this._client.hostport.value = hostport;
this._client.hostportDefault.value = this.Hostport[1][this._client.hostport.value];
let patch: number;
for (let i = 0; i < this.Patch[1].length; i++) {
const patchName = this.Patch[1][i];
if (patchName === select) {
patch = i;
}
}
this._client.patch.value = patch;
this._client.patchDefault.value = this.Patch[1][this._client.patch.value];
}
}
public SelectServertype(data: any) {
// data为el-option上:value绑定的对象
this._client.servertype.value = data;
}
public SelectHostport(data: any) {
// data为el-option上:value绑定的对象
this._client.hostport.value = data;
}
public SelectPatch(data: any) {
// data为el-option上:value绑定的对象
this._client.patch.value = data;
}
//#endregion
//#region Get Data
public GetLineType(): { key: string; value: string; label: string; }[] {
const linetypes: any[] = this.Linetype[1];
let options: any[] = [];
for (let i: number = 0; i < linetypes.length; i++) {
const linetype = linetypes[i];
options.push({
value: i,
label: linetype,
});
}
return options;
}
public GetServerType(): { key: string; value: string; label: string; }[] {
const servertypes: any[] = this.Servertype[1];
let options: any[] = [];
for (let i: number = 0; i < servertypes.length; i++) {
const servertype = servertypes[i];
options.push({
value: i,
label: servertype,
});
}
return options;
}
public GetHostport(): { key: string; value: string; label: string; }[] {
const hostports: any[] = this.Hostport[1];
let options: any[] = [];
for (let i: number = 0; i < hostports.length; i++) {
const hostport = hostports[i];
options.push({
value: i,
label: hostport,
});
}
return options;
}
public GetPatch(): { key: string; value: string; label: string; }[] {
const patchs: any[] = this.Patch[1];
let options: any[] = [];
for (let i: number = 0; i < patchs.length; i++) {
const patch = patchs[i];
options.push({
value: i,
label: patch,
});
}
return options;
}
//#endregion
//#region Custom
public OnclickOpen(isWan: boolean = false, obj: Object = {}) {
let hostport = this._client.hostport.value;
let linetype = +this._client.linetype.value;
let servertype = +this._client.servertype.value;
let patch = +this._client.patch.value;
let gameUrl = "https://liff.line.me/2000222870-MOkW3vgO?showtype=2";
let E_iscustom: any = document.getElementById("iscustom");
let iscustom = E_iscustom.checked;
let URLscheme: any = { v: Date.now() };
if (obj["deviceid"]) {
URLscheme["deviceid"] = obj["deviceid"];
}
switch (servertype) {
// 不選擇環境
case 0: {
break;
}
// 外版
case 1: {
URLscheme["servertype"] = 2;
break;
}
// B2B
case 2: {
URLscheme["servertype"] = 6;
break;
}
// Test
case 3: {
URLscheme["servertype"] = 8;
break;
}
// QA
case 4: {
URLscheme["servertype"] = 7;
break;
}
// 內版
case 5: {
URLscheme["servertype"] = 5;
break;
}
default: {
break;
}
}
switch (hostport) {
// 不選擇環境
case 0: {
break;
}
// 外版
case 1: {
URLscheme["host"] = "https://game.song-yy.com";
URLscheme["port"] = "9005";
break;
}
// B2B
case 2: {
URLscheme["host"] = "https://b2b.song-yy.com";
URLscheme["port"] = "9005";
break;
}
// Test
case 3: {
URLscheme["host"] = "https://testing.song-yy.com";
URLscheme["port"] = "9005";
break;
}
// QA
case 4: {
URLscheme["host"] = "https://qa.song-yy.com";
URLscheme["port"] = "9005";
break;
}
// 內版
case 5: {
URLscheme["host"] = "https://dev.song-yy.com";
URLscheme["port"] = "9005";
break;
}
default: {
break;
}
}
switch (patch) {
case 0: {
break;
}
// 外版
case 1: {
URLscheme["patch"] = "https://patch.song-yy.com/";
break;
}
// B2B
case 2: {
URLscheme["patch"] = "https://patch-b2b.song-yy.com/";
break;
}
// Test
case 3: {
URLscheme["patch"] = "https://patch-testing.song-yy.com/";
break;
}
// QA
case 4: {
URLscheme["patch"] = "https://patch-qa.song-yy.com/";
break;
}
// 內版
case 5: {
URLscheme["patch"] = "https://patch-dev.song-yy.com/";
break;
}
default: {
break;
}
}
switch (linetype) {
// 外版
case 0: {
gameUrl = "2000222941-8ORVa7oZ";
break;
}
// B2B
case 1: {
gameUrl = "2000222883-BvlaG5PA";
break;
}
// Test
case 2: {
gameUrl = "1657864500-N3YEgz6p";
break;
}
// QA
case 3: {
gameUrl = "2000773712-eY3J97pd";
break;
}
// 內版
case 4: {
gameUrl = "2000222870-MOkW3vgO";
break;
}
default: {
break;
}
}
let url = "";
if (iscustom) {
let URLscheme = new URL(location.href);
if (this._isiOS || this._isAndroid) {
url = `https://line.me/R/app/${gameUrl}/${URLscheme.search}`;
} else {
url = `https://liff.line.me/${gameUrl}/${URLscheme.search}`;
}
} else {
let _URLSearchParams = new URLSearchParams(URLscheme).toString();
let _decodeURI = decodeURIComponent(_URLSearchParams);
if (this._isiOS || this._isAndroid) {
url = `https://line.me/R/app/${gameUrl}/${_decodeURI ? `?${_decodeURI}` : ""}`;
} else {
url = `https://liff.line.me/${gameUrl}/${_decodeURI ? `?${_decodeURI}` : ""}`;
}
}
if (this._isiOS || this._isAndroid) {
window.open(url, "_self");
} else {
window.open(url, "_blank");
}
}
//#endregion
}

11
src/script/Tools.ts Normal file
View File

@@ -0,0 +1,11 @@
export class Tools {
//#region Custom
public static Sleep(ms: any): Promise<unknown> {
return new Promise(resolve => setTimeout(resolve, ms));
}
//#endregion
}