微信小程序--仿朋友圈Pro(内容发布、点赞、评论、回复评论)
2021-01-05 23:26
971 查看
微信小程序--仿微信小程序朋友圈Pro(内容发布、点赞、评论、回复评论)
项目开源地址M朋友圈Pro 求个Star
项目背景
基于原来的开源项目 微信小程序仿朋友圈功能开发(发布、点赞、评论等功能)的基础上,终于推陈出新了。
有一说一,这次界面好看多了。至于推陈出新的原因很简单🧐,接了个定制的项目,做完之后就把项目前端开源了。后续会延续原项目基础,保持前端和云开发代码的开源。
项目分析
这次项目完全
1:1高仿微信小程序朋友圈,但是额外加了个发帖权限校验(可以去掉),项目小程序端的整体思想如下所示。
数据库设计
1.发帖记录表m_circle_list
2.评论记录表m_comment_list
3.点赞记录表m_thumb_list
4.统一身份校验表uims
项目效果预览
项目关键问题
-
如何即时刷新点赞和评论页面(即如何给对象数组中的元素赋值)
ilike(e) { let cid = e.currentTarget.dataset.idx; let index = e.currentTarget.dataset.index; let nickname = app.globalData.userInfo.nickName; let thumblist = `list[${index}].thumbPOList`; let likelist = `list[${index}].thumblist`; Router.UpThumbInfo(cid).then(res => { this.setData({ [likelist]: this.data.list[index].thumblist + nickname, }) }) }
-
如何简短的表示分页查询条件规则
wx.request({ url: Config.SevDomain+'circlepart', method:'GET', data:{ page:parseInt(skipstep/3) + parseInt(skipstep%3) }, success:res=>{ } })
-
如何联查数据库中的三张表并封装返回数据
封装返回数据
public class CirclePartDto { private CirclePO circlePO; private List<CommentPO> commentPOList; private List<String> thumbPOList; public CirclePO getCirclePO() { return circlePO; } public void setCirclePO(CirclePO circlePO) { this.circlePO = circlePO; } public List<CommentPO> getCommentPOList() { return commentPOList; } public void setCommentPOList(List<CommentPO> commentPOList) { this.commentPOList = commentPOList; } public List<String> getThumbPOList() { return thumbPOList; } public void setThumbPOList(List<String> thumbPOList) { this.thumbPOList = thumbPOList; } }
事务多表联查
JPA
核心@Transactional
注解@RestController public class CirclePartService { @Autowired CircleDao circleDao; @Autowired CommentDao commentDao; @Autowired ThumbDao thumbDao; @Transactional @RequestMapping(value = "/circlepart") public List ad8 <CirclePartDto> GetCircleByLimit(@RequestParam("page") Integer page){ Pageable pageable = PageRequest.of(page,3, Sort.by(Sort.Direction.DESC,"createtime")); List<CirclePartDto> circlePartDtoList = new ArrayList<>(); // stream 转化为 list List<CirclePO> circlePOList = circleDao.findAll(pageable).get().collect(Collectors.toList()); // 查询 for (int i=0;i<circlePOList.size();i++){ CirclePO circlePO = circlePOList.get(i); Integer id = circlePO.getId(); CirclePartDto circlePartDto = new CirclePartDto(); circlePartDto.setCirclePO(circlePO); List<CommentPO> commentPOList = commentDao.findByCircleidOrderByCreatetime(id); List<ThumbPO> thumbPOList = thumbDao.findByCircleid(id); List<String> nicknameList = new ArrayList<>(); for(int j=0;j<thumbPOList.size();j++){ nicknameList.add(thumbPOList.get(j).getNickname()); } circlePartDto.setThumbPOList(nicknameList); circlePartDto.setCommentPOList(commentPOList); circlePartDtoList.add(circlePartDto); } return circlePartDtoList; } }
-
组件和页面之间的通信问题
源码地址
开源不易,求个Star
https://gitee.com/Kindear/CloudUI
参考文档
ThorUI样式组件库 - KeyBoard
ColorUI样式组件库 - Card Nav
相关文章推荐
- PHP仿qq空间或朋友圈发布动态、评论动态、回复评论、删除动态或评论的功能(上)
- php模仿qq空间或朋友圈发布动态、评论动态、回复评论、删除动态或评论的功能(中)
- Android 仿微信回复评论点赞效果
- 【微信小程序】:评论、回复和删除功能 -- 2017/7/14
- 微信小程序仿朋友圈,实现点赞和评论功能
- Android 仿微信回复评论点赞效果
- iOS 朋友圈点赞评论,发布朋友圈,想要的都有
- iOS - 关于微信朋友圈点赞回复的那些事儿
- 基于java的微信小程序的实现(八)用户点赞/取消点赞功能相关后端接口开发
- 微信小程序textarea的内容随着屏幕上下移动的问题
- 微信小程序怎么在一个wx:for循环中遍历两个内容不同的数组
- 【微信小程序】获得用户input内容的方法
- 微信小程序在线客服自动回复功能(基于node)
- 关于微信刷助力之微信怎么刷砍价及微信公众号文章评论点赞怎么刷赞方法
- UC浏览器 分享到朋友圈和微信好友 分类: JavaScript 2015-04-28 14:45 614人阅读 评论(1) 收藏
- 微信团队回应“部分用户朋友圈无法刷新”;罗永浩:准备做综艺节目;Apache Spark 3.0 发布| 极客头条...
- Android 仿微信朋友圈点赞和评论弹出框功能
- 01-android 微信实现本地视频发布到朋友圈功能
- 发布体验版小程序-微信小程序开发-视频教程15
- iOS类似微信点击评论或者回复 键盘出来 点击评论动态所在cell动态调整到键盘上方 方便用户看到自己所评论的