学习问答

This commit is contained in:
yanran200730
2023-01-11 09:58:04 +08:00
parent 4fcc643a09
commit e59cc375d1
4 changed files with 133 additions and 14 deletions

View File

@@ -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()
})
}
}
}