i18n: replace hardcoded strings with language translations
批量将项目中多处硬编码的文本替换为多语言翻译条目,统一项目文案管理,提升多语言适配效率,包括导航提示、操作反馈、空状态提示、表单占位符等各类文本内容。
This commit is contained in:
@@ -93,7 +93,7 @@
|
||||
</view>
|
||||
</block>
|
||||
<block v-if="list.length == 0 && emptyShow">
|
||||
<ns-empty text="暂无数据" :isIndex="false"></ns-empty>
|
||||
<ns-empty :text="$lang('fenxiao.emptyData')" :isIndex="false"></ns-empty>
|
||||
</block>
|
||||
</view>
|
||||
</mescroll-uni>
|
||||
|
||||
@@ -61,7 +61,7 @@
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="cart-empty"><ns-empty text="暂无订单" :isIndex="false"
|
||||
<view class="cart-empty"><ns-empty :text="$lang('fenxiao.emptyOrder')" :isIndex="false"
|
||||
v-if="orderList.length == 0 && emptyShow"></ns-empty></view>
|
||||
</view>
|
||||
</mescroll-uni>
|
||||
|
||||
@@ -72,7 +72,7 @@
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<block v-if="teamList.length == 0 && emptyShow"><ns-empty text="暂无数据" :isIndex="false"></ns-empty>
|
||||
<block v-if="teamList.length == 0 && emptyShow"><ns-empty :text="$lang('fenxiao.emptyData')" :isIndex="false"></ns-empty>
|
||||
</block>
|
||||
</block>
|
||||
</mescroll-uni>
|
||||
@@ -89,11 +89,11 @@ export default {
|
||||
return {
|
||||
levelList: [
|
||||
{
|
||||
name: '一级',
|
||||
name: this.$lang('fenxiao.firstLevel'),
|
||||
level: 1
|
||||
},
|
||||
{
|
||||
name: '二级',
|
||||
name: this.$lang('fenxiao.secondLevel'),
|
||||
level: 2
|
||||
}
|
||||
],
|
||||
@@ -108,7 +108,7 @@ export default {
|
||||
setTimeout(() => {
|
||||
if (!this.addonIsExist.fenxiao) {
|
||||
this.$util.showToast({
|
||||
title: '商家未开启分销',
|
||||
title: this.$lang('fenxiao.merchantNotOpenFenxiao'),
|
||||
mask: true,
|
||||
duration: 2000
|
||||
});
|
||||
|
||||
@@ -175,7 +175,7 @@
|
||||
verify() {
|
||||
if (this.withdrawMoney == '' || this.withdrawMoney < 0 || isNaN(parseFloat(this.withdrawMoney))) {
|
||||
this.$util.showToast({
|
||||
title: '请输入提现金额'
|
||||
title: this.$lang('fenxiao.inputWithdrawAmount')
|
||||
});
|
||||
return false;
|
||||
}
|
||||
@@ -186,14 +186,14 @@
|
||||
}
|
||||
if (parseFloat(this.withdrawMoney) > 0 && (parseFloat(this.withdrawMoney) > parseFloat(money))) {
|
||||
this.$util.showToast({
|
||||
title: '提现金额超出可提现金额'
|
||||
title: this.$lang('fenxiao.withdrawAmountExceed')
|
||||
});
|
||||
return false;
|
||||
}
|
||||
if (parseFloat(this.withdrawMoney) > 0 && (parseFloat(this.withdrawMoney) < parseFloat(this
|
||||
.withdrawConfigInfo.withdraw))) {
|
||||
this.$util.showToast({
|
||||
title: '提现金额小于最低提现金额'
|
||||
title: this.$lang('fenxiao.withdrawAmountBelowMin')
|
||||
});
|
||||
return false;
|
||||
}
|
||||
@@ -202,7 +202,7 @@
|
||||
withdraw() {
|
||||
if (!this.bankAccountInfo.withdraw_type && !this.isBalance) {
|
||||
this.$util.showToast({
|
||||
title: '请先添加提现方式'
|
||||
title: this.$lang('fenxiao.pleaseAddWithdrawMethod')
|
||||
});
|
||||
return;
|
||||
}
|
||||
@@ -235,7 +235,7 @@
|
||||
success: res => {
|
||||
if (res.code >= 0) {
|
||||
this.$util.showToast({
|
||||
title: '提现申请成功'
|
||||
title: this.$lang('fenxiao.withdrawApplySuccess')
|
||||
});
|
||||
setTimeout(() => {
|
||||
this.$util.redirectTo('/pages_promotion/fenxiao/withdraw_list', {},
|
||||
@@ -270,7 +270,7 @@
|
||||
success: res => {
|
||||
if (res.code >= 0) {
|
||||
this.$util.showToast({
|
||||
title: '提现申请成功'
|
||||
title: this.$lang('fenxiao.withdrawApplySuccess')
|
||||
});
|
||||
setTimeout(() => {
|
||||
this.$util.redirectTo('/pages_promotion/fenxiao/withdraw_list', {},
|
||||
|
||||
@@ -8,9 +8,9 @@
|
||||
<view class="detailed-item" v-for="(item, index) in withdrawList" :key="index"
|
||||
@click="toDetail(item.id)">
|
||||
<view class="info">
|
||||
<view class="event">{{ item.transfer_type == 'balance' && '余额' ||
|
||||
item.transfer_type == 'alipay' && '支付宝' || item.transfer_type == 'bank' && '银行卡' ||
|
||||
item.transfer_type =='wechatpay'&&'微信' }}</view>
|
||||
<view class="event">{{ item.transfer_type == 'balance' ? $lang('fenxiao.balance') :
|
||||
item.transfer_type == 'alipay' ? $lang('fenxiao.alipay') : item.transfer_type == 'bank' ? $lang('fenxiao.bankCard') :
|
||||
item.transfer_type =='wechatpay' ? $lang('fenxiao.wechat') : '' }}</view>
|
||||
<view>
|
||||
<text class="time">{{ $util.timeStampTurnTime(item.create_time) }}</text>
|
||||
</view>
|
||||
@@ -25,7 +25,7 @@
|
||||
</view>
|
||||
</block>
|
||||
<block v-else>
|
||||
<ns-empty :isIndex="false" text="暂无提现记录"></ns-empty>
|
||||
<ns-empty :isIndex="false" :text="$lang('fenxiao.emptyWithdrawRecord')"></ns-empty>
|
||||
</block>
|
||||
</view>
|
||||
</mescroll-uni>
|
||||
@@ -42,19 +42,19 @@ export default {
|
||||
withdrawState: {
|
||||
'3': {
|
||||
color: 'color: rgb(255, 69, 68)',
|
||||
text: '已转账'
|
||||
text: this.$lang('fenxiao.transferred')
|
||||
},
|
||||
'1': {
|
||||
color: 'color: rgb(255, 160, 68)',
|
||||
text: '待审核'
|
||||
text: this.$lang('fenxiao.pendingAudit')
|
||||
},
|
||||
'2': {
|
||||
color: 'color: rgb(17, 189, 100)',
|
||||
text: '已审核'
|
||||
text: this.$lang('fenxiao.audited')
|
||||
},
|
||||
'-1': {
|
||||
color: 'color: rgb(255, 69, 68)',
|
||||
text: '已拒绝'
|
||||
text: this.$lang('fenxiao.rejected')
|
||||
}
|
||||
},
|
||||
withdrawList: [],
|
||||
@@ -65,7 +65,7 @@ export default {
|
||||
setTimeout(() => {
|
||||
if (!this.addonIsExist.fenxiao) {
|
||||
this.$util.showToast({
|
||||
title: '商家未开启分销',
|
||||
title: this.$lang('fenxiao.merchantNotOpenFenxiao'),
|
||||
mask: true,
|
||||
duration: 2000
|
||||
});
|
||||
|
||||
@@ -258,7 +258,7 @@
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view v-if="goodsList.length == 0 && emptyShow"><ns-empty text="暂无商品"></ns-empty></view>
|
||||
<view v-if="goodsList.length == 0 && emptyShow"><ns-empty :text="$lang('merch.emptyGoods')"></ns-empty></view>
|
||||
</block>
|
||||
</mescroll-uni>
|
||||
|
||||
|
||||
@@ -123,14 +123,14 @@ export default {
|
||||
if (this.goodsData.id) {
|
||||
this.isAWait = true;
|
||||
uni.setNavigationBarTitle({
|
||||
title: '编辑商品'
|
||||
title: this.$lang('merch.editGoods')
|
||||
});
|
||||
await this.editGetGoodsInfo();
|
||||
} else {
|
||||
|
||||
this.isAWait = false;
|
||||
uni.setNavigationBarTitle({
|
||||
title: '添加商品'
|
||||
title: this.$lang('merch.addGoods')
|
||||
});
|
||||
}
|
||||
|
||||
@@ -167,7 +167,7 @@ export default {
|
||||
if(res.result.detail){
|
||||
this.goodsData = res.result.detail
|
||||
this.$util.showToast({
|
||||
title: '商品不存在',
|
||||
title: this.$lang('merch.goodsNotExist'),
|
||||
});
|
||||
setTimeout(() => {
|
||||
this.$util.redirectTo('/pages_goods/list', {}, 'redirectTo');
|
||||
@@ -265,7 +265,7 @@ export default {
|
||||
this.$forceUpdate();
|
||||
} else {
|
||||
this.$util.showToast({
|
||||
title: '商品不存在',
|
||||
title: this.$lang('merch.goodsNotExist'),
|
||||
});
|
||||
setTimeout(() => {
|
||||
this.$util.redirectTo('/pages_goods/list', {}, 'redirectTo');
|
||||
@@ -493,7 +493,7 @@ export default {
|
||||
addShopCategory() {
|
||||
if (this.shopCategoryNumber == 10) {
|
||||
this.$util.showToast({
|
||||
title: '商品可以属于多个分类,最多10个'
|
||||
title: this.$lang('merch.maxCategoryLimit')
|
||||
});
|
||||
return;
|
||||
}
|
||||
@@ -568,21 +568,21 @@ export default {
|
||||
|
||||
if (this.goodsData.goodsname.length == 0) {
|
||||
this.$util.showToast({
|
||||
title: '请输入商品名称'
|
||||
title: this.$lang('merch.inputGoodsName')
|
||||
});
|
||||
return false;
|
||||
}
|
||||
|
||||
if (this.goodsData.subtitle.length > 100) {
|
||||
this.$util.showToast({
|
||||
title: '商品简介不能超过100个字符'
|
||||
title: this.$lang('merch.subtitleMaxLength')
|
||||
});
|
||||
return false;
|
||||
}
|
||||
|
||||
if (this.goodsData.goods_image.length == 0) {
|
||||
this.$util.showToast({
|
||||
title: '请上传商品图片'
|
||||
title: this.$lang('merch.uploadGoodsImage')
|
||||
});
|
||||
return false;
|
||||
}
|
||||
@@ -632,7 +632,7 @@ export default {
|
||||
if (this.goodsData.price == 0) {
|
||||
|
||||
this.$util.showToast({
|
||||
title: '请输入销售价'
|
||||
title: this.$lang('merch.inputPrice')
|
||||
});
|
||||
return false;
|
||||
}
|
||||
@@ -655,26 +655,26 @@ export default {
|
||||
// 总库存
|
||||
if (this.goodsData.total == 0) {
|
||||
this.$util.showToast({
|
||||
title: '请输入库存'
|
||||
title: this.$lang('merch.inputStock')
|
||||
});
|
||||
return false;
|
||||
}
|
||||
|
||||
if (isNaN(this.goodsData.total) || !this.$util.data().regExp.number.test(this.goodsData.total)) {
|
||||
this.$util.showToast({
|
||||
title: '[库存]格式输入错误'
|
||||
title: this.$lang('merch.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('merch.startCountFormatError')
|
||||
});
|
||||
return false;
|
||||
}
|
||||
if (this.goodsData.goods_start_count < 0) {
|
||||
this.$util.showToast({
|
||||
title: '起售数量不能小于0'
|
||||
title: this.$lang('merch.startCountNotNegative')
|
||||
});
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -76,8 +76,8 @@ export default {
|
||||
this.getMerch()
|
||||
}else{
|
||||
uni.showModal({
|
||||
title:'提示',
|
||||
content:'商家不存在',
|
||||
title: this.$lang('common.tip'),
|
||||
content: this.$lang('merch.merchantNotExist'),
|
||||
showCancel:false,
|
||||
success(e){
|
||||
uni.navigateBack({})
|
||||
@@ -120,7 +120,7 @@ export default {
|
||||
* 转发分享
|
||||
*/
|
||||
onShareAppMessage(res) {
|
||||
var title = '搜索到' + this.count + '件“' + this.keyword + this.category_title + this.coupon_name + '”相关的优质商品';
|
||||
var title = this.$lang('merch.searchResultCount', { count: this.count, keyword: this.keyword + this.category_title + this.coupon_name });'”相关的优质商品';
|
||||
let route = this.$util.getCurrentShareRoute(this.memberInfo ? this.memberInfo.member_id : 0);
|
||||
var path = route.path;
|
||||
return {
|
||||
@@ -134,7 +134,7 @@ export default {
|
||||
},
|
||||
// 分享到微信朋友圈
|
||||
onShareTimeline() {
|
||||
var title = '搜索到' + this.count + '件“' + this.keyword + this.category_title + this.coupon_name + '”相关的优质商品';
|
||||
var title = this.$lang('merch.searchResultCount', { count: this.count, keyword: this.keyword + this.category_title + this.coupon_name });'”相关的优质商品';
|
||||
let route = this.$util.getCurrentShareRoute(this.memberInfo ? this.memberInfo.member_id : 0);
|
||||
var query = route.query;
|
||||
return {
|
||||
@@ -144,18 +144,18 @@ export default {
|
||||
};
|
||||
},
|
||||
methods: {
|
||||
getMerch(){
|
||||
this.$api.sendRequest({
|
||||
url: '/merch/api/merch/merchinfo',
|
||||
data: {
|
||||
merch_id: this.merch_id
|
||||
},
|
||||
success: res => {
|
||||
if (res.code >= 0 && res.data) {
|
||||
this.merch = res.data;
|
||||
}
|
||||
}
|
||||
});
|
||||
getMerch(){
|
||||
this.$api.sendRequest({
|
||||
url: '/merch/api/merch/merchinfo',
|
||||
data: {
|
||||
merch_id: this.merch_id
|
||||
},
|
||||
success: res => {
|
||||
if (res.code >= 0 && res.data) {
|
||||
this.merch = res.data;
|
||||
}
|
||||
}
|
||||
});
|
||||
},
|
||||
/**
|
||||
* 获取优惠券数据
|
||||
@@ -336,26 +336,26 @@ export default {
|
||||
// }
|
||||
if (!Number(this.maxPrice) && this.maxPrice) {
|
||||
this.$util.showToast({
|
||||
title: '请输入最高价'
|
||||
title: this.$lang('merch.inputMaxPrice')
|
||||
});
|
||||
return;
|
||||
}
|
||||
if (Number(this.minPrice) < 0 || Number(this.maxPrice) < 0) {
|
||||
this.$util.showToast({
|
||||
title: '筛选价格不能小于0'
|
||||
title: this.$lang('merch.priceNotNegative')
|
||||
});
|
||||
return;
|
||||
}
|
||||
if (this.minPrice != '' && Number(this.minPrice) > Number(this.maxPrice) && this.maxPrice) {
|
||||
|
||||
this.$util.showToast({
|
||||
title: '最低价不能大于最高价'
|
||||
title: this.$lang('merch.minNotGreaterMax')
|
||||
});
|
||||
return;
|
||||
}
|
||||
if (this.maxPrice != '' && Number(this.maxPrice) < Number(this.minPrice)) {
|
||||
this.$util.showToast({
|
||||
title: '最高价不能小于最低价'
|
||||
title: this.$lang('merch.maxNotLessMin')
|
||||
});
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -293,7 +293,7 @@ export default {
|
||||
imageUrl = this.pointInfo.image;
|
||||
break;
|
||||
}
|
||||
title = '仅需' + this.pointInfo.point + '积分即可兑换' + title;
|
||||
title = this.$lang('point.exchangeWithPoints', { points: this.pointInfo.point }) + title;
|
||||
imageUrl = this.$util.img(imageUrl);
|
||||
var route = this.$util.getCurrentShareRoute(this.memberInfo ? this.memberInfo.member_id : 0);
|
||||
var path = route.path;
|
||||
@@ -322,7 +322,7 @@ export default {
|
||||
imageUrl = this.pointInfo.image;
|
||||
break;
|
||||
}
|
||||
title = '仅需' + this.pointInfo.point + '积分即可兑换' + title;
|
||||
title = this.$lang('point.exchangeWithPoints', { points: this.pointInfo.point }) + title;
|
||||
imageUrl = this.$util.img(imageUrl);
|
||||
var route = this.$util.getCurrentShareRoute(this.memberInfo ? this.memberInfo.member_id : 0);
|
||||
var query = route.query;
|
||||
|
||||
@@ -285,26 +285,26 @@ export default {
|
||||
// }
|
||||
if (!Number(this.maxPoint) && this.maxPoint) {
|
||||
this.$util.showToast({
|
||||
title: this.isEnEnv ? 'Please enter the maximum price' : '请输入最高价'
|
||||
title: this.isEnEnv ? 'Please enter the maximum price' : this.$lang('point.inputMaxPrice')
|
||||
});
|
||||
return;
|
||||
}
|
||||
if (Number(this.minPoint) < 0 || Number(this.maxPoint) < 0) {
|
||||
this.$util.showToast({
|
||||
title: this.isEnEnv ? 'Filter price cannot be less than 0' : '筛选价格不能小于0'
|
||||
title: this.isEnEnv ? 'Filter price cannot be less than 0' : this.$lang('point.priceNotNegative')
|
||||
});
|
||||
return;
|
||||
}
|
||||
if (this.minPoint != '' && Number(this.minPoint) > Number(this.maxPoint) && this.maxPoint) {
|
||||
|
||||
this.$util.showToast({
|
||||
title: this.isEnEnv ? 'Minimum price cannot be greater than maximum price' : '最低价不能大于最高价'
|
||||
title: this.isEnEnv ? 'Minimum price cannot be greater than maximum price' : this.$lang('point.minNotGreaterMax')
|
||||
});
|
||||
return;
|
||||
}
|
||||
if (this.maxPoint != '' && Number(this.maxPoint) < Number(this.minPoint)) {
|
||||
this.$util.showToast({
|
||||
title: this.isEnEnv ? 'Maximum price cannot be less than minimum price' : '最高价不能小于最低价'
|
||||
title: this.isEnEnv ? 'Maximum price cannot be less than minimum price' : this.$lang('point.maxNotLessMin')
|
||||
});
|
||||
return;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user