We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
只需要在post.js 增加以下方法就可以了
//点赞功能 Likes: function () { var that = this; var urlLikeList = app.globalData.url + '/api/content/posts/'+that.data.postId+'/likes'; var token = app.globalData.token; var params = { }; //@todo 网络请求API数据 request.requestPostApi(urlLikeList, token, params, this, this.successSendLike, this.failSendLike); }, // 点赞成功回调 successSendLike: function (res, selfObj) { var that = this; wx.showToast({ title: '感谢你的点赞!', icon: 'none', duration: 2000 }); // 设置点赞数+1 var likes = Number(parseInt(that.data.postLikes) + 1); console.log(likes); that.setData({ postLikes: likes }) }, //点赞失败回调 failSendLike: function (res, selfObj) { wx.showToast({ title: '点赞失败,请联系作者!', icon: 'none', duration: 2000 }) },
小程序名称:IT技术分享社区 IT技术分享社区
The text was updated successfully, but these errors were encountered:
感谢贡献代码~
Sorry, something went wrong.
No branches or pull requests
只需要在post.js 增加以下方法就可以了
小程序名称:IT技术分享社区
![gh_32334eb097cd_430](https://camo.githubusercontent.com/f2975c1574782e7ea6bda1ac0caecb0d78a31ef93c9dd2a5eb7ea316c6815f08/68747470733a2f2f70726f6772616d6d6572626c6f672e78797a2f75706c6f61642f323032302f30362f2545352542302538462545372541382538422545352542412538466c6f676f2d32376463353133366537613634666565623639336334393631633835653164612d7468756d626e61696c2e6a7067)
IT技术分享社区
The text was updated successfully, but these errors were encountered: