|
@@ -26,7 +26,7 @@ Page({ |
|
@@ -26,7 +26,7 @@ Page({ |
|
26
|
markers: [],
|
26
|
markers: [],
|
|
27
|
//polygons:{},
|
27
|
//polygons:{},
|
|
28
|
sellers:[],
|
28
|
sellers:[],
|
|
29
|
- multiArray: [['不确定'].concat(renNum()), ['全部菜系'].concat(DA.caixi)],
|
29
|
+ multiArray: [['不确定'], ['全部菜系']],
|
|
30
|
multiIndex: [6, 0],
|
30
|
multiIndex: [6, 0],
|
|
31
|
scrollIntoView:'',
|
31
|
scrollIntoView:'',
|
|
32
|
suggestion:{},
|
32
|
suggestion:{},
|
|
@@ -37,13 +37,20 @@ Page({ |
|
@@ -37,13 +37,20 @@ Page({ |
|
37
|
sellers: [],
|
37
|
sellers: [],
|
|
38
|
sellersIds:[],
|
38
|
sellersIds:[],
|
|
39
|
searchAddrTop:50,
|
39
|
searchAddrTop:50,
|
|
|
|
40
|
+ user:{
|
|
|
|
41
|
+ latitude: 23.099994,
|
|
|
|
42
|
+ longitude: 113.324520,
|
|
|
|
43
|
+ },
|
|
40
|
/**
|
44
|
/**
|
|
41
|
* 生命周期函数--监听页面加载
|
45
|
* 生命周期函数--监听页面加载
|
|
42
|
*/
|
46
|
*/
|
|
43
|
- onLoad: function (options) {
|
47
|
+ onLoad: async function (options) {
|
|
44
|
// this.qqmapsdk=new QQMapWX({
|
48
|
// this.qqmapsdk=new QQMapWX({
|
|
45
|
// key: 'SDEBZ-I74W4-QLGUX-XXYXU-HIR23-3QFBJ'
|
49
|
// key: 'SDEBZ-I74W4-QLGUX-XXYXU-HIR23-3QFBJ'
|
|
46
|
// });
|
50
|
// });
|
|
|
|
51
|
+ this.setData({
|
|
|
|
52
|
+ multiArray:[['不确定'].concat(renNum()), ['全部菜系'].concat(await DA.getCates())]
|
|
|
|
53
|
+ })
|
|
47
|
},
|
54
|
},
|
|
48
|
|
55
|
|
|
49
|
/**
|
56
|
/**
|
|
@@ -77,6 +84,7 @@ Page({ |
|
@@ -77,6 +84,7 @@ Page({ |
|
77
|
//this.getPos();
|
84
|
//this.getPos();
|
|
78
|
if(this.data.hasSuggestion) return;
|
85
|
if(this.data.hasSuggestion) return;
|
|
79
|
let sys=getApp().system;
|
86
|
let sys=getApp().system;
|
|
|
|
87
|
+ console.log('onShow',sys.windowHeight,sys.windowHeight-this.transverseViewHeight)
|
|
80
|
this.setData({
|
88
|
this.setData({
|
|
81
|
[`map.height`]: sys.windowHeight-this.transverseViewHeight,
|
89
|
[`map.height`]: sys.windowHeight-this.transverseViewHeight,
|
|
82
|
searchAddrTop:sys.statusBarHeight
|
90
|
searchAddrTop:sys.statusBarHeight
|
|
@@ -125,6 +133,11 @@ Page({ |
|
@@ -125,6 +133,11 @@ Page({ |
|
125
|
let map = this.data.map;
|
133
|
let map = this.data.map;
|
|
126
|
map.latitude = res.latitude;
|
134
|
map.latitude = res.latitude;
|
|
127
|
map.longitude = res.longitude;
|
135
|
map.longitude = res.longitude;
|
|
|
|
136
|
+
|
|
|
|
137
|
+ this.user.latitude = res.latitude;
|
|
|
|
138
|
+ this.user.longitude = res.longitude;
|
|
|
|
139
|
+
|
|
|
|
140
|
+ console.log('onShow.getPos',getApp().system.windowHeight,getApp().system.windowHeight-this.transverseViewHeight)
|
|
128
|
map.height = getApp().system.windowHeight-this.transverseViewHeight
|
141
|
map.height = getApp().system.windowHeight-this.transverseViewHeight
|
|
129
|
this.setData({
|
142
|
this.setData({
|
|
130
|
map: map,
|
143
|
map: map,
|
|
@@ -262,8 +275,8 @@ Page({ |
|
@@ -262,8 +275,8 @@ Page({ |
|
262
|
let markers = [];
|
275
|
let markers = [];
|
|
263
|
let sellers=[];
|
276
|
let sellers=[];
|
|
264
|
App.Reserve.SellerList({
|
277
|
App.Reserve.SellerList({
|
|
265
|
- lat: cmap.latitude,
|
|
|
|
266
|
- lng: cmap.longitude,
|
278
|
+ lat: this.user.latitude,
|
|
|
|
279
|
+ lng: this.user.longitude,
|
|
267
|
offset: 0,
|
280
|
offset: 0,
|
|
268
|
rows: 10000,
|
281
|
rows: 10000,
|
|
269
|
distance: 100000,
|
282
|
distance: 100000,
|
|
@@ -279,9 +292,14 @@ Page({ |
|
@@ -279,9 +292,14 @@ Page({ |
|
279
|
}
|
292
|
}
|
|
280
|
this.sellersIds=sellersIds;
|
293
|
this.sellersIds=sellersIds;
|
|
281
|
sellers=res.data;
|
294
|
sellers=res.data;
|
|
282
|
- this.sellers = sellers;
|
|
|
|
283
|
-
|
|
|
|
284
|
sellers.forEach(seller => {
|
295
|
sellers.forEach(seller => {
|
|
|
|
296
|
+ seller.distance=parseInt(seller.distance);
|
|
|
|
297
|
+ if(seller.distance>1000){
|
|
|
|
298
|
+ seller.distance=(seller.distance/1000).toFixed(2)+'公里'
|
|
|
|
299
|
+ }else{
|
|
|
|
300
|
+ seller.distance+='米';
|
|
|
|
301
|
+ }
|
|
|
|
302
|
+
|
|
285
|
if(this.mapData.scale<13){
|
303
|
if(this.mapData.scale<13){
|
|
286
|
markers.push({
|
304
|
markers.push({
|
|
287
|
id: seller.id,
|
305
|
id: seller.id,
|
|
@@ -295,7 +313,7 @@ Page({ |
|
@@ -295,7 +313,7 @@ Page({ |
|
295
|
return;
|
313
|
return;
|
|
296
|
}
|
314
|
}
|
|
297
|
let namelength = seller.sellername.replace(/[^\x00-\xff]/g, "01").length + 8;
|
315
|
let namelength = seller.sellername.replace(/[^\x00-\xff]/g, "01").length + 8;
|
|
298
|
- markers.push({
|
316
|
+ let marker={
|
|
299
|
id: seller.id,
|
317
|
id: seller.id,
|
|
300
|
iconPath: "http://qn.colorcun.com/custom/lite-online/image/circle.png",
|
318
|
iconPath: "http://qn.colorcun.com/custom/lite-online/image/circle.png",
|
|
301
|
latitude: seller.lat,
|
319
|
latitude: seller.lat,
|
|
@@ -315,7 +333,16 @@ Page({ |
|
@@ -315,7 +333,16 @@ Page({ |
|
315
|
textAlign: 'center',
|
333
|
textAlign: 'center',
|
|
316
|
display:'ALWAYS',
|
334
|
display:'ALWAYS',
|
|
317
|
},
|
335
|
},
|
|
318
|
- })
|
336
|
+ };
|
|
|
|
337
|
+ if(seller.level[0].id<3){
|
|
|
|
338
|
+ //http://qn.colorcun.com/custom/lite-online/cates/%E6%B1%9F%E6%B5%99%E8%8F%9C.png
|
|
|
|
339
|
+ marker.iconPath="http://qn.colorcun.com/custom/lite-online/cates/"
|
|
|
|
340
|
+ +(seller.cate.length>0?seller.cate[0].name:'其他菜品')
|
|
|
|
341
|
+ +".png";
|
|
|
|
342
|
+ marker.width=20;
|
|
|
|
343
|
+ marker.height=25;
|
|
|
|
344
|
+ }
|
|
|
|
345
|
+ markers.push(marker)
|
|
319
|
})
|
346
|
})
|
|
320
|
} else {
|
347
|
} else {
|
|
321
|
markers.push({
|
348
|
markers.push({
|
|
@@ -341,6 +368,7 @@ Page({ |
|
@@ -341,6 +368,7 @@ Page({ |
|
341
|
},
|
368
|
},
|
|
342
|
})
|
369
|
})
|
|
343
|
}
|
370
|
}
|
|
|
|
371
|
+ this.sellers = sellers;
|
|
344
|
this.setData({
|
372
|
this.setData({
|
|
345
|
markers: markers,
|
373
|
markers: markers,
|
|
346
|
sellers:sellers,
|
374
|
sellers:sellers,
|