|
|
@ -17,7 +17,8 @@ Page({ |
|
|
areaIndex:0, |
|
|
areaIndex:0, |
|
|
latitude:"", |
|
|
latitude:"", |
|
|
longitude:"", |
|
|
longitude:"", |
|
|
type:0, |
|
|
// type:0,
|
|
|
|
|
|
type:1, // 改为默认选中第一个类型:景点
|
|
|
keywords:"", |
|
|
keywords:"", |
|
|
list:[], |
|
|
list:[], |
|
|
showInfo:false, |
|
|
showInfo:false, |
|
|
@ -27,7 +28,14 @@ Page({ |
|
|
productList:[], |
|
|
productList:[], |
|
|
productPage:1, |
|
|
productPage:1, |
|
|
productTotal:1, |
|
|
productTotal:1, |
|
|
timeList:{} |
|
|
timeList:{}, |
|
|
|
|
|
showMore:'close', |
|
|
|
|
|
scrollLeft: 0, |
|
|
|
|
|
}, |
|
|
|
|
|
listenScroll(e) { |
|
|
|
|
|
this.setData({ |
|
|
|
|
|
scrollLeft: e.detail.scrollLeft |
|
|
|
|
|
}) |
|
|
}, |
|
|
}, |
|
|
|
|
|
|
|
|
/** |
|
|
/** |
|
|
@ -67,6 +75,17 @@ Page({ |
|
|
|
|
|
|
|
|
}) |
|
|
}) |
|
|
}, |
|
|
}, |
|
|
|
|
|
changeClose() { |
|
|
|
|
|
this.setData({ |
|
|
|
|
|
showMore:'close' |
|
|
|
|
|
}) |
|
|
|
|
|
}, |
|
|
|
|
|
changeShow() { |
|
|
|
|
|
this.setData({ |
|
|
|
|
|
showMore:'open' |
|
|
|
|
|
}) |
|
|
|
|
|
console.log(this.data.showMore); |
|
|
|
|
|
}, |
|
|
getIsTest(){ |
|
|
getIsTest(){ |
|
|
if(app.globalData.configJson){ |
|
|
if(app.globalData.configJson){ |
|
|
this.setData({ |
|
|
this.setData({ |
|
|
@ -97,6 +116,12 @@ Page({ |
|
|
url: '/pages/info/redmapInfo/index?id='+this.data.info.info.id, |
|
|
url: '/pages/info/redmapInfo/index?id='+this.data.info.info.id, |
|
|
}) |
|
|
}) |
|
|
} |
|
|
} |
|
|
|
|
|
else if(this.data.info.info.type=='luggage'){ |
|
|
|
|
|
// 行李寄存
|
|
|
|
|
|
wx.navigateTo({ |
|
|
|
|
|
url: '/pages/info/luggageInfo/index?id='+this.data.info.info.id, |
|
|
|
|
|
}) |
|
|
|
|
|
} |
|
|
else if(this.data.info.info.type=='restaurant' || this.data.info.info.type=='tenscenic'){ |
|
|
else if(this.data.info.info.type=='restaurant' || this.data.info.info.type=='tenscenic'){ |
|
|
wx.navigateTo({ |
|
|
wx.navigateTo({ |
|
|
url: '/pages/info/foodInfo/index?id='+this.data.info.info.id, |
|
|
url: '/pages/info/foodInfo/index?id='+this.data.info.info.id, |
|
|
@ -112,9 +137,97 @@ Page({ |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
}, |
|
|
}, |
|
|
|
|
|
goAddress(e) { |
|
|
|
|
|
let item = e.currentTarget.dataset.item; |
|
|
|
|
|
wx.showModal({ |
|
|
|
|
|
title:'到这去', |
|
|
|
|
|
content:item.info.showContent?item.info.showContent:item.info.title, |
|
|
|
|
|
success:function(res){ |
|
|
|
|
|
if(res.confirm){ |
|
|
|
|
|
wx.openLocation({ |
|
|
|
|
|
latitude: item.latitude, |
|
|
|
|
|
longitude: item.longitude, |
|
|
|
|
|
}) |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
|
|
|
}) |
|
|
|
|
|
}, |
|
|
onTapMarker:function(e){ |
|
|
onTapMarker:function(e){ |
|
|
console.log(e) |
|
|
console.log(e) |
|
|
|
|
|
console.log(this.data.list,this.data.list.length); |
|
|
let info = this.data.list[e.detail.markerId]; |
|
|
let info = this.data.list[e.detail.markerId]; |
|
|
|
|
|
let list = []; |
|
|
|
|
|
this.data.list.map((item,itemIndex)=>{ |
|
|
|
|
|
let mapItem = item; |
|
|
|
|
|
if (itemIndex == e.detail.markerId) { |
|
|
|
|
|
mapItem.width = 30; |
|
|
|
|
|
mapItem.height=36; |
|
|
|
|
|
if (mapItem.info.type == "scenic") { |
|
|
|
|
|
mapItem.iconPath = "https://static.ticket.sz-trip.com/uploads/20240125/4b340f512e8e424cb70ef766ad35cddb.png"; |
|
|
|
|
|
}else if (mapItem.info.type=='venue') { |
|
|
|
|
|
mapItem.iconPath = "https://static.ticket.sz-trip.com/uploads/20240125/ff2d05414295b5e987c3fdc7373c5f38.png"; |
|
|
|
|
|
}else if (mapItem.info.type=='room') { |
|
|
|
|
|
mapItem.iconPath = "https://static.ticket.sz-trip.com/uploads/20240125/fc2e8f86ad4977f08e7fe6284f946cb9.png"; |
|
|
|
|
|
}else if (mapItem.info.type=='publicBycicle') { |
|
|
|
|
|
mapItem.iconPath = "https://static.ticket.sz-trip.com/uploads/20240125/1c35ea03927638d3d6fef7f15f92d67d.png"; |
|
|
|
|
|
}else if (mapItem.info.type=='restaurant') { |
|
|
|
|
|
mapItem.iconPath = "https://static.ticket.sz-trip.com/uploads/20240125/4239b516f5ba99bff0b892a25a96c762.png"; |
|
|
|
|
|
}else if (mapItem.info.type=='relic') { |
|
|
|
|
|
mapItem.iconPath = "https://static.ticket.sz-trip.com/uploads/20240125/ae03ad079e3e667e84b4e49e498c77a9.png"; |
|
|
|
|
|
}else if (mapItem.info.type=='tenscenic') { |
|
|
|
|
|
mapItem.iconPath = "https://static.ticket.sz-trip.com/uploads/20240125/15f025534e644799f8c7cae6efee732f.png"; |
|
|
|
|
|
}else if (mapItem.info.type=='academes') { |
|
|
|
|
|
mapItem.iconPath = "https://static.ticket.sz-trip.com/uploads/20240125/63e375cd4227fe6a58ef4eef85c38e4c.png"; |
|
|
|
|
|
}else if (mapItem.info.type=='park') { |
|
|
|
|
|
mapItem.iconPath = "https://static.ticket.sz-trip.com/uploads/20240125/82218d810a22ea254afdf2a089cfd0a7.png"; |
|
|
|
|
|
}else if (mapItem.info.type=='luggage') { |
|
|
|
|
|
mapItem.iconPath = "https://static.ticket.sz-trip.com/uploads/20240125/d73376830530e13963ccc3211480f975.png"; |
|
|
|
|
|
}else if (mapItem.info.type=='tourist') { |
|
|
|
|
|
mapItem.iconPath = "https://static.ticket.sz-trip.com/uploads/20240125/eeb6894d312a6fd0b771623a2db6120c.png"; |
|
|
|
|
|
}else if (mapItem.info.type=='post') { |
|
|
|
|
|
mapItem.iconPath = "https://static.ticket.sz-trip.com/uploads/20240125/2594df53aad900e56173eb024786379c.png"; |
|
|
|
|
|
} else { |
|
|
|
|
|
mapItem.iconPath = "https://static.ticket.sz-trip.com/uploads/20240125/27517eb0968079bbeadb3b6438d3fbf3.png"; |
|
|
|
|
|
} |
|
|
|
|
|
}else { |
|
|
|
|
|
mapItem.width = 20; |
|
|
|
|
|
mapItem.height=23; |
|
|
|
|
|
if (mapItem.info.type == "scenic") { |
|
|
|
|
|
mapItem.iconPath = "https://static.ticket.sz-trip.com/uploads/20240124/c59dc041fcfd8b7a62ad2ac2444adcda.png"; |
|
|
|
|
|
}else if (mapItem.info.type=='venue') { |
|
|
|
|
|
mapItem.iconPath = "https://static.ticket.sz-trip.com/uploads/20240124/04aedae4dc498d45267f3636d5524af6.png"; |
|
|
|
|
|
}else if (mapItem.info.type=='room') { |
|
|
|
|
|
mapItem.iconPath = "https://static.ticket.sz-trip.com/uploads/20240124/78ff8b94929d18dc6349a3482069b756.png"; |
|
|
|
|
|
}else if (mapItem.info.type=='publicBycicle') { |
|
|
|
|
|
mapItem.iconPath = "https://static.ticket.sz-trip.com/uploads/20240124/6ce2b9e6eda6f8a3fea5073d5d5ad19a.png"; |
|
|
|
|
|
}else if (mapItem.info.type=='restaurant') { |
|
|
|
|
|
mapItem.iconPath = "https://static.ticket.sz-trip.com/uploads/20240124/3f5bdfd0f0c81e2263bc3999291bec8f.png"; |
|
|
|
|
|
}else if (mapItem.info.type=='relic') { |
|
|
|
|
|
mapItem.iconPath = "https://static.ticket.sz-trip.com/uploads/20240124/dfb34899466e98e1f2e02a40175a7672.png"; |
|
|
|
|
|
}else if (mapItem.info.type=='tenscenic') { |
|
|
|
|
|
mapItem.iconPath = "https://static.ticket.sz-trip.com/uploads/20240124/f77236d6a84b8d28027417aa8ef60c96.png"; |
|
|
|
|
|
}else if (mapItem.info.type=='academes') { |
|
|
|
|
|
mapItem.iconPath = "https://static.ticket.sz-trip.com/uploads/20240124/44da805692924852614afb013479e917.png"; |
|
|
|
|
|
}else if (mapItem.info.type=='park') { |
|
|
|
|
|
mapItem.iconPath = "https://static.ticket.sz-trip.com/uploads/20240124/0b95fda240aa4f5eb89667188cfa1517.png"; |
|
|
|
|
|
}else if (mapItem.info.type=='luggage') { |
|
|
|
|
|
mapItem.iconPath = "https://static.ticket.sz-trip.com/uploads/20240124/6ba1e554b71f451a120217c029fe1877.png"; |
|
|
|
|
|
}else if (mapItem.info.type=='tourist') { |
|
|
|
|
|
mapItem.iconPath = "https://static.ticket.sz-trip.com/uploads/20240124/24fba3a917652e1bdfe31d5785dba09f.png"; |
|
|
|
|
|
}else if (mapItem.info.type=='post') { |
|
|
|
|
|
mapItem.iconPath = "https://static.ticket.sz-trip.com/uploads/20240124/754a384e8aacd4a1ea41007e79910c67.png"; |
|
|
|
|
|
} else { |
|
|
|
|
|
mapItem.iconPath = "https://static.ticket.sz-trip.com/uploads/20240124/2d61b60609564fc48e38768fbef87c0a.png"; |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
|
|
|
if(mapItem.latitude<40){ |
|
|
|
|
|
list.push(mapItem) |
|
|
|
|
|
} |
|
|
|
|
|
}) |
|
|
|
|
|
this.setData({ |
|
|
|
|
|
list:list |
|
|
|
|
|
}) |
|
|
|
|
|
console.log('换完图标后的list',list); |
|
|
if(info.info.type=='tenscenic'){ |
|
|
if(info.info.type=='tenscenic'){ |
|
|
// 运河十景需要先获取景点详情
|
|
|
// 运河十景需要先获取景点详情
|
|
|
commonApi._post("scene/detail",{ |
|
|
commonApi._post("scene/detail",{ |
|
|
@ -219,12 +332,19 @@ Page({ |
|
|
this.getProductList() |
|
|
this.getProductList() |
|
|
}) |
|
|
}) |
|
|
return; |
|
|
return; |
|
|
|
|
|
}else if (info.info.type=='publicBycicle' || info.info.type=='park') { |
|
|
|
|
|
console.log(e) |
|
|
|
|
|
let index = e.detail.markerId,list = this.data.list; |
|
|
|
|
|
let item = list[index]; |
|
|
|
|
|
} else { |
|
|
|
|
|
|
|
|
} |
|
|
} |
|
|
this.setData({ |
|
|
this.setData({ |
|
|
info:info, |
|
|
info:info, |
|
|
showInfo:true, |
|
|
showInfo:true, |
|
|
showAllMask:false |
|
|
showAllMask:false |
|
|
}) |
|
|
}) |
|
|
|
|
|
console.log('打印',this.data.info); |
|
|
}, |
|
|
}, |
|
|
changeMenu:function(e){ |
|
|
changeMenu:function(e){ |
|
|
let index = e.currentTarget.dataset.index; |
|
|
let index = e.currentTarget.dataset.index; |
|
|
@ -424,11 +544,71 @@ Page({ |
|
|
}, |
|
|
}, |
|
|
changeRegion:function(e){ |
|
|
changeRegion:function(e){ |
|
|
console.log(e) |
|
|
console.log(e) |
|
|
|
|
|
if(e.type!='end') return; |
|
|
|
|
|
console.log(e.detail.centerLocation) |
|
|
|
|
|
this.setData(e.detail.centerLocation) |
|
|
this.getList() |
|
|
this.getList() |
|
|
}, |
|
|
}, |
|
|
getList:function(){ |
|
|
getList:function(){ |
|
|
|
|
|
// this.setData({
|
|
|
|
|
|
// list:[]
|
|
|
|
|
|
// })
|
|
|
this.mapCtx = wx.createMapContext("map"); |
|
|
this.mapCtx = wx.createMapContext("map"); |
|
|
let types = ['','scenic','venue','post','restaurant','relic','tenscenic','cinema','academes','red_map'],that = this; |
|
|
// let types = ['','scenic','venue','post','restaurant','relic','tenscenic','cinema','academes','red_map'],that = this;
|
|
|
|
|
|
let types = ['','scenic','venue','room','publicBycicle','restaurant','relic','tenscenic','academes','park','luggage','tourist','post','red_map'],that = this; |
|
|
|
|
|
if (types[that.data.type] == 'publicBycicle') { |
|
|
|
|
|
commonApi.user_post("pbservice/Ztfw/publicBycicle",{ |
|
|
|
|
|
point_type:"gaode", |
|
|
|
|
|
lat:this.data.latitude, |
|
|
|
|
|
lon:this.data.longitude |
|
|
|
|
|
}).then(res=>{ |
|
|
|
|
|
let list = []; |
|
|
|
|
|
res.data.map((item,index)=>{ |
|
|
|
|
|
let mapItem = {}; |
|
|
|
|
|
item.showContent = item.name + "(" + item.address + ")"; |
|
|
|
|
|
mapItem.latitude = Number(item.lat); |
|
|
|
|
|
mapItem.longitude = Number(item.lng); |
|
|
|
|
|
mapItem.id = index; |
|
|
|
|
|
mapItem.info = item; |
|
|
|
|
|
mapItem.info.type = 'publicBycicle'; |
|
|
|
|
|
mapItem.width = 20; |
|
|
|
|
|
mapItem.height=23; |
|
|
|
|
|
mapItem.iconPath = "https://static.ticket.sz-trip.com/uploads/20240124/6ce2b9e6eda6f8a3fea5073d5d5ad19a.png"; |
|
|
|
|
|
if(mapItem.latitude<40){ |
|
|
|
|
|
list.push(mapItem) |
|
|
|
|
|
} |
|
|
|
|
|
}) |
|
|
|
|
|
this.setData({ |
|
|
|
|
|
list:list |
|
|
|
|
|
}) |
|
|
|
|
|
}) |
|
|
|
|
|
} else if (types[that.data.type] == 'park') { |
|
|
|
|
|
commonApi.user_post("pbservice/Ztfw/park_new",{ |
|
|
|
|
|
point_type:"gaode", |
|
|
|
|
|
lat:this.data.latitude, |
|
|
|
|
|
lon:this.data.longitude |
|
|
|
|
|
}).then(res=>{ |
|
|
|
|
|
let list = []; |
|
|
|
|
|
res.data.map((item,index)=>{ |
|
|
|
|
|
let mapItem = {}; |
|
|
|
|
|
item.showContent = item.name + "(" + item.address + ")"; |
|
|
|
|
|
mapItem.latitude = Number(item.lat); |
|
|
|
|
|
mapItem.longitude = Number(item.lng); |
|
|
|
|
|
mapItem.id = index; |
|
|
|
|
|
mapItem.info = item; |
|
|
|
|
|
mapItem.info.type = 'park'; |
|
|
|
|
|
mapItem.width = 20; |
|
|
|
|
|
mapItem.height=23; |
|
|
|
|
|
mapItem.iconPath = "https://static.ticket.sz-trip.com/uploads/20240124/0b95fda240aa4f5eb89667188cfa1517.png"; |
|
|
|
|
|
if(mapItem.latitude<40){ |
|
|
|
|
|
list.push(mapItem) |
|
|
|
|
|
} |
|
|
|
|
|
}) |
|
|
|
|
|
this.setData({ |
|
|
|
|
|
list:list |
|
|
|
|
|
}) |
|
|
|
|
|
}) |
|
|
|
|
|
} else { |
|
|
this.mapCtx.getRegion({ |
|
|
this.mapCtx.getRegion({ |
|
|
type: 'gcj02', |
|
|
type: 'gcj02', |
|
|
success: function(res) { |
|
|
success: function(res) { |
|
|
@ -449,11 +629,28 @@ Page({ |
|
|
mapItem.longitude = Number(item.lon); |
|
|
mapItem.longitude = Number(item.lon); |
|
|
mapItem.id = index; |
|
|
mapItem.id = index; |
|
|
mapItem.info = item; |
|
|
mapItem.info = item; |
|
|
if(item.type=='red_map'){ |
|
|
if(item.type=='scenic'){ |
|
|
mapItem.iconPath = "https://static.ticket.sz-trip.com/uploads/20230506/054cea53a068545e9e27fa9cd3acbdec.png"; |
|
|
mapItem.iconPath = "https://static.ticket.sz-trip.com/uploads/20240124/c59dc041fcfd8b7a62ad2ac2444adcda.png"; |
|
|
} |
|
|
}else if (item.type=='venue') { |
|
|
else { |
|
|
mapItem.iconPath = "https://static.ticket.sz-trip.com/uploads/20240124/04aedae4dc498d45267f3636d5524af6.png"; |
|
|
mapItem.iconPath = "https://static.ticket.sz-trip.com/xcxImages/map/"+item.type+".png"; |
|
|
}else if (item.type=='room') { |
|
|
|
|
|
mapItem.iconPath = "https://static.ticket.sz-trip.com/uploads/20240124/78ff8b94929d18dc6349a3482069b756.png"; |
|
|
|
|
|
}else if (item.type=='restaurant') { |
|
|
|
|
|
mapItem.iconPath = "https://static.ticket.sz-trip.com/uploads/20240124/3f5bdfd0f0c81e2263bc3999291bec8f.png"; |
|
|
|
|
|
}else if (item.type=='relic') { |
|
|
|
|
|
mapItem.iconPath = "https://static.ticket.sz-trip.com/uploads/20240124/dfb34899466e98e1f2e02a40175a7672.png"; |
|
|
|
|
|
}else if (item.type=='tenscenic') { |
|
|
|
|
|
mapItem.iconPath = "https://static.ticket.sz-trip.com/uploads/20240124/f77236d6a84b8d28027417aa8ef60c96.png"; |
|
|
|
|
|
}else if (item.type=='academes') { |
|
|
|
|
|
mapItem.iconPath = "https://static.ticket.sz-trip.com/uploads/20240124/44da805692924852614afb013479e917.png"; |
|
|
|
|
|
}else if (item.type=='luggage') { |
|
|
|
|
|
mapItem.iconPath = "https://static.ticket.sz-trip.com/uploads/20240124/6ba1e554b71f451a120217c029fe1877.png"; |
|
|
|
|
|
}else if (item.type=='tourist') { |
|
|
|
|
|
mapItem.iconPath = "https://static.ticket.sz-trip.com/uploads/20240124/24fba3a917652e1bdfe31d5785dba09f.png"; |
|
|
|
|
|
}else if (item.type=='post') { |
|
|
|
|
|
mapItem.iconPath = "https://static.ticket.sz-trip.com/uploads/20240124/754a384e8aacd4a1ea41007e79910c67.png"; |
|
|
|
|
|
} else { |
|
|
|
|
|
mapItem.iconPath = "https://static.ticket.sz-trip.com/uploads/20240124/2d61b60609564fc48e38768fbef87c0a.png"; |
|
|
} |
|
|
} |
|
|
mapItem.width = 20; |
|
|
mapItem.width = 20; |
|
|
mapItem.height=23; |
|
|
mapItem.height=23; |
|
|
@ -465,15 +662,55 @@ Page({ |
|
|
list:list |
|
|
list:list |
|
|
}) |
|
|
}) |
|
|
}) |
|
|
}) |
|
|
// that.mapCtx.getRegion({
|
|
|
} |
|
|
// success:function(r){
|
|
|
}) |
|
|
// let location = r.longitude+","+r.latitude;
|
|
|
} |
|
|
|
|
|
console.log('list',this.data.list); |
|
|
|
|
|
// this.mapCtx.getRegion({
|
|
|
|
|
|
// type: 'gcj02',
|
|
|
|
|
|
// success: function(res) {
|
|
|
|
|
|
// commonApi._post("act/map_travel",{
|
|
|
|
|
|
// type:types[that.data.type],
|
|
|
|
|
|
// title:that.data.keywords,
|
|
|
|
|
|
// m_lon:res.southwest.longitude-0.05,
|
|
|
|
|
|
// l_lon:res.northeast.longitude+0.05,
|
|
|
|
|
|
// m_lat:res.southwest.latitude-0.05,
|
|
|
|
|
|
// l_lat:res.northeast.latitude+0.05
|
|
|
|
|
|
// }).then(res=>{
|
|
|
|
|
|
// let list = [];
|
|
|
|
|
|
// res.data.map((item,index)=>{
|
|
|
|
|
|
// let mapItem = {};
|
|
|
|
|
|
// item.lat = item.tx_lat;
|
|
|
|
|
|
// item.lon = item.tx_lon;
|
|
|
|
|
|
// mapItem.latitude = Number(item.lat);
|
|
|
|
|
|
// mapItem.longitude = Number(item.lon);
|
|
|
|
|
|
// mapItem.id = index;
|
|
|
|
|
|
// mapItem.info = item;
|
|
|
|
|
|
// if(item.type=='red_map'){
|
|
|
|
|
|
// mapItem.iconPath = "https://static.ticket.sz-trip.com/uploads/20230506/054cea53a068545e9e27fa9cd3acbdec.png";
|
|
|
|
|
|
// }
|
|
|
|
|
|
// else {
|
|
|
|
|
|
// mapItem.iconPath = "https://static.ticket.sz-trip.com/xcxImages/map/"+item.type+".png";
|
|
|
|
|
|
// }
|
|
|
|
|
|
// mapItem.width = 20;
|
|
|
|
|
|
// mapItem.height=23;
|
|
|
|
|
|
// if(mapItem.latitude<40){
|
|
|
|
|
|
// list.push(mapItem)
|
|
|
|
|
|
// }
|
|
|
|
|
|
// })
|
|
|
|
|
|
// that.setData({
|
|
|
|
|
|
// list:list
|
|
|
|
|
|
// })
|
|
|
|
|
|
// })
|
|
|
|
|
|
// // that.mapCtx.getRegion({
|
|
|
|
|
|
// // success:function(r){
|
|
|
|
|
|
// // let location = r.longitude+","+r.latitude;
|
|
|
|
|
|
|
|
|
// that.getParkList(res.northeast.longitude,res.northeast.latitude,res.southwest.longitude,res.southwest.latitude,location)
|
|
|
// // that.getParkList(res.northeast.longitude,res.northeast.latitude,res.southwest.longitude,res.southwest.latitude,location)
|
|
|
|
|
|
// // }
|
|
|
|
|
|
// // })
|
|
|
// }
|
|
|
// }
|
|
|
// })
|
|
|
// })
|
|
|
} |
|
|
|
|
|
}) |
|
|
|
|
|
}, |
|
|
}, |
|
|
search:function(e){ |
|
|
search:function(e){ |
|
|
console.log(e) |
|
|
console.log(e) |
|
|
|