浏览代码

【BUG】修改提现页报错问题

mojunshou 7 月之前
父节点
当前提交
285c40336d

文件差异内容过多而无法显示
+ 896 - 1791
assets/bundle/gui/eliminate/eliminate.prefab


+ 5 - 5
assets/bundle/gui/eliminate/prefab/cashWithdrawal.prefab

@@ -3231,7 +3231,7 @@
         "__id__": 175
       }
     ],
-    "_active": false,
+    "_active": true,
     "_components": [
       {
         "__id__": 189
@@ -3549,7 +3549,7 @@
     },
     "_contentSize": {
       "__type__": "cc.Size",
-      "width": 0,
+      "width": 514,
       "height": 23
     },
     "_anchorPoint": {
@@ -3598,7 +3598,7 @@
       "y": 0
     },
     "_fillStart": 0,
-    "_fillRange": 0,
+    "_fillRange": 1,
     "_isTrimmedMode": true,
     "_useGrayscale": false,
     "_atlas": null,
@@ -3711,7 +3711,7 @@
     },
     "_mode": 2,
     "_totalLength": 1,
-    "_progress": 0,
+    "_progress": 1,
     "_reverse": false,
     "_id": ""
   },
@@ -3788,7 +3788,7 @@
     "_contentSize": {
       "__type__": "cc.Size",
       "width": 720,
-      "height": 1600
+      "height": 1600.0000000000002
     },
     "_anchorPoint": {
       "__type__": "cc.Vec2",

+ 2 - 2
assets/bundle/gui/eliminate/prefab/gameOver.prefab

@@ -388,7 +388,7 @@
     "__prefab": {
       "__id__": 22
     },
-    "playOnLoad": false,
+    "playOnLoad": true,
     "_clips": [
       {
         "__uuid__": "62c95173-1005-48b0-bef6-f49a73db295c",
@@ -2680,7 +2680,7 @@
     "_contentSize": {
       "__type__": "cc.Size",
       "width": 720,
-      "height": 1600
+      "height": 1600.0000000000002
     },
     "_anchorPoint": {
       "__type__": "cc.Vec2",

文件差异内容过多而无法显示
+ 282 - 250
assets/bundle/gui/eliminate/prefab/gamePass.prefab


文件差异内容过多而无法显示
+ 505 - 150
assets/bundle/gui/eliminate/prefab/redPacketWithdrawal.prefab


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

@@ -2,12 +2,14 @@
  * @Author: mojunshou 1637302775@qq.com
  * @Date: 2025-04-07 10:17:16
  * @LastEditors: mojunshou 1637302775@qq.com
- * @LastEditTime: 2025-04-15 14:42:02
+ * @LastEditTime: 2025-04-21 15:07:58
  * @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";
 
 export enum ProtocolEvent {
     /**微信登录*/
@@ -39,11 +41,9 @@ export enum ProtocolEvent {
     /**视频奖励*/
     GetVideorReward = server_url + "/project/playlet/v1/reward/videoReward",
 
-
     //获取微信提现页信息
     GetWechatTxInfo = server_url + "/project/playlet/v3/withdraw/view/wechat/fake",
 
-
     /**红包币提现*/
     GetRedPacketCash = server_url + "/project/playlet/v1/withdraw/convert",
     /**提现记录*/
@@ -57,9 +57,6 @@ export enum ProtocolEvent {
     /**福利点提现*/
     GetWelfarePointCash = server_url + "/project/playlet/v1/reward/weal",
 
-
-
-
     /**获取当前关卡配置信息*/
     GetCurrentLevelConfig = server_url + "/project/playlet/v1/checkPoint/conf",
     /**获取所有关卡配置信息*/

+ 3 - 3
assets/script/game/common/manager/ServerHandler.ts

@@ -2,7 +2,7 @@
  * @Author: mojunshou 1637302775@qq.com
  * @Date: 2025-04-11 10:16:41
  * @LastEditors: mojunshou 1637302775@qq.com
- * @LastEditTime: 2025-04-19 16:37:19
+ * @LastEditTime: 2025-04-21 16:23:18
  * @Description: 
  */
 // ServerHandler.ts
@@ -305,7 +305,7 @@ export class ServerHandler {
         //请求下一局
 
         //如果是提现点,就展示提现,然后展示提现返利
-        if (smc.game.GameModel.curLevelConfig.eventType == "WITHDRAW_POINT") {
+        if (smc.game.GameModel.curLevelConfig.eventType && smc.game.GameModel.curLevelConfig.eventType == "WITHDRAW_POINT") {
             //展示提现信息
             this.WechatReward();
         } else {
@@ -470,7 +470,7 @@ export class ServerHandler {
     onHbReward(str: string) {
         console.log('[服务器] 红包币提现返回', str);
         let result = JSON.parse(str);
-        const wxCash = result.changes["8001"] / 100;
+        const wxCash = result.changes["8001"];
         smc.game.GameModel.txNum = wxCash;
         smc.game.GameModel.txType = 2;
         oops.message.dispatchEvent(GameEvent.openView, "openCashWithdrawalView");

+ 9 - 42
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-21 11:01:14
+ * @LastEditTime: 2025-04-21 16:38:46
  * @Description: 消除游戏主场景
  */
 import { _decorator, Button, Color, EventTouch, instantiate, JsonAsset, Label, Node, Prefab, randomRangeInt, Sprite, tween, UITransform, Vec2, Vec3, Widget } from "cc";
@@ -312,9 +312,9 @@ export class EliminateViewComp extends CCComp {
         this.lab_hbCoin.string = Format.formatRedPacketCoin(this.cash);
         this.lab_taget.string = this.targetScore.toString();
         this.lab_goldNum.string = smc.account.AccountModel.goldCoin.toString();
+        this.gameState = GameState.PLAYING;
     }
 
-
     updateCoin() {
         this.money = smc.account.AccountModel.wxCoin;
         this.cash = smc.account.AccountModel.hbCoin;
@@ -565,6 +565,8 @@ export class EliminateViewComp extends CCComp {
             );
         }
 
+        this.updateGameScore();
+
     }
 
 
@@ -1095,7 +1097,6 @@ export class EliminateViewComp extends CCComp {
                         centerPos.y /= validGridCount;
                     }
                 }
-
                 // 放置方块到网格
                 this.editingData.gridList.forEach(grid => {
                     grid.status = CellState.FILLED;
@@ -1236,9 +1237,7 @@ export class EliminateViewComp extends CCComp {
         // 添加到场景中
         this.node.addChild(scoreLabel);
         scoreLabel.setWorldPosition(position);
-
         const num = this.isDoubleSpeed ? this.doubleNum : 1;
-
         // 创建动画效果
         tween(scoreLabel)
             .to(0.5 / num, {
@@ -1393,7 +1392,6 @@ export class EliminateViewComp extends CCComp {
                 }
 
                 this.score += score;
-                this.updateGameScore();
                 if (DeviceUtil.isNative && DeviceUtil.isAndroid) {
                     ServerHandler.inst.updateEliminationReward({
                         count: totalEliminationsInThisRound,
@@ -1806,6 +1804,7 @@ export class EliminateViewComp extends CCComp {
         this.gameState = GameState.GAME_OVER
         this.setGameState(GameState.GAME_OVER)
         console.log("游戏结束")
+        smc.game.GameModel.curScore = this.score;
         oops.gui.open(UIID.GameOver);
     }
 
@@ -1820,12 +1819,9 @@ export class EliminateViewComp extends CCComp {
             if (DeviceUtil.isNative && DeviceUtil.isAndroid) {
                 ServerHandler.inst.getGameAwardInfo();
             } else {
-                console.log("打开通关奖励");
+                oops.gui.open(UIID.GamePass);
             }
         }
-
-        //是否展示翻倍广告
-
     }
 
 
@@ -1907,9 +1903,11 @@ export class EliminateViewComp extends CCComp {
 
     //自动放置
     private btn_auto() {
+        if (this.gameState !== GameState.PLAYING) {
+            return;
+        }
         this.autoState = !this.autoState;
         this.initButtonState(this.autoState);
-        this.gameState = GameState.PLAYING
         if (this.autoState) {
             this.executeAutoPlace();
         }
@@ -2155,7 +2153,6 @@ export class EliminateViewComp extends CCComp {
     //重新开始
     private restartGame() {
         if (this.gameState === GameState.READY) return;
-        console.log("重新开始")
         this.initData();
         this.setData();
         this.reopenGrid();
@@ -2193,18 +2190,15 @@ export class EliminateViewComp extends CCComp {
         // this.popupType = "weal_3";
         switch (this.popupType) {
             case "weal_1":
-                // this.btn_warmReminder();
                 oops.gui.open(UIID.WarmReminder);
                 ServerHandler.inst.GetGuideInfo();
                 break;
             case "weal_2":
-                // this.btn_cashRebate();
                 //打开福利二
                 oops.gui.open(UIID.WelfareTwo);
                 ServerHandler.inst.GetGuideInfo();
                 break;
             case "weal_3":
-                // this.btn_doubleRewards();
                 //打开福利三
                 oops.gui.open(UIID.WelfareThree);
                 break;
@@ -2220,33 +2214,6 @@ export class EliminateViewComp extends CCComp {
 
 
 
-
-
-    //温馨提示
-    private btn_warmReminder() {
-        oops.gui.open(UIID.WarmReminder);
-    }
-
-
-    //界面测试
-    btn_tongguan() {
-        if (DeviceUtil.isNative && DeviceUtil.isAndroid) {
-            ServerHandler.inst.getGameAwardInfo();
-        }
-    }
-
-    btn_tx() {
-        if (DeviceUtil.isNative && DeviceUtil.isAndroid) {
-            ServerHandler.inst.getTxbfInfo();
-        }
-    }
-
-    btn_gxfb() {
-        if (DeviceUtil.isNative && DeviceUtil.isAndroid) {
-            ServerHandler.inst.getDoubleSurprise();
-        }
-    }
-
     btn_text() {
         // const param = {
         //     "showReward": [

+ 4 - 7
assets/script/game/view/GamePassView.ts

@@ -2,7 +2,7 @@
  * @Author: mojunshou 1637302775@qq.com
  * @Date: 2025-03-21 14:43:24
  * @LastEditors: mojunshou 1637302775@qq.com
- * @LastEditTime: 2025-04-19 17:42:10
+ * @LastEditTime: 2025-04-21 16:10:01
  * @Description: 游戏通关弹窗
  */
 import { Label, Node } from 'cc';
@@ -74,13 +74,10 @@ export class GamePassView extends GameComponent {
 
     //开心收下正常领取
     private btn_none() {
-        oops.gui.remove(UIID.GamePass);
-        //给服务器发信息--少量领取
-        ServerHandler.inst.getPassRewards();
-        //如果是提现点
-        if (smc.game.GameModel.eventType === "WITHDRAW_POINT") {
-            ServerHandler.inst.WechatReward();
+        if (DeviceUtil.isNative && DeviceUtil.isAndroid) {
+            ServerHandler.inst.getPassRewards();
         }
+        oops.gui.remove(UIID.GamePass);
     }
 
     //十倍领取

+ 7 - 6
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-16 18:17:39
+ * @LastEditTime: 2025-04-21 16:30:05
  * @Description: 红包提现
  */
 import { _decorator, Label, Node } from "cc";
@@ -16,6 +16,7 @@ import { ServerHandler } from "../common/manager/ServerHandler";
 import List from "../ui/List";
 import { RedPackeItemView } from "./RedPackeItemView";
 import { smc } from "../common/SingletonModuleComp";
+import { Format } from "../utils/Format";
 
 const { ccclass, property } = _decorator;
 
@@ -61,7 +62,7 @@ export class RedPackeWithdrawalViewComp extends CCVMParentComp {
         // this
         this.data.taskList = smc.game.GameModel.taskList;
         this.data.wxCash = smc.game.GameModel.wxCash;
-        this.data.hbCoin = this.formatNumber(smc.account.AccountModel.hbCoin / 100);
+        this.data.hbCoin = Format.formatRedPacketCoin(smc.account.AccountModel.hbCoin);
         this.data.goldNum = smc.account.AccountModel.goldCoin;
         if (this.data.taskList.length > 0) {
             this.recordList.numItems = this.data.taskList.length;
@@ -86,8 +87,8 @@ 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;
-        this.data.hbCoin = smc.account.AccountModel.hbCoin;
+        this.data.wxCash = Format.formatWxCoin(smc.game.GameModel.wxCash);
+        this.data.hbCoin = Format.formatRedPacketCoin(smc.account.AccountModel.hbCoin);
         this.data.goldNum = smc.account.AccountModel.goldCoin;
         this.recordList.numItems = 0;
         if (this.data.taskList.length > 0) {
@@ -98,8 +99,8 @@ export class RedPackeWithdrawalViewComp extends CCVMParentComp {
     }
 
     updateCoin() {
-        this.data.wxCash = this.formatNumber(smc.game.GameModel.wxCash / 1000);
-        this.data.hbCoin = this.formatNumber(smc.account.AccountModel.hbCoin / 100);
+        this.data.wxCash = Format.formatWxCoin(smc.game.GameModel.wxCash);
+        this.data.hbCoin = Format.formatRedPacketCoin(smc.account.AccountModel.hbCoin);
     }
 
     private btn_back() {