<template>
	<view>
		<view class="flow" style="display: flex;" v-for="(item, index) in logListData" :key="index">
			<view class="steps">
				<view class="steps_list">
					<view :class="index==0?'tails':'active-tails'"></view>
					<view class="node">
						<view class="active-node">

						</view>
					</view>
					<view v-if="(index+1)<logListData.length" class="tail"
						:class="{'active-tail':parseInt(item.id)-1 == item.index}" :hidden="item.index == 0">
					</view>
				</view>

			</view>
			<view class="wrapper">
				<view class="title">
					<text>{{item.name}}</text>
				</view>
				<view class="time">
					<span>{{item.timeMessage}}</span>
				</view>
			</view>
		</view>

	</view>

</template>

<script>
	/*
	item：没条记录详情
	activity: 当前进度条状态
	wrapperStatus：流程状态对应字段
	wrapperTitle：详情对应字段
	index：进度条排列序号 index == 0代表最后一个没有竖立进度条
	date：时间
	 */
	import {
		logList
	} from "@/api/maintain.js"
	export default {
		data() {
			return {
				detail: [{
						activity: 0,
						logType: 1,
						createTime: "2021.07.01 20:00",
					},
					{
						activity: 1,
						logType: 2,
						createTime: "2021.07.01 20:00",
					},
					{
						activity: 2,
						logType: 3,
						createTime: "2021.07.01 20:00",
					},
					{
						activity: 3,
						logType: 4,
						createTime: "2021.07.01 20:00",
					},
					{
						activity: 4,
						logType: 5,
						createTime: "2021.07.01 20:00",
					},
					{
						activity: 5,
						logType: 6,
						createTime: "2021.07.01 20:00",
					}
				],
				orderData: {},
				logListData: [],
			}
		},
		onLoad(options) {
			this.orderData = JSON.parse(decodeURIComponent(options.data));
			logList({
				orderId: this.orderData.id
			}).then((res) => {
				this.logListData = res.data
			})
		},
		methods: {

		}
	}
</script>

<style lang="scss">
	.flow {
		background: #F5F5F5;
	}

	page {
		height: 100%;
		background: #F5F5F5;
	}

	.wrapper {
		width: 605rpx;
		height: 138rpx;
		background: #FFFFFF;
		border-radius: 10rpx;
		margin: 46rpx 46rpx 46rpx 37rpx;
		padding: 33rpx;

		.title {
			font-weight: bold;
			font-size: 26rpx;
		}

		.time {
			padding-top: 20rpx;
			font-size: 26rpx;
			color: #333;
		}
	}

	.steps {
		display: flex;

		.steps_list {
			display: flex;
			flex-direction: column;
			align-items: center;
			// padding: 0 0 0 5px;
			// padding: 0 0 40rpx;
			margin-left: 54rpx;
			// height: 160rpx;
		}

		.active-tails {
			height: 118rpx;
			width: 2rpx;
			background: #E8E7E7;
		}

		.tails {
			height: 118rpx;
			width: 2rpx;
		}

		.tail {
			height: calc(100% - 15rpx);
			width: 2rpx;
			background: #E8E7E7;
		}

		.active-tail {
			width: 2rpx;
			background-color: #F87362 !important;
		}



		.node {
			width: 28rpx;
			height: 28rpx;
			background: rgba(0, 94, 255, 0.15);
			border-radius: 50%;
			display: flex;
			align-items: center;
			justify-content: center;

			.active-node {
				width: 14rpx;
				height: 14rpx;
				background: #005EFF;
				border-radius: 50%;

			}
		}
	}
</style>
