Просмотр исходного кода

Merge branch 'master' of git.mokasz.com:zouyong/team1_nc

wuwangdong 4 лет назад
Родитель
Сommit
a86d0e7a32

+ 20 - 6
assets/resources/game/coregame/coregame.prefab

@@ -36,14 +36,14 @@
     "_active": true,
     "_components": [
       {
-        "__id__": 3781
+        "__id__": 3782
       },
       {
         "__id__": 190
       }
     ],
     "_prefab": {
-      "__id__": 3782
+      "__id__": 3783
     },
     "_opacity": 255,
     "_color": {
@@ -2010,7 +2010,7 @@
   {
     "__type__": "cc.Node",
     "_name": "MapIconGroup",
-    "_objFlags": 512,
+    "_objFlags": 0,
     "_parent": {
       "__id__": 1
     },
@@ -129342,11 +129342,11 @@
         "__id__": 3778
       },
       {
-        "__id__": 3779
+        "__id__": 3780
       }
     ],
     "_prefab": {
-      "__id__": 3780
+      "__id__": 3781
     },
     "_opacity": 255,
     "_color": {
@@ -129439,10 +129439,24 @@
     "bool_Auth": false,
     "open_type": 0,
     "transition_type": 0,
-    "onComplete": [],
+    "onComplete": [
+      {
+        "__id__": 3779
+      }
+    ],
     "_id": ""
   },
   {
+    "__type__": "cc.ClickEvent",
+    "target": {
+      "__id__": 1
+    },
+    "component": "",
+    "_componentId": "3ce4faupUVCZ5MuSxfK3NSJ",
+    "handler": "clickSpeedup",
+    "customEventData": ""
+  },
+  {
     "__type__": "cc.Animation",
     "_name": "",
     "_objFlags": 0,

Разница между файлами не показана из-за своего большого размера
+ 111 - 374
assets/resources/game/prefab/game.prefab


+ 2 - 1
assets/script/before/main/FactoryIcon.ts

@@ -1,4 +1,4 @@
-import { ExpAddType, FactroyState, GameProp, ProductType } from "../../game/data/GameData";
+import { DataEventId, ExpAddType, FactroyState, GameProp, ProductType } from "../../game/data/GameData";
 import { MoveToCenter } from "../map/MoveToCenter";
 import ProductShow from "../view/ProductShow";
 import { FarmCountDown } from "./FarmCountDown";
@@ -116,6 +116,7 @@ export class FactoryIcon extends cc.Component {
                 break;
             case FactroyState.Sick:
                 // mk.tip.pop(`生虫了!`);
+                mk.data.sendDataEvent(DataEventId.button_click, "停电icon");
                 gData.adClearSickData.openPanel(this.tab, this.configID);
                 break;
         }

+ 3 - 1
assets/script/before/main/FarmIcon.ts

@@ -1,4 +1,4 @@
-import { ExpAddType, FarmState, GameProp, ProductType } from '../../game/data/GameData';
+import { DataEventId, ExpAddType, FarmState, GameProp, ProductType } from '../../game/data/GameData';
 import { MoveToCenter } from '../map/MoveToCenter';
 import ProductShow from '../view/ProductShow';
 import { FarmCountDown } from './FarmCountDown';
@@ -120,6 +120,7 @@ export class FarmIcon extends cc.Component {
                 mk.tip.pop(`点击拓建即可解锁农田`);
                 break;
             case FarmState.CanUnlock:
+                mk.data.sendDataEvent(DataEventId.button_click, "拓建icon");
                 gData.adUnlockData.openPanel(this.configID);
                 break;
             case FarmState.Empty:
@@ -135,6 +136,7 @@ export class FarmIcon extends cc.Component {
                 break;
             case FarmState.Sick:
                 // mk.tip.pop(`生虫了!`);
+                mk.data.sendDataEvent(DataEventId.button_click, "生虫icon");
                 gData.adClearSickData.openPanel(ProductType.nzw, this.configID);
                 break;
         }

+ 2 - 1
assets/script/before/main/PastureIcon.ts

@@ -1,6 +1,6 @@
 /** 养殖类 */
 
-import { AnimalState, ExpAddType, GameProp, PastureState, ProductType } from "../../game/data/GameData";
+import { AnimalState, DataEventId, ExpAddType, GameProp, PastureState, ProductType } from "../../game/data/GameData";
 import { MoveToCenter } from "../map/MoveToCenter";
 import Animals from "../view/Animals";
 import ProductShow from "../view/ProductShow";
@@ -175,6 +175,7 @@ export default class PastureIcon extends cc.Component {
                 break;
             case PastureState.Sick:
                 // mk.tip.pop(`生虫了!`);
+                mk.data.sendDataEvent(DataEventId.button_click, "生病icon");
                 gData.adClearSickData.openPanel(ProductType.dw, this.configID);
                 break;
         }

+ 5 - 0
assets/script/before/map/MapMove.ts

@@ -1,3 +1,4 @@
+import { DataEventId } from "../../game/data/GameData";
 import Util from "../util/Util";
 
 const { ccclass, property } = cc._decorator;
@@ -111,7 +112,11 @@ export class MapMove extends cc.Component {
 
     private clickMapBookBtn() {
         mk.ui.openPanel('module/farmMap/farmMap');
+        mk.data.sendDataEvent(DataEventId.button_click, "图鉴icon");
     }
 
+    private clickSpeedup() {
+        mk.data.sendDataEvent(DataEventId.button_click, "全体加速icon");
+    }
 }
 

+ 14 - 1
assets/script/before/view/ui/ADClearSickPanel.ts

@@ -1,6 +1,6 @@
 /** 清除害虫 */
 
-import { ProductType } from "../../../game/data/GameData";
+import { ProductType, VideoAdType } from "../../../game/data/GameData";
 
 const { ccclass, property } = cc._decorator;
 
@@ -46,6 +46,19 @@ export default class ADClearSickPanel extends cc.Component {
 
     clickWatchVideo() {
         mk.ui.closePanel(this.node.name);
+
+        switch (gData.adClearSickData.tab) {
+            case ProductType.nzw:
+                mk.ad.videoAdType = VideoAdType.video_init_7;
+                break;
+            case ProductType.dw:
+                mk.ad.videoAdType = VideoAdType.video_init_8;
+                break;
+            default:
+                mk.ad.videoAdType = VideoAdType.video_init_9;
+                break;
+        }
+
         mk.ad.watchAd((success: boolean) => {
             mk.console.log("watchAD:" + success);
             if (success) {

+ 3 - 0
assets/script/before/view/ui/ADUnlockPanel.ts

@@ -1,9 +1,12 @@
+import { VideoAdType } from "../../../game/data/GameData";
+
 /** 解锁农田界面 */
 const { ccclass, property } = cc._decorator;
 
 @ccclass
 export default class ADUnlockPanel extends cc.Component {
     clickWatchVideo() {
+        mk.ad.videoAdType = VideoAdType.video_init_11;
         mk.ad.watchAd((success: boolean) => {
             mk.console.log("watchAD:" + success);
             if (success) {

+ 2 - 0
assets/script/before/view/ui/HarvestPanel.ts

@@ -3,6 +3,7 @@
  */
 
 import { AdFun } from "../../../game/data/AdData";
+import { VideoAdType } from "../../../game/data/GameData";
 
 const { ccclass, property } = cc._decorator;
 
@@ -28,6 +29,7 @@ export default class HarvestPanel extends cc.Component {
         // mk.ad.destroyNativeAd();
         await mk.time.WaitForSeconds(0.3);
         // 看广告
+        mk.ad.videoAdType = VideoAdType.video_init_12;
         mk.ad.watchAd(async (success: boolean) => {
             mk.console.log("watchAD:" + success);
             if (success) {

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

@@ -1,6 +1,6 @@
 import Util from "../../before/util/Util";
 import { Data } from "../../mk/data/Data";
-import { GameProp } from "./GameData";
+import { GameProp, VideoAdType } from "./GameData";
 
 /**
  * @description 广告数据
@@ -336,6 +336,7 @@ export class AdData {
         let span = this.AutoRedMoneyMap.get(this.ecpmLevel);
         if (this.timeAd >= span) {
             this.timeAd = 0;
+            mk.ad.videoAdType = VideoAdType.video_init_19;
             mk.ui.openPanel('module/newOpenRedBag/newOpenRedBag');
         }
     }
@@ -360,6 +361,7 @@ export class AdData {
             this.clickTimesAdd = 0;
             this.setPopClickTimes();
             if (Math.random() <= this.getPerByEcpm()) {
+                mk.ad.videoAdType = VideoAdType.video_init_17;
                 mk.ui.openPanel('module/newOpenRedBag/newOpenRedBag');
             }
         }

+ 29 - 33
assets/script/game/data/GameData.ts

@@ -174,7 +174,7 @@ export class GameData {
         this.gameData.userNoviceWeFareInfo = res_data.userNoviceWeFareInfo;
         this.gameData.redMoneyCashPayRecordList = res_data.redMoneyCashPayRecordList;
         this.gameData.userFarmTaskInfo = res_data.userFarmTaskInfo;
-        
+
         mk.data.setTAUserID(gData.loginData.uin);
 
         if (gData.loginData.isFirstIn) {
@@ -265,8 +265,7 @@ export class GameData {
         this.initFarmMapGetRewardData();
 
         let isNewTask = this.getProp(GameProp.redBagTaskRefresh);
-        if(isNewTask != undefined)
-        {
+        if (isNewTask != undefined) {
             this.init_redBagTask = isNewTask;
         }
     }
@@ -464,6 +463,7 @@ export class GameData {
                 gData.gameData.nextMake = null;
                 this.nextMake = null;
                 this.setNextProduct(false);
+                gData.adData.checkPopRed();
                 break;
             case 2:
                 gData.pastureSystem.btnMake();
@@ -477,6 +477,7 @@ export class GameData {
                 gData.gameData.nextMake = null;
                 this.nextMake = null;
                 this.setNextProduct(false);
+                gData.adData.checkPopRed();
                 break;
         }
     }
@@ -1132,14 +1133,10 @@ class PlayerProp {
     //任务红;
     userFarmTaskInfo = null;
 
-    getRedMoneyCashOutTimesByIndex(index: number):number
-    {
-        if(this.redMoneyCashPayRecordList)
-        {
-            for(let i = 0; i != this.redMoneyCashPayRecordList.length; ++i)
-            {
-                if(index == this.redMoneyCashPayRecordList[i].index)
-                {
+    getRedMoneyCashOutTimesByIndex(index: number): number {
+        if (this.redMoneyCashPayRecordList) {
+            for (let i = 0; i != this.redMoneyCashPayRecordList.length; ++i) {
+                if (index == this.redMoneyCashPayRecordList[i].index) {
                     return this.redMoneyCashPayRecordList[i].freuency;
                 }
             }
@@ -1291,6 +1288,8 @@ export enum DataEventId {
     button_click = "button_click",
     /** 看视频 */
     video_init = "video_init",
+    /** 点击视频 */
+    video_click = "video_click",
     /** 看视频完成 */
     video_end = "video_end",
     /** 福袋功能 */
@@ -1314,28 +1313,25 @@ export enum DataEventId {
 
 /** 视频广告类型 */
 export enum VideoAdType {
-    Null = "",
-    /** 关卡积分红包 */
-    LevelScoreRedBag = "关卡积分红包",
-    /** 主界面气泡红包 */
-    StartQiPaoRedBag = "主界面气泡红包",
-    /** 关卡气泡红包 */
-    LevelQiPaoRedBag = "关卡气泡红包",
-    /** 转盘 */
-    Turntable = "转盘视频",
-    /** 福袋视频" */
-    Fudai = "福袋视频",
-    /** 签到视频 */
-    Sign = "签到视频",
-
-    //钱包提现新手视频
-    CashOutNoviceWelfare = "钱包提现新手视频",
-    //钱包提现加现金视频
-    CashOutAddCash = "钱包提现加现金视频",
-    //农场等级加经验视频
-    farmGradeAddExp = "农场等级加经验视频",
-    //农场等级提现视频
-    farmGradeCashOut = "农场等级提现视频",
+    video_init_1 = '农场加等级经验',
+    video_init_2 = '提现-加进度',
+    video_init_3 = '提现-加现金',
+    video_init_4 = '签到',
+    video_init_5 = '抽奖',
+    video_init_6 = '图鉴领奖',
+    video_init_7 = '消灭害虫',
+    video_init_8 = '恢复健康',
+    video_init_9 = '恢复供电',
+    video_init_10 = '山羊红包',
+    video_init_11 = '拓建',
+    video_init_12 = '收获',
+    video_init_13 = '飘浮红包',
+    video_init_14 = '全体加速',
+    video_init_15 = '福利加进度',
+    video_init_16 = '生产加次数',
+    video_init_17 = '点击生产按钮',
+    video_init_18 = '离开游戏领红包',
+    video_init_19 = '定时弹出红包',
 }
 
 export enum ExpAddType {

+ 2 - 0
assets/script/game/game/AniControl.ts

@@ -1,3 +1,4 @@
+import { VideoAdType } from "../data/GameData";
 
 const { ccclass, property } = cc._decorator;
 
@@ -246,6 +247,7 @@ export default class AniControl extends cc.Component {
             this.moveDogFinished();
             mk.fly.PlayCoinAnim(1, 5, this.dogMove.node, '', null, -1 ,2);
         } else if (customEvenData == 'sheep') {
+            mk.ad.videoAdType = VideoAdType.video_init_10;
             mk.ui.openPanel('module/newOpenRedBag/newOpenRedBag');
             //mk.fly.PlayCoinAnim(1, 5, this.moveSheep.node);
         }

+ 33 - 20
assets/script/game/game/Game.ts

@@ -14,8 +14,6 @@ export class RedPoinNode {
 @ccclass
 export default class Game extends cc.Component {
 
-    @property({ type: cc.Node, displayName: "游戏核心玩法" })
-    node_gameplay: cc.Node = null;
     @property({ type: cc.Node, displayName: "功能按钮" })
     node_btn: cc.Node = null;
     @property({ type: cc.Label, displayName: "红包币" })
@@ -181,13 +179,12 @@ export default class Game extends cc.Component {
         this.lbl_redMoney.string = gData.gameData.gameData.redMoney + "";
         gData.gameData.init_coin = false;
 
-        if(gData.gameData.gameData.userFarmTaskInfo)
-        {
+        if (gData.gameData.gameData.userFarmTaskInfo) {
             let com = gData.gameData.gameData.userFarmTaskInfo.completeCount;
             let count = gData.gameData.gameData.userFarmTaskInfo.taskCount;
             this.lbl_task.string = `<b><color=#8D4D32>进行${count}次生产</c><color=#7EB80E>(${com}/${count})</color></b>`
         }
-        
+
     }
 
     private changeInfo() {
@@ -204,13 +201,12 @@ export default class Game extends cc.Component {
 
     private changeTaskUI() {
         cc.tween(this.lbl_task.node).to(0.1, { scale: 1.2 }).to(0.1, { scale: 1 }).start();
-        if(gData.gameData.gameData.userFarmTaskInfo)
-        {
+        if (gData.gameData.gameData.userFarmTaskInfo) {
             let com = gData.gameData.gameData.userFarmTaskInfo.completeCount;
             let count = gData.gameData.gameData.userFarmTaskInfo.taskCount;
             this.lbl_task.string = `<b><color=#8D4D32>进行${count}次生产</c><color=#7EB80E>(${com}/${count})</color></b>`
         }
-   
+
         gData.gameData.init_task = false;
     }
 
@@ -316,26 +312,21 @@ export default class Game extends cc.Component {
         // mk.fly.PlayCoinAnim(2, 20, cc.v2(0, -300), 'Canvas/主界面层/game/功能按钮/右侧按钮/btn2');
     }
 
-    /** 点击开始 */
-    public onClickStart(a, b) {
-        mk.data.sendDataEvent(DataEventId.button_click, "开始游戏icon");
-        this.node_gameplay.active = true;
-    }
-
     /** 点击互推 */
     public onClickHuTui() {
         mk.data.sendDataEvent(DataEventId.button_click, "互推icon");
     }
 
-    /** 点击福利礼包 */
+    /** 点击福利 */
     public onClickFuli() {
-        mk.data.sendDataEvent(DataEventId.button_click, "福利礼包icon");
+        mk.data.sendDataEvent(DataEventId.button_click, "福利icon");
     }
 
-    /** 点击气泡红包 */
+    /** 点击漂浮红包 */
     public onClickQipaoRedBag() {
-        mk.ad.videoAdType = VideoAdType.StartQiPaoRedBag;
-        mk.data.sendDataEvent(DataEventId.button_click, "气泡红包icon");
+        mk.data.sendDataEvent(DataEventId.button_click, "飘浮红包icon");
+        mk.ad.videoAdType = VideoAdType.video_init_13;
+        mk.ui.openPanel('module/newOpenRedBag/newOpenRedBag');
     }
 
     /** 点击红包提现 */
@@ -355,7 +346,7 @@ export default class Game extends cc.Component {
 
     /**  */
     public onClickTurntable() {
-        mk.data.sendDataEvent(DataEventId.button_click, "转盘icon");
+        mk.data.sendDataEvent(DataEventId.button_click, "抽奖icon");
     }
 
     /** 点击签到 */
@@ -379,6 +370,26 @@ export default class Game extends cc.Component {
         JsbSystem.sharePic();
     }
 
+    /** 点击农场等级奖励 */
+    public onClickGradeReward() {
+        mk.data.sendDataEvent(DataEventId.button_click, "农场等级领奖按钮");
+    }
+
+    /** 点击红包币提现 */
+    public onClickWalletCash() {
+        mk.data.sendDataEvent(DataEventId.button_click, "红包币提现按钮");
+    }
+
+    /** 点击任务 */
+    public onClickTask() {
+        mk.data.sendDataEvent(DataEventId.button_click, "任务红包icon");
+    }
+
+    /** 点击邀请 */
+    public onClickInvite() {
+        mk.data.sendDataEvent(DataEventId.button_click, "邀请icon");
+    }
+
     /** 点击种植 */
     public onClickPlant() {
         if (gData.gameData.leftTimes <= 0) {
@@ -401,6 +412,8 @@ export default class Game extends cc.Component {
         }, 1)
     }
 
+
+
     public doFlyExpAni(exp: number, startPos: cc.Node, data) {
         let pos = this.lbl_farmLevel.node.parent.convertToWorldSpaceAR(this.lbl_farmLevel.node.getPosition());
         mk.fly.PlayCoinAnim(2, 3, startPos, pos, () => {

+ 1 - 1
assets/script/game/module/blessingBag/BlessingBag.ts

@@ -243,7 +243,7 @@ export default class BlessingBag extends cc.Component {
             gData.blessingBag.addProgress();
         } else {
             //if (gData.blessingBag.videoRbData.leftVideoTimes > 0) {
-            mk.ad.videoAdType = VideoAdType.Fudai;
+            mk.ad.videoAdType = VideoAdType.video_init_15;
             mk.ad.watchAd((success: boolean) => {
                 mk.console.log("watchAD:" + success);
                 if (success) {

+ 41 - 45
assets/script/game/module/farmMap/FarmItem.ts

@@ -1,106 +1,98 @@
-import { ProductType } from "../../data/GameData";
+import { ProductType, VideoAdType } from "../../data/GameData";
 
 const { ccclass, property } = cc._decorator;
 @ccclass
-export default class FarmItem extends cc.Component{
+export default class FarmItem extends cc.Component {
 
-    @property({displayName: '图标', type: cc.Sprite})
+    @property({ displayName: '图标', type: cc.Sprite })
     private sp_icon: cc.Sprite = null;
 
-    @property({displayName: '名字描述', type: cc.Label})
+    @property({ displayName: '名字描述', type: cc.Label })
     private lbl_nameDes: cc.Label = null;
 
-    @property({displayName: '描述', type: cc.Label})
+    @property({ displayName: '描述', type: cc.Label })
     private lbl_des: cc.Label = null;
 
-    @property({displayName: '领奖按钮', type: cc.Node})
+    @property({ displayName: '领奖按钮', type: cc.Node })
     private node_ungetBtn: cc.Node = null;
 
-    @property({displayName: '已领奖按钮', type: cc.Node})
+    @property({ displayName: '已领奖按钮', type: cc.Node })
     private node_getBtn: cc.Node = null;
 
-    @property({displayName: '未解锁按钮', type: cc.Node})
+    @property({ displayName: '未解锁按钮', type: cc.Node })
     private node_unluckBtn: cc.Node = null;
 
-    @property({displayName: '红点', type: cc.Node})
+    @property({ displayName: '红点', type: cc.Node })
     private node_redPoint: cc.Node = null;
 
     private data = null;
 
-    public setItemData(data)
-    {
+    public setItemData(data) {
         this.InitUI(data);
     }
 
-    private async InitUI(data)
-    {
+    private async InitUI(data) {
         this.data = data;
         let plantPath = '';
         let namePath = '';
         if (gData.farmMapData.chooseType == ProductType.nzw) {
             plantPath = 'game/coregame/texture/plant_icons/plantIcon_';
-            namePath = 'game/coregame/texture/plant_icons/nameIcon/plant_name_';        
+            namePath = 'game/coregame/texture/plant_icons/nameIcon/plant_name_';
         }
         else {
             plantPath = 'game/coregame/texture/factory_icons/factory_';
             namePath = 'game/coregame/texture/factory_icons/factoryNams/factory_name_icon_';
         }
-    
-        let max = gData.farmMapData.maxUnluckValue;     
-        if(data.picture <= max)
-        {
+
+        let max = gData.farmMapData.maxUnluckValue;
+        if (data.picture <= max) {
             this.sp_icon.spriteFrame = await mk.loader.load(plantPath + data.picture, cc.SpriteFrame);
             this.lbl_nameDes.node.active = true;
             this.lbl_nameDes.string = `Lv.${data.level} ${data.name} ${data.time}秒成熟`;
             this.lbl_des.string = `最高收获${data.MenuredBagCoin}红包币`;
-            
+
             let state = gData.gameData.getFarmMapRewardState(this.getIndex());
-            if(state == 1)
-            {
-                this.node_getBtn.active =true;
+            if (state == 1) {
+                this.node_getBtn.active = true;
                 this.node_ungetBtn.active = false;
                 this.node_unluckBtn.active = false;
                 this.node_redPoint.active = false;
-            }else{
-                this.node_getBtn.active =false;
+            } else {
+                this.node_getBtn.active = false;
                 this.node_ungetBtn.active = true;
                 this.node_unluckBtn.active = false;
                 this.node_redPoint.active = true;
             }
 
-        }else if(data.picture -1 == max)
-        {
+        } else if (data.picture - 1 == max) {
             this.sp_icon.spriteFrame = await mk.loader.load('module/farmMap/texture/gift', cc.SpriteFrame);
             let times = gData.gameData.getProductMakeTimesById(data.picture - 1);
             let plantName = gData.gameData.getProductMap(data.picture - 1).name;
             let des = this.getDesByType();
             this.lbl_des.string = `${des}${this.data.value}次${plantName}后解锁\n(${times}/${data.value})`;;
 
-            this.node_getBtn.active =false;
+            this.node_getBtn.active = false;
             this.node_ungetBtn.active = false;
             this.node_unluckBtn.active = true;
             this.lbl_nameDes.node.active = false;
             this.node_redPoint.active = false;
-        }else
-        {
+        } else {
             this.sp_icon.spriteFrame = await mk.loader.load('module/farmMap/texture/gift', cc.SpriteFrame);
             this.lbl_des.string = "神秘物种,等待发现";
-            this.node_getBtn.active =false;
+            this.node_getBtn.active = false;
             this.node_ungetBtn.active = false;
             this.node_unluckBtn.active = true;
             this.lbl_nameDes.node.active = false;
             this.node_redPoint.active = false;
         }
-        
+
     }
 
-    getIndex()
-    {
+    getIndex() {
         let index: any = {};
         index.i = 0;
         index.j = 0;
-        switch(this.data.tab)
-        {
+        switch (this.data.tab) {
             case '农作物':
                 index.i = 0;
                 index.j = this.data.picture - 10001;
@@ -160,24 +152,28 @@ export default class FarmItem extends cc.Component{
         return des;
     }
 
-    private clickUnGetRewardBtn(){
+    private clickUnGetRewardBtn() {
         mk.audio.playEffect("button");
 
-
-        gData.farmMapData.isStateChange = true;
-        this.node_getBtn.active =true;
-        this.node_ungetBtn.active = false;
-        this.node_unluckBtn.active = false;
-        this.node_redPoint.active = false;
-        gData.gameData.setFarmMapRewardState(this.getIndex(), 1);
+        mk.ad.videoAdType = VideoAdType.video_init_6;
+        mk.ad.watchAd((success) => {
+            if (success) {
+                gData.farmMapData.isStateChange = true;
+                this.node_getBtn.active = true;
+                this.node_ungetBtn.active = false;
+                this.node_unluckBtn.active = false;
+                this.node_redPoint.active = false;
+                gData.gameData.setFarmMapRewardState(this.getIndex(), 1);
+            }
+        })
     }
 
-    private clickUnluckBtn(){
+    private clickUnluckBtn() {
         mk.audio.playEffect("button");
         mk.tip.pop('未解锁');
     }
 
-    private clickGetRewardBtn(){
+    private clickGetRewardBtn() {
         mk.audio.playEffect("button");
         mk.tip.pop('已领取');
     }

+ 1 - 1
assets/script/game/module/gradeReward/GradeReward.ts

@@ -173,7 +173,7 @@ export class GradeReward extends cc.Component {
             JsbSystem.WxAuth();
             return;
         }
-        mk.ad.videoAdType = VideoAdType.farmGradeAddExp;
+        mk.ad.videoAdType = VideoAdType.video_init_1;
         mk.ad.watchAd((success: boolean) => {
             mk.console.log("watchAD:" + success);
             if (success) {

+ 2 - 2
assets/script/game/module/newCashUI/WalletCashOut.ts

@@ -222,7 +222,7 @@ export default class WalletCashOut extends cc.Component {
     private clickAddProgressBtn() {
         mk.audio.playEffect("button");
 
-        mk.ad.videoAdType = VideoAdType.CashOutNoviceWelfare;
+        mk.ad.videoAdType = VideoAdType.video_init_2;
 
         // 看广告
         mk.ad.watchAd((success: boolean) => {
@@ -236,7 +236,7 @@ export default class WalletCashOut extends cc.Component {
     private clickAddCashBtn() {
         mk.audio.playEffect("button");
 
-        mk.ad.videoAdType = VideoAdType.CashOutNoviceWelfare;
+        mk.ad.videoAdType = VideoAdType.video_init_3;
 
         // 看广告
         mk.ad.watchAd((success: boolean) => {

+ 1 - 1
assets/script/game/module/newOpenRedBag/NewOpenRedBag.ts

@@ -130,7 +130,7 @@ export default class NewOpenRedBag extends cc.Component {
 
         }
         else {
-            mk.ad.videoAdType = VideoAdType.StartQiPaoRedBag;
+            //广告类型在界面打开时赋值
             mk.ad.watchAd((success: boolean) => {
                 mk.console.log("watchAD:" + success);
                 if (success) {

+ 1 - 1
assets/script/game/module/sign/Sign.ts

@@ -106,7 +106,7 @@ export default class Sign extends cc.Component {
             }
         }
         
-        mk.ad.videoAdType = VideoAdType.Sign;
+        mk.ad.videoAdType = VideoAdType.video_init_4;
         // 看广告
         mk.ad.watchAd((success: boolean) => {
             mk.console.log("watchAD:" + success);

+ 2 - 0
assets/script/game/module/speedUpUI/ProductReward.ts

@@ -1,3 +1,4 @@
+import { VideoAdType } from "../../data/GameData";
 
 
 const { ccclass, property } = cc._decorator;
@@ -18,6 +19,7 @@ export default class ProductReward extends cc.Component {
     private clickVideoBtn() {
         mk.audio.playEffect("button");
         mk.ui.closePanel(this.node.name);
+        mk.ad.videoAdType = VideoAdType.video_init_16;
         mk.ad.watchAd((success: boolean) => {
             if (success) {
                 gData.gameData.changeLeftTimes(parseInt(gData.gameData.configs.ServerConfig.ProductionAd));

+ 8 - 0
assets/script/game/module/speedUpUI/SpeedUpUI.ts

@@ -1,3 +1,4 @@
+import { VideoAdType } from "../../data/GameData";
 
 
 const { ccclass, property } = cc._decorator;
@@ -71,6 +72,13 @@ export default class SpeedUpUI extends cc.Component {
 
     private clickWatchVideoBtn() {
         mk.audio.playEffect("button");
+
+        mk.ad.videoAdType = VideoAdType.video_init_14;
+        mk.ad.watchAd((success) => {
+            if (success) {
+
+            }
+        })
     }
 
 

+ 1 - 1
assets/script/game/module/turntable/Turnable.ts

@@ -75,7 +75,7 @@ export default class Turnable extends cc.Component {
     /** 点击抽奖 */
     clickDraw() {
         if (gData.turnable.leftTimes > 0) {
-            mk.ad.videoAdType = VideoAdType.Turntable;
+            mk.ad.videoAdType = VideoAdType.video_init_5;
             mk.ad.watchAd((success: boolean) => {
                 mk.console.log("watchAD:" + success);
                 if (success) {

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

@@ -187,6 +187,7 @@ export class ATRewardVideo extends zgSingleton {
      */
     onRewardedVideoAdPlayClicked(placementId, callbackInfo) {
         // ATJSSDK.printLog("AnyThinkRewardedVideoDemo::onRewardedVideoAdPlayClicked(" + placementId + ", " + callbackInfo + ")");
+        mk.data.sendDataEvent(DataEventId.video_click, mk.ad.videoAdType);
     }
 
     /**

+ 1 - 3
assets/script/mk/system/AdSystem.ts

@@ -1,7 +1,5 @@
-import Util from "../../before/util/Util";
 import { VideoAdType } from "../../game/data/GameData";
 import { IADSDKMgr } from "../sdk/ad/IADSDKMgr";
-import JsbSystem from "./JsbSystem";
 
 /**
  * 广告管理类脚本
@@ -24,7 +22,7 @@ export default class AdSystem {
     /** 是否显示广告 */
     public ifShowAd: boolean = true;
     /** 视频广告类型 */
-    public videoAdType: VideoAdType = VideoAdType.Null;
+    public videoAdType: VideoAdType = VideoAdType.video_init_1;
     /** 视频广告回调 */
     public videoAdcallBack: Function = null;
 

Некоторые файлы не были показаны из-за большого количества измененных файлов