refactor: 统一项目内国际化key的命名空间格式
本次提交对全项目的国际化调用进行了规范化重构:
1. 为中文/英文语言包新增了avatar和gender的别名映射,兼容旧有headImg/sex写法
2. 修正了lang.js中的注释路径错误
3. 将所有页面和组件内的$lang调用从短路径改为带业务模块前缀的完整命名空间路径,例如将$lang('title')改为$lang('article.list.title')
4. 优化了i18n-lazy.js的注释说明,补充了正确的key命名格式示例
5. 统一了分销、订单、会员等模块的国际化key层级,确保所有语言调用路径一致
This commit is contained in:
@@ -92,7 +92,7 @@ export default {
|
||||
uni.removeStorageSync("pay_flag");
|
||||
} else {
|
||||
this.$util.showToast({
|
||||
title: this.$lang('payment.toast.orderDataNotFound')
|
||||
title: this.$lang('point.payment.toast.orderDataNotFound')
|
||||
});
|
||||
setTimeout(() => {
|
||||
this.$util.redirectTo(this.$util.INDEX_PAGE_URL);
|
||||
@@ -119,7 +119,7 @@ export default {
|
||||
if (this.$refs.loadingCover) this.$refs.loadingCover.hide();
|
||||
} else {
|
||||
this.$util.showToast({
|
||||
title: this.$lang('payment.toast.orderDataNotFound')
|
||||
title: this.$lang('point.payment.toast.orderDataNotFound')
|
||||
});
|
||||
setTimeout(() => {
|
||||
this.$util.redirectTo(this.$util.INDEX_PAGE_URL);
|
||||
@@ -280,9 +280,9 @@ export default {
|
||||
this.isSub = false;
|
||||
if (res.data.error_code == 10 || res.data.error_code == 12) {
|
||||
uni.showModal({
|
||||
title: this.$lang('payment.modal.orderNotCreated'),
|
||||
title: this.$lang('point.payment.modal.orderNotCreated'),
|
||||
content: res.message,
|
||||
confirmText: this.$lang('payment.modal.goToSet'),
|
||||
confirmText: this.$lang('point.payment.modal.goToSet'),
|
||||
success: res => {
|
||||
if (res.confirm) {
|
||||
this.selectAddress();
|
||||
@@ -309,13 +309,13 @@ export default {
|
||||
if (this.orderPaymentData.is_virtual == 1) {
|
||||
if (!this.orderCreateData.member_address.mobile.length) {
|
||||
this.$util.showToast({
|
||||
title: this.$lang('payment.toast.pleaseEnterMobile')
|
||||
title: this.$lang('point.payment.toast.pleaseEnterMobile')
|
||||
});
|
||||
return false;
|
||||
}
|
||||
if (!this.$util.verifyMobile(this.orderCreateData.member_address.mobile)) {
|
||||
this.$util.showToast({
|
||||
title: this.$lang('payment.toast.pleaseEnterCorrectMobile')
|
||||
title: this.$lang('point.payment.toast.pleaseEnterCorrectMobile')
|
||||
});
|
||||
return false;
|
||||
}
|
||||
@@ -324,7 +324,7 @@ export default {
|
||||
if (this.orderPaymentData.is_virtual == 0) {
|
||||
if (!this.orderCreateData.delivery || !this.orderCreateData.delivery.delivery_type) {
|
||||
this.$util.showToast({
|
||||
title: this.$lang('payment.toast.noDeliveryMethod')
|
||||
title: this.$lang('point.payment.toast.noDeliveryMethod')
|
||||
});
|
||||
return false;
|
||||
}
|
||||
@@ -332,7 +332,7 @@ export default {
|
||||
if (this.orderCreateData.delivery.delivery_type != 'store') {
|
||||
if (!this.orderCreateData.member_address) {
|
||||
this.$util.showToast({
|
||||
title: this.$lang('payment.toast.pleaseSelectAddress')
|
||||
title: this.$lang('point.payment.toast.pleaseSelectAddress')
|
||||
});
|
||||
return false;
|
||||
}
|
||||
@@ -341,26 +341,26 @@ export default {
|
||||
if (this.orderCreateData.delivery.delivery_type == 'store') {
|
||||
if (!this.orderCreateData.delivery.store_id) {
|
||||
this.$util.showToast({
|
||||
title: this.$lang('payment.toast.noPickupStore')
|
||||
title: this.$lang('point.payment.toast.noPickupStore')
|
||||
});
|
||||
return false;
|
||||
}
|
||||
if (!this.member_address.mobile) {
|
||||
this.$util.showToast({
|
||||
title: this.$lang('payment.toast.pleaseEnterReservedMobile')
|
||||
title: this.$lang('point.payment.toast.pleaseEnterReservedMobile')
|
||||
});
|
||||
return false;
|
||||
}
|
||||
if (!this.$util.verifyMobile(this.member_address.mobile)) {
|
||||
this.$util.showToast({
|
||||
title: this.$lang('payment.toast.pleaseEnterCorrectReservedMobile')
|
||||
title: this.$lang('point.payment.toast.pleaseEnterCorrectReservedMobile')
|
||||
});
|
||||
return false;
|
||||
}
|
||||
|
||||
if (!this.orderCreateData.delivery.buyer_ask_delivery_time.start_date || !this.orderCreateData.delivery.buyer_ask_delivery_time.end_date) {
|
||||
this.$util.showToast({
|
||||
title: this.$lang('payment.toast.pleaseSelectPickupTime')
|
||||
title: this.$lang('point.payment.toast.pleaseSelectPickupTime')
|
||||
});
|
||||
return false;
|
||||
}
|
||||
@@ -369,13 +369,13 @@ export default {
|
||||
if (this.orderCreateData.delivery.delivery_type == 'local') {
|
||||
if (!this.orderCreateData.delivery.store_id) {
|
||||
this.$util.showToast({
|
||||
title: this.$lang('payment.toast.noDeliveryStore')
|
||||
title: this.$lang('point.payment.toast.noDeliveryStore')
|
||||
});
|
||||
return false;
|
||||
}
|
||||
if (this.orderPaymentData.config.local.is_use && this.orderPaymentData.delivery.local.info && this.orderPaymentData.delivery.local.info.time_is_open == 1 && (!this.orderCreateData.delivery.buyer_ask_delivery_time.start_date || !this.orderCreateData.delivery.buyer_ask_delivery_time.end_date)) {
|
||||
this.$util.showToast({
|
||||
title: this.$lang('payment.toast.pleaseSelectDeliveryTime')
|
||||
title: this.$lang('point.payment.toast.pleaseSelectDeliveryTime')
|
||||
});
|
||||
return false;
|
||||
}
|
||||
@@ -526,7 +526,7 @@ export default {
|
||||
start_date:data.data.start_date,
|
||||
end_date:data.data.end_date
|
||||
};
|
||||
if (data.data.title == this.$lang('payment.time.today') || data.data.title == this.$lang('payment.time.tomorrow')) {
|
||||
if (data.data.title == this.$lang('point.payment.time.today') || data.data.title == this.$lang('point.payment.time.tomorrow')) {
|
||||
this.orderCreateData.buyer_ask_delivery_title = data.data.title + '(' + data.data.time + ')'
|
||||
} else {
|
||||
this.orderCreateData.buyer_ask_delivery_title = data.data.month + '(' + data.data.time + ')'
|
||||
|
||||
Reference in New Issue
Block a user