index.vue 990 B

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  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 url = ref("")
  12. const pdfUrl = ref("")
  13. const webHost = ref("http://120.46.159.163:401/ezhizao-dms-sys")
  14. const fileUrl = ref("")
  15. const pdfjs = ref("/static/hybrid/html/web/viewer.html")
  16. const totalPage=ref(0) //总页码
  17. const currentReadPage = ref(0) //当前页码
  18. onLoad((options) => {
  19. pdfUrl.value = options.param1
  20. fileUrl.value =webHost.value + pdfUrl.value
  21. uni.setNavigationBarTitle({
  22. title: ""
  23. });
  24. console.log(fileUrl.value)
  25. init();
  26. });
  27. function init() {
  28. console.log(fileUrl.value)
  29. url.value =pdfjs.value + '?file=' +encodeURIComponent(fileUrl.value);
  30. console.log(11, url.value)
  31. }
  32. </script>
  33. <style>
  34. </style>