|
@@ -1,6 +1,7 @@
|
|
|
<template>
|
|
|
- <div class="scene-layer">
|
|
|
- <iframe ref="lookLive" allow="geolocation; microphone; camera; midi; encrypted-media;" :src="url" ></iframe>
|
|
|
+ <div class="scene-layer" id="iframediv">
|
|
|
+ <!-- getUrlname() -->
|
|
|
+ <!-- <iframe ref="lookLive" allow="geolocation; microphone; camera; midi; encrypted-media;" :src="url" ></iframe> -->
|
|
|
</div>
|
|
|
|
|
|
<com-dialog title="访问密码" enterText="确 定" v-model:show="confirm.show" @submit="loadData()" width="480" :showClose="false">
|
|
@@ -48,13 +49,10 @@ export default {
|
|
|
return process.env.VUE_APP_DOMAIN + '/fire-rtc-live.html' + ssurl.substr(ssurl.indexOf('?') || 0)
|
|
|
}
|
|
|
if (sceneNum && id) {
|
|
|
- // return process.env.VUE_APP_DOMAIN + '/fire-rtc-live.html?m=' + m +'&p_id='+p_id
|
|
|
return process.env.VUE_APP_DOMAIN + '/fire-rtc-live.html?m=' + sceneNum +'&app=fire-control&p_id='+id+'&vlog#/'
|
|
|
- // return 'https://test.4dkankan.com/fire-rtc-live.html?m=t-3fp7zQl&p_id=PROJECT01456470052986503168#/?mode=2&name=test&role=leader&roomId=9c4Q2rbL9ZP0Pxf1ReXLekBN&userId=9RYJ5jgQYvnP'
|
|
|
} else {
|
|
|
console.log('url获取=>',this.$route)
|
|
|
return 'javascript:void(0)'
|
|
|
- // return process.env.VUE_APP_DOMAIN + '/spc.html?m=' + this.detail.sceneNum
|
|
|
}
|
|
|
},
|
|
|
tableData() {
|
|
@@ -76,6 +74,9 @@ export default {
|
|
|
},
|
|
|
},
|
|
|
methods: {
|
|
|
+ getUrlname(){
|
|
|
+ return window.location.origin + window.location.pathname
|
|
|
+ },
|
|
|
async loadData() {
|
|
|
// if (!this.confirm.psw || this.confirm.psw.length === 0) return this.$message.error('请输入访问密码', '提示')
|
|
|
let {data: detail} = await axios.get(fireDetailByPsw, {params: {projectId: this.$route.params.projectId, randCode: this.confirm.psw,type:1}})
|
|
@@ -107,12 +108,19 @@ export default {
|
|
|
}
|
|
|
},
|
|
|
mounted() {
|
|
|
- // this.loadData()
|
|
|
window.addEventListener('message',this.handleMessage)
|
|
|
- let iframdata = this.$refs.lookLive
|
|
|
- if(iframdata){
|
|
|
- iframdata.allow = 'geolocation; microphone; camera; midi; encrypted-media;'
|
|
|
+ var iframe = document.createElement('iframe');
|
|
|
+ iframe.src=this.url;
|
|
|
+ iframe.width='100%';
|
|
|
+ iframe.height='100%';
|
|
|
+ iframe.name = this.getUrlname()
|
|
|
+ if(iframe){
|
|
|
+ iframe.allow = 'geolocation; microphone; camera; midi; encrypted-media;'
|
|
|
}
|
|
|
+ document.getElementById('iframediv').appendChild(iframe);
|
|
|
+ },
|
|
|
+ created(){
|
|
|
+
|
|
|
},
|
|
|
beforeDestroyed(){
|
|
|
window.removeEventListener("message", this.handleMessage);
|