From ad85c922e19571615846a845ecdba5433eb247c5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=BE=AE=E5=BE=AE=E4=B8=80=E7=AC=91?= <709648985@qq.com> Date: Fri, 21 Nov 2025 13:25:38 +0800 Subject: [PATCH] =?UTF-8?q?6155=E8=A7=A3=E5=86=B3=20iOS=20=E4=B8=8A?= =?UTF-8?q?=E7=9A=84=E5=88=86=E8=BE=A8=E7=8E=87=E6=A3=80=E6=9F=A5=E9=97=AE?= =?UTF-8?q?=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pages/6155/deviceDetail.vue | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/pages/6155/deviceDetail.vue b/pages/6155/deviceDetail.vue index 41c041f..6dae39d 100644 --- a/pages/6155/deviceDetail.vue +++ b/pages/6155/deviceDetail.vue @@ -1136,16 +1136,19 @@ success: function(res) { console.log("res=",res); let path = res.tempFilePath; - let width = res.width; - let height = res.height; + // iOS可能返回浮点数,需要转换为整数进行比较 + let width = Math.round(res.width); + let height = Math.round(res.height); let duration = res.duration; + console.log("视频信息 - 宽度:", width, "高度:", height, "时长:", duration); let err = []; if (duration < 2) { err.push("视频时长至少2秒"); } - if (width != 160 || height != 80) { - err.push("视频宽高必须是160*80"); + // 使用容差比较,允许1像素的误差(iOS可能有精度问题) + if (Math.abs(width - 160) > 1 || Math.abs(height - 80) > 1) { + err.push("视频宽高必须是160*80,当前分辨率:" + width + "*" + height); } if (err.length > 0) { err = err.join(";");