获取楼层数据

This commit is contained in:
jqtmviyu@gmail.com 2021-02-21 22:34:54 +08:00
parent e30c8cd232
commit 0ab0304cb0

View File

@ -12,12 +12,31 @@
<!-- 3. 导航 -->
<view class="nav">
<navigator class="nav_item" v-for="item in catitems" :key="item.image_src">
<navigator class="nav_item" v-for="item in catitems" :key="item.image_src" open-type="switchTab" url="/pages/category/category">
<image :src="item.image_src" mode="widthFix"></image>
<!-- widthFix 缩放模式宽度不变高度自动变化保持原图宽高比不变 -->
</navigator>
</view>
<!-- 4. 楼层 -->
<!-- 两层数据 -->
<view class="floor" >
<!-- 第一层:时尚女装,户外活动,箱包配饰... -->
<view class="floor_group" v-for="(item, index) in floordata" :key="index">
<!-- 标题 -->
<view class="floor_group_title">
<image :src="item.floor_title.image_src"></image>
</view>
<!-- 内容 -->
<view class="floor_group_list">
<navigator class="floor_item" v-for="item2 in item.product_list" :key="item2.name">
<image :src="item2.image_src"></image>
</navigator>
</view>
</view>
</view>
</view>
</template>
@ -26,7 +45,8 @@
data() {
return {
swiperList: [],
catitems: []
catitems: [],
floordata:[]
}
},
//
@ -35,6 +55,8 @@
this.getSwiper()
//
this.getCatitems()
//
this.getFloordata()
},
methods: {
// getSwiper(){
@ -54,6 +76,12 @@
async getCatitems(){
const { message } = await this.$u.api.getCatitems()
this.catitems = message
},
//
async getFloordata(){
const { message } = await this.$u.api.getFloordata()
this.floordata = message
}
}
}