Skip to content

Commit 41c3f85

Browse files
committed
build project
1 parent 2740b78 commit 41c3f85

22 files changed

+8901
-0
lines changed

app.js

+35
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
//app.js
2+
App({
3+
onLaunch: function () {
4+
// 获取系统信息
5+
wx.getSystemInfo({
6+
success: (res) => {
7+
this.globalData.systemInfo = res
8+
},
9+
})
10+
// 获取用户信息
11+
wx.getSetting({
12+
success: res => {
13+
if (res.authSetting['scope.userInfo']) {
14+
// 已经授权,可以直接调用 getUserInfo 获取头像昵称,不会弹框
15+
wx.getUserInfo({
16+
success: res => {
17+
// 可以将 res 发送给后台解码出 unionId
18+
this.globalData.userInfo = res.userInfo
19+
20+
// 由于 getUserInfo 是网络请求,可能会在 Page.onLoad 之后才返回
21+
// 所以此处加入 callback 以防止这种情况
22+
if (this.userInfoReadyCallback) {
23+
this.userInfoReadyCallback(res)
24+
}
25+
}
26+
})
27+
}
28+
}
29+
})
30+
},
31+
globalData: {
32+
userInfo: null,
33+
systemInfo: {}
34+
}
35+
})

app.json

+13
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
{
2+
"pages":[
3+
"pages/index/index",
4+
"pages/select/select",
5+
"pages/map/map"
6+
],
7+
"window":{
8+
"backgroundTextStyle":"light",
9+
"navigationBarBackgroundColor": "#fff",
10+
"navigationBarTitleText": "选择城市DEMO",
11+
"navigationBarTextStyle":"black"
12+
}
13+
}

app.wxss

+32
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
/**app.wxss**/
2+
text {
3+
font-family:"Helvetica Neue",Helvetica,Arial,"Microsoft Yahei","Hiragino Sans GB","Heiti SC", sans-serif;
4+
color: #333;
5+
}
6+
.container {
7+
width: 100%;
8+
box-sizing: border-box;
9+
}
10+
button{
11+
outline:0;
12+
}
13+
ul,li,ol {
14+
list-style: none;
15+
}
16+
a {
17+
color: #666;
18+
text-decoration: none;
19+
transition: all .25s ease-out;
20+
}
21+
a:hover {
22+
color: #39c5bb;
23+
}
24+
p{
25+
margin-bottom: 10px;
26+
}
27+
.clearfix:after{
28+
content: '';
29+
display: block;
30+
clear: both;
31+
height: 0;
32+
}

assets/img/controls.png

5.17 KB
Loading

0 commit comments

Comments
 (0)