From 7509df62180e7e4b08bf41bf3a181b23910d7c6c Mon Sep 17 00:00:00 2001
From: yyb <995253665@qq.com>
Date: 星期三, 29 四月 2026 15:26:20 +0800
Subject: [PATCH] 优化扫码结果处理逻辑

---
 src/pages/index.vue |   10 +++++++---
 1 files changed, 7 insertions(+), 3 deletions(-)

diff --git a/src/pages/index.vue b/src/pages/index.vue
index b7d3fa9..7ff805e 100644
--- a/src/pages/index.vue
+++ b/src/pages/index.vue
@@ -249,9 +249,13 @@
         console.log("鎵爜缁撴灉:", res);
         // 瑙f瀽鎵爜缁撴灉骞惰烦杞埌鐢熶骇鎶ュ伐椤甸潰
         try {
-          const scanResult = JSON.parse(res.result);
+          const scanRaw = res.result;
+          const scanResult =
+            typeof scanRaw === "string" ? JSON.parse(scanRaw) : scanRaw;
+          console.log("scanResult", scanResult);
           uni.navigateTo({
-            url: `/pages/productionManagement/productionReport/index?orderRow=${encodeURIComponent(JSON.stringify(scanResult))}`
+            // 浼犻�掓暣涓� orderRow 瀵硅薄锛堟壂鐮佸璞★級缁欐姤宸ラ〉
+            url: `/pages/productionManagement/productionReport/index?orderRow=${encodeURIComponent(JSON.stringify(scanResult))}`,
           });
         } catch (e) {
           console.error("鎵爜缁撴灉瑙f瀽澶辫触:", e);
@@ -260,7 +264,7 @@
       },
       fail: (err) => {
         console.error("鎵爜澶辫触:", err);
-      }
+      } 
     });
     return;
   }

--
Gitblit v1.9.3