提交 4183dfa4 authored 作者: lihuihui's avatar lihuihui

updata

上级 480e8104
...@@ -6,7 +6,7 @@ ...@@ -6,7 +6,7 @@
<div class="tag-box"> <div class="tag-box">
<span @click="signQuestion" v-if="isExamEnd">标记</span> <span @click="signQuestion" v-if="isExamEnd">标记</span>
<span @click="showCard">答题卡</span> <span @click="showCard">答题卡</span>
<span @click="isExamSubPop = true" v-if="isExamEnd">交卷</span> <span @click="submitShowPop" v-if="isExamEnd">交卷</span>
</div> </div>
</div> </div>
</div> </div>
...@@ -172,6 +172,29 @@ export default { ...@@ -172,6 +172,29 @@ export default {
this.scrollDom() this.scrollDom()
}, },
methods: { methods: {
async submitShowPop() {
const isLogin = await this.$store.dispatch('checkLogin')
console.log(isLogin)
if (!isLogin) {
if (this.isWeapp) {
// 小程序
wx.miniProgram.navigateTo({
url: `/pages/login/index?redirect_uri=${encodeURIComponent(
`/pages/web/index?src=${window.location.origin}/course/learn`
)}`
})
} else {
this.$router.push({
path: '/login',
query: {
redirect_uri: `/exam/answer?type=${this.$route.query.type}&is_create=0&papersUrl=${this.$route.query.papersUrl}`
}
})
}
return false
}
this.isExamSubPop = true
},
// 答题结束禁止答题 // 答题结束禁止答题
examEnd() { examEnd() {
this.isExamEnd = false this.isExamEnd = false
...@@ -353,6 +376,9 @@ export default { ...@@ -353,6 +376,9 @@ export default {
}, },
initData(n) { initData(n) {
const param = this.requestParam const param = this.requestParam
if (window.localStorage.userId) {
param.user_id = window.localStorage.userId
}
Exam.getExam(param, this.requestParam.papersUrl).then(res => { Exam.getExam(param, this.requestParam.papersUrl).then(res => {
const times = res.sheet.remainingTime ? res.sheet.remainingTime : res.sheet.duration const times = res.sheet.remainingTime ? res.sheet.remainingTime : res.sheet.duration
if (this.$route.query.id === -1 || this.$route.query.id === '-1') { if (this.$route.query.id === -1 || this.$route.query.id === '-1') {
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论