feat: 新增多语言文案与组件国际化适配
本次提交完成了大量多语言相关的新增与优化工作: 1. 新增充值、案例、会员资产、订单等页面的中文/英文翻译文案 2. 新增企业微信客服、时间选择、支付弹窗等组件的多语言包 3. 优化工具函数与自定义页面的多语言适配,替换硬编码提示文案 4. 新增会员等级规则、积分商品、退款管理等页面的国际化支持 5. 修复企业微信JS-SDK的错误提示文案硬编码问题
This commit is contained in:
@@ -4,19 +4,19 @@
|
||||
<uni-popup ref="choosePaymentPopup" type="center" :mask-click="false">
|
||||
<view class="choose-payment-popup popup" @touchmove.prevent.stop>
|
||||
<view class="popup-header">
|
||||
<text class="tit">支付方式</text>
|
||||
<text class="tit">{{ $lang('components.nsPayment.paymentMethod') }}</text>
|
||||
<text class="iconfont icon-close" @click="close()"></text>
|
||||
</view>
|
||||
<scroll-view scroll-y="true" class="popup-body" :class="{ 'safe-area': isIphoneX }">
|
||||
<view class="pay-money">
|
||||
<!-- <text class="unit">{{ $lang('common.currencySymbol') }}</text> -->
|
||||
<text class="money">支付金额{{ payMoney | moneyFormat }}元</text>
|
||||
<text class="money">{{ $lang('components.nsPayment.payAmount', { amount: payMoney | moneyFormat }) }}</text>
|
||||
</view>
|
||||
<view class="payment-item" v-if="balanceDeduct > 0 && balanceConfig == 1 && sale">
|
||||
<view class="iconfont icon-yue"></view>
|
||||
<view class="info-wrap">
|
||||
<text class="name">余额抵扣</text>
|
||||
<view class="money">可用¥{{ balanceDeduct }}</view>
|
||||
<text class="name">{{ $lang('components.nsPayment.balanceDeduction') }}</text>
|
||||
<view class="money">{{ $lang('components.nsPayment.availableBalance', { amount: balanceDeduct }) }}</view>
|
||||
</view>
|
||||
<ns-switch class="balance-switch" @change="useBalance" :checked="isBalance == 1"></ns-switch>
|
||||
</view>
|
||||
@@ -31,12 +31,12 @@
|
||||
</view>
|
||||
</block>
|
||||
<block v-else>
|
||||
<view class="empty">平台尚未配置支付方式!</view>
|
||||
<view class="empty">{{ $lang('components.nsPayment.noPaymentMethod') }}</view>
|
||||
</block>
|
||||
</block>
|
||||
</scroll-view>
|
||||
<view class="popup-footer" :class="{ 'bottom-safe-area': isIphoneX }">
|
||||
<view class="confirm-btn color-base-bg" @click="confirm()">确认支付</view>
|
||||
<view class="confirm-btn color-base-bg" @click="confirm()">{{ $lang('components.nsPayment.confirmPay') }}</view>
|
||||
</view>
|
||||
</view>
|
||||
</uni-popup>
|
||||
@@ -72,12 +72,12 @@ export default {
|
||||
payIndex: 0,
|
||||
// #ifdef H5
|
||||
payTypeList: [{
|
||||
name: '支付宝支付',
|
||||
name: this.$lang('components.nsPayment.alipay'),
|
||||
icon: 'icon-zhifubaozhifu-',
|
||||
type: 'alipay'
|
||||
},
|
||||
{
|
||||
name: '微信支付',
|
||||
name: this.$lang('components.nsPayment.wechatpay'),
|
||||
icon: 'icon-weixin1',
|
||||
type: 'wechatpay'
|
||||
}
|
||||
@@ -86,7 +86,7 @@ export default {
|
||||
// #endif
|
||||
// #ifdef MP-WEIXIN
|
||||
payTypeList: [{
|
||||
name: '微信支付',
|
||||
name: this.$lang('components.nsPayment.wechatpay'),
|
||||
provider: 'wxpay',
|
||||
icon: 'icon-weixin1',
|
||||
type: 'wechatpay'
|
||||
@@ -95,7 +95,7 @@ export default {
|
||||
// #endif
|
||||
// #ifdef MP-ALIPAY
|
||||
payTypeList: [{
|
||||
name: '支付宝支付',
|
||||
name: this.$lang('components.nsPayment.alipay'),
|
||||
icon: 'icon-zhifubaozhifu-',
|
||||
type: 'alipay',
|
||||
provider: 'alipay'
|
||||
@@ -108,11 +108,12 @@ export default {
|
||||
};
|
||||
},
|
||||
created(e) {
|
||||
let url;
|
||||
// #ifdef H5
|
||||
let url = window.location.href
|
||||
url = window.location.href
|
||||
// #endif
|
||||
// #ifndef H5
|
||||
let url = getCurrentPages()[getCurrentPages().length - 1].route
|
||||
url = getCurrentPages()[getCurrentPages().length - 1].route
|
||||
// #endif
|
||||
let list = url.match('presale/order_list/order_list')
|
||||
let detail = url.match('presale/order_detail/order_detail')
|
||||
@@ -158,12 +159,12 @@ export default {
|
||||
confirm() {
|
||||
if (this.payTypeList.length == 0 && this.payMoney > 0) {
|
||||
this.$util.showToast({
|
||||
title: '请选择支付方式!'
|
||||
title: this.$lang('components.nsPayment.pleaseSelectPaymentMethod')
|
||||
});
|
||||
return;
|
||||
}
|
||||
uni.showLoading({
|
||||
title: '支付中...',
|
||||
title: this.$lang('components.nsPayment.paying'),
|
||||
mask: true
|
||||
});
|
||||
this.$refs.choosePaymentPopup.close();
|
||||
@@ -182,7 +183,7 @@ export default {
|
||||
this.pay();
|
||||
} else {
|
||||
this.$util.showToast({
|
||||
title: '未获取到支付信息!'
|
||||
title: this.$lang('components.nsPayment.payInfoNotFound')
|
||||
});
|
||||
setTimeout(() => {
|
||||
this.$util.redirectTo(this.$util.INDEX_PAGE_URL);
|
||||
@@ -295,7 +296,7 @@ export default {
|
||||
},
|
||||
res => {
|
||||
this.$util.showToast({
|
||||
title: '您已取消支付'
|
||||
title: this.$lang('components.nsPayment.paymentCancelled')
|
||||
});
|
||||
setTimeout(() => {
|
||||
this.$util.redirectTo('/pages_tool/pay/result', {
|
||||
@@ -392,10 +393,10 @@ export default {
|
||||
fail: res => {
|
||||
this.flag = false;
|
||||
if (res.errMsg == 'requestOrderPayment:fail cancel') {
|
||||
this.$util.showToast({ title: '您已取消支付' });
|
||||
this.$util.showToast({ title: this.$lang('components.nsPayment.paymentCancelled') });
|
||||
} else {
|
||||
uni.showModal({
|
||||
content: '支付失败,失败原因: ' + res.errMsg,
|
||||
content: this.$lang('components.nsPayment.paymentFailed', { reason: res.errMsg }),
|
||||
showCancel: false
|
||||
});
|
||||
}
|
||||
@@ -428,10 +429,10 @@ export default {
|
||||
fail: res => {
|
||||
this.flag = false;
|
||||
if (res.errMsg == 'requestPayment:fail cancel') {
|
||||
this.$util.showToast({ title: '您已取消支付' });
|
||||
this.$util.showToast({ title: this.$lang('components.nsPayment.paymentCancelled') });
|
||||
} else {
|
||||
uni.showModal({
|
||||
content: '支付失败,失败原因: ' + res.errMsg,
|
||||
content: this.$lang('components.nsPayment.paymentFailed', { reason: res.errMsg }),
|
||||
showCancel: false
|
||||
});
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user