From d8d6c5631f8c6e499de7af9700fe03cc135ec8ae Mon Sep 17 00:00:00 2001 From: ZF sun <34314687@qq.com> Date: Wed, 24 Dec 2025 14:45:17 +0800 Subject: [PATCH] =?UTF-8?q?feat(lang):=20=E5=AE=9E=E7=8E=B0=E6=B5=AE?= =?UTF-8?q?=E5=8A=A8=E6=8C=89=E9=92=AE=E5=88=87=E6=8D=A2=E8=AF=AD=E8=A8=80?= =?UTF-8?q?=E5=8A=9F=E8=83=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- common/js/lang.js | 16 +- components/hover-nav/hover-nav.vue | 286 +++++++++++++++++++---------- 2 files changed, 197 insertions(+), 105 deletions(-) diff --git a/common/js/lang.js b/common/js/lang.js index 9a4eff7..6203dea 100644 --- a/common/js/lang.js +++ b/common/js/lang.js @@ -58,19 +58,23 @@ export default { if (value == undefined || (value == 'title' && field == 'title')) value = ''; // field return value; }, - //切换语言 - change(value) { + /** + * * 切换语言 + * @param {String} value 语言值 + * @param {String} url 切换后跳转的页面url + */ + change(value, url = '/pages/member/index') { let _this = getCurrentPages()[getCurrentPages().length - 1]; if (!_this) return; uni.setStorageSync("lang", value); locale = uni.getStorageSync('lang') || "zh-cn"; //设置语言 - + this.refresh(); - uni.reLaunch({ - url: '/pages/member/index' - }); + if (url) { + uni.reLaunch({ url: url }); + } }, //刷新标题、tabbar refresh() { diff --git a/components/hover-nav/hover-nav.vue b/components/hover-nav/hover-nav.vue index c4f38c3..5198ede 100644 --- a/components/hover-nav/hover-nav.vue +++ b/components/hover-nav/hover-nav.vue @@ -1,19 +1,29 @@