<template>
	<view style="position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 100%;">
		<web-view :src="url"></web-view>
		<!-- <iframe width="100%" height="800rpx" :src="url"></iframe> -->
	</view>
</template>

<script setup>
	import {
		onMounted,
		computed,
		ref
	} from 'vue';
	import {
		onLoad,
	} from '@dcloudio/uni-app';
	import {
		store
	} from '../../store';

	const urlList = JSON.parse(uni.getStorageSync('baseUrl'))
	const url = ref("")
	const pdfUrl = ref("")
	const webHost = ref(urlList.pdfAppURL)
	const fileUrl = ref("")
	const pdfjs = ref("/static/hybrid/html/web/viewer.html")
	const totalPage = ref(0) //总页码
	const currentReadPage = ref(0) //当前页码
	onLoad((options) => {
		console.log(urlList)
		pdfUrl.value = options.param1
		fileUrl.value = webHost.value + pdfUrl.value
		console.log(webHost.value)
		uni.setNavigationBarTitle({
			title: ""
		});
		console.log(fileUrl.value)
		init();

	});


	function init() {
		console.log(fileUrl.value)
		const encodeFileUrl = encodeURIComponent(fileUrl.value);
		console.log(encodeFileUrl, "777")
		url.value = pdfjs.value + '?file=' + encodeFileUrl

		console.log(11, url.value)
	}
</script>

<style>

</style>