<view>
  <view class="header margin-bottom">
    <!--<form onReset="onReset"><view class="search flex-box flex-v-ce"><image mode="scaleToFill" src="../../../image/ss.png"></image><input placeholder="请输入姓名或事件内容搜索" onInput="bindKeyInput" class="flex-1"></input><button a:if="{{isVal}}" class="delVal" formType="reset">×</button></view></form> -->
    <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>
  </view>
  <view class="main scroll">
    <scroll-view class="scroll" a:if="{{(activeIndex==1||activeIndex==2)&&list.length>0}}" scroll-y="{{true}}" onScrollToLower="onScrollToLower">
      <view class="flex-box li border-bottom" data-index="1" a:for="{{list}}" catchTap="openDetail" data-item="{{item}}">
        <img-box name="{{item.employee_name}}" a:if="{{activeIndex==1}}" imgUrl="{{item.employee_img_url}}" height="80rpx" width="80rpx" fSize="24rpx"></img-box>
        <block a:if="{{activeIndex==2}}">
          <img-box name="{{item.owner_name}}" a:if="{{item.receiver_id==0}}" imgUrl="{{item.owner_img_url}}" height="80rpx" width="80rpx" fSize="24rpx"></img-box>
          <img-box name="{{item.receiver_name}}" a:else imgUrl="{{item.receiver_img_url}}" height="80rpx" width="80rpx" fSize="24rpx"></img-box>
        </block>
        <view class="flex-1 main-right">
          <view class="flex-box flex-v-ce">
            <view class="name flex-1" a:if="{{activeIndex==1}}">{{item.employee_name}}</view>
            <block a:else>
              <view class="name flex-1" a:if="{{item.status == 2 || item.status == 3 || item.receiver_id !=0 && item.status == 4}}">{{item.receiver_name}}的{{item.pt_name}}任务</view>
              <view class="name flex-1" a:if="{{item.status == 1 || item.status == -1 || item.receiver_id ==0 &&item.status == 4}}">我发布的{{item.pt_name}}任务</view>
            </block>
            <block a:if="{{activeIndex==1}}">
              <block a:if="{{item.point_config.review_point>0}}">
                <view class="red" a:if="{{item.point_config.review_point>0}}">+{{item.point_config.review_point}} {{item.pt_name}}</view>
                <view class="green" a:else>{{item.point_config.review_point}} {{item.pt_name}}</view>
              </block>
              <block a:else>
                <view class="red" a:if="{{item.point_config.base_point>0}}">+{{item.point_config.base_point}} {{item.pt_name}}</view>
                <view class="green" a:else>{{item.point_config.base_point}} {{item.pt_name}}</view>
              </block>
            </block>
            <block a:else>
              <view class="red" a:if="{{item.base_point>0}}">+{{item.base_point}} {{item.pt_name}}</view>
              <view class="green" a:else>{{item.base_point}} {{item.pt_name}}</view>
            </block>
          </view>
          <view class="context" a:if="{{item.task_name}}">{{item.task_name}}</view>
          <view class="flex-box flex-v-ce">
            <view class="date flex-1">{{item.expire_time}}截止</view>
            <block a:if="{{activeIndex==1}}">
              <view class="yellowBox2" a:if="{{item.status==1}}">进行中</view>
              <view class="greenBox" a:elif="{{item.status==2}}">已完成</view>
              <view class="redBox" a:elif="{{item.status==3}}">退回</view>
              <view class="greenBox" a:elif="{{item.status==4}}">已审批</view>
              <view class="textBox" a:else>已撤回</view>
            </block>
            <block a:else>
              <view class="yellowBox" a:if="{{item.status==1}}">待领取</view>
              <view class="yellowBox2" a:elif="{{item.status==2}}">进行中</view>
              <view class="greenBox" a:elif="{{item.status==3}}">已完成</view>
              <view class="textBox" a:elif="{{item.status==4}}">已撤回</view>
              <view class="redBox" a:else>已过期</view>
            </block>
          </view>
        </view>
      </view>
      <view class="noDatas" a:if="{{isData}}">没有更多咯</view>
    </scroll-view>
    <scroll-view class="scroll" a:if="{{activeIndex==3&&list.length>0}}" scroll-y="{{true}}" onScrollToLower="onScrollToLower">
      <view class="li2 border-bottom" data-index="2" a:for="{{list}}" catchTap="openDetail" data-item="{{item}}">
        <view style="margin-bottom:10rpx;">{{item.name}}</view>
        <view class="flex-box flex-v-ce fontColorX" style="font-size:28rpx;">
          <image mode="scaleToFill" src="../../../image/sj2.png"/>
          <text a:if="{{item.task_cycle == 1}}">每天自动发布</text>
          <text a:if="{{item.task_cycle == 2}}">
            <text a:if="{{item.task_cycle_value == 1}}">每周一自动发布</text>
            <text a:if="{{item.task_cycle_value == 2}}">每周二自动发布</text>
            <text a:if="{{item.task_cycle_value == 3}}">每周三自动发布</text>
            <text a:if="{{item.task_cycle_value == 4}}">每周四自动发布</text>
            <text a:if="{{item.task_cycle_value == 5}}">每周五自动发布</text>
            <text a:if="{{item.task_cycle_value == 6}}">每周六自动发布</text>
            <text a:if="{{item.task_cycle_value == 7}}">每周日自动发布</text>
          </text>
          <text a:if="{{item.task_cycle == 3}}">每月自动发布</text>
          <text a:if="{{item.task_cycle == 1}}"> 完成截止为{{item.task_cycle_value}}点</text>
          <text a:if="{{item.task_cycle == 2}}"> 完成截止为
            <text a:if="{{item.task_cycle_value == 1}}">周一</text>
            <text a:if="{{item.task_cycle_value == 2}}">周二</text>
            <text a:if="{{item.task_cycle_value == 3}}">周三</text>
            <text a:if="{{item.task_cycle_value == 4}}">周四</text>
            <text a:if="{{item.task_cycle_value == 5}}">周五</text>
            <text a:if="{{item.task_cycle_value == 6}}">周六</text>
            <text a:if="{{item.task_cycle_value == 7}}">周日</text>
          </text>
          <text a:if="{{item.task_cycle == 3}}"> 完成截止为次月{{item.task_cycle_value}}号</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="{{activeIndex}}" a:if="{{showZp==true}}" isShow="{{showZp}}" onClose="onClose" onConfirm="onConfirmSx"></select-zp>
</view>