diff --git a/components/card_orderBan/card_orderBan.vue b/components/card_orderBan/card_orderBan.vue index 22daf6d..46ff90b 100644 --- a/components/card_orderBan/card_orderBan.vue +++ b/components/card_orderBan/card_orderBan.vue @@ -5,8 +5,14 @@ }"> + - @@ -56,11 +62,11 @@ background: 'rgba(238,10,36,0.2)', border: 'none' }, - // { //在订单详情退货 - // id: 3, - // name: '申请售后', - // value: '10,20', - // }, + { //在订单详情退货 + id: 3, + name: '申请售后', + value: '10,20', + }, { id: 4, name: '确认收货', @@ -69,12 +75,12 @@ background: 'rgba(238,10,36,0.2)', border: 'none' }, - // { - // id: 5, - // name: '再次购买', - // value: '30,50,40', - // color: '#FA9C31', - // }, + { + id: 5, + name: '再次购买', + value: '30,50,40', + color: '#FA9C31', + }, { id: 6, name: '取消售后', @@ -91,6 +97,9 @@ }); return; } + if (index === 3 && Number(props?.data?.type) === 5) { + return; + } let id = props.data?.id; switch (index) { case 1: @@ -197,17 +206,17 @@ .more {} .btn { - line-height: 54rpx; - padding: 0 24rpx; + line-height: 24rpx; + padding: 10rpx 24rpx; box-sizing: border-box; border: 2rpx solid #999999; - border-radius: 94px 94px 94px 94px; + border-radius: 10rpx; margin-left: 12rpx; color: #999999; } .btn1 { - line-height: 74rpx; - padding: 0 30rpx; + // line-height: 74rpx; + // padding: 0 30rpx; } - \ No newline at end of file + diff --git a/components/orderItem/orderItem.vue b/components/orderItem/orderItem.vue index 664e35f..0fc3d9d 100644 --- a/components/orderItem/orderItem.vue +++ b/components/orderItem/orderItem.vue @@ -59,7 +59,38 @@ style="font-weight: 600;">{{ fen2yuan(props.data.payPrice) }} - + + + 延迟发货 + + + 立即发货 + + 查看订单 + + 确认收货 + + + 去支付 + + + @@ -79,6 +110,12 @@ import card_order from './card_order.vue'; import card_orderBan from '@/components/card_orderBan/card_orderBan.vue'; import AfterSaleApi from '@/sheep/api/trade/afterSale'; + import { + aiDelayedShipment, + aiPendingShipment, + confirmReceive as aiConfirmReceive, + giftConfirmReceive, + } from '@/sheep/api/ai'; let emit = defineEmits(['downData']); let { proxy } = getCurrentInstance(); let props = defineProps({ @@ -119,6 +156,103 @@ const statusChange = (arr, status) => { return arr.indexOf(status) != -1; }; + + const isAiActionOrder = + String(props.data?.__source) === 'aishop' || Number(props.data?.type) === 5; + + const resolveAiOrderId = (data) => { + return data?.id || data?.orderId; + }; + + function delayShipment(data) { + const id = resolveAiOrderId(data); + if (!id) { + uni.showToast({ + title: '订单信息异常', + icon: 'none', + }); + return; + } + uni.showModal({ + title: '延迟发货', + content: '请您确认是否暂时不需要发货,确认后该产品将为您安排延迟发货', + confirmColor: '#FA7E31', + success: async function (res) { + if (!res.confirm) return; + const { code } = await aiDelayedShipment({ + id, + status: 50, + }); + if (code === 0) { + emit('downData'); + } + }, + }); + } + + function nowShipment(data) { + const id = resolveAiOrderId(data); + if (!id) { + uni.showToast({ + title: '订单信息异常', + icon: 'none', + }); + return; + } + uni.showModal({ + title: '立即发货', + content: '请您确认是否需要立即发货,确认后将尽快为您安排发货', + confirmColor: '#FA7E31', + success: async function (res) { + if (!res.confirm) return; + const { code } = await aiPendingShipment({ + id, + status: 10, + }); + if (code === 0) { + emit('downData'); + } + }, + }); + } + + const goAiOrderInfo = () => { + if (Number(props.data?.type) === 5) { + const id = props.data?.id; + if (!id) return; + proxy.utils.go('/pages/order/detail', { id, type: props.data?.type }); + return; + } + const id = resolveAiOrderId(props.data); + if (!id) return; + proxy.utils.go('/pages/AI/orderInfo', { id }); + }; + + const confirmReceiveOrder = async () => { + const id = resolveAiOrderId(props.data); + if (!id) return; + const req = Number(props.data?.type) === 5 ? giftConfirmReceive : aiConfirmReceive; + const { code } = await req({ id }); + if (code === 0) { + emit('downData'); + } + }; + + const goPay = () => { + const id = resolveAiOrderId(props.data); + const payOrderId = props.data?.payOrderId; + if (!id || !payOrderId) { + uni.showToast({ + title: '支付信息异常', + icon: 'none', + }); + return; + } + proxy.utils.go('/pages/AI/cashierDesk', { + id, + payOrderId, + }); + };