|
@@ -23,7 +23,7 @@
|
|
|
</view>
|
|
</view>
|
|
|
</view>
|
|
</view>
|
|
|
|
|
|
|
|
- <FamilyMemberStrip />
|
|
|
|
|
|
|
+ <FamilyMemberStrip @select="onMemberSelect" />
|
|
|
|
|
|
|
|
<view class="section section-dc-header">
|
|
<view class="section section-dc-header">
|
|
|
<view class="dc-title-row">
|
|
<view class="dc-title-row">
|
|
@@ -170,16 +170,20 @@ export default {
|
|
|
onShow() {
|
|
onShow() {
|
|
|
this.isLoggedIn = !!uni.getStorageSync('token')
|
|
this.isLoggedIn = !!uni.getStorageSync('token')
|
|
|
if (this.isLoggedIn) {
|
|
if (this.isLoggedIn) {
|
|
|
- this.loadHealthData()
|
|
|
|
|
- this.loadPlanList()
|
|
|
|
|
var stored = uni.getStorageSync('currentChildId') || ''
|
|
var stored = uni.getStorageSync('currentChildId') || ''
|
|
|
if (stored) {
|
|
if (stored) {
|
|
|
this.selectedMemberId = stored
|
|
this.selectedMemberId = stored
|
|
|
this.selectedMemberName = uni.getStorageSync('currentChildName') || '成员'
|
|
this.selectedMemberName = uni.getStorageSync('currentChildName') || '成员'
|
|
|
}
|
|
}
|
|
|
|
|
+ this.loadHealthData()
|
|
|
|
|
+ this.loadPlanList()
|
|
|
}
|
|
}
|
|
|
},
|
|
},
|
|
|
methods: {
|
|
methods: {
|
|
|
|
|
+ onMemberSelect: function(member) {
|
|
|
|
|
+ this.selectedMemberId = member && member.id ? member.id : ''
|
|
|
|
|
+ this.selectedMemberName = member && member.name ? member.name : '成员'
|
|
|
|
|
+ },
|
|
|
switchTab: function(code) { this.currentTab = code },
|
|
switchTab: function(code) { this.currentTab = code },
|
|
|
goPage: function(url) { uni.navigateTo({ url: url }) },
|
|
goPage: function(url) { uni.navigateTo({ url: url }) },
|
|
|
goQuiz: function(code) {
|
|
goQuiz: function(code) {
|
|
@@ -199,7 +203,7 @@ export default {
|
|
|
var self = this
|
|
var self = this
|
|
|
try {
|
|
try {
|
|
|
var api = require('../../utils/api.js')
|
|
var api = require('../../utils/api.js')
|
|
|
- api.getReportList().then(function(res) {
|
|
|
|
|
|
|
+ api.getReportList(self.selectedMemberId).then(function(res) {
|
|
|
if (res.code === 200 && res.data) {
|
|
if (res.code === 200 && res.data) {
|
|
|
var list = Array.isArray(res.data) ? res.data : (res.data.list || [])
|
|
var list = Array.isArray(res.data) ? res.data : (res.data.list || [])
|
|
|
self.reports = list
|
|
self.reports = list
|