Commit 58c8ffcc1345ef74d0560e6d45cea688eeed76d5

Authored by vking
1 parent 2dc7d7bf

拒绝预订

// pack-book/components/book/reserve/refuse.js
import util from '../../../../utils/util'
Component({
/**
* 组件的属性列表
*/
properties: {
detail:Object,
},
/**
* 组件的初始数据
*/
data: {
display:false,
},
/**
* 组件的方法列表
*/
methods: {
show(){
this.setData({
display:true,
})
},
hide(){
this.setData({
display:false,
})
},
refuseOrder(e){
//this.hide()
let auto=util.attr(e,'auto')
this.setData({
auto:auto,
})
this.triggerEvent('event',{type:'fun',fun:'refuseOrderDo',data:{
auto:auto,
}})
},
arrangeOrder(){
this.hide()
this.triggerEvent('event',{type:'fun',fun:'arrangeOrder'})
},
roomtype(){
wx.navigateTo({
url:'/pack-book/pages/book/roomtype/roomtype',
})
},
}
})
... ...
{
"component": true,
"usingComponents": {}
}
\ No newline at end of file
... ...
<!--pack-book/components/book/reserve/refuse.wxml-->
<wxs src="../../../../utils/util.wxs" module="util" />
<view class="mask" bindtap="hide" wx:if="{{true || display}}">
<view class="dialog">
<view class="flex-lr header">
<view></view>
<view class="title Medium">{{detail.status==0?'拒绝订单':''}}</view>
<view class="close-x"></view>
</view>
<view class="content flex-vc" catchtap="catchtap">
<view class="status0 flex-vc" wx:if="{{detail.status==0}}">
<view class="info">确定要拒绝订单吗?一旦拒绝无法恢复。</view>
<view class="button full" bindtap="refuseOrder" data-auto="1">拒绝并暂停预订</view>
<view class="button line" bindtap="refuseOrder" data-auto="0">直接拒绝</view>
<view class="button none" bindtap="arrangeOrder">去安排包间</view>
</view>
<view class="status6 flex-vc" wx:if="{{detail.status==6}}">
<view class="info flex-cc">
<view class="icon"></view>订单已拒绝
</view>
<view class="auto-info" wx:if="{{auto}}">
并已将{{util.unixtoTime(detail.rdate,'MM月DD日'+detail.soltName)}}的{{detail.room_demand[0].name}}置满
</view>
<view class="tip-info">如果有包间空出来或其他包间也满了,你可以:</view>
<view class="button full" bindtap="roomtype">去管理包间</view>
</view>
</view>
</view>
</view>
... ...
/* pack-book/components/book/reserve/refuse.wxss */
@import "../../../../app.wxss";
.dialog{
position: fixed;
bottom: 0;
width: 100%;
background: #FFFFFF;
border-radius: 40rpx 40rpx 0rpx 0rpx;
}
.header{
width: calc(100% - 84rpx);
margin: 48rpx 42rpx 0;
}
.title{
height: 44rpx;
font-size: 32rpx;
font-family: PingFangSC-Medium, PingFang SC;
font-weight: 500;
color: #353535;
line-height: 44rpx;
}
.button{
width: 336rpx;
height: 80rpx;
background: #199095;
border: 2rpx solid #199095;
font-size: 34rpx;
font-family: PingFangSC-Regular, PingFang SC;
font-weight: 400;
color: #FFFFFF;
line-height: 80rpx;
text-align: center;
margin-bottom: 20rpx;
}
.bottom:last-child{
margin-bottom: 0;
}
.button.line{
background: #FFFFFF;
color: #199095;
}
.button.none{
background: #FFFFFF;
border-color: #FFFFFF;
color: #199095;
}
.content{
padding-bottom: 60rpx;
}
.status0{
padding-top: 60rpx;
}
.status0 .info{
height: 48rpx;
font-size: 34rpx;
font-family: PingFangSC-Regular, PingFang SC;
font-weight: 400;
color: #353535;
line-height: 48rpx;
margin-bottom: 80rpx;
}
.status6 .info{
height: 56rpx;
font-size: 34rpx;
font-family: PingFangSC-Regular, PingFang SC;
font-weight: 400;
color: #353535;
line-height: 56rpx;
margin-top: 24rpx;
}
.status6 .info .icon{
width: 56rpx;
height: 56rpx;
background-size: 100% 100%;
background-color: #efefef;
margin-right: 10rpx;
}
.auto-info{
height: 48rpx;
font-size: 34rpx;
font-family: PingFangSC-Regular, PingFang SC;
font-weight: 400;
color: #353535;
line-height: 48rpx;
margin-top: 24rpx;
}
.tip-info{
height: 36rpx;
font-size: 26rpx;
font-family: PingFangSC-Regular, PingFang SC;
font-weight: 400;
color: #353535;
line-height: 36rpx;
margin-bottom: 20rpx;
margin-top: 120rpx;
}
\ No newline at end of file
... ...
... ... @@ -300,32 +300,28 @@ Page({
});
},
refuseOrder(){
this.selectComponent("#showModal").options({
header: '您确定要拒绝这个订单吗?',
body: '如果该类型包间已订满,请及时停用包间',
showCancel:true,
cancelText:'拒绝订单',
cancelColor:'',
confirmText:'去安排',
confirmColor:'',
}).show()
this.selectComponent("#refuse").show()
},
async showModalEvent(e){
showModalEvent(e){
if(e.detail.type=="confirm"){
return this.arrangeOrder()
}
if(e.detail.type=="cancel"){
let params={
rid:this.data.bookInfo.id,
status:6,
cause:await this.getCause('包间已订满'),
}
App.Customer.SetReserveStatus(params).then(()=>{
this.getDetail(this.data.bookInfo.id,true);
PubSub.emit('fulshReseveList')
})
return this.refuseOrderDo()
}
},
async refuseOrderDo(param={}){
let params={
rid:this.data.bookInfo.id,
status:6,
cause:await this.getCause('包间已订满'),
auto:param.auto||"0",
}
App.Customer.SetReserveStatus(params).then(()=>{
this.getDetail(this.data.bookInfo.id,true);
PubSub.emit('fulshReseveList')
})
},
arrangeOrder(){
let bi=this.data.bookInfo
let checked_tids=''
... ... @@ -443,4 +439,10 @@ Page({
}
})
},
refuseEvent(e){
console.log('refuseEvent',e.detail)
if(e.detail.type=='fun'){
this[e.detail.fun](e.detail.data)
}
},
})
\ No newline at end of file
... ...
... ... @@ -11,6 +11,7 @@
"a2l":"/components/tips/add-to-lite",
"formids":"/components/formids/formids",
"PreferentialDocking":"../../components/book/PreferentialDocking/index",
"showModal":"/components/showModal/showModal"
"showModal":"/components/showModal/showModal",
"refuse":"../../components/book/reserve/refuse"
}
}
\ No newline at end of file
... ...
... ... @@ -279,6 +279,19 @@
</view>
</block>
</view>
<view class="notice-opt" wx:if="{{bookInfo.status==6 && isAdmin}}">
<view class="notice-button-border font34r flex-lr bg-blue">
<view class="item">
<formids bindclick="easyCall" data-key="jdmans">联系接单人</formids>
</view>
<view class="item">
<formids bindclick="easyCall" data-key="seller">联系商家</formids>
</view>
<view class="item">
<formids bindclick="easyCall" data-key="customer">联系顾客</formids>
</view>
</view>
</view>
<noticeCall id="notice" bookInfo="{{bookInfo}}"></noticeCall>
<action-sheet hidden="{{actionSheetHidden}}" bindchange="actionSheetChange" class="flex-ll">
<block wx:for-items="{{actionSheetItems}}" wx:key="actionSheetItems.key">
... ... @@ -292,5 +305,6 @@
</action-sheet>
<cancel id="cancel" bindreserveCancel="reserveCancel" bookInfo="{{bookInfo}}"></cancel>
<showModal id="showModal" bindshowModal="showModalEvent"></showModal>
<refuse id="refuse" bindevent="refuseEvent" detail="{{bookInfo}}"></refuse>
</block>
<loading wx:else="">处理中</loading>
\ No newline at end of file
... ...
... ... @@ -18,7 +18,7 @@
"checkSiteMap": true,
"uploadWithSourceMap": true,
"useMultiFrameRuntime": false,
"useApiHook": false,
"useApiHook": true,
"babelSetting": {
"ignore": [],
"disablePlugins": [],
... ... @@ -621,7 +621,7 @@
"id": 71,
"name": "pages/reserve/detail",
"pathName": "pages/reserve/detail",
"query": "id=15524&_activeTab=reserve&_date=2020-02-16&_pnum=6",
"query": "id=1&_activeTab=reserve&_date=2020-02-16&_pnum=6",
"scene": null
},
{
... ...