<route lang="json5" type="page">
	{
	layout: 'default',
	style: {
	navigationStyle: 'custom',
	navigationBarTitleText: '在线预览',
	},
	}
</route>
<template>
	<view :class="{ 'gray': appStore.isGray == 1 }">
		<wd-navbar left-text="返回" left-arrow
			custom-style="padding-top: var(--status-bar-height, 0); background-image: linear-gradient(to right, #1890ff, #096dd9); color: #fff;"
			@click-left="handleClickLeft">
		</wd-navbar>
		<iframe id="bdIframe" :src="fileUrl" ref="bdIframe" style="border: none;" class="iframe" />
	</view>
</template>

<script setup>
	import {
		useAppStore
	} from '@/store'
	import {
		onLoad
	} from '@dcloudio/uni-app';
	import Base64 from '@/utils/code';
	import {
		getEnvBaseUrl
	} from '@/utils/index'
	const appStore = useAppStore();
	var fileUrl = "";
	const handleClickLeft = () => {
		uni.navigateBack()
	}
	
	onLoad((options) => {
		let base64 = new Base64();
		var url = getEnvBaseUrl() + '/sys/common/static/' + options.data;
		console.log('-----111',url)
		fileUrl = 'https://36.112.48.190/preview/onlinePreview?url=' + encodeURIComponent(base64.encode(url))
		console.log('-----222',fileUrl)
	})
</script>

<style>
	#bdIframe {
		position: absolute;
		top: 10;
		left: 0;
		width: 100%;
		height: 100%;
	}
</style>