提交 c89040d4 authored 作者: lihuihui's avatar lihuihui

updata

上级 2466baec
......@@ -131,6 +131,12 @@ export default {
}
},
mounted() {
if (window.localStorage.examTab === '1' || window.localStorage.examTab === 1) {
this.getCourseChapterList()
this.tabNav.navIndex = 1
} else {
this.tabNav.navIndex = 0
}
// this.getCourseChapterList()
this.scrollDom()
this.init()
......@@ -208,53 +214,59 @@ export default {
// })
},
startExam(event, id, cId, isCreate) {
const path = `/exam/answer?type=1&is_create=${isCreate}&course_id=${cId}&chapter_id=${id}&papersUrl=zy/v2/examination/course-papers`
if (this.isWeapp) {
const src = encodeURIComponent(`${window.location.origin}${path}`)
wx.miniProgram.navigateTo({
url: `/pages/web/index?src=${src}`
})
} else {
this.$router.push({ path })
}
// this.$router.push({
// path: '/exam/answer',
// query: {
// course_id: cId,
// chapter_id: id,
// type: 1,
// is_create: isCreate,
// papersUrl: 'zy/v2/examination/course-papers'
// }
// })
// const path = `/exam/answer?type=1&is_create=${isCreate}&course_id=${cId}&chapter_id=${id}&papersUrl=zy/v2/examination/course-papers`
// if (this.isWeapp) {
// const src = encodeURIComponent(`${window.location.origin}${path}`)
// wx.miniProgram.navigateTo({
// url: `/pages/web/index?src=${src}`
// })
// } else {
// this.$router.push({ path })
// }
this.$router.push({
path: '/exam/answer',
query: {
course_id: cId,
chapter_id: id,
type: 1,
is_create: isCreate,
papersUrl: 'zy/v2/examination/course-papers'
}
})
event.stopPropagation()
},
viewReport(event, id, cId, isCreate) {
const path = `/exam/result?type=1&is_create=${isCreate}&course_id=${cId}&chapter_id=${id}&papersUrl=zy/v2/examination/course-papers`
if (this.isWeapp) {
const src = encodeURIComponent(`${window.location.origin}${path}`)
wx.miniProgram.navigateTo({
url: `/pages/web/index?src=${src}`
})
} else {
this.$router.push({ path })
}
// this.$router.push({
// path: '/exam/result',
// query: {
// course_id: cId,
// chapter_id: id,
// type: 1,
// is_create: isCreate,
// papersUrl: 'zy/v2/examination/course-papers'
// }
// })
// const path = `/exam/result?type=1&is_create=${isCreate}&course_id=${cId}&chapter_id=${id}&papersUrl=zy/v2/examination/course-papers`
// if (this.isWeapp) {
// const src = encodeURIComponent(`${window.location.origin}${path}`)
// wx.miniProgram.navigateTo({
// url: `/pages/web/index?src=${src}`
// })
// } else {
// this.$router.push({ path })
// }
this.$router.push({
path: '/exam/result',
query: {
course_id: cId,
chapter_id: id,
type: 1,
is_create: isCreate,
papersUrl: 'zy/v2/examination/course-papers'
}
})
event.stopPropagation()
},
async tab(e) {
const isLogin = await this.$store.dispatch('checkLogin')
if (e === 1 || e === 2) {
e === 1 ? this.getCourseChapterList() : this.getCourseList()
if (e === 1) {
window.localStorage.examTab = e
this.getCourseChapterList()
} else {
window.localStorage.examTab = 0
this.getCourseList()
}
if (!isLogin) {
if (this.isWeapp) {
// 小程序
......
......@@ -110,6 +110,7 @@ export default {
// h5
this.$router.push({ name })
}
window.localStorage.examTab = 0
}
},
beforeMount() {
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论