Commit b050fc24 authored by 1271610056@qq.com's avatar 1271610056@qq.com

物业费详情bug处理

parent 5d8f3353
......@@ -4,7 +4,7 @@ import { Input, Menu, Table, Space, Pagination, Tooltip } from 'antd';
import { Link, useIntl, connect, Dispatch } from 'umi';
import PDF from 'react-pdf-js'; //
import PDF from 'react-pdf-js';
import { render } from 'react-dom';
import { Document } from 'react-pdf/dist/entry.webpack';
......@@ -22,9 +22,14 @@ const ChargeDetail = (props: any) => {
const [pages, setPages] = useState(1);
const [curpage, setCurpage] = useState(1);
useEffect(() => {
if (!CurData) {
history.back();
}
}, []);
const pdfpages = (pages: any) => {
setPages(pages);
//alert(pages)
};
const lookup = () => {
......@@ -39,10 +44,6 @@ const ChargeDetail = (props: any) => {
setCurpage(curpage);
};
if (!CurData) {
history.back();
}
return (
<div className={styles.base}>
{CurData ? (
......@@ -63,9 +64,8 @@ const ChargeDetail = (props: any) => {
<div className={styles.item25}>{CurData.floorNumber}</div>
<div className={styles.item245}>——</div>
<div className={styles.item26}>{CurData.roomNumber}</div>
<div className={styles.item27}>业主姓名</div>
<div className={styles.item27}>{CurData.tosOwnerName}</div>
</div>
<>{stringSplit(CurData.billFileUrl, 'm/cash')}</>
<div className={styles.box4}>
<Pagination simple defaultCurrent={curpage} total={pages * 10} onChange={pageChange} />
</div>
......@@ -74,11 +74,12 @@ const ChargeDetail = (props: any) => {
<div className={scale == 1.3 ? styles.box3out : null}>
<div className={scale == 1.3 ? styles.box3 : styles.box3of} onClick={lookup}>
<PDF
key="pdfjs"
// key="pdfjs"
file={
'data:application/pdf;base64,' + stringSplit(CurData.billFileUrl, 'm/cash')
// 'data:application/pdf;base64,' + stringSplit(CurData.billFileUrl, 'm/cash')
stringSplit(CurData.billFileUrl, 'm/cash')
}
workerSrc="//cdnjs.cloudflare.com/ajax/libs/pdf.js/2.2.228/pdf.worker.js"
// workerSrc="//cdnjs.cloudflare.com/ajax/libs/pdf.js/2.2.228/pdf.worker.js"
scale={scale}
page={curpage}
onDocumentComplete={pdfpages}
......
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