From 0e9db0e91ff5a65e58027524df0dd09836723326 Mon Sep 17 00:00:00 2001 From: User Date: Mon, 2 Mar 2026 17:00:13 +0800 Subject: [PATCH] =?UTF-8?q?=E6=AF=9B=E9=87=8D=E5=87=80=E9=87=8D=E5=81=9A?= =?UTF-8?q?=E8=A7=84=E8=8C=83?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pages/compare_price/index.js | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/pages/compare_price/index.js b/pages/compare_price/index.js index 20c889f..5ec4f48 100644 --- a/pages/compare_price/index.js +++ b/pages/compare_price/index.js @@ -525,18 +525,29 @@ Page({ if (!field) continue; if (typeof field === 'string') { + console.log('检查字符串字段:', field, '是否包含', weightNum); if (field.includes(weightNum)) { hasMatchingSpec = true; break; } } else if (Array.isArray(field)) { + console.log('检查数组字段:', field); if (field.some(spec => { - const specStr = typeof spec === 'string' ? spec : (spec.weightSpec || spec.display || ''); + const specStr = typeof spec === 'string' ? spec : (spec.weightSpec || spec.display || spec.spec || ''); + console.log('检查数组元素:', specStr, '是否包含', weightNum); return specStr.includes(weightNum); })) { hasMatchingSpec = true; break; } + } else if (typeof field === 'object') { + console.log('检查对象字段:', field); + const specStr = field.weightSpec || field.display || field.spec || ''; + console.log('检查对象字段值:', specStr, '是否包含', weightNum); + if (specStr.includes(weightNum)) { + hasMatchingSpec = true; + break; + } } } }