diff --git a/components-diy/diy-category-item.vue b/components-diy/diy-category-item.vue index da193f1..5421fee 100644 --- a/components-diy/diy-category-item.vue +++ b/components-diy/diy-category-item.vue @@ -559,12 +559,13 @@ export default { }; }, computed: { - // 后台新增开关:加购按钮;未下发时兼容旧字段 quickBuy + // 后台新增开关:加购按钮 + // 后台开启就显示, 关闭就不显示; 未下发新字段时兼容旧字段 quickBuy showAddCart() { - const v = this.value; - if (v.showAddCart !== undefined) return v.showAddCart; - if (v.show_add_cart !== undefined) return v.show_add_cart; - return v.quickBuy; + const t = this.getDiyToggle(['showAddCart', 'show_add_cart']); + if (t !== undefined) return t; + const legacy = this.getDiyToggle(['quickBuy', 'quick_buy']); + return legacy !== undefined ? legacy : false; }, /** * 当前分类层级 (参考 template 2 的 goodsLevel 模式) diff --git a/components-diy/diy-category.vue b/components-diy/diy-category.vue index af98eca..942d1a5 100644 --- a/components-diy/diy-category.vue +++ b/components-diy/diy-category.vue @@ -1,6 +1,8 @@