Showing
3 changed files
with
126 additions
and
14 deletions
| @@ -54,17 +54,19 @@ Page({ | @@ -54,17 +54,19 @@ Page({ | ||
| 54 | multiIndex:[options.multiIndex], | 54 | multiIndex:[options.multiIndex], |
| 55 | tags:tags, | 55 | tags:tags, |
| 56 | }) | 56 | }) |
| 57 | - this.eventChannel = this.getOpenerEventChannel() | ||
| 58 | - // 监听acceptDataFromOpenerPage事件,获取上一页面通过eventChannel传送到当前页面的数据 | ||
| 59 | - this.eventChannel.on('acceptDataFromMapPage', findSellerData=> { | ||
| 60 | - if(findSellerData){ | ||
| 61 | - this.findSellerData=findSellerData | ||
| 62 | - console.log('findSellerData',findSellerData) | ||
| 63 | - this.setData({ | ||
| 64 | - findSellerData:findSellerData, | ||
| 65 | - }) | ||
| 66 | - } | ||
| 67 | - }) | 57 | + try{ |
| 58 | + this.eventChannel = this.getOpenerEventChannel() | ||
| 59 | + // 监听acceptDataFromOpenerPage事件,获取上一页面通过eventChannel传送到当前页面的数据 | ||
| 60 | + this.eventChannel.on('acceptDataFromMapPage', findSellerData=> { | ||
| 61 | + if(findSellerData){ | ||
| 62 | + this.findSellerData=findSellerData | ||
| 63 | + console.log('findSellerData',findSellerData) | ||
| 64 | + this.setData({ | ||
| 65 | + findSellerData:findSellerData, | ||
| 66 | + }) | ||
| 67 | + } | ||
| 68 | + }) | ||
| 69 | + }catch(e){} | ||
| 68 | setTimeout(()=>{this.getList()},300) | 70 | setTimeout(()=>{this.getList()},300) |
| 69 | }, | 71 | }, |
| 70 | 72 | ||
| @@ -72,7 +74,7 @@ Page({ | @@ -72,7 +74,7 @@ Page({ | ||
| 72 | * 生命周期函数--监听页面初次渲染完成 | 74 | * 生命周期函数--监听页面初次渲染完成 |
| 73 | */ | 75 | */ |
| 74 | onReady: function () { | 76 | onReady: function () { |
| 75 | - | 77 | + this.selectComponent('#getpos').getPos(); |
| 76 | }, | 78 | }, |
| 77 | 79 | ||
| 78 | /** | 80 | /** |
| @@ -109,6 +111,7 @@ Page({ | @@ -109,6 +111,7 @@ Page({ | ||
| 109 | onReachBottom: function () { | 111 | onReachBottom: function () { |
| 110 | this.getListMore() | 112 | this.getListMore() |
| 111 | }, | 113 | }, |
| 114 | + hasGetSellerEnd:false, | ||
| 112 | async getList(){ | 115 | async getList(){ |
| 113 | let mapParam=this.options | 116 | let mapParam=this.options |
| 114 | this.offset=1 //page | 117 | this.offset=1 //page |
| @@ -179,6 +182,7 @@ Page({ | @@ -179,6 +182,7 @@ Page({ | ||
| 179 | hasDisabled:this.getHasDisabled(res.data.length>0,this.data.multiIndex[0]>0 || tags.length>0) | 182 | hasDisabled:this.getHasDisabled(res.data.length>0,this.data.multiIndex[0]>0 || tags.length>0) |
| 180 | }) | 183 | }) |
| 181 | this.triggerEvent('event',{type:'getListEnd',total:res.data.length}) | 184 | this.triggerEvent('event',{type:'getListEnd',total:res.data.length}) |
| 185 | + this.hasGetSellerEnd=true | ||
| 182 | }) | 186 | }) |
| 183 | }, | 187 | }, |
| 184 | /** | 188 | /** |
| @@ -287,4 +291,45 @@ Page({ | @@ -287,4 +291,45 @@ Page({ | ||
| 287 | setTimeout(()=>{this.getList();},0) | 291 | setTimeout(()=>{this.getList();},0) |
| 288 | this.selectComponent('#search-how').hide(); | 292 | this.selectComponent('#search-how').hide(); |
| 289 | }, | 293 | }, |
| 294 | + location:null, | ||
| 295 | + onpos(e){ | ||
| 296 | + console.log('onpos',this.hasGetSellerEnd,e); | ||
| 297 | + this.location=e.detail | ||
| 298 | + if(!this.hasGetSellerEnd){ | ||
| 299 | + return setTimeout(()=>{ | ||
| 300 | + this.onpos(e) | ||
| 301 | + },500) | ||
| 302 | + } | ||
| 303 | + if(this.data.markers.length<1){ | ||
| 304 | + this.GetRecommendSellerList() | ||
| 305 | + } | ||
| 306 | + }, | ||
| 307 | + GetRecommendSellerList(){ | ||
| 308 | + let param={sid:'sid'} | ||
| 309 | + if(this.location){ | ||
| 310 | + param.lat=this.location.latitude | ||
| 311 | + param.lng=this.location.longitude | ||
| 312 | + } | ||
| 313 | + App.Customer.GetRecommendSellerList(param).then(res=>{ | ||
| 314 | + this.setData({ | ||
| 315 | + rsl:res.data | ||
| 316 | + }) | ||
| 317 | + }) | ||
| 318 | + }, | ||
| 319 | + hasGoto:false, | ||
| 320 | + bindtransition(e){ | ||
| 321 | + if('change'==e.type){ | ||
| 322 | + this.hasGoto=false | ||
| 323 | + } | ||
| 324 | + if('animationfinish'==e.type){ | ||
| 325 | + if(this.hasGoto){ | ||
| 326 | + wx.switchTab({ | ||
| 327 | + url: '/pages/reserve/index' | ||
| 328 | + }) | ||
| 329 | + return; | ||
| 330 | + }else{ | ||
| 331 | + this.hasGoto=true | ||
| 332 | + } | ||
| 333 | + } | ||
| 334 | + }, | ||
| 290 | }) | 335 | }) |
| @@ -40,6 +40,10 @@ | @@ -40,6 +40,10 @@ | ||
| 40 | <view class="empry-info1">未找到符合要求的餐厅</view> | 40 | <view class="empry-info1">未找到符合要求的餐厅</view> |
| 41 | <view class="empry-info2">修改或减少条件,获取更多餐厅</view> | 41 | <view class="empry-info2">修改或减少条件,获取更多餐厅</view> |
| 42 | </block> | 42 | </block> |
| 43 | + <button class="button-none info-button" | ||
| 44 | + open-type="contact"> | ||
| 45 | + 人工帮订 | ||
| 46 | + </button> | ||
| 43 | </block> | 47 | </block> |
| 44 | </view> | 48 | </view> |
| 45 | <block wx:else=""> | 49 | <block wx:else=""> |
| @@ -62,3 +66,28 @@ | @@ -62,3 +66,28 @@ | ||
| 62 | bindactive="caixiActive" id="caixi" | 66 | bindactive="caixiActive" id="caixi" |
| 63 | ></caixi> | 67 | ></caixi> |
| 64 | <search-how id="search-how" findSellerData="{{findSellerData}}" bindevent="howEvent"></search-how> | 68 | <search-how id="search-how" findSellerData="{{findSellerData}}" bindevent="howEvent"></search-how> |
| 69 | +<block wx:if="{{rsl.length>0}}"> | ||
| 70 | + <view class="transverse-flxed"> | ||
| 71 | + <view class="line-push">为你推荐</view> | ||
| 72 | + <view class="transverse-list"> | ||
| 73 | + <swiper | ||
| 74 | + indicator-dots="{{false}}" autoplay="{{false}}" circular="{{false}}" vertical="{{false}}" | ||
| 75 | + interval="2000" duration="500" | ||
| 76 | + previous-margin="{{10}}px" next-margin="{{10}}px" style="height: 330rpx;" | ||
| 77 | + current="{{current}}" bindchange="bindtransition" bindanimationfinish="bindtransition"> | ||
| 78 | + <block wx:for="{{rsl}}" wx:key="rsl.key"> | ||
| 79 | + <swiper-item bindtap="gotoSellerDetail" id="{{item.id}}"> | ||
| 80 | + <view class="seller" id="seller-{{item.id}}"> | ||
| 81 | + <sb-tr seller="{{item}}" | ||
| 82 | + hasActivityTags="{{false}}" | ||
| 83 | + hasActivityShort="{{true}}" | ||
| 84 | + hasBrand="true" hasActivityTese="true" | ||
| 85 | + hasSlogan="{{false}}"></sb-tr> | ||
| 86 | + </view> | ||
| 87 | + </swiper-item> | ||
| 88 | + </block> | ||
| 89 | + </swiper> | ||
| 90 | + </view> | ||
| 91 | + </view> | ||
| 92 | +</block> | ||
| 93 | +<getpos bindpos="onpos" id="getpos" hasAllowFail hasAllowLoading="{{false}}"></getpos> |
| @@ -91,14 +91,14 @@ | @@ -91,14 +91,14 @@ | ||
| 91 | width: 90%; | 91 | width: 90%; |
| 92 | margin: 19rpx auto 0; | 92 | margin: 19rpx auto 0; |
| 93 | } | 93 | } |
| 94 | -.empty{margin-top: 230rpx; color: #353535} | 94 | +.empty{margin-top: 151rpx; color: #353535} |
| 95 | .empty image{ | 95 | .empty image{ |
| 96 | width: 191px; | 96 | width: 191px; |
| 97 | height: 158px; | 97 | height: 158px; |
| 98 | } | 98 | } |
| 99 | .empty view{ | 99 | .empty view{ |
| 100 | font-size: 28rpx; | 100 | font-size: 28rpx; |
| 101 | - margin-top: 86rpx; | 101 | + margin-top: 60rpx; |
| 102 | } | 102 | } |
| 103 | .empty view.empry-info2{ | 103 | .empty view.empry-info2{ |
| 104 | margin-top: 20rpx; | 104 | margin-top: 20rpx; |
| @@ -126,4 +126,42 @@ | @@ -126,4 +126,42 @@ | ||
| 126 | width:32rpx; | 126 | width:32rpx; |
| 127 | height: 30rpx; | 127 | height: 30rpx; |
| 128 | margin: 0 20rpx; | 128 | margin: 0 20rpx; |
| 129 | +} | ||
| 130 | +.info-button{ | ||
| 131 | + width:140rpx; | ||
| 132 | + height:50rpx; | ||
| 133 | + background:rgba(192,163,105,1); | ||
| 134 | + border-radius:25rpx; | ||
| 135 | + font-size:24rpx; | ||
| 136 | + font-weight:500; | ||
| 137 | + color:rgba(255,255,255,1); | ||
| 138 | + line-height: 50rpx; | ||
| 139 | + margin-top: 42rpx; | ||
| 140 | +} | ||
| 141 | + | ||
| 142 | +.transverse-flxed{ | ||
| 143 | + position: fixed; | ||
| 144 | + bottom: 0; | ||
| 145 | + width: 100%; | ||
| 146 | + z-index: 99; | ||
| 147 | +} | ||
| 148 | +.line-push{ | ||
| 149 | + background-image: url("http://qn.colorcun.com/reserve/images/line-push.png"); | ||
| 150 | + width: 328rpx; | ||
| 151 | + height: 42rpx; | ||
| 152 | + background-size: 100% 24rpx; | ||
| 153 | + margin: 0 auto; | ||
| 154 | + font-size:30rpx; | ||
| 155 | + color: #C0A369; | ||
| 156 | + line-height: 24rpx; | ||
| 157 | + background-repeat: no-repeat; | ||
| 158 | + text-align: center; | ||
| 159 | +} | ||
| 160 | +.transverse-list{ | ||
| 161 | + background-color: #fefefe; | ||
| 162 | + margin-top: 20rpx; | ||
| 163 | +} | ||
| 164 | +.transverse-list .seller{ | ||
| 165 | + width: 98%; | ||
| 166 | + margin: 0 auto; | ||
| 129 | } | 167 | } |
-
Please register or login to post a comment