当前位置:   article > 正文

基于微信小程序校内论坛系统_基于微信小程序的校园论坛

基于微信小程序的校园论坛

开发工具:IDEA、微信小程序

服务器:Tomcat9.0, jdk1.8

项目构建:maven

数据库:mysql5.7

前端技术:vue、uniapp

服务端技术:springboot+mybatis-plus

本系统分微信小程序和管理后台两部分,项目采用前后端分离

系统主要分为两个角色:管理员和普通用户。

1.普通用户(小程序):登录、注册、首页、论坛信息(查询、发布、回复、收藏)、我的(修改信息、我的发布、我的收藏、退出登录)。

2.管理员(后台):登录、首页、公告管理、新闻管理、论坛管理、用户管理、个人中心(收藏管理)、系统管理(管理员管理、角色管理、菜单管理、系统日志)、退出登录、修改密码等功能的管理

文档截图:

基于微信小程序校内论坛系统

微信小程序截图:

后台截图:

  1. package io.renren.modules.renren.controller;
  2. import java.util.Arrays;
  3. import java.util.List;
  4. import java.util.Map;
  5. import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
  6. import org.apache.shiro.authz.annotation.RequiresPermissions;
  7. import org.springframework.beans.factory.annotation.Autowired;
  8. import org.springframework.web.bind.annotation.PathVariable;
  9. import org.springframework.web.bind.annotation.RequestBody;
  10. import org.springframework.web.bind.annotation.RequestMapping;
  11. import org.springframework.web.bind.annotation.RequestParam;
  12. import org.springframework.web.bind.annotation.RestController;
  13. import io.renren.modules.renren.entity.TotalReplyEntity;
  14. import io.renren.modules.renren.service.TotalReplyService;
  15. import io.renren.common.utils.PageUtils;
  16. import io.renren.common.utils.R;
  17. @RestController
  18. @RequestMapping("renren/totalreply")
  19. public class TotalReplyController {
  20. @Autowired
  21. private TotalReplyService totalReplyService;
  22. /**
  23. * 列表
  24. */
  25. @RequestMapping("/list")
  26. public R list(@RequestParam Map<String, Object> params){
  27. PageUtils page = totalReplyService.queryPage(params);
  28. return R.ok().put("page", page);
  29. }
  30. /**
  31. * 列表
  32. */
  33. @RequestMapping("/listSearch")
  34. public R listSearch(Integer id){
  35. QueryWrapper<TotalReplyEntity> qw=new QueryWrapper<>();
  36. qw.eq("reply_id",id);
  37. List<TotalReplyEntity> list = totalReplyService.list(qw);
  38. return R.ok().put("list", list);
  39. }
  40. /**
  41. * 信息
  42. */
  43. @RequestMapping("/info/{id}")
  44. public R info(@PathVariable("id") Integer id){
  45. TotalReplyEntity totalReply = totalReplyService.getById(id);
  46. return R.ok().put("totalReply", totalReply);
  47. }
  48. /**
  49. * 保存
  50. */
  51. @RequestMapping("/save")
  52. public R save(@RequestBody TotalReplyEntity totalReply){
  53. totalReplyService.save(totalReply);
  54. return R.ok();
  55. }
  56. /**
  57. * 修改
  58. */
  59. @RequestMapping("/update")
  60. public R update(@RequestBody TotalReplyEntity totalReply){
  61. totalReplyService.updateById(totalReply);
  62. return R.ok();
  63. }
  64. /**
  65. * 删除
  66. */
  67. @RequestMapping("/delete")
  68. public R delete(@RequestBody Integer[] ids){
  69. totalReplyService.removeByIds(Arrays.asList(ids));
  70. return R.ok();
  71. }
  72. /**
  73. * 删除
  74. */
  75. @RequestMapping("/delete2")
  76. public R delete2(String ids){
  77. totalReplyService.removeById(ids);
  78. return R.ok();
  79. }
  80. }

<template>
 <view class="">
  <view style="padding: 20upx;border-bottom: 1upx solid #999999;display: flex;flex-direction: row;justify-content: space-around;margin: 30upx;">
   <view class="" @click="showDrawer">
    <image src="../../static/logo.jpg" style="width: 200upx;height: 200upx;border-radius: 21upx;"></image>
   </view>

   <view style="display: flex;flex-direction: column;margin:30upx 20upx 20upx -125upx;font-size: 29upx;">
    <text>账号: {{userTable.userName}}</text>
    <text>昵称: {{userTable.userReal}}</text>
    <text>手机: {{userTable.userPhone}}</text>
   </view>
    </view>
    <view style="display: flex;flex-direction: row;justify-content: space-around;">
      <button @click="showDrawer"  type="primary" size='mini' style="margin-right: 30upx;">修改信息</button>
      <button @click="logout" type="primary" size='mini'>退出登录</button>
    </view>
  <v-tabs v-model="current" :tabs="tabs" @change="changeTab"></v-tabs>
  <view v-if="showForum">
   <view class="news" v-for="items in dataList">
    <text @click="detaiForm(items.id)">{{items.forumTitle}}</text>
    <text @click="aaa(items.id)">{{items.createDate.substring(0,10)}}[删除]</text>
   </view>
  </view>
  <view v-if="showCollect">
   <view class="news" v-for="items in collectionList">
    <text @click="detai(items.forumId)">{{items.forumTitle}}</text>
    <text @click="delForm(items.id)">{{items.createDate.substring(0,10)}}[删除]</text>
   </view>

  </view>


  <uni-drawer ref="showRight" mode="right">
   <scroll-view style="height: 100%;" scroll-y="true">
    <view class=""
     style="margin-top: 20px;font-weight: bold;font-size: 21px;display: flex;justify-content: center;">
     修改个人信息
    </view>
    <view class="" style="padding: 20px;">
     <view class="" style="margin-bottom: 15px;">
      <uni-section title="昵称">
       <uni-easyinput v-model="userTable.userReal" placeholder="请输入内容">
       </uni-easyinput>
      </uni-section>
     </view>
     <view class="" style="margin-bottom: 15px;">
      <uni-section title="手机" type="line" padding>
       <uni-easyinput v-model="userTable.userPhone" placeholder="请输入内容">
       </uni-easyinput>
      </uni-section>
     </view>
     <view class="" style="margin-bottom: 15px;">
      <uni-section title="密码" type="line" padding>
       <uni-easyinput v-model="userTable.userPwd" placeholder="请输入内容">
       </uni-easyinput>
      </uni-section>
     </view>
    </view>
    <button @click="closeDrawer"
     style="display: flex;width: 100%;text-align: center;justify-content: center;" size="mini"
     type="warn">确定</button>
   </scroll-view>
  </uni-drawer>
 </view>
</template>

<script>
 import vTabs from '../../components/v-tabs/v-tabs.vue'
 export default {
  components: {
   vTabs
  },
  data() {
   return {
    id: '',
    dataList: [],
    collectionList: [],
    current: 0,
    showForum: true,
    showCollect: false,
    userTable: {},
    tabs: ['发布', '收藏'],

   }
  },
  onLoad() {
   this.initMy()
   this.initCollec()
   this.initForum()
  },
  onShow() {
   this.initMy()
   this.initCollec()
   this.initForum()
  },
  methods: {
   showDrawer() {
    console.log(JSON.stringify(this.userTable))
    this.$refs.showRight.open();
   },
   closeDrawer() {

    //修改个人信息
    uni.request({
     url: this.serverUrl + 'renren/usertable/update2',
     data: {
      id:this.userTable.id,
      userReal: this.userTable.userReal,
      userPhone: this.userTable.userPhone,
      userPwd: this.userTable.userPwd,
     },
     success(res) {
      uni.showToast({
       icon: 'none',
       title: '修改成功'
      })

     }
    })
    this.$refs.showRight.close();
   },
   detaiForm(id) {
    uni.navigateTo({
     url: '../totalforum/detail?id=' + id
    })
   },
   detai(id) {
    uni.navigateTo({
     url: '../totalforum/detail?id=' + id
    })
   },
   aaa(id) {
    var _this = this
    uni.request({
     url: _this.serverUrl + 'renren/totalforum/deleteid?id=' + id,
     success(res) {
      _this.initForum()
      uni.showToast({
       icon: 'none',
       title: '删除成功'
      })

     }
    })

   },
   delForm(id) {
     let _this=this;
    uni.request({
     url: this.serverUrl + 'renren/usercollection/deleteid?id=' + id,
     success(res) {
            _this.initCollec()
      uni.showToast({
       icon: 'none',
       title: '删除成功'
      })

     }
    })

   },

   initCollec() {
    var _this = this
    var usersName = uni.getStorageSync('usersName')
    uni.request({
     url: _this.serverUrl + 'renren/usercollection/SerrchUse',
     data: {
      userName: usersName
     },
     success(res) {

      /* debugger */
      _this.collectionList = res.data.userCollectionList
     }
    })
   },
   initMy() {
    var _this = this
    var usersName = uni.getStorageSync('usersName')

    uni.request({
     url: _this.serverUrl + 'renren/usertable/searchU?userName=' + usersName,
     method: 'POST',
     success(res) {
      _this.userTable = res.data.userTable
     }
    })
   },
   initForum() {
    var _this = this
    var usersName = uni.getStorageSync('usersName')
    uni.request({
     url: _this.serverUrl + 'renren/totalforum/searchU?userName=' + usersName,
     method: 'POST',
     success(res) {
      _this.dataList = res.data.totalForumList
     }
    })
   },
   changeTab(index) {
    var _this = this
    if (index == 0) {
     _this.showForum = true
     _this.showCollect = false
    } else {
     _this.showCollect = true
     _this.showForum = false
    }
   },
      logout(){
        uni.navigateTo({
          url: '../login/login'
        })
      }
  }
 }
</script>

<style>
 .news {

  margin: 20upx;
  display: flex;
  flex-direction: row;
  border-bottom: 1upx dashed #999999;
  padding: 10upx;
  font-size: 29upx;
  justify-content: space-between
 }
</style>

声明:本文内容由网友自发贡献,不代表【wpsshop博客】立场,版权归原作者所有,本站不承担相应法律责任。如您发现有侵权的内容,请联系我们。转载请注明出处:https://www.wpsshop.cn/w/从前慢现在也慢/article/detail/945754
推荐阅读
相关标签
  

闽ICP备14008679号