update:个人训练优化

This commit is contained in:
2026-08-14 17:13:23 +08:00
parent d662db9465
commit e7f073ed7c
25 changed files with 481 additions and 344 deletions
+12
View File
@@ -329,6 +329,18 @@ export const getDirectionText = (angle = 0) => {
}
};
// 正式射箭阶段的距离单位为厘米,按距离异常类型选择对应语音。
export const getInvalidShotAudioKey = (shootData) => {
if (!shootData || typeof shootData !== "object") return "射击无效";
// protobuf 会省略值为 0 的标量字段;消息体存在且距离缺失时按 0 处理。
const rawDistance = Number(shootData.distance ?? shootData.dst ?? 0);
if (!Number.isFinite(rawDistance)) return "射击无效";
if (rawDistance < 0) return "射箭无效,靶纸错误";
if (rawDistance === 0) return "射箭无效,未识别到靶纸";
if (rawDistance / 100 < 5) return "射箭无效,距离不足";
return "射击无效";
};
export const wxLogin = () => {
return new Promise((resolve, reject) => {
uni.login({