filter.vue 5.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122
  1. <template>
  2. <view class="task-status">
  3. <view class="platform">
  4. <view class="platform-item active">
  5. <view class="name">全部</view>
  6. <image src="https://blue-data.oss-cn-guangzhou.aliyuncs.com/star/tab-active-badge.png"></image>
  7. </view>
  8. <view class="platform-item">
  9. <view class="name">抖音</view>
  10. <image src="https://blue-data.oss-cn-guangzhou.aliyuncs.com/star/tab-active-badge.png"></image>
  11. </view>
  12. <view class="platform-item">
  13. <view class="name">快手</view>
  14. <image src="https://blue-data.oss-cn-guangzhou.aliyuncs.com/star/tab-active-badge.png"></image>
  15. </view>
  16. <view class="platform-item">
  17. <view class="name">小红书</view>
  18. <image src="https://blue-data.oss-cn-guangzhou.aliyuncs.com/star/tab-active-badge.png"></image>
  19. </view>
  20. <view class="platform-item">
  21. <view class="name">视频号</view>
  22. <image src="https://blue-data.oss-cn-guangzhou.aliyuncs.com/star/tab-active-badge.png"></image>
  23. </view>
  24. </view>
  25. <view class="filter" @click="showFilter(1)">
  26. <view class="filter-item" v-for="(item,indx) in filterData" :key="indx">
  27. {{item.name}}
  28. <text class="cuIcon-triangledownfill"></text>
  29. </view>
  30. </view>
  31. <uni-popup ref="filterPop" type="bottom" border-radius="10px 10px 0 0" background-color="#ffffff" :mask-click="false">
  32. <view class="filter-popup">
  33. <view class="title">
  34. <view class="name">
  35. <text>任务筛选</text>
  36. <image src="https://blue-data.oss-cn-guangzhou.aliyuncs.com/star/tab-active-badge.png"></image>
  37. </view>
  38. <view class="close" @click="showFilter(2)"><text class="cuIcon-close"></text></view>
  39. </view>
  40. <view class="filter-option-body">
  41. <view class="filter-check" v-for="(item,indx) in filterData" :key="indx">
  42. <view class="name">{{item.name}}</view>
  43. <view class="children">
  44. <view :class="sub.index==0?'children-item active':'children-item'" v-for="(sub,inddx) in item.children" :key="inddx">
  45. {{ sub.name }}
  46. </view>
  47. </view>
  48. </view>
  49. </view>
  50. <view class="filter-btn-group">
  51. <view class="u-button full">确定</view>
  52. <view class="u-button" @click="showFilter(2)">取消</view>
  53. </view>
  54. </view>
  55. </uni-popup>
  56. </view>
  57. </template>
  58. <script>
  59. export default {
  60. data() {
  61. return {
  62. filterData:this.data
  63. }
  64. },
  65. props: {
  66. data: {
  67. type: Array,
  68. default: []
  69. },
  70. },
  71. methods: {
  72. showFilter(type){
  73. if (type == 1) {
  74. uni.hideTabBar()
  75. this.$refs.filterPop.open();
  76. }
  77. if (type == 2){
  78. uni.showTabBar()
  79. this.$refs.filterPop.close();
  80. }
  81. },
  82. }
  83. }
  84. </script>
  85. <style>
  86. .filter-popup{height: 60vh;}
  87. .filter-popup .filter-option-body{padding: 20rpx;}
  88. .filter-popup .filter-option-body .filter-check{}
  89. .filter-popup .filter-option-body .filter-check .name{font-size: 28rpx;color: #000;}
  90. .filter-popup .filter-option-body .filter-check .children{display: flex;align-items: center;gap: 20rpx;flex-wrap: wrap;}
  91. .filter-popup .filter-option-body .filter-check .children-item{background-color: rgba(246, 246, 246, 1);border-radius: 6rpx;color: rgba(89, 91, 98, 1);font-size: 24rpx;padding: 15rpx 20rpx;text-align: center;margin: 20rpx 0;}
  92. .filter-popup .filter-option-body .filter-check .children-item.active{background-color: rgba(89, 91, 98, 1);color: #fff;}
  93. .filter-popup .title{display: flex;align-items: center;justify-content: space-between;padding: 20rpx;}
  94. .filter-popup .title .name{font-size: 32rpx;color: #000;font-weight: 800;position: relative;}
  95. .filter-popup .title .name text{position: relative;z-index: 999;font-family: "bluevBold";}
  96. .filter-popup .title .name image{width: 82rpx;height: 52rpx;position: absolute;right: -20rpx;bottom: 0;z-index: 99;}
  97. .filter-popup .filter-option-body{height: calc(100% - 200rpx);overflow-y: auto;}
  98. .filter-popup .filter-btn-group{display: flex;align-items: center;gap: 20rpx;padding: 20rpx;}
  99. .filter-btn-group .u-button{font-size: 28upx;height: 80upx;border-radius: 10upx;line-height: 80upx;margin-top: 40upx;color: #333;border: 2upx solid rgba(33, 34, 38, 1);background-color: #fff;flex: 1;text-align: center;font-family: "bluevBold";}
  100. .filter-btn-group .u-button::after{border: 0;}
  101. .filter-btn-group .u-button.full{background-color: rgba(33, 34, 38, 1);color: #fff;}
  102. .task-status .filter{display: flex;align-items: center;justify-content: space-around;gap: 10rpx;}
  103. .task-status .filter .filter-item{display: flex;align-items: center;background-color: rgba(246, 246, 246, 1);border-radius: 12rpx;color: rgba(89, 91, 98, 1);flex: 1;font-size: 24rpx;justify-content: center;padding: 10rpx;}
  104. .task-status .filter .filter-item.active{background-color: rgba(89, 91, 98, 1);color: #fff;}
  105. .task-status .filter .filter-item text{margin-left: auto;margin-right: 0;color: rgba(200, 200, 200, 1);font-size: 28rpx;}
  106. .task-status .platform{display: flex;align-items: center;font-size: 32rpx;color: #666;justify-content: space-around;margin: 20rpx 0;}
  107. .task-status .platform .platform-item{display: flex;align-items: center;position: relative;}
  108. .task-status .platform .platform-item .name{position: relative;z-index: 999;}
  109. .task-status .platform .platform-item image{width: 82rpx;height: 52rpx;position: absolute;right: -20rpx;bottom: 0;z-index: 99;display: none;}
  110. .task-status .platform .platform-item.active image{display: block;}
  111. .task-status .platform .platform-item.active{color: #000;font-weight: 800;font-family: "bluevBold";}
  112. </style>