sort.vue 3.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149
  1. <template>
  2. <view>
  3. <u-popup :show="showSort" mode="bottom" closeable @close="handleClose">
  4. <scroll-view scroll-y :style="{ height: mapHeight }" @touchmove.stop="() => {}">
  5. <view class="sort_wrap" :style="{ height : mapHeight }">
  6. <view class="sort_way">
  7. <view class="title">
  8. 排序方式
  9. </view>
  10. <view class="option_item" @click="handleChangeSort('asc')"
  11. :class="{ active : value.sort == 'asc' }">
  12. <text>正序排序</text>
  13. <u-icon name="checkbox-mark" color="#4c8afe"></u-icon>
  14. </view>
  15. <view class="option_item" @click="handleChangeSort('desc')"
  16. :class="{ active : value.sort == 'desc' }">
  17. <text>倒序排序</text>
  18. <u-icon name="checkbox-mark" color="#4c8afe"></u-icon>
  19. </view>
  20. <view class="title" style="margin-top: 30rpx;">
  21. 排序属性
  22. </view>
  23. <view class="option_item" v-for="(item,index) in sortParams" :key="index"
  24. @click="handleChangeSortField(item.value)" :class="{ active : value.sortField == item.value }">
  25. <text>{{item.text}}</text>
  26. <u-icon name="checkbox-mark" color="#4c8afe"></u-icon>
  27. </view>
  28. </view>
  29. <u-tabbar :fixed="true" inactiveColor="#ffffff" class="case_tabbar" :placeholder="true"
  30. :safeAreaInsetBottom="true">
  31. <u-tabbar-item text="重置" :customStyle="{backgroundColor : '#fff'}"
  32. class="uTabbarItem close_btn" @click="handleReset"></u-tabbar-item>
  33. <u-tabbar-item text="确定" :customStyle="{backgroundColor : '#4c8afe'}"
  34. class="uTabbarItem" @click="handleEnter"></u-tabbar-item>
  35. </u-tabbar>
  36. </view>
  37. </scroll-view>
  38. </u-popup>
  39. </view>
  40. </template>
  41. <script>
  42. export default {
  43. props: {
  44. value: {
  45. type: Object,
  46. },
  47. mapHeight : {
  48. type : String,
  49. },
  50. },
  51. emits : ["getList"],
  52. data() {
  53. return {
  54. showSort: false,
  55. sortParams: [{
  56. value: 1,
  57. text: '创建时间'
  58. }, {
  59. value: 2,
  60. text: '分配时间'
  61. },{
  62. value: 3,
  63. text: '跟进时间'
  64. }]
  65. }
  66. },
  67. mounted(){
  68. },
  69. methods: {
  70. handleClose(){
  71. this.showSort = false;
  72. },
  73. handleReset(){
  74. this.value.sort = undefined;
  75. this.value.sortField = undefined;
  76. },
  77. handleEnter(){
  78. this.$emit("getList");
  79. this.showSort = false;
  80. },
  81. handleChangeSort(sort) {
  82. this.value.sort = sort;
  83. },
  84. handleChangeSortField(value){
  85. this.value.sortField = value;
  86. },
  87. show() {
  88. this.showSort = true;
  89. }
  90. },
  91. }
  92. </script>
  93. <style lang="scss" scoped>
  94. .sort_wrap {
  95. padding: 20px;
  96. box-sizing: border-box;
  97. overflow: scroll;
  98. .title {
  99. font-size: 18px;
  100. color: #202020;
  101. }
  102. .option_item {
  103. display: flex;
  104. justify-content: space-between;
  105. align-items: center;
  106. font-size: 15px;
  107. padding: 18px 0;
  108. border-bottom: 1px solid #eeeef2;
  109. color: #606060;
  110. &:last-child{
  111. border: none;
  112. }
  113. }
  114. .active {
  115. color:#4c8afe;
  116. ::v-deep & .u-icon__icon {
  117. display: block;
  118. }
  119. }
  120. ::v-deep .u-icon__icon {
  121. display: none;
  122. font-weight: bold !important;
  123. font-size: 19px !important;
  124. }
  125. }
  126. .case_tabbar {
  127. .uTabbarItem {
  128. ::v-deep .u-tabbar-item__text {
  129. font-size: 18px;
  130. }
  131. }
  132. .close_btn {
  133. ::v-deep .u-tabbar-item__text {
  134. font-size: 18px;
  135. color: #606060 !important;
  136. }
  137. }
  138. }
  139. </style>