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

对接接口

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