onecold 8 mesi fa
parent
commit
48e8429b80
1 ha cambiato i file con 35 aggiunte e 14 eliminazioni
  1. 35 14
      entry/src/main/ets/pages/UploadMusicPage.ets

+ 35 - 14
entry/src/main/ets/pages/UploadMusicPage.ets

@@ -79,6 +79,8 @@ export struct UploadMusicPage {
   @State isLoadingFolders: boolean = false;
   @State pendingCount: number = 0;
   @State finishedCount: number = 0;
+  // 任务队列Tab选择
+  @State @Watch('onQueueTabChange') selectedQueueIndex: number[] = [0];
   // 上传速度计算相关变量
   private lastUploadTime: number = 0;
   private lastUploadedSize: number = 0;
@@ -109,6 +111,11 @@ export struct UploadMusicPage {
     }
   }
 
+  // 任务队列Tab变化监听
+  onQueueTabChange() {
+    // 可以在这里添加Tab变化的逻辑
+  }
+
   // 获取当前重复文件处理方式的描述
   private getActionDescription(): string {
     switch (this.duplicateAction) {
@@ -1330,22 +1337,33 @@ export struct UploadMusicPage {
       }
       .alignSelf(ItemAlign.Start)
 
-      Tabs({ barPosition: BarPosition.Start }) {
-        TabContent() {
-          this.QueueList(this.uploadQueueDataSource, 'pending')
-        }
-        .tabBar(this.TabBarBuilder('⏳', '待上传', this.pendingCount))
+      // 任务队列SegmentButton
+      Column({ space: 12 }) {
+        SegmentButton({
+          options: SegmentButtonOptions.capsule({
+            buttons: [
+              { text: '待上传' },
+              { text: '已完成' }
+            ] as SegmentButtonItemTuple,
+            backgroundColor: $r('app.color.index_background'),
+            selectedBackgroundColor: $r('app.color.start_window_background'),
+            selectedFontColor: $r('app.color.text_color'),
+            buttonPadding: { top: 10, bottom: 10 },
+            multiply: false
+          }),
+          selectedIndexes: $selectedQueueIndex
+        })
+          .width('100%')
+          .margin({ bottom: 12 })
 
-        TabContent() {
+        // 内容区域
+        if (this.selectedQueueIndex[0] === 0) {
+          this.QueueList(this.uploadQueueDataSource, 'pending')
+        } else {
           this.QueueList(this.finishQueueDataSource, 'finished')
         }
-        .tabBar(this.TabBarBuilder('✅', '已完成', this.finishedCount))
       }
-      .width('100%')
       .height(300)
-      .barMode(BarMode.Fixed)
-      .barBackgroundColor(this.isDarkMode ? '#23272E' : '#FFFFFF')
-      .animationDuration(300)
     }
     .width('100%')
     .padding(16)
@@ -1408,8 +1426,10 @@ export struct UploadMusicPage {
           ListItem() {
             Row({ space: 12 }) {
               // 文件图标
-              Text('🎵')
+              SymbolGlyph($r('sys.symbol.music'))
                 .fontSize(20)
+                .fontColor([this.themeColor])
+                .alignSelf(ItemAlign.Center)
 
               Text(item.name)
                 .fontSize(14)
@@ -1434,9 +1454,10 @@ export struct UploadMusicPage {
                     }
                   })
               } else {
-                Text('✓')
+                SymbolGlyph($r('sys.symbol.checkmark_circle'))
                   .fontSize(20)
-                  .fontColor(this.isDarkMode ? '#5BA854' : '#64BB5C')
+                  .fontColor([this.themeColor])
+                  .alignSelf(ItemAlign.Center)
               }
             }
             .width('100%')