|
|
|
@ -63,25 +63,19 @@ Component({ |
|
|
|
this.onRefreshList() |
|
|
|
}, |
|
|
|
onRefreshList: function () { |
|
|
|
this.setData({ |
|
|
|
orderList: [], |
|
|
|
['form.pageNum']: 1, |
|
|
|
loading: true, |
|
|
|
finished: false |
|
|
|
}) |
|
|
|
this.fetchList() |
|
|
|
// this.setData({ orderList: [], ['form.pageNum']: 1, loading: true, finished: false })
|
|
|
|
// this.fetchList()
|
|
|
|
}, |
|
|
|
fetchList: function () { |
|
|
|
if (this.data.requesting || this.data.finished) { |
|
|
|
return |
|
|
|
} |
|
|
|
if (this.data.loading) { |
|
|
|
if (this.data.orderList.length > 0) { |
|
|
|
this.data.requesting = true |
|
|
|
} else { |
|
|
|
this.setData({ requesting: true }) |
|
|
|
} |
|
|
|
getProductList(this.data.form).then(result => { |
|
|
|
//成功回调
|
|
|
|
if (result.data.records.length) { |
|
|
|
var respList = result.data.records |
|
|
|
let nowList = `orderList[${this.data.orderList.length}]` |
|
|
|
|