This commit is contained in:
许允枞 2025-04-08 17:00:07 +08:00
parent 58c3b759bf
commit ca09addd0b
5 changed files with 328 additions and 271 deletions

View File

@ -9,7 +9,7 @@
<u-subsection :list="list" :current="curNow" @change="sectionChange"></u-subsection> <u-subsection :list="list" :current="curNow" @change="sectionChange"></u-subsection>
</view> </view>
<scroll-view style="height: 1200rpx;" scroll-y="true" class="itemContent" @scrolltolower="onReachBottomCus" <scroll-view style="height: 1200rpx;" scroll-y="true" class="itemContent" @scrolltolower="onReachBottomCus"
refresher-enabled @refresherrefresh="onRefresherrefresh" :refresher-triggered="isTriggered"> refresher-enabled @refresherrefresh="onRefresherrefresh" :refresher-triggered="isTriggered" v-if="appointmentList.length > 0">
<!-- 新增内容容器 --> <!-- 新增内容容器 -->
<view class="box_2 flex-col" v-if="curNow === 0"> <view class="box_2 flex-col" v-if="curNow === 0">
<view class="box_4 flex-col" v-for="item in appointmentList" @click="goDetail(item,'')" :key="item.id"> <view class="box_4 flex-col" v-for="item in appointmentList" @click="goDetail(item,'')" :key="item.id">
@ -82,6 +82,13 @@
</view> </view>
</view> </view>
</scroll-view> </scroll-view>
<view class="empty-container" v-else>
<u-empty
mode="data"
/>
</view>
<view class="box_6 flex-col bottom_"> <view class="box_6 flex-col bottom_">
<view class="text-wrapper_12 flex-col " @click="goAppointment()"> <view class="text-wrapper_12 flex-col " @click="goAppointment()">
<text class="text_19">预约</text> <text class="text_19">预约</text>
@ -138,10 +145,10 @@
}, },
getList() { getList() {
request({ request({
url: '/app-api/drivingSchool/system/reservationCourse/list', url: '/app-api/reservation-course/page',
method: 'GET', method: 'GET',
params: { params: {
pageNum: this.pageNo, pageNo: this.pageNo,
pageSize: this.pageSize, pageSize: this.pageSize,
ifCancel: false ifCancel: false
}, },
@ -165,7 +172,7 @@
params: { params: {
pageNum: this.pageNo, pageNum: this.pageNo,
pageSize: this.pageSize, pageSize: this.pageSize,
selectType: 'all' selectType: 'my'
}, },
tenantIdFlag: false tenantIdFlag: false
}).then(res => { }).then(res => {
@ -279,4 +286,11 @@
margin: 8rpx 0 0 12rpx; margin: 8rpx 0 0 12rpx;
} }
} }
.empty-container {
display: flex;
justify-content: center; /* 水平居中 */
align-items: center; /* 垂直居中 */
height: 100vh; /* 或者你需要撑满的高度 */
}
</style> </style>

View File

@ -9,20 +9,20 @@
<view class="" style="background-color: white;padding: 10rpx 15rpx;border-radius: 15rpx"> <view class="" style="background-color: white;padding: 10rpx 15rpx;border-radius: 15rpx">
<u-form labelPosition="left" labelWidth="auto" labelAlign="center" :model="appointmentInfo" <u-form labelPosition="left" labelWidth="auto" labelAlign="center" :model="appointmentInfo"
:rules="rules" ref="uForm"> :rules="rules" ref="uForm">
<u-form-item label="课程名称" prop="userInfo.name" @click="showCourse = true" ref="item1"> <u-form-item label="课程名称" prop="courseName" @click="showCourse = true" ref="item1">
<u-input v-model="appointmentInfo.courseName" disabled disabledColor="#ffffff" <u-input v-model="appointmentInfo.courseName" disabled disabledColor="#ffffff"
placeholder="请选择课程" border="none"></u-input> placeholder="请选择课程" border="none"></u-input>
<u-icon slot="right" name="arrow-right"></u-icon> <u-icon slot="right" name="arrow-right"></u-icon>
</u-form-item> </u-form-item>
<u-form-item label="训练类型" prop="userInfo.sex" ref="item1"> <u-form-item label="训练类型" prop="courseType" ref="item1">
<u-input v-model="appointmentInfo.courseType" disabled disabledColor="#ffffff" <u-input v-model="appointmentInfo.courseType" disabled disabledColor="#ffffff"
placeholder="请选择训练类型" border="none"></u-input> placeholder="请选择训练类型" border="none"></u-input>
</u-form-item> </u-form-item>
<u-form-item label="选择科目" prop="userInfo.sex" ref="item1"> <u-form-item label="选择科目" prop="subject" ref="item1">
<u-input v-model="appointmentInfo.subjectStr" disabled disabledColor="#ffffff" <u-input v-model="appointmentInfo.subjectStr" disabled disabledColor="#ffffff"
placeholder="请选择科目" border="none"></u-input> placeholder="请选择科目" border="none"></u-input>
</u-form-item> </u-form-item>
<u-form-item label="教练名称" prop="userInfo.sex" ref="item1"> <u-form-item label="教练名称" prop="coachName" ref="item1">
<u-input v-model="appointmentInfo.coachName" disabled disabledColor="#ffffff" <u-input v-model="appointmentInfo.coachName" disabled disabledColor="#ffffff"
placeholder="请选择教练" border="none"></u-input> placeholder="请选择教练" border="none"></u-input>
</u-form-item> </u-form-item>
@ -33,17 +33,17 @@
<view class="form_"> <view class="form_">
<view class="" style="background-color: white;padding: 10rpx 15rpx;border-radius: 15rpx"> <view class="" style="background-color: white;padding: 10rpx 15rpx;border-radius: 15rpx">
<u-form labelPosition="left" labelWidth="auto" :model="appointmentInfo" :rules="rules" ref="uForm"> <u-form labelPosition="left" labelWidth="auto" :model="appointmentInfo" :rules="rules" ref="uForm">
<u-form-item label="累计训练时长" prop="userInfo.name" ref="item1"> <u-form-item label="累计训练时长" prop="name" ref="item1">
<u-input v-model="appointmentInfo.trainTime" disabled disabledColor="#ffffff" <u-input v-model="appointmentInfo.trainTime" disabled disabledColor="#ffffff"
border="none"></u-input> border="none"></u-input>
</u-form-item> </u-form-item>
<u-form-item label="日期选择" prop="userInfo.sex" @click="showDate = true;" <u-form-item label="日期选择" prop="dateStr" @click="showDate = true;"
ref="item1"> ref="item1">
<u-input v-model="appointmentInfo.dateStr" disabled disabledColor="#ffffff" <u-input v-model="appointmentInfo.dateStr" disabled disabledColor="#ffffff"
placeholder="请选择日期" border="none"></u-input> placeholder="请选择日期" border="none"></u-input>
<u-icon slot="right" name="arrow-right"></u-icon> <u-icon slot="right" name="arrow-right"></u-icon>
</u-form-item> </u-form-item>
<u-form-item label="时间范围" prop="userInfo.sex" borderBottom @click="showTime = true;" <u-form-item label="时间范围" prop="time" borderBottom @click="showTime = true;"
ref="item1" :borderBottom="false"> ref="item1" :borderBottom="false">
<u-input v-model="appointmentInfo.time" disabled disabledColor="#ffffff" <u-input v-model="appointmentInfo.time" disabled disabledColor="#ffffff"
placeholder="请选择时间范围" border="none"></u-input> placeholder="请选择时间范围" border="none"></u-input>
@ -65,26 +65,26 @@
</view> </view>
</template> </template>
<script> <script>
import headers from "@/components/header/headers.vue"; import headers from "@/components/header/headers.vue";
import request from "@/utils/request"; import request from "@/utils/request";
import {getDictDataByType} from "@/utils/utils"; import {getDictDataByType} from "@/utils/utils";
import {getLocalUserInfo} from "@/utils/auth";
export default { export default {
components: { components: {
headers headers
}, },
data() { data() {
return { return {
rules: {}, // rules
constants: {}, constants: {},
appointmentInfo: { appointmentInfo: {
subjectStr: '', subjectStr: '',
courseName: '', courseName: '',
coachName: '', coachName: '',
trainTime: '', trainTime: '',
dateStr:'', dateStr: '',
time: '', time: '',
coachId:'', coachId: '',
}, // }, //
showCourse: false, showCourse: false,
courseList: [], // courseList: [], //
@ -102,7 +102,34 @@
], ],
// //
timeColumns: '', timeColumns: '',
showSubject: false showSubject: false,
rules: {
time: [{
required: true,
message: '请选择时间',
trigger: 'change'
}],
courseName: [{
required: true,
message: '请选择课程',
trigger: 'change'
}],
dateStr: [{
required: true,
message: '请选择日期',
trigger: 'change'
}],
coachName: [{
required: true,
message: '请选择教练',
trigger: 'change'
}],
subject: [{
required: true,
message: '请选择科目',
trigger: 'change'
}],
}
}; };
}, },
async onLoad() { async onLoad() {
@ -110,6 +137,10 @@
this.timeColumns = await getDictDataByType('school_reserv_time'); this.timeColumns = await getDictDataByType('school_reserv_time');
console.log('字典', this.timeColumns) console.log('字典', this.timeColumns)
}, },
onReady() {
//setRules
this.$refs.uForm.setRules(this.rules)
},
methods: { methods: {
goback() { goback() {
uni.navigateBack() uni.navigateBack()
@ -157,7 +188,7 @@
title: '提示', title: '提示',
content: '请先报名课程', content: '请先报名课程',
showCancel: false, showCancel: false,
success: function(res) { success: function (res) {
if (res.confirm) { if (res.confirm) {
console.log('用户点击确定'); console.log('用户点击确定');
uni.navigateBack() uni.navigateBack()
@ -190,10 +221,8 @@
// 14 // 14
const subject = progress[0].subject const subject = progress[0].subject
this.$nextTick(() => { this.$nextTick(() => {
this.appointmentInfo.subject = subject this.appointmentInfo.subject = subject
this.appointmentInfo.subjectStr = this.subjectColumns.find(item => item.value == this.appointmentInfo.subjectStr = this.subjectColumns.find(item => item.value == subject).label
subject).label
}) })
this.appointmentInfo.coachName = progress[0].coachName this.appointmentInfo.coachName = progress[0].coachName
this.appointmentInfo.coachId = progress[0].coachId this.appointmentInfo.coachId = progress[0].coachId
@ -205,7 +234,7 @@
title: '提示', title: '提示',
content: '只能预约训练科目二和科目三', content: '只能预约训练科目二和科目三',
showCancel: false, showCancel: false,
success: function(res) { success: function (res) {
if (res.confirm) { if (res.confirm) {
console.log('用户点击确定'); console.log('用户点击确定');
uni.navigateBack() uni.navigateBack()
@ -230,17 +259,23 @@
console.log(res) console.log(res)
}) })
}, },
submit(){ submit() {
request({ //
url: '/app-api/drivingSchool/system/reservationCourse', this.$refs.uForm.validate().then(res => {
method: 'POST', const userInfo = getLocalUserInfo()
data: { const data = {
...this.appointmentInfo, ...this.appointmentInfo,
userId: userInfo.id,
userName: userInfo.nickname,
tenantId: this.tenantId, tenantId: this.tenantId,
reservDay: this.appointmentInfo.dateStr, reservDay: this.appointmentInfo.dateStr,
reservTime: this.appointmentInfo.time, reservTime: this.appointmentInfo.time,
subject: this.appointmentInfo.subject, subject: this.appointmentInfo.subject,
} }
request({
url: '/app-api/reservation-course/create',
method: 'PUT',
data: data
}).then(res => { }).then(res => {
console.log(res) console.log(res)
uni.showToast({ uni.showToast({
@ -253,27 +288,29 @@
uni.navigateBack() uni.navigateBack()
}, 2000) }, 2000)
}) })
}).catch(errors => {
})
}, },
} }
}; };
</script> </script>
<style lang='scss'> <style lang='scss'>
@import '../common/common.scss'; @import '../common/common.scss';
@import './assets/style/index.rpx.scss'; @import './assets/style/index.rpx.scss';
.bottom_ { .bottom_ {
position: fixed; position: fixed;
bottom: 0; bottom: 0;
} }
.header { .header {
width: 100%; width: 100%;
background: #f4f5f6; background: #f4f5f6;
box-sizing: border-box; box-sizing: border-box;
padding-top: 88px; padding-top: 88px;
} }
.form_ { .form_ {
padding: 10rpx 20rpx; padding: 10rpx 20rpx;
} }
</style> </style>

View File

@ -37,7 +37,7 @@
<view style="width: 90%; height: 1px; background-color: #e0e0e0; margin: 20px 10rpx auto;"></view> <view style="width: 90%; height: 1px; background-color: #e0e0e0; margin: 20px 10rpx auto;"></view>
<view class="text-wrapper_5 flex-row justify-between" v-if="!isTrain"> <view class="text-wrapper_5 flex-row justify-between" v-if="!isTrain">
<text class="text_12">累计训练时长</text> <text class="text_12">累计训练时长</text>
<text class="text_13">{{ appointmentInfo.allDriveTime }}分钟</text> <text class="text_13">{{ appointmentInfo.trainTime }}分钟</text>
</view> </view>
<view class="text-wrapper_6 flex-row justify-between" v-if="isTrain"> <view class="text-wrapper_6 flex-row justify-between" v-if="isTrain">
<text class="text_14">训练地址</text> <text class="text_14">训练地址</text>
@ -56,7 +56,7 @@
<view class="text-wrapper_9 flex-col" v-if="!isTrain"> <view class="text-wrapper_9 flex-col" v-if="!isTrain">
<text class="text_20">审核意见</text> <text class="text_20">审核意见</text>
<text class="text_21"> <text class="text_21">
{{ appointmentInfo.remark == null ? '暂无' : appointmentInfo.remark }} {{ appointmentInfo.refuseReason == null ? '暂无' : appointmentInfo.refuseReason }}
</text> </text>
</view> </view>
</view> </view>
@ -112,11 +112,11 @@ export default {
console.log("匹配的训练时间数据:", data); console.log("匹配的训练时间数据:", data);
this.appointmentInfo.allDriveTime = data ? data.trainTime || "0" : "0"; this.appointmentInfo.trainTime = data ? data.trainTime || "0" : "0";
console.log( console.log(
"this.appointmentInfo.allDriveTime", "this.appointmentInfo.trainTime",
this.appointmentInfo.allDriveTime this.appointmentInfo.trainTime
); );
} catch (error) { } catch (error) {
console.error("获取训练时间失败:", error); console.error("获取训练时间失败:", error);

View File

@ -6,7 +6,7 @@
</headers> </headers>
</view> </view>
<view class="group_4 flex-col"> <view class="group_4 flex-col">
<view class="list_1 flex-col"> <view class="list_1 flex-col" v-if="evaluate.length > 0">
<scroll-view style="height: 1400rpx;" scroll-y="true" class="itemContent" <scroll-view style="height: 1400rpx;" scroll-y="true" class="itemContent"
@scrolltolower="onReachBottomCus" refresher-enabled @refresherrefresh="onRefresherrefresh" @scrolltolower="onReachBottomCus" refresher-enabled @refresherrefresh="onRefresherrefresh"
:refresher-triggered="isTriggered"> :refresher-triggered="isTriggered">
@ -38,6 +38,12 @@
</view> </view>
</scroll-view> </scroll-view>
</view> </view>
<view class="empty-container" v-else>
<u-empty
mode="data"
text="评价为空"
/>
</view>
</view> </view>
</view> </view>
</template> </template>
@ -148,4 +154,10 @@
<style lang='scss'> <style lang='scss'>
@import '../common/common.scss'; @import '../common/common.scss';
@import './assets/style/index.rpx.scss'; @import './assets/style/index.rpx.scss';
.empty-container {
display: flex;
justify-content: center; /* 水平居中 */
align-items: center; /* 垂直居中 */
height: 100vh; /* 或者你需要撑满的高度 */
}
</style> </style>

View File

@ -22,14 +22,7 @@
</view> </view>
<view class="box_4 flex-row justify-between"> <view class="box_4 flex-row justify-between">
<view class="image-text_2 flex-row justify-between"> <view class="image-text_2 flex-row justify-between">
<image <u-notice-bar direction="column" duration="10000" bgColor="#e9f1ff" color="black" :text="announcement" icon="/static/lanhu_shouye2gai/FigmaDDSSlicePNGd2c17b5f24182e597acbfa50481040c1.png"></u-notice-bar>
class="label_2"
referrerpolicy="no-referrer"
src="/static/lanhu_shouye2gai/FigmaDDSSlicePNGd2c17b5f24182e597acbfa50481040c1.png"
/>
<text class="text-group_2">
高科技驾考作弊团伙被抓驾校校长教练负责介绍学员
</text>
</view> </view>
<view class="group_3 flex-col justify-between"> <view class="group_3 flex-col justify-between">
<view class="block_5 flex-col"></view> <view class="block_5 flex-col"></view>
@ -92,6 +85,7 @@ export default {
], ],
swiperList: [], swiperList: [],
msg: "1", msg: "1",
announcement:['ceshi1111','测试111111111111111111111111111111111111111111'],
constants: {}, constants: {},
schoolList: [ schoolList: [
// { // {