4 changed files with 103 additions and 436 deletions
@ -1,25 +1,111 @@ |
|||||
<template> |
<template> |
||||
<view></view> |
<view class="bg"> |
||||
|
<headerVue></headerVue> |
||||
|
<view class="content"> |
||||
|
<swiper class="top-banner" :circular="true" :interval="6000" |
||||
|
:duration="800" :indicator-dots="false" :autoplay="true" v-if="topBanner && topBanner.length > 0"> |
||||
|
<swiper-item v-for="(item, index) in topBanner" :key="index" @click.stop="gotoUrlNew(item)"> |
||||
|
<image class="top-banner" :src="showImg(item.head_img)" mode="aspectFill" lazy-load="true"></image> |
||||
|
</swiper-item> |
||||
|
</swiper> |
||||
|
</view> |
||||
|
<CustomTabBar :currentTab="1" /> |
||||
|
</view> |
||||
</template> |
</template> |
||||
|
|
||||
<script> |
<script> |
||||
|
import headerVue from "@/components/header.vue" |
||||
import CustomTabBar from '@/components/CustomTabBar.vue'; |
import CustomTabBar from '@/components/CustomTabBar.vue'; |
||||
export default { |
export default { |
||||
components: {CustomTabBar}, |
components: {CustomTabBar,headerVue}, |
||||
data() { |
data() { |
||||
return {} |
return { |
||||
|
topBanner: [] |
||||
|
} |
||||
}, |
}, |
||||
onLoad() { |
onLoad() { |
||||
|
|
||||
}, |
}, |
||||
onReady() { |
onReady() { |
||||
|
|
||||
|
|
||||
}, |
}, |
||||
methods:{ |
onReachBottom() { |
||||
|
|
||||
}, |
}, |
||||
|
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> |
</script> |
||||
|
|
||||
<style lang="scss" scoped> |
<style lang="scss" scoped> |
||||
</style> |
|
||||
|
.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> |
||||
|
Loading…
Reference in new issue