提交 34efae87 编写于 作者: guangjun.yang's avatar guangjun.yang

对接接口

上级 5d9387e8
<template>
<section class="user-info-wrapper">
<div class="user-avt">
<img src="../../assets/image/img.jpg" alt />
<img :src="userInfo.avatarImageUrl" alt />
</div>
<p class="user-name">{{userInfo.name}}</p>
<p class="user-mb">{{userInfo.mobilePhone}}</p>
......@@ -9,7 +9,6 @@
<el-button
class="footer"
style="width: 100px;"
v-if="userInfo.isShowCopyBtn"
type="primary"
size="small"
@click="clipboardAction"
......@@ -20,19 +19,19 @@
<div class="icon">
<img src="../../assets/image/IM/icon-contacts.png" alt />
</div>
<span class="desc">医生</span>
<span class="desc">{{userInfo.userTypeValue}}</span>
</article>
<article class="other-info">
<div class="icon">
<img src="../../assets/image/IM/icon-id-card.png" alt />
</div>
<div class="icon-s">
<img v-if="true" src="../../assets/image/IM/check-yes.png" alt />
<img v-if="userInfo.certifyStatus" src="../../assets/image/IM/check-yes.png" alt />
<img v-else src="../../assets/image/IM/check-no.png" alt />
</div>
<span class="desc mr12">实名认证</span>
<div class="icon-s">
<img v-if="false" src="../../assets/image/IM/check-yes.png" alt />
<img v-if="userInfo.status" src="../../assets/image/IM/check-yes.png" alt />
<img v-else src="../../assets/image/IM/check-no.png" alt />
</div>
<span class="desc">执业认证</span>
......@@ -41,17 +40,24 @@
<div class="icon">
<img src="../../assets/image/IM/icon-org.png" alt />
</div>
<span class="desc">无机构</span>
<span class="desc">{{userInfo.hospitalName}}</span>
</article>
</section>
<section class="qt-wrapper">
<p class="title">问题归类</p>
<el-select style="width:100%;" multiple v-model="questionType" size="mini" placeholder="请选择问题分类">
<el-select
style="width:100%;"
multiple
v-model="stickerIdList"
size="mini"
placeholder="请选择问题分类"
@visible-change="stickerSave"
>
<el-option
v-for="(item, index) in questionTypeOptions"
v-for="(item, index) in stickerList"
:key="index"
:label="item.label"
:value="item.value"
:label="item.name"
:value="item.id"
></el-option>
</el-select>
</section>
......@@ -70,40 +76,65 @@ export default {
isShowCopyBtn: true
};
}
},
taskLogId: {
type: String | Number,
default: ''
}
},
data() {
return {
questionType: '',
questionTypeOptions: [
{
label: '未选中1',
value: 1
},
{
label: '未选中2',
value: 2
stickerList: [],
stickerIdList: []
};
},
{
label: '未选中3',
value: 3
created() {
this.getStickerList();
},
{
label: '未选中4',
value: 4
methods: {
// 查询所有的问题分类
getStickerList() {
this.GET(`/im/sticker/list`).then(res => {
if (res.code === "000000") {
console.log("in getStickerList", res);
this.stickerList = res.data || [];
} else {
this.$message({
message: res.message,
type: "warning"
});
}
});
},
]
};
// 保存用户问题分类
stickerSave(status) {
if(status || !this.stickerIdList.length) return;
let params = {
stickerIdList: this.stickerIdList,
taskLogId: this.taskLogId,
}
this.POST(`/im/sticker/save`, params).then(res => {
if (res.code === "000000") {
console.log("in getStickerSave", res);
} else {
this.$message({
message: res.message,
type: "warning"
});
}
});
},
methods: {
// 粘帖文本
clipboardAction() {
const _this = this;
clipboard && clipboard.destroy(); // 不是单例的,所以每次都要销毁
clipboard = new this.ClipboardJS('.footer', { // .footer:文档的CSS类名
clipboard = new this.ClipboardJS(".footer", {
// .footer:文档的CSS类名
text: function(trigger) {
console.log(_this.userInfo.mobilePhone);
return _this.userInfo.mobilePhone; // 要粘贴的文案
console.log(_this.userInfo.mobilePhoneCopy);
return _this.userInfo.mobilePhoneCopy; // 要粘贴的文案
}
});
}
......
......@@ -9,37 +9,25 @@
</div>
<p class="c-num">当前等待会话:4个</p>
<ul class="session-list" :style="{'height': containerHeight + 'px'}">
<li class="item current">
<div class="img-wrapper">
<img src="../../../assets/image/img.jpg" alt />
</div>
<div class="desc">
<p class="top">
<span class="name">公华</span>
<span class="time small">19:20</span>
</p>
<p class="bottom">少即是多</p>
</div>
</li>
<li
class="item"
v-for="(session, index) in [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11]"
class="item" :class="{'current': currentTaskLogId == session.id}"
v-for="(session, index) in sessionListData.sessionList"
:key="index"
@click="selectSession(session)"
>
<div class="img-wrapper">
<img src="../../../assets/image/img.jpg" alt />
<img :src="session.avatarImageUrl" alt />
</div>
<div class="desc">
<div class="top">
<span class="name">公华</span>
<span class="time small">19:20</span>
<span class="name">{{session.toName}}</span>
<span class="time small">{{session.lastMsgTime}}</span>
</div>
<div class="bottom">
<span>少即是多</span>
<span v-show="true" class="num">5</span>
<span>{{session.lastMsgContent}}</span>
<span v-show="session.status !=3 && currentTaskLogId != session.id && session.unreadCount" class="num">{{session.unreadCount}}</span>
<img
v-show="false"
v-show="session.status == 3"
src="../../../assets/image/IM/icon-exit.png"
@click.stop="exitSession(session)"
/>
......@@ -52,7 +40,7 @@
<section class="c-header">
<div class="c-header-l">
<img src="../../../assets/image/img.jpg" alt />
<span class="name">杨Song</span>
<span class="name">{{doctorInfo.name}}</span>
<span class="time-tip">当前会话时长:3分08秒</span>
</div>
<!-- <span class="close-btn">结束会话</span> -->
......@@ -123,7 +111,7 @@
</section>
</article>
<article class="right">
<UserInfo :userInfo="userInfo"></UserInfo>
<UserInfo :userInfo="doctorInfo" :taskLogId="currentTaskLogId"></UserInfo>
</article>
</section>
......@@ -198,8 +186,10 @@ export default {
sessionList: [],
waitingTaskCount: 0
},
userInfo: {
// currentSessionIndex: 0, // 当前会话序号
currentTaskLogId: 0, // 当前会话ID
currentToAccId: 0,
doctorInfo: {
name: "杨Song",
mobilePhone: "138****7261",
isShowCopyBtn: true
......@@ -377,10 +367,13 @@ export default {
return !!this.text;
}
},
created() {
this.getSessionList();
},
mounted: function() {},
methods: {
// 发送带链接消息
sendLinkMsg() {
......@@ -398,6 +391,9 @@ export default {
// 打开一个会话
selectSession(session) {
console.log("selectSession");
this.currentTaskLogId = session.id;
this.currentToAccId = session.toAccId;
this.getDoctorinfo(this.currentToAccId);
},
// 关闭一个会话
......@@ -460,6 +456,20 @@ export default {
});
},
// 获取消息(准实时消息,历史消息等)
getMessageList() {
this.GET("/im/session/kf/msgList").then(res => {
if (res.code === "000000") {
console.log("in getMessageList", res);
} else {
this.$message({
message: res.message,
type: "warning"
});
}
});
},
// 获取会话列表
getSessionList() {
this.GET("/im/session/kf/list").then(res => {
......@@ -470,6 +480,11 @@ export default {
sessionList: [],
waitingTaskCount: 0
};
if(!this.currentTaskLogId && this.sessionListData.sessionList.length) {
this.currentTaskLogId = this.sessionListData.sessionList[0].id;
this.currentToAccId = this.sessionListData.sessionList[0].toAccId;
this.getDoctorinfo(this.currentToAccId);
}
} else {
this.$message({
message: res.message,
......@@ -481,10 +496,10 @@ export default {
// 根据云信id获取医生信息
getDoctorinfo(accId) {
this.GET(`/im/account/accid/doctorinfo?accId=${accId}`).then(res => {
this.GET(`/im/account/accid/doctorinfo?accId=${accId}`).then( res => {
if (res.code === "000000") {
console.log("in getDoctorinfo", res);
// this.$router.push({ path: `/current-session-list` });
console.log("in getDoctorinfo", res.data);
this.doctorInfo = res.data || {};
} else {
this.$message({
message: res.message,
......@@ -492,7 +507,26 @@ export default {
});
}
});
},
// 关闭一个任务
closeOneTask(taskLogId) {
let params = {
taskLogId
}
this.POST(`/im/session/kf/closeOneTask`, params).then(res => {
if (res.code === "000000") {
console.log("in closeOneTask", res);
} else {
this.$message({
message: res.message,
type: "warning"
});
}
});
},
}
};
</script>
......
Markdown 格式
0% or
您添加了 0 到此讨论。请谨慎行事。
先完成此消息的编辑!
想要评论请 注册