<view>
  <view class="header margin-bottom" style="padding-bottom:16rpx;">
    <view class="flex-box flex-v-ce selectItems border-bottom">
      <view data-index="1" class="{{activeIndex == 1? 'active':''}} flex-2" catchTap="activeItem">待完成</view>
      <view data-index="2" class="{{activeIndex == 2? 'active':''}} flex-2" catchTap="activeItem">待审批</view>
      <view data-index="3" class="{{activeIndex == 3? 'active':''}} flex-2" catchTap="activeItem" style="border-right:1px solid #f1f1f1">已审批</view>
      <view catchTap="selectSx" class="flex-1">
        <image mode="scaleToFill" class="sxImg" src="../../../image/sx.png"/>
      </view>
    </view>
    <form onReset="onReset">
      <view style="margin-top:16rpx;">
        <view class="search flex-box flex-v-ce">
          <image mode="scaleToFill" src="../../../image/ss.png"/>
          <input class="flex-1" placeholder="请输入任务内容" onInput="bindKeyInput" class="flex-1"/>
          <button a:if="{{isVal}}" class="delVal" formType="reset">×</button>
        </view>
      </view>
    </form>
  </view>
  <view class="main scroll">
    <scroll-view class="scroll" a:if="{{(activeIndex==1)&&list.length>0}}" scroll-y="{{true}}" onScrollToLower="onScrollToLower">
      <view class="task" a:if="{{toList.length>0}}">今日任务</view>
      <view class="li border-bottom" a:for="{{toList}}" a:if="{{toList.length>0}}" key="{{item.id}}">
        <view class="flex-box li-top" catchTap="openDetail" data-item="{{item}}">
          <view class="flex-1">{{item.task_name}}</view>
          <text class="red" a:if="{{item.point_config.base_point>0}}">+{{item.point_config.base_point}}  {{item.pt_name}}</text>
          <text a:else>{{item.point_config.base_point}}  {{item.pt_name}}</text>
        </view>
        <view class="flex-box li-bottom">
          <text class="flex-1 fontColorX" catchTap="openDetail" data-item="{{item}}">{{item.expire_time}} 截止</text>
          <button type="primary" class="defBtn" a:if="{{item.status == 1}}" data-is="{{true}}" data-item="{{item}}" onTap="openPerform">完成任务</button>
          <text class="yellowBox" a:if="{{item.status == 2}}">待审批</text>
          <text class="redBox" a:if="{{item.review_status == 2}}">审批驳回</text>
          <text class="greenBox" a:if="{{item.review_status == 1}}">审批通过</text>
        </view>
      </view>
      <view class="task">待完成任务</view>
      <view class="li border-bottom" a:for="{{list}}">
        <view class="flex-box li-top" catchTap="openDetail" data-item="{{item}}">
          <view class="flex-1">{{item.task_name}}</view>
          <text class="red" a:if="{{item.point_config.base_point>0}}">+{{item.point_config.base_point}}  {{item.pt_name}}</text>
          <text a:else>{{item.point_config.base_point}}  {{item.pt_name}}</text>
        </view>
        <view class="flex-box li-bottom">
          <text class="flex-1 fontColorX {{item.isCs? 'red':''}}" catchTap="openDetail" data-item="{{item}}">{{item.expire_time}} 截止</text>
          <button type="primary" class="defBtn" a:if="{{item.status == 1}}" data-item="{{item}}" onTap="openPerform">完成任务</button>
          <text class="yellowBox" a:if="{{item.status == 2}}">待审批</text>
          <text class="redBox" a:if="{{item.status == 3}}">审批驳回</text>
          <text class="greenBox" a:if="{{item.status == 4}}">审批通过</text>
        </view>
      </view>
      <view class="noDatas" a:if="{{isData}}">没有更多咯</view>
    </scroll-view>
    <scroll-view class="scroll" a:if="{{(activeIndex==2||activeIndex==3)&&list.length>0}}" scroll-y="{{true}}" onScrollToLower="onScrollToLower">
      <view class="li border-bottom" a:for="{{list}}">
        <view class="flex-box li-top" catchTap="openDetail" data-item="{{item}}">
          <view class="flex-1">{{item.task_name}}</view>
          <text class="red" a:if="{{item.point_config.base_point>0}}">+{{item.point_config.base_point}}  {{item.pt_name}}</text>
          <text a:else>{{item.point_config.base_point}}  {{item.pt_name}}</text>
        </view>
        <view class="flex-box li-bottom">
          <text class="flex-1 fontColorX" catchTap="openDetail" data-item="{{item}}">{{item.expire_time}} 截止</text>
          <button type="primary" class="defBtn" a:if="{{item.status == 1}}" data-item="{{item}}" onTap="openPerform">完成任务</button>
          <text class="yellow" a:if="{{item.review_status == 0}}">待处理</text>
          <text class="green" a:if="{{item.review_status == 1}}">已通过</text>
          <text class="red" a:if="{{item.review_status == 2}}">已驳回</text>
        </view>
      </view>
      <view class="noDatas" a:if="{{isData}}">没有更多咯</view>
    </scroll-view>
    <no-data a:if="{{list.length==0}}"></no-data>
  </view>
  <select-zp defaultSx="{{sxObj}}" typeIndex="2" a:if="{{showZp==true}}" isShow="{{showZp}}" onClose="onClose" onConfirm="onConfirmSx"></select-zp>
</view>