From 46d143d1d6fe8f286399f4d027c9a86adf7cd7fc Mon Sep 17 00:00:00 2001
From: baoshiwei <baoshiwei@shlanbao.cn>
Date: 星期三, 09 七月 2025 08:50:01 +0800
Subject: [PATCH] feat(inspection,maintenance): - 实现保养工单批量确认功能 - 在点检记录确认时增加时间限制,距离上次更新时间两小时内不允许确认

---
 eims-ui-mobile/src/components/fg-tabbar/fg-tabbar.vue |   68 +++++++++++++++++++++++----------
 1 files changed, 47 insertions(+), 21 deletions(-)

diff --git a/eims-ui-mobile/src/components/fg-tabbar/fg-tabbar.vue b/eims-ui-mobile/src/components/fg-tabbar/fg-tabbar.vue
index c3370a9..59233d0 100644
--- a/eims-ui-mobile/src/components/fg-tabbar/fg-tabbar.vue
+++ b/eims-ui-mobile/src/components/fg-tabbar/fg-tabbar.vue
@@ -53,6 +53,7 @@
 // i-carbon-code
 import { tabBar } from '@/pages.json'
 import { tabbarStore } from './tabbar'
+import qrcode from "@/utils/qrcode";
 
 /** tabbarList 閲岄潰鐨� path 浠� pages.config.ts 寰楀埌 */
 const tabbarList = tabBar.list.map((item) => ({ ...item, path: `/${item.pagePath}` }))
@@ -69,29 +70,54 @@
     // })
     // return false
     // 妯℃嫙鎴愬姛
+    const systemInfo = uni.getSystemInfoSync()
+    if (systemInfo.uniPlatform === 'app') {
+      // 鍙厑璁搁�氳繃鐩告満鎵爜
+      uni.scanCode({
+        onlyFromCamera: true,
+        success: function(res) {
+          console.log('鏉$爜绫诲瀷锛�' + res.scanType)
+          console.log('鏉$爜鍐呭锛�' + res.result)
+          if (res?.scanType !== 'QR_CODE') {
+            uni.showToast({
+              title: '璇蜂娇鐢ㄤ簩缁寸爜杩涜鎵爜',
+              icon: 'none',
+            })
+            return false
+          }
 
-    // 鍙厑璁搁�氳繃鐩告満鎵爜
-    uni.scanCode({
-      onlyFromCamera: true,
-      success: function (res) {
-        console.log('鏉$爜绫诲瀷锛�' + res.scanType)
-        console.log('鏉$爜鍐呭锛�' + res.result)
-        if (res?.scanType !== 'QR_CODE') {
-          uni.showToast({
-            title: '璇蜂娇鐢ㄤ簩缁寸爜杩涜鎵爜',
-            icon: 'none',
+          // 浣跨敤split鏂规硶鎴彇璧勪骇缂栧彿
+          // const assetCode = res.result.split('璧勪骇缂栧彿锛�')[1].split(' ')[0]
+          uni.navigateTo({
+            url: `/pages/scan/index?result=${res.result}`,
           })
-          return false
-        }
-
-        // 浣跨敤split鏂规硶鎴彇璧勪骇缂栧彿
-        // const assetCode = res.result.split('璧勪骇缂栧彿锛�')[1].split(' ')[0]
-        uni.navigateTo({
-          url: `/pages/scan/index?result=${res.result}`,
-        })
-      },
-      fail: function (res) {},
-    })
+        },
+        fail: function (res) {},
+      })
+    } else {
+      uni.chooseImage({
+        count: 1,
+        sizeType: ['original', 'compressed'],
+        sourceType: ['camera'],
+        success: function(response) {
+          qrcode.decode(response.tempFilePaths[0])
+          qrcode.callback = (res) => {
+            console.log('res', res)
+            if (res === 'error decoding QR Code') {
+              uni.showToast({
+                title: '浜岀淮鐮佽В鏋愬け璐�',
+                duration: 2000,
+                icon: 'none',
+              })
+            } else {
+              uni.navigateTo({
+                url: `/pages/scan/index?result=${res}`,
+              })
+            }
+          }
+        },
+      })
+    }
   } else {
     tabbarStore.setCurIdx(index)
     tabbarStore.setLastIdx(index)

--
Gitblit v1.9.3