<template>
	<view class="content">
		<view class="end-title">
			 <view v-for="(item,index) in items" :key="index" :class="{btna:count == index}" @tap="change(index)">
				{{item}}<view class="line"></view>
			</view>
		</view>
		<view class="end-cont" :class="{dis:btnnum == 0}">
		　　<view class="orderCol">
				<view class="title"><text>编号：202000001001</text><text class="font_red">待付款</text></view>
				<view class="infoList">
					<view class="infoCol"><text>下单时间：</text><text>2021-01-01 20:00:20</text></view>
					<view class="infoCol"><text>商品类型：</text><text>2021-01-01 20:00:20</text></view>
					<view class="infoCol"><text>订单金额：</text><text>2021-01-01 20:00:20</text></view>
					<view class="infoCol"><text>购买人：</text><text>2021-01-01 20:00:20</text></view>
				</view>
			</view>
		　　<view class="orderCol">
				<view class="title"><text>编号：202000001001</text><text class="font_red">待付款</text></view>
				<view class="infoList">
					<view class="infoCol"><text>下单时间：</text><text>2021-01-01 20:00:20</text></view>
					<view class="infoCol"><text>商品类型：</text><text>2021-01-01 20:00:20</text></view>
					<view class="infoCol"><text>订单金额：</text><text>2021-01-01 20:00:20</text></view>
					<view class="infoCol"><text>购买人：</text><text>2021-01-01 20:00:20</text></view>
				</view>
			</view>
						
		</view>
		<view class="end-cont" :class="{dis:btnnum == 1}">
		　　<view class="orderCol">
				<view class="title"><text>编号：202000001001</text></view>
				<view class="infoList">
					<view class="infoCol"><text>下单时间：</text><text>2021-01-01 20:00:20</text></view>
					<view class="infoCol"><text>商品类型：</text><text>2021-01-01 20:00:20</text></view>
					<view class="infoCol"><text>订单金额：</text><text>2021-01-01 20:00:20</text></view>
					<view class="infoCol"><text>购买人：</text><text>2021-01-01 20:00:20</text></view>
				</view>
			</view>
		　　<view class="orderCol">
				<view class="title"><text>编号：202000001001</text></view>
				<view class="infoList">
					<view class="infoCol"><text>下单时间：</text><text>2021-01-01 20:00:20</text></view>
					<view class="infoCol"><text>商品类型：</text><text>2021-01-01 20:00:20</text></view>
					<view class="infoCol"><text>订单金额：</text><text>2021-01-01 20:00:20</text></view>
					<view class="infoCol"><text>购买人：</text><text>2021-01-01 20:00:20</text></view>
				</view>
			</view>
		</view>	
	</view>
</template>

<script>
	export default {
		data() {
			return {
			  btnnum: 0,
			  items:["未完成","已完成"],
			  count:""		
			}
		},
		onLoad() {

		},
		methods:{
		  change(e) {
			 this.count = e
			 this.btnnum = e
			 console.log(this.count)
		  }
		}
	}
</script>

<style lang="scss" scoped>
	.content {
		display: flex;
		flex-direction: column;
		align-items: center;
		justify-content: center;
	}
    .end-title{
        display: flex;
		width:100%;
		height: 88rpx;
		background: #FFFFFF;
		box-shadow: 0px 2px 12px 0px #DEE4E7;
		line-height: 88rpx;
		font-size: 32rpx;
		font-weight: 400;
		color:#333;
    }
    .end-title view{
        flex-grow: 1;
        text-align: center;
		position: relative;
		.line{position: absolute;width: 128rpx;height: 8rpx;background: #FF578A;border-radius: 4rpx;bottom:0;left:50%;margin-left:-64rpx;display: none;}
    }	
    .end-cont{
        display: none;
    }
    .btna{
        color: #FF578A;
    }
	.btna .line{display:block!important;}
    .dis{
        display: block;
    }
	.orderCol{
		background: #fff;
		border-radius: 16rpx;
		width:710rpx;
		margin:20rpx auto 0 auto;
		padding: 0 30rpx;
		box-sizing: border-box;
		.title{
			padding:30rpx 0;
			display: flex;
			justify-content: space-between;
			font-size:28rpx;
			color:#333;
			border-bottom:1rpx solid #DEDEDE;
		}
		.infoList{
			padding:24rpx 0 33rpx 0;
		}
		.infoCol{
			color:#666;
			font-size: 28rpx;
			line-height:1.8;
		}
		.infoCol text:first-child{
			display: inline-block;
			min-width:5em;
			text-align: left;
		}
	}
</style>
