Skip to content

Commit b577b38

Browse files
committed
first-commit
1 parent e618a01 commit b577b38

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

83 files changed

+9234
-0
lines changed

Diff for: README.md

+26
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,28 @@
11
# wechatapp-news-reader
22
微信小程序 —— 新闻阅读器
3+
4+
## 说明
5+
6+
1.数据部分API来源于[《中安新闻客户端》](http://www.anhuinews.com/)
7+
2.富文本解析[wxParse](https://github.com/icindy/wxParse)
8+
9+
10+
11+
12+
## 界面截图
13+
14+
#### 主页页面
15+
16+
![demo1](screenshots/demo1.png)
17+
18+
#### 设置页面
19+
20+
![demo2](screenshots/demo2.png)
21+
22+
#### 专题页面
23+
24+
![demo3](screenshots/demo3.png)
25+
26+
#### 专题列表页面
27+
28+
![demo4](screenshots/demo4.png)

Diff for: app.js

+27
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
//app.js
2+
const utils = require('./utils/util.js')
3+
4+
App({
5+
onLaunch: function() {
6+
7+
},
8+
9+
getUserInfo(){
10+
return new utils.Promise((resolve,reject) => {
11+
if(this.globalData.userInfo){
12+
resolve(this.globalData.userInfo)
13+
}
14+
return utils.getUserInfo().then(res => {
15+
resolve(this.globalData.userInfo = res.userInfo)
16+
})
17+
})
18+
},
19+
globalData:{
20+
userInfo:null,
21+
categoryChanged:true
22+
},
23+
24+
cacheSubscibe:[],
25+
26+
utils
27+
})

Diff for: app.json

+46
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
{
2+
"pages": [
3+
"pages/news/index",
4+
"pages/news/detail",
5+
"pages/news/manage",
6+
"pages/subscibe/index",
7+
"pages/subscibe/article",
8+
"pages/found/index",
9+
"pages/user/index",
10+
"pages/logs/logs"
11+
],
12+
"window": {
13+
"backgroundTextStyle": "light",
14+
"navigationBarBackgroundColor": "#fff",
15+
"navigationBarTitleText": "News Reader",
16+
"navigationBarTextStyle": "black"
17+
},
18+
"tabBar": {
19+
"color": "#333",
20+
"selectedColor": "#d81e06",
21+
"borderStyle": "white",
22+
"backgroundColor": "#ffffff",
23+
"list": [{
24+
"pagePath": "pages/news/index",
25+
"iconPath": "image/icon-news.png",
26+
"selectedIconPath": "image/icon-news-a.png",
27+
"text": "新闻"
28+
}, {
29+
"pagePath": "pages/subscibe/index",
30+
"iconPath": "image/icon-sub.png",
31+
"selectedIconPath": "image/icon-sub-a.png",
32+
"text": "订阅"
33+
}, {
34+
"pagePath": "pages/found/index",
35+
"iconPath": "image/icon-like.png",
36+
"selectedIconPath": "image/icon-like-a.png",
37+
"text": "发现"
38+
}, {
39+
"pagePath": "pages/user/index",
40+
"iconPath": "image/icon-user.png",
41+
"selectedIconPath": "image/icon-user-a.png",
42+
"text": "我的"
43+
}]
44+
},
45+
"debug":true
46+
}

Diff for: app.wxss

+173
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,173 @@
1+
@import "./utils/wxParse/wxParse.wxss";
2+
3+
4+
/**app.wxss**/
5+
.page {
6+
min-height: 100%;
7+
flex: 1;
8+
background-color: #FBF9FE;
9+
font-size: 14px;
10+
font-family: -apple-system-font,Helvetica Neue,Helvetica,sans-serif;
11+
overflow: hidden;
12+
line-height: 1.6;
13+
}
14+
15+
.active{
16+
color:#d81e06;
17+
border-bottom: 2rpx solid #d81e06;
18+
}
19+
20+
21+
22+
/** global weui article **/
23+
24+
.articles{
25+
background-color: #fff;
26+
}
27+
.article__item{
28+
display: flex;
29+
padding: 30rpx;
30+
align-items: center;
31+
border-bottom: 1rpx solid #eee;
32+
position: relative;
33+
padding-bottom: 40rpx;
34+
}
35+
.article__thumb{
36+
width:4.2rem;
37+
height: 3rem;
38+
margin-right: 0.6rem;
39+
}
40+
.article__image{
41+
width:4.2rem;
42+
height: 3rem;
43+
}
44+
.article__info{
45+
flex: 1;
46+
width: 100%;
47+
overflow: hidden;
48+
}
49+
.article__title{
50+
font-weight: 400;
51+
font-size: 26rpx;
52+
text-overflow: ellipsis;
53+
white-space:nowrap;
54+
display: block;
55+
width: 100%;
56+
margin-bottom: 20rpx;
57+
}
58+
/* 支持多行 */
59+
.article__title__large{
60+
61+
}
62+
63+
.article__desc{
64+
color: #999;
65+
font-size: 24rpx;
66+
line-height: 1.2;
67+
width: 100%;
68+
}
69+
70+
.article__item__cover{
71+
display: block;
72+
}
73+
.article__cover{
74+
padding-bottom: 10rpx;
75+
overflow: hidden;
76+
}
77+
.article__ad{
78+
width: 100%;
79+
height: 4rem;
80+
border-radius: 10rpx;
81+
}
82+
83+
.article__remark{
84+
bottom: 0;
85+
width: 20rem;
86+
display: block;
87+
font-size: 28rpx;
88+
}
89+
90+
.article__source{
91+
color:#d81e06;
92+
border:1rpx solid #d81e06;
93+
padding: 2rpx 10rpx;
94+
border-radius: 4rpx;
95+
font-size:20rpx;
96+
margin-right: 20rpx;
97+
}
98+
99+
100+
.article__time{
101+
margin-right: 10rpx;
102+
}
103+
.article__count{
104+
float: right;
105+
display: flex;
106+
align-items: center;
107+
color:#333;
108+
font-size: 20rpx;
109+
font-weight: 500;
110+
}
111+
112+
.article__icon{
113+
width: 29rpx;
114+
height: 29rpx;
115+
margin-left: 15rpx;
116+
margin-right: 6rpx;
117+
}
118+
119+
.article__imgview{
120+
width: 200rpx;
121+
height: 142rpx;
122+
padding: 15rpx;
123+
}
124+
125+
126+
127+
.weui-footer {
128+
129+
color: #999999;
130+
font-size: 14px;
131+
text-align: center;
132+
background-color: #fff;
133+
padding: 20rpx;
134+
}
135+
.weui-footer_fixed-bottom {
136+
position: fixed;
137+
bottom: 0;
138+
left: 0;
139+
right: 0;
140+
}
141+
.weui-footer__links {
142+
font-size: 0;
143+
}
144+
.weui-footer__link {
145+
padding-top: 20rpx;
146+
display: inline-block;
147+
vertical-align: top;
148+
margin: 0 .62em;
149+
position: relative;
150+
font-size: 14px;
151+
color: #586C94;
152+
margin-bottom: 22rpx;
153+
}
154+
.weui-footer__link:before {
155+
content: " ";
156+
position: absolute;
157+
left: 0;
158+
top: 0;
159+
width: 1px;
160+
bottom: 0;
161+
border-left: 1rpx solid #C7C7C7;
162+
color: #C7C7C7;
163+
left: -0.65em;
164+
top: .36em;
165+
bottom: .36em;
166+
}
167+
.weui-footer__link:first-child:before {
168+
display: none;
169+
}
170+
.weui-footer__text {
171+
padding: 0 .34em;
172+
font-size: 12px;
173+
}

Diff for: image/demo/icon-demo1.png

3.24 KB
Loading

Diff for: image/demo/icon-demo10.png

1.05 KB
Loading

Diff for: image/demo/icon-demo11.png

1.84 KB
Loading

Diff for: image/demo/icon-demo12.png

1.04 KB
Loading

Diff for: image/demo/icon-demo13.png

2.4 KB
Loading

Diff for: image/demo/icon-demo14.png

2.92 KB
Loading

Diff for: image/demo/icon-demo15.png

1.52 KB
Loading

Diff for: image/demo/icon-demo16.png

2.79 KB
Loading

Diff for: image/demo/icon-demo2.png

1.46 KB
Loading

Diff for: image/demo/icon-demo3.png

1.57 KB
Loading

Diff for: image/demo/icon-demo4.png

2.43 KB
Loading

Diff for: image/demo/icon-demo5.png

2.79 KB
Loading

Diff for: image/demo/icon-demo6.png

1.9 KB
Loading

Diff for: image/demo/icon-demo7.png

1.76 KB
Loading

Diff for: image/demo/icon-demo8.png

2.26 KB
Loading

Diff for: image/demo/icon-demo9.png

2.56 KB
Loading

Diff for: image/icon-comt-a.png

2.9 KB
Loading

Diff for: image/icon-comt.png

2.9 KB
Loading

Diff for: image/icon-like-a.png

1.05 KB
Loading

Diff for: image/icon-like.png

1.05 KB
Loading

Diff for: image/icon-manage.png

679 Bytes
Loading

Diff for: image/icon-more-a.png

274 Bytes
Loading

Diff for: image/icon-more.png

274 Bytes
Loading

Diff for: image/icon-news-a.png

1.08 KB
Loading

Diff for: image/icon-news.png

1.08 KB
Loading

Diff for: image/icon-priaze-a.png

2.53 KB
Loading

Diff for: image/icon-priaze.png

2.46 KB
Loading

Diff for: image/icon-sub-a.png

845 Bytes
Loading

Diff for: image/icon-sub.png

845 Bytes
Loading

Diff for: image/icon-user-a.png

833 Bytes
Loading

Diff for: image/icon-user.png

833 Bytes
Loading

Diff for: jsconfig.json

+7
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
{
2+
"compilerOptions": {
3+
4+
},
5+
"exclude": [
6+
]
7+
}

Diff for: pages/common/template/article.wxml

+107
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,107 @@
1+
<!--新闻列表页面模板-->
2+
<!--
3+
id:news.news_id,
4+
title:news.news_title,
5+
data:news.news_date,
6+
parise:news.news_praise_count,
7+
commont:news.news_comment_count,
8+
summary:news.news_summary,
9+
icons:news.news_icon,
10+
style:news.news_style
11+
-->
12+
13+
<!--无图模式-->
14+
<template name="newsStyle0">
15+
<navigator url="/pages/news/detail?id={{ id }}&chid={{ chid }}&style={{ style }}&tag={{ tag }}">
16+
<view class="article__item">
17+
<view class="article__info">
18+
<view class="article__title article__title__large">{{ title }}</view>
19+
<view class="article__desc">
20+
<text class="article__source" wx:if="{{ tag }}">{{ tag }}</text>
21+
<text class="article__time">{{ date }}</text>
22+
<view class="article__count">
23+
<image class="article__icon" src="/image/icon-comt.png"></image>
24+
<text>{{ commont }}</text>
25+
<image class="article__icon" src="/image/icon-priaze.png"></image>
26+
<text>{{ parise }}</text>
27+
</view>
28+
</view>
29+
</view>
30+
</view>
31+
</navigator>
32+
</template>
33+
34+
<!--单大图模式-->
35+
<template name="newsStyle1">
36+
<navigator url="/pages/news/detail?id={{ id }}&chid={{ chid }}&style={{ style }}&tag={{ tag }}">
37+
<view class="article__item article__item__cover">
38+
<view class="article__cover">
39+
<view class="article__title">{{ title }}</view>
40+
<image class="article__ad" mode="aspectFill" src="{{ icons[0] }}"></image>
41+
</view>
42+
<view class="article__desc">
43+
<text class="article__source" wx:if="{{ tag }}">{{ tag }}</text>
44+
<text class="article__time">{{ date }}</text>
45+
<view class="article__count">
46+
<image class="article__icon" src="/image/icon-comt.png"></image>
47+
<text>{{ commont }}</text>
48+
<image class="article__icon" src="/image/icon-priaze.png"></image>
49+
<text>{{ parise }}</text>
50+
</view>
51+
</view>
52+
</view>
53+
</navigator>
54+
</template>
55+
56+
<!--普通模式-->
57+
<template name="newsStyle2">
58+
<navigator url="/pages/news/detail?id={{ id }}&chid={{ chid }}&style={{ style }}&tag={{ tag }}">
59+
<view class="article__item">
60+
<view class="article__thumb">
61+
<image class="article__image" src="{{ icons[0] }}"></image>
62+
</view>
63+
<view class="article__info">
64+
<view class="article__title article__title__large">{{ title }}</view>
65+
<!--<view class="article__desc">
66+
{{ summary }}
67+
</view>-->
68+
<view class="article__desc">
69+
<text wx:if="{{ tag }}" class="article__source">{{ tag }}</text>
70+
<text class="article__time">{{ date }}</text>
71+
<view class="article__count">
72+
<image class="article__icon" src="/image/icon-comt.png"></image>
73+
<text>{{ commont }}</text>
74+
<image class="article__icon" src="/image/icon-priaze.png"></image>
75+
<text>{{ parise }}</text>
76+
</view>
77+
</view>
78+
</view>
79+
</view>
80+
</navigator>
81+
</template>
82+
83+
<!--三图模式-->
84+
<template name="newsStyle3">
85+
<navigator url="/pages/news/detail?id={{ id }}&chid={{ chid }}&style={{ style }}&tag={{ tag }}">
86+
<view class="article__item">
87+
<view class="article__info">
88+
<view class="article__title">{{ title }}</view>
89+
<view class="article__images">
90+
<image class="article__imgview" src="{{ icons[0] }}"></image>
91+
<image class="article__imgview" src="{{ icons[1] }}"></image>
92+
<image class="article__imgview" src="{{ icons[2] }}"></image>
93+
</view>
94+
<view class="article__desc">
95+
<text class="article__source" wx:if="{{ tag }}">{{ tag }}</text>
96+
<text class="article__time">{{ date }}</text>
97+
<view class="article__count">
98+
<image class="article__icon" src="/image/icon-comt.png"></image>
99+
<text>{{ commont }}</text>
100+
<image class="article__icon" src="/image/icon-priaze.png"></image>
101+
<text>{{ parise }}</text>
102+
</view>
103+
</view>
104+
</view>
105+
</view>
106+
</navigator>
107+
</template>

0 commit comments

Comments
 (0)