修改模拟射箭
This commit is contained in:
@@ -201,7 +201,7 @@ export const simulShootAPI = (device_id, x, y) => {
|
||||
const data = {
|
||||
device_id,
|
||||
};
|
||||
if (x && y) {
|
||||
if (x !== undefined && y !== undefined) {
|
||||
data.x = x;
|
||||
data.y = y;
|
||||
}
|
||||
|
||||
@@ -111,6 +111,9 @@ function calcRealY(num) {
|
||||
const simulShoot = async () => {
|
||||
if (device.value.deviceId) await simulShootAPI(device.value.deviceId);
|
||||
};
|
||||
const simulShoot2 = async () => {
|
||||
if (device.value.deviceId) await simulShootAPI(device.value.deviceId, 1, 1);
|
||||
};
|
||||
</script>
|
||||
|
||||
<template>
|
||||
@@ -179,8 +182,9 @@ const simulShoot = async () => {
|
||||
<view v-if="avatar" class="footer">
|
||||
<image :src="avatar" mode="widthFix" />
|
||||
</view>
|
||||
<view class="simul" @click="simulShoot" :style="{ color: '#fff' }">
|
||||
模拟射箭
|
||||
<view class="simul">
|
||||
<button @click="simulShoot">模拟</button>
|
||||
<button @click="simulShoot2">射箭</button>
|
||||
</view>
|
||||
<StartCountdown :start="startCount" />
|
||||
</view>
|
||||
@@ -262,7 +266,9 @@ const simulShoot = async () => {
|
||||
position: absolute;
|
||||
bottom: 20px;
|
||||
right: 20px;
|
||||
color: #fff;
|
||||
margin-left: 20px;
|
||||
}
|
||||
.simul > button {
|
||||
color: #fff;
|
||||
}
|
||||
</style>
|
||||
|
||||
Reference in New Issue
Block a user