|
|
@ -10,12 +10,129 @@ import https from "../../utils/https.js" |
|
|
|
|
|
|
|
|
Page({ |
|
|
Page({ |
|
|
data: { |
|
|
data: { |
|
|
bannerInterver: 1000*60, |
|
|
|
|
|
|
|
|
// bannerInterver: 5*1000, // 动态更改banner时间
|
|
|
banner: [], |
|
|
banner: [], |
|
|
xiaobanner: [], |
|
|
xiaobanner: [], |
|
|
height: 0, |
|
|
activeBannerIndex: 0, |
|
|
padHeight: 0, |
|
|
smBannerIndex: 0, |
|
|
right: 0, |
|
|
systemStyle: { |
|
|
|
|
|
height: 0, |
|
|
|
|
|
padHeight: 0, |
|
|
|
|
|
right: 0, |
|
|
|
|
|
}, |
|
|
|
|
|
// banner上的金刚区
|
|
|
|
|
|
bannerDataList: [ |
|
|
|
|
|
{ |
|
|
|
|
|
title: "景点门票", |
|
|
|
|
|
img: "https://static.ticket.sz-trip.com/uploads/20250312/db946eebb863adc0bb020338c9edc271.png", |
|
|
|
|
|
path: "/pages/list/scene/index", |
|
|
|
|
|
}, |
|
|
|
|
|
{ |
|
|
|
|
|
title: "活动日历", |
|
|
|
|
|
img: "https://static.ticket.sz-trip.com/uploads/20250312/2453c4f3e932172905ed883190ef1356.png", |
|
|
|
|
|
path: "/pages/list/activitynew/index", |
|
|
|
|
|
}, |
|
|
|
|
|
{ |
|
|
|
|
|
title: "将意真品", |
|
|
|
|
|
img: "https://static.ticket.sz-trip.com/uploads/20250312/8e675fc57ea4b9e45f2fa7736bc03e7d.png", |
|
|
|
|
|
path: "/subPackages/techanNew/index", |
|
|
|
|
|
}, |
|
|
|
|
|
{ |
|
|
|
|
|
title: "领券中心", |
|
|
|
|
|
img: "https://static.ticket.sz-trip.com/uploads/20250312/db946eebb863adc0bb020338c9edc271.png", |
|
|
|
|
|
path: "/pages/list/scene/index", |
|
|
|
|
|
}, |
|
|
|
|
|
], |
|
|
|
|
|
// 金刚区
|
|
|
|
|
|
mainTypeList: [ |
|
|
|
|
|
{ |
|
|
|
|
|
title: "非遗专卖", |
|
|
|
|
|
img: "https://static.ticket.sz-trip.com/uploads/20250312/db946eebb863adc0bb020338c9edc271.png", |
|
|
|
|
|
path: "/subPackages/feiyiNew/index", |
|
|
|
|
|
}, |
|
|
|
|
|
{ |
|
|
|
|
|
title: "场馆预约", |
|
|
|
|
|
img: "https://static.ticket.sz-trip.com/uploads/20250312/db946eebb863adc0bb020338c9edc271.png", |
|
|
|
|
|
path: "/pages/list/museum/index", |
|
|
|
|
|
}, |
|
|
|
|
|
{ |
|
|
|
|
|
title: "一日游", |
|
|
|
|
|
img: "https://static.ticket.sz-trip.com/uploads/20250312/db946eebb863adc0bb020338c9edc271.png", |
|
|
|
|
|
weburl:"https://m.cloud.sz-trip.com/OneDayTravelNew", |
|
|
|
|
|
}, |
|
|
|
|
|
{ |
|
|
|
|
|
title: "户外游", |
|
|
|
|
|
img: "https://static.ticket.sz-trip.com/uploads/20250312/db946eebb863adc0bb020338c9edc271.png", |
|
|
|
|
|
weburl:"https://m.cloud.sz-trip.com/LearningTravel", |
|
|
|
|
|
}, |
|
|
|
|
|
{ |
|
|
|
|
|
title: "电影购票", |
|
|
|
|
|
img: "https://static.ticket.sz-trip.com/uploads/20250312/db946eebb863adc0bb020338c9edc271.png", |
|
|
|
|
|
weburl:"https://m.cloud.sz-trip.com/movies", |
|
|
|
|
|
}, |
|
|
|
|
|
{ |
|
|
|
|
|
type: 'hotel', // 特殊标识方便查找 更新weburl
|
|
|
|
|
|
title: "酒店住宿", |
|
|
|
|
|
img: "https://static.ticket.sz-trip.com/uploads/20250312/db946eebb863adc0bb020338c9edc271.png", |
|
|
|
|
|
weburl: '', |
|
|
|
|
|
path: '/pages/list/hotel/index' |
|
|
|
|
|
}, |
|
|
|
|
|
{ |
|
|
|
|
|
title: "水上游", |
|
|
|
|
|
img: "https://static.ticket.sz-trip.com/uploads/20250312/db946eebb863adc0bb020338c9edc271.png", |
|
|
|
|
|
path: '/pages/list/night/index' |
|
|
|
|
|
}, |
|
|
|
|
|
{ |
|
|
|
|
|
title: "剧场演出", |
|
|
|
|
|
img: "https://static.ticket.sz-trip.com/uploads/20250312/db946eebb863adc0bb020338c9edc271.png", |
|
|
|
|
|
path: '/pages/list/theatre/index' |
|
|
|
|
|
}, |
|
|
|
|
|
], |
|
|
|
|
|
|
|
|
|
|
|
xpth: {}, // 新品特惠
|
|
|
|
|
|
XPathBannerIndex: 0, |
|
|
|
|
|
// 公共服务
|
|
|
|
|
|
publicSerivce: [ |
|
|
|
|
|
{ |
|
|
|
|
|
title: "高峰预警", |
|
|
|
|
|
img: "https://static.ticket.sz-trip.com/uploads/20250312/65f1dda9a4dc43d426544a0d14eb73de.png", |
|
|
|
|
|
weburl: "https://wlsjzx.zdhxwl.cn/kt_h5/index.html#/morecopy", |
|
|
|
|
|
eventName: "comfort_click", |
|
|
|
|
|
}, |
|
|
|
|
|
{ |
|
|
|
|
|
title: "实时路况", |
|
|
|
|
|
img: "https://static.ticket.sz-trip.com/uploads/20250312/65f1dda9a4dc43d426544a0d14eb73de.png", |
|
|
|
|
|
weburl: "https://jiaotonghao2.amap.com/?channel=amap&unitId=257&src=app_share#/", |
|
|
|
|
|
eventName: "sslk", |
|
|
|
|
|
}, |
|
|
|
|
|
{ |
|
|
|
|
|
title: "行李直送", |
|
|
|
|
|
img: "https://static.ticket.sz-trip.com/uploads/20250312/65f1dda9a4dc43d426544a0d14eb73de.png", |
|
|
|
|
|
appId: 'wx757dd1ee184e75e9', |
|
|
|
|
|
pagePath: "pages/tabBar/index/index" |
|
|
|
|
|
}, |
|
|
|
|
|
{ |
|
|
|
|
|
title: "行李寄存", |
|
|
|
|
|
img: "https://static.ticket.sz-trip.com/uploads/20250312/65f1dda9a4dc43d426544a0d14eb73de.png", |
|
|
|
|
|
weburl: "https://weixin.2500sz.net/zt/2023/07/luggage_storage/", |
|
|
|
|
|
eventName: "xljc", |
|
|
|
|
|
}, |
|
|
|
|
|
{ |
|
|
|
|
|
title: "找厕所", |
|
|
|
|
|
img: "https://static.ticket.sz-trip.com/uploads/20250312/65f1dda9a4dc43d426544a0d14eb73de.png", |
|
|
|
|
|
path: "/pages/pbService/bike/index?type=1", |
|
|
|
|
|
}, |
|
|
|
|
|
{ |
|
|
|
|
|
title: "找厕所", |
|
|
|
|
|
img: "https://static.ticket.sz-trip.com/uploads/20250312/65f1dda9a4dc43d426544a0d14eb73de.png", |
|
|
|
|
|
weburl: "", |
|
|
|
|
|
}, |
|
|
|
|
|
|
|
|
|
|
|
], |
|
|
|
|
|
|
|
|
|
|
|
fullAdvTimer: null, // 全屏timer
|
|
|
|
|
|
|
|
|
weather: null, |
|
|
weather: null, |
|
|
saleProduct: null, |
|
|
saleProduct: null, |
|
|
roadProduct: null, |
|
|
roadProduct: null, |
|
|
@ -36,9 +153,8 @@ Page({ |
|
|
videoPrize: false, |
|
|
videoPrize: false, |
|
|
prizeInfo: null, |
|
|
prizeInfo: null, |
|
|
otherPlat: null, |
|
|
otherPlat: null, |
|
|
activeBannerIndex: 0, |
|
|
|
|
|
smBannerIndex: 0, |
|
|
|
|
|
XPathBannerIndex: 0, |
|
|
|
|
|
indexSeason: {}, |
|
|
indexSeason: {}, |
|
|
// startList: [], // 启动页广告
|
|
|
// startList: [], // 启动页广告
|
|
|
startList: { |
|
|
startList: { |
|
|
@ -50,9 +166,9 @@ Page({ |
|
|
opacity: 1, |
|
|
opacity: 1, |
|
|
time: 3, //全屏广告剩余时间
|
|
|
time: 3, //全屏广告剩余时间
|
|
|
showTime: false, |
|
|
showTime: false, |
|
|
xpth: {}, // 元旦新增 新品特惠和sqjNew
|
|
|
|
|
|
djs: null, // 元旦新增 新品特惠倒计时
|
|
|
|
|
|
djsTime: null, |
|
|
|
|
|
area_ids: ["changshu","taicang", "kunshan","wujiang","gongyeyuanqu","zhangjiagang","wuzhong","xiangcheng","gusu","gaoxin"], |
|
|
area_ids: ["changshu","taicang", "kunshan","wujiang","gongyeyuanqu","zhangjiagang","wuzhong","xiangcheng","gusu","gaoxin"], |
|
|
sqjNew: [ |
|
|
sqjNew: [ |
|
|
'https://static.ticket.sz-trip.com/uploads/20241012/df831b80bc445aef8dc439ef8f9761a2.png',// 常熟
|
|
|
'https://static.ticket.sz-trip.com/uploads/20241012/df831b80bc445aef8dc439ef8f9761a2.png',// 常熟
|
|
|
@ -66,24 +182,16 @@ Page({ |
|
|
'https://static.ticket.sz-trip.com/uploads/20241012/db5fcb0df2d8d326bd2b8d055b9284d2.png',// 姑苏
|
|
|
'https://static.ticket.sz-trip.com/uploads/20241012/db5fcb0df2d8d326bd2b8d055b9284d2.png',// 姑苏
|
|
|
'https://static.ticket.sz-trip.com/uploads/20241012/279e21d3e876379140bf77d01410b07d.png',// 高新区
|
|
|
'https://static.ticket.sz-trip.com/uploads/20241012/279e21d3e876379140bf77d01410b07d.png',// 高新区
|
|
|
], |
|
|
], |
|
|
viewHeight: "0px", |
|
|
|
|
|
isMuted: true, |
|
|
isMuted: true, |
|
|
videoPlay: false, |
|
|
videoPlay: false, |
|
|
|
|
|
|
|
|
// 页面图片
|
|
|
// 页面图片
|
|
|
imageSourceList:imageSource, |
|
|
imageSourceList:imageSource, |
|
|
|
|
|
|
|
|
// 酒店住宿配置链接 /pages/pbService/web/index?weburl=https://m.cloud.sz-trip.com/carPurchase
|
|
|
|
|
|
hotelUrl: '' |
|
|
|
|
|
}, |
|
|
}, |
|
|
onLoad: function(options) { |
|
|
onLoad: function(options) { |
|
|
console.log('onload') |
|
|
if(options && options.szxcCode) { |
|
|
|
|
|
|
|
|
wx.getLocation({type: 'gcj02'}) |
|
|
|
|
|
|
|
|
|
|
|
console.log('options',options) |
|
|
|
|
|
// 相城小程序跳转获取用户信息
|
|
|
|
|
|
if(options && options.szxcCode) { |
|
|
|
|
|
commonApi._post("uservice/user/loginByXC", { |
|
|
commonApi._post("uservice/user/loginByXC", { |
|
|
code: options.szxcCode |
|
|
code: options.szxcCode |
|
|
}).then(res => { |
|
|
}).then(res => { |
|
|
@ -91,67 +199,20 @@ Page({ |
|
|
https.set_logininfo(res); |
|
|
https.set_logininfo(res); |
|
|
} |
|
|
} |
|
|
}) |
|
|
}) |
|
|
} |
|
|
} |
|
|
this.getHeight() |
|
|
if (options.from) { |
|
|
//全屏广告
|
|
|
|
|
|
wx.hideTabBar() //这里隐藏了底部导航栏
|
|
|
|
|
|
commonApi._post("adv/getAdv", { |
|
|
|
|
|
position: 2, |
|
|
|
|
|
type_id: 3 |
|
|
|
|
|
}).then(res => { |
|
|
|
|
|
if (res.data.length > 0) { |
|
|
|
|
|
let length = res.data.length |
|
|
|
|
|
if (res.data.length > 1) { |
|
|
|
|
|
let num = Math.floor(Math.random() * length); |
|
|
|
|
|
this.setData({ |
|
|
|
|
|
startList: res.data[num] |
|
|
|
|
|
}) |
|
|
|
|
|
} else { |
|
|
|
|
|
this.setData({ |
|
|
|
|
|
startList: res.data[0] |
|
|
|
|
|
}) |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
// 图片
|
|
|
|
|
|
if (this.data.startList.media_type) { |
|
|
|
|
|
this.setData({ |
|
|
|
|
|
showTime: true |
|
|
|
|
|
}) |
|
|
|
|
|
var timer = setInterval(() => { |
|
|
|
|
|
this.setData({ |
|
|
|
|
|
time: this.data.time - 1 |
|
|
|
|
|
}) |
|
|
|
|
|
if (this.data.time === 0) { |
|
|
|
|
|
var opacityTimer = setInterval(() => { |
|
|
|
|
|
this.setData({ |
|
|
|
|
|
opacity: this.data.opacity - 0.3 |
|
|
|
|
|
}) |
|
|
|
|
|
}, 100) |
|
|
|
|
|
} |
|
|
|
|
|
if (this.data.time == -1) { |
|
|
|
|
|
clearInterval(timer) |
|
|
|
|
|
clearInterval(opacityTimer) |
|
|
|
|
|
wx.showTabBar() //倒计时结束清除定时器显示导航栏
|
|
|
|
|
|
this.setData({ |
|
|
|
|
|
showFullAdv: false |
|
|
|
|
|
}) |
|
|
|
|
|
} |
|
|
|
|
|
}, 1000) |
|
|
|
|
|
} else { |
|
|
|
|
|
// 视频
|
|
|
|
|
|
} |
|
|
|
|
|
} else { |
|
|
|
|
|
this.setData({ |
|
|
|
|
|
showFullAdv: false |
|
|
|
|
|
}) |
|
|
|
|
|
} |
|
|
|
|
|
}) |
|
|
|
|
|
if (options.from) { |
|
|
|
|
|
app.globalData.from = options.from; |
|
|
app.globalData.from = options.from; |
|
|
} |
|
|
} |
|
|
let systemInfo = wx.getSystemInfoSync(), |
|
|
return |
|
|
rect = wx.getMenuButtonBoundingClientRect(); |
|
|
|
|
|
let height = (rect.top - systemInfo.statusBarHeight) * 2 + rect.height; |
|
|
wx.getLocation({type: 'gcj02'}) |
|
|
|
|
|
|
|
|
|
|
|
console.log('options',options) |
|
|
|
|
|
// 相城小程序跳转获取用户信息
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
wx.getLocation({ |
|
|
wx.getLocation({ |
|
|
type: 'gcj02', |
|
|
type: 'gcj02', |
|
|
success: (res) => { |
|
|
success: (res) => { |
|
|
@ -165,11 +226,7 @@ Page({ |
|
|
this.getList() |
|
|
this.getList() |
|
|
} |
|
|
} |
|
|
}) |
|
|
}) |
|
|
this.setData({ |
|
|
|
|
|
height: height, |
|
|
|
|
|
padHeight: systemInfo.statusBarHeight, |
|
|
|
|
|
right: (systemInfo.screenWidth - rect.right) + rect.width |
|
|
|
|
|
}) |
|
|
|
|
|
|
|
|
|
|
|
commonApi._post("pbservice/Other/getClientConfig", { |
|
|
commonApi._post("pbservice/Other/getClientConfig", { |
|
|
unique_key: "urltopage" |
|
|
unique_key: "urltopage" |
|
|
@ -180,7 +237,7 @@ Page({ |
|
|
}) |
|
|
}) |
|
|
}) |
|
|
}) |
|
|
this.getTwoProduct() |
|
|
this.getTwoProduct() |
|
|
this.getBanner() |
|
|
|
|
|
this.getWeather() |
|
|
this.getWeather() |
|
|
// 获取今天的日期
|
|
|
// 获取今天的日期
|
|
|
let today = new Date(); |
|
|
let today = new Date(); |
|
|
@ -188,92 +245,288 @@ Page({ |
|
|
month: (this.data.months[today.getMonth()]).toUpperCase(), |
|
|
month: (this.data.months[today.getMonth()]).toUpperCase(), |
|
|
date: today.getDate() |
|
|
date: today.getDate() |
|
|
}) |
|
|
}) |
|
|
// 调用接口如果token过期会导致一进入就要登陆
|
|
|
|
|
|
// this.getVideoPrize()
|
|
|
}, |
|
|
this.getXpthList() |
|
|
|
|
|
|
|
|
onReady: function() { |
|
|
|
|
|
this.getHeight() |
|
|
|
|
|
this.getBanner() |
|
|
|
|
|
// 活动日历
|
|
|
|
|
|
// this.getFourProduct()
|
|
|
|
|
|
|
|
|
|
|
|
this.getXpthList() // 限时特惠
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}, |
|
|
}, |
|
|
|
|
|
// 获取系统信息
|
|
|
getHeight() { |
|
|
getHeight() { |
|
|
let that = this |
|
|
let systemInfo = wx.getSystemInfoSync(), |
|
|
wx.getSystemInfo({ |
|
|
rect = wx.getMenuButtonBoundingClientRect(); |
|
|
success(res) { |
|
|
let height = (rect.top - systemInfo.statusBarHeight) * 2 + rect.height; |
|
|
that.setData({ |
|
|
let systemStyle = { |
|
|
viewHeight: res.windowHeight + 'px' |
|
|
height: height, // 导航栏
|
|
|
|
|
|
padHeight: systemInfo.statusBarHeight, // 状态栏
|
|
|
|
|
|
right: (systemInfo.screenWidth - rect.right) + rect.width // 右侧胶囊
|
|
|
|
|
|
} |
|
|
|
|
|
this.setData({ |
|
|
|
|
|
systemStyle: systemStyle, |
|
|
|
|
|
}) |
|
|
|
|
|
}, |
|
|
|
|
|
//获取季节配置
|
|
|
|
|
|
getIndexSeason() { |
|
|
|
|
|
let mainTypeList = this.data.mainTypeList |
|
|
|
|
|
let hotelData = mainTypeList.find(v=>v.type == hotel) |
|
|
|
|
|
|
|
|
|
|
|
if (app.globalData.configJson.indexSeason) { |
|
|
|
|
|
hotelData.weburl = app.globalData.configJson.hotelUrl |
|
|
|
|
|
this.setData({ |
|
|
|
|
|
indexHot: app.globalData.configJson.indexHot, |
|
|
|
|
|
isTest: app.globalData.configJson.isTest, |
|
|
|
|
|
otherPlat: app.globalData.configJson.otherPlats, |
|
|
|
|
|
// 正式数据
|
|
|
|
|
|
indexSeason: app.globalData.configJson.indexSeason, |
|
|
|
|
|
// 开发数据
|
|
|
|
|
|
// indexSeason: imageSource.testImgs.indexSeason,
|
|
|
|
|
|
mainTypeList: mainTypeList |
|
|
|
|
|
}) |
|
|
|
|
|
} else { |
|
|
|
|
|
commonApi._post("adv/get_home_ui", {type_id: 3}).then(res => { |
|
|
|
|
|
let obj = {} |
|
|
|
|
|
res.data.content.forEach(item => { |
|
|
|
|
|
obj[item.id] = item.image |
|
|
|
|
|
}); |
|
|
|
|
|
app.globalData.configJson.indexSeason = obj |
|
|
|
|
|
app.globalData.loadIndexSeason = true |
|
|
|
|
|
hotelData.weburl = app.globalData.configJson.hotelUrl |
|
|
|
|
|
this.setData({ |
|
|
|
|
|
indexHot: app.globalData.configJson.indexHot, |
|
|
|
|
|
isTest: app.globalData.configJson.isTest, |
|
|
|
|
|
otherPlat: app.globalData.configJson.otherPlats, |
|
|
|
|
|
indexSeason: app.globalData.configJson.indexSeason, |
|
|
|
|
|
mainTypeList: mainTypeList |
|
|
|
|
|
}) |
|
|
|
|
|
}) |
|
|
|
|
|
} |
|
|
|
|
|
console.log(this.data) |
|
|
|
|
|
}, |
|
|
|
|
|
// --------------------banner 相关---------------------------
|
|
|
|
|
|
// 获取banner
|
|
|
|
|
|
getBanner: function() { |
|
|
|
|
|
let _this = this |
|
|
|
|
|
//全屏广告
|
|
|
|
|
|
commonApi._post("adv/getAdv", {position: 2,type_id: 3}).then(res => { |
|
|
|
|
|
if (res.data.length > 0) { |
|
|
|
|
|
let length = res.data.length |
|
|
|
|
|
let num = Math.floor(Math.random() * length); |
|
|
|
|
|
this.setData({startList: res.data[num]}) |
|
|
|
|
|
// 图片
|
|
|
|
|
|
if (this.data.startList.media_type) { |
|
|
|
|
|
wx.hideTabBar() //这里隐藏了底部导航栏
|
|
|
|
|
|
this.setData({showTime: true}) |
|
|
|
|
|
this.data.fullAdvTimer = setInterval(() => { |
|
|
|
|
|
_this.data.time-=0.5 |
|
|
|
|
|
if (Number.isInteger(_this.data.time)) { |
|
|
|
|
|
_this.setData({time: _this.data.time}) |
|
|
|
|
|
} |
|
|
|
|
|
if (_this.data.time <= 0) { |
|
|
|
|
|
_this.setData({opacity: _this.data.opacity - 0.3}) |
|
|
|
|
|
} |
|
|
|
|
|
if (_this.data.time <= -1) { |
|
|
|
|
|
clearInterval(_this.data.fullAdvTimer) |
|
|
|
|
|
wx.showTabBar() //倒计时结束清除定时器显示导航栏
|
|
|
|
|
|
_this.setData({showFullAdv: false}) |
|
|
|
|
|
} |
|
|
|
|
|
}, 500) |
|
|
|
|
|
} else { |
|
|
|
|
|
// 视频
|
|
|
|
|
|
} |
|
|
|
|
|
} else { |
|
|
|
|
|
this.setData({showFullAdv: false}) |
|
|
|
|
|
} |
|
|
|
|
|
}) |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
commonApi._post("adv/getAdv", {position: 0,type_id: 3}).then(res => { |
|
|
|
|
|
this.setData({banner: res.data || []}) |
|
|
|
|
|
}) |
|
|
|
|
|
commonApi._post("adv/getAdv", {position: 1,type_id: 3}).then(res => { |
|
|
|
|
|
this.setData({xiaobanner: res.data || []}) |
|
|
|
|
|
}) |
|
|
|
|
|
//弹窗广告
|
|
|
|
|
|
commonApi._post("adv/getAdv", {position: 3,type_id: 3}).then(res => { |
|
|
|
|
|
if (res.data.length > 0) { |
|
|
|
|
|
this.setData({ |
|
|
|
|
|
alertSwipeList: res.data || [], |
|
|
|
|
|
showAdv: true |
|
|
}) |
|
|
}) |
|
|
} |
|
|
} |
|
|
}) |
|
|
}) |
|
|
}, |
|
|
}, |
|
|
|
|
|
|
|
|
|
|
|
// 统一的banner change 需要时可以放开
|
|
|
|
|
|
changeBannerIndex: function(e) { |
|
|
|
|
|
return |
|
|
|
|
|
let keyname = e.currentTarget.dataset.keyname |
|
|
|
|
|
this.setData({ |
|
|
|
|
|
[keyname]: e.detail.current, |
|
|
|
|
|
}) |
|
|
|
|
|
}, |
|
|
|
|
|
|
|
|
|
|
|
// 轮播图点击
|
|
|
|
|
|
bannerClick: function(e) { |
|
|
|
|
|
if (this.data.isTest) return; |
|
|
|
|
|
let item = e.currentTarget.dataset.item; |
|
|
|
|
|
this.pagePoint({ |
|
|
|
|
|
event: "banner_click", |
|
|
|
|
|
type: 'banner' |
|
|
|
|
|
}, 1) |
|
|
|
|
|
switch (item.jump_type) { |
|
|
|
|
|
case 0: |
|
|
|
|
|
break; |
|
|
|
|
|
case 1: |
|
|
|
|
|
util.gotoDetail(item.product_model) |
|
|
|
|
|
break; |
|
|
|
|
|
case 2: |
|
|
|
|
|
if (item.front_model && item.front_model.mini) { |
|
|
|
|
|
wx.navigateTo({ |
|
|
|
|
|
url: "/" + item.front_model.mini |
|
|
|
|
|
}) |
|
|
|
|
|
} |
|
|
|
|
|
break; |
|
|
|
|
|
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) { |
|
|
|
|
|
// 外部h5
|
|
|
|
|
|
app.globalData.weburl = item.tdata.url; |
|
|
|
|
|
wx.navigateTo({ |
|
|
|
|
|
url: "/pages/pbService/web/index?weburl=" + encodeURIComponent(item.tdata |
|
|
|
|
|
.url) |
|
|
|
|
|
}) |
|
|
|
|
|
} else { |
|
|
|
|
|
let page = item.tdata.url.split("/"); |
|
|
|
|
|
page = page[page.length - 1].split("?") |
|
|
|
|
|
let url = this.data.urltopage[page[0]]; |
|
|
|
|
|
if (url && url.indexOf('map') != -1) { |
|
|
|
|
|
let types = ['', 'scenic', 'venue', 'post', 'restaurant', 'relic', 'tenscenic', |
|
|
|
|
|
'cinema', 'academes' |
|
|
|
|
|
], |
|
|
|
|
|
type = page[1] ? page[1].split("=") : []; |
|
|
|
|
|
wx.reLaunch({ |
|
|
|
|
|
url: url + "?type=" + (type[1] ? types.findIndex(t => t == type[1]) : |
|
|
|
|
|
null) |
|
|
|
|
|
}) |
|
|
|
|
|
} else if (url) { |
|
|
|
|
|
wx.navigateTo({ |
|
|
|
|
|
url: url, |
|
|
|
|
|
}) |
|
|
|
|
|
} else { |
|
|
|
|
|
app.globalData.weburl = item.tdata.url; |
|
|
|
|
|
wx.navigateTo({ |
|
|
|
|
|
url: "/pages/pbService/web/index?weburl=" + encodeURIComponent(item |
|
|
|
|
|
.tdata.url) |
|
|
|
|
|
}) |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
|
|
|
break; |
|
|
|
|
|
case 4: |
|
|
|
|
|
if (item.tdata.appid == 'wxe5ca0f71e918e352' && wx.getStorageSync('jstrip_userid')) { |
|
|
|
|
|
// 如果是苏心游的小程序 直接把authCode带过去
|
|
|
|
|
|
userApi.user_post("user/getJumpThirdAppCode", {}).then(res => { |
|
|
|
|
|
let weburl = item.tdata.page |
|
|
|
|
|
if (weburl.indexOf('?') != -1) { |
|
|
|
|
|
weburl += '&authCode=' + res.data; |
|
|
|
|
|
} else { |
|
|
|
|
|
weburl += '?authCode=' + res.data |
|
|
|
|
|
} |
|
|
|
|
|
wx.navigateToMiniProgram({ |
|
|
|
|
|
appId: item.tdata.appid, |
|
|
|
|
|
path: weburl |
|
|
|
|
|
}) |
|
|
|
|
|
}).catch(err => { |
|
|
|
|
|
wx.navigateToMiniProgram({ |
|
|
|
|
|
appId: item.tdata.appid, |
|
|
|
|
|
path: item.tdata.page |
|
|
|
|
|
}) |
|
|
|
|
|
}) |
|
|
|
|
|
} else { |
|
|
|
|
|
wx.navigateToMiniProgram({ |
|
|
|
|
|
appId: item.tdata.appid, |
|
|
|
|
|
path: item.tdata.page |
|
|
|
|
|
}) |
|
|
|
|
|
} |
|
|
|
|
|
break; |
|
|
|
|
|
default: |
|
|
|
|
|
break; |
|
|
|
|
|
} |
|
|
|
|
|
return; |
|
|
|
|
|
|
|
|
|
|
|
}, |
|
|
|
|
|
|
|
|
|
|
|
//------------------------金刚区点击-------------------------------------
|
|
|
|
|
|
mainIconClick: function(e) { |
|
|
|
|
|
let item = e.currentTarget.dataset.item |
|
|
|
|
|
// 埋点
|
|
|
|
|
|
if (item.eventName) { |
|
|
|
|
|
this.pagePoint({event: item.eventName,}, 1) |
|
|
|
|
|
}else if (item.title) { |
|
|
|
|
|
commonApi._post("browse/burying_point", { |
|
|
|
|
|
uuid: app.globalData.uuid, |
|
|
|
|
|
drive: "mini", |
|
|
|
|
|
title: item.title |
|
|
|
|
|
}) |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
if (item.appId) { |
|
|
|
|
|
wx.navigateToMiniProgram({ |
|
|
|
|
|
appId: item.appId, |
|
|
|
|
|
path: item.pagePath, |
|
|
|
|
|
}) |
|
|
|
|
|
return |
|
|
|
|
|
} |
|
|
|
|
|
if (item.path) { |
|
|
|
|
|
wx.navigateTo({ |
|
|
|
|
|
url: item.path |
|
|
|
|
|
}) |
|
|
|
|
|
return |
|
|
|
|
|
} |
|
|
|
|
|
if (item.weburl) { |
|
|
|
|
|
wx.navigateTo({ |
|
|
|
|
|
url: "/pages/pbService/web/index?weburl=" + encodeURIComponent(item.weburl) |
|
|
|
|
|
}) |
|
|
|
|
|
return |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
}, |
|
|
|
|
|
|
|
|
|
|
|
// 滚动监听
|
|
|
|
|
|
listenScroll(e) { |
|
|
|
|
|
console.log(e.detail.scrollLeft) |
|
|
|
|
|
this.setData({ |
|
|
|
|
|
scrollLeft: e.detail.scrollLeft |
|
|
|
|
|
}) |
|
|
|
|
|
}, |
|
|
|
|
|
|
|
|
|
|
|
// -----------------------------------------------------------------------
|
|
|
|
|
|
|
|
|
|
|
|
// 新品特惠
|
|
|
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, |
|
|
type: 1, // 返回数组
|
|
|
type: 1, // 返回数组
|
|
|
}).then(res => { |
|
|
}).then(res => { |
|
|
// res.data.adv = [res.data.adv]
|
|
|
this.setData({xpth: res.data,}) |
|
|
this.setData({ |
|
|
|
|
|
xpth: res.data, |
|
|
|
|
|
djsTime: res.data.time |
|
|
|
|
|
}) |
|
|
|
|
|
let time = setInterval(() => { |
|
|
|
|
|
this.setData({ |
|
|
|
|
|
djsTime: this.data.djsTime - 1 |
|
|
|
|
|
}) |
|
|
|
|
|
this.formatDate(this.data.djsTime) |
|
|
|
|
|
}, 1000) |
|
|
|
|
|
if (this.data.djsTime == 0) { |
|
|
|
|
|
clearInterval(time) |
|
|
|
|
|
} |
|
|
|
|
|
}) |
|
|
|
|
|
}, |
|
|
|
|
|
// 元旦新品特惠 倒计时
|
|
|
|
|
|
formatDate: function(oTime) { |
|
|
|
|
|
let h = parseInt(oTime / 3600) |
|
|
|
|
|
let m = parseInt((oTime % 3600) / 60) |
|
|
|
|
|
let s = parseInt(oTime % 60) |
|
|
|
|
|
h = h < 10 ? "0" + h : h; |
|
|
|
|
|
m = m < 10 ? "0" + m : m; |
|
|
|
|
|
s = s < 10 ? "0" + s : s; |
|
|
|
|
|
this.setData({ |
|
|
|
|
|
djs: { |
|
|
|
|
|
h: h, |
|
|
|
|
|
m: m, |
|
|
|
|
|
s: s |
|
|
|
|
|
} |
|
|
|
|
|
}) |
|
|
}) |
|
|
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) { |
|
|
|
|
|
console.log(e, 99999999) |
|
|
|
|
|
}, |
|
|
|
|
|
changeBannerIndex: function(e) { |
|
|
|
|
|
this.setData({ |
|
|
|
|
|
activeBannerIndex: e.detail.current, |
|
|
|
|
|
bannerInterver: 5000 |
|
|
|
|
|
}) |
|
|
|
|
|
}, |
|
|
|
|
|
changeSmBannerIndex: function(e) { |
|
|
|
|
|
this.setData({ |
|
|
|
|
|
smBannerIndex: e.detail.current |
|
|
|
|
|
}) |
|
|
|
|
|
}, |
|
|
|
|
|
changeXPathBannerIndex: function(e) { |
|
|
|
|
|
this.setData({ |
|
|
|
|
|
XPathBannerIndex: e.detail.current |
|
|
|
|
|
}) |
|
|
|
|
|
}, |
|
|
|
|
|
xlzs: function (e) { |
|
|
|
|
|
|
|
|
|
|
|
wx.navigateToMiniProgram({ |
|
|
|
|
|
appId: 'wx757dd1ee184e75e9', |
|
|
|
|
|
page: "pages/tabBar/index/index" |
|
|
|
|
|
}) |
|
|
|
|
|
}, |
|
|
|
|
|
// 一城百馆
|
|
|
// 一城百馆
|
|
|
city: function() { |
|
|
city: function() { |
|
|
wx.navigateToMiniProgram({ |
|
|
wx.navigateToMiniProgram({ |
|
|
@ -295,71 +548,8 @@ Page({ |
|
|
}) |
|
|
}) |
|
|
this.getFourProduct() |
|
|
this.getFourProduct() |
|
|
}, |
|
|
}, |
|
|
getBanner: function() { |
|
|
|
|
|
// commonApi._post("adv/getAdvByKey",{
|
|
|
|
|
|
// key:"xcxBanner"
|
|
|
|
|
|
// }).then(res=>{
|
|
|
|
|
|
// console.log(res)
|
|
|
|
|
|
// this.setData({
|
|
|
|
|
|
// banner:res.data.content || []
|
|
|
|
|
|
// })
|
|
|
|
|
|
// })
|
|
|
|
|
|
// commonApi._post("adv/getAdvByKey",{
|
|
|
|
|
|
// key:"xiaobanner"
|
|
|
|
|
|
// }).then(res=>{
|
|
|
|
|
|
// this.setData({
|
|
|
|
|
|
// xiaobanner:res.data.content || []
|
|
|
|
|
|
// })
|
|
|
|
|
|
// })
|
|
|
|
|
|
// return;
|
|
|
|
|
|
commonApi._post("adv/getAdv", { |
|
|
|
|
|
position: 0, |
|
|
|
|
|
type_id: 3 |
|
|
|
|
|
}).then(res => { |
|
|
|
|
|
this.setData({ |
|
|
|
|
|
banner: res.data || [] |
|
|
|
|
|
}) |
|
|
|
|
|
}) |
|
|
|
|
|
commonApi._post("adv/getAdv", { |
|
|
|
|
|
position: 1, |
|
|
|
|
|
type_id: 3 |
|
|
|
|
|
}).then(res => { |
|
|
|
|
|
this.setData({ |
|
|
|
|
|
xiaobanner: res.data || [] |
|
|
|
|
|
}) |
|
|
|
|
|
}) |
|
|
|
|
|
//弹窗广告
|
|
|
|
|
|
commonApi._post("adv/getAdv", { |
|
|
|
|
|
position: 3, |
|
|
|
|
|
type_id: 3 |
|
|
|
|
|
}).then(res => { |
|
|
|
|
|
if (res.data.length > 0) { |
|
|
|
|
|
this.setData({ |
|
|
|
|
|
alertSwipeList: res.data || [], |
|
|
|
|
|
showAdv: true |
|
|
|
|
|
}) |
|
|
|
|
|
} else if (!this.data.showFullAdv) { |
|
|
|
|
|
wx.showTabBar({ |
|
|
|
|
|
animation: true, |
|
|
|
|
|
}) |
|
|
|
|
|
} |
|
|
|
|
|
}) |
|
|
|
|
|
|
|
|
|
|
|
}, |
|
|
|
|
|
//获取季节配置
|
|
|
|
|
|
getIndexSeason() { |
|
|
|
|
|
this.setData({ |
|
|
|
|
|
indexHot: app.globalData.configJson.indexHot, |
|
|
|
|
|
isTest: app.globalData.configJson.isTest, |
|
|
|
|
|
otherPlat: app.globalData.configJson.otherPlats, |
|
|
|
|
|
// 正式数据
|
|
|
|
|
|
indexSeason: app.globalData.configJson.indexSeason, |
|
|
|
|
|
// 开发数据
|
|
|
|
|
|
// indexSeason: imageSource.testImgs.indexSeason
|
|
|
|
|
|
}) |
|
|
|
|
|
this.getFourProduct() |
|
|
|
|
|
console.log(this.data) |
|
|
|
|
|
}, |
|
|
|
|
|
//关闭弹窗广告
|
|
|
//关闭弹窗广告
|
|
|
closeAdv: function() { |
|
|
closeAdv: function() { |
|
|
this.setData({ |
|
|
this.setData({ |
|
|
@ -371,13 +561,10 @@ Page({ |
|
|
}, |
|
|
}, |
|
|
//关闭全屏广告
|
|
|
//关闭全屏广告
|
|
|
closeFullAdv: function() { |
|
|
closeFullAdv: function() { |
|
|
this.setData({ |
|
|
this.setData({showFullAdv: false}) |
|
|
showFullAdv: false |
|
|
clearInterval(this.data.fullAdvTimer) |
|
|
}) |
|
|
|
|
|
if (!this.data.alertSwipeList.length > 0) { |
|
|
if (!this.data.alertSwipeList.length > 0) { |
|
|
wx.showTabBar({ |
|
|
wx.showTabBar({animation: true}) |
|
|
animation: true, |
|
|
|
|
|
}) |
|
|
|
|
|
} |
|
|
} |
|
|
}, |
|
|
}, |
|
|
// 是否静音
|
|
|
// 是否静音
|
|
|
@ -502,19 +689,7 @@ Page({ |
|
|
util.gotoDetail(item) |
|
|
util.gotoDetail(item) |
|
|
}, |
|
|
}, |
|
|
gotoPath: function(e) { |
|
|
gotoPath: function(e) { |
|
|
// if (e.currentTarget.dataset.event) {
|
|
|
|
|
|
// if (e.currentTarget.dataset.event=='gongyeyuanqu_click') {
|
|
|
|
|
|
// wx.navigateToMiniProgram({
|
|
|
|
|
|
// appId: 'wxd323e63a10aa6865',
|
|
|
|
|
|
// path: 'pages/home/index'
|
|
|
|
|
|
// })
|
|
|
|
|
|
// return
|
|
|
|
|
|
// }else{
|
|
|
|
|
|
// this.pagePoint({
|
|
|
|
|
|
// event: e.currentTarget.dataset.event
|
|
|
|
|
|
// }, 1)
|
|
|
|
|
|
// }
|
|
|
|
|
|
// }
|
|
|
|
|
|
if (e.currentTarget.dataset.title == '书香借阅') { |
|
|
if (e.currentTarget.dataset.title == '书香借阅') { |
|
|
wx.navigateToMiniProgram({ |
|
|
wx.navigateToMiniProgram({ |
|
|
appId: 'wx165d4f1727f6bdb0', |
|
|
appId: 'wx165d4f1727f6bdb0', |
|
|
@ -527,12 +702,6 @@ Page({ |
|
|
path: 'pages/index/index' |
|
|
path: 'pages/index/index' |
|
|
}) |
|
|
}) |
|
|
return; |
|
|
return; |
|
|
// } else if (e.currentTarget.dataset.event == 'wuzhong_click') {
|
|
|
|
|
|
// wx.navigateToMiniProgram({
|
|
|
|
|
|
// appId: 'wxdd39069b9a91dbfe',
|
|
|
|
|
|
// path: 'pages/index/index'
|
|
|
|
|
|
// })
|
|
|
|
|
|
// return;
|
|
|
|
|
|
} else if (e.currentTarget.dataset.title == 'e读书') { |
|
|
} else if (e.currentTarget.dataset.title == 'e读书') { |
|
|
wx.navigateToMiniProgram({ |
|
|
wx.navigateToMiniProgram({ |
|
|
appId: 'wx26e6f4c0baba005b', |
|
|
appId: 'wx26e6f4c0baba005b', |
|
|
@ -718,95 +887,7 @@ Page({ |
|
|
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) { |
|
|
|
|
|
if (this.data.isTest) return; |
|
|
|
|
|
let item = e.currentTarget.dataset.item; |
|
|
|
|
|
this.pagePoint({ |
|
|
|
|
|
event: "banner_click", |
|
|
|
|
|
type: 'banner' |
|
|
|
|
|
}, 1) |
|
|
|
|
|
switch (item.jump_type) { |
|
|
|
|
|
case 0: |
|
|
|
|
|
break; |
|
|
|
|
|
case 1: |
|
|
|
|
|
util.gotoDetail(item.product_model) |
|
|
|
|
|
break; |
|
|
|
|
|
case 2: |
|
|
|
|
|
if (item.front_model && item.front_model.mini) { |
|
|
|
|
|
wx.navigateTo({ |
|
|
|
|
|
url: "/" + item.front_model.mini |
|
|
|
|
|
}) |
|
|
|
|
|
} |
|
|
|
|
|
break; |
|
|
|
|
|
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) { |
|
|
|
|
|
// 外部h5
|
|
|
|
|
|
app.globalData.weburl = item.tdata.url; |
|
|
|
|
|
wx.navigateTo({ |
|
|
|
|
|
url: "/pages/pbService/web/index?weburl=" + encodeURIComponent(item.tdata |
|
|
|
|
|
.url) |
|
|
|
|
|
}) |
|
|
|
|
|
} else { |
|
|
|
|
|
let page = item.tdata.url.split("/"); |
|
|
|
|
|
page = page[page.length - 1].split("?") |
|
|
|
|
|
let url = this.data.urltopage[page[0]]; |
|
|
|
|
|
if (url && url.indexOf('map') != -1) { |
|
|
|
|
|
let types = ['', 'scenic', 'venue', 'post', 'restaurant', 'relic', 'tenscenic', |
|
|
|
|
|
'cinema', 'academes' |
|
|
|
|
|
], |
|
|
|
|
|
type = page[1] ? page[1].split("=") : []; |
|
|
|
|
|
wx.reLaunch({ |
|
|
|
|
|
url: url + "?type=" + (type[1] ? types.findIndex(t => t == type[1]) : |
|
|
|
|
|
null) |
|
|
|
|
|
}) |
|
|
|
|
|
} else if (url) { |
|
|
|
|
|
wx.navigateTo({ |
|
|
|
|
|
url: url, |
|
|
|
|
|
}) |
|
|
|
|
|
} else { |
|
|
|
|
|
app.globalData.weburl = item.tdata.url; |
|
|
|
|
|
wx.navigateTo({ |
|
|
|
|
|
url: "/pages/pbService/web/index?weburl=" + encodeURIComponent(item |
|
|
|
|
|
.tdata.url) |
|
|
|
|
|
}) |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
|
|
|
break; |
|
|
|
|
|
case 4: |
|
|
|
|
|
if (item.tdata.appid == 'wxe5ca0f71e918e352' && wx.getStorageSync('jstrip_userid')) { |
|
|
|
|
|
// 如果是苏心游的小程序 直接把authCode带过去
|
|
|
|
|
|
userApi.user_post("user/getJumpThirdAppCode", {}).then(res => { |
|
|
|
|
|
let weburl = item.tdata.page |
|
|
|
|
|
if (weburl.indexOf('?') != -1) { |
|
|
|
|
|
weburl += '&authCode=' + res.data; |
|
|
|
|
|
} else { |
|
|
|
|
|
weburl += '?authCode=' + res.data |
|
|
|
|
|
} |
|
|
|
|
|
wx.navigateToMiniProgram({ |
|
|
|
|
|
appId: item.tdata.appid, |
|
|
|
|
|
path: weburl |
|
|
|
|
|
}) |
|
|
|
|
|
}).catch(err => { |
|
|
|
|
|
wx.navigateToMiniProgram({ |
|
|
|
|
|
appId: item.tdata.appid, |
|
|
|
|
|
path: item.tdata.page |
|
|
|
|
|
}) |
|
|
|
|
|
}) |
|
|
|
|
|
} else { |
|
|
|
|
|
wx.navigateToMiniProgram({ |
|
|
|
|
|
appId: item.tdata.appid, |
|
|
|
|
|
path: item.tdata.page |
|
|
|
|
|
}) |
|
|
|
|
|
} |
|
|
|
|
|
break; |
|
|
|
|
|
default: |
|
|
|
|
|
break; |
|
|
|
|
|
} |
|
|
|
|
|
return; |
|
|
|
|
|
|
|
|
|
|
|
}, |
|
|
|
|
|
//博物馆跳转 直接跳君到苏州H5
|
|
|
//博物馆跳转 直接跳君到苏州H5
|
|
|
goH5: function(e) { |
|
|
goH5: function(e) { |
|
|
let weburl = 'https://m.cloud.sz-trip.com/' + e.currentTarget.dataset.path; |
|
|
let weburl = 'https://m.cloud.sz-trip.com/' + e.currentTarget.dataset.path; |
|
|
@ -816,77 +897,9 @@ Page({ |
|
|
url: '/pages/pbService/web/index?weburl=' + encodeURIComponent(weburl), |
|
|
url: '/pages/pbService/web/index?weburl=' + encodeURIComponent(weburl), |
|
|
}) |
|
|
}) |
|
|
}, |
|
|
}, |
|
|
bannerClick2: function(e) { |
|
|
|
|
|
let item = e.currentTarget.dataset.item; |
|
|
|
|
|
if (item.action == 'href') { |
|
|
|
|
|
if (item.href.indexOf(",") != -1) { |
|
|
|
|
|
let info = item.href.split(","); |
|
|
|
|
|
wx.navigateToMiniProgram({ |
|
|
|
|
|
appId: info[0], |
|
|
|
|
|
path: info[1] |
|
|
|
|
|
}) |
|
|
|
|
|
} else if (item.href.indexOf('map/index') != -1) { |
|
|
|
|
|
wx.reLaunch({ |
|
|
|
|
|
url: item.href |
|
|
|
|
|
}) |
|
|
|
|
|
} else { |
|
|
|
|
|
wx.navigateTo({ |
|
|
|
|
|
url: item.href, |
|
|
|
|
|
}) |
|
|
|
|
|
} |
|
|
|
|
|
} else if (item.action == "web") { |
|
|
|
|
|
app.globalData.weburl = item.href; |
|
|
|
|
|
wx.navigateTo({ |
|
|
|
|
|
url: "/pages/pbService/web/index?weburl=" + encodeURIComponent(item.href), |
|
|
|
|
|
}) |
|
|
|
|
|
} |
|
|
|
|
|
}, |
|
|
|
|
|
// 监听文旅查询的scroll
|
|
|
|
|
|
listenScroll(e) { |
|
|
|
|
|
this.setData({ |
|
|
|
|
|
scrollLeft: e.detail.scrollLeft |
|
|
|
|
|
}) |
|
|
|
|
|
}, |
|
|
|
|
|
// 获取短视频大赛是否中奖 中奖详情
|
|
|
|
|
|
getVideoPrize() { |
|
|
|
|
|
let user_id = wx.getStorageSync('jstrip_userid'); |
|
|
|
|
|
if (!user_id || wx.getStorageSync('indexPriceNoTip')) return; |
|
|
|
|
|
commonApi.user_post('actonline/video_act/getRaffle', { |
|
|
|
|
|
act_id: 5 |
|
|
|
|
|
}).then(res => { |
|
|
|
|
|
this.setData({ |
|
|
|
|
|
videoPrize: res.data |
|
|
|
|
|
}) |
|
|
|
|
|
}) |
|
|
|
|
|
}, |
|
|
|
|
|
noMoreTip() { |
|
|
|
|
|
wx.setStorageSync('indexPriceNoTip', true) |
|
|
|
|
|
this.closePrice() |
|
|
|
|
|
}, |
|
|
|
|
|
closePrice() { |
|
|
|
|
|
this.setData({ |
|
|
|
|
|
videoPrize: false, |
|
|
|
|
|
prizeInfo: null |
|
|
|
|
|
}) |
|
|
|
|
|
}, |
|
|
|
|
|
// 抽奖
|
|
|
|
|
|
choosePrize() { |
|
|
|
|
|
commonApi.user_post('actonline/video_act/luckyDraw', { |
|
|
|
|
|
act_id: 5 |
|
|
|
|
|
}).then(res => { |
|
|
|
|
|
this.setData({ |
|
|
|
|
|
prizeInfo: res.data |
|
|
|
|
|
}) |
|
|
|
|
|
if (res.data.type != 'none') { |
|
|
|
|
|
// 抽奖成功的话 弹框
|
|
|
|
|
|
wx.showModal({ |
|
|
|
|
|
title: "提示", |
|
|
|
|
|
content: "中奖人员请联系君到苏州客服,领奖方式以客服通知为准", |
|
|
|
|
|
showCancel: false |
|
|
|
|
|
}) |
|
|
|
|
|
} |
|
|
|
|
|
}) |
|
|
|
|
|
}, |
|
|
|
|
|
bannerJumpNew(item) { |
|
|
bannerJumpNew(item) { |
|
|
let that = this |
|
|
let that = this |
|
|
item = item.currentTarget.dataset.item |
|
|
item = item.currentTarget.dataset.item |
|
|
@ -972,10 +985,7 @@ Page({ |
|
|
} |
|
|
} |
|
|
return |
|
|
return |
|
|
}, |
|
|
}, |
|
|
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') { |
|
|
@ -998,47 +1008,20 @@ Page({ |
|
|
util.pagePoint(e, type) |
|
|
util.pagePoint(e, type) |
|
|
}, |
|
|
}, |
|
|
onShow: function() { |
|
|
onShow: function() { |
|
|
|
|
|
// console.log(app.globalData)
|
|
|
|
|
|
// if (app.globalData.loadIndexSeason) {
|
|
|
|
|
|
// this.getIndexSeason()
|
|
|
|
|
|
// } else {
|
|
|
|
|
|
// let t = setInterval(() => {
|
|
|
|
|
|
// if (app.globalData.loadIndexSeason) {
|
|
|
|
|
|
// this.getIndexSeason()
|
|
|
|
|
|
// clearInterval(t)
|
|
|
|
|
|
// t = null
|
|
|
|
|
|
// }
|
|
|
|
|
|
// }, 500)
|
|
|
|
|
|
// }
|
|
|
|
|
|
|
|
|
if (app.globalData.loadIndexSeason) { |
|
|
this.pagePoint({event: 'home_view'}, 1) |
|
|
this.getIndexSeason() |
|
|
|
|
|
} else { |
|
|
|
|
|
let t = setInterval(() => { |
|
|
|
|
|
if (app.globalData.loadIndexSeason) { |
|
|
|
|
|
this.getIndexSeason() |
|
|
|
|
|
clearInterval(t) |
|
|
|
|
|
t = null |
|
|
|
|
|
} |
|
|
|
|
|
}, 500) |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
this.pagePoint({ |
|
|
|
|
|
event: 'home_view' |
|
|
|
|
|
}, 1) |
|
|
|
|
|
|
|
|
|
|
|
if(!this.data.hotelUrl) { |
|
|
|
|
|
commonApi._post("pbservice/Other/getClientConfig", { |
|
|
|
|
|
unique_key: "wechatxcx" |
|
|
|
|
|
}).then(res => { |
|
|
|
|
|
try { |
|
|
|
|
|
let data = JSON.parse(res.data); |
|
|
|
|
|
if (data.hotelUrl) { |
|
|
|
|
|
this.setData({ |
|
|
|
|
|
hotelUrl: data.hotelUrl |
|
|
|
|
|
}) |
|
|
|
|
|
} |
|
|
|
|
|
} catch(e) { |
|
|
|
|
|
this.setData({ |
|
|
|
|
|
hotelUrl: '/pages/list/hotel/index' |
|
|
|
|
|
}) |
|
|
|
|
|
} |
|
|
|
|
|
}).catch(err => { |
|
|
|
|
|
this.setData({ |
|
|
|
|
|
hotelUrl: '/pages/list/hotel/index' |
|
|
|
|
|
}) |
|
|
|
|
|
}) |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
// this.data.time!=5?wx.showTabBar():1
|
|
|
|
|
|
}, |
|
|
}, |
|
|
|
|
|
|
|
|
/** |
|
|
/** |
|
|
|