ow
This commit is contained in:
1 parent
fd67fa8f63
commit
211d2cd253
31 files changed
+1830
-454
No files matched your search
@@ -299,7 +299,7 @@ const pickedKind = computed<FileKind | null>(() => {
|
||||
return picked.every(f => f.kind === first.kind) ? first.kind : null;
|
||||
});
|
||||
|
||||
/** 旧系统 publishTooltip 简化口径:媒体类型统一「发布专辑」(按钮不超 4 字),文档仍「发布」 */
|
||||
/** 旧系统 publishTooltip 简化口径:发布只服务媒体类型,统一「发布专辑」(按钮不超 4 字) */
|
||||
const publishLabel = computed(() => {
|
||||
const kind = pickedKind.value;
|
||||
return kind === "image" || kind === "video" || kind === "audio"
|
||||
@@ -337,7 +337,7 @@ const previewKey = computed(() => {
|
||||
/** 选中含文件即可下载(旧系统 onDownloadSelected 就是滤掉目录逐个循环下载) */
|
||||
const hasFileSelected = computed(() => selectedFiles.value.some(f => f.kind !== "folder"));
|
||||
|
||||
/** 排1:下载(含文件即有)+ 共享/发布(同媒体类型且无目录)+ 删除恒在 */
|
||||
/** 排1:下载(含文件即有)+ 共享/发布(同媒体类型且无目录,文档无发布功能不显示)+ 删除恒在 */
|
||||
const multiActionsTop = computed<MultiAction[]>(() => {
|
||||
const actions: MultiAction[] = [];
|
||||
if (hasFileSelected.value) {
|
||||
@@ -345,7 +345,10 @@ const multiActionsTop = computed<MultiAction[]>(() => {
|
||||
}
|
||||
if (canSharePublish.value) {
|
||||
actions.push({ key: "share", label: t("FilePage.actionShareShort"), icon: "share-fill" });
|
||||
actions.push({ key: "publish", label: publishLabel.value, icon: "volume-fill" });
|
||||
// 发布仅图片/视频/音频(单选文档时共享仍在,发布不显示)
|
||||
if (pickedKind.value !== "document") {
|
||||
actions.push({ key: "publish", label: publishLabel.value, icon: "volume-fill" });
|
||||
}
|
||||
}
|
||||
actions.push({ key: "delete", label: t("FilePage.actionDelete"), icon: "trash", danger: true });
|
||||
return actions;
|
||||
@@ -389,14 +392,15 @@ function onToggleSelectItem(id: number): void {
|
||||
|
||||
// ===== 列表条目 / 悬浮按钮 =====
|
||||
async function onOpen(file: FileItem): Promise<void> {
|
||||
// 文件夹下钻走真实接口;文件点开即预览/播放(旧系统 onViewPic 同款分流)
|
||||
// 文件夹下钻走真实接口;图片连览、音视频进厅播放,文档与右侧「…」同口径弹出操作面板
|
||||
if (await openFolder(file)) {
|
||||
keyword.value = "";
|
||||
selectedIds.value = [];
|
||||
return;
|
||||
}
|
||||
if (file.kind === "image") {
|
||||
actionPreview([file]);
|
||||
// 连览当前可见列表的全部图片(按列表排序),从点击这张开始,左右滑动切前后一张
|
||||
actionPreview(visibleFiles.value.filter(f => f.kind === "image"), file);
|
||||
}
|
||||
else if (file.kind === "video" || file.kind === "audio") {
|
||||
// 单击即进音乐厅/影视厅(以当前目录为播放列表),从这一条开始播;
|
||||
@@ -404,8 +408,9 @@ async function onOpen(file: FileItem): Promise<void> {
|
||||
openInHall(file);
|
||||
}
|
||||
else {
|
||||
// 文档没有移动端预览器,点开按下载处理(比占位 toast 实用)
|
||||
actionDownload([file]);
|
||||
// 文档没有移动端预览器:与右侧「…」一致弹出操作面板(下载/重命名/移动/删除等由用户选),
|
||||
// 不再单击即静默下载
|
||||
onItemMore(file);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -597,17 +602,21 @@ async function actionDownload(targets: FileItem[]): Promise<void> {
|
||||
// ----- 图片查看器(缩略图秒开 + 按需原图,见 components/image-viewer)-----
|
||||
const viewerVisible = ref(false);
|
||||
const viewerItems = ref<ImageViewerItem[]>([]);
|
||||
/** 打开时定位的起始图(连览时从点击那张开始) */
|
||||
const viewerStartIndex = ref(0);
|
||||
|
||||
/** 图片预览:单选一张、多选多图相册连览。
|
||||
/** 图片预览:单选连览当前列表全部图片、多选只连览选中的图片。
|
||||
* 缩略图先行——thumbUrl 列表已加载过(甚至命中 HTTP 缓存),组装进查看器秒开;
|
||||
* 原图按需拉取(查看器底部「查看原图」触发 loadFull,走分片拼整 + 落盘旧通道)。
|
||||
* 替代旧 uni.previewImage 链路:它要先串行拉全部原图字节落盘才弹窗,慢的根因在此 */
|
||||
function actionPreview(targets: FileItem[]): void {
|
||||
* 替代旧 uni.previewImage 链路:它要先串行拉全部原图字节落盘才弹窗,慢的根因在此。
|
||||
* start 传了就从那张开始,否则从第一张开始 */
|
||||
function actionPreview(targets: FileItem[], start?: FileItem): void {
|
||||
const images = targets.filter(f => f.kind === "image");
|
||||
if (!images.length) {
|
||||
toast(t("FilePage.previewNoImage"));
|
||||
return;
|
||||
}
|
||||
viewerStartIndex.value = start ? Math.max(0, images.findIndex(f => f.id === start.id)) : 0;
|
||||
viewerItems.value = images.map((file) => {
|
||||
const item: ImageViewerItem = {
|
||||
name: file.name,
|
||||
@@ -656,7 +665,7 @@ function goPlay(type: "video" | "audio", name: string, url: string): void {
|
||||
});
|
||||
}
|
||||
|
||||
// ----- 共享家人:共享大厅式抽屉选目标目录(群组卡→逐级下钻→共享到此),
|
||||
// ----- 共享到群组目录:共享大厅式抽屉选目标目录(群组卡→逐级下钻→共享到此),
|
||||
// 多选文件一次批量建(CreateFamilyGroupFolder 数组入参,旧 handleSelectShare 同口径)-----
|
||||
const shareVisible = ref(false);
|
||||
const shareTargets = ref<FileItem[]>([]);
|
||||
@@ -1035,7 +1044,8 @@ const transferIconWhite = transferGlyph("#ffffff");
|
||||
<file-action-sheet :visible="!!actionFile" :file="actionFile" @close="actionFile = null"
|
||||
@action="onSheetAction" />
|
||||
<!-- 图片查看器:缩略图秒开连览,底部「查看原图」按需拉原图(全屏遮罩,打开时收起 tabbar) -->
|
||||
<image-viewer :visible="viewerVisible" :items="viewerItems" @close="viewerVisible = false" />
|
||||
<image-viewer :visible="viewerVisible" :items="viewerItems" :start-index="viewerStartIndex"
|
||||
@close="viewerVisible = false" />
|
||||
<folder-name-dialog :visible="folderDialogVisible" :submitting="folderSubmitting"
|
||||
@close="folderDialogVisible = false" @confirm="onCreateFolder" />
|
||||
<!-- 重命名:同一个命名对话框的第二个实例(预填当前名 + 重命名文案) -->
|
||||
@@ -1045,7 +1055,7 @@ const transferIconWhite = transferGlyph("#ffffff");
|
||||
<!-- 移动:网盘式逐级下钻选择器(进层浏览,「移动到此」提交当前层后直接调移动接口) -->
|
||||
<folder-move-picker :visible="moveVisible" :exclude-name="moveExcludeName" :source-path="moveSourcePath"
|
||||
:selected-count="moveTargets.length" @close="moveVisible = false" @confirm="onMovePick" />
|
||||
<!-- 共享家人:共享大厅式抽屉(群组卡→逐级下钻→「共享到此」),多选文件一次批量共享 -->
|
||||
<!-- 共享到群组目录:共享大厅式抽屉(群组卡→逐级下钻→「共享到此」),多选文件一次批量共享 -->
|
||||
<folder-share-picker :visible="shareVisible" :selected-count="shareTargets.length" @close="shareVisible = false"
|
||||
@confirm="onShareConfirm" />
|
||||
<!-- 发布:选专辑(确认键按类型叫「发布相册」等;附「新建相册」行跳媒体页创建态) -->
|
||||
|
||||
Reference in new issue
Block a user