feat(order): 拆分“确认完成”为“送达”和“确认完成”按钮
- 新增送达操作,已发货且无送达照片时显示,可上传送达凭证 - 确认完成操作仅限已付款订单,标记为已完成,不需上传凭证 - 取消deliveryStatus=30表示已送达的用法,避免混淆“部分发货”状态 - 统一按钮显示逻辑,支持线下付款场景下同时显示确认收款/送达按钮 - 调整订单状态文案,新增“已送达待收款”与“待确认完成”状态描述 - 优化订单列表及详情中付款和物流状态的判断,去除对deliveryStatus=30的依赖 - 确认证据上传界面调整,确认完成操作不再显示上传凭证区域
This commit is contained in:
@@ -151,9 +151,10 @@ function getOrderActions(order: ShopOrder): { label: string; type: OpType }[] {
|
||||
actions.push({label: '发货', type: 'ship'})
|
||||
}
|
||||
}
|
||||
// 送达:已发货即可上传送达照片(无论是否付款,线下付款先发货后结款场景也需要)
|
||||
const shipped = order.deliveryStatus != null && order.deliveryStatus >= 20
|
||||
if (shipped) {
|
||||
// 送达:已发货但未上传送达照片时显示(deliveryStatus=20 且 sendEndImg 为空)
|
||||
const shipped = order.deliveryStatus != null && order.deliveryStatus === 20
|
||||
const hasDeliverProof = order.sendEndImg && order.sendEndImg !== '[]'
|
||||
if (shipped && !hasDeliverProof) {
|
||||
actions.push({label: '送达', type: 'deliver'})
|
||||
}
|
||||
// 确认完成:仅已付款才可标记订单为已完成
|
||||
@@ -449,8 +450,7 @@ export default function StoreOrdersPage() {
|
||||
const updateData: any = {orderId: currentOrder.orderId}
|
||||
|
||||
if (opType === 'deliver') {
|
||||
// 送达:上传送达照片,标记为已收货(不改变付款状态和订单完成状态)
|
||||
updateData.deliveryStatus = 30 // 已收货
|
||||
// 送达:上传送达照片(不改变付款状态、deliveryStatus 和订单完成状态)
|
||||
updateData.deliveryTime = formatDateTime(new Date())
|
||||
updateData.sendEndImg = JSON.stringify(proofImages)
|
||||
} else if (opType === 'complete') {
|
||||
@@ -837,35 +837,39 @@ export default function StoreOrdersPage() {
|
||||
</View>
|
||||
)}
|
||||
|
||||
{/* 凭证上传 */}
|
||||
<Text className='text-sm text-gray-600 mb-3 block'>
|
||||
{opType === 'confirmPay'
|
||||
? '上传支付凭证(必填,如微信转账截图)'
|
||||
: opType === 'deliver'
|
||||
? '上传送达凭证(必填,配送货物到达后拍照上传,最多3张)'
|
||||
: '上传凭证照片(选填,最多3张)'}
|
||||
</Text>
|
||||
<View className='flex flex-wrap gap-3 mb-4'>
|
||||
{proofImages.map((url, idx) => (
|
||||
<View key={idx} className='relative'>
|
||||
<Image className='w-20 h-20 rounded-lg bg-gray-50' src={getCompressedImageUrl(url)} mode='aspectFill'/>
|
||||
<View
|
||||
className='absolute -top-2 -right-2 w-5 h-5 bg-red-500 rounded-full flex items-center justify-center'
|
||||
onClick={() => removeProofImage(idx)}
|
||||
>
|
||||
<Text className='text-white text-xs'>×</Text>
|
||||
</View>
|
||||
{/* 凭证上传(确认完成不需要凭证) */}
|
||||
{opType !== 'complete' && (
|
||||
<>
|
||||
<Text className='text-sm text-gray-600 mb-3 block'>
|
||||
{opType === 'confirmPay'
|
||||
? '上传支付凭证(必填,如微信转账截图)'
|
||||
: opType === 'deliver'
|
||||
? '上传送达凭证(必填,配送货物到达后拍照上传,最多3张)'
|
||||
: '上传凭证照片(选填,最多3张)'}
|
||||
</Text>
|
||||
<View className='flex flex-wrap gap-3 mb-4'>
|
||||
{proofImages.map((url, idx) => (
|
||||
<View key={idx} className='relative'>
|
||||
<Image className='w-20 h-20 rounded-lg bg-gray-50' src={getCompressedImageUrl(url)} mode='aspectFill'/>
|
||||
<View
|
||||
className='absolute -top-2 -right-2 w-5 h-5 bg-red-500 rounded-full flex items-center justify-center'
|
||||
onClick={() => removeProofImage(idx)}
|
||||
>
|
||||
<Text className='text-white text-xs'>×</Text>
|
||||
</View>
|
||||
</View>
|
||||
))}
|
||||
{proofImages.length < (opType === 'confirmPay' ? 1 : 3) && (
|
||||
<View
|
||||
className='w-20 h-20 rounded-lg bg-gray-50 border-2 border-dashed border-gray-200 flex items-center justify-center'
|
||||
onClick={chooseProofImage}
|
||||
>
|
||||
<Text className='text-2xl text-gray-300'>+</Text>
|
||||
</View>
|
||||
)}
|
||||
</View>
|
||||
))}
|
||||
{proofImages.length < (opType === 'confirmPay' ? 1 : 3) && (
|
||||
<View
|
||||
className='w-20 h-20 rounded-lg bg-gray-50 border-2 border-dashed border-gray-200 flex items-center justify-center'
|
||||
onClick={chooseProofImage}
|
||||
>
|
||||
<Text className='text-2xl text-gray-300'>+</Text>
|
||||
</View>
|
||||
)}
|
||||
</View>
|
||||
</>
|
||||
)}
|
||||
|
||||
{/* 备注(仅确认收款时显示) */}
|
||||
{opType === 'confirmPay' && (
|
||||
|
||||
Reference in New Issue
Block a user