提交 fac709bb authored 作者: matian's avatar matian

项目优化

上级 0a4637d1
<template> <template>
<div> <div>
<div style="margin-bottom: 20px"> <div style="" class="course-top">
<el-button type="primary" @click="getCourseList('learn-time')">最近学习<i class="el-icon-caret-bottom el-icon--right"></i></el-button> <el-button type="primary" @click="getCourseList('learn-time')"
<el-button type="primary" @click="getCourseList('updated_time')">最近更新<i class="el-icon-caret-bottom el-icon--right"></i></el-button> >最近学习<i class="el-icon-caret-bottom el-icon--right"></i
></el-button>
<el-button type="primary" @click="getCourseList('updated_time')"
>最近更新<i class="el-icon-caret-bottom el-icon--right"></i
></el-button>
<div class="coursr-top-text">
你的课程有效期为:{{ $store.state.user.student_info.expiration_time }},请在有效期内完成学习及考试
</div>
</div> </div>
<app-container> <app-container>
<div class="course-list" element-loading-text="加载中..." v-loading="!loaded"> <div class="course-list" element-loading-text="加载中..." v-loading="!loaded">
...@@ -46,6 +53,9 @@ export default { ...@@ -46,6 +53,9 @@ export default {
}) })
} }
}, },
mounted() {
console.log(this.$store.state.user.student_info.expiration_time, '00000')
},
methods: { methods: {
getCourseList(value = '') { getCourseList(value = '') {
api api
...@@ -67,3 +77,14 @@ export default { ...@@ -67,3 +77,14 @@ export default {
} }
} }
</script> </script>
<style lang="scss" scoped>
.course-top {
display: flex;
align-items: flex-end;
margin-bottom: 20px;
.coursr-top-text {
margin-left: 20px;
font-size: 28px;
}
}
</style>
<template> <template>
<app-container> <app-container>
<el-empty :description="msg" v-if="!data.length"></el-empty> <el-empty :description="msg" v-if="expirationMonth === 12 && !data.length"></el-empty>
<div class="cert" v-else> <div v-if="expirationMonth === 3 && !data.length" style="position: relative">
<el-empty description="您已考试通过,请扫描下方二维码获取证书"></el-empty>
<img
src="https://webapp-pub.ezijing.com/project/fd/u171.png"
alt=""
style="position: absolute; top: 350px; left: 50%; transform: translate(-50%, -50%); width: 200px; height: 200px"
/>
</div>
<div class="cert" v-if="data.length">
<el-button type="primary" @click="downImg">证书下载</el-button> <el-button type="primary" @click="downImg">证书下载</el-button>
<div class="img"> <div class="img">
<img :src="item.url" :key="index" alt="" v-for="(item, index) in data" /> <img :src="item.url" :key="index" alt="" v-for="(item, index) in data" />
...@@ -18,6 +26,11 @@ export default { ...@@ -18,6 +26,11 @@ export default {
msg: '' msg: ''
} }
}, },
computed: {
expirationMonth() {
return parseInt(this.$store.state.user.student_info.expiration_month)
}
},
mounted() { mounted() {
api.getCert().then(response => { api.getCert().then(response => {
console.log(response) console.log(response)
......
...@@ -23,7 +23,11 @@ export default { ...@@ -23,7 +23,11 @@ export default {
this.$message.error('暂无权限') this.$message.error('暂无权限')
return return
} }
// if (new Date(this.$store.state.user.student_info.expiration_time).getTime() < new Date().getTime()) {
// this.$message.warning('您的课程已到期')
// } else {
this.$router.push({ name: 'courseLearnItem', query: { id: data.course_id } }) this.$router.push({ name: 'courseLearnItem', query: { id: data.course_id } })
// }
}, },
// 搜索 // 搜索
handleSearch() {} handleSearch() {}
......
<template> <template>
<div> <div>
{{ $route.query.personal_name }}
{{ $route.query.id_number }}
<exam-card <exam-card
:title="$route.query.title || '考试'" :title="$route.query.title || '考试'"
:hasMark="hasMark" :hasMark="hasMark"
...@@ -43,7 +45,9 @@ export default { ...@@ -43,7 +45,9 @@ export default {
getTopic() { getTopic() {
const param = { const param = {
paper_id: this.examId, paper_id: this.examId,
is_create: 1 is_create: 1,
personal_name: this.$route.query.personal_name,
id_number: this.$route.query.id_number
} }
// const params = this.$route.query.is_create ? { ...param, is_create: 1 } : param // const params = this.$route.query.is_create ? { ...param, is_create: 1 } : param
api.getExamQuestion(param).then(response => { api.getExamQuestion(param).then(response => {
......
...@@ -60,6 +60,21 @@ ...@@ -60,6 +60,21 @@
<el-button :disabled="!isRead" type="primary" @click="goPage">{{ noticeText }}</el-button> <el-button :disabled="!isRead" type="primary" @click="goPage">{{ noticeText }}</el-button>
</span> </span>
</el-dialog> </el-dialog>
<!-- 校验个人信息弹框 -->
<el-dialog :visible.sync="infoVisible" width="30%">
<el-form ref="form" :model="form" label-width="80px">
<el-form-item label="姓名:">
<el-input v-model="form.personal_name"></el-input>
</el-form-item>
<el-form-item label="身份证号:">
<el-input v-model="form.id_number"></el-input>
</el-form-item>
</el-form>
<span slot="footer" class="dialog-footer">
<el-button type="primary" @click="onSubmit">提交</el-button>
<div style="margin-top: 10px; color: #c01540">请准确填写姓名及身份证号码信息,结业证书信息将以此为准</div>
</span>
</el-dialog>
</app-container> </app-container>
</template> </template>
...@@ -74,7 +89,12 @@ export default { ...@@ -74,7 +89,12 @@ export default {
noticeText: '我已阅读,开始考试(20秒)', noticeText: '我已阅读,开始考试(20秒)',
isRead: false, isRead: false,
curExamId: '', curExamId: '',
curExamTitle: '' curExamTitle: '',
infoVisible: false,
form: {
personal_name: '',
id_number: ''
}
} }
}, },
mounted() { mounted() {
...@@ -90,14 +110,25 @@ export default { ...@@ -90,14 +110,25 @@ export default {
} }
}) })
}, },
onSubmit() {
if (this.form.personal_name === '' || this.form.id_number === '') {
this.$message.warning('请完整写姓名及身份证号码信息,才能开始考试')
return false
} else {
this.$router.push({
path: '/exam/exam/exam',
query: {
id: this.curExamId,
title: this.curExamTitle,
personal_name: this.form.personal_name,
id_number: this.form.id_number
}
})
}
},
goPage() { goPage() {
this.$router.push({ this.dialogVisible = false
path: '/exam/exam/exam', this.infoVisible = true
query: {
id: this.curExamId,
title: this.curExamTitle
}
})
}, },
// 重新考试 // 重新考试
reStartExam(data) { reStartExam(data) {
......
...@@ -7,8 +7,23 @@ ...@@ -7,8 +7,23 @@
{{ data.sheet.created_time }} {{ data.sheet.created_time }}
</span> </span>
</div> </div>
<div v-if="expirationMonth === 3" style="position: relative">
<el-empty description="您已考试通过,请扫描下方二维码获取证书"></el-empty>
<img
src="https://webapp-pub.ezijing.com/project/fd/u171.png"
alt=""
style="
position: absolute;
top: 350px;
left: 50%;
transform: translate(-50%, -50%);
width: 200px;
height: 200px;
"
/>
</div>
<div class="chart-box"> <div class="chart-box">
<div class="chart-item" v-if="Object.keys(datas.data).length"> <div class="chart-item" v-if="expirationMonth === 12 && Object.keys(datas.data).length">
<div class="chart-title">成绩</div> <div class="chart-title">成绩</div>
<chart :accuracy="score" :accuracScore="totalScore"> <chart :accuracy="score" :accuracScore="totalScore">
<template v-slot:tips> <template v-slot:tips>
...@@ -17,12 +32,13 @@ ...@@ -17,12 +32,13 @@
</chart> </chart>
</div> </div>
</div> </div>
<p class="new__text">{{ resultText }}</p> <p class="new__text" v-if="expirationMonth === 12">{{ resultText }}</p>
</div> </div>
</div> </div>
</template> </template>
<script> <script>
import chart from '@/components/exam/result/pieChart.vue' import chart from '@/components/exam/result/pieChart.vue'
import * as api from '../api.js' import * as api from '../api.js'
export default { export default {
components: { components: {
...@@ -61,6 +77,9 @@ export default { ...@@ -61,6 +77,9 @@ export default {
}, },
setStyle() { setStyle() {
return `width: ${100 * this.percent}%` return `width: ${100 * this.percent}%`
},
expirationMonth() {
return parseInt(this.$store.state.user.student_info.expiration_month)
} }
}, },
methods: { methods: {
...@@ -90,9 +109,9 @@ export default { ...@@ -90,9 +109,9 @@ export default {
} }
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>
.new__text{ .new__text {
text-align: center; text-align: center;
padding:30px; padding: 30px;
font-size: 22px; font-size: 22px;
} }
.result-box { .result-box {
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论