<template>
	<view>
		<view class="info cardStyle_"
		v-for="(item, index) in cardListData" 
		:key="index" @click="toDetail(item)">
		    <view class="left">
		        <image :src="item.image && item.image.split(',')[0]" mode="aspectFill"></image>
		    </view>
		    <view class="right">
		        <view class="detailed">
		            <view class="title">{{$ot(item, 'travel', 'title')}}</view>
		            <view class="date">{{ $dayjs(item.startTime).format('YYYY-MM-DD') }}</view>
		            <view class="address">{{$ot(item, 'travel', 'address')}}</view>
		        </view>
		        <view class="data">
		            <text>¥{{item.price}}</text>
		            <text>{{item.num || 0}}/{{item.sum || 0}}</text>
		            <text class="btn" v-if="item.state == 0">{{$t('components.travel.travelList.enrolling')}}</text>
					<text class="btn-2" v-if="item.state == 1">{{$t('components.travel.travelList.ended')}}</text>
		        </view>
		    </view>
		</view>
	</view>
</template>

<script>
	export default {
		name:"travelList",
		props : ['cardListData'],
		data() {
			return {
				
			};
		},
		methods : {
			toDetail({ id }) {
				uni.navigateTo({
					url:`/pages_order/lvyou-detail?travelId=${id}`
				})
			},
		}
	}
</script>

<style scoped lang="scss">
.info {
	position: relative;
	margin: 20rpx 0;
	padding: 35rpx 0 35rpx 24rpx;
	border-radius: 26rpx;
	.right {
		.data {
			display: flex;
			justify-content: space-between;
			align-items: center;
			.btn {
				background: #381615;
				color: $uni-color-primary;
				padding: 10rpx 40rpx;
				border-radius: 30rpx 0px 0px 30rpx;
			}
			.btn-2 {
				background: #333;
				color: #999;
				padding: 10rpx 40rpx;
				border-radius: 30rpx 0px 0px 30rpx;
			}
		}
	}
}
</style>