|
|
@@ -396,15 +396,15 @@ export default {
|
|
|
async loadGrowthRecommendations() {
|
|
|
var self = this
|
|
|
try {
|
|
|
- var res = await getGrowthRecommendations('health', 3)
|
|
|
+ var res = await getGrowthRecommendations('health', 6)
|
|
|
if (res && res.code === 200 && res.data) {
|
|
|
- self.healthArticles = res.data.articles || []
|
|
|
- self.healthProducts = res.data.products || []
|
|
|
- }
|
|
|
- var res2 = await getGrowthRecommendations('growth', 3)
|
|
|
- if (res2 && res2.code === 200 && res2.data) {
|
|
|
- self.growthArticles = res2.data.articles || []
|
|
|
- self.growthProducts = res2.data.products || []
|
|
|
+ var arts = res.data.articles || []
|
|
|
+ var prods = res.data.products || []
|
|
|
+ // 按 growth_category 分组
|
|
|
+ self.healthArticles = arts.filter(function(a){ return a.growthCategory === 'health' })
|
|
|
+ self.healthProducts = prods.filter(function(p){ return p.growthCategory === 'health' })
|
|
|
+ self.growthArticles = arts.filter(function(a){ return a.growthCategory === 'growth' })
|
|
|
+ self.growthProducts = prods.filter(function(p){ return p.growthCategory === 'growth' })
|
|
|
}
|
|
|
} catch(e) {}
|
|
|
},
|