Coupon.wxml 4.0 KB
<!--pages/Coupon/Coupon.wxml-->
<view class="buttom">
  <view class="swiper-tab">
    <view class="swiper-tab-list {{currentTab==0 ? 'on' : ''}}" data-current="0" bindtap="swichNav">未使用</view>
    <view class="swiper-tab-list {{currentTab==1 ? 'on' : ''}}" data-current="1" bindtap="swichNav">已使用</view>
    <view class="swiper-tab-list {{currentTab==2 ? 'on' : ''}}" data-current="2" bindtap="swichNav">已过期</view>
  </view>

  <swiper current="{{currentTab}}" class="swiper-box" duration="300" style="height:{{winHeight - 31}}px" bindchange="bindChange">
    <!-- 未使用 -->
    <swiper-item >
      <view class="List" wx:for="{{arr1}}" wx:key="" data-id='{{item.id}}'>
        <view class="couponList">
          <view class="plice">{{item.reduce}}
            <text style="color:#999999;font-size:26rpx;">元</text>
          </view>
          <view class="mes">
            <view class="name">{{item.discount_coupon_name}}</view>
            <view class="time">有效期截止:{{item.deadline}}</view>
          </view>
        </view>
        <view class="go" bindtap='go'>立即使用
          <text class="icon icon-icon-test3" style="font-size:18rpx;margin-left:22rpx;"></text>
        </view>
      </view>

      <view class="List" wx:for="{{freeCard}}" wx:key="" data-id='{{item.id}}'>
        <view class="couponList">
          <view class="plice free_name">{{item.pledge_name}}
            <text style="color:#999999;font-size:26rpx;"></text>
          </view>
          <view class="mes">
            <view class="time">有效期截止:{{item.deadline}}</view>
          </view>
        </view>
        <view class="go" bindtap='go'>立即使用
          <text class="icon icon-icon-test3" style="font-size:18rpx;margin-left:22rpx;"></text>
        </view>
      </view>

    </swiper-item>
    <!-- 已使用 -->
    <swiper-item>
      <view class="List" wx:for="{{arr2}}" wx:key="" data-id='{{item.id}}'>
        <view class="couponList">
          <view class="plice">{{item.reduce}}
            <text style="color:#999999;font-size:26rpx;margin-left:13rpx;">元</text>
          </view>
          <view class="mes">
            <view class="name">{{item.discount_coupon_name}}</view>
            <view class="time">有效期截止:{{item.deadline}}</view>
          </view>
        </view>
        <view class="go" style="color:#666666;">已使用</view>
      </view>
      <!-- 免费优惠 -->
      <view class="List" wx:for="{{freeCard2}}" wx:key="" data-id='{{item.id}}'>
        <view class="couponList">
          <view class="plice free_name">{{item.pledge_name}}
            <text style="color:#999999;font-size:26rpx;"></text>
          </view>
          <view class="mes">
            <view class="time">有效期截止:{{item.deadline}}</view>
          </view>
        </view>
        <view class="go" >已使用</view>
      </view>
    </swiper-item>
    <!-- 已过期 -->
    <swiper-item>
      <view class="List" wx:for="{{arr3}}" wx:key="" data-id='{{item.id}}'>
        <view class="couponList">
          <view class="plice">{{item.reduce}}
            <text style="color:#999999;font-size:26rpx;margin-left:13rpx;">元</text>
          </view>
          <view class="mes"> 
            <view class="name">{{item.discount_coupon_name}}</view>
            <view class="time">有效期截止:{{item.deadline}}</view>
          </view>
        </view>
        <view class="go" style="color:#666666;">已过期</view>
      </view>
      <view class="List" wx:for="{{freeCard3}}" wx:key="" data-id='{{item.id}}'>
        <view class="couponList">
          <view class="plice free_name">{{item.pledge_name}}
            <text style="color:#999999;font-size:26rpx;"></text>
          </view>
          <view class="mes">
            <view class="time">有效期截止:{{item.deadline}}</view>
          </view>
        </view>
        <view class="go" bindtap='go'>已过期
          <text class="icon icon-icon-test3" style="font-size:18rpx;margin-left:22rpx;"></text>
        </view>
      </view>
    </swiper-item>
  </swiper>
</view>