|
@@ -30,7 +30,8 @@ export default {
|
|
pageNo: 1, // 页码
|
|
pageNo: 1, // 页码
|
|
pageSize: 20, // 每页多少条
|
|
pageSize: 20, // 每页多少条
|
|
isLastPage: false, // 是否最后一页
|
|
isLastPage: false, // 是否最后一页
|
|
- billNo: '' // 订单编号
|
|
|
|
|
|
+ billNo: '', // 订单编号
|
|
|
|
+ doneLoading: false // 数据请求反馈状态
|
|
};
|
|
};
|
|
},
|
|
},
|
|
methods: {
|
|
methods: {
|
|
@@ -40,7 +41,12 @@ export default {
|
|
mask: true,
|
|
mask: true,
|
|
title: '加载中'
|
|
title: '加载中'
|
|
})
|
|
})
|
|
|
|
+ if(_this.doneLoading){ // 防止多次请求同一页的数据
|
|
|
|
+ return
|
|
|
|
+ }
|
|
|
|
+ _this.doneLoading = true
|
|
queryByOrderList({billNo: _this.billNo, pageNo: _this.pageNo, pageSize: _this.pageSize}).then(res => {
|
|
queryByOrderList({billNo: _this.billNo, pageNo: _this.pageNo, pageSize: _this.pageSize}).then(res => {
|
|
|
|
+ _this.doneLoading = false
|
|
wx.hideLoading()
|
|
wx.hideLoading()
|
|
if(res.status == 200){
|
|
if(res.status == 200){
|
|
res.data.list.map(item => {
|
|
res.data.list.map(item => {
|
|
@@ -54,10 +60,14 @@ export default {
|
|
if(_this.listData.length>=res.data.count){
|
|
if(_this.listData.length>=res.data.count){
|
|
if(_this.pageNo!=1){
|
|
if(_this.pageNo!=1){
|
|
wx.showToast({
|
|
wx.showToast({
|
|
|
|
+ icon: 'none',
|
|
title: '已经是最后一页'
|
|
title: '已经是最后一页'
|
|
})
|
|
})
|
|
}
|
|
}
|
|
_this.isLastPage = true
|
|
_this.isLastPage = true
|
|
|
|
+ }else{
|
|
|
|
+ _this.isLastPage = false
|
|
|
|
+ _this.pageNo++
|
|
}
|
|
}
|
|
}
|
|
}
|
|
})
|
|
})
|
|
@@ -65,19 +75,17 @@ export default {
|
|
// 监听用户上拉触底事件
|
|
// 监听用户上拉触底事件
|
|
scrolltolower() {
|
|
scrolltolower() {
|
|
if(!this.isLastPage){
|
|
if(!this.isLastPage){
|
|
- this.pageNo = this.pageNo + 1
|
|
|
|
this.getList()
|
|
this.getList()
|
|
}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
},
|
|
- onShow() {
|
|
|
|
-
|
|
|
|
- },
|
|
|
|
|
|
+ onShow() {},
|
|
onLoad(options){
|
|
onLoad(options){
|
|
this.billNo = options.billNo
|
|
this.billNo = options.billNo
|
|
this.pageNo = 1
|
|
this.pageNo = 1
|
|
this.listData = []
|
|
this.listData = []
|
|
this.isLastPage = false
|
|
this.isLastPage = false
|
|
|
|
+ this.doneLoading = false
|
|
this.getList()
|
|
this.getList()
|
|
}
|
|
}
|
|
};
|
|
};
|