This commit is contained in:
许允枞 2025-04-07 16:47:05 +08:00
parent 02dde0928f
commit 3e383c9b62
8 changed files with 905 additions and 766 deletions

View File

@ -1,279 +1,282 @@
<template>
<view class="page flex-col">
<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 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" 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>
<view class="group_6 flex-row justify-between">
<view class="text-wrapper_1 flex-col">
<text class="text_3">{{ item.subjectStr }}</text>
</view>
<view class="text-wrapper_2 flex-col">
<text class="text_4">{{ item.courseType }}</text>
</view>
</view>
</view>
<view :class="item.status === true ? 'ytg' : 'text-wrapper_3'" class=" flex-col">
<text class="text_5">{{ item.statusStr }}</text>
</view>
</view>
<view class="text-wrapper_4 flex-row justify-between">
<text class="text_6">时间范围</text>
<text class="text_7">{{ item.reservTime }}</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>
</view>
<!-- 新增内容容器 -->
<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>
<view class="page flex-col">
<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 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" 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>
<view class="group_6 flex-row justify-between">
<view class="text-wrapper_1 flex-col">
<text class="text_3">{{ item.subjectStr }}</text>
</view>
<view class="text-wrapper_2 flex-col">
<text class="text_4">{{ item.courseType }}</text>
</view>
</view>
</view>
<view :class="item.status === true ? 'ytg' : 'text-wrapper_3'" class=" flex-col">
<text class="text_5">{{ item.statusStr }}</text>
</view>
</view>
<view class="text-wrapper_4 flex-row justify-between">
<text class="text_6">时间范围</text>
<text class="text_7">{{ item.reservTime }}</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>
</view>
<!-- 新增内容容器 -->
<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>
import headers from "@/components/header/headers.vue";
import request from "@/utils/request";
import headers from "@/components/header/headers.vue";
import request from "@/utils/request";
export default {
components: {
headers
},
data() {
return {
isTriggered: false,
pageNo: 1,
pageSize: 10,
total: 0,
appointmentList: [],
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()
},
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)
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
})
},
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}`
})
},
/**
* 上滑加载数据
*/
onReachBottomCus() {
// *
if (this.pageNo * this.pageSize >= this.total) {
uni.$u.toast('没有更多数据了')
return
}
//+1,
this.pageNo++
//
if (this.curNow === 1) {
this.getTrainList()
} else {
this.getList()
}
},
/**
* 下拉刷新数据
*/
onRefresherrefresh() {
this.isTriggered = true
this.pageNo = 1
this.total = 0
this.appointmentList = []
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`
})
},
}
};
export default {
components: {
headers
},
data() {
return {
isTriggered: false,
pageNo: 1,
pageSize: 10,
total: 0,
appointmentList: [],
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()
},
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)
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
})
},
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}`
})
},
/**
* 上滑加载数据
*/
onReachBottomCus() {
// *
if (this.pageNo * this.pageSize >= this.total) {
uni.$u.toast('没有更多数据了')
return
}
//+1,
this.pageNo++
//
if (this.curNow === 1) {
this.getTrainList()
} else {
this.getList()
}
},
/**
* 下拉刷新数据
*/
onRefresherrefresh() {
this.isTriggered = true
this.pageNo = 1
this.total = 0
this.appointmentList = []
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>
<style lang='scss'>
@import '../common/common.scss';
@import './assets/style/index.rpx.scss';
@import '../common/common.scss';
@import './assets/style/index.rpx.scss';
//
.content-box {
margin-top: 88rpx;
/* 根据头部高度调整 */
padding: 20rpx;
overflow-y: auto;
height: calc(100vh - 88rpx);
/* 确保内容区域高度正确 */
}
//
.content-box {
margin-top: 88rpx;
/* 根据头部高度调整 */
padding: 20rpx;
overflow-y: auto;
height: calc(100vh - 88rpx);
/* 确保内容区域高度正确 */
}
.header {
width: 100%;
background: #f4f5f6;
box-sizing: border-box;
padding-top: 88px;
}
.header {
width: 100%;
background: #f4f5f6;
box-sizing: border-box;
padding-top: 88px;
}
.bottom_ {
position: fixed;
bottom: 0;
}
.bottom_ {
position: fixed;
bottom: 0;
}
.ytg {
background-color: #cfe2ff;
border-radius: 4px;
height: 40rpx;
margin-top: 22rpx;
width: 96rpx;
.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;
}
}
.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>

View File

@ -163,9 +163,9 @@
.text-wrapper_2 {
background-color: rgba(255, 239, 229, 1);
border-radius: 2px;
height: 36rpx;
//height: 36rpx;
width: 52rpx;
margin: 48rpx 86rpx 0 -138rpx;
//margin: 48rpx 86rpx 0 -138rpx;
.text_6 {
width: 32rpx;
height: 24rpx;
@ -181,15 +181,15 @@
}
}
.text-wrapper_3 {
background-color: rgba(223, 235, 255, 1);
//background-color: rgba(223, 235, 255, 1);
border-radius: 2px;
height: 36rpx;
width: 92rpx;
//height: 36rpx;
//width: 92rpx;
position: absolute;
left: 232rpx;
top: 48rpx;
.text_7 {
width: 72rpx;
//width: 72rpx;
height: 24rpx;
overflow-wrap: break-word;
color: rgba(44, 120, 245, 1);
@ -199,7 +199,7 @@
text-align: left;
white-space: nowrap;
line-height: 24rpx;
margin: 6rpx 0 0 10rpx;
//margin: 6rpx 0 0 10rpx;
}
}
}

View File

@ -1,17 +1,9 @@
<template>
<view class="page flex-col">
<view class="group_1 flex-row">
</view>
<view class="group_2 flex-row">
<image
class="label_1"
referrerpolicy="no-referrer"
src="/static/lanhu_kechengliebiao/FigmaDDSSlicePNG53ddee177d4f9800624b95a9ec941112.png"
@click="goBack()"
/>
<text class="text_2">课程</text>
<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>
<scroll-view
class="scroll-view"
@ -32,23 +24,34 @@
<text class="text_5">{{ item.price }}</text>
</view>
</view>
<view class="text-wrapper_2 flex-col">
<text class="text_6">{{ item.type }}</text>
</view>
<view class="text-wrapper_3 flex-col">
<text class="text_7">{{ item.name }}</text>
<view style="display: flex">
<text class="text_7" style="background-color: rgba(223, 235, 255, 1);padding: 5rpx 15rpx">{{ item.name }}</text>
<text class="text-wrapper_2 text_7" style="color: black;padding: 5rpx 15rpx;margin-left: 10rpx">{{ item.type }}</text>
</view>
</view>
<!-- <view class="text-wrapper_3 flex-col">-->
<!-- <view >-->
<!-- <text class="text_7">{{ item.name }}</text>-->
<!-- </view>-->
<!-- <view class="text-wrapper_2 flex-col">-->
<!-- <text class="text_6">{{ item.type }}</text>-->
<!-- </view>-->
<!-- </view>-->
</view>
</view>
</scroll-view>
</view>
</template>
<script>
import request from "@/utils/request";
import config from "@/config.js"
import headers from "@/components/header/headers.vue";
export default {
components: {headers},
data() {
return {
imagesUrl: config.imagesUrl,
@ -72,7 +75,7 @@ export default {
methods: {
goBack() {
uni.navigateBack({
delta: 1
delta: 1
});
},
getSchoolAllClass() {
@ -80,16 +83,16 @@ export default {
url: '/app-api/dl-drive-school-course-small/list',
method: 'GET',
params: {
tenantId: this.tenantId,
tenantId: this.tenantId,
},
tenantIdFlag: false
tenantIdFlag: false
}).then(res => {
this.schoolAllClassList = res.data;
this.total = res.data.total;
this.total = res.data.total;
console.log('驾校课程列表', this.schoolAllClassList);
})
},
calculateScrollHeight() {
//
const screenHeight = uni.getSystemInfoSync().windowHeight;

View File

@ -1,105 +1,151 @@
<template>
<view class="page flex-col">
<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="list_1 flex-col">
<view
class="list-items_1 flex-col"
v-for="(item, index) in loopData0"
:key="index"
>
<view class="text-wrapper_1 flex-row">
<text class="text_2" v-html="item.lanhutext0"></text>
</view>
<view class="group_6 flex-row justify-between">
<view class="text-wrapper_2 flex-col">
<text class="text_3" v-html="item.lanhutext1"></text>
</view>
<view class="text-wrapper_3 flex-col">
<text class="text_4" v-html="item.lanhutext2"></text>
</view>
</view>
<view class="group_7 flex-row">
<view class="image-text_1 flex-row justify-between">
<image
class="label_2"
referrerpolicy="no-referrer"
:src="item.lanhuimage0"
/>
<text class="text-group_1" v-html="item.lanhutext3"></text>
</view>
<view class="section_2 flex-col"></view>
<view class="section_3 flex-col"></view>
<view class="section_4 flex-col"></view>
<view class="section_5 flex-col"></view>
<view class="section_6 flex-col"></view>
<text class="text_5" v-html="item.lanhutext4"></text>
</view>
</view>
</view>
</view>
</view>
<view class="page flex-col">
<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="list_1 flex-col">
<scroll-view style="height: 1400rpx;" scroll-y="true" class="itemContent"
@scrolltolower="onReachBottomCus" refresher-enabled @refresherrefresh="onRefresherrefresh"
:refresher-triggered="isTriggered">
<view class="list-items_1 flex-col" v-for="(item, index) in evaluate" :key="index"
@click="goEvaluateDetail(item)">
<view class="text-wrapper_1 flex-row">
<text class="text_2">{{ item.busiName }}</text>
</view>
<view class="group_6 flex-row justify-between">
<view class="text-wrapper_2 flex-col">
<text class="text_3">{{ item.busiName.slice(0, 3) }}</text>
</view>
<view class="text-wrapper_3 flex-col">
<text class="text_4">{{ item.courseType }}</text>
</view>
</view>
<view class="group_7 flex-row">
<view class="image-text_1 flex-row justify-between" style="align-items: center;">
<image class="label_2" referrerpolicy="no-referrer"
src="/static/lanhu_pingjiabiaodan/FigmaDDSSlicePNG9781bf564ae15eee66e88c90622422db.png" />
<text class="text-group_1">{{ item.coachName }}</text>
</view>
<view style="display: flex; align-items: center;">
<u-rate active-color="#EAA140" v-model="item.rate" allowHalf inactive-color="#b2b2b2"
readonly></u-rate>
<text style="margin-left: 5rpx;color:#E1A652;">{{ item.rate }}</text>
</view>
</view>
</view>
</scroll-view>
</view>
</view>
</view>
</template>
<script>
import headers from "@/components/header/headers.vue";
import {getLocalUserInfo} from "@/utils/auth";
import request from "@/utils/request";
import headers from "@/components/header/headers.vue";
import {
getLocalUserInfo
} from "@/utils/auth";
import request from "@/utils/request";
export default {
components: {headers},
data() {
return {
loopData0: [
{
lanhutext0: '科目二训练',
lanhutext1: '科目二',
lanhutext2: 'C2',
lanhuimage0:
'https://lanhu-oss-2537-2.lanhuapp.com/FigmaDDSSlicePNG9781bf564ae15eee66e88c90622422db.png',
lanhutext3: '马文峰',
lanhutext4: '4.0'
},
{
lanhutext0: '科目二考试',
lanhutext1: '科目二',
lanhutext2: 'C2',
lanhuimage0:
'https://lanhu-oss-2537-2.lanhuapp.com/FigmaDDSSlicePNG9781bf564ae15eee66e88c90622422db.png',
lanhutext3: '马文峰',
lanhutext4: '4.0'
}
],
constants: {},
userId: getLocalUserInfo().id,
pageNo: 1,
pageSize: 10
};
},
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)
})
}
}
};
export default {
components: {
headers
},
data() {
return {
loopData0: [{
lanhutext0: '科目二训练',
lanhutext1: '科目二',
lanhutext2: 'C2',
lanhuimage0: 'https://lanhu-oss-2537-2.lanhuapp.com/FigmaDDSSlicePNG9781bf564ae15eee66e88c90622422db.png',
lanhutext3: '马文峰',
lanhutext4: '4.0'
},
{
lanhutext0: '科目二考试',
lanhutext1: '科目二',
lanhutext2: 'C2',
lanhuimage0: 'https://lanhu-oss-2537-2.lanhuapp.com/FigmaDDSSlicePNG9781bf564ae15eee66e88c90622422db.png',
lanhutext3: '马文峰',
lanhutext4: '4.0'
}
],
evaluate: [],
constants: {},
userId: getLocalUserInfo().id,
pageNo: 1,
pageSize: 10,
total: 0,
isTriggered: false
};
},
onLoad() {
this.getList()
},
methods: {
getList() {
request({
url: '/app-api/feed-back/page',
method: 'GET',
params: {
userId: this.userId,
pageNo: this.pageNo,
pageSize: this.pageSize
}
}).then(res => {
console.log(res)
this.total = res.data.total
if (this.pageNo == 1) {
this.evaluate = res.data.records
} else {
this.evaluate = this.evaluate.concat(res.data.records)
}
this.isTriggered = false
})
},
/**
* 上滑加载数据
*/
onReachBottomCus() {
// *
if (this.pageNo * this.pageSize >= this.total) {
uni.$u.toast('没有更多数据了')
return
}
//+1,
this.pageNo++
//
if (this.curNow === 1) {
this.getTrainList()
} else {
this.getList()
}
},
/**
* 下拉刷新数据
*/
onRefresherrefresh() {
this.isTriggered = true
this.pageNo = 1
this.total = 0
this.appointmentList = []
if (this.curNow === 1) {
this.getTrainList()
} else {
this.getList()
}
},
goEvaluateDetail(data) {
data = JSON.stringify(data)
uni.navigateTo({
url: `/newPages/evaluateAdd/index?data=${data}`
})
}
}
};
</script>
<style lang='scss'>
@import '../common/common.scss';
@import './assets/style/index.rpx.scss';
@import '../common/common.scss';
@import './assets/style/index.rpx.scss';
</style>

View File

@ -1,159 +1,174 @@
<template>
<view class="page flex-col">
<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_2 flex-col">
<view class="block_3 flex-row">
<view class="text-group_1 flex-col justify-between">
<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">{{ subjectArr[info.subject - 1] }}</text>
</view>
<view class="text-wrapper_2 flex-col">
<text class="text_5">{{ info.courseType }}</text>
</view>
</view>
<view class="block_5 flex-row">
<view class="image-text_1 flex-row justify-between">
<image
class="label_2"
referrerpolicy="no-referrer"
src="/static/lanhu_pingjiabiaodan/FigmaDDSSlicePNG9781bf564ae15eee66e88c90622422db.png"
/>
<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>
</view>
</view>
<view class="section_4 flex-col">
<text class="text_7">服务评价</text>
<view class="text-wrapper_3 flex-col">
<u--textarea v-model="info.serviceContent" placeholder="请输入内容" ></u--textarea>
</view>
<text class="text_9">技术评价</text>
<view class="text-wrapper_4 flex-col">
<u--textarea v-model="info.teachContent" placeholder="请输入内容" ></u--textarea>
</view>
</view>
<view class="bottom_" v-if="show">
<view class="page flex-col">
<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_2 flex-col">
<view class="block_3 flex-row">
<view class="text-group_1 flex-col justify-between">
<text class="text_2" v-if="show">{{ subjectArr[info.subject - 1] }}{{ title}}</text>
<text class="text_2" v-else>{{ info.busiName }}{{ 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" v-if="show">{{ subjectArr[info.subject - 1] }}</text>
<text class="text_4" v-else>{{ info.busiName.slice(0, 3) }}</text>
</view>
<view class="text-wrapper_2 flex-col">
<text class="text_5">{{ info.courseType }}</text>
</view>
</view>
<view class="block_5 flex-row">
<view class="image-text_1 flex-row justify-between">
<image class="label_2" referrerpolicy="no-referrer"
src="/static/lanhu_pingjiabiaodan/FigmaDDSSlicePNG9781bf564ae15eee66e88c90622422db.png" />
<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" :readonly="!show"></u-rate>
<text style="margin-left: 5rpx;color:#E1A652;">{{ info.rate }}</text>
</view>
</view>
</view>
</view>
<view class="section_4 flex-col">
<text class="text_7">服务评价</text>
<view class="text-wrapper_3 flex-col">
<u--textarea v-model="info.serviceContent" :disabled="!show" autoHeight
placeholder="请输入内容"></u--textarea>
</view>
<text class="text_9">技术评价</text>
<view class="text-wrapper_4 flex-col">
<u--textarea v-model="info.teachContent" :disabled="!show" autoHeight 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>
<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";
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";
import {
login
} from "../../api/login";
export default {
components: {UInput, headers},
data() {
return {
constants: {},
show: false,
title:'',
//
info:{
rate: 0.0,
evaluateType: 0,
busiId: '',
tenantId: '',
subject: 0,
},
subjectArr: ['科目一', '科目二', '科目三', '科目四'],
};
},
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
}
}
export default {
components: {
UInput,
headers
},
data() {
return {
constants: {},
show: false,
title: '',
//
info: {
rate: 0.0,
evaluateType: 0,
busiId: '',
tenantId: '',
subject: 0,
},
subjectArr: ['科目一', '科目二', '科目三', '科目四'],
};
},
onLoad(options) {
const data = JSON.parse(options.data);
console.log('穿进来的数据');
//
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
}
} else {
Object.assign(this.info, data);
}
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
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)
})
}
}
};
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; /* 新增:水平居中 */
}
@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>

View File

@ -117,8 +117,9 @@
rgba(255, 255, 255, 0) 100%
);
width: 750rpx;
height: 304rpx;
//height: 304rpx;
justify-content: flex-center;
margin-bottom: 30rpx;
.text_3 {
width: 160rpx;
height: 40rpx;
@ -303,37 +304,38 @@
}
}
}
.text-wrapper_3 {
background-color: rgba(255, 239, 229, 1);
border-radius: 2px;
height: 36rpx;
width: 52rpx;
margin: 48rpx 86rpx 0 -138rpx;
//height: 36rpx;
width: 33rpx;
//margin: 48rpx 86rpx 0 -138rpx;
//width: 32rpx;
//height: 24rpx;
overflow-wrap: break-word;
color: rgba(123, 81, 11, 1);
font-size: 24rpx;
font-family: PingFang SC-Regular;
font-weight: NaN;
text-align: left;
white-space: nowrap;
margin-left: 10rpx;
.text_12 {
width: 32rpx;
height: 24rpx;
overflow-wrap: break-word;
color: rgba(123, 81, 11, 1);
font-size: 24rpx;
font-family: PingFang SC-Regular;
font-weight: NaN;
text-align: left;
white-space: nowrap;
line-height: 24rpx;
margin: 6rpx 0 0 10rpx;
}
}
.text-wrapper_4 {
background-color: rgba(223, 235, 255, 1);
//background-color: rgba(223, 235, 255, 1);
border-radius: 2px;
height: 36rpx;
width: 92rpx;
//width: 92rpx;
position: absolute;
left: 232rpx;
top: 48rpx;
.text_13 {
width: 72rpx;
height: 24rpx;
overflow-wrap: break-word;
color: rgba(44, 120, 245, 1);
@ -644,7 +646,7 @@
}
.text_27 {
width: 106rpx;
height: 24rpx;
height: 45rpx;
overflow-wrap: break-word;
color: rgba(137, 146, 162, 1);
font-size: 24rpx;
@ -657,10 +659,9 @@
}
}
.box_13 {
background-color: rgba(237, 162, 58, 1);
position: absolute;
left: 116rpx;
top: 48rpx;
left: 110rpx;
top: 40rpx;
width: 28rpx;
height: 28rpx;
}
@ -676,7 +677,7 @@
text-align: left;
white-space: nowrap;
line-height: 24rpx;
margin-top: 92rpx;
margin-top: 72rpx;
}
}
.group_11 {
@ -839,13 +840,13 @@
background: #fff;
border-radius: 16rpx;
}
.section-title {
font-size: 32rpx;
font-weight: bold;
margin-bottom: 20rpx;
}
.class-list {
display: flex;
flex-direction: column;
@ -854,20 +855,20 @@
height: 30%;
margin: 40rpx 0 0 20rpx;
}
.class-item {
display: flex;
padding: 20rpx;
border-radius: 12rpx;
}
.class-image {
width: 160rpx;
height: 100rpx;
border-radius: 8rpx;
}
.class-info {
flex: 1;
margin-left: 20rpx;
@ -875,39 +876,39 @@
flex-direction: column;
justify-content: space-between;
}
.class-name {
font-size: 35rpx;
font-weight: bold;
margin-bottom: 10px;
}
.class-price {
display: flex;
align-items: center;
}
.price {
font-size: 28rpx;
color: #ff4d4f;
font-weight: bold;
}
.original-price {
font-size: 24rpx;
text-decoration: line-through;
color: #999;
margin-left: 10rpx;
}
.class-details {
display: flex;
gap: 8rpx; /* 设置两个标签之间的间距 */
align-items: center;
margin-bottom: 10rpx;
}
.view-all {
margin-top: 20rpx;
display: flex;
@ -916,12 +917,12 @@
color: #007aff;
font-size: 28rpx;
}
.arrow-icon {
width: 20rpx;
height: 20rpx;
}
.class-type,
.class-license {
display: flex; /* 设置为行内块元素 */
@ -932,13 +933,13 @@
justify-content: center;
align-items: center;
}
/* 如果需要区分两个标签的样式,可以单独设置 */
.class-type {
color: #3478DC;
background-color: #DDEDFE; /* 红色背景 */
}
.class-license {
color: #8B623D;
background-color: #FFF0E4; /* 蓝色背景 */

View File

@ -1,82 +1,71 @@
<template>
<view class="page flex-col">
<view class="group_1 flex-row">
</view>
<view class="group_2 flex-row">
<image
class="label_1"
referrerpolicy="no-referrer"
src="/static/lanhu_jiaxiaoxiangqing/FigmaDDSSlicePNG53ddee177d4f9800624b95a9ec941112.png"
@click="handleBack"
/>
<text class="text_2">驾校</text>
<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">
<image
style="width: 100%; height: 100%;"
referrerpolicy="no-referrer"
src="/static/lanhu_jiaxiaoxiangqing/FigmaDDSSlicePNGcd54efcc9a8c89af0ef99c8275464828.png"
/>
</view>
<image
style="width: 100%; height: 100%;"
referrerpolicy="no-referrer"
src="/static/lanhu_jiaxiaoxiangqing/FigmaDDSSlicePNGcd54efcc9a8c89af0ef99c8275464828.png"
/>
</view>
<view class="group_5 flex-col">
<text class="text_3">{{ schoolDetails.corpName }}</text>
<view class="text-wrapper_1 flex-row justify-between">
<text class="text_4">营业中</text>
<text class="text_5">08:00-18:00</text>
</view>
<view class="block_2 flex-row">
<view class="text-group_1 flex-col justify-between">
<text class="text_6">山东省济南市历下区工业路城投伴山居三区</text>
<text class="text_7">距离4.0km</text>
</view>
<view class="image-wrapper_2 flex-col">
<image
class="label_2"
referrerpolicy="no-referrer"
src="/static/lanhu_jiaxiaoxiangqing/FigmaDDSSlicePNGb598f2a62156745f7ba827352fd17464.png"
/>
</view>
</view>
<!-- <view class="block_2 flex-row">-->
<!-- <view class="text-group_1 flex-col justify-between">-->
<!-- <text class="text_6">{{ schoolDetails.address }}</text>-->
<!-- <text class="text_7">距离4.0km</text>-->
<!-- </view>-->
<!-- <view class="image-wrapper_2 flex-col">-->
<!-- <image-->
<!-- class="label_2"-->
<!-- referrerpolicy="no-referrer"-->
<!-- src="/static/lanhu_jiaxiaoxiangqing/FigmaDDSSlicePNGb598f2a62156745f7ba827352fd17464.png"-->
<!-- />-->
<!-- </view>-->
<!-- </view>-->
</view>
<!-- <view class="container">
<view class="section-title">
<text class="title">报名类型</text>
</view>
<view class="class-list">
<view class="class-item" v-for="(item, index) in schoolClassList" :key="index">
<image class="class-image" :src="item.photo" />
<view class="class-info">
<text class="class-name">{{ item.tittle }}</text>
<view class="class-details">
<text class="class-type">{{ item.name }}</text>
<text class="class-license">{{ item.type }}</text>
</view>
<view class="class-price">
<text class="price">{{ item.price - item.favour }}</text>
<text class="original-price">{{ item.price }}</text>
</view>
</view>
</view>
</view>
<view class="view-all" @click="goClassList()">
<text>查看全部班型 ({{ schoolClassList.length }})</text>
<image src="/static/arrow.png" class="arrow-icon" />
</view>
</view> -->
<!-- <view class="container">
<view class="section-title">
<text class="title">报名类型</text>
</view>
<view class="class-list">
<view class="class-item" v-for="(item, index) in schoolClassList" :key="index">
<image class="class-image" :src="item.photo" />
<view class="class-info">
<text class="class-name">{{ item.tittle }}</text>
<view class="class-details">
<text class="class-type">{{ item.name }}</text>
<text class="class-license">{{ item.type }}</text>
</view>
<view class="class-price">
<text class="price">{{ item.price - item.favour }}</text>
<text class="original-price">{{ item.price }}</text>
</view>
</view>
</view>
</view>
<view class="view-all" @click="goClassList()">
<text>查看全部班型 ({{ schoolClassList.length }})</text>
<image src="/static/arrow.png" class="arrow-icon" />
</view>
</view> -->
<view class="group_6 flex-col">
<view class="box_4 flex-row justify-between">
<view class="box_5 flex-col"></view>
@ -85,9 +74,9 @@
<view class="box_6 flex-row" v-for="(item, index) in schoolClassList" :key="index" @click="goToDetail(item.id)">
<view class="image-text_1 flex-row">
<image
class="image_2"
referrerpolicy="no-referrer"
:src="imagesUrl + '/' + item.photo"
class="image_2"
referrerpolicy="no-referrer"
:src="imagesUrl + '/' + item.photo"
/>
<view class="text-group_2 flex-col justify-between">
<text class="text_9">{{ item.tittle }}</text>
@ -96,27 +85,34 @@
<text class="text_11">{{ item.price }}</text>
</view>
</view>
<view class="text-wrapper_3 flex-col">
<text class="text_12">{{ item.type }}</text>
</view>
<!-- <view class="text-wrapper_3 flex-col">-->
<!-- -->
<!-- </view>-->
<view class="text-wrapper_4 flex-col">
<text class="text_13">{{ item.name }}</text>
<view style="display: flex">
<text class="text_13" style="background-color: rgba(223, 235, 255, 1);padding: 5rpx 15rpx">{{
item.name
}}
</text>
<text class="text-wrapper_3 text_13" style="color: black;padding: 5rpx 15rpx">{{ item.type }}</text>
</view>
</view>
</view>
</view>
<view class="box_12 flex-row">
<view class="image-text_2 flex-row justify-between" @click="goClassList()">
<text class="text-group_3">查看全部班型({{ schoolAllClassList.length }})</text>
<image
class="thumbnail_2"
referrerpolicy="no-referrer"
src="/static/lanhu_jiaxiaoxiangqing/FigmaDDSSlicePNGb5045194768d2baa618848ea60e5a9e4.png"
class="thumbnail_2"
referrerpolicy="no-referrer"
src="/static/lanhu_jiaxiaoxiangqing/FigmaDDSSlicePNGb5045194768d2baa618848ea60e5a9e4.png"
/>
</view>
</view>
</view>
<view class="group_8 flex-col">
<view class="group_9 flex-row justify-between">
<view class="block_3 flex-col"></view>
@ -125,141 +121,210 @@
<view class="group_10 flex-row justify-between" v-for="(item, index) in schoolCoachList" :key="index">
<view class="image-text_3 flex-row justify-between">
<image
class="label_3"
referrerpolicy="no-referrer"
:src="imagesUrl + '/' + item.image"
class="label_3"
referrerpolicy="no-referrer"
:src="imagesUrl + '/' + item.image"
/>
<view class="text-group_4 flex-col justify-between">
<text class="text_25">{{ item.name }}</text>
<text class="text_26">5.0</text>
<!-- <text class="text_26">5.0</text>-->
<text class="text_27">教龄&nbsp;{{ item.seniority }}</text>
</view>
<view class="box_13 flex-col"></view>
<!-- <view class="box_13 flex-col">-->
<!-- <u-rate :count="1" activeColor="#eda23a"></u-rate>-->
<!-- </view>-->
</view>
<text class="text_28">学员&nbsp;598</text>
</view>
</view>
</view>
</template>
<script>
import request from "@/utils/request";
import config from "@/config.js"
import headers from "@/components/header/headers.vue";
export default {
components: {headers},
data() {
return {
imagesUrl: config.imagesUrl,
imagesUrl: config.imagesUrl,
constants: {},
schoolId: undefined,
tenantId: undefined,
tenantId: undefined,
schoolDetails: {},
schoolClassList: [],
schoolAllClassList: [],
schoolCoachList: [],
schoolClassList: [],
schoolAllClassList: [],
schoolCoachList: [],
};
},
async onShow() {
// const res = await this.getLocation();
// console.log('',res)
},
onLoad(options) {
if (options.id) {
this.schoolId = options.id;
this.tenantId = options.tenantId
console.log("首页传入数据", options)
this.schoolId = options.id;
this.tenantId = options.tenantId
console.log("首页传入数据", options)
console.log("驾校id", this.schoolId)
console.log("驾校租户id", this.tenantId)
this.getSchoolDetails();
this.getSchoolClass();
this.getSchoolAllClass()
this.getSchoolCoach()
console.log("驾校租户id", this.tenantId)
this.getSchoolDetails();
this.getSchoolClass();
this.getSchoolAllClass()
this.getSchoolCoach()
}
},
methods: {
handleBack() {
uni.navigateBack({
delta: 1
});
uni.navigateBack({
delta: 1
});
},
getSchoolDetails() {
request({
url: '/userClient/base/companySmallProgram/noTenantIdGet',
method: 'GET',
params: {
id: this.schoolId
},
tenantIdFlag : false
}).then(res => {
this.schoolDetails = res.data;
this.tenantId = res.data.tenantId
console.log('租户id', this.tenantId)
console.log('学校详情', this.schoolDetails);
}).catch(err => {
console.error('获取驾校详情失败', err);
});
request({
url: '/userClient/base/companySmallProgram/noTenantIdGet',
method: 'GET',
params: {
id: this.schoolId
},
getSchoolClass() {
console.log('tenantId',this.tenantId)
request({
url: '/app-api/dl-drive-school-course-small/noTenantIdPage',
method: 'GET',
params: {
pageNo: 1,
pageSize: 3,
tenantId: this.tenantId,
},
tenantIdFlag: false
}).then(res => {
this.schoolClassList = res.data.records;
this.total = res.data.total;
console.log('驾校课程列表', this.schoolClassList);
})
},
getSchoolAllClass() {
request({
url: '/app-api/dl-drive-school-course-small/list',
method: 'GET',
params: {
tenantId: this.tenantId,
},
tenantIdFlag: false
}).then(res => {
this.schoolAllClassList = res.data;
this.total = res.data.total;
console.log('驾校所有课程列表', this.schoolAllClassList);
})
},
getSchoolCoach(){
request({
url: '/app-api/dl-drive-school-coach-small/page',
method: 'GET',
params: {
tenantId: this.tenantId,
},
tenantIdFlag: false
}).then(res => {
//
const sortedList = res.data.records.sort((a, b) => b.seniority - a.seniority);
//
this.schoolCoachList = sortedList.slice(0, 3);
this.total = res.data.total;
console.log('驾校教练列表', this.schoolCoachList);
})
},
goClassList(){
uni.navigateTo({
url: '/newPages/courseList/index?tenantId=' + this.tenantId,
});
},
//
goToDetail(courseId) {
uni.navigateTo({
url: `/newPages/courseDetail/index?courseId=${courseId}&tenantId=${this.tenantId}`,
});
},
tenantIdFlag: false
}).then(res => {
this.schoolDetails = res.data;
this.tenantId = res.data.tenantId
console.log('租户id', this.tenantId)
console.log('学校详情', this.schoolDetails);
}).catch(err => {
console.error('获取驾校详情失败', err);
});
},
getSchoolClass() {
console.log('tenantId', this.tenantId)
request({
url: '/app-api/dl-drive-school-course-small/noTenantIdPage',
method: 'GET',
params: {
pageNo: 1,
pageSize: 3,
tenantId: this.tenantId,
},
tenantIdFlag: false
}).then(res => {
this.schoolClassList = res.data.records;
this.total = res.data.total;
console.log('驾校课程列表', this.schoolClassList);
})
},
//
getLocation() {
let location = {
lat: 0,
lng: 0,
}
return new Promise((reserve, reject) => {//使promise
uni.getLocation({
success(res) {
console.log('成功')
location.lat = res.latitude
location.lng = res.longitude,
reserve(location);
},
fail(err) {
console.log('失败', err)
reject(location);//0
}
})
})
},
//
calculateDistance(loc1, loc2) {
const {latitude: lat1, longitude: lng1} = loc1;
const {latitude: lat2, longitude: lng2} = loc2;
const rad = (d) => d * Math.PI / 180.0;
const radLat1 = rad(lat1);
const radLat2 = rad(lat2);
const a = radLat1 - radLat2;
const b = rad(lng1) - rad(lng2);
const distance = 2 * Math.asin(Math.sqrt(
Math.pow(Math.sin(a / 2), 2) +
Math.cos(radLat1) *
Math.cos(radLat2) *
Math.pow(Math.sin(b / 2), 2)
));
const EARTH_RADIUS = 6378.137; //
//
const result = (distance * EARTH_RADIUS).toFixed(2); // 2
console.log('距离:', result + 'km');
return result;
},
wxGeocoder(address) {
return new Promise((resolve, reject) => {
// chooseLocation
uni.chooseLocation({
success: (res) => {
resolve({
latitude: res.latitude,
longitude: res.longitude
});
},
fail: (err) => reject(err)
});
});
},
getSchoolAllClass() {
request({
url: '/app-api/dl-drive-school-course-small/list',
method: 'GET',
params: {
tenantId: this.tenantId,
},
tenantIdFlag: false
}).then(res => {
this.schoolAllClassList = res.data;
this.total = res.data.total;
console.log('驾校所有课程列表', this.schoolAllClassList);
})
},
getSchoolCoach() {
request({
url: '/app-api/dl-drive-school-coach-small/page',
method: 'GET',
params: {
tenantId: this.tenantId,
},
tenantIdFlag: false
}).then(res => {
//
const sortedList = res.data.records.sort((a, b) => b.seniority - a.seniority);
//
this.schoolCoachList = sortedList.slice(0, 3);
this.total = res.data.total;
console.log('驾校教练列表', this.schoolCoachList);
})
},
goClassList() {
uni.navigateTo({
url: '/newPages/courseList/index?tenantId=' + this.tenantId,
});
},
//
goToDetail(courseId) {
uni.navigateTo({
url: `/newPages/courseDetail/index?courseId=${courseId}&tenantId=${this.tenantId}`,
});
},
}
};
</script>

View File

@ -1,14 +1,14 @@
<template>
<view class="page flex-col">
<view class="container">
<headers titles="驾校"><uni-icons @click="goback()" type="arrow-left" color="#000000"
<headers titles="驾校"><uni-icons @click="goback()" type="left" color="#000000"
size="22px"></uni-icons></headers>
</view>
<view class="itemContent">
<scroll-view style="height: 100%;" scroll-y="true" class="itemContent" @scrolltolower="onReachBottomCus"
refresher-enabled @refresherrefresh="onRefresherrefresh" :refresher-triggered="isTriggered">
<!-- 使用 SchoolInfo 组件渲染驾校信息 -->
<SchoolInfo v-for="(school, index) in schoolList" :key="index" :schoolInfo="school" />
<SchoolInfo v-for="(school, index) in schoolList" :key="index" :schoolInfo="school" @click="goSchoolDetail(school)"/>
</scroll-view>
</view>
</view>
@ -102,6 +102,12 @@ export default {
this.isTriggered = false
})
},
goSchoolDetail(data) {
uni.navigateTo({
url: `/newPages/schoolDetail/index?id=${data.id}&tenantId=${data.tenantId}`,
// url: '/newPages/schoolDetail/index',
});
},
/**
* 上滑加载数据