<view>
  <view class="weui-search-bar weui-search-bar_focusing" id="searchBar" style="line-height: 1;background-color: #fff;">
    <form class="weui-search-bar__form flex-1">
      <view class="weui-search-bar__box" catchtap="goSearch" style="background-color: #f5f5f5;border-radius: 17px;">
        <i class="iconfont icon-sousuo11"></i>
        <!-- <input type="text" class="weui-search-bar__input" placeholder-style="color:#999;" placeholder="搜索姓名、手机号" value="{{inputVal}}" focus="{{inputShowed}}" bindinput="inputTyping" bindconfirm="searchKey" confirm-type="search" style="width: 200px;" />
        <view class="iconfont icon-qingchu1" wx:if="{{inputVal.length > 0}}" bindtap="clearInput"></view>
        <view class="search" bindtap="searchKey">搜索</view> -->
        <view class="weui-search-bar__input {{!chaShowed ? 'c9' : 'c3'}}" style="width: 160px;">{{inputVal}}</view>
        <view class="iconfont icon-qingchu1" wx:if="{{chaShowed}}" catchtap="clearInput"></view>
        <view class="search" catchtap="searchKey">搜索</view>
      </view>
      <!-- <label class="weui-search-bar__label" bindtap="showInput">
          <i class="weui-icon-search"></i>
          <span class="weui-search-bar__text">搜索工作</span>
        </label> -->
    </form>
  </view>
</view>
<view class="topMenu" wx:if='{{currIndex != 3}}'>
  <view class="onMune  {{currIndex == '0' ? 'active' : ''}}" data-id="0" bindtap="changeMenu">
    <view class="pr dib">
      全部
      <!-- <view class="top-circle"></view> -->
      <view class="menuBorder"></view>
    </view>
  </view>
  <view class="onMune  {{currIndex == '1' ? 'active' : ''}}" data-id="1" bindtap="changeMenu">
    <view class="pr dib">
      待确认
      <view class="menuBorder"></view>
    </view>
  </view>
  <view class="onMune  {{currIndex == '2' ? 'active' : ''}}" data-id="2" bindtap="changeMenu">
    <view class="pr dib">
      已确认
      <view class="menuBorder"></view>
    </view>
  </view>
</view>
<!-- top: -1000px; left: -1000px; -->
<canvas type='2d' style="position: absolute;left:-2000px; width: 425px; height: 350px; background: #fff;" id="canvasId"></canvas>
<scroll-view class="container {{currIndex == '1' ? 'total' : 'nottotal'}}" scroll-y enable-back-to-top="true" refresher-enabled bindscrolltolower="onScrollToLower" bindrefresherrefresh="onScrollRefresh" refresher-triggered="{{isTrigger}}">
  <view class="totalPriceInfoContainer" wx:if="{{recordList.length != 0}}">
    <view class="totalPriceInfo">
      <button wx:if="{{currIndex == '1' || currIndex == '0'}}" open-type="share" class="sharebtn share" style="padding:0;font-weight:100" bindtap='copyText'>
        <i class="iconfont icon-zhuanfa1 f20" style="color: #333;font-size: 16px"></i>
      </button>
      <view class="c6">
        税后金额（元）
        <view class="f28 ysd-base-color fw500">{{(factoryBill.totalSalary || '-') + '元'}}</view>
      </view>
      <view class="fsa c6">
        <view class="taxPrecent">
          税点 (%)
          <view class="c3 f18 fw500">{{factoryBill.taxRate || '-'}}</view>
        </view>
        <view class="beforePrice c6">
          税前金额 (元)
          <view class="c3 f18 fw500">{{factoryBill.totalServicePrice || '-'}}</view>
        </view>
      </view>
      <view class="fsa f13 c6 footer">
        <view class="oelps" style='max-width:160px'>{{factoryBill.title || '-'}}</view>
        <view class="oelps" style='max-width:160px'>{{billInfo.agencyName || '-'}}</view>
      </view>
    </view>
  </view>
  <view class="">
    <!-- 不是待确认时候显示的列表 -->
    <block wx:if="{{recordList != null && recordList.length > 0 && currIndex != 1}}">
      <view class="display-flex bgf fsa" hover-class="hcb" style="border-bottom:1px solid #eee;padding:16px 12px;" wx:for="{{recordList}}" wx:for-item="item" wx:for-index="idx" wx:key="idx" data-id="{{item.id}}" data-name="{{item.companyName}}" bindtap="goDetail">
        <view class="">
          <view class="pb4 fw500" style="">{{item.userName || '-'}}</view>
          <view class="f14 c6">{{item.workInfo + ' | ' + "服务费" + ((item.settlePrice == '' && item.settleUnit == '') ? '-' : ((item.settlePrice || '-') + (item.settleUnit || '-'))) }}</view>
          <!-- <view class="f14 c6">
            {{(item.finished || '-') + ' | ' + "服务费"}}
            <block wx:if="{{settlePrice == '' && settleUnit == ''}}">
              <text>-</text>
            </block>
            <block wx:else>
              <text>{{settlePrice ? settlePrice : '-'}}</text>
              <text>{{settleUnit ? settleUnit : '-'}}</text>
            </block>
          </view> -->
        </view>
        <view class="tar display-flex">
          <view class="vsb">
            <view class="pb4 ysd-base-color fw500">{{(item.salary  || '-') + '元'}}</view>
            <view class="f14 {{item.status == 1 ? 'cccc' : 'c3'}}">{{item.status == 10 ? '待确认' : '已确认'}}</view>
          </view>
          <icon class="iconfont icon-gengduo1 c9 ml4" type="" size="28" color=""></icon>
        </view>
      </view>
      <view wx:if="{{!hasMoreData && !isLoading}}" class="f12 c9 tc p20">暂无更多数据</view>
      <view wx:else class="f12 c9 tc p20">上滑加载更多</view>
    </block>
    <!-- 待确认时候显示的列表 -->
    <block wx:if="{{currIndex == 1}}">
      <view class="display-flex bgf fsa" hover-class="hcb" style="border-bottom:1px solid #eee;padding:16px 12px;" wx:for="{{recordList}}" wx:for-item="item" wx:for-index="idx" wx:key="idx" data-id="{{item.id}}" data-name="{{item.companyName}}" bindtap="goDetail">
        <view class="fsa">
          <view class="">
            <radio-group bindchange="radioChange" class="fr radiogroup">
              <radio value="{{item.id}}" data-id='{{item.id}}' catchtap='stopEvent' color="#1890ff" checked="{{item.checked}}" style="transform:scale(.8);margin-right:4px;"></radio>
            </radio-group>
          </view>
          <view class="">
            <view class="pb4 fw500" style="">{{item.userName || '-'}}</view>
            <view class="f14 c6">{{item.workInfo + ' | ' + "服务费" + ((item.settlePrice == '' && item.settleUnit == '') ? '-' : ((item.settlePrice || '-') + (item.settleUnit || '-')))}}</view>
          </view>
        </view>
        <view class="tar display-flex">
          <view class="vsb">
            <view class="pb4 ysd-base-color fw500">{{(item.salary || '-') + '元'}}</view>
            <view class="f14 {{item.status == 1 ? 'cccc' : 'c3'}}">{{item.status == 10 ? '待确认' : '已确认'}}</view>
          </view>
          <icon class="iconfont icon-gengduo1 c9 ml4" type="" size="28" color=""></icon>
        </view>
      </view>
    </block>
    <block wx:if="{{(recordList == null || recordList.length == 0) && !isLoading}}">
      <view style="margin-top:128rpx;">
        <view class="center">
          <icon class='t-icon cccc t-icon-zanwu' style='width:86px;height:86px;margin-bottom:20px;margin-top:30px'></icon>
          <view class="f16 cccc">暂无记录</view>
        </view>
      </view>
    </block>
  </view>
</scroll-view>
<!-- 待确认的整体选择区域 -->
<view class="footerBox" wx:if="{{currIndex == 1}}">
  <view class="display-flex">
    <radio-group bindchange="radioChange" class="fr radiogroup">
      <radio value="{{1}}" catchtap='totalChange' color="#1890ff" checked="{{isChecked}}" style="transform:scale(.8);margin-right:4px;"></radio>
    </radio-group>
    <view class="" selectable="false" space="false" decode="false">全选</view>
    <view class="ml24" selectable="false" space="false" decode="false">
      合计：
      <p class="ysd-base-color" selectable="false" space="false" decode="false">{{selectTotalSalary + '元'}}</p>
    </view>
  </view>
  <view aria-role="button" class="weui-btn weui-btn_primary" bindtap="confirmBill">确认账单</view>
</view>
<view aria-role="dialog" aria-modal="true">
  <view class="weui-mask weui-transition {{dialog ? 'weui-transition_show' : ''}}" bindtap="closeDrawer" aria-role="button" aria-label="关闭"></view>
  <view class="weui-half-screen-dialog weui-half-screen-dialog_large weui-transition {{dialog ? 'weui-transition_show' : ''}}">
    <view class="weui-half-screen-dialog__hd por">
      <view class="weui-half-screen-dialog__hd__side" bindtap="closeDrawer">
        <view aria-role="button" class="weui-icon-btn">
          关闭
          <i class="weui-icon-close-thin"></i>
        </view>
      </view>
      <view class="weui-half-screen-dialog__hd__main">
        <strong class="weui-half-screen-dialog__title f18">{{billInfo.title}}</strong>
      </view>
    </view>
    <view class="weui-half-screen-dialog__bd">
      <view class="weui-cell">
        <view class="weui-cell__hd">
          <label class="weui-label c6 ">姓名</label>
        </view>
        <view class="weui-cell__bd tr c3">{{currentDetail.userName || '-'}}</view>
      </view>
      <view class="weui-cell">
        <view class="weui-cell__hd">
          <label class="weui-label c6 ">身份证</label>
        </view>
        <view class="weui-cell__bd tr c3">{{currentDetail.idCard || '-'}}</view>
      </view>
      <view class="weui-cell">
        <view class="weui-cell__hd">
          <label class="weui-label c6 ">企业</label>
        </view>
        <view class="weui-cell__bd tr c3">{{currentDetail.storeName || '-'}}</view>
      </view>
      <view class="weui-cell">
        <view class="weui-cell__hd">
          <label class="weui-label c6 ">报名时间</label>
        </view>
        <view class="weui-cell__bd tr c3">{{currentDetail.applyTimeStr || '-'}}</view>
      </view>
      <view class="weui-cell">
        <view class="weui-cell__hd">
          <label class="weui-label c6 ">入职时间</label>
        </view>
        <view class="weui-cell__bd tr c3">{{currentDetail.entryTimeStr || '-'}}</view>
      </view>
      <view class="weui-cell">
        <view class="weui-cell__hd">
          <label class="weui-label c6 ">离职时间</label>
        </view>
        <view class="weui-cell__bd tr c3">{{currentDetail.leaveTimeStr || '-'}}</view>
      </view>
      <view class="weui-cell">
        <view class="weui-cell__hd">
          <label class="weui-label c6 ">是否达标</label>
        </view>
        <view class="weui-cell__bd tr c3">{{currentDetail.finished || '-'}}</view>
      </view>
      <view class="weui-cell">
        <view class="weui-cell__hd">
          <label class="weui-label c6 ">出勤时间</label>
        </view>
        <view class="weui-cell__bd tr c3">{{currentDetail.workDays || '-'}}</view>
      </view>
      <view class="weui-cell">
        <view class="weui-cell__hd">
          <label class="weui-label c6 ">利润单价</label>
        </view>
        <view class="weui-cell__bd tr c3">{{currentDetail.settlePrice || '-'}}</view>
      </view>
      <view class="weui-cell">
        <view class="weui-cell__hd">
          <label class="weui-label c6 ">结算单位</label>
        </view>
        <view class="weui-cell__bd tr c3">{{currentDetail.settleUnit || '-'}}</view>
      </view>
      <view class="weui-cell">
        <view class="weui-cell__hd">
          <label class="weui-label c6 ">服务费</label>
        </view>
        <view class="weui-cell__bd tr c3">{{currentDetail.servicePrice || '-'}}</view>
      </view>
      <view class="weui-cell">
        <view class="weui-cell__hd">
          <label class="weui-label c6 ">税点</label>
        </view>
        <view class="weui-cell__bd tr c3">{{currentDetail.taxRate || '-'}}</view>
      </view>
      <view class="weui-cell">
        <view class="weui-cell__hd">
          <label class="weui-label c6 ">应结费用</label>
        </view>
        <view class="weui-cell__bd tr c3">{{currentDetail.salary || '-'}}</view>
      </view>
      <view class="weui-cell" wx:for="{{currentDetail.customize}}" wx:for-item="item" wx:for-index="idx" wx:key="idx">
        <view class="weui-cell__hd">
          <label class="weui-label c6 ">{{item.title}}</label>
        </view>
        <view class="weui-cell__bd tr c3">{{currentDetail[item.dataIndex] || '-'}}</view>
      </view>
      <view class="weui-cell">
        <view class="weui-cell__hd">
          <label class="weui-label c6 ">备注</label>
        </view>
        <view class="weui-cell__bd tr c3">{{currentDetail.remarks || '-'}}</view>
      </view>
    </view>
    <view class="weui-half-screen-dialog__ft">
      <view class="weui-half-screen-dialog__btn-area" wx:if="{{currentDetail.status == 10}}">
        <view aria-role="button" class="weui-btn weui-btn_primary" bindtap="confirmBill">确认账单</view>
      </view>
    </view>
  </view>
</view>