|
@@ -293,48 +293,58 @@ export default class UIMain extends UIBase {
|
|
|
* @param spid 商品ID ,于数据库里的一致
|
|
|
* @returns
|
|
|
*/
|
|
|
- checkForShowFuLi17(spid: number) {
|
|
|
- // let userInfo = LocalStorageManager.getItem(keyForLoginInfo);
|
|
|
- // if (userInfo == null) {
|
|
|
- // console.log('zh:没有登录就不显示福利弹框了');
|
|
|
- // return;
|
|
|
- // }
|
|
|
-
|
|
|
+ checkForShowFuLi17(alert_spid: number) {
|
|
|
let userInfo = LocalStorageManager.getItem(keyForLoginInfo);
|
|
|
if (userInfo == null) {
|
|
|
- if (spid === 1) {
|
|
|
+ if (alert_spid === 1) {
|
|
|
xGame.uiMgr.Show(UIFuli1);
|
|
|
- } if (spid === 7) {
|
|
|
+ } if (alert_spid === 7) {
|
|
|
xGame.uiMgr.Show(UIFuli2);
|
|
|
}
|
|
|
return;
|
|
|
}
|
|
|
- console.log('zh:是否需要展示福利 ' + spid + ' 的弹窗');
|
|
|
+ console.log('zh:是否需要展示福利 ' + alert_spid + ' 的弹窗');
|
|
|
let reqData = xGame.httpMgr.getReqData();
|
|
|
let pd: any = JSON.parse(reqData);
|
|
|
- pd.productId = spid;
|
|
|
+ pd.productId = alert_spid;
|
|
|
reqData = JSON.stringify(pd);
|
|
|
- xGame.httpMgr.sendPost2025('order/checkBuyFuLi', reqData, (res) => {
|
|
|
+ xGame.httpMgr.sendPost2025('order/getOrderForBuyFuLiSpid17', 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);
|
|
|
+ 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);
|
|
|
- }
|
|
|
+ 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 {
|
|
|
- console.log('zh:已经购买了SPID=' + spid + ',不需要再提示用户了')
|
|
|
+ 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);
|
|
@@ -346,6 +356,41 @@ export default class UIMain extends UIBase {
|
|
|
|
|
|
}
|
|
|
});
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+ // 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 {
|
|
|
+
|
|
|
+ // }
|
|
|
+ // });
|
|
|
}
|
|
|
|
|
|
|
|
@@ -394,8 +439,8 @@ export default class UIMain extends UIBase {
|
|
|
private addEvent(): void {
|
|
|
this.addUIClick(this.ui.classicBtn, this.startGame, [GameMode.classic]);
|
|
|
this.addUIClick(this.ui.bigMoveBtn, this.startGame, [GameMode.bigMove])
|
|
|
- // this.addUIClick(this.ui.ganFaMoShiBtn, this.startGame, [GameMode.bigMove])
|
|
|
- this.addUIClick(this.ui.ganFaMoShiBtn, this.openShopView0)//原先右下角的干法模式改为链接到shop
|
|
|
+ // this.addUIClick(this.ui.ganFaMoShiBtn, this.startGame, [GameMode.bigMove])
|
|
|
+ this.addUIClick(this.ui.ganFaMoShiBtn, this.openShopView0)//原先右下角的干法模式改为链接到shop
|
|
|
//
|
|
|
this.addUIClick(this.ui.globalBtn, this.startGlobal);
|
|
|
// this.addUIClick(this.ui.weeklyBtn, this.startWeekly);
|
|
@@ -492,7 +537,7 @@ export default class UIMain extends UIBase {
|
|
|
})
|
|
|
}
|
|
|
|
|
|
- this.setGlobalFont(this.ui)
|
|
|
+ this.setGlobalFont(this.ui)
|
|
|
}
|
|
|
checkActive(show) {
|
|
|
//console.log("是否处于最外层",show);
|