Showing
5 changed files
with
81 additions
and
2 deletions
| @@ -15,6 +15,7 @@ Page({ | @@ -15,6 +15,7 @@ Page({ | ||
| 15 | detail: null, | 15 | detail: null, |
| 16 | hasOnlineReserve: false, | 16 | hasOnlineReserve: false, |
| 17 | firstShowMsg:'', | 17 | firstShowMsg:'', |
| 18 | + rsl:[],//推荐商家 | ||
| 18 | }, | 19 | }, |
| 19 | id: null, | 20 | id: null, |
| 20 | tpls: TP.tpls(), | 21 | tpls: TP.tpls(), |
| @@ -43,11 +44,14 @@ Page({ | @@ -43,11 +44,14 @@ Page({ | ||
| 43 | openid: getApp().openid, | 44 | openid: getApp().openid, |
| 44 | rid: this.id | 45 | rid: this.id |
| 45 | }).then(res => { | 46 | }).then(res => { |
| 46 | - console.log('res.data.type',res.data.type) | 47 | + let detail=this.formatDatail(res.data) |
| 47 | this.setData({ | 48 | this.setData({ |
| 48 | - detail: this.formatDatail(res.data), | 49 | + detail: detail, |
| 49 | hasOnlineReserve:res.data.type==1, | 50 | hasOnlineReserve:res.data.type==1, |
| 50 | }) | 51 | }) |
| 52 | + if(detail.type==1 && detail.status==6){ | ||
| 53 | + this.GetRecommendSellerList(detail.seller.id) | ||
| 54 | + } | ||
| 51 | }) | 55 | }) |
| 52 | }, | 56 | }, |
| 53 | 57 | ||
| @@ -180,4 +184,29 @@ Page({ | @@ -180,4 +184,29 @@ Page({ | ||
| 180 | cardEvent(e){ | 184 | cardEvent(e){ |
| 181 | console.log(e) | 185 | console.log(e) |
| 182 | }, | 186 | }, |
| 187 | + GetRecommendSellerList(sid){ | ||
| 188 | + App.Customer.GetRecommendSellerList({ | ||
| 189 | + sid:sid, | ||
| 190 | + }).then(res=>{ | ||
| 191 | + this.setData({ | ||
| 192 | + rsl:res.data | ||
| 193 | + }) | ||
| 194 | + }) | ||
| 195 | + }, | ||
| 196 | + hasGoto:false, | ||
| 197 | + bindtransition(e){ | ||
| 198 | + if('change'==e.type){ | ||
| 199 | + this.hasGoto=false | ||
| 200 | + } | ||
| 201 | + if('animationfinish'==e.type){ | ||
| 202 | + if(this.hasGoto){ | ||
| 203 | + wx.switchTab({ | ||
| 204 | + url: '/pages/reserve/index' | ||
| 205 | + }) | ||
| 206 | + return; | ||
| 207 | + }else{ | ||
| 208 | + this.hasGoto=true | ||
| 209 | + } | ||
| 210 | + } | ||
| 211 | + }, | ||
| 183 | }) | 212 | }) |
| @@ -9,6 +9,7 @@ | @@ -9,6 +9,7 @@ | ||
| 9 | "nav":"/components/nav/nav", | 9 | "nav":"/components/nav/nav", |
| 10 | "card":"/components/seller-card/seller-card", | 10 | "card":"/components/seller-card/seller-card", |
| 11 | "formids":"/components/formids/formids", | 11 | "formids":"/components/formids/formids", |
| 12 | + "sb-tr":"/components/reserve/seller-box-transverse/seller-box", | ||
| 12 | "as":"/components/actionSheet/index" | 13 | "as":"/components/actionSheet/index" |
| 13 | } | 14 | } |
| 14 | } | 15 | } |
| @@ -121,6 +121,28 @@ | @@ -121,6 +121,28 @@ | ||
| 121 | <view class="item" bindtap="callSeller" wx:if="{{detail.hasRunning}}">取消预订</view> | 121 | <view class="item" bindtap="callSeller" wx:if="{{detail.hasRunning}}">取消预订</view> |
| 122 | </view> | 122 | </view> |
| 123 | </view> | 123 | </view> |
| 124 | + <block wx:if="{{rsl.length>0}}"> | ||
| 125 | + <view class="line-push">为你推荐</view> | ||
| 126 | + <view class="transverse-list"> | ||
| 127 | + <swiper | ||
| 128 | + indicator-dots="{{false}}" autoplay="{{false}}" circular="{{false}}" vertical="{{false}}" | ||
| 129 | + interval="2000" duration="500" | ||
| 130 | + previous-margin="{{15}}px" next-margin="{{15}}px" style="height: 350rpx;" | ||
| 131 | + current="{{current}}" bindchange="bindtransition" bindanimationfinish="bindtransition"> | ||
| 132 | + <block wx:for="{{rsl}}" wx:key="rsl.key"> | ||
| 133 | + <swiper-item bindtap="gotoDetail" data-sid="{{id}}"> | ||
| 134 | + <view class="seller" id="seller-{{id}}"> | ||
| 135 | + <sb-tr seller="{{item}}" | ||
| 136 | + hasActivityTags="{{false}}" | ||
| 137 | + hasActivityShort="{{true}}" | ||
| 138 | + hasBrand="true" hasActivityTese="true" | ||
| 139 | + hasSlogan="{{false}}"></sb-tr> | ||
| 140 | + </view> | ||
| 141 | + </swiper-item> | ||
| 142 | + </block> | ||
| 143 | + </swiper> | ||
| 144 | + </view> | ||
| 145 | + </block> | ||
| 124 | <view style="height: 50rpx;"></view> | 146 | <view style="height: 50rpx;"></view> |
| 125 | </view> | 147 | </view> |
| 126 | <manager manager="{{detail}}" id="manager"></manager> | 148 | <manager manager="{{detail}}" id="manager"></manager> |
| @@ -132,4 +132,26 @@ | @@ -132,4 +132,26 @@ | ||
| 132 | .tuiding .item{ | 132 | .tuiding .item{ |
| 133 | margin-left: 40rpx; | 133 | margin-left: 40rpx; |
| 134 | text-decoration: underline; | 134 | text-decoration: underline; |
| 135 | +} | ||
| 136 | +.line-push{ | ||
| 137 | + background-image: url("https://qn.colorcun.com/reserve/images/line-push.png"); | ||
| 138 | + width: 328rpx; | ||
| 139 | + height: 42rpx; | ||
| 140 | + background-size: 100% 24rpx; | ||
| 141 | + margin: 0 auto; | ||
| 142 | + font-size:30rpx; | ||
| 143 | + color: #C0A369; | ||
| 144 | + line-height: 24rpx; | ||
| 145 | + background-repeat: no-repeat; | ||
| 146 | + text-align: center; | ||
| 147 | + margin-top: 100rpx; | ||
| 148 | +} | ||
| 149 | +.transverse-list{ | ||
| 150 | + background-color: #fefefe; | ||
| 151 | + width: 100%; | ||
| 152 | + margin-top: 40rpx; | ||
| 153 | +} | ||
| 154 | +.transverse-list .seller{ | ||
| 155 | + width: 98%; | ||
| 156 | + margin: 0 auto; | ||
| 135 | } | 157 | } |
| @@ -285,6 +285,11 @@ export default { | @@ -285,6 +285,11 @@ export default { | ||
| 285 | openid:'openid', | 285 | openid:'openid', |
| 286 | silence:false, | 286 | silence:false, |
| 287 | }, | 287 | }, |
| 288 | + // 预定失败推荐商家接口 | ||
| 289 | + 'App.Customer.GetRecommendSellerList':null, | ||
| 290 | + | ||
| 291 | + // 用户订单为空时推介商家 | ||
| 292 | + 'App.Customer.GetRecommendSellerLists':null, | ||
| 288 | 293 | ||
| 289 | //获取营业时间段满房接口 | 294 | //获取营业时间段满房接口 |
| 290 | 'App.Customer.GetHouseFullDateTimes':null, | 295 | 'App.Customer.GetHouseFullDateTimes':null, |
-
Please register or login to post a comment