feat: 单个物流查看
This commit is contained in:
@@ -45,6 +45,7 @@
|
||||
:delay-records="state.delayRecords"
|
||||
type="4"
|
||||
@getOrderDetail="getOrderDetail"
|
||||
@openExpress="handleOpenExpress"
|
||||
></card_order>
|
||||
|
||||
<PickUpVerify
|
||||
@@ -126,6 +127,15 @@
|
||||
>
|
||||
</view>
|
||||
</view>
|
||||
<ExpressListPopup
|
||||
ref="expressListPopupRef"
|
||||
popup-type="center"
|
||||
:order-no="state.orderInfo.no || ''"
|
||||
:order-data="state.orderInfo"
|
||||
:delay-records="state.delayRecords"
|
||||
:order-id="orderId || state.orderInfo.id || 0"
|
||||
@close="closeExpressListPopup"
|
||||
/>
|
||||
</s-pages>
|
||||
</template>
|
||||
|
||||
@@ -144,6 +154,7 @@
|
||||
import StoreApi from '@/sheep/api/trade/store';
|
||||
import PickUpVerify from '@/pages/order/pickUpVerify.vue';
|
||||
import card_order from '@/components/orderItem/card_order.vue';
|
||||
import ExpressListPopup from '@/components/orderItem/ExpressListPopup.vue';
|
||||
|
||||
const statusBarHeight = sheep.$platform.device.statusBarHeight * 2;
|
||||
const headerBg = sheep.$url.css('/static/img/shop/order/order_bg.png');
|
||||
@@ -320,6 +331,20 @@
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
const expressListPopupRef = ref();
|
||||
const closeExpressListPopup = () => {};
|
||||
const handleOpenExpress = () => {
|
||||
const id = orderId.value || state.orderInfo?.id || 0;
|
||||
if (!id) {
|
||||
uni.showToast({
|
||||
title: '订单信息异常',
|
||||
icon: 'none',
|
||||
});
|
||||
return;
|
||||
}
|
||||
expressListPopupRef.value?.open?.();
|
||||
};
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
|
||||
+35
-1
@@ -31,6 +31,7 @@
|
||||
type="2"
|
||||
theme="2"
|
||||
@getOrderDetail="getOrderDetail"
|
||||
@openExpress="handleTruckLineExpress"
|
||||
></card_order>
|
||||
|
||||
<PickUpVerify
|
||||
@@ -76,8 +77,9 @@
|
||||
</view>
|
||||
<truckLine
|
||||
:data="state.orderInfo"
|
||||
:code="1"
|
||||
:code="Number(isAiStoreOrder ? 2 : 1)"
|
||||
v-if="state.orderInfo.deliveryTime"
|
||||
@openExpress="handleTruckLineExpress"
|
||||
></truckLine>
|
||||
</view>
|
||||
<view class="notice-item flex-row ju-between">
|
||||
@@ -156,6 +158,15 @@
|
||||
@close="closeReceiveItemPopup"
|
||||
@submit="handleReceiveItemSubmit"
|
||||
/>
|
||||
<ExpressListPopup
|
||||
ref="expressListPopupRef"
|
||||
popup-type="center"
|
||||
:order-no="state.orderInfo.no || ''"
|
||||
:order-data="state.orderInfo"
|
||||
:delay-records="state.delayRecords"
|
||||
:order-id="resolveAiOrderId(state.orderInfo)"
|
||||
@close="closeExpressListPopup"
|
||||
/>
|
||||
</s-pages>
|
||||
</template>
|
||||
|
||||
@@ -182,6 +193,7 @@
|
||||
import AiOrderActionBar from '@/components/orderItem/AiOrderActionBar.vue';
|
||||
import ShipmentPopup from '@/components/orderItem/ShipmentPopup.vue';
|
||||
import ReceiveItemPopup from '@/components/orderItem/ReceiveItemPopup.vue';
|
||||
import ExpressListPopup from '@/components/orderItem/ExpressListPopup.vue';
|
||||
import truckLine from '@/components/truckLine/truckLine.vue';
|
||||
import PickUpVerify from '@/pages/order/pickUpVerify.vue';
|
||||
|
||||
@@ -298,9 +310,11 @@
|
||||
const delayShipmentPopupRef = ref();
|
||||
const nowShipmentPopupRef = ref();
|
||||
const receiveItemPopupRef = ref();
|
||||
const expressListPopupRef = ref();
|
||||
const closeDelayShipmentPopup = () => {};
|
||||
const closeNowShipmentPopup = () => {};
|
||||
const closeReceiveItemPopup = () => {};
|
||||
const closeExpressListPopup = () => {};
|
||||
|
||||
const reloadDelayRecords = async () => {
|
||||
if (!isAiStoreOrder.value) {
|
||||
@@ -510,6 +524,26 @@
|
||||
});
|
||||
return;
|
||||
}
|
||||
if (isAiStoreOrder.value && !isPickUpOrder.value) {
|
||||
expressListPopupRef.value?.open?.();
|
||||
return;
|
||||
}
|
||||
sheep.$router.go('/pages/order/express/log', { id });
|
||||
};
|
||||
|
||||
const handleTruckLineExpress = () => {
|
||||
const id = resolveAiOrderId(state.orderInfo);
|
||||
if (!id) {
|
||||
uni.showToast({
|
||||
title: '订单信息异常',
|
||||
icon: 'none',
|
||||
});
|
||||
return;
|
||||
}
|
||||
if (!isPickUpOrder.value) {
|
||||
expressListPopupRef.value?.open?.();
|
||||
return;
|
||||
}
|
||||
sheep.$router.go('/pages/order/express/log', { id });
|
||||
};
|
||||
|
||||
|
||||
@@ -58,38 +58,90 @@
|
||||
import { onLoad } from '@dcloudio/uni-app';
|
||||
import { computed, reactive } from 'vue';
|
||||
import OrderApi from '@/sheep/api/trade/order';
|
||||
import { getOrderDetail as getAiOrderDetail } from '@/sheep/api/ai';
|
||||
import { getExpressTrackList } from '@/sheep/api/index/index';
|
||||
import HighlightNumber from '@/pages/components/HighlightNumberText.vue';
|
||||
|
||||
const state = reactive({
|
||||
info: [],
|
||||
info: {},
|
||||
tracks: [],
|
||||
});
|
||||
|
||||
const goodsImages = computed(() => {
|
||||
let array = [];
|
||||
if (state.info.items) {
|
||||
if (state.info && state.info.items) {
|
||||
state.info.items.forEach((item) => {
|
||||
array.push({
|
||||
image: item.picUrl,
|
||||
});
|
||||
});
|
||||
}
|
||||
if (state.info && state.info.delayRecords && Array.isArray(state.info.delayRecords)) {
|
||||
state.info.delayRecords.forEach((record) => {
|
||||
if (record.picUrl || record.orderItemVO?.picUrl) {
|
||||
array.push({
|
||||
image: record.picUrl || record.orderItemVO?.picUrl,
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
return array;
|
||||
});
|
||||
|
||||
async function getExpressDetail(id) {
|
||||
const { data } = await OrderApi.getOrderExpressTrackList(id);
|
||||
state.tracks = data;
|
||||
async function getExpressDetail(options) {
|
||||
const id = options?.id;
|
||||
const codeRaw = options?.code;
|
||||
const code =
|
||||
codeRaw !== undefined && codeRaw !== null && String(codeRaw).trim() !== ''
|
||||
? Number(codeRaw)
|
||||
: 0;
|
||||
const delayRecordId = options?.delayRecordId;
|
||||
const hasDelayRecordId =
|
||||
delayRecordId !== undefined &&
|
||||
delayRecordId !== null &&
|
||||
String(delayRecordId).trim() !== '';
|
||||
if (id) {
|
||||
state.info.id = id;
|
||||
}
|
||||
if (code === 2 && hasDelayRecordId) {
|
||||
const { data } = await getExpressTrackList({
|
||||
id,
|
||||
code: 2,
|
||||
delayRecordId,
|
||||
});
|
||||
state.tracks = data;
|
||||
} else if (code > 0) {
|
||||
const { data } = await getExpressTrackList({
|
||||
id,
|
||||
code,
|
||||
});
|
||||
state.tracks = data;
|
||||
} else {
|
||||
const { data } = await OrderApi.getOrderExpressTrackList(id);
|
||||
state.tracks = data;
|
||||
}
|
||||
}
|
||||
|
||||
async function getOrderDetail(id) {
|
||||
const { data } = await OrderApi.getOrderDetail(id);
|
||||
state.info = data;
|
||||
if (!id) return;
|
||||
try {
|
||||
const { data } = await OrderApi.getOrderDetail(id);
|
||||
if (data) {
|
||||
state.info = data;
|
||||
return;
|
||||
}
|
||||
} catch (e) {}
|
||||
try {
|
||||
const { data } = await getAiOrderDetail({ id });
|
||||
if (data) {
|
||||
state.info = data;
|
||||
}
|
||||
} catch (e) {}
|
||||
}
|
||||
|
||||
onLoad((options) => {
|
||||
getExpressDetail(options.id);
|
||||
getOrderDetail(options.id);
|
||||
getExpressDetail(options || {});
|
||||
getOrderDetail(options?.id);
|
||||
});
|
||||
|
||||
function handlePhoneClick(data) {
|
||||
|
||||
Reference in New Issue
Block a user