|
@@ -42,7 +42,7 @@
|
|
|
<view class="exhibitor-operation">
|
|
|
<view class="exhibitor-views">浏览:{{ exhibitor.pv }}</view>
|
|
|
<view class="exhibitor-action">
|
|
|
- <view>
|
|
|
+ <view v-if="pollShow.exhibitors_poll_show">
|
|
|
<view class="iconfont icon-xiaochengxu-renqiicon"></view>
|
|
|
<view>人气:{{ exhibitor.poll_count }}</view>
|
|
|
</view>
|
|
@@ -54,17 +54,17 @@
|
|
|
</view>
|
|
|
</button>
|
|
|
</view>
|
|
|
- <view>
|
|
|
+ <view @click="onCollect()">
|
|
|
<view v-if="exhibitor.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="onLike()">
|
|
|
<view v-if="exhibitor.is_like" class="iconfont icon-aixin active"></view>
|
|
|
<view v-else class="iconfont icon-heart1"></view>
|
|
|
<view>点赞</view>
|
|
|
</view>
|
|
|
- <view>
|
|
|
+ <view v-if="pollShow.exhibitors_poll_show" @click="onPoll()">
|
|
|
<view v-if="exhibitor.is_poll" class="iconfont icon-Ticket1 active"></view>
|
|
|
<view v-else class="iconfont icon-xiaochengxu-toupiaoicon"></view>
|
|
|
<view>投票</view>
|
|
@@ -95,7 +95,7 @@
|
|
|
import ExhibitRecommend from '@/pages/exhibitor/components/exhibit-recommend.vue'
|
|
|
import NewsRecommend from '@/pages/news/components/news-recommend.vue'
|
|
|
import ActivityRecommend from '@/pages/activity/components/activity-recommend.vue'
|
|
|
- import { exhibitorsInfo } from '@/api/exhibitor'
|
|
|
+ import { exhibitorsInfo, exhibitorsCollect, exhibitorsLike, exhibitorsPoll, globalPollShow } from '@/api/exhibitor'
|
|
|
|
|
|
export default {
|
|
|
options: {
|
|
@@ -132,11 +132,16 @@
|
|
|
pv: 0,
|
|
|
poll_count: 0
|
|
|
},
|
|
|
- exhibitorId: 0
|
|
|
+ exhibitorId: 0,
|
|
|
+ pollShow: {
|
|
|
+ exhibitors_poll_show: 0,
|
|
|
+ product_poll_show: 0
|
|
|
+ }
|
|
|
}
|
|
|
},
|
|
|
created() {
|
|
|
this.loadFontFace('Poppins')
|
|
|
+ this.getGlobalPollShow()
|
|
|
},
|
|
|
methods: {
|
|
|
getExhibitorsInfo() {
|
|
@@ -153,13 +158,48 @@
|
|
|
imageUrl: this.exhibitor.logo + '?x-oss-process=image/resize,w_600,h_600,limit_0,m_pad'
|
|
|
}
|
|
|
},
|
|
|
- onShare(item) {
|
|
|
+ onShare() {
|
|
|
this.shareInfo = {
|
|
|
title: this.exhibitor.name_zh_cn,
|
|
|
path: `/pages/exhibitor/detail?id=` + this.exhibitor.id,
|
|
|
imageUrl: this.exhibitor.logo + '?x-oss-process=image/resize,w_600,h_600,limit_0,m_pad'
|
|
|
}
|
|
|
this.showShare = true
|
|
|
+ },
|
|
|
+ onCollect() { // 收藏
|
|
|
+ this.checkAuth('/pages/exhibitor/detail?id=' + this.exhibitor.id)
|
|
|
+ exhibitorsCollect({ id: this.exhibitor.id }).then(res => {
|
|
|
+ if (res.code === 0) {
|
|
|
+ this.exhibitor.is_collect = this.exhibitor.is_collect === 0 ? 1 : 0
|
|
|
+ }
|
|
|
+ })
|
|
|
+ },
|
|
|
+ onLike() { // 点赞
|
|
|
+ this.checkAuth('/pages/exhibitor/detail?id=' + this.exhibitor.id)
|
|
|
+ exhibitorsLike({ id: this.exhibitor.id }).then(res => {
|
|
|
+ if (res.code === 0) {
|
|
|
+ this.exhibitor.is_like = this.exhibitor.is_like === 0 ? 1 : 0
|
|
|
+ }
|
|
|
+ })
|
|
|
+ },
|
|
|
+ onPoll() { // 投票
|
|
|
+ this.checkAuth('/pages/exhibitor/detail?id=' + this.exhibitor.id)
|
|
|
+ exhibitorsPoll({ id: this.exhibitor.id }).then(res => {
|
|
|
+ if (res.code === 0) {
|
|
|
+ this.exhibitor.is_poll = this.exhibitor.is_poll === 0 ? 1 : 0
|
|
|
+ if (this.exhibitor.is_poll === 1) {
|
|
|
+ this.exhibitor.poll_count = this.exhibitor.poll_count + 1
|
|
|
+ } else {
|
|
|
+ this.exhibitor.poll_count = this.exhibitor.poll_count - 1
|
|
|
+ this.exhibitor.poll_count = this.exhibitor.poll_count < 0 ? 0 : this.exhibitor.poll_count
|
|
|
+ }
|
|
|
+ }
|
|
|
+ })
|
|
|
+ },
|
|
|
+ getGlobalPollShow() {
|
|
|
+ globalPollShow().then(res => {
|
|
|
+ this.pollShow = res.data
|
|
|
+ })
|
|
|
}
|
|
|
}
|
|
|
}
|