|
...
|
...
|
@@ -24,6 +24,7 @@ Page({ |
|
|
|
placeholder:'您好,几位,什么时候',
|
|
|
|
search_placeholder:"搜索餐厅/位置,快速订包间",
|
|
|
|
hasLoading:true,
|
|
|
|
height:1000,
|
|
|
|
},
|
|
|
|
|
|
|
|
/**
|
|
...
|
...
|
@@ -41,6 +42,14 @@ Page({ |
|
|
|
* &keyword=
|
|
|
|
* &filterParams={"consumeStr":"¥200-300","min":"200","max":"300","active":"200,300"}
|
|
|
|
*/
|
|
|
|
wx.getSystemInfo({
|
|
|
|
success:res=>{
|
|
|
|
console.log('wx.getSystemInfo',res)
|
|
|
|
this.setData({
|
|
|
|
height:res.windowHeight-80
|
|
|
|
})
|
|
|
|
},
|
|
|
|
})
|
|
|
|
this.filterParams=null
|
|
|
|
if(options.filterParams){
|
|
|
|
this.filterParams=JSON.parse(options.filterParams)
|
|
...
|
...
|
@@ -170,6 +179,9 @@ Page({ |
|
|
|
hasGetSellerEnd:false,
|
|
|
|
hasCleanSuggestion:false,
|
|
|
|
async getList(){
|
|
|
|
this.setData({
|
|
|
|
hasLoading:true,
|
|
|
|
})
|
|
|
|
let mapParam=this.options
|
|
|
|
this.offset=1 //page
|
|
|
|
this.size=20 //page size
|
|
...
|
...
|
@@ -228,51 +240,28 @@ Page({ |
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
if(this.data.multiIndex[0]>0){
|
|
|
|
this.param.cuisine=await DA.getCatesID(this.data.multiIndex[0]-1);
|
|
|
|
this.hasFilterData=false
|
|
|
|
if(this.filterGroupData.tags){
|
|
|
|
this.param.tags = this.filterGroupData.tags;
|
|
|
|
this.hasFilterData=true
|
|
|
|
}
|
|
|
|
let tags=[];
|
|
|
|
this.data.tags.forEach(t=>{
|
|
|
|
if(t.active){
|
|
|
|
tags.push(t.id)
|
|
|
|
}
|
|
|
|
})
|
|
|
|
if(tags.length>0){
|
|
|
|
this.param.tags=tags;
|
|
|
|
if (this.filterGroupData.cuisine) {
|
|
|
|
this.param.cuisine = this.filterGroupData.cuisine;
|
|
|
|
this.hasFilterData=true
|
|
|
|
}
|
|
|
|
let placeholder='您好,几位,什么时候';
|
|
|
|
if(this.findSellerData){
|
|
|
|
console.log(this.findSellerData)
|
|
|
|
this.param=Object.assign(this.param,this.findSellerData.paramObj)
|
|
|
|
//4位 今天 午餐
|
|
|
|
let sp=this.findSellerData.params
|
|
|
|
if(sp.pnum.val>30){
|
|
|
|
placeholder = '30 位以上 '
|
|
|
|
}else{
|
|
|
|
placeholder = sp.pnum.val+' 位 '
|
|
|
|
}
|
|
|
|
placeholder += util.unixtoTime(sp.date.val,' `DAY/MM-DD` ')
|
|
|
|
if(sp.dur){
|
|
|
|
placeholder+=' '+['','早餐','午餐','晚餐','夜宵'][sp.dur.val]
|
|
|
|
}
|
|
|
|
}
|
|
|
|
this.setData({
|
|
|
|
placeholder:placeholder,
|
|
|
|
})
|
|
|
|
if(this.filterParams){//人均过滤
|
|
|
|
let filterParams=this.filterParams.min+','+this.filterParams.max
|
|
|
|
if(this.filterParams.min==this.filterParams.max && this.filterParams.min==300){
|
|
|
|
filterParams=this.filterParams.min+','+parseInt(new Date()/1000)
|
|
|
|
}
|
|
|
|
this.param.average=filterParams
|
|
|
|
if(this.filterGroupData.average){
|
|
|
|
this.param.average = this.filterGroupData.average;
|
|
|
|
this.hasFilterData=true
|
|
|
|
}
|
|
|
|
|
|
|
|
App.Customer.SellerLists(this.param).then(res=>{
|
|
|
|
this.setData({
|
|
|
|
rsl:[],
|
|
|
|
hasMore:res.data.length==this.size,
|
|
|
|
sellers:this.sellerFormat(res.data),
|
|
|
|
hasLoading:false,
|
|
|
|
hasDisabled:this.getHasDisabled(res.data.length>0,this.data.multiIndex[0]>0 || tags.length>0 || this.findSellerData)
|
|
|
|
//hasDisabled:this.getHasDisabled(res.data.length>0,this.data.multiIndex[0]>0 || tags.length>0 || this.findSellerData)
|
|
|
|
hasFilterData:this.hasFilterData,
|
|
|
|
})
|
|
|
|
this.hasGetSellerEnd=true
|
|
|
|
this.triggerEvent('event',{type:'getListEnd',total:res.data.length})
|
|
...
|
...
|
@@ -503,6 +492,22 @@ Page({ |
|
|
|
)
|
|
|
|
}
|
|
|
|
},
|
|
|
|
debounceTimer:null,
|
|
|
|
debounce(func,wait){
|
|
|
|
if(this.debounceTimer){
|
|
|
|
clearTimeout(this.debounceTimer)
|
|
|
|
}
|
|
|
|
this.debounceTimer=setTimeout(()=>{
|
|
|
|
this.debounceTimer=null;
|
|
|
|
func()
|
|
|
|
},wait);
|
|
|
|
},
|
|
|
|
filterGroupData:{},
|
|
|
|
filterGroupEvent(e){
|
|
|
|
console.log('filterGroupEvent',e.detail)
|
|
|
|
this.filterGroupData=e.detail
|
|
|
|
this.debounce(this.getList,500)
|
|
|
|
},
|
|
|
|
sellerCardEvent(e){
|
|
|
|
if(e.detail.type=='phone'){
|
|
|
|
this.selectComponent('#as').show(e.detail.seller);
|
...
|
...
|
|