<!--packageC/CouponExchange/index.wxml-->
<view class="CouponExchange">
  <van-tabs active="{{ active }}" bind:change="getData">
    <van-tab title="商城">
      <view class="coupon_voucher_main" wx:for="{{list}}" wx:for-index="idx" wx:for-item="items" wx:key="coupon_id">
        <view class="coupon_voucher_left">
          <view>
            <text class="coupon_voucher_amount type_large {{items.belongs_to_coupon.coupon_method == 1?'deductClass':''}}">{{items.belongs_to_coupon.coupon_method == 1?items.belongs_to_coupon.deduct:items.belongs_to_coupon.discount+'折'}}</text>
            <text class="coupon_voucher_limit">满{{items.belongs_to_coupon.enough}}立{{items.belongs_to_coupon.coupon_method == 1?'减':'享'}}</text>
          </view>
        </view>
        <view class="coupon_voucher_hr"></view>
        <view class="coupon_voucher_right">
          <text class="coupon_voucher_range" style="-webkit-box-orient: vertical;">{{items.belongs_to_coupon.name}}</text>
          <text class="coupon_voucher_range1">
            <text>剩余数量:{{items.total}}</text>
          </text>
        </view>
        <view class="addBtn">
          <icon catchtap="numberLeft" class="iconfont icon-store_reduceLine" wx:if="{{numModel[idx]}}" data-info='{{items}}' data-index='{{idx}}'></icon>
          <input type="number" value="{{numModel[idx]}}" wx:if="{{numModel[idx]}}" disabled="disabled" catchtap />
          <icon catchtap="numberRight" class="iconfont icon-store_plus" data-info='{{items}}' data-index='{{idx}}'></icon>
        </view>
      </view>
    </van-tab>
  </van-tabs>
  <view class="btn">
      <view class="btn-left">{{num>0?'已选择'+num+'张':'请选择'}}</view>
      <view class="btn-right"
            catchtap="gotoExchange">去兑换</view>
    </view>
</view>