<view class="layer">
  <auth bindlogin="onShow" />
	
  <lip-sync />
  <view class="tab">
    <view class="{{showUsedTab ? 'active' : ''}}" bindtap="enableHandle">可使用 <text>({{enableCount}})</text></view>
    <view class="{{showUsedTab ? '' : 'active'}}" bindtap="disableHandle">已失效 <text>({{disableCount}})</text></view>
  </view>

  <view class="body">
    <view class="{{!showUsedTab ? 'disable item' : 'item'}}" wx:for="{{datas}}" :key="{{item.key}}" wx:if="{{item.used === showUsedTab}}" >
      <view class="product">
        <image src="../../static/images/img_coupon@2x.png" class="cover"></image>
        <view class="content">
          <view class="title">{{item.name}}</view>
          <view class="desc">有效期：{{item.useStartDate}}-{{item.useEndDate}}</view>
          <image src="../../static/images/img_tabs_invalid.png" class="invalid" wx:if="{{!showUsedTab}}"></image>
        </view>
        <view class="illustrate">
          <view class="momey"><text>￥</text>{{item.typeMoney}}</view>
          <view class="explain">满{{item.minGoodsAmount}}可用</view>
        </view>
      </view>
      <view class="oper">
        <view>适用渠道：{{item.brandName}}</view>
        <view class="btn" bindtap="gotoInfo" data-item="{{item}}">详情</view>
      </view>
    </view>

    <view class="un-content" wx:if="{{!loadding && !(showUsedTab ? enableCount : disableCount)}}">
      <view class="lay">
        <image src="/static/images/img_nocoupon@2x.png"></image>
        <view class="text">暂无优惠券</view>
      </view>
    </view>
  </view>
</view>