Commit 8e0a9f93e9360dd84638f0617e025638eff9a63f

Authored by vking
1 parent 7dce30c3

filter 人均

... ... @@ -69,10 +69,22 @@ Component({
hasDisplay:false,
})
},
show(){
this.setData({
show(filterParams=null){
let obj={
hasDisplay:true,
})
}
if(filterParams){
if(filterParams.active){
obj.active=filterParams.active
}
this.min=filterParams.min
this.max=filterParams.max
obj.consumeStr=filterParams.consumeStr||''
}
this.setData(obj)
setTimeout(()=>{
this.selectComponent('#consume').changeVal(this.min,this.max);
},0)
},
submit(){
this.triggerEvent('event',{
... ...
... ... @@ -107,6 +107,9 @@ Page({
if(data.fun=='moveToLocation'){
this.moveToLocation();
}
if(data.fun=='filterEvent'){
this.filterEvent(data.e)
}
}
)
PubSub.on(
... ... @@ -511,7 +514,7 @@ Page({
if(this.filterParams.min==this.filterParams.max && this.filterParams.min==300){
filterParams=this.filterParams.min+','+parseInt(new Date()/1000)
}
param.filterParams=filterParams
param.average=filterParams
}
//this.selectComponent('#list').getList(param);
this.param=param;
... ... @@ -897,6 +900,7 @@ Page({
centre_pos:this.param.centre_pos,
hasSuggestion:this.data.hasSuggestion?1:'',
keyword:this.data.hasSuggestion?this.data.suggestion.title:'',
filterParams:this.filterParams?JSON.stringify(this.filterParams):null,
},'./indexList'),
success: res=> {
// 通过eventChannel向被打开页面传送数据
... ... @@ -990,15 +994,21 @@ Page({
}
},
filterShow(){
this.selectComponent('#filter').show();
this.selectComponent('#filter').show(this.filterParams);
},
filterParams:null,
filterEvent(e){
console.log('filterEvent',e)
if(e.detail.type=='clean'){
this.filterParams=null
this.setData({
filterParams:null,
})
}else{
this.filterParams=e.detail.data
this.setData({
filterParams:this.filterParams,
})
}
setTimeout(()=>{this.getMarkers();},0)
},
... ...
... ... @@ -55,12 +55,11 @@
</block>
<view
bindtap="filterShow"
class="tags {{multiIndex[0]>0?'active':''}}"
class="tags {{filterParams.consumeStr?'active':''}}"
>
<view class="picker flex-lr">
<view class="input">
<block wx:if="{{multiIndex[0]==0}}">筛选</block>
<block wx:else="">{{multiArray[0][multiIndex[0]]}}</block>
{{filterParams.consumeStr?filterParams.consumeStr:'筛选'}}
</view>
<view class="more"></view>
</view>
... ...
... ... @@ -31,8 +31,23 @@ Page({
*/
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
//lat=39.65273&lng=118.15813&map={"errMsg":"getMapRegion:ok","southwest":{"longitude":118.11012337295534,"latitude":39.61934377763755},"northeast":{"longitude":118.1262166270447,"latitude":39.63137569933196},"scale":15}&multiIndex=0&centre_pos=39.625360,118.118170&hasSuggestion=1&keywordTip=唐山站
/**
* lat=39.65273
* &lng=118.15813
* &map={"errMsg":"getMapRegion:ok","southwest":{"longitude":118.15008337295534,"latitude":39.64671615783738},"northeast":{"longitude":118.16617662704469,"latitude":39.65874331903751},"scale":15}
* &multiIndex=0
* &centre_pos=39.65273,118.15813
* &hasSuggestion=
* &keyword=
* &filterParams={"consumeStr":"¥200-300","min":"200","max":"300","active":"200,300"}
*/
this.filterParams=null
if(options.filterParams){
this.filterParams=JSON.parse(options.filterParams)
this.setData({
filterParams:this.filterParams,
})
}
this.options=options;
if(options.hasSuggestion){
let pos=options.centre_pos.split(',')
... ... @@ -244,6 +259,13 @@ Page({
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
}
App.Customer.SellerLists(this.param).then(res=>{
this.setData({
rsl:[],
... ... @@ -453,4 +475,32 @@ Page({
//PubSub.emit('searchParam', {fun:'moveToLocation'})
setTimeout(()=>{this.getList()},0)
},
filterShow(){
this.selectComponent('#filter').show(this.filterParams);
},
filterParams:null,
filterEvent(e){
console.log('filterEvent',e)
if(e.detail.type=='clean'){
this.filterParams=null
this.setData({
filterParams:null,
})
}else{
this.filterParams=e.detail.data
this.setData({
filterParams:this.filterParams,
})
}
setTimeout(()=>{this.getList();},0)
if(this.hasOneListPage()){
PubSub.emit(
'searchParam',
{
fun:'filterEvent',
e:e,
}
)
}
},
})
\ No newline at end of file
... ...
... ... @@ -10,6 +10,7 @@
"caixi":"/components/reserve/caixi",
"search-how":"/components/reserve/search/how/index",
"as-phone":"/components/actionSheet/phone",
"hr":"/components/hr"
"hr":"/components/hr",
"filter":"/components/reserve/search/filter"
}
}
\ No newline at end of file
... ...
... ... @@ -20,7 +20,7 @@
<view class="clean" catchtap="moveToLocation" wx:if="{{keyword && hasSuggestion}}"></view>
</view>
</view>
<view class="transverse-search flex-ll {{hasDisabled?'disabled':''}}">
<view class="transverse-search {{hasDisabled?'disabled':''}}">
<view
bindtap="caixiShow"
class="tags {{multiIndex[0]>0?'active':''}}"
... ... @@ -38,6 +38,17 @@
bindtap="tagsChange"
data-id="{{item.id}}">{{item.name}}</view>
</block>
<view
bindtap="filterShow"
class="tags {{filterParams.consumeStr?'active':''}}"
>
<view class="picker flex-lr">
<view class="input">
{{filterParams.consumeStr?filterParams.consumeStr:'筛选'}}
</view>
<view class="more"></view>
</view>
</view>
</view>
</view>
<view class="pages" wx:if="{{hasLoading}}">
... ... @@ -109,4 +120,5 @@
</view>
</block>
<getpos bindpos="onpos" id="getpos" hasAllowLoading="{{false}}"></getpos>
<as-phone id="as"></as-phone>
\ No newline at end of file
<as-phone id="as"></as-phone>
<filter id="filter" bindevent="filterEvent"></filter>
\ No newline at end of file
... ...
... ... @@ -10,10 +10,16 @@
.transverse-search{
background-color: #fefefe;
height: 60rpx;
width: 100%;
margin: 0 auto;
font-size: 24rpx;
padding-left: 20rpx;
width: calc(100% - 20rpx);
overflow-x: auto;
white-space:nowrap;
}
.transverse-search view{
display: inline-block;
}
.transverse-search .tags{
height: 50rpx;
... ...