refactor(components&cart): 调整语言包引用路径

统一修正空状态组件和购物车页面的语言包调用路径,将零散的语言项归类到goods.cart命名空间下,移除默认兜底文案
This commit is contained in:
2026-07-03 11:26:26 +08:00
parent 2a2161c9d9
commit d1e6cc3122
2 changed files with 9 additions and 9 deletions

View File

@@ -43,13 +43,13 @@ export default {
computed: {
// 显示文案:优先用 prop 传入的,没有则用语言包默认值
displayText() {
return this.text || this.$lang('common.mescrollEmpty') || '暂无相关数据';
return this.text || this.$lang('common.mescrollEmpty');
},
displaySubText() {
return this.subText || '';
},
displayBtnText() {
return (this.emptyBtn && this.emptyBtn.text) || this.$lang('toGoodsCategoryPage') || '去逛逛';
return (this.emptyBtn && this.emptyBtn.text) || this.$lang('toGoodsCategoryPage');
},
// 建立 componentRefresh 依赖,切语言时自动更新
_i18nRefresh() {

View File

@@ -233,14 +233,14 @@ export default {
}
if (cart_id.length == 0) {
this.$util.showToast({
title: this.$lang('selectDeleteGoods')
title: this.$lang('goods.cart.selectDeleteGoods')
});
return;
}
uni.showModal({
title: this.$lang('tip'),
content: cart_id.length > 1 ? this.$lang('confirmDeleteGoods') : this.$lang('confirmDeleteGood'),
title: this.$lang('goods.cart.tip'),
content: cart_id.length > 1 ? this.$lang('goods.cart.confirmDeleteGoods') : this.$lang('goods.cart.confirmDeleteGood'),
success: res => {
if (res.confirm) {
cart_id = cart_id.toString();
@@ -381,8 +381,8 @@ export default {
*/
clearInvalidGoods() {
uni.showModal({
title: this.$lang('tip'),
content: this.$lang('confirmClearInvalid'),
title: this.$lang('goods.cart.tip'),
content: this.$lang('goods.cart.confirmClearInvalid'),
success: res => {
if (res.confirm) {
var cart_ids = [];
@@ -432,11 +432,11 @@ export default {
if (event.type == 'plus') {
if (data.max_buy > 0 && data.max_buy < data.stock) {
this.$util.showToast({
title: this.$lang('purchaseLimit', { maxBuy: data.max_buy })
title: this.$lang('goods.cart.purchaseLimit', { maxBuy: data.max_buy })
});
} else {
this.$util.showToast({
title: this.$lang('outOfStock')
title: this.$lang('goods.cart.outOfStock')
});
}
} else {