Ver código fonte

展商详情

zhaosm 2 dias atrás
pai
commit
9d96d30563

+ 3 - 1
pages/activity/components/activity-item.vue

@@ -49,7 +49,9 @@
 		},
 		methods: {
 			onCollect(item) { // 收藏
-				this.checkAuth('pages/activity/index')
+				if (!this.checkAuth('pages/activity/index')) {
+					return
+				}
 				if (item.is_collect === 1) {
 					meetingCancelCollect({ id: item.id }).then(res => {
 						if (res.code === 0) {

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

@@ -69,7 +69,7 @@
 			onShare(item) {
 				const shareInfo = {
 					title: item.name,
-					path: `/pages/exhibitor/exhibit-detail` + item.id,
+					path: `/pages/exhibitor/exhibit-detail?id=` + item.id,
 					imageUrl: item.pic + '?x-oss-process=image/resize,w_400'
 				}
 				this.$emit('share', {
@@ -80,7 +80,9 @@
 				this.navigateTo('/pages/exhibitor/exhibit-detail?id=' + item.id)
 			},
 			onCollect() { // 收藏
-				this.checkAuth('/pages/exhibitor/exhibit-detail?id=' + this.item.id)
+				if (!this.checkAuth('/pages/exhibitor/exhibit')) {
+					return
+				}
 				exhibitorsProductCollect({ id: this.item.id }).then(res => {
 					if (res.code === 0) {
 						let is_collect = this.item.is_collect === 0 ? 1 : 0
@@ -93,7 +95,9 @@
 				})
 			},
 			onLike() { // 点赞
-				this.checkAuth('/pages/exhibitor/exhibit-detail?id=' + this.item.id)
+				if (!this.checkAuth('/pages/exhibitor/exhibit')) {
+					return
+				}
 				exhibitorsProductLike({ id: this.item.id }).then(res => {
 					if (res.code === 0) {
 						let is_like = this.item.is_like === 0 ? 1 : 0
@@ -106,7 +110,9 @@
 				})
 			},
 			onPoll() { // 投票
-				this.checkAuth('/pages/exhibitor/exhibit-detail?id=' + this.item.id)
+				if (!this.checkAuth('/pages/exhibitor/exhibit')) {
+					return
+				}
 				exhibitorsProductPoll({ id: this.item.id }).then(res => {
 					if (res.code === 0) {
 						let is_poll = this.item.is_poll === 0 ? 1 : 0

+ 11 - 5
pages/exhibitor/components/exhibitor-item.vue

@@ -64,7 +64,9 @@
 		},
 		methods: {
 			onCollect() { // 收藏
-				this.checkAuth('/pages/exhibitor/detail?id=' + this.item.id)
+				if (!this.checkAuth('/pages/exhibitor/index')) {
+					return
+				}
 				exhibitorsCollect({ id: this.item.id }).then(res => {
 					if (res.code === 0) {
 						let is_collect = this.item.is_collect === 0 ? 1 : 0
@@ -77,7 +79,9 @@
 				})
 			},
 			onLike() { // 点赞
-				this.checkAuth('/pages/exhibitor/detail?id=' + this.item.id)
+				if (!this.checkAuth('/pages/exhibitor/index')) {
+					return
+				}
 				exhibitorsLike({ id: this.item.id }).then(res => {
 					if (res.code === 0) {
 						let is_like = this.item.is_like === 0 ? 1 : 0
@@ -90,7 +94,9 @@
 				})
 			},
 			onPoll() { // 投票
-				this.checkAuth('/pages/exhibitor/detail?id=' + this.item.id)
+				if (!this.checkAuth('/pages/exhibitor/index')) {
+					return
+				}
 				exhibitorsPoll({ id: this.item.id }).then(res => {
 					if (res.code === 0) {
 						let is_poll = this.item.is_poll === 0 ? 1 : 0
@@ -105,8 +111,8 @@
 			onShare(item) {
 				const shareInfo = {
 					title: item.name,
-					path: `/pages/exhibitor/exhibit-detail?id=` + item.id,
-					imageUrl: item.logo
+					path: `/pages/exhibitor/detail?id=` + item.id,
+					imageUrl: item.logo + '?x-oss-process=image/resize,w_600,h_600,limit_0,m_pad'
 				}
 				this.$emit('share', {
 					detail: shareInfo

+ 10 - 4
pages/exhibitor/detail.vue

@@ -5,7 +5,7 @@
 			<view class="main-container">
 				<view class="exhibitor-main">
 					<view class="exhibitor-logo">
-						<image src="https://oss.starify.cn/prod/starify/up/0001018678/20241108/672da70c02212.png?x-oss-process=image/resize,w_200" mode="aspectFit" />
+						<image :src="exhibitor.logo + '?x-oss-process=image/resize,w_200'" mode="aspectFit" />
 					</view>
 					<view class="exhibitor-title">
 						<view class="exhibitor-title-1">
@@ -168,7 +168,9 @@
 				this.showShare = true
 			},
 			onCollect() { // 收藏
-				this.checkAuth('/pages/exhibitor/detail?id=' + this.exhibitor.id)
+				if (!this.checkAuth('/pages/exhibitor/detail?id=' + this.exhibitor.id)) {
+					return
+				}
 				exhibitorsCollect({ id: this.exhibitor.id }).then(res => {
 					if (res.code === 0) {
 						this.exhibitor.is_collect = this.exhibitor.is_collect === 0 ? 1 : 0
@@ -176,7 +178,9 @@
 				})
 			},
 			onLike() { // 点赞
-				this.checkAuth('/pages/exhibitor/detail?id=' + this.exhibitor.id)
+				if (!this.checkAuth('/pages/exhibitor/detail?id=' + this.exhibitor.id)) {
+					return
+				}
 				exhibitorsLike({ id: this.exhibitor.id }).then(res => {
 					if (res.code === 0) {
 						this.exhibitor.is_like = this.exhibitor.is_like === 0 ? 1 : 0
@@ -184,7 +188,9 @@
 				})
 			},
 			onPoll() { // 投票
-				this.checkAuth('/pages/exhibitor/detail?id=' + this.exhibitor.id)
+				if (!this.checkAuth('/pages/exhibitor/detail?id=' + this.exhibitor.id)) {
+					return
+				}
 				exhibitorsPoll({ id: this.exhibitor.id }).then(res => {
 					if (res.code === 0) {
 						this.exhibitor.is_poll = this.exhibitor.is_poll === 0 ? 1 : 0

+ 10 - 4
pages/exhibitor/exhibit-detail.vue

@@ -153,7 +153,7 @@
 			onShare() {
 				this.shareInfo = {
 					title: this.exhibit.name,
-					path: `/pages/exhibitor/exhibit-detail` + this.id,
+					path: `/pages/exhibitor/exhibit-detail?id=` + this.id,
 					imageUrl: this.exhibit.pic + '?x-oss-process=image/resize,w_600,h_600,limit_0,m_pad'
 				}
 				this.showShare = true
@@ -167,7 +167,9 @@
 				})
 			},
 			onCollect() { // 收藏
-				this.checkAuth('/pages/exhibitor/exhibit-detail?id=' + this.id)
+				if (!this.checkAuth('/pages/exhibitor/exhibit-detail?id=' + this.id)) {
+					return
+				}
 				exhibitorsProductCollect({ id: this.id }).then(res => {
 					if (res.code === 0) {
 						this.exhibit.is_collect = this.exhibit.is_collect === 0 ? 1 : 0
@@ -175,7 +177,9 @@
 				})
 			},
 			onLike() { // 点赞
-				this.checkAuth('/pages/exhibitor/exhibit-detail?id=' + this.id)
+				if (!this.checkAuth('/pages/exhibitor/exhibit-detail?id=' + this.id)) {
+					return
+				}
 				exhibitorsProductLike({ id: this.id }).then(res => {
 					if (res.code === 0) {
 						this.exhibit.is_like = this.exhibit.is_like === 0 ? 1 : 0
@@ -183,7 +187,9 @@
 				})
 			},
 			onPoll() { // 投票
-				this.checkAuth('/pages/exhibitor/exhibit-detail?id=' + this.id)
+				if (!this.checkAuth('/pages/exhibitor/exhibit-detail?id=' + this.id)) {
+					return
+				}
 				exhibitorsProductPoll({ id: this.id }).then(res => {
 					if (res.code === 0) {
 						this.exhibit.is_poll = this.exhibit.is_poll === 0 ? 1 : 0

+ 41 - 6
pages/index/search.vue

@@ -12,12 +12,12 @@
 					<u-tabs :active.sync="tabActive" :tabs="tabs" tab-style="default" @change="tabChange"/>
 					<view v-if="tabActive === 1" class="search-result-list exhibit-list">
 						<template v-for="(item, index) in exhibitorList">
-							<exhibitor-item :item="item" :key="index" @updateItemValue="updateItemValue()"/>
+							<exhibitor-item :item="item" :key="index" :pollShow="pollShow.exhibitors_poll_show" @share="onShare()" @updateItemValue="updateItemValue()"/>
 						</template>
 					</view>
 					<view v-else-if="tabActive === 2" class="search-result-list exhibit-list">
 						<template v-for="(item, index) in exhibitList">
-							<exhibit-item :item="item" :key="index" @updateItemValue="updateItemValue()"/>
+							<exhibit-item :item="item" :key="index" :pollShow="pollShow.product_poll_show" @share="onShare()" @updateItemValue="updateItemValue()"/>
 						</template>
 					</view>
 					<view v-else-if="tabActive === 3" class="search-result-list exhibit-list">
@@ -39,6 +39,7 @@
 				<disclaimer-text></disclaimer-text>
 			</view>
 		</u-scroll-view>
+		<u-share-action-sheet :show.sync="showShare" :show-info="shareInfo" />
 	</view>
 </template>
 
@@ -46,12 +47,14 @@
 	import NavBar from '@/components/layout/nav-bar'
 	import UTabs from '@/components/common/u-tabs'
 	import UScrollView from '@/components/common/u-scroll-view'
+	import UShareActionSheet from '@/components/common/u-share-action-sheet'
 	import USearch from '@/components/common/u-search'
 	import ExhibitItem from '@/pages/exhibitor/components/exhibit-item.vue'
 	import ExhibitorItem from '@/pages/exhibitor/components/exhibitor-item.vue'
 	import NewsItem from '@/pages/news/components/news-item.vue'
 	import ActivityItem from '@/pages/activity/components/activity-item.vue'
-	import { globalSearch, mettingList, exhibitorsList, exhibitorsProductList, exhibitorsNewsList, exhibitorsBoothActivityList } from '@/api/exhibitor'
+	
+	import { globalSearch, mettingList, exhibitorsList, exhibitorsProductList, exhibitorsNewsList, exhibitorsBoothActivityList, globalPollShow } from '@/api/exhibitor'
 	import DisclaimerText from '@/components/disclaimer-text/index.vue'
 	export default {
 		options: {
@@ -66,7 +69,8 @@
 			ExhibitorItem,
 			NewsItem,
 			ActivityItem,
-			DisclaimerText
+			DisclaimerText,
+			UShareActionSheet
 		},
 		data() {
 			return {
@@ -134,7 +138,13 @@
 					page: 1,
 					page_size: 10,
 					keyword: ''
-				}
+				},
+				pollShow: {
+					exhibitors_poll_show: 0,
+					product_poll_show: 0
+				},
+				showShare: false,
+				shareInfo: null,
 			}
 		},
 		onLoad(options) {
@@ -143,7 +153,9 @@
 			this.searchKeyword = options.query
 			this.onClickSearch()
 		},
-		created() {},
+		created() {
+			this.getGlobalPollShow()
+		},
 		methods: {
 			tabChange() {
 
@@ -328,6 +340,29 @@
 						}
 					})
 				}
+			},
+			getGlobalPollShow() {
+				globalPollShow().then(res => {
+					this.pollShow = res.data
+				})
+			},
+			onShare(e) {
+				this.shareInfo = e.detail
+				this.showShare = true
+			},
+			onShareAppMessage: function (res) {
+				if (res.from === 'button') {
+					if (this.shareInfo) {
+						return this.shareInfo
+					}
+				}
+				this.shareInfo = null
+				this.showShare = false
+				return {
+					title: '慕尼黑上海电子生产设备展',
+					path: '/pages/index/index',
+					imageUrl: 'https://oss.starify.cn/prod/starify/up/0001018678/20241108/672da5a7dd374.png?x-oss-process=image/resize,w_600,h_600,limit_0,m_pad'
+				}
 			}
 		}
 	}