<template>
	<view>
		<web-view :src="webViewUrl"></web-view>
	</view>
</template>

<script setup>
	import {
		onMounted, ref
	} from 'vue';
	import { onLoad } from "@dcloudio/uni-app"
	const userInfo = uni.getStorageSync('userInfo')

	// 创建响应式的webview URL
	const webViewUrl = ref('')
	
	onLoad(({enterSelectTree}) => {
		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 {
			webViewUrl.value =
				`https://feiniao-mini-h5-dev.sysuimars.cn/youwei/#/gardenMap?userId=${userInfo.id}&token=${userInfo.token}`
				// webViewUrl.value = "http://localhost:8081/#/gardenMap?userId=91754&token=034d7cf5-25fc-42d3-993e-460120419e5a"
		}
	})
</script>