Commit 21477a12 authored by Morson's avatar Morson

对接拒单功能

parent 0a83b361
...@@ -5,8 +5,7 @@ const UNI_APP = { ...@@ -5,8 +5,7 @@ const UNI_APP = {
banshou: 'https://m.test.ibanshou.cn', //扳手app banshou: 'https://m.test.ibanshou.cn', //扳手app
}, },
systemUrl: { systemUrl: {
// apiUrl: 'https://system.dev.banshouhui.com', //java端域名请求头 apiUrl: 'https://system.dev.banshouhui.com', //java端域名请求头
apiUrl: 'http://apidoc.banshouhui.com:3000/mock/31', // mock端域名请求头
}, },
qn_base_url: 'https://qn-static.banshouhui.com/self-support/' qn_base_url: 'https://qn-static.banshouhui.com/self-support/'
} }
......
...@@ -37,7 +37,11 @@ let orderApiFun = function(vm){ ...@@ -37,7 +37,11 @@ let orderApiFun = function(vm){
let feedbackConfig = async (params = {}) => await vm.$u.get('/wxh-worker-rest/rst/order/v2/getFeedBack/' + vm.vuex_token, params) let feedbackConfig = async (params = {}) => await vm.$u.get('/wxh-worker-rest/rst/order/v2/getFeedBack/' + vm.vuex_token, params)
/* 预约+过程反馈 接口 */ /* 预约+过程反馈 接口 */
let traceAndAppointment = async (params = {}, orderId) => await vm.$u.post(`/wxh-worker-rest/rest/order/traceAndAppointment/trace/V2/`+vm.vuex_token+`/`+orderId, params) let traceAndAppointment = async (params = {}, orderId) => await vm.$u.post('/wxh-worker-rest/rest/order/traceAndAppointment/trace/V2/' + vm.vuex_token + '/' + orderId, params)
/* 师傅拒单 */
let rejectOrder = async (params = {}, orderId) => await vm.$u.get('/wxh-worker-rest/rest/' + vm.vuex_token + '/order/' + orderId + '/workerReject/V2', params)
/** /**
* 查询工单操作记录列表接口 * 查询工单操作记录列表接口
...@@ -68,7 +72,8 @@ let orderApiFun = function(vm){ ...@@ -68,7 +72,8 @@ let orderApiFun = function(vm){
orderGan, orderGan,
maintainWorkerCheckin, maintainWorkerCheckin,
feedbackConfig, feedbackConfig,
traceAndAppointment traceAndAppointment,
rejectOrder
} }
return orderApi return orderApi
} }
......
<!-- 预约时间 --> <!-- 预约时间 -->
<template> <template>
<view :class="{'con-box':titleShow}"> <view :class="{'con-box':titleShow}">
<view class="title" v-if="titleShow">{{'预约时间'}}</view> <view class="title" v-if="titleShow">{{ '预约时间' }}</view>
<view class="u-m-t-40"> <view class="u-m-t-40">
<view class="appoint-box"> <view class="appoint-box">
<view class="select-date"> <view class="select-date">
...@@ -24,11 +24,11 @@ ...@@ -24,11 +24,11 @@
<view class="select-time u-p-t-50"> <view class="select-time u-p-t-50">
<view class="u-flex u-row-between"> <view class="u-flex u-row-between">
<view class="txt">选择时间</view> <view class="txt">选择时间</view>
<view class="txt active">{{ timeList[currentTime] }}</view> <view class="txt active">{{ currentTimeTxt }}</view>
</view> </view>
<view class="u-p-t-30 u-flex u-flex-wrap time-list"> <view class="u-p-t-30 u-flex u-flex-wrap time-list">
<view @click="timeChange(item,index,timeList)" <view @click="timeChange(item,index,timeList)"
:class="{'time-item':true,'active':index===currentTime}" v-for="(item,index) in timeList" :class="{'time-item':true,'active': (currentTime && index===currentTime)}" v-for="(item,index) in timeList"
:key="index"> :key="index">
<text class="time">{{item}}</text> <text class="time">{{item}}</text>
</view> </view>
...@@ -51,31 +51,39 @@ ...@@ -51,31 +51,39 @@
data() { data() {
return { return {
currentDay: 0, currentDay: 0,
currentTime: 0, currentTime: null,
dateList: [{ dateList: [{
weekDay: '周三', weekDay: '周三',
day: '21' day: '21',
}, { }, {
weekDay: '周', weekDay: '周',
day: '21' day: '22',
}, { }, {
weekDay: '周', weekDay: '周',
day: '21' day: '23',
}, { }, {
weekDay: '周', weekDay: '周',
day: '21' day: '24',
}, { }, {
weekDay: '周', weekDay: '周',
day: '21' day: '25',
}, { }, {
weekDay: '周', weekDay: '周',
day: '21' day: '26',
}, ], }, ],
timeList: ['06:00-08:00', '08:00-10:00', '10:00-12:00', '12:00-14:00', '14:00-16:00', '16:00-18:00', timeList: ['06:00-08:00', '08:00-10:00', '10:00-12:00', '12:00-14:00', '14:00-16:00', '16:00-18:00',
'18:00-20:00', '20:00-22:00', '22:00-24:00' '18:00-20:00', '20:00-22:00', '22:00-24:00'
] ],
} }
}, },
computed: {
currentTimeTxt() {
if(this.currentTime != null) {
return this.timeList[this.currentTime]
}
return ''
},
},
methods: { methods: {
getDateList() { getDateList() {
// 获取日期 // 获取日期
......
...@@ -365,8 +365,8 @@ ...@@ -365,8 +365,8 @@
"query": "" //启动参数,在页面的onLoad函数里面得到 "query": "" //启动参数,在页面的onLoad函数里面得到
}, },
{ {
"name": "订单 - 过程反馈", //模式名称 "name": "订单 - 拒单", //模式名称
"path": "pages/order/feedback", //启动页面,必选 "path": "pages/order/refuse", //启动页面,必选
"query": "" //启动参数,在页面的onLoad函数里面得到 "query": "" //启动参数,在页面的onLoad函数里面得到
} }
] ]
......
...@@ -62,7 +62,7 @@ ...@@ -62,7 +62,7 @@
<appoint-time @dateChange="dateChange" @timeChange="timeChange" @weekChange="weekChange"></appoint-time> <appoint-time @dateChange="dateChange" @timeChange="timeChange" @weekChange="weekChange"></appoint-time>
</view> </view>
<view class="u-m-60"> <view class="u-m-60">
<button class="btn" @click="submitFrom" :loading="submiting" :disabled="disabledSubmit">确定</button> <button class="btn" @click="submitForm" :loading="submiting" :disabled="disabledSubmit">确定</button>
</view> </view>
</view> </view>
</template> </template>
...@@ -89,7 +89,8 @@ ...@@ -89,7 +89,8 @@
title:'问题类型', title:'问题类型',
}, },
appoint:{ appoint:{
title:'预约时间', '报单': '下次联系时间',
'改约': '预约时间',
} }
}, },
config: null, config: null,
...@@ -117,11 +118,14 @@ ...@@ -117,11 +118,14 @@
disabledSubmit() { disabledSubmit() {
let self = this let self = this
debugger if(self.trace.reasonType && self.trace.reasonType == '报备'){
if(self.trace.reasonType if(self.trace.reasonRelegation && self.trace.reason
&& (self.trace.reasonType == '报备' || self.trace.reasonType == '改约')){ && self.trace.nextTraceDatetime && self.trace.appointmentDatetimeRange) {
return false
}
} else if(self.trace.reasonType && self.trace.reasonType == '改约') {
if(self.trace.reasonRelegation && self.trace.reason if(self.trace.reasonRelegation && self.trace.reason
&& self.trace.appointmentDatetimeRange) { && self.trace.appointmentDatetime && self.trace.appointmentDatetimeRange) {
return false return false
} }
} }
...@@ -212,12 +216,23 @@ ...@@ -212,12 +216,23 @@
dateChange(data){ dateChange(data){
// 点击日期选择 // 点击日期选择
console.log(data,'week-data') console.log(data,'week-data')
let self = this
if(self.trace.reasonType == '报备') {
self.trace.appointmentDatetime = null
self.trace.nextTraceDatetime = data.item.day
} else if(self.trace.reasonType == '改约') {
self.trace.appointmentDatetime = data.item.day
self.trace.nextTraceDatetime = null
}
}, },
timeChange(data){ timeChange(data){
// 时间段选择变化 // 时间段选择变化
console.log(data,'week-data') console.log(data,'week-data')
this.trace.appointmentDatetimeRange = data.item
}, },
async submitFrom() { async submitForm() {
let self = this let self = this
self.orderId = 666 self.orderId = 666
if(!self.orderId) { if(!self.orderId) {
......
...@@ -7,19 +7,24 @@ ...@@ -7,19 +7,24 @@
<view class="con-box"> <view class="con-box">
<view class="tit u-m-b-40 u-flex"><text class="txt label"></text>{{refuse.title}}</view> <view class="tit u-m-b-40 u-flex"><text class="txt label"></text>{{refuse.title}}</view>
<view class="u-flex u-flex-wrap"> <view class="u-flex u-flex-wrap">
<view :class="{'txt-item':true,'active':true}" v-for="(txt,index) in refuse.list" :key="index"> <view
:class="{
'txt-item':true,
'active': (formData.rejectReason == txt)}"
v-for="(txt,index) in refuse.list"
:key="index" @click="changeReason(txt)">
<text class="txt">{{txt}}</text> <text class="txt">{{txt}}</text>
</view> </view>
</view> </view>
</view> </view>
<view class="con-box"> <view class="con-box">
<view class="tit u-m-b-40">补充说明</view> <view class="tit u-m-b-40">补充说明</view>
<u-input class="textarea" height="156" type="textarea" placeholder="请补充详细说明,以便于记录您的接单信用分"></u-input> <u-input v-model="formData.remark" class="textarea" height="156" type="textarea" placeholder="请补充详细说明,以便于记录您的接单信用分"></u-input>
</view> </view>
</view> </view>
<view class="u-m-60"> <view class="u-m-60">
<button class="btn">确定</button> <button :loading="submiting" :disabled="disabledSubmit" class="btn" @click="submitForm">确定</button>
</view> </view>
</view> </view>
</template> </template>
...@@ -28,18 +33,57 @@ ...@@ -28,18 +33,57 @@
export default { export default {
data() { data() {
return { return {
orderId: '',
submiting: false,
background: { background: {
backgroundColor: 'none', backgroundColor: 'none',
}, },
refuse:{ refuse:{
title:'问题归属', title:'拒单原因',
list:['时间不匹配', '技术不匹配', '价格过低', '距离太远', '其他'], list:['时间不匹配', '技术不匹配', '价格过低', '距离太远', '其他'],
}, },
formData: {
rejectReason: '',
remark: ''
},
}; };
}, },
computed: {
disabledSubmit() {
return !this.formData.rejectReason
}
},
components:{}, components:{},
onLoad(e) {
this.orderId = 111
if(e && e.orderId) {
this.orderId = e.orderId
}
},
methods: { methods: {
changeReason(reason) {
this.formData.rejectReason = reason
},
async submitForm() {
let self = this
self.submiting = true
let res = await self.$u.api.rejectOrder(self.formData, self.orderId)
self.submiting = false
if(res && res.code == 200) {
let data = res.data
if(data.code == 200) {
uni.showToast({
title: "拒单成功",
})
} else {
let message = '本月无拒单机会,请联系客服'
uni.showToast({
icon: 'none',
title: message,
})
}
}
},
} }
} }
</script> </script>
...@@ -65,7 +109,7 @@ ...@@ -65,7 +109,7 @@
background-color: #fff; background-color: #fff;
} }
.con-box{ .con-box{
padding:30rpx 30rpx 30rpx 20rpx; padding: 30rpx;
// border-radius: 12rpx; // border-radius: 12rpx;
background-color: #FFFFFF; background-color: #FFFFFF;
.tit{ .tit{
...@@ -99,6 +143,11 @@ ...@@ -99,6 +143,11 @@
line-height: 26rpx; line-height: 26rpx;
color: #333; color: #333;
} }
.label{
font-size:24rpx;
line-height: 40rpx;
color:#FA5A49
}
.textarea{ .textarea{
/deep/ .u-input{ /deep/ .u-input{
...@@ -121,8 +170,13 @@ ...@@ -121,8 +170,13 @@
&::after{ &::after{
content:''; content:'';
height:0; height:0;
border: none;
} }
} }
button[disabled]:not([type]) {
background: #D1D4D4;
color: #FFFFFF;
}
.width-320{ .width-320{
width:320rpx; width:320rpx;
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment