feat: 立即发货按钮展示
This commit is contained in:
@@ -9,7 +9,7 @@
|
|||||||
</view>
|
</view>
|
||||||
<view
|
<view
|
||||||
class="ai-button3 w_144 m-r-10"
|
class="ai-button3 w_144 m-r-10"
|
||||||
v-if="props.status === 50 && !props.disableDelayShipment"
|
v-if="(props.status === 50 || props.hasDelayedItems) && !props.disableDelayShipment"
|
||||||
@tap.stop="emit('now')"
|
@tap.stop="emit('now')"
|
||||||
>
|
>
|
||||||
立即发货
|
立即发货
|
||||||
@@ -54,6 +54,10 @@
|
|||||||
type: String,
|
type: String,
|
||||||
default: '查看订单',
|
default: '查看订单',
|
||||||
},
|
},
|
||||||
|
hasDelayedItems: {
|
||||||
|
type: Boolean,
|
||||||
|
default: false,
|
||||||
|
},
|
||||||
});
|
});
|
||||||
|
|
||||||
const emit = defineEmits(['delay', 'now', 'view', 'confirm', 'pay', 'cancel']);
|
const emit = defineEmits(['delay', 'now', 'view', 'confirm', 'pay', 'cancel']);
|
||||||
|
|||||||
@@ -78,6 +78,7 @@
|
|||||||
:status="currentStatus"
|
:status="currentStatus"
|
||||||
:disableDelayShipment="isPickUpOrder || !isAiStoreOrder"
|
:disableDelayShipment="isPickUpOrder || !isAiStoreOrder"
|
||||||
:showView="true"
|
:showView="true"
|
||||||
|
:hasDelayedItems="hasDelayedItems"
|
||||||
@delay="onDelayShipment"
|
@delay="onDelayShipment"
|
||||||
@now="onNowShipment"
|
@now="onNowShipment"
|
||||||
@view="goAiOrderInfo"
|
@view="goAiOrderInfo"
|
||||||
@@ -219,6 +220,17 @@
|
|||||||
const isDelayedShipmentOrder = () =>
|
const isDelayedShipmentOrder = () =>
|
||||||
currentStatus.value === 50 && !isPickUpOrder.value;
|
currentStatus.value === 50 && !isPickUpOrder.value;
|
||||||
|
|
||||||
|
const hasDelayedItems = computed(() => {
|
||||||
|
if (!isAiStoreOrder.value) return false;
|
||||||
|
if (isPickUpOrder.value) return false;
|
||||||
|
const orderRecords = Array.isArray(props.data?.delayRecords)
|
||||||
|
? props.data.delayRecords
|
||||||
|
: Array.isArray(props.data?.delayRecordList)
|
||||||
|
? props.data.delayRecordList
|
||||||
|
: [];
|
||||||
|
return orderRecords.some((record) => Number(record?.status) === 1);
|
||||||
|
});
|
||||||
|
|
||||||
const state = reactive({
|
const state = reactive({
|
||||||
delayRecords: [],
|
delayRecords: [],
|
||||||
delayRecordsLoaded: false,
|
delayRecordsLoaded: false,
|
||||||
|
|||||||
@@ -105,6 +105,7 @@
|
|||||||
v-if="isAiActionOrder"
|
v-if="isAiActionOrder"
|
||||||
:status="Number(state.orderInfo.status)"
|
:status="Number(state.orderInfo.status)"
|
||||||
:disableDelayShipment="isPickUpOrder || !isAiStoreOrder"
|
:disableDelayShipment="isPickUpOrder || !isAiStoreOrder"
|
||||||
|
:hasDelayedItems="hasDelayedItems"
|
||||||
@delay="delayShipment"
|
@delay="delayShipment"
|
||||||
@now="nowShipment"
|
@now="nowShipment"
|
||||||
@confirm="confirmReceiveOrder"
|
@confirm="confirmReceiveOrder"
|
||||||
@@ -215,12 +216,26 @@
|
|||||||
);
|
);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
const hasDelayedItems = computed(() => {
|
||||||
|
if (!isAiStoreOrder.value) return false;
|
||||||
|
if (isPickUpOrder.value) return false;
|
||||||
|
const records = Array.isArray(state.delayRecords)
|
||||||
|
? state.delayRecords
|
||||||
|
: Array.isArray(state.orderInfo?.delayRecords)
|
||||||
|
? state.orderInfo.delayRecords
|
||||||
|
: Array.isArray(state.orderInfo?.delayRecordList)
|
||||||
|
? state.orderInfo.delayRecordList
|
||||||
|
: [];
|
||||||
|
return records.some((record) => Number(record?.status) === 1);
|
||||||
|
});
|
||||||
|
|
||||||
const showBottomBar = computed(() => {
|
const showBottomBar = computed(() => {
|
||||||
if (!isAiActionOrder.value) return true;
|
if (!isAiActionOrder.value) return true;
|
||||||
const status = Number(state.orderInfo?.status);
|
const status = Number(state.orderInfo?.status);
|
||||||
if ([0, 20].includes(status)) return true;
|
if ([0, 20].includes(status)) return true;
|
||||||
if (!isAiStoreOrder.value) return false;
|
if (!isAiStoreOrder.value) return false;
|
||||||
if (isPickUpOrder.value) return false;
|
if (isPickUpOrder.value) return false;
|
||||||
|
if (hasDelayedItems.value) return true;
|
||||||
return [10, 50, 70].includes(status);
|
return [10, 50, 70].includes(status);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user