Skip to content

Commit dd8528b

Browse files
committed
init
init
0 parents  commit dd8528b

Some content is hidden

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

78 files changed

+1110
-0
lines changed

app.js

+30
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
//app.js
2+
App({
3+
onLaunch: function () {
4+
//调用API从本地缓存中获取数据
5+
var logs = wx.getStorageSync('logs') || []
6+
logs.unshift(Date.now())
7+
wx.setStorageSync('logs', logs)
8+
},
9+
getUserInfo:function(cb){
10+
var that = this
11+
if(this.globalData.userInfo){
12+
typeof cb == "function" && cb(this.globalData.userInfo)
13+
}else{
14+
//调用登录接口
15+
wx.login({
16+
success: function () {
17+
wx.getUserInfo({
18+
success: function (res) {
19+
that.globalData.userInfo = res.userInfo
20+
typeof cb == "function" && cb(that.globalData.userInfo)
21+
}
22+
})
23+
}
24+
})
25+
}
26+
},
27+
globalData:{
28+
userInfo:null
29+
}
30+
})

app.json

+44
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
{
2+
"pages":[
3+
"pages/index/index",
4+
"pages/logs/logs",
5+
"pages/category/category",
6+
"pages/rank/rank",
7+
"pages/detail/detail"
8+
],
9+
"window": {
10+
"navigationBarTextStyle": "black",
11+
"navigationBarTitleText": "change",
12+
"navigationBarBackgroundColor": "#fbf9fe",
13+
"backgroundColor": "#fbf9fe"
14+
},
15+
"tabBar": {
16+
"color": "#dddddd",
17+
"selectedColor": "#000000",
18+
"borderStyle": "white",
19+
"backgroundColor": "#ffffff",
20+
"list": [{
21+
"pagePath": "pages/index/index",
22+
"iconPath": "image/[email protected]",
23+
"selectedIconPath": "image/[email protected]",
24+
"text": "首页"
25+
}, {
26+
"pagePath": "pages/category/category",
27+
"iconPath": "image/[email protected]",
28+
"selectedIconPath": "image/[email protected]",
29+
"text": "分类"
30+
},{
31+
"pagePath": "pages/rank/rank",
32+
"iconPath": "image/[email protected]",
33+
"selectedIconPath": "image/[email protected]",
34+
"text": "排行"
35+
}]
36+
},
37+
"networkTimeout": {
38+
"request": 10000,
39+
"connectSocket": 10000,
40+
"uploadFile": 10000,
41+
"downloadFile": 10000
42+
},
43+
"debug": true
44+
}

app.wxss

+216
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,216 @@
1+
page {
2+
background-color: #fbf9fe;
3+
height: 100%;
4+
}
5+
.container {
6+
display: flex;
7+
flex-direction: column;
8+
min-height: 100%;
9+
justify-content: space-between;
10+
}
11+
.page-header {
12+
display: flex;
13+
font-size: 32rpx;
14+
color: #aaa;
15+
justify-content: center;
16+
margin-top: 50rpx;
17+
}
18+
.page-header-text {
19+
padding: 20rpx 40rpx;
20+
border-bottom: 1px solid #ccc;
21+
}
22+
23+
.page-body {
24+
width: 100%;
25+
display: flex;
26+
flex-direction: column;
27+
align-items: center;
28+
flex-grow: 1;
29+
overflow-x: hidden;
30+
}
31+
.page-body-wrapper {
32+
margin-top: 100rpx;
33+
display: flex;
34+
flex-direction: column;
35+
align-items: center;
36+
width: 100%;
37+
}
38+
.page-body-wrapper form {
39+
width: 100%;
40+
}
41+
.page-body-wording {
42+
text-align: center;
43+
padding: 200rpx 100rpx;
44+
}
45+
.page-body-info {
46+
display: flex;
47+
flex-direction: column;
48+
align-items: center;
49+
background-color: #fff;
50+
margin-bottom: 50rpx;
51+
width: 100%;
52+
padding: 50rpx 0 150rpx 0;
53+
}
54+
.page-body-title {
55+
margin-bottom: 100rpx;
56+
font-size: 32rpx;
57+
}
58+
.page-body-text {
59+
font-size: 30rpx;
60+
line-height: 26px;
61+
color: #ccc;
62+
}
63+
.page-body-text-small {
64+
font-size: 24rpx;
65+
color: #000;
66+
margin-bottom: 100rpx;
67+
}
68+
.page-body-form {
69+
width: 100%;
70+
background-color: #fff;
71+
display: flex;
72+
flex-direction: column;
73+
width: 100%;
74+
border: 1px solid #eee;
75+
}
76+
.page-body-form-item {
77+
display: flex;
78+
align-items: center;
79+
margin-left: 10rpx;
80+
border-bottom: 1px solid #eee;
81+
height: 80rpx;
82+
}
83+
.page-body-form-key {
84+
width: 180rpx;
85+
}
86+
.page-body-form-value {
87+
flex-grow: 1;
88+
}
89+
90+
.page-body-form-picker {
91+
display: flex;
92+
justify-content: space-between;
93+
height: 100rpx;
94+
align-items: center;
95+
font-size: 36rpx;
96+
margin-left: 20rpx;
97+
padding-right: 20rpx;
98+
border-bottom: 1px solid #eee;
99+
}
100+
.page-body-form-picker-value {
101+
color: #ccc;
102+
}
103+
104+
.page-body-buttons {
105+
width: 100%;
106+
}
107+
.page-body-button {
108+
margin: 25rpx;
109+
}
110+
.page-body-button image {
111+
width: 150rpx;
112+
height: 150rpx;
113+
}
114+
.page-footer {
115+
text-align: center;
116+
color: #1aad19;
117+
font-size: 24rpx;
118+
margin: 20rpx 0;
119+
}
120+
121+
.green{
122+
color: #09BB07;
123+
}
124+
.red{
125+
color: #F76260;
126+
}
127+
.blue{
128+
color: #10AEFF;
129+
}
130+
.yellow{
131+
color: #FFBE00;
132+
}
133+
.gray{
134+
color: #C9C9C9;
135+
}
136+
137+
.strong{
138+
font-weight: bold;
139+
}
140+
141+
.bc_green{
142+
background-color: #09BB07;
143+
}
144+
.bc_red{
145+
background-color: #F76260;
146+
}
147+
.bc_blue{
148+
background-color: #10AEFF;
149+
150+
}
151+
.bc_yellow{
152+
background-color: #FFBE00;
153+
}
154+
.bc_gray{
155+
background-color: #C9C9C9;
156+
}
157+
158+
.tc{
159+
text-align: center;
160+
}
161+
162+
.page input{
163+
padding: 10px 15px;
164+
background-color: #fff;
165+
}
166+
checkbox, radio{
167+
margin-right: 5px;
168+
}
169+
170+
.btn-area{
171+
padding: 0 15px;
172+
}
173+
.btn-area button{
174+
margin-top: 10px;
175+
margin-bottom: 10px;
176+
}
177+
178+
.page {
179+
min-height: 100%;
180+
flex: 1;
181+
background-color: #FBF9FE;
182+
font-size: 16px;
183+
font-family: -apple-system-font,Helvetica Neue,Helvetica,sans-serif;
184+
overflow: hidden;
185+
}
186+
.page__hd{
187+
padding: 40px;
188+
}
189+
.page__title{
190+
display: block;
191+
font-size: 20px;
192+
}
193+
.page__desc{
194+
margin-top: 5px;
195+
font-size: 14px;
196+
color: #888888;
197+
}
198+
199+
.section{
200+
margin-bottom: 40px;
201+
}
202+
.section_gap{
203+
padding: 0 15px;
204+
}
205+
.section__title{
206+
margin-bottom: 8px;
207+
padding-left: 15px;
208+
padding-right: 15px;
209+
}
210+
.section_gap .section__title{
211+
padding-left: 0;
212+
padding-right: 0;
213+
}
214+
.section__ctn{
215+
216+
}

image/[email protected]

840 Bytes

image/[email protected]

761 Bytes

image/[email protected]

1.46 KB

image/[email protected]

885 Bytes

image/[email protected]

1.74 KB

image/[email protected]

1.61 KB

image/[email protected]

861 Bytes

image/[email protected]

2.36 KB

image/[email protected]

850 Bytes

image/[email protected]

1.48 KB

image/[email protected]

1.01 KB

image/[email protected]

1.95 KB

image/[email protected]

1.21 KB

image/[email protected]

973 Bytes

image/[email protected]

1.58 KB

image/[email protected]

2.31 KB

image/[email protected]

1.85 KB

image/[email protected]

22.8 KB

image/[email protected]

9.67 KB

image/mask.png

21.7 KB

image/[email protected]

565 Bytes

image/[email protected]

615 Bytes

image/[email protected]

1.11 KB

image/[email protected]

3.51 KB

image/[email protected]

8.48 KB

image/play_alpha.png

7.91 KB

image/[email protected]

1.13 KB

image/[email protected]

2.45 KB

image/[email protected]

777 Bytes

image/[email protected]

1.39 KB

image/[email protected]

2.03 KB

image/[email protected]

2.17 KB

image/[email protected]

1.1 KB

image/[email protected]

1.21 KB

image/[email protected]

2.11 KB

image/[email protected]

2.3 KB

image/[email protected]

1.76 KB

image/[email protected]

1.97 KB

image/[email protected]

1.91 KB

image/[email protected]

2.25 KB

image/[email protected]

2.24 KB

image/[email protected]

2.54 KB

image/[email protected]

2.53 KB

image/[email protected]

2.78 KB

image/[email protected]

2.86 KB

image/[email protected]

3.17 KB

image/[email protected]

1.62 KB

image/[email protected]

2.34 KB

image/[email protected]

1.8 KB

image/[email protected]

1.46 KB

pages/category/category.js

+41
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
{
2+
Page({
3+
data:{
4+
list:[],
5+
},
6+
onLoad:function(options){
7+
// 生命周期函数--监听页面加载
8+
var that = this;
9+
wx.request( {
10+
url: 'https://api.change.so/v1/categories.json',
11+
header: {
12+
// 'Content-Type': 'application/json'
13+
},
14+
success: function( res ) {
15+
console.log(res);
16+
that.setData({
17+
list:res.data.categories,
18+
});
19+
},
20+
fail: function( res ) {
21+
console.log(res);
22+
}
23+
});
24+
},
25+
onPullDownRefresh: function() {
26+
// 页面相关事件处理函数--监听用户下拉动作
27+
28+
},
29+
onReachBottom: function() {
30+
// 页面上拉触底事件的处理函数
31+
},
32+
onShareAppMessage: function() {
33+
// 用户点击右上角分享
34+
return {
35+
title: 'title', // 分享标题
36+
desc: 'desc', // 分享描述
37+
path: 'path' // 分享路径
38+
}
39+
}
40+
})
41+
}

pages/category/category.json

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
{
2+
"enablePullDownRefresh": true
3+
}

pages/category/category.wxml

+38
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
2+
<view class="container" style="color:#000;width:100%; height:30%">
3+
4+
<navigator
5+
style="display: flex;align-items:center; justify-content:center;width: 100%; height:40%;background-size: 100%; background-image: url({{list[0].cover}});"
6+
url="../detail/detail?url=https://api.change.so/v1/categories/2/videos.json">
7+
<view style="display: flex;align-items:center; justify-content:center;width: 100%; height:40%; ">
8+
<text class="text">{{list[0].name}}</text>
9+
</view>
10+
</navigator>
11+
<view style="display: flex;flex-direction: row; width:100%; height:30%">
12+
<navigator
13+
class="other" style=" background-size: 100%; background-image: url({{list[1].cover}});"
14+
url="../detail/detail?url=https://api.change.so/v1/categories/9/videos.json">
15+
<text class="text">{{list[1].name}}</text>
16+
</navigator>
17+
18+
<navigator
19+
class="other" style=" background-size: 100%; background-image: url({{list[2].cover}});"
20+
url="../detail/detail?url=https://api.change.so/v1/categories/4/videos.json">
21+
<text class="text">{{list[2].name}}</text>
22+
</navigator>
23+
</view>
24+
25+
<view style="display: flex;flex-direction: row; width:100%; height:30%;">
26+
<navigator
27+
class="other" style=" background-size: 100%; background-image: url({{list[3].cover}});"
28+
url="../detail/detail?url=https://api.change.so/v1/categories/11/videos.json">
29+
<text class="text">{{list[3].name}}</text>
30+
</navigator>
31+
32+
<navigator
33+
class="other" style=" background-size: 100%; background-image: url({{list[4].cover}});"
34+
url="../detail/detail?url=https://api.change.so/v1/categories/5/videos.json">
35+
<text class="text">{{list[4].name}}</text>
36+
</navigator>
37+
</view>
38+
</view>

0 commit comments

Comments
 (0)