industry-select.vue 1.2 KB

1234567891011121314151617181920212223242526272829303132333435
  1. <template>
  2. <view class="industry-selector-page">
  3. <scroll-view scroll-y class="selector-content">
  4. <view class="header-titles">
  5. <text class="main-title">所在行业</text>
  6. <text class="sub-title">请选择行业,最多1个</text>
  7. </view>
  8. <view class="accordion-list">
  9. <view class="accordion-item" v-for="(category, cIdx) in industryData" :key="cIdx">
  10. <view class="accordion-header" @tap="toggleCategory(cIdx)">
  11. <text class="category-name">{{ category.name }}</text>
  12. <view :class="['arrow-icon', category.expanded ? 'expanded' : '']"></view>
  13. </view>
  14. <view class="tags-container" v-if="category.expanded">
  15. <view
  16. v-for="(tag, tIdx) in category.children"
  17. :key="tIdx"
  18. :class="['tag', (currentIndustry === category.name + '-' + tag) ? 'active' : '']"
  19. @tap="selectIndustry(category.name, tag)"
  20. >
  21. {{ tag }}
  22. </view>
  23. </view>
  24. </view>
  25. </view>
  26. </scroll-view>
  27. </view>
  28. </template>
  29. <script src="./industry-select.js"></script>
  30. <style lang="scss" scoped>
  31. @import './industry-select.scss';
  32. </style>