Commit ac75957c authored by zhangjinzhou's avatar zhangjinzhou

代码暂存

parent 59eec3b1
...@@ -146,6 +146,7 @@ Page({ ...@@ -146,6 +146,7 @@ Page({
let isnewdata = my.getStorageSync({ let isnewdata = my.getStorageSync({
key: 'jn_' + app.openId + '_new' key: 'jn_' + app.openId + '_new'
}); });
console.log("新手数据", isnewdata);
let isnew = isnewdata.data ? 0 : 1; let isnew = isnewdata.data ? 0 : 1;
// isnew = 1; // isnew = 1;
this.setData({ this.setData({
...@@ -612,6 +613,39 @@ Page({ ...@@ -612,6 +613,39 @@ Page({
this.updateActInfo(); this.updateActInfo();
}, },
onHide() { onHide() {
this.hideSetData();
this.setData({
hidetime: ntime
});
},
//更新活动信息
//30s刷新一次邀请人列表,新增温暖,结束前5s再请求一次,onshow请求一次
async updateActInfo(gamestat = "now") {
// console.log("updateActInfo=======>");
clearTimeout(updateact);
await this.updateAttionList(gamestat);
await this.getInviteListByCurGame();
let lesstime = this.data.gametime * 1000;
let chatime = 30000;
if (lesstime > chatime) {
} else {
if (lesstime > 5000) {
chatime = lesstime - 5000;
} else {
chatime = 0;
}
}
if (chatime > 0) {
// console.log("下次请求间隔", chatime);
updateact = setTimeout(() => {
this.updateActInfo();
}, chatime);
}
this.hideSetData();
},
//hideset Data
hideSetData() {
//房间数据 //房间数据
let roomdata = this.data.roomdata; let roomdata = this.data.roomdata;
let roomnums = this.data.roomnums; let roomnums = this.data.roomnums;
...@@ -646,38 +680,6 @@ Page({ ...@@ -646,38 +680,6 @@ Page({
hidetime: ntime, hidetime: ntime,
} }
}) })
this.setData({
hidetime: ntime
});
},
//更新活动信息
//30s刷新一次邀请人列表,新增温暖,结束前5s再请求一次,onshow请求一次
async updateActInfo(gamestat = "now") {
// console.log("updateActInfo=======>");
clearTimeout(updateact);
await this.updateAttionList(gamestat);
await this.getInviteListByCurGame();
let lesstime = this.data.gametime * 1000;
let chatime = 30000;
if (lesstime > chatime) {
} else {
if (lesstime > 5000) {
chatime = lesstime - 5000;
} else {
chatime = 0;
}
}
if (chatime > 0) {
// console.log("下次请求间隔", chatime);
updateact = setTimeout(() => {
this.updateActInfo();
}, chatime);
}
}, },
//全局的update //全局的update
updateAct() { updateAct() {
......
...@@ -549,7 +549,7 @@ Page({ ...@@ -549,7 +549,7 @@ Page({
// } // }
// } // }
console.log("上局状态",data);
//服务器的 //服务器的
let { joinGameStartTime, joinGameEndTime, toolStartTime, toolEndTime, winRate, propsCD ,step} = data; let { joinGameStartTime, joinGameEndTime, toolStartTime, toolEndTime, winRate, propsCD ,step} = data;
if (joinGameStartTime && joinGameEndTime) { if (joinGameStartTime && joinGameEndTime) {
...@@ -558,7 +558,7 @@ Page({ ...@@ -558,7 +558,7 @@ Page({
nowTime = Date.now(); nowTime = Date.now();
} }
let toolcd = Math.ceil((toolEndTime-toolStartTime)/1000); let toolcd = Math.ceil(propsCD);
let tooless = Math.ceil((toolEndTime-nowTime)/1000); let tooless = Math.ceil((toolEndTime-nowTime)/1000);
if(tooless<0){ if(tooless<0){
tooless = 0; tooless = 0;
......
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