feat: 区分普通订单和ai订单的查看物流
This commit is contained in:
+23
-3
@@ -108,8 +108,14 @@
|
||||
</view>
|
||||
<view
|
||||
class="flex btns bg16"
|
||||
v-if="statusObj[state.orderInfo.status]?.btn1 || statusObj[state.orderInfo.status]?.btn2"
|
||||
>
|
||||
<view
|
||||
v-if="hasExpress"
|
||||
class="ai-button3 h_70 line70 size28"
|
||||
:class="{ 'm-r-28': statusObj[state.orderInfo.status]?.btn1 || statusObj[state.orderInfo.status]?.btn2 }"
|
||||
@click="handleOpenExpress"
|
||||
>查看物流</view
|
||||
>
|
||||
<view
|
||||
class="ai-button1 h_70 line70 size28"
|
||||
:class="{
|
||||
@@ -142,7 +148,7 @@
|
||||
<script setup>
|
||||
import sheep from '@/sheep';
|
||||
import { onLoad, onShow } from '@dcloudio/uni-app';
|
||||
import { reactive, ref, getCurrentInstance } from 'vue';
|
||||
import { reactive, ref, getCurrentInstance, computed } from 'vue';
|
||||
import { isEmpty } from 'lodash-es';
|
||||
import {
|
||||
fen2yuan,
|
||||
@@ -334,6 +340,15 @@
|
||||
|
||||
const expressListPopupRef = ref();
|
||||
const closeExpressListPopup = () => {};
|
||||
const isPickUpOrder = () => Number(state.orderInfo?.deliveryType ?? 0) === 2;
|
||||
const hasExpress = computed(() => {
|
||||
const s = Number(state.orderInfo?.status ?? -1);
|
||||
if ([15, 20, 30].includes(s)) return true;
|
||||
if (Number(state.orderInfo?.logisticsId ?? 0) > 0) return true;
|
||||
if (state.orderInfo?.logisticsNo && String(state.orderInfo.logisticsNo).trim()) return true;
|
||||
if (state.orderInfo?.deliveryTime) return true;
|
||||
return false;
|
||||
});
|
||||
const handleOpenExpress = () => {
|
||||
const id = orderId.value || state.orderInfo?.id || 0;
|
||||
if (!id) {
|
||||
@@ -343,7 +358,12 @@
|
||||
});
|
||||
return;
|
||||
}
|
||||
expressListPopupRef.value?.open?.();
|
||||
// AI 店铺订单详情页:店铺订单(无论type多少)一律弹窗查看物流;自提兜底走原生
|
||||
if (!isPickUpOrder()) {
|
||||
expressListPopupRef.value?.open?.();
|
||||
return;
|
||||
}
|
||||
sheep.$router.go('/pages/order/express/log', { id });
|
||||
};
|
||||
</script>
|
||||
|
||||
|
||||
Reference in New Issue
Block a user