18 Commits
Author SHA1 Message Date
zhangyi 9699f1356f Merge branch 'feat-shebei' into test 2026-10-29 16:49:26 +08:00
zhangyi aa33a931b1 Merge branch 'feat-shebei' into test 2026-10-29 16:12:32 +08:00
zhangyi f044a95872 Merge branch 'feat-shebei' into test 2026-10-29 15:08:06 +08:00
zhangyi 318b952a9b Merge branch 'feat-training' into test 2026-10-23 14:50:28 +08:00
zhangyi 14437bb5a7 Merge branch 'feat-training' into test 2026-10-23 11:55:19 +08:00
zhangyi f16b486a89 update:优化打包 2026-10-21 16:02:34 +08:00
zhangyi 6c69e14630 Merge branch 'feat-mendian' into test 2026-10-21 15:50:01 +08:00
zhangyi 34118d59d3 Merge branch 'feat-mendian' into test 2026-10-21 15:38:46 +08:00
zhangyi b82474913a Merge branch 'feat-training' into test 2026-10-13 11:33:10 +08:00
zhangyi 9d9f005ca3 Merge branch 'feat-training' into test 2026-10-12 14:57:28 +08:00
zhangyi 605a0b2d91 Merge branch 'feat-shebei' into test 2026-10-08 14:35:34 +08:00
zhangyi c9bfa6792b Merge branch 'feat-shebei' into test 2026-09-24 17:10:53 +08:00
zhangyi b0ddf147aa Merge branch 'feat-shebei' into test 2026-09-24 15:16:37 +08:00
zhangyi 3caa53d4be Merge branch 'feat-training' into test 2026-09-24 10:23:55 +08:00
zhangyi f4f63954eb Merge branch 'feat-shebei' into test 2026-09-23 18:35:04 +08:00
zhangyi b89744802a Merge branch 'feat-shebei' into test 2026-09-23 15:37:10 +08:00
zhangyi fd6be25ba5 update:恢复ws电量通知代码 2026-09-23 14:22:57 +08:00
zhangyi bad3c8ff9a Merge branch 'feat-training' into test 2026-09-23 10:50:06 +08:00
4 changed files with 40 additions and 56 deletions
+4 -8
View File
@@ -4,6 +4,10 @@
"libVersion": "3.7.7",
"packOptions": {
"ignore": [
{
"type": "folder",
"value": "static/coin"
},
{
"type": "file",
"value": "static/common/dialog-light.png"
@@ -243,14 +247,6 @@
{
"type": "folder",
"value": "static/training-difficulty-design"
},
{
"type": "folder",
"value": "static/coin"
},
{
"type": "folder",
"value": "static/home-device"
}
],
"include": []
+4 -8
View File
@@ -55,6 +55,10 @@
"appid" : "wxa8f5989dcd45cc23",
"packOptions" : {
"ignore" : [
{
"type" : "folder",
"value" : "static/coin"
},
{
"type" : "file",
"value" : "static/common/dialog-light.png"
@@ -294,14 +298,6 @@
{
"type" : "folder",
"value" : "static/training-difficulty-design"
},
{
"type" : "folder",
"value" : "static/coin"
},
{
"type" : "folder",
"value" : "static/home-device"
}
]
},
-15
View File
@@ -21,9 +21,6 @@
{
"path": "pages/audio-test"
},
{
"path": "pages/calibration"
},
{
"path": "pages/about-us"
},
@@ -60,12 +57,6 @@
{
"path": "pages/match-page"
},
{
"path": "pages/my-device"
},
{
"path": "pages/device-intro"
},
{
"path": "pages/user"
},
@@ -107,12 +98,6 @@
},
{
"path": "pages/mine-bow-data"
},
{
"path": "pages/ota-wifi",
"style": {
"navigationStyle": "custom"
}
}
],
"globalStyle": {
+32 -25
View File
@@ -93,42 +93,49 @@ function createWebSocket(token, onMessage) {
"/addons/shoot/otaResult",
];
if (passthroughEvents.includes(event)) {
if ((code == null || Number(code) === 0) && onMessage && data && typeof data === "object") {
if (
(code == null || Number(code) === 0) &&
onMessage &&
data &&
typeof data === "object"
) {
onMessage({ event, data, code, timestamp });
}
return;
}
if (data?.type) {
if (!data || typeof data !== "object") return;
if (data.type) {
if (ENABLE_REALTIME_MESSAGE_LOG) {
console.log("收到 WebSocket 消息", getMessageTypeName(data.type));
}
if (onMessage) onMessage({ ...(data.data || {}), type: data.type });
return;
}
const updates = Array.isArray(data?.updates) ? data.updates : [];
if (!updates.length) return;
if (onMessage) onMessage(updates);
const msg = updates[0];
if (msg) {
if (ENABLE_REALTIME_MESSAGE_LOG) {
console.log(
"收到 WebSocket 更新",
getMessageTypeName(msg.constructor),
{ updateCount: data.updates.length }
);
}
if (msg.constructor === MESSAGETYPES.RankUpdate) {
uni.setStorageSync("latestRank", msg.lvl);
} else if (msg.constructor === MESSAGETYPES.LvlUpdate) {
uni.setStorageSync("latestLvl", msg.lvl);
} else if (msg.constructor === MESSAGETYPES.DeviceOnline) {
uni.$emit("update-online", true);
} else if (msg.constructor === MESSAGETYPES.DeviceOffline) {
uni.$emit("update-online", false);
} else if (msg.constructor === MESSAGETYPES.DeviceCharging) {
uni.$emit("device-charging");
}
if (!Array.isArray(data.updates)) return;
if (onMessage) onMessage(data.updates);
const firstMessage = data.updates[0];
if (firstMessage && ENABLE_REALTIME_MESSAGE_LOG) {
console.log(
"收到 WebSocket 更新",
getMessageTypeName(firstMessage.constructor),
{ updateCount: data.updates.length }
);
}
data.updates.forEach((msg) => {
if (msg) {
if (msg.constructor === MESSAGETYPES.RankUpdate) {
uni.setStorageSync("latestRank", msg.lvl);
} else if (msg.constructor === MESSAGETYPES.LvlUpdate) {
uni.setStorageSync("latestLvl", msg.lvl);
} else if (msg.constructor === MESSAGETYPES.DeviceOnline) {
uni.$emit("update-online", true);
} else if (msg.constructor === MESSAGETYPES.DeviceOffline) {
uni.$emit("update-online", false);
} else if (msg.constructor === MESSAGETYPES.DeviceCharging) {
uni.$emit("device-charging");
}
}
});
});
socketTask.onError((err) => {