diff --git a/vue/src/components/FileItem.vue b/vue/src/components/FileItem.vue
index 28f1f5b..c2b981f 100644
--- a/vue/src/components/FileItem.vue
+++ b/vue/src/components/FileItem.vue
@@ -66,7 +66,8 @@ const emit = defineEmits<{
'dragend': [event: DragEvent, idx: number],
'previewVisibleChange': [value: boolean, last: boolean],
'contextMenuClick': [e: MenuInfo, file: FileNodeInfo, idx: number],
- 'close-icon-click': []
+ 'close-icon-click': [],
+ 'tiktokView': [file: FileNodeInfo, idx: number]
}>()
const customTags = computed(() => {
@@ -152,7 +153,11 @@ const minShowDetailWidth = 160
emit('contextMenuClick', { key: `toggle-tag-${id}` } as any, file, idx))">
+ @click="openVideoModal(
+ file,
+ (id) => emit('contextMenuClick', { key: `toggle-tag-${id}` } as any, file, idx),
+ () => emit('tiktokView', file, idx)
+ )">
![]()
diff --git a/vue/src/components/functionalCallableComp.tsx b/vue/src/components/functionalCallableComp.tsx
index 8072a2f..40712e2 100644
--- a/vue/src/components/functionalCallableComp.tsx
+++ b/vue/src/components/functionalCallableComp.tsx
@@ -11,6 +11,7 @@ import { addCustomTag, getDbBasicInfo, rebuildImageIndex, renameFile } from '@/a
import { useTagStore } from '@/store/useTagStore'
import { useGlobalStore } from '@/store/useGlobalStore'
import { base64ToFile, video2base64 } from '@/util/video'
+import { closeImageFullscreenPreview } from '@/util/imagePreviewOperation'
export const openCreateFlodersModal = (base: string) => {
const floderName = ref('')
@@ -42,7 +43,11 @@ export const MultiSelectTips = () => (
)
-export const openVideoModal = (file: FileNodeInfo, onTagClick?: (id: string| number) => void) => {
+export const openVideoModal = (
+ file: FileNodeInfo,
+ onTagClick?: (id: string| number) => void,
+ onTiktokView?: () => void
+) => {
const tagStore = useTagStore()
const global = useGlobalStore()
const isSelected = (id: string | number) => {
@@ -70,7 +75,8 @@ export const openVideoModal = (file: FileNodeInfo, onTagClick?: (id: string| num
transition: '.5s all ease',
'user-select': 'none',
}
- Modal.confirm({
+
+ const modal = Modal.confirm({
width: '80vw',
title: file.name,
icon: null,
@@ -110,6 +116,13 @@ export const openVideoModal = (file: FileNodeInfo, onTagClick?: (id: string| num
default: t('download')
}}
+ {onTiktokView && (
+
+ )}
diff --git a/vue/src/page/fileTransfer/stackView.vue b/vue/src/page/fileTransfer/stackView.vue
index 95c7704..0916315 100644
--- a/vue/src/page/fileTransfer/stackView.vue
+++ b/vue/src/page/fileTransfer/stackView.vue
@@ -238,6 +238,7 @@ watch(
v-model:show-menu-idx="showMenuIdx" :selected="multiSelectedIdxs.includes(idx)" :cell-width="cellWidth"
@file-item-click="onFileItemClick" @dragstart="onFileDragStart" @dragend="onFileDragEnd"
@preview-visible-change="onPreviewVisibleChange" @context-menu-click="onContextMenuClick"
+ @tiktok-view="(file, idx) => openTiktokViewWithFiles(sortedFiles, idx)"
:is-selected-mutil-files="multiSelectedIdxs.length > 1"
:enable-change-indicator="changeIndchecked"
:seed-change-checked="seedChangeChecked"
diff --git a/vue/src/page/randomImage/randomImage.vue b/vue/src/page/randomImage/randomImage.vue
index 0ced350..d5cfa0c 100644
--- a/vue/src/page/randomImage/randomImage.vue
+++ b/vue/src/page/randomImage/randomImage.vue
@@ -10,6 +10,8 @@ import { GridViewFile, useGlobalStore } from '@/store/useGlobalStore'
import { getRandomImages } from '@/api/db'
import { identity } from '@vueuse/core'
import fullScreenContextMenu from '@/page/fileTransfer/fullScreenContextMenu.vue'
+import { openTiktokViewWithFiles } from '@/util/tiktokHelper'
+import MultiSelectKeep from '@/components/MultiSelectKeep.vue'
import { LeftCircleOutlined, RightCircleOutlined } from '@/icon'
import { copy2clipboardI18n } from '@/util'
@@ -40,6 +42,17 @@ const fetch = async () => {
onScroll()
}
}
+
+// TikTok View 按钮点击处理
+const onTiktokViewClick = () => {
+ if (files.value.length === 0) {
+ message.warn('没有图片可以浏览')
+ return
+ }
+ // 从当前预览索引开始,如果没有预览则从第一张开始
+ openTiktokViewWithFiles(files.value, previewIdx.value || 0)
+}
+
onMounted(fetch)
const { stackViewEl, multiSelectedIdxs, stack, scroller } = useHookShareState({
images: files as any
@@ -67,7 +80,24 @@ const onContextMenuClickU: typeof onContextMenuClick = async (e, file, idx) => {
@@ -90,7 +120,7 @@ const onContextMenuClickU: typeof onContextMenuClick = async (e, file, idx) => {
+ @file-item-click="onFileItemClick" @tiktok-view="(file, idx) => openTiktokViewWithFiles(files, idx)" />
@@ -124,6 +154,10 @@ const onContextMenuClickU: typeof onContextMenuClick = async (e, file, idx) => {
background: white;
border-radius: 9999px;
box-shadow: 0 0 20px var(--zp-secondary);
+ padding: 4px;
+ display: flex;
+ align-items: center;
+ gap: 8px;
}
.file-list {