Showing
7 changed files
with
112 additions
and
16 deletions
| @@ -3625,6 +3625,10 @@ scroll-view.cu-steps .cu-item { | @@ -3625,6 +3625,10 @@ scroll-view.cu-steps .cu-item { | ||
| 3625 | background-image: var(--gradualBlue); | 3625 | background-image: var(--gradualBlue); |
| 3626 | color: var(--white); | 3626 | color: var(--white); |
| 3627 | } | 3627 | } |
| 3628 | +.bg-blue-blue{ | ||
| 3629 | + background: linear-gradient(90deg, #3BBFF5 0%, #57A0FF 100%); | ||
| 3630 | + color: var(--white); | ||
| 3631 | +} | ||
| 3628 | 3632 | ||
| 3629 | .shadow[class*="-red"] { | 3633 | .shadow[class*="-red"] { |
| 3630 | box-shadow: var(--ShadowSize) var(--redShadow); | 3634 | box-shadow: var(--ShadowSize) var(--redShadow); |
| @@ -7,6 +7,7 @@ Component({ | @@ -7,6 +7,7 @@ Component({ | ||
| 7 | */ | 7 | */ |
| 8 | properties: { | 8 | properties: { |
| 9 | height:Number, | 9 | height:Number, |
| 10 | + disabled:Boolean, | ||
| 10 | }, | 11 | }, |
| 11 | 12 | ||
| 12 | /** | 13 | /** |
| @@ -54,6 +55,7 @@ Component({ | @@ -54,6 +55,7 @@ Component({ | ||
| 54 | this.hide() | 55 | this.hide() |
| 55 | }, | 56 | }, |
| 56 | caixiShow() { | 57 | caixiShow() { |
| 58 | + if(this.data.disabled) return; | ||
| 57 | if(this.data.caixiOpened){ | 59 | if(this.data.caixiOpened){ |
| 58 | this.selectComponent('#caixi').hide(); | 60 | this.selectComponent('#caixi').hide(); |
| 59 | this.setData({ | 61 | this.setData({ |
| @@ -69,6 +71,7 @@ Component({ | @@ -69,6 +71,7 @@ Component({ | ||
| 69 | } | 71 | } |
| 70 | }, | 72 | }, |
| 71 | filterShow() { | 73 | filterShow() { |
| 74 | + if(this.data.disabled) return; | ||
| 72 | if(this.data.filterOpened){ | 75 | if(this.data.filterOpened){ |
| 73 | this.selectComponent('#filter').hide(); | 76 | this.selectComponent('#filter').hide(); |
| 74 | this.setData({ | 77 | this.setData({ |
| @@ -110,6 +113,7 @@ Component({ | @@ -110,6 +113,7 @@ Component({ | ||
| 110 | this.hide() | 113 | this.hide() |
| 111 | }, | 114 | }, |
| 112 | tagsChange(e) { | 115 | tagsChange(e) { |
| 116 | + if(this.data.disabled) return; | ||
| 113 | let id = util.attr(e, 'id'); | 117 | let id = util.attr(e, 'id'); |
| 114 | let tags = this.data.tags; | 118 | let tags = this.data.tags; |
| 115 | let tagsIds=[]; | 119 | let tagsIds=[]; |
| @@ -31,6 +31,7 @@ Component({ | @@ -31,6 +31,7 @@ Component({ | ||
| 31 | */ | 31 | */ |
| 32 | methods: { | 32 | methods: { |
| 33 | getPos(fouce=false){ | 33 | getPos(fouce=false){ |
| 34 | + console.log('getPos') | ||
| 34 | this._getPos().then(res => { | 35 | this._getPos().then(res => { |
| 35 | console.log('wx.getLocation.then', res); | 36 | console.log('wx.getLocation.then', res); |
| 36 | failCount=0; | 37 | failCount=0; |
| @@ -3,7 +3,7 @@ import util from '../../utils/util'; | @@ -3,7 +3,7 @@ import util from '../../utils/util'; | ||
| 3 | import App from '../../utils/api'; | 3 | import App from '../../utils/api'; |
| 4 | import PubSub from '../../utils/PubSub' | 4 | import PubSub from '../../utils/PubSub' |
| 5 | const {regeneratorRuntime} = global | 5 | const {regeneratorRuntime} = global |
| 6 | -const mapScale = 15//18; | 6 | +const mapScale = 18//15//18; |
| 7 | const def_latitude = 39.684670; | 7 | const def_latitude = 39.684670; |
| 8 | const def_longitude = 118.176300; | 8 | const def_longitude = 118.176300; |
| 9 | const cates_version = '?1.2'; | 9 | const cates_version = '?1.2'; |
| @@ -11,6 +11,7 @@ Page({ | @@ -11,6 +11,7 @@ Page({ | ||
| 11 | data:{ | 11 | data:{ |
| 12 | map:{}, | 12 | map:{}, |
| 13 | height:1000, | 13 | height:1000, |
| 14 | + hasLoading:true, | ||
| 14 | }, | 15 | }, |
| 15 | user:{}, | 16 | user:{}, |
| 16 | /** | 17 | /** |
| @@ -73,13 +74,25 @@ Page({ | @@ -73,13 +74,25 @@ Page({ | ||
| 73 | } | 74 | } |
| 74 | this.setData(sdobj) | 75 | this.setData(sdobj) |
| 75 | }, | 76 | }, |
| 77 | + setLoacl(e){ | ||
| 78 | + let pos=util.attr(e,'val').split(','); | ||
| 79 | + let map = this.data.map | ||
| 80 | + map.latitude = pos[0]; | ||
| 81 | + map.longitude = pos[1]; | ||
| 82 | + this.setData({ | ||
| 83 | + map:map | ||
| 84 | + }) | ||
| 85 | + }, | ||
| 86 | + reduceMapScale(){ | ||
| 87 | + let map = this.data.map | ||
| 88 | + map.scale=parseInt(map.scale)-1 | ||
| 89 | + this.setData({ | ||
| 90 | + map:map | ||
| 91 | + }) | ||
| 92 | + }, | ||
| 76 | moveToLocation() { | 93 | moveToLocation() { |
| 77 | console.log('moveToLocation') | 94 | console.log('moveToLocation') |
| 78 | - if (!this.user.latitude) { | ||
| 79 | - console.log('moveToLocation') | ||
| 80 | - this.selectComponent('#getpos').getPos(true); | ||
| 81 | - return; | ||
| 82 | - } | 95 | + this.selectComponent('#getpos').getPos(true); |
| 83 | }, | 96 | }, |
| 84 | debounceTimer:null, | 97 | debounceTimer:null, |
| 85 | debounce(func,wait){ | 98 | debounce(func,wait){ |
| @@ -129,6 +142,9 @@ Page({ | @@ -129,6 +142,9 @@ Page({ | ||
| 129 | sellers:[], | 142 | sellers:[], |
| 130 | getSellers(){ | 143 | getSellers(){ |
| 131 | console.log('getSellers',this.mapScale,this.mapData) | 144 | console.log('getSellers',this.mapScale,this.mapData) |
| 145 | + this.setData({ | ||
| 146 | + hasLoading:true, | ||
| 147 | + }) | ||
| 132 | let param = { | 148 | let param = { |
| 133 | lat: this.user.latitude == def_latitude ? '' : this.user.latitude, | 149 | lat: this.user.latitude == def_latitude ? '' : this.user.latitude, |
| 134 | lng: this.user.longitude == def_longitude ? '' : this.user.longitude, | 150 | lng: this.user.longitude == def_longitude ? '' : this.user.longitude, |
| @@ -144,14 +160,18 @@ Page({ | @@ -144,14 +160,18 @@ Page({ | ||
| 144 | let lng = (this.mapData.region.southwest.longitude + this.mapData.region.northeast.longitude) / 2 | 160 | let lng = (this.mapData.region.southwest.longitude + this.mapData.region.northeast.longitude) / 2 |
| 145 | param.centre_pos = `${lat},${lng}` | 161 | param.centre_pos = `${lat},${lng}` |
| 146 | } | 162 | } |
| 163 | + this.hasFilterData=false | ||
| 147 | if(this.filterGroupData.tags){ | 164 | if(this.filterGroupData.tags){ |
| 148 | param.tags = this.filterGroupData.tags; | 165 | param.tags = this.filterGroupData.tags; |
| 166 | + this.hasFilterData=true | ||
| 149 | } | 167 | } |
| 150 | if (this.filterGroupData.cuisine) { | 168 | if (this.filterGroupData.cuisine) { |
| 151 | param.cuisine = this.filterGroupData.cuisine; | 169 | param.cuisine = this.filterGroupData.cuisine; |
| 170 | + this.hasFilterData=true | ||
| 152 | } | 171 | } |
| 153 | if(this.filterGroupData.average){ | 172 | if(this.filterGroupData.average){ |
| 154 | param.average = this.filterGroupData.average; | 173 | param.average = this.filterGroupData.average; |
| 174 | + this.hasFilterData=true | ||
| 155 | } | 175 | } |
| 156 | this.param = param; | 176 | this.param = param; |
| 157 | App.Customer.SellerList(param).then(async res => { | 177 | App.Customer.SellerList(param).then(async res => { |
| @@ -207,8 +227,8 @@ Page({ | @@ -207,8 +227,8 @@ Page({ | ||
| 207 | iconPath: "http://nosqn.colorcun.com/2.0/home%20%288%29.png" + cates_version, | 227 | iconPath: "http://nosqn.colorcun.com/2.0/home%20%288%29.png" + cates_version, |
| 208 | latitude: (this.user.latitude||def_latitude)+'', | 228 | latitude: (this.user.latitude||def_latitude)+'', |
| 209 | longitude: (this.user.longitude||def_longitude)+'', | 229 | longitude: (this.user.longitude||def_longitude)+'', |
| 210 | - width: 15, | ||
| 211 | - height: 29, | 230 | + width: 25, |
| 231 | + height: 41, | ||
| 212 | zIndex: 9999, | 232 | zIndex: 9999, |
| 213 | zIndexBak:9999, | 233 | zIndexBak:9999, |
| 214 | }) | 234 | }) |
| @@ -221,6 +241,9 @@ Page({ | @@ -221,6 +241,9 @@ Page({ | ||
| 221 | makeSellers(){ | 241 | makeSellers(){ |
| 222 | this.setData({ | 242 | this.setData({ |
| 223 | sellers:this.sellers, | 243 | sellers:this.sellers, |
| 244 | + hasSellers:(this.hasSellers==1 || this.sellers.length>0) || this.hasFilterData, | ||
| 245 | + hasLoading:false, | ||
| 246 | + hasFilterData:this.hasFilterData, | ||
| 224 | }) | 247 | }) |
| 225 | }, | 248 | }, |
| 226 | makeDefMarker(){ | 249 | makeDefMarker(){ |
| @@ -7,6 +7,7 @@ | @@ -7,6 +7,7 @@ | ||
| 7 | "a2l":"/components/tips/add-to-lite", | 7 | "a2l":"/components/tips/add-to-lite", |
| 8 | "filter-group":"/components/2.0/filter/filter-group", | 8 | "filter-group":"/components/2.0/filter/filter-group", |
| 9 | "seller-card":"/components/2.0/seller/card", | 9 | "seller-card":"/components/2.0/seller/card", |
| 10 | + "chatbot":"/components/userinfo/chatbot", | ||
| 10 | "as-phone":"/components/actionSheet/phone" | 11 | "as-phone":"/components/actionSheet/phone" |
| 11 | } | 12 | } |
| 12 | } | 13 | } |
| @@ -15,22 +15,60 @@ | @@ -15,22 +15,60 @@ | ||
| 15 | layer-style="2" | 15 | layer-style="2" |
| 16 | style="width: 100%; height: 360rpx;"></map> | 16 | style="width: 100%; height: 360rpx;"></map> |
| 17 | <view class="view content" style="height: {{height}}px;"> | 17 | <view class="view content" style="height: {{height}}px;"> |
| 18 | - <filter-group height="{{height}}" bindevent="filterGroupEvent"></filter-group> | 18 | + <filter-group height="{{height}}" bindevent="filterGroupEvent" disabled="{{sellers.length<1 && !hasFilterData}}"></filter-group> |
| 19 | <scroll-view class="view scroll-view" scroll-y="true" | 19 | <scroll-view class="view scroll-view" scroll-y="true" |
| 20 | scroll-into-view="seller-{{activeSellerID}}" | 20 | scroll-into-view="seller-{{activeSellerID}}" |
| 21 | scroll-with-animation | 21 | scroll-with-animation |
| 22 | bindscroll="scroll" style="width:100%;height: {{height-50}}px;"> | 22 | bindscroll="scroll" style="width:100%;height: {{height-50}}px;"> |
| 23 | - <block wx:for="{{sellers}}" wx:key="sellers"> | ||
| 24 | - <navigator url="/pages/reserve/detail?id={{item.id}}" hover-class="navigator-hover"> | ||
| 25 | - <seller-card class="seller-card" id="seller-{{item.id}}" | ||
| 26 | - activeSellerID="{{activeSellerID}}" | ||
| 27 | - seller="{{item}}" ></seller-card> | ||
| 28 | - </navigator> | 23 | + <view class="view flex flex-direction justify-center align-center" wx:if="{{hasLoading}}"> |
| 24 | + <image class="view" src="http://nosqn.colorcun.com/2.0/timg.gif" style="width: 40rpx;height: 40rpx;margin-top: 260rpx;"></image> | ||
| 25 | + <view class="view bg-white text-sm margin-top">包间查找中,请稍后…</view> | ||
| 26 | + </view> | ||
| 27 | + <block wx:else=""> | ||
| 28 | + <block wx:if="{{sellers.length>0}}"> | ||
| 29 | + <block wx:for="{{sellers}}" wx:key="sellers" > | ||
| 30 | + <navigator url="/pages/reserve/detail?id={{item.id}}" hover-class="navigator-hover"> | ||
| 31 | + <seller-card class="seller-card" id="seller-{{item.id}}" | ||
| 32 | + activeSellerID="{{activeSellerID}}" | ||
| 33 | + seller="{{item}}" ></seller-card> | ||
| 34 | + </navigator> | ||
| 35 | + </block> | ||
| 36 | + </block> | ||
| 37 | + <block wx:else=""> | ||
| 38 | + <view class="view flex flex-direction justify-center align-center empty-box margin-sm" wx:if="{{!hasSellers}}"> | ||
| 39 | + <view class="view text-lg">该地区没有可提供服务的餐厅</view> | ||
| 40 | + <view class="view" style="margin-top: 16rpx;">您可以切换到其他城市看看</view> | ||
| 41 | + <view style="margin-top: 80rpx;" | ||
| 42 | + bindtap="setLoacl" data-val="39.684670,118.176300" | ||
| 43 | + class="cu-btn round view text-def text-white bg-blue-blue">去唐山市</view> | ||
| 44 | + </view> | ||
| 45 | + <view class="view flex flex-direction justify-center align-center empty-box margin-sm" wx:elif="{{hasFilterData}}"> | ||
| 46 | + <view class="view text-lg">未找到符合要求的餐厅</view> | ||
| 47 | + <view class="view" style="margin-top: 16rpx;">修改或减少条件,获得更多餐厅</view> | ||
| 48 | + <chatbot> | ||
| 49 | + <view style="margin-top: 80rpx;" | ||
| 50 | + bindtap="setLoacl" data-val="39.684670,118.176300" | ||
| 51 | + class="cu-btn round view text-def text-white bg-blue-blue">人工抢订</view> | ||
| 52 | + </chatbot> | ||
| 53 | + </view> | ||
| 54 | + <view class="view flex flex-direction justify-center align-center empty-box empty-box-move margin-sm" | ||
| 55 | + wx:else=""> | ||
| 56 | + <view class="view flex text-df tips align-center text-orange"> | ||
| 57 | + <view class="view icon"></view> | ||
| 58 | + <view class="view">往任意方向拖动地图,可查找不同范围的餐厅</view> | ||
| 59 | + </view> | ||
| 60 | + <view class="view text-lg">地图显示范围无餐厅</view> | ||
| 61 | + <view style="margin-top: 80rpx;" | ||
| 62 | + bindtap="reduceMapScale" data-val="39.684670,118.176300" | ||
| 63 | + class="cu-btn round view text-def text-white bg-blue-blue">扩大搜索范围</view> | ||
| 64 | + </view> | ||
| 65 | + </block> | ||
| 29 | </block> | 66 | </block> |
| 67 | + | ||
| 30 | <view class="view" style="height: 192rpx;"></view> | 68 | <view class="view" style="height: 192rpx;"></view> |
| 31 | </scroll-view> | 69 | </scroll-view> |
| 32 | </view> | 70 | </view> |
| 33 | -<getpos bindpos="onpos" id="getpos"></getpos> | 71 | +<getpos bindpos="onpos" id="getpos" hasAllowLoading="{{false}}"></getpos> |
| 34 | <view bindtap="moveToLocation" class="view moveToLocation flex align-center justify-center"> | 72 | <view bindtap="moveToLocation" class="view moveToLocation flex align-center justify-center"> |
| 35 | <image class="moveToLocation-image" src="http://nosqn.colorcun.com/2.0/home%20%2811%29.png"></image> | 73 | <image class="moveToLocation-image" src="http://nosqn.colorcun.com/2.0/home%20%2811%29.png"></image> |
| 36 | </view> | 74 | </view> |
| @@ -41,4 +41,29 @@ page{ | @@ -41,4 +41,29 @@ page{ | ||
| 41 | box-shadow: 0rpx 0rpx 20rpx 0rpx #E5E5E5; | 41 | box-shadow: 0rpx 0rpx 20rpx 0rpx #E5E5E5; |
| 42 | border-radius: 40rpx 40rpx 0rpx 0rpx; | 42 | border-radius: 40rpx 40rpx 0rpx 0rpx; |
| 43 | overflow: hidden; | 43 | overflow: hidden; |
| 44 | +} | ||
| 45 | +.empty-box{ | ||
| 46 | + height: 416rpx; | ||
| 47 | + background: #FFFFFF; | ||
| 48 | + box-shadow: 0px 0px 30rpx 0px #E5E5E5; | ||
| 49 | + border-radius: 20rpx; | ||
| 50 | +} | ||
| 51 | +.empty-box-move{ | ||
| 52 | + position: relative; | ||
| 53 | +} | ||
| 54 | +.empty-box-move .tips{ | ||
| 55 | + position: absolute; | ||
| 56 | + width:100%; | ||
| 57 | + height: 64rpx; | ||
| 58 | + background: #FDF9F5; | ||
| 59 | + border-radius: 20rpx 20rpx 0px 0px; | ||
| 60 | + top:0; | ||
| 61 | + left:0; | ||
| 62 | +} | ||
| 63 | +.empty-box-move .tips .icon{ | ||
| 64 | + background-image: url("http://nosqn.colorcun.com/2.0/home%20%289%29.png"); | ||
| 65 | + width:42rpx; | ||
| 66 | + height:36rpx; | ||
| 67 | + margin-left: 44rpx; | ||
| 68 | + margin-right: 20rpx; | ||
| 44 | } | 69 | } |
-
Please register or login to post a comment