feat: add and optimize multilingual text resources

- add new language packs for multiple pages and components including category, cart, order, member center, distribution, etc.
- add Chinese and English translations for new features and UI text
- fix navigation service error message to use multilingual text
- update component templates to use dynamic language translation instead of hardcoded text
- adjust code indentation and formatting for consistency
This commit is contained in:
2026-06-26 13:49:26 +08:00
parent 66a579d48c
commit f7fb9f34f9
116 changed files with 1640 additions and 525 deletions

View File

@@ -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="langstatus ? $lang('Search') : '请输入您要搜索的商品'" />
:placeholder="$lang('Search')" />
<text class="iconfont icon-sousuo3" @click.stop="search()"></text>
</view>
<view class="iconfont" :class="{ 'icon-apps': isList, 'icon-list': !isList }"
@@ -16,16 +16,16 @@
<view class="sort-wrap">
<view class="comprehensive-wrap" :class="{ 'color-base-text': orderType === '' }"
@click="sortTabClick('')">
<text :class="{ 'color-base-text': orderType === '' }">{{ langstatus ? $lang('Random') : '综合' }}</text>
<text :class="{ 'color-base-text': orderType === '' }">{{ $lang('Random') }}</text>
</view>
<view :class="{ 'color-base-text': orderType === 'sale_num' }" @click="sortTabClick('sale_num')">
{{ langstatus ? $lang('Sales') : '销量' }}
{{ $lang('Sales') }}
</view>
<view class="price-wrap" @click="sortTabClick('discount_price')">
<text
:class="{ 'color-base-text': orderType === 'discount_price' }">{{ langstatus ? $lang('Price') : '价格' }}</text>
:class="{ 'color-base-text': orderType === 'discount_price' }">{{ $lang('Price') }}</text>
<view class="iconfont-wrap">
<view class="iconfont icon-iconangledown-copy asc"
:class="{ 'color-base-text': priceOrder === 'asc' && orderType === 'discount_price' }">
@@ -37,7 +37,7 @@
</view>
<view :class="{ 'color-base-text': orderType === 'screen' }" class="screen-wrap">
<text @click="sortTabClick('screen')">{{ langstatus ? $lang('Filter') : '筛选' }}</text>
<text @click="sortTabClick('screen')">{{ $lang('Filter') }}</text>
<view @click="sortTabClick('screen')" class="iconfont-wrap">
<view class="iconfont icon-shaixuan color-tip"></view>
</view>
@@ -78,8 +78,7 @@
</view>
<view class="pro-info" v-if="item.isinformation == 0">
<view class="block-wrap">
<view class="sale" v-if="item.sale_show">已售{{ item.sale_num }}{{ item.unit
? item.unit : '件' }}</view>
<view class="sale" v-if="item.sale_show">{{ $lang('soldCount', { count: item.sale_num, unit: item.unit || $lang('soldUnitDefault') }) }}</view>
</view>
<view class="cart-action-wrap" v-if="config.control && item.is_virtual == 0">
<view class="cart buy-btn click-wrap" :id="'goods-' + item.id"
@@ -126,8 +125,7 @@
</view>
<view class="pro-info" v-if="item.isinformation == 0">
<view class="block-wrap">
<view class="sale" v-if="item.sale_show">已售{{ item.sale_num }}{{ item.unit
? item.unit : '件' }}</view>
<view class="sale" v-if="item.sale_show">{{ $lang('soldCount', { count: item.sale_num, unit: item.unit || $lang('soldUnitDefault') }) }}</view>
</view>
<view class="cart-action-wrap" v-if="config.control && item.is_virtual == 0">
<view class="cart buy-btn click-wrap" :id="'goods-' + item.id"
@@ -145,7 +143,7 @@
</view>
</view>
</view>
<view v-if="goodsList.length == 0 && emptyShow"><ns-empty text="暂无商品"></ns-empty></view>
<view v-if="goodsList.length == 0 && emptyShow"><ns-empty :text="$lang('noProducts')"></ns-empty></view>
</block>
</mescroll-uni>
@@ -153,7 +151,7 @@
<!-- 筛选弹出框 -->
<uni-drawer :visible="showScreen" mode="right" @close="showScreen = false" class="screen-wrap">
<view class="title color-tip">筛选</view>
<view class="title color-tip">{{ $lang('Filter') }}</view>
<scroll-view scroll-y>
<!-- 包邮 -->
<!-- <view class="item-wrap">
@@ -185,10 +183,10 @@
<!-- 分类筛选项 -->
<view class="category-list-wrap">
<text class="first">全部分类</text>
<text class="first">{{ $lang('allCategories') }}</text>
<view class="class-box">
<view @click="selectedCategory('')" class="list-wrap">
<text :class="{ selected: !categoryId, 'color-base-text': !categoryId }">全部</text>
<text :class="{ selected: !categoryId, 'color-base-text': !categoryId }">{{ $lang('all') }}</text>
</view>
<view @click="selectedCategory(item.category_id)" v-for="(item, index) in categoryList"
:key="index" class="list-wrap">
@@ -200,8 +198,8 @@
</view>
</scroll-view>
<view class="footer" :class="{ 'safe-area': isIphoneX }">
<button type="default" class="footer-box" @click="resetData">重置</button>
<button type="primary" class="footer-box1" @click="screenData">确定</button>
<button type="default" class="footer-box" @click="resetData">{{ $lang('reset') }}</button>
<button type="primary" class="footer-box1" @click="screenData">{{ $lang('confirm') }}</button>
</view>
</uni-drawer>
<loading-cover ref="loadingCover"></loading-cover>