|
@@ -1,7 +1,7 @@
|
|
|
<template>
|
|
|
<view class="section_page_main clearfix">
|
|
|
- <view class="recommend-list">
|
|
|
- <swiper class="tui-banner-swiper" :autoplay="true" :interval="5000" :duration="500" :circular="true" @change="swiperChange">
|
|
|
+ <view class="recommend-list" :style="hasLessProduct?'height:269px':''">
|
|
|
+ <swiper class="tui-banner-swiper" :autoplay="true" :interval="5000" :duration="500" :circular="true" @change="swiperChange" :style="hasLessProduct?'height:269px':''">
|
|
|
<swiper-item v-for="(product,index) in productList" :key="index">
|
|
|
<view class="floor-item ad_04 clearfix" v-for="(item, idx) in product" :key="idx" @click.stop="navToDetailPage(item)">
|
|
|
<image class="item-img tui-skeleton-fillet" :src="item.image" mode="aspectFill"></image>
|
|
@@ -146,6 +146,7 @@
|
|
|
current:100,
|
|
|
swiperCurrent:0,
|
|
|
pageSize:4,
|
|
|
+ productCount:0
|
|
|
}
|
|
|
},
|
|
|
filters: {
|
|
@@ -157,7 +158,10 @@
|
|
|
this.initData(this.pageData)
|
|
|
},
|
|
|
computed: {
|
|
|
- ...mapState(['hasLogin','userInfo','isActivity'])
|
|
|
+ ...mapState(['hasLogin','userInfo','isActivity']),
|
|
|
+ hasLessProduct(){
|
|
|
+ return this.productCount <= 2
|
|
|
+ }
|
|
|
},
|
|
|
watch: {
|
|
|
pageData: {
|
|
@@ -175,7 +179,8 @@
|
|
|
}).catch(err => {
|
|
|
console.log('err',err)
|
|
|
})
|
|
|
- if(data.floorImageList.length>0){
|
|
|
+ this.productCount = data.floorImageList.length
|
|
|
+ if(this.productCount>0){
|
|
|
this.productList.splice(0,this.productList.length);
|
|
|
for (var i = 0, j = data.floorImageList.length; i < j; i += this.pageSize) {
|
|
|
this.productList.push(data.floorImageList.slice(i, i + this.pageSize));
|