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:
@@ -10,7 +10,7 @@
|
||||
</view>
|
||||
<view class="search" @click="$util.redirectTo('/pages_tool/goods/search')">
|
||||
<text class="iconfont icon-sousuo3"></text>
|
||||
<text class="tips">{{ $lang('searchPlaceholder') }}</text>
|
||||
<text class="tips">{{ $lang('point.list.searchPlaceholder') }}</text>
|
||||
</view>
|
||||
<view class="sign"
|
||||
:style="{ width: menuButtonBounding.height + 'px', height: menuButtonBounding.height + 'px' }"
|
||||
@@ -28,17 +28,17 @@
|
||||
<view class="account-content">
|
||||
<view class="left">
|
||||
<image :src="$util.img('public/uniapp/point/point-icon.png')" mode="widthFix"></image>
|
||||
<view>{{ $lang('myPoints') }}</view>
|
||||
<view>{{ $lang('point.list.myPoints') }}</view>
|
||||
</view>
|
||||
<view class="right">
|
||||
<text class="point price-font">{{ point }}</text>
|
||||
<text class="text">{{ $lang('points') }}</text>
|
||||
<text class="text">{{ $lang('point.list.points') }}</text>
|
||||
<!-- <text class="iconfont icon-right"></text> -->
|
||||
</view>
|
||||
</view>
|
||||
<view class="remark">
|
||||
<view class="label">{{ $lang('reminder') }}</view>
|
||||
<view class="text">{{ $lang('remarkText') }}</view>
|
||||
<view class="label">{{ $lang('point.list.reminder') }}</view>
|
||||
<view class="text">{{ $lang('point.list.remarkText') }}</view>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
@@ -81,9 +81,9 @@
|
||||
<view class="recharge-list-wrap" @click="redirect('/pages_tool/recharge/list')"
|
||||
v-if="rechargeList.length">
|
||||
<view class="item-wrap" v-for="(item, index) in rechargeList.slice(0, 4)" :key="index">
|
||||
<view class="recharge">{{ $lang('rechargeAmount', { price: parseFloat(item.buy_price) }) }}</view>
|
||||
<view class="point">{{ $lang('earnPoints', { point: item.point }) }}</view>
|
||||
<view class="btn">{{ $lang('goRecharge') }}</view>
|
||||
<view class="recharge">{{ $lang('point.list.rechargeAmount', { price: parseFloat(item.buy_price) }) }}</view>
|
||||
<view class="point">{{ $lang('point.list.earnPoints', { point: item.point }) }}</view>
|
||||
<view class="btn">{{ $lang('point.list.goRecharge') }}</view>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
@@ -91,7 +91,7 @@
|
||||
<view class="point-exchange-wrap exchange-coupon" v-if="couponList.length > 0">
|
||||
<view class="card-category-title">
|
||||
<text class="before-line"></text>
|
||||
<text>{{ $lang('exchangeCoupon') }}</text>
|
||||
<text>{{ $lang('point.list.exchangeCoupon') }}</text>
|
||||
<text class="after-line"></text>
|
||||
</view>
|
||||
|
||||
@@ -115,24 +115,24 @@
|
||||
</block>
|
||||
<block v-if="couponItem.coupon_type == 'discount'">
|
||||
<block v-if="couponItem.coupon_type == 'discount'">
|
||||
{{ parseFloat(couponItem.discount) }}<text>{{ $lang('discountSuffix') }}</text>
|
||||
{{ parseFloat(couponItem.discount) }}<text>{{ $lang('point.list.discountSuffix') }}</text>
|
||||
</block>
|
||||
</block>
|
||||
</view>
|
||||
<view class="coupon-info">
|
||||
<view class="coupon_condition font-size-activity-tag">
|
||||
{{ couponItem.at_least == 0 ? $lang('noThresholdCoupon') : $lang('minSpendAvailable', { amount: parseFloat(couponItem.at_least).toFixed(0) }) }}
|
||||
{{ couponItem.at_least == 0 ? $lang('point.list.noThresholdCoupon') : $lang('point.list.minSpendAvailable', { amount: parseFloat(couponItem.at_least).toFixed(0) }) }}
|
||||
</view>
|
||||
<view class="coupon_type font-size-activity-tag"
|
||||
v-if="couponItem.goods_type == 1">{{ $lang('allStoreCoupon') }}</view>
|
||||
v-if="couponItem.goods_type == 1">{{ $lang('point.list.allStoreCoupon') }}</view>
|
||||
<view class="coupon_type font-size-activity-tag"
|
||||
v-else-if="couponItem.goods_type == 2 || couponItem.goods_type == 3">
|
||||
{{ $lang('designatedCoupon') }}</view>
|
||||
{{ $lang('point.list.designatedCoupon') }}</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="coupon_right">
|
||||
<view class="coupon_num font-size-tag">{{ couponItem.point }}{{ $lang('points') }}</view>
|
||||
<view class="coupon_btn">{{ $lang('exchange') }}</view>
|
||||
<view class="coupon_num font-size-tag">{{ couponItem.point }}{{ $lang('point.list.points') }}</view>
|
||||
<view class="coupon_btn">{{ $lang('point.list.exchange') }}</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
@@ -144,7 +144,7 @@
|
||||
<view class="point-exchange-wrap exchange-hongbao" v-if="hongbaoList.length > 0">
|
||||
<view class="card-category-title">
|
||||
<text class="before-line"></text>
|
||||
<text>{{ $lang('exchangeHongbao') }}</text>
|
||||
<text>{{ $lang('point.list.exchangeHongbao') }}</text>
|
||||
<text class="after-line"></text>
|
||||
</view>
|
||||
|
||||
@@ -165,8 +165,8 @@
|
||||
<!-- <view class="coupon_condition font-size-activity-tag">{{ hongbaoItem.name }}</view> -->
|
||||
</view>
|
||||
<view class="coupon_right">
|
||||
<view class="coupon_num font-size-tag">{{ hongbaoItem.point }}{{ $lang('points') }}</view>
|
||||
<view class="coupon_btn">{{ $lang('exchange') }}</view>
|
||||
<view class="coupon_num font-size-tag">{{ hongbaoItem.point }}{{ $lang('point.list.points') }}</view>
|
||||
<view class="coupon_btn">{{ $lang('point.list.exchange') }}</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
@@ -177,7 +177,7 @@
|
||||
<view class="point-exchange-wrap" v-if="goodsList.length > 0">
|
||||
<view class="card-category-title">
|
||||
<text class="before-line"></text>
|
||||
<text>{{ $lang('exchangeGift') }}</text>
|
||||
<text>{{ $lang('point.list.exchangeGift') }}</text>
|
||||
<text class="after-line"></text>
|
||||
</view>
|
||||
|
||||
@@ -195,7 +195,7 @@
|
||||
<view class="discount-price">
|
||||
<view>
|
||||
<text class="unit price-font point">{{ item.point }}</text>
|
||||
<text class="unit font-size-tag ">{{ $lang('points') }}</text>
|
||||
<text class="unit font-size-tag ">{{ $lang('point.list.points') }}</text>
|
||||
</view>
|
||||
<block v-if="item.price > 0 && item.pay_type > 0">
|
||||
<text class="unit font-size-tag">+</text>
|
||||
@@ -203,17 +203,17 @@
|
||||
<text class="font-size-tag">{{
|
||||
parseFloat(item.price).toFixed(2).split(".")[0] }}</text>
|
||||
<text class="unit font-size-tag">.{{
|
||||
parseFloat(item.price).toFixed(2).split(".")[1] }}{{ $lang('yuan') }}</text>
|
||||
parseFloat(item.price).toFixed(2).split(".")[1] }}{{ $lang('point.list.yuan') }}</text>
|
||||
</view>
|
||||
</block>
|
||||
</view>
|
||||
<view class="btn" @click="toDetail(item)">{{ $lang('exchange') }}</view>
|
||||
<view class="btn" @click="toDetail(item)">{{ $lang('point.list.exchange') }}</view>
|
||||
</view>
|
||||
<view class="pro-info" v-if="item.stock_show || item.sale_show">
|
||||
<view class="font-size-activity-tag color-tip" v-if="item.stock_show">
|
||||
{{ $lang('stock') }}{{ isNaN(parseInt(item.stock)) ? 0 : parseInt(item.stock) }}</view>
|
||||
{{ $lang('point.list.stock') }}{{ isNaN(parseInt(item.stock)) ? 0 : parseInt(item.stock) }}</view>
|
||||
<view class="font-size-activity-tag color-tip sale" v-if="item.sale_show">
|
||||
{{ $lang('exchanged') }}{{ isNaN(parseInt(item.sale_num)) ? 0 : parseInt(item.sale_num) }}
|
||||
{{ $lang('point.list.exchanged') }}{{ isNaN(parseInt(item.sale_num)) ? 0 : parseInt(item.sale_num) }}
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
@@ -230,20 +230,20 @@
|
||||
<uni-popup ref="pointPopup" type="bottom">
|
||||
<view class="tips-layer">
|
||||
<view class="head" @click="closePointPopup()">
|
||||
<view class="title">{{ $lang('pointDescription') }}</view>
|
||||
<view class="title">{{ $lang('point.list.pointDescription') }}</view>
|
||||
<text class="iconfont icon-close"></text>
|
||||
</view>
|
||||
<view class="body">
|
||||
<view class="detail margin-bottom">
|
||||
<view class="tip">{{ $lang('pointAcquisition') }}</view>
|
||||
<view class="font-size-base">{{ $lang('acquisitionItem1') }}</view>
|
||||
<view class="font-size-base">{{ $lang('acquisitionItem2') }}</view>
|
||||
<view class="tip">{{ $lang('pointUsage') }}</view>
|
||||
<view class="font-size-base">{{ $lang('usageItem1') }}</view>
|
||||
<view class="font-size-base">{{ $lang('usageItem2') }}</view>
|
||||
<view class="font-size-base">{{ $lang('usageItem3') }}</view>
|
||||
<view class="tip">{{ $lang('pointQuery') }}</view>
|
||||
<view class="font-size-base">{{ $lang('queryItem1') }}</view>
|
||||
<view class="tip">{{ $lang('point.list.pointAcquisition') }}</view>
|
||||
<view class="font-size-base">{{ $lang('point.list.acquisitionItem1') }}</view>
|
||||
<view class="font-size-base">{{ $lang('point.list.acquisitionItem2') }}</view>
|
||||
<view class="tip">{{ $lang('point.list.pointUsage') }}</view>
|
||||
<view class="font-size-base">{{ $lang('point.list.usageItem1') }}</view>
|
||||
<view class="font-size-base">{{ $lang('point.list.usageItem2') }}</view>
|
||||
<view class="font-size-base">{{ $lang('point.list.usageItem3') }}</view>
|
||||
<view class="tip">{{ $lang('point.list.pointQuery') }}</view>
|
||||
<view class="font-size-base">{{ $lang('point.list.queryItem1') }}</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
@@ -301,7 +301,7 @@ export default {
|
||||
setTimeout(() => {
|
||||
if (!this.addonIsExist.pointexchange) {
|
||||
this.$util.showToast({
|
||||
title: this.$lang('merchantNotEnabled'),
|
||||
title: this.$lang('point.list.merchantNotEnabled'),
|
||||
mask: true,
|
||||
duration: 2000
|
||||
});
|
||||
@@ -580,7 +580,7 @@ export default {
|
||||
}
|
||||
} else {
|
||||
this.$util.showToast({
|
||||
title: this.$lang('noActivity')
|
||||
title: this.$lang('point.list.noActivity')
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user