<!--shoppingGuid/page/pages/kpi/kpi.wxml-->
<wxs src="../../../../wxs/utils.wxs" module="utils" />
<!-- KPI界面 -->
<view class='main-container'>
  <view class='header-tab'>
    <view class='header-tab-item' 
    wx:for="{{navBar}}" 
    wx:key="topbar" 
    wx:for-index="idx"
    bindtap='onTopBarTap'
    data-index="{{idx}}"
    data-item="{{item}}" 
    wx:for-item="item">
      <view class='item-text {{item.isActive ? "active" : ""}}'>{{item.name}}</view>
    </view>
  </view>

  <!-- list -->
  <view class='list' wx:if="{{current == 1}}">
    <view class='list-item' 
    wx:for="{{list}}"
    wx:for-index="idx"
    wx:key="listItem" 
    bindtap='onTapToSaleTaskInfo'
    data-item="{{item}}"
    wx:for-item="item">
      <view class='status-bar'>
        <view class='status'>
          已完成:<text>{{item.achieve}}</text>
        </view>
        <view class='percent'>{{item.rate}}</view>
      </view>
      <view class='task-time'>
         <image src='/assets/imgs/shoppingGuide/kpi_task_time.png' mode='widthFix'></image>
         <text>{{item.task.startStr}}～{{item.task.endStr}}</text>
      </view>
      <view class='task-info'>
        <view class='lf'>
          <image src='/assets/imgs/shoppingGuide/kpi_task_name.png' mode='widthFix'></image>
          <text>{{item.task.name}}</text>
        </view>
        <view class='rg'> 目标：{{item.task.target}} 元</view>
      </view>
    </view>
  </view>

  <!-- 招募任务 -->
  <view class='list' wx:if="{{current == 2}}">
    <view class='list-item' 
    wx:for="{{list}}"
    wx:for-index="idx"
    wx:key="listItem" 
    bindtap='onTapToInviteTaskInfo'
    data-item="{{item}}"
    wx:for-item="item">
      <view class='status-bar'>
        <view class='status'>
          已完成:<text>{{item.achieve}}</text>
        </view>
        <view class='percent'>{{item.rate}}</view>
      </view>
      <view class='task-time'>
        <image src='/assets/imgs/shoppingGuide/kpi_task_time.png' mode='widthFix'></image>
        <text>{{item.task.startStr}}～{{item.task.endStr}}</text>
      </view>
      <view class='task-info'>
        <view class='lf'>
          <image src='/assets/imgs/shoppingGuide/kpi_task_name.png' mode='widthFix'></image>
          <text>{{item.task.name}}</text>
        </view>
        <view class='rg'> 目标：{{item.task.target}} </view>
      </view>
    </view>
  </view>


</view>
<!-- tabbar -->
<tab-bar index="{{1}}"></tab-bar>