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:
@@ -13,7 +13,7 @@
|
||||
<view class="image" :class="fenXiaoAgreement.agreement.img ? '' : 'color-base-bg'">
|
||||
<image v-if="fenXiaoAgreement.agreement.img" class="apply-adv" :src="$util.img(fenXiaoAgreement.agreement.img)" mode="widthFix" style="width: 100%;" show-menu-by-longpress/>
|
||||
<view class="bg ns-gradient-otherpages-fenxiao-apply-apply-bg" v-else>
|
||||
<view class="bg-title"><text>{{ $lang('pleaseFillApplyInfo') }}</text></view>
|
||||
<view class="bg-title"><text>{{ $lang('fenxiao.apply.pleaseFillApplyInfo') }}</text></view>
|
||||
<view class="bg-img">
|
||||
<image :src="$util.img('public/uniapp/fenxiao/apply/edit.png')" mode="scaleToFill" show-menu-by-longpress></image>
|
||||
</view>
|
||||
@@ -24,44 +24,44 @@
|
||||
<view class="app-info">
|
||||
<view class="info">
|
||||
<view class="apply-item">
|
||||
<view class="title">{{ $lang('inviter') }}</view>
|
||||
<text class="shuru">{{ sourceMemberInfo.fenxiao_name || $lang('none') }}</text>
|
||||
<view class="title">{{ $lang('fenxiao.apply.inviter') }}</view>
|
||||
<text class="shuru">{{ sourceMemberInfo.fenxiao_name || $lang('fenxiao.apply.none') }}</text>
|
||||
</view>
|
||||
<view class="apply-item">
|
||||
<view class="title">{{ fenxiaoWords.fenxiao_name }}{{ $lang('nameLabel') }}</view>
|
||||
<input class="input" type="text" maxlength="30" :placeholder="$lang('namePlaceholder', { name: fenxiaoWords.fenxiao_name })" v-model="formData.fenXiaoName" placeholder-class="pla-cla" />
|
||||
<view class="title">{{ fenxiaoWords.fenxiao_name }}{{ $lang('fenxiao.apply.nameLabel') }}</view>
|
||||
<input class="input" type="text" maxlength="30" :placeholder="$lang('fenxiao.apply.namePlaceholder', { name: fenxiaoWords.fenxiao_name })" v-model="formData.fenXiaoName" placeholder-class="pla-cla" />
|
||||
</view>
|
||||
<view class="apply-item">
|
||||
<view class="title">{{ $lang('mobile') }}</view>
|
||||
<input class="input" type="number" :placeholder="$lang('mobilePlaceholder')" maxlength="11" v-model="formData.mobile" placeholder-class="pla-cla" />
|
||||
<view class="title">{{ $lang('fenxiao.apply.mobile') }}</view>
|
||||
<input class="input" type="number" :placeholder="$lang('fenxiao.apply.mobilePlaceholder')" maxlength="11" v-model="formData.mobile" placeholder-class="pla-cla" />
|
||||
</view>
|
||||
<view class="apply-xy" v-if="isAgreement" @click="ckeckedRuler()">
|
||||
<view class="iconfont" :class="isChecked ? 'icon-yuan_checked color-base-text' : 'icon-yuan_checkbox'">
|
||||
</view>
|
||||
{{ $lang('haveReadAndUnderstand') }}
|
||||
<text class="color-base-text" @click.stop="openPopup">{{ $lang('applyAgreement', { name: fenxiaoWords.fenxiao_name }) }}</text>
|
||||
{{ $lang('fenxiao.apply.haveReadAndUnderstand') }}
|
||||
<text class="color-base-text" @click.stop="openPopup">{{ $lang('fenxiao.apply.applyAgreement', { name: fenxiaoWords.fenxiao_name }) }}</text>
|
||||
</view>
|
||||
<view class="apply-btn">
|
||||
<button @click="applyFenXiao" class="color-base-bg">{{ $lang('applyBecome', { name: fenxiaoWords.fenxiao_name }) }}</button>
|
||||
<button @click="applyFenXiao" class="color-base-bg">{{ $lang('fenxiao.apply.applyBecome', { name: fenxiaoWords.fenxiao_name }) }}</button>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<view class="apply-message-wrap" v-if="fenxiaoConfig.fenxiao_condition == 2 || fenxiaoConfig.fenxiao_condition == 3">
|
||||
<view class="apply-message">
|
||||
<view class="apply-message-title color-base-bg-before">{{ $lang('applyConditionTitle') }}</view>
|
||||
<view class="apply-message-title color-base-bg-before">{{ $lang('fenxiao.apply.applyConditionTitle') }}</view>
|
||||
<text class="apply-message-info font-size-goods-tag" v-if="fenxiaoConfig.fenxiao_condition == 2">
|
||||
{{ $lang('conditionConsumeCount', { name: fenxiaoWords.fenxiao_name, count: fenxiaoConfig.consume_count }) }}
|
||||
{{ $lang('fenxiao.apply.conditionConsumeCount', { name: fenxiaoWords.fenxiao_name, count: fenxiaoConfig.consume_count }) }}
|
||||
</text>
|
||||
<text class="apply-message-info font-size-goods-tag" v-if="fenxiaoConfig.fenxiao_condition == 3">
|
||||
{{ $lang('conditionConsumeMoney', { name: fenxiaoWords.fenxiao_name, money: fenxiaoConfig.consume_money }) }}
|
||||
{{ $lang('fenxiao.apply.conditionConsumeMoney', { name: fenxiaoWords.fenxiao_name, money: fenxiaoConfig.consume_money }) }}
|
||||
</text>
|
||||
</view>
|
||||
</view>
|
||||
<view class="app-info-list" v-if="fenxiaoConfig.fenxiao_condition == 4">
|
||||
<view class="apply-message">
|
||||
<view class="apply-message-title color-base-bg-before">{{ $lang('applyConditionTitle') }}</view>
|
||||
<text class="apply-message-info font-size-goods-tag">{{ $lang('conditionBuyGoods', { name: fenxiaoWords.fenxiao_name }) }}</text>
|
||||
<view class="apply-message-title color-base-bg-before">{{ $lang('fenxiao.apply.applyConditionTitle') }}</view>
|
||||
<text class="apply-message-info font-size-goods-tag">{{ $lang('fenxiao.apply.conditionBuyGoods', { name: fenxiaoWords.fenxiao_name }) }}</text>
|
||||
</view>
|
||||
<view class="goods-list" v-for="(item, index) in goodsList" :key="index" @click="toDetail(item)">
|
||||
<view class="goods-img">
|
||||
@@ -79,7 +79,7 @@
|
||||
</view>
|
||||
</view>
|
||||
<view class="content-lists" v-if="isShow" @click="onOpen()">
|
||||
{{ isOpen ? $lang('expandMore') : $lang('collapse') }}
|
||||
{{ isOpen ? $lang('fenxiao.apply.expandMore') : $lang('fenxiao.apply.collapse') }}
|
||||
<text class="iconfont icon-unfold" style="font-weight: bold;" v-if="isOpen"></text>
|
||||
<text class="iconfont icon-fold" v-else></text>
|
||||
</view>
|
||||
@@ -89,16 +89,16 @@
|
||||
<view class="empty" v-else-if="basicsConfig.is_apply == 0" style="margin-top:40rpx;">
|
||||
<block v-if="fenxiaoConfig.fenxiao_condition == 2 || fenxiaoConfig.fenxiao_condition == 3">
|
||||
<image :src="$util.img('public/uniapp/fenxiao/index/no-fenxiao.png')" mode="widthFix" show-menu-by-longpress></image>
|
||||
<text v-if="fenxiaoConfig.fenxiao_condition == 2">{{ $lang('conditionConsumeCount', { name: fenxiaoWords.fenxiao_name, count: fenxiaoConfig.consume_count }) }}</text>
|
||||
<text v-if="fenxiaoConfig.fenxiao_condition == 2">{{ $lang('fenxiao.apply.conditionConsumeCount', { name: fenxiaoWords.fenxiao_name, count: fenxiaoConfig.consume_count }) }}</text>
|
||||
<text v-if="fenxiaoConfig.fenxiao_condition == 3">
|
||||
{{ $lang('conditionConsumeMoney', { name: fenxiaoWords.fenxiao_name, money: fenxiaoConfig.consume_money | moneyFormat }) }}
|
||||
{{ $lang('fenxiao.apply.conditionConsumeMoney', { name: fenxiaoWords.fenxiao_name, money: fenxiaoConfig.consume_money | moneyFormat }) }}
|
||||
</text>
|
||||
</block>
|
||||
<view class="apply-wrap" v-if="fenxiaoConfig.fenxiao_condition == 4">
|
||||
<view class="app-info-list">
|
||||
<view class="apply-message">
|
||||
<view class="apply-message-title color-base-bg-before">{{ $lang('becomeConditionTitle') }}</view>
|
||||
<text class="apply-message-info font-size-goods-tag">{{ $lang('becomeConditionBuyGoods', { name: fenxiaoWords.fenxiao_name }) }}</text>
|
||||
<view class="apply-message-title color-base-bg-before">{{ $lang('fenxiao.apply.becomeConditionTitle') }}</view>
|
||||
<text class="apply-message-info font-size-goods-tag">{{ $lang('fenxiao.apply.becomeConditionBuyGoods', { name: fenxiaoWords.fenxiao_name }) }}</text>
|
||||
</view>
|
||||
<view class="goods-list" v-for="(item, index) in goodsList" :key="index" @click="toDetail(item)">
|
||||
<view class="goods-img">
|
||||
@@ -114,7 +114,7 @@
|
||||
</view>
|
||||
</view>
|
||||
<view class="content-lists" v-if="isShow" @click="onOpen()">
|
||||
{{ isOpen ? $lang('expandMore') : $lang('collapse') }}
|
||||
{{ isOpen ? $lang('fenxiao.apply.expandMore') : $lang('fenxiao.apply.collapse') }}
|
||||
<text class="iconfont icon-unfold" style="font-weight: bold;" v-if="isOpen"></text>
|
||||
<text class="iconfont icon-fold" v-else></text>
|
||||
</view>
|
||||
@@ -123,15 +123,15 @@
|
||||
</view>
|
||||
<view class="empty" v-else>
|
||||
<image :src="$util.img('public/uniapp/fenxiao/index/no-fenxiao.png')" mode="widthFix" show-menu-by-longpress></image>
|
||||
<text>{{ $lang('notFenxiao') }}</text>
|
||||
<text>{{ $lang('fenxiao.apply.notFenxiao') }}</text>
|
||||
</view>
|
||||
</view>
|
||||
<view class="empty" v-else>
|
||||
<image :src="$util.img('public/uniapp/fenxiao/index/no-fenxiao.png')" mode="widthFix" show-menu-by-longpress></image>
|
||||
<text v-if="status == 1">{{ $lang('applyPending', { name: fenxiaoWords.fenxiao_name }) }}</text>
|
||||
<text v-if="status == 1">{{ $lang('fenxiao.apply.applyPending', { name: fenxiaoWords.fenxiao_name }) }}</text>
|
||||
<block v-else-if="status == -1">
|
||||
<text>{{ $lang('applyRejected', { name: fenxiaoWords.fenxiao_name }) }}</text>
|
||||
<view class="again-btn color-base-bg" @click="againApply">{{ $lang('reapply') }}</view>
|
||||
<text>{{ $lang('fenxiao.apply.applyRejected', { name: fenxiaoWords.fenxiao_name }) }}</text>
|
||||
<view class="again-btn color-base-bg" @click="againApply">{{ $lang('fenxiao.apply.reapply') }}</view>
|
||||
</block>
|
||||
</view>
|
||||
<view @touchmove.prevent v-if="fenXiaoAgreement.document">
|
||||
@@ -162,8 +162,8 @@
|
||||
isShow: true,
|
||||
isIphoneX: false,
|
||||
// 推荐人信息
|
||||
sourceMemberInfo: {
|
||||
fenxiao_name: ''
|
||||
sourceMemberInfo: {
|
||||
fenxiao_name: ''
|
||||
},
|
||||
formData: {
|
||||
fenXiaoName: '',
|
||||
@@ -191,7 +191,7 @@
|
||||
setTimeout( () => {
|
||||
if (!this.addonIsExist.fenxiao) {
|
||||
this.$util.showToast({
|
||||
title: this.$lang('merchantNotOpenFenxiao'),
|
||||
title: this.$lang('fenxiao.apply.merchantNotOpenFenxiao'),
|
||||
mask: true,
|
||||
duration: 2000
|
||||
});
|
||||
@@ -207,7 +207,7 @@
|
||||
async onShow() {
|
||||
this.isIphoneX = this.$util.uniappIsIPhoneX();
|
||||
|
||||
if (this.fenxiaoWords && this.fenxiaoWords.fenxiao_name) this.$langConfig.title(this.fenxiaoWords.fenxiao_name + this.$lang('applySuffix'));
|
||||
if (this.fenxiaoWords && this.fenxiaoWords.fenxiao_name) this.$langConfig.title(this.fenxiaoWords.fenxiao_name + this.$lang('fenxiao.apply.applySuffix'));
|
||||
|
||||
if (this.storeToken) {
|
||||
this.applyStatus();
|
||||
@@ -275,7 +275,7 @@
|
||||
if (!this.fenXiaoValidata()) return;
|
||||
if (this.isAgreement && !this.isChecked) {
|
||||
this.$util.showToast({
|
||||
title: this.$lang('pleaseReadAndCheckAgreement')
|
||||
title: this.$lang('fenxiao.apply.pleaseReadAndCheckAgreement')
|
||||
});
|
||||
return;
|
||||
}
|
||||
@@ -326,22 +326,22 @@
|
||||
closePopup() {
|
||||
this.$refs.applyPopup.close();
|
||||
},
|
||||
fenXiaoValidata() {
|
||||
let rule = [{
|
||||
name: 'fenXiaoName',
|
||||
checkType: 'required',
|
||||
errorMsg: this.$lang('pleaseEnterName', { name: this.fenxiaoWords.fenxiao_name })
|
||||
},
|
||||
{
|
||||
name: 'mobile',
|
||||
checkType: 'required',
|
||||
errorMsg: this.$lang('pleaseEnterMobile')
|
||||
},
|
||||
{
|
||||
name: 'mobile',
|
||||
checkType: 'phoneno',
|
||||
errorMsg: this.$lang('pleaseEnterValidMobile')
|
||||
}
|
||||
fenXiaoValidata() {
|
||||
let rule = [{
|
||||
name: 'fenXiaoName',
|
||||
checkType: 'required',
|
||||
errorMsg: this.$lang('fenxiao.apply.pleaseEnterName', { name: this.fenxiaoWords.fenxiao_name })
|
||||
},
|
||||
{
|
||||
name: 'mobile',
|
||||
checkType: 'required',
|
||||
errorMsg: this.$lang('fenxiao.apply.pleaseEnterMobile')
|
||||
},
|
||||
{
|
||||
name: 'mobile',
|
||||
checkType: 'phoneno',
|
||||
errorMsg: this.$lang('fenxiao.apply.pleaseEnterValidMobile')
|
||||
}
|
||||
];
|
||||
var checkRes = validate.check(this.formData, rule);
|
||||
if (checkRes) {
|
||||
|
||||
Reference in New Issue
Block a user