推拿小程序前端代码仓库
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

140 lines
2.6 KiB

3 months ago
3 months ago
3 months ago
3 months ago
3 months ago
3 months ago
  1. <template>
  2. <view class="page">
  3. <!-- 导航栏 -->
  4. <navbar title="优惠券" leftClick @leftClick="$utils.navigateBack" color="#fff" />
  5. <!-- 优惠券筛选 -->
  6. <view class="tabs">
  7. <uv-tabs
  8. :list="filtrationMenu"
  9. @click="hadleFiltrationMenuEvent"
  10. :customStyle="{
  11. backgroundColor: '#FFFFFF',
  12. }"
  13. :activeStyle="{
  14. color: '#84A73F',
  15. fontSize: '28rpx',
  16. whiteSpace: 'nowrap',
  17. paddingTop: '29rpx',
  18. paddingBottom: '21rpx',
  19. }"
  20. :inactiveStyle="{
  21. color: '#000000',
  22. fontSize: '28rpx',
  23. whiteSpace: 'nowrap',
  24. paddingTop: '29rpx',
  25. paddingBottom: '21rpx',
  26. }"
  27. lineHeight="5rpx"
  28. lineWidth="92rpx"
  29. lineColor="linear-gradient(to right, #84A73F, #D8FF8F)"
  30. :scrollable="false"
  31. ></uv-tabs>
  32. </view>
  33. <couponList ref="couponList" :list="list" :state="state"></couponList>
  34. </view>
  35. </template>
  36. <script>
  37. import couponList from "@/components/couponList/couponList.vue"
  38. export default {
  39. name: "coupon",
  40. components: {
  41. couponList
  42. },
  43. props: {
  44. height: {
  45. default: 'auto'
  46. // default : 'calc(90vh - 180rpx)'
  47. },
  48. // 押金
  49. depositPrice: {},
  50. washPrice: { //水洗费
  51. },
  52. rentPrice: { //租金
  53. },
  54. },
  55. onShow() {
  56. this.getCouponList()
  57. },
  58. data() {
  59. return {
  60. filtrationMenu: [{
  61. name: "全部优惠券"
  62. }, {
  63. name: "已使用优惠券"
  64. }, {
  65. name: "已过期优惠券"
  66. }],
  67. state: 0
  68. };
  69. },
  70. methods: {
  71. //获取优惠券数据
  72. getCouponList() {
  73. this.$refs.couponList.getCouponList()
  74. },
  75. select(item) {
  76. if (this.isSelect(item)) {
  77. return
  78. }
  79. this.$emit('select', item)
  80. },
  81. isSelect(item) {
  82. if (!this.depositPrice && !this.rentPrice && !this.washPrice) {
  83. return false
  84. }
  85. // 押金
  86. if (this.depositPrice &&
  87. item.useType == 0 &&
  88. this.depositPrice >= item.conditionPrice) {
  89. return false
  90. }
  91. // 租金
  92. if (this.rentPrice &&
  93. item.useType == 1 &&
  94. this.rentPrice >= item.conditionPrice) {
  95. return false
  96. }
  97. // 水洗
  98. if (this.washPrice &&
  99. item.useType == 2 &&
  100. this.washPrice >= item.conditionPrice) {
  101. return false
  102. }
  103. return true
  104. },
  105. //点击过滤菜单
  106. hadleFiltrationMenuEvent(event) {
  107. this.state = event.index
  108. }
  109. }
  110. }
  111. </script>
  112. <style scoped lang="scss">
  113. .page {
  114. background-color: $uni-bg-color;
  115. min-height: 100vh;
  116. /deep/ .nav-bar__view {
  117. background-image: linear-gradient(#84A73F, #D8FF8F);
  118. }
  119. }
  120. .tabs {
  121. /deep/ .uv-tabs__wrapper__nav__line {
  122. bottom: 0;
  123. }
  124. }
  125. </style>