index.vue 3.9 KB

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