couponList.wxml 4.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798
  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. <van-tabs active="{{status}}" color="#09afff" bind:change="onTabChange">
  14. <van-tab title="未使用" name="0"></van-tab>
  15. <van-tab title="已使用" name="1"></van-tab>
  16. <van-tab title="已过期" name="2"></van-tab>
  17. </van-tabs>
  18. <view class="b">
  19. <view class="coupon-form" wx:if="{{status == 0}}">
  20. <view class="input-box">
  21. <input class="coupon-sn" placeholder="请输入优惠码" value="{{code}}" bindinput="bindExchange"/>
  22. <van-icon name="close" class="clear-icon" wx:if="{{ code.length > 0 }}" catchtap="clearExchange"/>
  23. </view>
  24. <view class="add-btn" bindtap='goExchange'>兑换</view>
  25. </view>
  26. <!-- <view class="help" wx:if="{{status == 0}}">
  27. <van-icon name="question-o" />
  28. 使用说明
  29. </view> -->
  30. <scroll-view scroll-y="true" scroll-top="{{scrollTop}}" class="my-coupon-list">
  31. <view wx:for="{{couponList}}" wx:for-index="index" wx:for-item="item" wx:key="id" class="my-coupon-item">
  32. <view class="coupon-left">
  33. <view wx:if="{{item.voucherType==1}}">¥<text class="coupon-amount">{{item.discount}}</text></view>
  34. <view wx:if="{{item.voucherType==2}}"><text class="coupon-amount">{{item.discount/10}}</text>折</view>
  35. <view class="coupon-type">
  36. <!-- {{item.name}} -->
  37. <span wx:if="{{item.voucherType==1}}">立减券</span>
  38. <span wx:if="{{item.voucherType==2}}">折扣券</span>
  39. </view>
  40. <view class="coupon-btn {{item.status===0?'active-btn':''}}" data-id="{{item.couponId}}" data-goodsvalue="{{item.goodsValue}}" bindtap="goService">立即使用</view>
  41. </view>
  42. <view class="coupon-content">
  43. <view class="coupon-name">{{item.desc}}</view>
  44. <view class="coupon-date">有效期开始:{{item.startTime}}</view>
  45. <view class="coupon-date">有效期结束:{{item.endTime}}</view>
  46. </view>
  47. <view class="coupon-right">
  48. <image class="coupon-status" mode="aspectFit" wx:if="{{item.status==1}}" src="/static/images/coupon-used.png"></image>
  49. <image class="coupon-status" mode="aspectFit" wx:if="{{item.status==2}}" src="/static/images/coupon-invalid.png"></image>
  50. </view>
  51. </view>
  52. <view class="page" wx:if="{{showPage}}">
  53. <view class="prev {{ page <= 1 ? 'disabled' : ''}}" bindtap="prevPage">上一页</view>
  54. <view class="next {{ (count / size) < page ? 'disabled' : ''}}" bindtap="nextPage">下一页</view>
  55. </view>
  56. </scroll-view>
  57. <!-- <scroll-view class="coupon-list" scroll-y="true" scroll-top="{{scrollTop}}">
  58. <view class="item {{ status == 0 ? 'active' : ''}}" wx:for="{{couponList}}" wx:for-index="index" wx:for-item="item" wx:key="id">
  59. <view class="tag">{{item.tag}}</view>
  60. <view class="content">
  61. <view class="left">
  62. <view class="discount">{{item.discount}}元</view>
  63. <view class="min"> 满{{item.min}}元使用</view>
  64. </view>
  65. <view class="right">
  66. <view class="name">{{item.name}}</view>
  67. <view class="time"> 有效期:{{item.startTime}} - {{item.endTime}}</view>
  68. </view>
  69. </view>
  70. <view class="condition">
  71. <text class="txt">{{item.desc}}</text>
  72. <image src="{{item.pic}}" class="icon"></image>
  73. </view>
  74. </view>
  75. <view class="page" wx:if="{{showPage}}">
  76. <view class="prev {{ page <= 1 ? 'disabled' : ''}}" bindtap="prevPage">上一页</view>
  77. <view class="next {{ (count / size) < page ? 'disabled' : ''}}" bindtap="nextPage">下一页</view>
  78. </view>
  79. </scroll-view> -->
  80. <view class="no-list" wx:if="{{couponList==0}}">没有更多了</view>
  81. </view>
  82. </view>