<!--pages/exchange-record/exchange-record.wxml-->
<wxs src="exchange-record.wxs" module="Tools" />
<view class="title">
  <view class="title-content" wx:for='{{title_list}}' wx:key='index' data-index="{{index}}" bindtap="changeIndex">
    <view class="title-content-cons">
      <view class="">{{item.name}}</view>
      <view class="bar" hidden="{{index!==active_index}}"></view>
    </view>
  </view>
</view>
<view class="container">
  <block wx:if='{{show}}'>
    <view class="list" hidden="{{active_index!==0}}">
      <navigator class="cell" wx:for='{{list}}' wx:key='index' hover-class="none" url="/pages/integral/pages/exchange-detail/exchange-detail?id={{item.id}}&&type={{type}}">
        <image src="{{item.mpCompaignsRewardSettingAPI.rewardPic}}" class="images"></image>
        <view class="info">
          <view class="name">{{item.mpCompaignsRewardSettingAPI.rewardName}}</view>
          <view class="action">
            <view class="int">
              <image class="integral-star" src="../../images/exchange_star.png"></image>
              <view class="int-text">
                <text>{{item.mpCompaignsRewardSettingAPI.points}}积分</text>
                <text wx:if='{{item.mpCompaignsRewardSettingAPI.money}}'>+{{item.mpCompaignsRewardSettingAPI.money}}元</text>
              </view>
            </view>
            <view class="button">
              <view class="button-content {{Tools.getGiftStatusColor(item.mpMemberCompaignsRewardAction.memberCampaignsStatus)}}">{{Tools.getGiftStatusMessage(item.mpMemberCompaignsRewardAction.memberCampaignsStatus)}}</view>
            </view>
          </view>
        </view>
      </navigator>
    </view>

    <view class="list" hidden="{{active_index!==1}}">
      <navigator class="cell" wx:for='{{list}}' wx:key='index' hover-class="none" url="/pages/integral/pages/exchange-detail/exchange-detail?id={{item.id}}&&type={{type}}">
        <image src="{{item.mpCompaignsActivitySettingAPI.activityPic}}" class="images"></image>
        <view class="info">
          <view class="name">{{item.mpCompaignsActivitySettingAPI.activityName}}</view>
          <view class="action">
            <view class="int">
              <image class="integral-star" src="../../images/exchange_star.png"></image>
              <view class="int-text">
                <text>{{item.mpCompaignsActivitySettingAPI.points}}积分</text>
                <text wx:if='{{item.mpCompaignsActivitySettingAPI.money}}'>+{{item.mpCompaignsActivitySettingAPI.money}}元</text>
              </view>
            </view>
            <view class="button">
              <view class="button-content">{{Tools.getActiveStatusMessage(item.mpCompaignsActivitySettingAPI.activityStatus)}}</view>
            </view>
          </view>
        </view>
      </navigator>
    </view>
  </block>
  <view class="empty" wx:else>
    <image src="../../images/integral_empty.png"></image>
    <view class="empty-text">您还没有进行过积分兑换哦，快去看看有什么好东西吧！</view>
    <view class="look">
      <navigator class="look-content" open-type="navigateBack">
        去看看
      </navigator>
    </view>
  </view>
</view>