Files
bodyWeight/miniprogram/pages/data/data.wxml
T
17792275749andClaude Opus 4.7 485725a486 refactor: 统一术语「成员」→「用户」,代码格式化
- 页面文案、注释、Toast 提示统一改为"用户"
- lefu 模块缩进格式化(空格→Tab)
- selectMemberDrawer 组件注释统一

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-06-10 15:18:58 +08:00

107 lines
3.2 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.
<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">{{ 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>
<!-- 有数据:记录列表 -->
<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>
<view class="empty-state">
<view class="empty-icon">
<image src="/images/data/noData.png" mode="aspectFit"/>
</view>
<view class="empty-text">暂无称重数据</view>
</view>
</block>
</view>
</scroll-view>
<select-member-drawer
show="{{ showSelectDrawer }}"
source="history"
exclude-user-id="{{ userInfo.userId }}"
bind:select="onSelectMember"
bind:close="onCloseDrawer"
/>