mirror of
https://github.com/jxxghp/MoviePilot-Frontend.git
synced 2026-09-05 15:36:49 +08:00
优化默认布局和快速访问组件
This commit is contained in:
@@ -391,7 +391,7 @@ onMounted(() => {
|
|||||||
border-radius: 50%;
|
border-radius: 50%;
|
||||||
backdrop-filter: blur(20px);
|
backdrop-filter: blur(20px);
|
||||||
background: rgba(var(--v-theme-surface), 0.3);
|
background: rgba(var(--v-theme-surface), 0.3);
|
||||||
box-shadow: 0 2px 6px rgba(0, 0, 0, 10%), 0 1px 4px rgba(0, 0, 0, 6%);
|
box-shadow: 0 1px 2px rgba(0, 0, 0, 10%), 0 1px 3px rgba(0, 0, 0, 6%);
|
||||||
inset-block-start: 80px;
|
inset-block-start: 80px;
|
||||||
inset-inline-start: 50%;
|
inset-inline-start: 50%;
|
||||||
pointer-events: none;
|
pointer-events: none;
|
||||||
|
|||||||
@@ -39,6 +39,9 @@ const recentPlugins = ref<Plugin[]>([])
|
|||||||
// 是否加载中
|
// 是否加载中
|
||||||
const loading = ref(false)
|
const loading = ref(false)
|
||||||
|
|
||||||
|
// 各插件的图标加载状态
|
||||||
|
const pluginIconLoading = ref<Record<string, boolean>>({})
|
||||||
|
|
||||||
// 上滑关闭相关状态
|
// 上滑关闭相关状态
|
||||||
const isDraggingToClose = ref(false)
|
const isDraggingToClose = ref(false)
|
||||||
const dragOffset = ref(0)
|
const dragOffset = ref(0)
|
||||||
@@ -52,6 +55,11 @@ const isVisible = computed(() => {
|
|||||||
return props.visible // 只基于visible属性显示,不考虑pullDistance
|
return props.visible // 只基于visible属性显示,不考虑pullDistance
|
||||||
})
|
})
|
||||||
|
|
||||||
|
// 处理插件图标加载错误
|
||||||
|
function handleIconError(plugin: Plugin) {
|
||||||
|
pluginIconLoading.value[plugin.id] = false
|
||||||
|
}
|
||||||
|
|
||||||
// 计算整个组件的transform(包含拖动偏移)
|
// 计算整个组件的transform(包含拖动偏移)
|
||||||
const componentTransform = computed(() => {
|
const componentTransform = computed(() => {
|
||||||
let baseTransform = ''
|
let baseTransform = ''
|
||||||
@@ -85,6 +93,7 @@ const componentOpacity = computed(() => {
|
|||||||
// 计算插件图标路径
|
// 计算插件图标路径
|
||||||
function getPluginIcon(plugin: Plugin): string {
|
function getPluginIcon(plugin: Plugin): string {
|
||||||
if (!plugin.plugin_icon) return noImage
|
if (!plugin.plugin_icon) return noImage
|
||||||
|
if (!pluginIconLoading.value[plugin.id]) return noImage
|
||||||
|
|
||||||
// 如果是网络图片则使用代理后返回
|
// 如果是网络图片则使用代理后返回
|
||||||
if (plugin?.plugin_icon?.startsWith('http'))
|
if (plugin?.plugin_icon?.startsWith('http'))
|
||||||
@@ -155,9 +164,7 @@ watch(
|
|||||||
() => isVisible.value,
|
() => isVisible.value,
|
||||||
visible => {
|
visible => {
|
||||||
if (visible) {
|
if (visible) {
|
||||||
if (pluginsWithPage.value.length === 0) {
|
fetchPluginsWithPage()
|
||||||
fetchPluginsWithPage()
|
|
||||||
}
|
|
||||||
loadRecentPlugins()
|
loadRecentPlugins()
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
@@ -230,7 +237,7 @@ function handleBackdropClick(event: MouseEvent) {
|
|||||||
>
|
>
|
||||||
<div class="plugin-icon">
|
<div class="plugin-icon">
|
||||||
<VAvatar size="48" class="plugin-avatar">
|
<VAvatar size="48" class="plugin-avatar">
|
||||||
<VImg :src="getPluginIcon(plugin)" :alt="plugin.plugin_name" cover>
|
<VImg :src="getPluginIcon(plugin)" :alt="plugin.plugin_name" cover @error="handleIconError(plugin)">
|
||||||
<template #error>
|
<template #error>
|
||||||
<VIcon icon="mdi-puzzle" size="24" />
|
<VIcon icon="mdi-puzzle" size="24" />
|
||||||
</template>
|
</template>
|
||||||
@@ -306,6 +313,7 @@ function handleBackdropClick(event: MouseEvent) {
|
|||||||
position: fixed;
|
position: fixed;
|
||||||
z-index: 9999;
|
z-index: 9999;
|
||||||
display: flex;
|
display: flex;
|
||||||
|
overflow: hidden; /* 防止整个容器溢出 */
|
||||||
flex-direction: column;
|
flex-direction: column;
|
||||||
backdrop-filter: blur(20px);
|
backdrop-filter: blur(20px);
|
||||||
background: rgba(var(--v-theme-surface), 0.95);
|
background: rgba(var(--v-theme-surface), 0.95);
|
||||||
|
|||||||
Reference in New Issue
Block a user