Bladeren bron

【BUG】修改手续费领取问题

mojunshou 7 maanden geleden
bovenliggende
commit
854a19e0e8

+ 7 - 6
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 15:00:31
+ * @LastEditTime: 2025-04-24 17:30:06
  * @Description: 
  */
 // ADHandler.ts
@@ -117,12 +117,11 @@ export class ADHandler {
     adRewardLoadFailed = (str: string) => {
         oops.gui.waitClose();
         smc.game.GameModel.isShowAd = false;
-        oops.message.dispatchEvent(GameEvent.updateGameState, "playing");
+        if (smc.game.GameModel.viewType != "" && smc.game.GameModel.viewType != "pass_reward") {
+            oops.message.dispatchEvent(GameEvent.updateGameState, "playing");
+        }
         //展示失败
         if (smc.game.GameModel.viewType === "revive_reward") {
-            const score = smc.game.GameModel.curScore;
-            smc.game.GameModel.viewType = "";
-            smc.game.GameModel.curScore = Math.floor(score / 2);
             oops.message.dispatchEvent(GameEvent.RestartGame);
         }
     };
@@ -132,7 +131,9 @@ export class ADHandler {
         smc.game.GameModel.isShowAd = false;
         console.log("[广告] 激励视频关闭", state)
         smc.game.GameModel.isDone = state;
-        oops.message.dispatchEvent(GameEvent.updateGameState, "playing");
+        if (smc.game.GameModel.viewType != "" && smc.game.GameModel.viewType != "pass_reward") {
+            oops.message.dispatchEvent(GameEvent.updateGameState, "playing");
+        }
         if (state) {
             if (smc.game.GameModel.viewType === "speed_reward") {
                 //直接成功-增加时长

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

@@ -2,14 +2,13 @@
  * @Author: mojunshou 1637302775@qq.com
  * @Date: 2025-04-07 10:17:16
  * @LastEditors: mojunshou 1637302775@qq.com
- * @LastEditTime: 2025-04-24 16:32:01
+ * @LastEditTime: 2025-04-24 17:40:46
  * @Description: 消息定义
  */
+
 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 {
     /**微信登录*/
     WechatLogin = server_url + "/project/playlet/v1/user/login",
@@ -72,7 +71,8 @@ export enum ProtocolEvent {
     GetGuideInfo = server_url + "/project/playlet/v1/checkPoint/guideView",
     //更新弹窗界面状态
     UpdatePopUpState = server_url + "/project/playlet/v1/popup/event",
-
+    //领取手续费
+    GetFee = server_url + "/project/playlet/v1/reward/handlingCharge",
 
 }
 

+ 22 - 1
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-24 16:37:30
+ * @LastEditTime: 2025-04-24 17:42:18
  * @Description: 
  */
 // ServerHandler.ts
@@ -560,6 +560,27 @@ export class ServerHandler {
         let result = JSON.parse(str);
     }
 
+
+
+
+    //领取手续费
+    getFee() {
+        const param = {
+            url: ProtocolEvent.GetFee,
+            param: {
+                level: smc.account.AccountModel.curLevel,
+            },
+            callback: this.buildCallback('ServerHandler.inst.onGetFee', 'ServerHandler.inst.onRequestFail')
+        }
+        this.sendMsgToServer(param);
+    }
+
+    onGetFee(str: string) {
+        console.log('[服务器] 领取手续费返回', str);
+        let result = JSON.parse(str);
+        // smc.game.GameModel.fee = result.fee;
+    }
+
     onRequestFail(code: number, str: string) {
         console.log('[服务器] 请求失败', code, str);
     }

+ 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 16:13:44
+ * @LastEditTime: 2025-04-24 17:26:18
  * @Description: 消除游戏主场景
  */
 import { _decorator, Button, Color, EventTouch, instantiate, JsonAsset, v3, Label, Node, Prefab, randomRangeInt, Sprite, tween, UITransform, Vec2, Vec3, Widget } from "cc";
@@ -1913,6 +1913,7 @@ export class EliminateViewComp extends CCComp {
             //弹出通关奖励界面
             if (DeviceUtil.isNative && DeviceUtil.isAndroid) {
                 ServerHandler.inst.getGameAwardInfo();
+                //如果
             } else {
                 oops.gui.open(UIID.GamePass);
             }
@@ -2268,7 +2269,7 @@ export class EliminateViewComp extends CCComp {
         this.initData();
         this.setData();
         this.reopenGrid();
-        this.initButtonState(this.autoState);
+        // this.initButtonState(this.autoState);
         this.updateWelfarePoint();
     }
 

+ 2 - 2
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 15:11:03
+ * @LastEditTime: 2025-04-24 17:21:52
  * @Description: 红包提现
  */
 import { _decorator, Label, Node } from "cc";
@@ -108,7 +108,7 @@ export class RedPackeWithdrawalViewComp extends CCVMParentComp {
 
     private async btn_withdrawal() {
         //全部提现
-        if (this.data.wxCash > 0.1) {
+        if (this.data.wxCash >= 0.1) {
             ServerHandler.inst.HbReward();
             DCHandler.inst.reportData(3000900, 1001);
         } else {

+ 3 - 2
assets/script/game/view/popup/WechatTransfer.ts

@@ -2,7 +2,7 @@
  * @Author: mojunshou 1637302775@qq.com
  * @Date: 2025-04-19 11:34:46
  * @LastEditors: mojunshou 1637302775@qq.com
- * @LastEditTime: 2025-04-24 15:52:43
+ * @LastEditTime: 2025-04-24 17:08:05
  * @Description: 微信转账中界面
  */
 import { _decorator, Component, Node, Animation } from 'cc';
@@ -105,13 +105,14 @@ export class WechatTransfer extends VMParent {
     //高价值用户关闭
     btn_HightValueClose() {
         this.onHightValueClose();
-
+        ServerHandler.inst.getFee();
     }
 
 
     //高价只用户开心收下
     btn_happyAccept() {
         this.onHightValueClose();
+        ServerHandler.inst.getFee();
     }
 
 

+ 0 - 4
assets/script/game/view/popup/WelfareOne.ts

@@ -116,7 +116,6 @@ export class WelfareOne extends VMParent {
         }, 3)
     }
 
-
     updateState() {
         ServerHandler.inst.updatePopupState({
             level: smc.account.AccountModel.curLevel,
@@ -125,8 +124,6 @@ export class WelfareOne extends VMParent {
 
     }
 
-
-
     processLevelInfo(levelInfoList: LevelInfo[], totalLength: number = 602): LevelInfo[] {
         if (levelInfoList.length === 0) return [];
         const firstLevel = levelInfoList[0].level;
@@ -135,7 +132,6 @@ export class WelfareOne extends VMParent {
         const singleLength = totalLength / (lastLevel - 1);
         return levelInfoList.map((item, index) => {
             let foundFirstNotWithdraw = false;
-
             if (index === 0) {
                 item.position = this.progressNode.position.x;
             } else if (index === levelInfoList.length - 1) {