Authored by Tao

add channel

<template>
<LayoutApp :show-back="true" :hide-header="hideHeader">
<div class="scroll-list-wrap">
<template v-if="!isShow">
<template v-if="isShow">
<div v-for="(item, index) in channelList.list" v-if="item.template_name == 'guessLike'">
<ScrollNav :list="item.data.list" :cur="cur"></ScrollNav>
<ScrollNav :list="item.data.list" :current="active"></ScrollNav>
</div>
</template>
<Scroll
... ... @@ -23,12 +23,12 @@
<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" :cur="cur" @transfer="getIndex"></ScrollNav>
<ScrollNav :list="item.data.list" :current="active" @transfer="getIndex"></ScrollNav>
</div>
</template>
</div>
</div>
<div :style="{minHeight: total + 'px'}">
<div :style="{minHeight: total + 'px'}" :class="{marginTop: isShow}">
<ProductList :list="productList.list" v-if="productList.list.length > 0" class="bgColor"></ProductList>
<UfoNoItem :tip="`暂无数据`" v-else></UfoNoItem>
</div>
... ... @@ -70,7 +70,7 @@ export default {
isShow: false,
total: 0,
marginTop: 0,
cur: 0,
active: 0,
};
},
computed: {
... ... @@ -95,8 +95,7 @@ export default {
},
methods: {
getIndex(index) {
this.cur = index;
console.log(this.cur);
this.active = Number(index);
},
scrollHandler({ y }) {
let scrollY = Math.abs(parseInt(y));
... ... @@ -198,4 +197,7 @@ export default {
left: 0;
z-index: 999;
}
.marginTop {
margin-top: 64px;
}
</style>
... ...
<template>
<div class="ScrollNav" v-if="labels.length > 0">
<ScrollNavBar :current="this.list[cur].tab_name" :labels="labels" @change="changeHandler">
<ScrollNavBar :current="this.list[current].tab_name" :labels="labels" @change="changeHandler">
<span slot-scope="props">
{{props.txt}}
<span :ref="`getindex${props.txt}`" v-show="false">{{props.index}}</span>
... ... @@ -23,7 +23,7 @@ export default {
type: Array,
default: true
},
cur: {
current: {
type: Number,
default: true
}
... ... @@ -31,7 +31,7 @@ export default {
data() {
return {
index: 0,
current: this.list[0].tab_name,
// current: this.list[0].tab_name,
labels: [],
}
},
... ... @@ -56,7 +56,6 @@ export default {
let params = Object.assign({},...query);
params.isReset = true; delete params.method;
this.fetchProductList(params);
console.log(index);
this.$emit('transfer',index);
}
}
... ...