优化订单列表

This commit is contained in:
TOP糯米 2023-03-30 10:09:40 +08:00
parent ecc275426d
commit 381c5cf35f
5 changed files with 12 additions and 1 deletions

View File

@ -405,6 +405,7 @@ export default {
.then((response) => {
this.$utils.toast(response.msg).then(() => {
this.$store.commit("system/currentOrderTabIndex", 1);
this.$store.commit("system/refreshOrder", true);
this.$utils.toPage("/pages/order/order", {}, "switch");
});
});

View File

@ -175,6 +175,7 @@ export default {
.then((id) => {
this.$store.dispatch("cart/updateAll");
this.$store.commit("system/currentOrderTabIndex", 0);
this.$store.commit("system/refreshOrder", true);
this.$models.order
.pay({
request: {

View File

@ -98,6 +98,7 @@ export default {
computed: {
...mapState({
currentOrderTabIndex: (state) => state.system.currentOrderTabIndex,
refreshOrder: (state) => state.system.refreshOrder,
}),
},
onLoad() {},
@ -105,11 +106,14 @@ export default {
if (this.currentOrderTabIndex) {
this.tabIndex = this.currentOrderTabIndex;
}
this.switchTab(this.tabIndex);
if (this.refreshOrder) {
this.switchTab(this.tabIndex);
}
},
onReady() {},
onHide() {
this.$store.commit("system/currentOrderTabIndex", 0);
this.$store.commit("system/refreshOrder", false);
},
onReachBottom() {
this.loadData();

View File

@ -212,6 +212,7 @@ export default {
})
.then((data) => {
this.$store.commit("system/currentOrderTabIndex", 2);
this.$store.commit("system/refreshOrder", true);
this.$models.order
.pay({
request: {

View File

@ -10,6 +10,7 @@ export default {
register: "",
serviceMobile: "",
},
refreshOrder: true,
},
getters: {},
mutations: {
@ -21,6 +22,9 @@ export default {
},
platformData(state, data) {
state.platformData = data;
},
refreshOrder(state, data) {
state.refreshOrder = data;
}
},
actions: {