<view class="tabs">
  <view class="history" bindtap="goHistory"><text>历史记录</text></view>
  <view class="tabs-wrap flex-align-center">
    <view class="item flex-center {{current == 0 ? 'active' : ''}}" bindtap="onTabsChange" data-id="0">
      未使用
    </view>
    <view class="item flex-center {{current == 1 ? 'active' : ''}}" bindtap="onTabsChange" data-id="1">
      使用记录
    </view>
    <view class="item flex-center {{current == 2 ? 'active' : ''}}" bindtap="onTabsChange" data-id="2">
      已过期
    </view>
  </view>
  <view class="tabs-content">
    <!-- <coupon-item class="coupon-item" wx:for="{{ list }}" item="{{item}}" wx:key="index" couponStatus="{{item.status}}" data-item="{{item}}" bind:check="goToOrderBy"></coupon-item> -->
    <view class="item flex-column current{{item.status}}" wx:for="{{list2}}" wx:key="index">
      <view class="flex" style="background-color: #fff;height: 172rpx;">
        <view class="item-left flex-center">
          <text class="experience" wx:if="{{item.coupon_type  == 3}}">{{item.coupon_name}}</text>
          <text class="experience" wx:if="{{item.coupon_type  == 1}}">{{item.coupon_name}}</text>
          <view class="consume flex-column flex-align-center" wx:if="{{item.coupon_type == 2}}">
            <view class="text-box">
              <text style="font-family: PingFangSC-Semibold;font-size: 36rpx;margin-right:10rpx">¥</text>
              <text style="font-family: PingFangSC-Semibold;font-size: 68rpx;">{{item.price}}</text>
            </view>
            <text style="font-family: PingFangSC-Semibold;font-size: 28rpx;">满{{item.full_price}}元可用</text>
          </view>   
        </view>
        <view class="item-right flex1 flex-align-center">
          <view class="item-text flex1 flex-column">
            <!-- <text>券码：XH7T390J</text> -->
            <text>有效期</text>
            <text>{{item.ex_time}}</text>
            <!-- <text>{{item.coupon_desc}}</text> -->
            <view class="flex flex-align-center" data-index="{{index}}" data-item="{{item}}" bindtap="onChangeDesc">
              <text style="color: #FA7D22;font-size: 28rpx;font-family: PingFangSC-Medium, PingFang SC;">详细信息</text>
              <view class="triangle {{ item._status ? 'active' : ''}}"></view>
            </view>
          </view>
          <view class="item-btn flex-center" wx:if="{{item.status == 0}}"  bindtap="goToOrderBy">
            去使用
          </view>
          <image src="/images/my/coupon_1.png" wx:if="{{item.status == 1}}"></image>
          <image src="/images/my/coupon_0.png" wx:if="{{item.status == 2}}"></image>
        </view>
      </view>
      <!-- wx:if="{{ item._status && item.coupon_desc }}" -->
      <view class="item-btm" style="height: {{item.childrenHeight}}px;display: {{ item.coupon_desc ? 'block' : 'none' }};">
        <view id="item{{index}}">{{item.coupon_desc}}</view>
      </view>
    </view>
    <view class="no-data" style="display: {{list.length == 0 ? 'block' : 'none'}};">暂无数据~</view>
  </view>
</view>
<!-- 优惠券新页面 -->
<view class="couponList" wx:for="{{list}}" wx:key="index">
  <view class="coupon-item {{current==1?'used':''||current==2?'used':''}}">
  <view class="coupon-left">
    <!-- 优惠券类型，1直接抵扣券，2满减券，3全额减免券，4卡券 -->
    <view class="coupon-type bgc">
      {{couponType[item.coupon_type-1]}}
    </view>
    <view class="coupon-price" wx:if="{{item.coupon_type==3||item.coupon_type==4}}">
    全免
    </view>
    <view class="coupon-price" wx:else>
    <text>￥</text>{{item.price}}
    </view>
  </view>
  <view class="coupon-right">
    <view class="coupon-right-top">
    <view class="coupon-title">{{item.coupon_name}}</view>
    <view class="coupon-condition" wx:if="{{item.coupon_type==2}}">满{{item.full_price}}元可用</view>
    </view>
    <view class="coupon-right-bottom">
    <view class="coupon-time" wx:if="{{current!=2}}">
    还有<view class="{{item.finaTime<=3&&current!=1?'finaTime':''}}">{{item.finaTime}}天</view>({{item.fina_time}})过期
    </view>
    <view class="coupon-time" wx:else>

    </view>
    <view class="coupon-redio"  bindtap="goToOrderBy" data-item="{{item}}" wx:if="{{current==0}}">
    去使用
    </view>
    <view class="coupon-redio" wx:if="{{current==1}}">
    已使用
    </view>
    <view class="coupon-redio" wx:if="{{current==2}}">
    已过期
    </view>
    </view>
  </view>
  </view>
</view>