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