Просмотр исходного кода

fix: index-home 移除维度参数

Xiaogang Liao 1 месяц назад
Родитель
Сommit
00d7b5e2ff
1 измененных файлов с 3 добавлено и 24 удалено
  1. 3 24
      cfc-frontend/pages/index-home/index.vue

+ 3 - 24
cfc-frontend/pages/index-home/index.vue

@@ -158,8 +158,6 @@
         <text class="section-more" @click="goMoreProducts">更多 ›</text>
       </view>
       <DimensionProducts
-        dimensionCode="action"
-        :products="dimensionProducts"
         :isLoggedIn="true"
         :showMore="false"
         @productClick="goProductDetail" />
@@ -327,7 +325,7 @@ import FamilyFeed from '../../components/FamilyFeed.vue'
 import DimensionProducts from '../../components/DimensionProducts.vue'
 import ArticleBookshelf from '../../components/ArticleBookshelf.vue'
 import FamilyChallengeCard from '../../components/FamilyChallengeCard.vue'
-import { acceptParentInvite, productList, getActivityList, getFeaturedArticles, getFamilyEnergySandbox, getVisibleFamilyMembers, getChildren, getProductsByDomain, getChallengeList, switchToFamilyMember, getMyMembership, updateChallengeProgress, respondChallenge, getTodayTasks, completeTask as completeTaskApi, getTodayParentTasks, completeParentTask as completeParentTaskApi, getTaskHistory } from '../../utils/api.js'
+import { acceptParentInvite, productList, getActivityList, getFeaturedArticles, getFamilyEnergySandbox, getVisibleFamilyMembers, getChildren, getChallengeList, switchToFamilyMember, getMyMembership, updateChallengeProgress, respondChallenge, getTodayTasks, completeTask as completeTaskApi, getTodayParentTasks, completeParentTask as completeParentTaskApi, getTaskHistory } from '../../utils/api.js'
 import config from '@/config.js'
 
 export default {
@@ -386,7 +384,6 @@ export default {
       membersChecked: false,
       selectedMemberId: null,
       sandboxData: null,
-      dimensionProducts: [],
       articles: [],
       children: [],
       currentChildId: null,
@@ -420,15 +417,7 @@ export default {
     },
     actionArticles: function() {
       if (!this.articles || this.articles.length === 0) return []
-      var result = []
-      for (var i = 0; i < this.articles.length; i++) {
-        var a = this.articles[i]
-        if (a.relatedDimensions && a.relatedDimensions.indexOf('action') !== -1) {
-          result.push(a)
-        }
-      }
-      if (result.length === 0) return this.articles.slice(0, 5)
-      return result.slice(0, 5)
+      return this.articles.slice(0, 5)
     },
     // 会员入口显示:非会员显示开通;会员剩余≤30天显示续费
     showMemberEntry: function() {
@@ -528,7 +517,6 @@ export default {
     },
     loadDimensionData: function() {
       this.loadSandboxData()
-      this.loadActionProducts()
       this.loadActionArticles()
       this.loadChallenges()
     },
@@ -542,18 +530,9 @@ export default {
         }
       }).catch(function() {})
     },
-    loadActionProducts: function() {
-      var self = this
-      getProductsByDomain('action', 1, 4).then(function(res) {
-        if (res && res.data) {
-          var list = Array.isArray(res.data) ? res.data : (res.data.records || [])
-          self.dimensionProducts = list.slice(0, 4)
-        }
-      }).catch(function() { self.dimensionProducts = [] })
-    },
     loadActionArticles: function() {
       var self = this
-      getFeaturedArticles({ size: 5, dimensionCode: 'action' }).then(function(res) {
+      getFeaturedArticles({ size: 5 }).then(function(res) {
         if (res.code === 200 && res.data) {
           var gradientColors = [
             'linear-gradient(135deg, #10B981, #34D399)',