index.vue 1.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  1. <template>
  2. <view style="height: 1100rpx;">
  3. <web-view :src="url" ></web-view>
  4. <!-- <iframe width="100%" height="800rpx" :src="url"></iframe> -->
  5. </view>
  6. </template>
  7. <script setup>
  8. import {onMounted,computed,ref} from 'vue';
  9. import {onLoad,} from '@dcloudio/uni-app';
  10. import { store } from '../../store';
  11. const urlList = uni.getStorageSync('baseUrl')
  12. const url = ref("")
  13. const pdfUrl = ref("")
  14. const webHost = ref(urlList.pdfAppURL)
  15. const fileUrl = ref("")
  16. const pdfjs = ref("/static/hybrid/html/web/viewer.html")
  17. const totalPage=ref(0) //总页码
  18. const currentReadPage = ref(0) //当前页码
  19. onLoad((options) => {
  20. pdfUrl.value = options.param1
  21. fileUrl.value =webHost.value + pdfUrl.value
  22. console.log(webHost.value)
  23. uni.setNavigationBarTitle({
  24. title: ""
  25. });
  26. console.log(fileUrl.value)
  27. init();
  28. });
  29. function init() {
  30. console.log(fileUrl.value)
  31. url.value =pdfjs.value + '?file=' +encodeURIComponent(fileUrl.value);
  32. console.log(11, url.value)
  33. }
  34. </script>
  35. <style>
  36. </style>