|
|
<template>
|
|
|
<div class="body" ref="body">
|
|
|
<div v-for="(item, index) in channelData" :key="index">
|
|
|
<template v-if="item.template_name == 'focus'">
|
|
|
<Slider :list="list"></Slider>
|
|
|
</template>
|
|
|
<LayoutApp :show-back="true">
|
|
|
<div class="scroll-list-wrap">
|
|
|
<Scroll
|
|
|
ref="scroll"
|
|
|
:options="options"
|
|
|
@pulling-up="onPullingUp">
|
|
|
<div class="body" ref="body">
|
|
|
<div v-for="(item, index) in channelList.list" :key="index">
|
|
|
<template v-if="item.template_name == 'focus'">
|
|
|
<Slider :list="list"></Slider>
|
|
|
</template>
|
|
|
|
|
|
<template v-if="item.template_name == 'hotSeries'">
|
|
|
<Hot :list="item.data"></Hot>
|
|
|
</template>
|
|
|
<template v-if="item.template_name == 'hotSeries'">
|
|
|
<Hot :list="item.data"></Hot>
|
|
|
</template>
|
|
|
|
|
|
<template v-if="item.template_name == 'single_image'">
|
|
|
<Banner :linkUrl="linkUrl" :imgUrl="imgUrl"></Banner>
|
|
|
</template>
|
|
|
<template v-if="item.template_name == 'single_image'">
|
|
|
<Banner :linkUrl="linkUrl" :imgUrl="imgUrl"></Banner>
|
|
|
</template>
|
|
|
|
|
|
<template v-if="item.template_name == 'twoPicture'">
|
|
|
<TwoBanner :list="item.data"></TwoBanner>
|
|
|
</template>
|
|
|
</div>
|
|
|
<!-- <ScrollNav></ScrollNav> -->
|
|
|
<template v-if="item.template_name == 'twoPicture'">
|
|
|
<TwoBanner :list="item.data"></TwoBanner>
|
|
|
</template>
|
|
|
</div>
|
|
|
<ScrollNav></ScrollNav>
|
|
|
<ProductList :list="channelList.productlist"></ProductList>
|
|
|
</div>
|
|
|
</Scroll>
|
|
|
</div>
|
|
|
</LayoutApp>
|
|
|
</template>
|
|
|
|
|
|
<script>
|
|
|
import Slider from './components/slider'; // 轮播图
|
|
|
import Banner from './components/banner'; // 一张图广告位
|
|
|
import TwoBanner from './components/twoBanner'; // 两张图广告位
|
|
|
import Hot from './components/hot'; // 热门系列
|
|
|
import ScrollNav from './components/scrollNav'; // 滑动导航
|
|
|
import { Style, Scroll } from 'cube-ui'
|
|
|
import { createNamespacedHelpers } from 'vuex';
|
|
|
const {mapState, mapActions} = createNamespacedHelpers('home/channel');
|
|
|
import Slider from './components/slider';
|
|
|
import Banner from './components/banner';
|
|
|
import TwoBanner from './components/twoBanner';
|
|
|
import Hot from './components/hot';
|
|
|
import ScrollNav from './components/scrollNav';
|
|
|
import ProductList from '../../list/components/productList';
|
|
|
|
|
|
const { mapState, mapActions } = createNamespacedHelpers('home/channel');
|
|
|
|
|
|
export default {
|
|
|
data() {
|
|
|
return {
|
|
|
options: {
|
|
|
bounce: {
|
|
|
top: false
|
|
|
},
|
|
|
pullUpLoad: true
|
|
|
},
|
|
|
items: [1,2,3,4,5,6,7,8,9],
|
|
|
list: [
|
|
|
{
|
|
|
url: 'http://www.didichuxing.com/',
|
...
|
...
|
@@ -195,28 +215,42 @@ export default { |
|
|
}
|
|
|
},
|
|
|
computed: {
|
|
|
...mapState(['channelData']),
|
|
|
...mapState(['channelList']),
|
|
|
},
|
|
|
created() {
|
|
|
|
|
|
},
|
|
|
mounted() {
|
|
|
this.fetchChannelList();
|
|
|
this.fetchProductList();
|
|
|
},
|
|
|
methods: {
|
|
|
...mapActions(['fetchChannelList']),
|
|
|
...mapActions(['fetchChannelList','fetchProductList']),
|
|
|
|
|
|
async onPullingUp() {
|
|
|
await this.fetchProductList();
|
|
|
setTimeout(() => { this.$refs.scroll.forceUpdate() }, 1000)
|
|
|
}
|
|
|
|
|
|
},
|
|
|
components: {
|
|
|
Slider,
|
|
|
Banner,
|
|
|
TwoBanner,
|
|
|
Hot,
|
|
|
ScrollNav
|
|
|
ScrollNav,
|
|
|
Style,
|
|
|
Scroll,
|
|
|
ProductList
|
|
|
}
|
|
|
};
|
|
|
</script>
|
|
|
|
|
|
<style lang="scss" scoped>
|
|
|
.scroll-list-wrap {
|
|
|
height: 100%;
|
|
|
width: 100%;
|
|
|
}
|
|
|
.body {
|
|
|
height: 100%;
|
|
|
overflow-y: auto;
|
...
|
...
|
|