From 1a733843813fbda9da4e044176505ac6097d127d Mon Sep 17 00:00:00 2001 From: hsingyin Date: Fri, 1 Nov 2024 11:42:19 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E8=A1=A5=E5=85=85=E6=96=87=E4=BB=B6?= =?UTF-8?q?=E5=88=86=E4=BA=AB=E5=92=8C=E7=9B=B8=E5=85=B3=E9=80=BB=E8=BE=91?= =?UTF-8?q?=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/FileListItem.vue | 21 ++- src/components/SubListItem.vue | 223 ++++++++++++++++++++------------ src/locales/en.ts | 14 +- src/locales/zh.ts | 14 +- src/views/File.vue | 17 +++ src/views/Sub.vue | 1 + src/views/share/SharePopup.vue | 209 ++++++++++++++++++++++-------- 7 files changed, 353 insertions(+), 146 deletions(-) diff --git a/src/components/FileListItem.vue b/src/components/FileListItem.vue index 902025158..e493618a4 100644 --- a/src/components/FileListItem.vue +++ b/src/components/FileListItem.vue @@ -48,6 +48,13 @@ style="position: relative" :style="{ top: appearanceSetting.isSimpleMode ? '8px' : '0' }" > + @@ -190,11 +197,13 @@ import { useI18n } from 'vue-i18n'; import { useRouter, useRoute } from 'vue-router'; import { useHostAPI } from '@/hooks/useHostAPI'; + import { useBackend } from "@/hooks/useBackend"; const { copy, isSupported } = useClipboard(); const { toClipboard: copyFallback } = useV3Clipboard(); const { t } = useI18n(); + const { env } = useBackend(); const props = defineProps<{ type: 'sub' | 'collection' | 'file'; @@ -374,7 +383,17 @@ const { showNotify } = useAppNotifyStore(); const { currentUrl: host } = useHostAPI(); + const emit = defineEmits(["share"]); + const shareBtnVisible = computed(() => { + return env.value?.feature?.share; + }); + const onClickShareLink = async () => { + console.log('props', props) + const type = props.type; + const data = props.file; + emit("share", data, type); + }; const onClickCopyLink = async () => { const path = `/api/file/${encodeURIComponent(name)}`; const url = `${host.value}${path}`; @@ -441,7 +460,7 @@ font-size: 16px; color: var(--primary-text-color); } - + .share-sub-link, .copy-sub-link, .refresh-sub-flow { background-color: transparent; diff --git a/src/components/SubListItem.vue b/src/components/SubListItem.vue index 6fd9a5d30..7e3420df1 100644 --- a/src/components/SubListItem.vue +++ b/src/components/SubListItem.vue @@ -1,23 +1,31 @@