From 9c4def893d6a3d873d593321293e0fff975acca3 Mon Sep 17 00:00:00 2001
From: liuyg <376836862@qq.com>
Date: Thu, 12 Aug 2021 21:00:15 +0800
Subject: [PATCH] 视频14
---
pages.json | 2 +-
pages/videoCall/videoCall.nvue | 32 +++++++++++++++++++++++---------
store/mutations.js | 14 ++++++++++++++
pages/groupChat/groupChat.vue | 2 +-
store/actions.js | 1 +
5 files changed, 40 insertions(+), 11 deletions(-)
diff --git a/pages.json b/pages.json
index 159af86..897bc16 100644
--- a/pages.json
+++ b/pages.json
@@ -436,7 +436,7 @@
"pagePath": "pages/groupChat/groupChat",
"iconPath": "static/images/tabbar/demo.png",
"selectedIconPath": "static/images/tabbar/demo_selected.png",
- "text": "好友"
+ "text": "聊天"
},
{
"pagePath": "pages/manage/manage",
diff --git a/pages/groupChat/groupChat.vue b/pages/groupChat/groupChat.vue
index bf63674..680ca0c 100644
--- a/pages/groupChat/groupChat.vue
+++ b/pages/groupChat/groupChat.vue
@@ -72,7 +72,7 @@
name: '群组'
},
{
- name: '通讯录'
+ name: '好友'
}
],
swiperHeight: 0,
diff --git a/pages/videoCall/videoCall.nvue b/pages/videoCall/videoCall.nvue
index 88f936c..96aaf43 100644
--- a/pages/videoCall/videoCall.nvue
+++ b/pages/videoCall/videoCall.nvue
@@ -301,6 +301,7 @@
console.log('对方已挂断');
// RtcModule.leaveChannel((res) => {});
that.closeAll();
+ uni.navigateBack();
}
});
@@ -653,7 +654,7 @@
// 离开清空
async closeAll() {
// 销毁实例
- uni.navigateBack();
+ // uni.navigateBack();
await RtcModule.leaveChannel((res) => {
// uni.navigateBack();
})
@@ -710,18 +711,31 @@
// this.closeAll();
var that = this;
uni.hideLoading();
+ // uni.onSocketMessage(function(res) {
+ // console.log(res.data);
+ // var data = JSON.parse(res.data)
+ // // if (call && ) {
+
+ // // }
+ // if (data.type == 'close') {
+
+ // console.log('对方已挂断');
+ // // RtcModule.leaveChannel((res) => {});
+ // that.closeAll();
+ // }
+ // });
uni.onSocketMessage(function(res) {
console.log(res.data);
var data = JSON.parse(res.data)
- // if (call && ) {
-
- // }
- if (data.type == 'close') {
-
- console.log('对方已挂断');
- // RtcModule.leaveChannel((res) => {});
- that.closeAll();
+ if (data.type == 'video') {
+ // this.receiveVideo('Receiver', );
+ console.log('进入接受 跳转', data.type)
+ uni.navigateTo({
+ url: '../videoCall/videoCall?state=Receiver&type=' + data.type + '&room=' + data
+ .roomId + '&name=' + data.name + '&faqiid=' + data.faqiid
+ });
}
+ // console.log('收到服务器内容:' + res.data);
});
}
diff --git a/store/actions.js b/store/actions.js
index 99d89d0..65b75db 100644
--- a/store/actions.js
+++ b/store/actions.js
@@ -102,6 +102,7 @@
// }, 2000)
}
+
}
export default actions
diff --git a/store/mutations.js b/store/mutations.js
index 3fe2f25..3f6911d 100644
--- a/store/mutations.js
+++ b/store/mutations.js
@@ -92,6 +92,20 @@
WxStorage.set("accounts", data.accounts);
WxStorage.set("pass", data.pass);
},
+ // useWebSocket(state){
+ // uni.onSocketMessage(function(res) {
+ // console.log(res.data);
+ // var data = JSON.parse(res.data)
+ // if (data.type == 'video') {
+ // // this.receiveVideo('Receiver', );
+ // console.log('进入接受 跳转',data.type)
+ // uni.navigateTo({
+ // url: '../videoCall/videoCall?state=Receiver&type=' + data.type +'&room=' + data.roomId + '&name=' + data.name + '&faqiid=' + data.faqiid
+ // });
+ // }
+ // // console.log('收到服务器内容:' + res.data);
+ // });
+ // }
loginReset(state) { //重置
state.loging = false;
state.message.useName = '过客 ';
--
Gitblit v1.9.3