Commit c123732e authored by wildfirecode's avatar wildfirecode

1

parent 6eac03bb
......@@ -48,7 +48,7 @@
<script src="libs/pad-zeropadding.js"></script>
<img id="pic" style="width:100%;position: absolute;z-index: 999;display: none;" />
<script>
localStorage.clear();
// localStorage.clear();
window['total_level'] = 18 + 13 * 4;
window['last_level'] = 69;//必须大于等于total_level
......
......@@ -39,6 +39,7 @@ import SignPrizePanel from "../../src/panels/SignPrizePanel";
import getHomeData, { BLOOD_NUMS_MAX } from "../../src/getHomeData";
import BloodPanel2 from "../../src/panels/BloodPanel2";
import ExchangePanel from "../../src/panels/ExchangePanel";
import { initstatistics } from "../../src/statistics";
export default class MainBase extends eui.UILayer {
constructor() {
......@@ -292,7 +293,7 @@ export default class MainBase extends eui.UILayer {
check();
});
initstatistics();
document.addEventListener("visibilitychange", () => {
if (document.visibilityState == "visible") {
......
......@@ -1774,6 +1774,27 @@ export class NetManager extends ABNetManager {
this.send(net);
}
public remainDuration(remain,first,from?): void {
const net: INetData = {
name: 'remainDuration',
uri: window['duiba'] +'/customActivity/api/remainDuration ',
type: 'get',
dataType: 'jsonp',
param: {
id: DataManager.ins.customCfgData.hdToolId,
activityId: DataManager.ins.customCfgData.actId,
activityType:'hdtool',
remain:remain,
first:first,
from:from
},
callback: null,
hideMsg: true
};
this.send(net);
}
/**
* 消息响应
* @param net
......
......@@ -15,6 +15,6 @@
<e:Image id="progressmask2" y="9.14" x="16" source="mask2_png" width="444" height="60" scaleX="1"/>
</e:Group>
<e:Image source="头顶树丛_png" x="0" y="0"/>
<e:Label text="正在加载中,请稍后" y="985" textColor="0x244b00" horizontalCenter="0"/>
<e:Label id="tips" text="正在加载中,请稍后" y="993" textColor="0x244b00" horizontalCenter="0" size="24"/>
<e:Label id="percentTxt" text="63%" y="1110" textColor="0x244B00" horizontalCenter="0.5"/>
</e:Skin>
\ No newline at end of file
......@@ -24,7 +24,7 @@ export default class SignItem extends eui.ItemRenderer {
this['line1'].visible=this.data.index!=6;
this['line2'].visible=!this['line1'].visible;
this['light'].visible=this.data.signed;
this['title'].text = `${this.data.index+1}天`;
this['title'].text = `连续签到${this.data.index+1}天`;
this['amount'].text = this.data.config.nums;
if(this.data.config.nums<=0)
......
......@@ -6,7 +6,16 @@ import { loadSvga } from "../loadSvga";
import MapBottomPart from "../mapScene/MapBottomPart";
import MapRpeatPart from "../mapScene/MapRpeatPart";
import MapTopPart from "../mapScene/MapTopPart";
import setGlow from "../setGlow";
const list = [
'小提示:凑齐5个萌狮连消,可以开启大招哦!',
'小提示:连续爆炸,得分会成倍增加~',
'小提示:发光的小动物可以消除一整片区域哦!',
'小提示:带箭头的小动物可以连消一行或一列~',
'小提示:冰块对小动物不利,消除他们势在必行!',
'万千烦恼丝,一起全消掉!',
'连萌梦境,即将开启~'
]
export default class StartScene extends Scene {
private STOP_PERCENT = 99;
private _current = 0;
......@@ -22,7 +31,9 @@ export default class StartScene extends Scene {
this['progressmask2'].scaleX = 0;
this['percentTxt'].text = `0%`;
const index = Math.floor(Math.random() * list.length);
this['tips'].text = list[index];
// setGlow(this['tips'], 0xffffff, 1);
if (data && Array.isArray(data)) {
this['container3'].addChild(data[0]);
this['container2'].addChild(data[1]);
......
import { NetManager } from "../libs/tw/manager/NetManager";
let startTimer = new Date().getTime();
let endTimer;
//设置隐藏属性和改变可见属性的事件的名称
let hidden, visibilityChange;
if (typeof document.hidden !== 'undefined') {
hidden = 'hidden';
visibilityChange = 'visibilitychange';
} else if (typeof document['msHidden'] !== 'undefined') {
hidden = 'msHidden';
visibilityChange = 'msvisibilitychange';
} else if (typeof document['webkitHidden'] !== 'undefined') {
hidden = 'webkitHidden';
visibilityChange = 'webkitvisibilitychange';
}
const handleVisibilityChange = (e) => {
if (document.visibilityState == "visible") {
startTimer = new Date().getTime();
console.log('starttimer', startTimer)
}
if (document.visibilityState == "hidden") {
endTimer = new Date().getTime();
console.log('endTimer', endTimer)
sendData();
}
};
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);
// }
}
export const initstatistics = () => {
document.addEventListener(
visibilityChange,
handleVisibilityChange,
false
);
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