diff --git a/src/App.vue b/src/App.vue
index 1b364ec..4e6d0d8 100644
--- a/src/App.vue
+++ b/src/App.vue
@@ -28,6 +28,7 @@
const {
updateUser,
updateOnline,
+ showDeviceChargingDialog,
clearSessionState,
clearDevice
} = store;
@@ -82,6 +83,10 @@
uni.setStorageSync("calibration", false);
}
+ function onDeviceCharging() {
+ showDeviceChargingDialog();
+ }
+
function onDeviceShoot() {
// audioManager.play("射箭声音")
}
@@ -119,6 +124,7 @@
uni.$on("update-online", emitUpdateOnline);
uni.$on("session-kicked-out", onSessionKickedOut);
uni.$on("device-bind-invalid", onDeviceBindInvalid);
+ uni.$on("device-charging", onDeviceCharging);
if (typeof uni.offNetworkStatusChange === "function") {
uni.offNetworkStatusChange(onNetworkStatusChange);
}
@@ -144,6 +150,7 @@
uni.$off("update-online", emitUpdateOnline);
uni.$off("session-kicked-out", onSessionKickedOut);
uni.$off("device-bind-invalid", onDeviceBindInvalid);
+ uni.$off("device-charging", onDeviceCharging);
if (typeof uni.offNetworkStatusChange === "function") {
uni.offNetworkStatusChange(onNetworkStatusChange);
}
diff --git a/src/components/Container.vue b/src/components/Container.vue
index 3b6e60f..9df69a2 100644
--- a/src/components/Container.vue
+++ b/src/components/Container.vue
@@ -5,6 +5,7 @@ import AppBackground from "@/components/AppBackground.vue";
import Header from "@/components/Header.vue";
import ScreenHint from "@/components/ScreenHint.vue";
import BackToGame from "@/components/BackToGame.vue";
+import DeviceChargingDialog from "@/components/DeviceChargingDialog.vue";
import {laserAimAPI, getBattleAPI, matchGameAPI} from "@/apis";
import { capsuleHeight, debounce } from "@/util";
import { returnToBattle } from "@/utils/matchReturn";
@@ -226,6 +227,7 @@ const goCalibration = async () => {
{{ loadingText || "加载中..." }}
+
diff --git a/src/components/DeviceChargingDialog.vue b/src/components/DeviceChargingDialog.vue
new file mode 100644
index 0000000..b633deb
--- /dev/null
+++ b/src/components/DeviceChargingDialog.vue
@@ -0,0 +1,22 @@
+
+
+
+
+
diff --git a/src/constants.js b/src/constants.js
index 7822bcd..492f68d 100644
--- a/src/constants.js
+++ b/src/constants.js
@@ -29,6 +29,7 @@ export const MESSAGETYPES = {
DeviceOnline: 4168086626,
DeviceOffline: 4168086627,
SomeoneIsReady: 4168086628,
+ DeviceCharging: 4168086631, // 设备充电中
};
export const MESSAGETYPESV2 = {
diff --git a/src/pages/battle-result.vue b/src/pages/battle-result.vue
index 275b298..884b1fc 100644
--- a/src/pages/battle-result.vue
+++ b/src/pages/battle-result.vue
@@ -3,6 +3,7 @@ import { ref, computed, onMounted } from "vue";
import { onLoad } from "@dcloudio/uni-app";
import Avatar from "@/components/Avatar.vue";
import UserUpgrade from "@/components/UserUpgrade.vue";
+import DeviceChargingDialog from "@/components/DeviceChargingDialog.vue";
import { getBattleAPI } from "@/apis";
import { topThreeColors, getBattleResultTips } from "@/constants";
import audioManager from "@/audioManager";
@@ -287,6 +288,7 @@ const checkBowData = () => {
返回
+
diff --git a/src/pages/device-intro.vue b/src/pages/device-intro.vue
index 2af5013..f780e14 100644
--- a/src/pages/device-intro.vue
+++ b/src/pages/device-intro.vue
@@ -1,6 +1,7 @@