|
...
|
...
|
@@ -26,7 +26,7 @@ Page({ |
|
|
|
markers: [],
|
|
|
|
//polygons:{},
|
|
|
|
sellers:[],
|
|
|
|
multiArray: [['不确定'].concat(renNum()), ['全部菜系'].concat(DA.caixi)],
|
|
|
|
multiArray: [['不确定'], ['全部菜系']],
|
|
|
|
multiIndex: [6, 0],
|
|
|
|
scrollIntoView:'',
|
|
|
|
suggestion:{},
|
|
...
|
...
|
@@ -37,13 +37,20 @@ Page({ |
|
|
|
sellers: [],
|
|
|
|
sellersIds:[],
|
|
|
|
searchAddrTop:50,
|
|
|
|
user:{
|
|
|
|
latitude: 23.099994,
|
|
|
|
longitude: 113.324520,
|
|
|
|
},
|
|
|
|
/**
|
|
|
|
* 生命周期函数--监听页面加载
|
|
|
|
*/
|
|
|
|
onLoad: function (options) {
|
|
|
|
onLoad: async function (options) {
|
|
|
|
// this.qqmapsdk=new QQMapWX({
|
|
|
|
// key: 'SDEBZ-I74W4-QLGUX-XXYXU-HIR23-3QFBJ'
|
|
|
|
// });
|
|
|
|
this.setData({
|
|
|
|
multiArray:[['不确定'].concat(renNum()), ['全部菜系'].concat(await DA.getCates())]
|
|
|
|
})
|
|
|
|
},
|
|
|
|
|
|
|
|
/**
|
|
...
|
...
|
@@ -77,6 +84,7 @@ Page({ |
|
|
|
//this.getPos();
|
|
|
|
if(this.data.hasSuggestion) return;
|
|
|
|
let sys=getApp().system;
|
|
|
|
console.log('onShow',sys.windowHeight,sys.windowHeight-this.transverseViewHeight)
|
|
|
|
this.setData({
|
|
|
|
[`map.height`]: sys.windowHeight-this.transverseViewHeight,
|
|
|
|
searchAddrTop:sys.statusBarHeight
|
|
...
|
...
|
@@ -125,6 +133,11 @@ Page({ |
|
|
|
let map = this.data.map;
|
|
|
|
map.latitude = res.latitude;
|
|
|
|
map.longitude = res.longitude;
|
|
|
|
|
|
|
|
this.user.latitude = res.latitude;
|
|
|
|
this.user.longitude = res.longitude;
|
|
|
|
|
|
|
|
console.log('onShow.getPos',getApp().system.windowHeight,getApp().system.windowHeight-this.transverseViewHeight)
|
|
|
|
map.height = getApp().system.windowHeight-this.transverseViewHeight
|
|
|
|
this.setData({
|
|
|
|
map: map,
|
|
...
|
...
|
@@ -262,8 +275,8 @@ Page({ |
|
|
|
let markers = [];
|
|
|
|
let sellers=[];
|
|
|
|
App.Reserve.SellerList({
|
|
|
|
lat: cmap.latitude,
|
|
|
|
lng: cmap.longitude,
|
|
|
|
lat: this.user.latitude,
|
|
|
|
lng: this.user.longitude,
|
|
|
|
offset: 0,
|
|
|
|
rows: 10000,
|
|
|
|
distance: 100000,
|
|
...
|
...
|
@@ -279,9 +292,14 @@ Page({ |
|
|
|
}
|
|
|
|
this.sellersIds=sellersIds;
|
|
|
|
sellers=res.data;
|
|
|
|
this.sellers = sellers;
|
|
|
|
|
|
|
|
sellers.forEach(seller => {
|
|
|
|
seller.distance=parseInt(seller.distance);
|
|
|
|
if(seller.distance>1000){
|
|
|
|
seller.distance=(seller.distance/1000).toFixed(2)+'公里'
|
|
|
|
}else{
|
|
|
|
seller.distance+='米';
|
|
|
|
}
|
|
|
|
|
|
|
|
if(this.mapData.scale<13){
|
|
|
|
markers.push({
|
|
|
|
id: seller.id,
|
|
...
|
...
|
@@ -295,7 +313,7 @@ Page({ |
|
|
|
return;
|
|
|
|
}
|
|
|
|
let namelength = seller.sellername.replace(/[^\x00-\xff]/g, "01").length + 8;
|
|
|
|
markers.push({
|
|
|
|
let marker={
|
|
|
|
id: seller.id,
|
|
|
|
iconPath: "http://qn.colorcun.com/custom/lite-online/image/circle.png",
|
|
|
|
latitude: seller.lat,
|
|
...
|
...
|
@@ -315,7 +333,16 @@ Page({ |
|
|
|
textAlign: 'center',
|
|
|
|
display:'ALWAYS',
|
|
|
|
},
|
|
|
|
})
|
|
|
|
};
|
|
|
|
if(seller.level[0].id<3){
|
|
|
|
//http://qn.colorcun.com/custom/lite-online/cates/%E6%B1%9F%E6%B5%99%E8%8F%9C.png
|
|
|
|
marker.iconPath="http://qn.colorcun.com/custom/lite-online/cates/"
|
|
|
|
+(seller.cate.length>0?seller.cate[0].name:'其他菜品')
|
|
|
|
+".png";
|
|
|
|
marker.width=20;
|
|
|
|
marker.height=25;
|
|
|
|
}
|
|
|
|
markers.push(marker)
|
|
|
|
})
|
|
|
|
} else {
|
|
|
|
markers.push({
|
|
...
|
...
|
@@ -341,6 +368,7 @@ Page({ |
|
|
|
},
|
|
|
|
})
|
|
|
|
}
|
|
|
|
this.sellers = sellers;
|
|
|
|
this.setData({
|
|
|
|
markers: markers,
|
|
|
|
sellers:sellers,
|
...
|
...
|
|