|
|
|
@ -17,9 +17,8 @@ Component({ |
|
|
|
pageNum: 1, |
|
|
|
pageSize: 10 |
|
|
|
}, |
|
|
|
loading: false, |
|
|
|
loading: true, |
|
|
|
requesting: false, |
|
|
|
token: true, |
|
|
|
finished: false, |
|
|
|
dataIndex: 0, |
|
|
|
orderList: [] |
|
|
|
@ -37,7 +36,6 @@ Component({ |
|
|
|
if(!this.firstShow){ |
|
|
|
var min = new Date() |
|
|
|
min.setHours(0, 0, 0) |
|
|
|
this.data.token = app.globalData.userInfo ? true : false |
|
|
|
this.data.form.date = util.formatDate(min, 'Y-M-D') |
|
|
|
if(app.nowCity){ |
|
|
|
this.data.form.cityId = app.nowCity.cityCode |
|
|
|
@ -47,8 +45,11 @@ Component({ |
|
|
|
this.firstShow = true |
|
|
|
}, |
|
|
|
onEvent: function (message) { |
|
|
|
if(!this.firstShow){ |
|
|
|
return |
|
|
|
} |
|
|
|
if(message.what == 888){ |
|
|
|
this.setData({ token: app.globalData.userInfo ? true : false }) |
|
|
|
this.onRefreshList() |
|
|
|
} else if(message.what == 444 && this.firstShow){ |
|
|
|
this.data.form.cityId = app.nowCity.cityCode |
|
|
|
this.onRefreshList() |
|
|
|
@ -107,13 +108,13 @@ Component({ |
|
|
|
let nowList = `orderList[${this.data.orderList.length}]` |
|
|
|
var num = this.data.form.pageNum |
|
|
|
var finished = this.data.form.pageNum >= result.data.pages |
|
|
|
this.setData({ [nowList]: respList, ['form.pageNum']: (num + 1), finished, requesting: false, loading: false, token: this.data.token }) |
|
|
|
this.setData({ [nowList]: respList, ['form.pageNum']: (num + 1), finished, requesting: false, loading: false }) |
|
|
|
} else { |
|
|
|
this.setData({ finished: true, requesting: false, loading: false, token: this.data.token }) |
|
|
|
this.setData({ finished: true, requesting: false, loading: false }) |
|
|
|
} |
|
|
|
}).catch(err => { |
|
|
|
console.log(err) |
|
|
|
this.setData({ requesting: false, loading: false, token: this.data.token }) |
|
|
|
this.setData({ requesting: false, loading: false }) |
|
|
|
util.showToast(err) |
|
|
|
}) |
|
|
|
} |
|
|
|
|