This commit is contained in:
liuxi 2025-02-27 17:18:35 +08:00
commit a56dc745ca

View File

@ -481,16 +481,15 @@ export default {
if (this.videoCallInterval) { if (this.videoCallInterval) {
clearInterval(this.videoCallInterval) clearInterval(this.videoCallInterval)
} }
if(this.calling){
window.tccc.Call.hungUp({sessionId: this.sessionId})
}
window.removeEventListener('beforeunload', this.handleBeforeUnload); window.removeEventListener('beforeunload', this.handleBeforeUnload);
}, },
methods: { methods: {
handleBeforeUnload(event) { handleBeforeUnload(event) {
console.log(this.sessionId,'this.sessionId')
// //
if(this.sessionId !='') if(this.calling){
{
console.log('刷新及离开挂断电话')
window.tccc.Call.hungUp({sessionId: this.sessionId}) window.tccc.Call.hungUp({sessionId: this.sessionId})
} }
}, },
@ -600,17 +599,22 @@ export default {
// } // }
// }) // })
}, },
handleBack() { async handleBack() {
try {
if(this.timerInterval) { // if(this.timerInterval) { //
clearInterval(this.timerInterval); // clearInterval(this.timerInterval); //
} }
if (this.videoCallInterval) { if (this.videoCallInterval) {
clearInterval(this.videoCallInterval) clearInterval(this.videoCallInterval)
} }
this.handleBeforeUnload() if(this.calling){
setTimeout(() => { let res = await window.tccc.Call.hungUp({sessionId: this.sessionId})
console.log('挂断电话', res)
this.$router.push('/mediation-management') this.$router.push('/mediation-management')
}, 500); } else {
this.$router.push('/mediation-management')
}
} catch (err) {}
// this.$route.query.sourcePage == 'mediationManagement' // this.$route.query.sourcePage == 'mediationManagement'
// this.$router.push('/mediation-management') // this.$router.push('/mediation-management')
}, },