filter.vue 3.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165
  1. <template>
  2. <view class="page-wrap">
  3. <view class="filter-item">
  4. <view class="label">开票状态</view>
  5. <view class="tag-group">
  6. <view :class="{ item: true, active: filterForm.state === item.value }" v-for="(item, index) in stateOption" :key="index" @click="filterForm.state = item.value">
  7. {{ item.label }}
  8. </view>
  9. </view>
  10. </view>
  11. <view class="filter-item">
  12. <view class="label">日期范围</view>
  13. <view class="tag-group">
  14. <view :class="{ item: true, active: filterForm.timeType === item.value }" v-for="(item, index) in timeOption" :key="index" @click="filterForm.timeType = item.value">
  15. {{ item.label }}
  16. </view>
  17. <uni-datetime-picker v-model="filterForm.timeRanges" type="daterange">
  18. <view :class="{ item: true, active: filterForm.timeType === 4}" @click="filterForm.timeType = 4">
  19. 自定义 {{ filterForm.timeRanges.length ? filterForm.timeRanges[0] + ' 至 ' + filterForm.timeRanges[1] : '' }}
  20. </view>
  21. </uni-datetime-picker>
  22. </view>
  23. </view>
  24. <view class="filter-item">
  25. <view class="label">日期排序</view>
  26. <view class="tag-group">
  27. <view :class="{ item: true, active: item.value === filterForm.sort }" v-for="(item, index) in sortOption" :key="index">{{ item.label }}</view>
  28. </view>
  29. </view>
  30. <view class="btn-group">
  31. <button class="btn btn-1">重置</button>
  32. <button class="btn" @click="handleSubmit">确定</button>
  33. </view>
  34. </view>
  35. </template>
  36. <script>
  37. export default {
  38. data() {
  39. return {
  40. filterForm: {
  41. state: 0,
  42. timeType: 0,
  43. timeRanges: [],
  44. sort: 0
  45. },
  46. stateOption: [
  47. {
  48. label: '全部',
  49. value: 0
  50. },
  51. {
  52. label: '应付账单',
  53. value: 1
  54. },
  55. {
  56. label: '应收账单',
  57. value: 2
  58. },
  59. {
  60. label: '充值',
  61. value: 3
  62. },
  63. {
  64. label: '提现',
  65. value: 3
  66. }
  67. ],
  68. timeOption: [
  69. {
  70. label: '最近30天',
  71. value: 0
  72. },
  73. {
  74. label: '最近90天',
  75. value: 1
  76. },
  77. {
  78. label: '本季度',
  79. value: 2
  80. },
  81. {
  82. label: '本年度',
  83. value: 3
  84. }
  85. ],
  86. sortOption: [
  87. {
  88. label: '正序',
  89. value: 0
  90. },
  91. {
  92. label: '倒序',
  93. value: 1
  94. }
  95. ]
  96. };
  97. },
  98. methods: {
  99. handleSubmit(){
  100. uni.navigateBack()
  101. }
  102. }
  103. };
  104. </script>
  105. <style lang="scss" scoped>
  106. .page-wrap {
  107. padding: 41.21rpx 27.47rpx;
  108. }
  109. .filter-item {
  110. font-size: 27.47rpx;
  111. margin-bottom: 41.21rpx;
  112. .label {
  113. color: #666;
  114. }
  115. }
  116. .tag-group {
  117. display: flex;
  118. flex-wrap: wrap;
  119. .item {
  120. min-width: 157.97rpx;
  121. box-sizing: border-box;
  122. color: #999;
  123. height: 68.68rpx;
  124. line-height: 65.93rpx;
  125. white-space: nowrap;
  126. overflow: hidden;
  127. text-overflow: ellipsis;
  128. max-width: 100%;
  129. border: 1rpx solid #dcdcdc;
  130. border-radius: 5.49rpx;
  131. text-align: center;
  132. margin: 13.74rpx 13.74rpx 0 0;
  133. background: #fff;
  134. padding: 0 20.6rpx;
  135. }
  136. .active {
  137. color: #00bcd2;
  138. border-color: #00bcd2;
  139. background: #eafffd;
  140. }
  141. }
  142. .btn-group{
  143. display: flex;
  144. justify-content: center;
  145. margin-top: 156.59rpx;
  146. .btn{
  147. width: 247.25rpx;
  148. height: 75.55rpx;
  149. background: #079eff;
  150. font-size: 27.47rpx;
  151. color: #fff;
  152. border-radius: 8.24rpx;
  153. border: none;
  154. margin: 0 13.74rpx;
  155. line-height: 75.55rpx;
  156. &-1{
  157. color: #040404;
  158. background: #ccc;
  159. }
  160. }
  161. }
  162. </style>