<route lang="json5" type="page">
	{
	layout: 'default',
	style: {
	navigationStyle: 'custom',
	navigationBarTitleText: 'H5在线预览',
	},
	}
</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 {
		getEnvBaseUrl
	} from '@/utils/index'
	const appStore = useAppStore();
	import {
		Base64
	} from 'js-base64'
	
	var fileUrl = "";
	const baseUrl = 'https://10.75.166.6/jeecg-boot/sys/common/static/';
	const handleClickLeft = () => {
		uni.navigateBack()
	}

	onLoad((options) => {
		console.log(options)
		let url = JSON.parse(options.data)
		url = baseUrl + url;
		console.log(url)
		fileUrl ='https://36.112.48.190/preview/onlinePreview?url=' + encodeURIComponent(Base64.encode(url))
		console.log(fileUrl)
	})
</script>

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