0411
This commit is contained in:
parent
a40070c88e
commit
bb3ab5753e
130
components/tabbar/VNavigationBar.vue
Normal file
130
components/tabbar/VNavigationBar.vue
Normal file
@ -0,0 +1,130 @@
|
||||
<template>
|
||||
<!-- header -->
|
||||
<view :style="{ backgroundColor, paddingTop: homeHeaderPaddingTop + 'px', height: homeHeaderMenuHeight + 'px' }"
|
||||
class="navigationBar" :class="{leftTitle: leftTitle}">
|
||||
<template v-if="leftTitle">
|
||||
<view class="navigationBarTitle" :style="{ color: titleColor }">
|
||||
{{ title ? title : '' }}
|
||||
</view>
|
||||
</template>
|
||||
<template v-else>
|
||||
<view class="navigationBarBack" @click="back" >
|
||||
<slot name="back">
|
||||
<uni-icons size="24" type="left"
|
||||
:color="titleColor"></uni-icons>
|
||||
</slot>
|
||||
</view>
|
||||
<view class="navigationBarTitle" :style="{ color: titleColor }">
|
||||
{{ title }}
|
||||
</view>
|
||||
<view v-if="showClear" @click="clearNoReadFun" class="navigationBarIcon" :style="{ color: titleColor }">
|
||||
<image src="@/static/imgs/clear.png" mode="" class="clear-icon"></image>
|
||||
</view>
|
||||
</template>
|
||||
<view class="navigationBarBackExtra">
|
||||
<slot name="extra">
|
||||
</slot>
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
/* 计算标题位置 */
|
||||
import {
|
||||
getWXStatusHeight
|
||||
} from "@/utils/utils";
|
||||
|
||||
export default {
|
||||
props: {
|
||||
backgroundColor: {
|
||||
type: String,
|
||||
default: '#317DFA'
|
||||
},
|
||||
title: String,
|
||||
titleColor: {
|
||||
type: String,
|
||||
default: '#fff'
|
||||
},
|
||||
leftTitle: {
|
||||
type: Boolean,
|
||||
default: false
|
||||
},
|
||||
showClear: {
|
||||
type: Boolean,
|
||||
default: false
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
// #ifdef MP
|
||||
const {
|
||||
barHeight,
|
||||
barTop,
|
||||
menuButtonLeft
|
||||
} = getWXStatusHeight()
|
||||
console.log('barHeight, barTop, menuButtonLeft: ', barHeight, barTop, menuButtonLeft);
|
||||
this.homeHeaderPaddingTop = barTop || 0
|
||||
this.homeHeaderMenuHeight = barHeight
|
||||
this.homeHeaderMenuLeft = menuButtonLeft - 6
|
||||
// #endif
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
// #ifdef MP
|
||||
homeHeaderPaddingTop: 0,
|
||||
homeHeaderMenuHeight: 0,
|
||||
homeHeaderMenuLeft: 0,
|
||||
// #endif
|
||||
// #ifdef APP || H5
|
||||
homeHeaderPaddingTop: 20,
|
||||
homeHeaderMenuHeight: 50,
|
||||
homeHeaderMenuLeft: 0
|
||||
// #endif
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
back() {
|
||||
uni.navigateBack()
|
||||
},
|
||||
clearNoReadFun(){
|
||||
this.$emit('clearNoRead')
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
.navigationBar {
|
||||
position: relative;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
|
||||
&.leftTitle {
|
||||
justify-content: start;
|
||||
padding-left: 28rpx;
|
||||
}
|
||||
|
||||
.navigationBarBack {
|
||||
position: absolute;
|
||||
left: 20rpx;
|
||||
}
|
||||
|
||||
.navigationBarBackExtra {
|
||||
position: absolute;
|
||||
right: 20rpx;
|
||||
}
|
||||
|
||||
.navigationBarTitle {
|
||||
font-size: 36rpx;
|
||||
font-weight: bold;
|
||||
}
|
||||
.navigationBarIcon {
|
||||
display: flex;
|
||||
}
|
||||
.clear-icon{
|
||||
width: 40rpx;
|
||||
height: 40rpx;
|
||||
border-radius: 50%;
|
||||
}
|
||||
}
|
||||
</style>
|
@ -154,7 +154,6 @@
|
||||
},
|
||||
tenantIdFlag: false
|
||||
}).then(res => {
|
||||
console.log('获取预约列表', res)
|
||||
if (this.pageNo === 1) {
|
||||
this.total = res.data.total
|
||||
this.appointmentList = []
|
||||
@ -176,7 +175,6 @@
|
||||
},
|
||||
tenantIdFlag: false
|
||||
}).then(res => {
|
||||
console.log('获取预约列表', res)
|
||||
if (this.pageNo === 1) {
|
||||
this.total = res.data.total
|
||||
this.appointmentList = []
|
||||
|
@ -135,7 +135,6 @@ export default {
|
||||
async onLoad() {
|
||||
this.getLoginUserCourseInfoList()
|
||||
this.timeColumns = await getDictDataByType('school_reserv_time');
|
||||
console.log('字典', this.timeColumns)
|
||||
},
|
||||
onReady() {
|
||||
//如果需要兼容微信小程序,并且校验规则中含有方法等,只能通过setRules方法设置规则。
|
||||
@ -154,19 +153,14 @@ export default {
|
||||
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() {
|
||||
@ -203,7 +197,6 @@ export default {
|
||||
},
|
||||
//根据课程id查询报名进度
|
||||
async getAllByCourseId(courseId) {
|
||||
console.log('courseId', courseId)
|
||||
const res = await request({
|
||||
url: '/app-api/process/getAllByCourseId',
|
||||
method: 'GET',
|
||||
@ -217,7 +210,6 @@ export default {
|
||||
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(() => {
|
||||
@ -227,7 +219,6 @@ export default {
|
||||
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({
|
||||
|
@ -78,13 +78,11 @@ export default {
|
||||
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() {
|
||||
@ -98,9 +96,6 @@ export default {
|
||||
tenantIdFlag: false,
|
||||
});
|
||||
|
||||
console.log("获取所有训练时间", res);
|
||||
console.log("当前科目:", this.appointmentInfo.subject);
|
||||
|
||||
// 确保 appointmentInfo.subject 已有值
|
||||
if (!this.appointmentInfo.subject) {
|
||||
console.warn("appointmentInfo.subject 为空,等待赋值...");
|
||||
@ -110,14 +105,8 @@ export default {
|
||||
(item) => item.subject == this.appointmentInfo.subject
|
||||
);
|
||||
|
||||
console.log("匹配的训练时间数据:", data);
|
||||
|
||||
this.appointmentInfo.trainTime = data ? data.trainTime || "0" : "0";
|
||||
|
||||
console.log(
|
||||
"this.appointmentInfo.trainTime",
|
||||
this.appointmentInfo.trainTime
|
||||
);
|
||||
} catch (error) {
|
||||
console.error("获取训练时间失败:", error);
|
||||
}
|
||||
|
@ -195,11 +195,13 @@
|
||||
.text-wrapper_2 {
|
||||
background-color: rgba(223, 235, 255, 1);
|
||||
border-radius: 2px;
|
||||
height: 36rpx;
|
||||
width: 92rpx;
|
||||
/* height: 36rpx;
|
||||
width: 92rpx; */
|
||||
padding: 0 5rpx 0 5rpx;
|
||||
.text_7 {
|
||||
width: 72rpx;
|
||||
height: 24rpx;
|
||||
/* width: 72rpx;
|
||||
height: 24rpx; */
|
||||
|
||||
overflow-wrap: break-word;
|
||||
color: rgba(44, 120, 245, 1);
|
||||
font-size: 24rpx;
|
||||
@ -208,17 +210,20 @@
|
||||
text-align: left;
|
||||
white-space: nowrap;
|
||||
line-height: 24rpx;
|
||||
margin: 6rpx 0 0 10rpx;
|
||||
margin: 6rpx 10rpx 0 10rpx;
|
||||
}
|
||||
}
|
||||
.text-wrapper_3 {
|
||||
background-color: rgba(255, 239, 229, 1);
|
||||
border-radius: 2px;
|
||||
height: 36rpx;
|
||||
width: 52rpx;
|
||||
/* height: 36rpx;
|
||||
width: 52rpx; */
|
||||
margin-left: 10rpx;
|
||||
padding: 0 5rpx;
|
||||
.text_8 {
|
||||
width: 32rpx;
|
||||
height: 24rpx;
|
||||
/* width: 32rpx;
|
||||
height: 24rpx; */
|
||||
|
||||
overflow-wrap: break-word;
|
||||
color: rgba(123, 81, 11, 1);
|
||||
font-size: 24rpx;
|
||||
@ -227,7 +232,7 @@
|
||||
text-align: left;
|
||||
white-space: nowrap;
|
||||
line-height: 24rpx;
|
||||
margin: 6rpx 0 0 10rpx;
|
||||
margin: 6rpx 10rpx 0 10rpx;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -82,11 +82,9 @@ export default {
|
||||
onLoad(options) {
|
||||
this.courseId = options.courseId;
|
||||
this.tenantId = options.tenantId;
|
||||
console.log(options)
|
||||
this.getCourseDetails();
|
||||
this.userDetails = getLocalUserInfo();
|
||||
this.getServicePhone()
|
||||
console.log('123123', this.userDetails)
|
||||
},
|
||||
methods: {
|
||||
goBack() {
|
||||
@ -105,8 +103,6 @@ export default {
|
||||
tenantIdFlag: false
|
||||
}).then(res => {
|
||||
this.courseDetails = res.data;
|
||||
|
||||
console.log('驾校课程列表', this.schoolAllClassList);
|
||||
})
|
||||
},
|
||||
zxkf() {
|
||||
@ -123,9 +119,6 @@ export default {
|
||||
}
|
||||
}).then(res => {
|
||||
this.driveSchoolPhone = res.data
|
||||
console.log('客服电话res', res)
|
||||
console.log('客服电话1', this.driveSchoolPhone)
|
||||
console.log('客服电话2', this.driveSchoolPhone.phone)
|
||||
})
|
||||
},
|
||||
|
||||
|
@ -62,8 +62,6 @@ export default {
|
||||
onLoad(options) {
|
||||
if (options.tenantId) {
|
||||
this.tenantId = options.tenantId
|
||||
console.log("首页传入数据", options)
|
||||
console.log("驾校租户id", this.tenantId)
|
||||
this.getSchoolAllClass()
|
||||
}
|
||||
},
|
||||
@ -88,7 +86,6 @@ export default {
|
||||
}).then(res => {
|
||||
this.schoolAllClassList = res.data;
|
||||
this.total = res.data.total;
|
||||
console.log('驾校课程列表', this.schoolAllClassList);
|
||||
})
|
||||
},
|
||||
|
||||
|
@ -33,7 +33,8 @@
|
||||
}
|
||||
.group_4 {
|
||||
width: 750rpx;
|
||||
height: 1534rpx;
|
||||
// height: 1534rpx;
|
||||
height: 100%;
|
||||
margin-bottom: 2rpx;
|
||||
.group_5 {
|
||||
background-color: rgba(255, 255, 255, 1);
|
||||
@ -93,9 +94,8 @@
|
||||
}
|
||||
.list_1 {
|
||||
width: 686rpx;
|
||||
height: 464rpx;
|
||||
justify-content: space-between;
|
||||
margin: 20rpx 0 954rpx 32rpx;
|
||||
justify-content: center;
|
||||
margin: 20rpx 0 0 32rpx;
|
||||
.list-items_1 {
|
||||
background-color: rgba(255, 255, 255, 1);
|
||||
border-radius: 8px;
|
||||
|
@ -9,7 +9,7 @@
|
||||
<view class="list_1 flex-col" v-if="evaluate.length > 0">
|
||||
<scroll-view
|
||||
:style="{ height: scrollHeight + 'px' }"
|
||||
scroll-y="true" class="itemContent"
|
||||
scroll-y="true" class="scroll-view"
|
||||
@scrolltolower="onReachBottomCus" refresher-enabled @refresherrefresh="onRefresherrefresh"
|
||||
:refresher-triggered="isTriggered">
|
||||
<view class="list-items_1 flex-col" v-for="(item, index) in evaluate" :key="index"
|
||||
@ -96,6 +96,7 @@ export default {
|
||||
// 动态计算滚动区域高度
|
||||
this.calculateScrollHeight();
|
||||
},
|
||||
|
||||
methods: {
|
||||
getList() {
|
||||
request({
|
||||
@ -107,7 +108,6 @@ export default {
|
||||
pageSize: this.pageSize
|
||||
}
|
||||
}).then(res => {
|
||||
console.log(res)
|
||||
this.total = res.data.total
|
||||
if (this.pageNo == 1) {
|
||||
this.evaluate = res.data.records
|
||||
@ -139,7 +139,7 @@ export default {
|
||||
// 获取屏幕高度
|
||||
const screenHeight = uni.getSystemInfoSync().windowHeight;
|
||||
// 获取顶部区域高度
|
||||
const topHeight = 160;
|
||||
const topHeight = 120;
|
||||
// 计算滚动区域高度
|
||||
this.scrollHeight = screenHeight - topHeight;
|
||||
},
|
||||
@ -185,4 +185,9 @@ export default {
|
||||
text-overflow: ellipsis;
|
||||
}
|
||||
|
||||
.itemContent {
|
||||
height: 100% !important; /* 确保高度生效 */
|
||||
flex: 1; /* 填充剩余空间 */
|
||||
}
|
||||
|
||||
</style>
|
||||
|
@ -93,7 +93,6 @@
|
||||
},
|
||||
onLoad(options) {
|
||||
const data = JSON.parse(options.data);
|
||||
console.log('穿进来的数据');
|
||||
// 判断新增还是查看
|
||||
if (options.controls) {
|
||||
this.show = true
|
||||
@ -121,8 +120,6 @@
|
||||
} else {
|
||||
Object.assign(this.info, data);
|
||||
}
|
||||
|
||||
console.log(this.info)
|
||||
},
|
||||
methods: {
|
||||
changeRate() {},
|
||||
|
@ -164,7 +164,6 @@ export default {
|
||||
},
|
||||
onLoad(options) {
|
||||
this.userInfo = getLocalUserInfo()
|
||||
console.log('userInfo', this.userInfo)
|
||||
this.getUserOrderDetails()
|
||||
this.process.subject = options.subject
|
||||
this.opTenantId = options.tenantId
|
||||
@ -180,8 +179,6 @@ export default {
|
||||
this.process.userId = this.userInfo.id
|
||||
this.process.coachId = options.coachId
|
||||
this.process.userName = options.nickname
|
||||
console.log('options', options)
|
||||
console.log('batchItemId', this.batchItemId)
|
||||
},
|
||||
computed: {
|
||||
displayFileList() {
|
||||
@ -209,8 +206,6 @@ export default {
|
||||
});
|
||||
},
|
||||
ifPassOnConfirm(value) {
|
||||
console.log('选中的值:', value);
|
||||
|
||||
const statusMap = {
|
||||
'已通过': 1,
|
||||
'未通过': 0
|
||||
@ -218,17 +213,11 @@ export default {
|
||||
|
||||
// 更新数据
|
||||
this.process.examStatus = statusMap[value.value[0]];
|
||||
console.log('value[0]', value.value[0])
|
||||
this.selectedValue = value.value[0];
|
||||
this.show = false;
|
||||
|
||||
console.log('examStatus:', this.process.examStatus);
|
||||
console.log('process', this.process)
|
||||
},
|
||||
|
||||
subjectOnConfirm(value) {
|
||||
console.log('选中的值:', value);
|
||||
|
||||
const statusMap = {
|
||||
'科目一': 1,
|
||||
'科目四': 4
|
||||
@ -236,16 +225,11 @@ export default {
|
||||
|
||||
// 更新数据
|
||||
this.process.subject = statusMap[value.value[0]];
|
||||
console.log('value[0]', value.value[0])
|
||||
this.subjectValue = value.value[0];
|
||||
this.subjectShow = false;
|
||||
|
||||
console.log('subject:', this.process.subject);
|
||||
console.log('process', this.process)
|
||||
},
|
||||
|
||||
onConfirmExamTime(value) {
|
||||
console.log("选中的时间:", value);
|
||||
this.process.examTime = value;
|
||||
this.showTimePicker = false;
|
||||
},
|
||||
@ -292,7 +276,6 @@ export default {
|
||||
}
|
||||
},
|
||||
uploadFilePromise(filePath) {
|
||||
console.log('图片地址', filePath)
|
||||
return new Promise((resolve, reject) => {
|
||||
upload({
|
||||
url: '/app-api/small-upload/common/upload',
|
||||
@ -300,8 +283,6 @@ export default {
|
||||
}).then((res) => {
|
||||
if (res.data && res.data.url) {
|
||||
resolve(res.data.url);
|
||||
console.log('返回', res)
|
||||
console.log('返回url', res.data.url)
|
||||
} else {
|
||||
reject(new Error('上传失败'));
|
||||
}
|
||||
@ -321,7 +302,6 @@ export default {
|
||||
tenantIdFlag: false
|
||||
}).then(res => {
|
||||
this.orderList = res.data.records;
|
||||
console.log('订单信息', res.data)
|
||||
if (res.data.records.length > 0) {
|
||||
const tempData = res.data.records[0]
|
||||
if (this.process.subject != 2 && this.process.subject != 3) {
|
||||
@ -339,8 +319,6 @@ export default {
|
||||
},
|
||||
|
||||
getCourseCompleteStatus() {
|
||||
console.log('userId', this.userId)
|
||||
console.log('courseId', this.process.courseId)
|
||||
request({
|
||||
url: '/app-api/process/page',
|
||||
method: 'GET',
|
||||
@ -350,17 +328,11 @@ export default {
|
||||
}
|
||||
}).then(res => {
|
||||
this.courseCompleteStatusList = res.data.records
|
||||
console.log('res.data', res.data)
|
||||
if (this.courseCompleteStatusList.length > 0) {
|
||||
console.log('courseCompleteStatusList', this.courseCompleteStatusList)
|
||||
const subject2 = this.courseCompleteStatusList.find(item => item.subject === 2)
|
||||
const subject3 = this.courseCompleteStatusList.find(item => item.subject === 3)
|
||||
console.log('subject2', subject2)
|
||||
console.log('subject3', subject3)
|
||||
console.log(subject2?.status === '2' && subject3?.status === '2')
|
||||
|
||||
if (subject2?.status === '2' && subject3?.status === '2') {
|
||||
console.log(subject2?.status === 2 && subject3?.status === 2)
|
||||
this.subjectColumns = [['科目一', '科目四']]
|
||||
}
|
||||
}
|
||||
@ -381,20 +353,16 @@ export default {
|
||||
},
|
||||
saveDataOne() {
|
||||
if (this.process.subject === 1 && this.courseCompleteStatusList.length <= 0) {
|
||||
console.log('this.courseCompleteStatusList', this.courseCompleteStatusList)
|
||||
uni.showToast({title: '请联系驾校人员', icon: 'none'});
|
||||
return;
|
||||
|
||||
}
|
||||
if (this.process.subject === 4 && this.courseCompleteStatusList.length <= 0) {
|
||||
|
||||
uni.showToast({title: '请联系驾校人员', icon: 'none'});
|
||||
return;
|
||||
|
||||
}
|
||||
console.log('courseCompleteStatusList', this.courseCompleteStatusList.length)
|
||||
this.process.images = this.fileList?.map(item => item.url).join(',') || '';
|
||||
console.log('process', this.process)
|
||||
|
||||
if (!this.process.userId || !this.process.subject || !this.process.examScore || !this.process.examStatus || !this.process.examTime) {
|
||||
uni.showToast({title: '信息填写不完整', icon: 'none'});
|
||||
@ -432,8 +400,6 @@ export default {
|
||||
remark: this.process.remark,
|
||||
images: this.fileList?.map(item => item.url).join(',') || '',
|
||||
}
|
||||
|
||||
console.log('提交数据是:', postData)
|
||||
/* this.process.userId = this.userInfo.id
|
||||
this.process.tenantId = this.opTenantId
|
||||
this.process.fraction = this.process.examScore
|
||||
|
@ -48,45 +48,12 @@
|
||||
</view>
|
||||
<view class="block_5 flex-row" v-if="(item.subject == 2 || item.subject == 3) && getButtonInfo(item).text !== '1'">
|
||||
<view class="text-wrapper_4 flex-col" @click="handleButtonClick(item)" >
|
||||
<!-- <text class="text_10" v-if="item.fraction != null && item.ifPass">开始评价</text>
|
||||
<text class="text_10" v-else-if="item.fraction == null && (item.ifPass == null || item.ifPass == 0)">成绩录入</text>
|
||||
<text class="text_10" v-else-if="!item.ifEvaluate">查看评价</text> -->
|
||||
|
||||
<text class="text_10">{{ getButtonInfo(item).text }}</text>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<!-- <view class="list_1 flex-col">
|
||||
<view class="list-items_1 flex-col" v-for="(item, index) in examList" :key="index" >
|
||||
<view class="block_6 flex-row justify-between">
|
||||
<view class="text-group_3 flex-col justify-between">
|
||||
<text class="text_11" >{{ formatDate(item.examTime) }}</text>
|
||||
<text class="text_12" >{{item.courseName}}</text>
|
||||
</view>
|
||||
<view class="text-group_4 flex-col justify-between">
|
||||
<text
|
||||
class="text_13"
|
||||
:style="{ color: item.examScore }"
|
||||
>{{item.examScore}}</text>
|
||||
<text
|
||||
class="text_14"
|
||||
:style="{ color: item.examStatus }"
|
||||
>{{ getStatusText(item.examStatus) }}</text>
|
||||
</view>
|
||||
</view>
|
||||
<view class="block_7 flex-row justify-between">
|
||||
<view class="text-wrapper_5 flex-col">
|
||||
<text class="text_15" >{{getCourseTypeText(item.subject)}}</text>
|
||||
</view>
|
||||
<view class="text-wrapper_6 flex-col">
|
||||
<text class="text_16" >{{item.courseType}}</text>
|
||||
</view>
|
||||
</view>
|
||||
<view class="text-wrapper_7 flex-row justify-between">
|
||||
<text class="text_17" >考试地址:</text>
|
||||
<text class="text_18" >山东省济南市历下区</text>
|
||||
</view>
|
||||
</view>
|
||||
</view> -->
|
||||
|
||||
</scroll-view>
|
||||
</view>
|
||||
</view>
|
||||
@ -185,6 +152,7 @@ export default {
|
||||
|
||||
},
|
||||
|
||||
// 点击笔试成绩录入的时候 检查是否已报名课程
|
||||
onEnterScoreClick() {
|
||||
if (this.courseList.length > 0) {
|
||||
this.pickerColumns = this.courseList.map(item => ({
|
||||
@ -193,21 +161,17 @@ export default {
|
||||
}));
|
||||
this.pickerShow = true;
|
||||
} else if (this.courseList.length === 1) {
|
||||
console.log('1231231',this.courseList[0])
|
||||
this.goToScoreEntry(this.courseList[0]);
|
||||
} else {
|
||||
this.$u.toast("暂无课程信息");
|
||||
}
|
||||
},
|
||||
|
||||
// 选择课程后检查是否有课程进度信息
|
||||
onPickerConfirm(e) {
|
||||
const selectedCourseId = e.value[0];
|
||||
const selectedCourse = this.courseList.find(item => item.courseId === selectedCourseId.value);
|
||||
|
||||
console.log('courseList', this.courseList);
|
||||
console.log('selectedCourseId', selectedCourseId);
|
||||
console.log('selectedCourse', selectedCourse);
|
||||
|
||||
if (selectedCourse) {
|
||||
this.getProcess(selectedCourse.courseId).then(processData => {
|
||||
if (!processData || processData.length === 0) {
|
||||
@ -224,7 +188,6 @@ export default {
|
||||
);
|
||||
|
||||
if (hasSubject1Or4) {
|
||||
console.log('selectedCourse', this.selectedCourse)
|
||||
this.goToScoreEntry(selectedCourse);
|
||||
} else {
|
||||
uni.showToast({
|
||||
@ -238,8 +201,8 @@ export default {
|
||||
this.pickerShow = false;
|
||||
},
|
||||
|
||||
// 跳转成绩录入界面
|
||||
goToScoreEntry(course) {
|
||||
console.log('course', course)
|
||||
this.$u.route({
|
||||
url: '/newPages/examinationAdd/index',
|
||||
params: {
|
||||
@ -252,6 +215,7 @@ export default {
|
||||
});
|
||||
},
|
||||
|
||||
// 获取课程进度
|
||||
getProcess(courseId) {
|
||||
return new Promise((resolve, reject) => {
|
||||
request({
|
||||
@ -262,7 +226,6 @@ export default {
|
||||
courseId: courseId,
|
||||
}
|
||||
}).then(res => {
|
||||
console.log('res123', res);
|
||||
this.processList = res.data;
|
||||
resolve(res.data);
|
||||
}).catch(err => {
|
||||
@ -272,6 +235,7 @@ export default {
|
||||
});
|
||||
},
|
||||
|
||||
// 获取考试信息
|
||||
getExamList() {
|
||||
request({
|
||||
url: '/app-api/process/getExamListByUserId',
|
||||
@ -281,13 +245,11 @@ export default {
|
||||
}
|
||||
}).then(res => {
|
||||
this.examList = res.data
|
||||
this.getExamTwoList()
|
||||
console.log('examList', this.examList)
|
||||
console.log('res', res)
|
||||
// this.getExamTwoList()
|
||||
this.isTriggered = false
|
||||
})
|
||||
},
|
||||
getExamTwoList() {
|
||||
/* getExamTwoList() {
|
||||
request({
|
||||
url: '/app-api/examBatch/selectExamByUserIdAndCoachId',
|
||||
method: 'GET',
|
||||
@ -299,16 +261,19 @@ export default {
|
||||
console.log('examTwoList', this.examTwoList)
|
||||
console.log('resTwo', res)
|
||||
})
|
||||
},
|
||||
}, */
|
||||
|
||||
// 获取课程信息
|
||||
getCourseList() {
|
||||
request({
|
||||
url: '/app-api/small/drive/school-course-order/getCourseByLoginUser',
|
||||
method: 'GET'
|
||||
}).then(res => {
|
||||
this.courseList = res.data
|
||||
console.log('res111', res)
|
||||
})
|
||||
},
|
||||
|
||||
// 转换考试状态
|
||||
getStatusText(status) {
|
||||
const statusMap = {
|
||||
0: '未通过',
|
||||
@ -321,7 +286,7 @@ export default {
|
||||
return statusMap[status] || '未知状态';
|
||||
},
|
||||
|
||||
|
||||
// 转换科目
|
||||
getCourseTypeText(status) {
|
||||
const statusMap = {
|
||||
'1': '科目一',
|
||||
@ -331,6 +296,8 @@ export default {
|
||||
};
|
||||
return statusMap[status] || '未知状态';
|
||||
},
|
||||
|
||||
// 格式化时间
|
||||
formatDate(timestamp) {
|
||||
const date = new Date(timestamp);
|
||||
const year = date.getFullYear();
|
||||
@ -348,8 +315,8 @@ export default {
|
||||
this.scrollHeight = screenHeight - topHeight;
|
||||
},
|
||||
|
||||
|
||||
getButtonInfo(item) {
|
||||
console.log('item', item)
|
||||
if (item.fraction == null) {
|
||||
return {text: '成绩录入', type: 'input'}
|
||||
} else if (!item.ifPass) {
|
||||
@ -364,6 +331,7 @@ export default {
|
||||
// }
|
||||
},
|
||||
|
||||
//
|
||||
handleButtonClick(item) {
|
||||
const buttonInfo = this.getButtonInfo(item)
|
||||
|
||||
|
@ -24,7 +24,7 @@
|
||||
:maxCount="1"
|
||||
width="70rpx"
|
||||
height="70rpx"
|
||||
border-radius="50%"
|
||||
|
||||
>
|
||||
<!-- <image
|
||||
class="label_2"
|
||||
@ -186,8 +186,6 @@ export default {
|
||||
this.usersMsg = getLocalUserInfo()
|
||||
this.userId = option.userId;
|
||||
this.userDetails.userId = option.userId;
|
||||
console.log('option', option)
|
||||
console.log('userId', this.userId)
|
||||
this.getUserInfo()
|
||||
},
|
||||
methods: {
|
||||
@ -198,68 +196,14 @@ export default {
|
||||
},
|
||||
|
||||
|
||||
/* getUserInfo() {
|
||||
request({
|
||||
url: '/app-api/small/dl-drive-school-student/getByUserId',
|
||||
method: 'GET',
|
||||
params: { userId: this.userId }
|
||||
}).then(res => {
|
||||
if(!res.data){
|
||||
this.noN = false
|
||||
this.userDetails.name = this.usersMsg.nickname
|
||||
this.userDetails.phone = this.usersMsg.username
|
||||
this.userDetails.avatar = this.usersMsg.avatar
|
||||
console.log('userDetails',this.userDetails)
|
||||
if (this.usersMsg.avatar) {
|
||||
this.avatarList = [{
|
||||
url: `${this.imageUrl}/${this.usersMsg.avatar}`,
|
||||
fileName: this.usersMsg.avatar
|
||||
}]
|
||||
}
|
||||
return
|
||||
}
|
||||
this.userDetails = { ...res.data }
|
||||
console.log('userDetailsRes', res)
|
||||
console.log('userDetails',this.userDetails)
|
||||
|
||||
// 初始化头像
|
||||
if (res.data.avatar) {
|
||||
this.avatarList = [{
|
||||
url: `${this.imageUrl}/${res.data.avatar}`,
|
||||
fileName: res.data.avatar
|
||||
}]
|
||||
}
|
||||
|
||||
// 初始化身份证照片
|
||||
this.idCardfileList = res.data.idPhoto
|
||||
? res.data.idPhoto.split(',')
|
||||
.filter(url => url.trim())
|
||||
.map(url => ({
|
||||
url: `${this.imageUrl}/${url.trim()}`,
|
||||
fileName: url.trim()
|
||||
}))
|
||||
: []
|
||||
|
||||
// 初始化生活照
|
||||
this.lifePhotoFileList = res.data.lifePhoto
|
||||
? res.data.lifePhoto.split(',')
|
||||
.filter(url => url.trim())
|
||||
.map(url => ({
|
||||
url: `${this.imageUrl}/${url.trim()}`,
|
||||
fileName: url.trim()
|
||||
}))
|
||||
: []
|
||||
})
|
||||
}, */
|
||||
getUserInfo() {
|
||||
console.log('123',this.userId)
|
||||
request({
|
||||
url: '/app-api/small/dl-drive-school-student/getByUserId',
|
||||
method: 'GET',
|
||||
params: { userId: this.userId }
|
||||
}).then(res => {
|
||||
if (!res.data) {
|
||||
console.log('1')
|
||||
this.noN = false;
|
||||
this.userDetails = {
|
||||
name: this.usersMsg.nickname,
|
||||
@ -350,14 +294,12 @@ export default {
|
||||
)
|
||||
).then(newFiles => {
|
||||
this.idCardfileList = [...this.idCardfileList, ...newFiles];
|
||||
console.log('idCardFileListAdd', this.idCardfileList)
|
||||
});
|
||||
},
|
||||
|
||||
// 身份证照片删除
|
||||
idCardDelete(event) {
|
||||
this.idCardfileList.splice(event.index, 1)
|
||||
console.log('idCardFileListDel', this.idCardfileList)
|
||||
},
|
||||
|
||||
|
||||
@ -400,7 +342,6 @@ export default {
|
||||
url: '/app-api/small/drive/school-course-order/getCourseByLoginUser',
|
||||
method: 'GET',
|
||||
}).then(res => {
|
||||
console.log('111',res.data)
|
||||
if(res.data === null){
|
||||
// this.insertSchoolStudent()
|
||||
}
|
||||
@ -416,9 +357,6 @@ export default {
|
||||
this.updateSysUsersNickName()
|
||||
},
|
||||
updateSysUsersNickName(name, userId,avatar) {
|
||||
console.log(name)
|
||||
console.log(userId)
|
||||
console.log(avatar)
|
||||
request({
|
||||
url: '/app-api/system/user/update',
|
||||
method: 'PUT',
|
||||
@ -452,7 +390,6 @@ export default {
|
||||
idPhoto: this.idCardfileList.map(item => item.fileName).join(','),
|
||||
lifePhoto: this.lifePhotoFileList.map(item => item.fileName).join(',')
|
||||
}
|
||||
console.log('submitData2', submitData)
|
||||
this.updateSysUsersNickName(submitData.name, submitData.userId, submitData.avatar)
|
||||
|
||||
request({
|
||||
|
@ -127,8 +127,6 @@ export default {
|
||||
},
|
||||
onLoad(option) {
|
||||
this.userId = option.userId;
|
||||
console.log('option', option)
|
||||
console.log('userId', this.userId)
|
||||
this.getUserInfo()
|
||||
},
|
||||
methods: {
|
||||
@ -153,8 +151,6 @@ export default {
|
||||
status: 'success'
|
||||
}]
|
||||
}
|
||||
console.log('res.data', res.data);
|
||||
console.log('userDetails', this.userDetails);
|
||||
})
|
||||
},
|
||||
|
||||
|
260
newPages/messageCenter/index.vue
Normal file
260
newPages/messageCenter/index.vue
Normal file
@ -0,0 +1,260 @@
|
||||
<template>
|
||||
<view class="container">
|
||||
<VNavigationBar background-color="#fff" title-color="#333" title="消息中心" :showClear="showClear" @clearNoRead="clearNoReadFun"></VNavigationBar>
|
||||
<view class="body">
|
||||
<view class="messageList">
|
||||
<scroll-view style="height: 100%;" scroll-y="true" class="itemContent" @scrolltolower="onReachBottomCus"
|
||||
refresher-enabled @refresherrefresh="onRefresherrefresh" :refresher-triggered="isTriggered">
|
||||
<view v-for="(item, index) in messageList" :key="index" class="messageItem" @click="readNotice(item)">
|
||||
<image class="messageIcon" src="@/static/imgs/message-icon1.png" mode="aspectFit"></image>
|
||||
<view class="messageContent">
|
||||
<view :class="{'messageTitle':item.readStatus,'noReadTitle':!item.readStatus}" >系统通知</view>
|
||||
<view class="messageContent_content">{{item.templateContent}}</view>
|
||||
<view class="messageContent_content" style="text-align: right">{{formatTime(item.createTime)}}</view>
|
||||
</view>
|
||||
</view>
|
||||
<view style="text-align: center" v-if="messageList.length==0">
|
||||
<image class="" src="@/static/imgs/nothing.png"></image>
|
||||
</view>
|
||||
</scroll-view>
|
||||
</view>
|
||||
</view>
|
||||
<!-- 普通弹窗 -->
|
||||
<uni-popup ref="popup" background-color="#fff" >
|
||||
<view class="popup-content" :class="{ 'popup-height': type === 'left' || type === 'right' }">
|
||||
<text class="text popup-content-text">{{ nowReadItem.templateContent }}</text>
|
||||
<button class="button popup-info" @click="dialogToggle"><text
|
||||
class="button-text info-text">知道了</text></button>
|
||||
</view>
|
||||
</uni-popup>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import VNavigationBar from '@/components/tabbar/VNavigationBar.vue'
|
||||
import request from '@/utils/request.js'
|
||||
// import {formatTimestamp} from "@/utils/utils";
|
||||
|
||||
export default {
|
||||
components: {
|
||||
VNavigationBar,
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
type:"center",
|
||||
messageList: [],
|
||||
pageNo: 1,
|
||||
pageSize: 15,
|
||||
total: 0,
|
||||
//下来刷新状态
|
||||
isTriggered:false,
|
||||
//是否显示一键清空
|
||||
showClear:true,
|
||||
nowReadItem:{},
|
||||
systemCode: 'jiaxiao',
|
||||
};
|
||||
},
|
||||
onLoad(){
|
||||
|
||||
},
|
||||
onShow(){
|
||||
this.getList()
|
||||
},
|
||||
methods:{
|
||||
/**
|
||||
* 点击阅读消息
|
||||
*/
|
||||
async readNotice(item) {
|
||||
this.nowReadItem = item
|
||||
// open 方法传入参数 等同在 uni-popup 组件上绑定 type属性
|
||||
this.$refs.popup.open(this.type)
|
||||
//直接请求后台已读
|
||||
await request({
|
||||
url: "/app-api/system/notify-message/update-read",
|
||||
method: "PUT",
|
||||
params:{ids:this.nowReadItem.id},
|
||||
tenantIdFlag:false
|
||||
}).then((res) => {
|
||||
if(res.code==200){
|
||||
this.onRefresherrefresh()
|
||||
}
|
||||
})
|
||||
},
|
||||
/**
|
||||
* 消息设置为已读
|
||||
*/
|
||||
dialogToggle(){
|
||||
this.$refs.popup.close()
|
||||
},
|
||||
/**
|
||||
* 一键清空未读消息
|
||||
*/
|
||||
async clearNoReadFun(){
|
||||
console.log("清空了")
|
||||
await request({
|
||||
url: "/app-api/system/notify-message/update-all-read",
|
||||
method: "PUT",
|
||||
tenantIdFlag:false
|
||||
}).then((res) => {
|
||||
if(res.code==200){
|
||||
uni.showToast({
|
||||
title: '操作成功',
|
||||
icon: 'none'
|
||||
})
|
||||
setTimeout(()=>{
|
||||
this.onRefresherrefresh()
|
||||
},500)
|
||||
}
|
||||
})
|
||||
},
|
||||
formatTime(value){
|
||||
// 将时间戳转换为Date对象
|
||||
const date = new Date(value);
|
||||
// 获取年月日时分秒
|
||||
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');
|
||||
const seconds = date.getSeconds().toString().padStart(2, '0');
|
||||
// 组合成日期时间字符串
|
||||
return `${year}-${month}-${day} ${hours}:${minutes}:${seconds}`;
|
||||
},
|
||||
/**
|
||||
* 上滑加载数据
|
||||
*/
|
||||
onReachBottomCus() {
|
||||
//判断 如果页码*页容量大于等于总条数,提示该页数据加载完毕
|
||||
if (this.pageNo * this.pageSize >= this.total) {
|
||||
uni.$u.toast('没有更多数据了')
|
||||
return
|
||||
}
|
||||
//页码+1,调用获取数据的方法获取第二页数据
|
||||
this.pageNo++
|
||||
//此处调用自己获取数据列表的方法
|
||||
this.getList()
|
||||
},
|
||||
/**
|
||||
* 下拉刷新数据
|
||||
*/
|
||||
onRefresherrefresh(){
|
||||
this.isTriggered = true
|
||||
this.pageNo = 1
|
||||
this.total = 0
|
||||
this.messageList = []
|
||||
this.getList()
|
||||
},
|
||||
/**
|
||||
* 分页查询
|
||||
*/
|
||||
async getList(){
|
||||
await request({
|
||||
url: "/app-api/system/notify-message/my-page",
|
||||
method: "GET",
|
||||
params:{
|
||||
pageNo:this.pageNo,
|
||||
pageSize:this.pageSize
|
||||
},
|
||||
tenantIdFlag:false
|
||||
}).then((res) => {
|
||||
//判断 如果获取的数据的页码不是第一页,就让之前赋值获取过的数组数据 concat连接 刚获取的第n页数据
|
||||
if (this.pageNo != 1) {
|
||||
this.messageList = this.messageList.concat(res.data.list)
|
||||
} else {
|
||||
this.messageList = res.data.list
|
||||
}
|
||||
//将获取的总条数赋值
|
||||
this.total = res.data.total
|
||||
this.isTriggered = false
|
||||
})
|
||||
},
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="less" scoped>
|
||||
.container {
|
||||
height: 100%;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
.body {
|
||||
flex: 1;
|
||||
height: calc(100vh - env(safe-area-inset-top));
|
||||
overflow: auto;
|
||||
}
|
||||
.messageList {
|
||||
padding: 0 32rpx;
|
||||
height: 100%;
|
||||
}
|
||||
.messageItem {
|
||||
padding: 30rpx 0;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
column-gap: 20rpx;
|
||||
border-bottom: 1rpx solid #EEEEEE;
|
||||
|
||||
.messageIcon {
|
||||
width: 80rpx;
|
||||
height: 80rpx;
|
||||
}
|
||||
.noReadTitle {
|
||||
font-weight: bold;
|
||||
font-size: 32rpx;
|
||||
color: #333333;
|
||||
}
|
||||
.noReadTitle:after{
|
||||
content: "*";
|
||||
color: red;
|
||||
display: block; /* 或者其他的块级显示类型,比如 inline-block, table 等 */
|
||||
position: absolute; /* 或者 absolute 或者 fixed,取决于你的布局需求 */
|
||||
z-index: 1; /* 确保它在元素的上方 */
|
||||
right: 0;
|
||||
}
|
||||
|
||||
.messageContent {
|
||||
flex: 1;
|
||||
width: 0;
|
||||
}
|
||||
.messageTitle {
|
||||
font-size: 32rpx;
|
||||
color: #333333;
|
||||
}
|
||||
.messageContent_content {
|
||||
font-weight: 500;
|
||||
font-size: 28rpx;
|
||||
color: #858BA0;
|
||||
|
||||
overflow: hidden;
|
||||
white-space: nowrap;
|
||||
text-overflow: ellipsis;
|
||||
margin-top: 20rpx;
|
||||
}
|
||||
}
|
||||
.popup-content {
|
||||
padding: 15px;
|
||||
height: auto;
|
||||
margin: auto;
|
||||
width: 80%;
|
||||
background-color: #fff;
|
||||
}
|
||||
.popup-content-text {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
}
|
||||
|
||||
.text {
|
||||
color: #333;
|
||||
}
|
||||
|
||||
.popup-info {
|
||||
margin-top: 30rpx;
|
||||
color: #fff;
|
||||
background-color: #f2f6fc;
|
||||
}
|
||||
|
||||
.info-text {
|
||||
color: #909399;
|
||||
}
|
||||
}
|
||||
</style>
|
@ -89,14 +89,17 @@
|
||||
background-color: rgba(255, 255, 255, 1);
|
||||
height: 116rpx;
|
||||
width: 116rpx;
|
||||
border-radius: 10rpx;
|
||||
.image-wrapper_2 {
|
||||
background-color: rgba(177, 205, 255, 1);
|
||||
height: 108rpx;
|
||||
width: 108rpx;
|
||||
margin: 4rpx 0 0 4rpx;
|
||||
border-radius: 10rpx;
|
||||
.image_2 {
|
||||
width: 108rpx;
|
||||
height: 108rpx;
|
||||
border-radius: 10rpx;
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -171,12 +174,13 @@
|
||||
.label_2 {
|
||||
width: 80rpx;
|
||||
height: 80rpx;
|
||||
border-radius:10rpx;
|
||||
}
|
||||
}
|
||||
.text-group_3 {
|
||||
width: 112rpx;
|
||||
height: 72rpx;
|
||||
margin: 34rpx 0 0 10rpx;
|
||||
margin: 34rpx 0 0 30rpx;
|
||||
.text_4 {
|
||||
width: 84rpx;
|
||||
height: 28rpx;
|
||||
@ -336,8 +340,10 @@
|
||||
width: 646rpx;
|
||||
height: 56rpx;
|
||||
margin: 50rpx 0 0 52rpx;
|
||||
background-color: #000;
|
||||
.image-wrapper_4 {
|
||||
background-color: rgba(223, 235, 255, 1);
|
||||
// background-color: rgba(223, 235, 255, 1);
|
||||
background-color: #aa0000;
|
||||
border-radius: 50%;
|
||||
height: 56rpx;
|
||||
width: 56rpx;
|
||||
@ -404,6 +410,8 @@
|
||||
width: 646rpx;
|
||||
height: 56rpx;
|
||||
margin: 50rpx 0 436rpx 52rpx;
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
.image-wrapper_6 {
|
||||
background-color: rgba(223, 235, 255, 1);
|
||||
border-radius: 50%;
|
||||
@ -416,7 +424,7 @@
|
||||
}
|
||||
}
|
||||
.text_13 {
|
||||
width: 128rpx;
|
||||
width: 500rpx;
|
||||
height: 32rpx;
|
||||
overflow-wrap: break-word;
|
||||
color: rgba(51, 51, 51, 1);
|
||||
@ -502,4 +510,111 @@
|
||||
line-height: 28rpx;
|
||||
margin: 10rpx 0 40rpx 30rpx;
|
||||
}
|
||||
|
||||
/* .menu-list {
|
||||
margin-top: 20rpx;
|
||||
background-color: #fff;
|
||||
border-radius: 20rpx;
|
||||
overflow: hidden;
|
||||
padding: 0 20rpx;
|
||||
}
|
||||
|
||||
.menu-item {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
padding: 30rpx 10rpx;
|
||||
border-bottom: 1rpx solid #f0f0f0;
|
||||
|
||||
&:last-child {
|
||||
border-bottom: none;
|
||||
}
|
||||
}
|
||||
|
||||
.menu-icon {
|
||||
width: 32rpx;
|
||||
height: 32rpx;
|
||||
margin: 12rpx 20rpx 0 12rpx;
|
||||
}
|
||||
|
||||
.menu-text {
|
||||
flex: 1;
|
||||
font-size: 30rpx;
|
||||
color: #333;
|
||||
}
|
||||
|
||||
.menu-arrow {
|
||||
width: 32rpx;
|
||||
height: 32rpx;
|
||||
margin: 12rpx 0 0 400rpx;
|
||||
} */
|
||||
|
||||
.menu-list {
|
||||
margin: 20rpx 32rpx;
|
||||
background-color: #fff;
|
||||
border-radius: 16rpx;
|
||||
overflow: hidden;
|
||||
box-shadow: 0 4rpx 12rpx rgba(0, 0, 0, 0.05);
|
||||
|
||||
.menu-item, .menu-item-btn {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
padding: 40rpx 32rpx;
|
||||
// border-bottom: 1rpx solid #f5f5f5;
|
||||
position: relative;
|
||||
|
||||
&:last-child {
|
||||
border-bottom: none;
|
||||
}
|
||||
|
||||
.menu-icon {
|
||||
width: 36rpx;
|
||||
height: 36rpx;
|
||||
margin-right: 24rpx;
|
||||
flex-shrink: 0;
|
||||
}
|
||||
|
||||
.menu-text {
|
||||
flex: 1;
|
||||
font-size: 30rpx;
|
||||
color: #333;
|
||||
font-weight: 400;
|
||||
}
|
||||
|
||||
.menu-arrow {
|
||||
width: 24rpx;
|
||||
height: 24rpx;
|
||||
margin-left: auto;
|
||||
flex-shrink: 0;
|
||||
}
|
||||
|
||||
.message-num {
|
||||
margin-right: 16rpx;
|
||||
width: 36rpx;
|
||||
height: 36rpx;
|
||||
background: #ff4d4f;
|
||||
border-radius: 50%;
|
||||
color: #fff;
|
||||
font-size: 24rpx;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
}
|
||||
}
|
||||
|
||||
.menu-item-btn {
|
||||
text-align: left;
|
||||
justify-content: flex-start;
|
||||
background: none;
|
||||
border: none;
|
||||
padding: 0;
|
||||
line-height: normal;
|
||||
width: 100%;
|
||||
&::after {
|
||||
display: none !important;
|
||||
border: none !important;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
@ -76,7 +76,9 @@
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="block_2 flex-row" @click="goMyInDetails()">
|
||||
|
||||
|
||||
<!-- <view class="block_2 flex-row" @click="goMyInDetails()">
|
||||
<view class="image-wrapper_4 flex-col">
|
||||
<image
|
||||
class="thumbnail_2"
|
||||
@ -91,7 +93,8 @@
|
||||
src="/static/lanhu_gerenzhongxin/FigmaDDSSlicePNG4f20daae79bb7c60189f8702897465d1.png"
|
||||
/>
|
||||
</view>
|
||||
<view class="block_3 flex-row">
|
||||
<button open-type="contact" style="display: flex; align-items: center; border: none;" hairline="false">
|
||||
<view class="block_3 flex-row" open-type="contact">
|
||||
<view class="image-wrapper_5 flex-col">
|
||||
<image
|
||||
class="thumbnail_4"
|
||||
@ -105,8 +108,10 @@
|
||||
referrerpolicy="no-referrer"
|
||||
src="/static/lanhu_gerenzhongxin/FigmaDDSSlicePNG4f20daae79bb7c60189f8702897465d1.png"
|
||||
/>
|
||||
</view>
|
||||
<view class="block_4 flex-row">
|
||||
|
||||
</view></button>
|
||||
|
||||
<view class="block_4 flex-row" @click="goFeedback">
|
||||
<view class="image-wrapper_6 flex-col">
|
||||
<image
|
||||
class="thumbnail_6"
|
||||
@ -114,14 +119,68 @@
|
||||
src="/static/lanhu_gerenzhongxin/FigmaDDSSlicePNGa728895586dafec1bde5f90c89d05c48.png"
|
||||
/>
|
||||
</view>
|
||||
<text class="text_13">建议反馈</text>
|
||||
|
||||
<text class="text_13">消息中心</text>
|
||||
<text class="messageNum" v-if="noReadNum>0">
|
||||
{{ noReadNum }}
|
||||
</text>
|
||||
<image
|
||||
class="thumbnail_7"
|
||||
referrerpolicy="no-referrer"
|
||||
src="/static/lanhu_gerenzhongxin/FigmaDDSSlicePNG4f20daae79bb7c60189f8702897465d1.png"
|
||||
/>
|
||||
</view> -->
|
||||
|
||||
<!-- <view class="menu-list">
|
||||
<view class="menu-item" @click="goMyInDetails()">
|
||||
<image class="menu-icon" src="/static/lanhu_gerenzhongxin/FigmaDDSSlicePNG1bb0cdc369203c305a42d848736e8f01.png" />
|
||||
<text class="menu-text">个人信息</text>
|
||||
<image class="menu-arrow" src="/static/lanhu_gerenzhongxin/FigmaDDSSlicePNG4f20daae79bb7c60189f8702897465d1.png" />
|
||||
</view>
|
||||
|
||||
<view class="menu-item" @tap="goToService">
|
||||
<image class="menu-icon" src="@/static/icon/service.png" />
|
||||
<text class="menu-text">在线客服</text>
|
||||
<image class="menu-arrow" src="@/static/icon/arrow-right.png" />
|
||||
</view>
|
||||
<button open-type="contact" class="menu-item" style="display: flex;">
|
||||
<image class="menu-icon" src="/static/lanhu_gerenzhongxin/FigmaDDSSlicePNGb5e90b5b4c1f154eb4e27313164118a4.png" />
|
||||
<text class="menu-text">在线客服</text>
|
||||
<image class="menu-arrow" src="/static/lanhu_gerenzhongxin/FigmaDDSSlicePNG4f20daae79bb7c60189f8702897465d1.png" />
|
||||
</button>
|
||||
|
||||
<view class="menu-item" @tap="goToMessage">
|
||||
<image class="menu-icon" src="/static/lanhu_gerenzhongxin/FigmaDDSSlicePNGa728895586dafec1bde5f90c89d05c48.png" />
|
||||
<text class="menu-text">消息中心</text>
|
||||
<image class="menu-arrow" src="/static/lanhu_gerenzhongxin/FigmaDDSSlicePNG4f20daae79bb7c60189f8702897465d1.png" />
|
||||
</view>
|
||||
</view> -->
|
||||
|
||||
<view class="menu-list">
|
||||
<!-- 1. 个人信息 -->
|
||||
<view class="menu-item" @click="goMyInDetails()">
|
||||
<image class="menu-icon" src="/static/lanhu_gerenzhongxin/FigmaDDSSlicePNG1bb0cdc369203c305a42d848736e8f01.png" />
|
||||
<text class="menu-text">个人信息</text>
|
||||
<image class="menu-arrow" src="/static/lanhu_gerenzhongxin/FigmaDDSSlicePNG4f20daae79bb7c60189f8702897465d1.png" />
|
||||
</view>
|
||||
|
||||
<view class="menu-item">
|
||||
<button open-type="contact" class="menu-item-btn">
|
||||
<image class="menu-icon" src="/static/lanhu_gerenzhongxin/FigmaDDSSlicePNGb5e90b5b4c1f154eb4e27313164118a4.png" />
|
||||
<text class="menu-text">在线客服</text>
|
||||
<image class="menu-arrow" src="/static/lanhu_gerenzhongxin/FigmaDDSSlicePNG4f20daae79bb7c60189f8702897465d1.png" />
|
||||
</button></view>
|
||||
|
||||
<!-- 3. 消息中心 -->
|
||||
<view class="menu-item" @click="goFeedback">
|
||||
<image class="menu-icon" src="/static/lanhu_gerenzhongxin/FigmaDDSSlicePNGa728895586dafec1bde5f90c89d05c48.png" />
|
||||
<text class="menu-text">消息中心</text>
|
||||
<text class="message-num" v-if="noReadNum > 0">{{ noReadNum }}</text>
|
||||
<image class="menu-arrow" src="/static/lanhu_gerenzhongxin/FigmaDDSSlicePNG4f20daae79bb7c60189f8702897465d1.png" />
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<tabbar :msg='msg'></tabbar>
|
||||
<u-popup round="20" :show="showQrCode" @close="closeQrCode" mode="center" zoom="false" @open="openQrCode">
|
||||
<view style="padding: 50rpx">
|
||||
@ -155,6 +214,7 @@ export default {
|
||||
processList: {},
|
||||
showQrCode: false,
|
||||
isCreateQrCode:true,
|
||||
noReadNum:0,
|
||||
loopData: [
|
||||
{
|
||||
url: '/static/myImgs/alreadyPaid.png',
|
||||
@ -187,7 +247,6 @@ export default {
|
||||
},
|
||||
onLoad() {
|
||||
this.selfInfoLocal = getLocalUserInfo()
|
||||
console.log("用户信息", this.selfInfoLocal)
|
||||
this.getUserInfo()
|
||||
},
|
||||
onShow() {
|
||||
@ -234,7 +293,6 @@ export default {
|
||||
this.showQrCode = false
|
||||
},
|
||||
openQrCode(){
|
||||
console.log(this.userDetails,'202222')
|
||||
// 判断是否有二维码 有了不需要绘制
|
||||
if (this.isCreateQrCode){
|
||||
this.createQrCode(this.userDetails.uniqueCode)
|
||||
@ -262,6 +320,11 @@ export default {
|
||||
url: `/newPages/information/index?userId=${this.selfInfo.id}`
|
||||
})
|
||||
},
|
||||
goFeedback(){
|
||||
uni.navigateTo({
|
||||
url: "/newPages/messageCenter/index"
|
||||
})
|
||||
},
|
||||
|
||||
|
||||
getUserInfo() {
|
||||
@ -275,7 +338,7 @@ export default {
|
||||
}
|
||||
this.getOrder()
|
||||
this.getStudentInfo()
|
||||
console.log('userDetails', this.selfInfo)
|
||||
this.getNoReadNum()
|
||||
})
|
||||
},
|
||||
getStudentInfo(){
|
||||
@ -284,7 +347,6 @@ export default {
|
||||
method: 'GET',
|
||||
params: { userId: this.selfInfo.id }
|
||||
}).then(res => {
|
||||
console.log('userDetailsRes', res)
|
||||
this.userDetails = { ...res.data };
|
||||
});
|
||||
},
|
||||
@ -298,7 +360,6 @@ export default {
|
||||
}
|
||||
}).then(res => {
|
||||
this.coachDetails = res.data
|
||||
console.log('coachDetails', this.coachDetails);
|
||||
})
|
||||
},
|
||||
|
||||
@ -309,7 +370,6 @@ export default {
|
||||
}).then(res => {
|
||||
this.orderList = res.data
|
||||
if (this.orderList.length > 0) {
|
||||
console.log('orderList', this.orderList)
|
||||
this.getProcess(this.orderList[0].courseId)
|
||||
|
||||
}
|
||||
@ -345,13 +405,25 @@ export default {
|
||||
// 如果没有数据,result 保持 null
|
||||
}
|
||||
|
||||
console.log('最终结果:', result); // 调试用,可删除
|
||||
return result; // 如果需要返回结果,可以加上 return
|
||||
}).catch(error => {
|
||||
console.error('请求出错:', error);
|
||||
return null; // 出错时也返回 null
|
||||
});
|
||||
},
|
||||
|
||||
//获取未读消息数量
|
||||
async getNoReadNum(){
|
||||
await request({
|
||||
url: "/app-api/system/notify-message/get-unread-count",
|
||||
method: "GET",
|
||||
tenantIdFlag:false
|
||||
}).then((res) => {
|
||||
if(res.code==0){
|
||||
this.noReadNum = res.data
|
||||
}
|
||||
})
|
||||
},
|
||||
|
||||
}
|
||||
};
|
||||
|
@ -103,7 +103,7 @@
|
||||
}
|
||||
.section_2 {
|
||||
width: 750rpx;
|
||||
height: 1108rpx;
|
||||
height: 1020rpx;
|
||||
.list_1 {
|
||||
width: 618rpx;
|
||||
height: 112rpx;
|
||||
|
@ -115,7 +115,7 @@ export default {
|
||||
}).then(res => {
|
||||
res.data.records.forEach(item => {
|
||||
item.features = ['有接送', '规模大']
|
||||
item.imageUrl = '/static/lanhu_shouye2gai/FigmaDDSSlicePNG530e91ec069b391e8972e9ed0aeebc58.png'
|
||||
item.imageUrl = this.imageUrl + '/' + item.photo
|
||||
})
|
||||
this.schoolList = this.schoolList.concat(res.data.records)
|
||||
this.isTriggered = false
|
||||
@ -148,7 +148,6 @@ export default {
|
||||
item.swiperPicture = this.imageUrl + item.swiperPicture
|
||||
})
|
||||
this.swiperList = res.data
|
||||
console.log('轮播图', this.swiperList)
|
||||
})
|
||||
},
|
||||
/**
|
||||
@ -182,7 +181,7 @@ export default {
|
||||
},
|
||||
goSchoolDetail(data) {
|
||||
uni.navigateTo({
|
||||
url: `/newPages/schoolDetail/index?id=${data.id}&tenantId=${data.tenantId}`,
|
||||
url: `/newPages/schoolDetail/index?id=${data.id}&tenantId=${data.tenantId}&schoolName=${data.corpName}`,
|
||||
// url: '/newPages/schoolDetail/index',
|
||||
});
|
||||
},
|
||||
|
679
newPages/orderDetails/index.vue
Normal file
679
newPages/orderDetails/index.vue
Normal file
@ -0,0 +1,679 @@
|
||||
<template>
|
||||
<view class="order-detail-container">
|
||||
<!-- 头部信息 -->
|
||||
<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 class="status-card" :class="'status-' + orderData.paymentStatus">
|
||||
<text class="status-text">{{ getStatusText(orderData.paymentStatus) }}</text>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<!-- 课程信息 -->
|
||||
<view class="course-card">
|
||||
<view class="course-header">
|
||||
<!-- <text class="course-type" :class="'type-' + orderData.courseType">{{ orderData.courseType }}</text> -->
|
||||
<text class="order-time">{{ formatTime(orderData.createTime) }}</text>
|
||||
</view>
|
||||
|
||||
<view class="course-info">
|
||||
<image :src="imageUrl + '/' + orderData.photo" class="course-image"></image>
|
||||
<view class="course-detail">
|
||||
<text class="course-title">{{ orderData.courseName }}</text>
|
||||
|
||||
<text class="course-type" >{{ orderData.courseType }}</text>
|
||||
<text class="course-desc">{{ courseDetails.tittle }}</text>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<!-- 用户信息 -->
|
||||
<view class="info-card">
|
||||
<view class="info-item">
|
||||
<text class="info-title">学员姓名</text>
|
||||
<text class="info-value">{{ orderData.userName }}</text>
|
||||
</view>
|
||||
<view class="info-item">
|
||||
<text class="info-title">学员电话</text>
|
||||
<text class="info-value">{{ orderData.userPhone }}</text>
|
||||
</view>
|
||||
<view class="info-item">
|
||||
<text class="info-title">证件号码</text>
|
||||
<text class="info-value">{{ orderData.userNo }}</text>
|
||||
</view>
|
||||
<view class="info-item" v-if="orderData.coachUserName">
|
||||
<text class="info-title">教练姓名</text>
|
||||
<text class="info-value">{{ orderData.coachUserName }}</text>
|
||||
</view>
|
||||
<view class="info-item" v-if="schoolDetails.corpName">
|
||||
<text class="info-title">驾校名称</text>
|
||||
<text class="info-value">{{ schoolDetails.corpName }}</text>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<!-- 订单信息 -->
|
||||
<view class="info-card">
|
||||
<view class="info-item">
|
||||
<text class="info-title">订单编号</text>
|
||||
<text class="info-value">{{ orderData.orderNo }}</text>
|
||||
</view>
|
||||
<view class="info-item">
|
||||
<text class="info-title">下单时间</text>
|
||||
<text class="info-value">{{ formatTime(orderData.createTime) }}</text>
|
||||
</view>
|
||||
<view class="info-item">
|
||||
<text class="info-title">支付方式</text>
|
||||
<text class="info-value">{{ getPayTypeText(orderData.payType) }}</text>
|
||||
</view>
|
||||
<view class="info-item">
|
||||
<text class="info-title">支付状态</text>
|
||||
<text class="info-value">{{ getStatusText(orderData.paymentStatus) }}</text>
|
||||
</view>
|
||||
<view class="info-item">
|
||||
<text class="info-title">是否面签</text>
|
||||
<text class="info-value">{{ orderData.isSign ? '已面签' : '未面签' }}</text>
|
||||
</view>
|
||||
<view class="info-item">
|
||||
<text class="info-title">是否终止</text>
|
||||
<text class="info-value">{{ orderData.ifEnd ? '已终止' : '未终止' }}</text>
|
||||
</view>
|
||||
<view class="info-item" v-if="orderData.endReason">
|
||||
<text class="info-title">终止原因</text>
|
||||
<text class="info-value">{{ orderData.endReason }}</text>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<!-- 价格信息 -->
|
||||
<view class="price-card">
|
||||
<!-- <view class="price-row">
|
||||
<text class="price-label">课程{{ orderData.payType === '2' ? '定金' : '全款' }}</text>
|
||||
<text class="price-value">¥{{ orderData.reserveMoney.toFixed(2) }}</text>
|
||||
</view> -->
|
||||
|
||||
<view class="price-row">
|
||||
<text class="price-label">课程金额</text>
|
||||
<text class="price-value">¥{{ courseDetails.price }}</text>
|
||||
</view>
|
||||
|
||||
<view class="price-row" v-if="orderData.payType === '1' && orderData.paymentStatus === '0' ">
|
||||
<text class="price-label">定金金额</text>
|
||||
<text class="price-value">¥{{ courseDetails.reserveMoney }}</text>
|
||||
</view>
|
||||
|
||||
<view class="price-row" v-if="orderData.payType === '1' && orderData.paymentStatus === '0' ">
|
||||
<text class="price-label">尾款金额</text>
|
||||
<text class="price-value">¥{{ orderData.restMoney.toFixed(2) }}</text>
|
||||
</view>
|
||||
|
||||
<view class="price-row" v-if="orderData.payType === '1' && orderData.paymentStatus === '2' ">
|
||||
<text class="price-label">待付尾款</text>
|
||||
<text class="price-value">¥{{ orderData.restMoney.toFixed(2) }}</text>
|
||||
</view>
|
||||
|
||||
|
||||
|
||||
<view class="price-row total" v-if="orderData.reserveMoney && orderData.paymentStatus === '2'">
|
||||
<text class="price-label">实付款</text>
|
||||
<text class="price-value">¥{{ orderData.reserveMoney.toFixed(2) }}</text>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<!-- 底部操作按钮 -->
|
||||
<view class="footer" v-if="orderData.paymentStatus === '0'">
|
||||
<view class="cancel-button" @click="cancelOrder">
|
||||
<text class="pay-button-text">取消订单</text>
|
||||
</view>
|
||||
<view class="pay-button" @click="handlePay">
|
||||
<text class="pay-button-text">立即支付</text>
|
||||
</view>
|
||||
</view>
|
||||
<!-- <view class="footer" v-else-if="orderData.payType === '1'">
|
||||
<view class="pay-button" @click="handlePay">
|
||||
<text class="pay-button-text">支付尾款</text>
|
||||
</view>
|
||||
</view> -->
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import headers from "@/components/header/headers.vue";
|
||||
import request from '@/utils/request.js'
|
||||
export default {
|
||||
components: {
|
||||
headers
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
imageUrl: this.$imagesUrl,
|
||||
courseDetails: [],
|
||||
schoolDetails: [],
|
||||
orderData: {
|
||||
/* coachUserId: 4289,
|
||||
coachUserName: null,
|
||||
courseId: "1",
|
||||
courseName: "测试课程",
|
||||
courseType: "C1",
|
||||
createTime: 1744179195000,
|
||||
creator: "5171",
|
||||
deleted: false,
|
||||
endReason: "测试",
|
||||
endTime: null,
|
||||
gradTime: null,
|
||||
id: "6aea0dbe2c22ec7eaf2859ad6d0bc7ea",
|
||||
ifAssignmentCoach: 0,
|
||||
ifEnd: false,
|
||||
isCreated: false,
|
||||
isSign: 0,
|
||||
oldOrderId: null,
|
||||
orderNo: "69975643780792",
|
||||
passTime: null,
|
||||
payType: "1",
|
||||
paymentStatus: "0",
|
||||
photo: "lanan/5181406098997f57fbd12b968e65aec7d899c4e84f9011f754f5d6074eaa2888.png",
|
||||
reserveMoney: null,
|
||||
restMoney: 0.01,
|
||||
tenantId: 180,
|
||||
type: "C1",
|
||||
updateTime: 1744179195000,
|
||||
updater: "5171",
|
||||
userId: 5171,
|
||||
userName: "刘松源",
|
||||
userNo: "612701199307280651",
|
||||
userPhone: "15305306404",
|
||||
userSex: "0" */
|
||||
}
|
||||
}
|
||||
},
|
||||
onLoad(options) {
|
||||
const order = JSON.parse(decodeURIComponent(options.data));
|
||||
this.orderData = order;
|
||||
this.getCourseDetails()
|
||||
},
|
||||
methods: {
|
||||
getStatusText(status) {
|
||||
const statusMap = {
|
||||
'0': '待支付',
|
||||
'1': '已取消',
|
||||
'2': '已支付',
|
||||
'7': '退款中',
|
||||
'8': '退款成功'
|
||||
}
|
||||
return statusMap[status] || '未知状态'
|
||||
},
|
||||
|
||||
getPayTypeText(type) {
|
||||
const typeMap = {
|
||||
'2': '全款支付',
|
||||
'1': '定金支付'
|
||||
}
|
||||
return typeMap[type] || '未知支付方式'
|
||||
},
|
||||
|
||||
getCourseTypeText(type) {
|
||||
const typeMap = {
|
||||
'C1': 'C1驾照课程',
|
||||
'C2': 'C2驾照课程'
|
||||
}
|
||||
return typeMap[type] || type
|
||||
},
|
||||
|
||||
formatTime(timestamp) {
|
||||
if (!timestamp) return '无'
|
||||
const date = new Date(timestamp)
|
||||
return `${date.getFullYear()}-${this.padZero(date.getMonth() + 1)}-${this.padZero(date.getDate())} ${this.padZero(date.getHours())}:${this.padZero(date.getMinutes())}:${this.padZero(date.getSeconds())}`
|
||||
},
|
||||
|
||||
padZero(num) {
|
||||
return num < 10 ? `0${num}` : num
|
||||
},
|
||||
|
||||
/* handlePay() {
|
||||
uni.showLoading({ title: '跳转支付中...' })
|
||||
this.directWxPay(this.orderData.orderId, this.orderData.orderNo, this.orderData.payType)
|
||||
setTimeout(() => {
|
||||
uni.hideLoading()
|
||||
uni.showToast({ title: '支付成功', icon: 'success' })
|
||||
}, 1500)
|
||||
}, */
|
||||
async handlePay() {
|
||||
uni.showLoading({ title: '跳转支付中...' });
|
||||
try {
|
||||
const res = await this.directWxPay(this.orderData.id, this.orderData.orderNo, this.orderData.payType);
|
||||
if (res === 'success') {
|
||||
uni.showToast({ title: '支付成功', icon: 'success' });
|
||||
} else if (res === 'cancelled') {
|
||||
uni.showToast({ title: '已取消支付', icon: 'none' });
|
||||
} else {
|
||||
uni.showToast({ title: '支付失败,请重试', icon: 'none' });
|
||||
}
|
||||
} catch (error) {
|
||||
uni.showToast({ title: '支付异常', icon: 'none' });
|
||||
console.error('支付异常', error);
|
||||
} finally {
|
||||
uni.hideLoading();
|
||||
}
|
||||
},
|
||||
|
||||
getCourseDetails() {
|
||||
request({
|
||||
url: '/app-api/dl-drive-school-course-small/get',
|
||||
method: 'GET',
|
||||
params: {
|
||||
id: this.orderData.courseId,
|
||||
tenantId: this.orderData.tenantId,
|
||||
},
|
||||
tenantIdFlag: false
|
||||
}).then(res => {
|
||||
this.courseDetails = res.data;
|
||||
this.getSchoolDetails()
|
||||
})
|
||||
},
|
||||
getSchoolDetails() {
|
||||
request({
|
||||
url: '/userClient/base/companySmallProgram/pageNoTenantId',
|
||||
method: 'GET',
|
||||
params: {
|
||||
id: this.orderData.tenantId,
|
||||
serviceCodes: 'jiaxiao',
|
||||
},
|
||||
tenantIdFlag: false
|
||||
}).then(res => {
|
||||
const data = res.data.records;
|
||||
this.schoolDetails = Array.isArray(data) && data.length > 0 ? data[0] : null;
|
||||
})
|
||||
},
|
||||
|
||||
async directWxPay(orderId, orderNo, payType) {
|
||||
try {
|
||||
// 1. 获取预支付参数
|
||||
const prepayRes = await request({
|
||||
url: `/small/jxInfo/prepayment?type=jsapi&orderNo=${orderNo}&orderId=${orderId}&payType=${payType}`,
|
||||
method: 'get'
|
||||
});
|
||||
|
||||
// 2. 调用微信支付
|
||||
const result = await this.handleWxPayment(prepayRes);
|
||||
|
||||
// 3. 支付成功后处理逻辑(可选)
|
||||
if (result === 'success') {
|
||||
await this.updateOrderStatus(orderId, '2');
|
||||
await this.insertSchoolStudent(); // 如果有插入学员信息
|
||||
this.signContract(); // 如果还需要签约
|
||||
}
|
||||
|
||||
return result;
|
||||
} catch (error) {
|
||||
console.error("支付失败:", error);
|
||||
uni.showToast({ title: '支付失败,请重试', icon: 'none' });
|
||||
return 'fail';
|
||||
}
|
||||
},
|
||||
|
||||
handleWxPayment(paymentParams) {
|
||||
return new Promise((resolve) => {
|
||||
wx.requestPayment({
|
||||
...paymentParams,
|
||||
success: (res) => {
|
||||
resolve(res.errMsg === 'requestPayment:ok' ? 'success' : 'fail');
|
||||
},
|
||||
fail: (err) => {
|
||||
resolve(err.errMsg === 'requestPayment:fail cancel' ? 'cancelled' : 'fail');
|
||||
}
|
||||
});
|
||||
});
|
||||
},
|
||||
|
||||
// 插入学员信息
|
||||
insertSchoolStudent() {
|
||||
request({
|
||||
url: '/app-api/small/dl-drive-school-student/create',
|
||||
method: 'post',
|
||||
data: {
|
||||
name: this.orderData.userName,
|
||||
sex: this.orderData.userSex,
|
||||
phone: this.orderData.userPhone,
|
||||
idCard: this.orderData.userNo,
|
||||
registAddress: this.Address,
|
||||
userId: this.orderData.userId,
|
||||
tenantId: this.orderData.tenantId,
|
||||
}
|
||||
})
|
||||
this.updateSysUsersNickName()
|
||||
},
|
||||
|
||||
// 修改users信息
|
||||
updateSysUsersNickName(){
|
||||
request({
|
||||
url: '/app-api/system/user/update',
|
||||
method: 'PUT',
|
||||
data: {
|
||||
nickname: this.orderData.userName,
|
||||
id: this.orderData.userId,
|
||||
}
|
||||
})
|
||||
},
|
||||
|
||||
// 更新订单状态
|
||||
async updateOrderStatus(orderId, status) {
|
||||
await request({
|
||||
url: '/app-api/small/drive/school-course-order/update',
|
||||
method: 'put',
|
||||
data: {
|
||||
id: orderId,
|
||||
paymentStatus: status
|
||||
}
|
||||
});
|
||||
},
|
||||
|
||||
// 签合同
|
||||
signContract() {
|
||||
const contractData = {
|
||||
adress: '',
|
||||
name: this.orderData.userName,
|
||||
tenantId: this.orderData.tenantId,
|
||||
type: this.orderData.type,
|
||||
carType: this.getLicenseTypeDescription(this.orderData.type),
|
||||
money: this.orderData.reserveMoney,
|
||||
indent: this.orderData.userNo,
|
||||
phone: this.orderData.userPhone,
|
||||
time: this.getCurrentDateTime()
|
||||
};
|
||||
uni.navigateTo({
|
||||
url: '/pages/index/contract?data=' + encodeURIComponent(JSON.stringify(contractData))
|
||||
})
|
||||
},
|
||||
|
||||
// 格式化时间
|
||||
getCurrentDateTime() {
|
||||
const now = new Date();
|
||||
|
||||
const year = now.getFullYear();
|
||||
const month = String(now.getMonth() + 1).padStart(2, '0');
|
||||
const day = String(now.getDate()).padStart(2, '0');
|
||||
const hours = String(now.getHours()).padStart(2, '0');
|
||||
const minutes = String(now.getMinutes()).padStart(2, '0');
|
||||
const seconds = String(now.getSeconds()).padStart(2, '0');
|
||||
|
||||
return `${year}-${month}-${day} ${hours}:${minutes}`;
|
||||
// return now;
|
||||
},
|
||||
|
||||
getLicenseTypeDescription(code) {
|
||||
const licenseMap = {
|
||||
C1: "小型手动挡汽车",
|
||||
C2: "小型自动档汽车",
|
||||
B1: "中型客车",
|
||||
B2: "大型货车",
|
||||
A1: "大型客车",
|
||||
A2: "牵引车",
|
||||
A3: "城市公交车",
|
||||
D: "三轮摩托车",
|
||||
E: "两轮摩托车",
|
||||
F: "轻便摩托车"
|
||||
};
|
||||
|
||||
return licenseMap[code] || "未知类型";
|
||||
},
|
||||
|
||||
// 取消订单
|
||||
cancelOrder() {
|
||||
request({
|
||||
url: '/app-api/small/drive/school-course-order/update',
|
||||
method: 'PUT',
|
||||
data: {
|
||||
id: this.orderData.id,
|
||||
paymentStatus: '1',
|
||||
}
|
||||
}).then(res => {
|
||||
if (res.code === 0) {
|
||||
uni.showToast({
|
||||
title: '取消成功',
|
||||
icon: 'success',
|
||||
duration: 2000
|
||||
});
|
||||
this.orderData.paymentStatus = '1';
|
||||
}
|
||||
});
|
||||
},
|
||||
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
|
||||
<style scoped>
|
||||
.order-detail-container {
|
||||
padding-bottom: 200rpx;
|
||||
background-color: #f7f7f7;
|
||||
min-height: 100vh;
|
||||
}
|
||||
|
||||
/* 头部样式 */
|
||||
.header {
|
||||
position: relative;
|
||||
}
|
||||
|
||||
.navbar {
|
||||
height: 88rpx;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
background-color: #ffffff;
|
||||
position: relative;
|
||||
}
|
||||
|
||||
.navbar-title {
|
||||
font-size: 32rpx;
|
||||
font-weight: bold;
|
||||
color: #333;
|
||||
}
|
||||
|
||||
.status-card {
|
||||
height: 40rpx;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
color: #fff;
|
||||
}
|
||||
|
||||
.status-0 {
|
||||
background: linear-gradient(to right, #ff976a, #ff6600);
|
||||
}
|
||||
.status-1 {
|
||||
background: linear-gradient(to right, #ffcc00, #ff9900);
|
||||
}
|
||||
.status-2 {
|
||||
background: linear-gradient(to right, #19be6b, #00b050);
|
||||
}
|
||||
.status-3 {
|
||||
background: linear-gradient(to right, #dd6161, #cc0000);
|
||||
}
|
||||
.status-4 {
|
||||
background: linear-gradient(to right, #909399, #808080);
|
||||
}
|
||||
|
||||
.status-text {
|
||||
font-size: 28rpx;
|
||||
margin-top: 2rpx;
|
||||
}
|
||||
|
||||
/* 卡片通用样式 */
|
||||
.info-card, .course-card, .price-card {
|
||||
margin: 30rpx;
|
||||
background: #fff;
|
||||
border-radius: 16rpx;
|
||||
overflow: hidden;
|
||||
box-shadow: 0 4rpx 16rpx rgba(0,0,0,0.05);
|
||||
}
|
||||
|
||||
/* 信息项样式 */
|
||||
.info-item {
|
||||
padding: 24rpx 30rpx;
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
border-bottom: 2rpx solid #f5f5f5;
|
||||
}
|
||||
|
||||
.info-title {
|
||||
color: #666;
|
||||
font-size: 28rpx;
|
||||
}
|
||||
|
||||
.info-value {
|
||||
color: #333;
|
||||
font-size: 28rpx;
|
||||
font-weight: 500;
|
||||
}
|
||||
|
||||
/* 课程卡片样式 */
|
||||
.course-header {
|
||||
padding: 30rpx 30rpx 0;
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
margin-bottom: 24rpx;
|
||||
}
|
||||
|
||||
.course-type {
|
||||
width: 35rpx;
|
||||
font-size: 24rpx;
|
||||
padding: 4rpx 16rpx;
|
||||
border-radius: 8rpx;
|
||||
color: #fff;
|
||||
background-color: #2979ff;
|
||||
}
|
||||
|
||||
.type-C1 {
|
||||
background-color: #19be6b;
|
||||
}
|
||||
.type-C2 {
|
||||
background-color: #2979ff;
|
||||
}
|
||||
|
||||
.order-time {
|
||||
font-size: 24rpx;
|
||||
color: #909399;
|
||||
}
|
||||
|
||||
.course-info {
|
||||
padding: 0 30rpx 30rpx;
|
||||
display: flex;
|
||||
}
|
||||
|
||||
.course-image {
|
||||
width: 240rpx;
|
||||
height: 180rpx;
|
||||
border-radius: 8rpx;
|
||||
}
|
||||
|
||||
.course-detail {
|
||||
flex: 1;
|
||||
margin-left: 24rpx;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
}
|
||||
|
||||
.course-title {
|
||||
font-size: 32rpx;
|
||||
font-weight: bold;
|
||||
margin-bottom: 12rpx;
|
||||
color: #333;
|
||||
}
|
||||
|
||||
.course-desc {
|
||||
font-size: 24rpx;
|
||||
color: #909399;
|
||||
line-height: 1.5;
|
||||
margin-bottom: 8rpx;
|
||||
|
||||
display: -webkit-box;
|
||||
-webkit-line-clamp: 3; /* 限制显示3行 */
|
||||
-webkit-box-orient: vertical;
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
}
|
||||
|
||||
/* 价格卡片样式 */
|
||||
.price-card {
|
||||
padding: 30rpx;
|
||||
}
|
||||
|
||||
.price-row {
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
margin-bottom: 20rpx;
|
||||
font-size: 28rpx;
|
||||
}
|
||||
|
||||
.price-row.total {
|
||||
margin-top: 20rpx;
|
||||
padding-top: 20rpx;
|
||||
border-top: 2rpx dashed #eee;
|
||||
font-weight: bold;
|
||||
font-size: 32rpx;
|
||||
}
|
||||
|
||||
.price-label {
|
||||
color: #666;
|
||||
}
|
||||
|
||||
.price-value {
|
||||
color: #ff6600;
|
||||
}
|
||||
|
||||
/* 底部按钮样式 */
|
||||
.footer {
|
||||
position: fixed;
|
||||
bottom: 0;
|
||||
left: 0;
|
||||
right: 0;
|
||||
padding: 20rpx 30rpx;
|
||||
background: #fff;
|
||||
box-shadow: 0 -4rpx 16rpx rgba(0,0,0,0.05);
|
||||
display: flex;
|
||||
justify-content: space-around;
|
||||
}
|
||||
|
||||
/* .pay-button {
|
||||
height: 80rpx;
|
||||
background-color: #ff9900;
|
||||
border-radius: 40rpx;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
}
|
||||
|
||||
.cancel-button {
|
||||
height: 80rpx;
|
||||
background-color: #ff0105;
|
||||
border-radius: 40rpx;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
} */
|
||||
.pay-button,
|
||||
.cancel-button {
|
||||
flex: 1;
|
||||
height: 80rpx;
|
||||
margin: 0 10rpx; /* 两个按钮之间留点间距 */
|
||||
border-radius: 40rpx;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
}
|
||||
|
||||
.pay-button {
|
||||
background-color: #ff9900;
|
||||
}
|
||||
|
||||
.cancel-button {
|
||||
background-color: #ff0105;
|
||||
}
|
||||
|
||||
.pay-button-text {
|
||||
color: #fff;
|
||||
font-size: 32rpx;
|
||||
font-weight: bold;
|
||||
}
|
||||
</style>
|
@ -93,16 +93,16 @@
|
||||
}
|
||||
}
|
||||
.list_1 {
|
||||
width: 686rpx;
|
||||
width: 720rpx;
|
||||
height: 766rpx;
|
||||
justify-content: space-between;
|
||||
margin: 112rpx 0 560rpx 32rpx;
|
||||
margin: 112rpx 20rpx 560rpx 20rpx;
|
||||
.list-items_1 {
|
||||
background-color: rgba(255, 255, 255, 1);
|
||||
border-radius: 8px;
|
||||
height: 242rpx;
|
||||
height: 250rpx;
|
||||
margin-bottom: 20rpx;
|
||||
width: 686rpx;
|
||||
width: 710rpx;
|
||||
.box_6 {
|
||||
width: 646rpx;
|
||||
height: 40rpx;
|
||||
@ -221,7 +221,7 @@
|
||||
background-color: rgba(223, 235, 255, 1);
|
||||
border-radius: 2px;
|
||||
height: 36rpx;
|
||||
width: 92rpx;
|
||||
width: 52rpx;
|
||||
position: absolute;
|
||||
left: 232rpx;
|
||||
top: 48rpx;
|
||||
@ -241,6 +241,28 @@
|
||||
}
|
||||
}
|
||||
}
|
||||
.action-buttons {
|
||||
width: 100%;
|
||||
// padding: 0 20rpx 20rpx;
|
||||
margin-top: -10rpx;
|
||||
|
||||
.action-btn {
|
||||
height: 55rpx;
|
||||
line-height: 55rpx;
|
||||
border-radius: 18rpx;
|
||||
font-size: 20rpx;
|
||||
padding: 0 20rpx;
|
||||
margin: 0 40rpx;
|
||||
// background-color: #b1b1b1;
|
||||
border: 1rpx solid #b1b1b1;
|
||||
color: #636363;
|
||||
|
||||
&::after {
|
||||
border: none;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
.group_2 {
|
||||
|
@ -24,7 +24,7 @@
|
||||
:refresher-triggered="isRefreshing"
|
||||
@refresherrefresh="onRefresherrefresh"
|
||||
>
|
||||
<view class="list-items_1 flex-col" v-for="(item, index) in orderList" :key="index">
|
||||
<view class="list-items_1 flex-col" v-for="(item, index) in orderList" :key="index" @click="goOrderDetails(item)">
|
||||
<view class="box_6 flex-row justify-between">
|
||||
<text class="text_2">订单号: {{item.orderNo}}</text>
|
||||
<view class="text-wrapper_1 flex-col" :style="{ background: statusMap[item.paymentStatus].background }">
|
||||
@ -44,19 +44,25 @@
|
||||
<view class="text-group_1 flex-col justify-between">
|
||||
<text class="text_4">{{item.courseName}}</text>
|
||||
<view class="text-wrapper_2 flex-row justify-between">
|
||||
<text class="text_5">{{item.reserveMoney}}</text>
|
||||
<text class="text_6">{{item.reserveMoney}}</text>
|
||||
<text class="text_5">¥{{item.reserveMoney}}</text>
|
||||
<!-- <text class="text_6">{{item.reserveMoney}}</text> -->
|
||||
</view>
|
||||
|
||||
</view>
|
||||
<view class="text-wrapper_3 flex-col">
|
||||
<text class="text_7">{{item.type}}</text>
|
||||
</view>
|
||||
|
||||
<view class="text-wrapper_4 flex-col">
|
||||
<text class="text_8">{{item.type}}</text>
|
||||
</view>
|
||||
<!-- <view class="text-wrapper_3 flex-col">
|
||||
<text class="text_7">{{item.type}}</text>
|
||||
</view> -->
|
||||
</view>
|
||||
</view>
|
||||
|
||||
|
||||
|
||||
</view>
|
||||
|
||||
</scroll-view>
|
||||
</view>
|
||||
<view class="group_2 flex-col justify-end">
|
||||
@ -158,12 +164,17 @@ export default {
|
||||
loading: false,
|
||||
isRefreshing: false,
|
||||
statusMap: {
|
||||
5: {name: '已完成', background: 'rgba(255,228,228,1)', color: 'rgba(237,58,58,1)'},
|
||||
4: {name: '已面签', background: 'rgba(255,228,228,1)', color: 'rgba(237,58,58,1)'},
|
||||
3: {name: '待面签', background: 'rgba(255,228,228,1)', color: 'rgba(237,58,58,1)'},
|
||||
2: {name: '已付款', background: 'rgba(255,244,228,1)', color: 'rgba(237,162,58,1)'},
|
||||
1: {name: '未付款', background: 'rgba(255,228,228,1)', color: 'rgba(237,58,58,1)'},
|
||||
0: {name: '待支付', background: 'rgba(255,228,228,1)', color: 'rgba(237,58,58,1)'},
|
||||
8: { name: '退款成功', background: '#fef0f0', color: '#f56c6c' }, // 红色柔和
|
||||
7: { name: '退款中', background: '#fef0f0', color: '#f56c6c' }, // 红色柔和
|
||||
6: { name: '申请退款', background: '#fef0f0', color: '#f56c6c' }, // 红色柔和
|
||||
|
||||
5: { name: '已完成', background: '#f0f9eb', color: '#67c23a' }, // 绿色完成
|
||||
4: { name: '已面签', background: '#ecf5ff', color: '#409EFF' }, // 蓝色稳定
|
||||
3: { name: '待面签', background: '#fdf6ec', color: '#e6a23c' }, // 橙色提醒
|
||||
|
||||
2: { name: '已支付', background: '#f0f9eb', color: '#67c23a' }, // 绿色支付成功
|
||||
1: { name: '已取消', background: '#f4f4f5', color: '#909399' }, // 灰色中立
|
||||
0: { name: '待支付', background: '#fdf6ec', color: '#e6a23c' }, // 橙色提醒
|
||||
}
|
||||
};
|
||||
},
|
||||
@ -175,11 +186,6 @@ export default {
|
||||
// this.type = options.type;
|
||||
// this.getUserOrderDetails(this.orderType); // 页面加载时请求数据
|
||||
// this.getUserOrderDetails(options.orderType);
|
||||
console.log('options', options)
|
||||
console.log('type', this.type)
|
||||
console.log('type', this.type === 2)
|
||||
console.log('orderType', this.orderType)
|
||||
console.log('orderType', this.orderType === 2)
|
||||
this.changeOrderType(this.orderType, this.type)
|
||||
|
||||
},
|
||||
@ -225,23 +231,7 @@ export default {
|
||||
this.getUserOrderDetails(this.orderType, true);
|
||||
},
|
||||
|
||||
/* getUserOrderDetails(paymentStatus) {
|
||||
console.log(paymentStatus)
|
||||
console.log(this.userId)
|
||||
request({
|
||||
url: '/app-api/small/drive/school-course-order/page',
|
||||
method: 'GET',
|
||||
params: {
|
||||
userId: this.userId,
|
||||
paymentStatus:paymentStatus
|
||||
},
|
||||
tenantIdFlag : false
|
||||
}).then(res => {
|
||||
this.orderList = res.data.records;
|
||||
console.log('订单信息',res.data)
|
||||
});
|
||||
}, */
|
||||
|
||||
// 获取用户订单详情
|
||||
getUserOrderDetails(paymentStatus, isRefresh = false) {
|
||||
if (!isRefresh && this.loading) return;
|
||||
|
||||
@ -272,8 +262,6 @@ export default {
|
||||
|
||||
this.total = res.data.total;
|
||||
this.loading = false;
|
||||
|
||||
console.log('订单信息', res.data);
|
||||
}).catch(err => {
|
||||
this.loading = false;
|
||||
this.isRefreshing = false;
|
||||
@ -283,18 +271,21 @@ export default {
|
||||
console.error('获取订单失败', err);
|
||||
});
|
||||
},
|
||||
|
||||
// 判断选择的标签
|
||||
changeOrderType(orderType, type) {
|
||||
this.orderType = orderType;
|
||||
this.type = type;
|
||||
this.pageNo = 1;
|
||||
console.log('type', type)
|
||||
console.log('orderType', orderType)
|
||||
this.getUserOrderDetails(orderType); // 切换 Tab 时重新请求数据
|
||||
// this.updateUnderlinePosition(type);
|
||||
},
|
||||
// 支付状态
|
||||
getStatusStyle(status) {
|
||||
return this.statusMap[status] || {name: '未知状态', background: '', color: ''};
|
||||
},
|
||||
|
||||
// 获取课程详情
|
||||
getCourseDetails() {
|
||||
request({
|
||||
url: '/app-api/dl-drive-school-course-small/get',
|
||||
@ -308,6 +299,15 @@ export default {
|
||||
this.courseDetails = res.data;
|
||||
})
|
||||
},
|
||||
|
||||
// 订单详情
|
||||
goOrderDetails(data){
|
||||
uni.navigateTo({
|
||||
// url: `/newPages/orderDetails/index?data=${data}`
|
||||
url: `/newPages/orderDetails/index?data=${encodeURIComponent(JSON.stringify(data))}`
|
||||
})
|
||||
},
|
||||
|
||||
calculateScrollHeight() {
|
||||
// 获取屏幕高度
|
||||
const screenHeight = uni.getSystemInfoSync().windowHeight;
|
||||
@ -316,11 +316,6 @@ export default {
|
||||
// 计算滚动区域高度
|
||||
this.scrollHeight = screenHeight - topHeight;
|
||||
},
|
||||
/* updateUnderlinePosition(type) {
|
||||
const index = parseInt(type) - 1; // 计算选中的索引(从 0 开始)
|
||||
const tabWidth = uni.getSystemInfoSync().windowWidth / 4; // 假设有 4 个选项,均分屏幕宽度
|
||||
this.underlinePosition = index * tabWidth;
|
||||
}, */
|
||||
}
|
||||
};
|
||||
</script>
|
||||
|
@ -21,7 +21,7 @@
|
||||
</view>
|
||||
<view class="bm-page-right-3">
|
||||
<text class="bm-page-right-price">¥{{ rightInfoList.price }}</text>
|
||||
<text class="bm-page-right-jprice">¥{{ rightInfoList.price }}</text>
|
||||
<!-- <text class="bm-page-right-jprice">¥{{ rightInfoList.price }}</text> -->
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
@ -205,6 +205,7 @@ export default {
|
||||
userinfo: [],
|
||||
payPrice: null,
|
||||
payStatus: null,
|
||||
oldOrderDetails: [],
|
||||
loading: false,
|
||||
columns: [
|
||||
[{
|
||||
@ -232,11 +233,6 @@ export default {
|
||||
this.userId = option.userId,
|
||||
this.tenantId = option.tenantId
|
||||
this.userinfo = getLocalUserInfo()
|
||||
console.log("驾校id", this.jxId, "课程id", this.courseId)
|
||||
console.log("userId", this.userId, "tenantId", this.tenantId)
|
||||
console.log("userinfo", this.userinfo)
|
||||
console.log('当前存储的所有键:', uni.getStorageInfoSync().keys)
|
||||
console.log('token值:', uni.getStorageSync('App-Token'))
|
||||
},
|
||||
onShow() {
|
||||
this.getListAll()
|
||||
@ -292,7 +288,6 @@ export default {
|
||||
},
|
||||
tenantIdFlag: false
|
||||
})
|
||||
console.log(res);
|
||||
this.columnjl = [
|
||||
res.data.map(coach => ({
|
||||
label: coach.name,
|
||||
@ -312,7 +307,6 @@ export default {
|
||||
},
|
||||
// 选择教练
|
||||
jlconfirm(e) {
|
||||
console.log("选中教练:", e.value[0]);
|
||||
this.jlName = e.value[0].label; // 显示名称
|
||||
this.jlId = e.value[0].value.userId; // 获取教练ID
|
||||
this.showjl = false;
|
||||
@ -414,7 +408,6 @@ export default {
|
||||
// 3. 创建新订单
|
||||
await this.createNewOrder();
|
||||
} catch (error) {
|
||||
console.error("报名出错:", error);
|
||||
if (!error.message.includes('cancel')) {
|
||||
uni.showToast({title: error.message || '操作失败', icon: 'none'});
|
||||
}
|
||||
@ -493,14 +486,26 @@ export default {
|
||||
adress: this.Address,
|
||||
name: this.name,
|
||||
tenantId: this.tenantId,
|
||||
type: this.rightInfoList.price,
|
||||
money: this.getRightInfoList,
|
||||
type: this.rightInfoList.type,
|
||||
carType: this.getLicenseTypeDescription(this.rightInfoList.type),
|
||||
money: this.rightInfoList.price,
|
||||
indent: this.identity,
|
||||
phone: this.phone,
|
||||
time: this.getCurrentDateTime()
|
||||
|
||||
};
|
||||
uni.navigateTo({
|
||||
/* uni.navigateTo({
|
||||
url: '/pages/index/contract?data=' + encodeURIComponent(JSON.stringify(contractData))
|
||||
}); */
|
||||
uni.navigateTo({
|
||||
url: '/pages/index/contract?data=' + encodeURIComponent(JSON.stringify(contractData)) +
|
||||
'&callback=' + encodeURIComponent('handleContractSigned')
|
||||
});
|
||||
} else {
|
||||
uni.showToast({
|
||||
title: '订单创建失败,请稍后再试',
|
||||
icon: 'none',
|
||||
duration: 2000
|
||||
});
|
||||
}
|
||||
},
|
||||
@ -512,11 +517,15 @@ export default {
|
||||
})
|
||||
this.rightInfoList = res.data,
|
||||
this.currentPrice = this.rightInfoList.price;
|
||||
console.log("111222333", this.rightInfoList)
|
||||
},
|
||||
|
||||
// 线下支付合同签署完成后调用的方法
|
||||
handleContractSigned() {
|
||||
this.insertSchoolStudent();
|
||||
},
|
||||
|
||||
// 处理已存在的订单
|
||||
async processExistingOrder() {
|
||||
/* async processExistingOrder() {
|
||||
uni.showLoading({title: '准备支付...', mask: true});
|
||||
|
||||
try {
|
||||
@ -526,17 +535,81 @@ export default {
|
||||
url: `/small/jxInfo/prepayment?type=jsapi&orderNo=${this.orderNo}&orderId=${this.orderId}&payType=${payType}`,
|
||||
method: 'get'
|
||||
});
|
||||
/* if(res.userName != this.name ||
|
||||
res.userPhone != this.phone ||
|
||||
res.coachUserId != this.jlId ||
|
||||
res.coachUserName != jlName ||
|
||||
res.userNo != this.identity ||
|
||||
res.userSex != this.sex ||
|
||||
res.reserveMoney != this.payPrice ||
|
||||
res.payType != this.payType
|
||||
res.restMoney != ){
|
||||
|
||||
} */
|
||||
|
||||
const result = await this.handleWxPayment(res);
|
||||
if (result === 'success') {
|
||||
await Promise.all([
|
||||
this.updateOrderStatus(this.orderId, '2'),
|
||||
this.insertSchoolStudent()
|
||||
]);
|
||||
this.signContract();
|
||||
}
|
||||
return result;
|
||||
} else {
|
||||
this.xxiaPayClick();
|
||||
return 'success';
|
||||
}
|
||||
} finally {
|
||||
uni.hideLoading();
|
||||
}
|
||||
}, */
|
||||
|
||||
async processExistingOrder() {
|
||||
uni.showLoading({title: '准备支付...', mask: true});
|
||||
|
||||
try {
|
||||
// 1. 准备当前数据
|
||||
const payType = this.selectedPayType;
|
||||
const reserveMoney = payType === 1
|
||||
? this.rightInfoList.reserveMoney
|
||||
: this.rightInfoList.price;
|
||||
const restMoney = payType === 1
|
||||
? this.rightInfoList.price - reserveMoney
|
||||
: 0;
|
||||
|
||||
// 2. 获取并对比订单数据
|
||||
const orderDetail = await this.getOrderDetail(this.orderId);
|
||||
const needUpdate = this.checkOrderNeedUpdate(orderDetail, {
|
||||
userName: this.name,
|
||||
userPhone: this.phone,
|
||||
coachUserId: this.jlId,
|
||||
coachUserName: this.jlName,
|
||||
userNo: this.identity,
|
||||
userSex: this.sex,
|
||||
reserveMoney: reserveMoney,
|
||||
payType: payType,
|
||||
restMoney: restMoney
|
||||
});
|
||||
|
||||
// 3. 更新订单数据(如有变更)
|
||||
if (needUpdate) {
|
||||
this.orderNo = await this.generateOrderNo()
|
||||
await this.updateOrderData({
|
||||
id: this.orderId,
|
||||
userName: this.name,
|
||||
userPhone: this.phone,
|
||||
userSex: this.sex,
|
||||
userNo: this.identity,
|
||||
coachUserName: this.jlName,
|
||||
coachUserId: this.jlId,
|
||||
reserveMoney: reserveMoney,
|
||||
payType: payType,
|
||||
restMoney: restMoney,
|
||||
orderNo: this.orderNo,
|
||||
paymentStatus: '0' // 重置为未支付状态
|
||||
});
|
||||
|
||||
// 更新成功后保存新的原始数据
|
||||
this.saveOriginalFormData();
|
||||
}
|
||||
|
||||
// 4. 处理支付
|
||||
if (this.startPay === 1) {
|
||||
const res = await request({
|
||||
url: `/small/jxInfo/prepayment?type=jsapi&orderNo=${this.orderNo}&orderId=${this.orderId}&payType=${payType}`,
|
||||
method: 'get'
|
||||
});
|
||||
|
||||
const result = await this.handleWxPayment(res);
|
||||
if (result === 'success') {
|
||||
@ -556,6 +629,65 @@ export default {
|
||||
}
|
||||
},
|
||||
|
||||
// 检查订单是否需要更新
|
||||
checkOrderNeedUpdate(orderDetail, currentData) {
|
||||
const fieldsToCheck = [
|
||||
'userName',
|
||||
'userPhone',
|
||||
'coachUserId',
|
||||
'coachUserName',
|
||||
'userNo',
|
||||
'userSex',
|
||||
'reserveMoney',
|
||||
'payType',
|
||||
'restMoney'
|
||||
];
|
||||
|
||||
return fieldsToCheck.some(field => {
|
||||
// 特殊处理数字类型的字段
|
||||
if (['reserveMoney', 'restMoney'].includes(field)) {
|
||||
return Number(orderDetail[field]) !== Number(currentData[field]);
|
||||
}
|
||||
return orderDetail[field] !== currentData[field];
|
||||
});
|
||||
},
|
||||
|
||||
// 获取订单详情
|
||||
async getOrderDetail(orderId) {
|
||||
const res = await request({
|
||||
url: '/app-api/small/drive/school-course-order/get?id=' + orderId,
|
||||
method: 'GET'
|
||||
});
|
||||
return res.data;
|
||||
},
|
||||
|
||||
// 更新订单数据
|
||||
async updateOrderData(orderData) {
|
||||
const res = await request({
|
||||
url: '/app-api/small/drive/school-course-order/update',
|
||||
method: 'put',
|
||||
data: orderData
|
||||
});
|
||||
return res.data;
|
||||
},
|
||||
|
||||
saveOriginalFormData() {
|
||||
this.originalFormData = {
|
||||
jlName: this.jlName, // 教练姓名
|
||||
jlId: this.jlId, // 教练ID
|
||||
sfzimg: this.sfzimg, // 身份证照片
|
||||
name: this.name, // 学员姓名
|
||||
age: this.age, // 年龄
|
||||
sex: this.sex, // 性别
|
||||
identity: this.identity, // 身份证号
|
||||
phone: this.phone, // 手机号
|
||||
selectedPayType: this.selectedPayType, // 支付类型(1:定金 2:全款)
|
||||
currentPrice: this.currentPrice, // 当前显示价格
|
||||
reserveMoney: this.rightInfoList.reserveMoney, // 定金金额
|
||||
restMoney: this.rightInfoList.price - this.rightInfoList.reserveMoney // 尾款金额
|
||||
};
|
||||
this.formModified = false; // 重置修改标志
|
||||
},
|
||||
|
||||
// 微信支付处理
|
||||
handleWxPayment(paymentParams) {
|
||||
@ -599,6 +731,16 @@ export default {
|
||||
}
|
||||
},
|
||||
|
||||
// 获取新订单号
|
||||
async generateOrderNo(){
|
||||
const res = await request({
|
||||
url: '/small/jxInfo/generateOrderNo',
|
||||
method: 'GET',
|
||||
});
|
||||
return res
|
||||
|
||||
},
|
||||
|
||||
// 上传
|
||||
deletePic(event) {
|
||||
this[`fileList${event.name}`].splice(event.index, 1)
|
||||
@ -632,14 +774,11 @@ export default {
|
||||
}
|
||||
},
|
||||
uploadFilePromise(e) {
|
||||
console.log(e);
|
||||
upload({
|
||||
url: '/app-api/small-upload/common/upload',
|
||||
filePath: e,
|
||||
}).then((res) => {
|
||||
console.log('sfz', res)
|
||||
this.sfzimg = this.baseUrl + '/' + res.data.url
|
||||
console.log(this.sfzimg);
|
||||
|
||||
if (this.sfzimg) {
|
||||
this.idOcr(this.sfzimg)
|
||||
@ -648,9 +787,6 @@ export default {
|
||||
})
|
||||
},
|
||||
async idOcr(url) {
|
||||
console.log('url', url)
|
||||
console.log('sfz', this.sfzimg)
|
||||
|
||||
let that = this
|
||||
let res = await request({
|
||||
url: '/app-api/small-upload/idOcr',
|
||||
@ -659,14 +795,12 @@ export default {
|
||||
imagePath: url
|
||||
}
|
||||
})
|
||||
console.log('321', res)
|
||||
that.name = res.data.name
|
||||
that.phone = res.data.phone
|
||||
that.sex = res.data.sex
|
||||
that.identity = res.data.idCard
|
||||
that.age = res.data.age
|
||||
that.Address = res.data.Address
|
||||
console.log('654', res);
|
||||
that.popupShow = false
|
||||
},
|
||||
|
||||
@ -710,7 +844,7 @@ export default {
|
||||
method: 'PUT',
|
||||
data: {
|
||||
nickname: this.name,
|
||||
id: this.userInfo.id
|
||||
id: this.userinfo.id
|
||||
}
|
||||
})
|
||||
},
|
||||
@ -718,7 +852,6 @@ export default {
|
||||
// 校验是否登录
|
||||
checkLogin() {
|
||||
const token = uni.getStorageSync('App-Token');
|
||||
console.log(token)
|
||||
if (!token) {
|
||||
uni.showToast({title: '请先登录', icon: 'none'});
|
||||
return false;
|
||||
@ -741,6 +874,23 @@ export default {
|
||||
// return now;
|
||||
},
|
||||
|
||||
getLicenseTypeDescription(code) {
|
||||
const licenseMap = {
|
||||
C1: "小型手动挡汽车",
|
||||
C2: "小型自动档汽车",
|
||||
B1: "中型客车",
|
||||
B2: "大型货车",
|
||||
A1: "大型客车",
|
||||
A2: "牵引车",
|
||||
A3: "城市公交车",
|
||||
D: "三轮摩托车",
|
||||
E: "两轮摩托车",
|
||||
F: "轻便摩托车"
|
||||
};
|
||||
|
||||
return licenseMap[code] || "未知类型";
|
||||
},
|
||||
|
||||
// 签合同
|
||||
signContract() {
|
||||
const contractData = {
|
||||
@ -748,6 +898,7 @@ export default {
|
||||
name: this.name,
|
||||
tenantId: this.tenantId,
|
||||
type: this.rightInfoList.type,
|
||||
carType: this.getLicenseTypeDescription(this.rightInfoList.type),
|
||||
money: this.payPrice,
|
||||
indent: this.identity,
|
||||
phone: this.phone,
|
||||
@ -765,6 +916,7 @@ export default {
|
||||
method: 'GET'
|
||||
});
|
||||
this.payStatus = res.data.paymentStatus;
|
||||
this.oldOrderDetails = res.data
|
||||
return res.data.paymentStatus;
|
||||
},
|
||||
|
||||
|
@ -134,13 +134,28 @@
|
||||
line-height: 40rpx;
|
||||
margin: 30rpx 0 0 32rpx;
|
||||
}
|
||||
.text_3_2 {
|
||||
width: 88%;
|
||||
height: auto;
|
||||
overflow-wrap: break-word;
|
||||
word-break: break-word;
|
||||
color: rgba(51, 51, 51, 1);
|
||||
font-size: 24rpx;
|
||||
font-family: PingFang SC-Semibold;
|
||||
font-weight: NaN;
|
||||
text-align: left;
|
||||
white-space: normal;
|
||||
line-height: 40rpx;
|
||||
margin: 30rpx 0 0 32rpx;
|
||||
}
|
||||
.text-wrapper_1 {
|
||||
width: 220rpx;
|
||||
height: 24rpx;
|
||||
margin: 30rpx 0 0 32rpx;
|
||||
margin: 15rpx 0 0 32rpx;
|
||||
.text_4 {
|
||||
width: 72rpx;
|
||||
height: 24rpx;
|
||||
/* width: 72rpx;
|
||||
height: 24rpx; */
|
||||
padding: 0 10rpx 0 0;
|
||||
overflow-wrap: break-word;
|
||||
color: rgba(44, 120, 245, 1);
|
||||
font-size: 24rpx;
|
||||
@ -154,7 +169,8 @@
|
||||
width: 138rpx;
|
||||
height: 24rpx;
|
||||
overflow-wrap: break-word;
|
||||
color: rgba(137, 146, 162, 1);
|
||||
color: rgba(51, 51, 51, 1);
|
||||
// color: rgba(137, 146, 162, 1);
|
||||
font-size: 24rpx;
|
||||
font-family: PingFang SC-Regular;
|
||||
font-weight: NaN;
|
||||
@ -343,10 +359,10 @@
|
||||
font-size: 24rpx;
|
||||
font-family: PingFang SC-Regular;
|
||||
font-weight: NaN;
|
||||
text-align: left;
|
||||
text-align: center;
|
||||
white-space: nowrap;
|
||||
line-height: 24rpx;
|
||||
margin: 6rpx 0 0 10rpx;
|
||||
// margin: 6rpx 0 0 10rpx;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -9,14 +9,17 @@
|
||||
<image
|
||||
style="width: 100%; height: 100%;"
|
||||
referrerpolicy="no-referrer"
|
||||
src="/static/lanhu_jiaxiaoxiangqing/FigmaDDSSlicePNGcd54efcc9a8c89af0ef99c8275464828.png"
|
||||
:src="imagesUrl + '/' + schoolInfo.photo"
|
||||
/>
|
||||
<!-- src="/static/lanhu_jiaxiaoxiangqing/FigmaDDSSlicePNGcd54efcc9a8c89af0ef99c8275464828.png" -->
|
||||
</view>
|
||||
<view class="group_5 flex-col">
|
||||
<text class="text_3">{{ schoolDetails.corpName }}</text>
|
||||
<text class="text_3">{{ schoolInfo.corpName }}</text>
|
||||
<text class="text_3_2">地址:{{ schoolInfo.address }}</text>
|
||||
<view class="text-wrapper_1 flex-row justify-between">
|
||||
<text class="text_4">营业中</text>
|
||||
<text class="text_5">08:00-18:00</text>
|
||||
<text class="text_4">营业时间</text>
|
||||
<!-- <text class="text_5">08:00-18:00</text> -->
|
||||
<text class="text_5">{{ schoolInfo.businessStartTime }} - {{schoolInfo.businessEndTime}}</text>
|
||||
</view>
|
||||
<!-- <view class="block_2 flex-row">-->
|
||||
<!-- <view class="text-group_1 flex-col justify-between">-->
|
||||
@ -91,7 +94,7 @@
|
||||
item.tittle
|
||||
}}
|
||||
</text>
|
||||
<text class="text-wrapper_3 text_13" style="color: black;padding: 5rpx 15rpx">{{ item.type }}</text>
|
||||
<text class="text-wrapper_3 text_13" style="color: black;padding: 5rpx 10rpx">{{ item.type }}</text>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
@ -162,7 +165,9 @@ export default {
|
||||
constants: {},
|
||||
schoolId: undefined,
|
||||
tenantId: undefined,
|
||||
schoolName: undefined,
|
||||
schoolDetails: {},
|
||||
schoolInfo: [],
|
||||
schoolClassList: [],
|
||||
schoolAllClassList: [],
|
||||
schoolCoachList: [],
|
||||
@ -177,11 +182,10 @@ export default {
|
||||
onLoad(options) {
|
||||
if (options.id) {
|
||||
this.schoolId = options.id;
|
||||
this.tenantId = options.tenantId
|
||||
console.log("首页传入数据", options)
|
||||
console.log("驾校id", this.schoolId)
|
||||
console.log("驾校租户id", this.tenantId)
|
||||
this.getSchoolDetails();
|
||||
this.tenantId = options.tenantId;
|
||||
this.schoolName = options.schoolName;
|
||||
// this.getSchoolDetails();
|
||||
this.getSchoolInfo()
|
||||
this.getSchoolClass();
|
||||
this.getSchoolAllClass()
|
||||
this.getSchoolCoach()
|
||||
@ -204,14 +208,23 @@ export default {
|
||||
}).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);
|
||||
});
|
||||
},
|
||||
getSchoolInfo(){
|
||||
request({
|
||||
url:'/userClient/base/companySmallProgram/getCompanyByTenantId',
|
||||
method: 'GET',
|
||||
params: {
|
||||
tenantId: this.tenantId,
|
||||
systemCode: 'jiaxiao',
|
||||
}
|
||||
}).then(res => {
|
||||
this.schoolInfo = res.data
|
||||
})
|
||||
},
|
||||
getSchoolClass() {
|
||||
console.log('tenantId', this.tenantId)
|
||||
request({
|
||||
url: '/app-api/dl-drive-school-course-small/noTenantIdPage',
|
||||
method: 'GET',
|
||||
@ -224,7 +237,6 @@ export default {
|
||||
}).then(res => {
|
||||
this.schoolClassList = res.data.records;
|
||||
this.total = res.data.total;
|
||||
console.log('驾校课程列表', this.schoolClassList);
|
||||
})
|
||||
},
|
||||
//获取当前位置
|
||||
@ -299,7 +311,6 @@ export default {
|
||||
}).then(res => {
|
||||
this.schoolAllClassList = res.data;
|
||||
this.total = res.data.total;
|
||||
console.log('驾校所有课程列表', this.schoolAllClassList);
|
||||
})
|
||||
},
|
||||
|
||||
@ -317,7 +328,6 @@ export default {
|
||||
// 取排序后的前三条数据
|
||||
this.schoolCoachList = sortedList.slice(0, 3);
|
||||
this.total = res.data.total;
|
||||
console.log('驾校教练列表', this.schoolCoachList);
|
||||
})
|
||||
},
|
||||
|
||||
|
@ -27,48 +27,8 @@ export default {
|
||||
data() {
|
||||
return {
|
||||
constants: {},
|
||||
schoolList: [
|
||||
// {
|
||||
// imageUrl: '/static/lanhu_jiaxiaoliebiao/FigmaDDSSlicePNG530e91ec069b391e8972e9ed0aeebc58.png',
|
||||
// corpName: '兄弟驾校',
|
||||
// status: '未营业',
|
||||
// time: '08:00-18:00',
|
||||
// address: '山东省济南市历下区工业南路168号',
|
||||
// features: ['有接送', '规模大']
|
||||
// },
|
||||
// {
|
||||
// imageUrl: '/static/lanhu_jiaxiaoliebiao/FigmaDDSSlicePNG530e91ec069b391e8972e9ed0aeebc58.png',
|
||||
// corpName: '兄弟驾校',
|
||||
// status: '营业中',
|
||||
// time: '08:00-18:00',
|
||||
// address: '山东省济南市历下区工业南路168号',
|
||||
// features: ['有接送', '规模大']
|
||||
// },
|
||||
// {
|
||||
// imageUrl: '/static/lanhu_jiaxiaoliebiao/FigmaDDSSlicePNG530e91ec069b391e8972e9ed0aeebc58.png',
|
||||
// corpName: '兄弟驾校',
|
||||
// status: '营业中',
|
||||
// time: '08:00-18:00',
|
||||
// address: '山东省济南市历下区工业南路168号',
|
||||
// features: ['有接送', '规模大']
|
||||
// },
|
||||
// {
|
||||
// imageUrl: '/static/lanhu_jiaxiaoliebiao/FigmaDDSSlicePNG530e91ec069b391e8972e9ed0aeebc58.png',
|
||||
// corpName: '兄弟驾校',
|
||||
// status: '营业中',
|
||||
// time: '08:00-18:00',
|
||||
// address: '山东省济南市历下区工业南路168号',
|
||||
// features: ['有接送', '规模大']
|
||||
// },
|
||||
// {
|
||||
// imageUrl: '/static/lanhu_jiaxiaoliebiao/FigmaDDSSlicePNG530e91ec069b391e8972e9ed0aeebc58.png',
|
||||
// corpName: '兄弟驾校',
|
||||
// status: '营业中',
|
||||
// time: '08:00-18:00',
|
||||
// address: '山东省济南市历下区工业南路168号',
|
||||
// features: ['有接送', '规模大']
|
||||
// },
|
||||
],
|
||||
schoolList: [],
|
||||
imageUrl: this.$imagesUrl,
|
||||
isTriggered: false,
|
||||
pageNo: 1,
|
||||
pageSize: 10,
|
||||
@ -94,11 +54,10 @@ export default {
|
||||
}).then(res => {
|
||||
res.data.records.forEach(item => {
|
||||
item.features = ['有接送', '规模大']
|
||||
item.imageUrl = '/static/lanhu_shouye2gai/FigmaDDSSlicePNG530e91ec069b391e8972e9ed0aeebc58.png'
|
||||
item.imageUrl = this.imageUrl + '/' + item.photo
|
||||
})
|
||||
this.schoolList = this.schoolList.concat(res.data.records)
|
||||
this.total = res.data.total
|
||||
console.log('长度',this.schoolList.length)
|
||||
this.isTriggered = false
|
||||
})
|
||||
},
|
||||
@ -130,47 +89,7 @@ export default {
|
||||
this.isTriggered = true
|
||||
this.pageNo = 1
|
||||
this.total = 0
|
||||
this.schoolList = [
|
||||
{
|
||||
imageUrl: '/static/lanhu_jiaxiaoliebiao/FigmaDDSSlicePNG530e91ec069b391e8972e9ed0aeebc58.png',
|
||||
corpName: '兄弟驾校',
|
||||
status: '未营业',
|
||||
time: '08:00-18:00',
|
||||
address: '山东省济南市历下区工业南路168号',
|
||||
features: ['有接送', '规模大']
|
||||
},
|
||||
{
|
||||
imageUrl: '/static/lanhu_jiaxiaoliebiao/FigmaDDSSlicePNG530e91ec069b391e8972e9ed0aeebc58.png',
|
||||
corpName: '兄弟驾校',
|
||||
status: '营业中',
|
||||
time: '08:00-18:00',
|
||||
address: '山东省济南市历下区工业南路168号',
|
||||
features: ['有接送', '规模大']
|
||||
},
|
||||
{
|
||||
imageUrl: '/static/lanhu_jiaxiaoliebiao/FigmaDDSSlicePNG530e91ec069b391e8972e9ed0aeebc58.png',
|
||||
corpName: '兄弟驾校',
|
||||
status: '营业中',
|
||||
time: '08:00-18:00',
|
||||
address: '山东省济南市历下区工业南路168号',
|
||||
features: ['有接送', '规模大']
|
||||
},
|
||||
{
|
||||
imageUrl: '/static/lanhu_jiaxiaoliebiao/FigmaDDSSlicePNG530e91ec069b391e8972e9ed0aeebc58.png',
|
||||
corpName: '兄弟驾校',
|
||||
status: '营业中',
|
||||
time: '08:00-18:00',
|
||||
address: '山东省济南市历下区工业南路168号',
|
||||
features: ['有接送', '规模大']
|
||||
},
|
||||
{
|
||||
imageUrl: '/static/lanhu_jiaxiaoliebiao/FigmaDDSSlicePNG530e91ec069b391e8972e9ed0aeebc58.png',
|
||||
corpName: '兄弟驾校',
|
||||
status: '营业中',
|
||||
time: '08:00-18:00',
|
||||
address: '山东省济南市历下区工业南路168号',
|
||||
features: ['有接送', '规模大']
|
||||
},]
|
||||
this.schoolList = []
|
||||
this.getList()
|
||||
},
|
||||
}
|
||||
@ -191,6 +110,7 @@ export default {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
row-gap: 20rpx;
|
||||
height: calc(100% - 65px);
|
||||
/* height: calc(100% - 65px); */
|
||||
height: 100vh;
|
||||
}
|
||||
</style>
|
||||
|
@ -39,7 +39,7 @@ export default {
|
||||
tenantId: '',
|
||||
contractData: {},
|
||||
userData: {},
|
||||
|
||||
callback: null,
|
||||
}
|
||||
},
|
||||
onLoad(options) {
|
||||
@ -51,12 +51,9 @@ export default {
|
||||
console.log('tenantId',this.tenantId)*/
|
||||
if (options.data) {
|
||||
this.contractData = JSON.parse(decodeURIComponent(options.data));
|
||||
console.log(this.contractData.adress);
|
||||
console.log(this.contractData.name);
|
||||
console.log(this.contractData.tenantId);
|
||||
console.log(this.contractData.type);
|
||||
console.log(this.contractData.money);
|
||||
this.callback = options.callback;
|
||||
}
|
||||
this.callback = options.callback;
|
||||
this.userData = uni.getStorageSync('userInfo');
|
||||
},
|
||||
onShow() {
|
||||
@ -120,7 +117,24 @@ export default {
|
||||
title: '报名成功',
|
||||
duration: 3000
|
||||
|
||||
})
|
||||
});
|
||||
|
||||
const pages = getCurrentPages();
|
||||
const prevPage = pages[pages.length - 2];
|
||||
|
||||
if (prevPage && (prevPage.route === 'newPages/register/index' || prevPage.route === '/newPages/register/index')) {
|
||||
if (this.callback) { // 从onLoad中获取的callback
|
||||
try {
|
||||
const callback = decodeURIComponent(this.callback);
|
||||
if (prevPage.$vm && typeof prevPage.$vm[callback] === 'function') {
|
||||
prevPage.$vm[callback]();
|
||||
}
|
||||
} catch (e) {
|
||||
console.error('回调执行失败:', e);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
setTimeout(function () {
|
||||
// 在这里写需要延迟执行的代码
|
||||
uni.navigateTo({
|
||||
@ -133,6 +147,7 @@ export default {
|
||||
// this.uploadFile(this.imgUrl, fileName)
|
||||
|
||||
},
|
||||
|
||||
goback() {
|
||||
uni.navigateBack()
|
||||
},
|
||||
|
BIN
static/imgs/clear.png
Normal file
BIN
static/imgs/clear.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 2.1 KiB |
BIN
static/imgs/message-icon1.png
Normal file
BIN
static/imgs/message-icon1.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 6.7 KiB |
BIN
static/imgs/nothing.png
Normal file
BIN
static/imgs/nothing.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 40 KiB |
@ -57,3 +57,41 @@ export function formatDateTimeToMinute(timestamp) {
|
||||
return `${year}-${month}-${day} ${hours}:${minutes}`;
|
||||
}
|
||||
|
||||
export function formatTimestamp(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');
|
||||
const seconds = date.getSeconds().toString().padStart(2, '0');
|
||||
// 组合成日期时间字符串
|
||||
return `${year}-${month}-${day} ${hours}:${minutes}:${seconds}`;
|
||||
}
|
||||
|
||||
export function getWXStatusHeight() {
|
||||
// #ifdef MP-WEIXIN
|
||||
// 获取距上
|
||||
const barTop = wx.getSystemInfoSync().statusBarHeight
|
||||
// 获取胶囊按钮位置信息
|
||||
const menuButtonInfo = wx.getMenuButtonBoundingClientRect()
|
||||
// 获取导航栏高度
|
||||
const barHeight = menuButtonInfo.height + (menuButtonInfo.top - barTop) * 2
|
||||
let barWidth = menuButtonInfo.width
|
||||
console.log('menuButtonInfo', menuButtonInfo)
|
||||
let barLeftPosition = 375 - menuButtonInfo.right + menuButtonInfo.width
|
||||
let menuButtonLeft = menuButtonInfo.left
|
||||
let menuButtonRight = menuButtonInfo.right
|
||||
return {
|
||||
barHeight,
|
||||
barTop,
|
||||
barWidth,
|
||||
barLeftPosition,
|
||||
menuButtonLeft,
|
||||
menuButtonRight
|
||||
}
|
||||
// #endif
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user