对于文章评论,新建数据库集合来保存评论内容及相关书籍,有以下数据库字段:
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