jiazhipeng 4 months ago
parent
commit
4bd640125c
  1. 4
      components/header.vue
  2. 116
      pages/index/sensoryStore.vue

4
components/header.vue

@ -1,6 +1,8 @@
<template>
<view class="header" :style="{'height': height+'px','padding-top':statusBarHeight+'px'}">
<image src="https://static.ticket.sz-trip.com/epicSoul/readingBody/search.png" mode="heightFix"></image>
<image src="https://static.ticket.sz-trip.com/uploads/20250625/9bb05097e07570a934235983e1681a9f.png" mode="heightFix"></image>
<view></view>
</view>
</template>
@ -34,7 +36,7 @@
flex-shrink: 0;
display: flex;
align-items: center;
justify-content: center;
justify-content: space-around;
image{
height: 46.16rpx;
}

116
pages/index/sensoryStore.vue

@ -1,25 +1,133 @@
<template>
<view></view>
<view class="bg">
<headerVue></headerVue>
<view class="banner-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>
<image class="head-img" src="https://static.ticket.sz-trip.com/uploads/20250625/e3112c280ef9761af741907a737ef221.png"></image>
<CustomTabBar :currentTab="2" />
</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:{
onReachBottom() {
},
methods: {
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: 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;
}
},
gotoVideo(item) {
uni.navigateTo({
url: '/subPackages/video/video?item=' + encodeURIComponent(JSON.stringify(item))
})
},
}
}
</script>
<style lang="scss" scoped>
.bg {
min-height: 100vh;
background: #FFFFFF;
}
.banner-content{
width: 100%;
height: 496.4rpx;
.top-banner {
width: 100%;
height: 100%;
}
}
.head-img{
width: 697.24rpx;
height: 42.57rpx;
margin: 0 auto;
display: block;
}
</style>
Loading…
Cancel
Save