<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 no-body" bordered="{{false}}" t-class-description="patient-info-content" style="padding:10px">
    <block slot="description">
      <image class="user-image avatar" src="/module/health/assets/image/health-report.png" mode="aspectFill" />
      <view class="content">
        <view class="row primary title">{{dataset.name}}</view>
        <view class="row">
          <span class="col">
            <text class="text-item">{{dictionary.label($dictionaries, 'sys_user_sex', dataset.sex)}}</text>
            <text class="text-item" wx:if="{{dataset.age}}">{{dataset.age}}岁</text>
            <block wx:for="{{specialPeriod}}" wx:key="*this">
              <text class="text-item" wx:if="{{dictionary.label($dictionaries,'women_special_period', item) !== '无'}}">{{dictionary.label($dictionaries,'women_special_period', item)}}</text>
            </block>
            <text class="text-item" wx:for="{{job}}" wx:key="*this">{{dictionary.label($dictionaries, 'job', item)}}</text>
            <view class="text-items" wx:if="{{dataset.phone}}"><text style="color:#8C8C8C">手机号：</text><text style="color:black">{{dataset.phone}}</text></view>
            <view class="text-items" wx:if="{{dataset.cardno}}"><text style="color:#8C8C8C">身份证号：</text>
              <view style="color:black">{{dataset.cardno}}</view>
            </view>
          </span>
        </view>
      </view>
    </block>
  </t-cell>
</view>

<view class="card-wrapper patient-data-wrapper">
  <view class="card-box">
    <block slot="title">
      <text class="basic-info">基础信息</text>
      <t-loading wx:if="{{loading}}" theme="spinner" size="20px" class="loading" />
    </block>
    <block slot="right-icon">
      <slot name="extra"></slot>
    </block>
    <view slot="description" wx:if="{{!loading && !dataset}}">暂无数据</view>
  </view>

  <view class="body-box">
    <image class="image-wrapper" src="../../assets/image/health-report.png" mode="aspectFill" />
    <view class="content-wrapper">
      <view class="row title primary">
        <view>{{dataset.willillStateName}}</view>
      </view>
      <view class="row">
        <view class="col" wx:if="{{dataset.height}}" style="display:flex">
          <view style="color:#8C8C8C">身高：</view>
          <view>{{dataset.height}}cm</view>
        </view>
        <view class="col" wx:if="{{dataset.weight}}" style="display:flex">
          <text style="color:#8C8C8C">体重：</text>
          <text>{{dataset.weight}}kg</text>
        </view>
      </view>
      <view class="row">
        <view class="col" wx:if="{{dictionary.label($dictionaries, 'sys_yes_no', dataset.drinkState)}}" style="display:flex">
          <text style="color:#8C8C8C">饮酒：</text>
          <text>{{dictionary.label($dictionaries, 'sys_yes_no', dataset.drinkState)}}</text>
        </view>
        <view class="col" wx:if="{{dictionary.label($dictionaries, 'sys_yes_no', dataset.smokeState)}}" style="display:flex">
          <text style="color:#8C8C8C">抽烟：</text>
          <text>{{dictionary.label($dictionaries, 'sys_yes_no', dataset.smokeState)}}</text>
        </view>
      </view>
      <view class="row" style="display:flex">
        <text style="color:#8C8C8C">喜好口味：</text>
        <t-tag t-class="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>
      </view>
      <view class="row" style="display:flex">
        <text style="color:#8C8C8C">食物过敏：</text>
        <t-tag t-class="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>
      </view>
      <view 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>
      </view>
    </view>
  </view>

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