|
|
|
@ -146,10 +146,7 @@ Page({ |
|
|
|
isMayDay: new Date().getTime()>new Date('2025/05/01 00:00:00').getTime() |
|
|
|
|
|
|
|
}, |
|
|
|
onLoad: function(options) { |
|
|
|
this.getHeight() |
|
|
|
//全屏广告
|
|
|
|
wx.hideTabBar() //这里隐藏了底部导航栏
|
|
|
|
onLoad: function(options) { |
|
|
|
commonApi._post("adv/getAdv", { |
|
|
|
position: 2, |
|
|
|
type_id: 3 |
|
|
|
@ -205,56 +202,22 @@ Page({ |
|
|
|
}) |
|
|
|
if (options.from) { |
|
|
|
app.globalData.from = options.from; |
|
|
|
} |
|
|
|
// 获取今天的日期
|
|
|
|
} |
|
|
|
this.getHeight() |
|
|
|
//全屏广告
|
|
|
|
wx.hideTabBar() //这里隐藏了底部导航栏
|
|
|
|
|
|
|
|
// 获取今天的日期
|
|
|
|
let today = new Date(); |
|
|
|
let d = new Date(); |
|
|
|
let month = d.getMonth() + 1,day = d.getDate(); |
|
|
|
month = month > 10 ? month : ("0" + month); |
|
|
|
day = day > 10 ? day : ("0" + day); |
|
|
|
this.setData({ |
|
|
|
month: (this.data.months[today.getMonth()]).toUpperCase(), |
|
|
|
date: today.getDate() |
|
|
|
}) |
|
|
|
let d = new Date(); |
|
|
|
let month = d.getMonth() + 1, |
|
|
|
day = d.getDate(); |
|
|
|
month = month > 10 ? month : ("0" + month); |
|
|
|
day = day > 10 ? day : ("0" + day); |
|
|
|
this.setData({ |
|
|
|
today: d.getFullYear() + "-" + month + "-" + day |
|
|
|
}) |
|
|
|
let systemInfo = wx.getSystemInfoSync(), |
|
|
|
rect = wx.getMenuButtonBoundingClientRect(); |
|
|
|
let height = (rect.top - systemInfo.statusBarHeight) * 2 + rect.height; |
|
|
|
wx.getLocation({ |
|
|
|
type: 'gcj02', |
|
|
|
success: (res) => { |
|
|
|
this.setData({ |
|
|
|
lat: res.latitude, |
|
|
|
lon: res.longitude |
|
|
|
}) |
|
|
|
this.getList() |
|
|
|
this.getHdrlList() |
|
|
|
}, |
|
|
|
fail: (err) => { |
|
|
|
this.getList() |
|
|
|
this.getHdrlList() |
|
|
|
} |
|
|
|
}) |
|
|
|
this.setData({ |
|
|
|
height: height, |
|
|
|
padHeight: systemInfo.statusBarHeight, |
|
|
|
right: (systemInfo.screenWidth - rect.right) + rect.width |
|
|
|
date: today.getDate(), |
|
|
|
today: d.getFullYear() + "-" + month + "-" + day |
|
|
|
}) |
|
|
|
|
|
|
|
commonApi._post("pbservice/Other/getClientConfig", { |
|
|
|
unique_key: "urltopage" |
|
|
|
}).then(res => { |
|
|
|
let data = JSON.parse(res.data) |
|
|
|
this.setData({ |
|
|
|
urltopage: data |
|
|
|
}) |
|
|
|
}) |
|
|
|
this.getTwoProduct() |
|
|
|
this.getBanner() |
|
|
|
this.getWeather() |
|
|
|
}, |
|
|
|
gobdDetail(e) { |
|
|
|
let item = e.currentTarget.dataset.item |
|
|
|
@ -431,14 +394,16 @@ Page({ |
|
|
|
// 获取导航栏项目标题高度
|
|
|
|
getHeight() { |
|
|
|
let that = this |
|
|
|
wx.getSystemInfo({ |
|
|
|
success(res) { |
|
|
|
console.log(res) |
|
|
|
that.setData({ |
|
|
|
viewHeight: res.windowHeight + 'px' |
|
|
|
}) |
|
|
|
console.log(that.data.viewHeight) |
|
|
|
} |
|
|
|
let systemInfo = wx.getStorageSync('systemInfo'),rect = wx.getMenuButtonBoundingClientRect(); |
|
|
|
if (!systemInfo) {systemInfo = wx.getSystemInfoSync()} |
|
|
|
if (!rect) {rect = wx.getMenuButtonBoundingClientRect()} |
|
|
|
let height = (rect.top - systemInfo.statusBarHeight) * 2 + rect.height; |
|
|
|
|
|
|
|
that.setData({ |
|
|
|
viewHeight: systemInfo.windowHeight + 'px', |
|
|
|
height: height, |
|
|
|
padHeight: systemInfo.statusBarHeight, |
|
|
|
right: (systemInfo.screenWidth - rect.right) + rect.width |
|
|
|
}) |
|
|
|
}, |
|
|
|
// getXpthList: function() {
|
|
|
|
@ -887,34 +852,7 @@ Page({ |
|
|
|
|
|
|
|
}) |
|
|
|
}, |
|
|
|
// 热门推荐 去掉经纬度 接口排序方式变更(韩阳)
|
|
|
|
// getList: function() {
|
|
|
|
// if (!this.data.listMore) return;
|
|
|
|
// commonApi._post("search/recommend", {
|
|
|
|
// offset: this.data.list.length,
|
|
|
|
// limit: 16
|
|
|
|
// }).then(res => {
|
|
|
|
// res.data.map(item => {
|
|
|
|
// if (item.ext.display_tags) {
|
|
|
|
// item.ext.display_tags = item.ext.display_tags.split(",").splice(0, 2)
|
|
|
|
// } else {
|
|
|
|
// item.ext.display_tags = []
|
|
|
|
// }
|
|
|
|
// })
|
|
|
|
// if (res.data.length < 15) {
|
|
|
|
// this.setData({
|
|
|
|
// listMore: false
|
|
|
|
// })
|
|
|
|
// }
|
|
|
|
// this.setData({
|
|
|
|
// list: this.data.list.concat(res.data)
|
|
|
|
// })
|
|
|
|
// })
|
|
|
|
// },
|
|
|
|
onReachBottom: function() { |
|
|
|
// if (this.data.list.length < 30) {
|
|
|
|
// this.getList()
|
|
|
|
// }
|
|
|
|
}, |
|
|
|
gotoDetail: function(e) { |
|
|
|
let item = e.currentTarget.dataset.item; |
|
|
|
@ -1042,186 +980,43 @@ Page({ |
|
|
|
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) {
|
|
|
|
// let that = this
|
|
|
|
// item = item.currentTarget.dataset.item
|
|
|
|
// if (item.tdata == '') return
|
|
|
|
// that.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
|
|
|
|
// console.log(item.tdata)
|
|
|
|
// app.globalData.weburl = item.tdata.url;
|
|
|
|
// wx.navigateTo({
|
|
|
|
// url: "/pages/pbService/web/index"
|
|
|
|
// })
|
|
|
|
// } else {
|
|
|
|
// let page = item.tdata.url.split("/");
|
|
|
|
// page = page[page.length - 1].split("?")
|
|
|
|
// console.log(page[0])
|
|
|
|
// 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"
|
|
|
|
// })
|
|
|
|
// }
|
|
|
|
// }
|
|
|
|
// 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
|
|
|
|
// },
|
|
|
|
onReady: function() { |
|
|
|
wx.getLocation({ |
|
|
|
type: 'gcj02', |
|
|
|
success: (res) => { |
|
|
|
this.setData({ |
|
|
|
lat: res.latitude, |
|
|
|
lon: res.longitude |
|
|
|
}) |
|
|
|
this.getList() |
|
|
|
this.getHdrlList() |
|
|
|
}, |
|
|
|
fail: (err) => { |
|
|
|
this.getList() |
|
|
|
this.getHdrlList() |
|
|
|
} |
|
|
|
}) |
|
|
|
|
|
|
|
commonApi._post("pbservice/Other/getClientConfig", { |
|
|
|
unique_key: "urltopage" |
|
|
|
}).then(res => { |
|
|
|
let data = JSON.parse(res.data) |
|
|
|
this.setData({ |
|
|
|
urltopage: data |
|
|
|
}) |
|
|
|
}) |
|
|
|
// this.getTwoProduct()
|
|
|
|
this.getBanner() |
|
|
|
this.getWeather() |
|
|
|
|
|
|
|
}, |
|
|
|
// gotoOther: function(e) {
|
|
|
|
// let item = e.currentTarget.dataset.item;
|
|
|
|
// if (item.type == 'h5') {
|
|
|
|
// app.globalData.weburl = item.url
|
|
|
|
// wx.navigateTo({
|
|
|
|
// url: "/pages/pbService/web/index?weburl=" + encodeURIComponent(item.url)
|
|
|
|
// })
|
|
|
|
// } else if (item.type == 'mini') {
|
|
|
|
// wx.navigateToMiniProgram({
|
|
|
|
// appId: item.appid,
|
|
|
|
// path: item.path
|
|
|
|
// })
|
|
|
|
// } else if (item.type == 'page') {
|
|
|
|
// wx.navigateTo({
|
|
|
|
// url: item.page,
|
|
|
|
// })
|
|
|
|
// }
|
|
|
|
// },
|
|
|
|
|
|
|
|
pagePoint: function(e, type) { |
|
|
|
util.pagePoint(e, type) |
|
|
|
}, |
|
|
|
@ -1241,7 +1036,6 @@ Page({ |
|
|
|
this.pagePoint({ |
|
|
|
event: 'home_view' |
|
|
|
}, 1) |
|
|
|
// this.data.time!=5?wx.showTabBar():1
|
|
|
|
}, |
|
|
|
|
|
|
|
/** |
|
|
|
|