推拿小程序前端代码仓库
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.

103 lines
1.9 KiB

3 months ago
3 months ago
3 months ago
3 months ago
3 months ago
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="statusOptions"
  9. @click="onTabClick"
  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" :status="status"></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. },
  47. },
  48. onShow() {
  49. this.getCouponList()
  50. },
  51. data() {
  52. return {
  53. statusOptions: [{
  54. name: "全部优惠券"
  55. }, {
  56. name: "已使用优惠券"
  57. }, {
  58. name: "已过期优惠券"
  59. }],
  60. status: 'all'
  61. };
  62. },
  63. methods: {
  64. //获取优惠券数据
  65. getCouponList() {
  66. this.$refs.couponList.getCouponList()
  67. },
  68. //点击过滤菜单
  69. onTabClick(e) {
  70. const { index } = e
  71. // status:空-全部 0-未使用 1-已使用 2-已失效
  72. if (index === 0) {
  73. this.status = 'all'
  74. } else {
  75. this.status = index
  76. }
  77. }
  78. }
  79. }
  80. </script>
  81. <style scoped lang="scss">
  82. .page {
  83. background-color: $uni-bg-color;
  84. min-height: 100vh;
  85. /deep/ .nav-bar__view {
  86. background-image: linear-gradient(#84A73F, #D8FF8F);
  87. }
  88. }
  89. .tabs {
  90. /deep/ .uv-tabs__wrapper__nav__line {
  91. bottom: 0;
  92. }
  93. }
  94. </style>