Commit dfb8438bed0ab0df74f287b5d746fa3055701cdd

Authored by wangfan
1 parent 9251ed76

c端预定

... ... @@ -10,7 +10,11 @@ let getCates=async function(){
})
return cates;
}
let getCatesID=async function(index){
let res=await App.Reserve.GetCustomerConfig();
return res.data.cate[index].id;
}
export default {
getCates:getCates,
getCatesID:getCatesID,
}
\ No newline at end of file
... ...
... ... @@ -248,22 +248,33 @@ Page({
},
markertap(e){
console.log(e)
// let seller = {
// id: e.markerId
// };
// this.sellers.forEach(se => {
// if (se.id == seller.id) {
// seller = se;
// return false;
// }
// })
//this.selectComponent('#seller-box').show(seller);
//wx.hideTabBar();
let markers=this.data.markers;
let bl=1.2;
markers.forEach(m=>{
if(m.width==20*bl){
m.width=20;
m.height=25;
}
if(m.width==7*bl){
m.width=7;
m.height=7;
}
if(m.id==e.markerId){
if(m.width==20){
m.width=20*bl;
m.height=25*bl;
}else{
m.width=7*bl;
m.height=7*bl;
}
}
})
this.setData({
scrollIntoView:'seller-'+e.markerId
scrollIntoView:'seller-'+e.markerId,
markers:markers,
})
},
getMarkers(){
async getMarkers(){
let cmap=this.data.map;
let map = this.mapData;
//console.log('getMarkers',map.region);
... ... @@ -274,14 +285,21 @@ Page({
}
let markers = [];
let sellers=[];
App.Reserve.SellerList({
let param={
lat: this.user.latitude,
lng: this.user.longitude,
offset: 0,
rows: 10000,
distance: 100000,
map:JSON.stringify({...this.mapData.region,scale:this.mapData.scale})
}).then(res => {
}
if(this.data.multiIndex[0]>0){
param.pnum=this.data.multiIndex[0];
}
if(this.data.multiIndex[1]>0){
param.cuisine=await DA.getCatesID(this.data.multiIndex[1]-1);
}
App.Reserve.SellerList(param).then(res => {
if (res.ret == 200) {
let sellersIds=["scale"+this.mapData.scale];
res.data.forEach(seller=>{
... ... @@ -300,18 +318,6 @@ Page({
seller.distance+='米';
}
if(this.mapData.scale<13){
markers.push({
id: seller.id,
iconPath: "http://qn.colorcun.com/custom/lite-yd/image/diandian.png",
latitude: seller.lat,
longitude: seller.long,
width: 6,
height: 6,
title:seller.seller_name,
})
return;
}
let namelength = seller.sellername.replace(/[^\x00-\xff]/g, "01").length + 8;
let marker={
id: seller.id,
... ... @@ -321,18 +327,6 @@ Page({
width: 7,
height: 7,
//title:seller.seller_name,
callout:{
content: ' ' + seller.sellername + ' ',
color: '#fefefe',
fontSize: 12,
borderWidth: 1,
borderColor: '#4C4C4C',
borderRadius: 50,
bgColor: '#626262',
padding: 5,
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
... ... @@ -341,6 +335,18 @@ Page({
+".png";
marker.width=20;
marker.height=25;
marker.callout={
content: ' ' + seller.sellername + ' ',
color: '#fefefe',
fontSize: 12,
borderWidth: 1,
borderColor: '#4C4C4C',
borderRadius: 50,
bgColor: '#626262',
padding: 5,
textAlign: 'center',
display:'ALWAYS',
};
}
markers.push(marker)
})
... ... @@ -395,6 +401,7 @@ Page({
this.setData({
multiIndex:util.val(e)
})
this.getMarkers();
},
setSuggestion(suggestion){
let map=this.data.map;
... ...