feat: 自提状态下不展示延时发货
This commit is contained in:
@@ -1,9 +1,17 @@
|
||||
<template>
|
||||
<view class="flex-center ju-flex-end w100">
|
||||
<view class="ai-button3 w_144 m-r-10" v-if="props.status === 10" @tap.stop="emit('delay')">
|
||||
<view
|
||||
class="ai-button3 w_144 m-r-10"
|
||||
v-if="props.status === 10 && !props.disableDelayShipment"
|
||||
@tap.stop="emit('delay')"
|
||||
>
|
||||
延迟发货
|
||||
</view>
|
||||
<view class="ai-button3 w_144 m-r-10" v-if="props.status === 50" @tap.stop="emit('now')">
|
||||
<view
|
||||
class="ai-button3 w_144 m-r-10"
|
||||
v-if="props.status === 50 && !props.disableDelayShipment"
|
||||
@tap.stop="emit('now')"
|
||||
>
|
||||
立即发货
|
||||
</view>
|
||||
<view class="ai-button3 w_144" v-if="props.showView" @tap.stop="emit('view')">
|
||||
@@ -24,6 +32,10 @@
|
||||
type: Number,
|
||||
default: -1,
|
||||
},
|
||||
disableDelayShipment: {
|
||||
type: Boolean,
|
||||
default: false,
|
||||
},
|
||||
showView: {
|
||||
type: Boolean,
|
||||
default: false,
|
||||
|
||||
@@ -69,6 +69,7 @@
|
||||
<view class="flex-center ju-flex-end m-t-12" v-if="props.index != 5 && isAiActionOrder">
|
||||
<AiOrderActionBar
|
||||
:status="currentStatus"
|
||||
:disableDelayShipment="isPickUpOrder"
|
||||
:showView="true"
|
||||
@delay="onDelayShipment"
|
||||
@now="onNowShipment"
|
||||
@@ -87,6 +88,7 @@
|
||||
getCurrentInstance,
|
||||
defineProps,
|
||||
defineEmits,
|
||||
computed,
|
||||
ref,
|
||||
watch,
|
||||
} from 'vue';
|
||||
@@ -157,6 +159,15 @@
|
||||
|
||||
const isAiActionOrder =
|
||||
String(props.data?.__source) === 'aishop' || Number(props.data?.type) === 5;
|
||||
const isPickUpOrder = computed(() => {
|
||||
if (Number(props.data?.deliveryType) === 2) return true;
|
||||
return Boolean(
|
||||
props.data?.pickUpStoreId ||
|
||||
props.data?.pickUpStore ||
|
||||
props.data?.pickUpStoreVO ||
|
||||
props.data?.pickUpVerifyCode,
|
||||
);
|
||||
});
|
||||
const currentStatus = ref(Number(props.data?.status));
|
||||
watch(
|
||||
() => props.data?.status,
|
||||
@@ -165,7 +176,8 @@
|
||||
},
|
||||
{ immediate: true },
|
||||
);
|
||||
const isDelayedShipmentOrder = () => currentStatus.value === 50;
|
||||
const isDelayedShipmentOrder = () =>
|
||||
currentStatus.value === 50 && !isPickUpOrder.value;
|
||||
|
||||
const resolveAiOrderId = (data) => {
|
||||
return data?.id || data?.orderId;
|
||||
@@ -180,6 +192,7 @@
|
||||
};
|
||||
|
||||
function delayShipment(data) {
|
||||
if (isPickUpOrder.value) return;
|
||||
const id = resolveAiOrderId(data);
|
||||
if (!id) {
|
||||
uni.showToast({
|
||||
@@ -207,6 +220,7 @@
|
||||
}
|
||||
|
||||
function nowShipment(data) {
|
||||
if (isPickUpOrder.value) return;
|
||||
const id = resolveAiOrderId(data);
|
||||
if (!id) {
|
||||
uni.showToast({
|
||||
|
||||
Reference in New Issue
Block a user