|
...
|
...
|
@@ -21,11 +21,13 @@ Page({ |
|
|
|
hasMore:true,
|
|
|
|
hasDisabled:true,
|
|
|
|
hasSuggestion:false,
|
|
|
|
placeholder:'您好,几位,什么时候',
|
|
|
|
},
|
|
|
|
|
|
|
|
/**
|
|
|
|
* 生命周期函数--监听页面加载
|
|
|
|
*/
|
|
|
|
eventChannel:null,
|
|
|
|
onLoad: async function (options) {
|
|
|
|
//lat=34.21719&lng=108.89155&map={"errMsg":"getMapRegion:ok","southwest":{"longitude":108.87545674591064,"latitude":34.204520114013846},"northeast":{"longitude":108.90764325408935,"latitude":34.229857981005225},"scale":15}&multiIndex=1&tags=1,2
|
|
|
|
this.options=options;
|
|
...
|
...
|
@@ -52,7 +54,18 @@ Page({ |
|
|
|
multiIndex:[options.multiIndex],
|
|
|
|
tags:tags,
|
|
|
|
})
|
|
|
|
setTimeout(()=>{this.getList()},0)
|
|
|
|
this.eventChannel = this.getOpenerEventChannel()
|
|
|
|
// 监听acceptDataFromOpenerPage事件,获取上一页面通过eventChannel传送到当前页面的数据
|
|
|
|
this.eventChannel.on('acceptDataFromMapPage', findSellerData=> {
|
|
|
|
if(findSellerData){
|
|
|
|
this.findSellerData=findSellerData
|
|
|
|
console.log('findSellerData',findSellerData)
|
|
|
|
this.setData({
|
|
|
|
findSellerData:findSellerData,
|
|
|
|
})
|
|
|
|
}
|
|
|
|
})
|
|
|
|
setTimeout(()=>{this.getList()},300)
|
|
|
|
},
|
|
|
|
|
|
|
|
/**
|
|
...
|
...
|
@@ -143,6 +156,22 @@ Page({ |
|
|
|
if(tags.length>0){
|
|
|
|
this.param.tags=tags;
|
|
|
|
}
|
|
|
|
let placeholder='您好,几位,什么时候';
|
|
|
|
if(this.findSellerData){
|
|
|
|
console.log(this.findSellerData)
|
|
|
|
this.param=Object.assign(this.param,this.findSellerData.paramObj)
|
|
|
|
//4位 今天 午餐
|
|
|
|
let sp=this.findSellerData.params
|
|
|
|
placeholder=
|
|
|
|
sp.pnum.val+' 位 '
|
|
|
|
+util.unixtoTime(sp.date.val,' `DAY/MM-DD` ')
|
|
|
|
if(sp.dur){
|
|
|
|
placeholder+=' '+['','早餐','午餐','晚餐','夜宵'][sp.dur.val]
|
|
|
|
}
|
|
|
|
}
|
|
|
|
this.setData({
|
|
|
|
placeholder:placeholder,
|
|
|
|
})
|
|
|
|
App.Customer.SellerLists(this.param).then(res=>{
|
|
|
|
this.setData({
|
|
|
|
hasMore:res.data.length==this.size,
|
|
...
|
...
|
@@ -243,5 +272,14 @@ Page({ |
|
|
|
},
|
|
|
|
dispalySearchHow(){
|
|
|
|
this.selectComponent('#search-how').show();
|
|
|
|
}
|
|
|
|
},
|
|
|
|
howEvent(e){
|
|
|
|
this.eventChannel.emit('findSellerData',e.detail)
|
|
|
|
this.findSellerData=e.detail
|
|
|
|
this.setData({
|
|
|
|
findSellerData:e.detail
|
|
|
|
})
|
|
|
|
setTimeout(()=>{this.getList();},0)
|
|
|
|
this.selectComponent('#search-how').hide();
|
|
|
|
},
|
|
|
|
}) |
|
|
\ No newline at end of file |
...
|
...
|
|