jiazhipeng 4 months ago
parent
commit
a85f228cc0
  1. 90
      pages/index/intelligentAgent.vue
  2. 10
      pages/index/readingBody.vue

90
pages/index/intelligentAgent.vue

@ -1,25 +1,105 @@
<template> <template>
<view></view> <view class="bg">
<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)">
<image class="top-banner" :src="showImg(item.head_img)" mode="aspectFill" lazy-load="true"></image>
</swiper-item>
</swiper>
</view>
<CustomTabBar :currentTab="3" />
</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() {
this.getList()
}, },
methods: { methods: {
getList() {
//
this.Post({
type_id: 3,
position: 1,
}, '/api/adv/getAdv').then(res => {
if(res.data) {
this.topBanner = res.data;
}
});
},
// 234
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>
.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> </style>

10
pages/index/readingBody.vue

@ -1,9 +1,7 @@
<template> <template>
<view class="bg"> <view class="bg">
<headerVue></headerVue>
<view class="content"> <view class="content">
<swiper class="top-banner" :circular="true" :interval="6000" <swiper class="top-banner" :indicator-dots="false" :autoplay="false" v-if="topBanner && topBanner.length > 0">
: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)"> <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> <image class="top-banner" :src="showImg(item.head_img)" mode="aspectFill" lazy-load="true"></image>
</swiper-item> </swiper-item>
@ -27,11 +25,7 @@
}, },
onReady() { onReady() {
this.getList()
},
onReachBottom() {
}, },
methods: { methods: {
getList() { getList() {

Loading…
Cancel
Save