<template>
	<view class="step_box">
		<view class="same_row_in item_step" v-for="(item,index) in list" :key="index">
			<view class="same_row_in" style="padding-right: 10rpx;">
				<view class="step_box_num center_in" :class="current >= item.id ? 'activeColor' : 'inactiveColor'">
					{{item.id}}
				</view>
				<view class="box_title_step" :class="current >= item.id ? 'activeFontColor' : 'inactiveFontColor'">
					{{item.title}}
				</view>
			</view>
			<u-icon name="arrow-right" color="#dddddd" size="10" style="margin-left: 4rpx;"
				v-if="index < (list.length - 1)"></u-icon>
		</view>
	</view>
</template>

<script>
	export default {
		name: 'x-steps',
		props: {
			current: {
				type: Number,
				default () {
					return 1
				}
			},
			list: {
				type: Array,
				default () {
					return [{
						id: 1,
						title: '选择药品',
					}, {
						id: 2,
						title: '确定清单',
					}, {
						id: 3,
						title: '医生开方',
					}, {
						id: 4,
						title: '下单购买',
					}]
				}
			},
		},
		data() {
			return {
				// list: [{
				// 	id: 1,
				// 	title: '选择药品',
				// }, {
				// 	id: 2,
				// 	title: '确定清单',
				// }, {
				// 	id: 3,
				// 	title: '医生开方',
				// }, {
				// 	id: 4,
				// 	title: '下单购买',
				// }]
			}
		}
	}
</script>

<style lang="scss">
	.step_box {
		display: flex;
		align-items: center;
		justify-content: space-around;
		background-color: #fff;
		// margin: 20rpx;
		padding: 20rpx;
		border-radius: 10rpx;
	}

	.item_step {
		flex: 1;
		justify-content: space-around;
	}

	.step_box_num {
		width: 32rpx;
		height: 32rpx;
		border-radius: 50%;
		color: #fff;
		font-size: 20rpx;
		margin-right: 5rpx;
	}

	.box_title_step {
		font-size: 24rpx;
	}

	.activeColor {
		background-color: $x-color;
	}

	.inactiveColor {
		background-color: #dddddd;
	}

	.activeFontColor {
		font-weight: 600;
	}

	.inactiveFontColor {
		color: $u-info;
	}
</style>