diff --git a/package.json b/package.json index 5bbfb3e..a38019f 100644 --- a/package.json +++ b/package.json @@ -1,27 +1,27 @@ { - "name": "bj-casino-deeplink", - "private": true, - "version": "0.0.0", - "scripts": { - "dev": "vite", - "serve": "vue-cli-service serve", - "build": "vite build", - "build1": "vue-tsc --noEmit && vite build", - "preview": "vite preview" - }, - "dependencies": { - "@vue/cli": "^5.0.4", - "@vue/compiler-sfc": "^3.2.32", - "bootstrap": "^5.1.3", - "element-plus": "^2.1.9", - "moment": "^2.29.2", - "vue": "^3.2.25" - }, - "devDependencies": { - "@vitejs/plugin-vue": "^2.3.1", - "typescript": "^4.5.4", - "vite": "^2.9.2", - "vue-tsc": "^0.29.8" - }, - "@vue/compiler-sfc": "file: node_modules/@vue/compiler-sfc" -} + "name": "bj-casino-deeplink", + "private": true, + "version": "0.0.0", + "scripts": { + "dev": "vite --host", + "serve": "vue-cli-service serve", + "build": "vite build", + "build1": "vue-tsc --noEmit && vite build", + "preview": "vite preview" + }, + "dependencies": { + "@vue/cli": "^5.0.4", + "@vue/compiler-sfc": "^3.2.32", + "bootstrap": "^5.1.3", + "element-plus": "^2.1.9", + "moment": "^2.29.2", + "vue": "^3.2.25" + }, + "devDependencies": { + "@vitejs/plugin-vue": "^2.3.1", + "typescript": "^4.5.4", + "vite": "^2.9.2", + "vue-tsc": "^0.29.8" + }, + "@vue/compiler-sfc": "file: node_modules/@vue/compiler-sfc" +} \ No newline at end of file diff --git a/src/components/BJ_Casino_Deeplink.vue b/src/components/BJ_Casino_Deeplink.vue index 8512870..42e3789 100644 --- a/src/components/BJ_Casino_Deeplink.vue +++ b/src/components/BJ_Casino_Deeplink.vue @@ -1,6 +1,8 @@ \ No newline at end of file diff --git a/src/components/Popup.vue b/src/components/Popup.vue new file mode 100644 index 0000000..5f5667b --- /dev/null +++ b/src/components/Popup.vue @@ -0,0 +1,18 @@ + + + \ No newline at end of file diff --git a/src/script/BJ_Casino_Deeplink.ts b/src/script/BJ_Casino_Deeplink.ts index 1a19590..7308146 100644 --- a/src/script/BJ_Casino_Deeplink.ts +++ b/src/script/BJ_Casino_Deeplink.ts @@ -1,437 +1,505 @@ + export class BJ_Casino_Deeplink { - //#region public + //#region public - public Servertype: any[] = [5, ["不選擇版本", "Web", "Out", "Submit", "Internal_release", "Internal_Dev"]]; - public Hostport: any[] = [1, ["不選擇環境", "內版", "肉乾", "賴宏", "40", "送審", "外版", "testing1", "testing2", "testing3"]]; - public Patch: any[] = [1, [ - "不選擇資源路徑", - "內版", - "B2B", - "送審", - "外版", - "alex", - "bowei", - "建喵-內版", - "建喵-B2B", - "建喵-送審", - "建喵-外版", - "打包機-內版", - "打包機-B2B", - "打包機-送審", - "打包機-外版", - ]]; + public Servertype: any[] = [5, ["不選擇版本", "Web", "Out", "Submit", "Internal_release", "Internal_Dev"]]; + public Hostport: any[] = [1, ["不選擇環境", "內版", "肉乾9006", "肉乾9007", "肉乾9008", "肉乾9009", "賴宏", "40", "送審", "外版", "testing1", "testing2", "testing3"]]; + public Patch: any[] = [1, [ + "不選擇資源路徑", + "內版", + "B2B", + "送審", + "外版", + "alex", + "bowei", + "建喵-內版", + "建喵-B2B", + "建喵-送審", + "建喵-外版", + "打包機-內版", + "打包機-B2B", + "打包機-送審", + "打包機-外版", + ]]; - //#endregion + //#endregion - //#region private + //#region private - private _client: any; + 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/); + 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 + //#endregion - //#region Lifecycle + //#region Lifecycle - /** - * - */ - constructor(client: any) { - this._client = client; - this.onLoad(); - } + /** + * + */ + constructor(client: any) { + this._client = client; + this.onLoad(); + } - public onLoad() { - this._client.servertype.value = this.Servertype[0]; - this._client.hostport.value = this.Hostport[0]; - this._client.patch.value = this.Patch[0]; - 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]; - } + public onLoad() { + this._client.servertype.value = this.Servertype[0]; + this._client.hostport.value = this.Hostport[0]; + this._client.patch.value = this.Patch[0]; + 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(); - //#endregion + if (!this._isAndroid && !this._isiOS) { + this._client.isBtn_WanOpen.value = true; + } + } - //#region Get Data + //#endregion - public SelectServertype(data: any) { - // data为el-option上:value绑定的对象 - this._client.servertype.value = data; - } + //#region Get Data - public SelectHostport(data: any) { - // data为el-option上:value绑定的对象 - this._client.hostport.value = data; - } + public SelectServertype(data: any) { + // data为el-option上:value绑定的对象 + this._client.servertype.value = data; + } - public SelectPatch(data: any) { - // data为el-option上:value绑定的对象 - this._client.patch.value = data; - } + public SelectHostport(data: any) { + // data为el-option上:value绑定的对象 + this._client.hostport.value = data; + } - //#endregion + public SelectPatch(data: any) { + // data为el-option上:value绑定的对象 + this._client.patch.value = data; + } - //#region Get Data + //#endregion - 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; - } + //#region Get Data - 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 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 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; - } + 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; + } - //#endregion + 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; + } - //#region Custom + // public async GetLanIP(): Promise { + // let run: boolean = true; + // let ip: string = ""; + // // var url: string = "http://192.168.5.36/page/Net/"; + // var url: string = "http://220.134.195.1/public/bonus_casino/html5/jianmiau/Net/"; + // var xhr: XMLHttpRequest = new XMLHttpRequest(); + // xhr.onreadystatechange = function (): void { + // if (xhr.readyState === 4 && (xhr.status >= 200 && xhr.status < 400)) { + // ip = xhr.responseText; + // run = false; + // } + // }; + // xhr.open("GET", url); + // xhr.timeout = 500; // 超时时间,单位是毫秒 + // xhr.ontimeout = function (e) { + // // XMLHttpRequest 超时。在此做某事。 + // run = false; + // }; + // xhr.send(); + // while (run) { + // await Tools.Sleep(1000); + // } + // if (ip !== "") { + // this._isWan = false; + // } + // return ip; + // } - public Install_Debug() { - if (this._isAndroid) { - window.open("https://dl.dropboxusercontent.com/s/aoh4p9vs1lrofy2/BJ_Casino-debug.apk?v=" + Date.now(), "_self"); - } else if (this._isiOS) { - window.open("itms-services://?action=download-manifest&url=https://dl.dropboxusercontent.com/s/z390yysswqiiii4/BJ_Casino-debug.plist", "_self"); - } else { - window.open("https://dl.dropboxusercontent.com/s/aoh4p9vs1lrofy2/BJ_Casino-debug.apk?v=" + Date.now(), "_blank"); - window.open("https://dl.dropboxusercontent.com/s/4ki0rglk4w01ian/BJ_Casino-debug.ipa", "_blank"); - } - } + //#endregion - public Install_Release() { - if (this._isAndroid) { - window.open("https://dl.dropboxusercontent.com/s/6mjrw913u6ma5w8/BJ_Casino-release.apk?v=" + Date.now(), "_self"); - } else if (this._isiOS) { - window.open("itms-services://?action=download-manifest&url=https://dl.dropboxusercontent.com/s/9qckj6t66jgb6rw/BJ_Casino-release.plist", "_self"); - } else { - window.open("https://dl.dropboxusercontent.com/s/6mjrw913u6ma5w8/BJ_Casino-release.apk?v=" + Date.now(), "_blank"); - window.open("https://dl.dropboxusercontent.com/s/hyyswyun3m42qbk/BJ_Casino-release.ipa?v=" + Date.now(), "_blank"); - } - } + //#region Custom - public Install_Release_Debug() { - if (this._isAndroid) { - window.open("https://dl.dropboxusercontent.com/s/16m2b5sncymj6f9/BJ_Casino-release-debug.apk?v=" + Date.now(), "_self"); - } else if (this._isiOS) { - window.open("itms-services://?action=download-manifest&url=https://dl.dropboxusercontent.com/s/wixnsxbc7ctk87f/BJ_Casino-release-debug.plist", "_self"); - } else { - window.open("https://dl.dropboxusercontent.com/s/16m2b5sncymj6f9/BJ_Casino-release-debug.apk?v=" + Date.now(), "_blank"); - window.open("https://dl.dropboxusercontent.com/s/f6qjm1gk8jjvmhx/BJ_Casino-release-debug.ipa?v=" + Date.now(), "_blank"); - } - } + public Install_Debug() { + if (this._isAndroid) { + window.open("https://dl.dropboxusercontent.com/s/aoh4p9vs1lrofy2/BJ_Casino-debug.apk?v=" + Date.now(), "_self"); + } else if (this._isiOS) { + window.open("itms-services://?action=download-manifest&url=https://dl.dropboxusercontent.com/s/z390yysswqiiii4/BJ_Casino-debug.plist", "_self"); + } else { + window.open("https://dl.dropboxusercontent.com/s/aoh4p9vs1lrofy2/BJ_Casino-debug.apk?v=" + Date.now(), "_blank"); + window.open("https://dl.dropboxusercontent.com/s/4ki0rglk4w01ian/BJ_Casino-debug.ipa", "_blank"); + } + } - public Install_B2B() { - if (this._isAndroid) { - window.open("https://dl.dropboxusercontent.com/s/g66xrcdfj9e093i/BJ_Casino-B2B.apk?v=" + Date.now(), "_self"); - } else if (this._isiOS) { - window.open("itms-services://?action=download-manifest&url=https://dl.dropboxusercontent.com/s/rrs1ev3llogrm0a/BJ_Casino-B2B.plist", "_self"); - } else { - window.open("https://dl.dropboxusercontent.com/s/g66xrcdfj9e093i/BJ_Casino-B2B.apk?v=" + Date.now(), "_blank"); - window.open("https://dl.dropboxusercontent.com/s/fm79uc9ygrnzone/BJ_Casino-B2B.ipa?v=" + Date.now(), "_blank"); - } - } + public Install_Release() { + if (this._isAndroid) { + window.open("https://dl.dropboxusercontent.com/s/6mjrw913u6ma5w8/BJ_Casino-release.apk?v=" + Date.now(), "_self"); + } else if (this._isiOS) { + window.open("itms-services://?action=download-manifest&url=https://dl.dropboxusercontent.com/s/9qckj6t66jgb6rw/BJ_Casino-release.plist", "_self"); + } else { + window.open("https://dl.dropboxusercontent.com/s/6mjrw913u6ma5w8/BJ_Casino-release.apk?v=" + Date.now(), "_blank"); + window.open("https://dl.dropboxusercontent.com/s/hyyswyun3m42qbk/BJ_Casino-release.ipa?v=" + Date.now(), "_blank"); + } + } - public Install_JM() { - if (this._isAndroid) { - window.open("https://dl.dropboxusercontent.com/s/9zlj6og4octmim8/BJ_Casino-JM.apk?v=" + Date.now(), "_self"); - } else if (this._isiOS) { - window.open("itms-services://?action=download-manifest&url=https://dl.dropboxusercontent.com/s/23mx7l7cchbvjcv/BJ_Casino-JM.plist", "_self"); - } else { - window.open("https://dl.dropboxusercontent.com/s/9zlj6og4octmim8/BJ_Casino-JM.apk?v=" + Date.now(), "_blank"); - window.open("https://dl.dropboxusercontent.com/s/dwlil2rbfe1wi13/BJ_Casino-JM.ipa?v=" + Date.now(), "_blank"); - } - } + public Install_Release_Debug() { + if (this._isAndroid) { + window.open("https://dl.dropboxusercontent.com/s/16m2b5sncymj6f9/BJ_Casino-release-debug.apk?v=" + Date.now(), "_self"); + } else if (this._isiOS) { + window.open("itms-services://?action=download-manifest&url=https://dl.dropboxusercontent.com/s/wixnsxbc7ctk87f/BJ_Casino-release-debug.plist", "_self"); + } else { + window.open("https://dl.dropboxusercontent.com/s/16m2b5sncymj6f9/BJ_Casino-release-debug.apk?v=" + Date.now(), "_blank"); + window.open("https://dl.dropboxusercontent.com/s/f6qjm1gk8jjvmhx/BJ_Casino-release-debug.ipa?v=" + Date.now(), "_blank"); + } + } - public Install_Store() { - if (this._isAndroid) { - window.open("https://play.google.com/store/apps/details?id=org.vicking.bj_casino", "_self"); - } else if (this._isiOS) { - window.open("https://apps.apple.com/tw/app/爆機娛樂城/id1593328573", "_self"); - } else { - window.open("https://play.google.com/store/apps/details?id=org.vicking.bj_casino", "_blank"); - window.open("https://apps.apple.com/tw/app/爆機娛樂城/id1593328573", "_blank"); - } - } + public Install_B2B() { + if (this._isAndroid) { + window.open("https://dl.dropboxusercontent.com/s/g66xrcdfj9e093i/BJ_Casino-B2B.apk?v=" + Date.now(), "_self"); + } else if (this._isiOS) { + window.open("itms-services://?action=download-manifest&url=https://dl.dropboxusercontent.com/s/rrs1ev3llogrm0a/BJ_Casino-B2B.plist", "_self"); + } else { + window.open("https://dl.dropboxusercontent.com/s/g66xrcdfj9e093i/BJ_Casino-B2B.apk?v=" + Date.now(), "_blank"); + window.open("https://dl.dropboxusercontent.com/s/fm79uc9ygrnzone/BJ_Casino-B2B.ipa?v=" + Date.now(), "_blank"); + } + } - public Install_Bowei() { - if (this._isAndroid) { - window.open("http://220.134.195.1/public/bonus_casino/html5/bowei/BJ_Casino-debug.apk?v=" + Date.now(), "_self"); - } else if (this._isiOS) { - alert("iOS不提供"); - } else { - window.open("http://220.134.195.1/public/bonus_casino/html5/bowei/BJ_Casino-debug.apk?v=" + Date.now(), "_blank"); - } - } + public Install_JM() { + if (this._isAndroid) { + window.open("https://dl.dropboxusercontent.com/s/9zlj6og4octmim8/BJ_Casino-JM.apk?v=" + Date.now(), "_self"); + } else if (this._isiOS) { + window.open("itms-services://?action=download-manifest&url=https://dl.dropboxusercontent.com/s/23mx7l7cchbvjcv/BJ_Casino-JM.plist", "_self"); + } else { + window.open("https://dl.dropboxusercontent.com/s/9zlj6og4octmim8/BJ_Casino-JM.apk?v=" + Date.now(), "_blank"); + window.open("https://dl.dropboxusercontent.com/s/dwlil2rbfe1wi13/BJ_Casino-JM.ipa?v=" + Date.now(), "_blank"); + } + } - public Install_InternalTest(InternalTest: number): void { - // let InternalTest = document.getElementById("InternalTest").value; - // let InternalTest = ""; - if (this._isAndroid && InternalTest) { - window.open(`https://play.google.com/apps/test/org.vicking.bj_casino/${InternalTest}`, "_self"); - } else if (this._isiOS) { - alert("iOS不提供"); - } else { - window.open(`https://play.google.com/apps/test/org.vicking.bj_casino/${InternalTest}`, "_blank"); - } - } + public Install_Store() { + if (this._isAndroid) { + window.open("https://play.google.com/store/apps/details?id=org.vicking.bj_casino", "_self"); + } else if (this._isiOS) { + window.open("https://apps.apple.com/tw/app/爆機娛樂城/id1593328573", "_self"); + } else { + window.open("https://play.google.com/store/apps/details?id=org.vicking.bj_casino", "_blank"); + window.open("https://apps.apple.com/tw/app/爆機娛樂城/id1593328573", "_blank"); + } + } - public OnclickOpen() { - let hostport = this._client.hostport.value; - let servertype = +this._client.servertype.value; - let patch = +this._client.patch.value; - let E_iscustom: any = document.getElementById("iscustom"); - let iscustom = E_iscustom.checked; - let URLscheme: any = {}; + public Install_Bowei() { + if (this._isAndroid) { + window.open("http://220.134.195.1/public/bonus_casino/html5/bowei/BJ_Casino-debug.apk?v=" + Date.now(), "_self"); + } else if (this._isiOS) { + alert("iOS不提供"); + } else { + window.open("http://220.134.195.1/public/bonus_casino/html5/bowei/BJ_Casino-debug.apk?v=" + Date.now(), "_blank"); + } + } - switch (servertype) { - case 0: { - break; - } - default: { - URLscheme["servertype"] = servertype; - break; - } - } + public Install_InternalTest(InternalTest: number): void { + // let InternalTest = document.getElementById("InternalTest").value; + // let InternalTest = ""; + if (this._isAndroid && InternalTest) { + window.open(`https://play.google.com/apps/test/org.vicking.bj_casino/${InternalTest}`, "_self"); + } else if (this._isiOS) { + alert("iOS不提供"); + } else { + window.open(`https://play.google.com/apps/test/org.vicking.bj_casino/${InternalTest}`, "_blank"); + } + } - switch (hostport) { + public OnclickWanOpen() { + this._client.PopupVisible.value = true; + // this.OnclickOpen(true); + } - // 不選擇環境 - case 0: { - break; - } + public OnclickOpen(isWan: boolean = false, obj: Object = {}) { + let hostport = this._client.hostport.value; + let servertype = +this._client.servertype.value; + let patch = +this._client.patch.value; + let E_iscustom: any = document.getElementById("iscustom"); + let iscustom = E_iscustom.checked; + let URLscheme: any = {}; - // 外網連內版 - case 1: { - URLscheme["host"] = "http://220.134.195.1"; - URLscheme["port"] = "19005"; - break; - } + if (obj["deviceid"]) { + URLscheme["deviceid"] = obj["deviceid"]; + } - // 肉乾 - case 2: { - URLscheme["host"] = "http://192.168.5.230"; - URLscheme["port"] = "9006"; - break; - } + switch (servertype) { + case 0: { + break; + } + default: { + URLscheme["servertype"] = servertype; + break; + } + } - // 賴宏 - case 3: { - URLscheme["host"] = "http://192.168.5.134"; - URLscheme["port"] = "9005"; - break; - } + switch (hostport) { - // 40 - case 4: { - URLscheme["host"] = "http://192.168.5.12"; - URLscheme["port"] = "9487"; - break; - } + // 不選擇環境 + case 0: { + break; + } - // 送審 - case 5: { - URLscheme["host"] = "https://submit.online-bj.com"; - URLscheme["port"] = "9005"; - break; - } + // 外網連內版 + case 1: { + URLscheme["host"] = "http://220.134.195.1"; + URLscheme["port"] = "19005"; + break; + } - // 外版 - case 6: { - URLscheme["host"] = "https://game.online-bj.com"; - URLscheme["port"] = "9005"; - break; - } + // 肉乾9006 + case 2: { + URLscheme["host"] = "http://192.168.5.230"; + URLscheme["port"] = "9006"; + break; + } - // testing1 - case 7: { - URLscheme["host"] = "http://bj-testing1.casino.catan.com.tw"; - URLscheme["port"] = "9005"; - break; - } + // 肉乾9007 + case 3: { + URLscheme["host"] = "http://192.168.5.230"; + URLscheme["port"] = "9007"; + break; + } - // testing2 - case 8: { - URLscheme["host"] = "http://bj-testing2.casino.catan.com.tw"; - URLscheme["port"] = "9005"; - break; - } + // 肉乾9008 + case 4: { + URLscheme["host"] = "http://192.168.5.230"; + URLscheme["port"] = "9008"; + break; + } - // testing3 - case 9: { - URLscheme["host"] = "http://bj-testing3.casino.catan.com.tw"; - URLscheme["port"] = "9005"; - break; - } + // 肉乾9009 + case 5: { + URLscheme["host"] = "http://192.168.5.230"; + URLscheme["port"] = "9009"; + break; + } - default: { - break; - } - } + // 賴宏 + case 6: { + URLscheme["host"] = "http://192.168.5.134"; + URLscheme["port"] = "9005"; + break; + } - switch (patch) { - // "https://patch.online-bj.com/game/", - // "https://patch-submit.online-bj.com/game/", - // "http://220.134.195.1/public/bonus_casino/html5/alex/APPBundleTest/", - // "http://220.134.195.1/public/bonus_casino/html5/jianmiau/Bundle/", - // "http://patch-release.online-bj.com/", - // "http://patch-dev.online-bj.com/", + // 40 + case 7: { + URLscheme["host"] = "http://192.168.5.12"; + URLscheme["port"] = "9487"; + break; + } - case 0: { - break; - } + // 送審 + case 8: { + URLscheme["host"] = "https://submit.online-bj.com"; + URLscheme["port"] = "9005"; + break; + } - // Dev - case 1: { - URLscheme["patch"] = "http://patch-dev.online-bj.com/"; - break; - } + // 外版 + case 9: { + URLscheme["host"] = "https://game.online-bj.com"; + URLscheme["port"] = "9005"; + break; + } - // B2B - case 2: { - URLscheme["patch"] = "http://patch-release.online-bj.com/"; - break; - } + // testing1 + case 10: { + URLscheme["host"] = "http://bj-testing1.casino.catan.com.tw"; + URLscheme["port"] = "9005"; + break; + } - // 送審 - case 3: { - URLscheme["patch"] = "https://patch-submit.online-bj.com/game/"; - break; - } + // testing2 + case 11: { + URLscheme["host"] = "http://bj-testing2.casino.catan.com.tw"; + URLscheme["port"] = "9005"; + break; + } - // 外版 - case 4: { - URLscheme["patch"] = "https://patch.online-bj.com/game/"; - break; - } + // testing3 + case 12: { + URLscheme["host"] = "http://bj-testing3.casino.catan.com.tw"; + URLscheme["port"] = "9005"; + break; + } - // alex - case 5: { - URLscheme["patch"] = "http://220.134.195.1/public/bonus_casino/html5/alex/Bundle/"; - break; - } + default: { + break; + } + } - // bowei - case 6: { - URLscheme["patch"] = "http://220.134.195.1/public/bonus_casino/html5/bowei/Bundle/"; - break; - } + switch (patch) { + // "https://patch.online-bj.com/game/", + // "https://patch-submit.online-bj.com/game/", + // "http://220.134.195.1/public/bonus_casino/html5/alex/APPBundleTest/", + // "http://220.134.195.1/public/bonus_casino/html5/jianmiau/Bundle/", + // "http://patch-release.online-bj.com/", + // "http://patch-dev.online-bj.com/", - // jianmiau-Dev - case 7: { - // URLscheme["patch"] = "http://220.134.195.1/public/bonus_casino/html5/jianmiau/Bundle/"; - URLscheme["patch"] = "http://192.168.5.36/Source/_BJ_Source/BJ-Internal-Dev/"; - break; - } + case 0: { + break; + } - // jianmiau-Release - case 8: { - URLscheme["patch"] = "http://192.168.5.36/Source/_BJ_Source/BJ-Internal-Release/"; - break; - } + // Dev + case 1: { + URLscheme["patch"] = "http://patch-dev.online-bj.com/"; + break; + } - // jianmiau-Submit - case 9: { - URLscheme["patch"] = "http://192.168.5.36/Source/_BJ_Source/BJ-Submit/"; - break; - } + // B2B + case 2: { + URLscheme["patch"] = "http://patch-release.online-bj.com/"; + break; + } - // jianmiau-Out - case 10: { - URLscheme["patch"] = "http://192.168.5.36/Source/_BJ_Source/BJ-Out/"; - break; - } + // 送審 + case 3: { + URLscheme["patch"] = "https://patch-submit.online-bj.com/game/"; + break; + } - // 108-Dev - case 11: { - URLscheme["patch"] = "http://192.168.5.108/BJ-Internal-Dev/"; - break; - } + // 外版 + case 4: { + URLscheme["patch"] = "https://patch.online-bj.com/game/"; + break; + } - // 108-Release - case 12: { - URLscheme["patch"] = "http://192.168.5.108/BJ-Internal-Release/"; - break; - } + // alex + case 5: { + URLscheme["patch"] = "http://220.134.195.1/public/bonus_casino/html5/alex/Bundle/"; + break; + } - // 108-Submit - case 13: { - URLscheme["patch"] = "http://192.168.5.108/BJ-Submit/"; - break; - } + // bowei + case 6: { + URLscheme["patch"] = "http://220.134.195.1/public/bonus_casino/html5/bowei/Bundle/"; + break; + } - // 108-Out - case 14: { - URLscheme["patch"] = "http://192.168.5.108/BJ-Out/"; - break; - } + // jianmiau-Dev + case 7: { + // URLscheme["patch"] = "http://220.134.195.1/public/bonus_casino/html5/jianmiau/Bundle/"; + URLscheme["patch"] = "http://192.168.5.36/Source/_BJ_Source/BJ-Internal-Dev/"; + break; + } - default: { - break; - } - // case 0: { - // break; - // } - // default: { - // URLscheme["patch"] = document.getElementById("patch").options[patch].label; - // break; - // } - } + // jianmiau-Release + case 8: { + URLscheme["patch"] = "http://192.168.5.36/Source/_BJ_Source/BJ-Internal-Release/"; + break; + } - let url = ""; - if (iscustom) { - let URLscheme = new URL(location.href); - if (this._isiOS || this._isAndroid) { - url = `bjcasino://get/message${URLscheme.search}`; - } else { - url = `http://220.134.195.1:17456/phone.html${URLscheme.search}`; - } - } else { - let _URLSearchParams = new URLSearchParams(URLscheme).toString(); - let _decodeURI = decodeURIComponent(_URLSearchParams); - if (this._isiOS || this._isAndroid) { - url = `bjcasino://get/message${_decodeURI ? `?${_decodeURI}` : ""}`; - } else { - url = `http://220.134.195.1:17456/phone.html${_decodeURI ? `?${_decodeURI}` : ""}`; - } - } - if (this._isiOS || this._isAndroid) { - window.open(url, "_self"); - } else { - window.open(url, "_blank"); - } - } + // jianmiau-Submit + case 9: { + URLscheme["patch"] = "http://192.168.5.36/Source/_BJ_Source/BJ-Submit/"; + break; + } - //#endregion + // jianmiau-Out + case 10: { + URLscheme["patch"] = "http://192.168.5.36/Source/_BJ_Source/BJ-Out/"; + break; + } + + // 108-Dev + case 11: { + URLscheme["patch"] = "http://192.168.5.108/BJ-Internal-Dev/"; + break; + } + + // 108-Release + case 12: { + URLscheme["patch"] = "http://192.168.5.108/BJ-Internal-Release/"; + break; + } + + // 108-Submit + case 13: { + URLscheme["patch"] = "http://192.168.5.108/BJ-Submit/"; + break; + } + + // 108-Out + case 14: { + URLscheme["patch"] = "http://192.168.5.108/BJ-Out/"; + break; + } + + default: { + break; + } + // case 0: { + // break; + // } + // default: { + // URLscheme["patch"] = document.getElementById("patch").options[patch].label; + // break; + // } + } + + let url = ""; + let gameUrl = "220.134.195.1:17456"; + if (!isWan) { + gameUrl = "192.168.5.108:7456"; + } + if (iscustom) { + let URLscheme = new URL(location.href); + if (this._isiOS || this._isAndroid) { + url = `bjcasino://get/message${URLscheme.search}`; + } else { + url = `http://${gameUrl}/phone.html${URLscheme.search}`; + } + } else { + let _URLSearchParams = new URLSearchParams(URLscheme).toString(); + let _decodeURI = decodeURIComponent(_URLSearchParams); + if (this._isiOS || this._isAndroid) { + url = `bjcasino://get/message${_decodeURI ? `?${_decodeURI}` : ""}`; + } else { + url = `http://${gameUrl}/phone.html${_decodeURI ? `?${_decodeURI}` : ""}`; + } + } + if (this._isiOS || this._isAndroid) { + window.open(url, "_self"); + } else { + window.open(url, "_blank"); + } + } + + //#endregion } diff --git a/src/script/Tools.ts b/src/script/Tools.ts new file mode 100644 index 0000000..0a94a8c --- /dev/null +++ b/src/script/Tools.ts @@ -0,0 +1,11 @@ + +export class Tools { + + //#region Custom + + public static Sleep(ms: any): Promise { + return new Promise(resolve => setTimeout(resolve, ms)); + } + + //#endregion +} diff --git a/tsconfig.json b/tsconfig.json index 61e7e54..b144721 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -1,28 +1,28 @@ { - "compilerOptions": { - "target": "esnext", - "useDefineForClassFields": true, - "module": "esnext", - "moduleResolution": "node", - "strict": true, - "jsx": "preserve", - "sourceMap": true, - "resolveJsonModule": true, - "esModuleInterop": true, - "lib": [ - "esnext", - "dom" - ] - }, - "include": [ - "src/**/*.ts", - "src/**/*.d.ts", - "src/**/*.tsx", - "src/**/*.vue" - ], - "references": [ - { - "path": "./tsconfig.node.json" - } - ] + "compilerOptions": { + "target": "esnext", + "useDefineForClassFields": true, + "module": "esnext", + "moduleResolution": "node", + // "strict": true, + "jsx": "preserve", + "sourceMap": true, + "resolveJsonModule": true, + "esModuleInterop": true, + "lib": [ + "esnext", + "dom" + ] + }, + "include": [ + "src/**/*.ts", + "src/**/*.d.ts", + "src/**/*.tsx", + "src/**/*.vue" + ], + "references": [ + { + "path": "./tsconfig.node.json" + } + ] } \ No newline at end of file