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

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

				uni.setNavigationBarTitle({
					title: data.title
				})

				let url = escape(data.url)
				console.log(url)
				console.log(unescape(url))

				let title = escape(data.title)
				console.log(url)
				console.log(unescape(title))

				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>
