<template>
	<view>
		<web-view :src="url" @message="onMessage"></web-view>
	</view>
</template>

<script>
	import config from "@/config";
	export default {
		data() {
			return {
				url: ''
			}
		},
		onLoad(body) {
			uni.$on('reloadElement', () => {
				this.url = config.baseUrl + '/webview/document/editor.html?token=' + uni.getStorageSync('token') +
					'&id=' + body.id + '&contractId=' + body.contractId + '&time=' + new Date().getTime() +
					'&userId=' + this.$store.getters.user.userId;
			})
			this.url = config.baseUrl + '/webview/document/editor.html?token=' + uni.getStorageSync('token') +
				'&id=' + body.id + '&contractId=' + body.contractId + '&time=' + new Date().getTime() + '&userId=' + this
				.$store.getters.user.userId;
		},
		methods: {
			onMessage(data) {}
		}
	}
</script>

<style>

</style>