diff --git a/src/pages/store/orders/index.tsx b/src/pages/store/orders/index.tsx index a9af7d2..733abe8 100644 --- a/src/pages/store/orders/index.tsx +++ b/src/pages/store/orders/index.tsx @@ -28,10 +28,11 @@ const TABS: { key: TabKey; label: string; params: Partial[] }[] ] // ─── 操作类型 ───────────────────────────────────────────────────── -type OpType = 'confirmPay' | 'complete' | 'editPrice' | 'ship' +type OpType = 'confirmPay' | 'deliver' | 'complete' | 'editPrice' | 'ship' const OP_LABEL: Record = { confirmPay: '收款', + deliver: '送达', complete: '已完成', editPrice: '金额', ship: '发货', @@ -39,7 +40,8 @@ const OP_LABEL: Record = { const OP_DESC: Record = { confirmPay: '确认已收到线下付款', - complete: '同时变更支付状态为已付款、收货状态为已收货、订单状态为已完成', + deliver: '上传送达凭证照片,标记为已收货(不改变付款和订单完成状态)', + complete: '确认订单已完成,收款后点击此按钮标记订单完成', editPrice: '修改订单实付金额', ship: '选择发货人员并生成发货单,订单将进入已发货状态', } @@ -149,9 +151,13 @@ function getOrderActions(order: ShopOrder): { label: string; type: OpType }[] { actions.push({label: '发货', type: 'ship'}) } } - // 确认完成:已发货即可确认完成(无论是否付款,线下付款先发货后结款场景也需要上传送达照片) + // 送达:已发货即可上传送达照片(无论是否付款,线下付款先发货后结款场景也需要) const shipped = order.deliveryStatus != null && order.deliveryStatus >= 20 if (shipped) { + actions.push({label: '送达', type: 'deliver'}) + } + // 确认完成:仅已付款才可标记订单为已完成 + if (order.payStatus) { actions.push({label: '确认完成', type: 'complete'}) } return actions @@ -418,9 +424,9 @@ export default function StoreOrdersPage() { const submitOperation = async () => { if (!currentOrder) return - // 确认完成必须上传凭证照片 - if (opType === 'complete' && proofImages.length === 0) { - Taro.showToast({title: '请上传配送凭证照片', icon: 'none'}) + // 确认送达必须上传凭证照片 + if (opType === 'deliver' && proofImages.length === 0) { + Taro.showToast({title: '请上传送达凭证照片', icon: 'none'}) return } @@ -442,14 +448,14 @@ export default function StoreOrdersPage() { } else { const updateData: any = {orderId: currentOrder.orderId} - if (opType === 'complete') { - // 确认完成:用户已收到货 - updateData.payStatus = true - updateData.payTime = formatDateTime(new Date()) - updateData.deliveryStatus = 20 // 发货状态 → 已收货 - updateData.deliveryTime = formatDateTime(new Date()) // 收货时间 + if (opType === 'deliver') { + // 送达:上传送达照片,标记为已收货(不改变付款状态和订单完成状态) + updateData.deliveryStatus = 30 // 已收货 + updateData.deliveryTime = formatDateTime(new Date()) + updateData.sendEndImg = JSON.stringify(proofImages) + } else if (opType === 'complete') { + // 确认完成:标记订单为已完成 updateData.orderStatus = 1 // 订单状态 → 已完成 - updateData.sendEndImg = JSON.stringify(proofImages) // 配送员送达拍照(JSON数组) } await updateShopOrder(updateData) @@ -835,8 +841,8 @@ export default function StoreOrdersPage() { {opType === 'confirmPay' ? '上传支付凭证(必填,如微信转账截图)' - : opType === 'complete' - ? '上传凭证照片(必填,配送货物到达后拍照上传,最多3张)' + : opType === 'deliver' + ? '上传送达凭证(必填,配送货物到达后拍照上传,最多3张)' : '上传凭证照片(选填,最多3张)'}