|
@@ -5,7 +5,8 @@
|
|
|
<uni-popup class="dljt-pdf-popup" ref="popup" type="bottom" background-color="#fff" :mask-click="false" :animation="false">
|
|
|
<view class="pdf-popup-box">
|
|
|
<uni-nav-bar class="pdf-return-btn" shadow left-icon="left" title="PDF预览" @clickLeft="handleBack" />
|
|
|
- <web-view class="dljt-pdf-view" :src="pdfUrl1" v-if="showPdfUrl" ></web-view>
|
|
|
+ <web-view class="dljt-pdf-view" :src="pdfUrl1" v-if="showPdfUrl" >
|
|
|
+ </web-view>
|
|
|
</view>
|
|
|
</uni-popup>
|
|
|
|
|
@@ -14,8 +15,9 @@
|
|
|
<script setup>
|
|
|
import {
|
|
|
nextTick,
|
|
|
- ref
|
|
|
+ ref,
|
|
|
} from "vue"
|
|
|
+ import {addClassToWebViewIframe}from "@/utils/common.js"
|
|
|
const props = defineProps({
|
|
|
pdfUrl: {
|
|
|
type: String
|
|
@@ -25,21 +27,24 @@
|
|
|
let pdfUrl1 = '';
|
|
|
const popup = ref(null)
|
|
|
|
|
|
- const emits = defineEmits(['showNav'])
|
|
|
+ const emits = defineEmits(['showNav'])
|
|
|
|
|
|
function handleOpen() {
|
|
|
popup.value.open('bottom')
|
|
|
pdfUrl1 = `/hybrid/html/web/viewer.html?file=${encodeURIComponent(props.pdfUrl)}`;
|
|
|
setTimeout(() => {
|
|
|
showPdfUrl.value = true;
|
|
|
- emits('showNav', false)
|
|
|
+ emits('showNav', false)
|
|
|
+ setTimeout(() => {
|
|
|
+ addClassToWebViewIframe()
|
|
|
+ },10)
|
|
|
}, 50)
|
|
|
}
|
|
|
|
|
|
function handleBack() {
|
|
|
popup.value.close()
|
|
|
showPdfUrl.value = false;
|
|
|
- emits('showNav', true)
|
|
|
+ emits('showNav', true)
|
|
|
}
|
|
|
</script>
|
|
|
|