Browse Source

添加图标

图标和tabBar
master
lqq 6 years ago
parent
commit
1ac3e70c0a
  1. 2
      .gitignore
  2. 18
      app.json
  3. 4
      config.js
  4. BIN
      images/common/btn_bg.png
  5. BIN
      images/common/com_count.png
  6. BIN
      images/common/phone.png
  7. BIN
      images/common/star.png
  8. BIN
      images/common/star_highlight.png
  9. BIN
      images/common/user.png
  10. BIN
      images/common/zan.png
  11. BIN
      images/home/图层 935.png
  12. BIN
      images/home/焦点.png
  13. BIN
      images/home/置顶.png
  14. BIN
      images/tab/billboard.png
  15. BIN
      images/tab/billboard_highlight.png
  16. BIN
      images/tab/home.png
  17. BIN
      images/tab/home_highlight.png
  18. BIN
      images/tab/topics.png
  19. BIN
      images/tab/topics_highlight.png
  20. BIN
      images/tab/user.png
  21. BIN
      images/tab/user_highlight.png
  22. BIN
      images/topic/gidea.png
  23. BIN
      images/topic/publish.png
  24. BIN
      images/user/activity.png
  25. BIN
      images/user/activity_icon.png
  26. BIN
      images/user/collect.png
  27. BIN
      images/user/msg.png
  28. BIN
      images/user/msg_icon.png
  29. BIN
      images/user/pins.png
  30. BIN
      images/user/system_icon.png
  31. BIN
      images/user/topic.png
  32. 15
      models/home.js
  33. 37
      utils/http.js

2
.gitignore

@ -1,3 +1,5 @@
# mac os
.DS_Store
# Logs # Logs
logs logs
*.log *.log

18
app.json

@ -12,22 +12,32 @@
"navigationBarTextStyle": "black" "navigationBarTextStyle": "black"
}, },
"tabBar": { "tabBar": {
"selectedColor": "#000",
"borderStyle": "white",
"list": [ "list": [
{ {
"pagePath": "pages/home/index", "pagePath": "pages/home/index",
"text": "首页" "text": "首页",
"iconPath": "/images/tab/home.png",
"selectedIconPath": "/images/tab/home_highlight.png"
}, },
{ {
"pagePath": "pages/billboards/index", "pagePath": "pages/billboards/index",
"text": "宣传栏" "text": "宣传栏",
"iconPath": "/images/tab/billboard.png",
"selectedIconPath": "/images/tab/billboard_highlight.png"
}, },
{ {
"pagePath": "pages/topics/index", "pagePath": "pages/topics/index",
"text": "议事厅" "text": "议事厅",
"iconPath": "/images/tab/topics.png",
"selectedIconPath": "/images/tab/topics_highlight.png"
}, },
{ {
"pagePath": "pages/user/index", "pagePath": "pages/user/index",
"text": "我的" "text": "我的",
"iconPath": "/images/tab/user.png",
"selectedIconPath": "/images/tab/user_highlight.png"
} }
] ]
}, },

4
config.js

@ -0,0 +1,4 @@
const config = {
api_url: '', // 服务器地址
}
export { config }

BIN
images/common/btn_bg.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 10 KiB

BIN
images/common/com_count.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 328 B

BIN
images/common/phone.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 294 B

BIN
images/common/star.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 667 B

BIN
images/common/star_highlight.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 853 B

BIN
images/common/user.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 716 B

BIN
images/common/zan.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 323 B

BIN
images/home/图层 935.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 9.2 KiB

BIN
images/home/焦点.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.0 KiB

BIN
images/home/置顶.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 626 B

BIN
images/tab/billboard.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 569 B

BIN
images/tab/billboard_highlight.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 465 B

BIN
images/tab/home.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 421 B

BIN
images/tab/home_highlight.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 352 B

BIN
images/tab/topics.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 764 B

BIN
images/tab/topics_highlight.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 580 B

BIN
images/tab/user.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 580 B

BIN
images/tab/user_highlight.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 459 B

BIN
images/topic/gidea.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.4 KiB

BIN
images/topic/publish.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.1 KiB

BIN
images/user/activity.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 594 B

BIN
images/user/activity_icon.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.6 KiB

BIN
images/user/collect.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 657 B

BIN
images/user/msg.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 487 B

BIN
images/user/msg_icon.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.4 KiB

BIN
images/user/pins.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 634 B

BIN
images/user/system_icon.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.7 KiB

BIN
images/user/topic.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 680 B

15
models/home.js

@ -0,0 +1,15 @@
import {HTTP} from '../utils/http.js'
class HomeModel extends HTTP {
constructor () {
super()
}
// 首页列表
getHomeList (success) {
let params = {
url: '',
sucess: sucess
}
this.request(params)
}
}

37
utils/http.js

@ -0,0 +1,37 @@
import {config} from '../config.js'
class HTTP {
constructor () {
this.baseUrl = config.api_url
}
request = (params) => {
let url = this.baseUrl + params.url
if (!params.method) {
params.method = 'GET'
}
wx.request({
url: url,
data: params.data,
header: {
'conent-type': 'application/json',
},
method: params.method,
dataType: 'json',
responseType: 'json',
success: function(res) {
console.log(res)
let code = res.statusCode.toString()
let startCode = code.charAt(0)
if (startCode == '2') {
params.success && params.success(res.data)
} else {
params.error && params.error(res)
}
},
fail: function(res) {
params.fail && params.fail(res)
},
})
}
}
export {HTTP}
Loading…
Cancel
Save