<view class="page">
  <navigation-bar title="我的" back="{{false}}" color="white" background="#357ABD" />

  <!-- 家庭成员卡片 -->
  <view class="header">
    <view class="avatar">{{member.avatar || '👤'}}</view>
    <view class="name">{{member.name || '点击添加家庭成员'}}</view>
    <view class="relation" wx:if="{{member.relation}}">{{member.relation}}</view>
    <view class="edit-btn" bindtap="goEdit">{{member.name ? '编辑信息' : '添加信息'}}</view>
    </view>

   <!-- 红包记录入口 -->
   <view class="red-packet-card" bindtap="goRedHistory">
     <view class="red-packet-left">
       <view class="red-packet-icon">
         <text class="icon-text">🧧</text>
       </view>
       <view class="red-packet-title">红包记录</view>
     </view>
     <view class="red-packet-arrow">›</view>
   </view>

   <!-- 成员详细信息 -->
  <view class="content" wx:if="{{member.name}}">
    <view class="info-card">
      <view class="info-row">
        <view class="info-label">姓名</view>
        <view class="info-value">{{member.name}}</view>
      </view>
      <view class="info-row">
        <view class="info-label">性别</view>
        <view class="info-value">{{member.gender || '未填写'}}</view>
      </view>
      <view class="info-row">
        <view class="info-label">出生日期</view>
        <view class="info-value">{{member.birthday || '未填写'}}</view>
      </view>
      <view class="info-row">
        <view class="info-label">关系</view>
        <view class="info-value">{{member.relation || '未填写'}}</view>
      </view>
    </view>

    <view class="info-card">
      <view class="card-title">📋 健康信息</view>
      <view class="info-row">
        <view class="info-label">血型</view>
        <view class="info-value">{{member.bloodType || '未填写'}}</view>
      </view>
      <view class="info-row">
        <view class="info-label">过敏史</view>
        <view class="info-value {{member.allergies ? '' : 'empty'}}">{{member.allergies || '无'}}</view>
      </view>
      <view class="info-row">
        <view class="info-label">慢性病史</view>
        <view class="info-value {{member.chronicDiseases ? '' : 'empty'}}">{{member.chronicDiseases || '无'}}</view>
      </view>
      <view class="info-row">
        <view class="info-label">长期用药</view>
        <view class="info-value {{member.longTermMeds ? '' : 'empty'}}">{{member.longTermMeds || '无'}}</view>
      </view>
      <view class="info-row">
        <view class="info-label">备注</view>
        <view class="info-value {{member.notes ? '' : 'empty'}}">{{member.notes || '无'}}</view>
      </view>
    </view>
  </view>

  <!-- 空状态 -->
  <view class="empty-state" wx:else>
    <view class="empty-icon">👨‍👩‍👧‍👦</view>
    <view class="empty-title">还未添加家庭成员</view>
    <view class="empty-desc">添加家庭成员信息，方便管理全家用药</view>
    <view class="go-add-btn" bindtap="goEdit">添加家庭成员</view>
  </view>
</view>
