|
@@ -46,7 +46,7 @@ export default {
|
|
|
computed: {
|
|
|
url() {
|
|
|
let ssurl = window.location.hash.substr(window.location.hash.indexOf('?') || 0)
|
|
|
- let dataurl = sessionStorage.getItem('visitorurl')
|
|
|
+ let dataurl = localStorage.getItem('visitorurl')
|
|
|
// console.log('dataurl',dataurl,dataurl.substr(dataurl.indexOf('?') || 0))
|
|
|
if(dataurl){
|
|
|
return process.env.VUE_APP_DOMAIN + '/fire-rtc-live.html' + dataurl.substr(dataurl.indexOf('?') || 0)
|
|
@@ -107,9 +107,9 @@ export default {
|
|
|
var that = this
|
|
|
if(event.data){
|
|
|
const {liveStatus,url} = event.data
|
|
|
- url&&sessionStorage.setItem('visitorurl',url)
|
|
|
+ url&&localStorage.setItem('visitorurl',url)
|
|
|
if(liveStatus == 0){//已结束
|
|
|
- sessionStorage.removeItem('visitorurl')
|
|
|
+ localStorage.removeItem('visitorurl')
|
|
|
let isOk = await this.$alert(
|
|
|
"带看已结束",
|
|
|
"确定"
|
|
@@ -121,31 +121,38 @@ export default {
|
|
|
}
|
|
|
);
|
|
|
if(isOk){
|
|
|
- if(that.token){
|
|
|
- that.$router.push({name: 'home'})
|
|
|
- }else{
|
|
|
window.location.href = 'noAccess.html'
|
|
|
- }
|
|
|
}
|
|
|
}
|
|
|
console.log('handleMessage===>',event.data)
|
|
|
}
|
|
|
},
|
|
|
async lineCheck(){
|
|
|
- let { roomId } = getQueryString(this.url)
|
|
|
- if(!this.token){
|
|
|
- window.location.href = 'noAccess.html'
|
|
|
- return
|
|
|
- }
|
|
|
+ var that = this
|
|
|
+ let { roomId, } = getQueryString(this.url)
|
|
|
let {data} = await axios.get(onLineCheck, {params:{roomId}})
|
|
|
console.log('房间号不存在===>',data)
|
|
|
- if(data.error){
|
|
|
- window.location.href = 'noAccess.html'
|
|
|
+ if(data.error || data.isTrue){
|
|
|
+ let isOk = await this.$alert(
|
|
|
+ "带看已结束",
|
|
|
+ "确定"
|
|
|
+ ,{
|
|
|
+ customClass:that.modelType?'messageMobile':'',
|
|
|
+ showClose:false,
|
|
|
+ showCancelButton:false,
|
|
|
+ closeOnClickModal:false,
|
|
|
+ }
|
|
|
+ );
|
|
|
+ if(isOk){
|
|
|
+ if(data.error) return window.location.href = 'noAccess.html'
|
|
|
+ const search = getQueryString(window.location.hash)
|
|
|
+ this.$router.replace({name: 'sceneInitiator', query: {sceneNum:search['#/sceneVisitor?m'],id: search.p_id}})
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
},
|
|
|
mounted() {
|
|
|
- this.lineCheck()
|
|
|
+ this.lineCheck()
|
|
|
if((navigator.userAgent.match(/(phone|pad|pod|iPhone|iPod|ios|iPad|Android|Mobile|BlackBerry|IEMobile|MQQBrowser|JUC|Fennec|wOSBrowser|BrowserNG|WebOS|Symbian|Windows Phone)/i))) {
|
|
|
this.modelType = true
|
|
|
}
|
|
@@ -165,7 +172,7 @@ export default {
|
|
|
},
|
|
|
beforeDestroyed(){
|
|
|
window.removeEventListener("message", this.handleMessage);
|
|
|
- sessionStorage.removeItem('visitorurl')
|
|
|
+ localStorage.removeItem('visitorurl')
|
|
|
},
|
|
|
components: {
|
|
|
"com-dialog": comDialog,
|