From 1e6d7c100df5ed8c5507188158a741ee584cce5c Mon Sep 17 00:00:00 2001
From: Lou <luzhiping@qqyjz.com>
Date: Mon, 15 Jan 2024 17:47:58 +0800
Subject: [PATCH] 标签修改,走访任务修改,场所任务修改

---
 common/common.js |   23 +++++++++++++++++++++++
 1 files changed, 23 insertions(+), 0 deletions(-)

diff --git a/common/common.js b/common/common.js
index 500c1c3..8bcdec0 100644
--- a/common/common.js
+++ b/common/common.js
@@ -28,9 +28,32 @@
 		return []
 	}
 }
+
+
 export const showTips = (text, icon) => {
 	uni.showToast({
 		title: text,
 		icon: icon ? icon : 'none'
 	})
+}
+
+
+// 获取数据下标信息  (picker选择器数据回显)
+export const getIndex = (arr, value, key, nameKey) => {
+	if (key) {
+		for (let i = 0, ii = arr.length; i < ii; i++) {
+			if (arr[i] == value) {
+				return i;
+			}
+		}
+	} else {
+		for (let i = 0, ii = arr.length; i < ii; i++) {
+			if (arr[i][key] == value) {
+				return {
+					index: i,
+					name: arr[i][nameKey]
+				}
+			}
+		}
+	}
 }
\ No newline at end of file

--
Gitblit v1.9.3