Commit 03a01458 authored by 王炽's avatar 王炽

66666666

parent 6c37ffa3
import { initstatistics } from './statistics';
// import { initstatistics } from './statistics';
import { DataManager } from './../libs/tw/manager/DataManager';
import MainBase from "../libs/tl/MainBase";
import { NetManager } from "../libs/tw/manager/NetManager";
......@@ -41,11 +41,11 @@ class Main extends MainBase {
}
// 获取数据
protected getData() {
super.getData();
DataManager.ins.customCfgData = window['CFG'];
initstatistics();
}
// protected getData() {
// super.getData();
// DataManager.ins.customCfgData = window['CFG'];
// initstatistics();
// }
// 创建游戏场景
protected createGameScene() {
......
import { setEndTime, sendData } from './../statistics';
// import { setEndTime, sendData } from './../statistics';
import { LoopComponent } from './LoopComponent';
import { GCache } from './../../libs/tc/util/GCache';
import { WinnersData } from './../../libs/tw/data/common/winners/WinnersData';
......@@ -577,8 +577,8 @@ export default class PlayScene extends Scene {
this.removeEventListener(egret.Event.ENTER_FRAME, this.onEnterFrame, this);
egret.Tween.removeAllTweens();
setEndTime();
sendData();
// setEndTime();
// sendData();
SceneCtrl.instance.change(ModuleTypes.START_SCENE);
}else{
this.skip(12);
......@@ -602,8 +602,8 @@ export default class PlayScene extends Scene {
} else {
GCache.writeCache(`maxLevel`, this.currLevel);
}
setEndTime();
sendData();
// setEndTime();
// sendData();
PanelCtrl.instance.show(ModuleTypes.NOPRIZE_PANEL, '');
}
......
......@@ -36,7 +36,7 @@ export default class PrizePanel extends Panel {
private onLoad():void{
this.idx = Math.floor(Math.random() * 3);
this.img.source = window['imgstr'] ? (window['imgstr'] + this.idx + '.png') : 'prizeImg' + this.idx + '_png';
this.img.source = '';//window['imgstr'] ? (window['imgstr'] + this.idx + '.png') : 'prizeImg' + this.idx + '_png';
let logIdx;
if(this.idx == 0){
......@@ -47,11 +47,11 @@ export default class PrizePanel extends Panel {
logIdx = 4;
}
let startDpmOut = Buried.connectDpm(110, logIdx, 1); // 点击埋点
let startDcmOut = Buried.connectDcm(202, 0, 0); // 曝光埋点
let exposure = Buried.createExposure(startDpmOut, startDcmOut);
// let startDpmOut = Buried.connectDpm(110, logIdx, 1); // 点击埋点
// let startDcmOut = Buried.connectDcm(202, 0, 0); // 曝光埋点
// let exposure = Buried.createExposure(startDpmOut, startDcmOut);
NetManager.ins.showLog(exposure);
// NetManager.ins.showLog(exposure);
}
initEvents() {
......@@ -81,11 +81,11 @@ export default class PrizePanel extends Panel {
logIdx = 4;
}
let startDpmOut = Buried.connectDpm(110, logIdx, 1); // 点击埋点
let startDcmOut = Buried.connectDcm(202, 0, 0); // 曝光埋点
let exposure = Buried.createExposure(startDpmOut, startDcmOut);
// let startDpmOut = Buried.connectDpm(110, logIdx, 1); // 点击埋点
// let startDcmOut = Buried.connectDcm(202, 0, 0); // 曝光埋点
// let exposure = Buried.createExposure(startDpmOut, startDcmOut);
NetManager.ins.clickLog(exposure);
// NetManager.ins.clickLog(exposure);
}
onUse() {
......@@ -102,11 +102,11 @@ export default class PrizePanel extends Panel {
logIdx = 4;
}
let startDpmOut = Buried.connectDpm(110, logIdx, 1); // 点击埋点
let startDcmOut = Buried.connectDcm(202, 0, 0); // 曝光埋点
let exposure = Buried.createExposure(startDpmOut, startDcmOut);
// let startDpmOut = Buried.connectDpm(110, logIdx, 1); // 点击埋点
// let startDcmOut = Buried.connectDcm(202, 0, 0); // 曝光埋点
// let exposure = Buried.createExposure(startDpmOut, startDcmOut);
NetManager.ins.clickLog(exposure);
// NetManager.ins.clickLog(exposure);
}
onTouchTap(){
......
......@@ -32,11 +32,11 @@ export default class ExStartScene extends StartScene {
protected initUI() {
super.initUI();
let startDpmOut = Buried.connectDpm(110, 1, 1); // 点击埋点
let startDcmOut = Buried.connectDcm(202, 0, 0); // 曝光埋点
let exposure = Buried.createExposure(startDpmOut, startDcmOut);
// let startDpmOut = Buried.connectDpm(110, 1, 1); // 点击埋点
// let startDcmOut = Buried.connectDcm(202, 0, 0); // 曝光埋点
// let exposure = Buried.createExposure(startDpmOut, startDcmOut);
NetManager.ins.showLog(exposure);
// NetManager.ins.showLog(exposure);
this.updateCostTxt();
this.updateMyCredits();
......
import { setStartTime } from './../statistics';
// import { setStartTime } from './../statistics';
import { GameStartModel } from './../../libs/tw/model/game/GameStartModel';
import { TwFun } from './../../libs/tw/util/TwFun';
import Scene from "../views/Scene";
......@@ -138,12 +138,12 @@ export default class StartScene extends Scene {
playSound('button_sound');
setStartTime();
let startDpmOut = Buried.connectDpm(110, 1, 1); // 点击埋点
let startDcmOut = Buried.connectDcm(202, 0, 0); // 曝光埋点
let exposure = Buried.createExposure(startDpmOut, startDcmOut);
// setStartTime();
// let startDpmOut = Buried.connectDpm(110, 1, 1); // 点击埋点
// let startDcmOut = Buried.connectDcm(202, 0, 0); // 曝光埋点
// let exposure = Buried.createExposure(startDpmOut, startDcmOut);
NetManager.ins.clickLog(exposure);
// NetManager.ins.clickLog(exposure);
egret.Tween.removeTweens(this.startBtn);
SceneCtrl.instance.change(ModuleTypes.PLAY_SCENE);
......
......@@ -17,44 +17,44 @@ if (typeof document.hidden !== 'undefined') {
const handleVisibilityChange = (e) => {
if (document.visibilityState == "visible") {
startTimer = new Date().getTime();
console.log('starttimer', startTimer)
// startTimer = new Date().getTime();
// console.log('starttimer', startTimer)
}
if (document.visibilityState == "hidden") {
endTimer = new Date().getTime();
console.log('endTimer', endTimer)
sendData();
// endTimer = new Date().getTime();
// console.log('endTimer', endTimer)
// sendData();
}
};
export const setStartTime = () => {
startTimer = new Date().getTime();
}
export const setEndTime = () => {
endTimer = new Date().getTime();
}
export const sendData = () => {
const t0 = endTimer - startTimer;
// export const setStartTime = () => {
// startTimer = new Date().getTime();
// }
// export const setEndTime = () => {
// endTimer = new Date().getTime();
// }
// export const sendData = () => {
// const t0 = endTimer - startTimer;
console.log('停留时间是', t0);
// if (localStorage.getItem('xxl_first_statistics') == null) {
// NetManager.ins.remainDuration(t0, true);
// localStorage.setItem('xxl_first_statistics', '1');
// } else {
NetManager.ins.remainDuration(t0, false);
// }
}
// console.log('停留时间是', t0);
// // if (localStorage.getItem('xxl_first_statistics') == null) {
// // NetManager.ins.remainDuration(t0, true);
// // localStorage.setItem('xxl_first_statistics', '1');
// // } else {
// NetManager.ins.remainDuration(t0, false);
// // }
// }
export const initstatistics = () => {
document.addEventListener(
visibilityChange,
handleVisibilityChange,
false
);
// export const initstatistics = () => {
// document.addEventListener(
// visibilityChange,
// handleVisibilityChange,
// false
// );
document.body['onbeforeunload'] = () => {
endTimer = new Date().getTime();
return sendData();
}
}
// document.body['onbeforeunload'] = () => {
// endTimer = new Date().getTime();
// return sendData();
// }
// }
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