feat(escort): 微信支付入口与取消状态展示
- 下单改为提交预约后弹窗选择支付方式,默认微信支付 - 预约详情支持发起微信支付、查单确认与待支付期间切换支付方式 - 预约列表展示支付渠道、待支付/超时状态并提供去支付入口 - 取消状态与 status 解耦,展示状态优先取 cancelStatus - 详情页医院选择回传字段同步移除 manual
This commit is contained in:
@@ -25,6 +25,9 @@ const API = {
|
||||
updateRecord: (id, data) => request.put(`/health/escort-record/${id}`, data),
|
||||
updateStatus: (id, data) => request.patch(`/health/escort-record/${id}/status`, data),
|
||||
deleteRecord: (id) => request.delete(`/health/escort-record/${id}`),
|
||||
// 微信支付:发起支付返回调起收银台参数;支付结果以后端查单为准
|
||||
payOrder: (id) => request.post(`/health/escort-record/${id}/pay`),
|
||||
getPayStatus: (id) => request.get(`/health/escort-record/${id}/pay/status`),
|
||||
// 陪诊师公示列表(公开接口,后端已做脱敏)
|
||||
getAttendants: (params) => request.get('/health/attendant', params),
|
||||
// 单个陪诊师详情,同一份白名单数据
|
||||
|
||||
+13
-2
@@ -8,8 +8,18 @@ const STATUS_MAP = {
|
||||
cancelled: { text: '已取消', color: '#B4231A', bg: '#FCF0EE', border: '#F2D6D1', desc: '该订单已取消' }
|
||||
}
|
||||
|
||||
// 取消与 status 解耦:展示层优先按 cancelStatus 映射为「待取消/已取消」,
|
||||
// 其余情况仍按服务状态展示,status 本身不再写入取消值。
|
||||
function resolveOrderStatus(item) {
|
||||
const cancelStatus = item?.cancelStatus || 'none'
|
||||
if (cancelStatus === 'cancelled') return 'cancelled'
|
||||
if (cancelStatus === 'requested') return 'cancel_requested'
|
||||
return item?.status || 'pending'
|
||||
}
|
||||
|
||||
const PAYMENT_STATUS_MAP = {
|
||||
unpaid: { text: '未支付', color: '#B8520A', bg: '#FFF4E8', border: '#FFE0C2', hint: '请联系客服完成支付' },
|
||||
// 未支付的展示文案由页面按 payChannel / 支付窗口派生,这里不再固定「联系客服」
|
||||
unpaid: { text: '未支付', color: '#B8520A', bg: '#FFF4E8', border: '#FFE0C2' },
|
||||
partial: { text: '部分支付', color: '#B8520A', bg: '#FFF4E8', border: '#FFE0C2', hint: '请联系客服补齐剩余费用' },
|
||||
paid: { text: '已支付', color: '#1F7A4D', bg: '#EAF6EE', border: '#CDE9D7' },
|
||||
refunding: { text: '退款中', color: '#B8520A', bg: '#FFF4E8', border: '#FFE0C2', hint: '退款处理中,如需了解进度请联系客服' },
|
||||
@@ -18,5 +28,6 @@ const PAYMENT_STATUS_MAP = {
|
||||
|
||||
module.exports = {
|
||||
STATUS_MAP,
|
||||
PAYMENT_STATUS_MAP
|
||||
PAYMENT_STATUS_MAP,
|
||||
resolveOrderStatus
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user