Browse Source

【优化】完善提现返利的金额展示

mojunshou 9 months ago
parent
commit
d38af7317a

+ 2 - 2
assets/script/game/view/CashRebateView.ts

@@ -2,7 +2,7 @@
  * @Author: mojunshou 1637302775@qq.com
  * @Author: mojunshou 1637302775@qq.com
  * @Date: 2025-03-21 11:45:43
  * @Date: 2025-03-21 11:45:43
  * @LastEditors: mojunshou 1637302775@qq.com
  * @LastEditors: mojunshou 1637302775@qq.com
- * @LastEditTime: 2025-04-18 18:51:35
+ * @LastEditTime: 2025-04-19 17:46:48
  * @Description: 提现必返
  * @Description: 提现必返
  */
  */
 import { _decorator, Label } from 'cc';
 import { _decorator, Label } from 'cc';
@@ -31,7 +31,7 @@ export class CashRebateView extends GameComponent {
     }
     }
     setData() {
     setData() {
         if (this.lab_num) {
         if (this.lab_num) {
-            this.lab_num.string = Format.formatRedPacketCoin(smc.game.GameModel.cashNum);
+            this.lab_num.string = Format.formatRedPacketCoin(smc.game.GameModel.changeHbCoin);
         }
         }
     }
     }
     private btn_ok() {
     private btn_ok() {

+ 16 - 19
assets/script/game/view/EliminateViewComp.ts

@@ -2,7 +2,7 @@
  * @Author: mojunshou 1637302775@qq.com
  * @Author: mojunshou 1637302775@qq.com
  * @Date: 2025-03-20 15:01:09
  * @Date: 2025-03-20 15:01:09
  * @LastEditors: mojunshou 1637302775@qq.com
  * @LastEditors: mojunshou 1637302775@qq.com
- * @LastEditTime: 2025-04-19 16:58:13
+ * @LastEditTime: 2025-04-19 17:32:25
  * @Description: 消除游戏主场景
  * @Description: 消除游戏主场景
  */
  */
 import { _decorator, Button, Color, EventTouch, instantiate, JsonAsset, Label, Node, Prefab, randomRangeInt, Sprite, tween, UITransform, Vec2, Vec3, Widget } from "cc";
 import { _decorator, Button, Color, EventTouch, instantiate, JsonAsset, Label, Node, Prefab, randomRangeInt, Sprite, tween, UITransform, Vec2, Vec3, Widget } from "cc";
@@ -1432,7 +1432,21 @@ export class EliminateViewComp extends CCComp {
                 this.scheduleOnce(() => {
                 this.scheduleOnce(() => {
                     // 递归调用,检查并处理连锁消除
                     // 递归调用,检查并处理连锁消除
                     this.gridEliminate().then(() => {
                     this.gridEliminate().then(() => {
-                        // 连锁消除结束,不做额外处理
+                        if (this.eliminateInterval.length == 0) {
+                            return;
+                        }
+                        const minNum = this.eliminateInterval[0]
+                        const maxNum = this.eliminateInterval[1]
+                        const randomNum = randomRangeInt(minNum, maxNum + 1);
+                        //这个数可以被总消除次数整除那就可以弹广告
+                        if (this.eliminateTotal % randomNum === 0) {
+                            // oops.gui.open(UIID.DoubleSpeed);
+                            //如果有自动就暂停自动
+                            this.gameState = GameState.PAUSED;
+                            console.log("弹出翻倍广告");
+                            ServerHandler.inst.getDoubleSurprise();
+                            //弹出广告
+                        }
                     });
                     });
                 }, 0.2);
                 }, 0.2);
             }, 0.2)
             }, 0.2)
@@ -1803,23 +1817,6 @@ export class EliminateViewComp extends CCComp {
         }
         }
 
 
         //是否展示翻倍广告
         //是否展示翻倍广告
-        //从上边的随机数组区里边的两个数间取一个整数
-        if (this.eliminateInterval.length == 0) {
-            return;
-        }
-        const minNum = this.eliminateInterval[0]
-        const maxNum = this.eliminateInterval[1]
-        const randomNum = randomRangeInt(minNum, maxNum + 1);
-        //这个数可以被总消除次数整除那就可以弹广告
-        if (this.eliminateTotal % randomNum === 0) {
-            // oops.gui.open(UIID.DoubleSpeed);
-            //如果有自动就暂停自动
-            this.gameState = GameState.PAUSED;
-            console.log("弹出翻倍广告");
-            ServerHandler.inst.getDoubleSurprise();
-            //弹出广告
-        }
-
 
 
     }
     }
 
 

+ 5 - 3
assets/script/game/view/GamePassView.ts

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