<template>
	<page-meta root-font-size="system" />
	<view>
		<web-view :src="url"></web-view>
	</view>
</template>

<script setup lang="ts">
import { onLoad } from '@dcloudio/uni-app';
import { ref } from 'vue';
import config from '@/config';

const url = ref('');
onLoad((options) => {
	switch (options.type) {
		case 'doc':
			const previewDocUrl = 'https://view.xdocin.com/view?src='
			url.value = decodeURIComponent(previewDocUrl + config.baseUrlPre + options.url);
			break
		// case 'download':
		// 	url.value = decodeURIComponent(config.baseUrlPre + options.url);
		// 	break
		default:
			url.value = decodeURIComponent(options.url)
	}
	// if(options.type=='doc'){
	// 	const previewDocUrl='https://view.xdocin.com/view?src='
	// 	url.value = decodeURIComponent(previewDocUrl+config.baseUrlPre+options.url)
	// }else{
	// 	url.value = decodeURIComponent(options.url)
	// }
	console.log('url', url.value);
});
</script>

<style lang="scss"></style>