|
|
@@ -1,12 +1,5 @@
|
|
|
<template>
|
|
|
<view class="list-container">
|
|
|
- <!-- 顶部导航 -->
|
|
|
- <view class="nav-bar">
|
|
|
- <text class="nav-back" @click="goBack">‹ 返回</text>
|
|
|
- <text class="nav-title">健康报告</text>
|
|
|
- <view class="nav-placeholder"></view>
|
|
|
- </view>
|
|
|
-
|
|
|
<!-- 加载状态 -->
|
|
|
<view class="loading-wrap" v-if="loading">
|
|
|
<text class="loading-text">加载中...</text>
|
|
|
@@ -59,10 +52,18 @@ export default {
|
|
|
}
|
|
|
},
|
|
|
onLoad(options) {
|
|
|
- this.memberId = options.memberId ? parseInt(options.memberId) : null
|
|
|
+ this.memberId = options.memberId ? parseInt(options.memberId) : this.getMemberId()
|
|
|
this.loadData()
|
|
|
},
|
|
|
methods: {
|
|
|
+ getMemberId: function() {
|
|
|
+ // 优先当前选中的孩子/成员,兜底用登录用户 ID(与 health-main 一致)
|
|
|
+ var store = this.$store
|
|
|
+ if (store && store.state && store.state.currentChildId) return store.state.currentChildId
|
|
|
+ if (store && store.state && store.state.currentMemberId) return store.state.currentMemberId
|
|
|
+ if (store && store.state && store.state.userId) return store.state.userId
|
|
|
+ return uni.getStorageSync('userId') || ''
|
|
|
+ },
|
|
|
loadData() {
|
|
|
var self = this
|
|
|
self.loading = true
|
|
|
@@ -74,9 +75,6 @@ export default {
|
|
|
}).finally(function() {
|
|
|
self.loading = false
|
|
|
})
|
|
|
- },
|
|
|
- goBack() {
|
|
|
- uni.navigateBack()
|
|
|
},
|
|
|
goToDetail(reportId, reportType) {
|
|
|
var detailPages = {
|
|
|
@@ -109,32 +107,6 @@ export default {
|
|
|
background: #F5F7FA;
|
|
|
}
|
|
|
|
|
|
-/* ===== 导航栏 ===== */
|
|
|
-.nav-bar {
|
|
|
- position: sticky;
|
|
|
- top: 0;
|
|
|
- background: #fff;
|
|
|
- display: flex;
|
|
|
- flex-direction: row;
|
|
|
- align-items: center;
|
|
|
- justify-content: space-between;
|
|
|
- padding: 20rpx 30rpx;
|
|
|
- box-shadow: 0 2rpx 8rpx rgba(0,0,0,0.06);
|
|
|
- z-index: 100;
|
|
|
-}
|
|
|
-.nav-back {
|
|
|
- font-size: 32rpx;
|
|
|
- color: #5B9BD5;
|
|
|
-}
|
|
|
-.nav-title {
|
|
|
- font-size: 32rpx;
|
|
|
- font-weight: bold;
|
|
|
- color: #333;
|
|
|
-}
|
|
|
-.nav-placeholder {
|
|
|
- width: 80rpx;
|
|
|
-}
|
|
|
-
|
|
|
/* ===== 加载状态 ===== */
|
|
|
.loading-wrap {
|
|
|
display: flex;
|