|
|
@@ -596,10 +596,10 @@ export default {
|
|
|
self.foodCount = (Array.isArray(foodRes.data) ? foodRes.data : []).length
|
|
|
}
|
|
|
}).catch(function() {})
|
|
|
- // 异步加载戒备食材数量
|
|
|
- var userId = uni.getStorageSync('userId')
|
|
|
- if (userId) {
|
|
|
- getFoodCautionList().then(function(cautionRes) {
|
|
|
+ // 异步加载戒备食材数量(按报告 subjectId 查,家长 userId 查不到孩子的推荐指数)
|
|
|
+ var cautionUserId = (self.report && self.report.subjectId) || uni.getStorageSync('userId')
|
|
|
+ if (cautionUserId) {
|
|
|
+ getFoodCautionList(cautionUserId).then(function(cautionRes) {
|
|
|
if (cautionRes && cautionRes.code === 200) {
|
|
|
self.cautionCount = (cautionRes.data || []).length
|
|
|
}
|
|
|
@@ -974,7 +974,9 @@ report.gutType = s.gutType || ''
|
|
|
uni.navigateTo({ url: '/pages/health/gut-flora-foods-detail?reportId=' + this.reportId })
|
|
|
},
|
|
|
goToCaution: function() {
|
|
|
- uni.navigateTo({ url: '/pages/growth/caution-detail' })
|
|
|
+ // 报告绑定主体(subjectId)即 food_recommend_idx 写入的用户维度,作为 memberId 传入戒备页
|
|
|
+ var mid = (this.report && this.report.subjectId) || uni.getStorageSync('currentMemberId') || ''
|
|
|
+ uni.navigateTo({ url: '/pages/growth/caution-detail' + (mid ? '?memberId=' + mid : '') })
|
|
|
},
|
|
|
goToIndicators: function() {
|
|
|
// 展开所有营养分组手风琴
|