From 46cc7a29dc1f9b3dffee5cdcb9b7f9dfdac3b16d Mon Sep 17 00:00:00 2001
From: zrg <z1873@LAPTOP-EAVL132E>
Date: 星期五, 05 九月 2025 20:44:14 +0800
Subject: [PATCH] Merge branch 'Dev' of http://101.37.171.70:10101/r/~jhz/STUWMS into Dev

---
 utils/common.js |   14 +++++++++++++-
 1 files changed, 13 insertions(+), 1 deletions(-)

diff --git a/utils/common.js b/utils/common.js
index 24d5d0c..87f3b4e 100644
--- a/utils/common.js
+++ b/utils/common.js
@@ -277,7 +277,7 @@
 		        }
 		
 		    },
-		    complete() {
+		    complete: () => {
 		        setTimeout(() => {
 		            uni.hideLoading()
 		            if (errorTip != null) {
@@ -286,6 +286,11 @@
 		        }, 1000)
 		    }
 		})
+	}
+	
+	stringToBoolean(str) {
+	  // 蹇界暐澶у皬鍐欑殑杞崲
+	  return str?.toLowerCase() === "true";
 	}
 
     // uni-app 鎾斁闊抽灏佽
@@ -298,6 +303,13 @@
         }
         innerAudioContext.play(); // 鎾斁闊抽
     }
+    
+    replaceWithFunction(str, handler) {
+      return str.replace(/\{(.+?)\}/g, (match, key) => {
+        // 璋冪敤澶勭悊鍑芥暟锛屼紶鍏ュ尮閰嶅埌鐨勯敭
+        return handler(key, match);
+      });
+    }
 }
 
 export const CommonUtils = new commonUtils()
\ No newline at end of file

--
Gitblit v1.9.1