Skip to content
This repository has been archived by the owner on Dec 7, 2020. It is now read-only.

Commit

Permalink
修复课程搜索
Browse files Browse the repository at this point in the history
  • Loading branch information
mohuishou committed May 1, 2018
1 parent 28b02db commit fdd8d01
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 2 deletions.
3 changes: 3 additions & 0 deletions src/pages/course/lists.vue
Original file line number Diff line number Diff line change
Expand Up @@ -413,6 +413,9 @@
this.ShowToast("已经到底了!")
return
}
if (this.page == 1) {
this.isEmpty = false
}
const resp = await this.GetWithBind("/course/all", Object.assign({
page: this.page,
page_size: this.page_size,
Expand Down
8 changes: 6 additions & 2 deletions src/pages/course/search.vue
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@
name: "",
height: 500,
from: "",
isEmpty: false,
isEmpty: false,
}
newCourse(courses) {
for (let i = 0; i < courses.length; i++) {
Expand All @@ -127,6 +127,9 @@
this.ShowToast("已经到底了!")
return
}
if (this.page == 1) {
this.isEmpty = false
}
const resp = await this.PostWithBind("/course/search", {
page: this.page,
page_size: this.page_size,
Expand All @@ -137,7 +140,7 @@
} else {
this.courses = this.newCourse(resp.data)
}
if (resp.data.length === 0) {
if (resp.data.length === 0) {
this.isEmpty = true
}
this.$apply()
Expand All @@ -160,6 +163,7 @@
if (e.detail.value) {
this.name = e.detail.value
}
this.page = 1
this.searchCourse()
}
}
Expand Down

0 comments on commit fdd8d01

Please sign in to comment.