wechat_yxcl/pages/webview/webview.vue
2021-12-10 20:18:59 +08:00

64 lines
1.7 KiB
Vue

<template>
<view>
<web-view :src="src" v-if="src"></web-view>
<view v-else>
<noFound :nodata="true" text="抱歉.您暂无权限查看该页内容" > </noFound>
</view>
</view>
</template>
<script>
import {mapGetters} from 'vuex'
export default {
data() {
return {
src: '' //页面路由
}
},
computed:{
...mapGetters({
'user':'getUser' ,
})
},
onUnload() {
this.$util.addUserBehavior()
},
onLoad(option) {
if(option.name) {
switch(option.name) {
case 'questionnaire':
let mode = {} // this.userModules.find(u=>{return u.MODULE_GUID==='5733dfdd-29f6-4233-9ff0-6f077d80d778'})
mode.SERVERPART_IDS = ''
this.src = 'https://eshangtech.com/questionnarie/testType?mid=' + this.user.Membership_Id + '&sid='+(mode?mode.SERVERPART_IDS:'')+'&pcode='+this.user.ProvinceCode+'&phone=' + this.user.Membership_Phone+'&name='+encodeURIComponent(this.user.Membership_Name)
console.log(this.src)
break
case 'video':
let {sc,hd,bt,et,token} = option
this.src = `https://eshangtech.com/questionnarie/video?sc=${sc}&&hd=${hd}&bt=${bt}&et=${et}&token=${token}`
// this.src = `http://192.168.11.166:8080/video?sc=${sc}&&hd=${hd}&bt=${bt}&et=ss${et}&token=${token}`
break
case 'customer':
let {sid,pc,tmp,sn} = option
this.src = `https://eshangtech.com/questionnarie/customerAnaysis?sid=${sid}&pc=${pc}&tmp=${tmp}&sn=${sn}`
break
}
}else if(option.src.indexOf('https')>-1){
this.src = option.src
}
else if(option.src.indexOf('?')>-1){
this.src = option.src + "&uid=" + this.user.Membership_Id
}else{
this.src = option.src
}
}
}
</script>
<style>
</style>