diff --git a/components/orderItem/AiOrderActionBar.vue b/components/orderItem/AiOrderActionBar.vue
new file mode 100644
index 0000000..adf96c9
--- /dev/null
+++ b/components/orderItem/AiOrderActionBar.vue
@@ -0,0 +1,38 @@
+
+
+
+ 延迟发货
+
+
+ 立即发货
+
+
+ {{ props.viewText }}
+
+
+ 确认收货
+
+
+ 去支付
+
+
+
+
+
diff --git a/components/orderItem/orderItem.vue b/components/orderItem/orderItem.vue
index 0fc3d9d..c8c764f 100644
--- a/components/orderItem/orderItem.vue
+++ b/components/orderItem/orderItem.vue
@@ -60,35 +60,15 @@
-
- 延迟发货
-
-
- 立即发货
-
- 查看订单
-
- 确认收货
-
-
- 去支付
-
+
@@ -109,6 +89,7 @@
} from '@/sheep/hooks/useGoods';
import card_order from './card_order.vue';
import card_orderBan from '@/components/card_orderBan/card_orderBan.vue';
+ import AiOrderActionBar from '@/components/orderItem/AiOrderActionBar.vue';
import AfterSaleApi from '@/sheep/api/trade/afterSale';
import {
aiDelayedShipment,
@@ -164,6 +145,14 @@
return data?.id || data?.orderId;
};
+ const onDelayShipment = () => {
+ delayShipment(props.data);
+ };
+
+ const onNowShipment = () => {
+ nowShipment(props.data);
+ };
+
function delayShipment(data) {
const id = resolveAiOrderId(data);
if (!id) {
diff --git a/pages/order/detail.vue b/pages/order/detail.vue
index 75b942e..132c466 100644
--- a/pages/order/detail.vue
+++ b/pages/order/detail.vue
@@ -85,7 +85,15 @@
-
+
+
@@ -100,9 +108,17 @@
handleOrderButtons,
} from '@/sheep/hooks/useGoods';
import OrderApi from '@/sheep/api/trade/order';
- import { getOrderDetail as getAiOrderDetail, getOpenOrderDetail } from '@/sheep/api/ai';
+ import {
+ aiDelayedShipment,
+ aiPendingShipment,
+ confirmReceive as aiConfirmReceive,
+ giftConfirmReceive,
+ getOrderDetail as getAiOrderDetail,
+ getOpenOrderDetail,
+ } from '@/sheep/api/ai';
import DeliveryApi from '@/sheep/api/trade/delivery';
import card_order from '@/components/orderItem/card_order.vue';
+ import AiOrderActionBar from '@/components/orderItem/AiOrderActionBar.vue';
import truckLine from '@/components/truckLine/truckLine.vue'
const headerBg = sheep.$url.css('/static/img/shop/order/order_bg.png');
@@ -126,6 +142,99 @@
const pickUpVerifyRef = ref();
+ const isAiActionOrder = computed(() => {
+ return (
+ String(state.source) === 'aishop' ||
+ String(state.orderType) === '5' ||
+ String(state.orderInfo?.__source) === 'aishop' ||
+ Number(state.orderInfo?.type) === 5
+ );
+ });
+
+ const resolveAiOrderId = (data) => {
+ return data?.id || data?.orderId;
+ };
+
+ function delayShipment() {
+ const id = resolveAiOrderId(state.orderInfo);
+ 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) {
+ getOrderDetail();
+ }
+ },
+ });
+ }
+
+ function nowShipment() {
+ const id = resolveAiOrderId(state.orderInfo);
+ 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) {
+ getOrderDetail();
+ }
+ },
+ });
+ }
+
+ const confirmReceiveOrder = async () => {
+ const id = resolveAiOrderId(state.orderInfo);
+ if (!id) return;
+ const req = Number(state.orderInfo?.type) === 5 || String(state.orderType) === '5'
+ ? giftConfirmReceive
+ : aiConfirmReceive;
+ const { code } = await req({ id });
+ if (code === 0) {
+ getOrderDetail();
+ }
+ };
+
+ const goPay = () => {
+ const id = resolveAiOrderId(state.orderInfo);
+ const payOrderId = state.orderInfo?.payOrderId;
+ if (!id || !payOrderId) {
+ uni.showToast({
+ title: '支付信息异常',
+ icon: 'none',
+ });
+ return;
+ }
+ sheep.$router.go('/pages/AI/cashierDesk', {
+ id,
+ payOrderId,
+ });
+ };
+
async function getOrderDetail() {
let id = state.orderInfo.id;
// 对详情数据进行适配