mirror of
https://github.com/BTMuli/TeyvatGuide.git
synced 2025-12-13 09:28:14 +08:00
💄 调整帖子组件 UI
This commit is contained in:
@@ -1,5 +1,4 @@
|
|||||||
<template>
|
<template>
|
||||||
<!-- todo 样式优化 47041934-->
|
|
||||||
<div
|
<div
|
||||||
class="tp-villa-card-box"
|
class="tp-villa-card-box"
|
||||||
:style="{
|
:style="{
|
||||||
@@ -12,25 +11,25 @@
|
|||||||
<span class="tp-villa-card-name">{{ props.data.insert.villa_card.villa_name }}</span>
|
<span class="tp-villa-card-name">{{ props.data.insert.villa_card.villa_name }}</span>
|
||||||
<span class="tp-villa-card-owner">
|
<span class="tp-villa-card-owner">
|
||||||
<img alt="topIcon" :src="props.data.insert.villa_card.owner_avatar_url" />
|
<img alt="topIcon" :src="props.data.insert.villa_card.owner_avatar_url" />
|
||||||
<span>{{ props.data.insert.villa_card.owner_nickname }} 创建</span>
|
<span>{{ props.data.insert.villa_card.owner_nickname }}</span>
|
||||||
</span>
|
</span>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="tp-villa-card-tags">
|
<div class="tp-villa-card-tags">
|
||||||
<div class="tp-villa-card-tag">
|
<div class="tp-villa-card-tag">
|
||||||
{{ props.data.insert.villa_card.villa_member_num }} 人在聊
|
<v-icon>mdi-account-group</v-icon>
|
||||||
|
<span>{{ props.data.insert.villa_card.villa_member_num }}</span>
|
||||||
</div>
|
</div>
|
||||||
<div
|
<div
|
||||||
v-for="(tag, index) in props.data.insert.villa_card?.tag_list"
|
v-for="(tag, index) in props.data.insert.villa_card?.tag_list"
|
||||||
:key="index"
|
:key="index"
|
||||||
class="tp-villa-card-tag"
|
class="tp-villa-card-tag"
|
||||||
>
|
>
|
||||||
{{ tag }}
|
<v-icon>mdi-tag</v-icon>
|
||||||
|
<span>{{ tag }}</span>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="tp-villa-card-desc">
|
<div class="tp-villa-card-desc">{{ props.data.insert.villa_card.villa_introduce }}</div>
|
||||||
{{ props.data.insert.villa_card.villa_introduce }}
|
|
||||||
</div>
|
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
<script lang="ts" setup>
|
<script lang="ts" setup>
|
||||||
@@ -102,6 +101,7 @@ console.log(
|
|||||||
.tp-villa-card-content img {
|
.tp-villa-card-content img {
|
||||||
width: 80px;
|
width: 80px;
|
||||||
height: 80px;
|
height: 80px;
|
||||||
|
border: 1px solid var(--common-shadow-2);
|
||||||
border-radius: 5px;
|
border-radius: 5px;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -117,10 +117,7 @@ console.log(
|
|||||||
.tp-villa-card-name {
|
.tp-villa-card-name {
|
||||||
padding: 0 5px;
|
padding: 0 5px;
|
||||||
border-radius: 5px;
|
border-radius: 5px;
|
||||||
-webkit-backdrop-filter: blur(20px);
|
background: var(--box-bg-1);
|
||||||
backdrop-filter: blur(20px);
|
|
||||||
background: var(--common-shadow-t-2);
|
|
||||||
box-shadow: 0 0 5px var(--common-shadow-8);
|
|
||||||
color: var(--common-text-title);
|
color: var(--common-text-title);
|
||||||
font-family: var(--font-title);
|
font-family: var(--font-title);
|
||||||
font-size: 20px;
|
font-size: 20px;
|
||||||
@@ -131,10 +128,7 @@ console.log(
|
|||||||
align-items: center;
|
align-items: center;
|
||||||
padding: 5px;
|
padding: 5px;
|
||||||
border-radius: 20px 5px 5px 20px;
|
border-radius: 20px 5px 5px 20px;
|
||||||
-webkit-backdrop-filter: blur(20px);
|
background: var(--box-bg-1);
|
||||||
backdrop-filter: blur(20px);
|
|
||||||
background: var(--common-shadow-t-2);
|
|
||||||
box-shadow: 0 0 5px var(--common-shadow-8);
|
|
||||||
color: var(--common-text-title);
|
color: var(--common-text-title);
|
||||||
column-gap: 5px;
|
column-gap: 5px;
|
||||||
}
|
}
|
||||||
@@ -162,13 +156,11 @@ console.log(
|
|||||||
display: flex;
|
display: flex;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
justify-content: center;
|
justify-content: center;
|
||||||
padding: 5px 10px;
|
padding: 0 5px;
|
||||||
border-radius: 5px;
|
border-radius: 5px;
|
||||||
-webkit-backdrop-filter: blur(20px);
|
background: var(--box-bg-2);
|
||||||
backdrop-filter: blur(20px);
|
|
||||||
background: var(--common-shadow-t-2);
|
|
||||||
box-shadow: 0 0 5px var(--common-shadow-8);
|
|
||||||
color: var(--tgc-pink-1);
|
color: var(--tgc-pink-1);
|
||||||
|
column-gap: 2px;
|
||||||
font-family: var(--font-title);
|
font-family: var(--font-title);
|
||||||
font-size: 12px;
|
font-size: 12px;
|
||||||
}
|
}
|
||||||
@@ -177,13 +169,10 @@ console.log(
|
|||||||
display: flex;
|
display: flex;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
justify-content: center;
|
justify-content: center;
|
||||||
padding: 0 10px;
|
padding: 0 5px;
|
||||||
border-radius: 5px;
|
border-radius: 5px;
|
||||||
margin-right: auto;
|
margin-right: auto;
|
||||||
-webkit-backdrop-filter: blur(20px);
|
background: var(--box-bg-2);
|
||||||
backdrop-filter: blur(20px);
|
|
||||||
background: var(--common-shadow-t-2);
|
|
||||||
box-shadow: 0 0 5px var(--common-shadow-8);
|
|
||||||
color: var(--box-text-1);
|
color: var(--box-text-1);
|
||||||
}
|
}
|
||||||
</style>
|
</style>
|
||||||
|
|||||||
@@ -6,12 +6,17 @@
|
|||||||
<span>合集ID:{{ props.collection.collection_id }}</span>
|
<span>合集ID:{{ props.collection.collection_id }}</span>
|
||||||
</div>
|
</div>
|
||||||
<div class="tpoc-list">
|
<div class="tpoc-list">
|
||||||
<!-- todo 加上封面 -->
|
|
||||||
<div
|
<div
|
||||||
class="tpoc-item"
|
class="tpoc-item"
|
||||||
v-for="(item, index) in posts"
|
v-for="(item, index) in posts"
|
||||||
:key="index"
|
:key="index"
|
||||||
@click="toPost(item.postId)"
|
@click="toPost(item.postId, index)"
|
||||||
|
:style="{
|
||||||
|
backgroundColor:
|
||||||
|
index === props.collection.cur - 1 ? 'var(--box-bg-2)' : 'var(--box-bg-1)',
|
||||||
|
color: index === props.collection.cur - 1 ? 'var(--box-text-2)' : 'var(--box-text-1)',
|
||||||
|
cursor: index === props.collection.cur - 1 ? 'default' : 'pointer',
|
||||||
|
}"
|
||||||
>
|
>
|
||||||
<div class="tpoc-item-title" :title="item.title">{{ item.title }}</div>
|
<div class="tpoc-item-title" :title="item.title">{{ item.title }}</div>
|
||||||
<div class="tpoc-item-info">
|
<div class="tpoc-item-info">
|
||||||
@@ -103,15 +108,15 @@ function getDate(date: number): string {
|
|||||||
return new Date(date * 1000).toLocaleString().replace(/\//g, "-").split(" ")[0];
|
return new Date(date * 1000).toLocaleString().replace(/\//g, "-").split(" ")[0];
|
||||||
}
|
}
|
||||||
|
|
||||||
function toPost(postId: string) {
|
async function toPost(postId: string, index: number): Promise<void> {
|
||||||
if (router.currentRoute.value.params.post_id === postId) {
|
if (index === props.collection.cur - 1) {
|
||||||
showSnackbar({
|
showSnackbar({
|
||||||
text: "已经在当前帖子",
|
text: "已经在当前帖子",
|
||||||
color: "warn",
|
color: "warn",
|
||||||
});
|
});
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
router.push({
|
await router.push({
|
||||||
name: "帖子详情",
|
name: "帖子详情",
|
||||||
params: {
|
params: {
|
||||||
post_id: postId,
|
post_id: postId,
|
||||||
@@ -162,8 +167,6 @@ function toPost(postId: string) {
|
|||||||
padding: 10px;
|
padding: 10px;
|
||||||
border: 1px solid var(--common-shadow-2);
|
border: 1px solid var(--common-shadow-2);
|
||||||
border-radius: 5px;
|
border-radius: 5px;
|
||||||
background: var(--box-bg-2);
|
|
||||||
color: var(--box-text-2);
|
|
||||||
cursor: pointer;
|
cursor: pointer;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user