fix(多语言): 将售后待付款组件的翻译放到zh-cn/common文件中

This commit is contained in:
2026-01-06 17:57:48 +08:00
parent 9a63b5ff4e
commit 618babf5bf
4 changed files with 29 additions and 8 deletions

View File

@@ -6,6 +6,10 @@ const localDevConfig = ({
uniacid: 460, uniacid: 460,
domain: 'https://xcx30.5g-quickapp.com/', domain: 'https://xcx30.5g-quickapp.com/',
}, },
'576-xcx30.5g': { // 活性石灰装备
uniacid: 576,
domain: 'https://xcx30.5g-quickapp.com/',
},
'2285': { // 数码喷墨墨水 '2285': { // 数码喷墨墨水
uniacid: 2285, uniacid: 2285,
domain: 'https://xcx.aigc-quickapp.com/', domain: 'https://xcx.aigc-quickapp.com/',

View File

@@ -6,6 +6,10 @@ const localDevConfig = ({
uniacid: 460, uniacid: 460,
domain: 'https://xcx30.5g-quickapp.com/', domain: 'https://xcx30.5g-quickapp.com/',
}, },
'576-xcx30.5g': { // 活性石灰装备
uniacid: 576,
domain: 'https://xcx30.5g-quickapp.com/',
},
'2285': { // 数码喷墨墨水 '2285': { // 数码喷墨墨水
uniacid: 2285, uniacid: 2285,
domain: 'https://xcx.aigc-quickapp.com/', domain: 'https://xcx.aigc-quickapp.com/',

View File

@@ -1,8 +1,8 @@
import { langConfig } from './config-external.js'; import { langConfig } from './config-external.js';
var locale = uni.getStorageSync('lang') || "zh-cn"; //设置语言
// 缓存已加载的语言包 // 缓存已加载的语言包
var loadedLangPacks = {}; const loadedLangPacks = {};
// 处理页面目录映射 // 处理页面目录映射
function processRoutePath(route) { function processRoutePath(route) {
@@ -64,6 +64,8 @@ export default {
let _this = getCurrentPages()[getCurrentPages().length - 1]; let _this = getCurrentPages()[getCurrentPages().length - 1];
if (!_this) return; if (!_this) return;
const locale = uni.getStorageSync('lang') || "zh-cn"; //设置语言
var value = ''; var value = '';
try { try {
//公共语言包(同步加载) //公共语言包(同步加载)
@@ -72,7 +74,7 @@ export default {
//当前页面语言包(同步加载) //当前页面语言包(同步加载)
let route = _this.route; let route = _this.route;
let langPath = processRoutePath(route); let langPath = processRoutePath(route);
// console.log(`当前页面语言包路径: ${langPath}`); console.log(`当前语言: ${locale}, 当前页面语言包路径: ${langPath}`);
// 加载当前页面语言包 // 加载当前页面语言包
let currentPageLang = loadLangPackSync(locale, langPath); let currentPageLang = loadLangPackSync(locale, langPath);
@@ -113,7 +115,7 @@ export default {
if (value == undefined || (value == 'title' && field == 'title')) value = ''; // field if (value == undefined || (value == 'title' && field == 'title')) value = ''; // field
// 多语言调试,注释后可以关闭控制台输出 // 多语言调试,注释后可以关闭控制台输出
// console.log(`字段: ${field}, 值: ${value}`) console.log(`字段: ${field}, 值: ${value}`)
return value; return value;
}, },
/** /**
@@ -126,10 +128,14 @@ export default {
if (!_this) return; if (!_this) return;
uni.setStorageSync("lang", value); 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(); this.refresh();
@@ -141,7 +147,7 @@ export default {
refresh() { refresh() {
let _this = getCurrentPages()[getCurrentPages().length - 1]; let _this = getCurrentPages()[getCurrentPages().length - 1];
if (!_this) return; if (!_this) return;
locale = uni.getStorageSync('lang') || "zh-cn"; //设置语言 const locale = uni.getStorageSync('lang') || "zh-cn"; //设置语言
this.title(this.lang("title")); this.title(this.lang("title"));

View File

@@ -19,5 +19,12 @@ export const lang = {
currencySymbol: '¥', currencySymbol: '¥',
submit: '提交', submit: '提交',
searchTip: '请输入搜索关键词' searchTip: '请输入搜索关键词'
} },
waitpay: '待付款',
waitsend: '待发货',
waitconfirm: '待收货',
activist: '售后',
completed: '已完成',
} }