<!--pages/task/task.wxml-->
<wxs src="../../../tools.wxs" module="globalTools" />
<view class="container safe_area">
  <view class="title">- 每日任务 -</view>
  <view class="integral-content">

    <view class="integral-content-cell" wx:for='{{day_task}}' wx:key='index'>
      <view class="info">
        <view class="name">
          <text>{{item.taskSetting.taskName}}</text>
          <text class="points">+{{item.taskSetting.points}}</text>
        </view>
        <view class="step">
          <view class="step-content">
            <view class="step-content-status" style="width:{{globalTools.limitedSize(item.taskList.length,item.taskSetting.taskNumber)/item.taskSetting.taskNumber*100}}%"></view>
          </view>
          <text>{{globalTools.limitedSize(item.taskList.length,item.taskSetting.taskNumber)}}/{{item.taskSetting.taskNumber}}</text>
        </view>
      </view>
      <view class="status {{item.taskList.length < item.taskSetting.taskNumber?'do':item.is_get?'done':'take'}}" data-points="{{item.taskSetting.points}}" data-type="1" data-index="{{index}}" data-id="{{item.taskSetting.id}}" bindtap="{{item.taskList.length < item.taskSetting.taskNumber?'toDetail':item.is_get?'':'reward'}}">
        {{item.taskList.length < item.taskSetting.taskNumber?'去完成':item.is_get?'已完成':'领奖励'}}
      </view>
    </view>
  </view>
  <view class="title">- 新手任务 -</view>
  <view class="integral-content">

    <view class="integral-content-cell" wx:for='{{new_task}}' wx:key='index'>
      <view class="info">
        <view class="name">
          <text>{{item.taskSetting.taskName}}</text>
          <text class="points">+{{item.taskSetting.points}}</text>
        </view>
      </view>
      <view class="status {{item.taskList.length === 0?'do':item.is_get?'done':'take'}}" data-type="0" data-id="{{item.taskSetting.id}}" data-index="{{index}}" data-points="{{item.taskSetting.points}}" data-name="{{item.taskSetting.taskName}}" bindtap="{{item.taskList.length === 0?'newToDetail':item.is_get?'':'reward'}}">
        {{item.taskList.length === 0?'去完成':item.is_get?'已完成':'领奖励'}}
      </view>
    </view>
  </view>


</view>