├── README.md
├── app.js
├── app.json
├── app.wxss
├── assets
├── css
│ └── common.wxss
├── icon
│ └── iconfont.wxss
├── images
│ ├── 44.png
│ ├── name.png
│ ├── ncode.jpg
│ ├── share.jpg
│ └── wx_04.jpg
└── nav
│ ├── home.png
│ ├── home_fill.png
│ ├── project.png
│ ├── project_fill.png
│ ├── user.png
│ └── user_fill.png
├── components
├── backtop
│ ├── backtop.js
│ ├── backtop.json
│ ├── backtop.wxml
│ └── backtop.wxss
├── bottombar
│ ├── bottombar.js
│ ├── bottombar.json
│ ├── bottombar.wxml
│ └── bottombar.wxss
├── copyright
│ ├── copyright.js
│ ├── copyright.json
│ ├── copyright.wxml
│ └── copyright.wxss
├── loading
│ ├── loading.js
│ ├── loading.json
│ ├── loading.wxml
│ └── loading.wxss
├── modal
│ ├── modal.js
│ ├── modal.json
│ ├── modal.wxml
│ └── modal.wxss
├── nomore
│ ├── comment.wxml
│ ├── nomore.js
│ ├── nomore.json
│ ├── nomore.wxml
│ └── nomore.wxss
├── photo
│ ├── photo.js
│ ├── photo.json
│ ├── photo.wxml
│ └── photo.wxss
└── share
│ ├── share.js
│ ├── share.json
│ ├── share.wxml
│ └── share.wxss
├── pages
├── about
│ ├── about.js
│ ├── about.json
│ ├── about.wxml
│ └── about.wxss
├── comm.wxs
├── detail
│ ├── detail.js
│ ├── detail.json
│ ├── detail.wxml
│ └── detail.wxss
├── feedback
│ ├── feedback.js
│ ├── feedback.json
│ ├── feedback.wxml
│ └── feedback.wxss
├── index
│ ├── index.js
│ ├── index.json
│ ├── index.wxml
│ └── index.wxss
├── lists
│ ├── lists.js
│ ├── lists.json
│ ├── lists.wxml
│ └── lists.wxss
├── me
│ ├── me.js
│ ├── me.json
│ ├── me.wxml
│ └── me.wxss
├── more
│ ├── more.js
│ ├── more.json
│ ├── more.wxml
│ └── more.wxss
└── project
│ ├── project.js
│ ├── project.json
│ ├── project.wxml
│ └── project.wxss
├── project.config.json
├── sitemap.json
├── utils
├── api.js
├── login.js
├── request.js
└── util.js
└── wxParse
├── html2json.js
├── htmlparser.js
├── showdown.js
├── wxDiscode.js
├── wxParse.js
├── wxParse.wxml
└── wxParse.wxss
/README.md:
--------------------------------------------------------------------------------
1 | # KAPO博客
2 | 这是用微信小程序做的一个自己的博客, 喜欢记得star哟!
3 |
4 | 长期维护版本,欢迎大家踊跃提交贡献代码,
5 |
6 | 更多项目请关注 [https://github.com/Rose-GoGo](https://github.com/Rose-GoGo)。
7 |
8 | 期待您的加入~ ,欢迎大家踊跃提交代码,
9 |
10 | 开发问题欢迎一起交流: QQ:583459700
11 |
12 | 注: 若小伙伴需使用代码,请在您的博客中添加我的友情链接 KAPO博客:[https://www.zhmzjl.com/](https://www.zhmzjl.com.com/), 就这一点要求,忘满足!
13 |
14 |
15 |
16 | ## 扫码体验
17 |
18 |

19 |
20 |
21 | ## 项目截图
22 |
23 |
24 |
25 |
26 |
27 |
28 | ## 博客主要分为三大模块: 文章/项目/我
29 |
30 | - 文章:主要记录我在开发中遇到的问题,并且记录下来,作为技术分享
31 |
32 | - 项目: 主要记录我做的一些项目,并且对项目的理解和介绍
33 |
34 | - 我:主要分为4大模块,我的简介、打卡、意见反馈、感谢。最近读一本叫《微习惯》的书籍,然后给自己做了几个打卡的功能,算是自己监督自己。虽然现在很多现在这样的小程序,但是自己做的应该会更有意义。
35 |
36 |
37 |
38 | ## 版本更新细信息
39 |
40 | #### Version 2.0.1 开发中
41 | - 文章详情页添加点赞功能
42 | - 评论添加服务通知功能
43 | - 修改打卡翻年后数据无法依旧显示前一年数据的bug,
44 | - 添加海报保存功能
45 | - 添加绑定微信公众号,添加联系我的功能
46 | - 多词搜索全文内容
47 | - 小程序内添加文章
48 |
49 |
50 |
51 | #### Version 2.0.0
52 | - 修改设计与结构,博客改为首页-分类-我三大板块,原有的项目改到‘我’中
53 | - 文章详情页添加desciption
54 | - 更换背景音乐, 原有的改为 'qianbenyin'
55 | - 打卡删除添加确认删除操作,避免误删
56 |
57 |
58 | #### Version 1.0.8
59 | - 添加背景音乐
60 | - 文章详情页添加到首页的链接
61 | - 打卡进行数据请求,如果本月数据小于5条,请求一次上个月的数据
62 | - 打卡的收缩功能点击的时候,请求下一个月的数据
63 | - 文章列表页的分类向下滚动隐藏 向上滚动就显示出来
64 |
65 |
66 | #### Version 1.0.7
67 | - 打卡中json数据乱序的问题
68 | - 文章详情页添加PC文章地址
69 | - 添加返回顶部
70 | - 截图保存分享
71 | - 数据加载失败后,弹框后点击重新拉取数据
72 | - 打卡添加为富文本编辑器?
73 | - 摇一摇访问我的小程序或者添加我为好友?
74 | - 授权问题,授权后验证是否是Rose本人,如果是,才能在前台对数据进行增删改查操作
75 |
76 |
77 | #### Version 1.0.6
78 | - 打卡页点击编辑内容,网页返回到顶部编辑部分
79 | - 禁止评论输入为空格的bug
80 | - 修改留言页的设计
81 | - 文章详情页添加推荐阅读功能
82 | - 打赏功能自定义模态框且添加分享功能
83 | - 文章详情页代码不能换行问题
84 |
85 |
86 | #### Version 1.0.5
87 | - 文章列表与首页添加阅读量与作者
88 | - 文章详情页授权通过后才能评论的bug
89 | - 未授权无法打卡
90 | - 简历下载?
91 | - 打赏功能(支付对个人似乎有问题,计划保留中)
92 |
93 |
94 | #### Version 1.0.4
95 | - 添加公告模块信息;
96 | - 文章添加评论功能;
97 | - 更新Rose Zhao的个人信息;
98 | - 打卡修复月初数据加载异常bug;
99 | - 代码优化,去除项目详情页的代码,并归入文章详情页;
100 |
101 | #### Version 1.0.3
102 | - 首页文章列表图片的高宽解除限制;
103 | - 修改文章列表的选项卡的表现形式;
104 | - 添加数据加载的loading效果;
105 | - 调整打卡顺序;
106 |
107 | #### Version 1.0.2
108 | - 打卡功能添加图片
109 | - 首页添加下拉刷新功能
110 |
111 |
112 | ## 博客PC地址
113 | 欢迎大家关注我的博客,PC地址: [https://www.zhmzjl.com/](https://www.zhmzjl.com.com/)
114 | 此小程序仅供学习,不得以任何形式商用。
115 |
116 | ## 联系我?
117 | 有任何建议和意见都可以提哟,欢迎指正!
118 |
119 |
120 |
--------------------------------------------------------------------------------
/app.js:
--------------------------------------------------------------------------------
1 | //app.js
2 | var common = require('utils/login.js');
3 | App({
4 | onLoad: function (options) {
5 | },
6 | onShow: function (option) {},
7 | onPageNotFound: function (res) { },
8 | onLaunch: function () {
9 | let that = this;
10 | that.AppMusic = wx.createInnerAudioContext();
11 | that.AppMusic.autoplay = true;
12 | that.AppMusic.src = 'https://zhmzjl.com/statics/images/blog/qianbenyin.mp3';
13 | that.AppMusic.loop = true;
14 | that.AppMusic.volume = 0.05;
15 | that.AppMusic.onPlay(() => {
16 | })
17 | that.AppMusic.onError((res) => {
18 | });
19 | that.autoUpdate();
20 | },
21 | autoUpdate() {
22 | var self = this
23 | // 获取小程序更新机制兼容
24 | if (wx.canIUse('getUpdateManager')) {
25 | const updateManager = wx.getUpdateManager()
26 | //1. 检查小程序是否有新版本发布
27 | updateManager.onCheckForUpdate(function (res) {
28 | // 请求完新版本信息的回调
29 | if (res.hasUpdate) {
30 | //2. 小程序有新版本,则静默下载新版本,做好更新准备
31 | updateManager.onUpdateReady(function () {
32 | wx.showModal({
33 | title: '更新提示',
34 | content: '新版本已经准备好,是否重启?',
35 | success: function (res) {
36 | if (res.confirm) {
37 | //3. 新的版本已经下载好,调用 applyUpdate 应用新版本并重启
38 | updateManager.applyUpdate()
39 | } else if (res.cancel) {
40 | //如果需要强制更新,则给出二次弹窗,如果不需要,则这里的代码都可以删掉了
41 | wx.showModal({
42 | title: '温馨提示~',
43 | content: '本次版本更新涉及到新的功能添加,旧版本无法正常访问的哦~',
44 | success: function (res) {
45 | self.autoUpdate()
46 | return;
47 | //第二次提示后,强制更新
48 | if (res.confirm) {
49 | // 新的版本已经下载好,调用 applyUpdate 应用新版本并重启
50 | updateManager.applyUpdate()
51 | } else if (res.cancel) {
52 | //重新回到版本更新提示
53 | self.autoUpdate()
54 | }
55 | }
56 | })
57 | }
58 | }
59 | })
60 | })
61 | updateManager.onUpdateFailed(function () {
62 | // 新的版本下载失败
63 | wx.showModal({
64 | title: '已经有新版本了哟~',
65 | content: `新版本已经上线啦~,请您删除当前小程序,重新搜索打开哟~`,
66 | })
67 | })
68 | }
69 | })
70 | } else {
71 | // 如果希望用户在最新版本的客户端上体验您的小程序,可以这样子提示
72 | wx.showModal({
73 | title: '提示',
74 | content: `当前微信版本过低,无法使用该功能,请升级到最新微信版本后重试。`
75 | })
76 | }
77 | },
78 | globalData: {
79 | kinds: [{
80 | icon: 'icon-quanju',
81 | name: '前端',
82 | catid: '11'
83 | }, {
84 | icon: 'icon-anquan',
85 | name: '安全',
86 | catid: '12'
87 | },
88 | {
89 | icon: 'icon-xiazai47',
90 | name: '生活',
91 | catid: '13'
92 | }],
93 | userInfo: {}
94 | }
95 | })
96 |
--------------------------------------------------------------------------------
/app.json:
--------------------------------------------------------------------------------
1 | {
2 | "pages": [
3 | "pages/index/index",
4 | "pages/detail/detail",
5 | "pages/about/about",
6 | "pages/project/project",
7 | "pages/more/more",
8 | "pages/feedback/feedback",
9 | "pages/lists/lists",
10 | "pages/me/me"
11 | ],
12 | "window": {
13 | "backgroundTextStyle": "light",
14 | "navigationBarBackgroundColor": "#1d8f59",
15 | "navigationBarTitleText": "KAPO博客-记录学习和生活",
16 | "navigationBarTextStyle": "white",
17 | "enablePullDownRefresh": true,
18 | "onReachBottomDistance": 50
19 | },
20 | "tabBar": {
21 | "color": "#fff",
22 | "position": "bottom",
23 | "backgroundColor": "#4bb777",
24 | "selectedColor": "#fff",
25 | "borderStyle": "black",
26 | "list": [
27 | {
28 | "pagePath": "pages/index/index",
29 | "iconPath": "assets/nav/home.png",
30 | "selectedIconPath": "assets/nav/home_fill.png",
31 | "text": "首页"
32 | },
33 | {
34 | "pagePath": "pages/lists/lists",
35 | "iconPath": "assets/nav/project.png",
36 | "selectedIconPath": "assets/nav/project_fill.png",
37 | "text": "分类"
38 | },
39 | {
40 | "pagePath": "pages/about/about",
41 | "iconPath": "assets/nav/user.png",
42 | "selectedIconPath": "assets/nav/user_fill.png",
43 | "text": "我"
44 | }
45 | ]
46 | },
47 | "networkTimeout": {
48 | "request": 10000,
49 | "downloadFile": 10000
50 | },
51 | "debug": false,
52 | "sitemapLocation": "sitemap.json"
53 | }
54 |
--------------------------------------------------------------------------------
/app.wxss:
--------------------------------------------------------------------------------
1 | /**app.wxss**/
2 | @import "/assets/icon/iconfont";
3 | @import "/assets/css/common";
4 |
5 |
6 |
7 |
8 |
--------------------------------------------------------------------------------
/assets/css/common.wxss:
--------------------------------------------------------------------------------
1 | page {
2 | width: 100%;
3 | overflow-x: hidden;
4 | background: #e5e9f0
5 | }
6 | button::after {
7 | border: none;
8 | }
9 | .Rose-left{
10 | float: left;
11 | }
12 | .Rose-right{
13 | float: right
14 | }
15 | .Rose-flex {
16 | display: flex;
17 | }
18 | .Rose-flex1 {
19 | flex: 1;
20 | }
21 | .Rose-color5 {
22 | background-color: #16c2c2;
23 | }
24 | .Rose-color4 {
25 | background-color: #8a90fa;
26 | }
27 | .Rose-color3 {
28 | background-color: #4dc6ee;
29 | }
30 | .Rose-color2 {
31 | background-color: #fed030;
32 | }
33 | .Rose-color1 {
34 | background-color: #fd9d21;
35 | }
36 | /*none*/
37 | .allLoaded {
38 | position: relative;
39 | text-align: center;
40 | font-size: 28rpx;
41 | color: #ccc;
42 | padding: 40rpx;
43 | }
44 | .allLoaded:before {
45 | position: absolute;
46 | left: 5%;
47 | top: 60rpx;
48 | width: 90%;
49 | z-index: 1;
50 | height: 2rpx;
51 | content: '';
52 | background: #ddd;
53 | }
54 | .line-word {
55 | position: relative;
56 | padding: 0 20rpx;
57 | z-index: 2;
58 | background: #e5e9f0;
59 | }
60 | .Rose-center {
61 | text-align: center
62 | }
63 | .Rose-white {
64 | background: #fff
65 | }
66 | .green-color {
67 | font-size: 14px;
68 | color: #1d8f59
69 | }
70 | .wxParse-wxxxcode-style{
71 | white-space: pre;
72 | }
73 | /*copyright*/
74 | .Rose-copyRight{
75 | padding: 40rpx;
76 | text-align: center;
77 | font-size: 20rpx;
78 | color: #ccc;
79 | line-height: 1.4
80 | }
81 | .kapo-name{
82 | font-size: 24rpx;
83 | color: #a8a8a8
84 | }
85 |
--------------------------------------------------------------------------------
/assets/icon/iconfont.wxss:
--------------------------------------------------------------------------------
1 | @font-face {font-family: "iconfont";
2 | src: url('iconfont.eot?t=1551957502685'); /* IE9 */
3 | src: url('iconfont.eot?t=1551957502685#iefix') format('embedded-opentype'), /* IE6-IE8 */
4 | url('data:application/x-font-woff2;charset=utf-8;base64,d09GMgABAAAAACNUAAsAAAAAQ1gAACMDAAEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAHEIGVgCMHArqANQ0ATYCJAOBcAt6AAQgBYRtB4UKG0g3FeOYI7BxAEO8PTqiWpTJ/v+YQMcYXB2AZmVYpE98uWi/XbVh4Y/f1jXn8cjDtEaCBAkGo3cExTLlXsaSOSFROdpXnvdL8RuqWKhCxLpDKXn4b7/f77kXE3moJDySAqtTGuRAtMq3M/MXYDCbOeBNauLb2m1qtRE4++uvKZpLsfrPfWx/MAiQjSUn3az3B35u/+fGtnt310QNNwYG6WC0sWDK6BEbtAPdABGlhz0sBvqfaCNPwahhYP8v+JyVDytAUP8Dny/0VbAaMA+AMEcUr1umZ74gdrKWljTj2buTBg4aTGGblwAaDAGbF7k/0lf6tqQBQ2g4YUPAEKAFbqi6Jz7eZ/9Tl9I+OfAIWHrbfLtOo1Zc+q8p4rFwgMKZuRLwapUS/cIQqrt3IF9mzsFCU7uYxfACCODh4XLc2JT4EzymrvVrc7iWWeYTQ0t5iXr/v07f1f7MY/x7Qtuns+PZu43vSk70np6dWgraDslBGXosOyB9AprSDcmK0x7JLkifuYhjJ4Rh7jB36thh7DYy1LT/dZZHPHgpBeqvmniMqeVAk3ZrFrVKE0QUFJzjx3xOgg5De7r5kZwFhuM0Epw8YWkxGKrPcepJ2PYZD5tAr6EJq5a9C+CFvD79QFgigIpXg3Px0TRjDnz6Bj7uZCkp6GFOq5ti/wg1NKAJ9QNzVl1t9t68wYpftg6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pVqJUmXIVKsMoTtIsL8qqbtquH0bjyXQ2XyxX6812tz8cT+fL9XZ/PF/vz/eHP39lSlk+nNBR6uV/xFJ0QPi4kOoWXTiDBJ/3x6WSOFrl0DB3KiClRjTy3+lwv/qElFg5ig6OsyeYQAsDJiPdiyR8GJFk5oyKy+hOMK7F48rSklpkgICec1ai6Dh6RUjNmWUFI5ZwdvjwbOIp5gyk1tCkVUwEUiHVJ8wG8JeF8Ch/fj04PGfHRo14e8xacasXwS6sVLXqcnZfv+lG0QDdqvGe2Irc9qtA1YdLM+c8di4CKkehgoppBc9o0gSzT/R4loJUI0W+9Dj5AvVQZPaPTvcwzy7BIXMPh4IdKKHr0VSRS4Dp0oVQO+9ZaClXw0PvsBwzuGkxCSiNIN9VQTZf/EU81vPUMtyM8EkcnRvIbRCcafXBVGQgbQAAAAA=') format('woff2'),
5 | url('iconfont.woff?t=1551957502685') format('woff'),
6 | url('iconfont.ttf?t=1551957502685') format('truetype'), /* chrome, firefox, opera, Safari, Android, iOS 4.2+ */
7 | url('iconfont.svg?t=1551957502685#iconfont') format('svg'); /* iOS 4.1- */
8 | }
9 |
10 | .iconfont {
11 | font-family: "iconfont" !important;
12 | font-size: 16px;
13 | font-style: normal;
14 | -webkit-font-smoothing: antialiased;
15 | -moz-osx-font-smoothing: grayscale;
16 | }
17 |
18 | .icon-yonghu:before {
19 | content: "\e633";
20 | }
21 |
22 | .icon-xiangmu_fill:before {
23 | content: "\e64f";
24 | }
25 |
26 | .icon-xiangmu:before {
27 | content: "\e67d";
28 | }
29 |
30 | .icon-tianjiayonghutianchong:before {
31 | content: "\e697";
32 | }
33 |
34 | .icon-guanyu:before {
35 | content: "\e685";
36 | }
37 |
38 | .icon-book:before {
39 | content: "\e66d";
40 | }
41 |
42 | .icon-dingbu:before {
43 | content: "\e76c";
44 | }
45 |
46 | .icon-yonghu2:before {
47 | content: "\e788";
48 | }
49 |
50 | .icon-duanxin:before {
51 | content: "\e647";
52 | }
53 |
54 | .icon-xiangqu:before {
55 | content: "\e64d";
56 | }
57 |
58 | .icon-daohang:before {
59 | content: "\e651";
60 | }
61 |
62 | .icon-dianping:before {
63 | content: "\e653";
64 | }
65 |
66 | .icon-kanguo:before {
67 | content: "\e65e";
68 | }
69 |
70 | .icon-qian:before {
71 | content: "\e662";
72 | }
73 |
74 | .icon-shijian2:before {
75 | content: "\e665";
76 | }
77 |
78 | .icon-xiangji:before {
79 | content: "\e672";
80 | }
81 |
82 | .icon-youji:before {
83 | content: "\e675";
84 | }
85 |
86 | .icon-tupian:before {
87 | content: "\e67f";
88 | }
89 |
90 | .icon-shanchu:before {
91 | content: "\e68e";
92 | }
93 |
94 | .icon-pinglun:before {
95 | content: "\e6ad";
96 | }
97 |
98 | .icon-shouye:before {
99 | content: "\e6cb";
100 | }
101 |
102 | .icon-xiazai47:before {
103 | content: "\e61c";
104 | }
105 |
106 | .icon-jianshen:before {
107 | content: "\e62c";
108 | }
109 |
110 | .icon-yingyu:before {
111 | content: "\e600";
112 | }
113 |
114 | .icon-fenxiang:before {
115 | content: "\e86e";
116 | }
117 |
118 | .icon-xihuan-fill:before {
119 | content: "\e870";
120 | }
121 |
122 | .icon-xihuan:before {
123 | content: "\e871";
124 | }
125 |
126 | .icon-paizhao:before {
127 | content: "\e874";
128 | }
129 |
130 | .icon-pinglun1:before {
131 | content: "\e891";
132 | }
133 |
134 | .icon-qian1:before {
135 | content: "\e896";
136 | }
137 |
138 | .icon-tuikuan:before {
139 | content: "\e8ab";
140 | }
141 |
142 | .icon-jiazai:before {
143 | content: "\e622";
144 | }
145 |
146 | .icon-CD:before {
147 | content: "\eb9b";
148 | }
149 |
150 | .icon-banben1:before {
151 | content: "\e68c";
152 | }
153 |
154 | .icon-quanju:before {
155 | content: "\e607";
156 | }
157 |
158 | .icon-yinyue:before {
159 | content: "\e9d5";
160 | }
161 |
162 | .icon-md-shijian:before {
163 | content: "\e602";
164 | }
165 |
166 | .icon-kafei:before {
167 | content: "\e664";
168 | }
169 |
170 | .icon-anquan:before {
171 | content: "\e615";
172 | }
173 |
174 | .icon-fangzi:before {
175 | content: "\e8ff";
176 | }
177 |
178 | .icon-xiangyou:before {
179 | content: "\e912";
180 | }
181 |
182 | .icon-zulin:before {
183 | content: "\e900";
184 | }
185 |
186 | .icon-info-circle:before {
187 | content: "\e77e";
188 | }
189 |
190 | .icon-plus-circle:before {
191 | content: "\e781";
192 | }
193 |
194 | .icon-message:before {
195 | content: "\e78a";
196 | }
197 |
198 | .icon-home:before {
199 | content: "\e7c6";
200 | }
201 |
202 | .icon-like:before {
203 | content: "\e7c8";
204 | }
205 |
206 | .icon-unlike:before {
207 | content: "\e7c9";
208 | }
209 |
210 | .icon-folder-add:before {
211 | content: "\e7d1";
212 | }
213 |
214 | .icon-accountbook:before {
215 | content: "\e7d3";
216 | }
217 |
218 | .icon-mail:before {
219 | content: "\e7de";
220 | }
221 |
222 | .icon-heart:before {
223 | content: "\e7df";
224 | }
225 |
226 | .icon-gengduo2:before {
227 | content: "\e67e";
228 | }
229 |
230 | .icon-heart-fill:before {
231 | content: "\e849";
232 | }
233 |
234 | .icon-like-fill:before {
235 | content: "\e869";
236 | }
237 |
238 | .icon-unlike-fill:before {
239 | content: "\e86a";
240 | }
241 |
242 | .icon-xuanzhong:before {
243 | content: "\e694";
244 | }
245 |
246 | .icon-xiangxia:before {
247 | content: "\eb9c";
248 | }
249 |
250 | .icon-xiangshang:before {
251 | content: "\eb9d";
252 | }
253 |
254 |
--------------------------------------------------------------------------------
/assets/images/44.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Rose-GoGo/KAPO/2e47b575aab8cb4dddc7d2d7882768f598094e33/assets/images/44.png
--------------------------------------------------------------------------------
/assets/images/name.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Rose-GoGo/KAPO/2e47b575aab8cb4dddc7d2d7882768f598094e33/assets/images/name.png
--------------------------------------------------------------------------------
/assets/images/ncode.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Rose-GoGo/KAPO/2e47b575aab8cb4dddc7d2d7882768f598094e33/assets/images/ncode.jpg
--------------------------------------------------------------------------------
/assets/images/share.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Rose-GoGo/KAPO/2e47b575aab8cb4dddc7d2d7882768f598094e33/assets/images/share.jpg
--------------------------------------------------------------------------------
/assets/images/wx_04.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Rose-GoGo/KAPO/2e47b575aab8cb4dddc7d2d7882768f598094e33/assets/images/wx_04.jpg
--------------------------------------------------------------------------------
/assets/nav/home.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Rose-GoGo/KAPO/2e47b575aab8cb4dddc7d2d7882768f598094e33/assets/nav/home.png
--------------------------------------------------------------------------------
/assets/nav/home_fill.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Rose-GoGo/KAPO/2e47b575aab8cb4dddc7d2d7882768f598094e33/assets/nav/home_fill.png
--------------------------------------------------------------------------------
/assets/nav/project.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Rose-GoGo/KAPO/2e47b575aab8cb4dddc7d2d7882768f598094e33/assets/nav/project.png
--------------------------------------------------------------------------------
/assets/nav/project_fill.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Rose-GoGo/KAPO/2e47b575aab8cb4dddc7d2d7882768f598094e33/assets/nav/project_fill.png
--------------------------------------------------------------------------------
/assets/nav/user.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Rose-GoGo/KAPO/2e47b575aab8cb4dddc7d2d7882768f598094e33/assets/nav/user.png
--------------------------------------------------------------------------------
/assets/nav/user_fill.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Rose-GoGo/KAPO/2e47b575aab8cb4dddc7d2d7882768f598094e33/assets/nav/user_fill.png
--------------------------------------------------------------------------------
/components/backtop/backtop.js:
--------------------------------------------------------------------------------
1 | // components/backtop/backtop.js
2 | Component({
3 | /**
4 | * 组件的属性列表
5 | */
6 | properties: {
7 | backShow: {
8 | type: Boolean,
9 | value: false
10 | },
11 | },
12 | /**
13 | * 组件的初始数据
14 | */
15 | data: {
16 | },
17 | /**
18 | * 组件的方法列表
19 | */
20 | methods: {
21 | backTop(){
22 | if (wx.pageScrollTo) {
23 | wx.pageScrollTo({
24 | scrollTop: 0,
25 | duration: 300
26 | })
27 | } else {
28 | wx.showModal({
29 | title: '提示',
30 | content: '当前微信版本过低,无法使用该功能,请升级到最新微信版本后重试。'
31 | })
32 | }
33 | }
34 | }
35 | })
36 |
--------------------------------------------------------------------------------
/components/backtop/backtop.json:
--------------------------------------------------------------------------------
1 | {
2 | "component": true,
3 | "usingComponents": {}
4 | }
--------------------------------------------------------------------------------
/components/backtop/backtop.wxml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
--------------------------------------------------------------------------------
/components/backtop/backtop.wxss:
--------------------------------------------------------------------------------
1 | /* components/backtop/backtop.wxss */
2 | @import "/assets/icon/iconfont";
3 |
4 | .Rose-backtop {
5 | position: fixed;
6 | width: 60rpx;
7 | height: 60rpx;
8 | right: 20rpx;
9 | bottom: 120rpx;
10 | border: 2rpx solid #1d8f59;
11 | z-index: 2;
12 | border-radius: 4rpx;
13 | background: #fff;
14 | color: #1d8f59;
15 | text-align: center;
16 | line-height: 60rpx;
17 | }
18 |
19 | .icon-dingbu {
20 | font-size: 36rpx;
21 | }
22 |
23 | .fadeInUp {
24 | animation: fadeInUp 0.5s linear;
25 | }
26 |
27 | .fadeOutDown {
28 | animation: fadeOutDown 0.12s linear;
29 | }
30 |
31 | @-webkit-keyframes fadeInUp {
32 | from {
33 | opacity: 0;
34 | -webkit-transform: translate3d(0, 100%, 0);
35 | transform: translate3d(0, 100%, 0);
36 | }
37 |
38 | to {
39 | opacity: 1;
40 | -webkit-transform: none;
41 | transform: none;
42 | }
43 | }
44 |
45 | @keyframes fadeInUp {
46 | from {
47 | opacity: 0;
48 | -webkit-transform: translate3d(0, 100%, 0);
49 | transform: translate3d(0, 100%, 0);
50 | }
51 |
52 | to {
53 | opacity: 1;
54 | -webkit-transform: none;
55 | transform: none;
56 | }
57 | }
58 |
59 | @-webkit-keyframes fadeOutDown {
60 | from {
61 | opacity: 1;
62 | }
63 |
64 | to {
65 | opacity: 0;
66 | -webkit-transform: translate3d(0, 100%, 0);
67 | transform: translate3d(0, 100%, 0);
68 | }
69 | }
70 |
71 | @keyframes fadeOutDown {
72 | from {
73 | opacity: 1;
74 | }
75 |
76 | to {
77 | opacity: 0;
78 | -webkit-transform: translate3d(0, 100%, 0);
79 | transform: translate3d(0, 100%, 0);
80 | }
81 | }
82 |
--------------------------------------------------------------------------------
/components/bottombar/bottombar.js:
--------------------------------------------------------------------------------
1 | // components/bottombar/bottombar.js
2 | import Api from '/../../utils/api.js';
3 | Component({
4 | /**
5 | * 组件的属性列表
6 | */
7 | properties: {
8 | commentShow: {
9 | type: Boolean,
10 | value: false
11 | },
12 | newsid: {
13 | type: String,
14 | value: ''
15 | },
16 | items: {
17 | type: Object,
18 | value: {}
19 | },
20 | pid: {
21 | type: String,
22 | value: ''
23 | },
24 | placeholder: {
25 | type: String,
26 | value: ''
27 | },
28 | reply_username: {
29 | type: String,
30 | value: ''
31 | },
32 | },
33 | /**
34 | * 组件的初始数据
35 | */
36 | data: {
37 | bottom: 0,
38 | canIUse: wx.canIUse('button.open-type.getUserInfo'),
39 | userInfo: {},
40 | disabled: true,
41 | content: '',
42 | show: false, //分享
43 | },
44 | /**
45 | * 组件的方法列表
46 | */
47 | methods: {
48 | bindGetUserInfo(e) {
49 | var that = this;
50 | var userInfo = {};
51 | if (e.detail.userInfo) {
52 | userInfo = e.detail.userInfo;
53 | } else {
54 | wx.getUserInfo({
55 | success: function (res) {
56 | userInfo = res.userInfo;
57 | },
58 | fail: function (res) {
59 | wx.showModal({
60 | showCancel: false,
61 | confirmColor: '#1d8f59',
62 | content: '授权通过后才能评论哟,请重新授权!'
63 | })
64 | }
65 | })
66 | }
67 | if (JSON.stringify(userInfo) == '{}') return false;
68 | that.setData({
69 | userInfo: userInfo
70 | })
71 | that.postComments();
72 | },
73 | closeBox() {
74 | this.setData({
75 | commentShow: false,
76 | })
77 | },
78 | forContent(e) {
79 | let that = this;
80 | let _content = e.detail.value;
81 | // 禁止输入空格
82 | var regu = "^[ ]+$";
83 | var re = new RegExp(regu);
84 | var emptyy = re.test(_content);
85 | if (emptyy) return false;
86 | //end
87 | that.setData({
88 | content: _content
89 | })
90 | if (that.data.content) {
91 | that.setData({
92 | disabled: false
93 | })
94 | } else {
95 | that.setData({
96 | disabled: true
97 | })
98 | }
99 | },
100 | postComments() {
101 | var that = this;
102 | var _content = this.data.content;
103 | if (!_content) {
104 | wx.showModal({
105 | showCancel: false,
106 | confirmColor: '#1d8f59',
107 | content: '评论不能为空!'
108 | });
109 | return false;
110 | }
111 | var postinfo = that.data.userInfo;
112 | if (JSON.stringify(postinfo) == "{}") return false;
113 | wx.showLoading();
114 | let _params = {
115 | newsid: that.data.newsid, // 博客文章ID
116 | pid: that.data.pid, // 父评论ID,默认为0
117 | from_username: postinfo.nickName, // 评论者用户名
118 | from_avatar: postinfo.avatarUrl, // 评论者头像
119 | reply_username: that.data.reply_username, // 回复了谁,pid不为0时,不允许未空
120 | reply_avatar: "", // 回复了谁的头像,允许为空
121 | content: _content
122 | }
123 | Api.postcomments(_params).then(res => {
124 | if (!res.data.code) {
125 | wx.hideLoading();
126 | wx.showToast({
127 | title: '评论成功',
128 | icon: 'success',
129 | duration: 2000
130 | })
131 | that.setData({
132 | commentShow: false,
133 | content: '',
134 | reply_username: '',
135 | pid: 0,
136 | disabled: true
137 | });
138 | that.cancelBut();
139 | that.triggerEvent('commentlists')
140 | }
141 | });
142 | },
143 | cancelBut(e) {
144 | var that = this;
145 | var myEventDetail = { page: 1 } // detail对象,提供给事件监听函数
146 | this.triggerEvent('pullComment', myEventDetail) //
147 | },
148 | rewardRose() {
149 | var that = this;
150 | that.setData({
151 | show: true
152 | })
153 | },
154 | goHome() {
155 | wx.switchTab({
156 | url: '../index/index'
157 | });
158 | },
159 | makePhoto() { //父組件調用子組件的方法
160 | var that = this;
161 | that.triggerEvent('makePhoto')
162 | },
163 | rewardRose() {
164 | var that = this;
165 | that.setData({
166 | show: true
167 | })
168 | },
169 | }
170 | })
171 |
--------------------------------------------------------------------------------
/components/bottombar/bottombar.json:
--------------------------------------------------------------------------------
1 | {
2 | "component": true,
3 | "usingComponents": {
4 | "share": "../share/share",
5 | "photo": "../photo/photo"
6 | }
7 | }
8 |
--------------------------------------------------------------------------------
/components/bottombar/bottombar.wxml:
--------------------------------------------------------------------------------
1 |
2 |
24 |
25 |
26 | 您的转发与关注是对我最大的奖赏!
27 |
28 |
--------------------------------------------------------------------------------
/components/bottombar/bottombar.wxss:
--------------------------------------------------------------------------------
1 | /* components/bottombar/bottombar.wxss */
2 | @import "/assets/icon/iconfont";
3 | .Rose-left {
4 | float: left
5 | }
6 | .Rose-right {
7 | float: right
8 | }
9 | .Rose-center {
10 | text-align: center
11 | }
12 | .Rose-comments {
13 | position: fixed;
14 | left: 0;
15 | bottom: 115rpx;
16 | width: 100%;
17 | z-index: 4;
18 | background: #fefefe;
19 | border-top: 2rpx solid #d9d9d9;
20 | transition: all 0.25s ease;
21 | }
22 | .Rose-post {
23 | width: auto;
24 | height: 200rpx;
25 | margin: 20rpx 40rpx 0;
26 | padding: 10rpx;
27 | background: #eee;
28 | color: #333;
29 | font-size: 28rpx;
30 | border-radius: 8rpx;
31 | }
32 | .Rose-btn {
33 | background: #4bb777;
34 | margin: 20rpx 40rpx;
35 | color: #fff;
36 | font-size: 26rpx;
37 | border-radius: 8rpx;
38 | padding: 0 20rpx;
39 | text-align: center;
40 | box-shadow: none;
41 | }
42 | .Rose-btn.disabled {
43 | opacity: 0.5;
44 | color: #eee
45 | }
46 | .Rose-close {
47 | background: #DEDEDE
48 | }
49 | .Rose-tool {
50 | color: #999;
51 | font-size: 18rpx;
52 | padding: 10rpx 0;
53 | line-height: 40rpx;
54 | border-bottom: 1rpx solid #f2f2f2
55 | }
56 | .Rose-flex {
57 | display: flex;
58 | }
59 | .Rose-flex1 {
60 | flex: 1
61 | }
62 | .Rose-tool .iconfont {
63 | display: block;
64 | color: #333;
65 | font-size: 48rpx;
66 | color: #4bb777;
67 | font-weight: 500
68 | }
69 | .Rose-content {
70 | padding: 60rpx 0;
71 | }
72 | .Rose-share {
73 | font-size: 18rpx;
74 | color: #999;
75 | line-height: 40rpx;
76 | background: transparent;
77 | }
78 | .animated {
79 | animation-duration: 0.5s;
80 | animation-fill-mode: both
81 | }
82 | .animated.infinite {
83 | animation-iteration-count: infinite
84 | }
85 | @keyframes slideInUp {
86 | from {
87 | -webkit-transform: translate3d(0, 100%, 0);
88 | transform: translate3d(0, 100%, 0);
89 | visibility: visible
90 | }
91 | to {
92 | -webkit-transform: translate3d(0, 0, 0);
93 | transform: translate3d(0, 0, 0)
94 | }
95 | }
96 | .slideInUp {
97 | -webkit-animation-name: slideInUp;
98 | animation-name: slideInUp
99 | }
100 | @keyframes slideOutDown {
101 | from {
102 | -webkit-transform: translate3d(0, 0, 0);
103 | transform: translate3d(0, 0, 0)
104 | }
105 | to {
106 | visibility: hidden;
107 | -webkit-transform: translate3d(0, 100%, 0);
108 | transform: translate3d(0, 100%, 0)
109 | }
110 | }
111 | .slideOutDown {
112 | -webkit-animation-name: slideOutDown;
113 | animation-name: slideOutDown
114 | }
115 |
--------------------------------------------------------------------------------
/components/copyright/copyright.js:
--------------------------------------------------------------------------------
1 | Component({
2 | /**
3 | * 组件的属性列表
4 | */
5 | properties: {
6 | },
7 | /**
8 | * 组件的初始数据
9 | */
10 | data: {
11 | yearss: ''
12 | },
13 | ready: function(){
14 | this.getYear();
15 | },
16 | /**
17 | * 组件的方法列表
18 | */
19 | methods: {
20 | getYear() {
21 | var date = new Date();
22 | var _year = date.getFullYear();
23 | this.setData({
24 | yearss: _year
25 | })
26 | }
27 | }
28 | })
29 |
--------------------------------------------------------------------------------
/components/copyright/copyright.json:
--------------------------------------------------------------------------------
1 | {
2 | "component": true,
3 | "usingComponents": {
4 |
5 | }
6 | }
--------------------------------------------------------------------------------
/components/copyright/copyright.wxml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
9 |
10 |
11 |
12 | KAPO博客
13 | Copyright © 2014-{{yearss}} KAPO. All Rights Reserved.
14 |
15 |
16 |
--------------------------------------------------------------------------------
/components/copyright/copyright.wxss:
--------------------------------------------------------------------------------
1 | .Rose-copyRight{
2 | padding: 40rpx;
3 | text-align: center;
4 | font-size: 20rpx;
5 | color: #ccc;
6 | line-height: 1.4
7 | }
8 | .kapo-name{
9 | font-size: 24rpx;
10 | color: #a8a8a8
11 | }
12 |
--------------------------------------------------------------------------------
/components/loading/loading.js:
--------------------------------------------------------------------------------
1 | // pages/loading/loading.js
2 | Component({
3 | /**
4 | * 组件的属性列表
5 | */
6 | properties: {
7 | loadMore: {
8 | type: Boolean,
9 | value: false
10 | }
11 | },
12 | /**
13 | * 组件的初始数据
14 | */
15 | data: {
16 | },
17 | /**
18 | * 组件的方法列表
19 | */
20 | methods: {
21 | }
22 | })
23 |
--------------------------------------------------------------------------------
/components/loading/loading.json:
--------------------------------------------------------------------------------
1 | {
2 | "component": true,
3 | "usingComponents": {}
4 | }
--------------------------------------------------------------------------------
/components/loading/loading.wxml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | 正在加载
5 |
6 |
7 |
--------------------------------------------------------------------------------
/components/loading/loading.wxss:
--------------------------------------------------------------------------------
1 | /* pages/loading/loading.wxss */
2 | @import "/assets/icon/iconfont";
3 |
4 | .Rose-loading {
5 | height: 64rpx;
6 | text-align: center;
7 | font-size: 12px;
8 | color: #999;
9 | }
10 |
11 | .icon-jiazai {
12 | height: 72rpx;
13 | font-size: 28rpx;
14 | animation: rotate 1s linear infinite;
15 | }
16 |
17 | @keyframes rotate {
18 | 0% {
19 | -webkit-transform: rotate(0deg);
20 | transform: rotate(0deg);
21 | transform-origin: 50% 50%;
22 | }
23 |
24 | 100% {
25 | -webkit-transform: rotate(360deg);
26 | transform: rotate(360deg);
27 | transform-origin: 50% 50%;
28 | }
29 | }
30 |
--------------------------------------------------------------------------------
/components/modal/modal.js:
--------------------------------------------------------------------------------
1 | // components/share/share.js
2 | Component({
3 |
4 | /**
5 | * 组件的属性列表
6 | */
7 | properties: {
8 | //是否显示modal
9 | show: {
10 | type: Boolean,
11 | value: false
12 | }
13 | },
14 |
15 | /**
16 | * 组件的初始数据
17 | */
18 | data: {
19 |
20 | },
21 |
22 | /**
23 | * 组件的方法列表
24 | */
25 | methods: {
26 | clickMask() {
27 | // this.setData({show: false})
28 | },
29 |
30 | cancel() {
31 | this.setData({
32 | show: false
33 | })
34 | this.triggerEvent('cancel')
35 | },
36 |
37 | confirm() {
38 | this.setData({
39 | show: false
40 | })
41 | this.triggerEvent('confirm')
42 | }
43 | }
44 | })
45 |
--------------------------------------------------------------------------------
/components/modal/modal.json:
--------------------------------------------------------------------------------
1 | {
2 | "component": true,
3 | "usingComponents": {}
4 | }
--------------------------------------------------------------------------------
/components/modal/modal.wxml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
--------------------------------------------------------------------------------
/components/modal/modal.wxss:
--------------------------------------------------------------------------------
1 | /* components/share/share.wxss */
2 |
3 | .Rose-mask {
4 | position: fixed;
5 | left: 0;
6 | right: 0;
7 | top: 0;
8 | bottom: 0;
9 | margin-top: -104rpx;
10 | display: flex;
11 | justify-content: center;
12 | align-items: center;
13 | background-color: rgba(0, 0, 0, 0.4);
14 | z-index: 9;
15 | }
16 |
17 | .Rose-content {
18 | display: flex;
19 | flex-direction: column;
20 | width: 618rpx;
21 | background-color: #fff;
22 | border-radius: 8rpx;
23 | color: #999;
24 | text-align: center;
25 | font-size: 30rpx;
26 | }
27 |
28 | .Rose-main {
29 | flex: 1;
30 | height: 100%;
31 | overflow-y: hidden;
32 | }
33 |
34 | .Rose-btns {
35 | display: flex;
36 | flex-direction: row;
37 | height: 98rpx;
38 | line-height: 98rpx;
39 | border-top: 2rpx solid #e6e5e7;
40 | overflow: hidden;
41 | }
42 |
43 | .Rose-cancel, .Rose-confirm {
44 | position: relative;
45 | flex: 1;
46 | height: 100rpx;
47 | line-height: 100rpx;
48 | text-align: center;
49 | font-size: 36rpx;
50 | color: #999;
51 | z-index: 1;
52 | }
53 |
54 | button.Rose-confirm {
55 | color: #1d8f59;
56 | }
57 |
58 | button:after {
59 | border: none;
60 | }
61 |
62 | button {
63 | border-radius: 0;
64 | padding: 0;
65 | background-color: transparent;
66 | }
67 |
68 | button.Rose-cancel {
69 | border-right: 2rpx solid #e6e5e7;
70 | }
71 |
--------------------------------------------------------------------------------
/components/nomore/comment.wxml:
--------------------------------------------------------------------------------
1 |
2 | 我是有底线滴~
3 |
4 |
--------------------------------------------------------------------------------
/components/nomore/nomore.js:
--------------------------------------------------------------------------------
1 | // components/comment.js
2 | Component({
3 | /**
4 | * 组件的属性列表
5 | */
6 | properties: {
7 |
8 | },
9 |
10 | /**
11 | * 组件的初始数据
12 | */
13 | data: {
14 |
15 | },
16 |
17 | /**
18 | * 组件的方法列表
19 | */
20 | methods: {
21 |
22 | }
23 | })
24 |
--------------------------------------------------------------------------------
/components/nomore/nomore.json:
--------------------------------------------------------------------------------
1 | {
2 | "component": true,
3 | "usingComponents": {}
4 | }
--------------------------------------------------------------------------------
/components/nomore/nomore.wxml:
--------------------------------------------------------------------------------
1 |
2 | 我是有底线滴~
3 |
4 |
--------------------------------------------------------------------------------
/components/nomore/nomore.wxss:
--------------------------------------------------------------------------------
1 | /* components/comment.wxss */
2 |
3 |
--------------------------------------------------------------------------------
/components/photo/photo.js:
--------------------------------------------------------------------------------
1 | // components/photo/photo.js
2 | Component({
3 | /**
4 | * 组件的属性列表
5 | */
6 | properties: {
7 | dataSource: {
8 | type: Object,
9 | value: {}
10 | },
11 | modalshow: {
12 | type: Boolean,
13 | value: true
14 | },
15 | },
16 | /**
17 | * 组件的初始数据
18 | */
19 | data: {
20 | maskHidden: true,
21 | imagePath: ''
22 | },
23 | /**
24 | * 组件的方法列表
25 | */
26 | methods: {
27 | makePhoto: function (e) { //点击生成海报
28 | var that = this;
29 | that.setData({
30 | maskHidden: false
31 | });
32 | wx.showToast({
33 | title: '请骚等...',
34 | icon: 'loading',
35 | duration: 1000
36 | });
37 | setTimeout(function () {
38 | wx.hideToast()
39 | that.createNewImg();
40 | that.setData({
41 | maskHidden: true
42 | });
43 | }, 1000)
44 | },
45 | /*
46 | 海报
47 | */
48 | createNewImg: function () {
49 | var that = this;
50 | var context = wx.createCanvasContext('mycanvas');
51 | context.setFillStyle("#ffffff")
52 | context.fillRect(0, 0, 600, 970); //填充一个矩形。用 setFillStyle
53 | var dataSource = this.data.dataSource;
54 | var title = dataSource.title;
55 | var desc = dataSource.description;
56 | var thumb = dataSource.thumb;
57 | var qrcodeLoal = "https://www.zhmzjl.com/statics/images/blog/kapo.jpg";
58 | context.drawImage(thumb, 40, 40, 520, 260); //绘制首图
59 | context.drawImage(qrcodeLoal, 210, 650, 180, 180); //绘制二维码
60 | context.drawImage(qrcodeLoal, 210, 650, 180, 180); //绘制二维码
61 | context.setFillStyle("#000000");
62 | context.setFontSize(20); //设置字体大小
63 | context.setTextAlign('center'); //设置字体对齐
64 | context.fillText("阅读文章,请长按识别二维码", 300, 895);
65 | context.setFillStyle("#000000");
66 | context.beginPath() //分割线
67 | context.moveTo(30, 620)
68 | context.lineTo(570, 620)
69 | context.stroke();
70 | context.setTextAlign('left');
71 | context.setFontSize(40);
72 | if (title.lengh <= 12) {
73 | context.fillText(title, 40, 360); //文章标题
74 | } else {
75 | context.fillText(title.substring(0, 12), 40, 360);
76 | context.fillText(title.substring(12, 26), 40, 410);
77 | }
78 | context.setFontSize(20);
79 | if (desc.lengh <= 26) {
80 | context.fillText(desc, 40, 470); //文章描述
81 | } else {
82 | context.fillText(desc.substring(0, 26), 40, 470);
83 | context.fillText(desc.substring(26, 50) + '...', 40, 510);
84 | }
85 | //绘制图片
86 | context.draw(false, wx.canvasToTempFilePath({
87 | canvasId: 'mycanvas',
88 | destWidth:600,
89 | destHeight:970,
90 | quality:22,
91 | fileType:'jpg',
92 | success: function (res) {
93 | console.log(res)
94 | var tempFilePath = res.tempFilePath;
95 | that.setData({
96 | imagePath: tempFilePath,
97 | // modalshow: false
98 | });
99 | wx.hideToast()
100 | },
101 | fail: function (res) {
102 | console.log(res);
103 | }
104 | },this));
105 | },
106 | //点击保存到相册
107 | baocun: function () {
108 | var that = this
109 | wx.saveImageToPhotosAlbum({
110 | filePath: that.data.imagePath,
111 | success(res) {
112 | wx.showModal({
113 | content: '图片已保存到相册,赶紧晒一下吧~',
114 | showCancel: false,
115 | confirmText: '好的',
116 | confirmColor: '#333',
117 | success: function (res) {
118 | if (res.confirm) {
119 | console.log('用户点击确定');
120 | /* 该隐藏的隐藏 */
121 | that.setData({
122 | modalshow: true
123 | })
124 | }
125 | },
126 | fail: function (res) {
127 | console.log(11111)
128 | }
129 | })
130 | }
131 | })
132 | },
133 | //点击生成
134 | getCode: function () { //生成二维码
135 | var that = this;
136 | let _params = {
137 | catid: that.data.catid,
138 | id: that.data.id
139 | }
140 | Api.creatcode(_params).then(res => {
141 | if (res.data.code == 0) {
142 | let _data = res.data.url;
143 | that.setData({
144 | codeurl: _data
145 | })
146 | }
147 | });
148 | },
149 | }
150 | })
151 |
--------------------------------------------------------------------------------
/components/photo/photo.json:
--------------------------------------------------------------------------------
1 | {
2 | "component": true,
3 | "usingComponents": {}
4 | }
--------------------------------------------------------------------------------
/components/photo/photo.wxml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
--------------------------------------------------------------------------------
/components/photo/photo.wxss:
--------------------------------------------------------------------------------
1 | /* components/photo/photo.wxss */
2 |
3 | .Rose-photo {
4 | width: 100%;
5 | height: 100%;
6 | background: rgba(0, 0, 0, 0.7);
7 | position: fixed;
8 | top: 0;
9 | left: 0;
10 | right: 0;
11 | bottom: 0;
12 | z-index: 10;
13 | }
14 |
15 | .Rose-done {
16 | width: 80%;
17 | height: 80%;
18 | position: fixed;
19 | top: 50rpx;
20 | left: 50%;
21 | margin-left: -40%;
22 | z-index: 10;
23 | }
24 |
25 | .Rose-save {
26 | display: block;
27 | width: 80%;
28 | height: 80rpx;
29 | padding: 0;
30 | line-height: 80rpx;
31 | text-align: center;
32 | position: fixed;
33 | bottom: 50rpx;
34 | left: 10%;
35 | background: #fff;
36 | color: #333;
37 | font-size: 32rpx;
38 | border-radius: 44rpx;
39 | }
40 |
41 | .Rose-canvas {
42 | /* width: 0;
43 | height:0;
44 | overflow: hidden*/
45 | width: 600px;
46 | height: 970px;
47 | }
48 |
--------------------------------------------------------------------------------
/components/share/share.js:
--------------------------------------------------------------------------------
1 | // components/share/share.js
2 | Component({
3 |
4 | /**
5 | * 组件的属性列表
6 | */
7 | properties: {
8 | //是否显示modal
9 | show: {
10 | type: Boolean,
11 | value: false
12 | }
13 | },
14 |
15 | /**
16 | * 组件的初始数据
17 | */
18 | data: {
19 |
20 | },
21 |
22 | /**
23 | * 组件的方法列表
24 | */
25 | methods: {
26 | clickMask() {
27 | // this.setData({show: false})
28 | },
29 |
30 | cancel() {
31 | this.setData({
32 | show: false
33 | })
34 | this.triggerEvent('cancel')
35 | },
36 |
37 | confirm() {
38 | this.setData({
39 | show: false
40 | })
41 | this.triggerEvent('confirm')
42 | }
43 | }
44 | })
45 |
--------------------------------------------------------------------------------
/components/share/share.json:
--------------------------------------------------------------------------------
1 | {
2 | "component": true,
3 | "usingComponents": {}
4 | }
--------------------------------------------------------------------------------
/components/share/share.wxml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
--------------------------------------------------------------------------------
/components/share/share.wxss:
--------------------------------------------------------------------------------
1 | /* components/share/share.wxss */
2 | .Rose-mask {
3 | position: fixed;
4 | left: 0;
5 | right: 0;
6 | top: 0;
7 | bottom: 0;
8 | margin-top: -104rpx;
9 | display: flex;
10 | justify-content: center;
11 | align-items: center;
12 | background-color: rgba(0, 0, 0, 0.4);
13 | z-index: 9;
14 | }
15 | .Rose-content {
16 | display: flex;
17 | flex-direction: column;
18 | width: 618rpx;
19 | background-color: #fff;
20 | border-radius: 8rpx;
21 | color: #999;
22 | text-align: center;
23 | font-size: 30rpx;
24 | }
25 | .Rose-main {
26 | flex: 1;
27 | height: 100%;
28 | overflow-y: hidden;
29 | }
30 | .Rose-btns {
31 | display: flex;
32 | flex-direction: row;
33 | height: 98rpx;
34 | line-height: 98rpx;
35 | border-top: 2rpx solid #e6e5e7;
36 | overflow: hidden;
37 | }
38 | .Rose-cancel, .Rose-confirm {
39 | position: relative;
40 | flex: 1;
41 | height: 100rpx;
42 | line-height: 100rpx;
43 | text-align: center;
44 | font-size: 36rpx;
45 | color: #999;
46 | z-index: 1;
47 | }
48 | button.Rose-confirm {
49 | color: #1d8f59;
50 | }
51 | button {
52 | border-radius: 0;
53 | padding: 0;
54 | background-color: transparent;
55 | }
56 | button.Rose-cancel {
57 | border-right: 2rpx solid #e6e5e7;
58 | }
59 |
--------------------------------------------------------------------------------
/pages/about/about.js:
--------------------------------------------------------------------------------
1 | //index.js
2 | //获取应用实例
3 | const app = getApp()
4 | Page({
5 | data: {},
6 | onLoad: function () {
7 | },
8 | onReady: function () { },
9 | /**
10 | * 生命周期函数--监听页面显示
11 | */
12 | onShow: function () { },
13 | /**
14 | * 生命周期函数--监听页面隐藏
15 | */
16 | onHide: function () { },
17 | /**
18 | * 生命周期函数--监听页面卸载
19 | */
20 | onUnload: function () { },
21 | /**
22 | * 页面相关事件处理函数--监听用户下拉动作
23 | */
24 | onPullDownRefresh: function () { },
25 | /**
26 | * 页面上拉触底事件的处理函数
27 | */
28 | onReachBottom: function () { },
29 | /**
30 | * 用户点击右上角分享
31 | */
32 | onShareAppMessage: function () {
33 | return {
34 | title: '锲而舍之,朽木不折;锲而不舍,金石可镂',
35 | imageUrl: '/assets/images/share.jpg'
36 | }
37 | }
38 | })
39 |
--------------------------------------------------------------------------------
/pages/about/about.json:
--------------------------------------------------------------------------------
1 | {
2 | "navigationBarTitleText": "我",
3 | "enablePullDownRefresh": false,
4 | "usingComponents": {
5 | "copyright": "../../components/copyright/copyright"
6 | }
7 | }
8 |
--------------------------------------------------------------------------------
/pages/about/about.wxml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | 余秋雨: 一个在教师看来生气勃勃的学生,过几年看到他,他成为了一个平庸的人。所以我始终要提醒大家,人生要不断地设定起点,不断地突破围城,不断地提醒自己,你有一个更精彩的生命。即使年纪很大也应该这样,生命才会比较有价值。
5 |
6 |
7 |
8 |
9 |
10 | 留言
11 |
12 |
13 |
14 |
15 |
16 |
17 | 项目
18 |
19 |
20 |
21 |
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 |
53 |
63 |
64 |
65 |
66 |
67 |
68 |
--------------------------------------------------------------------------------
/pages/about/about.wxss:
--------------------------------------------------------------------------------
1 | /**index.wxss**/
2 | .Rose-floor {
3 | background: #fff;
4 | margin: 20rpx 0;
5 | }
6 | .Rose-menu {
7 | padding: 40rpx 30rpx 20rpx;
8 | display: flex;
9 | flex-flow: row;
10 | justify-content: space-between;
11 | }
12 | .Rose-flex1 {
13 | flex: 1;
14 | }
15 | .Rose-about-title {
16 | text-align: center;
17 | }
18 | .Rose-about {
19 | padding: 20rpx;
20 | background: #1d8f59;
21 | color: #fff;
22 | font-size: 32rpx;
23 | }
24 | .Rose-kinds {
25 | text-align: center;
26 | font-size: 28rpx;
27 | color: #333;
28 | width: 90rpx;
29 | }
30 | .Rose-kinds .iconfont {
31 | font-size: 42rpx;
32 | display: block;
33 | }
34 | .view-circle {
35 | border-radius: 100%;
36 | color: #fff;
37 | width: 90rpx;
38 | height: 90rpx;
39 | line-height: 90rpx;
40 | margin: 0 auto 20rpx;
41 | }
42 | .color4 {
43 | background-color: #8a90fa;
44 | }
45 | .color3 {
46 | background-color: #4dc6ee;
47 | }
48 | .color2 {
49 | background-color: #fed030;
50 | }
51 | .color1 {
52 | background-color: #fd9d21;
53 | }
54 | .Rose-floor-title {
55 | padding: 20rpx 20rpx;
56 | font-size: 32rpx;
57 | color: #666;
58 | border-bottom: 2rpx solid #f2f2f2;
59 | }
60 | .Rose-floor-title .iconfont {
61 | color: #555;
62 | font-size: 15px;
63 | }
64 | .Rose-content {
65 | font-size: 26rpx;
66 | margin: 10rpx 0 30rpx;
67 | line-height: 1.4;
68 | }
69 | .Rose-article {
70 | padding: 50rpx 20rpx 40rpx;
71 | display: flex;
72 | }
73 | .Rose-title {
74 | flex: 1;
75 | text-align: center;
76 | font-size: 26rpx;
77 | color: #666;
78 | }
79 | .Rose-title .iconfont {
80 | font-size: 52rpx;
81 | display: block;
82 | color: #599eec;
83 | }
84 | .Rose-Line .iconfont, .Rose-btn .iconfont{
85 | color: #599eec;
86 | font-size: 46rpx;
87 | padding-right: 10rpx;
88 | vertical-align: middle;
89 | }
90 | .Rose-Line .iconfont.fr {
91 | float: right;
92 | color: #a8a8a8;
93 | padding-right: 0;
94 | font-size: 30rpx;
95 | }
96 | .Rose-Line,.Rose-btn {
97 | padding: 20rpx 20rpx 20rpx 0;
98 | border-bottom: 1rpx solid #f5f5f5;
99 | background: #fff;
100 | font-size: 34rpx;
101 | color: #333;
102 | margin-left: 20rpx;
103 | line-height: 60rpx;
104 | text-align: left
105 | }
106 | .Rose-btn{
107 | padding: 0;
108 | margin: 0;
109 | border-bottom: none
110 | }
111 | .Rose-Line:last-child {
112 | border-bottom: none;
113 | }
114 |
--------------------------------------------------------------------------------
/pages/comm.wxs:
--------------------------------------------------------------------------------
1 | var common = {
2 | formatDate: function (time) {
3 | var date = getDate(time * 1000);
4 | var year = date.getFullYear();
5 | var month = date.getMonth() + 1;
6 | var day = date.getDate();
7 | var hour = date.getHours();
8 | var minute = date.getMinutes();
9 | var second = date.getSeconds();
10 | if (month < 10) month = '0' + month;
11 | if (day < 10) day = '0' + day;
12 | if (hour < 10) hour = '0' + hour;
13 | if (minute < 10) minute = '0' + minute;
14 | if (second < 10) second = '0' + second;
15 | return year + '-' + month + '-' + day;
16 | },
17 | formatTime: function (time) {
18 | var date = getDate(time * 1000);
19 | var year = date.getFullYear();
20 | var month = date.getMonth() + 1;
21 | var day = date.getDate();
22 | var hour = date.getHours();
23 | var minute = date.getMinutes();
24 | var second = date.getSeconds();
25 | if (month < 10) month = '0' + month;
26 | if (day < 10) day = '0' + day;
27 | if (hour < 10) hour = '0' + hour;
28 | if (minute < 10) minute = '0' + minute;
29 | if (second < 10) second = '0' + second;
30 | return year + '-' + month + '-' + day + ' ' + hour + ':' + minute + ':' + second;
31 | }
32 | }
33 | module.exports = {
34 | formatDate: common.formatDate,
35 | formatTime: common.formatTime,
36 | }
37 |
--------------------------------------------------------------------------------
/pages/detail/detail.js:
--------------------------------------------------------------------------------
1 | // pages/detail/detail.js
2 | import Api from '/../../utils/api.js';
3 | import util from '/../../utils/util.js';
4 | let wxparse = require("../../wxParse/wxParse.js");
5 | const app = getApp();
6 | Page({
7 | /**
8 | * 页面的初始数据
9 | */
10 | data: {
11 | items: {},
12 | dkcontent: '',
13 | id: '',
14 | catid: '',
15 | comments: [], //反馈列表
16 | canIUse: wx.canIUse('button.open-type.getUserInfo'),
17 | disabled: true,
18 | loadMore: true,
19 | focus: false,
20 | userInfo: {},
21 | content: '',
22 | placeholder: '爱发言的人运气都不会太差',
23 | reply_username: '',
24 | pid: 0,
25 | page: 1,
26 | likenum: null,
27 | like: false,
28 | maskHidden: false,
29 | codeurl: "",
30 | commentshow: false,
31 | modalshow: true,
32 | imagePath: ''
33 | },
34 | /**
35 | * 生命周期函数--监听页面加载
36 | */
37 | onLoad: function(options) {
38 | wx.showLoading();
39 | var that = this;
40 | let _userInfo = wx.getStorageSync('userInfo')
41 | let scene = decodeURIComponent(options.scene);
42 | if (options.scene) {
43 | let scene = decodeURIComponent(options.scene);
44 | let info_arr = [];
45 | info_arr = scene.split('&');
46 | let _catid = info_arr[0];
47 | let _id = info_arr[1];
48 | that.setData({
49 | userInfo: _userInfo,
50 | id: _id,
51 | catid: _catid
52 | });
53 | } else {
54 | that.setData({
55 | userInfo: _userInfo,
56 | id: options.id,
57 | catid: options.catid
58 | });
59 | }
60 | if (wx.getStorageSync('userInfo')) {} else {
61 | wx.getSetting({
62 | success: function(res) {
63 | if (res.authSetting['scope.userInfo']) {
64 | // 已经授权,可以直接调用 getUserInfo 获取头像昵称
65 | wx.getUserInfo({
66 | success: function(res) {
67 | let _userInfo = res.userInfo;
68 | app.globalData.userInfo = _userInfo;
69 | wx.setStorageSync('userInfo', _userInfo)
70 | }
71 | })
72 | }
73 | }
74 | });
75 | }
76 | that.getData();
77 | that.commentlists(); //反馈列表
78 | that.top10(); //top 10推荐
79 | },
80 | /**
81 | * 生命周期函数--监听页面初次渲染完成
82 | */
83 | onReady: function() {},
84 | /**
85 | * 生命周期函数--监听页面显示
86 | */
87 | onShow: function() {},
88 | /**
89 | * 生命周期函数--监听页面隐藏
90 | */
91 | onHide: function() {},
92 | /**
93 | * 生命周期函数--监听页面卸载
94 | */
95 | onUnload: function() {},
96 | /**
97 | * 页面相关事件处理函数--监听用户下拉动作
98 | */
99 | onPullDownRefresh: function() {},
100 | /**
101 | * 页面上拉触底事件的处理函数
102 | */
103 | onReachBottom: function() {
104 | var that = this;
105 | let page = that.data.page + 1;
106 | that.setData({
107 | page: page
108 | });
109 | if (that.data.loadMore) {
110 | that.commentlists();
111 | }
112 | },
113 | /**
114 | * 用户点击右上角分享
115 | */
116 | onShareAppMessage: function() {
117 | return {
118 | title: this.data.items.title,
119 | path: "/detail/detail",
120 | imageUrl: '/assets/images/share.jpg'
121 | }
122 | },
123 | getData() {
124 | var that = this;
125 | let _params = {
126 | catid: that.data.catid,
127 | id: that.data.id
128 | };
129 | Api.pageitem(_params).then(res => {
130 | if (!res.data.code) {
131 | wx.hideLoading();
132 | let _data = res.data.data;
133 | var _tpl = _data.content;
134 | that.setData({
135 | likenum: _data.thumbs_up,
136 | items: _data,
137 | dkcontent: _tpl
138 | });
139 | wxparse.wxParse('dkcontent', 'html', _tpl, that, 5);
140 | }
141 | })
142 | },
143 | commentNow() {
144 | this.setData({
145 | focus: true
146 | })
147 | },
148 | commentBox() {
149 | var that = this;
150 | that.setData({
151 | commentshow: !that.data.commentshow,
152 | })
153 | if (!that.data.codeurl) {
154 | that.getCode();
155 | }
156 | },
157 | wetherLike() { //点赞
158 | var that = this;
159 | let params = {
160 | id: that.data.id,
161 | catid: that.data.catid
162 | }
163 | if (!that.data.like) {
164 | Api.likenum(params).then(res => {
165 | if (!res.data.code) {
166 | let _data = res.data.data;
167 | let linknn = parseInt(that.data.likenum)
168 | that.setData({
169 | likenum: linknn + 1,
170 | like: !that.data.like
171 | })
172 | wx.showToast({
173 | title: '感谢您的鼓励!',
174 | icon: 'none',
175 | duration: 2000
176 | })
177 | }
178 | });
179 | }
180 | if (that.data.like) {
181 | let linknn = parseInt(that.data.likenum)
182 | that.setData({
183 | likenum: linknn - 1,
184 | like: !that.data.like
185 | })
186 | wx.showToast({
187 | title: '我会继续努力!',
188 | icon: 'none',
189 | duration: 2000
190 | })
191 | }
192 | },
193 | backContent(e) { //回复的评论
194 | let _from = e.currentTarget.dataset.from;
195 | let _id = e.currentTarget.dataset.pid;
196 | this.setData({
197 | placeholder: '回复 ' + _from,
198 | focus: true,
199 | reply_username: _from,
200 | pid: _id,
201 | commentshow: false
202 | })
203 | },
204 | top10() { //推荐阅读
205 | var that = this;
206 | let params = {
207 | pagesize: 5,
208 | page: 1,
209 | catid: that.data.catid
210 | }
211 | Api.lists(params).then(res => { //文章列表
212 | if (!res.data.code) {
213 | let _data = res.data.data;
214 | that.setData({
215 | top10: _data
216 | });
217 | }
218 | })
219 | },
220 | articleDetail(e) {
221 | let {id, catid} = e.currentTarget.dataset;
222 | wx.navigateTo({
223 | url: '../detail/detail?catid=' + catid + '&id=' + id
224 | });
225 | },
226 | previewImage(e) {
227 | var current = e.target.dataset.src;
228 | wx.previewImage({
229 | current: current,
230 | urls: [current]
231 | })
232 | },
233 | goHome() {
234 | wx.switchTab({
235 | url: '../index/index'
236 | });
237 | },
238 | forContent(e) {
239 | let that = this;
240 | let _content = e.detail.value;
241 | // 禁止输入空格
242 | var regu = "^[ ]+$";
243 | var re = new RegExp(regu);
244 | var emptyy = re.test(_content);
245 | if (emptyy) return false;
246 | //end
247 | that.setData({
248 | content: _content
249 | })
250 | if (that.data.content) {
251 | that.setData({
252 | disabled: false
253 | })
254 | } else {
255 | that.setData({
256 | disabled: true
257 | })
258 | }
259 | },
260 | bindGetUserInfo(e) {
261 | var that = this;
262 | var userInfo = {};
263 | if (e.detail.userInfo) {
264 | userInfo = e.detail.userInfo;
265 | } else {
266 | wx.getUserInfo({
267 | success: function (res) {
268 | userInfo = res.userInfo;
269 | },
270 | fail: function (res) {
271 | wx.showModal({
272 | showCancel: false,
273 | confirmColor: '#1d8f59',
274 | confirmColor: '#1d8f59',
275 | content: '授权通过后才能评论哟,请重新授权!'
276 | })
277 | }
278 | })
279 | }
280 | if (JSON.stringify(userInfo) == '{}') return false;
281 | that.setData({
282 | userInfo: userInfo
283 | })
284 | that.postComments()
285 | },
286 | postComments() {
287 | var that = this;
288 | if (!that.data.content) {
289 | wx.showModal({
290 | showCancel: false,
291 | confirmColor: '#1d8f59',
292 | content: '评论不能为空!'
293 | });
294 | return false;
295 | }
296 | if (!that.data.userInfo) return false;
297 | wx.showLoading();
298 | let _params = {
299 | newsid: that.data.id, // 博客文章ID
300 | pid: that.data.pid, // 父评论ID,默认为0
301 | from_username: that.data.userInfo.nickName, // 评论者用户名
302 | from_avatar: that.data.userInfo.avatarUrl, // 评论者头像
303 | reply_username: that.data.reply_username, // 回复了谁,pid不为0时,不允许未空
304 | reply_avatar: "", // 回复了谁的头像,允许为空
305 | content: that.data.content
306 | }
307 | Api.postcomments(_params).then(res => {
308 | if (!res.data.code) {
309 | wx.hideLoading();
310 | wx.showToast({
311 | title: '评论成功',
312 | icon: 'success',
313 | duration: 2000
314 | })
315 | that.setData({
316 | content: '',
317 | page: 1,
318 | comments: [],
319 | reply_username: '',
320 | pid: 0,
321 | placeholder: '点击评论回复...',
322 | disabled: true
323 | });
324 | that.commentlists();
325 | }
326 | });
327 | },
328 | commentlists() {
329 | var that = this;
330 | let _params = {
331 | newsid: that.data.id,
332 | page: that.data.page,
333 | pagesize: 10
334 | }
335 | Api.commentlists(_params).then(res => {
336 | if (res.data.code == 0) {
337 | let _data = res.data.data;
338 | let _count = res.data.count;
339 | let _arr = that.data.comments.concat(_data);
340 | that.setData({
341 | comments: _arr,
342 | count: _count
343 | });
344 | if (_data.length < 10) {
345 | that.setData({
346 | loadMore: false
347 | });
348 | }
349 | } else {
350 | wx.showModal({
351 | showCancel: false,
352 | confirmColor: '#1d8f59',
353 | content: '评论加载失败!'
354 | })
355 | }
356 | });
357 | },
358 | forRemark(e) {
359 | var that = this;
360 | let _data = e.detail.value;
361 | // 禁止输入空格
362 | var regu = "^[ ]+$";
363 | var re = new RegExp(regu);
364 | var emptyy = re.test(_data);
365 | if (emptyy) return false;
366 | //end
367 | that.setData({
368 | content: _data
369 | });
370 | if (that.data.content) {
371 | that.setData({
372 | disabled: false
373 | })
374 | } else {
375 | that.setData({
376 | disabled: true
377 | })
378 | }
379 | },
380 | makePhoto(e) { //点击生成海报
381 | var that = this;
382 | if (this.data.imagePath) {
383 | that.setData({
384 | modalshow: false,
385 | });
386 | return false;
387 | }
388 | wx.showToast({
389 | title: '请骚等...',
390 | icon: 'loading',
391 | duration: 1000
392 | });
393 | that.setData({
394 | modalshow: false,
395 | commentshow: false
396 | });
397 | const datas = that.data.items;
398 | const titles = datas.title; //標題
399 | const desc = datas.description; //介绍
400 | const imgs = datas.thumb ? datas.thumb : 'https://www.zhmzjl.com/statics/images/blog/ncode.jpg'; //图片
401 | wx.getImageInfo({
402 | src: that.data.codeurl, //服务器返回的图片地址
403 | success: res => {
404 | let Path = res.path;
405 | that.createNewImg(Path, imgs, titles, desc);
406 | }
407 | })
408 | },
409 | /*
410 | 海报
411 | */
412 | createNewImg: function(codes, img, title, desc) {
413 | var that = this;
414 | var Rose = wx.createCanvasContext('mycanvas');
415 | Rose.setFillStyle("#ffffff")
416 | Rose.fillRect(0, 0, 600, 1000); //填充一个矩形。用 setFillStyle
417 | wx.getImageInfo({
418 | src: img, //服务器返回的图片地址
419 | success: function(res) {
420 | var thumb = res.path;
421 | var datee = new Date();
422 | var cctime = util.formatTime(datee);
423 | var bg = "/assets/images/44.png";
424 | Rose.drawImage(bg, 0, 737, 640, 395); //绘制首图
425 | Rose.drawImage(thumb, 20, 140, 560, 300); //绘制首图
426 | Rose.drawImage(codes, 360, 720, 200, 200); //绘制二维码
427 | Rose.setFontSize(30);
428 | Rose.setTextAlign('right'); //设置字体对齐
429 | Rose.setFillStyle('#1d8f59');
430 | Rose.fillText('KAPO博客', 560, 60);
431 | Rose.setFontSize(20);
432 | Rose.setFillStyle('#666');
433 | Rose.fillText(cctime, 560, 120);
434 | Rose.beginPath();
435 | Rose.lineWidth = "2";
436 | Rose.strokeStyle = "#1d8f59";
437 | Rose.rect(400, 20, 180, 60);
438 | Rose.stroke();
439 | Rose.beginPath();
440 | Rose.lineWidth = "2";
441 | Rose.strokeStyle = "#f2f2f2";
442 | Rose.rect(20, 690, 570, 230);
443 | Rose.stroke();
444 | Rose.setFillStyle("#333");
445 | Rose.setFontSize(20); //设置字体大小
446 | Rose.setTextAlign('center'); //设置字体对齐
447 | Rose.beginPath() //分割线
448 | Rose.stroke();
449 | Rose.setTextAlign('left');
450 | Rose.setFontSize(40);
451 | if (title.length <= 14) {
452 | Rose.fillText(title, 40, 500); //文章标题
453 | } else {
454 | Rose.fillText(title.substring(0, 14), 40, 500);
455 | Rose.fillText(title.substring(14, 26), 40, 550);
456 | }
457 | Rose.setFillStyle("#999");
458 | Rose.setFontSize(20);
459 | if (title.length <= 14 && desc.length >= 26) {
460 | Rose.fillText(desc.substring(0, 26), 40, 560);
461 | Rose.fillText(desc.substring(26, 50) + '...', 40, 595);
462 | } else if (title.length <= 14 && desc.length <= 26) {
463 | Rose.fillText(desc, 26, 560);
464 | } else if (title.length >= 14 && desc.length <= 26) {
465 | Rose.fillText(desc, 26, 640); //文章描述
466 | } else {
467 | Rose.fillText(desc.substring(0, 26), 40, 610);
468 | Rose.fillText(desc.substring(26, 50) + '...', 40, 645);
469 | }
470 | Rose.setTextAlign('left');
471 | Rose.setFontSize(28);
472 | Rose.setFillStyle('#666');
473 | Rose.fillText('Hi, 这篇文章很精彩,', 40, 770);
474 | Rose.fillText('我想转发给你!', 40, 820);
475 | Rose.setFillStyle('#999');
476 | Rose.setFontSize(20);
477 | Rose.fillText('长按识别阅读文章', 380, 950);
478 | wx.showToast({
479 | title: '分享图片生成中...',
480 | icon: 'loading',
481 | duration: 1000
482 | });
483 | Rose.draw();
484 | // 将生成好的图片保存到本地,需要延迟一会,绘制期间耗时
485 | setTimeout(function() {
486 | wx.canvasToTempFilePath({
487 | canvasId: 'mycanvas',
488 | success: function(res) {
489 | var tempFilePath = res.tempFilePath;
490 | that.setData({
491 | imagePath: tempFilePath,
492 | canvasHidden: true,
493 | commentShow: false
494 | });
495 | wx.hideToast()
496 | },
497 | fail: function(res) {}
498 | }, this);
499 | }, 1000);
500 | }
501 | })
502 | },
503 | //点击保存到相册
504 | baocun() {
505 | var that = this
506 | wx.saveImageToPhotosAlbum({
507 | filePath: that.data.imagePath,
508 | success(res) {
509 | wx.showModal({
510 | content: '图片已保存到相册,赶紧晒一下吧~',
511 | showCancel: false,
512 | confirmText: '好的',
513 | confirmColor: '#333',
514 | success: function(res) {
515 | if (res.confirm) {
516 | /* 该隐藏的隐藏 */
517 | that.setData({
518 | modalshow: true
519 | })
520 | }
521 | },
522 | fail: function(res) {}
523 | })
524 | }
525 | })
526 | },
527 | quxiao() {
528 | var that = this;
529 | that.setData({
530 | modalshow: true
531 | })
532 | },
533 | //点击生成
534 | getCode() { //生成二维码
535 | var that = this;
536 | let _params = {
537 | catid: that.data.catid,
538 | id: that.data.id
539 | }
540 | Api.creatcode(_params).then(res => {
541 | if (res.data.code == 0) {
542 | let _data = res.data.url;
543 | that.setData({
544 | codeurl: _data
545 | })
546 | }
547 | });
548 | }
549 | })
550 |
--------------------------------------------------------------------------------
/pages/detail/detail.json:
--------------------------------------------------------------------------------
1 | {
2 | "navigationBarTitleText": "文章详情",
3 | "enablePullDownRefresh": false,
4 | "usingComponents": {
5 | "loading": "../../components/loading/loading",
6 | "backtop": "../../components/backtop/backtop",
7 | "bottombar": "../../components/bottombar/bottombar",
8 | "copyright": "../../components/copyright/copyright"
9 | }
10 |
11 | }
12 |
--------------------------------------------------------------------------------
/pages/detail/detail.wxml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 | {{items.title}}
7 |
8 |
9 |
10 | {{items.inputtime}}
11 |
12 |
13 |
14 | {{items.views}}
15 |
16 |
17 | {{items.description}}
18 |
19 |
20 |
21 |
22 | — End —
23 |
24 | 阅读 {{items.views}}
25 |
26 |
27 | {{likenum}}
28 |
29 |
30 | {{items.url}}
31 |
32 |
33 |
34 | 推荐阅读
35 | {{top.title}}
36 |
37 |
38 |
72 |
73 |
74 |
75 |
76 |
77 | {{likenum}}
78 |
79 |
80 | 更多
81 |
82 |
86 |
87 |
88 |
89 |
90 |
91 |
92 |
93 |
94 |
95 |
96 |
97 |
98 |
99 |
100 |
101 |
102 |
103 |
104 |
105 |
106 |
107 |
108 |
109 |
--------------------------------------------------------------------------------
/pages/detail/detail.wxss:
--------------------------------------------------------------------------------
1 | image {
2 | display: block;
3 | width: 100%;
4 | }
5 |
6 | .Rose-box {
7 | background: #fff;
8 | }
9 |
10 | .Rose-imgitem {
11 | height: 330rpx;
12 | display: block;
13 | width: 100%;
14 | }
15 |
16 | .Rose-description {
17 | padding: 20rpx;
18 | margin: 20rpx 0;
19 | background: #eef0f4;
20 | color: #666;
21 | border: 2rpx solid #ddd;
22 | border-left: 16rpx solid #dddfe4;
23 | }
24 |
25 | .Rose-content {
26 | overflow: hidden;
27 | word-break: break-word;
28 | }
29 |
30 | .Rose-detail {
31 | font-size: 32rpx;
32 | line-height: 1.8;
33 | padding: 20rpx;
34 | color: #4f4f4f;
35 | background: #fff;
36 | }
37 |
38 | .Rose-title {
39 | color: #000;
40 | font-size: 48rpx;
41 | line-height: 1.4;
42 | }
43 |
44 | .Rose-addtime {
45 | display: flex;
46 | margin: 0 0 40rpx;
47 | color: #999;
48 | font-size: 24rpx;
49 | }
50 |
51 | .Rose-addtime .iconfont {
52 | font-size: 24rpx;
53 | margin-right: 6rpx;
54 | }
55 |
56 | .Rose-keywords {
57 | margin-right: 20rpx;
58 | }
59 |
60 | .wxParse-pre {
61 | padding: 0 20rpx 20rpx;
62 | margin: 20rpx 0;
63 | white-space: pre;
64 | overflow: auto;
65 | background: #282c34;
66 | color: #abb2bf;
67 | -webkit-overflow-scrolling: touch;
68 | }
69 |
70 | .Rose-small {
71 | padding: 0 10rpx;
72 | font-size: 30rpx;
73 | color: #999;
74 | }
75 |
76 | .wxParse-p {
77 | padding: 10rpx 0;
78 | font-size: 32rpx;
79 | word-break: break-word;
80 | }
81 |
82 | .Rose-lines, .wxParse-h3 {
83 | font-size: 36rpx;
84 | position: relative;
85 | padding: 10rpx 20rpx;
86 | color: #333;
87 | }
88 |
89 | .Rose-lines:before, .wxParse-h3:before {
90 | position: absolute;
91 | top: 16rpx;
92 | left: 0;
93 | width: 8rpx;
94 | height: 36rpx;
95 | content: '';
96 | background: #4bb777;
97 | }
98 |
99 | .wxParse-h3 {
100 | margin: 40rpx 0 0;
101 | font-weight: 400;
102 | }
103 |
104 | .wxParse-h3:before {
105 | top: 24rpx;
106 | }
107 |
108 | .wxParse-li {
109 | position: relative;
110 | padding-left: 40rpx;
111 | }
112 |
113 | .wxParse-li:before {
114 | position: absolute;
115 | left: 10rpx;
116 | top: 20rpx;
117 | width: 10rpx;
118 | height: 10rpx;
119 | background: #999;
120 | content: '';
121 | border-radius: 100%;
122 | }
123 |
124 | /*.wxParse-div {
125 | word-break: break-all;
126 | }
127 | */
128 |
129 | .wxParse-h5 {
130 | padding: 5rpx 0;
131 | font-weight: 600;
132 | }
133 |
134 | /*top10推荐*/
135 |
136 | .Rose-top {
137 | background: #fff;
138 | padding: 20rpx 0;
139 | }
140 |
141 | .Rose-topli {
142 | position: relative;
143 | padding: 20rpx 20rpx 20rpx 40rpx;
144 | font-size: 28rpx;
145 | color: #999;
146 | }
147 |
148 | .Rose-topli:before {
149 | position: absolute;
150 | left: 20rpx;
151 | top: 34rpx;
152 | width: 10rpx;
153 | height: 10rpx;
154 | background: #4bb777;
155 | content: '';
156 | border-radius: 100%;
157 | }
158 |
159 | .Rose-read {
160 | margin: 40rpx 0 0;
161 | color: #999;
162 | font-size: 30rpx;
163 | }
164 |
165 | .Rose-Right {
166 | float: right;
167 | font-size: 32rpx;
168 | color: #999;
169 | }
170 |
171 | .Rose-Right .iconfont {
172 | margin-top: -8rpx;
173 | vertical-align: middle;
174 | font-size: 34rpx;
175 | }
176 |
177 | /*改版评论*/
178 |
179 | .icon-like-fill {
180 | color: #4bb777;
181 | }
182 |
183 | /*.Rose-fixed {
184 | position: fixed;
185 | left: 0;
186 | bottom: 0;
187 | width: 100%;
188 | border-top: 2rpx solid #d9d9d9;
189 | z-index: 5;
190 | background: #fff;
191 | }
192 | .Rose-flex {
193 | padding: 14rpx 20rpx;
194 | display: flex;
195 | }
196 | .Rose-input {
197 | flex: 1;
198 | height: 76rpx;
199 | line-height: 76rpx;
200 | padding: 0 20rpx;
201 | background: #f5f5f5;
202 | border: 2rpx solid #d9d9d9;
203 | font-size: 30rpx;
204 | border-radius: 4rpx;
205 | }
206 | button[disabled] {
207 | background: #d9d9d9;
208 | color: #999;
209 | border-radius: 4rpx;
210 | }
211 | button::after {
212 | border: 1px solid #d9d9d9;
213 | border-radius: 4rpx;
214 | }
215 | .Rose-post {
216 | flex: none;
217 | height: 80rpx;
218 | background: #4bb777;
219 | margin: 0 0 0 10rpx;
220 | line-height: 80rpx;
221 | color: #fff;
222 | font-size: 26rpx;
223 | border-radius: 4rpx;
224 | padding: 0 20rpx;
225 | text-align: center;
226 | box-shadow: none;
227 | }*/
228 |
229 | /*最新*/
230 |
231 | .Rose-comments {
232 | background: #fff;
233 | padding: 20rpx 0 0;
234 | }
235 |
236 | .Rose-lists {
237 | padding: 20rpx;
238 | }
239 |
240 | .Rose-resource {
241 | display: flex;
242 | }
243 |
244 | .Rose-image {
245 | flex: none;
246 | width: 80rpx;
247 | height: 80rpx;
248 | border-radius: 4rpx;
249 | }
250 |
251 | .Rose-user {
252 | flex: 1;
253 | padding: 0 0 20rpx;
254 | font-size: 24rpx;
255 | color: #a8a8a8;
256 | line-height: 1;
257 | border-bottom: 1rpx solid #f2f2f2;
258 | }
259 |
260 | .Rose-items {
261 | padding: 30rpx 0 0;
262 | }
263 |
264 | .Rose-items:last-child .Rose-user {
265 | border-bottom: none;
266 | }
267 |
268 | .Rose-form {
269 | margin: 0 0 0 20rpx;
270 | }
271 |
272 | .Rose-names {
273 | font-size: 28rpx;
274 | color: #666;
275 | }
276 |
277 | .Rose-times {
278 | padding: 16rpx 0;
279 | color: #999;
280 | font-size: 20rpx;
281 | }
282 |
283 | .Rose-comment-content {
284 | color: #666;
285 | font-size: 32rpx;
286 | line-height: 44rpx;
287 | }
288 |
289 | .Rose-back {
290 | margin: 20rpx 0 0 20rpx;
291 | color: #999;
292 | font-size: 28rpx;
293 | padding: 10rpx;
294 | line-height: 1.6;
295 | background: #f5f5f5;
296 | }
297 |
298 | .Rose-back-item {
299 | line-height: 1.4;
300 | word-break: break-all;
301 | padding: 5rpx 0;
302 | }
303 |
304 | .Rose-tt {
305 | color: #333;
306 | }
307 |
308 | .Rose-empty {
309 | padding: 60rpx 0 80rpx;
310 | text-align: center;
311 | font-size: 14px;
312 | color: #999;
313 | }
314 |
315 | .Rose-finish {
316 | padding: 30rpx 0;
317 | text-align: center;
318 | color: #999;
319 | }
320 |
321 | .Rose-end {
322 | padding: 30rpx 0;
323 | text-align: center;
324 | line-height: 1;
325 | border-top: 1rpx solid #f2f2f2;
326 | color: #999;
327 | }
328 |
329 | .Rose-word {
330 | line-height: 1;
331 | padding: 30rpx 0;
332 | font-size: 28rpx;
333 | color: #999;
334 | }
335 |
336 | .iconfont.icon-kafei {
337 | display: block;
338 | font-size: 90rpx;
339 | color: #eee;
340 | margin-bottom: 10rpx;
341 | }
342 |
343 | .Rose-link {
344 | margin: 20rpx 0 0;
345 | padding: 5rpx;
346 | background: #f5f5f5;
347 | color: #999;
348 | }
349 |
350 | .Rose-fixed {
351 | position: fixed;
352 | left: 0;
353 | bottom: 0;
354 | width: 100%;
355 | border-top: 2rpx solid #d9d9d9;
356 | z-index: 5;
357 | background: #fff;
358 | }
359 |
360 | .Rose-flex {
361 | padding: 12rpx 20rpx;
362 | display: flex;
363 | }
364 |
365 | .Rose-none {
366 | width: 80rpx;
367 | flex: none;
368 | font-size: 20rpx;
369 | color: #999;
370 | line-height: 40rpx;
371 | }
372 |
373 | .Rose-none .iconfont {
374 | display: block;
375 | font-size: 48rpx;
376 | color: #4bb777;
377 | font-weight: 600;
378 | }
379 |
380 | .Rose-none .iconfont.icon-heart-fill {
381 | color: #4bb777;
382 | }
383 |
384 | .Rose-input {
385 | flex: 1;
386 | margin: 0 0 0 10rpx;
387 | height: 80rpx;
388 | line-height: 80rpx;
389 | padding: 0 20rpx;
390 | background: #eef0f4;
391 | border: 1rpx solid #f2f2f2;
392 | font-size: 26rpx;
393 | border-radius: 4rpx;
394 | color: #666;
395 | }
396 |
397 | /* components/photo/photo.wxss */
398 |
399 | .Rose-photo {
400 | width: 100%;
401 | height: 100%;
402 | background: rgba(0, 0, 0, 0.7);
403 | position: fixed;
404 | top: 0;
405 | left: 0;
406 | right: 0;
407 | bottom: 0;
408 | z-index: 10;
409 | }
410 |
411 | .Rose-done {
412 | width: 80%;
413 | height: 80%;
414 | position: fixed;
415 | top: 50rpx;
416 | left: 50%;
417 | margin-left: -40%;
418 | z-index: 10;
419 | }
420 |
421 | .Rose-btn {
422 | display: block;
423 | width: 40%;
424 | height: 100rpx;
425 | padding: 0;
426 | line-height: 100rpx;
427 | text-align: center;
428 | position: fixed;
429 | bottom: 10%;
430 | background: #fff;
431 | color: #333;
432 | font-size: 32rpx;
433 | border: 1rpx solid #f2f2f2;
434 | z-index: 11;
435 | }
436 |
437 | .Rose-save {
438 | left: 50%;
439 | color: #1d8f59;
440 | }
441 |
442 | .Rose-close {
443 | left: 10%;
444 | }
445 |
446 | .Rose-canvas {
447 | width: 0;
448 | height: 0;
449 | overflow: hidden;
450 | }
451 |
452 | .Rose-flexform {
453 | flex: 1;
454 | margin: 0 20rpx 0 0;
455 | height: 80rpx;
456 | line-height: 80rpx;
457 | }
458 |
459 | .Rose-post {
460 | flex: none;
461 | height: 83rpx;
462 | background: #4bb777;
463 | line-height: 83rpx;
464 | color: #fff;
465 | font-size: 26rpx;
466 | border-radius: 4rpx;
467 |
468 | text-align: center;
469 | box-shadow: none;
470 | }
471 |
--------------------------------------------------------------------------------
/pages/feedback/feedback.js:
--------------------------------------------------------------------------------
1 | // pages/more/more.js
2 | import Api from '/../../utils/api.js';
3 | const app = getApp();
4 | var page = 1;
5 | Page({
6 | /**
7 | * 页面的初始数据
8 | */
9 | data: {
10 | show: false, //不显示分享
11 | // page: 1,
12 | content: '',
13 | disabled: true,
14 | comments: [],
15 | loadMore: true,
16 | canIUse: wx.canIUse('button.open-type.getUserInfo'),
17 | isRose: false,
18 | focus: false,
19 | placeholder: `点击评论回复...`,
20 | pid: 0,
21 | userInfo: {},
22 | reply_username: '',
23 | },
24 | /**
25 | * 生命周期函数--监听页面加载
26 | */
27 | onLoad: function (options) {
28 | var that = this;
29 | let _userInfo = wx.getStorageSync('userInfo')
30 | that.setData({
31 | userInfo: _userInfo
32 | });
33 | if (wx.getStorageSync('userInfo')) { } else {
34 | wx.getSetting({
35 | success: ress=>{
36 | if (ress.authSetting['scope.userInfo']) {
37 | // 已经授权,可以直接调用 getUserInfo 获取头像昵称
38 | wx.getUserInfo({
39 | success: res=>{
40 | let _userInfo = res.userInfo;
41 | app.globalData.userInfo = _userInfo;
42 | wx.setStorageSync('userInfo', _userInfo)
43 | },
44 | fail: res=>{ }
45 | })
46 | }
47 | }
48 | });
49 | }
50 | that.commentlists(); //反馈列表
51 | },
52 | /**
53 | * 生命周期函数--监听页面初次渲染完成
54 | */
55 | onReady: function () { },
56 | /**
57 | * 生命周期函数--监听页面显示
58 | */
59 | onShow: function () { },
60 | /**
61 | * 生命周期函数--监听页面隐藏
62 | */
63 | onHide: function () { },
64 | /**
65 | * 生命周期函数--监听页面卸载
66 | */
67 | onUnload: function () { },
68 | /**
69 | * 页面相关事件处理函数--监听用户下拉动作
70 | */
71 | onPullDownRefresh: function () {
72 | var that = this;
73 | page = 1;
74 | that.setData({
75 | comments: [],
76 | });
77 | that.commentlists();
78 | },
79 | /**
80 | * 页面上拉触底事件的处理函数
81 | */
82 | onReachBottom: function () {
83 | var that = this;
84 | page = page + 1;
85 | if (that.data.loadMore) {
86 | that.commentlists();
87 | }
88 | },
89 | /**
90 | * 用户点击右上角分享
91 | */
92 | onShareAppMessage: function (res) {
93 | return {
94 | title: '锲而舍之,朽木不折;锲而不舍,金石可镂',
95 | imageUrl: '/assets/images/share.jpg'
96 | }
97 | },
98 | forRemark(e) {
99 | var that = this;
100 | let _data = e.detail.value;
101 | // 禁止输入空格
102 | var regu = "^[ ]+$";
103 | var re = new RegExp(regu);
104 | var emptyy = re.test(_data);
105 | if (emptyy) return false;
106 | //end
107 | that.setData({
108 | content: _data
109 | });
110 | if (that.data.content) {
111 | that.setData({
112 | disabled: false
113 | })
114 | } else {
115 | that.setData({
116 | disabled: true
117 | })
118 | }
119 | },
120 | rewardRose() {
121 | var that = this;
122 | that.setData({
123 | show: true
124 | })
125 | },
126 | backContent(e) { //回复的评论
127 | let _from = e.currentTarget.dataset.from;
128 | let _id = e.currentTarget.dataset.pid;
129 | this.setData({
130 | placeholder: `回复 ${_from}`,
131 | focus: true,
132 | reply_username: _from,
133 | pid: _id
134 | });
135 | },
136 | bindGetUserInfo(e) {
137 | var that = this;
138 | var userInfo = {};
139 | if (e.detail.userInfo) {
140 | userInfo = e.detail.userInfo;
141 | } else {
142 | wx.getUserInfo({
143 | success: function (res) {
144 | userInfo = res.userInfo;
145 | },
146 | fail: function (res) {
147 | wx.showModal({
148 | showCancel: false,
149 | confirmColor: '#1d8f59',
150 | confirmColor: '#1d8f59',
151 | content: '授权通过后才能评论哟,请重新授权!'
152 | })
153 | }
154 | })
155 | }
156 | if (JSON.stringify(userInfo) == '{}') return false;
157 | that.setData({
158 | userInfo: userInfo
159 | })
160 | that.postComments()
161 | },
162 | postComments() {
163 | var that = this;
164 | if (!that.data.content) {
165 | wx.showModal({
166 | showCancel: false,
167 | confirmColor: '#1d8f59',
168 | content: '评论不能为空!'
169 | });
170 | return false;
171 | }
172 | if (!that.data.userInfo) return false;
173 | wx.showLoading();
174 | let _params = {
175 | miniFormId: that.data.formId,
176 | type: "punch",
177 | pid: that.data.pid, // 父评论ID,默认为0
178 | from_username: that.data.userInfo.nickName, // 评论者用户名
179 | from_avatar: that.data.userInfo.avatarUrl, // 评论者头像
180 | reply_username: that.data.reply_username, // 回复了谁,pid不为0时,不允许未空
181 | reply_avatar: "", // 回复了谁的头像,允许为空
182 | content: that.data.content
183 | }
184 | Api.postcomments(_params).then(res => {
185 | if (!res.data.code) {
186 | wx.showToast({
187 | title: '评论成功',
188 | icon: 'success',
189 | duration: 2000
190 | })
191 | page = 1;
192 | that.setData({
193 | content: '',
194 | comments: [],
195 | reply_username: '',
196 | pid: 0,
197 | placeholder: '点击评论回复...',
198 | disabled: true
199 | });
200 | that.commentlists();
201 | }
202 | });
203 | },
204 | commentlists() {
205 | var that = this;
206 | let _params = {
207 | type: "punch",
208 | page: page,
209 | pagesize: 10
210 | }
211 | Api.commentlists(_params).then(res => {
212 | if (res.data.code == 0) {
213 | let _data = res.data.data;
214 | let _count = res.data.count;
215 | let _arr = [...that.data.comments,..._data];
216 | that.setData({
217 | comments: _arr,
218 | count: _count
219 | });
220 | if (_data.length < 10) {
221 | that.setData({
222 | loadMore: false
223 | });
224 | }
225 | } else {
226 | wx.showModal({
227 | showCancel: false,
228 | confirmColor: '#1d8f59',
229 | content: '评论加载失败!'
230 | })
231 | }
232 | });
233 | },
234 | modalCancel() {
235 | this.setData({
236 | show: false
237 | })
238 | },
239 | goHome: function(){
240 | wx.switchTab({
241 | url: '../index/index'
242 | });
243 | },
244 | testSubmit:function(e){
245 | console.log(e.detail.formId)
246 | }
247 | })
248 |
--------------------------------------------------------------------------------
/pages/feedback/feedback.json:
--------------------------------------------------------------------------------
1 | {
2 | "navigationBarTitleText": "留言",
3 | "enablePullDownRefresh": true,
4 | "usingComponents": {
5 | "loading": "../../components/loading/loading",
6 | "share": "../../components/share/share",
7 | "backtop": "../../components/backtop/backtop"
8 | }
9 | }
10 |
--------------------------------------------------------------------------------
/pages/feedback/feedback.wxml:
--------------------------------------------------------------------------------
1 |
2 |
32 |
33 | 我是有底线滴~
34 |
35 |
36 |
37 |
38 |
39 |
40 |
41 |
42 |
43 |
44 |
45 |
46 |
49 |
50 |
51 |
52 |
53 |
54 |
55 | 您的分享与关注是对我最大的奖赏!
56 |
57 |
58 |
59 |
--------------------------------------------------------------------------------
/pages/feedback/feedback.wxss:
--------------------------------------------------------------------------------
1 | /* pages/feedback/feedback.wxss */
2 |
3 | /*改版评论*/
4 |
5 | .Rose-fixed {
6 | position: fixed;
7 | left: 0;
8 | bottom: 0;
9 | width: 100%;
10 | border-top: 2rpx solid #d9d9d9;
11 | background: #fff;
12 | z-index: 5;
13 | }
14 |
15 | .Rose-flex {
16 | padding: 14rpx 20rpx;
17 | display: flex;
18 | }
19 |
20 | .Rose-none .iconfont {
21 | font-size: 48rpx;
22 | padding: 15rpx 10rpx 0 0;
23 | color: #4bb777;
24 | }
25 |
26 | .Rose-none .iconfont.icon-hongbao1 {
27 | color: #4bb777;
28 | }
29 |
30 | .Rose-input {
31 | flex: 1;
32 | height: 76rpx;
33 | line-height: 76rpx;
34 | margin: 0 20rpx;
35 | padding: 0 20rpx;
36 | background: #f5f5f5;
37 | border: 2rpx solid #d9d9d9;
38 | font-size: 30rpx;
39 | border-radius: 4rpx;
40 | }
41 |
42 | button[disabled] {
43 | background: #d9d9d9;
44 | color: #999;
45 | border-radius: 4rpx;
46 | }
47 |
48 | button::after {
49 | border: 1px solid #d9d9d9;
50 | border-radius: 4rpx;
51 | }
52 |
53 | .Rose-post {
54 | flex: none;
55 | height: 78rpx;
56 | background: #4bb777;
57 | line-height: 78rpx;
58 | color: #fff;
59 | font-size: 26rpx;
60 | border-radius: 4rpx;
61 | padding: 0 20rpx;
62 | text-align: center;
63 | box-shadow: none;
64 | }
65 |
66 | .Rose-comments {
67 | margin: 20rpx 0 0;
68 | background: #fff;
69 | }
70 |
71 | .Rose-lists {
72 | padding: 20rpx;
73 | }
74 |
75 | .Rose-resource {
76 | display: flex;
77 | }
78 |
79 | .Rose-image {
80 | flex: none;
81 | width: 70rpx;
82 | height: 70rpx;
83 | border-radius: 4rpx;
84 | }
85 |
86 | .Rose-image .iconfont {
87 | font-size: 64rpx;
88 | color: #ccc;
89 | }
90 |
91 | .Rose-user {
92 | flex: 1;
93 | padding: 0 0 20rpx;
94 | font-size: 24rpx;
95 | color: #a8a8a8;
96 | line-height: 1;
97 | border-bottom: 1rpx solid #f2f2f2;
98 | }
99 |
100 | .Rose-items {
101 | padding: 30rpx 0 0;
102 | }
103 |
104 | .Rose-items:last-child .Rose-user {
105 | border-bottom: none;
106 | }
107 |
108 | .Rose-words {
109 | margin: 0 0 0 20rpx;
110 | }
111 |
112 | .Rose-names {
113 | font-size: 28rpx;
114 | color: #666;
115 | }
116 |
117 | .Rose-times {
118 | padding: 16rpx 0;
119 | color: #999;
120 | font-size: 20rpx;
121 | }
122 |
123 | .Rose-edit {
124 | float: right;
125 | }
126 |
127 | .Rose-edit icon {
128 | font-size: 36rpx;
129 | margin: 0 10rpx;
130 | color: #999;
131 | }
132 |
133 | .Rose-comment-content {
134 | color: #666;
135 | font-size: 32rpx;
136 | line-height: 44rpx;
137 | }
138 |
139 | .Rose-back {
140 | margin: 20rpx 0 0 20rpx;
141 | color: #999;
142 | font-size: 28rpx;
143 | padding: 10rpx;
144 | line-height: 1.6;
145 | background: #f5f5f5;
146 | }
147 |
148 | .Rose-back-item {
149 | line-height: 1.4;
150 | word-break: break-all;
151 | padding: 5rpx 0;
152 | }
153 |
154 | .Rose-tt {
155 | color: #333;
156 | }
157 |
158 | .Rose-feeds {
159 | padding: 10px;
160 | border-bottom: 2rpx solid #f2f2f2;
161 | font-size: 32rpx;
162 | color: #333;
163 | }
164 |
165 | .Rose-empty {
166 | padding: 60rpx 0 80rpx;
167 | text-align: center;
168 | font-size: 14px;
169 | color: #999;
170 | }
171 |
172 | .Rose-end {
173 | margin: -20rpx 0 0;
174 | padding: 30rpx 0;
175 | text-align: center;
176 | line-height: 1;
177 | border-top: 1rpx solid #f2f2f2;
178 | }
179 |
180 | .Rose-word {
181 | line-height: 1;
182 | padding: 30rpx 0;
183 | font-size: 28rpx;
184 | color: #999;
185 | }
186 |
187 | .iconfont.icon-kafei {
188 | display: block;
189 | font-size: 90rpx;
190 | color: #eee;
191 | margin-bottom: 10rpx;
192 | }
193 |
194 | .modal-content {
195 | padding: 59rpx 0;
196 | }
197 |
--------------------------------------------------------------------------------
/pages/index/index.js:
--------------------------------------------------------------------------------
1 | // pages/index/index.js
2 | import Api from '/../../utils/api.js';
3 | const app = getApp();
4 | var page = 1;
5 | Page({
6 | /**
7 | * 页面的初始数据
8 | */
9 | data: {
10 | isPlay: true,
11 | notices: [],
12 | items: [],
13 | loadMore: true,
14 | every: [{
15 | icon: 'icon-yinyue',
16 | name: '生活',
17 | id: 4
18 | }, {
19 | icon: 'icon-yingyu',
20 | name: '外语',
21 | id: 3
22 | }, {
23 | icon: 'icon-book',
24 | name: '读书',
25 | id: 2
26 | }, {
27 | icon: 'icon-jianshen',
28 | name: '健身',
29 | id: 1
30 | }
31 | // {
32 | // icon: 'icon-xiangji',
33 | // name: '摄影',
34 | // id: 5
35 | // }
36 | ]
37 | },
38 | /**
39 | * 生命周期函数--监听页面加载
40 | */
41 | onLoad: function (options) {
42 | var that = this;
43 | wx.hideLoading();
44 | that.getNotice();
45 | },
46 | /**
47 | * 生命周期函数--监听页面初次渲染完成
48 | */
49 | onReady: function (e) { },
50 | /**
51 | * 生命周期函数--监听页面显示
52 | */
53 | onShow: function () { },
54 | /**
55 | * 生命周期函数--监听页面隐藏
56 | */
57 | onHide: function () { },
58 | /**
59 | * 生命周期函数--监听页面卸载
60 | */
61 | onUnload: function () { },
62 | /**
63 | * 页面相关事件处理函数--监听用户下拉动作
64 | */
65 | onPullDownRefresh: function () {
66 | let that = this;
67 | page = 1;
68 | that.setData({
69 | items: [],
70 | loadMore: true
71 | });
72 | if (that.data.loadMore) {
73 | that.getNotice();
74 | }
75 | },
76 | /**
77 | * 页面上拉触底事件的处理函数
78 | */
79 | onReachBottom: function () {
80 | let that = this;
81 | page = page + 1;
82 | if (that.data.loadMore) {
83 | that.getLists();
84 | }
85 | },
86 | /**
87 | * 用户点击右上角分享
88 | */
89 | onShareAppMessage: function () {
90 | return {
91 | title: '锲而舍之,朽木不折;锲而不舍,金石可镂',
92 | imageUrl: '/assets/images/share.jpg'
93 | }
94 | },
95 | articleDetail(e) {
96 | let {id, catid} = e.currentTarget.dataset;
97 | wx.navigateTo({
98 | url: `../detail/detail?catid=${catid}&id=${id}`
99 | });
100 | },
101 | getLists(e) {
102 | let that = this;
103 | let params = {
104 | page: page,
105 | pagesize: 8
106 | }
107 | Api.all(params).then(res => { //文章列表
108 | if (!res.data.code) {
109 | let _data = res.data.data;
110 | let _items = [...that.data.items, ..._data];
111 | if (_data.length < 8) {
112 | that.setData({
113 | loadMore: false
114 | })
115 | }
116 | that.setData({
117 | items: _items
118 | });
119 | }
120 | });
121 | },
122 | top10() {
123 | Api.hits().then(res => { //文章列表
124 | if (!res.data.code) {
125 | let _data = res.data.data;
126 | this.setData({
127 | top10: _data
128 | });
129 | }
130 | });
131 | },
132 | getNotice() {
133 | var that = this;
134 | let _params = {
135 | catid: 21, //项目id
136 | page: 1,
137 | pagesize: 3 // 可选,默认为为5
138 | }
139 | Api.lists(_params).then(res => {
140 | if (!that.data.code) {
141 | let _data = res.data.data;
142 | that.setData({
143 | notices: _data,
144 | })
145 | that.getLists();
146 | wx.hideLoading();
147 | }
148 | });
149 | },
150 | onPageScroll(e) {
151 | var _backShow = false;
152 | if (e.scrollTop > 100) {
153 | _backShow = true;
154 | } else {
155 | _backShow = true;
156 | }
157 | },
158 | controlMusic() {
159 | if (this.data.isPlay) {
160 | app.AppMusic.pause();
161 | this.setData({
162 | isPlay: false
163 | });
164 | } else {
165 | app.AppMusic.play();
166 | this.setData({
167 | isPlay: true
168 | });
169 | }
170 | }
171 | })
172 |
--------------------------------------------------------------------------------
/pages/index/index.json:
--------------------------------------------------------------------------------
1 | {
2 | "navigationBarTitleText": "KAPO博客",
3 | "usingComponents": {
4 | "loading": "../../components/loading/loading",
5 | "backtop": "../../components/backtop/backtop"
6 | }
7 | }
8 |
--------------------------------------------------------------------------------
/pages/index/index.wxml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 | {{notice.title}}
12 | {{notice.description}}
13 |
14 |
15 |
16 |
17 |
29 |
30 |
31 |
32 |
33 |
34 |
35 |
36 |
37 | {{item.title}}
38 |
39 |
40 | {{comm.formatDate(item.updatetime)}}
41 |
42 |
43 | {{item.views}}
44 |
45 | {{item.cnum}}
46 |
47 | {{item.description}}
48 |
49 |
50 |
51 |
52 |
53 | 我是有底线滴~
54 |
55 |
56 |
57 |
58 |
--------------------------------------------------------------------------------
/pages/index/index.wxss:
--------------------------------------------------------------------------------
1 | .Rose-floor1 {
2 | background: #1d8f59;
3 | color: #fff;
4 | font-size: 26rpx;
5 | }
6 |
7 | .Rose-swiper {
8 | height: 260rpx;
9 | padding: 40rpx 40rpx 0;
10 | text-align: center;
11 | }
12 |
13 | .Rose-top-quote {
14 | margin: 0 20rpx 30rpx;
15 | font-size: 32rpx;
16 | text-align: center;
17 | }
18 |
19 | .Rose-floor2 {
20 | background: #fff;
21 | }
22 |
23 | .Rose-menu {
24 | padding: 40rpx 30rpx 20rpx;
25 | display: flex;
26 | flex-flow: row;
27 | justify-content: space-between;
28 | }
29 |
30 | .icon-pinglun3 {
31 | padding-left: 20rpx;
32 | }
33 |
34 | .Rose-news {
35 | overflow: hidden;
36 | margin: 20rpx;
37 | background: #fff;
38 | border-radius: 8rpx;
39 | }
40 |
41 | .Rose-title {
42 | display: -webkit-box;
43 | margin: 10rpx 20rpx 0;
44 | font-size: 34rpx;
45 | color: #333;
46 | white-space: pre-wrap;
47 | word-break: break-word;
48 | }
49 |
50 | .Rose-imgitem {
51 | flex: none;
52 | width: 100%;
53 | height: 300rpx;
54 | overflow: hidden;
55 | display: block;
56 | }
57 |
58 | .Rose-content {
59 | position: relative;
60 | color: #333;
61 | }
62 |
63 | .Rose-detail {
64 | padding: 10rpx 20rpx 20rpx;
65 | font-size: 28rpx;
66 | color: #999;
67 | z-index: 3;
68 | line-height: 1.5;
69 | }
70 |
71 | .Rose-bottom {
72 | position: absolute;
73 | top: 244rpx;
74 | width: 100%;
75 | display: flex;
76 | margin: 10rpx 0 0;
77 | padding: 0 20rpx;
78 | color: #fff;
79 | line-height: 2;
80 | background: rgba(0, 0, 0, 0.2);
81 | }
82 |
83 | .Rose-icon {
84 | font-size: 24rpx;
85 | margin-right: 24rpx;
86 | }
87 |
88 | .Rose-bottom .iconfont {
89 | margin: -22rpx 0 0;
90 | font-size: 24rpx;
91 | }
92 |
93 | .Rose-menu {
94 | padding: 20rpx;
95 | display: flex;
96 | flex-flow: row;
97 | justify-content: space-between;
98 | }
99 |
100 | .Rose-kinds {
101 | width: 90rpx;
102 | text-align: center;
103 | font-size: 24rpx;
104 | color: #333;
105 | }
106 |
107 | .Rose-kinds .iconfont {
108 | font-size: 46rpx;
109 | display: block;
110 | }
111 |
112 | .Rose-circle {
113 | border-radius: 100%;
114 | color: #fff;
115 | width: 90rpx;
116 | height: 90rpx;
117 | line-height: 90rpx;
118 | margin: 0 auto 8rpx;
119 | }
120 |
121 | .Rose-music {
122 | position: absolute;
123 | right: 20rpx;
124 | top: 0;
125 | width: 72rpx;
126 | height: 72rpx;
127 | line-height: 72rpx;
128 | text-align: center;
129 | z-index: 2;
130 | }
131 |
132 | .Rose-play {
133 | position: relative;
134 | line-height: 72rpx;
135 | }
136 |
137 | .Rose-rotate {
138 | animation: rotate 1s linear infinite;
139 | }
140 |
141 | .icon-CD {
142 | font-size: 48rpx;
143 | margin-top: 10rpx;
144 | color: #fefefe;
145 | }
146 |
147 | @keyframes rotate {
148 | 0% {
149 | -webkit-transform: rotate(0deg);
150 | transform: rotate(0deg);
151 | transform-origin: 0, 0;
152 | }
153 |
154 | 100% {
155 | -webkit-transform: rotate(360deg);
156 | transform: rotate(360deg);
157 | transform-origin: 0, 0;
158 | }
159 | }
160 |
--------------------------------------------------------------------------------
/pages/lists/lists.js:
--------------------------------------------------------------------------------
1 | // pages/lists/lists.js
2 | import Api from '/../../utils/api.js';
3 | const app = getApp();
4 | var page = 1;
5 | Page({
6 | /**
7 | * 页面的初始数据
8 | */
9 | data: {
10 | // page: 1,
11 | items: [],
12 | loadMore: true,
13 | catid: '11',
14 | kinds: app.globalData.kinds
15 | },
16 | /**
17 | * 生命周期函数--监听页面加载
18 | */
19 | onLoad: function (options) {
20 | wx.showLoading();
21 | this.getLists();
22 | },
23 | /**
24 | * 生命周期函数--监听页面初次渲染完成
25 | */
26 | onReady: function () { },
27 | /**
28 | * 生命周期函数--监听页面显示
29 | */
30 | onShow: function () {
31 | },
32 | /**
33 | * 生命周期函数--监听页面隐藏
34 | */
35 | onHide: function () { },
36 | /**
37 | * 生命周期函数--监听页面卸载
38 | */
39 | onUnload: function () { },
40 | /**
41 | * 页面相关事件处理函数--监听用户下拉动作
42 | */
43 | onPullDownRefresh: function () {
44 | this.setData({
45 | // page: 1,
46 | items: []
47 | });
48 | page = 1;
49 | this.getLists();
50 | },
51 | /**
52 | * 页面上拉触底事件的处理函数
53 | */
54 | onReachBottom: function () {
55 | var that = this;
56 | page = page + 1;
57 | if (that.data.loadMore) {
58 | that.getLists();
59 | }
60 | },
61 | /**
62 | * 用户点击右上角分享
63 | */
64 | onShareAppMessage: function () {
65 | return {
66 | title: `锲而舍之,朽木不折;锲而不舍,金石可镂`,
67 | imageUrl: '/assets/images/share.jpg'
68 | }
69 | },
70 | articleDetail: function (e) {
71 | let id = e.currentTarget.dataset.id;
72 | let catid = e.currentTarget.dataset.catid
73 | wx.navigateTo({
74 | url: `../detail/detail?catid=${catid}&id=${id}`
75 | })
76 | },
77 | showOne: function (e) {
78 | let catid = e.currentTarget.dataset.catid;
79 | if (catid == this.data.catid) return false;
80 | page = 1;
81 | this.setData({
82 | catid: catid,
83 | items: [],
84 | loadMore: true
85 | });
86 | this.getLists();
87 | },
88 |
89 | getLists() {
90 | var that = this;
91 | var cat = that.data.catid;
92 | let params = {
93 | pagesize: 10,
94 | page: page,
95 | catid: cat
96 | }
97 | Api.lists(params).then(res => { //文章列表
98 | if (!res.data.code) {
99 | let _data = res.data.data;
100 | let _items = [...that.data.items, ..._data];
101 | that.setData({
102 | items: _items
103 | });
104 | if (_data.length < 10) {
105 | that.setData({
106 | loadMore: false
107 | });
108 | }
109 | wx.hideLoading();
110 | }
111 | });
112 | },
113 | })
114 |
--------------------------------------------------------------------------------
/pages/lists/lists.json:
--------------------------------------------------------------------------------
1 | {
2 | "navigationBarTitleText": "文章分类",
3 | "enablePullDownRefresh": true,
4 | "usingComponents": {
5 | "loading": "../../components/loading/loading",
6 | "backtop": "../../components/backtop/backtop"
7 | }
8 | }
9 |
--------------------------------------------------------------------------------
/pages/lists/lists.wxml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 | {{rose.name}}
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 | {{item.title}}
16 |
17 |
18 | {{comm.formatTime(item.updatetime)}}
19 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 | 我是有底线滴~
31 |
32 |
33 |
34 |
35 |
36 |
--------------------------------------------------------------------------------
/pages/lists/lists.wxss:
--------------------------------------------------------------------------------
1 | /* pages/lists/lists.wxss */
2 |
3 | .Rose-fixed {
4 | position: fixed;
5 | left: 0;
6 | top: 0;
7 | width: 100%;
8 | height: 130rpx;
9 | padding: 0 20rpx;
10 | margin-bottom: 20rpx;
11 | background: #fff;
12 | border-bottom: 1rpx solid #f2f2f2;
13 | }
14 |
15 | .Rose-imgnotice {
16 | flex: none;
17 | width: 240rpx;
18 | max-height: 140rpx;
19 | margin: 10rpx 20rpx 0 0;
20 | border-radius: 4rpx;
21 | }
22 |
23 | .Rose-list {
24 | margin: 150rpx 0 0 0;
25 | padding: 0 20rpx;
26 | background: #fff;
27 | }
28 |
29 | .Rose-article {
30 | padding: 20rpx 0;
31 | display: flex;
32 | }
33 |
34 | .Rose-title {
35 | position: relative;
36 | flex: 1;
37 | text-align: center;
38 | font-size: 26rpx;
39 | color: #666;
40 | }
41 |
42 | .Rose-title:before {
43 | position: absolute;
44 | top: 10rpx;
45 | right: 0;
46 | width: 2rpx;
47 | height: 70rpx;
48 | background: #f2f2f2;
49 | content: '';
50 | }
51 |
52 | .Rose-title:last-child:before {
53 | background: transparent;
54 | }
55 |
56 | .Rose-title:after {
57 | position: absolute;
58 | bottom: -20rpx;
59 | left: 50%;
60 | width: 0;
61 | height: 4rpx;
62 | background: transparent;
63 | content: '';
64 | transition: all 0.25s linear;
65 | }
66 |
67 | .Rose-title.active:after {
68 | width: 100%;
69 | left: 0;
70 | background: #599eec;
71 | }
72 |
73 | .Rose-title .iconfont {
74 | font-size: 52rpx;
75 | display: block;
76 | color: #666;
77 | }
78 |
79 | .Rose-title.active .iconfont, .Rose-title.active {
80 | color: #599eec;
81 | }
82 |
83 | .Rose-Line .iconfont {
84 | color: #599eec;
85 | font-size: 46rpx;
86 | padding-right: 10rpx;
87 | vertical-align: bottom;
88 | }
89 |
90 | .Rose-Line .iconfont.fr {
91 | float: right;
92 | color: #a8a8a8;
93 | padding-right: 0;
94 | font-size: 30rpx;
95 | }
96 |
97 | .Rose-item {
98 | display: flex;
99 | padding: 30rpx 0;
100 | border-bottom: 2rpx solid #f2f2f2;
101 | }
102 |
103 | .Rose-aign {
104 | display: -webkit-flex;
105 | display: flex;
106 | -webkit-flex-wrap: wrap;
107 | flex-wrap: wrap;
108 | align-content: space-between;
109 | }
110 |
111 | .Rose-name {
112 | display: -webkit-box;
113 | overflow: hidden;
114 | line-height: 1.4;
115 | text-align: left;
116 | text-overflow: ellipsis;
117 | -webkit-line-clamp: 2;
118 | -webkit-box-orient: vertical;
119 | margin: 0 0 20rpx;
120 | font-size: 32rpx;
121 | color: #333;
122 | }
123 |
124 | .Rose-description {
125 | font-size: 28rpx;
126 | color: #666;
127 | display: -webkit-box;
128 | overflow: hidden;
129 | line-height: 1.6;
130 | text-align: left;
131 | text-overflow: ellipsis;
132 | -webkit-line-clamp: 1;
133 | -webkit-box-orient: vertical;
134 | }
135 |
136 | .Rose-time {
137 | display: flex;
138 | width: 100%;
139 | color: #999;
140 | font-size: 24rpx;
141 | justify-content: space-between;
142 | }
143 |
144 | .Rose-time .iconfont {
145 | font-size: 26rpx;
146 | margin: -20rpx 0 0;
147 | }
148 |
149 | .Rose-comment {
150 | margin-left: 20rpx;
151 | }
152 |
--------------------------------------------------------------------------------
/pages/me/me.js:
--------------------------------------------------------------------------------
1 | // pages/me/me.js
2 | Page({
3 | /**
4 | * 页面的初始数据
5 | */
6 | data: {
7 | },
8 | /**
9 | * 生命周期函数--监听页面加载
10 | */
11 | onLoad: function (options) {
12 | var that = this;
13 | // that.shake();
14 | },
15 | /**
16 | * 生命周期函数--监听页面初次渲染完成
17 | */
18 | onReady: function () {
19 | },
20 | /**
21 | * 生命周期函数--监听页面显示
22 | */
23 | onShow: function () {
24 | var that = this;
25 | },
26 | /**
27 | * 生命周期函数--监听页面隐藏
28 | */
29 | onHide: function () {
30 | },
31 | /**
32 | * 生命周期函数--监听页面卸载
33 | */
34 | onUnload: function () {
35 | },
36 | /**
37 | * 页面相关事件处理函数--监听用户下拉动作
38 | */
39 | onPullDownRefresh: function () {
40 | },
41 | /**
42 | * 页面上拉触底事件的处理函数
43 | */
44 | onReachBottom: function () {
45 | },
46 | /**
47 | * 用户点击右上角分享
48 | */
49 | onShareAppMessage: function () {
50 | },
51 | shake() {
52 | var numX = 1 //x轴
53 | var numY = 1 // y轴
54 | var numZ = 0 // z轴
55 | var stsw = true // 开关,保证在一定的时间内只能是一次,摇成功
56 | var positivenum = 0 //正数 摇一摇总数
57 | // var audioCtx = wx.createAudioContext('myAudio') //音频,用于摇成功提示
58 | wx.onAccelerometerChange(function (res) { //小程序api 加速度计
59 | if (numX < res.x && numY < res.y) { //个人看法,一次正数算摇一次,还有更复杂的
60 | positivenum++
61 | setTimeout(() => { positivenum = 0 }, 2000) //计时两秒内没有摇到指定次数,重新计算
62 | }
63 | if (numZ < res.z && numY < res.y) { //可以上下摇,上面的是左右摇
64 | positivenum++
65 | setTimeout(() => { positivenum = 0 }, 2000) //计时两秒内没有摇到指定次数,重新计算
66 | }
67 | if (positivenum == 2 && stsw) { //是否摇了指定的次数,执行成功后的操作
68 | stsw = false;
69 | wx.showModal({
70 | title: 'test',
71 | content: 'yaoyiyao',
72 | })
73 | // audioCtx.setSrc('http://pic.ibaotu.com/00/43/58/92J888piCmbi.mp3') //音频文件,第三方的可自行选择
74 | // audioCtx.play() //播发音频
75 | // console.log('摇一摇成功')
76 | // setTimeout(() => {
77 | // positivenum = 0 // 摇一摇总数,重新0开始,计算
78 | // stsw = true
79 | // },2000)
80 | }
81 | });
82 | }
83 | })
84 |
--------------------------------------------------------------------------------
/pages/me/me.json:
--------------------------------------------------------------------------------
1 | {
2 | "navigationBarTitleText": "Rose Zhao",
3 | "enablePullDownRefresh": false
4 |
5 | }
6 |
--------------------------------------------------------------------------------
/pages/me/me.wxml:
--------------------------------------------------------------------------------
1 |
2 |
3 | Rose Zhao
4 |
5 |
6 | 关于我:
7 | 女,一个三四线互联网公司的打杂员工,现坐落于四川成都。 2013年毕业于成都理工大学(十年寒窗都没冻死我!!)。从事WEB前端开发5年,拿着一丁点微不足道的工资勉强过活。生活中不算宅,喜欢读书、旅行,做事严谨,热爱生活,喜欢和朋友一起嗨,略微文艺,爱折腾, 有idea就立马动手开干,执行力强,未发现有拖延症潜质,不知道是否还有救?!
8 |
9 |
10 | 关于KAPO:
11 |
12 | 为什么做这个小程序?自然是为了装X,逢人就拿出来炫耀一番。 为什么叫KAPO, 因为KAPO谐音COUPLE, 考虑 COUPLE 这种花式秀恩爱的做法太略狗, 所以干脆用一个酷酷的的名字‘KAPO’。查了一下KAPO的英文意思, 居然是“犯人头目,管理其他人犯的犯人”,en....因吹斯听, 既然不能做WEB前端的大神,也希望成为垃圾中的战斗机吧。哈哈哈...除此之外,小程序中还做了一个打卡的功能,列举了一些现在想做和未来想做的事情, 用这个小程序监督自己每天前进是每一小步。 还有,希望通过这个小程序把自己的所学给他人奠定一条WEB前端的康庄大道,也算我为社会发光发热了吧!!
13 |
14 |
15 |
16 | 基本信息:
17 |
18 | 工作积极,和同事相处愉快,敢于承担责任,生活态度积极乐观,不易受外界干扰,喜欢有计划的安排生活和工作。 五年前端生活,创造属于自己的价值。 偶尔去旅游,逛街,骑行。
19 |
20 |
21 |
22 | 技能介绍
23 |
24 | 1. HTML5+CSS3+jQuery, 有移动端web开发经验;
25 | 2. 具有javascript面向对象编程能力,理解prototype对象原型链,封装插件;
26 | 3. 有丰富的跨浏览器开发经验,熟悉浏览器之间的兼容;
27 | 4. 熟练使用Bootstrap、AmazeUI、mui、Foundation等主流前端框架;
28 | 5. 对Photoshop进行操作,具备一定的UI设计能力;
29 | 6. 熟练使用自动化工具gulp 和 模块化工具 webpack;
30 | 7. 会使用Axure、MockingBot、Xmind 等原型工具;
31 | 8. 熟悉使用node, 有angularJS、Vuejs项目开发经验;
32 | 9. 熟悉小程序开发,有webapp,移动端开发经验;
33 | 10. 熟练使用SVN, Git
34 |
35 |
36 |
37 | 工作经历:
38 |
39 | 爱奇艺公司
40 | (2018.7-现在)
41 |
42 |
43 | 1. 微信小程序开发, 包含授权,以及后台数据交互等功能
44 | 2. 大型后台管理系统前端开发,
45 | 3. 配合产品人员的需求编写JavaScript等脚本实现页面的交互功能;
46 | 4. 使用webpck模块化工具,gulp自动化构建工具实现版本的更新,优化,与js和css的压缩与加密;
47 | 5. 使用svn或git配合后台开发人员实现产品界面和功能;
48 |
49 | 成都天象互动科技有限公司
50 | (2015.9-2018.7)
51 |
52 | 1. 根据UI设计师的提供的设计图,对页面进行分析,以及使用ps进行切图,制作符合前端标准和搜索引擎优化(SEO)的静态页面,包含PC与移动终端产品开发;
53 | 2. 配合产品人员的需求编写JavaScript等脚本实现页面的交互功能;
54 | 3. 调整页面在主流浏览器和平台(包括移动平台)上保持良好的兼容性;
55 | 4. 使用svn或git配合后台开发人员实现产品界面和功能;
56 | 5. web标准规范页面代码,优化页面代码和网页加载速度,提高网页的性能,提高用户体验;
57 | 6. 使用webpck模块化工具,gulp自动化构建工具实现版本的更新,优化,与js和css的压缩与加密;
58 | 7. 使用AngularJS,vueJS等框架对页面的数据进行绑定进行spa(单页web应用)开发;
59 | 8. 网站日常运营需求维护;
60 | 9. 学习reactJS
61 | 禾润信息技术有限公司
62 | (2014.7-2015.8)
63 |
64 | 1. 根据项目经理的需求对项目做出流程分析,并使用xMind, Microsoft Visio,Axure 画出原型图和流程图;
65 | 2. 根据UI设计师提供的设计图,实现Web界面(PC前端和移动端);
66 | 3. Web端功能设计、开发和实现;
67 | 4. 运用Javascript框架的应用进行项目开发;
68 | 5. 优化代码并保持在各浏览器下的良好兼容性;
69 | 6. 配合后台开发人员实现产品界面和功能;
70 |
71 |
72 |
73 | 博客地址:
74 | https://www.zhmzjl.com,这个域名,具有特殊含义,是我的名字和我老公的名字的字母组合而来,虽然不是大家喜欢的常用域名类型,但是无论好坏,个人喜欢,无关其他!
75 |
76 |
77 | 源码地址:
78 | KAPO博客小程序源码地址:https://github.com/Rose-GoGo/KAPO,代码一直都在更新,欢迎大家拉取最新源码,并且提出宝贵意见或建议,并踊跃提交贡献代码!注:若需要使用该源码,需在你的小程序中详情页添加 KAPO博客 的友情链接(不算过分吧?!).
79 |
80 |
81 | 关注我:
82 | 摇一摇,添加博主为好友吧
83 |
84 |
85 | 联系我:
86 | QQ: 583459700
87 | Whchat: zhao_583459700
88 | Github: https://github.com/SmileRose
89 |
90 |
91 |
92 |
--------------------------------------------------------------------------------
/pages/me/me.wxss:
--------------------------------------------------------------------------------
1 | /* pages/me/me.wxss */
2 | page {
3 | background: #fff;
4 | }
5 | .Rose-detail {
6 | background: #fff;
7 | margin: 20rpx;
8 | font-size: 32rpx;
9 | line-height: 1.6;
10 | padding: 0 0 80rpx;
11 | color: #666;
12 | }
13 | .Rose-title {
14 | color: #000;
15 | font-size: 48rpx;
16 | line-height: 1.2;
17 | }
18 | .Rose-addtime {
19 | margin: 20rpx 0;
20 | color: #999;
21 | font-size: 24rpx;
22 | }
23 | .Rose-imgitem {
24 | width: 100%;
25 | height: 330rpx;
26 | }
27 | .Rose-item {
28 | margin-top: 30px;
29 | font-size: 32rpx;
30 | }
31 | .Rose-line {
32 | font-size: 36rpx;
33 | position: relative;
34 | padding: 10rpx 20rpx 30rpx;
35 | line-height: 1;
36 | color: #333;
37 | }
38 | .Rose-line:before {
39 | position: absolute;
40 | top: 10rpx;
41 | left: 0;
42 | width: 8rpx;
43 | height: 36rpx;
44 | content: '';
45 | background: #4bb777;
46 | }
47 | .Rose-h3 {
48 | padding: 20rpx 0 0;
49 | font-weight: 600;
50 | }
51 | .Rose-concact {
52 | display: block;
53 | }
54 | .Rose-work {
55 | font-size: 24rpx;
56 | font-weight: 400;
57 | }
58 |
--------------------------------------------------------------------------------
/pages/more/more.js:
--------------------------------------------------------------------------------
1 | // pages/more/more.js
2 | import Api from '/../../utils/api.js';
3 | var username = '';
4 | // var dataIndex = 0;
5 | Page({
6 | /**
7 | * 页面的初始数据
8 | */
9 | data: {
10 | images: [],
11 | bigData: [],
12 | catid: '',
13 | disabled: true,
14 | loadMore: true,
15 | monthData: [], //存储月数据
16 | canIUse: wx.canIUse('button.open-type.getUserInfo'),
17 | year: String(new Date().getFullYear()),
18 | month: String(new Date().getMonth() + 1).padStart(2, '0'),
19 | isRose: false,
20 | showEdit: false,
21 | id: '',
22 | aids: [],
23 | dataIndex: 0, //为了得到bigdata中的数组,特别是是换年
24 | barText: ['每天一个俯卧撑', '读100本书', '学一门外语', '记录生活琐事', '摄影']
25 | },
26 | /**
27 | * 生命周期函数--监听页面加载
28 | */
29 | onLoad: function(options) {
30 | var that = this;
31 | that.setData({
32 | catid: options.catid,
33 | });
34 | wx.setNavigationBarTitle({
35 | title: that.data.barText[options.catid - 1]
36 | });
37 | wx.getSetting({
38 | success: function(res) {
39 | if (res.authSetting['scope.userInfo']) {
40 | // 已经授权,可以直接调用 getUserInfo 获取头像昵称
41 | wx.getUserInfo({
42 | success: function(res) {
43 | var userInfo = res.userInfo;
44 | if (userInfo.nickName == '赵') {
45 | that.setData({
46 | isRose: true
47 | })
48 | }
49 | username = userInfo.nickName;
50 | },
51 | fail: function(res) {}
52 | });
53 | }
54 | }
55 | });
56 | that.getLine();
57 | },
58 | /**
59 | * 生命周期函数--监听页面初次渲染完成
60 | */
61 | onReady: function() {},
62 | /**
63 | * 生命周期函数--监听页面显示
64 | */
65 | onShow: function() {},
66 | /**
67 | * 生命周期函数--监听页面隐藏
68 | */
69 | onHide: function() {},
70 | /**
71 | * 生命周期函数--监听页面卸载
72 | */
73 | onUnload: function() {},
74 | /**
75 | * 页面相关事件处理函数--监听用户下拉动作
76 | */
77 | onPullDownRefresh: function() {},
78 | /**
79 | * 页面上拉触底事件的处理函数
80 | */
81 | onReachBottom: function() {
82 | var that = this;
83 | if (that.data.loadMore) {
84 | that.earMonth(); //上个月的时间
85 | }
86 | },
87 | /**
88 | * 用户点击右上角分享
89 | */
90 | onShareAppMessage: function() {
91 | return {
92 | title: `锲而舍之,朽木不折;锲而不舍,金石可镂`,
93 | imageUrl: '/assets/images/share.jpg'
94 | }
95 | },
96 | forTitle(e) { //打卡数据验证
97 | var that = this;
98 | let _data = e.detail.value;
99 | that.setData({
100 | title: _data
101 | });
102 | if (that.data.title && that.data.remark) {
103 | that.setData({
104 | disabled: false
105 | });
106 | } else {
107 | that.setData({
108 | disabled: true
109 | });
110 | }
111 | },
112 | forRemark(e) { //打卡数据验证
113 | var that = this;
114 | let _data = e.detail.value;
115 | that.setData({
116 | remark: _data
117 | });
118 | if (that.data.title && that.data.remark) {
119 | that.setData({
120 | disabled: false
121 | });
122 | } else {
123 | that.setData({
124 | disabled: true
125 | });
126 | }
127 | },
128 | earMonth(n) { //获取年月
129 | var that = this;
130 | var ym, year, month;
131 | year = that.data.year;
132 | month = that.data.month;
133 | ym = `${year}-${month}`;
134 | if (new Date(ym).getMonth() == 0) {
135 | year = year - 1;
136 | month = 12;
137 | let big = that.data.bigData;
138 | let index = that.data.dataIndex + 1;
139 | let datas = {
140 | [year]: {}
141 | }
142 | big.push(datas);
143 | that.setData({
144 | dataIndex: index,
145 | monthData: [],
146 | bigData: big
147 | });
148 | } else {
149 | year = year;
150 | month = month - 1;
151 | }
152 | year = String(year);
153 | month = String(month).padStart(2, '0')
154 | that.setData({
155 | year: year,
156 | month: month
157 | });
158 | that.getLine();
159 | },
160 | getLine() { //拉取数据并且处理
161 | var that = this;
162 | let year = that.data.year;
163 | let month = that.data.month;
164 | var big = that.data.bigData;
165 | var dataIndex = that.data.dataIndex;
166 |
167 |
168 | var thisMonthData = {};
169 | var ym = `${year}-${month}`;
170 | if (Date.parse(new Date(ym)) < 1530403200000) {
171 | that.setData({
172 | loadMore: false
173 | });
174 | return false;
175 | }
176 | let _params = {
177 | year: year,
178 | month: month,
179 | catid: that.data.catid,
180 | }
181 | Api.showday(_params).then(res => {
182 | if (!res.data.code) {
183 | var _data = res.data.data;
184 | thisMonthData = _data;
185 |
186 | thisMonthData['monthNum'] = month;
187 | thisMonthData['monthShow'] = true;
188 | var _monthData = that.data.monthData;
189 | _monthData = [..._monthData, ...[thisMonthData]];
190 | if (that.data.month != '01') { //换年了
191 | big[dataIndex] = {
192 | [year]: _monthData
193 | }
194 | } else {
195 | var ss = {
196 | [year]: _monthData
197 | }
198 | big[dataIndex] = ss;
199 | }
200 | that.setData({
201 | bigData: big,
202 | monthData: _monthData
203 | });
204 | let _count = Object.keys(_data[month]).length;
205 | if (_count < 3 || that.data.bigData.length == 0) { //月初没有数据或者数据较少的时候加载上个月的数据
206 | that.earMonth(); //上个月的时间
207 | return false;
208 | }
209 | wx.hideLoading();
210 | }
211 | });
212 | },
213 | bindGetUserInfo(res) {
214 | var that = this;
215 | var userInfo = {};
216 | if (res) {
217 | userInfo = res.detail.userInfo;
218 | } else {
219 | wx.getUserInfo({
220 | success: function(res) {
221 | userInfo = res.userInfo;
222 | }
223 | })
224 | }
225 | if (!userInfo) return false;
226 | if (userInfo.nickName == '赵') {
227 | that.setData({
228 | isRose: true
229 | });
230 | username = userInfo.nickName;
231 | }
232 | },
233 | editItem(e) {
234 | let showEdit = this.data.showEdit;
235 | let showid = e.currentTarget.dataset.forid;
236 | this.setData({
237 | showEdit: !showEdit,
238 | showid: showid
239 | });
240 | },
241 | editOne(e) {
242 | var that = this;
243 | let tt = e.currentTarget.dataset;
244 | let {id, title, remark} = tt;
245 | that.setData({
246 | title: title,
247 | remark: remark,
248 | disabled: false,
249 | id: id,
250 | images: [],
251 | showEdit: false
252 | });
253 | wx.pageScrollTo({
254 | scrollTop: 0,
255 | duration: 300
256 | })
257 | },
258 | resetPage() { //默认的展示状态
259 | var that = this;
260 | let month = new Date().getMonth() + 1;
261 | let year = new Date().getFullYear();
262 | month = String(month).padStart(2, '0');
263 | that.setData({
264 | id: '',
265 | title: '',
266 | remark: '',
267 | year: year,
268 | month: month,
269 | showEdit: false,
270 | images: [],
271 | bigData: [],
272 | monthData: [],
273 | });
274 | that.getLine();
275 | },
276 | deleteOne(e) { //删除本条
277 | var that = this;
278 | let id = e.currentTarget.dataset.id;
279 | let _params = {
280 | catid: that.data.catid,
281 | id: id
282 | }
283 | wx.showModal({
284 | title: '提示',
285 | content: '确认删除?',
286 | confirmColor: '#1d8f59',
287 | success(res) {
288 | if (res.confirm) {
289 | Api.everydelete(_params).then(res => {
290 | if (!res.data.code) {
291 | that.resetPage();
292 | } else {
293 | wx.showModal({
294 | showCancel: false,
295 | confirmColor: '#1d8f59',
296 | content: `该功能已经暂停,暂不支持删除数据!`,
297 | })
298 | }
299 | });
300 | } else if (res.cancel) {}
301 | }
302 | })
303 | },
304 | removeImage(e) {
305 | let idx = e.target.dataset.idx;
306 | let img = this.data.images;
307 | img.splice(idx, 1);
308 | this.setData({
309 | images: img
310 | });
311 | },
312 | imagePreview(e) {
313 | let idx = e.target.dataset.idx;
314 | let arr = e.target.dataset.arr;
315 | wx.previewImage({
316 | current: arr[idx], //当前预览的图片
317 | urls: arr, //所有要预览的图片
318 | });
319 | },
320 | uploadImg() {
321 | var that = this;
322 | var aids = [];
323 | var images = that.data.images;
324 | return new Promise(function(resolve, reject) {
325 | if (images.length == 0) {
326 | resolve();
327 | return false;
328 | }
329 | for (let i = 0, h = images.length; i < h; i++) {
330 | wx.uploadFile({
331 | url: 'https://www.zhmzjl.com/index.php?m=content&c=punch&a=upload',
332 | filePath: images[i],
333 | name: 'file',
334 | success: res => {
335 | let _data = JSON.parse(res.data)
336 | if (_data.code == 0) {
337 | let _aid = _data.aid;
338 | aids.push(_aid);
339 | that.setData({
340 | aids: aids
341 | });
342 | if (images.length == aids.length) {
343 | resolve(aids);
344 | }
345 | }
346 | },
347 | fail: function(res) {
348 | reject(res);
349 | wx.showModal({
350 | content: '上传图片失败',
351 | showCancel: false,
352 | confirmColor: '#1d8f59',
353 | success: res => {}
354 | });
355 | }
356 | });
357 | }
358 | });
359 | },
360 | chooseImg() { //选取图片
361 | var that = this;
362 | if (that.data.images.length < 3) { // 限制最多只能留下3张照片
363 | wx.chooseImage({
364 | count: 3,
365 | sizeType: ['compressed', 'original'],
366 | sourceType: ['album', 'camera'], // 指定来源
367 | success: res => {
368 | // 返回选定照片的本地文件路径列表,tempFilePath可以作为img标签的src属性显示图片
369 | let images = that.data.images.concat(res.tempFilePaths);
370 | that.setData({
371 | images: images
372 | });
373 | }
374 | });
375 | }
376 | },
377 | formSubmit() {
378 | wx.showLoading();
379 | var that = this,
380 | aids = [];
381 | that.setData({
382 | disabled: true //想偷懒都不行,这里需要点击按钮后,按钮就设置成disabled, 避免重负提交
383 | });
384 | var promise = that.uploadImg(); //进行图片的上传
385 | promise.then(res => {
386 | aids = that.data.aids;
387 | let aidStr = aids.join(';');
388 | let _params = {
389 | catid: that.data.catid,
390 | title: that.data.title,
391 | remark: that.data.remark,
392 | username: username,
393 | aids: aidStr //图片
394 | }
395 | if (that.data.id) { //如果有id, 修改
396 | _params.id = that.data.id;
397 | Api.everyupdate(_params).then(res => {
398 | if (!res.data.code) {
399 | wx.hideLoading();
400 | that.resetPage();
401 | }
402 | });
403 | } else {
404 | Api.everyadd(_params).then(res => { //更新
405 | if (!res.data.code) {
406 | wx.hideLoading();
407 | that.resetPage();
408 | } else {
409 | wx.hideLoading();
410 | wx.showModal({
411 | showCancel: false,
412 | confirmColor: '#1d8f59',
413 | content: '暂停更新数据功能',
414 | })
415 | }
416 | });
417 | }
418 | })
419 | },
420 | hideData(e) { //隐藏该月的数组
421 | var that = this;
422 | let dDate = e.currentTarget.dataset;
423 | let _num = e.currentTarget.dataset.num;
424 | let _year = e.currentTarget.dataset.year;
425 | let _index = e.currentTarget.dataset.index;
426 | let _month = e.currentTarget.dataset.month;
427 |
428 | let _bigData = that.data.bigData;
429 | _bigData[_num][_year][_index]['monthShow'] = !_bigData[_num][_year][_index]['monthShow'];
430 | that.setData({
431 | bigData: _bigData
432 | })
433 | //当还有数据,而且这个月是被收缩的,而且小于上一次加载的月,才加载数据
434 | if (that.data.loadMore && !_bigData[_num][_year][_index]['monthShow'] && _month <= this.data.month) {
435 | that.earMonth(); //上个月的时间
436 | }
437 | }
438 | })
439 |
--------------------------------------------------------------------------------
/pages/more/more.json:
--------------------------------------------------------------------------------
1 | {
2 | "enablePullDownRefresh": false,
3 | "navigationBarTitleText": "打卡",
4 | "usingComponents": {
5 | "loading": "../../components/loading/loading",
6 | "backtop": "../../components/backtop/backtop"
7 | }
8 | }
9 |
--------------------------------------------------------------------------------
/pages/more/more.wxml:
--------------------------------------------------------------------------------
1 |
2 |
5 |
6 |
7 | 标题
8 |
9 |
10 |
11 | 内容
12 |
13 |
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 | {{index}}
41 |
42 |
43 |
44 |
45 |
46 | {{month.monthNum}}
47 |
48 |
49 |
50 |
51 |
52 | {{ix}}
53 |
54 |
55 |
56 |
57 |
58 |
59 |
60 |
61 |
62 | {{dd.title}}
63 | {{dd.insert_time}}
64 | {{dd.remark}}
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 |
--------------------------------------------------------------------------------
/pages/more/more.wxss:
--------------------------------------------------------------------------------
1 | /* pages/more/more.wxss */
2 | .Rose-form {
3 | padding: 20rpx;
4 | background: #fff;
5 | margin: 0 0 20rpx;
6 | }
7 | .Rose-input {
8 | flex: 1;
9 | line-height: 1;
10 | padding: 16rpx 20rpx;
11 | border: 2rpx solid #d9d9d9;
12 | border-radius: 4rpx;
13 | font-size: 30rpx;
14 | }
15 | .Rose-section_title {
16 | display: block;
17 | width: 3em;
18 | font-size: 30rpx;
19 | line-height: 1;
20 | padding: 24rpx 0 0;
21 | color: #666;
22 | }
23 | .Rose-section {
24 | display: flex;
25 | width: 100%;
26 | text-align: left;
27 | clear: both;
28 | margin: 20rpx 0;
29 | overflow: hidden;
30 | justify-content: space-between;
31 | }
32 | .Rose-btn {
33 | width: 100%;
34 | height: 100%;
35 | margin-top: 20rpx;
36 | background: #4bb777;
37 | font-size: 17px;
38 | border: none;
39 | color: #fff;
40 | border-radius: 20rpx;
41 | }
42 | button[disabled]:not([type]) {
43 | background: #ddd;
44 | color: #fff;
45 | }
46 | /*时间轴*/
47 | .Rose-floor-title {
48 | padding: 20rpx 30rpx;
49 | font-size: 34rpx;
50 | background: #fff;
51 | color: #000;
52 | text-align: center;
53 | font-weight: 500;
54 | }
55 | .Rose-year-line {
56 | background: #fff;
57 | }
58 | .Rose-circle {
59 | position: absolute;
60 | width: 22rpx;
61 | height: 22rpx;
62 | display: block;
63 | left: -34rpx;
64 | top: -14rpx;
65 | }
66 | .Rose-circle .iconfont {
67 | width: 22rpx;
68 | height: 22rpx;
69 | color: #4bb777;
70 | }
71 | .Rose-month {
72 | position: relative;
73 | padding: 0 0 30rpx;
74 | font-size: 32rpx;
75 | color: #666;
76 | }
77 | .Rose-year {
78 | padding: 0 20rpx 40rpx;
79 | color: #333;
80 | font-size: 36rpx;
81 | font-weight: 500;
82 | }
83 | .Rose-month-list {
84 | position: relative;
85 | padding-left: 20rpx;
86 | }
87 | .Rose-day-list {
88 | position: relative;
89 | padding: 0 0 10rpx;
90 | }
91 | .Rose-day {
92 | font-size: 28rpx;
93 | color: #999;
94 | }
95 | .Rose-title {
96 | font-size: 32rpx;
97 | color: #333;
98 | line-height: 1.4;
99 | }
100 | .Rose-time {
101 | font-size: 20rpx;
102 | color: #999;
103 | }
104 | .Rose-add-time {
105 | display: block;
106 | font-size: 20rpx;
107 | margin: 0 0 10rpx;
108 | color: #999;
109 | }
110 | .Rose-content {
111 | margin: 10rpx 0 0;
112 | font-size: 28rpx;
113 | color: #666;
114 | word-break: break-word;
115 | /* line-height: 1.4em;
116 | display: -webkit-box;
117 | -webkit-line-clamp: 15; 限制显示15行
118 | -webkit-box-orient: vertical;
119 | overflow: hidden;*/
120 | }
121 | .Rose-year-line {
122 | position: relative;
123 | margin: 0 20rpx 0 40rpx;
124 | padding-top: 40rpx;
125 | }
126 | .Rose-year-line:before {
127 | position: absolute;
128 | left: 0;
129 | top: 0;
130 | width: 2rpx;
131 | height: 100%;
132 | background: #ccc;
133 | content: '';
134 | }
135 | .Rose-event {
136 | border: 2rpx solid #eee;
137 | padding: 10rpx;
138 | border-radius: 8rpx;
139 | display: flex;
140 | margin: 0 0 20rpx;
141 | }
142 | .Rose-circle-img {
143 | display: block;
144 | width: 80rpx;
145 | height: 80rpx;
146 | border-radius: 100%;
147 | }
148 | .Rose-event-icon {
149 | width: 80rpx;
150 | flex: none;
151 | font-size: 20rpx;
152 | color: #999;
153 | display: flex;
154 | align-items: center;
155 | }
156 | .Rose-event-icon icon {
157 | display: block;
158 | margin: 0 auto;
159 | font-size: 40rpx;
160 | color: #4bb777;
161 | }
162 | .Rose-icon-item {
163 | text-align: right;
164 | }
165 | .Rose-icon-item icon {
166 | font-size: 40rpx;
167 | color: #999;
168 | margin: 0 20rpx 0 40rpx;
169 | }
170 | .icon-md-shijian {
171 | position: relative;
172 | display: inline-block;
173 | vertical-align: middle;
174 | font-size: 64rpx;
175 | margin-left: -52rpx;
176 | background: #fff;
177 | color: #333;
178 | }
179 | .icon-xiangshang, .icon-xiangxia {
180 | display: inline-block;
181 | vertical-align: sub;
182 | font-size: 48rpx;
183 | color: #4bb777;
184 | margin-left: -44rpx;
185 | background: #fff;
186 | font-weight: 500;
187 | }
188 | .icon-tupian {
189 | font-size: 52rpx;
190 | color: #ccc;
191 | margin-left: 6px;
192 | }
193 | .Rose-upimg {
194 | display: flex;
195 | width: 100%;
196 | font-size: 24rpx;
197 | }
198 | .Rose-upimg .icon-shanchu {
199 | font-size: 36rpx;
200 | }
201 | .Rose-imgbox {
202 | margin: 16rpx 1% 0;
203 | width: 33%;
204 | color: #999;
205 | text-align: center;
206 | }
207 | .Rose-image {
208 | width: 100%;
209 | height: 160rpx;
210 | }
211 | .Rose-itemline-item {
212 | margin: 10rpx 0;
213 | }
214 | .Rose-item {
215 | display: flex;
216 | justify-content: flex-start;
217 | }
218 | .Rose-img {
219 | height: 140rpx;
220 | width: 100%;
221 | }
222 | .Rose-contentbox {
223 | width: 100%;
224 | }
225 | .Rose-getuser {
226 | position: fixed;
227 | width: 60rpx;
228 | height: 60rpx;
229 | right: 20rpx;
230 | bottom: 40rpx;
231 | border: 2rpx solid #1d8f59;
232 | z-index: 2;
233 | border-radius: 4rpx;
234 | background: #fff;
235 | color: #1d8f59;
236 | text-align: center;
237 | line-height: 60rpx;
238 | padding: 0;
239 | }
240 | .icon-yonghu2 {
241 | margin: -18rpx auto 0;
242 | font-size: 36rpx;
243 | }
244 |
--------------------------------------------------------------------------------
/pages/project/project.js:
--------------------------------------------------------------------------------
1 | // pages/project/project.js
2 | import Api from '/../../utils/api.js';
3 | Page({
4 | /**
5 | * 页面的初始数据
6 | */
7 | data: {
8 | swipter_height: '550px',
9 | swiperCurrent: 1,
10 | items: [],
11 | beforeColor: "#dcdae3",//指示点颜色
12 | afterColor: "#a5a2af",//当前选中的指示点颜色
13 | previousmargin: '30px',//前边距
14 | nextmargin: '30px',//后边距
15 | // preIndex: 1
16 | },
17 | /**
18 | * 生命周期函数--监听页面加载
19 | */
20 | onLoad: function (options) {
21 | var that = this;
22 | wx.showLoading();
23 | wx.getSystemInfo({
24 | success: function (res) {
25 | that.setData({
26 | swipter_height: res.windowHeight
27 | })
28 | }
29 | });
30 | that.getData();
31 | },
32 | /**
33 | * 生命周期函数--监听页面初次渲染完成
34 | */
35 | onReady: function () {
36 | },
37 | /**
38 | * 生命周期函数--监听页面显示
39 | */
40 | onShow: function () {
41 | },
42 | /**
43 | * 生命周期函数--监听页面隐藏
44 | */
45 | onHide: function () {
46 | },
47 | /**
48 | * 生命周期函数--监听页面卸载
49 | */
50 | onUnload: function () {
51 | },
52 | /**
53 | * 页面相关事件处理函数--监听用户下拉动作
54 | */
55 | onPullDownRefresh: function () {
56 | },
57 | /**
58 | * 页面上拉触底事件的处理函数
59 | */
60 | onReachBottom: function () {
61 | },
62 | /**
63 | * 用户点击右上角分享
64 | */
65 | onShareAppMessage: function () {
66 | return {
67 | title: '锲而舍之,朽木不折;锲而不舍,金石可镂',
68 | imageUrl: '/assets/images/share.jpg'
69 | }
70 | },
71 | swiperChange(e) {
72 | var that = this;
73 | if (e.detail.source == "touch") {
74 | //防止swiper控件卡死
75 | if (that.data.swiperCurrent == 0 && that.data.preIndex > 1) {//卡死时,重置swiperCurrent为正确索引
76 | that.setData({ swiperCurrent: that.data.preIndex });
77 | }
78 | else {//正常轮转时,记录正确页码索引
79 | that.setData({ swiperCurrent: e.detail.current });
80 | }
81 | }
82 |
83 | },
84 | //滑动图片切换
85 | chuangEvent(e) {
86 | this.setData({
87 | swiperCurrent: e.currentTarget.id
88 | })
89 | },
90 | getData() {
91 | let _params = {
92 | catid: 19, //项目id
93 | page: 1,
94 | pagesize: 999 // 可选,默认为为5
95 | }
96 | Api.lists(_params).then(res => {
97 | if (!this.data.code) {
98 | let _data = res.data.data;
99 | this.setData({
100 | items: _data
101 | })
102 | wx.hideLoading();
103 | }
104 | })
105 | }
106 | })
107 |
--------------------------------------------------------------------------------
/pages/project/project.json:
--------------------------------------------------------------------------------
1 | {
2 | "navigationBarTitleText": "项目",
3 | "enablePullDownRefresh": false
4 | }
--------------------------------------------------------------------------------
/pages/project/project.wxml:
--------------------------------------------------------------------------------
1 |
2 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 | {{item.title}}
14 | {{item.keywords}}
15 |
16 |
17 |
18 |
19 |
20 |
21 |
--------------------------------------------------------------------------------
/pages/project/project.wxss:
--------------------------------------------------------------------------------
1 | /* pages/project/project.wxss */
2 |
3 | .Rose-swiper {
4 | width: 100%;
5 | height: 600rpx;
6 | overflow: hidden;
7 | margin: 44rpx 0 0;
8 | }
9 |
10 | swiper {
11 | display: block;
12 | position: relative;
13 | perspective: 800;
14 | }
15 |
16 | .Rose-image {
17 | width: 100%;
18 | display: block;
19 | margin: 0 auto;
20 | height: 750rpx;
21 | }
22 |
23 | .Rose-block {
24 | width: 94%;
25 | background: #fff;
26 | margin: 0 auto;
27 | border-radius: 12rpx;
28 | overflow: hidden;
29 | margin-top: 20rpx;
30 | }
31 |
32 | .Rose-box {
33 | width: 100%;
34 | display: block;
35 | border-radius: 0 0 90% 90% / 0 0 12% 12%;
36 | overflow: hidden;
37 | }
38 |
39 | .Rose-name {
40 | font-size: 40rpx;
41 | color: #333;
42 | }
43 |
44 | .Rose-description {
45 | padding: 16rpx 0 0;
46 | text-align: center;
47 | font-size: 26rpx;
48 | color: #999;
49 | }
50 |
51 | .Rose-info {
52 | height: 90px;
53 | position: relative;
54 | text-align: center;
55 | padding: 20px 0 0;
56 | }
57 |
--------------------------------------------------------------------------------
/project.config.json:
--------------------------------------------------------------------------------
1 | {
2 | "description": "项目配置文件",
3 | "packOptions": {
4 | "ignore": []
5 | },
6 | "setting": {
7 | "urlCheck": true,
8 | "es6": true,
9 | "enhance": true,
10 | "postcss": true,
11 | "minified": true,
12 | "newFeature": true,
13 | "coverView": true,
14 | "nodeModules": true,
15 | "autoAudits": true,
16 | "showShadowRootInWxmlPanel": true,
17 | "scopeDataCheck": false,
18 | "uglifyFileName": true,
19 | "checkInvalidKey": true,
20 | "checkSiteMap": false,
21 | "uploadWithSourceMap": true,
22 | "useMultiFrameRuntime": false,
23 | "useApiHook": true,
24 | "babelSetting": {
25 | "ignore": [],
26 | "disablePlugins": [],
27 | "outputPath": ""
28 | },
29 | "bundle": false,
30 | "useIsolateContext": true,
31 | "useCompilerModule": true,
32 | "userConfirmedUseCompilerModuleSwitch": false,
33 | "userConfirmedBundleSwitch": false,
34 | "packNpmManually": false,
35 | "packNpmRelationList": [],
36 | "minifyWXSS": true
37 | },
38 | "compileType": "miniprogram",
39 | "libVersion": "2.14.0",
40 | "appid": "wx11bb9ed460c13af5",
41 | "projectname": "firstXCX",
42 | "debugOptions": {
43 | "hidedInDevtools": []
44 | },
45 | "scripts": {},
46 | "simulatorType": "wechat",
47 | "simulatorPluginLibVersion": {},
48 | "condition": {
49 | "search": {
50 | "list": []
51 | },
52 | "conversation": {
53 | "list": []
54 | },
55 | "plugin": {
56 | "list": []
57 | },
58 | "game": {
59 | "list": []
60 | },
61 | "gamePlugin": {
62 | "list": []
63 | },
64 | "miniprogram": {
65 | "list": []
66 | }
67 | }
68 | }
--------------------------------------------------------------------------------
/sitemap.json:
--------------------------------------------------------------------------------
1 | {
2 | "desc": "关于本文件的更多信息,请参考文档 https://developers.weixin.qq.com/miniprogram/dev/framework/sitemap.html",
3 | "rules": [{
4 | "action": "allow",
5 | "page": "*"
6 | }]
7 | }
--------------------------------------------------------------------------------
/utils/api.js:
--------------------------------------------------------------------------------
1 | import MyHttp from './request.js';
2 | //所有的请求
3 | const ALL_API = {
4 | all: { //全部文章
5 | method: 'POST',
6 | url: '/index.php?m=content&c=api&a=index'
7 | },
8 | hits: { //top10
9 | method: 'POST',
10 | url: '/index.php?m=content&c=api&a=hits'
11 | },
12 | lists: { //分类文章
13 | method: 'POST',
14 | url: '/index.php?m=content&c=api&a=lists'
15 | },
16 | pageitem: { //详情
17 | method: 'POST',
18 | url: '/index.php?m=content&c=api&a=show'
19 | },
20 | commentlists: { //文章列表
21 | method: 'POST',
22 | url: '/index.php?m=content&c=wxcomment&a=lists'
23 | },
24 | postcomments: { //发布评论
25 | method: 'POST',
26 | url: '/index.php?m=content&c=wxcomment&a=publish'
27 | },
28 | showday: { //时间轴
29 | method: 'POST',
30 | url: '/index.php?m=content&c=punch&a=lists'
31 | },
32 | everyadd: { //打卡添加
33 | method: 'POST',
34 | url: '/index.php?m=content&c=punch&a=add'
35 | },
36 | everyupdate: { //打卡编辑
37 | method: 'POST',
38 | url: '/index.php?m=content&c=punch&a=update'
39 | },
40 | everydelete: { //打卡删除
41 | method: 'POST',
42 | url: '/index.php?m=content&c=punch&a=delete'
43 | },
44 | feedback: { //意见反馈
45 | method: 'POST',
46 | url: '/index.php?m=content&c=punch&a=feedback'
47 | },
48 | likenum: { //意见反馈
49 | method: 'POST',
50 | url: '/index.php?m=content&c=api&a=thumbs_up'
51 | },
52 | creatcode: { //二维码
53 | method: 'POST',
54 | url: '/index.php?m=content&c=msg&a=get_qrcode'
55 | },
56 | }
57 | const Api = new MyHttp({}, ALL_API);
58 | export default Api;
59 |
--------------------------------------------------------------------------------
/utils/login.js:
--------------------------------------------------------------------------------
1 | const login = n => {
2 |
3 | // if (wx.getStorageSync('loginSessionkey')) return;
4 |
5 | wx.login({
6 | success: (res) => {
7 | if (res.code) {
8 | wx.request({
9 | method: 'post',
10 | url: "http://119.29.161.36:3000/login",
11 | data: {
12 | jscode: res.code
13 | },
14 | success: (res) => {
15 | var _data = res.data.data.openid;
16 | var _keykey = res.data.data.tokes;
17 | wx.setStorageSync('loginSessionkey', _data);
18 | wx.setStorageSync('loginkey', _keykey);
19 | }
20 | })
21 | }
22 | }
23 | })
24 | }
25 | module.exports.login = login;
26 |
--------------------------------------------------------------------------------
/utils/request.js:
--------------------------------------------------------------------------------
1 | /*
2 | 域名
3 | */
4 | const GLOBAL_API_DOMAIN = "https://www.zhmzjl.com";
5 | /*
6 | 封装request
7 | */
8 | function sendRrquest(url, method, data, header) {
9 | let promise = new Promise(function (resolve, reject) {
10 | wx.showNavigationBarLoading() //在标题栏中显示加载
11 | wx.request({
12 | url: url,
13 | data: data,
14 | method: method,
15 | header: header,
16 | success: resolve,
17 | fail: reject,
18 | complete: function () {
19 | wx.hideNavigationBarLoading(); //完成停止加载
20 | wx.stopPullDownRefresh(); //停止下拉刷新
21 | },
22 | fail: function (res) {
23 | wx.showModal({
24 | showCancel: false,
25 | confirmColor: '#1d8f59',
26 | content: '数据加载失败,请检查您的网络,点击确定重新加载数据!',
27 | success: function (res) {
28 | if (res.confirm) {
29 | sendRrquest(url, method, data, header);
30 | }
31 | }
32 | });
33 | wx.hideLoading();
34 | // return false; //如果进来的时候数据加载失败,停止请求
35 | },
36 | })
37 | });
38 | return promise;
39 | };
40 |
41 | /*
42 | 多参数合并
43 | */
44 | function MyHttp(defaultParams, ALL_API) {
45 | let _build_url = GLOBAL_API_DOMAIN;
46 | let resource = {};
47 | for (let actionName in ALL_API) {
48 | let _config = ALL_API[actionName];
49 | resource[actionName] = (pdata) => {
50 | let _params_data = pdata;
51 | return sendRrquest(_build_url + _config.url, _config.method, _params_data, {
52 | 'content-type': 'application/x-www-form-urlencoded;charset=utf-8;Authorization;'
53 | });
54 | }
55 | }
56 | return resource;
57 | }
58 | export default MyHttp;
59 |
--------------------------------------------------------------------------------
/utils/util.js:
--------------------------------------------------------------------------------
1 | const formatTime = date => {
2 | const year = date.getFullYear()
3 | const month = date.getMonth() + 1
4 | const day = date.getDate()
5 | const hour = date.getHours()
6 | const minute = date.getMinutes()
7 | const second = date.getSeconds()
8 | return [year, month, day].map(formatNumber).join('.')
9 |
10 | // return [year, month, day].map(formatNumber).join('/') + ' ' + [hour, minute, second].map(formatNumber).join('-')
11 | }
12 | const formatNumber = n => {
13 | n = n.toString()
14 | return n[1] ? n : '0' + n
15 | }
16 | module.exports = {
17 | formatTime: formatTime
18 | }
19 |
--------------------------------------------------------------------------------
/wxParse/html2json.js:
--------------------------------------------------------------------------------
1 | /**
2 | * html2Json 改造来自: https://github.com/Jxck/html2json
3 | *
4 | *
5 | * author: Di (微信小程序开发工程师)
6 | * organization: WeAppDev(微信小程序开发论坛)(http://weappdev.com)
7 | * 垂直微信小程序开发交流社区
8 | *
9 | * github地址: https://github.com/icindy/wxParse
10 | *
11 | * for: 微信小程序富文本解析
12 | * detail : http://weappdev.com/t/wxparse-alpha0-1-html-markdown/184
13 | */
14 |
15 | var __placeImgeUrlHttps = "https";
16 | var __emojisReg = '';
17 | var __emojisBaseSrc = '';
18 | var __emojis = {};
19 | var wxDiscode = require('./wxDiscode.js');
20 | var HTMLParser = require('./htmlparser.js');
21 | // Empty Elements - HTML 5
22 | var empty = makeMap("area,base,basefont,br,col,frame,hr,img,input,link,meta,param,embed,command,keygen,source,track,wbr");
23 | // Block Elements - HTML 5
24 | var block = makeMap("br,a,code,address,article,applet,aside,audio,blockquote,button,canvas,center,dd,del,dir,div,dl,dt,fieldset,figcaption,figure,footer,form,frameset,h1,h2,h3,h4,h5,h6,header,hgroup,hr,iframe,ins,isindex,li,map,menu,noframes,noscript,object,ol,output,p,pre,section,script,table,tbody,td,tfoot,th,thead,tr,ul,video");
25 |
26 | // Inline Elements - HTML 5
27 | var inline = makeMap("abbr,acronym,applet,b,basefont,bdo,big,button,cite,del,dfn,em,font,i,iframe,img,input,ins,kbd,label,map,object,q,s,samp,script,select,small,span,strike,strong,sub,sup,textarea,tt,u,var");
28 |
29 | // Elements that you can, intentionally, leave open
30 | // (and which close themselves)
31 | var closeSelf = makeMap("colgroup,dd,dt,li,options,p,td,tfoot,th,thead,tr");
32 |
33 | // Attributes that have their values filled in disabled="disabled"
34 | var fillAttrs = makeMap("checked,compact,declare,defer,disabled,ismap,multiple,nohref,noresize,noshade,nowrap,readonly,selected");
35 |
36 | // Special Elements (can contain anything)
37 | var special = makeMap("wxxxcode-style,script,style,view,scroll-view,block");
38 | function makeMap(str) {
39 | var obj = {}, items = str.split(",");
40 | for (var i = 0; i < items.length; i++)
41 | obj[items[i]] = true;
42 | return obj;
43 | }
44 |
45 | function q(v) {
46 | return '"' + v + '"';
47 | }
48 |
49 | function removeDOCTYPE(html) {
50 | return html
51 | .replace(/<\?xml.*\?>\n/, '')
52 | .replace(/<.*!doctype.*\>\n/, '')
53 | .replace(/<.*!DOCTYPE.*\>\n/, '');
54 | }
55 |
56 | function trimHtml(html) {
57 | return html
58 | //.replace(/\r?\n+/g, '')
59 | .replace(//ig, '')
60 | .replace(/\/\*.*?\*\//ig, '')
61 | .replace(/[ ]+
189 | // add to parents
190 | var parent = bufArray[0] || results;
191 | if (parent.nodes === undefined) {
192 | parent.nodes = [];
193 | }
194 | parent.nodes.push(node);
195 | } else {
196 | bufArray.unshift(node);
197 | }
198 | },
199 | end: function (tag) {
200 | //debug(tag);
201 | // merge into parent tag
202 | var node = bufArray.shift();
203 | if (node.tag !== tag) console.error('invalid state: mismatch end tag');
204 |
205 | //当有缓存source资源时于于video补上src资源
206 | if(node.tag === 'video' && results.source){
207 | node.attr.src = results.source;
208 | delete results.source;
209 | }
210 |
211 | if (bufArray.length === 0) {
212 | results.nodes.push(node);
213 | } else {
214 | var parent = bufArray[0];
215 | if (parent.nodes === undefined) {
216 | parent.nodes = [];
217 | }
218 | parent.nodes.push(node);
219 | }
220 | },
221 | chars: function (text) {
222 | //debug(text);
223 | var node = {
224 | node: 'text',
225 | text: text,
226 | textArray:transEmojiStr(text)
227 | };
228 |
229 | if (bufArray.length === 0) {
230 | node.index = index.toString()
231 | index += 1
232 | results.nodes.push(node);
233 | } else {
234 | var parent = bufArray[0];
235 | if (parent.nodes === undefined) {
236 | parent.nodes = [];
237 | }
238 | node.index = parent.index + '.' + parent.nodes.length
239 | parent.nodes.push(node);
240 | }
241 | },
242 | comment: function (text) {
243 | //debug(text);
244 | // var node = {
245 | // node: 'comment',
246 | // text: text,
247 | // };
248 | // var parent = bufArray[0];
249 | // if (parent.nodes === undefined) {
250 | // parent.nodes = [];
251 | // }
252 | // parent.nodes.push(node);
253 | },
254 | });
255 | return results;
256 | };
257 |
258 | function transEmojiStr(str){
259 | // var eReg = new RegExp("["+__reg+' '+"]");
260 | // str = str.replace(/\[([^\[\]]+)\]/g,':$1:')
261 |
262 | var emojiObjs = [];
263 | //如果正则表达式为空
264 | if(__emojisReg.length == 0 || !__emojis){
265 | var emojiObj = {}
266 | emojiObj.node = "text";
267 | emojiObj.text = str;
268 | array = [emojiObj];
269 | return array;
270 | }
271 | //这个地方需要调整
272 | str = str.replace(/\[([^\[\]]+)\]/g,':$1:')
273 | var eReg = new RegExp("[:]");
274 | var array = str.split(eReg);
275 | for(var i = 0; i < array.length; i++){
276 | var ele = array[i];
277 | var emojiObj = {};
278 | if(__emojis[ele]){
279 | emojiObj.node = "element";
280 | emojiObj.tag = "emoji";
281 | emojiObj.text = __emojis[ele];
282 | emojiObj.baseSrc= __emojisBaseSrc;
283 | }else{
284 | emojiObj.node = "text";
285 | emojiObj.text = ele;
286 | }
287 | emojiObjs.push(emojiObj);
288 | }
289 |
290 | return emojiObjs;
291 | }
292 |
293 | function emojisInit(reg='',baseSrc="/wxParse/emojis/",emojis){
294 | __emojisReg = reg;
295 | __emojisBaseSrc=baseSrc;
296 | __emojis=emojis;
297 | }
298 |
299 | module.exports = {
300 | html2json: html2json,
301 | emojisInit:emojisInit
302 | };
303 |
304 |
--------------------------------------------------------------------------------
/wxParse/htmlparser.js:
--------------------------------------------------------------------------------
1 | /**
2 | *
3 | * htmlParser改造自: https://github.com/blowsie/Pure-JavaScript-HTML5-Parser
4 | *
5 | * author: Di (微信小程序开发工程师)
6 | * organization: WeAppDev(微信小程序开发论坛)(http://weappdev.com)
7 | * 垂直微信小程序开发交流社区
8 | *
9 | * github地址: https://github.com/icindy/wxParse
10 | *
11 | * for: 微信小程序富文本解析
12 | * detail : http://weappdev.com/t/wxparse-alpha0-1-html-markdown/184
13 | */
14 | // Regular Expressions for parsing tags and attributes
15 | var startTag = /^<([-A-Za-z0-9_]+)((?:\s+[a-zA-Z_:][-a-zA-Z0-9_:.]*(?:\s*=\s*(?:(?:"[^"]*")|(?:'[^']*')|[^>\s]+))?)*)\s*(\/?)>/,
16 | endTag = /^<\/([-A-Za-z0-9_]+)[^>]*>/,
17 | attr = /([a-zA-Z_:][-a-zA-Z0-9_:.]*)(?:\s*=\s*(?:(?:"((?:\\.|[^"])*)")|(?:'((?:\\.|[^'])*)')|([^>\s]+)))?/g;
18 |
19 | // Empty Elements - HTML 5
20 | var empty = makeMap("area,base,basefont,br,col,frame,hr,img,input,link,meta,param,embed,command,keygen,source,track,wbr");
21 |
22 | // Block Elements - HTML 5
23 | var block = makeMap("a,address,code,article,applet,aside,audio,blockquote,button,canvas,center,dd,del,dir,div,dl,dt,fieldset,figcaption,figure,footer,form,frameset,h1,h2,h3,h4,h5,h6,header,hgroup,hr,iframe,ins,isindex,li,map,menu,noframes,noscript,object,ol,output,p,pre,section,script,table,tbody,td,tfoot,th,thead,tr,ul,video");
24 |
25 | // Inline Elements - HTML 5
26 | var inline = makeMap("abbr,acronym,applet,b,basefont,bdo,big,br,button,cite,del,dfn,em,font,i,iframe,img,input,ins,kbd,label,map,object,q,s,samp,script,select,small,span,strike,strong,sub,sup,textarea,tt,u,var");
27 |
28 | // Elements that you can, intentionally, leave open
29 | // (and which close themselves)
30 | var closeSelf = makeMap("colgroup,dd,dt,li,options,p,td,tfoot,th,thead,tr");
31 |
32 | // Attributes that have their values filled in disabled="disabled"
33 | var fillAttrs = makeMap("checked,compact,declare,defer,disabled,ismap,multiple,nohref,noresize,noshade,nowrap,readonly,selected");
34 |
35 | // Special Elements (can contain anything)
36 | var special = makeMap("wxxxcode-style,script,style,view,scroll-view,block");
37 |
38 | function HTMLParser(html, handler) {
39 | var index, chars, match, stack = [], last = html;
40 | stack.last = function () {
41 | return this[this.length - 1];
42 | };
43 |
44 | while (html) {
45 | chars = true;
46 |
47 | // Make sure we're not in a script or style element
48 | if (!stack.last() || !special[stack.last()]) {
49 |
50 | // Comment
51 | if (html.indexOf("");
53 |
54 | if (index >= 0) {
55 | if (handler.comment)
56 | handler.comment(html.substring(4, index));
57 | html = html.substring(index + 3);
58 | chars = false;
59 | }
60 |
61 | // end tag
62 | } else if (html.indexOf("") == 0) {
63 | match = html.match(endTag);
64 |
65 | if (match) {
66 | html = html.substring(match[0].length);
67 | match[0].replace(endTag, parseEndTag);
68 | chars = false;
69 | }
70 |
71 | // start tag
72 | } else if (html.indexOf("<") == 0) {
73 | match = html.match(startTag);
74 |
75 | if (match) {
76 | html = html.substring(match[0].length);
77 | match[0].replace(startTag, parseStartTag);
78 | chars = false;
79 | }
80 | }
81 |
82 | if (chars) {
83 | index = html.indexOf("<");
84 | var text = ''
85 | while (index === 0) {
86 | text += "<";
87 | html = html.substring(1);
88 | index = html.indexOf("<");
89 | }
90 | text += index < 0 ? html : html.substring(0, index);
91 | html = index < 0 ? "" : html.substring(index);
92 |
93 | if (handler.chars)
94 | handler.chars(text);
95 | }
96 |
97 | } else {
98 |
99 | html = html.replace(new RegExp("([\\s\\S]*?)<\/" + stack.last() + "[^>]*>"), function (all, text) {
100 | text = text.replace(/|/g, "$1$2");
101 | if (handler.chars)
102 | handler.chars(text);
103 |
104 | return "";
105 | });
106 |
107 |
108 | parseEndTag("", stack.last());
109 | }
110 |
111 | if (html == last)
112 | throw "Parse Error: " + html;
113 | last = html;
114 | }
115 |
116 | // Clean up any remaining tags
117 | parseEndTag();
118 |
119 | function parseStartTag(tag, tagName, rest, unary) {
120 | tagName = tagName.toLowerCase();
121 |
122 | if (block[tagName]) {
123 | while (stack.last() && inline[stack.last()]) {
124 | parseEndTag("", stack.last());
125 | }
126 | }
127 |
128 | if (closeSelf[tagName] && stack.last() == tagName) {
129 | parseEndTag("", tagName);
130 | }
131 |
132 | unary = empty[tagName] || !!unary;
133 |
134 | if (!unary)
135 | stack.push(tagName);
136 |
137 | if (handler.start) {
138 | var attrs = [];
139 |
140 | rest.replace(attr, function (match, name) {
141 | var value = arguments[2] ? arguments[2] :
142 | arguments[3] ? arguments[3] :
143 | arguments[4] ? arguments[4] :
144 | fillAttrs[name] ? name : "";
145 |
146 | attrs.push({
147 | name: name,
148 | value: value,
149 | escaped: value.replace(/(^|[^\\])"/g, '$1\\\"') //"
150 | });
151 | });
152 |
153 | if (handler.start) {
154 | handler.start(tagName, attrs, unary);
155 | }
156 |
157 | }
158 | }
159 |
160 | function parseEndTag(tag, tagName) {
161 | // If no tag name is provided, clean shop
162 | if (!tagName)
163 | var pos = 0;
164 |
165 | // Find the closest opened tag of the same type
166 | else {
167 | tagName = tagName.toLowerCase();
168 | for (var pos = stack.length - 1; pos >= 0; pos--)
169 | if (stack[pos] == tagName)
170 | break;
171 | }
172 | if (pos >= 0) {
173 | // Close all the open elements, up the stack
174 | for (var i = stack.length - 1; i >= pos; i--)
175 | if (handler.end)
176 | handler.end(stack[i]);
177 |
178 | // Remove the open elements from the stack
179 | stack.length = pos;
180 | }
181 | }
182 | };
183 |
184 |
185 | function makeMap(str) {
186 | var obj = {}, items = str.split(",");
187 | for (var i = 0; i < items.length; i++)
188 | obj[items[i]] = true;
189 | return obj;
190 | }
191 |
192 | module.exports = HTMLParser;
193 |
--------------------------------------------------------------------------------
/wxParse/wxDiscode.js:
--------------------------------------------------------------------------------
1 | // HTML 支持的数学符号
2 | function strNumDiscode(str){
3 | str = str.replace(/∀/g, '∀');
4 | str = str.replace(/∂/g, '∂');
5 | str = str.replace(/&exists;/g, '∃');
6 | str = str.replace(/∅/g, '∅');
7 | str = str.replace(/∇/g, '∇');
8 | str = str.replace(/∈/g, '∈');
9 | str = str.replace(/∉/g, '∉');
10 | str = str.replace(/∋/g, '∋');
11 | str = str.replace(/∏/g, '∏');
12 | str = str.replace(/∑/g, '∑');
13 | str = str.replace(/−/g, '−');
14 | str = str.replace(/∗/g, '∗');
15 | str = str.replace(/√/g, '√');
16 | str = str.replace(/∝/g, '∝');
17 | str = str.replace(/∞/g, '∞');
18 | str = str.replace(/∠/g, '∠');
19 | str = str.replace(/∧/g, '∧');
20 | str = str.replace(/∨/g, '∨');
21 | str = str.replace(/∩/g, '∩');
22 | str = str.replace(/∩/g, '∪');
23 | str = str.replace(/∫/g, '∫');
24 | str = str.replace(/∴/g, '∴');
25 | str = str.replace(/∼/g, '∼');
26 | str = str.replace(/≅/g, '≅');
27 | str = str.replace(/≈/g, '≈');
28 | str = str.replace(/≠/g, '≠');
29 | str = str.replace(/≤/g, '≤');
30 | str = str.replace(/≥/g, '≥');
31 | str = str.replace(/⊂/g, '⊂');
32 | str = str.replace(/⊃/g, '⊃');
33 | str = str.replace(/⊄/g, '⊄');
34 | str = str.replace(/⊆/g, '⊆');
35 | str = str.replace(/⊇/g, '⊇');
36 | str = str.replace(/⊕/g, '⊕');
37 | str = str.replace(/⊗/g, '⊗');
38 | str = str.replace(/⊥/g, '⊥');
39 | str = str.replace(/⋅/g, '⋅');
40 | return str;
41 | }
42 |
43 | //HTML 支持的希腊字母
44 | function strGreeceDiscode(str){
45 | str = str.replace(/Α/g, 'Α');
46 | str = str.replace(/Β/g, 'Β');
47 | str = str.replace(/Γ/g, 'Γ');
48 | str = str.replace(/Δ/g, 'Δ');
49 | str = str.replace(/Ε/g, 'Ε');
50 | str = str.replace(/Ζ/g, 'Ζ');
51 | str = str.replace(/Η/g, 'Η');
52 | str = str.replace(/Θ/g, 'Θ');
53 | str = str.replace(/Ι/g, 'Ι');
54 | str = str.replace(/Κ/g, 'Κ');
55 | str = str.replace(/Λ/g, 'Λ');
56 | str = str.replace(/Μ/g, 'Μ');
57 | str = str.replace(/Ν/g, 'Ν');
58 | str = str.replace(/Ξ/g, 'Ν');
59 | str = str.replace(/Ο/g, 'Ο');
60 | str = str.replace(/Π/g, 'Π');
61 | str = str.replace(/Ρ/g, 'Ρ');
62 | str = str.replace(/Σ/g, 'Σ');
63 | str = str.replace(/Τ/g, 'Τ');
64 | str = str.replace(/Υ/g, 'Υ');
65 | str = str.replace(/Φ/g, 'Φ');
66 | str = str.replace(/Χ/g, 'Χ');
67 | str = str.replace(/Ψ/g, 'Ψ');
68 | str = str.replace(/Ω/g, 'Ω');
69 |
70 | str = str.replace(/α/g, 'α');
71 | str = str.replace(/β/g, 'β');
72 | str = str.replace(/γ/g, 'γ');
73 | str = str.replace(/δ/g, 'δ');
74 | str = str.replace(/ε/g, 'ε');
75 | str = str.replace(/ζ/g, 'ζ');
76 | str = str.replace(/η/g, 'η');
77 | str = str.replace(/θ/g, 'θ');
78 | str = str.replace(/ι/g, 'ι');
79 | str = str.replace(/κ/g, 'κ');
80 | str = str.replace(/λ/g, 'λ');
81 | str = str.replace(/μ/g, 'μ');
82 | str = str.replace(/ν/g, 'ν');
83 | str = str.replace(/ξ/g, 'ξ');
84 | str = str.replace(/ο/g, 'ο');
85 | str = str.replace(/π/g, 'π');
86 | str = str.replace(/ρ/g, 'ρ');
87 | str = str.replace(/ς/g, 'ς');
88 | str = str.replace(/σ/g, 'σ');
89 | str = str.replace(/τ/g, 'τ');
90 | str = str.replace(/υ/g, 'υ');
91 | str = str.replace(/φ/g, 'φ');
92 | str = str.replace(/χ/g, 'χ');
93 | str = str.replace(/ψ/g, 'ψ');
94 | str = str.replace(/ω/g, 'ω');
95 | str = str.replace(/ϑ/g, 'ϑ');
96 | str = str.replace(/ϒ/g, 'ϒ');
97 | str = str.replace(/ϖ/g, 'ϖ');
98 | str = str.replace(/·/g, '·');
99 | return str;
100 | }
101 |
102 | //
103 |
104 | function strcharacterDiscode(str){
105 | // 加入常用解析
106 | str = str.replace(/ /g, ' ');
107 | str = str.replace(/"/g, "'");
108 | str = str.replace(/&/g, '&');
109 | // str = str.replace(/</g, '‹');
110 | // str = str.replace(/>/g, '›');
111 |
112 | str = str.replace(/</g, '<');
113 | str = str.replace(/>/g, '>');
114 | str = str.replace(/•/g, '•');
115 |
116 | return str;
117 | }
118 |
119 | // HTML 支持的其他实体
120 | function strOtherDiscode(str){
121 | str = str.replace(/Œ/g, 'Œ');
122 | str = str.replace(/œ/g, 'œ');
123 | str = str.replace(/Š/g, 'Š');
124 | str = str.replace(/š/g, 'š');
125 | str = str.replace(/Ÿ/g, 'Ÿ');
126 | str = str.replace(/ƒ/g, 'ƒ');
127 | str = str.replace(/ˆ/g, 'ˆ');
128 | str = str.replace(/˜/g, '˜');
129 | str = str.replace(/ /g, '');
130 | str = str.replace(/ /g, '');
131 | str = str.replace(/ /g, '');
132 | str = str.replace(//g, '');
133 | str = str.replace(//g, '');
134 | str = str.replace(//g, '');
135 | str = str.replace(//g, '');
136 | str = str.replace(/–/g, '–');
137 | str = str.replace(/—/g, '—');
138 | str = str.replace(/‘/g, '‘');
139 | str = str.replace(/’/g, '’');
140 | str = str.replace(/‚/g, '‚');
141 | str = str.replace(/“/g, '“');
142 | str = str.replace(/”/g, '”');
143 | str = str.replace(/„/g, '„');
144 | str = str.replace(/†/g, '†');
145 | str = str.replace(/‡/g, '‡');
146 | str = str.replace(/•/g, '•');
147 | str = str.replace(/…/g, '…');
148 | str = str.replace(/‰/g, '‰');
149 | str = str.replace(/′/g, '′');
150 | str = str.replace(/″/g, '″');
151 | str = str.replace(/‹/g, '‹');
152 | str = str.replace(/›/g, '›');
153 | str = str.replace(/‾/g, '‾');
154 | str = str.replace(/€/g, '€');
155 | str = str.replace(/™/g, '™');
156 |
157 | str = str.replace(/←/g, '←');
158 | str = str.replace(/↑/g, '↑');
159 | str = str.replace(/→/g, '→');
160 | str = str.replace(/↓/g, '↓');
161 | str = str.replace(/↔/g, '↔');
162 | str = str.replace(/↵/g, '↵');
163 | str = str.replace(/⌈/g, '⌈');
164 | str = str.replace(/⌉/g, '⌉');
165 |
166 | str = str.replace(/⌊/g, '⌊');
167 | str = str.replace(/⌋/g, '⌋');
168 | str = str.replace(/◊/g, '◊');
169 | str = str.replace(/♠/g, '♠');
170 | str = str.replace(/♣/g, '♣');
171 | str = str.replace(/♥/g, '♥');
172 |
173 | str = str.replace(/♦/g, '♦');
174 | str = str.replace(/'/g, '\'');
175 | return str;
176 | }
177 |
178 | function strMoreDiscode(str){
179 | //str = str.replace(/\r\n/g,"");
180 | //str = str.replace(/\n/g,"");
181 |
182 | str = str.replace(/code/g,"wxxxcode-style");
183 | return str;
184 | }
185 |
186 | function strDiscode(str){
187 | str = strNumDiscode(str);
188 | str = strGreeceDiscode(str);
189 | str = strcharacterDiscode(str);
190 | str = strOtherDiscode(str);
191 | str = strMoreDiscode(str);
192 | return str;
193 | }
194 | function urlToHttpUrl(url,rep){
195 |
196 | var patt1 = new RegExp("^//");
197 | var result = patt1.test(url);
198 | if(result){
199 | url = rep+":"+url;
200 | }
201 | return url;
202 | }
203 |
204 | module.exports = {
205 | strDiscode:strDiscode,
206 | urlToHttpUrl:urlToHttpUrl
207 | }
--------------------------------------------------------------------------------
/wxParse/wxParse.js:
--------------------------------------------------------------------------------
1 | /**
2 | * author: Di (微信小程序开发工程师)
3 | * organization: WeAppDev(微信小程序开发论坛)(http://weappdev.com)
4 | * 垂直微信小程序开发交流社区
5 | *
6 | * github地址: https://github.com/icindy/wxParse
7 | *
8 | * for: 微信小程序富文本解析
9 | * detail : http://weappdev.com/t/wxparse-alpha0-1-html-markdown/184
10 | */
11 |
12 | /**
13 | * utils函数引入
14 | **/
15 | import showdown from './showdown.js';
16 | import HtmlToJson from './html2json.js';
17 | /**
18 | * 配置及公有属性
19 | **/
20 | var realWindowWidth = 0;
21 | var realWindowHeight = 0;
22 | wx.getSystemInfo({
23 | success: function (res) {
24 | realWindowWidth = res.windowWidth
25 | realWindowHeight = res.windowHeight
26 | }
27 | })
28 | /**
29 | * 主函数入口区
30 | **/
31 | function wxParse(bindName = 'wxParseData', type='html', data='数据不能为空
', target,imagePadding) {
32 | var that = target;
33 | var transData = {};//存放转化后的数据
34 | if (type == 'html') {
35 | transData = HtmlToJson.html2json(data, bindName);
36 | //console.log(JSON.stringify(transData, ' ', ' '));
37 | } else if (type == 'md' || type == 'markdown') {
38 | var converter = new showdown.Converter();
39 | var html = converter.makeHtml(data);
40 | transData = HtmlToJson.html2json(html, bindName);
41 | //console.log(JSON.stringify(transData, ' ', ' '));
42 | }
43 | transData.view = {};
44 | transData.view.imagePadding = 0;
45 | if(typeof(imagePadding) != 'undefined'){
46 | transData.view.imagePadding = imagePadding
47 | }
48 | var bindData = {};
49 | bindData[bindName] = transData;
50 | that.setData(bindData)
51 | that.wxParseImgLoad = wxParseImgLoad;
52 | that.wxParseImgTap = wxParseImgTap;
53 | }
54 | // 图片点击事件
55 | function wxParseImgTap(e) {
56 | var that = this;
57 | var nowImgUrl = e.target.dataset.src;
58 | var tagFrom = e.target.dataset.from;
59 | if (typeof (tagFrom) != 'undefined' && tagFrom.length > 0) {
60 | wx.previewImage({
61 | current: nowImgUrl, // 当前显示图片的http链接
62 | urls: that.data[tagFrom].imageUrls // 需要预览的图片http链接列表
63 | })
64 | }
65 | }
66 |
67 | /**
68 | * 图片视觉宽高计算函数区
69 | **/
70 | function wxParseImgLoad(e) {
71 | var that = this;
72 | var tagFrom = e.target.dataset.from;
73 | var idx = e.target.dataset.idx;
74 | if (typeof (tagFrom) != 'undefined' && tagFrom.length > 0) {
75 | calMoreImageInfo(e, idx, that, tagFrom)
76 | }
77 | }
78 | // 假循环获取计算图片视觉最佳宽高
79 | function calMoreImageInfo(e, idx, that, bindName) {
80 | var temData = that.data[bindName];
81 | if (!temData || temData.images.length == 0) {
82 | return;
83 | }
84 | var temImages = temData.images;
85 | //因为无法获取view宽度 需要自定义padding进行计算,稍后处理
86 | var recal = wxAutoImageCal(e.detail.width, e.detail.height,that,bindName);
87 | // temImages[idx].width = recal.imageWidth;
88 | // temImages[idx].height = recal.imageheight;
89 | // temData.images = temImages;
90 | // var bindData = {};
91 | // bindData[bindName] = temData;
92 | // that.setData(bindData);
93 | var index = temImages[idx].index
94 | var key = `${bindName}`
95 | for (var i of index.split('.')) key+=`.nodes[${i}]`
96 | var keyW = key + '.width'
97 | var keyH = key + '.height'
98 | that.setData({
99 | [keyW]: recal.imageWidth,
100 | [keyH]: recal.imageheight,
101 | })
102 | }
103 |
104 | // 计算视觉优先的图片宽高
105 | function wxAutoImageCal(originalWidth, originalHeight,that,bindName) {
106 | //获取图片的原始长宽
107 | var windowWidth = 0, windowHeight = 0;
108 | var autoWidth = 0, autoHeight = 0;
109 | var results = {};
110 | var padding = that.data[bindName].view.imagePadding;
111 | windowWidth = realWindowWidth-2*padding;
112 | windowHeight = realWindowHeight;
113 | //判断按照那种方式进行缩放
114 | // console.log("windowWidth" + windowWidth);
115 | if (originalWidth > windowWidth) {//在图片width大于手机屏幕width时候
116 | autoWidth = windowWidth;
117 | // console.log("autoWidth" + autoWidth);
118 | autoHeight = (autoWidth * originalHeight) / originalWidth;
119 | // console.log("autoHeight" + autoHeight);
120 | results.imageWidth = autoWidth;
121 | results.imageheight = autoHeight;
122 | } else {//否则展示原来的数据
123 | results.imageWidth = originalWidth;
124 | results.imageheight = originalHeight;
125 | }
126 | return results;
127 | }
128 |
129 | function wxParseTemArray(temArrayName,bindNameReg,total,that){
130 | var array = [];
131 | var temData = that.data;
132 | var obj = null;
133 | for(var i = 0; i < total; i++){
134 | var simArr = temData[bindNameReg+i].nodes;
135 | array.push(simArr);
136 | }
137 |
138 | temArrayName = temArrayName || 'wxParseTemArray';
139 | obj = JSON.parse('{"'+ temArrayName +'":""}');
140 | obj[temArrayName] = array;
141 | that.setData(obj);
142 | }
143 |
144 | /**
145 | * 配置emojis
146 | *
147 | */
148 |
149 | function emojisInit(reg='',baseSrc="/wxParse/emojis/",emojis){
150 | HtmlToJson.emojisInit(reg,baseSrc,emojis);
151 | }
152 |
153 | module.exports = {
154 | wxParse: wxParse,
155 | wxParseTemArray:wxParseTemArray,
156 | emojisInit:emojisInit
157 | }
158 |
159 |
160 |
--------------------------------------------------------------------------------
/wxParse/wxParse.wxss:
--------------------------------------------------------------------------------
1 | /**
2 | * author: Di (微信小程序开发工程师)
3 | * organization: WeAppDev(微信小程序开发论坛)(http://weappdev.com)
4 | * 垂直微信小程序开发交流社区
5 | *
6 | * github地址: https://github.com/icindy/wxParse
7 | *
8 | * for: 微信小程序富文本解析
9 | * detail : http://weappdev.com/t/wxparse-alpha0-1-html-markdown/184
10 | */
11 |
12 | .wxParse {
13 | margin: 0 5px;
14 |
15 | font-size: 28rpx;
16 | color: #666;
17 | line-height: 1.8;
18 | }
19 |
20 | .wxParse view {
21 | word-break: break-all;
22 | overflow: auto;
23 | }
24 |
25 | .wxParse-inline {
26 | /*display: inline;*/
27 | margin: 0;
28 | padding: 0;
29 | }
30 |
31 | /*//标题 */
32 |
33 | .wxParse-div {
34 | margin: 0;
35 | padding: 0;
36 | }
37 |
38 | .wxParse-h1 {
39 | font-size: 2em;
40 | margin: 0.67em 0;
41 | }
42 |
43 | .wxParse-h2 {
44 | font-size: 1.5em;
45 | margin: 0.75em 0;
46 | }
47 |
48 | .wxParse-h3 {
49 | font-size: 1.17em;
50 | margin: 0.83em 0;
51 | }
52 |
53 | .wxParse-h4 {
54 | margin: 1.12em 0;
55 | }
56 |
57 | .wxParse-h5 {
58 | font-size: 0.83em;
59 | margin: 1.5em 0;
60 | }
61 |
62 | .wxParse-h6 {
63 | font-size: 0.75em;
64 | margin: 1.67em 0;
65 | }
66 |
67 | .wxParse-h1 {
68 | font-size: 18px;
69 | font-weight: 400;
70 | margin-bottom: 0.9em;
71 | }
72 |
73 | .wxParse-h2 {
74 | font-size: 16px;
75 | font-weight: 400;
76 | margin-bottom: 0.34em;
77 | }
78 |
79 | .wxParse-h3 {
80 | font-weight: 400;
81 | font-size: 15px;
82 | margin-bottom: 0.34em;
83 | }
84 |
85 | .wxParse-h4 {
86 | font-weight: 400;
87 | font-size: 14px;
88 | margin-bottom: 0.24em;
89 | }
90 |
91 | .wxParse-h5 {
92 | font-weight: 400;
93 | font-size: 13px;
94 | margin-bottom: 0.14em;
95 | }
96 |
97 | .wxParse-h6 {
98 | font-weight: 400;
99 | font-size: 12px;
100 | margin-bottom: 0.04em;
101 | }
102 |
103 | .wxParse-h1, .wxParse-h2, .wxParse-h3, .wxParse-h4, .wxParse-h5, .wxParse-h6,
104 | .wxParse-b, .wxParse-strong {
105 | font-weight: bolder;
106 | }
107 |
108 | .wxParse-i, .wxParse-cite, .wxParse-em, .wxParse-var, .wxParse-address {
109 | font-style: italic;
110 | }
111 |
112 | .wxParse-tt, .wxParse-code, .wxParse-kbd, .wxParse-samp {
113 | font-family: monospace;
114 | }
115 |
116 | .wxParse-pre {
117 | white-space: pre;
118 | background: #f5f5f5;
119 | border: 1px solid #dddddd;
120 | }
121 |
122 | .wxParse-big {
123 | font-size: 1.17em;
124 | }
125 |
126 | .wxParse-small, .wxParse-sub, .wxParse-sup {
127 | font-size: 0.83em;
128 | }
129 |
130 | .wxParse-sub {
131 | vertical-align: sub;
132 | }
133 |
134 | .wxParse-sup {
135 | vertical-align: super;
136 | }
137 |
138 | .wxParse-s, .wxParse-strike, .wxParse-del {
139 | text-decoration: line-through;
140 | }
141 |
142 | /*wxparse-自定义个性化的css样式*/
143 |
144 | /*增加video的css样式*/
145 |
146 | .wxParse-strong, .wxParse-s {
147 | display: inline;
148 | }
149 |
150 | .wxParse-a {
151 | color: deepskyblue;
152 | word-break: break-all;
153 | overflow: auto;
154 | }
155 |
156 | .wxParse-video {
157 | text-align: center;
158 | margin: 10px 0;
159 | }
160 |
161 | .wxParse-video-video {
162 | width: 100%;
163 | }
164 |
165 | .wxParse-img {
166 | /*background-color: #efefef;*/
167 | overflow: hidden;
168 | }
169 |
170 | .wxParse-blockquote {
171 | margin: 0;
172 | padding: 10px 0 10px 5px;
173 | font-family: Courier, Calibri, "宋体";
174 | background: #f5f5f5;
175 | border-left: 3px solid #dbdbdb;
176 | }
177 | .wxParse-pre .wxParse-wxxxcode-style {
178 | display: inline;
179 | background: #f5f5f5;
180 | color: inherit;
181 | }
182 |
183 | .wxParse-code, .wxParse-wxxxcode-style {
184 | display: inline;
185 | background: #f5f5f5;
186 | color: #FF6600;
187 | }
188 |
189 | .wxParse-ul {
190 | margin: 20rpx 10rpx;
191 | }
192 |
193 | .wxParse-li, .wxParse-li-inner {
194 | display: flex;
195 | align-items: baseline;
196 | margin: 10rpx 0;
197 | }
198 |
199 | .wxParse-li-text {
200 | align-items: center;
201 | line-height: 20px;
202 | }
203 |
204 | .wxParse-li-circle {
205 | display: inline-flex;
206 | width: 5px;
207 | height: 5px;
208 | background-color: #333;
209 | margin-right: 5px;
210 | }
211 |
212 | .wxParse-li-square {
213 | display: inline-flex;
214 | width: 10rpx;
215 | height: 10rpx;
216 | background-color: #333;
217 | margin-right: 5px;
218 | }
219 |
220 | .wxParse-li-ring {
221 | display: inline-flex;
222 | width: 10rpx;
223 | height: 10rpx;
224 | border: 2rpx solid #333;
225 | border-radius: 50%;
226 | background-color: #fff;
227 | margin-right: 5px;
228 | }
229 |
230 | /*.wxParse-table{
231 | width: 100%;
232 | height: 400px;
233 | }
234 | .wxParse-thead,.wxParse-tfoot,.wxParse-tr{
235 | display: flex;
236 | flex-direction: row;
237 | }
238 | .wxParse-th,.wxParse-td{
239 | display: flex;
240 | width: 580px;
241 | overflow: auto;
242 | }*/
243 |
244 | .wxParse-u {
245 | text-decoration: underline;
246 | }
247 |
248 | .wxParse-hide {
249 | display: none;
250 | }
251 |
252 | .WxEmojiView {
253 | align-items: center;
254 | }
255 |
256 | .wxEmoji {
257 | width: 16px;
258 | height: 16px;
259 | }
260 |
261 | .wxParse-tr {
262 | display: flex;
263 | border-right: 1px solid #e0e0e0;
264 | border-bottom: 1px solid #e0e0e0;
265 | border-top: 1px solid #e0e0e0;
266 | }
267 |
268 | .wxParse-th, .wxParse-td {
269 | flex: 1;
270 | padding: 5px;
271 | font-size: 28rpx;
272 | border-left: 1px solid #e0e0e0;
273 | word-break: break-all;
274 | }
275 |
276 | .wxParse-td:last {
277 | border-top: 1px solid #e0e0e0;
278 | }
279 |
280 | .wxParse-th {
281 | background: #f0f0f0;
282 | border-top: 1px solid #e0e0e0;
283 | }
284 |
285 | .wxParse-del {
286 | display: inline;
287 | }
288 |
289 | .wxParse-figure {
290 | overflow: hidden;
291 | }
292 |
--------------------------------------------------------------------------------