Commit cbc7aa87 by zhangzhen

细节优化

parent 080e5406
......@@ -12,5 +12,5 @@ export const getDataStatistics=(data)=>{
export const getOrderStatistics=(data)=>{
let url=`/order/statistics/orderList`
return http.post(url,data)
return http.get(url,data)
}
......@@ -225,7 +225,7 @@
minDate: moment().subtract(1,'y').format("YYYY-MM-DD"),
maxDate: moment().format("YYYY-MM-DD 23:59:59"),
defaultDate:[
moment().subtract(6,'M').format("YYYY-MM-DD"),
moment().format("YYYY-MM-DD"),
moment().format("YYYY-MM-DD")
],
faultDate:{
......@@ -233,7 +233,8 @@
endTime: moment().format("YYYY-MM-DD")
},
platformTypeEnum:{},
orderVoList:[]
orderVoList:[],
pageNum:0
}
},
onLoad() {
......@@ -287,21 +288,35 @@
uni.hideLoading();
this.statisticsData = res.data.data;
this.orderVoList =this.statisticsData.orderVoList
this.status = "loadmore"
this.status = "loadmore";
this.pageNum = 0;
})
},
onGetOrderStatistics(){
if(this.status === "loadmore"){
if(this.status === "loadmore" && this.orderVoList.length>=5){
this.status = "loading"
this.pageNum+=1;
getOrderStatistics({
storeId: this.storeList[this.index].id,
startTime: this.dateList[this.dateIndex].startTime,
endTime: this.dateList[this.dateIndex].endTime
endTime: this.dateList[this.dateIndex].endTime,
pageNum:this.pageNum,
pageSize:20
}).then(res => {
if(res.data.code ==200){
this.status = "nomore"
this.orderVoList = res.data.data;
this.$forceUpdate();
if(res.data.data && res.data.data.length){
if(res.data.data.length>=20){
this.status = "loadmore"
}else{
this.status = "nomore"
}
if(this.pageNum ==1){
this.orderVoList = res.data.data
}else{
this.orderVoList = [...this.orderVoList,...res.data.data];
}
this.$forceUpdate();
}
}else{
uni.showToast({
icon:"none",
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment