优化页面

This commit is contained in:
TOP糯米 2023-03-30 17:19:46 +08:00
parent 963745ac42
commit a7ff964d4b
4 changed files with 34 additions and 10 deletions

View File

@ -119,18 +119,20 @@ export default {
computed: { computed: {
...mapState({ ...mapState({
refreshGet: (state) => state.system.refreshGet, refreshGet: (state) => state.system.refreshGet,
getTabIndex: (state) => state.system.getTabIndex,
}), }),
}, },
onLoad() {}, onLoad() {},
onShow() { onShow() {
if (this.getTabIndex != this.tabIndex) {
this.tabIndex = this.getTabIndex;
}
if (this.refreshGet) { if (this.refreshGet) {
this.switchTab(this.tabIndex); this.switchTab(this.tabIndex);
} }
}, },
onReady() {}, onReady() {},
onHide() { onHide() {},
this.$store.commit("system/refreshGet", false);
},
onReachBottom() { onReachBottom() {
this.loadData(); this.loadData();
}, },
@ -143,6 +145,7 @@ export default {
* 切换列表 * 切换列表
*/ */
switchTab(index) { switchTab(index) {
this.$store.commit("system/getTabIndex", index);
this.tabIndex = index; this.tabIndex = index;
let currentTab = this.tabList[index]; let currentTab = this.tabList[index];
currentTab.page = 1; currentTab.page = 1;
@ -259,6 +262,7 @@ export default {
* 查看详情 * 查看详情
*/ */
toDetail(id) { toDetail(id) {
this.$store.commit("system/refreshGet", false);
let currentTab = this.tabList[this.tabIndex]; let currentTab = this.tabList[this.tabIndex];
this.$utils.toPage("/pages/get/detail?list=" + currentTab.listType + "&id=" + id); this.$utils.toPage("/pages/get/detail?list=" + currentTab.listType + "&id=" + id);
}, },

View File

@ -54,19 +54,19 @@
</view> </view>
</view> </view>
<view class="action-group"> <view class="action-group">
<view class="item"> <view class="item" @click="toGet(0)">
<text class="num">{{ action.item1 }}</text> <text class="num">{{ action.item1 }}</text>
<text class="title">立即抢单</text> <text class="title">立即抢单</text>
</view> </view>
<view class="item"> <view class="item" @click="toGet(1)">
<text class="num">{{ action.item2 }}</text> <text class="num">{{ action.item2 }}</text>
<text class="title">立即报价</text> <text class="title">立即报价</text>
</view> </view>
<view class="item"> <view class="item" @click="toGet(2)">
<text class="num">{{ action.item3 }}</text> <text class="num">{{ action.item3 }}</text>
<text class="title">配送抢单</text> <text class="title">配送抢单</text>
</view> </view>
<view class="item"> <view class="item" @click="toOrder(1)">
<text class="num">{{ action.item4 }}</text> <text class="num">{{ action.item4 }}</text>
<text class="title">指派专区</text> <text class="title">指派专区</text>
</view> </view>
@ -133,6 +133,14 @@ export default {
this.$store.commit("system/messageTabIndex", id); this.$store.commit("system/messageTabIndex", id);
this.$utils.toPage("/pages/message/message", {}, "switch"); this.$utils.toPage("/pages/message/message", {}, "switch");
}, },
toGet(index) {
this.$store.commit("system/getTabIndex", index);
this.$utils.toPage("/pages/get/index", {});
},
toOrder(index) {
this.$store.commit("system/orderTabIndex", index);
this.$utils.toPage("/pages/order/order", {}, "switch");
},
notifyDetail(detail) { notifyDetail(detail) {
this.showNotifyModal = true; this.showNotifyModal = true;
this.notify.title = detail.title; this.notify.title = detail.title;

View File

@ -110,18 +110,20 @@ export default {
computed: { computed: {
...mapState({ ...mapState({
refreshOrder: (state) => state.system.refreshOrder, refreshOrder: (state) => state.system.refreshOrder,
orderTabIndex: (state) => state.system.orderTabIndex,
}), }),
}, },
onLoad() {}, onLoad() {},
onShow() { onShow() {
if (this.orderTabIndex != this.tabIndex) {
this.tabIndex = this.orderTabIndex;
}
if (this.refreshOrder) { if (this.refreshOrder) {
this.switchTab(this.tabIndex); this.switchTab(this.tabIndex);
} }
}, },
onReady() {}, onReady() {},
onHide() { onHide() {},
this.$store.commit("system/refreshOrder", false);
},
onReachBottom() { onReachBottom() {
this.loadData(); this.loadData();
}, },
@ -131,6 +133,7 @@ export default {
}, },
methods: { methods: {
switchTab(index) { switchTab(index) {
this.$store.commit("system/orderTabIndex", index);
this.tabIndex = index; this.tabIndex = index;
let currentTab = this.tabList[index]; let currentTab = this.tabList[index];
currentTab.page = 1; currentTab.page = 1;
@ -211,6 +214,7 @@ export default {
}); });
}, },
toDetail(id) { toDetail(id) {
this.$store.commit("system/refreshOrder", false);
let currentTab = this.tabList[this.tabIndex]; let currentTab = this.tabList[this.tabIndex];
this.$utils.toPage("/pages/order/detail?list=" + currentTab.listType + "&id=" + id); this.$utils.toPage("/pages/order/detail?list=" + currentTab.listType + "&id=" + id);
}, },

View File

@ -3,6 +3,8 @@ export default {
namespaced: true, namespaced: true,
state: { state: {
messageTabIndex: 0, messageTabIndex: 0,
getTabIndex: 0,
orderTabIndex: 0,
platformData: { platformData: {
about: "", about: "",
privacy: "", privacy: "",
@ -17,6 +19,12 @@ export default {
messageTabIndex(state, data) { messageTabIndex(state, data) {
state.messageTabIndex = data; state.messageTabIndex = data;
}, },
getTabIndex(state, data) {
state.getTabIndex = data;
},
orderTabIndex(state, data) {
state.orderTabIndex = data;
},
platformData(state, data) { platformData(state, data) {
state.platformData = data; state.platformData = data;
}, },