WxComment 介绍
WxComment
WxComment是一个微信小程序的评论插件,结合BaaS提供商LeanCloud,无需其他另外的个人或者云服务器,就可以免费使用。解决了需要个人去注册域名、备案、购买云服务器的繁杂问题。
特色
友好的UI界面和交互界面
屏幕截图
快速入手
注册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
将LeanCloud自己的AppID和AppKey复制到WxComment.js对应位置;
AV.init({
appId: ‘your leancloud appid’,
appKey: ‘your leancloud appkey’,
});
test.wxml
<view class=WxComment> <WxComment tipOne=Markdown tipTwo=will be supported, Powered by yicm. submitBtnText=回复 articleID={{article_id}} contentLen='1'></WxComment> </view>
WxComment组件属性说明:
tipOne: 颜色显示tip区域文字内容 tipTwo: 无颜色显示tip区域文字内容 submitBtnText:提交按钮文字内容 articleID:文章与WxComment绑定的唯一ID contentLen:评论内容至少为多长限制