提交 e5148557 编写于 作者: xiaoping.di's avatar xiaoping.di

Merge branch 'release' into 'develop'

Release

See merge request !233
......@@ -62,6 +62,13 @@ export const messageHistory = async (data) => {
});
};
export const getOnlineStatus = async (roomId) => {
return request({
url: `/coupler/trtc/room/online/userList?roomId=${roomId}`,
method: 'get',
});
};
export const messageSend = async (data) => {
return request({
url: '/im/team/op/message/send',
......
......@@ -123,6 +123,7 @@
callDirect,
usersigTrtc,
diagnoseEndCall,
getOnlineStatus,
} from '@/api/diagnosis';
export default {
......@@ -159,16 +160,13 @@
answerTime: 0, // 接诊医生接入时长
useTime: 0, // 问诊时长
loseTime: 0, // 问诊剩余时长
askTimeFn: null,
answerTimeFn: null,
useTimeFn: null,
loseTimeFn: null,
timerOfStatus: null,
type: 1, // 1: 语音 2: 视频
startTime: 0,
endTime: 0,
time: 30, // 总时长
memberList: [],
tid: '', // 群id
diagnoseLogId: '', // 问诊id
isMuted: true,
liveInfoSave: {},
......@@ -196,10 +194,11 @@
watch: {
currentChat(newVal, oldVal) {
if (newVal !== oldVal && newVal.imTeamId) {
const { imTeamId, diagnoseLogId } = this.currentChat;
this.tid = imTeamId;
const { diagnoseLogId } = this.currentChat;
this.diagnoseLogId = diagnoseLogId;
this.init();
} else {
clearInterval(this.timerOfStatus);
}
},
},
......@@ -222,6 +221,7 @@
// 获取视频参数
this.getViedoParams();
this.getInfo(); // 获取用户信息列表
this.getOnlineStatus(); // 实时获取用户状态
},
toggleVol() {
if (this.isMuted) {
......@@ -239,7 +239,6 @@
if (data.role == 2 && this.userTrtcEntryStatus != 2) {
return false;
}
console.log('--this.roomId', this.currentChat, data, this.roomId);
const params = {
imAccId: data.accId,
imTeamId: this.currentChat.imTeamId,
......@@ -304,7 +303,6 @@
.catch(() => {
this.$message.error('未获取到相关信息');
this.memberList = [];
// this.getErr();
});
},
// 获取AppId
......@@ -548,21 +546,6 @@
this.muteLocalAudio();
this.rtc.leave();
this.clearSession();
// window.location.href = 'about:blank';
// window.close();
},
// 结束会话
overFn() {
this.$refs.alert
.init({
cancleTxt: '取消',
confirmTxt: '我知道了',
title: '确定要结束会话么?',
})
.then(() => {
this.out();
})
.catch(() => {});
},
out() {
diagnoseEndCall({
......@@ -611,9 +594,6 @@
});
},
clearTime() {
clearInterval(this.askTimeFn);
clearInterval(this.answerTimeFn);
clearInterval(this.useTimeFn);
clearInterval(this.loseTimeFn);
this.isMuted = true;
},
......@@ -629,6 +609,75 @@
checkChrome() {
return getBroswer().broswer == 'Chrome';
},
getOnlineStatus() {
const { roomId } = this.currentChat;
const that = this;
this.timerOfStatus = setInterval(function () {
getOnlineStatus(roomId).then((res) => {
if (!res.data) {
return false;
}
const l = res.data.map((i) => {
return i.userId;
});
// l = [1089725294, 1089728785];
// that.memberList = [
// {
// accId: 'd_3651506947_uat',
// avatarImageUrl: 'https://test-file.yunqueyi.com/File/doctor_default.png',
// id: 1089725294,
// liveUserId: 'd_3651506947_uat_1089725294',
// name: '顾超',
// role: 2,
// status: 3,
// type: 1
// },
// {
// accId: 'd_1909506947_uat',
// avatarImageUrl: 'https://test-file.yunqueyi.com/File/doctor_default.png',
// id: 1089728785,
// liveUserId: 'd_1909506947_uat_1089728785',
// name: '陈影',
// role: 1,
// status: 3,
// type: 1,
// }
// ];
if (
l &&
l.length > 0 &&
that.memberList &&
that.memberList.length > 0
) {
that.memberList.map((i) => {
console.log('res==---', l, i.id, l.includes(i.id));
if (l.includes(i.id)) {
// 在线 更新状态
that.addNewMember(i.liveUserId);
} else {
// 不在线 更新状态
if (i.role == 1 && that.doctorTrtcEntryStatus != 3) {
that.removeMember(i.liveUserId);
}
if (i.role == 2 && that.userTrtcEntryStatus != 3) {
that.removeMember(i.liveUserId);
}
}
});
}else {
if( that.memberList &&
that.memberList.length > 0) {
that.memberList.map( i => {
that.removeMember(i.liveUserId);
});
}
}
});
}, 2000);
},
},
};
</script>
......
......@@ -1128,7 +1128,7 @@
this.userName = row.userName;
this.userNamePhone = row.userMobile;
this.triageDepartment = row.triageDepartment;
this.departmentId = row.departmentId;
this.departmentId = row.triageDepartmentId;
this.diagnosisTimeVisible = true;
this.bizType = 5;
// }
......
Markdown 格式
0% or
您添加了 0 到此讨论。请谨慎行事。
先完成此消息的编辑!
想要评论请 注册