welfare-admin/src/views/myexamDetail/index.vue

51 lines
1.1 KiB
Vue

<template>
<div>
<DbExam :type="$route.query.type" :data="examData" @submit="handlerSubmit"></DbExam>
</div>
</template>
<script>
import DbExam from '@/components/DbExam/index'
import { practiceStartAnswer } from '@/api/practice/practice'
export default {
components: { DbExam },
data () {
return {
examData: {},
query: {}
}
},
mounted () {
this.query = this.$route.query
this.$nextTick(() => {
this.initData()
})
},
methods: {
initData () {
const { type } = this.query
if (type === 'practice') {
console.log('练习')
this.getPracticeDetail()
}
},
// 获取练习详情
getPracticeDetail () {
const query = this.query
practiceStartAnswer({ projectId: Number(query.projectId), courseId: Number(query.courseId), type: Number(query.practiceType || 1) }).then(res => {
console.log('res', res)
this.examData = res.data
})
},
// 提交
handlerSubmit (data) {
console.log('this.data', data)
}
}
}
</script>
<style lang="less" scoped>
</style>