Kaynağa Gözat

花掌柜首页配置-关联分类要过滤掉禁用、删除的分类

ouyang 3 gün önce
ebeveyn
işleme
f4f93d521c

+ 2 - 1
hdApp/src/admin/goods/components/category-ad-setting.vue

@@ -232,8 +232,9 @@ export default {
         this.adList = this.parseAdvertisement(data.advertisement);
         this.adList = this.parseAdvertisement(data.advertisement);
       });
       });
     },
     },
+    /** 关联分类候选:onlyEnabled=1 后端过滤禁用/已删 */
     loadBouquetCategories() {
     loadBouquetCategories() {
-      categoryListInfo().then((res) => {
+      categoryListInfo({ onlyEnabled: 1 }).then((res) => {
         const list = res.data || [];
         const list = res.data || [];
         this.bouquetCategories = list;
         this.bouquetCategories = list;
         // 分类名称依赖列表,加载后刷新各 slot 分类类型展示文案
         // 分类名称依赖列表,加载后刷新各 slot 分类类型展示文案

+ 2 - 2
hdApp/src/admin/homePageConfig/banner.vue

@@ -307,9 +307,9 @@ export default {
         this.refreshAllLabels()
         this.refreshAllLabels()
       })
       })
     },
     },
-    /** 分类接口与商品详情页一致:/category/list */
+    /** 分类接口:onlyEnabled=1 由后端过滤禁用/已删 */
     loadCategory() {
     loadCategory() {
-      getClass().then((res) => {
+      getClass({ onlyEnabled: 1 }).then((res) => {
         if (res.code == 1) {
         if (res.code == 1) {
           this.categoryData = res.data || []
           this.categoryData = res.data || []
           this.refreshAllLabels()
           this.refreshAllLabels()

+ 2 - 1
hdApp/src/admin/homePageConfig/goodsSection.vue

@@ -229,7 +229,8 @@ export default {
           this.valueLabel = ids.length ? `已选${ids.length}个商品` : ''
           this.valueLabel = ids.length ? `已选${ids.length}个商品` : ''
         }
         }
       })
       })
-      getClass().then((res) => {
+      // 关联分类:后端 onlyEnabled=1 过滤禁用/已删
+      getClass({ onlyEnabled: 1 }).then((res) => {
         if (res.code == 1) this.categoryData = res.data || []
         if (res.code == 1) this.categoryData = res.data || []
       })
       })
       useCaseList().then((res) => {
       useCaseList().then((res) => {

+ 2 - 1
hdApp/src/admin/homePageConfig/navGridEdit.vue

@@ -268,8 +268,9 @@ export default {
         value: item.value ? String(item.value) : ''
         value: item.value ? String(item.value) : ''
       }
       }
     },
     },
+    /** 金刚区关联分类:onlyEnabled=1 后端过滤禁用/已删 */
     loadCategory() {
     loadCategory() {
-      getClass().then((res) => {
+      getClass({ onlyEnabled: 1 }).then((res) => {
         if (res.code == 1) {
         if (res.code == 1) {
           this.categoryData = res.data || []
           this.categoryData = res.data || []
         }
         }

+ 5 - 1
hdApp/src/api/category/index.js

@@ -1,7 +1,11 @@
+/**
+ * 商品分类相关接口
+ * getClass:分类列表;传 onlyEnabled=1 时后端只返回启用且未删除分类(首页配置选类用)
+ */
 import https from '@/plugins/luch-request_0.0.7/request'
 import https from '@/plugins/luch-request_0.0.7/request'
 
 
 /** *
 /** *
- * 获取分类 m
+ * 获取分类;支持 onlyEnabled=1 过滤禁用/已删
  */
  */
 export const getClass = data => {
 export const getClass = data => {
 	return https.get('/category/list', data)
 	return https.get('/category/list', data)

+ 4 - 0
hdApp/src/api/goods/index.js

@@ -168,6 +168,10 @@ export const getCategoryToGoods = data => {
 /** *
 /** *
  * 商品分类-列表(无分页) b
  * 商品分类-列表(无分页) b
  */
  */
+/**
+ * 商品分类列表(全量或筛选)
+ * onlyEnabled=1:仅启用且未删除,分类广告/首页配置选类用
+ */
 export const categoryListInfo = data => {
 export const categoryListInfo = data => {
 	return https.get('/category/list', data)
 	return https.get('/category/list', data)
 }
 }