当前位置:   article > 正文

微信阅读网站小程序的设计与实现_阅读类小程序文章阅读页面如何实现

阅读类小程序文章阅读页面如何实现

文末获取源码

开发语言:Java

框架:ssm

JDK版本:JDK1.8

服务器:tomcat7

数据库:mysql 5.7/8.0

数据库工具:Navicat11

开发软件:eclipse/myeclipse/idea

Maven包:Maven3.3.9

浏览器:谷歌浏览器

小程序框架:uniapp

小程序开发软件:HBuilder X

小程序运行软件:微信开发者

一、前言介绍 

微信阅读网站小程序借助微信开发者工具开发用户前端,使用SSM框架和Java语言开发管理员后台,使用Mysql创建数据表保存本系统产生的数据。系统可以提供信息显示和相应服务,其管理员管理书城,图书订单,图书章节,回复用户留言,管理用户以及阅读资讯。用户购买并支付图书订单,查看图书章节,发布留言,管理图书收藏信息。

总之,微信阅读网站小程序可以更加方便用户购买图书章节,在线阅读图书各个章节内容。

二、功能结构设计

在前面分析的管理员功能的基础上,进行接下来的设计工作,最终展示设计的管理员结构图(见下图)。管理员管理书城,图书订单,图书章节,回复用户留言,管理用户以及阅读资讯。

在前面分析的用户功能的基础上,进行接下来的设计工作,最终展示设计的用户结构图(见下图)。用户购买并支付图书订单,查看图书章节,发布留言,管理图书收藏信息。

 三、管理员功能

书城管理

图书订单管理

章节信息管理

四、用户功能

图书信息

 

图书订单

 

五、部分核心代码

  1. methods: {
  2. jump(url) {
  3. if (this.queryIndex == 0) {
  4. localStorage.setItem('indexQueryCondition', document.getElementById("dianyingxinxidianyingmingcheng").value);
  5. }
  6. jump(url)
  7. },
  8. queryChange(event) {
  9. this.queryIndex = event.target.value;
  10. if (this.queryIndex == 0) {
  11. this.dianyingxinxidianyingmingcheng = this.queryList[event.target.value].queryName;
  12. }
  13. }
  14. }
  15. });
  16. layui.use(['layer', 'form', 'element', 'carousel', 'http', 'jquery'], function() {
  17. var layer = layui.layer;
  18. var element = layui.element;
  19. var form = layui.form;
  20. var carousel = layui.carousel;
  21. var http = layui.http;
  22. var jquery = layui.jquery;
  23. vue.baseurl=http.baseurl;
  24. // 获取轮播图 数据
  25. http.request('config/list', 'get', {
  26. page: 1,
  27. limit: 5
  28. }, function(res) {
  29. if (res.data.list.length > 0) {
  30. let swiperList = [];
  31. res.data.list.forEach(element => {
  32. if (element.value != null) {
  33. swiperList.push({
  34. img: http.baseurl + element.value
  35. });
  36. }
  37. });
  38. vue.swiperList = swiperList;
  39. vue.$nextTick(() => {
  40. carousel.render({
  41. elem: '#test1',
  42. width: '89.6%',
  43. height: '500px',
  44. arrow: 'hover',
  45. anim: 'default',
  46. autoplay: 'true',
  47. interval: '3000',
  48. indicator: 'inside'
  49. });
  50. })
  51. // vue.$nextTick(()=>{
  52. // window.xznSlide();
  53. // });
  54. }
  55. });
  56. http.request('news/list', 'get', {
  57. page: 1,
  58. order: 'desc'
  59. }, function(res) {
  60. var newsList = res.data.list;
  61. for(var i = 0; i<newsList.length; i++) {
  62. let d = newsList[i].addtime.split(' ')
  63. d = d[0].split('-')
  64. newsList[i].year = d[0]
  65. newsList[i].month = d[1] + '-' + d[2]
  66. }
  67. vue.newsList = newsList;
  68. if (newsList.length > 0 && newsList.length <= 2) {
  69. vue.leftNewsList = res.data.list
  70. } else {
  71. var leftNewsList = []
  72. for (let i = 0; i <= 2; i++) {
  73. leftNewsList.push(newsList[i]);
  74. }
  75. vue.leftNewsList = leftNewsList
  76. }
  77. if (newsList.length > 2 && newsList.length <= 8) {
  78. var rightNewsList = []
  79. for (let i = 3; i <= newsList.length; i++) {
  80. rightNewsList.push(newsList[i]);
  81. }
  82. vue.rightNewsList = rightNewsList
  83. }
  84. let flag = 10;
  85. let options = {"navigation":{"nextEl":".swiper-button-next","prevEl":".swiper-button-prev"},"slidesPerView":5,"loop":true,"spaceBetween":20,"autoplay":{"delay":3000,"disableOnInteraction":false}}
  86. options.pagination = {el:'null'}
  87. if(flag == 3) {
  88. vue.$nextTick(() => {
  89. new Swiper('#newsnews', options)
  90. })
  91. }
  92. if(flag == 6) {
  93. let sixSwiper = {
  94. loop: true,
  95. speed: 2500,
  96. slidesPerView: 3,
  97. spaceBetween: 10,
  98. centeredSlides: true,
  99. watchSlidesProgress: true,
  100. autoplay: {
  101. delay: 0,
  102. stopOnLastSlide: false,
  103. disableOnInteraction: false
  104. }
  105. }
  106. vue.$nextTick(() => {
  107. new Swiper('#new-list-6', sixSwiper)
  108. })
  109. }
  110. });
  111. // 获取推荐信息
  112. var autoSortUrl = "dianyingxinxi/autoSort";
  113. if(localStorage.getItem('userid')!=null) {
  114. autoSortUrl = "dianyingxinxi/autoSort2";
  115. }
  116. http.request(autoSortUrl, 'get', {
  117. page: 1,
  118. limit: 3 * 1
  119. }, function(res) {
  120. vue.dianyingxinxiRecommend = res.data.list
  121. let flag = 1;
  122. let options = {"navigation":{"nextEl":".swiper-button-next","prevEl":".swiper-button-prev"},"slidesPerView":5,"loop":true,"spaceBetween":20,"autoplay":{"delay":3000,"disableOnInteraction":false}}
  123. options.pagination = {el:'null'}
  124. if(flag == 3) {
  125. vue.$nextTick(() => {
  126. new Swiper('#recommenddianyingxinxi', options)
  127. })
  128. }
  129. if(flag == 5) {
  130. vue.$nextTick(() => {
  131. var swiper = new Swiper('#recommend-five-swiperdianyingxinxi', {
  132. loop: true,
  133. speed: 500,
  134. slidesPerView: 5,
  135. spaceBetween: 10,
  136. autoplay: {"delay":3000,"disableOnInteraction":false},
  137. centeredSlides: true,
  138. watchSlidesProgress: true,
  139. on: {
  140. setTranslate: function() {
  141. slides = this.slides
  142. for (i = 0; i < slides.length; i++) {
  143. slide = slides.eq(i)
  144. progress = slides[i].progress
  145. // slide.html(progress.toFixed(2)); //看清楚progress是怎么变化的
  146. slide.css({
  147. 'opacity': '',
  148. 'background': ''
  149. });
  150. slide.transform(''); //清除样式
  151. slide.transform('scale(' + (1.5 - Math.abs(progress) / 4) + ')');
  152. }
  153. },
  154. setTransition: function(transition) {
  155. for (var i = 0; i < this.slides.length; i++) {
  156. var slide = this.slides.eq(i)
  157. slide.transition(transition);
  158. }
  159. },
  160. },
  161. navigation: {"nextEl":".swiper-button-next","prevEl":".swiper-button-prev"},
  162. pagination: {"el":".swiper-pagination","clickable":true},
  163. });
  164. })
  165. }
  166. });
  167. });

 

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

闽ICP备14008679号