合并缺失弥补
This commit is contained in:
parent
1040539640
commit
f887d00a60
@ -5,9 +5,7 @@
|
||||
<view class="patient-info-content">
|
||||
<view class="patient-basic-info">
|
||||
<text class="patient-name">{{ patientInfo.name }}</text>
|
||||
<text class="patient-detail"
|
||||
>{{ patientInfo.sex }} · {{ patientInfo.age }}岁</text
|
||||
>
|
||||
<text class="patient-detail">{{ patientInfo.sex }} · {{ patientInfo.age }}岁</text>
|
||||
</view>
|
||||
<view class="header-actions">
|
||||
<view class="patient-detail-btn" @click="handleViewPatientDetail">
|
||||
@ -21,16 +19,8 @@
|
||||
</view>
|
||||
|
||||
<!-- 聊天消息区域 -->
|
||||
<scroll-view
|
||||
class="chat-content"
|
||||
scroll-y="true"
|
||||
enhanced="true"
|
||||
bounces="false"
|
||||
:scroll-into-view="scrollIntoView"
|
||||
@scroll="onScroll"
|
||||
@scrolltoupper="handleScrollToUpper"
|
||||
ref="chatScrollView"
|
||||
>
|
||||
<scroll-view class="chat-content" scroll-y="true" enhanced="true" bounces="false" :scroll-into-view="scrollIntoView"
|
||||
@scroll="onScroll" @scrolltoupper="handleScrollToUpper" ref="chatScrollView">
|
||||
<!-- 加载更多提示 -->
|
||||
<view class="load-more-tip" v-if="messageList.length >= 15">
|
||||
<view class="loading" v-if="isLoadingMore">
|
||||
@ -46,21 +36,13 @@
|
||||
|
||||
<!-- 聊天消息列表 -->
|
||||
<view class="message-list" @click="closeMorePanel">
|
||||
<view
|
||||
v-for="(message, index) in messageList"
|
||||
:key="message.ID"
|
||||
:id="`msg-${message.ID}`"
|
||||
class="message-item"
|
||||
<view v-for="(message, index) in messageList" :key="message.ID" :id="`msg-${message.ID}`" class="message-item"
|
||||
:class="{
|
||||
'message-right': message.flow === 'out',
|
||||
'message-left': message.flow === 'in',
|
||||
}"
|
||||
>
|
||||
}">
|
||||
<!-- 时间分割线 -->
|
||||
<view
|
||||
v-if="shouldShowTime(message, index, messageList)"
|
||||
class="time-divider"
|
||||
>
|
||||
<view v-if="shouldShowTime(message, index, messageList)" class="time-divider">
|
||||
<text class="time-text">{{ formatTime(message.lastTime) }}</text>
|
||||
</view>
|
||||
|
||||
@ -70,29 +52,18 @@
|
||||
|
||||
<!-- 消息内容 -->
|
||||
<view v-else class="message-content">
|
||||
<image
|
||||
v-if="message.flow === 'in'"
|
||||
class="doctor-msg-avatar"
|
||||
:src="getUserAvatar(message.from)"
|
||||
mode="aspectFill"
|
||||
/>
|
||||
<image
|
||||
v-if="message.flow === 'out'"
|
||||
class="user-msg-avatar"
|
||||
:src="getUserAvatar(message.from)"
|
||||
mode="aspectFill"
|
||||
/>
|
||||
<image v-if="message.flow === 'in'" class="doctor-msg-avatar" :src="getUserAvatar(message.from)"
|
||||
mode="aspectFill" />
|
||||
<image v-if="message.flow === 'out'" class="user-msg-avatar" :src="getUserAvatar(message.from)"
|
||||
mode="aspectFill" />
|
||||
|
||||
<!-- 消息内容区域 -->
|
||||
<view class="message-bubble-container">
|
||||
<!-- 用户名显示 -->
|
||||
<view
|
||||
class="username-label"
|
||||
:class="{
|
||||
<view class="username-label" :class="{
|
||||
left: message.flow === 'in',
|
||||
right: message.flow === 'out',
|
||||
}"
|
||||
>
|
||||
}">
|
||||
<text class="username-text">{{
|
||||
chatMember[message.from]?.name
|
||||
}}</text>
|
||||
@ -100,24 +71,15 @@
|
||||
|
||||
<view class="message-bubble" :class="getBubbleClass(message)">
|
||||
<!-- 消息内容 -->
|
||||
<MessageTypes
|
||||
:message="message"
|
||||
:formatTime="formatTime"
|
||||
:playingVoiceId="playingVoiceId"
|
||||
@playVoice="playVoice"
|
||||
@previewImage="previewImage"
|
||||
@viewDetail="(message) => handleViewDetail(message)"
|
||||
/>
|
||||
<MessageTypes :message="message" :formatTime="formatTime" :playingVoiceId="playingVoiceId"
|
||||
@playVoice="playVoice" @previewImage="previewImage"
|
||||
@viewDetail="(message) => handleViewDetail(message)" />
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<!-- 发送状态 -->
|
||||
<view v-if="message.flow === 'out'" class="message-status">
|
||||
<text
|
||||
v-if="message.status === 'failed'"
|
||||
class="status-text failed"
|
||||
>发送失败</text
|
||||
>
|
||||
<text v-if="message.status === 'failed'" class="status-text failed">发送失败</text>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
@ -125,75 +87,38 @@
|
||||
</scroll-view>
|
||||
|
||||
<!-- 接受问诊组件 -->
|
||||
<ConsultAccept
|
||||
v-if="showConsultAccept"
|
||||
@accept="handleAcceptConsult"
|
||||
@reject="handleRejectConsult"
|
||||
/>
|
||||
<ConsultAccept v-if="showConsultAccept" @accept="handleAcceptConsult" @reject="handleRejectConsult" />
|
||||
|
||||
<!-- 拒绝原因对话框 -->
|
||||
<RejectReasonModal
|
||||
:visible="showRejectReasonModal"
|
||||
@confirm="handleRejectReasonConfirm"
|
||||
@cancel="handleRejectReasonCancel"
|
||||
/>
|
||||
<RejectReasonModal :visible="showRejectReasonModal" @confirm="handleRejectReasonConfirm"
|
||||
@cancel="handleRejectReasonCancel" />
|
||||
|
||||
<!-- 聊天输入组件 -->
|
||||
<ChatInput
|
||||
v-if="!isEvaluationPopupOpen && !showConsultAccept"
|
||||
ref="chatInputRef"
|
||||
:timChatManager="timChatManager"
|
||||
:formatTime="formatTime"
|
||||
:groupId="
|
||||
chatInfo.conversationID
|
||||
<ChatInput v-if="!isEvaluationPopupOpen && !showConsultAccept" ref="chatInputRef" :timChatManager="timChatManager"
|
||||
:formatTime="formatTime" :groupId="chatInfo.conversationID
|
||||
? chatInfo.conversationID.replace('GROUP', '')
|
||||
: ''
|
||||
"
|
||||
:userId="openid"
|
||||
:teamId="teamId"
|
||||
:patientId="patientId"
|
||||
:corpId="corpId"
|
||||
:patientInfo="patientInfo"
|
||||
:orderStatus="orderStatus"
|
||||
:isGenerating="isGenerating"
|
||||
@scrollToBottom="() => scrollToBottom(true)"
|
||||
@messageSent="() => scrollToBottom(true)"
|
||||
@endConsult="handleEndConsult"
|
||||
@openConsult="handleOpenConsult"
|
||||
>
|
||||
" :userId="openid" :teamId="teamId" :patientId="patientId" :corpId="corpId" :patientInfo="patientInfo"
|
||||
:orderStatus="orderStatus" :isGenerating="isGenerating"
|
||||
:canBenefitEntry="isBenefitEntryEnabled"
|
||||
@scrollToBottom="() => scrollToBottom(true)" @messageSent="() => scrollToBottom(true)"
|
||||
@endConsult="handleEndConsult" @openConsult="handleOpenConsult">
|
||||
<!-- AI助手按钮组插槽 -->
|
||||
<template #ai-assistant>
|
||||
<AIAssistantButtons
|
||||
v-if="orderStatus === 'processing'"
|
||||
ref="aiAssistantRef"
|
||||
:groupId="groupId"
|
||||
:patientAccountId="chatInfo.userID || ''"
|
||||
:patientId="patientId"
|
||||
:corpId="corpId"
|
||||
:typeSelectorRef="typeSelectorRef"
|
||||
:progressRef="progressRef"
|
||||
@streamText="handleStreamText"
|
||||
@clearInput="handleClearInput"
|
||||
@generatingStateChange="handleGeneratingStateChange"
|
||||
@caseTypeSelect="handleCaseTypeSelect"
|
||||
@regenerateFromProgress="handleRegenerateFromProgress"
|
||||
@nextFromProgress="handleNextFromProgress"
|
||||
/>
|
||||
<AIAssistantButtons v-if="orderStatus === 'processing'" ref="aiAssistantRef" :groupId="groupId"
|
||||
:patientAccountId="chatInfo.userID || ''" :patientId="patientId" :corpId="corpId"
|
||||
:typeSelectorRef="typeSelectorRef" :progressRef="progressRef" @streamText="handleStreamText"
|
||||
@clearInput="handleClearInput" @generatingStateChange="handleGeneratingStateChange"
|
||||
@caseTypeSelect="handleCaseTypeSelect" @regenerateFromProgress="handleRegenerateFromProgress"
|
||||
@nextFromProgress="handleNextFromProgress" />
|
||||
</template>
|
||||
</ChatInput>
|
||||
|
||||
<!-- 病历类型选择弹窗 -->
|
||||
<MedicalCaseTypeSelector
|
||||
ref="typeSelectorRef"
|
||||
@select="handleCaseTypeSelect"
|
||||
/>
|
||||
<MedicalCaseTypeSelector ref="typeSelectorRef" @select="handleCaseTypeSelect" />
|
||||
|
||||
<!-- 进度显示弹窗 -->
|
||||
<MedicalCaseProgress
|
||||
ref="progressRef"
|
||||
@regenerate="handleRegenerateFromProgress"
|
||||
@next="handleNextFromProgress"
|
||||
/>
|
||||
<MedicalCaseProgress ref="progressRef" @regenerate="handleRegenerateFromProgress" @next="handleNextFromProgress" />
|
||||
</view>
|
||||
</template>
|
||||
|
||||
@ -308,10 +233,11 @@ const env = __VITE_ENV__;
|
||||
const corpId = env.MP_CORP_ID || "";
|
||||
|
||||
// 获取登录状态
|
||||
const accountStore = useAccountStore();
|
||||
const { account, openid, isIMInitialized, doctorInfo } = storeToRefs(
|
||||
useAccountStore()
|
||||
accountStore
|
||||
);
|
||||
const { initIMAfterLogin } = useAccountStore();
|
||||
const { getDoctorInfo, initIMAfterLogin } = useAccountStore();
|
||||
|
||||
// 聊天输入组件引用
|
||||
const chatInputRef = ref(null);
|
||||
@ -358,6 +284,11 @@ const teamId = ref("");
|
||||
// 计算弹框显示状态 - 只有 pending 状态才显示接受问诊组件
|
||||
const showConsultAccept = computed(() => orderStatus.value === "pending");
|
||||
|
||||
const isBenefitEntryEnabled = computed(() => {
|
||||
const value = doctorInfo.value?.benefitEntryEnabled ?? doctorInfo.value?.canBenefitEntry;
|
||||
return value === true || value === 1 || ["true", "1", "yes"].includes(String(value).toLowerCase());
|
||||
});
|
||||
|
||||
// 拒绝原因对话框状态
|
||||
const showRejectReasonModal = ref(false);
|
||||
// 消息列表相关状态
|
||||
@ -905,14 +836,14 @@ const handleScrollToUpper = async () => {
|
||||
};
|
||||
|
||||
// 页面显示
|
||||
onShow(() => {
|
||||
onShow(async () => {
|
||||
if (!account.value || !openid.value) {
|
||||
uni.redirectTo({
|
||||
url: "/pages-center/login/login",
|
||||
});
|
||||
return;
|
||||
}
|
||||
|
||||
await getDoctorInfo();
|
||||
if (!isIMInitialized.value) {
|
||||
checkLoginAndInitTIM();
|
||||
} else if (timChatManager.tim && !timChatManager.isLoggedIn) {
|
||||
@ -1172,8 +1103,7 @@ const handleNextFromProgress = (data) => {
|
||||
|
||||
// 跳转到病历填写页面
|
||||
uni.navigateTo({
|
||||
url: `/pages/case/ai-medical-case-form?caseType=${data.caseType}&patientId=${
|
||||
patientId.value
|
||||
url: `/pages/case/ai-medical-case-form?caseType=${data.caseType}&patientId=${patientId.value
|
||||
}&groupId=${groupId.value}&formData=${encodeURIComponent(
|
||||
JSON.stringify(extractedData)
|
||||
)}`,
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user