<view class="container">
  <view class="coupon-form">
    <!-- <view class="input-box">
      <input class="coupon-sn" value="{{couponNumber}}" placeholder="请输入优惠码" bindinput="bindCouponNumberInput" />
        <view bindtap="clearData"><image class="clear-icon" src="/static/images/clear-fb.png"></image>
      </view>
    </view>
    <button class="add-btn" bindtap="exchangeCoupon">兑换</button> -->
    <view class="tab-bar">
      <view wx:for="{{tabList}}" wx:key="{{index}}" bindtap="toggleTab" data-index="{{index}}" class="tab-bar-item {{ index == tabIndex ? 'active' : '' }}">{{ item }}
      </view>
    </view>
  </view>
  <!-- <view class="help">使用说明</view> -->
  <view class="no-coupon" wx:if="{{couponList.length <= 0}}">
    <view class="c">
      <view class="title-box">
        暂无优惠券~
      </view>
      <view class="to-index-btn" bindtap="toIndexPage">
        去逛逛
      </view>
    </view>
  </view>
  <!-- 用户优惠券列表start -->
  <view style="margin: 16px 1px;" wx:for="{{couponList}}" wx:key="{{item.couponId}}" data-coupon-Url="{{item.advImgUrl}}" data-coupon-id="{{item.couponId}}">
    <view class="coupon-box {{item.isReceive==0?'coupon-box1':'coupon-box2'}} coupon-box-g">
      <view class="coupon-bg {{item.isReceive==0?'coupon-bg1':'coupon-bg2'}}" bindtap="getCouponDetail" data-coupon-Id="{{item.couponId}}" data-store-Topic-Id="{{item.storeTopicId}}">
        <view>
          <text class="coupon-currency">￥</text>{{item.tickDiscType==00?item.voucherMoney:''}}{{item.tickDiscType==01?item.discRatio:''}}{{item.tickDiscType==02?item.exchCond:''}}</view>
        <view class="coupon-type">{{item.tickDiscType==00?'满'+item.voucherCond+'可用':''}}{{item.tickDiscType==01?'满'+item.discCond+'可用':''}}{{item.tickDiscType==02?'满'+item.exchCond+'可用':''}}</view>
      </view>
      <view class="coupon-info" bindtap="getCouponDetail" data-coupon-Id="{{item.couponId}}" data-store-Topic-Id="{{item.storeTopicId}}">
        <view class="coupon-title">{{ item.name }}</view>
        <view class="coupon-desc">
          <view style="font-size: 26rpx;">{{ item.inValidTime }}</view>
        </view>
        <view class="coupon-desc-shop">
          <view style='font-size:24rpx;'>{{item.applyType==00?'全部商品可用':''}}{{item.applyType==01?'部分商品可用':''}}{{item.applyType==02?'部分商品可用':''}}{{item.goodsBizType==00?'-仅限保税仓商品':''}}{{item.goodsBizType==02?'-仅限补货商品':''}}{{item.goodsBizType==10?'-仅限现场速递商品':''}}{{item.goodsBizType==11?'-仅限普通商品':''}}</view>
        </view>
      </view>
      <view class="{{item.isReceive==0?'coupon-info-use':'coupon-info-use2'}}" bindtap="{{item.isReceive==0?'linkCoupon':''}}" data-tick-Id="{{item.tickDiscId}}" data-store-Topic-Id="{{item.storeTopicId}}">
        <view class="coupon-desc-use">
          {{item.isReceive==0?'去使用':''}}{{item.isReceive==1?'已过期':''}}{{item.isReceive==2?'暂不可用':''}}{{discStatus==1?'已使用':''}}
        </view>
      </view>
    </view>
  </view>
  <!-- 用户优惠券列表end -->

  <view class="coupon-data" wx:if="{{(discStatus==0 && couponList.length==0) || discStatus==1 || (discStatus==2 && couponList.length==0)}}">
    <view style='color: #999;font-size: 26rpx;text-align: center;padding-top:30rpx;' wx:if="{{ticketDiscountList.length > 0}}">领取优惠券</view>
    <!-- 查看门店优惠券列表 -->
    <view style="margin: 16px 0px;" wx:for="{{ticketDiscountList}}" wx:key="{{item.tickDiscId}}" data-coupon-id="{{item.tickDiscId}}">
      <view class="coupon-box {{item.isReceive==0?'coupon-box1':'coupon-box2'}} coupon-box-g">
        <view class="coupon-bg {{item.isReceive==0?'coupon-bg1':'coupon-bg2'}}" bindtap="getCouponDetail2" data-disc-Id="{{item.tickDiscId}}" data-store-Topic-Id="{{item.storeTopicId}}">
          <view>
            <text class="coupon-currency">￥</text>{{item.tickDiscType==00?item.voucherMoney:''}}{{item.tickDiscType==01?item.discRatio:''}}{{item.tickDiscType==02?item.exchCond:''}}</view>
          <!-- <view class="coupon-type" wx:if="{{item.tickDiscType==00}}">代金券</view>
          <view class="coupon-type" wx:if="{{item.tickDiscType==01}}">折扣券</view>
          <view class="coupon-type" wx:if="{{item.tickDiscType==02}}">兑换券</view> -->
          <view class="coupon-type">{{item.tickDiscType==00?'满'+item.voucherCond+'可用':''}}{{item.tickDiscType==01?'满'+item.discCond+'可用':''}}{{item.tickDiscType==02?'满'+item.exchCond+'可用':''}}</view>
        </view>
        <view class="coupon-info" bindtap="getCouponDetail2" data-disc-Id="{{item.tickDiscId}}" data-store-Topic-Id="{{item.storeTopicId}}">
          <view class="coupon-title">{{ item.name }}</view>
          <view class="coupon-desc">
            <view style="font-size: 26rpx;">{{ item.inValidTime }}</view>
            <!-- <view style='font-size:24rpx;color:#000;'>{{ item.discDecl }}</view> -->
          </view>
          <view class="coupon-desc-shop">
            <view style='font-size:24rpx;'>{{item.applyType==00?'全部商品可用':''}}{{item.applyType==01?'部分商品可用':''}}{{item.applyType==02?'部分商品可用':''}}</view>
          </view>
        </view>
        <view class="{{item.isReceive==0?'coupon-info-use':'coupon-info-use2'}}" bindtap="{{item.isReceive==0?'getUserCoupon':''}}" data-coupon-Id="{{item.tickDiscId}}" data-store-Topic-Id="{{item.storeTopicId}}">
          <view class="coupon-desc-use">
            {{item.isReceive==0?'领取':'已领完'}}
          </view>
        </view>
      </view>
    </view>
    <!-- 查看门店优惠券列表end -->
  </view>
</view>