<template>
	<div>
		<el-descriptions title="活动信息" :column="1" border>
			<el-descriptions-item label="活动名称">{{ detailInfo.campaignName }}</el-descriptions-item>
			<el-descriptions-item label="活动内容">{{ detailInfo.campaignContent }}</el-descriptions-item>
			<el-descriptions-item label="活动状态">
				<el-tag v-if="detailInfo.campaignStatus == 1" size="small">生效</el-tag>
				<el-tag v-if="detailInfo.campaignStatus == 0" type="danger" size="small">失效</el-tag>
			</el-descriptions-item>
			<el-descriptions-item label="活动时间">
				{{ detailInfo.effectiveStartTime }}-{{ detailInfo.effectiveEndTime }}
			</el-descriptions-item>
			<el-descriptions-item label="活动附件">
				<div v-if="detailInfo.fileName != '' && detailInfo.fileName != null">
					<el-popconfirm title="确定要下载文件吗" v-for="(item, index) in  detailInfo.fileName.split(',')" :key="index"
						@confirm="downLoad(detailInfo.fileUrl, index)">
						<el-button size="mini" type="primary" icon="el-icon-folder-opened" plain slot="reference">{{ item
						}}</el-button>
					</el-popconfirm>
				</div>
				<div v-else>
					无
				</div>
			</el-descriptions-item>
		</el-descriptions>
	</div>
</template>

<script>
export default {
	props: {
		detailInfo: Object
	},
	methods: {
		downLoad (fileUrl, index) {
			let fileArr = fileUrl.split(',')
			window.open(fileArr[index])
		},
	}
}
</script>

<style></style>