Commit a9470c30 authored by 张华挺's avatar 张华挺

log

parent f11a8fb1
......@@ -10,6 +10,7 @@ import Buy1Panel from "../../src/panels/Buy1Panel";
import Buy2Panel from "../../src/panels/Buy2Panel";
import Buy3Panel from "../../src/panels/Buy3Panel";
import FailedPanel from "../../src/panels/FailedPanel";
import { getlogItem } from "../../src/Main";
import GoldPanel from "../../src/panels/GoldPanel";
import Prize2Panel from "../../src/panels/Prize2Panel";
import QuitPanel from "../../src/panels/QuitPanel";
......@@ -58,6 +59,8 @@ export default class MainBase extends eui.UILayer {
super();
// 等待开屏广告结束之后再放背景音乐
stopGamebg()
// 注册和客户端通信的方法
this.initNativeEvent()
Loading.instace.loadImage();
DataManager.ins.customCfgData = window['CFG'];
this.getData();
......@@ -120,6 +123,53 @@ export default class MainBase extends eui.UILayer {
}
protected initNativeEvent() {
// 开屏广告结束后的回调
window["openFinished"] = () => {
playGameBg()
}
// 首页banner点击埋点
window["IndexBannerClickLog"] = () => {
NetManager.ins.clickLog(getlogItem(15))
}
// 首页banner展示埋点
window["IndexBannerShowLog"] = () => {
NetManager.ins.showLog(getlogItem(15))
}
// 游戏页面banner点击埋点
window["GameBannerClickLog"] = () => {
NetManager.ins.clickLog(getlogItem(16))
}
// 游戏页面banner展示埋点
window["GameBannerShowLog"] = () => {
NetManager.ins.showLog(getlogItem(16))
}
// 激励视频成功加载
window["TTVideoLoadSucc"] = () => {
NetManager.ins.clickLog(getlogItem(21, 2))
}
// 激励视频成功曝光
window["TTVideoShow"] = () => {
NetManager.ins.showLog(getlogItem(22, 2))
}
// 激励视频广告点击
window["TTVideoClick"] = () => {
NetManager.ins.clickLog(getlogItem(23, 2))
}
// 激励视频关闭点击
window["TTVideoClose"] = () => {
NetManager.ins.clickLog(getlogItem(24, 2))
}
// 激励视频endcard曝光
window["TTVideoEndcardShow"] = () => {
NetManager.ins.showLog(getlogItem(25, 2))
}
// 激励视频endcard点击
window["TTVideoEndcardClick"] = () => {
NetManager.ins.clickLog(getlogItem(26, 2))
}
}
protected createChildren(): void {
super.createChildren();
egret.lifecycle.addLifecycleListener((context) => {
......
......@@ -7,6 +7,7 @@ import { DataManager } from "../../tw/manager/DataManager";
import { NetManager } from "../../tw/manager/NetManager";
import Panel from "./Panel";
import { handleVideo } from "../../../src/myVideo/videoCtrl";
import handleInspireVideo from "../../../src/inspireVideo";
import Loading from "./Loading";
import { showToast } from "../ctrls/toastCtrl";
export default class PrizePanel extends Panel {
......@@ -73,7 +74,7 @@ export default class PrizePanel extends Panel {
//新增看视频双倍
this["doubleBtn"].addEventListener(egret.TouchEvent.TOUCH_TAP, () => {
NetManager.ins.clickLog(getlogItem(6))
handleVideo(
handleInspireVideo(
(s) => {
if (s) {
//居中
......
......@@ -9,6 +9,7 @@ export interface IExposureData {
appId: number;
consumerId: number;
dcm: string;
dom?: string;
domain: string;
dpm: string;
ip?: string;
......
......@@ -23,7 +23,7 @@ export class Buried {
* @param {string} embedDomain 埋点域名
* @returns {{dpm: string; consumerId: number; domain: string; appId: number}}
*/
public static createExposure(dpm: string, dcm: string, embedDomain = '//embedlog.duiba.com.cn'): IExposureData {
public static createExposure(dpm: string, dcm: string, embedDomain = '//embedlog.duiba.com.cn', dom: string): IExposureData {
const exposure: IExposureData = {
dpm: dpm,
dcm: dcm,
......@@ -31,6 +31,9 @@ export class Buried {
appId: Buried.appId,
domain: embedDomain
};
if (dom) {
exposure.dom = dom
}
return exposure;
}
......
......@@ -4,10 +4,11 @@ import { Buried } from "../libs/tw/util/Buried";
class Main extends MainBase {
}
export const getlogItem = (i) =>{
export const getlogItem = (i, dom = null) =>{
const Dpm = Buried.connectDpm(110, i, 1); // 点击埋点
const Dcm = Buried.connectDcm(202, 0, 0); // 曝光埋点
return Buried.createExposure(Dpm, Dcm);
if (dom) dom = `${dom}.0.0.0`
return Buried.createExposure(Dpm, Dcm, null, dom);
}
window['Main'] = Main;
......
......@@ -4,10 +4,10 @@ export default function (
returnCallback: (s: boolean) => void,
completeCallback: Function,
slotid: string,
type: number,
type = 2,
isIndex = false
) {
window["showTTAd"](isIndex ? window["TTIndexVideo"] : window["TTOtherVideo"], 2)
window["showTTAd"] && window["showTTAd"](isIndex ? window["TTIndexVideo"] : window["TTOtherVideo"], 2)
window["lastInspireShow"] = () => {
NetManager.ins.getTuiaAd(() => {
returnCallback(true)
......
......@@ -248,7 +248,8 @@ export default class MainScene extends Scene {
failStep: false
}
start(data: { chapter: number, boom: number, hammer: number, step: number, videoProp: number[] }) {
console.log(123)
// 请求游戏内banner
window["showTTAd"] && window["showTTAd"](window["TTIndexBanner"], 1)
super.start();
//第几关
this.chapter = (data && data.chapter) ? data.chapter : 1;
......@@ -932,7 +933,20 @@ export default class MainScene extends Scene {
}
}
onTap_quitBtn() {
PanelCtrl.instance.show("quit", { level: this.chapter });
const configData = DataManager.ins.getData('getConfig')
let signConfigData = configData.data.filter(item => item.id === 5)
if (signConfigData.length) {
if (signConfigData[0].index === 0) {
window["showTTAd"] && window["showTTAd"](window["TTPauseScreen"], 3)
} else if (signConfigData[0].index === 1) {
window["showTTAd"] && window["showTTAd"](window["TAPauseScreen"], 3)
}
wait(300).then(() => {
PanelCtrl.instance.show("quit", { level: this.chapter });
})
} else {
PanelCtrl.instance.show("quit", { level: this.chapter });
}
}
onTap_boomBtn() {
if (this.propBtnCon.boomBtn.propNumShow.count <= 0) {
......
......@@ -51,7 +51,8 @@ export default class MapScene extends Scene {
async start(data?) {
super.start();
// 请求首页banner
window["showTTAd"] && window["showTTAd"](window["TTIndexBanner"], 1)
//新增icon,还有埋点
this["wuhanGroup"].visible = false;
this["tuiaGroup"].visible = false;
......
......@@ -5,6 +5,7 @@ import getHomeData from "../getHomeData";
import { getlogItem } from "../Main";
import AdSmallComp from "../mapScene/AdSmallComp";
import { handleVideo } from "../myVideo/videoCtrl";
import handleInspireVideo from "../inspireVideo";
import { showToast } from "../../libs/new_wx/ctrls/toastCtrl";
import Loading from "../../libs/new_wx/components/Loading";
import { updateMainTimer } from "../../libs/new_wx/MainBase";
......@@ -40,7 +41,7 @@ export default class BoxPanel extends Panel {
this['close2Btn'].visible = false;
this["doubleBtn"].addEventListener(egret.TouchEvent.TOUCH_TAP, () => {
NetManager.ins.clickLog(getlogItem(12))
handleVideo(
handleInspireVideo(
(s) => {
if (s) {
this['close2Btn'].visible = true;
......
......@@ -3,6 +3,7 @@ import { NetManager } from "../../libs/tw/manager/NetManager";
import { addRankFriendList } from "../mapScene/RankFriendList";
import { changeMapScene } from "../startScene/StartScene";
import { handleVideo } from "../myVideo/videoCtrl";
import handleInspireVideo from "../inspireVideo";
import { showToast } from "../../libs/new_wx/ctrls/toastCtrl";
import { getlogItem } from "../Main";
import { DataManager } from "../../libs/tw/manager/DataManager";
......@@ -34,7 +35,7 @@ export default class FailedPanel extends Panel {
this["videoBtn"].visible = true;
this["videoBtn"].addEventListener(egret.TouchEvent.TOUCH_TAP, () => {
NetManager.ins.clickLog(getlogItem(4))
handleVideo(
handleInspireVideo(
(s) => {
if (s) {
this.hidePanel();
......
......@@ -50,9 +50,9 @@ export default class SignPanel extends Panel {
if(s) {
const {customInfo,success} =DataManager.ins.getData('dosign');
if(!success || !customInfo.success || customInfo.prizeType =='none') {
if(customInfo.code==100004) {
if (customInfo.code == 100004) {
showToast('与奖励失之交臂!明天再来试试吧!');
}else {
} else {
showToast('与奖励失之交臂');
}
return;
......@@ -61,7 +61,14 @@ export default class SignPanel extends Panel {
item.setSinged();
// showToast('签到成功!快去闯关吧~');
// PanelCtrl.instance.show('signPrize');
PanelCtrl.instance.addToShowPanels('signPrize');
const configData = DataManager.ins.getData('getConfig')
let signConfigData = configData.data.filter(item => item.id === 6)
if (signConfigData.length && signConfigData[0].index === 1) {
window["showTTAd"] && window["showTTAd"](window["TASignScreen"], 3)
window["finishScreenShowSignPrize"] = PanelCtrl.instance.addToShowPanels('signPrize');
} else {
PanelCtrl.instance.addToShowPanels('signPrize');
}
wait(200).then(()=>{
NetManager.ins.hc_home(() => {
updateMainTimer();
......
......@@ -4,6 +4,7 @@ import { addAdComp } from "./BoxPanel";
import { NetManager } from "../../libs/tw/manager/NetManager";
import { getlogItem } from "../Main";
import { handleVideo } from "../myVideo/videoCtrl";
import handleInspireVideo from "../inspireVideo";
import Loading from "../../libs/new_wx/components/Loading";
import { showToast } from "../../libs/new_wx/ctrls/toastCtrl";
import { updateMainTimer } from "../../libs/new_wx/MainBase";
......@@ -47,44 +48,52 @@ export default class SignPrizePanel extends Panel {
//曝光
NetManager.ins.showLog(getlogItem(7))
//新增看视频双倍
this['close2Btn'].visible = false;
this["doubleBtn"].addEventListener(egret.TouchEvent.TOUCH_TAP, () => {
NetManager.ins.clickLog(getlogItem(8))
handleVideo(
(s) => {
if (s) {
Loading.instace.show();
const configData = DataManager.ins.getData('getConfig')
let signConfigData = configData.data.filter(item => item.id === 6)
if (signConfigData.length && signConfigData[0].index === 1) {
// 因为除了插屏了,不需要翻倍
this['close2Btn'].visible = true;
this['doubleBtn'].visible = false;
} else {
// 依旧是视频翻倍
this['doubleBtn'].visible = true;
this["doubleBtn"].addEventListener(egret.TouchEvent.TOUCH_TAP, () => {
NetManager.ins.clickLog(getlogItem(8))
handleInspireVideo(
(s) => {
if (s) {
Loading.instace.show();
NetManager.ins.getIncentiveAward(
(s) => {
Loading.instace.hide();
this['close2Btn'].visible = true;
this['doubleBtn'].visible = false;
if (s) {
showToast("翻倍成功");
NetManager.ins.hc_home(() => {
updateMainTimer();
SceneCtrl.instance.updateScene();
}, window['collectRuleId']);
} else {
showToast("加倍失败");
this.hidePanel();
}
},
21
)
} else {
showToast("广告未成功观看,无法加倍领取");
}
},
() => {
NetManager.ins.getIncentiveAward(
(s) => {
Loading.instace.hide();
this['close2Btn'].visible = true;
this['doubleBtn'].visible = false;
if (s) {
showToast("翻倍成功");
NetManager.ins.hc_home(() => {
updateMainTimer();
SceneCtrl.instance.updateScene();
}, window['collectRuleId']);
} else {
showToast("加倍失败");
this.hidePanel();
}
},
21
)
} else {
showToast("广告未成功观看,无法加倍领取");
}
},
() => {
NetManager.ins.getIncentiveAward(
() => { },
21)
},
window["slotid"]
)
}, this)
() => { },
21)
},
window["slotid"]
)
}, this)
}
}
......
......@@ -19,6 +19,7 @@ import { addAdComp } from "./BoxPanel";
import { getChapterData } from "../something/chapters/getChapter";
import { getlogItem } from "../Main";
import { handleVideo } from "../myVideo/videoCtrl";
import handleInspireVideo from "../inspireVideo";
export default class StartPanel extends Panel {
static currlevel;
......@@ -194,7 +195,7 @@ export default class StartPanel extends Panel {
onTap_video1btn() {
//看视频按钮点击
NetManager.ins.clickLog(getlogItem(2))
handleVideo(
handleInspireVideo(
(s) => {
if (s) {
this['video1btn'].visible = false;
......@@ -213,7 +214,7 @@ export default class StartPanel extends Panel {
onTap_video2btn() {
//看视频按钮点击
NetManager.ins.clickLog(getlogItem(2))
handleVideo(
handleInspireVideo(
(s) => {
if (s) {
this['video2btn'].visible = false;
......@@ -232,7 +233,7 @@ export default class StartPanel extends Panel {
onTap_video3btn() {
//看视频按钮点击
NetManager.ins.clickLog(getlogItem(2))
handleVideo(
handleInspireVideo(
(s) => {
if (s) {
this['video3btn'].visible = false;
......
......@@ -19,6 +19,7 @@ import { addAdComp } from "./BoxPanel";
import { getChapterData } from "../something/chapters/getChapter";
import { getlogItem } from "../Main";
import { handleVideo } from "../myVideo/videoCtrl";
import handleInspireVideo from "../inspireVideo";
export default class StartPanelNew extends Panel {
static currlevel;
......@@ -194,7 +195,7 @@ export default class StartPanelNew extends Panel {
onTap_video1btn() {
//看视频按钮点击
NetManager.ins.clickLog(getlogItem(2))
handleVideo(
handleInspireVideo(
(s) => {
if (s) {
this['video1btn'].visible = false;
......@@ -213,7 +214,7 @@ export default class StartPanelNew extends Panel {
onTap_video2btn() {
//看视频按钮点击
NetManager.ins.clickLog(getlogItem(2))
handleVideo(
handleInspireVideo(
(s) => {
if (s) {
this['video2btn'].visible = false;
......@@ -232,7 +233,7 @@ export default class StartPanelNew extends Panel {
onTap_video3btn() {
//看视频按钮点击
NetManager.ins.clickLog(getlogItem(2))
handleVideo(
handleInspireVideo(
(s) => {
if (s) {
this['video3btn'].visible = false;
......
......@@ -11,6 +11,7 @@ import PanelCtrl from "../../libs/new_wx/ctrls/panelCtrl";
import MainScene from "../mainScene/MainScene";
import Loading from "../../libs/new_wx/components/Loading";
import { handleVideo } from "../myVideo/videoCtrl";
import handleInspireVideo from "../inspireVideo";
export default class VideoBuyPanel extends Panel {
buyBtn: eui.Button
......@@ -60,7 +61,7 @@ export default class VideoBuyPanel extends Panel {
this["videoBtn"].visible = true;
this["videoBtn"].addEventListener(egret.TouchEvent.TOUCH_TAP, () => {
NetManager.ins.clickLog(getlogItem(10))
handleVideo(
handleInspireVideo(
(s) => {
if (s) {
this.hidePanel();
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment