更新
This commit is contained in:
parent
ca09addd0b
commit
c29ddaf254
@ -160,4 +160,12 @@
|
||||
align-items: center; /* 垂直居中 */
|
||||
height: 100vh; /* 或者你需要撑满的高度 */
|
||||
}
|
||||
.text-group_1 {
|
||||
display: inline-block;
|
||||
max-width: 4em; /* 一个汉字大概占1em,3em就是三个字 */
|
||||
overflow: hidden;
|
||||
white-space: nowrap;
|
||||
text-overflow: ellipsis;
|
||||
}
|
||||
|
||||
</style>
|
||||
|
@ -111,8 +111,13 @@
|
||||
} else if (options.type === 'kaoshi') {
|
||||
this.title = '考试'
|
||||
//评价类型为考试
|
||||
this.info.evaluateType = 0
|
||||
this.info.evaluateType = 1
|
||||
this.info.busiId = data.batchItemId
|
||||
}
|
||||
this.info.createTime = undefined
|
||||
this.info.updataTime = undefined
|
||||
this.info.creator = undefined
|
||||
this.info.updater = undefined
|
||||
} else {
|
||||
Object.assign(this.info, data);
|
||||
}
|
||||
@ -171,4 +176,11 @@
|
||||
justify-content: center;
|
||||
/* 新增:水平居中 */
|
||||
}
|
||||
.text-group_2 {
|
||||
display: inline-block;
|
||||
max-width: 4em; /* 一个汉字大概占1em,3em就是三个字 */
|
||||
overflow: hidden;
|
||||
white-space: nowrap;
|
||||
text-overflow: ellipsis;
|
||||
}
|
||||
</style>
|
||||
|
@ -7,114 +7,118 @@
|
||||
<view class="block_2 flex-col">
|
||||
<view class="box_3 flex-row">
|
||||
<image
|
||||
class="label_1"
|
||||
referrerpolicy="no-referrer"
|
||||
src="/static/lanhu_kaoshijieguoluru/FigmaDDSSlicePNGacf527a62cbe7351c6472edd8f5b2814.png"
|
||||
@click="handleBack()"
|
||||
class="label_1"
|
||||
referrerpolicy="no-referrer"
|
||||
src="/static/lanhu_kaoshijieguoluru/FigmaDDSSlicePNGacf527a62cbe7351c6472edd8f5b2814.png"
|
||||
@click="handleBack()"
|
||||
/>
|
||||
<text class="text_1">考试结果录入</text>
|
||||
|
||||
</view>
|
||||
<view>
|
||||
<scroll-view
|
||||
class="scroll-view"
|
||||
scroll-y
|
||||
:style="{ height: scrollHeight + 'px' }"
|
||||
refresher-enabled @refresherrefresh="onRefresherrefresh" :refresher-triggered="isTriggered"
|
||||
>
|
||||
<view
|
||||
class="box_5 flex-col" v-for="(item, index) in examList"
|
||||
:key="index"
|
||||
:style="{ height: (item.subject != 2 && item.subject != 3) ? '210rpx' : 'auto' }">
|
||||
<view class="block_3 flex-row justify-between">
|
||||
<view class="text-group_1 flex-col justify-between">
|
||||
<view>
|
||||
<scroll-view
|
||||
class="scroll-view"
|
||||
scroll-y
|
||||
:style="{ height: scrollHeight + 'px' }"
|
||||
refresher-enabled @refresherrefresh="onRefresherrefresh" :refresher-triggered="isTriggered"
|
||||
>
|
||||
<view
|
||||
class="box_5 flex-col" v-for="(item, index) in examList"
|
||||
:key="index"
|
||||
:style="{ height: ((item.subject != 2 && item.subject != 3) || getButtonInfo(item).text === '1') ? '230rpx' : 'auto' }">
|
||||
<view class="block_3 flex-row justify-between">
|
||||
<view class="text-group_1 flex-col justify-between">
|
||||
|
||||
<text class="text_2" v-if="item.subject == 1 || item.subject == 4">{{ formatDate(item.examTime) }}</text>
|
||||
<text class="text_2" v-else>{{ formatDate(item.startTime) }}</text>
|
||||
<text class="text_2" v-if="item.subject == 1 || item.subject == 4">{{
|
||||
formatDate(item.examTime)
|
||||
}}
|
||||
</text>
|
||||
<text class="text_2" v-else>{{ formatDate(item.startTime) }}</text>
|
||||
|
||||
<text class="text_3">{{ item.courseName }}</text>
|
||||
</view>
|
||||
<view class="text-group_2 flex-col justify-between">
|
||||
<text class="text_4" v-if="item.examScore">{{ item.examScore }}</text>
|
||||
<text class="text_4" v-else>{{ '--' }}</text>
|
||||
<text class="text_5">{{ getStatusText(item.examStatus) }}</text>
|
||||
</view>
|
||||
</view>
|
||||
<view class="block_4 flex-row justify-between">
|
||||
<view class="text-wrapper_1 flex-col">
|
||||
<text class="text_6">{{getCourseTypeText(item.subject)}}</text>
|
||||
</view>
|
||||
<view class="text-wrapper_2 flex-col">
|
||||
<text class="text_7">{{ item.courseType }}</text>
|
||||
</view>
|
||||
</view>
|
||||
<view class="text-wrapper_3 flex-row justify-between" v-if="item.subject == 2 || item.subject == 3">
|
||||
<text class="text_8">考试地址:</text>
|
||||
<text class="text_9">{{ item.addr }}</text>
|
||||
</view>
|
||||
<view class="block_5 flex-row" v-if="item.subject == 2 || item.subject == 3">
|
||||
<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>
|
||||
<text class="text_3">{{ item.courseName }}</text>
|
||||
</view>
|
||||
<view class="text-group_2 flex-col justify-between">
|
||||
<text class="text_4" v-if="item.examScore">{{ item.examScore }}</text>
|
||||
<text class="text_4" v-else>{{ '--' }}</text>
|
||||
<text class="text_5">{{ getStatusText(item.examStatus) }}</text>
|
||||
</view>
|
||||
</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 class="block_4 flex-row justify-between">
|
||||
<view class="text-wrapper_1 flex-col">
|
||||
<text class="text_6">{{ getCourseTypeText(item.subject) }}</text>
|
||||
</view>
|
||||
<view class="text-wrapper_2 flex-col">
|
||||
<text class="text_7">{{ item.courseType }}</text>
|
||||
</view>
|
||||
</view>
|
||||
<view class="text-wrapper_3 flex-row justify-between" v-if="item.subject == 2 || item.subject == 3">
|
||||
<text class="text_8">考试地址:</text>
|
||||
<text class="text_9">{{ item.addr }}</text>
|
||||
</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="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 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 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> -->
|
||||
</scroll-view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="block_8 flex-col">
|
||||
<view class="text-wrapper_8 flex-col" @click="onEnterScoreClick()">
|
||||
|
||||
<text class="text_19">笔试成绩录入</text>
|
||||
<u-picker
|
||||
:show="pickerShow"
|
||||
:columns="[pickerColumns]"
|
||||
keyName="label"
|
||||
@confirm="onPickerConfirm"
|
||||
@cancel="pickerShow = false"
|
||||
/>
|
||||
<u-picker
|
||||
:show="pickerShow"
|
||||
:columns="[pickerColumns]"
|
||||
keyName="label"
|
||||
@confirm="onPickerConfirm"
|
||||
@cancel="pickerShow = false"
|
||||
/>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
</template>
|
||||
<script>
|
||||
import { getLocalUserInfo } from '../../utils/auth';
|
||||
import {getLocalUserInfo} from '../../utils/auth';
|
||||
import request from '@/utils/request.js'
|
||||
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
@ -144,255 +148,259 @@ export default {
|
||||
lanhutext7: '山东省济南市历下区'
|
||||
}
|
||||
],
|
||||
userInfo: {},
|
||||
examList: {},
|
||||
examTwoList: {},
|
||||
scrollHeight: 0,
|
||||
userInfo: {},
|
||||
examList: {},
|
||||
examTwoList: {},
|
||||
scrollHeight: 0,
|
||||
constants: {},
|
||||
courseList: [],
|
||||
pickerShow: false,
|
||||
pickerColumns: [],
|
||||
curNow: 0,
|
||||
isTriggered: false,
|
||||
courseList: [],
|
||||
pickerShow: false,
|
||||
pickerColumns: [],
|
||||
curNow: 0,
|
||||
isTriggered: false,
|
||||
};
|
||||
},
|
||||
onLoad(){
|
||||
this.userInfo = getLocalUserInfo()
|
||||
this.getExamList()
|
||||
this.getCourseList()
|
||||
onLoad() {
|
||||
this.userInfo = getLocalUserInfo()
|
||||
this.getExamList()
|
||||
this.getCourseList()
|
||||
},
|
||||
onReady() {
|
||||
// 动态计算滚动区域高度
|
||||
this.calculateScrollHeight();
|
||||
},
|
||||
// 动态计算滚动区域高度
|
||||
this.calculateScrollHeight();
|
||||
},
|
||||
methods: {
|
||||
handleBack() {
|
||||
uni.navigateBack({
|
||||
delta: 1
|
||||
});
|
||||
},
|
||||
handleBack() {
|
||||
uni.navigateBack({
|
||||
delta: 1
|
||||
});
|
||||
},
|
||||
|
||||
/**
|
||||
* 下拉刷新数据
|
||||
*/
|
||||
onRefresherrefresh() {
|
||||
this.isTriggered = true
|
||||
this.pageNo = 1
|
||||
this.total = 0
|
||||
this.examList = []
|
||||
this.getExamList()
|
||||
/**
|
||||
* 下拉刷新数据
|
||||
*/
|
||||
onRefresherrefresh() {
|
||||
this.isTriggered = true
|
||||
this.pageNo = 1
|
||||
this.total = 0
|
||||
this.examList = []
|
||||
this.getExamList()
|
||||
|
||||
},
|
||||
},
|
||||
|
||||
onEnterScoreClick() {
|
||||
if (this.courseList.length > 0) {
|
||||
this.pickerColumns = this.courseList.map(item => ({
|
||||
label: item.courseName,
|
||||
value: item.courseId
|
||||
}));
|
||||
this.pickerShow = true;
|
||||
} else if (this.courseList.length === 1) {
|
||||
this.goToScoreEntry(this.courseList[0]);
|
||||
} else {
|
||||
this.$u.toast("暂无课程信息");
|
||||
}
|
||||
},
|
||||
onEnterScoreClick() {
|
||||
if (this.courseList.length > 0) {
|
||||
this.pickerColumns = this.courseList.map(item => ({
|
||||
label: item.courseName,
|
||||
value: item.courseId
|
||||
}));
|
||||
this.pickerShow = true;
|
||||
} else if (this.courseList.length === 1) {
|
||||
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);
|
||||
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);
|
||||
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) {
|
||||
uni.showToast({
|
||||
title: '请联系驾校负责人',
|
||||
icon: 'none'
|
||||
});
|
||||
return;
|
||||
}
|
||||
if (selectedCourse) {
|
||||
this.getProcess(selectedCourse.courseId).then(processData => {
|
||||
if (!processData || processData.length === 0) {
|
||||
uni.showToast({
|
||||
title: '请联系驾校负责人',
|
||||
icon: 'none'
|
||||
});
|
||||
return;
|
||||
}
|
||||
|
||||
// 检查是否存在科目1或科目4的数据
|
||||
const hasSubject1Or4 = processData.some(item =>
|
||||
item.subject === 1 || item.subject === 4
|
||||
);
|
||||
// 检查是否存在科目1或科目4的数据
|
||||
const hasSubject1Or4 = processData.some(item =>
|
||||
item.subject === 1 || item.subject === 4
|
||||
);
|
||||
|
||||
if (hasSubject1Or4) {
|
||||
this.goToScoreEntry(selectedCourse);
|
||||
} else {
|
||||
uni.showToast({
|
||||
title: '未找到考试信息',
|
||||
icon: 'none'
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
if (hasSubject1Or4) {
|
||||
this.goToScoreEntry(selectedCourse);
|
||||
} else {
|
||||
uni.showToast({
|
||||
title: '未找到考试信息',
|
||||
icon: 'none'
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
this.pickerShow = false;
|
||||
},
|
||||
this.pickerShow = false;
|
||||
},
|
||||
|
||||
goToScoreEntry(course) {
|
||||
this.$u.route({
|
||||
url: '/newPages/examinationAdd/index',
|
||||
params: {
|
||||
courseId: course.value,
|
||||
courseType: course.courseType,
|
||||
userId: course.userId,
|
||||
tenantId: course.tenantId,
|
||||
}
|
||||
});
|
||||
},
|
||||
goToScoreEntry(course) {
|
||||
this.$u.route({
|
||||
url: '/newPages/examinationAdd/index',
|
||||
params: {
|
||||
courseId: course.value,
|
||||
courseType: course.courseType,
|
||||
userId: course.userId,
|
||||
tenantId: course.tenantId,
|
||||
}
|
||||
});
|
||||
},
|
||||
|
||||
getProcess(courseId) {
|
||||
return new Promise((resolve, reject) => {
|
||||
request({
|
||||
url: '/app-api/process/getAllByUserIdAndCourseId',
|
||||
method: 'GET',
|
||||
params: {
|
||||
userId: this.userInfo.id,
|
||||
courseId: courseId,
|
||||
}
|
||||
}).then(res => {
|
||||
console.log('res123', res);
|
||||
this.processList = res.data;
|
||||
resolve(res.data);
|
||||
}).catch(err => {
|
||||
console.error('查询失败:', err);
|
||||
reject(err);
|
||||
});
|
||||
});
|
||||
},
|
||||
getProcess(courseId) {
|
||||
return new Promise((resolve, reject) => {
|
||||
request({
|
||||
url: '/app-api/process/getAllByUserIdAndCourseId',
|
||||
method: 'GET',
|
||||
params: {
|
||||
userId: this.userInfo.id,
|
||||
courseId: courseId,
|
||||
}
|
||||
}).then(res => {
|
||||
console.log('res123', res);
|
||||
this.processList = res.data;
|
||||
resolve(res.data);
|
||||
}).catch(err => {
|
||||
console.error('查询失败:', err);
|
||||
reject(err);
|
||||
});
|
||||
});
|
||||
},
|
||||
|
||||
getExamList(){
|
||||
request({
|
||||
url: '/app-api/process/getExamListByUserId',
|
||||
method:'GET',
|
||||
params: {
|
||||
userId: this.userInfo.id,
|
||||
}
|
||||
}).then(res => {
|
||||
this.examList = res.data
|
||||
this.getExamTwoList()
|
||||
console.log('examList', this.examList)
|
||||
console.log('res',res)
|
||||
this.isTriggered = false
|
||||
})
|
||||
},
|
||||
getExamTwoList(){
|
||||
request({
|
||||
url: '/app-api/examBatch/selectExamByUserIdAndCoachId',
|
||||
method: 'GET',
|
||||
params: {
|
||||
userId: this.userInfo.id,
|
||||
}
|
||||
}).then(res => {
|
||||
this.examTwoList = res.data
|
||||
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: '未通过',
|
||||
1: '已通过',
|
||||
9: '已送考',
|
||||
'null': '未送考',
|
||||
'true': '已通过',
|
||||
'false': '未通过',
|
||||
};
|
||||
return statusMap[status] || '未知状态';
|
||||
},
|
||||
getExamList() {
|
||||
request({
|
||||
url: '/app-api/process/getExamListByUserId',
|
||||
method: 'GET',
|
||||
params: {
|
||||
userId: this.userInfo.id,
|
||||
}
|
||||
}).then(res => {
|
||||
this.examList = res.data
|
||||
this.getExamTwoList()
|
||||
console.log('examList', this.examList)
|
||||
console.log('res', res)
|
||||
this.isTriggered = false
|
||||
})
|
||||
},
|
||||
getExamTwoList() {
|
||||
request({
|
||||
url: '/app-api/examBatch/selectExamByUserIdAndCoachId',
|
||||
method: 'GET',
|
||||
params: {
|
||||
userId: this.userInfo.id,
|
||||
}
|
||||
}).then(res => {
|
||||
this.examTwoList = res.data
|
||||
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: '未通过',
|
||||
1: '已通过',
|
||||
9: '已送考',
|
||||
'null': '未送考',
|
||||
'true': '已通过',
|
||||
'false': '未通过',
|
||||
};
|
||||
return statusMap[status] || '未知状态';
|
||||
},
|
||||
|
||||
|
||||
getCourseTypeText(status) {
|
||||
const statusMap = {
|
||||
'1': '科目一',
|
||||
'2': '科目二',
|
||||
'3': '科目三',
|
||||
'4': '科目四',
|
||||
};
|
||||
return statusMap[status] || '未知状态';
|
||||
},
|
||||
formatDate(timestamp) {
|
||||
const date = new Date(timestamp);
|
||||
const year = date.getFullYear();
|
||||
const month = String(date.getMonth() + 1).padStart(2, '0'); // 月份从0开始,需要+1
|
||||
const day = String(date.getDate()).padStart(2, '0');
|
||||
return `${year}-${month}-${day}`;
|
||||
},
|
||||
getCourseTypeText(status) {
|
||||
const statusMap = {
|
||||
'1': '科目一',
|
||||
'2': '科目二',
|
||||
'3': '科目三',
|
||||
'4': '科目四',
|
||||
};
|
||||
return statusMap[status] || '未知状态';
|
||||
},
|
||||
formatDate(timestamp) {
|
||||
const date = new Date(timestamp);
|
||||
const year = date.getFullYear();
|
||||
const month = String(date.getMonth() + 1).padStart(2, '0'); // 月份从0开始,需要+1
|
||||
const day = String(date.getDate()).padStart(2, '0');
|
||||
return `${year}-${month}-${day}`;
|
||||
},
|
||||
|
||||
calculateScrollHeight() {
|
||||
// 获取屏幕高度
|
||||
const screenHeight = uni.getSystemInfoSync().windowHeight;
|
||||
// 获取顶部区域高度
|
||||
const topHeight = 160;
|
||||
// 计算滚动区域高度
|
||||
this.scrollHeight = screenHeight - topHeight;
|
||||
},
|
||||
calculateScrollHeight() {
|
||||
// 获取屏幕高度
|
||||
const screenHeight = uni.getSystemInfoSync().windowHeight;
|
||||
// 获取顶部区域高度
|
||||
const topHeight = 160;
|
||||
// 计算滚动区域高度
|
||||
this.scrollHeight = screenHeight - topHeight;
|
||||
},
|
||||
|
||||
getButtonInfo(item) {
|
||||
console.log('item', item)
|
||||
if (item.fraction == null ) {
|
||||
return { text: '成绩录入', type: 'input' }
|
||||
} else if (!item.ifPass) {
|
||||
return { text: '考试未通过', type: 'failed' }
|
||||
} else if (item.ifEvaluate) {
|
||||
return { text: '查看评价', type: 'view' }
|
||||
} else {
|
||||
return { text: '开始评价', type: 'evaluate' }
|
||||
}
|
||||
},
|
||||
getButtonInfo(item) {
|
||||
console.log('item', item)
|
||||
if (item.fraction == null) {
|
||||
return {text: '成绩录入', type: 'input'}
|
||||
} else if (!item.ifPass) {
|
||||
return {text: '考试未通过', type: 'failed'}
|
||||
} else if (!item.ifEvaluate) {
|
||||
return {text: '开始评价', type: 'evaluate'}
|
||||
}else {
|
||||
return {text: '1', type: 'evaluate'}
|
||||
}
|
||||
// else if (item.ifEvaluate) {
|
||||
// return { text: '查看评价', type: 'view' }
|
||||
// }
|
||||
},
|
||||
|
||||
handleButtonClick(item) {
|
||||
const buttonInfo = this.getButtonInfo(item)
|
||||
handleButtonClick(item) {
|
||||
const buttonInfo = this.getButtonInfo(item)
|
||||
|
||||
switch(buttonInfo.type) {
|
||||
case 'input':
|
||||
this.goScoreInput(item)
|
||||
break
|
||||
case 'evaluate':
|
||||
this.goEvaluate(item)
|
||||
break
|
||||
case 'view':
|
||||
this.goViewEvaluation(item)
|
||||
break
|
||||
default:
|
||||
switch (buttonInfo.type) {
|
||||
case 'input':
|
||||
this.goScoreInput(item)
|
||||
break
|
||||
case 'evaluate':
|
||||
this.goEvaluate(item)
|
||||
break
|
||||
case 'view':
|
||||
this.goViewEvaluation(item)
|
||||
break
|
||||
default:
|
||||
|
||||
}
|
||||
},
|
||||
}
|
||||
},
|
||||
|
||||
// 跳转到成绩录入页面
|
||||
goScoreInput(item) {
|
||||
uni.navigateTo({
|
||||
url: `/newPages/examinationAdd/index?id=${item.batchItemId}&batchId=${item.batchId}&batchId=${item.batchId}&tenantId=${item.tenantId}&courseType=${item.courseType}&subject=${item.subject}&courseId=${item.courseId}&coachId=${item.coachId}`
|
||||
});
|
||||
},
|
||||
// 跳转到开始评价页面
|
||||
goEvaluate(item) {
|
||||
uni.navigateTo({
|
||||
url: `/newPages/evaluation/index?batchId=${item.batchId}&evaluateId=${item.evaluateId || ''}`
|
||||
})
|
||||
},
|
||||
// 跳转到成绩录入页面
|
||||
goScoreInput(item) {
|
||||
uni.navigateTo({
|
||||
url: `/newPages/examinationAdd/index?id=${item.batchItemId}&batchId=${item.batchId}&batchId=${item.batchId}&tenantId=${item.tenantId}&courseType=${item.courseType}&subject=${item.subject}&courseId=${item.courseId}&coachId=${item.coachId}`
|
||||
});
|
||||
},
|
||||
// 跳转到开始评价页面
|
||||
goEvaluate(item) {
|
||||
item = JSON.stringify(item)
|
||||
uni.navigateTo({
|
||||
url: `/newPages/evaluateAdd/index?data=${item}&type=kaoshi&controls=add`
|
||||
})
|
||||
},
|
||||
|
||||
// 跳转到查看评价页面
|
||||
goViewEvaluation(item) {
|
||||
uni.navigateTo({
|
||||
url: `/newPages/evaluationDetail/index?evaluateId=${item.evaluateId}`
|
||||
})
|
||||
}
|
||||
// 跳转到查看评价页面
|
||||
goViewEvaluation(item) {
|
||||
uni.navigateTo({
|
||||
url: `/newPages/evaluationDetail/index?evaluateId=${item.evaluateId}`
|
||||
})
|
||||
}
|
||||
|
||||
}
|
||||
};
|
||||
|
Loading…
Reference in New Issue
Block a user