<template>
	<view class="info-container">
		<view class="info-box">
			<view class="info-row">
				<view class="info-lable">企业名称</view>
				<view class="info-value">{{from.name}}</view>
			</view>
			<view class="info-row">
				<view class="info-lable">标准名称</view>
				<view class="info-value">{{from.standard_name}}</view>
			</view>
			<view class="info-row">
				<view class="info-lable">标准编号</view>
				<view class="info-value">{{from.standard_code}}</view>
			</view>
			<view class="info-row">
				<view class="info-lable">公开时间</view>
				<view class="info-value">{{from.publicate_time}}</view>
			</view>
			<!-- <view class="info-row">
				<view class="info-lable">创建者</view>
				<view class="info-value">{{from.createBy}}</view>
			</view>
			<view class="info-row">
				<view class="info-lable">创建时间</view>
				<view class="info-value">{{from.createTime}}</view>
			</view> -->
			<view class="info-row" style="flex-direction: column; align-items: flex-start">
				<view class="info-lable" style="margin-bottom: 20rpx">文本附件</view>
				<view class="info-value data-img">
					<view style="width: 30.33%;" v-for="(item, index) in fileList" :key="index"
						:style="{margin:index == 1 ? '0 5%' : ''}" @click="
				  viewIamge(
				    baseUrl + '/common/download/downloadmino?filename=' + item,
				    index
				  )
				">
						<u-image height="188rpx" :src="baseUrl + '/common/download/downloadmino?filename=' + item"
							mode=""></u-image>
					</view>
				</view>
			</view>
		</view>
		<view v-if=" code">
			<fixedButton title="删除" :buttonStyle="{background:'#EB5B47'}" @click="clickRemove" />
		</view>

	</view>
</template>

<script>
	import {
		getInfo,
		removeList
	} from '@/api/shianliaoning/publicity.js'
	import config from "@/config.js";
	export default {
		data() {
			return {
				baseUrl: config.baseUrl,
				from: {},
				code: false,
				fileList: [],
			}
		},
		onLoad(option) {
			if (option.code != 'undefined') {
				this.code = true
			} else {
				this.code = false
			}
			console.log(this.code, 'aaa', option)
		},
		methods: {
			//预览图片
			viewIamge(url, index) {
				uni.previewImage({
					current: index,
					urls: url.split(","),
				});
			},
			//remove
			clickRemove() {
				uni.showModal({
					title: '删除提示！',
					content: `您确定要删除该条记录吗?`,
					success: (res) => {
						if (res.confirm) {
								uni.showToast({
									title: '删除成功',
									success: () => {
										setTimeout(function() {
											uni.navigateBack()
										}, 1000)
									}
								})
						}
					}
				})
			},
			//info
			getinfo(id) {
					
			},
		}
	}
</script>

<style lang="scss" scoped>
	.info-container {
		box-sizing: border-box;
		padding: 22rpx;

		.info-box {
			min-height: 500rpx;
			background-color: #fff;
			border-radius: 16rpx;
			box-sizing: border-box;
			padding: 0 25rpx;

			.info-row {
				display: flex;
				align-items: center;
				box-sizing: border-box;
				padding: 25rpx 0;
				border-bottom: 1rpx solid #ECF1F7;

				.info-lable {
					width: 200rpx;
					font-size: 30rpx;
					font-weight: 400;
					color: #34373B;
				}

				.info-value {
					flex: 1;
					font-size: 30rpx;
					font-weight: 400;
					color: #9DA2AB;
				}
			}

			&>.info-row:last-child {
				border: 0;
			}
		}
	}

	.data-img {
		width: 100%;
		display: flex;
		align-items: center;
	}
</style>