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.
105 lines
2.0 KiB
105 lines
2.0 KiB
<template>
|
|
<view class="bg">
|
|
<navigator url="/subPackages/readingBody/index" 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" >
|
|
<image class="top-banner" :src="showImg(item.head_img)" mode="aspectFill" lazy-load="true"></image>
|
|
</swiper-item>
|
|
</swiper>
|
|
</navigator>
|
|
<CustomTabBar :currentTab="1" />
|
|
</view>
|
|
</template>
|
|
|
|
<script>
|
|
import headerVue from "@/components/header.vue"
|
|
import CustomTabBar from '@/components/CustomTabBar.vue';
|
|
export default {
|
|
components: {CustomTabBar,headerVue},
|
|
data() {
|
|
return {
|
|
topBanner: []
|
|
}
|
|
},
|
|
onLoad() {
|
|
|
|
},
|
|
onReady() {
|
|
this.getList()
|
|
},
|
|
methods: {
|
|
getList() {
|
|
// 大轮播
|
|
this.Post({
|
|
type_id: 3,
|
|
position: 1,
|
|
}, '/api/adv/getAdv').then(res => {
|
|
if(res.data) {
|
|
this.topBanner = res.data;
|
|
}
|
|
});
|
|
},
|
|
// 2是各种详情页,3是列表专题页面,4是小程序
|
|
gotoUrlNew(item) {
|
|
console.log(item);
|
|
let that = this;
|
|
let url = '';
|
|
switch (item.jump_type) {
|
|
case 0:
|
|
break;
|
|
case 2:
|
|
uni.navigateTo({
|
|
url: item.tdata
|
|
});
|
|
break;
|
|
case 3:
|
|
uni.navigateTo({
|
|
url: '/subPackages/webPage/webPage?url=' + item.tdata
|
|
});
|
|
break;
|
|
case 4:
|
|
uni.navigateToMiniProgram({
|
|
appId: item.tdata.appid, // 此为appid
|
|
path: item.tdata.page, // 此为首页路径
|
|
envVersion: 'release',
|
|
success: res => {
|
|
// 打开成功
|
|
console.log('打开成功', res);
|
|
},
|
|
fail: err => {
|
|
console.log(err);
|
|
}
|
|
});
|
|
break;
|
|
default:
|
|
break;
|
|
}
|
|
},
|
|
|
|
|
|
|
|
|
|
}
|
|
}
|
|
</script>
|
|
|
|
<style lang="scss" scoped>
|
|
|
|
.bg {
|
|
min-height: 100vh;
|
|
background: #FFFFFF;
|
|
display: flex;
|
|
flex-direction: column;
|
|
}
|
|
.content{
|
|
flex: 1;
|
|
height: 200rpx;
|
|
width: 100%;
|
|
}
|
|
.top-banner {
|
|
width: 100%;
|
|
height: 100%;
|
|
}
|
|
|
|
|
|
</style>
|
|
|