diff --git a/.gitignore b/.gitignore index a4af05a..f3d35bc 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,5 @@ +# mac os +.DS_Store # Logs logs *.log diff --git a/app.json b/app.json index cb385e5..82c0fc1 100644 --- a/app.json +++ b/app.json @@ -12,22 +12,32 @@ "navigationBarTextStyle": "black" }, "tabBar": { + "selectedColor": "#000", + "borderStyle": "white", "list": [ { "pagePath": "pages/home/index", - "text": "首页" + "text": "首页", + "iconPath": "/images/tab/home.png", + "selectedIconPath": "/images/tab/home_highlight.png" }, { "pagePath": "pages/billboards/index", - "text": "宣传栏" + "text": "宣传栏", + "iconPath": "/images/tab/billboard.png", + "selectedIconPath": "/images/tab/billboard_highlight.png" }, { "pagePath": "pages/topics/index", - "text": "议事厅" + "text": "议事厅", + "iconPath": "/images/tab/topics.png", + "selectedIconPath": "/images/tab/topics_highlight.png" }, { "pagePath": "pages/user/index", - "text": "我的" + "text": "我的", + "iconPath": "/images/tab/user.png", + "selectedIconPath": "/images/tab/user_highlight.png" } ] }, diff --git a/config.js b/config.js new file mode 100644 index 0000000..8af9788 --- /dev/null +++ b/config.js @@ -0,0 +1,4 @@ +const config = { + api_url: '', // 服务器地址 +} +export { config } \ No newline at end of file diff --git a/images/common/btn_bg.png b/images/common/btn_bg.png new file mode 100644 index 0000000..ca30feb Binary files /dev/null and b/images/common/btn_bg.png differ diff --git a/images/common/com_count.png b/images/common/com_count.png new file mode 100644 index 0000000..d90c05a Binary files /dev/null and b/images/common/com_count.png differ diff --git a/images/common/phone.png b/images/common/phone.png new file mode 100644 index 0000000..709bd61 Binary files /dev/null and b/images/common/phone.png differ diff --git a/images/common/star.png b/images/common/star.png new file mode 100644 index 0000000..29a847c Binary files /dev/null and b/images/common/star.png differ diff --git a/images/common/star_highlight.png b/images/common/star_highlight.png new file mode 100644 index 0000000..c416e0e Binary files /dev/null and b/images/common/star_highlight.png differ diff --git a/images/common/user.png b/images/common/user.png new file mode 100644 index 0000000..bfcf322 Binary files /dev/null and b/images/common/user.png differ diff --git a/images/common/zan.png b/images/common/zan.png new file mode 100644 index 0000000..b7d65eb Binary files /dev/null and b/images/common/zan.png differ diff --git a/images/home/图层 935.png b/images/home/图层 935.png new file mode 100644 index 0000000..fe5f730 Binary files /dev/null and b/images/home/图层 935.png differ diff --git a/images/home/焦点.png b/images/home/焦点.png new file mode 100644 index 0000000..f90388f Binary files /dev/null and b/images/home/焦点.png differ diff --git a/images/home/置顶.png b/images/home/置顶.png new file mode 100644 index 0000000..700f0cc Binary files /dev/null and b/images/home/置顶.png differ diff --git a/images/tab/billboard.png b/images/tab/billboard.png new file mode 100644 index 0000000..2781d8f Binary files /dev/null and b/images/tab/billboard.png differ diff --git a/images/tab/billboard_highlight.png b/images/tab/billboard_highlight.png new file mode 100644 index 0000000..726f843 Binary files /dev/null and b/images/tab/billboard_highlight.png differ diff --git a/images/tab/home.png b/images/tab/home.png new file mode 100644 index 0000000..07d51fe Binary files /dev/null and b/images/tab/home.png differ diff --git a/images/tab/home_highlight.png b/images/tab/home_highlight.png new file mode 100644 index 0000000..7ec3d11 Binary files /dev/null and b/images/tab/home_highlight.png differ diff --git a/images/tab/topics.png b/images/tab/topics.png new file mode 100644 index 0000000..f8a4203 Binary files /dev/null and b/images/tab/topics.png differ diff --git a/images/tab/topics_highlight.png b/images/tab/topics_highlight.png new file mode 100644 index 0000000..a83bc16 Binary files /dev/null and b/images/tab/topics_highlight.png differ diff --git a/images/tab/user.png b/images/tab/user.png new file mode 100644 index 0000000..b510cee Binary files /dev/null and b/images/tab/user.png differ diff --git a/images/tab/user_highlight.png b/images/tab/user_highlight.png new file mode 100644 index 0000000..b81c1d2 Binary files /dev/null and b/images/tab/user_highlight.png differ diff --git a/images/topic/gidea.png b/images/topic/gidea.png new file mode 100644 index 0000000..b1ad613 Binary files /dev/null and b/images/topic/gidea.png differ diff --git a/images/topic/publish.png b/images/topic/publish.png new file mode 100644 index 0000000..039a9b0 Binary files /dev/null and b/images/topic/publish.png differ diff --git a/images/user/activity.png b/images/user/activity.png new file mode 100644 index 0000000..c8b3937 Binary files /dev/null and b/images/user/activity.png differ diff --git a/images/user/activity_icon.png b/images/user/activity_icon.png new file mode 100644 index 0000000..76bc85a Binary files /dev/null and b/images/user/activity_icon.png differ diff --git a/images/user/collect.png b/images/user/collect.png new file mode 100644 index 0000000..84c7d46 Binary files /dev/null and b/images/user/collect.png differ diff --git a/images/user/msg.png b/images/user/msg.png new file mode 100644 index 0000000..84c3d9b Binary files /dev/null and b/images/user/msg.png differ diff --git a/images/user/msg_icon.png b/images/user/msg_icon.png new file mode 100644 index 0000000..dffe590 Binary files /dev/null and b/images/user/msg_icon.png differ diff --git a/images/user/pins.png b/images/user/pins.png new file mode 100644 index 0000000..b62c3b0 Binary files /dev/null and b/images/user/pins.png differ diff --git a/images/user/system_icon.png b/images/user/system_icon.png new file mode 100644 index 0000000..6df0bfc Binary files /dev/null and b/images/user/system_icon.png differ diff --git a/images/user/topic.png b/images/user/topic.png new file mode 100644 index 0000000..73cbe66 Binary files /dev/null and b/images/user/topic.png differ diff --git a/models/home.js b/models/home.js new file mode 100644 index 0000000..3afa6e9 --- /dev/null +++ b/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) + } +} \ No newline at end of file diff --git a/utils/http.js b/utils/http.js new file mode 100644 index 0000000..d9a1a41 --- /dev/null +++ b/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}