ulist.vue 2.48 KB
<template>
	<view class="big-box">
		<view class="list-box">
			<view class="image">
				<image class="img" referrer="no-referrer|origin|unsafe-url" :src="porps.pic" mode="aspectFill"></image>
			</view>
			<view class="text">
				<view class="text-title esp">
					<text class="text-card color" v-if="porps.card == '报名中'">{{ porps.card }}</text>
					<text class="text-card color3" v-if="porps.card == '报名结束'">{{ porps.card }}</text>
					
				{{ porps.title }}</view>
				<view class="tagbox esp">
					<uni-tag type="warning" style="margin-right: 10rpx;" :inverted="true" size="mini" v-for="p in porps.tags.split(',')" :key="p" :text="p">
					</uni-tag>
				</view>
				<view class="text-timer esp">报名时间:{{ porps.timer }}</view>
			</view>
		</view>
		<view class="hr"></view>
	</view>
</template>

<script setup>
	const porps = defineProps({
		pic: {
			type: String
		},
		title: {
			type: String
		},
		card: {
			type: String
		},
		timer: {
			type: String
		},
		tags: {
			type: String
		}
	});
</script>

<style lang="scss">
	.big-box {
		width: 100%;
		padding: 25rpx 0;

		.hr {
			width: 100%;
			border-bottom: 1rpx solid #e5e5e5;
			padding-top: 25rpx;
		}

		.list-box {
			width: 100%;overflow: hidden;
			height: 180rpx;
			display: flex;

			.image {
				width: 270rpx;
				height: 180rpx;    flex: 0 0 auto;

				.img {
					width: 270rpx;
					height: 180rpx;
					border-radius: 15rpx;
				}
			}

			.text {
				margin-left: 20rpx;    flex: 1 1 auto;
				width: calc(100vw - 300rpx);
				.text-title {
					text-align: left;
					font-size: 30rpx;
					font-family: PingFang SC;
					font-weight: 400;
					color: #000000;
				}

				.text-card {margin: 10rpx 0;
					font-size: 20rpx;padding: 0 10rpx;
					height: 32rpx;
					text-align: center;
					font-family: PingFang SC;
					font-weight: 400;
					color: #ffffff;
					border-radius: 16px 16px 16px 0px;
				}

				.color {
					background: linear-gradient(270deg, #54e1b9, #00caa6);
				}

				.color1 {
					background: linear-gradient(270deg, #be8efb, #a76df4);
				}

				.color2 {
					background: linear-gradient(270deg, #fea449, #ffb95f);
				}

				.color3 {
					background: linear-gradient(270deg, #d9d9d9, #bcbcbc);
				}

				.color4 {
					background: linear-gradient(270deg, #40d8ee, #53a7f6);
				}

				.text-timer {
					margin-top: 20rpx;
					font-size: 24rpx;
					font-family: PingFang SC;
					font-weight: 400;
					color: #7b7f83;
				}
			}
		}
	}
	.tagbox{ text-align: left;padding: 10rpx;
	}
</style>