feat(escort): 记录详情页陪诊需求改为病历与诉求并支持编辑保存
This commit is contained in:
@@ -34,7 +34,8 @@ Page({
|
||||
loadError: '',
|
||||
// 编辑全部收进底部弹窗:页面只读,表单只活在弹窗里,两个弹窗各自一个开关
|
||||
showNotePopup: false,
|
||||
editPatientNote: '',
|
||||
editMedicalHistory: '',
|
||||
editDemand: '',
|
||||
// 医院预约规则与下单页一致,均由订单关联的服务目录下发
|
||||
showHospitalPopup: false,
|
||||
provinces: [],
|
||||
@@ -279,6 +280,8 @@ Page({
|
||||
canPay,
|
||||
canSwitchPayChannel,
|
||||
patientNote: item.notes?.patientNote || '',
|
||||
medicalHistory: item.inquiry?.medicalHistory || '',
|
||||
demand: item.inquiry?.demand || '',
|
||||
escortNote: item.notes?.escortNote || '',
|
||||
medicalSummary: item.notes?.medicalSummary || '',
|
||||
status: displayStatus,
|
||||
@@ -450,28 +453,35 @@ Page({
|
||||
})
|
||||
},
|
||||
|
||||
// ===== 陪诊需求编辑(底部弹窗) =====
|
||||
// ===== 病历与诉求编辑(底部弹窗) =====
|
||||
|
||||
onEditPatientNote() {
|
||||
onEditInquiry() {
|
||||
this.setData({
|
||||
showNotePopup: true,
|
||||
editPatientNote: this.data.record.patientNote || ''
|
||||
editMedicalHistory: this.data.record.medicalHistory || '',
|
||||
editDemand: this.data.record.demand || ''
|
||||
})
|
||||
},
|
||||
|
||||
onPatientNoteInput(e) {
|
||||
this.setData({ editPatientNote: e.detail.value })
|
||||
onMedicalHistoryInput(e) {
|
||||
this.setData({ editMedicalHistory: e.detail.value })
|
||||
},
|
||||
|
||||
onDemandInput(e) {
|
||||
this.setData({ editDemand: e.detail.value })
|
||||
},
|
||||
|
||||
onCancelEdit() {
|
||||
this.setData({ showNotePopup: false })
|
||||
},
|
||||
|
||||
onSavePatientNote() {
|
||||
const note = this.data.editPatientNote.trim()
|
||||
onSaveInquiry() {
|
||||
const medicalHistory = this.data.editMedicalHistory.trim()
|
||||
const demand = this.data.editDemand.trim()
|
||||
wx.showLoading({ title: '保存中...' })
|
||||
API.escort.updateRecord(this.data.recordId, {
|
||||
'notes.patientNote': note
|
||||
'inquiry.medicalHistory': medicalHistory,
|
||||
'inquiry.demand': demand
|
||||
})
|
||||
.then((res) => {
|
||||
wx.hideLoading()
|
||||
@@ -479,7 +489,8 @@ Page({
|
||||
wx.showToast({ title: '保存成功', icon: 'success' })
|
||||
this.setData({
|
||||
showNotePopup: false,
|
||||
'record.patientNote': note
|
||||
'record.medicalHistory': medicalHistory,
|
||||
'record.demand': demand
|
||||
})
|
||||
} else {
|
||||
wx.showToast({ title: res.msg || '保存失败', icon: 'none' })
|
||||
|
||||
@@ -111,7 +111,9 @@
|
||||
aria-role="button"
|
||||
aria-label="拨打就诊人电话"
|
||||
bindtap="onCallPatient"
|
||||
>拨打</view>
|
||||
>
|
||||
<t-icon name="call" size="36rpx" color="#9B4508" />
|
||||
</view>
|
||||
</view>
|
||||
<view class="appt-row">
|
||||
<text class="appt-label">服务</text>
|
||||
@@ -120,8 +122,7 @@
|
||||
<text class="appt-text" wx:if="{{record.sexRequirementText}}"> · 性别要求{{record.sexRequirementText}}</text>
|
||||
</view>
|
||||
</view>
|
||||
<!-- 预约备注:客户下单时的原话,家属核对「当时交代了什么」靠它;
|
||||
无备注不占行位 -->
|
||||
<!-- 备注:下单时填写的原话,与「病历与诉求」是两个字段;无备注不占行位 -->
|
||||
<view class="appt-row" wx:if="{{record.patientNote}}">
|
||||
<text class="appt-label">备注</text>
|
||||
<view class="appt-value">
|
||||
@@ -175,36 +176,6 @@
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<!-- 费用与支付:收在卡底单独一组,先看病信息再谈钱 -->
|
||||
<view class="pay-group">
|
||||
<!-- 费用:标签与金额同行对齐;支付状态胶囊收在行尾 -->
|
||||
<view class="fee-line">
|
||||
<text class="appt-label">费用</text>
|
||||
<text class="fee-amount">¥{{record.totalFee}}</text>
|
||||
<view class="fee-side">
|
||||
<view
|
||||
class="status-chip"
|
||||
wx:if="{{record.paymentStatus !== 'paid'}}"
|
||||
style="background: {{record.paymentStatusBg}}; color: {{record.paymentStatusColor}}; border-color: {{record.paymentStatusBorder}};"
|
||||
>{{record.paymentStatusText}}</view>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<!-- 支付渠道:仅待支付期间可切换;线下支付由平台收款后补记实际方式 -->
|
||||
<view
|
||||
class="pay-switch"
|
||||
wx:if="{{record.canSwitchPayChannel}}"
|
||||
aria-role="button"
|
||||
aria-label="切换支付方式"
|
||||
bindtap="onSwitchPayChannel"
|
||||
>
|
||||
<text class="pay-switch-label">支付方式</text>
|
||||
<text class="pay-switch-value">{{record.payChannelText}}</text>
|
||||
<text class="pay-switch-action">切换</text>
|
||||
<t-icon name="chevron-right" size="24rpx" color="#6F655C" />
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<!-- 陪诊师卡片:已派单显示名与电话;派单正常时后台会写姓名,
|
||||
@@ -237,20 +208,24 @@
|
||||
|
||||
<!-- 有内容才铺正文;可编辑但内容为空时只留一个添加入口,不让空卡占位。
|
||||
已完成订单的陪诊记录和就诊摘要直接展示,不收入展开区 -->
|
||||
<view class="section note-section" wx:if="{{record.patientNote || record.escortNote || record.medicalSummary || record.canEditNote}}">
|
||||
<view class="section note-section" wx:if="{{record.medicalHistory || record.demand || record.escortNote || record.medicalSummary || record.canEditNote}}">
|
||||
<view class="section-head">
|
||||
<view class="section-bar"></view>
|
||||
<text class="section-title">{{record.status === 'completed' && (record.escortNote || record.medicalSummary) ? '服务结果' : (record.escortNote || record.medicalSummary ? '陪诊需求与记录' : '陪诊需求')}}</text>
|
||||
<view class="section-link" wx:if="{{record.canEditNote && (record.patientNote || record.escortNote || record.medicalSummary)}}" bindtap="onEditPatientNote">
|
||||
<text class="section-title">{{record.status === 'completed' && (record.escortNote || record.medicalSummary) ? '服务结果' : (record.escortNote || record.medicalSummary ? '病历与诉求记录' : '病历与诉求')}}</text>
|
||||
<view class="section-link" wx:if="{{record.canEditNote && (record.medicalHistory || record.demand || record.escortNote || record.medicalSummary)}}" bindtap="onEditInquiry">
|
||||
<text class="section-link-text">修改</text>
|
||||
<t-icon name="edit" size="26rpx" color="#6F655C" />
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<view class="card note-card">
|
||||
<view class="note-block" wx:if="{{record.patientNote}}">
|
||||
<text class="note-label" wx:if="{{record.escortNote || record.medicalSummary}}">陪诊需求</text>
|
||||
<text class="note-text">{{record.patientNote}}</text>
|
||||
<view class="note-block" wx:if="{{record.medicalHistory}}">
|
||||
<text class="note-label">病历</text>
|
||||
<text class="note-text">{{record.medicalHistory}}</text>
|
||||
</view>
|
||||
<view class="note-block" wx:if="{{record.demand}}">
|
||||
<text class="note-label">诉求</text>
|
||||
<text class="note-text">{{record.demand}}</text>
|
||||
</view>
|
||||
<view class="note-block" wx:if="{{record.escortNote}}">
|
||||
<text class="note-label">陪诊记录</text>
|
||||
@@ -261,16 +236,53 @@
|
||||
<text class="note-text">{{record.medicalSummary}}</text>
|
||||
</view>
|
||||
|
||||
<!-- 可编辑且三段全空:给一个轻量添加入口,避免用户失去补充需求的路径 -->
|
||||
<!-- 可编辑且四段全空:给一个轻量添加入口,避免用户失去补充需求的路径 -->
|
||||
<view
|
||||
class="note-add"
|
||||
wx:if="{{record.canEditNote && !record.patientNote && !record.escortNote && !record.medicalSummary}}"
|
||||
wx:if="{{record.canEditNote && !record.medicalHistory && !record.demand && !record.escortNote && !record.medicalSummary}}"
|
||||
aria-role="button"
|
||||
aria-label="添加陪诊需求"
|
||||
bindtap="onEditPatientNote"
|
||||
aria-label="添加病历与诉求"
|
||||
bindtap="onEditInquiry"
|
||||
>
|
||||
<t-icon name="add" size="28rpx" color="#9B4508" />
|
||||
<text class="note-add-text">添加陪诊需求</text>
|
||||
<text class="note-add-text">添加病历与诉求</text>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<!-- 费用与支付:排在病历与诉求之后,先看需求与记录再谈钱 -->
|
||||
<view class="section pay-section">
|
||||
<view class="section-head">
|
||||
<view class="section-bar"></view>
|
||||
<text class="section-title">费用与支付</text>
|
||||
</view>
|
||||
|
||||
<view class="card pay-card">
|
||||
<!-- 费用:标签与金额同行对齐;支付状态胶囊收在行尾 -->
|
||||
<view class="fee-line">
|
||||
<text class="appt-label">费用</text>
|
||||
<text class="fee-amount">¥{{record.totalFee}}</text>
|
||||
<view class="fee-side">
|
||||
<!-- 支付结果也给出状态:已支付与时序状态一样落在行尾,用户不必去账单里猜 -->
|
||||
<view
|
||||
class="status-chip"
|
||||
style="background: {{record.paymentStatusBg}}; color: {{record.paymentStatusColor}}; border-color: {{record.paymentStatusBorder}};"
|
||||
>{{record.paymentStatusText}}</view>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<!-- 支付渠道:仅待支付期间可切换;线下支付由平台收款后补记实际方式 -->
|
||||
<view
|
||||
class="pay-switch"
|
||||
wx:if="{{record.canSwitchPayChannel}}"
|
||||
aria-role="button"
|
||||
aria-label="切换支付方式"
|
||||
bindtap="onSwitchPayChannel"
|
||||
>
|
||||
<text class="pay-switch-label">支付方式</text>
|
||||
<text class="pay-switch-value">{{record.payChannelText}}</text>
|
||||
<text class="pay-switch-action">切换</text>
|
||||
<t-icon name="chevron-right" size="24rpx" color="#6F655C" />
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
@@ -435,29 +447,43 @@
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<!-- 陪诊需求编辑弹窗 -->
|
||||
<!-- 病历与诉求编辑弹窗 -->
|
||||
<view class="popup-mask {{showNotePopup ? 'show' : ''}}" bindtap="onCancelEdit"></view>
|
||||
<view class="popup-content {{showNotePopup ? 'show' : ''}}">
|
||||
<view class="popup-content popup-tall {{showNotePopup ? 'show' : ''}}">
|
||||
<view class="popup-header">
|
||||
<text class="popup-title">修改陪诊需求</text>
|
||||
<text class="popup-title">修改病历与诉求</text>
|
||||
<view class="popup-close" aria-role="button" aria-label="关闭弹窗" bindtap="onCancelEdit">
|
||||
<t-icon name="close" size="40rpx" color="#6F655C" />
|
||||
</view>
|
||||
</view>
|
||||
<view class="popup-body">
|
||||
<view class="note-field">
|
||||
<text class="note-label">病历</text>
|
||||
<textarea
|
||||
class="note-textarea"
|
||||
value="{{editPatientNote}}"
|
||||
placeholder="请输入陪诊需求或症状描述"
|
||||
value="{{editMedicalHistory}}"
|
||||
placeholder="请输入病历信息"
|
||||
maxlength="500"
|
||||
placeholder-class="input-placeholder"
|
||||
bindinput="onPatientNoteInput"
|
||||
bindinput="onMedicalHistoryInput"
|
||||
focus="{{showNotePopup}}"
|
||||
/>
|
||||
</view>
|
||||
<view class="note-field">
|
||||
<text class="note-label">诉求</text>
|
||||
<textarea
|
||||
class="note-textarea"
|
||||
value="{{editDemand}}"
|
||||
placeholder="请输入陪诊诉求"
|
||||
maxlength="500"
|
||||
placeholder-class="input-placeholder"
|
||||
bindinput="onDemandInput"
|
||||
/>
|
||||
</view>
|
||||
</view>
|
||||
<view class="popup-footer">
|
||||
<view class="popup-btn popup-btn-ghost" bindtap="onCancelEdit">取消</view>
|
||||
<view class="popup-btn popup-btn-primary" bindtap="onSavePatientNote">保存</view>
|
||||
<view class="popup-btn popup-btn-primary" bindtap="onSaveInquiry">保存</view>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
|
||||
@@ -364,23 +364,17 @@ page {
|
||||
line-height: 1.7;
|
||||
}
|
||||
|
||||
/* 电话行拨打钮:与陪诊师卡片的拨打同款实心小块,行内缩一号 */
|
||||
/* 电话行拨打钮:只给一枚电话图标,无底色无描边,
|
||||
靠暖橙图标与位置成立;负 margin 把热区撑到 72rpx 而不撑高行 */
|
||||
.row-call {
|
||||
flex-shrink: 0;
|
||||
align-self: center;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
min-width: 96rpx;
|
||||
min-height: 60rpx;
|
||||
padding: 0 22rpx;
|
||||
border-radius: 999rpx;
|
||||
background: var(--brand-strong);
|
||||
box-shadow: var(--shadow-cta);
|
||||
color: var(--white);
|
||||
font-size: var(--fs-26);
|
||||
font-weight: 700;
|
||||
letter-spacing: 2rpx;
|
||||
min-width: 72rpx;
|
||||
min-height: 72rpx;
|
||||
margin: -12rpx 0 -12rpx 8rpx;
|
||||
}
|
||||
|
||||
.row-call:active {
|
||||
@@ -397,9 +391,19 @@ page {
|
||||
line-height: 1.6;
|
||||
}
|
||||
|
||||
/* 费用与支付组:收在卡底,与上方信息区隔开 */
|
||||
.pay-group {
|
||||
margin-top: 16rpx;
|
||||
/* 费用与支付:独立分区,排在陪诊需求之后 */
|
||||
.pay-section {
|
||||
margin-top: 32rpx;
|
||||
}
|
||||
|
||||
.pay-card {
|
||||
padding: 20rpx 24rpx;
|
||||
}
|
||||
|
||||
/* 卡内首行不再画顶边:分隔线由第二行(支付方式)自己提供 */
|
||||
.pay-card .fee-line {
|
||||
padding-top: 0;
|
||||
border-top: none;
|
||||
}
|
||||
|
||||
/* 费用行:标签列与上行对齐,金额主色,支付状态胶囊收行尾 */
|
||||
@@ -740,6 +744,14 @@ page {
|
||||
line-height: 1.7;
|
||||
}
|
||||
|
||||
.note-field {
|
||||
margin-bottom: 24rpx;
|
||||
}
|
||||
|
||||
.note-field:last-child {
|
||||
margin-bottom: 0;
|
||||
}
|
||||
|
||||
.input-placeholder {
|
||||
color: var(--muted);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user