import React, { useState } from 'react' import { View, Text, ScrollView } from '@tarojs/components' import Taro from '@tarojs/taro' definePageConfig({ navigationBarTitleText: '售后进度', }) const AfterSaleProgressPage: React.FC = () => { const [saleInfo, setSaleInfo] = useState({ id: 'AS202605120001', type: 2, // 1:退款, 2:退货退款, 3:换货 status: 2, // 1:待审核, 2:审核通过, 3:审核拒绝, 4:已完成, 5:已取消 reason: '商品质量问题', amount: 89.00, createTime: '2026-05-10 14:30:00', orderId: '123456', goodsName: '高品质保温杯', }) // 进度步骤 const steps = [ { time: '2026-05-10 14:30', title: '申请提交', desc: '您的售后申请已提交', done: true }, { time: '2026-05-10 15:00', title: '商家审核', desc: '商家已审核通过,请退货', done: true }, { time: '2026-05-11 09:00', title: '寄回商品', desc: '您已寄回商品,等待商家收货', done: true }, { time: '2026-05-12 10:00', title: '商家收货', desc: '商家已收到商品,正在处理', done: false }, { time: '', title: '退款完成', desc: '退款将返回您的原支付账户', done: false }, ] // 获取售后类型名称 const getTypeLabel = (type: number) => { const map: Record = { 1: '仅退款', 2: '退货退款', 3: '换货' } return map[type] || '未知' } // 获取状态标签 const getStatusLabel = (status: number) => { const map: Record = { 1: { label: '待审核', color: 'text-orange-500' }, 2: { label: '审核通过', color: 'text-green-500' }, 3: { label: '审核拒绝', color: 'text-red-500' }, 4: { label: '已完成', color: 'text-blue-500' }, 5: { label: '已取消', color: 'text-gray-400' }, } return map[status] || { label: '未知', color: 'text-gray-400' } } const statusInfo = getStatusLabel(saleInfo.status) // 取消售后 const handleCancel = () => { Taro.showModal({ title: '提示', content: '确定取消售后申请吗?', confirmColor: '#0e932e', success: (res) => { if (res.confirm) { Taro.showToast({ title: '已取消', icon: 'success' }) } } }) } return ( {/* 状态卡片 */} {statusInfo.label} 售后编号:{saleInfo.id} 申请时间:{saleInfo.createTime} {/* 售后信息 */} 售后信息 售后类型 {getTypeLabel(saleInfo.type)} 售后原因 {saleInfo.reason} {saleInfo.type === 1 && ( 退款金额 ¥{saleInfo.amount} )} 关联订单 Taro.navigateTo({ url: `/pages/order/detail?id=${saleInfo.orderId}` })}> {saleInfo.orderId} {/* 进度步骤 */} 处理进度 {steps.map((step, index) => ( {/* 时间线 */} {index < steps.length - 1 && ( )} {/* 内容 */} {step.title} {step.desc} {step.time && ( {step.time} )} ))} {/* 商品信息 */} 商品信息 🛍️ {saleInfo.goodsName} {/* 操作按钮 */} {saleInfo.status === 1 && ( 取消申请 )} ) } export default AfterSaleProgressPage