<import-sjs from="./index.sjs" name="page"/>
<import-sjs from="./../../utils/render.sjs" name="utils"/>

<wrapper>
  <view class="loading-full-page" a:if="{{loading}}"><loading /></view>
  <view class="user-cert-qrcode-page" a:else>
    <view class="user-qrcode-card">
      <view class="user-qrcode-card-header" style="{{ utils.getHeaderStyle(pageInfo.extInfo, imgSrcPrefix )}}">
        <view class="user-avatar">
          <image src="{{ page.getCardIcon(pageInfo, imgSrcPrefix) }}"/>
        </view>
        <view class="user-info">
          <view class="user-name">
            <text number-of-lines="2">
              {{ pageInfo.certName || serviceInfo.title }}
            </text>
          </view>
          <view class="user-desc">
            <text number-of-lines="2">
              {{ pageInfo.grantOrg }}
            </text>
          </view>
        </view>
      </view>
      <view class="user-qrcode-card-content">
        <view class="qrcode-image">
          <image src="{{ page.getQrcode(pageInfo) }}" />
          <view class="refresh-mask" onTap="onRefreshHandel" a:if="{{ shouldRefresh }}">
            <view><image src="https://gw.alipayobjects.com/mdn/rms_8ed4a1/afts/img/A*gbYiSZLKpDgAAAAAAAAAAAAAARQnAQ"/></view>
          </view>
        </view>
        <view class="qr-tip">
          <image src="https://gw.alipayobjects.com/mdn/rms_8ed4a1/afts/img/A*ynVrQICaqIAAAAAAAAAAAAAAARQnAQ" class="ref-icon"/>
          <view>{{ page.getTip(pageInfo.extInfo) }}</view>
        </view>
      </view>
    </view>
    <view class="footer-items">
      <view class="footer-item">
        <view>姓名</view>
        <view>{{ pageInfo.userNameDe }}</view>
      </view>
      <view class="footer-item">
        <view>电子码类型</view>
        <view>{{ pageInfo.identityType }}</view>
      </view>
    </view>
  </view>
</wrapper>
