Przeglądaj źródła

【BUG】修改红包页提现偶发报错问题

mojunshou 1 rok temu
rodzic
commit
bf5459f065

Plik diff jest za duży
+ 582 - 251
assets/bundle/gui/eliminate/prefab/redPacketWithdrawal.prefab


+ 2 - 1
assets/script/game/common/manager/ADHandler.ts

@@ -2,7 +2,7 @@
  * @Author: mojunshou 1637302775@qq.com
  * @Date: 2025-04-11 10:14:44
  * @LastEditors: mojunshou 1637302775@qq.com
- * @LastEditTime: 2025-04-24 17:30:06
+ * @LastEditTime: 2025-04-24 18:23:19
  * @Description: 
  */
 // ADHandler.ts
@@ -117,6 +117,7 @@ export class ADHandler {
     adRewardLoadFailed = (str: string) => {
         oops.gui.waitClose();
         smc.game.GameModel.isShowAd = false;
+        smc.game.GameModel.viewType = "";
         if (smc.game.GameModel.viewType != "" && smc.game.GameModel.viewType != "pass_reward") {
             oops.message.dispatchEvent(GameEvent.updateGameState, "playing");
         }

+ 4 - 3
assets/script/game/common/manager/ProtocolEvent.ts

@@ -2,13 +2,14 @@
  * @Author: mojunshou 1637302775@qq.com
  * @Date: 2025-04-07 10:17:16
  * @LastEditors: mojunshou 1637302775@qq.com
- * @LastEditTime: 2025-04-24 17:40:46
+ * @LastEditTime: 2025-04-24 17:50:59
  * @Description: 消息定义
  */
 
-const server_url = "http://192.168.10.103:8880";
+// const server_url = "http://192.168.10.103:8880";
 // https://central-test.atmob.com
-// const server_url = "https://central-test.atmob.com";
+const server_url = "https://central-test.atmob.com";
+
 export enum ProtocolEvent {
     /**微信登录*/
     WechatLogin = server_url + "/project/playlet/v1/user/login",

+ 3 - 2
assets/script/game/view/EliminateViewComp.ts

@@ -2,7 +2,7 @@
  * @Author: mojunshou 1637302775@qq.com
  * @Date: 2025-03-20 15:01:09
  * @LastEditors: mojunshou 1637302775@qq.com
- * @LastEditTime: 2025-04-24 17:26:18
+ * @LastEditTime: 2025-04-24 18:11:32
  * @Description: 消除游戏主场景
  */
 import { _decorator, Button, Color, EventTouch, instantiate, JsonAsset, v3, Label, Node, Prefab, randomRangeInt, Sprite, tween, UITransform, Vec2, Vec3, Widget } from "cc";
@@ -2224,7 +2224,8 @@ export class EliminateViewComp extends CCComp {
         this.doubleNum = 2;
         //改变按钮时间
         // let time = smc.game.GameModel.doubleSpeedTime;
-        this.doubleSpeedTime = this.doubleSpeedTime + smc.game.GameModel.doubleSpeedTime;
+        // this.doubleSpeedTime = this.doubleSpeedTime + smc.game.GameModel.doubleSpeedTime;
+        this.doubleSpeedTime = 20;
         if (this.doubleSpeedTime <= 0) {
             return
         }

+ 45 - 16
assets/script/game/view/RedPackeWithdrawalViewComp.ts

@@ -2,7 +2,7 @@
  * @Author: mojunshou 1637302775@qq.com
  * @Date: 2025-03-20 17:53:50
  * @LastEditors: mojunshou 1637302775@qq.com
- * @LastEditTime: 2025-04-24 17:21:52
+ * @LastEditTime: 2025-04-24 19:10:25
  * @Description: 红包提现
  */
 import { _decorator, Label, Node } from "cc";
@@ -32,10 +32,14 @@ export class RedPackeWithdrawalViewComp extends CCVMParentComp {
     @property(Label)
     lab_tips: Label = null!;
 
+    @property(Label)
+    lab_hbCoin: Label = null!;
+
+    @property(Label)
+    lab_wxCash: Label = null!;
+
     data: any = {
         tasklist: [],
-        wxCash: 0,
-        hbCoin: 0,
         goldNum: 0
     };
     start() {
@@ -43,8 +47,10 @@ export class RedPackeWithdrawalViewComp extends CCVMParentComp {
         this.addEvent();
         DCHandler.inst.reportData(3000900);
         this.data.taskList = smc.game.GameModel.taskList;
-        this.data.wxCash = smc.game.GameModel.wxCash;
-        this.data.hbCoin = Format.formatRedPacketCoin(smc.account.AccountModel.hbCoin);
+        let wxCash = smc.game.GameModel.wxCash;
+        let hbCoin = Format.formatRedPacketCoin(smc.account.AccountModel.hbCoin);
+        this.lab_wxCash.string = `${wxCash}`;
+        this.lab_hbCoin.string = `${hbCoin}`;
         this.data.goldNum = smc.account.AccountModel.goldCoin;
         if (this.data.taskList.length > 0) {
             this.recordList.numItems = this.data.taskList.length;
@@ -58,7 +64,6 @@ export class RedPackeWithdrawalViewComp extends CCVMParentComp {
         oops.message.on(GameEvent.updateHbAndWxCoin, this.updateCoin, this);
     }
 
-
     private onListRender(item: Node, idx: number) {
         const itemView: RedPackeItemView | null = item.getComponent(RedPackeItemView);
         if (itemView) {
@@ -68,11 +73,11 @@ export class RedPackeWithdrawalViewComp extends CCVMParentComp {
 
 
     updateList() {
-        // console.log("更新提现记录信息", this.data.wxCash);
         this.data.taskList = smc.game.GameModel.taskList;
-        this.data.wxCash = smc.game.GameModel.wxCash;
-        const hbCoin = Format.formatRedPacketCoin(smc.account.AccountModel.hbCoin);
-        this.data.hbCoin = Number(hbCoin);
+        let wxCash = smc.game.GameModel.wxCash;
+        let hbCoin = Format.formatRedPacketCoin(smc.account.AccountModel.hbCoin);
+        this.lab_wxCash.string = `${wxCash}`;
+        this.lab_hbCoin.string = `${hbCoin}`;
         this.data.goldNum = smc.account.AccountModel.goldCoin;
         this.recordList.numItems = 0;
         if (this.data.taskList.length > 0) {
@@ -83,11 +88,13 @@ export class RedPackeWithdrawalViewComp extends CCVMParentComp {
     }
 
     updateCoin() {
-        this.data.wxCash = smc.game.GameModel.wxCash;
-        console.log("111111111111111111111")
-        const hbCoin = Format.formatRedPacketCoin(smc.account.AccountModel.hbCoin);
-        console.log("22222222222222222")
-        this.data.hbCoin = Number(hbCoin);
+        console.log("更新红包币和微信币")
+        let wxCash = smc.game.GameModel.wxCash;
+        console.log("wxCash", wxCash);
+        let hbCoin = Format.formatRedPacketCoin(smc.account.AccountModel.hbCoin);
+        console.log("hbCoin", hbCoin);
+        this.lab_wxCash.string = `${wxCash}`;
+        this.lab_hbCoin.string = `${hbCoin}`;
     }
 
     private btn_back() {
@@ -108,7 +115,7 @@ export class RedPackeWithdrawalViewComp extends CCVMParentComp {
 
     private async btn_withdrawal() {
         //全部提现
-        if (this.data.wxCash >= 0.1) {
+        if (smc.game.GameModel.wxCash >= 0.1) {
             ServerHandler.inst.HbReward();
             DCHandler.inst.reportData(3000900, 1001);
         } else {
@@ -127,4 +134,26 @@ export class RedPackeWithdrawalViewComp extends CCVMParentComp {
     }
 
 
+    btn_text() {
+        const info = {
+            "ssid": "730596b822fe47b09d48be6bd41d085e",
+            "props": {
+                "1004": 44278,
+                "1005": 1837207,
+                "1006": 6,
+                "1007": 129,
+                "2001": 2,
+                "8001": 140,
+                "9001": 2
+            },
+            "changes": {
+                "1004": -500000,
+                "8001": 50
+            },
+            "money": 0.04
+        }
+
+        ServerHandler.inst.onHbReward(JSON.stringify(info));
+    }
+
 }

+ 5 - 5
assets/script/game/view/WechatWithdrawalViewComp.ts

@@ -2,7 +2,7 @@
  * @Author: mojunshou 1637302775@qq.com
  * @Date: 2025-03-20 17:00:12
  * @LastEditors: mojunshou 1637302775@qq.com
- * @LastEditTime: 2025-04-24 11:14:32
+ * @LastEditTime: 2025-04-24 18:44:51
  * @Description: 微信提现页面
  */
 import { _decorator, ImageAsset, Label, Node, RichText, Size, Sprite, SpriteFrame, Texture2D, tween, UITransform, Vec3 } from "cc";
@@ -96,12 +96,12 @@ export class WechatWithdrawalViewComp extends CCVMParentComp {
     private btn_auto() {
         //判断能否提现
         const num = smc.game.GameModel.wechat_tx_info.gapGoldNum;
-
+        const info = smc.game.GameModel.wechat_tx_info.handingChargeProgress
         if (num) {
             oops.gui.toast(`还需凑齐${num}金块即可微信打款`);
-        } else {
-            //展示提现界面//向服务器申请提现信息
-            ServerHandler.inst.getWechatTxInfo();
+        } else if (info) {
+            //弹出剩余多少手续费
+            oops.gui.toast(`还差${info.gapNum}元手续费即可微信打款~`);
         }
     }