From 6d4971bc5ecca0f10b6c2cdfeb007b989e69b59c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=94=90=E6=98=8E=E6=98=8E?= <970899069@qq.com> Date: Thu, 6 Jan 2022 17:09:07 +0800 Subject: [PATCH] =?UTF-8?q?=E5=93=81=E7=B1=BB=E6=8E=A8=E8=8D=90?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- apis/interfaces/store.js | 10 +++++++++- pages.json | 35 ++++++++++++++++++++++------------- pages/store/index.vue | 32 +++++++++++++++++--------------- pages/store/list.vue | 32 ++++++++++++++++++++++++++++++++ 4 files changed, 80 insertions(+), 29 deletions(-) create mode 100644 pages/store/list.vue diff --git a/apis/interfaces/store.js b/apis/interfaces/store.js index 7a071cf..c34249d 100644 --- a/apis/interfaces/store.js +++ b/apis/interfaces/store.js @@ -21,7 +21,15 @@ const goods = (id) => { }) } +// 套餐列表 +const meals = (id) => { + return request({ + url: 'mall/meals/' + id + }) +} + export { mall, - goods + goods, + meals } diff --git a/pages.json b/pages.json index f629a0e..fcdfb4c 100644 --- a/pages.json +++ b/pages.json @@ -17,7 +17,7 @@ "path": "pages/store/index", "name": "Store", "style": { - "navigationBarTitleText": "健康生活", + "navigationBarTitleText": "健康生活", "enablePullDownRefresh": true, "app-plus": { "titleNView": { @@ -38,22 +38,22 @@ "name": "User", "style": { "navigationBarTitleText": "我的", - "navigationBarTextStyle":"white", - "app-plus": { - "titleNView": { - "backgroundImage": "linear-gradient(to right, #34ce98, #22aa98)", - "type": "transparent" - } + "navigationBarTextStyle": "white", + "app-plus": { + "titleNView": { + "backgroundImage": "linear-gradient(to right, #34ce98, #22aa98)", + "type": "transparent" + } } } }, { "path": "pages/auth/auth", "name": "Auth", "style": { - "navigationBarTitleText": "登录", - "navigationStyle":"custom", - "app-plus":{ - "animationType":"slide-in-bottom" + "navigationBarTitleText": "登录", + "navigationStyle": "custom", + "app-plus": { + "animationType": "slide-in-bottom" } } }, { @@ -75,7 +75,7 @@ "style": { "navigationBarTitleText": "确认订单", "enablePullDownRefresh": false - } + } }, { "path": "pages/order/index", "name": "Order", @@ -105,11 +105,20 @@ "enablePullDownRefresh": false } }, { - "path": "pages/pay/pay", + "path": "pages/pay/pay", + "name": "Pay", "style": { "navigationBarTitleText": "收银台", "navigationBarBackgroundColor": "#FFFFFF" } + }, { + "path": "pages/store/list", + "name": "StoreList", + "style": { + "navigationBarTitleText": "列表", + "navigationBarBackgroundColor": "#FFFFFF", + "enablePullDownRefresh": true + } }], "tabBar": { "borderStyle": "white", diff --git a/pages/store/index.vue b/pages/store/index.vue index 1231297..3c9f739 100644 --- a/pages/store/index.vue +++ b/pages/store/index.vue @@ -39,16 +39,13 @@ - - 宝贝爱吃 - 精选食谱 三餐美味 - - - - 轻卡小食 - 火热商品 一目了然 - - + + + {{item.title}} + {{item.subtitle}} + + + @@ -71,7 +68,8 @@ banners : [], goodTabs : [], newGood : [], - goodsArr : [] + goodsArr : [], + meals : [] }; }, mounted(){ @@ -80,11 +78,15 @@ methods:{ getMall(){ mall().then(res => { - this.banners = res.banners - this.goodsArr = res.goods - this.newGood = res.news - this.goodTabs = res.categories + console.log(res) + this.banners = res.banners + this.goodsArr = res.goods + this.newGood = res.news + this.goodTabs = res.categories + this.meals = res.meals uni.stopPullDownRefresh() + }).catch(err => { + console.log(err) }) } }, diff --git a/pages/store/list.vue b/pages/store/list.vue new file mode 100644 index 0000000..52df698 --- /dev/null +++ b/pages/store/list.vue @@ -0,0 +1,32 @@ + + + + +