品类推荐
This commit is contained in:
@@ -39,16 +39,13 @@
|
||||
</view>
|
||||
<!-- 推荐品类 -->
|
||||
<view class="card-box">
|
||||
<view class="card-box-item" style="backgrond: #fef2ae">
|
||||
<view class="card-title">宝贝爱吃</view>
|
||||
<view class="card-subtitle">精选食谱 三餐美味</view>
|
||||
<image class="card-cover" src="@/static/store/store_icon_00.png" mode="aspectFill"></image>
|
||||
</view>
|
||||
<view class="card-box-item" style="backgrond: #c9ead9">
|
||||
<view class="card-title">轻卡小食</view>
|
||||
<view class="card-subtitle">火热商品 一目了然</view>
|
||||
<image class="card-cover" src="@/static/store/store_icon_01.png" mode="aspectFill"></image>
|
||||
</view>
|
||||
<block v-for="(item, index) in meals" :key="index">
|
||||
<view class="card-box-item" :style="{'backgrond': item.color}" @click="$Router.push({name: 'StoreList', params: {id: item.meal_id}})">
|
||||
<view class="card-title">{{item.title}}</view>
|
||||
<view class="card-subtitle">{{item.subtitle}}</view>
|
||||
<image class="card-cover" :src="item.cover" mode="aspectFill"></image>
|
||||
</view>
|
||||
</block>
|
||||
</view>
|
||||
<!-- goods -->
|
||||
<view class="goods-box">
|
||||
@@ -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)
|
||||
})
|
||||
}
|
||||
},
|
||||
|
||||
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