From 1d110fe25db7db946520f8111bff79a93e94dac0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=BB=8E=E6=B0=B8=E9=A1=BA?= <971387674@qq.com> Date: Mon, 13 Nov 2023 15:35:43 +0800 Subject: [PATCH] =?UTF-8?q?feature/2.9.42311.02-=E6=88=91=E7=9A=84?= =?UTF-8?q?=E8=96=AA=E8=B5=84=E7=A6=8F=E5=88=A9=E7=A7=BB=E5=8A=A8=E7=AB=AF?= =?UTF-8?q?=E5=88=97=E8=A1=A8=E6=9F=A5=E7=9C=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../components/payrollList/index.js | 10 ++++++++-- .../hrmSalary/pages/mySalaryMobile/index.js | 20 ++++++++++++------- .../hrmSalary/pages/mySalaryMobile/index.less | 7 ++++++- 3 files changed, 27 insertions(+), 10 deletions(-) diff --git a/pc4mobx/hrmSalary/pages/mySalaryMobile/components/payrollList/index.js b/pc4mobx/hrmSalary/pages/mySalaryMobile/components/payrollList/index.js index ce3d6de2..5e4cf85b 100644 --- a/pc4mobx/hrmSalary/pages/mySalaryMobile/components/payrollList/index.js +++ b/pc4mobx/hrmSalary/pages/mySalaryMobile/components/payrollList/index.js @@ -13,12 +13,12 @@ const getLabel = WeaLocaleProvider.getLabel; class Index extends Component { render() { - const { dataSource } = this.props; + const { dataSource, isMore, loading } = this.props; return ( ); } diff --git a/pc4mobx/hrmSalary/pages/mySalaryMobile/index.js b/pc4mobx/hrmSalary/pages/mySalaryMobile/index.js index e4d5d47f..e1fade72 100644 --- a/pc4mobx/hrmSalary/pages/mySalaryMobile/index.js +++ b/pc4mobx/hrmSalary/pages/mySalaryMobile/index.js @@ -6,7 +6,6 @@ */ import React, { Component } from "react"; import { WeaLocaleProvider, WeaTab } from "ecCom"; -import { message } from "antd"; import moment from "moment"; import MobileDatePicker from "./components/mobileDatePicker"; import PayrollList from "./components/payrollList"; @@ -20,7 +19,8 @@ class Index extends Component { super(props); this.state = { dataSource: [], loading: false, pageInfo: { current: 1, pageSize: 10, total: 0 }, - salaryYearMonth: [moment().startOf("year").format("YYYY-MM"), moment().startOf("month").format("YYYY-MM")] + salaryYearMonth: [moment().startOf("year").format("YYYY-MM"), moment().startOf("month").format("YYYY-MM")], + isMore: true //是否还有更多数据 }; } @@ -48,14 +48,20 @@ class Index extends Component { const { datas: dataSource, pageInfo: pageResult } = data; const { pageNum: current, pageSize, total } = pageResult; this.setState({ - dataSource, pageInfo: { ...pageInfo, current, pageSize, total } - }); + dataSource: [...this.state.dataSource, ...dataSource], + pageInfo: { ...pageInfo, current, pageSize, total } + }, () => this.setState({ isMore: this.state.dataSource.length < total })); } }).catch(() => this.setState({ loading: false })); }; handleLoadMore = () => { // 为测试效果临时使用 message - message.info("触底了~"); + const { pageInfo, isMore } = this.state; + if (!isMore) return; + const { current } = pageInfo; + this.setState({ + pageInfo: { ...pageInfo, current: current + 1 } + }, () => this.getMySalaryBillList()); }; isTouchBottom = (handler) => { const div = document.getElementById("mySalaryMobile"); @@ -70,7 +76,7 @@ class Index extends Component { }; render() { - const { salaryYearMonth, dataSource } = this.state; + const { salaryYearMonth, dataSource, isMore, loading } = this.state; const [salaryStartYearMonth, salaryEndYearMonth] = salaryYearMonth; return (
@@ -86,7 +92,7 @@ class Index extends Component { {getLabel(15322, "至")} this.handleChange("salaryEndYearMonth", v)}/>
- + ); } diff --git a/pc4mobx/hrmSalary/pages/mySalaryMobile/index.less b/pc4mobx/hrmSalary/pages/mySalaryMobile/index.less index 16ae3726..2db7cfab 100644 --- a/pc4mobx/hrmSalary/pages/mySalaryMobile/index.less +++ b/pc4mobx/hrmSalary/pages/mySalaryMobile/index.less @@ -59,7 +59,12 @@ padding: 8px 0; margin-top: 87px; - li { + li.empty, li.more { + text-align: center; + color: #999; + } + + li.item { display: flex; flex-direction: column; border-radius: 5px;