├── README.md ├── app.js ├── app.json ├── app.wxss ├── img ├── book.png ├── chapter.png ├── edit.png ├── icon.png ├── mybook.png ├── ok.png ├── otherIcon.png ├── pullDown.png ├── pullDowned.png ├── refresh.png ├── refresh1.png ├── search.png ├── selectedBook.png ├── selectedMybook.png └── selectedSearch.png ├── pages ├── bookCats │ ├── bookCats.js │ ├── bookCats.json │ ├── bookCats.wxml │ └── bookCats.wxss ├── bookCity │ ├── bookCity.js │ ├── bookCity.json │ ├── bookCity.wxml │ └── bookCity.wxss ├── bookshelf │ ├── bookshelf.js │ ├── bookshelf.json │ ├── bookshelf.wxml │ └── bookshelf.wxss ├── details │ ├── details.js │ ├── details.json │ ├── details.wxml │ └── details.wxss ├── help │ ├── help.js │ ├── help.json │ ├── help.wxml │ └── help.wxss ├── rank │ ├── rank.js │ ├── rank.json │ ├── rank.wxml │ └── rank.wxss ├── reader │ ├── reader.js │ ├── reader.json │ ├── reader.wxml │ └── reader.wxss ├── search │ ├── search.js │ ├── search.json │ ├── search.wxml │ └── search.wxss └── wxParse │ ├── html2json.js │ ├── htmlparser.js │ ├── showdown.js │ ├── wxDiscode.js │ ├── wxParse.js │ ├── wxParse.json │ ├── wxParse.wxml │ └── wxParse.wxss ├── project.config.json ├── screenshot ├── IMB_4fxOF8.GIF ├── IMB_RnLDFU.GIF ├── IMB_ZmOfIw.GIF ├── IMB_lPMctF.GIF └── icon.png └── utils ├── api.js └── util.js /README.md: -------------------------------------------------------------------------------- 1 | ![轻读书屋](./screenshot/icon.png) 2 |

轻读书屋

3 |

轻读书屋是一款支持在线阅读全网小说的免费阅读小程序,在轻读书屋你可以随时随地收藏自己喜欢的书籍进行阅读。

4 | 5 |

特色功能

6 |

1、记录章节阅读位置,下次进入自动滑动到上次的阅读位置

7 |

2、提供主题切换,目前包含夜间模式、护眼模式、正常模式

8 |

3、可改变字体大小和行间距

9 |

后续有时间的话再加入其它功能。。。

10 | 11 |

应用部分截图

12 | 13 | ![Alt text](./screenshot/IMB_4fxOF8.GIF) 14 | ***************************************************************************** 15 | 16 | ![Alt text](./screenshot/IMB_lPMctF.GIF) 17 | ***************************************************************************** 18 | 19 | ![Alt text](./screenshot/IMB_RnLDFU.GIF) 20 | ***************************************************************************** 21 | 22 | ![Alt text](./screenshot/IMB_ZmOfIw.GIF) 23 | ***************************************************************************** 24 | -------------------------------------------------------------------------------- /app.js: -------------------------------------------------------------------------------- 1 | //app.js 2 | App({ 3 | onLaunch: function () { 4 | // 展示本地存储能力 5 | var logs = wx.getStorageSync('logs') || [] 6 | logs.unshift(Date.now()) 7 | wx.setStorageSync('logs', logs) 8 | 9 | // 登录 10 | wx.login({ 11 | success: res => { 12 | // 发送 res.code 到后台换取 openId, sessionKey, unionId 13 | } 14 | }) 15 | // 获取用户信息 16 | wx.getSetting({ 17 | success: res => { 18 | if (res.authSetting['scope.userInfo']) { 19 | // 已经授权,可以直接调用 getUserInfo 获取头像昵称,不会弹框 20 | wx.getUserInfo({ 21 | success: res => { 22 | // 可以将 res 发送给后台解码出 unionId 23 | this.globalData.userInfo = res.userInfo 24 | 25 | // 由于 getUserInfo 是网络请求,可能会在 Page.onLoad 之后才返回 26 | // 所以此处加入 callback 以防止这种情况 27 | if (this.userInfoReadyCallback) { 28 | this.userInfoReadyCallback(res) 29 | } 30 | } 31 | }) 32 | } 33 | } 34 | }) 35 | }, 36 | globalData: { 37 | userInfo: null 38 | } 39 | }) -------------------------------------------------------------------------------- /app.json: -------------------------------------------------------------------------------- 1 | { 2 | "pages": [ 3 | "pages/bookshelf/bookshelf", 4 | "pages/details/details", 5 | "pages/bookCity/bookCity", 6 | "pages/bookCats/bookCats", 7 | "pages/reader/reader", 8 | "pages/search/search", 9 | "pages/rank/rank", 10 | "pages/help/help" 11 | ], 12 | "window": { 13 | "backgroundTextStyle": "light", 14 | "navigationBarBackgroundColor": "#fff", 15 | "navigationBarTitleText": "轻读书屋", 16 | "navigationBarTextStyle": "black" 17 | }, 18 | "tabBar": { 19 | "color": "#333", 20 | "selectedColor": "#cb1c36", 21 | "backgroundColor": "#fff", 22 | "list": [ 23 | { 24 | "iconPath": "img/mybook.png", 25 | "selectedIconPath": "img/selectedMybook.png", 26 | "pagePath": "pages/bookshelf/bookshelf", 27 | "text": "书架" 28 | }, 29 | { 30 | "iconPath": "img/book.png", 31 | "selectedIconPath": "img/selectedBook.png", 32 | "pagePath": "pages/bookCity/bookCity", 33 | "text": "书城" 34 | }, 35 | { 36 | "iconPath": "img/search.png", 37 | "selectedIconPath": "img/selectedSearch.png", 38 | "pagePath": "pages/search/search", 39 | "text": "搜索" 40 | } 41 | ] 42 | } 43 | } -------------------------------------------------------------------------------- /app.wxss: -------------------------------------------------------------------------------- 1 | /**app.wxss**/ 2 | 3 | .container { 4 | height: 100%; 5 | display: flex; 6 | flex-direction: column; 7 | align-items: center; 8 | justify-content: space-between; 9 | box-sizing: border-box; 10 | position: relative; 11 | } 12 | -------------------------------------------------------------------------------- /img/book.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/loongcheung/leisure-reader/19e247351c9285165beec464eced7b43b97f137f/img/book.png -------------------------------------------------------------------------------- /img/chapter.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/loongcheung/leisure-reader/19e247351c9285165beec464eced7b43b97f137f/img/chapter.png -------------------------------------------------------------------------------- /img/edit.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/loongcheung/leisure-reader/19e247351c9285165beec464eced7b43b97f137f/img/edit.png -------------------------------------------------------------------------------- /img/icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/loongcheung/leisure-reader/19e247351c9285165beec464eced7b43b97f137f/img/icon.png -------------------------------------------------------------------------------- /img/mybook.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/loongcheung/leisure-reader/19e247351c9285165beec464eced7b43b97f137f/img/mybook.png -------------------------------------------------------------------------------- /img/ok.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/loongcheung/leisure-reader/19e247351c9285165beec464eced7b43b97f137f/img/ok.png -------------------------------------------------------------------------------- /img/otherIcon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/loongcheung/leisure-reader/19e247351c9285165beec464eced7b43b97f137f/img/otherIcon.png -------------------------------------------------------------------------------- /img/pullDown.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/loongcheung/leisure-reader/19e247351c9285165beec464eced7b43b97f137f/img/pullDown.png -------------------------------------------------------------------------------- /img/pullDowned.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/loongcheung/leisure-reader/19e247351c9285165beec464eced7b43b97f137f/img/pullDowned.png -------------------------------------------------------------------------------- /img/refresh.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/loongcheung/leisure-reader/19e247351c9285165beec464eced7b43b97f137f/img/refresh.png -------------------------------------------------------------------------------- /img/refresh1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/loongcheung/leisure-reader/19e247351c9285165beec464eced7b43b97f137f/img/refresh1.png -------------------------------------------------------------------------------- /img/search.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/loongcheung/leisure-reader/19e247351c9285165beec464eced7b43b97f137f/img/search.png -------------------------------------------------------------------------------- /img/selectedBook.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/loongcheung/leisure-reader/19e247351c9285165beec464eced7b43b97f137f/img/selectedBook.png -------------------------------------------------------------------------------- /img/selectedMybook.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/loongcheung/leisure-reader/19e247351c9285165beec464eced7b43b97f137f/img/selectedMybook.png -------------------------------------------------------------------------------- /img/selectedSearch.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/loongcheung/leisure-reader/19e247351c9285165beec464eced7b43b97f137f/img/selectedSearch.png -------------------------------------------------------------------------------- /pages/bookCats/bookCats.js: -------------------------------------------------------------------------------- 1 | // pages/bookCats/bookCats.js 2 | const api = require('../../utils/api.js'); 3 | Page({ 4 | 5 | /** 6 | * 页面的初始数据 7 | */ 8 | data: { 9 | winHeight: "",//窗口高度 10 | STATIC_HOST: '', 11 | gender: '', 12 | major: '', 13 | currentType: 'hot', 14 | typeList: [ 15 | { 16 | id: 'hot', 17 | name: '热门' 18 | }, 19 | { 20 | id: 'new', 21 | name: '新书' 22 | }, 23 | { 24 | id: 'reputation', 25 | name: '好评' 26 | }, 27 | { 28 | id: 'over', 29 | name: '完结' 30 | }, 31 | { 32 | id: 'monthly', 33 | name: 'VIP' 34 | } 35 | ], 36 | currentMinor: '全部', 37 | showMinor: true, 38 | minorList: [], 39 | bookListTop: 164, //scroll-view的相对top 40 | books: {}, 41 | tagColors: ['#FF8C00', '#00CED1', '#FF4500'], 42 | start: 0, //分页起始 43 | loadMore: true, //防止多次加载 44 | loadedAll: false, //已加载全部 45 | scrollTop: 0 //scroll-view 滚动条位置 46 | }, 47 | 48 | getIndexBooks: function (gender, type, major, minor, start) { 49 | wx.request({ 50 | url: api.classification.getCatsBooks(gender, type, major, minor, start), 51 | success: res => { 52 | wx.hideLoading(); 53 | if (res.data.books.length === 0) { 54 | this.setData({ 55 | loadedAll: true 56 | }) 57 | } else { 58 | if (start !== 0) { 59 | this.data.books.books = this.data.books.books.concat(res.data.books); 60 | this.setData({ 61 | books: this.data.books, 62 | loadMore: true 63 | }); 64 | } else { 65 | this.setData({ 66 | books: res.data, 67 | start: 0, 68 | scrollTop: 0 69 | }); 70 | } 71 | } 72 | } 73 | }) 74 | }, 75 | 76 | loadMore: function () { 77 | if (this.data.loadMore) { 78 | wx.showLoading({ 79 | title: '加载中', 80 | mask: true 81 | }); 82 | this.setData({ 83 | start: this.data.start + 20, 84 | loadMore: false 85 | }); 86 | 87 | let minor = this.data.currentMinor === '全部' ? '' : this.data.currentMinor; 88 | this.getIndexBooks(this.data.gender, this.data.currentType, this.data.major, minor, this.data.start); 89 | } 90 | }, 91 | 92 | switchType: function (e) { 93 | wx.showLoading({ 94 | title: '加载中', 95 | mask: true 96 | }); 97 | this.setData({ 98 | currentType: e.target.dataset.typeid 99 | }); 100 | let minor = this.data.currentMinor === '全部' ? '' : this.data.currentMinor; 101 | this.getIndexBooks(this.data.gender, this.data.currentType, this.data.major, minor, 0); 102 | }, 103 | 104 | switchMinor: function (e) { 105 | wx.showLoading({ 106 | title: '加载中', 107 | mask: true 108 | }); 109 | this.setData({ 110 | currentMinor: e.target.dataset.typeid 111 | }); 112 | console.log(this.data.currentMinor) 113 | let minor = this.data.currentMinor === '全部' ? '' : this.data.currentMinor; 114 | this.getIndexBooks(this.data.gender, this.data.currentType, this.data.major, minor, 0); 115 | }, 116 | /** 117 | * 生命周期函数--监听页面加载 118 | */ 119 | onLoad: function (options) { 120 | wx.showLoading({ 121 | title: '加载中', 122 | mask: true 123 | }); 124 | // 高度自适应 125 | wx.getSystemInfo({ 126 | success: (res) => { 127 | var clientHeight = res.windowHeight, 128 | clientWidth = res.windowWidth, 129 | rpxR = 750 / clientWidth; 130 | var calc = clientHeight * rpxR - 180; 131 | this.setData({ 132 | winHeight: calc 133 | }); 134 | } 135 | }); 136 | wx.setNavigationBarTitle({ 137 | title: options.major, 138 | }); 139 | wx.getStorage({ 140 | key: 'minor', 141 | success: res => { 142 | let data = res.data[options.gender]; 143 | for (let i = 0; i < data.length; i++) { 144 | if (data[i].major === options.major) { 145 | data[i].mins.unshift('全部'); 146 | if (data[i].mins.length === 1) { 147 | this.setData({ 148 | showMinor: false, 149 | bookListTop: 82, 150 | winHeight: this.data.winHeight + 80 151 | }); 152 | } 153 | this.setData({ 154 | STATIC_HOST: api.STATIC_HOST, 155 | minorList: data[i].mins 156 | }); 157 | } 158 | } 159 | }, 160 | }); 161 | this.setData({ 162 | gender: options.gender, 163 | major: options.major 164 | }); 165 | this.getIndexBooks(options.gender, 'hot', options.major, '', 0); 166 | } 167 | }) -------------------------------------------------------------------------------- /pages/bookCats/bookCats.json: -------------------------------------------------------------------------------- 1 | { 2 | "navigationBarTitleText": "轻读", 3 | "backgroundTextStyle": "light", 4 | "navigationBarBackgroundColor": "#cb1c36", 5 | "navigationBarTextStyle": "#f2f2f2" 6 | } -------------------------------------------------------------------------------- /pages/bookCats/bookCats.wxml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | {{item.name}} 7 | 8 | 9 | 10 | 11 | {{item}} 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | {{book.title}} 20 | {{book.author}} 21 | {{book.shortIntro}} 22 | {{book.tags[tag]}} 23 | 24 | 25 | 已加载全部 26 | 27 | -------------------------------------------------------------------------------- /pages/bookCats/bookCats.wxss: -------------------------------------------------------------------------------- 1 | /* pages/bookCats/bookCats.wxss */ 2 | .bookCats { 3 | background: #f7f7f7; 4 | width: 100%; 5 | } 6 | 7 | .type_wrap { 8 | position: fixed; 9 | top: 0; 10 | width: 100%; 11 | z-index: 100; 12 | background: #fff; 13 | } 14 | 15 | .type,.minor { 16 | padding-left: 20rpx; 17 | border-bottom: 1px #eee solid; 18 | width: 100%; 19 | } 20 | 21 | .type { 22 | display: flex; 23 | } 24 | 25 | .minor { 26 | white-space: nowrap; 27 | } 28 | 29 | ::-webkit-scrollbar { 30 | width: 0; 31 | height: 0; 32 | color: transparent; 33 | } 34 | 35 | .type-item,.minor-item { 36 | line-height: 80rpx; 37 | font-size: 14px; 38 | color: #666; 39 | margin-right: 30rpx; 40 | } 41 | 42 | .minor-item { 43 | display: inline-block; 44 | } 45 | 46 | .active { 47 | color: #cb1c36; 48 | } 49 | 50 | .bookList { 51 | background: #fff; 52 | position: relative; 53 | padding: 0 30rpx; 54 | width: 92%; 55 | } 56 | 57 | .book_item { 58 | border-bottom: 1px #eee solid; 59 | position: relative; 60 | height: 335rpx; 61 | } 62 | 63 | .book_item image { 64 | width: 190rpx; 65 | height: 275rpx; 66 | position: absolute; 67 | left: 0; 68 | top: 30rpx; 69 | } 70 | 71 | .book_info { 72 | position: absolute; 73 | right: 0; 74 | top: 30rpx; 75 | width: 475rpx; 76 | } 77 | 78 | .book_title { 79 | color: #333; 80 | font-size: 15px; 81 | font-weight: bold; 82 | display: block; 83 | margin-bottom: 10rpx; 84 | } 85 | 86 | .book_site,.book_desc { 87 | color: #999; 88 | font-size: 12px; 89 | line-height: 40rpx; 90 | display: block; 91 | margin-bottom: 10rpx; 92 | } 93 | 94 | .book_desc { 95 | overflow : hidden; 96 | text-overflow: ellipsis; 97 | display: -webkit-box; 98 | -webkit-line-clamp: 3; 99 | -webkit-box-orient: vertical; 100 | } 101 | 102 | .book_tag { 103 | display: inline-block; 104 | } 105 | 106 | .book_tag_item { 107 | display: inline-block; 108 | color: #fff; 109 | font-size: 12px; 110 | padding: 0 8rpx; 111 | line-height: 40rpx; 112 | border-radius: 5rpx; 113 | margin-right: 10rpx; 114 | } 115 | 116 | .loadedAll { 117 | text-align: center; 118 | line-height: 50rpx; 119 | color: #666; 120 | font-size: 15px; 121 | } -------------------------------------------------------------------------------- /pages/bookCity/bookCity.js: -------------------------------------------------------------------------------- 1 | // pages/bookCity/bookCity.js 2 | const api = require('../../utils/api.js') 3 | 4 | Page({ 5 | data: { 6 | STATIC_HOST: '', 7 | winHeight: "",//窗口高度 8 | currentTab: 0, //预设当前项的值 9 | majorList: {}, 10 | rankCategory: {}, 11 | openMaleOther: false, //控制列表伸缩 12 | openFemaleOther: false 13 | }, 14 | // 滚动切换标签样式 15 | switchTab: function (e) { 16 | this.setData({ 17 | currentTab: e.detail.current 18 | }); 19 | }, 20 | // 点击标题切换当前页时改变样式 21 | swichNav: function (e) { 22 | var cur = e.target.dataset.current; 23 | if (this.data.currentTaB == cur) { return false; } 24 | else { 25 | this.setData({ 26 | currentTab: cur 27 | }) 28 | } 29 | }, 30 | //展开当前其他排行榜 31 | toggleList: function (e) { 32 | let id = e.target.dataset.id; 33 | if (id === '0') { 34 | this.setData({ 35 | openMaleOther: !this.data.openMaleOther 36 | }); 37 | } else if (id === '1') { 38 | this.setData({ 39 | openFemaleOther: !this.data.openFemaleOther 40 | }); 41 | } 42 | }, 43 | //获取一级分类及数目 44 | getCats: function () { 45 | wx.request({ 46 | url: api.classification.getCats, 47 | success: (res) => { 48 | this.setData({ 49 | majorList: res.data 50 | }); 51 | } 52 | }) 53 | }, 54 | //获取二级分类 55 | getMinor: function () { 56 | wx.request({ 57 | url: api.classification.getMinor, 58 | success: function (res) { 59 | wx.hideLoading(); 60 | wx.setStorage({ 61 | key: 'minor', 62 | data: res.data, 63 | }) 64 | } 65 | }); 66 | }, 67 | //获取排行 68 | getRankCategory: function () { 69 | wx.request({ 70 | url: api.rank.rankCategory, 71 | success: res => { 72 | for (let key in res.data) { //对于有别人家的排行榜的特殊处理 将追书替换为轻读 73 | for (let i = 0; i < res.data[key].length; i++) { 74 | res.data[key][i].title = res.data[key][i].title.replace('追书', '轻读'); 75 | if (res.data[key][i].collapse) { 76 | res.data[key].splice(i, 0, { 77 | title: '别人家的排行榜', 78 | key: 'isOther', 79 | collapse: true, 80 | cover: '../../img/otherIcon.png' 81 | }); 82 | break; 83 | } 84 | } 85 | } 86 | this.setData({ 87 | rankCategory: res.data 88 | }); 89 | } 90 | }) 91 | }, 92 | onLoad: function () { 93 | this.setData({ 94 | STATIC_HOST: api.STATIC_HOST 95 | }); 96 | wx.showLoading({ 97 | title: '加载中', 98 | mask: true 99 | }) 100 | this.getCats(); 101 | this.getMinor(); 102 | this.getRankCategory(); 103 | // 高度自适应 104 | wx.getSystemInfo({ 105 | success: (res) => { 106 | var clientHeight = res.windowHeight, 107 | clientWidth = res.windowWidth, 108 | rpxR = 750 / clientWidth; 109 | var calc = clientHeight * rpxR - 80; 110 | this.setData({ 111 | winHeight: calc 112 | }); 113 | } 114 | }); 115 | } 116 | }) -------------------------------------------------------------------------------- /pages/bookCity/bookCity.json: -------------------------------------------------------------------------------- 1 | { 2 | "navigationBarTitleText": "书城", 3 | "backgroundTextStyle": "light", 4 | "navigationBarBackgroundColor": "#cb1c36", 5 | "navigationBarTextStyle": "#f2f2f2" 6 | } -------------------------------------------------------------------------------- /pages/bookCity/bookCity.wxml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 7 | 分类 8 | 排行 9 | 10 | 11 | 14 | 15 | 16 | 17 | 男生 18 | 19 | 20 | {{item.name}} 21 | {{item.bookCount}}本 22 | 23 | 24 | 25 | 26 | 女生 27 | 28 | 29 | {{item.name}} 30 | {{item.bookCount}}本 31 | 32 | 33 | 34 | 43 | 44 | 出版 45 | 46 | 47 | {{item.name}} 48 | {{item.bookCount}}本 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 男生 58 | 59 | 60 | 61 | {{item.title}} 62 | 63 | 64 | 65 | 66 | 女生 67 | 68 | 69 | 70 | {{item.title}} 71 | 72 | 73 | 74 | 86 | 87 | 88 | 89 | -------------------------------------------------------------------------------- /pages/bookCity/bookCity.wxss: -------------------------------------------------------------------------------- 1 | /* pages/bookCity/bookCity.wxss */ 2 | 3 | .tab-h { 4 | height: 80rpx; 5 | width: 100%; 6 | box-sizing: border-box; 7 | overflow: hidden; 8 | line-height: 80rpx; 9 | background: #f7f7f7; 10 | font-size: 16px; 11 | white-space: nowrap; 12 | position: fixed; 13 | top: 0; 14 | left: 0; 15 | z-index: 99; 16 | } 17 | 18 | /* .tab-item { 有书单 19 | display: inline-block; 20 | width: 33.3%; 21 | text-align: center; 22 | } */ 23 | 24 | .tab-item { 25 | display: inline-block; 26 | width: 50%; 27 | text-align: center; 28 | } 29 | 30 | .tab-item.active { 31 | color: #ec304c; 32 | position: relative; 33 | } 34 | 35 | /* .tab-item.active:after { 有书单 36 | content: ""; 37 | display: block; 38 | height: 4rpx; 39 | width: 52rpx; 40 | background: #ec304c; 41 | position: absolute; 42 | bottom: 0; 43 | left: 98rpx; 44 | border-radius: 16rpx; 45 | } */ 46 | 47 | .tab-item.active:after { 48 | content: ""; 49 | display: block; 50 | height: 4rpx; 51 | width: 52rpx; 52 | background: #ec304c; 53 | position: absolute; 54 | bottom: 0; 55 | left: 160rpx; 56 | border-radius: 16rpx; 57 | } 58 | 59 | .tab-content { 60 | margin-top: 80rpx; 61 | } 62 | 63 | .scroll-h { 64 | height: 100%; 65 | } 66 | 67 | .Cats, .rank_item { 68 | width: 100%; 69 | } 70 | 71 | .bookCat, .bookRank { 72 | color: #999; 73 | font-size: 15px; 74 | line-height: 100rpx; 75 | text-align: left; 76 | padding-left: 20rpx; 77 | } 78 | 79 | .Cats view { 80 | display: flex; 81 | justify-content: flex-start; 82 | flex-direction: row; 83 | flex-wrap: wrap; 84 | } 85 | 86 | .rank_item { 87 | overflow: hidden; 88 | transition: .6s all ease-in-out; 89 | } 90 | 91 | .rank_item .rank_item_item { 92 | width: 95%; 93 | border-bottom: 1px #eee solid; 94 | height: 90rpx; 95 | line-height: 90rpx; 96 | display: flex; 97 | flex-direction: row; 98 | margin-left: 5%; 99 | } 100 | 101 | .rank_item_item .rank_icon { 102 | width: 55rpx; 103 | height: 55rpx; 104 | position: relative; 105 | top: 18rpx; 106 | } 107 | 108 | .rank_item_item view { 109 | font-size: 15px; 110 | color: #333; 111 | height: 90rpx; 112 | line-height: 90rpx; 113 | margin-left: 20rpx; 114 | } 115 | 116 | .rank_item_item .pulldown_icon { 117 | width: 35rpx; 118 | height: 35rpx; 119 | position: relative; 120 | top: 32rpx; 121 | left: 345rpx; 122 | } 123 | 124 | .catBlock { 125 | height: 120rpx; 126 | display: flex; 127 | width: 33.3%; 128 | flex-direction: column; 129 | text-align: center; 130 | border: 1px #f7f7f7 solid; 131 | box-sizing: border-box; 132 | } 133 | 134 | .catName { 135 | font-size: 15px; 136 | color: #333; 137 | font-weight: bold; 138 | margin-top: 15rpx; 139 | } 140 | 141 | .catCount { 142 | font-size: 12px; 143 | margin-top: 10rpx; 144 | color: #999; 145 | } 146 | -------------------------------------------------------------------------------- /pages/bookshelf/bookshelf.js: -------------------------------------------------------------------------------- 1 | //index.js 2 | //获取应用实例 3 | const app = getApp() 4 | const api = require('../../utils/api.js'); 5 | Page({ 6 | data: { 7 | STATIC_HOST: '', 8 | userInfo: {}, 9 | bookShelfData: [], 10 | hasUpdate: [], 11 | isEdit: false 12 | }, 13 | 14 | edit: function () { 15 | this.setData({ 16 | isEdit: !this.data.isEdit 17 | }); 18 | }, 19 | 20 | delete: function (e) { 21 | let i = e.target.dataset.id; 22 | this.data.bookShelfData.splice(i,1); 23 | wx.getStorage({ 24 | key: 'bookShelfData', 25 | success: function(res) { 26 | res.data.splice(i, 1); 27 | wx.setStorage({ 28 | key: 'bookShelfData', 29 | data: res.data, 30 | }) 31 | }, 32 | }) 33 | this.setData({ 34 | bookShelfData: this.data.bookShelfData 35 | }); 36 | }, 37 | 38 | getlasterChapter: function () { 39 | for (let i = 0; i < this.data.bookShelfData.length; i++) { 40 | wx.request({ 41 | url: api.book.bookChaptersBookId(this.data.bookShelfData[i].bookInfo.id), 42 | success: res => { 43 | wx.hideLoading(); 44 | //如果有更新就将最近更新的时间刷新进去,初次与加入书架时比较 45 | if (Date.parse(this.data.bookShelfData[i].bookInfo.laterChapter) + 60 * 60 * 24 <= Date.parse(res.data.mixToc.chaptersUpdated)) { 46 | this.data.bookShelfData[i].bookInfo.laterChapter = res.data.mixToc.chaptersUpdated; 47 | wx.setStorage({ 48 | key: 'bookShelfData', 49 | data: this.data.bookShelfData, 50 | }) 51 | this.data.hasUpdate[i] = 1; 52 | this.setData({ 53 | hasUpdate: this.data.hasUpdate 54 | }); 55 | } 56 | } 57 | }) 58 | } 59 | wx.hideLoading(); 60 | }, 61 | getShelfInfo: function () { 62 | wx.getStorage({ //获取书架信息 63 | key: 'bookShelfData', 64 | success: res => { 65 | this.setData({ 66 | STATIC_HOST: api.STATIC_HOST, 67 | bookShelfData: res.data 68 | }); 69 | for (let i = 0;i < res.data.length; i++) { 70 | this.data.hasUpdate.push(0); //用数组表示是否有更新, 1 有 0 无 71 | this.setData({ 72 | hasUpdate: this.data.hasUpdate 73 | }); 74 | } 75 | this.getlasterChapter(); 76 | }, 77 | fail: function () { 78 | wx.hideLoading(); 79 | wx.setStorage({ 80 | key: 'bookShelfData', 81 | data: [], 82 | }) 83 | } 84 | }) 85 | }, 86 | onLoad: function () { 87 | wx.getUserInfo({ 88 | success: res => { 89 | app.globalData.userInfo = res.userInfo 90 | this.setData({ 91 | userInfo: res.userInfo, 92 | hasUserInfo: true 93 | }) 94 | } 95 | }); 96 | }, 97 | onShow: function () { 98 | wx.showLoading({ 99 | title: '加载中', 100 | mask: true 101 | }); 102 | this.setData({ 103 | hasUpdate: [] 104 | }); 105 | this.getShelfInfo(); 106 | } 107 | }) -------------------------------------------------------------------------------- /pages/bookshelf/bookshelf.json: -------------------------------------------------------------------------------- 1 | { 2 | "navigationBarTitleText": "轻读", 3 | "backgroundTextStyle": "light", 4 | "navigationBarBackgroundColor": "#cb1c36", 5 | "navigationBarTextStyle": "#f2f2f2" 6 | } -------------------------------------------------------------------------------- /pages/bookshelf/bookshelf.wxml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | {{userInfo.nickName}} 7 | 已收藏{{bookShelfData.length}}本书 8 | 9 | 帮助 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 主人还没收藏书籍哦,请去书城收藏吧! 18 | 19 | 20 | 有更新 21 | 22 | 23 | {{item.bookInfo.title}} 24 | 读到第{{item.readNum}}章 25 | 26 | 27 | -------------------------------------------------------------------------------- /pages/bookshelf/bookshelf.wxss: -------------------------------------------------------------------------------- 1 | /**index.wxss**/ 2 | 3 | .userinfo { 4 | display: flex; 5 | flex-direction: row; 6 | padding: 20rpx 0; 7 | width: 100%; 8 | border-bottom: 20rpx #f7f7f7 solid; 9 | position: relative; 10 | } 11 | 12 | .userinfo-avatar { 13 | width: 128rpx; 14 | height: 128rpx; 15 | margin: 20rpx; 16 | border-radius: 50%; 17 | } 18 | 19 | .userbookinfo { 20 | height: 100rpx; 21 | position: relative; 22 | top: 20rpx; 23 | } 24 | 25 | .userinfo-nickname { 26 | color: #222; 27 | font-size: 18px; 28 | display: block; 29 | line-height: 80rpx; 30 | } 31 | 32 | .booksNum { 33 | color: #666; 34 | font-size: 13px; 35 | display: block; 36 | line-height: 30rpx; 37 | } 38 | 39 | .booksNum text { 40 | color: #cb1c36; 41 | } 42 | 43 | .help { 44 | line-height: 60rpx; 45 | font-size: 15px; 46 | color: #666; 47 | position: absolute; 48 | top: 50%; 49 | transform: translateY(-50%); 50 | right: 20rpx; 51 | border: 1px #999 solid; 52 | border-radius: 20%; 53 | text-align: center; 54 | width: 105rpx; 55 | } 56 | 57 | .bookshelfContainer { 58 | padding: 30rpx 0; 59 | margin: 0 20rpx; 60 | display: flex; 61 | flex-direction: row; 62 | flex-wrap: wrap; 63 | width: 92%; 64 | } 65 | 66 | .operation { 67 | width: 100%; 68 | margin-bottom: 40rpx; 69 | display: flex; 70 | flex-direction: row; 71 | justify-content: space-between; 72 | } 73 | 74 | .edit, .refresh1 { 75 | width: 50rpx; 76 | height: 50rpx; 77 | } 78 | 79 | .bookshelf_item { 80 | position: relative; 81 | width: 30%; 82 | margin: 0 30rpx 30rpx 0; 83 | } 84 | 85 | .noMargin { 86 | margin-right: 0; 87 | } 88 | 89 | .bookshelf_item image { 90 | width: 210rpx; 91 | height: 300rpx; 92 | margin: 0 auto; 93 | } 94 | 95 | .deletIcon { 96 | position: absolute; 97 | right: 0; 98 | top: 0; 99 | z-index: 20; 100 | } 101 | 102 | .bookshelf_item .name { 103 | color: #222; 104 | font-size: 15px; 105 | } 106 | 107 | .readNum { 108 | color: #999; 109 | font-size: 13px; 110 | } 111 | 112 | .hasUpdate { 113 | color: #fff; 114 | background: #cb1c36; 115 | width: 90rpx; 116 | height: 40rpx; 117 | text-align: center; 118 | line-height: 40rpx; 119 | font-size: 12px; 120 | position: absolute; 121 | top: 0; 122 | right: 0; 123 | z-index: 10; 124 | } 125 | 126 | .noBooks { 127 | margin-top: 60rpx; 128 | text-align: center; 129 | color: #333; 130 | font-size: 16px; 131 | width: 100%; 132 | } 133 | 134 | @keyframes delete { 135 | 0% { 136 | transform: rotate(0deg); 137 | } 138 | 139 | 25% { 140 | transform: rotate(-1deg); 141 | } 142 | 143 | 50% { 144 | transform: rotate(0deg); 145 | } 146 | 147 | 75% { 148 | transform: rotate(1deg); 149 | } 150 | 151 | 100% { 152 | transform: rotate(0deg); 153 | } 154 | } 155 | 156 | .deletAnimation { 157 | animation: delete 1s linear infinite; 158 | } 159 | 160 | -------------------------------------------------------------------------------- /pages/details/details.js: -------------------------------------------------------------------------------- 1 | // pages/details/details.js 2 | const api = require('../../utils/api.js'); 3 | Page({ 4 | 5 | /** 6 | * 页面的初始数据 7 | */ 8 | 9 | data: { 10 | STATIC_HOST: '', 11 | bookInfo: {}, 12 | book_rate: 0, //书籍评分 13 | showInfoContent: true, 14 | allRecommendBooks: [],//全部推荐书籍 15 | showRecommendBooks: [], //随机展示的三本推荐书籍 16 | shortReviews: {}, 17 | addedShelf: false 18 | }, 19 | 20 | showTab: function (event) { 21 | this.setData({ 22 | showInfoContent: !!parseInt(event.target.dataset.id) 23 | }); 24 | }, 25 | 26 | addShelf: function () { 27 | if (this.data.addedShelf) { 28 | return 29 | } 30 | let shelfData = { 31 | bookInfo: { 32 | id: this.data.bookInfo._id, 33 | title: this.data.bookInfo.title, 34 | cover: this.data.bookInfo.cover, 35 | laterChapter: this.data.bookInfo.updated 36 | }, 37 | readNum: 1, 38 | laterScrollTop: 0 //上次滑动的距离 39 | }; 40 | wx.getStorage({ 41 | key: 'bookShelfData', 42 | success: res => { 43 | res.data.unshift(shelfData); 44 | wx.setStorage({ 45 | key: 'bookShelfData', 46 | data: res.data, 47 | }); 48 | this.setData({ 49 | addedShelf: true 50 | }); 51 | }, 52 | }) 53 | }, 54 | 55 | getBookInfo: function (book_id) { 56 | wx.request({ 57 | url: api.book.bookInfo(book_id), 58 | success: res => { 59 | wx.hideLoading(); 60 | let score = Math.floor(res.data.rating.score / 2); 61 | this.setData({ 62 | bookInfo: res.data, 63 | book_rate: score 64 | }); 65 | } 66 | }) 67 | }, 68 | 69 | getRelatedRecommendedBooks: function (book_id) { 70 | wx.request({ 71 | url: api.book.relatedRecommendedBooks(book_id), 72 | success: res => { 73 | this.setData({ 74 | allRecommendBooks: res.data.books 75 | }); 76 | this.randomRecommendBooks(); 77 | } 78 | }) 79 | }, 80 | 81 | randomRecommendBooks: function () { //在所有推荐书籍中随机选出三本展示 82 | this.setData({ 83 | showRecommendBooks: [] 84 | }); 85 | let recommendBooksLen = this.data.allRecommendBooks.length; 86 | let randomIndex; 87 | for (let i = 0; i < 3; i++) { 88 | let newRandom = Math.floor(Math.random() * recommendBooksLen); 89 | if (newRandom === randomIndex) { 90 | i--; 91 | break; 92 | } 93 | randomIndex = newRandom; 94 | this.data.showRecommendBooks.push(this.data.allRecommendBooks[randomIndex]) 95 | } 96 | this.setData({ 97 | showRecommendBooks: this.data.showRecommendBooks 98 | }); 99 | }, 100 | 101 | getBookShortReviews(book_id) { 102 | wx.request({ 103 | url: api.comment.shortReviews(book_id), 104 | success: res => { 105 | this.setData({ 106 | shortReviews: res.data 107 | }); 108 | } 109 | }) 110 | }, 111 | /** 112 | * 生命周期函数--监听页面加载 113 | */ 114 | onLoad: function (options) { 115 | wx.showLoading({ 116 | title: '加载中', 117 | mask: true 118 | }); 119 | wx.getStorage({ //检查此书是否加入书架 120 | key: 'bookShelfData', 121 | success: res => { 122 | res.data.forEach(item => { 123 | if (item.bookInfo.id === options.book_id) { 124 | this.setData({ 125 | addedShelf: true 126 | }); 127 | return; 128 | } 129 | }); 130 | }, 131 | }); 132 | this.setData({ 133 | STATIC_HOST: api.STATIC_HOST 134 | }); 135 | this.getBookInfo(options.book_id); 136 | this.getRelatedRecommendedBooks(options.book_id); 137 | this.getBookShortReviews(options.book_id); 138 | }, 139 | 140 | /** 141 | * 生命周期函数--监听页面初次渲染完成 142 | */ 143 | onReady: function () { 144 | wx.hideLoading(); 145 | }, 146 | 147 | /** 148 | * 生命周期函数--监听页面显示 149 | */ 150 | onShow: function () { 151 | 152 | }, 153 | 154 | /** 155 | * 生命周期函数--监听页面隐藏 156 | */ 157 | onHide: function () { 158 | 159 | }, 160 | 161 | /** 162 | * 生命周期函数--监听页面卸载 163 | */ 164 | onUnload: function () { 165 | 166 | }, 167 | 168 | /** 169 | * 页面相关事件处理函数--监听用户下拉动作 170 | */ 171 | onPullDownRefresh: function () { 172 | 173 | }, 174 | 175 | /** 176 | * 页面上拉触底事件的处理函数 177 | */ 178 | onReachBottom: function () { 179 | 180 | }, 181 | 182 | /** 183 | * 用户点击右上角分享 184 | */ 185 | onShareAppMessage: function () { 186 | 187 | } 188 | }) 189 | -------------------------------------------------------------------------------- /pages/details/details.json: -------------------------------------------------------------------------------- 1 | { 2 | "navigationBarTitleText": "详情", 3 | "backgroundTextStyle": "light", 4 | "navigationBarBackgroundColor": "#cb1c36", 5 | "navigationBarTextStyle": "#f2f2f2" 6 | } -------------------------------------------------------------------------------- /pages/details/details.wxml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | {{bookInfo.title}} 10 | {{bookInfo.author}} 11 | 12 | 开始阅读 13 | {{addedShelf ? '已加入书架' : '加入书架'}} 14 | 15 | 16 | 17 | 18 | 19 | 20 | 更新至 21 | {{bookInfo.lastChapter}} 22 | 23 | 24 | 25 | 详情 26 | 评价({{shortReviews.total}}) 27 | 28 | 29 | 30 | 简介: {{bookInfo.longIntro}} 31 | 32 | 33 | 总目录({{bookInfo.chaptersCount}}章) 34 | 35 | 36 | 看过这本书的人还在看 37 | 换一换 38 | 39 | 40 | 41 | 42 | {{item.title}} 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | {{item.author.nickname}} 52 | {{item.content}} 53 | 54 | 55 | 56 | 57 | 58 | -------------------------------------------------------------------------------- /pages/details/details.wxss: -------------------------------------------------------------------------------- 1 | /* pages/details/details.wxss */ 2 | 3 | .details { 4 | display: flex; 5 | flex-direction: column; 6 | align-items: center; 7 | background: #f7f7f7; 8 | } 9 | 10 | .background { 11 | width: 100%; 12 | border-bottom: 1px #eee solid; 13 | } 14 | 15 | .background .top { 16 | background-color: #cb1c36; 17 | width: 100%; 18 | height: 150rpx; 19 | } 20 | 21 | .background .bottom { 22 | background-color: #fff; 23 | width: 100%; 24 | height: 400rpx; 25 | } 26 | 27 | .bookInfo { 28 | display: flex; 29 | justify-content: center; 30 | flex-direction: column; 31 | position: absolute; 32 | top: 10rpx; 33 | } 34 | 35 | .bookInfo image { 36 | width: 250rpx; 37 | height: 350rpx; 38 | margin: 0 auto; 39 | box-shadow: 0 2px 5px 0 #888; 40 | } 41 | 42 | .bookTitle { 43 | color: #11212e; 44 | font-size: 18px; 45 | font-weight: bold; 46 | text-align: center; 47 | display: block; 48 | margin-top: 20rpx; 49 | } 50 | 51 | .bookSite { 52 | color: #999; 53 | font-size: 15px; 54 | text-align: center; 55 | display: block; 56 | margin: 20rpx 0; 57 | } 58 | 59 | .infoBtn { 60 | display: flex; 61 | justify-content: space-around; 62 | } 63 | 64 | .startRead, .addReader { 65 | width: 250rpx; 66 | line-height: 80rpx; 67 | font-size: 15px; 68 | border-radius: 50rpx; 69 | text-align: center; 70 | } 71 | 72 | .startRead { 73 | background-color: #ec304c; 74 | color: #f2f2f2; 75 | margin-right: 35rpx; 76 | } 77 | 78 | .addReader { 79 | background-color: #fff; 80 | color: #666; 81 | margin-left: 35rpx; 82 | box-shadow: 0 0 1px 1px #eee; 83 | } 84 | 85 | .bookMsg { 86 | padding: 65rpx 0 900rpx 0; 87 | position: relative; 88 | } 89 | 90 | .rate { 91 | display: flex; 92 | flex-direction: row; 93 | justify-content: center; 94 | } 95 | 96 | .rate_item { 97 | font-size: 20px; 98 | color: #999; 99 | margin-right: 15rpx; 100 | } 101 | 102 | .rate_active { 103 | color: #ec304c; 104 | } 105 | 106 | .lastChapter { 107 | font-size: 13px; 108 | color: #333; 109 | text-align: center; 110 | width: 100%; 111 | } 112 | 113 | .lastChapter text { 114 | color: #40e0d0; 115 | } 116 | 117 | .info_commit { 118 | position: absolute; 119 | bottom: 75rpx; 120 | left: 50%; 121 | transform: translateX(-50%); 122 | background-color: #fff; 123 | width: 680rpx; 124 | } 125 | 126 | .info_commit .tab { 127 | width: 100%; 128 | display: flex; 129 | justify-content: space-between; 130 | line-height: 80rpx; 131 | border-bottom: 1px #eee solid; 132 | } 133 | 134 | .info_commit .tab_item { 135 | width: 50%; 136 | text-align: center; 137 | font-size: 15px; 138 | color: #666; 139 | } 140 | 141 | .info_commit .tab_item.active { 142 | color: #ec304c; 143 | position: relative; 144 | } 145 | 146 | .info_commit .tab_item.active:after { 147 | content: ""; 148 | display: block; 149 | height: 4rpx; 150 | width: 52rpx; 151 | background: #ec304c; 152 | position: absolute; 153 | bottom: 0; 154 | left: 144rpx; 155 | border-radius: 16rpx; 156 | } 157 | 158 | .commit_content, .info_content { 159 | height: 700rpx; 160 | } 161 | 162 | .info_desc { 163 | font-size: 13px; 164 | color: #333; 165 | line-height: 45rpx; 166 | margin: 20rpx 30rpx; 167 | } 168 | 169 | .openChapter { 170 | display: block; 171 | line-height: 60rpx; 172 | font-size: 13px; 173 | color: #666; 174 | text-align: center; 175 | background: #f7f7f7; 176 | width: 92%; 177 | margin: 0 auto; 178 | } 179 | 180 | .openChapter image { 181 | width: 32rpx; 182 | height: 32rpx; 183 | position: relative; 184 | top: 6rpx; 185 | } 186 | 187 | .Recommend { 188 | margin: 50rpx 30rpx 20rpx 30rpx; 189 | } 190 | 191 | .re_topic { 192 | display: flex; 193 | justify-content: space-between; 194 | flex-direction: row; 195 | } 196 | 197 | .re_title, .re_refresh { 198 | font-size: 15px; 199 | } 200 | 201 | .re_title { 202 | width: 50%; 203 | color: #333; 204 | } 205 | 206 | .re_refresh { 207 | width: 22%; 208 | background: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAEAAAABACAYAAACqaXHeAAAFVklEQVR4Xu1aTXraSBB9JWYmyzgniHOC2CcwLAzZxT5BMMw+9glCThB7PwJ8guBdwIuQEwxzgtgnGNgNjKXK192S3EII1PoB/6Dv8wKrVd3v9euqruomPPOHnjl+bAnYKuCZM7BdAs9cAFsnuF0C2yWwRga4frgHsl6DeE92S9gDaAfMQ/mbaQR2b6l7PVrXsApfAnxSew/CEYAyCLuJgDGPAerBokv665sip6CnMAK4Wf0AplY8aJ6AoWaa6CAWH+MGxC2yB5dFcJA7AdysHoHpSxg4TwD0pNTd/3vUHY4XgeH6u11YThlkCcW8D7fhEcg6y1sRuRLAjVoHhLo28Fuw26L2ddd09rhe3oH1+xHIagF4HXzP3KL24LOpvbj2uRAgZ67kfgVIOTcgNfD5gSoi/jgF4RSgl977IZzpcZySTMjJh4Bm7RzAR6/jKzjTeh6D04F4RAxB9Fb9n0dwZpWs/eRCgBxOs9oF44baAyHZQh5JQumFWE6ef+AR2YP9LJ3lRkCWQZh+K8kGfVBCQJfa/RNTG377R0mAUlytFyiBcUbtvliGxs/jJUA5R+UTxMbJnb1J4w8eLQFSBX++K4P5u+cUL8ke6CE4kRoeNQGB8/X9gUNvqPvtJhFyr5ERAR7jb8nuX5h0UmRbtQfhn2lVkJiAkNwyet68CQmiAvOY2oNXJvYTESDTWIu+g2hHM35Bdv/UpLOi2sr8A/TVU8Ex2QMRIRI9KwmIAe/15Z6k2ecnGplhI25WRQottspGE7OUgDB4kdEFe/H74fHDIIEbVRESD8D8g9qDclL+YgmIgHe4jJL1tzTMLLKxo/sYzJV1VnEWgeNGtQWiT+Id2f2VyvZtLGy4EPxvJVG6UjGXqII7Z4wSDaUq5EZksyRwoyYyxi+ZCVgEXsxuKAp48Va29VWRU3a2SrrcrMmscz4ULxqfbotPDg+oc/1j3n5EAdyo/byv5nDgUfUOdIlx47AOsjqe4SHZ/coqEGnfhwhn/qxnniECiCp65Ugr1EQcZJQAmdtzHcynuodfJjEO6gE8IXugh8q0WGO/40Z1FNQENAccp4BQlWqONKmkpCMMdzB9NZ94yPd3uDHdiibt328XKYw47r5cotpewFdouETHC3OFdATMScwURNb2ainoDtjah+XW9SiQBLyZAvQ99wOI/SEShANmTPx9AEDCj/mZ4RXZfVFlXvgkVoAM/yl3W1lnPO77OQccbcb8D9xZeVmdwJAAvwqTvRaXFymxJCQAb7QEpAL0kJci984L9LydUI1QDnT1zPs2zBSgqrL/yo8XhJSiACaxq6XEK2Wv2zMiQPkBbxlkqMMlAZSmjQjFpkdn5gTodbgHpoI0pBkToHyBl3qKH95GJE3nD+GbdASos8CRqg/kc0S1KTJSEeCpIMi/s57ObAq8cRhcGn7WVCgVuUCaA5A4klMrQKpAP51RPeR2bL1owN72tyPuEmU5D8wUBiMqiJAgfIJ1nHdWqG6eoBNUpnPKRzIpwCcjemytTm3hTs+yylVdm+FPoZsnGQ5D5ycwFwICIrS6nLdbFHeBzuHylWnRVJXmrI/hKzc8gcNlU1vLnGyuBCi/IGbM7UZufonbXuAeWOTx7hhcuvWXibo/iJewaBdMZYBFxVmrLMkbZedwZ+dZFVWoAnTjXgVJnBzN3fYyDnoXcKatvIH7o8hdAVEnKdfwkTer8fcB7z+8BeTN0R6c2bAo4GsjIErI4R7EGYPr7AIk/sawSF2YvPtvVDTgtS0BY6Fv6IPCl8CGcCXudktAYqqeaMOtAp7oxCaGtVVAYqqeaMOtAp7oxCaG9QvrvMZfXd+MCQAAAABJRU5ErkJggg==") no-repeat left center; 209 | background-size: 45rpx 45rpx; 210 | color: #ff6347; 211 | text-align: right; 212 | } 213 | 214 | .re_books { 215 | display: flex; 216 | flex-direction: row; 217 | justify-content: space-between; 218 | margin-top: 20rpx; 219 | } 220 | 221 | .re_bookItem { 222 | flex-direction: column; 223 | width: 33.3%; 224 | } 225 | 226 | .re_bookItem image { 227 | width: 190rpx; 228 | height: 275rpx; 229 | } 230 | 231 | .re_bookTitle { 232 | color: #333; 233 | font-size: 12px; 234 | text-align: center; 235 | } 236 | 237 | .review_item { 238 | position: relative; 239 | margin: 30rpx 20rpx; 240 | } 241 | 242 | .review_item image { 243 | width: 100rpx; 244 | height: 100rpx; 245 | border-radius: 50%; 246 | vertical-align: top; 247 | } 248 | 249 | .review_info { 250 | display: inline-block; 251 | width: 79%; 252 | margin-left: 30rpx; 253 | } 254 | 255 | .review_site { 256 | color: #ff6347; 257 | font-size: 14px; 258 | line-height: 50rpx; 259 | } 260 | 261 | .review_content { 262 | color: #666; 263 | font-size: 12px; 264 | line-height: 40rpx; 265 | } -------------------------------------------------------------------------------- /pages/help/help.js: -------------------------------------------------------------------------------- 1 | // pages/help/help.js 2 | Page({ 3 | /** 4 | * 页面的初始数据 5 | */ 6 | data: { 7 | helpList: [{ 8 | title: '此小程序能阅读哪些书籍?', 9 | content: '目前轻读书屋可以阅读几乎全网的书籍,如果遇到“小轻还没有给主人搬到此书,去看看别的吧”这样的提示,这说明此书籍无法阅读,欢迎阅读其它书籍或者去正版网站购买阅读。' 10 | }, 11 | { 12 | title: '进入阅读模式如何调出菜单?', 13 | content: '进入阅读模式中,点击屏幕中央可以呼出菜单,目前小轻提供了夜间转换、护眼转换、目录查看和字体设置,后期还会加入新功能。' 14 | }, 15 | { 16 | title: '以后会收费吗', 17 | content: '小轻承诺永远不会向主人索要小费,希望主人永远支持小轻,小轻也会竭尽全力给主人提供更好的服务。' 18 | }, 19 | { 20 | title: '免责声明', 21 | content: '您在使用轻读书屋之前请无比仔细阅读并理解本声明,您可以选择不使用本小程序,但如果您使用本小程序,您的使用将被视为对本声明内容的全部认可。轻读书屋是一款提供网络小说即使更新阅读的小程序,为广大小说爱好者提供一种方便快捷舒适的试读体验。致力于最大程度的减少读者在自行搜索过程中的毫无意义的时间浪费,通过专业的搜索展示不同网站中的网络小说新章节。当您点击搜索一本书时,本小程序将会对该书名以关键词的形式提交到第三方网站或者搜索引擎(百度谷歌等)第三方网站反馈内容与本小程序无关以不承担任何法律责任。第三方搜索引擎结果根据您提交的关键词自动搜索并获得阅读,并不代表我们赞成赞成第三方网站的内容,您应该对使用搜索引擎的搜索结果自行承担风险。我们不做任何形式的保证。我们建议阅读正版,任何单位或者个人认为通过本小程序搜索连接到的第三方网页内容可能涉嫌侵犯其网络传播权,应该及时向我们提供书面通知,我们收到法律文件后尽快断开相关连接内容。' 22 | }] 23 | }, 24 | }) -------------------------------------------------------------------------------- /pages/help/help.json: -------------------------------------------------------------------------------- 1 | { 2 | "navigationBarTitleText": "帮助", 3 | "backgroundTextStyle": "light", 4 | "navigationBarBackgroundColor": "#cb1c36", 5 | "navigationBarTextStyle": "#f2f2f2" 6 | } -------------------------------------------------------------------------------- /pages/help/help.wxml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 常见问题与声明 4 | 5 | {{item.title}} 6 | {{item.content}} 7 | 8 | 9 | -------------------------------------------------------------------------------- /pages/help/help.wxss: -------------------------------------------------------------------------------- 1 | /* pages/help/help.wxss */ 2 | .help_title { 3 | font-size: 20px; 4 | height: 60rpx; 5 | line-height: 60rpx; 6 | width: 100%; 7 | text-indent: 30rpx; 8 | color: #333; 9 | font-weight: bold; 10 | } 11 | .help_item { 12 | width: 92%; 13 | } 14 | 15 | .help_item .item_title { 16 | margin-left: 30rpx; 17 | font-size: 16px; 18 | width: 100%; 19 | color: #333; 20 | border-bottom: 1px #f7f7f7 solid; 21 | line-height: 80rpx; 22 | height: 80rpx; 23 | } 24 | 25 | .help_item .item_content { 26 | width: 100%; 27 | margin-left: 30rpx; 28 | font-size: 14px; 29 | line-height: 55rpx; 30 | color: #666; 31 | text-indent: 57rpx; 32 | border-bottom: 1px #f7f7f7 solid; 33 | } -------------------------------------------------------------------------------- /pages/rank/rank.js: -------------------------------------------------------------------------------- 1 | // pages/rank/rank.js 2 | const api = require('../../utils/api.js'); 3 | Page({ 4 | 5 | /** 6 | * 页面的初始数据 7 | */ 8 | data: { 9 | STATIC_HOST: '', 10 | winHeight: "",//窗口高度 11 | currentTab: 0, //预设当前项的值 12 | weekRank: [], 13 | monthRank: [], 14 | totalRank: [] 15 | }, 16 | 17 | // 滚动切换标签样式 18 | switchTab: function (e) { 19 | this.setData({ 20 | currentTab: e.detail.current 21 | }); 22 | }, 23 | // 点击标题切换当前页时改变样式 24 | swichNav: function (e) { 25 | var cur = e.target.dataset.current; 26 | if (this.data.currentTaB == cur) { return false; } 27 | else { 28 | this.setData({ 29 | currentTab: cur 30 | }) 31 | } 32 | }, 33 | 34 | getRankList: function (ids) { 35 | for (let i = 0; i < ids.length; i++) { 36 | if (i == 0 && ids[i] !== 'undefined') { 37 | wx.request({ 38 | url: api.rank.rankInfo(ids[i]), 39 | success: res => { 40 | wx.setNavigationBarTitle({ 41 | title: res.data.ranking.title, 42 | }); 43 | this.setData({ 44 | weekRank: res.data.ranking.books 45 | }); 46 | wx.hideLoading(); 47 | } 48 | }) 49 | } 50 | if (i == 1 && ids[i] !== 'undefined') { 51 | wx.request({ 52 | url: api.rank.rankInfo(ids[i]), 53 | success: res => { 54 | this.setData({ 55 | monthRank: res.data.ranking.books 56 | }); 57 | } 58 | }) 59 | } 60 | if (i == 2 && ids[i] !== 'undefined') { 61 | wx.request({ 62 | url: api.rank.rankInfo(ids[i]), 63 | success: res => { 64 | this.setData({ 65 | totalRank: res.data.ranking.books 66 | }); 67 | } 68 | }) 69 | } 70 | } 71 | }, 72 | 73 | /** 74 | * 生命周期函数--监听页面加载 75 | */ 76 | onLoad: function (options) { 77 | this.setData({ 78 | STATIC_HOST: api.STATIC_HOST 79 | }); 80 | wx.showLoading({ 81 | title: '加载中', 82 | mask: true 83 | }) 84 | let ids = options.id.split('|'); 85 | this.getRankList(ids); 86 | // 高度自适应 87 | wx.getSystemInfo({ 88 | success: (res) => { 89 | var clientHeight = res.windowHeight, 90 | clientWidth = res.windowWidth, 91 | rpxR = 750 / clientWidth; 92 | var calc = clientHeight * rpxR; 93 | this.setData({ 94 | winHeight: calc 95 | }); 96 | } 97 | }); 98 | }, 99 | 100 | /** 101 | * 生命周期函数--监听页面初次渲染完成 102 | */ 103 | onReady: function () { 104 | 105 | }, 106 | 107 | /** 108 | * 生命周期函数--监听页面显示 109 | */ 110 | onShow: function () { 111 | 112 | }, 113 | 114 | /** 115 | * 生命周期函数--监听页面隐藏 116 | */ 117 | onHide: function () { 118 | 119 | }, 120 | 121 | /** 122 | * 生命周期函数--监听页面卸载 123 | */ 124 | onUnload: function () { 125 | 126 | }, 127 | 128 | /** 129 | * 页面相关事件处理函数--监听用户下拉动作 130 | */ 131 | onPullDownRefresh: function () { 132 | 133 | }, 134 | 135 | /** 136 | * 页面上拉触底事件的处理函数 137 | */ 138 | onReachBottom: function () { 139 | 140 | }, 141 | 142 | /** 143 | * 用户点击右上角分享 144 | */ 145 | onShareAppMessage: function () { 146 | 147 | } 148 | }) -------------------------------------------------------------------------------- /pages/rank/rank.json: -------------------------------------------------------------------------------- 1 | { 2 | "navigationBarTitleText": "书城" 3 | } -------------------------------------------------------------------------------- /pages/rank/rank.wxml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 周榜 6 | 月榜 7 | 总榜 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | {{book.title}} 16 | {{book.author}} 17 | {{book.shortIntro}} 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | {{book.title}} 30 | {{book.author}} 31 | {{book.shortIntro}} 32 | 33 | 34 | 35 | 36 | -------------------------------------------------------------------------------- /pages/rank/rank.wxss: -------------------------------------------------------------------------------- 1 | /* pages/rank/rank.wxss */ 2 | 3 | .tab-h { 4 | height: 80rpx; 5 | width: 100%; 6 | box-sizing: border-box; 7 | overflow: hidden; 8 | line-height: 80rpx; 9 | background: #f7f7f7; 10 | font-size: 16px; 11 | white-space: nowrap; 12 | position: fixed; 13 | top: 0; 14 | left: 0; 15 | z-index: 99; 16 | } 17 | 18 | .tab-item { 19 | display: inline-block; 20 | width: 33.3%; 21 | text-align: center; 22 | } 23 | 24 | .tab-item.active { 25 | color: #ec304c; 26 | position: relative; 27 | } 28 | 29 | .tab-item.active:after { 30 | content: ""; 31 | display: block; 32 | height: 4rpx; 33 | width: 52rpx; 34 | background: #ec304c; 35 | position: absolute; 36 | bottom: 0; 37 | left: 98rpx; 38 | border-radius: 16rpx; 39 | } 40 | 41 | .tab-content { 42 | margin-top: 80rpx; 43 | } 44 | 45 | .scroll-h { 46 | height: 100%; 47 | width: 92%; 48 | margin: 0 4%; 49 | } 50 | 51 | .book_item { 52 | border-bottom: 1px #eee solid; 53 | position: relative; 54 | height: 335rpx; 55 | } 56 | 57 | .book_item image { 58 | width: 190rpx; 59 | height: 275rpx; 60 | position: absolute; 61 | left: 0; 62 | top: 30rpx; 63 | } 64 | 65 | .book_info { 66 | position: absolute; 67 | right: 0; 68 | top: 30rpx; 69 | width: 475rpx; 70 | } 71 | 72 | .book_title { 73 | color: #333; 74 | font-size: 15px; 75 | font-weight: bold; 76 | display: block; 77 | margin-bottom: 10rpx; 78 | } 79 | 80 | .book_site, .book_desc { 81 | color: #999; 82 | font-size: 12px; 83 | line-height: 40rpx; 84 | display: block; 85 | margin-bottom: 10rpx; 86 | } 87 | 88 | .book_desc { 89 | overflow: hidden; 90 | text-overflow: ellipsis; 91 | display: -webkit-box; 92 | -webkit-line-clamp: 3; 93 | -webkit-box-orient: vertical; 94 | } 95 | -------------------------------------------------------------------------------- /pages/reader/reader.js: -------------------------------------------------------------------------------- 1 | // pages/reader/reader.js 2 | const api = require('../../utils/api.js') 3 | const WxParse = require('../wxParse/wxParse.js'); 4 | Page({ 5 | /** 6 | * 页面的初始数据 7 | */ 8 | data: { 9 | showPage: false,//请求到数据显示界面 10 | clientWidth: "", 11 | clientHeight: "", 12 | winHeight: "",//窗口高度 13 | book_id: '', 14 | scrollTop: 0, 15 | bookSources: [], 16 | bookChapters: {}, 17 | indexPage: 0, //当前章节 18 | indexChapterContent: {}, //当前阅读的内容 19 | readerCss: { 20 | titleSize: 20, 21 | contentSize: 16, 22 | color: '#333', //夜间 #424952 23 | lineHeight: 60, 24 | backgroundColor: '#fff' //#C7EDCC 护眼色 #080C10 黑夜 25 | }, 26 | showMenu: false, 27 | showChapter: false, 28 | isDark: false, 29 | isHuyan: false 30 | }, 31 | 32 | toggleDark: function () { 33 | this.setData({ 34 | isDark: !this.data.isDark 35 | }); 36 | if (this.data.isDark) { 37 | wx.setNavigationBarColor({ 38 | frontColor: '#ffffff', 39 | backgroundColor: '#080C10' 40 | }); 41 | this.data.readerCss.color = '#696969'; 42 | this.data.readerCss.backgroundColor = '#080C10'; 43 | this.setData({ 44 | isHuyan: false, 45 | readerCss: this.data.readerCss 46 | }); 47 | } else { 48 | wx.setNavigationBarColor({ 49 | frontColor: '#ffffff', 50 | backgroundColor: '#cb1c36' 51 | }); 52 | this.data.readerCss.color = '#333'; 53 | this.data.readerCss.backgroundColor = '#fff'; 54 | this.setData({ 55 | isHuyan: false, 56 | readerCss: this.data.readerCss 57 | }); 58 | } 59 | }, 60 | 61 | toggleHuyan: function () { 62 | this.setData({ 63 | isHuyan: !this.data.isHuyan 64 | }); 65 | if (this.data.isHuyan) { 66 | wx.setNavigationBarColor({ 67 | frontColor: '#ffffff', 68 | backgroundColor: '#000000' 69 | }); 70 | this.data.readerCss.color = '#333'; 71 | this.data.readerCss.backgroundColor = '#C7EDCC'; 72 | this.setData({ 73 | isDark: false, 74 | readerCss: this.data.readerCss 75 | }); 76 | } else { 77 | wx.setNavigationBarColor({ 78 | frontColor: '#ffffff', 79 | backgroundColor: '#cb1c36' 80 | }); 81 | this.data.readerCss.color = '#333'; 82 | this.data.readerCss.backgroundColor = '#fff'; 83 | this.setData({ 84 | isDark: false, 85 | readerCss: this.data.readerCss 86 | }); 87 | } 88 | }, 89 | 90 | incSize: function () { 91 | if (this.data.readerCss.titleSize === 30) { 92 | return 93 | } 94 | this.data.readerCss.titleSize = this.data.readerCss.titleSize + 5; 95 | this.data.readerCss.lineHeight = this.data.readerCss.lineHeight + 10; 96 | this.data.readerCss.contentSize = this.data.readerCss.contentSize + 5; 97 | this.setData({ 98 | readerCss: this.data.readerCss 99 | }); 100 | }, 101 | 102 | decSize: function () { 103 | if (this.data.readerCss.titleSize === 20) { 104 | return 105 | } 106 | this.data.readerCss.titleSize = this.data.readerCss.titleSize - 5; 107 | this.data.readerCss.contentSize = this.data.readerCss.contentSize - 5; 108 | this.data.readerCss.lineHeight = this.data.readerCss.lineHeight - 10; 109 | this.setData({ 110 | readerCss: this.data.readerCss 111 | }); 112 | }, 113 | 114 | getBookSources: function (book_id) { 115 | wx.request({ 116 | url: api.book.bookSources(book_id), 117 | success: res => { 118 | this.setData({ 119 | bookSources: res.data 120 | }); 121 | this.getBookChapters(this.data.bookSources[1] ? this.data.bookSources[1]._id : this.data.bookSources[0]._id); 122 | } 123 | }) 124 | }, 125 | 126 | getBookChapters: function (source_id) { 127 | wx.request({ 128 | url: api.book.bookChapters(source_id), 129 | success: res => { 130 | this.setData({ 131 | bookChapters: res.data 132 | }); 133 | this.getChapterContent(this.data.bookChapters.chapters[this.data.indexPage].link); 134 | } 135 | }) 136 | }, 137 | 138 | getChapterContent: function (link) { 139 | wx.showLoading({ 140 | title: '加载中', 141 | mask: true 142 | }) 143 | wx.request({ 144 | url: api.book.chapterContent(link), 145 | success: res => { 146 | wx.hideLoading(); 147 | if (res.data.chapter.cpContent) { 148 | let bodyArray = res.data.chapter.cpContent.split(/\n/).map((item) => { //给每个段落加开头空格 ,方案改为修改wxParse.wxss 149 | return item 150 | }); 151 | res.data.chapter.cpContent = bodyArray.join('
'); 152 | } 153 | let bodyArray = res.data.chapter.body.split(/\n/).map((item) => { 154 | return item 155 | }); 156 | res.data.chapter.body = bodyArray.join('
'); 157 | this.setData({ 158 | showPage: true, 159 | showChapter: false, //关闭目录 160 | indexChapterContent: res.data 161 | }); 162 | //存储当前读到哪一章 163 | wx.getStorage({ 164 | key: 'bookShelfData', 165 | success: res => { 166 | let data = res.data; 167 | for (let i = 0; i < data.length; i++) { 168 | if (this.data.book_id === data[i].bookInfo.id) { 169 | data[i].readNum = this.data.indexPage + 1; 170 | data[i].laterScrollTop = this.data.scrollTop 171 | wx.setStorage({ 172 | key: 'bookShelfData', 173 | data: data, 174 | }) 175 | } 176 | } 177 | }, 178 | }); 179 | //使用Wxparse格式化小说内容 对收费的显示文字 后期换接口处理 180 | WxParse.wxParse('article', 'html', this.data.indexChapterContent.chapter.cpContent ? '小轻还没有给主人搬到此书,去看看别的吧' : this.data.indexChapterContent.chapter.body, this); 181 | //等到渲染页面后调节scrollTop 182 | this.setData({ 183 | scrollTop: this.data.scrollTop 184 | }) 185 | } 186 | }) 187 | }, 188 | 189 | goPrev: function () { 190 | if (this.data.indexPage === 0) { 191 | wx.showToast({ 192 | title: '已到第一章', 193 | icon: 'loading', 194 | mask: true 195 | }); 196 | } 197 | this.setData({ 198 | indexPage: this.data.indexPage - 1, 199 | scrollTop: 0 200 | }); 201 | if (this.data.bookChapters.chapters[this.data.indexPage]) { 202 | this.getChapterContent(this.data.bookChapters.chapters[this.data.indexPage].link); 203 | } 204 | }, 205 | 206 | goNext: function () { 207 | if (this.data.indexPage === this.data.bookChapters.chapters.length - 1) { //当前在最后一章 208 | wx.showToast({ 209 | title: '已到最新章节', 210 | icon: 'loading', 211 | mask: true 212 | }); 213 | return; 214 | } 215 | this.setData({ 216 | indexPage: this.data.indexPage + 1, 217 | scrollTop: 0 218 | }); 219 | if (this.data.bookChapters.chapters[this.data.indexPage]) { 220 | this.getChapterContent(this.data.bookChapters.chapters[this.data.indexPage].link); 221 | } 222 | }, 223 | //点击中央打开菜单 224 | openMenu: function (event) { 225 | let xMid = this.data.clientWidth / 2; 226 | let yMid = this.data.clientHeight / 2; 227 | let x = event.detail.x; 228 | let y = event.detail.y; 229 | if ((x > xMid - 100 && x < xMid + 100) && (y < yMid + 100 && y > yMid - 100)) { 230 | this.setData({ 231 | showMenu: !this.data.showMenu 232 | }); 233 | } 234 | }, 235 | 236 | getScrollTop: function (event) { //设置读取到文章的具体什么位置 237 | 238 | // this.setData({ 239 | // scrollTop: event.detail.scrollTop 240 | // }); 241 | //存储读到章节的什么位置 242 | wx.getStorage({ 243 | key: 'bookShelfData', 244 | success: res => { 245 | let data = res.data; 246 | for (let i = 0; i < data.length; i++) { 247 | if (this.data.book_id === data[i].bookInfo.id) { 248 | data[i].laterScrollTop = event.detail.scrollTop; 249 | wx.setStorage({ 250 | key: 'bookShelfData', 251 | data: data, 252 | }) 253 | } 254 | } 255 | }, 256 | }); 257 | }, 258 | 259 | showChapter: function () { 260 | this.setData({ 261 | showChapter: !this.data.showChapter 262 | }); 263 | }, 264 | 265 | pickChapter: function (event) { 266 | this.setData({ 267 | indexPage: event.target.dataset.indexpage, 268 | scrollTop: 0 269 | }); 270 | this.getChapterContent(event.target.dataset.link); 271 | }, 272 | 273 | /** 274 | * 生命周期函数--监听页面加载 275 | */ 276 | onLoad: function (options) { 277 | this.setData({ 278 | book_id: options.book_id 279 | }); 280 | 281 | let bookShelfData = wx.getStorageSync('bookShelfData'); //利用缓存实现阅读记录和书架 282 | if (bookShelfData.length !== 0) { 283 | for (let i = 0; i < bookShelfData.length; i++) { 284 | if (bookShelfData[i].bookInfo.id === options.book_id) { 285 | this.setData({ //上次读到哪 286 | indexPage: bookShelfData[i].readNum - 1, 287 | scrollTop: bookShelfData[i].laterScrollTop 288 | }); 289 | break; 290 | } 291 | } 292 | } 293 | 294 | wx.setNavigationBarTitle({ //设置标题 295 | title: options.book_title, 296 | }); 297 | 298 | wx.getSystemInfo({ 299 | success: (res) => { 300 | var clientHeight = res.windowHeight, 301 | clientWidth = res.windowWidth, 302 | rpxR = 750 / clientWidth; 303 | var calc = clientHeight * rpxR; 304 | this.setData({ 305 | clientHeight: clientHeight, 306 | clientWidth: clientWidth, 307 | winHeight: calc 308 | }); 309 | } 310 | }); 311 | wx.getStorage({ 312 | key: 'isAlerted', 313 | success: (res) => { 314 | let data = res.data; 315 | if (!data) { 316 | wx.showModal({ 317 | title: '提示', 318 | content: '点击呼出菜单', 319 | success: (res) => { 320 | if (res.confirm) { 321 | wx.setStorage({ 322 | key: 'isAlerted', 323 | value: true 324 | }); 325 | } 326 | } 327 | }); 328 | } 329 | } 330 | }); 331 | 332 | setTimeout(() => { 333 | wx.hideLoading(); 334 | this.getBookSources(options.book_id); 335 | }, 2000); 336 | } 337 | }); 338 | -------------------------------------------------------------------------------- /pages/reader/reader.json: -------------------------------------------------------------------------------- 1 | { 2 | "navigationBarTitleText": "闲暇阅读", 3 | "backgroundTextStyle": "light", 4 | "navigationBarBackgroundColor": "#cb1c36", 5 | "navigationBarTextStyle": "#f2f2f2" 6 | } -------------------------------------------------------------------------------- /pages/reader/reader.wxml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | {{bookChapters.chapters[indexPage].title}} 8 | 9 | 10 |