Selaa lähdekoodia

feat:修改地址剪切板问题

颜琼丽 21 tuntia sitten
vanhempi
commit
a5587c85f7
1 muutettua tiedostoa jossa 8 lisäystä ja 9 poistoa
  1. 8 9
      jd_logistics-app/pages/address/edit.vue

+ 8 - 9
jd_logistics-app/pages/address/edit.vue

@@ -126,15 +126,14 @@
 	// 粘贴并识别功能
 	const handleSearch = async (type) => {
 		try {
-			// 1. 读取剪贴板内容
-			const clipboardText = await new Promise((resolve, reject) => {
-				uni.getClipboardData({
-					success: res => resolve(res.data),
-					fail: err => reject(err)
-				});
-			});
-
 			if (type == 1) {
+				// 1. 读取剪贴板内容
+				const clipboardText = await new Promise((resolve, reject) => {
+					uni.getClipboardData({
+						success: res => resolve(res.data),
+						fail: err => reject(err)
+					});
+				});
 				if (!clipboardText) {
 					uni.showToast({
 						title: '剪贴板内容为空',
@@ -203,7 +202,7 @@
 
 				uni.showToast({
 					title: '识别成功,请核对地址信息',
-					icon: 'success'
+					icon: 'none'
 				});
 			} else {
 				uni.showToast({