diff --git a/pages/index/index.js b/pages/index/index.js index 3c95918..2a73d54 100644 --- a/pages/index/index.js +++ b/pages/index/index.js @@ -12,14 +12,7 @@ Page({ padHeight: 0, right: 0, weather: null, - saleProduct: null, - roadProduct: null, - fourProduct: [], - hotIndex: 0, - indexHot: [], - area_ids: ["zhangjiagang", "changshu", "taicang", "kunshan", "wujiang", "wuzhong", "xiangcheng", "gusu", - "gongyeyuanqu", "gaoxin" - ], + month: "", months: ['JAN', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'oct', 'nov', 'dec'], date: "", @@ -46,351 +39,327 @@ Page({ opacity: 1, time: 3, //全屏广告剩余时间 showTime: false, - xpth: {}, // 元旦新增 新品特惠和sqjNew - djs: null, // 元旦新增 新品特惠倒计时 - djsTime: null, - sqjNew: [ - '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/ad2324005ba1ed0cabe990ec62bfec76.png', - 'https://static.ticket.sz-trip.com/uploads/20240428/a90f3ce4519a585cc5cebfe62d8d4043.png', - 'https://static.ticket.sz-trip.com/uploads/20240428/e6fa6cdef2971c8abdb670be1f36d1ca.png', - 'https://static.ticket.sz-trip.com/uploads/20240428/9c8186b8249bf81a2ef4fe4a4194cf2b.png', - 'https://static.ticket.sz-trip.com/uploads/20240428/755ee01ac248aeda8812b025f483a869.png', - 'https://static.ticket.sz-trip.com/uploads/20240428/2d29f0d14e634b0a78d4ef91b28d5999.png', - 'https://static.ticket.sz-trip.com/uploads/20240428/71f7b558c7ca6d42728d48508d01819c.png', - 'https://static.ticket.sz-trip.com/uploads/20240428/23e07551be831036116c2fedbbf7aea5.png', - ], + viewHeight: "0px", isMuted: true, - videoPlay: false, - hdrlNavList:[ - { - type:null, - title:'全部' - }, - { - type:'scene', - title:'景区活动' - }, - { - type:'show', - title:'演出' - }, - { - type:'exhibition', - title:'展览' - }, - { - type:'movie', - title:'电影' - }, - { - type:'other', - title:'其他' - } - ], //活动日历板块导航分类 - hdrlNavIndex:0,//活动日历默认选中第一个全部分类 - today:null, - hdrlList:[], - yszNav:['公共服务','旅游助手'], - yszIndex:0, - bdList:[ + videoPlay: false, + hdrlNavList:[ { - color: '#FFE4BC', - bg: 'linear-gradient(172deg, #F08528, #D1201B);', - icon:'https://static.ticket.sz-trip.com/uploads/20250429/069ab247bb2ab5a08fa7707d671b1ac5.png', //游 景点 - url:'', - path:'/pages/list/scene/index', - list: [], - + type:null, + title:'全部' }, - { - color: '#DBD8F6', - bg: 'linear-gradient(172deg, #A49CE9, #353A68);', - icon:'https://static.ticket.sz-trip.com/uploads/20250429/8c023b9c626d3821b64d105ae6e65f2d.png', //非玩不可 景点产品 - // path:'/pages/list/night/index', - url:'https://m.cloud.sz-trip.com/nightTour2025', - path: '', - list: [], - + { + type:'scene', + title:'景区活动' }, { - color: '#FFE4BC', - bg: 'linear-gradient(172deg, #F08528, #D1201B);', - icon:'https://static.ticket.sz-trip.com/uploads/20250429/9928f46523fd57233b6ef3371a6ba460.png', //非看不可 - url:'', - path:'/pages/list/theatre/index', - list: [], - + type:'show', + title:'演出' }, { - color: '#DBD8F6', - bg: 'linear-gradient(172deg, #A49CE9, #353A68);', - icon:'https://static.ticket.sz-trip.com/uploads/20250429/a4f53072aa51a387593a183799b902e6.png', //非买不可 - path:'/subPackages/techanNew/index', - url:'', - list: [], - + type:'exhibition', + title:'展览' }, - - - ], - list1:[], //游-景点 - list2:[], //非晚-夜游 - list3:[], //非看-剧场演出 - list4:[], //非买-文创 - - nowDate: [('0' + (new Date().getMonth() + 1)).slice(-2) , ('0' + new Date().getDate()).slice(-2)], + { + type:'movie', + title:'电影' + }, + { + type:'other', + title:'其他' + } + ], //活动日历板块导航分类 + hdrlNavIndex:0,//活动日历默认选中第一个全部分类 + today:null, + hdrlList:[], + yszNav:['公共服务','旅游助手'], + yszIndex:0, + bdList:[ + { + color: '#FFE4BC', + bg: 'linear-gradient(172deg, #F08528, #D1201B);', + icon:'https://static.ticket.sz-trip.com/uploads/20250429/069ab247bb2ab5a08fa7707d671b1ac5.png', //游 景点 + url:'', + path:'/pages/list/scene/index', + list: [], + + }, + { + color: '#DBD8F6', + bg: 'linear-gradient(172deg, #A49CE9, #353A68);', + icon:'https://static.ticket.sz-trip.com/uploads/20250429/8c023b9c626d3821b64d105ae6e65f2d.png', //非玩不可 景点产品 + // path:'/pages/list/night/index', + url:'https://m.cloud.sz-trip.com/nightTour2025', + path: '', + list: [], + + }, + { + color: '#FFE4BC', + bg: 'linear-gradient(172deg, #F08528, #D1201B);', + icon:'https://static.ticket.sz-trip.com/uploads/20250429/9928f46523fd57233b6ef3371a6ba460.png', //非看不可 + url:'', + path:'/pages/list/theatre/index', + list: [], + + }, + { + color: '#DBD8F6', + bg: 'linear-gradient(172deg, #A49CE9, #353A68);', + icon:'https://static.ticket.sz-trip.com/uploads/20250429/a4f53072aa51a387593a183799b902e6.png', //非买不可 + path:'/subPackages/techanNew/index', + url:'', + list: [], + + }, + + + ], - isMayDay: new Date().getTime()>new Date('2025/05/01 00:00:00').getTime() + nowDate: [('0' + (new Date().getMonth() + 1)).slice(-2) , ('0' + new Date().getDate()).slice(-2)], + isMayDay: new Date().getTime()>new Date('2025/05/01 00:00:00').getTime() }, - onLoad: function(options) { - 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); - console.log('num', num); - this.setData({ - startList: res.data[num] - }) - console.log(this.data.startList.head_img); - } else { - this.setData({ - startList: res.data[0] - }) - } + onLoad: function(options) { + //全屏广告 + commonApi._post("adv/getAdv", { + position: 2, + type_id: 3 + }).then(res => { + if (res.data.length > 0) { + wx.hideTabBar() //这里隐藏了底部导航栏 - // 图片 - 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; - } - 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(), - today: d.getFullYear() + "-" + month + "-" + day - }) - }, - gobdDetail(e) { - let item = e.currentTarget.dataset.item - // wx.navigateTo({ - // url: url - // }) - util.gotoDetail(item) - }, - getList() { - let bdList = this.data.bdList - // 游--景点 - commonApi._post("scene/get_scene_by_tag",{ - tag_id:"4", - limit:6, - lon:this.data.lon, - lat:this.data.lat, - offset:0, - sort:"weight", - title:'', - area_id:'' - }).then(res=>{ - console.log('景点', res) - res.data.list.map(item => { - if (item.distance || item.distance == 0) { - if (item.distance >= 1000) { - item.distance = (item.distance / 1000).toFixed(2) + 'km'; - } else { - item.distance = (item.distance).toFixed(2) + 'm'; - } - } - }) - bdList[0].list = res.data.list - this.setData({ - list1:res.data.list, - bdList: bdList - }) - }) - // 非买不可--文创 - commonApi._post('product/get_product_by_tag_subject',{ - offset: 0, - limit: 6, - tag_id: 60, - }).then(res=>{ - bdList[3].list = res.data.list - this.setData({ - list4:res.data.list, - bdList: bdList - }) - }) - // 非玩不可--线路一日游 - commonApi._post('product/get_product_by_tag_subject',{ - tag_id: "58", - offset: 0, - limit: 6, - }).then(res=>{ - bdList[1].list = res.data.list - this.setData({ - list2:res.data.list, - bdList: bdList - }) - }) - // 非看不可--剧场演出 - commonApi._post("product/get_product_by_tag_subject",{ - tag_id:"59", - offset:0, - limit:6, - }).then(res=>{ - bdList[2].list = res.data.list - this.setData({ - list3:res.data.list, - bdList: bdList - }) - }) - }, - goDetail(e) { - let item = e.currentTarget.dataset.item; - let type = this.data.hdrlNavList[this.data.hdrlNavIndex].type - if (type == 'movie') { - // wx.navigateTo({ - // // url: '/pages/list/movieticket/list/info/index?id=' + item.third_id - // }) - util.goMovieDetail(item.third_id || item.id) - }else { - wx.navigateTo({ - url: '/pages/info/activityInfo/index?id=' + item.id, - }) - } - }, - // 分类为电影时调这个接口 - getMovieList() { - let service = "Cinema/getHotMovieList"; - let data = { - page: 1, - pageSize: 5 - }; - commonApi._post(service, data).then(res => { - console.log(res.data); - this.setData({ - hdrlList: res.data - }) - }) - console.log(this.data.hdrlList); - }, - // 推荐榜单更多跳转 - moreBtn(e) { - console.log(e) - let item = e.currentTarget.dataset.item - if (item.path!='') { - wx.navigateTo({ - url: item.path, - }) - } else { - // if (e.currentTarget.dataset.event) { - // this.pagePoint({ - // event: e.currentTarget.dataset.event - // }, 1) - // } - console.log('error', item) - let url = item.url; - app.globalData.weburl = url; - wx.navigateTo({ - url: '/pages/pbService/web/index?weburl=' + encodeURIComponent(url), - }) - } - }, - // 活动日历下的列表 - getHdrlList() { - commonApi._post('pbservice/Actcalendar/getActList', { - page_no: 1, - date: this.data.today, - category: this.data.hdrlNavList[this.data.hdrlNavIndex].type, - keywords: '', - area_key: '', - lat: this.data.lat, - lon: this.data.lon, - page_num: 5 - }).then(res => { - res.data.rows.forEach(v=>{ - if (!v.post_url) { - v.post_url = "https://static.ticket.sz-trip.com/uploads/20240909/c9a0029cc9426d2a17f1dbbb7a179762.jpg" + 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({ + 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; } + this.getHeight() + + + // 获取今天的日期 + 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(), + today: d.getFullYear() + "-" + month + "-" + day + }) + }, + gobdDetail(e) { + let item = e.currentTarget.dataset.item + util.gotoDetail(item) + }, + getList() { + let bdList = this.data.bdList + // 游--景点 + commonApi._post("scene/get_scene_by_tag",{ + tag_id:"4", + limit:6, + lon:this.data.lon, + lat:this.data.lat, + offset:0, + sort:"weight", + title:'', + area_id:'' + }).then(res=>{ + console.log('景点', res) + res.data.list.map(item => { + if (item.distance || item.distance == 0) { + if (item.distance >= 1000) { + item.distance = (item.distance / 1000).toFixed(2) + 'km'; + } else { + item.distance = (item.distance).toFixed(2) + 'm'; + } + } + }) + bdList[0].list = res.data.list + this.setData({ + bdList: bdList + }) + }) + // 非买不可--文创 + commonApi._post('product/get_product_by_tag_subject',{ + offset: 0, + limit: 6, + tag_id: 60, + }).then(res=>{ + bdList[3].list = res.data.list + this.setData({ + bdList: bdList + }) + }) + // 非玩不可--线路一日游 + commonApi._post('product/get_product_by_tag_subject',{ + tag_id: "58", + offset: 0, + limit: 6, + }).then(res=>{ + bdList[1].list = res.data.list + this.setData({ + bdList: bdList + }) + }) + // 非看不可--剧场演出 + commonApi._post("product/get_product_by_tag_subject",{ + tag_id:"59", + offset:0, + limit:6, + }).then(res=>{ + bdList[2].list = res.data.list + this.setData({ + bdList: bdList + }) + }) + }, + goDetail(e) { + let item = e.currentTarget.dataset.item; + let type = this.data.hdrlNavList[this.data.hdrlNavIndex].type + if (type == 'movie') { + // wx.navigateTo({ + // // url: '/pages/list/movieticket/list/info/index?id=' + item.third_id + // }) + util.goMovieDetail(item.third_id || item.id) + }else { + wx.navigateTo({ + url: '/pages/info/activityInfo/index?id=' + item.id, + }) + } + }, + // 分类为电影时调这个接口 + getMovieList() { + let service = "Cinema/getHotMovieList"; + let data = { + page: 1, + pageSize: 5 + }; + commonApi._post(service, data).then(res => { + console.log(res.data); + this.setData({ + hdrlList: res.data + }) + }) + console.log(this.data.hdrlList); + }, + // 推荐榜单更多跳转 + moreBtn(e) { + console.log(e) + let item = e.currentTarget.dataset.item + if (item.path!='') { + wx.navigateTo({ + url: item.path, + }) + } else { + // if (e.currentTarget.dataset.event) { + // this.pagePoint({ + // event: e.currentTarget.dataset.event + // }, 1) + // } + console.log('error', item) + let url = item.url; + app.globalData.weburl = url; + wx.navigateTo({ + url: '/pages/pbService/web/index?weburl=' + encodeURIComponent(url), + }) + } + }, + // 活动日历下的列表 + getHdrlList() { + commonApi._post('pbservice/Actcalendar/getActList', { + page_no: 1, + date: this.data.today, + category: this.data.hdrlNavList[this.data.hdrlNavIndex].type, + keywords: '', + area_key: '', + lat: this.data.lat, + lon: this.data.lon, + page_num: 5 + }).then(res => { + res.data.rows.forEach(v=>{ + if (!v.post_url) { + v.post_url = "https://static.ticket.sz-trip.com/uploads/20240909/c9a0029cc9426d2a17f1dbbb7a179762.jpg" + } + }) + this.setData({ + hdrlList:res.data.rows + }) }) - this.setData({ - hdrlList:res.data.rows - }) - }) - }, - // 切换活动日历分类 - changeHdrlNav(e) { - console.log(e.currentTarget.dataset); - this.setData({ - hdrlList:[], - hdrlNavIndex:e.currentTarget.dataset.index, - }) - if (this.data.hdrlNavIndex == 4) { - this.getMovieList() - } else { - this.getHdrlList() //切换分类重新获取活动日历列表 - } - }, - // 游苏州下的公共服务和旅游助手切换 - changeType(e) { - this.setData({ - yszIndex:e.currentTarget.dataset.index, - }) - }, - xlzs: function (e) { + }, + // 切换活动日历分类 + changeHdrlNav(e) { + console.log(e.currentTarget.dataset); + this.setData({ + hdrlList:[], + hdrlNavIndex:e.currentTarget.dataset.index, + }) + if (this.data.hdrlNavIndex == 4) { + this.getMovieList() + } else { + this.getHdrlList() //切换分类重新获取活动日历列表 + } + }, + // 游苏州下的公共服务和旅游助手切换 + changeType(e) { + this.setData({ + yszIndex:e.currentTarget.dataset.index, + }) + }, + xlzs: function (e) { - wx.navigateToMiniProgram({ - appId: 'wx757dd1ee184e75e9', - page: "pages/tabBar/index/index" - }) - }, + wx.navigateToMiniProgram({ + appId: 'wx757dd1ee184e75e9', + page: "pages/tabBar/index/index" + }) + }, // 获取导航栏项目标题高度 getHeight() { let that = this @@ -406,105 +375,21 @@ Page({ right: (systemInfo.screenWidth - rect.right) + rect.width }) }, - // getXpthList: function() { - // // 元旦新增 新品特惠 - // commonApi._post("product/get_product_indulgence", { - // tag_id: 275, - // typeId: 3, - // }).then(res => { - // console.log('data', 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() { - // app.globalData.weburl = 'https://m.cloud.sz-trip.com/mlgCoupons' - // wx.navigateTo({ - // url: "/pages/pbService/web/index" - // }) - // }, - // onTabItemTap: function(e) { - // console.log(e, 99999999) - // }, - // 大轮播的监听方法 + + // 大轮播的监听方法 changeBannerIndex: function(e) { this.setData({ activeBannerIndex: e.detail.current }) - }, - // 小轮播监听方法 + }, + // 小轮播监听方法 changeSmBannerIndex: function(e) { this.setData({ smBannerIndex: e.detail.current }) }, - // 一城百馆 - city: function() { - wx.navigateToMiniProgram({ - appId: 'wx114d514f39cb1fed', - path: "pages/entry/index" - }) - commonApi._post("browse/burying_point", { - drive: "mini", - title: "一城百馆", - uuid: app.globalData.uuid - }).then(res => { - }) - }, - changeHotIndex: function(e) { - this.setData({ - hotIndex: e.currentTarget.dataset.index, - fourProduct: [] - }) - 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 @@ -541,13 +426,27 @@ Page({ }, //获取季节配置 getIndexSeason() { - this.setData({ - indexHot: app.globalData.configJson.indexHot, - isTest: app.globalData.configJson.isTest, - otherPlat: app.globalData.configJson.otherPlats, - indexSeason: app.globalData.configJson.indexSeason - }) - this.getFourProduct() + if (app.globalData.configJson.indexSeason) { + this.setData({ + isTest: app.globalData.configJson.isTest, + otherPlat: app.globalData.configJson.otherPlats, + indexSeason: app.globalData.configJson.indexSeason + }) + } 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 + this.setData({ + isTest: app.globalData.configJson.isTest, + otherPlat: app.globalData.configJson.otherPlats, + indexSeason: app.globalData.configJson.indexSeason + }) + }) + } }, //关闭弹窗广告 closeAdv: function() { @@ -599,113 +498,9 @@ Page({ }) }) }, - saleDetail: function() {}, - getTwoProduct: function() { - // 获取首页限时特惠 - commonApi._post('act/fast_sale_now', { - offset: 0, - limit: 1 - }).then(res => { - if (res.data[0] && res.data[0].fast_sales_sku[0]) { - if (res.data[0].fast_sales_sku.length > 0) { - let price = res.data[0].fast_sales_sku[0].price - let data = res.data[0].fast_sales_sku[0] - for (let item of res.data[0].fast_sales_sku) { - if (price > item.price) price = item.price - } - data.price = price - this.setData({ - saleProduct: data - }) - } else { - this.setData({ - saleProduct: res.data[0].fast_sales_sku[0] - }) - } - } - }) - commonApi._post("product/get_product_by_tag", { - tag_id: 17, - offset: 0, - limit: 1, - sort: 'price', - order: 'asc' - }).then(res => { - if (res.data.list.length > 0) { - let price = res.data.list[0].price - for (let item of res.data.list) { - if (item.price > price) { - price = item.price - } - } - let data = res.data.list[0] - data.price = price - this.setData({ - roadProduct: data - }) - } else { - this.setData({ - roadProduct: [111] - }) - } - }) - }, - getFourProduct: function() { - let item = this.data.indexHot[this.data.hotIndex], - service = "product/get_product_by_tag", - data = { - tag_id: item.id, - offset: 0, - limit: 4, - sort: 'weight', - order: 'desc' - }; - if (item.type == 'scene') { - service = "scene/get_scene_by_tag"; - } else if (item.type == 'movie') { - service = "Cinema/getHotMovieList"; - data = { - page: 1, - pageSize: 4 - }; - } - commonApi._post(service, data).then(res => { - this.setData({ - fourProduct: res.data.list || res.data - }) - }) - }, - tagGotoDetail: function(e) { - let item = e.currentTarget.dataset.item; - if (this.data.indexHot[this.data.hotIndex].type == 'movie') { - // wx.navigateTo({ - // url: '/pages/list/movieticket/list/info/index?id=' + item.third_id + '&title=' + - // item.title, - // }) - util.goMovieDetail(item.third_id || item.id, item.title) - } else { - util.gotoDetail(item) - } - }, - productGotoDetail: function(e) { - let item = e.currentTarget.dataset.item; - util.gotoDetail(item) - }, gotoPath: function(e) { console.log(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 == '书香借阅') { wx.navigateToMiniProgram({ appId: 'wx165d4f1727f6bdb0', @@ -768,15 +563,6 @@ Page({ }) } }, - // 元旦 新品特惠部分 - goBanner: function(e) { - console.log('新品特惠', e.currentTarget.dataset.url); - let url = e.currentTarget.dataset.url; - app.globalData.weburl = url; - wx.navigateTo({ - url: "/pages/pbService/web/index?weburl=" + encodeURIComponent(url) - }) - }, gotoUrl: function(e) { console.log(e) if (e.currentTarget.dataset.event) { @@ -791,7 +577,7 @@ Page({ url: '/pages/pbService/web/index?weburl=' + encodeURIComponent(url), }) }, - // 实时路况跳转外链 + // 实时路况跳转外链 gotoUrls() { // 判断是否登录 var token = wx.getStorageSync("jstrip_token"), userId = wx.getStorageSync("jstrip_userid"); @@ -823,22 +609,7 @@ Page({ path: path }) }, - garbage: function() { - wx.navigateToMiniProgram({ - appId: 'wx13be821f3b1afed3', - path: 'pages/home/home' - }) - }, - gotoSku: function() { - commonApi.user_post("pbservice/Ztfw/sukangCode").then(res => { - console.log(res) - app.globalData.weburl = res.data.url; - wx.navigateTo({ - url: '/pages/pbService/web/index' - }) - return; - }) - }, + audioGuide: function() { wx.navigateToMiniProgram({ appId: 'wx74f380bc721a0379', @@ -872,12 +643,7 @@ Page({ util.gotoDetail(item.ext); } }, - meituan: function() { - wx.navigateToMiniProgram({ - appId: 'wxde8ac0a21135c07d', - 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; @@ -1006,14 +772,13 @@ Page({ commonApi._post("pbservice/Other/getClientConfig", { unique_key: "urltopage" }).then(res => { - let data = JSON.parse(res.data) - this.setData({ - urltopage: data - }) + let data = JSON.parse(res.data) + this.data.urltopage = data }) - // this.getTwoProduct() + this.getBanner() - this.getWeather() + this.getWeather() + this.getIndexSeason() }, @@ -1021,18 +786,7 @@ Page({ util.pagePoint(e, type) }, onShow: function() { - if (app.globalData.loadIndexSeason) { - this.getIndexSeason() - } else { - let t = setInterval(() => { - if (app.globalData.loadIndexSeason) { - this.getIndexSeason() - clearInterval(t) - t = null - } - }, 500) - } - + // this.getIndexSeason() this.pagePoint({ event: 'home_view' }, 1) diff --git a/pages/index/index.wxml b/pages/index/index.wxml index f3b737e..78bcb3b 100644 --- a/pages/index/index.wxml +++ b/pages/index/index.wxml @@ -1,21 +1,21 @@