APPbug反馈修改

This commit is contained in:
仲么了
2023-08-10 09:18:17 +08:00
parent 192bd44c7a
commit f395da8f93
48 changed files with 1420 additions and 480 deletions

View File

@@ -1,23 +1,23 @@
export default {
onPullDownRefresh() {
this.store && this.store.reload();
this.store && this.store.reload()
this.store.loadedCallback = () => {
uni.stopPullDownRefresh();
};
uni.stopPullDownRefresh()
}
},
onReachBottom() {
if (this.store.status != 'noMore') {
this.store.next && this.store.next();
this.store.next && this.store.next()
}
},
data() {
return {
store: {},
};
}
},
methods: {
DataSource(url) {
var me = this;
var me = this
return {
data: [],
status: 'more',
@@ -31,11 +31,11 @@ export default {
pageSize: 20,
},
reload() {
this.data = [];
this.status = 'loading';
this.empty = false;
this.params.pageNum = 1;
this.next();
this.data = []
this.status = 'loading'
this.empty = false
this.params.pageNum = 1
this.next()
},
callBack: null,
firstCallBack: null,
@@ -47,37 +47,35 @@ export default {
header: this.header,
method: 'POST',
}).then((res) => {
console.warn(res);
let resultData =
res.data?.list || res.data?.records || [];
console.warn(res)
let resultData = res.data?.list || res.data?.records || []
if (this.params.pageNum == 1) {
this.data = resultData;
this.data = resultData
if (resultData.length == 0 || resultData == 0) {
this.empty = true;
} else if (
resultData.length < this.params.pageSize
) {
this.status = 'noMore';
this.empty = true
this.status = 'noMore'
} else if (resultData.length < this.params.pageSize) {
this.status = 'noMore'
} else if (res.total == resultData.length) {
this.status = 'noMore';
this.status = 'noMore'
}
} else {
this.data.push(...resultData);
this.data.push(...resultData)
if (resultData.length < this.params.pageSize) {
this.status = 'noMore';
this.status = 'noMore'
}
}
if (this.params.pageNum == 1) {
this.firstCallBack && this.firstCallBack();
this.firstCallBack && this.firstCallBack()
}
this.loadedCallback && this.loadedCallback();
this.params.pageNum++;
this.total = res.total;
this.loading = false;
});
this.loadedCallback && this.loadedCallback()
this.params.pageNum++
this.total = res.total
this.loading = false
})
},
};
}
},
},
};
}