|
@@ -39,13 +39,11 @@ export struct UploadMusicPage {
|
|
|
@StorageProp('bottomSafeHeight') bottomSafeHeight: number = 0;
|
|
@StorageProp('bottomSafeHeight') bottomSafeHeight: number = 0;
|
|
|
@StorageProp('themeColor') themeColor: string = CommonConstants.DEFAULT_THEME_COLOR;
|
|
@StorageProp('themeColor') themeColor: string = CommonConstants.DEFAULT_THEME_COLOR;
|
|
|
@StorageProp('isDarkMode') isDarkMode: boolean = false;
|
|
@StorageProp('isDarkMode') isDarkMode: boolean = false;
|
|
|
-
|
|
|
|
|
// 页面状态变量
|
|
// 页面状态变量
|
|
|
@State selectedFiles: string[] = [];
|
|
@State selectedFiles: string[] = [];
|
|
|
@State selectedFileNames: string[] = [];
|
|
@State selectedFileNames: string[] = [];
|
|
|
@State selectedFileTypes: string[] = []; // 'file' 或 'folder'
|
|
@State selectedFileTypes: string[] = []; // 'file' 或 'folder'
|
|
|
@State accounts: WebDavAccount[] = [];
|
|
@State accounts: WebDavAccount[] = [];
|
|
|
-
|
|
|
|
|
// 文件浏览器状态
|
|
// 文件浏览器状态
|
|
|
@State isShowFileBrowser: boolean = false;
|
|
@State isShowFileBrowser: boolean = false;
|
|
|
@State fileBrowserPath: string = '';
|
|
@State fileBrowserPath: string = '';
|
|
@@ -56,7 +54,6 @@ export struct UploadMusicPage {
|
|
|
@State uploadPath: string = '/';
|
|
@State uploadPath: string = '/';
|
|
|
@State availablePaths: string[] = [];
|
|
@State availablePaths: string[] = [];
|
|
|
@State duplicateAction: string = 'skip';
|
|
@State duplicateAction: string = 'skip';
|
|
|
-
|
|
|
|
|
// SegmentButton 重复文件处理选项
|
|
// SegmentButton 重复文件处理选项
|
|
|
@State duplicateOptions: SegmentButtonOptions = SegmentButtonOptions.capsule({
|
|
@State duplicateOptions: SegmentButtonOptions = SegmentButtonOptions.capsule({
|
|
|
buttons: [{ text: '跳过' }, { text: '覆盖' }, { text: '重命名' }] as SegmentButtonItemTuple,
|
|
buttons: [{ text: '跳过' }, { text: '覆盖' }, { text: '重命名' }] as SegmentButtonItemTuple,
|
|
@@ -81,16 +78,13 @@ export struct UploadMusicPage {
|
|
|
@State isLoadingFolders: boolean = false;
|
|
@State isLoadingFolders: boolean = false;
|
|
|
@State pendingCount: number = 0;
|
|
@State pendingCount: number = 0;
|
|
|
@State finishedCount: number = 0;
|
|
@State finishedCount: number = 0;
|
|
|
-
|
|
|
|
|
// RemoteDriveManager实例
|
|
// RemoteDriveManager实例
|
|
|
private webdavManager: RemoteDriveManager = RemoteDriveManager.getInstance();
|
|
private webdavManager: RemoteDriveManager = RemoteDriveManager.getInstance();
|
|
|
-
|
|
|
|
|
// 性能优化:使用LazyDataSource优化队列列表渲染
|
|
// 性能优化:使用LazyDataSource优化队列列表渲染
|
|
|
// LazyForEach配合IDataSource可以实现按需加载,避免一次性渲染大量列表项
|
|
// LazyForEach配合IDataSource可以实现按需加载,避免一次性渲染大量列表项
|
|
|
// 对于包含数百个上传任务的队列,可以显著提升UI响应性能
|
|
// 对于包含数百个上传任务的队列,可以显著提升UI响应性能
|
|
|
private uploadQueueDataSource: UploadTaskDataSource = new UploadTaskDataSource();
|
|
private uploadQueueDataSource: UploadTaskDataSource = new UploadTaskDataSource();
|
|
|
private finishQueueDataSource: UploadTaskDataSource = new UploadTaskDataSource();
|
|
private finishQueueDataSource: UploadTaskDataSource = new UploadTaskDataSource();
|
|
|
-
|
|
|
|
|
// 事件处理器引用
|
|
// 事件处理器引用
|
|
|
private eventHandler: (event: string) => void = (event: string) => {
|
|
private eventHandler: (event: string) => void = (event: string) => {
|
|
|
this.handleUploadEvent(event);
|
|
this.handleUploadEvent(event);
|
|
@@ -439,18 +433,18 @@ export struct UploadMusicPage {
|
|
|
for (let i = 0; i < tasks.length; i++) {
|
|
for (let i = 0; i < tasks.length; i++) {
|
|
|
this.uploadQueue.push(tasks[i].song);
|
|
this.uploadQueue.push(tasks[i].song);
|
|
|
}
|
|
}
|
|
|
-
|
|
|
|
|
|
|
+
|
|
|
this.pendingCount = this.uploadQueue.length;
|
|
this.pendingCount = this.uploadQueue.length;
|
|
|
-
|
|
|
|
|
|
|
+
|
|
|
if (this.pendingCount === 0) {
|
|
if (this.pendingCount === 0) {
|
|
|
this.isUploading = false;
|
|
this.isUploading = false;
|
|
|
this.currentTask = null;
|
|
this.currentTask = null;
|
|
|
this.uploadProgress = 0;
|
|
this.uploadProgress = 0;
|
|
|
this.uploadSpeed = '0 KB/s';
|
|
this.uploadSpeed = '0 KB/s';
|
|
|
}
|
|
}
|
|
|
-
|
|
|
|
|
|
|
+
|
|
|
this.uploadQueueDataSource.updateTasks(this.uploadQueue);
|
|
this.uploadQueueDataSource.updateTasks(this.uploadQueue);
|
|
|
-
|
|
|
|
|
|
|
+
|
|
|
Logger.info(TAG, `上传队列更新,当前数量: ${this.pendingCount}`);
|
|
Logger.info(TAG, `上传队列更新,当前数量: ${this.pendingCount}`);
|
|
|
}
|
|
}
|
|
|
|
|
|
|
@@ -463,11 +457,11 @@ export struct UploadMusicPage {
|
|
|
for (let i = 0; i < tasks.length; i++) {
|
|
for (let i = 0; i < tasks.length; i++) {
|
|
|
this.finishQueue.push(tasks[i].song);
|
|
this.finishQueue.push(tasks[i].song);
|
|
|
}
|
|
}
|
|
|
-
|
|
|
|
|
|
|
+
|
|
|
this.finishedCount = this.finishQueue.length;
|
|
this.finishedCount = this.finishQueue.length;
|
|
|
-
|
|
|
|
|
|
|
+
|
|
|
this.finishQueueDataSource.updateTasks(this.finishQueue);
|
|
this.finishQueueDataSource.updateTasks(this.finishQueue);
|
|
|
-
|
|
|
|
|
|
|
+
|
|
|
Logger.info(TAG, `完成队列更新,当前数量: ${this.finishedCount}`);
|
|
Logger.info(TAG, `完成队列更新,当前数量: ${this.finishedCount}`);
|
|
|
}
|
|
}
|
|
|
|
|
|
|
@@ -477,17 +471,17 @@ export struct UploadMusicPage {
|
|
|
private async openFilePicker(): Promise<void> {
|
|
private async openFilePicker(): Promise<void> {
|
|
|
try {
|
|
try {
|
|
|
const documentSelectOptions = new picker.DocumentSelectOptions();
|
|
const documentSelectOptions = new picker.DocumentSelectOptions();
|
|
|
-
|
|
|
|
|
|
|
+
|
|
|
// 设置音频文件过滤器
|
|
// 设置音频文件过滤器
|
|
|
documentSelectOptions.fileSuffixFilters = Constants.AUDIO_EXTENSIONS;
|
|
documentSelectOptions.fileSuffixFilters = Constants.AUDIO_EXTENSIONS;
|
|
|
-
|
|
|
|
|
|
|
+
|
|
|
// 支持多选
|
|
// 支持多选
|
|
|
documentSelectOptions.maxSelectNumber = 100;
|
|
documentSelectOptions.maxSelectNumber = 100;
|
|
|
|
|
|
|
|
const documentPicker = new picker.DocumentViewPicker();
|
|
const documentPicker = new picker.DocumentViewPicker();
|
|
|
-
|
|
|
|
|
|
|
+
|
|
|
const documentSelectResult = await documentPicker.select(documentSelectOptions);
|
|
const documentSelectResult = await documentPicker.select(documentSelectOptions);
|
|
|
-
|
|
|
|
|
|
|
+
|
|
|
if (documentSelectResult && documentSelectResult.length > 0) {
|
|
if (documentSelectResult && documentSelectResult.length > 0) {
|
|
|
for (let i = 0; i < documentSelectResult.length; i++) {
|
|
for (let i = 0; i < documentSelectResult.length; i++) {
|
|
|
try {
|
|
try {
|
|
@@ -498,10 +492,10 @@ export struct UploadMusicPage {
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
Logger.info(TAG, `选择了 ${documentSelectResult.length} 个文件`);
|
|
Logger.info(TAG, `选择了 ${documentSelectResult.length} 个文件`);
|
|
|
-
|
|
|
|
|
|
|
+
|
|
|
// 保存选中的文件URI
|
|
// 保存选中的文件URI
|
|
|
this.selectedFiles = documentSelectResult;
|
|
this.selectedFiles = documentSelectResult;
|
|
|
-
|
|
|
|
|
|
|
+
|
|
|
// 提取文件名用于显示
|
|
// 提取文件名用于显示
|
|
|
this.selectedFileNames = [];
|
|
this.selectedFileNames = [];
|
|
|
this.selectedFileTypes = [];
|
|
this.selectedFileTypes = [];
|
|
@@ -519,7 +513,7 @@ export struct UploadMusicPage {
|
|
|
this.selectedFileTypes.push('file');
|
|
this.selectedFileTypes.push('file');
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
-
|
|
|
|
|
|
|
+
|
|
|
Logger.info(TAG, `文件列表: ${JSON.stringify(this.selectedFileNames)}`);
|
|
Logger.info(TAG, `文件列表: ${JSON.stringify(this.selectedFileNames)}`);
|
|
|
}
|
|
}
|
|
|
} catch (error) {
|
|
} catch (error) {
|
|
@@ -570,13 +564,13 @@ export struct UploadMusicPage {
|
|
|
targetPath = this.localBrowseRoot;
|
|
targetPath = this.localBrowseRoot;
|
|
|
}
|
|
}
|
|
|
Logger.info(TAG, `加载目录: ${targetPath}`);
|
|
Logger.info(TAG, `加载目录: ${targetPath}`);
|
|
|
-
|
|
|
|
|
|
|
+
|
|
|
const files = fs.listFileSync(targetPath);
|
|
const files = fs.listFileSync(targetPath);
|
|
|
-
|
|
|
|
|
|
|
+
|
|
|
for (let i = 0; i < files.length; i++) {
|
|
for (let i = 0; i < files.length; i++) {
|
|
|
const fileName = files[i];
|
|
const fileName = files[i];
|
|
|
const fullPath = `${targetPath}/${fileName}`;
|
|
const fullPath = `${targetPath}/${fileName}`;
|
|
|
-
|
|
|
|
|
|
|
+
|
|
|
try {
|
|
try {
|
|
|
const stat = fs.statSync(fullPath);
|
|
const stat = fs.statSync(fullPath);
|
|
|
const isDirectory = stat.isDirectory();
|
|
const isDirectory = stat.isDirectory();
|
|
@@ -585,7 +579,7 @@ export struct UploadMusicPage {
|
|
|
}
|
|
}
|
|
|
const lowerFileName = fileName.toLowerCase();
|
|
const lowerFileName = fileName.toLowerCase();
|
|
|
const isAudioFile = !isDirectory && Constants.AUDIO_EXTENSIONS.some(ext => lowerFileName.endsWith(ext));
|
|
const isAudioFile = !isDirectory && Constants.AUDIO_EXTENSIONS.some(ext => lowerFileName.endsWith(ext));
|
|
|
-
|
|
|
|
|
|
|
+
|
|
|
// 只显示文件夹和音频文件
|
|
// 只显示文件夹和音频文件
|
|
|
if (isDirectory || isAudioFile) {
|
|
if (isDirectory || isAudioFile) {
|
|
|
this.browserFiles.push({
|
|
this.browserFiles.push({
|
|
@@ -599,14 +593,14 @@ export struct UploadMusicPage {
|
|
|
Logger.warn(TAG, `无法访问: ${fullPath}`);
|
|
Logger.warn(TAG, `无法访问: ${fullPath}`);
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
-
|
|
|
|
|
|
|
+
|
|
|
// 排序:文件夹在前,文件在后
|
|
// 排序:文件夹在前,文件在后
|
|
|
this.browserFiles.sort((a, b) => {
|
|
this.browserFiles.sort((a, b) => {
|
|
|
if (a.isDirectory && !b.isDirectory) return -1;
|
|
if (a.isDirectory && !b.isDirectory) return -1;
|
|
|
if (!a.isDirectory && b.isDirectory) return 1;
|
|
if (!a.isDirectory && b.isDirectory) return 1;
|
|
|
return a.name.localeCompare(b.name);
|
|
return a.name.localeCompare(b.name);
|
|
|
});
|
|
});
|
|
|
-
|
|
|
|
|
|
|
+
|
|
|
Logger.info(TAG, `加载了 ${this.browserFiles.length} 个项目`);
|
|
Logger.info(TAG, `加载了 ${this.browserFiles.length} 个项目`);
|
|
|
} catch (error) {
|
|
} catch (error) {
|
|
|
const err = error as Error;
|
|
const err = error as Error;
|
|
@@ -734,17 +728,17 @@ export struct UploadMusicPage {
|
|
|
*/
|
|
*/
|
|
|
private async scanFolderForAudioFiles(folderPath: string, relativePrefix: string = ''): Promise<LocalAudioFile[]> {
|
|
private async scanFolderForAudioFiles(folderPath: string, relativePrefix: string = ''): Promise<LocalAudioFile[]> {
|
|
|
const audioFiles: LocalAudioFile[] = [];
|
|
const audioFiles: LocalAudioFile[] = [];
|
|
|
-
|
|
|
|
|
|
|
+
|
|
|
try {
|
|
try {
|
|
|
const files = fs.listFileSync(folderPath);
|
|
const files = fs.listFileSync(folderPath);
|
|
|
-
|
|
|
|
|
|
|
+
|
|
|
for (let i = 0; i < files.length; i++) {
|
|
for (let i = 0; i < files.length; i++) {
|
|
|
const fileName = files[i];
|
|
const fileName = files[i];
|
|
|
const fullPath = `${folderPath}/${fileName}`;
|
|
const fullPath = `${folderPath}/${fileName}`;
|
|
|
-
|
|
|
|
|
|
|
+
|
|
|
try {
|
|
try {
|
|
|
const stat = fs.statSync(fullPath);
|
|
const stat = fs.statSync(fullPath);
|
|
|
-
|
|
|
|
|
|
|
+
|
|
|
if (stat.isDirectory()) {
|
|
if (stat.isDirectory()) {
|
|
|
const nextPrefix = relativePrefix ? `${relativePrefix}/${fileName}` : fileName;
|
|
const nextPrefix = relativePrefix ? `${relativePrefix}/${fileName}` : fileName;
|
|
|
const subFiles = await this.scanFolderForAudioFiles(fullPath, nextPrefix);
|
|
const subFiles = await this.scanFolderForAudioFiles(fullPath, nextPrefix);
|
|
@@ -769,7 +763,7 @@ export struct UploadMusicPage {
|
|
|
const err = error as Error;
|
|
const err = error as Error;
|
|
|
Logger.error(TAG, `扫描文件夹失败: ${err.message}`);
|
|
Logger.error(TAG, `扫描文件夹失败: ${err.message}`);
|
|
|
}
|
|
}
|
|
|
-
|
|
|
|
|
|
|
+
|
|
|
return audioFiles;
|
|
return audioFiles;
|
|
|
}
|
|
}
|
|
|
|
|
|
|
@@ -813,9 +807,9 @@ export struct UploadMusicPage {
|
|
|
const managerPath = this.webdavManager.currentPath;
|
|
const managerPath = this.webdavManager.currentPath;
|
|
|
if (
|
|
if (
|
|
|
managerPath &&
|
|
managerPath &&
|
|
|
- managerPath.length > 0 &&
|
|
|
|
|
- managerAccount &&
|
|
|
|
|
- managerAccount.id === account.id
|
|
|
|
|
|
|
+ managerPath.length > 0 &&
|
|
|
|
|
+ managerAccount &&
|
|
|
|
|
+ managerAccount.id === account.id
|
|
|
) {
|
|
) {
|
|
|
this.uploadPath = managerPath;
|
|
this.uploadPath = managerPath;
|
|
|
} else {
|
|
} else {
|
|
@@ -840,17 +834,17 @@ export struct UploadMusicPage {
|
|
|
const defaultPath =
|
|
const defaultPath =
|
|
|
managerAccount &&
|
|
managerAccount &&
|
|
|
managerAccount.id === this.selectedAccount.id &&
|
|
managerAccount.id === this.selectedAccount.id &&
|
|
|
- this.webdavManager.currentPath &&
|
|
|
|
|
|
|
+ this.webdavManager.currentPath &&
|
|
|
this.webdavManager.currentPath.length > 0
|
|
this.webdavManager.currentPath.length > 0
|
|
|
? this.webdavManager.currentPath
|
|
? this.webdavManager.currentPath
|
|
|
: this.uploadPath;
|
|
: this.uploadPath;
|
|
|
-
|
|
|
|
|
|
|
+
|
|
|
this.currentBrowsePath = defaultPath;
|
|
this.currentBrowsePath = defaultPath;
|
|
|
this.isShowPathBrowser = true;
|
|
this.isShowPathBrowser = true;
|
|
|
-
|
|
|
|
|
|
|
+
|
|
|
Logger.info(TAG, `isShowPathBrowser 设置为: ${this.isShowPathBrowser}`);
|
|
Logger.info(TAG, `isShowPathBrowser 设置为: ${this.isShowPathBrowser}`);
|
|
|
Logger.info(TAG, '开始加载文件夹列表...');
|
|
Logger.info(TAG, '开始加载文件夹列表...');
|
|
|
-
|
|
|
|
|
|
|
+
|
|
|
this.loadWebDavFolders(this.currentBrowsePath);
|
|
this.loadWebDavFolders(this.currentBrowsePath);
|
|
|
}
|
|
}
|
|
|
|
|
|
|
@@ -877,7 +871,7 @@ export struct UploadMusicPage {
|
|
|
Logger.info(TAG, `加载文件夹列表: ${path}`);
|
|
Logger.info(TAG, `加载文件夹列表: ${path}`);
|
|
|
|
|
|
|
|
await this.webdavManager.loadFilesInfoFromAccount(this.selectedAccount, path);
|
|
await this.webdavManager.loadFilesInfoFromAccount(this.selectedAccount, path);
|
|
|
-
|
|
|
|
|
|
|
+
|
|
|
// 过滤出文件夹
|
|
// 过滤出文件夹
|
|
|
const allFiles = this.webdavManager.webDavFiles;
|
|
const allFiles = this.webdavManager.webDavFiles;
|
|
|
this.browseFolders = [];
|
|
this.browseFolders = [];
|
|
@@ -959,7 +953,7 @@ export struct UploadMusicPage {
|
|
|
|
|
|
|
|
try {
|
|
try {
|
|
|
Logger.info(TAG, '开始上传任务');
|
|
Logger.info(TAG, '开始上传任务');
|
|
|
-
|
|
|
|
|
|
|
+
|
|
|
// 显示处理提示
|
|
// 显示处理提示
|
|
|
promptAction.showToast({
|
|
promptAction.showToast({
|
|
|
message: '正在处理文件...',
|
|
message: '正在处理文件...',
|
|
@@ -970,7 +964,7 @@ export struct UploadMusicPage {
|
|
|
const songs: VideoItem[] = [];
|
|
const songs: VideoItem[] = [];
|
|
|
let totalFiles = 0;
|
|
let totalFiles = 0;
|
|
|
let totalFolders = 0;
|
|
let totalFolders = 0;
|
|
|
-
|
|
|
|
|
|
|
+
|
|
|
for (let i = 0; i < this.selectedFiles.length; i++) {
|
|
for (let i = 0; i < this.selectedFiles.length; i++) {
|
|
|
const selectedUri = this.selectedFiles[i];
|
|
const selectedUri = this.selectedFiles[i];
|
|
|
const displayName = this.selectedFileNames[i];
|
|
const displayName = this.selectedFileNames[i];
|
|
@@ -979,7 +973,7 @@ export struct UploadMusicPage {
|
|
|
try {
|
|
try {
|
|
|
const fileUriObj = new fileUri.FileUri(selectedUri);
|
|
const fileUriObj = new fileUri.FileUri(selectedUri);
|
|
|
const resolvedPath = fileUriObj.path || '';
|
|
const resolvedPath = fileUriObj.path || '';
|
|
|
-
|
|
|
|
|
|
|
+
|
|
|
if (!resolvedPath) {
|
|
if (!resolvedPath) {
|
|
|
Logger.error(TAG, `无法获取本地路径,跳过: ${selectedUri}`);
|
|
Logger.error(TAG, `无法获取本地路径,跳过: ${selectedUri}`);
|
|
|
continue;
|
|
continue;
|
|
@@ -991,11 +985,11 @@ export struct UploadMusicPage {
|
|
|
Logger.info(TAG, `扫描文件夹: ${folderName}`);
|
|
Logger.info(TAG, `扫描文件夹: ${folderName}`);
|
|
|
const audioFiles = await this.scanFolderForAudioFiles(resolvedPath, folderName);
|
|
const audioFiles = await this.scanFolderForAudioFiles(resolvedPath, folderName);
|
|
|
Logger.info(TAG, `文件夹 ${folderName} 包含 ${audioFiles.length} 个音频文件`);
|
|
Logger.info(TAG, `文件夹 ${folderName} 包含 ${audioFiles.length} 个音频文件`);
|
|
|
-
|
|
|
|
|
|
|
+
|
|
|
for (let j = 0; j < audioFiles.length; j++) {
|
|
for (let j = 0; j < audioFiles.length; j++) {
|
|
|
const audioFile = audioFiles[j];
|
|
const audioFile = audioFiles[j];
|
|
|
const audioFileName = this.getFileNameFromPath(audioFile.fullPath);
|
|
const audioFileName = this.getFileNameFromPath(audioFile.fullPath);
|
|
|
-
|
|
|
|
|
|
|
+
|
|
|
const videoItem = new VideoItem(
|
|
const videoItem = new VideoItem(
|
|
|
audioFileName,
|
|
audioFileName,
|
|
|
`file://${audioFile.fullPath}`,
|
|
`file://${audioFile.fullPath}`,
|
|
@@ -1050,7 +1044,7 @@ export struct UploadMusicPage {
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
Logger.info(TAG, `处理完成: ${totalFiles} 个文件, ${totalFolders} 个文件夹, 共 ${songs.length} 个音频文件`);
|
|
Logger.info(TAG, `处理完成: ${totalFiles} 个文件, ${totalFolders} 个文件夹, 共 ${songs.length} 个音频文件`);
|
|
|
-
|
|
|
|
|
|
|
+
|
|
|
promptAction.showToast({
|
|
promptAction.showToast({
|
|
|
message: `准备上传 ${songs.length} 个文件`,
|
|
message: `准备上传 ${songs.length} 个文件`,
|
|
|
duration: 2000
|
|
duration: 2000
|
|
@@ -1058,9 +1052,9 @@ export struct UploadMusicPage {
|
|
|
|
|
|
|
|
// 添加到上传队列,传递用户选择的上传路径
|
|
// 添加到上传队列,传递用户选择的上传路径
|
|
|
Logger.info(TAG, `使用上传路径: ${this.uploadPath}`);
|
|
Logger.info(TAG, `使用上传路径: ${this.uploadPath}`);
|
|
|
- const uniqueSongs = this.deduplicateSongs(songs);
|
|
|
|
|
- this.webdavManager.addToUploadQueue(uniqueSongs, this.selectedAccount, this.uploadPath);
|
|
|
|
|
- this.totalUploadCount = uniqueSongs.length;
|
|
|
|
|
|
|
+ const uniqueSongs = this.deduplicateSongs(songs);
|
|
|
|
|
+ this.webdavManager.addToUploadQueue(uniqueSongs, this.selectedAccount, this.uploadPath);
|
|
|
|
|
+ this.totalUploadCount = uniqueSongs.length;
|
|
|
this.uploadedCount = 0;
|
|
this.uploadedCount = 0;
|
|
|
|
|
|
|
|
// 开始处理上传队列
|
|
// 开始处理上传队列
|
|
@@ -1320,7 +1314,12 @@ export struct UploadMusicPage {
|
|
|
.fontSize(12)
|
|
.fontSize(12)
|
|
|
.fontWeight(FontWeight.Medium)
|
|
.fontWeight(FontWeight.Medium)
|
|
|
.fontColor('#FFFFFF')
|
|
.fontColor('#FFFFFF')
|
|
|
- .padding({ left: 6, right: 6, top: 2, bottom: 2 })
|
|
|
|
|
|
|
+ .padding({
|
|
|
|
|
+ left: 6,
|
|
|
|
|
+ right: 6,
|
|
|
|
|
+ top: 2,
|
|
|
|
|
+ bottom: 2
|
|
|
|
|
+ })
|
|
|
.backgroundColor(this.themeColor)
|
|
.backgroundColor(this.themeColor)
|
|
|
.borderRadius(8)
|
|
.borderRadius(8)
|
|
|
}
|
|
}
|
|
@@ -1462,13 +1461,12 @@ export struct UploadMusicPage {
|
|
|
(this.isDarkMode ? '#E5FFFFFF' : '#1F1F1F') :
|
|
(this.isDarkMode ? '#E5FFFFFF' : '#1F1F1F') :
|
|
|
(this.isDarkMode ? '#66FFFFFF' : '#99000000'))
|
|
(this.isDarkMode ? '#66FFFFFF' : '#99000000'))
|
|
|
.fontWeight(this.uploadPath ? FontWeight.Medium : FontWeight.Regular)
|
|
.fontWeight(this.uploadPath ? FontWeight.Medium : FontWeight.Regular)
|
|
|
- .layoutWeight(1)
|
|
|
|
|
.maxLines(1)
|
|
.maxLines(1)
|
|
|
.textOverflow({ overflow: TextOverflow.Ellipsis })
|
|
.textOverflow({ overflow: TextOverflow.Ellipsis })
|
|
|
}
|
|
}
|
|
|
- .width('100%')
|
|
|
|
|
|
|
+
|
|
|
Blank()
|
|
Blank()
|
|
|
-
|
|
|
|
|
|
|
+
|
|
|
Button('浏览')
|
|
Button('浏览')
|
|
|
.fontSize(13)
|
|
.fontSize(13)
|
|
|
.height(32)
|
|
.height(32)
|
|
@@ -1478,12 +1476,13 @@ export struct UploadMusicPage {
|
|
|
.borderRadius(6)
|
|
.borderRadius(6)
|
|
|
.enabled(this.selectedAccount !== null)
|
|
.enabled(this.selectedAccount !== null)
|
|
|
.opacity(this.selectedAccount !== null ? 1.0 : 0.4)
|
|
.opacity(this.selectedAccount !== null ? 1.0 : 0.4)
|
|
|
- .bindContentCover(this.isShowPathBrowser, this.PathBrowserDialogBuilder(), {
|
|
|
|
|
- modalTransition: ModalTransition.DEFAULT,
|
|
|
|
|
- onDisappear: () => {
|
|
|
|
|
- Logger.info(TAG, 'PathBrowser onDisappear 回调');
|
|
|
|
|
- this.isShowPathBrowser = false;
|
|
|
|
|
- }
|
|
|
|
|
|
|
+ .bindSheet($$this.isShowPathBrowser, this.PathBrowserDialog(), {
|
|
|
|
|
+ height: '90%',
|
|
|
|
|
+ dragBar: true,
|
|
|
|
|
+ showClose: true,
|
|
|
|
|
+ preferType: SheetType.BOTTOM,
|
|
|
|
|
+ blurStyle: BlurStyle.Thin,
|
|
|
|
|
+ title: { title: '选择上传路径' }
|
|
|
})
|
|
})
|
|
|
.onClick(() => {
|
|
.onClick(() => {
|
|
|
this.openPathBrowser();
|
|
this.openPathBrowser();
|
|
@@ -1497,8 +1496,8 @@ export struct UploadMusicPage {
|
|
|
.borderRadius(10)
|
|
.borderRadius(10)
|
|
|
.border({
|
|
.border({
|
|
|
width: 1,
|
|
width: 1,
|
|
|
- color: this.uploadPath ?
|
|
|
|
|
- (this.isDarkMode ? this.themeColor + '40' : this.themeColor + '30') :
|
|
|
|
|
|
|
+ color: this.uploadPath ?
|
|
|
|
|
+ (this.isDarkMode ? this.themeColor + '40' : this.themeColor + '30') :
|
|
|
(this.isDarkMode ? '#19FFFFFF' : '#E5E5EA')
|
|
(this.isDarkMode ? '#19FFFFFF' : '#E5E5EA')
|
|
|
})
|
|
})
|
|
|
|
|
|
|
@@ -1543,36 +1542,13 @@ export struct UploadMusicPage {
|
|
|
@Builder
|
|
@Builder
|
|
|
PathBrowserDialog() {
|
|
PathBrowserDialog() {
|
|
|
Column() {
|
|
Column() {
|
|
|
- // 标题栏
|
|
|
|
|
- Row({ space: 12 }) {
|
|
|
|
|
- Text('选择上传路径')
|
|
|
|
|
- .fontSize(18)
|
|
|
|
|
- .fontWeight(FontWeight.Bold)
|
|
|
|
|
- .fontColor(this.isDarkMode ? '#E5FFFFFF' : '#E5000000')
|
|
|
|
|
- .layoutWeight(1)
|
|
|
|
|
-
|
|
|
|
|
- Button('关闭')
|
|
|
|
|
- .fontSize(14)
|
|
|
|
|
- .height(36)
|
|
|
|
|
- .padding({ left: 16, right: 16 })
|
|
|
|
|
- .backgroundColor(this.isDarkMode ? '#2E3033' : '#E5E5EA')
|
|
|
|
|
- .fontColor(this.isDarkMode ? '#E5FFFFFF' : '#E5000000')
|
|
|
|
|
- .borderRadius(8)
|
|
|
|
|
- .onClick(() => {
|
|
|
|
|
- this.closePathBrowser();
|
|
|
|
|
- })
|
|
|
|
|
- }
|
|
|
|
|
- .width('100%')
|
|
|
|
|
- .padding(16)
|
|
|
|
|
- .backgroundColor(this.isDarkMode ? '#23272E' : '#FFFFFF')
|
|
|
|
|
-
|
|
|
|
|
// 当前路径显示
|
|
// 当前路径显示
|
|
|
Row({ space: 12 }) {
|
|
Row({ space: 12 }) {
|
|
|
Column({ space: 4 }) {
|
|
Column({ space: 4 }) {
|
|
|
Text('当前路径')
|
|
Text('当前路径')
|
|
|
.fontSize(12)
|
|
.fontSize(12)
|
|
|
.fontColor(this.isDarkMode ? '#66FFFFFF' : '#66000000')
|
|
.fontColor(this.isDarkMode ? '#66FFFFFF' : '#66000000')
|
|
|
-
|
|
|
|
|
|
|
+
|
|
|
Text(this.currentBrowsePath)
|
|
Text(this.currentBrowsePath)
|
|
|
.fontSize(14)
|
|
.fontSize(14)
|
|
|
.fontColor(this.isDarkMode ? '#E5FFFFFF' : '#E5000000')
|
|
.fontColor(this.isDarkMode ? '#E5FFFFFF' : '#E5000000')
|
|
@@ -1581,7 +1557,7 @@ export struct UploadMusicPage {
|
|
|
}
|
|
}
|
|
|
.alignItems(HorizontalAlign.Start)
|
|
.alignItems(HorizontalAlign.Start)
|
|
|
.layoutWeight(1)
|
|
.layoutWeight(1)
|
|
|
-
|
|
|
|
|
|
|
+
|
|
|
if (this.currentBrowsePath !== '/') {
|
|
if (this.currentBrowsePath !== '/') {
|
|
|
Button('返回上级')
|
|
Button('返回上级')
|
|
|
.fontSize(12)
|
|
.fontSize(12)
|
|
@@ -1606,7 +1582,7 @@ export struct UploadMusicPage {
|
|
|
.width(48)
|
|
.width(48)
|
|
|
.height(48)
|
|
.height(48)
|
|
|
.color(this.themeColor)
|
|
.color(this.themeColor)
|
|
|
-
|
|
|
|
|
|
|
+
|
|
|
Text('加载中...')
|
|
Text('加载中...')
|
|
|
.fontSize(14)
|
|
.fontSize(14)
|
|
|
.fontColor(this.isDarkMode ? '#99FFFFFF' : '#99000000')
|
|
.fontColor(this.isDarkMode ? '#99FFFFFF' : '#99000000')
|
|
@@ -1620,7 +1596,7 @@ export struct UploadMusicPage {
|
|
|
Text('📂')
|
|
Text('📂')
|
|
|
.fontSize(48)
|
|
.fontSize(48)
|
|
|
.margin({ bottom: 12 })
|
|
.margin({ bottom: 12 })
|
|
|
-
|
|
|
|
|
|
|
+
|
|
|
Text('当前目录没有子文件夹')
|
|
Text('当前目录没有子文件夹')
|
|
|
.fontSize(14)
|
|
.fontSize(14)
|
|
|
.fontColor(this.isDarkMode ? '#66FFFFFF' : '#66000000')
|
|
.fontColor(this.isDarkMode ? '#66FFFFFF' : '#66000000')
|
|
@@ -1659,7 +1635,7 @@ export struct UploadMusicPage {
|
|
|
}, (folder: FileInfo, index: number) => `folder-${index}-${folder.fileName}`)
|
|
}, (folder: FileInfo, index: number) => `folder-${index}-${folder.fileName}`)
|
|
|
}
|
|
}
|
|
|
.width('100%')
|
|
.width('100%')
|
|
|
- .height(300)
|
|
|
|
|
|
|
+ .layoutWeight(1)
|
|
|
.padding(16)
|
|
.padding(16)
|
|
|
.backgroundColor(this.isDarkMode ? '#23272E' : '#FFFFFF')
|
|
.backgroundColor(this.isDarkMode ? '#23272E' : '#FFFFFF')
|
|
|
.divider({
|
|
.divider({
|
|
@@ -1694,18 +1670,7 @@ export struct UploadMusicPage {
|
|
|
}
|
|
}
|
|
|
.width('100%')
|
|
.width('100%')
|
|
|
.padding(16)
|
|
.padding(16)
|
|
|
- .backgroundColor(this.isDarkMode ? '#23272E' : '#FFFFFF')
|
|
|
|
|
}
|
|
}
|
|
|
- .width('90%')
|
|
|
|
|
- .constraintSize({ maxWidth: 600 })
|
|
|
|
|
- .backgroundColor(this.isDarkMode ? '#191A1C' : '#FFFFFF')
|
|
|
|
|
- .borderRadius(16)
|
|
|
|
|
- .shadow({
|
|
|
|
|
- radius: 24,
|
|
|
|
|
- color: this.isDarkMode ? '#33000000' : '#19000000',
|
|
|
|
|
- offsetX: 0,
|
|
|
|
|
- offsetY: 8
|
|
|
|
|
- })
|
|
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
/**
|
|
@@ -1729,11 +1694,11 @@ export struct UploadMusicPage {
|
|
|
Column({ space: 12 }) {
|
|
Column({ space: 12 }) {
|
|
|
Text('📦')
|
|
Text('📦')
|
|
|
.fontSize(48)
|
|
.fontSize(48)
|
|
|
-
|
|
|
|
|
|
|
+
|
|
|
Text('暂无账户')
|
|
Text('暂无账户')
|
|
|
.fontSize(16)
|
|
.fontSize(16)
|
|
|
.fontColor(this.isDarkMode ? '#99FFFFFF' : '#99000000')
|
|
.fontColor(this.isDarkMode ? '#99FFFFFF' : '#99000000')
|
|
|
-
|
|
|
|
|
|
|
+
|
|
|
Text('请先添加账户')
|
|
Text('请先添加账户')
|
|
|
.fontSize(14)
|
|
.fontSize(14)
|
|
|
.fontColor(this.isDarkMode ? '#66FFFFFF' : '#66000000')
|
|
.fontColor(this.isDarkMode ? '#66FFFFFF' : '#66000000')
|
|
@@ -1755,7 +1720,7 @@ export struct UploadMusicPage {
|
|
|
.fontSize(14)
|
|
.fontSize(14)
|
|
|
.fontWeight(FontWeight.Medium)
|
|
.fontWeight(FontWeight.Medium)
|
|
|
.fontColor(this.isDarkMode ? '#E5FFFFFF' : '#1F1F1F')
|
|
.fontColor(this.isDarkMode ? '#E5FFFFFF' : '#1F1F1F')
|
|
|
-
|
|
|
|
|
|
|
+
|
|
|
Text(`${account.host}:${account.port}`)
|
|
Text(`${account.host}:${account.port}`)
|
|
|
.fontSize(11)
|
|
.fontSize(11)
|
|
|
.fontColor(this.isDarkMode ? '#66FFFFFF' : '#8E8E93')
|
|
.fontColor(this.isDarkMode ? '#66FFFFFF' : '#8E8E93')
|
|
@@ -1850,7 +1815,7 @@ export struct UploadMusicPage {
|
|
|
Row({ space: 6 }) {
|
|
Row({ space: 6 }) {
|
|
|
Text('📁')
|
|
Text('📁')
|
|
|
.fontSize(16)
|
|
.fontSize(16)
|
|
|
- Text('浏览选择')
|
|
|
|
|
|
|
+ Text('浏览选择')
|
|
|
.fontSize(14)
|
|
.fontSize(14)
|
|
|
.fontWeight(FontWeight.Medium)
|
|
.fontWeight(FontWeight.Medium)
|
|
|
}
|
|
}
|
|
@@ -1878,13 +1843,13 @@ export struct UploadMusicPage {
|
|
|
Text('✓')
|
|
Text('✓')
|
|
|
.fontSize(18)
|
|
.fontSize(18)
|
|
|
.fontColor(this.themeColor)
|
|
.fontColor(this.themeColor)
|
|
|
-
|
|
|
|
|
|
|
+
|
|
|
Column({ space: 2 }) {
|
|
Column({ space: 2 }) {
|
|
|
Text(`已选择 ${this.selectedFiles.length} 项`)
|
|
Text(`已选择 ${this.selectedFiles.length} 项`)
|
|
|
.fontSize(14)
|
|
.fontSize(14)
|
|
|
.fontWeight(FontWeight.Medium)
|
|
.fontWeight(FontWeight.Medium)
|
|
|
.fontColor(this.isDarkMode ? '#E5FFFFFF' : '#1F1F1F')
|
|
.fontColor(this.isDarkMode ? '#E5FFFFFF' : '#1F1F1F')
|
|
|
-
|
|
|
|
|
|
|
+
|
|
|
Row({ space: 8 }) {
|
|
Row({ space: 8 }) {
|
|
|
if (this.selectedFileTypes.filter(t => t === 'file').length > 0) {
|
|
if (this.selectedFileTypes.filter(t => t === 'file').length > 0) {
|
|
|
Text(`${this.selectedFileTypes.filter(t => t === 'file').length} 个文件`)
|
|
Text(`${this.selectedFileTypes.filter(t => t === 'file').length} 个文件`)
|
|
@@ -1937,14 +1902,19 @@ export struct UploadMusicPage {
|
|
|
.fontSize(16)
|
|
.fontSize(16)
|
|
|
.fontWeight(FontWeight.Medium)
|
|
.fontWeight(FontWeight.Medium)
|
|
|
.fontColor(this.isDarkMode ? '#E5FFFFFF' : '#E5000000')
|
|
.fontColor(this.isDarkMode ? '#E5FFFFFF' : '#E5000000')
|
|
|
-
|
|
|
|
|
|
|
+
|
|
|
Blank()
|
|
Blank()
|
|
|
-
|
|
|
|
|
|
|
+
|
|
|
Text(`${this.selectedFiles.length}`)
|
|
Text(`${this.selectedFiles.length}`)
|
|
|
.fontSize(13)
|
|
.fontSize(13)
|
|
|
.fontWeight(FontWeight.Medium)
|
|
.fontWeight(FontWeight.Medium)
|
|
|
.fontColor('#FFFFFF')
|
|
.fontColor('#FFFFFF')
|
|
|
- .padding({ left: 8, right: 8, top: 4, bottom: 4 })
|
|
|
|
|
|
|
+ .padding({
|
|
|
|
|
+ left: 8,
|
|
|
|
|
+ right: 8,
|
|
|
|
|
+ top: 4,
|
|
|
|
|
+ bottom: 4
|
|
|
|
|
+ })
|
|
|
.backgroundColor(this.themeColor)
|
|
.backgroundColor(this.themeColor)
|
|
|
.borderRadius(10)
|
|
.borderRadius(10)
|
|
|
}
|
|
}
|
|
@@ -1966,7 +1936,7 @@ export struct UploadMusicPage {
|
|
|
.fontColor(this.isDarkMode ? '#E5FFFFFF' : '#1F1F1F')
|
|
.fontColor(this.isDarkMode ? '#E5FFFFFF' : '#1F1F1F')
|
|
|
.maxLines(1)
|
|
.maxLines(1)
|
|
|
.textOverflow({ overflow: TextOverflow.Ellipsis })
|
|
.textOverflow({ overflow: TextOverflow.Ellipsis })
|
|
|
-
|
|
|
|
|
|
|
+
|
|
|
if (this.selectedFileTypes[index] === 'folder') {
|
|
if (this.selectedFileTypes[index] === 'folder') {
|
|
|
Text('文件夹')
|
|
Text('文件夹')
|
|
|
.fontSize(12)
|
|
.fontSize(12)
|
|
@@ -2068,17 +2038,18 @@ export struct UploadMusicPage {
|
|
|
.width('100%')
|
|
.width('100%')
|
|
|
.height('100%')
|
|
.height('100%')
|
|
|
.backgroundColor(this.isDarkMode ? '#191A1C' : '#F1F3F5')
|
|
.backgroundColor(this.isDarkMode ? '#191A1C' : '#F1F3F5')
|
|
|
- .bindContentCover(this.isShowFileBrowser, this.FileBrowserDialogBuilder(), {
|
|
|
|
|
- modalTransition: ModalTransition.DEFAULT,
|
|
|
|
|
- onDisappear: () => {
|
|
|
|
|
- Logger.info(TAG, 'FileBrowser onDisappear 回调');
|
|
|
|
|
- this.isShowFileBrowser = false;
|
|
|
|
|
- }
|
|
|
|
|
|
|
+ .bindSheet($$this.isShowFileBrowser, this.FileBrowserDialog(), {
|
|
|
|
|
+ height: '95%',
|
|
|
|
|
+ dragBar: true,
|
|
|
|
|
+ showClose: true,
|
|
|
|
|
+ preferType: SheetType.BOTTOM,
|
|
|
|
|
+ blurStyle: BlurStyle.Thin,
|
|
|
|
|
+ title: { title: '浏览选择文件' }
|
|
|
})
|
|
})
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
@Builder
|
|
@Builder
|
|
|
- topTitleBar(){
|
|
|
|
|
|
|
+ topTitleBar() {
|
|
|
Column() {
|
|
Column() {
|
|
|
Row({ space: 15 }) {
|
|
Row({ space: 15 }) {
|
|
|
|
|
|
|
@@ -2088,7 +2059,7 @@ export struct UploadMusicPage {
|
|
|
.attributeModifier(new SymbolGlyphFancyModifier(25, '', ''))
|
|
.attributeModifier(new SymbolGlyphFancyModifier(25, '', ''))
|
|
|
}
|
|
}
|
|
|
.attributeModifier(new ButtonFancyModifier(40, 40))
|
|
.attributeModifier(new ButtonFancyModifier(40, 40))
|
|
|
- .clickEffect({ level: ClickEffectLevel.MIDDLE,scale:0.6 })
|
|
|
|
|
|
|
+ .clickEffect({ level: ClickEffectLevel.MIDDLE, scale: 0.6 })
|
|
|
.animation({ duration: 300, curve: Curve.Ease })
|
|
.animation({ duration: 300, curve: Curve.Ease })
|
|
|
.onClick(() => {
|
|
.onClick(() => {
|
|
|
this.getUIContext().getRouter().back();
|
|
this.getUIContext().getRouter().back();
|
|
@@ -2097,42 +2068,24 @@ export struct UploadMusicPage {
|
|
|
.zIndex(0)
|
|
.zIndex(0)
|
|
|
|
|
|
|
|
Text('上传音乐')
|
|
Text('上传音乐')
|
|
|
- .margin({left:3,right:10})
|
|
|
|
|
|
|
+ .margin({ left: 3, right: 10 })
|
|
|
.fontColor($r('app.color.text_color'))
|
|
.fontColor($r('app.color.text_color'))
|
|
|
.fontSize(19)
|
|
.fontSize(19)
|
|
|
.maxLines(1)
|
|
.maxLines(1)
|
|
|
.textOverflow({ overflow: TextOverflow.MARQUEE })//超长滚动
|
|
.textOverflow({ overflow: TextOverflow.MARQUEE })//超长滚动
|
|
|
.layoutWeight(1)
|
|
.layoutWeight(1)
|
|
|
- .clickEffect({ level: ClickEffectLevel.MIDDLE,scale:0.6 })
|
|
|
|
|
|
|
+ .clickEffect({ level: ClickEffectLevel.MIDDLE, scale: 0.6 })
|
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
- .padding({ top: this.topSafeHeight+10, left: 10, right: 10,bottom:12 })
|
|
|
|
|
- .width('100%')
|
|
|
|
|
- }
|
|
|
|
|
-
|
|
|
|
|
-
|
|
|
|
|
- @Builder
|
|
|
|
|
- PathBrowserDialogBuilder() {
|
|
|
|
|
- Stack() {
|
|
|
|
|
- // 背景层
|
|
|
|
|
- Column()
|
|
|
|
|
- .width('100%')
|
|
|
|
|
- .height('100%')
|
|
|
|
|
- .backgroundColor('rgba(0, 0, 0, 0.5)')
|
|
|
|
|
-
|
|
|
|
|
- // 对话框内容(居中显示)
|
|
|
|
|
- Column() {
|
|
|
|
|
- this.PathBrowserDialog()
|
|
|
|
|
- }
|
|
|
|
|
- .width('100%')
|
|
|
|
|
- .height('100%')
|
|
|
|
|
- .justifyContent(FlexAlign.Center)
|
|
|
|
|
- .alignItems(HorizontalAlign.Center)
|
|
|
|
|
- }
|
|
|
|
|
|
|
+ .padding({
|
|
|
|
|
+ top: this.topSafeHeight + 10,
|
|
|
|
|
+ left: 10,
|
|
|
|
|
+ right: 10,
|
|
|
|
|
+ bottom: 12
|
|
|
|
|
+ })
|
|
|
.width('100%')
|
|
.width('100%')
|
|
|
- .height('100%')
|
|
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
/**
|
|
@@ -2141,36 +2094,13 @@ export struct UploadMusicPage {
|
|
|
@Builder
|
|
@Builder
|
|
|
FileBrowserDialog() {
|
|
FileBrowserDialog() {
|
|
|
Column() {
|
|
Column() {
|
|
|
- // 标题栏
|
|
|
|
|
- Row({ space: 12 }) {
|
|
|
|
|
- Text('浏览选择文件')
|
|
|
|
|
- .fontSize(18)
|
|
|
|
|
- .fontWeight(FontWeight.Bold)
|
|
|
|
|
- .fontColor(this.isDarkMode ? '#E5FFFFFF' : '#1F1F1F')
|
|
|
|
|
- .layoutWeight(1)
|
|
|
|
|
-
|
|
|
|
|
- Button('关闭')
|
|
|
|
|
- .fontSize(14)
|
|
|
|
|
- .height(36)
|
|
|
|
|
- .padding({ left: 16, right: 16 })
|
|
|
|
|
- .backgroundColor(this.isDarkMode ? '#2E3238' : '#E5E5EA')
|
|
|
|
|
- .fontColor(this.isDarkMode ? '#E5FFFFFF' : '#1F1F1F')
|
|
|
|
|
- .borderRadius(8)
|
|
|
|
|
- .onClick(() => {
|
|
|
|
|
- this.closeFileBrowser();
|
|
|
|
|
- })
|
|
|
|
|
- }
|
|
|
|
|
- .width('100%')
|
|
|
|
|
- .padding(16)
|
|
|
|
|
- .backgroundColor(this.isDarkMode ? '#23272E' : '#FFFFFF')
|
|
|
|
|
-
|
|
|
|
|
// 当前路径和返回按钮
|
|
// 当前路径和返回按钮
|
|
|
Row({ space: 12 }) {
|
|
Row({ space: 12 }) {
|
|
|
Column({ space: 4 }) {
|
|
Column({ space: 4 }) {
|
|
|
Text('当前目录')
|
|
Text('当前目录')
|
|
|
.fontSize(12)
|
|
.fontSize(12)
|
|
|
.fontColor(this.isDarkMode ? '#66FFFFFF' : '#8E8E93')
|
|
.fontColor(this.isDarkMode ? '#66FFFFFF' : '#8E8E93')
|
|
|
-
|
|
|
|
|
|
|
+
|
|
|
Text(this.fileBrowserPath)
|
|
Text(this.fileBrowserPath)
|
|
|
.fontSize(13)
|
|
.fontSize(13)
|
|
|
.fontColor(this.isDarkMode ? '#E5FFFFFF' : '#1F1F1F')
|
|
.fontColor(this.isDarkMode ? '#E5FFFFFF' : '#1F1F1F')
|
|
@@ -2204,7 +2134,7 @@ export struct UploadMusicPage {
|
|
|
.width(48)
|
|
.width(48)
|
|
|
.height(48)
|
|
.height(48)
|
|
|
.color(this.themeColor)
|
|
.color(this.themeColor)
|
|
|
-
|
|
|
|
|
|
|
+
|
|
|
Text('加载中...')
|
|
Text('加载中...')
|
|
|
.fontSize(14)
|
|
.fontSize(14)
|
|
|
.fontColor(this.isDarkMode ? '#99FFFFFF' : '#8E8E93')
|
|
.fontColor(this.isDarkMode ? '#99FFFFFF' : '#8E8E93')
|
|
@@ -2217,7 +2147,7 @@ export struct UploadMusicPage {
|
|
|
Column({ space: 12 }) {
|
|
Column({ space: 12 }) {
|
|
|
Text('📂')
|
|
Text('📂')
|
|
|
.fontSize(48)
|
|
.fontSize(48)
|
|
|
-
|
|
|
|
|
|
|
+
|
|
|
Text('当前目录为空')
|
|
Text('当前目录为空')
|
|
|
.fontSize(14)
|
|
.fontSize(14)
|
|
|
.fontColor(this.isDarkMode ? '#66FFFFFF' : '#8E8E93')
|
|
.fontColor(this.isDarkMode ? '#66FFFFFF' : '#8E8E93')
|
|
@@ -2251,7 +2181,7 @@ export struct UploadMusicPage {
|
|
|
.fontColor(this.isDarkMode ? '#E5FFFFFF' : '#1F1F1F')
|
|
.fontColor(this.isDarkMode ? '#E5FFFFFF' : '#1F1F1F')
|
|
|
.maxLines(1)
|
|
.maxLines(1)
|
|
|
.textOverflow({ overflow: TextOverflow.Ellipsis })
|
|
.textOverflow({ overflow: TextOverflow.Ellipsis })
|
|
|
-
|
|
|
|
|
|
|
+
|
|
|
if (item.isDirectory) {
|
|
if (item.isDirectory) {
|
|
|
Text('文件夹')
|
|
Text('文件夹')
|
|
|
.fontSize(12)
|
|
.fontSize(12)
|
|
@@ -2292,7 +2222,7 @@ export struct UploadMusicPage {
|
|
|
}, (item: LocalFileItem, index: number) => `${index}-${item.path}`)
|
|
}, (item: LocalFileItem, index: number) => `${index}-${item.path}`)
|
|
|
}
|
|
}
|
|
|
.width('100%')
|
|
.width('100%')
|
|
|
- .height(400)
|
|
|
|
|
|
|
+ .layoutWeight(1)
|
|
|
.padding(16)
|
|
.padding(16)
|
|
|
.backgroundColor(this.isDarkMode ? '#23272E' : '#FFFFFF')
|
|
.backgroundColor(this.isDarkMode ? '#23272E' : '#FFFFFF')
|
|
|
}
|
|
}
|
|
@@ -2330,38 +2260,6 @@ export struct UploadMusicPage {
|
|
|
}
|
|
}
|
|
|
.width('100%')
|
|
.width('100%')
|
|
|
.padding(16)
|
|
.padding(16)
|
|
|
- .backgroundColor(this.isDarkMode ? '#23272E' : '#FFFFFF')
|
|
|
|
|
}
|
|
}
|
|
|
- .width('90%')
|
|
|
|
|
- .constraintSize({ maxWidth: 700, maxHeight: '80%' })
|
|
|
|
|
- .backgroundColor(this.isDarkMode ? '#191A1C' : '#FFFFFF')
|
|
|
|
|
- .borderRadius(16)
|
|
|
|
|
- .shadow({
|
|
|
|
|
- radius: 24,
|
|
|
|
|
- color: this.isDarkMode ? '#33000000' : '#19000000',
|
|
|
|
|
- offsetX: 0,
|
|
|
|
|
- offsetY: 8
|
|
|
|
|
- })
|
|
|
|
|
}
|
|
}
|
|
|
-
|
|
|
|
|
- @Builder
|
|
|
|
|
- FileBrowserDialogBuilder() {
|
|
|
|
|
- Stack() {
|
|
|
|
|
- // 背景层(不添加 onClick,避免误关闭)
|
|
|
|
|
- Column()
|
|
|
|
|
- .width('100%')
|
|
|
|
|
- .height('100%')
|
|
|
|
|
- .backgroundColor('rgba(0, 0, 0, 0.5)')
|
|
|
|
|
-
|
|
|
|
|
- // 对话框内容(居中显示)
|
|
|
|
|
- Column() {
|
|
|
|
|
- this.FileBrowserDialog()
|
|
|
|
|
- }
|
|
|
|
|
- .width('100%')
|
|
|
|
|
- .height('100%')
|
|
|
|
|
- .justifyContent(FlexAlign.Center)
|
|
|
|
|
- }
|
|
|
|
|
- .width('100%')
|
|
|
|
|
- .height('100%')
|
|
|
|
|
- }
|
|
|
|
|
-}
|
|
|
|
|
|
|
+}
|