微信小程序开发 Note-10
保存留言功能
1  | // Service  | 
1  | // Controller  | 
1  | // JS  | 
1  | // JS  | 
留言列表(分页) & 联调
1  | // Service  | 
1  | <select id="queryComments" resultMap="BaseResultMap" parameterType="String">  | 
1  | // Controller  | 
1  | // JS  | 
1  | // JS  | 
评论回复(SQL设计与查询)
对于回复评论的评论,需要在数据库comments表中添加多一个新的字段father_comment_id,以表示评论之间的关系,评论的关系则使用新的字段to_user_id;
并且修改XML中的SQL查询;
1  | <select id="queryComments" resultMap="BaseResultMap" parameterType="String">  | 
评论回复功能
修改部分JS;
1  | // 发表留言  | 
修改Controller;
1  | (value = "SAVE COMMENT", notes = "SAVE COMMENT API")  | 
回复评论的评论绑定JS;
1  | // 回复评论的评论事件  |