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

合并更改

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