优化订单列表

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) => { .then((response) => {
this.$utils.toast(response.msg).then(() => { this.$utils.toast(response.msg).then(() => {
this.$store.commit("system/currentOrderTabIndex", 1); this.$store.commit("system/currentOrderTabIndex", 1);
this.$store.commit("system/refreshOrder", true);
this.$utils.toPage("/pages/order/order", {}, "switch"); this.$utils.toPage("/pages/order/order", {}, "switch");
}); });
}); });

View File

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

View File

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

View File

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

View File

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