Commit b25b742be607c2f2fa19073ccbe6d1c5c2ab4495

Authored by vking
1 parent 4b573d2a

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

@@ -77,6 +77,7 @@ Component({ @@ -77,6 +77,7 @@ Component({
77 offset:this.offset, 77 offset:this.offset,
78 size:this.size, 78 size:this.size,
79 distance:50, 79 distance:50,
  80 + centre_pos:mapParam.centre_pos,
80 }; 81 };
81 if(mapParam.tags){ 82 if(mapParam.tags){
82 this.param.tags=mapParam.tags 83 this.param.tags=mapParam.tags
@@ -250,10 +250,10 @@ Page({ @@ -250,10 +250,10 @@ Page({
250 this.mapCtx.getRegion({ 250 this.mapCtx.getRegion({
251 success:(res)=>{ 251 success:(res)=>{
252 console.log('onpos.getRegion',res) 252 console.log('onpos.getRegion',res)
253 - //if(res.southwest.latitude!=this.mapData.region.southwest.latitude) {  
254 - this.mapData.region = res  
255 - //this.getMarkers();  
256 - //} 253 + if(this.mapData.region.southwest.latitude) {
  254 + this.mapData.region = res
  255 + //this.getMarkers();
  256 + }
257 }, 257 },
258 }) 258 })
259 } 259 }
@@ -283,7 +283,9 @@ Page({ @@ -283,7 +283,9 @@ Page({
283 success:(res)=>{ 283 success:(res)=>{
284 console.log('regionchange.getRegion',res.southwest.latitude,this.mapData.region.southwest.latitude,res) 284 console.log('regionchange.getRegion',res.southwest.latitude,this.mapData.region.southwest.latitude,res)
285 this.hasClickMoveToLocation=false 285 this.hasClickMoveToLocation=false
286 - this.mapData.region = res 286 + if(res.southwest.latitude) {
  287 + this.mapData.region = res
  288 + };
287 this.timeoutGetMarkers(); 289 this.timeoutGetMarkers();
288 }, 290 },
289 }) 291 })
@@ -296,7 +298,7 @@ Page({ @@ -296,7 +298,7 @@ Page({
296 } 298 }
297 this.setTimeoutGetMarkers=setTimeout(()=>{ 299 this.setTimeoutGetMarkers=setTimeout(()=>{
298 this.getMarkers(); 300 this.getMarkers();
299 - },500) 301 + },300)
300 }, 302 },
301 mapUpdated(e){ 303 mapUpdated(e){
302 console.log('mapUpdated', e) 304 console.log('mapUpdated', e)
@@ -321,12 +323,10 @@ Page({ @@ -321,12 +323,10 @@ Page({
321 }); 323 });
322 this.mapCtx.getRegion({ 324 this.mapCtx.getRegion({
323 success:(res)=>{ 325 success:(res)=>{
324 - console.log('mapUpdated.getRegion',res)  
325 - //if(res.southwest.latitude!=this.mapData.region.southwest.latitude){  
326 - this.mapData.region=res  
327 - //this.getMarkers();  
328 - //}  
329 - 326 + if(this.mapData.region.southwest.latitude=='' || !res.southwest.latitude) return;
  327 + console.log('mapUpdated.getRegion',[res.southwest.latitude,this.mapData.region.southwest.latitude])
  328 + this.mapData.region=res
  329 + //this.timeoutGetMarkers();
330 }, 330 },
331 }) 331 })
332 }, 332 },
@@ -458,6 +458,10 @@ Page({ @@ -458,6 +458,10 @@ Page({
458 if(tags.length>0){ 458 if(tags.length>0){
459 param.tags=tags; 459 param.tags=tags;
460 } 460 }
  461 + param.centre_pos=`${this.mapData.latitude},${this.mapData.longitude}`
  462 + if(this.data.hasSuggestion){
  463 + param.centre_pos=`${this.data.suggestion.latitude},${this.data.suggestion.longitude}`
  464 + }
461 this.selectComponent('#list').getList(param); 465 this.selectComponent('#list').getList(param);
462 this.param=param; 466 this.param=param;
463 let now_sid=[]; 467 let now_sid=[];
@@ -701,25 +705,36 @@ Page({ @@ -701,25 +705,36 @@ Page({
701 ds.setA2LHeight(e.type=='hide'?0:40); 705 ds.setA2LHeight(e.type=='hide'?0:40);
702 }, 706 },
703 setLocationMarker(markers){ 707 setLocationMarker(markers){
  708 + let map = this.mapData;
704 let mks=[] 709 let mks=[]
  710 + let matchPosNum=1
705 if(markers.length>0){ 711 if(markers.length>0){
706 markers.forEach(mk=>{ 712 markers.forEach(mk=>{
707 - if(mk.id!='location'){ 713 + if(mk.id!='location'
  714 + && mk.latitude>map.region.southwest.latitude
  715 + && mk.longitude>map.region.southwest.longitude
  716 + && mk.latitude<map.region.northeast.latitude
  717 + && mk.longitude<map.region.northeast.longitude){
708 mks.push(mk); 718 mks.push(mk);
709 } 719 }
710 }) 720 })
711 } 721 }
712 - //if(this.data.hasSuggestion){  
713 - let map = this.data.map;  
714 - mks.push({  
715 - id: 'location',  
716 - iconPath: "http://qn.colorcun.com/reserve/images/location.png"+cates_version,  
717 - latitude: map.latitude,  
718 - longitude: map.longitude,  
719 - width: 20,  
720 - height: 25,  
721 - })  
722 - //} 722 + if(mks.length-markers.length<0){
  723 + this.timeoutGetMarkers()
  724 + return []
  725 + }
  726 +
  727 + if(this.data.hasSuggestion){
  728 + map=this.data.suggestion
  729 + }
  730 + mks.push({
  731 + id: 'location',
  732 + iconPath: "http://qn.colorcun.com/reserve/images/location.png"+cates_version,
  733 + latitude: map.latitude,
  734 + longitude: map.longitude,
  735 + width: 20,
  736 + height: 25,
  737 + })
723 return mks; 738 return mks;
724 }, 739 },
725 tagsChange(e){ 740 tagsChange(e){
@@ -786,6 +801,7 @@ Page({ @@ -786,6 +801,7 @@ Page({
786 map:this.param.map, 801 map:this.param.map,
787 multiIndex:this.data.multiIndex, 802 multiIndex:this.data.multiIndex,
788 tags:this.param.tags, 803 tags:this.param.tags,
  804 + centre_pos:this.param.centre_pos,
789 },'./indexList') 805 },'./indexList')
790 }); 806 });
791 }, 807 },
@@ -31,7 +31,7 @@ @@ -31,7 +31,7 @@
31 </formids> 31 </formids>
32 </view> 32 </view>
33 <view class="seller-view {{(listMoreCount<1)?(hasSearchLimit?'disabled enabled':'disabled'):''}}"> 33 <view class="seller-view {{(listMoreCount<1)?(hasSearchLimit?'disabled enabled':'disabled'):''}}">
34 - <cover-view class="toast" wx:if="{{hasGetSellersEnd && listMoreCount<1 && !hasSearchLimit}}">该地区没有可供预订的餐厅哦!努力开通中</cover-view> 34 + <cover-view class="toast" wx:if="{{hasGetSellersEnd && listMoreCount<1 && !hasSearchLimit && markers.length<2}}">该地区没有可供预订的餐厅哦!努力开通中</cover-view>
35 <cover-view class="toast" wx:if="{{hasGetSellersEnd && markers.length<2 && listMoreCount>0}}">移动或缩放地图,获取更多餐厅</cover-view> 35 <cover-view class="toast" wx:if="{{hasGetSellersEnd && markers.length<2 && listMoreCount>0}}">移动或缩放地图,获取更多餐厅</cover-view>
36 <cover-view class="flex-vc transverse-view-top" bindtap="listShow" wx:if="{{hasGetSellersEnd && listMoreCount>0}}"> 36 <cover-view class="flex-vc transverse-view-top" bindtap="listShow" wx:if="{{hasGetSellersEnd && listMoreCount>0}}">
37 <cover-view class="line"></cover-view> 37 <cover-view class="line"></cover-view>
@@ -101,7 +101,8 @@ Page({ @@ -101,7 +101,8 @@ Page({
101 keyword:mapParam.keyword, 101 keyword:mapParam.keyword,
102 offset:this.offset, 102 offset:this.offset,
103 size:this.size, 103 size:this.size,
104 - distance:5000, 104 + distance:500000,
  105 + centre_pos:`${mapParam.lat},${mapParam.lng}`,
105 }; 106 };
106 }else{ 107 }else{
107 //计算视窗中心 108 //计算视窗中心
@@ -116,6 +117,7 @@ Page({ @@ -116,6 +117,7 @@ Page({
116 offset:this.offset, 117 offset:this.offset,
117 size:this.size, 118 size:this.size,
118 distance:50, 119 distance:50,
  120 + centre_pos:mapParam.centre_pos,
119 }; 121 };
120 } 122 }
121 if(this.data.multiIndex[0]>0){ 123 if(this.data.multiIndex[0]>0){
@@ -3,15 +3,15 @@ @@ -3,15 +3,15 @@
3 "setting": { 3 "setting": {
4 "urlCheck": true, 4 "urlCheck": true,
5 "es6": true, 5 "es6": true,
  6 + "enhance": true,
6 "postcss": true, 7 "postcss": true,
7 "minified": true, 8 "minified": true,
8 "newFeature": true, 9 "newFeature": true,
  10 + "coverView": true,
9 "nodeModules": true, 11 "nodeModules": true,
10 "autoAudits": false, 12 "autoAudits": false,
11 "uglifyFileName": false, 13 "uglifyFileName": false,
12 "checkInvalidKey": true, 14 "checkInvalidKey": true,
13 - "enhance": true,  
14 - "coverView": true,  
15 "checkSiteMap": true, 15 "checkSiteMap": true,
16 "uploadWithSourceMap": true, 16 "uploadWithSourceMap": true,
17 "babelSetting": { 17 "babelSetting": {
@@ -5,6 +5,7 @@ export default { @@ -5,6 +5,7 @@ export default {
5 cachetime: 0, //缓存 0无,-1永久,86400秒; 默认 0 不缓存 5 cachetime: 0, //缓存 0无,-1永久,86400秒; 默认 0 不缓存
6 timeout: 2000, //接口超时时间,默认2s 6 timeout: 2000, //接口超时时间,默认2s
7 host: '', //默认空使用04服务器,测试填写 'https://xt05.colorcun.com:10006/?s=' 7 host: '', //默认空使用04服务器,测试填写 'https://xt05.colorcun.com:10006/?s='
  8 + //ximing http://www.dzapi.com/index.php?s=
8 alias: 'App.TestManagement.TestReal', //真实接口名称,默认为空 9 alias: 'App.TestManagement.TestReal', //真实接口名称,默认为空
9 msgSecCheck:true, //进行内容安全检查 10 msgSecCheck:true, //进行内容安全检查
10 }, 11 },
@@ -58,10 +59,14 @@ export default { @@ -58,10 +59,14 @@ export default {
58 }, 59 },
59 60
60 //地图页-商家 61 //地图页-商家
61 - 'App.Customer.SellerList': null, 62 + 'App.Customer.SellerList': {
  63 + alias: 'App.Customer.NewSellerList'
  64 + },
62 65
63 //地图页-商家-列表 66 //地图页-商家-列表
64 - 'App.Customer.SellerLists':null, 67 + 'App.Customer.SellerLists':{
  68 + alias: 'App.Customer.NewSellerLists'
  69 + },
65 70
66 //桌位列表 71 //桌位列表
67 'App.Tables.GetTableListsBySellerId': { 72 'App.Tables.GetTableListsBySellerId': {