You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
52 lines
1.1 KiB
52 lines
1.1 KiB
Page({
|
|
data: {
|
|
pageSize: 10,
|
|
pageIndex: 1,
|
|
listLength: 0,
|
|
loadVisible: true,
|
|
loadType: 'more',
|
|
isShow: false,
|
|
selectTab: 'tab0',
|
|
newList: [],
|
|
preloadVisible: true,
|
|
pagename: 'unSolved'
|
|
},
|
|
onShow: function () {
|
|
this.selectComponent("#tab1").getUnpassedList(this.data)
|
|
},
|
|
onGetCode: function (e: { detail: { val: any } }) {
|
|
this.setData({
|
|
preloadVisible: e.detail.preloadVisible,
|
|
listLength: e.detail.listLength,
|
|
loadType: e.detail.loadType
|
|
})
|
|
if (this.data.pageIndex == 1) {
|
|
if (e.detail.listLength == 0) {
|
|
this.setData({
|
|
loadVisible: false,
|
|
isShow: true
|
|
})
|
|
}
|
|
}
|
|
},
|
|
/**
|
|
* 页面上拉触底事件的处理函数
|
|
*/
|
|
onReachBottom: function () {
|
|
// 判断是否需要在加载数据
|
|
if (this.data.listLength !== this.data.pageSize) {
|
|
this.setData({
|
|
loadType: 'none',
|
|
})
|
|
return
|
|
}
|
|
this.setData({
|
|
loadType: 'more',
|
|
})
|
|
let obj = {
|
|
pageIndex: ++this.data.pageIndex,
|
|
pageSize: this.data.pageSize,
|
|
}
|
|
this.selectComponent("#tab1").getUnpassedList(this.data)
|
|
}
|
|
})
|
|
|