Browse Source

启动页

master
shaojing 2 years ago
parent
commit
ad6420f3ad
  1. 2
      app.js
  2. 47
      pages/index/index.js
  3. 19
      pages/index/index.wxml
  4. 46
      pages/index/index.wxss

2
app.js

@ -21,7 +21,7 @@ App({
unique_key: "wechatxcx"
}).then(res => {
let data = JSON.parse(res.data);
data.isTest = data.isTest107? true : false;
data.isTest = data.isTest108? true : false;
this.globalData.configJson = data
}).then(() => {
// 获取ui配置文件

47
pages/index/index.js

@ -34,11 +34,12 @@ Page({
activeBannerIndex: 0,
smBannerIndex: 0,
indexSeason: {},
startList: [], // 启动页广告
// startList: [], // 启动页广告
startList: {head_img:''}, // 启动页广告
alertSwipeList: [], //弹窗广告
showAdv: false, //弹窗开关
showFullAdv: true, //全屏广告开关
time: 5, //全屏广告剩余时间
time: 3, //全屏广告剩余时间
showTime:false,
xpth:{}, // 元旦新增 新品特惠和sqjNew
djs:null, // 元旦新增 新品特惠倒计时
@ -54,9 +55,11 @@ Page({
'https://static.ticket.sz-trip.com/uploads/20240228/c7de980e14c66a39215e7bf5f66ba218.png',
'https://static.ticket.sz-trip.com/uploads/20240228/24010b7a7a88b91c0ea75cf3f073702e.png',
'https://static.ticket.sz-trip.com/uploads/20240228/59e199b98bfb9fbe4fd996503d5f5698.png',
]
],
// viewHeight:"0px",
},
onLoad: function (options) {
// this.getHeight()
//全屏广告
wx.hideTabBar() //这里隐藏了底部导航栏
commonApi._post("adv/getAdv", {
@ -72,20 +75,26 @@ Page({
time: this.data.time - 1
})
if (this.data.time == 0) {
timer = null
clearInterval(timer)
wx.showTabBar() //倒计时结束清除定时器显示导航栏
this.setData({
showFullAdv: false
})
if (this.data.alertSwipeList.length==0) {
wx.showTabBar() //倒计时结束清楚定时器显示导航栏
}
}
}, 1000)
this.setData({
startList: res.data || []
})
let length = res.data.length
if (res.data.length > 1) {
let num = Math.round(Math.random()*length);
console.log('num',num);
this.setData({
startList:res.data[num]
})
console.log(this.data.startList.head_img);
} else {
this.setData({
startList:res.data[0]
})
}
}else{
this.setData({
showFullAdv: false
@ -137,6 +146,18 @@ Page({
this.getVideoPrize()
this.getXpthList()
},
// getHeight() {
// let that = this
// wx.getSystemInfo({
// success(res) {
// console.log(res)
// that.setData({
// viewHeight:res.windowHeight+'px'
// })
// console.log(that.data.viewHeight)
// }
// })
// },
getXpthList:function () {
// 元旦新增 新品特惠
commonApi._post("product/get_product_indulgence", {
@ -863,7 +884,7 @@ Page({
this.pagePoint({
event: 'home_view'
}, 1)
this.data.time!=5?wx.showTabBar():1
// this.data.time!=5?wx.showTabBar():1
},
/**

19
pages/index/index.wxml

@ -632,12 +632,25 @@
</view>
<!-- 广告弹窗结束 -->
<view class="fullavd" wx:if="{{showFullAdv}}">
<view class="time" bindtap="closeFullAdv" wx:if="{{showTime}}">跳过 {{time}}</view>
<swiper class="fullsp" autoplay="{{true}}" interval="{{3000}}" duration="{{300}}" indicator-active-color="white">
<view class="time" bindtap="closeFullAdv" wx:if="{{showTime}}">{{time}}s跳过</view>
<!-- <view class="Qtop" style="height:{{viewHeight}}"> -->
<view class="Qtop" style="min-height:100vh">
<image src="{{startList.head_img}}" mode="widthFix" style="width: 100%;height: 100%;"></image>
</view>
<!-- <swiper class="fullsp" autoplay="{{true}}" interval="{{3000}}" duration="{{300}}" indicator-active-color="white">
<block wx:for="{{startList}}" wx:key="*this">
<swiper-item data-item="{{item}}" bindtap="bannerJumpNew" >
<image src="{{item.head_img}}" style="width: 100%;height: 100%;" mode="widthFix"></image>
</swiper-item>
</block>
</swiper>
</swiper> -->
</view>
<!-- <view class="topBox">
<view class="Qtop" :style="{height:height}">
<image style="width: 100%;height:{{height}}" src="{{startList.head_img}}" mode=""/>
</view>
<view class="jumpBox">
<view class="time">{{time}}s</view>
<view bind:tap="gotoIndex">跳过</view>
</view>
</view> -->

46
pages/index/index.wxss

@ -790,11 +790,11 @@ page {
.time{
width: 150rpx;
height: 60rpx;
background-color: #999999;
color: #fff;
background-color: #fff;
color: #000;
position: absolute;
right: 20rpx;
top: 200rpx;
left: 20rpx;
top: 120rpx;
border-radius:6rpx ;
text-align: center;
line-height: 60rpx;
@ -1034,4 +1034,42 @@ page {
right: -22rpx;
z-index: 2;
/* top: -20rpx; */
}
.Qtop{
width: 100%;
}
.Qtop img{
width: 100%;
}
.miao{
position: fixed;
top: 100rpx;
background: antiquewhite;
margin: 18rpx;
width: 129rpx;
height: 63rpx;
background: rgba(17, 17, 17, 0.1);
text-align: center;
border-radius: 13rpx;
line-height: 63rpx;
}
.topBox {
/* display: flex;
padding-top: 120rpx;
padding-left: 20rpx; */
}
.jumpBox {
color: #000;
background: rgba(255,255,255, 0.911);
display: flex;
align-items: center;
border-radius: 10rpx;
padding: 10rpx 20rpx;
position: fixed;
top: 150rpx;
left: 20rpx;
}
.time{
padding-right: 10rpx;
}
Loading…
Cancel
Save