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

<script>
	import common from '../../common/common.js'
	var _self;
	var wv;
	export default {
		data() {
			const token = '';
			return {
				token: '',
				webUrl: "",
			};
		},
		methods: {
			createView(taskid, trid) {
				var url = common.evalutaionBaseUrl + '/app/apptask/getoptiontemplatedefaulttemporary/' + taskid + '/' +
					trid + "?token="
				// wv = plus.webview.create(url, "custom-webview", {
				// 	top: uni.getSystemInfoSync().statusBarHeight + 44,
				// 	bottom: '0px',
				// 	additionalHttpHeaders: {
				// 		token: _self.token
				// 	}
				// })
				// // wv.loadURL(url)
				// var currentWebview = this.$mp.page.$getAppWebview()
				// currentWebview.append(wv);
				// setTimeout(function() {}, 1000);
			}
		},
		onLoad(ldRes) {
			_self = this;
			console.log(ldRes.trid);
			uni.getStorage({
				key: 'appToken',
				success: res => {
					_self.token = res.data;
					_self.webUrl = common.evalutaionBaseUrl +
						'/app/apptask/getoptiontemplatedefaulttemporary-release/' +
						ldRes.taskId + '/' +
						ldRes.trid + "?token=" + _self.token;
				}
			});
		},
		onUnload() {},
		onShow() {},
		components: {}
	};
</script>

<style>
	.body {
		display: flex;
		flex-direction: column;
		justify-content: center;
		text-align: center;
		align-items: center;
		padding-top: 50%;
	}
</style>
