Ver Fonte

点击去重

wuwangdong há 4 anos atrás
pai
commit
067db5c103

+ 8 - 1
assets/script/mk/sdk/ad/toppon/AnyThinkAdsMgr/ATBanner.ts

@@ -19,6 +19,8 @@ export default class ATBanner extends zgSingleton {
     /**是否观看完毕 */
     public ifWatchEnd: boolean = false;
 
+    private singleClick = false;
+
     init() {
 
         this.ATBannerJS = cc["ATBannerJS"];
@@ -130,7 +132,7 @@ export default class ATBanner extends zgSingleton {
         let data = JSON.parse(callbackInfo);
         gData.adData.updateADLog(7, placementId, data);
 
-
+        this.singleClick = true;
     }
 
     /**
@@ -145,6 +147,11 @@ export default class ATBanner extends zgSingleton {
         mk.data.sendDataEvent(DataEventId.Ad_click, mk.ad.bannerAdType);
         let data = JSON.parse(callbackInfo);
         gData.adData.updateADLog(55, placementId, data);
+
+        if (this.singleClick) {
+            this.singleClick = false;
+            gData.adData.updateADLog(75, placementId, data);
+        }
     }
 
     /** banner自动刷新成功 */

+ 13 - 0
assets/script/mk/sdk/ad/toppon/AnyThinkAdsMgr/ATInterstitial.ts

@@ -18,6 +18,9 @@ export default class ATInterstitial extends zgSingleton {
     /** 是否加载完显示 */
     private ifLoadShowArr: Array<boolean> = new Array();
 
+    private singleClick = false;
+    private singleClickFull = false;
+
     /** 初始化 */
     async init() {
         this.ATInterstitialJS = cc["ATInterstitialJS"];
@@ -162,9 +165,11 @@ export default class ATInterstitial extends zgSingleton {
         mk.console.logSingle('ATInterstitialJS  ', 'onInterstitialAdShow ' + type);
         if (type == 0) {
             id = 2
+            this.singleClick = true;
         }
         else if (type == 1) {
             id = 9
+            this.singleClickFull = true;
             mk.data.sendDataEvent(DataEventId.interstitial2_init, mk.ad.interFullAdType);
         }
         gData.adData.updateADLog(id, placementId, data);
@@ -182,10 +187,18 @@ export default class ATInterstitial extends zgSingleton {
         if (type == 1) {
             mk.data.sendDataEvent(DataEventId.Ad_click, mk.ad.interFullAdType);
             gData.adData.updateADLog(56, placementId, data);
+            if (this.singleClickFull) {
+                this.singleClickFull = false;
+                gData.adData.updateADLog(76, placementId, data);
+            }
         }
         else {
             mk.data.sendDataEvent(DataEventId.Ad_click, mk.ad.interAdType);
             gData.adData.updateADLog(52, placementId, data);
+            if (this.singleClick) {
+                this.singleClick = false;
+                gData.adData.updateADLog(72, placementId, data);
+            }
         }
         // let data = JSON.parse(callbackInfo)
 

+ 8 - 1
assets/script/mk/sdk/ad/toppon/AnyThinkAdsMgr/ATNative.ts

@@ -17,7 +17,7 @@ export class ATNative extends zgSingleton {
     /** 是否加载显示 */
     private ifLoadShow: boolean = false;
 
-
+    private singleClick = false;
     /** 初始化 */
     init() {
         this.ATNativeJS = cc["ATNativeJS"];
@@ -192,6 +192,8 @@ export class ATNative extends zgSingleton {
 
         let data = JSON.parse(callbackInfo)
         gData.adData.updateADLog(3, placementId, data);
+
+        this.singleClick = true;
     }
 
     /**
@@ -203,6 +205,11 @@ export class ATNative extends zgSingleton {
         // ATJSSDK.printLog("AnyThinkNativeDemo::onNativeAdClick(" + placementId + ", " + callbackInfo + ")");
         let data = JSON.parse(callbackInfo)
         gData.adData.updateADLog(53, placementId, data);
+
+        if (this.singleClick) {
+            this.singleClick = false;
+            gData.adData.updateADLog(73, placementId, data);
+        }
     }
 }
 

+ 8 - 0
assets/script/mk/sdk/ad/toppon/AnyThinkAdsMgr/ATRewardVideo.ts

@@ -18,6 +18,8 @@ export class ATRewardVideo extends zgSingleton {
     public ifLoadShow: boolean = false;
     /**是否观看完毕 */
     public canGet: boolean = false;
+    /** 去重点击状态 */
+    private singleClick = false;
 
     init() {
         this.ATRewardVideoJS = cc["ATRewardVideoJS"];
@@ -146,6 +148,7 @@ export class ATRewardVideo extends zgSingleton {
 
         //点击关闭的时候重新加载(亲测,即使在start这边 加载 也是在点击关闭时候才返回成功)
         //this.loadAd();
+        this.singleClick = true;
     }
 
     /**
@@ -202,6 +205,11 @@ export class ATRewardVideo extends zgSingleton {
         mk.data.sendDataEvent(DataEventId.Ad_click, mk.ad.videoAdType);
         let data = JSON.parse(callbackInfo)
         gData.adData.updateADLog(51, placementId, data);
+
+        if (this.singleClick) {
+            this.singleClick = false;
+            gData.adData.updateADLog(71, placementId, data);
+        }
     }
 
     /**

+ 6 - 0
assets/script/mk/system/JsbSystem.ts

@@ -513,6 +513,7 @@ export default class JsbSystem {
         }
     }
 
+    private static singleClick = true;
     private static splashADid = '';
     /** 上传开屏广告星云埋点 */
     public static updateSplashAdLog(info) {
@@ -545,6 +546,11 @@ export default class JsbSystem {
     public static clickSplash() {
         mk.data.sendDataEvent(DataEventId.Ad_click, 'splash_click');
         gData.adData.updateADLog(54, this.splashADid);
+
+        if (this.singleClick) {
+            this.singleClick = false;
+            gData.adData.updateADLog(74, this.splashADid);
+        }
     }
 
     /** 获取阿里风控设备token */