|
@@ -143,7 +143,6 @@ export default {
|
|
|
loadTrackingData: function(key) { return this.trackingData[key] || [] },
|
|
loadTrackingData: function(key) { return this.trackingData[key] || [] },
|
|
|
async loadAllData() {
|
|
async loadAllData() {
|
|
|
var self = this
|
|
var self = this
|
|
|
- if (!self.memberId) return
|
|
|
|
|
try { await self.loadProgressItems() } catch(e) {}
|
|
try { await self.loadProgressItems() } 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) {}
|
|
@@ -154,7 +153,7 @@ export default {
|
|
|
// 今日打卡
|
|
// 今日打卡
|
|
|
var checkinDone = false
|
|
var checkinDone = false
|
|
|
try {
|
|
try {
|
|
|
- var ciRes = await healthCheckinList({ memberId: self.memberId, yearMonth: self.todayDate.substring(0, 7) })
|
|
|
|
|
|
|
+ var ciRes = await healthCheckinList({ yearMonth: self.todayDate.substring(0, 7) })
|
|
|
if (ciRes.code === 200 && ciRes.data) {
|
|
if (ciRes.code === 200 && ciRes.data) {
|
|
|
for (var ci = 0; ci < ciRes.data.length; ci++) { if (ciRes.data[ci] && ciRes.data[ci].checkinDate && ciRes.data[ci].checkinDate.substring(0, 10) === self.todayDate) { checkinDone = true; break } }
|
|
for (var ci = 0; ci < ciRes.data.length; ci++) { if (ciRes.data[ci] && ciRes.data[ci].checkinDate && ciRes.data[ci].checkinDate.substring(0, 10) === self.todayDate) { checkinDone = true; break } }
|
|
|
}
|
|
}
|
|
@@ -163,7 +162,7 @@ export default {
|
|
|
// 饮食
|
|
// 饮食
|
|
|
var dietDone = false
|
|
var dietDone = false
|
|
|
try {
|
|
try {
|
|
|
- var dRes = await getDietDailyRecords({ memberId: self.memberId, date: self.todayDate })
|
|
|
|
|
|
|
+ var dRes = await getDietDailyRecords({ date: self.todayDate })
|
|
|
if (dRes.code === 200 && dRes.data && dRes.data.length > 0) dietDone = true
|
|
if (dRes.code === 200 && dRes.data && dRes.data.length > 0) dietDone = true
|
|
|
} catch(e) {}
|
|
} catch(e) {}
|
|
|
items.push({ key: 'diet', icon: '🍽️', label: '饮食记录', done: dietDone, actionText: '补录' })
|
|
items.push({ key: 'diet', icon: '🍽️', label: '饮食记录', done: dietDone, actionText: '补录' })
|
|
@@ -178,7 +177,7 @@ export default {
|
|
|
async loadSurveyData() {
|
|
async loadSurveyData() {
|
|
|
var self = this
|
|
var self = this
|
|
|
try {
|
|
try {
|
|
|
- var statusRes = await getSurveyStatus({ memberId: self.memberId })
|
|
|
|
|
|
|
+ var statusRes = await getSurveyStatus({})
|
|
|
if (statusRes.code === 200 && statusRes.data) {
|
|
if (statusRes.code === 200 && statusRes.data) {
|
|
|
var list = statusRes.data
|
|
var list = statusRes.data
|
|
|
self.pendingSurvey = null; self.allDone = true; var hasAny = false
|
|
self.pendingSurvey = null; self.allDone = true; var hasAny = false
|
|
@@ -187,7 +186,7 @@ export default {
|
|
|
}
|
|
}
|
|
|
} catch(e) {}
|
|
} catch(e) {}
|
|
|
try {
|
|
try {
|
|
|
- var histRes = await getSurveyHistory({ memberId: self.memberId })
|
|
|
|
|
|
|
+ var histRes = await getSurveyHistory({})
|
|
|
if (histRes.code === 200 && histRes.data) {
|
|
if (histRes.code === 200 && histRes.data) {
|
|
|
var hlist = histRes.data; self.surveyHistory = []
|
|
var hlist = histRes.data; self.surveyHistory = []
|
|
|
for (var hi = 0; hi < Math.min(hlist.length, 3); hi++) { var h = hlist[hi]; self.surveyHistory.push({ _date: h && h.submittedAt ? h.submittedAt.substring(0, 10) : '', _content: '已完成调研' }) }
|
|
for (var hi = 0; hi < Math.min(hlist.length, 3); hi++) { var h = hlist[hi]; self.surveyHistory.push({ _date: h && h.submittedAt ? h.submittedAt.substring(0, 10) : '', _content: '已完成调研' }) }
|
|
@@ -197,7 +196,7 @@ export default {
|
|
|
async loadMilestones() {
|
|
async loadMilestones() {
|
|
|
var self = this
|
|
var self = this
|
|
|
try {
|
|
try {
|
|
|
- var ciRes = await healthCheckinList({ memberId: self.memberId })
|
|
|
|
|
|
|
+ var ciRes = await healthCheckinList({})
|
|
|
if (ciRes.code === 200 && ciRes.data) self.streakDays = Math.min(ciRes.data.length, 30)
|
|
if (ciRes.code === 200 && ciRes.data) self.streakDays = Math.min(ciRes.data.length, 30)
|
|
|
} catch(e) {}
|
|
} catch(e) {}
|
|
|
self.activeChallenges = 0
|
|
self.activeChallenges = 0
|