7 Commits
Author SHA1 Message Date
zhangyi 14f9ccd1ef Merge branch 'feat-shebei' 2026-10-29 16:49:46 +08:00
zhangyi cc8f997600 Merge branch 'feat-shebei' 2026-10-29 16:12:55 +08:00
zhangyi a81494973c Merge branch 'feat-shebei' 2026-10-29 15:08:27 +08:00
zhangyi f3fab17687 update:过滤图片 2026-10-29 14:54:00 +08:00
zhangyi d22d958215 Merge branch 'feat-mendian' 2026-10-29 10:05:02 +08:00
zhangyi b4ed13d2b5 Merge branch 'feat-training' 2026-10-29 09:57:48 +08:00
zhangyi b8b0ab4005 Merge branch 'feat-shebei' 2026-10-29 09:57:07 +08:00
4 changed files with 56 additions and 40 deletions
+8 -4
View File
@@ -4,10 +4,6 @@
"libVersion": "3.7.7",
"packOptions": {
"ignore": [
{
"type": "folder",
"value": "static/coin"
},
{
"type": "file",
"value": "static/common/dialog-light.png"
@@ -247,6 +243,14 @@
{
"type": "folder",
"value": "static/training-difficulty-design"
},
{
"type": "folder",
"value": "static/coin"
},
{
"type": "folder",
"value": "static/home-device"
}
],
"include": []
+8 -4
View File
@@ -55,10 +55,6 @@
"appid" : "wxa8f5989dcd45cc23",
"packOptions" : {
"ignore" : [
{
"type" : "folder",
"value" : "static/coin"
},
{
"type" : "file",
"value" : "static/common/dialog-light.png"
@@ -298,6 +294,14 @@
{
"type" : "folder",
"value" : "static/training-difficulty-design"
},
{
"type" : "folder",
"value" : "static/coin"
},
{
"type" : "folder",
"value" : "static/home-device"
}
]
},
+15
View File
@@ -21,6 +21,9 @@
{
"path": "pages/audio-test"
},
{
"path": "pages/calibration"
},
{
"path": "pages/about-us"
},
@@ -57,6 +60,12 @@
{
"path": "pages/match-page"
},
{
"path": "pages/my-device"
},
{
"path": "pages/device-intro"
},
{
"path": "pages/user"
},
@@ -98,6 +107,12 @@
},
{
"path": "pages/mine-bow-data"
},
{
"path": "pages/ota-wifi",
"style": {
"navigationStyle": "custom"
}
}
],
"globalStyle": {
+25 -32
View File
@@ -93,49 +93,42 @@ 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 || typeof data !== "object") return;
if (data.type) {
if (data?.type) {
if (ENABLE_REALTIME_MESSAGE_LOG) {
console.log("收到 WebSocket 消息", getMessageTypeName(data.type));
}
if (onMessage) onMessage({ ...(data.data || {}), type: data.type });
return;
}
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");
}
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");
}
}
});
socketTask.onError((err) => {