diff --git a/src/audioManager.js b/src/audioManager.js
index dfd13e2..ca72ac2 100644
--- a/src/audioManager.js
+++ b/src/audioManager.js
@@ -1,4 +1,6 @@
const audioFils = {
+ 激光已校准:
+ "https://static.shelingxingqiu.com/attachment/2025-10-29/ddupaur1vdkyhzaqdc.mp3",
胜利: "https://static.shelingxingqiu.com/attachment/2025-09-17/dcuo9yjp0kt5msvmvd.mp3",
失败: "https://static.shelingxingqiu.com/attachment/2025-09-17/dcuo9yht2sdwhuqygy.mp3",
请射箭测试距离:
@@ -64,9 +66,9 @@ function debugLog(...args) {
// 获取当前环境信息
const accountInfo = uni.getAccountInfoSync();
const envVersion = accountInfo.miniProgram.envVersion;
-
+
// 只在体验版打印日志,正式版(release)和开发版(develop)不打印
- if (envVersion === 'trial') {
+ if (envVersion === "trial") {
console.log(...args);
}
}
@@ -77,13 +79,13 @@ class AudioManager {
this.currentPlayingKey = null;
this.retryCount = new Map();
this.maxRetries = 3;
-
+
// 串行加载相关属性
this.audioKeys = [];
this.currentLoadingIndex = 0;
this.isLoading = false;
this.loadingPromise = null;
-
+
this.initAudios();
}
@@ -98,11 +100,11 @@ class AudioManager {
this.isLoading = true;
this.audioKeys = Object.keys(audioFils);
this.currentLoadingIndex = 0;
-
+
this.loadingPromise = new Promise((resolve) => {
this.loadNextAudio(resolve);
});
-
+
return this.loadingPromise;
}
@@ -116,8 +118,12 @@ class AudioManager {
}
const key = this.audioKeys[this.currentLoadingIndex];
- debugLog(`开始加载音频 ${this.currentLoadingIndex + 1}/${this.audioKeys.length}: ${key}`);
-
+ debugLog(
+ `开始加载音频 ${this.currentLoadingIndex + 1}/${
+ this.audioKeys.length
+ }: ${key}`
+ );
+
this.createAudio(key, () => {
this.currentLoadingIndex++;
setTimeout(() => {
@@ -182,12 +188,14 @@ class AudioManager {
if (currentRetries < this.maxRetries) {
this.retryCount.set(key, currentRetries + 1);
debugLog(`音频 ${key} 开始第 ${currentRetries + 1} 次重试...`);
-
+
setTimeout(() => {
this.retryLoadAudio(key);
}, 1000);
} else {
- console.error(`音频 ${key} 重试 ${this.maxRetries} 次后仍然失败,停止重试`);
+ console.error(
+ `音频 ${key} 重试 ${this.maxRetries} 次后仍然失败,停止重试`
+ );
const failedAudio = this.audioMap.get(key);
if (failedAudio) {
failedAudio.destroy();
diff --git a/src/components/BowPower.vue b/src/components/BowPower.vue
index 19d59fa..79cf959 100644
--- a/src/components/BowPower.vue
+++ b/src/components/BowPower.vue
@@ -6,6 +6,8 @@ const power = ref(0);
const timer = ref(null);
onMounted(async () => {
+ const data = await getDeviceBatteryAPI();
+ power.value = data.battery;
timer.value = setInterval(async () => {
const data = await getDeviceBatteryAPI();
power.value = data.battery;
diff --git a/src/constants.js b/src/constants.js
index 6177499..fbdb42c 100644
--- a/src/constants.js
+++ b/src/constants.js
@@ -24,6 +24,7 @@ export const MESSAGETYPES = {
LvlUpdate: 3958625354,
TeamUpdate: 4168086616,
InvalidShot: 4168086617,
+ Calibration: 4168086625,
};
export const topThreeColors = ["#FFD947", "#D2D2D2", "#FFA515"];
diff --git a/src/pages/calibration.vue b/src/pages/calibration.vue
index 5b286b8..9bc7b49 100644
--- a/src/pages/calibration.vue
+++ b/src/pages/calibration.vue
@@ -1,9 +1,11 @@
@@ -42,7 +61,12 @@ onMounted(async () => {
请完成以上步骤校准智能弓
-
+
我已校准
diff --git a/src/pages/my-device.vue b/src/pages/my-device.vue
index 2d48bea..39f212e 100644
--- a/src/pages/my-device.vue
+++ b/src/pages/my-device.vue
@@ -78,6 +78,7 @@ const toFristTryPage = () => {
const unbindDevice = async () => {
await unbindDeviceAPI(device.value.deviceId);
+ uni.setStorageSync("calibration", false);
uni.showToast({
title: "解绑成功",
icon: "success",
@@ -203,10 +204,6 @@ onShow(() => {
{{ user.nickName }}
-
- 恭喜,你的弓箭和账号已成功绑定!
- 已赠送6个月射灵世界会员
-
进入新手试炼 {
+
+ 恭喜,你的弓箭和账号已成功绑定!
+ 已赠送6个月射灵世界会员
+
校准智能弓
@@ -236,7 +237,7 @@ onShow(() => {
{{ device.deviceName }}
-
+