Commit b25b742be607c2f2fa19073ccbe6d1c5c2ab4495

Authored by vking
1 parent 4b573d2a

移动或缩放地图,获取更多餐厅

... ... @@ -77,6 +77,7 @@ Component({
offset:this.offset,
size:this.size,
distance:50,
centre_pos:mapParam.centre_pos,
};
if(mapParam.tags){
this.param.tags=mapParam.tags
... ...
... ... @@ -250,10 +250,10 @@ Page({
this.mapCtx.getRegion({
success:(res)=>{
console.log('onpos.getRegion',res)
//if(res.southwest.latitude!=this.mapData.region.southwest.latitude) {
this.mapData.region = res
//this.getMarkers();
//}
if(this.mapData.region.southwest.latitude) {
this.mapData.region = res
//this.getMarkers();
}
},
})
}
... ... @@ -283,7 +283,9 @@ Page({
success:(res)=>{
console.log('regionchange.getRegion',res.southwest.latitude,this.mapData.region.southwest.latitude,res)
this.hasClickMoveToLocation=false
this.mapData.region = res
if(res.southwest.latitude) {
this.mapData.region = res
};
this.timeoutGetMarkers();
},
})
... ... @@ -296,7 +298,7 @@ Page({
}
this.setTimeoutGetMarkers=setTimeout(()=>{
this.getMarkers();
},500)
},300)
},
mapUpdated(e){
console.log('mapUpdated', e)
... ... @@ -321,12 +323,10 @@ Page({
});
this.mapCtx.getRegion({
success:(res)=>{
console.log('mapUpdated.getRegion',res)
//if(res.southwest.latitude!=this.mapData.region.southwest.latitude){
this.mapData.region=res
//this.getMarkers();
//}
if(this.mapData.region.southwest.latitude=='' || !res.southwest.latitude) return;
console.log('mapUpdated.getRegion',[res.southwest.latitude,this.mapData.region.southwest.latitude])
this.mapData.region=res
//this.timeoutGetMarkers();
},
})
},
... ... @@ -458,6 +458,10 @@ Page({
if(tags.length>0){
param.tags=tags;
}
param.centre_pos=`${this.mapData.latitude},${this.mapData.longitude}`
if(this.data.hasSuggestion){
param.centre_pos=`${this.data.suggestion.latitude},${this.data.suggestion.longitude}`
}
this.selectComponent('#list').getList(param);
this.param=param;
let now_sid=[];
... ... @@ -701,25 +705,36 @@ Page({
ds.setA2LHeight(e.type=='hide'?0:40);
},
setLocationMarker(markers){
let map = this.mapData;
let mks=[]
let matchPosNum=1
if(markers.length>0){
markers.forEach(mk=>{
if(mk.id!='location'){
if(mk.id!='location'
&& mk.latitude>map.region.southwest.latitude
&& mk.longitude>map.region.southwest.longitude
&& mk.latitude<map.region.northeast.latitude
&& mk.longitude<map.region.northeast.longitude){
mks.push(mk);
}
})
}
//if(this.data.hasSuggestion){
let map = this.data.map;
mks.push({
id: 'location',
iconPath: "http://qn.colorcun.com/reserve/images/location.png"+cates_version,
latitude: map.latitude,
longitude: map.longitude,
width: 20,
height: 25,
})
//}
if(mks.length-markers.length<0){
this.timeoutGetMarkers()
return []
}
if(this.data.hasSuggestion){
map=this.data.suggestion
}
mks.push({
id: 'location',
iconPath: "http://qn.colorcun.com/reserve/images/location.png"+cates_version,
latitude: map.latitude,
longitude: map.longitude,
width: 20,
height: 25,
})
return mks;
},
tagsChange(e){
... ... @@ -786,6 +801,7 @@ Page({
map:this.param.map,
multiIndex:this.data.multiIndex,
tags:this.param.tags,
centre_pos:this.param.centre_pos,
},'./indexList')
});
},
... ...
... ... @@ -31,7 +31,7 @@
</formids>
</view>
<view class="seller-view {{(listMoreCount<1)?(hasSearchLimit?'disabled enabled':'disabled'):''}}">
<cover-view class="toast" wx:if="{{hasGetSellersEnd && listMoreCount<1 && !hasSearchLimit}}">该地区没有可供预订的餐厅哦!努力开通中</cover-view>
<cover-view class="toast" wx:if="{{hasGetSellersEnd && listMoreCount<1 && !hasSearchLimit && markers.length<2}}">该地区没有可供预订的餐厅哦!努力开通中</cover-view>
<cover-view class="toast" wx:if="{{hasGetSellersEnd && markers.length<2 && listMoreCount>0}}">移动或缩放地图,获取更多餐厅</cover-view>
<cover-view class="flex-vc transverse-view-top" bindtap="listShow" wx:if="{{hasGetSellersEnd && listMoreCount>0}}">
<cover-view class="line"></cover-view>
... ...
... ... @@ -101,7 +101,8 @@ Page({
keyword:mapParam.keyword,
offset:this.offset,
size:this.size,
distance:5000,
distance:500000,
centre_pos:`${mapParam.lat},${mapParam.lng}`,
};
}else{
//计算视窗中心
... ... @@ -116,6 +117,7 @@ Page({
offset:this.offset,
size:this.size,
distance:50,
centre_pos:mapParam.centre_pos,
};
}
if(this.data.multiIndex[0]>0){
... ...
... ... @@ -3,15 +3,15 @@
"setting": {
"urlCheck": true,
"es6": true,
"enhance": true,
"postcss": true,
"minified": true,
"newFeature": true,
"coverView": true,
"nodeModules": true,
"autoAudits": false,
"uglifyFileName": false,
"checkInvalidKey": true,
"enhance": true,
"coverView": true,
"checkSiteMap": true,
"uploadWithSourceMap": true,
"babelSetting": {
... ...
... ... @@ -5,6 +5,7 @@ export default {
cachetime: 0, //缓存 0无,-1永久,86400秒; 默认 0 不缓存
timeout: 2000, //接口超时时间,默认2s
host: '', //默认空使用04服务器,测试填写 'https://xt05.colorcun.com:10006/?s='
//ximing http://www.dzapi.com/index.php?s=
alias: 'App.TestManagement.TestReal', //真实接口名称,默认为空
msgSecCheck:true, //进行内容安全检查
},
... ... @@ -58,10 +59,14 @@ export default {
},
//地图页-商家
'App.Customer.SellerList': null,
'App.Customer.SellerList': {
alias: 'App.Customer.NewSellerList'
},
//地图页-商家-列表
'App.Customer.SellerLists':null,
'App.Customer.SellerLists':{
alias: 'App.Customer.NewSellerLists'
},
//桌位列表
'App.Tables.GetTableListsBySellerId': {
... ...