|
@@ -159,6 +159,26 @@
|
|
|
</view>
|
|
</view>
|
|
|
</view>
|
|
</view>
|
|
|
</view>
|
|
</view>
|
|
|
|
|
+ <view class="section" v-if="cautionCount > 0">
|
|
|
|
|
+ <view class="action-card" @click="goToCaution">
|
|
|
|
|
+ <text class="action-icon">⚠️</text>
|
|
|
|
|
+ <view class="action-info">
|
|
|
|
|
+ <text class="action-title">食材戒备匹配</text>
|
|
|
|
|
+ <text class="action-desc">{{ cautionCount }} 种食材需关注,点击查看戒备详情</text>
|
|
|
|
|
+ </view>
|
|
|
|
|
+ <text class="action-arrow">›</text>
|
|
|
|
|
+ </view>
|
|
|
|
|
+ </view>
|
|
|
|
|
+ <view class="section">
|
|
|
|
|
+ <view class="action-card" @click="goToFoods">
|
|
|
|
|
+ <text class="action-icon">🍽️</text>
|
|
|
|
|
+ <view class="action-info">
|
|
|
|
|
+ <text class="action-title">饮食推荐</text>
|
|
|
|
|
+ <text class="action-desc">基于菌群报告的个性化食材建议</text>
|
|
|
|
|
+ </view>
|
|
|
|
|
+ <text class="action-arrow">›</text>
|
|
|
|
|
+ </view>
|
|
|
|
|
+ </view>
|
|
|
<view class="section">
|
|
<view class="section">
|
|
|
<view class="tracking-card">
|
|
<view class="tracking-card">
|
|
|
<view class="tracking-tabs">
|
|
<view class="tracking-tabs">
|
|
@@ -230,10 +250,10 @@
|
|
|
import PageBanner from '../../components/PageBanner.vue'
|
|
import PageBanner from '../../components/PageBanner.vue'
|
|
|
import LoginGuideCard from '../../components/LoginGuideCard.vue'
|
|
import LoginGuideCard from '../../components/LoginGuideCard.vue'
|
|
|
import DimensionActivities from '../../components/DimensionActivities.vue'
|
|
import DimensionActivities from '../../components/DimensionActivities.vue'
|
|
|
-import { healthCheckinList, getDietDailyRecords, getSurveyStatus, getSurveyHistory } from '../../utils/api.js'
|
|
|
|
|
|
|
+import { healthCheckinList, getDietDailyRecords, getSurveyStatus, getSurveyHistory, getFoodCautionList } from '../../utils/api.js'
|
|
|
export default {
|
|
export default {
|
|
|
components: { PageBanner, LoginGuideCard, DimensionActivities },
|
|
components: { PageBanner, LoginGuideCard, DimensionActivities },
|
|
|
- data() { return { memberId: '', todayDate: '', hasIncomplete: false, incompleteCount: 0, progressItems: [], activeTab: 'diet', trackingTabs: [{ key: 'diet', label: '饮食' }, { key: 'exercise', label: '运动' }, { key: 'sleep', label: '睡眠' }, { key: 'emotion', label: '心情' }, { key: 'survey', label: '调研' }], trackingData: { diet: [], exercise: [], sleep: [], emotion: [], survey: [] }, streakDays: 0, activeChallenges: 0, completeness: 0, pendingSurvey: null, allDone: false, surveyHistory: [], isLoggedIn: false } },
|
|
|
|
|
|
|
+ data() { return { memberId: '', todayDate: '', hasIncomplete: false, incompleteCount: 0, progressItems: [], activeTab: 'diet', trackingTabs: [{ key: 'diet', label: '饮食' }, { key: 'exercise', label: '运动' }, { key: 'sleep', label: '睡眠' }, { key: 'emotion', label: '心情' }, { key: 'survey', label: '调研' }], trackingData: { diet: [], exercise: [], sleep: [], emotion: [], survey: [] }, streakDays: 0, activeChallenges: 0, completeness: 0, cautionCount: 0, pendingSurvey: null, allDone: false, surveyHistory: [], isLoggedIn: false } },
|
|
|
computed: {
|
|
computed: {
|
|
|
doneCount: function() { var c = 0; for (var i = 0; i < this.progressItems.length; i++) if (this.progressItems[i] && this.progressItems[i].done) c++; return c },
|
|
doneCount: function() { var c = 0; for (var i = 0; i < this.progressItems.length; i++) if (this.progressItems[i] && this.progressItems[i].done) c++; return c },
|
|
|
totalCount: function() { return this.progressItems.length },
|
|
totalCount: function() { return this.progressItems.length },
|
|
@@ -271,11 +291,14 @@ export default {
|
|
|
goActivityDetail: function(act) { uni.navigateTo({ url: '/pages/activity/activity-detail/activity-detail?id=' + act.id }) },
|
|
goActivityDetail: function(act) { uni.navigateTo({ url: '/pages/activity/activity-detail/activity-detail?id=' + act.id }) },
|
|
|
goMoreActivities: function() { uni.navigateTo({ url: '/pages/activity/index' }) },
|
|
goMoreActivities: function() { uni.navigateTo({ url: '/pages/activity/index' }) },
|
|
|
handleGuestFeatureTap: function() { uni.showToast({ title: '登录后即可体验该功能', icon: 'none' }) },
|
|
handleGuestFeatureTap: function() { uni.showToast({ title: '登录后即可体验该功能', icon: 'none' }) },
|
|
|
|
|
+ goToCaution: function() { uni.navigateTo({ url: '/pages/growth/caution-detail' }) },
|
|
|
|
|
+ goToFoods: function() { uni.navigateTo({ url: '/pages/growth/foods-detail' }) },
|
|
|
goPage: function(url) { uni.navigateTo({ url: url }) },
|
|
goPage: function(url) { uni.navigateTo({ url: url }) },
|
|
|
loadTrackingData: function(key) { return this.trackingData[key] || [] },
|
|
loadTrackingData: function(key) { return this.trackingData[key] || [] },
|
|
|
async loadAllData() {
|
|
async loadAllData() {
|
|
|
var self = this
|
|
var self = this
|
|
|
try { await self.loadProgressItems() } catch(e) {}
|
|
try { await self.loadProgressItems() } catch(e) {}
|
|
|
|
|
+ try { await self.loadCautionData() } catch(e) {}
|
|
|
try { await self.loadSurveyData() } catch(e) {}
|
|
try { await self.loadSurveyData() } catch(e) {}
|
|
|
try { await self.loadMilestones() } catch(e) {}
|
|
try { await self.loadMilestones() } catch(e) {}
|
|
|
},
|
|
},
|
|
@@ -323,6 +346,13 @@ export default {
|
|
|
}
|
|
}
|
|
|
} catch(e) {}
|
|
} catch(e) {}
|
|
|
},
|
|
},
|
|
|
|
|
+ async loadCautionData() {
|
|
|
|
|
+ var self = this
|
|
|
|
|
+ try {
|
|
|
|
|
+ var res = await getFoodCautionList()
|
|
|
|
|
+ if (res && res.code === 200) self.cautionCount = (res.data || []).length
|
|
|
|
|
+ } catch(e) {}
|
|
|
|
|
+ },
|
|
|
async loadMilestones() {
|
|
async loadMilestones() {
|
|
|
var self = this
|
|
var self = this
|
|
|
try {
|
|
try {
|
|
@@ -361,6 +391,14 @@ export default {
|
|
|
.feat-title{font-size:26rpx;font-weight:600;color:#333;display:block;margin-bottom:4rpx}
|
|
.feat-title{font-size:26rpx;font-weight:600;color:#333;display:block;margin-bottom:4rpx}
|
|
|
.feat-desc{font-size:22rpx;color:#999;display:block}
|
|
.feat-desc{font-size:22rpx;color:#999;display:block}
|
|
|
.login-guide-section{margin:0 24rpx 24rpx}
|
|
.login-guide-section{margin:0 24rpx 24rpx}
|
|
|
|
|
+/* 成长行动卡片 */
|
|
|
|
|
+.action-card{display:flex;align-items:center;padding:24rpx 28rpx;background:#fff;border-radius:16rpx;margin:0 24rpx 16rpx;box-shadow:0 2rpx 12rpx rgba(0,0,0,0.06)}
|
|
|
|
|
+.action-card:active{opacity:0.85}
|
|
|
|
|
+.action-icon{font-size:44rpx;margin-right:20rpx}
|
|
|
|
|
+.action-info{flex:1}
|
|
|
|
|
+.action-title{font-size:28rpx;font-weight:600;color:#333;display:block}
|
|
|
|
|
+.action-desc{font-size:22rpx;color:#888;margin-top:4rpx;display:block}
|
|
|
|
|
+.action-arrow{font-size:32rpx;color:#ccc}
|
|
|
/* 登录后原有样式 */
|
|
/* 登录后原有样式 */
|
|
|
.reminder-bar{margin:12rpx 24rpx;background:#FFF3E0;border:1rpx solid #FFB74D;border-radius:12rpx;padding:14rpx 20rpx;display:flex;align-items:center;justify-content:space-between}
|
|
.reminder-bar{margin:12rpx 24rpx;background:#FFF3E0;border:1rpx solid #FFB74D;border-radius:12rpx;padding:14rpx 20rpx;display:flex;align-items:center;justify-content:space-between}
|
|
|
.reminder-text{font-size:24rpx;color:#E65100}
|
|
.reminder-text{font-size:24rpx;color:#E65100}
|