diff --git a/pages/6155/deviceDetail.vue b/pages/6155/deviceDetail.vue index e1103dc..cc87725 100644 --- a/pages/6155/deviceDetail.vue +++ b/pages/6155/deviceDetail.vue @@ -585,7 +585,7 @@ console.log(`字段 ${key} 不在 formData 中,跳过更新`); } }); - + // 强制触发视图更新,确保电量显示同步 these.$forceUpdate(); console.log("更新后的电量:", these.formData.battary); @@ -1091,7 +1091,7 @@ dataView.setUint8(packetSize - 1, 0xFF); } let inteval = parseInt(this.inteval ? this.inteval : 80); - + console.log(inteval, 'intevalinteval'); ble.sendData(f.deviceId, buffer, f.writeServiceId, f .wirteCharactId).then(() => { if (ReSendNo) { @@ -1149,27 +1149,28 @@ let width = Math.round(res.width); let height = Math.round(res.height); let duration = res.duration; - + // 获取平台信息 const systemInfo = uni.getSystemInfoSync(); const platform = systemInfo.platform; const isIOS = platform === 'ios'; - - console.log("平台:", platform, "uni.chooseVideo返回 - 宽度:", width, "高度:", height, "时长:", duration); - + + console.log("平台:", platform, "uni.chooseVideo返回 - 宽度:", width, "高度:", height, + "时长:", duration); + // iOS特殊处理:如果返回的是80*40,很可能是160*80的一半(iOS的bug) if (isIOS && width === 80 && height === 40) { console.log("检测到iOS特殊情况:返回80*40,实际应该是160*80,进行修正"); width = 160; height = 80; } - + // 检查分辨率是否符合要求 let checkResolution = (w, h) => { // 使用容差比较,允许1像素的误差 return Math.abs(w - 160) <= 1 && Math.abs(h - 80) <= 1; }; - + let err = []; if (duration < 2) { err.push("视频时长至少2秒"); @@ -1178,7 +1179,7 @@ if (!checkResolution(width, height)) { err.push("视频宽高必须是160*80,当前分辨率:" + width + "*" + height); } - + if (err.length > 0) { err = err.join(";"); these.showPop({ @@ -1189,7 +1190,7 @@ }); return; } - + showLoading(these, { text: '正在上传' }); @@ -1579,8 +1580,9 @@ dataView.setUint8(bufferSize - 1, 0xFF); - let inteval = parseInt(this.inteval ? this.inteval : 50); - console.log("inteval=", inteval) + let inteval = 100; + //parseInt(this.inteval ? this.inteval : 80); + //console.log("inteval=", inteval) ble.sendData(f.deviceId, buffer, f.writeServiceId, f .wirteCharactId, 30).then(() => {