Forráskód Böngészése

Merge remote-tracking branch 'origin/zhaosm' into zhaosm

# Conflicts:
#	pages/activity/index.vue
#	pages/exhibitor/exhibit.vue
#	pages/exhibitor/index.vue
#	pages/news/index.vue
yanj 2 napja
szülő
commit
b2714dd2d6

+ 9 - 1
api/exhibitor.js

@@ -12,13 +12,21 @@ export const exhibitorsProductCollect = post('/api/exhibitors/product/collect')
 export const exhibitorsProductLike = post('/api/exhibitors/product/like')
 export const exhibitorsProductPoll = post('/api/exhibitors/product/poll')
 
-export const exhibitorsNewsList = get('/api/exhibitors/news/list')
+export const exhibitorsNewsList = get('/api/exhibitors/news/list') // 展商新闻
 export const exhibitorsNewsInfo = get('/api/exhibitors/news/info')
 
+export const newsList = get('/api/news/exhibit-list') // 展会新闻
+
 export const exhibitorsBoothActivityList = get('/api/exhibitors/booth-activity/list')
 export const exhibitorsBoothActivityInfo = get('/api/exhibitors/booth-activity/info')
 export const exhibitorsBoothActivityCollect = post('/api/exhibitors/booth-activity/collect')
 
+export const mettingList = get('/api/meeting/get-list') // 同期活动
+export const meetingCollect = post('/api/user/meeting/collect')
+export const meetingCancelCollect = post('/api/user/meeting/cancel-collect')
+export const meetingView = post('/api/user/meeting/view')
+export const mettingDesc = get('/api/global/metting-desc')
+
 export const exhibitorsCountryList = get('/api/exhibitors/country/list')
 export const productCategoryList = get('/api/product-category/list')
 export const applicationAreasList = get('/api/application-areas/list')

+ 6 - 3
package.json

@@ -18,7 +18,8 @@
 					"UNI_PLATFORM": "mp-weixin",
 					"NAME": "dev",
 					"TOKEN_KEY": "token",
-					"BASE_API": "https://mp-test-miniprogapi.matchexpo.cn"
+					"BASE_API": "https://mp-test-onlinecatelogue.matchexpo.cn",
+					"WEBSITE": "https://mp-website-test-munich.matchexpo.cn"
 				},
 				"define": {
 					"MP-CJN": true
@@ -31,7 +32,8 @@
 					"UNI_PLATFORM": "mp-weixin",
 					"NAME": "test",
 					"TOKEN_KEY": "token",
-					"BASE_API": "https://mp-test-miniprogapi.matchexpo.cn"
+					"BASE_API": "https://mp-test-miniprogapi.matchexpo.cn",
+					"WEBSITE": "https://mp-website-test-munich.matchexpo.cn"
 				},
 				"define": {
 					"MP-CJN": true
@@ -44,7 +46,8 @@
 					"UNI_PLATFORM": "mp-weixin",
 					"NAME": "prod",
 					"TOKEN_KEY": "token",
-					"BASE_API": "https://starify-api-dev.matchexpo.cn"
+					"BASE_API": "https://starify-api-dev.matchexpo.cn",
+					"WEBSITE": "https://www.productronicachina.com.cn"
 				},
 				"define": {
 					"MP-CJN": true

+ 38 - 7
pages/activity/components/activity-item.vue

@@ -1,18 +1,18 @@
 <template>
 	<view class="activity-item" hover-class="active" @click="onClickActivity(item)">
 		<view class="activity-title">
-			<view>TGV先进材料及封装产业化机遇高峰论坛</view>
-			<view v-if="!favoritesHidden" class="activity-favourites" :class="{ 'active': index === 1 }">
-				<view v-if="item.favourited" class="iconfont icon-favourites-filled-star-symbol active"></view>
+			<view>{{ item.title }}</view>
+			<view v-if="!favoritesHidden" @click.stop="onCollect(item)" class="activity-favourites" :class="{ 'active': index === 1 }">
+				<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 class="activity-favourites-text">收藏</view>
 			</view>
 		</view>
-		<view class="activity-time">2024年03月20日 | E1馆二楼M16会议室</view>
-		<view class="activity-views">浏览:1080</view>
+		<view class="activity-time">{{ formatDate(item.pub_date) }} | {{ item.address }}</view>
+		<view class="activity-views">浏览:{{ item.view }}</view>
 		<view class="activity-desc">
 			<view>
-				本次论坛将探讨玻璃基芯片板级封装载板在Mini/Micro直显、MIP封装、2.5D/3D封装、射频芯片载板、光通信芯片载板以及其他芯片载板,尤其是半导体先进封装领域的应用。
+				{{ item.description }}
 			</view>
 			<view>
 				<van-button class="activity-detail-link" type="primary">
@@ -26,6 +26,7 @@
 </template>
 
 <script>
+	import { meetingCollect, meetingCancelCollect, meetingView } from '@/api/exhibitor'
 	
 	export default {
 		options: {
@@ -40,13 +41,43 @@
 		},
 		data() {
 			return {
+				websiteUrl: process.env.WEBSITE
 			}
 		},
 		created() {
 		},
 		methods: {
+			onCollect(item) { // 收藏
+				this.checkAuth('pages/activity/index')
+				if (item.is_collect === 1) {
+					meetingCancelCollect({ id: item.id }).then(res => {
+						if (res.code === 0) {
+							item.is_collect = 0
+							this.$emit('updateItemCollect', {
+								id: item.id
+							})
+						}
+					})
+				} else {
+					meetingCollect({ id: item.id }).then(res => {
+						if (res.code === 0) {
+							item.is_collect = 1
+							this.$emit('updateItemCollect', {
+								id: item.id
+							})
+						}
+					})
+				}
+			},
+			formatDate(dateString) {
+			  const date = new Date(dateString);
+			  const year = date.getFullYear();
+			  const month = date.getMonth() + 1; // 月份从 0 开始
+			  const day = date.getDate();
+			  return `${year}年${month}月${day}日`;
+			},
 			onClickActivity(item){
-				this.navigateTo('/pages/activity/detail')
+				this.navigateTo(this.websiteUrl + '/' + item.urla)
 			}
 		}
 	}

+ 45 - 6
pages/activity/index.vue

@@ -5,12 +5,12 @@
 			<view class="main-container">
 				<view class="activity-head">
 					<view class="activity-head-title">同期活动</view>
-					<view class="activity-head-desc">今年慕尼黑上海电子生产设备展将围绕四大行业主题开展共计9场同期论坛,论坛围绕工业机器人、柔性制造、储能与新能源、汽车线束、智能座舱、智能制造、TGV先进材料、封装、胶粘剂、新能源汽车等热门话题展开更多探讨与交流。</view>
+					<view class="activity-head-desc">{{ mettingDesc }}</view>
 				</view>
 				<van-empty v-if="activityList.length === 0" description="暂无数据" />
 				<view v-else class="activity-list">
 					<template v-for="(item, index) in activityList">
-						<activity-item :item="item" :key="index" />
+						<activity-item :item="item" :key="index" @updateItemCollect="updateItemCollect"/>
 					</template>
 				</view>
 				<!-- <disclaimer-text></disclaimer-text> -->
@@ -24,7 +24,8 @@
 	import UScrollView from '@/components/common/u-scroll-view'
 	import ActivityItem from '@/pages/activity/components/activity-item.vue'
 	import DisclaimerText from '@/components/disclaimer-text/index.vue'
-	
+	import { mettingList, mettingDesc } from '@/api/exhibitor'
+
 	export default {
 		options: {
 			styleIsolation: 'shared'
@@ -38,11 +39,49 @@
 		data() {
 			return {
 				activityList: [{ favourited: true }, {}, {}],
+				activityParams: {
+					page: 1,
+					page_size: 10,
+					keyword: '',
+				},
+				activityListLoading: false,
+				activityListLastPage: 1,
+				mettingDesc: ''
 			}
 		},
-		created() {},
+		created() {
+			this.getMettingDesc()
+			this.getList()
+		},
 		methods: {
-			
+			getList() {
+				this.activityListLoading = true
+				mettingList(this.activityParams).then(res => {
+					if (res.data.data) {
+						if (this.activityParams.page > 1) {
+							this.activityList = [...this.activityList, ...res.data.data]
+						} else {
+							this.activityList = res.data.data
+							this.activityListLastPage = res.data.last_page
+						}
+					} else {
+						this.showToast('系统繁忙,稍候再试')
+					}
+					this.activityListLoading = false
+				})
+			},
+			updateItemCollect(e) {
+				this.activityList.forEach((item) => {
+					if (item.id === e.id) {
+						item.is_collect = item.is_collect === 1 ? 0 : 1
+					}
+				})
+			},
+			getMettingDesc() {
+				mettingDesc().then(res => {
+					this.mettingDesc = res.data
+				})
+			}
 		}
 	}
 </script>
@@ -71,4 +110,4 @@
 		margin-top: 40rpx;
 		color: #333333;
 	}
-</style>
+</style>

+ 43 - 4
pages/exhibitor/components/exhibit-item.vue

@@ -25,17 +25,17 @@
 						</view>
 					</button>
 				</view>
-				<view>
+				<view @click.stop="onCollect()">
 					<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 @click.stop="onLike()">
 					<view v-if="item.is_like" class="iconfont icon-aixin active"></view>
 					<view v-else class="iconfont icon-heart1"></view>
 					<view>点赞</view>
 				</view>
-				<view v-if="pollShow">
+				<view v-if="pollShow" @click.stop="onPoll()">
 					<view v-if="item.is_poll" class="iconfont icon-Ticket1 active"></view>
 					<view v-else class="iconfont icon-xiaochengxu-toupiaoicon"></view>
 					<view>投票</view>
@@ -46,7 +46,7 @@
 </template>
 
 <script>
-	
+	import { exhibitorsProductCollect, exhibitorsProductLike, exhibitorsProductPoll } from '@/api/exhibitor'
 	export default {
 		options: {
 			styleIsolation: 'shared'
@@ -78,6 +78,45 @@
 			},
 			onClickExhibit(item) {
 				this.navigateTo('/pages/exhibitor/exhibit-detail?id=' + item.id)
+			},
+			onCollect() { // 收藏
+				this.checkAuth('/pages/exhibitor/exhibit-detail?id=' + this.item.id)
+				exhibitorsProductCollect({ id: this.item.id }).then(res => {
+					if (res.code === 0) {
+						let is_collect = this.item.is_collect === 0 ? 1 : 0
+						this.$emit('updateItemValue', {
+							id: this.item.id,
+							key: 'is_collect',
+							value: is_collect
+						})
+					}
+				})
+			},
+			onLike() { // 点赞
+				this.checkAuth('/pages/exhibitor/exhibit-detail?id=' + this.item.id)
+				exhibitorsProductLike({ id: this.item.id }).then(res => {
+					if (res.code === 0) {
+						let is_like = this.item.is_like === 0 ? 1 : 0
+						this.$emit('updateItemValue', {
+							id: this.item.id,
+							key: 'is_like',
+							value: is_like
+						})
+					}
+				})
+			},
+			onPoll() { // 投票
+				this.checkAuth('/pages/exhibitor/exhibit-detail?id=' + this.item.id)
+				exhibitorsProductPoll({ id: this.item.id }).then(res => {
+					if (res.code === 0) {
+						let is_poll = this.item.is_poll === 0 ? 1 : 0
+						this.$emit('updateItemValue', {
+							id: this.item.id,
+							key: 'is_poll',
+							value: is_poll
+						})
+					}
+				})
 			}
 		}
 	}

+ 43 - 4
pages/exhibitor/components/exhibitor-item.vue

@@ -22,17 +22,17 @@
 						</view>
 					</button>
 				</view>
-				<view>
+				<view @click.stop="onCollect()">
 					<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 @click.stop="onLike()">
 					<view v-if="item.is_like" class="iconfont icon-aixin active"></view>
 					<view v-else class="iconfont icon-heart1"></view>
 					<view>点赞</view>
 				</view>
-				<view v-if="pollShow">
+				<view v-if="pollShow" @click.stop="onPoll()">
 					<view v-if="item.is_poll" class="iconfont icon-Ticket1 active"></view>
 					<view v-else class="iconfont icon-xiaochengxu-toupiaoicon"></view>
 					<view>投票</view>
@@ -43,7 +43,7 @@
 </template>
 
 <script>
-	
+	import { exhibitorsCollect, exhibitorsLike, exhibitorsPoll } from '@/api/exhibitor'
 	export default {
 		options: {
 			styleIsolation: 'shared'
@@ -63,6 +63,45 @@
 		created() {
 		},
 		methods: {
+			onCollect() { // 收藏
+				this.checkAuth('/pages/exhibitor/detail?id=' + this.item.id)
+				exhibitorsCollect({ id: this.item.id }).then(res => {
+					if (res.code === 0) {
+						let is_collect = this.item.is_collect === 0 ? 1 : 0
+						this.$emit('updateItemValue', {
+							id: this.item.id,
+							key: 'is_collect',
+							value: is_collect
+						})
+					}
+				})
+			},
+			onLike() { // 点赞
+				this.checkAuth('/pages/exhibitor/detail?id=' + this.item.id)
+				exhibitorsLike({ id: this.item.id }).then(res => {
+					if (res.code === 0) {
+						let is_like = this.item.is_like === 0 ? 1 : 0
+						this.$emit('updateItemValue', {
+							id: this.item.id,
+							key: 'is_like',
+							value: is_like
+						})
+					}
+				})
+			},
+			onPoll() { // 投票
+				this.checkAuth('/pages/exhibitor/detail?id=' + this.item.id)
+				exhibitorsPoll({ id: this.item.id }).then(res => {
+					if (res.code === 0) {
+						let is_poll = this.item.is_poll === 0 ? 1 : 0
+						this.$emit('updateItemValue', {
+							id: this.item.id,
+							key: 'is_poll',
+							value: is_poll
+						})
+					}
+				})
+			},
 			onShare(item) {
 				const shareInfo = {
 					title: item.name,

+ 18 - 1
pages/exhibitor/exhibit.vue

@@ -65,7 +65,6 @@
 				searchApplicationAreas: '',
 				scrollviewHeight: 0,
 				searchKeyword: '',
-				exhibitList: [],
 				exhibitParams: {
 					page: 1,
 					page_size: 10,
@@ -73,6 +72,7 @@
 					product_cate_id: '',
 					application_areas_id: ''
 				},
+				exhibitList: [],
 				exhibitListLoading: false,
 				exhibitListLastPage: 1,
 				shareInfo: null,
@@ -154,6 +154,10 @@
 				if (this.exhibitListLastPage === this.exhibitParams.page) {
 					return
 				}
+				if (this.exhibitListLoading === true) {
+					return
+				}
+				this.exhibitListLoading = true
 				this.exhibitParams.page = this.exhibitParams.page+1
 				this.getList()
 			},
@@ -187,6 +191,18 @@
 			},
 			onSearch() {
 				this.navigateTo('/pages/index/search?query=' + this.searchKeyword)
+			},
+			getGlobalPollShow() {
+				globalPollShow().then(res => {
+					this.pollShow = res.data
+				})
+			},
+			updateItemValue(e) {
+				this.exhibitList.forEach((item) => {
+					if (item.id === e.id) {
+						item[e.key] = e.value
+					}
+				})
 			}
 		}
 	}
@@ -194,3 +210,4 @@
 
 <style lang="scss">
 </style>
+

+ 14 - 3
pages/exhibitor/index.vue

@@ -24,8 +24,7 @@
 				<van-empty v-if="exhibitorList.length === 0" description="暂无数据" />
 				<view v-else class="exhibitor-list">
 					<template v-for="(item, index) in exhibitorList">
-						<exhibitor-item :item="item" :key="index" :pollShow="pollShow.exhibitors_poll_show" @share="(e) => $emit('share', e)" />
-					</template>
+            <exhibitor-item :item="item" :key="index" :pollShow="pollShow.exhibitors_poll_show" @share="(e) => $emit('share', e)" @updateItemValue="updateItemValue()" />					</template>
 				</view>
 				<disclaimer-text></disclaimer-text>
 			</view>
@@ -52,7 +51,7 @@
 			UScrollView,
 			UDropdownSelect,
 			ExhibitorItem,
-			DisclaimerText
+      DisclaimerText
 		},
 		data() {
 			return {
@@ -164,6 +163,10 @@
 				if (this.exhibitorListLastPage === this.exhibitorsParams.page) {
 					return
 				}
+				if (this.exhibitorListLoading === true) {
+					return
+				}
+				this.exhibitorListLoading = true
 				this.exhibitorsParams.page = this.exhibitorsParams.page+1
 				this.getExhibitorsList()
 			},
@@ -181,6 +184,13 @@
 				globalPollShow().then(res => {
 					this.pollShow = res.data
 				})
+			},
+			updateItemValue(e) {
+				this.exhibitorList.forEach((item) => {
+					if (item.id === e.id) {
+						item[e.key] = e.value
+					}
+				})
 			}
 		}
 	}
@@ -188,3 +198,4 @@
 
 <style lang="scss">
 </style>
+

+ 4 - 3
pages/news/components/news-item.vue

@@ -1,9 +1,9 @@
 <template>
 	<view class="news-item" @click="onClickDetail(item)">
 		<view class="news-title">{{ item.title }}</view>
-		<view class="news-time">{{ formatDate(item.publish_time) }}</view>
+		<view class="news-time">{{ formatDate(item.publish_time || item.pub_date) }}</view>
 		<view class="news-summary">
-			<view class="text">{{ item.content }}</view>
+			<view class="text">{{ item.content || item.description }}</view>
 			<view class="to-detail"><view>了解详情</view> <view class="arrow iconfont icon-right-s"></view></view>
 		</view>
 	</view>
@@ -20,6 +20,7 @@
 		},
 		data() {
 			return {
+				websiteUrl: process.env.WEBSITE
 			}
 		},
 		created() {
@@ -36,7 +37,7 @@
 				if (this.type === 'exhibitor')  {
 					this.navigateTo(link('/' + item.urla))
 				} else {
-					this.navigateTo('https://www.productronicachina.com.cn/2025%E6%85%95%E5%B0%BC%E9%BB%91%E4%B8%8A%E6%B5%B7%E7%94%B5%E5%AD%90%E7%94%9F%E4%BA%A7%E8%AE%BE%E5%A4%87%E5%B1%953%E6%9C%88%E5%A5%8F%E5%93%8D%E6%96%B0%E7%AF%87%E7%AB%A0-%E6%8E%A2%E7%B4%A2%E7%94%B5%E5%AD%90%E5%88%B6%E9%80%A0%E7%9A%84%E6%97%A0%E9%99%90%E5%8F%AF%E8%83%BD')
+					this.navigateTo(this.websiteUrl + '/' + item.urla)
 				}
 			}
 		}

+ 72 - 9
pages/news/index.vue

@@ -1,14 +1,14 @@
 <template>
 	<view class="news-index">
 		<nav-bar title="新闻" @init="onInitNavbar"></nav-bar>
-		<u-scroll-view :tabbar-conflict="false">
+		<u-scroll-view :tabbar-conflict="false" @scroll-near-lower="onScrollToLower">
 			<view class="main-container">
 				<u-tabs :active.sync="tabActive" :tabs="tabs" tab-style="default" @change="tabChange"/>
 				<van-empty v-if="newsList.length === 0" description="暂无数据" />
-				<view v-else class="news-list">	
+				<view v-else class="news-list">
 					<template v-for="(item, index) in newsList">
 						<news-item :item="item" :key="index" />
-					</template>	
+					</template>
 				</view>
 				<disclaimer-text></disclaimer-text>
 			</view>
@@ -21,8 +21,9 @@
 	import UTabs from '@/components/common/u-tabs'
 	import UScrollView from '@/components/common/u-scroll-view'
 	import NewsItem from '@/pages/news/components/news-item.vue'
+	import { exhibitorsNewsList, newsList } from '@/api/exhibitor'
 	import DisclaimerText from '@/components/disclaimer-text/index.vue'
-	
+
 	export default {
 		options: {
 			styleIsolation: 'shared'
@@ -44,18 +45,80 @@
 					label: '展商新闻',
 					value: 'exhibitor'
 				}],
-				newsList: [{}, {}, {}, {}, {}, {}]
+				newsList: [],
+				newsParams: {
+					page: 1,
+					page_size: 10,
+					keyword: '',
+				},
+				newsListLoading: false,
+				newsListLastPage: 1,
 			}
 		},
 		onLoad(options) {
 			if (options.type) {
 				this.tabActive = options.type
 			}
+			this.getList()
+		},
+		created() {
 		},
-		created() {},
 		methods: {
-			tabChange() {
-				
+			getList() {
+				if (this.tabActive === 'exhibitor') {
+					this.getExhibitorsNewsList()
+				}
+				if (this.tabActive === 'exhibition') {
+					this.getNewsList()
+				}
+			},
+			getNewsList() {
+				this.newsListLoading = true
+				newsList(this.newsParams).then(res => {
+					if (res.data.data) {
+						if (this.newsParams.page > 1) {
+							this.newsList = [...this.newsList, ...res.data.data]
+						} else {
+							this.newsList = res.data.data
+							this.newsListLastPage = res.data.last_page
+						}
+					} else {
+						this.showToast('系统繁忙,稍候再试')
+					}
+					this.newsListLoading = false
+				})
+			},
+			getExhibitorsNewsList() {
+				this.newsListLoading = true
+				exhibitorsNewsList(this.newsParams).then(res => {
+					if (res.data.data) {
+						if (this.newsParams.page > 1) {
+							this.newsList = [...this.newsList, ...res.data.data]
+						} else {
+							this.newsList = res.data.data
+							this.newsListLastPage = res.data.last_page
+						}
+					} else {
+						this.showToast('系统繁忙,稍候再试')
+					}
+					this.newsListLoading = false
+				})
+			},
+			onScrollToLower(e) {
+				if (this.newsListLastPage === this.newsParams.page) {
+					return
+				}
+				if (this.newsListLoading === true) {
+					return
+				}
+				this.newsListLoading = true
+				this.newsParams.page = this.newsParams.page+1
+				this.getList()
+			},
+			tabChange(e) {
+				this.tabActive = e.detail.value
+				this.newsParams.page = 1
+				this.getList()
 			}
 		}
 	}
@@ -68,4 +131,4 @@
 		grid-row-gap: 18rpx;
 		margin-top: 28rpx;
 	}
-</style>
+</style>