feat: 新增多语言文案与组件国际化适配
本次提交完成了大量多语言相关的新增与优化工作: 1. 新增充值、案例、会员资产、订单等页面的中文/英文翻译文案 2. 新增企业微信客服、时间选择、支付弹窗等组件的多语言包 3. 优化工具函数与自定义页面的多语言适配,替换硬编码提示文案 4. 新增会员等级规则、积分商品、退款管理等页面的国际化支持 5. 修复企业微信JS-SDK的错误提示文案硬编码问题
This commit is contained in:
@@ -299,7 +299,7 @@ export default {
|
||||
//生成海报
|
||||
getGoodsPoster() {
|
||||
uni.showLoading({
|
||||
'title': '海报生成中...'
|
||||
'title': this.$lang('detailView.posterGenerating')
|
||||
})
|
||||
//活动海报信息
|
||||
if (this.memberInfo && this.memberInfo.member_id) this.posterParams.source_member = this.memberInfo.member_id;
|
||||
@@ -365,12 +365,12 @@ export default {
|
||||
filePath: res.tempFilePath,
|
||||
success: () => {
|
||||
this.$util.showToast({
|
||||
title: "保存成功"
|
||||
title: this.$lang('detailView.saveSuccess')
|
||||
});
|
||||
},
|
||||
fail: (err) => {
|
||||
this.$util.showToast({
|
||||
title: "保存失败,请稍后重试"
|
||||
title: this.$lang('detailView.saveFailed')
|
||||
});
|
||||
}
|
||||
});
|
||||
@@ -378,7 +378,7 @@ export default {
|
||||
},
|
||||
fail: (err) => {
|
||||
this.$util.showToast({
|
||||
title: "保存失败,请稍后重试"
|
||||
title: this.$lang('detailView.saveFailed')
|
||||
});
|
||||
}
|
||||
});
|
||||
@@ -484,7 +484,7 @@ export default {
|
||||
onTapDoc(pdf_url) {
|
||||
if (!pdf_url) return;
|
||||
uni.showLoading({
|
||||
title: '正在加载'
|
||||
title: this.$lang('detailView.loading')
|
||||
});
|
||||
let url = this.$util.img(pdf_url);
|
||||
uni.downloadFile({
|
||||
@@ -510,7 +510,7 @@ export default {
|
||||
complete: (res) => {
|
||||
if (res.statusCode === 404) {
|
||||
uni.showToast({
|
||||
title: '文件不存在',
|
||||
title: this.$lang('detailView.fileNotExist'),
|
||||
icon: 'none'
|
||||
});
|
||||
}
|
||||
|
||||
@@ -72,7 +72,7 @@
|
||||
<text class="iconfont icon-right"></text>
|
||||
</block>
|
||||
<block v-else>
|
||||
<view class="box">未配置</view>
|
||||
<view class="box">{{ $lang('detailView.notConfigured') }}</view>
|
||||
</block>
|
||||
</view>
|
||||
|
||||
@@ -96,7 +96,7 @@
|
||||
|
||||
<view class="item service" @click="openMerchantsServicePopup()"
|
||||
v-if="goodsSkuDetail.goods_service.length">
|
||||
<view class="label">服务</view>
|
||||
<view class="label">{{ $lang('detailView.serviceLabel') }}</view>
|
||||
<view class="list-wrap">
|
||||
<view class="item-wrap" v-for="(item, index) in goodsSkuDetail.goods_service" :key="index"
|
||||
v-if="index < 3">
|
||||
@@ -140,7 +140,7 @@
|
||||
<view class="other-wrap">
|
||||
<view class="address" style="margin-left: 30rpx;">
|
||||
<view>{{ goodsSkuDetail.merchinfo.merch_name }}</view>
|
||||
<view style="font-size: 24rpx;color: #888;">官方认证商家,值得信赖!</view>
|
||||
<view style="font-size: 24rpx;color: #888;">{{ $lang('detailView.officialCertifiedMerchant') }}</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
@@ -153,7 +153,7 @@
|
||||
<uni-popup ref="deliveryType" type="bottom">
|
||||
<view class="deliverytype-popup-layer popup-layer">
|
||||
<view class="head-wrap" @click="$refs.deliveryType.close()">
|
||||
<text>配送</text>
|
||||
<text>{{ $lang('detailView.deliveryTitle') }}</text>
|
||||
<text class="iconfont icon-close"></text>
|
||||
</view>
|
||||
<scroll-view scroll-y class="type-body">
|
||||
@@ -177,7 +177,7 @@
|
||||
<uni-popup ref="merchantsServicePopup" type="bottom">
|
||||
<view class="goods-merchants-service-popup-layer popup-layer">
|
||||
<view class="head-wrap" @click="closeMerchantsServicePopup()">
|
||||
<text>商品服务</text>
|
||||
<text>{{ $lang('detailView.merchantsServiceTitle') }}</text>
|
||||
<text class="iconfont icon-close"></text>
|
||||
</view>
|
||||
<scroll-view scroll-y>
|
||||
@@ -199,7 +199,7 @@
|
||||
</view>
|
||||
</scroll-view>
|
||||
<view class="button-box">
|
||||
<button type="primary" @click="closeMerchantsServicePopup()">确定</button>
|
||||
<button type="primary" @click="closeMerchantsServicePopup()">{{ $lang('confirm') }}</button>
|
||||
</view>
|
||||
</view>
|
||||
</uni-popup>
|
||||
@@ -210,7 +210,7 @@
|
||||
<uni-popup ref="storeListPopup" type="bottom">
|
||||
<view class="goods-merchants-service-popup-layer popup-layer store-list-wrap">
|
||||
<view class="head-wrap" @click="closeStoreListPopup()">
|
||||
<text>门店列表</text>
|
||||
<text>{{ $lang('detailView.storeListTitle') }}</text>
|
||||
<text class="iconfont icon-close"></text>
|
||||
</view>
|
||||
<scroll-view scroll-y>
|
||||
@@ -226,11 +226,10 @@
|
||||
<view class="item-title">
|
||||
<text class="title">{{ item.store_name }}</text>
|
||||
<text class="distance color-base-text" v-if="item.distance">
|
||||
距离{{ item.distance > 1 ? item.distance + 'km' : item.distance *
|
||||
1000 + 'm' }}
|
||||
{{ $lang('detailView.distance', { distance: item.distance > 1 ? item.distance + 'km' : item.distance * 1000 + 'm' }) }}
|
||||
</text>
|
||||
</view>
|
||||
<view class="item-time" v-if="item.open_date">营业时间:{{ item.open_date }}
|
||||
<view class="item-time" v-if="item.open_date">{{ $lang('detailView.businessHours', { time: item.open_date }) }}
|
||||
</view>
|
||||
<view class="item-address">{{ item.full_address + item.address }}</view>
|
||||
</view>
|
||||
@@ -255,7 +254,7 @@
|
||||
<view class="community-txt">{{ goodsSkuDetail.qr_data.community_describe }}</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="community-btn" @click="onCommunity()">添加</view>
|
||||
<view class="community-btn" @click="onCommunity()">{{ $lang('detailView.addCommunity') }}</view>
|
||||
</view>
|
||||
|
||||
<!-- 促销 -->
|
||||
@@ -285,12 +284,12 @@
|
||||
<!-- <view class="tit" :class="{ active: goodsEvaluate.content }"> -->
|
||||
<view>
|
||||
<text class="color-title font-size-base">
|
||||
评价
|
||||
{{ $lang('detailView.evaluate') }}
|
||||
<text class="font-size-base">({{ evaluateCount }})</text>
|
||||
</text>
|
||||
<text class="evaluate-item-empty" v-if="!evaluateCount">暂无评价</text>
|
||||
<text class="evaluate-item-empty" v-if="!evaluateCount">{{ $lang('detailView.noEvaluate') }}</text>
|
||||
<view class="evaluate-item-empty" v-else>
|
||||
<text class="font-size-tag">查看全部</text>
|
||||
<text class="font-size-tag">{{ $lang('detailView.viewAll') }}</text>
|
||||
<text class="iconfont icon-right font-size-tag"></text>
|
||||
</view>
|
||||
</view>
|
||||
@@ -337,7 +336,7 @@
|
||||
<!-- 规格属性 -->
|
||||
<view class="goods-attr"
|
||||
v-if="goodsSkuDetail.goods_attr_format && goodsSkuDetail.goods_attr_format.length > 0">
|
||||
<view class="title">规格属性</view>
|
||||
<view class="title">{{ $lang('detailView.specAttrTitle') }}</view>
|
||||
<view class="attr-wrap">
|
||||
<block v-for="(item, index) in goodsSkuDetail.goods_attr_format" :key="index">
|
||||
<view class="item" v-if="goodsAttrShow || (!goodsAttrShow && index < 4)">
|
||||
@@ -348,10 +347,10 @@
|
||||
<view class="attr-action" v-if="goodsSkuDetail.goods_attr_format.length > 4"
|
||||
@click="switchGoodsAttr">
|
||||
<block v-if="!goodsAttrShow">
|
||||
展开<text class="iconfont icon-iconangledown"></text>
|
||||
{{ $lang('detailView.expand') }}<text class="iconfont icon-iconangledown"></text>
|
||||
</block>
|
||||
<block v-else>
|
||||
收起<text class="iconfont icon-iconangledown-copy"></text>
|
||||
{{ $lang('detailView.collapse') }}<text class="iconfont icon-iconangledown-copy"></text>
|
||||
</block>
|
||||
</view>
|
||||
</view>
|
||||
@@ -380,11 +379,11 @@
|
||||
<img class="iconfont icon-file" :src="$util.img('public/static/img/file/file-pdf.svg')" />
|
||||
</view>
|
||||
<view class="pdf-info">
|
||||
<text class="pdf-name">{{ goodsSkuDetail.pdf_name || '商品文档' }}</text>
|
||||
<text class="pdf-desc">点击查看文档详情</text>
|
||||
<text class="pdf-name">{{ goodsSkuDetail.pdf_name || $lang('detailView.defaultDocName') }}</text>
|
||||
<text class="pdf-desc">{{ $lang('detailView.viewDocDetail') }}</text>
|
||||
</view>
|
||||
<view class="pdf-btn">
|
||||
<text>查看</text>
|
||||
<text>{{ $lang('detailView.view') }}</text>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
@@ -420,10 +419,10 @@
|
||||
<view class="close iconfont icon-close" @click="closePosterPopup()"></view>
|
||||
</view>
|
||||
<!-- #ifdef MP || APP-PLUS -->
|
||||
<view class="save-btn" @click="saveGoodsPoster()">保存图片</view>
|
||||
<view class="save-btn" @click="saveGoodsPoster()">{{ $lang('detailView.saveImage') }}</view>
|
||||
<!-- #endif -->
|
||||
<!-- #ifdef H5 -->
|
||||
<view class="save-btn">长按图片进行保存</view>
|
||||
<view class="save-btn">{{ $lang('detailView.longPressToSave') }}</view>
|
||||
<!-- #endif -->
|
||||
</view>
|
||||
</template>
|
||||
@@ -434,13 +433,13 @@
|
||||
<view @touchmove.prevent.stop>
|
||||
<uni-popup ref="sharePopup" type="bottom" class="share-popup">
|
||||
<view>
|
||||
<view class="share-title">分享</view>
|
||||
<view class="share-title">{{ $lang('detailView.shareTitle') }}</view>
|
||||
<view class="share-content">
|
||||
<!-- #ifdef MP -->
|
||||
<view class="share-box">
|
||||
<button class="share-btn" :plain="true" open-type="share">
|
||||
<view class="iconfont icon-share-friend"></view>
|
||||
<text>分享给好友</text>
|
||||
<text>{{ $lang('detailView.shareToFriends') }}</text>
|
||||
</button>
|
||||
</view>
|
||||
<!-- #endif -->
|
||||
@@ -449,7 +448,7 @@
|
||||
<view class="share-box" v-if="goodsCircle">
|
||||
<button class="share-btn" :plain="true" @click="openBusinessView">
|
||||
<view class="iconfont icon-haowuquan"></view>
|
||||
<text>分享到好物圈</text>
|
||||
<text>{{ $lang('detailView.shareToGoodsCircle') }}</text>
|
||||
</button>
|
||||
</view>
|
||||
<!-- #endif -->
|
||||
@@ -457,19 +456,19 @@
|
||||
<view class="share-box" @click="openPosterPopup">
|
||||
<button class="share-btn" :plain="true">
|
||||
<view class="iconfont icon-pengyouquan"></view>
|
||||
<text>生成分享海报</text>
|
||||
<text>{{ $lang('detailView.generateSharePoster') }}</text>
|
||||
</button>
|
||||
</view>
|
||||
<!-- #ifdef H5 -->
|
||||
<view class="share-box" @click="copyUrl">
|
||||
<button class="share-btn" :plain="true">
|
||||
<view class="iconfont icon-fuzhilianjie"></view>
|
||||
<text>复制链接</text>
|
||||
<text>{{ $lang('detailView.copyLink') }}</text>
|
||||
</button>
|
||||
</view>
|
||||
<!-- #endif -->
|
||||
</view>
|
||||
<view class="share-footer" @click="closeSharePopup"><text>取消分享</text></view>
|
||||
<view class="share-footer" @click="closeSharePopup"><text>{{ $lang('detailView.cancelShare') }}</text></view>
|
||||
</view>
|
||||
</uni-popup>
|
||||
</view>
|
||||
|
||||
@@ -318,9 +318,9 @@ export default {
|
||||
|
||||
let list = this.couponList;
|
||||
if (res.data.is_exist == 1 && res.code < 0) {
|
||||
msg = '您已领取过该优惠券,快去使用吧';
|
||||
msg = this.$lang('couponAlreadyClaimed');
|
||||
} else if (res.code == 0) {
|
||||
msg = '领取成功,快去使用吧';
|
||||
msg = this.$lang('couponClaimSuccess');
|
||||
} else {
|
||||
msg = res.message;
|
||||
}
|
||||
@@ -362,7 +362,7 @@ export default {
|
||||
//获取满减信息
|
||||
getManjian(data) {
|
||||
this.manjian = data;
|
||||
let limit = data.type == 0 ? '元' : '件';
|
||||
let limit = data.type == 0 ? this.$lang('manjianUnitYuan') : this.$lang('manjianUnitPiece');
|
||||
Object.keys(data.rule_json).forEach((key) => {
|
||||
var item = data.rule_json[key];
|
||||
if (item.coupon_data) {
|
||||
@@ -373,41 +373,46 @@ export default {
|
||||
item.limit = data.type == 0 ? parseFloat(item.limit).toFixed(2) : parseInt(item.limit);
|
||||
// 满减
|
||||
if (item.discount_money != undefined) {
|
||||
let itemText = this.$lang('fullReductionItem', { limit: item.limit, unit: limit, money: item.discount_money });
|
||||
if (this.manjian.manjian == undefined) {
|
||||
this.manjian.manjian = '满' + item.limit + limit + '减' + item.discount_money + '元';
|
||||
this.manjian.manjian = itemText;
|
||||
} else {
|
||||
this.manjian.manjian += ';满' + item.limit + limit + '减' + item.discount_money + '元';
|
||||
this.manjian.manjian += this.$lang('manjianItemSeparator') + itemText;
|
||||
}
|
||||
}
|
||||
// 满送
|
||||
if (item.point != undefined || item.coupon != undefined) {
|
||||
let text = '';
|
||||
if (item.point != undefined) {
|
||||
text = '送' + item.point + '积分';
|
||||
text = this.$lang('fullGiftPoints', { point: item.point });
|
||||
}
|
||||
if (item.coupon != undefined && item.coupon_data != undefined) {
|
||||
item.coupon_data.forEach((couponItem, couponIndex) => {
|
||||
if (couponItem.type == 'discount') {
|
||||
if (text == '') text = '送' + item.coupon_num[couponIndex] + '张' + parseFloat(couponItem.discount) + '折优惠券';
|
||||
else text += '、送' + item.coupon_num[couponIndex] + '张' + parseFloat(couponItem.discount) + '折优惠券';
|
||||
let couponText = this.$lang('fullGiftDiscountCoupon', { count: item.coupon_num[couponIndex], discount: parseFloat(couponItem.discount) });
|
||||
if (text == '') text = couponText;
|
||||
else text += this.$lang('fullGiftConnector') + couponText;
|
||||
} else {
|
||||
if (text == '') text = '送' + item.coupon_num[couponIndex] + '张' + parseFloat(couponItem.money) + '元优惠券';
|
||||
else text += '、送' + item.coupon_num[couponIndex] + '张' + parseFloat(couponItem.money) + '元优惠券';
|
||||
let couponText = this.$lang('fullGiftMoneyCoupon', { count: item.coupon_num[couponIndex], money: parseFloat(couponItem.money) });
|
||||
if (text == '') text = couponText;
|
||||
else text += this.$lang('fullGiftConnector') + couponText;
|
||||
}
|
||||
})
|
||||
}
|
||||
let giftItemText = this.$lang('fullGiftItem', { limit: item.limit, unit: limit, gift: text });
|
||||
if (this.manjian.mansong == undefined) {
|
||||
this.manjian.mansong = '满' + item.limit + limit + text;
|
||||
this.manjian.mansong = giftItemText;
|
||||
} else {
|
||||
this.manjian.mansong += ';' + '满' + item.limit + limit + text;
|
||||
this.manjian.mansong += this.$lang('manjianItemSeparator') + giftItemText;
|
||||
}
|
||||
}
|
||||
// 包邮
|
||||
if (item.free_shipping != undefined) {
|
||||
let itemText = this.$lang('freeShippingItem', { limit: item.limit, unit: limit });
|
||||
if (this.manjian.free_shipping == undefined) {
|
||||
this.manjian.free_shipping = '满' + item.limit + limit + '包邮';
|
||||
this.manjian.free_shipping = itemText;
|
||||
} else {
|
||||
this.manjian.free_shipping += ';满' + item.limit + limit + '包邮';
|
||||
this.manjian.free_shipping += this.$lang('manjianItemSeparator') + itemText;
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user