聊天记录

This commit is contained in:
zoujiandong 2023-10-13 16:10:53 +08:00
parent 0e9f9ae85d
commit e5865423c4

View File

@ -170,7 +170,7 @@
<a-form-item field="license_cert" :hide-label="true"> <a-form-item field="license_cert" :hide-label="true">
<div class="phone"> <div class="phone">
<div class="phonecont"> <div class="phonecont">
<a-button class="more" v-if="showMore">点击加载更多</a-button> <a-button class="more" v-if="showMore" @click="loadMore">点击加载更多</a-button>
<div class="nomore" v-else>---没有更多了---</div> <div class="nomore" v-else>---没有更多了---</div>
<div <div
@ -183,37 +183,152 @@
v-for="item in chatlist" v-for="item in chatlist"
:key="item.message_id" :key="item.message_id"
> >
<a-avatar v-if="modalForm.user_doctor.user_id == item.from_user_id && (item.message_type!='TIMCustomElem' || (item.message_type=='TIMCustomElem' && JSON.parse(JSON.parse(item.message_content).Data)
.message_type == 7))">
<img <img
v-if="modalForm.user_doctor.user_id == item.from_user_id"
class="chatAvater"
src="https://img.applets.igandanyiyuan.com/basic/file/patient_avatar.png"
alt=""
/>
<img
v-else="modalForm.user_doctor.user_id == item.from_user_id"
class="chatAvater" class="chatAvater"
:src="modalForm.user_doctor.avatar" :src="modalForm.user_doctor.avatar"
alt="" alt=""
/> />
<div class="msgcon">
</a-avatar>
<a-avatar v-if="modalForm.user_doctor.user_id != item.from_user_id && item.message_type!='TIMCustomElem'">
<img
class="chatAvater"
src="https://img.applets.igandanyiyuan.com/basic/file/patient_avatar.png"
alt=""
/>
</a-avatar>
<div class="msgcon" :class="item.message_type=='TIMCustomElem'?'tipcon':''"
:style="(item.message_type=='TIMCustomElem'&& JSON.parse(JSON.parse(item.message_content).Data)
.message_type == 7)?'margin:6px;':''">
<div class="msgtext" v-if="item.message_type == 'TIMTextElem'"> <div class="msgtext" v-if="item.message_type == 'TIMTextElem'">
{{ JSON.parse(item.message_content).Text }} {{ JSON.parse(item.message_content).Text }}
</div> </div>
<div class="msgtext" v-if="item.message_type == 'TIMImageElem'">
<a-image width="200" :src="(JSON.parse(item.message_content).ImageInfoArray)[0].URL" :preview-props="{
actionsLayout: ['rotateRight', 'zoomIn', 'zoomOut'],
}" />
</div>
<div <div
class="msgtext" class="msgtext"
v-else-if="item.message_type == 'TIMCustomElem'" v-else-if="item.message_type == 'TIMCustomElem'"
:class="JSON.parse(JSON.parse(item.message_content).Data)
.message_type == 7?'otherColor':''"
> >
<div <div
v-if=" v-if="
JSON.parse(JSON.parse(item.message_content).Data)
.message_type == 1
"
class="text"
>
{{ JSON.parse(JSON.parse(item.message_content).Data)
.title}}
</div>
<div
v-else-if="
JSON.parse(JSON.parse(item.message_content).Data) JSON.parse(JSON.parse(item.message_content).Data)
.message_type == 2 .message_type == 2
" "
class="text" class="text"
> >
222 系统推送评价消息
</div>
<div
v-else-if="
JSON.parse(JSON.parse(item.message_content).Data)
.message_type == 3
"
class="text"
>
系统推送医生端系统通知
</div>
<div
v-else-if="
JSON.parse(JSON.parse(item.message_content).Data)
.message_type == 4
"
class="text"
>
系统推送医生端服务通知
</div>
<div
v-else-if="
JSON.parse(JSON.parse(item.message_content).Data)
.message_type == 5
"
class="text"
>
系统推送患者端系统消息
</div>
<div
v-else-if="
JSON.parse(JSON.parse(item.message_content).Data)
.message_type == 6
"
class="text"
>
药师审核中
</div>
<div
v-else-if="
JSON.parse(JSON.parse(item.message_content).Data)
.message_type == 7
"
class="text"
>
<div class="chufangbox">
<div class="title">处方已开具</div>
<div class="productbox">
<div class="row">
<div class="name">RP</div>
<div class="desc">{{ JSON.parse(JSON.parse(item.message_content).Data)
.data.product_name }}</div>
</div>
<div class="row">
<div class="name">开方日期</div>
<div class="desc">{{JSON.parse(JSON.parse(item.message_content).Data)
.data.pharmacist_verify_time}}</div>
</div>
</div>
</div>
</div>
<div
v-else-if="
JSON.parse(JSON.parse(item.message_content).Data)
.message_type == 10
"
class="text"
>
系统推送糖组检测报告
</div>
<div
v-else-if="
JSON.parse(JSON.parse(item.message_content).Data)
.message_type == 11
"
class="text"
>
系统推送患者病例
</div>
<div
v-else-if="
JSON.parse(JSON.parse(item.message_content).Data)
.message_type == 11
"
class="text"
>
系统推送患者信息
</div> </div>
</div> </div>
<div class="date">{{ item.created_at }}</div> <div class="date" v-if="item.message_type != 'TIMCustomElem'">{{ parseTime(item.message_send_time) }}</div>
</div> </div>
</div> </div>
</div> </div>
@ -335,8 +450,10 @@ const HandleGetIm = async (id, params = {}) => {
const { code, data } = await getIm(id, params); const { code, data } = await getIm(id, params);
if (code == 200) { if (code == 200) {
if (chatlist.value < 10) { if ( data.data.length < 10) {
showMore.value = false; showMore.value = false;
}else{
showMore.value = true;
} }
chatlist.value = data.data.reverse().concat(chatlist.value); chatlist.value = data.data.reverse().concat(chatlist.value);
if(!firstIn.value){ if(!firstIn.value){
@ -379,6 +496,12 @@ const openDcotor = () => {
const handleClose = () => { const handleClose = () => {
emits('inquiryVisibleChange', (modalVisible.value = false)); emits('inquiryVisibleChange', (modalVisible.value = false));
}; };
const loadMore=()=>{
pager.page= pager.page+1;
let id=props.modalForm.order_inquiry_case.inquiry_case_id
HandleGetIm(id, { ...pager });
}
</script> </script>
<style scoped> <style scoped>
.more { .more {
@ -412,7 +535,7 @@ const handleClose = () => {
background: #111; background: #111;
border-radius: 55px; border-radius: 55px;
box-shadow: 0px 0px 0px 2px #aaa; box-shadow: 0px 0px 0px 2px #aaa;
width: 320px; width: 360px;
height: 480px; height: 480px;
padding: 105px 25px 60px; padding: 105px 25px 60px;
-webkit-box-sizing: content-box; -webkit-box-sizing: content-box;
@ -451,12 +574,23 @@ const handleClose = () => {
flex-direction: row; flex-direction: row;
justify-content: flex-start; justify-content: flex-start;
} }
.phonecont .msgtext { .phonecont .msgtext {
max-width: 80vw; max-width: 80vw;
border-radius: 5px; border-radius: 5px;
padding: 5px 8px; padding: 5px 8px;
word-break: break-all;
color: var(--color-text-1);
background: #efefef; background: #efefef;
} }
.patientmsg .msgtext{
background: #3CC7C0;
color:#fff;
}
.msgbox .msgcon { .msgbox .msgcon {
margin-right: 6px; margin-right: 6px;
} }
@ -467,4 +601,45 @@ const handleClose = () => {
font-size: 12px; font-size: 12px;
color: #666; color: #666;
} }
.patientmsg .tipcon{
width:88%;
margin:0 auto;
text-align: center;
}
.tipcon .msgtext{
color: var(--color-text-1);
background: #efefef;
}
.phonecont .otherColor{
background: #3CC7C0;
color:#fff;
}
.tipcon .msgtext{
padding:0px;
font-size: 15px;
}
.chufangbox{
margin:0 20px;
}
.productbox .row{
display: flex;
align-items: center;
}
.chufangbox .title{
padding: 8px 0;
border-bottom:1px solid #E7E7E7;;
}
.productbox{
padding: 8px 0;
}
.productbox .row .name{
color:#fff;
}
.desc{
line-height: 28px;
color:#fff;
font-size: 15px;
}
</style> </style>