基于云开发的小程序评论功能实现

对于文章评论,新建数据库集合来保存评论内容及相关书籍,有以下数据库字段:

 var args={
      cNickName: that.data.userInfo.nickName,
      cAvatarUrl: that.data.userInfo.avatarUrl,
      cOpenId: app.globalData.openid,
      createDate: util.formatTime(new Date()),
      comment: comment,
      flag: true,
      title:that.data.title
    }

评论框实现,本次UI组件选用ColorUI组件:


<!-- 底部功能 -->
<view class="padding-0 bg-white" id='comment'>
 <form bindsubmit="formSubmit" >
    <view class="flex ">
       <view class="flex-treble bg-white padding-0 margin-xs radius">  
          <textarea maxlength="-1" placeholder="抢沙发..." auto-height fixed="true" name='comment'></textarea>         
       </view>
       <view 
评论 5
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值