优化订单跳转
This commit is contained in:
parent
482ff54eb8
commit
f27b2cdb1a
|
@ -377,6 +377,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.$utils.toPage("/pages/order/order", {}, "switch");
|
this.$utils.toPage("/pages/order/order", {}, "switch");
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
|
@ -174,6 +174,7 @@ export default {
|
||||||
})
|
})
|
||||||
.then((id) => {
|
.then((id) => {
|
||||||
this.$store.dispatch("cart/updateAll");
|
this.$store.dispatch("cart/updateAll");
|
||||||
|
this.$store.commit("system/currentOrderTabIndex", 0);
|
||||||
this.$models.order
|
this.$models.order
|
||||||
.pay({
|
.pay({
|
||||||
request: {
|
request: {
|
||||||
|
|
|
@ -57,6 +57,7 @@ import AppLayout from "@/components/layout/layout";
|
||||||
import OrderItem from "@/components/order/item";
|
import OrderItem from "@/components/order/item";
|
||||||
import OrderAction from "@/components/order/action";
|
import OrderAction from "@/components/order/action";
|
||||||
import WidgetLoadMore from "@/components/widgets/loadmore";
|
import WidgetLoadMore from "@/components/widgets/loadmore";
|
||||||
|
import { mapState } from "vuex";
|
||||||
export default {
|
export default {
|
||||||
name: "order",
|
name: "order",
|
||||||
data() {
|
data() {
|
||||||
|
@ -94,11 +95,22 @@ export default {
|
||||||
OrderAction,
|
OrderAction,
|
||||||
WidgetLoadMore,
|
WidgetLoadMore,
|
||||||
},
|
},
|
||||||
|
computed: {
|
||||||
|
...mapState({
|
||||||
|
currentOrderTabIndex: (state) => state.system.currentOrderTabIndex,
|
||||||
|
}),
|
||||||
|
},
|
||||||
onLoad() {},
|
onLoad() {},
|
||||||
onShow() {
|
onShow() {
|
||||||
|
if (this.currentOrderTabIndex) {
|
||||||
|
this.tabIndex = this.currentOrderTabIndex;
|
||||||
|
}
|
||||||
this.switchTab(this.tabIndex);
|
this.switchTab(this.tabIndex);
|
||||||
},
|
},
|
||||||
onReady() {},
|
onReady() {},
|
||||||
|
onHide() {
|
||||||
|
this.$store.commit("system/currentOrderTabIndex", 0);
|
||||||
|
},
|
||||||
onReachBottom() {
|
onReachBottom() {
|
||||||
this.loadData();
|
this.loadData();
|
||||||
},
|
},
|
||||||
|
|
|
@ -207,6 +207,7 @@ export default {
|
||||||
distance: this.distance,
|
distance: this.distance,
|
||||||
})
|
})
|
||||||
.then((data) => {
|
.then((data) => {
|
||||||
|
this.$store.commit("system/currentOrderTabIndex", 2);
|
||||||
this.$models.order
|
this.$models.order
|
||||||
.pay({
|
.pay({
|
||||||
request: {
|
request: {
|
||||||
|
|
|
@ -2,11 +2,15 @@ export default {
|
||||||
namespaced: true,
|
namespaced: true,
|
||||||
state: {
|
state: {
|
||||||
currentCateId: 0,
|
currentCateId: 0,
|
||||||
|
currentOrderTabIndex: 0,
|
||||||
},
|
},
|
||||||
getters: {},
|
getters: {},
|
||||||
mutations: {
|
mutations: {
|
||||||
currentCateId(state, data) {
|
currentCateId(state, data) {
|
||||||
state.currentCateId = data;
|
state.currentCateId = data;
|
||||||
|
},
|
||||||
|
currentOrderTabIndex(state, data) {
|
||||||
|
state.currentOrderTabIndex = data;
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
actions: {}
|
actions: {}
|
||||||
|
|
Loading…
Reference in New Issue