学习问答
This commit is contained in:
@@ -27,12 +27,19 @@
|
||||
export default {
|
||||
data () {
|
||||
return {
|
||||
|
||||
search: {
|
||||
current: 1,
|
||||
title: '',
|
||||
size: 20
|
||||
},
|
||||
isMore: false,
|
||||
list: []
|
||||
}
|
||||
},
|
||||
|
||||
mounted: {
|
||||
|
||||
mounted () {
|
||||
this.$loading()
|
||||
this.getList()
|
||||
},
|
||||
|
||||
methods: {
|
||||
@@ -40,6 +47,37 @@
|
||||
uni.navigateTo({
|
||||
url: './IntegralDetail'
|
||||
})
|
||||
},
|
||||
|
||||
getList () {
|
||||
if (this.isMore) return
|
||||
this.$http.post(`/app/applearningquestion/scoreRanking`, null, {
|
||||
params: {
|
||||
...this.search
|
||||
}
|
||||
}).then(res => {
|
||||
if (res.code == 0) {
|
||||
if (this.search.current > 1) {
|
||||
this.list = [...this.list, ...res.data.records]
|
||||
} else {
|
||||
this.list = res.data.records
|
||||
}
|
||||
|
||||
uni.hideLoading()
|
||||
|
||||
if (res.data.records.length < 20) {
|
||||
this.isMore = true
|
||||
|
||||
return false
|
||||
}
|
||||
|
||||
this.search.current = this.search.current + 1
|
||||
} else {
|
||||
uni.hideLoading()
|
||||
}
|
||||
}).catch(() => {
|
||||
uni.hideLoading()
|
||||
})
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user