<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, rid) {
				console.log(rid);
				var url = common.evalutaionBaseUrl + '/app/apptask/getoptiontemplatedefaultresult/' + taskid + '/' + rid
				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;
			uni.getStorage({
				key: 'appToken',
				success: res => {
					_self.token = res.data;
					console.log(ldRes.taskId + '===' + ldRes.rid);
					_self.createView(ldRes.taskId, ldRes.rid)
				}
			});
		},
		onUnload() {},
		onShow() {},
		components: {}
	};
</script>

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