ow
This commit is contained in:
1 parent
b858386e86
commit
3b2ee8523b
28 files changed
+2285
-1496
No files matched your search
@@ -2,7 +2,7 @@
|
||||
/**
|
||||
* 底部导航「文件」页:按截图拆解为独立组件(components/ 下各自一个 vue 文件),
|
||||
* 页面只持有状态与数据,经 props 单向下发、事件(emit)上报,组件之间不互相引用:
|
||||
* page-navbar 顶部导航(居中标题;仅子目录态显示返回箭头)
|
||||
* page-navbar 顶部导航(左对齐标题 + 右对齐操作图标;仅子目录态显示返回箭头)
|
||||
* file-breadcrumb 目录面包屑(仅子目录态:左起排列,放不下折成 根+…+尾部段)
|
||||
* search-input 搜索框(v-model 即时过滤,确认键触发服务端搜索)
|
||||
* quick-entry 快捷功能入口(横向滚动图标组)
|
||||
@@ -32,6 +32,7 @@ import dmsFileService from "@/service/master/dmsFileService";
|
||||
import publishAudioService from "@/service/master/publishAudioService";
|
||||
import publishPhotoService from "@/service/master/publishPhotoService";
|
||||
import publishVideoService from "@/service/master/publishVideoService";
|
||||
import { useMediaIntentStore } from "@/stores/mediaIntent";
|
||||
import { useUploadQueueStore } from "@/stores/uploadQueue";
|
||||
import { chooseFiles } from "@/utils/chooseFiles";
|
||||
import { fetchFileBytes, saveFileBytes, toPlayableUrl } from "@/utils/dmsBytes";
|
||||
@@ -40,13 +41,16 @@ import { transferGlyph } from "@/utils/transferGlyph";
|
||||
|
||||
const { t } = useLocale();
|
||||
|
||||
// 页面底渐变跟随主题(派生逻辑在 composables/useThemeGradient,多页共用)
|
||||
const { themeBackground } = useThemeGradient();
|
||||
// 页面底跟随主题(派生逻辑在 composables/useThemeGradient,多页共用):
|
||||
// 顶部主题色光晕 → 自然过渡到近白内容区,替代整页铺色的灰浊感
|
||||
const { themeGlowBackground } = useThemeGradient();
|
||||
|
||||
const { files, records, loading, errorText, pathStack, atRoot, init, openTrail, retry, openFolder, back, goTo, search } = useDmsFiles();
|
||||
|
||||
// 上传队列(全局 store):入队在本页、胶囊读它的进行中计数、守卫回调消费它的面包屑导航请求
|
||||
const uploadQueue = useUploadQueueStore();
|
||||
// 跨 tab 意图通道:发布面板「新建相册」→ reLaunch 去媒体页自动进创建态
|
||||
const mediaIntent = useMediaIntentStore();
|
||||
|
||||
// 首次显示拉根目录,之后每次回到页面只刷新当前目录(重进 tab 不该丢位置重新拉全链);
|
||||
// 回页末尾消费传输页的面包屑导航请求(reLaunch 重建后恢复到目标目录)
|
||||
@@ -675,6 +679,41 @@ const publishTitle = computed(() => {
|
||||
return publishKind.value === "audio" ? t("FilePage.publishPickAudio") : t("FilePage.publishPickPhoto");
|
||||
});
|
||||
|
||||
/** 确认键按类型叫「发布相册/发布音乐专辑/发布视频专辑」,不再笼统叫「创建」 */
|
||||
const publishConfirmText = computed(() => {
|
||||
if (publishKind.value === "video") {
|
||||
return t("FilePage.publishConfirmVideo");
|
||||
}
|
||||
return publishKind.value === "audio" ? t("FilePage.publishConfirmAudio") : t("FilePage.publishConfirmPhoto");
|
||||
});
|
||||
|
||||
/** 附加「新建」行文案:与确认键同类型口径 */
|
||||
const publishCreateText = computed(() => {
|
||||
if (publishKind.value === "video") {
|
||||
return t("FilePage.publishCreateVideo");
|
||||
}
|
||||
return publishKind.value === "audio" ? t("FilePage.publishCreateAudio") : t("FilePage.publishCreatePhoto");
|
||||
});
|
||||
|
||||
/** 专辑行首图标:与媒体页分段图标同口径 */
|
||||
const publishRowIcon = computed(() =>
|
||||
publishKind.value === "video" ? "play-circle-fill" : publishKind.value === "audio" ? "volume" : "photo",
|
||||
);
|
||||
|
||||
/** 「新建相册」行:关弹层 → 登记创建意图 → 切到媒体 tab(onShow 消费后进创建态) */
|
||||
function goCreateAlbum(): void {
|
||||
publishVisible.value = false;
|
||||
const kindMap: Record<"image" | "video" | "audio", "photo" | "video" | "audio"> = {
|
||||
image: "photo",
|
||||
video: "video",
|
||||
audio: "audio",
|
||||
};
|
||||
mediaIntent.requestCreate(kindMap[publishKind.value]);
|
||||
// 项目无原生 tabBar(自定义 app-tabbar),switchTab 会报 can not switch to no-tabBar page,
|
||||
// 切 tab 与 app-tabbar.onChange 同套路用 reLaunch;意图由媒体页首显回调消费
|
||||
uni.reLaunch({ url: pageUrl("mediaTab") });
|
||||
}
|
||||
|
||||
async function actionPublish(targets: FileItem[]): Promise<void> {
|
||||
const picked = targets.filter(f => f.kind !== "folder");
|
||||
if (!picked.length) {
|
||||
@@ -735,7 +774,7 @@ async function actionPublish(targets: FileItem[]): Promise<void> {
|
||||
if (hasName) {
|
||||
parts.push(code);
|
||||
}
|
||||
return { key: code, label, sub: parts.join(" · ") };
|
||||
return { key: code, label, sub: parts.join(" · "), icon: publishRowIcon.value };
|
||||
});
|
||||
}
|
||||
catch (error: any) {
|
||||
@@ -886,7 +925,7 @@ const transferIconWhite = transferGlyph("#ffffff");
|
||||
弹层 z-index 再高也压不住它,直接隐藏最干净(主流云盘同款交互) -->
|
||||
<app-page :hide-nav="true"
|
||||
:show-tabbar="atRoot && !actionFile && !selectMode && !folderDialogVisible && !renameVisible && !moveVisible && !shareVisible && !publishVisible">
|
||||
<view class="file-page" :style="{ background: themeBackground }">
|
||||
<view class="file-page" :style="{ background: themeGlowBackground }">
|
||||
<!-- 上半屏整体固定,只有文件列表所在的 scroll-view 内部滚动(整页不滚) -->
|
||||
<view class="file-page__head">
|
||||
<page-navbar :title="navTitle" :show-back="!atRoot" :search-on="showSearch" :quick-on="showQuick"
|
||||
@@ -976,9 +1015,10 @@ const transferIconWhite = transferGlyph("#ffffff");
|
||||
<!-- 共享家人:共享大厅式抽屉(群组卡→逐级下钻→「共享到此」),多选文件一次批量共享 -->
|
||||
<folder-share-picker :visible="shareVisible" :selected-count="shareTargets.length" @close="shareVisible = false"
|
||||
@confirm="onShareConfirm" />
|
||||
<!-- 发布:选专辑 -->
|
||||
<!-- 发布:选专辑(确认键按类型叫「发布相册」等;附「新建相册」行跳媒体页创建态) -->
|
||||
<option-picker :visible="publishVisible" :title="publishTitle" :items="publishItems" :loading="publishLoading"
|
||||
:empty-text="t('FilePage.pickerEmpty')" @close="publishVisible = false" @confirm="onPublishConfirm" />
|
||||
:empty-text="t('FilePage.pickerEmpty')" :confirm-text="publishConfirmText" :create-text="publishCreateText"
|
||||
@close="publishVisible = false" @create="goCreateAlbum" @confirm="onPublishConfirm" />
|
||||
<!-- 多选底部操作栏:常驻非模态(无遮罩),勾选与动作可交替进行;
|
||||
动作集是旧系统多选子集——共享/发布按同媒体类型条件,重命名/移动仅单选 -->
|
||||
<view v-if="selectMode" class="file-page__actions">
|
||||
|
||||
Reference in new issue
Block a user