当前位置:   article > 正文

校园管理系统(小程序+后台管理)——直击毕设_学校管理后台系统展示

学校管理后台系统展示

项目展示:

小程序端大体展示

后台管理大体展示

 

 

 

项目需要前后端的配合

  1. 沟通与协作:良好的沟通和协作是前端和后端开发之间成功结合的关键。团队成员应该定期沟通,并确保共享相同的目标和理解。

  2. API 设计:定义清晰的 API 接口,确保前端和后端之间的数据交换和通信顺畅。API 应该简单明了,并符合业务需求和最佳实践。

  3. 技术栈的选择:选择合适的技术栈以支持前端和后端的开发。常见的前端技术包括 HTML、CSS、JavaScript、React、Angular 或 Vue.js,而后端技术可以包括 Node.js、Python、Ruby、Java 或 PHP 等。

  4. 数据交互:确保前端和后端能够有效地交换数据。常见的数据交互方式包括使用 RESTful API、GraphQL 或 WebSocket 等。

  5. 安全性:确保应用程序在前端和后端都具有必要的安全性。包括对数据传输进行加密,对用户输入进行验证和清理,以及使用安全的身份验证和授权机制等。

  6. 性能优化:在前端与后端开发中都要注意性能优化。前端需要优化页面加载速度和响应时间,后端需要优化数据处理和数据库查询等。

  7. 版本控制和部署:使用版本控制系统(如 Git)进行代码管理,并建立适当的部署流程以确保应用程序可以顺利部署到生产环境中。

  8. 测试:进行全面的单元测试、集成测试和端到端测试,以确保前端和后端代码的质量和稳定性。

  9. 监控与日志:建立监控系统和日志记录机制,以便及时发现并解决潜在的问题。

  10. 持续改进:不断收集用户反馈并进行改进。定期审查代码,并寻找优化前端和后端的机会。

呃....然而这些都由我一个人做了。

不是买实体服务器买不起,是云开发更有性价比(坏笑,嘿嘿~)

首先需要完成的是小程序的开发,小程序端我选择的是云开发,因为我想的是反正做一个只在学校用就那几w人也撑不爆云服务空间哇。

关于想成为云全栈开发的朋友们,可以按照我的学习路线走哈~

云开发的学习我这里推荐我自己的哔哩哔哩课程(所有全部免费开放,地址:卢淼儿的个人空间-卢淼儿个人主页-哔哩哔哩视频

我的视频集里面包括(小程序原生、uniapp、unicloud、python等)记住哦,我的简介里面有加群方式:814571333(“爱编程互助基地”,最近有很多打广告的所以最近机一按先禁言)

里面有惊喜开源项目供大家参考哦~

关于此项目

其实关于此项目并不是我最近几天完成的,是个项目从一开始的小项目,走到这一步,其实它沉淀了很多的东西,它的开发经历20多次版本的更新。由于上半年开发完它之后就去打比赛了。所以一直把它放到了一边,直到前几天国庆节放假回老家,想着,闲着也是闲着,给我的“宝儿~”升升级。于是就有了此项目。

涉及到的技术栈

  1. vue.js
  2. node.js
  3. CloudBase
  4. WeChat Base

展示部分前端小程序代码

  1. // pages/shouye/shouye.js
  2. // const { update } = require("XrFrame/kanata/lib/index")
  3. const app = getApp()
  4. const defaultAvatarUrl = '../../images/Default_avatar.png'
  5. Page({
  6. data: {
  7. // 轮播图开始
  8. imgUrls: [
  9. 'XXXX-1312670923/yian_tupian/two.jpg',
  10. 'XXXX-1312670923/yian_tupian/two.jpg',
  11. ],
  12. circular: true,
  13. // indicatorDots: true,
  14. autoplay: true,
  15. interval: 2000,
  16. duration: 300,
  17. inputShowed: false,
  18. touxiang: '../../images/Default_avatar.png',
  19. moren_xinxi: '尚未登陆',
  20. show_login: false,
  21. avatarUrl: defaultAvatarUrl,
  22. name: '请输入昵称',
  23. xuehao:'请输入学号',
  24. xingming:'请输入姓名',
  25. Public_announcement: true,
  26. Public_announcement_1: false,
  27. My_mail: true,
  28. My_mail_1: false
  29. },
  30. close_login_case() {
  31. this.setData({
  32. show_login: false
  33. })
  34. },
  35. show_login_case() {
  36. this.setData({
  37. show_login: true
  38. })
  39. },
  40. WD_ZH_1() {
  41. let that = this
  42. wx.cloud.callFunction({
  43. name: 'getusers',
  44. data: {},
  45. }).then(res => {
  46. that.setData({
  47. user_openid: res.result.openid
  48. })
  49. wx.cloud.database().collection('users').where({
  50. _openid: res.result.openid
  51. })
  52. .remove({
  53. success(res) {
  54. that.setData({
  55. moren_xinxi: '尚未登陆',
  56. touxiang: '../../images/Default_avatar.png'
  57. })
  58. wx.showToast({
  59. title: '谢谢使用!',
  60. icon: 'none'
  61. })
  62. that.onShow()
  63. }
  64. })
  65. })
  66. },
  67. onChooseAvatar(e) {
  68. let avatarUrl = e.detail.avatarUrl
  69. this.setData({
  70. avatarUrl,
  71. })
  72. },
  73. input_nickname(e) {
  74. let nickname = e.detail.value
  75. this.setData({
  76. nickname
  77. })
  78. },
  79. input_xuehao(e){
  80. let xuehao = e.detail.value
  81. this.setData({
  82. xuehao
  83. })
  84. },
  85. input_xingming(e){
  86. let xingming = e.detail.value
  87. this.setData({
  88. xingming
  89. })
  90. },
  91. denglu() {
  92. let that = this
  93. if (that.data.avatarUrl == defaultAvatarUrl || that.data.nickname == '请输入昵称' || that.data.xuehao == '请输入学号' || that.data.xingming == '请输入姓名') {
  94. wx.showToast({
  95. title: '请填写正确信息',
  96. icon: 'none'
  97. })
  98. } else {
  99. wx.cloud.callFunction({
  100. name: 'getusers',
  101. data: {},
  102. }).then(res => {
  103. that.setData({
  104. _openid: res.result.openid
  105. })
  106. wx.cloud.database().collection('users').where({
  107. _openid: res.result.openid
  108. }).get({
  109. success(res) {
  110. wx.cloud.database().collection('users').add({
  111. data: {
  112. nickname: that.data.nickname,
  113. touxiangUrl: that.data.avatarUrl,
  114. openid: that.data._openid,
  115. xuehao:that.data.xuehao,
  116. xingming:that.data.xingming,
  117. user:1
  118. },
  119. success(res) {
  120. that.setData({
  121. show_login: false
  122. })
  123. wx.showToast({
  124. title: '登录成功!',
  125. })
  126. wx.cloud.callFunction({
  127. name:'getusers',
  128. data:{}
  129. }).then(res=>{
  130. wx.cloud.database().collection('xinxiaoxi_users').where({
  131. _openid:res.result.openid
  132. }).get({
  133. success(res){
  134. console.log(res.data.length,'useruser');
  135. if(res.data.length < 1){
  136. wx.cloud.database().collection('xinxiaoxi_users').add({
  137. data: {
  138. user:1,
  139. gonggao: [],
  140. youjian: [],
  141. }
  142. })
  143. }else{
  144. console.log('user已经添加过了');
  145. }
  146. }
  147. })
  148. wx.cloud.database().collection('Two_dimensional_code').where({
  149. _openid:res.result.openid
  150. }).get({
  151. success(res){
  152. console.log(res.data.length,'useruser');
  153. if(res.data.length < 1){
  154. wx.cloud.database().collection('Two_dimensional_code').add({
  155. data: {
  156. user:1,
  157. Two_dimensional_code: [],
  158. }
  159. })
  160. }else{
  161. console.log('二维码已经添加过了');
  162. }
  163. }
  164. })
  165. })
  166. that.onShow()
  167. this.duqu_users()
  168. }
  169. })
  170. }
  171. })
  172. })
  173. }
  174. },
  175. shuaxin() {
  176. let that = this
  177. wx.cloud.callFunction({
  178. name: 'getusers',
  179. data: {},
  180. }).then(res => {
  181. that.setData({
  182. _openid: res.result.openid
  183. })
  184. wx.cloud.database().collection('users').where({
  185. _openid: res.result.openid
  186. }).get({
  187. success(res) {
  188. that.setData({
  189. moren_xinxi: res.data[0].nickname,
  190. touxiang: res.data[0].touxiangUrl,
  191. })
  192. }
  193. })
  194. })
  195. },
  196. Write_letters() {
  197. let that = this
  198. if (that.data.touxiang == "../../images/Default_avatar.png" || that.data.moren_xinxi == "尚未登陆") {
  199. wx.showToast({
  200. title: '您还未登录!',
  201. icon: 'none'
  202. })
  203. } else {
  204. wx.navigateTo({
  205. url: '../Write_letters/Write_letters',
  206. })
  207. }
  208. },
  209. My_mail() {
  210. let that = this
  211. if (that.data.touxiang == "../../images/Default_avatar.png" || that.data.moren_xinxi == "尚未登陆") {
  212. wx.showToast({
  213. title: '您还未登录!',
  214. icon: 'none'
  215. })
  216. } else {
  217. wx.navigateTo({
  218. url: '../My_mail/My_mail',
  219. })
  220. }
  221. },
  222. My_wenjain() {
  223. let that = this
  224. if (that.data.touxiang == "../../images/Default_avatar.png" || that.data.moren_xinxi == "尚未登陆") {
  225. wx.showToast({
  226. title: '您还未登录!',
  227. icon: 'none'
  228. })
  229. } else {
  230. wx.navigateTo({
  231. url: '../My_wenjain/My_wenjain',
  232. })
  233. }
  234. },
  235. Formula_announcement() {
  236. let that = this
  237. if (that.data.touxiang == "../../images/Default_avatar.png" || that.data.moren_xinxi == "尚未登陆") {
  238. wx.showToast({
  239. title: '您还未登录!',
  240. icon: 'none'
  241. })
  242. } else {
  243. wx.navigateTo({
  244. url: '../Formula_announcement/Formula_announcement',
  245. })
  246. }
  247. },
  248. W_zonghe() {
  249. let that = this
  250. wx.cloud.database().collection('content').get({
  251. success(res) {
  252. console.log(res);
  253. let W_zonghe = res.data.length
  254. that.setData({
  255. W_zonghe: W_zonghe
  256. })
  257. }
  258. })
  259. },
  260. W_zixun() {
  261. let that = this
  262. wx.cloud.database().collection('content').where({
  263. newsid: '0'
  264. }).get({
  265. success(res) {
  266. let W_zixun
  267. W_zixun = res.data.length
  268. that.setData({
  269. W_zixun: W_zixun
  270. })
  271. if (W_zixun >= 1) {
  272. that.setData({
  273. W_zixun1: true,
  274. W_zixun2: false,
  275. W_zixun: W_zixun
  276. })
  277. } else {
  278. that.setData({
  279. W_zixun1: false,
  280. W_zixun2: true,
  281. })
  282. }
  283. }
  284. })
  285. },
  286. W_yijian() {
  287. let that = this
  288. wx.cloud.database().collection('content').where({
  289. newsid: '1'
  290. }).get({
  291. success(res) {
  292. let W_yijian
  293. W_yijian = res.data.length
  294. that.setData({
  295. W_yijian: W_yijian
  296. })
  297. if (W_yijian >= 1) {
  298. that.setData({
  299. W_yijian1: true,
  300. W_yijian2: false,
  301. W_yijian: W_yijian
  302. })
  303. } else {
  304. that.setData({
  305. W_yijian1: false,
  306. W_yijian2: true,
  307. })
  308. }
  309. }
  310. })
  311. },
  312. W_qiuzhu() {
  313. let that = this
  314. wx.cloud.database().collection('content').where({
  315. newsid: '2'
  316. }).get({
  317. success(res) {
  318. let W_qiuzhu
  319. W_qiuzhu = res.data.length
  320. that.setData({
  321. W_qiuzhu: W_qiuzhu
  322. })
  323. if (W_qiuzhu >= 1) {
  324. that.setData({
  325. W_qiuzhu1: true,
  326. W_qiuzhu2: false,
  327. W_qiuzhu: W_qiuzhu
  328. })
  329. } else {
  330. that.setData({
  331. W_qiuzhu1: false,
  332. W_qiuzhu2: true,
  333. })
  334. }
  335. }
  336. })
  337. },
  338. W_jubao() {
  339. let that = this
  340. wx.cloud.database().collection('content').where({
  341. newsid: '3'
  342. }).get({
  343. success(res) {
  344. let W_jubao
  345. W_jubao = res.data.length
  346. that.setData({
  347. W_jubao: W_jubao
  348. })
  349. if (W_jubao >= 1) {
  350. that.setData({
  351. W_jubao1: true,
  352. W_jubao2: false,
  353. W_jubao: W_jubao
  354. })
  355. } else {
  356. that.setData({
  357. W_jubao1: false,
  358. W_jubao2: true,
  359. })
  360. }
  361. }
  362. })
  363. },
  364. W_tousu() {
  365. let that = this
  366. wx.cloud.database().collection('content').where({
  367. newsid: '4'
  368. }).get({
  369. success(res) {
  370. let W_tousu
  371. W_tousu = res.data.length
  372. that.setData({
  373. W_tousu: W_tousu
  374. })
  375. if (W_tousu >= 1) {
  376. that.setData({
  377. W_tousu1: true,
  378. W_tousu2: false,
  379. W_tousu: W_tousu
  380. })
  381. } else {
  382. that.setData({
  383. W_tousu1: false,
  384. W_tousu2: true,
  385. })
  386. }
  387. }
  388. })
  389. },
  390. W_baoxiu() {
  391. let that = this
  392. wx.cloud.database().collection('content').where({
  393. newsid: '5'
  394. }).get({
  395. success(res) {
  396. let W_baoxiu
  397. W_baoxiu = res.data.length
  398. that.setData({
  399. W_baoxiu: W_baoxiu
  400. })
  401. if (W_baoxiu >= 1) {
  402. that.setData({
  403. W_baoxiu1: true,
  404. W_baoxiu2: false,
  405. W_baoxiu: W_baoxiu
  406. })
  407. } else {
  408. that.setData({
  409. W_baoxiu1: false,
  410. W_baoxiu2: true,
  411. })
  412. }
  413. }
  414. })
  415. },
  416. Y_zonghe() {
  417. let that = this
  418. wx.cloud.database().collection('yiyuedu').get({
  419. success(res) {
  420. console.log(res);
  421. let Y_zonghe = res.data.length
  422. that.setData({
  423. Y_zonghe: Y_zonghe
  424. })
  425. }
  426. })
  427. },
  428. Y_zixun() {
  429. let that = this
  430. wx.cloud.database().collection('yiyuedu').where({
  431. newsid: '0'
  432. }).get({
  433. success(res) {
  434. let Y_zixun
  435. Y_zixun = res.data.length
  436. that.setData({
  437. Y_zixun: Y_zixun
  438. })
  439. if (Y_zixun >= 1) {
  440. that.setData({
  441. Y_zixun1: true,
  442. Y_zixun2: false,
  443. Y_zixun: Y_zixun
  444. })
  445. } else {
  446. that.setData({
  447. Y_zixun1: false,
  448. Y_zixun2: true,
  449. })
  450. }
  451. }
  452. })
  453. },
  454. Y_yijian() {
  455. let that = this
  456. wx.cloud.database().collection('yiyuedu').where({
  457. newsid: '1'
  458. }).get({
  459. success(res) {
  460. let Y_yijian
  461. Y_yijian = res.data.length
  462. that.setData({
  463. Y_yijian: Y_yijian
  464. })
  465. if (Y_yijian >= 1) {
  466. that.setData({
  467. Y_yijian1: true,
  468. Y_yijian2: false,
  469. Y_yijian: Y_yijian
  470. })
  471. } else {
  472. that.setData({
  473. Y_yijian1: false,
  474. Y_yijian2: true,
  475. })
  476. }
  477. }
  478. })
  479. },
  480. Y_qiuzhu() {
  481. let that = this
  482. wx.cloud.database().collection('yiyuedu').where({
  483. newsid: '2'
  484. }).get({
  485. success(res) {
  486. let Y_qiuzhu
  487. Y_qiuzhu = res.data.length
  488. that.setData({
  489. Y_qiuzhu: Y_qiuzhu
  490. })
  491. if (Y_qiuzhu >= 1) {
  492. that.setData({
  493. Y_qiuzhu1: true,
  494. Y_qiuzhu2: false,
  495. Y_qiuzhu: Y_qiuzhu
  496. })
  497. } else {
  498. that.setData({
  499. Y_qiuzhu1: false,
  500. Y_qiuzhu2: true,
  501. })
  502. }
  503. }
  504. })
  505. },
  506. Y_jubao() {
  507. let that = this
  508. wx.cloud.database().collection('yiyuedu').where({
  509. newsid: '3'
  510. }).get({
  511. success(res) {
  512. let Y_jubao
  513. Y_jubao = res.data.length
  514. that.setData({
  515. Y_jubao: Y_jubao
  516. })
  517. if (Y_jubao >= 1) {
  518. that.setData({
  519. Y_jubao1: true,
  520. Y_jubao2: false,
  521. Y_jubao: Y_jubao
  522. })
  523. } else {
  524. that.setData({
  525. Y_jubao1: false,
  526. Y_jubao2: true,
  527. })
  528. }
  529. }
  530. })
  531. },
  532. Y_tousu() {
  533. let that = this
  534. wx.cloud.database().collection('yiyuedu').where({
  535. newsid: '4'
  536. }).get({
  537. success(res) {
  538. let Y_tousu
  539. Y_tousu = res.data.length
  540. that.setData({
  541. Y_tousu: Y_tousu
  542. })
  543. if (Y_tousu >= 1) {
  544. that.setData({
  545. Y_tousu1: true,
  546. Y_tousu2: false,
  547. Y_tousu: Y_tousu
  548. })
  549. } else {
  550. that.setData({
  551. Y_tousu1: false,
  552. Y_tousu2: true,
  553. })
  554. }
  555. }
  556. })
  557. },
  558. Y_baoxiu() {
  559. let that = this
  560. wx.cloud.database().collection('yiyuedu').where({
  561. newsid: '5'
  562. }).get({
  563. success(res) {
  564. let Y_baoxiu
  565. Y_baoxiu = res.data.length
  566. that.setData({
  567. Y_baoxiu: Y_baoxiu
  568. })
  569. if (Y_baoxiu >= 1) {
  570. that.setData({
  571. Y_baoxiu1: true,
  572. Y_baoxiu2: false,
  573. Y_baoxiu: Y_baoxiu
  574. })
  575. } else {
  576. that.setData({
  577. Y_baoxiu1: false,
  578. Y_baoxiu2: true,
  579. })
  580. }
  581. }
  582. })
  583. },
  584. administrator() {
  585. let that = this
  586. if (that.data.touxiang == "../../images/Default_avatar.png" || that.data.moren_xinxi == "尚未登陆") {
  587. wx.showToast({
  588. title: '登录后,可登录管理员后台',
  589. icon: 'none'
  590. })
  591. } else {
  592. wx.navigateTo({
  593. url: '../administrator_DL/administrator_DL',
  594. })
  595. }
  596. },
  597. Rili() {
  598. wx.navigateTo({
  599. url: '../Rili/Rili',
  600. })
  601. },
  602. onLoad(options) {
  603. if (options.wenjian == 'yonghu') {
  604. wx.navigateTo({
  605. url: '../My_wenjain/My_wenjain',
  606. })
  607. }
  608. },
  609. onReady() {
  610. },
  611. gonggao_xin(){
  612. let that = this
  613. wx.cloud.callFunction({
  614. name:'getusers',
  615. data:{}
  616. }).then(res=>{
  617. wx.cloud.database().collection('xinxiaoxi_users').where({
  618. _openid:res.result.openid
  619. }).get({
  620. success(res){
  621. console.log(res.data[0].gonggao.length,'qqqqqqqqqqqqqqqqqqqqqqqqqqqq');
  622. if(res.data[0].gonggao.length > 0){
  623. that.setData({
  624. Public_announcement: false,
  625. Public_announcement_1: true,
  626. })
  627. }
  628. }
  629. })
  630. })
  631. },
  632. Formula_announcement_1(){
  633. let that = this
  634. that.Formula_announcement()
  635. that.setData({
  636. Public_announcement: true,
  637. Public_announcement_1: false,
  638. })
  639. wx.cloud.callFunction({
  640. name:'getusers',
  641. data:{}
  642. }).then(res=>{
  643. console.log(res.result.openid,'ooooooooooooooooooooooooppppppppppppp');
  644. wx.cloud.database().collection('xinxiaoxi_users').where({
  645. _openid:res.result.openid
  646. }).update({
  647. data:{
  648. gonggao:[]
  649. }
  650. })
  651. })
  652. },
  653. My_mail_xin(){
  654. let that = this
  655. wx.cloud.callFunction({
  656. name:'getusers',
  657. data:{}
  658. }).then(res=>{
  659. wx.cloud.database().collection('xinxiaoxi_users').where({
  660. _openid:res.result.openid
  661. }).get({
  662. success(res){
  663. console.log(res.data[0].youjian.length,'qqqqqqqqqqqqqqqqqqqqqqqqqqqq');
  664. if(res.data[0].youjian.length > 0){
  665. that.setData({
  666. My_mail: false,
  667. My_mail_1: true,
  668. })
  669. }
  670. }
  671. })
  672. })
  673. },
  674. My_mail_1(){
  675. let that = this
  676. that.My_mail()
  677. that.setData({
  678. My_mail: true,
  679. My_mail_1: false,
  680. })
  681. wx.cloud.callFunction({
  682. name:'getusers',
  683. data:{}
  684. }).then(res=>{
  685. console.log(res.result.openid,'ooooooooooooooooooooooooppppppppppppp');
  686. wx.cloud.database().collection('xinxiaoxi_users').where({
  687. _openid:res.result.openid
  688. }).update({
  689. data:{
  690. youjian:[]
  691. }
  692. })
  693. })
  694. },
  695. onShow() {
  696. this.gonggao_xin()
  697. this.My_mail_xin()
  698. this.shuaxin()
  699. this.W_zonghe()
  700. this.W_zixun()
  701. this.W_yijian()
  702. this.W_qiuzhu()
  703. this.W_jubao()
  704. this.W_tousu()
  705. this.W_baoxiu()
  706. this.Y_zonghe()
  707. this.Y_zixun()
  708. this.Y_yijian()
  709. this.Y_qiuzhu()
  710. this.Y_jubao()
  711. this.Y_tousu()
  712. this.Y_baoxiu()
  713. },
  714. onHide() {
  715. },
  716. onUnload() {},
  717. onPullDownRefresh() {},
  718. onReachBottom() {
  719. },
  720. onShareAppMessage() {
  721. }
  722. })

展示部分前端后台PC端代码

  1. <template>
  2. <div id="app">
  3. <el-button style="margin: 10px 0 0 200px;" @click="weidu" type="primary">未阅读</el-button>
  4. <el-button style="margin: 10px 100px 0 0;" @click="YiYueDu" type="success">已阅读</el-button>
  5. <el-dropdown @command="handleClick_fenlei">
  6. <el-button type="primary">
  7. 邮件分类<i class="el-icon-arrow-down el-icon--right"></i>
  8. </el-button>
  9. <el-dropdown-menu slot="dropdown">
  10. <el-dropdown-item command="咨询类">咨询类</el-dropdown-item>
  11. <el-dropdown-item command="意见类">意见类</el-dropdown-item>
  12. <el-dropdown-item command="求助类">求助类</el-dropdown-item>
  13. <el-dropdown-item command="举报类">举报类</el-dropdown-item>
  14. <el-dropdown-item command="投诉类">投诉类</el-dropdown-item>
  15. <el-dropdown-item command="报修类">报修类</el-dropdown-item>
  16. </el-dropdown-menu>
  17. </el-dropdown>
  18. <div
  19. style="display: flex;flex-direction: row;justify-content: space-around;padding: 20px 100px 30px 200px;height: 73%;">
  20. <el-table :data="tableData" border style="width: 45%;">
  21. <el-table-column fixed label="邮件图片" width="175">
  22. <template slot-scope="scope">
  23. <img style="width: 150px;height: 100px;display: flex;flex-direction: row;justify-content: space-around;align-content: center;"
  24. :src="scope.row.img_URL" alt="无图片">
  25. </template>
  26. </el-table-column>
  27. <el-table-column prop="title" label="邮件主题" width="300">
  28. </el-table-column>
  29. <el-table-column prop="content" label="邮件内容" width="300">
  30. </el-table-column>
  31. <el-table-column prop="cTime" label="上传时间" width="300">
  32. </el-table-column>
  33. <el-table-column fixed="right" label="操作" width="220">
  34. <template slot-scope="scope">
  35. <el-button @click="handleClick(scope.row), drawer = true" type="primary" size="small">查看</el-button>
  36. <el-button v-if="handleClick_YiYue_panduan" @click="handleClick_YiYue(scope.row)" type="success"
  37. size="small">已阅</el-button>
  38. <!-- 未读邮件删除 -->
  39. <el-button v-if="handleClick_weidu_panduan" @click="delClick(scope.row)" type="danger"
  40. size="small">删除</el-button>
  41. <!-- 已读邮件删除 -->
  42. <el-button v-if="handleClick_yidu_panduan" @click="delClick_1(scope.row)" type="danger"
  43. size="small">删除</el-button>
  44. </template>
  45. </el-table-column>
  46. </el-table>
  47. </div>
  48. <!-- 未读分页 -->
  49. <el-pagination background :current-page="currentPage" :page-size="pageSize" :total="total"
  50. @current-change="handleCurrentChange_weidu" v-if="paginationType === 'weidu'"></el-pagination>
  51. <!-- 已读分页 -->
  52. <el-pagination background :current-page="currentPage" :page-size="pageSize" :total="total"
  53. @current-change="handleCurrentChange_yidu" v-if="paginationType === 'yidu'"></el-pagination>
  54. <!-- 咨询类分页 -->
  55. <el-pagination background :current-page="currentPage" :page-size="pageSize" :total="total"
  56. @current-change="handleCurrentChange_newids0" v-if="paginationType === 'newids0'"></el-pagination>
  57. <!-- 意见类分页 -->
  58. <el-pagination background :current-page="currentPage" :page-size="pageSize" :total="total"
  59. @current-change="handleCurrentChange_newids1" v-if="paginationType === 'newids1'"></el-pagination>
  60. <!-- 求助类分页 -->
  61. <el-pagination background :current-page="currentPage" :page-size="pageSize" :total="total"
  62. @current-change="handleCurrentChange_newids2" v-if="paginationType === 'newids2'"></el-pagination>
  63. <!-- 举报类分页 -->
  64. <el-pagination background :current-page="currentPage" :page-size="pageSize" :total="total"
  65. @current-change="handleCurrentChange_newids3" v-if="paginationType === 'newids3'"></el-pagination>
  66. <!-- 投诉类分页 -->
  67. <el-pagination background :current-page="currentPage" :page-size="pageSize" :total="total"
  68. @current-change="handleCurrentChange_newids4" v-if="paginationType === 'newids4'"></el-pagination>
  69. <!-- 报修类分页 -->
  70. <el-pagination background :current-page="currentPage" :page-size="pageSize" :total="total"
  71. @current-change="handleCurrentChange_newids5" v-if="paginationType === 'newids5'"></el-pagination>
  72. <el-drawer :title="this.row_title" :visible.sync="drawer" :with-header="false">
  73. <div style="display: flex;flex-direction: column;">
  74. <div style="display: flex;flex-direction: row;justify-content: space-around;">
  75. <img style="width: 350px;height: 200px;border-radius: 20px;margin-top: 20px;" :src="this.row_img" />
  76. </div>
  77. <div style="margin-left: 20px;display: flex;flex-direction: column;">
  78. <span style="font-size: 22px;font-weight: bolder;margin-top: 20px;margin-bottom: 10px;">标题</span>
  79. <span>{{ this.row_title }}</span>
  80. <span style="font-size: 22px;font-weight: bolder;margin-top: 20px;margin-bottom: 10px;">内容</span>
  81. <span>{{ this.row_content }}</span>
  82. <span style="font-size: 22px;font-weight: bolder;margin-top: 20px;margin-bottom: 10px;">时间</span>
  83. <span>{{ this.row_cTime }}</span>
  84. </div>
  85. </div>
  86. </el-drawer>
  87. </div>
  88. </template>
  89. <script>
  90. import YouJianGuanLi from '../YouJian/YouJianGuanLi.vue'
  91. export default {
  92. name: 'App',
  93. components: {
  94. YouJianGuanLi
  95. },
  96. data() {
  97. return {
  98. // 未读状态分页
  99. currentPage: 1,
  100. pageSize: 5,
  101. total: 0,
  102. paginationType: '',
  103. fileList: [],
  104. imgUrl: '',
  105. form: {
  106. name: '',
  107. content: ''
  108. },
  109. formRules: {
  110. name: [{
  111. required: true,
  112. message: '请输入公告主题',
  113. trigger: 'change'
  114. }],
  115. content: [{
  116. required: true,
  117. message: '请输入公告内容',
  118. trigger: 'change'
  119. }]
  120. },
  121. tableData: [],
  122. selectedFile: null,
  123. previewImage: null,
  124. previewImages: [],
  125. cloud_img_url: [],
  126. http_img_url: [],
  127. drawer: false,
  128. row_title: '',
  129. row_content: '',
  130. row_img: '',
  131. row_cTime: '',
  132. handleClick_YiYue_panduan: true,
  133. handleClick_weidu_panduan: true,
  134. handleClick_yidu_panduan: false
  135. }
  136. },
  137. created() {
  138. this.YouJian_GuanLi()
  139. },
  140. methods: {
  141. async wxXCX() {
  142. var c1 = new this.cloud.Cloud({
  143. identityless: true,
  144. resourceAppid: 'XXX',
  145. resourceEnv: 'XXX',
  146. })
  147. await c1.init()
  148. return c1;
  149. },
  150. async YouJian_GuanLi() {
  151. const c1 = await this.wxXCX();
  152. c1.callFunction({
  153. name: 'pc_houtai',
  154. data: {
  155. pc_YouJian: 1,
  156. currentPage: this.currentPage
  157. },
  158. success: res => {
  159. console.log(res.result.data)
  160. this.tableData = res.result.data
  161. this.total = res.result.pageCount * this.pageSize
  162. this.handleClick_YiYue_panduan = true
  163. this.paginationType = 'weidu'
  164. }
  165. })
  166. console.log(111);
  167. },
  168. handleCurrentChange_weidu(val) {
  169. this.currentPage = val
  170. this.weidu()
  171. },
  172. handleClick(row) {
  173. console.log(row);
  174. this.row_title = row.title
  175. this.row_content = row.content
  176. this.row_img = row.img_URL
  177. this.row_cTime = row.cTime
  178. },
  179. async handleClick_YiYue(row) {
  180. const c1 = await this.wxXCX();
  181. c1.callFunction({
  182. name: 'pc_houtai',
  183. data: {
  184. yiyue_pc_YouJian_GuanLi: 1,
  185. _id: row._id
  186. },
  187. success: res => {
  188. this.YouJian_GuanLi()
  189. }
  190. })
  191. },
  192. async delClick(row) {
  193. const c1 = await this.wxXCX();
  194. c1.callFunction({
  195. name: 'pc_houtai',
  196. data: {
  197. del_pc_YouJian_GuanLi: 1,
  198. _id: row._id
  199. },
  200. success: res => {
  201. this.YouJian_GuanLi()
  202. }
  203. })
  204. },
  205. async YiYueDu() {
  206. const c1 = await this.wxXCX();
  207. this.currentPage = 1,
  208. this.pageSize = 5,
  209. this.total = 0,
  210. c1.callFunction({
  211. name: 'pc_houtai',
  212. data: {
  213. YiYueDu_pc_YouJian: 1,
  214. currentPage: this.currentPage
  215. },
  216. success: res => {
  217. console.log(res.result.data)
  218. this.tableData = res.result.data
  219. this.total = res.result.pageCount * this.pageSize
  220. this.handleClick_YiYue_panduan = false,
  221. this.handleClick_weidu_panduan = false
  222. this.handleClick_yidu_panduan = true,
  223. this.paginationType = 'yidu'
  224. }
  225. })
  226. },
  227. handleCurrentChange_yidu(val) {
  228. this.currentPage = val
  229. this.YiYueDu_list()
  230. },
  231. async YiYueDu_list() {
  232. const c1 = await this.wxXCX();
  233. c1.callFunction({
  234. name: 'pc_houtai',
  235. data: {
  236. YiYueDu_pc_YouJian: 1,
  237. currentPage: this.currentPage
  238. },
  239. success: res => {
  240. console.log(res.result.data)
  241. this.tableData = res.result.data
  242. this.total = res.result.pageCount * this.pageSize
  243. this.handleClick_YiYue_panduan = false,
  244. this.handleClick_weidu_panduan = false
  245. this.handleClick_yidu_panduan = true,
  246. this.paginationType = 'yidu'
  247. }
  248. })
  249. },
  250. weidu() {
  251. this.YouJian_GuanLi(),
  252. this.handleClick_weidu_panduan = true
  253. this.handleClick_yidu_panduan = false
  254. },
  255. async delClick_1(row) {
  256. const c1 = await this.wxXCX();
  257. c1.callFunction({
  258. name: 'pc_houtai',
  259. data: {
  260. del_yidu_pc_YouJian_GuanLi: 1,
  261. _id: row._id
  262. },
  263. success: res => {
  264. this.YiYueDu()
  265. }
  266. })
  267. },
  268. handleCurrentChange_newids0(val) {
  269. this.currentPage = val
  270. this.handleCurrentChange_newids0_list()
  271. },
  272. async handleCurrentChange_newids0_list() {
  273. const c1 = await this.wxXCX();
  274. c1.callFunction({
  275. name: 'pc_houtai',
  276. data: {
  277. fenlei_pc_YouJian: 1,
  278. newsid: "0",
  279. currentPage: this.currentPage
  280. },
  281. success: res => {
  282. console.log(res.result.data)
  283. this.tableData = res.result.data
  284. this.total = res.result.pageCount * this.pageSize
  285. this.handleClick_YiYue_panduan = true,
  286. this.paginationType = 'newids0'
  287. }
  288. })
  289. },
  290. handleCurrentChange_newids1(val) {
  291. this.currentPage = val
  292. this.handleCurrentChange_newids1_list()
  293. },
  294. async handleCurrentChange_newids1_list() {
  295. const c1 = await this.wxXCX();
  296. c1.callFunction({
  297. name: 'pc_houtai',
  298. data: {
  299. fenlei_pc_YouJian: 1,
  300. newsid: "1",
  301. currentPage: this.currentPage
  302. },
  303. success: res => {
  304. console.log(res.result.data)
  305. this.tableData = res.result.data
  306. this.total = res.result.pageCount * this.pageSize
  307. this.handleClick_YiYue_panduan = true,
  308. this.paginationType = 'newids1'
  309. }
  310. })
  311. },
  312. handleCurrentChange_newids2(val) {
  313. this.currentPage = val
  314. this.handleCurrentChange_newids2_list()
  315. },
  316. async handleCurrentChange_newids2_list() {
  317. const c1 = await this.wxXCX();
  318. c1.callFunction({
  319. name: 'pc_houtai',
  320. data: {
  321. fenlei_pc_YouJian: 1,
  322. newsid: "2",
  323. currentPage: this.currentPage
  324. },
  325. success: res => {
  326. console.log(res.result.data)
  327. this.tableData = res.result.data
  328. this.total = res.result.pageCount * this.pageSize
  329. this.handleClick_YiYue_panduan = true,
  330. this.paginationType = 'newids2'
  331. }
  332. })
  333. },
  334. handleCurrentChange_newids3(val) {
  335. this.currentPage = val
  336. this.handleCurrentChange_newids3_list()
  337. },
  338. async handleCurrentChange_newids3_list() {
  339. const c1 = await this.wxXCX();
  340. c1.callFunction({
  341. name: 'pc_houtai',
  342. data: {
  343. fenlei_pc_YouJian: 1,
  344. newsid: "3",
  345. currentPage: this.currentPage
  346. }, //调用的云函数名字
  347. success: res => {
  348. console.log(res.result.data)
  349. this.tableData = res.result.data
  350. this.total = res.result.pageCount * this.pageSize
  351. this.handleClick_YiYue_panduan = true,
  352. this.paginationType = 'newids3'
  353. }
  354. })
  355. },
  356. handleCurrentChange_newids4(val) {
  357. this.currentPage = val
  358. this.handleCurrentChange_newids4_list()
  359. },
  360. async handleCurrentChange_newids4_list() {
  361. const c1 = await this.wxXCX();
  362. c1.callFunction({
  363. name: 'pc_houtai',
  364. data: {
  365. fenlei_pc_YouJian: 1,
  366. newsid: "4",
  367. currentPage: this.currentPage
  368. },
  369. success: res => {
  370. console.log(res.result.data)
  371. this.tableData = res.result.data
  372. this.total = res.result.pageCount * this.pageSize
  373. this.handleClick_YiYue_panduan = true,
  374. this.paginationType = 'newids4'
  375. }
  376. })
  377. },
  378. handleCurrentChange_newids5(val) {
  379. this.currentPage = val
  380. this.handleCurrentChange_newids5_list('报修类')
  381. },
  382. async handleCurrentChange_newids5_list() {
  383. const c1 = await this.wxXCX();
  384. c1.callFunction({
  385. name: 'pc_houtai',
  386. data: {
  387. fenlei_pc_YouJian: 1,
  388. newsid: "5",
  389. currentPage: this.currentPage
  390. },
  391. success: res => {
  392. console.log(res.result.data)
  393. this.tableData = res.result.data
  394. this.total = res.result.pageCount * this.pageSize
  395. this.handleClick_YiYue_panduan = true,
  396. this.paginationType = 'newids5'
  397. }
  398. })
  399. },
  400. async handleClick_fenlei(command) {
  401. const c1 = await this.wxXCX();
  402. this.$message('正在查看' + '----' + command);
  403. // this.command = command
  404. if (command == '咨询类') {
  405. this.currentPage = 1,
  406. this.pageSize = 5,
  407. this.total = 0,
  408. c1.callFunction({
  409. name: 'pc_houtai',
  410. data: {
  411. fenlei_pc_YouJian: 1,
  412. newsid: "0",
  413. currentPage: this.currentPage
  414. },
  415. success: res => {
  416. console.log(res.result.data)
  417. this.tableData = res.result.data
  418. this.total = res.result.pageCount * this.pageSize
  419. this.handleClick_YiYue_panduan = true,
  420. this.paginationType = 'newids0'
  421. }
  422. })
  423. } else if (command == '意见类') {
  424. this.currentPage = 1,
  425. this.pageSize = 5,
  426. this.total = 0,
  427. c1.callFunction({
  428. name: 'pc_houtai',
  429. data: {
  430. fenlei_pc_YouJian: 1,
  431. newsid: "1",
  432. currentPage: this.currentPage
  433. },
  434. success: res => {
  435. console.log(res.result.data)
  436. this.tableData = res.result.data
  437. this.total = res.result.pageCount * this.pageSize
  438. this.handleClick_YiYue_panduan = true,
  439. this.paginationType = 'newids1'
  440. }
  441. })
  442. } else if (command == '求助类') {
  443. this.currentPage = 1,
  444. this.pageSize = 5,
  445. this.total = 0,
  446. c1.callFunction({
  447. name: 'pc_houtai',
  448. data: {
  449. fenlei_pc_YouJian: 1,
  450. newsid: "2",
  451. currentPage: this.currentPage
  452. },
  453. success: res => {
  454. console.log(res.result.data)
  455. this.tableData = res.result.data
  456. this.total = res.result.pageCount * this.pageSize
  457. this.handleClick_YiYue_panduan = true,
  458. this.paginationType = 'newids2'
  459. }
  460. })
  461. } else if (command == '举报类') {
  462. this.currentPage = 1,
  463. this.pageSize = 5,
  464. this.total = 0,
  465. c1.callFunction({
  466. name: 'pc_houtai',
  467. data: {
  468. fenlei_pc_YouJian: 1,
  469. newsid: "3",
  470. currentPage: this.currentPage
  471. },
  472. success: res => {
  473. console.log(res.result.data)
  474. this.tableData = res.result.data
  475. this.total = res.result.pageCount * this.pageSize
  476. this.handleClick_YiYue_panduan = true
  477. this.paginationType = 'newids3'
  478. }
  479. })
  480. } else if (command == '投诉类') {
  481. this.currentPage = 1,
  482. this.pageSize = 5,
  483. this.total = 0,
  484. c1.callFunction({
  485. name: 'pc_houtai',
  486. data: {
  487. fenlei_pc_YouJian: 1,
  488. newsid: "4",
  489. currentPage: this.currentPage
  490. },
  491. success: res => {
  492. console.log(res.result.data)
  493. this.tableData = res.result.data
  494. this.total = res.result.pageCount * this.pageSize
  495. this.handleClick_YiYue_panduan = true,
  496. this.paginationType = 'newids4'
  497. }
  498. })
  499. } else if (command == '报修类') {
  500. this.currentPage = 1,
  501. this.pageSize = 5,
  502. this.total = 0,
  503. c1.callFunction({
  504. name: 'pc_houtai',
  505. data: {
  506. fenlei_pc_YouJian: 1,
  507. newsid: "5",
  508. currentPage: this.currentPage
  509. },
  510. success: res => {
  511. console.log(res.result.data)
  512. this.tableData = res.result.data
  513. this.total = res.result.pageCount * this.pageSize
  514. this.handleClick_YiYue_panduan = true,
  515. this.paginationType = 'newids5'
  516. }
  517. })
  518. }
  519. }
  520. },
  521. }
  522. </script>
  523. <style scoped>
  524. .box {
  525. box-shadow:
  526. inset 0 0 10px rgba(255, 255, 255, 0.5),
  527. inset 0 0 20px rgba(255, 255, 255, 0.3),
  528. 0 0 10px rgba(0, 0, 0, 0.5);
  529. border-radius: 5px;
  530. width: 1500px;
  531. }
  532. .mask {
  533. position: fixed;
  534. top: 0;
  535. left: 0;
  536. width: 100%;
  537. height: 100%;
  538. background-color: rgba(0, 0, 0, 0.7);
  539. z-index: 999;
  540. }
  541. .custom-file-upload {
  542. display: inline-block;
  543. padding: 10px 20px;
  544. background-color: #f0f0f0;
  545. color: #333;
  546. border: 2px solid #ccc;
  547. border-radius: 5px;
  548. cursor: pointer;
  549. height: 20px;
  550. }
  551. .custom-file-upload:hover {
  552. background-color: #e0e0e0;
  553. }
  554. .custom-file-upload input[type="file"] {
  555. display: none;
  556. }
  557. </style>

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

闽ICP备14008679号