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

94
pages/index/intelligentAgent.vue

@ -1,25 +1,105 @@
<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>
<script>
import headerVue from "@/components/header.vue"
import CustomTabBar from '@/components/CustomTabBar.vue';
export default {
components: {CustomTabBar},
components: {CustomTabBar,headerVue},
data() {
return {}
return {
topBanner: []
}
},
onLoad() {
},
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>
<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>

10
pages/index/readingBody.vue

@ -1,9 +1,7 @@
<template>
<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 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>
@ -27,11 +25,7 @@
},
onReady() {
},
onReachBottom() {
this.getList()
},
methods: {
getList() {

Loading…
Cancel
Save