├── LICENSE.md ├── README.md ├── mango_new_life.sql ├── 前台源码 ├── app.js ├── app.json ├── app.wxss ├── components │ ├── navbar │ │ ├── index.js │ │ ├── index.json │ │ ├── index.wxml │ │ └── index.wxss │ ├── search │ │ ├── index.js │ │ ├── index.json │ │ ├── index.wxml │ │ └── index.wxss │ └── searchBox │ │ ├── index.js │ │ ├── index.json │ │ ├── index.wxml │ │ └── index.wxss ├── images │ ├── other │ │ ├── 1.png │ │ ├── ad_bottom.jpg │ │ ├── add.png │ │ ├── hidden.jpg │ │ ├── index.jpeg │ │ ├── logo.png │ │ ├── mark.png │ │ └── top.png │ └── tabBar │ │ ├── shangpin.png │ │ ├── shangpin_active.png │ │ ├── tianjia.png │ │ ├── tianjia_active.png │ │ ├── wode.png │ │ ├── wode_active.png │ │ ├── zhuye.png │ │ └── zhuye_active.png ├── music │ └── new.wav ├── pages │ ├── add │ │ ├── add.js │ │ ├── add.json │ │ ├── add.wxml │ │ └── add.wxss │ ├── add_detail │ │ ├── add_detail.js │ │ ├── add_detail.json │ │ ├── add_detail.wxml │ │ └── add_detail.wxss │ ├── agreement │ │ ├── agreement.js │ │ ├── agreement.json │ │ ├── agreement.wxml │ │ └── agreement.wxss │ ├── category │ │ ├── category.js │ │ ├── category.json │ │ ├── category.wxml │ │ └── category.wxss │ ├── index │ │ ├── index.js │ │ ├── index.json │ │ ├── index.wxml │ │ └── index.wxss │ ├── me │ │ ├── me.js │ │ ├── me.json │ │ ├── me.wxml │ │ └── me.wxss │ ├── me_about │ │ ├── me_about.js │ │ ├── me_about.json │ │ ├── me_about.wxml │ │ └── me_about.wxss │ ├── me_canyu │ │ ├── me_canyu.js │ │ ├── me_canyu.json │ │ ├── me_canyu.wxml │ │ └── me_canyu.wxss │ ├── me_fabu │ │ ├── me_fabu.js │ │ ├── me_fabu.json │ │ ├── me_fabu.wxml │ │ └── me_fabu.wxss │ ├── me_shoucang │ │ ├── me_shoucang.js │ │ ├── me_shoucang.json │ │ ├── me_shoucang.wxml │ │ └── me_shoucang.wxss │ ├── me_xiaoxi │ │ ├── me_xiaoxi.js │ │ ├── me_xiaoxi.json │ │ ├── me_xiaoxi.wxml │ │ └── me_xiaoxi.wxss │ ├── message_detail │ │ ├── message_detail.js │ │ ├── message_detail.json │ │ ├── message_detail.wxml │ │ └── message_detail.wxss │ ├── search │ │ ├── search.js │ │ ├── search.json │ │ ├── search.wxml │ │ └── search.wxss │ ├── shop │ │ ├── shop.js │ │ ├── shop.json │ │ ├── shop.wxml │ │ └── shop.wxss │ ├── shop_detail │ │ ├── shop_detail.js │ │ ├── shop_detail.json │ │ ├── shop_detail.wxml │ │ └── shop_detail.wxss │ └── welcome │ │ ├── welcome.js │ │ ├── welcome.json │ │ ├── welcome.wxml │ │ └── welcome.wxss ├── project.config.json ├── sitemap.json └── utils │ ├── base64.js │ ├── bmap-wx.min.js │ ├── config.js │ ├── crypto.js │ ├── hmac.js │ ├── sha1.js │ ├── uploadFile.js │ └── util.js └── 后台源码 ├── .idea ├── compiler.xml ├── dataSources.local.xml ├── dataSources.xml ├── dataSources │ ├── c411d75a-6309-43a4-90b2-5e14c73e1773.xml │ └── c411d75a-6309-43a4-90b2-5e14c73e1773 │ │ └── storage_v2 │ │ └── _src_ │ │ └── schema │ │ └── information_schema.FNRwLQ.meta ├── encodings.xml ├── jarRepositories.xml ├── misc.xml ├── uiDesigner.xml ├── vcs.xml └── workspace.xml ├── mango.iml ├── pom.xml └── src ├── main ├── java │ └── work │ │ └── huangxin │ │ └── mango │ │ ├── MiniProgramRunApp.java │ │ ├── basemapper │ │ └── SameMethod.java │ │ ├── controller │ │ ├── AddAdminReplyController.java │ │ ├── AddCollectionController.java │ │ ├── AddCommentController.java │ │ ├── AddCommentReplyController.java │ │ ├── AddMessageDetailController.java │ │ ├── DeleteByUserIdController.java │ │ ├── DeleteCommentByIdController.java │ │ ├── GetAttendMessageController.java │ │ ├── GetCategoryMessageController.java │ │ ├── GetLostMessageController.java │ │ ├── GetMessageDetailController.java │ │ ├── GetNewMessageController.java │ │ ├── GetNoticeController.java │ │ ├── GetShopMessageController.java │ │ ├── GetSwiperMessageController.java │ │ ├── LoginController.java │ │ ├── SearchMessageController.java │ │ ├── UpdateMessageByUserIdController.java │ │ └── addShareCountController.java │ │ ├── mapper │ │ ├── MangoAttendMapper.java │ │ ├── MangoCategoryMapper.java │ │ ├── MangoCollectMapper.java │ │ ├── MangoCommentMapper.java │ │ ├── MangoCommentReplyMapper.java │ │ ├── MangoMessageImagesMapper.java │ │ ├── MangoMessageMapper.java │ │ ├── MangoNewMessageMapper.java │ │ ├── MangoNoticeMapper.java │ │ ├── MangoShopBusinessMapper.java │ │ ├── MangoShopImagesMapper.java │ │ ├── MangoShopMapper.java │ │ ├── MangoSwiperMapper.java │ │ └── MangoUserMapper.java │ │ ├── model │ │ ├── MangoAttend.java │ │ ├── MangoCategory.java │ │ ├── MangoCollect.java │ │ ├── MangoComment.java │ │ ├── MangoCommentReply.java │ │ ├── MangoMessage.java │ │ ├── MangoMessageImages.java │ │ ├── MangoNewMessage.java │ │ ├── MangoNotice.java │ │ ├── MangoShop.java │ │ ├── MangoShopBusiness.java │ │ ├── MangoShopImages.java │ │ ├── MangoSwiper.java │ │ ├── MangoUser.java │ │ └── WXSessionModel.java │ │ ├── otherMethod │ │ └── DeleteAliyunFile.java │ │ ├── service │ │ ├── MangoAttendService.java │ │ ├── MangoCategoryService.java │ │ ├── MangoCollectService.java │ │ ├── MangoCommentReplayService.java │ │ ├── MangoCommentService.java │ │ ├── MangoMessageDetailService.java │ │ ├── MangoMessageImagesService.java │ │ ├── MangoNewMessageService.java │ │ ├── MangoNoticeService.java │ │ ├── MangoShopBusinessService.java │ │ ├── MangoShopImagesService.java │ │ ├── MangoShopService.java │ │ ├── MangoSwiperService.java │ │ └── MangoUserService.java │ │ └── util │ │ ├── SameService.java │ │ ├── Upload │ │ └── IsUpload.java │ │ ├── common │ │ ├── HttpClientUtil.java │ │ └── JsonUtils.java │ │ ├── isCollect │ │ └── IsCollect.java │ │ ├── isComment │ │ └── IsComment.java │ │ ├── isCommentReply │ │ └── IsCommentReply.java │ │ ├── isDelete │ │ └── IsDelete.java │ │ ├── isUpdate │ │ └── IsUpdate.java │ │ └── login │ │ └── IsLogin.java └── resources │ ├── application.yml │ ├── banner.txt │ └── mappers │ ├── MangoAttendMapper.xml │ ├── MangoCategoryMapper.xml │ ├── MangoCollectMapper.xml │ ├── MangoCommentMapper.xml │ ├── MangoCommentReplyMapper.xml │ ├── MangoMessageImagesMapper.xml │ ├── MangoMessageMapper.xml │ ├── MangoNewMessageMapper.xml │ ├── MangoNoticeMapper.xml │ ├── MangoShopBusinessMapper.xml │ ├── MangoShopImagesMapper.xml │ ├── MangoShopMapper.xml │ ├── MangoSwiperMapper.xml │ └── MangoUserMapper.xml └── test └── java └── test.java /README.md: -------------------------------------------------------------------------------- 1 | # Mango(开源,免费,禁止售卖) 2 | ### 微信小程序|校园|表白墙|失物招领|二手交易|论坛|兼职|拼车|活动等 3 | 4 | ## 微信搜索(芒果New Life)即可查看效果 5 | 6 | 7 | ![项目地址](https://images.gitee.com/uploads/images/2020/0228/193310_c2cc3774_4760255.jpeg "在这里输入图片标题") 8 | 9 | ## 另一个小程序(优化版本,预留核心功能,美化界面)[直达链接](https://github.com/Xin-Felix/Share)https://github.com/Xin-Felix/Share 10 | 11 | # 2020-2-14后台源码公开 12 | 13 | ### 项目使用技术 14 | 1.前台微信小程序(Vue) 15 | 16 | 2.后台(springBoot+mybatis+mysql) 17 | 18 | ### 如何使用 19 | * ## 工具(IDEA(maven),tomcat,mysql(5.6以上)使用maven下载依赖以后方可启动,启动类是MiniProgramRunApp.java点击main方法启动即可,上线部署用springboot的package命令打包成jar运行即可 20 | 21 | 1.打开前台代码先修改app.js去配置服务器地址和oss的地址(用于展示图片) 22 | 23 | 2.打开前台util/config.js配置阿里云oss(如果有自己需求可以直接在后台增加上传的代码) 24 | 25 | 3.后台就不多说了,创建sql表,去修改yml文件内容 26 | 27 | 4.数据库请提前储存部分信息(sql文件带测试数据,进入程序自己可以添加数据),不然无法正常进入小程序 28 | 29 | 5.因为微信小程序登录需要用到appid和密钥,登陆微信公众平台查看小程序的appid和密钥,然后找到后台源码Controller层的LoginController.java修改你的appid和密钥 30 | 31 | 6.去后台源码/Mango/src/main/java/work/huangxin/mango/util/isDelete/IsDelete.java添加你自己的oss信息(删除oss的文件的操作) 32 | 33 | 7.数据库是mysql,版本需要大于5.5,否则会有冲突无法导入sql文件 34 | 35 | 8.[oss购买地址,几块钱](https://www.aliyun.com/minisite/goods?userCode=ztot6i1n),创建bucket,请将bucket默认权限改为公共读写,否则外界无法访问 36 | 37 | ### 程序本身的一些功能 38 | 1.发布帖子 39 | 40 | 2.收藏 41 | 42 | 3.转发 43 | 44 | 4.帖子的增删改查 45 | 46 | 5.最新消息的提醒 47 | 48 | 5.管理员可以前台管理帖子 49 | 50 | 6.匿名发布,封禁用户 51 | 52 | 7.消息提醒等 53 | 54 | 8.管理员以及禁用的功能(数据库表mango_user中的user_is_admin为2是管理员,user_allow为1正常使用,其他数字禁止用户使用程序功能) 55 | 56 | [管理员可以修改用户的帖子以及删除,在帖子页面,点击头像可以查看用户的信息并可以禁用Ta,可以回复消息给Ta] 57 | 58 | 59 | ### 程序的缺陷以及问题 60 | 1.由于技术欠佳,后台一人维护,并没有后台,大部分数据(轮播图,添加管理员)等操作需要直接操作数据库 61 | 62 | 2.图片的上传,由于服务器网速限制,文件均在阿里云oss存储 63 | 64 | 3.如果自己搭建修改可以修改小程序上传的代码,保存在服务器也可以 65 | 66 | # 程序已下线 67 | 68 | ## 本来是想用来给自己学校学生用,但是由于经营不佳出现后续问题,如果想在自己学校可以试试.或者拿去当毕业设计 69 | 70 | # 如果你有什么问题可以私聊我 71 | ### QQ/WeChat 1538933906 72 | 73 | # 如果你觉得程序帮到了你,可以请我喝杯coffee,谢谢 74 | 75 | ![weixin](https://images.gitee.com/uploads/images/2020/0228/192541_a630d5a7_4760255.jpeg "markdown") 76 | 77 | 78 | 79 | -------------------------------------------------------------------------------- /前台源码/app.json: -------------------------------------------------------------------------------- 1 | { 2 | "pages": [ 3 | "pages/welcome/welcome", 4 | "pages/index/index", 5 | "pages/category/category", 6 | "pages/search/search", 7 | "pages/message_detail/message_detail", 8 | "pages/add/add", 9 | "pages/agreement/agreement", 10 | "pages/add_detail/add_detail", 11 | "pages/shop/shop", 12 | "pages/shop_detail/shop_detail", 13 | "pages/me/me", 14 | "pages/me_fabu/me_fabu", 15 | "pages/me_canyu/me_canyu", 16 | "pages/me_shoucang/me_shoucang", 17 | "pages/me_xiaoxi/me_xiaoxi", 18 | "pages/me_about/me_about" 19 | ], 20 | "permission": { 21 | "scope.userLocation": { 22 | "desc": "你的位置信息将用于天气预报,请给予权限噢" 23 | } 24 | }, 25 | "window": { 26 | "backgroundTextStyle": "light", 27 | "navigationBarBackgroundColor": "#fff", 28 | "navigationBarTitleText": "WeChat", 29 | "navigationBarTextStyle": "black", 30 | "navigationStyle": "custom" 31 | }, 32 | "tabBar": { 33 | "list": [ 34 | { 35 | "pagePath": "pages/index/index", 36 | "text": "主页", 37 | "iconPath": "/images/tabBar/zhuye.png", 38 | "selectedIconPath": "/images/tabBar/zhuye_active.png" 39 | }, 40 | { 41 | "pagePath": "pages/add/add", 42 | "text": "添加", 43 | "iconPath": "/images/tabBar/tianjia.png", 44 | "selectedIconPath": "/images/tabBar/tianjia_active.png" 45 | }, 46 | { 47 | "pagePath": "pages/shop/shop", 48 | "text": "商店", 49 | "iconPath": "/images/tabBar/shangpin.png", 50 | "selectedIconPath": "/images/tabBar/shangpin_active.png" 51 | }, 52 | { 53 | "pagePath": "pages/me/me", 54 | "text": "我的", 55 | "iconPath": "/images/tabBar/wode.png", 56 | "selectedIconPath": "/images/tabBar/wode_active.png" 57 | } 58 | ] 59 | }, 60 | "requiredBackgroundModes": [ 61 | "audio" 62 | ], 63 | "sitemapLocation": "sitemap.json" 64 | } -------------------------------------------------------------------------------- /前台源码/app.wxss: -------------------------------------------------------------------------------- 1 | page { 2 | background-color: rgb(240, 240, 240); 3 | width: 100%; 4 | height: 100%; 5 | } 6 | 7 | /* KEYFRAMES */ 8 | 9 | @keyframes spin { 10 | from { 11 | transform: rotate(0); 12 | } 13 | 14 | to { 15 | transform: rotate(359deg); 16 | } 17 | } 18 | 19 | @keyframes configure-clockwise { 20 | 0% { 21 | transform: rotate(0); 22 | } 23 | 24 | 25% { 25 | transform: rotate(90deg); 26 | } 27 | 28 | 50% { 29 | transform: rotate(180deg); 30 | } 31 | 32 | 75% { 33 | transform: rotate(270deg); 34 | } 35 | 36 | 100% { 37 | transform: rotate(359deg); 38 | } 39 | } 40 | 41 | @keyframes configure-xclockwise { 42 | 0% { 43 | transform: rotate(45deg); 44 | } 45 | 46 | 25% { 47 | transform: rotate(-45deg); 48 | } 49 | 50 | 50% { 51 | transform: rotate(-135deg); 52 | } 53 | 54 | 75% { 55 | transform: rotate(-215deg); 56 | } 57 | 58 | 100% { 59 | transform: rotate(-305deg); 60 | } 61 | } 62 | 63 | @keyframes pulse { 64 | from { 65 | opacity: 1; 66 | transform: scale(1); 67 | } 68 | 69 | to { 70 | opacity: 0.25; 71 | transform: scale(0.75); 72 | } 73 | } 74 | 75 | /* GRID STYLING */ 76 | 77 | htmleaf-container { 78 | box-sizing: border-box; 79 | } 80 | 81 | htmleaf-container { 82 | min-height: 100vh; 83 | background-color: #37474f; 84 | display: flex; 85 | justify-content: space-between; 86 | flex-wrap: wrap; 87 | align-items: flex-start; 88 | } 89 | 90 | .spinner-box { 91 | width: 300px; 92 | height: 300px; 93 | display: flex; 94 | justify-content: center; 95 | align-items: center; 96 | background-color: transparent; 97 | } 98 | 99 | /* GRID STYLING */ 100 | 101 | htmleaf-container { 102 | box-sizing: border-box; 103 | } 104 | 105 | htmleaf-container { 106 | min-height: 100vh; 107 | background-color: #37474f; 108 | display: flex; 109 | justify-content: space-between; 110 | flex-wrap: wrap; 111 | align-items: flex-start; 112 | } 113 | 114 | .spinner-box { 115 | width: 300px; 116 | height: 300px; 117 | display: flex; 118 | justify-content: center; 119 | align-items: center; 120 | background-color: transparent; 121 | } 122 | 123 | /* PULSE BUBBLES */ 124 | 125 | .pulse-container { 126 | width: 120px; 127 | display: flex; 128 | justify-content: space-between; 129 | align-items: center; 130 | } 131 | 132 | .pulse-bubble { 133 | width: 20px; 134 | height: 20px; 135 | border-radius: 50%; 136 | background-color: #3ff9dc; 137 | } 138 | 139 | .pulse-bubble-1 { 140 | animation: pulse 0.4s ease 0s infinite alternate; 141 | } 142 | 143 | .pulse-bubble-2 { 144 | animation: pulse 0.4s ease 0.2s infinite alternate; 145 | } 146 | 147 | .pulse-bubble-3 { 148 | animation: pulse 0.4s ease 0.4s infinite alternate; 149 | } 150 | 151 | .sun { 152 | width: 35px; 153 | height: 35px; 154 | border-radius: 50%; 155 | background-color: #ffab91; 156 | } 157 | -------------------------------------------------------------------------------- /前台源码/components/navbar/index.js: -------------------------------------------------------------------------------- 1 | const app = getApp() 2 | Component({ 3 | properties: { 4 | navbarData: { //navbarData 由父页面传递的数据,变量名字自命名 5 | type: Object, 6 | value: {}, 7 | observer: function(newVal, oldVal) {} 8 | } 9 | }, 10 | data: { 11 | height: '', 12 | //默认值 默认显示左上角 13 | navbarData: { 14 | showCapsule: 1 15 | } 16 | }, 17 | attached: function() { 18 | // 获取是否是通过分享进入的小程序 19 | this.setData({ 20 | share: app.globalData.share 21 | }) 22 | // 定义导航栏的高度 方便对齐 23 | this.setData({ 24 | height: app.globalData.height 25 | }) 26 | }, 27 | methods: { 28 | // 返回上一页面 29 | _navback() { 30 | wx.navigateBack({ 31 | delta: 1 32 | }) 33 | }, 34 | //返回到首页 35 | _backhome() { 36 | wx.switchTab({ 37 | url: '/pages/index/index', 38 | }) 39 | } 40 | } 41 | 42 | }) -------------------------------------------------------------------------------- /前台源码/components/navbar/index.json: -------------------------------------------------------------------------------- 1 | { 2 | "component": true, 3 | "usingComponents": { 4 | "SearchBar": "/components/searchBox/index" 5 | } 6 | } -------------------------------------------------------------------------------- /前台源码/components/navbar/index.wxml: -------------------------------------------------------------------------------- 1 | 2 | 3 | {{navbarData.title}} 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | -------------------------------------------------------------------------------- /前台源码/components/navbar/index.wxss: -------------------------------------------------------------------------------- 1 | /* 顶部要固定定位 标题要居中 自定义按钮和标题要和右边微信原生的胶囊上下对齐 */ 2 | 3 | @font-face { 4 | font-family: "iconfont"; 5 | src: url('iconfont.eot?t=1565321795659'); /* IE9 */ 6 | src: url('iconfont.eot?t=1565321795659#iefix') format('embedded-opentype'), 7 | /* IE6-IE8 */ url('data:application/x-font-woff2;charset=utf-8;base64,d09GMgABAAAAAAOoAAsAAAAAB8QAAANZAAEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAHEIGVgCDHAqDBIJjATYCJAMQCwoABCAFhG0HQRvOBhHVm6PIfibwJparAE7mrwlnEZEQ6akJQsxlI8vZukmPEOkHTL9LAGyuOWCjoiaf5Cx69IW0fcxfmo4ScPT34Jjp0iaQBzSXrKRIwNF0OrCo+G+gB/0Xxh/GrlqKgzoNAXxSkxOpWLlmQxwWPEkA6dmtSztcRoFtSBccQqRipUXm4uHMNHMTmBP8vXwivzgweAo+q27nSh0p+zbV20E6NkRLHcfY6XSAug4UyAlYkK6VhvZoFMiJ4tv9LYUBh8PAVF0Z3g4KQ8Q6isCRf3mgGAQkAk6NAaAgCiq8TcUYiTADlGGgcBBkPUCRBcDxREkDgA0Yl5IbBYOJn9FljNely5Jx26cn7LhwbKJEnRbN2DEu8YDbAHEXcQ9xh9Bo2YwUd7UNb9+m1Mw9d+40uXevyfLpTTtt2pG88+atw/zpp5Orb5ae9COELNq4ffWaJF12zMjWadGqlVszVvbtHMw4hQk06Nwx8LPGnak6okfPr9nIz/0/e/a3bN8qTJ78JeuTrE/5dZ8mjRYsb7bHW9Ky9jJvT+s5y+pucfOa1J5HwyK5skiT6sum99yetlHC+onG9k1XO3296F3Za5Xt8771yFQj0i+6oqOz5uqYK1280uFP/rnfKDh27P4Ulfxi+4r4lVLsTt4oxd6seX+/HnTryKx0BdLtnfmk06vfRc6DydOfOHiw5p5ie3/1++ccntXjz4EiyT36AhBuLmq5gJB+0OYh+k/H/bVRXGgxolibOCX/uOCqOx4MCCogW8jSTcirZ3Zm/iNmxwbrsLHSWovDGK7JUmjwBAP4+MCfiUB8nk5hSgSJTnAaE4IhilSgODIiLTYneAQUhAiOMuCTgyrrAxLQH0VsNJCdSQCEuOwBQ2zOgBKXW0iLfQIeifkCEeKKgk9jSbBjQLOXendkVIIW9A9qQ4OjatmF6Tf0qVOcZgf4F3Ks3VBmRT58xQF5ijnx7SsRB46phws4D7uOYGRq0EgWRMZDnruqb8oM9ZMdR0YlaAH9A2pDgxPtZVf4/Rv61CluKGlTvpBj3TtQklF0QF4FQ6eSW3lNfPsKEQc4ph64AB12JEDAWD2sQSMZYYBvPJCjVq6rIFte1L9AuloBvsGKERUrHqvOagipXkVKMdHyn9h/OJkAAAAA') format('woff2'), 8 | url('iconfont.woff?t=1565321795659') format('woff'), 9 | url('iconfont.ttf?t=1565321795659') format('truetype'), 10 | /* chrome, 11 | firefox, 12 | opera, 13 | Safari, 14 | Android, 15 | iOS 4.2+ */ url('iconfont.svg?t=1565321795659#iconfont') format('svg'); /* iOS 4.1- */ 16 | } 17 | 18 | .iconfont { 19 | font-family: "iconfont" !important; 20 | font-size: 16px; 21 | font-style: normal; 22 | -webkit-font-smoothing: antialiased; 23 | -moz-osx-font-smoothing: grayscale; 24 | } 25 | 26 | .icon-fanhui:before { 27 | content: "\e675"; 28 | } 29 | 30 | .icon-sousuo:before { 31 | content: "\e623"; 32 | } 33 | 34 | .icon-zhuye:before { 35 | content: "\e61d"; 36 | } 37 | 38 | .nav-wrap { 39 | position: fixed; 40 | width: 100%; 41 | top: 0; 42 | background: #fff; 43 | color: #000; 44 | z-index: 9999999; 45 | } 46 | 47 | /* 标题要居中 */ 48 | 49 | .nav-title { 50 | position: absolute; 51 | text-align: center; 52 | max-width: 400rpx; 53 | overflow: hidden; 54 | text-overflow: ellipsis; 55 | white-space: nowrap; 56 | top: 0; 57 | left: 0; 58 | right: 0; 59 | bottom: 0; 60 | margin: auto; 61 | font-size: 18px; 62 | color: #2c2b2b; 63 | font-weight: 600; 64 | } 65 | 66 | .nav-capsule { 67 | display: flex; 68 | align-items: center; 69 | margin-left: 30rpx; 70 | width: 140rpx; 71 | justify-content: space-between; 72 | height: 100%; 73 | } 74 | 75 | .navbar-v-line { 76 | width: 1px; 77 | height: 32rpx; 78 | background-color: #e5e5e5; 79 | } 80 | 81 | .back-pre, .back-home { 82 | width: 32rpx; 83 | height: 36rpx; 84 | margin-top: 4rpx; 85 | padding: 10rpx; 86 | } 87 | 88 | .nav-capsule .back-home { 89 | width: 36rpx; 90 | height: 40rpx; 91 | margin-top: 3rpx; 92 | } 93 | -------------------------------------------------------------------------------- /前台源码/components/search/index.js: -------------------------------------------------------------------------------- 1 | 2 | // 本组件为搜索组件 3 | // 需要传入addflag 值为true / false (搜索框右侧部分) 4 | // 若显示搜索框右侧部分 需传入右侧图标url以及addhandle函数 5 | 6 | Component({ 7 | 8 | properties: { 9 | 10 | addflag: { //显示搜索框右侧部分 11 | type: Boolean, 12 | value: false, 13 | observer(newVal, oldVal, changedPath) { 14 | 15 | } 16 | }, 17 | addimg: { //显示搜索框右侧部分icon 18 | type: String, 19 | value: '' 20 | }, 21 | searchstr: { //input 值 22 | type: String, 23 | value: '值' 24 | }, 25 | searchflag: { 26 | type: Boolean, 27 | value: false, 28 | } 29 | 30 | }, 31 | 32 | /** 33 | * 组件的初始数据 34 | */ 35 | data: { 36 | // searchflag: false, //搜索框 取消按钮显示与隐藏 37 | }, 38 | 39 | /** 40 | * 组件的方法列表 41 | 42 | */ 43 | methods: { 44 | 45 | //获得焦点 46 | getfocus() { 47 | this.setData({ 48 | searchflag: true, 49 | }) 50 | }, 51 | //搜索框右侧按钮事件 52 | addhandle() { 53 | this.triggerEvent("addhandle"); 54 | }, 55 | //搜索输入 56 | searchList(e) { 57 | this.triggerEvent("searchList", e); 58 | }, 59 | //查询 60 | endsearchList(e) { 61 | 62 | this.triggerEvent("endsearchList"); 63 | }, 64 | //失去焦点 65 | blursearch() { 66 | // console.log('失去焦点') 67 | 68 | }, 69 | // 取消 70 | cancelsearch() { 71 | this.setData({ 72 | searchflag: false, 73 | }) 74 | this.triggerEvent("cancelsearch"); 75 | }, 76 | //清空搜索框 77 | activity_clear(e) { 78 | 79 | this.triggerEvent("activity_clear"); 80 | }, 81 | 82 | } 83 | }) 84 | -------------------------------------------------------------------------------- /前台源码/components/search/index.json: -------------------------------------------------------------------------------- 1 | { 2 | "component": true, 3 | "usingComponents": {} 4 | } -------------------------------------------------------------------------------- /前台源码/components/search/index.wxml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 取消 14 | 15 | 16 | 17 | 18 | 19 | -------------------------------------------------------------------------------- /前台源码/components/search/index.wxss: -------------------------------------------------------------------------------- 1 | /*搜索 开始*/ 2 | 3 | .tit_seabox { 4 | width: calc(100% - 64rpx); 5 | background: #fff; 6 | height: 60rpx; 7 | padding: 20rpx 32rpx; 8 | display: flex; 9 | align-items: center; 10 | overflow: hidden; 11 | } 12 | 13 | .tit_seabox_bar { 14 | width: calc(100% - 32rpx); 15 | height: 60rpx; 16 | display: flex; 17 | align-items: center; 18 | border-radius: 30rpx; 19 | background: #f5f5f5; 20 | padding-left: 32rpx; 21 | } 22 | 23 | /*有权限添加活动*/ 24 | 25 | .tit_seabox_bar.tit_seabox_add { 26 | width: calc(100% - 122rpx); 27 | } 28 | 29 | /*开始搜索时*/ 30 | 31 | .tit_seabox_bar.tit_start_search { 32 | width: calc(100% - 102rpx); 33 | } 34 | 35 | /*开始搜索且有权限添加*/ 36 | 37 | .tit_seabox_bar.tit_start_search.tit_seabox_add { 38 | width: calc(100% - 192rpx); 39 | } 40 | 41 | .tit_seabox_bar icon { 42 | margin-right: 20rpx; 43 | } 44 | 45 | .tit_seabox input { 46 | height: 60rpx; 47 | line-height: 60rpx; 48 | font-size: 28rpx; 49 | width: 100%; 50 | margin-right: 32rpx; 51 | } 52 | 53 | .activity_add { 54 | width: 60rpx; 55 | text-align: right; 56 | border-left: 4rpx solid #f2f2f2; 57 | margin-left: 20rpx; 58 | } 59 | 60 | .activity_add image { 61 | width: 40rpx; 62 | height: 40rpx; 63 | } 64 | 65 | .activity_seabtn { 66 | font-size: 28rpx; 67 | width: 70rpx; 68 | text-align: right; 69 | } 70 | 71 | /*搜索 结束*/ 72 | -------------------------------------------------------------------------------- /前台源码/components/searchBox/index.js: -------------------------------------------------------------------------------- 1 | // 本组件为搜索组件 2 | // 需要传入addflag 值为true / false (搜索框右侧部分) 3 | // 若显示搜索框右侧部分 需传入右侧图标url以及addhandle函数 4 | const app = getApp(); 5 | Component({ 6 | 7 | properties: { 8 | 9 | addflag: { //显示搜索框右侧部分 10 | type: Boolean, 11 | value: false, 12 | 13 | observer(newVal, oldVal, changedPath) { 14 | 15 | } 16 | }, 17 | addimg: { //显示搜索框右侧部分icon 18 | type: String, 19 | value: '' 20 | }, 21 | searchstr: { //input 值 22 | type: String, 23 | value: '值' 24 | }, 25 | searchflag: { 26 | type: Boolean, 27 | value: false, 28 | } 29 | 30 | }, 31 | 32 | /** 33 | * 组件的初始数据 34 | */ 35 | data: { 36 | // searchflag: false, //搜索框 取消按钮显示与隐藏 37 | height: 0 38 | }, 39 | attached: function() { 40 | // 定义导航栏的高度 方便对齐 41 | this.setData({ 42 | height: app.globalData.height 43 | }) 44 | }, 45 | 46 | 47 | }) -------------------------------------------------------------------------------- /前台源码/components/searchBox/index.json: -------------------------------------------------------------------------------- 1 | { 2 | "component": true 3 | } -------------------------------------------------------------------------------- /前台源码/components/searchBox/index.wxml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /前台源码/components/searchBox/index.wxss: -------------------------------------------------------------------------------- 1 | /*搜索 开始*/ 2 | 3 | .nav-wrap { 4 | position: fixed; 5 | width: 100%; 6 | top: 0; 7 | background: #fff; 8 | color: #000; 9 | z-index: 9999999; 10 | } 11 | 12 | .tit_seabox { 13 | width: calc(100% - 64rpx); 14 | background: #fff; 15 | height: 30px; 16 | padding: 10px 16px; 17 | display: flex; 18 | align-items: center; 19 | overflow: hidden; 20 | } 21 | 22 | .tit_seabox_bar { 23 | width: calc(100% - 16px); 24 | height: 30px; 25 | display: flex; 26 | align-items: center; 27 | border-radius: 15px; 28 | background: #f5f5f5; 29 | padding-left: 16px; 30 | } 31 | 32 | .tit_seabox input { 33 | height: 30px; 34 | line-height: 30px; 35 | font-size: 14px; 36 | width: 100%; 37 | margin-right: 16px; 38 | } 39 | -------------------------------------------------------------------------------- /前台源码/images/other/1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Xin-Felix/Mango/44acdb02fb9bfdfd1fac1816f264ee828371fd14/前台源码/images/other/1.png -------------------------------------------------------------------------------- /前台源码/images/other/ad_bottom.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Xin-Felix/Mango/44acdb02fb9bfdfd1fac1816f264ee828371fd14/前台源码/images/other/ad_bottom.jpg -------------------------------------------------------------------------------- /前台源码/images/other/add.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Xin-Felix/Mango/44acdb02fb9bfdfd1fac1816f264ee828371fd14/前台源码/images/other/add.png -------------------------------------------------------------------------------- /前台源码/images/other/hidden.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Xin-Felix/Mango/44acdb02fb9bfdfd1fac1816f264ee828371fd14/前台源码/images/other/hidden.jpg -------------------------------------------------------------------------------- /前台源码/images/other/index.jpeg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Xin-Felix/Mango/44acdb02fb9bfdfd1fac1816f264ee828371fd14/前台源码/images/other/index.jpeg -------------------------------------------------------------------------------- /前台源码/images/other/logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Xin-Felix/Mango/44acdb02fb9bfdfd1fac1816f264ee828371fd14/前台源码/images/other/logo.png -------------------------------------------------------------------------------- /前台源码/images/other/mark.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Xin-Felix/Mango/44acdb02fb9bfdfd1fac1816f264ee828371fd14/前台源码/images/other/mark.png -------------------------------------------------------------------------------- /前台源码/images/other/top.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Xin-Felix/Mango/44acdb02fb9bfdfd1fac1816f264ee828371fd14/前台源码/images/other/top.png -------------------------------------------------------------------------------- /前台源码/images/tabBar/shangpin.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Xin-Felix/Mango/44acdb02fb9bfdfd1fac1816f264ee828371fd14/前台源码/images/tabBar/shangpin.png -------------------------------------------------------------------------------- /前台源码/images/tabBar/shangpin_active.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Xin-Felix/Mango/44acdb02fb9bfdfd1fac1816f264ee828371fd14/前台源码/images/tabBar/shangpin_active.png -------------------------------------------------------------------------------- /前台源码/images/tabBar/tianjia.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Xin-Felix/Mango/44acdb02fb9bfdfd1fac1816f264ee828371fd14/前台源码/images/tabBar/tianjia.png -------------------------------------------------------------------------------- /前台源码/images/tabBar/tianjia_active.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Xin-Felix/Mango/44acdb02fb9bfdfd1fac1816f264ee828371fd14/前台源码/images/tabBar/tianjia_active.png -------------------------------------------------------------------------------- /前台源码/images/tabBar/wode.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Xin-Felix/Mango/44acdb02fb9bfdfd1fac1816f264ee828371fd14/前台源码/images/tabBar/wode.png -------------------------------------------------------------------------------- /前台源码/images/tabBar/wode_active.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Xin-Felix/Mango/44acdb02fb9bfdfd1fac1816f264ee828371fd14/前台源码/images/tabBar/wode_active.png -------------------------------------------------------------------------------- /前台源码/images/tabBar/zhuye.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Xin-Felix/Mango/44acdb02fb9bfdfd1fac1816f264ee828371fd14/前台源码/images/tabBar/zhuye.png -------------------------------------------------------------------------------- /前台源码/images/tabBar/zhuye_active.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Xin-Felix/Mango/44acdb02fb9bfdfd1fac1816f264ee828371fd14/前台源码/images/tabBar/zhuye_active.png -------------------------------------------------------------------------------- /前台源码/music/new.wav: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Xin-Felix/Mango/44acdb02fb9bfdfd1fac1816f264ee828371fd14/前台源码/music/new.wav -------------------------------------------------------------------------------- /前台源码/pages/add/add.js: -------------------------------------------------------------------------------- 1 | //index.js 2 | //获取应用实例 3 | const app = getApp() 4 | 5 | Page({ 6 | data: { 7 | // 组件所需的参数 8 | nvabarData: { 9 | showCapsule: 0, //是否显示左上角图标 1表示显示 0表示不显示 10 | title: "添加", //导航栏 中间的标题 11 | height: 0 12 | }, 13 | userId: -1, 14 | agree: false, 15 | 16 | // 此页面 页面内容距最顶部的距离 17 | height: app.globalData.height * 2 + 20, 18 | }, 19 | onLoad() { 20 | let that = this 21 | this.setData({ 22 | height: app.globalData.height, 23 | userId: getApp().globalData.userId 24 | }) 25 | 26 | 27 | 28 | }, 29 | 30 | to_add() { 31 | let that = this; 32 | 33 | 34 | if (that.data.userId == -1) { 35 | wx.showModal({ 36 | title: '提示', 37 | content: '还没有登录噢~', 38 | confirmText: "去登陆", 39 | success: function(e) { 40 | if (e.confirm) { 41 | wx.switchTab({ 42 | url: "/pages/me/me" 43 | }) 44 | } 45 | } 46 | }) 47 | return; 48 | } 49 | 50 | if (this.data.agree) { 51 | wx.navigateTo({ 52 | url: '/pages/add_detail/add_detail', 53 | }) 54 | } else { 55 | wx.showModal({ 56 | title: '提示', 57 | content: '请先阅读约定', 58 | showCancel: false, 59 | confirmText: '去查看', 60 | success: function(e) { 61 | wx.navigateTo({ 62 | url: '/pages/agreement/agreement', 63 | }) 64 | } 65 | }) 66 | } 67 | 68 | }, 69 | look_agreement(e) { 70 | let that = this; 71 | this.setData({ 72 | agree: !that.data.agree 73 | }) 74 | }, 75 | onShow() { 76 | let that = this 77 | this.setData({ 78 | userId: getApp().globalData.userId 79 | }) 80 | wx.getStorage({ 81 | key: 'userId', 82 | success: function(res) { 83 | that.setData({ 84 | userId: res.data 85 | }) 86 | }, 87 | }) 88 | } 89 | 90 | }) -------------------------------------------------------------------------------- /前台源码/pages/add/add.json: -------------------------------------------------------------------------------- 1 | { 2 | "usingComponents": { 3 | "nav-bar": "/components/navbar/index" 4 | } 5 | } -------------------------------------------------------------------------------- /前台源码/pages/add/add.wxml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 免责声明:平台发布的所有信息仅负责展示,与平台本身无关,平台不负任何责任。 5 | 6 | 7 | 同意 8 | 《平台约定》 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /前台源码/pages/add/add.wxss: -------------------------------------------------------------------------------- 1 | /* pages/add/add.wxss */ 2 | 3 | .container { 4 | background-color: white; 5 | } 6 | 7 | .tips { 8 | background-color: wheat; 9 | padding: 20rpx; 10 | margin: 60rpx; 11 | color: #999; 12 | font-size: 25rpx; 13 | } 14 | 15 | .yveding { 16 | text-align: center; 17 | font-size: 30rpx; 18 | } 19 | 20 | navigator { 21 | display: inline-block; 22 | color: blue; 23 | } 24 | 25 | .submit { 26 | margin: 20rpx; 27 | } 28 | -------------------------------------------------------------------------------- /前台源码/pages/add_detail/add_detail.json: -------------------------------------------------------------------------------- 1 | { 2 | "usingComponents": { 3 | "nav-bar": "/components/navbar/index"} 4 | } -------------------------------------------------------------------------------- /前台源码/pages/add_detail/add_detail.wxml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 内容描述 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 联系方式: 20 | 21 | 22 | 23 | 24 | 25 | 当前年级: 26 | 27 | 28 | 29 | 30 | 31 | 专业说明: 32 | 33 | 34 | 35 | 36 | 37 | 请选择分类: 38 | 39 | 40 | {{(array[category_index]==null)?"请选择分类":"当前选择-"}}{{array[category_index]}} 41 | 42 | 43 | 44 | 45 | 46 | 47 | 是否匿名: 48 | 49 | 50 | 51 | 52 | · 联系方式将用于管理员核实信息,请熟知 53 | · 以上信息仅用于向他人展示,请根据实际情况填写 54 | · 联系方式不会显示在详情界面,如需告知他人请在描述中说明 55 | 56 | 57 | 58 | 确定发布 59 | 60 | -------------------------------------------------------------------------------- /前台源码/pages/add_detail/add_detail.wxss: -------------------------------------------------------------------------------- 1 | @font-face { 2 | font-family: "iconfont"; 3 | src: url('iconfont.eot?t=1565503082362'); 4 | /* IE9 */ 5 | src: url('iconfont.eot?t=1565503082362#iefix') format('embedded-opentype'), /* IE6-IE8 */ 6 | url('data:application/x-font-woff2;charset=utf-8;base64,d09GMgABAAAAAAKcAAsAAAAABlgAAAJRAAEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAHEIGVgCCcApkdAE2AiQDCAsGAAQgBYRtBy0blwXInpo8qVDb+BjCsEElBJCECOLX2M++20PcI1E0iyaaJUIhRBK0SqJkQrH/S7j7n9PrCH3Vl8MSqRGpkkxSuB/gn0vBjUgJoOdRqAm5Crdits/K53oDLqc/gR6kdUC5zTF4TMDA0kD3wCiyIom8YewCl/CYQIcZKyInO0dVmJCsVYF41tUGTOSiUrJCm9BSczDFu1pbeS2At/D78V8qJijqitVy/rTdhrXvqF1SHTfH7nxCjICO16iwBSRxXZs9NSwYN6wjO2IB7Ksx+I42jW8Xe7UI9tdZ9V1gCkrvSebKb7W+gIynJ4HFUZdRerpfHm6XOk8nP3eL4ePxgkTZ0u+T5e7z3Rebm/dmHorVy4vt0lMpcG3DhZVqFz+KNfhjtdJzcQfWAJpBdV8KBB92uvL8zm2dCb7CDBpuBgn9/LTtzRf8FVnPodQVlq2kKqv1F5OjVhZ06EADODhgMNY4fAvF0Gb4RvytplNU2iyRyW6h1mkbLdrso8Om3eOdBgnDItux4QIg9HlH0eMTlT6/ZLJ/qI34R4u+GEaH2xi8sNNK6FPHAhuEbdbsM73lOtxx0FTUWEY1tBoiqwh5dRSBnmDJWKJY2EUHxRxbgo6aIuKMC9dmO+A5tCyXecI1sEUxjcgrxeO87k2xlmvDlGMCaiCojWnqY3QtLgf3J5Op0ufLkCpkaRAtbTXxOiQE9NmZpJhED3JX6/Rqu5dXAh2qFEI4hhNcNmYHzEMWi4vx6ucZUAuJ0UakPSVxexzvq42tr7c/oIR1YXlKlIfM3GsNAAA=') format('woff2'), url('iconfont.woff?t=1565503082362') format('woff'), url('iconfont.ttf?t=1565503082362') format('truetype'), /* chrome, firefox, opera, Safari, Android, iOS 4.2+ */ 7 | url('iconfont.svg?t=1565503082362#iconfont') format('svg'); 8 | /* iOS 4.1- */ 9 | } 10 | 11 | .iconfont { 12 | font-family: "iconfont" !important; 13 | font-size: 32rpx; 14 | font-style: normal; 15 | -webkit-font-smoothing: antialiased; 16 | -moz-osx-font-smoothing: grayscale; 17 | } 18 | 19 | .icon-cha:before { 20 | content: "\e61a"; 21 | color: red; 22 | } 23 | 24 | .container { 25 | background-color: white; 26 | display: flex; 27 | flex-direction: column; 28 | padding: 20rpx; 29 | } 30 | 31 | .top_title { 32 | font-size: 30rpx; 33 | } 34 | 35 | .intro { 36 | font-size: 27rpx; 37 | color: #999; 38 | } 39 | 40 | .image_content { 41 | display: flex; 42 | flex-direction: row; 43 | flex-wrap: wrap; 44 | margin-top: 20rpx; 45 | justify-content: space-around; 46 | } 47 | 48 | .moment_img { 49 | width: 230rpx; 50 | height: 230rpx; 51 | } 52 | 53 | .image { 54 | position: relative; 55 | } 56 | 57 | .cha { 58 | position: absolute; 59 | top: 0; 60 | } 61 | 62 | .bottom, 63 | .bottom_item { 64 | margin-top: 20rpx; 65 | background-color: white; 66 | padding: 20rpx; 67 | } 68 | 69 | .message_user, 70 | .message_category { 71 | display: flex; 72 | flex-direction: row; 73 | } 74 | 75 | .phone_title { 76 | font-size: 30rpx; 77 | width: 300rpx; 78 | } 79 | 80 | .phone { 81 | font-size: 27rpx; 82 | color: #999 83 | } 84 | 85 | .message_category { 86 | margin-top: 2rpx; 87 | } 88 | 89 | .bottom_item { 90 | margin-top: 4rpx; 91 | } 92 | 93 | .wx-switch-input { 94 | width: 80rpx !important; 95 | height: 36rpx !important; 96 | background: #50D2C2 !important; 97 | border: #50d2c2 !important; 98 | /* 2018-07-18 重置开关边框颜色 */ 99 | } 100 | 101 | 102 | /*白色样式(false的样式)*/ 103 | 104 | .wx-switch-input::before { 105 | width: 80rpx !important; 106 | height: 36rpx !important; 107 | } 108 | 109 | .wx-switch-input::after { 110 | width: 40rpx !important; 111 | height: 36rpx !important; 112 | } 113 | 114 | .tips { 115 | padding: 20rpx; 116 | color: red; 117 | font-size: 20rpx; 118 | height: 200rpx; 119 | } 120 | 121 | .submit { 122 | position: fixed; 123 | bottom: 0; 124 | width: 100%; 125 | } 126 | 127 | .main { 128 | text-align: center; 129 | font-size: 40rpx; 130 | padding: 20rpx; 131 | font-weight: 1000; 132 | color: white; 133 | background-color: #50D2C2; 134 | } -------------------------------------------------------------------------------- /前台源码/pages/agreement/agreement.js: -------------------------------------------------------------------------------- 1 | //index.js 2 | //获取应用实例 3 | const app = getApp() 4 | 5 | Page({ 6 | data: { 7 | // 组件所需的参数 8 | nvabarData: { 9 | showCapsule: 1, //是否显示左上角图标 1表示显示 0表示不显示 10 | title: '平台约定', //导航栏 中间的标题 11 | height: 0 12 | }, 13 | 14 | // 此页面 页面内容距最顶部的距离 15 | height: app.globalData.height * 2 + 20, 16 | }, 17 | onLoad() { 18 | this.setData({ 19 | height: app.globalData.height 20 | }) 21 | } 22 | }) -------------------------------------------------------------------------------- /前台源码/pages/agreement/agreement.json: -------------------------------------------------------------------------------- 1 | { 2 | "usingComponents": { 3 | "nav-bar": "/components/navbar/index" 4 | } 5 | } -------------------------------------------------------------------------------- /前台源码/pages/agreement/agreement.wxml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 发布须知 4 | 1.针对失物招领、闲置交易、相约学习等需要其他人联系的文章,请在文章描述中说明联系方式 5 | 2.对于闲置交易,禁止发布任何非个人商品(如:商品售卖等),对于发布的闲置交易,平台不保证物品信息的正确,请联系卖家当面交易,如遇到虚假信息,请及时反馈给我们 6 | 3.对于所有发布信息,请发布健康内容,禁止发布任何具有攻击性以及没意义的内容(如:广告等),管理员有权删除违规信息,对于屡次违规,管理员将禁止使用平台功能 7 | 4.请在发布前确定好信息的分类,帮助其他人快速找到,对于随意发布,不遵守约定,管理员将删除你的信息 8 | 5.文章内所有信息均可复制,对于联系方式,可通过复制进行联系 9 | 6.平台对失物招领做了优先展示,请合理使用,并在找到后及时删除 10 | 7.平台免费使用,禁止发布任何推广内容,如需首页展示,请联系管理员 11 | 8.由于初版,可能在使用中出现错误,如果发布或者查看信息时出现问题,请及时联系我们 12 | 留言须知 13 | 14 | 1.平台尊重所有评论和留言者的言论自由,留言和评论内容只有拥有者和管理员可删除,其他人没有权限删除,请对自己的言论负责,对于具有攻击性的评论或留言,管理员有权删除,对于屡次违规,管理员将禁止使用平台功能 15 | 16 | 2.评论留言区禁止发布商品售卖、广告等无意义内容,如有发现,管理员有权删除,对于屡次违规,管理员将禁止使用平台功能 17 | 商业合作 18 | 1.如果你觉得平台还不错,想成为合作伙伴,请在我的界面联系我们 19 | 隐私须知 20 | 21 | 1.在发布时预留的手机号,仅用于后期出现问题时联系您,请如实填写,如无法联系将删除你的发布,对于你的信息标签(专业、分类、年级等)请根据实际情况选择,但是由于互联网的隐蔽性,信息标签仅供参考,不可当真 22 | 23 | 2.平台仅负责展示发布的信息,内容与平台无关,平台不负任何责任,请注意保护隐私 24 | -------------------------------------------------------------------------------- /前台源码/pages/agreement/agreement.wxss: -------------------------------------------------------------------------------- 1 | .container { 2 | padding: 10rpx; 3 | color: #999; 4 | } 5 | 6 | .container view { 7 | font-size: 28rpx; 8 | } -------------------------------------------------------------------------------- /前台源码/pages/category/category.js: -------------------------------------------------------------------------------- 1 | //index.js 2 | //获取应用实例 3 | const app = getApp() 4 | 5 | Page({ 6 | data: { 7 | // 组件所需的参数 8 | nvabarData: { 9 | showCapsule: 1, //是否显示左上角图标 1表示显示 0表示不显示 10 | title: '分类', //导航栏 中间的标题 11 | height: 0 12 | }, 13 | imageUrl:"", 14 | allCategoryMessage: [], 15 | search: "", 16 | floorstatus: "none", 17 | user_message: [], 18 | activeIndex: 1, 19 | isLastPage: false, //是否最后一页 20 | categoryId: -1, 21 | // 此页面 页面内容距最顶部的距离 22 | height: app.globalData.height * 2 + 20, 23 | isLoading: false 24 | }, 25 | activity_clear() { 26 | this.setData({ 27 | search: "" 28 | }) 29 | }, 30 | endsearchList: function(e) { 31 | let that = this; 32 | if (this.data.search.length < 2) { 33 | wx.showModal({ 34 | title: '提示', 35 | content: '至少输入两个字噢~', 36 | showCancel: false 37 | }) 38 | return; 39 | } 40 | wx.request({ 41 | url: getApp().globalData.url + '/search/' + that.data.categoryId + '/' + that.data.search, 42 | method: "post", 43 | success: function(e) { 44 | if (e.data.length == 0) { 45 | wx.showModal({ 46 | title: '提示', 47 | content: '没有搜到噢,换个关键词吧', 48 | }) 49 | return; 50 | } 51 | 52 | that.setData({ 53 | user_message: e.data, 54 | isLastPage: true 55 | }) 56 | } 57 | }) 58 | }, 59 | searchList: function(e) { 60 | let value = e.detail.detail.value; 61 | this.setData({ 62 | search: value 63 | }) 64 | }, 65 | onLoad(options) { 66 | 67 | 68 | this.setData({ 69 | allCategoryMessage: getApp().globalData.categoryMessage, 70 | imageUrl:getApp().globalData.imageUrl, 71 | }) 72 | this.setData({ 73 | height: app.globalData.height, 74 | categoryId: options.categoryId 75 | }) 76 | this.setData({ 77 | nvabarData: { 78 | showCapsule: 1, //是否显示左上角图标 1表示显示 0表示不显示 79 | title: options.categoryName, //导航栏 中间的标题 80 | height: 0 81 | } 82 | }) 83 | this.loadMessage(options.categoryId, 1) 84 | 85 | }, 86 | loadMessage(categoryId, page) { 87 | let that = this; 88 | 89 | var app = getApp() 90 | wx.request({ 91 | url: getApp().globalData.url + '/getMessage/getAllMessageDetail/' + categoryId + '/' + page, 92 | method: "POST", 93 | success: (res) => { 94 | if (res.data == 200) { 95 | that.setData({ 96 | isLastPage: true 97 | }) 98 | return; 99 | } 100 | that.setData({ 101 | user_message: that.data.user_message.concat(res.data) 102 | }) 103 | }, 104 | complete: function(res) { 105 | 106 | setTimeout(function() { 107 | that.setData({ 108 | isLoading: true 109 | }) 110 | }, 300) 111 | 112 | 113 | }, 114 | }) 115 | }, 116 | //一键返回顶部 117 | onPageScroll: function(e) { //判断滚轮位置 118 | if (e.scrollTop > 200) { 119 | this.setData({ 120 | floorstatus: "block" 121 | }); 122 | } else { 123 | this.setData({ 124 | floorstatus: "none" 125 | }); 126 | } 127 | }, 128 | goTop: function(e) { // 一键回到顶部 129 | if (wx.pageScrollTo) { 130 | wx.pageScrollTo({ 131 | scrollTop: 0 132 | }) 133 | } else { 134 | wx.showModal({ 135 | title: '提示', 136 | content: '当前微信版本过低,无法使用该功能,请升级到最新微信版本后重试。' 137 | }) 138 | } 139 | }, 140 | //跳转到详情页 141 | to_message_detail: function(e) { 142 | wx.navigateTo({ 143 | url: '/pages/message_detail/message_detail?messageId=' + e.currentTarget.id, 144 | }) 145 | }, 146 | onReachBottom: function(e) { 147 | // 最后一页了,取消下拉功能 148 | if (this.data.isLastPage) { 149 | return 150 | } 151 | this.loadMessage(this.data.categoryId, ++this.data.activeIndex) 152 | }, 153 | }) -------------------------------------------------------------------------------- /前台源码/pages/category/category.json: -------------------------------------------------------------------------------- 1 | { 2 | "usingComponents": { 3 | "nav-bar": "/components/navbar/index", 4 | "search": "/components/search/index" 5 | } 6 | } -------------------------------------------------------------------------------- /前台源码/pages/category/category.wxml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | {{item.userIdAnonymity==0?item.mangoUser.userNickname:"匿名用户"}} 34 | 35 | 36 | {{allCategoryMessage[item.categoryId-1].categoryName}} 37 | {{item.mangoUser.userGender==1?"小哥哥":"小姐姐"}} 38 | {{item.userMajor}} 39 | {{item.userLevel}}级 40 | 41 | 42 | 43 | 44 | 45 | 46 | {{item.messageDetail}} 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | {{item.messageShare}} 59 | {{item.messageComment}} 60 | 61 | 62 | 63 | {{item.messageWatch}} 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | ————————— End ————————— 73 | 74 | 75 | ————————— End ————————— 76 | 77 | 78 | 79 | 80 | 81 | 82 | 83 | 84 | 85 | -------------------------------------------------------------------------------- /前台源码/pages/index/index.json: -------------------------------------------------------------------------------- 1 | { 2 | "usingComponents": { 3 | "SearchBar": "/components/searchBox/index" 4 | } 5 | } -------------------------------------------------------------------------------- /前台源码/pages/me/me.json: -------------------------------------------------------------------------------- 1 | { 2 | "usingComponents": { 3 | "nav-bar": "/components/navbar/index" 4 | } 5 | } -------------------------------------------------------------------------------- /前台源码/pages/me_about/me_about.js: -------------------------------------------------------------------------------- 1 | //index.js 2 | //获取应用实例 3 | const app = getApp() 4 | 5 | Page({ 6 | data: { 7 | // 组件所需的参数 8 | nvabarData: { 9 | showCapsule: 1, //是否显示左上角图标 1表示显示 0表示不显示 10 | title: '关于程序', //导航栏 中间的标题 11 | height: 0 12 | }, 13 | 14 | // 此页面 页面内容距最顶部的距离 15 | height: app.globalData.height * 2 + 20, 16 | isLoading: false 17 | }, 18 | onLoad() { 19 | this.setData({ 20 | height: app.globalData.height 21 | }) 22 | }, 23 | onReady() { 24 | let that = this 25 | setTimeout(function() { 26 | that.setData({ 27 | isLoading: true 28 | }) 29 | }, 200) 30 | }, 31 | 32 | call() { 33 | wx.showModal({ 34 | title: '提示', 35 | content: '是否要联系我?', 36 | success: function(e) { 37 | if (e.confirm) { 38 | wx.makePhoneCall({ 39 | phoneNumber: '18996379281', 40 | }) 41 | } 42 | } 43 | }) 44 | } 45 | }) -------------------------------------------------------------------------------- /前台源码/pages/me_about/me_about.json: -------------------------------------------------------------------------------- 1 | { 2 | "usingComponents": { 3 | "nav-bar": "/components/navbar/index"} 4 | } -------------------------------------------------------------------------------- /前台源码/pages/me_about/me_about.wxml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 大家好!我叫 Xin-Felix(以下简称我),这是我经一月时间开发出的 芒果 New Life(以下简称小程序),首先非常感谢大家能够使用我写的小程序。 24 | 由于时间的问题,小程序并没有太多优秀的功能,但是我将大家平时使用的很多服务收集到当前的小程序,希望大家可以更方便的获取到最新咨询以及更好的商家服务。 25 | 26 | 如果后期使用人数理想,我将继续开发下去,如果在使用过程中遇到任何问题,或者对小程序有任何建议,请在第一时间联系我,我的手机号 27 | 18996379281 28 | 29 | 如果你不嫌弃我们,我们团队所有成员欢迎你的到来,你的到来将减少更多的开发时间,让我们更好的发展下去 30 | 31 | 32 | 33 | -------------------------------------------------------------------------------- /前台源码/pages/me_about/me_about.wxss: -------------------------------------------------------------------------------- 1 | page { 2 | background-color: white; 3 | width: 100%; 4 | height: 100%; 5 | } 6 | 7 | .main { 8 | display: flex; 9 | flex-direction: column; 10 | justify-content: center; 11 | } 12 | 13 | .main { 14 | width: 80%; 15 | margin: 0 auto; 16 | margin-top: 80rpx; 17 | text-align: center; 18 | } 19 | 20 | .avatar image { 21 | width: 220rpx; 22 | } 23 | 24 | .intro { 25 | font-weight: 200; 26 | font-size: 28rpx; 27 | text-align: left; 28 | text-indent: 60rpx; 29 | letter-spacing: 2rpx; 30 | color: #999; 31 | } -------------------------------------------------------------------------------- /前台源码/pages/me_canyu/me_canyu.js: -------------------------------------------------------------------------------- 1 | //index.js 2 | //获取应用实例 3 | const app = getApp() 4 | 5 | Page({ 6 | data: { 7 | // 组件所需的参数 8 | nvabarData: { 9 | showCapsule: 1, //是否显示左上角图标 1表示显示 0表示不显示 10 | title: '我的参与', //导航栏 中间的标题 11 | height: 0 12 | }, 13 | imageUrl:"", 14 | allCategoryMessage: [], 15 | userId: -1, 16 | activeIndex: 1, 17 | floorstatus: "none", 18 | user_message: [], 19 | 20 | // 此页面 页面内容距最顶部的距离 21 | height: app.globalData.height * 2 + 20, 22 | isLoading: false 23 | }, 24 | onReady() { 25 | let that = this 26 | setTimeout(function () { 27 | that.setData({ 28 | isLoading: true 29 | }) 30 | }, 500) 31 | }, 32 | //一键返回顶部 33 | onPageScroll: function(e) { //判断滚轮位置 34 | if (e.scrollTop > 200) { 35 | this.setData({ 36 | floorstatus: "block" 37 | }); 38 | } else { 39 | this.setData({ 40 | floorstatus: "none" 41 | }); 42 | } 43 | }, 44 | goTop: function(e) { // 一键回到顶部 45 | if (wx.pageScrollTo) { 46 | wx.pageScrollTo({ 47 | scrollTop: 0 48 | }) 49 | } else { 50 | wx.showModal({ 51 | title: '提示', 52 | content: '当前微信版本过低,无法使用该功能,请升级到最新微信版本后重试。' 53 | }) 54 | } 55 | }, 56 | onLoad() { 57 | let that = this 58 | this.setData({ 59 | allCategoryMessage: getApp().globalData.categoryMessage, 60 | imageUrl:getApp().globalData.imageUrl, 61 | }) 62 | this.setData({ 63 | height: app.globalData.height 64 | }) 65 | this.setData({ 66 | userId: getApp().globalData.userId 67 | }) 68 | this.loadMessage(1) 69 | 70 | }, 71 | loadMessage(index) { 72 | wx.showLoading({ 73 | title: '加载中~', 74 | }) 75 | var that = this; 76 | var app = getApp() 77 | wx.request({ 78 | url: getApp().globalData.url + '/getMessage/getAttendMessageByUserId/' + that.data.userId + '/' + index, 79 | method: "POST", 80 | success: (res) => { 81 | if (res.data == 200) { 82 | that.setData({ 83 | isLastPage: true 84 | }) 85 | return; 86 | } 87 | that.setData({ 88 | user_message: that.data.user_message.concat(res.data) 89 | }) 90 | }, 91 | complete: function(res) { 92 | wx.hideLoading(); 93 | }, 94 | }) 95 | }, 96 | /** 97 | * 页面上拉触底事件的处理函数 98 | */ 99 | onReachBottom: function() { 100 | // 最后一页了,取消下拉功能 101 | if (this.data.isLastPage) { 102 | return 103 | } 104 | this.loadMessage(++this.data.activeIndex) 105 | }, 106 | 107 | //跳转到详情页 108 | to_message_detail: function(e) { 109 | wx.navigateTo({ 110 | url: '/pages/message_detail/message_detail?messageId=' + e.currentTarget.id, 111 | }) 112 | }, 113 | }) -------------------------------------------------------------------------------- /前台源码/pages/me_canyu/me_canyu.json: -------------------------------------------------------------------------------- 1 | { 2 | "usingComponents": { 3 | "nav-bar": "/components/navbar/index" 4 | } 5 | } -------------------------------------------------------------------------------- /前台源码/pages/me_canyu/me_canyu.wxml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | {{item.userIdAnonymity==0?item.mangoUser.userNickname:"匿名用户"}} 31 | 32 | 33 | {{allCategoryMessage[item.categoryId-1].categoryName}} 34 | {{item.mangoUser.userGender==1?"小哥哥":"小姐姐"}} 35 | {{item.userMajor}} 36 | {{item.userLevel}}级 37 | 38 | 39 | 40 | 41 | 42 | 43 | {{item.messageDetail}} 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | {{item.messageShare}} 56 | {{item.messageComment}} 57 | 58 | 59 | 60 | {{item.messageWatch}} 61 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | ————————— End ————————— 70 | 71 | 72 | ————————— End ————————— 73 | 74 | 75 | 76 | 77 | 78 | 79 | 80 | 81 | -------------------------------------------------------------------------------- /前台源码/pages/me_fabu/me_fabu.json: -------------------------------------------------------------------------------- 1 | { 2 | "usingComponents": { 3 | "nav-bar": "/components/navbar/index" 4 | } 5 | } -------------------------------------------------------------------------------- /前台源码/pages/me_shoucang/me_shoucang.js: -------------------------------------------------------------------------------- 1 | //index.js 2 | //获取应用实例 3 | const app = getApp() 4 | 5 | Page({ 6 | data: { 7 | // 组件所需的参数 8 | nvabarData: { 9 | showCapsule: 1, //是否显示左上角图标 1表示显示 0表示不显示 10 | title: '我的收藏', //导航栏 中间的标题 11 | height: 0 12 | }, 13 | imageUrl:"", 14 | allCategoryMessage: [], 15 | userId: -1, 16 | activeIndex: 1, 17 | floorstatus: "none", 18 | user_message: [], 19 | floorstatus: "none", 20 | 21 | // 此页面 页面内容距最顶部的距离 22 | height: app.globalData.height * 2 + 20, 23 | isLoading: false 24 | }, 25 | onReady() { 26 | let that = this 27 | setTimeout(function() { 28 | that.setData({ 29 | isLoading: true 30 | }) 31 | }, 500) 32 | }, 33 | onLoad() { 34 | let that = this 35 | this.setData({ 36 | imageUrl:getApp().globalData.imageUrl, 37 | allCategoryMessage: getApp().globalData.categoryMessage 38 | }) 39 | this.setData({ 40 | height: app.globalData.height 41 | }) 42 | this.setData({ 43 | userId: getApp().globalData.userId 44 | }) 45 | this.loadMessage(1) 46 | 47 | 48 | }, 49 | loadMessage(index) { 50 | wx.showLoading({ 51 | title: '加载中~', 52 | }) 53 | var that = this; 54 | var app = getApp() 55 | wx.request({ 56 | url: getApp().globalData.url + '/getMessage/getAllCollectionMessageByUserId/' + that.data.userId + '/' + index, 57 | method: "POST", 58 | success: (res) => { 59 | if (res.data == 200) { 60 | that.setData({ 61 | isLastPage: true 62 | }) 63 | return; 64 | } 65 | that.setData({ 66 | user_message: that.data.user_message.concat(res.data) 67 | }) 68 | }, 69 | complete: function(res) { 70 | wx.hideLoading(); 71 | }, 72 | }) 73 | }, 74 | /** 75 | * 页面上拉触底事件的处理函数 76 | */ 77 | onReachBottom: function() { 78 | // 最后一页了,取消下拉功能 79 | if (this.data.isLastPage) { 80 | return 81 | } 82 | this.loadMessage(++this.data.activeIndex) 83 | }, 84 | //一键返回顶部 85 | onPageScroll: function(e) { //判断滚轮位置 86 | if (e.scrollTop > 200) { 87 | this.setData({ 88 | floorstatus: "block" 89 | }); 90 | } else { 91 | this.setData({ 92 | floorstatus: "none" 93 | }); 94 | } 95 | }, 96 | 97 | goTop: function(e) { // 一键回到顶部 98 | if (wx.pageScrollTo) { 99 | wx.pageScrollTo({ 100 | scrollTop: 0 101 | }) 102 | } else { 103 | wx.showModal({ 104 | title: '提示', 105 | content: '当前微信版本过低,无法使用该功能,请升级到最新微信版本后重试。' 106 | }) 107 | } 108 | }, //跳转到详情页 109 | to_message_detail: function(e) { 110 | wx.navigateTo({ 111 | url: '/pages/message_detail/message_detail?messageId=' + e.currentTarget.id, 112 | }) 113 | }, 114 | }) -------------------------------------------------------------------------------- /前台源码/pages/me_shoucang/me_shoucang.json: -------------------------------------------------------------------------------- 1 | { 2 | "usingComponents": { 3 | "nav-bar": "/components/navbar/index" 4 | } 5 | } -------------------------------------------------------------------------------- /前台源码/pages/me_shoucang/me_shoucang.wxml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | {{item.userIdAnonymity==0?item.mangoUser.userNickname:"匿名用户"}} 31 | 32 | 33 | {{allCategoryMessage[item.categoryId-1].categoryName}} 34 | {{item.mangoUser.userGender==1?"小哥哥":"小姐姐"}} 35 | {{item.userMajor}} 36 | {{item.userLevel}}级 37 | 38 | 39 | 40 | 41 | 42 | 43 | {{item.messageDetail}} 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | {{item.messageShare}} 56 | {{item.messageComment}} 57 | 58 | 59 | 60 | {{item.messageWatch}} 61 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | ————————— End ————————— 70 | 71 | 72 | ————————— End ————————— 73 | 74 | 75 | 76 | 77 | 78 | 79 | 80 | 81 | 82 | -------------------------------------------------------------------------------- /前台源码/pages/me_xiaoxi/me_xiaoxi.js: -------------------------------------------------------------------------------- 1 | //index.js 2 | //获取应用实例 3 | const app = getApp() 4 | 5 | Page({ 6 | data: { 7 | // 组件所需的参数 8 | nvabarData: { 9 | showCapsule: 1, //是否显示左上角图标 1表示显示 0表示不显示 10 | title: '我的消息', //导航栏 中间的标题 11 | height: 0 12 | }, 13 | floorstatus: "none", 14 | activeIndex: 1, 15 | isLastPage: false, //是否最后一页 16 | me_message: [], 17 | userId: -1, 18 | messageType: [ 19 | "有新留言啦~", 20 | "有新回复啦~", 21 | "管理员回复" 22 | ], 23 | // 此页面 页面内容距最顶部的距离 24 | height: app.globalData.height * 2 + 20, 25 | isLoading: false 26 | }, 27 | onReady() { 28 | let that = this 29 | setTimeout(function() { 30 | that.setData({ 31 | isLoading: true 32 | }) 33 | }, 500) 34 | 35 | 36 | 37 | 38 | }, 39 | onLoad() { 40 | 41 | this.setData({ 42 | height: app.globalData.height 43 | }) 44 | this.setData({ 45 | userId: app.globalData.userId 46 | }) 47 | this.loadMessage(1); 48 | 49 | }, 50 | /** 51 | * 页面上拉触底事件的处理函数 52 | */ 53 | onReachBottom: function() { 54 | // 最后一页了,取消下拉功能 55 | if (this.data.isLastPage) { 56 | return 57 | } 58 | this.loadMessage(++this.data.activeIndex) 59 | }, 60 | loadMessage(index) { 61 | 62 | wx.showLoading({ 63 | title: '加载中~', 64 | }) 65 | let that = this; 66 | wx.request({ 67 | url: getApp().globalData.url + '/getMessage/getAllNewMessage/' + that.data.userId + '/' + index, 68 | method: "post", 69 | success: function(e) { 70 | 71 | if (e.statusCode != 200) { 72 | wx.showModal({ 73 | title: '提示', 74 | content: '出错啦,请稍后再试~', 75 | }) 76 | return; 77 | } 78 | if (e.data == 200) { 79 | that.setData({ 80 | isLastPage: true 81 | }) 82 | return; 83 | } 84 | 85 | that.setData({ 86 | me_message: that.data.me_message.concat(e.data) 87 | }) 88 | }, 89 | complete: function() { 90 | wx.hideLoading() 91 | wx.setStorage({ 92 | key: 'lastNewMessage', 93 | data: that.data.me_message[0].newMessageId, 94 | }) 95 | } 96 | }) 97 | }, 98 | to_message_detail: function(e) { 99 | wx.navigateTo({ 100 | url: '/pages/message_detail/message_detail?messageId=' + e.currentTarget.id, 101 | }) 102 | }, 103 | 104 | //一键返回顶部 105 | onPageScroll: function(e) { //判断滚轮位置 106 | if (e.scrollTop > 200) { 107 | this.setData({ 108 | floorstatus: "block" 109 | }); 110 | } else { 111 | this.setData({ 112 | floorstatus: "none" 113 | }); 114 | } 115 | }, 116 | goTop: function(e) { // 一键回到顶部 117 | if (wx.pageScrollTo) { 118 | wx.pageScrollTo({ 119 | scrollTop: 0 120 | }) 121 | } else { 122 | wx.showModal({ 123 | title: '提示', 124 | content: '当前微信版本过低,无法使用该功能,请升级到最新微信版本后重试。' 125 | }) 126 | } 127 | }, 128 | }) -------------------------------------------------------------------------------- /前台源码/pages/me_xiaoxi/me_xiaoxi.json: -------------------------------------------------------------------------------- 1 | { 2 | "usingComponents": { 3 | "nav-bar": "/components/navbar/index" 4 | } 5 | } -------------------------------------------------------------------------------- /前台源码/pages/me_xiaoxi/me_xiaoxi.wxml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | {{messageType[item.newMessageType-1]}} 22 | {{item.newMessageTime}} 23 | 24 | {{item.newMessageDetail}} 25 | 查看详情 26 | 27 | 28 | 29 | 30 | ————————— End ————————— 31 | 32 | 33 | ————————— End ————————— 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | -------------------------------------------------------------------------------- /前台源码/pages/me_xiaoxi/me_xiaoxi.wxss: -------------------------------------------------------------------------------- 1 | .message_item { 2 | display: flex; 3 | flex-direction: column; 4 | position: relative; 5 | margin-top: 10rpx; 6 | } 7 | 8 | .back { 9 | background-color: white; 10 | padding: 10rpx; 11 | } 12 | 13 | .title { 14 | display: flex; 15 | flex-direction: row; 16 | justify-content: space-between; 17 | } 18 | 19 | .main_title { 20 | font-weight: 800; 21 | } 22 | 23 | .main_time { 24 | font-weight: 200; 25 | font-size: 25rpx; 26 | color: #999; 27 | } 28 | 29 | .message_detail { 30 | height: 80rpx; 31 | font-size: 28rpx; 32 | overflow: hidden; 33 | /*超出部分隐藏*/ 34 | text-overflow: ellipsis; 35 | /* 超出部分显示省略号 */ 36 | white-space: nowrap; 37 | /*规定段落中的文本不进行换行 */ 38 | } 39 | 40 | .message_operation { 41 | position: absolute; 42 | right: 10rpx; 43 | bottom: 0; 44 | color: #999; 45 | } 46 | 47 | .goTop { 48 | height: 80rpx; 49 | width: 80rpx; 50 | position: fixed; 51 | bottom: 50rpx; 52 | right: 30rpx; 53 | } -------------------------------------------------------------------------------- /前台源码/pages/message_detail/message_detail.json: -------------------------------------------------------------------------------- 1 | { 2 | "usingComponents": { 3 | "nav-bar": "/components/navbar/index" 4 | } 5 | } -------------------------------------------------------------------------------- /前台源码/pages/search/search.js: -------------------------------------------------------------------------------- 1 | //index.js 2 | //获取应用实例 3 | const app = getApp() 4 | 5 | Page({ 6 | data: { 7 | // 组件所需的参数 8 | nvabarData: { 9 | showCapsule: 1, //是否显示左上角图标 1表示显示 0表示不显示 10 | title: '搜索', //导航栏 中间的标题 11 | height: 0 12 | }, 13 | imageUrl:"", 14 | allCategoryMessage: [], 15 | search: "", 16 | activeIndex: 1, 17 | isLastPage: false, //是否最后一页 18 | // 此页面 页面内容距最顶部的距离 19 | 20 | user_message: [], 21 | height: app.globalData.height * 2 + 20, 22 | }, 23 | searchList: function(e) { 24 | let value = e.detail.detail.value; 25 | this.setData({ 26 | search: value 27 | }) 28 | }, 29 | endsearchList: function(e) { 30 | let that = this; 31 | if (this.data.search.length < 2) { 32 | wx.showModal({ 33 | title: '提示', 34 | content: '至少输入两个字噢~', 35 | showCancel: false 36 | }) 37 | return; 38 | } 39 | that.setData({ 40 | user_message: [] 41 | }) 42 | this.loadMessage(that.data.search, 1) 43 | 44 | }, 45 | /** 46 | * 页面上拉触底事件的处理函数 47 | */ 48 | onReachBottom: function() { 49 | // 最后一页了,取消下拉功能 50 | if (this.data.isLastPage) { 51 | return 52 | } 53 | this.loadMessage(this.data.search, ++this.data.activeIndex) 54 | }, 55 | 56 | loadMessage(keyword, index) { 57 | let that = this; 58 | wx.request({ 59 | url: getApp().globalData.url + '/searchByKeyword/' + that.data.search + '/' + index, 60 | method: "post", 61 | success: function(e) { 62 | if (e.data.length == 0) { 63 | wx.showModal({ 64 | title: '提示', 65 | content: '没有搜到噢,换个关键词吧', 66 | }) 67 | return; 68 | } 69 | if (e.data == 200) { 70 | that.setData({ 71 | isLastPage: true 72 | }) 73 | return; 74 | } 75 | that.setData({ 76 | user_message: that.data.user_message.concat(e.data) 77 | }) 78 | } 79 | }) 80 | }, //跳转到详情页 81 | to_message_detail: function(e) { 82 | wx.navigateTo({ 83 | url: '/pages/message_detail/message_detail?messageId=' + e.currentTarget.id, 84 | }) 85 | }, 86 | onLoad() { 87 | /** 88 | * 分类信息 89 | */ 90 | this.setData({ 91 | allCategoryMessage: getApp().globalData.categoryMessage, 92 | imageUrl:getApp().globalData.imageUrl, 93 | }) 94 | this.setData({ 95 | height: app.globalData.height 96 | }) 97 | } 98 | }) -------------------------------------------------------------------------------- /前台源码/pages/search/search.json: -------------------------------------------------------------------------------- 1 | { 2 | "usingComponents": { 3 | "nav-bar": "/components/navbar/index", 4 | "search": "/components/search/index" 5 | } 6 | } -------------------------------------------------------------------------------- /前台源码/pages/search/search.wxml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | {{item.mangoUser.userNickname}} 19 | 20 | 21 | {{allCategoryMessage[item.categoryId-1].categoryName}} 22 | {{item.mangoUser.userGender==1?"小哥哥":"小姐姐"}} 23 | {{item.userMajor}} 24 | {{item.userLevel}}级 25 | 26 | 27 | 28 | 29 | 30 | 31 | {{item.messageDetail}} 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | {{item.messageShare}} 44 | {{item.messageComment}} 45 | 46 | 47 | 48 | {{item.messageWatch}} 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | ————————— End ————————— 58 | 59 | 60 | ————————— End ————————— 61 | 62 | -------------------------------------------------------------------------------- /前台源码/pages/shop/shop.js: -------------------------------------------------------------------------------- 1 | //index.js 2 | //获取应用实例 3 | const app = getApp() 4 | 5 | Page({ 6 | data: { 7 | // 组件所需的参数 8 | nvabarData: { 9 | showCapsule: 0, //是否显示左上角图标 1表示显示 0表示不显示 10 | title: '小店', //导航栏 中间的标题 11 | height: 0 12 | }, 13 | shopMessage: [], 14 | 15 | // 此页面 页面内容距最顶部的距离 16 | height: app.globalData.height * 2 + 20, 17 | isLoading: false 18 | }, 19 | onLoad() { 20 | this.setData({ 21 | height: app.globalData.height 22 | }) 23 | this.setData({ 24 | shopMessage: getApp().globalData.shopMessage 25 | }) 26 | 27 | }, 28 | onReady() { 29 | let that = this 30 | setTimeout(function() { 31 | that.setData({ 32 | isLoading: true 33 | }) 34 | }, 500) 35 | }, 36 | call(e) { 37 | wx.showModal({ 38 | title: '提示', 39 | content: '是否联系(' + e.target.id + ")", 40 | cancelText: '取消', 41 | confirmText: '确定', 42 | confirmColor: '#3CC51F', 43 | success: (result) => { 44 | if (result.confirm) { 45 | wx.makePhoneCall({ 46 | phoneNumber: e.target.id, 47 | }) 48 | } 49 | }, 50 | 51 | }); 52 | 53 | 54 | }, 55 | to_look(e) { 56 | wx.navigateTo({ 57 | url: '/pages/shop_detail/shop_detail?shopId=' + e.target.id, 58 | }) 59 | } 60 | }) -------------------------------------------------------------------------------- /前台源码/pages/shop/shop.json: -------------------------------------------------------------------------------- 1 | { 2 | "usingComponents": { 3 | "nav-bar": "/components/navbar/index" } 4 | } -------------------------------------------------------------------------------- /前台源码/pages/shop/shop.wxml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | {{item.shopName}} 24 | 25 | 26 | {{item.shopIntro}} 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 空空如也,快来联系我们吧~ 38 | 39 | -------------------------------------------------------------------------------- /前台源码/pages/shop/shop.wxss: -------------------------------------------------------------------------------- 1 | page { 2 | height: 100%; 3 | width: 100%; 4 | } 5 | 6 | .goods_center { 7 | display: flex; 8 | flex-direction: row; 9 | flex-wrap: wrap; 10 | } 11 | 12 | .goods_left image { 13 | width: 250rpx; 14 | border-radius: 10rpx; 15 | } 16 | 17 | .goods_center { 18 | margin-top: 10rpx; 19 | padding: 10rpx; 20 | background-color: white; 21 | } 22 | 23 | .goods_title .title { 24 | font-weight: 800; 25 | } 26 | 27 | .goods_rigth { 28 | padding: 10rpx; 29 | display: flex; 30 | flex-direction: column; 31 | justify-content: space-between; 32 | width: 460rpx; 33 | } 34 | 35 | .goods_intro { 36 | flex-grow: 2; 37 | font-size: 25rpx; 38 | letter-spacing: 2rpx; 39 | text-overflow: ellipsis; 40 | display: -webkit-box; 41 | -webkit-line-clamp: 4; 42 | -webkit-box-orient: vertical; 43 | overflow: hidden; 44 | } 45 | 46 | .operation { 47 | display: flex; 48 | flex-direction: row; 49 | } 50 | 51 | .goods_bottom button { 52 | background-color: #3cc; 53 | width: 100%; 54 | font-weight: 800; 55 | font-size: 30rpx; 56 | color: white; 57 | line-height: 60rpx; 58 | } 59 | -------------------------------------------------------------------------------- /前台源码/pages/shop_detail/shop_detail.js: -------------------------------------------------------------------------------- 1 | //index.js 2 | //获取应用实例 3 | const app = getApp() 4 | 5 | Page({ 6 | data: { 7 | // 组件所需的参数 8 | nvabarData: { 9 | showCapsule: 1, //是否显示左上角图标 1表示显示 0表示不显示 10 | title: '店面详情', //导航栏 中间的标题 11 | height: 0 12 | }, 13 | markers: [], 14 | shopMessage: {}, 15 | // 此页面 页面内容距最顶部的距离 16 | height: app.globalData.height * 2 + 20, 17 | isLoading: false 18 | }, 19 | onLoad(options) { 20 | 21 | let that = this 22 | this.setData({ 23 | height: app.globalData.height 24 | }) 25 | 26 | wx.request({ 27 | url: getApp().globalData.url + '/getMessage/getShopMessage/' + options.shopId, 28 | method: "post", 29 | success: function(e) { 30 | if (e.statusCode != 200) { 31 | wx.showModal({ 32 | title: '错误', 33 | content: '出现错误啦,请联系管理员', 34 | }) 35 | return; 36 | } 37 | that.setData({ 38 | shopMessage: e.data 39 | }) 40 | }, 41 | complete: function() { 42 | 43 | that.setData({ 44 | markers: [{ 45 | iconPath: "../../images/other/mark.png", 46 | id: 0, 47 | latitude: that.data.shopMessage.shopLatitude, 48 | longitude: that.data.shopMessage.shopLongitude, 49 | width: 20, 50 | height: 40, 51 | title: "【 " + that.data.shopMessage.shopName + "】芒果微校园合作伙伴", 52 | }] 53 | }) 54 | 55 | setTimeout(function() { 56 | that.setData({ 57 | isLoading: true 58 | }) 59 | }, 300) 60 | 61 | } 62 | 63 | }) 64 | 65 | 66 | }, 67 | 68 | to_index() { 69 | wx.switchTab({ 70 | url: '/pages/index/index', 71 | }) 72 | }, 73 | onShareAppMessage() { 74 | return { 75 | title: "看看这家店,还不错~" 76 | } 77 | }, 78 | look_image(e) { 79 | wx.previewImage({ 80 | urls: [e.target.id] 81 | }) 82 | }, 83 | call(e) { 84 | wx.showModal({ 85 | title: '提示', 86 | content: '是否联系(' + e.target.id + ")", 87 | showCancel: true, 88 | cancelText: '取消', 89 | confirmText: '确定', 90 | success: (result) => { 91 | if (result.confirm) { 92 | wx.makePhoneCall({ 93 | phoneNumber: e.target.id, 94 | }); 95 | } 96 | }, 97 | }); 98 | } 99 | }) -------------------------------------------------------------------------------- /前台源码/pages/shop_detail/shop_detail.json: -------------------------------------------------------------------------------- 1 | { 2 | "usingComponents": { 3 | "nav-bar": "/components/navbar/index"} 4 | } -------------------------------------------------------------------------------- /前台源码/pages/shop_detail/shop_detail.wxml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | {{shopMessage.shopName}} 31 | 32 | 合作时间:{{shopMessage.shopCreatTime}} 33 | 34 | 35 | 36 | 37 | {{shopMessage.shopIntro}} 38 | 39 | 40 | 主营商品 41 | 42 | 43 | 44 | 45 | 46 | 47 | {{item.shopGoodsTitle}} 48 | {{item.shopGoodsPrice}}元 49 | 50 | 51 | 52 | 53 | 54 | 位置 55 | 56 | 57 | 58 | 59 | 60 | ·以上信息均由管理员整理 61 | ·如出现问题请及时联系管理员 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 立即联系 70 | 71 | -------------------------------------------------------------------------------- /前台源码/pages/welcome/welcome.js: -------------------------------------------------------------------------------- 1 | // pages/welcome/welcome.js 2 | Page({ 3 | 4 | /** 5 | * 页面的初始数据 6 | */ 7 | data: { 8 | time: 5, 9 | isLoad: -1, 10 | }, 11 | 12 | /** 13 | * 生命周期函数--监听页面加载 14 | */ 15 | onLoad: function(options) { 16 | var that = this; 17 | that.setData({ 18 | time: --that.data.time 19 | }) 20 | 21 | if (getApp().globalData.messageDetail.length != 0 && getApp().globalData.swiperImages.length != 0) { 22 | that.setData({ 23 | isLoad: 1 24 | }) 25 | } 26 | 27 | if (that.data.time == 0) { 28 | that.setData({ 29 | time: 0 30 | }) 31 | 32 | if (that.data.isLoad != 1) { 33 | wx.showModal({ 34 | title: '提示', 35 | content: '网络链接较慢或服务器正在维护中,请稍后再试', 36 | }) 37 | return 38 | } 39 | wx.switchTab({ 40 | url: '/pages/index/index', 41 | }) 42 | } 43 | setTimeout(function() { 44 | that.onLoad(); 45 | //循环代码 46 | }, 1000) 47 | }, 48 | next() { 49 | let that = this; 50 | if (that.data.isLoad != 1) { 51 | wx.showModal({ 52 | title: '提示', 53 | content: '服务器维护中,请稍后再试', 54 | }) 55 | clearInterval(this.onLoad()); 56 | that.setData({ 57 | time: 0 58 | }) 59 | return 60 | } 61 | clearInterval(this.onLoad()); 62 | wx.switchTab({ 63 | url: '/pages/index/index', 64 | }) 65 | }, 66 | /** 67 | * 用户点击右上角分享 68 | */ 69 | onShareAppMessage: function() { 70 | return { 71 | title: "芒果新生活,便利你的生活", 72 | imageUrl: "../../images/other/logo.png" 73 | } 74 | 75 | } 76 | }) -------------------------------------------------------------------------------- /前台源码/pages/welcome/welcome.json: -------------------------------------------------------------------------------- 1 | { 2 | "usingComponents": {} 3 | } -------------------------------------------------------------------------------- /前台源码/pages/welcome/welcome.wxml: -------------------------------------------------------------------------------- 1 | 2 | 3 | {{time}} 跳过 4 | 5 | 6 | 7 | 10 | 11 | 芒果 New Life 12 | 便利你的生活 13 | 14 | 15 | -------------------------------------------------------------------------------- /前台源码/pages/welcome/welcome.wxss: -------------------------------------------------------------------------------- 1 | .bg image { 2 | display: block; 3 | width: 100%; 4 | height: 100%; 5 | position: fixed; 6 | top: 0; 7 | z-index: -999; 8 | } 9 | 10 | .myButton { 11 | position: fixed; 12 | z-index: 9999999; 13 | bottom: 230rpx; 14 | width: 130rpx; 15 | right: 30rpx; 16 | padding: 20rpx; 17 | border-radius: 60rpx; 18 | border: 1rpx solid #999; 19 | text-align: center; 20 | font-weight: 600; 21 | color: #999; 22 | background-color: rgba(240, 240, 240, 0.5); 23 | } 24 | 25 | .bottom { 26 | position: fixed; 27 | bottom: 0; 28 | left: 0; 29 | background-color: white; 30 | height: 200rpx; 31 | width: 100%; 32 | } 33 | 34 | .logo image { 35 | width: 150rpx; 36 | } 37 | 38 | .main { 39 | display: flex; 40 | flex-direction: row; 41 | align-items: center; 42 | justify-content: center; 43 | } 44 | 45 | .detail { 46 | display: flex; 47 | flex-direction: column; 48 | justify-content: space-between; 49 | } 50 | 51 | .detail .title { 52 | font-size: 30rpx; 53 | font-weight: 800; 54 | letter-spacing: 5rpx; 55 | } 56 | 57 | .detail .intro { 58 | font-size: 28rpx; 59 | font-weight: 200; 60 | letter-spacing: 5rpx; 61 | } -------------------------------------------------------------------------------- /前台源码/project.config.json: -------------------------------------------------------------------------------- 1 | { 2 | "description": "项目配置文件", 3 | "packOptions": { 4 | "ignore": [] 5 | }, 6 | "setting": { 7 | "urlCheck": false, 8 | "es6": true, 9 | "enhance": false, 10 | "postcss": true, 11 | "preloadBackgroundData": false, 12 | "minified": true, 13 | "newFeature": true, 14 | "coverView": true, 15 | "autoAudits": false, 16 | "showShadowRootInWxmlPanel": true, 17 | "scopeDataCheck": false, 18 | "uglifyFileName": true, 19 | "checkInvalidKey": true, 20 | "checkSiteMap": false, 21 | "uploadWithSourceMap": true, 22 | "babelSetting": { 23 | "ignore": [], 24 | "disablePlugins": [], 25 | "outputPath": "" 26 | } 27 | }, 28 | "compileType": "miniprogram", 29 | "libVersion": "2.8.0", 30 | "appid": "wxe0bc4659bcdffd95", 31 | "projectname": "%E8%8A%92%E6%9E%9CNew%20Life", 32 | "debugOptions": { 33 | "hidedInDevtools": [] 34 | }, 35 | "isGameTourist": false, 36 | "simulatorType": "wechat", 37 | "simulatorPluginLibVersion": {}, 38 | "condition": { 39 | "search": { 40 | "current": -1, 41 | "list": [] 42 | }, 43 | "conversation": { 44 | "current": -1, 45 | "list": [] 46 | }, 47 | "plugin": { 48 | "current": -1, 49 | "list": [] 50 | }, 51 | "game": { 52 | "currentL": -1, 53 | "list": [] 54 | }, 55 | "miniprogram": { 56 | "current": 0, 57 | "list": [ 58 | { 59 | "id": 0, 60 | "name": "pages/message_detail/message_detail", 61 | "pathName": "pages/me/me", 62 | "query": "messageId=45", 63 | "scene": null 64 | } 65 | ] 66 | } 67 | } 68 | } -------------------------------------------------------------------------------- /前台源码/sitemap.json: -------------------------------------------------------------------------------- 1 | { 2 | "desc": "关于本文件的更多信息,请参考文档 https://developers.weixin.qq.com/miniprogram/dev/framework/sitemap.html", 3 | "rules": [{ 4 | "action": "allow", 5 | "page": "*" 6 | }] 7 | } -------------------------------------------------------------------------------- /前台源码/utils/config.js: -------------------------------------------------------------------------------- 1 | var fileHost = "https://*.aliyuncs.com/"; //你的阿里云地址最后面跟上一个/ 在你当前小程序的后台的uploadFile 合法域名也要配上这个域名 2 | var config = { 3 | //aliyun OSS config 4 | uploadImageUrl: `${fileHost}`, // 默认存在根目录,可根据需求改 5 | //这两个你可以去阿里云购买,也就几块钱,测试没什么问题,我的就不公布了 6 | AccessKeySecret: '', // AccessKeySecret 去你的阿里云上控制台上找 7 | OSSAccessKeyId: '', // AccessKeyId 去你的阿里云上控制台上找 8 | timeout: 87600 //这个是上传文件时Policy的失效时间 9 | }; 10 | module.exports = config 11 | -------------------------------------------------------------------------------- /前台源码/utils/hmac.js: -------------------------------------------------------------------------------- 1 | const Crypto = require('./crypto.js'); 2 | 3 | (function(){ 4 | 5 | // Shortcut 6 | var util = Crypto.util; 7 | 8 | Crypto.HMAC = function (hasher, message, key, options) { 9 | 10 | // Allow arbitrary length keys 11 | key = key.length > hasher._blocksize * 4 ? 12 | hasher(key, { asBytes: true }) : 13 | util.stringToBytes(key); 14 | 15 | // XOR keys with pad constants 16 | var okey = key, 17 | ikey = key.slice(0); 18 | for (var i = 0; i < hasher._blocksize * 4; i++) { 19 | okey[i] ^= 0x5C; 20 | ikey[i] ^= 0x36; 21 | } 22 | 23 | var hmacbytes = hasher(util.bytesToString(okey) + 24 | hasher(util.bytesToString(ikey) + message, { asString: true }), 25 | { asBytes: true }); 26 | return options && options.asBytes ? hmacbytes : 27 | options && options.asString ? util.bytesToString(hmacbytes) : 28 | util.bytesToHex(hmacbytes); 29 | 30 | }; 31 | 32 | })(); 33 | 34 | module.exports = Crypto; -------------------------------------------------------------------------------- /前台源码/utils/sha1.js: -------------------------------------------------------------------------------- 1 | const Crypto = require('./crypto.js'); 2 | 3 | (function(){ 4 | 5 | // Shortcut 6 | var util = Crypto.util; 7 | 8 | // Public API 9 | var SHA1 = Crypto.SHA1 = function (message, options) { 10 | var digestbytes = util.wordsToBytes(SHA1._sha1(message)); 11 | return options && options.asBytes ? digestbytes : 12 | options && options.asString ? util.bytesToString(digestbytes) : 13 | util.bytesToHex(digestbytes); 14 | }; 15 | 16 | // The core 17 | SHA1._sha1 = function (message) { 18 | 19 | var m = util.stringToWords(message), 20 | l = message.length * 8, 21 | w = [], 22 | H0 = 1732584193, 23 | H1 = -271733879, 24 | H2 = -1732584194, 25 | H3 = 271733878, 26 | H4 = -1009589776; 27 | 28 | // Padding 29 | m[l >> 5] |= 0x80 << (24 - l % 32); 30 | m[((l + 64 >>> 9) << 4) + 15] = l; 31 | 32 | for (var i = 0; i < m.length; i += 16) { 33 | 34 | var a = H0, 35 | b = H1, 36 | c = H2, 37 | d = H3, 38 | e = H4; 39 | 40 | for (var j = 0; j < 80; j++) { 41 | 42 | if (j < 16) w[j] = m[i + j]; 43 | else { 44 | var n = w[j-3] ^ w[j-8] ^ w[j-14] ^ w[j-16]; 45 | w[j] = (n << 1) | (n >>> 31); 46 | } 47 | 48 | var t = ((H0 << 5) | (H0 >>> 27)) + H4 + (w[j] >>> 0) + ( 49 | j < 20 ? (H1 & H2 | ~H1 & H3) + 1518500249 : 50 | j < 40 ? (H1 ^ H2 ^ H3) + 1859775393 : 51 | j < 60 ? (H1 & H2 | H1 & H3 | H2 & H3) - 1894007588 : 52 | (H1 ^ H2 ^ H3) - 899497514); 53 | 54 | H4 = H3; 55 | H3 = H2; 56 | H2 = (H1 << 30) | (H1 >>> 2); 57 | H1 = H0; 58 | H0 = t; 59 | 60 | } 61 | 62 | H0 += a; 63 | H1 += b; 64 | H2 += c; 65 | H3 += d; 66 | H4 += e; 67 | 68 | } 69 | 70 | return [H0, H1, H2, H3, H4]; 71 | 72 | }; 73 | 74 | // Package private blocksize 75 | SHA1._blocksize = 16; 76 | 77 | })(); 78 | 79 | module.exports = Crypto; -------------------------------------------------------------------------------- /前台源码/utils/uploadFile.js: -------------------------------------------------------------------------------- 1 | const env = require('config.js'); //配置文件,在这文件里配置你的OSS keyId和KeySecret,timeout:87600; 2 | 3 | const base64 = require('base64.js'); //Base64,hmac,sha1,crypto相关算法 4 | require('hmac.js'); 5 | require('sha1.js'); 6 | const Crypto = require('crypto.js'); 7 | 8 | /* 9 | *上传文件到阿里云oss 10 | *@param - filePath :图片的本地资源路径 11 | *@param - dir:表示要传到哪个目录下 12 | *@param - successc:成功回调 13 | *@param - failc:失败回调 14 | */ 15 | const uploadFile = function(filePath, dir, successc, failc) { 16 | if (!filePath || filePath.length < 9) { 17 | wx.showModal({ 18 | title: '图片错误', 19 | content: '请重试', 20 | showCancel: false, 21 | }) 22 | return; 23 | } 24 | 25 | console.log('上传图片.....'); 26 | //图片名字 可以自行定义, 这里是采用当前的时间戳 + 150内的随机数来给图片命名的 27 | const aliyunFileKey = dir; 28 | 29 | const aliyunServerURL = env.uploadImageUrl; //OSS地址,需要https 30 | const accessid = env.OSSAccessKeyId; 31 | const policyBase64 = getPolicyBase64(); 32 | const signature = getSignature(policyBase64); //获取签名 33 | 34 | wx.uploadFile({ 35 | url: aliyunServerURL, //开发者服务器 url 36 | filePath: filePath, //要上传文件资源的路径 37 | name: 'file', //必须填file 38 | formData: { 39 | 'key': aliyunFileKey, 40 | 'policy': policyBase64, 41 | 'OSSAccessKeyId': accessid, 42 | 'signature': signature, 43 | 'success_action_status': '200', 44 | }, 45 | success: function(res) { 46 | if (res.statusCode != 200) { 47 | failc(new Error('上传错误:' + JSON.stringify(res))) 48 | return; 49 | } 50 | successc(aliyunServerURL + aliyunFileKey); 51 | }, 52 | fail: function(err) { 53 | err.wxaddinfo = aliyunServerURL; 54 | failc(err); 55 | }, 56 | }) 57 | } 58 | 59 | const getPolicyBase64 = function() { 60 | let date = new Date(); 61 | date.setHours(date.getHours() + env.timeout); 62 | let srcT = date.toISOString(); 63 | const policyText = { 64 | "expiration": srcT, //设置该Policy的失效时间,超过这个失效时间之后,就没有办法通过这个policy上传文件了 65 | "conditions": [ 66 | ["content-length-range", 0, 5 * 1024 * 1024] // 设置上传文件的大小限制,5mb 67 | ] 68 | }; 69 | 70 | const policyBase64 = base64.encode(JSON.stringify(policyText)); 71 | return policyBase64; 72 | } 73 | 74 | const getSignature = function(policyBase64) { 75 | const accesskey = env.AccessKeySecret; 76 | 77 | const bytes = Crypto.HMAC(Crypto.SHA1, policyBase64, accesskey, { 78 | asBytes: true 79 | }); 80 | const signature = Crypto.util.bytesToBase64(bytes); 81 | 82 | return signature; 83 | } 84 | 85 | module.exports = uploadFile; -------------------------------------------------------------------------------- /前台源码/utils/util.js: -------------------------------------------------------------------------------- 1 | const formatTime = date => { 2 | const year = date.getFullYear() 3 | const month = date.getMonth() + 1 4 | const day = date.getDate() 5 | const hour = date.getHours() 6 | const minute = date.getMinutes() 7 | const second = date.getSeconds() 8 | 9 | return [year, month, day].map(formatNumber).join('/') + ' ' + [hour, minute, second].map(formatNumber).join(':') 10 | } 11 | 12 | const formatNumber = n => { 13 | n = n.toString() 14 | return n[1] ? n : '0' + n 15 | } 16 | 17 | module.exports = { 18 | formatTime: formatTime 19 | } 20 | -------------------------------------------------------------------------------- /后台源码/.idea/compiler.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 18 | 19 | -------------------------------------------------------------------------------- /后台源码/.idea/dataSources.local.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | #@ 7 | ` 8 | 9 | 10 | master_key 11 | root 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | -------------------------------------------------------------------------------- /后台源码/.idea/dataSources.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | mysql 6 | true 7 | com.mysql.jdbc.Driver 8 | jdbc:mysql://localhost:3306/mango_new_life 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | -------------------------------------------------------------------------------- /后台源码/.idea/dataSources/c411d75a-6309-43a4-90b2-5e14c73e1773/storage_v2/_src_/schema/information_schema.FNRwLQ.meta: -------------------------------------------------------------------------------- 1 | #n:information_schema 2 | ! [null, 0, null, null, -2147483648, -2147483648] 3 | -------------------------------------------------------------------------------- /后台源码/.idea/encodings.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | -------------------------------------------------------------------------------- /后台源码/.idea/jarRepositories.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 9 | 10 | 14 | 15 | 19 | 20 | -------------------------------------------------------------------------------- /后台源码/.idea/misc.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 10 | 11 | 16 | 17 | 18 | 19 | 20 | -------------------------------------------------------------------------------- /后台源码/.idea/vcs.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /后台源码/mango.iml: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /后台源码/src/main/java/work/huangxin/mango/MiniProgramRunApp.java: -------------------------------------------------------------------------------- 1 | package work.huangxin.mango; 2 | 3 | import org.springframework.boot.SpringApplication; 4 | import org.springframework.boot.autoconfigure.SpringBootApplication; 5 | import org.springframework.boot.builder.SpringApplicationBuilder; 6 | import org.springframework.boot.web.servlet.support.SpringBootServletInitializer; 7 | import org.springframework.transaction.annotation.EnableTransactionManagement; 8 | import tk.mybatis.spring.annotation.MapperScan; 9 | 10 | @SpringBootApplication 11 | @MapperScan(basePackages = "work.huangxin.mango.mapper") 12 | @EnableTransactionManagement 13 | public class MiniProgramRunApp extends SpringBootServletInitializer { 14 | 15 | public static void main(String args[]) { 16 | SpringApplication.run(MiniProgramRunApp.class, args); 17 | } 18 | 19 | 20 | // /** 21 | // * 以下为Tomcat启动 22 | // * @param application 23 | // * @return 24 | // */ 25 | // @Override 26 | // protected SpringApplicationBuilder configure(SpringApplicationBuilder application) { 27 | // return application.sources(MiniProgramRunApp.class); 28 | // } 29 | // 30 | // public static void main(String[] args) { 31 | // SpringApplication.run(MiniProgramRunApp.class, args); 32 | // } 33 | 34 | } 35 | 36 | 37 | 38 | 39 | -------------------------------------------------------------------------------- /后台源码/src/main/java/work/huangxin/mango/basemapper/SameMethod.java: -------------------------------------------------------------------------------- 1 | package work.huangxin.mango.basemapper; 2 | 3 | import tk.mybatis.mapper.common.Mapper; 4 | import tk.mybatis.mapper.common.MySqlMapper; 5 | 6 | public interface SameMethod extends Mapper, MySqlMapper { 7 | } 8 | -------------------------------------------------------------------------------- /后台源码/src/main/java/work/huangxin/mango/controller/AddAdminReplyController.java: -------------------------------------------------------------------------------- 1 | package work.huangxin.mango.controller; 2 | 3 | import org.springframework.beans.factory.annotation.Autowired; 4 | import org.springframework.transaction.annotation.Transactional; 5 | import org.springframework.web.bind.annotation.PathVariable; 6 | import org.springframework.web.bind.annotation.PostMapping; 7 | import org.springframework.web.bind.annotation.RequestBody; 8 | import org.springframework.web.bind.annotation.RestController; 9 | import work.huangxin.mango.model.MangoNewMessage; 10 | import work.huangxin.mango.model.MangoUser; 11 | import work.huangxin.mango.service.MangoNewMessageService; 12 | import work.huangxin.mango.service.MangoUserService; 13 | 14 | @RestController 15 | public class AddAdminReplyController { 16 | 17 | @Autowired 18 | private MangoUserService mangoUserService; 19 | @Autowired 20 | private MangoNewMessageService mangoNewMessageService; 21 | 22 | @Transactional 23 | @PostMapping("/addNewMessageByAdmin/{adminId}/{messageId}/{messageUserId}") 24 | public Integer addNewMessageByAdmin(@PathVariable Integer adminId, @PathVariable Integer messageId, @PathVariable Integer messageUserId, @RequestBody String newMessage) { 25 | MangoUser admin = mangoUserService.getById(adminId); 26 | if (admin.getUserIsAdmin() != 2) { 27 | return 400; 28 | } 29 | 30 | MangoNewMessage mangoNewMessage = new MangoNewMessage(); 31 | mangoNewMessage.setNewMessageDetail(newMessage); 32 | mangoNewMessage.setMessageId(messageId); 33 | mangoNewMessage.setUserId(messageUserId); 34 | mangoNewMessage.setNewMessageType(3); 35 | mangoNewMessageService.add(mangoNewMessage); 36 | 37 | return 200; 38 | } 39 | 40 | 41 | } 42 | -------------------------------------------------------------------------------- /后台源码/src/main/java/work/huangxin/mango/controller/AddCollectionController.java: -------------------------------------------------------------------------------- 1 | package work.huangxin.mango.controller; 2 | 3 | import com.github.pagehelper.PageHelper; 4 | import com.github.pagehelper.PageInfo; 5 | import org.springframework.beans.factory.annotation.Autowired; 6 | import org.springframework.transaction.annotation.Transactional; 7 | import org.springframework.web.bind.annotation.PathVariable; 8 | import org.springframework.web.bind.annotation.PostMapping; 9 | import org.springframework.web.bind.annotation.RestController; 10 | import work.huangxin.mango.model.MangoAttend; 11 | import work.huangxin.mango.model.MangoCollect; 12 | import work.huangxin.mango.model.MangoMessage; 13 | import work.huangxin.mango.service.MangoCollectService; 14 | import work.huangxin.mango.service.MangoMessageDetailService; 15 | import work.huangxin.mango.service.MangoMessageImagesService; 16 | import work.huangxin.mango.service.MangoUserService; 17 | import work.huangxin.mango.util.isCollect.IsCollect; 18 | 19 | import java.util.ArrayList; 20 | import java.util.LinkedList; 21 | import java.util.List; 22 | 23 | @RestController 24 | public class AddCollectionController { 25 | @Autowired 26 | private MangoCollectService mangoCollectService; 27 | @Autowired 28 | private MangoUserService mangoUserService; 29 | @Autowired 30 | private MangoMessageImagesService mangoMessageImagesService; 31 | @Autowired 32 | private MangoMessageDetailService mangoMessageDetailService; 33 | 34 | @PostMapping("/getMessage/getAllCollectionMessageByUserId/{userId}/{pageNumber}") 35 | 36 | public List getAllCollectionMessageByUserId(@PathVariable Integer userId, @PathVariable Integer pageNumber) { 37 | PageHelper.startPage(pageNumber, 5); 38 | PageInfo pageInfo = new PageInfo(mangoCollectService.getAllCollectionMessageByUserId(userId)); 39 | 40 | if (pageInfo.getPageNum() < pageNumber) { 41 | List list1 = new LinkedList(); 42 | list1.add(200); 43 | return list1; 44 | } 45 | List list = pageInfo.getList(); 46 | 47 | 48 | List list1 = new ArrayList(); 49 | for (int i = 0; i < list.size(); i++) { 50 | Integer messageId = list.get(i).getMessageId(); 51 | MangoMessage message = mangoMessageDetailService.getById(messageId); 52 | list1.add(message); 53 | } 54 | return new GetMessageDetailController().getImage(list1, mangoUserService, mangoMessageImagesService); 55 | } 56 | 57 | 58 | @Transactional 59 | @PostMapping("/addCollection/{userId}/{messageId}") 60 | public IsCollect addCollection(@PathVariable Integer userId, @PathVariable Integer messageId) { 61 | return new IsCollect().isTrue(userId, messageId, mangoCollectService, mangoUserService); 62 | } 63 | 64 | @PostMapping("/addCollection/checkIsCollection/{userId}/{messageId}") 65 | public Integer checkIsCollection(@PathVariable Integer userId, @PathVariable Integer messageId) { 66 | MangoCollect mangoCollect = new MangoCollect(); 67 | mangoCollect.setUserId(userId); 68 | mangoCollect.setMessageId(messageId); 69 | return mangoCollectService.findCount(mangoCollect); 70 | } 71 | 72 | @Transactional 73 | @PostMapping("/deleteCollection/{userId}/{messageId}") 74 | public Integer deleteCollection(@PathVariable Integer userId, @PathVariable Integer messageId) { 75 | 76 | 77 | MangoCollect mangoCollect = new MangoCollect(); 78 | mangoCollect.setUserId(userId); 79 | mangoCollect.setMessageId(messageId); 80 | mangoCollectService.delete(mangoCollect); 81 | return 200; 82 | } 83 | } 84 | -------------------------------------------------------------------------------- /后台源码/src/main/java/work/huangxin/mango/controller/AddCommentController.java: -------------------------------------------------------------------------------- 1 | package work.huangxin.mango.controller; 2 | 3 | import org.springframework.beans.factory.annotation.Autowired; 4 | import org.springframework.transaction.annotation.Transactional; 5 | import org.springframework.web.bind.annotation.PathVariable; 6 | import org.springframework.web.bind.annotation.PostMapping; 7 | import org.springframework.web.bind.annotation.RequestBody; 8 | import org.springframework.web.bind.annotation.RestController; 9 | import work.huangxin.mango.service.MangoAttendService; 10 | import work.huangxin.mango.service.MangoCommentService; 11 | import work.huangxin.mango.service.MangoNewMessageService; 12 | import work.huangxin.mango.service.MangoUserService; 13 | import work.huangxin.mango.util.isComment.IsComment; 14 | 15 | @RestController 16 | public class AddCommentController { 17 | 18 | @Autowired 19 | private MangoUserService mangoUserService; 20 | @Autowired 21 | private MangoCommentService mangoCommentService; 22 | @Autowired 23 | private MangoNewMessageService mangoNewMessageService; 24 | @Autowired 25 | private MangoAttendService mangoAttendService; 26 | 27 | @Transactional 28 | @PostMapping("/addComment/{userId}/{messageId}/{messageUserId}") 29 | public IsComment addComment(@PathVariable Integer userId, @RequestBody String userComment, @PathVariable Integer messageId, @PathVariable Integer messageUserId) { 30 | return new IsComment().isTrue(userId, messageId, userComment, messageUserId, mangoUserService, mangoCommentService, mangoNewMessageService, mangoAttendService); 31 | } 32 | 33 | } 34 | -------------------------------------------------------------------------------- /后台源码/src/main/java/work/huangxin/mango/controller/AddCommentReplyController.java: -------------------------------------------------------------------------------- 1 | package work.huangxin.mango.controller; 2 | 3 | import org.springframework.beans.factory.annotation.Autowired; 4 | import org.springframework.transaction.annotation.Transactional; 5 | import org.springframework.web.bind.annotation.PathVariable; 6 | import org.springframework.web.bind.annotation.PostMapping; 7 | import org.springframework.web.bind.annotation.RequestBody; 8 | import org.springframework.web.bind.annotation.RestController; 9 | import work.huangxin.mango.model.MangoCommentReply; 10 | import work.huangxin.mango.service.MangoAttendService; 11 | import work.huangxin.mango.service.MangoCommentReplayService; 12 | import work.huangxin.mango.service.MangoNewMessageService; 13 | import work.huangxin.mango.service.MangoUserService; 14 | import work.huangxin.mango.util.isCommentReply.IsCommentReply; 15 | 16 | @RestController 17 | public class AddCommentReplyController { 18 | 19 | @Autowired 20 | private MangoUserService mangoUserService; 21 | @Autowired 22 | private MangoCommentReplayService mangoCommentReplayService; 23 | @Autowired 24 | private MangoNewMessageService mangoNewMessageService; 25 | @Autowired 26 | private MangoAttendService mangoAttendService; 27 | 28 | @Transactional 29 | @PostMapping("/addCommentReply/{messageId}") 30 | public IsCommentReply addCommentReply(@PathVariable Integer messageId, @RequestBody MangoCommentReply mangoCommentReply) { 31 | 32 | return new IsCommentReply().isTrue(messageId, mangoCommentReply, mangoUserService, mangoCommentReplayService, mangoNewMessageService,mangoAttendService); 33 | 34 | } 35 | 36 | 37 | } 38 | -------------------------------------------------------------------------------- /后台源码/src/main/java/work/huangxin/mango/controller/AddMessageDetailController.java: -------------------------------------------------------------------------------- 1 | package work.huangxin.mango.controller; 2 | 3 | import org.springframework.beans.factory.annotation.Autowired; 4 | import org.springframework.transaction.annotation.Transactional; 5 | import org.springframework.web.bind.annotation.PathVariable; 6 | import org.springframework.web.bind.annotation.PostMapping; 7 | import org.springframework.web.bind.annotation.RequestBody; 8 | import org.springframework.web.bind.annotation.RestController; 9 | import work.huangxin.mango.model.MangoMessage; 10 | import work.huangxin.mango.service.MangoMessageDetailService; 11 | import work.huangxin.mango.service.MangoMessageImagesService; 12 | import work.huangxin.mango.service.MangoUserService; 13 | import work.huangxin.mango.util.Upload.IsUpload; 14 | 15 | @RestController 16 | public class AddMessageDetailController { 17 | @Autowired 18 | private MangoMessageImagesService mangoMessageImagesService; 19 | @Autowired 20 | private MangoMessageDetailService mangoMessageDetailService; 21 | @Autowired 22 | private MangoUserService mangoUserService; 23 | 24 | @Transactional 25 | @PostMapping("/addMessage/{userId}") 26 | public IsUpload addMessage(@PathVariable Integer userId, @RequestBody MangoMessage mangoMessage) { 27 | return new IsUpload().isTrue(mangoMessage, mangoMessageDetailService, mangoMessageImagesService, mangoUserService); 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /后台源码/src/main/java/work/huangxin/mango/controller/DeleteByUserIdController.java: -------------------------------------------------------------------------------- 1 | package work.huangxin.mango.controller; 2 | 3 | import org.springframework.beans.factory.annotation.Autowired; 4 | import org.springframework.transaction.annotation.Transactional; 5 | import org.springframework.web.bind.annotation.PathVariable; 6 | import org.springframework.web.bind.annotation.PostMapping; 7 | import org.springframework.web.bind.annotation.RestController; 8 | import work.huangxin.mango.service.*; 9 | import work.huangxin.mango.util.isDelete.IsDelete; 10 | 11 | @RestController 12 | public class DeleteByUserIdController { 13 | @Autowired 14 | private MangoMessageDetailService mangoMessageDetailService; 15 | @Autowired 16 | private MangoMessageImagesService mangoMessageImagesService; 17 | @Autowired 18 | private MangoAttendService mangoAttendService; 19 | @Autowired 20 | private MangoUserService mangoUserService; 21 | @Autowired 22 | private MangoCollectService mangoCollectService; 23 | @Autowired 24 | private MangoNewMessageService mangoNewMessageService; 25 | 26 | 27 | @Transactional 28 | @PostMapping("/deleteMessageById/{userId}/{messageId}") 29 | public IsDelete deleteByUserId(@PathVariable Integer userId, @PathVariable Integer messageId) { 30 | return new IsDelete().isDelete(userId, messageId, mangoMessageImagesService, mangoUserService, mangoMessageDetailService,mangoAttendService,mangoCollectService,mangoNewMessageService); 31 | } 32 | 33 | 34 | } 35 | -------------------------------------------------------------------------------- /后台源码/src/main/java/work/huangxin/mango/controller/DeleteCommentByIdController.java: -------------------------------------------------------------------------------- 1 | package work.huangxin.mango.controller; 2 | 3 | import org.springframework.beans.factory.annotation.Autowired; 4 | import org.springframework.transaction.annotation.Transactional; 5 | import org.springframework.web.bind.annotation.PathVariable; 6 | import org.springframework.web.bind.annotation.PostMapping; 7 | import org.springframework.web.bind.annotation.RestController; 8 | import work.huangxin.mango.model.MangoComment; 9 | import work.huangxin.mango.model.MangoCommentReply; 10 | import work.huangxin.mango.model.MangoUser; 11 | import work.huangxin.mango.service.MangoCommentReplayService; 12 | import work.huangxin.mango.service.MangoCommentService; 13 | import work.huangxin.mango.service.MangoUserService; 14 | 15 | @RestController 16 | public class DeleteCommentByIdController { 17 | 18 | @Autowired 19 | private MangoCommentService mangoCommentService; 20 | @Autowired 21 | private MangoUserService mangoUserService; 22 | @Autowired 23 | private MangoCommentReplayService mangoCommentReplayService; 24 | 25 | @Transactional 26 | @PostMapping("/deleteCommentByCommentId/{userId}/{messageId}") 27 | public Integer deleteCommentByCommentId(@PathVariable Integer userId, @PathVariable Integer messageId) { 28 | MangoUser user = mangoUserService.getById(userId); 29 | if (user == null) { 30 | return 400; 31 | } 32 | MangoComment mangoComment = new MangoComment(); 33 | 34 | if (user.getUserIsAdmin() == 2) { 35 | mangoComment.setCommentId(messageId); 36 | } else { 37 | mangoComment.setCommentId(messageId); 38 | mangoComment.setUserId(userId); 39 | } 40 | 41 | mangoCommentService.delete(mangoComment); 42 | 43 | MangoCommentReply mangoCommentReply = new MangoCommentReply(); 44 | mangoCommentReply.setCommentId(messageId); 45 | mangoCommentReplayService.delete(mangoCommentReply); 46 | 47 | 48 | return 200; 49 | } 50 | 51 | 52 | @Transactional 53 | @PostMapping("/deleteCommentReplyByCommentId/{userId}/{commentReplyId}") 54 | public Integer deleteCommentReplyByCommentId(@PathVariable Integer userId, @PathVariable Integer commentReplyId) { 55 | MangoUser user = mangoUserService.getById(userId); 56 | if (user == null) { 57 | return 400; 58 | } 59 | MangoCommentReply mangoCommentReply = new MangoCommentReply(); 60 | 61 | if (user.getUserIsAdmin() == 2) { 62 | mangoCommentReply.setCommentReplyId(commentReplyId); 63 | } else { 64 | mangoCommentReply.setCommentReplyId(commentReplyId); 65 | mangoCommentReply.setReplayUserId(userId); 66 | } 67 | 68 | mangoCommentReplayService.delete(mangoCommentReply); 69 | 70 | return 200; 71 | } 72 | 73 | } 74 | 75 | 76 | -------------------------------------------------------------------------------- /后台源码/src/main/java/work/huangxin/mango/controller/GetAttendMessageController.java: -------------------------------------------------------------------------------- 1 | package work.huangxin.mango.controller; 2 | 3 | import com.github.pagehelper.PageHelper; 4 | import com.github.pagehelper.PageInfo; 5 | import org.springframework.beans.factory.annotation.Autowired; 6 | import org.springframework.web.bind.annotation.PathVariable; 7 | import org.springframework.web.bind.annotation.PostMapping; 8 | import org.springframework.web.bind.annotation.RestController; 9 | import work.huangxin.mango.model.MangoAttend; 10 | import work.huangxin.mango.model.MangoMessage; 11 | import work.huangxin.mango.service.MangoAttendService; 12 | import work.huangxin.mango.service.MangoMessageDetailService; 13 | import work.huangxin.mango.service.MangoMessageImagesService; 14 | import work.huangxin.mango.service.MangoUserService; 15 | 16 | import java.util.ArrayList; 17 | import java.util.LinkedList; 18 | import java.util.List; 19 | 20 | @RestController 21 | public class GetAttendMessageController { 22 | 23 | @Autowired 24 | private MangoUserService mangoUserService; 25 | @Autowired 26 | private MangoMessageDetailService mangoMessageDetailService; 27 | @Autowired 28 | private MangoMessageImagesService mangoMessageImagesService; 29 | @Autowired 30 | private MangoAttendService mangoAttendService; 31 | 32 | 33 | @PostMapping("/getMessage/getAttendMessageByUserId/{userId}/{pageNumber}") 34 | 35 | public List getAttendMessageByUserId(@PathVariable Integer userId, @PathVariable Integer pageNumber) { 36 | PageHelper.startPage(pageNumber, 5); 37 | PageInfo pageInfo = new PageInfo(mangoAttendService.getAllAttendMessageByUserId(userId)); 38 | 39 | if (pageInfo.getPageNum() < pageNumber) { 40 | List list1 = new LinkedList(); 41 | list1.add(200); 42 | return list1; 43 | } 44 | List list = pageInfo.getList(); 45 | 46 | 47 | List list1 = new ArrayList(); 48 | for (int i = 0; i < list.size(); i++) { 49 | Integer messageId = list.get(i).getMessageId(); 50 | MangoMessage message = mangoMessageDetailService.getById(messageId); 51 | list1.add(message); 52 | } 53 | return new GetMessageDetailController().getImage(list1, mangoUserService, mangoMessageImagesService); 54 | } 55 | } 56 | -------------------------------------------------------------------------------- /后台源码/src/main/java/work/huangxin/mango/controller/GetCategoryMessageController.java: -------------------------------------------------------------------------------- 1 | package work.huangxin.mango.controller; 2 | 3 | import org.springframework.beans.factory.annotation.Autowired; 4 | import org.springframework.web.bind.annotation.PostMapping; 5 | import org.springframework.web.bind.annotation.RestController; 6 | import work.huangxin.mango.model.MangoCategory; 7 | import work.huangxin.mango.service.MangoCategoryService; 8 | 9 | import java.util.List; 10 | 11 | @RestController 12 | public class GetCategoryMessageController { 13 | 14 | @Autowired 15 | private MangoCategoryService mangoCategoryService; 16 | 17 | 18 | @PostMapping("/getMessage/getAllCategoryMessage") 19 | public List getAllCategoryMessage() { 20 | return mangoCategoryService.findAll(); 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /后台源码/src/main/java/work/huangxin/mango/controller/GetLostMessageController.java: -------------------------------------------------------------------------------- 1 | package work.huangxin.mango.controller; 2 | 3 | import org.springframework.beans.factory.annotation.Autowired; 4 | import org.springframework.web.bind.annotation.PostMapping; 5 | import org.springframework.web.bind.annotation.RestController; 6 | import work.huangxin.mango.model.MangoMessage; 7 | import work.huangxin.mango.service.MangoMessageDetailService; 8 | 9 | @RestController 10 | public class GetLostMessageController { 11 | @Autowired 12 | private MangoMessageDetailService mangoMessageDetailService; 13 | 14 | @PostMapping("/getMessage/getLostMessage") 15 | public MangoMessage getLostMessage(){ 16 | 17 | return mangoMessageDetailService.getLostMessage(); 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /后台源码/src/main/java/work/huangxin/mango/controller/GetNewMessageController.java: -------------------------------------------------------------------------------- 1 | package work.huangxin.mango.controller; 2 | 3 | import com.github.pagehelper.PageHelper; 4 | import com.github.pagehelper.PageInfo; 5 | import org.springframework.beans.factory.annotation.Autowired; 6 | import org.springframework.web.bind.annotation.PathVariable; 7 | import org.springframework.web.bind.annotation.PostMapping; 8 | import org.springframework.web.bind.annotation.RestController; 9 | import work.huangxin.mango.model.MangoNewMessage; 10 | import work.huangxin.mango.model.MangoUser; 11 | import work.huangxin.mango.service.MangoNewMessageService; 12 | import work.huangxin.mango.service.MangoUserService; 13 | 14 | import java.util.LinkedList; 15 | import java.util.List; 16 | 17 | @RestController 18 | public class GetNewMessageController { 19 | 20 | 21 | @Autowired 22 | private MangoUserService mangoUserService; 23 | @Autowired 24 | private MangoNewMessageService mangoNewMessageService; 25 | 26 | @PostMapping("/getMessage/getAllNewMessage/{userId}/{pageNumber}") 27 | public List getAllNewMessage(@PathVariable Integer userId, @PathVariable Integer pageNumber) { 28 | MangoUser user = mangoUserService.getById(userId); 29 | if (user == null) { 30 | return null; 31 | } 32 | PageHelper.startPage(pageNumber, 10); 33 | PageInfo pageInfo = new PageInfo(mangoNewMessageService.getAllNewMessage(userId)); 34 | 35 | if (pageInfo.getPageNum() < pageNumber) { 36 | List list1 = new LinkedList(); 37 | list1.add(200); 38 | return list1; 39 | } 40 | List list = pageInfo.getList(); 41 | return list; 42 | } 43 | 44 | @PostMapping("/getMessage/getLastNewMessage/{userId}") 45 | public MangoNewMessage getLastNewMessage(@PathVariable Integer userId) { 46 | 47 | if (userId == -1) { 48 | return null; 49 | } 50 | 51 | return mangoNewMessageService.getLastNewMessage(userId); 52 | 53 | } 54 | 55 | 56 | } 57 | -------------------------------------------------------------------------------- /后台源码/src/main/java/work/huangxin/mango/controller/GetNoticeController.java: -------------------------------------------------------------------------------- 1 | package work.huangxin.mango.controller; 2 | 3 | import org.springframework.beans.factory.annotation.Autowired; 4 | import org.springframework.web.bind.annotation.PostMapping; 5 | import org.springframework.web.bind.annotation.RestController; 6 | import work.huangxin.mango.model.MangoNotice; 7 | import work.huangxin.mango.service.MangoNoticeService; 8 | 9 | import java.util.List; 10 | 11 | @RestController 12 | public class GetNoticeController { 13 | 14 | 15 | @Autowired 16 | private MangoNoticeService mangoNoticeService; 17 | 18 | @PostMapping("/getMessage/getAllNoticeMessage") 19 | 20 | public List getAllNoticeMessage() { 21 | return mangoNoticeService.findAll(); 22 | } 23 | 24 | } 25 | -------------------------------------------------------------------------------- /后台源码/src/main/java/work/huangxin/mango/controller/GetShopMessageController.java: -------------------------------------------------------------------------------- 1 | package work.huangxin.mango.controller; 2 | 3 | import org.springframework.beans.factory.annotation.Autowired; 4 | import org.springframework.web.bind.annotation.PathVariable; 5 | import org.springframework.web.bind.annotation.PostMapping; 6 | import org.springframework.web.bind.annotation.RestController; 7 | import work.huangxin.mango.model.MangoShop; 8 | import work.huangxin.mango.model.MangoShopBusiness; 9 | import work.huangxin.mango.model.MangoShopImages; 10 | import work.huangxin.mango.service.MangoShopBusinessService; 11 | import work.huangxin.mango.service.MangoShopImagesService; 12 | import work.huangxin.mango.service.MangoShopService; 13 | 14 | import java.util.List; 15 | 16 | @RestController 17 | public class GetShopMessageController { 18 | @Autowired 19 | private MangoShopService mangoShopService; 20 | 21 | @Autowired 22 | private MangoShopImagesService mangoShopImagesService; 23 | @Autowired 24 | private MangoShopBusinessService mangoShopBusinessService; 25 | 26 | @PostMapping("/getMessage/getAllShop") 27 | public List getAllShopMessage() { 28 | return mangoShopService.findAll(); 29 | } 30 | 31 | @PostMapping("/getMessage/getShopMessage/{id}") 32 | public MangoShop getShopMessageById(@PathVariable Integer id) { 33 | MangoShop mangoShop = mangoShopService.getById(id); 34 | MangoShopImages mangoShopImages = new MangoShopImages(); 35 | mangoShopImages.setShopId(id); 36 | mangoShop.setShopImages(mangoShopImagesService.findList(mangoShopImages)); 37 | MangoShopBusiness mangoShopBusiness = new MangoShopBusiness(); 38 | mangoShopBusiness.setShopId(id); 39 | mangoShop.setShopBusinesses(mangoShopBusinessService.findList(mangoShopBusiness)); 40 | return mangoShop; 41 | } 42 | 43 | } 44 | -------------------------------------------------------------------------------- /后台源码/src/main/java/work/huangxin/mango/controller/GetSwiperMessageController.java: -------------------------------------------------------------------------------- 1 | package work.huangxin.mango.controller; 2 | 3 | import org.springframework.beans.factory.annotation.Autowired; 4 | import org.springframework.web.bind.annotation.PostMapping; 5 | import org.springframework.web.bind.annotation.RestController; 6 | import work.huangxin.mango.model.MangoSwiper; 7 | import work.huangxin.mango.service.MangoSwiperService; 8 | 9 | import java.util.List; 10 | 11 | @RestController 12 | public class GetSwiperMessageController { 13 | 14 | @Autowired 15 | private MangoSwiperService mangoSwiperService; 16 | 17 | @PostMapping("/getMessage/getAllSwiperMessage") 18 | public List getAllSwiperMessage() { 19 | return mangoSwiperService.findAll(); 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /后台源码/src/main/java/work/huangxin/mango/controller/LoginController.java: -------------------------------------------------------------------------------- 1 | package work.huangxin.mango.controller; 2 | 3 | import org.springframework.beans.factory.annotation.Autowired; 4 | import org.springframework.transaction.annotation.Transactional; 5 | import org.springframework.web.bind.annotation.PostMapping; 6 | import org.springframework.web.bind.annotation.RequestBody; 7 | import org.springframework.web.bind.annotation.RestController; 8 | import work.huangxin.mango.model.MangoUser; 9 | import work.huangxin.mango.model.WXSessionModel; 10 | import work.huangxin.mango.service.MangoUserService; 11 | import work.huangxin.mango.util.common.HttpClientUtil; 12 | import work.huangxin.mango.util.common.JsonUtils; 13 | import work.huangxin.mango.util.login.IsLogin; 14 | 15 | import java.util.HashMap; 16 | import java.util.List; 17 | import java.util.Map; 18 | 19 | @RestController 20 | public class LoginController { 21 | @Autowired 22 | private MangoUserService mangoUserService; 23 | 24 | /** 25 | * 登录功能 26 | * 27 | * @param code 28 | * @param mangoUser 29 | * @return 30 | */ 31 | @Transactional 32 | @PostMapping("/Login") 33 | public IsLogin Login(String code, @RequestBody MangoUser mangoUser) { 34 | 35 | String url = "https://api.weixin.qq.com/sns/jscode2session"; 36 | Map param = new HashMap(); 37 | param.put("appid", "微信小程序后台查看"); 38 | param.put("secret", "微信小程序后台查看"); 39 | param.put("js_code", code); 40 | param.put("grant_type", "authorization_code"); 41 | 42 | String wxResult = HttpClientUtil.doGet(url, param); 43 | WXSessionModel wxSessionModel = JsonUtils.jsonToPojo(wxResult, WXSessionModel.class); 44 | 45 | String openid = wxSessionModel.getOpenid(); 46 | mangoUser.setUserOpenid(openid); 47 | 48 | return new IsLogin().isTrue(mangoUser, openid, mangoUserService); 49 | } 50 | 51 | @PostMapping("/checkAdmin") 52 | public List checkAdmin(Integer id) { 53 | MangoUser mangoUser = new MangoUser(); 54 | mangoUser.setUserId(id); 55 | return mangoUserService.getUserMessageByOtherMessage(mangoUser); 56 | } 57 | } 58 | -------------------------------------------------------------------------------- /后台源码/src/main/java/work/huangxin/mango/controller/SearchMessageController.java: -------------------------------------------------------------------------------- 1 | package work.huangxin.mango.controller; 2 | 3 | import com.github.pagehelper.PageHelper; 4 | import com.github.pagehelper.PageInfo; 5 | import org.springframework.beans.factory.annotation.Autowired; 6 | import org.springframework.web.bind.annotation.PathVariable; 7 | import org.springframework.web.bind.annotation.PostMapping; 8 | import org.springframework.web.bind.annotation.RestController; 9 | import work.huangxin.mango.model.MangoMessage; 10 | import work.huangxin.mango.service.MangoMessageDetailService; 11 | import work.huangxin.mango.service.MangoMessageImagesService; 12 | import work.huangxin.mango.service.MangoUserService; 13 | 14 | import java.util.LinkedList; 15 | import java.util.List; 16 | 17 | @RestController 18 | public class SearchMessageController { 19 | 20 | @Autowired 21 | private MangoMessageDetailService mangoMessageDetailService; 22 | @Autowired 23 | private MangoUserService mangoUserService; 24 | @Autowired 25 | private MangoMessageImagesService mangoMessageImagesService; 26 | 27 | @PostMapping("/search/{categoryId}/{keyword}") 28 | public List getMessageByCategoryAndKeyword(@PathVariable Integer categoryId, @PathVariable String keyword) { 29 | List allMessage = mangoMessageDetailService.getMessageByCategoryAndKeyword(categoryId, keyword); 30 | return new GetMessageDetailController().getImage(allMessage, mangoUserService, mangoMessageImagesService); 31 | 32 | } 33 | 34 | @PostMapping("/searchByKeyword/{keyword}/{pageNumber}") 35 | public List getMessageByCategoryAndKeyword(@PathVariable String keyword, @PathVariable Integer pageNumber) { 36 | 37 | PageHelper.startPage(pageNumber, 3); 38 | 39 | PageInfo pageInfo = new PageInfo(mangoMessageDetailService.getMessageByKeyword(keyword)); 40 | 41 | if (pageInfo.getPageNum() < pageNumber) { 42 | List list1 = new LinkedList(); 43 | list1.add(200); 44 | return list1; 45 | } 46 | 47 | List allMessage = pageInfo.getList(); 48 | 49 | return new GetMessageDetailController().getImage(allMessage, mangoUserService, mangoMessageImagesService); 50 | 51 | } 52 | 53 | } 54 | -------------------------------------------------------------------------------- /后台源码/src/main/java/work/huangxin/mango/controller/UpdateMessageByUserIdController.java: -------------------------------------------------------------------------------- 1 | package work.huangxin.mango.controller; 2 | 3 | import org.springframework.beans.factory.annotation.Autowired; 4 | import org.springframework.transaction.annotation.Transactional; 5 | import org.springframework.web.bind.annotation.PathVariable; 6 | import org.springframework.web.bind.annotation.PostMapping; 7 | import org.springframework.web.bind.annotation.RequestBody; 8 | import org.springframework.web.bind.annotation.RestController; 9 | import work.huangxin.mango.service.MangoMessageDetailService; 10 | import work.huangxin.mango.service.MangoUserService; 11 | import work.huangxin.mango.util.isUpdate.IsUpdate; 12 | 13 | @RestController 14 | public class UpdateMessageByUserIdController { 15 | 16 | @Autowired 17 | private MangoMessageDetailService mangoMessageDetailService; 18 | @Autowired 19 | private MangoUserService mangoUserService; 20 | @Transactional 21 | @PostMapping("/updateMessageById/{id}/{messageId}") 22 | public IsUpdate updateMessageById(@PathVariable Integer id,@PathVariable Integer messageId,@RequestBody String message){ 23 | 24 | 25 | return new IsUpdate().isTrue(id,messageId,message,mangoMessageDetailService,mangoUserService); 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /后台源码/src/main/java/work/huangxin/mango/controller/addShareCountController.java: -------------------------------------------------------------------------------- 1 | package work.huangxin.mango.controller; 2 | 3 | import org.springframework.beans.factory.annotation.Autowired; 4 | import org.springframework.web.bind.annotation.PathVariable; 5 | import org.springframework.web.bind.annotation.PostMapping; 6 | import org.springframework.web.bind.annotation.RestController; 7 | import work.huangxin.mango.model.MangoMessage; 8 | import work.huangxin.mango.service.MangoMessageDetailService; 9 | 10 | @RestController 11 | public class addShareCountController { 12 | 13 | 14 | @Autowired 15 | private MangoMessageDetailService mangoMessageDetailService; 16 | 17 | @PostMapping("/share/addShareCount/{messageId}") 18 | public Integer addShareCount(@PathVariable Integer messageId) { 19 | 20 | MangoMessage message = mangoMessageDetailService.getById(messageId); 21 | 22 | MangoMessage mangoMessage = new MangoMessage(); 23 | 24 | mangoMessage.setMessageId(messageId); 25 | mangoMessage.setMessageShare(message.getMessageShare() + 1); 26 | mangoMessageDetailService.update(mangoMessage); 27 | 28 | 29 | return message.getMessageShare(); 30 | } 31 | 32 | } 33 | -------------------------------------------------------------------------------- /后台源码/src/main/java/work/huangxin/mango/mapper/MangoAttendMapper.java: -------------------------------------------------------------------------------- 1 | package work.huangxin.mango.mapper; 2 | 3 | import tk.mybatis.mapper.common.Mapper; 4 | import work.huangxin.mango.model.MangoAttend; 5 | 6 | import java.util.List; 7 | 8 | public interface MangoAttendMapper extends Mapper { 9 | List getAllAttendMessageByUserId(Integer id); 10 | } -------------------------------------------------------------------------------- /后台源码/src/main/java/work/huangxin/mango/mapper/MangoCategoryMapper.java: -------------------------------------------------------------------------------- 1 | package work.huangxin.mango.mapper; 2 | 3 | import tk.mybatis.mapper.common.Mapper; 4 | import work.huangxin.mango.model.MangoCategory; 5 | 6 | public interface MangoCategoryMapper extends Mapper { 7 | } -------------------------------------------------------------------------------- /后台源码/src/main/java/work/huangxin/mango/mapper/MangoCollectMapper.java: -------------------------------------------------------------------------------- 1 | package work.huangxin.mango.mapper; 2 | 3 | import tk.mybatis.mapper.common.Mapper; 4 | import work.huangxin.mango.model.MangoAttend; 5 | import work.huangxin.mango.model.MangoCollect; 6 | 7 | import java.util.List; 8 | 9 | public interface MangoCollectMapper extends Mapper { 10 | List getAllCollectionMessageByUserId(Integer id); 11 | 12 | } -------------------------------------------------------------------------------- /后台源码/src/main/java/work/huangxin/mango/mapper/MangoCommentMapper.java: -------------------------------------------------------------------------------- 1 | package work.huangxin.mango.mapper; 2 | 3 | import tk.mybatis.mapper.common.Mapper; 4 | import work.huangxin.mango.model.MangoComment; 5 | 6 | public interface MangoCommentMapper extends Mapper { 7 | } -------------------------------------------------------------------------------- /后台源码/src/main/java/work/huangxin/mango/mapper/MangoCommentReplyMapper.java: -------------------------------------------------------------------------------- 1 | package work.huangxin.mango.mapper; 2 | 3 | import tk.mybatis.mapper.common.Mapper; 4 | import work.huangxin.mango.model.MangoCommentReply; 5 | 6 | public interface MangoCommentReplyMapper extends Mapper { 7 | } -------------------------------------------------------------------------------- /后台源码/src/main/java/work/huangxin/mango/mapper/MangoMessageImagesMapper.java: -------------------------------------------------------------------------------- 1 | package work.huangxin.mango.mapper; 2 | 3 | import tk.mybatis.mapper.common.Mapper; 4 | import work.huangxin.mango.model.MangoMessageImages; 5 | 6 | public interface MangoMessageImagesMapper extends Mapper { 7 | } -------------------------------------------------------------------------------- /后台源码/src/main/java/work/huangxin/mango/mapper/MangoMessageMapper.java: -------------------------------------------------------------------------------- 1 | package work.huangxin.mango.mapper; 2 | 3 | import org.apache.ibatis.annotations.Param; 4 | import tk.mybatis.mapper.common.Mapper; 5 | import work.huangxin.mango.model.MangoMessage; 6 | 7 | import java.util.List; 8 | 9 | public interface MangoMessageMapper extends Mapper { 10 | 11 | MangoMessage getLostMessage(); 12 | 13 | Integer insertMessageDetail(MangoMessage mangoMessage); 14 | 15 | List getAllMessage(); 16 | 17 | List getMessageByCategoryId(Integer id); 18 | 19 | List getMessageByCategoryAndKeyword(@Param("id") Integer id,@Param("keyword") String keyword); 20 | 21 | List getMessageDetailByUserId (Integer userId); 22 | 23 | List getMessageByKeyword(@Param("keyword") String keyword); 24 | 25 | void deleteCommentAndReply(@Param("id") Integer id); 26 | 27 | 28 | 29 | } -------------------------------------------------------------------------------- /后台源码/src/main/java/work/huangxin/mango/mapper/MangoNewMessageMapper.java: -------------------------------------------------------------------------------- 1 | package work.huangxin.mango.mapper; 2 | 3 | import tk.mybatis.mapper.common.Mapper; 4 | import work.huangxin.mango.model.MangoNewMessage; 5 | 6 | import java.util.List; 7 | 8 | public interface MangoNewMessageMapper extends Mapper { 9 | 10 | List getAllNewMessage(Integer id); 11 | 12 | 13 | MangoNewMessage getLastNewMessage(Integer id); 14 | } -------------------------------------------------------------------------------- /后台源码/src/main/java/work/huangxin/mango/mapper/MangoNoticeMapper.java: -------------------------------------------------------------------------------- 1 | package work.huangxin.mango.mapper; 2 | 3 | import tk.mybatis.mapper.common.Mapper; 4 | import work.huangxin.mango.model.MangoNotice; 5 | 6 | public interface MangoNoticeMapper extends Mapper { 7 | } -------------------------------------------------------------------------------- /后台源码/src/main/java/work/huangxin/mango/mapper/MangoShopBusinessMapper.java: -------------------------------------------------------------------------------- 1 | package work.huangxin.mango.mapper; 2 | 3 | import tk.mybatis.mapper.common.Mapper; 4 | import work.huangxin.mango.model.MangoShopBusiness; 5 | 6 | public interface MangoShopBusinessMapper extends Mapper { 7 | } -------------------------------------------------------------------------------- /后台源码/src/main/java/work/huangxin/mango/mapper/MangoShopImagesMapper.java: -------------------------------------------------------------------------------- 1 | package work.huangxin.mango.mapper; 2 | 3 | import tk.mybatis.mapper.common.Mapper; 4 | import work.huangxin.mango.model.MangoShopImages; 5 | 6 | public interface MangoShopImagesMapper extends Mapper { 7 | } -------------------------------------------------------------------------------- /后台源码/src/main/java/work/huangxin/mango/mapper/MangoShopMapper.java: -------------------------------------------------------------------------------- 1 | package work.huangxin.mango.mapper; 2 | 3 | import tk.mybatis.mapper.common.Mapper; 4 | import work.huangxin.mango.model.MangoShop; 5 | 6 | import java.util.List; 7 | 8 | public interface MangoShopMapper extends Mapper { 9 | 10 | 11 | } -------------------------------------------------------------------------------- /后台源码/src/main/java/work/huangxin/mango/mapper/MangoSwiperMapper.java: -------------------------------------------------------------------------------- 1 | package work.huangxin.mango.mapper; 2 | 3 | import tk.mybatis.mapper.common.Mapper; 4 | import work.huangxin.mango.model.MangoSwiper; 5 | 6 | public interface MangoSwiperMapper extends Mapper { 7 | } -------------------------------------------------------------------------------- /后台源码/src/main/java/work/huangxin/mango/mapper/MangoUserMapper.java: -------------------------------------------------------------------------------- 1 | package work.huangxin.mango.mapper; 2 | 3 | import tk.mybatis.mapper.common.Mapper; 4 | import work.huangxin.mango.model.MangoUser; 5 | 6 | public interface MangoUserMapper extends Mapper { 7 | 8 | Integer insertUserMessage(MangoUser mangoUser); 9 | 10 | } -------------------------------------------------------------------------------- /后台源码/src/main/java/work/huangxin/mango/model/MangoAttend.java: -------------------------------------------------------------------------------- 1 | package work.huangxin.mango.model; 2 | 3 | import javax.persistence.*; 4 | 5 | @Table(name = "`mango_attend`") 6 | public class MangoAttend { 7 | @Id 8 | @Column(name = "`attend_id`") 9 | private Integer attendId; 10 | 11 | @Column(name = "`user_id`") 12 | private Integer userId; 13 | 14 | @Column(name = "`message_id`") 15 | private Integer messageId; 16 | 17 | /** 18 | * @return attend_id 19 | */ 20 | public Integer getAttendId() { 21 | return attendId; 22 | } 23 | 24 | /** 25 | * @param attendId 26 | */ 27 | public void setAttendId(Integer attendId) { 28 | this.attendId = attendId; 29 | } 30 | 31 | /** 32 | * @return user_id 33 | */ 34 | public Integer getUserId() { 35 | return userId; 36 | } 37 | 38 | /** 39 | * @param userId 40 | */ 41 | public void setUserId(Integer userId) { 42 | this.userId = userId; 43 | } 44 | 45 | /** 46 | * @return message_id 47 | */ 48 | public Integer getMessageId() { 49 | return messageId; 50 | } 51 | 52 | /** 53 | * @param messageId 54 | */ 55 | public void setMessageId(Integer messageId) { 56 | this.messageId = messageId; 57 | } 58 | } -------------------------------------------------------------------------------- /后台源码/src/main/java/work/huangxin/mango/model/MangoCategory.java: -------------------------------------------------------------------------------- 1 | package work.huangxin.mango.model; 2 | 3 | import javax.persistence.*; 4 | 5 | @Table(name = "`mango_category`") 6 | public class MangoCategory { 7 | @Id 8 | @Column(name = "`category_id`") 9 | private Integer categoryId; 10 | 11 | @Column(name = "`category_name`") 12 | private String categoryName; 13 | 14 | @Column(name = "`category_image`") 15 | private String categoryImage; 16 | 17 | /** 18 | * @return category_id 19 | */ 20 | public Integer getCategoryId() { 21 | return categoryId; 22 | } 23 | 24 | /** 25 | * @param categoryId 26 | */ 27 | public void setCategoryId(Integer categoryId) { 28 | this.categoryId = categoryId; 29 | } 30 | 31 | /** 32 | * @return category_name 33 | */ 34 | public String getCategoryName() { 35 | return categoryName; 36 | } 37 | 38 | /** 39 | * @param categoryName 40 | */ 41 | public void setCategoryName(String categoryName) { 42 | this.categoryName = categoryName; 43 | } 44 | 45 | /** 46 | * @return category_image 47 | */ 48 | public String getCategoryImage() { 49 | return categoryImage; 50 | } 51 | 52 | /** 53 | * @param categoryImage 54 | */ 55 | public void setCategoryImage(String categoryImage) { 56 | this.categoryImage = categoryImage; 57 | } 58 | } -------------------------------------------------------------------------------- /后台源码/src/main/java/work/huangxin/mango/model/MangoCollect.java: -------------------------------------------------------------------------------- 1 | package work.huangxin.mango.model; 2 | 3 | import javax.persistence.*; 4 | 5 | @Table(name = "`mango_collect`") 6 | public class MangoCollect { 7 | @Id 8 | @Column(name = "`collect_id`") 9 | private Integer collectId; 10 | 11 | @Column(name = "`user_id`") 12 | private Integer userId; 13 | 14 | @Column(name = "`message_id`") 15 | private Integer messageId; 16 | 17 | /** 18 | * @return collect_id 19 | */ 20 | public Integer getCollectId() { 21 | return collectId; 22 | } 23 | 24 | /** 25 | * @param collectId 26 | */ 27 | public void setCollectId(Integer collectId) { 28 | this.collectId = collectId; 29 | } 30 | 31 | /** 32 | * @return user_id 33 | */ 34 | public Integer getUserId() { 35 | return userId; 36 | } 37 | 38 | /** 39 | * @param userId 40 | */ 41 | public void setUserId(Integer userId) { 42 | this.userId = userId; 43 | } 44 | 45 | /** 46 | * @return message_id 47 | */ 48 | public Integer getMessageId() { 49 | return messageId; 50 | } 51 | 52 | /** 53 | * @param messageId 54 | */ 55 | public void setMessageId(Integer messageId) { 56 | this.messageId = messageId; 57 | } 58 | } -------------------------------------------------------------------------------- /后台源码/src/main/java/work/huangxin/mango/model/MangoComment.java: -------------------------------------------------------------------------------- 1 | package work.huangxin.mango.model; 2 | 3 | import java.util.Date; 4 | import java.util.List; 5 | import javax.persistence.*; 6 | 7 | @Table(name = "`mango_comment`") 8 | public class MangoComment { 9 | @Id 10 | @Column(name = "`comment_id`") 11 | private Integer commentId; 12 | 13 | @Column(name = "`user_id`") 14 | private Integer userId; 15 | 16 | @Column(name = "`message_id`") 17 | private Integer messageId; 18 | 19 | @Column(name = "`comment_detail`") 20 | private String commentDetail; 21 | 22 | @Column(name = "`comment_creat_time`") 23 | private Date commentCreatTime; 24 | private MangoUser mangoUser; 25 | 26 | public MangoUser getMangoUser() { 27 | return mangoUser; 28 | } 29 | 30 | public void setMangoUser(MangoUser mangoUser) { 31 | this.mangoUser = mangoUser; 32 | } 33 | 34 | private List commentReplies; 35 | 36 | public List getCommentReplies() { 37 | return commentReplies; 38 | } 39 | 40 | public void setCommentReplies(List commentReplies) { 41 | this.commentReplies = commentReplies; 42 | } 43 | 44 | /** 45 | * @return comment_id 46 | */ 47 | public Integer getCommentId() { 48 | return commentId; 49 | } 50 | 51 | /** 52 | * @param commentId 53 | */ 54 | public void setCommentId(Integer commentId) { 55 | this.commentId = commentId; 56 | } 57 | 58 | /** 59 | * @return user_id 60 | */ 61 | public Integer getUserId() { 62 | return userId; 63 | } 64 | 65 | /** 66 | * @param userId 67 | */ 68 | public void setUserId(Integer userId) { 69 | this.userId = userId; 70 | } 71 | 72 | /** 73 | * @return message_id 74 | */ 75 | public Integer getMessageId() { 76 | return messageId; 77 | } 78 | 79 | /** 80 | * @param messageId 81 | */ 82 | public void setMessageId(Integer messageId) { 83 | this.messageId = messageId; 84 | } 85 | 86 | /** 87 | * @return comment_detail 88 | */ 89 | public String getCommentDetail() { 90 | return commentDetail; 91 | } 92 | 93 | /** 94 | * @param commentDetail 95 | */ 96 | public void setCommentDetail(String commentDetail) { 97 | this.commentDetail = commentDetail; 98 | } 99 | 100 | /** 101 | * @return comment_creat_time 102 | */ 103 | public Date getCommentCreatTime() { 104 | return commentCreatTime; 105 | } 106 | 107 | /** 108 | * @param commentCreatTime 109 | */ 110 | public void setCommentCreatTime(Date commentCreatTime) { 111 | this.commentCreatTime = commentCreatTime; 112 | } 113 | } -------------------------------------------------------------------------------- /后台源码/src/main/java/work/huangxin/mango/model/MangoMessageImages.java: -------------------------------------------------------------------------------- 1 | package work.huangxin.mango.model; 2 | 3 | import javax.persistence.*; 4 | 5 | @Table(name = "`mango_message_images`") 6 | public class MangoMessageImages { 7 | @Id 8 | @Column(name = "`image_id`") 9 | private Integer imageId; 10 | 11 | @Column(name = "`message_id`") 12 | private Integer messageId; 13 | 14 | @Column(name = "`image_url`") 15 | private String imageUrl; 16 | 17 | /** 18 | * @return image_id 19 | */ 20 | public Integer getImageId() { 21 | return imageId; 22 | } 23 | 24 | /** 25 | * @param imageId 26 | */ 27 | public void setImageId(Integer imageId) { 28 | this.imageId = imageId; 29 | } 30 | 31 | /** 32 | * @return message_id 33 | */ 34 | public Integer getMessageId() { 35 | return messageId; 36 | } 37 | 38 | /** 39 | * @param messageId 40 | */ 41 | public void setMessageId(Integer messageId) { 42 | this.messageId = messageId; 43 | } 44 | 45 | /** 46 | * @return image_url 47 | */ 48 | public String getImageUrl() { 49 | return imageUrl; 50 | } 51 | 52 | /** 53 | * @param imageUrl 54 | */ 55 | public void setImageUrl(String imageUrl) { 56 | this.imageUrl = imageUrl; 57 | } 58 | } -------------------------------------------------------------------------------- /后台源码/src/main/java/work/huangxin/mango/model/MangoNewMessage.java: -------------------------------------------------------------------------------- 1 | package work.huangxin.mango.model; 2 | 3 | import javax.persistence.*; 4 | import java.util.Date; 5 | 6 | @Table(name = "`mango_new_message`") 7 | public class MangoNewMessage { 8 | @Id 9 | @Column(name = "`new_message_id`") 10 | private Integer newMessageId; 11 | 12 | @Column(name = "`user_id`") 13 | private Integer userId; 14 | 15 | @Column(name = "`new_message_type`") 16 | private Integer newMessageType; 17 | 18 | @Column(name = "`message_id`") 19 | private Integer messageId; 20 | 21 | @Column(name = "`new_message_detail`") 22 | private String newMessageDetail; 23 | 24 | public Date getNewMessageTime() { 25 | return newMessageTime; 26 | } 27 | 28 | public void setNewMessageTime(Date newMessageTime) { 29 | this.newMessageTime = newMessageTime; 30 | } 31 | 32 | @Column(name = "`new_message_time`") 33 | private Date newMessageTime; 34 | /** 35 | * @return new_message_id 36 | */ 37 | public Integer getNewMessageId() { 38 | return newMessageId; 39 | } 40 | 41 | /** 42 | * @param newMessageId 43 | */ 44 | public void setNewMessageId(Integer newMessageId) { 45 | this.newMessageId = newMessageId; 46 | } 47 | 48 | /** 49 | * @return user_id 50 | */ 51 | public Integer getUserId() { 52 | return userId; 53 | } 54 | 55 | /** 56 | * @param userId 57 | */ 58 | public void setUserId(Integer userId) { 59 | this.userId = userId; 60 | } 61 | 62 | /** 63 | * @return new_message_type 64 | */ 65 | public Integer getNewMessageType() { 66 | return newMessageType; 67 | } 68 | 69 | /** 70 | * @param newMessageType 71 | */ 72 | public void setNewMessageType(Integer newMessageType) { 73 | this.newMessageType = newMessageType; 74 | } 75 | 76 | /** 77 | * @return message_id 78 | */ 79 | public Integer getMessageId() { 80 | return messageId; 81 | } 82 | 83 | /** 84 | * @param messageId 85 | */ 86 | public void setMessageId(Integer messageId) { 87 | this.messageId = messageId; 88 | } 89 | 90 | /** 91 | * @return new_message_detail 92 | */ 93 | public String getNewMessageDetail() { 94 | return newMessageDetail; 95 | } 96 | 97 | /** 98 | * @param newMessageDetail 99 | */ 100 | public void setNewMessageDetail(String newMessageDetail) { 101 | this.newMessageDetail = newMessageDetail; 102 | } 103 | } -------------------------------------------------------------------------------- /后台源码/src/main/java/work/huangxin/mango/model/MangoNotice.java: -------------------------------------------------------------------------------- 1 | package work.huangxin.mango.model; 2 | 3 | import javax.persistence.*; 4 | 5 | @Table(name = "`mango_notice`") 6 | public class MangoNotice { 7 | @Id 8 | @Column(name = "`notice_id`") 9 | private Integer noticeId; 10 | 11 | @Column(name = "`notice_detail`") 12 | private String noticeDetail; 13 | 14 | /** 15 | * @return notice_id 16 | */ 17 | public Integer getNoticeId() { 18 | return noticeId; 19 | } 20 | 21 | /** 22 | * @param noticeId 23 | */ 24 | public void setNoticeId(Integer noticeId) { 25 | this.noticeId = noticeId; 26 | } 27 | 28 | /** 29 | * @return notice_detail 30 | */ 31 | public String getNoticeDetail() { 32 | return noticeDetail; 33 | } 34 | 35 | /** 36 | * @param noticeDetail 37 | */ 38 | public void setNoticeDetail(String noticeDetail) { 39 | this.noticeDetail = noticeDetail; 40 | } 41 | } -------------------------------------------------------------------------------- /后台源码/src/main/java/work/huangxin/mango/model/MangoShopBusiness.java: -------------------------------------------------------------------------------- 1 | package work.huangxin.mango.model; 2 | 3 | import java.math.BigDecimal; 4 | import javax.persistence.*; 5 | 6 | @Table(name = "`mango_shop_business`") 7 | public class MangoShopBusiness { 8 | @Id 9 | @Column(name = "`business_id`") 10 | private Integer businessId; 11 | 12 | @Column(name = "`shop_id`") 13 | private Integer shopId; 14 | 15 | @Column(name = "`shop_goods_image`") 16 | private String shopGoodsImage; 17 | 18 | @Column(name = "`shop_goods_title`") 19 | private String shopGoodsTitle; 20 | 21 | @Column(name = "`shop_goods_price`") 22 | private BigDecimal shopGoodsPrice; 23 | 24 | /** 25 | * @return business_id 26 | */ 27 | public Integer getBusinessId() { 28 | return businessId; 29 | } 30 | 31 | /** 32 | * @param businessId 33 | */ 34 | public void setBusinessId(Integer businessId) { 35 | this.businessId = businessId; 36 | } 37 | 38 | /** 39 | * @return shop_id 40 | */ 41 | public Integer getShopId() { 42 | return shopId; 43 | } 44 | 45 | /** 46 | * @param shopId 47 | */ 48 | public void setShopId(Integer shopId) { 49 | this.shopId = shopId; 50 | } 51 | 52 | /** 53 | * @return shop_goods_image 54 | */ 55 | public String getShopGoodsImage() { 56 | return shopGoodsImage; 57 | } 58 | 59 | /** 60 | * @param shopGoodsImage 61 | */ 62 | public void setShopGoodsImage(String shopGoodsImage) { 63 | this.shopGoodsImage = shopGoodsImage; 64 | } 65 | 66 | /** 67 | * @return shop_goods_title 68 | */ 69 | public String getShopGoodsTitle() { 70 | return shopGoodsTitle; 71 | } 72 | 73 | /** 74 | * @param shopGoodsTitle 75 | */ 76 | public void setShopGoodsTitle(String shopGoodsTitle) { 77 | this.shopGoodsTitle = shopGoodsTitle; 78 | } 79 | 80 | /** 81 | * @return shop_goods_price 82 | */ 83 | public BigDecimal getShopGoodsPrice() { 84 | return shopGoodsPrice; 85 | } 86 | 87 | /** 88 | * @param shopGoodsPrice 89 | */ 90 | public void setShopGoodsPrice(BigDecimal shopGoodsPrice) { 91 | this.shopGoodsPrice = shopGoodsPrice; 92 | } 93 | } -------------------------------------------------------------------------------- /后台源码/src/main/java/work/huangxin/mango/model/MangoShopImages.java: -------------------------------------------------------------------------------- 1 | package work.huangxin.mango.model; 2 | 3 | import javax.persistence.*; 4 | 5 | @Table(name = "`mango_shop_images`") 6 | public class MangoShopImages { 7 | @Id 8 | @Column(name = "`shop_detail_id`") 9 | private Integer shopDetailId; 10 | 11 | @Column(name = "`shop_id`") 12 | private Integer shopId; 13 | 14 | @Column(name = "`shop_images`") 15 | private String shopImages; 16 | 17 | /** 18 | * @return shop_detail_id 19 | */ 20 | public Integer getShopDetailId() { 21 | return shopDetailId; 22 | } 23 | 24 | /** 25 | * @param shopDetailId 26 | */ 27 | public void setShopDetailId(Integer shopDetailId) { 28 | this.shopDetailId = shopDetailId; 29 | } 30 | 31 | /** 32 | * @return shop_id 33 | */ 34 | public Integer getShopId() { 35 | return shopId; 36 | } 37 | 38 | /** 39 | * @param shopId 40 | */ 41 | public void setShopId(Integer shopId) { 42 | this.shopId = shopId; 43 | } 44 | 45 | /** 46 | * @return shop_images 47 | */ 48 | public String getShopImages() { 49 | return shopImages; 50 | } 51 | 52 | /** 53 | * @param shopImages 54 | */ 55 | public void setShopImages(String shopImages) { 56 | this.shopImages = shopImages; 57 | } 58 | } -------------------------------------------------------------------------------- /后台源码/src/main/java/work/huangxin/mango/model/MangoSwiper.java: -------------------------------------------------------------------------------- 1 | package work.huangxin.mango.model; 2 | 3 | import javax.persistence.*; 4 | 5 | @Table(name = "`mango_swiper`") 6 | public class MangoSwiper { 7 | @Id 8 | @Column(name = "`swiper_id`") 9 | private Integer swiperId; 10 | 11 | @Column(name = "`swiper_image_url`") 12 | private String swiperImageUrl; 13 | 14 | /** 15 | * @return swiper_id 16 | */ 17 | public Integer getSwiperId() { 18 | return swiperId; 19 | } 20 | 21 | /** 22 | * @param swiperId 23 | */ 24 | public void setSwiperId(Integer swiperId) { 25 | this.swiperId = swiperId; 26 | } 27 | 28 | /** 29 | * @return swiper_image_url 30 | */ 31 | public String getSwiperImageUrl() { 32 | return swiperImageUrl; 33 | } 34 | 35 | /** 36 | * @param swiperImageUrl 37 | */ 38 | public void setSwiperImageUrl(String swiperImageUrl) { 39 | this.swiperImageUrl = swiperImageUrl; 40 | } 41 | } -------------------------------------------------------------------------------- /后台源码/src/main/java/work/huangxin/mango/model/MangoUser.java: -------------------------------------------------------------------------------- 1 | package work.huangxin.mango.model; 2 | 3 | import java.util.Date; 4 | import javax.persistence.*; 5 | 6 | @Table(name = "`mango_user`") 7 | public class MangoUser { 8 | @Id 9 | @Column(name = "`user_id`") 10 | private Integer userId; 11 | 12 | @Column(name = "`user_openid`") 13 | private String userOpenid; 14 | 15 | @Column(name = "`user_gender`") 16 | private Integer userGender; 17 | 18 | @Column(name = "`user_avatar`") 19 | private String userAvatar; 20 | 21 | @Column(name = "`user_nickname`") 22 | private String userNickname; 23 | 24 | @Column(name = "`user_is_admin`") 25 | private Integer userIsAdmin; 26 | 27 | @Column(name = "`user_allow`") 28 | private Integer userAllow; 29 | 30 | @Column(name = "`user_creat_time`") 31 | private Date userCreatTime; 32 | 33 | /** 34 | * @return user_id 35 | */ 36 | public Integer getUserId() { 37 | return userId; 38 | } 39 | 40 | /** 41 | * @param userId 42 | */ 43 | public void setUserId(Integer userId) { 44 | this.userId = userId; 45 | } 46 | 47 | /** 48 | * @return user_openid 49 | */ 50 | public String getUserOpenid() { 51 | return userOpenid; 52 | } 53 | 54 | /** 55 | * @param userOpenid 56 | */ 57 | public void setUserOpenid(String userOpenid) { 58 | this.userOpenid = userOpenid; 59 | } 60 | 61 | /** 62 | * @return user_gender 63 | */ 64 | public Integer getUserGender() { 65 | return userGender; 66 | } 67 | 68 | /** 69 | * @param userGender 70 | */ 71 | public void setUserGender(Integer userGender) { 72 | this.userGender = userGender; 73 | } 74 | 75 | /** 76 | * @return user_avatar 77 | */ 78 | public String getUserAvatar() { 79 | return userAvatar; 80 | } 81 | 82 | /** 83 | * @param userAvatar 84 | */ 85 | public void setUserAvatar(String userAvatar) { 86 | this.userAvatar = userAvatar; 87 | } 88 | 89 | /** 90 | * @return user_nickname 91 | */ 92 | public String getUserNickname() { 93 | return userNickname; 94 | } 95 | 96 | /** 97 | * @param userNickname 98 | */ 99 | public void setUserNickname(String userNickname) { 100 | this.userNickname = userNickname; 101 | } 102 | 103 | /** 104 | * @return user_is_admin 105 | */ 106 | public Integer getUserIsAdmin() { 107 | return userIsAdmin; 108 | } 109 | 110 | /** 111 | * @param userIsAdmin 112 | */ 113 | public void setUserIsAdmin(Integer userIsAdmin) { 114 | this.userIsAdmin = userIsAdmin; 115 | } 116 | 117 | /** 118 | * @return user_allow 119 | */ 120 | public Integer getUserAllow() { 121 | return userAllow; 122 | } 123 | 124 | /** 125 | * @param userAllow 126 | */ 127 | public void setUserAllow(Integer userAllow) { 128 | this.userAllow = userAllow; 129 | } 130 | 131 | /** 132 | * @return user_creat_time 133 | */ 134 | public Date getUserCreatTime() { 135 | return userCreatTime; 136 | } 137 | 138 | /** 139 | * @param userCreatTime 140 | */ 141 | public void setUserCreatTime(Date userCreatTime) { 142 | this.userCreatTime = userCreatTime; 143 | } 144 | } -------------------------------------------------------------------------------- /后台源码/src/main/java/work/huangxin/mango/model/WXSessionModel.java: -------------------------------------------------------------------------------- 1 | package work.huangxin.mango.model; 2 | 3 | public class WXSessionModel { 4 | 5 | private String session_key; 6 | private String openid; 7 | 8 | public String getSession_key() { 9 | return session_key; 10 | } 11 | 12 | public void setSession_key(String session_key) { 13 | this.session_key = session_key; 14 | } 15 | 16 | public String getOpenid() { 17 | return openid; 18 | } 19 | 20 | public void setOpenid(String openid) { 21 | this.openid = openid; 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /后台源码/src/main/java/work/huangxin/mango/otherMethod/DeleteAliyunFile.java: -------------------------------------------------------------------------------- 1 | package work.huangxin.mango.otherMethod; 2 | 3 | import com.aliyun.oss.OSSClient; 4 | 5 | public class DeleteAliyunFile { 6 | 7 | public Boolean DeleteAliyunFile(String filePath, OSSClient ossClient, String bucketName) { 8 | try { 9 | 10 | // 删除文件。 11 | ossClient.deleteObject(bucketName, filePath); 12 | 13 | 14 | return true; 15 | } catch (Exception e) { 16 | return false; 17 | } 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /后台源码/src/main/java/work/huangxin/mango/service/MangoAttendService.java: -------------------------------------------------------------------------------- 1 | package work.huangxin.mango.service; 2 | 3 | import org.springframework.beans.factory.annotation.Autowired; 4 | import org.springframework.stereotype.Service; 5 | import work.huangxin.mango.mapper.MangoAttendMapper; 6 | import work.huangxin.mango.model.MangoAttend; 7 | import work.huangxin.mango.util.SameService; 8 | 9 | import java.util.List; 10 | 11 | @Service 12 | public class MangoAttendService extends SameService { 13 | 14 | @Autowired 15 | private MangoAttendMapper mangoAttendMapper; 16 | 17 | public List getAllAttendMessageByUserId(Integer id) { 18 | return mangoAttendMapper.getAllAttendMessageByUserId(id); 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /后台源码/src/main/java/work/huangxin/mango/service/MangoCategoryService.java: -------------------------------------------------------------------------------- 1 | package work.huangxin.mango.service; 2 | 3 | import org.springframework.stereotype.Service; 4 | import work.huangxin.mango.model.MangoCategory; 5 | import work.huangxin.mango.util.SameService; 6 | @Service 7 | public class MangoCategoryService extends SameService { 8 | } 9 | -------------------------------------------------------------------------------- /后台源码/src/main/java/work/huangxin/mango/service/MangoCollectService.java: -------------------------------------------------------------------------------- 1 | package work.huangxin.mango.service; 2 | 3 | import org.springframework.beans.factory.annotation.Autowired; 4 | import org.springframework.stereotype.Service; 5 | import work.huangxin.mango.mapper.MangoCollectMapper; 6 | import work.huangxin.mango.model.MangoCollect; 7 | import work.huangxin.mango.util.SameService; 8 | 9 | import java.util.List; 10 | 11 | @Service 12 | public class MangoCollectService extends SameService { 13 | 14 | @Autowired 15 | private MangoCollectMapper mangoCollectMapper; 16 | 17 | public List getAllCollectionMessageByUserId(Integer userId) { 18 | return mangoCollectMapper.getAllCollectionMessageByUserId(userId); 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /后台源码/src/main/java/work/huangxin/mango/service/MangoCommentReplayService.java: -------------------------------------------------------------------------------- 1 | package work.huangxin.mango.service; 2 | 3 | import org.springframework.stereotype.Service; 4 | import work.huangxin.mango.model.MangoCommentReply; 5 | import work.huangxin.mango.util.SameService; 6 | 7 | @Service 8 | public class MangoCommentReplayService extends SameService { 9 | } 10 | -------------------------------------------------------------------------------- /后台源码/src/main/java/work/huangxin/mango/service/MangoCommentService.java: -------------------------------------------------------------------------------- 1 | package work.huangxin.mango.service; 2 | 3 | import org.springframework.stereotype.Service; 4 | import work.huangxin.mango.model.MangoComment; 5 | import work.huangxin.mango.util.SameService; 6 | 7 | @Service 8 | public class MangoCommentService extends SameService { 9 | } 10 | -------------------------------------------------------------------------------- /后台源码/src/main/java/work/huangxin/mango/service/MangoMessageDetailService.java: -------------------------------------------------------------------------------- 1 | package work.huangxin.mango.service; 2 | 3 | import org.springframework.beans.factory.annotation.Autowired; 4 | import org.springframework.stereotype.Service; 5 | import work.huangxin.mango.mapper.MangoMessageMapper; 6 | import work.huangxin.mango.model.MangoMessage; 7 | import work.huangxin.mango.util.SameService; 8 | 9 | import java.util.List; 10 | 11 | @Service 12 | public class MangoMessageDetailService extends SameService { 13 | 14 | @Autowired 15 | private MangoMessageMapper mangoMessageMapper; 16 | 17 | public MangoMessage getLostMessage() { 18 | return mangoMessageMapper.getLostMessage(); 19 | } 20 | 21 | public Integer insertMessageDetail(MangoMessage mangoMessage) { 22 | return mangoMessageMapper.insertMessageDetail(mangoMessage); 23 | } 24 | 25 | public List getAllMessage() { 26 | return mangoMessageMapper.getAllMessage(); 27 | } 28 | 29 | /** 30 | * 查询分类所有 31 | * 32 | * @param id 33 | * @return 34 | */ 35 | public List getMessageByCategoryId(Integer id) { 36 | return mangoMessageMapper.getMessageByCategoryId(id); 37 | } 38 | 39 | /** 40 | * 在分类里查询信息 41 | */ 42 | 43 | public List getMessageByCategoryAndKeyword(Integer id, String keyword) { 44 | return mangoMessageMapper.getMessageByCategoryAndKeyword(id, keyword); 45 | } 46 | 47 | /** 48 | * 全局查询 49 | */ 50 | public List getMessageByKeyword(String keyword){ 51 | return mangoMessageMapper.getMessageByKeyword(keyword); 52 | } 53 | 54 | /** 55 | * 通过用户id查询 56 | */ 57 | public List getMessageDetailByUserId(Integer userId) { 58 | return mangoMessageMapper.getMessageDetailByUserId(userId); 59 | } 60 | 61 | /** 62 | * 删除对应信息下的所有评论以及回复 63 | */ 64 | public void deleteCommentAndReply(Integer messageId) { 65 | 66 | mangoMessageMapper.deleteCommentAndReply(messageId); 67 | } 68 | } 69 | -------------------------------------------------------------------------------- /后台源码/src/main/java/work/huangxin/mango/service/MangoMessageImagesService.java: -------------------------------------------------------------------------------- 1 | package work.huangxin.mango.service; 2 | 3 | import org.springframework.stereotype.Service; 4 | import work.huangxin.mango.model.MangoMessageImages; 5 | import work.huangxin.mango.util.SameService; 6 | 7 | @Service 8 | public class MangoMessageImagesService extends SameService { 9 | } 10 | -------------------------------------------------------------------------------- /后台源码/src/main/java/work/huangxin/mango/service/MangoNewMessageService.java: -------------------------------------------------------------------------------- 1 | package work.huangxin.mango.service; 2 | 3 | import org.springframework.beans.factory.annotation.Autowired; 4 | import org.springframework.stereotype.Service; 5 | import work.huangxin.mango.mapper.MangoNewMessageMapper; 6 | import work.huangxin.mango.model.MangoNewMessage; 7 | import work.huangxin.mango.util.SameService; 8 | 9 | import java.util.List; 10 | 11 | @Service 12 | public class MangoNewMessageService extends SameService { 13 | 14 | 15 | @Autowired 16 | private MangoNewMessageMapper mangoNewMessageMapper; 17 | 18 | public List getAllNewMessage(Integer userId) { 19 | return mangoNewMessageMapper.getAllNewMessage(userId); 20 | } 21 | 22 | public MangoNewMessage getLastNewMessage(Integer id) { 23 | return mangoNewMessageMapper.getLastNewMessage(id); 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /后台源码/src/main/java/work/huangxin/mango/service/MangoNoticeService.java: -------------------------------------------------------------------------------- 1 | package work.huangxin.mango.service; 2 | 3 | import org.springframework.stereotype.Service; 4 | import work.huangxin.mango.model.MangoNotice; 5 | import work.huangxin.mango.util.SameService; 6 | 7 | @Service 8 | public class MangoNoticeService extends SameService { 9 | } 10 | -------------------------------------------------------------------------------- /后台源码/src/main/java/work/huangxin/mango/service/MangoShopBusinessService.java: -------------------------------------------------------------------------------- 1 | package work.huangxin.mango.service; 2 | 3 | import org.springframework.stereotype.Service; 4 | import work.huangxin.mango.model.MangoShopBusiness; 5 | import work.huangxin.mango.util.SameService; 6 | 7 | @Service 8 | 9 | public class MangoShopBusinessService extends SameService { 10 | } 11 | -------------------------------------------------------------------------------- /后台源码/src/main/java/work/huangxin/mango/service/MangoShopImagesService.java: -------------------------------------------------------------------------------- 1 | package work.huangxin.mango.service; 2 | 3 | import org.springframework.stereotype.Service; 4 | import work.huangxin.mango.model.MangoShopImages; 5 | import work.huangxin.mango.util.SameService; 6 | 7 | @Service 8 | public class MangoShopImagesService extends SameService { 9 | 10 | 11 | } 12 | -------------------------------------------------------------------------------- /后台源码/src/main/java/work/huangxin/mango/service/MangoShopService.java: -------------------------------------------------------------------------------- 1 | package work.huangxin.mango.service; 2 | 3 | import org.springframework.beans.factory.annotation.Autowired; 4 | import org.springframework.stereotype.Service; 5 | import work.huangxin.mango.mapper.MangoShopMapper; 6 | import work.huangxin.mango.model.MangoShop; 7 | import work.huangxin.mango.util.SameService; 8 | 9 | @Service 10 | public class MangoShopService extends SameService { 11 | @Autowired 12 | private MangoShopMapper mangoShopMapper; 13 | 14 | 15 | } 16 | -------------------------------------------------------------------------------- /后台源码/src/main/java/work/huangxin/mango/service/MangoSwiperService.java: -------------------------------------------------------------------------------- 1 | package work.huangxin.mango.service; 2 | 3 | import org.springframework.stereotype.Service; 4 | import work.huangxin.mango.model.MangoSwiper; 5 | import work.huangxin.mango.util.SameService; 6 | @Service 7 | public class MangoSwiperService extends SameService { 8 | } 9 | -------------------------------------------------------------------------------- /后台源码/src/main/java/work/huangxin/mango/service/MangoUserService.java: -------------------------------------------------------------------------------- 1 | package work.huangxin.mango.service; 2 | 3 | import org.springframework.beans.factory.annotation.Autowired; 4 | import org.springframework.stereotype.Service; 5 | import work.huangxin.mango.mapper.MangoUserMapper; 6 | import work.huangxin.mango.model.MangoUser; 7 | import work.huangxin.mango.util.SameService; 8 | 9 | import java.util.List; 10 | 11 | @Service 12 | public class MangoUserService extends SameService { 13 | 14 | @Autowired 15 | private MangoUserMapper mangoUserMapper; 16 | 17 | /** 18 | * 新用户插入 19 | * 20 | * @param mangoUser 21 | * @return 22 | */ 23 | public Integer insertUserMessage(MangoUser mangoUser) { 24 | return mangoUserMapper.insertUserMessage(mangoUser); 25 | } 26 | 27 | /** 28 | * 得到符合条件的用户数 29 | * 30 | * @param mangoUser 31 | * @return 32 | */ 33 | 34 | public Integer getUserCount(MangoUser mangoUser) { 35 | return mangoUserMapper.selectCount(mangoUser); 36 | } 37 | 38 | /** 39 | * 更新用户信息 40 | * 41 | * @param mangoUser 42 | */ 43 | public void updateUserMessage(MangoUser mangoUser) { 44 | mangoUserMapper.updateByPrimaryKey(mangoUser); 45 | } 46 | 47 | /** 48 | * 返回符合条件的用户信息 49 | */ 50 | public List getUserMessageByOtherMessage(MangoUser mangoUser) { 51 | return mangoUserMapper.select(mangoUser); 52 | } 53 | 54 | } 55 | -------------------------------------------------------------------------------- /后台源码/src/main/java/work/huangxin/mango/util/SameService.java: -------------------------------------------------------------------------------- 1 | package work.huangxin.mango.util; 2 | 3 | import com.github.pagehelper.PageHelper; 4 | import com.github.pagehelper.PageInfo; 5 | import org.apache.ibatis.session.RowBounds; 6 | import org.springframework.beans.factory.annotation.Autowired; 7 | import tk.mybatis.mapper.common.Mapper; 8 | 9 | import java.util.List; 10 | 11 | 12 | public class SameService { 13 | /** 14 | * 泛型注入 15 | */ 16 | @Autowired 17 | private Mapper mapper; 18 | 19 | /** 20 | * 按条件分页查询 21 | * 22 | * @param t 查询条件 23 | * @param pageNum 当前页码 24 | * @param pageSize 一页显示多少条 25 | * @return 26 | */ 27 | public PageInfo findPage(T t, int pageNum, int pageSize) { 28 | PageHelper.startPage(pageNum, pageSize); 29 | List list = findList(t); 30 | return new PageInfo(list); 31 | } 32 | 33 | /** 34 | * 查询所有 35 | * 36 | * @return 37 | */ 38 | public List findAll() { 39 | return mapper.selectAll(); 40 | } 41 | 42 | /** 43 | * 通过条件查询 44 | * 45 | * @param param 46 | * @return 47 | */ 48 | public List findList(T param) { 49 | return mapper.select(param); 50 | } 51 | 52 | /** 53 | * 通过条件查询,分页查询 54 | * 55 | * @param t 查询条件 56 | * @param pageNum 当前页码 57 | * @param pageSize 一页显示多少条 58 | * @return 59 | */ 60 | public List findList(T t, int pageNum, int pageSize) { 61 | return mapper.selectByRowBounds(t, new RowBounds(pageNum, pageSize)); 62 | } 63 | 64 | /** 65 | * 通过条件查一个 66 | * 67 | * @param t 68 | */ 69 | public void findOne(T t) { 70 | mapper.selectOne(t); 71 | } 72 | 73 | /** 74 | * 通过id查询 75 | * 76 | * @param id 77 | * @return 78 | */ 79 | public T getById(Object id) { 80 | return (T) mapper.selectByPrimaryKey(id); 81 | 82 | } 83 | 84 | /** 85 | * 通过id删除 86 | * 87 | * @param id 88 | */ 89 | 90 | public void deleteById(Object id) { 91 | mapper.deleteByPrimaryKey(id); 92 | } 93 | 94 | /** 95 | * 添加信息 96 | * 97 | * @param t 98 | */ 99 | 100 | public void add(T t) { 101 | mapper.insertSelective(t); 102 | } 103 | 104 | /** 105 | * 更新商品信息 106 | * 107 | * @param t 108 | */ 109 | public void update(T t) { 110 | mapper.updateByPrimaryKeySelective(t); 111 | } 112 | 113 | /** 114 | * 返回对应条件的信息数 115 | * 116 | * @param t 117 | * @return 118 | */ 119 | public Integer findCount(T t) { 120 | return mapper.selectCount(t); 121 | } 122 | 123 | /** 124 | * 通过指定条件删除 125 | * 126 | * @param param 127 | */ 128 | 129 | public void delete(T param) { 130 | mapper.delete(param); 131 | } 132 | } 133 | -------------------------------------------------------------------------------- /后台源码/src/main/java/work/huangxin/mango/util/Upload/IsUpload.java: -------------------------------------------------------------------------------- 1 | package work.huangxin.mango.util.Upload; 2 | 3 | import work.huangxin.mango.model.MangoMessage; 4 | import work.huangxin.mango.model.MangoMessageImages; 5 | import work.huangxin.mango.model.MangoUser; 6 | import work.huangxin.mango.service.MangoMessageDetailService; 7 | import work.huangxin.mango.service.MangoMessageImagesService; 8 | import work.huangxin.mango.service.MangoUserService; 9 | 10 | import java.util.List; 11 | 12 | public class IsUpload { 13 | 14 | /** 15 | * 500 服务器错误 16 | * 200 上传成功 17 | * 403 不允许发布,拉黑 18 | * 400 数据出现问题 19 | * 401 未登录 20 | * 1000 非法入侵 21 | */ 22 | private Integer code; 23 | 24 | public Integer getCode() { 25 | return code; 26 | } 27 | 28 | public void setCode(Integer code) { 29 | this.code = code; 30 | } 31 | 32 | 33 | public IsUpload isTrue(MangoMessage mangoMessage, MangoMessageDetailService mangoMessageDetailService, MangoMessageImagesService mangoMessageImagesService, MangoUserService mangoUserService) { 34 | IsUpload isUpload = new IsUpload(); 35 | 36 | MangoUser user = mangoUserService.getById(mangoMessage.getUserId()); 37 | 38 | if (user == null) { 39 | isUpload.setCode(1000); 40 | return isUpload; 41 | } 42 | 43 | if(user.getUserAllow()!=1){ 44 | isUpload.setCode(301); 45 | return isUpload; 46 | } 47 | 48 | List resultImage = mangoMessage.getResultImage(); 49 | 50 | mangoMessageDetailService.insertMessageDetail(mangoMessage); 51 | 52 | for (int i = 0; i < resultImage.size(); i++) { 53 | MangoMessageImages mangoMessageImages = new MangoMessageImages(); 54 | mangoMessageImages.setImageUrl(resultImage.get(i)); 55 | mangoMessageImages.setMessageId(mangoMessage.getMessageId()); 56 | mangoMessageImagesService.add(mangoMessageImages); 57 | } 58 | 59 | isUpload.setCode(200); 60 | 61 | return isUpload; 62 | 63 | 64 | } 65 | 66 | } 67 | -------------------------------------------------------------------------------- /后台源码/src/main/java/work/huangxin/mango/util/common/JsonUtils.java: -------------------------------------------------------------------------------- 1 | package work.huangxin.mango.util.common; 2 | 3 | import com.fasterxml.jackson.core.JsonProcessingException; 4 | import com.fasterxml.jackson.databind.JavaType; 5 | import com.fasterxml.jackson.databind.ObjectMapper; 6 | 7 | import java.util.List; 8 | 9 | /** 10 | * 11 | * @Title: JsonUtils.java 12 | * @Package com.lee.utils 13 | * @Description: 自定义响应结构, 转换类 14 | * Copyright: Copyright (c) 2016 15 | * Company:Nathan.Lee.Salvatore 16 | * 17 | * @author leechenxiang 18 | * @date 2016年4月29日 下午11:05:03 19 | * @version V1.0 20 | */ 21 | public class JsonUtils { 22 | 23 | // 定义jackson对象 24 | private static final ObjectMapper MAPPER = new ObjectMapper(); 25 | 26 | /** 27 | * 将对象转换成json字符串。 28 | *

Title: pojoToJson

29 | *

Description:

30 | * @param data 31 | * @return 32 | */ 33 | public static String objectToJson(Object data) { 34 | try { 35 | String string = MAPPER.writeValueAsString(data); 36 | return string; 37 | } catch (JsonProcessingException e) { 38 | e.printStackTrace(); 39 | } 40 | return null; 41 | } 42 | 43 | /** 44 | * 将json结果集转化为对象 45 | * 46 | * @param jsonData json数据 47 | * @param beanType 对象中的object类型 48 | * @return 49 | */ 50 | public static T jsonToPojo(String jsonData, Class beanType) { 51 | try { 52 | T t = MAPPER.readValue(jsonData, beanType); 53 | return t; 54 | } catch (Exception e) { 55 | e.printStackTrace(); 56 | } 57 | return null; 58 | } 59 | 60 | /** 61 | * 将json数据转换成pojo对象list 62 | *

Title: jsonToList

63 | *

Description:

64 | * @param jsonData 65 | * @param beanType 66 | * @return 67 | */ 68 | public static List jsonToList(String jsonData, Class beanType) { 69 | JavaType javaType = MAPPER.getTypeFactory().constructParametricType(List.class, beanType); 70 | try { 71 | List list = MAPPER.readValue(jsonData, javaType); 72 | return list; 73 | } catch (Exception e) { 74 | e.printStackTrace(); 75 | } 76 | 77 | return null; 78 | } 79 | 80 | 81 | 82 | } 83 | -------------------------------------------------------------------------------- /后台源码/src/main/java/work/huangxin/mango/util/isCollect/IsCollect.java: -------------------------------------------------------------------------------- 1 | package work.huangxin.mango.util.isCollect; 2 | 3 | import work.huangxin.mango.model.MangoCollect; 4 | import work.huangxin.mango.model.MangoUser; 5 | import work.huangxin.mango.service.MangoCollectService; 6 | import work.huangxin.mango.service.MangoUserService; 7 | 8 | public class IsCollect { 9 | 10 | private Integer code; 11 | 12 | public Integer getCode() { 13 | return code; 14 | } 15 | 16 | public void setCode(Integer code) { 17 | this.code = code; 18 | } 19 | 20 | 21 | public IsCollect isTrue(Integer userId, Integer messageId, MangoCollectService mangoCollectService, MangoUserService mangoUserService) { 22 | 23 | IsCollect isCollect = new IsCollect(); 24 | isCollect.setCode(500); 25 | MangoUser user = mangoUserService.getById(userId); 26 | if (user == null) { 27 | isCollect.setCode(400); 28 | return isCollect; 29 | } 30 | 31 | MangoCollect mangoCollect = new MangoCollect(); 32 | mangoCollect.setUserId(userId); 33 | mangoCollect.setMessageId(messageId); 34 | mangoCollectService.add(mangoCollect); 35 | 36 | isCollect.setCode(200); 37 | 38 | return isCollect; 39 | 40 | } 41 | } 42 | -------------------------------------------------------------------------------- /后台源码/src/main/java/work/huangxin/mango/util/isComment/IsComment.java: -------------------------------------------------------------------------------- 1 | package work.huangxin.mango.util.isComment; 2 | 3 | import work.huangxin.mango.model.MangoAttend; 4 | import work.huangxin.mango.model.MangoComment; 5 | import work.huangxin.mango.model.MangoNewMessage; 6 | import work.huangxin.mango.model.MangoUser; 7 | import work.huangxin.mango.service.MangoAttendService; 8 | import work.huangxin.mango.service.MangoCommentService; 9 | import work.huangxin.mango.service.MangoNewMessageService; 10 | import work.huangxin.mango.service.MangoUserService; 11 | 12 | public class IsComment { 13 | 14 | private Integer code; 15 | 16 | public Integer getCode() { 17 | return code; 18 | } 19 | 20 | public void setCode(Integer code) { 21 | this.code = code; 22 | } 23 | 24 | public IsComment isTrue(Integer userId, Integer messageId, String userComment, Integer messageUserId, MangoUserService mangoUserService, MangoCommentService mangoCommentService, MangoNewMessageService mangoNewMessageService, MangoAttendService mangoAttendService) { 25 | IsComment isComment = new IsComment(); 26 | isComment.setCode(500); 27 | MangoUser user = mangoUserService.getById(userId); 28 | if (user == null) { 29 | isComment.setCode(400); 30 | return isComment; 31 | } 32 | 33 | if(user.getUserAllow()!=1){ 34 | isComment.setCode(301); 35 | return isComment; 36 | } 37 | 38 | MangoComment mangoComment = new MangoComment(); 39 | mangoComment.setMessageId(messageId); 40 | mangoComment.setUserId(userId); 41 | mangoComment.setCommentDetail(userComment); 42 | mangoCommentService.add(mangoComment); 43 | 44 | if(userId!=messageUserId) { 45 | MangoNewMessage mangoNewMessage = new MangoNewMessage(); 46 | mangoNewMessage.setUserId(messageUserId); 47 | mangoNewMessage.setNewMessageType(1); 48 | mangoNewMessage.setNewMessageDetail(userComment); 49 | mangoNewMessage.setMessageId(messageId); 50 | mangoNewMessageService.add(mangoNewMessage); 51 | } 52 | MangoAttend mangoAttend = new MangoAttend(); 53 | 54 | mangoAttend.setMessageId(messageId); 55 | mangoAttend.setUserId(userId); 56 | 57 | if (mangoAttendService.findCount(mangoAttend) != 0) { 58 | isComment.setCode(200); 59 | return isComment; 60 | } 61 | 62 | 63 | mangoAttendService.add(mangoAttend); 64 | 65 | isComment.setCode(200); 66 | return isComment; 67 | } 68 | } 69 | -------------------------------------------------------------------------------- /后台源码/src/main/java/work/huangxin/mango/util/isCommentReply/IsCommentReply.java: -------------------------------------------------------------------------------- 1 | package work.huangxin.mango.util.isCommentReply; 2 | 3 | import work.huangxin.mango.model.MangoAttend; 4 | import work.huangxin.mango.model.MangoCommentReply; 5 | import work.huangxin.mango.model.MangoNewMessage; 6 | import work.huangxin.mango.model.MangoUser; 7 | import work.huangxin.mango.service.MangoAttendService; 8 | import work.huangxin.mango.service.MangoCommentReplayService; 9 | import work.huangxin.mango.service.MangoNewMessageService; 10 | import work.huangxin.mango.service.MangoUserService; 11 | 12 | public class IsCommentReply { 13 | private Integer code; 14 | 15 | public Integer getCode() { 16 | return code; 17 | } 18 | 19 | public void setCode(Integer code) { 20 | this.code = code; 21 | } 22 | 23 | public IsCommentReply isTrue(Integer messageId, MangoCommentReply mangoCommentReply, MangoUserService mangoUserService, MangoCommentReplayService mangoCommentReplayService, MangoNewMessageService mangoNewMessageService, MangoAttendService mangoAttendService) { 24 | IsCommentReply isCommentReply = new IsCommentReply(); 25 | isCommentReply.setCode(500); 26 | MangoUser user = mangoUserService.getById(mangoCommentReply.getReplayUserId()); 27 | if (user == null) { 28 | isCommentReply.setCode(400); 29 | return isCommentReply; 30 | } 31 | 32 | if(user.getUserAllow()!=1){ 33 | isCommentReply.setCode(301); 34 | return isCommentReply; 35 | } 36 | 37 | mangoCommentReplayService.add(mangoCommentReply); 38 | 39 | 40 | if (mangoCommentReply.getReceiveUserId() == mangoCommentReply.getReplayUserId()) { 41 | isCommentReply.setCode(200); 42 | return isCommentReply; 43 | } 44 | 45 | if(mangoCommentReply.getReplayUserId()!=mangoCommentReply.getReceiveUserId()) { 46 | MangoNewMessage mangoNewMessage = new MangoNewMessage(); 47 | mangoNewMessage.setUserId(mangoCommentReply.getReceiveUserId()); 48 | mangoNewMessage.setNewMessageType(2); 49 | mangoNewMessage.setMessageId(messageId); 50 | mangoNewMessage.setNewMessageDetail(mangoCommentReply.getReplyDetail()); 51 | mangoNewMessageService.add(mangoNewMessage); 52 | } 53 | 54 | MangoAttend mangoAttend = new MangoAttend(); 55 | mangoAttend.setMessageId(messageId); 56 | mangoAttend.setUserId(mangoCommentReply.getReplayUserId()); 57 | 58 | if (mangoAttendService.findCount(mangoAttend) != 0) { 59 | isCommentReply.setCode(200); 60 | return isCommentReply; 61 | } 62 | 63 | mangoAttendService.add(mangoAttend); 64 | 65 | 66 | isCommentReply.setCode(200); 67 | return isCommentReply; 68 | } 69 | } 70 | -------------------------------------------------------------------------------- /后台源码/src/main/java/work/huangxin/mango/util/isDelete/IsDelete.java: -------------------------------------------------------------------------------- 1 | package work.huangxin.mango.util.isDelete; 2 | 3 | import com.aliyun.oss.OSSClient; 4 | import work.huangxin.mango.model.*; 5 | import work.huangxin.mango.otherMethod.DeleteAliyunFile; 6 | import work.huangxin.mango.service.*; 7 | 8 | import java.util.List; 9 | 10 | public class IsDelete { 11 | 12 | 13 | private Integer code; 14 | 15 | public Integer getCode() { 16 | return code; 17 | } 18 | 19 | public void setCode(Integer code) { 20 | this.code = code; 21 | } 22 | 23 | /** 24 | * 500 服务器错误 25 | * 200 上传成功 26 | * 403 不允许发布,拉黑 27 | * 400 数据出现问题 28 | * 401 未登录 29 | * 1000 非法入侵 30 | */ 31 | public IsDelete isDelete(Integer userId, Integer messageId, MangoMessageImagesService mangoMessageImagesService, MangoUserService mangoUserService, MangoMessageDetailService mangoMessageDetailService, MangoAttendService mangoAttendService, MangoCollectService mangoCollectService,MangoNewMessageService mangoNewMessageService) { 32 | IsDelete isDelete = new IsDelete(); 33 | isDelete.setCode(500); 34 | 35 | MangoUser user = mangoUserService.getById(userId); 36 | 37 | if (user == null) { 38 | isDelete.setCode(1000); 39 | return isDelete; 40 | } 41 | 42 | MangoMessage message = mangoMessageDetailService.getById(messageId); 43 | 44 | if (user.getUserIsAdmin() == 2 || message.getUserId() == user.getUserId()) { 45 | 46 | /** 47 | * 删除对应评论 48 | */ 49 | mangoMessageDetailService.deleteCommentAndReply(messageId); 50 | /** 51 | * 删除我的参与 52 | */ 53 | MangoAttend mangoAttend = new MangoAttend(); 54 | mangoAttend.setMessageId(messageId); 55 | mangoAttendService.delete(mangoAttend); 56 | /** 57 | * 删除收藏 58 | */ 59 | MangoCollect mangoCollect = new MangoCollect(); 60 | mangoCollect.setMessageId(messageId); 61 | mangoCollectService.delete(mangoCollect); 62 | 63 | /** 64 | * 删除消息 65 | */ 66 | MangoNewMessage mangoNewMessage = new MangoNewMessage(); 67 | mangoNewMessage.setMessageId(messageId); 68 | mangoNewMessageService.delete(mangoNewMessage); 69 | 70 | mangoMessageDetailService.deleteById(messageId); 71 | MangoMessageImages mangoMessageImages = new MangoMessageImages(); 72 | mangoMessageImages.setMessageId(messageId); 73 | List images = mangoMessageImagesService.findList(mangoMessageImages); 74 | mangoMessageImagesService.delete(mangoMessageImages); 75 | 76 | // Endpoint以杭州为例,其它Region请按实际情况填写。 77 | String endpoint = "你的阿里云实际位置地址"; 78 | // 阿里云主账号AccessKey拥有所有API的访问权限,风险很高。强烈建议您创建并使用RAM账号进行API访问或日常运维,请登录 https://ram.console.aliyun.com 创建RAM账号。 79 | String accessKeyId = "你的阿里云id"; 80 | String accessKeySecret = "你的阿里云密钥"; 81 | String bucketName = "oss名称"; 82 | 83 | 84 | // 创建OSSClient实例。 85 | OSSClient ossClient = new OSSClient(endpoint, accessKeyId, accessKeySecret); 86 | DeleteAliyunFile deleteAliyunFile = new DeleteAliyunFile(); 87 | 88 | for (int i = 0; i < images.size(); i++) { 89 | String objectName = images.get(i).getImageUrl(); 90 | deleteAliyunFile.DeleteAliyunFile(objectName, ossClient, bucketName); 91 | } 92 | 93 | // 关闭OSSClient。 94 | // ossClient.shutdown(); 95 | 96 | isDelete.setCode(200); 97 | } 98 | return isDelete; 99 | } 100 | } 101 | -------------------------------------------------------------------------------- /后台源码/src/main/java/work/huangxin/mango/util/isUpdate/IsUpdate.java: -------------------------------------------------------------------------------- 1 | package work.huangxin.mango.util.isUpdate; 2 | 3 | import work.huangxin.mango.model.MangoMessage; 4 | import work.huangxin.mango.model.MangoUser; 5 | import work.huangxin.mango.service.MangoMessageDetailService; 6 | import work.huangxin.mango.service.MangoUserService; 7 | 8 | public class IsUpdate { 9 | 10 | private Integer code; 11 | 12 | public Integer getCode() { 13 | 14 | return code; 15 | } 16 | 17 | public void setCode(Integer code) { 18 | this.code = code; 19 | } 20 | 21 | public IsUpdate isTrue(Integer id, Integer messageId, String message, MangoMessageDetailService mangoMessageDetailService, MangoUserService mangoUserService) { 22 | 23 | 24 | 25 | IsUpdate isUpdate = new IsUpdate(); 26 | isUpdate.setCode(500); 27 | MangoUser user = mangoUserService.getById(id); 28 | 29 | if (user == null) { 30 | isUpdate.setCode(400); 31 | return isUpdate; 32 | } 33 | MangoMessage mangoMessage = new MangoMessage(); 34 | 35 | if (user.getUserIsAdmin() == 2) { 36 | mangoMessage.setMessageId(messageId); 37 | } else { 38 | mangoMessage.setMessageId(messageId); 39 | mangoMessage.setUserId(id); 40 | 41 | Integer count = mangoMessageDetailService.findCount(mangoMessage); 42 | 43 | if (count == 0) { 44 | isUpdate.setCode(400); 45 | return isUpdate; 46 | } 47 | } 48 | mangoMessage.setMessageDetail(message); 49 | mangoMessageDetailService.update(mangoMessage); 50 | isUpdate.setCode(200); 51 | return isUpdate; 52 | } 53 | } 54 | -------------------------------------------------------------------------------- /后台源码/src/main/java/work/huangxin/mango/util/login/IsLogin.java: -------------------------------------------------------------------------------- 1 | package work.huangxin.mango.util.login; 2 | 3 | import org.springframework.stereotype.Component; 4 | import work.huangxin.mango.model.MangoUser; 5 | import work.huangxin.mango.service.MangoUserService; 6 | 7 | import java.util.List; 8 | 9 | @Component 10 | public class IsLogin { 11 | 12 | 13 | private Integer code; 14 | 15 | private Integer userId; 16 | 17 | 18 | public Integer getCode() { 19 | return code; 20 | } 21 | 22 | public void setCode(Integer code) { 23 | this.code = code; 24 | } 25 | 26 | public Integer getUserId() { 27 | return userId; 28 | } 29 | 30 | public void setUserId(Integer userId) { 31 | this.userId = userId; 32 | } 33 | 34 | /** 35 | * 用户登录判断 36 | * 37 | * @param mangoUser 38 | * @param openid 39 | * @param mangoUserService 40 | * @return 41 | */ 42 | 43 | public IsLogin isTrue(MangoUser mangoUser, String openid, MangoUserService mangoUserService) { 44 | MangoUser mangoUser1 = new MangoUser(); 45 | mangoUser1.setUserOpenid(openid); 46 | 47 | IsLogin isLogin = new IsLogin(); 48 | isLogin.setCode(500); 49 | List userMessageByOtherMessage = mangoUserService.getUserMessageByOtherMessage(mangoUser1); 50 | 51 | try { 52 | if (userMessageByOtherMessage.size() == 1) { 53 | mangoUserService.updateUserMessage(mangoUser); 54 | isLogin.setCode(200);//老用户 55 | isLogin.setUserId(userMessageByOtherMessage.get(0).getUserId()); 56 | } else { 57 | mangoUserService.insertUserMessage(mangoUser); 58 | isLogin.setUserId(mangoUser.getUserId()); 59 | isLogin.setCode(300);//新用户 60 | } 61 | } catch (Exception e) { 62 | e.printStackTrace(); 63 | isLogin.setCode(500);//出现错误 64 | } 65 | return isLogin; 66 | } 67 | 68 | 69 | } 70 | -------------------------------------------------------------------------------- /后台源码/src/main/resources/application.yml: -------------------------------------------------------------------------------- 1 | server: 2 | port: 8080 3 | 4 | spring: 5 | datasource: 6 | driver-class-name: com.mysql.jdbc.Driver 7 | type: com.alibaba.druid.pool.DruidDataSource 8 | url: jdbc:mysql://localhost:3306/数据库名称 9 | username: 数据库名称 10 | password: 数据库密码 11 | 12 | mybatis: 13 | type-aliases-package: work.huangxin.mango.model 14 | mapper-locations: classpath:mappers/*.xml 15 | #通用mapper配置 16 | mapper: 17 | #公用接口类路径 18 | mappers: work.huangxin.mango.basemapper 19 | identity: MYSQL 20 | 21 | # 日志,生产环境注释即可 22 | logging: 23 | level: 24 | work.huangxin.mango.mapper: debug 25 | 26 | spring.jackson.date-format: yyyy-MM-dd HH:mm 27 | 28 | #这个是时区,一定要加,否则会默认为格林尼治时间,即少8小时 29 | spring.jackson.time-zone: GMT+8 30 | # 31 | pagehelper: 32 | helperDialect: mysql 33 | reasonable: true 34 | supportMethodsArguments: true 35 | params: count=countSql 36 | -------------------------------------------------------------------------------- /后台源码/src/main/resources/banner.txt: -------------------------------------------------------------------------------- 1 | ${AnsiColor.BRIGHT_MAGENTA} 2 | _ __ ______ ______ _____ _____ _______ _ _ _____ 3 | | |/ / | ____| | ____| | __ \ |_ _| |__ __| | | | | | __ \ 4 | | ' / | |__ | |__ | |__) | | | | | | | | | | |__) | 5 | | < | __| | __| | ___/ | | | | | | | | | ___/ 6 | | . \ | |____ | |____ | | _| |_ | | | |__| | | | 7 | |_|\_\ |______| |______| |_| |_____| |_| \____/ |_| 8 | 9 | 10 | ${AnsiColor.BRIGHT_YELLOW} 11 | //////////////////////////////////////////////////////////////////// 12 | // _ooOoo_ // 13 | // o8888888o // 14 | // 88" . "88 // 15 | // (| ^_^ |) // 16 | // O\ = /O // 17 | // ____/`---'\____ // 18 | // .' \\| |// `. // 19 | // / \\||| : |||// \ // 20 | // / _||||| -:- |||||- \ // 21 | // | | \\\ - /// | | // 22 | // | \_| ''\---/'' | | // 23 | // \ .-\__ `-` ___/-. / // 24 | // ___`. .' /--.--\ `. . ___ // 25 | // ."" '< `.___\_<|>_/___.' >'"". // 26 | // | | : `- \`.;`\ _ /`;.`/ - ` : | | // 27 | // \ \ `-. \_ __\ /__ _/ .-` / / // 28 | // ========`-.____`-.___\_____/___.-`____.-'======== // 29 | // `=---=' // 30 | // ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ // 31 | // 佛祖保佑 永不宕机 永无BUG   // 32 | //////////////////////////////////////////////////////////////////// -------------------------------------------------------------------------------- /后台源码/src/main/resources/mappers/MangoAttendMapper.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 8 | 9 | 10 | 11 | 12 | 13 | 16 | attend_id, user_id, message_id 17 | 18 | 22 | -------------------------------------------------------------------------------- /后台源码/src/main/resources/mappers/MangoCategoryMapper.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 8 | 9 | 10 | 11 | 12 | 13 | 16 | category_id, category_name, category_image 17 | 18 | -------------------------------------------------------------------------------- /后台源码/src/main/resources/mappers/MangoCollectMapper.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 8 | 9 | 10 | 11 | 12 | 13 | 16 | collect_id, user_id, message_id 17 | 18 | 19 | 23 | -------------------------------------------------------------------------------- /后台源码/src/main/resources/mappers/MangoCommentMapper.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 18 | comment_id, user_id, message_id, comment_detail, comment_creat_time 19 | 20 | -------------------------------------------------------------------------------- /后台源码/src/main/resources/mappers/MangoCommentReplyMapper.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 22 | comment_reply_id, comment_id, comment_user_id, replay_user_id, replay_user_name, 23 | receive_user_id, receive_user_name, reply_detail, reply_time 24 | 25 | -------------------------------------------------------------------------------- /后台源码/src/main/resources/mappers/MangoMessageImagesMapper.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 8 | 9 | 10 | 11 | 12 | 13 | 16 | image_id, message_id, image_url 17 | 18 | -------------------------------------------------------------------------------- /后台源码/src/main/resources/mappers/MangoNewMessageMapper.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 19 | new_message_id, user_id, new_message_type, message_id, new_message_detail,new_message_time 20 | 21 | 26 | 30 | 31 | 32 | -------------------------------------------------------------------------------- /后台源码/src/main/resources/mappers/MangoNoticeMapper.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 8 | 9 | 10 | 11 | 12 | 15 | notice_id, notice_detail 16 | 17 | -------------------------------------------------------------------------------- /后台源码/src/main/resources/mappers/MangoShopBusinessMapper.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 18 | business_id, shop_id, shop_goods_image, shop_goods_title, shop_goods_price 19 | 20 | -------------------------------------------------------------------------------- /后台源码/src/main/resources/mappers/MangoShopImagesMapper.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 8 | 9 | 10 | 11 | 12 | 13 | 16 | shop_detail_id, shop_id, shop_images 17 | 18 | -------------------------------------------------------------------------------- /后台源码/src/main/resources/mappers/MangoShopMapper.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 21 | shop_id, shop_name, shop_intro, shop_phone, shop_avatar, shop_latitude, shop_longitude, 22 | shop_creat_time 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | -------------------------------------------------------------------------------- /后台源码/src/main/resources/mappers/MangoSwiperMapper.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 8 | 9 | 10 | 11 | 12 | 15 | swiper_id, swiper_image_url 16 | 17 | -------------------------------------------------------------------------------- /后台源码/src/main/resources/mappers/MangoUserMapper.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 21 | user_id, user_openid, user_gender, user_avatar, user_nickname, user_is_admin, user_allow, 22 | user_creat_time 23 | 24 | 25 | 26 | SELECT LAST_INSERT_ID() 27 | 28 | INSERT INTO mango_user (user_openid, user_gender, user_avatar, user_nickname) VALUES 29 | (#{userOpenid},#{userGender},#{userAvatar},#{userNickname}) 30 | 31 | 32 | -------------------------------------------------------------------------------- /后台源码/src/test/java/test.java: -------------------------------------------------------------------------------- 1 | import org.springframework.beans.factory.annotation.Autowired; 2 | 3 | import javax.annotation.PreDestroy; 4 | 5 | public class test { 6 | @Autowired 7 | 8 | public static void main(String args[]){ 9 | 10 | } 11 | 12 | } 13 | --------------------------------------------------------------------------------