<template>
	<view class="main">
		<view class="detail">
			<view class="item">
				<view class="title">会议名称:</view>
				<view class="info">{{detail.name}}</view>
			</view>

			<view class="item">
				<view class="title">会议分类:</view>
				<view class="info">{{detail.type_info.name}}</view>
			</view>

			<view class="item">
				<view class="title">组织部门:</view>
				<view class="info">{{detail.org.name}}</view>
			</view>

			<view class="item">
				<view class="title">主持人:</view>
				<view class="info">{{detail.anchor_info.nickname}}</view>
			</view>

			<view class="item">
				<view class="title">参会人员:</view>
				<view class="info people">
					<uni-tag :circle="true" type="primary" v-for="(item,index) in detail.writer_info" :key="index"
						:text="item.nickname"></uni-tag>
				</view>
			</view>

			<view class="item">
				<view class="title">协作人员:</view>
				<view class="info people">
					<uni-tag :circle="true" type="primary" v-for="(item,index) in detail.actor_info" :key="index"
						:text="item.name"></uni-tag>
				</view>
			</view>

			<view class="item">
				<view class="title">会议时间:</view>
				<view class="info">{{detail.drawup}}</view>
			</view>

			<view class="item">
				<view class="title">会议地点:</view>
				<view class="info">{{detail.location}}</view>
				<view class="info">{{detail.location_detail}}</view>
			</view>

			<view class="item">
				<view class="title">会议通知:</view>
				<view class="info">{{detail.notify}}</view>
			</view>

			<view class="item">
				<view class="title">会议影像:</view>
				<view class="info">
					<uni-file-picker file-mediatype="image" v-model="detail.images" readonly></uni-file-picker>
					<!-- <view v-for="(item,index) in detail.images">
						<span @click="downFile(item.url)">{{item.name}}</span>
					</view> -->
				</view>
			</view>

			<view class="item">
				<view class="title">会议内容:</view>
				<view class="info">
					<div style="width: 500rpx;">
						<u-parse :content="detail.content" noData="无内容" :imageProp="imageProp"></u-parse>
					</div>
				</view>
			</view>
		</view>
	</view>
</template>

<script>
	import config from '@/common/config.js'
	import uParse from '@/components/u-parse/u-parse.vue'
	export default {
		components: {
			uParse
		},
		data() {
			return {
				detail: '',
				imageProp: {
					domain: 'anquansys.sxlq.com:37100'
				}
			}
		},
		onLoad({
			s_id
		}) {
			this.getDetail(s_id);
		},
		methods: {
			joinImageUrl(url) {
				return config.ROOTPATH + url.substring(1)
			},
			downFile(url) {
				console.log(url)
				uni.downloadFile({
					url: url
				});
			},
			getDetail(id) {
				getApp().globalData.request.post(
					"responsibility/safeconference/show/" + id, {
						id
					}
				).then(res => {
					this.detail = res.data
					this.detail.images = res.data.images.map(item => {
						return {
							...item,
							url: this.joinImageUrl(item.url)
						}
					})
				})
			}
		}
	}
</script>

<style scoped lang="scss">
	@import url("@/components/u-parse/u-parse.css");

	.main {
		padding: 30rpx;
		font-size: 28rpx;
		background-color: #f4f9ff;
	}

	.detail {
		padding: 20rpx;
		background-color: #fff;
		border-radius: 20rpx;
	}

	.item {
		display: flex;
		justify-content: space-between;
		margin: 23rpx 0;

		.title {
			color: #797979;
			width: 150rpx;
		}

		.info {
			flex: 1;
			text-align: right;
			color: #6d6d6d;
		}

		.people {
			display: flex;
			justify-content: end;
			gap: 2rpx;
			flex-wrap: wrap;
		}
	}
</style>