Merge remote-tracking branch 'origin/master'
This commit is contained in:
commit
494a3bcc83
@ -92,7 +92,6 @@
|
||||
.box_4 {
|
||||
background-color: rgba(255, 255, 255, 1);
|
||||
border-radius: 8px;
|
||||
height: 242rpx;
|
||||
width: 686rpx;
|
||||
margin: 16rpx 0 0 32rpx;
|
||||
.group_5 {
|
||||
|
@ -1,16 +1,18 @@
|
||||
<template>
|
||||
<view class="page flex-col">
|
||||
<view class="header">
|
||||
<view style="width: 100%;background: #f4f5f6;box-sizing: border-box;padding-top: 88px;">
|
||||
<headers titles="预约训练">
|
||||
<uni-icons @click="goback()" type="arrow-left" color="#000000"
|
||||
size="22px"></uni-icons>
|
||||
<uni-icons type="left" color="#000000" size="22px"></uni-icons>
|
||||
</headers>
|
||||
</view>
|
||||
<scroll-view style="height: 100%;" scroll-y="true" class="itemContent" @scrolltolower="onReachBottomCus"
|
||||
<view style="padding: 10rpx 30rpx">
|
||||
<u-subsection :list="list" :current="curNow" @change="sectionChange"></u-subsection>
|
||||
</view>
|
||||
<scroll-view style="height: 1200rpx;" scroll-y="true" class="itemContent" @scrolltolower="onReachBottomCus"
|
||||
refresher-enabled @refresherrefresh="onRefresherrefresh" :refresher-triggered="isTriggered">
|
||||
<!-- 新增内容容器 -->
|
||||
<view class="box_2 flex-col">
|
||||
<view class="box_4 flex-col" v-for="item in appointmentList">
|
||||
<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="group_5 flex-row justify-between">
|
||||
<view class="block_3 flex-col justify-between">
|
||||
<text class="text_2">{{ item.reservDay }}</text>
|
||||
@ -19,11 +21,11 @@
|
||||
<text class="text_3">{{ item.subjectStr }}</text>
|
||||
</view>
|
||||
<view class="text-wrapper_2 flex-col">
|
||||
<text class="text_4">{{ item.coach }}</text>
|
||||
<text class="text_4">{{ item.courseType }}</text>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="text-wrapper_3 flex-col">
|
||||
<view :class="item.status === true ? 'ytg' : 'text-wrapper_3'" class=" flex-col">
|
||||
<text class="text_5">{{ item.statusStr }}</text>
|
||||
</view>
|
||||
</view>
|
||||
@ -37,12 +39,51 @@
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="box_6 flex-col bottom_">
|
||||
<view class="text-wrapper_12 flex-col " @click="goAppointment()">
|
||||
<text class="text_19">预约</text>
|
||||
<!-- 新增内容容器 -->
|
||||
<view class="box_2 flex-col" v-if="curNow === 1">
|
||||
<view class="box_4 flex-col" v-for="item in appointmentList" @click="goDetail(item,'train')" :key="item.id">
|
||||
<view class="group_5 flex-row justify-between">
|
||||
<view class="block_3 flex-col justify-between">
|
||||
<text class="text_2">{{ item.trainDay }}</text>
|
||||
<view class="group_6 flex-row justify-between">
|
||||
<view class="text-wrapper_1 flex-col">
|
||||
<text class="text_3">{{ subjectArr[item.subject - 1] }}</text>
|
||||
</view>
|
||||
<view class="text-wrapper_2 flex-col">
|
||||
<text class="text_4">{{ item.courseType }}</text>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="text-wrapper_4 flex-row justify-between">
|
||||
<text class="text_6">交通方式:</text>
|
||||
<text class="text_7">{{ item.transWay }}</text>
|
||||
</view>
|
||||
<view class="text-wrapper_4 flex-row justify-between">
|
||||
<text class="text_6">训练地址:</text>
|
||||
<text class="text_7">{{ item.addr }}</text>
|
||||
</view>
|
||||
<view class="text-wrapper_4 flex-row justify-between">
|
||||
<text class="text_6">训练时长:</text>
|
||||
<text class="text_7">{{ item.trainTime }}分钟</text>
|
||||
</view>
|
||||
<view class="text-wrapper_5 flex-row justify-between">
|
||||
<text class="text_8">教练名称:</text>
|
||||
<text class="text_9">{{ item.coachName }}</text>
|
||||
</view>
|
||||
<view class="block_5 box_10 flex-row" style="justify-content: flex-end; margin: 0 20rpx 15rpx 0;" v-if="!item.ifEvaluate" @click="goEvaluateAdd(item)">
|
||||
<view style="border: 1px solid rgba(44, 120, 245, 1); padding: 7rpx 30rpx; border-radius: 50rpx;color: rgba(44, 120, 245, 1)">
|
||||
<text class="text_18">开始评价</text>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</scroll-view>
|
||||
<view class="box_6 flex-col bottom_">
|
||||
<view class="text-wrapper_12 flex-col " @click="goAppointment()">
|
||||
<text class="text_19">预约</text>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
<script>
|
||||
@ -50,7 +91,9 @@ import headers from "@/components/header/headers.vue";
|
||||
import request from "@/utils/request";
|
||||
|
||||
export default {
|
||||
components: {headers},
|
||||
components: {
|
||||
headers
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
isTriggered: false,
|
||||
@ -58,33 +101,86 @@ export default {
|
||||
pageSize: 10,
|
||||
total: 0,
|
||||
appointmentList: [],
|
||||
constants: {}
|
||||
constants: {},
|
||||
list: ['预约记录', '训练记录'],
|
||||
curNow: 0,
|
||||
subjectArr:['科目一','科目二','科目三','科目四']
|
||||
};
|
||||
},
|
||||
onLoad() {
|
||||
this.getList()
|
||||
uni.$on('refresh', (data) => {
|
||||
this.pageNo = 1
|
||||
this.appointmentList = []
|
||||
if (this.curNow === 0) {
|
||||
this.getList()
|
||||
} else {
|
||||
this.getTrainList()
|
||||
}
|
||||
})
|
||||
},
|
||||
methods: {
|
||||
goback() {
|
||||
uni.navigateBack()
|
||||
},
|
||||
getList(){
|
||||
sectionChange(index) {
|
||||
this.curNow = index;
|
||||
this.pageNo = 1
|
||||
this.appointmentList = []
|
||||
if (this.curNow === 0) {
|
||||
this.getList()
|
||||
} else {
|
||||
this.getTrainList()
|
||||
}
|
||||
},
|
||||
getList() {
|
||||
request({
|
||||
url: '/app-api/drivingSchool/system/reservationCourse/list',
|
||||
method: 'GET',
|
||||
params: {
|
||||
pageNum: this.pageNo,
|
||||
pageSize: this.pageSize,
|
||||
ifCancel: false
|
||||
},
|
||||
tenantIdFlag: false
|
||||
}).then(res => {
|
||||
console.log('获取预约列表',res)
|
||||
console.log('获取预约列表', res)
|
||||
if (this.pageNo === 1) {
|
||||
this.total = res.data.total
|
||||
this.appointmentList = []
|
||||
this.appointmentList = res.data.records
|
||||
} else {
|
||||
this.appointmentList = this.appointmentList.concat(res.data.records)
|
||||
}
|
||||
this.appointmentList = this.appointmentList.concat(res.data.records)
|
||||
this.isTriggered = false
|
||||
})
|
||||
},
|
||||
getTrainList() {
|
||||
request({
|
||||
url: '/app-api/train/page',
|
||||
method: 'GET',
|
||||
params: {
|
||||
pageNum: this.pageNo,
|
||||
pageSize: this.pageSize,
|
||||
selectType: 'all'
|
||||
},
|
||||
tenantIdFlag: false
|
||||
}).then(res => {
|
||||
console.log('获取预约列表', res)
|
||||
if (this.pageNo === 1) {
|
||||
this.total = res.data.total
|
||||
this.appointmentList = []
|
||||
this.appointmentList = res.data.records
|
||||
} else {
|
||||
this.appointmentList = this.appointmentList.concat(res.data.records)
|
||||
}
|
||||
this.isTriggered = false
|
||||
})
|
||||
},
|
||||
goDetail(data,str) {
|
||||
//将data转为字符串
|
||||
uni.navigateTo({
|
||||
url: `/newPages/appointmentDetail/index?data=${JSON.stringify(data)}&type=${str}`
|
||||
})
|
||||
},
|
||||
/**
|
||||
@ -99,7 +195,11 @@ export default {
|
||||
//页码+1,调用获取数据的方法获取第二页数据
|
||||
this.pageNo++
|
||||
//此处调用自己获取数据列表的方法
|
||||
this.getList()
|
||||
if (this.curNow === 1) {
|
||||
this.getTrainList()
|
||||
} else {
|
||||
this.getList()
|
||||
}
|
||||
},
|
||||
/**
|
||||
* 下拉刷新数据
|
||||
@ -109,13 +209,23 @@ export default {
|
||||
this.pageNo = 1
|
||||
this.total = 0
|
||||
this.appointmentList = []
|
||||
this.getList()
|
||||
if (this.curNow === 1) {
|
||||
this.getTrainList()
|
||||
} else {
|
||||
this.getList()
|
||||
}
|
||||
},
|
||||
goAppointment() {
|
||||
uni.navigateTo({
|
||||
url: '/newPages/appointmentAdd/index'
|
||||
})
|
||||
}
|
||||
},
|
||||
goEvaluateAdd(data) {
|
||||
data = JSON.stringify(data)
|
||||
uni.navigateTo({
|
||||
url: `/newPages/evaluateAdd/index?data=${data}&type=xunlian&controls=add`
|
||||
})
|
||||
},
|
||||
}
|
||||
};
|
||||
</script>
|
||||
@ -125,10 +235,12 @@ export default {
|
||||
|
||||
// 新增样式
|
||||
.content-box {
|
||||
margin-top: 88rpx; /* 根据头部高度调整 */
|
||||
margin-top: 88rpx;
|
||||
/* 根据头部高度调整 */
|
||||
padding: 20rpx;
|
||||
overflow-y: auto;
|
||||
height: calc(100vh - 88rpx); /* 确保内容区域高度正确 */
|
||||
height: calc(100vh - 88rpx);
|
||||
/* 确保内容区域高度正确 */
|
||||
}
|
||||
|
||||
.header {
|
||||
@ -137,8 +249,31 @@ export default {
|
||||
box-sizing: border-box;
|
||||
padding-top: 88px;
|
||||
}
|
||||
.bottom_{
|
||||
|
||||
.bottom_ {
|
||||
position: fixed;
|
||||
bottom: 0;
|
||||
}
|
||||
|
||||
.ytg {
|
||||
background-color: #cfe2ff;
|
||||
border-radius: 4px;
|
||||
height: 40rpx;
|
||||
margin-top: 22rpx;
|
||||
width: 96rpx;
|
||||
|
||||
.text_5 {
|
||||
width: 72rpx;
|
||||
height: 24rpx;
|
||||
overflow-wrap: break-word;
|
||||
color: rgba(4, 78, 242, 1);
|
||||
font-size: 24rpx;
|
||||
font-family: PingFang SC-Regular;
|
||||
font-weight: NaN;
|
||||
text-align: left;
|
||||
white-space: nowrap;
|
||||
line-height: 24rpx;
|
||||
margin: 8rpx 0 0 12rpx;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
|
@ -1,213 +1,279 @@
|
||||
<template>
|
||||
<view class="page flex-col">
|
||||
<view class="header">
|
||||
<headers titles="预约训练">
|
||||
<uni-icons @click="goback()" type="arrow-left" color="#000000"
|
||||
size="22px"></uni-icons>
|
||||
</headers>
|
||||
</view>
|
||||
<view class="form_" >
|
||||
<view class="" style="background-color: white;padding: 10rpx 15rpx;border-radius: 15rpx">
|
||||
<u-form
|
||||
labelPosition="left"
|
||||
labelWidth="auto"
|
||||
labelAlign="center"
|
||||
:model="appointmentInfo"
|
||||
:rules="rules"
|
||||
ref="uForm"
|
||||
>
|
||||
<u-form-item
|
||||
label="课程名称"
|
||||
prop="userInfo.name"
|
||||
borderBottom
|
||||
ref="item1"
|
||||
>
|
||||
<u-input
|
||||
v-model="appointmentInfo.userInfo.name"
|
||||
border="none"
|
||||
></u-input>
|
||||
</u-form-item>
|
||||
<u-form-item
|
||||
label="训练类型"
|
||||
prop="userInfo.sex"
|
||||
borderBottom
|
||||
@click="showSex = true; hideKeyboard()"
|
||||
ref="item1"
|
||||
>
|
||||
<u-input
|
||||
v-model="appointmentInfo.userInfo.sex"
|
||||
disabled
|
||||
disabledColor="#ffffff"
|
||||
placeholder="请选择性别"
|
||||
border="none"
|
||||
></u-input>
|
||||
<u-icon
|
||||
slot="right"
|
||||
name="arrow-right"
|
||||
></u-icon>
|
||||
</u-form-item>
|
||||
<u-form-item
|
||||
label="选择科目"
|
||||
prop="userInfo.sex"
|
||||
borderBottom
|
||||
@click="showSex = true; hideKeyboard()"
|
||||
ref="item1"
|
||||
>
|
||||
<u-input
|
||||
v-model="appointmentInfo.userInfo.sex"
|
||||
disabled
|
||||
disabledColor="#ffffff"
|
||||
placeholder="请选择性别"
|
||||
border="none"
|
||||
></u-input>
|
||||
<u-icon
|
||||
slot="right"
|
||||
name="arrow-right"
|
||||
></u-icon>
|
||||
</u-form-item>
|
||||
<u-form-item
|
||||
label="教练名称"
|
||||
prop="userInfo.sex"
|
||||
borderBottom
|
||||
@click="showSex = true; hideKeyboard()"
|
||||
ref="item1"
|
||||
>
|
||||
<u-input
|
||||
v-model="appointmentInfo.userInfo.sex"
|
||||
disabled
|
||||
disabledColor="#ffffff"
|
||||
placeholder="请选择性别"
|
||||
border="none"
|
||||
></u-input>
|
||||
<u-icon
|
||||
slot="right"
|
||||
name="arrow-right"
|
||||
></u-icon>
|
||||
</u-form-item>
|
||||
</u-form>
|
||||
<view class="page flex-col">
|
||||
<view class="header">
|
||||
<headers titles="预约">
|
||||
<uni-icons type="left" color="#000000" size="22px"></uni-icons>
|
||||
</headers>
|
||||
</view>
|
||||
<view class="form_">
|
||||
<view class="" style="background-color: white;padding: 10rpx 15rpx;border-radius: 15rpx">
|
||||
<u-form labelPosition="left" labelWidth="auto" labelAlign="center" :model="appointmentInfo"
|
||||
:rules="rules" ref="uForm">
|
||||
<u-form-item label="课程名称" prop="userInfo.name" @click="showCourse = true" ref="item1">
|
||||
<u-input v-model="appointmentInfo.courseName" disabled disabledColor="#ffffff"
|
||||
placeholder="请选择课程" border="none"></u-input>
|
||||
<u-icon slot="right" name="arrow-right"></u-icon>
|
||||
</u-form-item>
|
||||
<u-form-item label="训练类型" prop="userInfo.sex" ref="item1">
|
||||
<u-input v-model="appointmentInfo.courseType" disabled disabledColor="#ffffff"
|
||||
placeholder="请选择训练类型" border="none"></u-input>
|
||||
</u-form-item>
|
||||
<u-form-item label="选择科目" prop="userInfo.sex" ref="item1">
|
||||
<u-input v-model="appointmentInfo.subjectStr" disabled disabledColor="#ffffff"
|
||||
placeholder="请选择科目" border="none"></u-input>
|
||||
</u-form-item>
|
||||
<u-form-item label="教练名称" prop="userInfo.sex" ref="item1">
|
||||
<u-input v-model="appointmentInfo.coachName" disabled disabledColor="#ffffff"
|
||||
placeholder="请选择教练" border="none"></u-input>
|
||||
</u-form-item>
|
||||
</u-form>
|
||||
|
||||
</view>
|
||||
</view><view class="form_" >
|
||||
<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-item
|
||||
label="累计训练时长"
|
||||
prop="userInfo.name"
|
||||
borderBottom
|
||||
ref="item1"
|
||||
>
|
||||
<u-input
|
||||
v-model="appointmentInfo.userInfo.name"
|
||||
border="none"
|
||||
></u-input>
|
||||
</u-form-item>
|
||||
<u-form-item
|
||||
label="训练地址"
|
||||
prop="userInfo.sex"
|
||||
borderBottom
|
||||
@click="showSex = true; hideKeyboard()"
|
||||
ref="item1"
|
||||
>
|
||||
<u-input
|
||||
v-model="appointmentInfo.userInfo.sex"
|
||||
disabled
|
||||
disabledColor="#ffffff"
|
||||
placeholder="请选择性别"
|
||||
border="none"
|
||||
></u-input>
|
||||
<u-icon
|
||||
slot="right"
|
||||
name="arrow-right"
|
||||
></u-icon>
|
||||
</u-form-item>
|
||||
<u-form-item
|
||||
label="交通方式"
|
||||
prop="userInfo.sex"
|
||||
borderBottom
|
||||
@click="showSex = true; hideKeyboard()"
|
||||
ref="item1"
|
||||
>
|
||||
<u-input
|
||||
v-model="appointmentInfo.userInfo.sex"
|
||||
disabled
|
||||
disabledColor="#ffffff"
|
||||
placeholder="请选择性别"
|
||||
border="none"
|
||||
></u-input>
|
||||
<u-icon
|
||||
slot="right"
|
||||
name="arrow-right"
|
||||
></u-icon>
|
||||
</u-form-item>
|
||||
<u-form-item
|
||||
label="时间范围"
|
||||
prop="userInfo.sex"
|
||||
borderBottom
|
||||
@click="showSex = true; hideKeyboard()"
|
||||
ref="item1"
|
||||
>
|
||||
<u-input
|
||||
v-model="appointmentInfo.userInfo.sex"
|
||||
disabled
|
||||
disabledColor="#ffffff"
|
||||
placeholder="请选择性别"
|
||||
border="none"
|
||||
></u-input>
|
||||
<u-icon
|
||||
slot="right"
|
||||
name="arrow-right"
|
||||
></u-icon>
|
||||
</u-form-item>
|
||||
</u-form>
|
||||
|
||||
</view>
|
||||
</view>
|
||||
<view class="section_4 flex-col bottom_">
|
||||
<view class="text-wrapper_5 flex-col">
|
||||
<text class="text_10">开始预约</text>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="form_">
|
||||
<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-item label="累计训练时长" prop="userInfo.name" ref="item1">
|
||||
<u-input v-model="appointmentInfo.trainTime" disabled disabledColor="#ffffff"
|
||||
border="none"></u-input>
|
||||
</u-form-item>
|
||||
<u-form-item label="日期选择" prop="userInfo.sex" @click="showDate = true;"
|
||||
ref="item1">
|
||||
<u-input v-model="appointmentInfo.dateStr" disabled disabledColor="#ffffff"
|
||||
placeholder="请选择日期" border="none"></u-input>
|
||||
<u-icon slot="right" name="arrow-right"></u-icon>
|
||||
</u-form-item>
|
||||
<u-form-item label="时间范围" prop="userInfo.sex" borderBottom @click="showTime = true;"
|
||||
ref="item1" :borderBottom="false">
|
||||
<u-input v-model="appointmentInfo.time" disabled disabledColor="#ffffff"
|
||||
placeholder="请选择时间范围" border="none"></u-input>
|
||||
<u-icon slot="right" name="arrow-right"></u-icon>
|
||||
</u-form-item>
|
||||
</u-form>
|
||||
</view>
|
||||
</view>
|
||||
<u-picker :show="showCourse" @close="showCourse = false" keyName="courseName" @cancel="showCourse = false"
|
||||
@confirm="confirmCourse" :columns="[courseList]"></u-picker>
|
||||
<u-picker :show="showTime" @close="showTime = false" keyName="label" @cancel="showTime = false"
|
||||
@confirm="confirmTime" :columns="[timeColumns]"></u-picker>
|
||||
<u-calendar :show="showDate" @confirm="confirmDate" @close="showDate = false"></u-calendar>
|
||||
<view class="section_4 flex-col bottom_">
|
||||
<view class="text-wrapper_5 flex-col" @click="submit">
|
||||
<text class="text_10">开始预约</text>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
<script>
|
||||
import headers from "@/components/header/headers.vue";
|
||||
import headers from "@/components/header/headers.vue";
|
||||
import request from "@/utils/request";
|
||||
import {getDictDataByType} from "@/utils/utils";
|
||||
|
||||
export default {
|
||||
components: {headers},
|
||||
data() {
|
||||
return {
|
||||
rules: {}, // 确保 rules 至少是一个空对象
|
||||
constants: {},
|
||||
appointmentInfo: {}, // 预约信息
|
||||
};
|
||||
},
|
||||
methods: {
|
||||
goback() {
|
||||
uni.navigateBack()
|
||||
export default {
|
||||
components: {
|
||||
headers
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
rules: {}, // 确保 rules 至少是一个空对象
|
||||
constants: {},
|
||||
appointmentInfo: {
|
||||
subjectStr: '',
|
||||
courseName: '',
|
||||
coachName: '',
|
||||
trainTime: '',
|
||||
dateStr:'',
|
||||
time: '',
|
||||
coachId:'',
|
||||
}, // 预约信息
|
||||
showCourse: false,
|
||||
courseList: [], //报名的课程信息
|
||||
showDate: false,
|
||||
showTime: false,
|
||||
tenantId: '',
|
||||
subjectColumns: [{
|
||||
label: '科目二',
|
||||
value: 2
|
||||
},
|
||||
{
|
||||
label: '科目三',
|
||||
value: 3
|
||||
},
|
||||
],
|
||||
//时间段数组 查询字典
|
||||
timeColumns: '',
|
||||
showSubject: false
|
||||
};
|
||||
},
|
||||
async onLoad() {
|
||||
this.getLoginUserCourseInfoList()
|
||||
this.timeColumns = await getDictDataByType('school_reserv_time');
|
||||
console.log('字典', this.timeColumns)
|
||||
},
|
||||
}
|
||||
};
|
||||
methods: {
|
||||
goback() {
|
||||
uni.navigateBack()
|
||||
},
|
||||
confirmCourse(e) {
|
||||
this.restForm()
|
||||
this.appointmentInfo.courseId = e.value[0].courseId
|
||||
this.appointmentInfo.courseName = e.value[0].courseName
|
||||
this.appointmentInfo.courseType = e.value[0].courseType
|
||||
this.tenantId = e.value[0].tenantId
|
||||
this.appointmentInfo.userName = e.value[0].userName
|
||||
this.appointmentInfo.userId = e.value[0].userId
|
||||
this.getAllByCourseId(e.value[0].courseId)
|
||||
console.log(e)
|
||||
this.showCourse = false
|
||||
},
|
||||
confirmDate(e) {
|
||||
console.log(e)
|
||||
this.appointmentInfo.dateStr = e[0]
|
||||
console.log(this.appointmentInfo)
|
||||
this.showDate = false
|
||||
},
|
||||
confirmTime(e) {
|
||||
console.log(e)
|
||||
this.appointmentInfo.time = e.value[0].label
|
||||
console.log(this.appointmentInfo)
|
||||
this.showTime = false
|
||||
},
|
||||
restForm() {
|
||||
this.appointmentInfo = {
|
||||
subjectStr: '',
|
||||
courseName: '',
|
||||
coachName: '',
|
||||
trainTime: '',
|
||||
}
|
||||
},
|
||||
// 查询所有报名科目
|
||||
getLoginUserCourseInfoList() {
|
||||
request({
|
||||
url: '/app-api/small/drive/school-course-order/getCourseByLoginUser',
|
||||
method: 'GET'
|
||||
}).then(res => {
|
||||
if (res.data.length == 0) {
|
||||
uni.showModal({
|
||||
title: '提示',
|
||||
content: '请先报名课程',
|
||||
showCancel: false,
|
||||
success: function(res) {
|
||||
if (res.confirm) {
|
||||
console.log('用户点击确定');
|
||||
uni.navigateBack()
|
||||
} else if (res.cancel) {
|
||||
console.log('用户点击取消');
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
this.courseList = res.data
|
||||
})
|
||||
},
|
||||
//根据课程id查询报名进度
|
||||
async getAllByCourseId(courseId) {
|
||||
console.log('courseId', courseId)
|
||||
const res = await request({
|
||||
url: '/app-api/process/getAllByCourseId',
|
||||
method: 'GET',
|
||||
params: {
|
||||
courseId: courseId
|
||||
}
|
||||
})
|
||||
// 找出正在训练中的科目并且科目不是1和4
|
||||
// && item.subject != 1 && item.subject != 4
|
||||
const progress = res.data.filter(item => {
|
||||
return item.status == 1 && item.subject != 1 && item.subject != 4
|
||||
})
|
||||
if (progress.length > 0) {
|
||||
console.log('正在训练中的科目', progress)
|
||||
// 找出正在训练中的科目并且科目不是1和4
|
||||
const subject = progress[0].subject
|
||||
this.$nextTick(() => {
|
||||
|
||||
this.appointmentInfo.subject = subject
|
||||
this.appointmentInfo.subjectStr = this.subjectColumns.find(item => item.value ==
|
||||
subject).label
|
||||
})
|
||||
this.appointmentInfo.coachName = progress[0].coachName
|
||||
this.appointmentInfo.coachId = progress[0].coachId
|
||||
this.appointmentInfo.trainTime = progress[0].trainTime
|
||||
console.log('subject', this.appointmentInfo)
|
||||
} else {
|
||||
// 弹窗只能预约训练科目二
|
||||
uni.showModal({
|
||||
title: '提示',
|
||||
content: '只能预约训练科目二和科目三',
|
||||
showCancel: false,
|
||||
success: function(res) {
|
||||
if (res.confirm) {
|
||||
console.log('用户点击确定');
|
||||
uni.navigateBack()
|
||||
} else if (res.cancel) {
|
||||
console.log('用户点击取消');
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
},
|
||||
// 查询训练地址
|
||||
getTrainAddress() {
|
||||
request({
|
||||
url: '/app-api/small/address/getList',
|
||||
method: 'GET',
|
||||
params: {
|
||||
type: 0,
|
||||
subject: this.appointmentInfo.subject,
|
||||
tenantId: this.tenantId
|
||||
}
|
||||
}).then(res => {
|
||||
console.log(res)
|
||||
})
|
||||
},
|
||||
submit(){
|
||||
request({
|
||||
url: '/app-api/drivingSchool/system/reservationCourse',
|
||||
method: 'POST',
|
||||
data: {
|
||||
...this.appointmentInfo,
|
||||
tenantId: this.tenantId,
|
||||
reservDay: this.appointmentInfo.dateStr,
|
||||
reservTime: this.appointmentInfo.time,
|
||||
subject: this.appointmentInfo.subject,
|
||||
}
|
||||
}).then(res => {
|
||||
console.log(res)
|
||||
uni.showToast({
|
||||
title: '预约成功',
|
||||
icon: 'none',
|
||||
duration: 2000
|
||||
})
|
||||
setTimeout(() => {
|
||||
uni.$emit('refresh');
|
||||
uni.navigateBack()
|
||||
}, 2000)
|
||||
})
|
||||
},
|
||||
}
|
||||
};
|
||||
</script>
|
||||
<style lang='scss'>
|
||||
@import '../common/common.scss';
|
||||
@import './assets/style/index.rpx.scss';
|
||||
.bottom_{
|
||||
position: fixed;
|
||||
bottom: 0;
|
||||
}
|
||||
.header {
|
||||
width: 100%;
|
||||
background: #f4f5f6;
|
||||
box-sizing: border-box;
|
||||
padding-top: 88px;
|
||||
}
|
||||
.form_ {
|
||||
padding: 10rpx 20rpx;
|
||||
}
|
||||
@import '../common/common.scss';
|
||||
@import './assets/style/index.rpx.scss';
|
||||
|
||||
.bottom_ {
|
||||
position: fixed;
|
||||
bottom: 0;
|
||||
}
|
||||
|
||||
.header {
|
||||
width: 100%;
|
||||
background: #f4f5f6;
|
||||
box-sizing: border-box;
|
||||
padding-top: 88px;
|
||||
}
|
||||
|
||||
.form_ {
|
||||
padding: 10rpx 20rpx;
|
||||
}
|
||||
</style>
|
||||
|
@ -91,7 +91,6 @@
|
||||
background-color: rgba(255, 255, 255, 1);
|
||||
border-radius: 8px;
|
||||
width: 686rpx;
|
||||
height: 834rpx;
|
||||
margin: 20rpx 0 0 32rpx;
|
||||
.section_4 {
|
||||
background-image: linear-gradient(
|
||||
@ -256,8 +255,7 @@
|
||||
}
|
||||
.text-wrapper_5 {
|
||||
width: 646rpx;
|
||||
height: 28rpx;
|
||||
margin: 100rpx 0 0 20rpx;
|
||||
margin: 20rpx 0 0 20rpx;
|
||||
.text_12 {
|
||||
width: 168rpx;
|
||||
height: 28rpx;
|
||||
@ -271,7 +269,6 @@
|
||||
line-height: 28rpx;
|
||||
}
|
||||
.text_13 {
|
||||
width: 56rpx;
|
||||
height: 28rpx;
|
||||
overflow-wrap: break-word;
|
||||
color: rgba(51, 51, 51, 1);
|
||||
|
@ -1,99 +1,173 @@
|
||||
<template>
|
||||
<view class="page flex-col">
|
||||
<view class="section_1 flex-row">
|
||||
<image
|
||||
class="image_1"
|
||||
referrerpolicy="no-referrer"
|
||||
src="/static/lanhu_yuyuexiangqing/FigmaDDSSlicePNG5472ef46deab947fe098747eb1b07bd2.png"
|
||||
/>
|
||||
<view class="group_1 flex-col"></view>
|
||||
<view class="group_2 flex-col"></view>
|
||||
<image
|
||||
class="image_2"
|
||||
referrerpolicy="no-referrer"
|
||||
src="/static/lanhu_yuyuexiangqing/FigmaDDSSlicePNGb239db97c719ec7467ee7c9615d3d24a.png"
|
||||
/>
|
||||
</view>
|
||||
<view class="section_2 flex-row">
|
||||
<image
|
||||
class="label_1"
|
||||
referrerpolicy="no-referrer"
|
||||
src="/static/lanhu_yuyuexiangqing/FigmaDDSSlicePNGacf527a62cbe7351c6472edd8f5b2814.png"
|
||||
/>
|
||||
<text class="text_1">预约</text>
|
||||
<view class="box_1 flex-col">
|
||||
<view class="image-wrapper_1 flex-row">
|
||||
<image
|
||||
class="thumbnail_1"
|
||||
referrerpolicy="no-referrer"
|
||||
src="/static/lanhu_yuyuexiangqing/FigmaDDSSlicePNGdc9929c2b5fd86c1689cc5990a0b4397.png"
|
||||
/>
|
||||
</view>
|
||||
<view class="box_2 flex-row justify-between">
|
||||
<view class="box_3 flex-col"></view>
|
||||
<view class="box_4 flex-col"></view>
|
||||
</view>
|
||||
</view>
|
||||
<view style="width: 100%;background: #f4f5f6;box-sizing: border-box;padding-top: 88px;">
|
||||
<headers titles="预约">
|
||||
<uni-icons type="left" color="#000000" size="22px"></uni-icons>
|
||||
</headers>
|
||||
</view>
|
||||
<view class="section_3 flex-col">
|
||||
<view class="section_4 flex-row">
|
||||
<view class="text-group_1 flex-col justify-between">
|
||||
<text class="text_2">已审核</text>
|
||||
<text class="text_3">2025-02-20 12:00</text>
|
||||
<view :class="appointmentInfo.status === false ? 'jj' : 'section_4'" class="flex-row">
|
||||
<view class="text-group_1 flex-col justify-between" v-if="isTrain">
|
||||
<text class="text_2">已训练</text>
|
||||
<text class="text_3">{{ appointmentInfo.trainDay }}</text>
|
||||
</view>
|
||||
<view class="text-group_1 flex-col justify-between" v-else>
|
||||
<text class="text_2">{{ appointmentInfo.statusStr }}</text>
|
||||
<text class="text_3">{{ appointmentInfo.reservDay }}</text>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<view class="text-wrapper_1 flex-row justify-between">
|
||||
<text class="text_4">课程名称</text>
|
||||
<text class="text_5">AI智能+人工教学</text>
|
||||
<text class="text_5">{{ appointmentInfo.courseName }}</text>
|
||||
</view>
|
||||
<view class="text-wrapper_2 flex-row justify-between">
|
||||
<text class="text_6">训练类型</text>
|
||||
<text class="text_7">C1</text>
|
||||
<text class="text_7">{{ appointmentInfo.courseType }}</text>
|
||||
</view>
|
||||
<view class="text-wrapper_3 flex-row justify-between">
|
||||
<text class="text_8">训练科目</text>
|
||||
<text class="text_9">科目二</text>
|
||||
<text class="text_9">{{ subjectArr[appointmentInfo.subject - 1] }}</text>
|
||||
</view>
|
||||
<view class="text-wrapper_4 flex-row justify-between">
|
||||
<text class="text_10">教练名称</text>
|
||||
<text class="text_11">马文峰</text>
|
||||
<text class="text_11">{{ appointmentInfo.coachName }}</text>
|
||||
</view>
|
||||
<view class="text-wrapper_5 flex-row justify-between">
|
||||
<!-- 添加一条宽度占 80% 的线 -->
|
||||
<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">
|
||||
<text class="text_12">累计训练时长</text>
|
||||
<text class="text_13">13天</text>
|
||||
<text class="text_13">{{ appointmentInfo.allDriveTime }}分钟</text>
|
||||
</view>
|
||||
<view class="text-wrapper_6 flex-row justify-between">
|
||||
<view class="text-wrapper_6 flex-row justify-between" v-if="isTrain">
|
||||
<text class="text_14">训练地址</text>
|
||||
<text class="text_15">山东省济南市历下区 历东上午大厦</text>
|
||||
<text class="text_15">{{ appointmentInfo.addr }}</text>
|
||||
</view>
|
||||
<view class="text-wrapper_7 flex-row justify-between">
|
||||
<view class="text-wrapper_7 flex-row justify-between" :class="isTrain ? 'text-wrapper_8' : 'text-wrapper_7'"
|
||||
v-if="isTrain">
|
||||
<text class="text_16">交通方式</text>
|
||||
<text class="text_17">公交车</text>
|
||||
<text class="text_17">{{ appointmentInfo.reservationWay }}</text>
|
||||
</view>
|
||||
<view class="text-wrapper_8 flex-row justify-between">
|
||||
<view class="text-wrapper_8 flex-row justify-between" v-else>
|
||||
<text class="text_18">时间范围</text>
|
||||
<text class="text_19">09:00-10:00</text>
|
||||
<text class="text_19">{{ appointmentInfo.reservTime }}</text>
|
||||
</view>
|
||||
</view>
|
||||
<view class="text-wrapper_9 flex-col">
|
||||
<view class="text-wrapper_9 flex-col" v-if="!isTrain">
|
||||
<text class="text_20">审核意见</text>
|
||||
<text class="text_21">
|
||||
审核意见审核意见审核意见审核意见审核意见审核意见审核意见审核意见审核意见
|
||||
{{ appointmentInfo.remark == null ? '暂无' : appointmentInfo.remark }}
|
||||
</text>
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
<script>
|
||||
import headers from "@/components/header/headers.vue";
|
||||
import request from "@/utils/request";
|
||||
|
||||
export default {
|
||||
components: {headers},
|
||||
data() {
|
||||
return {
|
||||
constants: {}
|
||||
constants: {},
|
||||
appointmentInfo: {},
|
||||
isTrain: false,
|
||||
subjectArr: ['科目一', '科目二', '科目三', '科目四'],
|
||||
};
|
||||
},
|
||||
methods: {}
|
||||
onLoad(options) {
|
||||
this.appointmentInfo = JSON.parse(options.data)
|
||||
this.getAllTrainTime()
|
||||
console.log(this.appointmentInfo)
|
||||
if (options.type === 'train') {
|
||||
this.isTrain = true
|
||||
} else {
|
||||
this.isTrain = false
|
||||
}
|
||||
console.log(this.isTrain)
|
||||
},
|
||||
methods: {
|
||||
async getAllTrainTime() {
|
||||
try {
|
||||
const res = await request({
|
||||
url: "/app-api/process/getAllByCourseId",
|
||||
method: "GET",
|
||||
params: {
|
||||
courseId: this.appointmentInfo.courseId,
|
||||
},
|
||||
tenantIdFlag: false,
|
||||
});
|
||||
|
||||
console.log("获取所有训练时间", res);
|
||||
console.log("当前科目:", this.appointmentInfo.subject);
|
||||
|
||||
// 确保 appointmentInfo.subject 已有值
|
||||
if (!this.appointmentInfo.subject) {
|
||||
console.warn("appointmentInfo.subject 为空,等待赋值...");
|
||||
await new Promise((resolve) => setTimeout(resolve, 100));
|
||||
}
|
||||
const data = res.data.find(
|
||||
(item) => item.subject == this.appointmentInfo.subject
|
||||
);
|
||||
|
||||
console.log("匹配的训练时间数据:", data);
|
||||
|
||||
this.appointmentInfo.allDriveTime = data ? data.trainTime || "0" : "0";
|
||||
|
||||
console.log(
|
||||
"this.appointmentInfo.allDriveTime",
|
||||
this.appointmentInfo.allDriveTime
|
||||
);
|
||||
} catch (error) {
|
||||
console.error("获取训练时间失败:", error);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
};
|
||||
</script>
|
||||
<style lang='scss'>
|
||||
@import '../common/common.scss';
|
||||
@import './assets/style/index.rpx.scss';
|
||||
|
||||
.jj {
|
||||
background-image: linear-gradient(180deg, rgba(245, 44, 44, 0.2) 0%, rgba(245, 44, 44, 0) 100%);
|
||||
border-radius: 8px;
|
||||
width: 686rpx;
|
||||
height: 140rpx;
|
||||
border: 1px solid rgba(255, 255, 255, 1);
|
||||
|
||||
.text-group_1 {
|
||||
width: 248rpx;
|
||||
height: 80rpx;
|
||||
margin: 30rpx 0 0 20rpx;
|
||||
|
||||
.text_2 {
|
||||
width: 96rpx;
|
||||
height: 32rpx;
|
||||
overflow-wrap: break-word;
|
||||
color: rgba(242, 39, 39, 1);
|
||||
font-size: 32rpx;
|
||||
font-family: PingFang SC-Regular;
|
||||
font-weight: NaN;
|
||||
text-align: left;
|
||||
white-space: nowrap;
|
||||
line-height: 32rpx;
|
||||
}
|
||||
|
||||
.text_3 {
|
||||
width: 248rpx;
|
||||
height: 28rpx;
|
||||
overflow-wrap: break-word;
|
||||
color: rgba(115, 124, 144, 1);
|
||||
font-size: 28rpx;
|
||||
font-family: PingFang SC-Regular;
|
||||
font-weight: NaN;
|
||||
text-align: left;
|
||||
white-space: nowrap;
|
||||
line-height: 28rpx;
|
||||
margin-top: 20rpx;
|
||||
}
|
||||
}
|
||||
}
|
||||
</style>
|
||||
|
@ -1,41 +1,11 @@
|
||||
<template>
|
||||
<view class="page flex-col">
|
||||
<view class="group_1 flex-row">
|
||||
<image
|
||||
class="image_1"
|
||||
referrerpolicy="no-referrer"
|
||||
src="/static/lanhu_pingjiazhongxin/FigmaDDSSlicePNG5472ef46deab947fe098747eb1b07bd2.png"
|
||||
/>
|
||||
<view class="group_2 flex-col"></view>
|
||||
<view class="group_3 flex-col"></view>
|
||||
<image
|
||||
class="image_2"
|
||||
referrerpolicy="no-referrer"
|
||||
src="/static/lanhu_pingjiazhongxin/FigmaDDSSlicePNGb239db97c719ec7467ee7c9615d3d24a.png"
|
||||
/>
|
||||
<view style="width: 100%;background: #f4f5f6;box-sizing: border-box;padding-top: 88px;">
|
||||
<headers titles="预约">
|
||||
<uni-icons type="left" color="#000000" size="22px"></uni-icons>
|
||||
</headers>
|
||||
</view>
|
||||
<view class="group_4 flex-col">
|
||||
<view class="group_5 flex-row">
|
||||
<image
|
||||
class="label_1"
|
||||
referrerpolicy="no-referrer"
|
||||
src="/static/lanhu_pingjiazhongxin/FigmaDDSSlicePNGacf527a62cbe7351c6472edd8f5b2814.png"
|
||||
/>
|
||||
<text class="text_1">评价中心</text>
|
||||
<view class="section_1 flex-col">
|
||||
<view class="image-wrapper_1 flex-row">
|
||||
<image
|
||||
class="thumbnail_1"
|
||||
referrerpolicy="no-referrer"
|
||||
src="/static/lanhu_pingjiazhongxin/FigmaDDSSlicePNGdc9929c2b5fd86c1689cc5990a0b4397.png"
|
||||
/>
|
||||
</view>
|
||||
<view class="box_1 flex-row justify-between">
|
||||
<view class="block_1 flex-col"></view>
|
||||
<view class="block_2 flex-col"></view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="list_1 flex-col">
|
||||
<view
|
||||
class="list-items_1 flex-col"
|
||||
@ -75,7 +45,12 @@
|
||||
</view>
|
||||
</template>
|
||||
<script>
|
||||
import headers from "@/components/header/headers.vue";
|
||||
import {getLocalUserInfo} from "@/utils/auth";
|
||||
import request from "@/utils/request";
|
||||
|
||||
export default {
|
||||
components: {headers},
|
||||
data() {
|
||||
return {
|
||||
loopData0: [
|
||||
@ -98,10 +73,30 @@ export default {
|
||||
lanhutext4: '4.0'
|
||||
}
|
||||
],
|
||||
constants: {}
|
||||
constants: {},
|
||||
userId: getLocalUserInfo().id,
|
||||
pageNo: 1,
|
||||
pageSize: 10
|
||||
};
|
||||
},
|
||||
methods: {}
|
||||
onLoad() {
|
||||
this.getList()
|
||||
},
|
||||
methods: {
|
||||
getList() {
|
||||
request({
|
||||
url: '/app-api/feed-back/page',
|
||||
method: 'GET',
|
||||
params: {
|
||||
userId: 5171,
|
||||
pageNo: this.pageNo,
|
||||
pageSize: this.pageSize
|
||||
}
|
||||
}).then(res => {
|
||||
console.log(res)
|
||||
})
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
||||
<style lang='scss'>
|
||||
|
@ -1,54 +1,24 @@
|
||||
<template>
|
||||
<view class="page flex-col">
|
||||
<view class="section_1 flex-row">
|
||||
<image
|
||||
class="image_1"
|
||||
referrerpolicy="no-referrer"
|
||||
src="/static/lanhu_pingjiabiaodan/FigmaDDSSlicePNG5472ef46deab947fe098747eb1b07bd2.png"
|
||||
/>
|
||||
<view class="block_1 flex-col"></view>
|
||||
<view class="block_2 flex-col"></view>
|
||||
<image
|
||||
class="image_2"
|
||||
referrerpolicy="no-referrer"
|
||||
src="/static/lanhu_pingjiabiaodan/FigmaDDSSlicePNGb239db97c719ec7467ee7c9615d3d24a.png"
|
||||
/>
|
||||
<view style="width: 100%;background: #f4f5f6;box-sizing: border-box;padding-top: 88px;">
|
||||
<headers titles="评价表单">
|
||||
<uni-icons type="left" color="#000000" size="22px"></uni-icons>
|
||||
</headers>
|
||||
</view>
|
||||
<view class="section_2 flex-col">
|
||||
<view class="box_1 flex-row">
|
||||
<image
|
||||
class="label_1"
|
||||
referrerpolicy="no-referrer"
|
||||
src="/static/lanhu_pingjiabiaodan/FigmaDDSSlicePNGacf527a62cbe7351c6472edd8f5b2814.png"
|
||||
/>
|
||||
<text class="text_1">评价表单</text>
|
||||
<view class="section_3 flex-col">
|
||||
<view class="image-wrapper_1 flex-row">
|
||||
<image
|
||||
class="thumbnail_1"
|
||||
referrerpolicy="no-referrer"
|
||||
src="/static/lanhu_pingjiabiaodan/FigmaDDSSlicePNGdc9929c2b5fd86c1689cc5990a0b4397.png"
|
||||
/>
|
||||
</view>
|
||||
<view class="group_1 flex-row justify-between">
|
||||
<view class="group_2 flex-col"></view>
|
||||
<view class="group_3 flex-col"></view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="box_2 flex-col">
|
||||
<view class="block_3 flex-row">
|
||||
<view class="text-group_1 flex-col justify-between">
|
||||
<text class="text_2">科目二考试</text>
|
||||
<text class="text_3">2025-02-20 12:00</text>
|
||||
<text class="text_2">{{ subjectArr[info.subject - 1] }}{{ title}}</text>
|
||||
<text class="text_3">{{ info.time }}</text>
|
||||
</view>
|
||||
</view>
|
||||
<view class="block_4 flex-row justify-between">
|
||||
<view class="text-wrapper_1 flex-col">
|
||||
<text class="text_4">科目二</text>
|
||||
<text class="text_4">{{ subjectArr[info.subject - 1] }}</text>
|
||||
</view>
|
||||
<view class="text-wrapper_2 flex-col">
|
||||
<text class="text_5">C2</text>
|
||||
<text class="text_5">{{ info.courseType }}</text>
|
||||
</view>
|
||||
</view>
|
||||
<view class="block_5 flex-row">
|
||||
@ -58,44 +28,132 @@
|
||||
referrerpolicy="no-referrer"
|
||||
src="/static/lanhu_pingjiabiaodan/FigmaDDSSlicePNG9781bf564ae15eee66e88c90622422db.png"
|
||||
/>
|
||||
<text class="text-group_2">马文峰</text>
|
||||
<text class="text-group_2">{{ info.coachName }}</text>
|
||||
</view>
|
||||
<view style="display: flex; align-items: center;">
|
||||
<u-rate active-color="#EAA140" v-model="info.rate" allowHalf inactive-color="#b2b2b2" @change="changeRate"></u-rate>
|
||||
<text style="margin-left: 5rpx;color:#E1A652;">{{ info.rate }}</text>
|
||||
</view>
|
||||
<view class="box_3 flex-col"></view>
|
||||
<view class="box_4 flex-col"></view>
|
||||
<view class="box_5 flex-col"></view>
|
||||
<view class="box_6 flex-col"></view>
|
||||
<view class="box_7 flex-col"></view>
|
||||
<text class="text_6">4.0</text>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="section_4 flex-col">
|
||||
<text class="text_7">服务评价</text>
|
||||
<view class="text-wrapper_3 flex-col">
|
||||
<text class="text_8">
|
||||
服务评价服务评价服务评价服务评价服务评价服务评价服务评价
|
||||
</text>
|
||||
<u--textarea v-model="info.serviceContent" placeholder="请输入内容" ></u--textarea>
|
||||
</view>
|
||||
<text class="text_9">技术评价</text>
|
||||
<view class="text-wrapper_4 flex-col">
|
||||
<text class="text_10">
|
||||
技术评价技术评价技术评价技术评价技术评价技术评价技术评价
|
||||
</text>
|
||||
<u--textarea v-model="info.teachContent" placeholder="请输入内容" ></u--textarea>
|
||||
</view>
|
||||
</view>
|
||||
<view class="bottom_" v-if="show">
|
||||
|
||||
<view class="text-wrapper_5 flex-col" style="display: flex; justify-content: center; width: 60%;" @click="submit">
|
||||
<view style="background-color: #044EF2; padding: 20rpx 80rpx; border-radius: 18rpx;text-align: center ">
|
||||
<text style="color: white; font-size: 28rpx;">确认评价</text>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
<script>
|
||||
import headers from "@/components/header/headers.vue";
|
||||
import request from "@/utils/request";
|
||||
import UInput from "@/uni_modules/uview-ui/components/u--input/u--input.vue";
|
||||
import {getLocalUserInfo} from "@/utils/auth";
|
||||
|
||||
export default {
|
||||
components: {UInput, headers},
|
||||
data() {
|
||||
return {
|
||||
constants: {}
|
||||
constants: {},
|
||||
show: false,
|
||||
title:'',
|
||||
// 评价信息
|
||||
info:{
|
||||
rate: 0.0,
|
||||
evaluateType: 0,
|
||||
busiId: '',
|
||||
tenantId: '',
|
||||
subject: 0,
|
||||
},
|
||||
subjectArr: ['科目一', '科目二', '科目三', '科目四'],
|
||||
};
|
||||
},
|
||||
methods: {}
|
||||
onLoad(options){
|
||||
const data = JSON.parse(options.data);
|
||||
// 判断新增还是查看
|
||||
if (options.controls) {
|
||||
this.show = true
|
||||
Object.assign(this.info, data);
|
||||
this.info.id = null
|
||||
//设置默认评分
|
||||
this.info.rate = 0.0
|
||||
if (options.type === 'xunlian') {
|
||||
this.title = '训练'
|
||||
//评价类型为训练
|
||||
this.info.evaluateType = 0
|
||||
//业务id
|
||||
this.info.busiId = data.id
|
||||
this.info.time = data.trainDay
|
||||
} else if (options.type === 'kaoshi') {
|
||||
this.title = '考试'
|
||||
//评价类型为考试
|
||||
this.info.evaluateType = 0
|
||||
}
|
||||
}
|
||||
|
||||
console.log(this.info)
|
||||
},
|
||||
methods: {
|
||||
changeRate(){},
|
||||
submit(){
|
||||
// 判断评分、评价不能为空
|
||||
if (this.info.rate === 0.0 || this.info.serviceEvaluate === '' || this.info.technologyEvaluate === '') {
|
||||
uni.showToast({
|
||||
title: '请填写完整评价信息',
|
||||
icon: 'none',
|
||||
duration: 2000
|
||||
})
|
||||
return
|
||||
}
|
||||
//获取userId
|
||||
const user = getLocalUserInfo();
|
||||
this.info.userId = user.id
|
||||
this.info.userName = user.nickname
|
||||
|
||||
request({
|
||||
url: '/app-api/feed-back',
|
||||
method: 'post',
|
||||
data: this.info,
|
||||
}).then(res => {
|
||||
uni.showToast({
|
||||
title: '评价成功',
|
||||
icon: 'none',
|
||||
duration: 2000
|
||||
})
|
||||
setTimeout(() => {
|
||||
//触发刷新事件
|
||||
uni.$emit('refresh');
|
||||
uni.navigateBack()
|
||||
}, 2000)
|
||||
})
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
||||
<style lang='scss'>
|
||||
@import '../common/common.scss';
|
||||
@import './assets/style/index.rpx.scss';
|
||||
.bottom_{
|
||||
//固定在底部
|
||||
position: fixed;
|
||||
bottom: 10rpx;
|
||||
width: 100%;
|
||||
background: white;
|
||||
padding: 40rpx 0;
|
||||
display: flex;
|
||||
justify-content: center; /* 新增:水平居中 */
|
||||
}
|
||||
</style>
|
||||
|
@ -29,3 +29,33 @@ export function setLocalUserInfo(userinfo){
|
||||
export function getLocalUserInfo() {
|
||||
return uni.getStorageSync(userInfo)
|
||||
}
|
||||
|
||||
// 设置本地存储,并设置一个过期时间(单位为秒)
|
||||
export function setStorageWithExpiry(key, value, ttl) {
|
||||
const now = new Date();
|
||||
// 计算过期时间
|
||||
const item = {
|
||||
value: value,
|
||||
expiry: now.getTime() + ttl * 1000,
|
||||
};
|
||||
// 将数据对象转换为字符串存储
|
||||
uni.setStorageSync(key, JSON.stringify(item));
|
||||
}
|
||||
|
||||
// 获取本地存储的数据,检查是否过期
|
||||
export function getStorageWithExpiry(key) {
|
||||
// 从本地存储获取数据
|
||||
const itemStr = uni.getStorageSync(key);
|
||||
if (!itemStr) {
|
||||
return null; // 未找到数据
|
||||
}
|
||||
const item = JSON.parse(itemStr);
|
||||
const now = new Date();
|
||||
// 检查项目是否过期
|
||||
if (now.getTime() > item.expiry) {
|
||||
// 如果过期,从存储中移除该项
|
||||
uni.removeStorageSync(key);
|
||||
return null;
|
||||
}
|
||||
return item.value; // 数据未过期,返回数据
|
||||
}
|
||||
|
@ -32,13 +32,13 @@ const request = config => {
|
||||
// 设置租户
|
||||
const isTanantId = (config.headers || {}).isTanantId === false
|
||||
config.header = config.header || {}
|
||||
if (!config.hasOwnProperty("tenantIdFlag")) {
|
||||
//请求设置了不需要租户,不拼接,,走进这里的是没设置不需要租户的
|
||||
if (getTenantId() && !isTanantId) {
|
||||
config.header['tenant-id'] = getTenantId()
|
||||
}
|
||||
config.header['tenant-id'] = 180
|
||||
}
|
||||
// if (!config.hasOwnProperty("tenantIdFlag")) {
|
||||
// //请求设置了不需要租户,不拼接,,走进这里的是没设置不需要租户的
|
||||
// if (getTenantId() && !isTanantId) {
|
||||
// config.header['tenant-id'] = getTenantId()
|
||||
// }
|
||||
// config.header['tenant-id'] = 180
|
||||
// }
|
||||
console.log(config.header, 424242);
|
||||
return new Promise((resolve, reject) => {
|
||||
uni.request({
|
||||
|
59
utils/utils.js
Normal file
59
utils/utils.js
Normal file
@ -0,0 +1,59 @@
|
||||
import request from "./request";
|
||||
import {
|
||||
setStorageWithExpiry,
|
||||
getStorageWithExpiry
|
||||
} from './auth'
|
||||
|
||||
export async function getDictDataByType(type) {
|
||||
let data = getStorageWithExpiry(type);
|
||||
if (data === null || data === undefined) {
|
||||
try {
|
||||
const response = await request({
|
||||
url: '/app-api/system/dict-data/type',
|
||||
method: 'get',
|
||||
params: {type}
|
||||
});
|
||||
data = response.data;
|
||||
setStorageWithExpiry(type, data, 3600); // 存储数据并设置过期时间
|
||||
} catch (error) {
|
||||
console.error("请求字典数据时出现了异常:", error);
|
||||
throw error; // 确保错误能够被外部捕获
|
||||
}
|
||||
}
|
||||
return data;
|
||||
}
|
||||
|
||||
export function formatDate(timestamp) {
|
||||
// 将时间戳转换为Date对象
|
||||
const date = new Date(timestamp);
|
||||
// 获取年月日时分秒
|
||||
const year = date.getFullYear();
|
||||
const month = (date.getMonth() + 1).toString().padStart(2, '0');
|
||||
const day = date.getDate().toString().padStart(2, '0');
|
||||
// 组合成日期时间字符串
|
||||
return `${year}-${month}-${day}`;
|
||||
}
|
||||
export function formatDateChinese(timestamp) {
|
||||
// 将时间戳转换为Date对象
|
||||
const date = new Date(timestamp);
|
||||
// 获取年月日时分秒
|
||||
const year = date.getFullYear();
|
||||
const month = (date.getMonth() + 1).toString().padStart(2, '0');
|
||||
const day = date.getDate().toString().padStart(2, '0');
|
||||
// 组合成日期时间字符串
|
||||
return `${year}年${month}月${day}日`;
|
||||
}
|
||||
|
||||
export function formatDateTimeToMinute(timestamp) {
|
||||
// 将时间戳转换为 Date 对象
|
||||
const date = new Date(timestamp);
|
||||
// 获取年月日时分
|
||||
const year = date.getFullYear();
|
||||
const month = (date.getMonth() + 1).toString().padStart(2, '0');
|
||||
const day = date.getDate().toString().padStart(2, '0');
|
||||
const hours = date.getHours().toString().padStart(2, '0');
|
||||
const minutes = date.getMinutes().toString().padStart(2, '0');
|
||||
// 组合成日期时间字符串(格式:yyyy-MM-dd hh:mm)
|
||||
return `${year}-${month}-${day} ${hours}:${minutes}`;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user