Commit 736a59cb authored by liwei's avatar liwei

修改了动态点赞bug

parent 792b0dce
......@@ -22,7 +22,7 @@ export function publishArticle(data) {
// 动态点赞
export function like(data) {
return request({
url: '/app/opmArticle/like?articleId='+data.id+'&praiseType='+data.praiseType,
url: '/app/opmArticle/like?articleId='+data.articleId+'&praiseType='+data.praiseType,
data: {},
method: 'POST',
})
......@@ -31,7 +31,7 @@ export function like(data) {
// 评论点赞
export function likeComment(data) {
return request({
url: '/app/opmArticle/likeComment?articleId='+data.id+'&praiseType='+data.praiseType,
url: '/app/opmArticle/likeComment?commentId=' + data.commentId +'&praiseType='+data.praiseType,
data: {},
method: 'POST',
})
......
......@@ -90,9 +90,11 @@
console.log('this.tabIndex:',this.tabIndex)
if (newVal === this.tabIndex) {
if (newVal === 0){
//关注
this.articleType = '0'
}
if (newVal === 2){
//话题
this.getTopicList()
}
// 懒加载,当滑动到当前的item时,才去加载
......@@ -267,7 +269,7 @@
item.likeCount += 1
}
const params = {
id: item.businessId,
articleId: item.businessId,
praiseType: type
}
like(params).then( res => {
......
......@@ -64,7 +64,7 @@
<!-- {{ children.replyCount }}-->
</view>
<view class="action-item">
<image @click="()=>praise(children)" :src="children.isLike == '0'? baseUrl+'/article/105.png': baseUrl+'/article/105-no.png'"></image>
<image @click="()=>praise(children)" :src="children.isLike == '0' ? baseUrl+'/article/105.png': baseUrl+'/article/105-no.png'"></image>
{{ children.likeCount }}
</view>
</view>
......@@ -157,7 +157,7 @@ export default{
},
// 点赞
praise(item) {
console.log('1111111',item)
console.log('item', item)
var type = ''
if (item.isLike == '1') {
//取消点赞
......@@ -167,7 +167,7 @@ export default{
type = 'praise'
}
const params = {
id: item.businessId,
commentId: item.businessId,
praiseType: type
}
likeComment(params).then(res=>{
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment