1234567891011121314151617181920212223242526272829303132333435363738394041424344454647 |
- import moment from "@/components/moment/moment.js";
- export default {
- data() {
- return {
- pagination: {
- total: "",
- currentPage: 1,
- pageSize: 30,
- },
- projectFilter: {},
- loadMoreText: "加载中...",
- };
- },
- methods: {
- initData() {
- var pagination = this.pagination;
- return this.getProject({
- ...this.projectFilter,
- pageSize: pagination.pageSize,
- currentPage: pagination.currentPage,
- }).then((res) => {
- // console.log(res)
- pagination.total = res.pagination.total;
- pagination.currentPage = res.pagination.current;
- if (pagination.currentPage * pagination.pageSize >= pagination.total) {
- this.loadMoreText = "全部加载完毕";
- }
- });
- },
- },
- onReachBottom() {
- // console.log("onReachBottom");
- if (this.projectList.length >= this.pagination.total) {
- this.loadMoreText = "没有更多数据了";
- return;
- }
- this.pagination.currentPage++;
- this.initData();
- },
- onPullDownRefresh() {
- this.pagination.currentPage = 1;
- this.initData().then(() => {
- uni.stopPullDownRefresh();
- });
- },
- };
|