<!--pages/integral/integral.wxml-->
<wxs src="../../../tools.wxs" module="globalTools" />

<view class="container">

  <view class="header">
    <image class="header-bg" src="../../images/sign_background.jpeg"></image>
    <view class="header-content">
      <view class="score">
        <text class="fen">{{mpMemberAccount.pointsBalance || 0}}</text>
        <text>分</text>
      </view>
      <navigator url="/pages/payment-details/payment-details?type=integral" hover-class="none" class="score-detail">查看我的积分明细 >></navigator>
    </view>
  </view>
  <view class="sign">
    <view class="title">
      <view class="title-left">
        <text>每周签到</text>
        <image class="rule" src="../../images/sign_rule.png" data-type="dec" bindtap="checkRule"></image>
      </view>
      <navigator class="more-integral" url="/pages/integral/pages/task/task" hover-class="none">
        <image class="sign_icon" src="../../images/sign_icon.png"></image>
        <text>赚更多积分</text>
      </navigator>
    </view>
    <view class="bar"></view>
    <view class="sign-list">
      <view class="sign-btn" wx:for='{{sign_list}}' wx:key='index'>
        <view class="sign-icon">
          <image src="{{mpMemberSigninList[index]?'../../images/sign_success.png':noSign!==0&&mpMemberSigninList.length === index&&isSign&&!isSupSign?'../../images/sign_wait.png':'../../images/sign_no.png'}}" mode="widthFix" class="sign_icon_img"></image>
          <view class="sign-bar {{mpMemberSigninList[index]?'bar-action':noSign!==0&&mpMemberSigninList.length === index&&isSign&&!isSupSign?'bar-wait':''}}"></view>
        </view>
        <view class="text">第{{index + 1}}天</view>
      </view>
    </view>
    <view class="sign-button" bindtap="sign">
      <image class="sign-button-image" src=" {{(isSign&&isSupSign) || (isSign&&!isSupSign&&!supplementarySignin)?'../../images/sign_button_grey.png':'../../images/sign_button.png'}} "></image>
      <view class="sian-button-content">
        <text wx:if='{{!isSign&&!isSupSign}}'>本周已签到{{mpMemberSigninList.length || 0}}天，点击继续签到</text>
        <text wx:if='{{isSign&&!isSupSign&&noSign>=1}}'>您已签到{{mpMemberSigninList.length || 0}}天，点击可补签1次</text>
        <text wx:if='{{isSign&&isSupSign || noSign === 0}}'>您已成功签到{{mpMemberSigninList.length || 0}}天，明天再来吧</text>
      </view>
    </view>
  </view>
  <view class="gift">
    <view class="gift-title">
      <view class="gift-title-left">积分兑换</view>
      <view class="gift-title-right" data-type="rule" bindtap="checkRule">积分规则 ></view>
    </view>
    <view class="gift-content">
      <image src="../../images/gift.png" data-type="gift" bindtap="toPage"></image>
      <image src="../../images/activity.png" data-type="activity" bindtap="toPage"></image>
    </view>
  </view>
  <view class="integral">
    <view class="gift-title">
      <view class="gift-title-left">做任务赚积分</view>
      <navigator class="gift-title-right" hover-class="none" url="/pages/integral/pages/task/task">更多任务 ></navigator>
    </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-id="{{item.taskSetting.id}}" data-index="{{index}}" data-points="{{item.taskSetting.points}}" 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>
</view>