|
@@ -158,8 +158,6 @@
|
|
|
<text class="section-more" @click="goMoreProducts">更多 ›</text>
|
|
<text class="section-more" @click="goMoreProducts">更多 ›</text>
|
|
|
</view>
|
|
</view>
|
|
|
<DimensionProducts
|
|
<DimensionProducts
|
|
|
- dimensionCode="action"
|
|
|
|
|
- :products="dimensionProducts"
|
|
|
|
|
:isLoggedIn="true"
|
|
:isLoggedIn="true"
|
|
|
:showMore="false"
|
|
:showMore="false"
|
|
|
@productClick="goProductDetail" />
|
|
@productClick="goProductDetail" />
|
|
@@ -327,7 +325,7 @@ import FamilyFeed from '../../components/FamilyFeed.vue'
|
|
|
import DimensionProducts from '../../components/DimensionProducts.vue'
|
|
import DimensionProducts from '../../components/DimensionProducts.vue'
|
|
|
import ArticleBookshelf from '../../components/ArticleBookshelf.vue'
|
|
import ArticleBookshelf from '../../components/ArticleBookshelf.vue'
|
|
|
import FamilyChallengeCard from '../../components/FamilyChallengeCard.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'
|
|
import config from '@/config.js'
|
|
|
|
|
|
|
|
export default {
|
|
export default {
|
|
@@ -386,7 +384,6 @@ export default {
|
|
|
membersChecked: false,
|
|
membersChecked: false,
|
|
|
selectedMemberId: null,
|
|
selectedMemberId: null,
|
|
|
sandboxData: null,
|
|
sandboxData: null,
|
|
|
- dimensionProducts: [],
|
|
|
|
|
articles: [],
|
|
articles: [],
|
|
|
children: [],
|
|
children: [],
|
|
|
currentChildId: null,
|
|
currentChildId: null,
|
|
@@ -420,15 +417,7 @@ export default {
|
|
|
},
|
|
},
|
|
|
actionArticles: function() {
|
|
actionArticles: function() {
|
|
|
if (!this.articles || this.articles.length === 0) return []
|
|
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天显示续费
|
|
// 会员入口显示:非会员显示开通;会员剩余≤30天显示续费
|
|
|
showMemberEntry: function() {
|
|
showMemberEntry: function() {
|
|
@@ -528,7 +517,6 @@ export default {
|
|
|
},
|
|
},
|
|
|
loadDimensionData: function() {
|
|
loadDimensionData: function() {
|
|
|
this.loadSandboxData()
|
|
this.loadSandboxData()
|
|
|
- this.loadActionProducts()
|
|
|
|
|
this.loadActionArticles()
|
|
this.loadActionArticles()
|
|
|
this.loadChallenges()
|
|
this.loadChallenges()
|
|
|
},
|
|
},
|
|
@@ -542,18 +530,9 @@ export default {
|
|
|
}
|
|
}
|
|
|
}).catch(function() {})
|
|
}).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() {
|
|
loadActionArticles: function() {
|
|
|
var self = this
|
|
var self = this
|
|
|
- getFeaturedArticles({ size: 5, dimensionCode: 'action' }).then(function(res) {
|
|
|
|
|
|
|
+ getFeaturedArticles({ size: 5 }).then(function(res) {
|
|
|
if (res.code === 200 && res.data) {
|
|
if (res.code === 200 && res.data) {
|
|
|
var gradientColors = [
|
|
var gradientColors = [
|
|
|
'linear-gradient(135deg, #10B981, #34D399)',
|
|
'linear-gradient(135deg, #10B981, #34D399)',
|