|
|
|
@ -8,18 +8,39 @@ Page({ |
|
|
|
* 页面的初始数据 |
|
|
|
*/ |
|
|
|
data: { |
|
|
|
types:['必赏','必吃','必游','必玩','必购','必住','夜戏','夜饮','夜宴','夜市'], |
|
|
|
types:['必赏','必吃','必游','必玩','必购','必住','赏夜戏','品夜饮','尝夜宴','逛夜市'], |
|
|
|
type:0, |
|
|
|
list:[], |
|
|
|
total:1 |
|
|
|
total:1, |
|
|
|
areas:[], |
|
|
|
areaIndex:-1 |
|
|
|
}, |
|
|
|
|
|
|
|
/** |
|
|
|
* 生命周期函数--监听页面加载 |
|
|
|
*/ |
|
|
|
onLoad: function (options) { |
|
|
|
// 获取当前定位
|
|
|
|
commonApi._post("act/get_suzhou_areas").then(res=>{ |
|
|
|
res.data.unshift({ |
|
|
|
area_id:"", |
|
|
|
area_title:"苏州" |
|
|
|
}) |
|
|
|
this.setData({ |
|
|
|
areas:res.data, |
|
|
|
areaIndex:0 |
|
|
|
}) |
|
|
|
}) |
|
|
|
this.getList() |
|
|
|
}, |
|
|
|
changeArea:function(e){ |
|
|
|
this.setData({ |
|
|
|
areaIndex:e.detail.value, |
|
|
|
list:[], |
|
|
|
total:1 |
|
|
|
}) |
|
|
|
this.getList(); |
|
|
|
}, |
|
|
|
changeType:function(e){ |
|
|
|
this.setData({ |
|
|
|
type:e.currentTarget.dataset.type, |
|
|
|
@ -33,15 +54,17 @@ Page({ |
|
|
|
commonApi._post("scene/get_scene_by_tag",{ |
|
|
|
offset:this.data.list.length, |
|
|
|
limit:10, |
|
|
|
tag_id:17+Number(this.data.type) |
|
|
|
tag_id:17+Number(this.data.type), |
|
|
|
area_id:this.data.areaIndex>-1?this.data.areas[this.data.areaIndex].area_id:null |
|
|
|
}).then(res=>{ |
|
|
|
res.data.list.map(item=>{ |
|
|
|
if(item.scene_tags && item.scene_tags.indexOf('运河十景')!=-1){ |
|
|
|
if(item.type && item.type.indexOf('tenscenic')!=-1){ |
|
|
|
item.isYunHe = true; |
|
|
|
} |
|
|
|
else { |
|
|
|
item.isYunHe = false; |
|
|
|
} |
|
|
|
item.brief_intro = item.brief_intro.replace(/<\/?.+?>/g,""); |
|
|
|
item.display_tags = item.display_tags?item.display_tags.split(","):[]; |
|
|
|
item.display_tags = item.display_tags.splice(0,2); |
|
|
|
}) |
|
|
|
@ -66,7 +89,9 @@ Page({ |
|
|
|
let item = e.currentTarget.dataset.item; |
|
|
|
wx.openLocation({ |
|
|
|
latitude: item.lat, |
|
|
|
longitude: item.lon |
|
|
|
longitude: item.lon, |
|
|
|
name:item.title, |
|
|
|
address:item.address |
|
|
|
}) |
|
|
|
}, |
|
|
|
gotoFoodInfo:function(e){ |
|
|
|
|