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

updata

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