feat: 新增多语言文案与组件国际化适配
本次提交完成了大量多语言相关的新增与优化工作: 1. 新增充值、案例、会员资产、订单等页面的中文/英文翻译文案 2. 新增企业微信客服、时间选择、支付弹窗等组件的多语言包 3. 优化工具函数与自定义页面的多语言适配,替换硬编码提示文案 4. 新增会员等级规则、积分商品、退款管理等页面的国际化支持 5. 修复企业微信JS-SDK的错误提示文案硬编码问题
This commit is contained in:
@@ -11,8 +11,8 @@
|
||||
:src="$util.img('public/uniapp/order/order-icon-close.png')" />
|
||||
<view class="status-name">
|
||||
<view class="status-name">
|
||||
{{ orderData.order_status == 0 ? '待支付' : orderData.order_status == 1 ? '已完成' :
|
||||
orderData.order_status == -1 ? '已关闭' : '' }}
|
||||
{{ orderData.order_status == 0 ? $lang('status.pendingPayment') : orderData.order_status == 1 ? $lang('status.completed') :
|
||||
orderData.order_status == -1 ? $lang('status.closed') : '' }}
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
@@ -32,7 +32,7 @@
|
||||
<view>
|
||||
<text class="goods-price color-base-text">
|
||||
<text>
|
||||
<text>{{ orderData.point }}积分</text>
|
||||
<text>{{ orderData.point }}{{ $lang('goods.points') }}</text>
|
||||
<text v-if="orderData.price > 0" class="price-color">
|
||||
+
|
||||
<text class="unit">{{ $lang('common.currencySymbol') }}</text>
|
||||
@@ -58,26 +58,26 @@
|
||||
<!-- 订单概况 -->
|
||||
<view class="order-summary">
|
||||
<view class="order-cell">
|
||||
<text class="tit">订单编号:</text>
|
||||
<text class="tit">{{ $lang('orderInfo.orderNo') }}</text>
|
||||
<view class="box">
|
||||
<text class="color-title">{{ orderData.order_no }}</text>
|
||||
<view class="copy" @click="$util.copy(orderData.order_no)">复制</view>
|
||||
<view class="copy" @click="$util.copy(orderData.order_no)">{{ $lang('orderInfo.copy') }}</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="order-cell">
|
||||
<text class="tit">订单交易号:</text>
|
||||
<text class="tit">{{ $lang('orderInfo.outTradeNo') }}</text>
|
||||
<view class="box">
|
||||
<text class="color-title">{{ orderData.out_trade_no }}</text>
|
||||
</view>
|
||||
</view>
|
||||
<view class="order-cell">
|
||||
<text class="tit">创建时间:</text>
|
||||
<text class="tit">{{ $lang('orderInfo.createTime') }}</text>
|
||||
<view class="box">
|
||||
<text class="color-title">{{ $util.timeStampTurnTime(orderData.create_time) }}</text>
|
||||
</view>
|
||||
</view>
|
||||
<view class="order-cell" v-if="orderData.close_time > 0">
|
||||
<text class="tit">关闭时间:</text>
|
||||
<text class="tit">{{ $lang('orderInfo.closeTime') }}</text>
|
||||
<view class="box">
|
||||
<text class="color-title">{{ $util.timeStampTurnTime(orderData.close_time) }}</text>
|
||||
</view>
|
||||
@@ -96,7 +96,7 @@
|
||||
<!-- 订单金额 -->
|
||||
<view class="order-money">
|
||||
<view class="order-cell" v-if="orderData.point > 0">
|
||||
<text class="tit">使用积分</text>
|
||||
<text class="tit">{{ $lang('amount.pointsUsed') }}</text>
|
||||
<view class="box align-right">
|
||||
<text class="color-base-text price-font">
|
||||
<text>{{ orderData.point }}</text>
|
||||
@@ -104,7 +104,7 @@
|
||||
</view>
|
||||
</view>
|
||||
<view class="order-cell" v-if="orderData.delivery_price > 0">
|
||||
<text class="tit">运费</text>
|
||||
<text class="tit">{{ $lang('amount.deliveryFee') }}</text>
|
||||
<view class="box align-right">
|
||||
<text class="color-base-text price-font">
|
||||
<text class="unit font-size-tag">{{ $lang('common.currencySymbol') }}</text>
|
||||
@@ -114,7 +114,7 @@
|
||||
</view>
|
||||
<view class="order-cell" v-if="orderData.order_money > 0">
|
||||
<view class="box align-right">
|
||||
<text>实付金额:</text>
|
||||
<text>{{ $lang('amount.totalPayable') }}</text>
|
||||
<text class="color-base-text price-font">
|
||||
<text class="font-size-goods-tag">{{ $lang('common.currencySymbol') }}</text>
|
||||
<text class="font-size-base">{{ orderData.order_money }}</text>
|
||||
@@ -123,9 +123,9 @@
|
||||
</view>
|
||||
|
||||
<view class="order-action" v-if="orderData.order_status == 0 && orderData.type == 1">
|
||||
<view class="order-box-btn" @click="orderClose()">关闭</view>
|
||||
<view class="order-box-btn" @click="orderClose()">{{ $lang('button.close') }}</view>
|
||||
<view class="order-box-btn color-base-bg color-base-border color-text-white"
|
||||
@click="openChoosePayment()">支付</view>
|
||||
@click="openChoosePayment()">{{ $lang('button.pay') }}</view>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
@@ -200,7 +200,7 @@ export default {
|
||||
JSON.parse(this.orderData.delivery_store_info);
|
||||
} else {
|
||||
this.$util.showToast({
|
||||
title: '未获取到订单信息!'
|
||||
title: this.$lang('toast.orderInfoNotFound')
|
||||
});
|
||||
setTimeout(() => {
|
||||
this.$util.redirectTo('/pages_order/list');
|
||||
@@ -221,8 +221,8 @@ export default {
|
||||
},
|
||||
orderClose() {
|
||||
uni.showModal({
|
||||
title: '提示',
|
||||
content: '确定关闭此次兑换?',
|
||||
title: this.$lang('modal.tip'),
|
||||
content: this.$lang('modal.confirmClose'),
|
||||
success: res => {
|
||||
if (res.confirm) {
|
||||
this.$api.sendRequest({
|
||||
@@ -233,7 +233,7 @@ export default {
|
||||
success: res => {
|
||||
if (res.code >= 0) {
|
||||
this.$util.showToast({
|
||||
title: '关闭成功'
|
||||
title: this.$lang('toast.closeSuccess')
|
||||
});
|
||||
this.getOrderData();
|
||||
}
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
<view class="cate-search">
|
||||
<view class="search-box">
|
||||
<input class="uni-input" maxlength="50" v-model="searchText" confirm-type="search"
|
||||
placeholder="请输入商品名称/订单编号" @confirm="search()" @click.stop="search()" @tap.stop="search()" />
|
||||
:placeholder="$lang('searchPlaceholder')" @confirm="search()" @click.stop="search()" @tap.stop="search()" />
|
||||
<text class="iconfont icon-sousuo3" @click.stop="search()" @tap.stop="search()"></text>
|
||||
</view>
|
||||
</view>
|
||||
@@ -12,7 +12,7 @@
|
||||
:id="statusItem.id" :data-current="statusIndex" @click="ontabtap">
|
||||
<text class="uni-tab-item-title"
|
||||
:class="statusItem.status == orderStatus ? 'uni-tab-item-title-active color-base-text' : ''">
|
||||
{{ statusItem.name }}
|
||||
{{ $lang('status.' + statusItem.status) }}
|
||||
</text>
|
||||
</view>
|
||||
</view>
|
||||
@@ -32,7 +32,7 @@
|
||||
:class="$util.inArray(orderItem.order_id, mergePayOrder) == -1 ? 'icon-yuan_checkbox' : 'icon-yuan_checked color-base-text'"
|
||||
@click="selectOrder(orderItem.order_id, orderItem.pay_money)"
|
||||
v-if="orderStatus == 'waitpay' && orderItem.order_status == 0"></view> -->
|
||||
<text class="order-no">订单号:{{ orderItem.order_no }}</text>
|
||||
<text class="order-no">{{ $lang('orderNo') }}{{ orderItem.order_no }}</text>
|
||||
<text class="order-type-name">{{ orderItem.order_type_name }}</text>
|
||||
<text class="status-name">{{ orderItem.order_status_name }}</text>
|
||||
</view>
|
||||
@@ -98,9 +98,9 @@
|
||||
<view class="order-footer">
|
||||
<view class="order-base-info">
|
||||
<view class="total">
|
||||
<text class="font-size-sub">共{{ orderItem.goods_num }}件商品</text>
|
||||
<text class="font-size-sub">{{ $lang('totalGoods', { num: orderItem.goods_num }) }}</text>
|
||||
<text class="align-right font-size-base">
|
||||
实付款:
|
||||
{{ $lang('actualPayment') }}
|
||||
<text class="font-size-base price-font">{{ $lang('common.currencySymbol')
|
||||
}}{{ orderItem.order_money }}</text>
|
||||
</text>
|
||||
@@ -109,7 +109,7 @@
|
||||
<view class="order-action" v-if="orderItem.action.length > 0">
|
||||
<view class="order-time" v-if="orderItem.order_status == 0" id="action-date">
|
||||
<image :src="$util.img('public/uniapp/order/time.png')" show-menu-by-longpress></image>
|
||||
剩余时间:
|
||||
{{ $lang('remainingTime') }}
|
||||
<uni-count-down :day="orderItem.discountTimeMachine.d"
|
||||
:hour="orderItem.discountTimeMachine.h"
|
||||
:minute="orderItem.discountTimeMachine.i"
|
||||
@@ -119,8 +119,8 @@
|
||||
<view class="order-box-btn"
|
||||
v-if="evaluateConfig.evaluate_status == 1 && orderItem.is_evaluate == 1"
|
||||
@click="operation('memberOrderEvaluation', orderItem)">
|
||||
<text v-if="orderItem.evaluate_status == 0">评价</text>
|
||||
<text v-else-if="orderItem.evaluate_status == 1">追评</text>
|
||||
<text v-if="orderItem.evaluate_status == 0">{{ $lang('evaluate') }}</text>
|
||||
<text v-else-if="orderItem.evaluate_status == 1">{{ $lang('review') }}</text>
|
||||
</view>
|
||||
<view class="order-box-btn"
|
||||
:class="{ 'color-base-border color-base-bg': operationItem.action == 'orderPay' }"
|
||||
@@ -133,12 +133,12 @@
|
||||
v-else-if="orderItem.action.length == 0 && orderItem.is_evaluate == 1 && evaluateConfig.evaluate_status == 1">
|
||||
<view class="order-box-btn" v-if="orderItem.is_evaluate == 1"
|
||||
@click="operation('memberOrderEvaluation', orderItem)">
|
||||
<text v-if="orderItem.evaluate_status == 0">评价</text>
|
||||
<text v-else-if="orderItem.evaluate_status == 1">追评</text>
|
||||
<text v-if="orderItem.evaluate_status == 0">{{ $lang('evaluate') }}</text>
|
||||
<text v-else-if="orderItem.evaluate_status == 1">{{ $lang('review') }}</text>
|
||||
</view>
|
||||
</view>
|
||||
<view class="order-action" v-else>
|
||||
<view class="order-box-btn" @click="orderDetail(orderItem)">查看详情</view>
|
||||
<view class="order-box-btn" @click="orderDetail(orderItem)">{{ $lang('viewDetail') }}</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
@@ -34,20 +34,20 @@ export default {
|
||||
*/
|
||||
promotion(data){
|
||||
if (data.promotion && data.promotion.manjian && data.promotion.manjian.length) {
|
||||
let promotionStr = {title: `满减送`, content: ''}
|
||||
let promotionStr = {title: this.$lang('promotion.title'), content: ''}
|
||||
data.promotion.manjian.forEach((mItem,mIndex)=>{
|
||||
let promotion = '';
|
||||
let content = {};
|
||||
let limit = mItem.type == 0 ? '元' : '件';
|
||||
let limit = mItem.type == 0 ? this.$lang('promotion.yuan') : this.$lang('promotion.piece');
|
||||
if(mItem.rule){
|
||||
var item = mItem.discount_array.rule;
|
||||
item.limit = mItem.type == 0 ? parseFloat(item.limit).toFixed(2) : parseInt(item.limit);
|
||||
// 满减
|
||||
if (item.discount_money != undefined) {
|
||||
if (content.manjian == undefined) {
|
||||
content.manjian = '购买可享受满' + item.limit + limit + '减' + item.discount_money + '元';
|
||||
content.manjian = this.$lang('promotion.manjianFirst', { limit: item.limit, unit: limit, money: item.discount_money });
|
||||
} else {
|
||||
content.manjian += ';满' + item.limit + limit + '减' + item.discount_money + '元';
|
||||
content.manjian += this.$lang('promotion.manjianMore', { limit: item.limit, unit: limit, money: item.discount_money });
|
||||
}
|
||||
}
|
||||
// 满送优惠券
|
||||
@@ -55,32 +55,32 @@ export default {
|
||||
let text = '';
|
||||
item.coupon_list.forEach((couponItem, couponIndex) => {
|
||||
if (couponItem.type == 'discount') {
|
||||
if (text == '') text = '送'+ couponItem.give_num +'张' + parseFloat(couponItem.discount) + '折优惠券';
|
||||
else text += '、送'+ couponItem.give_num +'张' + parseFloat(couponItem.discount) + '折优惠券';
|
||||
if (text == '') text = this.$lang('promotion.couponDiscountFirst', { num: couponItem.give_num, discount: parseFloat(couponItem.discount) });
|
||||
else text += this.$lang('promotion.couponDiscountMore', { num: couponItem.give_num, discount: parseFloat(couponItem.discount) });
|
||||
} else {
|
||||
if (text == '') text = '送'+ couponItem.give_num +'张' + parseFloat(couponItem.money) + '元优惠券';
|
||||
else text += '、送'+ couponItem.give_num +'张' + parseFloat(couponItem.money) + '元优惠券';
|
||||
if (text == '') text = this.$lang('promotion.couponMoneyFirst', { num: couponItem.give_num, money: parseFloat(couponItem.money) });
|
||||
else text += this.$lang('promotion.couponMoneyMore', { num: couponItem.give_num, money: parseFloat(couponItem.money) });
|
||||
}
|
||||
})
|
||||
if (content.mansong == undefined) {
|
||||
content.mansong = '购物满' + item.limit + limit + text;
|
||||
content.mansong = this.$lang('promotion.mansongFirst', { limit: item.limit, unit: limit, text: text });
|
||||
} else {
|
||||
content.mansong += ';' + '满' + item.limit + limit + text;
|
||||
content.mansong += this.$lang('promotion.mansongMore', { limit: item.limit, unit: limit, text: text });
|
||||
}
|
||||
}
|
||||
// 满送积分
|
||||
if (item.point) {
|
||||
let point_text = '可得' + item.point + '积分';
|
||||
let point_text = this.$lang('promotion.pointGain', { point: item.point });
|
||||
if(content.point_text == undefined) {
|
||||
content.point_text = '购物满' + item.limit + limit + point_text
|
||||
content.point_text = this.$lang('promotion.pointFirst', { limit: item.limit, unit: limit, pointText: point_text });
|
||||
}else {
|
||||
content.point_text += ';' + '满' + item.limit + limit + point_text;
|
||||
content.point_text += this.$lang('promotion.pointMore', { limit: item.limit, unit: limit, pointText: point_text });
|
||||
}
|
||||
}
|
||||
// 包邮
|
||||
if (item.free_shipping != undefined) {
|
||||
if (content.free_shipping == undefined) {
|
||||
content.free_shipping = '购物满' + item.limit + limit + '包邮';
|
||||
content.free_shipping = this.$lang('promotion.freeShipping', { limit: item.limit, unit: limit });
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user