feat: 新增多语言文案与组件国际化适配

本次提交完成了大量多语言相关的新增与优化工作:
1. 新增充值、案例、会员资产、订单等页面的中文/英文翻译文案
2. 新增企业微信客服、时间选择、支付弹窗等组件的多语言包
3. 优化工具函数与自定义页面的多语言适配,替换硬编码提示文案
4. 新增会员等级规则、积分商品、退款管理等页面的国际化支持
5. 修复企业微信JS-SDK的错误提示文案硬编码问题
This commit is contained in:
2026-06-26 09:09:46 +08:00
parent 2d8846c64c
commit 066ca61d97
97 changed files with 2704 additions and 716 deletions

View File

@@ -6,7 +6,7 @@
<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="isEnEnv ? 'Please enter product keywords' : '请输入商品关键词'" />
:placeholder="$lang('goods_list.searchPlaceholder')" />
<text class="iconfont icon-sousuo3" @click.stop="search()" @tap.stop="search()"></text>
</view>
</view>
@@ -14,10 +14,10 @@
<!-- 排序 -->
<view class="sort-wrap">
<view class="comprehensive-wrap" :class="{ 'color-base-text': order === '' }" @click="sortTabClick('')">
<text :class="{ 'color-base-text': order === '' }">{{ isEnEnv ? 'Comprehensive' : '综合' }}</text>
<text :class="{ 'color-base-text': order === '' }">{{ $lang('goods_list.comprehensive') }}</text>
</view>
<view class="price-wrap" @click="sortTabClick('point')">
<text :class="{ 'color-base-text': order === 'point' }">{{ isEnEnv ? 'Points' : '积分' }}</text>
<text :class="{ 'color-base-text': order === 'point' }">{{ $lang('goods_list.points') }}</text>
<view class="iconfont-wrap">
<view class="iconfont icon-shangsanjiao-copy"
:class="{ 'color-base-text': priceOrder === 'asc' && order === 'point' }"></view>
@@ -26,8 +26,7 @@
</view>
</view>
<view class="price-wrap" @click="sortTabClick('create_time')">
<text :class="{ 'color-base-text': order === 'create_time' }">{{ isEnEnv ? 'New Arrival' : '上新时间'
}}</text>
<text :class="{ 'color-base-text': order === 'create_time' }">{{ $lang('goods_list.newArrival') }}</text>
<view class="iconfont-wrap">
<view class="iconfont icon-shangsanjiao-copy"
:class="{ 'color-base-text': priceOrder === 'asc' && order === 'create_time' }"></view>
@@ -36,7 +35,7 @@
</view>
</view>
<view :class="{ 'color-base-text': order === 'screen' }" class="screen-wrap">
<text @click="sortTabClick('screen')">{{ isEnEnv ? 'Filter' : '筛选' }}</text>
<text @click="sortTabClick('screen')">{{ $lang('goods_list.filter') }}</text>
<view @click="sortTabClick('screen')" class="iconfont-wrap">
<view class="iconfont icon-shaixuan color-tip"></view>
</view>
@@ -60,7 +59,7 @@
<view class="lineheight-clear">
<view class="discount-price">
<text class="unit ">{{ item.point }}</text>
<text class="unit font-size-tag">{{ isEnEnv ? 'Points' : '积分' }}</text>
<text class="unit font-size-tag">{{ $lang('goods_list.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')
@@ -73,7 +72,7 @@
</view>
</view>
<view class="pro-info" v-if="item.stock_show">
<view class="font-size-activity-tag color-tip">{{ isEnEnv ? 'Stock ' : '库存' }}{{
<view class="font-size-activity-tag color-tip">{{ $lang('goods_list.stock') }}{{
item.stock }}</view>
<view class="sale font-size-activity-tag color-tip" @click="toDetail(item)">
<!-- <button type="primary" size="mini">立即兑换</button> -->
@@ -84,7 +83,7 @@
</view>
<view class="empty" v-if="goodsList.length == 0">
<ns-empty :isIndex="false"
:text="isEnEnv ? 'No point products available' : '暂无积分商品'"></ns-empty>
:text="$lang('goods_list.noGoods')"></ns-empty>
</view>
</view>
</block>
@@ -92,26 +91,25 @@
<!-- 筛选弹出框 -->
<uni-drawer :visible="showScreen" mode="right" @close="showScreen = false" class="screen-wrap">
<view class="title color-tip">{{ isEnEnv ? 'Filter' : '筛选' }}</view>
<view class="title color-tip">{{ $lang('goods_list.filter') }}</view>
<scroll-view scroll-y>
<!-- 价格筛选项 -->
<view class="item-wrap">
<view class="label"><text>{{ isEnEnv ? 'Point Range' : '积分区间' }}</text></view>
<view class="label"><text>{{ $lang('goods_list.pointRange') }}</text></view>
<view class="price-wrap">
<input class="uni-input" type="digit" v-model="minPoint"
:placeholder="isEnEnv ? 'Min' : '最低'" />
:placeholder="$lang('goods_list.minPlaceholder')" />
<view class="h-line"></view>
<input class="uni-input" type="digit" v-model="maxPoint"
:placeholder="isEnEnv ? 'Max' : '最高'" />
:placeholder="$lang('goods_list.maxPlaceholder')" />
</view>
</view>
<!-- 分类筛选项 -->
<view class="category-list-wrap">
<text class="first">{{ isEnEnv ? 'All Categories' : '全部分类' }}</text>
<text class="first">{{ $lang('goods_list.allCategories') }}</text>
<view class="class-box">
<view @click="selectedCategory('')" class="list-wrap"><text
:class="{ selected: !categoryId, 'color-base-text': !categoryId }">{{ isEnEnv ? 'All' :
'全部' }}</text></view>
:class="{ selected: !categoryId, 'color-base-text': !categoryId }">{{ $lang('goods_list.all') }}</text></view>
<view @click="selectedCategory(item.category_id)" v-for="(item, index) in categoryList"
:key="index" class="list-wrap">
<text
@@ -122,8 +120,8 @@
</view>
</scroll-view>
<view class="footer" :class="{ 'safe-area': isIphoneX }">
<button type="default" class="footer-box" @click="resetData">{{ isEnEnv ? 'Reset' : '重置' }}</button>
<button type="primary" class="footer-box1" @click="screenData">{{ isEnEnv ? 'Confirm' : '确定' }}</button>
<button type="default" class="footer-box" @click="resetData">{{ $lang('goods_list.reset') }}</button>
<button type="primary" class="footer-box1" @click="screenData">{{ $lang('goods_list.confirm') }}</button>
</view>
</uni-drawer>
@@ -285,26 +283,26 @@ export default {
// }
if (!Number(this.maxPoint) && this.maxPoint) {
this.$util.showToast({
title: this.isEnEnv ? 'Please enter the maximum price' : '请输入最高价'
title: this.$lang('goods_list.pleaseEnterMaxPrice')
});
return;
}
if (Number(this.minPoint) < 0 || Number(this.maxPoint) < 0) {
this.$util.showToast({
title: this.isEnEnv ? 'Filter price cannot be less than 0' : '筛选价格不能小于0'
title: this.$lang('goods_list.priceCannotBeLessThanZero')
});
return;
}
if (this.minPoint != '' && Number(this.minPoint) > Number(this.maxPoint) && this.maxPoint) {
this.$util.showToast({
title: this.isEnEnv ? 'Minimum price cannot be greater than maximum price' : '最低价不能大于最高价'
title: this.$lang('goods_list.minCannotBeGreaterThanMax')
});
return;
}
if (this.maxPoint != '' && Number(this.maxPoint) < Number(this.minPoint)) {
this.$util.showToast({
title: this.isEnEnv ? 'Maximum price cannot be less than minimum price' : '最高价不能小于最低价'
title: this.$lang('goods_list.maxCannotBeLessThanMin')
});
return;
}

View File

@@ -92,7 +92,7 @@ export default {
uni.removeStorageSync("pay_flag");
} else {
this.$util.showToast({
title: '未获取到创建订单所需数据!'
title: this.$lang('payment.toast.orderDataNotFound')
});
setTimeout(() => {
this.$util.redirectTo(this.$util.INDEX_PAGE_URL);
@@ -119,7 +119,7 @@ export default {
if (this.$refs.loadingCover) this.$refs.loadingCover.hide();
} else {
this.$util.showToast({
title: '未获取到创建订单所需数据!'
title: this.$lang('payment.toast.orderDataNotFound')
});
setTimeout(() => {
this.$util.redirectTo(this.$util.INDEX_PAGE_URL);
@@ -280,9 +280,9 @@ export default {
this.isSub = false;
if (res.data.error_code == 10 || res.data.error_code == 12) {
uni.showModal({
title: '订单未创建',
title: this.$lang('payment.modal.orderNotCreated'),
content: res.message,
confirmText: '去设置',
confirmText: this.$lang('payment.modal.goToSet'),
success: res => {
if (res.confirm) {
this.selectAddress();
@@ -309,13 +309,13 @@ export default {
if (this.orderPaymentData.is_virtual == 1) {
if (!this.orderCreateData.member_address.mobile.length) {
this.$util.showToast({
title: '请输入您的手机号码'
title: this.$lang('payment.toast.pleaseEnterMobile')
});
return false;
}
if (!this.$util.verifyMobile(this.orderCreateData.member_address.mobile)) {
this.$util.showToast({
title: '请输入正确的手机号码'
title: this.$lang('payment.toast.pleaseEnterCorrectMobile')
});
return false;
}
@@ -324,7 +324,7 @@ export default {
if (this.orderPaymentData.is_virtual == 0) {
if (!this.orderCreateData.delivery || !this.orderCreateData.delivery.delivery_type) {
this.$util.showToast({
title: '商家未设置配送方式'
title: this.$lang('payment.toast.noDeliveryMethod')
});
return false;
}
@@ -332,7 +332,7 @@ export default {
if (this.orderCreateData.delivery.delivery_type != 'store') {
if (!this.orderCreateData.member_address) {
this.$util.showToast({
title: '请先选择您的收货地址'
title: this.$lang('payment.toast.pleaseSelectAddress')
});
return false;
}
@@ -341,26 +341,26 @@ export default {
if (this.orderCreateData.delivery.delivery_type == 'store') {
if (!this.orderCreateData.delivery.store_id) {
this.$util.showToast({
title: '没有可提货的门店,请选择其他配送方式'
title: this.$lang('payment.toast.noPickupStore')
});
return false;
}
if (!this.member_address.mobile) {
this.$util.showToast({
title: '请输入预留手机'
title: this.$lang('payment.toast.pleaseEnterReservedMobile')
});
return false;
}
if (!this.$util.verifyMobile(this.member_address.mobile)) {
this.$util.showToast({
title: '请输入正确的预留手机'
title: this.$lang('payment.toast.pleaseEnterCorrectReservedMobile')
});
return false;
}
if (!this.orderCreateData.delivery.buyer_ask_delivery_time.start_date || !this.orderCreateData.delivery.buyer_ask_delivery_time.end_date) {
this.$util.showToast({
title: '请选择自提时间'
title: this.$lang('payment.toast.pleaseSelectPickupTime')
});
return false;
}
@@ -369,13 +369,13 @@ export default {
if (this.orderCreateData.delivery.delivery_type == 'local') {
if (!this.orderCreateData.delivery.store_id) {
this.$util.showToast({
title: '没有可配送的门店,请选择其他配送方式'
title: this.$lang('payment.toast.noDeliveryStore')
});
return false;
}
if (this.orderPaymentData.config.local.is_use && this.orderPaymentData.delivery.local.info && this.orderPaymentData.delivery.local.info.time_is_open == 1 && (!this.orderCreateData.delivery.buyer_ask_delivery_time.start_date || !this.orderCreateData.delivery.buyer_ask_delivery_time.end_date)) {
this.$util.showToast({
title: '请选择配送时间'
title: this.$lang('payment.toast.pleaseSelectDeliveryTime')
});
return false;
}
@@ -526,7 +526,7 @@ export default {
start_date:data.data.start_date,
end_date:data.data.end_date
};
if (data.data.title == '今天' || data.data.title == '明天') {
if (data.data.title == this.$lang('payment.time.today') || data.data.title == this.$lang('payment.time.tomorrow')) {
this.orderCreateData.buyer_ask_delivery_title = data.data.title + '(' + data.data.time + ')'
} else {
this.orderCreateData.buyer_ask_delivery_title = data.data.month + '(' + data.data.time + ')'