<template>
	<view>
    <web-view :src="src" v-if="bool"></web-view>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				projectSn:'',
				src:'',
        bool:false
			};
		},
   created(){
     let projectInfo = JSON.parse(uni.getStorageSync('projectDetail'))
     this.src = url_config+'?project='+projectInfo.projectSn
   },
   mounted(){
     let height = 0
     let platform = ''
     uni.getSystemInfo({
       success:res=>{
         console.log(res,'设备信息')
         height = res.windowHeight - 70
         platform = res.platform
       }
     })
   if(platform == 'other'){
     console.log('pc端')
     this.bool = true
     return 
   }else{
     let wv = plus.webview.create("","webview",{
       plusrequire:"none",
       top:70,
       height:height,
     })
     wv.loadURL(this.src)
     let currentWebview = this.$parent.$scope.$getAppWebview()
     currentWebview.append(wv)
     setTimeout(function(){
       console.log(wv)
       console.log(wv.getStyle())
     },1000)
   }
   
   },
    // beforeDestroy(){
    //  wv.close()
    // }
	}
</script>

<style>

</style>
