diff --git a/src/assets/img/bg.jpg b/src/assets/img/bg.jpg new file mode 100644 index 0000000..fdc39b3 Binary files /dev/null and b/src/assets/img/bg.jpg differ diff --git a/src/assets/img/button.png b/src/assets/img/button.png new file mode 100644 index 0000000..0a0a03f Binary files /dev/null and b/src/assets/img/button.png differ diff --git a/src/components/page/ClientLogin.vue b/src/components/page/ClientLogin.vue new file mode 100644 index 0000000..62d1058 --- /dev/null +++ b/src/components/page/ClientLogin.vue @@ -0,0 +1,573 @@ + + + + + \ No newline at end of file diff --git a/src/components/page/Login.vue b/src/components/page/Login.vue index 62d1058..8f744f6 100644 --- a/src/components/page/Login.vue +++ b/src/components/page/Login.vue @@ -1,573 +1,221 @@ - \ No newline at end of file diff --git a/src/components/page/ProjectIntro.vue b/src/components/page/ProjectIntro.vue index 808dc3d..449ad1c 100644 --- a/src/components/page/ProjectIntro.vue +++ b/src/components/page/ProjectIntro.vue @@ -15,15 +15,89 @@
-
+
期权套期保值实验
-
+
期权组合保险实验
+ + + + +
能力测评
+ +
+

{{question.currentQuestionSortNo}}/{{question.totalQuestionNum}}

+

({{question.questionTypeName}})

+
{{question.questionStem}}
+
+ + 倒计时:{{countdown}} +
+
    +
  • {{key}}.{{item}}
  • +
+
+ + +
+ + + +
{{result.isPassed}}
+ +
+
+ {{result.totalScore}}分 +
+

{{result.isPassed == '通过' ? '恭喜' : ''}}你答对{{result.correctQuestionNum}}题,正确率{{result.correctRate}}!

+
+ + +
+ + + +
成绩详情
+
+ + + + + + + + + + +
+

得分:{{totalScore}}分

+
@@ -31,12 +105,43 @@ export default { data() { return { - title:'期权交易虚仿实验', - contentText:'本项目构建了面向实战的期权交易场景,让学生面对实际存在的农业生产相关问题,设计交易策略。分为期权套期保值实验和期权组合保险实验,期权套期保值实验为单一期权的实验,需利用一个期权合约对现货进行套期保值;期权组合保险实验为期货期权组合的实验,需利用多个期权的组合满足较为复杂的套期保值需求。' + title:'期权交易虚仿实验', + contentText:'本项目构建了面向实战的期权交易场景,让学生面对实际存在的农业生产相关问题,设计交易策略。分为期权套期保值实验和期权组合保险实验,期权套期保值实验为单一期权的实验,需利用一个期权合约对现货进行套期保值;期权组合保险实验为期货期权组合的实验,需利用多个期权的组合满足较为复杂的套期保值需求。', + passExam: [1504, 1505, 1506, 1507, 1508, 1509, 1510, 1511, 1512, 1513].includes(this.$store.state.studentId), + + userId: this.$store.state.userId, + evaluationVisible: false, + resultVisible: false, + detailVisible: false, + lastOne: false, + question: { + options: {} + }, + countdown: '', + selected: '', + result: {}, + detail: {}, + timer: null, + totalScore: 0, + detailData: [], + isDone: false, + history: [], + btnType: 1, + showProject: false, }; }, + watch: { + question: { + handler(newVal,oldVal) { + for(let n in newVal.options) { + if(newVal.options[n] == '') delete(newVal.options[n]) + } + }, + deep: true + } + }, mounted(){ - + console.log(11,this.passExam) }, methods: { toIndex() { @@ -48,6 +153,167 @@ export default { toNext(index) { this.$router.push(`ProjectPattern?pattern=${index}`) }, + async toEvaluation(type,btn) { + clearInterval(this.timer) + this.lastOne = false + this.selected = '' + this.resultVisible = false + this.history = [] + if(btn) this.btnType = btn + if(type && !this.passExam){ + let res = await this.$get(this.api.openExerciseOrTeaching, { userId: this.userId }) + if(res.errmessage == 'true'){ + this.toNext(this.btnType == 2 ? 0 : 1) + }else{ + this.$alert('请先完成能力测评并达到80分以上才可以进行实验', '提示', { + confirmButtonText: '进入测评', + callback: action => { + if(action == 'confirm') this.toEvaluation(0) + } + }); + } + }else{ + this.start() + this.getCountdown() + } + }, + handleQues() { + this.question.options = {} + for(let n in this.question) { + if(n.includes('option') && n != 'options') { + this.question.options[n.replace('option','')] = this.question[n] + } + } + if(this.question.currentQuestionSortNo == this.question.totalQuestionNum){ + this.lastOne = true + }else{ + this.lastOne = false + } + }, + async start() { + let res = await this.$get(this.api.experimentStart, { userId: this.userId,types: this.btnType }) + if(res.data){ + this.question = res.data + this.isDone = false + this.question.currentQuestionSortNo == 1 && this.$store.commit("answerHistoryData", { answerHistory : []}) + this.handleQues() + this.evaluationVisible = true + }else{ + this.$message.warning(res.message) + } + }, + async getCountdown() { + let res = await this.$get(this.api.experimentRemaining, { userId: this.userId }) + res.data && this.countDown(res.data) + // this.countDown('00:00:05') + }, + countDown(time) { + this.countdown = time + this.timer = setInterval(() => { + let timeList = this.countdown.split(':') + let total = Number.parseInt(timeList[1] * 60) + Number.parseInt(timeList[2]) + if(total > 0){ + --total + let minutes = Math.floor(total / 60) + let seconds = Math.floor(total % 60) + this.countdown = `00:${this.core.formateTime(minutes)}:${this.core.formateTime(seconds)}` + }else{ + this.isDone = true + this.$message.warning('测评时间结束'); + clearInterval(this.timer) + } + },1000) + }, + selectOption(option) { + if(!this.isDone) { + if(this.selected.includes(option)) { + this.selected = this.selected.replace(option,'') + }else{ + if(this.question.questionType == 2) { + this.selected += option + }else{ + this.selected = option + } + } + } + }, + getHistory() { + this.history = this.$store.state.answerHistory + }, + async nextQues() { + if(!this.selected) return this.$message.warning('请选择答案') + this.getHistory() + if(this.history.length > this.question.currentQuestionSortNo){ + this.history[this.question.currentQuestionSortNo-1] = this.selected + }else if(this.history.length < this.question.currentQuestionSortNo){ + this.history.push(this.selected) + } + this.$store.commit("answerHistoryData", { answerHistory : this.history}) + let res = await this.$post(this.api.experimentNext, { + id: this.question.id, + currentQuestionSortNo: this.question.currentQuestionSortNo, + userAnswer: this.selected + }) + if(res.data){ + this.question = res.data + this.selected = '' + if(this.history.length >= this.question.currentQuestionSortNo){ + this.selected = this.history[this.question.currentQuestionSortNo-1] + }else{ + this.selected = '' + } + this.handleQues() + } + }, + async prevQues() { + if(this.question.currentQuestionSortNo > 1){ + this.getHistory() + let res = await this.$post(this.api.experimentPrevious, { + id: this.question.id, + currentQuestionSortNo: this.question.currentQuestionSortNo, + userAnswer: this.selected + }) + if(res.data){ + this.question = res.data + this.selected = this.history[this.question.currentQuestionSortNo-1] + this.handleQues() + } + } + }, + async submitQues() { + if(!this.selected) return this.$message.warning('请选择答案'); + let res = await this.$post(this.api.experimentSubmit, { + id: this.question.id, + currentQuestionSortNo: this.question.currentQuestionSortNo, + userAnswer: this.selected, + userId: this.userId, + types: this.btnType + }) + if(res.data) { + this.result = res.data + this.evaluationVisible = false + this.resultVisible = true + } + }, + async passQues(){ + this.resultVisible = false + this.toNext(this.btnType == 2 ? 0 : 1) + }, + async getDetail() { + let res = await this.$get(this.api.experimentDetail, { + evaluationRecordId: this.question.id + }) + if(res.data){ + this.totalScore = res.data.totalScore + this.detailData = res.data.evaluationDetailVOS + this.resultVisible = false + this.detailVisible = true + } + }, + toSonSys() { + this.resultVisible = false + this.toNext(this.btnType == 2 ? 0 : 1) + } }, }; @@ -177,4 +443,198 @@ export default { color: white; line-height: 60px; } + +/deep/.el-tabs__item:focus{ + outline: none; + box-shadow: none !important; +} +.back_index:hover{ + opacity: 0.8; + cursor: pointer; +} +.back_index{ + position: fixed; + right: 0px; + top: 48%; + width: 80px; + height: 80px; + background: white; + text-align: center; + z-index: 100; +} +.icon-home{ + font-size: 50px; + color: #FF5288; + font-weight: 600; + line-height: 80px; +} +h3{ + color: #328aff; + margin-bottom: 10px; +} +.mar0{ + margin-top: 0; +} +/deep/.evaluation_dialog{ + min-height: 700px; + background: url(../../assets/img/evaluation_bg1.png) 0 0/100% 100% no-repeat; +} +/deep/.evaluation_dialog .el-dialog__headerbtn,/deep/.evaluation_dialog .el-dialog__headerbtn,/deep/.detail_dialog .el-dialog__headerbtn{ + font-size: 28px; +} +/deep/.evaluation_dialog .title,/deep/.detail_dialog .title{ + margin-bottom: 45px; + text-align: center; + font-size: 24px +} +/deep/.evaluation_dialog .title{ + margin-bottom: 55px; +} +/deep/.evaluation_dialog .serial{ + font-size: 12px; + text-align: center; +} +/deep/.evaluation_dialog .content{ + width: 80%; + margin: 0 auto; +} +/deep/.evaluation_dialog .type{ + color: #666; +} +/deep/.evaluation_dialog .ques{ + margin: 20px 0; + min-height: 145px; + color: #666; + font-size: 16px; +} +/deep/.evaluation_dialog .countdown{ + margin-bottom: 20px; + justify-content: center; + text-align: center; + color: #DC3434; + font-size: 14px; +} +/deep/.evaluation_dialog .countdown img{ + width: 15px !important; + margin-right: 10px; +} +/deep/.evaluation_dialog .options{ + display: flex; + flex-direction: column; + min-height: 340px; +} +/deep/.evaluation_dialog .options.isDone{ + min-height: 395px; +} +/deep/.evaluation_dialog .options li{ + padding: 0 15px; + margin-bottom: 15px; + line-height: 40px; + border: 1px solid #9070FF; + border-radius: 20px; + color: #666; + cursor: pointer; +} +/deep/.evaluation_dialog .options li:hover{ + color: #fff; + background-color: #b038bb; + border-color: #b038bb; +} +/deep/.evaluation_dialog .options li.active{ + color: #fff; + background-color: #916CFF; + border-color: #916CFF; +} +/deep/.evaluation_dialog .options em{ + margin-right: 10px; + font-weight: bold; + font-style: normal; + font-size: 16px; +} +/deep/.evaluation_dialog .options span{ + font-size: 16px; +} +/deep/.evaluation_dialog .el-dialog__footer{ + text-align: center; +} +/deep/.evaluation_dialog .first,/deep/.result_dialog .first{ + color: #fff; + background-color: #9268FF; + border-color: #9268FF; +} +/deep/.evaluation_dialog .second,/deep/.result_dialog .second{ + color: #fff; + background-color: #E371DA; + border-color: #E371DA; +} +/deep/.evaluation_dialog .pass,/deep/.result_dialog .pass{ + color: #fff; + background-color: #e42c85; + border-color: #e42c85; +} + +/deep/.result_dialog{ + min-height: 500px; + background: url(../../assets/img/evaluation_bg2.png) 0 0/100% 100% no-repeat; +} +/deep/.result_dialog .el-dialog__headerbtn .el-dialog__close{ + color: #5a5a5a; + font-size: 28px; +} +/deep/.result_dialog .result{ + margin-top: 60px; + text-align: center; + color: #fff; + font-size: 24px; +} +/deep/.result_dialog .point{ + margin: 30px 0 20px; + text-align: center; + font-size: 30px; + color: #666; +} +/deep/.result_dialog .point span{ + font-size: 120px; + font-weight: bold; +} +/deep/.result_dialog .tips{ + color: #666; + text-align: center; + font-size: 14px; +} +/deep/.result_dialog .third{ + color: #fff; + background-color: #418cf5; + border-color: #418cf5; +} + +/deep/.detail_dialog{ + background: url(../../assets/img/evaluation_bg3.png) 0 0/100% 100% no-repeat; +} +/deep/.detail_dialog .title{ + margin-top: -20px; +} +/deep/.detail_dialog .el-table__header th:nth-last-child(2){ + text-align: center; +} +/deep/.detail_dialog .total{ + margin-top: 20px; + text-align: center; + font-size: 30px; + color: #DC3434; +} +/deep/.evaluation_dialog{ + margin:0 !important; + position:absolute; + top:50%; + left:50%; + transform:translate(-50%,-50%); + max-height:calc(100% - 30px); + max-width:calc(100% - 30px); +} + +/deep/.evaluation_dialog .el-dialog__body{ + flex:1; + overflow: auto; +} \ No newline at end of file diff --git a/src/components/page/ProjectPattern.vue b/src/components/page/ProjectPattern.vue index 1fbefa7..e882109 100644 --- a/src/components/page/ProjectPattern.vue +++ b/src/components/page/ProjectPattern.vue @@ -25,11 +25,11 @@
-
+
练习模式
-
+
考核模式
@@ -40,78 +40,6 @@
- - - -
能力测评
- -
-

{{question.currentQuestionSortNo}}/{{question.totalQuestionNum}}

-

({{question.questionTypeName}})

-
{{question.questionStem}}
-
- - 倒计时:{{countdown}} -
-
    -
  • {{key}}.{{item}}
  • -
-
- - -
- - - -
{{result.isPassed}}
- -
-
- {{result.totalScore}}分 -
-

{{result.isPassed == '通过' ? '恭喜' : ''}}你答对{{result.correctQuestionNum}}题,正确率{{result.correctRate}}!

-
- - -
- - - -
成绩详情
-
- - - - - - - - - - -
-

得分:{{totalScore}}分

-
@@ -463,193 +188,4 @@ export default { height: 320px; } } - -/deep/.el-tabs__item:focus{ - outline: none; - box-shadow: none !important; -} -.back_index:hover{ - opacity: 0.8; - cursor: pointer; -} -.back_index{ - position: fixed; - right: 0px; - top: 48%; - width: 80px; - height: 80px; - background: white; - text-align: center; - z-index: 100; -} -.icon-home{ - font-size: 50px; - color: #FF5288; - font-weight: 600; - line-height: 80px; -} -h3{ - color: #328aff; - margin-bottom: 10px; -} -.mar0{ - margin-top: 0; -} -/deep/.evaluation_dialog{ - min-height: 700px; - background: url(../../assets/img/evaluation_bg1.png) 0 0/100% 100% no-repeat; -} -/deep/.evaluation_dialog .el-dialog__headerbtn,/deep/.evaluation_dialog .el-dialog__headerbtn,/deep/.detail_dialog .el-dialog__headerbtn{ - font-size: 28px; -} -/deep/.evaluation_dialog .title,/deep/.detail_dialog .title{ - margin-bottom: 45px; - text-align: center; - font-size: 24px -} -/deep/.evaluation_dialog .title{ - margin-bottom: 55px; -} -/deep/.evaluation_dialog .serial{ - font-size: 12px; - text-align: center; -} -/deep/.evaluation_dialog .content{ - width: 80%; - margin: 0 auto; -} -/deep/.evaluation_dialog .type{ - color: #666; -} -/deep/.evaluation_dialog .ques{ - margin: 20px 0; - min-height: 145px; - color: #666; - font-size: 16px; -} -/deep/.evaluation_dialog .countdown{ - margin-bottom: 20px; - justify-content: center; - text-align: center; - color: #DC3434; - font-size: 14px; -} -/deep/.evaluation_dialog .countdown img{ - width: 15px !important; - margin-right: 10px; -} -/deep/.evaluation_dialog .options{ - display: flex; - flex-direction: column; - min-height: 340px; -} -/deep/.evaluation_dialog .options.isDone{ - min-height: 395px; -} -/deep/.evaluation_dialog .options li{ - padding: 0 15px; - margin-bottom: 15px; - line-height: 40px; - border: 1px solid #9070FF; - border-radius: 20px; - color: #666; - cursor: pointer; -} -/deep/.evaluation_dialog .options li:hover{ - color: #fff; - background-color: #b038bb; - border-color: #b038bb; -} -/deep/.evaluation_dialog .options li.active{ - color: #fff; - background-color: #916CFF; - border-color: #916CFF; -} -/deep/.evaluation_dialog .options em{ - margin-right: 10px; - font-weight: bold; - font-style: normal; - font-size: 16px; -} -/deep/.evaluation_dialog .options span{ - font-size: 16px; -} -/deep/.evaluation_dialog .el-dialog__footer{ - text-align: center; -} -/deep/.evaluation_dialog .first,/deep/.result_dialog .first{ - color: #fff; - background-color: #9268FF; - border-color: #9268FF; -} -/deep/.evaluation_dialog .second,/deep/.result_dialog .second{ - color: #fff; - background-color: #E371DA; - border-color: #E371DA; -} - -/deep/.result_dialog{ - min-height: 500px; - background: url(../../assets/img/evaluation_bg2.png) 0 0/100% 100% no-repeat; -} -/deep/.result_dialog .el-dialog__headerbtn .el-dialog__close{ - color: #5a5a5a; - font-size: 28px; -} -/deep/.result_dialog .result{ - margin-top: 60px; - text-align: center; - color: #fff; - font-size: 24px; -} -/deep/.result_dialog .point{ - margin: 30px 0 20px; - text-align: center; - font-size: 30px; - color: #666; -} -/deep/.result_dialog .point span{ - font-size: 120px; - font-weight: bold; -} -/deep/.result_dialog .tips{ - color: #666; - text-align: center; - font-size: 14px; -} -/deep/.result_dialog .third{ - color: #fff; - background-color: #418cf5; - border-color: #418cf5; -} - -/deep/.detail_dialog{ - background: url(../../assets/img/evaluation_bg3.png) 0 0/100% 100% no-repeat; -} -/deep/.detail_dialog .title{ - margin-top: -20px; -} -/deep/.detail_dialog .el-table__header th:nth-last-child(2){ - text-align: center; -} -/deep/.detail_dialog .total{ - margin-top: 20px; - text-align: center; - font-size: 30px; - color: #DC3434; -} -/deep/.evaluation_dialog{ - margin:0 !important; - position:absolute; - top:50%; - left:50%; - transform:translate(-50%,-50%); - max-height:calc(100% - 30px); - max-width:calc(100% - 30px); -} - -/deep/.evaluation_dialog .el-dialog__body{ - flex:1; - overflow: auto; -} \ No newline at end of file diff --git a/src/router/index.js b/src/router/index.js index 24a72b8..31cb661 100644 --- a/src/router/index.js +++ b/src/router/index.js @@ -76,6 +76,11 @@ export default new Router({ component: () => import(/* webpackChunkName: "login" */ '../components/page/Login.vue'), meta: { title: '登录' } }, + { + path: '/clientLogin', + component: () => import(/* webpackChunkName: "login" */ '../components/page/ClientLogin.vue'), + meta: { title: '首页' } + }, { path: '*', redirect: '/404' diff --git a/src/utils/api.js b/src/utils/api.js index b5f8deb..c5f285e 100644 --- a/src/utils/api.js +++ b/src/utils/api.js @@ -10,6 +10,7 @@ if(process.env.NODE_ENV === 'development'){ export default { logins: `${host}/liuwanr/userInfo/logins`, //登录  + getAccountPassword: `${host}/evaluation/tms/userInfo/getAccountPassword`, //获取账号密码 queryToken: `${host}/liuwanr/userInfo/queryToken`, save: `${host}/evaluation/tms/userInfo/add`, //注册 updateLogInNumber: `${host}/liuwanr/userInfo/updateLogInNumber`, //用户登录修改登录次数和登陆时间