<template>
	<view :class="['content',{'gray':store.isgray==1}]">
		<view class="title_box">
			<view class="title">
				{{detail._title}}
			</view>
			<view class="time">
				{{detail._time}}
			</view>
		</view>
		<view class="document f-row">
			<text class="">
				附件：
			</text>
			<view class="f-col">
				<view class="" style="padding: 5rpx 0;" @click="opendocument(item)"
					v-for="item,i in detail?.pdf?.split(',')">
					{{item}}

				</view>
			</view>
		</view>
	</view>
</template>

<script setup>
	import {
		ref
	} from 'vue'
	import {
		onLoad
	} from '@dcloudio/uni-app';
	import {
		opendocument
	} from '@/utils/index.js';
	import {
		useStore
	} from '@/store';
	const store = useStore();
	const detail = ref({})
	onLoad((options) => {
		detail.value = JSON.parse(options.data)
		if (options.id == 0) {
			detail.value.pdf = detail.value.wjbt
		} else if (options.id == 2) {
			if (detail.value.jdwj) {
				detail.value.pdf = detail.value.jdwj + ',' + detail.value.sszd
			} else {
				detail.value.pdf = detail.value.sszd
			}

		} else if (options.id == 3) {
			detail.value.pdf = detail.value.mingcheng
		}
	})
</script>

<style>
	/* page{
		background-color: #f8f8f8;
	} */
</style>
<style lang="scss" scoped>
	.content {
		padding: 0 30rpx;
	}

	.title_box {

		.title {
			font-size: 32rpx;
			color: #333333;
			padding: 30rpx 0 20rpx 0;
		}

		.time {
			font-size: 24rpx;
			color: #888888;
			padding-bottom: 30rpx;
		}
	}

	.document {
		text {
			font-size: 28rpx;
			color: #333333;
			white-space: nowrap;
		}

		view {
			font-size: 28rpx;
			color: #5A79F8;
			text-decoration: underline;
		}
	}
</style>