提交 2ac9f319 编写于 作者: lyf's avatar lyf

合并更改

......@@ -84,11 +84,9 @@ export default {
watch: {
currentChat(newVal, oldVal) {
if(newVal !== oldVal && newVal.imTeamId){
const {imTeamId, diagnoseLogId, doctorTrtcEntryStatus, userTrtcEntryStatus} = this.currentChat;
const {imTeamId, diagnoseLogId,} = this.currentChat;
this.tid = imTeamId;
this.diagnoseLogId = diagnoseLogId;
// this.doctorTrtcEntryStatus = doctorTrtcEntryStatus;
// this.userTrtcEntryStatus = userTrtcEntryStatus;
this.init();
}
}
......@@ -316,7 +314,6 @@ export default {
.then(() => {
Promise.all([this.rtc.join()]).then((res) => {
this.ispending();
this.muteLocalAudio();
let t = setTimeout(() => {
closeLoading(this);
this.muteLocalAudio();
......
......@@ -82,7 +82,7 @@
</div>
</div>
<div class="line-btn" @click="openChat">
<span v-if="userCallKfStatus == 1">正在呼叫医助,进入诊室</span>
<span v-if="userCallKfStatus == 1||doctorCallKfStatus==1">正在呼叫医助,进入诊室</span>
<span v-else>进入诊室</span>
</div>
</div>
......@@ -541,7 +541,6 @@ export default {
.call-status {
width: 45px;
height: 46px;
img {
cursor: pointer;
width: 45px;
......
// ES6 import
import store from '../';
import storejs from 'storejs';
import io from 'socket.io-client';
let socketTimer = null;
export default {
namespaced: true,
state: {
socketClient: null
socketClient: null,
},
actions: {
initSocket ({ commit, rootState }, payload) {
const socket = io.connect(payload.url, {
query: {
loginUserNum: `diagnose_list_socket_${payload.userId}`
// loginUserNum: `diagnose_list_socket_888`
}
});
commit('SET_SOCKET', socket);
......@@ -29,14 +30,19 @@ export default {
if(!state.socketClient){
return false;
}
state.socketClient.on("connection", (socket) => {
state.socketClient.on("connect", (socket) => {
console.log ('socket 链接成功',socket);
console.log ('socketTimer---',socketTimer);
if(socketTimer){
clearInterval(socketTimer);
}
});
state.socketClient.on("connect_error", (err) => {
console.log ('socket connect_error',err);
});
state.socketClient.on("disconnect", (socket) => {
console.log ('socket disconnect',socket);
console.log ('socket disconnect----',socket);
store.commit('socket/RECONNECT_SOCKET');
});
state.socketClient.on("diagnose_push_event", (socket) => {
console.log('diagnose_push_event---', socket);
......@@ -76,11 +82,16 @@ export default {
let doms = document.getElementsByClassName('el-notification')
if (doms.length >= 5) return
const h = _VM.$createElement;
const t = payload.department ? `问诊单${payload.diagnoseLogId}(${payload.department})` : `问诊单${payload.diagnoseLogId}`
// userCallKfStatus 医助呼叫
// doctorCallKfStatus 医生呼叫
let name= payload.userCallKfStatus==1 ? payload.userName:payload.doctorName
const cn = _VM.$notify({
title: t,
message: h("p", [
h("i", {style: `color: teal;`}, `${payload.userName}正在呼叫你`),
h("i", {style: `color: teal;`}, `${name}正在呼叫你`),
h(
"el-button",
{
......@@ -110,6 +121,13 @@ export default {
duration: 5000,
position: 'top-right',
})
},
RECONNECT_SOCKET: (state, payload) => {
socketTimer = setInterval(function (){
const i = storejs.get('initSocketInfo');
console.log('----initSocketInfo', i);
store.dispatch( 'socket/initSocket', i)
}, 2000);
}
},
};
......@@ -198,8 +198,6 @@ class RtcClient {
//对于本地流,调用该方法会触发远端 Client.on('unmute-audio') 事件。
//音频轨道默认是开启的,若你调用 muteAudio() 后可用该方法重新启用音频。
unmuteLocalAudio() {
const a = this.localStream_.getAudioTrack();
console.log('---a',a);
this.localStream_.unmuteAudio();
}
......@@ -251,7 +249,7 @@ class RtcClient {
this.client_.on('peer-leave', evt => {
const userId = evt.userId;
console.log('有远程同伴离开房间:' + userId);
this.remove(userId)
this.removeUserList(userId)
});
......@@ -345,7 +343,7 @@ class RtcClient {
this.remoteStreams_ = this.remoteStreams_.filter(stream => {
return stream.getId() !== id;
});
this.remove(uid)
this.removeUserList(uid)
});
// 流更新
......@@ -401,7 +399,7 @@ class RtcClient {
}
// 移除视频数组
remove(userId) {
removeUserList(userId) {
for(let i = 0; i < this.viewslist.length; i++) {
if (this.viewslist[i] && this.viewslist[i].userId == userId) {
this.viewslist[i] = null
......
......@@ -267,7 +267,7 @@ export default {
}
.workbench-container {
min-width: 1250px;
min-width: 1200px;
.select-content {
padding: 0 20px;
background: #fff;
......
......@@ -32,6 +32,7 @@
</template>
<script>
import { getInnerLoginUrl } from "../../utils";
import storejs from 'storejs';
const BUILD_ENV = process.env.BUILD_ENV;
let vm = null;
export default {
......@@ -81,6 +82,7 @@ export default {
userID: userId
};
const u = this.getSocketUrl(BUILD_ENV);
storejs.set('initSocketInfo', {url: u,userId: userId});
this.$store.dispatch( 'socket/initSocket',{url: u,userId: userId})
vueMenuDtos.map( item => {
if(item.index.indexOf('administrators') > -1){
......
Markdown 格式
0% or
您添加了 0 到此讨论。请谨慎行事。
先完成此消息的编辑!
想要评论请 注册