Browse Source

实操预约修改

master
unknown 10 months ago
parent
commit
1c82b0950d
  1. 2
      config/api.js
  2. 13
      config/request.js
  3. 44
      pages/carEntry/operaAppointment/comp/pickDate.vue
  4. 2
      pages/carEntry/operaAppointment/comp/step1.vue
  5. 28
      pages/carEntry/operaAppointment/operaAppointment.vue
  6. 1
      pages/mineEntry/myAppointment/comp/comp.scss
  7. 15
      pages/mineEntry/myAppointment/comp/opera.vue
  8. 27
      pages/mineEntry/myAppointment/detail/detail.vue
  9. 101
      pages/mineEntry/myAppointment/detail/opera.vue
  10. 13
      pages/mineEntry/myAppointment/myAppointment.vue
  11. BIN
      static/images/car/check_cli.png
  12. BIN
      static/images/car/check_nor.png
  13. 1
      store/modules/user.js

2
config/api.js

@ -135,7 +135,7 @@ export const masterPage = (params) => http.get('business/booking/master/page', {
// 4,实操预约详情
export const masterDetail = (params) => http.get('business/booking/master/get', {params})
// 5实操取消预约
export const masterCancelBooking = (data) => http.put('business/booking/master/cancelBooking', data)
export const masterCancelBooking = (data) => http.put('business/booking/master/cancelBooking/'+data, )

13
config/request.js

@ -48,18 +48,15 @@ module.exports = (vm) => {
// console.log(data)
if(data.code==406&&response.config.url!='member/auth/refresh-token'&&response.config.url!=='member/auth/logout') {
await vm.$store.dispatch('refreshToken')
// uni.$u.toast('登录过期,请重新登录')
// setTimeout(()=>{
// vm.$store.commit('goLogin')
// },1500)
// console.log(response.config)
setTimeout(()=>{
let obj = response.config
let method = obj.method.toLowerCase()
if(method=='get') {
return uni.$u.http.method(obj.url, {params: obj.params})
return uni.$u.http[method](obj.url, {params: obj.params})
}else{
return uni.$u.http.method(obj.url, obj.data )
return uni.$u.http[method](obj.url, obj.data )
}
})
}
if(data.code==401) {
vm.$store.commit('goLogin')
@ -67,7 +64,7 @@ module.exports = (vm) => {
// 自定义参数
const custom = response.config?.custom
if (data.code !== 0) {
if (data.code !== 0&&data.code!=406) {
// 如果没有显式定义custom的toast参数为false的话,默认对报错进行toast弹出提示
if (custom.toast !== false) {
uni.$u.toast(data.msg)

44
pages/carEntry/operaAppointment/comp/pickDate.vue

@ -37,7 +37,7 @@
<view class="timeCon" v-if="timerArr.length||timerArr2.length">
<view class="h2" v-if="timerArr.length">上午</view>
<view class="time_box">
<view class="time_item" v-for="(item,index) in timerArr" :key="index" @click="chooseCourse(item)" :class="{active: courseIds==item.id, disable: item.status!=0}" >
<view class="time_item" v-for="(item,index) in timerArr" :key="index" @click="chooseCourse(item)" :class="{active: (FormData.courseArr.findIndex(val=>val.id==item.id))!=-1, disable: item.status!=0}" >
<!-- <view class="flex" v-if="item.status==0">
<view class="lab">{{ item.appointmentAlreadyCount ||0 }} <text>/</text> {{ item.appointmentSumCount}} </view>
<view class="iconArrowBg" v-if="item.appointmentAlreadyCount">
@ -50,7 +50,7 @@
</view>
<view class="h2" v-if="timerArr2.length">下午</view>
<view class="time_box">
<view class="time_item" v-for="(item,index) in timerArr2" :key="index" @click="chooseCourse(item)" :class="{active: courseIds==item.id, disable: item.status!=0}">
<view class="time_item" v-for="(item,index) in timerArr2" :key="index" @click="chooseCourse(item)" :class="{active: (FormData.courseArr.findIndex(val=>val.id==item.id))!=-1, disable: item.status!=0}">
<!-- <view class="flex" v-if="item.status==0">
<view class="lab">{{ item.appointmentAlreadyCount ||0 }} <text>/</text> {{ item.appointmentSumCount}} </view>
<view class="iconArrowBg" v-if="item.appointmentAlreadyCount">
@ -132,10 +132,19 @@
methods: {
//
async scheduleClassFn() {
uni.showLoading({
title: '正在加载...'
})
this.FormData.courseArr = []
let obj = { "coachId": this.FormData.coachId, "trainType": this.FormData.trainType, "subject": this.FormData.subject, "classDate": this.chooseDay, "studentId": this.FormData.studentId}
const {data: res} = await scheduleClass(obj)
this.timerArr2 = res.afternoonScheduleClass
this.timerArr = res.morningScheduleClass
uni.hideLoading()
this.timerArr2 = res.afternoonScheduleClass.sort((a,b)=>{
return parseInt(a.classTime.slice(0,2)) - parseInt(b.classTime.slice(0,2))
})
this.timerArr = res.morningScheduleClass.sort((a,b)=>{
return parseInt(a.classTime.slice(0,2)) - parseInt(b.classTime.slice(0,2))
})
//
if(this.chooseDay==this.dateArr[0][0].date) {
let arr = [...this.timerArr,...this.timerArr2]
@ -192,15 +201,24 @@
},
chooseCourse(item) {
if(item.status!=0) return
this.FormData.courseIds = this.courseIds = item.id
this.FormData.classDate = item.classDate
this.FormData.classTime = item.classTime
this.FormData.carNumber = item.carNumber
this.FormData.siteName = item.siteName
this.FormData.siteAddress = item.siteAddress
this.FormData.latitude = item.latitude
this.FormData.longitude = item.longitude
this.FormData.photoPath = item.photoPath
let index = this.FormData.courseArr.findIndex(val=>val.id==item.id)
if( index==-1) {
//
let arr = [...this.timerArr,...this.timerArr2]
let status4 = arr.reduce((p,v)=>{
if(v.status==4) p++
return p
},0)
if((status4+this.FormData.courseArr.length)>=4 ){
this.$u.toast('一天最多能约四节课')
}else {
this.FormData.courseArr.push(item)
}
}else {
this.FormData.courseArr.splice(index,1)
}
},
}
}

2
pages/carEntry/operaAppointment/comp/step1.vue

@ -49,7 +49,7 @@
methods: {
openPopup(num) {
if(!this.FormData.courseIds) {
if(!this.FormData.courseArr.length) {
return this.$u.toast('请选择排课日期')
}
this.$emit('openPopup', num)

28
pages/carEntry/operaAppointment/operaAppointment.vue

@ -20,11 +20,15 @@
</view>
<view class="row">
<view class="lab">预约场地</view>
<view class="val">{{FormData.siteName}}</view>
<view class="">
<view class="val" v-for="item in FormData.showSiteName" :key="item.id">{{item}}</view>
</view>
</view>
<view class="row">
<view class="lab">预约车辆</view>
<view class="val">{{ FormData.carNumber }}</view>
<view class="">
<view class="val" v-for="item in FormData.showCarName" :key="item">{{ item }}</view>
</view>
</view>
<view class="row">
<view class="lab">预约时间</view>
@ -63,7 +67,10 @@
carNumber: '',//
siteName: '',//
siteAddress: '',//
photoPath: ''
photoPath: '',
courseArr: [],
showSiteName: [],//
showCarName: [],//
},
show: false
@ -93,6 +100,17 @@
this.currentStep = num
},
openPopup() {
this.FormData.classDate = this.FormData.courseArr[0].classDate
this.FormData.showSiteName = [...new Set(this.FormData.courseArr.map(item=>item.siteName))]
this.FormData.showCarName = [...new Set(this.FormData.courseArr.map(item=>item.carNumber))]
let classTime = [...new Set(this.FormData.courseArr.map(item=>{ return item.classTime.slice(0,2)}))]
if(classTime.length>1) {
let minTime = Math.min(...classTime)
let maxTime = Math.max(...classTime)
this.FormData.classTime = (minTime*1>9?minTime: '0'+minTime + '-') + (maxTime*1>9?maxTime: '0'+maxTime)
}else {
this.FormData.classTime = this.FormData.courseArr[0].classTime
}
this.show = true
},
showStep2() {
@ -104,7 +122,7 @@
"studentId": this.FormData.studentId,
"coachId": this.FormData.coachId,
"classDate": this.FormData.classDate,
"selectScheduleClass": [this.FormData.courseIds],
"selectScheduleClass": this.FormData.courseArr.map(item=>item.id),
// classId: [this.FormData.courseIds]
}
const {data: res} = await masterCreate(obj)
@ -141,7 +159,7 @@
padding: 22rpx 0;
display: flex;
font-size: 28rpx;
align-items: center;
// align-items: center;
.lab {
width: 180rpx;

1
pages/mineEntry/myAppointment/comp/comp.scss

@ -23,6 +23,7 @@
margin-right: 24rpx;
white-space: nowrap;
padding: 10rpx 18rpx;
}
.schoolName {

15
pages/mineEntry/myAppointment/comp/opera.vue

@ -20,7 +20,16 @@
<view class="icon">
<image src="@/static/images/car/ic_chexing.png" mode=""></image>
</view>
<view class="lab">所选择车辆</view>
<view class="lab">预约教练</view>
</view>
<view class="name">{{item.coachName}}</view>
</view>
<view class="row">
<view class="leftLab">
<view class="icon">
<image src="@/static/images/car/ic_chexing.png" mode=""></image>
</view>
<view class="lab">预约车辆</view>
</view>
<view class="name">{{item.carNumber}}</view>
</view>
@ -29,9 +38,9 @@
<view class="icon">
<image src="@/static/images/car/ic_shijian.png" mode=""></image>
</view>
<view class="lab">预约时间</view>
<view class="lab">预约日期</view>
</view>
<view class="name">{{$u.timeFormat(item.startTime, 'yyyy-mm-dd ')}}</view>
<view class="name">{{item.classDate}}</view>
</view>
</view>
<view class="border_bottom" v-if="item.status==2">

27
pages/mineEntry/myAppointment/detail/detail.vue

@ -5,15 +5,19 @@
<view class="pad">
<view class="card">
<imitate v-if="type==1" :info="info"/>
<opera v-else-if="type==2" :info="info"/>
<opera v-else-if="type==2" :info="info" ref="operaRef"/>
<examin v-else-if="type==3" :info="info"/>
</view>
<view class="btnCon">
<view class="btnCon" v-if="type!=2">
<view class="btnBg" @click.stop="$goPage('/pages/carEntry/evaluate/evaluate')" v-if="info.writtenoffStatus==2">去评价</view>
<view class="btnBorder" @click="show=true" v-if="info.recordStatus==0">取消预约</view>
<view class="btnBorder" @click="canceClick" v-if="info.recordStatus==0">取消预约</view>
<view class="btnBorder" v-if="info.payStatus==1">申请退款</view>
</view>
<view class="btnCon" v-else>
<view class="btnBg" @click.stop="$goPage('/pages/carEntry/evaluate/evaluate')" v-if="info.loginStatus==2">去评价</view>
<view class="btnBorder" @click="canceClick" v-if="info.loginStatus==0">取消预约</view>
</view>
</view>
<u-popup :show="show" mode="center" :round="20" >
<cancelReservation @popupBtnClick="popupBtnClick"/>
@ -53,9 +57,12 @@
const {data: res} = await examSimulationGet({id: this.id})
this.info = res
},
//
//
async masterDetailFn() {
const {data: res} = await masterDetail({id: this.id})
res.bookingDetailRespVOS = res.bookingDetailRespVOS.sort((a,b)=>{
return parseInt(a.classTime.slice(0,2)) - parseInt(b.classTime.slice(0,2))
})
this.info = res
},
@ -82,7 +89,9 @@
},
//
async masterCancelBookingFn() {
const {data: res} = await masterCancelBooking({id: this.id})
let ids = this.$refs.operaRef.ids
const {data: res} = await masterCancelBooking(ids.join())
this.$refs.operaRef.ids = []
this.$u.toast('取消成功')
this.masterDetailFn()
},
@ -100,6 +109,13 @@
}
this.show = false
console.log(val)
},
canceClick() {
if(this.type==2) {
let ids = this.$refs.operaRef.ids
if(!ids.length) return this.$u.toast('请选择取消时间段')
}
this.show=true
}
}
}
@ -114,6 +130,7 @@
flex-direction: column;
align-items: center;
justify-content: center;
margin-top: 76rpx;
.btnBg {
width: 212rpx;

101
pages/mineEntry/myAppointment/detail/opera.vue

@ -20,7 +20,16 @@
<view class="icon">
<image src="@/static/images/car/ic_chexing.png" mode=""></image>
</view>
<view class="lab">所选择车辆</view>
<view class="lab">预约教练</view>
</view>
<view class="name">{{info.coachName}}</view>
</view>
<view class="row">
<view class="leftLab">
<view class="icon">
<image src="@/static/images/car/ic_chexing.png" mode=""></image>
</view>
<view class="lab">预约车辆</view>
</view>
<view class="name">{{info.carNumber}}</view>
</view>
@ -29,16 +38,38 @@
<view class="icon">
<image src="@/static/images/car/ic_shijian.png" mode=""></image>
</view>
<view class="lab">预约时间</view>
<view class="lab">预约日期</view>
</view>
<view class="name">{{info.classDate}}</view>
</view>
<view class="row rowBotton" v-for="(item,index) in info.bookingDetailRespVOS" :key="index" :class="{blue: (item.loginStatus==1||item.loginStatus==1),hui: (item.loginStatus==3||item.loginStatus==9)}">
<view class="leftLab" v-if="index==0">
<view class="icon">
<image src="@/static/images/car/ic_shijian.png" mode=""></image>
</view>
<view class="lab">预约时段</view>
</view>
<view class="leftLab" v-else></view>
<view class="classTime" @click="chooseClassTime(item)">
<view class="radioIcon">
<view class="radioW" v-if="item.loginStatus==0" >
<image src="@/static/images/car/check_cli.png" mode="" v-if="ids.indexOf(item.id)!=-1"></image>
<image src="@/static/images/car/check_nor.png" mode="" v-else></image>
</view>
</view>
<view class="time" :class="{blue: (item.loginStatus==1||item.loginStatus==1),hui: (item.loginStatus==3||item.loginStatus==9)}">{{item.classTime}}</view>
</view>
<view class="status">
<view class="text hui" v-if="item.loginStatus==9">已取消</view>
<view class="text" v-else >{{statusTxt[item.loginStatus]}}</view>
</view>
<view class="name">2023/08/08 10:00:00</view>
</view>
</view>
<view class="border_bottom">
<view class="dateBox">
<view class="date">提交预约时间{{$u.timeFormat(info.startTime, 'yyyy-mm-dd hh:MM:ss')}}</view>
<view class="date" v-if="info.signOutTime">完成时间{{$u.timeFormat(item.signOutTime, 'yyyy-mm-dd hh:MM:ss')}}</view>
<view class="date">核销来源计时机器001</view>
<view class="date">提交预约时间{{$u.timeFormat(info.createTime, 'yyyy-mm-dd hh:MM:ss')}}</view>
<view class="date" v-if="info.loginStatus==3||info.loginStatus==9"><text>{{ info.loginStatus==3?'过期时间':'取消时间'}}</text> {{$u.timeFormat(info.updateTime, 'yyyy-mm-dd hh:MM:ss')}}</view>
<view class="date" v-if="info.signOutTime">完成时间{{$u.timeFormat(info.signOutTime, 'yyyy-mm-dd hh:MM:ss')}}</view>
</view>
</view>
</view>
@ -50,11 +81,69 @@
data() {
return {
statusTxt: ['未签到','已签到','已签退','旷课','已取消',''],//012退39
ids: []
}
},
methods: {
chooseClassTime(item) {
let index = this.ids.indexOf(item.id)
if(index==-1) {
this.ids.push(item.id)
}else {
this.ids.splice(index, 1)
}
}
}
}
</script>
<style lang="scss" scoped>
.rowBotton {
border-bottom: 1px solid #f8f8f8;
&.blue {
.classTime {
.time {
color: $themC;
}
}
.status {
.text {
color: $themC;
}
}
}
&.hui {
.classTime {
.time {
color: #ADADAD;
}
}
.status {
.text {
color: #ADADAD;
}
}
}
&:last-child {
border-bottom: none
}
.leftLab {
width: 160rpx;
}
.classTime {
display: flex;
align-items: center;
}
.radioIcon {
width: 36rpx;
height: 36rpx;
margin-right: 20rpx;
.radioW {
width: 100%;
height: 100%
}
}
}
@import '../comp/comp.scss';
</style>

13
pages/mineEntry/myAppointment/myAppointment.vue

@ -73,20 +73,31 @@
onLoad(options) {
if(options.currentTab) this.currentTab = options.currentTab
this.params.studentId = this.studentId
},
onShow() {
this.inintList()
},
onReachBottom() {
if(this.total>this.list.length) {
this.inintList('onReachBottom')
}
},
onPullDownRefresh() {
this.inintList()
},
methods: {
inintList() {
inintList(type) {
if(!type) {
this.params.pageNo = 1
this.list = []
this.total = 0
}
if(this.currentTab==3) {
this.examSimulationRecordFn()
}else if(this.currentTab==1) {
this.simulationPageFn()
}else {
this.masterPageFn()
}
},

BIN
static/images/car/check_cli.png

After

Width: 36  |  Height: 36  |  Size: 562 B

BIN
static/images/car/check_nor.png

After

Width: 36  |  Height: 36  |  Size: 272 B

1
store/modules/user.js

@ -106,6 +106,7 @@ const user = {
return config
})
}else {
commit('update_apiOk',true)
commit('goLogin')
return false
}

Loading…
Cancel
Save