|
@@ -1,6 +1,6 @@
|
|
|
import SpineMgr from "../core/mgrs/SpineMgr";
|
|
|
import DataMgr from "../data/DataMgr";
|
|
|
-import { CHANGE_SECRETARY, GameMode, GET_USER_INFO, RESTART_GAME, keyForLoginInfo, TIP_MSG_key, LOGIN_OUT, LOGIN_IN } from "../data/Define";
|
|
|
+import { CHANGE_SECRETARY, GameMode, GET_USER_INFO, RESTART_GAME, keyForLoginInfo, TIP_MSG_key, LOGIN_OUT, LOGIN_IN, TipsType } from "../data/Define";
|
|
|
import UIBase from "../fgui/core/UIBase";
|
|
|
import ui_UIMain from "../fgui/res/game/ui_UIMain";
|
|
|
import PlatMgr from "../game/PlatMgr";
|
|
@@ -37,7 +37,7 @@ import UIAddCoin from "./UIAddCoin";
|
|
|
import { NoInternetDialog } from "./NoInternetDialog";
|
|
|
//import NetCheckTool from "../utils/NetCheckTool";
|
|
|
import { LocalStorageManager } from "../utils/LocalStorageManager";
|
|
|
-
|
|
|
+import UITips from "../ui/UITips";
|
|
|
|
|
|
|
|
|
export default class UIMain extends UIBase {
|
|
@@ -226,6 +226,9 @@ export default class UIMain extends UIBase {
|
|
|
DataMgr.setPlaceBallLevelList("");
|
|
|
DataMgr.setChallengeMode_overLev(1);
|
|
|
this.setDefaultSignData();
|
|
|
+ DataMgr.setBigSkillFormServer('[1, 1, 1, 1, 1]');//初始值
|
|
|
+
|
|
|
+
|
|
|
}
|
|
|
/**
|
|
|
* 默认签到数据
|
|
@@ -280,124 +283,14 @@ export default class UIMain extends UIBase {
|
|
|
}
|
|
|
showFuLiSp1() {
|
|
|
console.log('zh:福利1');
|
|
|
- this.checkForShowFuLi17(1);
|
|
|
+ DataMgr.checkForShowFuLi17AndAlert(1)
|
|
|
}
|
|
|
showFuLiSp7() {
|
|
|
console.log('zh:福利7');
|
|
|
- this.checkForShowFuLi17(7);
|
|
|
+ DataMgr.checkForShowFuLi17AndAlert(7)
|
|
|
}
|
|
|
|
|
|
|
|
|
- /**
|
|
|
- *
|
|
|
- * @param spid 商品ID ,于数据库里的一致
|
|
|
- * @returns
|
|
|
- */
|
|
|
- checkForShowFuLi17(alert_spid: number) {
|
|
|
- let userInfo = LocalStorageManager.getItem(keyForLoginInfo);
|
|
|
- if (userInfo == null) {
|
|
|
- if (alert_spid === 1) {
|
|
|
- xGame.uiMgr.Show(UIFuli1);
|
|
|
- } if (alert_spid === 7) {
|
|
|
- xGame.uiMgr.Show(UIFuli2);
|
|
|
- }
|
|
|
- return;
|
|
|
- }
|
|
|
- console.log('zh:是否需要展示福利 ' + alert_spid + ' 的弹窗');
|
|
|
- let reqData = xGame.httpMgr.getReqData();
|
|
|
- let pd: any = JSON.parse(reqData);
|
|
|
- pd.productId = alert_spid;
|
|
|
- reqData = JSON.stringify(pd);
|
|
|
- xGame.httpMgr.sendPost2025('order/getOrderForBuyFuLiSpid17', reqData, (res) => {
|
|
|
- try {
|
|
|
-
|
|
|
- let code = res.code;
|
|
|
- let msg = res.msg;
|
|
|
- if (code == 401) {
|
|
|
- Laya.LocalStorage.removeItem(keyForLoginInfo);
|
|
|
- xGame.uiMgr.Show(UIMsg, TIP_MSG_key.pleaseLoginIn)
|
|
|
- return;
|
|
|
- }
|
|
|
- if (code == 200) {
|
|
|
- let data = res.data;
|
|
|
- //data 示例数据 {"msg":"操作成功","code":200,"data":[{"createBy":"","createTime":"2025-07-22 18:02:11","updateBy":"","updateTime":null,"remark":null,"orderId":51,"userId":112,"spid":1,"ggSpid":"com.vadltq.strike.ball.cue.noads.pack","ggOrderId":"DEBUG-NO202507221801566770","spsl":1,"ddjg":4.99,"ddzt":"1","delFlag":"0"},{"createBy":"","createTime":"2025-07-22 18:27:52","updateBy":"","updateTime":null,"remark":null,"orderId":52,"userId":112,"spid":7,"ggSpid":"com.vadltq.strike.ball.cue.passcard","ggOrderId":"DEBUG-NO202507221827494178","spsl":1,"ddjg":14.99,"ddzt":"1","delFlag":"0"}]}
|
|
|
- let buyOkSpid: number[] = [];
|
|
|
- for (let i = 0; i < data.length; i++) {
|
|
|
- let item = data[i];
|
|
|
- let temp_spid = item.spid;//这里只要查出来就是已经购买的
|
|
|
- DataMgr.updateLocalUserDataForSpid17(temp_spid, true);
|
|
|
- buyOkSpid.push(temp_spid);
|
|
|
- }
|
|
|
- let isBuyOk7 = buyOkSpid.indexOf(7) >= 0 ? true : false;
|
|
|
- if (isBuyOk7) { //如果购买了SPID = 7的则不现实任何福利弹窗
|
|
|
- return;
|
|
|
- }
|
|
|
- let isBuyOk = buyOkSpid.indexOf(alert_spid) >= 0 ? true : false;
|
|
|
- if (isBuyOk && alert_spid === 1) {
|
|
|
- return;
|
|
|
- } else {
|
|
|
- if (isBuyOk === false) {//如果没有
|
|
|
- if (alert_spid === 1) {
|
|
|
- xGame.uiMgr.Show(UIFuli1);
|
|
|
- } if (alert_spid === 7) {
|
|
|
- xGame.uiMgr.Show(UIFuli2);
|
|
|
- }
|
|
|
- } else {
|
|
|
- console.log('zh:已经购买了SPID=' + alert_spid + ',不需要再提示用户了')
|
|
|
- }
|
|
|
- }
|
|
|
- } else {
|
|
|
- xGame.uiMgr.Show(UIMsg, msg);
|
|
|
- }
|
|
|
- } catch (error) {
|
|
|
- console.log('error=' + error);
|
|
|
- alert(error);
|
|
|
- } finally {
|
|
|
-
|
|
|
- }
|
|
|
- });
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
- // 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.removeItem(keyForLoginInfo);
|
|
|
- // xGame.uiMgr.Show(UIMsg, TIP_MSG_key.pleaseLoginIn)
|
|
|
- // return;
|
|
|
- // }
|
|
|
- // if (code == 200) {//{"msg":"Please do not repeat the purchase.","code":200,"data":0}
|
|
|
- // let isBuyOk = res.data;//true 表示已经购买
|
|
|
- // 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 {
|
|
|
-
|
|
|
- // }
|
|
|
- // });
|
|
|
- }
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
/**
|
|
|
* 登录注册退出
|
|
|
*/
|
|
@@ -458,6 +351,9 @@ export default class UIMain extends UIBase {
|
|
|
this.addUIClick(this.ui.drawBtn, this.openDrawView);
|
|
|
this.addUIClick(this.ui.rankBtn, this.openRanking);
|
|
|
|
|
|
+ //那個小手
|
|
|
+ this.addUIClick(this.ui.n73,this.startGame, [GameMode.bigMove]);
|
|
|
+
|
|
|
//退出登录
|
|
|
this.addUIClick(this.ui.n_dengLu, this.gotoLogin);
|
|
|
// this.addUIClick(this.ui.n_fuli, this.showFuLiSp7);
|
|
@@ -525,20 +421,42 @@ export default class UIMain extends UIBase {
|
|
|
// xGame.common.autoPopUIView();
|
|
|
})
|
|
|
|
|
|
- Laya.timer.once(1000, this, () => {
|
|
|
- console.log('zh: 1秒后 showFuLiSp1')
|
|
|
- this.showFuLiSp1();
|
|
|
- })
|
|
|
+ // Laya.timer.once(1000, this, () => {
|
|
|
+ // console.log('zh: 1秒后 showFuLiSp1')
|
|
|
+ // this.showFuLiSp1();
|
|
|
+ // })
|
|
|
|
|
|
|
|
|
- Laya.timer.once(10000, this, () => {
|
|
|
- console.log('zh: 10秒后 showFuLiSp1')
|
|
|
+ Laya.timer.once(1000, this, () => {
|
|
|
+ console.log('zh: 1秒后 showFuLiSp7')
|
|
|
this.showFuLiSp7();
|
|
|
})
|
|
|
+
|
|
|
+ //引导登录
|
|
|
+ this.showTipForGuest();
|
|
|
}
|
|
|
|
|
|
this.setGlobalFont(this.ui)
|
|
|
}
|
|
|
+
|
|
|
+
|
|
|
+ showTipForGuest() {
|
|
|
+ let userInfo = LocalStorageManager.getItem(keyForLoginInfo);
|
|
|
+ if (userInfo == null) {
|
|
|
+ console.log('zh: 游客模式下数据可能丢失,建议登录账号')
|
|
|
+ //游客模式下数据可能丢失,建议登录账号
|
|
|
+ //JSBridgeUtils.instance.showToast2('Data may be lost in guest mode. Logging in is recommended.');
|
|
|
+
|
|
|
+
|
|
|
+ let tips = "Data may be lost in guest mode. Logging in is recommended."
|
|
|
+ let woman = "this is an important notice."
|
|
|
+ xGame.uiMgr.Show(UITips, tips, woman, TipsType.foul);
|
|
|
+
|
|
|
+
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
checkActive(show) {
|
|
|
//console.log("是否处于最外层",show);
|
|
|
//wx banner太大
|
|
@@ -563,6 +481,7 @@ export default class UIMain extends UIBase {
|
|
|
this.ui.secretaryGuide.visible = false;
|
|
|
this.ui.enterGuide.visible = true;
|
|
|
this.ui.wordsNode.t0.play();
|
|
|
+
|
|
|
//todo
|
|
|
if (DataMgr.getNewUser()) Moyu.sendDataEvent("gameReady");
|
|
|
}
|
|
@@ -701,24 +620,32 @@ export default class UIMain extends UIBase {
|
|
|
});
|
|
|
}
|
|
|
|
|
|
+ private moni_click_count: number = 0;
|
|
|
+
|
|
|
|
|
|
/**
|
|
|
* 模拟支付OK
|
|
|
* @returns
|
|
|
*/
|
|
|
start_debug_for_moni_payOk() {
|
|
|
- console.log('zh:start_debug_for_moni_payOk')
|
|
|
- let userInfo = LocalStorageManager.getItem(keyForLoginInfo);
|
|
|
- if (userInfo != null) {
|
|
|
- let token = userInfo.token;
|
|
|
- let ggSpid = 'com.vadltq.strike.ball.cue.gem50';
|
|
|
- JSBridgeUtils.instance.testPay1ForMoNiPayOver(token, ggSpid, 1);
|
|
|
- alert('模拟支付OK')
|
|
|
-
|
|
|
- return;
|
|
|
- } else {
|
|
|
- xGame.uiMgr.Show(UIMsg, TIP_MSG_key.pleaseLoginIn);
|
|
|
+ let ccc = this.moni_click_count + 1;
|
|
|
+ this.moni_click_count = ccc;
|
|
|
+
|
|
|
+ if (ccc % 5 == 0) {
|
|
|
+ console.log('zh:start_debug_for_moni_payOk')
|
|
|
+ let userInfo = LocalStorageManager.getItem(keyForLoginInfo);
|
|
|
+ if (userInfo != null) {
|
|
|
+ let token = userInfo.token;
|
|
|
+ let ggSpid = 'com.vadltq.strike.ball.cue.gem50';
|
|
|
+ JSBridgeUtils.instance.testPay1ForMoNiPayOver(token, ggSpid, 1);
|
|
|
+ alert('模拟支付OK')
|
|
|
+
|
|
|
+ return;
|
|
|
+ } else {
|
|
|
+ xGame.uiMgr.Show(UIMsg, TIP_MSG_key.pleaseLoginIn);
|
|
|
+ }
|
|
|
}
|
|
|
+
|
|
|
}
|
|
|
|
|
|
|