|
@@ -141,7 +141,7 @@
|
|
|
},
|
|
},
|
|
|
|
|
|
|
|
methods: {
|
|
methods: {
|
|
|
- ...mapMutations(['updateIsRefusedCall', 'updateTalkingStatus','updateOccupyedStatus']),
|
|
|
|
|
|
|
+ ...mapMutations(['updateIsRefusedCall', 'updateTalkingStatus', 'updateOccupyedStatus']),
|
|
|
// 即构 - 视频通话 初始化
|
|
// 即构 - 视频通话 初始化
|
|
|
async setup() {
|
|
async setup() {
|
|
|
var that = this
|
|
var that = this
|
|
@@ -457,63 +457,99 @@
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
this.engine.logoutRoom(that.videoObj.room_id); // 退出房间
|
|
this.engine.logoutRoom(that.videoObj.room_id); // 退出房间
|
|
|
- this.$refs.uToast.show({
|
|
|
|
|
- type: 'default',
|
|
|
|
|
- message: isRefused ? '对方正忙' : '结束视频通话!',
|
|
|
|
|
- })
|
|
|
|
|
- setTimeout(() => {
|
|
|
|
|
- that.videoShow = true
|
|
|
|
|
- that.allStreamList = [];
|
|
|
|
|
- that.allUserViewObjectList = [];
|
|
|
|
|
- var obj = {}
|
|
|
|
|
- // obj = {
|
|
|
|
|
- // 'action': 'read', // 动作标识,必填
|
|
|
|
|
- // 'send_user_id': that.videoObj.user_id, // 接收人用户id, 非必填
|
|
|
|
|
- // 'data': {}
|
|
|
|
|
- // }
|
|
|
|
|
- console.warn('-----------off video 接收人用户id-------------', that.videoObj.user_id, API)
|
|
|
|
|
- obj = {
|
|
|
|
|
- 'action': 'list', // 动作标识,必填
|
|
|
|
|
- 'type': '当前为挂断',
|
|
|
|
|
- 'recv_user_id': that.videoObj.user_id, // 接收人用户id, 非必填
|
|
|
|
|
- 'data': {}
|
|
|
|
|
- }
|
|
|
|
|
-
|
|
|
|
|
- if (!isRefused) {
|
|
|
|
|
-
|
|
|
|
|
- API.socketTask.send({
|
|
|
|
|
- data: JSON.stringify(obj),
|
|
|
|
|
- async success(res) {
|
|
|
|
|
- console.log("消息发送成功");
|
|
|
|
|
- },
|
|
|
|
|
- });
|
|
|
|
|
- }
|
|
|
|
|
-
|
|
|
|
|
- if (isNotice) {
|
|
|
|
|
- console.log(this.videoObj, 'is notice')
|
|
|
|
|
-
|
|
|
|
|
- if (!that.currentReceiveUserID) {
|
|
|
|
|
- console.warn('当前连接的用户不存在,不是本人发起的通话.')
|
|
|
|
|
- } else {
|
|
|
|
|
- const socketData = {
|
|
|
|
|
- action: 'reject_video', // 动作标识,必填
|
|
|
|
|
- recv_user_id: that.currentReceiveUserID, // 接收人用户id, 非必填
|
|
|
|
|
- data: {},
|
|
|
|
|
- }
|
|
|
|
|
-
|
|
|
|
|
|
|
+
|
|
|
|
|
+ const execExit = () => {
|
|
|
|
|
+ console.log('---------------- exec exit')
|
|
|
|
|
+ setTimeout(() => {
|
|
|
|
|
+ that.videoShow = true
|
|
|
|
|
+ that.allStreamList = [];
|
|
|
|
|
+ that.allUserViewObjectList = [];
|
|
|
|
|
+ var obj = {}
|
|
|
|
|
+ // obj = {
|
|
|
|
|
+ // 'action': 'read', // 动作标识,必填
|
|
|
|
|
+ // 'send_user_id': that.videoObj.user_id, // 接收人用户id, 非必填
|
|
|
|
|
+ // 'data': {}
|
|
|
|
|
+ // }
|
|
|
|
|
+ console.warn('-----------off video 接收人用户id-------------', that.videoObj
|
|
|
|
|
+ .user_id, API)
|
|
|
|
|
+ obj = {
|
|
|
|
|
+ 'action': 'list', // 动作标识,必填
|
|
|
|
|
+ 'type': '当前为挂断',
|
|
|
|
|
+ 'recv_user_id': that.videoObj.user_id, // 接收人用户id, 非必填
|
|
|
|
|
+ 'data': {}
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ if (!isRefused) {
|
|
|
|
|
+
|
|
|
API.socketTask.send({
|
|
API.socketTask.send({
|
|
|
- data: JSON.stringify(socketData),
|
|
|
|
|
|
|
+ data: JSON.stringify(obj),
|
|
|
async success(res) {
|
|
async success(res) {
|
|
|
- console.log('reject_video 消息发送成功 reject_video')
|
|
|
|
|
|
|
+ console.log("消息发送成功");
|
|
|
},
|
|
},
|
|
|
- })
|
|
|
|
|
|
|
+ });
|
|
|
}
|
|
}
|
|
|
|
|
+
|
|
|
|
|
+ if (isNotice) {
|
|
|
|
|
+ console.log(this.videoObj, 'is notice')
|
|
|
|
|
+
|
|
|
|
|
+ if (!that.currentReceiveUserID) {
|
|
|
|
|
+ console.warn('当前连接的用户不存在,不是本人发起的通话.')
|
|
|
|
|
+ } else {
|
|
|
|
|
+ const socketData = {
|
|
|
|
|
+ action: 'reject_video', // 动作标识,必填
|
|
|
|
|
+ recv_user_id: that
|
|
|
|
|
+ .currentReceiveUserID, // 接收人用户id, 非必填
|
|
|
|
|
+ data: {},
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ API.socketTask.send({
|
|
|
|
|
+ data: JSON.stringify(socketData),
|
|
|
|
|
+ async success(res) {
|
|
|
|
|
+ console.log(
|
|
|
|
|
+ 'reject_video 消息发送成功 reject_video')
|
|
|
|
|
+ },
|
|
|
|
|
+ })
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ this.handleBack()
|
|
|
|
|
+ }, 1500)
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ this.$refs.uToast.show({
|
|
|
|
|
+ type: 'default',
|
|
|
|
|
+ message: isRefused ? '对方正忙' : '结束视频通话!',
|
|
|
|
|
+ })
|
|
|
|
|
+ console.log('------------------------------------------ exec exit exec before')
|
|
|
|
|
+ execExit()
|
|
|
|
|
+
|
|
|
|
|
+ // if (isRefused) {
|
|
|
|
|
+ // uni.showModal({
|
|
|
|
|
+ // title: '提示',
|
|
|
|
|
+ // content: isRefused ? '对方正忙' : '结束视频通话!',
|
|
|
|
|
+ // showCancel: false,
|
|
|
|
|
+ // confirmText: '好',
|
|
|
|
|
+ // success: (res) => {
|
|
|
|
|
+ // execExit()
|
|
|
|
|
+ // },
|
|
|
|
|
+ // fail: () => {
|
|
|
|
|
+ // this.handleBack()
|
|
|
|
|
+ // }
|
|
|
|
|
+ // });
|
|
|
|
|
+ // } else {
|
|
|
|
|
+ // this.$refs.uToast.show({
|
|
|
|
|
+ // type: 'default',
|
|
|
|
|
+ // message: isRefused ? '对方正忙' : '结束视频通话!',
|
|
|
|
|
+ // })
|
|
|
|
|
+ // console.log('------------------------------------------ exec exit exec before')
|
|
|
|
|
+ // execExit()
|
|
|
|
|
+ // }
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
|
|
|
|
|
|
|
|
|
|
- }
|
|
|
|
|
|
|
|
|
|
- this.handleBack()
|
|
|
|
|
- }, 1500)
|
|
|
|
|
// uni.redirectTo({
|
|
// uni.redirectTo({
|
|
|
// url: "/pages/response/index"
|
|
// url: "/pages/response/index"
|
|
|
// })
|
|
// })
|
|
@@ -553,12 +589,28 @@
|
|
|
async onLoad(optinos) {
|
|
async onLoad(optinos) {
|
|
|
console.log('onload -------------- 1213', this.isVideoCallRefused)
|
|
console.log('onload -------------- 1213', this.isVideoCallRefused)
|
|
|
if (this.isVideoCallRefused) {
|
|
if (this.isVideoCallRefused) {
|
|
|
-
|
|
|
|
|
- uni.$u.toast('对方正忙')
|
|
|
|
|
-
|
|
|
|
|
|
|
+ this.$refs.uToast.show({
|
|
|
|
|
+ type: 'default',
|
|
|
|
|
+ message: '对方正忙',
|
|
|
|
|
+ })
|
|
|
|
|
+
|
|
|
setTimeout(() => {
|
|
setTimeout(() => {
|
|
|
this.handleBack();
|
|
this.handleBack();
|
|
|
}, 1500)
|
|
}, 1500)
|
|
|
|
|
+ // uni.showModal({
|
|
|
|
|
+ // title: '提示',
|
|
|
|
|
+ // content: '对方正忙',
|
|
|
|
|
+ // showCancel: false,
|
|
|
|
|
+ // confirmText: '好',
|
|
|
|
|
+ // success: (res) => {
|
|
|
|
|
+ // setTimeout(() => {
|
|
|
|
|
+ // this.handleBack();
|
|
|
|
|
+ // }, 1500)
|
|
|
|
|
+ // },
|
|
|
|
|
+ // fail: () => {
|
|
|
|
|
+ // this.handleBack()
|
|
|
|
|
+ // }
|
|
|
|
|
+ // });
|
|
|
return
|
|
return
|
|
|
}
|
|
}
|
|
|
|
|
|