From 9fb0a7458413c34e05cb44f5ab9e426625c530d5 Mon Sep 17 00:00:00 2001 From: jscyl13849007907 <13849007907@163.com> Date: Fri, 5 Jun 2026 09:49:28 +0800 Subject: [PATCH] no message --- pages/home/index.vue | 22 +++++++++++++++++++++- 1 file changed, 21 insertions(+), 1 deletion(-) diff --git a/pages/home/index.vue b/pages/home/index.vue index d9dc43e..45d81f8 100644 --- a/pages/home/index.vue +++ b/pages/home/index.vue @@ -332,12 +332,14 @@ export default { } that.initSelectedCityByAgencyInfo().then(() => { that.loadSelectedCityFromCache().then(() => { + that.restoreActiveTab(); that.getList(); }); }); } else { that.initSelectedCityByAgencyInfo().then(() => { that.loadSelectedCityFromCache().then(() => { + that.restoreActiveTab(); this.getList(); }); }); @@ -1122,7 +1124,7 @@ export default { }); }, goDetail($item) { - // console.log("前往详情页", $item); + uni.setStorageSync("HOME_ACTIVE_TAB", this.tabInfo.active); uni.navigateTo({ url: "/root/detail/job?id=" + $item.id, }); @@ -1275,6 +1277,24 @@ export default { // console.log(this.whichPage); this.getList(); }, + restoreActiveTab() { + let savedTab = uni.getStorageSync("HOME_ACTIVE_TAB"); + if (savedTab !== "" && savedTab !== null && savedTab !== undefined) { + uni.removeStorageSync("HOME_ACTIVE_TAB"); + if (savedTab !== this.tabInfo.active && savedTab < this.tabInfo.list.length) { + this.tabInfo.active = savedTab; + this.query.list = []; + this.loading = true; + this.query.page = 1; + this.speed = -1; + if (this.tabInfo.list[this.tabInfo.active].classify == 2) { + this.query.ujc = 1; + } else { + this.query.ujc = 0; + } + } + } + }, handleUpdateTab(e) { // console.log("获取tab数据:", e); let that = this;