<template>
	<view style="display: flex;justify-content: space-between;align-items: center;">
		<view style="display: flex;align-items: center;margin: 20rpx 0;">
			<view class="tag tagColor1" v-if="menuItem.sectionType==1">录播</view>
			<view class="tag tagColor2" v-if="menuItem.sectionType==2">直播</view>
			<view class="tag tagColor3" v-if="menuItem.sectionType==3">回放</view>
			<view class="t_content">
				<view>{{menuItem.name}}</view>
				<view style="font-size: 20rpx;color: #FF3B30;" v-if="menuItem.liveStartTime">
					<view v-if="menuItem.liveStartTime>nowTime">
						<text>{{$method.timestampToTime(menuItem.liveStartTime)}}</text>-
						<text>{{$method.timestampToTime(menuItem.liveEndTime)}}</text>
					</view>
					<view v-if="menuItem.liveStartTime<=nowTime&&menuItem.liveEndTime>nowTime">
						<text>直播中</text>
					</view>
					<view v-if="menuItem.liveEndTime<nowTime">
						<text>回放</text>
					</view>
				</view>
			</view>
		</view>
		<view v-if="menuItem.tryListen" class="tryBox">
			试看
		</view>
	</view>
</template>

<script>

export default {
	name: 'courseSection',
	props: {
		menuItem: {
			type: Object,
			default: {}
		}
	},
	data() {
		return {
			nowTime:0
		};
	},
	onLoad() {},
	created() {
		
	},
	mounted() {
		this.nowTime = Number(new  Date().getTime()/1000).toFixed(0)
	},
	methods: {
		
	}
	
};
</script>

<style scoped>
	.tryBox{
		width: 96rpx;
		height: 48rpx;
		background: #007AFF;
		border-radius: 24rpx;
		color: #FFFFFF;
		font-size: 30rpx;
		line-height: 48rpx;
		text-align: center;
	}
	.icon_up{
		width: 24rpx;
		height: 24rpx;
	}
	.t_content3{
		color: #007AFF;
	}
	.t_content2{
		color: #007AFF;
	}
	.t_content1{
		color: #007AFF;
	}
	.t_content{
		margin-left: 10rpx;
		color: #666666;
		white-space:nowrap;
		overflow:hidden;
		text-overflow:ellipsis; 
	}
	.tagColor3{
		border: 2rpx solid #FF9500;
		color: #FF9500;
	}
	.tagColor2{
		border: 2rpx solid #FF3B30;
		color: #FF3B30;
	}
	.tagColor1{
		border: 2rpx solid #007AFF;
		color: #007AFF;
	}
	.tag{
		border-radius: 8rpx;
		font-size: 20rpx;
		padding: 5rpx;
	}
</style>
