├── LICENSE
├── README.md
├── app.js
├── app.json
├── app.wxss
├── colorui.wxss
├── component
├── cu-custom.js
├── cu-custom.json
├── custom.js
├── custom.json
├── custom.wxml
└── custom.wxss
├── highlight
├── prism.js
└── prism.wxss
├── icon.wxss
├── images
├── logo.png
└── tabbar
│ ├── about.png
│ ├── about_cur.png
│ ├── basics.png
│ ├── basics_cur.png
│ ├── component.png
│ ├── component_cur.png
│ ├── plugin.png
│ └── plugin_cur.png
├── pages
├── about
│ ├── about.js
│ ├── about.json
│ ├── about.wxml
│ ├── about.wxss
│ ├── issue.js
│ ├── issue.json
│ ├── issue.wxml
│ ├── issue.wxss
│ ├── thank.js
│ ├── thank.json
│ ├── thank.wxml
│ └── thank.wxss
├── index
│ ├── list.js
│ ├── list.json
│ ├── list.wxml
│ ├── list.wxss
│ ├── more.js
│ ├── more.json
│ ├── more.wxml
│ ├── more.wxss
│ ├── reply.js
│ ├── reply.json
│ ├── reply.wxml
│ ├── reply.wxss
│ └── router.js
├── login
│ ├── login.js
│ ├── login.json
│ ├── login.wxml
│ └── login.wxss
└── temp
│ ├── collection.js
│ ├── collection.json
│ ├── collection.wxml
│ ├── collection.wxss
│ ├── comment.js
│ ├── comment.json
│ ├── comment.wxml
│ ├── comment.wxss
│ ├── flash.js
│ ├── flash.json
│ ├── flash.wxml
│ ├── flash.wxss
│ ├── index.js
│ ├── index.json
│ ├── index.wxml
│ ├── index.wxss
│ ├── like.js
│ ├── like.json
│ ├── like.wxml
│ ├── like.wxss
│ ├── notice.js
│ ├── notice.json
│ ├── notice.wxml
│ └── notice.wxss
├── project.config.json
├── scan.jpg
├── sitemap.json
├── utils
├── md5.js
├── router.js
├── timeago.js
└── util.js
└── wxParse
├── emojis
├── 00.gif
├── 01.gif
├── 02.gif
├── 03.gif
├── 04.gif
├── 05.gif
├── 06.gif
├── 07.gif
├── 08.gif
├── 09.gif
├── 10.gif
├── 100.gif
├── 101.gif
├── 102.gif
├── 103.gif
├── 104.gif
├── 105.gif
├── 106.gif
├── 107.gif
├── 108.gif
├── 109.gif
├── 11.gif
├── 110.gif
├── 111.gif
├── 112.gif
├── 113.gif
├── 114.gif
├── 115.gif
├── 116.gif
├── 117.gif
├── 118.gif
├── 119.gif
├── 12.gif
├── 120.gif
├── 121.gif
├── 122.gif
├── 123.gif
├── 124.gif
├── 125.gif
├── 126.gif
├── 127.gif
├── 128.gif
├── 129.gif
├── 13.gif
├── 130.gif
├── 131.gif
├── 132.gif
├── 133.gif
├── 134.gif
├── 14.gif
├── 15.gif
├── 16.gif
├── 17.gif
├── 18.gif
├── 19.gif
├── 20.gif
├── 21.gif
├── 22.gif
├── 23.gif
├── 24.gif
├── 25.gif
├── 26.gif
├── 27.gif
├── 28.gif
├── 29.gif
├── 30.gif
├── 31.gif
├── 32.gif
├── 33.gif
├── 34.gif
├── 35.gif
├── 36.gif
├── 37.gif
├── 38.gif
├── 39.gif
├── 40.gif
├── 41.gif
├── 42.gif
├── 43.gif
├── 44.gif
├── 45.gif
├── 46.gif
├── 47.gif
├── 48.gif
├── 49.gif
├── 50.gif
├── 51.gif
├── 52.gif
├── 53.gif
├── 54.gif
├── 55.gif
├── 56.gif
├── 57.gif
├── 58.gif
├── 59.gif
├── 60.gif
├── 61.gif
├── 62.gif
├── 63.gif
├── 64.gif
├── 65.gif
├── 66.gif
├── 67.gif
├── 68.gif
├── 69.gif
├── 70.gif
├── 71.gif
├── 72.gif
├── 73.gif
├── 74.gif
├── 75.gif
├── 76.gif
├── 77.gif
├── 78.gif
├── 79.gif
├── 80.gif
├── 81.gif
├── 82.gif
├── 83.gif
├── 84.gif
├── 85.gif
├── 86.gif
├── 87.gif
├── 88.gif
├── 89.gif
├── 90.gif
├── 91.gif
├── 92.gif
├── 93.gif
├── 94.gif
├── 95.gif
├── 96.gif
├── 97.gif
├── 98.gif
└── 99.gif
├── highlight.js
├── html2json.js
├── htmlparser.js
├── showdown.js
├── wxDiscode.js
├── wxParse.js
├── wxParse.wxml
└── wxParse.wxss
/LICENSE:
--------------------------------------------------------------------------------
1 | MIT License
2 |
3 | Copyright (c) 2019 Jarry
4 |
5 | Permission is hereby granted, free of charge, to any person obtaining a copy
6 | of this software and associated documentation files (the "Software"), to deal
7 | in the Software without restriction, including without limitation the rights
8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9 | copies of the Software, and to permit persons to whom the Software is
10 | furnished to do so, subject to the following conditions:
11 |
12 | The above copyright notice and this permission notice shall be included in all
13 | copies or substantial portions of the Software.
14 |
15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21 | SOFTWARE.
22 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | # 微信小程序
2 |
3 | ## 介绍
4 |
5 | 这是一款后台为 `python-flask` 的博客微信小程序。使用了 `ColorUI` 组件库。
6 |
7 | 可以实现 `代码高亮` `点赞` `收藏` `评论` `回复` `接收通知` 等功能。
8 |
9 | 微信搜索 : `jarry007` 进行体验。
10 |
11 | 或者扫码体验:
12 |
13 |
14 |
15 | ---
16 |
17 | ## 版本
18 |
19 | - ### v1.1 (05/17)
20 |
21 | - 修复个人界面点击获取头像按钮无法显示头像BUG
22 | - 解决分享之后打开页面路径不对的问题
23 | - 修复下拉后无法自动收回的问题
24 | - 在一些操作事件中加入短震动(iphone7及以上,部分安卓)
25 | - 反馈内容直接发送到作者邮箱
26 | - 点击评论的任意位置即可跳转至回复界面
27 | - 文章页面双击导航栏回到顶部
28 |
29 | - ### v1.2 (05/21)
30 |
31 | - 修复代码段无法换行问题
32 | - 修复反馈内容无图情况下无法发送的问题
33 | - 评论后延时触底
34 | - 解决消息提醒错误的问题
35 |
36 |
37 |
38 |
39 |
40 |
41 |
42 |
--------------------------------------------------------------------------------
/app.js:
--------------------------------------------------------------------------------
1 | //app.js
2 | var time = require('utils/util.js')
3 | App({
4 | onLaunch: function() {
5 | wx.getSystemInfo({
6 | success: e => {
7 | this.globalData.StatusBar = e.statusBarHeight;
8 | let custom = wx.getMenuButtonBoundingClientRect();
9 | this.globalData.Custom = custom;
10 | this.globalData.CustomBar = custom.bottom + custom.top - e.statusBarHeight;
11 | }
12 | })
13 | },
14 | globalData: {
15 | userInfo: null,
16 | url: 'http://localhost:5000/',
17 | new_: '',
18 | StatusBar: '',
19 | Custom: '',
20 | CustomBar: '',
21 | routerConfig:{
22 | tokenName:'Authorization',
23 | tokenValue:'',
24 | url:'http://localhost:5000/'
25 | }
26 |
27 | }
28 | })
--------------------------------------------------------------------------------
/app.json:
--------------------------------------------------------------------------------
1 | {
2 | "pages": [
3 | "pages/index/list",
4 | "pages/index/more",
5 | "pages/temp/index",
6 | "pages/temp/flash",
7 | "pages/temp/like",
8 | "pages/login/login",
9 | "pages/temp/comment",
10 | "pages/temp/collection",
11 | "pages/temp/notice",
12 | "pages/about/about",
13 | "pages/about/thank",
14 | "pages/index/reply",
15 | "pages/about/issue",
16 | "component/custom"
17 |
18 | ],
19 | "window": {
20 | "backgroundTextStyle": "light",
21 | "navigationBarBackgroundColor": "#fff",
22 | "navigationBarTitleText": "ColorUI",
23 | "navigationStyle": "custom",
24 | "navigationBarTextStyle": "white"
25 | },
26 |
27 | "tabBar": {
28 | "color": "#aaa",
29 | "selectedColor": "#39b54a",
30 | "borderStyle": "black",
31 | "backgroundColor": "#ffffff",
32 | "list": [
33 | {
34 | "pagePath": "pages/index/list",
35 | "iconPath": "/images/tabbar/component.png",
36 | "selectedIconPath": "/images/tabbar/component_cur.png",
37 | "text": "文章"
38 | },
39 | {
40 | "pagePath": "pages/temp/index",
41 | "iconPath": "/images/tabbar/about.png",
42 | "selectedIconPath": "/images/tabbar/about_cur.png",
43 | "text": "我的"
44 | }
45 | ]
46 | },
47 | "usingComponents": {
48 | "cu-custom": "/component/custom"
49 | },
50 | "sitemapLocation": "sitemap.json"
51 | }
--------------------------------------------------------------------------------
/app.wxss:
--------------------------------------------------------------------------------
1 | @import "icon.wxss";
2 | @import "colorui.wxss";
3 |
4 | .nav-list {
5 | display: flex;
6 | flex-wrap: wrap;
7 | padding: 0px 40rpx 0px;
8 | justify-content: space-between;
9 | }
10 |
11 | .nav-li {
12 | padding: 30rpx;
13 | border-radius: 12rpx;
14 | width: 45%;
15 | margin: 0 2.5% 40rpx;
16 | background-image: url(https://image.weilanwl.com/color2.0/cardBg.png);
17 | background-size: cover;
18 | background-position: center;
19 | position: relative;
20 | z-index: 1;
21 | }
22 |
23 | .nav-li::after {
24 | content: "";
25 | position: absolute;
26 | z-index: -1;
27 | background-color: inherit;
28 | width: 100%;
29 | height: 100%;
30 | left: 0;
31 | bottom: -10%;
32 | border-radius: 10rpx;
33 | opacity: 0.2;
34 | transform: scale(0.9, 0.9);
35 | }
36 |
37 | .nav-li.cur {
38 | color: #fff;
39 | background: rgb(94, 185, 94);
40 | box-shadow: 4rpx 4rpx 6rpx rgba(94, 185, 94, 0.4);
41 | }
42 |
43 | .nav-title {
44 | font-size: 32rpx;
45 | font-weight: 300;
46 | }
47 |
48 | .nav-title::first-letter {
49 | font-size: 40rpx;
50 | margin-right: 4rpx;
51 | }
52 |
53 | .nav-name {
54 | font-size: 28rpx;
55 | text-transform: Capitalize;
56 | margin-top: 20rpx;
57 | position: relative;
58 | }
59 |
60 | .nav-name::before {
61 | content: "";
62 | position: absolute;
63 | display: block;
64 | width: 40rpx;
65 | height: 6rpx;
66 | background: #fff;
67 | bottom: 0;
68 | right: 0;
69 | opacity: 0.5;
70 | }
71 |
72 | .nav-name::after {
73 | content: "";
74 | position: absolute;
75 | display: block;
76 | width: 100rpx;
77 | height: 1px;
78 | background: #fff;
79 | bottom: 0;
80 | right: 40rpx;
81 | opacity: 0.3;
82 | }
83 |
84 | .nav-name::first-letter {
85 | font-weight: bold;
86 | font-size: 36rpx;
87 | margin-right: 1px;
88 | }
89 |
90 | .nav-li text {
91 | position: absolute;
92 | right: 30rpx;
93 | top: 30rpx;
94 | font-size: 52rpx;
95 | width: 60rpx;
96 | height: 60rpx;
97 | text-align: center;
98 | line-height: 60rpx;
99 | }
100 |
101 | .text-light {
102 | font-weight: 300;
103 | }
104 |
105 | @keyframes show {
106 | 0% {
107 | transform: translateY(-50px);
108 | }
109 |
110 | 60% {
111 | transform: translateY(40rpx);
112 | }
113 |
114 | 100% {
115 | transform: translateY(0px);
116 | }
117 | }
118 |
119 | @-webkit-keyframes show {
120 | 0% {
121 | transform: translateY(-50px);
122 | }
123 |
124 | 60% {
125 | transform: translateY(40rpx);
126 | }
127 |
128 | 100% {
129 | transform: translateY(0px);
130 | }
131 | }
132 |
--------------------------------------------------------------------------------
/component/cu-custom.js:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Jarry007/wxBlog/0c170f6b46751976b273f8bd94524451e9b0df47/component/cu-custom.js
--------------------------------------------------------------------------------
/component/cu-custom.json:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Jarry007/wxBlog/0c170f6b46751976b273f8bd94524451e9b0df47/component/cu-custom.json
--------------------------------------------------------------------------------
/component/custom.js:
--------------------------------------------------------------------------------
1 | const app = getApp();
2 | Component({
3 | /**
4 | * 组件的一些选项
5 | */
6 | options: {
7 | addGlobalClass: true,
8 | multipleSlots: true
9 | },
10 | /**
11 | * 组件的对外属性
12 | */
13 | properties: {
14 | bgColor: {
15 | type: String,
16 | default: ''
17 | },
18 | isCustom: {
19 | type: [Boolean, String],
20 | default: false
21 | },
22 | isBack: {
23 | type: [Boolean, String],
24 | default: false
25 | },
26 | bgImage: {
27 | type: String,
28 | default: ''
29 | },
30 | },
31 | /**
32 | * 组件的初始数据
33 | */
34 | attached() {
35 | // console.log(app.sysCallBack)
36 | // if (app.globalData.barInfo.Custom){
37 | // this.setData({
38 | // StatusBar: app.globalData.barInfo.StatusBar,
39 | // CustomBar: app.globalData.barInfo.CustomBar,
40 | // Custom: app.globalData.barInfo.Custom
41 | // })
42 | // }else{
43 | // console.log('callbackkkkkk')
44 | // app.sysCallBack = e=>{
45 | // console.log('e',e)
46 | // this.setData({
47 | // StatusBar: e.statusBarHeight,
48 | // CustomBar: custom.bottom + custom.top - e.statusBarHeight,
49 | // Custom: custom
50 | // })
51 | // }
52 | // }
53 |
54 | wx.getSystemInfo({
55 |
56 | success: e => {
57 | let custom = wx.getMenuButtonBoundingClientRect();
58 |
59 | // this.globalData.barInfo.StatusBar = e.statusBarHeight;
60 |
61 | // this.globalData.barInfo.Custom = custom;
62 | // this.globalData.barInfo.CustomBar = custom.bottom + custom.top - e.statusBarHeight;
63 |
64 |
65 | this.setData({
66 | StatusBar: e.statusBarHeight,
67 | Custom: custom,
68 | CustomBar: custom.bottom + custom.top - e.statusBarHeight
69 | })
70 |
71 | }
72 | })
73 | },
74 | data: {
75 | StatusBar: '',
76 | CustomBar: '',
77 | Custom: ''
78 | },
79 | /**
80 | * 组件的方法列表
81 | */
82 | methods: {
83 | BackPage() {
84 | wx.navigateBack({
85 | delta: 1
86 | });
87 | },
88 | toHome() {
89 | wx.reLaunch({
90 | url: '/pages/index/index',
91 | })
92 | }
93 | }
94 | })
--------------------------------------------------------------------------------
/component/custom.json:
--------------------------------------------------------------------------------
1 | {
2 | "component": true,
3 | "usingComponents": {}
4 | }
--------------------------------------------------------------------------------
/component/custom.wxml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
--------------------------------------------------------------------------------
/component/custom.wxss:
--------------------------------------------------------------------------------
1 | /* component/custom.wxss */
--------------------------------------------------------------------------------
/highlight/prism.js:
--------------------------------------------------------------------------------
1 |
2 | var _self="undefined"!=typeof window?window:"undefined"!=typeof WorkerGlobalScope&&self instanceof WorkerGlobalScope?self:{},Prism=function(g){var c=/\blang(?:uage)?-([\w-]+)\b/i,a=0,C={manual:g.Prism&&g.Prism.manual,disableWorkerMessageHandler:g.Prism&&g.Prism.disableWorkerMessageHandler,util:{encode:function(e){return e instanceof M?new M(e.type,C.util.encode(e.content),e.alias):Array.isArray(e)?e.map(C.util.encode):e.replace(/&/g,"&").replace(/e.length)return;if(!(k instanceof M)){if(f&&y!=a.length-1){if(c.lastIndex=v,!(x=c.exec(e)))break;for(var b=x.index+(h?x[1].length:0),w=x.index+x[0].length,A=y,P=v,O=a.length;A"+t.content+""+t.tag+">"},!g.document)return g.addEventListener&&(C.disableWorkerMessageHandler||g.addEventListener("message",function(e){var a=JSON.parse(e.data),t=a.language,n=a.code,r=a.immediateClose;g.postMessage(C.highlight(n,C.languages[t],t)),r&&g.close()},!1)),C;var e=document.currentScript||[].slice.call(document.getElementsByTagName("script")).pop();return e&&(C.filename=e.src,C.manual||e.hasAttribute("data-manual")||("loading"!==document.readyState?window.requestAnimationFrame?window.requestAnimationFrame(C.highlightAll):window.setTimeout(C.highlightAll,16):document.addEventListener("DOMContentLoaded",C.highlightAll))),C}(_self);"undefined"!=typeof module&&module.exports&&(module.exports=Prism),"undefined"!=typeof global&&(global.Prism=Prism);
3 | Prism.languages.markup={comment://,prolog:/<\?[\s\S]+?\?>/,doctype://i,cdata://i,tag:{pattern:/<\/?(?!\d)[^\s>\/=$<%]+(?:\s(?:\s*[^\s>\/=]+(?:\s*=\s*(?:"[^"]*"|'[^']*'|[^\s'">=]+(?=[\s>]))|(?=[\s/>])))+)?\s*\/?>/i,greedy:!0,inside:{tag:{pattern:/^<\/?[^\s>\/]+/i,inside:{punctuation:/^<\/?/,namespace:/^[^\s>\/:]+:/}},"attr-value":{pattern:/=\s*(?:"[^"]*"|'[^']*'|[^\s'">=]+)/i,inside:{punctuation:[/^=/,{pattern:/^(\s*)["']|["']$/,lookbehind:!0}]}},punctuation:/\/?>/,"attr-name":{pattern:/[^\s>\/]+/,inside:{namespace:/^[^\s>\/:]+:/}}}},entity:/?[\da-z]{1,8};/i},Prism.languages.markup.tag.inside["attr-value"].inside.entity=Prism.languages.markup.entity,Prism.hooks.add("wrap",function(a){"entity"===a.type&&(a.attributes.title=a.content.replace(/&/,"&"))}),Object.defineProperty(Prism.languages.markup.tag,"addInlined",{value:function(a,e){var s={};s["language-"+e]={pattern:/(^$)/i,lookbehind:!0,inside:Prism.languages[e]},s.cdata=/^$/i;var n={"included-cdata":{pattern://i,inside:s}};n["language-"+e]={pattern:/[\s\S]+/,inside:Prism.languages[e]};var i={};i[a]={pattern:RegExp("(<__[\\s\\S]*?>)(?:\\s*|[\\s\\S])*?(?=<\\/__>)".replace(/__/g,a),"i"),lookbehind:!0,greedy:!0,inside:n},Prism.languages.insertBefore("markup","cdata",i)}}),Prism.languages.xml=Prism.languages.extend("markup",{}),Prism.languages.html=Prism.languages.markup,Prism.languages.mathml=Prism.languages.markup,Prism.languages.svg=Prism.languages.markup;
4 | !function(s){var e=/("|')(?:\\(?:\r\n|[\s\S])|(?!\1)[^\\\r\n])*\1/;s.languages.css={comment:/\/\*[\s\S]*?\*\//,atrule:{pattern:/@[\w-]+?[\s\S]*?(?:;|(?=\s*\{))/i,inside:{rule:/@[\w-]+/}},url:RegExp("url\\((?:"+e.source+"|.*?)\\)","i"),selector:RegExp("[^{}\\s](?:[^{};\"']|"+e.source+")*?(?=\\s*\\{)"),string:{pattern:e,greedy:!0},property:/[-_a-z\xA0-\uFFFF][-\w\xA0-\uFFFF]*(?=\s*:)/i,important:/!important\b/i,function:/[-a-z0-9]+(?=\()/i,punctuation:/[(){};:,]/},s.languages.css.atrule.inside.rest=s.languages.css;var a=s.languages.markup;a&&(a.tag.addInlined("style","css"),s.languages.insertBefore("inside","attr-value",{"style-attr":{pattern:/\s*style=("|')(?:\\[\s\S]|(?!\1)[^\\])*\1/i,inside:{"attr-name":{pattern:/^\s*style/i,inside:a.tag.inside},punctuation:/^\s*=\s*['"]|['"]\s*$/,"attr-value":{pattern:/.+/i,inside:s.languages.css}},alias:"language-css"}},a.tag))}(Prism);
5 | Prism.languages.clike={comment:[{pattern:/(^|[^\\])\/\*[\s\S]*?(?:\*\/|$)/,lookbehind:!0},{pattern:/(^|[^\\:])\/\/.*/,lookbehind:!0,greedy:!0}],string:{pattern:/(["'])(?:\\(?:\r\n|[\s\S])|(?!\1)[^\\\r\n])*\1/,greedy:!0},"class-name":{pattern:/((?:\b(?:class|interface|extends|implements|trait|instanceof|new)\s+)|(?:catch\s+\())[\w.\\]+/i,lookbehind:!0,inside:{punctuation:/[.\\]/}},keyword:/\b(?:if|else|while|do|for|return|in|instanceof|function|new|try|throw|catch|finally|null|break|continue)\b/,boolean:/\b(?:true|false)\b/,function:/\w+(?=\()/,number:/\b0x[\da-f]+\b|(?:\b\d+\.?\d*|\B\.\d+)(?:e[+-]?\d+)?/i,operator:/--?|\+\+?|!=?=?|<=?|>=?|==?=?|&&?|\|\|?|\?|\*|\/|~|\^|%/,punctuation:/[{}[\];(),.:]/};
6 | Prism.languages.javascript=Prism.languages.extend("clike",{"class-name":[Prism.languages.clike["class-name"],{pattern:/(^|[^$\w\xA0-\uFFFF])[_$A-Z\xA0-\uFFFF][$\w\xA0-\uFFFF]*(?=\.(?:prototype|constructor))/,lookbehind:!0}],keyword:[{pattern:/((?:^|})\s*)(?:catch|finally)\b/,lookbehind:!0},{pattern:/(^|[^.])\b(?:as|async(?=\s*(?:function\b|\(|[$\w\xA0-\uFFFF]|$))|await|break|case|class|const|continue|debugger|default|delete|do|else|enum|export|extends|for|from|function|get|if|implements|import|in|instanceof|interface|let|new|null|of|package|private|protected|public|return|set|static|super|switch|this|throw|try|typeof|undefined|var|void|while|with|yield)\b/,lookbehind:!0}],number:/\b(?:(?:0[xX][\dA-Fa-f]+|0[bB][01]+|0[oO][0-7]+)n?|\d+n|NaN|Infinity)\b|(?:\b\d+\.?\d*|\B\.\d+)(?:[Ee][+-]?\d+)?/,function:/[_$a-zA-Z\xA0-\uFFFF][$\w\xA0-\uFFFF]*(?=\s*(?:\.\s*(?:apply|bind|call)\s*)?\()/,operator:/-[-=]?|\+[+=]?|!=?=?|<=?|>>?>?=?|=(?:==?|>)?|&[&=]?|\|[|=]?|\*\*?=?|\/=?|~|\^=?|%=?|\?|\.{3}/}),Prism.languages.javascript["class-name"][0].pattern=/(\b(?:class|interface|extends|implements|instanceof|new)\s+)[\w.\\]+/,Prism.languages.insertBefore("javascript","keyword",{regex:{pattern:/((?:^|[^$\w\xA0-\uFFFF."'\])\s])\s*)\/(\[(?:[^\]\\\r\n]|\\.)*]|\\.|[^/\\\[\r\n])+\/[gimyu]{0,5}(?=\s*($|[\r\n,.;})\]]))/,lookbehind:!0,greedy:!0},"function-variable":{pattern:/[_$a-zA-Z\xA0-\uFFFF][$\w\xA0-\uFFFF]*(?=\s*[=:]\s*(?:async\s*)?(?:\bfunction\b|(?:\((?:[^()]|\([^()]*\))*\)|[_$a-zA-Z\xA0-\uFFFF][$\w\xA0-\uFFFF]*)\s*=>))/,alias:"function"},parameter:[{pattern:/(function(?:\s+[_$A-Za-z\xA0-\uFFFF][$\w\xA0-\uFFFF]*)?\s*\(\s*)(?!\s)(?:[^()]|\([^()]*\))+?(?=\s*\))/,lookbehind:!0,inside:Prism.languages.javascript},{pattern:/[_$a-z\xA0-\uFFFF][$\w\xA0-\uFFFF]*(?=\s*=>)/i,inside:Prism.languages.javascript},{pattern:/(\(\s*)(?!\s)(?:[^()]|\([^()]*\))+?(?=\s*\)\s*=>)/,lookbehind:!0,inside:Prism.languages.javascript},{pattern:/((?:\b|\s|^)(?!(?:as|async|await|break|case|catch|class|const|continue|debugger|default|delete|do|else|enum|export|extends|finally|for|from|function|get|if|implements|import|in|instanceof|interface|let|new|null|of|package|private|protected|public|return|set|static|super|switch|this|throw|try|typeof|undefined|var|void|while|with|yield)(?![$\w\xA0-\uFFFF]))(?:[_$A-Za-z\xA0-\uFFFF][$\w\xA0-\uFFFF]*\s*)\(\s*)(?!\s)(?:[^()]|\([^()]*\))+?(?=\s*\)\s*\{)/,lookbehind:!0,inside:Prism.languages.javascript}],constant:/\b[A-Z](?:[A-Z_]|\dx?)*\b/}),Prism.languages.insertBefore("javascript","string",{"template-string":{pattern:/`(?:\\[\s\S]|\${[^}]+}|[^\\`])*`/,greedy:!0,inside:{interpolation:{pattern:/\${[^}]+}/,inside:{"interpolation-punctuation":{pattern:/^\${|}$/,alias:"punctuation"},rest:Prism.languages.javascript}},string:/[\s\S]+/}}}),Prism.languages.markup&&Prism.languages.markup.tag.addInlined("script","javascript"),Prism.languages.js=Prism.languages.javascript;
7 | Prism.languages.c=Prism.languages.extend("clike",{"class-name":{pattern:/(\b(?:enum|struct)\s+)\w+/,lookbehind:!0},keyword:/\b(?:_Alignas|_Alignof|_Atomic|_Bool|_Complex|_Generic|_Imaginary|_Noreturn|_Static_assert|_Thread_local|asm|typeof|inline|auto|break|case|char|const|continue|default|do|double|else|enum|extern|float|for|goto|if|int|long|register|return|short|signed|sizeof|static|struct|switch|typedef|union|unsigned|void|volatile|while)\b/,operator:/>>=?|<<=?|->|([-+&|:])\1|[?:~]|[-+*/%&|^!=<>]=?/,number:/(?:\b0x(?:[\da-f]+\.?[\da-f]*|\.[\da-f]+)(?:p[+-]?\d+)?|(?:\b\d+\.?\d*|\B\.\d+)(?:e[+-]?\d+)?)[ful]*/i}),Prism.languages.insertBefore("c","string",{macro:{pattern:/(^\s*)#\s*[a-z]+(?:[^\r\n\\]|\\(?:\r\n|[\s\S]))*/im,lookbehind:!0,alias:"property",inside:{string:{pattern:/(#\s*include\s*)(?:<.+?>|("|')(?:\\?.)+?\2)/,lookbehind:!0},directive:{pattern:/(#\s*)\b(?:define|defined|elif|else|endif|error|ifdef|ifndef|if|import|include|line|pragma|undef|using)\b/,lookbehind:!0,alias:"keyword"}}},constant:/\b(?:__FILE__|__LINE__|__DATE__|__TIME__|__TIMESTAMP__|__func__|EOF|NULL|SEEK_CUR|SEEK_END|SEEK_SET|stdin|stdout|stderr)\b/}),delete Prism.languages.c.boolean;
8 | !function(e){var t=/\b(?:abstract|continue|for|new|switch|assert|default|goto|package|synchronized|boolean|do|if|private|this|break|double|implements|protected|throw|byte|else|import|public|throws|case|enum|instanceof|return|transient|catch|extends|int|short|try|char|final|interface|static|void|class|finally|long|strictfp|volatile|const|float|native|super|while|var|null|exports|module|open|opens|provides|requires|to|transitive|uses|with)\b/,a=/\b[A-Z](?:\w*[a-z]\w*)?\b/;e.languages.java=e.languages.extend("clike",{"class-name":[a,/\b[A-Z]\w*(?=\s+\w+\s*[;,=())])/],keyword:t,function:[e.languages.clike.function,{pattern:/(\:\:)[a-z_]\w*/,lookbehind:!0}],number:/\b0b[01][01_]*L?\b|\b0x[\da-f_]*\.?[\da-f_p+-]+\b|(?:\b\d[\d_]*\.?[\d_]*|\B\.\d[\d_]*)(?:e[+-]?\d[\d_]*)?[dfl]?/i,operator:{pattern:/(^|[^.])(?:<<=?|>>>?=?|->|([-+&|])\2|[?:~]|[-+*/%&|^!=<>]=?)/m,lookbehind:!0}}),e.languages.insertBefore("java","class-name",{annotation:{alias:"punctuation",pattern:/(^|[^.])@\w+/,lookbehind:!0},namespace:{pattern:/(\b(?:exports|import(?:\s+static)?|module|open|opens|package|provides|requires|to|transitive|uses|with)\s+)[a-z]\w*(\.[a-z]\w*)+/,lookbehind:!0,inside:{punctuation:/\./}},generics:{pattern:/<(?:[\w\s,.&?]|<(?:[\w\s,.&?]|<(?:[\w\s,.&?]|<[\w\s,.&?]*>)*>)*>)*>/,inside:{"class-name":a,keyword:t,punctuation:/[<>(),.:]/,operator:/[?&|]/}}})}(Prism);
9 | Prism.languages.python={comment:{pattern:/(^|[^\\])#.*/,lookbehind:!0},"string-interpolation":{pattern:/(?:f|rf|fr)(?:("""|''')[\s\S]+?\1|("|')(?:\\.|(?!\2)[^\\\r\n])*\2)/i,greedy:!0,inside:{interpolation:{pattern:/((?:^|[^{])(?:{{)*){(?!{)(?:[^{}]|{(?!{)(?:[^{}]|{(?!{)(?:[^{}])+})+})+}/,lookbehind:!0,inside:{"format-spec":{pattern:/(:)[^:(){}]+(?=}$)/,lookbehind:!0},"conversion-option":{pattern://,alias:"punctuation"},rest:null}},string:/[\s\S]+/}},"triple-quoted-string":{pattern:/(?:[rub]|rb|br)?("""|''')[\s\S]+?\1/i,greedy:!0,alias:"string"},string:{pattern:/(?:[rub]|rb|br)?("|')(?:\\.|(?!\1)[^\\\r\n])*\1/i,greedy:!0},function:{pattern:/((?:^|\s)def[ \t]+)[a-zA-Z_]\w*(?=\s*\()/g,lookbehind:!0},"class-name":{pattern:/(\bclass\s+)\w+/i,lookbehind:!0},decorator:{pattern:/(^\s*)@\w+(?:\.\w+)*/i,lookbehind:!0,alias:["annotation","punctuation"],inside:{punctuation:/\./}},keyword:/\b(?:and|as|assert|async|await|break|class|continue|def|del|elif|else|except|exec|finally|for|from|global|if|import|in|is|lambda|nonlocal|not|or|pass|print|raise|return|try|while|with|yield)\b/,builtin:/\b(?:__import__|abs|all|any|apply|ascii|basestring|bin|bool|buffer|bytearray|bytes|callable|chr|classmethod|cmp|coerce|compile|complex|delattr|dict|dir|divmod|enumerate|eval|execfile|file|filter|float|format|frozenset|getattr|globals|hasattr|hash|help|hex|id|input|int|intern|isinstance|issubclass|iter|len|list|locals|long|map|max|memoryview|min|next|object|oct|open|ord|pow|property|range|raw_input|reduce|reload|repr|reversed|round|set|setattr|slice|sorted|staticmethod|str|sum|super|tuple|type|unichr|unicode|vars|xrange|zip)\b/,boolean:/\b(?:True|False|None)\b/,number:/(?:\b(?=\d)|\B(?=\.))(?:0[bo])?(?:(?:\d|0x[\da-f])[\da-f]*\.?\d*|\.\d+)(?:e[+-]?\d+)?j?\b/i,operator:/[-+%=]=?|!=|\*\*?=?|\/\/?=?|<[<=>]?|>[=>]?|[&|^~]/,punctuation:/[{}[\];(),.:]/},Prism.languages.python["string-interpolation"].inside.interpolation.inside.rest=Prism.languages.python,Prism.languages.py=Prism.languages.python;
10 |
--------------------------------------------------------------------------------
/highlight/prism.wxss:
--------------------------------------------------------------------------------
1 | /* PrismJS 1.16.0
2 | https://prismjs.com/download.html#themes=prism&languages=markup+css+clike+javascript+c+java+python */
3 | /**
4 | * prism.js default theme for JavaScript, CSS and HTML
5 | * Based on dabblet (http://dabblet.com)
6 | * @author Lea Verou
7 | */
8 |
9 | code[class*="language-"],
10 | .wxParse-pre {
11 | color: black;
12 | background: none;
13 | text-shadow: 0 1px white;
14 | font-family: Consolas, Monaco, 'Andale Mono', 'Ubuntu Mono', monospace;
15 | font-size: 1em;
16 | text-align: left;
17 | white-space: pre;
18 | word-spacing: normal;
19 | word-break: normal;
20 | word-wrap: normal;
21 | line-height: 1.5;
22 |
23 | -moz-tab-size: 4;
24 | -o-tab-size: 4;
25 | tab-size: 4;
26 |
27 | -webkit-hyphens: none;
28 | -moz-hyphens: none;
29 | -ms-hyphens: none;
30 | hyphens: none;
31 | }
32 |
33 | .wxParse-pre::-moz-selection, .wxParse-pre::-moz-selection,
34 | code[class*="language-"]::-moz-selection, code[class*="language-"] ::-moz-selection {
35 | text-shadow: none;
36 | background: #080d13;
37 | }
38 |
39 | .wxParse-pre::selection, .wxParse-pre ::selection,
40 | code[class*="language-"]::selection, code[class*="language-"] ::selection {
41 | text-shadow: none;
42 | background: #040608;
43 | }
44 |
45 | @media print {
46 | code[class*="language-"],
47 | pre[class*="language-"] {
48 | text-shadow: none;
49 | }
50 | }
51 |
52 | /* Code blocks */
53 | .wxParse-pre {
54 | padding: 1em;
55 | margin: .5em 0;
56 | overflow: auto;
57 | border-radius: 10rpx;
58 | }
59 |
60 | :not(pre) > code[class*="language-"],
61 | .wxParse-pre {
62 | background: #f7f7f7;
63 | border: 1rpx solid rgb(209, 208, 208);
64 | border-radius: 10rpx;
65 | }
66 | /* Inline code */
67 | :not(pre) > code[class*="language-"] {
68 | padding: .1em;
69 | border-radius: .3em;
70 | white-space: normal;
71 | }
72 |
73 | .token.comment,
74 | .token.prolog,
75 | .token.doctype,
76 | .token.cdata {
77 | color: slategray;
78 | }
79 |
80 | .token.punctuation {
81 | color: #999;
82 | }
83 |
84 | .namespace {
85 | opacity: .7;
86 | }
87 |
88 | .token.property,
89 | .token.tag,
90 | .token.boolean,
91 | .token.number,
92 | .token.constant,
93 | .token.symbol,
94 | .token.deleted {
95 | color: #905;
96 | }
97 |
98 | .token.selector,
99 | .token.attr-name,
100 | .token.string,
101 | .token.char,
102 | .token.builtin,
103 | .token.inserted {
104 | color: #690;
105 | }
106 |
107 | .token.operator,
108 | .token.entity,
109 | .token.url,
110 | .language-css .token.string,
111 | .style .token.string {
112 | color: #9a6e3a;
113 | background: hsla(0, 0%, 100%, .5);
114 | }
115 |
116 | .token.atrule,
117 | .token.attr-value,
118 | .token.keyword {
119 | color: #07a;
120 | }
121 |
122 | .token.function,
123 | .token.class-name {
124 | color: #DD4A68;
125 | }
126 |
127 | .token.regex,
128 | .token.important,
129 | .token.variable {
130 | color: #e90;
131 | }
132 |
133 | .token.important,
134 | .token.bold {
135 | font-weight: bold;
136 | }
137 | .token.italic {
138 | font-style: italic;
139 | }
140 |
141 | .token.entity {
142 | cursor: help;
143 | }
144 |
145 |
--------------------------------------------------------------------------------
/images/logo.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Jarry007/wxBlog/0c170f6b46751976b273f8bd94524451e9b0df47/images/logo.png
--------------------------------------------------------------------------------
/images/tabbar/about.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Jarry007/wxBlog/0c170f6b46751976b273f8bd94524451e9b0df47/images/tabbar/about.png
--------------------------------------------------------------------------------
/images/tabbar/about_cur.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Jarry007/wxBlog/0c170f6b46751976b273f8bd94524451e9b0df47/images/tabbar/about_cur.png
--------------------------------------------------------------------------------
/images/tabbar/basics.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Jarry007/wxBlog/0c170f6b46751976b273f8bd94524451e9b0df47/images/tabbar/basics.png
--------------------------------------------------------------------------------
/images/tabbar/basics_cur.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Jarry007/wxBlog/0c170f6b46751976b273f8bd94524451e9b0df47/images/tabbar/basics_cur.png
--------------------------------------------------------------------------------
/images/tabbar/component.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Jarry007/wxBlog/0c170f6b46751976b273f8bd94524451e9b0df47/images/tabbar/component.png
--------------------------------------------------------------------------------
/images/tabbar/component_cur.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Jarry007/wxBlog/0c170f6b46751976b273f8bd94524451e9b0df47/images/tabbar/component_cur.png
--------------------------------------------------------------------------------
/images/tabbar/plugin.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Jarry007/wxBlog/0c170f6b46751976b273f8bd94524451e9b0df47/images/tabbar/plugin.png
--------------------------------------------------------------------------------
/images/tabbar/plugin_cur.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Jarry007/wxBlog/0c170f6b46751976b273f8bd94524451e9b0df47/images/tabbar/plugin_cur.png
--------------------------------------------------------------------------------
/pages/about/about.js:
--------------------------------------------------------------------------------
1 | const app = getApp();
2 | Page({
3 | data: {
4 | StatusBar: app.globalData.StatusBar,
5 | CustomBar: app.globalData.CustomBar,
6 | ColorList: app.globalData.ColorList,
7 | },
8 | onLoad: function () { },
9 | pageBack() {
10 | wx.navigateBack({
11 | delta: 1
12 | });
13 | }
14 | });
--------------------------------------------------------------------------------
/pages/about/about.json:
--------------------------------------------------------------------------------
1 | {
2 | "usingComponents": {}
3 | }
--------------------------------------------------------------------------------
/pages/about/about.wxml:
--------------------------------------------------------------------------------
1 |
2 |
3 | 返回
4 |
5 |
6 | 更多功能
7 |
8 | 目前web端和小程序端还不能实现账号同步,您可以访问 'blogai.cn' 使用完整版的博客,web端可以支持博客文章的撰写,用户的关注等。
9 | 如果您觉得不错,请移步github给作者点个赞吧。谢谢!
10 | 更多功能敬请期待!
11 | ---2019/5/6---
12 |
13 |
14 |
--------------------------------------------------------------------------------
/pages/about/about.wxss:
--------------------------------------------------------------------------------
1 | /* pages/about/about.wxss */
--------------------------------------------------------------------------------
/pages/about/issue.js:
--------------------------------------------------------------------------------
1 | const app = getApp()
2 | const accountInfo = wx.getAccountInfoSync()
3 | var router = require('../index/router.js');
4 | Page({
5 |
6 |
7 | data: {
8 | StatusBar: app.globalData.StatusBar,
9 | CustomBar: app.globalData.CustomBar,
10 | ColorList: app.globalData.ColorList,
11 | imgList:[]
12 | },
13 | onLoad: function (options) {
14 |
15 | },
16 |
17 | onReady: function () {
18 |
19 | },
20 | issue(e){
21 | wx.vibrateShort({})
22 | let iss = e.detail.value.issue,
23 | imgs = this.data.imgList;
24 | if (iss){
25 | wx.showToast({
26 | title: '反馈成功',
27 | icon:'success'
28 | })
29 | if(this.data.imgList.length>0){
30 | wx.uploadFile({
31 | url: 'https://blogai.cn/mp/send_mail' ,
32 | header:{
33 | appid: String(accountInfo.miniProgram.appId)
34 | },
35 | metohd: 'POST',
36 | filePath: String(imgs[0]),
37 | name: 'imgs',
38 | formData:{
39 | iss:JSON.stringify(iss)
40 | },
41 | success:res=>{
42 | console.log(res)
43 | }
44 | })}else{
45 | wx.request({
46 | url: 'https://blogai.cn/mp/send_mail',
47 | header: {
48 | appid: String(accountInfo.miniProgram.appId)
49 | },
50 | metohd: 'POST',
51 | data:{
52 | iss: JSON.stringify(iss)
53 | },
54 | success:res=>{
55 | console.log(res)
56 | }
57 | })
58 | }
59 | }else{
60 | wx.showToast({
61 | title: '不能为空',
62 | icon:'none'
63 | })
64 | }
65 | },
66 | choose(e){
67 | wx.vibrateShort({})
68 | // let imgCount = 3-this.data.imgList.length
69 | wx.chooseImage({
70 | count: 1,
71 | sizeType: ['original', 'compressed'],
72 | sourceType: ['album'],
73 | success: res=> {
74 | if (this.data.imgList.length != 0) {
75 | this.setData({
76 | imgList: this.data.imgList.concat(res.tempFilePaths)
77 | })
78 | } else {
79 | this.setData({
80 | imgList: res.tempFilePaths
81 | })
82 | }
83 | }
84 | })
85 | },
86 | ViewImage(e) {
87 | wx.previewImage({
88 | urls: this.data.imgList,
89 | current: e.currentTarget.dataset.url
90 | });
91 | },
92 | closeimg(e){
93 |
94 | this.setData({
95 | imgList: []
96 | })
97 | }
98 | })
--------------------------------------------------------------------------------
/pages/about/issue.json:
--------------------------------------------------------------------------------
1 | {
2 | "usingComponents": {}
3 | }
--------------------------------------------------------------------------------
/pages/about/issue.wxml:
--------------------------------------------------------------------------------
1 | 返回反馈
2 |
3 |
4 |
5 |
--------------------------------------------------------------------------------
/pages/about/issue.wxss:
--------------------------------------------------------------------------------
1 | /* pages/about/issue.wxss */
--------------------------------------------------------------------------------
/pages/about/thank.js:
--------------------------------------------------------------------------------
1 | const app = getApp();
2 | Page({
3 | data: {
4 | StatusBar: app.globalData.StatusBar,
5 | CustomBar: app.globalData.CustomBar,
6 | ColorList: app.globalData.ColorList,
7 | },
8 |
9 | })
--------------------------------------------------------------------------------
/pages/about/thank.json:
--------------------------------------------------------------------------------
1 | {
2 | "usingComponents": {}
3 | }
--------------------------------------------------------------------------------
/pages/about/thank.wxml:
--------------------------------------------------------------------------------
1 | 返回
2 |
3 |
4 | 特别感谢
5 | "ALL-in",取这个名字是希望对待任何事情都要全力以赴,不留遗憾。
6 | 该项目是我的博客(blogai.cn)的微信小程序版本,后台使用的是python的flask框架。匆忙之中赶出来的,作为一个新手,存在很多不足。如果您在使用中遇到了任何问题,欢迎反馈。
7 | 另外该小程序的开发使用到了很多优秀的开源组件和插件,特在此表示感谢
8 |
9 | - ColorUI 组件库
10 | - wxParse
11 | - Prism
12 | - 日出一点一
13 |
14 |
15 |
16 |
17 |
--------------------------------------------------------------------------------
/pages/about/thank.wxss:
--------------------------------------------------------------------------------
1 | /* pages/about/thank.wxss */
--------------------------------------------------------------------------------
/pages/index/list.js:
--------------------------------------------------------------------------------
1 | // pages/index/list.js
2 | const app = getApp()
3 | const {
4 | Router
5 | } = require('../../utils/router.js');
6 | var time = require('../../utils/util.js')
7 | var router = require('../index/router.js');
8 | Page({
9 | data: {
10 | posts: '',
11 | cardCur: 0,
12 | news: '',
13 | page: 1,
14 | StatusBar: app.globalData.StatusBar,
15 | CustomBar: app.globalData.CustomBar,
16 | first_tap: '',
17 | pageNum:1,
18 | canScroll:true,
19 | list:[],
20 | hiddenLoading:false
21 | },
22 | onLoad: function (options) {
23 | wx.vibrateShort({})
24 | this.getNew()
25 | this.getList()
26 | // router.route_request('mp/new').catch(res => {
27 | // let news = res.news;
28 | // for (var i = 0; i < news.length; i++) {
29 | // news[i]['time'] = time.formatTime(new Date(news[i]['time'].replace('GMT', '')))
30 | // }
31 | // this.setData({
32 | // news: news
33 | // })
34 | // })
35 |
36 | },
37 | getNew() {
38 | Router.get('mp/new').then(res => {
39 | this.setData({
40 | news: res.data
41 | })
42 | })
43 | },
44 | getList(e) {
45 | if (e === 'refresh') {
46 | this.data.pageNum = 1
47 | } else {
48 | if (!this.data.canScroll) return
49 | }
50 | const parmas = {
51 | pageNum: this.data.pageNum
52 | }
53 | Router.get('get-list', parmas).then(res => {
54 | console.log('列表', res)
55 | if(e==='refresh'){
56 | this.setData({
57 | list: res.data,
58 | status: false,
59 | hiddenLoading:true
60 | })
61 | }else{
62 | this.data.list = this.data.list.concat(res.data)
63 | this.setData({
64 | list: this.data.list,
65 | hiddenLoading:true
66 | })
67 | }
68 | this.data.pageNum++
69 |
70 | this.setData({
71 | canScroll: res.data.length === 10
72 | })
73 | })
74 | },
75 | // onReady: function () {
76 |
77 | // let info = {
78 | // page: this.data.page
79 | // }
80 | // router.route_request('mp/posts', info).catch(res => {
81 |
82 | // let post_ = res.posts
83 | // for (var i = 0; i < post_.length; i++) {
84 | // post_[i]['time'] = time.formatTime(new Date(post_[i]['time'].replace('GMT', '')))
85 | // }
86 | // this.setData({
87 | // posts: post_
88 | // })
89 | // })
90 |
91 | // },
92 | more: function (event) {
93 | let postId = event.currentTarget.dataset.id
94 | wx.navigateTo({
95 | url: 'more?id=' + postId,
96 | })
97 | },
98 | onShow: function () {
99 |
100 |
101 |
102 | },
103 | cardSwiper(e) {
104 | this.setData({
105 | cardCur: e.detail.current
106 | })
107 | },
108 |
109 |
110 |
111 |
112 | onReachBottom: function () {
113 | wx.vibrateShort({})
114 | wx.showLoading({
115 | title: '数据加载中...',
116 | icon: 'loading',
117 | duration: 1000
118 | })
119 | let page = this.data.page + 1,
120 | posts = this.data.posts,
121 | info = {
122 | page: page
123 | }
124 | console.log('page' + page)
125 | router.route_request('mp/posts', info).catch(res => {
126 | let news = res.posts
127 | for (var i = 0; i < news.length; i++) {
128 | news[i]['time'] = time.formatTime(new Date(news[i]['time'].replace('GMT', '')))
129 | }
130 | this.setData({
131 | posts: posts.concat(news)
132 | })
133 | })
134 | this.setData({
135 | page: page
136 | })
137 |
138 |
139 | },
140 | onPullDownRefresh() {
141 | wx.vibrateShort({})
142 | wx.showNavigationBarLoading()
143 | console.log('到顶了')
144 | wx.showLoading({
145 | title: '刷新中...',
146 | icon: 'loading',
147 | duration: 1500
148 | })
149 | let info = {
150 | page: 1
151 | }
152 | router.route_request('mp/posts', info).catch(res => {
153 | let news = res.posts
154 | for (var i = 0; i < news.length; i++) {
155 | news[i]['time'] = time.formatTime(new Date(news[i]['time'].replace('GMT', '')))
156 | }
157 | this.setData({
158 | posts: news,
159 | page: 1
160 | })
161 | })
162 | wx.stopPullDownRefresh();
163 |
164 | },
165 | totop(e) {
166 | let first = e.timeStamp
167 | if (first - this.data.first_tap < 300) {
168 | wx.pageScrollTo({
169 | scrollTop: 0,
170 | duration: 1000
171 | })
172 | }
173 | this.setData({
174 | first_tap: first
175 | })
176 |
177 | }
178 | })
--------------------------------------------------------------------------------
/pages/index/list.json:
--------------------------------------------------------------------------------
1 | {
2 | "usingComponents": {},
3 | "enablePullDownRefresh": true
4 | }
--------------------------------------------------------------------------------
/pages/index/list.wxml:
--------------------------------------------------------------------------------
1 | 主页
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 | {{new_.tittle}}
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 | {{item.tittle}}
23 |
24 |
25 |
43 |
44 |
45 |
--------------------------------------------------------------------------------
/pages/index/list.wxss:
--------------------------------------------------------------------------------
1 | /* pages/index/list.wxss */
2 |
3 | .page{
4 | background-image:url(https://image.weilanwl.com/gif/loading-white.gif);
5 | background-size:contain;
6 | background-repeat:no-repeat;
7 | background-position: 50% 50%;
8 |
9 | }
10 | .loading{
11 | background-image:url(https://image.weilanwl.com/gif/loading-white.gif);
12 | background-size:contain;
13 | background-repeat:no-repeat;
14 | background-position: 50% 50%;
15 | height: 50vh;
16 | }
17 |
18 | .bg-black{
19 | background: rgba(17, 17, 17, 0.3);
20 | border-radius: 10rpx;
21 | }
22 |
23 |
--------------------------------------------------------------------------------
/pages/index/more.js:
--------------------------------------------------------------------------------
1 | var WxParse = require('../../wxParse/wxParse.js');
2 | var router = require('../index/router.js');
3 | var time_ = require('../../utils/util.js');
4 | var md_ = require('../../utils/md5.js');
5 | var timeago = require('../../utils/timeago.js')
6 | const app = getApp()
7 | Page({
8 |
9 | data: {
10 | post: '',
11 | StatusBar: app.globalData.StatusBar,
12 | CustomBar: app.globalData.CustomBar,
13 | liked: false,
14 | like_count: '',
15 | comment_count: '',
16 | view_count: '',
17 | comments: '',
18 | isZan: '',
19 | collection: false,
20 | iscollec: false,
21 | imgUrl: ''
22 |
23 | },
24 |
25 | onLoad: function(options) {
26 | let num = options.id,
27 | info = {
28 | num: num
29 | }
30 | // console.log(num)
31 | router.route_request('mp/refresh', info).catch(res => {
32 |
33 | let posts = res;
34 | // console.log(posts)
35 | posts['time'] = time_.formatTime(new Date(posts['time'].replace('GMT', '')))
36 | this.get_data(posts)
37 | let collec = wx.getStorageSync('collection');
38 | if (collec) {
39 | for (let i = 0; i < collec.length; i++) {
40 | if (collec[i].id == posts.id) {
41 | this.setData({
42 | iscollec: true
43 | })
44 | }
45 | }
46 | }
47 | let parse = this.data.post.body_html;
48 | WxParse.wxParse('wxshow', 'html', parse, this, 20);
49 | if(posts['img']){
50 | var bgImg = "https://blogai.cn/static/" + posts['img']
51 | }else{
52 | var bgImg = 'https://blogai.cn/static/uploads/82f6bfa51778a0c55d42a334321cabf1/20190906180648_94.png'
53 | }
54 | if (posts['post.link_.avatar']) {
55 | var avaImg = "https://blogai.cn/static/" + posts['img']
56 | } else {
57 | var avaImg = 'https://blogai.cn/static/uploads/82f6bfa51778a0c55d42a334321cabf1/20190906180648_94.png'
58 | }
59 |
60 | //
61 | wx.getImageInfo({
62 | src: bgImg,
63 | success: res_ => {
64 | this.setData({
65 | imgeInfo: res_
66 | })
67 | }
68 | })
69 |
70 | wx.getImageInfo({
71 | src: avaImg,
72 | success: res_ => {
73 | this.setData({
74 | avatarInfo: res_
75 | })
76 | }
77 | })
78 | })
79 |
80 | const sysInfo = wx.getSystemInfoSync();
81 | const screenWidth = sysInfo.screenWidth;
82 | const screenHeight = sysInfo.screenHeight;
83 | this.setData({
84 | cWidth: screenWidth - 20,
85 | cHeight: screenHeight - 200
86 | })
87 |
88 |
89 |
90 |
91 | },
92 | like(e) {
93 | // like_.like()
94 | wx.vibrateShort({
95 |
96 | })
97 | let stroage = wx.getStorageSync('final_data');
98 | if (stroage) {
99 | let like_count = this.data.like_count,
100 | liked = this.data.liked,
101 | num = this.data.post.id,
102 | info = {
103 | openId: stroage.openId,
104 | num: num
105 | };
106 | router.route_request('mp/like', info).catch(res => {
107 | // console.log({
108 | // 'res': res
109 | // })
110 | })
111 | if (!liked) {
112 | liked = true,
113 | like_count++;
114 | wx.showToast({
115 | title: '点赞成功',
116 | icon: 'success',
117 | duration: 2000
118 | })
119 | } else {
120 | liked = false,
121 | like_count--;
122 | wx.showToast({
123 | title: '取消成功',
124 | icon: 'success',
125 | duration: 2000
126 | })
127 | }
128 | this.setData({
129 | liked: liked,
130 | like_count: like_count
131 | })
132 |
133 | } else {
134 | wx.navigateTo({
135 | url: '../login/login',
136 | })
137 | }
138 |
139 |
140 | },
141 | comment(e) {
142 | wx.vibrateShort({
143 |
144 | })
145 | if (e.detail.value.comment) {
146 | let stroage = wx.getStorageSync('final_data')
147 | // console.log(stroage)
148 | if (stroage) {
149 | let num = this.data.post['id'],
150 | wx_comment = e.detail.value.comment,
151 | info = {
152 | openId: stroage.openId,
153 | wx_comment: wx_comment,
154 | num: num
155 | };
156 | var wx_uid = md_.md5(stroage['openId']);
157 | router.route_request('mp/comment', info).catch(res => {
158 | var comments = res.new_comment.comments
159 | for (var j = 0; j < comments.length; j++) {
160 | comments[j]['time'] = timeago.transDate(comments[j]['time'].replace('GMT', ''))
161 | for (var k = 0; k < comments[j].liker.length; k++) {
162 | if (comments[j].liker[k].user_id == wx_uid) {
163 | comments[j].liked = 'isLike'
164 | }
165 | }
166 | }
167 | this.setData({
168 | comments: comments,
169 | comment_count: this.data.comment_count + 1
170 | })
171 | })
172 | wx.showToast({
173 | title: '评论成功',
174 | duration: 1500
175 | })
176 | setTimeout(() => {
177 | this.tobottom()
178 | }, 1500)
179 |
180 |
181 |
182 | } else {
183 | wx.navigateTo({
184 | url: '../login/login',
185 | })
186 | }
187 | } else {
188 | wx.showToast({
189 | title: '输入不能为空',
190 | icon: 'none'
191 | })
192 | }
193 | },
194 | get_data(posts) {
195 | let view_count = posts['view_count'],
196 | comments = posts.new_comment.comments,
197 | like = posts.likes,
198 | stroage = wx.getStorageSync('final_data');
199 |
200 | if (stroage) {
201 | var wx_uid = md_.md5(stroage['openId']);
202 |
203 | for (var i = 0; i < like.length; i++) {
204 | like[i]['time'] = timeago.transDate(like[i]['time'].replace('GMT', ''))
205 | if (like[i].user_id == wx_uid) {
206 | var liked = true
207 | }
208 | }
209 |
210 | for (var j = 0; j < comments.length; j++) {
211 | comments[j]['time'] = timeago.transDate(comments[j]['time'].replace('GMT', ''))
212 | for (var k = 0; k < comments[j].liker.length; k++) {
213 |
214 | if (comments[j].liker[k].user_id == wx_uid) {
215 | comments[j].liked = 'isLike'
216 | }
217 | }
218 | }
219 | } else {
220 | var liked = false
221 | }
222 |
223 | view_count++;
224 | this.setData({
225 | post: posts,
226 | like_count: posts['like_count'],
227 | comment_count: posts['comment'],
228 | view_count: view_count,
229 | comments: comments,
230 | liked: liked
231 | })
232 |
233 | },
234 | onPullDownRefresh() {
235 | wx.vibrateShort({})
236 | wx.showNavigationBarLoading()
237 | wx.showLoading({
238 | title: '更新中...',
239 | icon: 'loading',
240 | duration: 1500
241 | })
242 | let info = {
243 | num: this.data.post.id
244 | }
245 | router.route_request('mp/refresh', info).catch(res => {
246 | let posts = res;
247 | posts['time'] = time_.formatTime(new Date(posts['time'].replace('GMT', '')))
248 | this.get_data(posts)
249 | })
250 | wx.stopPullDownRefresh();
251 | },
252 | zan: function(e) {
253 | wx.vibrateShort({})
254 | let stroage = wx.getStorageSync('final_data'),
255 | num = e.currentTarget.dataset.id;
256 | var index = e.currentTarget.dataset.index;
257 | if (stroage) {
258 | let info = {
259 | openId: stroage.openId,
260 | num: num
261 | };
262 | // console.log('num' + num)
263 | router.route_request('mp/like_comment', info).catch(res => {
264 | res.time = timeago.transDate(res['time'].replace('GMT', ''))
265 | let comments = this.data.comments;
266 | let liker = comments[index];
267 | let status = liker.liked ? '' : 'isLike'
268 | res.liked = status
269 | comments[index] = res
270 | this.setData({
271 | comments: comments
272 | })
273 |
274 | })
275 |
276 |
277 | } else {
278 | wx.navigateTo({
279 | url: '../login/login',
280 | })
281 | }
282 |
283 |
284 |
285 | },
286 | tobottom() {
287 | wx.createSelectorQuery().select('#b_comment').boundingClientRect(function(rect) {
288 | // 使页面滚动到底部
289 | wx.pageScrollTo({
290 | scrollTop: rect.bottom
291 | })
292 | }).exec()
293 | },
294 | reply(e) {
295 | let comment_id = e.currentTarget.dataset.id,
296 | index = e.currentTarget.dataset.index;
297 | wx.setStorageSync('comment', this.data.comments[index])
298 | wx.navigateTo({
299 | url: 'reply?id=' + comment_id,
300 | })
301 |
302 | },
303 | poster() {
304 |
305 | },
306 |
307 | share() {
308 |
309 | wx.showLoading({
310 | title: '生成中....',
311 | })
312 | let that = this
313 | const ctx = wx.createCanvasContext('poster', this)
314 | const fs = wx.getFileSystemManager();
315 | const filePath = `${wx.env.USER_DATA_PATH}/interim`;
316 | router.route_request('mp/get_code').catch(res => {
317 | console.log(res.access_token)
318 | wx.request({
319 | method: 'POST',
320 | url: `https://api.weixin.qq.com/wxa/getwxacode?access_token=${res.access_token}`,
321 | data: {
322 | path: '/pages/index/more?id=' + this.data.post.id
323 | },
324 | responseType: 'arraybuffer',
325 | success: res_ => {
326 | console.log(res_)
327 | // let imgUrl = wx.arrayBufferToBase64(res_.data)
328 | // console.log(imgUrl)
329 | // this.setData({
330 | // imgUrl: imgUrl
331 | // })
332 | fs.writeFile({
333 | filePath: filePath,
334 | data: res_.data,
335 | encoding: 'utf-8',
336 | success() {
337 | console.log('d', filePath)
338 | wx.getImageInfo({
339 | src: filePath,
340 | success: img => {
341 |
342 | that.setData({
343 | imgUrl: img.path
344 | })
345 |
346 | let img_w = that.data.imgeInfo.width,
347 | img_h = that.data.imgeInfo.height,
348 | scale = img_w / img_h;
349 | if (scale > 1) {
350 | var width = that.data.cWidth,
351 | height = width / scale
352 | } else {
353 | var height = that.data.cHeight,
354 | width = scale * height
355 | }
356 | ctx.beginPath()
357 | ctx.setFillStyle('#5e00ff')
358 | ctx.rect(0, 0, that.data.cWidth, that.data.cHeight)
359 | ctx.fill()
360 |
361 | ctx.drawImage(that.data.imgeInfo.path, 0, 0, width, height)
362 |
363 | ctx.draw()
364 | that.setData({
365 | show: true
366 | })
367 |
368 | }
369 | })
370 |
371 | },
372 | fail() {
373 | return (new Error('ERROR_WRITE'));
374 | },
375 | });
376 | }
377 | })
378 | })
379 |
380 | console.log('dd')
381 |
382 |
383 |
384 | },
385 | onShareAppMessage: function(res) {
386 | if (res.from == 'button') {
387 | // 来自页面内转发按钮
388 | // console.log(res.target)
389 | }
390 | return {
391 | title: this.data.post.tittle,
392 | path: '/pages/index/more?id=' + this.data.post.id,
393 | success: res => {
394 | // console.log('成功')
395 | },
396 | fail: err => {
397 | // console.log('失败')
398 | }
399 | }
400 |
401 | },
402 | collection(e) {
403 | wx.vibrateShort({
404 |
405 | })
406 | let colloced = this.data.iscollec;
407 | let post = [this.data.post],
408 | collec = wx.getStorageSync('collection');
409 | if (!colloced) {
410 |
411 | if (collec) {
412 | var collec_post = collec.concat(post)
413 | wx.setStorageSync('collection', collec_post)
414 | } else {
415 | var collec_post = post;
416 | wx.setStorageSync('collection', collec_post)
417 | }
418 | this.setData({
419 | iscollec: true
420 | })
421 | } else {
422 |
423 | for (let i = 0; i < collec.length; i++) {
424 | let num = this.data.post.id
425 | if (collec[i].id == num) {
426 | collec.splice(i, 1)
427 |
428 | }
429 | wx.setStorageSync('collection', collec)
430 |
431 | }
432 | // console.log(collec)
433 | this.setData({
434 | iscollec: false
435 | })
436 | }
437 |
438 | }
439 | })
--------------------------------------------------------------------------------
/pages/index/more.json:
--------------------------------------------------------------------------------
1 | {
2 | "usingComponents": {},
3 | "enablePullDownRefresh": true
4 | }
--------------------------------------------------------------------------------
/pages/index/more.wxml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | 返回
6 | {{post.tittle}}
7 |
8 |
9 |
10 |
78 |
79 |
80 |
81 |
82 |
94 |
95 |
96 | 分享
97 |
98 |
99 |
100 |
101 |
102 |
103 |
104 |
105 |
107 |
108 |
109 |
110 | 保存图片
111 | 取消操作
112 |
113 |
114 |
--------------------------------------------------------------------------------
/pages/index/more.wxss:
--------------------------------------------------------------------------------
1 |
2 | @import '/wxParse/wxParse.wxss';
3 |
4 | @import '/highlight/prism.wxss';
5 |
6 | .img-plus-style {
7 | background: cornflowerblue;
8 | height: 100rpx;
9 | width: 100rpx;
10 | position: absolute;
11 | bottom: 150rpx;
12 | right: 60rpx;
13 | z-index: 1;
14 | border-radius: 50%;
15 | line-height: 100rpx;
16 | font-size: 20rpx;
17 |
18 | }
19 |
20 | .img-style {
21 | background: darkcyan;
22 | height: 100rpx;
23 | width: 100rpx;
24 | position: absolute;
25 | bottom: 150rpx;
26 | right: 60rpx;
27 | opacity: 0;
28 | border-radius: 50%;
29 | line-height: 100rpx;
30 | font-size: 20rpx;
31 | }
32 |
33 | .poster-btn{
34 | width: 80rpx;
35 | height: 80rpx;
36 | border-radius: 50%;
37 | box-shadow: 2rpx 2rpx 20rpx rgba(123, 154, 211, 0.808);
38 | background: cornflowerblue;
39 | position: fixed;
40 | bottom: 130rpx;
41 | right: 0;
42 | line-height: 80rpx;
43 | text-align: center;
44 | color: #fff;
45 |
46 |
47 | }
48 | .poster{
49 | margin: 0 auto;
50 | transition: all .3s ease-in;
51 | }
52 |
53 | .hidden{
54 | transform: translateY(200%);
55 |
56 | }
--------------------------------------------------------------------------------
/pages/index/reply.js:
--------------------------------------------------------------------------------
1 | const app = getApp()
2 | var router = require('../index/router.js');
3 | var time_ = require('../../utils/util.js');
4 | var md_ = require('../../utils/md5.js')
5 | Page({
6 |
7 | data: {
8 | StatusBar: app.globalData.StatusBar,
9 | CustomBar: app.globalData.CustomBar,
10 | comments:'',
11 | replies:''
12 |
13 | },
14 | onLoad: function (options) {
15 | let comments = wx.getStorageSync('comment');
16 | this.setData({
17 | comments: comments
18 | })
19 |
20 | },
21 |
22 | onReady: function() {
23 |
24 | },
25 | reply(e){
26 | wx.vibrateShort({})
27 | if (e.detail.value.reply) {
28 | let stroage = wx.getStorageSync('final_data')
29 | if (stroage) {
30 | let num = this.data.comments.id,
31 | wx_reply = e.detail.value.reply,
32 | info = {
33 | openId: stroage.openId,
34 | wx_reply: wx_reply,
35 | num: num
36 | };
37 | var wx_uid = md_.md5(stroage['openId']);
38 | router.route_request('mp/reply', info).catch(res => {
39 | this.setData({
40 | comments:res
41 | })
42 | })
43 | } else {
44 | wx.navigateTo({
45 | url: '../login/login',
46 | })
47 | }
48 | } else {
49 | wx.showToast({
50 | title: '输入不能为空',
51 | icon: 'none'
52 | })
53 | }
54 | }
55 |
56 | })
--------------------------------------------------------------------------------
/pages/index/reply.json:
--------------------------------------------------------------------------------
1 | {
2 | "usingComponents": {}
3 |
4 | }
--------------------------------------------------------------------------------
/pages/index/reply.wxml:
--------------------------------------------------------------------------------
1 | 返回
2 |
3 |
4 |
5 |
6 |
46 |
47 |
48 |
--------------------------------------------------------------------------------
/pages/index/reply.wxss:
--------------------------------------------------------------------------------
1 | /* pages/index/reply.wxss */
--------------------------------------------------------------------------------
/pages/index/router.js:
--------------------------------------------------------------------------------
1 | const app = getApp()
2 | const accountInfo = wx.getAccountInfoSync()
3 |
4 |
5 | function route_request(route, info) {
6 | return new Promise((resolve, reject) => {
7 | wx.request({
8 | url: `${app.globalData.url}${route}`,
9 | method: 'POST',
10 | data: {
11 | info: JSON.stringify(info),
12 | appid: JSON.stringify(accountInfo.miniProgram.appId) //把object转化为json数据
13 | },
14 | header: {
15 | 'content-type': 'application/x-www-form-urlencoded'
16 | },
17 | success(request) {
18 | if (parseInt(request.data.code) === 200) {
19 | resolve(request.data)
20 | } else {
21 | reject(request.data)
22 | }
23 | },
24 | fail(error) {
25 | reject(error.data)
26 | }
27 | })
28 | })
29 | }
30 |
31 |
32 | module.exports = {
33 | route_request: route_request
34 | };
--------------------------------------------------------------------------------
/pages/login/login.js:
--------------------------------------------------------------------------------
1 | var router = require('../index/router.js');
2 | var time_ = require('../../utils/util.js');
3 | const app = getApp()
4 | Page({
5 |
6 | /**
7 | * 页面的初始数据
8 | */
9 | data: {
10 | StatusBar: app.globalData.StatusBar,
11 | CustomBar: app.globalData.CustomBar,
12 | canIUse: wx.canIUse('button.open-type.getUserInfo')
13 |
14 | },
15 |
16 | /**
17 | * 生命周期函数--监听页面加载
18 | */
19 | onLoad: function(options) {
20 | wx.getSetting({
21 | success(res) {
22 | if (res.authSetting['scope.userInfo']) {
23 | // 已经授权,可以直接调用 getUserInfo 获取头像昵称
24 | wx.getUserInfo({
25 | success(res) {
26 | console.log(res.userInfo)
27 | }
28 | })
29 | }
30 | }
31 | })
32 | },
33 |
34 | bindGetUserInfo(e) {
35 | wx.vibrateShort({})
36 | const accountInfo = wx.getAccountInfoSync()
37 | console.log(accountInfo.miniProgram.appId)
38 | console.log(e.detail.userInfo)
39 | wx.login({
40 | success: res => {
41 | if (res.code) {
42 | console.log(res.code)
43 | wx.getUserInfo({
44 | success: e => {
45 | let info = {
46 | encryptedData: e.encryptedData,
47 | iv: e.iv,
48 | code: res.code,
49 | appid: accountInfo.miniProgram.appId
50 | }
51 | router.route_request('mp/login', info).catch(res=>{
52 | console.log()
53 | wx.setStorageSync('final_data', res)
54 | wx.navigateBack({
55 | detal: 1
56 | })
57 | })
58 | },
59 | fail: f => {
60 | console.log('fail,login_fail')
61 | console.log
62 | wx.showToast({
63 | title: '失败',
64 | })
65 | }
66 | })
67 | }
68 | }
69 | })
70 | wx.checkSession({
71 | success() {},
72 | fail() {
73 | wx.login() // 重新登录
74 | }
75 | })
76 | }
77 | })
--------------------------------------------------------------------------------
/pages/login/login.json:
--------------------------------------------------------------------------------
1 | {
2 | "usingComponents": {}
3 | }
--------------------------------------------------------------------------------
/pages/login/login.wxml:
--------------------------------------------------------------------------------
1 |
2 |
3 | 返回ALL-in
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
22 |
23 |
24 |
--------------------------------------------------------------------------------
/pages/login/login.wxss:
--------------------------------------------------------------------------------
1 | /* pages/login/login.wxss */
--------------------------------------------------------------------------------
/pages/temp/collection.js:
--------------------------------------------------------------------------------
1 | var router = require('../index/router.js');
2 | var time_ = require('../../utils/util.js');
3 | const app = getApp()
4 | Page({
5 | data: {
6 | StatusBar: app.globalData.StatusBar,
7 | CustomBar: app.globalData.CustomBar,
8 | collection:''
9 | },
10 | onLoad: function (options) {
11 | let collec = wx.getStorageSync('collection');
12 | console.log(collec)
13 | this.setData({
14 | collection:collec
15 | })
16 |
17 | },
18 | onReady: function () {
19 |
20 | },
21 | todetail(e){
22 | wx.vibrateShort({})
23 | let id = e.currentTarget.dataset.id;
24 | wx.navigateTo({
25 | url: '../index/more?id=' + id,
26 | })
27 | }
28 | })
--------------------------------------------------------------------------------
/pages/temp/collection.json:
--------------------------------------------------------------------------------
1 | {
2 | "usingComponents": {}
3 |
4 | }
--------------------------------------------------------------------------------
/pages/temp/collection.wxml:
--------------------------------------------------------------------------------
1 |
2 |
3 | 返回我的收藏
4 |
5 |
6 |
7 |
8 |
9 |
10 | 收藏
11 |
12 |
13 |
14 |
15 |
16 |
17 | {{item.tittle}}
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
--------------------------------------------------------------------------------
/pages/temp/collection.wxss:
--------------------------------------------------------------------------------
1 | /* pages/temp/collection.wxss */
--------------------------------------------------------------------------------
/pages/temp/comment.js:
--------------------------------------------------------------------------------
1 | // pages/temp/comment.js
2 | var app = getApp()
3 | var router = require('../index/router.js');
4 | var time_ = require('../../utils/util.js');
5 | var md_ = require('../../utils/md5.js');
6 | var timeago = require('../../utils/timeago.js')
7 | Page({
8 |
9 | /**
10 | * 页面的初始数据
11 | */
12 | data: {
13 | StatusBar: app.globalData.StatusBar,
14 | CustomBar: app.globalData.CustomBar,
15 | comment: '',
16 | page:1,
17 | TabCur: 0,
18 | scrollLeft: 0,
19 |
20 | },
21 | onLoad: function(options) {
22 | let stroage = wx.getStorageSync('final_data')
23 | console.log(stroage)
24 | if (stroage) {
25 | let info = {
26 | openId: stroage.openId,
27 | page:this.data.page
28 | };
29 | router.route_request('mp/my_say',info).catch(res=>{
30 | let comment = res.all;
31 | for (var i = 0; i < comment.length; i++) {
32 | comment[i]['time'] = timeago.transDate(comment[i]['time'].replace('GMT', ''))
33 | }
34 | this.setData({
35 | comment:comment
36 | })
37 | })
38 | } else {
39 | wx.navigateTo({
40 | url: '../login/login',
41 | })
42 | }
43 |
44 | },
45 | onReady: function() {
46 |
47 | },
48 | // ListTouch触摸开始
49 | ListTouchStart(e) {
50 | this.setData({
51 | ListTouchStart: e.touches[0].pageX
52 | })
53 | },
54 |
55 | // ListTouch计算方向
56 | ListTouchMove(e) {
57 | this.setData({
58 | ListTouchDirection: e.touches[0].pageX - this.data.ListTouchStart > 0 ? 'right' : 'left'
59 | })
60 | },
61 |
62 | // ListTouch计算滚动
63 | ListTouchEnd(e) {
64 | if (this.data.ListTouchDirection == 'left') {
65 | this.setData({
66 | modalName: e.currentTarget.dataset.target
67 | })
68 | } else {
69 | this.setData({
70 | modalName: null
71 | })
72 | }
73 | this.setData({
74 | ListTouchDirection: null
75 | })
76 | },
77 | onReachBottom: function () {
78 | wx.vibrateShort({})
79 | wx.showLoading({
80 | title: '数据加载中...',
81 | icon: 'loading',
82 | duration: 1000
83 | })
84 | let page = this.data.page + 1,
85 | stroage = wx.getStorageSync('final_data'),
86 | comment = this.data.comment,
87 | info = {
88 | openId: stroage.openId,
89 | page: page
90 | }
91 | router.route_request('mp/my_say', info).catch(res => {
92 | let data_ = res.all;
93 | for (var i = 0; i < data_.length; i++) {
94 | data_[i]['time'] = timeago.transDate(data_[i]['time'].replace('GMT', ''))
95 | }
96 | this.setData({
97 | comment: comment.concat(data_)
98 | })
99 | })
100 | this.setData({
101 | page: page
102 | })
103 |
104 |
105 | },
106 | onShow: function() {
107 |
108 | },
109 | toDelect(e){
110 | var num = e.currentTarget.dataset.num;
111 | console.log(num)
112 | let stroage = wx.getStorageSync('final_data'),
113 | info = {
114 | num:num,
115 | openId: stroage.openId
116 | }
117 | wx.showModal({
118 | title: '注意!',
119 | content: '此操作会删除您的评论',
120 | success:res=>{
121 | if (res.confirm){
122 |
123 | router.route_request('mp/delete_comment', info).catch(res => {
124 | let comment = this.data.comment;
125 | for (let i=0;i
2 |
3 |
4 | 返回
5 |
6 |
7 |
8 |
9 |
--------------------------------------------------------------------------------
/pages/temp/comment.wxss:
--------------------------------------------------------------------------------
1 | /* pages/temp/comment.wxss */
--------------------------------------------------------------------------------
/pages/temp/flash.js:
--------------------------------------------------------------------------------
1 | // pages/index/flash.js
2 | const app = getApp()
3 | var router = require('../index/router.js')
4 | var timeago = require('../../utils/timeago.js')
5 | Page({
6 |
7 | data: {
8 | StatusBar: app.globalData.StatusBar,
9 | CustomBar: app.globalData.CustomBar,
10 | notice: '',
11 | TabCur: 0,
12 | scrollLeft:0,
13 | page: 1,
14 | tab2: false,
15 | route: 'mp/notice',
16 | reply:'',
17 | like:''
18 |
19 | },
20 | tabselect(e){
21 | wx.vibrateShort({})
22 | let id = e.currentTarget.dataset.id;
23 | if (id==0){
24 | var route = 'mp/notice'
25 | }else{
26 | var route = 'mp/notice_reply';
27 | }
28 | let stroage = wx.getStorageSync('final_data');
29 | let info = {
30 | openId: stroage.openId,
31 | page: 1
32 | };
33 | this.pagenation(route, info)
34 | this.setData({
35 | TabCur: id,
36 | scrollLeft: (id - 1) * 60,
37 | route:route,
38 | page:1
39 | })
40 | },
41 | onLoad: function(options) {
42 | let stroage = wx.getStorageSync('final_data'),
43 | route = this.data.route,
44 | page = this.data.page;
45 | if (stroage) {
46 | let info = {
47 | openId: stroage.openId,
48 | page: page
49 | };
50 | this.pagenation(route, info)
51 | } else {
52 | wx.navigateTo({
53 | url: '../login/login',
54 | })
55 | }
56 | },
57 |
58 | pagenation(route, info) {
59 | router.route_request(route, info).catch(res => {
60 | var data_ = res.all;
61 | let page = this.data.page
62 | let notice = this.data.notice;
63 | console.log(data_)
64 | for(var i =0;i返回我的消息
3 |
4 |
5 |
6 |
7 | 点赞
8 |
9 |
10 | 回复
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 | 收到的回复
20 |
21 | 收到的赞
22 |
23 |
24 |
25 |
26 |
27 |
--------------------------------------------------------------------------------
/pages/temp/flash.wxss:
--------------------------------------------------------------------------------
1 | /* pages/index/flash.wxss */
2 | .label{
3 | display: inline;
4 | position: relative
5 | }
--------------------------------------------------------------------------------
/pages/temp/index.js:
--------------------------------------------------------------------------------
1 | //index.js
2 | //获取应用实例
3 | const app = getApp()
4 | var router = require('../index/router.js')
5 | Page({
6 | data: {
7 | StatusBar: app.globalData.StatusBar,
8 | CustomBar: app.globalData.CustomBar,
9 | motto: 'blogai.cn',
10 | userInfo: {},
11 | hasUserInfo: false,
12 | canIUse: wx.canIUse('button.open-type.getUserInfo'),
13 | isnew: false
14 | },
15 | onLoad: function (options) {
16 |
17 | wx.getSetting({
18 | success:res=> {
19 | if (res.authSetting['scope.userInfo']) {
20 | // 已经授权,可以直接调用 getUserInfo 获取头像昵称
21 | wx.getUserInfo({
22 | success:res=> {
23 | console.log({'res.userinfo':res.userInfo})
24 | this.setData({
25 | userInfo:res.userInfo,
26 | hasUserInfo:true
27 | })
28 | }
29 | })
30 | }
31 | }
32 | })
33 | },
34 |
35 | bindGetUserInfo(e) {
36 | wx.vibrateShort({})
37 | const accountInfo = wx.getAccountInfoSync()
38 | console.log(accountInfo.miniProgram.appId)
39 | console.log(e.detail.userInfo)
40 | wx.login({
41 | success: res => {
42 | if (res.code) {
43 | console.log(res.code)
44 | wx.getUserInfo({
45 | success: e => {
46 | let info = {
47 | encryptedData: e.encryptedData,
48 | iv: e.iv,
49 | code: res.code,
50 | appid: accountInfo.miniProgram.appId
51 | }
52 | router.route_request('mp/login', info).catch(res => {
53 | console.log(res)
54 | this.setData({
55 | userInfo:res,
56 | hasUserInfo:true
57 | })
58 | wx.setStorageSync('final_data', res)
59 | wx.navigateBack({
60 | detal: 1
61 | })
62 | })
63 | },
64 | fail: f => {
65 | console.log('fail,login_fail')
66 | console.log
67 | wx.showToast({
68 | title: '失败',
69 | })
70 | }
71 | })
72 | }
73 | }
74 | })
75 | wx.checkSession({
76 | success() { },
77 | fail() {
78 | wx.login() // 重新登录
79 | }
80 | })
81 | },
82 | onShow: function() {
83 | let stroage = wx.getStorageSync('final_data');
84 | if (stroage) {
85 | let info = {
86 | openId: stroage.openId
87 | }
88 | router.route_request('mp/all_notice', info).catch(res => {
89 | wx.setStorageSync('notice', res)
90 | console.log(res)
91 | if (res.like[0]['new'] || res.reply[0]['new']) {
92 | console.log('new')
93 | this.setData({
94 | isnew: true
95 | })
96 | } else {
97 | console.log('old')
98 | this.setData({
99 | isnew: false
100 | })
101 | }
102 | })
103 |
104 | }
105 |
106 | },
107 | CopyLink(e) {
108 | wx.setClipboardData({
109 | data: e.currentTarget.dataset.link,
110 | success: res => {
111 | wx.showToast({
112 | title: '已复制',
113 | duration: 1000,
114 | })
115 | }
116 | })
117 | }
118 | })
--------------------------------------------------------------------------------
/pages/temp/index.json:
--------------------------------------------------------------------------------
1 | {
2 | "usingComponents": {}
3 | }
--------------------------------------------------------------------------------
/pages/temp/index.wxml:
--------------------------------------------------------------------------------
1 |
2 | 我的
3 |
4 |
5 |
6 |
7 |
8 |
11 |
12 |
13 |
14 | {{userInfo.nickName}}
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 | 我的喜欢
26 |
27 |
28 |
29 |
30 |
32 | 我的评论
33 |
34 |
35 |
36 |
37 |
38 |
39 | 我的收藏
40 |
41 |
42 |
43 |
44 |
45 |
46 |
47 |
48 | 我的消息
49 |
50 |
51 |
52 |
53 |
54 |
55 | 关于
56 |
57 |
58 |
59 |
60 |
61 |
62 | 问题反馈
63 |
64 |
65 |
66 |
67 |
68 |
69 | 更多功能
70 |
71 |
72 |
73 |
74 |
75 | GitHub
76 |
77 |
78 |
79 |
80 |
81 | 特别感谢
82 |
83 |
84 |
85 |
89 |
90 |
91 |
92 |
93 | {{motto}}
94 |
--------------------------------------------------------------------------------
/pages/temp/index.wxss:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Jarry007/wxBlog/0c170f6b46751976b273f8bd94524451e9b0df47/pages/temp/index.wxss
--------------------------------------------------------------------------------
/pages/temp/like.js:
--------------------------------------------------------------------------------
1 | // pages/index/like.js
2 | const app = getApp()
3 | var router = require('../index/router.js');
4 | var timeago = require('../../utils/timeago.js')
5 | Page({
6 | data: {
7 | StatusBar: app.globalData.StatusBar,
8 | CustomBar: app.globalData.CustomBar,
9 | like: ''
10 | },
11 | onLoad: function(options) {
12 | let stroage = wx.getStorageSync('final_data')
13 | console.log(stroage)
14 | if (stroage) {
15 | let info = {
16 | openId: stroage.openId
17 | };
18 | router.route_request('mp/my_like', info).catch(res => {
19 | let data_ = res.all
20 | for (var i = 0; i < data_.length; i++) {
21 | data_[i]['time'] = timeago.transDate(data_[i]['time'].replace('GMT', ''))
22 | }
23 | this.setData({
24 | like: data_
25 | })
26 | })
27 | } else {
28 | wx.navigateTo({
29 | url: '../login/login',
30 | })
31 | }
32 |
33 | },
34 | todetail(e) {
35 | wx.vibrateShort({})
36 | let id = e.currentTarget.dataset.id;
37 | wx.navigateTo({
38 | url: '../index/more?id=' + id,
39 | })
40 |
41 | }
42 |
43 | })
--------------------------------------------------------------------------------
/pages/temp/like.json:
--------------------------------------------------------------------------------
1 | {
2 | "usingComponents": {}
3 | }
--------------------------------------------------------------------------------
/pages/temp/like.wxml:
--------------------------------------------------------------------------------
1 |
2 |
3 | 返回我的喜欢
4 |
5 |
6 |
7 |
8 |
9 |
10 | {{item.time}}
11 | 喜欢了
12 |
13 |
14 |
15 |
16 |
17 |
18 | {{item.article_title}}
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
--------------------------------------------------------------------------------
/pages/temp/like.wxss:
--------------------------------------------------------------------------------
1 | /* pages/index/like.wxss */
--------------------------------------------------------------------------------
/pages/temp/notice.js:
--------------------------------------------------------------------------------
1 | // pages/temp/notice.js
2 | const app = getApp()
3 | var router = require('../index/router.js')
4 | Page({
5 | data: {
6 | notice: ''
7 | },
8 | onLoad: function(options) {
9 | let stroage = wx.getStorageSync('final_data')
10 | console.log(stroage)
11 | if (stroage) {
12 | let info = {
13 | openId: stroage.openId
14 | };
15 | router.route_request('mp/notice', info).catch(res => {
16 | console.log(res)
17 | this.setData({
18 | notice: res.all
19 | })
20 | })
21 | } else {
22 | wx.navigateTo({
23 | url: '../login/login',
24 | })
25 | }
26 | },
27 | })
--------------------------------------------------------------------------------
/pages/temp/notice.json:
--------------------------------------------------------------------------------
1 | {
2 | "usingComponents": {}
3 | }
--------------------------------------------------------------------------------
/pages/temp/notice.wxml:
--------------------------------------------------------------------------------
1 |
2 | pages/temp/notice.wxml
3 |
--------------------------------------------------------------------------------
/pages/temp/notice.wxss:
--------------------------------------------------------------------------------
1 | /* pages/temp/notice.wxss */
--------------------------------------------------------------------------------
/project.config.json:
--------------------------------------------------------------------------------
1 | {
2 | "cloudfunctionRoot": "cloudfunctions/",
3 | "description": "项目配置文件",
4 | "packOptions": {
5 | "ignore": []
6 | },
7 | "setting": {
8 | "urlCheck": false,
9 | "es6": true,
10 | "enhance": false,
11 | "postcss": true,
12 | "preloadBackgroundData": false,
13 | "minified": true,
14 | "newFeature": true,
15 | "coverView": true,
16 | "nodeModules": false,
17 | "autoAudits": false,
18 | "showShadowRootInWxmlPanel": true,
19 | "scopeDataCheck": false,
20 | "uglifyFileName": false,
21 | "checkInvalidKey": true,
22 | "checkSiteMap": true,
23 | "uploadWithSourceMap": true,
24 | "compileHotReLoad": false,
25 | "useMultiFrameRuntime": false,
26 | "useApiHook": true,
27 | "babelSetting": {
28 | "ignore": [],
29 | "disablePlugins": [],
30 | "outputPath": ""
31 | },
32 | "enableEngineNative": false,
33 | "useIsolateContext": true,
34 | "useCompilerModule": true,
35 | "userConfirmedUseCompilerModuleSwitch": false,
36 | "packNpmManually": false,
37 | "packNpmRelationList": []
38 | },
39 | "compileType": "miniprogram",
40 | "libVersion": "2.8.1",
41 | "appid": "wx41756aa8716ef1b9",
42 | "projectname": "007",
43 | "debugOptions": {
44 | "hidedInDevtools": []
45 | },
46 | "isGameTourist": false,
47 | "simulatorType": "wechat",
48 | "simulatorPluginLibVersion": {},
49 | "condition": {
50 | "search": {
51 | "current": -1,
52 | "list": []
53 | },
54 | "conversation": {
55 | "current": -1,
56 | "list": []
57 | },
58 | "game": {
59 | "currentL": -1,
60 | "list": []
61 | },
62 | "miniprogram": {
63 | "current": -1,
64 | "list": []
65 | }
66 | }
67 | }
--------------------------------------------------------------------------------
/scan.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Jarry007/wxBlog/0c170f6b46751976b273f8bd94524451e9b0df47/scan.jpg
--------------------------------------------------------------------------------
/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/md5.js:
--------------------------------------------------------------------------------
1 |
2 | var hexcase = 0; /* hex output format. 0 - lowercase; 1 - uppercase */
3 | var b64pad = ""; /* base-64 pad character. "=" for strict RFC compliance */
4 | var chrsz = 8; /* bits per input character. 8 - ASCII; 16 - Unicode */
5 |
6 |
7 | function hex_md5(s){ return binl2hex(core_md5(str2binl(s), s.length * chrsz));}
8 | function b64_md5(s){ return binl2b64(core_md5(str2binl(s), s.length * chrsz));}
9 | function str_md5(s){ return binl2str(core_md5(str2binl(s), s.length * chrsz));}
10 | function hex_hmac_md5(key, data) { return binl2hex(core_hmac_md5(key, data)); }
11 | function b64_hmac_md5(key, data) { return binl2b64(core_hmac_md5(key, data)); }
12 | function str_hmac_md5(key, data) { return binl2str(core_hmac_md5(key, data)); }
13 |
14 | /*
15 | * Perform a simple self-test to see if the VM is working
16 | */
17 | function md5_vm_test()
18 | {
19 | return hex_md5("abc") == "900150983cd24fb0d6963f7d28e17f72";
20 | }
21 |
22 | /*
23 | * Calculate the MD5 of an array of little-endian words, and a bit length
24 | */
25 | function core_md5(x, len)
26 | {
27 | /* append padding */
28 | x[len >> 5] |= 0x80 << ((len) % 32);
29 | x[(((len + 64) >>> 9) << 4) + 14] = len;
30 |
31 | var a = 1732584193;
32 | var b = -271733879;
33 | var c = -1732584194;
34 | var d = 271733878;
35 |
36 | for(var i = 0; i < x.length; i += 16)
37 | {
38 | var olda = a;
39 | var oldb = b;
40 | var oldc = c;
41 | var oldd = d;
42 |
43 | a = md5_ff(a, b, c, d, x[i+ 0], 7 , -680876936);
44 | d = md5_ff(d, a, b, c, x[i+ 1], 12, -389564586);
45 | c = md5_ff(c, d, a, b, x[i+ 2], 17, 606105819);
46 | b = md5_ff(b, c, d, a, x[i+ 3], 22, -1044525330);
47 | a = md5_ff(a, b, c, d, x[i+ 4], 7 , -176418897);
48 | d = md5_ff(d, a, b, c, x[i+ 5], 12, 1200080426);
49 | c = md5_ff(c, d, a, b, x[i+ 6], 17, -1473231341);
50 | b = md5_ff(b, c, d, a, x[i+ 7], 22, -45705983);
51 | a = md5_ff(a, b, c, d, x[i+ 8], 7 , 1770035416);
52 | d = md5_ff(d, a, b, c, x[i+ 9], 12, -1958414417);
53 | c = md5_ff(c, d, a, b, x[i+10], 17, -42063);
54 | b = md5_ff(b, c, d, a, x[i+11], 22, -1990404162);
55 | a = md5_ff(a, b, c, d, x[i+12], 7 , 1804603682);
56 | d = md5_ff(d, a, b, c, x[i+13], 12, -40341101);
57 | c = md5_ff(c, d, a, b, x[i+14], 17, -1502002290);
58 | b = md5_ff(b, c, d, a, x[i+15], 22, 1236535329);
59 |
60 | a = md5_gg(a, b, c, d, x[i+ 1], 5 , -165796510);
61 | d = md5_gg(d, a, b, c, x[i+ 6], 9 , -1069501632);
62 | c = md5_gg(c, d, a, b, x[i+11], 14, 643717713);
63 | b = md5_gg(b, c, d, a, x[i+ 0], 20, -373897302);
64 | a = md5_gg(a, b, c, d, x[i+ 5], 5 , -701558691);
65 | d = md5_gg(d, a, b, c, x[i+10], 9 , 38016083);
66 | c = md5_gg(c, d, a, b, x[i+15], 14, -660478335);
67 | b = md5_gg(b, c, d, a, x[i+ 4], 20, -405537848);
68 | a = md5_gg(a, b, c, d, x[i+ 9], 5 , 568446438);
69 | d = md5_gg(d, a, b, c, x[i+14], 9 , -1019803690);
70 | c = md5_gg(c, d, a, b, x[i+ 3], 14, -187363961);
71 | b = md5_gg(b, c, d, a, x[i+ 8], 20, 1163531501);
72 | a = md5_gg(a, b, c, d, x[i+13], 5 , -1444681467);
73 | d = md5_gg(d, a, b, c, x[i+ 2], 9 , -51403784);
74 | c = md5_gg(c, d, a, b, x[i+ 7], 14, 1735328473);
75 | b = md5_gg(b, c, d, a, x[i+12], 20, -1926607734);
76 |
77 | a = md5_hh(a, b, c, d, x[i+ 5], 4 , -378558);
78 | d = md5_hh(d, a, b, c, x[i+ 8], 11, -2022574463);
79 | c = md5_hh(c, d, a, b, x[i+11], 16, 1839030562);
80 | b = md5_hh(b, c, d, a, x[i+14], 23, -35309556);
81 | a = md5_hh(a, b, c, d, x[i+ 1], 4 , -1530992060);
82 | d = md5_hh(d, a, b, c, x[i+ 4], 11, 1272893353);
83 | c = md5_hh(c, d, a, b, x[i+ 7], 16, -155497632);
84 | b = md5_hh(b, c, d, a, x[i+10], 23, -1094730640);
85 | a = md5_hh(a, b, c, d, x[i+13], 4 , 681279174);
86 | d = md5_hh(d, a, b, c, x[i+ 0], 11, -358537222);
87 | c = md5_hh(c, d, a, b, x[i+ 3], 16, -722521979);
88 | b = md5_hh(b, c, d, a, x[i+ 6], 23, 76029189);
89 | a = md5_hh(a, b, c, d, x[i+ 9], 4 , -640364487);
90 | d = md5_hh(d, a, b, c, x[i+12], 11, -421815835);
91 | c = md5_hh(c, d, a, b, x[i+15], 16, 530742520);
92 | b = md5_hh(b, c, d, a, x[i+ 2], 23, -995338651);
93 |
94 | a = md5_ii(a, b, c, d, x[i+ 0], 6 , -198630844);
95 | d = md5_ii(d, a, b, c, x[i+ 7], 10, 1126891415);
96 | c = md5_ii(c, d, a, b, x[i+14], 15, -1416354905);
97 | b = md5_ii(b, c, d, a, x[i+ 5], 21, -57434055);
98 | a = md5_ii(a, b, c, d, x[i+12], 6 , 1700485571);
99 | d = md5_ii(d, a, b, c, x[i+ 3], 10, -1894986606);
100 | c = md5_ii(c, d, a, b, x[i+10], 15, -1051523);
101 | b = md5_ii(b, c, d, a, x[i+ 1], 21, -2054922799);
102 | a = md5_ii(a, b, c, d, x[i+ 8], 6 , 1873313359);
103 | d = md5_ii(d, a, b, c, x[i+15], 10, -30611744);
104 | c = md5_ii(c, d, a, b, x[i+ 6], 15, -1560198380);
105 | b = md5_ii(b, c, d, a, x[i+13], 21, 1309151649);
106 | a = md5_ii(a, b, c, d, x[i+ 4], 6 , -145523070);
107 | d = md5_ii(d, a, b, c, x[i+11], 10, -1120210379);
108 | c = md5_ii(c, d, a, b, x[i+ 2], 15, 718787259);
109 | b = md5_ii(b, c, d, a, x[i+ 9], 21, -343485551);
110 |
111 | a = safe_add(a, olda);
112 | b = safe_add(b, oldb);
113 | c = safe_add(c, oldc);
114 | d = safe_add(d, oldd);
115 | }
116 | return Array(a, b, c, d);
117 |
118 | }
119 |
120 | /*
121 | * These functions implement the four basic operations the algorithm uses.
122 | */
123 | function md5_cmn(q, a, b, x, s, t)
124 | {
125 | return safe_add(bit_rol(safe_add(safe_add(a, q), safe_add(x, t)), s),b);
126 | }
127 | function md5_ff(a, b, c, d, x, s, t)
128 | {
129 | return md5_cmn((b & c) | ((~b) & d), a, b, x, s, t);
130 | }
131 | function md5_gg(a, b, c, d, x, s, t)
132 | {
133 | return md5_cmn((b & d) | (c & (~d)), a, b, x, s, t);
134 | }
135 | function md5_hh(a, b, c, d, x, s, t)
136 | {
137 | return md5_cmn(b ^ c ^ d, a, b, x, s, t);
138 | }
139 | function md5_ii(a, b, c, d, x, s, t)
140 | {
141 | return md5_cmn(c ^ (b | (~d)), a, b, x, s, t);
142 | }
143 |
144 | /*
145 | * Calculate the HMAC-MD5, of a key and some data
146 | */
147 | function core_hmac_md5(key, data)
148 | {
149 | var bkey = str2binl(key);
150 | if(bkey.length > 16) bkey = core_md5(bkey, key.length * chrsz);
151 |
152 | var ipad = Array(16), opad = Array(16);
153 | for(var i = 0; i < 16; i++)
154 | {
155 | ipad[i] = bkey[i] ^ 0x36363636;
156 | opad[i] = bkey[i] ^ 0x5C5C5C5C;
157 | }
158 |
159 | var hash = core_md5(ipad.concat(str2binl(data)), 512 + data.length * chrsz);
160 | return core_md5(opad.concat(hash), 512 + 128);
161 | }
162 |
163 | /*
164 | * Add integers, wrapping at 2^32. This uses 16-bit operations internally
165 | * to work around bugs in some JS interpreters.
166 | */
167 | function safe_add(x, y)
168 | {
169 | var lsw = (x & 0xFFFF) + (y & 0xFFFF);
170 | var msw = (x >> 16) + (y >> 16) + (lsw >> 16);
171 | return (msw << 16) | (lsw & 0xFFFF);
172 | }
173 |
174 | /*
175 | * Bitwise rotate a 32-bit number to the left.
176 | */
177 | function bit_rol(num, cnt)
178 | {
179 | return (num << cnt) | (num >>> (32 - cnt));
180 | }
181 |
182 | /*
183 | * Convert a string to an array of little-endian words
184 | * If chrsz is ASCII, characters >255 have their hi-byte silently ignored.
185 | */
186 | function str2binl(str)
187 | {
188 | var bin = Array();
189 | var mask = (1 << chrsz) - 1;
190 | for(var i = 0; i < str.length * chrsz; i += chrsz)
191 | bin[i>>5] |= (str.charCodeAt(i / chrsz) & mask) << (i%32);
192 | return bin;
193 | }
194 |
195 | /*
196 | * Convert an array of little-endian words to a string
197 | */
198 | function binl2str(bin)
199 | {
200 | var str = "";
201 | var mask = (1 << chrsz) - 1;
202 | for(var i = 0; i < bin.length * 32; i += chrsz)
203 | str += String.fromCharCode((bin[i>>5] >>> (i % 32)) & mask);
204 | return str;
205 | }
206 |
207 | /*
208 | * Convert an array of little-endian words to a hex string.
209 | */
210 | function binl2hex(binarray)
211 | {
212 | var hex_tab = hexcase ? "0123456789ABCDEF" : "0123456789abcdef";
213 | var str = "";
214 | for(var i = 0; i < binarray.length * 4; i++)
215 | {
216 | str += hex_tab.charAt((binarray[i>>2] >> ((i%4)*8+4)) & 0xF) +
217 | hex_tab.charAt((binarray[i>>2] >> ((i%4)*8 )) & 0xF);
218 | }
219 | return str;
220 | }
221 |
222 | /*
223 | * Convert an array of little-endian words to a base-64 string
224 | */
225 | function binl2b64(binarray)
226 | {
227 | var tab = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";
228 | var str = "";
229 | for(var i = 0; i < binarray.length * 4; i += 3)
230 | {
231 | var triplet = (((binarray[i >> 2] >> 8 * ( i %4)) & 0xFF) << 16)
232 | | (((binarray[i+1 >> 2] >> 8 * ((i+1)%4)) & 0xFF) << 8 )
233 | | ((binarray[i+2 >> 2] >> 8 * ((i+2)%4)) & 0xFF);
234 | for(var j = 0; j < 4; j++)
235 | {
236 | if(i * 8 + j * 6 > binarray.length * 32) str += b64pad;
237 | else str += tab.charAt((triplet >> 6*(3-j)) & 0x3F);
238 | }
239 | }
240 | return str;
241 | }
242 | module.exports = {
243 | md5: hex_md5
244 | }
--------------------------------------------------------------------------------
/utils/router.js:
--------------------------------------------------------------------------------
1 | const app = getApp()
2 |
3 | class _Router {
4 | static get(_route, parmas) {
5 | const tokenName = app.globalData.routerConfig.tokenName
6 | const header = {}
7 | header[tokenName] = app.globalData.routerConfig.tokenValue
8 |
9 | return new Promise((resolve, reject) => {
10 | wx.request({
11 | url: `${app.globalData.routerConfig.url}${_route}`,
12 | method: 'GET',
13 | header: header,
14 | data: parmas,
15 | success: res => {
16 | if (res.data.code == 200) {
17 | resolve(res.data)
18 | } else if (res.data.code == '401') {
19 | wx.clearStorageSync('token')
20 | wx.showToast({
21 | title: '登录信息失效,请重新登录',
22 | icon: 'none',
23 | duration: 1500
24 | })
25 | setTimeout(() => {
26 | wx.redirectTo({
27 | url: '/pages/login/login',
28 | })
29 | }, 1500)
30 | } else {
31 | if (res.data.msg === 'token已过期') {
32 | wx.clearStorageSync('token')
33 | setTimeout(() => {
34 | wx.redirectTo({
35 | url: '/pages/login',
36 | })
37 | }, 1000)
38 | }
39 | reject(res.data)
40 | wx.showToast({
41 | title: `${res.data.msg || '网络出了点小问题,请重试~~'}`,
42 | icon: 'none'
43 | })
44 | }
45 | },
46 | fail: err => {
47 | reject(err)
48 | wx.showToast({
49 | title: '微信异常,稍后重试',
50 | icon: 'none'
51 | })
52 | }
53 | })
54 | })
55 | }
56 |
57 | static post(_route, _data, _method = false) {
58 | const tokenName = app.globalData.routerConfig.tokenName
59 | const header = _method ? {
60 | 'content-type': 'application/x-www-form-urlencoded'
61 | } : {
62 | 'content-type': 'application/json'
63 | }
64 | if (_route !== loginUrl) {
65 | header[tokenName] = app.globalData.routerConfig.tokenValue
66 | }
67 |
68 |
69 | return new Promise((resolve, reject) => {
70 | wx.request({
71 | url: `${app.globalData.routerConfig.url}${_route}`,
72 | method: 'POST',
73 | header: header,
74 | data: _data,
75 | success: res_ => {
76 | if (res_.data.code == 200) {
77 | resolve(res_.data)
78 | } else if (res_.data.code == '401') {
79 | wx.clearStorageSync('token')
80 | wx.showToast({
81 | title: '登录信息失效,请重新登录',
82 | icon: 'none',
83 | duration: 1500
84 | })
85 | setTimeout(() => {
86 | wx.redirectTo({
87 | url: '/pages/login/login',
88 | })
89 | }, 1500)
90 | } else {
91 | if (res_.data.msg === 'token已过期') {
92 | wx.clearStorageSync('token')
93 | setTimeout(() => {
94 | wx.redirectTo({
95 | url: '/pages/login',
96 | })
97 | }, 1000)
98 | }
99 | reject(res_.data)
100 | wx.showToast({
101 | title: `${res_.data.msg || '网络出了点小问题,请重试~~'}`,
102 | icon: 'none'
103 | })
104 | }
105 | },
106 | fail: err_ => {
107 | reject(err_)
108 | wx.showToast({
109 | title: '微信异常,稍后重试',
110 | icon: 'none'
111 | })
112 |
113 | }
114 | })
115 | })
116 |
117 | }
118 |
119 | static put(_route, _data, _method = false) {
120 | const tokenName_ = app.globalData.routerConfig.tokenName;
121 | const header_ = _method ? {
122 | 'content-type': 'application/x-www-form-urlencoded'
123 | } : {
124 | 'content-type': 'application/json'
125 | }
126 |
127 | header_[tokenName_] = app.globalData.routerConfig.tokenValue
128 |
129 | return new Promise((res, rej) => {
130 | wx.request({
131 | url: `${app.globalData.routerConfig.url}${_route}`,
132 | method: 'PUT',
133 | header: header_,
134 | data: _data,
135 | success: res_ => {
136 | if (res_.data.code == 200) {
137 | res(res_.data)
138 | } else if (res_.data.code == '401') {
139 | wx.clearStorageSync('token')
140 | wx.showToast({
141 | title: '登录信息失效,请重新登录',
142 | icon: 'none',
143 | duration: 1500
144 | })
145 | setTimeout(() => {
146 | wx.redirectTo({
147 | url: '/pages/login/login',
148 | })
149 | }, 1500)
150 | } else {
151 | if (res_.data.msg === 'token已过期') {
152 | wx.clearStorageSync('token')
153 | setTimeout(() => {
154 | wx.redirectTo({
155 | url: '/pages/login',
156 | })
157 | }, 1000)
158 | }
159 | rej(res_.data)
160 | wx.showToast({
161 | title: `${res_.data.msg || '网络出了点小问题,请重试~~'}`,
162 | icon: 'none'
163 | })
164 | }
165 | },
166 | fail: err_ => {
167 | rej(err_)
168 | wx.showToast({
169 | title: '微信异常,稍后重试',
170 | icon: 'none'
171 | })
172 | }
173 | })
174 | })
175 | }
176 |
177 | static del(_route, _data, _method = false) {
178 | const tokenName_ = app.globalData.routerConfig.tokenName;
179 | const header_ = _method ? {
180 | 'content-type': 'application/x-www-form-urlencoded'
181 | } : {
182 | 'content-type': 'application/json'
183 | }
184 |
185 | header_[tokenName_] = app.globalData.routerConfig.tokenValue
186 |
187 | return new Promise((res, rej) => {
188 | wx.request({
189 | url: `${app.globalData.routerConfig.url}${_route}`,
190 | method: 'DELETE',
191 | header: header_,
192 | data: _data,
193 | success: res_ => {
194 | if (res_.data.code == 200) {
195 | res(res_.data)
196 | } else if (res_.data.code == '401') {
197 | wx.clearStorageSync('token')
198 | wx.showToast({
199 | title: '登录信息失效,请重新登录',
200 | icon: 'none',
201 | duration: 1500
202 | })
203 | setTimeout(() => {
204 | wx.redirectTo({
205 | url: '/pages/login/login',
206 | })
207 | }, 1500)
208 |
209 | } else {
210 | if (res_.data.msg === 'token已过期') {
211 | wx.clearStorageSync('token')
212 | setTimeout(() => {
213 | wx.redirectTo({
214 | url: '/pages/login',
215 | })
216 | }, 1000)
217 | }
218 | rej(res_.data)
219 | wx.showToast({
220 | title: `${res_.data.msg || '网络出了点小问题,请重试~~'}`,
221 | })
222 | }
223 | },
224 | fail: err_ => {
225 | rej(err_)
226 | wx.showToast({
227 | title: '微信异常,稍后重试',
228 | icon: 'none'
229 | })
230 | }
231 | })
232 | })
233 | }
234 |
235 | static upload(_route, _file, ) {
236 | const tokenName_ = app.globalData.routerConfig.tokenName;
237 | const header_ = {}
238 | header_[tokenName_] = app.globalData.routerConfig.tokenValue
239 |
240 | return new Promise((resolve, reject) => {
241 | wx.uploadFile({
242 | filePath: _file,
243 | name: 'file',
244 | header: header_,
245 | url: `${app.globalData.routerConfig.url}${_route}`,
246 | success: res => {
247 | const result = JSON.parse(res.data)
248 | if (result.code == 200) {
249 | resolve(result)
250 | } else {
251 | if (result.msg === 'token已过期') {
252 | wx.clearStorageSync('token')
253 | setTimeout(() => {
254 | wx.redirectTo({
255 | url: '/pages/login',
256 | })
257 | }, 1000)
258 | }
259 | reject(result)
260 | }
261 | },
262 | fail: err => {
263 | reject(err)
264 | wx.showToast({
265 | title: '上传图片失败,请重试',
266 | icon: 'none'
267 | })
268 | }
269 | })
270 | })
271 | }
272 |
273 | static scan() {
274 | return new Promise((resolve, reject) => {
275 | wx.scanCode({
276 | success: res => {
277 | resolve(res)
278 | },
279 | fail: err => {
280 | // console.log('err',err)
281 | const data = {
282 | msg: "您取消了扫码~~"
283 | }
284 | reject(data)
285 | }
286 | })
287 | })
288 | }
289 | }
290 |
291 | export const Router = _Router
--------------------------------------------------------------------------------
/utils/timeago.js:
--------------------------------------------------------------------------------
1 |
2 | function transDate (mescStr) {
3 | var n = mescStr;
4 | var date = new Date(n);
5 | var M = (date.getMonth() + 1 < 10 ? '0' + (date.getMonth() + 1) : date.getMonth() + 1) + '-';
6 | var D = date.getDate() < 10 ? '0' + date.getDate() + ' ' : date.getDate() + ' ';
7 | var H = date.getHours() + ':';
8 | var Mi = date.getMinutes() < 10 ? '0' + date.getMinutes() : date.getMinutes();
9 |
10 |
11 | var M2 = date.getMonth() + 1;
12 | var D2 = date.getDate();
13 | var H2 = date.getHours();
14 | var Mi2 = date.getMinutes();
15 |
16 | var date1 = new Date();
17 | var M1 = date1.getMonth() + 1;
18 | var D1 = date1.getDate();
19 | var H1 = date1.getHours();
20 | var Mi1 = date1.getMinutes();
21 | console.log(M1 + " " + D1 + "....")
22 | if (M1 > M2 || D1 > D2) {
23 | return (M + D + H + Mi)
24 | }
25 | else if (H1 - H2 > 1) {
26 | var H3 = H1 - H2
27 | return (H3 + "小时前")
28 | }
29 | else if (Mi1 - Mi2 > 1) {
30 | var Mi3 = Mi1 - Mi2
31 | return (Mi3 + "分钟前")
32 | }
33 | else {
34 | return "刚刚"
35 | }
36 | }
37 |
38 | module.exports = {
39 | transDate: transDate
40 | }
--------------------------------------------------------------------------------
/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 |
9 | return [year, month, day].map(formatNumber).join('/') + ' ' + [hour, minute, second].map(formatNumber).join(':')
10 | }
11 |
12 | const formatNumber = n => {
13 | n = n.toString()
14 | return n[1] ? n : '0' + n
15 | }
16 |
17 | module.exports = {
18 | formatTime: formatTime
19 | }
20 |
--------------------------------------------------------------------------------
/wxParse/emojis/00.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Jarry007/wxBlog/0c170f6b46751976b273f8bd94524451e9b0df47/wxParse/emojis/00.gif
--------------------------------------------------------------------------------
/wxParse/emojis/01.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Jarry007/wxBlog/0c170f6b46751976b273f8bd94524451e9b0df47/wxParse/emojis/01.gif
--------------------------------------------------------------------------------
/wxParse/emojis/02.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Jarry007/wxBlog/0c170f6b46751976b273f8bd94524451e9b0df47/wxParse/emojis/02.gif
--------------------------------------------------------------------------------
/wxParse/emojis/03.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Jarry007/wxBlog/0c170f6b46751976b273f8bd94524451e9b0df47/wxParse/emojis/03.gif
--------------------------------------------------------------------------------
/wxParse/emojis/04.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Jarry007/wxBlog/0c170f6b46751976b273f8bd94524451e9b0df47/wxParse/emojis/04.gif
--------------------------------------------------------------------------------
/wxParse/emojis/05.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Jarry007/wxBlog/0c170f6b46751976b273f8bd94524451e9b0df47/wxParse/emojis/05.gif
--------------------------------------------------------------------------------
/wxParse/emojis/06.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Jarry007/wxBlog/0c170f6b46751976b273f8bd94524451e9b0df47/wxParse/emojis/06.gif
--------------------------------------------------------------------------------
/wxParse/emojis/07.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Jarry007/wxBlog/0c170f6b46751976b273f8bd94524451e9b0df47/wxParse/emojis/07.gif
--------------------------------------------------------------------------------
/wxParse/emojis/08.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Jarry007/wxBlog/0c170f6b46751976b273f8bd94524451e9b0df47/wxParse/emojis/08.gif
--------------------------------------------------------------------------------
/wxParse/emojis/09.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Jarry007/wxBlog/0c170f6b46751976b273f8bd94524451e9b0df47/wxParse/emojis/09.gif
--------------------------------------------------------------------------------
/wxParse/emojis/10.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Jarry007/wxBlog/0c170f6b46751976b273f8bd94524451e9b0df47/wxParse/emojis/10.gif
--------------------------------------------------------------------------------
/wxParse/emojis/100.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Jarry007/wxBlog/0c170f6b46751976b273f8bd94524451e9b0df47/wxParse/emojis/100.gif
--------------------------------------------------------------------------------
/wxParse/emojis/101.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Jarry007/wxBlog/0c170f6b46751976b273f8bd94524451e9b0df47/wxParse/emojis/101.gif
--------------------------------------------------------------------------------
/wxParse/emojis/102.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Jarry007/wxBlog/0c170f6b46751976b273f8bd94524451e9b0df47/wxParse/emojis/102.gif
--------------------------------------------------------------------------------
/wxParse/emojis/103.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Jarry007/wxBlog/0c170f6b46751976b273f8bd94524451e9b0df47/wxParse/emojis/103.gif
--------------------------------------------------------------------------------
/wxParse/emojis/104.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Jarry007/wxBlog/0c170f6b46751976b273f8bd94524451e9b0df47/wxParse/emojis/104.gif
--------------------------------------------------------------------------------
/wxParse/emojis/105.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Jarry007/wxBlog/0c170f6b46751976b273f8bd94524451e9b0df47/wxParse/emojis/105.gif
--------------------------------------------------------------------------------
/wxParse/emojis/106.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Jarry007/wxBlog/0c170f6b46751976b273f8bd94524451e9b0df47/wxParse/emojis/106.gif
--------------------------------------------------------------------------------
/wxParse/emojis/107.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Jarry007/wxBlog/0c170f6b46751976b273f8bd94524451e9b0df47/wxParse/emojis/107.gif
--------------------------------------------------------------------------------
/wxParse/emojis/108.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Jarry007/wxBlog/0c170f6b46751976b273f8bd94524451e9b0df47/wxParse/emojis/108.gif
--------------------------------------------------------------------------------
/wxParse/emojis/109.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Jarry007/wxBlog/0c170f6b46751976b273f8bd94524451e9b0df47/wxParse/emojis/109.gif
--------------------------------------------------------------------------------
/wxParse/emojis/11.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Jarry007/wxBlog/0c170f6b46751976b273f8bd94524451e9b0df47/wxParse/emojis/11.gif
--------------------------------------------------------------------------------
/wxParse/emojis/110.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Jarry007/wxBlog/0c170f6b46751976b273f8bd94524451e9b0df47/wxParse/emojis/110.gif
--------------------------------------------------------------------------------
/wxParse/emojis/111.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Jarry007/wxBlog/0c170f6b46751976b273f8bd94524451e9b0df47/wxParse/emojis/111.gif
--------------------------------------------------------------------------------
/wxParse/emojis/112.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Jarry007/wxBlog/0c170f6b46751976b273f8bd94524451e9b0df47/wxParse/emojis/112.gif
--------------------------------------------------------------------------------
/wxParse/emojis/113.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Jarry007/wxBlog/0c170f6b46751976b273f8bd94524451e9b0df47/wxParse/emojis/113.gif
--------------------------------------------------------------------------------
/wxParse/emojis/114.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Jarry007/wxBlog/0c170f6b46751976b273f8bd94524451e9b0df47/wxParse/emojis/114.gif
--------------------------------------------------------------------------------
/wxParse/emojis/115.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Jarry007/wxBlog/0c170f6b46751976b273f8bd94524451e9b0df47/wxParse/emojis/115.gif
--------------------------------------------------------------------------------
/wxParse/emojis/116.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Jarry007/wxBlog/0c170f6b46751976b273f8bd94524451e9b0df47/wxParse/emojis/116.gif
--------------------------------------------------------------------------------
/wxParse/emojis/117.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Jarry007/wxBlog/0c170f6b46751976b273f8bd94524451e9b0df47/wxParse/emojis/117.gif
--------------------------------------------------------------------------------
/wxParse/emojis/118.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Jarry007/wxBlog/0c170f6b46751976b273f8bd94524451e9b0df47/wxParse/emojis/118.gif
--------------------------------------------------------------------------------
/wxParse/emojis/119.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Jarry007/wxBlog/0c170f6b46751976b273f8bd94524451e9b0df47/wxParse/emojis/119.gif
--------------------------------------------------------------------------------
/wxParse/emojis/12.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Jarry007/wxBlog/0c170f6b46751976b273f8bd94524451e9b0df47/wxParse/emojis/12.gif
--------------------------------------------------------------------------------
/wxParse/emojis/120.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Jarry007/wxBlog/0c170f6b46751976b273f8bd94524451e9b0df47/wxParse/emojis/120.gif
--------------------------------------------------------------------------------
/wxParse/emojis/121.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Jarry007/wxBlog/0c170f6b46751976b273f8bd94524451e9b0df47/wxParse/emojis/121.gif
--------------------------------------------------------------------------------
/wxParse/emojis/122.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Jarry007/wxBlog/0c170f6b46751976b273f8bd94524451e9b0df47/wxParse/emojis/122.gif
--------------------------------------------------------------------------------
/wxParse/emojis/123.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Jarry007/wxBlog/0c170f6b46751976b273f8bd94524451e9b0df47/wxParse/emojis/123.gif
--------------------------------------------------------------------------------
/wxParse/emojis/124.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Jarry007/wxBlog/0c170f6b46751976b273f8bd94524451e9b0df47/wxParse/emojis/124.gif
--------------------------------------------------------------------------------
/wxParse/emojis/125.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Jarry007/wxBlog/0c170f6b46751976b273f8bd94524451e9b0df47/wxParse/emojis/125.gif
--------------------------------------------------------------------------------
/wxParse/emojis/126.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Jarry007/wxBlog/0c170f6b46751976b273f8bd94524451e9b0df47/wxParse/emojis/126.gif
--------------------------------------------------------------------------------
/wxParse/emojis/127.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Jarry007/wxBlog/0c170f6b46751976b273f8bd94524451e9b0df47/wxParse/emojis/127.gif
--------------------------------------------------------------------------------
/wxParse/emojis/128.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Jarry007/wxBlog/0c170f6b46751976b273f8bd94524451e9b0df47/wxParse/emojis/128.gif
--------------------------------------------------------------------------------
/wxParse/emojis/129.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Jarry007/wxBlog/0c170f6b46751976b273f8bd94524451e9b0df47/wxParse/emojis/129.gif
--------------------------------------------------------------------------------
/wxParse/emojis/13.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Jarry007/wxBlog/0c170f6b46751976b273f8bd94524451e9b0df47/wxParse/emojis/13.gif
--------------------------------------------------------------------------------
/wxParse/emojis/130.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Jarry007/wxBlog/0c170f6b46751976b273f8bd94524451e9b0df47/wxParse/emojis/130.gif
--------------------------------------------------------------------------------
/wxParse/emojis/131.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Jarry007/wxBlog/0c170f6b46751976b273f8bd94524451e9b0df47/wxParse/emojis/131.gif
--------------------------------------------------------------------------------
/wxParse/emojis/132.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Jarry007/wxBlog/0c170f6b46751976b273f8bd94524451e9b0df47/wxParse/emojis/132.gif
--------------------------------------------------------------------------------
/wxParse/emojis/133.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Jarry007/wxBlog/0c170f6b46751976b273f8bd94524451e9b0df47/wxParse/emojis/133.gif
--------------------------------------------------------------------------------
/wxParse/emojis/134.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Jarry007/wxBlog/0c170f6b46751976b273f8bd94524451e9b0df47/wxParse/emojis/134.gif
--------------------------------------------------------------------------------
/wxParse/emojis/14.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Jarry007/wxBlog/0c170f6b46751976b273f8bd94524451e9b0df47/wxParse/emojis/14.gif
--------------------------------------------------------------------------------
/wxParse/emojis/15.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Jarry007/wxBlog/0c170f6b46751976b273f8bd94524451e9b0df47/wxParse/emojis/15.gif
--------------------------------------------------------------------------------
/wxParse/emojis/16.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Jarry007/wxBlog/0c170f6b46751976b273f8bd94524451e9b0df47/wxParse/emojis/16.gif
--------------------------------------------------------------------------------
/wxParse/emojis/17.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Jarry007/wxBlog/0c170f6b46751976b273f8bd94524451e9b0df47/wxParse/emojis/17.gif
--------------------------------------------------------------------------------
/wxParse/emojis/18.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Jarry007/wxBlog/0c170f6b46751976b273f8bd94524451e9b0df47/wxParse/emojis/18.gif
--------------------------------------------------------------------------------
/wxParse/emojis/19.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Jarry007/wxBlog/0c170f6b46751976b273f8bd94524451e9b0df47/wxParse/emojis/19.gif
--------------------------------------------------------------------------------
/wxParse/emojis/20.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Jarry007/wxBlog/0c170f6b46751976b273f8bd94524451e9b0df47/wxParse/emojis/20.gif
--------------------------------------------------------------------------------
/wxParse/emojis/21.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Jarry007/wxBlog/0c170f6b46751976b273f8bd94524451e9b0df47/wxParse/emojis/21.gif
--------------------------------------------------------------------------------
/wxParse/emojis/22.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Jarry007/wxBlog/0c170f6b46751976b273f8bd94524451e9b0df47/wxParse/emojis/22.gif
--------------------------------------------------------------------------------
/wxParse/emojis/23.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Jarry007/wxBlog/0c170f6b46751976b273f8bd94524451e9b0df47/wxParse/emojis/23.gif
--------------------------------------------------------------------------------
/wxParse/emojis/24.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Jarry007/wxBlog/0c170f6b46751976b273f8bd94524451e9b0df47/wxParse/emojis/24.gif
--------------------------------------------------------------------------------
/wxParse/emojis/25.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Jarry007/wxBlog/0c170f6b46751976b273f8bd94524451e9b0df47/wxParse/emojis/25.gif
--------------------------------------------------------------------------------
/wxParse/emojis/26.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Jarry007/wxBlog/0c170f6b46751976b273f8bd94524451e9b0df47/wxParse/emojis/26.gif
--------------------------------------------------------------------------------
/wxParse/emojis/27.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Jarry007/wxBlog/0c170f6b46751976b273f8bd94524451e9b0df47/wxParse/emojis/27.gif
--------------------------------------------------------------------------------
/wxParse/emojis/28.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Jarry007/wxBlog/0c170f6b46751976b273f8bd94524451e9b0df47/wxParse/emojis/28.gif
--------------------------------------------------------------------------------
/wxParse/emojis/29.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Jarry007/wxBlog/0c170f6b46751976b273f8bd94524451e9b0df47/wxParse/emojis/29.gif
--------------------------------------------------------------------------------
/wxParse/emojis/30.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Jarry007/wxBlog/0c170f6b46751976b273f8bd94524451e9b0df47/wxParse/emojis/30.gif
--------------------------------------------------------------------------------
/wxParse/emojis/31.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Jarry007/wxBlog/0c170f6b46751976b273f8bd94524451e9b0df47/wxParse/emojis/31.gif
--------------------------------------------------------------------------------
/wxParse/emojis/32.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Jarry007/wxBlog/0c170f6b46751976b273f8bd94524451e9b0df47/wxParse/emojis/32.gif
--------------------------------------------------------------------------------
/wxParse/emojis/33.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Jarry007/wxBlog/0c170f6b46751976b273f8bd94524451e9b0df47/wxParse/emojis/33.gif
--------------------------------------------------------------------------------
/wxParse/emojis/34.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Jarry007/wxBlog/0c170f6b46751976b273f8bd94524451e9b0df47/wxParse/emojis/34.gif
--------------------------------------------------------------------------------
/wxParse/emojis/35.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Jarry007/wxBlog/0c170f6b46751976b273f8bd94524451e9b0df47/wxParse/emojis/35.gif
--------------------------------------------------------------------------------
/wxParse/emojis/36.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Jarry007/wxBlog/0c170f6b46751976b273f8bd94524451e9b0df47/wxParse/emojis/36.gif
--------------------------------------------------------------------------------
/wxParse/emojis/37.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Jarry007/wxBlog/0c170f6b46751976b273f8bd94524451e9b0df47/wxParse/emojis/37.gif
--------------------------------------------------------------------------------
/wxParse/emojis/38.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Jarry007/wxBlog/0c170f6b46751976b273f8bd94524451e9b0df47/wxParse/emojis/38.gif
--------------------------------------------------------------------------------
/wxParse/emojis/39.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Jarry007/wxBlog/0c170f6b46751976b273f8bd94524451e9b0df47/wxParse/emojis/39.gif
--------------------------------------------------------------------------------
/wxParse/emojis/40.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Jarry007/wxBlog/0c170f6b46751976b273f8bd94524451e9b0df47/wxParse/emojis/40.gif
--------------------------------------------------------------------------------
/wxParse/emojis/41.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Jarry007/wxBlog/0c170f6b46751976b273f8bd94524451e9b0df47/wxParse/emojis/41.gif
--------------------------------------------------------------------------------
/wxParse/emojis/42.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Jarry007/wxBlog/0c170f6b46751976b273f8bd94524451e9b0df47/wxParse/emojis/42.gif
--------------------------------------------------------------------------------
/wxParse/emojis/43.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Jarry007/wxBlog/0c170f6b46751976b273f8bd94524451e9b0df47/wxParse/emojis/43.gif
--------------------------------------------------------------------------------
/wxParse/emojis/44.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Jarry007/wxBlog/0c170f6b46751976b273f8bd94524451e9b0df47/wxParse/emojis/44.gif
--------------------------------------------------------------------------------
/wxParse/emojis/45.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Jarry007/wxBlog/0c170f6b46751976b273f8bd94524451e9b0df47/wxParse/emojis/45.gif
--------------------------------------------------------------------------------
/wxParse/emojis/46.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Jarry007/wxBlog/0c170f6b46751976b273f8bd94524451e9b0df47/wxParse/emojis/46.gif
--------------------------------------------------------------------------------
/wxParse/emojis/47.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Jarry007/wxBlog/0c170f6b46751976b273f8bd94524451e9b0df47/wxParse/emojis/47.gif
--------------------------------------------------------------------------------
/wxParse/emojis/48.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Jarry007/wxBlog/0c170f6b46751976b273f8bd94524451e9b0df47/wxParse/emojis/48.gif
--------------------------------------------------------------------------------
/wxParse/emojis/49.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Jarry007/wxBlog/0c170f6b46751976b273f8bd94524451e9b0df47/wxParse/emojis/49.gif
--------------------------------------------------------------------------------
/wxParse/emojis/50.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Jarry007/wxBlog/0c170f6b46751976b273f8bd94524451e9b0df47/wxParse/emojis/50.gif
--------------------------------------------------------------------------------
/wxParse/emojis/51.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Jarry007/wxBlog/0c170f6b46751976b273f8bd94524451e9b0df47/wxParse/emojis/51.gif
--------------------------------------------------------------------------------
/wxParse/emojis/52.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Jarry007/wxBlog/0c170f6b46751976b273f8bd94524451e9b0df47/wxParse/emojis/52.gif
--------------------------------------------------------------------------------
/wxParse/emojis/53.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Jarry007/wxBlog/0c170f6b46751976b273f8bd94524451e9b0df47/wxParse/emojis/53.gif
--------------------------------------------------------------------------------
/wxParse/emojis/54.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Jarry007/wxBlog/0c170f6b46751976b273f8bd94524451e9b0df47/wxParse/emojis/54.gif
--------------------------------------------------------------------------------
/wxParse/emojis/55.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Jarry007/wxBlog/0c170f6b46751976b273f8bd94524451e9b0df47/wxParse/emojis/55.gif
--------------------------------------------------------------------------------
/wxParse/emojis/56.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Jarry007/wxBlog/0c170f6b46751976b273f8bd94524451e9b0df47/wxParse/emojis/56.gif
--------------------------------------------------------------------------------
/wxParse/emojis/57.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Jarry007/wxBlog/0c170f6b46751976b273f8bd94524451e9b0df47/wxParse/emojis/57.gif
--------------------------------------------------------------------------------
/wxParse/emojis/58.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Jarry007/wxBlog/0c170f6b46751976b273f8bd94524451e9b0df47/wxParse/emojis/58.gif
--------------------------------------------------------------------------------
/wxParse/emojis/59.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Jarry007/wxBlog/0c170f6b46751976b273f8bd94524451e9b0df47/wxParse/emojis/59.gif
--------------------------------------------------------------------------------
/wxParse/emojis/60.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Jarry007/wxBlog/0c170f6b46751976b273f8bd94524451e9b0df47/wxParse/emojis/60.gif
--------------------------------------------------------------------------------
/wxParse/emojis/61.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Jarry007/wxBlog/0c170f6b46751976b273f8bd94524451e9b0df47/wxParse/emojis/61.gif
--------------------------------------------------------------------------------
/wxParse/emojis/62.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Jarry007/wxBlog/0c170f6b46751976b273f8bd94524451e9b0df47/wxParse/emojis/62.gif
--------------------------------------------------------------------------------
/wxParse/emojis/63.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Jarry007/wxBlog/0c170f6b46751976b273f8bd94524451e9b0df47/wxParse/emojis/63.gif
--------------------------------------------------------------------------------
/wxParse/emojis/64.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Jarry007/wxBlog/0c170f6b46751976b273f8bd94524451e9b0df47/wxParse/emojis/64.gif
--------------------------------------------------------------------------------
/wxParse/emojis/65.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Jarry007/wxBlog/0c170f6b46751976b273f8bd94524451e9b0df47/wxParse/emojis/65.gif
--------------------------------------------------------------------------------
/wxParse/emojis/66.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Jarry007/wxBlog/0c170f6b46751976b273f8bd94524451e9b0df47/wxParse/emojis/66.gif
--------------------------------------------------------------------------------
/wxParse/emojis/67.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Jarry007/wxBlog/0c170f6b46751976b273f8bd94524451e9b0df47/wxParse/emojis/67.gif
--------------------------------------------------------------------------------
/wxParse/emojis/68.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Jarry007/wxBlog/0c170f6b46751976b273f8bd94524451e9b0df47/wxParse/emojis/68.gif
--------------------------------------------------------------------------------
/wxParse/emojis/69.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Jarry007/wxBlog/0c170f6b46751976b273f8bd94524451e9b0df47/wxParse/emojis/69.gif
--------------------------------------------------------------------------------
/wxParse/emojis/70.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Jarry007/wxBlog/0c170f6b46751976b273f8bd94524451e9b0df47/wxParse/emojis/70.gif
--------------------------------------------------------------------------------
/wxParse/emojis/71.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Jarry007/wxBlog/0c170f6b46751976b273f8bd94524451e9b0df47/wxParse/emojis/71.gif
--------------------------------------------------------------------------------
/wxParse/emojis/72.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Jarry007/wxBlog/0c170f6b46751976b273f8bd94524451e9b0df47/wxParse/emojis/72.gif
--------------------------------------------------------------------------------
/wxParse/emojis/73.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Jarry007/wxBlog/0c170f6b46751976b273f8bd94524451e9b0df47/wxParse/emojis/73.gif
--------------------------------------------------------------------------------
/wxParse/emojis/74.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Jarry007/wxBlog/0c170f6b46751976b273f8bd94524451e9b0df47/wxParse/emojis/74.gif
--------------------------------------------------------------------------------
/wxParse/emojis/75.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Jarry007/wxBlog/0c170f6b46751976b273f8bd94524451e9b0df47/wxParse/emojis/75.gif
--------------------------------------------------------------------------------
/wxParse/emojis/76.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Jarry007/wxBlog/0c170f6b46751976b273f8bd94524451e9b0df47/wxParse/emojis/76.gif
--------------------------------------------------------------------------------
/wxParse/emojis/77.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Jarry007/wxBlog/0c170f6b46751976b273f8bd94524451e9b0df47/wxParse/emojis/77.gif
--------------------------------------------------------------------------------
/wxParse/emojis/78.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Jarry007/wxBlog/0c170f6b46751976b273f8bd94524451e9b0df47/wxParse/emojis/78.gif
--------------------------------------------------------------------------------
/wxParse/emojis/79.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Jarry007/wxBlog/0c170f6b46751976b273f8bd94524451e9b0df47/wxParse/emojis/79.gif
--------------------------------------------------------------------------------
/wxParse/emojis/80.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Jarry007/wxBlog/0c170f6b46751976b273f8bd94524451e9b0df47/wxParse/emojis/80.gif
--------------------------------------------------------------------------------
/wxParse/emojis/81.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Jarry007/wxBlog/0c170f6b46751976b273f8bd94524451e9b0df47/wxParse/emojis/81.gif
--------------------------------------------------------------------------------
/wxParse/emojis/82.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Jarry007/wxBlog/0c170f6b46751976b273f8bd94524451e9b0df47/wxParse/emojis/82.gif
--------------------------------------------------------------------------------
/wxParse/emojis/83.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Jarry007/wxBlog/0c170f6b46751976b273f8bd94524451e9b0df47/wxParse/emojis/83.gif
--------------------------------------------------------------------------------
/wxParse/emojis/84.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Jarry007/wxBlog/0c170f6b46751976b273f8bd94524451e9b0df47/wxParse/emojis/84.gif
--------------------------------------------------------------------------------
/wxParse/emojis/85.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Jarry007/wxBlog/0c170f6b46751976b273f8bd94524451e9b0df47/wxParse/emojis/85.gif
--------------------------------------------------------------------------------
/wxParse/emojis/86.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Jarry007/wxBlog/0c170f6b46751976b273f8bd94524451e9b0df47/wxParse/emojis/86.gif
--------------------------------------------------------------------------------
/wxParse/emojis/87.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Jarry007/wxBlog/0c170f6b46751976b273f8bd94524451e9b0df47/wxParse/emojis/87.gif
--------------------------------------------------------------------------------
/wxParse/emojis/88.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Jarry007/wxBlog/0c170f6b46751976b273f8bd94524451e9b0df47/wxParse/emojis/88.gif
--------------------------------------------------------------------------------
/wxParse/emojis/89.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Jarry007/wxBlog/0c170f6b46751976b273f8bd94524451e9b0df47/wxParse/emojis/89.gif
--------------------------------------------------------------------------------
/wxParse/emojis/90.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Jarry007/wxBlog/0c170f6b46751976b273f8bd94524451e9b0df47/wxParse/emojis/90.gif
--------------------------------------------------------------------------------
/wxParse/emojis/91.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Jarry007/wxBlog/0c170f6b46751976b273f8bd94524451e9b0df47/wxParse/emojis/91.gif
--------------------------------------------------------------------------------
/wxParse/emojis/92.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Jarry007/wxBlog/0c170f6b46751976b273f8bd94524451e9b0df47/wxParse/emojis/92.gif
--------------------------------------------------------------------------------
/wxParse/emojis/93.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Jarry007/wxBlog/0c170f6b46751976b273f8bd94524451e9b0df47/wxParse/emojis/93.gif
--------------------------------------------------------------------------------
/wxParse/emojis/94.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Jarry007/wxBlog/0c170f6b46751976b273f8bd94524451e9b0df47/wxParse/emojis/94.gif
--------------------------------------------------------------------------------
/wxParse/emojis/95.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Jarry007/wxBlog/0c170f6b46751976b273f8bd94524451e9b0df47/wxParse/emojis/95.gif
--------------------------------------------------------------------------------
/wxParse/emojis/96.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Jarry007/wxBlog/0c170f6b46751976b273f8bd94524451e9b0df47/wxParse/emojis/96.gif
--------------------------------------------------------------------------------
/wxParse/emojis/97.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Jarry007/wxBlog/0c170f6b46751976b273f8bd94524451e9b0df47/wxParse/emojis/97.gif
--------------------------------------------------------------------------------
/wxParse/emojis/98.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Jarry007/wxBlog/0c170f6b46751976b273f8bd94524451e9b0df47/wxParse/emojis/98.gif
--------------------------------------------------------------------------------
/wxParse/emojis/99.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Jarry007/wxBlog/0c170f6b46751976b273f8bd94524451e9b0df47/wxParse/emojis/99.gif
--------------------------------------------------------------------------------
/wxParse/highlight.js:
--------------------------------------------------------------------------------
1 | var Prism = require('../highlight/prism.js')
2 | function highlight(data){
3 | let langArr = new Array();
4 | langArr = listLanguages();
5 | // console.log('all-language:'+langArr)
6 | let html = data;
7 | let tagArr = data.match(/<\/?code[^>]*>/g);
8 | if(tagArr == null){
9 | return html;
10 | }
11 | let indexArr = [];
12 | for (let i = 0; i < tagArr.length; i++){
13 | if (i == 0){
14 | indexArr.push(data.indexOf(tagArr[i]));
15 | }
16 | else{
17 | indexArr.push(data.indexOf(tagArr[i], indexArr[i-1]));
18 | }
19 | }
20 |
21 | let cls;
22 | let i = 0;
23 | while (i < tagArr.length - 1) {
24 | getStartInfo(tagArr[i])
25 | var label = tagArr[i].match(/<*([^> ]*)/)[1];
26 | // console.log('label:'+label)
27 | if (tagArr[i + 1] === '' + label + '>') {
28 | if (label === 'code' ) {
29 | let lang = cls.split(' ')[0];
30 | if (/lang-(.*)/i.test(lang)) {
31 | lang = lang.replace(/lang-(.*)/i, '$1');
32 | }
33 | else if (/languages?-(.*)/i.test(lang)) {
34 | lang = lang.replace(/languages?-(.*)/i, '$1');
35 | }
36 | if (langArr.indexOf(lang) == -1 || lang == null || lang == 'none' || lang == 'null') {
37 | }
38 | else {
39 |
40 | let code = data.substring(indexArr[i], indexArr[i + 1]).replace(/]*>/, '');
41 |
42 | let hcode = Prism.highlight(code, Prism.languages[lang], lang);
43 | html = html.replace(code, hcode);
44 |
45 | }
46 |
47 | }
48 | i++;
49 | }else{
50 | console.log('不是闭包')
51 | }
52 | i++;
53 | }
54 | return html;
55 |
56 | function getStartInfo(str) {
57 | cls = matchRule(str, 'class');
58 | }
59 |
60 | function matchRule(str, rule) {
61 | let value = '';
62 | let re = new RegExp(rule + '=[\'"]?([^\'"]*)');
63 | //console.log('regexp:'+re)
64 | if (str.match(re) !== null) {
65 | value = str.match(re)[1];
66 | //console.log('value:'+value)
67 | }
68 | return value;
69 | }
70 |
71 |
72 | // 列出当前 Prism.js 中已有的代码语言,可以自己在 Prism 的下载页面选择更多的语言。
73 | function listLanguages() {
74 | var langs = new Array();
75 | let i = 0;
76 | for (let language in Prism.languages) {
77 | if (Object.prototype.toString.call(Prism.languages[language]) !== '[object Function]') {
78 | langs[i] = language;
79 | i++;
80 | }
81 | }
82 | return langs;
83 | }
84 | }
85 |
86 | module.exports = {
87 | highlight: highlight
88 | };
89 |
--------------------------------------------------------------------------------
/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 | var highlight = require('./highlight.js')
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 |
39 |
40 | function makeMap(str) {
41 | var obj = {}, items = str.split(",");
42 | for (var i = 0; i < items.length; i++)
43 | obj[items[i]] = true;
44 | return obj;
45 | }
46 |
47 | function q(v) {
48 | return '"' + v + '"';
49 | }
50 |
51 | function removeDOCTYPE(html) {
52 | return html
53 | .replace(/<\?xml.*\?>\n/, '')
54 | .replace(/<.*!doctype.*\>\n/, '')
55 | .replace(/<.*!DOCTYPE.*\>\n/, '');
56 | }
57 |
58 | function trimHtml(html) {
59 | return html
60 | // .replace(/\r?\n+/g, '')
61 | .replace(//ig, '')
62 | .replace(/\/\*.*?\*\//ig, '')
63 | .replace(/[ ]+
193 | // add to parents
194 | var parent = bufArray[0] || results;
195 | if (parent.nodes === undefined) {
196 | parent.nodes = [];
197 | }
198 | parent.nodes.push(node);
199 | } else {
200 | bufArray.unshift(node);
201 | }
202 | },
203 | end: function (tag) {
204 | //debug(tag);
205 | // merge into parent tag
206 | var node = bufArray.shift();
207 | if (node.tag !== tag) console.error('invalid state: mismatch end tag');
208 |
209 | //当有缓存source资源时于于video补上src资源
210 | if(node.tag === 'video' && results.source){
211 | node.attr.src = results.source;
212 | delete results.source;
213 | }
214 |
215 | if (bufArray.length === 0) {
216 | results.nodes.push(node);
217 | } else {
218 | var parent = bufArray[0];
219 | if (parent.nodes === undefined) {
220 | parent.nodes = [];
221 | }
222 | parent.nodes.push(node);
223 | }
224 | },
225 | chars: function (text) {
226 | //debug(text);
227 | var node = {
228 | node: 'text',
229 | text: text,
230 | textArray:transEmojiStr(text)
231 | };
232 |
233 | if (bufArray.length === 0) {
234 | node.index = index.toString()
235 | index += 1
236 | results.nodes.push(node);
237 | } else {
238 | var parent = bufArray[0];
239 | if (parent.nodes === undefined) {
240 | parent.nodes = [];
241 | }
242 | node.index = parent.index + '.' + parent.nodes.length
243 | parent.nodes.push(node);
244 | }
245 | },
246 | comment: function (text) {
247 | //debug(text);
248 | // var node = {
249 | // node: 'comment',
250 | // text: text,
251 | // };
252 | // var parent = bufArray[0];
253 | // if (parent.nodes === undefined) {
254 | // parent.nodes = [];
255 | // }
256 | // parent.nodes.push(node);
257 | },
258 | });
259 | return results;
260 | };
261 |
262 | function transEmojiStr(str){
263 | // var eReg = new RegExp("["+__reg+' '+"]");
264 | // str = str.replace(/\[([^\[\]]+)\]/g,':$1:')
265 | str = str.replace(/</g, '<');
266 | str = str.replace(/>/g, '>');
267 | str = str.replace(/&/g, '&');
268 | var emojiObjs = [];
269 | //如果正则表达式为空
270 | if(__emojisReg.length == 0 || !__emojis){
271 | var emojiObj = {}
272 | emojiObj.node = "text";
273 | emojiObj.text = str;
274 | array = [emojiObj];
275 | return array;
276 | }
277 | //这个地方需要调整
278 | str = str.replace(/\[([^\[\]]+)\]/g,':$1:')
279 |
280 | var eReg = new RegExp("[:]");
281 | var array = str.split(eReg);
282 | for(var i = 0; i < array.length; i++){
283 | var ele = array[i];
284 | var emojiObj = {};
285 | if(__emojis[ele]){
286 | emojiObj.node = "element";
287 | emojiObj.tag = "emoji";
288 | emojiObj.text = __emojis[ele];
289 | emojiObj.baseSrc= __emojisBaseSrc;
290 | }else{
291 | emojiObj.node = "text";
292 | emojiObj.text = ele;
293 | }
294 | emojiObjs.push(emojiObj);
295 | }
296 |
297 | return emojiObjs;
298 | }
299 |
300 | function emojisInit(reg='',baseSrc="/wxParse/emojis/",emojis){
301 | __emojisReg = reg;
302 | __emojisBaseSrc=baseSrc;
303 | __emojis=emojis;
304 | }
305 |
306 | module.exports = {
307 | html2json: html2json,
308 | emojisInit:emojisInit
309 | };
310 |
311 |
--------------------------------------------------------------------------------
/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 |
110 | str = str.replace(/</g, '‹');
111 | str = str.replace(/>/g, '›');
112 |
113 | str = str.replace(/</g, '‹');
114 | str = str.replace(/>/g, '›');
115 |
116 | //str = str.replace(/</g, '<');
117 | //str = str.replace(/>/g, '>');
118 | str = str.replace(/•/g, '•');
119 | str = str.replace(/↵/g, '\n');
120 | // console.log('character转义完成')
121 | // console.log(str)
122 | return str;
123 | }
124 |
125 | // HTML 支持的其他实体
126 | function strOtherDiscode(str){
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 | str = str.replace(/″/g, '″');
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 |
163 | str = str.replace(/←/g, '←');
164 | str = str.replace(/↑/g, '↑');
165 | str = str.replace(/→/g, '→');
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 |
172 | str = str.replace(/⌊/g, '⌊');
173 | str = str.replace(/⌋/g, '⌋');
174 | str = str.replace(/◊/g, '◊');
175 | str = str.replace(/♠/g, '♠');
176 | str = str.replace(/♣/g, '♣');
177 | str = str.replace(/♥/g, '♥');
178 |
179 | str = str.replace(/♦/g, '♦');
180 | str = str.replace(/'/g, '\'');
181 | return str;
182 | }
183 |
184 | function strMoreDiscode(str){
185 | // str = str.replace(/\r\n/g,"$1");
186 | // str = str.replace(/\n/g, '$1');
187 |
188 | // str = str.replace(/code/g,"wxxxcode-style");
189 | return str;
190 | }
191 |
192 | function strDiscode(str){
193 | str = strNumDiscode(str);
194 | str = strGreeceDiscode(str);
195 | str = strOtherDiscode(str);
196 | str = strMoreDiscode(str);
197 | str = strcharacterDiscode(str);
198 | return str;
199 | }
200 | function urlToHttpUrl(url,rep){
201 |
202 | var patt1 = new RegExp("^//");
203 | var result = patt1.test(url);
204 | if(result){
205 | url = rep+":"+url;
206 | }
207 | return url;
208 | }
209 |
210 | module.exports = {
211 | strDiscode:strDiscode,
212 | urlToHttpUrl:urlToHttpUrl
213 | }
--------------------------------------------------------------------------------
/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 |
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 |
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 | /**
3 | * author: Di (微信小程序开发工程师)
4 | * organization: WeAppDev(微信小程序开发论坛)(http://weappdev.com)
5 | * 垂直微信小程序开发交流社区
6 | *
7 | * github地址: https://github.com/icindy/wxParse
8 | *
9 | * for: 微信小程序富文本解析
10 | * detail : http://weappdev.com/t/wxparse-alpha0-1-html-markdown/184
11 | */
12 |
13 | .wxParse{
14 | margin: 0 5px;
15 | font-family: Helvetica,sans-serif;
16 | font-size: 28rpx;
17 | color: #666;
18 | line-height: 1.8;
19 | }
20 | view{
21 | word-break:break-all;
22 | }
23 | .wxParse-inline{
24 | display: inline;
25 | margin: 0;
26 | padding: 0;
27 | }
28 | /*//标题 */
29 | .wxParse-div{margin: 0;padding: 0;}
30 | .wxParse-h1{ font-size:2em; margin: .67em 0 }
31 | .wxParse-h2{ font-size:1.5em; margin: .75em 0 }
32 | .wxParse-h3{ font-size:1.17em; margin: .83em 0 }
33 | .wxParse-h4{ margin: 1.12em 0}
34 | .wxParse-h5 { font-size:.83em; margin: 1.5em 0 }
35 | .wxParse-h6{ font-size:.75em; margin: 1.67em 0 }
36 |
37 | .wxParse-h1 {
38 | font-size: 18px;
39 | font-weight: 400;
40 | border-bottom: 2rpx solid rgb(79, 81, 228);
41 |
42 | }
43 | .wxParse-h1 .wxParse-inline{
44 | padding: 6rpx 11rpx 4rpx;
45 | color: #fff;
46 | background: rgb(79, 81, 228);
47 | border-top-left-radius: 5rpx;
48 | border-top-right-radius: 12rpx;
49 | }
50 | .wxParse-h2 {
51 |
52 | font-size: 16px;
53 | font-weight: 400;
54 | margin-bottom: .5em;
55 | border-bottom: 2rpx solid rgb(82, 199, 121);
56 | }
57 | .wxParse-h2 .wxParse-inline{
58 | padding: 8rpx 6rpx 0 6rpx;
59 | color: #fff;
60 | background: rgb(82, 199, 121);
61 | border-top-left-radius: 5rpx;
62 | border-top-right-radius: 12rpx;
63 | }
64 | .wxParse-h3 {
65 | font-weight: 400;
66 | font-size: 15px;
67 | margin-bottom: .5em;
68 |
69 | }
70 | .wxParse-h3 .wxParse-inline{
71 | border-bottom: 2rpx solid rgb(221, 176, 80);
72 | }
73 | .wxParse-h4 {
74 | font-weight: 400;
75 | font-size: 14px;
76 | margin-bottom: .24em;
77 | }
78 | .wxParse-h5 {
79 | font-weight: 400;
80 | font-size: 13px;
81 | margin-bottom: .14em;
82 | }
83 | .wxParse-h6 {
84 | font-weight: 400;
85 | font-size: 12px;
86 | margin-bottom: .04em;
87 | }
88 |
89 | .wxParse-h1, .wxParse-h2, .wxParse-h3, .wxParse-h4, .wxParse-h5, .wxParse-h6, .wxParse-b, .wxParse-strong { font-weight: bolder }
90 |
91 | .wxParse-i,.wxParse-cite,.wxParse-em,.wxParse-var,.wxParse-address{font-style:italic}
92 | .wxParse-pre,.wxParse-tt,.wxParse-code,.wxParse-kbd,.wxParse-samp{font-family:monospace}
93 | .wxParse-pre{white-space:pre}
94 | .wxParse-big{font-size:1.17em}
95 | .wxParse-small,.wxParse-sub,.wxParse-sup{font-size:.83em}
96 | .wxParse-sub{vertical-align:sub}
97 | .wxParse-sup{vertical-align:super}
98 | .wxParse-s,.wxParse-strike,.wxParse-del{text-decoration:line-through}
99 | /*wxparse-自定义个性化的css样式*/
100 | /*增加video的css样式*/
101 | .wxParse-strong,.wxParse-s{display: inline}
102 | .wxParse-a{
103 | color: deepskyblue;
104 | word-break:break-all;
105 | overflow:auto;
106 | }
107 |
108 | .wxParse-video{
109 | text-align: center;
110 | margin: 10px 0;
111 | }
112 |
113 | .wxParse-video-video{
114 | width:100%;
115 | }
116 |
117 | .wxParse-img{
118 | /*background-color: #efefef;*/
119 | overflow: hidden;
120 | }
121 |
122 | .wxParse-blockquote {
123 | margin: 0;
124 | font-family:Courier, Calibri,"宋体";
125 | background:#fdfbfb;
126 | border-left: 4px solid #252525;
127 | padding-left: 15rpx;
128 | }
129 |
130 | .wxParse-code,.wxParse-wxxxcode-style{
131 | display: inline;
132 | font-size: 80%;
133 | font-family: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, Courier, monospace, "STHeitiTC-Light", "Microsoft YaHei Light", -apple-system, system-ui, BlinkMacSystemFont;
134 | color: rgb(249, 63, 127);
135 |
136 | }
137 | .wxParse-ol{
138 | list-style-type: decimal;
139 | margin-left: 30rpx;
140 | }
141 | .wxParse-ul{
142 | margin: 20rpx 10rpx;
143 | }
144 | .wxParse-hr{
145 | background-color: rgb(129, 139, 224);
146 |
147 | height: 8rpx;
148 | margin: 40rpx 0;
149 |
150 | }
151 | .wxParse-li{
152 | display: list-item;
153 | align-items: baseline;
154 |
155 | }
156 | .wxParse-li-text{
157 | align-items: center;
158 |
159 | }
160 |
161 | .wxParse-li-square{
162 | display: inline-flex;
163 | width: 10rpx;
164 | height: 10rpx;
165 | background-color: rgb(129, 139, 224);
166 | margin-right: 5px;
167 | }
168 | .wxParse-li-ring{
169 | display: inline-flex;
170 | width: 10rpx;
171 | height: 10rpx;
172 | border: 2rpx solid #333;
173 | border-radius: 50%;
174 | background-color: #fff;
175 | margin-right: 5px;
176 | }
177 |
178 | .wxParse-table{
179 | width: 100%;
180 | border-collapse: collapse;
181 | border-spacing: 0;
182 | display: table;
183 | margin-bottom: 40rpx;
184 | }
185 | /*
186 | .wxParse-thead,.wxParse-tfoot,.wxParse-tr{
187 | display: flex;
188 | flex-direction: row;
189 | }
190 | .wxParse-th,.wxParse-td{
191 | display: flex;
192 | width: 580px;
193 | overflow: auto;
194 | }*/
195 |
196 | .wxParse-u {
197 | text-decoration: underline;
198 | }
199 | .wxParse-hide{
200 | display: none;
201 | }
202 | .WxEmojiView{
203 | align-items: center;
204 | }
205 | .wxEmoji{
206 | width: 16px;
207 | height:16px;
208 | }
209 | .wxParse-tr{
210 | display: flex;
211 | border-right:1px solid #e0e0e0;
212 | border-bottom:1px solid #e0e0e0;
213 | border-top:1px solid #e0e0e0;
214 | }
215 | .wxParse-th,
216 | .wxParse-td{
217 | flex:1;
218 | padding:5px;
219 | font-size:28rpx;
220 | border-left:1px solid #e0e0e0;
221 | word-break: break-all;
222 | }
223 | .wxParse-td:last{
224 | border-top:1px solid #e0e0e0;
225 | }
226 | .wxParse-th{
227 | background:#f0f0f0;
228 | border-top:1px solid #e0e0e0;
229 | }
230 | .wxParse-del{
231 | display: inline;
232 | }
233 | .wxParse-figure {
234 | overflow: hidden;
235 | }
236 |
--------------------------------------------------------------------------------