zhaosm il y a 4 jours
Parent
commit
f7eab3b962
3 fichiers modifiés avec 131 ajouts et 53 suppressions
  1. 24 0
      api/exhibitor.js
  2. 9 9
      pages/exhibitor/components/exhibitor-item.vue
  3. 98 44
      pages/exhibitor/index.vue

+ 24 - 0
api/exhibitor.js

@@ -0,0 +1,24 @@
+import { get, post, link, upload } from '@/utils/request'
+
+export const exhibitorsList = get('/api/exhibitors/list')
+export const exhibitorsInfo = get('/api/exhibitors/info')
+
+export const exhibitorsProductList = get('/api/exhibitors/product/list')
+export const exhibitorsProductInfo = get('/api/exhibitors/product/info')
+
+export const exhibitorsNewsList = get('/api/exhibitors/news/list')
+export const exhibitorsNewsInfo = get('/api/exhibitors/news/info')
+
+export const exhibitorsBoothActivityList = get('/api/exhibitors/booth-activity/list')
+export const exhibitorsBoothActivityInfo = get('/api/exhibitors/booth-activity/info')
+
+export const exhibitorsCountryList = get('/api/exhibitors/country/list')
+export const productCategoryList = get('/api/product-category/list')
+export const applicationAreasList = get('/api/application-areas/list')
+export const productAttrList = get('/api/product-attr/list')
+export const exhibitorsHallList = get('/api/exhibitors/hall/list')
+
+export const exhibitorsViewLogList = get('/api/exhibitors/view-log')
+export const exhibitorsProductViewLogList = get('/api/exhibitors/product/view-log')
+
+export const exhibitorsSearch = get('/api/exhibitors/search') // 全局搜索

+ 9 - 9
pages/exhibitor/components/exhibitor-item.vue

@@ -1,18 +1,18 @@
 <template>
 	<view class="exhibitor-item" hover-class="active" @click="onClickExhibitor">
 		<view class="exhibitor-body">
-			<view class="exhibitor-logo"><image src="https://oss.starify.cn/prod/starify/up/0001018678/20241108/672da70c02212.png?x-oss-process=image/resize,w_400" mode="aspectFit" /></view>
+			<view class="exhibitor-logo"><image :src="item.logo" mode="aspectFit" /></view>
 			<view class="exhibitor-name">
-				<view class="exhibitor-name-cn">科世达(上海)连接器有限公司</view>
-				<view class="exhibitor-name-en">Leopold Kostal GmbH & Co. KG</view>
+				<view class="exhibitor-name-cn">{{ item.name_zh_cn }}</view>
+				<view class="exhibitor-name-en">{{ item.name_en_us }}</view>
 			</view>
 			<view class="exhibitor-number">
 				<view class="exhibitor-number-label">展位号:</view>
-				<view class="exhibitor-number-text">E1.1101</view>
+				<view class="exhibitor-number-text">{{ item.hall_booth_no }}</view>
 			</view>
 		</view>
 		<view v-if="!footerHidden" class="exhibitor-footer">
-			<view class="exhibitor-views">浏览:30911</view>
+			<view class="exhibitor-views">浏览:{{ item.pv }}</view>
 			<view class="exhibitor-action">
 				<view>
 					<button :plain="true" @click.stop="onShare(item)">
@@ -23,17 +23,17 @@
 					</button>
 				</view>
 				<view>
-					<view v-if="item.favourited" class="iconfont icon-favourites-filled-star-symbol active"></view>
+					<view v-if="item.is_collect" class="iconfont icon-favourites-filled-star-symbol active"></view>
 					<view v-else class="iconfont icon-Favourites-Add-Large"></view>
 					<view>收藏</view>
 				</view>
 				<view>
-					<view v-if="item.liked" class="iconfont icon-aixin active"></view>
+					<view v-if="item.is_like" class="iconfont icon-aixin active"></view>
 					<view v-else class="iconfont icon-heart1"></view>
 					<view>点赞</view>
 				</view>
 				<view>
-					<view v-if="item.voted" class="iconfont icon-Ticket1 active"></view>
+					<view v-if="item.is_poll" class="iconfont icon-Ticket1 active"></view>
 					<view v-else class="iconfont icon-xiaochengxu-toupiaoicon"></view>
 					<view>投票</view>
 				</view>
@@ -66,7 +66,7 @@
 				const shareInfo = {
 					title: item.name || '科世达(上海)连接器有限公司',
 					path: `/pages/exhibitor/exhibit-detail`,
-					imageUrl: 'https://oss.starify.cn/prod/starify/up/0001018678/20241108/672da70c02212.png?x-oss-process=image/resize,w_400'
+					imageUrl: item.logo || 'https://oss.starify.cn/prod/starify/up/0001018678/20241108/672da70c02212.png?x-oss-process=image/resize,w_400'
 				}
 				this.$emit('share', {
 					detail: shareInfo

+ 98 - 44
pages/exhibitor/index.vue

@@ -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 => {