<template>
	<view>
		<view style="color: #fff;">
			<tn-nav-bar @rightClick="handleBtnClick()" backgroundColor="#26B3A0" :bottomShadow="false">pdf预览
				<!-- <view class="" slot="right">
					下载
				</view> -->
			</tn-nav-bar>
			<view :style="{ height: tobheight + 'px' }"></view>

		</view>
		<view class="recordBox">
			<web-view :webview-styles="webviewStyles" class="wiewer" :src="src"></web-view>
			<!-- <ss-download ref="ssdownload" :fileUrl="fileUrl" :fileType="fileType"></ss-download> -->
		</view>
	</view>
</template>

<script>
	export default {
		components: {

		},
		data() {
			return {
				tobheight: 45,
				fileUrl: '',
				fileType: '2',
				src: 'http://t20.9026.com/uploads/images/2023-07-11/3Sp0Cw18vxAJ.pdf',
				reSrc: '',
				webviewStyles: {
					progress: {
						color: '#FF3333',
					},
				},

			};
		},
		computed: {

		},
		created() {},
		async onLoad(o) {
			this.src1 = o.url
			this.previewPdf(this.src1)
		},
		async onShow() {

		},
		methods: {
			previewPdf(value) {
				this.src = `/uni_modules/ss-preview/hybrid/html/pdf-reader/index.html?file=${encodeURIComponent(value)}`;
			},
			// handleBtnClick() {
			// 	if (this.fileType == '2') {
			// 		return uni.$u.toast('文件已下载，请勿重复下载！')
			// 	}
			// 	console.log(123);
			// 	this.fileUrl = this.src;
			// 	this.fileType = '2';
			// }
		}
	}
</script>

<style lang="scss">
	@import './index.scss';

	.wiewer {
		margin-top: 45px;
	}
</style>