添加模拟射箭按钮

This commit is contained in:
kron
2025-06-08 13:55:09 +08:00
parent deff79aa7b
commit 312906fec3
5 changed files with 46 additions and 7 deletions

View File

@@ -1,10 +1,22 @@
<script setup>
import useStore from "@/store";
import { simulShootAPI } from "@/apis";
import { storeToRefs } from "pinia";
const store = useStore();
const { device } = storeToRefs(store);
defineProps({
title: {
type: String,
default: "",
},
});
const simulShoot = async () => {
if (device.value.deviceId) {
await simulShootAPI(device.value.deviceId);
}
};
</script>
<template>
@@ -13,6 +25,7 @@ defineProps({
<image src="../static/back.png" mode="widthFix" />
</navigator>
<text>{{ title }}</text>
<view class="simul" @click="simulShoot">S</view>
</view>
</template>
@@ -38,4 +51,8 @@ defineProps({
.container > text {
color: #fff;
}
.simul {
color: #fff;
margin-left: 20px;
}
</style>