|
|
@ -11,17 +11,18 @@
|
|
|
|
<div class="home-logisitcs-label">我的物流</div>
|
|
|
|
<div class="home-logisitcs-label">我的物流</div>
|
|
|
|
<!-- 无物流信息 -->
|
|
|
|
<!-- 无物流信息 -->
|
|
|
|
<div
|
|
|
|
<div
|
|
|
|
v-if="loadFinish && list.length === 0"
|
|
|
|
v-if="loadFinish && total === 0"
|
|
|
|
class="home-logisitcs-empty flex flex-center flex-middle"
|
|
|
|
class="home-logisitcs-empty flex flex-center flex-middle"
|
|
|
|
>
|
|
|
|
>
|
|
|
|
<img src="~/assets/img/account/home/logisitcs-empty.png" />
|
|
|
|
<img src="~/assets/img/account/home/logisitcs-empty.png" />
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
<!-- 有物流信息 -->
|
|
|
|
<!-- 有物流信息 -->
|
|
|
|
<div v-else v-loading="loading">
|
|
|
|
<div v-else v-loading="loading">
|
|
|
|
<div class="home-logisitcs-content">
|
|
|
|
<div v-infinite-scroll="handleListload" class="home-logisitcs-content">
|
|
|
|
<div
|
|
|
|
<div
|
|
|
|
v-for="item in list"
|
|
|
|
v-for="item in list"
|
|
|
|
:key="item.orderId"
|
|
|
|
:key="item.orderId"
|
|
|
|
|
|
|
|
@click="onJumpOrderDetail(item.orderId)"
|
|
|
|
class="home-logisitcs-content__item flex flex-middle flex-between"
|
|
|
|
class="home-logisitcs-content__item flex flex-middle flex-between"
|
|
|
|
>
|
|
|
|
>
|
|
|
|
<div class="logisitcs-content-item__info flex flex-start">
|
|
|
|
<div class="logisitcs-content-item__info flex flex-start">
|
|
|
@ -68,6 +69,11 @@ export default {
|
|
|
|
data() {
|
|
|
|
data() {
|
|
|
|
return {
|
|
|
|
return {
|
|
|
|
selectOrderId: 0,
|
|
|
|
selectOrderId: 0,
|
|
|
|
|
|
|
|
query: {
|
|
|
|
|
|
|
|
pageIndex: 1,
|
|
|
|
|
|
|
|
length: 15,
|
|
|
|
|
|
|
|
},
|
|
|
|
|
|
|
|
total: 0,
|
|
|
|
confirmOrderVisible: false,
|
|
|
|
confirmOrderVisible: false,
|
|
|
|
list: [],
|
|
|
|
list: [],
|
|
|
|
loading: false,
|
|
|
|
loading: false,
|
|
|
@ -81,11 +87,14 @@ export default {
|
|
|
|
// 获取待收货物流信息
|
|
|
|
// 获取待收货物流信息
|
|
|
|
async getLogisticsList() {
|
|
|
|
async getLogisticsList() {
|
|
|
|
this.loading = true;
|
|
|
|
this.loading = true;
|
|
|
|
const { result } = await ApiGetOrderLogisticsList();
|
|
|
|
const { result } = await ApiGetOrderLogisticsList({ ...this.query });
|
|
|
|
this.loading = false;
|
|
|
|
this.loading = false;
|
|
|
|
this.loadFinish = true;
|
|
|
|
this.loadFinish = true;
|
|
|
|
if (result) {
|
|
|
|
if (result) {
|
|
|
|
this.list = result.map((item) => {
|
|
|
|
const { total, records } = result;
|
|
|
|
|
|
|
|
this.total = total;
|
|
|
|
|
|
|
|
if (records && records.length > 0) {
|
|
|
|
|
|
|
|
const formatRecords = records.map((item) => {
|
|
|
|
const goods = item.products || [{ productImageUrl: "" }];
|
|
|
|
const goods = item.products || [{ productImageUrl: "" }];
|
|
|
|
const logisticsList = item.logistics.logisticsDataList || [
|
|
|
|
const logisticsList = item.logistics.logisticsDataList || [
|
|
|
|
{ context: "暂无物流信息" },
|
|
|
|
{ context: "暂无物流信息" },
|
|
|
@ -96,12 +105,25 @@ export default {
|
|
|
|
logisticsContext: logisticsList[0].context, // 物流详细信息
|
|
|
|
logisticsContext: logisticsList[0].context, // 物流详细信息
|
|
|
|
};
|
|
|
|
};
|
|
|
|
});
|
|
|
|
});
|
|
|
|
|
|
|
|
this.list = this.list.concat(formatRecords);
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
},
|
|
|
|
},
|
|
|
|
onOrderConfirm({ orderId }) {
|
|
|
|
onOrderConfirm({ orderId }) {
|
|
|
|
this.selectOrderId = orderId;
|
|
|
|
this.selectOrderId = orderId;
|
|
|
|
this.confirmOrderVisible = true;
|
|
|
|
this.confirmOrderVisible = true;
|
|
|
|
},
|
|
|
|
},
|
|
|
|
|
|
|
|
// 上拉加载
|
|
|
|
|
|
|
|
handleListload() {
|
|
|
|
|
|
|
|
if (this.total > 0 && this.list.length < this.total) {
|
|
|
|
|
|
|
|
// 执行接口请求
|
|
|
|
|
|
|
|
this.query.pageIndex += 1;
|
|
|
|
|
|
|
|
this.getLogisticsList();
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
},
|
|
|
|
|
|
|
|
onJumpOrderDetail(id) {
|
|
|
|
|
|
|
|
this.$router.push(`/account/order/detail?id=${id}`);
|
|
|
|
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
|
|
// 确认收货
|
|
|
|
// 确认收货
|
|
|
|
async handleOrderEnsure() {
|
|
|
|
async handleOrderEnsure() {
|
|
|
@ -110,7 +132,9 @@ export default {
|
|
|
|
});
|
|
|
|
});
|
|
|
|
this.confirmOrderVisible = false;
|
|
|
|
this.confirmOrderVisible = false;
|
|
|
|
if (result) {
|
|
|
|
if (result) {
|
|
|
|
Message.success("收货成功");
|
|
|
|
Message.success("确认收货成功");
|
|
|
|
|
|
|
|
this.list = [];
|
|
|
|
|
|
|
|
this.query.pageIndex = 1;
|
|
|
|
this.getLogisticsList();
|
|
|
|
this.getLogisticsList();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
},
|
|
|
|
},
|
|
|
@ -154,6 +178,7 @@ export default {
|
|
|
|
}
|
|
|
|
}
|
|
|
|
.home-logisitcs-content__item {
|
|
|
|
.home-logisitcs-content__item {
|
|
|
|
margin-bottom: 30px;
|
|
|
|
margin-bottom: 30px;
|
|
|
|
|
|
|
|
cursor: pointer;
|
|
|
|
&:last-child {
|
|
|
|
&:last-child {
|
|
|
|
margin-bottom: 0;
|
|
|
|
margin-bottom: 0;
|
|
|
|
}
|
|
|
|
}
|
|
|
|