Ver Fonte

【bug】修改翻倍奖励少量领取没有领取问题

mojunshou há 7 meses atrás
pai
commit
90a8f426d0

+ 4 - 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-25 16:52:33
+ * @LastEditTime: 2025-04-25 17:20:58
  * @Description: 
  */
 // ADHandler.ts
@@ -78,11 +78,7 @@ export class ADHandler {
         smc.game.GameModel.isShowAd = false;
         if (oops.gui.has(UIID.KindTips)) oops.gui.remove(UIID.KindTips);
         if (oops.gui.has(UIID.Retention)) oops.gui.remove(UIID.Retention);
-
-        const result = await LoginHandler.inst.savePrivacyStatus(true);
-        if (result?.code === 0) {
-            ServerHandler.inst.getAccountInfo();
-        }
+        ServerHandler.inst.getAccountInfo();
     };
 
     adSplashLoadFailed = () => {
@@ -102,6 +98,7 @@ export class ADHandler {
         console.log('[广告] 插屏广告关闭', type);
         //如果有弹窗,则不发送事件,
         oops.message.dispatchEvent(GameEvent.updateGameState, "playing");
+        // 如果是插屏广告
     };
 
     adRewardShow = (str: string) => {
@@ -132,6 +129,7 @@ export class ADHandler {
             ServerHandler.inst.getVideorReward();
             if (smc.game.GameModel.viewType === "speed_reward") {
                 //直接成功-增加时长
+                oops.message.dispatchEvent(GameEvent.updateGameState, "playing");
                 oops.message.dispatchEvent(GameEvent.DoubleSpeedOpenSuccess);
                 smc.game.GameModel.viewType = "";
             }

+ 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-25 16:36:40
+ * @LastEditTime: 2025-04-25 16:59:29
  * @Description: 
  */
 // ServerHandler.ts
@@ -409,9 +409,9 @@ export class ServerHandler {
         smc.game.GameModel.targetScore = result.currentLevelConf.score;
         smc.game.GameModel.eventType = result.currentLevelConf.eventType || "";
         smc.game.GameModel.curLevelConfig = result.currentLevelConf;
-        smc.account.AccountModel.goldCoin = result.props["1006"] //金砖数量
+        smc.account.AccountModel.goldCoin = result.props["1006"] || 0//金砖数量
         smc.game.GameModel.popupType = result.currentLevelConf.popupType || "";
-        smc.game.GameModel.popupShow = result.currentLevelData.popupStatus;
+        smc.game.GameModel.popupShow = result.currentLevelData.popupStatus || false;
         smc.game.GameModel.skipAdConfig = result.currentLevelConf.skipCount || -1;
         oops.message.dispatchEvent(GameEvent.RestartGame);
     }

+ 4 - 1
assets/script/game/common/tips/KindTipsView.ts

@@ -2,7 +2,7 @@
  * @Author: mojunshou 1637302775@qq.com
  * @Date: 2025-03-19 18:02:51
  * @LastEditors: mojunshou 1637302775@qq.com
- * @LastEditTime: 2025-04-23 15:39:56
+ * @LastEditTime: 2025-04-25 17:02:54
  * @Description: 温馨提示弹窗
  */
 import { _decorator } from 'cc';
@@ -15,6 +15,7 @@ import { CocosHandler } from '../manager/CocosHandler';
 import { ADHandler } from '../manager/ADHandler';
 import { LoginHandler } from '../manager/LoginHandler';
 import { DCHandler } from '../manager/DCHandler';
+import { ServerHandler } from '../manager/ServerHandler';
 const { ccclass, property } = _decorator;
 
 @ccclass('KindTipsView')
@@ -29,6 +30,8 @@ export class KindTipsView extends GameComponent {
             LoginHandler.inst.savePrivacyStatus(true);
             this.scheduleOnce(() => {
                 ADHandler.inst.showAd(AD_TYPE.Start);
+                //先关闭,同意直接进游戏
+                // ServerHandler.inst.getAccountInfo();
                 oops.gui.remove(UIID.KindTips);
             }, 0.2)
         }

+ 3 - 2
assets/script/game/common/tips/RetentionView.ts

@@ -2,7 +2,7 @@
  * @Author: mojunshou 1637302775@qq.com
  * @Date: 2025-03-19 18:02:51
  * @LastEditors: mojunshou 1637302775@qq.com
- * @LastEditTime: 2025-04-22 11:35:10
+ * @LastEditTime: 2025-04-25 17:22:44
  * @Description: 隐私挽留弹窗
  */
 import { _decorator, game } from 'cc';
@@ -15,6 +15,7 @@ import { CocosHandler } from '../manager/CocosHandler';
 import { ADHandler } from '../manager/ADHandler';
 import { LoginHandler } from '../manager/LoginHandler';
 import { DCHandler } from '../manager/DCHandler';
+import { ServerHandler } from '../manager/ServerHandler';
 const { ccclass, property } = _decorator;
 
 @ccclass('RetentionView')
@@ -27,10 +28,10 @@ export class RetentionView extends GameComponent {
         DCHandler.inst.reportData(3000002);
         //调用安卓给权限
         if (DeviceUtil.isNative && DeviceUtil.isAndroid) {
-            // CocosHandler.inst.ad_interstitial_start();
             LoginHandler.inst.savePrivacyStatus(true);
             this.scheduleOnce(() => {
                 ADHandler.inst.showAd(AD_TYPE.Start);
+                // ServerHandler.inst.getAccountInfo();
                 oops.gui.remove(UIID.Retention);
             }, 0.2)
 

+ 7 - 6
assets/script/game/view/DoubleRewardsView.ts

@@ -2,7 +2,7 @@
  * @Author: mojunshou 1637302775@qq.com
  * @Date: 2025-03-21 11:57:43
  * @LastEditors: mojunshou 1637302775@qq.com
- * @LastEditTime: 2025-04-25 15:03:54
+ * @LastEditTime: 2025-04-25 11:10:04
  * @Description: 惊喜翻倍弹窗
  */
 import { _decorator, instantiate, Label, Node, Prefab, UITransform } from 'cc';
@@ -14,6 +14,7 @@ import { ADHandler } from '../common/manager/ADHandler';
 import { smc } from '../common/SingletonModuleComp';
 import { BricsItem } from './BricsItem';
 import { DCHandler } from '../common/manager/DCHandler';
+import { ServerHandler } from '../common/manager/ServerHandler';
 
 const { ccclass, property } = _decorator;
 
@@ -78,9 +79,8 @@ export class DoubleRewardsView extends VMParent {
 
 
     btn_alittle() {
-        // ServerHandler.inst.getLittleRewards();
         oops.gui.remove(UIID.DoubleRewards);
-        //插屏广告
+        ServerHandler.inst.getLittleRewards();
         ADHandler.inst.showAd(AD_TYPE.Double_Close);
         DCHandler.inst.reportData(2000401);
         DCHandler.inst.reportData(2000403);
@@ -104,13 +104,14 @@ export class DoubleRewardsView extends VMParent {
                 if (this.isAuto) {
                     this.isAuto = false;
                     oops.gui.remove(UIID.DoubleRewards);
-                    //插屏广告
+                    ServerHandler.inst.getLittleRewards();
                     ADHandler.inst.showAd(AD_TYPE.Double_Close);
                     DCHandler.inst.reportData(2000402);
                     DCHandler.inst.reportData(2000403);
                 }
-
-                this.unschedule(this.callback);
+                if (this.callback) {
+                    this.unschedule(this.callback);
+                }
             }
         }
         this.schedule(this.callback, 1, this.data.time - 1);