<template>
	<web-view  ref="webview" class="web-view" :webview-styles="webviewStyles" :src="url"    @message="getMSG"></web-view>
</template>

<script>
	
	export default {
		//computed: mapGetters(['chatUrl']),
		data() {
			return {
				windowH: 0,
				windowW: 0,
				webviewStyles: {
					progress: {
						color: 'transparent'
					}
				},
				url: ''
			}
		},
		onLoad(option) {
			// if(option.webUel)
			this.url='https://liveness.shumaidata.com/index?token='
			 this.url = this.url+option.weburl;
			 // this.url='http://localhost:8080/#/pages/users/faceBack/index?success=false&_r=fcc4c290fad711eea7e655ad4ce7134c'
			 // console.log(	 this.url);
			 
			
			// 蚂蚁智能客服场景参数
			// if(option.scene) this.url += `&scene=${option.scene}`;
			// uni.setNavigationBarTitle({
			// 	title: option.title
			// })
			// try {
			// 	const res = uni.getSystemInfoSync();
			// 	this.windowW = res.windowWidth;
			// 	this.windowH = res.windowHeight;
			// } catch (e) {
			// 	// error
			// }
			
		},
		methods: {
			 getMSG(e){
				console.log('============这里返回postMessage对应的对象============')
				console.log(e)
				let abb=e.detail.data[0].url
				console.log(abb,'abbbb');
				if (e.detail.data[0].url) {
				    uni.redirectTo({
				        url: '/pages/users/faceBack/index?success=' + e.detail.data[0].url.success + '&_r=' + e.detail.data[0].url._r
				    });
				}
			},
			
		}
	}
</script>
