|
@@ -850,7 +850,7 @@
|
|
|
|
|
|
class HttpMgr {
|
|
class HttpMgr {
|
|
constructor() {
|
|
constructor() {
|
|
- this.isDev = false;
|
|
|
|
|
|
+ this.isDev = true;
|
|
HttpMgr._instance = this;
|
|
HttpMgr._instance = this;
|
|
}
|
|
}
|
|
static getInstance() {
|
|
static getInstance() {
|
|
@@ -1147,6 +1147,53 @@
|
|
}
|
|
}
|
|
ui_UIBox.URL = "ui://isxx5ak7erstv4nm";
|
|
ui_UIBox.URL = "ui://isxx5ak7erstv4nm";
|
|
|
|
|
|
|
|
+ class LocalStorageManager {
|
|
|
|
+ test1() {
|
|
|
|
+ LocalStorageManager.setItem("playerName", "Tom");
|
|
|
|
+ LocalStorageManager.setItem("playerLevel", 5);
|
|
|
|
+ LocalStorageManager.setItem("playerData", { score: 100, level: 3 });
|
|
|
|
+ const name = LocalStorageManager.getItem("playerName");
|
|
|
|
+ const level = LocalStorageManager.getItem("playerLevel");
|
|
|
|
+ const data = LocalStorageManager.getItem("playerData");
|
|
|
|
+ console.log(name);
|
|
|
|
+ console.log(level);
|
|
|
|
+ console.log(data);
|
|
|
|
+ LocalStorageManager.removeItem("playerLevel");
|
|
|
|
+ }
|
|
|
|
+ static setItem(key, value) {
|
|
|
|
+ Laya.LocalStorage.setItem(key, JSON.stringify(value));
|
|
|
|
+ }
|
|
|
|
+ static getItem(key) {
|
|
|
|
+ const data = Laya.LocalStorage.getItem(key);
|
|
|
|
+ if (data === null)
|
|
|
|
+ return null;
|
|
|
|
+ try {
|
|
|
|
+ return JSON.parse(data);
|
|
|
|
+ }
|
|
|
|
+ catch (e) {
|
|
|
|
+ return data;
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ static removeItem(key) {
|
|
|
|
+ Laya.LocalStorage.removeItem(key);
|
|
|
|
+ }
|
|
|
|
+ static clear() {
|
|
|
|
+ Laya.LocalStorage.clear();
|
|
|
|
+ }
|
|
|
|
+ static hasJosnKey(key) {
|
|
|
|
+ var value = Laya.LocalStorage.getJSON(key);
|
|
|
|
+ if (value != null) {
|
|
|
|
+ return true;
|
|
|
|
+ }
|
|
|
|
+ else {
|
|
|
|
+ return false;
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ static hasKey(key) {
|
|
|
|
+ return Laya.LocalStorage.getItem(key) !== null;
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+
|
|
class GlobalManager {
|
|
class GlobalManager {
|
|
constructor() {
|
|
constructor() {
|
|
}
|
|
}
|
|
@@ -1223,6 +1270,11 @@
|
|
}, "testAsyncCallback", JSON.stringify(reqObj));
|
|
}, "testAsyncCallback", JSON.stringify(reqObj));
|
|
}
|
|
}
|
|
showInternAd(mark) {
|
|
showInternAd(mark) {
|
|
|
|
+ let boo1 = this.checkAdForUserOrderForSpid17(1);
|
|
|
|
+ if (boo1) {
|
|
|
|
+ console.log('zh: VIP SPID = 1,免除插页AD');
|
|
|
|
+ return false;
|
|
|
|
+ }
|
|
console.log('zh:showInternAd start');
|
|
console.log('zh:showInternAd start');
|
|
if (!Laya.Browser.onAndroid) {
|
|
if (!Laya.Browser.onAndroid) {
|
|
console.log('zh:showInternAd 非android dev');
|
|
console.log('zh:showInternAd 非android dev');
|
|
@@ -1258,7 +1310,27 @@
|
|
console.log('zh:开始关闭游戏-');
|
|
console.log('zh:开始关闭游戏-');
|
|
this.bridge.call("exitAndCloseGame");
|
|
this.bridge.call("exitAndCloseGame");
|
|
}
|
|
}
|
|
|
|
+ checkAdForUserOrderForSpid17(spid) {
|
|
|
|
+ let userInfo = LocalStorageManager.getItem(keyForLoginInfo);
|
|
|
|
+ if (userInfo != null) {
|
|
|
|
+ if (!userInfo.buySpids) {
|
|
|
|
+ userInfo.buySpids = { 1: false, 7: false };
|
|
|
|
+ }
|
|
|
|
+ else {
|
|
|
|
+ console.log('zh:检查 userInfo.buySpidsX[' + spid + '] ' + userInfo.buySpids[spid]);
|
|
|
|
+ }
|
|
|
|
+ let boo = userInfo.buySpids[spid];
|
|
|
|
+ console.log('zh:检查是否免AD SPID=' + spid + '= 免除AD?=' + boo);
|
|
|
|
+ return boo;
|
|
|
|
+ }
|
|
|
|
+ return false;
|
|
|
|
+ }
|
|
showRewardAd(mark) {
|
|
showRewardAd(mark) {
|
|
|
|
+ let boo7 = this.checkAdForUserOrderForSpid17(7);
|
|
|
|
+ if (boo7) {
|
|
|
|
+ console.log('zh: VIP SPID = 7,无任何AD');
|
|
|
|
+ return false;
|
|
|
|
+ }
|
|
if (!Laya.Browser.onAndroid) {
|
|
if (!Laya.Browser.onAndroid) {
|
|
return false;
|
|
return false;
|
|
}
|
|
}
|
|
@@ -1354,7 +1426,7 @@
|
|
}
|
|
}
|
|
this.bridge.call("loginOutForApp");
|
|
this.bridge.call("loginOutForApp");
|
|
}
|
|
}
|
|
- startGgPay(token, ggSpid) {
|
|
|
|
|
|
+ startGgPay(token, ggSpid, spid) {
|
|
if (!Laya.Browser.onAndroid) {
|
|
if (!Laya.Browser.onAndroid) {
|
|
return;
|
|
return;
|
|
}
|
|
}
|
|
@@ -1364,13 +1436,14 @@
|
|
let jsonObj = {
|
|
let jsonObj = {
|
|
token: token,
|
|
token: token,
|
|
ggSpid: ggSpid,
|
|
ggSpid: ggSpid,
|
|
|
|
+ spid: spid,
|
|
spsl: 1
|
|
spsl: 1
|
|
};
|
|
};
|
|
let reqData = JSON.stringify(jsonObj);
|
|
let reqData = JSON.stringify(jsonObj);
|
|
console.log("zh:startGgPay ts reqData=" + reqData);
|
|
console.log("zh:startGgPay ts reqData=" + reqData);
|
|
this.bridge.call("startGgPay", reqData);
|
|
this.bridge.call("startGgPay", reqData);
|
|
}
|
|
}
|
|
- testPay1ForMoNiPayOver(token, ggSpid) {
|
|
|
|
|
|
+ testPay1ForMoNiPayOver(token, ggSpid, spid) {
|
|
if (!Laya.Browser.onAndroid) {
|
|
if (!Laya.Browser.onAndroid) {
|
|
return;
|
|
return;
|
|
}
|
|
}
|
|
@@ -1380,6 +1453,7 @@
|
|
let jsonObj = {
|
|
let jsonObj = {
|
|
token: token,
|
|
token: token,
|
|
ggSpid: ggSpid,
|
|
ggSpid: ggSpid,
|
|
|
|
+ spid: spid,
|
|
spsl: 1
|
|
spsl: 1
|
|
};
|
|
};
|
|
let reqData = JSON.stringify(jsonObj);
|
|
let reqData = JSON.stringify(jsonObj);
|
|
@@ -4980,53 +5054,6 @@
|
|
}
|
|
}
|
|
UIPower.uiName = "UIPower";
|
|
UIPower.uiName = "UIPower";
|
|
|
|
|
|
- class LocalStorageManager {
|
|
|
|
- test1() {
|
|
|
|
- LocalStorageManager.setItem("playerName", "Tom");
|
|
|
|
- LocalStorageManager.setItem("playerLevel", 5);
|
|
|
|
- LocalStorageManager.setItem("playerData", { score: 100, level: 3 });
|
|
|
|
- const name = LocalStorageManager.getItem("playerName");
|
|
|
|
- const level = LocalStorageManager.getItem("playerLevel");
|
|
|
|
- const data = LocalStorageManager.getItem("playerData");
|
|
|
|
- console.log(name);
|
|
|
|
- console.log(level);
|
|
|
|
- console.log(data);
|
|
|
|
- LocalStorageManager.removeItem("playerLevel");
|
|
|
|
- }
|
|
|
|
- static setItem(key, value) {
|
|
|
|
- Laya.LocalStorage.setItem(key, JSON.stringify(value));
|
|
|
|
- }
|
|
|
|
- static getItem(key) {
|
|
|
|
- const data = Laya.LocalStorage.getItem(key);
|
|
|
|
- if (data === null)
|
|
|
|
- return null;
|
|
|
|
- try {
|
|
|
|
- return JSON.parse(data);
|
|
|
|
- }
|
|
|
|
- catch (e) {
|
|
|
|
- return data;
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
- static removeItem(key) {
|
|
|
|
- Laya.LocalStorage.removeItem(key);
|
|
|
|
- }
|
|
|
|
- static clear() {
|
|
|
|
- Laya.LocalStorage.clear();
|
|
|
|
- }
|
|
|
|
- static hasJosnKey(key) {
|
|
|
|
- var value = Laya.LocalStorage.getJSON(key);
|
|
|
|
- if (value != null) {
|
|
|
|
- return true;
|
|
|
|
- }
|
|
|
|
- else {
|
|
|
|
- return false;
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
- static hasKey(key) {
|
|
|
|
- return Laya.LocalStorage.getItem(key) !== null;
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
class UILevelProp extends UIBase {
|
|
class UILevelProp extends UIBase {
|
|
constructor() {
|
|
constructor() {
|
|
super();
|
|
super();
|
|
@@ -5973,6 +6000,7 @@
|
|
this.index = 0;
|
|
this.index = 0;
|
|
this.uiIndex = 0;
|
|
this.uiIndex = 0;
|
|
this.ggSpid = "";
|
|
this.ggSpid = "";
|
|
|
|
+ this.spid = 0;
|
|
this.ui = ui;
|
|
this.ui = ui;
|
|
this.index = index;
|
|
this.index = index;
|
|
this.initData();
|
|
this.initData();
|
|
@@ -5985,15 +6013,19 @@
|
|
this.ui.n_jiaGe.text = data.spjg + "";
|
|
this.ui.n_jiaGe.text = data.spjg + "";
|
|
this.ui.n_zuanShi.text = "X" + data.zssl + "";
|
|
this.ui.n_zuanShi.text = "X" + data.zssl + "";
|
|
this.ggSpid = data.ggSpid;
|
|
this.ggSpid = data.ggSpid;
|
|
|
|
+ this.spid = data.spid;
|
|
let baseUrl = "asset/sound/ogg/";
|
|
let baseUrl = "asset/sound/ogg/";
|
|
this.ui.zsImg.url = xGame.common.getGameIconUrl(data.img);
|
|
this.ui.zsImg.url = xGame.common.getGameIconUrl(data.img);
|
|
}
|
|
}
|
|
gotoBuy() {
|
|
gotoBuy() {
|
|
- let userInfo = LocalStorageManager.getItem('userInfo');
|
|
|
|
|
|
+ let userInfo = LocalStorageManager.getItem(keyForLoginInfo);
|
|
if (userInfo != null) {
|
|
if (userInfo != null) {
|
|
let token = userInfo.token;
|
|
let token = userInfo.token;
|
|
let ggSpid = this.ggSpid;
|
|
let ggSpid = this.ggSpid;
|
|
- JSBridgeUtils.instance.startGgPay(token, ggSpid);
|
|
|
|
|
|
+ let spid = this.spid;
|
|
|
|
+ console.log('zh:gotoBuy1 ggSpid =' + ggSpid);
|
|
|
|
+ console.log('zh:gotoBuy1 spid =' + spid);
|
|
|
|
+ JSBridgeUtils.instance.startGgPay(token, ggSpid, spid);
|
|
return;
|
|
return;
|
|
}
|
|
}
|
|
else {
|
|
else {
|
|
@@ -6004,7 +6036,7 @@
|
|
xGame.soundMgr.playSound(xGame.common.btnClickStr);
|
|
xGame.soundMgr.playSound(xGame.common.btnClickStr);
|
|
let djItem = cfgTable.daoJuData[this.index + 1];
|
|
let djItem = cfgTable.daoJuData[this.index + 1];
|
|
console.log('zh:点击购买 djItem =' + JSON.stringify(djItem));
|
|
console.log('zh:点击购买 djItem =' + JSON.stringify(djItem));
|
|
- let userInfo = LocalStorageManager.getItem('userInfo');
|
|
|
|
|
|
+ let userInfo = LocalStorageManager.getItem(keyForLoginInfo);
|
|
if (userInfo == null) {
|
|
if (userInfo == null) {
|
|
xGame.uiMgr.Show(UIMsg, TIP_MSG_key.pleaseLoginIn);
|
|
xGame.uiMgr.Show(UIMsg, TIP_MSG_key.pleaseLoginIn);
|
|
return;
|
|
return;
|
|
@@ -6942,10 +6974,11 @@
|
|
let code = res.code;
|
|
let code = res.code;
|
|
let msg = res.msg;
|
|
let msg = res.msg;
|
|
if (code == 200) {
|
|
if (code == 200) {
|
|
- let keyStr = 'userInfo';
|
|
|
|
|
|
+ let keyStr = keyForLoginInfo;
|
|
let jsonStr = {
|
|
let jsonStr = {
|
|
"username": res.username,
|
|
"username": res.username,
|
|
- "token": res.token
|
|
|
|
|
|
+ "token": res.token,
|
|
|
|
+ "buySpids": { 1: false, 7: false }
|
|
};
|
|
};
|
|
LocalStorageManager.setItem(keyStr, jsonStr);
|
|
LocalStorageManager.setItem(keyStr, jsonStr);
|
|
xGame.uiMgr.Show(UIMsg, msg);
|
|
xGame.uiMgr.Show(UIMsg, msg);
|
|
@@ -7077,11 +7110,11 @@
|
|
this.hide();
|
|
this.hide();
|
|
}
|
|
}
|
|
gotoBuy() {
|
|
gotoBuy() {
|
|
- let userInfo = LocalStorageManager.getItem('userInfo');
|
|
|
|
|
|
+ let userInfo = LocalStorageManager.getItem(keyForLoginInfo);
|
|
if (userInfo != null) {
|
|
if (userInfo != null) {
|
|
let token = userInfo.token;
|
|
let token = userInfo.token;
|
|
let ggSpid = 'com.vadltq.strike.ball.cue.noads.pack';
|
|
let ggSpid = 'com.vadltq.strike.ball.cue.noads.pack';
|
|
- JSBridgeUtils.instance.startGgPay(token, ggSpid);
|
|
|
|
|
|
+ JSBridgeUtils.instance.startGgPay(token, ggSpid, 1);
|
|
return;
|
|
return;
|
|
}
|
|
}
|
|
else {
|
|
else {
|
|
@@ -7160,11 +7193,11 @@
|
|
this.hide();
|
|
this.hide();
|
|
}
|
|
}
|
|
gotoBuy() {
|
|
gotoBuy() {
|
|
- let userInfo = LocalStorageManager.getItem('userInfo');
|
|
|
|
|
|
+ let userInfo = LocalStorageManager.getItem(keyForLoginInfo);
|
|
if (userInfo != null) {
|
|
if (userInfo != null) {
|
|
let token = userInfo.token;
|
|
let token = userInfo.token;
|
|
let ggSpid = 'com.vadltq.strike.ball.cue.passcard';
|
|
let ggSpid = 'com.vadltq.strike.ball.cue.passcard';
|
|
- JSBridgeUtils.instance.startGgPay(token, ggSpid);
|
|
|
|
|
|
+ JSBridgeUtils.instance.startGgPay(token, ggSpid, 7);
|
|
return;
|
|
return;
|
|
}
|
|
}
|
|
else {
|
|
else {
|
|
@@ -7541,6 +7574,7 @@
|
|
}
|
|
}
|
|
this.c_btn_for_user();
|
|
this.c_btn_for_user();
|
|
window['nativeCallJs'] = this.nativeCallJs.bind(this);
|
|
window['nativeCallJs'] = this.nativeCallJs.bind(this);
|
|
|
|
+ this.loadUserSpOrderForAd();
|
|
}
|
|
}
|
|
Logout() {
|
|
Logout() {
|
|
if (LocalStorageManager.hasJosnKey(keyForLoginInfo)) {
|
|
if (LocalStorageManager.hasJosnKey(keyForLoginInfo)) {
|
|
@@ -7555,13 +7589,106 @@
|
|
gotoRegUser() {
|
|
gotoRegUser() {
|
|
xGame.uiMgr.Show(UIReg);
|
|
xGame.uiMgr.Show(UIReg);
|
|
}
|
|
}
|
|
- showFuLi1() {
|
|
|
|
|
|
+ showFuLiSp1() {
|
|
console.log('zh:福利1');
|
|
console.log('zh:福利1');
|
|
- xGame.uiMgr.Show(UIFuli1);
|
|
|
|
|
|
+ this.checkForShowFuLi17(1);
|
|
}
|
|
}
|
|
- showFuLi2() {
|
|
|
|
- console.log('zh:福利2');
|
|
|
|
- xGame.uiMgr.Show(UIFuli2);
|
|
|
|
|
|
+ showFuLiSp7() {
|
|
|
|
+ console.log('zh:福利7');
|
|
|
|
+ this.checkForShowFuLi17(7);
|
|
|
|
+ }
|
|
|
|
+ loadUserSpOrderForAd() {
|
|
|
|
+ let userInfo = LocalStorageManager.getItem(keyForLoginInfo);
|
|
|
|
+ if (userInfo == null) {
|
|
|
|
+ return;
|
|
|
|
+ }
|
|
|
|
+ let reqData = xGame.httpMgr.getReqData();
|
|
|
|
+ xGame.httpMgr.sendPost2025('order/getOrderListForNoChongFuBuy', reqData, (res) => {
|
|
|
|
+ try {
|
|
|
|
+ console.log('zh:loadUserSpOrderForAd res = ' + JSON.stringify(res));
|
|
|
|
+ let code = res.code;
|
|
|
|
+ let msg = res.msg;
|
|
|
|
+ if (code == 401) {
|
|
|
|
+ Laya.LocalStorage.setItem(keyForLoginInfo, null);
|
|
|
|
+ xGame.uiMgr.Show(UIMsg, TIP_MSG_key.pleaseLoginIn);
|
|
|
|
+ return;
|
|
|
|
+ }
|
|
|
|
+ if (code == 200) {
|
|
|
|
+ let data = res.data;
|
|
|
|
+ let buy_spid1 = false;
|
|
|
|
+ let buy_spid7 = false;
|
|
|
|
+ for (let index = 0; index < data.length; index++) {
|
|
|
|
+ let element = data[index];
|
|
|
|
+ console.log('zh:list element.spid = ' + element.spid);
|
|
|
|
+ if (element.spid == 1) {
|
|
|
|
+ buy_spid1 = true;
|
|
|
|
+ }
|
|
|
|
+ if (element.spid == 7) {
|
|
|
|
+ buy_spid7 = true;
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ DataMgr.updateLocalUserDataForSpid17(1, buy_spid1);
|
|
|
|
+ DataMgr.updateLocalUserDataForSpid17(7, buy_spid7);
|
|
|
|
+ }
|
|
|
|
+ else {
|
|
|
|
+ xGame.uiMgr.Show(UIMsg, msg);
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ catch (error) {
|
|
|
|
+ console.log('error=' + error);
|
|
|
|
+ alert(error);
|
|
|
|
+ }
|
|
|
|
+ finally {
|
|
|
|
+ }
|
|
|
|
+ });
|
|
|
|
+ }
|
|
|
|
+ checkForShowFuLi17(spid) {
|
|
|
|
+ let userInfo = LocalStorageManager.getItem(keyForLoginInfo);
|
|
|
|
+ if (userInfo == null) {
|
|
|
|
+ console.log('zh:没有登录就不显示福利弹框了');
|
|
|
|
+ return;
|
|
|
|
+ }
|
|
|
|
+ console.log('zh:是否需要展示福利 ' + spid + ' 的弹窗');
|
|
|
|
+ let reqData = xGame.httpMgr.getReqData();
|
|
|
|
+ let pd = JSON.parse(reqData);
|
|
|
|
+ pd.productId = spid;
|
|
|
|
+ reqData = JSON.stringify(pd);
|
|
|
|
+ xGame.httpMgr.sendPost2025('order/checkBuyFuLi', reqData, (res) => {
|
|
|
|
+ try {
|
|
|
|
+ console.log('zh:checkForShowFuLi17 res = ' + JSON.stringify(res));
|
|
|
|
+ let code = res.code;
|
|
|
|
+ let msg = res.msg;
|
|
|
|
+ if (code == 401) {
|
|
|
|
+ Laya.LocalStorage.setItem(keyForLoginInfo, null);
|
|
|
|
+ xGame.uiMgr.Show(UIMsg, TIP_MSG_key.pleaseLoginIn);
|
|
|
|
+ return;
|
|
|
|
+ }
|
|
|
|
+ if (code == 200) {
|
|
|
|
+ let isBuyOk = res.data;
|
|
|
|
+ DataMgr.updateLocalUserDataForSpid17(spid, isBuyOk);
|
|
|
|
+ if (isBuyOk === false) {
|
|
|
|
+ if (spid === 1) {
|
|
|
|
+ xGame.uiMgr.Show(UIFuli1);
|
|
|
|
+ }
|
|
|
|
+ if (spid === 7) {
|
|
|
|
+ xGame.uiMgr.Show(UIFuli2);
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ else {
|
|
|
|
+ console.log('zh:已经购买了SPID=' + spid + ',不需要再提示用户了');
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ else {
|
|
|
|
+ xGame.uiMgr.Show(UIMsg, msg);
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ catch (error) {
|
|
|
|
+ console.log('error=' + error);
|
|
|
|
+ alert(error);
|
|
|
|
+ }
|
|
|
|
+ finally {
|
|
|
|
+ }
|
|
|
|
+ });
|
|
}
|
|
}
|
|
c_btn_for_user() {
|
|
c_btn_for_user() {
|
|
this.ui.n_Logout.visible = false;
|
|
this.ui.n_Logout.visible = false;
|
|
@@ -7614,11 +7741,12 @@
|
|
this.addUIClick(this.ui.n_Logout, this.Logout);
|
|
this.addUIClick(this.ui.n_Logout, this.Logout);
|
|
this.addUIClick(this.ui.n_dengLu, this.gotoLogin);
|
|
this.addUIClick(this.ui.n_dengLu, this.gotoLogin);
|
|
this.addUIClick(this.ui.n_zhuCe, this.gotoRegUser);
|
|
this.addUIClick(this.ui.n_zhuCe, this.gotoRegUser);
|
|
- this.addUIClick(this.ui.n_fuli, this.showFuLi2);
|
|
|
|
|
|
+ this.addUIClick(this.ui.n_fuli, this.showFuLiSp7);
|
|
this.addUIClick(this.ui.n_moni_pay_ok, this.start_debug_for_moni_payOk);
|
|
this.addUIClick(this.ui.n_moni_pay_ok, this.start_debug_for_moni_payOk);
|
|
}
|
|
}
|
|
show(showFailWords) {
|
|
show(showFailWords) {
|
|
super.show();
|
|
super.show();
|
|
|
|
+ this.loadUserSpOrderForAd();
|
|
this.moneyNode.ui.c1.selectedIndex = 1;
|
|
this.moneyNode.ui.c1.selectedIndex = 1;
|
|
this.playSecretaryIdle();
|
|
this.playSecretaryIdle();
|
|
xGame.soundMgr.playMusic("caromhall01", 0);
|
|
xGame.soundMgr.playMusic("caromhall01", 0);
|
|
@@ -7656,10 +7784,6 @@
|
|
}
|
|
}
|
|
Laya.timer.once(randTime, this, () => {
|
|
Laya.timer.once(randTime, this, () => {
|
|
});
|
|
});
|
|
- Laya.timer.once(1000, this, () => {
|
|
|
|
- console.log('zh: 1秒后 showFuLi1');
|
|
|
|
- this.showFuLi1();
|
|
|
|
- });
|
|
|
|
}
|
|
}
|
|
}
|
|
}
|
|
checkActive(show) {
|
|
checkActive(show) {
|
|
@@ -7797,16 +7921,17 @@
|
|
});
|
|
});
|
|
}
|
|
}
|
|
start_debug_for_moni_payOk() {
|
|
start_debug_for_moni_payOk() {
|
|
- console.log('zh:start_debug_for_moni_payOk 111');
|
|
|
|
- let userInfo = LocalStorageManager.getItem('userInfo');
|
|
|
|
|
|
+ console.log('zh:start_debug_for_moni_payOk');
|
|
|
|
+ let userInfo = LocalStorageManager.getItem(keyForLoginInfo);
|
|
if (userInfo != null) {
|
|
if (userInfo != null) {
|
|
let token = userInfo.token;
|
|
let token = userInfo.token;
|
|
let ggSpid = 'com.vadltq.strike.ball.cue.gem50';
|
|
let ggSpid = 'com.vadltq.strike.ball.cue.gem50';
|
|
- JSBridgeUtils.instance.testPay1ForMoNiPayOver(token, ggSpid);
|
|
|
|
|
|
+ JSBridgeUtils.instance.testPay1ForMoNiPayOver(token, ggSpid, 1);
|
|
|
|
+ alert('模拟支付OK');
|
|
return;
|
|
return;
|
|
}
|
|
}
|
|
else {
|
|
else {
|
|
- alert(TIP_MSG_key.pleaseLoginIn);
|
|
|
|
|
|
+ xGame.uiMgr.Show(UIMsg, TIP_MSG_key.pleaseLoginIn);
|
|
}
|
|
}
|
|
}
|
|
}
|
|
startGlobal() {
|
|
startGlobal() {
|
|
@@ -18950,6 +19075,22 @@
|
|
}
|
|
}
|
|
});
|
|
});
|
|
}
|
|
}
|
|
|
|
+ static updateLocalUserDataForSpid17(spid, isBuyOk) {
|
|
|
|
+ let userInfo = LocalStorageManager.getItem(keyForLoginInfo);
|
|
|
|
+ console.log('zh:updateLocalUserData=' + userInfo);
|
|
|
|
+ if (userInfo != null) {
|
|
|
|
+ if (!userInfo.buySpids) {
|
|
|
|
+ userInfo.buySpids = { 1: false, 7: false };
|
|
|
|
+ }
|
|
|
|
+ else {
|
|
|
|
+ console.log('zh:检查 userInfo.buySpidsX[' + spid + '] ' + userInfo.buySpids[spid]);
|
|
|
|
+ }
|
|
|
|
+ userInfo.buySpids[spid] = isBuyOk;
|
|
|
|
+ LocalStorageManager.setItem(keyForLoginInfo, userInfo);
|
|
|
|
+ }
|
|
|
|
+ else {
|
|
|
|
+ }
|
|
|
|
+ }
|
|
}
|
|
}
|
|
DataMgr.isNewUser = false;
|
|
DataMgr.isNewUser = false;
|
|
DataMgr.fristEnter = true;
|
|
DataMgr.fristEnter = true;
|
|
@@ -23039,6 +23180,7 @@
|
|
this.index = 0;
|
|
this.index = 0;
|
|
this.uiIndex = 0;
|
|
this.uiIndex = 0;
|
|
this.ggSpid = "";
|
|
this.ggSpid = "";
|
|
|
|
+ this.spid = 0;
|
|
this.ui = ui;
|
|
this.ui = ui;
|
|
this.index = index;
|
|
this.index = index;
|
|
this.initData();
|
|
this.initData();
|
|
@@ -23051,15 +23193,19 @@
|
|
this.ui.n_jiaGe.text = data.spjg + "";
|
|
this.ui.n_jiaGe.text = data.spjg + "";
|
|
this.ui.n_zuanShi.text = "X" + data.zssl + "";
|
|
this.ui.n_zuanShi.text = "X" + data.zssl + "";
|
|
this.ggSpid = data.ggSpid;
|
|
this.ggSpid = data.ggSpid;
|
|
|
|
+ this.spid = data.spid;
|
|
let baseUrl = "asset/sound/ogg/";
|
|
let baseUrl = "asset/sound/ogg/";
|
|
this.ui.zsImg.url = xGame.common.getGameIconUrl(data.img);
|
|
this.ui.zsImg.url = xGame.common.getGameIconUrl(data.img);
|
|
}
|
|
}
|
|
gotoBuy() {
|
|
gotoBuy() {
|
|
- let userInfo = LocalStorageManager.getItem('userInfo');
|
|
|
|
|
|
+ let userInfo = LocalStorageManager.getItem(keyForLoginInfo);
|
|
if (userInfo != null) {
|
|
if (userInfo != null) {
|
|
let token = userInfo.token;
|
|
let token = userInfo.token;
|
|
let ggSpid = this.ggSpid;
|
|
let ggSpid = this.ggSpid;
|
|
- JSBridgeUtils.instance.startGgPay(token, ggSpid);
|
|
|
|
|
|
+ let spid = this.spid;
|
|
|
|
+ console.log('zh:gotoBuy1 ggSpid =' + ggSpid);
|
|
|
|
+ console.log('zh:gotoBuy1 spid =' + spid);
|
|
|
|
+ JSBridgeUtils.instance.startGgPay(token, ggSpid, spid);
|
|
return;
|
|
return;
|
|
}
|
|
}
|
|
else {
|
|
else {
|
|
@@ -23070,7 +23216,7 @@
|
|
xGame.soundMgr.playSound(xGame.common.btnClickStr);
|
|
xGame.soundMgr.playSound(xGame.common.btnClickStr);
|
|
let djItem = cfgTable.daoJuData[this.index + 1];
|
|
let djItem = cfgTable.daoJuData[this.index + 1];
|
|
console.log('zh:点击购买 djItem =' + JSON.stringify(djItem));
|
|
console.log('zh:点击购买 djItem =' + JSON.stringify(djItem));
|
|
- let userInfo = LocalStorageManager.getItem('userInfo');
|
|
|
|
|
|
+ let userInfo = LocalStorageManager.getItem(keyForLoginInfo);
|
|
if (userInfo == null) {
|
|
if (userInfo == null) {
|
|
xGame.uiMgr.Show(UIMsg$1, TIP_MSG_key.pleaseLoginIn);
|
|
xGame.uiMgr.Show(UIMsg$1, TIP_MSG_key.pleaseLoginIn);
|
|
return;
|
|
return;
|
|
@@ -23638,10 +23784,11 @@
|
|
let code = res.code;
|
|
let code = res.code;
|
|
let msg = res.msg;
|
|
let msg = res.msg;
|
|
if (code == 200) {
|
|
if (code == 200) {
|
|
- let keyStr = 'userInfo';
|
|
|
|
|
|
+ let keyStr = keyForLoginInfo;
|
|
let jsonStr = {
|
|
let jsonStr = {
|
|
"username": res.username,
|
|
"username": res.username,
|
|
- "token": res.token
|
|
|
|
|
|
+ "token": res.token,
|
|
|
|
+ "buySpids": { 1: false, 7: false }
|
|
};
|
|
};
|
|
LocalStorageManager.setItem(keyStr, jsonStr);
|
|
LocalStorageManager.setItem(keyStr, jsonStr);
|
|
xGame.uiMgr.Show(UIMsg$1, msg);
|
|
xGame.uiMgr.Show(UIMsg$1, msg);
|
|
@@ -23762,11 +23909,11 @@
|
|
this.hide();
|
|
this.hide();
|
|
}
|
|
}
|
|
gotoBuy() {
|
|
gotoBuy() {
|
|
- let userInfo = LocalStorageManager.getItem('userInfo');
|
|
|
|
|
|
+ let userInfo = LocalStorageManager.getItem(keyForLoginInfo);
|
|
if (userInfo != null) {
|
|
if (userInfo != null) {
|
|
let token = userInfo.token;
|
|
let token = userInfo.token;
|
|
let ggSpid = 'com.vadltq.strike.ball.cue.noads.pack';
|
|
let ggSpid = 'com.vadltq.strike.ball.cue.noads.pack';
|
|
- JSBridgeUtils.instance.startGgPay(token, ggSpid);
|
|
|
|
|
|
+ JSBridgeUtils.instance.startGgPay(token, ggSpid, 1);
|
|
return;
|
|
return;
|
|
}
|
|
}
|
|
else {
|
|
else {
|
|
@@ -23834,11 +23981,11 @@
|
|
this.hide();
|
|
this.hide();
|
|
}
|
|
}
|
|
gotoBuy() {
|
|
gotoBuy() {
|
|
- let userInfo = LocalStorageManager.getItem('userInfo');
|
|
|
|
|
|
+ let userInfo = LocalStorageManager.getItem(keyForLoginInfo);
|
|
if (userInfo != null) {
|
|
if (userInfo != null) {
|
|
let token = userInfo.token;
|
|
let token = userInfo.token;
|
|
let ggSpid = 'com.vadltq.strike.ball.cue.passcard';
|
|
let ggSpid = 'com.vadltq.strike.ball.cue.passcard';
|
|
- JSBridgeUtils.instance.startGgPay(token, ggSpid);
|
|
|
|
|
|
+ JSBridgeUtils.instance.startGgPay(token, ggSpid, 7);
|
|
return;
|
|
return;
|
|
}
|
|
}
|
|
else {
|
|
else {
|
|
@@ -24301,6 +24448,7 @@
|
|
}
|
|
}
|
|
this.c_btn_for_user();
|
|
this.c_btn_for_user();
|
|
window['nativeCallJs'] = this.nativeCallJs.bind(this);
|
|
window['nativeCallJs'] = this.nativeCallJs.bind(this);
|
|
|
|
+ this.loadUserSpOrderForAd();
|
|
}
|
|
}
|
|
Logout() {
|
|
Logout() {
|
|
if (LocalStorageManager.hasJosnKey(keyForLoginInfo)) {
|
|
if (LocalStorageManager.hasJosnKey(keyForLoginInfo)) {
|
|
@@ -24315,13 +24463,106 @@
|
|
gotoRegUser() {
|
|
gotoRegUser() {
|
|
xGame.uiMgr.Show(UIReg$1);
|
|
xGame.uiMgr.Show(UIReg$1);
|
|
}
|
|
}
|
|
- showFuLi1() {
|
|
|
|
|
|
+ showFuLiSp1() {
|
|
console.log('zh:福利1');
|
|
console.log('zh:福利1');
|
|
- xGame.uiMgr.Show(UIFuli1$1);
|
|
|
|
|
|
+ this.checkForShowFuLi17(1);
|
|
|
|
+ }
|
|
|
|
+ showFuLiSp7() {
|
|
|
|
+ console.log('zh:福利7');
|
|
|
|
+ this.checkForShowFuLi17(7);
|
|
|
|
+ }
|
|
|
|
+ loadUserSpOrderForAd() {
|
|
|
|
+ let userInfo = LocalStorageManager.getItem(keyForLoginInfo);
|
|
|
|
+ if (userInfo == null) {
|
|
|
|
+ return;
|
|
|
|
+ }
|
|
|
|
+ let reqData = xGame.httpMgr.getReqData();
|
|
|
|
+ xGame.httpMgr.sendPost2025('order/getOrderListForNoChongFuBuy', reqData, (res) => {
|
|
|
|
+ try {
|
|
|
|
+ console.log('zh:loadUserSpOrderForAd res = ' + JSON.stringify(res));
|
|
|
|
+ let code = res.code;
|
|
|
|
+ let msg = res.msg;
|
|
|
|
+ if (code == 401) {
|
|
|
|
+ Laya.LocalStorage.setItem(keyForLoginInfo, null);
|
|
|
|
+ xGame.uiMgr.Show(UIMsg$1, TIP_MSG_key.pleaseLoginIn);
|
|
|
|
+ return;
|
|
|
|
+ }
|
|
|
|
+ if (code == 200) {
|
|
|
|
+ let data = res.data;
|
|
|
|
+ let buy_spid1 = false;
|
|
|
|
+ let buy_spid7 = false;
|
|
|
|
+ for (let index = 0; index < data.length; index++) {
|
|
|
|
+ let element = data[index];
|
|
|
|
+ console.log('zh:list element.spid = ' + element.spid);
|
|
|
|
+ if (element.spid == 1) {
|
|
|
|
+ buy_spid1 = true;
|
|
|
|
+ }
|
|
|
|
+ if (element.spid == 7) {
|
|
|
|
+ buy_spid7 = true;
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ DataMgr.updateLocalUserDataForSpid17(1, buy_spid1);
|
|
|
|
+ DataMgr.updateLocalUserDataForSpid17(7, buy_spid7);
|
|
|
|
+ }
|
|
|
|
+ else {
|
|
|
|
+ xGame.uiMgr.Show(UIMsg$1, msg);
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ catch (error) {
|
|
|
|
+ console.log('error=' + error);
|
|
|
|
+ alert(error);
|
|
|
|
+ }
|
|
|
|
+ finally {
|
|
|
|
+ }
|
|
|
|
+ });
|
|
}
|
|
}
|
|
- showFuLi2() {
|
|
|
|
- console.log('zh:福利2');
|
|
|
|
- xGame.uiMgr.Show(UIFuli2$1);
|
|
|
|
|
|
+ checkForShowFuLi17(spid) {
|
|
|
|
+ let userInfo = LocalStorageManager.getItem(keyForLoginInfo);
|
|
|
|
+ if (userInfo == null) {
|
|
|
|
+ console.log('zh:没有登录就不显示福利弹框了');
|
|
|
|
+ return;
|
|
|
|
+ }
|
|
|
|
+ console.log('zh:是否需要展示福利 ' + spid + ' 的弹窗');
|
|
|
|
+ let reqData = xGame.httpMgr.getReqData();
|
|
|
|
+ let pd = JSON.parse(reqData);
|
|
|
|
+ pd.productId = spid;
|
|
|
|
+ reqData = JSON.stringify(pd);
|
|
|
|
+ xGame.httpMgr.sendPost2025('order/checkBuyFuLi', reqData, (res) => {
|
|
|
|
+ try {
|
|
|
|
+ console.log('zh:checkForShowFuLi17 res = ' + JSON.stringify(res));
|
|
|
|
+ let code = res.code;
|
|
|
|
+ let msg = res.msg;
|
|
|
|
+ if (code == 401) {
|
|
|
|
+ Laya.LocalStorage.setItem(keyForLoginInfo, null);
|
|
|
|
+ xGame.uiMgr.Show(UIMsg$1, TIP_MSG_key.pleaseLoginIn);
|
|
|
|
+ return;
|
|
|
|
+ }
|
|
|
|
+ if (code == 200) {
|
|
|
|
+ let isBuyOk = res.data;
|
|
|
|
+ DataMgr.updateLocalUserDataForSpid17(spid, isBuyOk);
|
|
|
|
+ if (isBuyOk === false) {
|
|
|
|
+ if (spid === 1) {
|
|
|
|
+ xGame.uiMgr.Show(UIFuli1$1);
|
|
|
|
+ }
|
|
|
|
+ if (spid === 7) {
|
|
|
|
+ xGame.uiMgr.Show(UIFuli2$1);
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ else {
|
|
|
|
+ console.log('zh:已经购买了SPID=' + spid + ',不需要再提示用户了');
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ else {
|
|
|
|
+ xGame.uiMgr.Show(UIMsg$1, msg);
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ catch (error) {
|
|
|
|
+ console.log('error=' + error);
|
|
|
|
+ alert(error);
|
|
|
|
+ }
|
|
|
|
+ finally {
|
|
|
|
+ }
|
|
|
|
+ });
|
|
}
|
|
}
|
|
c_btn_for_user() {
|
|
c_btn_for_user() {
|
|
this.ui.n_Logout.visible = false;
|
|
this.ui.n_Logout.visible = false;
|
|
@@ -24374,11 +24615,12 @@
|
|
this.addUIClick(this.ui.n_Logout, this.Logout);
|
|
this.addUIClick(this.ui.n_Logout, this.Logout);
|
|
this.addUIClick(this.ui.n_dengLu, this.gotoLogin);
|
|
this.addUIClick(this.ui.n_dengLu, this.gotoLogin);
|
|
this.addUIClick(this.ui.n_zhuCe, this.gotoRegUser);
|
|
this.addUIClick(this.ui.n_zhuCe, this.gotoRegUser);
|
|
- this.addUIClick(this.ui.n_fuli, this.showFuLi2);
|
|
|
|
|
|
+ this.addUIClick(this.ui.n_fuli, this.showFuLiSp7);
|
|
this.addUIClick(this.ui.n_moni_pay_ok, this.start_debug_for_moni_payOk);
|
|
this.addUIClick(this.ui.n_moni_pay_ok, this.start_debug_for_moni_payOk);
|
|
}
|
|
}
|
|
show(showFailWords) {
|
|
show(showFailWords) {
|
|
super.show();
|
|
super.show();
|
|
|
|
+ this.loadUserSpOrderForAd();
|
|
this.moneyNode.ui.c1.selectedIndex = 1;
|
|
this.moneyNode.ui.c1.selectedIndex = 1;
|
|
this.playSecretaryIdle();
|
|
this.playSecretaryIdle();
|
|
xGame.soundMgr.playMusic("caromhall01", 0);
|
|
xGame.soundMgr.playMusic("caromhall01", 0);
|
|
@@ -24416,10 +24658,6 @@
|
|
}
|
|
}
|
|
Laya.timer.once(randTime, this, () => {
|
|
Laya.timer.once(randTime, this, () => {
|
|
});
|
|
});
|
|
- Laya.timer.once(1000, this, () => {
|
|
|
|
- console.log('zh: 1秒后 showFuLi1');
|
|
|
|
- this.showFuLi1();
|
|
|
|
- });
|
|
|
|
}
|
|
}
|
|
}
|
|
}
|
|
checkActive(show) {
|
|
checkActive(show) {
|
|
@@ -24557,16 +24795,17 @@
|
|
});
|
|
});
|
|
}
|
|
}
|
|
start_debug_for_moni_payOk() {
|
|
start_debug_for_moni_payOk() {
|
|
- console.log('zh:start_debug_for_moni_payOk 111');
|
|
|
|
- let userInfo = LocalStorageManager.getItem('userInfo');
|
|
|
|
|
|
+ console.log('zh:start_debug_for_moni_payOk');
|
|
|
|
+ let userInfo = LocalStorageManager.getItem(keyForLoginInfo);
|
|
if (userInfo != null) {
|
|
if (userInfo != null) {
|
|
let token = userInfo.token;
|
|
let token = userInfo.token;
|
|
let ggSpid = 'com.vadltq.strike.ball.cue.gem50';
|
|
let ggSpid = 'com.vadltq.strike.ball.cue.gem50';
|
|
- JSBridgeUtils.instance.testPay1ForMoNiPayOver(token, ggSpid);
|
|
|
|
|
|
+ JSBridgeUtils.instance.testPay1ForMoNiPayOver(token, ggSpid, 1);
|
|
|
|
+ alert('模拟支付OK');
|
|
return;
|
|
return;
|
|
}
|
|
}
|
|
else {
|
|
else {
|
|
- alert(TIP_MSG_key.pleaseLoginIn);
|
|
|
|
|
|
+ xGame.uiMgr.Show(UIMsg$1, TIP_MSG_key.pleaseLoginIn);
|
|
}
|
|
}
|
|
}
|
|
}
|
|
startGlobal() {
|
|
startGlobal() {
|