feat: 新增多语言文案与组件国际化适配
本次提交完成了大量多语言相关的新增与优化工作: 1. 新增充值、案例、会员资产、订单等页面的中文/英文翻译文案 2. 新增企业微信客服、时间选择、支付弹窗等组件的多语言包 3. 优化工具函数与自定义页面的多语言适配,替换硬编码提示文案 4. 新增会员等级规则、积分商品、退款管理等页面的国际化支持 5. 修复企业微信JS-SDK的错误提示文案硬编码问题
This commit is contained in:
@@ -3,11 +3,11 @@
|
||||
<view class="cf-container color-line-border">
|
||||
<view class="tab">
|
||||
<view @click="changeSort(1)"><text
|
||||
:class="sort == 1 ? 'color-base-text active color-base-border-bottom' : ''">全部</text></view>
|
||||
:class="sort == 1 ? 'color-base-text active color-base-border-bottom' : ''">{{ $lang('tabAll') }}</text></view>
|
||||
<view @click="changeSort(2, 'reward')"><text
|
||||
:class="sort == 2 ? 'color-base-text active color-base-border-bottom' : ''">满减券</text></view>
|
||||
:class="sort == 2 ? 'color-base-text active color-base-border-bottom' : ''">{{ $lang('tabReward') }}</text></view>
|
||||
<view @click="changeSort(3, 'discount')"><text
|
||||
:class="sort == 3 ? 'color-base-text active color-base-border-bottom' : ''">折扣券</text></view>
|
||||
:class="sort == 3 ? 'color-base-text active color-base-border-bottom' : ''">{{ $lang('tabDiscount') }}</text></view>
|
||||
<!-- <view @click="changeSort(4, 'no_threshold')"><text :class="sort == 4 ? 'color-base-text active color-base-border-bottom' : ''">无门槛券</text></view> -->
|
||||
</view>
|
||||
</view>
|
||||
@@ -28,23 +28,22 @@
|
||||
</view>
|
||||
<view class="use_price price-font" v-else-if="item.type == 'discount'"
|
||||
:class="{ disabled: item.useState == 2 }">
|
||||
{{ parseFloat(item.discount) }}
|
||||
<text>折</text>
|
||||
{{ $lang('discountText', { discount: parseFloat(item.discount) }) }}
|
||||
</view>
|
||||
<view class="use_condition font-size-tag" v-if="item.at_least > 0"
|
||||
:class="{ disabled: item.useState == 2 }">满{{ item.at_least }}元可用</view>
|
||||
:class="{ disabled: item.useState == 2 }">{{ $lang('minSpendAvailable', { atLeast: item.at_least }) }}</view>
|
||||
<view class="use_condition font-size-tag" v-else
|
||||
:class="{ disabled: item.useState == 2 }">无门槛优惠券</view>
|
||||
:class="{ disabled: item.useState == 2 }">{{ $lang('noThresholdCoupon') }}</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="item-info">
|
||||
<view class="use_title">
|
||||
<view class="title">{{ item.coupon_name }}</view>
|
||||
<view class="max_price" v-if="item.goods_type == 2 || item.goods_type == 3"
|
||||
:class="{ disabled: item.useState == 2 }">指定商品</view>
|
||||
<view class="max_price" v-else :class="{ disabled: item.useState == 2 }">全场商品</view>
|
||||
:class="{ disabled: item.useState == 2 }">{{ $lang('specifiedGoods') }}</view>
|
||||
<view class="max_price" v-else :class="{ disabled: item.useState == 2 }">{{ $lang('allGoods') }}</view>
|
||||
<view class="max_price" v-if="item.discount_limit != '0.00'">
|
||||
(最大优惠{{ item.discount_limit }}元)
|
||||
{{ $lang('maxDiscount', { amount: item.discount_limit }) }}
|
||||
</view>
|
||||
<view class="max_price" :class="{ disabled: item.useState == 2 }">{{
|
||||
item.use_channel_name }}</view>
|
||||
@@ -53,21 +52,21 @@
|
||||
</view> -->
|
||||
</view>
|
||||
<view class="use_time" v-if="item.validity_type == 0">
|
||||
有效期:{{ $util.timeStampTurnTime(item.end_time) }}</view>
|
||||
{{ $lang('validPeriodDate', { date: $util.timeStampTurnTime(item.end_time) }) }}</view>
|
||||
<view class="use_time" v-else-if="item.validity_type == 1">
|
||||
有效期:领取之日起{{ item.fixed_term }}日内有效</view>
|
||||
<view class="use_time" v-else>有效期:长期有效</view>
|
||||
{{ $lang('validPeriodDays', { days: item.fixed_term }) }}</view>
|
||||
<view class="use_time" v-else>{{ $lang('validPeriodLong') }}</view>
|
||||
</view>
|
||||
<view class="item-btn">
|
||||
<view v-if="item.useState == 0" @click.stop="receiveCoupon(item, index)">领取</view>
|
||||
<view v-if="item.useState == 1" @click.stop="toGoodsList(item, index)">去使用</view>
|
||||
<view v-if="item.receivedType == 'out'" class="disabled">已抢光</view>
|
||||
<view v-if="item.receivedType == 'expire'" class="disabled">已过期</view>
|
||||
<view v-if="item.receivedType == 'limit'" class="disabled">已达上限</view>
|
||||
<view v-if="item.useState == 0" @click.stop="receiveCoupon(item, index)">{{ $lang('receive') }}</view>
|
||||
<view v-if="item.useState == 1" @click.stop="toGoodsList(item, index)">{{ $lang('useNow') }}</view>
|
||||
<view v-if="item.receivedType == 'out'" class="disabled">{{ $lang('soldOut') }}</view>
|
||||
<view v-if="item.receivedType == 'expire'" class="disabled">{{ $lang('expired') }}</view>
|
||||
<view v-if="item.receivedType == 'limit'" class="disabled">{{ $lang('limitReached') }}</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view v-if="list.length == 0"><ns-empty text="暂无可领取的优惠券" :isIndex="false"></ns-empty></view>
|
||||
<view v-if="list.length == 0"><ns-empty :text="$lang('emptyText')" :isIndex="false"></ns-empty></view>
|
||||
</block>
|
||||
</mescroll-uni>
|
||||
<loading-cover ref="loadingCover"></loading-cover>
|
||||
@@ -99,7 +98,7 @@ export default {
|
||||
setTimeout(() => {
|
||||
if (!this.addonIsExist.coupon) {
|
||||
this.$util.showToast({
|
||||
title: '商家未开启优惠券',
|
||||
title: this.$lang('merchantNotEnabled'),
|
||||
mask: true,
|
||||
duration: 2000
|
||||
});
|
||||
@@ -173,7 +172,7 @@ export default {
|
||||
},
|
||||
success: res => {
|
||||
this.couponBtnSwitch = false;
|
||||
let msg = '领取成功,快去使用吧';
|
||||
let msg = this.$lang('receiveSuccess');
|
||||
let list = this.list;
|
||||
if (res.code < 0) msg = res.message;
|
||||
|
||||
|
||||
@@ -7,24 +7,24 @@
|
||||
<view class="get-coupon">
|
||||
<text class="coupon-name">{{ info.coupon_name }}</text>
|
||||
<view class="color-base-text coupon-price" v-if="info.type == 'reward'">¥{{ info.money }}</view>
|
||||
<view class="color-base-text coupon-price" v-else-if="info.type == 'discount'">{{ info.discount }}折</view>
|
||||
<text v-if="info.at_least > 0" class="color-tip">满{{ info.at_least }}元使用</text>
|
||||
<text v-else class="color-tip">无门槛优惠券</text>
|
||||
<view v-if="info.validity_type == 0" class="color-tip">有效期至 {{ $util.timeStampTurnTime(info.end_time) }}</view>
|
||||
<view v-else-if="info.validity_type == 1" class="color-tip">领取之日起{{ info.fixed_term }}天内有效</view>
|
||||
<view v-else class="color-tip">长期有效</view>
|
||||
<view class="color-base-text coupon-price" v-else-if="info.type == 'discount'">{{ $lang('discountText', { discount: info.discount }) }}</view>
|
||||
<text v-if="info.at_least > 0" class="color-tip">{{ $lang('minSpendUsage', { atLeast: info.at_least }) }}</text>
|
||||
<text v-else class="color-tip">{{ $lang('noThresholdCoupon') }}</text>
|
||||
<view v-if="info.validity_type == 0" class="color-tip">{{ $lang('validUntil', { endTime: $util.timeStampTurnTime(info.end_time) }) }}</view>
|
||||
<view v-else-if="info.validity_type == 1" class="color-tip">{{ $lang('validDaysAfterReceive', { fixedTerm: info.fixed_term }) }}</view>
|
||||
<view v-else class="color-tip">{{ $lang('longTermValid') }}</view>
|
||||
<!-- 适用场景: -->
|
||||
<view class="color-tip truncate" v-if="info.use_channel!='all'">{{ info.use_channel_name }}</view>
|
||||
<!-- 适用门店: -->
|
||||
<view v-if="info.use_channel!='online' &&info.use_store!='all'" class="color-tip">
|
||||
<view class="w-460 truncate">适用门店:{{ info.use_store_name}}</view>
|
||||
<view class="w-460 truncate">{{ $lang('applicableStores', { storeName: info.use_store_name }) }}</view>
|
||||
</view>
|
||||
<view class="get-span" @click="receiveGoodsCoupon(info.coupon_type_id)">
|
||||
<button type="primary" v-if="isCanReceive">{{ button }}</button>
|
||||
<button type="primary" disabled v-if="!isCanReceive">{{ button }}</button>
|
||||
</view>
|
||||
|
||||
<view class="color-tip font-size-goods-tag tips">注:扫描二维码或点击右上角进行分享</view>
|
||||
<view class="color-tip font-size-goods-tag tips">{{ $lang('scanShareTip') }}</view>
|
||||
</view>
|
||||
</view>
|
||||
<loading-cover ref="loadingCover"></loading-cover>
|
||||
@@ -42,7 +42,7 @@
|
||||
info: {},
|
||||
couponTypeId: 0,
|
||||
path: '',
|
||||
button: '领取',
|
||||
button: '',
|
||||
uid: 0,
|
||||
couponBtnSwitch: false, //获取优惠券防止重复提交
|
||||
receivedNum: 0,
|
||||
@@ -50,10 +50,11 @@
|
||||
};
|
||||
},
|
||||
onLoad(data) {
|
||||
this.button = this.$lang('receive');
|
||||
setTimeout( () => {
|
||||
if (!this.addonIsExist.coupon) {
|
||||
this.$util.showToast({
|
||||
title: '商家未开启优惠券',
|
||||
title: this.$lang('merchantNotEnabled'),
|
||||
mask: true,
|
||||
duration: 2000
|
||||
});
|
||||
@@ -152,7 +153,7 @@
|
||||
let msg = res.message;
|
||||
this.receivedType = data.type;
|
||||
if (res.code == 0) {
|
||||
msg = '领取成功';
|
||||
msg = this.$lang('receiveSuccess');
|
||||
this.receivedNum += 1;
|
||||
}
|
||||
this.buttonRefresh();
|
||||
@@ -181,18 +182,18 @@
|
||||
});
|
||||
},
|
||||
buttonRefresh() {
|
||||
this.button = '领取';
|
||||
this.button = this.$lang('receive');
|
||||
if (this.info.count <= this.info.lead_count || this.receivedType == 'out') {
|
||||
this.button = '来迟了该优惠券已被领取完了!';
|
||||
this.button = this.$lang('couponSoldOut');
|
||||
}
|
||||
if (this.info.status == 2 || this.receivedType == 'expire') {
|
||||
this.button = '该优惠券活动已结束!';
|
||||
this.button = this.$lang('activityEnded');
|
||||
}
|
||||
if (this.info.status == 3) {
|
||||
this.button = '该优惠券活动已关闭';
|
||||
this.button = this.$lang('activityClosed');
|
||||
}
|
||||
if (this.receivedType == 'limit'){
|
||||
this.button = '该优惠券领取已达到上限!';
|
||||
this.button = this.$lang('receiveLimitReached');
|
||||
}
|
||||
},
|
||||
/**
|
||||
@@ -204,14 +205,14 @@
|
||||
|
||||
var title = '';
|
||||
if (this.info.type == 'reward') {
|
||||
title = '恭喜您获得一张' + this.info.money + '元的优惠券';
|
||||
title = this.$lang('congratsMoneyCoupon', { money: this.info.money });
|
||||
} else if (this.info.type == 'discount') {
|
||||
title = '恭喜您获得一张' + this.info.discount + '折优惠券';
|
||||
title = this.$lang('congratsDiscountCoupon', { discount: this.info.discount });
|
||||
}
|
||||
if (this.info.at_least > 0) {
|
||||
var desc = `满${this.info.at_least}元可用`;
|
||||
var desc = this.$lang('minSpendAvailable', { atLeast: this.info.at_least });
|
||||
} else {
|
||||
var desc = `无门槛优惠券`;
|
||||
var desc = this.$lang('noThresholdCoupon');
|
||||
}
|
||||
this.$util.setPublicShare({
|
||||
title: title,
|
||||
@@ -239,14 +240,14 @@
|
||||
onShareAppMessage(res) {
|
||||
var title = '';
|
||||
if (this.info.type == 'reward') {
|
||||
title = '恭喜您获得一张' + this.info.money + '元的优惠券';
|
||||
title = this.$lang('congratsMoneyCoupon', { money: this.info.money });
|
||||
} else if (this.info.type == 'discount') {
|
||||
title = '恭喜您获得一张' + this.info.discount + '折优惠券';
|
||||
title = this.$lang('congratsDiscountCoupon', { discount: this.info.discount });
|
||||
}
|
||||
if (this.info.at_least > 0) {
|
||||
title += `,满${this.info.at_least}元可用`;
|
||||
title += ',' + this.$lang('minSpendAvailable', { atLeast: this.info.at_least });
|
||||
} else {
|
||||
title += `,无门槛优惠券`;
|
||||
title += ',' + this.$lang('noThresholdCoupon');
|
||||
}
|
||||
var path = '/pages_tool/goods/coupon_receive?coupon_type_id=' + this.couponTypeId;
|
||||
if (this.memberInfo && this.memberInfo.member_id) path += '&source_member=' + this.memberInfo.member_id;
|
||||
|
||||
Reference in New Issue
Block a user