This commit is contained in:
binbin_pan 2024-08-28 09:51:05 +08:00
parent be3fb04e74
commit 2c6200a92a
24 changed files with 855 additions and 414 deletions

View File

@ -10,157 +10,157 @@ export function getNoticeAnnoByUserId(data) {
} }
// 考试-列表 /personalCenter/getStudentExamList // 考试-列表 /personalCenter/getStudentExamList
export function getStudentExamList(params) { // export function getStudentExamList(params) {
return request({ // return request({
url: '/exam-student/personalCenter/getStudentExamList', // url: '/exam-student/personalCenter/getStudentExamList',
method: 'post', // method: 'post',
data: params // data: params
}) // })
} // }
// 考试-题目 /studentExam/getExamQuestionList // 考试-题目 /studentExam/getExamQuestionList
export function getExamQuestionList(params) { // export function getExamQuestionList(params) {
return request({ // return request({
url: '/exam-student/studentExam/getExamQuestionList', // url: '/exam-student/studentExam/getExamQuestionList',
method: 'post', // method: 'post',
data: params // data: params
}) // })
} // }
// 考试-做题 /studentExam/insertQuestionAnswerById // 考试-做题 /studentExam/insertQuestionAnswerById
export function insertQuestionAnswerById(params) { // export function insertQuestionAnswerById(params) {
return request({ // return request({
url: '/exam-student/studentExam/insertQuestionAnswerById', // url: '/exam-student/studentExam/insertQuestionAnswerById',
method: 'post', // method: 'post',
data: params // data: params
}) // })
} // }
// 考试-交卷+结果 /studentExam/commitExamByRecordId // 考试-交卷+结果 /studentExam/commitExamByRecordId
export function commitExamByRecordId(params) { // export function commitExamByRecordId(params) {
return request({ // return request({
url: '/exam-student/studentExam/commitExamByRecordId', // url: '/exam-student/studentExam/commitExamByRecordId',
method: 'post', // method: 'post',
data: params // data: params
}) // })
} // }
// 考试-查询结果列表 /studentExam/getExamRecordById // 考试-查询结果列表 /studentExam/getExamRecordById
export function getExamRecordById(params) { // export function getExamRecordById(params) {
return request({ // return request({
url: '/exam-student/studentExam/getExamRecordById', // url: '/exam-student/studentExam/getExamRecordById',
method: 'get', // method: 'get',
data: params // data: params
}) // })
} // }
// 考试-结果详情 studentExam/getExamRecordAnswer // 考试-结果详情 studentExam/getExamRecordAnswer
export function getExamRecordAnswer(params) { // export function getExamRecordAnswer(params) {
return request({ // return request({
url: '/exam-student/studentExam/getExamRecordAnswer', // url: '/exam-student/studentExam/getExamRecordAnswer',
method: 'post', // method: 'post',
data: params // data: params
}) // })
} // }
// 考试-排名 studentExam/getExamRankById // 考试-排名 studentExam/getExamRankById
export function getExamRankById(params) { // export function getExamRankById(params) {
return request({ // return request({
url: '/exam-student/studentExam/getExamRankById', // url: '/exam-student/studentExam/getExamRankById',
method: 'post', // method: 'post',
data: params // data: params
}) // })
} // }
// 练习-列表 /personalCenter/getStudentPracticeList // 练习-列表 /personalCenter/getStudentPracticeList
export function getStudentPracticeList(params) { // export function getStudentPracticeList(params) {
return request({ // return request({
url: '/exam-student/personalCenter/getStudentPracticeList', // url: '/exam-student/personalCenter/getStudentPracticeList',
method: 'post', // method: 'post',
data: params // data: params
}) // })
} // }
// 练习-总览 /studentPractice/getPracticeQuestionRate // 练习-总览 /studentPractice/getPracticeQuestionRate
export function getPracticeQuestionRate(params) { // export function getPracticeQuestionRate(params) {
return request({ // return request({
url: '/exam-student/studentPractice/getPracticeQuestionRate', // url: '/exam-student/studentPractice/getPracticeQuestionRate',
method: 'post', // method: 'post',
data: params // data: params
}) // })
} // }
// 练习-聚合数据 /studentPractice/getPracticeItData // 练习-聚合数据 /studentPractice/getPracticeItData
export function getPracticeItData(params) { // export function getPracticeItData(params) {
return request({ // return request({
url: '/exam-student/studentPractice/getPracticeItData', // url: '/exam-student/studentPractice/getPracticeItData',
method: 'post', // method: 'post',
data: params // data: params
}) // })
} // }
// 练习-题目 studentPractice/getPracticeQuestion // 练习-题目 studentPractice/getPracticeQuestion
export function getPracticeQuestion(params) { // export function getPracticeQuestion(params) {
return request({ // return request({
url: '/exam-student/studentPractice/getPracticeQuestion', // url: '/exam-student/studentPractice/getPracticeQuestion',
method: 'post', // method: 'post',
data: params // data: params
}) // })
} // }
// 练习-答题 studentPractice/insertPracticeAnswerById // 练习-答题 studentPractice/insertPracticeAnswerById
export function insertPracticeAnswerById(params) { // export function insertPracticeAnswerById(params) {
return request({ // return request({
url: '/exam-student/studentPractice/insertPracticeAnswerById', // url: '/exam-student/studentPractice/insertPracticeAnswerById',
method: 'post', // method: 'post',
data: params // data: params
}) // })
} // }
// 练习-前后题-跳题 studentPractice/changeQuestion // 练习-前后题-跳题 studentPractice/changeQuestion
export function changeQuestion(params) { // export function changeQuestion(params) {
return request({ // return request({
url: '/exam-student/studentPractice/changeQuestion', // url: '/exam-student/studentPractice/changeQuestion',
method: 'post', // method: 'post',
data: params // data: params
}) // })
} // }
// 练习-弹框序号跳题 /studentPractice/getPracticeQuestionList // 练习-弹框序号跳题 /studentPractice/getPracticeQuestionList
export function getPracticeQuestionList(params) { // export function getPracticeQuestionList(params) {
return request({ // return request({
url: '/exam-student/studentPractice/getPracticeQuestionList', // url: '/exam-student/studentPractice/getPracticeQuestionList',
method: 'post', // method: 'post',
data: params // data: params
}) // })
} // }
// 练习-保存练习时长 /studentPractice/savePracticeDuration // 练习-保存练习时长 /studentPractice/savePracticeDuration
export function savePracticeDuration(params) { // export function savePracticeDuration(params) {
return request({ // return request({
url: '/exam-student/studentPractice/savePracticeDuration', // url: '/exam-student/studentPractice/savePracticeDuration',
method: 'post', // method: 'post',
data: params // data: params
}) // })
} // }
// 练习-错题消除 studentPractice/updateRemoveRecordData // 练习-错题消除 studentPractice/updateRemoveRecordData
export function updateRemoveRecordData(params) { // export function updateRemoveRecordData(params) {
return request({ // return request({
url: '/exam-student/studentPractice/updateRemoveRecordData', // url: '/exam-student/studentPractice/updateRemoveRecordData',
method: 'post', // method: 'post',
data: params // data: params
}) // })
} // }
// 学习项目-列表 /personalCenter/getStudentStudyWorkList // 学习项目-列表 /personalCenter/getStudentStudyWorkList
export function getStudentStudyWorkList(params) { // export function getStudentStudyWorkList(params) {
return request({ // return request({
url: '/exam-student/personalCenter/getStudentStudyWorkList', // url: '/exam-student/personalCenter/getStudentStudyWorkList',
method: 'post', // method: 'post',
data: params // data: params
}) // })
} // }
// 学习项目-目录 /studyWork/StudyWorkAll // 学习项目-目录 /studyWork/StudyWorkAll
// export function studyWorkAll(params) { // export function studyWorkAll(params) {
@ -172,19 +172,19 @@ export function getStudentStudyWorkList(params) {
// } // }
// 学习项目-进度 /student/updStudyDuration // 学习项目-进度 /student/updStudyDuration
export function updStudyDuration(params) { // export function updStudyDuration(params) {
return request({ // return request({
url: '/exam-student/student/updStudyDuration', // url: '/exam-student/student/updStudyDuration',
method: 'post', // method: 'post',
data: params // data: params
}) // })
} // }
// 学习项目-考试/学习 结束 /student/updStudyDurationExamPractice // 学习项目-考试/学习 结束 /student/updStudyDurationExamPractice
export function updStudyDurationExamPractice(params) { // export function updStudyDurationExamPractice(params) {
return request({ // return request({
url: '/exam-student/student/updStudyDurationExamPractice', // url: '/exam-student/student/updStudyDurationExamPractice',
method: 'post', // method: 'post',
data: params // data: params
}) // })
} // }

View File

@ -4,12 +4,7 @@ import config from '@/config'
import { getToken } from '@/utils/auth.js' import { getToken } from '@/utils/auth.js'
// import store from '@/store'; // import store from '@/store';
let baseUrl = '' const baseUrl = config.loginBaseUrl
if (uni.getStorageSync('jwtToken')) {
baseUrl = config.baseUrl
} else {
baseUrl = config.loginBaseUrl
}
console.log('baseUrl-请求', baseUrl) console.log('baseUrl-请求', baseUrl)
const http = new Request({ const http = new Request({

View File

@ -1,16 +1,39 @@
// 应用全局配置 // 应用全局配置
// module.exports = {
// // baseUrl:'/prod-api',
// loginBaseUrl:'http://112.29.103.165:1616',
// // baseUrl:'http://192.168.0.14:2900',
// baseUrl:'http://192.168.0.137:2900',
// // loginUrl: 'http://112.29.103.165:1616',
// login: 'http://192.168.0.137:19200',
// // 图片展示基础地址
// fileUrl:'http://192.168.0.137:2909/exam-file/',
// // 上传文件地址
// uploadUrl: 'http://192.168.0.137:2909/exam-file/file/uploadBase64',
// bmwUrl: 'http://192.168.0.137:2911/exam-bmw',
// // 应用信息
// appInfo: {
// // 应用名称
// name: "作业管控智慧平台",
// // 应用版本
// version: "1.1.0",
// }
// }
module.exports = { module.exports = {
// baseUrl:'/prod-api', // baseUrl:'/prod-api',
// http://192.168.0.14:19999
loginBaseUrl:'http://112.29.103.165:1616', loginBaseUrl:'http://112.29.103.165:1616',
// loginBaseUrl:'http://192.168.0.14:19999',
// baseUrl:'http://192.168.0.14:2900', // baseUrl:'http://192.168.0.14:2900',
baseUrl:'http://192.168.0.32:2900', baseUrl:'http://192.168.0.14:19999',
loginUrl: 'http://112.29.103.165:1616', // loginUrl: 'http://112.29.103.165:1616',
login: 'http://192.168.0.32:19200', login: 'http://192.168.0.14:19200',
// 图片展示基础地址 // 图片展示基础地址
fileUrl:'http://192.168.0.137:2909/exam-file/', fileUrl:'http://192.168.0.14:19999/exam-file/',
// 上传文件地址 // 上传文件地址
uploadUrl: 'http://192.168.0.32:2909/exam-file/file/uploadBase64', uploadUrl: 'http://192.168.0.14:19999/exam-file/file/uploadBase64',
bmwUrl: 'http://192.168.0.32:2911/exam-bmw', bmwUrl: 'http://192.168.0.14:19999/exam-bmw',
// 应用信息 // 应用信息
appInfo: { appInfo: {
// 应用名称 // 应用名称

View File

@ -6,6 +6,7 @@
"versionCode" : 104, "versionCode" : 104,
"transformPx" : false, "transformPx" : false,
"app-plus" : { "app-plus" : {
"popGesture": "none",
"useragent" : { "useragent" : {
"value" : "Mozilla/5.0 (iPhone; CPU iPhone OS 15_5 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Mobile/15E148 Html5Plus/1.0 (Immersed/20) uni-app", "value" : "Mozilla/5.0 (iPhone; CPU iPhone OS 15_5 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Mobile/15E148 Html5Plus/1.0 (Immersed/20) uni-app",
"concatenate" : true //true false "concatenate" : true //true false

View File

@ -64,6 +64,8 @@ export default {
examNum: 0, // examNum: 0, //
examCount: 1, // 1: 2: 3: examCount: 1, // 1: 2: 3:
examCustom: 0, // examCustom: 0, //
score: 0,
passScore: 0
} }
}, },
onLoad(opt) { onLoad(opt) {
@ -75,6 +77,8 @@ export default {
this.duration = opt.responseTime this.duration = opt.responseTime
this.switchCount = opt.cutNum.includes('null') || opt.cutNum.includes('undefined') ? '不限次' : opt.cutNum this.switchCount = opt.cutNum.includes('null') || opt.cutNum.includes('undefined') ? '不限次' : opt.cutNum
this.studyId = opt.studyId this.studyId = opt.studyId
this.score = opt.score
this.passScore = opt.passScore
}, },
methods: { methods: {
openModal() { openModal() {
@ -89,6 +93,8 @@ export default {
examCount: this.examCount, examCount: this.examCount,
examCustom: this.examCustom, examCustom: this.examCustom,
studyId: this.studyId, // id studyId: this.studyId, // id
score: this.score, //
passScore: this.passScore //
} }
console.log('🚀 ~ handleEnterExam ~ params:', params) console.log('🚀 ~ handleEnterExam ~ params:', params)
uni.navigateTo({ uni.navigateTo({

View File

@ -22,7 +22,7 @@
<div class="time">{{ item.validityDate }}</div> <div class="time">{{ item.validityDate }}</div>
<div class="count-total"> <div class="count-total">
<div class="count">考试{{ item.examNum }}</div> <div class="count">考试{{ item.examNum }}</div>
<div class="total">总分{{ item.passScore }}</div> <div class="total">总分{{ item.score }}</div>
</div> </div>
<div class="bt-wrapper"> <div class="bt-wrapper">
<div class="score">得分{{ item.examScore }}</div> <div class="score">得分{{ item.examScore }}</div>
@ -45,6 +45,7 @@
<script> <script>
import { getStudentExamList } from '@/api/eduApp/index' import { getStudentExamList } from '@/api/eduApp/index'
import config from '@/config'
export default { export default {
data() { data() {
@ -71,12 +72,32 @@ export default {
userId: uni.getStorageSync('userId'), userId: uni.getStorageSync('userId'),
source: 1 source: 1
} }
const res = await getStudentExamList(params) // const res = await getStudentExamList(params)
// status // // status
this.list = this.allList // this.list = this.allList
this.allList = this.list = res.data // this.allList = this.list = res.data
this.waitList = res.data.filter(item => item.status === 1) // this.waitList = res.data.filter(item => item.status === 1)
this.alreadyList = res.data.filter(item => item.status === 2) // this.alreadyList = res.data.filter(item => item.status === 2)
uni.request({
url: config.baseUrl + '/exam-student/personalCenter/getStudentExamList',
method: 'post',
data: params,
header: {
'Content-Type': 'application/x-www-form-urlencoded',
Authorization: uni.getStorageSync('access_token')
},
success: res => {
console.log('🚀 ~ getList ~ res:', res)
res = res.data
this.list = this.allList
this.allList = this.list = res.data
this.waitList = res.data.filter(item => item.status === 1)
this.alreadyList = res.data.filter(item => item.status === 2)
},
fail: err => {
console.log(err)
}
})
}, },
handleTab(item, index) { handleTab(item, index) {
this.activeIndex = index this.activeIndex = index
@ -92,6 +113,7 @@ export default {
}, },
// //
handleExamination(item) { handleExamination(item) {
console.log('🚀 ~ handleExamination ~ item:', item)
// examCount 1: 2: 3: // examCount 1: 2: 3:
if (item.examCount == 2 && item.results == 1) { if (item.examCount == 2 && item.results == 1) {
uni.showToast({ uni.showToast({
@ -114,7 +136,9 @@ export default {
responseTime: item.responseTime, // responseTime: item.responseTime, //
examNum: item.examNum, // examNum: item.examNum, //
examCount: item.examCount, // examCount: item.examCount, //
examCustom: item.examCustom // examCustom: item.examCustom, //
score: item.score, //
passScore: item.passScore, //
} }
uni.navigateTo({ uni.navigateTo({
url: `/pages/YNEduApp/exam/beforeExam?params=${JSON.stringify(params)}` url: `/pages/YNEduApp/exam/beforeExam?params=${JSON.stringify(params)}`
@ -131,7 +155,7 @@ export default {
handleExamDataList(item) { handleExamDataList(item) {
console.log('🚀 ~ handleExamDataList ~ item:', item) console.log('🚀 ~ handleExamDataList ~ item:', item)
const params = { const params = {
examId: item.id, examId: item.id
} }
uni.navigateTo({ uni.navigateTo({
url: `/pages/YNEduApp/exam/examinationList?params=${JSON.stringify(params)}` url: `/pages/YNEduApp/exam/examinationList?params=${JSON.stringify(params)}`

View File

@ -124,7 +124,7 @@ import {
getFaceRecognition, getFaceRecognition,
updStudyDurationExamPractice updStudyDurationExamPractice
} from '@/api/eduApp' } from '@/api/eduApp'
import config from 'config' import config from '@/config'
export default { export default {
data() { data() {
@ -158,18 +158,22 @@ export default {
studyId: '', // id studyId: '', // id
// //
questionList: [], questionList: [],
fileUrl: config.fileUrl fileUrl: config.fileUrl,
score: 0,
passScore: 0
} }
}, },
onLoad(opt) { onLoad(opt) {
console.log('🚀 ~ onLoad ~ opt考试中--:', opt)
opt = JSON.parse(opt.params) opt = JSON.parse(opt.params)
console.log('🚀 ~ onLoad ~ opt考试中--:', opt)
this.examId = opt.examId this.examId = opt.examId
this.switchCount = Number(opt.switchCount) this.switchCount = Number(opt.switchCount)
this.examNum = opt.examNum this.examNum = opt.examNum
this.examCount = opt.examCount this.examCount = opt.examCount
this.examCustom = opt.examCustom this.examCustom = opt.examCustom
this.studyId = opt.studyId || '' this.studyId = opt.studyId || ''
this.score = opt.score
this.passScore = opt.passScore
}, },
onShow() { onShow() {
setTimeout(() => { setTimeout(() => {
@ -200,30 +204,52 @@ export default {
const params = { const params = {
examId: this.examId examId: this.examId
} }
const res = await getExamQuestionList(params) // const res = await getExamQuestionList(params)
const data = res.data // const data = res.data
this.questionList = data.examPaperData // this.questionList = data.examPaperData
this.recordId = data.recordId // this.recordId = data.recordId
this.examTime = data.answerTime // this.examTime = data.answerTime
this.time = Number(data.answerTime) * 60 * 1000 // this.time = Number(data.answerTime) * 60 * 1000
console.log('🚀 ~ getList ~ this.time:', this.time) // console.log('🚀 ~ getList ~ this.time:', this.time)
console.log('🚀 ~ getList ~ res考试题:', res) // console.log('🚀 ~ getList ~ res:', res)
uni.request({
if (this.questionList.length > 0) { url: config.baseUrl + '/exam-student/studentExam/getExamQuestionList',
this.questionList.forEach((item, index) => { method: 'post',
this.$set(item, 'isShow', index < 7) data: params,
this.$set(item, 'isActive', false) header: {
if (item.listOption) { 'Content-Type': 'application/x-www-form-urlencoded',
item.listOption.forEach(option => { Authorization: uni.getStorageSync('access_token')
this.$set(option, 'isActive', false) },
success: res => {
console.log('🚀 ~ getList ~ res:', res)
res = res.data
const data = res.data
this.questionList = data.examPaperData
this.recordId = data.recordId
this.examTime = data.answerTime
this.time = Number(data.answerTime) * 60 * 1000
console.log('🚀 ~ getList ~ this.time:', this.time)
console.log('🚀 ~ getList ~ this.questionList:', this.questionList)
if (this.questionList.length > 0) {
this.questionList.forEach((item, index) => {
this.$set(item, 'isShow', index < 7)
this.$set(item, 'isActive', false)
if (item.listOption) {
item.listOption.forEach(option => {
this.$set(option, 'isActive', false)
})
}
}) })
console.log('🚀 ~ this.questionList.forEach ~ this.questionList:', this.questionList)
setTimeout(() => {
this.$refs.countDown.start()
}, 100)
} }
}) },
console.log('🚀 ~ this.questionList.forEach ~ this.questionList:', this.questionList) fail: err => {
setTimeout(() => { console.log(err)
this.$refs.countDown.start() }
}, 100) })
}
} catch (error) { } catch (error) {
console.log('🚀 ~ getList ~ error:', error) console.log('🚀 ~ getList ~ error:', error)
} }
@ -299,7 +325,16 @@ export default {
selectAnswer selectAnswer
} }
console.log('🚀 ~ handleSelectOption ~ params:', params) console.log('🚀 ~ handleSelectOption ~ params:', params)
insertQuestionAnswerById(params) // insertQuestionAnswerById(params)
uni.request({
url: config.baseUrl + '/exam-student/studentExam/insertQuestionAnswerById',
method: 'post',
data: params,
header: {
'Content-Type': 'application/x-www-form-urlencoded',
Authorization: uni.getStorageSync('access_token')
}
})
}, },
openConfirmModal() { openConfirmModal() {
this.unDoCount = this.questionList.filter(item => !item.isActive).length this.unDoCount = this.questionList.filter(item => !item.isActive).length
@ -316,30 +351,65 @@ export default {
// , // ,
answerTime: Math.ceil(this.answerTime / 60000) answerTime: Math.ceil(this.answerTime / 60000)
} }
const res = await commitExamByRecordId(params) // const res = await commitExamByRecordId(params)
uni.request({
url: config.baseUrl + '/exam-student/studentExam/commitExamByRecordId',
method: 'post',
data: params,
header: {
'Content-Type': 'application/x-www-form-urlencoded',
Authorization: uni.getStorageSync('access_token')
},
success: res => {
console.log('🚀 ~ handleConfirmSubmit ~ res:', res)
res = res.data
this.showConfirmModal = false
const params2 = {
examId: this.examId,
examGrade: res.examGrade,
examResult: res.examResult,
gradeAverage: res.gradeAverage,
answerTime: Math.ceil(this.answerTime / 60000),
examTime: this.examTime,
questionCount: this.questionList.length,
switchCount: this.switchCount,
examNum: this.examNum,
examCount: this.examCount,
examCustom: this.examCustom,
results: res.examResult,
studyId: this.studyId || '',
score: this.score,
passScore: this.passScore
}
uni.navigateTo({
url: `/pages/YNEduApp/exam/examinationDetails?params=${JSON.stringify(params2)}`
})
}
})
if (this.studyId) { if (this.studyId) {
updStudyDurationExamPractice({userId: params.userId, studyId: this.studyId }) // updStudyDurationExamPractice({ userId: params.userId, studyId: this.studyId })
this.updStudyDurationExamPractice({ userId: params.userId, studyId: this.studyId })
} }
console.log('🚀 ~ handleConfirmSubmit ~ params:', params, res) console.log('🚀 ~ handleConfirmSubmit ~ params:', params, res)
this.showConfirmModal = false // this.showConfirmModal = false
const params2 = { // const params2 = {
examId: this.examId, // examId: this.examId,
examGrade: res.examGrade, // examGrade: res.examGrade,
examResult: res.examResult, // examResult: res.examResult,
gradeAverage: res.gradeAverage, // gradeAverage: res.gradeAverage,
answerTime: Math.ceil(this.answerTime / 60000), // answerTime: Math.ceil(this.answerTime / 60000),
examTime: this.examTime, // examTime: this.examTime,
questionCount: this.questionList.length, // questionCount: this.questionList.length,
switchCount: this.switchCount, // switchCount: this.switchCount,
examNum: this.examNum, // examNum: this.examNum,
examCount: this.examCount, // examCount: this.examCount,
examCustom: this.examCustom, // examCustom: this.examCustom,
results: res.examResult, // results: res.examResult,
studyId: this.studyId || '' // studyId: this.studyId || ''
} // }
uni.navigateTo({ // uni.navigateTo({
url: `/pages/YNEduApp/exam/examinationDetails?params=${JSON.stringify(params2)}` // url: `/pages/YNEduApp/exam/examinationDetails?params=${JSON.stringify(params2)}`
}) // })
}, },
// //
async openFaceScan() { async openFaceScan() {
@ -357,7 +427,7 @@ export default {
method: 'POST', method: 'POST',
header: { header: {
'content-type': 'application/json', 'content-type': 'application/json',
Authorization: 'Bearer ' + uni.getStorageSync('App-Token') Authorization: uni.getStorageSync('access_token')
}, },
data: params, data: params,
success: res => { success: res => {
@ -390,6 +460,20 @@ export default {
}) })
this.screenCount-- this.screenCount--
}, },
updStudyDurationExamPractice(params) {
uni.request({
url: config.baseUrl + '/exam-student/student/updStudyDurationExamPractice',
method: 'post',
data: params,
header: {
'Content-Type': 'application/x-www-form-urlencoded',
Authorization: uni.getStorageSync('access_token')
},
fail: err => {
console.log(err)
}
})
}
} }
} }
</script> </script>

View File

@ -71,6 +71,7 @@
<script> <script>
import { getExamRankById } from '@/api/eduApp' import { getExamRankById } from '@/api/eduApp'
import config from '@/config'
export default { export default {
data() { data() {
@ -117,6 +118,8 @@ export default {
this.examCustom = opt.examCustom this.examCustom = opt.examCustom
this.results = opt.results this.results = opt.results
this.studyId = opt.studyId || '' this.studyId = opt.studyId || ''
this.totalScore = opt.score || 100
this.passScore = opt.passScore || 60
}, },
mounted() { mounted() {
this.getExamRankById() this.getExamRankById()
@ -165,9 +168,9 @@ export default {
handleArrow() { handleArrow() {
let from = '' let from = ''
if (this.studyId) { if (this.studyId) {
from = uni.getStorageSync('from') + '?id=' + this.studyId from = '/pages/YNEduApp/learnProj/learnProjDetail?id=' + this.studyId
} else { } else {
from = uni.getStorageSync('from') from = '/pages/YNEduApp/exam/exam'
} }
console.log('🚀 ~ handleArrow ~ from:', from) console.log('🚀 ~ handleArrow ~ from:', from)
uni.navigateTo({ uni.navigateTo({
@ -179,8 +182,25 @@ export default {
const params = { const params = {
examId: this.examId examId: this.examId
} }
const res = await getExamRankById(params) // const res = await getExamRankById(params)
this.rankList = res.data // this.rankList = res.data
uni.request({
url: config.baseUrl + '/exam-student/studentExam/getExamRankById',
method: 'post',
data: params,
header: {
'Content-Type': 'application/x-www-form-urlencoded',
Authorization: uni.getStorageSync('access_token')
},
success: res => {
console.log('🚀 ~ getExamRankById ~ res:', res)
res = res.data
this.rankList = res.data
},
fail: err => {
console.log(err)
}
})
} }
} }
} }

View File

@ -40,43 +40,13 @@
<script> <script>
import { getExamRecordById } from '@/api/eduApp' import { getExamRecordById } from '@/api/eduApp'
import config from '@/config'
export default { export default {
data() { data() {
return { return {
examId: '', // id examId: '', // id
list: [ list: []
{
id: 1,
//
time: '2023年04月27日 14:23',
//
pass: false,
//
answerTime: '30分钟',
//
score: 60,
//
totalScore: 100,
//
scoreRate: '60%'
},
{
id: 2,
//
time: '2023年04月27日 14:23',
//
pass: true,
//
answerTime: '30分钟',
//
score: 60,
//
totalScore: 100,
//
scoreRate: '60%'
}
]
} }
}, },
onLoad(opt) { onLoad(opt) {
@ -93,9 +63,26 @@ export default {
page: 1, page: 1,
limit: 999 limit: 999
} }
const res = await getExamRecordById(params) // const res = await getExamRecordById(params)
console.log('🚀 ~ getList ~ res:', res) // console.log('🚀 ~ getList ~ res:', res)
this.list = res.data // this.list = res.data
uni.request({
url: config.baseUrl + '/exam-student/studentExam/getExamRecordById',
method: 'get',
data: params,
header: {
'Content-Type': 'application/x-www-form-urlencoded',
Authorization: uni.getStorageSync('access_token')
},
success: res => {
console.log('🚀 ~ getList ~ res:', res)
res = res.data
this.list = res.data
},
fail: err => {
console.log(err)
}
})
}, },
// //
handleExamList(item) { handleExamList(item) {

View File

@ -125,6 +125,7 @@
<script> <script>
import { getExamRecordAnswer } from '@/api/eduApp' import { getExamRecordAnswer } from '@/api/eduApp'
import config from '@/config'
export default { export default {
data() { data() {
@ -478,8 +479,21 @@ export default {
examId: this.examId, examId: this.examId,
recordId: this.recordId recordId: this.recordId
} }
const res = await getExamRecordAnswer(params) // const res = await getExamRecordAnswer(params)
this.questionList = res.data.examPaperData // this.questionList = res.data.examPaperData
uni.request({
url: config.baseUrl + '/exam-student/studentExam/getExamRecordAnswer',
method: 'post',
data: params,
header: {
'Content-Type': 'application/x-www-form-urlencoded',
Authorization: uni.getStorageSync('access_token')
},
success: res => {
res = res.data
this.questionList = res.data.examPaperData
}
})
this.list = this.questionList this.list = this.questionList
this.list.forEach((item, index) => { this.list.forEach((item, index) => {
if (index < 7) { if (index < 7) {

View File

@ -95,48 +95,35 @@ export default {
msgList: [] msgList: []
} }
}, },
mounted() { onLoad() {
this.getUserInfo() console.log('🚀 ~ mounted ~ mounted-index:')
this.getList()
this.getMsgList()
}, },
methods: { methods: {
//
getUserInfo() {
const params = {
username: uni.getStorageSync('userPhone'),
jwtToken: uni.getStorageSync('jwtToken')
}
uni.removeStorageSync('App-Token')
uni.request({
url: config.login + '/login',
method: 'POST',
data: JSON.stringify(params),
header: {
'Content-Type': 'application/json'
},
success: res => {
console.log(res)
let req = res.data
console.log('🚀 ~ getUserInfo ~ req:', req, req.data.access_token)
uni.setStorageSync('App-Token', req.data.access_token)
uni.setStorageSync('userId', req.data.loginUser.userId)
setTimeout(() => {
// this.getList()
}, 1000)
this.getMsgList()
},
fail: err => {
console.log(err)
}
})
},
async getList() { async getList() {
this.taskList = [] this.taskList = []
let params = { let params = {
userId: this.userId, userId: this.userId,
status: '0' status: '0'
} }
const res = await getStudentStudyWorkList(params) // const res = await getStudentStudyWorkList(params)
this.taskList = res.data // console.log('🚀 ~ getList ~ res:', res)
// this.taskList = res.data
uni.request({
url: config.baseUrl + '/exam-student/personalCenter/getStudentStudyWorkList',
method: 'post',
header: {
'Content-Type': 'application/x-www-form-urlencoded',
Authorization: uni.getStorageSync('access_token')
},
data: params,
success: res => {
console.log('🚀 ~ getList ~ res:', res)
res = res.data
this.taskList = res.data
}
})
}, },
// //
async toggleSearch() { async toggleSearch() {
@ -147,8 +134,22 @@ export default {
status: '0', status: '0',
name: this.keyword name: this.keyword
} }
const res = await getStudentStudyWorkList(params) // const res = await getStudentStudyWorkList(params)
this.taskList = res.data // this.taskList = res.data
uni.request({
url: config.baseUrl + '/exam-student/personalCenter/getStudentStudyWorkList',
method: 'post',
header: {
'Content-Type': 'application/x-www-form-urlencoded',
Authorization: uni.getStorageSync('access_token')
},
data: params,
success: res => {
console.log('🚀 ~ getList ~ res:', res)
res = res.data
this.taskList = res.data
}
})
}, },
// //
async getMsgList() { async getMsgList() {
@ -157,7 +158,7 @@ export default {
method: 'post', method: 'post',
data: {}, data: {},
header: { header: {
Authorization: this.token Authorization: uni.getStorageSync('access_token')
}, },
success: res => { success: res => {
console.log('🚀 ~ getMsgList ~ res:', res) console.log('🚀 ~ getMsgList ~ res:', res)

View File

@ -106,10 +106,27 @@ export default {
studyPercentage: this.studyPercentage studyPercentage: this.studyPercentage
} }
console.log('🚀 ~ handleEnd ~ params:', params) console.log('🚀 ~ handleEnd ~ params:', params)
updStudyDuration(params).then(res => { // updStudyDuration(params).then(res => {
console.log('🚀 ~ handleEnd ~ res:', res) // console.log('🚀 ~ handleEnd ~ res:', res)
this.showModal = false // this.showModal = false
uni.navigateBack() // uni.navigateBack()
// })
uni.request({
url: config.baseUrl + '/exam-student/student/updStudyDuration',
method: 'post',
data: params,
header: {
'Content-Type': 'application/x-www-form-urlencoded',
Authorization: uni.getStorageSync('access_token')
},
success: res => {
console.log('🚀 ~ handleEnd ~ res:', res)
this.showModal = false
uni.navigateBack()
},
fail: err => {
console.log('🚀 ~ handleEnd ~ err:', err)
}
}) })
} }
} }

View File

@ -53,6 +53,7 @@
<script> <script>
import { getStudentStudyWorkList } from '@/api/eduApp' import { getStudentStudyWorkList } from '@/api/eduApp'
import config from '@/config'
export default { export default {
data() { data() {
@ -171,9 +172,9 @@ export default {
userId: uni.getStorageSync('userId'), userId: uni.getStorageSync('userId'),
status: '-1' status: '-1'
} }
const res = await getStudentStudyWorkList(params) // const res = await getStudentStudyWorkList(params)
this.projList = res.data // this.projList = res.data
console.log('🚀 ~ getList ~ res:', res) this.getStudentStudyWorkList(params)
}, },
async chooseStatus(count) { async chooseStatus(count) {
this.projList = [] this.projList = []
@ -191,8 +192,9 @@ export default {
} else if (count === 2) { } else if (count === 2) {
params.status = '0' params.status = '0'
} }
const res = await getStudentStudyWorkList(params) // const res = await getStudentStudyWorkList(params)
this.projList = res.data // this.projList = res.data
this.getStudentStudyWorkList(params)
}, },
async toggleSearch() { async toggleSearch() {
this.projList = [] this.projList = []
@ -209,8 +211,9 @@ export default {
} else if (this.totalStatus.statusCount === 2) { } else if (this.totalStatus.statusCount === 2) {
params.status = '0' params.status = '0'
} }
const res = await getStudentStudyWorkList(params) // const res = await getStudentStudyWorkList(params)
this.projList = res.data // this.projList = res.data
this.getStudentStudyWorkList(params)
}, },
statusChange(item) { statusChange(item) {
console.log(this.totalStatus) console.log(this.totalStatus)
@ -224,6 +227,25 @@ export default {
uni.navigateTo({ uni.navigateTo({
url: '/pages/YNEduApp/index/index' url: '/pages/YNEduApp/index/index'
}) })
},
getStudentStudyWorkList(params) {
uni.request({
url: config.baseUrl + '/exam-student/personalCenter/getStudentStudyWorkList',
method: 'post',
header: {
'Content-Type': 'application/x-www-form-urlencoded',
Authorization: uni.getStorageSync('access_token')
},
data: params,
success: res => {
console.log('🚀 ~ getList ~ res:', res)
res = res.data
this.projList = res.data
},
fail: err => {
console.log(err)
}
})
} }
} }
} }

View File

@ -56,7 +56,12 @@
</div> </div>
<div class="right-content"> <div class="right-content">
<div class="progress"> <div class="progress">
<u-line-progress :percentage="item.studyPercentage" :showText="false" activeColor="#579AF8" height="8" /> <u-line-progress
:percentage="item.studyPercentage"
:showText="false"
activeColor="#579AF8"
height="8"
/>
</div> </div>
<div>{{ item.studyPercentage || 0 }}%</div> <div>{{ item.studyPercentage || 0 }}%</div>
</div> </div>
@ -69,6 +74,7 @@
class="list-wrapper" class="list-wrapper"
v-for="(item, index) in content.studyList" v-for="(item, index) in content.studyList"
:key="index" :key="index"
@click="toggleTheoryLearn(item, content)"
> >
<div class="left-content"> <div class="left-content">
<div class="title"> <div class="title">
@ -80,7 +86,12 @@
</div> </div>
<div class="right-content"> <div class="right-content">
<div class="progress"> <div class="progress">
<u-line-progress :percentage="item.studyPercentage" :showText="false" activeColor="#579AF8" height="8" /> <u-line-progress
:percentage="item.studyPercentage"
:showText="false"
activeColor="#579AF8"
height="8"
/>
</div> </div>
<div>{{ item.studyPercentage || 0 }}%</div> <div>{{ item.studyPercentage || 0 }}%</div>
</div> </div>
@ -213,11 +224,6 @@ export default {
// ] // ]
} }
}, },
onShow() {
console.log('🚀 ~ onShow ~ ')
//
this.getStudyWorkAll()
},
onLoad(params) { onLoad(params) {
this.projId = params.id this.projId = params.id
console.log('🚀 ~ onLoad ~ this.projId:', this.projId) console.log('🚀 ~ onLoad ~ this.projId:', this.projId)
@ -234,7 +240,7 @@ export default {
data: params, data: params,
header: { header: {
'Content-Type': 'application/x-www-form-urlencoded', 'Content-Type': 'application/x-www-form-urlencoded',
Authorization: getToken() Authorization: uni.getStorageSync('access_token')
}, },
dataType: 'json', dataType: 'json',
success: res => { success: res => {
@ -250,7 +256,7 @@ export default {
}, },
// //
toggleTheoryLearn(item, content) { toggleTheoryLearn(item, content) {
console.log('🚀 ~ toggleTheoryLearn ~ content:',item, content) console.log('🚀 ~ toggleTheoryLearn ~ content:', item, content)
const params = { const params = {
userId: uni.getStorageSync('userId'), // id userId: uni.getStorageSync('userId'), // id
studyId: this.studyId, // id studyId: this.studyId, // id
@ -261,11 +267,22 @@ export default {
sourceId: item.id, // id sourceId: item.id, // id
path: item.path, // path: item.path, //
studyDuration: item.studyDuration || 0, // studyDuration: item.studyDuration || 0, //
allStudyDuration: item.allStudyDuration, // allStudyDuration: item.allStudyDuration //
} }
console.log('🚀 ~ toggleTheoryLearn ~ params:', params) console.log('🚀 ~ toggleTheoryLearn ~ params:', params)
console.log('🚀 ~ toggleTheoryLearn ~ item:', item.studyName)
let url = ''
// item.studyName .mp4
if (item.studyName.includes('.mp4')) {
url = '/pages/YNEduApp/learn/learn'
} else if (item.studyName.includes('.pdf')) {
// url = '/pages/YNEduApp/learn/pdfStudy'
//
return
}
uni.navigateTo({ uni.navigateTo({
url: '/pages/YNEduApp/learn/learn?params=' + JSON.stringify(params) url: url + '?params=' + JSON.stringify(params)
}) })
}, },
// - // -
@ -278,7 +295,7 @@ export default {
practiceId: item.practiceMsg.id, // id practiceId: item.practiceMsg.id, // id
title: item.practiceMsg.name, title: item.practiceMsg.name,
name: item.practiceMsg.name, name: item.practiceMsg.name,
studyId: this.studyId, // id studyId: this.studyId // id
} }
uni.navigateTo({ uni.navigateTo({
url: '/pages/YNEduApp/prac/pracDetail?params=' + JSON.stringify(params) url: '/pages/YNEduApp/prac/pracDetail?params=' + JSON.stringify(params)
@ -297,7 +314,9 @@ export default {
examCount: item.examMsg.examCount, // 1: 2: 3: examCount: item.examMsg.examCount, // 1: 2: 3:
examCustom: item.examMsg.examCustom, // examCustom: item.examMsg.examCustom, //
studyId: this.studyId, // id studyId: this.studyId, // id
responseTime: item.examMsg.responseTime // responseTime: item.examMsg.responseTime, //
score: item.examMsg.score, //
passScore: item.examMsg.passScore //
} }
console.log('🚀 ~ toggleTheoryExam ~ params:', params) console.log('🚀 ~ toggleTheoryExam ~ params:', params)
uni.navigateTo({ uni.navigateTo({

View File

@ -196,7 +196,7 @@ import {
updateRemoveRecordData, // updateRemoveRecordData, //
updStudyDurationExamPractice updStudyDurationExamPractice
} from '@/api/eduApp' } from '@/api/eduApp'
import config from 'config' import config from '@/config'
export default { export default {
data() { data() {
@ -239,8 +239,6 @@ export default {
this.isError = opt.isError || '' this.isError = opt.isError || ''
this.studyId = opt.studyId || '' this.studyId = opt.studyId || ''
console.log('🚀 ~ onLoad ~ opt:', opt) console.log('🚀 ~ onLoad ~ opt:', opt)
},
mounted() {
// //
this.startTimer() this.startTimer()
this.getPracticeItData() this.getPracticeItData()
@ -259,12 +257,32 @@ export default {
isNew: this.isNew || '', isNew: this.isNew || '',
isMiss: this.isError ? 1 : '' isMiss: this.isError ? 1 : ''
} }
const res = await getPracticeItData(params) // const res = await getPracticeItData(params)
this.trueNum = res.data.trueNum // this.trueNum = res.data.trueNum
this.falseNum = res.data.falseNum // this.falseNum = res.data.falseNum
this.allNum = res.data.allNum // this.allNum = res.data.allNum
this.nowNum = res.data.nowNum // this.nowNum = res.data.nowNum
console.log('🚀 ~ getPracticeItData ~ res:', res) // console.log('🚀 ~ getPracticeItData ~ res:', res)
uni.request({
url: config.baseUrl + '/exam-student/studentPractice/getPracticeItData',
method: 'post',
data: params,
header: {
'Content-Type': 'application/x-www-form-urlencoded',
Authorization: uni.getStorageSync('access_token')
},
success: res => {
console.log('🚀 ~ getPracticeItData ~ res:', res)
res = res.data
this.trueNum = res.data.trueNum
this.falseNum = res.data.falseNum
this.allNum = res.data.allNum
this.nowNum = res.data.nowNum
},
fail: err => {
console.log(err)
}
})
}, },
// //
async getPracticeQuestion() { async getPracticeQuestion() {
@ -276,14 +294,33 @@ export default {
isOutOfOrder: this.isOutOfOrder || '', isOutOfOrder: this.isOutOfOrder || '',
isMiss: this.isError ? 1 : '' isMiss: this.isError ? 1 : ''
} }
const res = await getPracticeQuestion(params) // const res = await getPracticeQuestion(params)
this.recordId = res.data.recordId // this.recordId = res.data.recordId
this.questionList.push(res.data) // this.questionList.push(res.data)
console.log('🚀 ~ getPracticeQuestion ~ res:', res) // console.log('🚀 ~ getPracticeQuestion ~ res:', res)
console.log('🚀 ~ getPracticeQuestion ~ this.questionList:', this.questionList) // console.log('🚀 ~ getPracticeQuestion ~ this.questionList:', this.questionList)
uni.request({
url: config.baseUrl + '/exam-student/studentPractice/getPracticeQuestion',
method: 'post',
data: params,
header: {
'Content-Type': 'application/x-www-form-urlencoded',
Authorization: uni.getStorageSync('access_token')
},
success: res => {
console.log('🚀 ~ getPracticeQuestion ~ res:', res)
res = res.data
this.recordId = res.data.recordId ? res.data.recordId : this.recordId
this.questionList.push(res.data)
},
fail: err => {
console.log(err)
}
})
}, },
// //
async handleJump(item, index) { async handleJump(item, index) {
console.log('🚀 ~ handleJump ~ item:', item, this.recordId)
if (item === 'prev') { if (item === 'prev') {
this.nowNum -= 1 this.nowNum -= 1
} else if (item === 'next') { } else if (item === 'next') {
@ -296,13 +333,32 @@ export default {
this.questionList = [] this.questionList = []
const params = { const params = {
recordId: this.recordId || '', recordId: this.recordId || '',
practiceId: this.practiceId,
operate: item || '', operate: item || '',
sort: this.nowNum, sort: this.nowNum,
isMiss: this.isError ? 1 : '' isMiss: this.isError ? 1 : ''
} }
const res = await changeQuestion(params) console.log('🚀 ~ handleJump ~ params:', params)
this.questionList.push(res.data) // const res = await changeQuestion(params)
console.log('🚀 ~ handleJump ~ res:', res) // this.questionList.push(res.data)
// console.log('🚀 ~ handleJump ~ res:', res)
uni.request({
url: config.baseUrl + '/exam-student/studentPractice/changeQuestion',
method: 'post',
data: params,
header: {
'Content-Type': 'application/x-www-form-urlencoded',
Authorization: uni.getStorageSync('access_token')
},
success: res => {
console.log('🚀 ~ handleJump ~ res:', res)
res = res.data
this.questionList.push(res.data)
},
fail: err => {
console.log(err)
}
})
}, },
// - // -
async getPracticeQuestionList() { async getPracticeQuestionList() {
@ -311,9 +367,26 @@ export default {
id: this.practiceId, id: this.practiceId,
isMiss: this.isError ? 1 : '' isMiss: this.isError ? 1 : ''
} }
const res = await getPracticeQuestionList(params) // const res = await getPracticeQuestionList(params)
console.log('🚀 ~ getPracticeQuestionList ~ res:', res) // console.log('🚀 ~ getPracticeQuestionList ~ res:', res)
this.questionListSelect = res.data // this.questionListSelect = res.data
uni.request({
url: config.baseUrl + '/exam-student/studentPractice/getPracticeQuestionList',
method: 'post',
data: params,
header: {
'Content-Type': 'application/x-www-form-urlencoded',
Authorization: uni.getStorageSync('access_token')
},
success: res => {
console.log('🚀 ~ getPracticeQuestionList ~ res:', res)
res = res.data
this.questionListSelect = res.data
},
fail: err => {
console.log(err)
}
})
}, },
// - // -
startTimer() { startTimer() {
@ -386,7 +459,19 @@ export default {
} }
console.log('🚀 ~ handleOption ~ params:', params) console.log('🚀 ~ handleOption ~ params:', params)
// //
insertPracticeAnswerById(params) // insertPracticeAnswerById(params)
uni.request({
url: config.baseUrl + 'exam-student/studentPractice/insertPracticeAnswerById',
method: 'post',
data: params,
header: {
'Content-Type': 'application/x-www-form-urlencoded',
Authorization: uni.getStorageSync('access_token')
},
success: res => {
console.log('🚀 ~ handleOption ~ res:', res)
}
})
} }
}, },
// //
@ -452,7 +537,19 @@ export default {
isTrue: isCorrect ? 1 : 0 isTrue: isCorrect ? 1 : 0
} }
console.log('🚀 ~ handleOk ~ params-多选:', params) console.log('🚀 ~ handleOk ~ params-多选:', params)
insertPracticeAnswerById(params) // insertPracticeAnswerById(params)
uni.request({
url: config.baseUrl + 'exam-student/studentPractice/insertPracticeAnswerById',
method: 'post',
data: params,
header: {
'Content-Type': 'application/x-www-form-urlencoded',
Authorization: uni.getStorageSync('access_token')
},
success: res => {
console.log('🚀 ~ handleOption ~ res:', res)
}
})
} }
}, },
// //
@ -462,14 +559,33 @@ export default {
const params = { const params = {
id: this.practiceId id: this.practiceId
} }
const res = await getPracticeQuestionRate(params) // const res = await getPracticeQuestionRate(params)
// trueRate // // trueRate
this.correctRate = res.data.trueRate // this.correctRate = res.data.trueRate
// allQuestionNum // // allQuestionNum
this.answerNum = res.data.allQuestionNum // this.answerNum = res.data.allQuestionNum
// trueQuestionNum // // trueQuestionNum
this.trueNum = res.data.trueQuestionNum // this.trueNum = res.data.trueQuestionNum
console.log('🚀 ~ handleSubmit ~ res:', res) // console.log('🚀 ~ handleSubmit ~ res:', res)
uni.request({
url: config.baseUrl + '/exam-student/studentPractice/getPracticeQuestionRate',
method: 'post',
data: params,
header: {
'Content-Type': 'application/x-www-form-urlencoded',
Authorization: uni.getStorageSync('access_token')
},
success: res => {
console.log('🚀 ~ handleSubmit ~ res:', res)
res = res.data
this.correctRate = res.data.trueRate
this.answerNum = res.data.allQuestionNum
this.trueNum = res.data.trueQuestionNum
},
fail: err => {
console.log(err)
}
})
}, },
handleConfirm() { handleConfirm() {
console.log('确认') console.log('确认')
@ -481,14 +597,45 @@ export default {
clearInterval() clearInterval()
console.log('结束') console.log('结束')
// //
savePracticeDuration({ // savePracticeDuration({
// id: this.practiceId,
// practiceDuration: Math.ceil(this.usedTime.split(':')[0] * 60 + this.usedTime.split(':')[1] / 60)
// })
const params = {
id: this.practiceId, id: this.practiceId,
practiceDuration: Math.ceil(this.usedTime.split(':')[0] * 60 + this.usedTime.split(':')[1] / 60) practiceDuration: Math.ceil(this.usedTime.split(':')[0] * 60 + this.usedTime.split(':')[1] / 60)
}
console.log('🚀 ~ handleClose ~ params:', params)
uni.request({
url: config.baseUrl + '/exam-student/studentPractice/savePracticeDuration',
method: 'post',
data: params,
header: {
'Content-Type': 'application/x-www-form-urlencoded',
Authorization: uni.getStorageSync('access_token')
},
fail: err => {
console.log(err)
}
}) })
if (this.isError) { if (this.isError) {
// //
updateRemoveRecordData({ // updateRemoveRecordData({
practiceId: this.practiceId // practiceId: this.practiceId
// })
uni.request({
url: config.baseUrl + '/exam-student/studentPractice/updateRemoveRecordData',
method: 'post',
data: {
practiceId: this.practiceId
},
header: {
'Content-Type': 'application/x-www-form-urlencoded',
Authorization: uni.getStorageSync('access_token')
},
fail: err => {
console.log(err)
}
}) })
} }
if (this.studyId) { if (this.studyId) {
@ -496,17 +643,52 @@ export default {
userId: uni.getStorageSync('userId'), userId: uni.getStorageSync('userId'),
studyId: this.studyId studyId: this.studyId
} }
updStudyDurationExamPractice(params) // updStudyDurationExamPractice(params)
uni.request({
url: config.baseUrl + '/exam-student/student/updStudyDurationExamPractice',
method: 'post',
data: params,
header: {
'Content-Type': 'application/x-www-form-urlencoded',
Authorization: uni.getStorageSync('access_token')
},
fail: err => {
console.log(err)
}
})
uni.redirectTo({
url: '/pages/YNEduApp/learnProj/learnProjDetail?studyId=' + this.studyId
})
} }
this.showModal = false this.showModal = false
uni.navigateBack() // uni.navigateBack()
uni.redirectTo({
url: '/pages/YNEduApp/prac/prac'
})
}, },
// //
async openSelect() { async openSelect() {
this.showModalSelect = true this.showModalSelect = true
const res = await this.getPracticeQuestionList() // const res = await this.getPracticeQuestionList()
console.log('🚀 ~ openSelect ~ res:', res) // console.log('🚀 ~ openSelect ~ res:', res)
this.questionListSelect = res.data // this.questionListSelect = res.data
uni.request({
url: config.baseUrl + '/exam-student/studentPractice/getPracticeQuestionList',
method: 'post',
data: params,
header: {
'Content-Type': 'application/x-www-form-urlencoded',
Authorization: uni.getStorageSync('access_token')
},
success: res => {
console.log('🚀 ~ getPracticeQuestionList ~ res:', res)
res = res.data
this.questionListSelect = res.data
},
fail: err => {
console.log(err)
}
})
} }
} }
} }

View File

@ -23,7 +23,7 @@
<div class="score">完成率{{ item.completionRate }}</div> <div class="score">完成率{{ item.completionRate }}</div>
<div class="btn-wrapper"> <div class="btn-wrapper">
<div class="btn" @click="handleExercise(item)">开始练习</div> <div class="btn" @click="handleExercise(item)">开始练习</div>
<div class="btn" @click="handleError(item)">错题消除({{ item.missNum }})</div> <div v-if="item.missNum > 0" class="btn" @click="handleError(item)">错题消除({{ item.missNum }})</div>
</div> </div>
</div> </div>
</div> </div>
@ -39,6 +39,7 @@
<script> <script>
import { getStudentPracticeList } from '@/api/eduApp' import { getStudentPracticeList } from '@/api/eduApp'
import config from '@/config';
export default { export default {
data() { data() {
@ -54,7 +55,7 @@ export default {
alreadyList: [] alreadyList: []
} }
}, },
mounted() { onLoad() {
this.getList() this.getList()
}, },
methods: { methods: {
@ -63,12 +64,31 @@ export default {
userId: uni.getStorageSync('userId'), userId: uni.getStorageSync('userId'),
source: 1 source: 1
} }
const res = await getStudentPracticeList(params) // const res = await getStudentPracticeList(params)
this.list = this.allList = res.data // this.list = this.allList = res.data
// alreadyNum // // alreadyNum
this.waitList = res.data.filter(item => item.alreadyNum === 0) // this.waitList = res.data.filter(item => item.alreadyNum === 0)
this.alreadyList = res.data.filter(item => item.alreadyNum > 0) // this.alreadyList = res.data.filter(item => item.alreadyNum > 0)
// console.log('🚀 ~ getList ~ res:', res) // console.log('🚀 ~ getList ~ res:', res)
uni.request({
url: config.baseUrl + '/exam-student/personalCenter/getStudentPracticeList',
method: 'post',
header: {
'Content-Type': 'application/x-www-form-urlencoded',
Authorization: uni.getStorageSync('access_token')
},
data: params,
success: res => {
res = res.data
console.log('🚀 ~ getList ~ res:', res)
this.list = this.allList = res.data
this.waitList = res.data.filter(item => item.alreadyNum === 0)
this.alreadyList = res.data.filter(item => item.alreadyNum > 0)
},
fail: err => {
console.log('🚀 ~ getList ~ err:', err)
}
})
}, },
handleTab(item, index) { handleTab(item, index) {
this.activeIndex = index this.activeIndex = index
@ -82,9 +102,11 @@ export default {
}, },
// //
handleExercise(item) { handleExercise(item) {
console.log('🚀 ~ handleExercise ~ item:', item)
const params = { const params = {
practiceId: item.id, practiceId: item.id,
title: item.name, title: item.name || '',
isNew: item.alreadyNum == 0 ? true : false
} }
uni.navigateTo({ uni.navigateTo({
url: '/pages/YNEduApp/prac/pracDetail?params=' + JSON.stringify(params) url: '/pages/YNEduApp/prac/pracDetail?params=' + JSON.stringify(params)
@ -104,6 +126,7 @@ export default {
recordId: item.recordId, recordId: item.recordId,
isError: true isError: true
} }
console.log('🚀 ~ handleError ~ params:', params)
uni.navigateTo({ uni.navigateTo({
url: '/pages/YNEduApp/prac/exercises?params=' + JSON.stringify(params) url: '/pages/YNEduApp/prac/exercises?params=' + JSON.stringify(params)
}) })

View File

@ -33,7 +33,7 @@
<div class="right"> <div class="right">
<div class="right-top"> <div class="right-top">
<div class="right-text">顺序练习</div> <div class="right-text">顺序练习</div>
<div class="btn"> <div class="btn" v-if="!isNew">
<u-button <u-button
type="primary" type="primary"
plain plain
@ -56,7 +56,7 @@
</div> </div>
<div class="right-bottom"> <div class="right-bottom">
<div class="right-text">随机练习</div> <div class="right-text">随机练习</div>
<div class="btn"> <div class="btn" v-if="!isNew">
<u-button <u-button
type="primary" type="primary"
plain plain
@ -89,6 +89,7 @@
<script> <script>
import { getPracticeQuestionRate } from '@/api/eduApp' import { getPracticeQuestionRate } from '@/api/eduApp'
import config from '@/config'
export default { export default {
data() { data() {
@ -107,33 +108,56 @@ export default {
totalAnswer: 0, totalAnswer: 0,
// //
totalCorrect: 0, totalCorrect: 0,
studyId: '' // id studyId: '', // id
isNew: true //
} }
}, },
onShow() {
},
onLoad(opt) { onLoad(opt) {
opt = JSON.parse(opt.params) opt = JSON.parse(opt.params)
console.log('🚀 ~ onLoad ~ opt:', opt) console.log('🚀 ~ onLoad ~ opt:', opt)
this.practiceId = opt.practiceId this.practiceId = opt.practiceId
this.title = opt.title this.title = opt.title
this.studyId = opt.studyId || '' // id this.studyId = opt.studyId || '' // id
}, this.isNew = opt.isNew
onShow() {
this.getData() this.getData()
}, },
methods: { methods: {
async getData() { async getData() {
const params = { const params = {
id: this.practiceId id: this.practiceId
} }
const res = await getPracticeQuestionRate(params) // const res = await getPracticeQuestionRate(params)
this.title = res.data.name // this.title = res.data.name
this.userName = res.data.userName // this.userName = res.data.userName
this.correctRate = res.data.trueRate // this.correctRate = res.data.trueRate
this.totalAnswer = res.data.allQuestionNum // this.totalAnswer = res.data.allQuestionNum
this.totalCorrect = res.data.trueQuestionNum // this.totalCorrect = res.data.trueQuestionNum
this.recordId = res.data.recordId // this.recordId = res.data.recordId
console.log('🚀 ~ getData ~ res:', res) // console.log('🚀 ~ getData ~ res:', res)
uni.request({
url: config.baseUrl + '/exam-student/studentPractice/getPracticeQuestionRate',
method: 'post',
data: params,
header: {
'Content-Type': 'application/x-www-form-urlencoded',
Authorization: uni.getStorageSync('access_token')
},
success: res => {
res = res.data
console.log('🚀 ~ handleSubmit ~ res:', res)
// this.title = res.data.name
// this.userName = res.data.userName
// this.correctRate = res.data.trueRate
// this.totalAnswer = res.data.allQuestionNum
// this.totalCorrect = res.data.trueQuestionNum
// this.recordId = res.data.recordId
},
fail: err => {
console.log(err)
}
})
}, },
handleExercises(type) { handleExercises(type) {
console.log('type', type) console.log('type', type)

View File

@ -46,7 +46,7 @@
:isLink="true" :isLink="true"
:border="false" :border="false"
> >
<span slot="value">{{ infos.unit }}</span> <span slot="value" style="width: 180px;">{{ infos.unit }}</span>
</u-cell> </u-cell>
</u-cell-group> </u-cell-group>
</view> </view>

View File

@ -50,7 +50,7 @@ export default {
url: '', url: '',
facePath: '', facePath: '',
optMode: 'add', optMode: 'add',
token: uni.getStorageSync('App-Token'), token: uni.getStorageSync('access_token'),
userId: uni.getStorageSync('userId') userId: uni.getStorageSync('userId')
} }
}, },

View File

@ -14,13 +14,13 @@ export default {
data() { data() {
return { return {
userId: uni.getStorageSync('userId'), userId: uni.getStorageSync('userId'),
token: uni.getStorageSync('App-Token'), token: uni.getStorageSync('access_token'),
// //
msgList: [] msgList: []
} }
}, },
onLoad() { onLoad() {
// this.getMsgList() this.getMsgList()
}, },
methods: { methods: {
// //

View File

@ -45,9 +45,9 @@ import config from '@/config'
export default { export default {
data() { data() {
return { return {
userName: '', userName: uni.getStorageSync('userName'),
className: '', className: uni.getStorageSync('className'),
facePath: '', facePath: uni.getStorageSync('facePath'),
tabbar: TabbarConfig, tabbar: TabbarConfig,
// //
learnStats: { learnStats: {
@ -63,13 +63,12 @@ export default {
{ id: 3, title: '我的消息', src: '/static/eduImg/myMsg.png', path: 'myMsg' }, { id: 3, title: '我的消息', src: '/static/eduImg/myMsg.png', path: 'myMsg' },
{ id: 4, title: '设置', src: '/static/eduImg/settings.png', path: 'settings' } { id: 4, title: '设置', src: '/static/eduImg/settings.png', path: 'settings' }
], ],
token: uni.getStorageSync('App-Token') token: uni.getStorageSync('access_token')
} }
}, },
onLoad() { onLoad() {
// this.token = uni.getStorageSync('App-Token') // this.token = uni.getStorageSync('App-Token')
console.log('🚀 ~ onLoad ~ this.token:', this.token) console.log('🚀 ~ onLoad ~ this.token:', this.token)
this.getUserInfo()
this.getLearnStats() this.getLearnStats()
}, },
methods: { methods: {
@ -78,48 +77,25 @@ export default {
url: `/pages/YNEduApp/user/${path}` url: `/pages/YNEduApp/user/${path}`
}) })
}, },
//
getUserInfo() {
const params = {
username: uni.getStorageSync('userPhone'),
jwtToken: uni.getStorageSync('jwtToken')
}
uni.request({
url: config.login + '/login',
method: 'POST',
data: JSON.stringify(params),
header: {
'Content-Type': 'application/json'
},
success: res => {
console.log(res)
let req = res.data
console.log('🚀 ~ getUserInfo ~ req:', req)
this.userName = req.data.loginUser.userName
this.className = req.data.loginUser.sysUser.className
this.facePath = config.fileUrl + req.data.loginUser.sysUser.facePath
uni.setStorageSync('facePath', this.facePath)
console.log('🚀 ~ getUserInfo ~ this.facePath:', this.facePath)
},
fail: err => {
console.log(err)
}
})
},
// -- // --
getLearnStats() { getLearnStats() {
console.log('🚀 ~ getLearnStats ~ this.token:',uni.getStorageSync('access_token'))
uni.request({ uni.request({
url: config.baseUrl + '/exam-student/personalCenter/getStudyAndCer', url: config.baseUrl + '/exam-student/personalCenter/getStudyAndCer',
// url: 'http://192.168.0.137:2900' + '/exam-student/personalCenter/getStudyAndCer',
method: 'post', method: 'post',
header: { header: {
Authorization: this.token Authorization: uni.getStorageSync('access_token')
// Authorization: 'eyJhbGciOiJIUzUxMiJ9.eyJ1c2VyX2lkIjozMSwidXNlcl9rZXkiOiIzNTFmNDJjMS00YTM4LTRlMDMtOWQxYy0wMWM2YjMwY2Y3OTUiLCJ1c2VybmFtZSI6IuaWueS6riJ9.4OatIEFwP5ZgrtH0CPR5yc1-dPUCGFlXrhwmFgvcH3jXuA0PSt5JiJgcw8nMnyPIbuDBktY3c2JalZXm-_RJTQ'
}, },
data: {}, data: {},
success: res => { success: res => {
console.log('🚀 ~ getLearnStats ~ res:', res) console.log('🚀 ~ getLearnStats ~ res:', res.data)
this.allDuration = (res.data && res.data.data.allDuration) || 0 res = res.data
this.value = (res.data && res.data.data.value) || 0 if (res.code == 200) {
this.allDuration = (res.data && res.data.allDuration) || 0
this.value = (res.data && res.data.value) || 0
}
} }
}) })
}, },

View File

@ -95,6 +95,8 @@
<script> <script>
import TabbarConfig from '@/totalTabbar.js' import TabbarConfig from '@/totalTabbar.js'
import config from '@/config'
import { import {
getDayNoticeAnnoByUserId, getDayNoticeAnnoByUserId,
getAppList, getAppList,
@ -191,6 +193,31 @@
}, },
gotoYy(name) { gotoYy(name) {
if (name == '考试培训移动端') { if (name == '考试培训移动端') {
const params = {
username: uni.getStorageSync('userPhone'),
jwtToken: uni.getStorageSync('App-Token')
}
uni.request({
url: config.login + '/login',
method: 'POST',
data: JSON.stringify(params),
header: {
'Content-Type': 'application/json'
},
success: res => {
console.log(res)
let req = res.data
console.log('🚀 ~ getUserInfo ~ req:', req)
uni.setStorageSync('access_token', req.data.access_token)
uni.setStorageSync('userId', req.data.loginUser.userId)
uni.setStorageSync('userName', req.data.loginUser.userName)
uni.setStorageSync('className', req.data.loginUser.sysUser.className)
uni.setStorageSync('facePath', req.data.loginUser.sysUser.facePath)
},
fail: err => {
console.log(err)
}
})
uni.reLaunch({ uni.reLaunch({
url: '/pages/YNEduApp/index/index' url: '/pages/YNEduApp/index/index'
}) })

View File

@ -51,9 +51,7 @@ const user = {
return new Promise((resolve, reject) => { return new Promise((resolve, reject) => {
login(phone, pd) login(phone, pd)
.then(res => { .then(res => {
console.log('🚀 ~ returnnewPromise ~ res:', res)
setToken(res.data.token) setToken(res.data.token)
uni.setStorageSync('jwtToken', res.data.token)
commit('SET_TOKEN', res.data.token) commit('SET_TOKEN', res.data.token)
const user = res.data.user const user = res.data.user
commit('SET_USERID', user.id) commit('SET_USERID', user.id)
@ -96,6 +94,9 @@ const user = {
return new Promise((resolve, reject) => { return new Promise((resolve, reject) => {
commit('SET_TOKEN', '') commit('SET_TOKEN', '')
removeToken() removeToken()
uni.removeStorageSync('userPhone')
uni.removeStorageSync('userId')
uni.removeStorageSync('access_token')
storage.clean() storage.clean()
resolve() resolve()
}) })

View File

@ -5,12 +5,7 @@ import errorCode from '@/utils/errorCode'
import { toast, showConfirm, tansParams } from '@/utils/common' import { toast, showConfirm, tansParams } from '@/utils/common'
let timeout = 10000 let timeout = 10000
let baseUrl = '' const baseUrl = config.loginBaseUrl
if (uni.getStorageSync('jwtToken')) {
baseUrl = config.baseUrl
} else {
baseUrl = config.loginBaseUrl
}
console.log('baseUrl-请求', baseUrl) console.log('baseUrl-请求', baseUrl)
const request = config => { const request = config => {