├── .gitattributes
├── .gitignore
├── README.md
├── app.js
├── app.json
├── app.wxss
├── dist
├── actionsheet
│ ├── index.js
│ ├── index.wxml
│ └── index.wxss
├── badge
│ └── index.wxss
├── btn
│ └── index.wxss
├── capsule
│ ├── index.wxml
│ └── index.wxss
├── card
│ └── index.wxss
├── cell
│ └── index.wxss
├── col
│ └── index.wxss
├── color
│ └── index.wxss
├── common
│ └── helper.js
├── dialog
│ ├── index.js
│ ├── index.wxml
│ └── index.wxss
├── field
│ ├── index.js
│ ├── index.wxml
│ └── index.wxss
├── helper
│ └── index.wxss
├── icon
│ └── index.wxss
├── index.js
├── index.wxss
├── loadmore
│ ├── index.wxml
│ └── index.wxss
├── noticebar
│ ├── index.js
│ ├── index.wxml
│ └── index.wxss
├── panel
│ └── index.wxss
├── popup
│ └── index.wxss
├── row
│ └── index.wxss
├── select
│ ├── index.js
│ ├── index.wxml
│ └── index.wxss
├── stepper
│ ├── index.js
│ ├── index.wxml
│ └── index.wxss
├── steps
│ ├── index.wxml
│ ├── index.wxss
│ └── wxss
│ │ ├── step.wxss
│ │ └── vstep.wxss
├── switch
│ ├── index.js
│ ├── index.wxml
│ └── index.wxss
├── tab
│ ├── index.js
│ ├── index.wxml
│ └── index.wxss
├── tag
│ └── index.wxss
├── toast
│ ├── index.js
│ ├── index.wxml
│ └── index.wxss
└── toptips
│ ├── index.js
│ ├── index.wxml
│ └── index.wxss
├── img
├── calendar.png
├── express.png
├── index_n.png
├── index_p.png
├── jiantou.png
├── loginme.png
├── more_n.png
├── more_p.png
├── weather.png
├── weather
│ ├── 0.png
│ ├── 1.png
│ ├── 10.png
│ ├── 11.png
│ ├── 12.png
│ ├── 13.png
│ ├── 14.png
│ ├── 15.png
│ ├── 16.png
│ ├── 17.png
│ ├── 18.png
│ ├── 19.png
│ ├── 2.png
│ ├── 20.png
│ ├── 21.png
│ ├── 22.png
│ ├── 23.png
│ ├── 24.png
│ ├── 25.png
│ ├── 26.png
│ ├── 27.png
│ ├── 28.png
│ ├── 29.png
│ ├── 3.png
│ ├── 30.png
│ ├── 301.png
│ ├── 302.png
│ ├── 31.png
│ ├── 32.png
│ ├── 39.png
│ ├── 4.png
│ ├── 49.png
│ ├── 5.png
│ ├── 53.png
│ ├── 54.png
│ ├── 55.png
│ ├── 56.png
│ ├── 57.png
│ ├── 58.png
│ ├── 6.png
│ ├── 7.png
│ ├── 8.png
│ ├── 9.png
│ └── 99.png
└── weixinarticle.png
├── pages
├── content
│ ├── content.js
│ ├── content.json
│ ├── content.wxml
│ └── content.wxss
├── index
│ ├── index.js
│ ├── index.json
│ ├── index.wxml
│ └── index.wxss
├── kdselect
│ ├── kdselect.js
│ ├── kdselect.json
│ ├── kdselect.wxml
│ └── kdselect.wxss
├── other
│ ├── other.js
│ ├── other.json
│ ├── other.wxml
│ └── other.wxss
├── weather
│ ├── weather.js
│ ├── weather.json
│ ├── weather.wxml
│ └── weather.wxss
└── wxarticle
│ ├── wxarticle.js
│ ├── wxarticle.json
│ ├── wxarticle.wxml
│ └── wxarticle.wxss
├── screen
├── 1.png
├── 2.png
├── 3.png
├── 4.png
├── 5.png
├── 6.png
└── 7.png
├── utils
├── bmob.js
├── underscore.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
├── html2json.js
├── htmlparser.js
├── showdown.js
├── wxDiscode.js
├── wxParse.js
├── wxParse.wxml
└── wxParse.wxss
/.gitattributes:
--------------------------------------------------------------------------------
1 | # Auto detect text files and perform LF normalization
2 | * text=auto
3 |
4 | # Custom for Visual Studio
5 | *.cs diff=csharp
6 |
7 | # Standard to msysgit
8 | *.doc diff=astextplain
9 | *.DOC diff=astextplain
10 | *.docx diff=astextplain
11 | *.DOCX diff=astextplain
12 | *.dot diff=astextplain
13 | *.DOT diff=astextplain
14 | *.pdf diff=astextplain
15 | *.PDF diff=astextplain
16 | *.rtf diff=astextplain
17 | *.RTF diff=astextplain
18 |
--------------------------------------------------------------------------------
/.gitignore:
--------------------------------------------------------------------------------
1 | # Windows image file caches
2 | Thumbs.db
3 | ehthumbs.db
4 |
5 | # Folder config file
6 | Desktop.ini
7 |
8 | # Recycle Bin used on file shares
9 | $RECYCLE.BIN/
10 |
11 | # Windows Installer files
12 | *.cab
13 | *.msi
14 | *.msm
15 | *.msp
16 |
17 | # Windows shortcuts
18 | *.lnk
19 |
20 | # =========================
21 | # Operating System Files
22 | # =========================
23 |
24 | # OSX
25 | # =========================
26 |
27 | .DS_Store
28 | .AppleDouble
29 | .LSOverride
30 |
31 | # Thumbnails
32 | ._*
33 |
34 | # Files that might appear in the root of a volume
35 | .DocumentRevisions-V100
36 | .fseventsd
37 | .Spotlight-V100
38 | .TemporaryItems
39 | .Trashes
40 | .VolumeIcon.icns
41 |
42 | # Directories potentially created on remote AFP share
43 | .AppleDB
44 | .AppleDesktop
45 | Network Trash Folder
46 | Temporary Items
47 | .apdisk
48 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | # 微信小程序历史上的今天
2 | 毕业设计项目
3 | 主要功能为历史上的今天 指定日期的历史上今天,历史上的今天的详情、评论;
4 | 其他功能:天气预报、快递查询、微信热门文章
5 |
6 | ## 项目截图:
7 | ### 历史上今天界面
8 | 
9 | ### 日期选择
10 | 
11 | ### 文章详情
12 | 
13 | ### 天气预报
14 | 
15 | ### 微信热门文章
16 | 
17 | ### 快递查询
18 | 
19 | ## 接口来源:
20 | 极速数据:
21 | 全国天气预报
22 | 快递查询
23 | 历史上的今天
24 | 微信文章精选
25 | ## 技术框架:
26 | 有赞UI框架
27 | 微信小程序富文本解析
28 | ## 使用说明:
29 | 替换app.js文件中对应的Bmob.initialize("你的Application ID", "你的REST API Key");
30 | 替换页面js中appkey(appkey 在极速数据申请)
31 |
32 |
--------------------------------------------------------------------------------
/app.js:
--------------------------------------------------------------------------------
1 | //app.js
2 |
3 | const Bmob = require('utils/bmob.js');
4 | Bmob.initialize("你的Application ID", "你的REST API Key");
5 | App({
6 | onLaunch: function () {
7 | var that=this;
8 | // 登录
9 | wx.login({
10 | success: res => {
11 | // 发送 res.code 到后台换取 openId, sessionKey, unionId
12 | }
13 | })
14 | // 获取用户信息
15 | wx.getUserInfo({
16 | success: function (res) {
17 | var userInfo = res.userInfo
18 | that.globalData.userInfo = userInfo
19 | console.log(userInfo)
20 | }
21 | })
22 |
23 | },
24 | globalData: {
25 | userInfo: null,
26 | //历史事件数据
27 | data:'',
28 | //微信文章数据
29 | wxlist:'',
30 | //判断文章类型 0 历史 1 微信
31 | wztype:'',
32 |
33 | }
34 | })
--------------------------------------------------------------------------------
/app.json:
--------------------------------------------------------------------------------
1 | {
2 | "pages": [
3 | "pages/index/index",
4 | "pages/other/other",
5 | "pages/content/content",
6 | "pages/weather/weather",
7 | "pages/kdselect/kdselect",
8 | "pages/wxarticle/wxarticle"
9 | ],
10 | "window": {
11 | "backgroundTextStyle": "light",
12 | "navigationBarBackgroundColor": "#fff",
13 | "navigationBarTitleText": "历史上的今天",
14 | "navigationBarTextStyle": "black"
15 | },
16 | "tabBar": {
17 | "color": "#a9b7b7",
18 | "selectedColor": "#11cd6e",
19 | "borderStyle": "white",
20 | "list": [
21 | {
22 | "selectedIconPath": "img/index_p.png",
23 | "iconPath": "img/index_n.png",
24 | "pagePath": "pages/index/index",
25 | "text": "首页"
26 | },
27 | {
28 | "selectedIconPath": "img/more_p.png",
29 | "iconPath": "img/more_n.png",
30 | "pagePath": "pages/other/other",
31 | "text": "更多"
32 | }
33 | ]
34 | }
35 | }
--------------------------------------------------------------------------------
/app.wxss:
--------------------------------------------------------------------------------
1 | /**app.wxss**/
2 | @import "/dist/index.wxss";
--------------------------------------------------------------------------------
/dist/actionsheet/index.js:
--------------------------------------------------------------------------------
1 | const { extractComponentId } = require('../common/helper');
2 |
3 | module.exports = {
4 | _handleZanActionsheetMaskClick({ currentTarget = {} }) {
5 | const dataset = currentTarget.dataset || {};
6 | const { componentId, closeOnClickOverlay } = dataset;
7 |
8 | // 判断是否在点击背景时需要关闭弹层
9 | if (!closeOnClickOverlay) {
10 | return;
11 | }
12 |
13 | resolveCancelClick.call(this, { componentId });
14 | },
15 |
16 | _handleZanActionsheetCancelBtnClick(e) {
17 | const componentId = extractComponentId(e);
18 |
19 | resolveCancelClick.call(this, { componentId });
20 | },
21 |
22 | _handleZanActionsheetBtnClick({ currentTarget = {} }) {
23 | const dataset = currentTarget.dataset || {};
24 | const { componentId, index } = dataset;
25 |
26 | if (this.handleZanActionsheetClick) {
27 | this.handleZanActionsheetClick({ componentId, index });
28 | } else {
29 | console.warn('页面缺少 handleZanActionsheetClick 回调函数');
30 | }
31 | }
32 | };
33 |
34 | function resolveCancelClick({ componentId }) {
35 |
36 | if (this.handleZanActionsheetCancel) {
37 | this.handleZanActionsheetCancel({ componentId });
38 | } else {
39 | console.warn('页面缺少 handleZanActionsheetCancel 回调函数');
40 | }
41 | }
42 |
--------------------------------------------------------------------------------
/dist/actionsheet/index.wxml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
8 |
9 |
10 |
26 |
27 |
28 |
38 |
39 |
40 |
41 |
--------------------------------------------------------------------------------
/dist/actionsheet/index.wxss:
--------------------------------------------------------------------------------
1 | .zan-actionsheet{background-color:#f8f8f8}.zan-actionsheet__mask{position:fixed;top:0;left:0;right:0;bottom:0;z-index:10;background:rgba(0,0,0,.7);display:none}.zan-actionsheet__container{position:fixed;left:0;right:0;bottom:0;background:#f8f8f8;transform:translate3d(0,50%,0);transform-origin:center;transition:all .2s ease;z-index:11;opacity:0;visibility:hidden}.zan-actionsheet__btn.zan-btn{height:50px;line-height:50px;margin-bottom:0}.zan-actionsheet__btn.zan-btn::after{border-width:0;border-bottom-width:1px}.zan-actionsheet__btn.zan-btn:last-child::after{border-bottom-width:0}.zan-actionsheet__subname{margin-left:2px;font-size:12px;color:#666}.zan-actionsheet__footer{margin-top:10px}.zan-actionsheet__btn.zan-btn--loading .zan-actionsheet__subname{color:transparent}.zan-actionsheet--show .zan-actionsheet__container{opacity:1;transform:translate3d(0,0,0);visibility:visible}.zan-actionsheet--show .zan-actionsheet__mask{display:block}
--------------------------------------------------------------------------------
/dist/badge/index.wxss:
--------------------------------------------------------------------------------
1 | .zan-badge{position:relative}.zan-badge__count{position:absolute;top:-16px;right:0;height:1.6em;min-width:1.6em;line-height:1.6;padding:0 .4em;font-size:20px;border-radius:.8em;background:#f44;color:#fff;text-align:center;white-space:nowrap;transform:translateX(50%) scale(.5);transform-origin:center;z-index:10;box-shadow:0 0 0 2px #fff;box-sizing:border-box}
--------------------------------------------------------------------------------
/dist/btn/index.wxss:
--------------------------------------------------------------------------------
1 | .zan-btn{position:relative;color:#333;background-color:#fff;margin-bottom:10px;padding-left:15px;padding-right:15px;border-radius:2px;font-size:16px;line-height:45px;height:45px;box-sizing:border-box;text-decoration:none;text-align:center;vertical-align:middle}.zan-btn::after{content:'';position:absolute;top:0;left:0;width:200%;height:200%;transform:scale(.5);transform-origin:0 0;pointer-events:none;box-sizing:border-box;border:0 solid #e5e5e5;border-width:1px;border-radius:4px}.zan-btns{margin:15px}.zan-btn--primary{color:#fff;background-color:#4b0}.zan-btn--primary::after{border-color:#0a0}.zan-btn--warn{color:#fff;background-color:#f85}.zan-btn--warn::after{border-color:#f85}.zan-btn--danger{color:#fff;background-color:#f44}.zan-btn--danger::after{border-color:#e33}.zan-btn--small{display:inline-block;height:30px;line-height:30px;font-size:12px;margin-right:5px;margin-bottom:0}.zan-btn--mini{display:inline-block;line-height:21px;height:22px;font-size:10px;margin-right:5px;margin-bottom:0;padding-left:5px;padding-right:5px}.zan-btn--large{border-radius:0;margin-bottom:0;border:none;line-height:50px;height:50px}.zan-btn--plain.zan-btn{background-color:transparent}.zan-btn--plain.zan-btn--primary{color:#06bf04}.zan-btn--plain.zan-btn--warn{color:#f60}.zan-btn--plain.zan-btn--danger{color:#f44}.button-hover{opacity:.9}.zan-btn--loading{color:transparent;opacity:1}.zan-btn--loading::before{position:absolute;left:50%;top:50%;content:' ';width:16px;height:16px;margin-left:-8px;margin-top:-8px;border:3px solid #e5e5e5;border-color:#666 #e5e5e5 #e5e5e5 #e5e5e5;border-radius:8px;box-sizing:border-box;animation:btn-spin .6s linear;animation-iteration-count:infinite}.zan-btn--danger.zan-btn--loading::before,.zan-btn--primary.zan-btn--loading::before,.zan-btn--warn.zan-btn--loading::before{border-color:#fff rgba(0,0,0,.1) rgba(0,0,0,.1) rgba(0,0,0,.1)}@keyframes btn-spin{0%{transform:rotate(0)}100%{transform:rotate(360deg)}}.zan-btn.zan-btn--disabled{color:#999!important;background:#f8f8f8!important;border-color:#e5e5e5!important;cursor:not-allowed!important;opacity:1!important}.zan-btn.zan-btn--disabled::after{border-color:#e5e5e5!important}.zan-btn--last-child,.zan-btn:last-child{margin-bottom:0;margin-right:0}
--------------------------------------------------------------------------------
/dist/capsule/index.wxml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | {{ leftText }}
8 | {{ rightText }}
12 |
13 |
14 | {{ leftText }}
15 | {{ rightText }}
16 |
17 |
18 |
19 |
--------------------------------------------------------------------------------
/dist/capsule/index.wxss:
--------------------------------------------------------------------------------
1 | .zan-capsule{display:inline-block;font-size:12px;vertical-align:middle;line-height:19px;transform:scale(.83)}.zan-capsule__left,.zan-capsule__right{display:inline-block;line-height:17px;height:19px;vertical-align:middle;box-sizing:border-box}.zan-capsule__left{padding:0 2px;color:#fff;background:#999;border-radius:2px 0 0 2px;border:1rpx solid #999}.zan-capsule__right{padding:0 5px;color:#999;border-radius:0 2px 2px 0;border:1rpx solid #999}.zan-capsule--danger .zan-capsule__left{color:#fff;background:#f24544;border-color:#f24544}.zan-capsule--danger .zan-capsule__right{color:#f24544;border-color:#f24544}
--------------------------------------------------------------------------------
/dist/card/index.wxss:
--------------------------------------------------------------------------------
1 | .zan-card{margin-left:0;width:auto;padding:5px 15px;overflow:hidden;position:relative;font-size:14px}.zan-card__thumb{width:90px;height:90px;float:left;position:relative;margin-left:auto;margin-right:auto;overflow:hidden;background-size:cover}.zan-card__img{position:absolute;top:0;left:0;right:0;bottom:0;width:auto;height:auto;max-width:100%;max-height:100%}.zan-card__detail{margin-left:100px;width:auto;position:relative}.zan-card__detail-row{overflow:hidden;line-height:20px;min-height:20px;margin-bottom:3px}.zan-card__right-col{float:right}.zan-card__left-col{margin-right:80px}
--------------------------------------------------------------------------------
/dist/cell/index.wxss:
--------------------------------------------------------------------------------
1 | .zan-cell{position:relative;padding:12px 15px;display:flex;align-items:center;line-height:1.4;font-size:14px}.zan-cell::after{content:'';position:absolute;top:0;left:0;width:200%;height:200%;transform:scale(.5);transform-origin:0 0;pointer-events:none;box-sizing:border-box;border:0 solid #e5e5e5;border-bottom-width:1px;left:15px;right:0}.zan-cell__icon{margin-right:5px}.zan-cell__bd{flex:1}.zan-cell__text{line-height:24px;font-size:14px}.zan-cell__desc{line-height:1.2;font-size:12px;color:#666}.zan-cell__ft{position:relative;text-align:right;color:#666}.zan-cell__no-pading{padding:0}.zan-cell__no-pading .zan-cell__bd_padding{padding:12px 0 12px 15px}.zan-cell__no-pading .zan-cell__bd_padding .zan-form__input{height:26px}.zan-cell__no-pading .zan-cell__ft_padding{padding:12px 15px 12px 0}.zan-cell--last-child::after,.zan-cell:last-child::after{display:none}.zan-cell--access .zan-cell__ft{padding-right:13px}.zan-cell--access .zan-cell__ft::after{position:absolute;top:50%;right:2px;content:" ";display:inline-block;height:6px;width:6px;border-width:2px 2px 0 0;border-color:#c8c8c8;border-style:solid;transform:translateY(-50%) matrix(.71,.71,-.71,.71,0,0)}.zan-cell--switch{padding-top:6px;padding-bottom:6px}
--------------------------------------------------------------------------------
/dist/col/index.wxss:
--------------------------------------------------------------------------------
1 | .zan-col{float:left;box-sizing:border-box;width:0}.zan-col-1{width:4.16667%}.zan-col-offset-1{margin-left:4.16667%}.zan-col-2{width:8.33333%}.zan-col-offset-2{margin-left:8.33333%}.zan-col-3{width:12.5%}.zan-col-offset-3{margin-left:12.5%}.zan-col-4{width:16.66667%}.zan-col-offset-4{margin-left:16.66667%}.zan-col-5{width:20.83333%}.zan-col-offset-5{margin-left:20.83333%}.zan-col-6{width:25%}.zan-col-offset-6{margin-left:25%}.zan-col-7{width:29.16667%}.zan-col-offset-7{margin-left:29.16667%}.zan-col-8{width:33.33333%}.zan-col-offset-8{margin-left:33.33333%}.zan-col-9{width:37.5%}.zan-col-offset-9{margin-left:37.5%}.zan-col-10{width:41.66667%}.zan-col-offset-10{margin-left:41.66667%}.zan-col-11{width:45.83333%}.zan-col-offset-11{margin-left:45.83333%}.zan-col-12{width:50%}.zan-col-offset-12{margin-left:50%}.zan-col-13{width:54.16667%}.zan-col-offset-13{margin-left:54.16667%}.zan-col-14{width:58.33333%}.zan-col-offset-14{margin-left:58.33333%}.zan-col-15{width:62.5%}.zan-col-offset-15{margin-left:62.5%}.zan-col-16{width:66.66667%}.zan-col-offset-16{margin-left:66.66667%}.zan-col-17{width:70.83333%}.zan-col-offset-17{margin-left:70.83333%}.zan-col-18{width:75%}.zan-col-offset-18{margin-left:75%}.zan-col-19{width:79.16667%}.zan-col-offset-19{margin-left:79.16667%}.zan-col-20{width:83.33333%}.zan-col-offset-20{margin-left:83.33333%}.zan-col-21{width:87.5%}.zan-col-offset-21{margin-left:87.5%}.zan-col-22{width:91.66667%}.zan-col-offset-22{margin-left:91.66667%}.zan-col-23{width:95.83333%}.zan-col-offset-23{margin-left:95.83333%}.zan-col-24{width:100%}.zan-col-offset-24{margin-left:100%}
--------------------------------------------------------------------------------
/dist/color/index.wxss:
--------------------------------------------------------------------------------
1 | .zan-c-red{color:#f44!important}.zan-c-gray{color:#c9c9c9!important}.zan-c-gray-dark{color:#999!important}.zan-c-gray-darker{color:#666!important}.zan-c-black{color:#333!important}.zan-c-blue{color:#38f!important}.zan-c-green{color:#06bf04!important}
--------------------------------------------------------------------------------
/dist/common/helper.js:
--------------------------------------------------------------------------------
1 | // 从事件对象中解析得到 componentId
2 | // 需要在元素上声明 data-component-id
3 | function extractComponentId(event = {}) {
4 | const { dataset: { componentId } } = event.currentTarget || {};
5 | return componentId;
6 | }
7 |
8 | /*
9 | 注:默认合并所有生命周期函数
10 | 配置合并指定的生命周期 or 忽略指定字段
11 | const extend = extendCreator({
12 | life: ['onLoad', 'onPullDownRefresh'],
13 | exclude: ['binder']
14 | });
15 |
16 | Page(extend({}, {
17 | onLoad() {},
18 | ...
19 | }));
20 | */
21 |
22 | const LIFE_CYCLE = ['onLoad', 'onReady', 'onShow', 'onHide', 'onUnload', 'onPullDownRefresh', 'onReachBottom', 'onShareAppMessage', 'onPageScroll'];
23 |
24 | const extendCreator = (config = {}) => {
25 | const {
26 | life = LIFE_CYCLE,
27 | exclude = []
28 | } = config;
29 |
30 | const excludeList = exclude.concat(LIFE_CYCLE.map(getFuncArrayName));
31 |
32 | if (!Array.isArray(life) || !Array.isArray(exclude)) throw new Error('Invalid Extend Config');
33 | let lifeCycleList = life.filter(item => LIFE_CYCLE.indexOf(item) >= 0);
34 | return function extend(target, ...objList) {
35 | objList.forEach((source) => {
36 | if (source) {
37 | let keys = Object.keys(source);
38 | keys.forEach((key) => {
39 | let value = source[key];
40 | if (excludeList.indexOf(key) >= 0) return;
41 | if (lifeCycleList.indexOf(key) >= 0 && typeof value === 'function') {
42 | let funcArrayName = getFuncArrayName(key);
43 | if (!target[funcArrayName]) {
44 | target[funcArrayName] = [];
45 | if (target[key]) {
46 | target[funcArrayName].push(target[key]);
47 | }
48 | target[key] = function (...rest) {
49 | target[funcArrayName].forEach(func => func.apply(this, rest));
50 | };
51 | }
52 |
53 | if (source[funcArrayName]) {
54 | // 经过生命周期合并的组件直接整合函数列表
55 | target[funcArrayName].push(...source[funcArrayName]);
56 | } else {
57 | // 添加生命周期函数进入函数列表
58 | target[funcArrayName].push(value);
59 | }
60 | } else {
61 | target[key] = value;
62 | }
63 | });
64 | }
65 | });
66 | return target;
67 | };
68 | };
69 |
70 | const getFuncArrayName = name => `__$${name}`;
71 |
72 | module.exports = {
73 | extractComponentId,
74 | extend: Object.assign,
75 | extendCreator
76 | };
77 |
--------------------------------------------------------------------------------
/dist/dialog/index.js:
--------------------------------------------------------------------------------
1 | const _f = function () {};
2 |
3 | module.exports = {
4 | showZanDialog(options = {}) {
5 | const {
6 | // 自定义 btn 列表
7 | // { type: 按钮类型,回调时以此作为区分依据,text: 按钮文案, color: 按钮文字颜色 }
8 | buttons = [],
9 | // 标题
10 | title = '',
11 | // 内容
12 | content = ' ',
13 | // 按钮是否展示为纵向
14 | buttonsShowVertical = false,
15 | // 是否展示确定
16 | showConfirm = true,
17 | // 确认按钮文案
18 | confirmText = '确定',
19 | // 确认按钮颜色
20 | confirmColor = '#3CC51F',
21 | // 是否展示取消
22 | showCancel = false,
23 | // 取消按钮文案
24 | cancelText = '取消',
25 | // 取消按钮颜色
26 | cancelColor = '#333'
27 | } = options;
28 |
29 | // 处理默认按钮的展示
30 | // 纵向排布确认按钮在上方
31 | let showCustomBtns = false;
32 | if (buttons.length === 0) {
33 | if (showConfirm) {
34 | buttons.push({
35 | type: 'confirm',
36 | text: confirmText,
37 | color: confirmColor
38 | });
39 | }
40 |
41 | if (showCancel) {
42 | const cancelButton = {
43 | type: 'cancel',
44 | text: cancelText,
45 | color: cancelColor
46 | };
47 | if (buttonsShowVertical) {
48 | buttons.push(cancelButton);
49 | } else {
50 | buttons.unshift(cancelButton);
51 | }
52 | }
53 | } else {
54 | showCustomBtns = true;
55 | }
56 |
57 | return new Promise((resolve, reject) => {
58 | this.setData({
59 | zanDialog: {
60 | show: true,
61 | showCustomBtns,
62 | buttons,
63 | title,
64 | content,
65 | buttonsShowVertical,
66 | showConfirm,
67 | confirmText,
68 | confirmColor,
69 | showCancel,
70 | cancelText,
71 | cancelColor,
72 | // 回调钩子
73 | resolve,
74 | reject
75 | }
76 | });
77 | });
78 | },
79 |
80 | _handleZanDialogButtonClick(e) {
81 | const { currentTarget = {} } = e;
82 | const { dataset = {} } = currentTarget;
83 |
84 | // 获取当次弹出框的信息
85 | const zanDialogData = this.data.zanDialog || {};
86 | const { resolve = _f, reject = _f } = zanDialogData;
87 |
88 | // 重置 zanDialog 里的内容
89 | this.setData({
90 | zanDialog: { show: false }
91 | });
92 |
93 | // 自定义按钮,全部 resolve 形式返回,根据 type 区分点击按钮
94 | if (zanDialogData.showCustomBtns) {
95 | resolve({
96 | type: dataset.type
97 | });
98 | return;
99 | }
100 |
101 | // 默认按钮,确认为 resolve,取消为 reject
102 | if (dataset.type === 'confirm') {
103 | resolve({
104 | type: 'confirm'
105 | });
106 | } else {
107 | reject({
108 | type: 'cancel'
109 | });
110 | }
111 | }
112 | };
113 |
--------------------------------------------------------------------------------
/dist/dialog/index.wxml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
8 | {{ zanDialog.content }}
10 |
12 |
13 |
18 |
19 |
20 |
21 |
22 |
23 |
--------------------------------------------------------------------------------
/dist/dialog/index.wxss:
--------------------------------------------------------------------------------
1 | .zan-dialog--container{position:fixed;top:45%;left:50%;width:80%;height:0;font-size:16px;overflow:hidden;transition:all .2s linear;border-radius:4px;background-color:#fff;transform:translate3d(-50%,-50%,0);color:#333;opacity:0}.zan-dialog--mask{position:fixed;width:100%;height:100%;top:0;left:0;background-color:rgba(0,0,0,.6);transition:.3s;display:none}.zan-dialog__header{padding:15px 0 0;text-align:center}.zan-dialog__content{position:relative;padding:15px 20px;line-height:1.5;min-height:40px}.zan-dialog__content::after{content:'';position:absolute;top:0;left:0;width:200%;height:200%;transform:scale(.5);transform-origin:0 0;pointer-events:none;box-sizing:border-box;border:0 solid #e5e5e5;border-bottom-width:1px}.zan-dialog__content--title{color:#999;font-size:14px}.zan-dialog__footer{overflow:hidden}.zan-dialog__button{line-height:50px;height:50px;padding:0 5px;border-radius:0;margin-bottom:0}.zan-dialog__button::after{border-width:0;border-radius:0}.zan-dialog--show .zan-dialog--container{opacity:1;height:auto}.zan-dialog--show .zan-dialog--mask{display:block}.zan-dialog__footer--horizon{display:flex}.zan-dialog__footer--horizon .zan-dialog__button{flex:1}.zan-dialog__footer--horizon .zan-dialog__button::after{border-right-width:1px}.zan-dialog__footer--horizon .zan-dialog__button:last-child::after{border-right-width:0}.zan-dialog__footer--vertical .zan-dialog__button{flex:1}.zan-dialog__footer--vertical .zan-dialog__button::after{border-bottom-width:1px}.zan-dialog__footer--vertical .zan-dialog__button:last-child::after{border-bottom-width:0}
--------------------------------------------------------------------------------
/dist/field/index.js:
--------------------------------------------------------------------------------
1 | const { extractComponentId } = require('../common/helper');
2 |
3 | module.exports = {
4 | _handleZanFieldChange(event) {
5 | const componentId = extractComponentId(event);
6 | event.componentId = componentId;
7 |
8 |
9 |
10 | if (this.handleZanFieldChange) {
11 | return this.handleZanFieldChange(event);
12 | }
13 |
14 | console.warn('页面缺少 handleZanFieldChange 回调函数');
15 | },
16 |
17 | _handleZanFieldFocus(event) {
18 | const componentId = extractComponentId(event);
19 | event.componentId = componentId;
20 |
21 |
22 |
23 | if (this.handleZanFieldFocus) {
24 | return this.handleZanFieldFocus(event);
25 | }
26 | },
27 |
28 | _handleZanFieldBlur(event) {
29 | const componentId = extractComponentId(event);
30 | event.componentId = componentId;
31 |
32 |
33 |
34 | if (this.handleZanFieldBlur) {
35 | return this.handleZanFieldBlur(event);
36 | }
37 | }
38 | };
39 |
--------------------------------------------------------------------------------
/dist/field/index.wxml:
--------------------------------------------------------------------------------
1 |
2 |
3 | {{ title }}
6 |
19 |
32 |
33 |
34 |
--------------------------------------------------------------------------------
/dist/field/index.wxss:
--------------------------------------------------------------------------------
1 | .zan-cell{position:relative;padding:12px 15px;display:flex;align-items:center;line-height:1.4;font-size:14px}.zan-cell::after{content:'';position:absolute;top:0;left:0;width:200%;height:200%;transform:scale(.5);transform-origin:0 0;pointer-events:none;box-sizing:border-box;border:0 solid #e5e5e5;border-bottom-width:1px;left:15px;right:0}.zan-cell__icon{margin-right:5px}.zan-cell__bd{flex:1}.zan-cell__text{line-height:24px;font-size:14px}.zan-cell__desc{line-height:1.2;font-size:12px;color:#666}.zan-cell__ft{position:relative;text-align:right;color:#666}.zan-cell__no-pading{padding:0}.zan-cell__no-pading .zan-cell__bd_padding{padding:12px 0 12px 15px}.zan-cell__no-pading .zan-cell__bd_padding .zan-form__input{height:26px}.zan-cell__no-pading .zan-cell__ft_padding{padding:12px 15px 12px 0}.zan-cell--last-child::after,.zan-cell:last-child::after{display:none}.zan-cell--access .zan-cell__ft{padding-right:13px}.zan-cell--access .zan-cell__ft::after{position:absolute;top:50%;right:2px;content:" ";display:inline-block;height:6px;width:6px;border-width:2px 2px 0 0;border-color:#c8c8c8;border-style:solid;transform:translateY(-50%) matrix(.71,.71,-.71,.71,0,0)}.zan-cell--switch{padding-top:6px;padding-bottom:6px}.zan-field{padding:7px 15px;color:#333}.zan-field--wrapped{margin:0 15px;background-color:#fff}.zan-field--wrapped::after{left:0;border-width:1px;border-radius:4px}.zan-field.zan-field--wrapped::after{display:block}.zan-field--wrapped+.zan-field--wrapped{margin-top:10px}.zan-field--error{color:#f40}.zan-field--wrapped.zan-field--error::after{border-color:#f40}.zan-field__title{color:#333;min-width:65px;padding-right:10px}.zan-field__input{flex:1;line-height:1.6;padding:4px 0;min-height:22px;height:auto;font-size:14px}.zan-field__placeholder{font-size:14px}.zan-field__input--right{text-align:right}
--------------------------------------------------------------------------------
/dist/helper/index.wxss:
--------------------------------------------------------------------------------
1 | .zan-pull-left{float:left}.zan-pull-right{float:right}.zan-center{text-align:center}.zan-right{text-align:right}.zan-text-deleted{text-decoration:line-through}.zan-font-8{font-size:8px}.zan-font-10{font-size:10px}.zan-font-12{font-size:12px}.zan-font-14{font-size:14px}.zan-font-16{font-size:16px}.zan-font-18{font-size:18px}.zan-font-20{font-size:20px}.zan-font-22{font-size:22px}.zan-font-24{font-size:22px}.zan-font-30{font-size:30px}.zan-font-bold{font-weight:700}.zan-arrow{position:absolute;right:15px;top:50%;display:inline-block;height:6px;width:6px;border-width:2px 2px 0 0;border-color:#c8c8c8;border-style:solid;transform:translateY(-50%) matrix(.71,.71,-.71,.71,0,0)}.zan-ellipsis{overflow:hidden;text-overflow:ellipsis;white-space:nowrap;word-wrap:normal}.zan-ellipsis--l2{max-height:40px;line-height:20px;overflow:hidden;text-overflow:ellipsis;display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical}.zan-ellipsis--l3{max-height:60px;line-height:20px;overflow:hidden;text-overflow:ellipsis;display:-webkit-box;-webkit-line-clamp:3;-webkit-box-orient:vertical}.zan-clearfix{zoom:1}.zan-clearfix::after{content:'';display:table;clear:both}.zan-hairline,.zan-hairline--bottom,.zan-hairline--left,.zan-hairline--right,.zan-hairline--surround,.zan-hairline--top,.zan-hairline--top-bottom{position:relative}.zan-hairline--bottom::after,.zan-hairline--left::after,.zan-hairline--right::after,.zan-hairline--surround::after,.zan-hairline--top-bottom::after,.zan-hairline--top::after,.zan-hairline::after{content:'';position:absolute;top:0;left:0;width:200%;height:200%;transform:scale(.5);transform-origin:0 0;pointer-events:none;box-sizing:border-box;border:0 solid #e5e5e5}.zan-hairline--top::after{border-top-width:1px}.zan-hairline--left::after{border-left-width:1px}.zan-hairline--right::after{border-right-width:1px}.zan-hairline--bottom::after{border-bottom-width:1px}.zan-hairline--top-bottom::after{border-width:1px 0}.zan-hairline--surround::after{border-width:1px}
--------------------------------------------------------------------------------
/dist/icon/index.wxss:
--------------------------------------------------------------------------------
1 | @font-face{font-family:zanui-weapp-icon;src:url(https://b.yzcdn.cn/zanui-weapp/zanui-weapp-icon-4381aded05.eot);src:url(https://b.yzcdn.cn/zanui-weapp/zanui-weapp-icon-4381aded05.eot?#iefix) format('embedded-opentype'),url(https://b.yzcdn.cn/zanui-weapp/zanui-weapp-icon-4381aded05.woff2) format('woff2'),url(https://b.yzcdn.cn/zanui-weapp/zanui-weapp-icon-4381aded05.woff) format('woff'),url(https://b.yzcdn.cn/zanui-weapp/zanui-weapp-icon-4381aded05.ttf) format('truetype')}.zan-icon{display:inline-block}.zan-icon::before{font-family:zanui-weapp-icon!important;font-style:normal;font-weight:400;speak:none;display:inline-block;text-decoration:inherit;width:1em;text-align:center;font-variant:normal;text-transform:none;line-height:1em;-webkit-font-smoothing:antialiased}.zan-icon-qr-invalid:before{content:'\e800'}.zan-icon-qr:before{content:'\e801'}.zan-icon-exchange:before{content:'\e802'}.zan-icon-close:before{content:'\e803'}.zan-icon-location:before{content:'\e804'}.zan-icon-upgrade:before{content:'\e805'}.zan-icon-check:before{content:'\e806'}.zan-icon-checked:before{content:'\e807'}.zan-icon-like-o:before{content:'\e808'}.zan-icon-like:before{content:'\e809'}.zan-icon-chat:before{content:'\e80a'}.zan-icon-shop:before{content:'\e80b'}.zan-icon-photograph:before{content:'\e80c'}.zan-icon-add:before{content:'\e80d'}.zan-icon-add2:before{content:'\e80e'}.zan-icon-photo:before{content:'\e80f'}.zan-icon-logistics:before{content:'\e810'}.zan-icon-edit:before{content:'\e811'}.zan-icon-passed:before{content:'\e812'}.zan-icon-cart:before{content:'\e813'}.zan-icon-shopping-cart:before{content:'\e814'}.zan-icon-arrow:before{content:'\e815'}.zan-icon-gift:before{content:'\e816'}.zan-icon-search:before{content:'\e817'}.zan-icon-clear:before{content:'\e818'}.zan-icon-success:before{content:'\e819'}.zan-icon-fail:before{content:'\e81a'}.zan-icon-contact:before{content:'\e81b'}.zan-icon-wechat:before{content:'\e81c'}.zan-icon-alipay:before{content:'\e81d'}.zan-icon-password-view:before{content:'\e81e'}.zan-icon-password-not-view:before{content:'\e81f'}.zan-icon-wap-nav:before{content:'\e820'}.zan-icon-wap-home:before{content:'\e821'}.zan-icon-ecard-pay:before{content:'\e822'}.zan-icon-balance-pay:before{content:'\e823'}.zan-icon-peer-pay:before{content:'\e824'}.zan-icon-credit-pay:before{content:'\e825'}.zan-icon-debit-pay:before{content:'\e826'}.zan-icon-other-pay:before{content:'\e827'}.zan-icon-browsing-history:before{content:'\e828'}.zan-icon-goods-collect:before{content:'\e829'}.zan-icon-shop-collect:before{content:'\e82a'}.zan-icon-receive-gift:before{content:'\e82b'}.zan-icon-send-gift:before{content:'\e82c'}.zan-icon-setting:before{content:'\e82d'}.zan-icon-points:before{content:'\e82e'}.zan-icon-coupon:before{content:'\e82f'}.zan-icon-free-postage:before{content:'\e830'}.zan-icon-discount:before{content:'\e831'}.zan-icon-birthday-privilege:before{content:'\e832'}.zan-icon-member-day-privilege:before{content:'\e833'}.zan-icon-balance-details:before{content:'\e834'}.zan-icon-cash-back-record:before{content:'\e835'}.zan-icon-points-mall:before{content:'\e836'}.zan-icon-exchange-record:before{content:'\e837'}.zan-icon-pending-payment:before{content:'\e838'}.zan-icon-pending-orders:before{content:'\e839'}.zan-icon-pending-deliver:before{content:'\e83a'}.zan-icon-pending-evaluate:before{content:'\e83b'}.zan-icon-gift-card-pay:before{content:'\e83c'}.zan-icon-cash-on-deliver:before{content:'\e83d'}.zan-icon-underway:before{content:'\e83e'}.zan-icon-point-gift:before{content:'\e83f'}.zan-icon-after-sale:before{content:'\e840'}.zan-icon-edit-data:before{content:'\e841'}.zan-icon-question:before{content:'\e842'}.zan-icon-delete:before{content:'\e843'}.zan-icon-records:before{content:'\e844'}.zan-icon-description:before{content:'\e845'}.zan-icon-card:before{content:'\e846'}.zan-icon-gift-card:before{content:'\e847'}.zan-icon-clock:before{content:'\e848'}.zan-icon-gold-coin:before{content:'\e849'}.zan-icon-completed:before{content:'\e84a'}.zan-icon-value-card:before{content:'\e84b'}.zan-icon-certificate:before{content:'\e84c'}.zan-icon-tosend:before{content:'\e84d'}.zan-icon-sign:before{content:'\e84e'}.zan-icon-home:before{content:'\e84f'}.zan-icon-phone:before{content:'\e850'}.zan-icon-add-o:before{content:'\e851'}.zan-icon-play:before{content:'\e852'}.zan-icon-pause:before{content:'\e853'}.zan-icon-stop:before{content:'\e854'}.zan-icon-hot:before{content:'\e855'}.zan-icon-new:before{content:'\e856'}.zan-icon-new-arrival:before{content:'\e857'}.zan-icon-hot-sale:before{content:'\e858'}
--------------------------------------------------------------------------------
/dist/index.js:
--------------------------------------------------------------------------------
1 | exports.Actionsheet = require('./actionsheet/index');
2 | exports.Dialog = require('./dialog/index');
3 | exports.Field = require('./field/index');
4 | exports.NoticeBar = require('./noticebar/index');
5 | exports.Select = require('./select/index');
6 | exports.Stepper = require('./stepper/index');
7 | exports.Switch = require('./switch/index');
8 | exports.Tab = require('./tab/index');
9 | exports.Toast = require('./toast/index');
10 | exports.TopTips = require('./toptips/index');
11 |
12 | // 兼容老版本,在下次大版本发布时会被移除
13 | exports.CheckLabel = require('./select/index');
14 |
15 | const { extend } = require('./common/helper');
16 | exports.extend = extend;
17 |
--------------------------------------------------------------------------------
/dist/loadmore/index.wxml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 | {{ nodata_str || '暂无数据' }}
14 |
15 |
16 |
17 |
18 |
19 |
20 | 加载中...
21 |
22 |
23 |
24 |
25 |
--------------------------------------------------------------------------------
/dist/loadmore/index.wxss:
--------------------------------------------------------------------------------
1 | .zan-loadmore{position:relative;width:65%;margin:21px auto;line-height:20px;font-size:14px;text-align:center;vertical-align:middle}.zan-loading{width:20px;height:20px;display:inline-block;vertical-align:middle;animation:weuiLoading 1s steps(12,end) infinite;background:transparent url(data:image/svg+xml;base64,PHN2ZyBjbGFzcz0iciIgd2lkdGg9JzEyMHB4JyBoZWlnaHQ9JzEyMHB4JyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZpZXdCb3g9IjAgMCAxMDAgMTAwIj4KICAgIDxyZWN0IHg9IjAiIHk9IjAiIHdpZHRoPSIxMDAiIGhlaWdodD0iMTAwIiBmaWxsPSJub25lIiBjbGFzcz0iYmsiPjwvcmVjdD4KICAgIDxyZWN0IHg9JzQ2LjUnIHk9JzQwJyB3aWR0aD0nNycgaGVpZ2h0PScyMCcgcng9JzUnIHJ5PSc1JyBmaWxsPScjRTlFOUU5JwogICAgICAgICAgdHJhbnNmb3JtPSdyb3RhdGUoMCA1MCA1MCkgdHJhbnNsYXRlKDAgLTMwKSc+CiAgICA8L3JlY3Q+CiAgICA8cmVjdCB4PSc0Ni41JyB5PSc0MCcgd2lkdGg9JzcnIGhlaWdodD0nMjAnIHJ4PSc1JyByeT0nNScgZmlsbD0nIzk4OTY5NycKICAgICAgICAgIHRyYW5zZm9ybT0ncm90YXRlKDMwIDUwIDUwKSB0cmFuc2xhdGUoMCAtMzApJz4KICAgICAgICAgICAgICAgICByZXBlYXRDb3VudD0naW5kZWZpbml0ZScvPgogICAgPC9yZWN0PgogICAgPHJlY3QgeD0nNDYuNScgeT0nNDAnIHdpZHRoPSc3JyBoZWlnaHQ9JzIwJyByeD0nNScgcnk9JzUnIGZpbGw9JyM5Qjk5OUEnCiAgICAgICAgICB0cmFuc2Zvcm09J3JvdGF0ZSg2MCA1MCA1MCkgdHJhbnNsYXRlKDAgLTMwKSc+CiAgICAgICAgICAgICAgICAgcmVwZWF0Q291bnQ9J2luZGVmaW5pdGUnLz4KICAgIDwvcmVjdD4KICAgIDxyZWN0IHg9JzQ2LjUnIHk9JzQwJyB3aWR0aD0nNycgaGVpZ2h0PScyMCcgcng9JzUnIHJ5PSc1JyBmaWxsPScjQTNBMUEyJwogICAgICAgICAgdHJhbnNmb3JtPSdyb3RhdGUoOTAgNTAgNTApIHRyYW5zbGF0ZSgwIC0zMCknPgogICAgPC9yZWN0PgogICAgPHJlY3QgeD0nNDYuNScgeT0nNDAnIHdpZHRoPSc3JyBoZWlnaHQ9JzIwJyByeD0nNScgcnk9JzUnIGZpbGw9JyNBQkE5QUEnCiAgICAgICAgICB0cmFuc2Zvcm09J3JvdGF0ZSgxMjAgNTAgNTApIHRyYW5zbGF0ZSgwIC0zMCknPgogICAgPC9yZWN0PgogICAgPHJlY3QgeD0nNDYuNScgeT0nNDAnIHdpZHRoPSc3JyBoZWlnaHQ9JzIwJyByeD0nNScgcnk9JzUnIGZpbGw9JyNCMkIyQjInCiAgICAgICAgICB0cmFuc2Zvcm09J3JvdGF0ZSgxNTAgNTAgNTApIHRyYW5zbGF0ZSgwIC0zMCknPgogICAgPC9yZWN0PgogICAgPHJlY3QgeD0nNDYuNScgeT0nNDAnIHdpZHRoPSc3JyBoZWlnaHQ9JzIwJyByeD0nNScgcnk9JzUnIGZpbGw9JyNCQUI4QjknCiAgICAgICAgICB0cmFuc2Zvcm09J3JvdGF0ZSgxODAgNTAgNTApIHRyYW5zbGF0ZSgwIC0zMCknPgogICAgPC9yZWN0PgogICAgPHJlY3QgeD0nNDYuNScgeT0nNDAnIHdpZHRoPSc3JyBoZWlnaHQ9JzIwJyByeD0nNScgcnk9JzUnIGZpbGw9JyNDMkMwQzEnCiAgICAgICAgICB0cmFuc2Zvcm09J3JvdGF0ZSgyMTAgNTAgNTApIHRyYW5zbGF0ZSgwIC0zMCknPgogICAgPC9yZWN0PgogICAgPHJlY3QgeD0nNDYuNScgeT0nNDAnIHdpZHRoPSc3JyBoZWlnaHQ9JzIwJyByeD0nNScgcnk9JzUnIGZpbGw9JyNDQkNCQ0InCiAgICAgICAgICB0cmFuc2Zvcm09J3JvdGF0ZSgyNDAgNTAgNTApIHRyYW5zbGF0ZSgwIC0zMCknPgogICAgPC9yZWN0PgogICAgPHJlY3QgeD0nNDYuNScgeT0nNDAnIHdpZHRoPSc3JyBoZWlnaHQ9JzIwJyByeD0nNScgcnk9JzUnIGZpbGw9JyNEMkQyRDInCiAgICAgICAgICB0cmFuc2Zvcm09J3JvdGF0ZSgyNzAgNTAgNTApIHRyYW5zbGF0ZSgwIC0zMCknPgogICAgPC9yZWN0PgogICAgPHJlY3QgeD0nNDYuNScgeT0nNDAnIHdpZHRoPSc3JyBoZWlnaHQ9JzIwJyByeD0nNScgcnk9JzUnIGZpbGw9JyNEQURBREEnCiAgICAgICAgICB0cmFuc2Zvcm09J3JvdGF0ZSgzMDAgNTAgNTApIHRyYW5zbGF0ZSgwIC0zMCknPgogICAgPC9yZWN0PgogICAgPHJlY3QgeD0nNDYuNScgeT0nNDAnIHdpZHRoPSc3JyBoZWlnaHQ9JzIwJyByeD0nNScgcnk9JzUnIGZpbGw9JyNFMkUyRTInCiAgICAgICAgICB0cmFuc2Zvcm09J3JvdGF0ZSgzMzAgNTAgNTApIHRyYW5zbGF0ZSgwIC0zMCknPgogICAgPC9yZWN0Pgo8L3N2Zz4=) no-repeat;-webkit-background-size:100%;background-size:100%}.zan-loadmore .zan-loading{margin-right:4px}.zan-loadmore__tips{display:inline-block;vertical-align:middle;height:20px;line-height:20px}.zan-loadmore--nodata,.zan-loadmore--nomore{color:#999}.zan-loadmore--nodata::after,.zan-loadmore--nomore::after{content:'';position:absolute;top:0;left:0;width:200%;height:200%;transform:scale(.5);transform-origin:0 0;pointer-events:none;box-sizing:border-box;border:0 solid #e5e5e5;border-top-width:1px}.zan-loadmore--nodata{margin-top:120px}.zan-loadmore--nodata .zan-loadmore__tips{position:relative;top:-11px;background:#f9f9f9;padding:0 6px;z-index:1}.zan-loadmore--nomore .zan-loadmore__tips{position:relative;top:-11px;background:#f9f9f9;padding:0 6px;z-index:1}.zan-loadmore__dot{position:absolute;left:50%;top:10px;margin-left:-2px;margin-top:-2px;content:" ";width:4px;height:4px;border-radius:50%;background-color:#e5e5e5;display:inline-block;vertical-align:middle}
--------------------------------------------------------------------------------
/dist/noticebar/index.js:
--------------------------------------------------------------------------------
1 | const ZanNoticeBar = {
2 | initZanNoticeBarScroll(componentId) {
3 | this.zanNoticeBarNode = this.zanNoticeBarNode || {};
4 | this.zanNoticeBarNode[`${componentId}`] = {
5 | width: undefined,
6 | wrapWidth: undefined,
7 | animation: null,
8 | resetAnimation: null
9 | };
10 |
11 | const currentComponent = this.zanNoticeBarNode[`${componentId}`];
12 | wx.createSelectorQuery()
13 | .in(this)
14 | .select(`#${componentId}__content`)
15 | .boundingClientRect((rect) => {
16 | if (!rect || !rect.width) {
17 | console.warn('页面缺少 noticebar 元素');
18 | return;
19 | }
20 |
21 | currentComponent.width = rect.width;
22 | wx
23 | .createSelectorQuery()
24 | .in(this)
25 | .select(`#${componentId}__content-wrap`)
26 | .boundingClientRect((rect) => {
27 | if (!rect || !rect.width) {
28 | return;
29 | }
30 |
31 | currentComponent.wrapWidth = rect.width;
32 | if (currentComponent.wrapWidth < currentComponent.width) {
33 | var mstime = currentComponent.width / 40 * 1000;
34 | currentComponent.animation = wx.createAnimation({
35 | duration: mstime,
36 | timingFunction: 'linear'
37 | });
38 | currentComponent.resetAnimation = wx.createAnimation({
39 | duration: 0,
40 | timingFunction: 'linear'
41 | });
42 | this.scrollZanNoticeBar(componentId, mstime);
43 | }
44 | })
45 | .exec();
46 | })
47 | .exec();
48 | },
49 |
50 | scrollZanNoticeBar(componentId, mstime) {
51 | const currentComponent = this.zanNoticeBarNode[`${componentId}`];
52 | const resetAnimationData = currentComponent.resetAnimation.translateX(currentComponent.wrapWidth).step();
53 | this.setData({
54 | [`${componentId}.animationData`]: resetAnimationData.export()
55 | });
56 | const aninationData = currentComponent.animation.translateX(-mstime * 40 / 1000).step();
57 | setTimeout(() => {
58 | this.setData({
59 | [`${componentId}.animationData`]: aninationData.export()
60 | });
61 | }, 100);
62 |
63 | setTimeout(() => {
64 | this.scrollZanNoticeBar(componentId, mstime);
65 | }, mstime);
66 | }
67 | };
68 |
69 | module.exports = ZanNoticeBar;
70 |
--------------------------------------------------------------------------------
/dist/noticebar/index.wxml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
7 |
12 | {{ text }}
13 |
14 |
15 |
16 |
17 |
--------------------------------------------------------------------------------
/dist/noticebar/index.wxss:
--------------------------------------------------------------------------------
1 | .zan-noticebar{color:#f60;padding:9px 10px;font-size:12px;line-height:1.5;background-color:#fff7cc}
--------------------------------------------------------------------------------
/dist/panel/index.wxss:
--------------------------------------------------------------------------------
1 | .zan-panel{position:relative;background:#fff;margin-top:10px;overflow:hidden}.zan-panel::after{content:'';position:absolute;top:0;left:0;width:200%;height:200%;transform:scale(.5);transform-origin:0 0;pointer-events:none;box-sizing:border-box;border:0 solid #e5e5e5;border-top-width:1px;border-bottom-width:1px}.zan-panel-title{font-size:14px;line-height:1;color:#999;padding:20px 15px 0 15px}.zan-panel--without-margin-top{margin-top:0}.zan-panel--without-border::after{border:0 none}
--------------------------------------------------------------------------------
/dist/popup/index.wxss:
--------------------------------------------------------------------------------
1 | .zan-popup{visibility:hidden}.zan-popup--show{visibility:visible}.zan-popup__mask{position:fixed;top:0;left:0;right:0;bottom:0;z-index:10;background:rgba(0,0,0,.7);display:none}.zan-popup__container{position:fixed;left:50%;top:50%;background:#fff;transform:translate3d(-50%,-50%,0);transform-origin:center;transition:all .4s ease;z-index:11;opacity:0}.zan-popup--show .zan-popup__container{opacity:1}.zan-popup--show .zan-popup__mask{display:block}.zan-popup--left .zan-popup__container{left:0;top:auto;transform:translate3d(-100%,0,0)}.zan-popup--show.zan-popup--left .zan-popup__container{transform:translate3d(0,0,0)}.zan-popup--right .zan-popup__container{right:0;top:auto;left:auto;transform:translate3d(100%,0,0)}.zan-popup--show.zan-popup--right .zan-popup__container{transform:translate3d(0,0,0)}.zan-popup--bottom .zan-popup__container{top:auto;left:auto;bottom:0;transform:translate3d(0,100%,0)}.zan-popup--show.zan-popup--bottom .zan-popup__container{transform:translate3d(0,0,0)}.zan-popup--top .zan-popup__container{top:0;left:auto;transform:translate3d(0,-100%,0)}.zan-popup--show.zan-popup--top .zan-popup__container{transform:translate3d(0,0,0)}
--------------------------------------------------------------------------------
/dist/row/index.wxss:
--------------------------------------------------------------------------------
1 | .zan-row:after{content:"";display:table;clear:both}
--------------------------------------------------------------------------------
/dist/select/index.js:
--------------------------------------------------------------------------------
1 | const { extractComponentId } = require('../common/helper');
2 |
3 | function handle(e) {
4 | const componentId = extractComponentId(e);
5 | const value = e.detail.value;
6 |
7 | callback.call(this, componentId, value);
8 | }
9 |
10 | function callback(componentId, value) {
11 | const e = { componentId, value };
12 |
13 |
14 | if (this.handleZanSelectChange) {
15 | this.handleZanSelectChange(e);
16 | } else {
17 | console.warn('页面缺少 handleZanSelectChange 回调函数');
18 | }
19 | }
20 |
21 | module.exports = {
22 | _handleZanSelectChange(e) {
23 | handle.call(this, e);
24 | }
25 | };
26 |
--------------------------------------------------------------------------------
/dist/select/index.wxml:
--------------------------------------------------------------------------------
1 |
2 |
8 |
20 |
21 |
22 |
23 |
24 | function getColor(color) {
25 | color = color || '#ff4444'
26 | return color;
27 | }
28 |
29 | module.exports = {
30 | getColor: getColor,
31 | getItemStyle: function(item, checkedValue, activeColor) {
32 | var padding = item.padding * 10;
33 | var style = 'padding-left: ' + padding + 'px;';
34 |
35 | // 如果为选中状态,则高亮
36 | if (item.value === checkedValue) {
37 | style += 'color: ' + getColor(activeColor);
38 | }
39 |
40 | return style;
41 | }
42 | };
43 |
44 |
--------------------------------------------------------------------------------
/dist/select/index.wxss:
--------------------------------------------------------------------------------
1 | .zan-select__list .zan-select__radio{display:none}
--------------------------------------------------------------------------------
/dist/stepper/index.js:
--------------------------------------------------------------------------------
1 | function handle(e, num) {
2 | var dataset = e.currentTarget.dataset;
3 | var componentId = dataset.componentId;
4 | var disabled = dataset.disabled;
5 | var stepper = +dataset.stepper;
6 |
7 | if (disabled) return null;
8 |
9 | callback.call(this, componentId, stepper + num);
10 | }
11 |
12 | function callback(componentId, stepper) {
13 | stepper = +stepper;
14 | var e = { componentId, stepper };
15 |
16 |
17 | if (this.handleZanStepperChange) {
18 | this.handleZanStepperChange(e);
19 | } else {
20 | console.warn('页面缺少 handleZanStepperChange 回调函数');
21 | }
22 | }
23 |
24 | var Stepper = {
25 | _handleZanStepperMinus(e) {
26 | handle.call(this, e, -1);
27 | },
28 |
29 | _handleZanStepperPlus(e) {
30 | handle.call(this, e, +1);
31 | },
32 |
33 | _handleZanStepperBlur(e) {
34 | var dataset = e.currentTarget.dataset;
35 | var componentId = dataset.componentId;
36 | var max = +dataset.max;
37 | var min = +dataset.min;
38 | var value = e.detail.value;
39 |
40 | if (!value) {
41 | setTimeout(() => {
42 | callback.call(this, componentId, min);
43 | }, 16);
44 | callback.call(this, componentId, value);
45 | return '' + value;
46 | }
47 |
48 | value = +value;
49 | if (value > max) {
50 | value = max;
51 | } else if (value < min) {
52 | value = min;
53 | }
54 |
55 | callback.call(this, componentId, value);
56 |
57 | return '' + value;
58 | }
59 | };
60 |
61 | module.exports = Stepper;
62 |
--------------------------------------------------------------------------------
/dist/stepper/index.wxml:
--------------------------------------------------------------------------------
1 |
2 |
3 | -
10 |
20 | +
27 |
28 |
29 |
--------------------------------------------------------------------------------
/dist/stepper/index.wxss:
--------------------------------------------------------------------------------
1 | .zan-stepper{color:#666}.zan-stepper view{display:inline-block;line-height:20px;padding:5px 0;text-align:center;min-width:40px;box-sizing:border-box;vertical-align:middle;font-size:12px;border:1rpx solid #999}.zan-stepper .zan-stepper__minus{border-right:none;border-radius:2px 0 0 2px}.zan-stepper .zan-stepper__text{border:1rpx solid #999;display:inline-block;text-align:center;vertical-align:middle;height:30px;width:40px;min-height:auto;font-size:12px;line-height:30px}.zan-stepper .zan-stepper__plus{border-left:none;border-radius:0 2px 2px 0}.zan-stepper .zan-stepper--disabled{background:#f8f8f8;color:#bbb;border-color:#e8e8e8}.zan-stepper--small view{min-width:36px;line-height:18px}.zan-stepper--small .zan-stepper__text{width:36px;line-height:28px;height:28px}
--------------------------------------------------------------------------------
/dist/steps/index.wxml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
7 | {{ step.text }}
8 | {{ step.desc }}
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
--------------------------------------------------------------------------------
/dist/steps/index.wxss:
--------------------------------------------------------------------------------
1 | .zan-steps--steps.zan-steps--5 .zan-steps__step{width:25%}.zan-steps--steps.zan-steps--4 .zan-steps__step{width:33%}.zan-steps--steps.zan-steps--3 .zan-steps__step{width:50%}.zan-steps--steps .zan-steps__step{position:relative;float:left;padding-bottom:25px;color:#b1b1b1}.zan-steps--steps .zan-steps__title{transform:translateX(-50%);font-size:10px;text-align:center}.zan-steps--steps .zan-steps__icons{position:absolute;top:30px;left:-10px;padding:0 8px;background-color:#fff;z-index:10}.zan-steps--steps .zan-steps__circle{display:block;position:relative;width:5px;height:5px;background-color:#e5e5e5;border-radius:50%}.zan-steps--steps .zan-steps__line{position:absolute;left:0;top:32px;width:100%;height:1px;background-color:#e5e5e5}.zan-steps--steps .zan-steps__step--done{color:#333}.zan-steps--steps .zan-steps__step--done .zan-steps__line{background-color:#06bf04}.zan-steps--steps .zan-steps__step--done .zan-steps__circle{width:5px;height:5px;background-color:#09bb07}.zan-steps--steps .zan-steps__step--cur .zan-steps__icons{top:25px;left:-14px}.zan-steps--steps .zan-steps__step--cur .zan-steps__circle{width:13px;height:13px;background-image:url(https://b.yzcdn.cn/v2/image/wap/success_small@2x.png);background-size:13px 13px}.zan-steps--steps .zan-steps__step--cur .zan-steps__line{background-color:#e5e5e5}.zan-steps--steps .zan-steps__step--first-child .zan-steps__title{margin-left:0;transform:none;text-align:left}.zan-steps--steps .zan-steps__step--first-child .zan-steps__icons{left:-7px}.zan-steps--steps .zan-steps__step--last-child{position:absolute;right:0;top:0;text-align:right}.zan-steps--steps .zan-steps__step--last-child .zan-steps__title{transform:none;text-align:right}.zan-steps--steps .zan-steps__step--last-child .zan-steps__icons{left:auto;right:-6px}.zan-steps--steps .zan-steps__step--last-child .zan-steps__line{display:none}.zan-steps--steps .zan-steps__step--db-title{min-height:29px}.zan-steps--steps .zan-steps__step--db-title .zan-steps__line{top:45px}.zan-steps--steps .zan-steps__step--db-title .zan-steps__icons{top:43px}.zan-steps--steps .zan-steps__step--db-title.zan-steps__step--cur .zan-steps__icons{top:39px}.zan-steps--vsteps{color:#999;font-size:14px}.zan-steps--vsteps .zan-steps__step{position:relative;padding:15px 0}.zan-steps--vsteps .zan-steps__step--done{color:#4b0}.zan-steps--vsteps .zan-steps__line{position:absolute;top:0;bottom:0;left:7px;width:1px;background-color:#e5e5e5}.zan-steps--vsteps .zan-steps__title{display:inline-block;line-height:20px;padding-left:27px}.zan-steps--vsteps .zan-steps__title--desc{padding-left:3px}.zan-steps--vsteps .zan-steps__icons{position:absolute;left:7px;top:50%;transform:translate(-50%,-50%);z-index:2;padding:3px 0;background-color:#fff}.zan-steps--vsteps .zan-steps__circle{width:5px;height:5px;background-color:#cacaca;border-radius:10px}.zan-steps--vsteps .zan-steps__step--done .zan-steps__circle{width:5px;height:5px;background-color:#09bb07}.zan-steps--vsteps .zan-steps__step--cur .zan-steps__circle{width:13px;height:13px;background:transparent url(https://b.yzcdn.cn/v2/image/wap/success_small@2x.png);background-size:13px 13px;border-radius:0}.zan-steps--vsteps .zan-steps__icon--active{width:13px;height:13px}.zan-steps--vsteps .zan-steps__step--first-child .zan-steps__title::before{content:'';position:absolute;top:0;bottom:50%;left:7px;width:1px;background-color:#fff;z-index:1}.zan-steps--vsteps .zan-steps__step--last-child .zan-steps__title::after{content:'';position:absolute;top:50%;bottom:0;left:7px;width:1px;background-color:#fff;z-index:1}.zan-steps{position:relative}
--------------------------------------------------------------------------------
/dist/steps/wxss/step.wxss:
--------------------------------------------------------------------------------
1 | .zan-steps--steps.zan-steps--5 .zan-steps__step{width:25%}.zan-steps--steps.zan-steps--4 .zan-steps__step{width:33%}.zan-steps--steps.zan-steps--3 .zan-steps__step{width:50%}.zan-steps--steps .zan-steps__step{position:relative;float:left;padding-bottom:25px;color:#b1b1b1}.zan-steps--steps .zan-steps__title{transform:translateX(-50%);font-size:10px;text-align:center}.zan-steps--steps .zan-steps__icons{position:absolute;top:30px;left:-10px;padding:0 8px;background-color:#fff;z-index:10}.zan-steps--steps .zan-steps__circle{display:block;position:relative;width:5px;height:5px;background-color:#e5e5e5;border-radius:50%}.zan-steps--steps .zan-steps__line{position:absolute;left:0;top:32px;width:100%;height:1px;background-color:#e5e5e5}.zan-steps--steps .zan-steps__step--done{color:#333}.zan-steps--steps .zan-steps__step--done .zan-steps__line{background-color:#06bf04}.zan-steps--steps .zan-steps__step--done .zan-steps__circle{width:5px;height:5px;background-color:#09bb07}.zan-steps--steps .zan-steps__step--cur .zan-steps__icons{top:25px;left:-14px}.zan-steps--steps .zan-steps__step--cur .zan-steps__circle{width:13px;height:13px;background-image:url(https://b.yzcdn.cn/v2/image/wap/success_small@2x.png);background-size:13px 13px}.zan-steps--steps .zan-steps__step--cur .zan-steps__line{background-color:#e5e5e5}.zan-steps--steps .zan-steps__step--first-child .zan-steps__title{margin-left:0;transform:none;text-align:left}.zan-steps--steps .zan-steps__step--first-child .zan-steps__icons{left:-7px}.zan-steps--steps .zan-steps__step--last-child{position:absolute;right:0;top:0;text-align:right}.zan-steps--steps .zan-steps__step--last-child .zan-steps__title{transform:none;text-align:right}.zan-steps--steps .zan-steps__step--last-child .zan-steps__icons{left:auto;right:-6px}.zan-steps--steps .zan-steps__step--last-child .zan-steps__line{display:none}.zan-steps--steps .zan-steps__step--db-title{min-height:29px}.zan-steps--steps .zan-steps__step--db-title .zan-steps__line{top:45px}.zan-steps--steps .zan-steps__step--db-title .zan-steps__icons{top:43px}.zan-steps--steps .zan-steps__step--db-title.zan-steps__step--cur .zan-steps__icons{top:39px}
--------------------------------------------------------------------------------
/dist/steps/wxss/vstep.wxss:
--------------------------------------------------------------------------------
1 | .zan-steps--vsteps{color:#999;font-size:14px}.zan-steps--vsteps .zan-steps__step{position:relative;padding:15px 0}.zan-steps--vsteps .zan-steps__step--done{color:#4b0}.zan-steps--vsteps .zan-steps__line{position:absolute;top:0;bottom:0;left:7px;width:1px;background-color:#e5e5e5}.zan-steps--vsteps .zan-steps__title{display:inline-block;line-height:20px;padding-left:27px}.zan-steps--vsteps .zan-steps__title--desc{padding-left:3px}.zan-steps--vsteps .zan-steps__icons{position:absolute;left:7px;top:50%;transform:translate(-50%,-50%);z-index:2;padding:3px 0;background-color:#fff}.zan-steps--vsteps .zan-steps__circle{width:5px;height:5px;background-color:#cacaca;border-radius:10px}.zan-steps--vsteps .zan-steps__step--done .zan-steps__circle{width:5px;height:5px;background-color:#09bb07}.zan-steps--vsteps .zan-steps__step--cur .zan-steps__circle{width:13px;height:13px;background:transparent url(https://b.yzcdn.cn/v2/image/wap/success_small@2x.png);background-size:13px 13px;border-radius:0}.zan-steps--vsteps .zan-steps__icon--active{width:13px;height:13px}.zan-steps--vsteps .zan-steps__step--first-child .zan-steps__title::before{content:'';position:absolute;top:0;bottom:50%;left:7px;width:1px;background-color:#fff;z-index:1}.zan-steps--vsteps .zan-steps__step--last-child .zan-steps__title::after{content:'';position:absolute;top:50%;bottom:0;left:7px;width:1px;background-color:#fff;z-index:1}
--------------------------------------------------------------------------------
/dist/switch/index.js:
--------------------------------------------------------------------------------
1 | var Switch = {
2 | _handleZanSwitchChange(e) {
3 | var dataset = e.currentTarget.dataset;
4 |
5 | var checked = !dataset.checked;
6 | var loading = dataset.loading;
7 | var disabled = dataset.disabled;
8 | var componentId = dataset.componentId;
9 |
10 | if (loading || disabled) return;
11 |
12 |
13 |
14 | if (this.handleZanSwitchChange) {
15 | this.handleZanSwitchChange({
16 | checked,
17 | componentId
18 | });
19 | } else {
20 | console.warn('页面缺少 handleZanSwitchChange 回调函数');
21 | }
22 | }
23 | };
24 |
25 | module.exports = Switch;
26 |
--------------------------------------------------------------------------------
/dist/switch/index.wxml:
--------------------------------------------------------------------------------
1 |
2 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
--------------------------------------------------------------------------------
/dist/switch/index.wxss:
--------------------------------------------------------------------------------
1 | .zan-switch{position:relative;display:inline-block;width:52px;height:32px;vertical-align:middle;box-sizing:border-box;border-radius:16px;background:#44db5e;border:1px solid #44db5e}.zan-switch__circle{position:absolute;top:0;left:0;width:30px;height:30px;display:inline-block;background:#fff;border-radius:15px;box-sizing:border-box;box-shadow:0 0 0 1px rgba(0,0,0,.1),0 3px 1px 0 rgba(0,0,0,.05),0 2px 2px 0 rgba(0,0,0,.1),0 3px 3px 0 rgba(0,0,0,.05);transition:transform .35s cubic-bezier(.45,1,.4,1);z-index:2}.zan-switch__bg{position:absolute;top:-1px;left:-1px;width:52px;height:32px;background:#fff;border-radius:26px;display:inline-block;border:1px solid #e5e5e5;box-sizing:border-box;transition:transform .35s cubic-bezier(.45,1,.4,1);transform:scale(0);transform-origin:36px 16px}.zan-switch--on .zan-switch__circle{transform:translateX(20px)}.zan-switch--off .zan-switch__bg{transform:scale(1)}.zan-swtich--disabled{opacity:.4}.zan-switch__loading{position:absolute;left:7px;top:7px;width:16px;height:16px;background:url(https://img.yzcdn.cn/public_files/2017/02/24/9acec77d91106cd15b8107c4633d9155.png) no-repeat;background-size:16px 16px;animation:zan-switch-loading .8s infinite linear}@keyframes zan-switch-loading{from{transform:rotate(0)}to{transform:rotate(360deg)}}
--------------------------------------------------------------------------------
/dist/tab/index.js:
--------------------------------------------------------------------------------
1 | const { extractComponentId } = require('../common/helper');
2 |
3 | var Tab = {
4 | _handleZanTabChange(e) {
5 | const componentId = extractComponentId(e);
6 | const dataset = e.currentTarget.dataset;
7 | const selectedId = dataset.itemId;
8 | const data = { componentId, selectedId };
9 |
10 |
11 | if (this.handleZanTabChange) {
12 | this.handleZanTabChange(data);
13 | } else {
14 | console.warn('页面缺少 handleZanTabChange 回调函数');
15 | }
16 | }
17 | };
18 |
19 | module.exports = Tab;
20 |
--------------------------------------------------------------------------------
/dist/tab/index.wxml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
9 |
12 |
13 |
14 |
15 |
16 |
17 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
35 | {{ item.title }}
36 |
37 |
38 |
--------------------------------------------------------------------------------
/dist/tab/index.wxss:
--------------------------------------------------------------------------------
1 | .zan-tab{height:45px}.zan-tab__bd{width:750rpx;display:flex;flex-direction:row;border-bottom:1rpx solid #e5e5e5;background:#fff}.zan-tab__bd--fixed{position:fixed;top:0;z-index:2}.zan-tab__item{flex:1;display:inline-block;padding:0 10px;line-height:0;box-sizing:border-box;overflow:hidden;text-align:center}.zan-tab__title{display:inline-block;max-width:100%;height:44px;line-height:44px;overflow:hidden;text-overflow:ellipsis;box-sizing:border-box;word-break:keep-all;font-size:14px;color:#666}.zan-tab__item--selected .zan-tab__title{color:#f44;border-bottom:2px solid #f44}.zan-tab__bd--scroll{display:block;white-space:nowrap}.zan-tab__bd--scroll .zan-tab__item{min-width:80px}
--------------------------------------------------------------------------------
/dist/tag/index.wxss:
--------------------------------------------------------------------------------
1 | .zan-tag{display:inline-block;position:relative;box-sizing:border-box;line-height:16px;padding:0 5px;border-radius:2px;font-size:11px;background:#c9c9c9;text-align:center;color:#fff}.zan-tag::after{content:'';position:absolute;top:0;left:0;width:200%;height:200%;transform:scale(.5);transform-origin:0 0;pointer-events:none;box-sizing:border-box;border:0 solid #e5e5e5;border-width:1px;border-radius:4px}.zan-tag--plain{color:#c9c9c9;background:#fff}.zan-tag--primary{color:#fff;background-color:#4b0}.zan-tag--primary::after{border-color:#4b0}.zan-tag--primary.zan-tag--plain{color:#4b0;background:#fff}.zan-tag--danger{color:#fff;background:#f44}.zan-tag--danger::after{border-color:#f44}.zan-tag--danger.zan-tag--plain{color:#f44;background:#fff}.zan-tag--warn{color:#fff;background:#f85}.zan-tag--warn::after{border-color:#f85}.zan-tag--warn.zan-tag--plain{color:#f85;background:#fff}.zan-tag--disabled{color:#999!important;background:#e5e5e5}.zan-tag--disabled::after{border-color:#ccc}
--------------------------------------------------------------------------------
/dist/toast/index.js:
--------------------------------------------------------------------------------
1 | module.exports = {
2 | showZanToast(title, timeout) {
3 | const options = formatParameter(title, timeout);
4 |
5 | // 清除上一轮的计时器
6 | const { timer = 0 } = this.data.zanToast || {};
7 | clearTimeout(timer);
8 |
9 | // 弹层设置~
10 | const zanToast = {
11 | show: true,
12 | icon: options.icon,
13 | image: options.image,
14 | title: options.title
15 | };
16 | this.setData({
17 | zanToast
18 | });
19 |
20 | // 传入的显示时长小于0,就认为需要一直显示
21 | if (timeout < 0) {
22 | return;
23 | }
24 |
25 | // 下一轮计时器
26 | const nextTimer = setTimeout(() => {
27 | this.clearZanToast();
28 | }, timeout || 3000);
29 |
30 | this.setData({
31 | 'zanToast.timer': nextTimer
32 | });
33 | },
34 |
35 | // 清除所有 toast
36 | clearZanToast() {
37 | const { timer = 0 } = this.data.zanToast || {};
38 | clearTimeout(timer);
39 |
40 | this.setData({
41 | 'zanToast.show': false
42 | });
43 | },
44 |
45 | // 快捷方法,显示 loading
46 | showZanLoading(title) {
47 | const options = formatParameter(title);
48 |
49 | this.showZanToast({
50 | ...options,
51 | icon: 'loading'
52 | });
53 | }
54 | };
55 |
56 | function formatParameter(title, timeout = 0) {
57 | // 如果传入的 title 是对象,那么认为所有的配置属性都在这个对象中了
58 | if (typeof title === 'object') {
59 | return title;
60 | }
61 |
62 | return {
63 | title,
64 | timeout
65 | };
66 | }
67 |
--------------------------------------------------------------------------------
/dist/toast/index.wxml:
--------------------------------------------------------------------------------
1 |
2 |
7 |
8 |
11 |
16 |
20 |
21 |
22 |
26 |
27 |
28 |
29 | {{ zanToast.title }}
30 |
31 |
32 |
--------------------------------------------------------------------------------
/dist/toast/index.wxss:
--------------------------------------------------------------------------------
1 | .zan-toast{position:fixed;top:35%;left:50%;transform:translate3d(-50%,-50%,0);background:rgba(0,0,0,.7);color:#fff;font-size:14px;line-height:1.5em;margin:0 auto;box-sizing:border-box;padding:10px 18px;text-align:center;border-radius:4px;z-index:100}.zan-toast--notitle{padding:18px}.zan-toast__icon{width:40px;height:40px;line-height:40px;margin:0 auto;padding:12px 15px;font-size:38px;text-align:center}.zan-toast__icon-loading{line-height:0}.zan-toast__icon-loading .zan-loading{width:40px;height:40px}.zan-toast__icon-image{background-size:40px;background-position:center;background-repeat:no-repeat}
--------------------------------------------------------------------------------
/dist/toptips/index.js:
--------------------------------------------------------------------------------
1 | module.exports = {
2 | showZanTopTips(content = '', options = {}) {
3 | let zanTopTips = this.data.zanTopTips || {};
4 | // 如果已经有一个计时器在了,就清理掉先
5 | if (zanTopTips.timer) {
6 | clearTimeout(zanTopTips.timer);
7 | zanTopTips.timer = 0;
8 | }
9 |
10 | if (typeof options === 'number') {
11 | options = {
12 | duration: options
13 | };
14 | }
15 |
16 | // options参数默认参数扩展
17 | options = Object.assign({
18 | duration: 3000
19 | }, options);
20 |
21 | // 设置定时器,定时关闭topTips
22 | let timer = setTimeout(() => {
23 | this.setData({
24 | 'zanTopTips.show': false,
25 | 'zanTopTips.timer': 0
26 | });
27 | }, options.duration);
28 |
29 | // 展示出topTips
30 | this.setData({
31 | zanTopTips: {
32 | show: true,
33 | content,
34 | options,
35 | timer
36 | }
37 | });
38 | }
39 | };
40 |
--------------------------------------------------------------------------------
/dist/toptips/index.wxml:
--------------------------------------------------------------------------------
1 |
2 | {{ zanTopTips.content }}
3 |
4 |
--------------------------------------------------------------------------------
/dist/toptips/index.wxss:
--------------------------------------------------------------------------------
1 | .zan-toptips{display:block;position:fixed;-webkit-transform:translateZ(0) translateY(-100%);width:100%;min-height:32px;top:0;line-height:2.3;font-size:14px;text-align:center;color:#fff;background-color:#e64340;z-index:110;opacity:0;transition:all .4s ease}.zan-toptips--show{-webkit-transform:translateZ(0) translateY(0);opacity:1}
--------------------------------------------------------------------------------
/img/calendar.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/best-fan/wechat-app-history/9de7e0962cbed3ddf0ca1d67f9798bd6f95104bf/img/calendar.png
--------------------------------------------------------------------------------
/img/express.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/best-fan/wechat-app-history/9de7e0962cbed3ddf0ca1d67f9798bd6f95104bf/img/express.png
--------------------------------------------------------------------------------
/img/index_n.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/best-fan/wechat-app-history/9de7e0962cbed3ddf0ca1d67f9798bd6f95104bf/img/index_n.png
--------------------------------------------------------------------------------
/img/index_p.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/best-fan/wechat-app-history/9de7e0962cbed3ddf0ca1d67f9798bd6f95104bf/img/index_p.png
--------------------------------------------------------------------------------
/img/jiantou.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/best-fan/wechat-app-history/9de7e0962cbed3ddf0ca1d67f9798bd6f95104bf/img/jiantou.png
--------------------------------------------------------------------------------
/img/loginme.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/best-fan/wechat-app-history/9de7e0962cbed3ddf0ca1d67f9798bd6f95104bf/img/loginme.png
--------------------------------------------------------------------------------
/img/more_n.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/best-fan/wechat-app-history/9de7e0962cbed3ddf0ca1d67f9798bd6f95104bf/img/more_n.png
--------------------------------------------------------------------------------
/img/more_p.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/best-fan/wechat-app-history/9de7e0962cbed3ddf0ca1d67f9798bd6f95104bf/img/more_p.png
--------------------------------------------------------------------------------
/img/weather.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/best-fan/wechat-app-history/9de7e0962cbed3ddf0ca1d67f9798bd6f95104bf/img/weather.png
--------------------------------------------------------------------------------
/img/weather/0.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/best-fan/wechat-app-history/9de7e0962cbed3ddf0ca1d67f9798bd6f95104bf/img/weather/0.png
--------------------------------------------------------------------------------
/img/weather/1.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/best-fan/wechat-app-history/9de7e0962cbed3ddf0ca1d67f9798bd6f95104bf/img/weather/1.png
--------------------------------------------------------------------------------
/img/weather/10.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/best-fan/wechat-app-history/9de7e0962cbed3ddf0ca1d67f9798bd6f95104bf/img/weather/10.png
--------------------------------------------------------------------------------
/img/weather/11.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/best-fan/wechat-app-history/9de7e0962cbed3ddf0ca1d67f9798bd6f95104bf/img/weather/11.png
--------------------------------------------------------------------------------
/img/weather/12.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/best-fan/wechat-app-history/9de7e0962cbed3ddf0ca1d67f9798bd6f95104bf/img/weather/12.png
--------------------------------------------------------------------------------
/img/weather/13.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/best-fan/wechat-app-history/9de7e0962cbed3ddf0ca1d67f9798bd6f95104bf/img/weather/13.png
--------------------------------------------------------------------------------
/img/weather/14.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/best-fan/wechat-app-history/9de7e0962cbed3ddf0ca1d67f9798bd6f95104bf/img/weather/14.png
--------------------------------------------------------------------------------
/img/weather/15.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/best-fan/wechat-app-history/9de7e0962cbed3ddf0ca1d67f9798bd6f95104bf/img/weather/15.png
--------------------------------------------------------------------------------
/img/weather/16.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/best-fan/wechat-app-history/9de7e0962cbed3ddf0ca1d67f9798bd6f95104bf/img/weather/16.png
--------------------------------------------------------------------------------
/img/weather/17.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/best-fan/wechat-app-history/9de7e0962cbed3ddf0ca1d67f9798bd6f95104bf/img/weather/17.png
--------------------------------------------------------------------------------
/img/weather/18.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/best-fan/wechat-app-history/9de7e0962cbed3ddf0ca1d67f9798bd6f95104bf/img/weather/18.png
--------------------------------------------------------------------------------
/img/weather/19.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/best-fan/wechat-app-history/9de7e0962cbed3ddf0ca1d67f9798bd6f95104bf/img/weather/19.png
--------------------------------------------------------------------------------
/img/weather/2.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/best-fan/wechat-app-history/9de7e0962cbed3ddf0ca1d67f9798bd6f95104bf/img/weather/2.png
--------------------------------------------------------------------------------
/img/weather/20.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/best-fan/wechat-app-history/9de7e0962cbed3ddf0ca1d67f9798bd6f95104bf/img/weather/20.png
--------------------------------------------------------------------------------
/img/weather/21.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/best-fan/wechat-app-history/9de7e0962cbed3ddf0ca1d67f9798bd6f95104bf/img/weather/21.png
--------------------------------------------------------------------------------
/img/weather/22.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/best-fan/wechat-app-history/9de7e0962cbed3ddf0ca1d67f9798bd6f95104bf/img/weather/22.png
--------------------------------------------------------------------------------
/img/weather/23.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/best-fan/wechat-app-history/9de7e0962cbed3ddf0ca1d67f9798bd6f95104bf/img/weather/23.png
--------------------------------------------------------------------------------
/img/weather/24.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/best-fan/wechat-app-history/9de7e0962cbed3ddf0ca1d67f9798bd6f95104bf/img/weather/24.png
--------------------------------------------------------------------------------
/img/weather/25.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/best-fan/wechat-app-history/9de7e0962cbed3ddf0ca1d67f9798bd6f95104bf/img/weather/25.png
--------------------------------------------------------------------------------
/img/weather/26.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/best-fan/wechat-app-history/9de7e0962cbed3ddf0ca1d67f9798bd6f95104bf/img/weather/26.png
--------------------------------------------------------------------------------
/img/weather/27.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/best-fan/wechat-app-history/9de7e0962cbed3ddf0ca1d67f9798bd6f95104bf/img/weather/27.png
--------------------------------------------------------------------------------
/img/weather/28.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/best-fan/wechat-app-history/9de7e0962cbed3ddf0ca1d67f9798bd6f95104bf/img/weather/28.png
--------------------------------------------------------------------------------
/img/weather/29.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/best-fan/wechat-app-history/9de7e0962cbed3ddf0ca1d67f9798bd6f95104bf/img/weather/29.png
--------------------------------------------------------------------------------
/img/weather/3.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/best-fan/wechat-app-history/9de7e0962cbed3ddf0ca1d67f9798bd6f95104bf/img/weather/3.png
--------------------------------------------------------------------------------
/img/weather/30.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/best-fan/wechat-app-history/9de7e0962cbed3ddf0ca1d67f9798bd6f95104bf/img/weather/30.png
--------------------------------------------------------------------------------
/img/weather/301.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/best-fan/wechat-app-history/9de7e0962cbed3ddf0ca1d67f9798bd6f95104bf/img/weather/301.png
--------------------------------------------------------------------------------
/img/weather/302.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/best-fan/wechat-app-history/9de7e0962cbed3ddf0ca1d67f9798bd6f95104bf/img/weather/302.png
--------------------------------------------------------------------------------
/img/weather/31.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/best-fan/wechat-app-history/9de7e0962cbed3ddf0ca1d67f9798bd6f95104bf/img/weather/31.png
--------------------------------------------------------------------------------
/img/weather/32.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/best-fan/wechat-app-history/9de7e0962cbed3ddf0ca1d67f9798bd6f95104bf/img/weather/32.png
--------------------------------------------------------------------------------
/img/weather/39.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/best-fan/wechat-app-history/9de7e0962cbed3ddf0ca1d67f9798bd6f95104bf/img/weather/39.png
--------------------------------------------------------------------------------
/img/weather/4.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/best-fan/wechat-app-history/9de7e0962cbed3ddf0ca1d67f9798bd6f95104bf/img/weather/4.png
--------------------------------------------------------------------------------
/img/weather/49.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/best-fan/wechat-app-history/9de7e0962cbed3ddf0ca1d67f9798bd6f95104bf/img/weather/49.png
--------------------------------------------------------------------------------
/img/weather/5.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/best-fan/wechat-app-history/9de7e0962cbed3ddf0ca1d67f9798bd6f95104bf/img/weather/5.png
--------------------------------------------------------------------------------
/img/weather/53.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/best-fan/wechat-app-history/9de7e0962cbed3ddf0ca1d67f9798bd6f95104bf/img/weather/53.png
--------------------------------------------------------------------------------
/img/weather/54.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/best-fan/wechat-app-history/9de7e0962cbed3ddf0ca1d67f9798bd6f95104bf/img/weather/54.png
--------------------------------------------------------------------------------
/img/weather/55.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/best-fan/wechat-app-history/9de7e0962cbed3ddf0ca1d67f9798bd6f95104bf/img/weather/55.png
--------------------------------------------------------------------------------
/img/weather/56.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/best-fan/wechat-app-history/9de7e0962cbed3ddf0ca1d67f9798bd6f95104bf/img/weather/56.png
--------------------------------------------------------------------------------
/img/weather/57.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/best-fan/wechat-app-history/9de7e0962cbed3ddf0ca1d67f9798bd6f95104bf/img/weather/57.png
--------------------------------------------------------------------------------
/img/weather/58.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/best-fan/wechat-app-history/9de7e0962cbed3ddf0ca1d67f9798bd6f95104bf/img/weather/58.png
--------------------------------------------------------------------------------
/img/weather/6.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/best-fan/wechat-app-history/9de7e0962cbed3ddf0ca1d67f9798bd6f95104bf/img/weather/6.png
--------------------------------------------------------------------------------
/img/weather/7.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/best-fan/wechat-app-history/9de7e0962cbed3ddf0ca1d67f9798bd6f95104bf/img/weather/7.png
--------------------------------------------------------------------------------
/img/weather/8.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/best-fan/wechat-app-history/9de7e0962cbed3ddf0ca1d67f9798bd6f95104bf/img/weather/8.png
--------------------------------------------------------------------------------
/img/weather/9.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/best-fan/wechat-app-history/9de7e0962cbed3ddf0ca1d67f9798bd6f95104bf/img/weather/9.png
--------------------------------------------------------------------------------
/img/weather/99.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/best-fan/wechat-app-history/9de7e0962cbed3ddf0ca1d67f9798bd6f95104bf/img/weather/99.png
--------------------------------------------------------------------------------
/img/weixinarticle.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/best-fan/wechat-app-history/9de7e0962cbed3ddf0ca1d67f9798bd6f95104bf/img/weixinarticle.png
--------------------------------------------------------------------------------
/pages/content/content.js:
--------------------------------------------------------------------------------
1 | // pages/content/content.js
2 | const app = getApp();
3 | var Bmob = require('../../utils/bmob.js');
4 | var WxParse = require('../../wxParse/wxParse.js');
5 | var Zan = require('../../dist/index');
6 | Page(Object.assign({}, Zan.TopTips, {
7 |
8 | /**
9 | * 页面的初始数据
10 | */
11 | data: {
12 | //标题
13 | Title: '',
14 | //用户信息
15 | userinfor: '',
16 | //页面内容
17 | // content: '',
18 | //是否点击评论
19 | releaseFocus: false,
20 | //评论数量
21 | num: '',
22 | //输入的评论
23 | pl: '',
24 | //数据库评论列表
25 | plresult: ''
26 | },
27 |
28 | /**
29 | * 生命周期函数--监听页面加载+
30 | */
31 | onLoad: function (options) {
32 |
33 | var that = this;
34 | // 获取传参
35 | if (options != null) {
36 | if (app.globalData.wztype=='0'){
37 | var article = app.globalData.data[options.index].content;
38 | WxParse.wxParse('article', 'html', article, that, 5);
39 | that.setData({
40 | // content: app.globalData.data[options.index].content,
41 | userinfor: app.globalData.userInfo,
42 | Title: app.globalData.data[options.index].title,
43 | });
44 | wx.setNavigationBarTitle({
45 | title: app.globalData.data[options.index].title,
46 | })
47 | }else{
48 | console.log(app.globalData.wxlist)
49 | var article = app.globalData.wxlist[options.index].content;
50 | WxParse.wxParse('article', 'html', article, that, 5);
51 | that.setData({
52 | //content: app.globalData.wxlist[options.index].content,
53 | userinfor: app.globalData.userInfo,
54 | Title: app.globalData.wxlist[options.index].title,
55 | });
56 | wx.setNavigationBarTitle({
57 | title: app.globalData.wxlist[options.index].title,
58 | })
59 | }
60 |
61 | //console.log('options不为空')
62 | } else {
63 |
64 | //console.log('options为空')
65 | }
66 |
67 |
68 | that.getcontent();
69 | },
70 |
71 | /**
72 | * 生命周期函数--监听页面初次渲染完成
73 | */
74 | onReady: function () {
75 |
76 | },
77 |
78 | /**
79 | * 点击回复
80 | **/
81 | bindReply: function (e) {
82 | this.setData({
83 | releaseFocus: true
84 | })
85 | },
86 | //获取评论内容
87 | getplnr: function (e) {
88 | this.setData({
89 | pl: e.detail.value
90 | })
91 | },
92 | // 点击发送
93 | bindsubmit: function () {
94 |
95 | ////console.log(this.data.pl)
96 | this.putcontent();
97 | this.getcontent();
98 | },
99 |
100 | //获取评论
101 | getcontent: function () {
102 | var that = this;
103 | var Diary = Bmob.Object.extend("comment");
104 | var query = new Bmob.Query(Diary);
105 | query.equalTo("title", that.data.Title);
106 | query.descending("createdAt");
107 | // 查询所有数据
108 | query.find({
109 | success: function (results) {
110 | //console.log("共查询到 " + results.length + " 条记录");
111 | that.setData({
112 | num: results.length,
113 | plresult: results,
114 | })
115 |
116 | },
117 | error: function (error) {
118 | //console.log("查询失败: " + error.code + " " + error.message);
119 | }
120 | });
121 | },
122 | //上传评论
123 | putcontent: function () {
124 | var that = this;
125 | if (that.data.pl.length == 0) {
126 | ////console.log('评论为空');
127 | that.showZanTopTips('评论不能为空,提交失败');
128 | that.setData({
129 | releaseFocus: false
130 | })
131 |
132 | } else {
133 | var Diary = Bmob.Object.extend("comment");
134 | var diary = new Diary();
135 | diary.set("title", that.data.Title);
136 | diary.set("content", that.data.pl);
137 | diary.set("nickname", that.data.userinfor.nickName);
138 | diary.set("side", that.data.userinfor.city);
139 | diary.set("imgsrc", that.data.userinfor.avatarUrl);
140 | //添加数据,第一个入口参数是null
141 | diary.save(null, {
142 | success: function (result) {
143 | // 添加成功,返回成功之后的objectId(注意:返回的属性名字是id,不是objectId),你还可以在Bmob的Web管理后台看到对应的数据
144 | //console.log("日记创建成功, objectId:" + result.id);
145 | that.showZanTopTips('评论提交成功');
146 | },
147 | error: function (result, error) {
148 | // 添加失败
149 | //console.log('创建日记失败');
150 |
151 | }
152 | });
153 | that.setData({
154 | releaseFocus: false,
155 | pl: '',
156 | })
157 | }
158 |
159 | }
160 |
161 |
162 | //})
163 | }));
--------------------------------------------------------------------------------
/pages/content/content.json:
--------------------------------------------------------------------------------
1 | {
2 | "component": true,
3 | "usingComponents": {}
4 | }
--------------------------------------------------------------------------------
/pages/content/content.wxml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 | 用户评论:
11 |
12 |
13 |
14 |
31 |
32 |
33 |
34 |
35 | 暂无评论
36 |
37 |
38 |
39 |
40 |
41 |
42 |
43 |
44 |
45 |
56 | 发送
57 |
58 |
59 |
60 |
--------------------------------------------------------------------------------
/pages/content/content.wxss:
--------------------------------------------------------------------------------
1 | /* pages/content/content.wxss */
2 | @import "/wxParse/wxParse.wxss";
3 | /*内容 */
4 | .conent_view{
5 | margin-left:17px;
6 | margin-right:17px;
7 | margin-top:10px;
8 |
9 | }
10 | .zwpl_view{
11 | text-align:center;
12 | margin-top:20px;
13 | margin-bottom:20px;
14 | color:#737373;
15 |
16 | }
17 | /*用户评论 */
18 | .top_view{
19 | margin-left: 17px;
20 | margin-bottom: 5px;
21 | margin-top: 15px;
22 | }
23 | /*评论定义 */
24 | .comment_all{
25 | width: 90%;
26 | margin-left: auto;
27 | margin-right: auto;
28 | height: 100%;
29 | border-bottom:1px #999 dashed;
30 | }
31 | .comment{
32 | width:100%;
33 | height: 84px;
34 | }
35 | .comment_left{
36 | width: 64px;
37 | height: 84px;
38 | float: left;
39 | }
40 | .comment_left image{
41 | height: 50px;
42 | width: 50px;
43 | border-radius: 7px;
44 | margin-left: auto;
45 | margin-right: auto;
46 | margin-top: 16px;
47 | }
48 | .comment_right{
49 | width: 80%;
50 | height: 84px;
51 | float: right;
52 | }
53 | .comment_right_up{
54 | height: 32px;
55 | width: 100%;
56 | }
57 | .comment_right_up ul{
58 | height: 32px;
59 | width: 100%;
60 | }
61 | .comment_right_up ul li{
62 | color: #888;
63 | font-size: 12px;
64 | height: 32px;
65 | line-height: 32px;
66 | float: left;
67 | }
68 | .comment_right_down{
69 | word-break:break-all;
70 | font-size: 14px;
71 | height: 52px;
72 | width: 100%;
73 | }
74 |
75 |
76 |
77 | /*输入框定义 */
78 | .input_null{
79 | color: #C9C9C9;
80 | }
81 |
82 | .release{
83 | display: flex;
84 | align-items: flex-end; /*底部对齐*/
85 | justify-content: space-between; /*两端对齐*/
86 | box-sizing: border-box;
87 | position: fixed;
88 | left: 0;
89 | bottom: 0;
90 | width: 100%;
91 | padding: 18rpx 0 18rpx 30rpx;
92 | background-color: #F7F8F7;
93 | font-size: 28rpx;
94 | z-index: 999;
95 | height:51px;
96 | }
97 | .release .text{
98 | width: 604rpx;
99 | min-height: 34rpx;
100 | max-height: 102rpx; /*最多显示三行*/
101 | border-width: 15rpx 20rpx; /*使用padding与预期留白不一致,故使用border*/
102 | border-style: solid;
103 | border-color: #ffffff;
104 | line-height: 34rpx;
105 | font-size: 28rpx;
106 | background-color: #ffffff;
107 | border-radius: 4rpx;
108 | }
109 | .release .submit{
110 | width: 116rpx;
111 | height: 64rpx;
112 | line-height: 64rpx;
113 | text-align: center;
114 | color: #66CC00;
115 | }
116 | /*我要评论 */
117 | .view_btn{
118 | /* margin-top: 9px; */
119 | width:100%;
120 | position:fixed;
121 | bottom:0px;
122 | }
--------------------------------------------------------------------------------
/pages/index/index.js:
--------------------------------------------------------------------------------
1 | //获取应用实例
2 | const app = getApp();
3 | var util = require('../../utils/util.js');
4 | //index.js
5 | Page({
6 | data: {
7 | //日历选择
8 | multiArray: [],
9 | //日历底标
10 | multiIndex: [0, 0],
11 | //历史数据
12 | datas: '',
13 | //月份
14 | months: [],
15 | //天数31
16 | days: [],
17 | //天数30
18 | day: [],
19 | //天数 28
20 | dday: [],
21 | //显示日历
22 | showtext: '',
23 | //天气数据
24 | weatherinfor: '',
25 | //展示天氣信息
26 | msgList: '',
27 |
28 | },
29 | /**
30 | * 生命周期函数--监听页面加载
31 | */
32 | onLoad: function () {
33 | this.setData({
34 | showtext: util.formatTime()[0] + '月' + util.formatTime()[1] + '日',
35 | })
36 | //console.log(util.formatTime()[0])
37 | //console.log(util.formatTime()[1])
38 | //获取历史信息
39 | this.getinfor(util.formatTime()[0], util.formatTime()[1])
40 | //获取天气信息
41 | this.getweater();
42 |
43 |
44 |
45 | },
46 | onReady: function () {
47 | // //console.log(util.getnum(0));
48 | var data = {
49 | multiArray: this.data.multiArray,
50 | multiIndex: this.data.multiIndex,
51 | months: this.data.months,
52 | days: this.data.days,
53 | day: this.data.day,
54 | dday: this.data.dday
55 | };
56 | data.months = util.getnum(0),
57 | data.days = util.getnum(1),
58 | data.day = util.getnum(2),
59 | data.dday = util.getnum(3),
60 | data.multiArray[0] = data.months;
61 | data.multiArray[1] = data.days;
62 |
63 | this.setData(data);
64 |
65 | },
66 |
67 | //提交日期
68 | bindMultiPickerChange: function (e) {
69 | //console.log('picker发送选择改变,携带值为', e.detail.value)
70 | var month = e.detail.value[0] + 1
71 | var day = e.detail.value[1] + 1
72 | this.setData({
73 | multiIndex: e.detail.value,
74 | showtext: month + '月' + day + '日'
75 | })
76 | this.getinfor(month, day)
77 | wx.showToast({
78 | title: '正在加载',
79 | icon: 'loading',
80 | duration: 1000
81 | })
82 | //console.log(month + '月:' + day + '日');
83 | },
84 | //日期选择
85 | bindMultiPickerColumnChange: function (e) {
86 | //console.log('修改的列为', e.detail.column, ',值为', e.detail.value);
87 | var data = {
88 | multiArray: this.data.multiArray,
89 | multiIndex: this.data.multiIndex
90 | };
91 | data.multiIndex[e.detail.column] = e.detail.value;
92 | switch (e.detail.column) {
93 | case 0:
94 | switch (data.multiIndex[0] + 1) {
95 | case 1:
96 | case 3:
97 | case 5:
98 | case 7:
99 | case 8:
100 | case 10:
101 | case 12:
102 | data.multiArray[1] = this.data.days;
103 | break;
104 | case 2:
105 | data.multiArray[1] = this.data.dday;
106 | break;
107 | case 4:
108 | case 6:
109 | case 9:
110 | data.multiArray[1] = this.data.day;
111 | break;
112 | }
113 | data.multiIndex[1] = 0;
114 | data.multiIndex[2] = 0;
115 | break;
116 | }
117 | this.setData(data);
118 | },
119 |
120 | //点击某个列表跳转,页面传参
121 | showDetail: function (e) {
122 | var that = this;
123 | // // 获取wxml元素绑定的index值
124 | // var index = e.currentTarget.dataset.index;
125 | // console.log(index);
126 | // // 取出objectId
127 | // var title = that.data.datas[index].content;
128 | app.globalData.wztype = '0';
129 | //console.log(title)
130 | ////console.log("1111111" + objectId);
131 | // 跳转到详情页
132 | wx.navigateTo ({
133 | url: '../content/content?index=' + e.currentTarget.dataset.index
134 | });
135 | },
136 |
137 | /**
138 | * 获取信息
139 | */
140 | getinfor: function (month, day) {
141 | var that = this;
142 | wx.request({
143 | url: 'https://api.jisuapi.com/todayhistory/query', //仅为示例,并非真实的接口地址
144 | data: {
145 | appkey: 'appkey',
146 | month: month,
147 | day: day
148 | },
149 | header: {
150 | 'content-type': 'application/json' // 默认值
151 | },
152 | success: function (res) {
153 | console.log(res.data.result)
154 | that.setData({
155 | datas: res.data.result
156 | })
157 | app.globalData.data = res.data.result;
158 | }
159 | })
160 |
161 | },
162 |
163 | getweater: function () {
164 | var that = this;
165 | //天气请求
166 | wx.request({
167 | url: 'https://api.jisuapi.com/weather/query', //仅为示例,并非真实的接口地址
168 | data: {
169 | appkey: 'appkey',
170 | city: '新乡'
171 | },
172 | header: {
173 | 'content-type': 'application/json' // 默认值
174 | },
175 | success: function (res) {
176 | //console.log(res.result)
177 | that.setData({
178 | weatherinfor: res.data.result,
179 | msgList: [
180 | { title: "新乡今日天气:" + res.data.result.weather + ',' + res.data.result.winddirect + ':' + res.data.result.windpower },
181 | { title: "最高温度:" + res.data.result.temphigh + "°C最低温度:" + res.data.result.templow + "°C平均温度:" + res.data.result.temp+"°C" },
182 | { title: "空调指数:" + res.data.result.index[0].ivalue + ";" },
183 | { title: res.data.result.index[0].detail },
184 | { title: "运动指数:" + res.data.result.index[1].ivalue + ";" },
185 | { title: res.data.result.index[1].detail },
186 | { title: "紫外线指数:" + res.data.result.index[2].ivalue + ";" },
187 | { title: res.data.result.index[2].detail },
188 | { title: "感冒指数:" + res.data.result.index[3].ivalue + ";" },
189 | { title: res.data.result.index[3].detail },
190 | { title: "洗车指数:" + res.data.result.index[4].ivalue + ";" },
191 | { title: res.data.result.index[4].detail },
192 | { title: "空气污染扩散指数:" + res.data.result.index[5].ivalue + ";" },
193 | { title: res.data.result.index[5].detail },
194 | { title: "穿衣指数:" + res.data.result.index[6].ivalue + ";" },
195 | { title: res.data.result.index[6].detail }]
196 | })
197 | }
198 | })
199 | }
200 |
201 |
202 |
203 | })
204 |
--------------------------------------------------------------------------------
/pages/index/index.json:
--------------------------------------------------------------------------------
1 | {
2 |
3 | }
--------------------------------------------------------------------------------
/pages/index/index.wxml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | {{item.title}}
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 | -
16 | - {{showtext}}
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 | {{item.year}}
30 | {{item.title}}
31 |
32 |
33 |
34 |
35 |
36 |
37 |
38 |
39 |
--------------------------------------------------------------------------------
/pages/index/index.wxss:
--------------------------------------------------------------------------------
1 | /**index.wxss**/
2 |
3 | /* .view_top{
4 | text-align: center;
5 | height: 40px;
6 | background-color: #515151;
7 | color:white;
8 |
9 | } */
10 |
11 | /* .data{
12 | padding-top:5px;
13 | } */
14 |
15 | /*滚动天气 */
16 |
17 | .swiper_container {
18 | margin-left: 8px;
19 | height: 55rpx;
20 | width: 90%;
21 | }
22 |
23 | .swiper_item {
24 | font-size: 25rpx;
25 | overflow: hidden;
26 | text-overflow: ellipsis;
27 | white-space: nowrap;
28 | letter-spacing: 2px;
29 | margin-top: 5px;
30 | color: #818291;
31 | }
32 |
33 | .zan-panel {
34 | margin-top: 1px;
35 | }
36 |
37 | .zan-btn {
38 | background: #515151;
39 | color: #fff;
40 | }
41 |
42 | .zan-cell__bd {
43 | color: #8f8f8f;
44 | }
45 |
46 | .items-list {
47 | margin-top: 5px;
48 | width: 100%;
49 | height: 100rpx;
50 | box-shadow: 0px 0px 7px rgba(55, 55, 55, 0.5);
51 | }
52 |
53 | .zan-pull-right {
54 | flex: 6;
55 | }
56 |
57 | /**index.wxss**/
58 |
59 | .zan-btn ul {
60 | height: 50px;
61 | }
62 |
63 | .zan-btn ul li {
64 | text-align: left;
65 | height: 50px;
66 | line-height: 50px;
67 | list-style-type: none;
68 | float: left;
69 | }
70 |
71 | .zan-btn ul li image {
72 | height: 50px;
73 | width: 50px;
74 | float: right;
75 | }
76 |
--------------------------------------------------------------------------------
/pages/kdselect/kdselect.js:
--------------------------------------------------------------------------------
1 | // pages/kdselect/kdselect.js
2 | Page({
3 |
4 | /**
5 | * 页面的初始数据
6 | */
7 | data: {
8 | //快递单号
9 | expressnu:'',
10 | //查询结果
11 | expressInfo:'',
12 | status:'',
13 | //是否隐藏
14 | reply:true,
15 | steps: [
16 | ]
17 | },
18 |
19 | /**
20 | * 生命周期函数--监听页面加载
21 | */
22 | onLoad: function (options) {
23 |
24 | },
25 |
26 | /**
27 | * 生命周期函数--监听页面初次渲染完成
28 | */
29 | onReady: function () {
30 |
31 | },
32 |
33 | /**
34 | * 生命周期函数--监听页面显示
35 | */
36 | onShow: function () {
37 |
38 | },
39 |
40 | /**
41 | * 生命周期函数--监听页面隐藏
42 | */
43 | onHide: function () {
44 |
45 | },
46 | //查询快递
47 | btnClick:function(){
48 | var that=this;
49 | var content=[];
50 | //快递请求
51 | wx.request({
52 | url: 'https://api.jisuapi.com/express/query', //仅为示例,并非真实的接口地址
53 | data: {
54 | appkey: 'appkey',
55 | type: 'auto',
56 | number: that.data.expressnu
57 | },
58 | header: {
59 | 'content-type': 'application/json' // 默认值
60 | },
61 | success: function (res) {
62 | console.log(res.data.result)
63 | console.log( res.data.result.list.length)
64 | for (var i = 0; i
2 |
3 |
4 |
5 |
6 |
7 | {{expressInfo.type}}:{{expressInfo.number}}
8 | 物流状态:{{status}}
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
--------------------------------------------------------------------------------
/pages/kdselect/kdselect.wxss:
--------------------------------------------------------------------------------
1 | /* pages/kdselect/kdselect.wxss */
2 | input{
3 | border:1px solid #ccc;
4 | width:90%;
5 | margin: 5%;
6 | padding: 5px;
7 | }
8 |
--------------------------------------------------------------------------------
/pages/other/other.js:
--------------------------------------------------------------------------------
1 | // pages/other/other.js
2 | const app = getApp();
3 | Page({
4 |
5 | /**
6 | * 页面的初始数据
7 | */
8 | data: {
9 |
10 | userinfor:''
11 | },
12 |
13 | /**
14 | * 生命周期函数--监听页面加载
15 | */
16 | onLoad: function (options) {
17 | console.log(app.globalData.userInfo)
18 | this.setData({
19 | userinfor: app.globalData.userInfo,
20 | });
21 |
22 | console.log("我加载了")
23 | },
24 |
25 | /**
26 | * 生命周期函数--监听页面初次渲染完成
27 | */
28 | onReady: function () {
29 |
30 | },
31 |
32 | /**
33 | * 生命周期函数--监听页面显示
34 | */
35 | onShow: function () {
36 | console.log("我出现了")
37 | },
38 |
39 | /**
40 | * 生命周期函数--监听页面隐藏
41 | */
42 | onHide: function () {
43 |
44 | },
45 |
46 | /**
47 | * 生命周期函数--监听页面卸载
48 | */
49 | onUnload: function () {
50 |
51 | },
52 | //天气预报
53 | bindViewWeather:function(){
54 | // 跳转到详情页
55 | wx.navigateTo({
56 | url: '../weather/weather'
57 | });
58 |
59 | },
60 | //快递查询
61 | bindViewkdcx:function(){
62 | // 跳转到详情页
63 | wx.navigateTo({
64 | url: '../kdselect/kdselect'
65 | });
66 |
67 | },
68 | //微信热门文章
69 | bindViewwxwz:function(){
70 |
71 | // 跳转到详情页
72 | wx.navigateTo({
73 | url: '../wxarticle/wxarticle'
74 | });
75 | }
76 | })
--------------------------------------------------------------------------------
/pages/other/other.json:
--------------------------------------------------------------------------------
1 | {
2 | "navigationBarTitleText": "个人中心"
3 | }
--------------------------------------------------------------------------------
/pages/other/other.wxml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 | {{userinfor.nickName}}
8 |
9 |
10 |
11 |
12 |
13 | 天气预报
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 | 快递查询
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
32 | 微信文章
33 |
34 |
35 |
36 |
37 |
38 |
--------------------------------------------------------------------------------
/pages/other/other.wxss:
--------------------------------------------------------------------------------
1 | /* pages/other/other.wxss */
2 | .personal-top{
3 | width:100%;
4 | height: 300rpx;
5 | }
6 | .personal-top-image{
7 | width:19%;
8 | height: 150rpx;
9 | margin-left: auto;
10 | margin-right: auto;
11 | margin-top: 60rpx;
12 | }
13 | .personal-top-image image{
14 | width:100%;
15 | height:100%;
16 | border-radius: 75rpx;
17 | }
18 | .personal-top-text{
19 | font-size: 12px;
20 | color: #888;
21 | font-weight:bold;
22 | margin-top: 40rpx;
23 | width: 100%;
24 | text-align: center;
25 | }
26 | .personal-middle{
27 | width: 100%;
28 | height: 450rpx;
29 | border-top: 1px #f7f7f7 solid;
30 | border-bottom: 1px #f7f7f7 solid;
31 | }
32 | .per-mid-list1,.per-mid-list2,.per-mid-list3{
33 | border-bottom: 1px #f7f7f7 solid;
34 | margin-top: 15px;
35 | width: 90%;
36 | float: right;
37 | height: 19.5%;
38 | }
39 | .per-mid-list4,.per-mid-list5{
40 | width: 90%;
41 | float: right;
42 | height: 20%;
43 | }
44 | .per-mid-list4{
45 | border-bottom: 1px #f7f7f7 solid;
46 | }
47 |
48 | .per-mid-list-left{
49 | width:40%;
50 | height:100%;
51 | float: left;
52 | }
53 | .per-mid-list-left image{
54 | width: 30%;
55 | height: 100%;
56 | float: left;
57 | }
58 | .per-mid-list-left-text{
59 | color: #888;
60 | font-size: 13px;
61 | line-height: 90rpx;
62 | width: 60%;
63 | height: 100%;
64 | float: right;
65 | }
66 |
67 | .per-mid-list-right{
68 | width:40%;
69 | height:100%;
70 | float: right;
71 | }
72 | .per-mid-list-right image{
73 | width: 30%;
74 | height: 100%;
75 | float: right;
76 | }
--------------------------------------------------------------------------------
/pages/weather/weather.js:
--------------------------------------------------------------------------------
1 | // pages/weather/weather.js
2 | Page({
3 |
4 | /**
5 | * 页面的初始数据
6 | */
7 | data: {
8 |
9 | weatherinfor:'',
10 | },
11 |
12 | /**
13 | * 生命周期函数--监听页面加载
14 | */
15 | onLoad: function (options) {
16 | this.getlocation();
17 | },
18 |
19 | /**
20 | * 生命周期函数--监听页面初次渲染完成
21 | */
22 | onReady: function () {
23 |
24 | },
25 |
26 | /**
27 | * 生命周期函数--监听页面显示
28 | */
29 | onShow: function () {
30 |
31 | },
32 |
33 | /**
34 | * 生命周期函数--监听页面隐藏
35 | */
36 | onHide: function () {
37 |
38 | },
39 |
40 | /**
41 | * 生命周期函数--监听页面卸载
42 | */
43 | onUnload: function () {
44 |
45 | },
46 |
47 | /**
48 | * 页面相关事件处理函数--监听用户下拉动作
49 | */
50 | onPullDownRefresh: function () {
51 |
52 | },
53 | //获取位置信息
54 | getlocation: function () {
55 | var that = this;
56 | wx.getLocation({
57 | type: 'wgs84',
58 | success: function (res) {
59 | let latitude = res.latitude
60 | let longitude = res.longitude
61 | //天气请求
62 | wx.request({
63 | url: 'https://api.jisuapi.com/weather/query', //仅为示例,并非真实的接口地址
64 | data: {
65 | appkey: 'appkey',
66 | location: latitude+','+longitude
67 | },
68 | header: {
69 | 'content-type': 'application/json' // 默认值
70 | },
71 | success: function (res) {
72 | console.log(res.data.result)
73 | that.setData({
74 | weatherinfor: res.data.result,
75 |
76 | })
77 | }
78 | })
79 | }
80 | })
81 |
82 | },
83 | })
--------------------------------------------------------------------------------
/pages/weather/weather.json:
--------------------------------------------------------------------------------
1 | {
2 | "navigationBarBackgroundColor":"#42c642",
3 | "navigationBarTextStyle":"white",
4 | "navigationBarTitleText": "天气预报"
5 | }
--------------------------------------------------------------------------------
/pages/weather/weather.wxml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 | {{weatherinfor.city}}
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 | {{weatherinfor.temp}}°
20 |
21 |
22 |
23 | {{weatherinfor.weather}} {{weatherinfor.winddirect}} {{weatherinfor.windpower}}
24 |
25 |
26 |
27 | 湿度 : {{weatherinfor.humidity}}
28 | PM2.5 : {{weatherinfor.aqi.pm2_5}}
29 | {{weatherinfor.aqi.quality}}
30 |
31 |
32 |
33 |
34 |
35 |
36 |
37 |
38 |
39 | {{item.time}}
40 |
41 | {{item.temp}}°C
42 |
43 | {{item.weather}}
44 |
45 |
46 |
47 |
48 |
49 |
50 |
51 |
52 | {{item.week}}
53 |
54 | {{item.day.weather}}
55 | {{item.night.templow}}°~{{item.day.temphigh}}°
56 |
57 |
58 |
59 |
--------------------------------------------------------------------------------
/pages/weather/weather.wxss:
--------------------------------------------------------------------------------
1 | /* pages/weather/weather.wxss */
2 | /* ------- top city --------- */
3 |
4 | .top_city {
5 | align-items: center;
6 | background: #42c642;
7 | padding-top:13px;
8 | text-align:center
9 |
10 | }
11 |
12 |
13 | .city_item{
14 | color: #fff;
15 | font-size: 43rpx;
16 | padding-top: 5rpx;
17 | }
18 |
19 |
20 | /* ------- today --------- */
21 |
22 | .today {
23 | padding: 50rpx 0 60rpx 0;
24 | display: flex;
25 | height:210px;
26 | flex-direction: column;
27 | align-items: center;
28 | background: #42c642;
29 | }
30 |
31 | .today .weather .pic {
32 | width:110rpx;
33 | height:110rpx;
34 |
35 | }
36 | .desc{
37 | color: white;
38 | }
39 | .today .weather .desc{
40 | display: flex;
41 | flex-direction: column;
42 | margin-right: 20rpx;
43 | }
44 | .today .weather .desc text {
45 | color: #fff;
46 | font-size: 26rpx;
47 | line-height: 40rpx;
48 | margin-top: 10rpx;
49 | }
50 | .today .temperature {
51 | color: #faf9fa;
52 |
53 | font-size:100rpx;
54 | margin:46rpx 0;
55 |
56 | }
57 | .today .more {
58 | color: #faf9fa;
59 | font-size: 25rpx;
60 | margin-top:60rpx;
61 |
62 | }
63 | .today .more text {
64 | padding: 0 10rpx;
65 | }
66 | .today-bottom {
67 | background: #faf9fa;
68 | width: 150%;
69 | height: 300rpx;
70 | border-radius: 150%;
71 | margin: -50rpx 0 0 0;
72 | margin-left:-25%;
73 | }
74 |
75 | .hourly {
76 | width:100%;
77 | height: 308rpx;
78 | white-space: nowrap;
79 | display: flex;
80 | background-color: white;
81 | }
82 | /*小时天气 */
83 | .oneHourly {
84 | height: 100%;
85 | width: 150rpx;
86 | display: inline-block;
87 | /* background-color: blue; */
88 | /* letter-spacing:4px; */
89 | font-size:30rpx;
90 | }
91 | .oneHourlyFlex {
92 | width: 100%;
93 | height: 80%;
94 | display: flex;
95 | flex-direction: column;
96 | justify-content: space-between;
97 | align-items: center;
98 | margin-top: 10%;
99 | margin-bottom: 10%;
100 | }
101 | .hourlyDate {
102 | text-align: center;
103 | color: #4B4B4B;
104 | font-size: 30rpx;
105 | font-family: "SFUIDisplay-Regular";
106 | }
107 | .hourlyImg {
108 | width: 64rpx;
109 | height: 64rpx;
110 | text-align: center;
111 | }
112 | .hourlyTmp {
113 | text-align: center;
114 | color: #4B4B4B;
115 | font-size: 30rpx;
116 | font-family: "PingFangSC-Semibold";
117 | }
118 | .hourlyWind {
119 | text-align: center;
120 | color: #4B4B4B;
121 | font-size: 28rpx;
122 | font-family: "PingFangSC-Medium";
123 | display: flex;
124 | align-items: center;
125 | justify-content: center;
126 | }
127 |
128 | .hourlyWind image {
129 | width: 16rpx;
130 | height: 28rpx;
131 | margin-right: 5rpx;
132 | }
133 | /*daily */
134 | .dailyForecast {
135 | margin-top: 40rpx;
136 | font-family: "PingFangSC-Medium";
137 | }
138 | .daily {
139 | display: flex;
140 | align-items: center;
141 | height: 80rpx;
142 | background-color: white;
143 | text-align: center;
144 | }
145 | .dailyDate {
146 | text-align: left;
147 | width: 25%;
148 | color: #4B4B4B;
149 | font-size: 30rpx;
150 | margin-left: 5%;
151 | }
152 | .dailyImg {
153 | margin-left: 100rpx;
154 | margin-right: 40rpx;
155 | width: 64rpx;
156 | height: 80%;
157 | }
158 | .dailyCond {
159 | text-align: left;
160 | width: 40%;
161 | color: #4B4B4B;
162 | font-size: 30rpx;
163 | }
164 | .dailyTmp {
165 | text-align: center;
166 | width: 40%;
167 | font-size: 30rpx;
168 | font-family: "PingFangSC-Semibold";
169 | }
--------------------------------------------------------------------------------
/pages/wxarticle/wxarticle.js:
--------------------------------------------------------------------------------
1 | const app = getApp();
2 | // pages/wxarticle/wxarticle.js
3 | Page({
4 |
5 | /**
6 | * 页面的初始数据
7 | */
8 | data: {
9 | //微信文章
10 | list:'',
11 | },
12 |
13 | /**
14 | * 生命周期函数--监听页面加载
15 | */
16 | onLoad: function (options) {
17 | this.getinfor(0);
18 | },
19 |
20 | /**
21 | * 生命周期函数--监听页面初次渲染完成
22 | */
23 | onReady: function () {
24 |
25 | },
26 |
27 | /**
28 | * 生命周期函数--监听页面显示
29 | */
30 | onShow: function () {
31 |
32 | },
33 |
34 | /**
35 | * 生命周期函数--监听页面隐藏
36 | */
37 | onHide: function () {
38 |
39 | },
40 |
41 | /**
42 | * 生命周期函数--监听页面卸载
43 | */
44 | onUnload: function () {
45 |
46 | },
47 | //获取微信文章
48 | getinfor:function(startnum){
49 | var that=this;
50 | //网络请求
51 | wx.request({
52 | url: 'https://api.jisuapi.com/weixinarticle/get', //仅为示例,并非真实的接口地址
53 | data: {
54 | appkey: 'appkey',
55 | channelid:'0',
56 | start: startnum,
57 | num:'10',
58 | },
59 | header: {
60 | 'content-type': 'application/json' // 默认值
61 | },
62 | success: function (res) {
63 | console.log(res.data.result)
64 | that.setData({
65 | list: res.data.result.list,
66 | })
67 | app.globalData.wxlist = res.data.result.list;
68 | }
69 | })
70 | },
71 | bindViewNewsList:function(e){
72 |
73 | var that = this;
74 | app.globalData.wztype = '1';
75 | // 跳转到详情页
76 | wx.navigateTo({
77 | url: '../content/content?index=' + e.currentTarget.dataset.index
78 | });
79 | }
80 | })
--------------------------------------------------------------------------------
/pages/wxarticle/wxarticle.json:
--------------------------------------------------------------------------------
1 | {
2 | "navigationBarTitleText": "微信热门文章"
3 | }
--------------------------------------------------------------------------------
/pages/wxarticle/wxarticle.wxml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 | {{item.title}}
7 |
8 | {{item.weixinname}}
9 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
--------------------------------------------------------------------------------
/pages/wxarticle/wxarticle.wxss:
--------------------------------------------------------------------------------
1 | /* pages/wxarticle/wxarticle.wxss */
2 | .container{
3 | height: 100%;
4 | width: 92%;
5 | margin-left: auto;
6 | margin-right: auto;
7 | word-break:break-all;
8 | padding: 0;
9 | }
10 | .news{
11 | width: 100%;
12 | /* border-bottom: 1px #e6e6e6 solid; */
13 | padding:10px 0;
14 | }
15 | .news_left{
16 | padding-top:10rpx;
17 | width:63%;
18 | height: 95%;
19 | float: left;
20 | }
21 | .news_title{
22 | line-height: 50rpx;
23 | padding-bottom: 4px;
24 | width: 100%;
25 | height: 100%;
26 | overflow: hidden;
27 | }
28 | .news_left_down{
29 | margin-bottom: 26rpx;
30 | width: 100%;
31 | height: 25px;
32 | line-height: 25px;
33 | color: #888;
34 | font-size: 10px;
35 | }
36 | .postername{
37 | padding: 0 20rpx 0 0;
38 | float: left;
39 | }
40 | .comment{
41 | margin-left: 6rpx;
42 | }
43 | .com_number{
44 | padding: 0 4rpx;
45 | float: left;
46 | }
47 | .comment image{
48 | margin-top: 13rpx;
49 | width: 14px;
50 | height: 13.5px;
51 | }
52 | .news_right{
53 | vertical-align: middle;
54 | float: right;
55 | width: 30%;
56 | height: 150rpx;
57 | }
58 | .news_right image{
59 | vertical-align: middle;
60 | height: 150rpx;
61 | width: 100%;
62 | padding: 0;
63 | border-radius: 1.7px;
64 | }
65 | .bottom{
66 | width: 100%;
67 | height: 340rpx;
68 | line-height: 340rpx;
69 | font-size: 15px;
70 | text-align: center;
71 | color: #888;
72 | }
--------------------------------------------------------------------------------
/screen/1.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/best-fan/wechat-app-history/9de7e0962cbed3ddf0ca1d67f9798bd6f95104bf/screen/1.png
--------------------------------------------------------------------------------
/screen/2.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/best-fan/wechat-app-history/9de7e0962cbed3ddf0ca1d67f9798bd6f95104bf/screen/2.png
--------------------------------------------------------------------------------
/screen/3.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/best-fan/wechat-app-history/9de7e0962cbed3ddf0ca1d67f9798bd6f95104bf/screen/3.png
--------------------------------------------------------------------------------
/screen/4.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/best-fan/wechat-app-history/9de7e0962cbed3ddf0ca1d67f9798bd6f95104bf/screen/4.png
--------------------------------------------------------------------------------
/screen/5.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/best-fan/wechat-app-history/9de7e0962cbed3ddf0ca1d67f9798bd6f95104bf/screen/5.png
--------------------------------------------------------------------------------
/screen/6.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/best-fan/wechat-app-history/9de7e0962cbed3ddf0ca1d67f9798bd6f95104bf/screen/6.png
--------------------------------------------------------------------------------
/screen/7.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/best-fan/wechat-app-history/9de7e0962cbed3ddf0ca1d67f9798bd6f95104bf/screen/7.png
--------------------------------------------------------------------------------
/utils/util.js:
--------------------------------------------------------------------------------
1 | //获取当前时间
2 | function formatTime() {
3 | var date = new Date();
4 | var month = date.getMonth() + 1
5 | var day = date.getDate()
6 |
7 |
8 |
9 | return [month, day]
10 | }
11 | //获取月 日
12 | function getnum(num){
13 | var data=[];
14 | switch(num){
15 | case 0:
16 | for (let n = 1; n <= 12; n++) {
17 | // n = n.toString()[1] ? n : '0' + n
18 | data.push(n + '月')
19 | }
20 | break;
21 | case 1:
22 | for (let n = 1; n <= 31; n++) {
23 | // n = n.toString()[1] ? n : '0' + n
24 | data.push(n + '日')
25 | }
26 | break;
27 | case 2:
28 | for (let n = 1; n <= 30; n++) {
29 | // n = n.toString()[1] ? n : '0' + n
30 | data.push(n + '日')
31 | }
32 |
33 | default:
34 | for (let n = 1; n <= 28; n++) {
35 | // n = n.toString()[1] ? n : '0' + n
36 | data.push(n + '日')
37 | }
38 | break
39 | break;
40 | }
41 | return data;
42 | }
43 | //将方法暴露出来
44 | module.exports = {
45 | formatTime: formatTime,
46 | getnum:getnum
47 | }
48 |
49 |
--------------------------------------------------------------------------------
/wxParse/emojis/00.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/best-fan/wechat-app-history/9de7e0962cbed3ddf0ca1d67f9798bd6f95104bf/wxParse/emojis/00.gif
--------------------------------------------------------------------------------
/wxParse/emojis/01.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/best-fan/wechat-app-history/9de7e0962cbed3ddf0ca1d67f9798bd6f95104bf/wxParse/emojis/01.gif
--------------------------------------------------------------------------------
/wxParse/emojis/02.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/best-fan/wechat-app-history/9de7e0962cbed3ddf0ca1d67f9798bd6f95104bf/wxParse/emojis/02.gif
--------------------------------------------------------------------------------
/wxParse/emojis/03.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/best-fan/wechat-app-history/9de7e0962cbed3ddf0ca1d67f9798bd6f95104bf/wxParse/emojis/03.gif
--------------------------------------------------------------------------------
/wxParse/emojis/04.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/best-fan/wechat-app-history/9de7e0962cbed3ddf0ca1d67f9798bd6f95104bf/wxParse/emojis/04.gif
--------------------------------------------------------------------------------
/wxParse/emojis/05.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/best-fan/wechat-app-history/9de7e0962cbed3ddf0ca1d67f9798bd6f95104bf/wxParse/emojis/05.gif
--------------------------------------------------------------------------------
/wxParse/emojis/06.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/best-fan/wechat-app-history/9de7e0962cbed3ddf0ca1d67f9798bd6f95104bf/wxParse/emojis/06.gif
--------------------------------------------------------------------------------
/wxParse/emojis/07.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/best-fan/wechat-app-history/9de7e0962cbed3ddf0ca1d67f9798bd6f95104bf/wxParse/emojis/07.gif
--------------------------------------------------------------------------------
/wxParse/emojis/08.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/best-fan/wechat-app-history/9de7e0962cbed3ddf0ca1d67f9798bd6f95104bf/wxParse/emojis/08.gif
--------------------------------------------------------------------------------
/wxParse/emojis/09.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/best-fan/wechat-app-history/9de7e0962cbed3ddf0ca1d67f9798bd6f95104bf/wxParse/emojis/09.gif
--------------------------------------------------------------------------------
/wxParse/emojis/10.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/best-fan/wechat-app-history/9de7e0962cbed3ddf0ca1d67f9798bd6f95104bf/wxParse/emojis/10.gif
--------------------------------------------------------------------------------
/wxParse/emojis/100.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/best-fan/wechat-app-history/9de7e0962cbed3ddf0ca1d67f9798bd6f95104bf/wxParse/emojis/100.gif
--------------------------------------------------------------------------------
/wxParse/emojis/101.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/best-fan/wechat-app-history/9de7e0962cbed3ddf0ca1d67f9798bd6f95104bf/wxParse/emojis/101.gif
--------------------------------------------------------------------------------
/wxParse/emojis/102.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/best-fan/wechat-app-history/9de7e0962cbed3ddf0ca1d67f9798bd6f95104bf/wxParse/emojis/102.gif
--------------------------------------------------------------------------------
/wxParse/emojis/103.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/best-fan/wechat-app-history/9de7e0962cbed3ddf0ca1d67f9798bd6f95104bf/wxParse/emojis/103.gif
--------------------------------------------------------------------------------
/wxParse/emojis/104.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/best-fan/wechat-app-history/9de7e0962cbed3ddf0ca1d67f9798bd6f95104bf/wxParse/emojis/104.gif
--------------------------------------------------------------------------------
/wxParse/emojis/105.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/best-fan/wechat-app-history/9de7e0962cbed3ddf0ca1d67f9798bd6f95104bf/wxParse/emojis/105.gif
--------------------------------------------------------------------------------
/wxParse/emojis/106.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/best-fan/wechat-app-history/9de7e0962cbed3ddf0ca1d67f9798bd6f95104bf/wxParse/emojis/106.gif
--------------------------------------------------------------------------------
/wxParse/emojis/107.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/best-fan/wechat-app-history/9de7e0962cbed3ddf0ca1d67f9798bd6f95104bf/wxParse/emojis/107.gif
--------------------------------------------------------------------------------
/wxParse/emojis/108.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/best-fan/wechat-app-history/9de7e0962cbed3ddf0ca1d67f9798bd6f95104bf/wxParse/emojis/108.gif
--------------------------------------------------------------------------------
/wxParse/emojis/109.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/best-fan/wechat-app-history/9de7e0962cbed3ddf0ca1d67f9798bd6f95104bf/wxParse/emojis/109.gif
--------------------------------------------------------------------------------
/wxParse/emojis/11.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/best-fan/wechat-app-history/9de7e0962cbed3ddf0ca1d67f9798bd6f95104bf/wxParse/emojis/11.gif
--------------------------------------------------------------------------------
/wxParse/emojis/110.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/best-fan/wechat-app-history/9de7e0962cbed3ddf0ca1d67f9798bd6f95104bf/wxParse/emojis/110.gif
--------------------------------------------------------------------------------
/wxParse/emojis/111.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/best-fan/wechat-app-history/9de7e0962cbed3ddf0ca1d67f9798bd6f95104bf/wxParse/emojis/111.gif
--------------------------------------------------------------------------------
/wxParse/emojis/112.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/best-fan/wechat-app-history/9de7e0962cbed3ddf0ca1d67f9798bd6f95104bf/wxParse/emojis/112.gif
--------------------------------------------------------------------------------
/wxParse/emojis/113.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/best-fan/wechat-app-history/9de7e0962cbed3ddf0ca1d67f9798bd6f95104bf/wxParse/emojis/113.gif
--------------------------------------------------------------------------------
/wxParse/emojis/114.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/best-fan/wechat-app-history/9de7e0962cbed3ddf0ca1d67f9798bd6f95104bf/wxParse/emojis/114.gif
--------------------------------------------------------------------------------
/wxParse/emojis/115.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/best-fan/wechat-app-history/9de7e0962cbed3ddf0ca1d67f9798bd6f95104bf/wxParse/emojis/115.gif
--------------------------------------------------------------------------------
/wxParse/emojis/116.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/best-fan/wechat-app-history/9de7e0962cbed3ddf0ca1d67f9798bd6f95104bf/wxParse/emojis/116.gif
--------------------------------------------------------------------------------
/wxParse/emojis/117.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/best-fan/wechat-app-history/9de7e0962cbed3ddf0ca1d67f9798bd6f95104bf/wxParse/emojis/117.gif
--------------------------------------------------------------------------------
/wxParse/emojis/118.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/best-fan/wechat-app-history/9de7e0962cbed3ddf0ca1d67f9798bd6f95104bf/wxParse/emojis/118.gif
--------------------------------------------------------------------------------
/wxParse/emojis/119.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/best-fan/wechat-app-history/9de7e0962cbed3ddf0ca1d67f9798bd6f95104bf/wxParse/emojis/119.gif
--------------------------------------------------------------------------------
/wxParse/emojis/12.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/best-fan/wechat-app-history/9de7e0962cbed3ddf0ca1d67f9798bd6f95104bf/wxParse/emojis/12.gif
--------------------------------------------------------------------------------
/wxParse/emojis/120.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/best-fan/wechat-app-history/9de7e0962cbed3ddf0ca1d67f9798bd6f95104bf/wxParse/emojis/120.gif
--------------------------------------------------------------------------------
/wxParse/emojis/121.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/best-fan/wechat-app-history/9de7e0962cbed3ddf0ca1d67f9798bd6f95104bf/wxParse/emojis/121.gif
--------------------------------------------------------------------------------
/wxParse/emojis/122.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/best-fan/wechat-app-history/9de7e0962cbed3ddf0ca1d67f9798bd6f95104bf/wxParse/emojis/122.gif
--------------------------------------------------------------------------------
/wxParse/emojis/123.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/best-fan/wechat-app-history/9de7e0962cbed3ddf0ca1d67f9798bd6f95104bf/wxParse/emojis/123.gif
--------------------------------------------------------------------------------
/wxParse/emojis/124.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/best-fan/wechat-app-history/9de7e0962cbed3ddf0ca1d67f9798bd6f95104bf/wxParse/emojis/124.gif
--------------------------------------------------------------------------------
/wxParse/emojis/125.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/best-fan/wechat-app-history/9de7e0962cbed3ddf0ca1d67f9798bd6f95104bf/wxParse/emojis/125.gif
--------------------------------------------------------------------------------
/wxParse/emojis/126.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/best-fan/wechat-app-history/9de7e0962cbed3ddf0ca1d67f9798bd6f95104bf/wxParse/emojis/126.gif
--------------------------------------------------------------------------------
/wxParse/emojis/127.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/best-fan/wechat-app-history/9de7e0962cbed3ddf0ca1d67f9798bd6f95104bf/wxParse/emojis/127.gif
--------------------------------------------------------------------------------
/wxParse/emojis/128.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/best-fan/wechat-app-history/9de7e0962cbed3ddf0ca1d67f9798bd6f95104bf/wxParse/emojis/128.gif
--------------------------------------------------------------------------------
/wxParse/emojis/129.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/best-fan/wechat-app-history/9de7e0962cbed3ddf0ca1d67f9798bd6f95104bf/wxParse/emojis/129.gif
--------------------------------------------------------------------------------
/wxParse/emojis/13.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/best-fan/wechat-app-history/9de7e0962cbed3ddf0ca1d67f9798bd6f95104bf/wxParse/emojis/13.gif
--------------------------------------------------------------------------------
/wxParse/emojis/130.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/best-fan/wechat-app-history/9de7e0962cbed3ddf0ca1d67f9798bd6f95104bf/wxParse/emojis/130.gif
--------------------------------------------------------------------------------
/wxParse/emojis/131.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/best-fan/wechat-app-history/9de7e0962cbed3ddf0ca1d67f9798bd6f95104bf/wxParse/emojis/131.gif
--------------------------------------------------------------------------------
/wxParse/emojis/132.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/best-fan/wechat-app-history/9de7e0962cbed3ddf0ca1d67f9798bd6f95104bf/wxParse/emojis/132.gif
--------------------------------------------------------------------------------
/wxParse/emojis/133.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/best-fan/wechat-app-history/9de7e0962cbed3ddf0ca1d67f9798bd6f95104bf/wxParse/emojis/133.gif
--------------------------------------------------------------------------------
/wxParse/emojis/134.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/best-fan/wechat-app-history/9de7e0962cbed3ddf0ca1d67f9798bd6f95104bf/wxParse/emojis/134.gif
--------------------------------------------------------------------------------
/wxParse/emojis/14.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/best-fan/wechat-app-history/9de7e0962cbed3ddf0ca1d67f9798bd6f95104bf/wxParse/emojis/14.gif
--------------------------------------------------------------------------------
/wxParse/emojis/15.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/best-fan/wechat-app-history/9de7e0962cbed3ddf0ca1d67f9798bd6f95104bf/wxParse/emojis/15.gif
--------------------------------------------------------------------------------
/wxParse/emojis/16.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/best-fan/wechat-app-history/9de7e0962cbed3ddf0ca1d67f9798bd6f95104bf/wxParse/emojis/16.gif
--------------------------------------------------------------------------------
/wxParse/emojis/17.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/best-fan/wechat-app-history/9de7e0962cbed3ddf0ca1d67f9798bd6f95104bf/wxParse/emojis/17.gif
--------------------------------------------------------------------------------
/wxParse/emojis/18.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/best-fan/wechat-app-history/9de7e0962cbed3ddf0ca1d67f9798bd6f95104bf/wxParse/emojis/18.gif
--------------------------------------------------------------------------------
/wxParse/emojis/19.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/best-fan/wechat-app-history/9de7e0962cbed3ddf0ca1d67f9798bd6f95104bf/wxParse/emojis/19.gif
--------------------------------------------------------------------------------
/wxParse/emojis/20.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/best-fan/wechat-app-history/9de7e0962cbed3ddf0ca1d67f9798bd6f95104bf/wxParse/emojis/20.gif
--------------------------------------------------------------------------------
/wxParse/emojis/21.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/best-fan/wechat-app-history/9de7e0962cbed3ddf0ca1d67f9798bd6f95104bf/wxParse/emojis/21.gif
--------------------------------------------------------------------------------
/wxParse/emojis/22.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/best-fan/wechat-app-history/9de7e0962cbed3ddf0ca1d67f9798bd6f95104bf/wxParse/emojis/22.gif
--------------------------------------------------------------------------------
/wxParse/emojis/23.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/best-fan/wechat-app-history/9de7e0962cbed3ddf0ca1d67f9798bd6f95104bf/wxParse/emojis/23.gif
--------------------------------------------------------------------------------
/wxParse/emojis/24.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/best-fan/wechat-app-history/9de7e0962cbed3ddf0ca1d67f9798bd6f95104bf/wxParse/emojis/24.gif
--------------------------------------------------------------------------------
/wxParse/emojis/25.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/best-fan/wechat-app-history/9de7e0962cbed3ddf0ca1d67f9798bd6f95104bf/wxParse/emojis/25.gif
--------------------------------------------------------------------------------
/wxParse/emojis/26.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/best-fan/wechat-app-history/9de7e0962cbed3ddf0ca1d67f9798bd6f95104bf/wxParse/emojis/26.gif
--------------------------------------------------------------------------------
/wxParse/emojis/27.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/best-fan/wechat-app-history/9de7e0962cbed3ddf0ca1d67f9798bd6f95104bf/wxParse/emojis/27.gif
--------------------------------------------------------------------------------
/wxParse/emojis/28.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/best-fan/wechat-app-history/9de7e0962cbed3ddf0ca1d67f9798bd6f95104bf/wxParse/emojis/28.gif
--------------------------------------------------------------------------------
/wxParse/emojis/29.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/best-fan/wechat-app-history/9de7e0962cbed3ddf0ca1d67f9798bd6f95104bf/wxParse/emojis/29.gif
--------------------------------------------------------------------------------
/wxParse/emojis/30.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/best-fan/wechat-app-history/9de7e0962cbed3ddf0ca1d67f9798bd6f95104bf/wxParse/emojis/30.gif
--------------------------------------------------------------------------------
/wxParse/emojis/31.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/best-fan/wechat-app-history/9de7e0962cbed3ddf0ca1d67f9798bd6f95104bf/wxParse/emojis/31.gif
--------------------------------------------------------------------------------
/wxParse/emojis/32.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/best-fan/wechat-app-history/9de7e0962cbed3ddf0ca1d67f9798bd6f95104bf/wxParse/emojis/32.gif
--------------------------------------------------------------------------------
/wxParse/emojis/33.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/best-fan/wechat-app-history/9de7e0962cbed3ddf0ca1d67f9798bd6f95104bf/wxParse/emojis/33.gif
--------------------------------------------------------------------------------
/wxParse/emojis/34.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/best-fan/wechat-app-history/9de7e0962cbed3ddf0ca1d67f9798bd6f95104bf/wxParse/emojis/34.gif
--------------------------------------------------------------------------------
/wxParse/emojis/35.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/best-fan/wechat-app-history/9de7e0962cbed3ddf0ca1d67f9798bd6f95104bf/wxParse/emojis/35.gif
--------------------------------------------------------------------------------
/wxParse/emojis/36.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/best-fan/wechat-app-history/9de7e0962cbed3ddf0ca1d67f9798bd6f95104bf/wxParse/emojis/36.gif
--------------------------------------------------------------------------------
/wxParse/emojis/37.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/best-fan/wechat-app-history/9de7e0962cbed3ddf0ca1d67f9798bd6f95104bf/wxParse/emojis/37.gif
--------------------------------------------------------------------------------
/wxParse/emojis/38.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/best-fan/wechat-app-history/9de7e0962cbed3ddf0ca1d67f9798bd6f95104bf/wxParse/emojis/38.gif
--------------------------------------------------------------------------------
/wxParse/emojis/39.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/best-fan/wechat-app-history/9de7e0962cbed3ddf0ca1d67f9798bd6f95104bf/wxParse/emojis/39.gif
--------------------------------------------------------------------------------
/wxParse/emojis/40.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/best-fan/wechat-app-history/9de7e0962cbed3ddf0ca1d67f9798bd6f95104bf/wxParse/emojis/40.gif
--------------------------------------------------------------------------------
/wxParse/emojis/41.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/best-fan/wechat-app-history/9de7e0962cbed3ddf0ca1d67f9798bd6f95104bf/wxParse/emojis/41.gif
--------------------------------------------------------------------------------
/wxParse/emojis/42.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/best-fan/wechat-app-history/9de7e0962cbed3ddf0ca1d67f9798bd6f95104bf/wxParse/emojis/42.gif
--------------------------------------------------------------------------------
/wxParse/emojis/43.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/best-fan/wechat-app-history/9de7e0962cbed3ddf0ca1d67f9798bd6f95104bf/wxParse/emojis/43.gif
--------------------------------------------------------------------------------
/wxParse/emojis/44.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/best-fan/wechat-app-history/9de7e0962cbed3ddf0ca1d67f9798bd6f95104bf/wxParse/emojis/44.gif
--------------------------------------------------------------------------------
/wxParse/emojis/45.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/best-fan/wechat-app-history/9de7e0962cbed3ddf0ca1d67f9798bd6f95104bf/wxParse/emojis/45.gif
--------------------------------------------------------------------------------
/wxParse/emojis/46.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/best-fan/wechat-app-history/9de7e0962cbed3ddf0ca1d67f9798bd6f95104bf/wxParse/emojis/46.gif
--------------------------------------------------------------------------------
/wxParse/emojis/47.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/best-fan/wechat-app-history/9de7e0962cbed3ddf0ca1d67f9798bd6f95104bf/wxParse/emojis/47.gif
--------------------------------------------------------------------------------
/wxParse/emojis/48.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/best-fan/wechat-app-history/9de7e0962cbed3ddf0ca1d67f9798bd6f95104bf/wxParse/emojis/48.gif
--------------------------------------------------------------------------------
/wxParse/emojis/49.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/best-fan/wechat-app-history/9de7e0962cbed3ddf0ca1d67f9798bd6f95104bf/wxParse/emojis/49.gif
--------------------------------------------------------------------------------
/wxParse/emojis/50.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/best-fan/wechat-app-history/9de7e0962cbed3ddf0ca1d67f9798bd6f95104bf/wxParse/emojis/50.gif
--------------------------------------------------------------------------------
/wxParse/emojis/51.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/best-fan/wechat-app-history/9de7e0962cbed3ddf0ca1d67f9798bd6f95104bf/wxParse/emojis/51.gif
--------------------------------------------------------------------------------
/wxParse/emojis/52.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/best-fan/wechat-app-history/9de7e0962cbed3ddf0ca1d67f9798bd6f95104bf/wxParse/emojis/52.gif
--------------------------------------------------------------------------------
/wxParse/emojis/53.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/best-fan/wechat-app-history/9de7e0962cbed3ddf0ca1d67f9798bd6f95104bf/wxParse/emojis/53.gif
--------------------------------------------------------------------------------
/wxParse/emojis/54.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/best-fan/wechat-app-history/9de7e0962cbed3ddf0ca1d67f9798bd6f95104bf/wxParse/emojis/54.gif
--------------------------------------------------------------------------------
/wxParse/emojis/55.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/best-fan/wechat-app-history/9de7e0962cbed3ddf0ca1d67f9798bd6f95104bf/wxParse/emojis/55.gif
--------------------------------------------------------------------------------
/wxParse/emojis/56.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/best-fan/wechat-app-history/9de7e0962cbed3ddf0ca1d67f9798bd6f95104bf/wxParse/emojis/56.gif
--------------------------------------------------------------------------------
/wxParse/emojis/57.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/best-fan/wechat-app-history/9de7e0962cbed3ddf0ca1d67f9798bd6f95104bf/wxParse/emojis/57.gif
--------------------------------------------------------------------------------
/wxParse/emojis/58.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/best-fan/wechat-app-history/9de7e0962cbed3ddf0ca1d67f9798bd6f95104bf/wxParse/emojis/58.gif
--------------------------------------------------------------------------------
/wxParse/emojis/59.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/best-fan/wechat-app-history/9de7e0962cbed3ddf0ca1d67f9798bd6f95104bf/wxParse/emojis/59.gif
--------------------------------------------------------------------------------
/wxParse/emojis/60.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/best-fan/wechat-app-history/9de7e0962cbed3ddf0ca1d67f9798bd6f95104bf/wxParse/emojis/60.gif
--------------------------------------------------------------------------------
/wxParse/emojis/61.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/best-fan/wechat-app-history/9de7e0962cbed3ddf0ca1d67f9798bd6f95104bf/wxParse/emojis/61.gif
--------------------------------------------------------------------------------
/wxParse/emojis/62.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/best-fan/wechat-app-history/9de7e0962cbed3ddf0ca1d67f9798bd6f95104bf/wxParse/emojis/62.gif
--------------------------------------------------------------------------------
/wxParse/emojis/63.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/best-fan/wechat-app-history/9de7e0962cbed3ddf0ca1d67f9798bd6f95104bf/wxParse/emojis/63.gif
--------------------------------------------------------------------------------
/wxParse/emojis/64.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/best-fan/wechat-app-history/9de7e0962cbed3ddf0ca1d67f9798bd6f95104bf/wxParse/emojis/64.gif
--------------------------------------------------------------------------------
/wxParse/emojis/65.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/best-fan/wechat-app-history/9de7e0962cbed3ddf0ca1d67f9798bd6f95104bf/wxParse/emojis/65.gif
--------------------------------------------------------------------------------
/wxParse/emojis/66.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/best-fan/wechat-app-history/9de7e0962cbed3ddf0ca1d67f9798bd6f95104bf/wxParse/emojis/66.gif
--------------------------------------------------------------------------------
/wxParse/emojis/67.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/best-fan/wechat-app-history/9de7e0962cbed3ddf0ca1d67f9798bd6f95104bf/wxParse/emojis/67.gif
--------------------------------------------------------------------------------
/wxParse/emojis/68.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/best-fan/wechat-app-history/9de7e0962cbed3ddf0ca1d67f9798bd6f95104bf/wxParse/emojis/68.gif
--------------------------------------------------------------------------------
/wxParse/emojis/69.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/best-fan/wechat-app-history/9de7e0962cbed3ddf0ca1d67f9798bd6f95104bf/wxParse/emojis/69.gif
--------------------------------------------------------------------------------
/wxParse/emojis/70.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/best-fan/wechat-app-history/9de7e0962cbed3ddf0ca1d67f9798bd6f95104bf/wxParse/emojis/70.gif
--------------------------------------------------------------------------------
/wxParse/emojis/71.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/best-fan/wechat-app-history/9de7e0962cbed3ddf0ca1d67f9798bd6f95104bf/wxParse/emojis/71.gif
--------------------------------------------------------------------------------
/wxParse/emojis/72.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/best-fan/wechat-app-history/9de7e0962cbed3ddf0ca1d67f9798bd6f95104bf/wxParse/emojis/72.gif
--------------------------------------------------------------------------------
/wxParse/emojis/73.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/best-fan/wechat-app-history/9de7e0962cbed3ddf0ca1d67f9798bd6f95104bf/wxParse/emojis/73.gif
--------------------------------------------------------------------------------
/wxParse/emojis/74.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/best-fan/wechat-app-history/9de7e0962cbed3ddf0ca1d67f9798bd6f95104bf/wxParse/emojis/74.gif
--------------------------------------------------------------------------------
/wxParse/emojis/75.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/best-fan/wechat-app-history/9de7e0962cbed3ddf0ca1d67f9798bd6f95104bf/wxParse/emojis/75.gif
--------------------------------------------------------------------------------
/wxParse/emojis/76.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/best-fan/wechat-app-history/9de7e0962cbed3ddf0ca1d67f9798bd6f95104bf/wxParse/emojis/76.gif
--------------------------------------------------------------------------------
/wxParse/emojis/77.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/best-fan/wechat-app-history/9de7e0962cbed3ddf0ca1d67f9798bd6f95104bf/wxParse/emojis/77.gif
--------------------------------------------------------------------------------
/wxParse/emojis/78.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/best-fan/wechat-app-history/9de7e0962cbed3ddf0ca1d67f9798bd6f95104bf/wxParse/emojis/78.gif
--------------------------------------------------------------------------------
/wxParse/emojis/79.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/best-fan/wechat-app-history/9de7e0962cbed3ddf0ca1d67f9798bd6f95104bf/wxParse/emojis/79.gif
--------------------------------------------------------------------------------
/wxParse/emojis/80.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/best-fan/wechat-app-history/9de7e0962cbed3ddf0ca1d67f9798bd6f95104bf/wxParse/emojis/80.gif
--------------------------------------------------------------------------------
/wxParse/emojis/81.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/best-fan/wechat-app-history/9de7e0962cbed3ddf0ca1d67f9798bd6f95104bf/wxParse/emojis/81.gif
--------------------------------------------------------------------------------
/wxParse/emojis/82.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/best-fan/wechat-app-history/9de7e0962cbed3ddf0ca1d67f9798bd6f95104bf/wxParse/emojis/82.gif
--------------------------------------------------------------------------------
/wxParse/emojis/83.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/best-fan/wechat-app-history/9de7e0962cbed3ddf0ca1d67f9798bd6f95104bf/wxParse/emojis/83.gif
--------------------------------------------------------------------------------
/wxParse/emojis/84.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/best-fan/wechat-app-history/9de7e0962cbed3ddf0ca1d67f9798bd6f95104bf/wxParse/emojis/84.gif
--------------------------------------------------------------------------------
/wxParse/emojis/85.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/best-fan/wechat-app-history/9de7e0962cbed3ddf0ca1d67f9798bd6f95104bf/wxParse/emojis/85.gif
--------------------------------------------------------------------------------
/wxParse/emojis/86.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/best-fan/wechat-app-history/9de7e0962cbed3ddf0ca1d67f9798bd6f95104bf/wxParse/emojis/86.gif
--------------------------------------------------------------------------------
/wxParse/emojis/87.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/best-fan/wechat-app-history/9de7e0962cbed3ddf0ca1d67f9798bd6f95104bf/wxParse/emojis/87.gif
--------------------------------------------------------------------------------
/wxParse/emojis/88.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/best-fan/wechat-app-history/9de7e0962cbed3ddf0ca1d67f9798bd6f95104bf/wxParse/emojis/88.gif
--------------------------------------------------------------------------------
/wxParse/emojis/89.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/best-fan/wechat-app-history/9de7e0962cbed3ddf0ca1d67f9798bd6f95104bf/wxParse/emojis/89.gif
--------------------------------------------------------------------------------
/wxParse/emojis/90.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/best-fan/wechat-app-history/9de7e0962cbed3ddf0ca1d67f9798bd6f95104bf/wxParse/emojis/90.gif
--------------------------------------------------------------------------------
/wxParse/emojis/91.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/best-fan/wechat-app-history/9de7e0962cbed3ddf0ca1d67f9798bd6f95104bf/wxParse/emojis/91.gif
--------------------------------------------------------------------------------
/wxParse/emojis/92.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/best-fan/wechat-app-history/9de7e0962cbed3ddf0ca1d67f9798bd6f95104bf/wxParse/emojis/92.gif
--------------------------------------------------------------------------------
/wxParse/emojis/93.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/best-fan/wechat-app-history/9de7e0962cbed3ddf0ca1d67f9798bd6f95104bf/wxParse/emojis/93.gif
--------------------------------------------------------------------------------
/wxParse/emojis/94.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/best-fan/wechat-app-history/9de7e0962cbed3ddf0ca1d67f9798bd6f95104bf/wxParse/emojis/94.gif
--------------------------------------------------------------------------------
/wxParse/emojis/95.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/best-fan/wechat-app-history/9de7e0962cbed3ddf0ca1d67f9798bd6f95104bf/wxParse/emojis/95.gif
--------------------------------------------------------------------------------
/wxParse/emojis/96.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/best-fan/wechat-app-history/9de7e0962cbed3ddf0ca1d67f9798bd6f95104bf/wxParse/emojis/96.gif
--------------------------------------------------------------------------------
/wxParse/emojis/97.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/best-fan/wechat-app-history/9de7e0962cbed3ddf0ca1d67f9798bd6f95104bf/wxParse/emojis/97.gif
--------------------------------------------------------------------------------
/wxParse/emojis/98.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/best-fan/wechat-app-history/9de7e0962cbed3ddf0ca1d67f9798bd6f95104bf/wxParse/emojis/98.gif
--------------------------------------------------------------------------------
/wxParse/emojis/99.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/best-fan/wechat-app-history/9de7e0962cbed3ddf0ca1d67f9798bd6f95104bf/wxParse/emojis/99.gif
--------------------------------------------------------------------------------
/wxParse/html2json.js:
--------------------------------------------------------------------------------
1 | /**
2 | * html2Json 改造来自: https://github.com/Jxck/html2json
3 | *
4 | *
5 | * author: Di (微信小程序开发工程师)
6 | * organization: WeAppDev(微信小程序开发论坛)(http://weappdev.com)
7 | * 垂直微信小程序开发交流社区
8 | *
9 | * github地址: https://github.com/icindy/wxParse
10 | *
11 | * for: 微信小程序富文本解析
12 | * detail : http://weappdev.com/t/wxparse-alpha0-1-html-markdown/184
13 | */
14 |
15 | var __placeImgeUrlHttps = "https";
16 | var __emojisReg = '';
17 | var __emojisBaseSrc = '';
18 | var __emojis = {};
19 | var wxDiscode = require('./wxDiscode.js');
20 | var HTMLParser = require('./htmlparser.js');
21 | // Empty Elements - HTML 5
22 | var empty = makeMap("area,base,basefont,br,col,frame,hr,img,input,link,meta,param,embed,command,keygen,source,track,wbr");
23 | // Block Elements - HTML 5
24 | var block = makeMap("br,a,code,address,article,applet,aside,audio,blockquote,button,canvas,center,dd,del,dir,div,dl,dt,fieldset,figcaption,figure,footer,form,frameset,h1,h2,h3,h4,h5,h6,header,hgroup,hr,iframe,ins,isindex,li,map,menu,noframes,noscript,object,ol,output,p,pre,section,script,table,tbody,td,tfoot,th,thead,tr,ul,video");
25 |
26 | // Inline Elements - HTML 5
27 | var inline = makeMap("abbr,acronym,applet,b,basefont,bdo,big,button,cite,del,dfn,em,font,i,iframe,img,input,ins,kbd,label,map,object,q,s,samp,script,select,small,span,strike,strong,sub,sup,textarea,tt,u,var");
28 |
29 | // Elements that you can, intentionally, leave open
30 | // (and which close themselves)
31 | var closeSelf = makeMap("colgroup,dd,dt,li,options,p,td,tfoot,th,thead,tr");
32 |
33 | // Attributes that have their values filled in disabled="disabled"
34 | var fillAttrs = makeMap("checked,compact,declare,defer,disabled,ismap,multiple,nohref,noresize,noshade,nowrap,readonly,selected");
35 |
36 | // Special Elements (can contain anything)
37 | var special = makeMap("wxxxcode-style,script,style,view,scroll-view,block");
38 | function makeMap(str) {
39 | var obj = {}, items = str.split(",");
40 | for (var i = 0; i < items.length; i++)
41 | obj[items[i]] = true;
42 | return obj;
43 | }
44 |
45 | function q(v) {
46 | return '"' + v + '"';
47 | }
48 |
49 | function removeDOCTYPE(html) {
50 | return html
51 | .replace(/<\?xml.*\?>\n/, '')
52 | .replace(/<.*!doctype.*\>\n/, '')
53 | .replace(/<.*!DOCTYPE.*\>\n/, '');
54 | }
55 |
56 | function trimHtml(html) {
57 | return html
58 | .replace(/\r?\n+/g, '')
59 | .replace(//ig, '')
60 | .replace(/\/\*.*?\*\//ig, '')
61 | .replace(/[ ]+
189 | // add to parents
190 | var parent = bufArray[0] || results;
191 | if (parent.nodes === undefined) {
192 | parent.nodes = [];
193 | }
194 | parent.nodes.push(node);
195 | } else {
196 | bufArray.unshift(node);
197 | }
198 | },
199 | end: function (tag) {
200 | //debug(tag);
201 | // merge into parent tag
202 | var node = bufArray.shift();
203 | if (node.tag !== tag) console.error('invalid state: mismatch end tag');
204 |
205 | //当有缓存source资源时于于video补上src资源
206 | if(node.tag === 'video' && results.source){
207 | node.attr.src = results.source;
208 | delete results.source;
209 | }
210 |
211 | if (bufArray.length === 0) {
212 | results.nodes.push(node);
213 | } else {
214 | var parent = bufArray[0];
215 | if (parent.nodes === undefined) {
216 | parent.nodes = [];
217 | }
218 | parent.nodes.push(node);
219 | }
220 | },
221 | chars: function (text) {
222 | //debug(text);
223 | var node = {
224 | node: 'text',
225 | text: text,
226 | textArray:transEmojiStr(text)
227 | };
228 |
229 | if (bufArray.length === 0) {
230 | node.index = index.toString()
231 | index += 1
232 | results.nodes.push(node);
233 | } else {
234 | var parent = bufArray[0];
235 | if (parent.nodes === undefined) {
236 | parent.nodes = [];
237 | }
238 | node.index = parent.index + '.' + parent.nodes.length
239 | parent.nodes.push(node);
240 | }
241 | },
242 | comment: function (text) {
243 | //debug(text);
244 | // var node = {
245 | // node: 'comment',
246 | // text: text,
247 | // };
248 | // var parent = bufArray[0];
249 | // if (parent.nodes === undefined) {
250 | // parent.nodes = [];
251 | // }
252 | // parent.nodes.push(node);
253 | },
254 | });
255 | return results;
256 | };
257 |
258 | function transEmojiStr(str){
259 | // var eReg = new RegExp("["+__reg+' '+"]");
260 | // str = str.replace(/\[([^\[\]]+)\]/g,':$1:')
261 |
262 | var emojiObjs = [];
263 | //如果正则表达式为空
264 | if(__emojisReg.length == 0 || !__emojis){
265 | var emojiObj = {}
266 | emojiObj.node = "text";
267 | emojiObj.text = str;
268 | array = [emojiObj];
269 | return array;
270 | }
271 | //这个地方需要调整
272 | str = str.replace(/\[([^\[\]]+)\]/g,':$1:')
273 | var eReg = new RegExp("[:]");
274 | var array = str.split(eReg);
275 | for(var i = 0; i < array.length; i++){
276 | var ele = array[i];
277 | var emojiObj = {};
278 | if(__emojis[ele]){
279 | emojiObj.node = "element";
280 | emojiObj.tag = "emoji";
281 | emojiObj.text = __emojis[ele];
282 | emojiObj.baseSrc= __emojisBaseSrc;
283 | }else{
284 | emojiObj.node = "text";
285 | emojiObj.text = ele;
286 | }
287 | emojiObjs.push(emojiObj);
288 | }
289 |
290 | return emojiObjs;
291 | }
292 |
293 | function emojisInit(reg='',baseSrc="/wxParse/emojis/",emojis){
294 | __emojisReg = reg;
295 | __emojisBaseSrc=baseSrc;
296 | __emojis=emojis;
297 | }
298 |
299 | module.exports = {
300 | html2json: html2json,
301 | emojisInit:emojisInit
302 | };
303 |
304 |
--------------------------------------------------------------------------------
/wxParse/htmlparser.js:
--------------------------------------------------------------------------------
1 | /**
2 | *
3 | * htmlParser改造自: https://github.com/blowsie/Pure-JavaScript-HTML5-Parser
4 | *
5 | * author: Di (微信小程序开发工程师)
6 | * organization: WeAppDev(微信小程序开发论坛)(http://weappdev.com)
7 | * 垂直微信小程序开发交流社区
8 | *
9 | * github地址: https://github.com/icindy/wxParse
10 | *
11 | * for: 微信小程序富文本解析
12 | * detail : http://weappdev.com/t/wxparse-alpha0-1-html-markdown/184
13 | */
14 | // Regular Expressions for parsing tags and attributes
15 | var startTag = /^<([-A-Za-z0-9_]+)((?:\s+[a-zA-Z_:][-a-zA-Z0-9_:.]*(?:\s*=\s*(?:(?:"[^"]*")|(?:'[^']*')|[^>\s]+))?)*)\s*(\/?)>/,
16 | endTag = /^<\/([-A-Za-z0-9_]+)[^>]*>/,
17 | attr = /([a-zA-Z_:][-a-zA-Z0-9_:.]*)(?:\s*=\s*(?:(?:"((?:\\.|[^"])*)")|(?:'((?:\\.|[^'])*)')|([^>\s]+)))?/g;
18 |
19 | // Empty Elements - HTML 5
20 | var empty = makeMap("area,base,basefont,br,col,frame,hr,img,input,link,meta,param,embed,command,keygen,source,track,wbr");
21 |
22 | // Block Elements - HTML 5
23 | var block = makeMap("a,address,code,article,applet,aside,audio,blockquote,button,canvas,center,dd,del,dir,div,dl,dt,fieldset,figcaption,figure,footer,form,frameset,h1,h2,h3,h4,h5,h6,header,hgroup,hr,iframe,ins,isindex,li,map,menu,noframes,noscript,object,ol,output,p,pre,section,script,table,tbody,td,tfoot,th,thead,tr,ul,video");
24 |
25 | // Inline Elements - HTML 5
26 | var inline = makeMap("abbr,acronym,applet,b,basefont,bdo,big,br,button,cite,del,dfn,em,font,i,iframe,img,input,ins,kbd,label,map,object,q,s,samp,script,select,small,span,strike,strong,sub,sup,textarea,tt,u,var");
27 |
28 | // Elements that you can, intentionally, leave open
29 | // (and which close themselves)
30 | var closeSelf = makeMap("colgroup,dd,dt,li,options,p,td,tfoot,th,thead,tr");
31 |
32 | // Attributes that have their values filled in disabled="disabled"
33 | var fillAttrs = makeMap("checked,compact,declare,defer,disabled,ismap,multiple,nohref,noresize,noshade,nowrap,readonly,selected");
34 |
35 | // Special Elements (can contain anything)
36 | var special = makeMap("wxxxcode-style,script,style,view,scroll-view,block");
37 |
38 | function HTMLParser(html, handler) {
39 | var index, chars, match, stack = [], last = html;
40 | stack.last = function () {
41 | return this[this.length - 1];
42 | };
43 |
44 | while (html) {
45 | chars = true;
46 |
47 | // Make sure we're not in a script or style element
48 | if (!stack.last() || !special[stack.last()]) {
49 |
50 | // Comment
51 | if (html.indexOf("");
53 |
54 | if (index >= 0) {
55 | if (handler.comment)
56 | handler.comment(html.substring(4, index));
57 | html = html.substring(index + 3);
58 | chars = false;
59 | }
60 |
61 | // end tag
62 | } else if (html.indexOf("") == 0) {
63 | match = html.match(endTag);
64 |
65 | if (match) {
66 | html = html.substring(match[0].length);
67 | match[0].replace(endTag, parseEndTag);
68 | chars = false;
69 | }
70 |
71 | // start tag
72 | } else if (html.indexOf("<") == 0) {
73 | match = html.match(startTag);
74 |
75 | if (match) {
76 | html = html.substring(match[0].length);
77 | match[0].replace(startTag, parseStartTag);
78 | chars = false;
79 | }
80 | }
81 |
82 | if (chars) {
83 | index = html.indexOf("<");
84 | var text = ''
85 | while (index === 0) {
86 | text += "<";
87 | html = html.substring(1);
88 | index = html.indexOf("<");
89 | }
90 | text += index < 0 ? html : html.substring(0, index);
91 | html = index < 0 ? "" : html.substring(index);
92 |
93 | if (handler.chars)
94 | handler.chars(text);
95 | }
96 |
97 | } else {
98 |
99 | html = html.replace(new RegExp("([\\s\\S]*?)<\/" + stack.last() + "[^>]*>"), function (all, text) {
100 | text = text.replace(/|/g, "$1$2");
101 | if (handler.chars)
102 | handler.chars(text);
103 |
104 | return "";
105 | });
106 |
107 |
108 | parseEndTag("", stack.last());
109 | }
110 |
111 | if (html == last)
112 | throw "Parse Error: " + html;
113 | last = html;
114 | }
115 |
116 | // Clean up any remaining tags
117 | parseEndTag();
118 |
119 | function parseStartTag(tag, tagName, rest, unary) {
120 | tagName = tagName.toLowerCase();
121 |
122 | if (block[tagName]) {
123 | while (stack.last() && inline[stack.last()]) {
124 | parseEndTag("", stack.last());
125 | }
126 | }
127 |
128 | if (closeSelf[tagName] && stack.last() == tagName) {
129 | parseEndTag("", tagName);
130 | }
131 |
132 | unary = empty[tagName] || !!unary;
133 |
134 | if (!unary)
135 | stack.push(tagName);
136 |
137 | if (handler.start) {
138 | var attrs = [];
139 |
140 | rest.replace(attr, function (match, name) {
141 | var value = arguments[2] ? arguments[2] :
142 | arguments[3] ? arguments[3] :
143 | arguments[4] ? arguments[4] :
144 | fillAttrs[name] ? name : "";
145 |
146 | attrs.push({
147 | name: name,
148 | value: value,
149 | escaped: value.replace(/(^|[^\\])"/g, '$1\\\"') //"
150 | });
151 | });
152 |
153 | if (handler.start) {
154 | handler.start(tagName, attrs, unary);
155 | }
156 |
157 | }
158 | }
159 |
160 | function parseEndTag(tag, tagName) {
161 | // If no tag name is provided, clean shop
162 | if (!tagName)
163 | var pos = 0;
164 |
165 | // Find the closest opened tag of the same type
166 | else {
167 | tagName = tagName.toLowerCase();
168 | for (var pos = stack.length - 1; pos >= 0; pos--)
169 | if (stack[pos] == tagName)
170 | break;
171 | }
172 | if (pos >= 0) {
173 | // Close all the open elements, up the stack
174 | for (var i = stack.length - 1; i >= pos; i--)
175 | if (handler.end)
176 | handler.end(stack[i]);
177 |
178 | // Remove the open elements from the stack
179 | stack.length = pos;
180 | }
181 | }
182 | };
183 |
184 |
185 | function makeMap(str) {
186 | var obj = {}, items = str.split(",");
187 | for (var i = 0; i < items.length; i++)
188 | obj[items[i]] = true;
189 | return obj;
190 | }
191 |
192 | module.exports = HTMLParser;
193 |
--------------------------------------------------------------------------------
/wxParse/wxDiscode.js:
--------------------------------------------------------------------------------
1 | // HTML 支持的数学符号
2 | function strNumDiscode(str){
3 | str = str.replace(/∀/g, '∀');
4 | str = str.replace(/∂/g, '∂');
5 | str = str.replace(/&exists;/g, '∃');
6 | str = str.replace(/∅/g, '∅');
7 | str = str.replace(/∇/g, '∇');
8 | str = str.replace(/∈/g, '∈');
9 | str = str.replace(/∉/g, '∉');
10 | str = str.replace(/∋/g, '∋');
11 | str = str.replace(/∏/g, '∏');
12 | str = str.replace(/∑/g, '∑');
13 | str = str.replace(/−/g, '−');
14 | str = str.replace(/∗/g, '∗');
15 | str = str.replace(/√/g, '√');
16 | str = str.replace(/∝/g, '∝');
17 | str = str.replace(/∞/g, '∞');
18 | str = str.replace(/∠/g, '∠');
19 | str = str.replace(/∧/g, '∧');
20 | str = str.replace(/∨/g, '∨');
21 | str = str.replace(/∩/g, '∩');
22 | str = str.replace(/∩/g, '∪');
23 | str = str.replace(/∫/g, '∫');
24 | str = str.replace(/∴/g, '∴');
25 | str = str.replace(/∼/g, '∼');
26 | str = str.replace(/≅/g, '≅');
27 | str = str.replace(/≈/g, '≈');
28 | str = str.replace(/≠/g, '≠');
29 | str = str.replace(/≤/g, '≤');
30 | str = str.replace(/≥/g, '≥');
31 | str = str.replace(/⊂/g, '⊂');
32 | str = str.replace(/⊃/g, '⊃');
33 | str = str.replace(/⊄/g, '⊄');
34 | str = str.replace(/⊆/g, '⊆');
35 | str = str.replace(/⊇/g, '⊇');
36 | str = str.replace(/⊕/g, '⊕');
37 | str = str.replace(/⊗/g, '⊗');
38 | str = str.replace(/⊥/g, '⊥');
39 | str = str.replace(/⋅/g, '⋅');
40 | return str;
41 | }
42 |
43 | //HTML 支持的希腊字母
44 | function strGreeceDiscode(str){
45 | str = str.replace(/Α/g, 'Α');
46 | str = str.replace(/Β/g, 'Β');
47 | str = str.replace(/Γ/g, 'Γ');
48 | str = str.replace(/Δ/g, 'Δ');
49 | str = str.replace(/Ε/g, 'Ε');
50 | str = str.replace(/Ζ/g, 'Ζ');
51 | str = str.replace(/Η/g, 'Η');
52 | str = str.replace(/Θ/g, 'Θ');
53 | str = str.replace(/Ι/g, 'Ι');
54 | str = str.replace(/Κ/g, 'Κ');
55 | str = str.replace(/Λ/g, 'Λ');
56 | str = str.replace(/Μ/g, 'Μ');
57 | str = str.replace(/Ν/g, 'Ν');
58 | str = str.replace(/Ξ/g, 'Ν');
59 | str = str.replace(/Ο/g, 'Ο');
60 | str = str.replace(/Π/g, 'Π');
61 | str = str.replace(/Ρ/g, 'Ρ');
62 | str = str.replace(/Σ/g, 'Σ');
63 | str = str.replace(/Τ/g, 'Τ');
64 | str = str.replace(/Υ/g, 'Υ');
65 | str = str.replace(/Φ/g, 'Φ');
66 | str = str.replace(/Χ/g, 'Χ');
67 | str = str.replace(/Ψ/g, 'Ψ');
68 | str = str.replace(/Ω/g, 'Ω');
69 |
70 | str = str.replace(/α/g, 'α');
71 | str = str.replace(/β/g, 'β');
72 | str = str.replace(/γ/g, 'γ');
73 | str = str.replace(/δ/g, 'δ');
74 | str = str.replace(/ε/g, 'ε');
75 | str = str.replace(/ζ/g, 'ζ');
76 | str = str.replace(/η/g, 'η');
77 | str = str.replace(/θ/g, 'θ');
78 | str = str.replace(/ι/g, 'ι');
79 | str = str.replace(/κ/g, 'κ');
80 | str = str.replace(/λ/g, 'λ');
81 | str = str.replace(/μ/g, 'μ');
82 | str = str.replace(/ν/g, 'ν');
83 | str = str.replace(/ξ/g, 'ξ');
84 | str = str.replace(/ο/g, 'ο');
85 | str = str.replace(/π/g, 'π');
86 | str = str.replace(/ρ/g, 'ρ');
87 | str = str.replace(/ς/g, 'ς');
88 | str = str.replace(/σ/g, 'σ');
89 | str = str.replace(/τ/g, 'τ');
90 | str = str.replace(/υ/g, 'υ');
91 | str = str.replace(/φ/g, 'φ');
92 | str = str.replace(/χ/g, 'χ');
93 | str = str.replace(/ψ/g, 'ψ');
94 | str = str.replace(/ω/g, 'ω');
95 | str = str.replace(/ϑ/g, 'ϑ');
96 | str = str.replace(/ϒ/g, 'ϒ');
97 | str = str.replace(/ϖ/g, 'ϖ');
98 | str = str.replace(/·/g, '·');
99 | return str;
100 | }
101 |
102 | //
103 |
104 | function strcharacterDiscode(str){
105 | // 加入常用解析
106 | str = str.replace(/ /g, ' ');
107 | str = str.replace(/"/g, "'");
108 | str = str.replace(/&/g, '&');
109 | // str = str.replace(/</g, '‹');
110 | // str = str.replace(/>/g, '›');
111 |
112 | str = str.replace(/</g, '<');
113 | str = str.replace(/>/g, '>');
114 | str = str.replace(/•/g, '•');
115 |
116 | return str;
117 | }
118 |
119 | // HTML 支持的其他实体
120 | function strOtherDiscode(str){
121 | str = str.replace(/Œ/g, 'Œ');
122 | str = str.replace(/œ/g, 'œ');
123 | str = str.replace(/Š/g, 'Š');
124 | str = str.replace(/š/g, 'š');
125 | str = str.replace(/Ÿ/g, 'Ÿ');
126 | str = str.replace(/ƒ/g, 'ƒ');
127 | str = str.replace(/ˆ/g, 'ˆ');
128 | str = str.replace(/˜/g, '˜');
129 | str = str.replace(/ /g, '');
130 | str = str.replace(/ /g, '');
131 | str = str.replace(/ /g, '');
132 | str = str.replace(//g, '');
133 | str = str.replace(//g, '');
134 | str = str.replace(//g, '');
135 | str = str.replace(//g, '');
136 | str = str.replace(/–/g, '–');
137 | str = str.replace(/—/g, '—');
138 | str = str.replace(/‘/g, '‘');
139 | str = str.replace(/’/g, '’');
140 | str = str.replace(/‚/g, '‚');
141 | str = str.replace(/“/g, '“');
142 | str = str.replace(/”/g, '”');
143 | str = str.replace(/„/g, '„');
144 | str = str.replace(/†/g, '†');
145 | str = str.replace(/‡/g, '‡');
146 | str = str.replace(/•/g, '•');
147 | str = str.replace(/…/g, '…');
148 | str = str.replace(/‰/g, '‰');
149 | str = str.replace(/′/g, '′');
150 | str = str.replace(/″/g, '″');
151 | str = str.replace(/‹/g, '‹');
152 | str = str.replace(/›/g, '›');
153 | str = str.replace(/‾/g, '‾');
154 | str = str.replace(/€/g, '€');
155 | str = str.replace(/™/g, '™');
156 |
157 | str = str.replace(/←/g, '←');
158 | str = str.replace(/↑/g, '↑');
159 | str = str.replace(/→/g, '→');
160 | str = str.replace(/↓/g, '↓');
161 | str = str.replace(/↔/g, '↔');
162 | str = str.replace(/↵/g, '↵');
163 | str = str.replace(/⌈/g, '⌈');
164 | str = str.replace(/⌉/g, '⌉');
165 |
166 | str = str.replace(/⌊/g, '⌊');
167 | str = str.replace(/⌋/g, '⌋');
168 | str = str.replace(/◊/g, '◊');
169 | str = str.replace(/♠/g, '♠');
170 | str = str.replace(/♣/g, '♣');
171 | str = str.replace(/♥/g, '♥');
172 |
173 | str = str.replace(/♦/g, '♦');
174 | str = str.replace(/'/g, '\'');
175 | return str;
176 | }
177 |
178 | function strMoreDiscode(str){
179 | str = str.replace(/\r\n/g,"");
180 | str = str.replace(/\n/g,"");
181 |
182 | str = str.replace(/code/g,"wxxxcode-style");
183 | return str;
184 | }
185 |
186 | function strDiscode(str){
187 | str = strNumDiscode(str);
188 | str = strGreeceDiscode(str);
189 | str = strcharacterDiscode(str);
190 | str = strOtherDiscode(str);
191 | str = strMoreDiscode(str);
192 | return str;
193 | }
194 | function urlToHttpUrl(url,rep){
195 |
196 | var patt1 = new RegExp("^//");
197 | var result = patt1.test(url);
198 | if(result){
199 | url = rep+":"+url;
200 | }
201 | return url;
202 | }
203 |
204 | module.exports = {
205 | strDiscode:strDiscode,
206 | urlToHttpUrl:urlToHttpUrl
207 | }
--------------------------------------------------------------------------------
/wxParse/wxParse.js:
--------------------------------------------------------------------------------
1 | /**
2 | * author: Di (微信小程序开发工程师)
3 | * organization: WeAppDev(微信小程序开发论坛)(http://weappdev.com)
4 | * 垂直微信小程序开发交流社区
5 | *
6 | * github地址: https://github.com/icindy/wxParse
7 | *
8 | * for: 微信小程序富文本解析
9 | * detail : http://weappdev.com/t/wxparse-alpha0-1-html-markdown/184
10 | */
11 |
12 | /**
13 | * utils函数引入
14 | **/
15 | import showdown from './showdown.js';
16 | import HtmlToJson from './html2json.js';
17 | /**
18 | * 配置及公有属性
19 | **/
20 | var realWindowWidth = 0;
21 | var realWindowHeight = 0;
22 | wx.getSystemInfo({
23 | success: function (res) {
24 | realWindowWidth = res.windowWidth
25 | realWindowHeight = res.windowHeight
26 | }
27 | })
28 | /**
29 | * 主函数入口区
30 | **/
31 | function wxParse(bindName = 'wxParseData', type='html', data='数据不能为空
', target,imagePadding) {
32 | var that = target;
33 | var transData = {};//存放转化后的数据
34 | if (type == 'html') {
35 | transData = HtmlToJson.html2json(data, bindName);
36 | // console.log(JSON.stringify(transData, ' ', ' '));
37 | } else if (type == 'md' || type == 'markdown') {
38 | var converter = new showdown.Converter();
39 | var html = converter.makeHtml(data);
40 | transData = HtmlToJson.html2json(html, bindName);
41 | //console.log(JSON.stringify(transData, ' ', ' '));
42 | }
43 | transData.view = {};
44 | transData.view.imagePadding = 0;
45 | if(typeof(imagePadding) != 'undefined'){
46 | transData.view.imagePadding = imagePadding
47 | }
48 | var bindData = {};
49 | bindData[bindName] = transData;
50 | that.setData(bindData)
51 | that.wxParseImgLoad = wxParseImgLoad;
52 | that.wxParseImgTap = wxParseImgTap;
53 | }
54 | // 图片点击事件
55 | function wxParseImgTap(e) {
56 | var that = this;
57 | var nowImgUrl = e.target.dataset.src;
58 | var tagFrom = e.target.dataset.from;
59 | if (typeof (tagFrom) != 'undefined' && tagFrom.length > 0) {
60 | wx.previewImage({
61 | current: nowImgUrl, // 当前显示图片的http链接
62 | urls: that.data[tagFrom].imageUrls // 需要预览的图片http链接列表
63 | })
64 | }
65 | }
66 |
67 | /**
68 | * 图片视觉宽高计算函数区
69 | **/
70 | function wxParseImgLoad(e) {
71 | var that = this;
72 | var tagFrom = e.target.dataset.from;
73 | var idx = e.target.dataset.idx;
74 | if (typeof (tagFrom) != 'undefined' && tagFrom.length > 0) {
75 | calMoreImageInfo(e, idx, that, tagFrom)
76 | }
77 | }
78 | // 假循环获取计算图片视觉最佳宽高
79 | function calMoreImageInfo(e, idx, that, bindName) {
80 | var temData = that.data[bindName];
81 | if (!temData || temData.images.length == 0) {
82 | return;
83 | }
84 | var temImages = temData.images;
85 | //因为无法获取view宽度 需要自定义padding进行计算,稍后处理
86 | var recal = wxAutoImageCal(e.detail.width, e.detail.height,that,bindName);
87 | // temImages[idx].width = recal.imageWidth;
88 | // temImages[idx].height = recal.imageheight;
89 | // temData.images = temImages;
90 | // var bindData = {};
91 | // bindData[bindName] = temData;
92 | // that.setData(bindData);
93 | var index = temImages[idx].index
94 | var key = `${bindName}`
95 | for (var i of index.split('.')) key+=`.nodes[${i}]`
96 | var keyW = key + '.width'
97 | var keyH = key + '.height'
98 | that.setData({
99 | [keyW]: recal.imageWidth,
100 | [keyH]: recal.imageheight,
101 | })
102 | }
103 |
104 | // 计算视觉优先的图片宽高
105 | function wxAutoImageCal(originalWidth, originalHeight,that,bindName) {
106 | //获取图片的原始长宽
107 | var windowWidth = 0, windowHeight = 0;
108 | var autoWidth = 0, autoHeight = 0;
109 | var results = {};
110 | var padding = that.data[bindName].view.imagePadding;
111 | windowWidth = realWindowWidth-2*padding;
112 | windowHeight = realWindowHeight;
113 | //判断按照那种方式进行缩放
114 | // console.log("windowWidth" + windowWidth);
115 | if (originalWidth > windowWidth) {//在图片width大于手机屏幕width时候
116 | autoWidth = windowWidth;
117 | // console.log("autoWidth" + autoWidth);
118 | autoHeight = (autoWidth * originalHeight) / originalWidth;
119 | // console.log("autoHeight" + autoHeight);
120 | results.imageWidth = autoWidth;
121 | results.imageheight = autoHeight;
122 | } else {//否则展示原来的数据
123 | results.imageWidth = originalWidth;
124 | results.imageheight = originalHeight;
125 | }
126 | return results;
127 | }
128 |
129 | function wxParseTemArray(temArrayName,bindNameReg,total,that){
130 | var array = [];
131 | var temData = that.data;
132 | var obj = null;
133 | for(var i = 0; i < total; i++){
134 | var simArr = temData[bindNameReg+i].nodes;
135 | array.push(simArr);
136 | }
137 |
138 | temArrayName = temArrayName || 'wxParseTemArray';
139 | obj = JSON.parse('{"'+ temArrayName +'":""}');
140 | obj[temArrayName] = array;
141 | that.setData(obj);
142 | }
143 |
144 | /**
145 | * 配置emojis
146 | *
147 | */
148 |
149 | function emojisInit(reg='',baseSrc="/wxParse/emojis/",emojis){
150 | HtmlToJson.emojisInit(reg,baseSrc,emojis);
151 | }
152 |
153 | module.exports = {
154 | wxParse: wxParse,
155 | wxParseTemArray:wxParseTemArray,
156 | emojisInit:emojisInit
157 | }
158 |
159 |
160 |
--------------------------------------------------------------------------------
/wxParse/wxParse.wxss:
--------------------------------------------------------------------------------
1 |
2 | /**
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; overflow:auto;
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 | margin-bottom: .9em;
41 | }
42 | .wxParse-h2 {
43 | font-size: 16px;
44 | font-weight: 400;
45 | margin-bottom: .34em;
46 | }
47 | .wxParse-h3 {
48 | font-weight: 400;
49 | font-size: 15px;
50 | margin-bottom: .34em;
51 | }
52 | .wxParse-h4 {
53 | font-weight: 400;
54 | font-size: 14px;
55 | margin-bottom: .24em;
56 | }
57 | .wxParse-h5 {
58 | font-weight: 400;
59 | font-size: 13px;
60 | margin-bottom: .14em;
61 | }
62 | .wxParse-h6 {
63 | font-weight: 400;
64 | font-size: 12px;
65 | margin-bottom: .04em;
66 | }
67 |
68 | .wxParse-h1, .wxParse-h2, .wxParse-h3, .wxParse-h4, .wxParse-h5, .wxParse-h6, .wxParse-b, .wxParse-strong { font-weight: bolder }
69 |
70 | .wxParse-i,.wxParse-cite,.wxParse-em,.wxParse-var,.wxParse-address{font-style:italic}
71 | .wxParse-pre,.wxParse-tt,.wxParse-code,.wxParse-kbd,.wxParse-samp{font-family:monospace}
72 | .wxParse-pre{white-space:pre}
73 | .wxParse-big{font-size:1.17em}
74 | .wxParse-small,.wxParse-sub,.wxParse-sup{font-size:.83em}
75 | .wxParse-sub{vertical-align:sub}
76 | .wxParse-sup{vertical-align:super}
77 | .wxParse-s,.wxParse-strike,.wxParse-del{text-decoration:line-through}
78 | /*wxparse-自定义个性化的css样式*/
79 | /*增加video的css样式*/
80 | .wxParse-strong,.wxParse-s{display: inline}
81 | .wxParse-a{
82 | color: deepskyblue;
83 | word-break:break-all;
84 | overflow:auto;
85 | }
86 |
87 | .wxParse-video{
88 | text-align: center;
89 | margin: 10px 0;
90 | }
91 |
92 | .wxParse-video-video{
93 | width:100%;
94 | }
95 |
96 | .wxParse-img{
97 | /*background-color: #efefef;*/
98 | overflow: hidden;
99 | }
100 |
101 | .wxParse-blockquote {
102 | margin: 0;
103 | padding:10px 0 10px 5px;
104 | font-family:Courier, Calibri,"宋体";
105 | background:#f5f5f5;
106 | border-left: 3px solid #dbdbdb;
107 | }
108 |
109 | .wxParse-code,.wxParse-wxxxcode-style{
110 | display: inline;
111 | background:#f5f5f5;
112 | }
113 | .wxParse-ul{
114 | margin: 20rpx 10rpx;
115 | }
116 |
117 | .wxParse-li,.wxParse-li-inner{
118 | display: flex;
119 | align-items: baseline;
120 | margin: 10rpx 0;
121 | }
122 | .wxParse-li-text{
123 |
124 | align-items: center;
125 | line-height: 20px;
126 | }
127 |
128 | .wxParse-li-circle{
129 | display: inline-flex;
130 | width: 5px;
131 | height: 5px;
132 | background-color: #333;
133 | margin-right: 5px;
134 | }
135 |
136 | .wxParse-li-square{
137 | display: inline-flex;
138 | width: 10rpx;
139 | height: 10rpx;
140 | background-color: #333;
141 | margin-right: 5px;
142 | }
143 | .wxParse-li-ring{
144 | display: inline-flex;
145 | width: 10rpx;
146 | height: 10rpx;
147 | border: 2rpx solid #333;
148 | border-radius: 50%;
149 | background-color: #fff;
150 | margin-right: 5px;
151 | }
152 |
153 | /*.wxParse-table{
154 | width: 100%;
155 | height: 400px;
156 | }
157 | .wxParse-thead,.wxParse-tfoot,.wxParse-tr{
158 | display: flex;
159 | flex-direction: row;
160 | }
161 | .wxParse-th,.wxParse-td{
162 | display: flex;
163 | width: 580px;
164 | overflow: auto;
165 | }*/
166 |
167 | .wxParse-u {
168 | text-decoration: underline;
169 | }
170 | .wxParse-hide{
171 | display: none;
172 | }
173 | .WxEmojiView{
174 | align-items: center;
175 | }
176 | .wxEmoji{
177 | width: 16px;
178 | height:16px;
179 | }
180 | .wxParse-tr{
181 | display: flex;
182 | border-right:1px solid #e0e0e0;
183 | border-bottom:1px solid #e0e0e0;
184 | border-top:1px solid #e0e0e0;
185 | }
186 | .wxParse-th,
187 | .wxParse-td{
188 | flex:1;
189 | padding:5px;
190 | font-size:28rpx;
191 | border-left:1px solid #e0e0e0;
192 | word-break: break-all;
193 | }
194 | .wxParse-td:last{
195 | border-top:1px solid #e0e0e0;
196 | }
197 | .wxParse-th{
198 | background:#f0f0f0;
199 | border-top:1px solid #e0e0e0;
200 | }
201 | .wxParse-del{
202 | display: inline;
203 | }
204 | .wxParse-figure {
205 | overflow: hidden;
206 | }
207 |
--------------------------------------------------------------------------------