<template>
	<view>
		<web-view @message="handleMsg" :src='webUrl' ></web-view>
	</view>
</template>

<script>
	import http from '@/shopro/request/index';
	export default {
		data() {
			return {
				webUrl:'',
				appointPage:''
			}
		} ,
		onReady(){
			// this.webUrl = "https://wx.zhonghuihaotai.com/webpage/wxdist/index.html#/?mallId=134581110000230&companyId=00000310&time="+new Date().getTime()
		},
		methods:{
			handleMsg(e){
				// uni.navigateToMiniProgram({
				// 	orderId: data.orderId,
				// });
			},
			saveMiniCode(){
				let fsCode =  uni.getStorageSync('token');
				http('user.miniCode', {fsCode:fsCode}).then(res => {
					if (!res.code && res.data) {
						let code = res.data.sfCode;
						let time = new Date().getTime();
						this.webUrl= `https://wxcs.zhonghuihaotai.com/webpage/wxdist/index.html#/${this.appointPage?this.appointPage:""}?mallId=119583623123146&companyId=625&time=${time}&sfCode=${code}&authMode=force`
						// this.webUrl = `https://wxcs.zhonghuihaotai.com/webpage/wxdist/index.html#/?mallId=106975910000477&companyId=999999998&time=${time}&sfCode=${code}`
						console.log(this.webUrl)
					}  
				})
				
			}
		},
		onLoad(option){
			this.appointPage = option.appointPage;//指定页面
			// uni.hideTabBar();
			this.saveMiniCode();
		},
		onLaunch(){
		}
	}
</script>
<style>
</style>
