Commit cc654f5b authored by 毛线's avatar 毛线

auto bug

parent 25c2d3a6
...@@ -135,6 +135,15 @@ export default { ...@@ -135,6 +135,15 @@ export default {
} }
return isAuto return isAuto
}, },
// play按钮的value
buttonValue() {
return this.playBtn.buttonValue
},
},
created() {
if (this.buttonValue) {
this.network().autoPlay('release') // 进入游戏的时候,先暂停之前的auto
}
}, },
methods: { methods: {
init() { init() {
...@@ -177,23 +186,22 @@ export default { ...@@ -177,23 +186,22 @@ export default {
this.network().upPoint({ type: 2 }) this.network().upPoint({ type: 2 })
}, },
play: () => { play: () => {
const { playBtn } = this const { buttonValue } = this
this.network().button({ buttonValue: playBtn.buttonValue }) this.network().button({ buttonValue })
}, },
player: ({ x16, y16 }) => { player: ({ x16, y16 }) => {
this.network().touch({ x: x16, y: y16 }) this.network().touch({ x: x16, y: y16 })
}, },
// 设置自动play时间 // 设置自动play时间
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.network().autoPlay('press')
this.showTime = false this.showTime = false
}
}, },
cancelAuto: () => { cancelAuto: () => {
this.cancelAutoClick++ this.cancelAutoClick++
...@@ -288,11 +296,12 @@ export default { ...@@ -288,11 +296,12 @@ export default {
}) })
}, },
autoPlay: (methodName) => { autoPlay: (methodName) => {
const { id, playBtn, } = this const { id, buttonValue, } = this
console.log('buttonValue', buttonValue)
const params = { const params = {
deviceId: id, deviceId: id,
methodName, methodName,
key: playBtn.buttonValue, key: buttonValue,
} }
this.$request({ this.$request({
......
...@@ -17,7 +17,7 @@ ...@@ -17,7 +17,7 @@
</div> </div>
</div> </div>
<!-- 底部键盘 --> <!-- 底部键盘 -->
<Keyboard :id="id" :device-button-panel="deviceButtonPanel" /> <Keyboard v-if="deviceButtonPanel.id" :id="id" :device-button-panel="deviceButtonPanel" />
</div> </div>
</template> </template>
......
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