Commit 736a59cb authored by liwei's avatar liwei

修改了动态点赞bug

parent 792b0dce
...@@ -22,7 +22,7 @@ export function publishArticle(data) { ...@@ -22,7 +22,7 @@ export function publishArticle(data) {
// 动态点赞 // 动态点赞
export function like(data) { export function like(data) {
return request({ return request({
url: '/app/opmArticle/like?articleId='+data.id+'&praiseType='+data.praiseType, url: '/app/opmArticle/like?articleId='+data.articleId+'&praiseType='+data.praiseType,
data: {}, data: {},
method: 'POST', method: 'POST',
}) })
...@@ -31,7 +31,7 @@ export function like(data) { ...@@ -31,7 +31,7 @@ export function like(data) {
// 评论点赞 // 评论点赞
export function likeComment(data) { export function likeComment(data) {
return request({ return request({
url: '/app/opmArticle/likeComment?articleId='+data.id+'&praiseType='+data.praiseType, url: '/app/opmArticle/likeComment?commentId=' + data.commentId +'&praiseType='+data.praiseType,
data: {}, data: {},
method: 'POST', method: 'POST',
}) })
......
...@@ -90,9 +90,11 @@ ...@@ -90,9 +90,11 @@
console.log('this.tabIndex:',this.tabIndex) console.log('this.tabIndex:',this.tabIndex)
if (newVal === this.tabIndex) { if (newVal === this.tabIndex) {
if (newVal === 0){ if (newVal === 0){
//关注
this.articleType = '0' this.articleType = '0'
} }
if (newVal === 2){ if (newVal === 2){
//话题
this.getTopicList() this.getTopicList()
} }
// 懒加载,当滑动到当前的item时,才去加载 // 懒加载,当滑动到当前的item时,才去加载
...@@ -267,7 +269,7 @@ ...@@ -267,7 +269,7 @@
item.likeCount += 1 item.likeCount += 1
} }
const params = { const params = {
id: item.businessId, articleId: item.businessId,
praiseType: type praiseType: type
} }
like(params).then( res => { like(params).then( res => {
......
...@@ -64,7 +64,7 @@ ...@@ -64,7 +64,7 @@
<!-- {{ children.replyCount }}--> <!-- {{ children.replyCount }}-->
</view> </view>
<view class="action-item"> <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 }} {{ children.likeCount }}
</view> </view>
</view> </view>
...@@ -157,7 +157,7 @@ export default{ ...@@ -157,7 +157,7 @@ export default{
}, },
// 点赞 // 点赞
praise(item) { praise(item) {
console.log('1111111',item) console.log('item', item)
var type = '' var type = ''
if (item.isLike == '1') { if (item.isLike == '1') {
//取消点赞 //取消点赞
...@@ -167,7 +167,7 @@ export default{ ...@@ -167,7 +167,7 @@ export default{
type = 'praise' type = 'praise'
} }
const params = { const params = {
id: item.businessId, commentId: item.businessId,
praiseType: type praiseType: type
} }
likeComment(params).then(res=>{ 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