获取楼层数据
This commit is contained in:
parent
e30c8cd232
commit
0ab0304cb0
@ -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
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user