<template>
|
<view class="card-container">
|
<image class="card-bg" :src="image" mode="aspectFill" />
|
|
<view class="card-content">
|
<text class="card-title">{{ title }}</text>
|
<text class="card-subtitle">{{ subtitle }}</text>
|
|
<view class="card-footer">
|
<up-icon name="clock" size="20" color="#fff" />
|
<text class="card-footer-text">{{ readTime }}</text>
|
</view>
|
</view>
|
</view>
|
</template>
|
|
<script setup lang="ts">
|
|
interface Props {
|
image: string;
|
title: string;
|
subtitle?: string;
|
readTime?: string;
|
}
|
|
const props = defineProps<Props>();
|
</script>
|
|
<style scoped lang="scss">
|
.card-container {
|
position: relative;
|
width: 100%;
|
height: 400rpx;
|
border-radius: 20rpx;
|
overflow: hidden;
|
margin-bottom: 20rpx;
|
}
|
|
.card-bg {
|
width: 100%;
|
height: 100%;
|
border-radius: 20rpx;
|
}
|
|
.card-content {
|
position: absolute;
|
bottom: 20rpx;
|
left: 20rpx;
|
right: 20rpx;
|
color: #fff;
|
}
|
|
.card-title {
|
font-size: 30rpx;
|
font-weight: bold;
|
margin-bottom: 10rpx;
|
display: block;
|
}
|
|
.card-subtitle {
|
font-size: 24rpx;
|
opacity: 0.85;
|
display: block;
|
margin-bottom: 20rpx;
|
}
|
|
.card-footer {
|
display: flex;
|
align-items: center;
|
}
|
|
.card-footer-text {
|
font-size: 22rpx;
|
margin-left: 8rpx;
|
opacity: 0.9;
|
}
|
</style>
|
|