diff --git a/src/pages/demand/demand.vue b/src/pages/demand/demand.vue index 3892962..6d65765 100644 --- a/src/pages/demand/demand.vue +++ b/src/pages/demand/demand.vue @@ -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"); }); }); diff --git a/src/pages/order/create.vue b/src/pages/order/create.vue index d26b165..012872d 100644 --- a/src/pages/order/create.vue +++ b/src/pages/order/create.vue @@ -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: { diff --git a/src/pages/order/order.vue b/src/pages/order/order.vue index 7e8ca63..1d74feb 100644 --- a/src/pages/order/order.vue +++ b/src/pages/order/order.vue @@ -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(); diff --git a/src/pages/service/other/distribution.vue b/src/pages/service/other/distribution.vue index 9c33480..9e20636 100644 --- a/src/pages/service/other/distribution.vue +++ b/src/pages/service/other/distribution.vue @@ -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: { diff --git a/src/store/modules/system.js b/src/store/modules/system.js index c925f6f..f43ca79 100644 --- a/src/store/modules/system.js +++ b/src/store/modules/system.js @@ -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: {