feat: 新增多语言文案与组件国际化适配
本次提交完成了大量多语言相关的新增与优化工作: 1. 新增充值、案例、会员资产、订单等页面的中文/英文翻译文案 2. 新增企业微信客服、时间选择、支付弹窗等组件的多语言包 3. 优化工具函数与自定义页面的多语言适配,替换硬编码提示文案 4. 新增会员等级规则、积分商品、退款管理等页面的国际化支持 5. 修复企业微信JS-SDK的错误提示文案硬编码问题
This commit is contained in:
@@ -53,57 +53,57 @@ export default {
|
||||
begin_time:'',//团购开始时间
|
||||
end_time:''//团购结束时间
|
||||
},
|
||||
groundingArray: ['下架', '上架'],
|
||||
groundingArray: [this.$lang('grounding.offShelf'), this.$lang('grounding.onShelf')],
|
||||
|
||||
pickuptypeArray: ['当日达', '次日达', '隔日达'],//, '自定义'
|
||||
pickuptypeArray: [this.$lang('pickupType.sameDay'), this.$lang('pickupType.nextDay'), this.$lang('pickupType.dayAfter')],//, '自定义'
|
||||
|
||||
|
||||
currCategory: 0, // 当前所设置的商品分类
|
||||
virtualDeliverArray: [{
|
||||
name: '自动发货',
|
||||
value: 'auto_deliver',
|
||||
},
|
||||
{
|
||||
name: '手动发货',
|
||||
value: 'artificial_deliver',
|
||||
},
|
||||
{
|
||||
name: '到店核销',
|
||||
value: 'verify',
|
||||
}
|
||||
],
|
||||
virtualDeliverValue: {
|
||||
'auto_deliver': '自动发货',
|
||||
'artificial_deliver': '手动发货',
|
||||
'verify': '到店核销'
|
||||
},
|
||||
virtualReceiveArray: [{
|
||||
name: '自动收货',
|
||||
value: 'auto_receive',
|
||||
},
|
||||
{
|
||||
name: '买家确认收货',
|
||||
value: 'artificial_receive',
|
||||
},
|
||||
],
|
||||
virtualReceiveValue: {
|
||||
'auto_receive': '自动收货',
|
||||
'artificial_receive': '买家确认收货',
|
||||
},
|
||||
validityTypeArray: ['永久', '购买后几日有效', '指定过期日期'],
|
||||
virtualDeliverArray: [{
|
||||
name: this.$lang('virtualDeliver.auto'),
|
||||
value: 'auto_deliver',
|
||||
},
|
||||
{
|
||||
name: this.$lang('virtualDeliver.manual'),
|
||||
value: 'artificial_deliver',
|
||||
},
|
||||
{
|
||||
name: this.$lang('virtualDeliver.verify'),
|
||||
value: 'verify',
|
||||
}
|
||||
],
|
||||
virtualDeliverValue: {
|
||||
'auto_deliver': this.$lang('virtualDeliver.auto'),
|
||||
'artificial_deliver': this.$lang('virtualDeliver.manual'),
|
||||
'verify': this.$lang('virtualDeliver.verify')
|
||||
},
|
||||
virtualReceiveArray: [{
|
||||
name: this.$lang('virtualReceive.auto'),
|
||||
value: 'auto_receive',
|
||||
},
|
||||
{
|
||||
name: this.$lang('virtualReceive.buyerConfirm'),
|
||||
value: 'artificial_receive',
|
||||
},
|
||||
],
|
||||
virtualReceiveValue: {
|
||||
'auto_receive': this.$lang('virtualReceive.auto'),
|
||||
'artificial_receive': this.$lang('virtualReceive.buyerConfirm'),
|
||||
},
|
||||
validityTypeArray: [this.$lang('validityType.permanent'), this.$lang('validityType.daysAfterPurchase'), this.$lang('validityType.specifiedDate')],
|
||||
virtualIndate: 0,
|
||||
minDate: '',
|
||||
carmiLength: '添加卡密',
|
||||
limitLength: [ //限购
|
||||
{
|
||||
name: '单次限购',
|
||||
value: '1'
|
||||
},
|
||||
{
|
||||
name: '长期限购',
|
||||
value: '2'
|
||||
}
|
||||
],
|
||||
carmiLength: this.$lang('carmi.add'),
|
||||
limitLength: [ //限购
|
||||
{
|
||||
name: this.$lang('limitType.single'),
|
||||
value: '1'
|
||||
},
|
||||
{
|
||||
name: this.$lang('limitType.longTerm'),
|
||||
value: '2'
|
||||
}
|
||||
],
|
||||
current: 0,
|
||||
goodsFormArray: [],
|
||||
goodsForm: [],
|
||||
@@ -163,7 +163,7 @@ export default {
|
||||
if(res.result.detail){
|
||||
this.goodsData = res.result.detail
|
||||
this.$util.showToast({
|
||||
title: '商品不存在',
|
||||
title: this.$lang('message.goodsNotExist'),
|
||||
});
|
||||
setTimeout(() => {
|
||||
this.$util.redirectTo('/pages_goods/list', {}, 'redirectTo');
|
||||
@@ -489,7 +489,7 @@ export default {
|
||||
addShopCategory() {
|
||||
if (this.shopCategoryNumber == 10) {
|
||||
this.$util.showToast({
|
||||
title: '商品可以属于多个分类,最多10个'
|
||||
title: this.$lang('message.maxCategory')
|
||||
});
|
||||
return;
|
||||
}
|
||||
@@ -526,7 +526,7 @@ export default {
|
||||
|
||||
this.goodsData.carmichael = uni.getStorageSync('editGoodsCarmichael') ? JSON.parse(uni.getStorageSync('editGoodsCarmichael')) : [];
|
||||
if (this.goodsData.carmichael.length > 0) {
|
||||
this.carmiLength = '添加卡密【' + this.goodsData.carmichael.length + '】'
|
||||
this.carmiLength = this.$lang('carmi.addWithCount', { count: this.goodsData.carmichael.length })
|
||||
}
|
||||
}
|
||||
|
||||
@@ -564,21 +564,21 @@ export default {
|
||||
|
||||
if (this.goodsData.goodsname.length == 0) {
|
||||
this.$util.showToast({
|
||||
title: '请输入商品名称'
|
||||
title: this.$lang('message.pleaseEnterGoodsName')
|
||||
});
|
||||
return false;
|
||||
}
|
||||
|
||||
if (this.goodsData.subtitle.length > 100) {
|
||||
this.$util.showToast({
|
||||
title: '商品简介不能超过100个字符'
|
||||
title: this.$lang('message.subtitleMaxLength', { max: 100 })
|
||||
});
|
||||
return false;
|
||||
}
|
||||
|
||||
if (this.goodsData.goods_image.length == 0) {
|
||||
this.$util.showToast({
|
||||
title: '请上传商品图片'
|
||||
title: this.$lang('message.pleaseUploadGoodsImage')
|
||||
});
|
||||
return false;
|
||||
}
|
||||
@@ -628,20 +628,20 @@ export default {
|
||||
if (this.goodsData.price == 0) {
|
||||
|
||||
this.$util.showToast({
|
||||
title: '请输入销售价'
|
||||
title: this.$lang('message.pleaseEnterSalePrice')
|
||||
});
|
||||
return false;
|
||||
}
|
||||
if (isNaN(this.goodsData.price) || !this.$util.data().regExp.digit.test(this.goodsData.price)) {
|
||||
this.$util.showToast({
|
||||
title: '[销售价]格式输入错误'
|
||||
title: this.$lang('message.salePriceFormatError')
|
||||
});
|
||||
return false;
|
||||
}
|
||||
|
||||
if (this.goodsData.productprice.length > 0 && (isNaN(this.goodsData.productprice) || !this.$util.data().regExp.digit.test(this.goodsData.productprice))) {
|
||||
this.$util.showToast({
|
||||
title: '[原价价]格式输入错误'
|
||||
title: this.$lang('message.originalPriceFormatError')
|
||||
});
|
||||
return false;
|
||||
}
|
||||
@@ -651,26 +651,26 @@ export default {
|
||||
// 总库存
|
||||
if (this.goodsData.total == 0) {
|
||||
this.$util.showToast({
|
||||
title: '请输入库存'
|
||||
title: this.$lang('message.pleaseEnterStock')
|
||||
});
|
||||
return false;
|
||||
}
|
||||
|
||||
if (isNaN(this.goodsData.total) || !this.$util.data().regExp.number.test(this.goodsData.total)) {
|
||||
this.$util.showToast({
|
||||
title: '[库存]格式输入错误'
|
||||
title: this.$lang('message.stockFormatError')
|
||||
});
|
||||
return false;
|
||||
}
|
||||
if (isNaN(this.goodsData.goods_start_count) || !this.$util.data().regExp.number.test(this.goodsData.goods_start_count)) {
|
||||
this.$util.showToast({
|
||||
title: '[起售]格式输入错误'
|
||||
title: this.$lang('message.minOrderFormatError')
|
||||
});
|
||||
return false;
|
||||
}
|
||||
if (this.goodsData.goods_start_count < 0) {
|
||||
this.$util.showToast({
|
||||
title: '起售数量不能小于0'
|
||||
title: this.$lang('message.minOrderNotLessThanZero')
|
||||
});
|
||||
return false;
|
||||
}
|
||||
@@ -901,7 +901,7 @@ export default {
|
||||
getGoodsForm() {
|
||||
getOrderFormList().then(res=>{
|
||||
if (res.data) {
|
||||
let goodsForm = ['请选择商品表单'];
|
||||
let goodsForm = [this.$lang('placeholder.selectGoodsForm')];
|
||||
res.data.forEach((item, index) => {
|
||||
goodsForm.push(item.form_name);
|
||||
if (this.goodsData.form_id && this.goodsData.form_id == item.id) this.goodsData.goods_form_index = index + 1;
|
||||
@@ -922,7 +922,7 @@ export default {
|
||||
getSupplyList() {
|
||||
getSupplyList().then(res=>{
|
||||
if (res.data) {
|
||||
let supplyForm = ['请选择供应商'];
|
||||
let supplyForm = [this.$lang('placeholder.selectSupplier')];
|
||||
res.data.forEach((item, index) => {
|
||||
supplyForm.push(item.title);
|
||||
if (this.goodsData.supplier_id && this.goodsData.supplier_id == item.supplier_id) this.goodsData.supply_index = index + 1;
|
||||
|
||||
Reference in New Issue
Block a user