|
@@ -128,8 +128,8 @@ export default {
|
|
|
// 这里存放数据
|
|
// 这里存放数据
|
|
|
return {
|
|
return {
|
|
|
// 点赞-帖子的开关
|
|
// 点赞-帖子的开关
|
|
|
- likeFlagOne: true,
|
|
|
|
|
- unLikeFlagOne: true,
|
|
|
|
|
|
|
+ likeFlagOne: [],
|
|
|
|
|
+ unLikeFlagOne: [],
|
|
|
// 点赞-评论的开关
|
|
// 点赞-评论的开关
|
|
|
likeFlag: [],
|
|
likeFlag: [],
|
|
|
unLikeFlag: [],
|
|
unLikeFlag: [],
|
|
@@ -158,22 +158,22 @@ export default {
|
|
|
methods: {
|
|
methods: {
|
|
|
// 点赞-帖子
|
|
// 点赞-帖子
|
|
|
async clickLikeOne (type, id) {
|
|
async clickLikeOne (type, id) {
|
|
|
- if (this.likeFlagOne) {
|
|
|
|
|
|
|
+ if (!this.likeFlagOne.includes(id)) {
|
|
|
const res = await webBbsLike(type, id)
|
|
const res = await webBbsLike(type, id)
|
|
|
if (res.code === 0) {
|
|
if (res.code === 0) {
|
|
|
this.$message.success('点赞成功.')
|
|
this.$message.success('点赞成功.')
|
|
|
- this.likeFlagOne = false
|
|
|
|
|
|
|
+ this.likeFlagOne.push(id)
|
|
|
this.lookInfo.upVote++
|
|
this.lookInfo.upVote++
|
|
|
} else this.$message.warning(res.msg)
|
|
} else this.$message.warning(res.msg)
|
|
|
} else this.$message.warning('您已经赞过了.')
|
|
} else this.$message.warning('您已经赞过了.')
|
|
|
},
|
|
},
|
|
|
// 点踩-帖子
|
|
// 点踩-帖子
|
|
|
async clickUnlikeOne (type, id) {
|
|
async clickUnlikeOne (type, id) {
|
|
|
- if (this.unLikeFlagOne) {
|
|
|
|
|
|
|
+ if (!this.unLikeFlagOne.includes(id)) {
|
|
|
const res = await webBbsLike(type, id)
|
|
const res = await webBbsLike(type, id)
|
|
|
if (res.code === 0) {
|
|
if (res.code === 0) {
|
|
|
this.$message.success('点踩成功.')
|
|
this.$message.success('点踩成功.')
|
|
|
- this.unLikeFlagOne = false
|
|
|
|
|
|
|
+ this.unLikeFlagOne.push(id)
|
|
|
this.lookInfo.unVote++
|
|
this.lookInfo.unVote++
|
|
|
} else this.$message.warning(res.msg)
|
|
} else this.$message.warning(res.msg)
|
|
|
} else this.$message.warning('您已经踩过了.')
|
|
} else this.$message.warning('您已经踩过了.')
|