Browse Source

实操预约

master
unknown 11 months ago
parent
commit
33ce398c98
  1. 2
      config/api.js
  2. 2
      manifest.json
  3. 8
      pages/carEntry/examineAppointment/comp/pickDate.vue
  4. 380
      pages/carEntry/operaAppointment/comp/pickDate.vue
  5. 9
      pages/carEntry/operaAppointment/comp/searchBox.vue
  6. 131
      pages/carEntry/operaAppointment/comp/step1.vue
  7. 87
      pages/carEntry/operaAppointment/comp/step2.vue
  8. 178
      pages/carEntry/operaAppointment/comp/step3.vue
  9. 168
      pages/carEntry/operaAppointment/operaAppointment.vue
  10. 10
      pages/carEntry/simulateAppointment/comp/step3.vue
  11. 7
      pages/mineEntry/myAppointment/comp/examin.vue
  12. 35
      pages/mineEntry/myAppointment/myAppointment.vue

2
config/api.js

@ -106,6 +106,8 @@ export const simulationClass = (params) => http.get('business/booking/simulation
export const simulationDevices = (params) => http.get('business/booking/simulation-devices/list', {params}) export const simulationDevices = (params) => http.get('business/booking/simulation-devices/list', {params})
// 4创建模拟预约 // 4创建模拟预约
export const simulationCreate = (data) => http.post('business/booking/simulation-record/create', data) export const simulationCreate = (data) => http.post('business/booking/simulation-record/create', data)
// 5获得模拟预约记录
export const simulationPage = (params) => http.get('business/booking/simulation-record/page', {params})
// 1新增实操预约记录 // 1新增实操预约记录
export const masterCreate = (data) => http.post('business/booking/master/create', data) export const masterCreate = (data) => http.post('business/booking/master/create', data)
// 1获得考场 // 1获得考场

2
manifest.json

@ -94,7 +94,7 @@
"proxy" : { "proxy" : {
"/api" : { "/api" : {
// "target" : "http://192.168.1.26:48080/", // "target" : "http://192.168.1.26:48080/",
"target" : "http://192.168.1.39:48080/",
"target" : "http://192.168.1.36:48080/",
"changeOrigin" : true, "changeOrigin" : true,
"secure" : true, "secure" : true,
"pathRewrite" : { "pathRewrite" : {

8
pages/carEntry/examineAppointment/comp/pickDate.vue

@ -57,11 +57,12 @@
</view> </view>
</view> </view>
</view> </view>
<view class="card" v-if="!timerArr2.length&&!timerArr.length">
<nodata>暂无预约排课</nodata>
</view>
</view> </view>
<view class="card" v-if="!timerArr2.length&&!timerArr.length">
<nodata>暂无预约排课</nodata>
</view>
<u-datetime-picker <u-datetime-picker
:show="show" :show="show"
@ -69,6 +70,7 @@
:minDate="minDate" :minDate="minDate"
:maxDate="maxDate" :maxDate="maxDate"
mode="year-month" mode="year-month"
@cancel="show=false"
@confirm="changeMonth" @confirm="changeMonth"
></u-datetime-picker> ></u-datetime-picker>
</view> </view>

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

@ -0,0 +1,380 @@
<template>
<view class="step1">
<view class="card">
<view class="dateBox">
<view class="month-row">
<view class="month" @click="show=true">{{ currentMonth }}</view>
<view class="arrow">
<u-icon name="arrow-down" :size="12" :color="'#1989FA'"></u-icon>
</view>
</view>
<view class="date_row">
<view class="icon left" @click="changeDateIndex(-1)">
<u-icon name="arrow-left" :size="12" :color="'#fff'"></u-icon>
</view>
<view class="dateArr" >
<view class="dateWidth" v-for="(item,index) in dateArr[currentDay]" :key="index" @click="chooseDate(item)" >
<view class="date" :class="{active: chooseDay==item.date}">
<!-- <view class="dian"></view> -->
<view class="week">{{ item.week }}</view>
<view class="num">{{ item.num }}</view>
</view>
</view>
</view>
<view class="icon right" @click="changeDateIndex(1)">
<u-icon name="arrow-right" :size="12" :color="'#fff'"></u-icon>
</view>
</view>
</view>
</view>
<view class="card" >
<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="flex" v-if="item.status==0">
<view class="lab">{{ item.appointmentAlreadyCount ||0 }} <text>/</text> {{ item.appointmentSum}} </view>
<view class="iconArrowBg" v-if="item.appointmentAlreadyCount">
<u-icon name="arrow-right" :size="10" :color="'#fff'"></u-icon>
</view>
</view>
<view class="lab" v-else>{{ statusTxt[item.status] }}</view>
<view class="time">{{ item.classTime }}</view>
</view>
</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="flex" v-if="item.status==0">
<view class="lab">{{ item.appointmentAlreadyCount ||0 }} <text>/</text> {{ item.appointmentSum}} </view>
<view class="iconArrowBg" v-if="item.appointmentAlreadyCount">
<u-icon name="arrow-right" :size="10" :color="'#fff'"></u-icon>
</view>
</view>
<view class="lab" v-else>{{ statusTxt[item.status] }}</view>
<view class="time">{{ item.classTime }}</view>
</view>
</view>
</view>
<view class="card" v-if="!timerArr2.length&&!timerArr.length" style="padding: 0 0 60rpx 0;">
<nodata>暂无预约排课</nodata>
</view>
</view>
<u-datetime-picker
:show="show"
v-model="chooseMonth"
:minDate="minDate"
:maxDate="maxDate"
mode="year-month"
@confirm="changeMonth"
@cancel="show=false"
></u-datetime-picker>
</view>
</template>
<script>
import { getDates, getMonthsBetweenDates } from '@/config/utils.js'
import { scheduleClass } from '@/config/api.js'
export default {
props: ['step', 'FormData'],
data() {
return {
maxDate: 0,
minDate: 0,
monthArr: [],
show: false,
dateArr: [],
currentDay: 0,//
chooseDay: '',
chooseMonth: '',
timerArr: [],
statusTxt: ['可预约', '未开放', '已过期', '已约满', '已约过'], //0 1,2,3
timerArr2: [],
chooseTimerId: '',
endDate: null,
startDate: null,
courseIds: '',
radioVal: '',
}
},
mounted() {
this.initDate()
},
computed: {
currentMonth() {
let tiemr = new Date(this.chooseDay) * 1
return this.$u.date(tiemr, 'yyyy.mm')
}
},
watch: {
courseIds: {
handler(val) {
let allTimer = [...this.timerArr,...this.timerArr2]
let total = allTimer.reduce((pre, item)=>{
if(item.status==1) {
pre.push(item.classTime)
}
return pre
},[])
if(total.length==this.courseIds.length) {
this.radioVal = 0
}
}
}
},
methods: {
//
async scheduleClassFn() {
let obj = { "coachId": this.vuex_userInfo.coachId, "trainType": this.FormData.trainType, "subject": this.FormData.subject, "classDate": this.chooseDay, "studentId": this.userId}
const {data: res} = await scheduleClass(obj)
return
this.timerArr2 = res.afternoonSimulationClass
this.timerArr = res.morningSimulationClass
//
if(this.chooseDay==this.dateArr[0][0].date) {
let arr = [...this.timerArr,...this.timerArr2]
arr.forEach(item=>{
let timer = new Date() * 1
let date = this.chooseDay+' '+(item.classTime.split('-')[0])
date = date.replace(/-/g,'/');
let timer2 = new Date(date).getTime();
// console.log(timer)
// console.log(timer2)
// console.log(date)
if(timer>timer2) {
item.status = 2
}
})
}
},
//
async initDate() {
this.startDate = this.$u.timeFormat(new Date()*1, 'yyyy-mm-dd');
this.maxDate = this.endDate = new Date('2023-11-30')*1
this.minDate = new Date()*1
this.dateArr = getDates(this.startDate, this.endDate);
this.chooseDay = this.dateArr[0][0].date
console.log(this.dateArr)
this.scheduleClassFn()
},
//
changeMonth(val) {
let startDate = this.$u.date(val.value, 'yyyy-mm-dd')
for(let i=0; i<this.dateArr.length; i++) {
for(let j=0; j<this.dateArr[i].length; j++) {
let date = this.dateArr[i][j].date
if(startDate==date) {
this.currentDay = i
this.chooseDay = date
}
}
}
this.show = false
},
//
chooseDate(item) {
this.chooseDay = item.date
this.scheduleClassFn()
// console.log('*****')
// console.log(this.chooseDay)
},
changeDateIndex(num) {
if(this.currentDay==0&&num==-1) return this.$u.toast('已是可选最小日期')
if(this.currentDay==this.dateArr.length-1&&num==1) return this.$u.toast('已是可选最大日期')
this.currentDay = this.currentDay + num
this.chooseDay = this.dateArr[this.currentDay][0].date
this.scheduleClassFn()
},
chooseCourse(item) {
this.FormData.courseIds = this.courseIds = item.id
this.FormData.classDate = item.classDate
this.FormData.classTime = item.classTime
console.log(item)
},
}
}
</script>
<style lang="scss" scoped>
.card {
width: 100%;
margin-bottom: 24rpx;
overflow: hidden;
.dateBox {
padding: 36rpx 0 40rpx 0;
.month-row {
display: flex;
justify-content: center;
align-items: center;
margin-bottom: 36rpx;
.month {
font-size: 32rpx;
color: $themC;
}
.arrow {
margin-left: 6rpx;
}
}
.date_row {
width: 100%;
height: 100rpx;
position: relative;
.icon {
width: 40rpx;
height: 40rpx;
background: rgba(51,51,51,0.18);
backdrop-filter: blur(4rpx);
position: absolute;
top: 50%;
transform: translateY(-50%);
display: flex;
align-items: center;
justify-content: center;
border-radius: 50%;
&.left {
left: 16rpx;
}
&.right {
right: 16rpx;
}
}
.dateArr {
display: flex;
padding: 0 70rpx;
// justify-content: space-between;
&.oneDate {
justify-content: center;
}
.dateWidth {
width: 20%;
display: flex;
justify-content: center;
}
.date {
width: 74rpx;
height: 100rpx;
border-radius: 16rpx;
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
font-size: 28rpx;
color: #333;
.dian {
width: 12rpx;
height: 12rpx;
background: #D8D8D8;
border-radius: 50%;
&.active {
background: #1989FA;
}
}
&.active {
background: rgba(25,137,250,0.1);
border: 2rpx solid #1989FA;
color: $themC;
}
.week {
}
.num {
margin-top: 4rpx;
}
}
}
}
}
}
.card {
.timeCon {
padding: 0 24rpx 40rpx 24rpx;
}
.h2 {
line-height: 90rpx;
font-weight: 500;
color: #333;
}
.time_box {
display: flex;
flex-wrap: wrap;
justify-content: space-between;
&::after{
display:block;
content:"";
width: 32%;
height:0px;
}
.time_item {
width: 30%;
height: 120rpx;
background: #F8F8F8;
border-radius: 12rpx;
display: flex;
flex-direction: column;
justify-content: center;
align-items: center;
border-radius: 12rpx;
margin-bottom: 20rpx;
color: #333;
&.active {
background: rgba(25,137,250,0.1);
border: 2rpx solid #1989FA;
color: $themC;
}
&.disable {
opacity: 0.4;
}
.lab {
font-size: 28rpx;
font-weight: 500;
}
.time {
font-size: 24rpx;
margin-top: 4rpx;
}
}
}
}
.btn {
width: 47%;
height: 72rpx;
background: #1989FA;
border-radius: 8rpx;
font-size: 28rpx;
color: #fff;
text-align: center;
line-height: 72rpx;
margin: 108rpx auto 50rpx auto;
}
.iconArrowBg {
background: #D8D8D8;
width: 26rpx;
height: 26rpx;
border-radius: 50%;
display: flex;
justify-content: center;
align-items: center;
margin-left: 4px;
}
.step2 {
display: flex;
justify-content: space-between;
align-items: center;
padding-bottom: 40px;
.btnBg {
width: 310rpx;
}
}
</style>

9
pages/carEntry/operaAppointment/comp/searchBox.vue

@ -5,8 +5,8 @@
<image src="@/static/images/car/ic_sousuo.png" mode=""></image> <image src="@/static/images/car/ic_sousuo.png" mode=""></image>
</view> </view>
<view class="inputBox"> <view class="inputBox">
<u--input :placeholder="placeholder" border="none" clearable v-model="keywords" :color="'#1989FA'"
placeholderClass="placeholderClass"></u--input>
<u-search :placeholder="placeholder" border="none" clearable v-model="keywords" :color="'#1989FA'" :bgColor="'transparent'" :showAction="false"
:placeholderColor="'#1989FA'" @search="$u.debounce(searchFn, 500)" @clear="searchFn"></u-search>
</view> </view>
</view> </view>
</view> </view>
@ -19,6 +19,11 @@
return { return {
keywords: '' keywords: ''
} }
},
methods: {
searchFn() {
this.$emit('searchFn', this.keywords)
}
} }
} }
</script> </script>

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

@ -1,72 +1,117 @@
<template> <template>
<view class="step1"> <view class="step1">
<coachInfo @click.native="showStep2"/>
<view class="h1">预约时间</view>
<pickDate :FormData="FormData"/>
<view class="h1">教练车</view>
<view class="card"> <view class="card">
<view class="list">
<view class="listItem" v-for="(item,index) in list" :key="index" :class="{active: index==1}">
{{ item.text }}</view>
<view class="car">
<view class="carTag">赣A98299学</view>
</view>
</view>
<view class="h1">训练场地</view>
<view class="card" >
<view class="site">
<view class="leftTxt">
<view class="adrs">某某场地</view>
<view class="adrsTxt">江西省江西市江西区尚坤丁兰国际1190</view>
</view>
<view class="icon">
<image src="@/static/images/car/btn_daohang.png" mode=""></image>
<!-- <image src="@/static/images/car/btn_daohang_cli.png" mode=""></image> -->
</view>
</view>
</view>
<view class="poz_btn">
<view class="btn_row" >
<view class="btnBg" @click="changeStep(2)">下一步</view>
</view> </view>
</view> </view>
<view class="btn" @click="changeStep(2)">下一步</view>
</view> </view>
</template> </template>
<script> <script>
import coachInfo from './coachInfo'
import pickDate from './pickDate'
export default { export default {
components: { coachInfo, pickDate },
props: ['FormData'],
data() { data() {
return { return {
list: [{
text: '科目二',
id: 2
},
{
text: '科目三',
id: 3
},
],
} }
}, },
methods: { methods: {
changeStep(val) {
this.$emit('changeStep', val)
}
changeStep(num) {
if(this.FormData.coachId) {
}
this.$emit('changeStep', num)
},
showStep2() {
this.$emit('showStep2')
}
} }
} }
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>
.list {
display: flex;
flex-wrap: wrap;
display: flex;
padding: 24rpx;
.listItem {
width: 32.4%;
.poz_btn {
// position: fixed;
// bottom: 0;
// left: 0;
// padding: 32rpx;
// width: 100%;
// background: #F6F6F6;
.btn_row {
display: flex;
height: 200rpx;
align-items: center;
justify-content: center;
.btnBg {
width: 396rpx;
}
}
}
.h1 {
line-height: 100rpx;
}
.car {
padding: 32rpx 28rpx;
.carTag {
height: 120rpx; height: 120rpx;
background: #F8F8F8; background: #F8F8F8;
padding: 0 18rpx;
color: $themC;
border-radius: 12rpx; border-radius: 12rpx;
font-size: 28rpx;
font-weight: 500; font-weight: 500;
text-align: center;
width: fit-content;
line-height: 120rpx; line-height: 120rpx;
margin-right: 20rpx;
&.active {
width: 200rpx;
height: 120rpx;
background: rgba(25, 137, 250, 0.1);
border-radius: 12rpx;
border: 2rpx solid $themC;
color: $themC;
}
} }
} }
.btn {
width: 47%;
height: 72rpx;
background: #1989FA;
border-radius: 8rpx;
font-size: 28rpx;
color: #fff;
text-align: center;
line-height: 72rpx;
margin: 108rpx auto 50rpx auto;
.site {
padding: 28rpx 40rpx 28rpx 36rpx;
display: flex;
align-items: center;
.leftTxt {
width: 0;
flex: 1;
color: $themC;
.adrs {
font-size: 32rpx;
font-weight: 550;
margin-bottom: 10rpx;
}
.adrsTxt {
font-size: 28rpx;
font-weight: 400;
}
}
.icon {
width: 72rpx;
height: 72rpx;
}
} }
</style> </style>

87
pages/carEntry/operaAppointment/comp/step2.vue

@ -1,20 +1,19 @@
<template> <template>
<view class="step2"> <view class="step2">
<searchBox placeholder="搜索场地名称" key="step3"></searchBox>
<view class="card" v-for="(item,index) in 10" :key="index" :class="{active: index==2}">
<view class="leftTxt">
<view class="name oneRowText">某某模拟驾驶馆</view>
<view class="adr">江西省江西市江西区尚坤丁兰国际1190</view>
</view>
<searchBox placeholder="搜索教练姓名或手机号" @searchFn="searchFn"></searchBox>
<view class="card" v-for="(item,index) in list" :key="index" :class="{active: FormData.coachId==item.id}" @click="chooseCoach(item)">
<view class="icon"> <view class="icon">
<image src="@/static/images/car/btn_daohang.png" mode=""></image>
<!-- <image src="@/static/images/car/btn_daohang_cli.png" mode=""></image> -->
<image src="@/static/images/index/radio_cli.png" mode="" v-if="FormData.coachId==item.id"></image>
<image src="@/static/images/index/radio_nor.png" mode="" v-else></image>
</view>
<view class="name">
{{item.name}} <text>{{item.mobile}}</text>
</view> </view>
</view> </view>
<view class="poz_btn"> <view class="poz_btn">
<view class="btn_row" > <view class="btn_row" >
<view class="border btn" @click="changeStep(1)">返回上一步</view> <view class="border btn" @click="changeStep(1)">返回上一步</view>
<view class="btn" @click="changeStep(3)">下一步</view>
<view class="btn" @click="changeStep(1)">下一步</view>
</view> </view>
</view> </view>
</view> </view>
@ -22,11 +21,52 @@
<script> <script>
import searchBox from './searchBox' import searchBox from './searchBox'
import { coachPage } from '@/config/api.js'
export default { export default {
props: ['FormData'],
components: { searchBox }, components: { searchBox },
data() {
return {
params: {
pageNo: 1,
pageSize: 20,
schoolId: '',
name: ''
},
status: 'loading',
list: [],
total: 20
}
},
created() {
this.params.schoolId = this.vuex_userInfo.schoolId
this.coachPageFn()
},
methods: { methods: {
changeStep(val) { changeStep(val) {
this.$emit('changeStep', val) this.$emit('changeStep', val)
},
//
async coachPageFn() {
const {data:res} = await coachPage(this.params)
this.list.push(...res.list)
this.params.pageNo ++
this.total = res.total
if(this.list.length>=this.total) {
this.status = 'nomore'
}
console.log('获取教练')
console.log(this.list)
},
searchFn(val) {
this.params.name = val
this.list = []
this.params.pageNo = 1
this.coachPageFn()
},
chooseCoach(item) {
this.FormData.coachId = item.id
this.FormData.coachName = item.name
} }
} }
} }
@ -47,31 +87,20 @@
.card { .card {
padding: 28rpx 36rpx; padding: 28rpx 36rpx;
display: flex; display: flex;
justify-content: space-between;
align-items: center; align-items: center;
margin-bottom: 20rpx; margin-bottom: 20rpx;
&.active {
background: rgba(25,137,250,0.1);
border: 2rpx solid #1989FA;
color: $themC;
}
.leftTxt {
width: 0;
flex: 1;
.name {
font-size: 32rpx;
font-weight: 600;
}
.adr {
font-size: 24rpx;
margin-top: 8rpx;
height: 100rpx;
.name {
font-size: 26rpx;
color: #333;
margin-left: 16rpx;
text {
margin-left: 10rpx;
} }
} }
.icon { .icon {
width: 72rpx;
height: 72rpx;
width: 30rpx;
height: 30rpx;
} }
} }
} }

178
pages/carEntry/operaAppointment/comp/step3.vue

@ -1,42 +1,19 @@
<template> <template>
<view class="step3"> <view class="step3">
<searchBox placeholder="搜索车辆编号或车牌号" key="step3"></searchBox>
<view class="card">
<view class="list">
<view class="listItem" v-for="(item,index) in list" :key="index" :class="{active: index==1}">
<view class="num">{{index+1}}号车</view>
<view class="text">{{ item.text }}</view>
</view>
</view>
</view>
<view class="btn_row" style="margin-top: 108rpx;">
<view class="border btn" @click="changeStep(2)">返回上一步</view>
<view class="btn" @click="changeStep(4)">下一步</view>
</view>
</view> </view>
</template> </template>
<script> <script>
import searchBox from './searchBox'
export default { export default {
components: { searchBox },
data() { data() {
return { return {
list: [{
text: '00001',
id: 1
},
{
text: '00002',
id: 1
},
{
text: '00003',
id: 1
},
dateArr: [
{week: '一', num: '08'},
{week: '二', num: '09'},
{week: '三', num: '10'},
{week: '四', num: '11'},
{week: '五', num: '12'},
], ],
show: false show: false
} }
@ -51,47 +28,138 @@
<style lang="scss" scoped> <style lang="scss" scoped>
.card { .card {
padding: 28rpx 24rpx;
width: 100%;
overflow: hidden;
.dateBox {
padding: 36rpx 0 40rpx 0;
.month-row {
display: flex;
justify-content: center;
align-items: center;
margin-bottom: 36rpx;
.month {
font-size: 32rpx;
color: $themC;
}
.arrow {
margin-left: 6rpx;
}
}
.date_row {
width: 100%;
height: 100rpx;
position: relative;
.icon {
width: 40rpx;
height: 40rpx;
background: rgba(51,51,51,0.18);
backdrop-filter: blur(4rpx);
position: absolute;
top: 50%;
transform: translateY(-50%);
display: flex;
align-items: center;
justify-content: center;
border-radius: 50%;
&.left {
left: 16rpx;
}
&.right {
right: 16rpx;
}
}
.dateArr {
display: flex;
padding: 0 70rpx;
justify-content: space-between;
.date {
width: 74rpx;
height: 100rpx;
border-radius: 16rpx;
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
font-size: 28rpx;
color: #333;
&.active {
background: rgba(25,137,250,0.1);
border: 2rpx solid #1989FA;
color: $themC;
}
.week {
}
.num {
margin-top: 4rpx;
}
}
}
}
}
} }
.list {
display: flex;
flex-wrap: wrap;
display: flex;
justify-content: space-between;
.card {
.timeCon {
padding: 0 24rpx 70rpx 24rpx;
}
.h2 {
line-height: 90rpx;
font-weight: 500;
color: #333;
}
.listItem {
width: 32.4%;
.time_box {
display: flex;
flex-wrap: wrap;
justify-content: space-between;
.time_item {
width: 30%;
height: 120rpx; height: 120rpx;
background: #F8F8F8; background: #F8F8F8;
border-radius: 12rpx; border-radius: 12rpx;
font-weight: 500;
text-align: center;
font-size: 24rpx;
display: flex; display: flex;
flex-direction: column; flex-direction: column;
align-items: center;
justify-content: center; justify-content: center;
.num {
font-size: 28rpx;
font-weight: 600;
margin-bottom: 10rpx;
}
align-items: center;
border-radius: 12rpx;
color: #333;
&.active { &.active {
width: 200rpx;
height: 120rpx;
background: rgba(25, 137, 250, 0.1);
border-radius: 12rpx;
border: 2rpx solid $themC;
background: rgba(25,137,250,0.1);
border: 2rpx solid #1989FA;
color: $themC; color: $themC;
} }
}
}
&.disable {
opacity: 0.5;
}
.lab {
font-size: 28rpx;
font-weight: 500;
}
.time {
font-size: 24rpx;
margin-top: 4rpx;
}
}
}
}
.poz_btn {
position: fixed;
bottom: 0;
left: 0;
padding: 12rpx 32rpx;
width: 100%;
background: #F6F6F6;
}
.btn_row { .btn_row {
display: flex; display: flex;
justify-content: space-between; justify-content: space-between;
padding-bottom: 30rpx;
.btn { .btn {
width: 47%; width: 47%;
height: 72rpx; height: 72rpx;
@ -109,4 +177,6 @@
} }
} }
} }
</style> </style>

168
pages/carEntry/operaAppointment/operaAppointment.vue

@ -2,109 +2,145 @@
<view class="pageBgImg"> <view class="pageBgImg">
<topNavbar :title="title"></topNavbar> <topNavbar :title="title"></topNavbar>
<view class="pad" style="padding-bottom: 60rpx;"> <view class="pad" style="padding-bottom: 60rpx;">
<coachInfo/>
<view class="h1">预约时间</view>
<pickDateTimer/>
<view class="h1">教练车</view>
<view class="card">
<view class="car">
<view class="carTag">赣A98299学</view>
</view>
</view>
<view class="h1">训练场地</view>
<view class="card" >
<view class="site">
<view class="leftTxt">
<view class="adrs">某某场地</view>
<view class="adrsTxt">江西省江西市江西区尚坤丁兰国际1190</view>
<step1 v-if="currentStep==1" @changeStep="changeStep" :FormData="FormData" @showStep2="showStep2"></step1>
<step2 v-if="currentStep==2" @changeStep="changeStep" :FormData="FormData"></step2>
</view>
<u-popup :show="show" mode="center" :round="8">
<view class="popupCon">
<view class="h2">再次确认预约信息</view>
<view class="content">
<view class="row">
<view class="lab">预约类型</view>
<view class="val">实操训练预约</view>
</view> </view>
<view class="icon">
<image src="@/static/images/car/btn_daohang.png" mode=""></image>
<!-- <image src="@/static/images/car/btn_daohang_cli.png" mode=""></image> -->
<view class="row">
<view class="lab">预约科目</view>
<view class="val">{{FormData.subject==2?'科目二': '科目三'}}</view>
</view> </view>
<view class="row">
<view class="lab">预约场地</view>
<view class="val">xxx场地</view>
</view>
<view class="row">
<view class="lab">预约车辆</view>
<view class="val">02号车</view>
</view>
<view class="row">
<view class="lab">预约时间</view>
<view class="val">2023/08/08 08:009:00</view>
</view>
</view>
<view class="btn_row">
<view class="border btn" @click="show = false">返回修改</view>
<view class="btn">确认</view>
</view> </view>
</view> </view>
</view>
</u-popup>
</view> </view>
</template> </template>
<script> <script>
import coachInfo from './comp/coachInfo'
import step1 from './comp/step1'
import step2 from './comp/step2' import step2 from './comp/step2'
import step3 from './comp/step3'
import step4 from './comp/step4'
import { scheduleClass } from '@/config/api.js'
export default { export default {
components: { coachInfo, step2, step3, step4 },
components: { step1, step2,},
data() { data() {
return { return {
currentStep: 2,
subject: 2,
title: '实操训练预约'
currentStep: 1,
title: '实操训练预约',
FormData: {
carId: '',
subject: 2,
classDate: '',
classTime: '',
licnum: '',
siteName: '',
trainType: 'C1',
coachId: ''
},
show: false
} }
}, },
onLoad(options) { onLoad(options) {
this.subject = options.subject this.subject = options.subject
if(this.subject==2) { if(this.subject==2) {
this.title = '实操训练科目二预约' this.title = '实操训练科目二预约'
this.currentStep = 2
}else if(this.subject==3) { }else if(this.subject==3) {
this.title = '实操训练科目三预约' this.title = '实操训练科目三预约'
this.currentStep = 2
} }
this.scheduleClassFn()
if(options.subject) this.FormData.subject = options.subject
this.FormData.trainType = this.vuex_userInfo.trainType
}, },
methods: { methods: {
changeStep(num) { changeStep(num) {
this.currentStep = num this.currentStep = num
}, },
async scheduleClassFn() {
let obj = { "coachId": this.vuex_userInfo.coachId, "subject": 2, "classDate": "2023-10-30", "studentId": this.userId}
const {data: res} = await scheduleClass(obj)
showStep2() {
this.currentStep = 2
} }
} }
} }
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>
.h1 {
line-height: 100rpx;
}
.car {
padding: 32rpx 28rpx;
.carTag {
height: 120rpx;
background: #F8F8F8;
padding: 0 18rpx;
color: $themC;
border-radius: 12rpx;
font-size: 28rpx;
font-weight: 500;
width: fit-content;
line-height: 120rpx;
.popupCon {
padding: 30rpx 50rpx;
.h2 {
font-weight: 600;
color: #333333;
line-height: 70rpx;
font-size: 36rpx;
text-align: center;
margin-bottom: 20rpx;
} }
}
.site {
padding: 28rpx 40rpx 28rpx 36rpx;
display: flex;
align-items: center;
.leftTxt {
width: 0;
flex: 1;
color: $themC;
.adrs {
font-size: 32rpx;
font-weight: 550;
margin-bottom: 10rpx;
}
.adrsTxt {
.content {
padding-bottom: 20rpx;
.row {
padding: 22rpx 0;
display: flex;
font-size: 28rpx; font-size: 28rpx;
font-weight: 400;
align-items: center;
.lab {
width: 180rpx;
color: #686B73;
}
.val {
flex: 1;
font-weight: 500;
}
} }
} }
.icon {
width: 72rpx;
}
.btn_row {
display: flex;
justify-content: space-between;
padding-bottom: 30rpx;
.btn {
width: 47%;
height: 72rpx; height: 72rpx;
background: #1989FA;
border-radius: 8rpx;
font-size: 28rpx;
color: #fff;
text-align: center;
line-height: 72rpx;
&.border {
background: rgba(25, 137, 250, 0.1);
border: 2rpx solid $themC;
color: $themC;
}
} }
} }
</style> </style>

10
pages/carEntry/simulateAppointment/comp/step3.vue

@ -82,8 +82,14 @@
"classId": this.FormData.courseIds, "classId": this.FormData.courseIds,
"deviceNum": this.FormData.deviceNum "deviceNum": this.FormData.deviceNum
} }
const {data: res} = await simulationCreate(obj)
console.log(res)
const res = await simulationCreate(obj)
if(res.code==0) {
this.show = false
this.$u.toast('预约成功')
setTimeout(()=>{
this.$goPage('/pages/mineEntry/myAppointment/myAppointment?currentTab=1')
},1500)
}
} }
} }
} }

7
pages/mineEntry/myAppointment/comp/examin.vue

@ -49,7 +49,12 @@
<script> <script>
export default { export default {
props: ['item']
props: ['item'],
data() {
return {
statusTxt: ['未签到','已签到','已签退','旷课','已取消',''],//012退39
}
}
} }
</script> </script>

35
pages/mineEntry/myAppointment/myAppointment.vue

@ -11,17 +11,17 @@
<view class="navs"> <view class="navs">
<view class="nav" v-for="(item,index) in navList" :key="index" :class="{active: currentNav===item.id}" @click="changeNav(item)">{{ item.text }}</view> <view class="nav" v-for="(item,index) in navList" :key="index" :class="{active: currentNav===item.id}" @click="changeNav(item)">{{ item.text }}</view>
</view> </view>
<view class="recordTotal">{{total}}条记录</view>
<view class="recordTotal" v-if="total">{{total}}条记录</view>
<view class="tabCon" v-show="currentTab==1"> <view class="tabCon" v-show="currentTab==1">
<view class="card" v-for="(item,index) in 10" :key="index" @click="$goPage('/pages/mineEntry/myAppointment/detail/detail')">
<imitate></imitate>
<view class="card" v-for="(item,index) in examList" :key="index" @click="$goPage('/pages/mineEntry/myAppointment/detail/detail')">
<imitate :item="item"></imitate>
</view> </view>
</view> </view>
<view class="tabCon" v-if="currentTab==2"> <view class="tabCon" v-if="currentTab==2">
<view class="card" v-for="(item,index) in 10" :key="index" @click="$goPage('/pages/mineEntry/myAppointment/detail/detail')"> <view class="card" v-for="(item,index) in 10" :key="index" @click="$goPage('/pages/mineEntry/myAppointment/detail/detail')">
<opera></opera>
<opera :item="item"></opera>
</view> </view>
</view> </view>
@ -40,7 +40,7 @@
import imitate from './comp/imitate' import imitate from './comp/imitate'
import opera from './comp/opera' import opera from './comp/opera'
import examin from './comp/examin' import examin from './comp/examin'
import { examSimulationRecord } from '@/config/api.js'
import { examSimulationRecord, simulationPage } from '@/config/api.js'
export default { export default {
components: { imitate, opera, examin}, components: { imitate, opera, examin},
data() { data() {
@ -60,18 +60,29 @@
// 012退39 // 012退39
currentTab: 3, currentTab: 3,
currentNav: 0, currentNav: 0,
examParams: { "pageNo": 1, "pageSize": 10, "keyWord": "", "status": '',},
examParams: { "pageNo": 1, "pageSize": 10, "keyWord": "", "status": '0',studentId: ''},
examList: [], examList: [],
total: 20 total: 20
} }
}, },
onLoad(options) { onLoad(options) {
if(options.currentTab) this.currentTab = options.currentTab if(options.currentTab) this.currentTab = options.currentTab
this.examSimulationRecordFn()
this.examParams.studentId = this.userId
this.inintList()
}, },
methods: { methods: {
inintList() {
this.examParams.pageNo = 1
this.examList = []
if(this.currentTab==3) {
this.examSimulationRecordFn()
}else if(this.currentTab==1) {
this.simulationPageFn()
}
},
changeTab(item) { changeTab(item) {
this.currentTab = item.id this.currentTab = item.id
this.inintList()
}, },
changeNav(item) { changeNav(item) {
this.currentNav = item.id this.currentNav = item.id
@ -90,6 +101,13 @@
this.examParams.pageNo ++ this.examParams.pageNo ++
this.examList.push(...res.list) this.examList.push(...res.list)
this.total = res.total this.total = res.total
},
//
async simulationPageFn() {
const {data: res} = await simulationPage(this.examParams)
this.examParams.pageNo ++
this.examList.push(...res.list)
this.total = res.total
} }
} }
} }
@ -154,4 +172,7 @@
padding: 0rpx 0 28rpx 0; padding: 0rpx 0 28rpx 0;
text-align: right; text-align: right;
} }
.pad {
padding-bottom: 40rpx;
}
</style> </style>
Loading…
Cancel
Save