|
|
@@ -405,11 +405,12 @@
|
|
|
:modal="false"
|
|
|
:close-on-press-escape="false"
|
|
|
:visible.sync="videoNoticeDialogVisible"
|
|
|
+ @close="handleCloseNoticeDialog"
|
|
|
width="500px"
|
|
|
>
|
|
|
<div style="padding:40px 20px;">{{ videoNoticeTitle }}</div>
|
|
|
<span slot="footer" class="dialog-footer">
|
|
|
- <el-button @click="cancleNoticeClik">取 消</el-button>
|
|
|
+ <el-button @click="handleCloseNoticeDialog">取 消</el-button>
|
|
|
<el-button type="primary" @click="confrimNoticeClick">确 定</el-button>
|
|
|
</span>
|
|
|
</el-dialog>
|
|
|
@@ -513,7 +514,8 @@ export default {
|
|
|
currentVideoCallUserID: '',
|
|
|
videoNoticeTitle: '',
|
|
|
videoNoticeDialogVisible: false,
|
|
|
- currentVideoNoticeData: null
|
|
|
+ currentVideoNoticeData: null,
|
|
|
+ isNoticeDialogConfirm: false
|
|
|
};
|
|
|
},
|
|
|
//监听属性 类似于data概念
|
|
|
@@ -948,7 +950,7 @@ export default {
|
|
|
};
|
|
|
this.websock.onmessage = event => {
|
|
|
var data = JSON.parse(event.data);
|
|
|
- console.log('WebSocket:消息---------------------------', data);
|
|
|
+ console.warn('WebSocket:消息---------------------------', data);
|
|
|
|
|
|
if (data.action == 'none') {
|
|
|
// 获取聊天记录
|
|
|
@@ -1002,6 +1004,8 @@ export default {
|
|
|
this.websock.send(JSON.stringify(obj));
|
|
|
return;
|
|
|
}
|
|
|
+
|
|
|
+ this.updateTalkingStatus(true);
|
|
|
// 获取当前点击用户的房间号以及登录房间所需的Token
|
|
|
// console.log(JSON.parse(event.data));
|
|
|
console.log(data);
|
|
|
@@ -1039,6 +1043,7 @@ export default {
|
|
|
console.warn('recv_video---------------- response', data.data);
|
|
|
if (this.isVideoCallRefused) {
|
|
|
this.updateIsRefusedCall(false);
|
|
|
+ this.updateTalkingStatus(false);
|
|
|
return;
|
|
|
}
|
|
|
|
|
|
@@ -1114,7 +1119,9 @@ export default {
|
|
|
}
|
|
|
},
|
|
|
confrimNoticeClick() {
|
|
|
+ this.isNoticeDialogConfirm = true;
|
|
|
this.videoNoticeDialogVisible = false;
|
|
|
+
|
|
|
if (!this.currentVideoNoticeData) {
|
|
|
return;
|
|
|
}
|
|
|
@@ -1123,9 +1130,16 @@ export default {
|
|
|
'正在和' + this.currentVideoNoticeData.real_name + '视频通话';
|
|
|
this.loginRoom();
|
|
|
},
|
|
|
- cancleNoticeClik() {
|
|
|
+ handleCloseNoticeDialog() {
|
|
|
+ console.warn('close notice dialog', this.isNoticeDialogConfirm);
|
|
|
this.videoNoticeDialogVisible = false;
|
|
|
+ if (!this.isNoticeDialogConfirm) {
|
|
|
+ this.cancleNoticeClik();
|
|
|
+ }
|
|
|
|
|
|
+ this.isNoticeDialogConfirm = false;
|
|
|
+ },
|
|
|
+ cancleNoticeClik() {
|
|
|
const socketData = {
|
|
|
action: 'reject_video', // 动作标识,必填
|
|
|
recv_user_id: this.currentVideoNoticeData.user_id, // 接收人用户id, 非必填
|
|
|
@@ -1134,7 +1148,7 @@ export default {
|
|
|
|
|
|
console.warn('send reject_video', socketData);
|
|
|
this.websock.send(JSON.stringify(socketData));
|
|
|
-
|
|
|
+ this.updateTalkingStatus(false);
|
|
|
this.currentVideoNoticeData = null;
|
|
|
},
|
|
|
loginRoom() {
|
|
|
@@ -1415,6 +1429,8 @@ export default {
|
|
|
}, //生命周期 - 销毁之前
|
|
|
destroyed() {
|
|
|
console.log('我进入到销毁里喽');
|
|
|
+ this.updateTalkingStatus(false);
|
|
|
+ this.updateIsRefusedCall(false);
|
|
|
var that = this;
|
|
|
clearTimeout(that.timeoutnum); // 清除重连
|
|
|
clearTimeout(that.timeoutObj); // 清除心跳
|