品类推荐
This commit is contained in:
@@ -21,7 +21,15 @@ const goods = (id) => {
|
|||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// 套餐列表
|
||||||
|
const meals = (id) => {
|
||||||
|
return request({
|
||||||
|
url: 'mall/meals/' + id
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
export {
|
export {
|
||||||
mall,
|
mall,
|
||||||
goods
|
goods,
|
||||||
|
meals
|
||||||
}
|
}
|
||||||
|
|||||||
17
pages.json
17
pages.json
@@ -38,7 +38,7 @@
|
|||||||
"name": "User",
|
"name": "User",
|
||||||
"style": {
|
"style": {
|
||||||
"navigationBarTitleText": "我的",
|
"navigationBarTitleText": "我的",
|
||||||
"navigationBarTextStyle":"white",
|
"navigationBarTextStyle": "white",
|
||||||
"app-plus": {
|
"app-plus": {
|
||||||
"titleNView": {
|
"titleNView": {
|
||||||
"backgroundImage": "linear-gradient(to right, #34ce98, #22aa98)",
|
"backgroundImage": "linear-gradient(to right, #34ce98, #22aa98)",
|
||||||
@@ -51,9 +51,9 @@
|
|||||||
"name": "Auth",
|
"name": "Auth",
|
||||||
"style": {
|
"style": {
|
||||||
"navigationBarTitleText": "登录",
|
"navigationBarTitleText": "登录",
|
||||||
"navigationStyle":"custom",
|
"navigationStyle": "custom",
|
||||||
"app-plus":{
|
"app-plus": {
|
||||||
"animationType":"slide-in-bottom"
|
"animationType": "slide-in-bottom"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}, {
|
}, {
|
||||||
@@ -106,10 +106,19 @@
|
|||||||
}
|
}
|
||||||
}, {
|
}, {
|
||||||
"path": "pages/pay/pay",
|
"path": "pages/pay/pay",
|
||||||
|
"name": "Pay",
|
||||||
"style": {
|
"style": {
|
||||||
"navigationBarTitleText": "收银台",
|
"navigationBarTitleText": "收银台",
|
||||||
"navigationBarBackgroundColor": "#FFFFFF"
|
"navigationBarBackgroundColor": "#FFFFFF"
|
||||||
}
|
}
|
||||||
|
}, {
|
||||||
|
"path": "pages/store/list",
|
||||||
|
"name": "StoreList",
|
||||||
|
"style": {
|
||||||
|
"navigationBarTitleText": "列表",
|
||||||
|
"navigationBarBackgroundColor": "#FFFFFF",
|
||||||
|
"enablePullDownRefresh": true
|
||||||
|
}
|
||||||
}],
|
}],
|
||||||
"tabBar": {
|
"tabBar": {
|
||||||
"borderStyle": "white",
|
"borderStyle": "white",
|
||||||
|
|||||||
@@ -39,16 +39,13 @@
|
|||||||
</view>
|
</view>
|
||||||
<!-- 推荐品类 -->
|
<!-- 推荐品类 -->
|
||||||
<view class="card-box">
|
<view class="card-box">
|
||||||
<view class="card-box-item" style="backgrond: #fef2ae">
|
<block v-for="(item, index) in meals" :key="index">
|
||||||
<view class="card-title">宝贝爱吃</view>
|
<view class="card-box-item" :style="{'backgrond': item.color}" @click="$Router.push({name: 'StoreList', params: {id: item.meal_id}})">
|
||||||
<view class="card-subtitle">精选食谱 三餐美味</view>
|
<view class="card-title">{{item.title}}</view>
|
||||||
<image class="card-cover" src="@/static/store/store_icon_00.png" mode="aspectFill"></image>
|
<view class="card-subtitle">{{item.subtitle}}</view>
|
||||||
</view>
|
<image class="card-cover" :src="item.cover" mode="aspectFill"></image>
|
||||||
<view class="card-box-item" style="backgrond: #c9ead9">
|
</view>
|
||||||
<view class="card-title">轻卡小食</view>
|
</block>
|
||||||
<view class="card-subtitle">火热商品 一目了然</view>
|
|
||||||
<image class="card-cover" src="@/static/store/store_icon_01.png" mode="aspectFill"></image>
|
|
||||||
</view>
|
|
||||||
</view>
|
</view>
|
||||||
<!-- goods -->
|
<!-- goods -->
|
||||||
<view class="goods-box">
|
<view class="goods-box">
|
||||||
@@ -71,7 +68,8 @@
|
|||||||
banners : [],
|
banners : [],
|
||||||
goodTabs : [],
|
goodTabs : [],
|
||||||
newGood : [],
|
newGood : [],
|
||||||
goodsArr : []
|
goodsArr : [],
|
||||||
|
meals : []
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
mounted(){
|
mounted(){
|
||||||
@@ -80,11 +78,15 @@
|
|||||||
methods:{
|
methods:{
|
||||||
getMall(){
|
getMall(){
|
||||||
mall().then(res => {
|
mall().then(res => {
|
||||||
this.banners = res.banners
|
console.log(res)
|
||||||
this.goodsArr = res.goods
|
this.banners = res.banners
|
||||||
this.newGood = res.news
|
this.goodsArr = res.goods
|
||||||
this.goodTabs = res.categories
|
this.newGood = res.news
|
||||||
|
this.goodTabs = res.categories
|
||||||
|
this.meals = res.meals
|
||||||
uni.stopPullDownRefresh()
|
uni.stopPullDownRefresh()
|
||||||
|
}).catch(err => {
|
||||||
|
console.log(err)
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|||||||
32
pages/store/list.vue
Normal file
32
pages/store/list.vue
Normal file
@@ -0,0 +1,32 @@
|
|||||||
|
<template>
|
||||||
|
<view>
|
||||||
|
<oct-goods
|
||||||
|
:lists="goodsArr"
|
||||||
|
color="#e6576b"
|
||||||
|
@onGoods="$Router.push({ name: 'StoreGoods', params: {id: $event.goods_id}})"
|
||||||
|
/>
|
||||||
|
</view>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
import { meals } from "@/apis/interfaces/store"
|
||||||
|
export default {
|
||||||
|
data() {
|
||||||
|
return {
|
||||||
|
goodsArr: []
|
||||||
|
};
|
||||||
|
},
|
||||||
|
mounted(){
|
||||||
|
meals(this.$Route.query.id).then(res => {
|
||||||
|
uni.setNavigationBarTitle({
|
||||||
|
title: res.title
|
||||||
|
})
|
||||||
|
this.goodsArr = res.items
|
||||||
|
})
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<style lang="scss">
|
||||||
|
|
||||||
|
</style>
|
||||||
Reference in New Issue
Block a user