<template>
	<view>
	</view>
</template>

<script>
	import common from '../../common/common.js'
	var _self;
	var wv;
	export default {
		data() {
			const token = '';
			return {
				token: ''
			};
		},
		methods: {
			createView(taskid,trid) {
				var url = common.evalutaionBaseUrl + '/app/apptask/getoptiontemplatedefaulttemporary/' + taskid+'/'+trid
				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.createView(ldRes.taskId,ldRes.trid)
				}
			});
		},
		onUnload() {},
		onShow() {},
		components: {}
	};
</script>

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