feat: 自提状态下不展示延时发货
This commit is contained in:
@@ -1,9 +1,17 @@
|
|||||||
<template>
|
<template>
|
||||||
<view class="flex-center ju-flex-end w100">
|
<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>
|
||||||
<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>
|
||||||
<view class="ai-button3 w_144" v-if="props.showView" @tap.stop="emit('view')">
|
<view class="ai-button3 w_144" v-if="props.showView" @tap.stop="emit('view')">
|
||||||
@@ -24,6 +32,10 @@
|
|||||||
type: Number,
|
type: Number,
|
||||||
default: -1,
|
default: -1,
|
||||||
},
|
},
|
||||||
|
disableDelayShipment: {
|
||||||
|
type: Boolean,
|
||||||
|
default: false,
|
||||||
|
},
|
||||||
showView: {
|
showView: {
|
||||||
type: Boolean,
|
type: Boolean,
|
||||||
default: false,
|
default: false,
|
||||||
|
|||||||
@@ -69,6 +69,7 @@
|
|||||||
<view class="flex-center ju-flex-end m-t-12" v-if="props.index != 5 && isAiActionOrder">
|
<view class="flex-center ju-flex-end m-t-12" v-if="props.index != 5 && isAiActionOrder">
|
||||||
<AiOrderActionBar
|
<AiOrderActionBar
|
||||||
:status="currentStatus"
|
:status="currentStatus"
|
||||||
|
:disableDelayShipment="isPickUpOrder"
|
||||||
:showView="true"
|
:showView="true"
|
||||||
@delay="onDelayShipment"
|
@delay="onDelayShipment"
|
||||||
@now="onNowShipment"
|
@now="onNowShipment"
|
||||||
@@ -87,6 +88,7 @@
|
|||||||
getCurrentInstance,
|
getCurrentInstance,
|
||||||
defineProps,
|
defineProps,
|
||||||
defineEmits,
|
defineEmits,
|
||||||
|
computed,
|
||||||
ref,
|
ref,
|
||||||
watch,
|
watch,
|
||||||
} from 'vue';
|
} from 'vue';
|
||||||
@@ -157,6 +159,15 @@
|
|||||||
|
|
||||||
const isAiActionOrder =
|
const isAiActionOrder =
|
||||||
String(props.data?.__source) === 'aishop' || Number(props.data?.type) === 5;
|
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));
|
const currentStatus = ref(Number(props.data?.status));
|
||||||
watch(
|
watch(
|
||||||
() => props.data?.status,
|
() => props.data?.status,
|
||||||
@@ -165,7 +176,8 @@
|
|||||||
},
|
},
|
||||||
{ immediate: true },
|
{ immediate: true },
|
||||||
);
|
);
|
||||||
const isDelayedShipmentOrder = () => currentStatus.value === 50;
|
const isDelayedShipmentOrder = () =>
|
||||||
|
currentStatus.value === 50 && !isPickUpOrder.value;
|
||||||
|
|
||||||
const resolveAiOrderId = (data) => {
|
const resolveAiOrderId = (data) => {
|
||||||
return data?.id || data?.orderId;
|
return data?.id || data?.orderId;
|
||||||
@@ -180,6 +192,7 @@
|
|||||||
};
|
};
|
||||||
|
|
||||||
function delayShipment(data) {
|
function delayShipment(data) {
|
||||||
|
if (isPickUpOrder.value) return;
|
||||||
const id = resolveAiOrderId(data);
|
const id = resolveAiOrderId(data);
|
||||||
if (!id) {
|
if (!id) {
|
||||||
uni.showToast({
|
uni.showToast({
|
||||||
@@ -207,6 +220,7 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
function nowShipment(data) {
|
function nowShipment(data) {
|
||||||
|
if (isPickUpOrder.value) return;
|
||||||
const id = resolveAiOrderId(data);
|
const id = resolveAiOrderId(data);
|
||||||
if (!id) {
|
if (!id) {
|
||||||
uni.showToast({
|
uni.showToast({
|
||||||
|
|||||||
+2
-2
@@ -2,8 +2,8 @@
|
|||||||
"name" : "优购商城",
|
"name" : "优购商城",
|
||||||
"appid" : "__UNI__8B19741",
|
"appid" : "__UNI__8B19741",
|
||||||
"description" : "",
|
"description" : "",
|
||||||
"versionName" : "1.5.8",
|
"versionName" : "1.6.0",
|
||||||
"versionCode" : 158,
|
"versionCode" : 160,
|
||||||
"transformPx" : false,
|
"transformPx" : false,
|
||||||
"app-plus" : {
|
"app-plus" : {
|
||||||
"privacy" : {
|
"privacy" : {
|
||||||
|
|||||||
+22
-1
@@ -93,11 +93,12 @@
|
|||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
<su-fixed bottom placeholder bg="bg24">
|
<su-fixed bottom placeholder bg="bg24" v-if="showBottomBar">
|
||||||
<view class="orderBan flex-column ju-center">
|
<view class="orderBan flex-column ju-center">
|
||||||
<AiOrderActionBar
|
<AiOrderActionBar
|
||||||
v-if="isAiActionOrder"
|
v-if="isAiActionOrder"
|
||||||
:status="Number(state.orderInfo.status)"
|
:status="Number(state.orderInfo.status)"
|
||||||
|
:disableDelayShipment="isPickUpOrder"
|
||||||
@delay="delayShipment"
|
@delay="delayShipment"
|
||||||
@now="nowShipment"
|
@now="nowShipment"
|
||||||
@confirm="confirmReceiveOrder"
|
@confirm="confirmReceiveOrder"
|
||||||
@@ -162,6 +163,24 @@
|
|||||||
);
|
);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
const isPickUpOrder = computed(() => {
|
||||||
|
if (Number(state.orderInfo?.deliveryType) === 2) return true;
|
||||||
|
return Boolean(
|
||||||
|
state.orderInfo?.pickUpStoreId ||
|
||||||
|
state.orderInfo?.pickUpStore ||
|
||||||
|
state.orderInfo?.pickUpStoreVO ||
|
||||||
|
state.orderInfo?.pickUpVerifyCode,
|
||||||
|
);
|
||||||
|
});
|
||||||
|
|
||||||
|
const showBottomBar = computed(() => {
|
||||||
|
if (!isAiActionOrder.value) return true;
|
||||||
|
const status = Number(state.orderInfo?.status);
|
||||||
|
if ([0, 20].includes(status)) return true;
|
||||||
|
if (isPickUpOrder.value) return false;
|
||||||
|
return [10, 50].includes(status);
|
||||||
|
});
|
||||||
|
|
||||||
const resolvePickUpStoreId = (data = {}) => {
|
const resolvePickUpStoreId = (data = {}) => {
|
||||||
return Number(
|
return Number(
|
||||||
data?.pickUpStoreId ||
|
data?.pickUpStoreId ||
|
||||||
@@ -181,6 +200,7 @@
|
|||||||
};
|
};
|
||||||
|
|
||||||
function delayShipment() {
|
function delayShipment() {
|
||||||
|
if (isPickUpOrder.value) return;
|
||||||
const id = resolveAiOrderId(state.orderInfo);
|
const id = resolveAiOrderId(state.orderInfo);
|
||||||
if (!id) {
|
if (!id) {
|
||||||
uni.showToast({
|
uni.showToast({
|
||||||
@@ -207,6 +227,7 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
function nowShipment() {
|
function nowShipment() {
|
||||||
|
if (isPickUpOrder.value) return;
|
||||||
const id = resolveAiOrderId(state.orderInfo);
|
const id = resolveAiOrderId(state.orderInfo);
|
||||||
if (!id) {
|
if (!id) {
|
||||||
uni.showToast({
|
uni.showToast({
|
||||||
|
|||||||
Reference in New Issue
Block a user