Commit 69184621 authored by zhangjinzhou's avatar zhangjinzhou

代码暂存

parent a522ea2d
...@@ -109,8 +109,17 @@ Page({ ...@@ -109,8 +109,17 @@ Page({
avatar4: "", avatar4: "",
canwin: false canwin: false
}, },
onLoad(props) { onLoad(query) {
console.log("onLoad========>", app, props); // console.log("onLoad========>", app, props);
let isnewdata = my.getStorageSync({
key: 'jn_' + app.openId + "_new"
});
let isnew = isnewdata.data ? 0 : 1;
this.setData({
isnew: isnew
});
console.log("新手", isnew, query);
let step = 1; let step = 1;
let sucgl = 70; let sucgl = 70;
let nranksuc = Math.random() * 100; let nranksuc = Math.random() * 100;
...@@ -144,12 +153,16 @@ Page({ ...@@ -144,12 +153,16 @@ Page({
canwin: canwin, canwin: canwin,
isfirst: true, isfirst: true,
}); });
let attiontxt1 = "游戏开始啦,共有" + roomnums + "名玩家加入游戏,快来升温队伍拿奖励吧。";
this.addAttionTxt(attiontxt1);
this.changePashow(); this.changePashow();
},
startGame() {
if (this.data.isnew > 0 && this.data.isnew < 7) {
return;
}
console.log("游戏开始逻辑");
let attiontxt1 = "游戏开始啦,共有" + this.data.roomnums + "名玩家加入游戏,快来升温队伍拿奖励吧。";
this.addAttionTxt(attiontxt1);
this.updateAct(); this.updateAct();
// this.updateActInfo();
// this.doAiControl();
this.newAiControl(); this.newAiControl();
}, },
//新ai逻辑 //新ai逻辑
...@@ -294,6 +307,9 @@ Page({ ...@@ -294,6 +307,9 @@ Page({
} }
}, },
onShow() { onShow() {
if ((this.data.isnew > 0 && this.data.isnew < 7)||this.data.show_v!=2) {
return;
}
this.updateActInfo(); this.updateActInfo();
}, },
//更新活动信息 //更新活动信息
...@@ -427,6 +443,7 @@ Page({ ...@@ -427,6 +443,7 @@ Page({
this.setData({ this.setData({
show_v: 2 show_v: 2
}) })
this.startGame();
}, 1000); }, 1000);
}, },
//新手下一步 //新手下一步
...@@ -435,6 +452,7 @@ Page({ ...@@ -435,6 +452,7 @@ Page({
this.setData({ this.setData({
isnew: nguide isnew: nguide
}); });
this.startGame();
}, },
//使用道具 //使用道具
async usetool() { async usetool() {
......
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