<import-sjs name="utils" from="./index.sjs"/>
<mas-adc-nav-bar background="#1677FF" zIndex="100"/>
<wrapper>
  <view class="personal-center-head">
    <view class="personal-center-container">
      <!-- 未登录 -->
      <view
        class="login login-out"
        a:if="{{ !isLogin }}"
      >
        <view class="login-top">
          <view class="login-top-title">
            未登陆
          </view>
          <view class="login-top-desc">
            登陆查看个人信息
          </view>
        </view>
        <button
          class="login-btn"
          onTap="onLogin"
        >
          <view>
            去登陆
          </view>
        </button>
      </view>
      <!-- 已登陆 -->
      <view class="login login-in" a:else>
        <view class="login-top">
          <view class="login-top-left">
            <view class="avatar">
              <image
                class="avatar-img"
                src="{{ userInfo.avatar }}"
              />
            </view>
            <view class="title">
              <view class="user-name">
                {{ userInfo.nickName }}
              </view>
              <view
                class="user-number"
                a:if="{{ cardInfo.hisPatientId }}"
              >
                <text number-of-lines="1">
                  就诊卡号：{{ cardInfo.hisPatientId  }}
                </text>
              </view>
            </view>
          </view>
          <!-- <view class="login-top-right">
            <view class="change-btn" onTap="changeBtn">
              切换就诊人
            </view>
          </view> -->
        </view>
        <view class="login-buttons">
          <block a:if="{{ cardInfo }}">
            <!-- <view
              class="login-btn"
              onTap="toPatientDetail"
              a:if="{{ cardInfo.hisPatientId }}"
            >
              <view class="login-btn-content">
                <image
                  class="btn-icon"
                  src="{{ qrImage }}"
                />
                <text>二维码</text>
              </view>
            </view> -->
            <view class="login-btn" a:if="{{ !cardInfo.hisPatientId }}" onTap="toAddCard">
              <view class="login-btn-content">
                <image
                  class="btn-icon"
                  src="{{ addIcon }}"
                />
                <text>添加就诊人</text>
              </view>
            </view>
          </block>
        </view>
      </view>
    </view>
  </view>
</wrapper>
<patient-selector
  onClose="onClose"
  onChange="onChange"
  show="{{ showPatient }}"
  autoSelectDefault="{{ false }}"
/>
