Showing
18 changed files
with
265 additions
and
101 deletions
| 1 | <!--components/reserve/search/filter.wxml--> | 1 | <!--components/reserve/search/filter.wxml--> |
| 2 | -<view class="filter {{hasDisplay?'animation-slide-top':''}}" catchtap="catchtap" wx:if="{{hasDisplay}}"> | 2 | +<view class="filter {{cla}} {{(hasDisplay && !cla)?'animation-slide-top':''}}" catchtap="catchtap" wx:if="{{hasDisplay}}"> |
| 3 | <view class="part flex-ll"> | 3 | <view class="part flex-ll"> |
| 4 | 人均消费 | 4 | 人均消费 |
| 5 | <view class="txt" wx:if="{{consumeStr}}">{{consumeStr}}</view> | 5 | <view class="txt" wx:if="{{consumeStr}}">{{consumeStr}}</view> |
| @@ -10,7 +10,9 @@ | @@ -10,7 +10,9 @@ | ||
| 10 | box-sizing: border-box; | 10 | box-sizing: border-box; |
| 11 | border-radius: 0px 0px 40rpx 40rpx; | 11 | border-radius: 0px 0px 40rpx 40rpx; |
| 12 | } | 12 | } |
| 13 | - | 13 | +.bottom-search{ |
| 14 | + border-radius: 40rpx 40rpx 0px 0px ; | ||
| 15 | +} | ||
| 14 | .part{ | 16 | .part{ |
| 15 | height: 48rpx; | 17 | height: 48rpx; |
| 16 | font-size: 34rpx; | 18 | font-size: 34rpx; |
| 1 | // components/reserve/search/how/hv/pnum.js | 1 | // components/reserve/search/how/hv/pnum.js |
| 2 | +/** | ||
| 3 | + 早餐:7:00 —10:00 | ||
| 4 | + 午餐:11:00 — 14:30 | ||
| 5 | + 晚餐:16:00—22:00 | ||
| 6 | + 取最近未到的时段 | ||
| 7 | + 当天最后一个时段过了,那就第二天第一个时段 | ||
| 8 | + */ | ||
| 9 | +import util from '../../../../utils/util' | ||
| 2 | var myBehavior = require('hv_behavior') | 10 | var myBehavior = require('hv_behavior') |
| 3 | const items=[ | 11 | const items=[ |
| 4 | - {id:1,label:'早餐'}, | ||
| 5 | - {id:2,label:'午餐'}, | ||
| 6 | - {id:3,label:'晚餐'}, | 12 | + {id:1,label:'早餐',stime:'07:00',etime:'10:00'}, |
| 13 | + {id:2,label:'午餐',stime:'11:00',etime:'14:30'}, | ||
| 14 | + {id:3,label:'晚餐',stime:'16:00',etime:'22:00'}, | ||
| 7 | {}, | 15 | {}, |
| 8 | {}, | 16 | {}, |
| 9 | ] | 17 | ] |
| @@ -12,20 +20,36 @@ Component({ | @@ -12,20 +20,36 @@ Component({ | ||
| 12 | data:{ | 20 | data:{ |
| 13 | items:items, | 21 | items:items, |
| 14 | }, | 22 | }, |
| 15 | - lifetimes: { | ||
| 16 | - created: function () { | ||
| 17 | - // 在组件实例进入页面节点树时执行 | ||
| 18 | - this.type='dur' | ||
| 19 | - }, | ||
| 20 | - detached: function () { | ||
| 21 | - // 在组件实例被从页面节点树移除时执行 | ||
| 22 | - }, | 23 | + created: function () { |
| 24 | + // 在组件实例进入页面节点树时执行 | ||
| 25 | + this.type='dur' | ||
| 26 | + this.autoChecked()//自动选中 | ||
| 23 | }, | 27 | }, |
| 24 | 28 | ||
| 25 | /** | 29 | /** |
| 26 | * 组件的方法列表 | 30 | * 组件的方法列表 |
| 27 | */ | 31 | */ |
| 28 | methods: { | 32 | methods: { |
| 33 | + autoChecked(){ | ||
| 34 | + let now=parseInt(new Date()/1000); | ||
| 35 | + let nowHHII=util.unixtoTime(now,'HH:II') | ||
| 36 | + let activeIndex=0 | ||
| 37 | + if(nowHHII>items[0].etime && nowHHII<=items[2].etime){//有效时间内计算 | ||
| 38 | + activeIndex=1 | ||
| 39 | + if(nowHHII>items[1].etime){ | ||
| 40 | + activeIndex=2 | ||
| 41 | + } | ||
| 42 | + } | ||
| 43 | + let dataset={ | ||
| 44 | + index:activeIndex, | ||
| 45 | + val:items[activeIndex].id, | ||
| 46 | + type:'dur', | ||
| 47 | + } | ||
| 48 | + //console.log('dur-dataset',dataset) | ||
| 49 | + setTimeout(()=>{ | ||
| 50 | + this.checked({currentTarget:{dataset:dataset}}) | ||
| 51 | + },0) | ||
| 29 | 52 | ||
| 53 | + } | ||
| 30 | } | 54 | } |
| 31 | }) | 55 | }) |
| @@ -28,6 +28,9 @@ Component({ | @@ -28,6 +28,9 @@ Component({ | ||
| 28 | this.setData({ | 28 | this.setData({ |
| 29 | hidden:!this.data.hasPage | 29 | hidden:!this.data.hasPage |
| 30 | }) | 30 | }) |
| 31 | + setTimeout(()=>{ | ||
| 32 | + this.submit() | ||
| 33 | + },0) | ||
| 31 | }, | 34 | }, |
| 32 | observers: { | 35 | observers: { |
| 33 | 'findSellerData': function(findSellerData) { | 36 | 'findSellerData': function(findSellerData) { |
| @@ -57,6 +60,9 @@ Component({ | @@ -57,6 +60,9 @@ Component({ | ||
| 57 | this.triggerEvent('event',{ | 60 | this.triggerEvent('event',{ |
| 58 | params:this.params, | 61 | params:this.params, |
| 59 | paramObj:paramObj, | 62 | paramObj:paramObj, |
| 63 | + paramStr:util.unixtoTime(this.params['date'].val,'MM月DD日(`DAY/周WW`)') | ||
| 64 | + +' '+{1:'早餐',2:'午餐',3:'晚餐'}[this.params['dur'].val] | ||
| 65 | + +' '+this.params['pnum'].val+'位', | ||
| 60 | }) | 66 | }) |
| 61 | }, | 67 | }, |
| 62 | show(){ | 68 | show(){ |
| @@ -3,7 +3,7 @@ | @@ -3,7 +3,7 @@ | ||
| 3 | <view class="mask" wx:if="{{!hasPage}}" bindtap="hide"></view> | 3 | <view class="mask" wx:if="{{!hasPage}}" bindtap="hide"></view> |
| 4 | <view class="{{hasPage?'pages':'pages-window'}}"> | 4 | <view class="{{hasPage?'pages':'pages-window'}}"> |
| 5 | <view class="title flex-lr"> | 5 | <view class="title flex-lr"> |
| 6 | - <view class="title-name">您好,几位,什么时候</view> | 6 | + <view class="title-name">您几位?什么时间用餐?</view> |
| 7 | <view class="close33" bindtap="hide"></view> | 7 | <view class="close33" bindtap="hide"></view> |
| 8 | </view> | 8 | </view> |
| 9 | <view> | 9 | <view> |
| @@ -34,12 +34,18 @@ Component({ | @@ -34,12 +34,18 @@ Component({ | ||
| 34 | this.position={} | 34 | this.position={} |
| 35 | this.isAddr=false | 35 | this.isAddr=false |
| 36 | this.citys=await DA.getCitys() | 36 | this.citys=await DA.getCitys() |
| 37 | + this.cacheCity=null | ||
| 37 | this.setData({ | 38 | this.setData({ |
| 38 | citys: this.citys | 39 | citys: this.citys |
| 39 | }) | 40 | }) |
| 41 | + let cache=util.cache(CACHE_LOCALTION_KEY) | ||
| 42 | + if(cache && cache.city){ | ||
| 43 | + this.cacheCity=cache.city | ||
| 44 | + } | ||
| 40 | this.selectComponent('#getpos').getPos(); | 45 | this.selectComponent('#getpos').getPos(); |
| 41 | }, | 46 | }, |
| 42 | rePos(e){ | 47 | rePos(e){ |
| 48 | + this.cacheCity=null | ||
| 43 | this.isAddr=util.attr(e,'isAddr') | 49 | this.isAddr=util.attr(e,'isAddr') |
| 44 | this.selectComponent('#getpos').getPos(); | 50 | this.selectComponent('#getpos').getPos(); |
| 45 | }, | 51 | }, |
| @@ -63,6 +69,7 @@ Component({ | @@ -63,6 +69,7 @@ Component({ | ||
| 63 | activeCity:activeCity, | 69 | activeCity:activeCity, |
| 64 | }) | 70 | }) |
| 65 | this.event({city:activeCity,address:this.position.address,isAddr:false}) | 71 | this.event({city:activeCity,address:this.position.address,isAddr:false}) |
| 72 | + this.hide() | ||
| 66 | }, | 73 | }, |
| 67 | onpos(e) { | 74 | onpos(e) { |
| 68 | let res = e.detail; | 75 | let res = e.detail; |
| @@ -80,7 +87,9 @@ Component({ | @@ -80,7 +87,9 @@ Component({ | ||
| 80 | this.position.address_component= res.result.address_component | 87 | this.position.address_component= res.result.address_component |
| 81 | this.position.address=res.result.address | 88 | this.position.address=res.result.address |
| 82 | let activeCity={} | 89 | let activeCity={} |
| 83 | - if(!this.data.code){ | 90 | + if(this.cacheCity){ |
| 91 | + activeCity=this.cacheCity | ||
| 92 | + }else if(!this.data.code){ | ||
| 84 | this.citys.some(ci=>{ | 93 | this.citys.some(ci=>{ |
| 85 | if(ci.name==this.position.address_component.city){ | 94 | if(ci.name==this.position.address_component.city){ |
| 86 | activeCity=ci | 95 | activeCity=ci |
| @@ -95,6 +104,7 @@ Component({ | @@ -95,6 +104,7 @@ Component({ | ||
| 95 | } | 104 | } |
| 96 | }) | 105 | }) |
| 97 | } | 106 | } |
| 107 | + | ||
| 98 | this.setData({ | 108 | this.setData({ |
| 99 | activeCity:activeCity, | 109 | activeCity:activeCity, |
| 100 | address:this.position.address | 110 | address:this.position.address |
| @@ -4,7 +4,9 @@ | @@ -4,7 +4,9 @@ | ||
| 4 | <view class="nav" style="margin-top: {{statusBarHeight}}px;"> | 4 | <view class="nav" style="margin-top: {{statusBarHeight}}px;"> |
| 5 | <view class="flex-lr part" style="height: {{titleBarHeight}}px; line-height: {{titleBarHeight}}px"> | 5 | <view class="flex-lr part" style="height: {{titleBarHeight}}px; line-height: {{titleBarHeight}}px"> |
| 6 | <view class="opt flex-ll"> | 6 | <view class="opt flex-ll"> |
| 7 | - <view class="back flex-vc" bindtap="back" wx:if="{{disBack}}"> | 7 | + <view class="back flex-vc" |
| 8 | + style="height: {{titleBarHeight}}px; line-height: {{titleBarHeight}}px" | ||
| 9 | + bindtap="back" wx:if="{{disBack}}"> | ||
| 8 | <image class="back-image" | 10 | <image class="back-image" |
| 9 | src="http://nosqn.colorcun.com/custom/lite-yd/image/back{{backgroundColor!='#ffffff'?'-light':''}}.png"></image> | 11 | src="http://nosqn.colorcun.com/custom/lite-yd/image/back{{backgroundColor!='#ffffff'?'-light':''}}.png"></image> |
| 10 | </view> | 12 | </view> |
| @@ -42,6 +42,11 @@ Page({ | @@ -42,6 +42,11 @@ Page({ | ||
| 42 | * &keyword= | 42 | * &keyword= |
| 43 | * &filterParams={"consumeStr":"¥200-300","min":"200","max":"300","active":"200,300"} | 43 | * &filterParams={"consumeStr":"¥200-300","min":"200","max":"300","active":"200,300"} |
| 44 | */ | 44 | */ |
| 45 | + /** | ||
| 46 | + hasSuggestion=1&keyword=橡树湾&lat=39.662877&lng=118.130962¢re_pos=39.662877,118.130962&multiIndex=0&filter={"consumeStr":"¥200-300","min":"200","max":"300","active":"200,300"}&city={"code":"610100","pid":"610000","name":"西安市","status":"1","last_date":"1598949575"}&hows={"params":{"pnum":{"index":3,"val":4,"type":"pnum"},"date":{"index":0,"val":1606983211,"type":"date"},"dur":{"index":2,"val":3,"type":"dur"}},"paramObj":{"when_date":"2020-12-03","several":4,"daily":3},"paramStr":"12月03日(今天) 晚餐 4位"} | ||
| 47 | + | ||
| 48 | + city={"code":"130200","pid":"130000","name":"唐山市","status":"1","last_date":"1598949575"}&hows={"params":{"pnum":{"index":3,"val":4,"type":"pnum"},"date":{"index":0,"val":1606984766,"type":"date"},"dur":{"index":2,"val":3,"type":"dur"}},"paramObj":{"when_date":"2020-12-03","several":4,"daily":3},"paramStr":"12月03日(今天) 晚餐 4位"} | ||
| 49 | + */ | ||
| 45 | wx.getSystemInfo({ | 50 | wx.getSystemInfo({ |
| 46 | success:res=>{ | 51 | success:res=>{ |
| 47 | console.log('wx.getSystemInfo',res) | 52 | console.log('wx.getSystemInfo',res) |
| @@ -51,12 +56,25 @@ Page({ | @@ -51,12 +56,25 @@ Page({ | ||
| 51 | }, | 56 | }, |
| 52 | }) | 57 | }) |
| 53 | this.filterParams=null | 58 | this.filterParams=null |
| 54 | - if(options.filterParams){ | ||
| 55 | - this.filterParams=JSON.parse(options.filterParams) | 59 | + if(options.filter){ |
| 60 | + this.filterParams=JSON.parse(options.filter) | ||
| 56 | this.setData({ | 61 | this.setData({ |
| 57 | filterParams:this.filterParams, | 62 | filterParams:this.filterParams, |
| 58 | }) | 63 | }) |
| 59 | } | 64 | } |
| 65 | + if(options.city){ | ||
| 66 | + this.city=JSON.parse(options.city) | ||
| 67 | + } | ||
| 68 | + if(options.hows){ | ||
| 69 | + this.hows=JSON.parse(options.hows) | ||
| 70 | + let paramStr=this.hows.paramStr.split(" "); | ||
| 71 | + this.setData({ | ||
| 72 | + headerHows:[ | ||
| 73 | + paramStr[0].substr(0,6), | ||
| 74 | + paramStr[1]+' '+paramStr[2], | ||
| 75 | + ], | ||
| 76 | + }) | ||
| 77 | + } | ||
| 60 | this.options=options; | 78 | this.options=options; |
| 61 | if(options.hasSuggestion){ | 79 | if(options.hasSuggestion){ |
| 62 | let pos=options.centre_pos.split(',') | 80 | let pos=options.centre_pos.split(',') |
| @@ -102,7 +120,7 @@ Page({ | @@ -102,7 +120,7 @@ Page({ | ||
| 102 | } | 120 | } |
| 103 | }) | 121 | }) |
| 104 | }catch(e){} | 122 | }catch(e){} |
| 105 | - setTimeout(()=>{this.getList()},300) | 123 | + //setTimeout(()=>{this.getList()},300) |
| 106 | 124 | ||
| 107 | }, | 125 | }, |
| 108 | 126 | ||
| @@ -127,6 +145,13 @@ Page({ | @@ -127,6 +145,13 @@ Page({ | ||
| 127 | } | 145 | } |
| 128 | } | 146 | } |
| 129 | ) | 147 | ) |
| 148 | + if(wx.getMenuButtonBoundingClientRect){ | ||
| 149 | + let rect=wx.getMenuButtonBoundingClientRect() | ||
| 150 | + console.log(rect,getApp().system) | ||
| 151 | + this.setData({ | ||
| 152 | + right:getApp().system.windowWidth - rect.right + rect.width + 10, | ||
| 153 | + }) | ||
| 154 | + } | ||
| 130 | }, | 155 | }, |
| 131 | 156 | ||
| 132 | /** | 157 | /** |
| @@ -182,64 +207,21 @@ Page({ | @@ -182,64 +207,21 @@ Page({ | ||
| 182 | this.setData({ | 207 | this.setData({ |
| 183 | hasLoading:true, | 208 | hasLoading:true, |
| 184 | }) | 209 | }) |
| 185 | - let mapParam=this.options | ||
| 186 | this.offset=1 //page | 210 | this.offset=1 //page |
| 187 | this.size=20 //page size | 211 | this.size=20 //page size |
| 188 | - this.setData({ | ||
| 189 | - keyword:mapParam.keyword||'', | ||
| 190 | - }) | ||
| 191 | - | ||
| 192 | - if(mapParam.keyword){ | ||
| 193 | - this.param={ | ||
| 194 | - lat_extend:mapParam.lat, | ||
| 195 | - lng_extend:mapParam.lng, | ||
| 196 | - keyword:mapParam.keyword.trim(), | ||
| 197 | - offset:this.offset, | ||
| 198 | - size:this.size, | ||
| 199 | - distance:500000, | ||
| 200 | - }; | ||
| 201 | - if(mapParam.lat){ | ||
| 202 | - this.param.centre_pos=`${mapParam.lat},${mapParam.lng}` | ||
| 203 | - } | ||
| 204 | - if(mapParam.isopen_md){ | ||
| 205 | - this.param.isopen_md=1 | ||
| 206 | - } | ||
| 207 | - }else{ | ||
| 208 | - //计算视窗中心 | ||
| 209 | - let lat,lng | ||
| 210 | - if(this.suggestion){ | ||
| 211 | - lat=this.suggestion.latitude | ||
| 212 | - lng=this.suggestion.longitude | ||
| 213 | - this.setData({ | ||
| 214 | - keyword:this.suggestion.title, | ||
| 215 | - }) | ||
| 216 | - }else if(this.hasCleanSuggestion){//清理地标使用人的位置 | ||
| 217 | - lat=this.location.latitude | ||
| 218 | - lng=this.location.longitude | ||
| 219 | - } | ||
| 220 | - if(!lat || !lng){//不完整时,使用地图中心点 | ||
| 221 | - let map=JSON.parse(mapParam.map); | ||
| 222 | - lat=map.northeast.latitude-(map.northeast.latitude-map.southwest.latitude)/2; | ||
| 223 | - lng=map.northeast.longitude-(map.northeast.longitude-map.southwest.longitude)/2; | ||
| 224 | - } | ||
| 225 | - this.param={ | ||
| 226 | - lat:lat, | ||
| 227 | - lng:lng, | ||
| 228 | - lat_extend:mapParam.lat, | ||
| 229 | - lng_extend:mapParam.lng, | ||
| 230 | - offset:this.offset, | ||
| 231 | - size:this.size, | ||
| 232 | - distance:50, | ||
| 233 | - }; | ||
| 234 | - if(this.suggestion || this.hasCleanSuggestion){ | ||
| 235 | - this.param.centre_pos=`${lat},${lng}` | ||
| 236 | - }else{ | ||
| 237 | - if(mapParam.centre_pos){ | ||
| 238 | - this.param.centre_pos=mapParam.centre_pos | ||
| 239 | - } | ||
| 240 | - } | 212 | + this.param={ |
| 213 | + offset:this.offset, | ||
| 214 | + size:this.size, | ||
| 215 | + code:this.city.code, | ||
| 216 | + pid:this.city.pid, | ||
| 217 | + keyword:this.options.keyword||'', | ||
| 218 | + ...this.hows.paramObj, | ||
| 219 | + } | ||
| 220 | + console.log('this.location',this.location) | ||
| 221 | + if(this.location){ | ||
| 222 | + this.param.lat_extend=this.location.latitude | ||
| 223 | + this.param.lng_extend=this.location.longitude | ||
| 241 | } | 224 | } |
| 242 | - | ||
| 243 | this.hasFilterData=false | 225 | this.hasFilterData=false |
| 244 | if(this.filterGroupData.tags){ | 226 | if(this.filterGroupData.tags){ |
| 245 | this.param.tags = this.filterGroupData.tags; | 227 | this.param.tags = this.filterGroupData.tags; |
| @@ -254,7 +236,7 @@ Page({ | @@ -254,7 +236,7 @@ Page({ | ||
| 254 | this.hasFilterData=true | 236 | this.hasFilterData=true |
| 255 | } | 237 | } |
| 256 | 238 | ||
| 257 | - App.Customer.SellerLists(this.param).then(res=>{ | 239 | + App.Customer.GetSellerListByFoods(this.param).then(res=>{ |
| 258 | this.setData({ | 240 | this.setData({ |
| 259 | rsl:[], | 241 | rsl:[], |
| 260 | hasMore:res.data.length==this.size, | 242 | hasMore:res.data.length==this.size, |
| @@ -283,7 +265,7 @@ Page({ | @@ -283,7 +265,7 @@ Page({ | ||
| 283 | getListMore(){ | 265 | getListMore(){ |
| 284 | this.param.offset+=1; | 266 | this.param.offset+=1; |
| 285 | let sellers=this.data.sellers; | 267 | let sellers=this.data.sellers; |
| 286 | - App.Customer.SellerLists(this.param).then(res=>{ | 268 | + App.Customer.GetSellerListByFoods(this.param).then(res=>{ |
| 287 | this.setData({ | 269 | this.setData({ |
| 288 | hasMore:res.data.length==this.size, | 270 | hasMore:res.data.length==this.size, |
| 289 | sellers:sellers.concat(this.sellerFormat(res.data)), | 271 | sellers:sellers.concat(this.sellerFormat(res.data)), |
| @@ -384,11 +366,7 @@ Page({ | @@ -384,11 +366,7 @@ Page({ | ||
| 384 | onpos(e){ | 366 | onpos(e){ |
| 385 | console.log('onpos',this.hasGetSellerEnd,e); | 367 | console.log('onpos',this.hasGetSellerEnd,e); |
| 386 | this.location=e.detail | 368 | this.location=e.detail |
| 387 | - if(!this.hasGetSellerEnd){ | ||
| 388 | - return setTimeout(()=>{ | ||
| 389 | - this.onpos(e) | ||
| 390 | - },500) | ||
| 391 | - } | 369 | + this.getList() |
| 392 | // if(this.data.sellers.length<1){ | 370 | // if(this.data.sellers.length<1){ |
| 393 | // this.GetRecommendSellerList() | 371 | // this.GetRecommendSellerList() |
| 394 | // } | 372 | // } |
| @@ -513,4 +491,20 @@ Page({ | @@ -513,4 +491,20 @@ Page({ | ||
| 513 | this.selectComponent('#as').show(e.detail.seller); | 491 | this.selectComponent('#as').show(e.detail.seller); |
| 514 | } | 492 | } |
| 515 | }, | 493 | }, |
| 494 | + searchKeyword(){ | ||
| 495 | + let pages = getCurrentPages(); | ||
| 496 | + if(pages.length>=2){ | ||
| 497 | + let p = pages[pages.length - 2]; | ||
| 498 | + if(p.route=='pages/reserve/searchKeyword') { | ||
| 499 | + return wx.navigateBack(); | ||
| 500 | + } | ||
| 501 | + } | ||
| 502 | + wx.navigateTo({ | ||
| 503 | + url:util.http_build_query({ | ||
| 504 | + filter:this.filterParams?JSON.stringify(this.filterParams):null, | ||
| 505 | + city:JSON.stringify(this.city), | ||
| 506 | + hows:JSON.stringify(this.hows), | ||
| 507 | + },'/pages/reserve/searchKeyword') | ||
| 508 | + }) | ||
| 509 | + }, | ||
| 516 | }) | 510 | }) |
| 1 | <!--pages/reserve/indexList.wxml--> | 1 | <!--pages/reserve/indexList.wxml--> |
| 2 | -<nav>周到安排</nav> | ||
| 3 | -<view class="view content" style="height: calc(100vh - 65px);"> | 2 | +<nav> |
| 3 | + <view class="view header flex align-center justify-center text-blue" style="right:{{right}}px;" wx:if="{{right>0}}"> | ||
| 4 | + <view class="view flex flex-direction" style="width: 174rpx;"> | ||
| 5 | + <view class="view txt-26-h">{{headerHows[0]}}</view> | ||
| 6 | + <view class="view txt-26-h">{{headerHows[1]}}</view> | ||
| 7 | + </view> | ||
| 8 | + <view class="line margin-lr"></view> | ||
| 9 | + <view class="flex justify-around align-center" style="width: 292rpx;"> | ||
| 10 | + <image class="margin-right-sm" wx:if="{{!keyword}}" | ||
| 11 | + style="width: 32rpx; height: 32rpx;" src="http://nosqn.colorcun.com/search/s%20%2811%29.png"></image> | ||
| 12 | + <view class="view text-cut txt-34-h" catchtap="searchKeyword">{{keyword||'搜索餐厅…'}}</view> | ||
| 13 | + <view class="clean margin-left-sm" catchtap="moveToLocation" wx:if="{{keyword}}"></view> | ||
| 14 | + </view> | ||
| 15 | + </view> | ||
| 16 | +</nav> | ||
| 17 | + <!-- | ||
| 4 | <view class="searchAddrView searchKeyword bg-white" bindtap="gotoSearch"> | 18 | <view class="searchAddrView searchKeyword bg-white" bindtap="gotoSearch"> |
| 5 | <view class="searchAddr flex-ll"> | 19 | <view class="searchAddr flex-ll"> |
| 6 | <image class="icon" src="http://nosqn.colorcun.com/custom/lite-online/image/search26.png"></image> | 20 | <image class="icon" src="http://nosqn.colorcun.com/custom/lite-online/image/search26.png"></image> |
| @@ -10,6 +24,8 @@ | @@ -10,6 +24,8 @@ | ||
| 10 | <view class="clean" catchtap="moveToLocation" wx:if="{{keyword && hasSuggestion}}"></view> | 24 | <view class="clean" catchtap="moveToLocation" wx:if="{{keyword && hasSuggestion}}"></view> |
| 11 | </view> | 25 | </view> |
| 12 | </view> | 26 | </view> |
| 27 | + --> | ||
| 28 | +<view class="view content" style="height: calc(100vh - 65px);"> | ||
| 13 | <filter-group height="{{height}}" | 29 | <filter-group height="{{height}}" |
| 14 | id="filter-group" | 30 | id="filter-group" |
| 15 | bindevent="filterGroupEvent" | 31 | bindevent="filterGroupEvent" |
| @@ -33,7 +49,7 @@ | @@ -33,7 +49,7 @@ | ||
| 33 | scroll-into-view="seller-{{scrollSellerID}}" | 49 | scroll-into-view="seller-{{scrollSellerID}}" |
| 34 | scroll-with-animation | 50 | scroll-with-animation |
| 35 | bindscrolltolower="getListMore" | 51 | bindscrolltolower="getListMore" |
| 36 | - style="width:100%;height: calc(100vh - 150px);"> | 52 | + style="width:100%;height: calc(100vh - 65px);"> |
| 37 | <block wx:for="{{sellers}}" wx:key="sellers" > | 53 | <block wx:for="{{sellers}}" wx:key="sellers" > |
| 38 | <navigator url="/pages/reserve/detail?id={{item.id}}" hover-class="navigator-hover"> | 54 | <navigator url="/pages/reserve/detail?id={{item.id}}" hover-class="navigator-hover"> |
| 39 | <seller-card class="seller-card" id="seller-{{item.id}}" | 55 | <seller-card class="seller-card" id="seller-{{item.id}}" |
| @@ -41,7 +57,7 @@ | @@ -41,7 +57,7 @@ | ||
| 41 | seller="{{item}}" bindevent="sellerCardEvent" ></seller-card> | 57 | seller="{{item}}" bindevent="sellerCardEvent" ></seller-card> |
| 42 | </navigator> | 58 | </navigator> |
| 43 | </block> | 59 | </block> |
| 44 | - <view class="view" style="height: 50rpx;"></view> | 60 | + <view class="view" style="height: 160rpx;"></view> |
| 45 | </scroll-view> | 61 | </scroll-view> |
| 46 | </block> | 62 | </block> |
| 47 | </view> | 63 | </view> |
| @@ -227,4 +227,38 @@ | @@ -227,4 +227,38 @@ | ||
| 227 | position: absolute; | 227 | position: absolute; |
| 228 | top:16rpx; | 228 | top:16rpx; |
| 229 | left:32rpx; | 229 | left:32rpx; |
| 230 | +} | ||
| 231 | + | ||
| 232 | + | ||
| 233 | + | ||
| 234 | +.header{ | ||
| 235 | + width: 468rpx; | ||
| 236 | + height: 80rpx; | ||
| 237 | + background: #F4FAFF; | ||
| 238 | + border-radius: 48rpx; | ||
| 239 | + border: 2rpx solid #4C91F8; | ||
| 240 | + position: fixed; | ||
| 241 | + font-weight: 500; | ||
| 242 | +} | ||
| 243 | +.header .line{ | ||
| 244 | + width: 2rpx; | ||
| 245 | + height: 32rpx; | ||
| 246 | + background: #42A5FF; | ||
| 247 | +} | ||
| 248 | +.header .clean{ | ||
| 249 | + position: relative; | ||
| 250 | + width: 100rpx; | ||
| 251 | + height: 60rpx; | ||
| 252 | + min-width: 100rpx; | ||
| 253 | +} | ||
| 254 | +.header .clean:after{ | ||
| 255 | + background-image: url("http://nosqn.colorcun.com/clean.png"); | ||
| 256 | + background-size: 100% 100%; | ||
| 257 | + display: block; | ||
| 258 | + content: ""; | ||
| 259 | + width:28rpx; | ||
| 260 | + height:28rpx; | ||
| 261 | + position: absolute; | ||
| 262 | + top:16rpx; | ||
| 263 | + left:32rpx; | ||
| 230 | } | 264 | } |
| 1 | // pages/reserve/home.js | 1 | // pages/reserve/home.js |
| 2 | +import util from '../../utils/util' | ||
| 2 | Page({ | 3 | Page({ |
| 3 | 4 | ||
| 4 | /** | 5 | /** |
| 5 | * 页面的初始数据 | 6 | * 页面的初始数据 |
| 6 | */ | 7 | */ |
| 7 | data: { | 8 | data: { |
| 8 | - location:'获取中...' | 9 | + location:'获取中...', |
| 10 | + hasFilter:false,// | ||
| 9 | }, | 11 | }, |
| 10 | 12 | ||
| 11 | /** | 13 | /** |
| @@ -81,11 +83,47 @@ Page({ | @@ -81,11 +83,47 @@ Page({ | ||
| 81 | dispalyLocation(){ | 83 | dispalyLocation(){ |
| 82 | this.selectComponent('#location').show(); | 84 | this.selectComponent('#location').show(); |
| 83 | }, | 85 | }, |
| 86 | + meLocation(){ | ||
| 87 | + this.selectComponent('#location').rePos({currentTarget:{dataset:{isAddr:true}}}); | ||
| 88 | + }, | ||
| 84 | locationEvent(e){ | 89 | locationEvent(e){ |
| 85 | console.log('locationEvent',e.detail) | 90 | console.log('locationEvent',e.detail) |
| 86 | this.city=e.detail.city | 91 | this.city=e.detail.city |
| 87 | this.setData({ | 92 | this.setData({ |
| 88 | location:e.detail.isAddr?e.detail.address:e.detail.city.name | 93 | location:e.detail.isAddr?e.detail.address:e.detail.city.name |
| 89 | }) | 94 | }) |
| 90 | - } | 95 | + }, |
| 96 | + filterParams:null, | ||
| 97 | + displayFilter(){ | ||
| 98 | + this.selectComponent('#filter').show(this.filterParams); | ||
| 99 | + this.setData({ | ||
| 100 | + hasFilter:true, | ||
| 101 | + }) | ||
| 102 | + }, | ||
| 103 | + filterEvent(e){ | ||
| 104 | + console.log('filterEvent',e.detail) | ||
| 105 | + if(e.detail.type=='set'){ | ||
| 106 | + this.filterParams=e.detail.data | ||
| 107 | + this.setData({ | ||
| 108 | + hasFilter:false, | ||
| 109 | + consumeStr:e.detail.data.consumeStr, | ||
| 110 | + }) | ||
| 111 | + }else{ | ||
| 112 | + this.filterParams=null; | ||
| 113 | + this.setData({ | ||
| 114 | + hasFilter:false, | ||
| 115 | + consumeStr:'', | ||
| 116 | + }) | ||
| 117 | + } | ||
| 118 | + }, | ||
| 119 | + goPath(e){ | ||
| 120 | + let path=util.attr(e,'path'); | ||
| 121 | + wx.navigateTo({ | ||
| 122 | + url:util.http_build_query({ | ||
| 123 | + filter:this.filterParams?JSON.stringify(this.filterParams):null, | ||
| 124 | + city:JSON.stringify(this.city), | ||
| 125 | + hows:JSON.stringify(this.findSellerData), | ||
| 126 | + },path) | ||
| 127 | + }) | ||
| 128 | + }, | ||
| 91 | }) | 129 | }) |
| @@ -4,6 +4,7 @@ | @@ -4,6 +4,7 @@ | ||
| 4 | "navigationBarTitleText":"周到安排", | 4 | "navigationBarTitleText":"周到安排", |
| 5 | "usingComponents": { | 5 | "usingComponents": { |
| 6 | "search-how":"/components/2.0/filter/how/index", | 6 | "search-how":"/components/2.0/filter/how/index", |
| 7 | - "location":"/components/2.0/filter/location" | 7 | + "location":"/components/2.0/filter/location", |
| 8 | + "filter":"/components/2.0/filter/filter" | ||
| 8 | } | 9 | } |
| 9 | } | 10 | } |
| @@ -10,26 +10,35 @@ | @@ -10,26 +10,35 @@ | ||
| 10 | class="view flex-treble text-bold text-xl text-cut margin-right-lg"> | 10 | class="view flex-treble text-bold text-xl text-cut margin-right-lg"> |
| 11 | {{location}} | 11 | {{location}} |
| 12 | </view> | 12 | </view> |
| 13 | - <view class="view flex flex-direction align-center justify-center"> | 13 | + <view class="view flex flex-direction align-center justify-center" bindtap="meLocation"> |
| 14 | <view class="view posicon"></view> | 14 | <view class="view posicon"></view> |
| 15 | <view class="view text-blue txt-24-h" style="margin-top: 4rpx;">我的位置</view> | 15 | <view class="view text-blue txt-24-h" style="margin-top: 4rpx;">我的位置</view> |
| 16 | </view> | 16 | </view> |
| 17 | </view> | 17 | </view> |
| 18 | <view class="view solid-bottom flex justify-around align-center" style="height: 110rpx;" bindtap="dispalySearchHow"> | 18 | <view class="view solid-bottom flex justify-around align-center" style="height: 110rpx;" bindtap="dispalySearchHow"> |
| 19 | - <view class="flex-treble">sss</view> | 19 | + <view class="flex-treble txt-36-h text-bold">{{findSellerData.paramStr}}</view> |
| 20 | <view class="more"></view> | 20 | <view class="more"></view> |
| 21 | </view> | 21 | </view> |
| 22 | - <view class="view solid-bottom flex justify-around align-center" style="height: 110rpx;"> | ||
| 23 | - <view class="flex-treble">sss</view> | 22 | + <view class="view solid-bottom flex justify-around align-center" |
| 23 | + bindtap="goPath" data-path="/pages/reserve/searchKeyword" | ||
| 24 | + style="height: 110rpx;"> | ||
| 25 | + <view class="flex-treble txt-32-h text-gray">搜索餐厅/位置/关键词</view> | ||
| 24 | <view class="more"></view> | 26 | <view class="more"></view> |
| 25 | </view> | 27 | </view> |
| 26 | - <view class="view flex justify-around align-center" style="height: 110rpx;"> | ||
| 27 | - <view class="flex-treble">sss</view> | 28 | + <view class="view flex justify-around align-center" style="height: 110rpx;" bindtap="displayFilter"> |
| 29 | + <view class="flex-treble txt-32-h {{consumeStr?'':'text-gray'}}">{{consumeStr||'人均消费'}}</view> | ||
| 28 | <view class="more"></view> | 30 | <view class="more"></view> |
| 29 | </view> | 31 | </view> |
| 30 | - <view class="view flex justify-around align-center round bg-blue-blue text-bold" style="height: 84rpx;"> | 32 | + <view class="view flex justify-around align-center round bg-blue-blue text-bold" |
| 33 | + bindtap="goPath" data-path="/pages/reserve/indexList" | ||
| 34 | + style="height: 84rpx;"> | ||
| 31 | 查找包间 | 35 | 查找包间 |
| 32 | </view> | 36 | </view> |
| 33 | </view> | 37 | </view> |
| 34 | <search-how id="search-how" findSellerData="{{findSellerData}}" bindevent="howEvent"></search-how> | 38 | <search-how id="search-how" findSellerData="{{findSellerData}}" bindevent="howEvent"></search-how> |
| 35 | -<location id="location" bindevent="locationEvent"></location> | ||
| 39 | +<location id="location" bindevent="locationEvent"></location> | ||
| 40 | +<view class="view filter-mask" hidden="{{!hasFilter}}"> | ||
| 41 | + <view class="view filter"> | ||
| 42 | + <filter id="filter" bindevent="filterEvent" cla="bottom-search"></filter> | ||
| 43 | + </view> | ||
| 44 | +</view> |
| @@ -45,4 +45,17 @@ | @@ -45,4 +45,17 @@ | ||
| 45 | background-image: url("http://nosqn.colorcun.com/search/s%20%283%29.png"); | 45 | background-image: url("http://nosqn.colorcun.com/search/s%20%283%29.png"); |
| 46 | width: 36rpx; | 46 | width: 36rpx; |
| 47 | height: 36rpx; | 47 | height: 36rpx; |
| 48 | +} | ||
| 49 | +.filter-mask{ | ||
| 50 | + background-color: rgba(0,0,0,0.5); | ||
| 51 | + width: 100%; | ||
| 52 | + height: 100%; | ||
| 53 | + position: fixed; | ||
| 54 | + z-index: 99999; | ||
| 55 | + bottom:0; | ||
| 56 | + left:0; | ||
| 57 | +} | ||
| 58 | +.filter{ | ||
| 59 | + position: relative; | ||
| 60 | + margin-top: calc(100% + 30rpx); | ||
| 48 | } | 61 | } |
| @@ -27,6 +27,10 @@ Page({ | @@ -27,6 +27,10 @@ Page({ | ||
| 27 | * 生命周期函数--监听页面加载 | 27 | * 生命周期函数--监听页面加载 |
| 28 | */ | 28 | */ |
| 29 | onLoad: function (options) { | 29 | onLoad: function (options) { |
| 30 | + //filter=null&city={"code":"610100","pid":"610000","name":"西安市","status":"1","last_date":"1598949575"}&hows={"params":{"pnum":{"index":3,"val":4,"type":"pnum"},"date":{"index":0,"val":1606979898,"type":"date"},"dur":{"index":2,"val":3,"type":"dur"}},"paramObj":{"when_date":"2020-12-03","several":4,"daily":3},"paramStr":"12月03日(今天)晚餐 4位"} | ||
| 31 | + console.log('searchKeyword',options) | ||
| 32 | + this.options=options | ||
| 33 | + this.city=JSON.parse(options.city) | ||
| 30 | this.selectComponent('#getpos').getPos(); | 34 | this.selectComponent('#getpos').getPos(); |
| 31 | }, | 35 | }, |
| 32 | 36 | ||
| @@ -116,11 +120,16 @@ Page({ | @@ -116,11 +120,16 @@ Page({ | ||
| 116 | let prarms={ | 120 | let prarms={ |
| 117 | keyword:this.inputVal, | 121 | keyword:this.inputVal, |
| 118 | region:this.location.city||'', | 122 | region:this.location.city||'', |
| 119 | - region_fix:0, | 123 | + region_fix:1, |
| 120 | page_size:20, | 124 | page_size:20, |
| 121 | page_index:1, | 125 | page_index:1, |
| 122 | key:map_key, | 126 | key:map_key, |
| 123 | } | 127 | } |
| 128 | + if(this.city){ | ||
| 129 | + prarms.name=this.city.name | ||
| 130 | + prarms.code=this.city.code | ||
| 131 | + prarms.pid=this.city.pid | ||
| 132 | + } | ||
| 124 | if(this.location.latitude){ | 133 | if(this.location.latitude){ |
| 125 | prarms.location=this.location.latitude+','+this.location.longitude | 134 | prarms.location=this.location.latitude+','+this.location.longitude |
| 126 | } | 135 | } |
| @@ -235,7 +244,7 @@ Page({ | @@ -235,7 +244,7 @@ Page({ | ||
| 235 | this.setData({ | 244 | this.setData({ |
| 236 | backfill: item.title | 245 | backfill: item.title |
| 237 | }); | 246 | }); |
| 238 | - wx.navigateBack(); | 247 | + //wx.navigateBack(); |
| 239 | } | 248 | } |
| 240 | }else{ | 249 | }else{ |
| 241 | wx.navigateTo({ | 250 | wx.navigateTo({ |
| @@ -321,6 +330,7 @@ Page({ | @@ -321,6 +330,7 @@ Page({ | ||
| 321 | lng:suggestion.longitude, | 330 | lng:suggestion.longitude, |
| 322 | centre_pos:`${suggestion.latitude},${suggestion.longitude}`, | 331 | centre_pos:`${suggestion.latitude},${suggestion.longitude}`, |
| 323 | multiIndex:0, | 332 | multiIndex:0, |
| 333 | + ...this.options, | ||
| 324 | },'/pages/reserve/indexList') | 334 | },'/pages/reserve/indexList') |
| 325 | }) | 335 | }) |
| 326 | }, | 336 | }, |
| @@ -468,7 +468,7 @@ | @@ -468,7 +468,7 @@ | ||
| 468 | { | 468 | { |
| 469 | "name": "pages/reserve/indexList", | 469 | "name": "pages/reserve/indexList", |
| 470 | "pathName": "pages/reserve/indexList", | 470 | "pathName": "pages/reserve/indexList", |
| 471 | - "query": "lat=39.65157&lng=118.15044&keyword=西安&multiIndex=0", | 471 | + "query": "city={\"code\":\"130200\",\"pid\":\"130000\",\"name\":\"唐山市\",\"status\":\"1\",\"last_date\":\"1598949575\"}&hows={\"params\":{\"pnum\":{\"index\":3,\"val\":4,\"type\":\"pnum\"},\"date\":{\"index\":0,\"val\":1606984766,\"type\":\"date\"},\"dur\":{\"index\":2,\"val\":3,\"type\":\"dur\"}},\"paramObj\":{\"when_date\":\"2020-12-03\",\"several\":4,\"daily\":3},\"paramStr\":\"12月03日(今天) 晚餐 4位\"}", |
| 472 | "scene": null | 472 | "scene": null |
| 473 | }, | 473 | }, |
| 474 | { | 474 | { |
| @@ -294,7 +294,9 @@ export default { | @@ -294,7 +294,9 @@ export default { | ||
| 294 | 'App.Customer.SearchMap':null, | 294 | 'App.Customer.SearchMap':null, |
| 295 | 295 | ||
| 296 | //根据腾讯地点搜索api整合现有商家 | 296 | //根据腾讯地点搜索api整合现有商家 |
| 297 | - 'App.Customer.KeywordTips':null, | 297 | + 'App.Customer.KeywordTips':{ |
| 298 | + alias:'App.App.KeywordTips'//限制城市 | ||
| 299 | + }, | ||
| 298 | 300 | ||
| 299 | //设置C端用户常用信息 | 301 | //设置C端用户常用信息 |
| 300 | 'App.Customer.SetCustomerInfo':{ | 302 | 'App.Customer.SetCustomerInfo':{ |
| @@ -512,6 +514,9 @@ export default { | @@ -512,6 +514,9 @@ export default { | ||
| 512 | openid:'openid', | 514 | openid:'openid', |
| 513 | }, | 515 | }, |
| 514 | 516 | ||
| 517 | + //根据区域查询指定条件下的商家列表 | ||
| 518 | + 'App.Customer.GetSellerListByFoods':null, | ||
| 519 | + | ||
| 515 | //根据账单ID获取账单详情 | 520 | //根据账单ID获取账单详情 |
| 516 | 'App.Foodset.GetFoodOrdersDetail':null, | 521 | 'App.Foodset.GetFoodOrdersDetail':null, |
| 517 | 522 |
-
Please register or login to post a comment