feat(data): 历史数据页接入统计与历史接口,切换用户抽屉接真实成员
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Opus 4.7
parent
0fcb6eebef
commit
18704cbb76
@@ -1,91 +1,87 @@
|
||||
<scroll-view
|
||||
class="scrollView"
|
||||
scroll-y
|
||||
refresher-enabled
|
||||
refresher-triggered="{{ refresherTriggered }}"
|
||||
bind:refresherrefresh="onRefresh"
|
||||
bind:scrolltolower="onScrollToLower"
|
||||
>
|
||||
<view class="scrollViewContent">
|
||||
|
||||
<!-- 数据卡(用户信息 + 时间 Tab + 统计) -->
|
||||
<view class="data-card">
|
||||
|
||||
<!-- 用户信息 -->
|
||||
<view class="userInfo">
|
||||
<view class="avatar">张</view>
|
||||
<view class="info">
|
||||
<view class="info-name-row">
|
||||
<view class="info-name">张晓敏</view>
|
||||
<view class="data">
|
||||
<!-- 数据卡(用户信息 + 时间 Tab + 统计) -->
|
||||
<view class="data-card">
|
||||
<!-- 用户信息 -->
|
||||
<view class="userInfo" wx:if="{{ userInfo }}">
|
||||
<view class="avatar">{{ userInfo.realname[0] }}</view>
|
||||
<view class="info">
|
||||
<view class="info-name-row">
|
||||
<view class="info-name">{{ userInfo.realname }}</view>
|
||||
<block wx:if="{{ userInfo.isSelf }}">
|
||||
<view class="badge-self">本人</view>
|
||||
</view>
|
||||
<view class="info-meta">
|
||||
<view class="meta-text">男·36岁</view>
|
||||
<view class="meta-divider">|</view>
|
||||
<view class="meta-text">170cm</view>
|
||||
</view>
|
||||
</block>
|
||||
</view>
|
||||
<view class="info-meta">
|
||||
<view class="meta-text">{{ userInfo.sex_dictText }}</view>
|
||||
<view class="meta-divider">·</view>
|
||||
<view class="meta-text">{{ userInfo.age }}岁</view>
|
||||
<view class="meta-divider">|</view>
|
||||
<view class="meta-text">{{ userInfo.height }}cm</view>
|
||||
</view>
|
||||
<view class="btn" bind:tap="onTapSwitchMember">切换用户</view>
|
||||
</view>
|
||||
<view class="btn" bind:tap="onTapSwitchMember">切换用户</view>
|
||||
</view>
|
||||
|
||||
<view class="card-divider"></view>
|
||||
<view class="card-divider"></view>
|
||||
|
||||
<!-- 时间范围 Tab -->
|
||||
<view class="nav">
|
||||
<view class="active">近7日</view>
|
||||
<view>近30日</view>
|
||||
<view>近90日</view>
|
||||
<!-- 时间范围 Tab -->
|
||||
<view class="nav">
|
||||
<block wx:for="{{ rangeTabs }}" wx:key="key">
|
||||
<view class="{{ activeType === item.key ? 'active' : '' }}" data-key="{{ item.key }}" bind:tap="onTapRange">{{ item.label }}</view>
|
||||
</block>
|
||||
</view>
|
||||
|
||||
<!-- 统计摘要(4格) -->
|
||||
<view class="summary">
|
||||
<view class="summary-item">
|
||||
<view class="summary-label">最高体重</view>
|
||||
<view class="summary-value">{{ stats.maxWeight }}<text>kg</text></view>
|
||||
</view>
|
||||
|
||||
<!-- 统计摘要(4格) -->
|
||||
<view class="summary">
|
||||
<view class="summary-item">
|
||||
<view class="summary-label">最高体重</view>
|
||||
<view class="summary-value">89.6<text>kg</text></view>
|
||||
</view>
|
||||
<view class="summary-item">
|
||||
<view class="summary-label">最低体重</view>
|
||||
<view class="summary-value">89.6<text>kg</text></view>
|
||||
</view>
|
||||
<view class="summary-item">
|
||||
<view class="summary-label">平均体重</view>
|
||||
<view class="summary-value">89.6<text>kg</text></view>
|
||||
</view>
|
||||
<view class="summary-item">
|
||||
<view class="summary-label">体重变化</view>
|
||||
<view class="summary-value {{ stats.weightChange < 0 ? 'value-down' : 'value-up' }}">
|
||||
{{ stats.weightChange > 0 ? '+' : '' }}{{ stats.weightChange }}<text>kg</text>
|
||||
</view>
|
||||
<view class="summary-item">
|
||||
<view class="summary-label">最低体重</view>
|
||||
<view class="summary-value">{{ stats.minWeight }}<text>kg</text></view>
|
||||
</view>
|
||||
<view class="summary-item">
|
||||
<view class="summary-label">平均体重</view>
|
||||
<view class="summary-value">{{ stats.avgWeight }}<text>kg</text></view>
|
||||
</view>
|
||||
<view class="summary-item">
|
||||
<view class="summary-label">体重变化</view>
|
||||
<view class="summary-value {{ stats.weightChange < 0 ? 'value-down' : 'value-up' }}">
|
||||
{{ stats.weightChange > 0 ? '+' : '' }}{{ stats.weightChange }}<text>kg</text>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<!-- 有数据:记录列表 -->
|
||||
<block wx:if="{{ records.length }}">
|
||||
<view class="data-list">
|
||||
<block wx:for="{{ records }}" wx:key="recordId">
|
||||
<view class="list" bind:tap="onTapRecord" data-record-id="{{ item.recordId }}">
|
||||
<view>{{ item.examTime }}</view>
|
||||
<view class="arrow">
|
||||
<view>体重:<text>{{ item.weight }}kg</text></view>
|
||||
<view>BMI:<text>{{ item.bmi }}</text></view>
|
||||
<view>体脂率:<text>{{ item.fatRate }}%</text></view>
|
||||
</view>
|
||||
<view class="data-user-list">
|
||||
<scroll-view class="scrollView" scroll-y refresher-enabled refresher-triggered="{{ refresherTriggered }}" bind:refresherrefresh="onRefresh" bind:scrolltolower="onScrollToLower">
|
||||
<view class="scrollViewContent">
|
||||
|
||||
<!-- 有数据:记录列表 -->
|
||||
<block wx:if="{{ records.length }}">
|
||||
<view class="data-list">
|
||||
<block wx:for="{{ records }}" wx:key="recordId">
|
||||
<view class="list" bind:tap="onTapRecord" data-record-id="{{ item.recordId }}">
|
||||
<view>{{ item.examTime }}</view>
|
||||
<view class="arrow">
|
||||
<view>体重:<text>{{ item.weight }}kg</text></view>
|
||||
<view>BMI:<text>{{ item.bmi }}</text></view>
|
||||
<view>体脂率:<text>{{ item.fatRate }}%</text></view>
|
||||
</view>
|
||||
</view>
|
||||
</block>
|
||||
</view>
|
||||
</block>
|
||||
|
||||
<!-- 无数据:占位 -->
|
||||
<block wx:else>
|
||||
<empty-data text="暂无称重数据" />
|
||||
</block>
|
||||
|
||||
</view>
|
||||
</block>
|
||||
|
||||
<!-- 无数据:占位 -->
|
||||
<block wx:else>
|
||||
<empty-data />
|
||||
</block>
|
||||
</scroll-view>
|
||||
</view>
|
||||
</scroll-view>
|
||||
</view>
|
||||
|
||||
<select-member-drawer
|
||||
show="{{ showSelectDrawer }}"
|
||||
exclude-user-id="{{ userInfo.userId }}"
|
||||
bind:select="onSelectMember"
|
||||
bind:close="onCloseDrawer"
|
||||
/>
|
||||
<select-member-drawer show="{{ showSelectDrawer }}" source="history" exclude-user-id="{{ userInfo.userId || '' }}" bind:select="onSelectMember" bind:close="onCloseDrawer" />
|
||||
Reference in New Issue
Block a user