sift.vue 2.6 KB

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