From 618babf5bf7e418554dfb0ed9a2957f0a32ac391 Mon Sep 17 00:00:00 2001 From: ZF sun <34314687@qq.com> Date: Tue, 6 Jan 2026 17:57:48 +0800 Subject: [PATCH] =?UTF-8?q?fix(=E5=A4=9A=E8=AF=AD=E8=A8=80):=20=E5=B0=86?= =?UTF-8?q?=E5=94=AE=E5=90=8E=E5=BE=85=E4=BB=98=E6=AC=BE=E7=BB=84=E4=BB=B6?= =?UTF-8?q?=E7=9A=84=E7=BF=BB=E8=AF=91=E6=94=BE=E5=88=B0zh-cn/common?= =?UTF-8?q?=E6=96=87=E4=BB=B6=E4=B8=AD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .local.config.js | 4 ++++ .local.config.js.example | 4 ++++ common/js/lang.js | 20 +++++++++++++------- lang/zh-cn/common.js | 9 ++++++++- 4 files changed, 29 insertions(+), 8 deletions(-) diff --git a/.local.config.js b/.local.config.js index b733ec7..28cf028 100644 --- a/.local.config.js +++ b/.local.config.js @@ -6,6 +6,10 @@ const localDevConfig = ({ uniacid: 460, domain: 'https://xcx30.5g-quickapp.com/', }, + '576-xcx30.5g': { // 活性石灰装备 + uniacid: 576, + domain: 'https://xcx30.5g-quickapp.com/', + }, '2285': { // 数码喷墨墨水 uniacid: 2285, domain: 'https://xcx.aigc-quickapp.com/', diff --git a/.local.config.js.example b/.local.config.js.example index b733ec7..28cf028 100644 --- a/.local.config.js.example +++ b/.local.config.js.example @@ -6,6 +6,10 @@ const localDevConfig = ({ uniacid: 460, domain: 'https://xcx30.5g-quickapp.com/', }, + '576-xcx30.5g': { // 活性石灰装备 + uniacid: 576, + domain: 'https://xcx30.5g-quickapp.com/', + }, '2285': { // 数码喷墨墨水 uniacid: 2285, domain: 'https://xcx.aigc-quickapp.com/', diff --git a/common/js/lang.js b/common/js/lang.js index bc03c0b..5fec1bf 100644 --- a/common/js/lang.js +++ b/common/js/lang.js @@ -1,8 +1,8 @@ import { langConfig } from './config-external.js'; -var locale = uni.getStorageSync('lang') || "zh-cn"; //设置语言 + // 缓存已加载的语言包 -var loadedLangPacks = {}; +const loadedLangPacks = {}; // 处理页面目录映射 function processRoutePath(route) { @@ -64,6 +64,8 @@ export default { let _this = getCurrentPages()[getCurrentPages().length - 1]; if (!_this) return; + const locale = uni.getStorageSync('lang') || "zh-cn"; //设置语言 + var value = ''; try { //公共语言包(同步加载) @@ -72,7 +74,7 @@ export default { //当前页面语言包(同步加载) let route = _this.route; let langPath = processRoutePath(route); - // console.log(`当前页面语言包路径: ${langPath}`); + console.log(`当前语言: ${locale}, 当前页面语言包路径: ${langPath}`); // 加载当前页面语言包 let currentPageLang = loadLangPackSync(locale, langPath); @@ -113,7 +115,7 @@ export default { if (value == undefined || (value == 'title' && field == 'title')) value = ''; // field // 多语言调试,注释后可以关闭控制台输出 - // console.log(`字段: ${field}, 值: ${value}`) + console.log(`字段: ${field}, 值: ${value}`) return value; }, /** @@ -126,10 +128,14 @@ export default { if (!_this) return; uni.setStorageSync("lang", value); - locale = uni.getStorageSync('lang') || "zh-cn"; //设置语言 + const locale = uni.getStorageSync('lang') || "zh-cn"; //设置语言 // 清空已加载的语言包缓存 - loadedLangPacks = {}; + for (let key in loadedLangPacks) { + if (!key.startsWith(locale)) { + delete loadedLangPacks[key]; + } + } this.refresh(); @@ -141,7 +147,7 @@ export default { refresh() { let _this = getCurrentPages()[getCurrentPages().length - 1]; if (!_this) return; - locale = uni.getStorageSync('lang') || "zh-cn"; //设置语言 + const locale = uni.getStorageSync('lang') || "zh-cn"; //设置语言 this.title(this.lang("title")); diff --git a/lang/zh-cn/common.js b/lang/zh-cn/common.js index c19bb2c..b9edf32 100644 --- a/lang/zh-cn/common.js +++ b/lang/zh-cn/common.js @@ -19,5 +19,12 @@ export const lang = { currencySymbol: '¥', submit: '提交', searchTip: '请输入搜索关键词' - } + }, + + + waitpay: '待付款', + waitsend: '待发货', + waitconfirm: '待收货', + activist: '售后', + completed: '已完成', }