...
|
...
|
@@ -10,25 +10,17 @@ const pdfPreview = (props: pdfPreviewProps) => { |
10
|
10
|
|
11
|
11
|
useEffect(()=>{
|
12
|
12
|
if (props.url) {
|
13
|
|
- // const _url = encodeURIComponent(props.url);
|
14
|
|
- const _url = props.url;
|
|
13
|
+ const _url = encodeURIComponent(props.url);
|
15
|
14
|
setFilePath(_url);
|
16
|
15
|
}
|
17
|
16
|
},[props.url])
|
18
|
17
|
|
19
|
|
- // #viewerContainer margin-bottom: 0;
|
20
|
|
-
|
21
|
|
-
|
22
|
18
|
return (
|
23
|
19
|
<div className={'pdfPreview'}>
|
24
|
|
- {/* pdf属性 page 跳转到指定页码,navpanes 控制左侧的缩略图预览导航是否默认打开。0-关闭,1-打开*/}
|
25
|
|
- {/* navpanes=0&scrollbars=0&toolbar=0&statusbar=0 去除缩略图和工具栏 */}
|
26
|
|
- {/* view=FitH,top 为全屏展示 */}
|
27
|
20
|
<iframe
|
28
|
21
|
title="pdf-preview"
|
29
|
22
|
style={{ width: '100%', height: '100%' }}
|
30
|
|
- src={`${filePath}#page=1&navpanes=0&scrollbars=0&toolbar=0&statusbar=0&view=FitH,top`}
|
31
|
|
- // src={`https://h5jianke.21tb.com/file/generic_mobile/web/viewer.html?file=${filePath}#page=1&navpanes=0&scrollbars=0&toolbar=0&statusbar=0&view=FitH,top`}
|
|
23
|
+ src={`https://h5jianke.21tb.com/file/generic_mobile/web/viewer.html?file=${filePath}`}
|
32
|
24
|
/>
|
33
|
25
|
</div>
|
34
|
26
|
);
|
...
|
...
|
|