chore(多语言): 部分语言暂时使用 isEnEnv 计算属性来判断

This commit is contained in:
2025-12-26 18:11:15 +08:00
parent 31623e6667
commit 332350cfab
3 changed files with 25 additions and 25 deletions

View File

@@ -79,7 +79,7 @@
<text class="unit price-style small">.{{ parseFloat(showPrice(item)).toFixed(2).split('.')[1] }}</text>
</view>
<view class="discount-price" v-else>
<text class="price price-style large">咨询</text>
<text class="price price-style large">{{ $lang('Make') ? $lang('Make') : '咨询' }}</text>
</view>
@@ -164,7 +164,7 @@
<text class="unit price-style small">.{{ parseFloat(showPrice(item)).toFixed(2).split('.')[1] }}</text>
</view>
<view class="discount-price" v-else>
<text class="price price-style large">咨询</text>
<text class="price price-style large">{{ $lang('Make') ? $lang('Make') : '咨询' }}</text>
</view>
<view class="member-price-tag" v-if="item.member_price && item.member_price == showPrice(item)">
<image :src="$util.img('public/uniapp/index/VIP.png')" mode="widthFix"></image>

View File

@@ -5,7 +5,7 @@
<!-- 搜索区域 -->
<view class="search-wrap uni-flex uni-row">
<view class="flex-item input-wrap" @click.stop="search()" @tap.stop="search()">
<input class="uni-input" maxlength="50" v-model="keyword" confirm-type="search" @confirm="search()" @click.stop="search()" @tap.stop="search()" placeholder="请输入商品关键词" />
<input class="uni-input" maxlength="50" v-model="keyword" confirm-type="search" @confirm="search()" @click.stop="search()" @tap.stop="search()" :placeholder="isEnEnv ? 'Please enter product keywords' : '请输入商品关键词'" />
<text class="iconfont icon-sousuo3" @click.stop="search()" @tap.stop="search()"></text>
</view>
</view>
@@ -13,24 +13,24 @@
<!-- 排序 -->
<view class="sort-wrap">
<view class="comprehensive-wrap" :class="{ 'color-base-text': order === '' }" @click="sortTabClick('')">
<text :class="{ 'color-base-text': order === '' }">综合</text>
<text :class="{ 'color-base-text': order === '' }">{{ isEnEnv ? 'Comprehensive' : '综合' }}</text>
</view>
<view class="price-wrap" @click="sortTabClick('point')">
<text :class="{ 'color-base-text': order === 'point' }">积分</text>
<text :class="{ 'color-base-text': order === 'point' }">{{ isEnEnv ? 'Points' : '积分' }}</text>
<view class="iconfont-wrap">
<view class="iconfont icon-shangsanjiao-copy" :class="{ 'color-base-text': priceOrder === 'asc' && order === 'point' }"></view>
<view class="iconfont icon-sanjiao" :class="{ 'color-base-text': priceOrder === 'desc' && order === 'point' }"></view>
</view>
</view>
<view class="price-wrap" @click="sortTabClick('create_time')">
<text :class="{ 'color-base-text': order === 'create_time' }">上新时间</text>
<text :class="{ 'color-base-text': order === 'create_time' }">{{ isEnEnv ? 'New Arrival' : '上新时间' }}</text>
<view class="iconfont-wrap">
<view class="iconfont icon-shangsanjiao-copy" :class="{ 'color-base-text': priceOrder === 'asc' && order === 'create_time' }"></view>
<view class="iconfont icon-sanjiao" :class="{ 'color-base-text': priceOrder === 'desc' && order === 'create_time' }"></view>
</view>
</view>
<view :class="{ 'color-base-text': order === 'screen' }" class="screen-wrap">
<text @click="sortTabClick('screen')">筛选</text>
<text @click="sortTabClick('screen')">{{ isEnEnv ? 'Filter' : '筛选' }}</text>
<view @click="sortTabClick('screen')" class="iconfont-wrap">
<view class="iconfont icon-shaixuan color-tip"></view>
</view>
@@ -48,12 +48,12 @@
</view>
<view class="info-wrap">
<view class="name-wrap">
<view class="goods-name" @click="toDetail(item)">{{ item.name }}</view>
<view class="goods-name" @click="toDetail(item)">{{ isEnEnv ? item.en_goods_name : item.goods_name }}</view>
</view>
<view class="lineheight-clear">
<view class="discount-price">
<text class="unit ">{{ item.point }}</text>
<text class="unit font-size-tag">积分</text>
<text class="unit font-size-tag">{{ isEnEnv ? 'Points' : '积分' }}</text>
<block v-if="item.price > 0 && item.pay_type > 0">
<text class="unit font-size-tag">+</text>
<text class="unit font-size-tag">{{ $lang('common.currencySymbol') }}</text>
@@ -63,7 +63,7 @@
</view>
</view>
<view class="pro-info" v-if="item.stock_show">
<view class="font-size-activity-tag color-tip">库存{{ item.stock }}</view>
<view class="font-size-activity-tag color-tip">{{ isEnEnv ? 'Stock ' : '库存' }}{{ item.stock }}</view>
<view class="sale font-size-activity-tag color-tip" @click="toDetail(item)">
<!-- <button type="primary" size="mini">立即兑换</button> -->
</view>
@@ -72,7 +72,7 @@
</view>
</view>
<view class="empty" v-if="goodsList.length == 0">
<ns-empty :isIndex="false" text="暂无积分商品"></ns-empty>
<ns-empty :isIndex="false" :text="isEnEnv ? 'No point products available' : '暂无积分商品'"></ns-empty>
</view>
</view>
</block>
@@ -80,22 +80,22 @@
<!-- 筛选弹出框 -->
<uni-drawer :visible="showScreen" mode="right" @close="showScreen = false" class="screen-wrap">
<view class="title color-tip">筛选</view>
<view class="title color-tip">{{ isEnEnv ? 'Filter' : '筛选' }}</view>
<scroll-view scroll-y>
<!-- 价格筛选项 -->
<view class="item-wrap">
<view class="label"><text>积分区间</text></view>
<view class="label"><text>{{ isEnEnv ? 'Point Range' : '积分区间' }}</text></view>
<view class="price-wrap">
<input class="uni-input" type="digit" v-model="minPoint" placeholder="最低" />
<input class="uni-input" type="digit" v-model="minPoint" :placeholder="isEnEnv ? 'Min' : '最低'" />
<view class="h-line"></view>
<input class="uni-input" type="digit" v-model="maxPoint" placeholder="最高" />
<input class="uni-input" type="digit" v-model="maxPoint" :placeholder="isEnEnv ? 'Max' : '最高'" />
</view>
</view>
<!-- 分类筛选项 -->
<view class="category-list-wrap">
<text class="first">全部分类</text>
<text class="first">{{ isEnEnv ? 'All Categories' : '全部分类' }}</text>
<view class="class-box">
<view @click="selectedCategory('')" class="list-wrap"><text :class="{ selected: !categoryId, 'color-base-text': !categoryId }">全部</text></view>
<view @click="selectedCategory('')" class="list-wrap"><text :class="{ selected: !categoryId, 'color-base-text': !categoryId }">{{ isEnEnv ? 'All' : '全部' }}</text></view>
<view @click="selectedCategory(item.category_id)" v-for="(item, index) in categoryList" :key="index" class="list-wrap">
<text :class="{ selected: item.category_id == categoryId, 'color-base-text': item.category_id == categoryId }">{{ item.category_name }}</text>
</view>
@@ -103,8 +103,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">{{ isEnEnv ? 'Reset' : '重置' }}</button>
<button type="primary" class="footer-box1" @click="screenData">{{ isEnEnv ? 'Confirm' : '确定' }}</button>
</view>
</uni-drawer>
@@ -268,26 +268,26 @@
// }
if (!Number(this.maxPoint) && this.maxPoint) {
this.$util.showToast({
title: '请输入最高价'
title: this.isEnEnv ? 'Please enter the maximum price' : '请输入最高价'
});
return;
}
if (Number(this.minPoint) < 0 || Number(this.maxPoint) < 0) {
this.$util.showToast({
title: '筛选价格不能小于0'
title: this.isEnEnv ? 'Filter price cannot be less than 0' : '筛选价格不能小于0'
});
return;
}
if (this.minPoint != '' && Number(this.minPoint) > Number(this.maxPoint) && this.maxPoint) {
this.$util.showToast({
title: '最低价不能大于最高价'
title: this.isEnEnv ? 'Minimum price cannot be greater than maximum price' : '最低价不能大于最高价'
});
return;
}
if (this.maxPoint != '' && Number(this.maxPoint) < Number(this.minPoint)) {
this.$util.showToast({
title: '最高价不能小于最低价'
title: this.isEnEnv ? 'Maximum price cannot be less than minimum price' : '最高价不能小于最低价'
});
return;
}