Browse Source

feat:提交广告修复

zouwuqiang 1 year ago
parent
commit
0b0635ce08
1 changed files with 31 additions and 27 deletions
  1. 31 27
      assets/script/game/checkpoint/view/CheckpointMainViewComp.ts

+ 31 - 27
assets/script/game/checkpoint/view/CheckpointMainViewComp.ts

@@ -79,6 +79,7 @@ export class CheckpointMainViewComp extends CCComp {
         } else {
             btnReward.active = false
         }
+        // btnReward.active = true
     }
 
     initLevel() {
@@ -130,15 +131,16 @@ export class CheckpointMainViewComp extends CCComp {
                     oops.gui.toast('该关卡使用次数已满')
                     return
                 }
-                if (sys.platform === sys.Platform.WECHAT_GAME) {
-                    oops.gui.open(UIID.ClearCell);
-                } else {
-                    AdManager.getInstance().showRewardVideoAd(() => {
-                        console.log('成功看完广告')
-                        ecs.getSingleton(SingletonModuleComp).account.checkpoint.add(ClearCellOperationComp)
-                        ecs.getSingleton(SingletonModuleComp).account.checkpoint.CheckpointModelBase.vm.clearCount += 1
-                    })
-                }
+                oops.gui.open(UIID.ClearCell);
+                // if (sys.platform === sys.Platform.WECHAT_GAME) {
+                //     oops.gui.open(UIID.ClearCell);
+                // } else {
+                //     AdManager.getInstance().showRewardVideoAd(() => {
+                //         console.log('成功看完广告')
+                //         ecs.getSingleton(SingletonModuleComp).account.checkpoint.add(ClearCellOperationComp)
+                //         ecs.getSingleton(SingletonModuleComp).account.checkpoint.CheckpointModelBase.vm.clearCount += 1
+                //     })
+                // }
 
                 break;
             case "btn_add_cell":
@@ -146,15 +148,16 @@ export class CheckpointMainViewComp extends CCComp {
                     oops.gui.toast('该关卡使用次数已满')
                     return
                 }
-                if (sys.platform === sys.Platform.WECHAT_GAME) {
-                    oops.gui.open(UIID.AddCell);
-                } else {
-                    AdManager.getInstance().showRewardVideoAd(() => {
-                        console.log('成功看完广告')
-                        ecs.getSingleton(SingletonModuleComp).account.checkpoint.add(AddCellOperationComp)
-                        ecs.getSingleton(SingletonModuleComp).account.checkpoint.CheckpointModelBase.vm.addCellCount += 1
-                    })
-                }
+                oops.gui.open(UIID.AddCell);
+                // if (sys.platform === sys.Platform.WECHAT_GAME) {
+                    // oops.gui.open(UIID.AddCell);
+                // } else {
+                //     AdManager.getInstance().showRewardVideoAd(() => {
+                //         console.log('成功看完广告')
+                //         ecs.getSingleton(SingletonModuleComp).account.checkpoint.add(AddCellOperationComp)
+                //         ecs.getSingleton(SingletonModuleComp).account.checkpoint.CheckpointModelBase.vm.addCellCount += 1
+                //     })
+                // }
 
                 break;
             case "btn_leave":
@@ -165,15 +168,16 @@ export class CheckpointMainViewComp extends CCComp {
                     oops.gui.toast('该关卡使用次数已满')
                     return
                 }
-                if (sys.platform === sys.Platform.WECHAT_GAME) {
-                    oops.gui.open(UIID.VehicleLeave);
-                } else {
-                    AdManager.getInstance().showRewardVideoAd(() => {
-                        console.log('成功看完广告')
-                        ecs.getSingleton(SingletonModuleComp).account.checkpoint.add(FullVehicleOperationComp)
-                        ecs.getSingleton(SingletonModuleComp).account.checkpoint.CheckpointModelBase.vm.leaveCount += 1
-                    })
-                }
+                oops.gui.open(UIID.VehicleLeave);
+                // if (sys.platform === sys.Platform.WECHAT_GAME) {
+                    // oops.gui.open(UIID.VehicleLeave);
+                // } else {
+                //     AdManager.getInstance().showRewardVideoAd(() => {
+                //         console.log('成功看完广告')
+                //         ecs.getSingleton(SingletonModuleComp).account.checkpoint.add(FullVehicleOperationComp)
+                //         ecs.getSingleton(SingletonModuleComp).account.checkpoint.CheckpointModelBase.vm.leaveCount += 1
+                //     })
+                // }
                 break;
             case "btn_reward":
                 oops.gui.open(UIID.SideReward);