فهرست منبع

互推行为上报

kaka 4 سال پیش
والد
کامیت
43ba03e8c1

+ 0 - 3
assets/script/game/data/AppData.ts

@@ -17,9 +17,6 @@ export class AppData {
     /** api版本 */
     public version: string = '';
 
-    /** UserAgent */
-    UA = '';
-
     IP = '';
 
     /** 测试服/正式服的appId */

+ 22 - 0
assets/script/game/data/module/MoreGameData.ts

@@ -31,6 +31,10 @@ export class MoreGameData extends Data {
     //哪个位置打开互推红包界面
     openType = -1;
 
+    /** 点击格子时互推位信息 */
+    placement_id = '';
+    nebulaAppId = '';
+
     /** 测试数据 */
     private testData = {
         "normal": [
@@ -222,6 +226,24 @@ export class MoreGameData extends Data {
             mk.ui.openPanel('module/reward/reward');
         }
     }
+
+    /**
+     * 互推行为埋点
+     * @param recommend_type 互推位类型(1:banner展示;2:banner点击;3:格子展示;4:格子点击;5:信息流展示;6:信息流点击;7:插屏展示;8:插屏点击)
+     * @param placement_id 互推位id
+     * @param toAppId 跳转应用id
+     */
+    userBehaveLog(recommend_type: number, placement_id: string, toAppId: string) {
+        let data = {
+            toAppId: toAppId,
+            recommend_type: recommend_type,
+            placement_id: placement_id,
+            ip: gData.appData.IP,
+            ua: gData.appData.machineInfo.UA,
+        }
+
+        mk.http.sendData('fission/userBehaveLog', data);
+    }
 }
 
 /** 下载任务 */

+ 24 - 34
assets/script/game/game/Game.ts

@@ -160,10 +160,9 @@ export default class Game extends cc.Component {
 
         this.initRefreshEvent();
 
-        if(gData.gameData.playerProp.orderData)
-        {
+        if (gData.gameData.playerProp.orderData) {
             this.initOrderUI();
-        }else{
+        } else {
             mk.event.register("initOrderUi", this.initOrderUI.bind(this), this);
         }
     }
@@ -478,15 +477,15 @@ export default class Game extends cc.Component {
     /** 点击互推 */
     public onClickHuTui() {
         mk.data.sendDataEvent(DataEventId.button_click, "互推icon");
+        gData.moreGame.userBehaveLog(4, gData.moreGame.placement_id, gData.moreGame.nebulaAppId);
     }
 
     /** 点击福利 */
     public onClickFuli() {
-        if(gData.gameData.playerProp.orderData && gData.gameData.playerProp.orderData.overTimes >= gData.gameData.welfareOpenLimit)
-        {
+        if (gData.gameData.playerProp.orderData && gData.gameData.playerProp.orderData.overTimes >= gData.gameData.welfareOpenLimit) {
             mk.ui.openPanel('module/blessingBag/blessingBag');
             mk.data.sendDataEvent(DataEventId.button_click, "福利icon");
-        }else{
+        } else {
             mk.tip.pop(`订单提现${gData.gameData.welfareOpenLimit}次后开启`);
         }
     }
@@ -1042,8 +1041,8 @@ export default class Game extends cc.Component {
                     this.node_getOrderReward.getComponent(cc.Animation).stop();
                     this.node_orderHand.active = false;
                 }
-            } 
-        } 
+            }
+        }
     }
 
     public clickGetOrderRewardBtn() {
@@ -1075,8 +1074,7 @@ export default class Game extends cc.Component {
         let data = {};
         let response = await mk.http.sendData('orderTask/receiveRewardCash', data);
         if (response.errcode != 0) {
-            if(response.errcode == 405)
-            {
+            if (response.errcode == 405) {
                 mk.tip.pop("今日提现额度已到上限,请明天再提现");
                 mk.data.sendDataEvent(DataEventId.cashLimit, "提现触发上限");
             }
@@ -1090,13 +1088,13 @@ export default class Game extends cc.Component {
         // gData.reward.adData = { videoRedMoney: { videoRewardList: null } };
         // gData.reward.adData.videoRedMoney.videoRewardList = [{ rewardType: 1, rewardNum: addMoney }]
         // mk.ui.openPanel('module/reward/reward');
-        
+
         //处理提现逻辑
         gData.cashPro.callBack = this.getRewardCallBack.bind(this);
         gData.receiptNotice.receip_rmb = addMoney;
         mk.ui.openPanel('module/newNotice/newNotice');
 
-        this.node_crop.forEach((v)=>{
+        this.node_crop.forEach((v) => {
             v.active = false;
         })
         this.node_orderHbIcon.active = false;
@@ -1105,22 +1103,19 @@ export default class Game extends cc.Component {
 
     //停止农民产红包币
     isStopFarm = false;
-    public getRewardCallBack()
-    {
+    public getRewardCallBack() {
         this.node_extraOrderUi.active = true;
         this.node_bgUi.scale = 0;
-        cc.tween(this.node_bgUi).to(0.4, {scale: 1.4}).start();
+        cc.tween(this.node_bgUi).to(0.4, { scale: 1.4 }).start();
 
-        if(gData.gameData.funOpenData[1] == '1')
-        {
+        if (gData.gameData.funOpenData[1] == '1') {
             gData.gameData.funOpenData[1] = "0";
             this.isStopFarm = true;
         }
     }
 
-    public showRefreshLogic()
-    {
-        this.node_crop.forEach((v)=>{
+    public showRefreshLogic() {
+        this.node_crop.forEach((v) => {
             v.active = true;
         })
         this.node_orderHbIcon.active = true;
@@ -1132,19 +1127,17 @@ export default class Game extends cc.Component {
         gData.gameData.checkTaskFinishUnLock();
         gData.safeDepositBoxData.updateQipao();
 
-        if(this.isStopFarm)
-        {
+        if (this.isStopFarm) {
             this.isStopFarm = false;
             gData.gameData.funOpenData[1] = '1';
         }
     }
 
-    showTips()
-    {
+    showTips() {
         mk.tip.pop("提现成功,订单已刷新");
     }
 
-    async doCropFlyLogic(plantId: number, farmNode: cc.Node = null, parentNode: cc.Node = null,isNzw = false) {
+    async doCropFlyLogic(plantId: number, farmNode: cc.Node = null, parentNode: cc.Node = null, isNzw = false) {
         if (gData.gameData.funOpenData[11] == "0" || !gData.gameData.playerProp.orderData) {
             return;
         }
@@ -1218,13 +1211,12 @@ export default class Game extends cc.Component {
                     mk.tip.pop("订单已完成,快提现吧!");
                 }
             }
-            if(parentNode)
-            {
+            if (parentNode) {
                 let pos = this.node_orderHb.parent.convertToWorldSpaceAR(this.node_orderHb.getPosition());
                 mk.fly.PlayCoinAnim(1, 5, parentNode, pos, () => {
                     //this.refreshOrderUI(index);
                 }, 0.8);
-            }else{
+            } else {
                 let pos = this.node_orderHb.parent.convertToWorldSpaceAR(this.node_orderHb.getPosition());
                 mk.fly.PlayCoinAnim(1, 5, this.btn_product, pos, () => {
                     //this.refreshOrderUI(index);
@@ -1243,8 +1235,7 @@ export default class Game extends cc.Component {
         }
     }
 
-    public refreshOrderUI(index)
-    {
+    public refreshOrderUI(index) {
         let orderData = gData.gameData.playerProp.orderData;
         let dataE = orderData.orderTaskList[index];
         if (dataE) {
@@ -1291,13 +1282,12 @@ export default class Game extends cc.Component {
             //     mk.guide.curDes = `<color=8A4312><color=ff0000>继续生产${leftTimes}次</c>,很快就\n可以完成订单了!</color>`;
             // }
         } else {
-            if(this.isGray)
-            {
+            if (this.isGray) {
                 mk.tip.pop("完成订单即可提现");
-            }else{
+            } else {
                 mk.tip.pop("订单已完成,快提现吧");
             }
-            
+
         }
 
     }

+ 4 - 0
assets/script/game/module/moreGame/BtnMoreGame.ts

@@ -56,5 +56,9 @@ export default class BtnMoreGame extends cc.Component {
         }
 
         this.lab_moregame.string = data.title
+
+        gData.moreGame.placement_id = data.placement_id;
+        gData.moreGame.nebulaAppId = data.nebulaAppId;
+        gData.moreGame.userBehaveLog(3, gData.moreGame.placement_id, gData.moreGame.nebulaAppId);
     }
 }

+ 1 - 1
assets/script/mk/system/DataSystem.ts

@@ -106,7 +106,7 @@ export default class DataSystem {
             user_id: gData.loginData.uin,
             device_id: "",
             os_type: 1,
-            user_agent: gData.appData.UA,
+            user_agent: gData.appData.machineInfo.UA,
             imei: gData.appData.machineInfo.imei,
             ifda: gData.appData.machineInfo.idfa,
             oaid: gData.appData.machineInfo.oaid,