...
|
...
|
@@ -3,7 +3,7 @@ |
|
|
<div class="scroll-list-wrap">
|
|
|
<template v-if="isShow">
|
|
|
<div v-for="(item, index) in channelList.list" v-if="item.template_name == 'guessLike'">
|
|
|
<ScrollNav :list="item.data.list" :current="active"></ScrollNav>
|
|
|
<ScrollNav :list="item.data" :current="active"></ScrollNav>
|
|
|
</div>
|
|
|
</template>
|
|
|
<Scroll
|
...
|
...
|
@@ -18,12 +18,12 @@ |
|
|
<div class="marginTop">
|
|
|
<div v-for="(item, index) in channelList.list" :key="index" class="space-between">
|
|
|
<Swiper :list="item.data" v-if="item.template_name == 'threePicture'"/>
|
|
|
<Hot :list="item.data.list" v-if="item.template_name == 'image_list'"/>
|
|
|
<Hot :list="item.data" v-if="item.template_name == 'image_list'"/>
|
|
|
<Banner :list="item.data" v-if="item.template_name == 'single_image'"/>
|
|
|
<TwoBanner :list="item.data" v-if="item.template_name == 'twoPicture'"/>
|
|
|
<template v-if="!isShow">
|
|
|
<div ref="sss" v-if="item.template_name == 'guessLike'">
|
|
|
<ScrollNav :list="item.data.list" :current="active" @transfer="getIndex"></ScrollNav>
|
|
|
<ScrollNav :list="item.data" :current="active" @transfer="getIndex"></ScrollNav>
|
|
|
</div>
|
|
|
</template>
|
|
|
</div>
|
...
|
...
|
@@ -41,6 +41,7 @@ |
|
|
<script>
|
|
|
import { Style, Scroll, Sticky } from 'cube-ui';
|
|
|
import { createNamespacedHelpers } from 'vuex';
|
|
|
import queryString from 'query-string';
|
|
|
import Swiper from './components/swiper';
|
|
|
import Banner from './components/banner';
|
|
|
import TwoBanner from './components/twoBanner';
|
...
|
...
|
@@ -71,6 +72,9 @@ export default { |
|
|
total: 0,
|
|
|
marginTop: 0,
|
|
|
active: 0,
|
|
|
params: {
|
|
|
isHome: true,
|
|
|
}
|
|
|
};
|
|
|
},
|
|
|
computed: {
|
...
|
...
|
@@ -78,17 +82,22 @@ export default { |
|
|
...mapStateList(['productList']),
|
|
|
},
|
|
|
mounted() {
|
|
|
const params = {
|
|
|
isPage: true,
|
|
|
isHome: true,
|
|
|
}
|
|
|
this.fetchChannelList().then((res) => {
|
|
|
console.log(res);
|
|
|
let windowH = document.documentElement.clientHeight || document.body.clientHeight;
|
|
|
this.navTop = this.$refs.sss[0].offsetTop;
|
|
|
this.navHeight = this.$refs.sss[0].offsetHeight;
|
|
|
this.total = windowH - this.navHeight;
|
|
|
res.forEach((item) => {
|
|
|
if (item.template_name == "guessLike") {
|
|
|
let url = item.data[0].url.split("?");
|
|
|
this.params = queryString.parse(url[1]);
|
|
|
}
|
|
|
})
|
|
|
this.fetchProductList(this.params);
|
|
|
});
|
|
|
this.fetchProductList(params);
|
|
|
|
|
|
|
|
|
},
|
|
|
created() {
|
|
|
|
...
|
...
|
@@ -101,22 +110,15 @@ export default { |
|
|
let scrollY = Math.abs(parseInt(y));
|
|
|
if (scrollY >= this.navTop) {
|
|
|
this.isShow = true;
|
|
|
this.marginTop = 0;
|
|
|
} else {
|
|
|
this.isShow = false;
|
|
|
this.marginTop = '30px';
|
|
|
}
|
|
|
// this.scrollY = -y
|
|
|
},
|
|
|
...mapActions(['fetchChannelList']),
|
|
|
...mapActionsList(['fetchProductList']),
|
|
|
async onPullingUp() {
|
|
|
const params = {
|
|
|
isReset: false,
|
|
|
isHome: true,
|
|
|
};
|
|
|
await this.fetchProductList(params);
|
|
|
this.$refs.scroll.forceUpdate();
|
|
|
this.params.isReset = false
|
|
|
await this.fetchProductList(this.params);
|
|
|
}
|
|
|
},
|
|
|
components: {
|
...
|
...
|
@@ -198,6 +200,6 @@ export default { |
|
|
z-index: 999;
|
|
|
}
|
|
|
.marginTop {
|
|
|
margin-top: 64px;
|
|
|
// margin-top: 64px;
|
|
|
}
|
|
|
</style> |
...
|
...
|
|