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:
@@ -5,7 +5,7 @@
|
||||
<view class="search-wrap uni-flex uni-row">
|
||||
<view class="flex-item input-wrap">
|
||||
<input class="uni-input" maxlength="50" v-model="keyword" @confirm="search()"
|
||||
:placeholder="$lang('searchPlaceholder')" />
|
||||
:placeholder="$lang('merch.list.searchPlaceholder')" />
|
||||
<text class="iconfont icon-sousuo3" @click.stop="search()"></text>
|
||||
</view>
|
||||
<view class="iconfont" :class="{ 'icon-apps': isList, 'icon-list': !isList }"
|
||||
@@ -16,15 +16,15 @@
|
||||
<view class="sort-wrap">
|
||||
<view class="comprehensive-wrap" :class="{ 'color-base-text': orderType === '' }"
|
||||
@click="sortTabClick('')">
|
||||
<text :class="{ 'color-base-text': orderType === '' }">{{ $lang('sort.comprehensive') }}</text>
|
||||
<text :class="{ 'color-base-text': orderType === '' }">{{ $lang('merch.list.sort.comprehensive') }}</text>
|
||||
</view>
|
||||
|
||||
<view :class="{ 'color-base-text': orderType === 'sale_num' }" @click="sortTabClick('sale_num')">{{ $lang('sort.sales') }}
|
||||
<view :class="{ 'color-base-text': orderType === 'sale_num' }" @click="sortTabClick('sale_num')">{{ $lang('merch.list.sort.sales') }}
|
||||
</view>
|
||||
|
||||
<view class="price-wrap" @click="sortTabClick('discount_price')">
|
||||
<text
|
||||
:class="{ 'color-base-text': orderType === 'discount_price' }">{{ $lang('sort.price') }}</text>
|
||||
:class="{ 'color-base-text': orderType === 'discount_price' }">{{ $lang('merch.list.sort.price') }}</text>
|
||||
<view class="iconfont-wrap">
|
||||
<view class="iconfont icon-iconangledown-copy asc"
|
||||
:class="{ 'color-base-text': priceOrder === 'asc' && orderType === 'discount_price' }">
|
||||
@@ -36,7 +36,7 @@
|
||||
</view>
|
||||
|
||||
<view :class="{ 'color-base-text': orderType === 'screen' }" class="screen-wrap" @click="sortTabClick('screen')">
|
||||
<text @click="sortTabClick('screen')">{{ $lang('sort.filter') }}</text>
|
||||
<text @click="sortTabClick('screen')">{{ $lang('merch.list.sort.filter') }}</text>
|
||||
<view @click="sortTabClick('screen')" class="iconfont-wrap">
|
||||
<view class="iconfont icon-shaixuan color-tip"></view>
|
||||
</view>
|
||||
@@ -74,7 +74,7 @@
|
||||
parseFloat(showPrice(item)).toFixed(2).split('.')[1] }}</text>
|
||||
</view>
|
||||
<view class="discount-price" v-else>
|
||||
<text class="price price-style large">{{ $lang('goods.consultNow') }}</text>
|
||||
<text class="price price-style large">{{ $lang('merch.list.goods.consultNow') }}</text>
|
||||
</view>
|
||||
</view>
|
||||
<view class="pro-info" v-if="item.isinformation == 0">
|
||||
@@ -83,7 +83,7 @@
|
||||
<text>{{ showMarketPrice(item) }}</text>
|
||||
</view>
|
||||
<view class="block-wrap">
|
||||
<view class="sale color-tip" v-if="item.sale_show">{{ $lang('goods.sold', { num: item.sale_num, unit: item.unit || $lang('goods.defaultUnit') }) }}</view>
|
||||
<view class="sale color-tip" v-if="item.sale_show">{{ $lang('merch.list.goods.sold', { num: item.sale_num, unit: item.unit || $lang('merch.list.goods.defaultUnit') }) }}</view>
|
||||
</view>
|
||||
<view class="cart-action-wrap" v-if="config.control && item.is_virtual == 0">
|
||||
<!-- 购物车图标 -->
|
||||
@@ -157,7 +157,7 @@
|
||||
parseFloat(showPrice(item)).toFixed(2).split('.')[1] }}</text>
|
||||
</view>
|
||||
<view class="discount-price" v-else>
|
||||
<text class="price price-style large">{{ $lang('goods.consultNow') }}</text>
|
||||
<text class="price price-style large">{{ $lang('merch.list.goods.consultNow') }}</text>
|
||||
</view>
|
||||
<view class="member-price-tag"
|
||||
v-if="item.member_price && item.member_price == showPrice(item)">
|
||||
@@ -173,7 +173,7 @@
|
||||
</view>
|
||||
<view class="pro-info" v-if="item.isinformation == 0">
|
||||
<view class="block-wrap">
|
||||
<view class="sale color-tip" v-if="item.sale_show">{{ $lang('goods.sold', { num: item.sale_num, unit: item.unit || $lang('goods.defaultUnit') }) }}</view>
|
||||
<view class="sale color-tip" v-if="item.sale_show">{{ $lang('merch.list.goods.sold', { num: item.sale_num, unit: item.unit || $lang('merch.list.goods.defaultUnit') }) }}</view>
|
||||
</view>
|
||||
<view class="cart-action-wrap" v-if="config.control && item.is_virtual == 0">
|
||||
<!-- 购物车图标 -->
|
||||
@@ -220,7 +220,7 @@
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view v-if="goodsList.length == 0 && emptyShow"><ns-empty :text="$lang('goods.noGoods')"></ns-empty></view>
|
||||
<view v-if="goodsList.length == 0 && emptyShow"><ns-empty :text="$lang('merch.list.goods.noGoods')"></ns-empty></view>
|
||||
</block>
|
||||
</mescroll-uni>
|
||||
|
||||
@@ -228,14 +228,14 @@
|
||||
|
||||
<!-- 筛选弹出框 -->
|
||||
<uni-drawer :visible="showScreen" mode="right" @close="showScreen = false" class="screen-wrap">
|
||||
<view class="title color-tip">{{ $lang('filter.title') }}</view>
|
||||
<view class="title color-tip">{{ $lang('merch.list.filter.title') }}</view>
|
||||
<scroll-view scroll-y>
|
||||
<!-- 分类筛选项 -->
|
||||
<view class="category-list-wrap">
|
||||
<text class="first">{{ $lang('filter.allCategories') }}</text>
|
||||
<text class="first">{{ $lang('merch.list.filter.allCategories') }}</text>
|
||||
<view class="class-box">
|
||||
<view @click="selectedCategory('')" class="list-wrap">
|
||||
<text :class="{ selected: !categoryId, 'color-base-text': !categoryId }">{{ $lang('filter.all') }}</text>
|
||||
<text :class="{ selected: !categoryId, 'color-base-text': !categoryId }">{{ $lang('merch.list.filter.all') }}</text>
|
||||
</view>
|
||||
<view @click="selectedCategory(item.category_id)" v-for="(item, index) in categoryList"
|
||||
:key="index" class="list-wrap">
|
||||
@@ -247,8 +247,8 @@
|
||||
</view>
|
||||
</scroll-view>
|
||||
<view class="footer" :class="{ 'safe-area': isIphoneX }">
|
||||
<button type="default" class="footer-box" @click="resetData">{{ $lang('filter.reset') }}</button>
|
||||
<button type="primary" class="footer-box1" @click="screenData">{{ $lang('filter.confirm') }}</button>
|
||||
<button type="default" class="footer-box" @click="resetData">{{ $lang('merch.list.filter.reset') }}</button>
|
||||
<button type="primary" class="footer-box1" @click="screenData">{{ $lang('merch.list.filter.confirm') }}</button>
|
||||
</view>
|
||||
</uni-drawer>
|
||||
<loading-cover ref="loadingCover"></loading-cover>
|
||||
|
||||
Reference in New Issue
Block a user