Compare commits
15
Commits
37ef98e12b
...
3e61d18f70
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
3e61d18f70 | ||
|
|
19156ae35e | ||
|
|
4834827504 | ||
|
|
11b4b7d697 | ||
|
|
3a2a30e12f | ||
|
|
0ef4ee479e | ||
|
|
88d72d7f40 | ||
|
|
221f2c8203 | ||
|
|
8ae07dd501 | ||
|
|
0d2912c544 | ||
|
|
28793e39f5 | ||
|
|
7b5599cd3d | ||
|
|
a54e3695ae | ||
|
|
1de3f0cde6 | ||
|
|
f45f2f4be3 |
@@ -33,6 +33,9 @@ Component({
|
||||
placeholder: { type: String, value: '请选择就诊医院' },
|
||||
disabled: { type: Boolean, value: false },
|
||||
compact: { type: Boolean, value: false },
|
||||
// 展开面板上滚时,医院行锚定到距页面顶部的距离(rpx);
|
||||
// 传入上方行的总高度,可让「就诊人姓名」等上一行滚到页面顶部
|
||||
scrollAnchorOffset: { type: Number, value: 0 },
|
||||
},
|
||||
|
||||
data: {
|
||||
@@ -69,6 +72,34 @@ Component({
|
||||
}
|
||||
this.setData({ open: true, keyword: '', manualEntry: false })
|
||||
this.refreshFiltered(this.data.options, '')
|
||||
// 面板展开后若被页面底部遮挡,自动上滚页面,保证下拉列表完整可见
|
||||
wx.nextTick(() => this.scrollPanelIntoView())
|
||||
},
|
||||
|
||||
scrollPanelIntoView() {
|
||||
const query = this.createSelectorQuery()
|
||||
query.select('.hospital-row').boundingClientRect()
|
||||
query.select('.hospital-panel').boundingClientRect()
|
||||
query.selectViewport().scrollOffset()
|
||||
query.exec((res) => {
|
||||
const rowRect = res && res[0]
|
||||
const panelRect = res && res[1]
|
||||
const scroll = res && res[2]
|
||||
if (!rowRect || !scroll) return
|
||||
const rpx = wx.getSystemInfoSync().windowWidth / 750
|
||||
const margin = 20
|
||||
// 目标1:医院行上滚到距顶部 scrollAnchorOffset 处(默认页面顶部)
|
||||
let delta = rowRect.top - this.data.scrollAnchorOffset * rpx
|
||||
// 目标2:面板完整可见,两者取滚动量更大的一方
|
||||
if (panelRect) {
|
||||
delta = Math.max(delta, panelRect.bottom + margin - wx.getSystemInfoSync().windowHeight)
|
||||
}
|
||||
if (Math.abs(delta) < 1) return
|
||||
wx.pageScrollTo({
|
||||
scrollTop: scroll.scrollTop + delta,
|
||||
duration: 300,
|
||||
})
|
||||
})
|
||||
},
|
||||
|
||||
onClose() {
|
||||
|
||||
@@ -88,8 +88,11 @@
|
||||
.hospital-manual-input {
|
||||
flex: 1;
|
||||
min-width: 0;
|
||||
padding: 16rpx 20rpx;
|
||||
color: var(--ink, #2B2521);
|
||||
font-size: var(--fs-30, 30rpx);
|
||||
background: #E6F4EA;
|
||||
border-radius: 12rpx;
|
||||
}
|
||||
|
||||
.hospital-manual-confirm {
|
||||
@@ -140,8 +143,11 @@
|
||||
.hospital-search-input {
|
||||
flex: 1;
|
||||
min-width: 0;
|
||||
padding: 16rpx 20rpx;
|
||||
color: var(--ink, #2B2521);
|
||||
font-size: var(--fs-30, 30rpx);
|
||||
background: #E6F4EA;
|
||||
border-radius: 12rpx;
|
||||
}
|
||||
|
||||
.hospital-search-close {
|
||||
|
||||
+9
-2
@@ -792,7 +792,14 @@ Page({
|
||||
}, VOICE_FINISH_TIMEOUT)
|
||||
},
|
||||
|
||||
// 页面隐藏 / 主动放弃:中止本轮,输入框回到开录前手打的内容
|
||||
// 状态条里的主动取消入口;页面隐藏时直接调用 cancelVoiceInput,不额外弹提示
|
||||
onCancelVoiceTap() {
|
||||
if (!this.data.recording) return
|
||||
this.cancelVoiceInput()
|
||||
wx.showToast({ title: '已取消语音输入', icon: 'none' })
|
||||
},
|
||||
|
||||
// 页面隐藏 / 主动放弃:中止本轮,保留输入框当前文字,便于修改后继续发送
|
||||
cancelVoiceInput() {
|
||||
const stream = this.voiceStream
|
||||
if (stream && !stream.stopSent) {
|
||||
@@ -800,7 +807,7 @@ Page({
|
||||
stream.socket.send({ type: 'asr_cancel', id: stream.id }).catch(() => {})
|
||||
}
|
||||
this.stopRecorderSilently()
|
||||
this.resetVoiceState(false)
|
||||
this.resetVoiceState(true)
|
||||
},
|
||||
|
||||
clearRecordTimer() {
|
||||
|
||||
@@ -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
@@ -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
@@ -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);
|
||||
|
||||
+142
-44
@@ -1,5 +1,5 @@
|
||||
const API = require('../../utils/api.js')
|
||||
const { formatDate } = require('../../utils/date.js')
|
||||
const { formatDate, LATEST_APPOINTMENT_TIME, buildTimeSlots } = require('../../utils/date.js')
|
||||
|
||||
Page({
|
||||
data: {
|
||||
@@ -25,17 +25,18 @@ Page({
|
||||
appointmentDate: '',
|
||||
appointmentTime: '',
|
||||
minAppointmentDate: '',
|
||||
fixedTime: false,
|
||||
timeOptions: [],
|
||||
sessionIndex: 0,
|
||||
timeStart: '',
|
||||
timeEnd: '',
|
||||
// 预约时间:从服务起始时刻到 23:30,每半小时一档
|
||||
timeSlots: [],
|
||||
timeSlotIndex: 0,
|
||||
remark: '',
|
||||
shippingAddress: '',
|
||||
requiresAddress: false,
|
||||
gender: '不限',
|
||||
genderIndex: 0,
|
||||
genderOptions: ['不限', '男', '女']
|
||||
genderOptions: ['不限', '男', '女'],
|
||||
payChannel: 'online_wechat',
|
||||
// 点击「提交预约」后弹出支付方式选择,默认微信支付
|
||||
showPayPopup: false
|
||||
},
|
||||
|
||||
onLoad(options) {
|
||||
@@ -103,26 +104,17 @@ Page({
|
||||
applyBookingConfig(service) {
|
||||
const booking = service.booking || {}
|
||||
const sessions = booking.sessions || []
|
||||
const fixedTime = sessions.length > 0 && sessions.every((item) => !item.flexible)
|
||||
const firstSession = sessions[0] || {}
|
||||
const minDate = new Date()
|
||||
minDate.setDate(minDate.getDate() + Number(booking.advanceDays || 0))
|
||||
const minAppointmentDate = formatDate(minDate)
|
||||
let timeEnd = firstSession.end || ''
|
||||
if (!fixedTime && firstSession.end && booking.durationMinutes) {
|
||||
const [hour, minute] = firstSession.end.split(':').map(Number)
|
||||
const latest = hour * 60 + minute - booking.durationMinutes
|
||||
timeEnd = `${String(Math.floor(latest / 60)).padStart(2, '0')}:${String(latest % 60).padStart(2, '0')}`
|
||||
}
|
||||
const provinces = service.areas || []
|
||||
this.selectedHospitalId = ''
|
||||
this.setData({
|
||||
minAppointmentDate,
|
||||
fixedTime,
|
||||
timeOptions: sessions.map((item) => `${item.start} - ${item.end}`),
|
||||
sessionIndex: 0,
|
||||
timeStart: firstSession.start || '',
|
||||
timeEnd,
|
||||
// 所有服务统一提供到 23:30 的开始时间档位(夜间陪诊也需覆盖晚间时段)
|
||||
timeSlots: buildTimeSlots(firstSession.start || '', LATEST_APPOINTMENT_TIME),
|
||||
timeSlotIndex: 0,
|
||||
provinces,
|
||||
province: provinces[0] || '',
|
||||
provinceIndex: 0,
|
||||
@@ -195,7 +187,19 @@ Page({
|
||||
sex: item.profile?.sex || '',
|
||||
birth: item.profile?.birth || ''
|
||||
}))
|
||||
this.setData({ profiles })
|
||||
// 默认选中第一个就诊人,信息随档案一键带入
|
||||
const first = profiles[0]
|
||||
if (first && !this.data.selectedProfileId) {
|
||||
this.setData({
|
||||
profiles,
|
||||
selectedProfileId: first._id,
|
||||
patientName: first.name,
|
||||
patientPhone: first.mobile,
|
||||
selectedPatient: first
|
||||
})
|
||||
} else {
|
||||
this.setData({ profiles })
|
||||
}
|
||||
})
|
||||
.catch((err) => {
|
||||
console.log('获取就诊人列表失败', err)
|
||||
@@ -269,13 +273,8 @@ Page({
|
||||
},
|
||||
|
||||
onTimeChange(e) {
|
||||
if (this.data.fixedTime) {
|
||||
const index = Number(e.detail.value)
|
||||
const session = this.data.service.booking.sessions[index]
|
||||
this.setData({ sessionIndex: index, appointmentTime: session.start })
|
||||
return
|
||||
}
|
||||
this.setData({ appointmentTime: e.detail.value })
|
||||
const index = Number(e.detail.value)
|
||||
this.setData({ timeSlotIndex: index, appointmentTime: this.data.timeSlots[index] || '' })
|
||||
},
|
||||
|
||||
onGenderChange(e) {
|
||||
@@ -299,13 +298,20 @@ Page({
|
||||
}
|
||||
if (!data.appointmentDate) return '请选择预约日期'
|
||||
if (!data.appointmentTime) return '请选择预约时间'
|
||||
if (data.requiresAddress && !data.shippingAddress.trim()) return '请填写完整收货地址'
|
||||
// 收货地址选填:跑腿/买药未填地址时由客服线下确认
|
||||
if (!/^1[3-9]\d{9}$/.test(data.selectedPatient.mobile.trim())) {
|
||||
return '就诊人手机号有误,请到就诊人档案修改'
|
||||
}
|
||||
return ''
|
||||
},
|
||||
|
||||
onPayChannelChange(e) {
|
||||
const channel = e.currentTarget.dataset.channel
|
||||
if (!['online_wechat', 'offline'].includes(channel)) return
|
||||
if (this.data.submitting) return
|
||||
this.setData({ payChannel: channel })
|
||||
},
|
||||
|
||||
submitOrder() {
|
||||
if (this.data.submitting) return
|
||||
const error = this.validateOrder()
|
||||
@@ -313,10 +319,58 @@ Page({
|
||||
wx.showToast({ title: error, icon: 'none' })
|
||||
return
|
||||
}
|
||||
// 保留下单弹窗在下层,取消支付时可直接返回表单,已填信息不丢失
|
||||
this.setData({ showPayPopup: true, payChannel: 'online_wechat' })
|
||||
},
|
||||
|
||||
onClosePayPopup() {
|
||||
if (this.data.submitting) return
|
||||
this.setData({ showPayPopup: false })
|
||||
},
|
||||
|
||||
/**
|
||||
* 确认支付方式后真正提交订单
|
||||
*/
|
||||
async onConfirmPay() {
|
||||
if (this.data.submitting) return
|
||||
this.setData({ submitting: true, showPayPopup: false })
|
||||
try {
|
||||
const error = this.validateOrder()
|
||||
if (error) {
|
||||
wx.showToast({ title: error, icon: 'none' })
|
||||
return
|
||||
}
|
||||
|
||||
const payChannel = this.data.payChannel
|
||||
const orderData = this.buildOrderData()
|
||||
|
||||
// 网络重试沿用同一幂等键,服务端只创建一笔订单。
|
||||
const res = await API.escort.createRecord(orderData)
|
||||
if (res.code !== 0) throw new Error(res.msg || '下单失败')
|
||||
const record = res.data?.record
|
||||
this.resetForm()
|
||||
|
||||
if (payChannel === 'offline') {
|
||||
wx.showToast({ title: '线下支付,请联系平台收款', icon: 'none' })
|
||||
wx.navigateTo({ url: '/pages/escort/recordlist?tab=ongoing' })
|
||||
return
|
||||
}
|
||||
|
||||
// 选微信支付:下单成功后立即拉起收银台,支付结果以后端查单为准
|
||||
if (record?._id) await this.startWechatPay(record._id)
|
||||
else wx.navigateTo({ url: '/pages/escort/recordlist?tab=ongoing' })
|
||||
} catch (err) {
|
||||
console.log('下单失败', err)
|
||||
wx.showToast({ title: err.message || '网络请求失败,请重试', icon: 'none' })
|
||||
} finally {
|
||||
this.setData({ submitting: false })
|
||||
}
|
||||
},
|
||||
|
||||
buildOrderData() {
|
||||
const data = this.data
|
||||
const sexMap = { 男: 'male', 女: 'female' }
|
||||
const orderData = {
|
||||
return {
|
||||
idempotencyKey: this.idempotencyKey,
|
||||
healthProfileId: data.selectedProfileId,
|
||||
escort: {
|
||||
@@ -332,24 +386,58 @@ Page({
|
||||
startTime: data.appointmentTime
|
||||
},
|
||||
shippingAddress: { address: data.shippingAddress.trim() },
|
||||
notes: { patientNote: data.remark.trim() }
|
||||
notes: { patientNote: data.remark.trim() },
|
||||
payment: { payChannel: data.payChannel }
|
||||
}
|
||||
},
|
||||
|
||||
// 同步锁定按钮;网络重试沿用同一幂等键,服务端只创建一笔订单。
|
||||
this.setData({ submitting: true })
|
||||
API.escort.createRecord(orderData)
|
||||
.then((res) => {
|
||||
if (res.code !== 0) throw new Error(res.msg || '下单失败')
|
||||
wx.showToast({ title: '下单成功', icon: 'success' })
|
||||
this.setData({ showOrderPopup: false })
|
||||
this.resetForm()
|
||||
wx.navigateTo({ url: '/pages/escort/recordlist?tab=ongoing' })
|
||||
/**
|
||||
* 发起微信支付:payOrder → requestPayment → 查单确认
|
||||
* 支付按钮防抖(this.paying),前端回调只作提示,最终状态以 getPayStatus 为准
|
||||
*/
|
||||
async startWechatPay(recordId) {
|
||||
if (this.paying) return
|
||||
this.paying = true
|
||||
let paid = false
|
||||
try {
|
||||
const res = await API.escort.payOrder(recordId)
|
||||
if (res.code !== 0 || !res.data?.payParams) {
|
||||
wx.showToast({ title: res.msg || '支付发起失败,请稍后重试', icon: 'none' })
|
||||
return
|
||||
}
|
||||
|
||||
const payResult = await new Promise((resolve) => {
|
||||
wx.requestPayment({
|
||||
...res.data.payParams,
|
||||
success: () => resolve({ ok: true }),
|
||||
fail: (err) => resolve({ ok: false, err })
|
||||
})
|
||||
})
|
||||
.catch((err) => {
|
||||
console.log('下单失败', err)
|
||||
wx.showToast({ title: err.message || '网络请求失败,请重试', icon: 'none' })
|
||||
|
||||
if (!payResult.ok) {
|
||||
const errMsg = payResult.err?.errMsg || ''
|
||||
if (/cancel/i.test(errMsg)) {
|
||||
wx.showToast({ title: '已取消支付', icon: 'none' })
|
||||
return
|
||||
}
|
||||
// 非取消失败可能是网络中断但支付已成功:先查单兜底
|
||||
}
|
||||
|
||||
const statusRes = await API.escort.getPayStatus(recordId).catch(() => null)
|
||||
paid = statusRes?.code === 0 && statusRes.data?.paymentStatus === 'paid'
|
||||
wx.showToast({
|
||||
title: paid ? '支付成功' : '支付结果确认中',
|
||||
icon: paid ? 'success' : 'none'
|
||||
})
|
||||
.finally(() => this.setData({ submitting: false }))
|
||||
} catch (err) {
|
||||
console.log('发起支付失败', err)
|
||||
wx.showToast({ title: '支付发起失败,请稍后重试', icon: 'none' })
|
||||
} finally {
|
||||
this.paying = false
|
||||
setTimeout(() => {
|
||||
wx.navigateTo({ url: `/pages/escort/recorddetail?id=${recordId}` })
|
||||
}, paid ? 600 : 0)
|
||||
}
|
||||
},
|
||||
|
||||
resetForm() {
|
||||
@@ -366,12 +454,22 @@ Page({
|
||||
hospitalCustom: false,
|
||||
appointmentDate: '',
|
||||
appointmentTime: '',
|
||||
sessionIndex: 0,
|
||||
timeSlotIndex: 0,
|
||||
gender: '不限',
|
||||
genderIndex: 0,
|
||||
remark: '',
|
||||
shippingAddress: ''
|
||||
}, () => this.refreshHospitalOptions(provinces[0] || ''))
|
||||
// 重置后仍默认选中第一个就诊人,方便连续预约
|
||||
const first = this.data.profiles[0]
|
||||
if (first) {
|
||||
this.setData({
|
||||
selectedProfileId: first._id,
|
||||
patientName: first.name,
|
||||
patientPhone: first.mobile,
|
||||
selectedPatient: first
|
||||
})
|
||||
}
|
||||
this.idempotencyKey = ''
|
||||
},
|
||||
|
||||
|
||||
@@ -180,15 +180,10 @@
|
||||
</picker>
|
||||
</view>
|
||||
|
||||
<!-- 预约时间 -->
|
||||
<!-- 预约时间:整点/半点一档,所有服务统一可选到 23:30 -->
|
||||
<view class="order-row">
|
||||
<text class="order-label">预约时间</text>
|
||||
<picker wx:if="{{fixedTime}}" class="order-picker" mode="selector" range="{{timeOptions}}" value="{{sessionIndex}}" bindchange="onTimeChange">
|
||||
<view class="picker-value {{appointmentTime ? '' : 'placeholder'}}">
|
||||
{{appointmentTime ? timeOptions[sessionIndex] : '请选择服务班次'}}
|
||||
</view>
|
||||
</picker>
|
||||
<picker wx:else class="order-picker" mode="time" value="{{appointmentTime}}" start="{{timeStart}}" end="{{timeEnd}}" bindchange="onTimeChange">
|
||||
<picker class="order-picker" mode="selector" range="{{timeSlots}}" value="{{timeSlotIndex}}" bindchange="onTimeChange">
|
||||
<view class="picker-value {{appointmentTime ? '' : 'placeholder'}}">
|
||||
{{appointmentTime || '请选择预约时间'}}
|
||||
</view>
|
||||
@@ -197,7 +192,7 @@
|
||||
|
||||
<!-- 收货地址仅对快递/跑腿服务展示,随订单保存快照 -->
|
||||
<view class="order-row column" wx:if="{{requiresAddress}}">
|
||||
<text class="order-label">收货地址</text>
|
||||
<text class="order-label">收货地址(选填)</text>
|
||||
<textarea class="order-textarea" value="{{shippingAddress}}" placeholder="请输入省市区、街道门牌等完整收货地址" maxlength="200" placeholder-class="input-placeholder" bindinput="onShippingAddressChange" />
|
||||
<text class="address-tip">收货人与联系电话使用所选就诊人信息</text>
|
||||
</view>
|
||||
@@ -220,6 +215,42 @@
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<!-- 支付方式选择弹窗:点击「提交预约」后出现,默认微信支付 -->
|
||||
<view class="popup-mask {{showPayPopup ? 'show' : ''}}" bindtap="onClosePayPopup"></view>
|
||||
<view class="popup-content {{showPayPopup ? 'show' : ''}}">
|
||||
<view class="popup-header">
|
||||
<text class="popup-title">选择支付方式</text>
|
||||
<view class="popup-close" bindtap="onClosePayPopup" aria-role="button" aria-label="关闭支付弹窗">
|
||||
<t-icon name="close" size="40rpx" color="#6F655C" />
|
||||
</view>
|
||||
</view>
|
||||
<view class="popup-body">
|
||||
<view class="pay-channel-options">
|
||||
<view class="pay-channel-option {{payChannel === 'online_wechat' ? 'active' : ''}}" data-channel="online_wechat" bindtap="onPayChannelChange">
|
||||
<view class="pay-channel-text">
|
||||
<text class="pay-channel-title">微信支付</text>
|
||||
<text class="pay-channel-desc">提交后立即拉起收银台</text>
|
||||
</view>
|
||||
<view class="pay-channel-radio {{payChannel === 'online_wechat' ? 'checked' : ''}}"></view>
|
||||
</view>
|
||||
<view class="pay-channel-option {{payChannel === 'offline' ? 'active' : ''}}" data-channel="offline" bindtap="onPayChannelChange">
|
||||
<view class="pay-channel-text">
|
||||
<text class="pay-channel-title">线下支付</text>
|
||||
<text class="pay-channel-desc">平台收款后确认订单</text>
|
||||
</view>
|
||||
<view class="pay-channel-radio {{payChannel === 'offline' ? 'checked' : ''}}"></view>
|
||||
</view>
|
||||
</view>
|
||||
<text class="pay-popup-tip">微信支付可立即完成付款;线下支付由平台收款后再确认订单。</text>
|
||||
</view>
|
||||
<view class="popup-footer pay-actions">
|
||||
<view class="popup-btn popup-btn-ghost" bindtap="onClosePayPopup">取消</view>
|
||||
<view class="popup-btn popup-btn-primary" bindtap="onConfirmPay">
|
||||
{{submitting ? '提交中...' : '确认提交'}}
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
</view>
|
||||
<view class="page-state" wx:if="{{pageLoading}}"><t-loading theme="circular" size="40rpx" text="加载中..." /></view>
|
||||
<view class="page-state" wx:if="{{!pageLoading && pageError}}">
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
/* ===== 表单行 ===== */
|
||||
@@ -732,6 +737,101 @@ page {
|
||||
transform: scale(0.98);
|
||||
}
|
||||
|
||||
/* ===== 支付方式选择 ===== */
|
||||
/* 两张可选卡片,选中态沿用品牌橙 */
|
||||
.pay-channel-options {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
gap: 16rpx;
|
||||
margin-top: 16rpx;
|
||||
}
|
||||
|
||||
.pay-channel-option {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: space-between;
|
||||
padding: 20rpx 24rpx;
|
||||
border: 2rpx solid var(--line);
|
||||
border-radius: 18rpx;
|
||||
background: var(--paper);
|
||||
}
|
||||
|
||||
.pay-channel-option.active {
|
||||
border-color: var(--brand-line);
|
||||
background: var(--brand-soft);
|
||||
}
|
||||
|
||||
.pay-channel-text {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
gap: 6rpx;
|
||||
}
|
||||
|
||||
.pay-channel-title {
|
||||
color: var(--ink);
|
||||
font-size: var(--fs-30);
|
||||
font-weight: 600;
|
||||
}
|
||||
|
||||
.pay-channel-desc {
|
||||
color: var(--muted);
|
||||
font-size: var(--fs-24);
|
||||
}
|
||||
|
||||
.pay-channel-radio {
|
||||
flex-shrink: 0;
|
||||
width: 32rpx;
|
||||
height: 32rpx;
|
||||
border: 2rpx solid var(--line);
|
||||
border-radius: 50%;
|
||||
background: var(--white);
|
||||
}
|
||||
|
||||
.pay-channel-radio.checked {
|
||||
border-color: var(--brand-strong);
|
||||
background: var(--brand-strong);
|
||||
}
|
||||
|
||||
.pay-popup-tip {
|
||||
display: block;
|
||||
margin-top: 20rpx;
|
||||
color: var(--muted);
|
||||
font-size: var(--fs-24);
|
||||
line-height: 1.6;
|
||||
}
|
||||
|
||||
/* 支付弹窗底部只放两个等宽按钮,覆盖下单弹窗的「左价格右按钮」布局 */
|
||||
.pay-actions {
|
||||
justify-content: flex-end;
|
||||
gap: 16rpx;
|
||||
}
|
||||
|
||||
.popup-btn {
|
||||
flex: 1;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
padding: 22rpx 0;
|
||||
border-radius: 999rpx;
|
||||
font-size: var(--fs-30);
|
||||
line-height: 1.4;
|
||||
}
|
||||
|
||||
.popup-btn:active {
|
||||
opacity: 0.7;
|
||||
}
|
||||
|
||||
.popup-btn-ghost {
|
||||
border: 3rpx solid var(--sep);
|
||||
color: var(--muted);
|
||||
}
|
||||
|
||||
.popup-btn-primary {
|
||||
background: var(--brand-strong);
|
||||
color: var(--white);
|
||||
font-weight: 700;
|
||||
}
|
||||
|
||||
@media (prefers-reduced-motion: reduce) {
|
||||
.popup-content,
|
||||
.popup-mask {
|
||||
|
||||
@@ -24,7 +24,7 @@ const SERVICE_GROUPS = [{
|
||||
// 「开药」已改为「取药」:国标 8.1 只列「领取药物」,开药属开具处方的医疗行为,
|
||||
// 会擦 8.2「提供医疗建议」「代替选择用药方案」;取药是凭已有处方代领,口径与 id 8 一致
|
||||
note: '代问诊、跑腿取药取报告,本人不必到场。',
|
||||
ids: [3, 4, 5, 6, 8] // 代问诊 / 检查预约 / 出入院代办 / 跑腿服务 / 取药快递
|
||||
ids: [3, 4, 5, 6, 8, 9] // 代问诊 / 检查预约 / 出入院代办 / 跑腿服务 / 取药快递 / 其他项目
|
||||
}
|
||||
]
|
||||
|
||||
|
||||
+91
-36
@@ -1,13 +1,19 @@
|
||||
const API = require('../../utils/api.js')
|
||||
const { formatDate } = require('../../utils/date.js')
|
||||
const { formatDate, LATEST_APPOINTMENT_TIME, buildTimeSlots } = require('../../utils/date.js')
|
||||
|
||||
// 陪诊项目下拉单行高度:图标 72rpx + 单行文字 + 上下留白
|
||||
const SERVICE_OPTION_HEIGHT = 108
|
||||
// 下拉面板最多占用的屏高:扣掉底部固定操作栏与页面留白,项目再多也能整屏看到
|
||||
const SERVICE_PANEL_RESERVED = 200
|
||||
|
||||
Page({
|
||||
data: {
|
||||
services: [],
|
||||
serviceOptions: [],
|
||||
serviceIndex: 0,
|
||||
service: {},
|
||||
serviceIcon: 'user-business',
|
||||
servicePanelOpen: false,
|
||||
serviceOptionsHeight: 0,
|
||||
totalPrice: '0.00',
|
||||
pageLoading: true,
|
||||
pageError: '',
|
||||
@@ -26,11 +32,9 @@ Page({
|
||||
appointmentDate: '',
|
||||
appointmentTime: '',
|
||||
minAppointmentDate: '',
|
||||
fixedTime: false,
|
||||
timeOptions: [],
|
||||
sessionIndex: 0,
|
||||
timeStart: '',
|
||||
timeEnd: '',
|
||||
// 预约时间:从服务起始时刻到 23:30,每半小时一档
|
||||
timeSlots: [],
|
||||
timeSlotIndex: 0,
|
||||
remark: '',
|
||||
shippingAddress: '',
|
||||
requiresAddress: false,
|
||||
@@ -65,11 +69,13 @@ Page({
|
||||
const requestedIndex = services.findIndex((item) => item.id === this.requestedServiceId)
|
||||
const consultationIndex = services.findIndex((item) => item.title.includes('问诊'))
|
||||
const serviceIndex = requestedIndex >= 0 ? requestedIndex : (consultationIndex >= 0 ? consultationIndex : 0)
|
||||
// 每个项目带上展示图标,供下拉列表逐项渲染
|
||||
const serviceList = services.map((item) => ({ ...item, icon: this.getServiceIcon(item.title) }))
|
||||
this.setData({
|
||||
services,
|
||||
serviceOptions: services.map((item) => item.title)
|
||||
services: serviceList,
|
||||
serviceOptionsHeight: this.getServiceOptionsHeight(serviceList.length)
|
||||
})
|
||||
this.applyService(services[serviceIndex], serviceIndex)
|
||||
this.applyService(serviceList[serviceIndex], serviceIndex)
|
||||
this.setData({ pageLoading: false })
|
||||
this.pageReady = true
|
||||
|
||||
@@ -87,6 +93,14 @@ Page({
|
||||
this.initializePage()
|
||||
},
|
||||
|
||||
// 按屏高算下拉可见高度:项目少时整列铺开,多时撑到屏高上限后在面板内滚动
|
||||
getServiceOptionsHeight(count) {
|
||||
const { windowWidth, windowHeight } = wx.getSystemInfoSync()
|
||||
const availableRpx = (windowHeight * 750) / windowWidth - SERVICE_PANEL_RESERVED
|
||||
const maxRows = Math.max(1, Math.floor(availableRpx / SERVICE_OPTION_HEIGHT))
|
||||
return Math.min(count, maxRows) * SERVICE_OPTION_HEIGHT
|
||||
},
|
||||
|
||||
createIdempotencyKey() {
|
||||
return `order_${Date.now().toString(36)}_${Math.random().toString(36).slice(2, 12)}`
|
||||
},
|
||||
@@ -94,30 +108,22 @@ Page({
|
||||
applyService(service, serviceIndex) {
|
||||
const booking = service.booking || {}
|
||||
const sessions = booking.sessions || []
|
||||
const fixedTime = sessions.length > 0 && sessions.every((item) => !item.flexible)
|
||||
const firstSession = sessions[0] || {}
|
||||
const minDate = new Date()
|
||||
minDate.setDate(minDate.getDate() + Number(booking.advanceDays || 0))
|
||||
let timeEnd = firstSession.end || ''
|
||||
if (!fixedTime && firstSession.end && booking.durationMinutes) {
|
||||
const [hour, minute] = firstSession.end.split(':').map(Number)
|
||||
const latest = hour * 60 + minute - booking.durationMinutes
|
||||
timeEnd = `${String(Math.floor(latest / 60)).padStart(2, '0')}:${String(latest % 60).padStart(2, '0')}`
|
||||
}
|
||||
const provinces = service.areas || []
|
||||
|
||||
this.selectedHospitalId = ''
|
||||
this.setData({
|
||||
service,
|
||||
serviceIndex,
|
||||
serviceIcon: this.getServiceIcon(service.title),
|
||||
serviceIcon: service.icon || this.getServiceIcon(service.title),
|
||||
servicePanelOpen: false,
|
||||
totalPrice: service.price,
|
||||
minAppointmentDate: formatDate(minDate),
|
||||
fixedTime,
|
||||
timeOptions: sessions.map((item) => `${item.start} - ${item.end}`),
|
||||
sessionIndex: 0,
|
||||
timeStart: firstSession.start || '',
|
||||
timeEnd,
|
||||
// 所有服务统一提供到 23:30 的开始时间档位(夜间陪诊也需覆盖晚间时段)
|
||||
timeSlots: buildTimeSlots(firstSession.start || '', LATEST_APPOINTMENT_TIME),
|
||||
timeSlotIndex: 0,
|
||||
provinces,
|
||||
province: provinces[0] || '',
|
||||
provinceIndex: 0,
|
||||
@@ -130,10 +136,41 @@ Page({
|
||||
}, () => this.refreshHospitalOptions(provinces[0] || ''))
|
||||
},
|
||||
|
||||
onServiceChange(e) {
|
||||
const index = Number(e.detail.value)
|
||||
// 展开/收起陪诊项目下拉面板
|
||||
onToggleServicePanel() {
|
||||
if (this.data.submitting) return
|
||||
const open = !this.data.servicePanelOpen
|
||||
this.setData({ servicePanelOpen: open })
|
||||
if (open) wx.nextTick(() => this.scrollServicePanelIntoView())
|
||||
},
|
||||
|
||||
// 面板展开后若被底部固定操作栏遮挡,自动上滚页面,保证列表完整可见
|
||||
scrollServicePanelIntoView() {
|
||||
const query = this.createSelectorQuery()
|
||||
query.select('.service-panel').boundingClientRect()
|
||||
query.selectViewport().scrollOffset()
|
||||
query.exec((res) => {
|
||||
const panelRect = res && res[0]
|
||||
const scroll = res && res[1]
|
||||
if (!panelRect || !scroll) return
|
||||
const rpx = wx.getSystemInfoSync().windowWidth / 750
|
||||
// 底部操作栏 152rpx + 留白,避免面板最后一行被压住
|
||||
const reserved = 180 * rpx
|
||||
const delta = panelRect.bottom + reserved - wx.getSystemInfoSync().windowHeight
|
||||
if (delta < 1) return
|
||||
wx.pageScrollTo({ scrollTop: scroll.scrollTop + delta, duration: 300 })
|
||||
})
|
||||
},
|
||||
|
||||
onServiceOptionTap(e) {
|
||||
if (this.data.submitting) return
|
||||
const index = Number(e.currentTarget.dataset.index)
|
||||
if (index === this.data.serviceIndex) {
|
||||
this.setData({ servicePanelOpen: false })
|
||||
return
|
||||
}
|
||||
const service = this.data.services[index]
|
||||
if (!service || index === this.data.serviceIndex) return
|
||||
if (!service) return
|
||||
this.applyService(service, index)
|
||||
},
|
||||
|
||||
@@ -176,7 +213,19 @@ Page({
|
||||
sex: item.profile?.sex || '',
|
||||
birth: item.profile?.birth || ''
|
||||
}))
|
||||
this.setData({ profiles })
|
||||
// 默认选中第一个就诊人,信息随档案一键带入
|
||||
const first = profiles[0]
|
||||
if (first && !this.data.selectedProfileId) {
|
||||
this.setData({
|
||||
profiles,
|
||||
selectedProfileId: first._id,
|
||||
patientName: first.name,
|
||||
patientPhone: first.mobile,
|
||||
selectedPatient: first
|
||||
})
|
||||
} else {
|
||||
this.setData({ profiles })
|
||||
}
|
||||
})
|
||||
.catch((err) => {
|
||||
console.log('获取就诊人列表失败', err)
|
||||
@@ -246,13 +295,8 @@ Page({
|
||||
},
|
||||
|
||||
onTimeChange(e) {
|
||||
if (this.data.fixedTime) {
|
||||
const index = Number(e.detail.value)
|
||||
const session = this.data.service.booking.sessions[index]
|
||||
this.setData({ sessionIndex: index, appointmentTime: session.start })
|
||||
return
|
||||
}
|
||||
this.setData({ appointmentTime: e.detail.value })
|
||||
const index = Number(e.detail.value)
|
||||
this.setData({ timeSlotIndex: index, appointmentTime: this.data.timeSlots[index] || '' })
|
||||
},
|
||||
|
||||
onGenderChange(e) {
|
||||
@@ -283,7 +327,7 @@ Page({
|
||||
}
|
||||
if (!data.appointmentDate) return '请选择预约日期'
|
||||
if (!data.appointmentTime) return '请选择预约时间'
|
||||
if (data.requiresAddress && !data.shippingAddress.trim()) return '请填写完整收货地址'
|
||||
// 收货地址选填:跑腿/买药未填地址时由客服线下确认
|
||||
if (!/^1[3-9]\d{9}$/.test(data.selectedPatient.mobile.trim())) {
|
||||
return '就诊人手机号有误,请到就诊人档案修改'
|
||||
}
|
||||
@@ -434,18 +478,29 @@ Page({
|
||||
patientName: '',
|
||||
patientPhone: '',
|
||||
selectedPatient: null,
|
||||
servicePanelOpen: false,
|
||||
province: provinces[0] || '',
|
||||
provinceIndex: 0,
|
||||
hospital: '',
|
||||
hospitalCustom: false,
|
||||
appointmentDate: '',
|
||||
appointmentTime: '',
|
||||
sessionIndex: 0,
|
||||
timeSlotIndex: 0,
|
||||
gender: '不限',
|
||||
genderIndex: 0,
|
||||
remark: '',
|
||||
shippingAddress: ''
|
||||
}, () => this.refreshHospitalOptions(provinces[0] || ''))
|
||||
// 重置后仍默认选中第一个就诊人,方便连续预约
|
||||
const first = this.data.profiles[0]
|
||||
if (first) {
|
||||
this.setData({
|
||||
selectedProfileId: first._id,
|
||||
patientName: first.name,
|
||||
patientPhone: first.mobile,
|
||||
selectedPatient: first
|
||||
})
|
||||
}
|
||||
this.idempotencyKey = this.createIdempotencyKey()
|
||||
}
|
||||
})
|
||||
+28
-14
@@ -8,12 +8,11 @@
|
||||
</view>
|
||||
|
||||
<view class="booking-form">
|
||||
<!-- 陪诊项目:切换后同步更新服务的预约规则 -->
|
||||
<!-- 陪诊项目:保留原项目卡片展示,点击卡片展开下拉列表切换 -->
|
||||
<view class="service-picker-row">
|
||||
<text class="order-label">陪诊项目</text>
|
||||
<picker class="service-picker" mode="selector" range="{{serviceOptions}}" value="{{serviceIndex}}"
|
||||
disabled="{{submitting}}" bindchange="onServiceChange">
|
||||
<view class="order-service-info">
|
||||
<view class="service-picker {{submitting ? 'is-disabled' : ''}}">
|
||||
<view class="order-service-info" bindtap="onToggleServicePanel">
|
||||
<view class="order-service-mark">
|
||||
<t-icon name="{{serviceIcon}}" size="48rpx" color="#9B4508" />
|
||||
</view>
|
||||
@@ -21,11 +20,29 @@
|
||||
<text class="order-service-title">{{service.title}}</text>
|
||||
<text class="order-service-price">¥{{service.price}}/次</text>
|
||||
</view>
|
||||
<view class="service-picker-arrow">
|
||||
<view class="service-picker-arrow {{servicePanelOpen ? 'is-open' : ''}}">
|
||||
<t-icon name="chevron-down" size="40rpx" color="#9B4508" />
|
||||
</view>
|
||||
</view>
|
||||
</picker>
|
||||
|
||||
<view class="service-panel" wx:if="{{servicePanelOpen}}">
|
||||
<scroll-view wx:if="{{services.length > 0}}" class="service-options" scroll-y
|
||||
style="height: {{serviceOptionsHeight}}rpx;">
|
||||
<view class="service-option {{index === serviceIndex ? 'active' : ''}}" wx:for="{{services}}" wx:key="id"
|
||||
data-index="{{index}}" bindtap="onServiceOptionTap">
|
||||
<view class="service-option-mark">
|
||||
<t-icon name="{{item.icon}}" size="40rpx" color="#9B4508" />
|
||||
</view>
|
||||
<text class="service-option-name">{{item.title}}</text>
|
||||
<text class="service-option-sub">¥{{item.price}}/次</text>
|
||||
<text class="service-option-selected" wx:if="{{index === serviceIndex}}">已选</text>
|
||||
</view>
|
||||
</scroll-view>
|
||||
<view wx:else class="service-empty">
|
||||
<text class="service-empty-text">暂无可选项目</text>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<!-- 选择就诊人:订单必须关联健康档案,就诊人信息全部由此带入 -->
|
||||
@@ -73,6 +90,7 @@
|
||||
options="{{hospitalOptions}}"
|
||||
placeholder="请选择就诊医院"
|
||||
disabled="{{submitting}}"
|
||||
scroll-anchor-offset="{{200}}"
|
||||
bindchange="onHospitalChange"
|
||||
/>
|
||||
|
||||
@@ -90,21 +108,17 @@
|
||||
</picker>
|
||||
</view>
|
||||
|
||||
<!-- 预约时间:整点/半点一档,所有服务统一可选到 23:30 -->
|
||||
<view class="order-row">
|
||||
<text class="order-label">预约时间</text>
|
||||
<picker wx:if="{{fixedTime}}" class="order-picker" mode="selector" range="{{timeOptions}}" value="{{sessionIndex}}" bindchange="onTimeChange">
|
||||
<view class="picker-value {{appointmentTime ? '' : 'placeholder'}}">
|
||||
{{appointmentTime ? timeOptions[sessionIndex] : '请选择服务班次'}}
|
||||
</view>
|
||||
</picker>
|
||||
<picker wx:else class="order-picker" mode="time" value="{{appointmentTime}}" start="{{timeStart}}" end="{{timeEnd}}" bindchange="onTimeChange">
|
||||
<picker class="order-picker" mode="selector" range="{{timeSlots}}" value="{{timeSlotIndex}}" bindchange="onTimeChange">
|
||||
<view class="picker-value {{appointmentTime ? '' : 'placeholder'}}">{{appointmentTime || '请选择预约时间'}}</view>
|
||||
</picker>
|
||||
</view>
|
||||
|
||||
<!-- 收货地址仅对快递/跑腿服务展示,随订单保存快照 -->
|
||||
<view class="order-row column" wx:if="{{requiresAddress}}">
|
||||
<text class="order-label">收货地址</text>
|
||||
<text class="order-label">收货地址(选填)</text>
|
||||
<textarea class="order-textarea" value="{{shippingAddress}}" placeholder="请输入省市区、街道门牌等完整收货地址" maxlength="200" placeholder-class="input-placeholder" bindinput="onShippingAddressChange" />
|
||||
<text class="address-tip">收货人与联系电话使用所选就诊人信息</text>
|
||||
</view>
|
||||
@@ -179,4 +193,4 @@
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
+105
-5
@@ -50,6 +50,7 @@ page {
|
||||
box-shadow: var(--shadow-card);
|
||||
}
|
||||
|
||||
/* 陪诊项目:展示沿用原项目卡片,点击卡片展开下拉列表 */
|
||||
.service-picker-row {
|
||||
padding: 24rpx 0;
|
||||
border-bottom: 2rpx solid var(--line);
|
||||
@@ -60,6 +61,10 @@ page {
|
||||
margin-top: 16rpx;
|
||||
}
|
||||
|
||||
.service-picker.is-disabled {
|
||||
opacity: 0.6;
|
||||
}
|
||||
|
||||
.order-service-info {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
@@ -78,26 +83,34 @@ page {
|
||||
height: 80rpx;
|
||||
}
|
||||
|
||||
/* 项目名称与价格同一行,价格靠右,右侧留出更大间距 */
|
||||
.order-service-text {
|
||||
display: flex;
|
||||
flex: 1;
|
||||
min-width: 0;
|
||||
margin: 0 16rpx 0 12rpx;
|
||||
align-items: center;
|
||||
margin: 0 56rpx 0 12rpx;
|
||||
}
|
||||
|
||||
.order-service-title {
|
||||
display: block;
|
||||
flex: 1;
|
||||
min-width: 0;
|
||||
overflow: hidden;
|
||||
color: var(--ink);
|
||||
font-size: var(--fs-32);
|
||||
font-weight: 700;
|
||||
line-height: 1.4;
|
||||
text-overflow: ellipsis;
|
||||
white-space: nowrap;
|
||||
}
|
||||
|
||||
.order-service-price {
|
||||
display: block;
|
||||
margin-top: 6rpx;
|
||||
flex-shrink: 0;
|
||||
margin-left: 16rpx;
|
||||
color: var(--brand-ink);
|
||||
font-size: var(--fs-28);
|
||||
font-size: var(--fs-32);
|
||||
font-weight: 700;
|
||||
line-height: 1.4;
|
||||
}
|
||||
|
||||
.service-picker-arrow {
|
||||
@@ -110,6 +123,93 @@ page {
|
||||
border: 2rpx solid var(--brand-line);
|
||||
border-radius: 50%;
|
||||
background: var(--white);
|
||||
transition: transform 0.2s ease;
|
||||
}
|
||||
|
||||
.service-picker-arrow.is-open {
|
||||
transform: rotate(180deg);
|
||||
}
|
||||
|
||||
/* 展开面板:浅橙衬底 + 浅橙描边,与「就诊医院」下拉同款 */
|
||||
.service-panel {
|
||||
margin: 12rpx 0 24rpx;
|
||||
padding: 0 20rpx 8rpx;
|
||||
border: 2rpx solid var(--brand-line);
|
||||
border-radius: 20rpx;
|
||||
background: var(--brand-soft);
|
||||
}
|
||||
|
||||
.service-options {
|
||||
margin-top: 4rpx;
|
||||
}
|
||||
|
||||
.service-option {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
padding: 16rpx 0;
|
||||
border-bottom: 2rpx solid var(--sep);
|
||||
}
|
||||
|
||||
.service-option:last-child {
|
||||
border-bottom: none;
|
||||
}
|
||||
|
||||
.service-option:active {
|
||||
background: var(--white);
|
||||
}
|
||||
|
||||
.service-option-mark {
|
||||
display: flex;
|
||||
flex-shrink: 0;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
width: 72rpx;
|
||||
height: 72rpx;
|
||||
}
|
||||
|
||||
/* 名称与价格同一行:名称左对齐并自适应截断,价格靠右 */
|
||||
.service-option-name {
|
||||
flex: 1;
|
||||
min-width: 0;
|
||||
margin-left: 12rpx;
|
||||
overflow: hidden;
|
||||
color: var(--ink);
|
||||
font-size: var(--fs-30);
|
||||
font-weight: 700;
|
||||
line-height: 1.4;
|
||||
text-overflow: ellipsis;
|
||||
white-space: nowrap;
|
||||
}
|
||||
|
||||
.service-option.active .service-option-name {
|
||||
color: var(--brand-ink);
|
||||
}
|
||||
|
||||
.service-option-sub {
|
||||
flex-shrink: 0;
|
||||
margin-left: 16rpx;
|
||||
color: var(--brand-ink);
|
||||
font-size: var(--fs-26);
|
||||
font-weight: 700;
|
||||
line-height: 1.4;
|
||||
}
|
||||
|
||||
.service-option-selected {
|
||||
flex-shrink: 0;
|
||||
margin-left: 16rpx;
|
||||
color: var(--brand-ink);
|
||||
font-size: var(--fs-26);
|
||||
}
|
||||
|
||||
.service-empty {
|
||||
padding: 32rpx 0;
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
.service-empty-text {
|
||||
display: block;
|
||||
color: var(--muted);
|
||||
font-size: var(--fs-30);
|
||||
}
|
||||
|
||||
.order-row {
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
const API = require('../../utils/api.js')
|
||||
|
||||
const { parseDate, formatDate, formatDateTime, calcAge } = require('../../utils/date.js')
|
||||
const { parseDate, formatDate, formatDateTime, calcAge, LATEST_APPOINTMENT_TIME, buildTimeSlots } = require('../../utils/date.js')
|
||||
const { STATUS_MAP, PAYMENT_STATUS_MAP, resolveOrderStatus } = require('../../utils/order.js')
|
||||
const { maskIdNumber, maskOrderId } = require('../../utils/privacy.js')
|
||||
|
||||
@@ -34,16 +34,15 @@ Page({
|
||||
loadError: '',
|
||||
// 编辑全部收进底部弹窗:页面只读,表单只活在弹窗里,两个弹窗各自一个开关
|
||||
showNotePopup: false,
|
||||
editPatientNote: '',
|
||||
editMedicalHistory: '',
|
||||
editDemand: '',
|
||||
// 医院预约规则与下单页一致,均由订单关联的服务目录下发
|
||||
showHospitalPopup: false,
|
||||
provinces: [],
|
||||
hospitalOptions: [],
|
||||
minAppointmentDate: '',
|
||||
fixedTime: false,
|
||||
timeOptions: [],
|
||||
timeStart: '',
|
||||
timeEnd: '',
|
||||
// 预约时间:从服务起始时刻到 23:30,每半小时一档
|
||||
timeSlots: [],
|
||||
editHospital: {},
|
||||
showCancelPopup: false,
|
||||
cancelReason: '',
|
||||
@@ -120,24 +119,14 @@ Page({
|
||||
applyBookingConfig(service) {
|
||||
const booking = service.booking || {}
|
||||
const sessions = booking.sessions || []
|
||||
const fixedTime = sessions.length > 0 && sessions.every(item => !item.flexible)
|
||||
const firstSession = sessions[0] || {}
|
||||
const minDate = new Date()
|
||||
minDate.setDate(minDate.getDate() + Number(booking.advanceDays || 0))
|
||||
const minAppointmentDate = formatDate(minDate)
|
||||
let timeEnd = firstSession.end || ''
|
||||
if (!fixedTime && firstSession.end && booking.durationMinutes) {
|
||||
const [hour, minute] = firstSession.end.split(':').map(Number)
|
||||
const latest = hour * 60 + minute - booking.durationMinutes
|
||||
timeEnd = `${String(Math.floor(latest / 60)).padStart(2, '0')}:${String(latest % 60).padStart(2, '0')}`
|
||||
}
|
||||
this.setData({
|
||||
provinces: service.areas || [],
|
||||
minAppointmentDate,
|
||||
fixedTime,
|
||||
timeOptions: sessions.map(item => `${item.start} - ${item.end}`),
|
||||
timeStart: firstSession.start || '',
|
||||
timeEnd
|
||||
minAppointmentDate: formatDate(minDate),
|
||||
// 所有服务统一提供到 23:30 的开始时间档位(夜间陪诊也需覆盖晚间时段)
|
||||
timeSlots: buildTimeSlots(firstSession.start || '', LATEST_APPOINTMENT_TIME)
|
||||
})
|
||||
},
|
||||
|
||||
@@ -279,6 +268,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,
|
||||
@@ -344,6 +335,20 @@ Page({
|
||||
this.setData({ showAllDetails: !this.data.showAllDetails })
|
||||
},
|
||||
|
||||
// 一键拨打就诊人电话:家属代订时号码在自己手机通讯录之外的情况靠它
|
||||
onCallPatient() {
|
||||
const mobile = this.data.record.patientMobile
|
||||
if (!mobile) return
|
||||
wx.makePhoneCall({ phoneNumber: mobile })
|
||||
},
|
||||
|
||||
// 一键拨打陪诊师电话:就诊当天最高频动作,不做二次确认
|
||||
onCallAttendant() {
|
||||
const mobile = this.data.record.attendantMobile
|
||||
if (!mobile) return
|
||||
wx.makePhoneCall({ phoneNumber: mobile })
|
||||
},
|
||||
|
||||
// ===== 微信支付 =====
|
||||
|
||||
onPayOrder() {
|
||||
@@ -436,28 +441,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()
|
||||
@@ -465,7 +477,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' })
|
||||
@@ -489,8 +502,7 @@ Page({
|
||||
? this.data.provinces[matchedProvinceIndex]
|
||||
: (r.hospitalProvince || this.data.provinces[0] || '')
|
||||
const provinceIndex = Math.max(0, matchedProvinceIndex)
|
||||
const sessions = this.data.service?.booking?.sessions || []
|
||||
const sessionIndex = Math.max(0, sessions.findIndex(item => item.start === r.scheduleStartTime))
|
||||
const timeSlotIndex = Math.max(0, this.data.timeSlots.indexOf(r.scheduleStartTime))
|
||||
|
||||
const hospitalOptions = getApp().getHospitalsByProvince(province)
|
||||
const name = r.hospitalName || ''
|
||||
@@ -508,7 +520,7 @@ Page({
|
||||
medicalRecordNo: r.medicalRecordNo || '',
|
||||
scheduleDate: r.scheduleDate || '',
|
||||
startTime: r.scheduleStartTime || '',
|
||||
sessionIndex
|
||||
timeSlotIndex
|
||||
}
|
||||
})
|
||||
},
|
||||
@@ -545,16 +557,11 @@ Page({
|
||||
},
|
||||
|
||||
onStartTimeChange(e) {
|
||||
if (this.data.fixedTime) {
|
||||
const sessionIndex = Number(e.detail.value)
|
||||
const session = this.data.service.booking.sessions[sessionIndex]
|
||||
this.setData({
|
||||
'editHospital.sessionIndex': sessionIndex,
|
||||
'editHospital.startTime': session.start
|
||||
})
|
||||
return
|
||||
}
|
||||
this.setData({ 'editHospital.startTime': e.detail.value })
|
||||
const index = Number(e.detail.value)
|
||||
this.setData({
|
||||
'editHospital.timeSlotIndex': index,
|
||||
'editHospital.startTime': this.data.timeSlots[index] || ''
|
||||
})
|
||||
},
|
||||
|
||||
onCancelHospitalEdit() {
|
||||
|
||||
+125
-73
@@ -60,7 +60,6 @@
|
||||
<text class="appt-label">医院</text>
|
||||
<view class="appt-value">
|
||||
<text class="appt-text {{!record.hospitalName ? 'is-empty' : ''}}">{{record.hospitalName || '就诊医院待补充'}}</text>
|
||||
<text class="appt-text" wx:if="{{record.hospitalDepartment}}"> · {{record.hospitalDepartment}}</text>
|
||||
<text class="appt-sub" wx:if="{{record.hospitalAddress}}">{{record.hospitalAddress}}</text>
|
||||
</view>
|
||||
<view
|
||||
@@ -73,6 +72,13 @@
|
||||
<t-icon name="edit" size="28rpx" color="#6F655C" />
|
||||
</view>
|
||||
</view>
|
||||
<!-- 科室独立成行:家属核对「去哪个科」不用在医院名后找小字拼接 -->
|
||||
<view class="appt-row" wx:if="{{record.hospitalDepartment}}">
|
||||
<text class="appt-label">科室</text>
|
||||
<view class="appt-value">
|
||||
<text class="appt-text">{{record.hospitalDepartment}}</text>
|
||||
</view>
|
||||
</view>
|
||||
<!-- 就诊人先于服务:家属打开单据第一件事往往是核对「是不是我家老人」,
|
||||
这比看订的是哪项服务更靠前;就诊人降为一行即可,
|
||||
陪诊师不在此行重复,下方独立卡片承载姓名与电话 -->
|
||||
@@ -93,6 +99,22 @@
|
||||
<t-icon name="chevron-right" size="28rpx" color="#6F655C" />
|
||||
</view>
|
||||
</view>
|
||||
<!-- 电话:家属代订时常用自己的手机操作,就诊人号码未必背得,
|
||||
显示出来并给实心拨打钮,与陪诊师卡片的拨打同款式 -->
|
||||
<view class="appt-row" wx:if="{{record.patientMobile}}">
|
||||
<text class="appt-label">电话</text>
|
||||
<view class="appt-value">
|
||||
<text class="appt-text">{{record.patientMobile}}</text>
|
||||
</view>
|
||||
<view
|
||||
class="row-call"
|
||||
aria-role="button"
|
||||
aria-label="拨打就诊人电话"
|
||||
bindtap="onCallPatient"
|
||||
>
|
||||
<t-icon name="call" size="28rpx" color="#6F655C" />
|
||||
</view>
|
||||
</view>
|
||||
<view class="appt-row">
|
||||
<text class="appt-label">服务</text>
|
||||
<view class="appt-value">
|
||||
@@ -100,39 +122,15 @@
|
||||
<text class="appt-text" wx:if="{{record.sexRequirementText}}"> · 性别要求{{record.sexRequirementText}}</text>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<!-- 费用:标签与金额同行对齐;支付状态胶囊收在行尾 -->
|
||||
<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 class="appt-row" wx:if="{{record.patientNote}}">
|
||||
<text class="appt-label">备注</text>
|
||||
<view class="appt-value">
|
||||
<text class="appt-text appt-note">{{record.patientNote}}</text>
|
||||
</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 class="cancel-summary" wx:if="{{record.status === 'cancelled' && record.cancelReason}}">
|
||||
<text class="cancel-summary-label">取消原因</text>
|
||||
<text class="cancel-summary-value">{{record.cancelReason}}</text>
|
||||
@@ -183,7 +181,8 @@
|
||||
<!-- 陪诊师卡片:已派单显示名与电话;派单正常时后台会写姓名,
|
||||
若只有 id 未冗余名则退成「已安排」,不误报「待分配」。
|
||||
未派单(如待确认)显示占位,让用户知道「会有一位陪诊师」;
|
||||
已取消、已完成且无人可联系时不出现——那是正常结果,不必提示 -->
|
||||
已取消、已完成且无人可联系时不出现——那是正常结果,不必提示。
|
||||
有电话时右侧给实心「拨打」钮:就诊当天最核心动作是一键呼出,不必抄号 -->
|
||||
<view class="section attendant-section" wx:if="{{record.hasAttendant || (record.status !== 'cancelled' && record.status !== 'completed')}}">
|
||||
<view class="section-head">
|
||||
<view class="section-bar"></view>
|
||||
@@ -191,28 +190,42 @@
|
||||
</view>
|
||||
|
||||
<view class="card attendant-card">
|
||||
<text class="attendant-name" wx:if="{{record.hasAttendant}}">{{record.attendantName || '已安排'}}</text>
|
||||
<text class="attendant-empty" wx:else>待分配</text>
|
||||
<text class="attendant-phone" wx:if="{{record.attendantMobile}}">{{record.attendantMobile}}</text>
|
||||
<view class="attendant-avatar">{{record.attendantName ? record.attendantName[0] : '陪'}}</view>
|
||||
<view class="attendant-info">
|
||||
<text class="attendant-name" wx:if="{{record.hasAttendant}}">{{record.attendantName || '已安排'}}</text>
|
||||
<text class="attendant-empty" wx:else>待分配</text>
|
||||
<text class="attendant-phone" wx:if="{{record.attendantMobile}}">{{record.attendantMobile}}</text>
|
||||
</view>
|
||||
<view
|
||||
class="attendant-call"
|
||||
wx:if="{{record.attendantMobile}}"
|
||||
aria-role="button"
|
||||
aria-label="拨打陪诊师电话"
|
||||
bindtap="onCallAttendant"
|
||||
>拨打</view>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<!-- 有内容才铺正文;可编辑但内容为空时只留一个添加入口,不让空卡占位。
|
||||
已完成订单的陪诊记录和就诊摘要直接展示,不收入展开区 -->
|
||||
<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>
|
||||
@@ -223,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>
|
||||
@@ -369,22 +419,10 @@
|
||||
<view class="form-row">
|
||||
<text class="form-label">预约时间</text>
|
||||
<picker
|
||||
wx:if="{{fixedTime}}"
|
||||
class="form-picker"
|
||||
mode="selector"
|
||||
range="{{timeOptions}}"
|
||||
value="{{editHospital.sessionIndex}}"
|
||||
bindchange="onStartTimeChange"
|
||||
>
|
||||
<view class="form-picker-value">{{timeOptions[editHospital.sessionIndex] || '请选择服务班次'}}</view>
|
||||
</picker>
|
||||
<picker
|
||||
wx:else
|
||||
class="form-picker"
|
||||
mode="time"
|
||||
value="{{editHospital.startTime}}"
|
||||
start="{{timeStart}}"
|
||||
end="{{timeEnd}}"
|
||||
range="{{timeSlots}}"
|
||||
value="{{editHospital.timeSlotIndex}}"
|
||||
bindchange="onStartTimeChange"
|
||||
>
|
||||
<view class="form-picker-value">{{editHospital.startTime || '请选择时间'}}</view>
|
||||
@@ -397,29 +435,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>
|
||||
|
||||
|
||||
+199
-91
@@ -10,8 +10,8 @@
|
||||
- 陪诊需求、陪诊记录与就诊摘要仅在有内容时出现,已完成订单的服务结果直接展示;
|
||||
- 修改仍按就诊人、医院预约、陪诊需求分区,表单只存在于档案页或底部弹窗;
|
||||
- 配色沿用 app.wxss 暖橙令牌,状态文字与颜色共同传达信息;
|
||||
- 字号阶梯:36 日期 / 34 金额 · 分区标题 · 姓名 · 弹窗标题 / 30 行值(医院 · 服务 · 电话 · 正文)
|
||||
/ 26-28 标签 · 地址 · 辅助说明,最小 26rpx */
|
||||
- 字号层级:36 日期 / 32 标题与重点信息 / 30 正文 / 28 标签 / 26 辅助信息;
|
||||
字重只用常规与 600,统一系统字体,避免相近字号和字重堆叠造成视觉杂乱 */
|
||||
page {
|
||||
background-color: var(--paper);
|
||||
|
||||
@@ -22,10 +22,17 @@ page {
|
||||
.page-bg {
|
||||
min-height: 100vh;
|
||||
background: var(--paper);
|
||||
font-family: inherit;
|
||||
}
|
||||
|
||||
.page-bg button,
|
||||
.page-bg input,
|
||||
.page-bg textarea {
|
||||
font-family: inherit;
|
||||
}
|
||||
|
||||
.container {
|
||||
padding: 0 32rpx 40rpx;
|
||||
padding: 0 32rpx 48rpx;
|
||||
}
|
||||
|
||||
.page-state {
|
||||
@@ -52,7 +59,7 @@ page {
|
||||
background: transparent;
|
||||
color: var(--brand-strong);
|
||||
font-size: var(--fs-30);
|
||||
font-weight: 500;
|
||||
font-weight: 600;
|
||||
line-height: 1.5;
|
||||
}
|
||||
|
||||
@@ -63,11 +70,11 @@ page {
|
||||
/* ===== 抬头状态 ===== */
|
||||
.page-header {
|
||||
/* 抬头自成一区,靠空间 + 一条线立住,不引入第二套容器语言:
|
||||
上方留白 40rpx(比卡间距 48rpx 略紧,让抬头贴住顶栏而非浮在中间);
|
||||
上方留白 40rpx(与分区间距一致,让抬头贴住顶栏而非浮在中间);
|
||||
左右负 margin 抵消 .container 的 32rpx 内距,使下方发丝线通栏顶到屏幕两侧,
|
||||
同时用 padding 把色标与胶囊重新拉回卡片同一条左对齐线 */
|
||||
margin: 0 -32rpx;
|
||||
padding: 40rpx 32rpx 28rpx;
|
||||
padding: 40rpx 32rpx 32rpx;
|
||||
border-bottom: 2rpx solid var(--line);
|
||||
}
|
||||
|
||||
@@ -79,7 +86,7 @@ page {
|
||||
}
|
||||
|
||||
.status-row {
|
||||
margin-top: 22rpx;
|
||||
margin-top: 24rpx;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
}
|
||||
@@ -110,8 +117,8 @@ page {
|
||||
border: 2rpx solid transparent;
|
||||
border-radius: 10rpx;
|
||||
font-size: var(--fs-26);
|
||||
font-weight: 700;
|
||||
letter-spacing: 1rpx;
|
||||
font-weight: 600;
|
||||
letter-spacing: 0;
|
||||
line-height: 1.4;
|
||||
white-space: nowrap;
|
||||
}
|
||||
@@ -131,15 +138,15 @@ page {
|
||||
min-width: 0;
|
||||
margin-left: 20rpx;
|
||||
/* 说明保持比 32rpx 的胶囊低一档,抬头内部才有焦点 */
|
||||
font-size: var(--fs-28);
|
||||
font-size: var(--fs-26);
|
||||
color: var(--muted);
|
||||
line-height: 1.6;
|
||||
letter-spacing: 1rpx;
|
||||
letter-spacing: 0;
|
||||
}
|
||||
|
||||
/* ===== 分区:纸面留白分隔,标题在纸面上、内容在白卡里 ===== */
|
||||
.section {
|
||||
margin-top: 48rpx;
|
||||
margin-top: 40rpx;
|
||||
}
|
||||
|
||||
.section-head {
|
||||
@@ -151,18 +158,18 @@ page {
|
||||
flex-shrink: 0;
|
||||
width: 8rpx;
|
||||
/* 色标高度跟随标题字号,缩字号时同步收,保持「短横 + 标题」的等高一档 */
|
||||
height: 34rpx;
|
||||
height: 32rpx;
|
||||
border-radius: 4rpx;
|
||||
background: var(--brand-strong);
|
||||
}
|
||||
|
||||
/* 分区标题 34rpx,色标等高跟随 */
|
||||
/* 分区标题 32rpx,色标等高跟随 */
|
||||
.section-title {
|
||||
margin-left: 16rpx;
|
||||
font-size: var(--fs-34);
|
||||
font-weight: 700;
|
||||
font-size: var(--fs-32);
|
||||
font-weight: 600;
|
||||
color: var(--ink);
|
||||
letter-spacing: 1rpx;
|
||||
letter-spacing: 0;
|
||||
}
|
||||
|
||||
/* 区块右侧入口:用 padding 撑热区、负 margin 抵消,保持标题行高度 */
|
||||
@@ -183,23 +190,20 @@ page {
|
||||
.section-link-text {
|
||||
margin-right: 4rpx;
|
||||
/* 与图标同档:入口降为中性的同时留一点体量 */
|
||||
font-size: var(--fs-28);
|
||||
font-size: var(--fs-26);
|
||||
color: var(--muted);
|
||||
}
|
||||
|
||||
/* ===== 白卡:全页唯一的容器语言(§2.3 主规则) =====
|
||||
2rpx --line 发丝边、中性阴影 --shadow-card;
|
||||
卡内首尾留白由卡片自己的 padding 给。
|
||||
本页例外(已登记):圆角取 24rpx 而非 §2.3 的 28rpx——
|
||||
与卡内首字牌(24rpx)同档,圆角家族内部不倒挂;
|
||||
注意全站其余九页的白卡仍是 28rpx,从订单列表切进本页时卡片会略方一点 */
|
||||
2rpx --line 发丝边、中性阴影 --shadow-card、28rpx 圆角,
|
||||
与全站其余页面的白卡同一档,跨页跳转不再「卡一下」 */
|
||||
.card {
|
||||
box-sizing: border-box;
|
||||
margin-top: 16rpx;
|
||||
padding: 20rpx 24rpx;
|
||||
padding: 24rpx;
|
||||
background: var(--white);
|
||||
border: 2rpx solid var(--line);
|
||||
border-radius: 24rpx;
|
||||
border-radius: 28rpx;
|
||||
box-shadow: var(--shadow-card);
|
||||
}
|
||||
|
||||
@@ -213,7 +217,7 @@ page {
|
||||
.meta-item {
|
||||
font-size: var(--fs-26);
|
||||
color: var(--muted);
|
||||
letter-spacing: 1rpx;
|
||||
letter-spacing: 0;
|
||||
line-height: 1.6;
|
||||
}
|
||||
|
||||
@@ -232,7 +236,7 @@ page {
|
||||
「医院 / 服务 / 陪诊师 / 就诊人」四行小标签作答,底部一行费用 */
|
||||
.appointment-card {
|
||||
margin-top: 32rpx;
|
||||
padding: 28rpx;
|
||||
padding: 24rpx;
|
||||
}
|
||||
|
||||
/* 时间块:卡内首落点。日期给全卡最大字号——它是唯一会过期的
|
||||
@@ -254,9 +258,9 @@ page {
|
||||
.schedule-date {
|
||||
flex-shrink: 0;
|
||||
font-size: 36rpx;
|
||||
font-weight: 700;
|
||||
font-weight: 600;
|
||||
color: var(--ink);
|
||||
letter-spacing: 1rpx;
|
||||
letter-spacing: 0;
|
||||
line-height: 1.4;
|
||||
}
|
||||
|
||||
@@ -267,10 +271,10 @@ page {
|
||||
}
|
||||
|
||||
.schedule-time {
|
||||
font-size: var(--fs-28);
|
||||
font-weight: 700;
|
||||
font-size: var(--fs-30);
|
||||
font-weight: 600;
|
||||
color: var(--brand-ink);
|
||||
letter-spacing: 1rpx;
|
||||
letter-spacing: 0;
|
||||
}
|
||||
|
||||
/* 完整信息入口:卡片右上角的向下箭头,展开后翻转成向上。
|
||||
@@ -302,17 +306,18 @@ page {
|
||||
}
|
||||
|
||||
/* 行右入口:只留图标,靠位置与热区成立,不靠颜色。
|
||||
负 margin 把热区撑到 88rpx 而不撑高行 */
|
||||
行尾图标统一尺寸与负 margin,让修改、箭头、拨打三枚图标
|
||||
都落在首行文字的同一条垂直中线上(48rpx 首行:88rpx 热区上下各负 20rpx) */
|
||||
.row-entry {
|
||||
box-sizing: border-box;
|
||||
flex-shrink: 0;
|
||||
align-self: flex-start;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: flex-end;
|
||||
min-width: 64rpx;
|
||||
justify-content: center;
|
||||
width: 72rpx;
|
||||
min-height: 88rpx;
|
||||
margin: -24rpx -8rpx -24rpx 16rpx;
|
||||
padding-left: 16rpx;
|
||||
margin: -20rpx 0 -20rpx 16rpx;
|
||||
}
|
||||
|
||||
.row-entry:active {
|
||||
@@ -327,16 +332,16 @@ page {
|
||||
.appt-row {
|
||||
display: flex;
|
||||
align-items: baseline;
|
||||
padding: 16rpx 0;
|
||||
padding: 12rpx 0;
|
||||
}
|
||||
|
||||
/* 标签列按最长三字标签(陪诊师 / 就诊人)留宽,值的起点不错位 */
|
||||
.appt-label {
|
||||
flex-shrink: 0;
|
||||
width: 96rpx;
|
||||
font-size: var(--fs-26);
|
||||
font-size: var(--fs-28);
|
||||
color: var(--muted);
|
||||
letter-spacing: 1rpx;
|
||||
letter-spacing: 0;
|
||||
line-height: 1.8;
|
||||
}
|
||||
|
||||
@@ -352,7 +357,7 @@ page {
|
||||
.appt-text {
|
||||
font-size: var(--fs-30);
|
||||
color: var(--ink);
|
||||
letter-spacing: 1rpx;
|
||||
letter-spacing: 0;
|
||||
line-height: 1.6;
|
||||
}
|
||||
|
||||
@@ -360,29 +365,70 @@ page {
|
||||
color: var(--muted);
|
||||
}
|
||||
|
||||
/* 备注是客户原话,可能多行长句:放宽行高、允许任意断行 */
|
||||
.appt-note {
|
||||
flex-basis: 100%;
|
||||
word-break: break-all;
|
||||
line-height: 1.7;
|
||||
}
|
||||
|
||||
/* 电话行拨打钮:只给一枚电话图标,无底色无描边,
|
||||
靠暖橙图标与位置成立;尺寸与负 margin 和 .row-entry 一致,
|
||||
三枚行尾图标共用同一条垂直中线 */
|
||||
.row-call {
|
||||
box-sizing: border-box;
|
||||
flex-shrink: 0;
|
||||
align-self: flex-start;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
width: 72rpx;
|
||||
min-height: 88rpx;
|
||||
margin: -20rpx 0 -20rpx 16rpx;
|
||||
}
|
||||
|
||||
.row-call:active {
|
||||
opacity: 0.7;
|
||||
}
|
||||
|
||||
/* 地址:医院行下的副行,换行独占。
|
||||
颜色用 --ink-2:老人靠它找到地方,不能压成浅灰小字 */
|
||||
.appt-sub {
|
||||
flex-basis: 100%;
|
||||
font-size: var(--fs-28);
|
||||
font-size: var(--fs-26);
|
||||
color: var(--ink-2);
|
||||
letter-spacing: 1rpx;
|
||||
letter-spacing: 0;
|
||||
line-height: 1.6;
|
||||
}
|
||||
|
||||
/* 费用与支付:独立分区,排在陪诊需求之后 */
|
||||
.pay-section {
|
||||
margin-top: 40rpx;
|
||||
}
|
||||
|
||||
.pay-card {
|
||||
padding: 24rpx;
|
||||
}
|
||||
|
||||
/* 卡内首行不再画顶边:分隔线由第二行(支付方式)自己提供 */
|
||||
.pay-card .fee-line {
|
||||
padding-top: 0;
|
||||
border-top: none;
|
||||
}
|
||||
|
||||
/* 费用行:标签列与上行对齐,金额主色,支付状态胶囊收行尾 */
|
||||
.fee-line {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
padding-top: 20rpx;
|
||||
padding-top: 16rpx;
|
||||
border-top: 2rpx solid var(--line);
|
||||
}
|
||||
|
||||
.fee-amount {
|
||||
font-size: var(--fs-34);
|
||||
font-weight: 700;
|
||||
font-size: var(--fs-32);
|
||||
font-weight: 600;
|
||||
color: var(--brand-strong);
|
||||
letter-spacing: 1rpx;
|
||||
letter-spacing: 0;
|
||||
line-height: 1.4;
|
||||
}
|
||||
|
||||
@@ -394,8 +440,8 @@ page {
|
||||
|
||||
/* 取消原因:--paper 底在白卡上只差 1.06:1,靠描边托形 */
|
||||
.cancel-summary {
|
||||
margin-top: 16rpx;
|
||||
padding: 16rpx 20rpx;
|
||||
margin-top: 12rpx;
|
||||
padding: 12rpx 20rpx;
|
||||
border: 2rpx solid var(--line);
|
||||
border-radius: 16rpx;
|
||||
background: var(--paper);
|
||||
@@ -403,24 +449,37 @@ page {
|
||||
|
||||
.cancel-summary-label {
|
||||
display: block;
|
||||
font-size: var(--fs-26);
|
||||
font-size: var(--fs-28);
|
||||
color: var(--muted);
|
||||
}
|
||||
|
||||
.cancel-summary-value {
|
||||
display: block;
|
||||
margin-top: 6rpx;
|
||||
font-size: var(--fs-28);
|
||||
font-size: var(--fs-26);
|
||||
color: var(--ink-2);
|
||||
line-height: 1.5;
|
||||
}
|
||||
|
||||
/* ===== 完整信息:默认折叠,展开后按资料类型分组 ===== */
|
||||
/* ===== 完整信息:默认折叠,展开后按资料类型分组 =====
|
||||
展开时淡入 + 轻微下落入场,与箭头旋转同步,避免内容硬切闪现 */
|
||||
@keyframes details-in {
|
||||
from {
|
||||
opacity: 0;
|
||||
transform: translateY(-8rpx);
|
||||
}
|
||||
to {
|
||||
opacity: 1;
|
||||
transform: translateY(0);
|
||||
}
|
||||
}
|
||||
|
||||
.full-details {
|
||||
/* 展开区自带顶边:费用行不画底边,取消原因也自带边,
|
||||
任一块出现都只落一条分隔线 */
|
||||
margin-top: 16rpx;
|
||||
border-top: 2rpx solid var(--line);
|
||||
animation: details-in 0.24s ease-out;
|
||||
}
|
||||
|
||||
/* 首个分组不再重复画顶边:它紧接 full-details 的顶边,
|
||||
@@ -432,7 +491,7 @@ page {
|
||||
|
||||
.detail-group {
|
||||
margin-top: 8rpx;
|
||||
padding: 24rpx 0 8rpx;
|
||||
padding: 16rpx 0 4rpx;
|
||||
border-top: 2rpx solid var(--line);
|
||||
}
|
||||
|
||||
@@ -444,8 +503,8 @@ page {
|
||||
|
||||
.detail-group-title {
|
||||
display: block;
|
||||
font-size: var(--fs-28);
|
||||
font-weight: 700;
|
||||
font-size: var(--fs-26);
|
||||
font-weight: 600;
|
||||
color: var(--ink);
|
||||
}
|
||||
|
||||
@@ -456,12 +515,12 @@ page {
|
||||
.detail-row {
|
||||
display: flex;
|
||||
align-items: flex-start;
|
||||
margin-top: 16rpx;
|
||||
margin-top: 10rpx;
|
||||
}
|
||||
|
||||
.detail-label {
|
||||
flex-shrink: 0;
|
||||
font-size: var(--fs-26);
|
||||
font-size: var(--fs-28);
|
||||
color: var(--muted);
|
||||
line-height: 1.6;
|
||||
}
|
||||
@@ -470,7 +529,7 @@ page {
|
||||
flex: 1;
|
||||
min-width: 0;
|
||||
margin-left: 24rpx;
|
||||
font-size: var(--fs-28);
|
||||
font-size: var(--fs-26);
|
||||
color: var(--ink-2);
|
||||
line-height: 1.5;
|
||||
text-align: right;
|
||||
@@ -479,15 +538,15 @@ page {
|
||||
.shipping-recipient {
|
||||
display: block;
|
||||
margin-top: 16rpx;
|
||||
font-size: var(--fs-28);
|
||||
font-weight: 700;
|
||||
font-size: var(--fs-26);
|
||||
font-weight: 600;
|
||||
color: var(--ink);
|
||||
}
|
||||
|
||||
.shipping-address {
|
||||
display: block;
|
||||
margin-top: 8rpx;
|
||||
font-size: var(--fs-28);
|
||||
font-size: var(--fs-26);
|
||||
color: var(--ink-2);
|
||||
line-height: 1.6;
|
||||
}
|
||||
@@ -495,15 +554,15 @@ page {
|
||||
/* 订单号是需要逐字核对的标识符:左对齐、允许断行,不跟随右侧值的右对齐 */
|
||||
.order-no {
|
||||
text-align: left;
|
||||
letter-spacing: 1rpx;
|
||||
letter-spacing: 0;
|
||||
word-break: break-all;
|
||||
}
|
||||
|
||||
/* ===== 陪诊师卡片:平台分配后才出现 =====
|
||||
就诊当天要联系的人单独成卡,只用「名 + 电话」两段,
|
||||
名字 34rpx 立住身份,电话弱一档在右侧,扫一眼就能报出是谁 */
|
||||
就诊当天要联系的人单独成卡:首字牌立住「是谁」,名 + 电话在中间,
|
||||
右侧实心「拨打」是本卡唯一动作——不用抄号,也不让电话文字承担点击 */
|
||||
.attendant-section {
|
||||
margin-top: 32rpx;
|
||||
margin-top: 40rpx;
|
||||
}
|
||||
|
||||
.attendant-card {
|
||||
@@ -513,39 +572,80 @@ page {
|
||||
padding: 24rpx;
|
||||
}
|
||||
|
||||
.attendant-name {
|
||||
/* 首字牌:浅橙圆底 + 姓氏首字,与性别选中块同一套暖橙语言 */
|
||||
.attendant-avatar {
|
||||
box-sizing: border-box;
|
||||
flex-shrink: 0;
|
||||
font-size: var(--fs-34);
|
||||
font-weight: 700;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
width: 88rpx;
|
||||
height: 88rpx;
|
||||
border-radius: 50%;
|
||||
background: var(--brand-soft);
|
||||
border: 2rpx solid var(--brand-line);
|
||||
color: var(--brand-ink);
|
||||
font-size: var(--fs-32);
|
||||
font-weight: 600;
|
||||
}
|
||||
|
||||
.attendant-info {
|
||||
flex: 1;
|
||||
min-width: 0;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
gap: 4rpx;
|
||||
}
|
||||
|
||||
.attendant-name {
|
||||
font-size: var(--fs-32);
|
||||
font-weight: 600;
|
||||
color: var(--ink);
|
||||
letter-spacing: 1rpx;
|
||||
letter-spacing: 0;
|
||||
line-height: 1.4;
|
||||
}
|
||||
|
||||
/* 电话靠右对齐:等宽数字不跳字,长号码也只会压缩自己不会挤名字 */
|
||||
/* 电话弱一档在名下:信息完整但不抢「拨打」的戏 */
|
||||
.attendant-phone {
|
||||
flex: 1;
|
||||
min-width: 0;
|
||||
text-align: right;
|
||||
font-size: var(--fs-30);
|
||||
font-size: var(--fs-26);
|
||||
color: var(--ink-2);
|
||||
letter-spacing: 1rpx;
|
||||
letter-spacing: 0;
|
||||
font-variant-numeric: tabular-nums;
|
||||
}
|
||||
|
||||
/* 待分配占位:比姓名低一档并退到灰字,读作「还没定」而不是「没有」 */
|
||||
.attendant-empty {
|
||||
flex: 1;
|
||||
min-width: 0;
|
||||
font-size: var(--fs-30);
|
||||
color: var(--muted);
|
||||
letter-spacing: 1rpx;
|
||||
letter-spacing: 0;
|
||||
line-height: 1.5;
|
||||
}
|
||||
|
||||
/* 拨打:卡内唯一实心小块,暖橙 + 白字,热区 72rpx 见方 */
|
||||
.attendant-call {
|
||||
flex-shrink: 0;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
min-width: 112rpx;
|
||||
min-height: 72rpx;
|
||||
padding: 0 28rpx;
|
||||
border-radius: 999rpx;
|
||||
background: var(--brand-strong);
|
||||
box-shadow: var(--shadow-cta);
|
||||
color: var(--white);
|
||||
font-size: var(--fs-26);
|
||||
font-weight: 600;
|
||||
letter-spacing: 0;
|
||||
}
|
||||
|
||||
.attendant-call:active {
|
||||
opacity: 0.7;
|
||||
}
|
||||
|
||||
/* ===== 需求与服务结果:有内容才出现 ===== */
|
||||
.note-section {
|
||||
margin-top: 32rpx;
|
||||
margin-top: 40rpx;
|
||||
}
|
||||
|
||||
.note-card {
|
||||
@@ -553,8 +653,8 @@ page {
|
||||
}
|
||||
|
||||
.note-block {
|
||||
margin-top: 20rpx;
|
||||
padding-top: 20rpx;
|
||||
margin-top: 24rpx;
|
||||
padding-top: 24rpx;
|
||||
border-top: 2rpx solid var(--line);
|
||||
}
|
||||
|
||||
@@ -567,7 +667,7 @@ page {
|
||||
.note-label {
|
||||
display: block;
|
||||
margin-bottom: 8rpx;
|
||||
font-size: var(--fs-26);
|
||||
font-size: var(--fs-28);
|
||||
color: var(--muted);
|
||||
}
|
||||
|
||||
@@ -576,7 +676,7 @@ page {
|
||||
font-size: var(--fs-30);
|
||||
color: var(--ink-2);
|
||||
line-height: 1.7;
|
||||
letter-spacing: 1rpx;
|
||||
letter-spacing: 0;
|
||||
word-break: break-word;
|
||||
}
|
||||
|
||||
@@ -595,7 +695,7 @@ page {
|
||||
|
||||
.note-add-text {
|
||||
margin-left: 8rpx;
|
||||
font-size: var(--fs-28);
|
||||
font-size: var(--fs-26);
|
||||
color: var(--brand-ink);
|
||||
}
|
||||
|
||||
@@ -654,6 +754,14 @@ page {
|
||||
line-height: 1.7;
|
||||
}
|
||||
|
||||
.note-field {
|
||||
margin-bottom: 24rpx;
|
||||
}
|
||||
|
||||
.note-field:last-child {
|
||||
margin-bottom: 0;
|
||||
}
|
||||
|
||||
.input-placeholder {
|
||||
color: var(--muted);
|
||||
}
|
||||
@@ -745,7 +853,7 @@ page {
|
||||
.action-primary {
|
||||
background: var(--brand-strong);
|
||||
color: var(--white);
|
||||
font-weight: 700;
|
||||
font-weight: 600;
|
||||
box-shadow: var(--shadow-cta);
|
||||
}
|
||||
|
||||
@@ -802,8 +910,8 @@ page {
|
||||
}
|
||||
|
||||
.popup-title {
|
||||
font-size: var(--fs-34);
|
||||
font-weight: 700;
|
||||
font-size: var(--fs-32);
|
||||
font-weight: 600;
|
||||
color: var(--ink);
|
||||
}
|
||||
|
||||
@@ -819,7 +927,7 @@ page {
|
||||
.popup-body {
|
||||
flex: 1;
|
||||
overflow-y: auto;
|
||||
padding: 20rpx 32rpx 28rpx;
|
||||
padding: 24rpx 32rpx 32rpx;
|
||||
}
|
||||
|
||||
/* ===== 取消订单弹窗内的原因单选 ===== */
|
||||
@@ -908,7 +1016,7 @@ page {
|
||||
.popup-btn-primary {
|
||||
background: var(--brand-strong);
|
||||
color: var(--white);
|
||||
font-weight: 700;
|
||||
font-weight: 600;
|
||||
}
|
||||
|
||||
/* 支付方式切换:待支付期间才出现,轻量一行,不额外占卡片高度 */
|
||||
@@ -928,8 +1036,8 @@ page {
|
||||
|
||||
.pay-switch-value {
|
||||
color: var(--ink);
|
||||
font-size: var(--fs-28);
|
||||
font-weight: 500;
|
||||
font-size: var(--fs-26);
|
||||
font-weight: 600;
|
||||
}
|
||||
|
||||
.pay-switch-action {
|
||||
|
||||
@@ -1,8 +1,7 @@
|
||||
{
|
||||
"navigationBarTitleText": "预约记录",
|
||||
"usingComponents": {
|
||||
"t-icon": "tdesign-miniprogram/icon/icon",
|
||||
"t-loading": "tdesign-miniprogram/loading/loading"
|
||||
"t-icon": "tdesign-miniprogram/icon/icon"
|
||||
},
|
||||
"enablePullDownRefresh": true,
|
||||
"backgroundTextStyle": "dark"
|
||||
|
||||
@@ -50,9 +50,8 @@
|
||||
>{{item.statusText}}</view>
|
||||
</view>
|
||||
|
||||
<!-- 预约时间 -->
|
||||
<!-- 预约时间:卡内第一眼信息,加粗立住,不用小图标加噪点 -->
|
||||
<view class="card-time">
|
||||
<t-icon name="time" size="26rpx" color="#6F655C" />
|
||||
<text class="time-text">{{item.appointmentTime}}</text>
|
||||
</view>
|
||||
|
||||
@@ -72,7 +71,8 @@
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<!-- 底部:费用 + 支付状态 + 详情入口暗示 -->
|
||||
<!-- 底部:费用 + 支付状态/支付入口。
|
||||
整卡可点进详情,右下不再放 chevron 暗示,减少一行里的元素数 -->
|
||||
<view class="card-foot">
|
||||
<view class="fee">
|
||||
<text class="fee-sym">¥</text>
|
||||
@@ -81,6 +81,7 @@
|
||||
<view class="foot-right">
|
||||
<view
|
||||
class="pay-chip"
|
||||
wx:if="{{!item.canPay}}"
|
||||
style="background: {{item.paymentStatusBg}}; color: {{item.paymentStatusColor}}; border-color: {{item.paymentStatusBorder}};"
|
||||
>{{item.paymentStatusText}}</view>
|
||||
<view
|
||||
@@ -89,7 +90,6 @@
|
||||
catchtap="onPayRecord"
|
||||
data-id="{{item._id}}"
|
||||
>去支付</view>
|
||||
<t-icon class="record-chevron" name="chevron-right" size="28rpx" color="#6F655C" />
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
@@ -102,16 +102,31 @@
|
||||
<button class="retry-btn" bindtap="retryLoad">重新加载</button>
|
||||
</view>
|
||||
|
||||
<!-- 空状态:两档口径不同,文案跟着当前档走 -->
|
||||
<!-- 空状态:两档口径不同,文案跟着当前档走;给一枚主按钮把空态变成预约入口 -->
|
||||
<view class="empty-state" wx:if="{{!loading && !loadError && records.length === 0}}">
|
||||
<t-icon name="file-unknown" size="120rpx" color="#A79C92" />
|
||||
<view class="empty-icon-wrap">
|
||||
<t-icon name="file-unknown" size="72rpx" color="#9B4508" />
|
||||
</view>
|
||||
<text class="empty-text">{{statusFilter ? '暂无进行中的预约' : '暂无陪诊记录'}}</text>
|
||||
<text class="empty-subtext">{{statusFilter ? '已结束的预约可在「全部预约」里查看' : '您还没有预约陪诊服务'}}</text>
|
||||
<view class="empty-cta" wx:if="{{!statusFilter}}" bindtap="onGoHome">预约陪诊服务</view>
|
||||
</view>
|
||||
|
||||
<!-- 加载中 -->
|
||||
<view class="loading-wrap" wx:if="{{loading}}">
|
||||
<t-loading theme="circular" size="40rpx" text="加载中..." />
|
||||
<!-- 加载中:骨架卡比居中转圈更稳,列表骨架与真实卡片同构,加载完不跳版 -->
|
||||
<view class="skeleton-list" wx:if="{{loading && records.length === 0}}">
|
||||
<view class="skeleton-card" wx:for="{{[1, 2, 3]}}" wx:key="*this">
|
||||
<view class="sk-row">
|
||||
<view class="sk-bar sk-type"></view>
|
||||
<view class="sk-bar sk-chip"></view>
|
||||
</view>
|
||||
<view class="sk-bar sk-time"></view>
|
||||
<view class="sk-bar sk-line"></view>
|
||||
<view class="sk-bar sk-line sk-short"></view>
|
||||
<view class="sk-row sk-foot">
|
||||
<view class="sk-bar sk-fee"></view>
|
||||
<view class="sk-bar sk-chip"></view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<!-- 到底提示 -->
|
||||
|
||||
+121
-19
@@ -5,8 +5,8 @@
|
||||
- 顶部筛选做成吸顶两段式分段控件(只有「进行中的 / 全部预约」两档):
|
||||
白底胶囊容器(发丝边 + 紧阴影)内两格等宽,选中格 = 浅橙底 + 暖橙字,
|
||||
未选中格 = --muted 字;两格带文字标签,颜色只做强化(§四.8)
|
||||
- 卡面走「白底 + 发丝边 + 紧阴影」(中性 --shadow-card,28rpx 圆角),
|
||||
与首页、清单页同一套白面语言
|
||||
- 卡面走「白底 + 中性紧阴影」(--shadow-card,28rpx 圆角,无描边),
|
||||
与首页、清单页同一套白面语言;描边只留给分段控件等小容器
|
||||
- 卡内四段:类型 + 状态 → 时间 → 就诊信息 → 费用 + 支付状态;
|
||||
长文本(需求、陪诊记录)交给详情页,保证每张卡一眼看完
|
||||
- 形状锁定:卡 28rpx、状态胶囊 10rpx、分段控件 999rpx
|
||||
@@ -115,7 +115,8 @@ page {
|
||||
padding: 28rpx 28rpx 24rpx;
|
||||
border-radius: 28rpx;
|
||||
background: var(--white);
|
||||
border: 2rpx solid var(--line);
|
||||
/* 去描边:白面与纸面的色差 + 阴影足够分层,边框叠阴影会让卡片显重;
|
||||
描边语言只留给分段控件、弹窗这类「需要收拢的小容器」 */
|
||||
box-shadow: var(--shadow-card);
|
||||
transition: transform 0.15s ease;
|
||||
}
|
||||
@@ -156,10 +157,13 @@ page {
|
||||
margin-top: 14rpx;
|
||||
}
|
||||
|
||||
/* 时间是卡内第一眼信息:加粗 + 主文字色,弱化图标后自身立住 */
|
||||
.time-text {
|
||||
margin-left: 8rpx;
|
||||
font-size: var(--fs-28);
|
||||
color: var(--ink-2);
|
||||
font-size: var(--fs-30);
|
||||
font-weight: 700;
|
||||
color: var(--ink);
|
||||
letter-spacing: 1rpx;
|
||||
font-variant-numeric: tabular-nums;
|
||||
}
|
||||
|
||||
.card-info {
|
||||
@@ -218,10 +222,6 @@ page {
|
||||
align-items: center;
|
||||
}
|
||||
|
||||
.record-chevron {
|
||||
margin-left: 12rpx;
|
||||
}
|
||||
|
||||
/* 支付状态胶囊:比订单状态轻一档(无底色的中性档只留字与描边) */
|
||||
.pay-chip {
|
||||
padding: 4rpx 14rpx;
|
||||
@@ -233,7 +233,7 @@ page {
|
||||
white-space: nowrap;
|
||||
}
|
||||
|
||||
/* ===== 空 / 错误 / 加载 / 到底 ===== */
|
||||
/* ===== 空 / 错误 / 骨架 / 到底 ===== */
|
||||
.error-state {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
@@ -269,13 +269,26 @@ page {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
align-items: center;
|
||||
padding-top: 180rpx;
|
||||
padding-top: 140rpx;
|
||||
}
|
||||
|
||||
/* 空态图标垫浅橙圆底:灰图标孤零零挂在纸面上显得「坏了」,
|
||||
品牌色圆底让它读作「这里将来有内容」 */
|
||||
.empty-icon-wrap {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
width: 160rpx;
|
||||
height: 160rpx;
|
||||
border-radius: 50%;
|
||||
background: var(--brand-soft);
|
||||
}
|
||||
|
||||
.empty-text {
|
||||
margin-top: 24rpx;
|
||||
margin-top: 32rpx;
|
||||
font-size: var(--fs-30);
|
||||
color: var(--muted);
|
||||
color: var(--ink);
|
||||
font-weight: 500;
|
||||
}
|
||||
|
||||
.empty-subtext {
|
||||
@@ -284,13 +297,102 @@ page {
|
||||
color: var(--muted);
|
||||
}
|
||||
|
||||
.loading-wrap {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
padding: 60rpx;
|
||||
/* 空态主按钮:把死胡同变成预约入口,样式与保存/拨打同一套实心暖橙 */
|
||||
.empty-cta {
|
||||
margin-top: 40rpx;
|
||||
padding: 22rpx 72rpx;
|
||||
border-radius: 999rpx;
|
||||
background: var(--brand-strong);
|
||||
box-shadow: var(--shadow-cta);
|
||||
color: var(--white);
|
||||
font-size: var(--fs-30);
|
||||
font-weight: 700;
|
||||
letter-spacing: 2rpx;
|
||||
}
|
||||
|
||||
.empty-cta:active {
|
||||
opacity: 0.7;
|
||||
}
|
||||
|
||||
/* ===== 骨架屏:与真实卡片同构,加载完成不跳版 ===== */
|
||||
.skeleton-list {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
margin-top: 12rpx;
|
||||
}
|
||||
|
||||
.skeleton-card {
|
||||
padding: 28rpx 28rpx 24rpx;
|
||||
border-radius: 28rpx;
|
||||
background: var(--white);
|
||||
box-shadow: var(--shadow-card);
|
||||
}
|
||||
|
||||
.skeleton-card + .skeleton-card {
|
||||
margin-top: 24rpx;
|
||||
}
|
||||
|
||||
.sk-row {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: space-between;
|
||||
}
|
||||
|
||||
.sk-foot {
|
||||
margin-top: 24rpx;
|
||||
padding-top: 22rpx;
|
||||
border-top: 2rpx solid var(--paper);
|
||||
}
|
||||
|
||||
/* 微光扫过:底色微微呼吸即可,不做复杂扫光动画 */
|
||||
.sk-bar {
|
||||
border-radius: 8rpx;
|
||||
background: var(--paper);
|
||||
animation: sk-breathe 1.2s ease-in-out infinite;
|
||||
}
|
||||
|
||||
@keyframes sk-breathe {
|
||||
0%, 100% {
|
||||
opacity: 1;
|
||||
}
|
||||
50% {
|
||||
opacity: 0.55;
|
||||
}
|
||||
}
|
||||
|
||||
.sk-type {
|
||||
width: 180rpx;
|
||||
height: 32rpx;
|
||||
}
|
||||
|
||||
.sk-chip {
|
||||
width: 96rpx;
|
||||
height: 32rpx;
|
||||
border-radius: 999rpx;
|
||||
}
|
||||
|
||||
.sk-time {
|
||||
width: 320rpx;
|
||||
height: 30rpx;
|
||||
margin-top: 24rpx;
|
||||
}
|
||||
|
||||
.sk-line {
|
||||
width: 60%;
|
||||
height: 28rpx;
|
||||
margin-top: 20rpx;
|
||||
}
|
||||
|
||||
.sk-short {
|
||||
width: 45%;
|
||||
}
|
||||
|
||||
.sk-fee {
|
||||
width: 140rpx;
|
||||
height: 34rpx;
|
||||
}
|
||||
|
||||
/* ===== 到底提示 ===== */
|
||||
.no-more {
|
||||
padding: 36rpx 0 8rpx;
|
||||
text-align: center;
|
||||
|
||||
@@ -98,7 +98,7 @@
|
||||
>
|
||||
<view class="home-icon"></view>
|
||||
</view>
|
||||
<button class="primary-btn {{saving ? 'primary-btn-disabled' : ''}}" bindtap="onSave">保存</button>
|
||||
<button class="primary-btn {{saving ? 'primary-btn-disabled' : ''}}" disabled="{{saving}}" bindtap="onSave">{{saving ? '保存中…' : '保存'}}</button>
|
||||
</view>
|
||||
|
||||
</view>
|
||||
|
||||
@@ -77,8 +77,8 @@ page {
|
||||
border-bottom: none;
|
||||
}
|
||||
|
||||
/* 标签走 --muted、值走 --ink 700:层级靠明度与字重拉开,
|
||||
不给可点性上色(DESIGN.md §2.2「三档只表示文字层级」) */
|
||||
/* 标签走 --muted、值走 --ink 500:层级靠明度与字重拉开,
|
||||
值不顶满 700——整页只有保存按钮是实心强调,表单自身保持安静 */
|
||||
.form-label {
|
||||
flex-shrink: 0;
|
||||
margin-right: 24rpx;
|
||||
@@ -92,7 +92,7 @@ page {
|
||||
min-width: 0;
|
||||
text-align: right;
|
||||
font-size: var(--fs-30);
|
||||
font-weight: 700;
|
||||
font-weight: 500;
|
||||
color: var(--ink);
|
||||
}
|
||||
|
||||
@@ -111,7 +111,7 @@ page {
|
||||
display: block;
|
||||
text-align: right;
|
||||
font-size: var(--fs-30);
|
||||
font-weight: 700;
|
||||
font-weight: 500;
|
||||
color: var(--ink);
|
||||
}
|
||||
|
||||
|
||||
@@ -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>
|
||||
<!-- 主行动按钮:通栏胶囊,直达服务列表(下单路径最短化) -->
|
||||
|
||||
+24
-30
@@ -5,17 +5,13 @@
|
||||
区块合并、间距收紧,靠发丝线与留白分层,不靠卡片堆叠。
|
||||
|
||||
===== 字体系统 =====
|
||||
字体栈与 app.wxss 一致:iOS 落到苹方、Windows/安卓落到雅黑或系统黑体,
|
||||
都属同一类无衬线,不强行加载外部字体,避免首屏体积与闪烁问题。
|
||||
字号、字重、字距全部收在下方的 --t-* / --tracking-* 令牌里,
|
||||
页面内不再出现散落的 font-size 字面量:
|
||||
展示数字 88 / 页面标题 44 / 区块标题 36 / 卡片主值 32 / 正文 28 / 注释 26
|
||||
中文只用 400、700 两档字重;大字标题字距为 0,小号英文标反而放宽到 4rpx,
|
||||
让"大标题紧、小标签松"形成对比,这是最省力的秩序感来源。
|
||||
价格等数字统一 tabular-nums,切数与位数变化时不会左右跳。
|
||||
字体栈与 app.wxss 一致,不加载外部字体。
|
||||
全页只保留四档字号:价格 64 / 页面标题 40 / 区块与卡片标题 32 / 正文与注释 28。
|
||||
辅助信息通过颜色和字重区分,不再额外增加字号;中文只用 400、700 两档字重。
|
||||
价格等数字统一 tabular-nums,避免位数变化时左右跳动。
|
||||
|
||||
===== 行高 =====
|
||||
单行标题 1.4–1.45,多行正文 1.7–1.75;中文方块字低于 1.4 发挤、高于 1.8 发散 */
|
||||
单行标题 1.4–1.45,多行正文 1.6–1.75。 */
|
||||
|
||||
.page-bg {
|
||||
min-height: 100vh;
|
||||
@@ -23,24 +19,22 @@
|
||||
font-family: -apple-system, BlinkMacSystemFont, 'PingFang SC', 'Microsoft YaHei', sans-serif;
|
||||
-webkit-font-smoothing: antialiased;
|
||||
|
||||
/* 72rpx:价格数字收小一号(原 88rpx),避免大号数字压过卡片信息 */
|
||||
--t-display: 72rpx;
|
||||
--t-h1: 44rpx;
|
||||
/* 36rpx 及以上不参与全局字号令牌(大字模式不放大),保持字面量 */
|
||||
--t-h2: 36rpx;
|
||||
/* 中小号三档接全局令牌,二期大字模式只需覆写 app.wxss 一处 */
|
||||
/* 四档字号:语义令牌可以复用,但不增加新的字体尺寸 */
|
||||
--t-display: 64rpx;
|
||||
--t-h1: 40rpx;
|
||||
--t-title: var(--fs-32);
|
||||
--t-body: var(--fs-28);
|
||||
--t-caption: var(--fs-26);
|
||||
--t-h2: var(--t-title);
|
||||
--t-caption: var(--t-body);
|
||||
--tracking-tight: -1rpx;
|
||||
--tracking-title: 1rpx;
|
||||
--tracking-label: 4rpx;
|
||||
--tracking-label: 2rpx;
|
||||
}
|
||||
|
||||
.container { padding: 32rpx 32rpx calc(48rpx + env(safe-area-inset-bottom)); }
|
||||
.container { padding: 28rpx 28rpx calc(48rpx + env(safe-area-inset-bottom)); }
|
||||
|
||||
/* ===== 页首 ===== */
|
||||
.page-header { padding: 24rpx 0 8rpx; }
|
||||
.page-header { padding: 20rpx 4rpx 4rpx; }
|
||||
/* 短横色标:页面级记号(首页 .page-accent 同一支),区块级留给竖条 */
|
||||
.header-accent { width: 64rpx; height: 8rpx; border-radius: 4rpx; background: var(--brand-strong); }
|
||||
.header-title {
|
||||
@@ -63,7 +57,7 @@
|
||||
box-shadow: var(--shadow-card);
|
||||
}
|
||||
.intro-card {
|
||||
margin-top: 32rpx; padding: 40rpx 24rpx; border-radius: 28rpx;
|
||||
margin-top: 28rpx; padding: 32rpx 16rpx; border-radius: 24rpx;
|
||||
background: var(--brand-soft); border-color: var(--brand-line);
|
||||
}
|
||||
|
||||
@@ -96,11 +90,11 @@
|
||||
}
|
||||
|
||||
/* ===== 区块标题 =====
|
||||
竖条高 = 标题字号(36rpx),与首页 / itemlist 同一支记号;
|
||||
竖条高 = 标题字号(32rpx),与首页 / itemlist 同一支记号;
|
||||
右侧英文小标只做节奏与秩序感,宽字距 + muted,不与中文标题争层级 */
|
||||
.section { margin-top: 44rpx; }
|
||||
.section-head { display: flex; align-items: baseline; margin-bottom: 20rpx; }
|
||||
.section-bar { width: 8rpx; height: 36rpx; border-radius: 4rpx; background: var(--brand-strong); flex-shrink: 0; align-self: center; }
|
||||
.section { margin-top: 36rpx; }
|
||||
.section-head { display: flex; align-items: baseline; margin-bottom: 16rpx; padding: 0 4rpx; }
|
||||
.section-bar { width: 8rpx; height: 32rpx; border-radius: 4rpx; background: var(--brand-strong); flex-shrink: 0; align-self: center; }
|
||||
.section-title {
|
||||
margin-left: 16rpx;
|
||||
font-size: var(--t-h2); font-weight: 700; line-height: 1.4;
|
||||
@@ -113,12 +107,12 @@
|
||||
}
|
||||
|
||||
/* ===== 白卡 ===== */
|
||||
.list-card { padding: 6rpx 26rpx; border-radius: 28rpx; }
|
||||
.list-card { padding: 4rpx 24rpx; border-radius: 24rpx; }
|
||||
|
||||
/* ===== 培训与考试:规格表 =====
|
||||
左标签 muted 小字、右取值 ink 粗体,一行一条,横向扫读最快 */
|
||||
.spec-card { padding-top: 4rpx; }
|
||||
.spec-row { display: flex; align-items: baseline; justify-content: space-between; padding: 24rpx 0; border-bottom: 2rpx solid var(--line); }
|
||||
.spec-row { display: flex; align-items: baseline; justify-content: space-between; padding: 22rpx 0; border-bottom: 2rpx solid var(--line); }
|
||||
.spec-row:last-of-type { border-bottom: none; }
|
||||
.spec-label {
|
||||
flex-shrink: 0;
|
||||
@@ -127,7 +121,7 @@
|
||||
}
|
||||
.spec-value {
|
||||
flex: 1; min-width: 0; margin-left: 32rpx; text-align: right;
|
||||
font-size: var(--t-title); font-weight: 700; line-height: 1.5;
|
||||
font-size: var(--t-body); font-weight: 700; line-height: 1.5;
|
||||
letter-spacing: 0; color: var(--ink); word-break: break-word;
|
||||
font-variant-numeric: tabular-nums;
|
||||
}
|
||||
@@ -171,8 +165,8 @@
|
||||
|
||||
/* ===== 报考联系:文字与二维码并排 =====
|
||||
二维码不必独占一行,说明与入口压在同一张卡里 */
|
||||
.contact-card { display: flex; align-items: center; padding: 20rpx 24rpx; }
|
||||
.contact-main { flex: 1; min-width: 0; padding-right: 24rpx; }
|
||||
.contact-card { display: flex; align-items: center; padding: 24rpx; }
|
||||
.contact-main { flex: 1; min-width: 0; padding-right: 20rpx; }
|
||||
.contact-lead {
|
||||
display: block;
|
||||
font-size: var(--t-title); font-weight: 700; line-height: 1.45;
|
||||
@@ -184,7 +178,7 @@
|
||||
font-size: var(--t-body); font-weight: 700; line-height: 1.5;
|
||||
letter-spacing: 0; color: var(--brand-ink);
|
||||
}
|
||||
.contact-qr { width: 280rpx; height: 260rpx; flex-shrink: 0; border-radius: 16rpx; }
|
||||
.contact-qr { width: 240rpx; height: 220rpx; flex-shrink: 0; border-radius: 16rpx; }
|
||||
|
||||
/* ===== 常见问题 =====
|
||||
问:一行粗体墨色;答:缩进到问句正文左缘,常规字重 ink-2 */
|
||||
|
||||
+32
-1
@@ -54,10 +54,41 @@ function toISOString(value) {
|
||||
return date ? date.toISOString() : null
|
||||
}
|
||||
|
||||
// 预约开始时间的最晚档位:所有服务统一可约到 23:30(整点/半点)
|
||||
const LATEST_APPOINTMENT_TIME = '23:30'
|
||||
|
||||
// 预约时间只取整点和半点:按 30 分钟步长生成 start~end 内可选的 HH:mm 列表
|
||||
function buildTimeSlots(start, end, stepMinutes = 30) {
|
||||
const startMinutes = parseTimeToMinutes(start)
|
||||
const endMinutes = parseTimeToMinutes(end)
|
||||
if (startMinutes === null || endMinutes === null || endMinutes < startMinutes) return []
|
||||
|
||||
const slots = []
|
||||
// 起点若不在整/半点上,从之后最近的整/半点开始
|
||||
let minutes = Math.ceil(startMinutes / stepMinutes) * stepMinutes
|
||||
while (minutes <= endMinutes) {
|
||||
slots.push(`${pad(Math.floor(minutes / 60))}:${pad(minutes % 60)}`)
|
||||
minutes += stepMinutes
|
||||
}
|
||||
return slots
|
||||
}
|
||||
|
||||
function parseTimeToMinutes(value) {
|
||||
if (!value) return null
|
||||
const match = /^(\d{1,2}):(\d{2})$/.exec(String(value))
|
||||
if (!match) return null
|
||||
const hour = Number(match[1])
|
||||
const minute = Number(match[2])
|
||||
if (hour > 23 || minute > 59) return null
|
||||
return hour * 60 + minute
|
||||
}
|
||||
|
||||
module.exports = {
|
||||
parseDate,
|
||||
formatDate,
|
||||
formatDateTime,
|
||||
calcAge,
|
||||
toISOString
|
||||
toISOString,
|
||||
LATEST_APPOINTMENT_TIME,
|
||||
buildTimeSlots
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user