index.wxml 3.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182
  1. <van-tabs bind:change="tabClick">
  2. <van-tab wx:for="{{tabs}}" wx:key="index" title="{{item}}"></van-tab>
  3. </van-tabs>
  4. <van-cell wx:if="{{ activeIndex == 1 && coupons && coupons.length == 0 }}" custom-class="hecheng" title="合成高品质优惠券" value="合成" is-link />
  5. <van-empty wx:if="{{ activeIndex != 3 && (!coupons || coupons.length == 0) }}" description="暂无优惠券" />
  6. <view class="coupons" wx:for="{{coupons}}" wx:key="id" wx:if="{{activeIndex == 0}}">
  7. <image class="icon" src="/images/icon/coupons-active.svg"></image>
  8. <view class="profile">
  9. <view class="name">
  10. <view class="t">代金券</view>
  11. <view class="n">{{item.name}}</view>
  12. </view>
  13. <view class="price">
  14. <view class="tj">满{{item.moneyHreshold}}</view>
  15. <view wx:if="{{ item.moneyType == 0 }}" class="amount"><text>¥</text>{{item.moneyMin}}</view>
  16. <view wx:if="{{ item.moneyType == 1 }}" class="amount"><text></text>{{item.moneyMin}}<text>%</text></view>
  17. </view>
  18. <view class="btn" bindtap="getCounpon" data-id="{{item.id}}" data-pwd="{{item.pwd}}">立即领取</view>
  19. </view>
  20. </view>
  21. <view class="coupons" wx:for="{{coupons}}" wx:key="id" wx:if="{{activeIndex == 1}}">
  22. <image class="icon" src="/images/icon/coupons-active.svg"></image>
  23. <view class="profile">
  24. <view class="name">
  25. <view class="t">代金券</view>
  26. <view class="n">{{item.name}}</view>
  27. </view>
  28. <view class="price">
  29. <view class="tj">({{item.dateEnd}}到期) 满{{item.moneyHreshold}}</view>
  30. <view wx:if="{{ item.moneyType == 0 }}" class="amount"><text>¥</text>{{item.money}}</view>
  31. <view wx:if="{{ item.moneyType == 1 }}" class="amount"><text></text>{{item.money}}<text>%</text></view>
  32. </view>
  33. <view class="btn" bindtap="toIndexPage">立即使用</view>
  34. </view>
  35. </view>
  36. <view class="coupons" wx:for="{{coupons}}" wx:key="id" wx:if="{{activeIndex == 2}}">
  37. <image class="icon" src="/images/icon/coupons-off.svg"></image>
  38. <view class="profile">
  39. <view class="name">
  40. <view class="t disabled1">代金券</view>
  41. <view class="n disabled2">{{item.name}}</view>
  42. </view>
  43. <view class="price">
  44. <view class="tj disabled2">满{{item.moneyHreshold}}</view>
  45. <view wx:if="{{ item.moneyType == 0 }}" class="amount disabled2"><text class="disabled2">¥</text>{{item.money}}</view>
  46. <view wx:if="{{ item.moneyType == 1 }}" class="amount disabled2"><text class="disabled2"></text>{{item.money}}<text class="disabled2">%</text></view>
  47. </view>
  48. <view class="btn">{{ item.statusStr }}</view>
  49. </view>
  50. </view>
  51. <view class="koulingcoupon" wx:if="{{activeIndex == 3}}">
  52. <van-field
  53. label="券号"
  54. model:value="{{ number }}"
  55. clearable
  56. size="large"
  57. placeholder="请输入券号"
  58. bind:change="onChange"
  59. />
  60. <van-field
  61. label="密码"
  62. model:value="{{ pwd }}"
  63. clearable
  64. size="large"
  65. placeholder="请输入密码"
  66. bind:change="onChange"
  67. />
  68. <view class="block-btn">
  69. <van-button wx:if="{{ isLogined }}" block type="primary" loading="{{ exchangeCouponsLoading }}" bind:click="exchangeCoupons">立即兑换</van-button>
  70. <van-button wx:else block type="primary" open-type="getUserInfo" lang="zh_CN" bind:getuserinfo="processLogin">登陆后兑换</van-button>
  71. </view>
  72. </view>
  73. <view class="bottom"></view>
  74. <block wx:if="{{showPwdPop}}">
  75. <view class="pwd-coupons-mask" bindtap="closePwd"></view>
  76. <view class="pwd-coupons">
  77. <view class="t">请输入口令</view>
  78. <input bindinput="pwdCouponChange" class="input" value="{{couponPwd}}" auto-focus/>
  79. <button type="primary" plain bindtap="getCounpon2"> 领取 </button>
  80. </view>
  81. </block>