|
@@ -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
|
|
|
+ })
|
|
|
+ }
|
|
|
+ })
|
|
|
}
|
|
|
}
|
|
|
}
|