Browse Source

小程序开屏页

master
chenkainan 2 years ago
parent
commit
11b46caeba
  1. 2
      app.js
  2. 240
      pages/index/index.js
  3. 38
      pages/index/index.wxml
  4. 29
      pages/index/index.wxss
  5. 3
      utils/https.js

2
app.js

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

240
pages/index/index.js

@ -17,7 +17,9 @@ Page({
fourProduct: [], fourProduct: [],
hotIndex: 0, hotIndex: 0,
indexHot: [], indexHot: [],
area_ids: ["zhangjiagang", "changshu", "taicang", "kunshan", "wujiang", "wuzhong", "xiangcheng", "gusu", "gongyeyuanqu", "gaoxin"], area_ids: ["zhangjiagang", "changshu", "taicang", "kunshan", "wujiang", "wuzhong", "xiangcheng", "gusu",
"gongyeyuanqu", "gaoxin"
],
month: "", month: "",
months: ['JAN', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'oct', 'nov', 'dec'], months: ['JAN', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'oct', 'nov', 'dec'],
date: "", date: "",
@ -35,17 +37,19 @@ Page({
smBannerIndex: 0, smBannerIndex: 0,
indexSeason: {}, indexSeason: {},
// startList: [], // 启动页广告 // startList: [], // 启动页广告
startList: {head_img:''}, // 启动页广告 startList: {
head_img: ''
}, // 启动页广告
alertSwipeList: [], //弹窗广告 alertSwipeList: [], //弹窗广告
showAdv: false, //弹窗开关 showAdv: false, //弹窗开关
showFullAdv: true, //全屏广告开关 showFullAdv: true, //全屏广告开关
opacity: 1, opacity: 1,
time: 3, //全屏广告剩余时间 time: 3, //全屏广告剩余时间
showTime:false, showTime: false,
xpth:{}, // 元旦新增 新品特惠和sqjNew xpth: {}, // 元旦新增 新品特惠和sqjNew
djs:null, // 元旦新增 新品特惠倒计时 djs: null, // 元旦新增 新品特惠倒计时
djsTime:null, djsTime: null,
sqjNew:[ sqjNew: [
'https://static.ticket.sz-trip.com/uploads/20240428/faede304469bb3e7b9bbf7001008d09a.png', 'https://static.ticket.sz-trip.com/uploads/20240428/faede304469bb3e7b9bbf7001008d09a.png',
'https://static.ticket.sz-trip.com/uploads/20240428/77c3bd6c3f44ee0e3cc483557c1c7462.png', 'https://static.ticket.sz-trip.com/uploads/20240428/77c3bd6c3f44ee0e3cc483557c1c7462.png',
'https://static.ticket.sz-trip.com/uploads/20240428/ad2324005ba1ed0cabe990ec62bfec76.png', 'https://static.ticket.sz-trip.com/uploads/20240428/ad2324005ba1ed0cabe990ec62bfec76.png',
@ -57,9 +61,11 @@ Page({
'https://static.ticket.sz-trip.com/uploads/20240428/71f7b558c7ca6d42728d48508d01819c.png', 'https://static.ticket.sz-trip.com/uploads/20240428/71f7b558c7ca6d42728d48508d01819c.png',
'https://static.ticket.sz-trip.com/uploads/20240428/23e07551be831036116c2fedbbf7aea5.png', 'https://static.ticket.sz-trip.com/uploads/20240428/23e07551be831036116c2fedbbf7aea5.png',
], ],
viewHeight:"0px", viewHeight: "0px",
isMuted: true,
videoPlay: false,
}, },
onLoad: function (options) { onLoad: function(options) {
this.getHeight() this.getHeight()
//全屏广告 //全屏广告
wx.hideTabBar() //这里隐藏了底部导航栏 wx.hideTabBar() //这里隐藏了底部导航栏
@ -68,8 +74,24 @@ Page({
type_id: 3 type_id: 3
}).then(res => { }).then(res => {
if (res.data.length > 0) { if (res.data.length > 0) {
let length = res.data.length
if (res.data.length > 1) {
let num = Math.floor(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]
})
}
// 图片
if (this.data.startList.media_type) {
this.setData({ this.setData({
showTime:true showTime: true
}) })
var timer = setInterval(() => { var timer = setInterval(() => {
this.setData({ this.setData({
@ -91,20 +113,10 @@ Page({
}) })
} }
}, 1000) }, 1000)
let length = res.data.length
if (res.data.length > 1) {
let num = Math.floor(Math.random()*length);
console.log('num',num);
this.setData({
startList:res.data[num]
})
console.log(this.data.startList.head_img);
} else { } else {
this.setData({ // 视频
startList:res.data[0]
})
} }
}else{ } else {
this.setData({ this.setData({
showFullAdv: false showFullAdv: false
}) })
@ -161,68 +173,72 @@ Page({
success(res) { success(res) {
console.log(res) console.log(res)
that.setData({ that.setData({
viewHeight:res.windowHeight+'px' viewHeight: res.windowHeight + 'px'
}) })
console.log(that.data.viewHeight) console.log(that.data.viewHeight)
} }
}) })
}, },
getXpthList:function () { getXpthList: function() {
// 元旦新增 新品特惠 // 元旦新增 新品特惠
commonApi._post("product/get_product_indulgence", { commonApi._post("product/get_product_indulgence", {
tag_id: 275, tag_id: 275,
typeId:3, typeId: 3,
}).then(res => { }).then(res => {
console.log('data',res.data); console.log('data', res.data);
this.setData({ this.setData({
xpth: res.data, xpth: res.data,
djsTime: res.data.time djsTime: res.data.time
}) })
let time = setInterval(()=>{ let time = setInterval(() => {
this.setData({ this.setData({
djsTime:this.data.djsTime-1 djsTime: this.data.djsTime - 1
}) })
this.formatDate(this.data.djsTime) this.formatDate(this.data.djsTime)
},1000) }, 1000)
if(this.data.djsTime==0) { if (this.data.djsTime == 0) {
clearInterval(time) clearInterval(time)
} }
}) })
}, },
// 元旦新品特惠 倒计时 // 元旦新品特惠 倒计时
formatDate: function (oTime) { formatDate: function(oTime) {
let h = parseInt(oTime/3600) let h = parseInt(oTime / 3600)
let m = parseInt((oTime%3600)/60) let m = parseInt((oTime % 3600) / 60)
let s = parseInt(oTime%60) let s = parseInt(oTime % 60)
h=h<10?"0"+h:h; h = h < 10 ? "0" + h : h;
m=m<10?"0"+m:m; m = m < 10 ? "0" + m : m;
s=s<10?"0"+s:s; s = s < 10 ? "0" + s : s;
this.setData({ this.setData({
djs:{h:h,m:m,s:s} djs: {
h: h,
m: m,
s: s
}
}) })
return return
}, },
goFeiyi: function () { goFeiyi: function() {
app.globalData.weburl = 'https://m.cloud.sz-trip.com/mlgCoupons' app.globalData.weburl = 'https://m.cloud.sz-trip.com/mlgCoupons'
wx.navigateTo({ wx.navigateTo({
url:"/pages/pbService/web/index" url: "/pages/pbService/web/index"
}) })
}, },
onTabItemTap: function (e) { onTabItemTap: function(e) {
console.log(e, 99999999) console.log(e, 99999999)
}, },
changeBannerIndex: function (e) { changeBannerIndex: function(e) {
this.setData({ this.setData({
activeBannerIndex: e.detail.current activeBannerIndex: e.detail.current
}) })
}, },
changeSmBannerIndex: function (e) { changeSmBannerIndex: function(e) {
this.setData({ this.setData({
smBannerIndex: e.detail.current smBannerIndex: e.detail.current
}) })
}, },
// 一城百馆 // 一城百馆
city: function () { city: function() {
wx.navigateToMiniProgram({ wx.navigateToMiniProgram({
appId: 'wx114d514f39cb1fed', appId: 'wx114d514f39cb1fed',
path: "pages/entry/index" path: "pages/entry/index"
@ -235,14 +251,14 @@ Page({
}) })
}, },
changeHotIndex: function (e) { changeHotIndex: function(e) {
this.setData({ this.setData({
hotIndex: e.currentTarget.dataset.index, hotIndex: e.currentTarget.dataset.index,
fourProduct: [] fourProduct: []
}) })
this.getFourProduct() this.getFourProduct()
}, },
getBanner: function () { getBanner: function() {
// commonApi._post("adv/getAdvByKey",{ // commonApi._post("adv/getAdvByKey",{
// key:"xcxBanner" // key:"xcxBanner"
// }).then(res=>{ // }).then(res=>{
@ -285,7 +301,7 @@ Page({
alertSwipeList: res.data || [], alertSwipeList: res.data || [],
showAdv: true showAdv: true
}) })
}else if(!this.data.showFullAdv){ } else if (!this.data.showFullAdv) {
wx.showTabBar({ wx.showTabBar({
animation: true, animation: true,
}) })
@ -294,7 +310,7 @@ Page({
}, },
//获取季节配置 //获取季节配置
getIndexSeason(){ getIndexSeason() {
this.setData({ this.setData({
indexHot: app.globalData.configJson.indexHot, indexHot: app.globalData.configJson.indexHot,
isTest: app.globalData.configJson.isTest, isTest: app.globalData.configJson.isTest,
@ -304,7 +320,7 @@ Page({
this.getFourProduct() this.getFourProduct()
}, },
//关闭弹窗广告 //关闭弹窗广告
closeAdv: function () { closeAdv: function() {
this.setData({ this.setData({
showAdv: false showAdv: false
}) })
@ -313,17 +329,39 @@ Page({
}) })
}, },
//关闭全屏广告 //关闭全屏广告
closeFullAdv:function(){ closeFullAdv: function() {
this.setData({ this.setData({
showFullAdv:false showFullAdv: false
}) })
if (!this.data.alertSwipeList.length>0) { if (!this.data.alertSwipeList.length > 0) {
wx.showTabBar({ wx.showTabBar({
animation: true, animation: true,
}) })
} }
}, },
getWeather: function () { // 是否静音
closeMuted: function() {
this.setData({
isMuted: this.data.isMuted = !this.data.isMuted
})
},
// 播放视频
videoPlay: function() {
let videoplay = wx.createVideoContext('myVideo', this)
videoplay.play();
this.setData({
videoPlay: false
})
},
// 暂停视频
videoPause: function() {
let videoplay = wx.createVideoContext('myVideo', this)
videoplay.pause();
this.setData({
videoPlay: true
})
},
getWeather: function() {
commonApi._post('pbservice/Ztfw/getWeather').then(res => { commonApi._post('pbservice/Ztfw/getWeather').then(res => {
console.log(res) console.log(res)
this.setData({ this.setData({
@ -331,8 +369,8 @@ Page({
}) })
}) })
}, },
saleDetail: function () {}, saleDetail: function() {},
getTwoProduct: function () { getTwoProduct: function() {
// 获取首页限时特惠 // 获取首页限时特惠
commonApi._post('act/fast_sale_now', { commonApi._post('act/fast_sale_now', {
offset: 0, offset: 0,
@ -382,7 +420,7 @@ Page({
} }
}) })
}, },
getFourProduct: function () { getFourProduct: function() {
let item = this.data.indexHot[this.data.hotIndex], let item = this.data.indexHot[this.data.hotIndex],
service = "product/get_product_by_tag", service = "product/get_product_by_tag",
data = { data = {
@ -407,21 +445,22 @@ Page({
}) })
}) })
}, },
tagGotoDetail: function (e) { tagGotoDetail: function(e) {
let item = e.currentTarget.dataset.item; let item = e.currentTarget.dataset.item;
if (this.data.indexHot[this.data.hotIndex].type == 'movie') { if (this.data.indexHot[this.data.hotIndex].type == 'movie') {
wx.navigateTo({ wx.navigateTo({
url: '/pages/list/movieticket/list/info/index?id=' + item.third_id + '&title=' + item.title, url: '/pages/list/movieticket/list/info/index?id=' + item.third_id + '&title=' +
item.title,
}) })
} else { } else {
util.gotoDetail(item) util.gotoDetail(item)
} }
}, },
productGotoDetail: function (e) { productGotoDetail: function(e) {
let item = e.currentTarget.dataset.item; let item = e.currentTarget.dataset.item;
util.gotoDetail(item) util.gotoDetail(item)
}, },
gotoPath: function (e) { gotoPath: function(e) {
console.log(e) console.log(e)
// if (e.currentTarget.dataset.event) { // if (e.currentTarget.dataset.event) {
// if (e.currentTarget.dataset.event=='gongyeyuanqu_click') { // if (e.currentTarget.dataset.event=='gongyeyuanqu_click') {
@ -448,37 +487,37 @@ Page({
path: 'pages/index/index' path: 'pages/index/index'
}) })
return; return;
}else if (e.currentTarget.dataset.event == 'wuzhong_click') { } else if (e.currentTarget.dataset.event == 'wuzhong_click') {
wx.navigateToMiniProgram({ wx.navigateToMiniProgram({
appId: 'wxdd39069b9a91dbfe', appId: 'wxdd39069b9a91dbfe',
path: 'pages/index/index' path: 'pages/index/index'
}) })
return; return;
}else if (e.currentTarget.dataset.event == 'kunshan_click') { } else if (e.currentTarget.dataset.event == 'kunshan_click') {
wx.navigateToMiniProgram({ wx.navigateToMiniProgram({
appId: 'wx8888a3fd0862b4c8', appId: 'wx8888a3fd0862b4c8',
path: 'pages/index/index' path: 'pages/index/index'
}) })
return; return;
}else if (e.currentTarget.dataset.event == 'taicang_click') { } else if (e.currentTarget.dataset.event == 'taicang_click') {
wx.navigateToMiniProgram({ wx.navigateToMiniProgram({
appId: 'wx8853b0d93cbca75e', appId: 'wx8853b0d93cbca75e',
path: 'pages/home/home' path: 'pages/home/home'
}) })
return; return;
}else if (e.currentTarget.dataset.event == 'changshu_click') { } else if (e.currentTarget.dataset.event == 'changshu_click') {
wx.navigateToMiniProgram({ wx.navigateToMiniProgram({
appId: 'wx4df5fd9a6a5ea123', appId: 'wx4df5fd9a6a5ea123',
path: 'pages/index' path: 'pages/index'
}) })
return; return;
}else if (e.currentTarget.dataset.event == 'gongyeyuanqu_click') { } else if (e.currentTarget.dataset.event == 'gongyeyuanqu_click') {
wx.navigateToMiniProgram({ wx.navigateToMiniProgram({
appId: 'wxd323e63a10aa6865', appId: 'wxd323e63a10aa6865',
path: 'pages/home/index' path: 'pages/home/index'
}) })
return; return;
}else if (e.currentTarget.dataset.event == 'wujiang_click') { } else if (e.currentTarget.dataset.event == 'wujiang_click') {
wx.navigateToMiniProgram({ wx.navigateToMiniProgram({
appId: 'wx8eadea4ee2d42d4b', appId: 'wx8eadea4ee2d42d4b',
path: 'pages/index/index' path: 'pages/index/index'
@ -500,14 +539,14 @@ Page({
}, },
// 元旦 新品特惠部分 // 元旦 新品特惠部分
goBanner: function(e) { goBanner: function(e) {
console.log('新品特惠',e.currentTarget.dataset.url); console.log('新品特惠', e.currentTarget.dataset.url);
let url = e.currentTarget.dataset.url; let url = e.currentTarget.dataset.url;
app.globalData.weburl = url; app.globalData.weburl = url;
wx.navigateTo({ wx.navigateTo({
url: "/pages/pbService/web/index?weburl=" + encodeURIComponent(url) url: "/pages/pbService/web/index?weburl=" + encodeURIComponent(url)
}) })
}, },
gotoUrl: function (e) { gotoUrl: function(e) {
console.log(e) console.log(e)
if (e.currentTarget.dataset.event) { if (e.currentTarget.dataset.event) {
this.pagePoint({ this.pagePoint({
@ -518,10 +557,10 @@ Page({
app.globalData.weburl = url; app.globalData.weburl = url;
wx.navigateTo({ wx.navigateTo({
// url: '/pages/pbService/web/index?weburl='+encodeURIComponent('https://m.cloud.sz-trip.com/Cloudperform2022'), // url: '/pages/pbService/web/index?weburl='+encodeURIComponent('https://m.cloud.sz-trip.com/Cloudperform2022'),
url: '/pages/pbService/web/index?weburl='+encodeURIComponent(url), url: '/pages/pbService/web/index?weburl=' + encodeURIComponent(url),
}) })
}, },
gotoMini: function (e) { gotoMini: function(e) {
let appid = e.currentTarget.dataset.appid, let appid = e.currentTarget.dataset.appid,
path = e.currentTarget.dataset.path path = e.currentTarget.dataset.path
wx.navigateToMiniProgram({ wx.navigateToMiniProgram({
@ -529,13 +568,13 @@ Page({
path: path path: path
}) })
}, },
garbage: function () { garbage: function() {
wx.navigateToMiniProgram({ wx.navigateToMiniProgram({
appId: 'wx13be821f3b1afed3', appId: 'wx13be821f3b1afed3',
path: 'pages/home/home' path: 'pages/home/home'
}) })
}, },
gotoSku: function () { gotoSku: function() {
commonApi.user_post("pbservice/Ztfw/sukangCode").then(res => { commonApi.user_post("pbservice/Ztfw/sukangCode").then(res => {
console.log(res) console.log(res)
app.globalData.weburl = res.data.url; app.globalData.weburl = res.data.url;
@ -545,7 +584,7 @@ Page({
return; return;
}) })
}, },
audioGuide: function () { audioGuide: function() {
wx.navigateToMiniProgram({ wx.navigateToMiniProgram({
appId: 'wx74f380bc721a0379', appId: 'wx74f380bc721a0379',
path: '/pages/listen/listen?title=君到苏州' path: '/pages/listen/listen?title=君到苏州'
@ -559,7 +598,7 @@ Page({
}) })
}, },
// 热门推荐 去掉经纬度 接口排序方式变更(韩阳) // 热门推荐 去掉经纬度 接口排序方式变更(韩阳)
getList: function () { getList: function() {
if (!this.data.listMore) return; if (!this.data.listMore) return;
commonApi._post("search/recommend", { commonApi._post("search/recommend", {
offset: this.data.list.length, offset: this.data.list.length,
@ -582,12 +621,12 @@ Page({
}) })
}) })
}, },
onReachBottom: function () { onReachBottom: function() {
if (this.data.list.length<30) { if (this.data.list.length < 30) {
this.getList() this.getList()
} }
}, },
gotoDetail: function (e) { gotoDetail: function(e) {
let item = e.currentTarget.dataset.item; let item = e.currentTarget.dataset.item;
util.pagePoint({ util.pagePoint({
event: 'recommend_click', event: 'recommend_click',
@ -605,14 +644,14 @@ Page({
util.gotoDetail(item.ext); util.gotoDetail(item.ext);
} }
}, },
meituan: function () { meituan: function() {
wx.navigateToMiniProgram({ wx.navigateToMiniProgram({
appId: 'wxde8ac0a21135c07d', appId: 'wxde8ac0a21135c07d',
path: "hotel/pages/h5/index?q=https%3A%2F%2Ffenxiao.meituan.com%2Fopdtor%2Fh5%2Fhotel%2Fsearch%3FpartnerId%3D16829" path: "hotel/pages/h5/index?q=https%3A%2F%2Ffenxiao.meituan.com%2Fopdtor%2Fh5%2Fhotel%2Fsearch%3FpartnerId%3D16829"
}) })
}, },
// 轮播图点击 // 轮播图点击
bannerClick: function (e) { bannerClick: function(e) {
if (this.data.isTest) return; if (this.data.isTest) return;
let item = e.currentTarget.dataset.item; let item = e.currentTarget.dataset.item;
this.pagePoint({ this.pagePoint({
@ -633,12 +672,14 @@ Page({
} }
break; break;
case 3: case 3:
if ((item.tdata.url.indexOf('http://') != -1 || item.tdata.url.indexOf('https://') != -1) && item.tdata.url.indexOf('m.cloud.sz-trip.com') == -1) { if ((item.tdata.url.indexOf('http://') != -1 || item.tdata.url.indexOf('https://') != -1) &&
item.tdata.url.indexOf('m.cloud.sz-trip.com') == -1) {
// 外部h5 // 外部h5
console.log(111,item.tdata) console.log(111, item.tdata)
app.globalData.weburl = item.tdata.url; app.globalData.weburl = item.tdata.url;
wx.navigateTo({ wx.navigateTo({
url: "/pages/pbService/web/index?weburl=" + encodeURIComponent(item.tdata.url) url: "/pages/pbService/web/index?weburl=" + encodeURIComponent(item.tdata
.url)
}) })
} else { } else {
let page = item.tdata.url.split("/"); let page = item.tdata.url.split("/");
@ -646,10 +687,13 @@ Page({
console.log(page[0]) console.log(page[0])
let url = this.data.urltopage[page[0]]; let url = this.data.urltopage[page[0]];
if (url && url.indexOf('map') != -1) { if (url && url.indexOf('map') != -1) {
let types = ['', 'scenic', 'venue', 'post', 'restaurant', 'relic', 'tenscenic', 'cinema', 'academes'], let types = ['', 'scenic', 'venue', 'post', 'restaurant', 'relic', 'tenscenic',
'cinema', 'academes'
],
type = page[1] ? page[1].split("=") : []; type = page[1] ? page[1].split("=") : [];
wx.reLaunch({ wx.reLaunch({
url: url + "?type=" + (type[1] ? types.findIndex(t => t == type[1]) : null) url: url + "?type=" + (type[1] ? types.findIndex(t => t == type[1]) :
null)
}) })
} else if (url) { } else if (url) {
wx.navigateTo({ wx.navigateTo({
@ -657,9 +701,10 @@ Page({
}) })
} else { } else {
app.globalData.weburl = item.tdata.url; app.globalData.weburl = item.tdata.url;
console.log(2222,item.tdata.url,app.globalData.weburl) console.log(2222, item.tdata.url, app.globalData.weburl)
wx.navigateTo({ wx.navigateTo({
url: "/pages/pbService/web/index?weburl=" + encodeURIComponent(item.tdata.url) url: "/pages/pbService/web/index?weburl=" + encodeURIComponent(item
.tdata.url)
}) })
} }
} }
@ -698,16 +743,16 @@ Page({
}, },
//博物馆跳转 直接跳君到苏州H5 //博物馆跳转 直接跳君到苏州H5
goH5:function(e){ goH5: function(e) {
console.log(e.currentTarget.dataset.path); console.log(e.currentTarget.dataset.path);
let weburl = 'https://m.cloud.sz-trip.com/' + e.currentTarget.dataset.path; let weburl = 'https://m.cloud.sz-trip.com/' + e.currentTarget.dataset.path;
// app.globalData.weburl ='https://m.cloud.sz-trip.com/' + e.currentTarget.dataset.path; // app.globalData.weburl ='https://m.cloud.sz-trip.com/' + e.currentTarget.dataset.path;
wx.navigateTo({ wx.navigateTo({
// url: "/pages/pbService/web/index" // url: "/pages/pbService/web/index"
url: '/pages/pbService/web/index?weburl='+encodeURIComponent(weburl), url: '/pages/pbService/web/index?weburl=' + encodeURIComponent(weburl),
}) })
}, },
bannerClick2: function (e) { bannerClick2: function(e) {
let item = e.currentTarget.dataset.item; let item = e.currentTarget.dataset.item;
if (item.action == 'href') { if (item.action == 'href') {
if (item.href.indexOf(",") != -1) { if (item.href.indexOf(",") != -1) {
@ -800,7 +845,8 @@ Page({
} }
break; break;
case 3: case 3:
if ((item.tdata.url.indexOf('http://') != -1 || item.tdata.url.indexOf('https://') != -1) && item.tdata.url.indexOf('m.cloud.sz-trip.com') == -1) { if ((item.tdata.url.indexOf('http://') != -1 || item.tdata.url.indexOf('https://') != -1) &&
item.tdata.url.indexOf('m.cloud.sz-trip.com') == -1) {
// 外部h5 // 外部h5
console.log(item.tdata) console.log(item.tdata)
app.globalData.weburl = item.tdata.url; app.globalData.weburl = item.tdata.url;
@ -813,7 +859,9 @@ Page({
console.log(page[0]) console.log(page[0])
let url = this.data.urltopage[page[0]]; let url = this.data.urltopage[page[0]];
if (url && url.indexOf('map') != -1) { if (url && url.indexOf('map') != -1) {
let types = ['', 'scenic', 'venue', 'post', 'restaurant', 'relic', 'tenscenic', 'cinema', 'academes'], let types = ['', 'scenic', 'venue', 'post', 'restaurant', 'relic', 'tenscenic',
'cinema', 'academes'
],
type = page[1] ? page[1].split("=") : []; type = page[1] ? page[1].split("=") : [];
wx.reLaunch({ wx.reLaunch({
url: url + "?type=" + (type[1] ? types.findIndex(t => t == type[1]) : null) url: url + "?type=" + (type[1] ? types.findIndex(t => t == type[1]) : null)
@ -862,11 +910,11 @@ Page({
} }
return return
}, },
onReady: function () { onReady: function() {
}, },
gotoOther: function (e) { gotoOther: function(e) {
let item = e.currentTarget.dataset.item; let item = e.currentTarget.dataset.item;
if (item.type == 'h5') { if (item.type == 'h5') {
app.globalData.weburl = item.url app.globalData.weburl = item.url
@ -884,10 +932,10 @@ Page({
}) })
} }
}, },
pagePoint: function (e, type) { pagePoint: function(e, type) {
util.pagePoint(e, type) util.pagePoint(e, type)
}, },
onShow: function () { onShow: function() {
if (app.globalData.loadIndexSeason) { if (app.globalData.loadIndexSeason) {
this.getIndexSeason() this.getIndexSeason()
} else { } else {
@ -909,7 +957,7 @@ Page({
/** /**
* 用户点击右上角分享 * 用户点击右上角分享
*/ */
onShareAppMessage: function () { onShareAppMessage: function() {
}, },
onShareTimeline: function() { onShareTimeline: function() {

38
pages/index/index.wxml

@ -655,19 +655,35 @@
<image bindtap="closeAdv" style="width: 100rpx; height: 100rpx;transform: translate(200rpx,6rpx);" src="https://static.ticket.sz-trip.com/uploads/20220810/f4bb1a4f0b5eb394e6ca6e4f03aaa1e0.png"></image> <image bindtap="closeAdv" style="width: 100rpx; height: 100rpx;transform: translate(200rpx,6rpx);" src="https://static.ticket.sz-trip.com/uploads/20220810/f4bb1a4f0b5eb394e6ca6e4f03aaa1e0.png"></image>
</view> </view>
<!-- 广告弹窗结束 --> <!-- 广告弹窗结束 -->
<view class="fullavd" wx:if="{{showFullAdv}}" style="opacity: {{opacity}}"> <view class="fullavd" wx:if="{{showFullAdv && startList.head_img}}" style="opacity: {{opacity}}">
<view class="time" bindtap="closeFullAdv" wx:if="{{showTime}}">{{time}}s跳过</view> <view class="time" bindtap="closeFullAdv" wx:if="{{showTime && startList.media_type}}">{{time}}s跳过</view>
<!-- <view class="Qtop" style="height:{{viewHeight}}"> --> <view class="Qtop" style="min-height:100vh" wx:if="{{showTime && startList.media_type}}">
<view class="Qtop" style="min-height:100vh">
<image src="{{startList.head_img}}" mode="widthFix" style="width: 100%;height: 100%;"></image> <image src="{{startList.head_img}}" mode="widthFix" style="width: 100%;height: 100%;"></image>
</view> </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" > <view style="width:100vw;height: 100vh;position: relative;" wx:if="{{!startList.media_type}}">
<image src="{{item.head_img}}" style="width: 100%;height: 100%;" mode="widthFix"></image> <video
</swiper-item> style="width:100vw;height:100vh;display:block;"
</block> id="myVideo"
</swiper> --> src="{{startList.head_img}}"
show-center-play-btn="{{false}}"
show-play-btn="{{true}}"
autoplay
controls="{{false}}"
bindended="videoend"
loop="{{true}}"
muted="{{isMuted}}"
object-fit="fill"
></video>
<!-- <image src="https://static.ticket.sz-trip.com/jundaosuzhou/images/startPage/mute.png" class="muteImg" mode="widthFix" wx:if="{{isMuted}}" bindtap="closeMuted"></image> -->
<!-- <image src="https://static.ticket.sz-trip.com/jundaosuzhou/images/startPage/sound.png" class="muteImg" mode="widthFix" wx:else bindtap="closeMuted"></image> -->
<image src="https://static.ticket.sz-trip.com/jundaosuzhou/images/startPage/logo.png" class="logoImg" mode="widthFix"></image>
<image src="https://static.ticket.sz-trip.com/jundaosuzhou/images/startPage/btn.png" class="btnImg" mode="widthFix" bindtap="closeFullAdv"></image>
<image src="https://static.ticket.sz-trip.com/jundaosuzhou/images/startPage/play.png" class="playImg" mode="widthFix" wx:if="{{videoPlay}}" bindtap="videoPlay"></image>
<image src="https://static.ticket.sz-trip.com/jundaosuzhou/images/startPage/pause.png" class="playImg" mode="widthFix" wx:else bindtap="videoPause"></image>
</view>
</view> </view>
<!-- <view class="topBox"> <!-- <view class="topBox">
<view class="Qtop" :style="{height:height}"> <view class="Qtop" :style="{height:height}">

29
pages/index/index.wxss

@ -1145,3 +1145,32 @@ page {
.time{ .time{
padding-right: 10rpx; padding-right: 10rpx;
} }
.muteImg {
width: 62rpx;
height: 62rpx;
position: absolute;
top: 194rpx;
right: 38rpx;
}
.logoImg {
width: 464.67rpx;
height: 342.67rpx;
position: absolute;
top: 406rpx;
left: 142rpx;
}
.btnImg {
width: 296.67rpx;
height: 79.33rpx;
position: absolute;
left: 226rpx;
bottom: 208rpx;
}
.playImg {
position: absolute;
width: 31.33rpx;
height: 38rpx;
left: 56.67rpx;
bottom: 64rpx;
}

3
utils/https.js

@ -7,7 +7,8 @@ const env = wx.getAccountInfoSync().miniProgram.envVersion
if (env == 'develop1') { if (env == 'develop1') {
baseUrl = "https://test.api.cloud.sz-trip.com/api/" baseUrl = "https://test.api.cloud.sz-trip.com/api/"
} else { } else {
baseUrl = "https://api.cloud.sz-trip.com/api/"; // baseUrl = "https://api.cloud.sz-trip.com/api/";
// baseUrl = "https://test.api.cloud.sz-trip.com/api/"
} }
const orders = ['', 'weight', 'distance', 'sale_number', 'sale_price', 'price']; const orders = ['', 'weight', 'distance', 'sale_number', 'sale_price', 'price'];
//封装GET请求 //封装GET请求

Loading…
Cancel
Save