Commit 9b79369c authored by zhangjinzhou's avatar zhangjinzhou

代码暂存

parent 01eccadc
...@@ -17,11 +17,11 @@ const { ...@@ -17,11 +17,11 @@ const {
getSystemInfo getSystemInfo
} = tbcc.tb; } = tbcc.tb;
let updateact = 1;//请求 let updateact = 1;//请求
const gameatime = 100;//活动倒计时,100, let gameatime = 100;//活动倒计时,100,
const toolwarm = 1;//升温道具+温度值 const toolwarm = 1;//升温道具+温度值
const taskwarm = 1;//任务+温度值 const taskwarm = 1;//任务+温度值
const invitewarm = 1;//邀请+温度值 const invitewarm = 1;//邀请+温度值
const toolcd = 5;// let gtoolcd = 5;//
const paple1 = "cloud://1C47337C3D86F381913E3741232B26EB//paple1.svga"; const paple1 = "cloud://1C47337C3D86F381913E3741232B26EB//paple1.svga";
const paple2 = "cloud://6E5D893BA34F99343C702D9FAA543C21//paple2.svga"; const paple2 = "cloud://6E5D893BA34F99343C702D9FAA543C21//paple2.svga";
...@@ -48,6 +48,8 @@ Page({ ...@@ -48,6 +48,8 @@ Page({
],//实际展示的list ],//实际展示的list
iswin: false,// iswin: false,//
step: 1,//阶段 step: 1,//阶段
startime:0,
endtime:0,
//我的消息通知 //我的消息通知
linvite: { linvite: {
count: 0, count: 0,
...@@ -112,16 +114,25 @@ Page({ ...@@ -112,16 +114,25 @@ Page({
onLoad(query) { onLoad(query) {
// console.log("onLoad========>", app, props); // console.log("onLoad========>", app, props);
let isnewdata = my.getStorageSync({ let isnewdata = my.getStorageSync({
key: 'jn_' + app.openId + "_new" key: 'jn_' + app.openId + '_new'
}); });
let isnew = isnewdata.data ? 0 : 1; let isnew = isnewdata.data ? 0 : 1;
this.setData({ this.setData({
isnew: isnew isnew: isnew
}); });
if(isnew!=0){
my.setStorageSync({
key: 'jn_' + app.openId + '_new',
data: 1
});
}
console.log("新手", isnew, query); console.log("新手", isnew, query);
let step = 1; let {end,gl,start,step,toolcd} = query;
let sucgl = 70; step = Number(step);
gameatime = Math.floor((Number(end)-Number(start))/1000);
gtoolcd = Number(toolcd);
let sucgl = Number(gl);
let nranksuc = Math.random() * 100; let nranksuc = Math.random() * 100;
let canwin = false; let canwin = false;
if (nranksuc < sucgl) {//能赢 if (nranksuc < sucgl) {//能赢
...@@ -152,6 +163,10 @@ Page({ ...@@ -152,6 +163,10 @@ Page({
showattionlist: [], showattionlist: [],
canwin: canwin, canwin: canwin,
isfirst: true, isfirst: true,
gametime:gameatime,
tooltime:0,
startime:Number(start),
endtime:Number(end),
}); });
this.changePashow(); this.changePashow();
}, },
...@@ -176,7 +191,7 @@ Page({ ...@@ -176,7 +191,7 @@ Page({
doact = true; doact = true;
} }
let i = 1; let i = 0;
if (doact) { if (doact) {
let isfirst = this.data.isfirst; let isfirst = this.data.isfirst;
if (isfirst) { if (isfirst) {
...@@ -263,7 +278,7 @@ Page({ ...@@ -263,7 +278,7 @@ Page({
let lesstime = this.data.gametime * 1000; let lesstime = this.data.gametime * 1000;
let itime1 = Number((Math.random() * chatime).toFixed(2)) * 1000; let itime1 = Number((Math.random() * chatime).toFixed(2)) * 1000;
let nexttooltime = toolcd * 1000 + itime1; let nexttooltime = gtoolcd * 1000 + itime1;
if (nexttooltime < lesstime) { if (nexttooltime < lesstime) {
return this.aiuseTool(nexttooltime, i, chatime); return this.aiuseTool(nexttooltime, i, chatime);
} }
...@@ -492,7 +507,7 @@ Page({ ...@@ -492,7 +507,7 @@ Page({
if (success) { if (success) {
this.updateActInfo(); this.updateActInfo();
this.setData({ this.setData({
tooltime: 5 tooltime: gtoolcd
}); });
} }
} else {//倒计时中 } else {//倒计时中
......
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