<!--pages/clock/clock.wxml-->
<wxs src="./clock.wxs" module="clock"></wxs>
<view class="container">
  <view class="no-authentication" wx:if="{{approveStatus === 2}}">
    <view class="header">
      <image src="{{imgServerUrl}}/images/clock/clock-bg.png" class="no-authentication-bg" mode="widthFixed"></image>
    </view>
    <view class="no-authentication-content">
      <image src="{{imgServerUrl}}/images/clock/clock-no-certified.png" class="no-authentication-img"></image>
      <view class="no-authentication-content-text">
        <view>您的审核未通过</view>
        <view>
          <text>请再次上传您本人的真实身份证图片，</text>
          <view>
            <text>已经上传将无法更改。</text>
          </view>
        </view>
      </view>
      <navigator class="no-authentication-content-button" url="../identification/index?from=clock">
        前往认证
      </navigator>
    </view>
    <image bindtap="toRule" src="{{imgServerUrl}}/images/clock/clock-video.png" class="video"></image>
  </view>
  <view class="no-pass" wx:elif="{{approveStatus === 0}}">
    <view class="header">
      <image src="{{imgServerUrl}}/images/clock/clock-bg.png" class="no-pass-bg" mode="widthFixed"></image>
    </view>
    <view class="no-pass-content">
      <image src="{{imgServerUrl}}/images/clock/clock-no-certified.png" class="no-passs-img"></image>
      <view class="no-pass-content-text">
        <view>您还没有实名认证</view>
        <view>为保证账户安全，请完成实名认证后再进行打卡签到。</view>
      </view>
      <navigator class="no-pass-content-button" url="../identification/index?from=clock">
        前往认证
      </navigator>
    </view>
    <image  bindtap="toRule" src="{{imgServerUrl}}/images/clock/clock-video.png" class="video"></image>
  </view>
  <view class="pass" wx:else>
    <view class="pass-header">
      <image src="{{imgServerUrl}}/images/clock/clock-bg-home.png" class="pass-header-bg" mode="widthFixed"></image>
      <view class="pass-header-content">
        <view class="time">
          <view>本周工时</view>
          <view>
            <text class="number">{{clock.toFixed(sumDuration)}}</text>
            <text class="unit">小时</text>
          </view>
        </view>
        <view class="money">
          <view>本周预支</view>
          <view>
            <text class="number">{{clock.toFixed(sumMoney)}}</text>
            <text class="unit">元</text>
          </view>
        </view>
      </view>
      <view class="pass-header-message">实际预支发放结合企业考勤，以上金额仅供参考。</view>
      <view class="pass-header-footer">
        <view class="pass-header-footer-view" wx:for="{{navigation}}" wx:key='index' data-index="{{index}}"
          bindtap="navigator">
          <image src='{{imgServerUrl}}{{item.image}}'></image>
          <text>{{item.text}}</text>
        </view>
      </view>
    </view>
    <view class="pass-content {{clockType === 4 ?'height':''}}">
      <view class="status">
        <view class="clock-in">
          <text>上班打卡</text>
          <view class="clock-time">
            <image src="{{imgServerUrl}}/images/clock/clock-success-icon.png" wx:if="{{startPunch !== '未完成' }}"></image>
            <text class="status-text" wx:if="{{startPunch !== '未完成' }}">{{clock.formateHS(startPunch)}} 已打卡</text>
            <text class="status-text" wx:else>{{startPunch}}</text>
          </view>
        </view>
        <view class="clock-out">
          <text>上班打卡</text>
          <view class="clock-time">
            <image src="{{imgServerUrl}}/images/clock/clock-success-icon.png" wx:if="{{endPunch !== '未完成' }}"></image>
            <text class="status-text" wx:if="{{endPunch !== '未完成' }}">{{clock.formateHS(endPunch)}} 已打卡</text>
            <text class="status-text" wx:else>{{endPunch}}</text>
          </view>
        </view>
      </view>
      <view class="rule-messgae">规则：请根据企业实际上下班时间打卡</view>
      <view wx:if="{{approveStatus === 1}}" class="image">
        <image src="{{imgServerUrl}}/images/clock/clock-approving.png"></image>
      </view>
      <view wx:else class="image" bindtap="click">
        <image src="{{statusImage}}"></image>
      </view>
      <view class="clock-status" wx:if="{{approveStatus === 1}}">
        <image src="{{imgServerUrl}}/images/clock/clock-waring.png"></image>
        <text>我们会尽快完成实名认证审核</text>
      </view>
      <view class="clock-status" wx:else>
        <image src="{{statusIcon}}"></image>
        <text>{{statusMessage}}</text>
      </view>
      <view class="reload-location" bindtap="load" wx:if="{{clockType === 3}}">
        <image src="{{imgServerUrl}}/images/clock/refresh.png"></image>
        <text>重新定位</text>
      </view>
      <view class="prepayable">
        <text>当日可预支工资：</text>
        <view>
          <text class="prepayable-number">{{clock.toFixed(todayMoney)}}</text>
          <text class="prepayable-unit">元</text>
        </view>
      </view>
    </view>
    <image bindtap="toRule" src="{{imgServerUrl}}/images/clock/clock-video.png" class="video"></image>
  </view>
</view>
<view class="cover" hidden="{{showCover}}" bindtap="changeCoverStatus">
  <view class="cover-kefu">
    <view class="cover-kefu-title">开心工作客服电话</view>
    <view class="cover-kefu-number">400-692-0099</view>
    <view class="cover-kefu-tips">在线时间：每天8:00-21:00</view>
    <view class="cover-kefu-button" bindtap="callKefu">
      <image src="{{imgServerUrl}}/images/clock/clock-phone-call.png"></image>
      <text>一键拨号</text>
    </view>
  </view>
</view>