read.vue 875 B

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  1. <template>
  2. <view >
  3. <view style="width: 100%;" id="app">
  4. <web-view :src="webUrl"></web-view>
  5. </view>
  6. </view>
  7. </template>
  8. <script>
  9. export default {
  10. data() {
  11. return {
  12. webUrl : 'https://m.xyyxt.net/oss/images/20210602/2021_6_2_1763607338.pdf'
  13. }
  14. },
  15. onLoad(option) {
  16. let url = decodeURIComponent(option.url)
  17. console.log(url)
  18. this.webUrl = 'https://m.xyyxt.net/pages/note/index?pdfUrl='+url
  19. /* uni.downloadFile({
  20. url: 'http://192.168.0.222:8080/img/test.pdf',
  21. success: function (res) {
  22. var filePath = res.tempFilePath;
  23. uni.openDocument({
  24. filePath: filePath,
  25. success: function (res) {
  26. console.log('打开文档成功');
  27. }
  28. });
  29. }
  30. }); */
  31. },
  32. onShow(){
  33. },
  34. methods: {
  35. },
  36. }
  37. </script>
  38. <style scope>
  39. page {
  40. background: #FFFFFF;
  41. }
  42. </style>