|
@@ -6,15 +6,15 @@
|
|
|
<view class="exhibitor-filter">
|
|
|
<view>
|
|
|
<view class="exhibitor-filter-label">展馆号</view>
|
|
|
- <u-dropdown-select ref="select1" v-model="categoryId" placeholder="选择展馆号" :options="categories" @dropdown="onSelectDropdown(1)" />
|
|
|
+ <u-dropdown-select ref="select1" v-model="searchHall" placeholder="选择展馆号" :options="halls" @dropdown="onSelectDropdown(1)" @change="getExhibitorsList()"/>
|
|
|
</view>
|
|
|
<view>
|
|
|
<view class="exhibitor-filter-label">产品类别</view>
|
|
|
- <u-dropdown-select ref="select2" v-model="categoryId" placeholder="选择产品类别" :options="categories" @dropdown="onSelectDropdown(2)" />
|
|
|
+ <u-dropdown-select ref="select2" v-model="searchCategoryId" placeholder="选择产品类别" :options="categories" @dropdown="onSelectDropdown(2)" @change="getExhibitorsList()"/>
|
|
|
</view>
|
|
|
<view>
|
|
|
<view class="exhibitor-filter-label">应用领域</view>
|
|
|
- <u-dropdown-select ref="select3" v-model="categoryId" placeholder="选择应用领域" :options="categories" @dropdown="onSelectDropdown(3)" />
|
|
|
+ <u-dropdown-select ref="select3" v-model="searchApplicationAreas" placeholder="选择应用领域" :options="applicationAreass" @dropdown="onSelectDropdown(3)" @change="getExhibitorsList()"/>
|
|
|
</view>
|
|
|
</view>
|
|
|
<u-search v-model="searchKeyword" placeholder="搜索展商 / 展品名称 / 会议" @search="onSearch" />
|
|
@@ -38,6 +38,7 @@
|
|
|
import USearch from '@/components/common/u-search'
|
|
|
import UDropdownSelect from '@/components/common/u-dropdown-select'
|
|
|
import ExhibitorItem from '@/pages/exhibitor/components/exhibitor-item.vue'
|
|
|
+ import { exhibitorsList, productCategoryList, exhibitorsHallList, applicationAreasList } from '@/api/exhibitor'
|
|
|
|
|
|
export default {
|
|
|
options: {
|
|
@@ -52,55 +53,108 @@
|
|
|
},
|
|
|
data() {
|
|
|
return {
|
|
|
- categoryId: undefined,
|
|
|
+ searchCategoryId: '',
|
|
|
+ searchHall: '',
|
|
|
+ searchApplicationAreas: '',
|
|
|
searchKeyword: '',
|
|
|
- exhibitorList: [{ favourited: true, name: '科世达(上海)连接器有限公司' }, { liked: true }, { voted: true }, {}, {}, {}],
|
|
|
- categories: [{
|
|
|
- label: '表面贴装',
|
|
|
- value: 1,
|
|
|
- children: [{
|
|
|
- label: '表面贴装技术',
|
|
|
- value: 11
|
|
|
- }, {
|
|
|
- label: 'PCB焊接和连接技术',
|
|
|
- value: 12
|
|
|
- }, {
|
|
|
- label: '测试测量和质量保证',
|
|
|
- value: 13
|
|
|
- }, {
|
|
|
- label: '电子组装自动化',
|
|
|
- value: 14
|
|
|
- }, {
|
|
|
- label: '生产物流和物流技术',
|
|
|
- value: 15
|
|
|
- }, {
|
|
|
- label: '清洗技术',
|
|
|
- value: 16
|
|
|
- }]
|
|
|
- }, {
|
|
|
- label: '线束加工',
|
|
|
- value: 2
|
|
|
- }, {
|
|
|
- label: '工厂自动化',
|
|
|
- value: 3
|
|
|
- }, {
|
|
|
- label: '点胶注胶',
|
|
|
- value: 4
|
|
|
- }, {
|
|
|
- label: '电子制造服务',
|
|
|
- value: 5
|
|
|
- }, {
|
|
|
- label: '未来服务',
|
|
|
- value: 6
|
|
|
- }]
|
|
|
+ exhibitorsParams: {
|
|
|
+ page: 1,
|
|
|
+ page_size: 10,
|
|
|
+ keyword: '',
|
|
|
+ country: '',
|
|
|
+ hall: '',
|
|
|
+ product_cate_id: '',
|
|
|
+ application_areas_id: ''
|
|
|
+ },
|
|
|
+ exhibitorList: [],
|
|
|
+ exhibitorListLoading: false,
|
|
|
+ exhibitorListLastPage: 1,
|
|
|
+ categories: [],
|
|
|
+ halls: [],
|
|
|
+ applicationAreass: []
|
|
|
}
|
|
|
},
|
|
|
created() {
|
|
|
this.loadFontFace('Poppins')
|
|
|
+ this.getProductCategoryList()
|
|
|
+ this.getExhibitorsHallList()
|
|
|
+ this.getApplicationAreasList()
|
|
|
+ this.getExhibitorsList()
|
|
|
},
|
|
|
methods: {
|
|
|
+ getApplicationAreasList() {
|
|
|
+ applicationAreasList().then(res => {
|
|
|
+ let areas = []
|
|
|
+ res.data.forEach(item => {
|
|
|
+ areas.push({
|
|
|
+ label: item.name,
|
|
|
+ value: item.id,
|
|
|
+ })
|
|
|
+ })
|
|
|
+ this.applicationAreass = areas
|
|
|
+ })
|
|
|
+ },
|
|
|
+ getExhibitorsHallList() {
|
|
|
+ exhibitorsHallList().then(res => {
|
|
|
+ let halls = []
|
|
|
+ res.data.forEach(item => {
|
|
|
+ halls.push({
|
|
|
+ label: item.name,
|
|
|
+ value: item.id,
|
|
|
+ })
|
|
|
+ })
|
|
|
+ console.log(halls)
|
|
|
+ this.halls = halls
|
|
|
+ })
|
|
|
+ },
|
|
|
+ getProductCategoryList() {
|
|
|
+ productCategoryList().then(res => {
|
|
|
+ let cate = []
|
|
|
+ res.data.forEach(item => {
|
|
|
+ let child = []
|
|
|
+ item.children.forEach(itemC => {
|
|
|
+ child.push({
|
|
|
+ label: itemC.name,
|
|
|
+ value: itemC.id
|
|
|
+ })
|
|
|
+ })
|
|
|
+ cate.push({
|
|
|
+ label: item.name,
|
|
|
+ value: item.id,
|
|
|
+ children: child
|
|
|
+ })
|
|
|
+ })
|
|
|
+ this.categories = cate
|
|
|
+ })
|
|
|
+ },
|
|
|
+ getExhibitorsList() {
|
|
|
+ if (this.exhibitorListLoading === true) {
|
|
|
+ return
|
|
|
+ }
|
|
|
+ this.exhibitorsParams.application_areas_id = this.searchApplicationAreas
|
|
|
+ this.exhibitorsParams.product_cate_id = this.searchCategoryId
|
|
|
+ this.exhibitorsParams.hall = this.searchHall
|
|
|
+ this.exhibitorListLoading = true
|
|
|
+ exhibitorsList(this.exhibitorsParams).then(res => {
|
|
|
+ if (res.data.data) {
|
|
|
+ if (this.exhibitorsParams.page > 1) {
|
|
|
+ this.exhibitorList = [...this.exhibitorList, ...res.data.data]
|
|
|
+ } else {
|
|
|
+ this.exhibitorList = res.data.data
|
|
|
+ this.exhibitorListLastPage = res.data.last_page
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ this.showToast('系统繁忙,稍候再试')
|
|
|
+ }
|
|
|
+ this.exhibitorListLoading = false
|
|
|
+ })
|
|
|
+ },
|
|
|
onScrollToLower(e) {
|
|
|
- console.log("滚动接近底部100个像素")
|
|
|
+ if (this.exhibitorListLastPage === this.exhibitorsParams.page) {
|
|
|
+ return
|
|
|
+ }
|
|
|
+ this.exhibitorsParams.page = this.exhibitorsParams.page+1
|
|
|
+ this.getExhibitorsList()
|
|
|
},
|
|
|
onSelectDropdown(index) {
|
|
|
['select1', 'select2', 'select3'].forEach(v => {
|