fix: 聊天(已实现图文消息对话)

This commit is contained in:
2025-07-25 15:59:33 +08:00
parent 866d9ae083
commit 53c29e93a6
12 changed files with 539 additions and 306 deletions

View File

@@ -124,9 +124,9 @@
<view class="img">
<image :src="item.avatar" mode=""></image>
</view>
<u-badge size="default" v-if="item.un_read_num>=0" :count="item.un_read_num"
:is-dot="item.un_read_num==0?true:false"
type="error" :offset="item.un_read_num>0?[-4,-8]:[0,0]"></u-badge>
<u-badge size="default" v-if="item.un_read_count>=0" :count="item.un_read_count"
:is-dot="item.un_read_count==0?true:false"
type="error" :offset="item.un_read_count>0?[-4,-8]:[0,0]"></u-badge>
</view>
<!-- 描述 -->
<view class="info">
@@ -136,7 +136,7 @@
</view>
<view class="preview">
<p>{{ item.last_message }}</p>
<!-- <p v-if="item.un_read_num>0">您有{{item.un_read_num}}条新的消息</p>-->
<!-- <p v-if="item.un_read_count>0">您有{{item.un_read_count}}条新的消息</p>-->
</view>
<view class="preview" v-if="item.last_message===''">
暂无新消息
@@ -151,6 +151,7 @@ import {
getseesionInfo,
getseesionRead
} from '../../request/api/api'
import {getChatFriendsListApi} from "@/request/api/im";
export default {
data() {
@@ -158,108 +159,7 @@ export default {
order: [],
system: [],
doctor: [],
imChat: [
{
id: 'doctor-39',
room_id: 'xk_chat_room_68786b4fd071233eb15dfa3e62c1',
nick_name: '李二狗',
avatar: 'https://xiaokang88.oss-cn-hangzhou.aliyuncs.com/xk_upload_20250108/29bdb9560340373bb3096394a845afa5.jpg',
un_read_num: 99,
last_message: '多喝水即可',
last_message_time: '2021-07-05 09:05:05'
},
{
id: 'doctor-2',
room_id: 'xk_chat_room_68786b4fd071233eb15dfa3e62c1',
nick_name: '王三三',
avatar: '/static/xx/ysxx.png',
un_read_num: 0,
last_message: '[图片]',
last_message_time: '2021-07-05 09:05:05'
},
{
id: 'doctor-3',
room_id: 'xk_chat_room_68786b4fd071233eb15dfa3e62c1',
nick_name: '王五五',
avatar: '/static/xx/ysxx.png',
un_read_num: 0,
last_message: '[图片]',
last_message_time: '2021-07-05 09:05:05'
},
{
id: 'doctor-4',
room_id: 'xk_chat_room_68786b4fd071233eb15dfa3e62c1',
nick_name: '王六六',
avatar: '/static/xx/ysxx.png',
un_read_num: 0,
last_message: '[图片]',
last_message_time: '2021-07-05 09:05:05'
},
{
id: 'doctor-5',
room_id: 'xk_chat_room_68786b4fd071233eb15dfa3e62c1',
nick_name: '王六六1',
avatar: '/static/xx/ysxx.png',
un_read_num: 0,
last_message: '[音频]',
last_message_time: '2021-07-05 09:05:05'
},
{
id: 'doctor-6',
room_id: 'xk_chat_room_68786b4fd071233eb15dfa3e62c1',
nick_name: '王六六2',
avatar: '/static/xx/ysxx.png',
un_read_num: 0,
last_message: '[视频]',
last_message_time: '2021-07-05 09:05:05'
},
{
id: 'doctor-7',
room_id: 'xk_chat_room_68786b4fd071233eb15dfa3e62c1',
nick_name: '王六六3',
avatar: '/static/xx/ysxx.png',
un_read_num: 0,
last_message: '[文件]',
last_message_time: '2021-07-05 09:05:05'
},
{
id: 'doctor-8',
room_id: 'xk_chat_room_68786b4fd071233eb15dfa3e62c1',
nick_name: '王六六',
avatar: '/static/xx/ysxx.png',
un_read_num: 0,
last_message: '[图片]',
last_message_time: '2021-07-05 09:05:05'
},
{
id: 'doctor-9',
room_id: 'xk_chat_room_68786b4fd071233eb15dfa3e62c1',
nick_name: '王六六1',
avatar: '/static/xx/ysxx.png',
un_read_num: 0,
last_message: '[音频]',
last_message_time: '2021-07-05 09:05:05'
},
{
id: 'doctor-10',
room_id: 'xk_chat_room_68786b4fd071233eb15dfa3e62c1',
nick_name: '王六六2',
avatar: '/static/xx/ysxx.png',
un_read_num: 0,
last_message: '[视频]',
last_message_time: '2021-07-05 09:05:05'
},
{
id: 'doctor-11',
room_id: 'xk_chat_room_68786b4fd071233eb15dfa3e62c1',
nick_name: '王六六3',
avatar: '/static/xx/ysxx.png',
un_read_num: 0,
last_message: '[文件]',
last_message_time: '2021-07-05 09:05:05'
},
],
imChat: [],
type: ""
}
},
@@ -357,6 +257,11 @@ export default {
this.system = res.data.data.system
this.doctor = res.data.data.doctor_news
})
},
getMyChatFriendsList() {
getChatFriendsListApi().then((res) => {
this.imChat = res.data.result
})
}
},
mounted() {
@@ -367,6 +272,7 @@ export default {
this.system = []
this.doctor = []
this.getInfo()
this.getMyChatFriendsList()
}
}
</script>