From 1bd1061c60c286e3b2216a67090c4976c9c7b35f Mon Sep 17 00:00:00 2001
From: yyb <995253665@qq.com>
Date: 星期六, 18 四月 2026 17:50:29 +0800
Subject: [PATCH] 出入库扫码

---
 src/plugins/modal.ts |   17 +++++++++++++++--
 1 files changed, 15 insertions(+), 2 deletions(-)

diff --git a/src/plugins/modal.ts b/src/plugins/modal.ts
index 4a97dd3..46d622c 100644
--- a/src/plugins/modal.ts
+++ b/src/plugins/modal.ts
@@ -14,9 +14,22 @@
    * @param content 娑堟伅鍐呭
    */
   msgError(content: string): void {
+    const text = (content ?? '').toString()
+    // showToast 鍦ㄥ绔粡甯镐細瀵� title 鍋氬崟琛�/闀垮害鎴柇锛涢暱鏂囨鐢� showModal 淇濊瘉瀹屾暣灞曠ず
+    const shouldUseModal = text.length > 16 || text.includes('\n')
+    if (shouldUseModal) {
+      uni.showModal({
+        title: '閿欒',
+        content: text,
+        showCancel: false,
+        confirmText: '鐭ラ亾浜�',
+      })
+      return
+    }
     uni.showToast({
-      title: content,
-      icon: 'error'
+      title: text,
+      icon: 'none',
+      duration: 2500,
     })
   },
   /**

--
Gitblit v1.9.3