├── .gitignore
├── README.md
├── app.js
├── app.json
├── app.wxss
├── config.js
├── pages
├── add-comment
│ ├── add-comment.js
│ ├── add-comment.json
│ ├── add-comment.wxml
│ └── add-comment.wxss
├── blog-info
│ ├── blog-info.js
│ ├── blog-info.json
│ ├── blog-info.wxml
│ └── blog-info.wxss
├── blog
│ ├── blog.js
│ ├── blog.json
│ ├── blog.wxml
│ └── blog.wxss
├── resume
│ ├── resume.js
│ ├── resume.json
│ ├── resume.wxml
│ └── resume.wxss
├── search
│ ├── search.js
│ ├── search.json
│ ├── search.wxml
│ └── search.wxss
├── sorts-log
│ ├── blog.js
│ ├── blog.json
│ ├── blog.wxml
│ └── blog.wxss
└── sorts
│ ├── sorts.js
│ ├── sorts.json
│ ├── sorts.wxml
│ └── sorts.wxss
├── project.config.json
├── project.private.config.json
├── sitemap.json
├── static
├── images
│ ├── about-active.png
│ ├── about.png
│ ├── add.png
│ ├── banner.jpg
│ ├── blog-active.png
│ ├── blog.png
│ ├── empty.svg
│ ├── logo.png
│ ├── search-active.png
│ ├── search.png
│ ├── sort-active.png
│ └── sort.png
└── weui.wxss
├── template.wxml
└── utils
├── api.js
└── util.js
/.gitignore:
--------------------------------------------------------------------------------
1 | .DS_Store
2 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | # emlog小程序版客户端
2 |
3 | 请先安装微信小程序辅助插件,然后配置config.js
4 | 插件地址: `https://github.com/jaeheng/emlog-api`
--------------------------------------------------------------------------------
/app.js:
--------------------------------------------------------------------------------
1 | //app.js
2 | import util from './utils/util.js'
3 | App({
4 | onLaunch: function(e) {
5 | console.log('onLaunch', e);
6 | },
7 |
8 | getSetting: function(cb) {
9 | let setting = this.globalData.setting;
10 | if (setting) {
11 | typeof cb === 'function' ? cb(setting) : setting;
12 | return true;
13 | }
14 | util.getSettings(success => {
15 | this.globalData.setting = success;
16 | typeof cb === 'function' ? cb(success) : setting;
17 | });
18 | },
19 |
20 | globalData: {
21 | setting: null
22 | }
23 | })
24 |
--------------------------------------------------------------------------------
/app.json:
--------------------------------------------------------------------------------
1 | {
2 | "pages": [
3 | "pages/blog/blog",
4 | "pages/blog-info/blog-info",
5 | "pages/resume/resume",
6 | "pages/sorts/sorts",
7 | "pages/add-comment/add-comment",
8 | "pages/sorts-log/blog",
9 | "pages/search/search"
10 | ],
11 | "window": {
12 | "backgroundTextStyle": "dark",
13 | "navigationBarBackgroundColor": "#fff",
14 | "navigationBarTitleText": "博客首页",
15 | "navigationBarTextStyle": "black"
16 | },
17 | "tabBar": {
18 | "color": "#333",
19 | "backgroundColor": "#fff",
20 | "selectedColor": "#1296db",
21 | "list": [
22 | {
23 | "pagePath": "pages/blog/blog",
24 | "text": "博客",
25 | "iconPath": "static/images/blog.png",
26 | "selectedIconPath": "static/images/blog-active.png"
27 | },
28 | {
29 | "pagePath": "pages/sorts/sorts",
30 | "text": "板块",
31 | "iconPath": "static/images/sort.png",
32 | "selectedIconPath": "static/images/sort-active.png"
33 | },
34 | {
35 | "pagePath": "pages/search/search",
36 | "text": "搜索",
37 | "iconPath": "static/images/search.png",
38 | "selectedIconPath": "static/images/search-active.png"
39 | },
40 | {
41 | "pagePath": "pages/resume/resume",
42 | "text": "关于",
43 | "iconPath": "static/images/about.png",
44 | "selectedIconPath": "static/images/about-active.png"
45 | }
46 | ]
47 | },
48 | "networkTimeout": {
49 | "request": 10000,
50 | "downloadFile": 100000
51 | },
52 | "debug": true,
53 | "sitemapLocation": "sitemap.json",
54 | "useExtendedLib": {
55 | "weui": true
56 | }
57 | }
--------------------------------------------------------------------------------
/app.wxss:
--------------------------------------------------------------------------------
1 | /**app.wxss**/
2 | .container {
3 | height: 100%;
4 | display: flex;
5 | flex-direction: column;
6 | justify-content: space-between;
7 | box-sizing: border-box;
8 | }
9 | .blog-view {
10 | background-color: #fff;
11 | }
12 | a {
13 | color: #378CC2;
14 | }
15 |
16 | button.red-btn {
17 | background-color: #378CC2;
18 | color: #fff;
19 | }
20 |
21 | button.red-btn:active,
22 | button.red-btn.button-hover {
23 | background-color: #137dc0;
24 | color: #fff;
25 | }
26 |
27 | button[disabled].red-btn,
28 | button[disabled].red-btn:active {
29 | background-color: #eee;
30 | color: #aaa;
31 | }
32 | /*列表*/
33 | .zh-list {
34 | border-top: 1px solid #f3f3f3;
35 | }
36 | .zh-list-item {
37 | height: 24px;
38 | line-height: 24px;
39 | font-size: 14px;
40 | padding: 10px;
41 | border-bottom: 1rpx solid #f3f3f3;
42 | }
43 | .zh-list-item .icon {
44 | height: 16px;
45 | width: 16px;
46 | margin-right: 10px;
47 | float: left;
48 | margin-top: 3px;
49 | }
50 | .zh-list-item .icon-right {
51 | float: right;
52 | margin-top: 6px;
53 | }
54 |
55 | .zh-list-item.list-item-link:active {
56 | background-color: #f3f3f3;
57 | }
58 |
59 | /*icon*/
60 | .icon-right {
61 | width: 12px;
62 | height: 12px;
63 | border-top: 1px solid #ccc;
64 | border-right: 1px solid #ccc;
65 | transform: rotate(45deg);
66 | }
67 |
68 | .page-title {
69 | padding: 20rpx 30rpx;
70 | font-size: 16px;
71 | line-height: 1.5;
72 | border-bottom: 1rpx solid #fafafa;
73 | }
74 |
75 | .article-item {
76 | padding: 30rpx 0rpx;
77 | margin: 0 30rpx;
78 | border-bottom: 1rpx solid #d3d3d3;
79 | }
80 | .article-item .info {
81 | overflow: hidden;
82 | }
83 | .article-item .username,
84 | .article-item .sort,
85 | .article-item .view,
86 | .article-item .time {
87 | font-size: 12px;
88 | line-height: 20px;
89 | margin-top: 5px;
90 | display: block;
91 | color: #aaa;
92 | }
93 | .article-item .view,
94 | .article-item .username,
95 | .article-item .sort {
96 | float: left;
97 | margin-right: 10px;
98 | }
99 | .article-item .time {
100 | float: right;
101 | }
102 | .article-item.with-pic {
103 | padding-right: 200rpx;
104 | position: relative;
105 | padding-bottom: 1.5em;
106 | min-height: 150rpx;
107 | }
108 | .article-item.with-pic .title {
109 | min-height: 3.5em;
110 | }
111 | .article-item.with-pic .info {
112 | position:absolute;
113 | width:100%;
114 | box-sizing:border-box;
115 | bottom:20rpx;
116 | }
117 | .article-item.with-pic .desc-img {
118 | position: absolute;
119 | right: 0;
120 | top: 20rpx;
121 | width: 180rpx;
122 | height: 145rpx;
123 | overflow: hidden;
124 | }
125 | .article-item .desc,
126 | .article-item .desc-with-pics {
127 | font-size: 14px;
128 | line-height: 1.5;
129 | color: #787878;
130 | }
131 | .article-item .desc-with-pics .desc-pics {
132 | display: flex;
133 | }
134 | .article-item .desc-with-pics .desc-img {
135 | flex: 1;
136 | padding: 20rpx 10rpx;
137 | height: 200rpx;
138 | }
139 |
140 | .article-item .title {
141 | display: block;
142 | font-size: 32rpx;
143 | margin-bottom: 10px;
144 | color:#202020;
145 | line-height: 1.5;
146 | }
147 | .article-item.article-info {
148 | background-color: transparent;
149 | }
150 | .article-item .article-item {
151 | border-left: 1px solid #666;
152 | background-color: #eee;
153 | margin: 10px 0;
154 | }
155 | .read-more {
156 | text-align: center;
157 | padding: 30rpx 0;
158 | font-size: 14px;
159 | color: #aaa;
160 | }
161 | .error {
162 | background-color:#ff0;
163 | text-align:center;
164 | padding:10px 0;
165 | color:#a00;
166 | font-size:14px;
167 | }
168 |
169 | .article-comment-item {
170 | border-bottom-color: #eee;
171 | }
172 |
173 | .article-comment-item .desc {
174 | color: #2b2b2b;
175 | }
176 |
177 | .article-comment-children {
178 | padding-left: 30rpx;
179 | }
180 | .article-comment-children .desc {
181 | margin: 0;
182 | font-size: 24rpx;
183 | }
184 | .add-comment {
185 | position: fixed;
186 | bottom: 15px;
187 | right: 15px;
188 | width: 110rpx;
189 | height: 110rpx;
190 | z-index: 999;
191 | }
192 | .add-comment:active {
193 | opacity: 0.8;
194 | }
195 |
196 | .banner {
197 | width: 100%;
198 | height: 260rpx;
199 | }
--------------------------------------------------------------------------------
/config.js:
--------------------------------------------------------------------------------
1 | module.exports = {
2 | /**
3 | * 接口域名地址
4 | * (必须安装emlog-api插件: https://github.com/jaeheng/emlog-api)
5 | * (请求接口时会自动加上插件地址: /content/plugins/wxa/api.php?route=)
6 | */
7 | domain: 'https://blog.phpat.com',
8 | /**
9 | * 加密字符串,配置不正确会导致发布文章提示“无权访问”
10 | */
11 | code: '883c7b721f6c6b646596acdba7edc87b'
12 | }
13 |
--------------------------------------------------------------------------------
/pages/add-comment/add-comment.js:
--------------------------------------------------------------------------------
1 | // add-comment.js
2 | import util from '../../utils/util.js'
3 | var app = getApp()
4 |
5 | Page({
6 |
7 | /**
8 | * 页面的初始数据
9 | */
10 | data: {
11 | gid: 0,
12 | comment: '',
13 | disabled: true,
14 | userInfo: {}
15 | },
16 |
17 | /**
18 | * 生命周期函数--监听页面加载
19 | */
20 | onLoad: function (options) {
21 | this.setData({
22 | gid: options.gid
23 | })
24 | },
25 |
26 | onShow: function () {
27 | var that = this
28 | wx.getUserInfo({
29 | success: function (res) {
30 | that.setData({
31 | userInfo: res.userInfo
32 | })
33 | }
34 | })
35 | },
36 |
37 | getUserinfoHandle: function (res) {
38 | console.log('res:', res)
39 | var that = this
40 | if (res.detail.errMsg === 'getUserInfo:ok') {
41 | var userInfo = res.detail.userInfo
42 | that.setData({
43 | userInfo: userInfo
44 | })
45 | wx.showToast({
46 | title: '授权成功',
47 | icon: 'success'
48 | })
49 | } else {
50 | wx.showModal({
51 | title: '授权失败',
52 | content: '请自行在小程序设置界面授权',
53 | success: function ({ confirm, cancel }) {
54 | wx.openSetting()
55 | }
56 | })
57 | }
58 | },
59 |
60 | changeHandle: function (e) {
61 | console.log('input comment')
62 | var gid = this.data.gid
63 | var comment = e.detail.value
64 | console.log('gid: ' + gid)
65 | console.log('comment: ' + comment)
66 |
67 | this.setData({
68 | comment: comment,
69 | disabled: gid === 0 || comment.length < 1
70 | })
71 | },
72 |
73 | addComment: function () {
74 | var gid = this.data.gid
75 | var comment = this.data.comment
76 | var poster = this.data.userInfo.nickName
77 |
78 | if (gid === 0 || comment.length < 1) {
79 | return false
80 | } else {
81 | util.addComment({ gid, comment, poster }, function (res) {
82 | wx.showToast({
83 | title: '评论成功,可能需要管理员审核才能显示',
84 | icon: 'none',
85 | success: function () {
86 | setTimeout(() => {
87 | wx.navigateBack()
88 | }, 300);
89 | }
90 | })
91 | }, function (msg) {
92 | wx.showToast({
93 | title: msg,
94 | icon: 'none'
95 | })
96 | })
97 | }
98 | }
99 | })
--------------------------------------------------------------------------------
/pages/add-comment/add-comment.json:
--------------------------------------------------------------------------------
1 | {
2 | "navigationBarTitleText": "评论"
3 | }
--------------------------------------------------------------------------------
/pages/add-comment/add-comment.wxml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | {{ userInfo.nickName }}
5 |
10 |
11 |
12 |
--------------------------------------------------------------------------------
/pages/add-comment/add-comment.wxss:
--------------------------------------------------------------------------------
1 | /* add-comment.wxss */
2 | .comment-box {
3 | border-bottom: 1px solid #eee;
4 | padding: 15px;
5 | font-size: 16px;
6 | width: 100%;
7 | min-height: 300rpx;
8 | }
9 |
10 | .red-btn {
11 | width: 90%;
12 | margin: 20px auto;
13 | }
--------------------------------------------------------------------------------
/pages/blog-info/blog-info.js:
--------------------------------------------------------------------------------
1 | // blog-info.js
2 | import util from '../../utils/util.js'
3 |
4 | var app = getApp();
5 |
6 | Page({
7 |
8 | /**
9 | * 页面的初始数据
10 | */
11 | data: {
12 | gid: 0,
13 | data: {},
14 | error: '',
15 | total: 0,
16 | page: 1,
17 | comments: [],
18 | isend: false,
19 | setting: {
20 | comment_pnum: 10
21 | }
22 | },
23 |
24 | /**
25 | * 生命周期函数--监听页面加载
26 | */
27 | onLoad: function (options) {
28 | console.log(options)
29 | this.setData({
30 | gid: options.gid
31 | })
32 | },
33 |
34 | /**
35 | * 生命周期函数--监听页面初次渲染完成
36 | */
37 | onShow: function () {
38 | this.getArticleInfo()
39 | this.getComments()
40 | var that = this
41 | app.getSetting(function(setting) {
42 | console.log('setting:', setting)
43 | that.setData({
44 | setting: setting
45 | })
46 | })
47 | },
48 |
49 | replyPost: function (e) {
50 | var gid = this.data.gid
51 | wx.navigateTo({
52 | url: '../add-comment/add-comment?gid=' + gid
53 | })
54 | },
55 |
56 | getArticleInfo: function () {
57 | var gid = this.data.gid
58 | var that = this
59 | util.getArticleInfo(gid, function (success) {
60 | success.content = success.content.replace(/
/g, '\div>');
63 | that.setData({
64 | data: success
65 | })
66 | }, function (error) {
67 | that.setData({
68 | error: error
69 | })
70 | })
71 | },
72 |
73 | getComments: function () {
74 | let isEnd = this.data.isend
75 | if (isEnd) return false
76 | var gid = this.data.gid
77 | var page = this.data.page
78 | var that = this
79 | var oldData = this.data.comments
80 |
81 | util.getArticleComments(gid, page, function (success) {
82 | console.log(success)
83 | that.setData({
84 | page: page + 1,
85 | comments: oldData.concat(success.list),
86 | total: success.total,
87 | isend: success.list.length < that.data.setting.comment_pnum
88 | })
89 |
90 | wx.stopPullDownRefresh()
91 | })
92 | },
93 |
94 | onPullDownRefresh: function () {
95 | this.getArticleInfo()
96 | },
97 | onReachBottom: function () {
98 | this.getComments()
99 | },
100 | onShareAppMessage: function (res) {
101 | return {
102 | title: this.data.data.title
103 | }
104 | },
105 | onShareTimeline: function (res) {
106 | return {
107 | title: this.data.data.title
108 | }
109 | }
110 | })
--------------------------------------------------------------------------------
/pages/blog-info/blog-info.json:
--------------------------------------------------------------------------------
1 | {
2 | "navigationBarTitleText": "文章详情",
3 | "enablePullDownRefresh": false
4 | }
--------------------------------------------------------------------------------
/pages/blog-info/blog-info.wxml:
--------------------------------------------------------------------------------
1 |
2 |
3 | {{ error }}
4 | {{ data.title }}
5 |
6 |
7 | {{ data.sortname }}
8 | 浏览:{{ data.views }}
9 | {{ data.date }}
10 |
11 |
12 | 发布者: {{ data.wxa_poster || data.nickname }}
13 |
14 |
15 |
16 |
17 |
20 |
21 |
22 | 最新评论
23 |
37 |
38 |
--------------------------------------------------------------------------------
/pages/blog-info/blog-info.wxss:
--------------------------------------------------------------------------------
1 | /* blog-info.wxss */
2 | .wxParse-pre {
3 | white-space: normal;
4 | width: 100%;
5 | }
6 | .p {
7 | margin-top: 15px;
8 | width: 100%;
9 | overflow: hidden;
10 | word-break: break-all;
11 | }
12 |
13 | .comment-btn {
14 | text-align: right;
15 | padding: 10px 0;
16 | font-size: 12px;
17 | color: #fff;
18 | }
19 | .comment-btn text {
20 | background-color: #FF4949;
21 | display: inline-block;
22 | padding: 20rpx 40rpx;
23 | box-shadow: 0 4px 5px #ccc;
24 | }
25 | .comment-btn text:active {
26 | box-shadow: 0 1px 5px #ccc;
27 | background-color: #ee4949;
28 | }
29 | .article-info {
30 | border-bottom: none;
31 | padding-bottom: 46px;
32 | padding-top: 10rpx;
33 | }
34 | .info {
35 | margin-bottom: 20rpx;
36 | }
37 | .cnbtn {
38 | position: fixed;
39 | bottom:0;
40 | left:0;
41 | right: 0;
42 | border-radius: 0;
43 | }
44 | .rich-img {
45 | max-width: 100%!important;
46 | height: auto!important;
47 | }
--------------------------------------------------------------------------------
/pages/blog/blog.js:
--------------------------------------------------------------------------------
1 | // blog.js
2 | import util from '../../utils/util.js';
3 | let app = getApp();
4 |
5 | Page({
6 |
7 | /**
8 | * 页面的初始数据
9 | */
10 | data: {
11 | page: 0,
12 | data: [],
13 | loading: true, // 是否显示loading
14 | isend: false, // 是否最后一页
15 | imgUrl: util.getRandomBanner(),
16 | setting: {},
17 | keyword: ""
18 | },
19 |
20 | /**
21 | * 生命周期函数--监听页面加载
22 | */
23 | onLoad: function (options) {
24 | this.getData();
25 | },
26 |
27 | showblogInfo: function (event) {
28 | var gid = event.currentTarget.dataset.gid
29 | wx.navigateTo({
30 | url: '../blog-info/blog-info?gid=' + gid
31 | })
32 | },
33 |
34 | getData: function (fromStart) {
35 | let isEnd = this.data.isend
36 | if (isEnd && !fromStart) return false
37 | var page = fromStart ? 1 : this.data.page + 1
38 | let that = this
39 | let oldData = this.data.data
40 | app.getSetting(setting => {
41 | util.getArticle(page, 0, '', function (data) {
42 | that.setData({
43 | page: page,
44 | data: fromStart ? data : oldData.concat(data),
45 | isend: data.length < setting.index_lognum // 判断每页文章条数,小于这条数说明是最后一页
46 | })
47 | wx.stopPullDownRefresh()
48 | });
49 | });
50 | },
51 | onReachBottom: function () {
52 | this.getData();
53 | },
54 |
55 | onPullDownRefresh: function () {
56 | this.getData(1);
57 | },
58 |
59 | onShareAppMessage: function (res) {
60 | return {
61 | }
62 | },
63 | onShareTimeline: function (res) {
64 | return {}
65 | },
66 | /**
67 | * 生命周期函数--监听页面初次渲染完成
68 | */
69 | onShow: function () {
70 | var that = this
71 | app.getSetting(function(setting) {
72 | console.log('setting:', setting)
73 | that.setData({
74 | setting: setting
75 | })
76 | })
77 | }
78 | })
--------------------------------------------------------------------------------
/pages/blog/blog.json:
--------------------------------------------------------------------------------
1 | {
2 | "navigationBarTitleText": "EM小程序演示",
3 | "enablePullDownRefresh": true
4 | }
--------------------------------------------------------------------------------
/pages/blog/blog.wxml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 | {{ isend ? '无更多数据' : '加载中...' }}
13 |
14 |
--------------------------------------------------------------------------------
/pages/blog/blog.wxss:
--------------------------------------------------------------------------------
1 | /* blog.wxss */
--------------------------------------------------------------------------------
/pages/resume/resume.js:
--------------------------------------------------------------------------------
1 | // resume.js
2 | import util from '../../utils/util.js'
3 | let app = getApp();
4 | Page({
5 |
6 | /**
7 | * 页面的初始数据
8 | */
9 | data: {
10 | setting: {}
11 | },
12 |
13 | onReady: function () {
14 | app.getSetting(setting => {
15 | this.setData({
16 | setting: setting
17 | })
18 | })
19 | }
20 | })
--------------------------------------------------------------------------------
/pages/resume/resume.json:
--------------------------------------------------------------------------------
1 | {
2 | "navigationBarTitleText": "关于"
3 | }
--------------------------------------------------------------------------------
/pages/resume/resume.wxml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
7 |
8 |
9 | 博客介绍
10 |
11 | {{ setting.bloginfo }}
12 |
13 |
14 |
15 | 联系我
16 |
17 | Email: {{ setting.user_email }}
18 |
19 |
20 |
21 |
--------------------------------------------------------------------------------
/pages/resume/resume.wxss:
--------------------------------------------------------------------------------
1 | /* resume.wxss */
2 | page {
3 | background-color: #f3f3f3;
4 | }
5 | .resume_header {
6 | background-color: #337adf;
7 | text-align: center;
8 | padding: 40rpx 0;
9 | }
10 | .resume-pic {
11 | width: 128rpx;
12 | height: 128rpx;
13 | border-radius: 50%;
14 | border: 8rpx solid #fff;
15 | margin: 0 auto 40rpx;
16 | display: block;
17 | background: #fff;
18 | }
19 | .resume_header .name {
20 | color: #fff;
21 | }
22 | .resume_header .desc {
23 | color: #2367c7;
24 | }
25 | .section {
26 | background-color: #fff;
27 | padding: 0 30rpx;
28 | margin-top: 30rpx;
29 | }
30 | .section-title {
31 | padding: 18rpx 0;
32 | border-bottom: 1rpx solid #ddd;
33 | }
34 | .section-body {
35 | padding: 30rpx 0;
36 | line-height: 2em;
37 | }
38 |
39 | .timeline {
40 | padding-left: 30rpx;
41 | border-left: 2rpx solid #eee;
42 | padding-bottom: 60rpx;
43 | }
44 | .timeline .time {
45 | position: relative;
46 | }
47 | .timeline .time-current {
48 | position: absolute;
49 | top: 0;
50 | bottom: 0;
51 | left: -42rpx;
52 | margin: auto 0;
53 | background: #378CC2;
54 | border-radius: 50%;
55 | width: 12rpx;
56 | height: 12rpx;
57 | border: 6rpx solid #eee;
58 | }
59 | .timeline .content {
60 | color: #999;
61 | }
62 | .timeline .strong {
63 | color: #333;
64 | }
65 | .ul {
66 | padding-left: 1.2em;
67 | }
68 | .ul .li {
69 | display: list-item;
70 | list-style-type: circle;
71 | }
--------------------------------------------------------------------------------
/pages/search/search.js:
--------------------------------------------------------------------------------
1 | // pages/search.js
2 | import util from '../../utils/util.js';
3 | Page({
4 |
5 | /**
6 | * 页面的初始数据
7 | */
8 | data: {
9 | isEmpty: true,
10 | show: false
11 | },
12 |
13 | /**
14 | * 生命周期函数--监听页面加载
15 | */
16 | onLoad: function (options) {
17 | this.setData({
18 | search: this.search.bind(this)
19 | })
20 | },
21 |
22 | /**
23 | * 生命周期函数--监听页面初次渲染完成
24 | */
25 | onReady: function () {
26 |
27 | },
28 |
29 | /**
30 | * 生命周期函数--监听页面显示
31 | */
32 | onShow: function () {
33 |
34 | },
35 |
36 | /**
37 | * 生命周期函数--监听页面隐藏
38 | */
39 | onHide: function () {
40 |
41 | },
42 |
43 | /**
44 | * 生命周期函数--监听页面卸载
45 | */
46 | onUnload: function () {
47 |
48 | },
49 |
50 | /**
51 | * 页面相关事件处理函数--监听用户下拉动作
52 | */
53 | onPullDownRefresh: function () {
54 |
55 | },
56 |
57 | /**
58 | * 页面上拉触底事件的处理函数
59 | */
60 | onReachBottom: function () {
61 |
62 | },
63 |
64 | /**
65 | * 用户点击右上角分享
66 | */
67 | onShareAppMessage: function () {
68 |
69 | },
70 |
71 | search: function (value) {
72 | console.log(value)
73 | return new Promise((resolve, reject) => {
74 | let that = this
75 | this.setData({
76 | show: true
77 | })
78 | util.getArticle(1, 0, value, function (data) {
79 | const list = data.map(item => {
80 | return {
81 | text: item.title,
82 | value: item.gid
83 | }
84 | })
85 | that.setData({
86 | isEmpty: list.length === 0,
87 | show: false
88 | })
89 | resolve(list)
90 | });
91 | })
92 | },
93 | selectResult: function (e) {
94 | var gid = e.detail.item.value
95 | wx.navigateTo({
96 | url: '../blog-info/blog-info?gid=' + gid
97 | })
98 | }
99 | })
--------------------------------------------------------------------------------
/pages/search/search.json:
--------------------------------------------------------------------------------
1 | {
2 | "usingComponents": {
3 | "mp-searchbar": "weui-miniprogram/searchbar/searchbar",
4 | "mp-loading": "weui-miniprogram/loading/loading"
5 | },
6 | "navigationBarTitleText": "搜索文章"
7 | }
--------------------------------------------------------------------------------
/pages/search/search.wxml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 | 未搜索到文章
8 |
9 |
10 |
--------------------------------------------------------------------------------
/pages/search/search.wxss:
--------------------------------------------------------------------------------
1 | /* pages/search.wxss */
--------------------------------------------------------------------------------
/pages/sorts-log/blog.js:
--------------------------------------------------------------------------------
1 | // blog.js
2 | import util from '../../utils/util.js';
3 | let app = getApp();
4 |
5 | Page({
6 |
7 | /**
8 | * 页面的初始数据
9 | */
10 | data: {
11 | sortname: '',
12 | sid: 0,
13 | page: 0,
14 | data: [],
15 | loading: true, // 是否显示loading
16 | isend: false, // 是否最后一页
17 | imgUrl: util.getRandomBanner()
18 | },
19 |
20 | /**
21 | * 生命周期函数--监听页面加载
22 | */
23 | onLoad: function (options) {
24 | this.setData({
25 | sid: options.sid,
26 | sortname: options.sortname
27 | })
28 | this.getData();
29 | },
30 |
31 | showblogInfo: function (event) {
32 | console.log(event)
33 | var gid = event.currentTarget.dataset.gid
34 | wx.navigateTo({
35 | url: '../blog-info/blog-info?gid=' + gid
36 | })
37 | },
38 |
39 | getData: function (fromStart) {
40 | let isEnd = this.data.isend
41 | if (isEnd && !fromStart) return false
42 | var page = fromStart ? 1 : this.data.page + 1
43 | let that = this
44 | let oldData = this.data.data
45 | let sid = this.data.sid
46 | app.getSetting(setting => {
47 | console.log('setting', setting);
48 | util.getArticle(page, sid, '', function (data) {
49 | that.setData({
50 | page: page,
51 | data: fromStart ? data : oldData.concat(data),
52 | isend: data.length < setting.index_lognum // 判断每页文章条数,小于这条数说明是最后一页
53 | })
54 |
55 | wx.stopPullDownRefresh()
56 | });
57 | });
58 | },
59 | onReachBottom: function () {
60 | this.getData();
61 | },
62 |
63 | onPullDownRefresh: function () {
64 | this.getData(1);
65 | },
66 |
67 | onReady: function () {
68 | var sortname = this.data.sortname
69 | console.log(sortname)
70 | wx.setNavigationBarTitle({
71 | title: sortname
72 | })
73 | }
74 | })
--------------------------------------------------------------------------------
/pages/sorts-log/blog.json:
--------------------------------------------------------------------------------
1 | {
2 | "navigationBarTitleText": "分类文章列表",
3 | "enablePullDownRefresh": true
4 | }
--------------------------------------------------------------------------------
/pages/sorts-log/blog.wxml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 | {{ isend ? '无更多数据' : '加载中...' }}
13 |
14 |
--------------------------------------------------------------------------------
/pages/sorts-log/blog.wxss:
--------------------------------------------------------------------------------
1 | /* blog.wxss */
--------------------------------------------------------------------------------
/pages/sorts/sorts.js:
--------------------------------------------------------------------------------
1 | // pages/sorts/sorts.js
2 | import util from '../../utils/util.js'
3 |
4 | Page({
5 |
6 | /**
7 | * 页面的初始数据
8 | */
9 | data: {
10 | sorts: []
11 | },
12 |
13 | /**
14 | * 生命周期函数--监听页面加载
15 | */
16 | onLoad: function (options) {
17 | this.getSorts();
18 | },
19 | /**
20 | * 用户点击右上角分享
21 | */
22 | onShareAppMessage: function () {
23 | },
24 |
25 | getSorts: function () {
26 | util.getSorts(success => {
27 | console.log(success)
28 | this.setData({
29 | sorts: success
30 | })
31 | })
32 | },
33 | goSortLogs: function (event) {
34 | console.log(event)
35 | var sid = event.currentTarget.dataset.sid;
36 | var sortname = event.currentTarget.dataset.sortname;
37 | wx.navigateTo({
38 | url: '../sorts-log/blog?sid=' + sid + '&sortname=' + sortname
39 | });
40 | },
41 | onShareTimeline: function (res) {
42 | return {}
43 | }
44 | })
--------------------------------------------------------------------------------
/pages/sorts/sorts.json:
--------------------------------------------------------------------------------
1 | {
2 | "navigationBarTitleText": "板块"
3 | }
--------------------------------------------------------------------------------
/pages/sorts/sorts.wxml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 | {{ sortname }}
15 | {{ description }}
16 | {{ lognum }}
17 |
18 |
19 |
20 |
--------------------------------------------------------------------------------
/pages/sorts/sorts.wxss:
--------------------------------------------------------------------------------
1 | /* pages/sorts/sorts.wxss */
2 | .sorts {
3 | display: flex;
4 | flex-wrap: wrap;
5 | padding: 10rpx;
6 | }
7 | .sorts-item {
8 | width: 100%;
9 | box-sizing: border-box;
10 | padding: 10rpx;
11 | vertical-align: top;
12 | margin-bottom: 10px;
13 | }
14 | .sorts-item .item-link {
15 | border: 1px solid #f3f3f3;
16 | padding: 50rpx 30rpx;
17 | position: relative;
18 | height: 100%;
19 | box-sizing: border-box;
20 | background: #fff;
21 | box-shadow: 0 5px 15px -5px rgba(0,0,0,.3);
22 | }
23 | .sorts-item .title {
24 | font-size: 40rpx;
25 | padding-right: 50rpx;
26 | }
27 | .sorts-item .desc {
28 | font-size: 30rpx;
29 | margin-top: 1em;
30 | color: #666;
31 | }
32 | .sorts-item .num {
33 | position: absolute;
34 | right: 30rpx;
35 | top: 20rpx;
36 | font-size: 60rpx;
37 | }
--------------------------------------------------------------------------------
/project.config.json:
--------------------------------------------------------------------------------
1 | {
2 | "description": "项目配置文件。",
3 | "setting": {
4 | "urlCheck": true,
5 | "es6": true,
6 | "enhance": true,
7 | "postcss": false,
8 | "preloadBackgroundData": false,
9 | "minified": true,
10 | "newFeature": true,
11 | "coverView": true,
12 | "nodeModules": true,
13 | "autoAudits": true,
14 | "showShadowRootInWxmlPanel": true,
15 | "scopeDataCheck": false,
16 | "uglifyFileName": true,
17 | "checkInvalidKey": true,
18 | "checkSiteMap": true,
19 | "uploadWithSourceMap": true,
20 | "compileHotReLoad": false,
21 | "lazyloadPlaceholderEnable": false,
22 | "useMultiFrameRuntime": true,
23 | "useApiHook": true,
24 | "useApiHostProcess": false,
25 | "babelSetting": {
26 | "ignore": [],
27 | "disablePlugins": [],
28 | "outputPath": ""
29 | },
30 | "enableEngineNative": false,
31 | "useIsolateContext": true,
32 | "userConfirmedBundleSwitch": false,
33 | "packNpmManually": false,
34 | "packNpmRelationList": [],
35 | "minifyWXSS": true,
36 | "showES6CompileOption": false
37 | },
38 | "compileType": "miniprogram",
39 | "libVersion": "2.18.0",
40 | "appid": "wx4f6bf6a4274d956c",
41 | "projectname": "emlog-wxa",
42 | "simulatorType": "wechat",
43 | "simulatorPluginLibVersion": {},
44 | "qqappid": "1108100302",
45 | "scripts": {
46 | "beforeCompile": "",
47 | "beforePreview": "",
48 | "beforeUpload": ""
49 | },
50 | "qqLibVersion": "1.16.0",
51 | "condition": {
52 | "search": {
53 | "list": []
54 | },
55 | "conversation": {
56 | "list": []
57 | },
58 | "plugin": {
59 | "list": []
60 | },
61 | "game": {
62 | "list": []
63 | },
64 | "gamePlugin": {
65 | "list": []
66 | },
67 | "miniprogram": {
68 | "list": [
69 | {
70 | "id": 0,
71 | "name": "板块",
72 | "pathName": "pages/sorts/sorts",
73 | "query": ""
74 | },
75 | {
76 | "id": -1,
77 | "name": "关于",
78 | "pathName": "pages/resume/resume",
79 | "query": ""
80 | },
81 | {
82 | "id": -1,
83 | "name": "文章页",
84 | "pathName": "pages/blog-info/blog-info",
85 | "query": "gid=463"
86 | },
87 | {
88 | "id": -1,
89 | "name": "pages/blog-info/blog-info",
90 | "pathName": "pages/blog-info/blog-info",
91 | "query": "gid=1216",
92 | "scene": null
93 | },
94 | {
95 | "id": -1,
96 | "name": "pages/add-comment/add-comment",
97 | "pathName": "pages/add-comment/add-comment",
98 | "query": "gid=1216",
99 | "scene": null
100 | },
101 | {
102 | "id": -1,
103 | "name": "pages/add-blog/add-blog",
104 | "pathName": "pages/add-blog/add-blog",
105 | "query": "",
106 | "scene": null
107 | }
108 | ]
109 | }
110 | }
111 | }
--------------------------------------------------------------------------------
/project.private.config.json:
--------------------------------------------------------------------------------
1 | {
2 | "setting": {},
3 | "condition": {
4 | "plugin": {
5 | "list": []
6 | },
7 | "game": {
8 | "list": []
9 | },
10 | "gamePlugin": {
11 | "list": []
12 | },
13 | "miniprogram": {
14 | "list": [
15 | {
16 | "id": 0,
17 | "name": "板块",
18 | "pathName": "pages/sorts/sorts",
19 | "query": ""
20 | },
21 | {
22 | "id": -1,
23 | "name": "关于",
24 | "pathName": "pages/resume/resume",
25 | "query": ""
26 | },
27 | {
28 | "id": -1,
29 | "name": "文章页",
30 | "pathName": "pages/blog-info/blog-info",
31 | "query": "gid=463"
32 | },
33 | {
34 | "name": "pages/blog-info/blog-info",
35 | "pathName": "pages/blog-info/blog-info",
36 | "query": "gid=475",
37 | "scene": null
38 | },
39 | {
40 | "id": -1,
41 | "name": "pages/add-comment/add-comment",
42 | "pathName": "pages/add-comment/add-comment",
43 | "query": "gid=1216",
44 | "scene": null
45 | },
46 | {
47 | "name": "pages/search/search",
48 | "pathName": "pages/search/search",
49 | "query": "",
50 | "scene": null
51 | }
52 | ]
53 | }
54 | }
55 | }
--------------------------------------------------------------------------------
/sitemap.json:
--------------------------------------------------------------------------------
1 | {
2 | "desc": "关于本文件的更多信息,请参考文档 https://developers.weixin.qq.com/miniprogram/dev/framework/sitemap.html",
3 | "rules": [{
4 | "action": "allow",
5 | "page": "*"
6 | }]
7 | }
--------------------------------------------------------------------------------
/static/images/about-active.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/jaeheng/emlog-wxa/2ac8d319bdf37973f92043153af9e7b20a62d936/static/images/about-active.png
--------------------------------------------------------------------------------
/static/images/about.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/jaeheng/emlog-wxa/2ac8d319bdf37973f92043153af9e7b20a62d936/static/images/about.png
--------------------------------------------------------------------------------
/static/images/add.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/jaeheng/emlog-wxa/2ac8d319bdf37973f92043153af9e7b20a62d936/static/images/add.png
--------------------------------------------------------------------------------
/static/images/banner.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/jaeheng/emlog-wxa/2ac8d319bdf37973f92043153af9e7b20a62d936/static/images/banner.jpg
--------------------------------------------------------------------------------
/static/images/blog-active.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/jaeheng/emlog-wxa/2ac8d319bdf37973f92043153af9e7b20a62d936/static/images/blog-active.png
--------------------------------------------------------------------------------
/static/images/blog.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/jaeheng/emlog-wxa/2ac8d319bdf37973f92043153af9e7b20a62d936/static/images/blog.png
--------------------------------------------------------------------------------
/static/images/empty.svg:
--------------------------------------------------------------------------------
1 |
2 |
3 |
1601 |
--------------------------------------------------------------------------------
/static/images/logo.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/jaeheng/emlog-wxa/2ac8d319bdf37973f92043153af9e7b20a62d936/static/images/logo.png
--------------------------------------------------------------------------------
/static/images/search-active.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/jaeheng/emlog-wxa/2ac8d319bdf37973f92043153af9e7b20a62d936/static/images/search-active.png
--------------------------------------------------------------------------------
/static/images/search.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/jaeheng/emlog-wxa/2ac8d319bdf37973f92043153af9e7b20a62d936/static/images/search.png
--------------------------------------------------------------------------------
/static/images/sort-active.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/jaeheng/emlog-wxa/2ac8d319bdf37973f92043153af9e7b20a62d936/static/images/sort-active.png
--------------------------------------------------------------------------------
/static/images/sort.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/jaeheng/emlog-wxa/2ac8d319bdf37973f92043153af9e7b20a62d936/static/images/sort.png
--------------------------------------------------------------------------------
/static/weui.wxss:
--------------------------------------------------------------------------------
1 | /*!
2 | * weui.js v1.1.0 (https://github.com/weui/weui-wxss)
3 | * Copyright 2016, wechat ui team
4 | * MIT license
5 | */
6 | page {
7 | line-height: 1.6;
8 | font-family: -apple-system-font, "Helvetica Neue", sans-serif;
9 | }
10 | icon {
11 | vertical-align: middle;
12 | }
13 | .weui-cells {
14 | position: relative;
15 | margin-top: 1.17647059em;
16 | background-color: #FFFFFF;
17 | line-height: 1.41176471;
18 | font-size: 17px;
19 | }
20 | .weui-cells:before {
21 | content: " ";
22 | position: absolute;
23 | left: 0;
24 | top: 0;
25 | right: 0;
26 | height: 1px;
27 | border-top: 1rpx solid #D9D9D9;
28 | color: #D9D9D9;
29 | }
30 | .weui-cells:after {
31 | content: " ";
32 | position: absolute;
33 | left: 0;
34 | bottom: 0;
35 | right: 0;
36 | height: 1px;
37 | border-bottom: 1rpx solid #D9D9D9;
38 | color: #D9D9D9;
39 | }
40 | .weui-cells__title {
41 | margin-top: .77em;
42 | margin-bottom: .3em;
43 | padding-left: 15px;
44 | padding-right: 15px;
45 | color: #999999;
46 | font-size: 14px;
47 | }
48 | .weui-cells_after-title {
49 | margin-top: 0;
50 | }
51 | .weui-cells__tips {
52 | margin-top: .3em;
53 | color: #999999;
54 | padding-left: 15px;
55 | padding-right: 15px;
56 | font-size: 14px;
57 | }
58 | .weui-cell {
59 | padding: 10px 15px;
60 | position: relative;
61 | display: -webkit-box;
62 | display: -webkit-flex;
63 | display: flex;
64 | -webkit-box-align: center;
65 | -webkit-align-items: center;
66 | align-items: center;
67 | }
68 | .weui-cell:before {
69 | content: " ";
70 | position: absolute;
71 | left: 0;
72 | top: 0;
73 | right: 0;
74 | height: 1px;
75 | border-top: 1rpx solid #D9D9D9;
76 | color: #D9D9D9;
77 | left: 15px;
78 | }
79 | .weui-cell:first-child:before {
80 | display: none;
81 | }
82 | .weui-cell_active {
83 | background-color: #ECECEC;
84 | }
85 | .weui-cell_primary {
86 | -webkit-box-align: start;
87 | -webkit-align-items: flex-start;
88 | align-items: flex-start;
89 | }
90 | .weui-cell__bd {
91 | -webkit-box-flex: 1;
92 | -webkit-flex: 1;
93 | flex: 1;
94 | }
95 | .weui-cell__ft {
96 | text-align: right;
97 | color: #999999;
98 | }
99 | .weui-cell_access {
100 | color: inherit;
101 | }
102 | .weui-cell__ft_in-access {
103 | padding-right: 13px;
104 | position: relative;
105 | }
106 | .weui-cell__ft_in-access:after {
107 | content: " ";
108 | display: inline-block;
109 | height: 6px;
110 | width: 6px;
111 | border-width: 2px 2px 0 0;
112 | border-color: #C8C8CD;
113 | border-style: solid;
114 | -webkit-transform: matrix(0.71, 0.71, -0.71, 0.71, 0, 0);
115 | transform: matrix(0.71, 0.71, -0.71, 0.71, 0, 0);
116 | position: relative;
117 | top: -2px;
118 | position: absolute;
119 | top: 50%;
120 | margin-top: -4px;
121 | right: 2px;
122 | }
123 | .weui-cell_link {
124 | color: #586C94;
125 | font-size: 14px;
126 | }
127 | .weui-cell_link:active {
128 | background-color: #ECECEC;
129 | }
130 | .weui-cell_link:first-child:before {
131 | display: block;
132 | }
133 | .weui-icon-radio {
134 | margin-left: 3.2px;
135 | margin-right: 3.2px;
136 | }
137 | .weui-icon-checkbox_circle,
138 | .weui-icon-checkbox_success {
139 | margin-left: 4.6px;
140 | margin-right: 4.6px;
141 | }
142 | .weui-check__label:active {
143 | background-color: #ECECEC;
144 | }
145 | .weui-check {
146 | position: absolute;
147 | left: -9999px;
148 | }
149 | .weui-check__hd_in-checkbox {
150 | padding-right: 0.35em;
151 | }
152 | .weui-cell__ft_in-radio {
153 | padding-left: 0.35em;
154 | }
155 | .weui-cell_input {
156 | padding-top: 0;
157 | padding-bottom: 0;
158 | }
159 | .weui-label {
160 | width: 105px;
161 | word-wrap: break-word;
162 | word-break: break-all;
163 | }
164 | .weui-input {
165 | height: 2.58823529em;
166 | min-height: 2.58823529em;
167 | line-height: 2.58823529em;
168 | }
169 | .weui-toptips {
170 | position: fixed;
171 | -webkit-transform: translateZ(0);
172 | transform: translateZ(0);
173 | top: 0;
174 | left: 0;
175 | right: 0;
176 | padding: 5px;
177 | font-size: 14px;
178 | text-align: center;
179 | color: #FFFFFF;
180 | z-index: 5000;
181 | word-wrap: break-word;
182 | word-break: break-all;
183 | }
184 | .weui-toptips_warn {
185 | background-color: #E64340;
186 | }
187 | .weui-textarea {
188 | display: block;
189 | width: 100%;
190 | }
191 | .weui-textarea-counter {
192 | color: #B2B2B2;
193 | text-align: right;
194 | }
195 | .weui-textarea-counter_warn {
196 | color: #E64340;
197 | }
198 | .weui-cell_warn {
199 | color: #E64340;
200 | }
201 | .weui-form-preview {
202 | position: relative;
203 | background-color: #FFFFFF;
204 | }
205 | .weui-form-preview:before {
206 | content: " ";
207 | position: absolute;
208 | left: 0;
209 | top: 0;
210 | right: 0;
211 | height: 1px;
212 | border-top: 1rpx solid #D9D9D9;
213 | color: #D9D9D9;
214 | }
215 | .weui-form-preview:after {
216 | content: " ";
217 | position: absolute;
218 | left: 0;
219 | bottom: 0;
220 | right: 0;
221 | height: 1px;
222 | border-bottom: 1rpx solid #D9D9D9;
223 | color: #D9D9D9;
224 | }
225 | .weui-form-preview__value {
226 | font-size: 14px;
227 | }
228 | .weui-form-preview__value_in-hd {
229 | font-size: 26px;
230 | }
231 | .weui-form-preview__hd {
232 | position: relative;
233 | padding: 10px 15px;
234 | text-align: right;
235 | line-height: 2.5em;
236 | }
237 | .weui-form-preview__hd:after {
238 | content: " ";
239 | position: absolute;
240 | left: 0;
241 | bottom: 0;
242 | right: 0;
243 | height: 1px;
244 | border-bottom: 1rpx solid #D9D9D9;
245 | color: #D9D9D9;
246 | left: 15px;
247 | }
248 | .weui-form-preview__bd {
249 | padding: 10px 15px;
250 | font-size: .9em;
251 | text-align: right;
252 | color: #999999;
253 | line-height: 2;
254 | }
255 | .weui-form-preview__ft {
256 | position: relative;
257 | line-height: 50px;
258 | display: -webkit-box;
259 | display: -webkit-flex;
260 | display: flex;
261 | }
262 | .weui-form-preview__ft:after {
263 | content: " ";
264 | position: absolute;
265 | left: 0;
266 | top: 0;
267 | right: 0;
268 | height: 1px;
269 | border-top: 1rpx solid #D5D5D6;
270 | color: #D5D5D6;
271 | }
272 | .weui-form-preview__item {
273 | overflow: hidden;
274 | }
275 | .weui-form-preview__label {
276 | float: left;
277 | margin-right: 1em;
278 | min-width: 4em;
279 | color: #999999;
280 | text-align: justify;
281 | text-align-last: justify;
282 | }
283 | .weui-form-preview__value {
284 | display: block;
285 | overflow: hidden;
286 | word-break: normal;
287 | word-wrap: break-word;
288 | }
289 | .weui-form-preview__btn {
290 | position: relative;
291 | display: block;
292 | -webkit-box-flex: 1;
293 | -webkit-flex: 1;
294 | flex: 1;
295 | color: #3CC51F;
296 | text-align: center;
297 | }
298 | .weui-form-preview__btn:after {
299 | content: " ";
300 | position: absolute;
301 | left: 0;
302 | top: 0;
303 | width: 1px;
304 | bottom: 0;
305 | border-left: 1rpx solid #D5D5D6;
306 | color: #D5D5D6;
307 | }
308 | .weui-form-preview__btn:first-child:after {
309 | display: none;
310 | }
311 | .weui-form-preview__btn_active {
312 | background-color: #EEEEEE;
313 | }
314 | .weui-form-preview__btn_default {
315 | color: #999999;
316 | }
317 | .weui-form-preview__btn_primary {
318 | color: #0BB20C;
319 | }
320 | .weui-cell_select {
321 | padding: 0;
322 | }
323 | .weui-select {
324 | position: relative;
325 | padding-left: 15px;
326 | padding-right: 30px;
327 | height: 2.58823529em;
328 | min-height: 2.58823529em;
329 | line-height: 2.58823529em;
330 | border-right: 1rpx solid #D9D9D9;
331 | }
332 | .weui-select:before {
333 | content: " ";
334 | display: inline-block;
335 | height: 6px;
336 | width: 6px;
337 | border-width: 2px 2px 0 0;
338 | border-color: #C8C8CD;
339 | border-style: solid;
340 | -webkit-transform: matrix(0.71, 0.71, -0.71, 0.71, 0, 0);
341 | transform: matrix(0.71, 0.71, -0.71, 0.71, 0, 0);
342 | position: relative;
343 | top: -2px;
344 | position: absolute;
345 | top: 50%;
346 | right: 15px;
347 | margin-top: -4px;
348 | }
349 | .weui-select_in-select-after {
350 | padding-left: 0;
351 | }
352 | .weui-cell__hd_in-select-after,
353 | .weui-cell__bd_in-select-before {
354 | padding-left: 15px;
355 | }
356 | .weui-cell_vcode {
357 | padding-right: 0;
358 | }
359 | .weui-vcode-img {
360 | margin-left: 5px;
361 | height: 2.58823529em;
362 | vertical-align: middle;
363 | }
364 | .weui-vcode-btn {
365 | display: inline-block;
366 | height: 2.58823529em;
367 | margin-left: 5px;
368 | padding: 0 0.6em 0 0.7em;
369 | border-left: 1px solid #E5E5E5;
370 | line-height: 2.58823529em;
371 | vertical-align: middle;
372 | font-size: 17px;
373 | color: #3CC51F;
374 | white-space: nowrap;
375 | }
376 | .weui-vcode-btn:active {
377 | color: #52a341;
378 | }
379 | .weui-cell_switch {
380 | padding-top: 6px;
381 | padding-bottom: 6px;
382 | }
383 | .weui-uploader__hd {
384 | display: -webkit-box;
385 | display: -webkit-flex;
386 | display: flex;
387 | padding-bottom: 10px;
388 | -webkit-box-align: center;
389 | -webkit-align-items: center;
390 | align-items: center;
391 | }
392 | .weui-uploader__title {
393 | -webkit-box-flex: 1;
394 | -webkit-flex: 1;
395 | flex: 1;
396 | }
397 | .weui-uploader__info {
398 | color: #B2B2B2;
399 | }
400 | .weui-uploader__bd {
401 | margin-bottom: -4px;
402 | margin-right: -9px;
403 | overflow: hidden;
404 | }
405 | .weui-uploader__file {
406 | float: left;
407 | margin-right: 9px;
408 | margin-bottom: 9px;
409 | }
410 | .weui-uploader__img {
411 | display: block;
412 | width: 79px;
413 | height: 79px;
414 | }
415 | .weui-uploader__file_status {
416 | position: relative;
417 | }
418 | .weui-uploader__file_status:before {
419 | content: " ";
420 | position: absolute;
421 | top: 0;
422 | right: 0;
423 | bottom: 0;
424 | left: 0;
425 | background-color: rgba(0, 0, 0, 0.5);
426 | }
427 | .weui-uploader__file-content {
428 | position: absolute;
429 | top: 50%;
430 | left: 50%;
431 | -webkit-transform: translate(-50%, -50%);
432 | transform: translate(-50%, -50%);
433 | color: #FFFFFF;
434 | }
435 | .weui-uploader__input-box {
436 | float: left;
437 | position: relative;
438 | margin-right: 9px;
439 | margin-bottom: 9px;
440 | width: 77px;
441 | height: 77px;
442 | border: 1px solid #D9D9D9;
443 | }
444 | .weui-uploader__input-box:before,
445 | .weui-uploader__input-box:after {
446 | content: " ";
447 | position: absolute;
448 | top: 50%;
449 | left: 50%;
450 | -webkit-transform: translate(-50%, -50%);
451 | transform: translate(-50%, -50%);
452 | background-color: #D9D9D9;
453 | }
454 | .weui-uploader__input-box:before {
455 | width: 2px;
456 | height: 39.5px;
457 | }
458 | .weui-uploader__input-box:after {
459 | width: 39.5px;
460 | height: 2px;
461 | }
462 | .weui-uploader__input-box:active {
463 | border-color: #999999;
464 | }
465 | .weui-uploader__input-box:active:before,
466 | .weui-uploader__input-box:active:after {
467 | background-color: #999999;
468 | }
469 | .weui-uploader__input {
470 | position: absolute;
471 | z-index: 1;
472 | top: 0;
473 | left: 0;
474 | width: 100%;
475 | height: 100%;
476 | opacity: 0;
477 | }
478 | .weui-article {
479 | padding: 20px 15px;
480 | font-size: 15px;
481 | }
482 | .weui-article__section {
483 | margin-bottom: 1.5em;
484 | }
485 | .weui-article__h1 {
486 | font-size: 18px;
487 | font-weight: 400;
488 | margin-bottom: .9em;
489 | }
490 | .weui-article__h2 {
491 | font-size: 16px;
492 | font-weight: 400;
493 | margin-bottom: .34em;
494 | }
495 | .weui-article__h3 {
496 | font-weight: 400;
497 | font-size: 15px;
498 | margin-bottom: .34em;
499 | }
500 | .weui-article__p {
501 | margin: 0 0 .8em;
502 | }
503 | .weui-msg {
504 | padding-top: 36px;
505 | text-align: center;
506 | }
507 | .weui-msg__link {
508 | display: inline;
509 | color: #586C94;
510 | }
511 | .weui-msg__icon-area {
512 | margin-bottom: 30px;
513 | }
514 | .weui-msg__text-area {
515 | margin-bottom: 25px;
516 | padding: 0 20px;
517 | }
518 | .weui-msg__title {
519 | margin-bottom: 5px;
520 | font-weight: 400;
521 | font-size: 20px;
522 | }
523 | .weui-msg__desc {
524 | font-size: 14px;
525 | color: #999999;
526 | }
527 | .weui-msg__opr-area {
528 | margin-bottom: 25px;
529 | }
530 | .weui-msg__extra-area {
531 | margin-bottom: 15px;
532 | font-size: 14px;
533 | color: #999999;
534 | }
535 | @media screen and (min-height: 438px) {
536 | .weui-msg__extra-area {
537 | position: fixed;
538 | left: 0;
539 | bottom: 0;
540 | width: 100%;
541 | text-align: center;
542 | }
543 | }
544 | .weui-flex {
545 | display: -webkit-box;
546 | display: -webkit-flex;
547 | display: flex;
548 | }
549 | .weui-flex__item {
550 | -webkit-box-flex: 1;
551 | -webkit-flex: 1;
552 | flex: 1;
553 | }
554 | .weui-btn {
555 | margin-top: 15px;
556 | }
557 | .weui-btn:first-child {
558 | margin-top: 0;
559 | }
560 | .weui-btn-area {
561 | margin: 1.17647059em 15px 0.3em;
562 | }
563 | .weui-agree {
564 | display: block;
565 | padding: .5em 15px;
566 | font-size: 13px;
567 | }
568 | .weui-agree__text {
569 | color: #999999;
570 | }
571 | .weui-agree__link {
572 | display: inline;
573 | color: #586C94;
574 | }
575 | .weui-agree__checkbox {
576 | position: absolute;
577 | left: -9999px;
578 | }
579 | .weui-agree__checkbox-icon {
580 | position: relative;
581 | top: 2px;
582 | display: inline-block;
583 | border: 1px solid #D1D1D1;
584 | background-color: #FFFFFF;
585 | border-radius: 3px;
586 | width: 11px;
587 | height: 11px;
588 | }
589 | .weui-agree__checkbox-icon-check {
590 | position: absolute;
591 | top: 1px;
592 | left: 1px;
593 | }
594 | .weui-footer {
595 | color: #999999;
596 | font-size: 14px;
597 | text-align: center;
598 | }
599 | .weui-footer_fixed-bottom {
600 | position: fixed;
601 | bottom: .52em;
602 | left: 0;
603 | right: 0;
604 | }
605 | .weui-footer__links {
606 | font-size: 0;
607 | }
608 | .weui-footer__link {
609 | display: inline-block;
610 | vertical-align: top;
611 | margin: 0 .62em;
612 | position: relative;
613 | font-size: 14px;
614 | color: #586C94;
615 | }
616 | .weui-footer__link:before {
617 | content: " ";
618 | position: absolute;
619 | left: 0;
620 | top: 0;
621 | width: 1px;
622 | bottom: 0;
623 | border-left: 1rpx solid #C7C7C7;
624 | color: #C7C7C7;
625 | left: -0.65em;
626 | top: .36em;
627 | bottom: .36em;
628 | }
629 | .weui-footer__link:first-child:before {
630 | display: none;
631 | }
632 | .weui-footer__text {
633 | padding: 0 .34em;
634 | font-size: 12px;
635 | }
636 | .weui-grids {
637 | border-top: 1rpx solid #D9D9D9;
638 | border-left: 1rpx solid #D9D9D9;
639 | overflow: hidden;
640 | }
641 | .weui-grid {
642 | position: relative;
643 | float: left;
644 | padding: 20px 10px;
645 | width: 33.33333333%;
646 | box-sizing: border-box;
647 | border-right: 1rpx solid #D9D9D9;
648 | border-bottom: 1rpx solid #D9D9D9;
649 | }
650 | .weui-grid_active {
651 | background-color: #ECECEC;
652 | }
653 | .weui-grid__icon {
654 | display: block;
655 | width: 28px;
656 | height: 28px;
657 | margin: 0 auto;
658 | }
659 | .weui-grid__label {
660 | margin-top: 5px;
661 | display: block;
662 | text-align: center;
663 | color: #000000;
664 | font-size: 14px;
665 | white-space: nowrap;
666 | text-overflow: ellipsis;
667 | overflow: hidden;
668 | }
669 | .weui-loading {
670 | margin: 0 5px;
671 | width: 20px;
672 | height: 20px;
673 | display: inline-block;
674 | vertical-align: middle;
675 | -webkit-animation: weuiLoading 1s steps(12, end) infinite;
676 | animation: weuiLoading 1s steps(12, end) infinite;
677 | background: transparent url(data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIxMjAiIGhlaWdodD0iMTIwIiB2aWV3Qm94PSIwIDAgMTAwIDEwMCI+PHBhdGggZmlsbD0ibm9uZSIgZD0iTTAgMGgxMDB2MTAwSDB6Ii8+PHJlY3Qgd2lkdGg9IjciIGhlaWdodD0iMjAiIHg9IjQ2LjUiIHk9IjQwIiBmaWxsPSIjRTlFOUU5IiByeD0iNSIgcnk9IjUiIHRyYW5zZm9ybT0idHJhbnNsYXRlKDAgLTMwKSIvPjxyZWN0IHdpZHRoPSI3IiBoZWlnaHQ9IjIwIiB4PSI0Ni41IiB5PSI0MCIgZmlsbD0iIzk4OTY5NyIgcng9IjUiIHJ5PSI1IiB0cmFuc2Zvcm09InJvdGF0ZSgzMCAxMDUuOTggNjUpIi8+PHJlY3Qgd2lkdGg9IjciIGhlaWdodD0iMjAiIHg9IjQ2LjUiIHk9IjQwIiBmaWxsPSIjOUI5OTlBIiByeD0iNSIgcnk9IjUiIHRyYW5zZm9ybT0icm90YXRlKDYwIDc1Ljk4IDY1KSIvPjxyZWN0IHdpZHRoPSI3IiBoZWlnaHQ9IjIwIiB4PSI0Ni41IiB5PSI0MCIgZmlsbD0iI0EzQTFBMiIgcng9IjUiIHJ5PSI1IiB0cmFuc2Zvcm09InJvdGF0ZSg5MCA2NSA2NSkiLz48cmVjdCB3aWR0aD0iNyIgaGVpZ2h0PSIyMCIgeD0iNDYuNSIgeT0iNDAiIGZpbGw9IiNBQkE5QUEiIHJ4PSI1IiByeT0iNSIgdHJhbnNmb3JtPSJyb3RhdGUoMTIwIDU4LjY2IDY1KSIvPjxyZWN0IHdpZHRoPSI3IiBoZWlnaHQ9IjIwIiB4PSI0Ni41IiB5PSI0MCIgZmlsbD0iI0IyQjJCMiIgcng9IjUiIHJ5PSI1IiB0cmFuc2Zvcm09InJvdGF0ZSgxNTAgNTQuMDIgNjUpIi8+PHJlY3Qgd2lkdGg9IjciIGhlaWdodD0iMjAiIHg9IjQ2LjUiIHk9IjQwIiBmaWxsPSIjQkFCOEI5IiByeD0iNSIgcnk9IjUiIHRyYW5zZm9ybT0icm90YXRlKDE4MCA1MCA2NSkiLz48cmVjdCB3aWR0aD0iNyIgaGVpZ2h0PSIyMCIgeD0iNDYuNSIgeT0iNDAiIGZpbGw9IiNDMkMwQzEiIHJ4PSI1IiByeT0iNSIgdHJhbnNmb3JtPSJyb3RhdGUoLTE1MCA0NS45OCA2NSkiLz48cmVjdCB3aWR0aD0iNyIgaGVpZ2h0PSIyMCIgeD0iNDYuNSIgeT0iNDAiIGZpbGw9IiNDQkNCQ0IiIHJ4PSI1IiByeT0iNSIgdHJhbnNmb3JtPSJyb3RhdGUoLTEyMCA0MS4zNCA2NSkiLz48cmVjdCB3aWR0aD0iNyIgaGVpZ2h0PSIyMCIgeD0iNDYuNSIgeT0iNDAiIGZpbGw9IiNEMkQyRDIiIHJ4PSI1IiByeT0iNSIgdHJhbnNmb3JtPSJyb3RhdGUoLTkwIDM1IDY1KSIvPjxyZWN0IHdpZHRoPSI3IiBoZWlnaHQ9IjIwIiB4PSI0Ni41IiB5PSI0MCIgZmlsbD0iI0RBREFEQSIgcng9IjUiIHJ5PSI1IiB0cmFuc2Zvcm09InJvdGF0ZSgtNjAgMjQuMDIgNjUpIi8+PHJlY3Qgd2lkdGg9IjciIGhlaWdodD0iMjAiIHg9IjQ2LjUiIHk9IjQwIiBmaWxsPSIjRTJFMkUyIiByeD0iNSIgcnk9IjUiIHRyYW5zZm9ybT0icm90YXRlKC0zMCAtNS45OCA2NSkiLz48L3N2Zz4=) no-repeat;
678 | background-size: 100%;
679 | }
680 | @-webkit-keyframes weuiLoading {
681 | 0% {
682 | -webkit-transform: rotate3d(0, 0, 1, 0deg);
683 | transform: rotate3d(0, 0, 1, 0deg);
684 | }
685 | 100% {
686 | -webkit-transform: rotate3d(0, 0, 1, 360deg);
687 | transform: rotate3d(0, 0, 1, 360deg);
688 | }
689 | }
690 | @keyframes weuiLoading {
691 | 0% {
692 | -webkit-transform: rotate3d(0, 0, 1, 0deg);
693 | transform: rotate3d(0, 0, 1, 0deg);
694 | }
695 | 100% {
696 | -webkit-transform: rotate3d(0, 0, 1, 360deg);
697 | transform: rotate3d(0, 0, 1, 360deg);
698 | }
699 | }
700 | .weui-badge {
701 | display: inline-block;
702 | padding: .15em .4em;
703 | min-width: 8px;
704 | border-radius: 18px;
705 | background-color: #F43530;
706 | color: #FFFFFF;
707 | line-height: 1.2;
708 | text-align: center;
709 | font-size: 12px;
710 | vertical-align: middle;
711 | }
712 | .weui-badge_dot {
713 | padding: .4em;
714 | min-width: 0;
715 | }
716 | .weui-loadmore {
717 | width: 65%;
718 | margin: 1.5em auto;
719 | line-height: 1.6em;
720 | font-size: 14px;
721 | text-align: center;
722 | }
723 | .weui-loadmore__tips {
724 | display: inline-block;
725 | vertical-align: middle;
726 | }
727 | .weui-loadmore_line {
728 | border-top: 1px solid #E5E5E5;
729 | margin-top: 2.4em;
730 | }
731 | .weui-loadmore__tips_in-line {
732 | position: relative;
733 | top: -0.9em;
734 | padding: 0 .55em;
735 | background-color: #FFFFFF;
736 | color: #999999;
737 | }
738 | .weui-loadmore__tips_in-dot {
739 | position: relative;
740 | padding: 0 .16em;
741 | width: 4px;
742 | height: 1.6em;
743 | }
744 | .weui-loadmore__tips_in-dot:before {
745 | content: " ";
746 | position: absolute;
747 | top: 50%;
748 | left: 50%;
749 | margin-top: -1px;
750 | margin-left: -2px;
751 | width: 4px;
752 | height: 4px;
753 | border-radius: 50%;
754 | background-color: #E5E5E5;
755 | }
756 | .weui-panel {
757 | background-color: #FFFFFF;
758 | margin-top: 10px;
759 | position: relative;
760 | overflow: hidden;
761 | }
762 | .weui-panel:first-child {
763 | margin-top: 0;
764 | }
765 | .weui-panel:before {
766 | content: " ";
767 | position: absolute;
768 | left: 0;
769 | top: 0;
770 | right: 0;
771 | height: 1px;
772 | border-top: 1rpx solid #E5E5E5;
773 | color: #E5E5E5;
774 | }
775 | .weui-panel:after {
776 | content: " ";
777 | position: absolute;
778 | left: 0;
779 | bottom: 0;
780 | right: 0;
781 | height: 1px;
782 | border-bottom: 1rpx solid #E5E5E5;
783 | color: #E5E5E5;
784 | }
785 | .weui-panel__hd {
786 | padding: 14px 15px 10px;
787 | color: #999999;
788 | font-size: 13px;
789 | position: relative;
790 | }
791 | .weui-panel__hd:after {
792 | content: " ";
793 | position: absolute;
794 | left: 0;
795 | bottom: 0;
796 | right: 0;
797 | height: 1px;
798 | border-bottom: 1rpx solid #E5E5E5;
799 | color: #E5E5E5;
800 | left: 15px;
801 | }
802 | .weui-media-box {
803 | padding: 15px;
804 | position: relative;
805 | }
806 | .weui-media-box:before {
807 | content: " ";
808 | position: absolute;
809 | left: 0;
810 | top: 0;
811 | right: 0;
812 | height: 1px;
813 | border-top: 1rpx solid #E5E5E5;
814 | color: #E5E5E5;
815 | left: 15px;
816 | }
817 | .weui-media-box:first-child:before {
818 | display: none;
819 | }
820 | .weui-media-box__title {
821 | font-weight: 400;
822 | font-size: 17px;
823 | width: auto;
824 | overflow: hidden;
825 | text-overflow: ellipsis;
826 | white-space: nowrap;
827 | word-wrap: normal;
828 | word-wrap: break-word;
829 | word-break: break-all;
830 | }
831 | .weui-media-box__desc {
832 | color: #999999;
833 | font-size: 13px;
834 | line-height: 1.2;
835 | overflow: hidden;
836 | text-overflow: ellipsis;
837 | display: -webkit-box;
838 | -webkit-box-orient: vertical;
839 | -webkit-line-clamp: 2;
840 | }
841 | .weui-media-box__info {
842 | margin-top: 15px;
843 | padding-bottom: 5px;
844 | font-size: 13px;
845 | color: #CECECE;
846 | line-height: 1em;
847 | list-style: none;
848 | overflow: hidden;
849 | }
850 | .weui-media-box__info__meta {
851 | float: left;
852 | padding-right: 1em;
853 | }
854 | .weui-media-box__info__meta_extra {
855 | padding-left: 1em;
856 | border-left: 1px solid #CECECE;
857 | }
858 | .weui-media-box__title_in-text {
859 | margin-bottom: 8px;
860 | }
861 | .weui-media-box_appmsg {
862 | display: -webkit-box;
863 | display: -webkit-flex;
864 | display: flex;
865 | -webkit-box-align: center;
866 | -webkit-align-items: center;
867 | align-items: center;
868 | }
869 | .weui-media-box__thumb {
870 | width: 100%;
871 | height: 100%;
872 | vertical-align: top;
873 | }
874 | .weui-media-box__hd_in-appmsg {
875 | margin-right: .8em;
876 | width: 60px;
877 | height: 60px;
878 | line-height: 60px;
879 | text-align: center;
880 | }
881 | .weui-media-box__bd_in-appmsg {
882 | -webkit-box-flex: 1;
883 | -webkit-flex: 1;
884 | flex: 1;
885 | min-width: 0;
886 | }
887 | .weui-media-box_small-appmsg {
888 | padding: 0;
889 | }
890 | .weui-cells_in-small-appmsg {
891 | margin-top: 0;
892 | }
893 | .weui-cells_in-small-appmsg:before {
894 | display: none;
895 | }
896 | .weui-progress {
897 | display: -webkit-box;
898 | display: -webkit-flex;
899 | display: flex;
900 | -webkit-box-align: center;
901 | -webkit-align-items: center;
902 | align-items: center;
903 | }
904 | .weui-progress__bar {
905 | -webkit-box-flex: 1;
906 | -webkit-flex: 1;
907 | flex: 1;
908 | }
909 | .weui-progress__opr {
910 | margin-left: 15px;
911 | font-size: 0;
912 | }
913 | .weui-navbar {
914 | display: -webkit-box;
915 | display: -webkit-flex;
916 | display: flex;
917 | position: absolute;
918 | z-index: 500;
919 | top: 0;
920 | width: 100%;
921 | border-bottom: 1rpx solid #CCCCCC;
922 | }
923 | .weui-navbar__item {
924 | position: relative;
925 | display: block;
926 | -webkit-box-flex: 1;
927 | -webkit-flex: 1;
928 | flex: 1;
929 | padding: 13px 0;
930 | text-align: center;
931 | font-size: 0;
932 | }
933 | .weui-navbar__item.weui-bar__item_on {
934 | color: #1AAD19;
935 | }
936 | .weui-navbar__slider {
937 | position: absolute;
938 | content: " ";
939 | left: 0;
940 | bottom: 0;
941 | width: 6em;
942 | height: 3px;
943 | background-color: #1AAD19;
944 | -webkit-transition: -webkit-transform .3s;
945 | transition: -webkit-transform .3s;
946 | transition: transform .3s;
947 | transition: transform .3s, -webkit-transform .3s;
948 | }
949 | .weui-navbar__title {
950 | display: inline-block;
951 | font-size: 15px;
952 | max-width: 8em;
953 | width: auto;
954 | overflow: hidden;
955 | text-overflow: ellipsis;
956 | white-space: nowrap;
957 | word-wrap: normal;
958 | }
959 | .weui-tab {
960 | position: relative;
961 | height: 100%;
962 | }
963 | .weui-tab__panel {
964 | box-sizing: border-box;
965 | height: 100%;
966 | padding-top: 50px;
967 | overflow: auto;
968 | -webkit-overflow-scrolling: touch;
969 | }
970 | .weui-search-bar {
971 | position: relative;
972 | padding: 8px 10px;
973 | display: -webkit-box;
974 | display: -webkit-flex;
975 | display: flex;
976 | box-sizing: border-box;
977 | background-color: #EFEFF4;
978 | border-top: 1rpx solid #D7D6DC;
979 | border-bottom: 1rpx solid #D7D6DC;
980 | }
981 | .weui-icon-search {
982 | margin-right: 8px;
983 | font-size: inherit;
984 | }
985 | .weui-icon-search_in-box {
986 | position: absolute;
987 | left: 10px;
988 | top: 7px;
989 | }
990 | .weui-search-bar__text {
991 | display: inline-block;
992 | font-size: 14px;
993 | vertical-align: middle;
994 | }
995 | .weui-search-bar__form {
996 | position: relative;
997 | -webkit-box-flex: 1;
998 | -webkit-flex: auto;
999 | flex: auto;
1000 | border-radius: 5px;
1001 | background: #FFFFFF;
1002 | border: 1rpx solid #E6E6EA;
1003 | }
1004 | .weui-search-bar__box {
1005 | position: relative;
1006 | padding-left: 30px;
1007 | padding-right: 30px;
1008 | width: 100%;
1009 | box-sizing: border-box;
1010 | z-index: 1;
1011 | }
1012 | .weui-search-bar__input {
1013 | height: 28px;
1014 | line-height: 28px;
1015 | font-size: 14px;
1016 | }
1017 | .weui-icon-clear {
1018 | position: absolute;
1019 | top: 0;
1020 | right: 0;
1021 | padding: 7px 8px;
1022 | font-size: 0;
1023 | }
1024 | .weui-search-bar__label {
1025 | position: absolute;
1026 | top: 0;
1027 | right: 0;
1028 | bottom: 0;
1029 | left: 0;
1030 | z-index: 2;
1031 | border-radius: 3px;
1032 | text-align: center;
1033 | color: #9B9B9B;
1034 | background: #FFFFFF;
1035 | line-height: 28px;
1036 | }
1037 | .weui-search-bar__cancel-btn {
1038 | margin-left: 10px;
1039 | line-height: 28px;
1040 | color: #09BB07;
1041 | white-space: nowrap;
1042 | }
1043 |
--------------------------------------------------------------------------------
/template.wxml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | {{ title }}
5 |
6 | 评论: ({{ comnum }})
7 | 阅读: ({{ views }})
8 | {{ date }}
9 |
10 |
11 |
--------------------------------------------------------------------------------
/utils/api.js:
--------------------------------------------------------------------------------
1 | import config from '../config.js'
2 | let api = config.domain + '/content/plugins/wxa/api.php?route='
3 |
4 | module.exports = {
5 | getArticle: api + 'article&page=',
6 | getArticleInfo: api + 'articleInfo&gid=',
7 | getSettings: api + 'options',
8 | getSorts: api + 'sorts',
9 | getArticleComments: api + 'comments',
10 | addComment: api + 'addComment'
11 | }
--------------------------------------------------------------------------------
/utils/util.js:
--------------------------------------------------------------------------------
1 | import api from './api'
2 | import config from '../config'
3 |
4 | function formatTime(date) {
5 | var year = date.getFullYear()
6 | var month = date.getMonth() + 1
7 | var day = date.getDate()
8 |
9 | var hour = date.getHours()
10 | var minute = date.getMinutes()
11 | var second = date.getSeconds()
12 |
13 |
14 | return [year, month, day].map(formatNumber).join('/') + ' ' + [hour, minute, second].map(formatNumber).join(':')
15 | }
16 |
17 | function formatNumber(n) {
18 | n = n.toString()
19 | return n[1] ? n : '0' + n
20 | }
21 |
22 | function loading () {
23 | wx.showLoading({
24 | title: '加载中..',
25 | mask: true
26 | })
27 | }
28 |
29 | function unloading () {
30 | wx.hideLoading()
31 | }
32 |
33 | /**
34 | * http操作
35 | */
36 | function http (url, params, type, success, error, needLoading, headers) {
37 | if (typeof needLoading !== 'boolean' || needLoading) {
38 | loading()
39 | }
40 | if (!headers) {
41 | headers = {}
42 | }
43 | wx.request({
44 | url: url,
45 | data: params,
46 | method: type,
47 | header: {
48 | 'content-type': 'application/x-www-form-urlencoded',
49 | ...headers
50 | },
51 | success: function (resp) {
52 | var data = resp.data
53 | if (data.state) {
54 | typeof success == 'function' && success(data.data)
55 | setTimeout(function () { unloading() }, 300)
56 | } else {
57 | console.log(data.msg)
58 | typeof error == 'function' && error(data.msg)
59 | unloading()
60 | }
61 | },
62 | fail: function() {
63 | unloading()
64 | typeof error == 'function' && error('请求错误!')
65 | }
66 | })
67 | }
68 |
69 | /**
70 | * 获取某分类下的文章
71 | */
72 | function getArticle(page, sid, keyword, success, error) {
73 | http(api.getArticle + page + '&sid=' + sid + '&keyword=' + keyword, {}, 'GET', success, error)
74 | }
75 |
76 | /**
77 | * 获取文章详情
78 | */
79 | function getArticleInfo(gid, success, error) {
80 | http(api.getArticleInfo + gid, {}, 'GET', success, error)
81 | }
82 |
83 | /**
84 | * 获取某文章下的评论
85 | */
86 | function getArticleComments(gid, page, success, error) {
87 | http(api.getArticleComments, { gid, page }, 'GET', success, error, false)
88 | }
89 | /**
90 | * 设置本地存储内容
91 | */
92 | function setLS (key, value) {
93 | wx.setStorage({
94 | key: key,
95 | data: value
96 | })
97 | }
98 | /**
99 | * 获取本地存储内容
100 | */
101 | function getLS (key) {
102 | return wx.getStorageSync(key)
103 | }
104 |
105 | /**
106 | * 获取博客设置信息
107 | */
108 | function getSettings (success, error) {
109 | http(api.getSettings, {}, 'GET', success, error)
110 | }
111 |
112 | /**
113 | * 获取分类列表
114 | */
115 | function getSorts (success, error) {
116 | http(api.getSorts, {}, 'GET', success, error)
117 | }
118 |
119 | /**
120 | * 获取随机的banner图片
121 | * index: 随机数字1-9
122 | * 若需更改图片,更改图片连接即可
123 | */
124 | function getRandomBanner () {
125 | return '../../static/images/banner.jpg'
126 | }
127 |
128 | /**
129 | * 添加评论
130 | */
131 | function addComment (data, callback, error) {
132 | data.poster = data.poster || '小程序用户'
133 | http(api.addComment, data, 'POST', callback, error)
134 | }
135 |
136 | module.exports = {
137 | formatTime,
138 | getArticle,
139 | getArticleInfo,
140 | getSettings,
141 | getSorts,
142 | getRandomBanner,
143 | getArticleComments,
144 | addComment
145 | }
146 |
--------------------------------------------------------------------------------