<template>
	<view>
		<web-view v-if="webviewUrl" :src="webviewUrl" @message="message"></web-view>
	</view>
</template>

<script>
	import config from '@/config';
	export default {
		data() {
			return {
				webviewUrl: ''
			}
		},
		onLoad(body) {
			let path = decodeURIComponent(body.url);
			let link = path.indexOf('?') === -1 ? '?' : '&';
			this.webviewUrl = config.webviewUrl + path + link + 'token=' + uni.getStorageSync('shopMobileToken');
		},
		methods: {
			message(e) {
				console.log(e.detail);
			}
		}
	}
</script>

<style>

</style>