Commit 4f9e72b1 authored by 毛线's avatar 毛线

自动play

parent dce8d898
......@@ -146,6 +146,8 @@ export default {
setTimeout(() => {
this.init().autoTime()
}, 1000)
} else {
this.network().autoPlay('release') // 去掉自动游戏
}
},
// 自动玩游戏递归调用
......@@ -185,12 +187,13 @@ export default {
setAutoPlay: (time) => {
if (time === -1) {
this.autoTime = -1
this.network().autoPlay('release')
} else {
this.autoTime = time * 60
this.init().autoTime()
this.network().autoPlay('press')
this.showTime = false
}
this.init().autoPlay()
},
cancelAuto: () => {
this.cancelAutoClick++
......@@ -200,6 +203,7 @@ export default {
if (this.cancelAutoClick >= 2) {
this.autoTime = 0
this.cancelAutoClick = 0
this.network().autoPlay('release')
}
},
}
......@@ -283,6 +287,22 @@ export default {
}, 100)
})
},
autoPlay: (methodName) => {
const { id, playBtn, } = this
const params = {
deviceId: id,
methodName,
key: playBtn.buttonValue,
}
this.$request({
url: '/api/game/button',
method: 'get',
params,
}).then(({ data }) => {
}).catch(() => {
})
},
}
},
}
......
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