Commit dea7ab26228362a418030e97480ceaa2c445e74e

Authored by vking
1 parent af1ee56b

search page map

... ... @@ -54,17 +54,19 @@ Page({
multiIndex:[options.multiIndex],
tags:tags,
})
this.eventChannel = this.getOpenerEventChannel()
// 监听acceptDataFromOpenerPage事件,获取上一页面通过eventChannel传送到当前页面的数据
this.eventChannel.on('acceptDataFromMapPage', findSellerData=> {
if(findSellerData){
this.findSellerData=findSellerData
console.log('findSellerData',findSellerData)
this.setData({
findSellerData:findSellerData,
})
}
})
try{
this.eventChannel = this.getOpenerEventChannel()
// 监听acceptDataFromOpenerPage事件,获取上一页面通过eventChannel传送到当前页面的数据
this.eventChannel.on('acceptDataFromMapPage', findSellerData=> {
if(findSellerData){
this.findSellerData=findSellerData
console.log('findSellerData',findSellerData)
this.setData({
findSellerData:findSellerData,
})
}
})
}catch(e){}
setTimeout(()=>{this.getList()},300)
},
... ... @@ -72,7 +74,7 @@ Page({
* 生命周期函数--监听页面初次渲染完成
*/
onReady: function () {
this.selectComponent('#getpos').getPos();
},
/**
... ... @@ -109,6 +111,7 @@ Page({
onReachBottom: function () {
this.getListMore()
},
hasGetSellerEnd:false,
async getList(){
let mapParam=this.options
this.offset=1 //page
... ... @@ -179,6 +182,7 @@ Page({
hasDisabled:this.getHasDisabled(res.data.length>0,this.data.multiIndex[0]>0 || tags.length>0)
})
this.triggerEvent('event',{type:'getListEnd',total:res.data.length})
this.hasGetSellerEnd=true
})
},
/**
... ... @@ -287,4 +291,45 @@ Page({
setTimeout(()=>{this.getList();},0)
this.selectComponent('#search-how').hide();
},
location:null,
onpos(e){
console.log('onpos',this.hasGetSellerEnd,e);
this.location=e.detail
if(!this.hasGetSellerEnd){
return setTimeout(()=>{
this.onpos(e)
},500)
}
if(this.data.markers.length<1){
this.GetRecommendSellerList()
}
},
GetRecommendSellerList(){
let param={sid:'sid'}
if(this.location){
param.lat=this.location.latitude
param.lng=this.location.longitude
}
App.Customer.GetRecommendSellerList(param).then(res=>{
this.setData({
rsl:res.data
})
})
},
hasGoto:false,
bindtransition(e){
if('change'==e.type){
this.hasGoto=false
}
if('animationfinish'==e.type){
if(this.hasGoto){
wx.switchTab({
url: '/pages/reserve/index'
})
return;
}else{
this.hasGoto=true
}
}
},
})
\ No newline at end of file
... ...
... ... @@ -40,6 +40,10 @@
<view class="empry-info1">未找到符合要求的餐厅</view>
<view class="empry-info2">修改或减少条件,获取更多餐厅</view>
</block>
<button class="button-none info-button"
open-type="contact">
人工帮订
</button>
</block>
</view>
<block wx:else="">
... ... @@ -62,3 +66,28 @@
bindactive="caixiActive" id="caixi"
></caixi>
<search-how id="search-how" findSellerData="{{findSellerData}}" bindevent="howEvent"></search-how>
<block wx:if="{{rsl.length>0}}">
<view class="transverse-flxed">
<view class="line-push">为你推荐</view>
<view class="transverse-list">
<swiper
indicator-dots="{{false}}" autoplay="{{false}}" circular="{{false}}" vertical="{{false}}"
interval="2000" duration="500"
previous-margin="{{10}}px" next-margin="{{10}}px" style="height: 330rpx;"
current="{{current}}" bindchange="bindtransition" bindanimationfinish="bindtransition">
<block wx:for="{{rsl}}" wx:key="rsl.key">
<swiper-item bindtap="gotoSellerDetail" id="{{item.id}}">
<view class="seller" id="seller-{{item.id}}">
<sb-tr seller="{{item}}"
hasActivityTags="{{false}}"
hasActivityShort="{{true}}"
hasBrand="true" hasActivityTese="true"
hasSlogan="{{false}}"></sb-tr>
</view>
</swiper-item>
</block>
</swiper>
</view>
</view>
</block>
<getpos bindpos="onpos" id="getpos" hasAllowFail hasAllowLoading="{{false}}"></getpos>
\ No newline at end of file
... ...
... ... @@ -91,14 +91,14 @@
width: 90%;
margin: 19rpx auto 0;
}
.empty{margin-top: 230rpx; color: #353535}
.empty{margin-top: 151rpx; color: #353535}
.empty image{
width: 191px;
height: 158px;
}
.empty view{
font-size: 28rpx;
margin-top: 86rpx;
margin-top: 60rpx;
}
.empty view.empry-info2{
margin-top: 20rpx;
... ... @@ -126,4 +126,42 @@
width:32rpx;
height: 30rpx;
margin: 0 20rpx;
}
.info-button{
width:140rpx;
height:50rpx;
background:rgba(192,163,105,1);
border-radius:25rpx;
font-size:24rpx;
font-weight:500;
color:rgba(255,255,255,1);
line-height: 50rpx;
margin-top: 42rpx;
}
.transverse-flxed{
position: fixed;
bottom: 0;
width: 100%;
z-index: 99;
}
.line-push{
background-image: url("http://qn.colorcun.com/reserve/images/line-push.png");
width: 328rpx;
height: 42rpx;
background-size: 100% 24rpx;
margin: 0 auto;
font-size:30rpx;
color: #C0A369;
line-height: 24rpx;
background-repeat: no-repeat;
text-align: center;
}
.transverse-list{
background-color: #fefefe;
margin-top: 20rpx;
}
.transverse-list .seller{
width: 98%;
margin: 0 auto;
}
\ No newline at end of file
... ...