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