feat: add and optimize multiple multilingual language packs
1. 新增拼团、砍价、分销、支付、地址、账户等多业务场景的中英文本地化文案 2. 替换项目中硬编码的文本为多语言调用,统一前端页面文案展示 3. 新增多个业务组件的国际化语言配置文件
This commit is contained in:
@@ -13,18 +13,18 @@
|
||||
<view class="payment-item" v-for="(item, index) in payTypeList" :key="index" @click="payIndex = index">
|
||||
<view>
|
||||
<text class="iconfont" :class="item.icon"></text>
|
||||
<text class="name">{{ item.name }}</text>
|
||||
<text class="name">{{ $lang('pay.cashier.' + item.type) }}</text>
|
||||
</view>
|
||||
<text class="iconfont" :class="payIndex == index ? 'icon-yuan_checked color-base-text' : 'icon-checkboxblank'"></text>
|
||||
</view>
|
||||
</view>
|
||||
<button type="primary" @click="confirm">确认支付</button>
|
||||
<button type="primary" @click="confirm">{{ $lang('pay.cashier.confirmPay') }}</button>
|
||||
</block>
|
||||
<view v-else class="empty">店铺尚未配置支付方式!</view>
|
||||
<view v-else class="empty">{{ $lang('pay.cashier.noPayMethodConfigured') }}</view>
|
||||
</block>
|
||||
<ns-empty text="该支付单据已支付" :is-index="true" v-else></ns-empty>
|
||||
<ns-empty :text="$lang('pay.cashier.orderAlreadyPaid')" :is-index="true" v-else></ns-empty>
|
||||
</block>
|
||||
<ns-empty text="未获取到支付信息" :is-index="true" v-else></ns-empty>
|
||||
<ns-empty :text="$lang('pay.cashier.noPayInfo')" :is-index="true" v-else></ns-empty>
|
||||
<ns-login ref="login"></ns-login>
|
||||
</view>
|
||||
</template>
|
||||
@@ -131,12 +131,12 @@ export default {
|
||||
}
|
||||
if (this.payTypeList.length == 0 && this.payInfo.pay_money > 0) {
|
||||
this.$util.showToast({
|
||||
title: '请选择支付方式!'
|
||||
title: this.$lang('pay.cashier.pleaseSelectPayMethod')
|
||||
});
|
||||
return;
|
||||
}
|
||||
uni.showLoading({
|
||||
title: '支付中...',
|
||||
title: this.$lang('pay.cashier.paying'),
|
||||
mask: true
|
||||
});
|
||||
this.pay();
|
||||
@@ -265,9 +265,9 @@ export default {
|
||||
fail: res => {
|
||||
this.flag = false;
|
||||
if (res.errMsg == 'requestPayment:fail cancel') {
|
||||
this.$util.showToast({ title: '您已取消支付' });
|
||||
this.$util.showToast({ title: this.$lang('pay.cashier.paymentCancelled') });
|
||||
} else {
|
||||
uni.showModal({ content: '支付失败,失败原因: ' + res.errMsg, showCancel: false });
|
||||
uni.showModal({ content: this.$lang('pay.cashier.paymentFailed', { reason: res.errMsg }), showCancel: false });
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
<view class="result-box">
|
||||
<template v-if="payInfo.pay_status">
|
||||
<image :src="$util.img('public/uniapp/pay/pay_success.png')" mode="widthFix" lazy-load="true" class="result-image" show-menu-by-longpress/>
|
||||
<view class="msg success">{{ $lang('paymentSuccess') }}</view>
|
||||
<view class="msg success">{{ $lang('pay.result.paymentSuccess') }}</view>
|
||||
<view class="pay-amount">
|
||||
<text class="unit price-style small">{{ $lang('common.currencySymbol') }}</text>
|
||||
<text class="price-style large">{{ parseFloat(payInfo.pay_money).toFixed(2).split(".")[0] }}</text>
|
||||
@@ -13,43 +13,43 @@
|
||||
</template>
|
||||
<template v-else>
|
||||
<image :src="$util.img('public/uniapp/pay/pay_fail.png')" mode="widthFix" class="result-image" show-menu-by-longpress/>
|
||||
<view class="msg fail">{{ $lang('paymentFail') }}</view>
|
||||
<view class="msg fail">{{ $lang('pay.result.paymentFail') }}</view>
|
||||
</template>
|
||||
|
||||
<view class="consume-box" v-if="addonIsExist.memberconsume && consumeStatus == 1 && payInfo.pay_status">
|
||||
<view class="consume-head">
|
||||
<view class="consume-head-text">恭喜您获得</view>
|
||||
<view class="consume-head-text">{{ $lang('pay.result.congratulations') }}</view>
|
||||
</view>
|
||||
<view class="consume-list">
|
||||
<view class="consume-item" v-if="consumeInfo.point_num > 0">
|
||||
<image :src="$util.img('public/uniapp/pay/point.png')" mode="widthFix" show-menu-by-longpress></image>
|
||||
<view class="consume-value color-base-text">{{ consumeInfo.point_num }}</view>
|
||||
<view class="consume-type">积分</view>
|
||||
<view class="consume-type">{{ $lang('pay.result.points') }}</view>
|
||||
</view>
|
||||
<view class="consume-item" v-if="consumeInfo.growth_num > 0">
|
||||
<image :src="$util.img('public/uniapp/pay/growth.png')" mode="widthFix" show-menu-by-longpress></image>
|
||||
<view class="consume-value color-base-text">{{ consumeInfo.growth_num }}</view>
|
||||
<view class="consume-type">成长值</view>
|
||||
<view class="consume-type">{{ $lang('pay.result.growthValue') }}</view>
|
||||
</view>
|
||||
<view class="consume-item" v-if="consumeInfo.coupon_list.length > 0">
|
||||
<image :src="$util.img('public/uniapp/pay/coupon.png')" mode="widthFix" show-menu-by-longpress></image>
|
||||
<view class="consume-value color-base-text">{{ consumeInfo.coupon_list.length }}</view>
|
||||
<view class="consume-type">张优惠券</view>
|
||||
<view class="consume-type">{{ $lang('pay.result.couponsCount', { count: consumeInfo.coupon_list.length }) }}</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<view class="action">
|
||||
<template v-if="storeToken">
|
||||
<view v-if="paySource == 'recharge'" class="btn" @click="toRecharge()">充值记录</view>
|
||||
<view v-else-if="paySource == 'membercard'" class="btn" @click="toCard()">会员卡</view>
|
||||
<view v-else-if="paySource == 'presale'" class="btn" @click="toPresaleOrder()">查看订单</view>
|
||||
<view v-else-if="paySource == 'giftcard'" class="btn" @click="toOrder()">查看订单</view>
|
||||
<view v-else-if="paySource == 'pointexchange'" class="btn" @click="toExchangeOrder()">查看订单
|
||||
<view v-if="paySource == 'recharge'" class="btn" @click="toRecharge()">{{ $lang('pay.result.rechargeRecords') }}</view>
|
||||
<view v-else-if="paySource == 'membercard'" class="btn" @click="toCard()">{{ $lang('pay.result.memberCard') }}</view>
|
||||
<view v-else-if="paySource == 'presale'" class="btn" @click="toPresaleOrder()">{{ $lang('pay.result.viewOrder') }}</view>
|
||||
<view v-else-if="paySource == 'giftcard'" class="btn" @click="toOrder()">{{ $lang('pay.result.viewOrder') }}</view>
|
||||
<view v-else-if="paySource == 'pointexchange'" class="btn" @click="toExchangeOrder()">{{ $lang('pay.result.viewOrder') }}
|
||||
</view>
|
||||
<view v-else class="btn" @click="toOrderDetail(payInfo.order_id)">查看订单</view>
|
||||
<view v-else class="btn" @click="toOrderDetail(payInfo.order_id)">{{ $lang('pay.result.viewOrder') }}</view>
|
||||
</template>
|
||||
<view class="btn go-home" @click="goHome()">{{ $lang('goHome') }}</view>
|
||||
<view class="btn go-home" @click="goHome()">{{ $lang('pay.result.goHome') }}</view>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
@@ -130,7 +130,7 @@
|
||||
if (this.$refs.loadingCover) this.$refs.loadingCover.hide();
|
||||
} else {
|
||||
this.$util.showToast({
|
||||
title: '未获取到支付信息!'
|
||||
title: this.$lang('pay.result.noPayInfo')
|
||||
});
|
||||
setTimeout(() => {
|
||||
this.$util.redirectTo(this.$util.INDEX_PAGE_URL, {}, 'reLaunch');
|
||||
|
||||
Reference in New Issue
Block a user