├── .gitignore
├── App.vue
├── LICENSE
├── README.md
├── change.md
├── components
├── header.vue
├── imt-audio.vue
├── listBook.vue
├── loading.vue
├── menu.vue
├── menuTree.vue
├── scrollBook.vue
├── search.vue
└── tab.vue
├── config.example.js
├── main.js
├── manifest.json
├── pages.json
├── pages
├── bind
│ └── bind.vue
├── bookmarks
│ └── bookmarks.vue
├── bookshelf
│ └── bookshelf.vue
├── cate
│ └── cate.vue
├── comment
│ └── comment.vue
├── history
│ └── history.vue
├── index
│ └── index.vue
├── intro
│ └── intro.vue
├── list
│ └── list.vue
├── login
│ └── login.vue
├── me
│ └── me.vue
├── menu
│ └── menu.vue
├── notfound
│ └── notfound.vue
├── rank
│ └── rank.vue
├── read
│ └── read.vue
├── reg
│ └── reg.vue
├── search
│ └── search.vue
└── ucenter
│ └── ucenter.vue
├── static
├── css
│ ├── bookchat.css
│ ├── markdown.css
│ └── reg-login.css
└── images
│ ├── 404.png
│ ├── about-us.png
│ ├── bg-poster.jpg
│ ├── book.png
│ ├── bookmark-add.png
│ ├── bookmark-added.png
│ ├── bookmark.png
│ ├── cate-default.png
│ ├── cate-selected.png
│ ├── cate.png
│ ├── checked.png
│ ├── clear.png
│ ├── clock.png
│ ├── collect-selected.png
│ ├── collect.png
│ ├── comment.png
│ ├── document.png
│ ├── download.png
│ ├── error.png
│ ├── eye.png
│ ├── fans.png
│ ├── follow.png
│ ├── font-minus.png
│ ├── font-plus.png
│ ├── font.png
│ ├── header-back.png
│ ├── header-home.png
│ ├── history.png
│ ├── home-black.png
│ ├── home-selected.png
│ ├── home.png
│ ├── loading-white.png
│ ├── loading.gif
│ ├── loading.png
│ ├── login.png
│ ├── logo.png
│ ├── me-selected.png
│ ├── me.png
│ ├── menu.png
│ ├── more.png
│ ├── next-disable.png
│ ├── next.png
│ ├── pre-disable.png
│ ├── pre.png
│ ├── rank.png
│ ├── read-white.png
│ ├── read.png
│ ├── readed.png
│ ├── recycle.png
│ ├── refresh-o.png
│ ├── reg.png
│ ├── report.png
│ ├── right-angle.png
│ ├── search-black.png
│ ├── search.png
│ ├── share.png
│ ├── sign.png
│ ├── signed.png
│ ├── sprite_star.png
│ ├── star-half.png
│ ├── star-highlight.png
│ ├── star-selected.png
│ ├── star.png
│ └── wxcode-black.png
├── unpackage
├── images
│ ├── alipay.jpg
│ ├── book-intro-2.png
│ ├── book-intro.png
│ ├── bookshelf.png
│ ├── category.png
│ ├── index.png
│ ├── iphone
│ │ ├── bookshelf.png
│ │ ├── category.png
│ │ ├── index.png
│ │ ├── intro.png
│ │ ├── loading.png
│ │ ├── me.png
│ │ ├── read.png
│ │ └── search.png
│ ├── login.png
│ ├── me.png
│ ├── read-menu.png
│ ├── read-setting.png
│ ├── read.png
│ ├── search-book-2.png
│ ├── search-book.png
│ └── wxpay.jpg
└── res
│ └── icons
│ ├── 1024x1024.png
│ ├── 120x120.png
│ ├── 144x144.png
│ ├── 152x152.png
│ ├── 167x167.png
│ ├── 180x180.png
│ ├── 192x192.png
│ ├── 20x20.png
│ ├── 29x29.png
│ ├── 40x40.png
│ ├── 58x58.png
│ ├── 60x60.png
│ ├── 72x72.png
│ ├── 76x76.png
│ ├── 80x80.png
│ ├── 87x87.png
│ └── 96x96.png
└── utils
├── api.js
└── util.js
/.gitignore:
--------------------------------------------------------------------------------
1 | unpackage/dist/*
2 | unpackage/resources/*
3 | unpackage/.DS_Store
4 | unpackage/release/*
5 | .DS_Store
6 | */.DS_Store
7 | config.js
8 | .idea
9 | .hbuilderx
--------------------------------------------------------------------------------
/App.vue:
--------------------------------------------------------------------------------
1 |
90 |
91 |
95 |
--------------------------------------------------------------------------------
/LICENSE:
--------------------------------------------------------------------------------
1 | Apache License
2 | Version 2.0, January 2004
3 | http://www.apache.org/licenses/
4 |
5 | TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
6 |
7 | 1. Definitions.
8 |
9 | "License" shall mean the terms and conditions for use, reproduction,
10 | and distribution as defined by Sections 1 through 9 of this document.
11 |
12 | "Licensor" shall mean the copyright owner or entity authorized by
13 | the copyright owner that is granting the License.
14 |
15 | "Legal Entity" shall mean the union of the acting entity and all
16 | other entities that control, are controlled by, or are under common
17 | control with that entity. For the purposes of this definition,
18 | "control" means (i) the power, direct or indirect, to cause the
19 | direction or management of such entity, whether by contract or
20 | otherwise, or (ii) ownership of fifty percent (50%) or more of the
21 | outstanding shares, or (iii) beneficial ownership of such entity.
22 |
23 | "You" (or "Your") shall mean an individual or Legal Entity
24 | exercising permissions granted by this License.
25 |
26 | "Source" form shall mean the preferred form for making modifications,
27 | including but not limited to software source code, documentation
28 | source, and configuration files.
29 |
30 | "Object" form shall mean any form resulting from mechanical
31 | transformation or translation of a Source form, including but
32 | not limited to compiled object code, generated documentation,
33 | and conversions to other media types.
34 |
35 | "Work" shall mean the work of authorship, whether in Source or
36 | Object form, made available under the License, as indicated by a
37 | copyright notice that is included in or attached to the work
38 | (an example is provided in the Appendix below).
39 |
40 | "Derivative Works" shall mean any work, whether in Source or Object
41 | form, that is based on (or derived from) the Work and for which the
42 | editorial revisions, annotations, elaborations, or other modifications
43 | represent, as a whole, an original work of authorship. For the purposes
44 | of this License, Derivative Works shall not include works that remain
45 | separable from, or merely link (or bind by name) to the interfaces of,
46 | the Work and Derivative Works thereof.
47 |
48 | "Contribution" shall mean any work of authorship, including
49 | the original version of the Work and any modifications or additions
50 | to that Work or Derivative Works thereof, that is intentionally
51 | submitted to Licensor for inclusion in the Work by the copyright owner
52 | or by an individual or Legal Entity authorized to submit on behalf of
53 | the copyright owner. For the purposes of this definition, "submitted"
54 | means any form of electronic, verbal, or written communication sent
55 | to the Licensor or its representatives, including but not limited to
56 | communication on electronic mailing lists, source code control systems,
57 | and issue tracking systems that are managed by, or on behalf of, the
58 | Licensor for the purpose of discussing and improving the Work, but
59 | excluding communication that is conspicuously marked or otherwise
60 | designated in writing by the copyright owner as "Not a Contribution."
61 |
62 | "Contributor" shall mean Licensor and any individual or Legal Entity
63 | on behalf of whom a Contribution has been received by Licensor and
64 | subsequently incorporated within the Work.
65 |
66 | 2. Grant of Copyright License. Subject to the terms and conditions of
67 | this License, each Contributor hereby grants to You a perpetual,
68 | worldwide, non-exclusive, no-charge, royalty-free, irrevocable
69 | copyright license to reproduce, prepare Derivative Works of,
70 | publicly display, publicly perform, sublicense, and distribute the
71 | Work and such Derivative Works in Source or Object form.
72 |
73 | 3. Grant of Patent License. Subject to the terms and conditions of
74 | this License, each Contributor hereby grants to You a perpetual,
75 | worldwide, non-exclusive, no-charge, royalty-free, irrevocable
76 | (except as stated in this section) patent license to make, have made,
77 | use, offer to sell, sell, import, and otherwise transfer the Work,
78 | where such license applies only to those patent claims licensable
79 | by such Contributor that are necessarily infringed by their
80 | Contribution(s) alone or by combination of their Contribution(s)
81 | with the Work to which such Contribution(s) was submitted. If You
82 | institute patent litigation against any entity (including a
83 | cross-claim or counterclaim in a lawsuit) alleging that the Work
84 | or a Contribution incorporated within the Work constitutes direct
85 | or contributory patent infringement, then any patent licenses
86 | granted to You under this License for that Work shall terminate
87 | as of the date such litigation is filed.
88 |
89 | 4. Redistribution. You may reproduce and distribute copies of the
90 | Work or Derivative Works thereof in any medium, with or without
91 | modifications, and in Source or Object form, provided that You
92 | meet the following conditions:
93 |
94 | (a) You must give any other recipients of the Work or
95 | Derivative Works a copy of this License; and
96 |
97 | (b) You must cause any modified files to carry prominent notices
98 | stating that You changed the files; and
99 |
100 | (c) You must retain, in the Source form of any Derivative Works
101 | that You distribute, all copyright, patent, trademark, and
102 | attribution notices from the Source form of the Work,
103 | excluding those notices that do not pertain to any part of
104 | the Derivative Works; and
105 |
106 | (d) If the Work includes a "NOTICE" text file as part of its
107 | distribution, then any Derivative Works that You distribute must
108 | include a readable copy of the attribution notices contained
109 | within such NOTICE file, excluding those notices that do not
110 | pertain to any part of the Derivative Works, in at least one
111 | of the following places: within a NOTICE text file distributed
112 | as part of the Derivative Works; within the Source form or
113 | documentation, if provided along with the Derivative Works; or,
114 | within a display generated by the Derivative Works, if and
115 | wherever such third-party notices normally appear. The contents
116 | of the NOTICE file are for informational purposes only and
117 | do not modify the License. You may add Your own attribution
118 | notices within Derivative Works that You distribute, alongside
119 | or as an addendum to the NOTICE text from the Work, provided
120 | that such additional attribution notices cannot be construed
121 | as modifying the License.
122 |
123 | You may add Your own copyright statement to Your modifications and
124 | may provide additional or different license terms and conditions
125 | for use, reproduction, or distribution of Your modifications, or
126 | for any such Derivative Works as a whole, provided Your use,
127 | reproduction, and distribution of the Work otherwise complies with
128 | the conditions stated in this License.
129 |
130 | 5. Submission of Contributions. Unless You explicitly state otherwise,
131 | any Contribution intentionally submitted for inclusion in the Work
132 | by You to the Licensor shall be under the terms and conditions of
133 | this License, without any additional terms or conditions.
134 | Notwithstanding the above, nothing herein shall supersede or modify
135 | the terms of any separate license agreement you may have executed
136 | with Licensor regarding such Contributions.
137 |
138 | 6. Trademarks. This License does not grant permission to use the trade
139 | names, trademarks, service marks, or product names of the Licensor,
140 | except as required for reasonable and customary use in describing the
141 | origin of the Work and reproducing the content of the NOTICE file.
142 |
143 | 7. Disclaimer of Warranty. Unless required by applicable law or
144 | agreed to in writing, Licensor provides the Work (and each
145 | Contributor provides its Contributions) on an "AS IS" BASIS,
146 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
147 | implied, including, without limitation, any warranties or conditions
148 | of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
149 | PARTICULAR PURPOSE. You are solely responsible for determining the
150 | appropriateness of using or redistributing the Work and assume any
151 | risks associated with Your exercise of permissions under this License.
152 |
153 | 8. Limitation of Liability. In no event and under no legal theory,
154 | whether in tort (including negligence), contract, or otherwise,
155 | unless required by applicable law (such as deliberate and grossly
156 | negligent acts) or agreed to in writing, shall any Contributor be
157 | liable to You for damages, including any direct, indirect, special,
158 | incidental, or consequential damages of any character arising as a
159 | result of this License or out of the use or inability to use the
160 | Work (including but not limited to damages for loss of goodwill,
161 | work stoppage, computer failure or malfunction, or any and all
162 | other commercial damages or losses), even if such Contributor
163 | has been advised of the possibility of such damages.
164 |
165 | 9. Accepting Warranty or Additional Liability. While redistributing
166 | the Work or Derivative Works thereof, You may choose to offer,
167 | and charge a fee for, acceptance of support, warranty, indemnity,
168 | or other liability obligations and/or rights consistent with this
169 | License. However, in accepting such obligations, You may act only
170 | on Your own behalf and on Your sole responsibility, not on behalf
171 | of any other Contributor, and only if You agree to indemnify,
172 | defend, and hold each Contributor harmless for any liability
173 | incurred by, or claims asserted against, such Contributor by reason
174 | of your accepting any such warranty or additional liability.
175 |
176 | END OF TERMS AND CONDITIONS
177 |
178 | APPENDIX: How to apply the Apache License to your work.
179 |
180 | To apply the Apache License to your work, attach the following
181 | boilerplate notice, with the fields enclosed by brackets "[]"
182 | replaced with your own identifying information. (Don't include
183 | the brackets!) The text should be enclosed in the appropriate
184 | comment syntax for the file format. We also recommend that a
185 | file or class name and description of purpose be included on the
186 | same "printed page" as the copyright notice for easier
187 | identification within third-party archives.
188 |
189 | Copyright [yyyy] [name of copyright owner]
190 |
191 | Licensed under the Apache License, Version 2.0 (the "License");
192 | you may not use this file except in compliance with the License.
193 | You may obtain a copy of the License at
194 |
195 | http://www.apache.org/licenses/LICENSE-2.0
196 |
197 | Unless required by applicable law or agreed to in writing, software
198 | distributed under the License is distributed on an "AS IS" BASIS,
199 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
200 | See the License for the specific language governing permissions and
201 | limitations under the License.
202 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | [TOC]
2 |
3 | # BookChatApp
4 |
5 | 
6 |
7 | 通用书籍阅读APP,[BookChat](https://gitee.com/truthhun/BookChat) 的 `uni-app` 实现版本,支持多端分发,编译生成 Android 和 iOS 手机APP以及各平台的小程序。
8 |
9 | 使用`BookChatApp`,您可以轻松地将您的电子书、文档手册和在线书籍分发到各个小程序平台,以及编译生成手机APP发布到各大手机软件市场供用户下载和使用。
10 |
11 | ## APP 体验
12 |
13 | 目前 `BookChatApp` 已经打包编译生成的 Android 和 iOS 手机APP,您可以直接下载体验和感受下。
14 |
15 | APP下载体验地址: https://www.bookstack.cn/app
16 |
17 | ## 设计开发
18 |
19 | `BookChatApp`的设计开发跟微信小程序[BookChat](https://gitee.com/truthhun/BookChat)几乎没有两样,如果有不一样的地方,
20 | 那就是从微信小程序的原生开发迁移到了使用`uni-app`的vue开发上来。
21 |
22 | `BookChatApp`中对HTML内容的渲染,经过多次对性能和渲染效果体验的对比,最终没有采用网上开源的第三方渲染组件,直接使用了`uni-app`自带的`rich-text`组件,
23 | 而将`BookChatApp`编译成各平台的小程序的时候,同样也是用了各小程序平台的`rich-text`组件。
24 |
25 |
26 | ## 特点
27 |
28 | - 开源:基于 Apache 2.0 开源协议进行开源,对商业友好
29 | - 秀气:简洁、美观,给您焕然一新的视觉体验,让你都不敢相信这是一个擅长后端的程序员设计和开发实现的
30 | - 丰富:注册、登录、搜索、书架、书签、阅读偏好设置等功能齐全,麻雀虽小,五脏俱全
31 | - 强大:尽管`BookChatApp`使用的是混合开发,但是编译生成的手机App以及各平台的小程序,性能和体验也没见得真比原生的差
32 |
33 |
34 | ## 二次开发
35 |
36 | 可能您对现有程序的功能和主题色调不是很满意,或者有自己的一套UI设计方案,那么,您可以对`BookChatApp`进行二次开发,如果您对`Vue`熟悉。
37 |
38 |
39 |
40 | ### 后端程序
41 |
42 | `BookChatApp`的配套后端程序是 [BookStack](https://gitee.com/truthhun/BookStack) v2.1 以上版本。
43 |
44 | `BookStack`的安装部署教程,看这里--> [BookStack安装部署](https://www.bookstack.cn/read/help/Ubuntu.md)
45 |
46 | > 注意: BookStack 的安装部署,不是使用源码进行部署的,而是用编译好了的可执行程序进行部署
47 |
48 | **BookStack 开源地址**
49 |
50 | - Gitee: https://gitee.com/truthhun/BookStack
51 | - GitHub: https://github.com/truthhun/BookStack
52 |
53 | **BookStack 官网**
54 |
55 | 书栈网: https://www.bookstack.cn
56 |
57 | ### 二次开发基本步骤
58 |
59 | 1. 安装部署`BookStack`
60 | 1. 克隆下载`BookChatApp`源码
61 | 1. 使用`HBuilderX`打开项目文件夹
62 | 1. 将下载程序中的`config.example.js`文件重命名为`config.js`文件
63 | 1. 根据自己的开发环境,设置`host`配置项
64 |
65 | > 如果是在开发环境,请把`debug`设置为true,编译生成生产程序的时候,把`debug`设置为false
66 |
67 | ## 程序页面
68 |
69 | - [x] 目录页 /pages/menu/menu
70 | - [x] 书籍阅读页 /pages/read/read
71 | - [x] 用户中心页 /pages/ucenter/ucenter
72 | - [x] 首页 /pages/index/index
73 | - [x] 分类页 /pages/cate/cate
74 | - [x] 书架页 /pages/bookshelf/bookshelf
75 | - [x] 列表页 /pages/list/list
76 | - [x] 个人主页 /pages/me/me
77 | - [x] 书签页 /pages/bookmarks/bookmarks
78 | - [x] 搜索结果页 /pages/search/search
79 | - [x] 内容点评页 /pages/comment/comment
80 | - [x] 404页 /pages/notfound/notfound
81 | - [x] 登录页 /pages/login/login
82 | - [x] 注册页 /pages/register/register
83 | - [x] 书籍介绍页 /pages/intro/intro
84 |
85 |
86 | ## QQ交流群
87 |
88 | QQ交流群:457803862(猿军团)
89 |
90 | 加群请备注`来自BookChatApp`
91 |
92 | 说明:
93 |
94 | > 该群是一个技术交流群。如果是开源程序遇到问题,请直接提交issues,群里不解答问题.
95 |
96 | ## 作者介绍
97 |
98 | Web 全栈工程师,自带发际线魔法加成,擅长`Ctrl + C` 和 `Ctrl + V`
99 |
100 | - 作者:皇虫(TruthHun)
101 | - Email: TruthHun#QQ.COM(把 # 换成 @ )
102 |
103 | ## 预览
104 |
105 | ### 启动页
106 |
107 | 
108 |
109 | ### 首页
110 |
111 |
112 | 
113 |
114 |
115 |
116 |
117 | ### 分类页
118 |
119 | 
120 |
121 |
122 |
123 |
124 | ### 书架页
125 |
126 | 
127 |
128 |
129 |
130 |
131 | ### 书籍介绍页
132 |
133 | 
134 |
135 |
136 |
137 |
138 | ### 书籍阅读页
139 |
140 | 
141 |
142 | -----
143 |
144 | 
145 |
146 | -----
147 |
148 | 
149 |
150 |
151 |
152 |
153 | ### 登录
154 |
155 |
156 | 
157 |
158 |
159 |
160 |
161 | ### 个人中心
162 |
163 | 
164 |
165 |
166 |
167 |
168 | ### 搜索
169 |
170 | 
171 |
172 | -----
173 |
174 | 
175 |
176 |
177 | ## 开源协议
178 |
179 | Apache v2.0
180 |
181 |
182 | ## 赞助
183 |
184 | 如果您觉得程序还可以,欢迎 start 和 fork,以及赞助我一杯咖啡
185 |
186 | 
187 | 
188 |
--------------------------------------------------------------------------------
/change.md:
--------------------------------------------------------------------------------
1 | ## BookChatApp v1.5.0
2 | - [x] 增加显示最近阅读的书籍
3 | - [x] 移除书架书籍引起的书架空白问题的bug
4 | - [x] 使用`ActionSheet`组件优化书架书籍管理方式
5 | - [x] 增加类似通讯录的分类布局。([修改配置方式](https://gitee.com/truthhun/BookChatApp/blob/master/pages/cate/cate.vue#L76))
6 | - [x] 修复 Android内容阅读亮度调节跳转系统设置的问题(APP请求的手机权限不足的问题造成)([#I1DMRB](https://gitee.com/truthhun/BookChatApp/issues/I1DMRB))
7 | - [x] 书架收藏的书籍分类太多时,部分机型会出现分类换行显示,导致下边显示的书籍封面被盖住([#I1DMRC](https://gitee.com/truthhun/BookChatApp/issues/I1DMRC))
8 |
9 | ## BookChatApp v1.4.0
10 |
11 | - [x] 增加本月累计签到和上月累计签到等榜单
12 | - [x] 增加分享功能
13 |
14 | > 本次版本,使用 HBuilderX 2.6.5 进行开发,推荐版本跟进
15 |
16 | ## BookChatApp v1.3.0
17 | - [x] 书籍介绍页面显示书籍标签,以便用户快捷搜索
18 | - [x] 用户退出后,更新书架内容
19 | - [x] 解决类似`mgt-30upx`等class样式不生效的问题,将此类class名更换为`mgt-30`
20 | - [x] 封面样式调整
21 | - [x] `iOS`由 `UIWebView`更换为`WKWebView`
22 | - [x] Fix: 内容阅读设置,恢复默认值时,屏幕亮度没有跟着恢复的问题
23 | - [x] 自定义header,增加`home`键和`搜索按钮`
24 | - [x] 用户个人中心,显示个人相关阅读时长等数据
25 | - [x] 收藏到书架的书籍,点击的时候直接跳转到书籍内容阅读页
26 | - [x] APP签到功能
27 | - [x] 榜单功能显示
28 | - [x] 书籍列表、分类列表增加懒加载功能(之前懒加载使用方式没使用正确)
29 | - [x] 使用`localstorage`的方式存储`app.globalData`,以避免`h5`下的其他问题
30 |
31 | > **注意事项**: 不要使用 `v3` 模式进行编译,不然阅读页面的内容会渲染不出来
32 |
33 | ## BookChatApp v1.2.0
34 | - [x] 平板适配页面
35 | - [x] 目录页 /pages/menu/menu
36 | - [x] 书籍阅读页 /pages/read/read
37 | - [x] 用户中心页 /pages/ucenter/ucenter
38 | - [x] 首页 /pages/index/index
39 | - [x] 分类页 /pages/cate/cate
40 | - [x] 书架页 /pages/bookshelf/bookshelf
41 | - [x] 列表页 /pages/list/list
42 | - [x] 个人主页 /pages/me/me
43 | - [x] 书签页 /pages/bookmarks/bookmarks
44 | - [x] 搜索结果页 /pages/search/search
45 | - [x] 内容点评页 /pages/comment/comment
46 | - [x] 404页 /pages/notfound/notfound
47 | - [x] 登录页 /pages/login/login
48 | - [x] 注册页 /pages/register/register
49 | - [x] 书籍介绍页 /pages/intro/intro
50 | - [x] 平板适配微调
51 | - [x] `tab` 内边距太大
52 | - [x] 书架中书籍名称行高太大
53 | - [x] 搜索输入框优化
54 | - [x] 内容阅读页面代码块显示优化
55 | - [x] Banner 等HTTP链接允许外部打开
56 | - [x] APP版本升级提示(仅针对Android,iOS有App Store,不需要升级提示)
57 | - [x] 书架,长按可以将书籍从书架中移除
--------------------------------------------------------------------------------
/components/header.vue:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
17 |
18 |
19 |
20 |
21 |
22 |
35 |
36 |
37 |
38 |
39 |
40 |
41 |
135 |
136 |
193 |
--------------------------------------------------------------------------------
/components/imt-audio.vue:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 | {{loading?'':(paused?'':'')}}
8 |
9 |
10 | {{title}}
11 |
12 | {{format(current)}}
13 |
15 | {{format(duration)}}
16 |
17 |
18 |
19 |
20 |
21 |
132 |
133 |
227 |
--------------------------------------------------------------------------------
/components/listBook.vue:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 | {{book.book_name}}
10 |
11 |
12 |
13 | {{book.view}} 阅读
14 |
15 |
16 |
17 | {{book.cnt_doc}} 章节
18 |
19 |
20 |
21 | {{book.created_at}}
22 |
23 |
24 | {{book.description ? book.description : book.book_name}}
25 |
26 |
27 |
28 |
29 |
30 |
31 |
66 |
67 |
149 |
--------------------------------------------------------------------------------
/components/loading.vue:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 | {{tips}}
9 |
10 |
11 |
12 |
26 |
27 |
31 |
--------------------------------------------------------------------------------
/components/menu.vue:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 | {{book.book_name}}
18 |
19 | {{book.cnt_doc}} 章节
20 |
21 |
22 |
23 | {{book.score_float}} 分
24 | {{book.cnt_readed}} / {{book.cnt_doc}} 章节
25 |
26 |
27 |
28 | 阅读进度
29 | {{book.percent}}%
30 | (未登录)
31 |
32 |
33 |
34 |
35 |
36 |
37 |
38 |
39 |
47 |
48 |
49 |
50 |
113 |
114 |
149 |
--------------------------------------------------------------------------------
/components/menuTree.vue:
--------------------------------------------------------------------------------
1 |
2 |
3 |
14 |
15 |
16 |
17 |
54 |
55 |
99 |
--------------------------------------------------------------------------------
/components/scrollBook.vue:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 | {{book.book_name}}
8 |
9 |
10 |
11 |
12 |
13 |
14 |
36 |
37 |
71 |
--------------------------------------------------------------------------------
/components/search.vue:
--------------------------------------------------------------------------------
1 |
2 |
3 |
9 |
10 |
11 |
12 |
79 |
80 |
150 |
--------------------------------------------------------------------------------
/components/tab.vue:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 | {{tab.title}}
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
69 |
70 |
123 |
--------------------------------------------------------------------------------
/config.example.js:
--------------------------------------------------------------------------------
1 | // api host,末尾不要带斜杠。后端程序是BookStack (https://github.com/truthhun/BookStack)
2 | // let host = 'http://localhost:8181/bookchat'
3 |
4 | // 默认分享的内容
5 | let shareContent = 'BookChat,程序员IT互联网开源编程书籍免费阅读'
6 | let shareLink = 'https://www.bookstack.cn/read/help/app.md'
7 |
8 | // 是否是调试模式。如果是生产环境,请设置为false
9 | const debug = true
10 |
11 | // 横幅广告id,如果申请了腾讯小程序的广告,则创建一个横幅广告,把广告的AdUnitId粘贴进来即可,不投放广告,则把该值设置为空
12 | const bannerAdUnitId = ''
13 |
14 | // 程序信息,置空则不显示
15 | const info = {
16 | about: 'help/about', // "关于我们"的文档标识
17 | version: 'v1.7.0',
18 | copyright: 'BookStack.CN',
19 | license: 'Apache 2.0',
20 | author: 'TruthHun',
21 | }
22 |
23 | const api = {
24 | banners: `${host}/api/v1/banners`,
25 | register: `${host}/api/v1/register`,
26 | login: `${host}/api/v1/login`,
27 | loginByWechat: `${host}/api/v1/login-by-wechat`,
28 | loginBindWechat: `${host}/api/v1/login-bind-wechat`,
29 | loginedBindWechat: `${host}/api/v1/login-bind-wechat`,
30 | logout: `${host}/api/v1/logout`,
31 | categories: `${host}/api/v1/book/categories`,
32 | bookLists: `${host}/api/v1/book/lists`,
33 | bookListsByCids: `${host}/api/v1/book/lists-by-cids`,
34 | bookInfo: `${host}/api/v1/book/info`,
35 | historyReadBook: `${host}/api/v1/book/history`,
36 | bookMenu: `${host}/api/v1/book/menu`,
37 | bookDownload: `${host}/api/v1/book/download`,
38 | searchBook: `${host}/api/v1/search/book`,
39 | searchDoc: `${host}/api/v1/search/doc`,
40 | bookmark: `${host}/api/v1/book/bookmark`,
41 | read: `${host}/api/v1/book/read`,
42 | userInfo: `${host}/api/v1/user/info`,
43 | userMoreInfo: `${host}/api/v1/user/more-info`,
44 | userRelease: `${host}/api/v1/user/release`,
45 | userFans: `${host}/api/v1/user/fans`,
46 | userFollow: `${host}/api/v1/user/follow`,
47 | userSign: `${host}/api/v1/user/sign`,
48 | bookshelf: `${host}/api/v1/user/bookshelf`,
49 | bookStar: `${host}/api/v1/book/star`,
50 | comment: `${host}/api/v1/book/comment`,
51 | bookRelated: `${host}/api/v1/book/related`,
52 | changeAvatar: `${host}/api/v1/user/change-avatar`,
53 | changePassword: `${host}/api/v1/user/change-password`,
54 | lastestVersion: `${host}/api/v1/version`,
55 | rank: `${host}/api/v1/rank`,
56 | }
57 |
58 | module.exports = {
59 | api,
60 | debug,
61 | info,
62 | shareContent,
63 | shareLink,
64 | }
65 |
--------------------------------------------------------------------------------
/main.js:
--------------------------------------------------------------------------------
1 | import Vue from 'vue'
2 | import App from './App'
3 |
4 | Vue.config.productionTip = false
5 |
6 | App.mpType = 'app'
7 |
8 | const app = new Vue({
9 | ...App
10 | })
11 | app.$mount()
12 |
--------------------------------------------------------------------------------
/manifest.json:
--------------------------------------------------------------------------------
1 | {
2 | "name" : "BookChat",
3 | "appid" : "__UNI__8FAB29C",
4 | "description" : "",
5 | "versionName" : "1.7.0",
6 | "versionCode" : 170,
7 | "transformPx" : false,
8 | /* 5+App特有相关 */
9 | "app-plus" : {
10 | "kernel" : {
11 | "ios" : "WKWebview" // UIWebview 或者 "WKWebview"
12 | },
13 | "usingComponents" : true,
14 | "splashscreen" : {
15 | "alwaysShowBeforeRender" : true,
16 | "waiting" : true,
17 | "autoclose" : true,
18 | "delay" : 0
19 | },
20 | // 屏幕方向
21 | "screenOrientation" : [
22 | "portrait-primary",
23 | "landscape-primary",
24 | "portrait-secondary",
25 | "landscape-secondary"
26 | ],
27 | /* 模块配置 */
28 | "modules" : {},
29 | /* 应用发布信息 */
30 | "distribute" : {
31 | /* android打包配置 */
32 | "android" : {
33 | "permissions" : [
34 | "",
35 | "",
36 | "",
37 | ""
38 | ],
39 | "schemes" : "",
40 | "autoSdkPermissions" : true
41 | },
42 | /* ios打包配置 */
43 | "ios" : {
44 | "urltypes" : ""
45 | },
46 | /* SDK配置 */
47 | "sdkConfigs" : {
48 | "ad" : {},
49 | "speech" : {}
50 | },
51 | "icons" : {
52 | "android" : {
53 | "hdpi" : "unpackage/res/icons/72x72.png",
54 | "xhdpi" : "unpackage/res/icons/96x96.png",
55 | "xxhdpi" : "unpackage/res/icons/144x144.png",
56 | "xxxhdpi" : "unpackage/res/icons/192x192.png"
57 | },
58 | "ios" : {
59 | "appstore" : "unpackage/res/icons/1024x1024.png",
60 | "ipad" : {
61 | "app" : "unpackage/res/icons/76x76.png",
62 | "app@2x" : "unpackage/res/icons/152x152.png",
63 | "notification" : "unpackage/res/icons/20x20.png",
64 | "notification@2x" : "unpackage/res/icons/40x40.png",
65 | "proapp@2x" : "unpackage/res/icons/167x167.png",
66 | "settings" : "unpackage/res/icons/29x29.png",
67 | "settings@2x" : "unpackage/res/icons/58x58.png",
68 | "spotlight" : "unpackage/res/icons/40x40.png",
69 | "spotlight@2x" : "unpackage/res/icons/80x80.png"
70 | },
71 | "iphone" : {
72 | "app@2x" : "unpackage/res/icons/120x120.png",
73 | "app@3x" : "unpackage/res/icons/180x180.png",
74 | "notification@2x" : "unpackage/res/icons/40x40.png",
75 | "notification@3x" : "unpackage/res/icons/60x60.png",
76 | "settings@2x" : "unpackage/res/icons/58x58.png",
77 | "settings@3x" : "unpackage/res/icons/87x87.png",
78 | "spotlight@2x" : "unpackage/res/icons/80x80.png",
79 | "spotlight@3x" : "unpackage/res/icons/120x120.png"
80 | }
81 | }
82 | }
83 | },
84 | "uniStatistics" : {
85 | "enable" : true
86 | },
87 | "compilerVersion" : 2
88 | },
89 | /* 快应用特有相关 */
90 | "quickapp" : {},
91 | /* 小程序特有相关 */
92 | "mp-weixin" : {
93 | "appid" : "wx3485915f4bdab8fb",
94 | "setting" : {
95 | "urlCheck" : false,
96 | "es6" : false
97 | },
98 | "usingComponents" : true,
99 | "uniStatistics" : {
100 | "enable" : true
101 | }
102 | },
103 | "mp-alipay" : {
104 | "usingComponents" : true,
105 | "uniStatistics" : {
106 | "enable" : true
107 | }
108 | },
109 | "mp-baidu" : {
110 | "usingComponents" : true,
111 | "uniStatistics" : {
112 | "enable" : true
113 | }
114 | },
115 | "mp-toutiao" : {
116 | "usingComponents" : true,
117 | "uniStatistics" : {
118 | "enable" : true
119 | }
120 | },
121 | "h5" : {
122 | "uniStatistics" : {
123 | "enable" : true
124 | }
125 | },
126 | "mp-qq" : {
127 | "uniStatistics" : {
128 | "enable" : true
129 | }
130 | },
131 | "uniStatistics" : {
132 | "enable" : true
133 | }
134 | }
135 | /* ios打包配置 *//* SDK配置 */
136 |
137 |
--------------------------------------------------------------------------------
/pages.json:
--------------------------------------------------------------------------------
1 | {
2 | "pages": [ //pages数组中第一项表示应用启动页,参考:https://uniapp.dcloud.io/collocation/pages
3 | {
4 | "path": "pages/index/index",
5 | "style": {
6 | "navigationBarTitleText": "BookChat"
7 | }
8 | }, {
9 | "path": "pages/read/read"
10 | }, {
11 | "path": "pages/menu/menu",
12 | "style": {}
13 | }, {
14 | "path": "pages/notfound/notfound",
15 | "style": {
16 | "navigationBarTitleText": "未找到对象"
17 | }
18 | },
19 | {
20 | "path": "pages/comment/comment",
21 | "style": {
22 | "navigationBarTitleText": "点评"
23 | }
24 | },
25 | {
26 | "path": "pages/reg/reg",
27 | "style": {
28 | "navigationBarTitleText": "注册"
29 | }
30 | },
31 | {
32 | "path": "pages/login/login",
33 | "style": {
34 | "navigationBarTitleText": "登录"
35 | }
36 | },
37 | {
38 | "path": "pages/list/list",
39 | "style": {
40 | "navigationBarTitleText": "列表"
41 | }
42 | },
43 | {
44 | "path": "pages/cate/cate",
45 | "style": {
46 | "navigationBarTitleText": "分类"
47 | }
48 | },
49 | {
50 | "path": "pages/me/me",
51 | "style": {
52 | "navigationBarTitleText": "我的"
53 | }
54 | }, {
55 | "path": "pages/bookshelf/bookshelf",
56 | "style": {
57 | "navigationBarTitleText": "书架"
58 | }
59 | }, {
60 | "path": "pages/ucenter/ucenter",
61 | "style": {}
62 | }, {
63 | "path": "pages/intro/intro",
64 | "style": {}
65 | }, {
66 | "path": "pages/bookmarks/bookmarks",
67 | "style": {
68 | "navigationBarTitleText": "书签"
69 | }
70 | }, {
71 | "path": "pages/search/search",
72 | "style": {
73 | "navigationBarTitleText": "搜索"
74 | }
75 | }, {
76 | "path": "pages/rank/rank",
77 | "style": {}
78 | }, {
79 | "path": "pages/history/history",
80 | "style": {
81 | "enablePullDownRefresh": true
82 | }
83 | }
84 | ,{
85 | "path" : "pages/bind/bind",
86 | "style" :
87 | {
88 | "navigationBarTitleText": "",
89 | "enablePullDownRefresh": false
90 | }
91 |
92 | }
93 | ],
94 | "tabBar": {
95 | "list": [{
96 | "pagePath": "pages/index/index",
97 | "text": "首页",
98 | "iconPath": "static/images/home.png",
99 | "selectedIconPath": "static/images/home-selected.png"
100 | },
101 | {
102 | "pagePath": "pages/cate/cate",
103 | "text": "分类",
104 | "iconPath": "static/images/cate.png",
105 | "selectedIconPath": "static/images/cate-selected.png"
106 | },
107 | {
108 | "pagePath": "pages/bookshelf/bookshelf",
109 | "text": "书架",
110 | "iconPath": "static/images/collect.png",
111 | "selectedIconPath": "static/images/collect-selected.png"
112 | },
113 | {
114 | "pagePath": "pages/me/me",
115 | "text": "我的",
116 | "iconPath": "static/images/me.png",
117 | "selectedIconPath": "static/images/me-selected.png"
118 | }
119 | ],
120 | "backgroundColor": "#ffffff",
121 | "color": "#888888",
122 | "selectedColor": "#1aad19"
123 | },
124 | "globalStyle": {
125 | "navigationBarTextStyle": "black",
126 | "navigationBarTitleText": "BookChat",
127 | "navigationBarBackgroundColor": "#FFFFFF",
128 | "backgroundColor": "#FFFFFF",
129 | "navigationStyle": "custom"
130 | },
131 | "condition": { //模式配置,仅开发期间生效
132 | "current": 0, //当前激活的模式(list 的索引项)
133 | "list": [{
134 | "name": "", //模式名称
135 | "path": "", //启动页面,必选
136 | "query": "" //启动参数,在页面的onLoad函数里面得到
137 | }]
138 | }
139 | }
140 |
--------------------------------------------------------------------------------
/pages/bind/bind.vue:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 | {{nickname}}
10 |
11 |
12 | 绑定已有账号
13 | 绑定新账号
14 |
15 |
16 |
69 |
70 |
71 |
72 |
73 |
74 |
146 |
147 |
187 |
--------------------------------------------------------------------------------
/pages/bookmarks/bookmarks.vue:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 | [ {{bookmark.created_at}} ]
9 | {{bookmark.title}}
10 |
11 |
12 |
13 |
14 |
15 |
16 | {{tips}}
17 |
18 |
19 |
20 |
21 |
22 |
105 |
106 |
138 |
--------------------------------------------------------------------------------
/pages/bookshelf/bookshelf.vue:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 | 分类可左右滑动;长按可操作书架收藏的书籍
11 | X
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 | {{cate.title}}
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 | 黑夜给了你一双黑色的眼睛
32 | 你用它去寻找光明...
33 | 我们给了你一个华丽的书架
34 | 你却没有一本书籍...
35 |
36 |
37 |
38 |
39 |
40 | 黑夜给了你一双黑色的眼睛
41 | 你用它去寻找光明...
42 | 我们给了你一个华丽的书架
43 | 你却没登录...
44 |
45 |
46 |
47 |
48 |
49 |
50 |
51 |
52 |
54 |
55 | {{book.book_name}}
56 |
57 |
58 |
59 |
60 |
61 |
62 |
63 |
64 |
289 |
290 |
397 |
--------------------------------------------------------------------------------
/pages/cate/cate.vue:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 | {{category.title}}
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 | {{child.title}}
20 | {{child.cnt}} 本
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
32 |
33 | {{category.title}}
34 |
35 |
36 |
37 |
38 |
39 |
40 |
41 |
42 |
43 |
44 | {{child.title}}
45 |
46 |
47 |
48 |
49 |
50 |
51 |
52 |
53 |
54 | {{category.firstWord}}
56 |
57 |
58 |
59 |
60 |
61 |
62 |
134 |
135 |
279 |
--------------------------------------------------------------------------------
/pages/comment/comment.vue:
--------------------------------------------------------------------------------
1 |
2 |
25 |
26 |
27 |
103 |
104 |
149 |
--------------------------------------------------------------------------------
/pages/history/history.vue:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
87 |
88 |
91 |
--------------------------------------------------------------------------------
/pages/index/index.vue:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
11 |
12 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 | 最新推荐
23 | 最近阅读
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
32 |
33 |
34 |
35 |
36 |
37 |
38 |
39 |
40 |
41 |
42 |
43 | {{category.title}}
44 | 更多
46 |
47 |
48 |
49 |
50 |
51 |
52 |
53 | .
54 |
55 |
56 |
57 |
245 |
246 |
258 |
--------------------------------------------------------------------------------
/pages/list/list.vue:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
156 |
157 |
160 |
--------------------------------------------------------------------------------
/pages/login/login.vue:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
41 |
42 |
43 |
44 |
45 |
186 |
187 |
199 |
--------------------------------------------------------------------------------
/pages/me/me.vue:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 | {{user.nickname}}
8 |
9 | {{user.intro}}
10 |
11 |
12 |
13 |
14 | 我的成就
15 |
16 |
17 |
18 | 已签到
19 |
20 |
21 |
22 | 签到
23 |
24 | |
25 |
26 |
27 | 榜单
28 |
29 |
30 |
31 |
32 |
33 | {{moreInfo.today_reading_hour}} 时 {{moreInfo.today_reading_min}}
35 | 分
36 | 今日阅读
37 |
38 |
39 | {{moreInfo.month_reading_hour}} 时 {{moreInfo.month_reading_min}}
41 | 分
42 | 本月阅读
43 |
44 |
45 | {{moreInfo.total_reading_hour}} 时 {{moreInfo.total_reading_min}}
47 | 分
48 | 累计阅读
49 |
50 |
51 | {{moreInfo.join_day}} 天
52 | 加入组织
53 |
54 |
55 | {{moreInfo.total_sign}} 天
56 | 累计签到
57 |
58 |
59 | {{moreInfo.total_continuous_sign}} 天
60 | 连续签到
61 |
62 |
63 |
64 |
65 |
66 |
67 |
68 | 书籍搜索
69 |
70 |
71 |
72 |
73 | 热门榜单
74 |
75 |
76 |
77 |
78 | 最近阅读
79 |
80 |
81 |
82 |
83 |
84 |
85 | 我的发布
86 |
87 |
88 |
89 |
90 | 我的收藏
91 |
92 |
93 |
94 |
95 | 我的关注
96 |
97 |
98 |
99 |
100 | 我的粉丝
101 |
102 |
103 |
104 |
105 |
106 |
107 |
108 | 关于我们
109 |
110 |
111 |
112 |
113 |
114 |
115 |
116 | 退出登录
117 |
118 |
119 |
120 |
121 |
137 |
138 |
139 |
140 |
280 |
281 |
450 |
--------------------------------------------------------------------------------
/pages/menu/menu.vue:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
9 |
10 |
11 |
12 |
138 |
139 |
142 |
--------------------------------------------------------------------------------
/pages/notfound/notfound.vue:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 | 404
8 | 确认过眼神,没找到对的人
9 |
10 |
11 | 朕要肥家
12 |
13 |
14 |
15 |
16 |
37 |
38 |
45 |
--------------------------------------------------------------------------------
/pages/rank/rank.vue:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 | {{item.title}}
7 |
8 |
9 |
10 |
11 |
12 |
13 | {{subItem.title}}
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 | {{index + 1}}
26 |
27 | {{list.nickname}}
28 | {{list.book_name}}
29 |
30 | {{list.info}}
31 |
32 |
33 |
34 |
35 |
36 |
37 |
304 |
392 |
--------------------------------------------------------------------------------
/pages/reg/reg.vue:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
55 |
56 |
57 |
58 |
59 |
202 |
203 |
206 |
--------------------------------------------------------------------------------
/pages/search/search.vue:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 | {{doc.title}}
19 |
20 |
21 |
22 |
23 | {{doc.vcnt}}
24 |
25 |
26 |
27 | {{doc.created_at}}
28 |
29 | 《{{doc.book_name}}》
30 |
31 | {{doc.content}}
32 |
33 |
34 |
35 |
36 |
37 |
38 |
39 |
40 |
201 |
202 |
237 |
--------------------------------------------------------------------------------
/pages/ucenter/ucenter.vue:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 | {{user.nickname}}
7 | {{user.intro}}
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
17 |
18 |
19 |
20 |
21 |
22 |
23 | {{book.book_name}}
24 |
25 |
26 |
27 | {{book.view}} 阅读
28 |
29 |
30 |
31 | {{book.cnt_doc}} 章节
32 |
33 |
34 |
35 | {{book.created_at}}
36 |
37 |
38 |
39 | {{book.star}} 收藏
40 |
41 |
42 |
43 | {{book.description ? book.description : book.book_name}}
44 |
45 |
46 |
47 |
48 |
49 |
50 |
51 |
52 |
53 |
54 |
55 |
56 |
57 | {{user.nickname}}
58 |
59 |
60 |
61 |
62 |
63 |
64 |
65 |
66 |
67 |
68 |
69 |
311 |
312 |
481 |
--------------------------------------------------------------------------------
/static/css/bookchat.css:
--------------------------------------------------------------------------------
1 | /* bookchat global css */
2 | .text-center {
3 | text-align: center;
4 | }
5 |
6 | .block{display: block !important;}
7 |
8 | /* 字体大小规范 */
9 |
10 | .font-lv1 {
11 | font-size: 18px !important;
12 | }
13 |
14 | .font-lv2 {
15 | font-size: 16px !important;
16 | }
17 |
18 | .font-lv3 {
19 | font-size: 14px !important;
20 | }
21 |
22 | .font-lv4 {
23 | font-size: 12px !important;
24 | }
25 |
26 | .font-lv5 {
27 | font-size: 10px !important;
28 | }
29 |
30 | /* margin */
31 |
32 | .mgt-15 {
33 | /* margin-top: 15upx; */
34 | margin-top: 8px;
35 | }
36 |
37 | .mgb-15 {
38 | /* margin-bottom: 15upx; */
39 | margin-bottom: 8px;
40 | }
41 |
42 | .mgt-30 {
43 | /* margin-top: 30upx; */
44 | margin-top: 15px;
45 | }
46 |
47 | .mgb-30 {
48 | /* margin-bottom: 30upx; */
49 | margin-bottom: 15px;
50 | }
51 |
52 | .mgl-30{
53 | /* margin-left: 30upx; */
54 | margin-left: 15px;
55 | }
56 |
57 | .mgr-30{
58 | /* margin-right: 30upx; */
59 | margin-right: 15px;
60 | }
61 |
62 | /* padding */
63 |
64 | .pdt-15 {
65 | /* padding-top: 15upx; */
66 | padding-top: 8px;
67 | }
68 |
69 | .pdb-15 {
70 | /* padding-bottom: 15upx; */
71 | padding-bottom: 8px;
72 | }
73 |
74 | .pdt-30 {
75 | /* padding-top: 30upx; */
76 | padding-top: 15px;
77 | }
78 |
79 | .pdb-30 {
80 | /* padding-bottom: 30upx; */
81 | padding-bottom: 15px;
82 | }
83 |
84 | .pdl-30 {
85 | /* padding-left: 30upx; */
86 | padding-left: 15px;
87 | }
88 |
89 | .plr-30 {
90 | /* padding-right: 30upx; */
91 | padding-right: 15px;
92 | }
93 |
94 | /* 颜色规范 */
95 |
96 | .color-black {
97 | color: #000;
98 | }
99 |
100 | .color-semi {
101 | color: #353535;
102 | }
103 |
104 | .color-grey {
105 | color: #888;
106 | }
107 |
108 | .color-light {
109 | color: #b2b2b2;
110 | }
111 |
112 | .color-green {
113 | color: #09bb09;
114 | }
115 |
116 | .color-red {
117 | color: #e64340;
118 | }
119 |
120 | .color-info,
121 | .color-link,
122 | .color-active {
123 | color: #00acff;
124 | }
125 |
126 | .bd-color {
127 | border-color: #f1f1f1;
128 | }
129 |
130 | .bg-color {
131 | background-color: #f1f1f1;
132 | }
133 |
134 | .img-responsive {
135 | max-width: 100%;
136 | }
137 |
138 | .border-basic {
139 | border: 1px solid #efefef;
140 | }
141 |
142 | .radius-basic,
143 | .cover {
144 | border-radius: 3px;
145 | }
146 |
147 | .radius-circle {
148 | border-radius: 100%;
149 | }
150 |
151 | .row {
152 | display: flex;
153 | flex-wrap: wrap;
154 | }
155 |
156 | .col {
157 | flex-basis: 0;
158 | flex-grow: 1;
159 | max-width: 100%;
160 | }
161 |
162 | .col-1 {
163 | flex: 0 0 8.333333%;
164 | max-width: 8.333333%;
165 | }
166 |
167 | .col-2 {
168 | flex: 0 0 16.666667%;
169 | max-width: 16.666667%;
170 | }
171 |
172 | .col-3 {
173 | flex: 0 0 25%;
174 | max-width: 25%;
175 | }
176 |
177 | .col-4 {
178 | flex: 0 0 33.333333%;
179 | max-width: 33.333333%;
180 | }
181 |
182 | .col-5 {
183 | flex: 0 0 41.666667%;
184 | max-width: 41.666667%;
185 | }
186 |
187 | .col-6 {
188 | flex: 0 0 50%;
189 | max-width: 50%;
190 | }
191 |
192 | .col-7 {
193 | flex: 0 0 58.333333%;
194 | max-width: 58.333333%;
195 | }
196 |
197 | .col-8 {
198 | flex: 0 0 66.666667%;
199 | max-width: 66.666667%;
200 | }
201 |
202 | .col-9 {
203 | flex: 0 0 75%;
204 | max-width: 75%;
205 | }
206 |
207 | .col-10 {
208 | flex: 0 0 83.333333%;
209 | max-width: 83.333333%;
210 | }
211 |
212 | .col-11 {
213 | flex: 0 0 91.666667%;
214 | max-width: 91.666667%;
215 | }
216 |
217 | .col-12 {
218 | flex: 0 0 100%;
219 | max-width: 100%;
220 | }
221 |
222 | /**app.wxss**/
223 |
224 | .box-shadow {
225 | box-shadow: 0px 0px 3px rgba(0, 0, 0, 0.09);
226 | /* border: 1upx solid rgba(0, 0, 0, 0.08); */
227 | }
228 |
229 | .base-padding {
230 | box-sizing: border-box;
231 | padding: 0 15px;
232 | }
233 |
234 | .base-margin-bottom {
235 | margin-bottom: 30px;
236 | }
237 |
238 | .pull-right {
239 | float: right;
240 | }
241 |
242 | .text-right {
243 | text-align: right;
244 | }
245 |
246 | navigator:hover,
247 | navigator:active {
248 | background-color: transparent;
249 | }
250 |
251 | .panel-heading {
252 | margin-bottom: 15px;
253 | }
254 |
255 | /* 显示两行,溢出文字用‘...’替换 */
256 |
257 | .ellipsis-1row {
258 | text-overflow: ellipsis;
259 | display: -webkit-box;
260 | -webkit-line-clamp: 1;
261 | -webkit-box-orient: vertical;
262 | overflow: hidden;
263 | }
264 |
265 | .ellipsis-2row {
266 | text-overflow: ellipsis;
267 | display: -webkit-box;
268 | box-decoration-break: ;
269 | -webkit-line-clamp: 2;
270 | -webkit-box-orient: vertical;
271 | /* box-orient: vertical;
272 | height: 3em;
273 | line-height: 1.5; */
274 | overflow: hidden;
275 | }
276 |
277 | .ellipsis-3row {
278 | text-overflow: ellipsis;
279 | display: -webkit-box;
280 | -webkit-line-clamp: 3;
281 | -webkit-box-orient: vertical;
282 | overflow: hidden;
283 | }
284 |
285 | .text-muted {
286 | color: #888;
287 | /* font-size: 28upx; */
288 | /* line-height: 170%; */
289 | /* text-align: left; */
290 | }
291 |
292 | .cover {
293 | border-radius: 3px;
294 | }
295 |
296 | .score {
297 | height: 14.5px;
298 | padding-left: 85px;
299 | background: transparent url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAEsAAAClCAYAAAAUAAAYAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAA5xJREFUeNrs3T9rFEEcxvG7qEQIglaCICKkin9AUEtBKxU7wS61VlYivgWj70TtNFj5BqzE7qxEWwsxKIoYn4UtluFmbm8nczvzm+/BjxyuDwNzu3uXD0+46f7LC5PA45Hm+WTYw1x2LRDc0jzTXB+wqMlsaLPutz8fDFjYZHYauAz3NBvt83XNnyUWNpn1nVm3OsHmsb3EomazzZnVXKMPNcc0xzUnNKc0Rzv/77fms+Z7O3vt9b1eU7bZrNN68l5zcolX4ofmsuZXTdnmMvyi2dR86Bmcac62P6vKrnVubpc0bxYE32nOab45N8YqsvPeDfcD4SOav4HjprPuu+H5BTt9LXDMfNbdLPfT678Fx6vKupt1o/O8+R3pkOaJ5/iktqx7z/qp+aq5q/nY+fczmheaK03Gs7D5rLtZdzSvA6/Ebc2u55j57HQB0TzW7AzkjiKzny6+2hlKNE8juMNcFqKBaIZndRlCNBBNgmx7ZkE0fbLtZkE0EA1EM17WuQwhGogGooFoss6296y52cNO+J6HLJoPaFdbsvA9zGerIxrPh85eWYgGooFoDiQbuAxp0UA0EVmdWbRo+ma1WbRoIBqIZtzsnHdDWjQQDUQD0WSbde5ZS2UhmtqJJtSEiVkXooFoIJre2VATJmZdiKZ2ogk1YSb8oVMvDeUPnSAaiCaPJkzMuhANRAPRQDQpsqEmTMy6EI11oolpwkA0EA1EcyDZmCYMRAPR+LMxTZjqiCamCQPRQDQQzehNGIgGooFoIJpVZ2OaMBBN7USTqgkD0UA0EE3vbKomDERTO9GkasKYJJpUTRiIBqKBaEZvwkA0EA1EA9GkyKZqwkA01olmrCYMRAPRQDR9LkO+0QmiKbAJUyTRjNWEgWggGohm9CYMRAPRQDQQzZDsWE0YiMYC0eTYhIFoIJrKiCbHJgxEY4FocmzCZEs0OTZhIBqIpjKiybEJA9FANBANROPL5tiEgWhKIJoSmzAQDURjjGhKbMJANCUQTYlNmNGIpsQmDEQD0RgjmhKbMBANRAPR1Es0JTZhIJpciMZaEwaigWgKJBprTRiIJheisdaESUo01powEA1EUyDRWGvCQDQQDURjm2isNWEgmlURzWw2q4pZIBqIJkOiCVyGJpkFolkV0ejMMvel28mIRptl7ku3IRqIpjCimfNuaJpZIBqIBqIpm2ice5Z5ZonJupvVkMRu4JW4qXnrOWY++1+AAQBw9BJSCTeN9wAAAABJRU5ErkJggg==) no-repeat 0 2px;
300 | font-size: 15px;
301 | color: #999;
302 | margin-bottom: 8px;
303 | }
304 |
305 | .score text {
306 | position: relative;
307 | top: -2px;
308 | }
309 |
310 | /* 评分 */
311 |
312 | .score-50,
313 | .score-49,
314 | .score-48,
315 | .score-47 {
316 | background-position-y: 0px;
317 | }
318 |
319 | .score-45,
320 | .score-46,
321 | .score-44,
322 | .score-43 {
323 | background-position-y: -15px;
324 | }
325 |
326 | .score-40,
327 | .score-41,
328 | .score-42,
329 | .score-39,
330 | .score-38,
331 | .score-37 {
332 | background-position-y: -29px;
333 | }
334 |
335 | .score-35,
336 | .score-36,
337 | .score-34,
338 | .score-33 {
339 | background-position-y: -45px;
340 | }
341 |
342 | .score-30,
343 | .score-32,
344 | .score-31,
345 | .score-29,
346 | .score-28,
347 | .score-27 {
348 | background-position-y: -60px;
349 | }
350 |
351 | .score-25,
352 | .score-26,
353 | .score-24,
354 | .score-23 {
355 | background-position-y: -75px;
356 | }
357 |
358 | .score-20,
359 | .score-21,
360 | .score-22,
361 | .score-19,
362 | .score-18,
363 | .score-17 {
364 | background-position-y: -90px;
365 | }
366 |
367 | .score-15,
368 | .score-16,
369 | .score-14,
370 | .score-13 {
371 | background-position-y: -105px;
372 | }
373 |
374 | .score-10,
375 | .score-11,
376 | .score-12,
377 | .score-9,
378 | .score-8,
379 | .score-7 {
380 | background-position-y: -120px;
381 | }
382 |
383 | .score-5,
384 | .score-6,
385 | .score-4,
386 | .score-3 {
387 | background-position-y: -135px;
388 | }
389 |
390 | .score-2,
391 | .score-1,
392 | .score-0 {
393 | background-position-y: -150px;
394 | }
395 |
396 | /* 平板样式兼容 */
397 |
398 | @media (min-width: 768px) {
399 | .font-lv1 {
400 | font-size: 21px !important;
401 | }
402 |
403 | .font-lv2 {
404 | font-size: 19px !important;
405 | }
406 |
407 | .font-lv3 {
408 | font-size: 17px !important;
409 | }
410 |
411 | .font-lv4 {
412 | font-size: 15px !important;
413 | }
414 |
415 | .font-lv5 {
416 | font-size: 13px !important;
417 | }
418 | }
419 |
--------------------------------------------------------------------------------
/static/css/reg-login.css:
--------------------------------------------------------------------------------
1 | /* pages/reg/reg.wxss */
2 |
3 | .form-body{margin-bottom: 15px;}
4 |
5 | .form-body .row{
6 | border-bottom: 1upx solid #efefef;
7 | color: #353535;height: 50px;line-height: 50px;
8 | }
9 | .form-body .row input{
10 | margin-top: 12px;
11 | }
12 |
13 | .btn-captcha{
14 | border-radius: 3px;
15 | }
16 |
17 | .btn-block{
18 | width: 100%;border-radius: 3px;color: #fff;margin-bottom: 15px;
19 | }
20 | .btn-submit{
21 | background-color: #00acff;border-color: #00acff;
22 | }
23 |
24 | .btn-auth{
25 | background-color: #00c706;border-color: #00c706;
26 | }
27 | .btn-reg,.btn-login{
28 | color: #353535;
29 | }
30 |
31 | image{width: 80px;height: 80px;display: block;margin:15px auto;}
--------------------------------------------------------------------------------
/static/images/404.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/TruthHun/BookChatApp/5b334ce986c7e5309eef38043fd2ead97c931b9e/static/images/404.png
--------------------------------------------------------------------------------
/static/images/about-us.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/TruthHun/BookChatApp/5b334ce986c7e5309eef38043fd2ead97c931b9e/static/images/about-us.png
--------------------------------------------------------------------------------
/static/images/bg-poster.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/TruthHun/BookChatApp/5b334ce986c7e5309eef38043fd2ead97c931b9e/static/images/bg-poster.jpg
--------------------------------------------------------------------------------
/static/images/book.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/TruthHun/BookChatApp/5b334ce986c7e5309eef38043fd2ead97c931b9e/static/images/book.png
--------------------------------------------------------------------------------
/static/images/bookmark-add.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/TruthHun/BookChatApp/5b334ce986c7e5309eef38043fd2ead97c931b9e/static/images/bookmark-add.png
--------------------------------------------------------------------------------
/static/images/bookmark-added.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/TruthHun/BookChatApp/5b334ce986c7e5309eef38043fd2ead97c931b9e/static/images/bookmark-added.png
--------------------------------------------------------------------------------
/static/images/bookmark.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/TruthHun/BookChatApp/5b334ce986c7e5309eef38043fd2ead97c931b9e/static/images/bookmark.png
--------------------------------------------------------------------------------
/static/images/cate-default.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/TruthHun/BookChatApp/5b334ce986c7e5309eef38043fd2ead97c931b9e/static/images/cate-default.png
--------------------------------------------------------------------------------
/static/images/cate-selected.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/TruthHun/BookChatApp/5b334ce986c7e5309eef38043fd2ead97c931b9e/static/images/cate-selected.png
--------------------------------------------------------------------------------
/static/images/cate.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/TruthHun/BookChatApp/5b334ce986c7e5309eef38043fd2ead97c931b9e/static/images/cate.png
--------------------------------------------------------------------------------
/static/images/checked.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/TruthHun/BookChatApp/5b334ce986c7e5309eef38043fd2ead97c931b9e/static/images/checked.png
--------------------------------------------------------------------------------
/static/images/clear.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/TruthHun/BookChatApp/5b334ce986c7e5309eef38043fd2ead97c931b9e/static/images/clear.png
--------------------------------------------------------------------------------
/static/images/clock.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/TruthHun/BookChatApp/5b334ce986c7e5309eef38043fd2ead97c931b9e/static/images/clock.png
--------------------------------------------------------------------------------
/static/images/collect-selected.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/TruthHun/BookChatApp/5b334ce986c7e5309eef38043fd2ead97c931b9e/static/images/collect-selected.png
--------------------------------------------------------------------------------
/static/images/collect.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/TruthHun/BookChatApp/5b334ce986c7e5309eef38043fd2ead97c931b9e/static/images/collect.png
--------------------------------------------------------------------------------
/static/images/comment.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/TruthHun/BookChatApp/5b334ce986c7e5309eef38043fd2ead97c931b9e/static/images/comment.png
--------------------------------------------------------------------------------
/static/images/document.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/TruthHun/BookChatApp/5b334ce986c7e5309eef38043fd2ead97c931b9e/static/images/document.png
--------------------------------------------------------------------------------
/static/images/download.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/TruthHun/BookChatApp/5b334ce986c7e5309eef38043fd2ead97c931b9e/static/images/download.png
--------------------------------------------------------------------------------
/static/images/error.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/TruthHun/BookChatApp/5b334ce986c7e5309eef38043fd2ead97c931b9e/static/images/error.png
--------------------------------------------------------------------------------
/static/images/eye.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/TruthHun/BookChatApp/5b334ce986c7e5309eef38043fd2ead97c931b9e/static/images/eye.png
--------------------------------------------------------------------------------
/static/images/fans.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/TruthHun/BookChatApp/5b334ce986c7e5309eef38043fd2ead97c931b9e/static/images/fans.png
--------------------------------------------------------------------------------
/static/images/follow.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/TruthHun/BookChatApp/5b334ce986c7e5309eef38043fd2ead97c931b9e/static/images/follow.png
--------------------------------------------------------------------------------
/static/images/font-minus.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/TruthHun/BookChatApp/5b334ce986c7e5309eef38043fd2ead97c931b9e/static/images/font-minus.png
--------------------------------------------------------------------------------
/static/images/font-plus.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/TruthHun/BookChatApp/5b334ce986c7e5309eef38043fd2ead97c931b9e/static/images/font-plus.png
--------------------------------------------------------------------------------
/static/images/font.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/TruthHun/BookChatApp/5b334ce986c7e5309eef38043fd2ead97c931b9e/static/images/font.png
--------------------------------------------------------------------------------
/static/images/header-back.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/TruthHun/BookChatApp/5b334ce986c7e5309eef38043fd2ead97c931b9e/static/images/header-back.png
--------------------------------------------------------------------------------
/static/images/header-home.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/TruthHun/BookChatApp/5b334ce986c7e5309eef38043fd2ead97c931b9e/static/images/header-home.png
--------------------------------------------------------------------------------
/static/images/history.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/TruthHun/BookChatApp/5b334ce986c7e5309eef38043fd2ead97c931b9e/static/images/history.png
--------------------------------------------------------------------------------
/static/images/home-black.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/TruthHun/BookChatApp/5b334ce986c7e5309eef38043fd2ead97c931b9e/static/images/home-black.png
--------------------------------------------------------------------------------
/static/images/home-selected.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/TruthHun/BookChatApp/5b334ce986c7e5309eef38043fd2ead97c931b9e/static/images/home-selected.png
--------------------------------------------------------------------------------
/static/images/home.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/TruthHun/BookChatApp/5b334ce986c7e5309eef38043fd2ead97c931b9e/static/images/home.png
--------------------------------------------------------------------------------
/static/images/loading-white.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/TruthHun/BookChatApp/5b334ce986c7e5309eef38043fd2ead97c931b9e/static/images/loading-white.png
--------------------------------------------------------------------------------
/static/images/loading.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/TruthHun/BookChatApp/5b334ce986c7e5309eef38043fd2ead97c931b9e/static/images/loading.gif
--------------------------------------------------------------------------------
/static/images/loading.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/TruthHun/BookChatApp/5b334ce986c7e5309eef38043fd2ead97c931b9e/static/images/loading.png
--------------------------------------------------------------------------------
/static/images/login.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/TruthHun/BookChatApp/5b334ce986c7e5309eef38043fd2ead97c931b9e/static/images/login.png
--------------------------------------------------------------------------------
/static/images/logo.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/TruthHun/BookChatApp/5b334ce986c7e5309eef38043fd2ead97c931b9e/static/images/logo.png
--------------------------------------------------------------------------------
/static/images/me-selected.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/TruthHun/BookChatApp/5b334ce986c7e5309eef38043fd2ead97c931b9e/static/images/me-selected.png
--------------------------------------------------------------------------------
/static/images/me.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/TruthHun/BookChatApp/5b334ce986c7e5309eef38043fd2ead97c931b9e/static/images/me.png
--------------------------------------------------------------------------------
/static/images/menu.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/TruthHun/BookChatApp/5b334ce986c7e5309eef38043fd2ead97c931b9e/static/images/menu.png
--------------------------------------------------------------------------------
/static/images/more.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/TruthHun/BookChatApp/5b334ce986c7e5309eef38043fd2ead97c931b9e/static/images/more.png
--------------------------------------------------------------------------------
/static/images/next-disable.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/TruthHun/BookChatApp/5b334ce986c7e5309eef38043fd2ead97c931b9e/static/images/next-disable.png
--------------------------------------------------------------------------------
/static/images/next.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/TruthHun/BookChatApp/5b334ce986c7e5309eef38043fd2ead97c931b9e/static/images/next.png
--------------------------------------------------------------------------------
/static/images/pre-disable.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/TruthHun/BookChatApp/5b334ce986c7e5309eef38043fd2ead97c931b9e/static/images/pre-disable.png
--------------------------------------------------------------------------------
/static/images/pre.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/TruthHun/BookChatApp/5b334ce986c7e5309eef38043fd2ead97c931b9e/static/images/pre.png
--------------------------------------------------------------------------------
/static/images/rank.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/TruthHun/BookChatApp/5b334ce986c7e5309eef38043fd2ead97c931b9e/static/images/rank.png
--------------------------------------------------------------------------------
/static/images/read-white.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/TruthHun/BookChatApp/5b334ce986c7e5309eef38043fd2ead97c931b9e/static/images/read-white.png
--------------------------------------------------------------------------------
/static/images/read.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/TruthHun/BookChatApp/5b334ce986c7e5309eef38043fd2ead97c931b9e/static/images/read.png
--------------------------------------------------------------------------------
/static/images/readed.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/TruthHun/BookChatApp/5b334ce986c7e5309eef38043fd2ead97c931b9e/static/images/readed.png
--------------------------------------------------------------------------------
/static/images/recycle.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/TruthHun/BookChatApp/5b334ce986c7e5309eef38043fd2ead97c931b9e/static/images/recycle.png
--------------------------------------------------------------------------------
/static/images/refresh-o.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/TruthHun/BookChatApp/5b334ce986c7e5309eef38043fd2ead97c931b9e/static/images/refresh-o.png
--------------------------------------------------------------------------------
/static/images/reg.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/TruthHun/BookChatApp/5b334ce986c7e5309eef38043fd2ead97c931b9e/static/images/reg.png
--------------------------------------------------------------------------------
/static/images/report.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/TruthHun/BookChatApp/5b334ce986c7e5309eef38043fd2ead97c931b9e/static/images/report.png
--------------------------------------------------------------------------------
/static/images/right-angle.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/TruthHun/BookChatApp/5b334ce986c7e5309eef38043fd2ead97c931b9e/static/images/right-angle.png
--------------------------------------------------------------------------------
/static/images/search-black.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/TruthHun/BookChatApp/5b334ce986c7e5309eef38043fd2ead97c931b9e/static/images/search-black.png
--------------------------------------------------------------------------------
/static/images/search.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/TruthHun/BookChatApp/5b334ce986c7e5309eef38043fd2ead97c931b9e/static/images/search.png
--------------------------------------------------------------------------------
/static/images/share.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/TruthHun/BookChatApp/5b334ce986c7e5309eef38043fd2ead97c931b9e/static/images/share.png
--------------------------------------------------------------------------------
/static/images/sign.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/TruthHun/BookChatApp/5b334ce986c7e5309eef38043fd2ead97c931b9e/static/images/sign.png
--------------------------------------------------------------------------------
/static/images/signed.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/TruthHun/BookChatApp/5b334ce986c7e5309eef38043fd2ead97c931b9e/static/images/signed.png
--------------------------------------------------------------------------------
/static/images/sprite_star.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/TruthHun/BookChatApp/5b334ce986c7e5309eef38043fd2ead97c931b9e/static/images/sprite_star.png
--------------------------------------------------------------------------------
/static/images/star-half.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/TruthHun/BookChatApp/5b334ce986c7e5309eef38043fd2ead97c931b9e/static/images/star-half.png
--------------------------------------------------------------------------------
/static/images/star-highlight.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/TruthHun/BookChatApp/5b334ce986c7e5309eef38043fd2ead97c931b9e/static/images/star-highlight.png
--------------------------------------------------------------------------------
/static/images/star-selected.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/TruthHun/BookChatApp/5b334ce986c7e5309eef38043fd2ead97c931b9e/static/images/star-selected.png
--------------------------------------------------------------------------------
/static/images/star.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/TruthHun/BookChatApp/5b334ce986c7e5309eef38043fd2ead97c931b9e/static/images/star.png
--------------------------------------------------------------------------------
/static/images/wxcode-black.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/TruthHun/BookChatApp/5b334ce986c7e5309eef38043fd2ead97c931b9e/static/images/wxcode-black.png
--------------------------------------------------------------------------------
/unpackage/images/alipay.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/TruthHun/BookChatApp/5b334ce986c7e5309eef38043fd2ead97c931b9e/unpackage/images/alipay.jpg
--------------------------------------------------------------------------------
/unpackage/images/book-intro-2.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/TruthHun/BookChatApp/5b334ce986c7e5309eef38043fd2ead97c931b9e/unpackage/images/book-intro-2.png
--------------------------------------------------------------------------------
/unpackage/images/book-intro.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/TruthHun/BookChatApp/5b334ce986c7e5309eef38043fd2ead97c931b9e/unpackage/images/book-intro.png
--------------------------------------------------------------------------------
/unpackage/images/bookshelf.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/TruthHun/BookChatApp/5b334ce986c7e5309eef38043fd2ead97c931b9e/unpackage/images/bookshelf.png
--------------------------------------------------------------------------------
/unpackage/images/category.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/TruthHun/BookChatApp/5b334ce986c7e5309eef38043fd2ead97c931b9e/unpackage/images/category.png
--------------------------------------------------------------------------------
/unpackage/images/index.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/TruthHun/BookChatApp/5b334ce986c7e5309eef38043fd2ead97c931b9e/unpackage/images/index.png
--------------------------------------------------------------------------------
/unpackage/images/iphone/bookshelf.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/TruthHun/BookChatApp/5b334ce986c7e5309eef38043fd2ead97c931b9e/unpackage/images/iphone/bookshelf.png
--------------------------------------------------------------------------------
/unpackage/images/iphone/category.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/TruthHun/BookChatApp/5b334ce986c7e5309eef38043fd2ead97c931b9e/unpackage/images/iphone/category.png
--------------------------------------------------------------------------------
/unpackage/images/iphone/index.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/TruthHun/BookChatApp/5b334ce986c7e5309eef38043fd2ead97c931b9e/unpackage/images/iphone/index.png
--------------------------------------------------------------------------------
/unpackage/images/iphone/intro.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/TruthHun/BookChatApp/5b334ce986c7e5309eef38043fd2ead97c931b9e/unpackage/images/iphone/intro.png
--------------------------------------------------------------------------------
/unpackage/images/iphone/loading.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/TruthHun/BookChatApp/5b334ce986c7e5309eef38043fd2ead97c931b9e/unpackage/images/iphone/loading.png
--------------------------------------------------------------------------------
/unpackage/images/iphone/me.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/TruthHun/BookChatApp/5b334ce986c7e5309eef38043fd2ead97c931b9e/unpackage/images/iphone/me.png
--------------------------------------------------------------------------------
/unpackage/images/iphone/read.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/TruthHun/BookChatApp/5b334ce986c7e5309eef38043fd2ead97c931b9e/unpackage/images/iphone/read.png
--------------------------------------------------------------------------------
/unpackage/images/iphone/search.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/TruthHun/BookChatApp/5b334ce986c7e5309eef38043fd2ead97c931b9e/unpackage/images/iphone/search.png
--------------------------------------------------------------------------------
/unpackage/images/login.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/TruthHun/BookChatApp/5b334ce986c7e5309eef38043fd2ead97c931b9e/unpackage/images/login.png
--------------------------------------------------------------------------------
/unpackage/images/me.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/TruthHun/BookChatApp/5b334ce986c7e5309eef38043fd2ead97c931b9e/unpackage/images/me.png
--------------------------------------------------------------------------------
/unpackage/images/read-menu.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/TruthHun/BookChatApp/5b334ce986c7e5309eef38043fd2ead97c931b9e/unpackage/images/read-menu.png
--------------------------------------------------------------------------------
/unpackage/images/read-setting.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/TruthHun/BookChatApp/5b334ce986c7e5309eef38043fd2ead97c931b9e/unpackage/images/read-setting.png
--------------------------------------------------------------------------------
/unpackage/images/read.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/TruthHun/BookChatApp/5b334ce986c7e5309eef38043fd2ead97c931b9e/unpackage/images/read.png
--------------------------------------------------------------------------------
/unpackage/images/search-book-2.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/TruthHun/BookChatApp/5b334ce986c7e5309eef38043fd2ead97c931b9e/unpackage/images/search-book-2.png
--------------------------------------------------------------------------------
/unpackage/images/search-book.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/TruthHun/BookChatApp/5b334ce986c7e5309eef38043fd2ead97c931b9e/unpackage/images/search-book.png
--------------------------------------------------------------------------------
/unpackage/images/wxpay.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/TruthHun/BookChatApp/5b334ce986c7e5309eef38043fd2ead97c931b9e/unpackage/images/wxpay.jpg
--------------------------------------------------------------------------------
/unpackage/res/icons/1024x1024.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/TruthHun/BookChatApp/5b334ce986c7e5309eef38043fd2ead97c931b9e/unpackage/res/icons/1024x1024.png
--------------------------------------------------------------------------------
/unpackage/res/icons/120x120.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/TruthHun/BookChatApp/5b334ce986c7e5309eef38043fd2ead97c931b9e/unpackage/res/icons/120x120.png
--------------------------------------------------------------------------------
/unpackage/res/icons/144x144.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/TruthHun/BookChatApp/5b334ce986c7e5309eef38043fd2ead97c931b9e/unpackage/res/icons/144x144.png
--------------------------------------------------------------------------------
/unpackage/res/icons/152x152.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/TruthHun/BookChatApp/5b334ce986c7e5309eef38043fd2ead97c931b9e/unpackage/res/icons/152x152.png
--------------------------------------------------------------------------------
/unpackage/res/icons/167x167.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/TruthHun/BookChatApp/5b334ce986c7e5309eef38043fd2ead97c931b9e/unpackage/res/icons/167x167.png
--------------------------------------------------------------------------------
/unpackage/res/icons/180x180.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/TruthHun/BookChatApp/5b334ce986c7e5309eef38043fd2ead97c931b9e/unpackage/res/icons/180x180.png
--------------------------------------------------------------------------------
/unpackage/res/icons/192x192.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/TruthHun/BookChatApp/5b334ce986c7e5309eef38043fd2ead97c931b9e/unpackage/res/icons/192x192.png
--------------------------------------------------------------------------------
/unpackage/res/icons/20x20.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/TruthHun/BookChatApp/5b334ce986c7e5309eef38043fd2ead97c931b9e/unpackage/res/icons/20x20.png
--------------------------------------------------------------------------------
/unpackage/res/icons/29x29.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/TruthHun/BookChatApp/5b334ce986c7e5309eef38043fd2ead97c931b9e/unpackage/res/icons/29x29.png
--------------------------------------------------------------------------------
/unpackage/res/icons/40x40.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/TruthHun/BookChatApp/5b334ce986c7e5309eef38043fd2ead97c931b9e/unpackage/res/icons/40x40.png
--------------------------------------------------------------------------------
/unpackage/res/icons/58x58.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/TruthHun/BookChatApp/5b334ce986c7e5309eef38043fd2ead97c931b9e/unpackage/res/icons/58x58.png
--------------------------------------------------------------------------------
/unpackage/res/icons/60x60.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/TruthHun/BookChatApp/5b334ce986c7e5309eef38043fd2ead97c931b9e/unpackage/res/icons/60x60.png
--------------------------------------------------------------------------------
/unpackage/res/icons/72x72.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/TruthHun/BookChatApp/5b334ce986c7e5309eef38043fd2ead97c931b9e/unpackage/res/icons/72x72.png
--------------------------------------------------------------------------------
/unpackage/res/icons/76x76.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/TruthHun/BookChatApp/5b334ce986c7e5309eef38043fd2ead97c931b9e/unpackage/res/icons/76x76.png
--------------------------------------------------------------------------------
/unpackage/res/icons/80x80.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/TruthHun/BookChatApp/5b334ce986c7e5309eef38043fd2ead97c931b9e/unpackage/res/icons/80x80.png
--------------------------------------------------------------------------------
/unpackage/res/icons/87x87.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/TruthHun/BookChatApp/5b334ce986c7e5309eef38043fd2ead97c931b9e/unpackage/res/icons/87x87.png
--------------------------------------------------------------------------------
/unpackage/res/icons/96x96.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/TruthHun/BookChatApp/5b334ce986c7e5309eef38043fd2ead97c931b9e/unpackage/res/icons/96x96.png
--------------------------------------------------------------------------------
/utils/api.js:
--------------------------------------------------------------------------------
1 | import config from '../config.js'
2 | import util from "./util.js"
3 |
4 | const keyCategories = 'categories';
5 | const keyCacheExpire = 'categories-expire';
6 | const expire = 1800; // 1800 seconds
7 |
8 | // 获取书籍分类
9 | const getCategories = () => {
10 | if (config.debug) console.log(config.api.categories);
11 | // 从缓存中读取,判断缓存存不存在,并且有没有过期
12 | return new Promise((resolve, reject) => {
13 | let categories = {};
14 | let now = util.now();
15 | let value
16 | let cacheExpire = parseInt(uni.getStorageSync(keyCacheExpire))
17 | if (cacheExpire > now) {
18 | try {
19 | value = uni.getStorageSync(keyCategories)
20 | if (value) value = JSON.parse(value)
21 | } catch (e) {
22 | console.log(e)
23 | }
24 | }
25 |
26 | if (value) {
27 | if (config.debug) console.log("从缓存中获取分类数据");
28 | resolve(value);
29 | } else {
30 | if (config.debug) console.log("从接口获取数据");
31 | util.request(config.api.categories).then(function(res) {
32 | let tree = util.menuToTree(res.data.categories)
33 | uni.setStorageSync(keyCategories, JSON.stringify(tree))
34 | uni.setStorageSync(keyCacheExpire, now + expire)
35 | resolve(tree)
36 | }).catch(function(e) {
37 | reject(e)
38 | })
39 | }
40 | });
41 | }
42 |
43 | const getCategoryByCid = (cid) => {
44 | return getCategories().then((categories) => {
45 | let found = false
46 | let category = {}
47 | for (let i = 0; found == false && i < categories.length; i++) {
48 | if (cid == categories[i].id) {
49 | found = true
50 | category = categories[i]
51 | } else if (categories[i].children.length>0){
52 | let children = categories[i].children
53 | for (let i = 0; found == false && i < children.length; i++) {
54 | if (cid == children[i].id) {
55 | found = true
56 | category = children[i]
57 | }
58 | }
59 | }
60 | }
61 | return category
62 | })
63 | }
64 |
65 |
66 | module.exports = {
67 | getCategories,
68 | getCategoryByCid,
69 | }
--------------------------------------------------------------------------------
/utils/util.js:
--------------------------------------------------------------------------------
1 | const keyUser = 'user'
2 | const keyWeChatUser = 'wechat-user'
3 | const keyMenu = 'menu'
4 | const keyReaderSetting = 'reader-setting'
5 | const keySysInfo = 'sys-info'
6 | const keySign = 'sign'
7 |
8 | const formatTime = date => {
9 | const year = date.getFullYear()
10 | const month = date.getMonth() + 1
11 | const day = date.getDate()
12 | const hour = date.getHours()
13 | const minute = date.getMinutes()
14 | const second = date.getSeconds()
15 |
16 | return [year, month, day].map(formatNumber).join('/') + ' ' + [hour, minute, second].map(formatNumber).join(':')
17 | }
18 |
19 | const timestampToDate = (timestamp) => {
20 | let date = new Date(timestamp * 1000)
21 | const year = date.getFullYear()
22 | const month = date.getMonth() + 1
23 | const day = date.getDate()
24 | return [year, month, day].map(formatNumber).join('/')
25 | }
26 |
27 | const formatNumber = n => {
28 | n = n.toString()
29 | return n[1] ? n : '0' + n
30 | }
31 |
32 | const now = () => {
33 | return parseInt(new Date().getTime() / 1000)
34 | }
35 |
36 | const toTimestamp = t => {
37 | return parseInt(new Date(t).getTime() / 1000)
38 | }
39 |
40 | const relativeTime = t => {
41 |
42 | let timestamp = toTimestamp(t)
43 | let n = now()
44 | let diff = n - timestamp
45 | let minute = 60;
46 | let hour = minute * 60;
47 | let day = hour * 24;
48 | let month = day * 30;
49 |
50 | let monthC = diff / month;
51 | let dayC = diff / day;
52 | let hourC = diff / hour;
53 | let minC = diff / minute;
54 |
55 | if (monthC > 12) {
56 | return parseInt(monthC / 12) + " 年前";
57 | } else if (monthC >= 1) {
58 | return parseInt(monthC) + " 月前";
59 | } else if (dayC >= 1) {
60 | return parseInt(dayC) + " 天前";
61 | } else if (hourC >= 1) {
62 | return parseInt(hourC) + " 小时前";
63 | } else if (minC >= 1) {
64 | return parseInt(minC) + " 分钟前";
65 | }
66 | return '刚刚';
67 | }
68 |
69 | const clearUser = () => {
70 | uni.setStorageSync(keyUser, '{}')
71 | }
72 |
73 | const setUser = (user) => {
74 | uni.setStorageSync(keyUser, JSON.stringify(user))
75 | }
76 |
77 | const getUser = () => {
78 | try {
79 | var value = uni.getStorageSync(keyUser)
80 | if (value) {
81 | return JSON.parse(value)
82 | }
83 | } catch (e) {
84 | // Do something when catch error
85 | console.log(e)
86 | return {}
87 | }
88 | }
89 |
90 | const setWeChatUser = (user) => {
91 | uni.setStorageSync(keyWeChatUser, JSON.stringify(user))
92 | }
93 |
94 | const getWeChatUser = () => {
95 | try {
96 | var value = uni.getStorageSync(keyWeChatUser)
97 | if (value) {
98 | return JSON.parse(value)
99 | }
100 | } catch (e) {
101 | // Do something when catch error
102 | console.log(e)
103 | return {}
104 | }
105 | }
106 |
107 | const getToken = () => {
108 | let user = getUser()
109 | if (user && user.token != undefined) {
110 | return user.token
111 | }
112 | return ""
113 | }
114 |
115 | const redirect = (uriWithDecode) => {
116 | // 带问号的,用 redirectTo,不带问号的,用switchTab
117 | if (uriWithDecode.indexOf("?") > -1) {
118 | uni.redirectTo({
119 | url: uriWithDecode,
120 | })
121 | } else {
122 | uni.switchTab({
123 | url: uriWithDecode,
124 | })
125 | }
126 | }
127 |
128 | //添加事件结束
129 | Promise.prototype.finally = function(callback) {
130 | var Promise = this.constructor;
131 | return this.then(
132 | function(value) {
133 | Promise.resolve(callback()).then(
134 | function() {
135 | return value;
136 | }
137 | );
138 | },
139 | function(reason) {
140 | Promise.resolve(callback()).then(
141 | function() {
142 | throw reason;
143 | }
144 | );
145 | }
146 | );
147 | }
148 |
149 | const _getVersion = () => {
150 | let version = getSysInfo().appVersion
151 | if (version != undefined && version != "") return version
152 | return ''
153 | }
154 |
155 | // 只有请求结果返回 200 的时候,才会resolve,否则reject
156 | const request = (api, params = {}, method = "GET", header = {}) => {
157 | return new Promise(function(resolve, reject) {
158 | if (!header["content-type"]) {
159 | header["content-type"] = "application/json"
160 | }
161 |
162 | if (method.toUpperCase() == 'POST') header["content-type"] = "application/x-www-form-urlencoded"
163 |
164 | let token = getToken()
165 | if (token) header['authorization'] = token
166 |
167 | header['x-version'] = _getVersion()
168 |
169 | uni.request({
170 | url: api,
171 | data: params,
172 | method: method,
173 | header: header,
174 | success: function(res) {
175 | if (res.statusCode == 200) {
176 | resolve(res.data);
177 | } else {
178 | if (res.statusCode == 401) clearUser()
179 | reject(res);
180 | }
181 | },
182 | fail: function(err) {
183 | reject(err)
184 | }
185 | })
186 | });
187 | }
188 |
189 | const loading = (title) => {
190 | title = title ? title : '玩命加载中...'
191 | uni.showLoading({
192 | title: title,
193 | mask: false,
194 | })
195 | }
196 |
197 | const toastError = (content) => {
198 | uni.showToast({
199 | title: content,
200 | icon: 'none',
201 | duration: 3000
202 | })
203 | }
204 |
205 | const toastSuccess = (content) => {
206 | uni.showToast({
207 | title: content,
208 | })
209 | }
210 |
211 | const fixView = (view) => {
212 | if (view > 10000) {
213 | view = (view / 10000).toFixed(1) + "w"
214 | } else if (view > 1000) {
215 | view = (view / 1000).toFixed(1) + "k"
216 | }
217 | return view
218 | }
219 |
220 |
221 | function isEmail(email) {
222 | let pattern = /^([A-Za-z0-9_\-\.])+\@([A-Za-z0-9_\-\.])+\.([A-Za-z]{2,4})$/
223 | return pattern.test(email);
224 | }
225 |
226 | const _findChildren = (menu, pid) => {
227 | let children = []
228 | let left = []
229 | for (let i = 0; i < menu.length; i++) {
230 | if (menu[i].pid == pid) {
231 | children.push(menu[i])
232 | } else {
233 | left.push(menu[i])
234 | }
235 | }
236 | return left, children
237 | }
238 |
239 | const menuToTree = (menu) => {
240 | // 来自这篇博客,谢谢: https://blog.csdn.net/u013373006/article/details/82108873
241 | menu.forEach(function(item) {
242 | delete item.children;
243 | });
244 | var map = {};
245 | menu.forEach(function(item) {
246 | map[item.id] = item;
247 | });
248 | var val = [];
249 | menu.forEach(function(item) {
250 | var parent = map[item.pid];
251 | if (parent) {
252 | (parent.children || (parent.children = [])).push(item);
253 | } else {
254 | val.push(item);
255 | }
256 | });
257 | return val;
258 | }
259 |
260 | const menuSortIds = (menuTree) => {
261 | let docs = []
262 | for (let i in menuTree) {
263 | docs.push(menuTree[i].id)
264 | if (menuTree[i].children) {
265 | docs = docs.concat(menuSortIds(menuTree[i].children))
266 | }
267 | }
268 | return docs
269 | }
270 |
271 | const menuTreeReaded = (menuTree, docId) => {
272 | for (let i in menuTree) {
273 | if (menuTree[i].id == docId) {
274 | menuTree[i].readed = true
275 | break
276 | }
277 | if (menuTree[i].children) {
278 | menuTree[i].children = menuTreeReaded(menuTree[i].children, docId)
279 | }
280 | }
281 | return menuTree
282 | }
283 |
284 | const setReaderSetting = (obj) => {
285 | uni.setStorageSync(keyReaderSetting, JSON.stringify(obj))
286 | }
287 |
288 | const getReaderSetting = () => {
289 | let val = uni.getStorageSync(keyReaderSetting)
290 | if (!val) {
291 | return {
292 | themeIndex: 0,
293 | fontIndex: 0
294 | }
295 | }
296 | val = JSON.parse(val)
297 | if (val.themeIndex == undefined) val.themeIndex = 0
298 | if (val.fontIndex == undefined) val.fontIndex = 0
299 | return val
300 | }
301 |
302 | const setSysInfo = (obj) => {
303 | uni.setStorageSync(keySysInfo, JSON.stringify(obj))
304 | }
305 |
306 | const formatReading = (seconds) => {
307 | let reading = {
308 | hour: 0,
309 | min: 0,
310 | }
311 | let hour = 3600
312 | if (seconds <= 0) {
313 | return reading
314 | }
315 | reading.hour = parseInt(seconds / hour)
316 | reading.min = parseInt((seconds - (hour * reading.hour)) / 60)
317 | return reading
318 | }
319 |
320 | const getSysInfo = () => {
321 | let val = uni.getStorageSync(keySysInfo)
322 | if (!val) {
323 | return {
324 | windowWidth: 0,
325 | windowHeight: 0,
326 | baseWidth: 0,
327 | baseHeight: 0,
328 | }
329 | }
330 | return JSON.parse(val)
331 | }
332 |
333 | const setSignedAt = (timestamp) => {
334 | // timestamp = 0 表示重置签到时间
335 | if (timestamp == 0 || timestamp > getSignedAt()) uni.setStorageSync(keySign, timestamp)
336 | }
337 |
338 | const getSignedAt = () => {
339 | let signedAt = uni.getStorageSync(keySign) || 0
340 | return parseInt(signedAt)
341 | }
342 |
343 | const isSignedToday = () => {
344 | return timestampToDate(now()) == timestampToDate(getSignedAt())
345 | }
346 |
347 |
348 | module.exports = {
349 | formatTime,
350 | now,
351 | toTimestamp,
352 | relativeTime,
353 | request,
354 | loading,
355 | toastError,
356 | toastSuccess,
357 | setUser,
358 | setWeChatUser,
359 | clearUser,
360 | getUser,
361 | getWeChatUser,
362 | getToken,
363 | menuToTree,
364 | menuSortIds,
365 | menuTreeReaded,
366 | setReaderSetting,
367 | getReaderSetting,
368 | isEmail,
369 | getSysInfo,
370 | setSysInfo,
371 | fixView,
372 | formatReading,
373 | setSignedAt,
374 | getSignedAt,
375 | isSignedToday,
376 | redirect,
377 | }
378 |
--------------------------------------------------------------------------------