<!--coupon.wxml-->
<view class="nav_bar {{tabIndex == 1?'active':''}}" bindtap="switchTab">
  <view class="nav_item {{tabIndex == 0?'active':''}}" data-index="0">Event List</view>
  <view class="nav_item {{tabIndex == 1?'active':''}}" data-index="1">My E-Voucher</view>
</view>
 <!-- <view class="activity_title">
        <view class="activity_name">满{{item.full_money}}元减{{item.pre_money}}元</view>
        <view class="activity_time">有效期:{{item.validity_day}}天</view>
      </view>
      <view class="activity_img">
        <image mode="aspectFill" src="{{imgUrlBefore + item.img}}"></image>
      </view>
      <view class="activity_footer">
        <view class="coupon_box">
          <view class="coupon_item" wx:for="{{item.coupon_text}}" wx:key="coupon_text"> {{item}} </view>
        </view>
        <view class="coupon_btn" data-index="{{index}}" bindtap="getCoupon">立即领取</view>
      </view> -->
<block wx:if="{{tabIndex == 0}}">
  <view class="list activity">
    <view class="activity_item" wx:for="{{couponList}}" wx:key="couponList">
      <view class='coupon_content'>
        <view class='coupon_top'>
          <view class='coupon_left'>
            <view class='coupon_logo'>¥</view>
            <view class='coupon_pre'>{{item.pre_money}}</view>
          </view>
          <view class='coupon_right'>
            <view class='big_text'>coupon</view>
            <!-- <view class='small_text'>You have already received {{item.re_nums}} copies</view> -->
            <view class='small_text'>¥{{item.full_money}} can be used</view>
          </view>
        </view>
        <view class='coupon_bottom'>
          <view class='bottom_text'>
            <view class='small_text'>quantity: You can get {{item.num}}pieces </view>
          <view class='small_text'>useful-life: {{item.validity_day}}days</view>
          </view>
          <view class='bottom_btn'>
            <!-- <image src='/images/finger.png'></image> -->
            <text class='get' bindtap='getCoupon' data-pre_id='{{item.id}}'>Get it</text>
          </view>
        </view>
      </view>
    </view>
  </view>
  <block wx:if="{{couponList.length==0}}">
    <view class="empty_box">
      No Event To Show
    </view>
  </block>
</block>
<block wx:else>
  <view class="list coupon">
    <view class="item {{item.status == -1?'gary':''}}" wx:for="{{activityList}}" wx:key="activityList">
      <view class="content">
        <view class="left">
          <view class="coupon_info">
            <view class="coupon_name">{{item.title}}</view>
            <view class="coupon_desc">
              
               <view class="coupon_text">minus ¥ {{item.pre_money}}</view>
                
              <view class="coupon_limit">Available for over ¥{{item.full_money}}</view>
              <view class='coupon_small'>{{item.start_time}}--{{item.end_time}} </view>
            </view>
          </view>
        </view>
        <view class="right">
          <block wx:if="{{item.status == 0}}">
           
          </block>
          <block wx:else>
            <view class="tips">
              not used
            </view>
          </block>
        </view>
      </view>
    </view>
  </view>
  <block wx:if="{{!activityList.length}}">
    <view class="empty_box">
      No E-Voucher To Show
    </view>
  </block>
</block>