瀏覽代碼

Merge branch 'master' of http://www.sysuimars.cn:3000/feiniao/feiniao-youwei-uniapp

wangsisi 3 周之前
父節點
當前提交
578027ee1b
共有 3 個文件被更改,包括 21 次插入9 次删除
  1. 12 6
      pages/login/index.vue
  2. 4 2
      pages/tabBar/home/subPages/allGardenMap.vue
  3. 5 1
      pages/tabBar/home/subPages/gardenMap.vue

+ 12 - 6
pages/login/index.vue

@@ -44,7 +44,7 @@
 		params = "{}"
 	}) => {
 		pageUrl.value = route_path
-		pageParams.value = params
+		pageParams.value = JSON.parse(params)
 		getUserData()
 	})
 
@@ -91,11 +91,17 @@
 					icon: 'none',
 					duration: 2000,
 					mask: true
-				})
+				})
 				uni.setStorageSync('userInfo', userData.value);
-				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: '保存失败',
@@ -112,7 +118,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}`