<template>
	<view>
		<!-- <web-view :src="href"></web-view> -->
		
		{{res}}
		
	</view>
</template>

<script>
	export default {
		data() {
			return {
				href: "",
				
				res:""
			};
		},
		onLoad(option) {
			// #ifndef APP-NVUE
			const eventChannel = this.getOpenerEventChannel();
			// #endif
			// 监听acceptDataFromOpenerPage事件，获取上一页面通过eventChannel传送到当前页面的数据
			eventChannel.on('acceptDataFromOpenerPage', (data) => {
				
				uni.setNavigationBarTitle({
					title: data.title
				})

				let url = escape(data.url)
				let title = escape(data.title)
				
				// 获取位置
				uni.getLocation({
					type: 'gcj02',
					geocode: true ,
					success: (res)=> {
						this.res = res
						console.log(res)
						console.log('当前位置的经度：' + res.longitude);
						console.log('当前位置的纬度：' + res.latitude);
					}
				});
				

				// this.href = "http://oa_system.nxjiewei.com:8011/oa_login?staff_num=" + uni.getStorageSync('user')
				// 	.staff_num + "&url=" + url + "&title=" + title
			})

		}
	}
</script>

<style lang="scss">

</style>
