Browse Source

功能修复

guessPrice
sui 5 years ago
parent
commit
a638e0ec9b
2 changed files with 12 additions and 3 deletions
  1. +2
    -1
      496_dongfengqichen/pages/index/index.js
  2. +10
    -2
      496_dongfengqichen/pages/luckyStar/luckyStar.js

+ 2
- 1
496_dongfengqichen/pages/index/index.js View File

this.data.subscribeData.realname = ""; this.data.subscribeData.realname = "";
this.data.subscribeData.captcha = ""; this.data.subscribeData.captcha = "";
this.setData({ this.setData({
subscribeData: this.data.subscribeData
subscribeData: this.data.subscribeData,
verificationCode: '获取验证码',
}) })
// this.setData({ // this.setData({
// isRegister:true // isRegister:true

+ 10
- 2
496_dongfengqichen/pages/luckyStar/luckyStar.js View File

}, },
beginGame: function () {//开始游戏 beginGame: function () {//开始游戏
app.wxRequest(app.globalData.urlRoot + "dollGame/beginGame", {}, res => { app.wxRequest(app.globalData.urlRoot + "dollGame/beginGame", {}, res => {
console.log(res);
if(res.code==200){ if(res.code==200){
this.data.gameSign = res.data.sign; this.data.gameSign = res.data.sign;
this.endGame(); this.endGame();
}, this,"POST") }, this,"POST")
}, },
startClaw:function(e){//开始控制爪子方向 startClaw:function(e){//开始控制爪子方向
if(!this.data.gameState){
return;
}
let direction = e.currentTarget.dataset.direction; let direction = e.currentTarget.dataset.direction;
if (direction == "L") {//向左 if (direction == "L") {//向左
if (this.data.clawLeft <= 130) { if (this.data.clawLeft <= 130) {
}, 20); }, 20);
} }
}, },
endClaw:function(e){//结束爪子动作
endClaw: function (e) {//结束爪子动作
if (!this.data.gameState) {
return;
}
let direction = e.currentTarget.dataset.direction; let direction = e.currentTarget.dataset.direction;
if (direction == "L") {//向左 if (direction == "L") {//向左
clearInterval(this.data.setGroup.left); clearInterval(this.data.setGroup.left);
} }
}, },
getClaw:function(){//抓取 getClaw:function(){//抓取
if (!this.data.gameState){
return;
}
this.setData({ this.setData({
clawTop: this.data.clawScale > 1 ? 490 - (2 * (this.data.clawScale-1) * 90) : 490 + (2 * (1 - this.data.clawScale) * 90 ) clawTop: this.data.clawScale > 1 ? 490 - (2 * (this.data.clawScale-1) * 90) : 490 + (2 * (1 - this.data.clawScale) * 90 )
}) })

Loading…
Cancel
Save