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

自动play

parent dce8d898
...@@ -146,6 +146,8 @@ export default { ...@@ -146,6 +146,8 @@ export default {
setTimeout(() => { setTimeout(() => {
this.init().autoTime() this.init().autoTime()
}, 1000) }, 1000)
} else {
this.network().autoPlay('release') // 去掉自动游戏
} }
}, },
// 自动玩游戏递归调用 // 自动玩游戏递归调用
...@@ -185,12 +187,13 @@ export default { ...@@ -185,12 +187,13 @@ export default {
setAutoPlay: (time) => { setAutoPlay: (time) => {
if (time === -1) { if (time === -1) {
this.autoTime = -1 this.autoTime = -1
this.network().autoPlay('release')
} else { } else {
this.autoTime = time * 60 this.autoTime = time * 60
this.init().autoTime() this.init().autoTime()
this.network().autoPlay('press')
this.showTime = false this.showTime = false
} }
this.init().autoPlay()
}, },
cancelAuto: () => { cancelAuto: () => {
this.cancelAutoClick++ this.cancelAutoClick++
...@@ -200,6 +203,7 @@ export default { ...@@ -200,6 +203,7 @@ export default {
if (this.cancelAutoClick >= 2) { if (this.cancelAutoClick >= 2) {
this.autoTime = 0 this.autoTime = 0
this.cancelAutoClick = 0 this.cancelAutoClick = 0
this.network().autoPlay('release')
} }
}, },
} }
...@@ -283,6 +287,22 @@ export default { ...@@ -283,6 +287,22 @@ export default {
}, 100) }, 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