Compare commits

4 Commits
9 changed files with 222 additions and 115 deletions
+7
View File
@@ -792,6 +792,13 @@ Page({
}, VOICE_FINISH_TIMEOUT)
},
// 状态条里的主动取消入口;页面隐藏时直接调用 cancelVoiceInput,不额外弹提示
onCancelVoiceTap() {
if (!this.data.recording) return
this.cancelVoiceInput()
wx.showToast({ title: '已取消语音输入', icon: 'none' })
},
// 页面隐藏 / 主动放弃:中止本轮,输入框回到开录前手打的内容
cancelVoiceInput() {
const stream = this.voiceStream
+1
View File
@@ -1,5 +1,6 @@
{
"navigationBarTitleText": "AI陪诊助手",
"navigationBarBackgroundColor": "#F0EBE3",
"usingComponents": {
"t-icon": "tdesign-miniprogram/icon/icon",
"t-chat-markdown": "tdesign-miniprogram/chat-markdown/chat-markdown"
+16 -5
View File
@@ -137,13 +137,24 @@
<view style="height: 40rpx;"></view>
</scroll-view>
<!-- 语音状态:只在录音阶段显示,紧贴输入区上方一行。
识别/定稿阶段不再出现底部提示条,统一由 AI 回复区的等待气泡承载,
与图片识别保持同一种反馈 -->
<!-- 语音状态:只在录音阶段显示,紧贴输入区上方。
左侧展示计时与发送提示,右侧可随时取消;取消不会发送或识别本次录音。
识别/定稿阶段统一由 AI 回复区的等待气泡承载,与图片识别保持同一种反馈 -->
<view class="voice-status" wx:if="{{recording}}">
<view class="voice-dot recording"></view>
<text class="voice-status-text">正在录音 {{recordTime}},说完点麦克风或发送键发出</text>
<text class="voice-status-sub" wx:if="{{voiceRealtimeOff}}">结束后整段转写</text>
<view class="voice-status-main">
<text class="voice-status-text">正在录音 {{recordTime}}</text>
<text class="voice-status-sub">{{voiceRealtimeOff ? '结束后整段转写' : '点麦克风或发送键发出'}}</text>
</view>
<view
class="voice-cancel"
bindtap="onCancelVoiceTap"
aria-role="button"
aria-label="取消语音输入"
>
<t-icon name="close" size="24rpx" color="#9B4508" />
<text>取消</text>
</view>
</view>
<!-- 输入区:文字输入 + 语音 + 发送。
+57 -23
View File
@@ -1,6 +1,6 @@
/* 配色令牌来自 app.wxss(全站唯一来源),本页不留副本。
整体沿用首页的「暖白纸面 + 白卡 + 浅橙衬底」语言:
AI 气泡走白卡(白面 + 2rpx 发丝边),用户气泡走浅橙衬底,避免实心橙泛滥。 */
/* 配色与页面底色统一使用 app.wxss 的全局令牌,与首页等其他页面保持一致。 */
/* 页面底色交给全局 --paper,底部整片留白也走它 */
.chat-container {
display: flex;
flex-direction: column;
@@ -41,13 +41,13 @@
}
/* 热区靠上下 padding 撑到约 60rpx;「去登录」比正文再大一档,
它是这条提示里唯一可点的动作,字号必须压得住 */
它是这条提示里唯一可点的动作,字色与浅橙衬底保持清晰对比。 */
.login-notice-link {
flex-shrink: 0;
padding: 10rpx 4rpx;
font-size: var(--fs-30);
font-weight: 600;
color: var(--brand-strong);
color: var(--brand-ink);
}
.login-notice-link:active {
@@ -56,7 +56,7 @@
/* ===== 辅助入口(在输入区下方:左侧常见问题/清空聊天,右侧图片)===== */
/* 与输入区右侧语音/发送键同一套材质:浅橙衬底 + 2rpx --brand-line 描边,
文字与图标同为 --muted(浅橙底 5.24:1,过 AA);暖橙只留给「正在动作」的态。
文字与图标同为 --muted;暖橙只留给「正在动作」的态。
圆角 20rpx 与输入框、发送键、气泡同档——全页统一为圆角矩形,不再有胶囊。
整行铺满后左组贴左、右组贴右,左右 24rpx 与输入区、消息气泡同一条边线 */
.tool-bar {
@@ -102,8 +102,9 @@
.tool-btn-text {
font-size: var(--fs-24);
font-weight: 500;
/* 与语音/发送键的默认图标同色(--muted 落在浅橙底 5.24:1,仍过 AA):
待发状态统一用暖灰收声,暖橙只在按下/可发/录音这些「正在动作」的时刻出现 */
/* 与语音/发送键的默认图标同色:待发状态统一用暖灰收声,
暖橙只在按下/可发/录音这些「正在动作」的时刻出现。
图标是 t-icon 硬编码(读不到变量),只能跟同一个色值走,故此处不改 --ink-2 */
color: var(--muted);
letter-spacing: 1rpx;
}
@@ -229,25 +230,26 @@
}
/* 未登录提示里的登录入口:同一行居中的裸文字链,热区由上下 padding 撑起;
字号比系统提示正文大一档,保证它是这条提示里最醒目的动作 */
字号比系统提示正文大一档,字色统一使用 --brand-ink。 */
.system-login-link {
display: inline-block;
margin-left: 8rpx;
padding: 10rpx 8rpx;
font-size: var(--fs-30);
font-weight: 600;
color: var(--brand-strong);
color: var(--brand-ink);
}
.system-login-link:active {
opacity: 0.6;
}
/* 重试使用与其他文字入口一致的 --brand-ink */
.message-retry {
padding: 12rpx 0;
font-size: var(--fs-24);
line-height: 1.5;
color: var(--brand-strong);
color: var(--brand-ink);
}
/* 头像行:头像在左,时间紧跟其右 */
@@ -316,15 +318,17 @@
word-break: break-all;
}
/* AI:白卡(白面 + 发丝边),安静、不与用户消息争色 */
/* AI:白卡(白面 + 发丝边 + 中性阴影),安静、不与用户消息争色。
与其他页面卡片一致使用全局 --shadow-card。 */
.message-item.ai .message-bubble {
background: var(--white);
border: 2rpx solid var(--line);
border-top-left-radius: 6rpx;
box-shadow: var(--shadow-card);
}
/* 用户:浅橙衬底 + 暖陶土字,避免一排实心橙(浅橙底 5.96:1,过 AA)。
气泡落在纸面上,浅橙底与纸面明度差仅约 1.03:1,必须靠 2rpx --brand-line 描边托形 */
/* 用户:全局浅橙衬底 + 暖陶土字,与 AI 白卡区分;
2rpx --brand-line 描边让气泡在暖白纸面上保持清晰边界。 */
.message-item.user .message-bubble {
background: var(--brand-soft);
border: 2rpx solid var(--brand-line);
@@ -500,15 +504,15 @@
}
/* ===== 语音 / 识别状态条 ===== */
/* 一行内联提示,贴在输入区上沿:不盖住输入框、不替换输入框。
只在录音阶段说明"现在在录音、下一步怎么发出";识别阶段改用 AI 回复区等待气泡 */
/* 左侧计时与提示、右侧取消;不盖住输入框,也不替换输入框。
只在录音阶段出现,识别阶段改用 AI 回复区等待气泡 */
.voice-status {
display: flex;
align-items: center;
gap: 12rpx;
flex-shrink: 0;
margin: 8rpx 24rpx 0;
padding: 10rpx 20rpx;
padding: 10rpx 16rpx 10rpx 20rpx;
border-radius: 16rpx;
background: var(--brand-soft);
border: 2rpx solid var(--brand-line);
@@ -526,20 +530,50 @@
animation: record-pulse 1.2s infinite ease-in-out;
}
.voice-status-main {
flex: 1;
min-width: 0;
display: flex;
flex-direction: column;
gap: 2rpx;
}
.voice-status-text {
font-size: var(--fs-24);
line-height: 1.5;
font-size: var(--fs-26);
font-weight: 700;
line-height: 1.4;
color: var(--ink-2);
}
/* 实时链路不可用时的补充说明:不是错误,只是告知「结束后出字」 */
/* 默认说明如何发出;实时链路不可用时改为「结束后整段转写」 */
.voice-status-sub {
margin-left: auto;
flex-shrink: 0;
font-size: 22rpx;
font-size: var(--fs-24);
line-height: 1.4;
color: var(--muted);
}
.voice-cancel {
align-self: stretch;
display: flex;
align-items: center;
justify-content: center;
gap: 4rpx;
flex-shrink: 0;
min-width: 88rpx;
min-height: 88rpx;
margin-left: 4rpx;
padding: 0 12rpx 0 16rpx;
border-left: 2rpx solid var(--sep);
border-radius: 12rpx;
font-size: var(--fs-26);
font-weight: 700;
color: var(--brand-ink);
}
.voice-cancel:active {
background: rgba(184, 82, 10, 0.08);
}
@keyframes record-pulse {
0%, 100% {
transform: scale(0.7);
+9 -4
View File
@@ -459,10 +459,13 @@ page {
flex: 1;
min-width: 0;
margin-left: 20rpx;
display: flex;
align-items: baseline;
justify-content: space-between;
}
.order-service-title {
display: block;
display: inline;
font-size: var(--fs-32);
font-weight: 700;
color: var(--ink);
@@ -470,11 +473,13 @@ page {
}
.order-service-price {
display: block;
margin-top: 8rpx;
font-size: var(--fs-28);
display: inline;
margin-left: 16rpx;
margin-right: 48rpx;
font-size: var(--fs-32);
font-weight: 700;
color: var(--brand-ink);
flex-shrink: 0;
}
/* ===== 表单行 ===== */
+21 -10
View File
@@ -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' })
+83 -57
View File
@@ -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">
<textarea
class="note-textarea"
value="{{editPatientNote}}"
placeholder="请输入陪诊需求或症状描述"
maxlength="500"
placeholder-class="input-placeholder"
bindinput="onPatientNoteInput"
focus="{{showNotePopup}}"
/>
<view class="note-field">
<text class="note-label">病历</text>
<textarea
class="note-textarea"
value="{{editMedicalHistory}}"
placeholder="请输入病历信息"
maxlength="500"
placeholder-class="input-placeholder"
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>
+26 -14
View File
@@ -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);
}
+2 -2
View File
@@ -27,11 +27,11 @@
不加底色与描边:它就是标题的补充说明,让纸面与下方实心 CTA 保持对比 -->
<view class="hero-trust-wrap">
<view class="hero-trust">
<text class="hero-trust-item">实名专业陪诊师</text>
<text class="hero-trust-item">实名认证陪诊师</text>
<view class="hero-trust-sep"></view>
<text class="hero-trust-item">熟悉医院流程</text>
<view class="hero-trust-sep"></view>
<text class="hero-trust-item">全程专属陪诊</text>
<text class="hero-trust-item">1对1全程陪同</text>
</view>
</view>
<!-- 主行动按钮:通栏胶囊,直达服务列表(下单路径最短化) -->