From 9ec7266c022e4d8b0266cde9d9d3010a34e01f2d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=BC=A0=E8=89=BA?= <9855095+pigpigee@user.noreply.gitee.com> Date: Sat, 12 Feb 2022 08:25:22 +0800 Subject: [PATCH] day02 --- components/category/category.vue | 61 +++++++++++++ components/category/category1.vue | 61 +++++++++++++ components/category/category2.vue | 61 +++++++++++++ components/category/category3.vue | 61 +++++++++++++ components/category/category4.vue | 61 +++++++++++++ pages.json | 14 ++- pages/index/index.vue | 147 ++++++++++++++++-------------- pages/search/search.vue | 62 +++++++++++++ utils/config.js | 3 +- utils/request.js | 5 +- 10 files changed, 460 insertions(+), 76 deletions(-) create mode 100644 components/category/category.vue create mode 100644 components/category/category1.vue create mode 100644 components/category/category2.vue create mode 100644 components/category/category3.vue create mode 100644 components/category/category4.vue create mode 100644 pages/search/search.vue diff --git a/components/category/category.vue b/components/category/category.vue new file mode 100644 index 0000000..4735af2 --- /dev/null +++ b/components/category/category.vue @@ -0,0 +1,61 @@ + + + + + diff --git a/components/category/category1.vue b/components/category/category1.vue new file mode 100644 index 0000000..17481a1 --- /dev/null +++ b/components/category/category1.vue @@ -0,0 +1,61 @@ + + + + + diff --git a/components/category/category2.vue b/components/category/category2.vue new file mode 100644 index 0000000..920c115 --- /dev/null +++ b/components/category/category2.vue @@ -0,0 +1,61 @@ + + + + + diff --git a/components/category/category3.vue b/components/category/category3.vue new file mode 100644 index 0000000..ba61b81 --- /dev/null +++ b/components/category/category3.vue @@ -0,0 +1,61 @@ + + + + + diff --git a/components/category/category4.vue b/components/category/category4.vue new file mode 100644 index 0000000..f46bfb6 --- /dev/null +++ b/components/category/category4.vue @@ -0,0 +1,61 @@ + + + + + diff --git a/pages.json b/pages.json index dbb18eb..2479850 100644 --- a/pages.json +++ b/pages.json @@ -10,18 +10,26 @@ "enablePullDownRefresh": false } - }, { + }, + { "path": "pages/index/index", "style": { "navigationBarTitleText": "uni-app" } - }, { + }, + { "path": "pages/shopcar/shopcar", "style": { "navigationBarTitleText": "", "enablePullDownRefresh": false } - + }, + { + "path": "pages/search/search", + "style": { + "navigationBarTitleText": "", + "enablePullDownRefresh": false + } } ], "globalStyle": { diff --git a/pages/index/index.vue b/pages/index/index.vue index 528be63..17beec6 100644 --- a/pages/index/index.vue +++ b/pages/index/index.vue @@ -5,64 +5,54 @@ 🔎 - + - + + - - 推荐 - 智能 - 电视 - 家电 - 笔记本 - + @@ -70,50 +60,41 @@ - - -

手机

- - - - -
- -

手机

- - - - -
+ + + + + + @@ -137,14 +118,62 @@ @@ -179,22 +208,7 @@ export default { font-size 24upx color #f89f1b margin 0 20upx - .navScroll - width 100% - display flex - white-space nowrap - height 80upx - .navItem - width 200upx - height 100% - margin 0 20upx - padding 0 20upx - line-height 80upx - text-align center - display inline-block - box-sizing border-box - &.active - border-bottom 6upx solid orange + .banner image width 100% @@ -205,16 +219,9 @@ export default { .navItem width 20% margin-top 15upx - .phone - width 100% - h1 - margin-bottom 20upx - image - box-sizing border-box - width 50% - border 1px solid #eee .footer + float left width 100% background-color #2f2f2f .sb diff --git a/pages/search/search.vue b/pages/search/search.vue new file mode 100644 index 0000000..dd48e7c --- /dev/null +++ b/pages/search/search.vue @@ -0,0 +1,62 @@ + + + + + diff --git a/utils/config.js b/utils/config.js index 591dca2..009682d 100644 --- a/utils/config.js +++ b/utils/config.js @@ -1,3 +1,4 @@ export default { - host:'' + // host:'/api' + host:'http://106.15.179.105' } \ No newline at end of file diff --git a/utils/request.js b/utils/request.js index 6823a13..f0b1811 100644 --- a/utils/request.js +++ b/utils/request.js @@ -3,7 +3,7 @@ import config from "./config.js" export default (url, data = {}, method = 'GET') => { return new Promise((resolve, reject) => { wx.request({ - url: config.hostUrl + url, + url: config.host + url, data, method, success: res => { @@ -13,4 +13,5 @@ export default (url, data = {}, method = 'GET') => { reject(err) } }) - }) \ No newline at end of file + }) +} \ No newline at end of file -- Gitee