<template>
	<view class="task-page">
		<div class="title">{{item.title}}</div>
		<div class="info">
			<div class="item">
				<view class="name">执行人</view>
				<view class="cont">执行人</view>	
			</div>
			<div class="item">
				<view class="name">执行部门</view>
				<view class="cont">执行部门</view>	
			</div>
			<div class="item">
				<view class="name">上报时间</view>
				<view class="cont">{{parseTime(new Date())}}</view>	
			</div>
		</div>
		<div class="status">
			<div class="head">整改过程</div>
			<template v-if="flow.status===-1">
				<image class="icon-empty" src="/static/icon/empty.png" mode="widthFix"></image>
				<p>暂无处置信息</p>	
				<view class="footer" @click="onSubmit">整改</view>
			</template>
		</div>
	</view>
</template>

<script>
	import {parseTime} from '@/libs/index.js'
	export default {
		data() {
			return {
				item:{
					title:"水位预{2号-770-32002}:采空区封堵完好，无渗水情况。"
				},
				flow:{
					status:"",
					time:"",
					desc:"",
					attachList:[]
				}
			}
		},
		onLoad() {
			this.init()
		},
		methods: {
			parseTime,
			init(){
				this.flow={
					status:-1,
					time:new Date(),
					desc:"处置过程描述处置过程描述处置过程描述处置过程描述处置过程描述处置过程描述处置过程描述",
					attachList:[
						{url:"/static/preview/1.png"},
						{url:"/static/preview/2.png"},
						{url:"/static/preview/3.png"},
						{url:"/static/preview/2.png"}
					]
				}
			},
			getTask(){
				this.item=uni.getStorageSync('task-item')
			},
			onSubmit(){
				uni.navigateTo({
					url:'/pages/risk/rectify/form/form'
				})
			}
		},
		destroyed() {
			uni.removeStorageSync('task-item')
		}
	}
</script>

<style lang="scss" scoped>
	.task-page{
		background-color: #F3F5FB;
		.title{
			font-family: 'Source Han Sans CN';
			font-style: normal;
			font-weight: 700;
			font-size: 36rpx;
			line-height: 54rpx;
			color: #212121;
			padding:0 32rpx;
		}
		.info{
			padding: 0 32rpx;
			margin: 40rpx 0;
			background: #FFFFFF;
			border-radius: 32rpx 32rpx 0px 0px;	
			.item{
				border-bottom: 1rpx solid #EFF1F3;	
				padding: 40rpx 32rpx;
				.name{
					font-size: 28rpx;
					color: #999999;
					line-height: 1;
				}
				.cont{
					font-size: 30rpx;
					color: #212121;
					line-height: 1.5;
					padding-top: 12rpx;
				}
				&:last-child{
					border-bottom:none;
				}
			}
		}
		.status{
			background: #FFFFFF;
			border-radius: 32rpx 32rpx 0px 0px;
			padding: 48rpx 32rpx;
			.head{
				color: #212121;
				font-size: 34rpx;
				line-height:1;
				font-weight: 700;				
			}
			.icon-empty{
				display: block;
				width: 160rpx;
				margin: 64rpx auto 0;
			}
			p{
				font-size: 24rpx;
				line-height: 28rpx;
				color: #D5D5D5;
				text-align: center;
			}
			.flow-head{
				display: flex;
				justify-content: space-between;
				align-items: center;
				font-family: 'Abhaya Libre';
				font-style: normal;
				font-weight: 400;
				font-size: 24rpx;
				line-height: 48rpx;
				padding: 30rpx 0  24rpx 0;
				.flow-status{
					color: #27DFA8;
					&.error{
						color: #F54545;
					}					
				}
				.flow-time{
					color: #999999;
				}
			}
			.desc{
				font-family: 'SF Pro Text';
				font-style: normal;
				font-weight: 500;
				font-size: 30rpx;
				line-height: 42rpx;
				color: #434343;
				padding-bottom: 24rpx;
			}
			.attach{
				display: flex;
				flex-wrap: wrap;
				.attach-item{
					width: 224rpx;
					overflow: hidden;
					margin-right: 7rpx;
					margin-bottom: 20rpx;
					&:nth-child(3n){
						margin-right: 0;
					}
					.image{
						display: block;
						width: 224rpx;
						border-radius: 8px;
					}
				}				
			}
		}
		.footer{
			width: 100%;
			height: 136upx;
			background: #FFFFFF;
			border-radius: 16upx 16upx 0px 0px;
			position: fixed;
			left: 0;
			bottom: 0;
			text-align: center;
			color: #168DEC;
			font-size: 32upx;
			padding-top: 20upx;
			letter-spacing: 2px;
		}
	}

</style>
