refactor: 将项目内硬编码文本替换为多语言调用

统一替换所有页面和组件中的硬编码字符串为 $lang 多语言方法调用,提升项目国际化适配能力
This commit is contained in:
2026-06-22 14:04:13 +08:00
parent 46508c7d55
commit 2337e3cacf
38 changed files with 505 additions and 511 deletions

View File

@@ -67,13 +67,13 @@ export default {
let cart_id = cart ? cart.cart_id : 0;
if (_num > parseInt(data.stock)) {
this.$util.showToast({
title: '商品库存不足'
title: this.$lang('sku.stockInsufficient')
});
return;
}
if (data.is_limit && data.max_buy && _num > parseInt(data.max_buy)) {
this.$util.showToast({
title: `该商品每人限购${data.max_buy}${data.unit || '件'}`
title: this.$lang('sku.maxBuyPerPerson') + data.max_buy + (data.unit || this.$lang('sku.unit'))
});
return;
}
@@ -121,7 +121,7 @@ export default {
res.data;
}
this.$util.showToast({
title: "商品添加购物车成功"
title: this.$lang('sku.addToCartSuccess')
});
this.$store.commit('setCartChange');
this.$store.dispatch('cartCalculate');