feat:人物搜索

This commit is contained in:
jxxghp
2024-04-26 20:35:40 +08:00
parent 54415377ee
commit db0d5133e8
5 changed files with 82 additions and 124 deletions

View File

@@ -17,15 +17,13 @@ const isImageLoaded = ref(false)
// 人物图片地址
function getPersonImage() {
if (!personInfo.value?.profile_path)
return personIcon
if (!personInfo.value?.profile_path) return personIcon
return `https://image.tmdb.org/t/p/w600_and_h900_bestv2${personInfo.value?.profile_path}`
}
// 人物详情
function goPersonDetail() {
if (!personInfo.value?.id)
return
if (!personInfo.value?.id) return
router.push({
path: '/person',
query: {
@@ -51,7 +49,7 @@ function goPersonDetail() {
<div
class="person-card relative transform-gpu cursor-pointer rounded shadow ring-1 transition duration-150 ease-in-out scale-100 ring-gray-700"
>
<div style="padding-bottom: 150%;">
<div style="padding-block-end: 150%">
<div class="absolute inset-0 flex h-full w-full flex-col items-center p-2">
<div class="relative mt-2 mb-4 flex h-1/2 w-full justify-center">
<VAvatar
@@ -60,17 +58,16 @@ function goPersonDetail() {
'ring-1 ring-gray-700': isImageLoaded,
}"
>
<VImg
:src="getPersonImage()"
cover
@load="isImageLoaded = true"
/>
<VImg :src="getPersonImage()" cover @load="isImageLoaded = true" />
</VAvatar>
</div>
<div class="w-full truncate text-center font-bold">
{{ personInfo?.name }}
</div>
<div class="overflow-hidden whitespace-normal text-center text-sm" style=" display: -webkit-box; overflow: hidden; -webkit-box-orient: vertical;-webkit-line-clamp: 2;">
<div
class="overflow-hidden whitespace-normal text-center text-sm"
style="display: -webkit-box; overflow: hidden; -webkit-box-orient: vertical; -webkit-line-clamp: 2"
>
{{ personInfo?.character }}
</div>
<div class="absolute bottom-0 left-0 right-0 h-12 rounded-b" />