<wxs src="../../../../core/wxs/dictionary.wxs" module="dictionary" />

<!--module/health/components/report-health-patient/report-health-patient.wxml-->
<view class="card-wrapper">
  <t-cell t-class="card-header cell-border-gradient" t-class-description="patient-info-content">
    <block slot="description">
      <user-avatar class="avatar" size="60px"></user-avatar>
      <view class="content">
        <view class="row primary title">{{dataset.name}}</view>
        <view class="row">
          <span class="col">
            <text>个人简介：</text>
            <text class="text-item">{{dictionary.label($dictionaries, 'sys_user_sex', dataset.sex)}}</text>
            <text class="text-item">{{dataset.age}}岁</text>
            <text class="text-item" wx:for="{{specialPeriod}}" wx:key="*this">
              {{dictionary.label($dictionaries, 'women_special_period', item)}}
            </text>
            <text class="text-item" wx:for="{{job}}" wx:key="*this">
              {{dictionary.label($dictionaries, 'job', item)}}
            </text>
            <text class="text-item">手机号：{{phone}}</text>
            <text class="text-item">身份证号：{{cardno}}</text>
          </span>
        </view>
      </view>
    </block>
  </t-cell>
</view>

<view class="card-wrapper patient-data-wrapper">
  <t-cell t-class="card-header cell-border-gradient" t-class-title="card-header__title">
    <block slot="title">
      <text>基础信息</text>
      <t-loading wx:if="{{loading}}" theme="spinner" size="20px" class="loading" />
      <image wx:else class="icon" src="../../assets/icon/health-patient.icon.png" mode="heightFix"></image>
    </block>
    <block slot="right-icon">
      <slot name="extra"></slot>
    </block>

    <view slot="description" wx:if="{{!loading && !dataset}}">暂无数据</view>
  </t-cell>

  <view class="card-body">
    <image class="image-wrapper" src="../../assets/image/health-patient.png" mode="aspectFill" />
    <view class="content-wrapper">
      <view class="row title primary">
        <view>{{dataset.willillStateName}}</view>
      </view>
      <view class="row">
        <span class="col">
          <text>身高：</text>
          <text>{{dataset.height}}cm</text>
        </span>
        <span class="col">
          <text>体重：</text>
          <text>{{dataset.height}}kg</text>
        </span>
      </view>
      <view class="row">
        <span class="col">
          <text>饮酒：</text>
          <text>{{dictionary.label($dictionaries, 'sys_yes_no', dataset.drinkState)}}</text>
        </span>
        <span class="col">
          <text>抽烟：</text>
          <text>{{dictionary.label($dictionaries, 'sys_yes_no', dataset.smokeState)}}</text>
        </span>
      </view>
      <span class="row">
        <text>喜好口味：</text>
        <t-tag variant="outline" wx:for="{{hobbyFlavor}}" wx:key="*this">
          {{dictionary.label($dictionaries, 'hobby_flavor', item)}}
        </t-tag>
        <t-tag variant="outline" wx:if="{{!hobbyFlavor.length}}">无</t-tag>
      </span>
      <span class="row">
        <text>食物过敏：</text>
        <t-tag variant="outline" wx:for="{{foodAllergy}}" wx:key="*this">
          {{dictionary.label($dictionaries, 'food_allergy', item)}}
        </t-tag>
        <t-tag variant="outline" wx:if="{{!foodAllergy.length}}">无</t-tag>
      </span>
      <span class="row">
        <text class="text-item" wx:if="{{dataset.willillDegreeName}}">{{dataset.willillDegreeName}}</text>
        <text class="text-item" wx:if="{{dataset.willillSocialName}}">{{dataset.willillSocialName}}</text>
        <text class="text-item" wx:if="{{dataset.willillFunctionName}}">{{dataset.willillFunctionName}}</text>
      </span>
    </view>
  </view>

  <t-empty wx:if="{{message}}" t-class="empty-wrapper error" icon="info-circle" description="{{message}}" />
</view>