<template>
	<view class="list" @click="bindClick">
		<view class="list-cell" v-if="cellType == ''" :class="done ? 'done' : 'info'">
			<view class="status" v-if="status" :class="statusClass" v-text="status"></view>
			<view class="title" v-text="title"></view>
			<view class="time" v-text="more"></view>
		</view>
		<!-- slot more -->
		<view class="list-cell list-cell-more"  v-if="cellType == 'more'" >
			<view class="title" v-text="title"></view>
			<slot name="more"></slot>
		</view>
		<slot></slot>
	</view>
</template>

<script>
	export default {
		name:"cell",
		props:{
			done:{
				type:Boolean,
				default: false
			},
			status:{
				type:String,
				default: ''
			},
			title:{
				type:String,
				default: ''
			},
			more:{
				type:[String, Number],
				default: ''
			},
			statusClass:{
				type:[String, Array],
				default:'status-span'
			},
			cellType:{
				type: String,
				default:''
			}
		},
		data() {
			return {
				
			};
		},
		methods:{
			bindClick(){
				this.$emit('click')
			}
		}
	}
</script>

<style lang="scss" scoped>
.list{
	color: $uni-text-color;
	line-height: 1.5;
	border-bottom: 2rpx solid #d8d8d8;
	font-size: $uni-font-size-base;
	.list-cell{
		position: relative;
		display: flex;
		align-items: center;
		justify-content: space-between;
		padding: 20rpx;
		
		.title {
			flex-grow: 1;
		}
		
		.time {
			font-size: 12px;
			color: #AAAAAA;
		}
		
	}
	
	
	.list-cell.list-cell-more{
		padding:  20rpx 30rpx;
	}
}


.done{
	color: $uni-text-color-grey !important;
}

.status {
	padding: 2rpx 8rpx;
	margin-right: 20rpx;
	color: #D7D7D7;
	background-color: #f2f2f2;
	border-radius: 10rpx;
	font-size: $uni-font-size-sm;
	&.status-check{
		color: #FFFFFF;
		background-color: $uni-color-success;
	}
}



</style>
