<template>
	<view>
		<view class="head">
			<view class="lf-row-between lf-color-gray list">
				<view>采购单 492461046128742764</view>
			</view>
			<view class="list">
				<lf-ysteps :stepList="stepList" color="#11D189"></lf-ysteps>
			</view>
		</view>
		<self-line></self-line>
		<view class="head">
			<view class="lf-row-between list">
				<view>申请人</view>
				<view class="lf-font-bold">李清玉</view>
			</view>
			<view class="lf-row-between list">
				<view>联系电话</view>
				<view class="lf-font-bold">13200000000</view>
			</view>
		</view>
		<self-line></self-line>
		<view class="lf-m-t-30 lf-m-l-32">
			<view class="lf-font-32 lf-color-black lf-font-bold lf-m-b-20">物资明细</view>
			<wyb-table :first-line-fixed="true" contentBgColor="#ecfaf5" :headers="headers" :contents="contents" @onButtonClick="onButtonClick" width="100%" height="350rpx"></wyb-table>
		</view>
		<view style="height: 100rpx;"></view>
		<!-- 操作按钮 -->
		<view class="fixed-bottom">
			<button class="btn btn2">立即申请</button>
		</view>
	</view>
</template>

<script>
	import lfYsteps from '@/components/lf-ysteps/lf-ysteps';
	import wybTable from '@/components/wyb-table/wyb-table';
	
	export default {
		components: { lfYsteps, wybTable },
		data(){
			return {
				stepList: [
				    {
				        time: '2021-07-23 13:23:52', // 左侧时间 -- 必选
				        info: '订单创建', // 右侧内容 -- 可选
				        isFinished: false, // 是否已完成（完成 index 为 √）-- 可选
				        isActive: true, // 是否为当前节点 Active（当前节点 即使完成 index 也不会显示 √）-- 可选
				        isShowSlot: false // 右侧是否有 Slot（显示在 右侧内容下方）-- 可选
				    }
				],
				headers: [{
						key: 'name',
						label: '姓名'
					},{
						key: 'age',
						label: '年龄'
					},{
						key: 'sex',
						label: '性别'
					},{
						key: 'height',
						label: '身高'
					},{
						key: 'info',
						label: '描述'
					},{
						key: 'operation',
						label: '操作'
					}],
				contents: [{
						name: '张三',
						age: '18',
						sex: '男',
						height: '192cm',
						info: '无敌叫是',
						operation: {button: true, key: 'delete', value: '删除'}
					}, {
						name: '李四',
						age: '18',
						sex: '男',
						height: '192cm',
						info: '无敌叫是'
					}, {
						name: '赵五',
						age: '18',
						sex: '男',
						height: '192cm',
						info: '无敌叫是'
					},{
						name: '王六',
						age: '18',
						sex: '男',
						height: '192cm',
						info: '无敌叫是'
					}]
			}
		},
		onLoad(){
			
		},
		methods: {
			onButtonClick(event){
				uni.showModal({
					title: '温馨提示',
					content: '您确定移除该项吗?',
					success: result => {
						if(result.confirm){
							console.log("移除某一项", event);
							let { contentIndex } = event;
							this.contents.splice(contentIndex, 1);
						}
					}
				})
			}
		}
	}
</script>

<style lang="scss" scoped="scoped">
	.head{
		padding: 0 32rpx;
		width: 750rpx;
		box-sizing: border-box;
		height: auto;
		.list{
			padding: 30rpx 0;
			border-bottom: 1rpx solid #e5e5e5;
			font-size: 28rpx;
			color: #555555;
			&:last-child{
				border-bottom: none;
			}
			.image{
				width: 140rpx;
				height: 140rpx;
				border-radius: 10rpx;
			}
			.info{
				display: flex;
				flex-direction: column;
				justify-content: space-around;
				width: 530rpx;
				height: 140rpx;
			}
		}
	}
	.fixed-bottom{
		position: fixed;
		bottom: 0rpx;
		left: 0rpx;
		z-index: 99;
		width: 750rpx;
		height: 98rpx;
		display: flex;
		justify-content: flex-end;
		align-items: center;
		border-top: 1rpx solid #E5E5E5;
		background-color: #FFFFFF;
		box-sizing: border-box;
		padding: 0 32rpx;
		.btn{
			width: 212rpx;
			height: 82rpx;
			border-radius: 41rpx;
			margin: 0;
			padding: 0;
			font-size: 32rpx;
			display: flex;
			justify-content: center;
			align-items: center;
		}
		.btn1{
			border: 2rpx solid #555555;
			opacity: .5;
		}
		.btn2{
			background: #11D189;
			color: #FFFFFF;
			margin-left: 20rpx;
		}
	}
	.ms-img{
		width: 160rpx;
		height: 160rpx;
		margin-right: 15rpx;
		margin-top: 15rpx;
		&:nth-of-type(4n){
			margin-right: 0rpx;
		}
	}
</style>
