Files
jiapuapp/components/GenealogyCard.vue
T
2026-07-20 06:52:33 +08:00

282 lines
5.5 KiB
Vue
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
<!-- 公共组件G01 已创建已加入家谱的题签列表项保持透明题签框叠在纸纹底图上 -->
<template>
<view
class="genealogy-card"
:class="{ 'genealogy-card--current': selected }"
@click="$emit('select', genealogy)"
>
<image
class="row-frame"
src="/static/assets/modules/genealogy/transparent/list-slip-frame.png"
mode="scaleToFill"
/>
<view class="surname-seal">
<image
class="surname-seal-frame"
src="/static/assets/modules/genealogy/transparent/row-seal-frame.png"
mode="scaleToFill"
/>
<view class="surname-seal-copy">
<text class="seal-title">家谱</text>
</view>
</view>
<view class="card-main">
<view class="card-title-row">
<text class="card-name">{{ genealogy.name }}</text>
<view class="card-side">
<text class="card-role">{{ role }}</text>
<image
class="card-chevron"
src="/static/assets/foundation/transparent/chevron-right.png"
mode="aspectFit"
/>
</view>
</view>
<view class="card-detail-row">
<view class="card-updated">
<text>更新于 {{ genealogy.updatedAt }}</text>
</view>
<view class="card-metas">
<view class="card-meta-item">
<image
class="card-meta-icon"
src="/static/assets/foundation/transparent/meta-location.png"
mode="aspectFit"
/>
<text class="card-meta">{{ genealogy.location }}</text>
</view>
<view class="card-meta-item">
<image
class="card-meta-icon"
src="/static/assets/foundation/transparent/meta-member.png"
mode="aspectFit"
/>
<text class="card-meta">{{ genealogy.memberCount }} 位成员</text>
</view>
</view>
</view>
</view>
</view>
</template>
<script setup>
defineProps({
genealogy: { type: Object, required: true },
role: { type: String, required: true },
selected: { type: Boolean, default: false },
});
defineEmits(["select"]);
</script>
<style scoped lang="scss">
.genealogy-card {
position: relative;
display: flex;
min-height: 178rpx;
align-items: center;
padding: 18rpx 24rpx;
box-sizing: border-box;
background: transparent;
}
.genealogy-card--current {
background: transparent;
}
.row-frame {
position: absolute;
top: 0;
right: 0;
bottom: 0;
left: 0;
z-index: 0;
width: 100%;
height: 100%;
pointer-events: none;
}
.surname-seal {
position: relative;
z-index: 1;
display: flex;
width: 72rpx;
height: 112rpx;
flex: 0 0 auto;
align-items: center;
justify-content: center;
margin-right: 22rpx;
color: #fff5df;
}
.surname-seal-frame {
position: absolute;
top: 0;
right: 0;
bottom: 0;
left: 0;
z-index: 0;
width: 100%;
height: 100%;
}
.surname-seal-copy {
position: relative;
z-index: 1;
display: flex;
height: 82rpx;
align-items: center;
justify-content: center;
}
.seal-title {
color: #fff5df;
font-family: "STKaiti", "KaiTi", serif;
font-size: 30rpx;
font-weight: 700;
letter-spacing: 2rpx;
line-height: 1;
writing-mode: vertical-rl;
}
.genealogy-card:not(.genealogy-card--current) .surname-seal-frame {
opacity: 0.32;
}
.genealogy-card:not(.genealogy-card--current) .seal-title {
color: $ink-muted;
}
.card-main {
position: relative;
z-index: 1;
display: flex;
min-width: 0;
flex: 1;
flex-direction: column;
}
.card-name {
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
}
.card-meta {
white-space: nowrap;
}
.card-title-row {
display: flex;
min-width: 0;
align-items: center;
justify-content: space-between;
}
.card-name {
color: $ink;
font-family: "STKaiti", "KaiTi", serif;
font-size: 37rpx;
font-weight: 700;
}
.card-detail-row {
display: flex;
min-width: 0;
flex-wrap: wrap;
align-items: center;
justify-content: space-between;
margin-top: 8rpx;
}
.card-metas {
display: flex;
min-width: 0;
width: 100%;
align-items: center;
margin-top: 2rpx;
}
.card-meta-item {
display: flex;
min-width: 0;
align-items: center;
margin-right: 0;
}
.card-meta-item + .card-meta-item {
margin-left: 18rpx;
}
.card-meta-icon {
width: 46rpx;
height: 46rpx;
flex: 0 0 auto;
margin-right: 6rpx;
opacity: 1;
filter: saturate(1.35) brightness(0.82) contrast(1.15);
}
.card-meta {
color: #62584c;
font-size: 26rpx;
font-weight: 500;
}
.card-updated {
display: flex;
width: 100%;
flex: 0 0 auto;
align-items: center;
justify-content: flex-end;
margin-top: 0;
margin-left: 0;
color: #62584c;
font-size: 24rpx;
font-weight: 500;
white-space: nowrap;
}
.card-side {
position: relative;
z-index: 1;
display: flex;
min-width: 0;
flex: 0 0 auto;
flex-direction: row;
align-items: center;
justify-content: flex-end;
margin-left: 20rpx;
}
.card-role {
color: #62584c;
font-size: 26rpx;
font-weight: 500;
white-space: nowrap;
}
.card-chevron {
width: 34rpx;
height: 34rpx;
margin-left: 14rpx;
}
@media screen and (max-width: 340px) {
.genealogy-card {
min-height: 148rpx;
padding-right: 18rpx;
padding-left: 18rpx;
}
.surname-seal {
width: 66rpx;
height: 100rpx;
margin-right: 16rpx;
}
.card-name {
font-size: 32rpx;
}
.card-meta {
font-size: 22rpx;
}
.card-updated {
display: none;
}
.card-side {
margin-left: 12rpx;
}
.card-chevron {
width: 28rpx;
height: 28rpx;
margin-left: 8rpx;
}
}
</style>