|
@@ -10,15 +10,20 @@
|
|
import {ref} from "vue"
|
|
import {ref} from "vue"
|
|
import {onLoad} from "@dcloudio/uni-app"
|
|
import {onLoad} from "@dcloudio/uni-app"
|
|
import ssDownload from "./ssDownload.vue"
|
|
import ssDownload from "./ssDownload.vue"
|
|
-
|
|
|
|
-
|
|
|
|
|
|
+ import * as httpApi from "@/apis/pdf.js"
|
|
|
|
+
|
|
const pdfUrl = ref('');
|
|
const pdfUrl = ref('');
|
|
const httpUrl = ref('');
|
|
const httpUrl = ref('');
|
|
const ssRef = ref(null)
|
|
const ssRef = ref(null)
|
|
|
|
|
|
- function updatePdfUrl(url) {
|
|
|
|
- httpUrl.value = url;
|
|
|
|
- pdfUrl.value = '/hybrid/html/web/viewer.html?file=' + encodeURIComponent(url);
|
|
|
|
|
|
+ function updatePdfUrl({banben,nianji}) {
|
|
|
|
+ httpApi.getPDFUrl({
|
|
|
|
+ banben,
|
|
|
|
+ nianji,
|
|
|
|
+ }).then(url => {
|
|
|
|
+ httpUrl.value = url;
|
|
|
|
+ pdfUrl.value = '/hybrid/html/web/viewer.html?file=' + encodeURIComponent(url);
|
|
|
|
+ })
|
|
}
|
|
}
|
|
|
|
|
|
function getPostMessage() {
|
|
function getPostMessage() {
|
|
@@ -30,9 +35,8 @@
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
- onLoad(({url}) => {
|
|
|
|
- const mockUrl = "https://501351981.github.io/vue-office/examples/dist/static/test-files/test.pdf"
|
|
|
|
- updatePdfUrl(url||mockUrl);
|
|
|
|
|
|
+ onLoad(({banben, nianji}) => {
|
|
|
|
+ updatePdfUrl({banben, nianji});
|
|
})
|
|
})
|
|
|
|
|
|
</script>
|
|
</script>
|