🏷️WxComment是一个微信小程序(Mini Program of WeChat)的评论插件,结合BaaS提供商https://leancloud.cn ,无需其他另外的个人或者云服务器,就可以免费使用。解决了需要个人去注册域名、备案、购买云服务器的繁杂问题。适用于个人博客或者个人小程序需要评论、点赞、阅读量统计的用户。📑 有问题可以加微信号XEthanm讨论
WxComment
https://github.com/yicm/WxComment是一个微信小程序的评论插件,结合BaaS提供商LeanCloud,无需其他另外的个人或者云服务器,就可以免费使用。解决了需要个人去注册域名、备案、购买云服务器的繁杂问题。
小白AI
)小白AI
)下图为WxComment
嵌入式到具体博客中显示的效果。
注册LeanCloud账号,并创建过LeanCloud应用;
登陆LeanCloud账号,打开链接https://leancloud.cn/docs/weapp-domains.html,将显示域名配置到你的微信小程序服务器配置中;
设置小程序的 AppID 与 AppSecret
3.1 登录 微信公众平台,在设置
> 开发设置
中获得 AppID 与 AppSecret
3.2 前往 LeanCloud 控制台
> 组件
> 社交
,保存「微信小程序」的 AppID 与 AppSecret
克隆项目WxComment并将其放入小程序根目录
$ git clone https://github.com/yicm/WxComment.git
AV.init({
appId: 'your leancloud appid',
appKey: 'your leancloud appkey',
});
test.wxml
<view class="WxComment">
<WxComment tipOne="WxComment " tipTwo="Powered by https://github.com/yicm" submitBtnText="回复" articleID="{{your_article_id}}" contentLen='1' theme="light"></WxComment>
</view>
test.json
"usingComponents": {
"WxComment": "/component/WxComment/WxComment"
}
配置Admin删除其他用户评论
存储
->数据
->创建Class
->创建Admin
Class:WxComment组件属性说明:
tipOne: 颜色显示tip区域文字内容
tipTwo: 无颜色显示tip区域文字内容
submitBtnText:提交按钮文字内容,默认为“回复”
textMaxLength: 评论最大文字长度限制,默认300
articleID:文章或页面与WxComment绑定的唯一ID
articleTitle: 文章或页面标题,默认值为空
articleURL: 文章或页面的访问链接,默认值为空
contentLen:评论内容至少为多长限制,默认为1
theme: 评论组件样式,支持light/dark两种样式,默认值为light
小程序小白AI
博客引用WxComment组件示例,评论消息订阅可见我的
->消息
: