couponCenter.wxml 7.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127
  1. <view class="container">
  2. <view class="coupons">
  3. <view class="banner">
  4. <view class="bg"><image src="../../images/icon/coupon-bg.png"></image></view>
  5. <view class="img"><image src="../../images/icon/coupon-banner.png"></image></view>
  6. </view>
  7. <view class="con-box">
  8. <view class="c-tit" wx:if="{{couponList.length}}">通用神券</view>
  9. <scroll-view scroll-x="true" class="general-box" wx:if="{{couponList.length}}">
  10. <view class="general">
  11. <view class="item" wx:for='{{couponList}}' wx:key='couponId'>
  12. <view class="item-box {{(item.canGoUse) ? 'received' : ((!item.stocks && !item.curUserReceiveCount) ? 'robbed' : '') }}">
  13. <view class="item-con">
  14. <view class="number" wx:if="{{item.couponType == 1}}">
  15. <view class="symbol">¥</view>
  16. <view class="text">{{item.reduceAmount}}</view>
  17. </view>
  18. <view class="number" wx:if="{{item.couponType == 2}}">
  19. <view class="text">{{item.couponDiscount}}</view>
  20. <view class="symbol">折</view>
  21. </view>
  22. <view class="condition">满{{item.cashCondition}}元可用</view>
  23. <view class="scope" wx:if="{{item.suitableProdType == 0}}">全品类商品通用</view>
  24. <view class="scope" wx:if="{{item.suitableProdType != 0}}">仅可购买平台部分商品</view>
  25. <view class="progress-box">
  26. <view class="text" wx:if="{{item.stocks == 0}}">已抢光</view>
  27. <view class="text" wx:if="{{item.stocks != 0}}">已抢{{wxs.rounding((item.sourceStock - item.stocks) * 100 / item.sourceStock)}}%</view>
  28. <view class="progress" style="width: {{wxs.rounding((item.sourceStock - item.stocks) * 100 / item.sourceStock)}}%"></view>
  29. </view>
  30. </view>
  31. <view class="item-btn" wx-if="{{!item.canGoUse && item.stocks}}" data-couponid="{{item.couponId}}" data-coupontype="1" data-couponindex="{{index}}" bindtap='receiveCoupon'>立即领取</view>
  32. <view class="item-btn" wx-if="{{item.canGoUse}}" data-couponid="{{item.couponId}}" bindtap='useCoupon'>去使用</view>
  33. <view class="item-btn" wx-if="{{!item.canGoUse && !item.stocks}}">已抢光</view>
  34. <view class="icon" wx-if="{{item.canGoUse}}"><image src="../../images/icon/coupon-received.png"></image></view>
  35. <view class="icon" wx-if="{{!item.canGoUse && !item.stocks}}"><image src="../../images/icon/coupon-robbed.png"></image></view>
  36. </view>
  37. </view>
  38. </view>
  39. </scroll-view>
  40. <view class="c-tit" wx:if="{{prodCouponList.length}}">推荐好券</view>
  41. <view class="special" wx:if="{{prodCouponList.length}}">
  42. <view class="item" wx:for='{{prodCouponList}}' wx:key='couponId'>
  43. <view class="item-box {{(item.canGoUse) ? 'received' : ((!item.stocks && !item.curUserReceiveCount) ? 'robbed' : '')}}">
  44. <!-- 多商品券 -->
  45. <view class="item-con" wx:if="{{item.prods.length > 1}}">
  46. <view class="shop-msg">
  47. <view class="logo"><image src="{{item.shopLogo}}"></image></view>
  48. <view class="name">{{item.shopName}}</view>
  49. </view>
  50. <view class="prod-msg">
  51. <view class="p-item" wx:for='{{item.prods}}' wx:for-item="prod" wx:for-index="prodIndex" wx:key='prodIndex'>
  52. <view class="img"><image src="{{prod.pic}}"></image></view>
  53. <view class="price">¥{{prod.price}}</view>
  54. </view>
  55. </view>
  56. </view>
  57. <view class="item-btn" wx:if="{{item.prods.length > 1}}">
  58. <view class="btn-box">
  59. <view class="number" wx:if="{{item.couponType == 1}}">
  60. <view class="symbol">¥</view>
  61. <view class="text">{{item.reduceAmount}}</view>
  62. </view>
  63. <view class="number" wx:if="{{item.couponType == 2}}">
  64. <view class="text">{{item.couponDiscount}}</view>
  65. <view class="symbol">折</view>
  66. </view>
  67. <view class="condition">满{{item.cashCondition}}元可用</view>
  68. <view class="progress-box">
  69. <view class="text" wx:if="{{item.stocks == 0}}">已抢光</view>
  70. <view class="text" wx:if="{{item.stocks != 0}}">已抢{{wxs.rounding((item.sourceStock - item.stocks) * 100 / item.sourceStock)}}%</view>
  71. <view class="progress" style="width: {{wxs.rounding((item.sourceStock - item.stocks) * 100 / item.sourceStock)}}%"></view>
  72. </view>
  73. <view class="btn" wx-if="{{!item.canGoUse && item.stocks}}" data-couponid="{{item.couponId}}" data-coupontype="2" data-couponindex="{{index}}" bindtap='receiveCoupon'>立即领取</view>
  74. <view class="btn" wx-if="{{item.canGoUse}}" data-couponid="{{item.couponId}}" data-prodlist="{{item.prods}}" bindtap='useCoupon'>去使用</view>
  75. <view class="btn" wx-if="{{!item.canGoUse && !item.stocks}}">已抢光</view>
  76. </view>
  77. </view>
  78. <!-- /多商品券 -->
  79. <!-- 单商品券 -->
  80. <view class="left" wx:if="{{item.prods.length == 1}}">
  81. <view class="img"><image src="{{item.prods[0].pic}}"></image></view>
  82. <view class="text-box">
  83. <view class="goods-name">{{item.prods[0].prodName}}</view>
  84. <view class="coupon-number">
  85. <view class="number" wx:if="{{item.couponType == 1}}">
  86. <view class="symbol">¥</view>
  87. <view class="text">{{item.reduceAmount}}</view>
  88. </view>
  89. <view class="number" wx:if="{{item.couponType == 2}}">
  90. <view class="text">{{item.couponDiscount}}</view>
  91. <view class="symbol">折</view>
  92. </view>
  93. <view class="condition">满{{item.cashCondition}}元可用</view>
  94. </view>
  95. </view>
  96. </view>
  97. <view class="right" wx:if="{{item.prods.length == 1}}">
  98. <view class="btn-box">
  99. <view class="progress-text" wx:if="{{item.stocks == 0}}">已抢光</view>
  100. <view class="progress-text" wx:if="{{item.stocks != 0}}">已抢{{wxs.rounding((item.sourceStock - item.stocks) * 100 / item.sourceStock)}}%</view>
  101. <view class="progress-box">
  102. <view class="progress" style="width: {{wxs.rounding((item.sourceStock - item.stocks) * 100 / item.sourceStock)}}%"></view>
  103. </view>
  104. <view class="btn" wx-if="{{!item.canGoUse && item.stocks}}" data-couponid="{{item.couponId}}" data-coupontype="2" data-couponindex="{{index}}" bindtap='receiveCoupon'>立即领取</view>
  105. <view class="btn" wx-if="{{item.canGoUse}}" data-couponid="{{item.couponId}}" data-prodlist="{{item.prods}}" bindtap='useCoupon'>去使用</view>
  106. <view class="btn" wx-if="{{!item.canGoUse && !item.stocks}}">已抢光</view>
  107. </view>
  108. </view>
  109. <!-- /单商品券 -->
  110. <view class="icon" wx-if="{{item.canGoUse}}"><image src="../../images/icon/coupon-received.png"></image></view>
  111. <view class="icon" wx-if="{{!item.canGoUse && !item.stocks}}"><image src="../../images/icon/coupon-robbed.png"></image></view>
  112. </view>
  113. </view>
  114. </view>
  115. </view>
  116. <!-- 空 -->
  117. <view class="empty" wx:if="{{couponList.length==0 && prodCouponList.length==0}}">
  118. <view class="empty-icon">
  119. <image src="../../images/icon/empty.png"></image>
  120. </view>
  121. <view class="empty-text">商家还未发布优惠券哦</view>
  122. </view>
  123. </view>
  124. </view>
  125. <wxs module="wxs" src="../../wxs/number.wxs" />