소스 검색

增加提现时弹出全屏广告

kaka 4 년 전
부모
커밋
57bcc7bf70

+ 13 - 1
assets/script/game/data/AdData.ts

@@ -50,6 +50,8 @@ export class AdData {
     private ABCInsertAdPercentArr = [];
     /** 概率弹出AB插屏广告ecpm等级数组 */
     private ABCInsertAdArr = [];
+    /** 提现弹出全屏ecpm等级数据 */
+    private FullCsahAdArr = [];
 
     public init() {
         this.adMap = new Map<number, Data>();
@@ -211,6 +213,8 @@ export class AdData {
             this.ABCInsertAdPercentArr[i] = per;
         }
         this.ABCInsertAdArr = gData.gameData.configs.ServerConfig.ABInsertAd.split(',');
+
+        this.FullCsahAdArr = gData.gameData.configs.ServerConfig.FullCsahAd.split(',');
     }
 
     /** 设置用户ecpm分级, 自动弹窗字典等 */
@@ -299,6 +303,14 @@ export class AdData {
         this.checkShowFullInter(index);
     }
 
+    /** 点击提现弹出全屏插屏 */
+    checkPopCashFull() {
+        if (this.FullCsahAdArr.indexOf(this.ecpmLevel.toString()) == -1) {
+            return;
+        }
+        mk.ad.showInterAd(1);
+    }
+
     //定时弹出计时
     private timeAd = 0;
     /** 定时弹出红包 */
@@ -309,7 +321,7 @@ export class AdData {
 
         this.timeAd += dt;
         let span = this.AutoRedMoneyMap.get(this.ecpmLevel);
-        if (this.timeAd >= span * 1000) {
+        if (this.timeAd >= span) {
             this.timeAd = 0;
             mk.ui.openPanel('module/newOpenRedBag/newOpenRedBag');
         }

+ 9 - 7
assets/script/game/module/gradeReward/GradeRewardItem.ts

@@ -86,13 +86,15 @@ export class GradeRewardItem extends cc.Component{
             JsbSystem.WxAuth();
             return;
         }
-        mk.ad.videoAdType = VideoAdType.farmGradeCashOut;
-        mk.ad.watchAd((success: boolean) => {
-            mk.console.log("watchFarmAd:" + success);
-            if (success) {     
-                gData.farmGradeData.HttpCashOut(this.data.id);            
-            }
-        });
+
+        gData.adData.checkPopCashFull();
+        gData.farmGradeData.HttpCashOut(this.data.id);            
+        // mk.ad.videoAdType = VideoAdType.farmGradeCashOut;
+        // mk.ad.watchAd((success: boolean) => {
+        //     mk.console.log("watchFarmAd:" + success);
+        //     if (success) {     
+        //     }
+        // });
     }
 
     private clickNoReachBtn(){

+ 11 - 17
assets/script/game/module/newCashUI/WalletCashOut.ts

@@ -18,11 +18,11 @@ export default class WalletCashOut extends cc.Component {
     @property({ displayName: '下提示', type: cc.Label })
     private lbl_tip: cc.Label = null;
 
-    @property({displayName: '提现按钮文本', type: cc.Label})
+    @property({ displayName: '提现按钮文本', type: cc.Label })
     private lbl_cashOut: cc.Label = null;
-    @property({displayName: '新手描述', type: cc.Label})
+    @property({ displayName: '新手描述', type: cc.Label })
     private lbl_noviceTitle: cc.Label = null;
-    @property({displayName: '新手金额', type: cc.Label})
+    @property({ displayName: '新手金额', type: cc.Label })
     private lbl_noviceValue: cc.Label = null;
     @property({ displayName: '上提示', type: cc.Label })
     private lbl_tipUp: cc.Label = null;
@@ -49,11 +49,9 @@ export default class WalletCashOut extends cc.Component {
         }
     }
 
-    private initNoviceUI()
-    {
+    private initNoviceUI() {
         let data = gData.gameData.gameData.userNoviceWeFareInfo;
-        if(data)
-        {
+        if (data) {
             this.lbl_noviceTitle.string = data.name + ':';
             this.sp_progress.fillRange = data.progressRate;
             let value = data.cashmoney / 100;
@@ -64,10 +62,8 @@ export default class WalletCashOut extends cc.Component {
         }
     }
 
-    update(dt)
-    {
-        if(gData.walletCashOutData.init_novice)
-        {
+    update(dt) {
+        if (gData.walletCashOutData.init_novice) {
             this.initNoviceUI();
             gData.walletCashOutData.init_novice = false;
         }
@@ -98,7 +94,7 @@ export default class WalletCashOut extends cc.Component {
 
     private clickCashOutBtn() {
         mk.audio.playEffect("button");
-
+        gData.adData.checkPopCashFull();
         //this.check_button[this.curChooseIndex].setIsCanNotChoose();
     }
 
@@ -137,12 +133,10 @@ export default class WalletCashOut extends cc.Component {
         mk.audio.playEffect("button");
 
         let data = gData.gameData.gameData.userNoviceWeFareInfo;
-        if(data)
-        {
-            if(data.progressRate >= 1)
-            {
+        if (data) {
+            if (data.progressRate >= 1) {
                 gData.walletCashOutData.HttpCashOut(this.intV);
-            }else{
+            } else {
                 mk.tip.pop(`满${this.intV}元提现`);
             }
 

+ 0 - 2
assets/script/game/module/newNotice/NewNotice.ts

@@ -29,7 +29,5 @@ export default class NewNotice extends cc.Component {
     }
 
     private clickCloseBtn() {
-        gData.adData.checkShowFullInter(1);
     }
-
 }

+ 1 - 0
assets/script/game/module/redBagCash/RedBagCashItem.ts

@@ -92,6 +92,7 @@ export default class RedBagCashItem extends cc.Component {
             mk.data.sendXYEvent("cash_" + times, "第" + times + "次提现");
         }
         gData.redBagCash.cashOP();
+        gData.adData.checkPopCashFull();
     }
 
     onDestroy() {

+ 1 - 0
assets/script/game/module/redBagTask/RedBagTask.ts

@@ -172,6 +172,7 @@ export default class RedBagTask extends cc.Component {
     private clickGetRewardBtn() {
         //gData.receiptNotice.receip_rmb = gData.blessingBag.rbNum;
         //mk.ui.openPanel('module/newNotice/newNotice');
+        gData.adData.checkPopCashFull();
     }
 
     /**