index.vue 3.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143
  1. <template>
  2. <view class="exhibitor-index">
  3. <nav-bar title="展商信息" @init="onInitNavbar"></nav-bar>
  4. <u-scroll-view :tabbar-conflict="true" @scroll-near-lower="onScrollToLower">
  5. <view class="main-container">
  6. <view class="exhibitor-filter">
  7. <view>
  8. <view class="exhibitor-filter-label">展馆号</view>
  9. <u-dropdown-select ref="select1" v-model="categoryId" placeholder="选择展馆号" :options="categories2" @dropdown="onSelectDropdown(1)" />
  10. </view>
  11. <view>
  12. <view class="exhibitor-filter-label">产品类别</view>
  13. <u-dropdown-select ref="select2" v-model="categoryId" placeholder="选择产品类别" :options="categories" @dropdown="onSelectDropdown(2)" />
  14. </view>
  15. <view>
  16. <view class="exhibitor-filter-label">应用领域</view>
  17. <u-dropdown-select ref="select3" v-model="categoryId" placeholder="选择应用领域" :options="categories" @dropdown="onSelectDropdown(3)" />
  18. </view>
  19. </view>
  20. <u-search v-model="searchKeyword" placeholder="搜索展商 / 展品名称 / 会议" @search="onSearch" />
  21. <view class="ad-space">
  22. <image src="https://oss.starify.cn/prod/starify/up/0001018678/20241108/672da70a6c76a.png?x-oss-process=image/resize,w_200" mode="aspectFill"/>
  23. </view>
  24. <van-empty v-if="exhibitorList.length === 0" description="暂无数据" />
  25. <view v-else class="exhibitor-list">
  26. <template v-for="(item, index) in exhibitorList">
  27. <exhibitor-item :item="item" :key="index" @share="(e) => $emit('share', e)" />
  28. </template>
  29. </view>
  30. </view>
  31. </u-scroll-view>
  32. </view>
  33. </template>
  34. <script>
  35. import NavBar from '@/components/layout/nav-bar'
  36. import UScrollView from '@/components/common/u-scroll-view'
  37. import USearch from '@/components/common/u-search'
  38. import UDropdownSelect from '@/components/common/u-dropdown-select'
  39. import ExhibitorItem from '@/pages/exhibitor/components/exhibitor-item.vue'
  40. export default {
  41. options: {
  42. styleIsolation: 'shared'
  43. },
  44. components: {
  45. NavBar,
  46. USearch,
  47. UScrollView,
  48. UDropdownSelect,
  49. ExhibitorItem
  50. },
  51. data() {
  52. return {
  53. categoryId: undefined,
  54. searchKeyword: '',
  55. exhibitorList: [{ favourited: true, name: '科世达(上海)连接器有限公司' }, { liked: true }, { voted: true }, {}, {}, {}],
  56. categories2: [{
  57. label: '表面贴装技术',
  58. value: 11
  59. }, {
  60. label: 'PCB焊接和连接技术',
  61. value: 12
  62. }, {
  63. label: '测试测量和质量保证',
  64. value: 13
  65. }, {
  66. label: '电子组装自动化',
  67. value: 14
  68. }, {
  69. label: '生产物流和物流技术',
  70. value: 15
  71. }, {
  72. label: '清洗技术',
  73. value: 16
  74. }],
  75. categories: [{
  76. label: '表面贴装',
  77. value: 1,
  78. children: [{
  79. label: '表面贴装技术',
  80. value: 11
  81. }, {
  82. label: 'PCB焊接和连接技术',
  83. value: 12
  84. }, {
  85. label: '测试测量和质量保证',
  86. value: 13
  87. }, {
  88. label: '电子组装自动化',
  89. value: 14
  90. }, {
  91. label: '生产物流和物流技术',
  92. value: 15
  93. }, {
  94. label: '清洗技术',
  95. value: 16
  96. }]
  97. }, {
  98. label: '线束加工',
  99. value: 2,
  100. children: [{
  101. label: '表面贴装技术',
  102. value: 111
  103. }]
  104. }, {
  105. label: '工厂自动化',
  106. value: 3
  107. }, {
  108. label: '点胶注胶',
  109. value: 4
  110. }, {
  111. label: '电子制造服务',
  112. value: 5
  113. }, {
  114. label: '未来服务',
  115. value: 6
  116. }]
  117. }
  118. },
  119. created() {
  120. this.loadFontFace('Poppins')
  121. },
  122. methods: {
  123. onScrollToLower(e) {
  124. console.log("滚动接近底部100个像素")
  125. },
  126. onSelectDropdown(index) {
  127. ['select1', 'select2', 'select3'].forEach(v => {
  128. if (v !== 'select' + index) {
  129. this.$refs[v].hideDropdown()
  130. }
  131. })
  132. },
  133. onSearch() {
  134. this.navigateTo('/pages/index/search?query=' + this.searchKeyword)
  135. }
  136. }
  137. }
  138. </script>
  139. <style lang="scss">
  140. </style>