Commit cc654f5b authored by 毛线's avatar 毛线

auto bug

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