123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657 |
- <template>
- <view style="position: absolute;
- top: 0;
- left: 0;
- right: 0;
- height: 100%;">
- <web-view :src="url"></web-view>
- <!-- <iframe width="100%" height="800rpx" :src="url"></iframe> -->
- </view>
- </template>
- <script setup>
- import {
- onMounted,
- computed,
- ref
- } from 'vue';
- import {
- onLoad,
- } from '@dcloudio/uni-app';
- import {
- store
- } from '../../store';
- const urlList = JSON.parse(uni.getStorageSync('baseUrl'))
- const url = ref("")
- const pdfUrl = ref("")
- const webHost = ref(urlList.pdfAppURL)
- const fileUrl = ref("")
- const pdfjs = ref("/static/hybrid/html/web/viewer.html")
- const totalPage = ref(0) //总页码
- const currentReadPage = ref(0) //当前页码
- onLoad((options) => {
- console.log(urlList)
- pdfUrl.value = options.param1
- fileUrl.value = webHost.value + pdfUrl.value
- console.log(webHost.value)
- uni.setNavigationBarTitle({
- title: ""
- });
- console.log(fileUrl.value)
- init();
- });
- function init() {
- console.log(fileUrl.value)
- url.value = pdfjs.value + '?file=' + encodeURIComponent(fileUrl.value);
- console.log(11, url.value)
- }
- </script>
- <style>
- </style>
|