From ca03f17f289c81ca8a68debe6c798d621f989915 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=8E=E7=90=A6?= Date: Mon, 26 Jan 2026 16:22:16 +0800 Subject: [PATCH] =?UTF-8?q?=E5=9C=A8=E7=BA=BF=E9=97=AE=E8=AF=8A=E9=BB=98?= =?UTF-8?q?=E8=AE=A4=E4=B8=8D=E8=83=BD=E9=80=89=E6=8B=A9=E5=88=B0=E5=BA=97?= =?UTF-8?q?=EF=BC=8C=E8=81=8A=E5=A4=A9UI=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- subPackages/chat/chat.vue | 20 ++++++++++++++------ 1 file changed, 14 insertions(+), 6 deletions(-) diff --git a/subPackages/chat/chat.vue b/subPackages/chat/chat.vue index f73956e..36808dd 100644 --- a/subPackages/chat/chat.vue +++ b/subPackages/chat/chat.vue @@ -22,15 +22,15 @@ 职称 - 主任医师 + {{ doctorDetailInfo.title || '--' }} 医院 - 北京协和医院 + {{ doctorDetailInfo.hospital || '--' }} 擅长 - 冠心病、高血压、心力衰竭、心律失常的诊断与药物治疗 + {{ doctorDetailInfo.good_at || '--' }} @@ -185,6 +185,7 @@ export default { data() { return { doctorUserInfo: { id: 0, avatar: '', nick_name: '医生', room_id: '' }, + doctorDetailInfo: { title: '', hospital: '', good_at: '' }, // 医生详情信息 showDoctorDetail: false, currentUserId: '', doctorId: 'doctor-1', @@ -236,10 +237,11 @@ export default { if (option.room_id) this.fetchRoomStatus(option.room_id); + // 无论是否有nickName,都需要获取医生详情信息(职称、医院、擅长) + this.fetchDoctorInfo(doctorId); + const nickName = this.doctorUserInfo.nick_name; - if (!nickName || nickName === 'undefined' || nickName === 'null') { - this.fetchDoctorInfo(doctorId); - } else { + if (nickName && nickName !== 'undefined' && nickName !== 'null') { uni.setNavigationBarTitle({ title: `与${nickName}医生的对话` }); } @@ -365,6 +367,12 @@ export default { nick_name: doctorInfo.nick_name || '医生', avatar: doctorInfo.avatar || this.doctorAvatar, }; + // 保存完整的医生详情信息 + this.doctorDetailInfo = { + title: doctorInfo.title || '', + hospital: doctorInfo.hospital || '', + good_at: doctorInfo.good_at || '' + }; if (doctorInfo.avatar) this.doctorAvatar = doctorInfo.avatar; uni.setNavigationBarTitle({ title: `与${this.doctorUserInfo.nick_name}医生的对话` }); }