You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 

99 lines
2.1 KiB

<template>
<view class="bg">
<headerVue :isSearch="false"></headerVue>
<view class="content">
<swiper class="top-banner" :indicator-dots="false" :autoplay="false" v-if="topBanner && topBanner.length > 0">
<swiper-item v-for="(item, index) in topBanner" :key="index" @click.stop="gotoUrlNew(item,index)">
<image class="top-banner" :src="showImg(item.head_img)" mode="aspectFill" lazy-load="true"></image>
</swiper-item>
</swiper>
</view>
<CustomTabBar :currentTab="0" />
<MusicControl />
</view>
</template>
<script>
import MusicControl from '@/components/MusicControl.vue';
import headerVue from "@/components/header.vue"
import CustomTabBar from '@/components/CustomTabBar.vue';
export default {
components: {CustomTabBar,headerVue,MusicControl},
data() {
return {
topBanner: []
}
},
onLoad() {
},
onReady() {
this.getList()
},
onShow() {
this.browse_record({type: 'page',title: '首页'});
},
onReachBottom() {
},
methods: {
gotoUrlNew(item,index) {
if(index == 0) {
uni.switchTab({
url:"/pages/index/readingBody"
})
}else if(index == 1) {
uni.switchTab({
url:"/pages/index/intelligentAgent"
})
}
},
viewDetail(item) {
if (item.url) {
uni.navigateTo({
url:"/subPackages/webPage/webPage?url="+encodeURIComponent(item.url)
})
return
}
uni.navigateTo({
url:'/subPackages/letter/detail?id='+item.id
})
},
getList() {
// 大轮播
this.Post({
type_id: 3,
position: 17,
}, '/api/adv/getAdv').then(res => {
if(res.data) {
this.topBanner = res.data;
}
});
},
gotoVideo(item) {
uni.navigateTo({
url: '/subPackages/video/video?item=' + encodeURIComponent(JSON.stringify(item))
})
}
}
}
</script>
<style lang="scss" scoped>
.bg {
min-height: 100vh;
background: #FFFFFF;
display: flex;
flex-direction: column;
}
.content{
height: calc(100vh - 123rpx);
width: 100%;
}
.top-banner {
width: 100%;
height: calc(100vh - 123rpx);
}
</style>