仅正式环境判断设备在线

This commit is contained in:
kron
2026-01-04 11:36:31 +08:00
parent 60b1006447
commit 9f7523839d
6 changed files with 44 additions and 90 deletions

View File

@@ -5,6 +5,7 @@ import Container from "@/components/Container.vue";
import Guide from "@/components/Guide.vue";
import Avatar from "@/components/Avatar.vue";
import { getPractiseDataAPI } from "@/apis";
import { canEenter } from "@/util";
import useStore from "@/store";
import { storeToRefs } from "pinia";
@@ -13,24 +14,7 @@ const { user, device, online } = storeToRefs(store);
const data = ref({});
const goPractise = async (type) => {
if (!device.value.deviceId) {
return uni.showToast({
title: "请先绑定设备",
icon: "none",
});
}
if (!online.value) {
return uni.showToast({
title: "智能弓未连接",
icon: "none",
});
}
if (!user.value.trio) {
return uni.showToast({
title: "请先完成新手试炼",
icon: "none",
});
}
if (!canEenter(user.value, device.value, online.value)) return;
await uni.$checkAudio();
uni.navigateTo({
url: `/pages/practise-${type}`,