Commit 65bd099a authored by wangzhujun's avatar wangzhujun

1232

parent b0ecc611
...@@ -4,7 +4,7 @@ import { IExposureData } from '../data/common/IExposureData'; ...@@ -4,7 +4,7 @@ import { IExposureData } from '../data/common/IExposureData';
export class Buried { export class Buried {
private static appId: number; private static appId: number;
// private static consumerId: number; private static consumerId: number;
private static oaId: number; private static oaId: number;
/** /**
...@@ -13,23 +13,23 @@ export class Buried { ...@@ -13,23 +13,23 @@ export class Buried {
public static init(): void { public static init(): void {
if (DataManager.ins.gameCfgData) { if (DataManager.ins.gameCfgData) {
this.appId = DataManager.ins.gameCfgData.appInfo.appId; this.appId = DataManager.ins.gameCfgData.appInfo.appId;
// this.consumerId = DataManager.ins.getInfoData.consumerId; this.consumerId = DataManager.ins.getInfoData.consumerId;
this.oaId = DataManager.ins.gameCfgData.gameInfo.oaId; this.oaId = DataManager.ins.gameCfgData.gameInfo.oaId;
} else if (DataManager.ins.customCfgData) { } else if (DataManager.ins.customCfgData) {
this.appId = DataManager.ins.customCfgData.appId; this.appId = DataManager.ins.customCfgData.appId;
// this.consumerId = DataManager.ins.customCfgData.consumerId; this.consumerId = DataManager.ins.customCfgData.consumerId;
this.oaId = DataManager.ins.customCfgData.oaId; this.oaId = DataManager.ins.customCfgData.oaId;
} else if (DataManager.ins.petIndexData && DataManager.ins.petIndexData.appId && DataManager.ins.petIndexData.activityId) { } else if (DataManager.ins.petIndexData && DataManager.ins.petIndexData.appId && DataManager.ins.petIndexData.activityId) {
this.appId = DataManager.ins.petIndexData.appId; this.appId = DataManager.ins.petIndexData.appId;
// this.consumerId = DataManager.ins.petIndexData.consumerId; this.consumerId = DataManager.ins.petIndexData.consumerId;
this.oaId = DataManager.ins.petIndexData.activityId; this.oaId = DataManager.ins.petIndexData.activityId;
} else if (DataManager.ins.petsIndexData && DataManager.ins.petsIndexData.appId && DataManager.ins.petsIndexData.activityId) { } else if (DataManager.ins.petsIndexData && DataManager.ins.petsIndexData.appId && DataManager.ins.petsIndexData.activityId) {
this.appId = DataManager.ins.petsIndexData.appId; this.appId = DataManager.ins.petsIndexData.appId;
// this.consumerId = DataManager.ins.petsIndexData.consumerId; this.consumerId = DataManager.ins.petsIndexData.consumerId;
this.oaId = DataManager.ins.petsIndexData.activityId; this.oaId = DataManager.ins.petsIndexData.activityId;
} else { } else {
this.appId = window["appId"]; this.appId = window["appId"];
// this.consumerId = window["consumerId"]; this.consumerId = window["consumerId"];
this.oaId = window["projectId"]; this.oaId = window["projectId"];
} }
} }
...@@ -42,25 +42,32 @@ export class Buried { ...@@ -42,25 +42,32 @@ export class Buried {
* @returns {{dpm: string; consumerId: number; domain: string; appId: number}} * @returns {{dpm: string; consumerId: number; domain: string; appId: number}}
*/ */
public static createExposure(dpm: string, dcm: string, dom?: string, embedDomain = '//embedlog.duiba.com.cn'): IExposureData { public static createExposure(dpm: string, dcm: string, dom?: string, embedDomain = '//embedlog.duiba.com.cn'): IExposureData {
const exposure: IExposureData = { if(dom){
dpm: dpm, const exposure: IExposureData = {
dcm: dcm, dpm: dpm,
dcm: dcm,
// consumerId: Buried.consumerId, dom: dom,
appId: Buried.appId, consumerId: Buried.consumerId,
domain: embedDomain appId: Buried.appId,
}; domain: embedDomain
};
if (dom) return exposure;
exposure.dom = dom; }else{
return exposure; const exposure: IExposureData = {
dpm: dpm,
dcm: dcm,
consumerId: Buried.consumerId,
appId: Buried.appId,
domain: embedDomain
};
return exposure;
}
} }
/** /**
* dpm拼接 * dom拼接
* @param pageId 页面ID * @param wayId 渠道ID
* @param area 区域
* @param dpm 埋点号
* @returns {string} * @returns {string}
*/ */
public static connectDom(wayId: number): string { public static connectDom(wayId: number): string {
......
...@@ -8,6 +8,8 @@ import { DataManager } from "../../libs/tw/manager/DataManager"; ...@@ -8,6 +8,8 @@ import { DataManager } from "../../libs/tw/manager/DataManager";
import SceneCtrl from "../ctrls/sceneCtrl"; import SceneCtrl from "../ctrls/sceneCtrl";
import Waiting from "../waiting/Waiting"; import Waiting from "../waiting/Waiting";
import GameConst from "../GameConst"; import GameConst from "../GameConst";
import { Buried } from "../../libs/tw/util/Buried";
import { NetManager } from "../../libs/tw/manager/NetManager";
export default class StartScene extends Scene { export default class StartScene extends Scene {
...@@ -35,6 +37,11 @@ export default class StartScene extends Scene { ...@@ -35,6 +37,11 @@ export default class StartScene extends Scene {
private level; private level;
private startdata; private startdata;
private type; private type;
private startExposure:any;
private chuandiExposure:any;
private huozhongExposure:any;
private pkExposure:any;
constructor(data){ constructor(data){
super(); super();
if(data.type){ if(data.type){
...@@ -61,13 +68,40 @@ export default class StartScene extends Scene { ...@@ -61,13 +68,40 @@ export default class StartScene extends Scene {
} }
initBuired() { initBuired() {
let num:any
if(GameConst.getQueryString("wayId")){
num = GameConst.getQueryString("wayId")
}else{
num = 0;
}
let startDpmIn = Buried.connectDpm(110, 1, 1); // 点击埋点
let startDcmIn = Buried.connectDcm(202, 0, 0); // 曝光埋点
let startDomIn = Buried.connectDom(num)
this.startExposure = Buried.createExposure(startDpmIn, startDcmIn,startDomIn);
NetManager.ins.showLog(this.startExposure);
let chuandiDpmIn = Buried.connectDpm(110, 2, 1); // 点击埋点
let chuandiDcmIn = Buried.connectDcm(202, 0, 0); // 曝光埋点
this.chuandiExposure = Buried.createExposure(chuandiDpmIn, chuandiDcmIn);
NetManager.ins.showLog(this.chuandiExposure);
let huozhongDpmIn = Buried.connectDpm(110, 3, 1); // 点击埋点
let huozhongDcmIn = Buried.connectDcm(202, 0, 0); // 曝光埋点
this.huozhongExposure = Buried.createExposure(huozhongDpmIn, huozhongDcmIn);
NetManager.ins.showLog(this.huozhongExposure);
let pkDpmIn = Buried.connectDpm(110, 4, 1); // 点击埋点
let pkDcmIn = Buried.connectDcm(202, 0, 0); // 曝光埋点
this.pkExposure = Buried.createExposure(pkDpmIn, pkDcmIn);
NetManager.ins.showLog(this.pkExposure);
} }
onEnterFrame(){ onEnterFrame(){
} }
initUI(data) { initUI(data) {
this.once(egret.Event.ADDED_TO_STAGE, () => { this.once(egret.Event.ADDED_TO_STAGE, () => {
this.height = this.stage.stageHeight; this.height = this.stage.stageHeight;
}, this); }, this);
...@@ -199,6 +233,7 @@ export default class StartScene extends Scene { ...@@ -199,6 +233,7 @@ export default class StartScene extends Scene {
} }
GuideFive(){ GuideFive(){
Waiting.instance.show(); Waiting.instance.show();
NetManager.ins.clickLog(this.chuandiExposure);
yzwNet.doStart((s)=>{ yzwNet.doStart((s)=>{
if(!s){ if(!s){
ToastCtrl.instance.show(DataManager.ins.getData("doStart").message) ToastCtrl.instance.show(DataManager.ins.getData("doStart").message)
...@@ -249,6 +284,7 @@ export default class StartScene extends Scene { ...@@ -249,6 +284,7 @@ export default class StartScene extends Scene {
unlockArea(){ unlockArea(){
if(this.level == 0){ if(this.level == 0){
Waiting.instance.show(); Waiting.instance.show();
NetManager.ins.clickLog(this.chuandiExposure);
yzwNet.doStart((s)=>{ yzwNet.doStart((s)=>{
if(!s){ if(!s){
ToastCtrl.instance.show(DataManager.ins.getData("doStart").message) ToastCtrl.instance.show(DataManager.ins.getData("doStart").message)
...@@ -301,10 +337,12 @@ export default class StartScene extends Scene { ...@@ -301,10 +337,12 @@ export default class StartScene extends Scene {
} }
onTap_chuandi(){ onTap_chuandi(){
NetManager.ins.clickLog(this.huozhongExposure);
SceneCtrl.instance.change(ModuleTypes.ShareStarterScene); SceneCtrl.instance.change(ModuleTypes.ShareStarterScene);
} }
onTap_PKBtn(){ onTap_PKBtn(){
Waiting.instance.show(); Waiting.instance.show();
NetManager.ins.clickLog(this.pkExposure);
yzwNet.getPkBaseInfo((s)=>{ yzwNet.getPkBaseInfo((s)=>{
Waiting.instance.hide(); Waiting.instance.hide();
if(!s){ if(!s){
......
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