|
|
|
@ -41,83 +41,85 @@ Page({ |
|
|
|
|
|
|
|
// banner上的金刚区
|
|
|
|
bannerDataList: [ |
|
|
|
{ |
|
|
|
title: "景点门票", |
|
|
|
img: "https://static.ticket.sz-trip.com/uploads/20250526/5934b8b77b058ce1de5943adbaf51739.png", |
|
|
|
path: "/pages/list/scene/index", |
|
|
|
}, |
|
|
|
{ |
|
|
|
title: "活动日历", |
|
|
|
img: "https://static.ticket.sz-trip.com/uploads/20250526/d75d7a3924d832912a2633ee29b30b9b.png", |
|
|
|
path: "/pages/list/activitynew/index", |
|
|
|
}, |
|
|
|
{ |
|
|
|
title: "匠意臻品", |
|
|
|
img: "https://static.ticket.sz-trip.com/uploads/20250526/69722050b638954e0b755a4d6c771d48.png", |
|
|
|
path: "/subPackages/techanNew/index", |
|
|
|
}, |
|
|
|
{ |
|
|
|
title: "领券中心", |
|
|
|
img: "https://static.ticket.sz-trip.com/uploads/20250526/4384a93f77d8faba5f504195c77e57c1.png", |
|
|
|
path: "/pages/list/scene/index", |
|
|
|
}, |
|
|
|
// {
|
|
|
|
// title: "景点门票",
|
|
|
|
// img: "https://static.ticket.sz-trip.com/uploads/20250526/5934b8b77b058ce1de5943adbaf51739.png",
|
|
|
|
// path: "/pages/list/scene/index",
|
|
|
|
// },
|
|
|
|
// {
|
|
|
|
// title: "活动日历",
|
|
|
|
// img: "https://static.ticket.sz-trip.com/uploads/20250526/d75d7a3924d832912a2633ee29b30b9b.png",
|
|
|
|
// path: "/pages/list/activitynew/index",
|
|
|
|
// },
|
|
|
|
// {
|
|
|
|
// title: "匠意臻品",
|
|
|
|
// img: "https://static.ticket.sz-trip.com/uploads/20250526/69722050b638954e0b755a4d6c771d48.png",
|
|
|
|
// path: "/subPackages/techanNew/index",
|
|
|
|
// },
|
|
|
|
// {
|
|
|
|
// title: "领券中心",
|
|
|
|
// img: "https://static.ticket.sz-trip.com/uploads/20250526/4384a93f77d8faba5f504195c77e57c1.png",
|
|
|
|
// path: "/pages/list/scene/index",
|
|
|
|
// },
|
|
|
|
], |
|
|
|
// 金刚区
|
|
|
|
mainTypeList: [ |
|
|
|
{ |
|
|
|
title: "非遗专卖", |
|
|
|
img: "https://static.ticket.sz-trip.com/uploads/20250526/a901ad572bda409e769f92760b812d71.png", |
|
|
|
path: "/subPackages/feiyiNew/index", |
|
|
|
}, |
|
|
|
{ |
|
|
|
title: "场馆预约", |
|
|
|
img: "https://static.ticket.sz-trip.com/uploads/20250526/a901ad572bda409e769f92760b812d71.png", |
|
|
|
path: "/pages/list/museum/index", |
|
|
|
}, |
|
|
|
{ |
|
|
|
title: "一日游", |
|
|
|
img: "https://static.ticket.sz-trip.com/uploads/20250526/a901ad572bda409e769f92760b812d71.png", |
|
|
|
weburl:"https://m.cloud.sz-trip.com/OneDayTravelNew", |
|
|
|
}, |
|
|
|
{ |
|
|
|
title: "户外游", |
|
|
|
img: "https://static.ticket.sz-trip.com/uploads/20250526/a901ad572bda409e769f92760b812d71.png", |
|
|
|
weburl:"https://m.cloud.sz-trip.com/LearningTravel", |
|
|
|
}, |
|
|
|
{ |
|
|
|
title: "电影购票", |
|
|
|
img: "https://static.ticket.sz-trip.com/uploads/20250526/a901ad572bda409e769f92760b812d71.png", |
|
|
|
weburl:"https://m.cloud.sz-trip.com/movies", |
|
|
|
}, |
|
|
|
{ |
|
|
|
type: 'hotel', // 特殊标识方便查找 更新weburl
|
|
|
|
title: "酒店住宿", |
|
|
|
img: "https://static.ticket.sz-trip.com/uploads/20250526/a901ad572bda409e769f92760b812d71.png", |
|
|
|
weburl: '', |
|
|
|
path: '/pages/list/hotel/index' |
|
|
|
}, |
|
|
|
{ |
|
|
|
title: "水上游", |
|
|
|
img: "https://static.ticket.sz-trip.com/uploads/20250526/a901ad572bda409e769f92760b812d71.png", |
|
|
|
path: '/pages/list/night/index' |
|
|
|
}, |
|
|
|
{ |
|
|
|
title: "剧场演出", |
|
|
|
img: "https://static.ticket.sz-trip.com/uploads/20250526/a901ad572bda409e769f92760b812d71.png", |
|
|
|
path: '/pages/list/theatre/index' |
|
|
|
}, |
|
|
|
// {
|
|
|
|
// title: "非遗专卖",
|
|
|
|
// img: "https://static.ticket.sz-trip.com/uploads/20250526/a901ad572bda409e769f92760b812d71.png",
|
|
|
|
// path: "/subPackages/feiyiNew/index",
|
|
|
|
// },
|
|
|
|
// {
|
|
|
|
// title: "场馆预约",
|
|
|
|
// img: "https://static.ticket.sz-trip.com/uploads/20250526/a901ad572bda409e769f92760b812d71.png",
|
|
|
|
// path: "/pages/list/museum/index",
|
|
|
|
// },
|
|
|
|
// {
|
|
|
|
// title: "一日游",
|
|
|
|
// img: "https://static.ticket.sz-trip.com/uploads/20250526/a901ad572bda409e769f92760b812d71.png",
|
|
|
|
// weburl:"https://m.cloud.sz-trip.com/OneDayTravelNew",
|
|
|
|
// },
|
|
|
|
// {
|
|
|
|
// title: "户外游",
|
|
|
|
// img: "https://static.ticket.sz-trip.com/uploads/20250526/a901ad572bda409e769f92760b812d71.png",
|
|
|
|
// weburl:"https://m.cloud.sz-trip.com/LearningTravel",
|
|
|
|
// },
|
|
|
|
// {
|
|
|
|
// title: "电影购票",
|
|
|
|
// img: "https://static.ticket.sz-trip.com/uploads/20250526/a901ad572bda409e769f92760b812d71.png",
|
|
|
|
// weburl:"https://m.cloud.sz-trip.com/movies",
|
|
|
|
// },
|
|
|
|
// {
|
|
|
|
// type: 'hotel', // 特殊标识方便查找 更新weburl
|
|
|
|
// title: "酒店住宿",
|
|
|
|
// img: "https://static.ticket.sz-trip.com/uploads/20250526/a901ad572bda409e769f92760b812d71.png",
|
|
|
|
// weburl: '',
|
|
|
|
// path: '/pages/list/hotel/index'
|
|
|
|
// },
|
|
|
|
// {
|
|
|
|
// title: "水上游",
|
|
|
|
// img: "https://static.ticket.sz-trip.com/uploads/20250526/a901ad572bda409e769f92760b812d71.png",
|
|
|
|
// path: '/pages/list/night/index'
|
|
|
|
// },
|
|
|
|
// {
|
|
|
|
// title: "剧场演出",
|
|
|
|
// img: "https://static.ticket.sz-trip.com/uploads/20250526/a901ad572bda409e769f92760b812d71.png",
|
|
|
|
// path: '/pages/list/theatre/index'
|
|
|
|
// },
|
|
|
|
], |
|
|
|
mainTypeLeft: 0, |
|
|
|
|
|
|
|
xpth: {}, // 新品特惠
|
|
|
|
XPathBannerIndex: 0, |
|
|
|
xpthIndex: 0, |
|
|
|
list: [], // 热门推荐
|
|
|
|
|
|
|
|
// 公共服务
|
|
|
|
publicSerivce: [ |
|
|
|
{ |
|
|
|
title: "高峰预警", |
|
|
|
img: "https://static.ticket.sz-trip.com/uploads/20250526/c7e28d88bde040c386183d69ae9bb228.png", |
|
|
|
weburl: "https://wlsjzx.zdhxwl.cn/kt_h5/index.html#/morecopy", |
|
|
|
path: "/pages/pbService/sceneComfort/index?title=高峰预警", |
|
|
|
eventName: "comfort_click", |
|
|
|
}, |
|
|
|
{ |
|
|
|
@ -200,17 +202,17 @@ Page({ |
|
|
|
}, |
|
|
|
{ |
|
|
|
title: "云上文博会", |
|
|
|
img: 'https://static.ticket.sz-trip.com/uploads/20250312.png', |
|
|
|
img: 'https://static.ticket.sz-trip.com/uploads/20250529/f45acb752680d1b4cce7d25da02c96f5.png', |
|
|
|
weburl: "https://m.cloud.sz-trip.com/CloudExpo", |
|
|
|
}, |
|
|
|
{ |
|
|
|
title: "精彩回顾", |
|
|
|
img: 'https://static.ticket.sz-trip.com/uploads/20250312/58d0fd32ea7521b0b1ea12bf5b593fe2.png', |
|
|
|
img: 'https://static.ticket.sz-trip.com/uploads/20250529/74bd8e6b027797a24fbfccaef5c836ad.png', |
|
|
|
path: "/pages/pbService/activity/index", |
|
|
|
}, |
|
|
|
{ |
|
|
|
title: "文化场馆查询", |
|
|
|
img: 'https://static.ticket.sz-trip.com/uploads/20250312/58d0fd32ea7521b0b1ea12bf5b593fe2.png', |
|
|
|
img: 'https://static.ticket.sz-trip.com/uploads/20250529/ff56544a00fb1cc78e0b307f16daa821.png', |
|
|
|
weburl: "https://m.cloud.sz-trip.com/Museum", |
|
|
|
}, |
|
|
|
{ |
|
|
|
@ -237,12 +239,12 @@ Page({ |
|
|
|
}, |
|
|
|
{ |
|
|
|
title: "云游苏州", |
|
|
|
img: 'https://static.ticket.sz-trip.com/uploads/20250312/58d0fd32ea7521b0b1ea12bf5b593fe2.png', |
|
|
|
img: 'https://static.ticket.sz-trip.com/uploads/20250529/f3b1ec60b5f069182faadf263ec9dfee.png', |
|
|
|
weburl: 'https://speed.web.yunyouyizhan.com/downloadApp/index.html#/', |
|
|
|
}, |
|
|
|
{ |
|
|
|
title: "美图鉴赏", |
|
|
|
img: 'https://static.ticket.sz-trip.com/uploads/20250312/58d0fd32ea7521b0b1ea12bf5b593fe2.png', |
|
|
|
img: 'https://static.ticket.sz-trip.com/uploads/20250529/820de8c4353bde80379f46e474104c04.png', |
|
|
|
path: "/pages/pbService/appreciate/index", |
|
|
|
|
|
|
|
}, |
|
|
|
@ -256,57 +258,57 @@ Page({ |
|
|
|
SQSM: [ |
|
|
|
{ |
|
|
|
title: "常熟", |
|
|
|
img: "https://static.ticket.sz-trip.com/uploads/20250312/3e4b8f20f9468cb4fd3f0c92d604db09.png", |
|
|
|
img: "https://static.ticket.sz-trip.com/uploads/20250529/ed641bf31558381e8d1c372e5cbbd155.png", |
|
|
|
appId: 'wx4df5fd9a6a5ea123', |
|
|
|
pagePath: 'pages/index' |
|
|
|
}, |
|
|
|
{ |
|
|
|
title: "太仓", |
|
|
|
img: "https://static.ticket.sz-trip.com/uploads/20250312/24fc48715691714988d5e0cf78e5a657.png", |
|
|
|
img: "https://static.ticket.sz-trip.com/uploads/20250529/f359551295197eff9c0966324659f037.png", |
|
|
|
appId: 'wx8853b0d93cbca75e', |
|
|
|
pagePath: 'pages/home/home' |
|
|
|
}, |
|
|
|
{ |
|
|
|
title: "昆山", |
|
|
|
img: "https://static.ticket.sz-trip.com/uploads/20250312/55b86da028a00326994ac8ebf10447b5.png", |
|
|
|
img: "https://static.ticket.sz-trip.com/uploads/20250529/35f498dbb43e14cdf3c6bbdf83e613db.png", |
|
|
|
appId: 'wx8888a3fd0862b4c8', |
|
|
|
pagePath: 'pages/index/index' |
|
|
|
}, |
|
|
|
{ |
|
|
|
title: "吴江", |
|
|
|
img: "https://static.ticket.sz-trip.com/uploads/20250312/aa60aec108158b47e0210b8b33c72fe5.png", |
|
|
|
img: "https://static.ticket.sz-trip.com/uploads/20250529/2288c75b3797363015bfe633ea9abc0e.png", |
|
|
|
appId: 'wx8eadea4ee2d42d4b', |
|
|
|
pagePath: 'pages/index/index' |
|
|
|
}, |
|
|
|
{ |
|
|
|
title: "工业园区", |
|
|
|
img: "https://static.ticket.sz-trip.com/uploads/20250312/4fdd5f3e9f63421d4394f2c3b3a0c7a4.png", |
|
|
|
img: "https://static.ticket.sz-trip.com/uploads/20250529/9e947f0ef8addbe5c52b5bd4de205788.png", |
|
|
|
appId: 'wxd323e63a10aa6865', |
|
|
|
pagePath: 'pages/home/index' |
|
|
|
}, |
|
|
|
{ |
|
|
|
title: "张家港", |
|
|
|
img: "https://static.ticket.sz-trip.com/uploads/20250312/bb32450e448ec520c90241556a68c092.png", |
|
|
|
img: "https://static.ticket.sz-trip.com/uploads/20250529/6162e0a86ec7e7b12e568fd5f81b5c9b.png", |
|
|
|
path: "/pages/list/six/index?area=zhangjiagang" |
|
|
|
}, |
|
|
|
{ |
|
|
|
title: "吴中", |
|
|
|
img: "https://static.ticket.sz-trip.com/uploads/20250312/cea52b2c0f3c18762d7feea2ba987e63.png", |
|
|
|
img: "https://static.ticket.sz-trip.com/uploads/20250529/36fc77bf5d6879e6ce06ae349187c2ad.png", |
|
|
|
path: "/pages/list/six/index?area=wuzhong" |
|
|
|
}, |
|
|
|
{ |
|
|
|
title: "相城", |
|
|
|
img: "https://static.ticket.sz-trip.com/uploads/20250312/ef29b1cbdd9b33919891732750f72f2a.png", |
|
|
|
img: "https://static.ticket.sz-trip.com/uploads/20250529/ec54fba906166c7512d26ca8a4fa5a9f.png", |
|
|
|
path: "/pages/list/six/index?area=xiangcheng" |
|
|
|
}, |
|
|
|
{ |
|
|
|
title: "姑苏", |
|
|
|
img: "https://static.ticket.sz-trip.com/uploads/20250312/8de375c2fc322cb44d7e0cdb84c97cfe.png", |
|
|
|
img: "https://static.ticket.sz-trip.com/uploads/20250529/cbb939c4ddfa187489b59adcbe72f7a9.png", |
|
|
|
path: "/pages/list/six/index?area=gusu" |
|
|
|
}, |
|
|
|
{ |
|
|
|
title: "高新", |
|
|
|
img: "https://static.ticket.sz-trip.com/uploads/20250312/96a0c3631a0b3a9d5836943663a2f5c5.png", |
|
|
|
img: "https://static.ticket.sz-trip.com/uploads/20250529/f2aa7328af4afaa9d1d4ecac1778300a.png", |
|
|
|
path: "/pages/list/six/index?area=gaoxin" |
|
|
|
}, |
|
|
|
|
|
|
|
@ -345,16 +347,9 @@ Page({ |
|
|
|
|
|
|
|
], |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
saleProduct: null, |
|
|
|
roadProduct: null, |
|
|
|
|
|
|
|
month: "", |
|
|
|
months: ['JAN', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'oct', 'nov', 'dec'], |
|
|
|
date: "", |
|
|
|
list: [], |
|
|
|
listMore: true, |
|
|
|
// 回购榜
|
|
|
|
repurchaseList: [], |
|
|
|
canGetrepurchase: true, |
|
|
|
|
|
|
|
urltopage: {}, |
|
|
|
|
|
|
|
@ -386,15 +381,6 @@ Page({ |
|
|
|
return |
|
|
|
console.log('options',options) |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// 获取今天的日期
|
|
|
|
let today = new Date(); |
|
|
|
this.setData({ |
|
|
|
month: (this.data.months[today.getMonth()]).toUpperCase(), |
|
|
|
date: today.getDate() |
|
|
|
}) |
|
|
|
|
|
|
|
}, |
|
|
|
|
|
|
|
onReady: function() { |
|
|
|
@ -403,7 +389,6 @@ Page({ |
|
|
|
this.getBanner() |
|
|
|
|
|
|
|
this.getXpthList() // 限时特惠
|
|
|
|
this.getTwoProduct() |
|
|
|
|
|
|
|
this.getList() // 回购榜
|
|
|
|
// this.getWeather() // 2025-5-26首页改版不需要天气了
|
|
|
|
@ -416,10 +401,8 @@ Page({ |
|
|
|
lat: res.latitude, |
|
|
|
lon: res.longitude |
|
|
|
}) |
|
|
|
// this.getList() // 2025不需要经纬度了
|
|
|
|
}, |
|
|
|
fail: (err) => { |
|
|
|
// this.getList()
|
|
|
|
} |
|
|
|
}) |
|
|
|
|
|
|
|
@ -427,6 +410,17 @@ Page({ |
|
|
|
|
|
|
|
|
|
|
|
}, |
|
|
|
|
|
|
|
showImg (img) { |
|
|
|
if (!img) { return img } |
|
|
|
if (img.indexOf('https://') != -1 || img.indexOf('http://') != -1) { |
|
|
|
return img; |
|
|
|
} else { |
|
|
|
// return "https://test.api.cloud.sz-trip.com"+img
|
|
|
|
return "https://static.ticket.sz-trip.com" + img; |
|
|
|
} |
|
|
|
}, |
|
|
|
|
|
|
|
// 获取系统信息
|
|
|
|
getHeight() { |
|
|
|
let systemInfo = wx.getSystemInfoSync(), |
|
|
|
@ -443,12 +437,8 @@ Page({ |
|
|
|
}, |
|
|
|
//获取季节配置
|
|
|
|
getIndexSeason() { |
|
|
|
let mainTypeList = this.data.mainTypeList |
|
|
|
let hotelData = mainTypeList.find(v=>v.type == "hotel") |
|
|
|
|
|
|
|
if (app.globalData.configJson&&app.globalData.configJson.indexSeason) { |
|
|
|
console.log('app', app.globalData.configJson) |
|
|
|
hotelData.weburl = app.globalData.configJson.hotelUrl |
|
|
|
this.setData({ |
|
|
|
indexHot: app.globalData.configJson.indexHot, |
|
|
|
isTest: app.globalData.configJson.isTest, |
|
|
|
@ -457,24 +447,32 @@ Page({ |
|
|
|
indexSeason: app.globalData.configJson.indexSeason, |
|
|
|
// 开发数据
|
|
|
|
// indexSeason: imageSource.testImgs.indexSeason,
|
|
|
|
mainTypeList: mainTypeList |
|
|
|
bannerDataList: (app.globalData.configJson.nav_menu || []), |
|
|
|
mainTypeList: (app.globalData.configJson.menu_button || []), |
|
|
|
}) |
|
|
|
} else { |
|
|
|
commonApi._post("adv/get_home_ui", {type_id: 3}).then(res => { |
|
|
|
let obj = {} |
|
|
|
res.data.content.forEach(item => { |
|
|
|
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 |
|
|
|
app.globalData.configJson.nav_menu = (res.data.nav_menu || []).map(v=>{ |
|
|
|
return {...v, icon:this.showImg(v.icon)} |
|
|
|
}) |
|
|
|
app.globalData.configJson.menu_button = (res.data.menu_button || []).map(v=>{ |
|
|
|
return {...v, icon:this.showImg(v.icon)} |
|
|
|
}) |
|
|
|
|
|
|
|
console.log('webData', app.globalData.configJson) |
|
|
|
this.setData({ |
|
|
|
indexHot: app.globalData.configJson.indexHot, |
|
|
|
isTest: app.globalData.configJson.isTest, |
|
|
|
// otherPlat: app.globalData.configJson.otherPlats,
|
|
|
|
indexSeason: app.globalData.configJson.indexSeason, |
|
|
|
mainTypeList: mainTypeList |
|
|
|
bannerDataList: (app.globalData.configJson.nav_menu || []), |
|
|
|
mainTypeList: (app.globalData.configJson.menu_button || []), |
|
|
|
}) |
|
|
|
}) |
|
|
|
} |
|
|
|
@ -679,7 +677,25 @@ Page({ |
|
|
|
} |
|
|
|
|
|
|
|
}, |
|
|
|
// 后台配置数据的跳转
|
|
|
|
// 后台配置数据跳转
|
|
|
|
mainNavClick:function (e) { |
|
|
|
let item = e.currentTarget.dataset.item |
|
|
|
console.log(item) |
|
|
|
if (item.jump_type == "page") { |
|
|
|
wx.navigateTo({ |
|
|
|
url: item.page.mini, |
|
|
|
}) |
|
|
|
return |
|
|
|
} |
|
|
|
if (item.jump_type == "link") { |
|
|
|
wx.navigateTo({ |
|
|
|
url: "/pages/pbService/web/index?weburl=" + encodeURIComponent(item.url), |
|
|
|
}) |
|
|
|
return |
|
|
|
} |
|
|
|
}, |
|
|
|
|
|
|
|
// 其他平台配置数据的跳转
|
|
|
|
gotoOther: function(e) { |
|
|
|
let item = e.currentTarget.dataset.item; |
|
|
|
if (item.type == 'h5') { |
|
|
|
@ -725,117 +741,42 @@ Page({ |
|
|
|
let value = e.currentTarget.dataset.value |
|
|
|
this.setData({xpthIndex:value}) |
|
|
|
}, |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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] |
|
|
|
}) |
|
|
|
} |
|
|
|
}) |
|
|
|
}, |
|
|
|
|
|
|
|
|
|
|
|
productGotoDetail: function(e) { |
|
|
|
let item = e.currentTarget.dataset.item; |
|
|
|
util.gotoDetail(item) |
|
|
|
}, |
|
|
|
|
|
|
|
// 热门推荐 去掉经纬度 接口排序方式变更(韩阳)
|
|
|
|
// 热门推荐
|
|
|
|
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) |
|
|
|
commonApi._post("product/get_product_by_tag_subject", { |
|
|
|
tag_id: 85,offset: 0,limit: 5, |
|
|
|
}).then(res=>{ |
|
|
|
this.setData({ list: res.data.list || []}) |
|
|
|
}) |
|
|
|
}, |
|
|
|
// 回购
|
|
|
|
getRepurchaseList:function () { |
|
|
|
commonApi._post("repurchase/repurchase/getRepurchaseList", {}).then(res=>{ |
|
|
|
(res.data || []).forEach(v=>v.headimg = this.showImg(v.headimg)) |
|
|
|
this.setData({ repurchaseList: res.data || []}) |
|
|
|
}) |
|
|
|
}, |
|
|
|
onReachBottom: function() { |
|
|
|
if (this.data.list.length < 30) { |
|
|
|
this.getList() |
|
|
|
// if (this.data.list.length < 30) {
|
|
|
|
// this.getList()
|
|
|
|
// }
|
|
|
|
if (this.data.canGetrepurchase) { |
|
|
|
this.data.canGetrepurchase = false |
|
|
|
this.getRepurchaseList() |
|
|
|
} |
|
|
|
}, |
|
|
|
gotoDetail: function(e) { |
|
|
|
let item = e.currentTarget.dataset.item; |
|
|
|
util.pagePoint({ |
|
|
|
event: 'recommend_click', |
|
|
|
param: { |
|
|
|
id: item.id, |
|
|
|
type: item.type |
|
|
|
} |
|
|
|
}, 1) |
|
|
|
if (item.type == 'travels') { |
|
|
|
// 游记做特殊处理 其他都按照原来的来
|
|
|
|
wx.navigateTo({ |
|
|
|
url: '/pages/info/strategyInfo/index?id=' + item.s_id, |
|
|
|
}) |
|
|
|
} else { |
|
|
|
util.gotoDetail(item.ext); |
|
|
|
} |
|
|
|
}, |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
commonApi._post("repurchase/repurchase/recordClick", {product_id:item.product_id}) |
|
|
|
item.id = item.type=='post'?item.product_id:item.scene_id |
|
|
|
util.gotoDetail(item); |
|
|
|
|
|
|
|
}, |
|
|
|
|
|
|
|
pagePoint: function(e, type) { |
|
|
|
util.pagePoint(e, type) |
|
|
|
|