Files
bodyWeight/miniprogram/pages/data/data.wxml
T

87 lines
3.1 KiB
Plaintext
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
<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>
</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>
<view class="btn" bind:tap="onTapSwitchMember">切换用户</view>
</view>
<view class="card-divider"></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>
<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>
<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>
</scroll-view>
</view>
</view>
<select-member-drawer show="{{ showSelectDrawer }}" source="history" exclude-user-id="{{ userInfo.userId || '' }}" bind:select="onSelectMember" bind:close="onCloseDrawer" />