refactor: 统一项目内国际化key的命名空间格式

本次提交对全项目的国际化调用进行了规范化重构:
1. 为中文/英文语言包新增了avatar和gender的别名映射,兼容旧有headImg/sex写法
2. 修正了lang.js中的注释路径错误
3. 将所有页面和组件内的$lang调用从短路径改为带业务模块前缀的完整命名空间路径,例如将$lang('title')改为$lang('article.list.title')
4. 优化了i18n-lazy.js的注释说明,补充了正确的key命名格式示例
5. 统一了分销、订单、会员等模块的国际化key层级,确保所有语言调用路径一致
This commit is contained in:
2026-07-04 09:24:35 +08:00
parent 92e8823566
commit 783c10fc62
98 changed files with 1543 additions and 1530 deletions

View File

@@ -17,15 +17,15 @@
</view>
<view class="level-rate">
<view class="rate-item" v-if="config.level > 0">
<view class="title">{{ $lang('firstLevelCommissionRate') }}</view>
<view class="title">{{ $lang('fenxiao.level.firstLevelCommissionRate') }}</view>
<view class="rate">{{ item.one_rate }}<text class="percentage">%</text></view>
</view>
<view class="rate-item" v-if="config.level > 1">
<view class="title">{{ $lang('secondLevelCommissionRate') }}</view>
<view class="title">{{ $lang('fenxiao.level.secondLevelCommissionRate') }}</view>
<view class="rate">{{ item.two_rate }}<text class="percentage">%</text></view>
</view>
<view class="rate-item" v-if="config.level > 2">
<view class="title">{{ $lang('thirdLevelCommissionRate') }}</view>
<view class="title">{{ $lang('fenxiao.level.thirdLevelCommissionRate') }}</view>
<view class="rate">{{ item.three_rate }}<text class="percentage">%</text></view>
</view>
</view>
@@ -40,7 +40,7 @@
<view class="level-condition" v-if="levelInfo">
<view class="condition-title">
<view class="title">{{ $lang('quickUpgradeTips') }}</view>
<view class="title">{{ $lang('fenxiao.level.quickUpgradeTips') }}</view>
<view class="rate price-font">
<text class="complete">{{ levelInfo.complete > levelInfo.task_num ? levelInfo.task_num : levelInfo.complete }}</text>
<text class="num">/{{ levelInfo.task_num }}</text>
@@ -54,7 +54,7 @@
<text class="iconfont icon-wenxiao" @click="openTips(item)"></text>
</view>
<view class="status" :class="{'complete': item.progress == 100}">
{{ item.progress == 100 ? $lang('completed') : $lang('incomplete') }}</view>
{{ item.progress == 100 ? $lang('completed') : $lang('fenxiao.level.incomplete') }}</view>
</view>
<view class="progress">
<progress :percent="item.progress" activeColor="#E7B667" stroke-width="4" />
@@ -73,12 +73,12 @@
<uni-popup type="bottom" ref="tips">
<view class="popup">
<view class="popup-header">
<text class="tit">{{ $lang('tip') }}</text>
<text class="tit">{{ $lang('fenxiao.level.tip') }}</text>
<text class="iconfont icon-close" @click="$refs.tips.close()"></text>
</view>
<view class="popup-body">
<view>{{ tips }}</view>
<view v-if="levelInfo">{{ levelInfo.upgrade_type == 1 ? $lang('anyConditionUpgrade') : $lang('allConditionsUpgrade') }}</view>
<view v-if="levelInfo">{{ levelInfo.upgrade_type == 1 ? $lang('fenxiao.level.anyConditionUpgrade') : $lang('fenxiao.level.allConditionsUpgrade') }}</view>
</view>
</view>
</uni-popup>
@@ -114,9 +114,9 @@
if (level.one_fenxiao_order_num > 0) {
let task = {
title: this.$lang('subordinateConsumption'),
desc: this.$lang('subordinateOrderCount', { count: level.one_fenxiao_order_num }),
tips: this.$lang('subordinateOrderCountTip', { count: level.one_fenxiao_order_num }),
title: this.$lang('fenxiao.level.subordinateConsumption'),
desc: this.$lang('fenxiao.level.subordinateOrderCount', { count: level.one_fenxiao_order_num }),
tips: this.$lang('fenxiao.level.subordinateOrderCountTip', { count: level.one_fenxiao_order_num }),
condition: level.one_fenxiao_order_num,
value: this.fenxiaoInfo.one_fenxiao_order_num,
progress: parseFloat(this.fenxiaoInfo.one_fenxiao_order_num) > parseFloat(level.one_fenxiao_order_num) ? 100 : (parseFloat(this.fenxiaoInfo.one_fenxiao_order_num) / parseFloat(level.one_fenxiao_order_num) * 100).toFixed(2)
@@ -126,9 +126,9 @@
}
if (level.one_fenxiao_total_order > 0) {
let task = {
title: this.$lang('subordinateConsumption'),
desc: this.$lang('subordinateOrderAmount', { amount: this.moneyFormat(level.one_fenxiao_total_order) }),
tips: this.$lang('subordinateOrderAmountTip', { amount: this.moneyFormat(level.one_fenxiao_total_order) }),
title: this.$lang('fenxiao.level.subordinateConsumption'),
desc: this.$lang('fenxiao.level.subordinateOrderAmount', { amount: this.moneyFormat(level.one_fenxiao_total_order) }),
tips: this.$lang('fenxiao.level.subordinateOrderAmountTip', { amount: this.moneyFormat(level.one_fenxiao_total_order) }),
condition: this.moneyFormat(level.one_fenxiao_total_order),
value: this.fenxiaoInfo.one_fenxiao_total_order,
progress: parseFloat(this.fenxiaoInfo.one_fenxiao_total_order) > parseFloat(level.one_fenxiao_total_order) ? 100 : (parseFloat(this.fenxiaoInfo.one_fenxiao_total_order) / parseFloat(level.one_fenxiao_total_order) * 100)
@@ -139,9 +139,9 @@
}
if (level.one_fenxiao_order_money > 0) {
let task = {
title: this.$lang('subordinateConsumption'),
desc: this.$lang('subordinateCommissionAmount', { amount: this.moneyFormat(level.one_fenxiao_order_money) }),
tips: this.$lang('subordinateCommissionAmountTip', { amount: this.moneyFormat(level.one_fenxiao_order_money) }),
title: this.$lang('fenxiao.level.subordinateConsumption'),
desc: this.$lang('fenxiao.level.subordinateCommissionAmount', { amount: this.moneyFormat(level.one_fenxiao_order_money) }),
tips: this.$lang('fenxiao.level.subordinateCommissionAmountTip', { amount: this.moneyFormat(level.one_fenxiao_order_money) }),
condition: this.moneyFormat(level.one_fenxiao_order_money),
value: this.fenxiaoInfo.one_fenxiao_order_money,
progress: parseFloat(this.fenxiaoInfo.one_fenxiao_order_money) > parseFloat(level.one_fenxiao_order_money) ? 100 : (parseFloat(this.fenxiaoInfo.one_fenxiao_order_money) / parseFloat(level.one_fenxiao_order_money) * 100)
@@ -152,9 +152,9 @@
}
if (level.order_num > 0) {
let task = {
title: this.$lang('selfConsumption'),
desc: this.$lang('selfOrderCount', { count: level.order_num }),
tips: this.$lang('selfOrderCountTip', { count: level.order_num }),
title: this.$lang('fenxiao.level.selfConsumption'),
desc: this.$lang('fenxiao.level.selfOrderCount', { count: level.order_num }),
tips: this.$lang('fenxiao.level.selfOrderCountTip', { count: level.order_num }),
condition: level.order_num,
value: this.fenxiaoInfo.order_num,
progress: parseFloat(this.fenxiaoInfo.order_num) > parseFloat(level.order_num) ? 100 : (parseFloat(this.fenxiaoInfo.order_num) / parseFloat(level.order_num) * 100).toFixed(2)
@@ -164,9 +164,9 @@
}
if (level.order_money > 0) {
let task = {
title: this.$lang('selfConsumption'),
desc: this.$lang('selfOrderAmount', { amount: this.moneyFormat(level.order_money) }),
tips: this.$lang('selfOrderAmountTip', { amount: this.moneyFormat(level.order_money) }),
title: this.$lang('fenxiao.level.selfConsumption'),
desc: this.$lang('fenxiao.level.selfOrderAmount', { amount: this.moneyFormat(level.order_money) }),
tips: this.$lang('fenxiao.level.selfOrderAmountTip', { amount: this.moneyFormat(level.order_money) }),
condition: this.moneyFormat(level.order_money),
value: this.fenxiaoInfo.order_money,
progress: parseFloat(this.fenxiaoInfo.order_money) > parseFloat(level.order_money) ? 100 : (parseFloat(this.fenxiaoInfo.order_money) / parseFloat(level.order_money) * 100).toFixed(2)
@@ -176,9 +176,9 @@
}
if (level.one_child_num > 0) {
let task = {
title: this.$lang('inviteFriends'),
desc: this.$lang('inviteFriendCount', { count: level.one_child_num }),
tips: this.$lang('inviteFriendCountTip', { count: level.one_child_num }),
title: this.$lang('fenxiao.level.inviteFriends'),
desc: this.$lang('fenxiao.level.inviteFriendCount', { count: level.one_child_num }),
tips: this.$lang('fenxiao.level.inviteFriendCountTip', { count: level.one_child_num }),
condition: level.one_child_num,
value: this.fenxiaoInfo.one_child_num,
progress: parseFloat(this.fenxiaoInfo.one_child_num) > parseFloat(level.one_child_num) ? 100 : (parseFloat(this.fenxiaoInfo.one_child_num) / parseFloat(level.one_child_num) * 100).toFixed(2)
@@ -188,9 +188,9 @@
}
if (level.one_child_fenxiao_num > 0) {
let task = {
title: this.$lang('inviteFriends'),
desc: this.$lang('inviteFenxiaoCount', { count: level.one_child_fenxiao_num }),
tips: this.$lang('inviteFenxiaoCountTip', { count: level.one_child_fenxiao_num }),
title: this.$lang('fenxiao.level.inviteFriends'),
desc: this.$lang('fenxiao.level.inviteFenxiaoCount', { count: level.one_child_fenxiao_num }),
tips: this.$lang('fenxiao.level.inviteFenxiaoCountTip', { count: level.one_child_fenxiao_num }),
condition: level.one_child_fenxiao_num,
value: this.fenxiaoInfo.one_child_fenxiao_num,
progress: parseFloat(this.fenxiaoInfo.one_child_fenxiao_num) > parseFloat(level.one_child_fenxiao_num) ? 100 : (parseFloat(this.fenxiaoInfo.one_child_fenxiao_num) / parseFloat(level.one_child_fenxiao_num) * 100).toFixed(2)
@@ -208,7 +208,7 @@
setTimeout( () => {
if (!this.addonIsExist.fenxiao) {
this.$util.showToast({
title: this.$lang('merchantNotOpenFenxiao'),
title: this.$lang('fenxiao.level.merchantNotOpenFenxiao'),
mask: true,
duration: 2000
});
@@ -218,7 +218,7 @@
}
},1000);
if (this.fenxiaoWords && this.fenxiaoWords.fenxiao_name) this.$langConfig.title(this.fenxiaoWords.fenxiao_name + this.$lang('levelSuffix'));
if (this.fenxiaoWords && this.fenxiaoWords.fenxiao_name) this.$langConfig.title(this.fenxiaoWords.fenxiao_name + this.$lang('fenxiao.level.levelSuffix'));
if (this.storeToken) {
this.getFenxiaoInfo();