This commit is contained in:
parent
be3fb04e74
commit
2c6200a92a
|
|
@ -10,157 +10,157 @@ export function getNoticeAnnoByUserId(data) {
|
|||
}
|
||||
|
||||
// 考试-列表 /personalCenter/getStudentExamList
|
||||
export function getStudentExamList(params) {
|
||||
return request({
|
||||
url: '/exam-student/personalCenter/getStudentExamList',
|
||||
method: 'post',
|
||||
data: params
|
||||
})
|
||||
}
|
||||
// export function getStudentExamList(params) {
|
||||
// return request({
|
||||
// url: '/exam-student/personalCenter/getStudentExamList',
|
||||
// method: 'post',
|
||||
// data: params
|
||||
// })
|
||||
// }
|
||||
|
||||
// 考试-题目 /studentExam/getExamQuestionList
|
||||
export function getExamQuestionList(params) {
|
||||
return request({
|
||||
url: '/exam-student/studentExam/getExamQuestionList',
|
||||
method: 'post',
|
||||
data: params
|
||||
})
|
||||
}
|
||||
// export function getExamQuestionList(params) {
|
||||
// return request({
|
||||
// url: '/exam-student/studentExam/getExamQuestionList',
|
||||
// method: 'post',
|
||||
// data: params
|
||||
// })
|
||||
// }
|
||||
|
||||
// 考试-做题 /studentExam/insertQuestionAnswerById
|
||||
export function insertQuestionAnswerById(params) {
|
||||
return request({
|
||||
url: '/exam-student/studentExam/insertQuestionAnswerById',
|
||||
method: 'post',
|
||||
data: params
|
||||
})
|
||||
}
|
||||
// export function insertQuestionAnswerById(params) {
|
||||
// return request({
|
||||
// url: '/exam-student/studentExam/insertQuestionAnswerById',
|
||||
// method: 'post',
|
||||
// data: params
|
||||
// })
|
||||
// }
|
||||
|
||||
// 考试-交卷+结果 /studentExam/commitExamByRecordId
|
||||
export function commitExamByRecordId(params) {
|
||||
return request({
|
||||
url: '/exam-student/studentExam/commitExamByRecordId',
|
||||
method: 'post',
|
||||
data: params
|
||||
})
|
||||
}
|
||||
// export function commitExamByRecordId(params) {
|
||||
// return request({
|
||||
// url: '/exam-student/studentExam/commitExamByRecordId',
|
||||
// method: 'post',
|
||||
// data: params
|
||||
// })
|
||||
// }
|
||||
|
||||
// 考试-查询结果列表 /studentExam/getExamRecordById
|
||||
export function getExamRecordById(params) {
|
||||
return request({
|
||||
url: '/exam-student/studentExam/getExamRecordById',
|
||||
method: 'get',
|
||||
data: params
|
||||
})
|
||||
}
|
||||
// export function getExamRecordById(params) {
|
||||
// return request({
|
||||
// url: '/exam-student/studentExam/getExamRecordById',
|
||||
// method: 'get',
|
||||
// data: params
|
||||
// })
|
||||
// }
|
||||
|
||||
// 考试-结果详情 studentExam/getExamRecordAnswer
|
||||
export function getExamRecordAnswer(params) {
|
||||
return request({
|
||||
url: '/exam-student/studentExam/getExamRecordAnswer',
|
||||
method: 'post',
|
||||
data: params
|
||||
})
|
||||
}
|
||||
// export function getExamRecordAnswer(params) {
|
||||
// return request({
|
||||
// url: '/exam-student/studentExam/getExamRecordAnswer',
|
||||
// method: 'post',
|
||||
// data: params
|
||||
// })
|
||||
// }
|
||||
|
||||
// 考试-排名 studentExam/getExamRankById
|
||||
export function getExamRankById(params) {
|
||||
return request({
|
||||
url: '/exam-student/studentExam/getExamRankById',
|
||||
method: 'post',
|
||||
data: params
|
||||
})
|
||||
}
|
||||
// export function getExamRankById(params) {
|
||||
// return request({
|
||||
// url: '/exam-student/studentExam/getExamRankById',
|
||||
// method: 'post',
|
||||
// data: params
|
||||
// })
|
||||
// }
|
||||
|
||||
// 练习-列表 /personalCenter/getStudentPracticeList
|
||||
export function getStudentPracticeList(params) {
|
||||
return request({
|
||||
url: '/exam-student/personalCenter/getStudentPracticeList',
|
||||
method: 'post',
|
||||
data: params
|
||||
})
|
||||
}
|
||||
// export function getStudentPracticeList(params) {
|
||||
// return request({
|
||||
// url: '/exam-student/personalCenter/getStudentPracticeList',
|
||||
// method: 'post',
|
||||
// data: params
|
||||
// })
|
||||
// }
|
||||
|
||||
// 练习-总览 /studentPractice/getPracticeQuestionRate
|
||||
export function getPracticeQuestionRate(params) {
|
||||
return request({
|
||||
url: '/exam-student/studentPractice/getPracticeQuestionRate',
|
||||
method: 'post',
|
||||
data: params
|
||||
})
|
||||
}
|
||||
// export function getPracticeQuestionRate(params) {
|
||||
// return request({
|
||||
// url: '/exam-student/studentPractice/getPracticeQuestionRate',
|
||||
// method: 'post',
|
||||
// data: params
|
||||
// })
|
||||
// }
|
||||
|
||||
// 练习-聚合数据 /studentPractice/getPracticeItData
|
||||
export function getPracticeItData(params) {
|
||||
return request({
|
||||
url: '/exam-student/studentPractice/getPracticeItData',
|
||||
method: 'post',
|
||||
data: params
|
||||
})
|
||||
}
|
||||
// export function getPracticeItData(params) {
|
||||
// return request({
|
||||
// url: '/exam-student/studentPractice/getPracticeItData',
|
||||
// method: 'post',
|
||||
// data: params
|
||||
// })
|
||||
// }
|
||||
|
||||
// 练习-题目 studentPractice/getPracticeQuestion
|
||||
export function getPracticeQuestion(params) {
|
||||
return request({
|
||||
url: '/exam-student/studentPractice/getPracticeQuestion',
|
||||
method: 'post',
|
||||
data: params
|
||||
})
|
||||
}
|
||||
// export function getPracticeQuestion(params) {
|
||||
// return request({
|
||||
// url: '/exam-student/studentPractice/getPracticeQuestion',
|
||||
// method: 'post',
|
||||
// data: params
|
||||
// })
|
||||
// }
|
||||
|
||||
// 练习-答题 studentPractice/insertPracticeAnswerById
|
||||
export function insertPracticeAnswerById(params) {
|
||||
return request({
|
||||
url: '/exam-student/studentPractice/insertPracticeAnswerById',
|
||||
method: 'post',
|
||||
data: params
|
||||
})
|
||||
}
|
||||
// export function insertPracticeAnswerById(params) {
|
||||
// return request({
|
||||
// url: '/exam-student/studentPractice/insertPracticeAnswerById',
|
||||
// method: 'post',
|
||||
// data: params
|
||||
// })
|
||||
// }
|
||||
|
||||
// 练习-前后题-跳题 studentPractice/changeQuestion
|
||||
export function changeQuestion(params) {
|
||||
return request({
|
||||
url: '/exam-student/studentPractice/changeQuestion',
|
||||
method: 'post',
|
||||
data: params
|
||||
})
|
||||
}
|
||||
// export function changeQuestion(params) {
|
||||
// return request({
|
||||
// url: '/exam-student/studentPractice/changeQuestion',
|
||||
// method: 'post',
|
||||
// data: params
|
||||
// })
|
||||
// }
|
||||
|
||||
// 练习-弹框序号跳题 /studentPractice/getPracticeQuestionList
|
||||
export function getPracticeQuestionList(params) {
|
||||
return request({
|
||||
url: '/exam-student/studentPractice/getPracticeQuestionList',
|
||||
method: 'post',
|
||||
data: params
|
||||
})
|
||||
}
|
||||
// export function getPracticeQuestionList(params) {
|
||||
// return request({
|
||||
// url: '/exam-student/studentPractice/getPracticeQuestionList',
|
||||
// method: 'post',
|
||||
// data: params
|
||||
// })
|
||||
// }
|
||||
|
||||
// 练习-保存练习时长 /studentPractice/savePracticeDuration
|
||||
export function savePracticeDuration(params) {
|
||||
return request({
|
||||
url: '/exam-student/studentPractice/savePracticeDuration',
|
||||
method: 'post',
|
||||
data: params
|
||||
})
|
||||
}
|
||||
// export function savePracticeDuration(params) {
|
||||
// return request({
|
||||
// url: '/exam-student/studentPractice/savePracticeDuration',
|
||||
// method: 'post',
|
||||
// data: params
|
||||
// })
|
||||
// }
|
||||
|
||||
// 练习-错题消除 studentPractice/updateRemoveRecordData
|
||||
export function updateRemoveRecordData(params) {
|
||||
return request({
|
||||
url: '/exam-student/studentPractice/updateRemoveRecordData',
|
||||
method: 'post',
|
||||
data: params
|
||||
})
|
||||
}
|
||||
// export function updateRemoveRecordData(params) {
|
||||
// return request({
|
||||
// url: '/exam-student/studentPractice/updateRemoveRecordData',
|
||||
// method: 'post',
|
||||
// data: params
|
||||
// })
|
||||
// }
|
||||
|
||||
// 学习项目-列表 /personalCenter/getStudentStudyWorkList
|
||||
export function getStudentStudyWorkList(params) {
|
||||
return request({
|
||||
url: '/exam-student/personalCenter/getStudentStudyWorkList',
|
||||
method: 'post',
|
||||
data: params
|
||||
})
|
||||
}
|
||||
// export function getStudentStudyWorkList(params) {
|
||||
// return request({
|
||||
// url: '/exam-student/personalCenter/getStudentStudyWorkList',
|
||||
// method: 'post',
|
||||
// data: params
|
||||
// })
|
||||
// }
|
||||
|
||||
// 学习项目-目录 /studyWork/StudyWorkAll
|
||||
// export function studyWorkAll(params) {
|
||||
|
|
@ -172,19 +172,19 @@ export function getStudentStudyWorkList(params) {
|
|||
// }
|
||||
|
||||
// 学习项目-进度 /student/updStudyDuration
|
||||
export function updStudyDuration(params) {
|
||||
return request({
|
||||
url: '/exam-student/student/updStudyDuration',
|
||||
method: 'post',
|
||||
data: params
|
||||
})
|
||||
}
|
||||
// export function updStudyDuration(params) {
|
||||
// return request({
|
||||
// url: '/exam-student/student/updStudyDuration',
|
||||
// method: 'post',
|
||||
// data: params
|
||||
// })
|
||||
// }
|
||||
|
||||
// 学习项目-考试/学习 结束 /student/updStudyDurationExamPractice
|
||||
export function updStudyDurationExamPractice(params) {
|
||||
return request({
|
||||
url: '/exam-student/student/updStudyDurationExamPractice',
|
||||
method: 'post',
|
||||
data: params
|
||||
})
|
||||
}
|
||||
// export function updStudyDurationExamPractice(params) {
|
||||
// return request({
|
||||
// url: '/exam-student/student/updStudyDurationExamPractice',
|
||||
// method: 'post',
|
||||
// data: params
|
||||
// })
|
||||
// }
|
||||
|
|
@ -4,12 +4,7 @@ import config from '@/config'
|
|||
import { getToken } from '@/utils/auth.js'
|
||||
// import store from '@/store';
|
||||
|
||||
let baseUrl = ''
|
||||
if (uni.getStorageSync('jwtToken')) {
|
||||
baseUrl = config.baseUrl
|
||||
} else {
|
||||
baseUrl = config.loginBaseUrl
|
||||
}
|
||||
const baseUrl = config.loginBaseUrl
|
||||
console.log('baseUrl-请求', baseUrl)
|
||||
|
||||
const http = new Request({
|
||||
|
|
|
|||
35
config.js
35
config.js
|
|
@ -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 = {
|
||||
// baseUrl:'/prod-api',
|
||||
// http://192.168.0.14:19999
|
||||
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.32:2900',
|
||||
loginUrl: 'http://112.29.103.165:1616',
|
||||
login: 'http://192.168.0.32:19200',
|
||||
baseUrl:'http://192.168.0.14:19999',
|
||||
// loginUrl: 'http://112.29.103.165:1616',
|
||||
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',
|
||||
bmwUrl: 'http://192.168.0.32:2911/exam-bmw',
|
||||
uploadUrl: 'http://192.168.0.14:19999/exam-file/file/uploadBase64',
|
||||
bmwUrl: 'http://192.168.0.14:19999/exam-bmw',
|
||||
// 应用信息
|
||||
appInfo: {
|
||||
// 应用名称
|
||||
|
|
|
|||
|
|
@ -6,6 +6,7 @@
|
|||
"versionCode" : 104,
|
||||
"transformPx" : false,
|
||||
"app-plus" : {
|
||||
"popGesture": "none",
|
||||
"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",
|
||||
"concatenate" : true //true则为在默认基础上追加 false则为替换默认
|
||||
|
|
|
|||
|
|
@ -64,6 +64,8 @@ export default {
|
|||
examNum: 0, // 考试次数
|
||||
examCount: 1, // 1: 不限次 2: 及格终止 3: 自定义
|
||||
examCustom: 0, // 自定义次数
|
||||
score: 0,
|
||||
passScore: 0
|
||||
}
|
||||
},
|
||||
onLoad(opt) {
|
||||
|
|
@ -75,6 +77,8 @@ export default {
|
|||
this.duration = opt.responseTime
|
||||
this.switchCount = opt.cutNum.includes('null') || opt.cutNum.includes('undefined') ? '不限次' : opt.cutNum
|
||||
this.studyId = opt.studyId
|
||||
this.score = opt.score
|
||||
this.passScore = opt.passScore
|
||||
},
|
||||
methods: {
|
||||
openModal() {
|
||||
|
|
@ -89,6 +93,8 @@ export default {
|
|||
examCount: this.examCount,
|
||||
examCustom: this.examCustom,
|
||||
studyId: this.studyId, // 学习id
|
||||
score: this.score, // 总分
|
||||
passScore: this.passScore // 及格分数
|
||||
}
|
||||
console.log('🚀 ~ handleEnterExam ~ params:', params)
|
||||
uni.navigateTo({
|
||||
|
|
|
|||
|
|
@ -22,7 +22,7 @@
|
|||
<div class="time">{{ item.validityDate }}</div>
|
||||
<div class="count-total">
|
||||
<div class="count">考试{{ item.examNum }}次</div>
|
||||
<div class="total">总分:{{ item.passScore }}</div>
|
||||
<div class="total">总分:{{ item.score }}</div>
|
||||
</div>
|
||||
<div class="bt-wrapper">
|
||||
<div class="score">得分:{{ item.examScore }}</div>
|
||||
|
|
@ -45,6 +45,7 @@
|
|||
|
||||
<script>
|
||||
import { getStudentExamList } from '@/api/eduApp/index'
|
||||
import config from '@/config'
|
||||
|
||||
export default {
|
||||
data() {
|
||||
|
|
@ -71,13 +72,33 @@ export default {
|
|||
userId: uni.getStorageSync('userId'),
|
||||
source: 1
|
||||
}
|
||||
const res = await getStudentExamList(params)
|
||||
// 根据 status 区分
|
||||
// const res = await getStudentExamList(params)
|
||||
// // 根据 status 区分
|
||||
// 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)
|
||||
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) {
|
||||
this.activeIndex = index
|
||||
if (index === 0) {
|
||||
|
|
@ -92,6 +113,7 @@ export default {
|
|||
},
|
||||
// 开始考试
|
||||
handleExamination(item) {
|
||||
console.log('🚀 ~ handleExamination ~ item:', item)
|
||||
// examCount 1: 不限次 2: 及格终止 3: 自定义
|
||||
if (item.examCount == 2 && item.results == 1) {
|
||||
uni.showToast({
|
||||
|
|
@ -114,7 +136,9 @@ export default {
|
|||
responseTime: item.responseTime, // 考试时长
|
||||
examNum: item.examNum, // 考试次数
|
||||
examCount: item.examCount, // 考试次数类型
|
||||
examCustom: item.examCustom // 自定义考试次数
|
||||
examCustom: item.examCustom, // 自定义考试次数
|
||||
score: item.score, // 总分
|
||||
passScore: item.passScore, // 及格分数
|
||||
}
|
||||
uni.navigateTo({
|
||||
url: `/pages/YNEduApp/exam/beforeExam?params=${JSON.stringify(params)}`
|
||||
|
|
@ -131,7 +155,7 @@ export default {
|
|||
handleExamDataList(item) {
|
||||
console.log('🚀 ~ handleExamDataList ~ item:', item)
|
||||
const params = {
|
||||
examId: item.id,
|
||||
examId: item.id
|
||||
}
|
||||
uni.navigateTo({
|
||||
url: `/pages/YNEduApp/exam/examinationList?params=${JSON.stringify(params)}`
|
||||
|
|
|
|||
|
|
@ -124,7 +124,7 @@ import {
|
|||
getFaceRecognition,
|
||||
updStudyDurationExamPractice
|
||||
} from '@/api/eduApp'
|
||||
import config from 'config'
|
||||
import config from '@/config'
|
||||
|
||||
export default {
|
||||
data() {
|
||||
|
|
@ -158,18 +158,22 @@ export default {
|
|||
studyId: '', // 学习id
|
||||
// 题目列表
|
||||
questionList: [],
|
||||
fileUrl: config.fileUrl
|
||||
fileUrl: config.fileUrl,
|
||||
score: 0,
|
||||
passScore: 0
|
||||
}
|
||||
},
|
||||
onLoad(opt) {
|
||||
console.log('🚀 ~ onLoad ~ opt考试中--:', opt)
|
||||
opt = JSON.parse(opt.params)
|
||||
console.log('🚀 ~ onLoad ~ opt考试中--:', opt)
|
||||
this.examId = opt.examId
|
||||
this.switchCount = Number(opt.switchCount)
|
||||
this.examNum = opt.examNum
|
||||
this.examCount = opt.examCount
|
||||
this.examCustom = opt.examCustom
|
||||
this.studyId = opt.studyId || ''
|
||||
this.score = opt.score
|
||||
this.passScore = opt.passScore
|
||||
},
|
||||
onShow() {
|
||||
setTimeout(() => {
|
||||
|
|
@ -200,15 +204,32 @@ export default {
|
|||
const params = {
|
||||
examId: this.examId
|
||||
}
|
||||
const res = await getExamQuestionList(params)
|
||||
// const res = await getExamQuestionList(params)
|
||||
// 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 ~ res考试题:', res)
|
||||
uni.request({
|
||||
url: config.baseUrl + '/exam-student/studentExam/getExamQuestionList',
|
||||
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
|
||||
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 ~ res考试题:', res)
|
||||
|
||||
console.log('🚀 ~ getList ~ this.questionList:', this.questionList)
|
||||
if (this.questionList.length > 0) {
|
||||
this.questionList.forEach((item, index) => {
|
||||
this.$set(item, 'isShow', index < 7)
|
||||
|
|
@ -224,6 +245,11 @@ export default {
|
|||
this.$refs.countDown.start()
|
||||
}, 100)
|
||||
}
|
||||
},
|
||||
fail: err => {
|
||||
console.log(err)
|
||||
}
|
||||
})
|
||||
} catch (error) {
|
||||
console.log('🚀 ~ getList ~ error:', error)
|
||||
}
|
||||
|
|
@ -299,7 +325,16 @@ export default {
|
|||
selectAnswer
|
||||
}
|
||||
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() {
|
||||
this.unDoCount = this.questionList.filter(item => !item.isActive).length
|
||||
|
|
@ -316,11 +351,18 @@ export default {
|
|||
// 时间 转换为分钟, 不足一分钟算一分钟
|
||||
answerTime: Math.ceil(this.answerTime / 60000)
|
||||
}
|
||||
const res = await commitExamByRecordId(params)
|
||||
if (this.studyId) {
|
||||
updStudyDurationExamPractice({userId: params.userId, studyId: this.studyId })
|
||||
}
|
||||
console.log('🚀 ~ handleConfirmSubmit ~ params:', params, res)
|
||||
// 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,
|
||||
|
|
@ -335,11 +377,39 @@ export default {
|
|||
examCount: this.examCount,
|
||||
examCustom: this.examCustom,
|
||||
results: res.examResult,
|
||||
studyId: this.studyId || ''
|
||||
studyId: this.studyId || '',
|
||||
score: this.score,
|
||||
passScore: this.passScore
|
||||
}
|
||||
uni.navigateTo({
|
||||
url: `/pages/YNEduApp/exam/examinationDetails?params=${JSON.stringify(params2)}`
|
||||
})
|
||||
}
|
||||
})
|
||||
if (this.studyId) {
|
||||
// updStudyDurationExamPractice({ userId: params.userId, studyId: this.studyId })
|
||||
this.updStudyDurationExamPractice({ userId: params.userId, studyId: this.studyId })
|
||||
}
|
||||
console.log('🚀 ~ handleConfirmSubmit ~ params:', params, res)
|
||||
// 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 || ''
|
||||
// }
|
||||
// uni.navigateTo({
|
||||
// url: `/pages/YNEduApp/exam/examinationDetails?params=${JSON.stringify(params2)}`
|
||||
// })
|
||||
},
|
||||
// 人脸识别
|
||||
async openFaceScan() {
|
||||
|
|
@ -357,7 +427,7 @@ export default {
|
|||
method: 'POST',
|
||||
header: {
|
||||
'content-type': 'application/json',
|
||||
Authorization: 'Bearer ' + uni.getStorageSync('App-Token')
|
||||
Authorization: uni.getStorageSync('access_token')
|
||||
},
|
||||
data: params,
|
||||
success: res => {
|
||||
|
|
@ -390,6 +460,20 @@ export default {
|
|||
})
|
||||
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>
|
||||
|
|
|
|||
|
|
@ -71,6 +71,7 @@
|
|||
|
||||
<script>
|
||||
import { getExamRankById } from '@/api/eduApp'
|
||||
import config from '@/config'
|
||||
|
||||
export default {
|
||||
data() {
|
||||
|
|
@ -117,6 +118,8 @@ export default {
|
|||
this.examCustom = opt.examCustom
|
||||
this.results = opt.results
|
||||
this.studyId = opt.studyId || ''
|
||||
this.totalScore = opt.score || 100
|
||||
this.passScore = opt.passScore || 60
|
||||
},
|
||||
mounted() {
|
||||
this.getExamRankById()
|
||||
|
|
@ -165,9 +168,9 @@ export default {
|
|||
handleArrow() {
|
||||
let from = ''
|
||||
if (this.studyId) {
|
||||
from = uni.getStorageSync('from') + '?id=' + this.studyId
|
||||
from = '/pages/YNEduApp/learnProj/learnProjDetail?id=' + this.studyId
|
||||
} else {
|
||||
from = uni.getStorageSync('from')
|
||||
from = '/pages/YNEduApp/exam/exam'
|
||||
}
|
||||
console.log('🚀 ~ handleArrow ~ from:', from)
|
||||
uni.navigateTo({
|
||||
|
|
@ -179,8 +182,25 @@ export default {
|
|||
const params = {
|
||||
examId: this.examId
|
||||
}
|
||||
const res = await getExamRankById(params)
|
||||
// const res = await getExamRankById(params)
|
||||
// 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)
|
||||
}
|
||||
})
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -40,43 +40,13 @@
|
|||
|
||||
<script>
|
||||
import { getExamRecordById } from '@/api/eduApp'
|
||||
import config from '@/config'
|
||||
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
examId: '', // 考试id
|
||||
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%'
|
||||
}
|
||||
]
|
||||
list: []
|
||||
}
|
||||
},
|
||||
onLoad(opt) {
|
||||
|
|
@ -93,10 +63,27 @@ export default {
|
|||
page: 1,
|
||||
limit: 999
|
||||
}
|
||||
const res = await getExamRecordById(params)
|
||||
// const res = await getExamRecordById(params)
|
||||
// console.log('🚀 ~ getList ~ res:', res)
|
||||
// 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) {
|
||||
const params = {
|
||||
|
|
|
|||
|
|
@ -125,6 +125,7 @@
|
|||
|
||||
<script>
|
||||
import { getExamRecordAnswer } from '@/api/eduApp'
|
||||
import config from '@/config'
|
||||
|
||||
export default {
|
||||
data() {
|
||||
|
|
@ -478,8 +479,21 @@ export default {
|
|||
examId: this.examId,
|
||||
recordId: this.recordId
|
||||
}
|
||||
const res = await getExamRecordAnswer(params)
|
||||
// const res = await getExamRecordAnswer(params)
|
||||
// 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.forEach((item, index) => {
|
||||
if (index < 7) {
|
||||
|
|
|
|||
|
|
@ -95,48 +95,35 @@ export default {
|
|||
msgList: []
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
this.getUserInfo()
|
||||
},
|
||||
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)
|
||||
onLoad() {
|
||||
console.log('🚀 ~ mounted ~ mounted-index:')
|
||||
this.getList()
|
||||
this.getMsgList()
|
||||
},
|
||||
fail: err => {
|
||||
console.log(err)
|
||||
}
|
||||
})
|
||||
},
|
||||
methods: {
|
||||
async getList() {
|
||||
this.taskList = []
|
||||
let params = {
|
||||
userId: this.userId,
|
||||
status: '0'
|
||||
}
|
||||
const res = await getStudentStudyWorkList(params)
|
||||
// const res = await getStudentStudyWorkList(params)
|
||||
// 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() {
|
||||
|
|
@ -147,8 +134,22 @@ export default {
|
|||
status: '0',
|
||||
name: this.keyword
|
||||
}
|
||||
const res = await getStudentStudyWorkList(params)
|
||||
// const res = await getStudentStudyWorkList(params)
|
||||
// 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() {
|
||||
|
|
@ -157,7 +158,7 @@ export default {
|
|||
method: 'post',
|
||||
data: {},
|
||||
header: {
|
||||
Authorization: this.token
|
||||
Authorization: uni.getStorageSync('access_token')
|
||||
},
|
||||
success: res => {
|
||||
console.log('🚀 ~ getMsgList ~ res:', res)
|
||||
|
|
|
|||
|
|
@ -106,10 +106,27 @@ export default {
|
|||
studyPercentage: this.studyPercentage
|
||||
}
|
||||
console.log('🚀 ~ handleEnd ~ params:', params)
|
||||
updStudyDuration(params).then(res => {
|
||||
// updStudyDuration(params).then(res => {
|
||||
// console.log('🚀 ~ handleEnd ~ res:', res)
|
||||
// this.showModal = false
|
||||
// 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)
|
||||
}
|
||||
})
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -53,6 +53,7 @@
|
|||
|
||||
<script>
|
||||
import { getStudentStudyWorkList } from '@/api/eduApp'
|
||||
import config from '@/config'
|
||||
|
||||
export default {
|
||||
data() {
|
||||
|
|
@ -171,9 +172,9 @@ export default {
|
|||
userId: uni.getStorageSync('userId'),
|
||||
status: '-1'
|
||||
}
|
||||
const res = await getStudentStudyWorkList(params)
|
||||
this.projList = res.data
|
||||
console.log('🚀 ~ getList ~ res:', res)
|
||||
// const res = await getStudentStudyWorkList(params)
|
||||
// this.projList = res.data
|
||||
this.getStudentStudyWorkList(params)
|
||||
},
|
||||
async chooseStatus(count) {
|
||||
this.projList = []
|
||||
|
|
@ -191,8 +192,9 @@ export default {
|
|||
} else if (count === 2) {
|
||||
params.status = '0'
|
||||
}
|
||||
const res = await getStudentStudyWorkList(params)
|
||||
this.projList = res.data
|
||||
// const res = await getStudentStudyWorkList(params)
|
||||
// this.projList = res.data
|
||||
this.getStudentStudyWorkList(params)
|
||||
},
|
||||
async toggleSearch() {
|
||||
this.projList = []
|
||||
|
|
@ -209,8 +211,9 @@ export default {
|
|||
} else if (this.totalStatus.statusCount === 2) {
|
||||
params.status = '0'
|
||||
}
|
||||
const res = await getStudentStudyWorkList(params)
|
||||
this.projList = res.data
|
||||
// const res = await getStudentStudyWorkList(params)
|
||||
// this.projList = res.data
|
||||
this.getStudentStudyWorkList(params)
|
||||
},
|
||||
statusChange(item) {
|
||||
console.log(this.totalStatus)
|
||||
|
|
@ -224,6 +227,25 @@ export default {
|
|||
uni.navigateTo({
|
||||
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)
|
||||
}
|
||||
})
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -56,7 +56,12 @@
|
|||
</div>
|
||||
<div class="right-content">
|
||||
<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>{{ item.studyPercentage || 0 }}%</div>
|
||||
</div>
|
||||
|
|
@ -69,6 +74,7 @@
|
|||
class="list-wrapper"
|
||||
v-for="(item, index) in content.studyList"
|
||||
:key="index"
|
||||
@click="toggleTheoryLearn(item, content)"
|
||||
>
|
||||
<div class="left-content">
|
||||
<div class="title">
|
||||
|
|
@ -80,7 +86,12 @@
|
|||
</div>
|
||||
<div class="right-content">
|
||||
<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>{{ item.studyPercentage || 0 }}%</div>
|
||||
</div>
|
||||
|
|
@ -213,11 +224,6 @@ export default {
|
|||
// ]
|
||||
}
|
||||
},
|
||||
onShow() {
|
||||
console.log('🚀 ~ onShow ~ ')
|
||||
// 刷新页面
|
||||
this.getStudyWorkAll()
|
||||
},
|
||||
onLoad(params) {
|
||||
this.projId = params.id
|
||||
console.log('🚀 ~ onLoad ~ this.projId:', this.projId)
|
||||
|
|
@ -234,7 +240,7 @@ export default {
|
|||
data: params,
|
||||
header: {
|
||||
'Content-Type': 'application/x-www-form-urlencoded',
|
||||
Authorization: getToken()
|
||||
Authorization: uni.getStorageSync('access_token')
|
||||
},
|
||||
dataType: 'json',
|
||||
success: res => {
|
||||
|
|
@ -250,7 +256,7 @@ export default {
|
|||
},
|
||||
// 跳转素材
|
||||
toggleTheoryLearn(item, content) {
|
||||
console.log('🚀 ~ toggleTheoryLearn ~ content:',item, content)
|
||||
console.log('🚀 ~ toggleTheoryLearn ~ content:', item, content)
|
||||
const params = {
|
||||
userId: uni.getStorageSync('userId'), // 用户id
|
||||
studyId: this.studyId, // 学习id
|
||||
|
|
@ -261,11 +267,22 @@ export default {
|
|||
sourceId: item.id, // 素材id
|
||||
path: item.path, // 视频路径
|
||||
studyDuration: item.studyDuration || 0, // 学习时长
|
||||
allStudyDuration: item.allStudyDuration, // 总时长
|
||||
allStudyDuration: item.allStudyDuration // 总时长
|
||||
}
|
||||
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({
|
||||
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
|
||||
title: item.practiceMsg.name,
|
||||
name: item.practiceMsg.name,
|
||||
studyId: this.studyId, // 学习id
|
||||
studyId: this.studyId // 学习id
|
||||
}
|
||||
uni.navigateTo({
|
||||
url: '/pages/YNEduApp/prac/pracDetail?params=' + JSON.stringify(params)
|
||||
|
|
@ -297,7 +314,9 @@ export default {
|
|||
examCount: item.examMsg.examCount, // 1: 不限次 2: 及格终止 3: 自定义
|
||||
examCustom: item.examMsg.examCustom, // 自定义次数
|
||||
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)
|
||||
uni.navigateTo({
|
||||
|
|
|
|||
|
|
@ -196,7 +196,7 @@ import {
|
|||
updateRemoveRecordData, // 错题消除记录
|
||||
updStudyDurationExamPractice
|
||||
} from '@/api/eduApp'
|
||||
import config from 'config'
|
||||
import config from '@/config'
|
||||
|
||||
export default {
|
||||
data() {
|
||||
|
|
@ -239,8 +239,6 @@ export default {
|
|||
this.isError = opt.isError || ''
|
||||
this.studyId = opt.studyId || ''
|
||||
console.log('🚀 ~ onLoad ~ opt:', opt)
|
||||
},
|
||||
mounted() {
|
||||
// 开始计时
|
||||
this.startTimer()
|
||||
this.getPracticeItData()
|
||||
|
|
@ -259,12 +257,32 @@ export default {
|
|||
isNew: this.isNew || '',
|
||||
isMiss: this.isError ? 1 : ''
|
||||
}
|
||||
const res = await getPracticeItData(params)
|
||||
// const res = await getPracticeItData(params)
|
||||
// this.trueNum = res.data.trueNum
|
||||
// this.falseNum = res.data.falseNum
|
||||
// this.allNum = res.data.allNum
|
||||
// this.nowNum = res.data.nowNum
|
||||
// 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
|
||||
console.log('🚀 ~ getPracticeItData ~ res:', res)
|
||||
},
|
||||
fail: err => {
|
||||
console.log(err)
|
||||
}
|
||||
})
|
||||
},
|
||||
// 获取题目
|
||||
async getPracticeQuestion() {
|
||||
|
|
@ -276,14 +294,33 @@ export default {
|
|||
isOutOfOrder: this.isOutOfOrder || '',
|
||||
isMiss: this.isError ? 1 : ''
|
||||
}
|
||||
const res = await getPracticeQuestion(params)
|
||||
this.recordId = res.data.recordId
|
||||
this.questionList.push(res.data)
|
||||
// const res = await getPracticeQuestion(params)
|
||||
// this.recordId = res.data.recordId
|
||||
// this.questionList.push(res.data)
|
||||
// console.log('🚀 ~ getPracticeQuestion ~ res:', res)
|
||||
// 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)
|
||||
console.log('🚀 ~ getPracticeQuestion ~ this.questionList:', this.questionList)
|
||||
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) {
|
||||
console.log('🚀 ~ handleJump ~ item:', item, this.recordId)
|
||||
if (item === 'prev') {
|
||||
this.nowNum -= 1
|
||||
} else if (item === 'next') {
|
||||
|
|
@ -296,13 +333,32 @@ export default {
|
|||
this.questionList = []
|
||||
const params = {
|
||||
recordId: this.recordId || '',
|
||||
practiceId: this.practiceId,
|
||||
operate: item || '',
|
||||
sort: this.nowNum,
|
||||
isMiss: this.isError ? 1 : ''
|
||||
}
|
||||
const res = await changeQuestion(params)
|
||||
this.questionList.push(res.data)
|
||||
console.log('🚀 ~ handleJump ~ params:', params)
|
||||
// const res = await changeQuestion(params)
|
||||
// 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() {
|
||||
|
|
@ -311,10 +367,27 @@ export default {
|
|||
id: this.practiceId,
|
||||
isMiss: this.isError ? 1 : ''
|
||||
}
|
||||
const res = await getPracticeQuestionList(params)
|
||||
// const res = await getPracticeQuestionList(params)
|
||||
// console.log('🚀 ~ getPracticeQuestionList ~ res:', res)
|
||||
// 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() {
|
||||
setInterval(() => {
|
||||
|
|
@ -386,7 +459,19 @@ export default {
|
|||
}
|
||||
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
|
||||
}
|
||||
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 = {
|
||||
id: this.practiceId
|
||||
}
|
||||
const res = await getPracticeQuestionRate(params)
|
||||
// trueRate 正确率
|
||||
this.correctRate = res.data.trueRate
|
||||
// allQuestionNum 答题数
|
||||
this.answerNum = res.data.allQuestionNum
|
||||
// trueQuestionNum 正确数
|
||||
this.trueNum = res.data.trueQuestionNum
|
||||
// const res = await getPracticeQuestionRate(params)
|
||||
// // trueRate 正确率
|
||||
// this.correctRate = res.data.trueRate
|
||||
// // allQuestionNum 答题数
|
||||
// this.answerNum = res.data.allQuestionNum
|
||||
// // trueQuestionNum 正确数
|
||||
// this.trueNum = res.data.trueQuestionNum
|
||||
// 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() {
|
||||
console.log('确认')
|
||||
|
|
@ -481,14 +597,45 @@ export default {
|
|||
clearInterval()
|
||||
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,
|
||||
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) {
|
||||
// 错题消除
|
||||
updateRemoveRecordData({
|
||||
// updateRemoveRecordData({
|
||||
// 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) {
|
||||
|
|
@ -496,17 +643,52 @@ export default {
|
|||
userId: uni.getStorageSync('userId'),
|
||||
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
|
||||
uni.navigateBack()
|
||||
// uni.navigateBack()
|
||||
uni.redirectTo({
|
||||
url: '/pages/YNEduApp/prac/prac'
|
||||
})
|
||||
},
|
||||
// 打开题目选择弹框
|
||||
async openSelect() {
|
||||
this.showModalSelect = true
|
||||
const res = await this.getPracticeQuestionList()
|
||||
console.log('🚀 ~ openSelect ~ res:', res)
|
||||
// const res = await this.getPracticeQuestionList()
|
||||
// console.log('🚀 ~ openSelect ~ res:', res)
|
||||
// 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)
|
||||
}
|
||||
})
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -23,7 +23,7 @@
|
|||
<div class="score">完成率:{{ item.completionRate }}</div>
|
||||
<div class="btn-wrapper">
|
||||
<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>
|
||||
|
|
@ -39,6 +39,7 @@
|
|||
|
||||
<script>
|
||||
import { getStudentPracticeList } from '@/api/eduApp'
|
||||
import config from '@/config';
|
||||
|
||||
export default {
|
||||
data() {
|
||||
|
|
@ -54,7 +55,7 @@ export default {
|
|||
alreadyList: []
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
onLoad() {
|
||||
this.getList()
|
||||
},
|
||||
methods: {
|
||||
|
|
@ -63,12 +64,31 @@ export default {
|
|||
userId: uni.getStorageSync('userId'),
|
||||
source: 1
|
||||
}
|
||||
const res = await getStudentPracticeList(params)
|
||||
// const res = await getStudentPracticeList(params)
|
||||
// this.list = this.allList = res.data
|
||||
// // 根据 alreadyNum 字段判断待练习和已练习
|
||||
// this.waitList = res.data.filter(item => item.alreadyNum === 0)
|
||||
// this.alreadyList = res.data.filter(item => item.alreadyNum > 0)
|
||||
// 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
|
||||
// 根据 alreadyNum 字段判断待练习和已练习
|
||||
this.waitList = res.data.filter(item => item.alreadyNum === 0)
|
||||
this.alreadyList = res.data.filter(item => item.alreadyNum > 0)
|
||||
// console.log('🚀 ~ getList ~ res:', res)
|
||||
},
|
||||
fail: err => {
|
||||
console.log('🚀 ~ getList ~ err:', err)
|
||||
}
|
||||
})
|
||||
},
|
||||
handleTab(item, index) {
|
||||
this.activeIndex = index
|
||||
|
|
@ -82,9 +102,11 @@ export default {
|
|||
},
|
||||
// 开始练习
|
||||
handleExercise(item) {
|
||||
console.log('🚀 ~ handleExercise ~ item:', item)
|
||||
const params = {
|
||||
practiceId: item.id,
|
||||
title: item.name,
|
||||
title: item.name || '',
|
||||
isNew: item.alreadyNum == 0 ? true : false
|
||||
}
|
||||
uni.navigateTo({
|
||||
url: '/pages/YNEduApp/prac/pracDetail?params=' + JSON.stringify(params)
|
||||
|
|
@ -104,6 +126,7 @@ export default {
|
|||
recordId: item.recordId,
|
||||
isError: true
|
||||
}
|
||||
console.log('🚀 ~ handleError ~ params:', params)
|
||||
uni.navigateTo({
|
||||
url: '/pages/YNEduApp/prac/exercises?params=' + JSON.stringify(params)
|
||||
})
|
||||
|
|
|
|||
|
|
@ -33,7 +33,7 @@
|
|||
<div class="right">
|
||||
<div class="right-top">
|
||||
<div class="right-text">顺序练习</div>
|
||||
<div class="btn">
|
||||
<div class="btn" v-if="!isNew">
|
||||
<u-button
|
||||
type="primary"
|
||||
plain
|
||||
|
|
@ -56,7 +56,7 @@
|
|||
</div>
|
||||
<div class="right-bottom">
|
||||
<div class="right-text">随机练习</div>
|
||||
<div class="btn">
|
||||
<div class="btn" v-if="!isNew">
|
||||
<u-button
|
||||
type="primary"
|
||||
plain
|
||||
|
|
@ -89,6 +89,7 @@
|
|||
|
||||
<script>
|
||||
import { getPracticeQuestionRate } from '@/api/eduApp'
|
||||
import config from '@/config'
|
||||
|
||||
export default {
|
||||
data() {
|
||||
|
|
@ -107,33 +108,56 @@ export default {
|
|||
totalAnswer: 0,
|
||||
// 累计答对
|
||||
totalCorrect: 0,
|
||||
studyId: '' // 学习id
|
||||
studyId: '', // 学习id
|
||||
isNew: true // 是否新练习
|
||||
}
|
||||
},
|
||||
onShow() {
|
||||
},
|
||||
onLoad(opt) {
|
||||
opt = JSON.parse(opt.params)
|
||||
console.log('🚀 ~ onLoad ~ opt:', opt)
|
||||
this.practiceId = opt.practiceId
|
||||
this.title = opt.title
|
||||
this.studyId = opt.studyId || '' // 学习id
|
||||
},
|
||||
onShow() {
|
||||
this.isNew = opt.isNew
|
||||
this.getData()
|
||||
|
||||
},
|
||||
methods: {
|
||||
async getData() {
|
||||
const params = {
|
||||
id: this.practiceId
|
||||
}
|
||||
const res = await getPracticeQuestionRate(params)
|
||||
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
|
||||
console.log('🚀 ~ getData ~ res:', res)
|
||||
// const res = await getPracticeQuestionRate(params)
|
||||
// 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
|
||||
// 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) {
|
||||
console.log('type', type)
|
||||
|
|
|
|||
|
|
@ -46,7 +46,7 @@
|
|||
:isLink="true"
|
||||
:border="false"
|
||||
>
|
||||
<span slot="value">{{ infos.unit }}</span>
|
||||
<span slot="value" style="width: 180px;">{{ infos.unit }}</span>
|
||||
</u-cell>
|
||||
</u-cell-group>
|
||||
</view>
|
||||
|
|
|
|||
|
|
@ -50,7 +50,7 @@ export default {
|
|||
url: '',
|
||||
facePath: '',
|
||||
optMode: 'add',
|
||||
token: uni.getStorageSync('App-Token'),
|
||||
token: uni.getStorageSync('access_token'),
|
||||
userId: uni.getStorageSync('userId')
|
||||
}
|
||||
},
|
||||
|
|
|
|||
|
|
@ -14,13 +14,13 @@ export default {
|
|||
data() {
|
||||
return {
|
||||
userId: uni.getStorageSync('userId'),
|
||||
token: uni.getStorageSync('App-Token'),
|
||||
token: uni.getStorageSync('access_token'),
|
||||
// 消息列表
|
||||
msgList: []
|
||||
}
|
||||
},
|
||||
onLoad() {
|
||||
// this.getMsgList()
|
||||
this.getMsgList()
|
||||
},
|
||||
methods: {
|
||||
// 获取消息列表
|
||||
|
|
|
|||
|
|
@ -45,9 +45,9 @@ import config from '@/config'
|
|||
export default {
|
||||
data() {
|
||||
return {
|
||||
userName: '',
|
||||
className: '',
|
||||
facePath: '',
|
||||
userName: uni.getStorageSync('userName'),
|
||||
className: uni.getStorageSync('className'),
|
||||
facePath: uni.getStorageSync('facePath'),
|
||||
tabbar: TabbarConfig,
|
||||
// 信息参数
|
||||
learnStats: {
|
||||
|
|
@ -63,13 +63,12 @@ export default {
|
|||
{ id: 3, title: '我的消息', src: '/static/eduImg/myMsg.png', path: 'myMsg' },
|
||||
{ id: 4, title: '设置', src: '/static/eduImg/settings.png', path: 'settings' }
|
||||
],
|
||||
token: uni.getStorageSync('App-Token')
|
||||
token: uni.getStorageSync('access_token')
|
||||
}
|
||||
},
|
||||
onLoad() {
|
||||
// this.token = uni.getStorageSync('App-Token')
|
||||
console.log('🚀 ~ onLoad ~ this.token:', this.token)
|
||||
this.getUserInfo()
|
||||
this.getLearnStats()
|
||||
},
|
||||
methods: {
|
||||
|
|
@ -78,48 +77,25 @@ export default {
|
|||
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() {
|
||||
console.log('🚀 ~ getLearnStats ~ this.token:',uni.getStorageSync('access_token'))
|
||||
uni.request({
|
||||
url: config.baseUrl + '/exam-student/personalCenter/getStudyAndCer',
|
||||
// url: 'http://192.168.0.137:2900' + '/exam-student/personalCenter/getStudyAndCer',
|
||||
method: 'post',
|
||||
header: {
|
||||
Authorization: this.token
|
||||
Authorization: uni.getStorageSync('access_token')
|
||||
// Authorization: 'eyJhbGciOiJIUzUxMiJ9.eyJ1c2VyX2lkIjozMSwidXNlcl9rZXkiOiIzNTFmNDJjMS00YTM4LTRlMDMtOWQxYy0wMWM2YjMwY2Y3OTUiLCJ1c2VybmFtZSI6IuaWueS6riJ9.4OatIEFwP5ZgrtH0CPR5yc1-dPUCGFlXrhwmFgvcH3jXuA0PSt5JiJgcw8nMnyPIbuDBktY3c2JalZXm-_RJTQ'
|
||||
},
|
||||
data: {},
|
||||
success: res => {
|
||||
console.log('🚀 ~ getLearnStats ~ res:', res)
|
||||
this.allDuration = (res.data && res.data.data.allDuration) || 0
|
||||
this.value = (res.data && res.data.data.value) || 0
|
||||
console.log('🚀 ~ getLearnStats ~ res:', res.data)
|
||||
res = res.data
|
||||
if (res.code == 200) {
|
||||
this.allDuration = (res.data && res.data.allDuration) || 0
|
||||
this.value = (res.data && res.data.value) || 0
|
||||
}
|
||||
}
|
||||
})
|
||||
},
|
||||
|
|
|
|||
|
|
@ -95,6 +95,8 @@
|
|||
|
||||
<script>
|
||||
import TabbarConfig from '@/totalTabbar.js'
|
||||
import config from '@/config'
|
||||
|
||||
import {
|
||||
getDayNoticeAnnoByUserId,
|
||||
getAppList,
|
||||
|
|
@ -191,6 +193,31 @@
|
|||
},
|
||||
gotoYy(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({
|
||||
url: '/pages/YNEduApp/index/index'
|
||||
})
|
||||
|
|
|
|||
|
|
@ -51,9 +51,7 @@ const user = {
|
|||
return new Promise((resolve, reject) => {
|
||||
login(phone, pd)
|
||||
.then(res => {
|
||||
console.log('🚀 ~ returnnewPromise ~ res:', res)
|
||||
setToken(res.data.token)
|
||||
uni.setStorageSync('jwtToken', res.data.token)
|
||||
commit('SET_TOKEN', res.data.token)
|
||||
const user = res.data.user
|
||||
commit('SET_USERID', user.id)
|
||||
|
|
@ -96,6 +94,9 @@ const user = {
|
|||
return new Promise((resolve, reject) => {
|
||||
commit('SET_TOKEN', '')
|
||||
removeToken()
|
||||
uni.removeStorageSync('userPhone')
|
||||
uni.removeStorageSync('userId')
|
||||
uni.removeStorageSync('access_token')
|
||||
storage.clean()
|
||||
resolve()
|
||||
})
|
||||
|
|
|
|||
|
|
@ -5,12 +5,7 @@ import errorCode from '@/utils/errorCode'
|
|||
import { toast, showConfirm, tansParams } from '@/utils/common'
|
||||
|
||||
let timeout = 10000
|
||||
let baseUrl = ''
|
||||
if (uni.getStorageSync('jwtToken')) {
|
||||
baseUrl = config.baseUrl
|
||||
} else {
|
||||
baseUrl = config.loginBaseUrl
|
||||
}
|
||||
const baseUrl = config.loginBaseUrl
|
||||
console.log('baseUrl-请求', baseUrl)
|
||||
|
||||
const request = config => {
|
||||
|
|
|
|||
Loading…
Reference in New Issue