lxf 3 тижнів тому
батько
коміт
38fd675dc2

+ 11 - 5
pages/login/index.vue

@@ -44,7 +44,7 @@
 		params = "{}"
 	}) => {
 		pageUrl.value = route_path
-		pageParams.value = params
+		pageParams.value = JSON.parse(params)
 		getUserData()
 	})
 
@@ -92,9 +92,15 @@
 					duration: 2000,
 					mask: true
 				})
-				uni.reLaunch({
-					url: `/pages/tabBar/home/subPages/gardenMap?enterSelectTree=true`
-				});
+				if (pageParams.value?.isFromScan) {
+					uni.reLaunch({
+						url: `/pages/tabBar/home/subPages/gardenMap?isScanAuthSuccess=true`
+					});
+				} else {
+					uni.reLaunch({
+						url: `/pages/tabBar/home/subPages/gardenMap?enterSelectTree=true`
+					});
+				}
 			} else {
 				uni.showToast({
 					title: '保存失败',
@@ -111,7 +117,7 @@
 	@import "@/static/style/mixin.scss";
 	
 	.login-container {
-		.base-container {
+		.base-container {
 			@include ossBg("login-bj.png");
 			height: 100vh;
 			

+ 4 - 2
pages/tabBar/home/subPages/allGardenMap.vue

@@ -10,12 +10,14 @@
 	} from 'vue';
 	const userInfo = uni.getStorageSync('userInfo')
 
-	// 创建响应式的webview URL
+	// webview的地址
 	const webViewUrl = ref('')
 
 	onMounted(() => {
 		// webViewUrl.value =
 		// 	`https://feiniao-mini-h5-dev.sysuimars.cn/youwei/#/allGardenMap?userId=${userInfo.id}&token=${userInfo.token}`
-		webViewUrl.value = "http://localhost:8081/#/allGardenMap?userId=91754&token=034d7cf5-25fc-42d3-993e-460120419e5a"
+		// webViewUrl.value = "http://localhost:8081/#/allGardenMap?userId=91754&token=034d7cf5-25fc-42d3-993e-460120419e5a"
+		webViewUrl.value =
+			`http://localhost:8081/#/gardenMap?userId=${userInfo.id}&token=${userInfo.token}&isFromScan=true`
 	})
 </script>

+ 5 - 1
pages/tabBar/home/subPages/gardenMap.vue

@@ -14,11 +14,15 @@
 	// 创建响应式的webview URL
 	const webViewUrl = ref('')
 	
-	onLoad(({enterSelectTree}) => {
+	onLoad(({enterSelectTree, isScanAuthSuccess}) => {
 		if (enterSelectTree) {
 			webViewUrl.value =
 				`https://feiniao-mini-h5-dev.sysuimars.cn/youwei/#/gardenMap?userId=${userInfo.id}&token=${userInfo.token}&enterSelectTree=true`
 			// webViewUrl.value = "http://localhost:8081/#/gardenMap?userId=91754&token=034d7cf5-25fc-42d3-993e-460120419e5a&enterSelectTree=true"
+		} else if (isScanAuthSuccess) {
+			// webViewUrl.value =
+			// 	`https://feiniao-mini-h5-dev.sysuimars.cn/youwei/#/gardenMap?userId=${userInfo.id}&token=${userInfo.token}&isScanAuthSuccess=true`
+				webViewUrl.value = `http://localhost:8081/#/gardenMap?userId=${userInfo.id}&token=${userInfo.token}&isScanAuthSuccess=true`
 		} else {
 			webViewUrl.value =
 				`https://feiniao-mini-h5-dev.sysuimars.cn/youwei/#/gardenMap?userId=${userInfo.id}&token=${userInfo.token}`