feat: 我的订单调整
This commit is contained in:
@@ -1,7 +1,18 @@
|
||||
import { createPaidOrder } from './model.mjs'
|
||||
|
||||
export const PLACEHOLDER_IMAGE = 'https://one-feel-bucket.oss-cn-guangzhou.aliyuncs.com/oneFeel/2082673896938569729.jpg'
|
||||
|
||||
export const ORDER_STATUS_META = {
|
||||
pending_payment: { label: '待支付', className: 'border-amber-200 bg-amber-50 text-amber-700' },
|
||||
closed: { label: '已关闭', className: 'border-slate-200 bg-slate-100 text-slate-500' },
|
||||
paid: { label: '待使用', className: 'border-blue-200 bg-blue-50 text-blue-700' },
|
||||
fulfilling: { label: '出票中', className: 'border-indigo-200 bg-indigo-50 text-indigo-700' },
|
||||
partial_used: { label: '部分使用', className: 'border-amber-200 bg-amber-50 text-amber-700' },
|
||||
completed: { label: '已完成', className: 'border-emerald-200 bg-emerald-50 text-emerald-700' },
|
||||
refunding: { label: '退款中', className: 'border-orange-200 bg-orange-50 text-orange-700' },
|
||||
partial_refunded: { label: '部分退款', className: 'border-cyan-200 bg-cyan-50 text-cyan-700' },
|
||||
refunded: { label: '已退款', className: 'border-slate-200 bg-slate-100 text-slate-600' },
|
||||
exception: { label: '异常', className: 'border-rose-200 bg-rose-50 text-rose-700' },
|
||||
}
|
||||
|
||||
export const SCENIC_SPOT = {
|
||||
id: 'libo-xiaoqikong',
|
||||
name: '荔波小七孔景区',
|
||||
@@ -161,18 +172,288 @@ export const INITIAL_TRAVELERS = [
|
||||
{ id: 'traveler-zhou-ning', name: '周宁', idType: '身份证', idNumber: '110101196001020017', phone: '13900139000' },
|
||||
]
|
||||
|
||||
const createDemoOrder = (productId, draft, now) => createPaidOrder({
|
||||
product: PRODUCTS.find((product) => product.id === productId),
|
||||
draft,
|
||||
travelers: INITIAL_TRAVELERS.map((traveler) => ({ ...traveler })),
|
||||
now,
|
||||
const createPrototypeOrder = (order) => ({
|
||||
insurance: null,
|
||||
refundStatus: order.status === 'refunding'
|
||||
? 'pending'
|
||||
: ['partial_refunded', 'refunded'].includes(order.status) ? 'approved' : '',
|
||||
productAmount: order.amount,
|
||||
insuranceAmount: 0,
|
||||
paidAmount: order.amount,
|
||||
contactName: order.customerName,
|
||||
travelers: [{
|
||||
id: `${order.id}-traveler`,
|
||||
name: order.customerName,
|
||||
idType: '身份证',
|
||||
idNumber: order.idCard,
|
||||
phone: order.phone,
|
||||
}],
|
||||
...order,
|
||||
})
|
||||
|
||||
export const INITIAL_ORDERS = [
|
||||
createDemoOrder('adult', {
|
||||
visitDate: '2026-08-01', timeSlot: '08:00—09:30', quantity: 1, travelerIds: ['traveler-lin-xiao'], contactName: '林晓', phone: '13800138000', insuranceSelected: true, insurancePrice: INSURANCE.price, maxQuantity: 5,
|
||||
}, new Date('2026-07-30T09:00:00+08:00')),
|
||||
createDemoOrder('classic', {
|
||||
visitDate: '2026-08-02', timeSlot: '09:30—11:30', quantity: 1, travelerIds: ['traveler-lin-xiao'], contactName: '林晓', phone: '13800138000', insuranceSelected: false, insurancePrice: INSURANCE.price, maxQuantity: 5,
|
||||
}, new Date('2026-07-30T09:05:00+08:00')),
|
||||
createPrototypeOrder({
|
||||
id: 'o-001',
|
||||
orderNo: 'LB202607260001',
|
||||
productId: 'p-package-classic',
|
||||
productName: '小七孔经典畅游套餐',
|
||||
customerName: '张晓云',
|
||||
phone: '13800138088',
|
||||
idCard: '52272219930418XXXX',
|
||||
visitDate: '2026-07-27',
|
||||
timeSlot: '08:00—10:00',
|
||||
quantity: 1,
|
||||
amount: 188,
|
||||
paidAt: '2026-07-26 09:18:32',
|
||||
status: 'partial_used',
|
||||
refundMode: 'all_or_nothing',
|
||||
gateCredential: { status: 'used', provider: '景区票务平台', providerOrderNo: 'TP20260726093821', ticketNo: 'XQK88261001', qrToken: 'GATE-XQK-88261001', issuedAt: '2026-07-26 09:18:36' },
|
||||
selfCredential: { status: 'issued', credentialNo: 'BEN202607260001', qrToken: 'BENEFIT-LB202607260001', createdAt: '2026-07-26 09:18:37' },
|
||||
entitlements: [
|
||||
{ id: 'oe-001-ticket', name: '小七孔成人门票', fulfillment: 'third_party', quantity: 1, usedQuantity: 1, unit: '张', status: 'used', refundAllocation: 120, voucherNo: 'XQK88261001', usedAt: '2026-07-27 08:46:12' },
|
||||
{ id: 'oe-001-shuttle', name: '观光车票', fulfillment: 'third_party', quantity: 1, usedQuantity: 1, unit: '张', status: 'used', refundAllocation: 30, voucherNo: 'XQK88261001-CAR', usedAt: '2026-07-27 09:02:18' },
|
||||
{ id: 'oe-001-boat', name: '鸳鸯湖游船', fulfillment: 'self', quantity: 1, usedQuantity: 0, unit: '次', status: 'pending', refundAllocation: 38, voucherNo: 'BEN202607260001-02' },
|
||||
],
|
||||
logs: [
|
||||
{ time: '2026-07-26 09:18:32', text: '小程序支付成功,实付 ¥188', operator: '系统' },
|
||||
{ time: '2026-07-26 09:18:36', text: '第三方门票与观光车票出票成功', operator: '出票服务' },
|
||||
{ time: '2026-07-26 09:18:37', text: '自营园内权益包生成成功', operator: '系统' },
|
||||
{ time: '2026-07-27 08:46:12', text: '门票已通过闸机,状态由第三方同步', operator: '景区票务平台' },
|
||||
{ time: '2026-07-27 09:02:18', text: '观光车票已使用,状态由第三方同步', operator: '景区票务平台' },
|
||||
],
|
||||
}),
|
||||
createPrototypeOrder({
|
||||
id: 'o-002',
|
||||
orderNo: 'LB202607260002',
|
||||
productId: 'p-package-classic',
|
||||
productName: '小七孔经典畅游套餐',
|
||||
customerName: '周一航',
|
||||
phone: '18682131666',
|
||||
idCard: '52010219880902XXXX',
|
||||
visitDate: '2026-07-28',
|
||||
timeSlot: '10:00—12:00',
|
||||
quantity: 2,
|
||||
amount: 376,
|
||||
paidAt: '2026-07-26 10:05:09',
|
||||
status: 'paid',
|
||||
refundMode: 'all_or_nothing',
|
||||
gateCredential: { status: 'issued', provider: '景区票务平台', providerOrderNo: 'TP20260726102977', ticketNo: 'XQK88261002', qrToken: 'GATE-XQK-88261002', issuedAt: '2026-07-26 10:05:13' },
|
||||
selfCredential: { status: 'issued', credentialNo: 'BEN202607260002', qrToken: 'BENEFIT-LB202607260002', createdAt: '2026-07-26 10:05:14' },
|
||||
entitlements: [
|
||||
{ id: 'oe-002-ticket', name: '小七孔成人门票', fulfillment: 'third_party', quantity: 2, usedQuantity: 0, unit: '张', status: 'pending', refundAllocation: 240, voucherNo: 'XQK88261002' },
|
||||
{ id: 'oe-002-shuttle', name: '观光车票', fulfillment: 'third_party', quantity: 2, usedQuantity: 0, unit: '张', status: 'pending', refundAllocation: 60, voucherNo: 'XQK88261002-CAR' },
|
||||
{ id: 'oe-002-boat', name: '鸳鸯湖游船', fulfillment: 'self', quantity: 2, usedQuantity: 0, unit: '次', status: 'pending', refundAllocation: 76, voucherNo: 'BEN202607260002-02' },
|
||||
],
|
||||
logs: [
|
||||
{ time: '2026-07-26 10:05:09', text: '小程序支付成功,实付 ¥376', operator: '系统' },
|
||||
{ time: '2026-07-26 10:05:13', text: '第三方门票与观光车票出票成功,各2张', operator: '出票服务' },
|
||||
{ time: '2026-07-26 10:05:14', text: '自营园内权益包生成成功', operator: '系统' },
|
||||
],
|
||||
}),
|
||||
createPrototypeOrder({
|
||||
id: 'o-003',
|
||||
orderNo: 'LB202607260003',
|
||||
productId: 'p-ticket-adult',
|
||||
productName: '荔波小七孔景区成人票',
|
||||
customerName: '陈思齐',
|
||||
phone: '17730208821',
|
||||
idCard: '52270119991221XXXX',
|
||||
visitDate: '2026-07-29',
|
||||
timeSlot: '12:00—14:00',
|
||||
quantity: 1,
|
||||
amount: 120,
|
||||
paidAt: '2026-07-26 10:42:51',
|
||||
status: 'exception',
|
||||
gateCredential: { status: 'failed', provider: '景区票务平台', providerOrderNo: '—', failureReason: '第三方票种库存校验超时' },
|
||||
entitlements: [
|
||||
{ id: 'oe-003-ticket', name: '小七孔成人门票', fulfillment: 'third_party', quantity: 1, usedQuantity: 0, unit: '张', status: 'pending', refundAllocation: 120, voucherNo: '待出票' },
|
||||
],
|
||||
logs: [
|
||||
{ time: '2026-07-26 10:42:51', text: '小程序支付成功,实付 ¥120', operator: '系统' },
|
||||
{ time: '2026-07-26 10:42:56', text: '第三方出票失败:库存校验超时', operator: '出票服务' },
|
||||
],
|
||||
}),
|
||||
createPrototypeOrder({
|
||||
id: 'o-004',
|
||||
orderNo: 'LB202607260004',
|
||||
productId: 'p-boat',
|
||||
productName: '鸳鸯湖游船票',
|
||||
customerName: '吴嘉树',
|
||||
phone: '13985271349',
|
||||
idCard: '52272220010307XXXX',
|
||||
visitDate: '2026-07-27',
|
||||
timeSlot: '不限时段',
|
||||
quantity: 2,
|
||||
amount: 100,
|
||||
paidAt: '2026-07-26 11:16:24',
|
||||
status: 'paid',
|
||||
selfCredential: { status: 'issued', credentialNo: 'BEN202607260004', qrToken: 'BENEFIT-LB202607260004', createdAt: '2026-07-26 11:16:25' },
|
||||
entitlements: [
|
||||
{ id: 'oe-004-boat', name: '鸳鸯湖游船', fulfillment: 'self', quantity: 2, usedQuantity: 0, unit: '次', status: 'pending', refundAllocation: 100, voucherNo: 'BEN202607260004-01' },
|
||||
],
|
||||
logs: [
|
||||
{ time: '2026-07-26 11:16:24', text: '小程序支付成功,实付 ¥100', operator: '系统' },
|
||||
{ time: '2026-07-26 11:16:25', text: '自营园内权益包生成成功', operator: '系统' },
|
||||
],
|
||||
}),
|
||||
createPrototypeOrder({
|
||||
id: 'o-005',
|
||||
orderNo: 'LB202607260005',
|
||||
productId: 'p-ticket-adult',
|
||||
productName: '荔波小七孔景区成人票',
|
||||
customerName: '罗雨桐',
|
||||
phone: '18585321206',
|
||||
idCard: '52272519960816XXXX',
|
||||
visitDate: '2026-07-30',
|
||||
timeSlot: '08:00—09:30',
|
||||
quantity: 1,
|
||||
amount: 120,
|
||||
paidAt: '2026-07-26 11:42:18',
|
||||
status: 'fulfilling',
|
||||
gateCredential: { status: 'issuing', provider: '景区票务平台', providerOrderNo: 'TP20260726114218' },
|
||||
entitlements: [
|
||||
{ id: 'oe-005-ticket', name: '小七孔成人门票', fulfillment: 'third_party', quantity: 1, usedQuantity: 0, unit: '张', status: 'pending', refundAllocation: 120, voucherNo: '出票中' },
|
||||
],
|
||||
logs: [
|
||||
{ time: '2026-07-26 11:42:18', text: '小程序支付成功,实付 ¥120', operator: '系统' },
|
||||
{ time: '2026-07-26 11:42:19', text: '已提交第三方出票,等待出票结果', operator: '出票服务' },
|
||||
],
|
||||
}),
|
||||
createPrototypeOrder({
|
||||
id: 'o-006',
|
||||
orderNo: 'LB202607260006',
|
||||
productId: 'p-boat',
|
||||
productName: '鸳鸯湖游船票',
|
||||
customerName: '高子涵',
|
||||
phone: '18786650218',
|
||||
idCard: '52272619941122XXXX',
|
||||
visitDate: '2026-07-26',
|
||||
timeSlot: '13:30—15:00',
|
||||
quantity: 1,
|
||||
amount: 50,
|
||||
paidAt: '2026-07-25 18:20:06',
|
||||
status: 'completed',
|
||||
selfCredential: { status: 'issued', credentialNo: 'BEN202607260006', qrToken: 'BENEFIT-LB202607260006', createdAt: '2026-07-25 18:20:07' },
|
||||
entitlements: [
|
||||
{ id: 'oe-006-boat', name: '鸳鸯湖游船', fulfillment: 'self', quantity: 1, usedQuantity: 1, unit: '次', status: 'used', refundAllocation: 50, voucherNo: 'BEN202607260006-01', usedAt: '2026-07-26 14:06:32' },
|
||||
],
|
||||
logs: [
|
||||
{ time: '2026-07-25 18:20:06', text: '小程序支付成功,实付 ¥50', operator: '系统' },
|
||||
{ time: '2026-07-25 18:20:07', text: '自营园内权益包生成成功', operator: '系统' },
|
||||
{ time: '2026-07-26 14:06:32', text: '鸳鸯湖游船核销成功,订单完成', operator: '核销员·王超' },
|
||||
],
|
||||
}),
|
||||
createPrototypeOrder({
|
||||
id: 'o-007',
|
||||
orderNo: 'LB202607260007',
|
||||
productId: 'p-shuttle',
|
||||
productName: '小七孔观光车票',
|
||||
customerName: '何静怡',
|
||||
phone: '15285940731',
|
||||
idCard: '52272319870709XXXX',
|
||||
visitDate: '2026-07-31',
|
||||
timeSlot: '不限时段',
|
||||
quantity: 2,
|
||||
amount: 80,
|
||||
paidAt: '2026-07-26 12:08:40',
|
||||
status: 'refunding',
|
||||
refundMode: 'per_item',
|
||||
gateCredential: { status: 'issued', provider: '景区票务平台', providerOrderNo: 'TP20260726120840', ticketNo: 'XQKCAR261207', qrToken: 'GATE-CAR-XQKCAR261207', issuedAt: '2026-07-26 12:08:41' },
|
||||
entitlements: [
|
||||
{ id: 'oe-007-shuttle', name: '观光车票', fulfillment: 'third_party', quantity: 2, usedQuantity: 0, unit: '张', status: 'refunding', refundAllocation: 80, voucherNo: 'XQKCAR261207' },
|
||||
],
|
||||
logs: [
|
||||
{ time: '2026-07-26 12:08:40', text: '小程序支付成功,实付 ¥80;第三方观光车票出票成功', operator: '出票服务' },
|
||||
{ time: '2026-07-27 10:15:22', text: '游客申请整单退款,等待审核', operator: '系统' },
|
||||
],
|
||||
}),
|
||||
createPrototypeOrder({
|
||||
id: 'o-008',
|
||||
orderNo: 'LB202607260008',
|
||||
productId: 'p-guide',
|
||||
productName: '精品讲解服务',
|
||||
customerName: '彭浩然',
|
||||
phone: '15086031257',
|
||||
idCard: '52270119920511XXXX',
|
||||
visitDate: '2026-08-01',
|
||||
timeSlot: '09:00—10:30',
|
||||
quantity: 1,
|
||||
amount: 68,
|
||||
paidAt: '2026-07-26 13:26:11',
|
||||
status: 'refunded',
|
||||
selfCredential: { status: 'issued', credentialNo: 'BEN202607260008', qrToken: 'BENEFIT-LB202607260008', createdAt: '2026-07-26 13:26:12' },
|
||||
entitlements: [
|
||||
{ id: 'oe-008-guide', name: '精品讲解服务', fulfillment: 'self', quantity: 1, usedQuantity: 0, unit: '次', status: 'refunded', refundAllocation: 68, voucherNo: 'BEN202607260008-01' },
|
||||
],
|
||||
logs: [
|
||||
{ time: '2026-07-26 13:26:11', text: '小程序支付成功,实付 ¥68', operator: '系统' },
|
||||
{ time: '2026-07-27 09:30:16', text: '退款审核通过,原路退回 ¥68', operator: '客服·宋妍' },
|
||||
],
|
||||
}),
|
||||
createPrototypeOrder({
|
||||
id: 'o-009',
|
||||
orderNo: 'LB202607260009',
|
||||
productId: 'p-package-classic',
|
||||
productName: '小七孔经典畅游套餐',
|
||||
customerName: '叶嘉宁',
|
||||
phone: '18188040712',
|
||||
idCard: '52270219950915XXXX',
|
||||
visitDate: '2026-08-02',
|
||||
timeSlot: '08:00—09:30',
|
||||
quantity: 1,
|
||||
amount: 188,
|
||||
paidAt: '—',
|
||||
status: 'pending_payment',
|
||||
refundMode: 'all_or_nothing',
|
||||
entitlements: [],
|
||||
logs: [
|
||||
{ time: '2026-07-27 14:02:33', text: '订单创建成功,库存已锁定15分钟', operator: '系统' },
|
||||
],
|
||||
}),
|
||||
createPrototypeOrder({
|
||||
id: 'o-010',
|
||||
orderNo: 'LB202607260010',
|
||||
productId: 'p-ticket-adult',
|
||||
productName: '荔波小七孔景区成人票',
|
||||
customerName: '田思远',
|
||||
phone: '18984510366',
|
||||
idCard: '52272819881203XXXX',
|
||||
visitDate: '2026-08-02',
|
||||
timeSlot: '09:30—11:30',
|
||||
quantity: 1,
|
||||
amount: 120,
|
||||
paidAt: '—',
|
||||
status: 'closed',
|
||||
entitlements: [],
|
||||
logs: [
|
||||
{ time: '2026-07-27 13:30:04', text: '订单创建成功,等待支付', operator: '系统' },
|
||||
{ time: '2026-07-27 13:45:04', text: '超过15分钟未支付,订单自动关闭并释放库存', operator: '系统' },
|
||||
],
|
||||
}),
|
||||
createPrototypeOrder({
|
||||
id: 'o-011',
|
||||
orderNo: 'LB202607260011',
|
||||
productId: 'p-boat',
|
||||
productName: '鸳鸯湖游船票',
|
||||
customerName: '蒋语晨',
|
||||
phone: '15329760845',
|
||||
idCard: '52272419910208XXXX',
|
||||
visitDate: '2026-07-25',
|
||||
timeSlot: '不限时段',
|
||||
quantity: 2,
|
||||
amount: 100,
|
||||
paidAt: '2026-07-24 16:18:28',
|
||||
status: 'partial_refunded',
|
||||
refundMode: 'per_item',
|
||||
selfCredential: { status: 'issued', credentialNo: 'BEN202607260011', qrToken: 'BENEFIT-LB202607260011', createdAt: '2026-07-24 16:18:32' },
|
||||
entitlements: [
|
||||
{ id: 'oe-011-boat-used', name: '鸳鸯湖游船', fulfillment: 'self', quantity: 1, usedQuantity: 1, unit: '次', status: 'used', refundAllocation: 50, voucherNo: 'BEN202607260011-01', usedAt: '2026-07-25 10:26:18' },
|
||||
{ id: 'oe-011-boat-refunded', name: '鸳鸯湖游船', fulfillment: 'self', quantity: 1, usedQuantity: 0, unit: '次', status: 'refunded', refundAllocation: 50, voucherNo: 'BEN202607260011-02' },
|
||||
],
|
||||
logs: [
|
||||
{ time: '2026-07-24 16:18:28', text: '小程序支付成功,实付 ¥100', operator: '系统' },
|
||||
{ time: '2026-07-25 10:26:18', text: '第1份游船权益核销成功', operator: '核销员·王超' },
|
||||
{ time: '2026-07-25 15:48:06', text: '第2份未使用游船权益退款成功,退款 ¥50', operator: '客服·宋妍' },
|
||||
],
|
||||
}),
|
||||
]
|
||||
|
||||
Reference in New Issue
Block a user