sift.vue 1.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596
  1. <template>
  2. <u-popup :show="value" @close="close()" round="15" :closeable="true" :mask-close-able="true">
  3. <view class="ppopup">
  4. <u-divider text="简历筛选" style="margin-top: 25px; margin-bottom: -5px"></u-divider>
  5. <view class="item">
  6. <view class="title">年龄范围</view>
  7. <view class="form_group" style="display: flex">
  8. <view class="start">
  9. <input type="number" placeholder="开始" v-model="item.min" maxlength="2" />
  10. </view>
  11. <view class="hor">至</view>
  12. <view class="start">
  13. <input type="number" placeholder="结束" v-model="item.max" maxlength="2" />
  14. </view>
  15. </view>
  16. </view>
  17. <view class="flex">
  18. <view class="f">
  19. <button class="btn ex" @click="clear()">重置</button>
  20. </view>
  21. <view class="f">
  22. <button class="btn" @click="confirm()">确认</button>
  23. </view>
  24. </view>
  25. </view>
  26. </u-popup>
  27. </template>
  28. <script>
  29. export default {
  30. name: 'filters',
  31. props: {
  32. value: {
  33. type: Boolean,
  34. default: true
  35. }
  36. },
  37. data() {
  38. return {
  39. item: {}
  40. };
  41. },
  42. methods: {
  43. confirm() {
  44. if (parseInt(this.item.max) < parseInt(this.item.min)) {
  45. uni.showModal({ content: '结束年龄不能小于开始年龄', showCancel: false });
  46. return false;
  47. }
  48. this.$emit('input', false);
  49. this.$emit('confirm', this.item);
  50. },
  51. clear() {
  52. this.item = { min: '', max: '' };
  53. this.$forceUpdate();
  54. this.$emit('confirm', this.item);
  55. this.$emit('input', false);
  56. },
  57. close() {
  58. this.$emit('input', false);
  59. }
  60. }
  61. };
  62. </script>
  63. <style lang="scss">
  64. .ppopup {
  65. padding: 10px;
  66. .title {
  67. font-size: 17px;
  68. margin-top: 12px;
  69. margin-bottom: 12px;
  70. font-weight: bold;
  71. padding-left: 5px;
  72. .icon {
  73. float: right;
  74. }
  75. }
  76. .item {
  77. overflow: hidden;
  78. input {
  79. text-align: center;
  80. }
  81. }
  82. .f {
  83. margin: 7px;
  84. .btn {
  85. margin-top: 10px;
  86. padding: 0px;
  87. }
  88. .ex {
  89. background-color: #f3f3f3;
  90. color: #6b6b6b;
  91. }
  92. }
  93. }
  94. </style>