Răsfoiți Sursa

调整更新日志UI

chendeben 11 luni în urmă
părinte
comite
3ca74e297b
1 a modificat fișierele cu 11 adăugiri și 100 ștergeri
  1. 11 100
      entry/src/main/ets/dialog/OnlineUpdateLog.ets

+ 11 - 100
entry/src/main/ets/dialog/OnlineUpdateLog.ets

@@ -86,18 +86,6 @@ export default struct OnlineUpdateLog {
     }
   }
 
-  /**
-   * 记录已显示的版本,避免重复显示
-   */
-  private markVersionShown() {
-    try {
-      UpdateLogManager.markCurrentVersionShown();
-    } catch (error) {
-      console.error('OnlineUpdateLogDialog markVersionShown error:', error);
-    }
-  }
-
-
   /**
    * 组件销毁时清理资源
    */
@@ -112,69 +100,6 @@ export default struct OnlineUpdateLog {
 
   build() {
     Column() {
-      // 标题区域 - 优化设计
-      Column() {
-        // 图标装饰
-        Column() {
-          Text('📋')
-            .fontSize(24)
-        }
-        .width(48)
-        .height(48)
-        .backgroundColor(this.themeColor)
-        .borderRadius(24)
-        .justifyContent(FlexAlign.Center)
-        .alignItems(HorizontalAlign.Center)
-        .shadow({
-          radius: 8,
-          color: this.themeColor + '30',
-          offsetX: 0,
-          offsetY: 2
-        })
-        .margin({ bottom: 12 })
-        
-        if (this.updateLogConfig?.title) {
-          Text(this.updateLogConfig.title)
-            .fontSize(20)
-            .fontWeight(FontWeight.Bold)
-            .fontColor(this.isDarkMode ? Color.White : '#1A1A1A')
-            .textAlign(TextAlign.Center)
-            .margin({ bottom: 8 })
-        }
-        
-        // 当前版本信息 - 带背景的标签样式
-        Row() {
-          Text('当前版本')
-            .fontSize(11)
-            .fontColor(this.isDarkMode ? '#B0B0B0' : '#666666')
-            .margin({ right: 6 })
-          
-          Text(this.currentVersion)
-            .fontSize(12)
-            .fontWeight(FontWeight.Medium)
-            .fontColor(Color.White)
-            .padding({ left: 8, right: 8, top: 2, bottom: 2 })
-            .backgroundColor(this.themeColor)
-            .borderRadius(10)
-        }
-        .justifyContent(FlexAlign.Center)
-      }
-      .width('100%')
-      .padding({ left: 24, right: 24, top: 20, bottom: 16 })
-      .backgroundColor(this.isDarkMode ? '#2A2A2A' : Color.White)
-      .borderRadius({
-        topLeft: 12,
-        topRight: 12,
-        bottomLeft: 0,
-        bottomRight: 0
-      })
-      .shadow({
-        radius: 4,
-        color: this.isDarkMode ? 'rgba(0,0,0,0.3)' : 'rgba(0,0,0,0.08)',
-        offsetX: 0,
-        offsetY: 2
-      })
-
       // 内容区域
       if (this.errorMessage) {
         // 错误状态
@@ -227,11 +152,12 @@ export default struct OnlineUpdateLog {
             })
         }
         .width('100%')
-        .height(350)
+        .height('100%')
         .justifyContent(FlexAlign.Center)
         .alignItems(HorizontalAlign.Center)
         .padding(20)
         .backgroundColor(this.isDarkMode ? '#2C2C2C' : Color.White)
+        .borderRadius(16)
       } else if (this.isLoading) {
         // 加载状态 - 优化设计
         Column() {
@@ -253,16 +179,11 @@ export default struct OnlineUpdateLog {
             .fontColor(this.isDarkMode ? '#B0B0B0' : '#888888')
         }
         .width('100%')
-        .height(400)
+        .height('100%')
         .justifyContent(FlexAlign.Center)
         .alignItems(HorizontalAlign.Center)
         .backgroundColor(this.isDarkMode ? '#1E1E1E' : '#F5F7FA')
-        .borderRadius({
-          topLeft: 0,
-          topRight: 0,
-          bottomLeft: 12,
-          bottomRight: 12
-        })
+        .borderRadius(16)
       } else {
         // 更新日志内容
         if (!this.updateLogConfig || !this.updateLogConfig.logs || this.updateLogConfig.logs.length === 0) {
@@ -298,18 +219,13 @@ export default struct OnlineUpdateLog {
             .fontColor(this.isDarkMode ? '#B0B0B0' : '#888888')
         }
         .width('100%')
-        .height(400)
+        .height('100%')
         .justifyContent(FlexAlign.Center)
         .alignItems(HorizontalAlign.Center)
         .backgroundColor(this.isDarkMode ? '#1E1E1E' : '#F5F7FA')
-        .borderRadius({
-          topLeft: 0,
-          topRight: 0,
-          bottomLeft: 12,
-          bottomRight: 12
-        })
+        .borderRadius(16)
         } else {
-          // 更新日志列表 - 优化设计
+          // 更新日志列表 - 扩大页面占比
           Scroll() {
             Column({ space: 20 }) {
               ForEach(this.updateLogConfig.logs, (logItem: UpdateLogItemType, index: number) => {
@@ -320,17 +236,12 @@ export default struct OnlineUpdateLog {
               Column()
                 .height(20)
             }
-            .padding({ left: 20, right: 20, top: 16, bottom: 4 })
+            .padding({ left: 20, right: 20, top: 20, bottom: 20 })
           }
           .width('100%')
-          .height(400)
+          .height('100%')
           .backgroundColor(this.isDarkMode ? '#1E1E1E' : '#F5F7FA')
-          .borderRadius({
-            topLeft: 0,
-            topRight: 0,
-            bottomLeft: 12,
-            bottomRight: 12
-          })
+          .borderRadius(16)
           .scrollable(ScrollDirection.Vertical)
           .scrollBar(BarState.Auto)
           .edgeEffect(EdgeEffect.Spring)
@@ -340,7 +251,7 @@ export default struct OnlineUpdateLog {
     .backgroundColor('transparent')
     .borderRadius(16)
     .width('95%')
-    .constraintSize({ maxHeight: '88%' })
+    .height('85%')
     .shadow({
       radius: 24,
       color: this.isDarkMode ? 'rgba(0,0,0,0.6)' : 'rgba(0,0,0,0.12)',