Przeglądaj źródła

feat(frontend): DimensionProducts组件新增dimensionCode按维度取推荐

prop 非空时并入 getDimensionProducts 请求参数,空值保持原通用推荐行为

Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-openagent)

Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
Sisyphus 4 dni temu
rodzic
commit
7df7811a1c
1 zmienionych plików z 4 dodań i 0 usunięć
  1. 4 0
      cfc-frontend/components/DimensionProducts.vue

+ 4 - 0
cfc-frontend/components/DimensionProducts.vue

@@ -33,6 +33,7 @@ export default {
     // 自加载模式:传入 familyId 后组件内部调用 getDimensionProducts
     familyId: { type: [Number, String], default: null },
     isLoggedIn: { type: Boolean, default: false },
+    dimensionCode: { type: String, default: '' },
     title: { type: String, default: '推荐商品' },
     showMore: { type: Boolean, default: true }
   },
@@ -82,6 +83,9 @@ export default {
       var params = {
         limit: 4
       }
+      if (self.dimensionCode) {
+        params.dimensionCode = self.dimensionCode
+      }
       getDimensionProducts(params).then(function(res) {
         self.loading = false
         if (res.code === 200 && res.data) {