<template>
	<view class="">
		<view class="status_bar" :style="navHeight"></view>
		<web-view ref="web-view" class="uni-flex-item" :src="src" :webview-styles="webview_styles" @message="message"
			@error="error" @loading="loading" @loaded="loaded">
		</web-view>
	</view>
</template>

<script>
	import { mapState } from 'vuex'
	export default {
		data() {
			return {
				src: '',
				webview_styles: {
				}
			}
		},
		onLoad() {
			// this.src = 'https://uat.wuliangye.com.cn/market-workbench-dealer-audit/?dealerId='+this.userInfo.code  //测试环境
			this.src = 'https://yingxiao.wuliangye.com.cn/market-workbench-dealer-audit/?dealerId='+this.userInfo.code  //生产环境
		},
		computed: {
			...mapState(['userInfo']),
			navHeight() {
				return {
					'height': `100px`
				}
			},
		},
		methods: {
			message(event) {
				console.log(JSON.stringify(event.detail));
			},
			error(event) {
				console.log(JSON.stringify(event.detail));
			},
			loading(event) {
				console.log(JSON.stringify(event.type));
			},
			loaded(event ) {
				console.log(JSON.stringify(event.type));
			},
		}
	}
</script>

<style>
	.uni-input-v {
		padding: 10rpx 0;
	}

	.uni-btn-ml {
		margin-left: 10rpx;
	}
	.uni-flex-item{
		height: 100%
	}
	.status_bar {
		height: var(--status-bar-height);
	}
</style>
