refactor(train_management): 优化签名展示和签到状态显示逻辑- 在 exam_record.vue 中将签字图片展示方式从 u-image 改为 image 组件

- 在 sign_information.vue 中完善签到状态和考试签到状态的显示逻辑- 更新 BusStagestudentrelationDao.xml 中的排序逻辑,根据状态和创建时间排序
hyx_2025-01-13_xgf2.0
wangyan 2025-03-07 11:03:55 +08:00
parent aee7e4332b
commit bd40af6eb3
6 changed files with 255 additions and 176 deletions

View File

@ -8,3 +8,4 @@ export const uploadFile = (params) => upload("/app/sys/file/uploadFile", params)
export const setRefreshToken = (params) => post("/sys/refreshToken", params ); // 刷新token export const setRefreshToken = (params) => post("/sys/refreshToken", params ); // 刷新token
export const setEntryV1 = (params) => post("/app/sys/user/entry", params ); // 入职 export const setEntryV1 = (params) => post("/app/sys/user/entry", params ); // 入职
export const resignV1 = (params) => post("/app/sys/user/resign", params ); // 离职 export const resignV1 = (params) => post("/app/sys/user/resign", params ); // 离职
export const getStudentInfoApi = (params) => post("/app/student/getStudentInfo", params ); // 获取学员信息

View File

@ -128,6 +128,33 @@ export default {
CODE_TYPE: obj[0].CODE_TYPE CODE_TYPE: obj[0].CODE_TYPE
} }
}) })
} else if (type === '2') {
// , [type: 2 --> ]
if (findClassId) {
uni.$u.route({
url: '/pages/train_management/realname_info_auth',
params: {
type: 'scan_face',
classId
}
})
} else {
uni.$u.toast('您未在培训计划内,无法入班签到,请联系教师')
}
} else if (type === '3') {
// [type: 3 --> ]
if (findClassId) {
uni.$u.route({
url: '/pages/train_management/face_authentication',
params: {
type: 'learning_certification',
stageexampaperinputId,
classId,
}
})
} else {
uni.$u.toast('您未在培训计划内,无法进行考试,请联系教师')
}
} }
} }
}) })

View File

@ -7,8 +7,10 @@
</view> </view>
<view class="content__info"> <view class="content__info">
<view class="content__top">
<view>姓名: {{info.username}}</view> <view>姓名: {{info.username}}</view>
<view>分数: {{info.examscore}}</view> <view>分数: {{info.examscore}}</view>
</view>
<view>考试时间: {{info.examtimeend}}</view> <view>考试时间: {{info.examtimeend}}</view>
</view> </view>
@ -30,7 +32,8 @@
<text>{{ questionList[current].questiondry }}</text> <text>{{ questionList[current].questiondry }}</text>
</view> </view>
<view v-if="questionList[current].questiontype === '1'" class="options"> <view v-if="questionList[current].questiontype === '1'" class="options">
<view v-for="(item, index) in ['A', 'B', 'C', 'D']" :key="index" :class="['item', questionList[current].answer === item ? 'active' : '']"> <view v-for="(item, index) in ['A', 'B', 'C', 'D']" :key="index"
:class="['item', questionList[current].answer === item ? 'active' : '']">
<text class="option">{{ item }}</text> <text class="option">{{ item }}</text>
<text class="text"> <text class="text">
{{ questionList[current]['option' + item.toLocaleLowerCase()] }} {{ questionList[current]['option' + item.toLocaleLowerCase()] }}
@ -38,7 +41,8 @@
</view> </view>
</view> </view>
<view v-if="questionList[current].questiontype === '2'" class="options"> <view v-if="questionList[current].questiontype === '2'" class="options">
<view v-for="(item, index) in ['A', 'B', 'C', 'D']" :key="index" :class="['item', questionList[current].answer && questionList[current].answer.indexOf(item) !== -1 ? 'active' : '']"> <view v-for="(item, index) in ['A', 'B', 'C', 'D']" :key="index"
:class="['item', questionList[current].answer && questionList[current].answer.indexOf(item) !== -1 ? 'active' : '']">
<text class="option">{{ item }}</text> <text class="option">{{ item }}</text>
<text class="text"> <text class="text">
{{ questionList[current]['option' + item.toLocaleLowerCase()] }} {{ questionList[current]['option' + item.toLocaleLowerCase()] }}
@ -46,7 +50,8 @@
</view> </view>
</view> </view>
<view v-if="questionList[current].questiontype === '3'" class="options"> <view v-if="questionList[current].questiontype === '3'" class="options">
<view v-for="(item, index) in ['A', 'B']" :key="index" :class="['item', questionList[current].answer === item ? 'active' : '']"> <view v-for="(item, index) in ['A', 'B']" :key="index"
:class="['item', questionList[current].answer === item ? 'active' : '']">
<text class="option"> <text class="option">
{{ questionList[current]['option' + item.toLocaleLowerCase()] }} {{ questionList[current]['option' + item.toLocaleLowerCase()] }}
</text> </text>
@ -92,7 +97,9 @@
</template> </template>
<script> <script>
import { getTaskScoreInfo } from "@/api"; import {
getTaskScoreInfo
} from "@/api";
export default { export default {
data() { data() {
@ -111,7 +118,10 @@ export default {
}, },
onLoad(query) { onLoad(query) {
const { stagestudentrelationId, classId } = query const {
stagestudentrelationId,
classId
} = query
this.getData(stagestudentrelationId, classId) this.getData(stagestudentrelationId, classId)
}, },
@ -159,13 +169,20 @@ export default {
.content__info { .content__info {
font-size: 34rpx; font-size: 34rpx;
view { view {
margin-top: 18rpx; margin-top: 8rpx;
}
.content__top {
display: flex;
align-items: center;
justify-content: space-between;
} }
} }
.content__sign { .content__sign {
margin-top: 18rpx; margin-top: 10rpx;
font-size: 34rpx; font-size: 34rpx;
display: flex; display: flex;
align-items: center; align-items: center;
@ -173,7 +190,7 @@ export default {
.counter { .counter {
font-size: 28rpx; font-size: 28rpx;
margin: 15rpx 0; margin: 10rpx 0;
text-align: end; text-align: end;
} }
@ -239,11 +256,9 @@ export default {
} }
.correct-answer { .correct-answer {
margin-top: 40rpx;
text { text {
display: inline-block; display: inline-block;
margin-top: 40rpx; margin-top: 10rpx;
color: #696868; color: #696868;
font-size: 30rpx; font-size: 30rpx;
font-weight: bold; font-weight: bold;

View File

@ -45,7 +45,7 @@
</template> </template>
<script> <script>
import { getClassList, getIsUploadFace } from '@/api'; import { getClassList, getIsUploadFace, getStudentInfoApi } from '@/api';
import store from '@/store/index'; import store from '@/store/index';
export default { export default {
@ -97,6 +97,9 @@ export default {
* 右上角自定义扫码图标触发事件 * 右上角自定义扫码图标触发事件
*/ */
onNavigationBarButtonTap(e) { onNavigationBarButtonTap(e) {
//
getStudentInfoFunc();
// //
uni.scanCode({ uni.scanCode({
// scanType: ['qrCode'], // // scanType: ['qrCode'], //
@ -105,8 +108,8 @@ export default {
success: (response) => { success: (response) => {
const { stageexampaperinputId, classId, type, } = JSON.parse(response.result) const { stageexampaperinputId, classId, type, } = JSON.parse(response.result)
const findClassId = this.trainList.some((item) => item.classId === classId) const findClassId = this.trainList.some((item) => item.classId === classId)
if (type === '0') { if (type === '2') {
// // , [type: 2 --> ]
if (findClassId) { if (findClassId) {
uni.$u.route({ uni.$u.route({
url: '/pages/train_management/realname_info_auth', url: '/pages/train_management/realname_info_auth',
@ -118,8 +121,8 @@ export default {
} else { } else {
uni.$u.toast('您未在培训计划内,无法入班签到,请联系教师') uni.$u.toast('您未在培训计划内,无法入班签到,请联系教师')
} }
} else if (type === '1') { } else if (type === '3') {
// // [type: 3 --> ]
if (findClassId) { if (findClassId) {
uni.$u.route({ uni.$u.route({
url: '/pages/train_management/face_authentication', url: '/pages/train_management/face_authentication',
@ -142,6 +145,13 @@ export default {
} }
}) })
}, },
/**
* 使用网络接口获取学员信息
*/
async getStudentInfoFunc() {
const resData = await getStudentInfoApi();
await this.$store.dispatch('studentInfo', resData.studentInfo)
},
/** /**
* 获取是否已经完成上传人脸信息 * 获取是否已经完成上传人脸信息
*/ */

View File

@ -181,6 +181,17 @@ export default {
onLoad(query) { onLoad(query) {
this.routeQuery = query // 1 this.routeQuery = query // 1
const { name,//
phone, //
userIdCard,//
sex, //
degreeOfEducation, //
} = this.$store.getters.getStudentInfo;
this.ruleFormData.userInfo.name = name;
this.ruleFormData.userInfo.phone = phone;
this.ruleFormData.userInfo.userIdCard = userIdCard;
this.ruleFormData.userInfo.sex = sex;
this.ruleFormData.userInfo.degreeOfEducation = degreeOfEducation;
}, },
methods: { methods: {

View File

@ -19,14 +19,26 @@ const store = new Vuex.Store({
PHOTO: "", PHOTO: "",
token: "" token: ""
}, },
// 这里是存储学员信息的数据,直接存储到 localStore 中的
studentInfo: {
name: "" ,// 学员姓名,
phone: "", // 联系电话
userIdCard: "", // 身份证号
sex: "", // 学员性别
degreeOfEducation: "", // 学历
}
}, },
getters: { getters: {
getUserInfo: state => state.userInfo, getUserInfo: state => state.userInfo,
getStudentInfo: state => state.studentInfo,
getVerification: state => state.verification, getVerification: state => state.verification,
}, },
mutations: { mutations: {
setUserInfo(state, userInfo) { setUserInfo(state, userInfo) {
state.userInfo = userInfo state.userInfo = userInfo
},
setStudentInfo(state, studentInfo) {
state.studentInfo = studentInfo
}, },
setVerification(state, verification) { setVerification(state, verification) {
state.verification = verification state.verification = verification
@ -36,6 +48,9 @@ const store = new Vuex.Store({
setUserInfo({commit}, userInfo) { setUserInfo({commit}, userInfo) {
commit('setUserInfo', userInfo) commit('setUserInfo', userInfo)
}, },
setStudentInfo(state, studentInfo) {
commit('setStudentInfo', studentInfo)
},
setVerification({commit}, verification) { setVerification({commit}, verification) {
commit('setVerification', verification) commit('setVerification', verification)
}, },