Commit be6c1c12 authored by Facius's avatar Facius

feat: 前台——待预约,待签到,过程反馈页面修改

parent 90d41a06
<!-- 过程反馈 --> <!-- 改约 -->
<template> <template>
<!-- <view class="feedback-box bg">
<u-navbar
back-icon-color="#FFFFFF"
:background="background"
title="过程反馈"
titleColor="#FFFFFF"
:border-bottom="false"
title-bold
></u-navbar> -->
<!-- <view class="feedback-content u-p-l-30 u-p-r-30">
<view class="top-tab">
<u-tabs
:list="options"
:current="curTab"
height="60"
gutter="89"
bar-height="4"
bar-width="44"
bg-color="none"
active-color="#FFFFFF"
inactive-color="#DEDEDE"
font-size="32"
bold
@change="changeTab"
></u-tabs> -->
<!-- </view> -->
<view class="content-view"> <view class="content-view">
<view class="con-box"> <view class="con-box">
<view class="title">{{ traceTitles[0] }}</view> <view class="title">{{ traceTitles[0] }}</view>
...@@ -75,18 +49,6 @@ ...@@ -75,18 +49,6 @@
></appoint-time> ></appoint-time>
</view> </view>
</view> </view>
<!-- </view> -->
<!-- <view class="bottom-view">
<button
class="btn, bottom-btn"
@click="$u.throttle(submitForm, 500)"
:loading="submiting"
:disabled="disabledSubmit"
>
<text class="button-text">确定</text>
</button>
</view>
</view> -->
</template> </template>
<script> <script>
...@@ -97,7 +59,7 @@ export default { ...@@ -97,7 +59,7 @@ export default {
appointTime, appointTime,
}, },
props: { props: {
// 报备: 'filing', 改约: 'subscribe' // 报备(预约): 'filing', 改约: 'subscribe'
type: { type: {
type: String, type: String,
default: 'subscribe', default: 'subscribe',
...@@ -213,6 +175,55 @@ export default { ...@@ -213,6 +175,55 @@ export default {
defaultAppointRangeItem() { defaultAppointRangeItem() {
return this.options.defaultAppointRangeItem return this.options.defaultAppointRangeItem
}, },
submitData() {
if (this.isSubscribe) {
// 改约
let params = {
reason: this.trace.reason,
reasonRelegation: this.trace.reasonRelegation,
reasonType: this.trace.reasonType,
remark: this.trace.remark,
}
params.appointmentDatetime = this.trace.traceDate
params.appointmentDatetimeRange = this.trace.timeRange
return params
} else {
// 报备(预约)
let data = {
reason: this.trace.reason,
reasonRelegation: this.trace.reasonRelegation,
reasonType: this.trace.reasonType,
remark: this.trace.remark,
}
data.appointmentDatetime = this.trace.traceDate
data.appointmentDatetimeRange = this.trace.timeRange
if (
this.trace.timeItem &&
this.trace.timeItem.pkey &&
this.trace.traceDate
) {
let traceDate = this.moment(this.trace.traceDate)
let timeArr = this.trace.timeItem.pkey.split('_')
if (this.trace.timeItem.pkey == 'appointment_range_24') {
let traceDateTime = traceDate
.clone()
.add(23, 'hours')
.add(59, 'minutes')
data.nextTraceDatetime = traceDateTime.unix() * 1000
} else {
let hours = timeArr && timeArr.length && timeArr.pop()
let traceDateTime = traceDate.clone().add(Number(hours), 'hours')
data.nextTraceDatetime = traceDateTime.unix() * 1000
}
}
return data
}
},
}, },
watch: { watch: {
disabledSubmit(val) { disabledSubmit(val) {
...@@ -336,13 +347,6 @@ export default { ...@@ -336,13 +347,6 @@ export default {
} }
}, },
/**
* 切换tab项
*/
// changeTab(index) {
// this.curTab = index
// this.initParams()
// },
changeOwn(index, own, types) { changeOwn(index, own, types) {
let self = this let self = this
self.curOwn = index self.curOwn = index
...@@ -396,98 +400,14 @@ export default { ...@@ -396,98 +400,14 @@ export default {
this.trace.timeRange = data.item.pkey this.trace.timeRange = data.item.pkey
this.trace.timeItem = data.item this.trace.timeItem = data.item
}, },
// async submitForm() {
// let self = this
// if (!self.orderId) {
// uni.showToast({
// icon: error,
// title: '工单ID不能为空',
// })
// return false
// }
// self.submiting = true
// getApp().track('order_feedback_submitForm', {
// reasonType: self.trace.reasonType,
// traceDate: self.trace.traceDate,
// })
// let params = this.$u.deepClone(self.trace)
// if (self.trace.reasonType != '改约') {
// if (self.trace.timeItem && self.trace.timeItem.pkey && self.trace.traceDate) {
// let traceDate = self.moment(self.trace.traceDate)
// let timeArr = self.trace.timeItem.pkey.split('_')
// if (self.trace.timeItem.pkey == 'appointment_range_24') {
// let traceDateTime = traceDate
// .clone()
// .add(23, 'hours')
// .add(59, 'minutes')
// params.nextTraceDatetime = traceDateTime.unix() * 1000
// } else {
// let hours = timeArr && timeArr.length && timeArr.pop()
// let traceDateTime = traceDate.clone().add(Number(hours), 'hours')
// params.nextTraceDatetime = traceDateTime.unix() * 1000
// }
// }
// } else {
// params.appointmentDatetime = self.trace.traceDate
// params.appointmentDatetimeRange = self.trace.timeRange
// }
// let res = await self.$u.api.traceAndAppointment(params, self.orderId)
// self.submiting = false
// if (res && res.code == 200) {
// var pages = getCurrentPages()
// if (pages.length >= 2) {
// var page = pages[pages.length - 2]
// page.needFresh = true
// }
// uni.navigateBack()
// }
// },
}, },
} }
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>
// .bg {
// width: 750rpx;
// height: 100vh;
// overflow: auto;
// background-color: #f4f5f7;
// background-image: linear-gradient(to top, #f4f5f7 0%, #2272ff 50%);
// background-size: 750rpx 600rpx;
// background-repeat: no-repeat;
// }
// .feedback-view {
// display: flex;
// flex-direction: column;
// .header {
// padding: 12rpx 30rpx 40rpx 30rpx;
// display: flex;
// justify-content: space-between;
// align-items: center;
// .title {
// font-size: 40rpx;
// font-weight: bold;
// color: #ffffff;
// }
// }
// }
// /deep/ .u-subsection {
// padding: 4rpx !important;
// }
// .top-tab {
// text-align: center;
// }
// .content {
// display: flex;
// flex-direction: column;
// overflow: hidden;
// margin-bottom: 188rpx;
.content-view { .content-view {
height: 100%; height: 100%;
border-radius: 12rpx; border-radius: 12rpx;
overflow: auto; overflow: auto;
margin-top: 30rpx;
.time-view { .time-view {
border-radius: 12rpx; border-radius: 12rpx;
...@@ -495,23 +415,6 @@ export default { ...@@ -495,23 +415,6 @@ export default {
padding-bottom: 20rpx; padding-bottom: 20rpx;
} }
} }
// }
// .bottom-view {
// position: fixed;
// bottom: 44rpx;
// width: 100%;
// }
// .bottom-btn {
// height: 104rpx;
// width: 600rpx;
// display: flex;
// align-items: center;
// justify-content: center;
// .button-text {
// font-size: 32rpx;
// font-weight: bold;
// }
// }
.con-box { .con-box {
padding: 30rpx 30rpx 8rpx 30rpx; padding: 30rpx 30rpx 8rpx 30rpx;
...@@ -563,51 +466,5 @@ export default { ...@@ -563,51 +466,5 @@ export default {
border: 2rpx solid #ececec; border: 2rpx solid #ececec;
padding: 18rpx 30rpx; padding: 18rpx 30rpx;
} }
// .textarea {
// /deep/ .u-input {
// textarea {
// margin-top: 20rpx;
// border: 2rpx solid #ececec;
// padding: 18rpx 30rpx;
// }
// }
// }
} }
// .btn {
// padding: 30rpx;
// border-radius: 52rpx;
// line-height: 44rpx;
// font-size: 32rpx;
// text-align: center;
// background-color: #2272ff;
// color: #fff;
// &::after {
// content: '';
// height: 0;
// border: none;
// }
// }
// .btn {
// padding: 30rpx;
// border-radius: 52rpx;
// line-height: 44rpx;
// font-size: 32rpx;
// text-align: center;
// background-color: #2272ff;
// color: #fff;
// &::after {
// content: '';
// height: 0;
// }
// }
// .width-320 {
// width: 320rpx;
// }
// /deep/ button[plain] {
// border: none;
// }
// button[disabled]:not([type]) {
// background: #d1d4d4;
// color: #ffffff;
// }
</style> </style>
...@@ -103,15 +103,6 @@ ...@@ -103,15 +103,6 @@
</view> </view>
</view> </view>
<!-- 带预约显示时间选择 --> <!-- 带预约显示时间选择 -->
<!-- <view class="card appoint-item" v-show="isWaitAppointment">
<appoint-time
:dateList="dateList"
:timeList="timeList"
@dateChange="dateChange"
@timeChange="timeChange"
@weekChange="weekChange"
></appoint-time>
</view> -->
<FeedbackContent <FeedbackContent
ref="feed-back" ref="feed-back"
v-show="isWaitAppointment" v-show="isWaitAppointment"
...@@ -195,26 +186,6 @@ export default { ...@@ -195,26 +186,6 @@ export default {
return { return {
type: '', type: '',
readMore: true, // 是:显示的是'查看更多'按钮;否:显示的是'点击收起'按钮 readMore: true, // 是:显示的是'查看更多'按钮;否:显示的是'点击收起'按钮
// dateList: [
// { day: now, timeRange: [] },
// { day: now + 1 * 86400000, timeRange: [] },
// { day: now + 2 * 86400000, timeRange: [] },
// { day: now + 3 * 86400000, timeRange: [] },
// { day: now + 4 * 86400000, timeRange: [] },
// { day: now + 5 * 86400000, timeRange: [] },
// { day: now + 6 * 86400000, timeRange: [] },
// ],
// timeList: [
// { name: '06:00-08:00', pkey: 'appointment_range_8' },
// { name: '08:00-10:00', pkey: 'appointment_range_10' },
// { name: '10:00-12:00', pkey: 'appointment_range_12' },
// { name: '12:00-14:00', pkey: 'appointment_range_14' },
// { name: '14:00-16:00', pkey: 'appointment_range_16' },
// { name: '16:00-18:00', pkey: 'appointment_range_18' },
// { name: '18:00-20:00', pkey: 'appointment_range_20' },
// { name: '20:00-22:00', pkey: 'appointment_range_22' },
// { name: '22:00-24:00', pkey: 'appointment_range_24' },
// ],
background: { background: {
backgroundColor: 'none', backgroundColor: 'none',
// 导航栏背景图 // 导航栏背景图
...@@ -250,16 +221,6 @@ export default { ...@@ -250,16 +221,6 @@ export default {
// showApplyList: false, // 显示已申请配件列表 // showApplyList: false, // 显示已申请配件列表
partsList: [], // 已申请的配件列表 partsList: [], // 已申请的配件列表
partsCount: 0, partsCount: 0,
// trace: {
// reasonType: '报备', // 反馈类型
// reasonRelegation: '客户', // 反馈归属
// reason: '', // 反馈原因
// remark: '', // 备注
// traceDate: null, // 反馈时间
// timeRange: null, // 反馈时间段
// dateItem: null,
// timeItem: null,
// },
} }
}, },
computed: { computed: {
...@@ -691,69 +652,7 @@ export default { ...@@ -691,69 +652,7 @@ export default {
} }
}) })
}, },
// weekChange(data) {
// // 点击下一周
// if (data && data.time) {
// let num = data.num
// let time = data.time
// this.num = num
// if (num == 0) {
// this.loadCalendar()
// } else {
// this.loadCalendar()
// }
// }
// } /* 加载日历数据 */,
// async loadCalendar() {
// let self = this
// let params = {
// num: this.num,
// }
// self.dateItem = null
// let res = await this.$u.api.workerCalendar(params)
// if (res && res.code == 200) {
// self.dateList = res.data
// }
// this.loadTimerange()
// },
// /* 加载预约时间段 */
// async loadTimerange() {
// let self = this
// let res = await this.$u.api.openTimerange()
// if (res && res.code == 200) {
// let list = res.data
// list.map((item, index) => {
// if (
// (self.dateItem &&
// self.dateItem.timeRange.indexOf(item.pkey) > -1) ||
// item.isEnd
// ) {
// item.disabled = true
// } else {
// false
// }
// })
// self.timeList = list
// }
// },
// dateChange(data) {
// // 点击日期选择
// let self = this
// self.appointmentDatetime = data.item.day
// self.dateItem = data.item
// self.appointmentDatetimeRange = null
// self.timeList.map((item, index) => {
// if (data.item.timeRange.indexOf(item.pkey) > -1 || item.isEnd) {
// item.disabled = true
// } else {
// item.disabled = false
// }
// })
// },
// timeChange(data) {
// // 时间段选择变化
// this.appointmentDatetimeRange = data.item
// },
handleChange(val) { handleChange(val) {
console.log('-----handleChange-------', val) console.log('-----handleChange-------', val)
}, },
...@@ -877,41 +776,16 @@ export default { ...@@ -877,41 +776,16 @@ export default {
data.orderId = this.order.orderId data.orderId = this.order.orderId
data.channel = 4 data.channel = 4
} else if (this.submitType === 'workerAppointment') { } else if (this.submitType === 'workerAppointment') {
let trace = this.$refs['feed-back'].trace data = this.$refs['feed-back'].submitData
data = {
reason: trace.reason,
reasonRelegation: trace.reasonRelegation,
reasonType: trace.reasonType,
remark: trace.remark,
}
// 预约
data.appointmentDatetime = trace.traceDate
if (!data.appointmentDatetime) { if (!data.appointmentDatetime) {
this.commonToast('请选择预约日期', 'waring') this.commonToast('请选择预约日期', 'waring')
return return
} }
if (!trace.timeItem || !trace.timeItem.pkey) { if (!data.appointmentDatetimeRange) {
this.commonToast('请选择预约时间段', 'waring') this.commonToast('请选择预约时间段', 'waring')
return return
} }
data.appointmentDatetimeRange = trace.timeRange
if (trace.timeItem && trace.timeItem.pkey && trace.traceDate) {
let traceDate = this.moment(trace.traceDate)
let timeArr = trace.timeItem.pkey.split('_')
if (trace.timeItem.pkey == 'appointment_range_24') {
let traceDateTime = traceDate
.clone()
.add(23, 'hours')
.add(59, 'minutes')
data.nextTraceDatetime = traceDateTime.unix() * 1000
} else {
let hours = timeArr && timeArr.length && timeArr.pop()
let traceDateTime = traceDate.clone().add(Number(hours), 'hours')
data.nextTraceDatetime = traceDateTime.unix() * 1000
}
}
} else if (this.submitType === 'maintainWorkerCheckin') { } else if (this.submitType === 'maintainWorkerCheckin') {
// 签到 // 签到
// 检查见到距离是否符合 // 检查见到距离是否符合
......
<!-- 过程反馈 --> <!-- 改约 -->
<template> <template>
<view class="feedback-box bg"> <view class="feedback-box bg">
<u-navbar <u-navbar
...@@ -10,71 +10,6 @@ ...@@ -10,71 +10,6 @@
title-bold title-bold
></u-navbar> ></u-navbar>
<view class="content u-p-l-30 u-p-r-30"> <view class="content u-p-l-30 u-p-r-30">
<!-- <view class="top-tab">
<u-tabs
:list="options"
:current="curTab"
height="60"
gutter="89"
bar-height="4"
bar-width="44"
bg-color="none"
active-color="#FFFFFF"
inactive-color="#DEDEDE"
font-size="32"
bold
@change="changeTab"
></u-tabs>
</view> -->
<!-- <view class="content-view">
<view class="con-box">
<view class="title">{{ traceTitles[0] }}</view>
<view class="u-flex u-flex-wrap">
<view
v-for="(item, index) in options[curTab]['owns']"
:key="index"
@click="changeOwn(index, item.name, item.types)"
:class="{ 'txt-item': true, active: curOwn == index }"
>
<text class="txt">{{ item.name }}</text>
</view>
</view>
<u-gap height="30"></u-gap>
<view class="title">{{ traceTitles[1] }}</view>
<view class="u-flex u-flex-wrap">
<view
v-for="(txt, index) in options[curTab]['owns'][curOwn]['types']"
:key="index"
@click="changeType(index, txt)"
:class="{ 'txt-item': true, active: trace.reason == txt }"
style="width: 306rpx;margin-right: 18rpx"
>
<text class="txt">{{ txt }}</text>
</view>
</view>
<view class="input-view">
<u-input
v-model="trace.remark"
class="textarea"
height="156"
type="textarea"
placeholder="请补充详细说明,以便于记录您的接单信用分"
></u-input>
</view>
</view>
<view class="time-view">
<appoint-time
:dateList="dateList"
:title="appointTitle"
:timeList="timeList"
:type="timeType"
:defaultAppointRangeItem="defaultAppointRangeItem"
@dateChange="dateChange"
@timeChange="timeChange"
@weekChange="weekChange"
></appoint-time>
</view>
</view> -->
<FeedbackContent <FeedbackContent
ref="feed-back" ref="feed-back"
:categoryId="categoryId" :categoryId="categoryId"
...@@ -105,16 +40,6 @@ export default { ...@@ -105,16 +40,6 @@ export default {
categoryId: null, categoryId: null,
submiting: false, submiting: false,
disabledSubmit: true, disabledSubmit: true,
// trace: {
// reasonType: '报备', // 反馈类型
// reasonRelegation: '客户', // 反馈归属
// reason: '', // 反馈原因
// remark: '', // 备注
// traceDate: null, // 反馈时间
// timeRange: null, // 反馈时间段
// dateItem: null,
// timeItem: null,
// },
} }
}, },
components: { components: {
...@@ -127,17 +52,13 @@ export default { ...@@ -127,17 +52,13 @@ export default {
this.orderId = e.orderId || null this.orderId = e.orderId || null
this.categoryId = e.categoryId || null this.categoryId = e.categoryId || null
} }
// uni.showLoading({
// title: '数据加载中',
// mask: true,
// })
}, },
methods: { methods: {
handleChange(val) { handleChange(val) {
this.disabledSubmit = val this.disabledSubmit = val
}, },
async submitForm() { async submitForm() {
let trace = this.$refs['feed-back'].trace let submitData = this.$refs['feed-back'].submitData
let self = this let self = this
if (!self.orderId) { if (!self.orderId) {
uni.showToast({ uni.showToast({
...@@ -149,36 +70,11 @@ export default { ...@@ -149,36 +70,11 @@ export default {
self.submiting = true self.submiting = true
getApp().track('order_feedback_submitForm', { getApp().track('order_feedback_submitForm', {
reasonType: trace.reasonType, reasonType: submitData.reasonType,
traceDate: trace.traceDate, traceDate: submitData.traceDate,
}) })
let params = {
reason: trace.reason, let res = await self.$u.api.traceAndAppointment(submitData, self.orderId)
reasonRelegation: trace.reasonRelegation,
reasonType: trace.reasonType,
remark: trace.remark,
}
// if (self.trace.reasonType != '改约') {
// if (self.timeItem && self.timeItem.pkey && self.trace.traceDate) {
// let traceDate = self.moment(self.trace.traceDate)
// let timeArr = self.timeItem.pkey.split('_')
// if (self.timeItem.pkey == 'appointment_range_24') {
// let traceDateTime = traceDate
// .clone()
// .add(23, 'hours')
// .add(59, 'minutes')
// params.nextTraceDatetime = traceDateTime.unix() * 1000
// } else {
// let hours = timeArr && timeArr.length && timeArr.pop()
// let traceDateTime = traceDate.clone().add(Number(hours), 'hours')
// params.nextTraceDatetime = traceDateTime.unix() * 1000
// }
// }
// } else {
params.appointmentDatetime = trace.traceDate
params.appointmentDatetimeRange = trace.timeRange
// }
let res = await self.$u.api.traceAndAppointment(params, self.orderId)
self.submiting = false self.submiting = false
if (res && res.code == 200) { if (res && res.code == 200) {
var pages = getCurrentPages() var pages = getCurrentPages()
...@@ -218,28 +114,16 @@ export default { ...@@ -218,28 +114,16 @@ export default {
} }
} }
} }
// /deep/ .u-subsection {
// padding: 4rpx !important;
// }
// .top-tab {
// text-align: center;
// }
.content { .content {
display: flex; display: flex;
flex-direction: column; flex-direction: column;
overflow: hidden; overflow: hidden;
margin-bottom: 188rpx; margin-bottom: 188rpx;
margin-top: 30rpx;
.content-view { .content-view {
height: 100%; height: 100%;
// border-radius: 12rpx;
overflow: auto; overflow: auto;
// margin-top: 30rpx;
// .time-view {
// border-radius: 12rpx;
// background-color: #ffffff;
// padding-bottom: 20rpx;
// }
} }
} }
.bottom-view { .bottom-view {
...@@ -258,64 +142,6 @@ export default { ...@@ -258,64 +142,6 @@ export default {
font-weight: bold; font-weight: bold;
} }
} }
// .con-box {
// padding: 30rpx 30rpx 8rpx 30rpx;
// border-radius: 12rpx;
// background-color: #ffffff;
// margin-bottom: 20rpx;
// .title {
// font-weight: bold;
// font-size: 32rpx;
// line-height: 32rpx;
// color: #333;
// }
// & > .u-flex {
// margin-top: 40rpx;
// margin-right: -24rpx;
// .txt-item {
// border-radius: 12rpx;
// padding: 24rpx 38rpx;
// width: 196rpx;
// height: 72rpx;
// text-align: center;
// margin-right: 22rpx;
// margin-bottom: 20rpx;
// background-color: #f4f5f7;
// &.active {
// background-color: #2272ff;
// .txt {
// color: #fff;
// text-overflow: ellipsis;
// overflow: hidden;
// white-space: nowrap;
// }
// }
// }
// }
// .txt {
// display: block;
// font-size: 26rpx;
// line-height: 26rpx;
// color: #333;
// text-overflow: ellipsis;
// overflow: hidden;
// white-space: nowrap;
// }
// .input-view {
// margin-bottom: 24rpx;
// }
// .textarea {
// /deep/ .u-input {
// textarea {
// margin-top: 20rpx;
// border: 2rpx solid #ececec;
// padding: 18rpx 30rpx;
// }
// }
// }
// }
.btn { .btn {
padding: 30rpx; padding: 30rpx;
border-radius: 52rpx; border-radius: 52rpx;
......
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