|
@@ -16,7 +16,8 @@ Component({
|
|
|
size: 20,
|
|
size: 20,
|
|
|
list: [],
|
|
list: [],
|
|
|
total: 0,
|
|
total: 0,
|
|
|
- cargoOwnerId: 0
|
|
|
|
|
|
|
+ cargoOwnerId: 0,
|
|
|
|
|
+ isFreshing: false
|
|
|
},
|
|
},
|
|
|
methods: {
|
|
methods: {
|
|
|
async getVoyageList(isScroll) {
|
|
async getVoyageList(isScroll) {
|
|
@@ -59,9 +60,13 @@ Component({
|
|
|
return
|
|
return
|
|
|
} else {
|
|
} else {
|
|
|
this.setData({
|
|
this.setData({
|
|
|
- cargoOwnerId
|
|
|
|
|
|
|
+ cargoOwnerId,
|
|
|
|
|
+ list: []
|
|
|
})
|
|
})
|
|
|
}
|
|
}
|
|
|
|
|
+ this.setData({
|
|
|
|
|
+ isFreshing: true
|
|
|
|
|
+ })
|
|
|
let res = await postApi('/voyage/list', {
|
|
let res = await postApi('/voyage/list', {
|
|
|
cargoOwnerId: wx.getStorageSync('cargoOwnerId'),
|
|
cargoOwnerId: wx.getStorageSync('cargoOwnerId'),
|
|
|
term: this.data.term,
|
|
term: this.data.term,
|
|
@@ -70,7 +75,8 @@ Component({
|
|
|
size: this.data.size
|
|
size: this.data.size
|
|
|
})
|
|
})
|
|
|
this.setData({
|
|
this.setData({
|
|
|
- currentPage: this.data.currentPage
|
|
|
|
|
|
|
+ currentPage: this.data.currentPage,
|
|
|
|
|
+ isFreshing: false
|
|
|
})
|
|
})
|
|
|
if (res.data.status == 0) {
|
|
if (res.data.status == 0) {
|
|
|
if (isScroll) {
|
|
if (isScroll) {
|
|
@@ -124,6 +130,14 @@ Component({
|
|
|
if (this.data.total == 0 || this.data.total <= this.data.size * this.data.currentPage) return
|
|
if (this.data.total == 0 || this.data.total <= this.data.size * this.data.currentPage) return
|
|
|
this.data.currentPage += 1
|
|
this.data.currentPage += 1
|
|
|
this.getVoyageList(true)
|
|
this.getVoyageList(true)
|
|
|
|
|
+ },
|
|
|
|
|
+ scrollDownList() {
|
|
|
|
|
+ this.setData({
|
|
|
|
|
+ total: 0,
|
|
|
|
|
+ currentPage: 1,
|
|
|
|
|
+ list: []
|
|
|
|
|
+ })
|
|
|
|
|
+ this.getVoyageList()
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
})
|
|
})
|