Showing
8 changed files
with
221 additions
and
22 deletions
pack-book/components/book/reserve/refuse.js
0 → 100644
| 1 | +// pack-book/components/book/reserve/refuse.js | ||
| 2 | +import util from '../../../../utils/util' | ||
| 3 | +Component({ | ||
| 4 | + /** | ||
| 5 | + * 组件的属性列表 | ||
| 6 | + */ | ||
| 7 | + properties: { | ||
| 8 | + detail:Object, | ||
| 9 | + }, | ||
| 10 | + | ||
| 11 | + /** | ||
| 12 | + * 组件的初始数据 | ||
| 13 | + */ | ||
| 14 | + data: { | ||
| 15 | + display:false, | ||
| 16 | + }, | ||
| 17 | + | ||
| 18 | + /** | ||
| 19 | + * 组件的方法列表 | ||
| 20 | + */ | ||
| 21 | + methods: { | ||
| 22 | + show(){ | ||
| 23 | + this.setData({ | ||
| 24 | + display:true, | ||
| 25 | + }) | ||
| 26 | + }, | ||
| 27 | + hide(){ | ||
| 28 | + this.setData({ | ||
| 29 | + display:false, | ||
| 30 | + }) | ||
| 31 | + }, | ||
| 32 | + refuseOrder(e){ | ||
| 33 | + //this.hide() | ||
| 34 | + let auto=util.attr(e,'auto') | ||
| 35 | + this.setData({ | ||
| 36 | + auto:auto, | ||
| 37 | + }) | ||
| 38 | + this.triggerEvent('event',{type:'fun',fun:'refuseOrderDo',data:{ | ||
| 39 | + auto:auto, | ||
| 40 | + }}) | ||
| 41 | + }, | ||
| 42 | + arrangeOrder(){ | ||
| 43 | + this.hide() | ||
| 44 | + this.triggerEvent('event',{type:'fun',fun:'arrangeOrder'}) | ||
| 45 | + }, | ||
| 46 | + roomtype(){ | ||
| 47 | + wx.navigateTo({ | ||
| 48 | + url:'/pack-book/pages/book/roomtype/roomtype', | ||
| 49 | + }) | ||
| 50 | + }, | ||
| 51 | + } | ||
| 52 | +}) |
| 1 | +<!--pack-book/components/book/reserve/refuse.wxml--> | ||
| 2 | +<wxs src="../../../../utils/util.wxs" module="util" /> | ||
| 3 | +<view class="mask" bindtap="hide" wx:if="{{true || display}}"> | ||
| 4 | + <view class="dialog"> | ||
| 5 | + <view class="flex-lr header"> | ||
| 6 | + <view></view> | ||
| 7 | + <view class="title Medium">{{detail.status==0?'拒绝订单':''}}</view> | ||
| 8 | + <view class="close-x"></view> | ||
| 9 | + </view> | ||
| 10 | + <view class="content flex-vc" catchtap="catchtap"> | ||
| 11 | + <view class="status0 flex-vc" wx:if="{{detail.status==0}}"> | ||
| 12 | + <view class="info">确定要拒绝订单吗?一旦拒绝无法恢复。</view> | ||
| 13 | + <view class="button full" bindtap="refuseOrder" data-auto="1">拒绝并暂停预订</view> | ||
| 14 | + <view class="button line" bindtap="refuseOrder" data-auto="0">直接拒绝</view> | ||
| 15 | + <view class="button none" bindtap="arrangeOrder">去安排包间</view> | ||
| 16 | + </view> | ||
| 17 | + <view class="status6 flex-vc" wx:if="{{detail.status==6}}"> | ||
| 18 | + <view class="info flex-cc"> | ||
| 19 | + <view class="icon"></view>订单已拒绝 | ||
| 20 | + </view> | ||
| 21 | + <view class="auto-info" wx:if="{{auto}}"> | ||
| 22 | + 并已将{{util.unixtoTime(detail.rdate,'MM月DD日'+detail.soltName)}}的{{detail.room_demand[0].name}}置满 | ||
| 23 | + </view> | ||
| 24 | + <view class="tip-info">如果有包间空出来或其他包间也满了,你可以:</view> | ||
| 25 | + <view class="button full" bindtap="roomtype">去管理包间</view> | ||
| 26 | + </view> | ||
| 27 | + </view> | ||
| 28 | + </view> | ||
| 29 | +</view> |
| 1 | +/* pack-book/components/book/reserve/refuse.wxss */ | ||
| 2 | +@import "../../../../app.wxss"; | ||
| 3 | +.dialog{ | ||
| 4 | + position: fixed; | ||
| 5 | + bottom: 0; | ||
| 6 | + width: 100%; | ||
| 7 | + background: #FFFFFF; | ||
| 8 | + border-radius: 40rpx 40rpx 0rpx 0rpx; | ||
| 9 | +} | ||
| 10 | +.header{ | ||
| 11 | + width: calc(100% - 84rpx); | ||
| 12 | + margin: 48rpx 42rpx 0; | ||
| 13 | +} | ||
| 14 | +.title{ | ||
| 15 | + height: 44rpx; | ||
| 16 | + font-size: 32rpx; | ||
| 17 | + font-family: PingFangSC-Medium, PingFang SC; | ||
| 18 | + font-weight: 500; | ||
| 19 | + color: #353535; | ||
| 20 | + line-height: 44rpx; | ||
| 21 | +} | ||
| 22 | +.button{ | ||
| 23 | + width: 336rpx; | ||
| 24 | + height: 80rpx; | ||
| 25 | + background: #199095; | ||
| 26 | + border: 2rpx solid #199095; | ||
| 27 | + font-size: 34rpx; | ||
| 28 | + font-family: PingFangSC-Regular, PingFang SC; | ||
| 29 | + font-weight: 400; | ||
| 30 | + color: #FFFFFF; | ||
| 31 | + line-height: 80rpx; | ||
| 32 | + text-align: center; | ||
| 33 | + margin-bottom: 20rpx; | ||
| 34 | +} | ||
| 35 | +.bottom:last-child{ | ||
| 36 | + margin-bottom: 0; | ||
| 37 | +} | ||
| 38 | +.button.line{ | ||
| 39 | + background: #FFFFFF; | ||
| 40 | + color: #199095; | ||
| 41 | +} | ||
| 42 | +.button.none{ | ||
| 43 | + background: #FFFFFF; | ||
| 44 | + border-color: #FFFFFF; | ||
| 45 | + color: #199095; | ||
| 46 | +} | ||
| 47 | +.content{ | ||
| 48 | + padding-bottom: 60rpx; | ||
| 49 | +} | ||
| 50 | +.status0{ | ||
| 51 | + padding-top: 60rpx; | ||
| 52 | +} | ||
| 53 | +.status0 .info{ | ||
| 54 | + height: 48rpx; | ||
| 55 | + font-size: 34rpx; | ||
| 56 | + font-family: PingFangSC-Regular, PingFang SC; | ||
| 57 | + font-weight: 400; | ||
| 58 | + color: #353535; | ||
| 59 | + line-height: 48rpx; | ||
| 60 | + margin-bottom: 80rpx; | ||
| 61 | +} | ||
| 62 | + | ||
| 63 | +.status6 .info{ | ||
| 64 | + height: 56rpx; | ||
| 65 | + font-size: 34rpx; | ||
| 66 | + font-family: PingFangSC-Regular, PingFang SC; | ||
| 67 | + font-weight: 400; | ||
| 68 | + color: #353535; | ||
| 69 | + line-height: 56rpx; | ||
| 70 | + margin-top: 24rpx; | ||
| 71 | +} | ||
| 72 | +.status6 .info .icon{ | ||
| 73 | + width: 56rpx; | ||
| 74 | + height: 56rpx; | ||
| 75 | + background-size: 100% 100%; | ||
| 76 | + background-color: #efefef; | ||
| 77 | + margin-right: 10rpx; | ||
| 78 | +} | ||
| 79 | +.auto-info{ | ||
| 80 | + height: 48rpx; | ||
| 81 | + font-size: 34rpx; | ||
| 82 | + font-family: PingFangSC-Regular, PingFang SC; | ||
| 83 | + font-weight: 400; | ||
| 84 | + color: #353535; | ||
| 85 | + line-height: 48rpx; | ||
| 86 | + margin-top: 24rpx; | ||
| 87 | +} | ||
| 88 | +.tip-info{ | ||
| 89 | + height: 36rpx; | ||
| 90 | + font-size: 26rpx; | ||
| 91 | + font-family: PingFangSC-Regular, PingFang SC; | ||
| 92 | + font-weight: 400; | ||
| 93 | + color: #353535; | ||
| 94 | + line-height: 36rpx; | ||
| 95 | + margin-bottom: 20rpx; | ||
| 96 | + margin-top: 120rpx; | ||
| 97 | +} |
| @@ -300,32 +300,28 @@ Page({ | @@ -300,32 +300,28 @@ Page({ | ||
| 300 | }); | 300 | }); |
| 301 | }, | 301 | }, |
| 302 | refuseOrder(){ | 302 | refuseOrder(){ |
| 303 | - this.selectComponent("#showModal").options({ | ||
| 304 | - header: '您确定要拒绝这个订单吗?', | ||
| 305 | - body: '如果该类型包间已订满,请及时停用包间', | ||
| 306 | - showCancel:true, | ||
| 307 | - cancelText:'拒绝订单', | ||
| 308 | - cancelColor:'', | ||
| 309 | - confirmText:'去安排', | ||
| 310 | - confirmColor:'', | ||
| 311 | - }).show() | 303 | + this.selectComponent("#refuse").show() |
| 312 | }, | 304 | }, |
| 313 | - async showModalEvent(e){ | 305 | + showModalEvent(e){ |
| 314 | if(e.detail.type=="confirm"){ | 306 | if(e.detail.type=="confirm"){ |
| 315 | return this.arrangeOrder() | 307 | return this.arrangeOrder() |
| 316 | } | 308 | } |
| 317 | if(e.detail.type=="cancel"){ | 309 | if(e.detail.type=="cancel"){ |
| 318 | - let params={ | ||
| 319 | - rid:this.data.bookInfo.id, | ||
| 320 | - status:6, | ||
| 321 | - cause:await this.getCause('包间已订满'), | ||
| 322 | - } | ||
| 323 | - App.Customer.SetReserveStatus(params).then(()=>{ | ||
| 324 | - this.getDetail(this.data.bookInfo.id,true); | ||
| 325 | - PubSub.emit('fulshReseveList') | ||
| 326 | - }) | 310 | + return this.refuseOrderDo() |
| 327 | } | 311 | } |
| 328 | }, | 312 | }, |
| 313 | + async refuseOrderDo(param={}){ | ||
| 314 | + let params={ | ||
| 315 | + rid:this.data.bookInfo.id, | ||
| 316 | + status:6, | ||
| 317 | + cause:await this.getCause('包间已订满'), | ||
| 318 | + auto:param.auto||"0", | ||
| 319 | + } | ||
| 320 | + App.Customer.SetReserveStatus(params).then(()=>{ | ||
| 321 | + this.getDetail(this.data.bookInfo.id,true); | ||
| 322 | + PubSub.emit('fulshReseveList') | ||
| 323 | + }) | ||
| 324 | + }, | ||
| 329 | arrangeOrder(){ | 325 | arrangeOrder(){ |
| 330 | let bi=this.data.bookInfo | 326 | let bi=this.data.bookInfo |
| 331 | let checked_tids='' | 327 | let checked_tids='' |
| @@ -443,4 +439,10 @@ Page({ | @@ -443,4 +439,10 @@ Page({ | ||
| 443 | } | 439 | } |
| 444 | }) | 440 | }) |
| 445 | }, | 441 | }, |
| 442 | + refuseEvent(e){ | ||
| 443 | + console.log('refuseEvent',e.detail) | ||
| 444 | + if(e.detail.type=='fun'){ | ||
| 445 | + this[e.detail.fun](e.detail.data) | ||
| 446 | + } | ||
| 447 | + }, | ||
| 446 | }) | 448 | }) |
| @@ -11,6 +11,7 @@ | @@ -11,6 +11,7 @@ | ||
| 11 | "a2l":"/components/tips/add-to-lite", | 11 | "a2l":"/components/tips/add-to-lite", |
| 12 | "formids":"/components/formids/formids", | 12 | "formids":"/components/formids/formids", |
| 13 | "PreferentialDocking":"../../components/book/PreferentialDocking/index", | 13 | "PreferentialDocking":"../../components/book/PreferentialDocking/index", |
| 14 | - "showModal":"/components/showModal/showModal" | 14 | + "showModal":"/components/showModal/showModal", |
| 15 | + "refuse":"../../components/book/reserve/refuse" | ||
| 15 | } | 16 | } |
| 16 | } | 17 | } |
| @@ -279,6 +279,19 @@ | @@ -279,6 +279,19 @@ | ||
| 279 | </view> | 279 | </view> |
| 280 | </block> | 280 | </block> |
| 281 | </view> | 281 | </view> |
| 282 | + <view class="notice-opt" wx:if="{{bookInfo.status==6 && isAdmin}}"> | ||
| 283 | + <view class="notice-button-border font34r flex-lr bg-blue"> | ||
| 284 | + <view class="item"> | ||
| 285 | + <formids bindclick="easyCall" data-key="jdmans">联系接单人</formids> | ||
| 286 | + </view> | ||
| 287 | + <view class="item"> | ||
| 288 | + <formids bindclick="easyCall" data-key="seller">联系商家</formids> | ||
| 289 | + </view> | ||
| 290 | + <view class="item"> | ||
| 291 | + <formids bindclick="easyCall" data-key="customer">联系顾客</formids> | ||
| 292 | + </view> | ||
| 293 | + </view> | ||
| 294 | + </view> | ||
| 282 | <noticeCall id="notice" bookInfo="{{bookInfo}}"></noticeCall> | 295 | <noticeCall id="notice" bookInfo="{{bookInfo}}"></noticeCall> |
| 283 | <action-sheet hidden="{{actionSheetHidden}}" bindchange="actionSheetChange" class="flex-ll"> | 296 | <action-sheet hidden="{{actionSheetHidden}}" bindchange="actionSheetChange" class="flex-ll"> |
| 284 | <block wx:for-items="{{actionSheetItems}}" wx:key="actionSheetItems.key"> | 297 | <block wx:for-items="{{actionSheetItems}}" wx:key="actionSheetItems.key"> |
| @@ -292,5 +305,6 @@ | @@ -292,5 +305,6 @@ | ||
| 292 | </action-sheet> | 305 | </action-sheet> |
| 293 | <cancel id="cancel" bindreserveCancel="reserveCancel" bookInfo="{{bookInfo}}"></cancel> | 306 | <cancel id="cancel" bindreserveCancel="reserveCancel" bookInfo="{{bookInfo}}"></cancel> |
| 294 | <showModal id="showModal" bindshowModal="showModalEvent"></showModal> | 307 | <showModal id="showModal" bindshowModal="showModalEvent"></showModal> |
| 308 | + <refuse id="refuse" bindevent="refuseEvent" detail="{{bookInfo}}"></refuse> | ||
| 295 | </block> | 309 | </block> |
| 296 | <loading wx:else="">处理中</loading> | 310 | <loading wx:else="">处理中</loading> |
| @@ -18,7 +18,7 @@ | @@ -18,7 +18,7 @@ | ||
| 18 | "checkSiteMap": true, | 18 | "checkSiteMap": true, |
| 19 | "uploadWithSourceMap": true, | 19 | "uploadWithSourceMap": true, |
| 20 | "useMultiFrameRuntime": false, | 20 | "useMultiFrameRuntime": false, |
| 21 | - "useApiHook": false, | 21 | + "useApiHook": true, |
| 22 | "babelSetting": { | 22 | "babelSetting": { |
| 23 | "ignore": [], | 23 | "ignore": [], |
| 24 | "disablePlugins": [], | 24 | "disablePlugins": [], |
| @@ -621,7 +621,7 @@ | @@ -621,7 +621,7 @@ | ||
| 621 | "id": 71, | 621 | "id": 71, |
| 622 | "name": "pages/reserve/detail", | 622 | "name": "pages/reserve/detail", |
| 623 | "pathName": "pages/reserve/detail", | 623 | "pathName": "pages/reserve/detail", |
| 624 | - "query": "id=15524&_activeTab=reserve&_date=2020-02-16&_pnum=6", | 624 | + "query": "id=1&_activeTab=reserve&_date=2020-02-16&_pnum=6", |
| 625 | "scene": null | 625 | "scene": null |
| 626 | }, | 626 | }, |
| 627 | { | 627 | { |
-
Please register or login to post a comment