position-select.vue 2.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465
  1. <template>
  2. <view class="position-select-page">
  3. <view class="search-header">
  4. <view class="search-box">
  5. <text class="icon-search"></text>
  6. <input type="text" v-model="searchQuery" placeholder="搜索职位名称" placeholder-style="color: #A0AABF;" />
  7. </view>
  8. </view>
  9. <view class="content-body" v-if="!searchQuery">
  10. <!-- Left side -->
  11. <scroll-view class="left-menu" scroll-y>
  12. <view
  13. v-for="(item, index) in positionData"
  14. :key="index"
  15. :class="['menu-item', activeIndex === index ? 'active' : '']"
  16. @tap="selectMenu(index)"
  17. >
  18. <text class="menu-name">{{ item.name }}</text>
  19. <view class="active-indicator" v-if="activeIndex === index"></view>
  20. </view>
  21. </scroll-view>
  22. <!-- Right side -->
  23. <scroll-view class="right-content" scroll-y :scroll-into-view="scrollIntoId" scroll-with-animation @scroll="onRightScroll">
  24. <!-- 一级分类 Wrapper -->
  25. <view class="category-wrapper" v-for="(item, index) in positionData" :key="'wrapper-'+index" :id="'category-' + index">
  26. <!-- 二级分类 Section -->
  27. <view class="category-section" v-for="(sub, sIdx) in item.sections" :key="'sub-'+sIdx">
  28. <view class="section-title">{{ sub.name }}</view>
  29. <view class="tags-grid">
  30. <view
  31. :class="['tag-item', pos === currentSelected ? 'selected' : '']"
  32. v-for="(pos, pIdx) in sub.children"
  33. :key="pIdx"
  34. @tap="selectPosition(pos)"
  35. >
  36. {{ pos }}
  37. </view>
  38. </view>
  39. </view>
  40. </view>
  41. </scroll-view>
  42. </view>
  43. <scroll-view class="search-results" scroll-y v-else>
  44. <view class="result-list" v-if="searchResults.length > 0">
  45. <view :class="['result-item', pos === currentSelected ? 'selected' : '']" v-for="(pos, index) in searchResults" :key="index" @tap="selectPosition(pos)">
  46. {{ pos }}
  47. </view>
  48. </view>
  49. <view class="empty-state" v-else>
  50. <text class="empty-text">未找到相关职位</text>
  51. </view>
  52. </scroll-view>
  53. </view>
  54. </template>
  55. <script src="./position-select.js"></script>
  56. <style lang="scss" scoped>
  57. @import './position-select.scss';
  58. </style>