Commit 1b50fbbb by chenwq

```

feat(order): 订单详情页面添加来源参数并优化导航逻辑

- 在AuctionOrderPage和ProfilePage中传递from参数到OrderDetailPage
- 添加orderPanelEvents计算属性统一处理子组件事件绑定
- 在订单详情页面添加navigate-to-source事件用于返回原页面
- 优化各订单状态面板的完成操作,统一通过事件处理页面跳转
- 调整提车成功提示时长并在完成后跳转回原页面
```
1 parent a89879cc
......@@ -196,7 +196,7 @@ export default class AuctionOrderPage extends PaginationComponent<AuctionOrder>
if (order.orderState === 'CANCELED') {
BurialPoint.burialPoint(this.$auth.getAuthentication(), 'auction_orderlist_cancelview_click', order.orderId.toString(), this.currentPath);
uni.navigateTo({url: '/module/order/OrderDetailPage?orderId=' + order.orderId});
uni.navigateTo({url: '/module/order/OrderDetailPage?orderId=' + order.orderId + '&from=auctionOrder'});
return;
}
if (order.onAppeal) {
......@@ -205,7 +205,7 @@ export default class AuctionOrderPage extends PaginationComponent<AuctionOrder>
return;
}
BurialPoint.burialPoint(this.$auth.getAuthentication(), 'auction_orderlist_pay_click', order.orderId.toString(), this.currentPath);
uni.navigateTo({url: '/module/order/OrderDetailPage?orderId=' + order.orderId});
uni.navigateTo({url: '/module/order/OrderDetailPage?orderId=' + order.orderId + '&from=auctionOrder'});
// switch (order.orderState) {
// case 'CONTRACT_UNSIGNED':
// BurialPoint.burialPoint(this.$auth.getAuthentication(), 'auction_orderlist_sign_click', order.orderId.toString(), this.currentPath);
......
......@@ -6,13 +6,13 @@
<order-canceled-info-panel v-if="order && order.orderState === 'CANCELED'"
:order="order"></order-canceled-info-panel>
<order-pickup-info-panel v-else-if="order && order.orderState === 'WAIT_PICKUP'" :order="order"
:order-id="orderId" @order-updated="onOrderUpdated"></order-pickup-info-panel>
:order-id="orderId" v-on="orderPanelEvents"></order-pickup-info-panel>
<order-transfer-info-panel v-else-if="order && order.orderState === 'TRANSFERRING'" :order="order"
:order-id="orderId" @order-updated="onOrderUpdated"></order-transfer-info-panel>
:order-id="orderId" v-on="orderPanelEvents"></order-transfer-info-panel>
<order-complete-info-panel v-else-if="order && order.orderState === 'COMPLETED'"
:order="order"></order-complete-info-panel>
:order="order" v-on="orderPanelEvents"></order-complete-info-panel>
<order-payment-info-panel v-else-if="order" :order="order" :order-id="orderId"
@order-updated="onOrderUpdated"></order-payment-info-panel>
v-on="orderPanelEvents"></order-payment-info-panel>
</view>
</view>
</template>
......@@ -43,11 +43,13 @@ import OrderCanceledInfoPanel from "@/module/order/detail/OrderCanceledInfoPanel
})
export default class OrderDetailPage extends Vue {
orderId: number;
from: "auctionOrder" | "profile" | "" = "";
order: AuctionOrder = null;
created(): void {
onLoad((option) => {
this.orderId = Number(option.orderId);
this.from = option.from === "auctionOrder" || option.from === "profile" ? option.from : "";
this.loadData();
});
}
......@@ -66,9 +68,24 @@ export default class OrderDetailPage extends Vue {
this.order = order;
}
get orderPanelEvents() {
return {
"order-updated": this.onOrderUpdated,
"navigate-to-source": this.navigateToSource,
};
}
get isPaymentAuditRejected(): boolean {
return this.order?.orderState === "UNPAID" && this.order?.auditState === "REJECTED";
}
navigateToSource(): void {
if (this.from === "profile") {
uni.switchTab({ url: "/pages/tabbar/ProfilePage" });
return;
}
uni.reLaunch({ url: "/module/order/AuctionOrderPage" });
}
}
</script>
......
......@@ -42,7 +42,7 @@ export default class OrderCompleteInfoPanel extends Vue {
}
finish(): void {
uni.reLaunch({ url: "/module/order/AuctionOrderPage" });
this.$emit("navigate-to-source");
}
}
</script>
......
......@@ -771,7 +771,7 @@ export default class OrderPaymentInfoPanel extends Vue {
icon: "none",
duration: 3000,
complete: () => {
uni.reLaunch({ url: "/module/order/AuctionOrderPage" });
this.$emit("navigate-to-source");
},
});
})
......
......@@ -212,7 +212,10 @@ export default class OrderPickupInfoPanel extends Vue {
.then((res) => {
this.showConfirmPopup = false;
this.$emit("order-updated", res.data);
uni.showToast({ title: "提车成功", icon: "success" });
uni.showToast({ title: "提车成功", icon: "success", duration: 1500 });
setTimeout(() => {
this.$emit("navigate-to-source");
}, 1500);
})
.catch(() => {
uni.showToast({ title: "确认提车失败", icon: "none" });
......
......@@ -708,7 +708,7 @@ export default class OrderTransferInfoPanel extends Vue {
.then(() => {
uni.showToast({ title: "提交成功,请等待审核", icon: "success", duration: 1500 });
setTimeout(() => {
uni.reLaunch({ url: "/module/order/AuctionOrderPage" });
this.$emit("navigate-to-source");
}, 1500);
})
.catch((error) => {
......
......@@ -284,7 +284,7 @@ export default class ProfilePage extends Vue {
return;
}
if(!['CANCELED', 'COMPLETED'].includes(order.orderState)) {
uni.navigateTo({url: '/module/order/OrderDetailPage?orderId=' + order.orderId});
uni.navigateTo({url: '/module/order/OrderDetailPage?orderId=' + order.orderId + '&from=profile'});
}
// switch (order.orderState) {
// case 'CONTRACT_UNSIGNED':
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!