提交 08b394b7 authored 作者: 王鹏飞's avatar 王鹏飞

chore: 移除toast

上级 c78c9ef6
...@@ -21,19 +21,9 @@ export default { ...@@ -21,19 +21,9 @@ export default {
}, },
methods: { methods: {
getCourseList() { getCourseList() {
this.$toast.loading({ api.getCourseList().then(response => {
duration: 0, this.courseList = response
message: '加载中...',
forbidClick: true
}) })
api
.getCourseList()
.then(response => {
this.courseList = response
})
.finally(() => {
this.$toast.clear()
})
} }
}, },
beforeMount() { beforeMount() {
......
...@@ -39,30 +39,20 @@ export default { ...@@ -39,30 +39,20 @@ export default {
methods: { methods: {
// 课程学习 // 课程学习
getCourse() { getCourse() {
this.$toast.loading({
duration: 0,
message: '加载中...',
forbidClick: true
})
this.loaded = false this.loaded = false
api api.getCourse(this.courseId).then(response => {
.getCourse(this.courseId) this.loaded = true
.then(response => { response.chapters = response.chapters.filter(item => {
this.loaded = true item.children = item.children.filter(
response.chapters = response.chapters.filter(item => { child =>
item.children = item.children.filter( child.type === 2 &&
child => child.resource_id &&
child.type === 2 && child.resource_id !== '6684350363920760832'
child.resource_id && )
child.resource_id !== '6684350363920760832' return item.children.length
)
return item.children.length
})
this.detail = response
})
.finally(() => {
this.$toast.clear()
}) })
this.detail = response
})
} }
}, },
beforeMount() { beforeMount() {
......
...@@ -61,28 +61,18 @@ export default { ...@@ -61,28 +61,18 @@ export default {
methods: { methods: {
// 获取知识点列表 // 获取知识点列表
getCourseTagList() { getCourseTagList() {
this.$toast.loading({ api.getCourseTagList(this.courseId).then(response => {
duration: 0, this.$emit('ready', response)
message: '加载中...', this.detail = response
forbidClick: true this.messageList = response.chapters.map((item, index) => {
}) return {
api id: this.genId(index),
.getCourseTagList(this.courseId) type: 1,
.then(response => { from: 'system',
this.$emit('ready', response) payload: item
this.detail = response }
this.messageList = response.chapters.map((item, index) => {
return {
id: this.genId(index),
type: 1,
from: 'system',
payload: item
}
})
})
.finally(() => {
this.$toast.clear()
}) })
})
}, },
// 输入搜索 // 输入搜索
onSearch() { onSearch() {
......
...@@ -57,21 +57,11 @@ export default { ...@@ -57,21 +57,11 @@ export default {
methods: { methods: {
// 获取知识点详情 // 获取知识点详情
getCourseTag(tagId) { getCourseTag(tagId) {
this.$toast.loading({
duration: 0,
message: '加载中...',
forbidClick: true
})
this.loaded = false this.loaded = false
api api.getCourseTag(tagId || this.tagId).then(response => {
.getCourseTag(tagId || this.tagId) this.loaded = true
.then(response => { this.detail = response
this.loaded = true })
this.detail = response
})
.finally(() => {
this.$toast.clear()
})
}, },
// 去知识点考试页面 // 去知识点考试页面
toExamPage() { toExamPage() {
......
...@@ -57,21 +57,11 @@ export default { ...@@ -57,21 +57,11 @@ export default {
methods: { methods: {
// 获取知识点列表 // 获取知识点列表
getCourseTagList() { getCourseTagList() {
this.$toast.loading({
duration: 0,
message: '加载中...',
forbidClick: true
})
this.loaded = false this.loaded = false
api api.getCourseTagList(this.courseId).then(response => {
.getCourseTagList(this.courseId) this.loaded = true
.then(response => { this.detail = response
this.loaded = true })
this.detail = response
})
.finally(() => {
this.$toast.clear()
})
}, },
onClick({ id }) { onClick({ id }) {
const path = `/exam/answer?type=2&tag_id=${id}&papersUrl=zy/v2/examination/course-papers` const path = `/exam/answer?type=2&tag_id=${id}&papersUrl=zy/v2/examination/course-papers`
......
...@@ -75,19 +75,9 @@ export default { ...@@ -75,19 +75,9 @@ export default {
methods: { methods: {
// 获取课程试听列表 // 获取课程试听列表
getCourseList() { getCourseList() {
this.$toast.loading({ api.getFreeCourseList().then(response => {
duration: 0, this.courseList = response
message: '加载中...',
forbidClick: true
}) })
api
.getFreeCourseList()
.then(response => {
this.courseList = response
})
.finally(() => {
this.$toast.clear()
})
}, },
// 搜索 // 搜索
toSearch() { toSearch() {
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论