<template>
	<view>
		<view class="pack-center pages-hint grey" v-if="loading">
		    <image src="https://douhuo-storage.oss-cn-beijing.aliyuncs.com/images/2023/06/06/ce792f15541723fe847a2d2073de151d.gif"></image>
		    <view>疯狂加载中...</view>
		</view>
		
		<web-view :src="pdfUrl"></web-view>
		<!-- <web-view src="https://uniapp.dcloud.io/static/web-view.html"></web-view> -->
		<!-- <web-view src="/static/hybrid/web/viewer.html" :webview-styles="{height:'100%'}"></web-view> -->
	</view>
</template>

<script>
	export default {
		data() {
			return {
				viewerUrl	: '/static/hybrid/web/viewer.html',
				pdfUrl		: '',
				loading     : true
			};
		},
		onLoad(params){
			let that = this
			setTimeout(function() {
				that.loading = false
				const urlStr = params.url; // 这里是获取的url值
				that.pdfUrl = `${that.viewerUrl}?file=${decodeURIComponent(urlStr)}`;
			}, 2000);
		},
		onBackPress(){}
	}
</script>



<style>
.pack-center {
	display: -webkit-box;
	-webkit-box-orient: vertical;
	-webkit-box-pack: center;
	position: absolute;
	left: 0;
	right: 0;
	top: 0;
	bottom: 0;
	z-index: -1;
}

.pages-hint {
    width: 100%;
    text-align: center;
    color: #747788;
    font-size: 28rpx;
    background: white;
	background-color: #f9f9f9;
}

.pages-hint image {
    width: 220rpx;
    height: 220rpx;
}

</style>