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

<script>
	import http from '@/shopro/request/index';
	export default {
		data() {
			return {
				webUrl:''
			}
		} ,
		onReady(){
			// this.webUrl = "http://172.18.0.147:8000/#/?time="+new Date().getTime()
			// this.webUrl = "https://wxcs.zhonghuihaotai.com/webpage/wxdist/index.html#/?mallId=171795610000098&time="+new Date().getTime()
			// this.webUrl = "https://wx.zhonghuihaotai.com/webpage/wxdist/index.html#/?mallId=134581110000230&companyId=00000310&time="+new Date().getTime()
		},
		methods:{
			handleMsg(e){
				console.log(e)
				console.log('接收到消息：' + JSON.stringify(e.detail.data));
				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#/?mallId=106975910000477&companyId=999999998&time=${time}&sfCode=${code}`
						// this.webUrl = `https://wxcs.zhonghuihaotai.com/webpage/wxdist/index.html#/?mallId=106975910000477&companyId=999999998&time=${time}&sfCode=${code}`
					} else {
					}
				})
				
			}
		},
		onLoad(){
			uni.hideTabBar();
			this.saveMiniCode();
		},
		onLaunch(){
		}
	}
</script>
<style>
</style>
