From 9153dff40743d7023873fc23e0321fb21f957da5 Mon Sep 17 00:00:00 2001 From: yaoqin <497681109@qq.com> Date: Fri, 1 Aug 2025 17:13:20 +0800 Subject: [PATCH] =?UTF-8?q?=E6=B5=8B=E8=AF=95=E7=89=88V1.2.0=E6=9B=B4?= =?UTF-8?q?=E6=96=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- mining-pool/src/components/content.vue | 7 +- mining-pool/src/main.js | 2 +- .../src/views/AccessMiningPool/index.js | 103 +++--------------- .../src/views/AccessMiningPool/index.vue | 4 +- mining-pool/src/views/home/index.js | 5 +- mining-pool/test.zip | Bin 7816509 -> 7680798 bytes .../test/css/app-0a0a89cb.3a738b58.css | 1 + .../test/css/app-0a0a89cb.3a738b58.css.gz | Bin 0 -> 10612 bytes .../test/css/app-113c6c50.e7088500.css | 1 + .../test/css/app-113c6c50.e7088500.css.gz | Bin 0 -> 6852 bytes .../test/css/app-7023e5b0.b2dd9d63.css | 1 + .../test/css/app-7023e5b0.b2dd9d63.css.gz | Bin 0 -> 5227 bytes .../test/css/app-b4c4f6ec.855e5d4c.css | 1 + .../test/css/app-b4c4f6ec.855e5d4c.css.gz | Bin 0 -> 7047 bytes .../test/css/app-d87c119a.c835515c.css | 1 + .../test/css/app-d87c119a.c835515c.css.gz | Bin 0 -> 13912 bytes mining-pool/test/index.html | 2 +- mining-pool/test/js/app-0a0a89cb.617c0d7d.js | 1 + .../test/js/app-0a0a89cb.617c0d7d.js.gz | Bin 0 -> 21902 bytes mining-pool/test/js/app-113c6c50.f41deb32.js | 1 + .../test/js/app-113c6c50.f41deb32.js.gz | Bin 0 -> 25287 bytes mining-pool/test/js/app-5c551db8.84d543aa.js | 1 + .../test/js/app-5c551db8.84d543aa.js.gz | Bin 0 -> 10453 bytes mining-pool/test/js/app-7023e5b0.fc505df9.js | 1 + .../test/js/app-7023e5b0.fc505df9.js.gz | Bin 0 -> 9040 bytes mining-pool/test/js/app-a6ba6ead.ce3a9923.js | 1 + .../test/js/app-a6ba6ead.ce3a9923.js.gz | Bin 0 -> 25993 bytes mining-pool/test/js/app-af2560cd.7ed13436.js | 1 + .../test/js/app-af2560cd.7ed13436.js.gz | Bin 0 -> 9368 bytes mining-pool/test/js/app-b4c4f6ec.eb8c1455.js | 1 + .../test/js/app-b4c4f6ec.eb8c1455.js.gz | Bin 0 -> 9954 bytes mining-pool/test/js/app-d87c119a.4cb0202f.js | 1 + .../test/js/app-d87c119a.4cb0202f.js.gz | Bin 0 -> 50943 bytes mining-pool/test/sitemap-en.xml | 2 +- mining-pool/test/sitemap-en.xml.gz | Bin 379 -> 378 bytes mining-pool/test/sitemap-zh.xml | 2 +- mining-pool/test/sitemap-zh.xml.gz | Bin 364 -> 364 bytes 37 files changed, 40 insertions(+), 100 deletions(-) create mode 100644 mining-pool/test/css/app-0a0a89cb.3a738b58.css create mode 100644 mining-pool/test/css/app-0a0a89cb.3a738b58.css.gz create mode 100644 mining-pool/test/css/app-113c6c50.e7088500.css create mode 100644 mining-pool/test/css/app-113c6c50.e7088500.css.gz create mode 100644 mining-pool/test/css/app-7023e5b0.b2dd9d63.css create mode 100644 mining-pool/test/css/app-7023e5b0.b2dd9d63.css.gz create mode 100644 mining-pool/test/css/app-b4c4f6ec.855e5d4c.css create mode 100644 mining-pool/test/css/app-b4c4f6ec.855e5d4c.css.gz create mode 100644 mining-pool/test/css/app-d87c119a.c835515c.css create mode 100644 mining-pool/test/css/app-d87c119a.c835515c.css.gz create mode 100644 mining-pool/test/js/app-0a0a89cb.617c0d7d.js create mode 100644 mining-pool/test/js/app-0a0a89cb.617c0d7d.js.gz create mode 100644 mining-pool/test/js/app-113c6c50.f41deb32.js create mode 100644 mining-pool/test/js/app-113c6c50.f41deb32.js.gz create mode 100644 mining-pool/test/js/app-5c551db8.84d543aa.js create mode 100644 mining-pool/test/js/app-5c551db8.84d543aa.js.gz create mode 100644 mining-pool/test/js/app-7023e5b0.fc505df9.js create mode 100644 mining-pool/test/js/app-7023e5b0.fc505df9.js.gz create mode 100644 mining-pool/test/js/app-a6ba6ead.ce3a9923.js create mode 100644 mining-pool/test/js/app-a6ba6ead.ce3a9923.js.gz create mode 100644 mining-pool/test/js/app-af2560cd.7ed13436.js create mode 100644 mining-pool/test/js/app-af2560cd.7ed13436.js.gz create mode 100644 mining-pool/test/js/app-b4c4f6ec.eb8c1455.js create mode 100644 mining-pool/test/js/app-b4c4f6ec.eb8c1455.js.gz create mode 100644 mining-pool/test/js/app-d87c119a.4cb0202f.js create mode 100644 mining-pool/test/js/app-d87c119a.4cb0202f.js.gz diff --git a/mining-pool/src/components/content.vue b/mining-pool/src/components/content.vue index a68887f..df6aee8 100644 --- a/mining-pool/src/components/content.vue +++ b/mining-pool/src/components/content.vue @@ -296,13 +296,12 @@ export default { let url = `/${lang}/AccessMiningPool` // 使用 name 进行导航,避免重复的路由参数 this.$router.push({ - path:url, - query: { - lang: lang, + name:'AccessMiningPool', + params: { coin: this.activeItemCoin.value, imgUrl: this.activeItemCoin.imgUrl - }, + replace: false // 保留历史记录,允许回退 }); diff --git a/mining-pool/src/main.js b/mining-pool/src/main.js index dac86ca..88d1bd0 100644 --- a/mining-pool/src/main.js +++ b/mining-pool/src/main.js @@ -28,7 +28,7 @@ Vue.use(ElementUI, { }); Vue.prototype.$axios = axios -// console.log = ()=>{} //全局关闭打印 +console.log = ()=>{} //全局关闭打印 // 全局注册混入 Vue.mixin(loadingStateMixin);//loading状态管理 Vue.mixin(networkRecoveryMixin);//网络恢复后数据刷新 diff --git a/mining-pool/src/views/AccessMiningPool/index.js b/mining-pool/src/views/AccessMiningPool/index.js index 0c60bc3..db760fc 100644 --- a/mining-pool/src/views/AccessMiningPool/index.js +++ b/mining-pool/src/views/AccessMiningPool/index.js @@ -283,8 +283,8 @@ export default { this.currentRoutePath =to.path.split(`/`)[3] - this.activeItem = this.currencyList.find(item => { return item.path == this.currentRoutePath }) - this.$addStorageEvent(1, `activeItem`, JSON.stringify( this.activeItem)) + // this.activeItem = this.currencyList.find(item => { return item.path == this.currentRoutePath }) + // this.$addStorageEvent(1, `activeItem`, JSON.stringify( this.activeItem)) @@ -293,94 +293,21 @@ export default { }, mounted() { - - // if (this.$route.name =="AccessMiningPool" ) { - // this.$router.go(-1); - // } - this.fetchAllList(this.listParams) - - console.log(this.$route, "this.$route.query.coin"); - - if (this.$route.query.coin) { - this.activeCoin = this.$route.query.coin - // this.currencyPath = this.$route.query.imgUrl - this.imgUrl = this.$route.query.imgUrl - this.currencyPath = this.$route.query.imgUrl - this.params.coin = this.$route.query.coin - this.$addStorageEvent(1, `activeCoin`, JSON.stringify(this.activeCoin)) - this.activeItem = this.currencyList.find(item => { return item.value == this.params.coin }) - const item = this.navList.find(item => { return item.coin == this.params.coin }) - console.log(item, "item65656565",this.navList,this.$route.query.coin); - - if (item && item.coin) { - this.clickJump(item) - // const mockEvent = { - // stopPropagation: () => {}, - // currentTarget: document.getElementById('menu1') - // }; - // this.changeMenuName(mockEvent, item) - } + // 优先级:路由参数 > localStorage > 默认 + let coinFromRoute = this.$route.params && this.$route.params.coin; + let localActiveCoin = localStorage.getItem('activeCoin') ? JSON.parse(localStorage.getItem('activeCoin')) : null; + let targetCoin = coinFromRoute || localActiveCoin || (this.currencyList[0] && this.currencyList[0].value); + this.activeCoin = targetCoin; + this.activeItem = this.currencyList.find(item => item.value === targetCoin) || this.currencyList[0]; + this.params.coin = targetCoin; + // 如果是路由参数,记忆到localStorage + if (coinFromRoute) { + localStorage.setItem('activeCoin', JSON.stringify(coinFromRoute)); } - - - - let activeCoin = localStorage.getItem("activeCoin") - this.activeCoin = JSON.parse(activeCoin) - let currencyList = localStorage.getItem("currencyList") - this.currencyList = JSON.parse(currencyList) - window.addEventListener("setItem", () => { - let activeCoin = localStorage.getItem("activeCoin") - this.activeCoin = JSON.parse(activeCoin) - let currencyList = localStorage.getItem("currencyList") - this.currencyList = JSON.parse(currencyList) - }); - - - - if (!this.activeCoin) { - this.activeCoin = "nexa" - this.imgUrl = `${this.$baseApi}/img/nexa.png` - this.currencyPath = `${this.$baseApi}/img/nexa.png` - this.params.coin = "nexa" - this.$addStorageEvent(1, `activeCoin`, JSON.stringify(this.activeCoin)) - this.openAPI = true - } else { - - // this.openAPI =true - try { - this.pageTitle = this.currencyList.find(item => item.value == this.activeCoin).name - this.imgUrl = this.currencyList.find(item => item.value == this.activeCoin).imgUrl - } catch (error) { - console.log(error); - - } - - } - // 从本地存储获取activeItem - // const savedActiveItem = localStorage.getItem('activeItem'); - // if (savedActiveItem) { - // try { - // this.activeItem = JSON.parse(savedActiveItem); - // } catch (error) { - // console.error('Parse activeItem failed:', error); - // // 使用默认值 - // this.activeItem = this.currencyList[0]; - // } - // } else { - // // 没有存储值时使用默认值 - // this.activeItem = this.currencyList[0]; - // } - - - - - - - - + this.fetchAllList(this.listParams); }, methods: { async fetchAllList(params){ @@ -444,7 +371,8 @@ export default { }, changeMenuName(e, item) { - + console.log(`走移动端了?`); + if (!e) return; if (!item.path) return; // 添加路径检查 @@ -481,6 +409,7 @@ export default { this.DetailsParams.id = item.id this.DetailsParams.coin = item.coin this.activeCoin = item.coin + localStorage.setItem('activeCoin', JSON.stringify(this.activeCoin)) this.fetchProblemDetails(this.DetailsParams) // if (!item.path) return; // 添加路径检查 // this.activeCoin = item.value diff --git a/mining-pool/src/views/AccessMiningPool/index.vue b/mining-pool/src/views/AccessMiningPool/index.vue index fe2ffb8..41aab38 100644 --- a/mining-pool/src/views/AccessMiningPool/index.vue +++ b/mining-pool/src/views/AccessMiningPool/index.vue @@ -50,10 +50,10 @@