Commit ac75957c authored by zhangjinzhou's avatar zhangjinzhou

代码暂存

parent 59eec3b1
......@@ -146,6 +146,7 @@ Page({
let isnewdata = my.getStorageSync({
key: 'jn_' + app.openId + '_new'
});
console.log("新手数据", isnewdata);
let isnew = isnewdata.data ? 0 : 1;
// isnew = 1;
this.setData({
......@@ -612,6 +613,39 @@ Page({
this.updateActInfo();
},
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 roomnums = this.data.roomnums;
......@@ -646,38 +680,6 @@ Page({
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
updateAct() {
......
......@@ -549,7 +549,7 @@ Page({
// }
// }
console.log("上局状态",data);
//服务器的
let { joinGameStartTime, joinGameEndTime, toolStartTime, toolEndTime, winRate, propsCD ,step} = data;
if (joinGameStartTime && joinGameEndTime) {
......@@ -557,8 +557,8 @@ Page({
if(!nowTime){
nowTime = Date.now();
}
let toolcd = Math.ceil((toolEndTime-toolStartTime)/1000);
let toolcd = Math.ceil(propsCD);
let tooless = Math.ceil((toolEndTime-nowTime)/1000);
if(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