Browse Source

预览pdf页面

cxmo 1 year ago
parent
commit
fcc2a0c26e
3 changed files with 42 additions and 0 deletions
  1. 38 0
      pages-report/previewPDF.vue
  2. 3 0
      pages.json
  3. 1 0
      pages/pc.vue

+ 38 - 0
pages-report/previewPDF.vue

@@ -0,0 +1,38 @@
+<template>
+    <web-view :src="url" />
+</template>
+
+<script>
+export default {
+    data() {
+        return {
+            msgObj:{},
+            url:''
+        };
+    },
+    onLoad(options) {
+        this.init(options)
+        wx.setVisualEffectOnCapture({visualEffect:'hidden'})
+    },
+    onShareAppMessage() {
+        return {
+            title:this.msgObj.title,
+            path:`/pages-report/previewPDF?Id=${this.msgObj.Id}`,
+        }
+    },
+    methods: {
+        init(options){
+            this.url = `http://192.168.77.31:3000/xcx_h5/hzyb/report/previewpdf`
+        },
+        handleGetMessage(e){
+            const data=e.detail.data[e.detail.data.length-1]
+            console.log('h5传来的数据',data);
+            this.msgObj=data
+        },
+    },
+};
+</script>
+
+<style scoped lang="scss">
+
+</style>

+ 3 - 0
pages.json

@@ -303,6 +303,9 @@
 					"style":{
 					"style":{
 						"navigationBarTitleText": "播放列表 "
 						"navigationBarTitleText": "播放列表 "
 					}
 					}
+				},
+				{
+					"path": "previewPDF"
 				}
 				}
 			]
 			]
 		},
 		},

+ 1 - 0
pages/pc.vue

@@ -27,6 +27,7 @@ const mapObj=new Map([
     ['pages/positionAnalysis/index','/positionanalysis/index'],
     ['pages/positionAnalysis/index','/positionanalysis/index'],
     ['pages/positionAnalysis/detail','/positionanalysis/detail'],
     ['pages/positionAnalysis/detail','/positionanalysis/detail'],
     ['pages-report/chapterList','/report/detail'],
     ['pages-report/chapterList','/report/detail'],
+    ['pages-report/previewPDF','/report/previewPDF']
 ])//map映射小程序页面路径对应h5页面路径
 ])//map映射小程序页面路径对应h5页面路径
 import {apiUserInfo} from '@/api/user'
 import {apiUserInfo} from '@/api/user'
 import {apiGetSceneToParams} from '@/api/common'
 import {apiGetSceneToParams} from '@/api/common'