Compare commits
8
Commits
9699f1356f
..
main
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
419cefd00e | ||
|
|
14f9ccd1ef | ||
|
|
cc8f997600 | ||
|
|
a81494973c | ||
|
|
f3fab17687 | ||
|
|
d22d958215 | ||
|
|
b4ed13d2b5 | ||
|
|
b8b0ab4005 |
+8
-4
@@ -4,10 +4,6 @@
|
|||||||
"libVersion": "3.7.7",
|
"libVersion": "3.7.7",
|
||||||
"packOptions": {
|
"packOptions": {
|
||||||
"ignore": [
|
"ignore": [
|
||||||
{
|
|
||||||
"type": "folder",
|
|
||||||
"value": "static/coin"
|
|
||||||
},
|
|
||||||
{
|
{
|
||||||
"type": "file",
|
"type": "file",
|
||||||
"value": "static/common/dialog-light.png"
|
"value": "static/common/dialog-light.png"
|
||||||
@@ -247,6 +243,14 @@
|
|||||||
{
|
{
|
||||||
"type": "folder",
|
"type": "folder",
|
||||||
"value": "static/training-difficulty-design"
|
"value": "static/training-difficulty-design"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"type": "folder",
|
||||||
|
"value": "static/coin"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"type": "folder",
|
||||||
|
"value": "static/home-device"
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"include": []
|
"include": []
|
||||||
|
|||||||
@@ -164,6 +164,8 @@ const defaultHighlightStyle = {
|
|||||||
color: "rgba(255, 228, 0, 0.6)",
|
color: "rgba(255, 228, 0, 0.6)",
|
||||||
strokeColor: "rgba(254, 216, 71, 0.82)",
|
strokeColor: "rgba(254, 216, 71, 0.82)",
|
||||||
lineWidthRatio: 0.003,
|
lineWidthRatio: 0.003,
|
||||||
|
// 在最小线宽计算后应用倍数,确保不同靶面尺寸下按比例加粗。
|
||||||
|
lineWidthScale: 1,
|
||||||
};
|
};
|
||||||
|
|
||||||
// 合并默认靶纸样式和外部传入样式,ringColors 单独深合并。
|
// 合并默认靶纸样式和外部传入样式,ringColors 单独深合并。
|
||||||
@@ -319,7 +321,7 @@ const drawSectorHighlight = (
|
|||||||
(angles.endAngle - angles.startAngle) * safeRevealProgress,
|
(angles.endAngle - angles.startAngle) * safeRevealProgress,
|
||||||
style.color,
|
style.color,
|
||||||
style.strokeColor,
|
style.strokeColor,
|
||||||
Math.max(1, targetRadius * style.lineWidthRatio)
|
Math.max(1, targetRadius * style.lineWidthRatio) * style.lineWidthScale
|
||||||
);
|
);
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|||||||
+8
-4
@@ -55,10 +55,6 @@
|
|||||||
"appid" : "wxa8f5989dcd45cc23",
|
"appid" : "wxa8f5989dcd45cc23",
|
||||||
"packOptions" : {
|
"packOptions" : {
|
||||||
"ignore" : [
|
"ignore" : [
|
||||||
{
|
|
||||||
"type" : "folder",
|
|
||||||
"value" : "static/coin"
|
|
||||||
},
|
|
||||||
{
|
{
|
||||||
"type" : "file",
|
"type" : "file",
|
||||||
"value" : "static/common/dialog-light.png"
|
"value" : "static/common/dialog-light.png"
|
||||||
@@ -298,6 +294,14 @@
|
|||||||
{
|
{
|
||||||
"type" : "folder",
|
"type" : "folder",
|
||||||
"value" : "static/training-difficulty-design"
|
"value" : "static/training-difficulty-design"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"type" : "folder",
|
||||||
|
"value" : "static/coin"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"type" : "folder",
|
||||||
|
"value" : "static/home-device"
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -21,6 +21,9 @@
|
|||||||
{
|
{
|
||||||
"path": "pages/audio-test"
|
"path": "pages/audio-test"
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
"path": "pages/calibration"
|
||||||
|
},
|
||||||
{
|
{
|
||||||
"path": "pages/about-us"
|
"path": "pages/about-us"
|
||||||
},
|
},
|
||||||
@@ -57,6 +60,12 @@
|
|||||||
{
|
{
|
||||||
"path": "pages/match-page"
|
"path": "pages/match-page"
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
"path": "pages/my-device"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"path": "pages/device-intro"
|
||||||
|
},
|
||||||
{
|
{
|
||||||
"path": "pages/user"
|
"path": "pages/user"
|
||||||
},
|
},
|
||||||
@@ -98,6 +107,12 @@
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
"path": "pages/mine-bow-data"
|
"path": "pages/mine-bow-data"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"path": "pages/ota-wifi",
|
||||||
|
"style": {
|
||||||
|
"navigationStyle": "custom"
|
||||||
|
}
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"globalStyle": {
|
"globalStyle": {
|
||||||
|
|||||||
@@ -546,6 +546,7 @@ onBeforeUnmount(() => {
|
|||||||
:showCrosshair="false"
|
:showCrosshair="false"
|
||||||
:showRingLabels="false"
|
:showRingLabels="false"
|
||||||
:highlightOnly="true"
|
:highlightOnly="true"
|
||||||
|
:highlightStyle="{ strokeColor: '#00fffc', lineWidthScale: 3 }"
|
||||||
:sectorCount="sectorCount"
|
:sectorCount="sectorCount"
|
||||||
:activeSector="activeSector"
|
:activeSector="activeSector"
|
||||||
:activeRings="activeRings"
|
:activeRings="activeRings"
|
||||||
|
|||||||
+25
-32
@@ -93,49 +93,42 @@ function createWebSocket(token, onMessage) {
|
|||||||
"/addons/shoot/otaResult",
|
"/addons/shoot/otaResult",
|
||||||
];
|
];
|
||||||
if (passthroughEvents.includes(event)) {
|
if (passthroughEvents.includes(event)) {
|
||||||
if (
|
if ((code == null || Number(code) === 0) && onMessage && data && typeof data === "object") {
|
||||||
(code == null || Number(code) === 0) &&
|
|
||||||
onMessage &&
|
|
||||||
data &&
|
|
||||||
typeof data === "object"
|
|
||||||
) {
|
|
||||||
onMessage({ event, data, code, timestamp });
|
onMessage({ event, data, code, timestamp });
|
||||||
}
|
}
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (!data || typeof data !== "object") return;
|
if (data?.type) {
|
||||||
if (data.type) {
|
|
||||||
if (ENABLE_REALTIME_MESSAGE_LOG) {
|
if (ENABLE_REALTIME_MESSAGE_LOG) {
|
||||||
console.log("收到 WebSocket 消息", getMessageTypeName(data.type));
|
console.log("收到 WebSocket 消息", getMessageTypeName(data.type));
|
||||||
}
|
}
|
||||||
if (onMessage) onMessage({ ...(data.data || {}), type: data.type });
|
if (onMessage) onMessage({ ...(data.data || {}), type: data.type });
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (!Array.isArray(data.updates)) return;
|
const updates = Array.isArray(data?.updates) ? data.updates : [];
|
||||||
if (onMessage) onMessage(data.updates);
|
if (!updates.length) return;
|
||||||
const firstMessage = data.updates[0];
|
if (onMessage) onMessage(updates);
|
||||||
if (firstMessage && ENABLE_REALTIME_MESSAGE_LOG) {
|
const msg = updates[0];
|
||||||
console.log(
|
if (msg) {
|
||||||
"收到 WebSocket 更新",
|
if (ENABLE_REALTIME_MESSAGE_LOG) {
|
||||||
getMessageTypeName(firstMessage.constructor),
|
console.log(
|
||||||
{ updateCount: data.updates.length }
|
"收到 WebSocket 更新",
|
||||||
);
|
getMessageTypeName(msg.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");
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
});
|
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) => {
|
socketTask.onError((err) => {
|
||||||
|
|||||||
Reference in New Issue
Block a user