100J优化语音逻辑

This commit is contained in:
微微一笑
2026-04-01 09:23:47 +08:00
parent c64b140754
commit a2c8a98bc5
2 changed files with 20 additions and 100 deletions

View File

@ -137,9 +137,6 @@
updateLoading
} from '@/utils/loading.js';
import Common from '@/utils/Common.js';
import {
cache100JVoiceFileForBle
} from '@/api/100J/HBY100-J.js';
export default {
data() {
@ -523,22 +520,6 @@
}
const resData = JSON.parse(res.data);
if (resData.code === 200) {
// 缓存本地路径Apply 时优先用本地文件走蓝牙,避免下载失败
const deviceId = these.Status.ID;
if (deviceId) {
const cacheKey = `100J_local_path_cache_${deviceId}`;
const d = resData.data;
const fileUrl = (d && typeof d === 'object' && d.fileUrl) || (typeof d === 'string' ? d : '');
if (filePath) {
let cache = uni.getStorageSync(cacheKey) || {};
if (fileUrl) cache[fileUrl] = filePath;
if (d && typeof d === 'object' && d.id) cache[d.id] = filePath;
uni.setStorageSync(cacheKey, cache);
if (d && typeof d === 'object' && d.id) {
cache100JVoiceFileForBle(deviceId, d.id, filePath);
}
}
}
// 合并两个存储操作
Promise.all([
new Promise((resolve, reject) => {