chore:商品分类模板2,4加购按钮显示正常

This commit is contained in:
2026-09-07 16:52:27 +08:00
parent 9739eea32a
commit 8443cadba9
4 changed files with 45 additions and 11 deletions

View File

@@ -578,10 +578,10 @@ export default {
};
},
computed: {
// 后台新增开关:加购按钮
// 后台开启就显示, 关闭就不显示; 未下发新字段时兼容旧字段 quickBuy
// 后台开关:加购按钮 = cartBtn; 未下发 cartBtn 时兼容旧字段 quickBuy
// 后台开启就显示, 关闭就不显示
showAddCart() {
const t = this.getDiyToggle(['showAddCart', 'show_add_cart']);
const t = this.getDiyToggle(['showAddCart', 'show_add_cart', 'cartBtn', 'cart_btn']);
if (t !== undefined) return t;
const legacy = this.getDiyToggle(['quickBuy', 'quick_buy']);
return legacy !== undefined ? legacy : false;