This commit is contained in:
lik
2026-10-04 22:13:54 +08:00
parent f542b1dced
commit 530135fce3
9 changed files with 908 additions and 866 deletions
+26 -15
View File
@@ -1,18 +1,22 @@
const API = require('../../utils/api.js')
// 状态配色遵循 doc/DESIGN.md §三:四档状态色 + 状态说明文字,
// 颜色只做强化,文字才是信息。待确认与已确认同属「等待」阶段,共用待服务档
const STATUS_MAP = {
pending: { text: '待确认', color: '#F59E0B', bg: '#FEF3C7', gradient: 'linear-gradient(135deg, #F59E0B 0%, #D97706 100%)', icon: 'time', desc: '您的订单已提交,等待确认中' },
confirmed: { text: '已确认', color: '#3B82F6', bg: '#DBEAFE', gradient: 'linear-gradient(135deg, #3B82F6 0%, #2563EB 100%)', icon: 'check-circle', desc: '订单已确认,陪诊员将准时为您服务' },
in_progress: { text: '进行中', color: '#8B5CF6', bg: '#EDE9FE', gradient: 'linear-gradient(135deg, #8B5CF6 0%, #7C3AED 100%)', icon: 'play-circle', desc: '陪诊服务正在进行中' },
completed: { text: '已完成', color: '#10B981', bg: '#D1FAE5', gradient: 'linear-gradient(135deg, #10B981 0%, #059669 100%)', icon: 'check-circle-filled', desc: '陪诊服务已完成,感谢您的使用' },
cancelled: { text: '已取消', color: '#6B7280', bg: '#F3F4F6', gradient: 'linear-gradient(135deg, #9CA3AF 0%, #6B7280 100%)', icon: 'close-circle', desc: '该订单已取消' }
pending: { text: '待确认', color: '#0F766E', bg: '#ECF7F4', border: '#C7E5DF', desc: '您的订单已提交,等待陪诊员确认' },
confirmed: { text: '已确认', color: '#0F766E', bg: '#ECF7F4', border: '#C7E5DF', desc: '订单已确认,陪诊员将准时为您服务' },
in_progress: { text: '进行中', color: '#B8520A', bg: '#FFF4E8', border: '#FFE0C2', desc: '陪诊服务正在进行中' },
completed: { text: '已完成', color: '#1F7A4D', bg: '#EAF6EE', border: '#CDE9D7', desc: '陪诊服务已完成,感谢您的使用' },
cancelled: { text: '已取消', color: '#B4231A', bg: '#FCF0EE', border: '#F2D6D1', desc: '该订单已取消' }
}
// 支付状态:已支付走「已完成」档;未支付 / 部分支付复用主色浅档提示待处理;
// 已退款走中性档(--muted 字 + --sep 描边 + 透明底)
const PAYMENT_STATUS_MAP = {
unpaid: { text: '未支付', color: '#F59E0B', bg: '#FEF3C7' },
partial: { text: '部分支付', color: '#F59E0B', bg: '#FEF3C7' },
paid: { text: '已支付', color: '#10B981', bg: '#D1FAE5' },
refunded: { text: '已退款', color: '#6B7280', bg: '#F3F4F6' }
unpaid: { text: '未支付', color: '#B8520A', bg: '#FFF4E8', border: '#FFE0C2' },
partial: { text: '部分支付', color: '#B8520A', bg: '#FFF4E8', border: '#FFE0C2' },
paid: { text: '已支付', color: '#1F7A4D', bg: '#EAF6EE', border: '#CDE9D7' },
refunded: { text: '已退款', color: '#6F655C', bg: 'transparent', border: '#E5DACC' }
}
const SEX_MAP = {
@@ -20,7 +24,7 @@ const SEX_MAP = {
female: '女'
}
const ATTENDANT_SEX_MAP = {
const SEX_REQUIREMENT_MAP = {
none: '不限',
male: '男',
female: '女'
@@ -116,13 +120,15 @@ Page({
scheduleDuration: item.schedule?.duration || 0,
escortServiceName: item.escort?.serviceName || '',
attendantName: item.attendant?.name || '',
attendantSexText: ATTENDANT_SEX_MAP[item.escort?.sexRequirement] || '',
attendantMobile: item.attendant?.mobile || '',
sexRequirementText: SEX_REQUIREMENT_MAP[item.escort?.sexRequirement] || '',
totalFee: (item.payment?.totalFee || 0).toFixed(2),
paidFee: (item.payment?.paidFee || 0).toFixed(2),
paymentStatus: item.payment?.status || 'unpaid',
paymentStatusText: paymentInfo.text,
paymentStatusColor: paymentInfo.color,
paymentStatusBg: paymentInfo.bg,
paymentStatusBorder: paymentInfo.border,
patientNote: item.notes?.patientNote || '',
escortNote: item.notes?.escortNote || '',
medicalSummary: item.notes?.medicalSummary || '',
@@ -130,8 +136,7 @@ Page({
statusText: statusInfo.text,
statusColor: statusInfo.color,
statusBg: statusInfo.bg,
statusGradient: statusInfo.gradient,
statusIcon: statusInfo.icon,
statusBorder: statusInfo.border,
statusDesc: statusInfo.desc,
createTime: item.meta?.createtime ? this.formatDateTime(item.meta.createtime) : '',
updateTime: item.meta?.updatetime ? this.formatDateTime(item.meta.updatetime) : ''
@@ -178,6 +183,12 @@ Page({
wx.makePhoneCall({ phoneNumber: '18618162956' })
},
onCallAttendant() {
const mobile = this.data.record.attendantMobile
if (!mobile || mobile === '--') return
wx.makePhoneCall({ phoneNumber: mobile })
},
onEditPatientNote() {
this.setData({
editing: true,
@@ -346,7 +357,7 @@ Page({
wx.showModal({
title: '确认完成',
content: '确认陪诊服务已完成?',
confirmColor: '#6B8E7B',
confirmColor: '#B8520A',
success: (res) => {
if (res.confirm) {
wx.showLoading({ title: '处理中...' })
@@ -375,7 +386,7 @@ Page({
wx.showModal({
title: '删除订单',
content: '确定要删除该订单吗?删除后不可恢复。',
confirmColor: '#EF4444',
confirmColor: '#B4231A',
success: (res) => {
if (res.confirm) {
wx.showLoading({ title: '删除中...' })