<view class="container">
  <header text="我的优惠券"></header>
  <scroll-view 
    class="content"
    scroll-y="true"
    bindscrolltolower="onReachBottom"
    lower-threshold="50"
    refresher-enabled="true"
    refresher-triggered="{{refreshing}}"
    bindrefresherrefresh="onPullDownRefresh"
  >
    <!-- 有数据 -->
    <block wx:if="{{couponList.length > 0}}">
      <view class="card-box" wx:for="{{couponList}}" wx:key="index" bindtap="goPage">
        <image class="card-img" src="/static/image/yhq.png" mode="aspectFit"/>
        <view class="card-cont">
          <view class="card-cont-lf">{{item.typeText}}</view>
          <view class="card-cont-ri">
            <view>
              <view>{{item.name}}</view>
              <view class="pop-time">{{item.expireTime}}到期</view>
            </view>
            <view>
              <image class="card-cont-status" src="{{item.statusImg}}" mode="aspectFit"/>
            </view>
          </view>
        </view>
      </view>
    </block>

    <!-- 空状态 -->
    <van-empty wx:if="{{!loadingMore && couponList.length === 0}}" description="暂无数据" />
  </scroll-view>

  <!-- 分页到底提示 -->
  <view wx:if="{{!loadingMore && noMore && couponList.length > 0}}" class="loading">
    没有更多数据了
  </view>
</view>
