couponList.wxml 2.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
  1. <view class="container">
  2. <view class="h">
  3. <view class="item {{ status == 0 ? 'active' : ''}}" bindtap="switchTab" data-index="0">
  4. <view class="txt">未使用</view>
  5. </view>
  6. <view class="item {{ status == 1 ? 'active' : ''}}" bindtap="switchTab" data-index="1">
  7. <view class="txt">已使用</view>
  8. </view>
  9. <view class="item {{ status == 2 ? 'active' : ''}}" bindtap="switchTab" data-index="2">
  10. <view class="txt">已过期</view>
  11. </view>
  12. </view>
  13. <view class="b">
  14. <view class="coupon-form" wx:if="{{status == 0}}">
  15. <view class="input-box">
  16. <input class="coupon-sn" placeholder="请输入优惠码" value="{{code}}" bindinput="bindExchange"/>
  17. <van-icon name="close" class="clear-icon" wx:if="{{ code.length > 0 }}" catchtap="clearExchange"/>
  18. </view>
  19. <view class="add-btn" bindtap='goExchange'>兑换</view>
  20. </view>
  21. <view class="help" wx:if="{{status == 0}}">
  22. <van-icon name="question-o" />
  23. 使用说明
  24. </view>
  25. <scroll-view class="coupon-list" scroll-y="true" scroll-top="{{scrollTop}}">
  26. <view class="item {{ status == 0 ? 'active' : ''}}" wx:for="{{couponList}}" wx:for-index="index" wx:for-item="item" wx:key="id">
  27. <view class="tag">{{item.tag}}</view>
  28. <view class="content">
  29. <view class="left">
  30. <view class="discount">{{item.discount}}元</view>
  31. <view class="min"> 满{{item.min}}元使用</view>
  32. </view>
  33. <view class="right">
  34. <view class="name">{{item.name}}</view>
  35. <view class="time"> 有效期:{{item.startTime}} - {{item.endTime}}</view>
  36. </view>
  37. </view>
  38. <view class="condition">
  39. <text class="txt">{{item.desc}}</text>
  40. <image src="{{item.pic}}" class="icon"></image>
  41. </view>
  42. </view>
  43. <view class="page" wx:if="{{showPage}}">
  44. <view class="prev {{ page <= 1 ? 'disabled' : ''}}" bindtap="prevPage">上一页</view>
  45. <view class="next {{ (count / size) < page ? 'disabled' : ''}}" bindtap="nextPage">下一页</view>
  46. </view>
  47. </scroll-view>
  48. </view>
  49. </view>