Browse Source

更新日志改成后台json配置

chendeben 11 tháng trước cách đây
mục cha
commit
ab827891c2

+ 79 - 5
entry/src/main/ets/common/util/UpdateLogManager.ets

@@ -7,9 +7,83 @@ import { UpdateConstants } from '../constants/UpdateConstants';
 import Logger from './Logger';
 import { ConfigManager } from './ConfigManager';
 
+/**
+ * 更新日志项类型定义
+ */
+export interface UpdateLogItemType {
+  version: string;
+  date: string;
+  title?: string;
+  features?: string[];
+  improvements?: string[];
+  fixes?: string[];
+}
+
+/**
+ * 更新日志配置类型定义
+ */
+export interface UpdateLogConfigType {
+  title: string;
+  logs: UpdateLogItemType[];
+}
+
 export class UpdateLogManager {
   private static readonly TAG = 'UpdateLogManager';
 
+  /**
+   * 检查是否有有效的更新日志配置
+   * @returns boolean 是否有有效配置
+   */
+  private static hasValidUpdateLogConfig(): boolean {
+    try {
+      const updateLogConfig = ConfigManager.getConfig('update_log_config', null);
+      
+      if (!updateLogConfig) {
+        Logger.warn(UpdateLogManager.TAG, '更新日志配置为空');
+        return false;
+      }
+
+      // 检查配置结构是否有效
+      const config = updateLogConfig as UpdateLogConfigType;
+      if (!config.title || !config.logs) {
+        Logger.warn(UpdateLogManager.TAG, '更新日志配置结构无效,缺少title或logs字段');
+        return false;
+      }
+
+      const logs = config.logs as UpdateLogItemType[];
+      if (!Array.isArray(logs) || logs.length === 0) {
+        Logger.warn(UpdateLogManager.TAG, '更新日志配置中logs字段无效或为空');
+        return false;
+      }
+
+      // 检查至少有一个有效的日志项
+      const hasValidLog: boolean = logs.some((log: UpdateLogItemType): boolean => {
+        // 检查版本号和日期是否存在
+        if (!log.version || !log.date) {
+          return false;
+        }
+        
+        // 检查是否至少有一种更新内容
+        const hasFeatures: boolean = Boolean(log.features && Array.isArray(log.features) && log.features.length > 0);
+        const hasImprovements: boolean = Boolean(log.improvements && Array.isArray(log.improvements) && log.improvements.length > 0);
+        const hasFixes: boolean = Boolean(log.fixes && Array.isArray(log.fixes) && log.fixes.length > 0);
+        
+        return hasFeatures || hasImprovements || hasFixes;
+      });
+
+      if (!hasValidLog) {
+        Logger.warn(UpdateLogManager.TAG, '更新日志配置中没有有效的日志项');
+        return false;
+      }
+
+      Logger.info(UpdateLogManager.TAG, `更新日志配置有效,包含${logs.length}个日志项`);
+      return true;
+    } catch (error) {
+      Logger.error(UpdateLogManager.TAG, '检查更新日志配置有效性失败:' + error);
+      return false;
+    }
+  }
+
   /**
    * 检查并显示更新日志
    * @returns Promise<boolean> 是否显示了更新日志
@@ -24,10 +98,11 @@ export class UpdateLogManager {
       }
       Logger.info(UpdateLogManager.TAG, '更新日志功能已通过API配置启用');
 
-      // if (!UpdateConstants.ENABLE_UPDATE_LOG) {
-      //   Logger.info(UpdateLogManager.TAG, '更新日志功能已禁用');
-      //   return false;
-      // }
+      // 检查更新日志配置是否存在且有效
+      if (!UpdateLogManager.hasValidUpdateLogConfig()) {
+        Logger.info(UpdateLogManager.TAG, '更新日志配置无效或不存在');
+        return false;
+      }
 
       const shouldShow = UpdateLogManager.shouldShowUpdateLog();
       if (!shouldShow) {
@@ -109,5 +184,4 @@ export class UpdateLogManager {
     }
   }
 
-
 }

+ 360 - 117
entry/src/main/ets/dialog/OnlineUpdateLog.ets

@@ -1,13 +1,12 @@
 /**
  * 在线更新日志弹窗组件
- * 参考WebIndex.ets的成功实现,确保WebView正常工作
+ * 通过ConfigManager获取json配置并渲染页面,避免WebView加载loading
  */
-import { webview } from '@kit.ArkWeb';
-import { UpdateConstants } from '../common/constants/UpdateConstants';
-import { UpdateLogManager } from '../common/util/UpdateLogManager';
+import { UpdateLogManager, UpdateLogItemType, UpdateLogConfigType } from '../common/util/UpdateLogManager';
 import { ConfigurationConstant } from '@kit.AbilityKit';
 import { AppUtil, PreferencesUtil } from '@pura/harmony-utils';
 import { CommonConstants } from '../common/constants/CommonConstants';
+import { ConfigManager } from '../common/util/ConfigManager';
 
 @Component
 export default struct OnlineUpdateLog {
@@ -15,20 +14,14 @@ export default struct OnlineUpdateLog {
   controller?: CustomDialogController;
   /** 关闭回调 */
   onClose?: () => void;
-  /** 更新日志URL */
-  @State updateLogUrl: string = '';
   /** 当前应用版本 */
   @State currentVersion: string = '';
-  /** WebView控制器 */
-  private webViewController: webview.WebviewController = new webview.WebviewController();
+  /** 更新日志配置数据 */
+  @State updateLogConfig: UpdateLogConfigType | null = null;
   /** 是否加载完成 */
   @State isLoading: boolean = true;
   /** 加载错误信息 */
   @State errorMessage: string = '';
-  /** 加载进度 */
-  @State progressValue: number = 0;
-  /** 进度条是否可见 */
-  @State progressVisible: boolean = true;
   /** 深色模式 */
   @State isDarkMode: boolean = false;
   @StorageProp('currentColorMode') currentMode: number = ConfigurationConstant.ColorMode.COLOR_MODE_LIGHT;
@@ -38,20 +31,16 @@ export default struct OnlineUpdateLog {
     try {
       // 获取当前应用版本
       this.getCurrentVersion();
-      // 设置更新日志URL - 直接使用在线URL
-      this.updateLogUrl = UpdateConstants.UPDATE_LOG_URL;
       // 检查深色模式
       this.isDarkMode = this.currentMode === ConfigurationConstant.ColorMode.COLOR_MODE_DARK;
       let themeColor = PreferencesUtil.getStringSync('THEME_COLOR', CommonConstants.DEFAULT_THEME_COLOR);
       AppStorage.setOrCreate('themeColor', themeColor);
       this.themeColor = themeColor
-      console.info('OnlineUpdateLogDialog URL:', this.updateLogUrl);
-      console.info('OnlineUpdateLogDialog 开始加载在线更新日志');
       
-      // 确保WebView控制器已初始化
-      if (!this.webViewController) {
-        this.webViewController = new webview.WebviewController();
-      }
+      // 从ConfigManager获取更新日志配置
+      this.loadUpdateLogConfig();
+      
+      console.info('OnlineUpdateLogDialog 开始加载更新日志配置');
     } catch (error) {
       console.error('OnlineUpdateLogDialog aboutToAppear error:', error);
       this.errorMessage = '初始化失败';
@@ -64,12 +53,39 @@ export default struct OnlineUpdateLog {
    */
   private getCurrentVersion() {
     try {
-      this.currentVersion = AppUtil.getVersionName()//UpdateConstants.APP_VERSION;
+      this.currentVersion = AppUtil.getVersionName();
     } catch (error) {
       this.currentVersion = '1.0.0';
     }
   }
 
+  /**
+   * 从ConfigManager加载更新日志配置
+   */
+  private loadUpdateLogConfig() {
+    try {
+      this.isLoading = true;
+      this.errorMessage = '';
+      
+      // 从ConfigManager获取更新日志配置
+      const configData = ConfigManager.getConfig('update_log_config', null);
+      
+      if (configData) {
+        this.updateLogConfig = configData as UpdateLogConfigType;
+        this.isLoading = false;
+        console.info('OnlineUpdateLogDialog 成功加载更新日志配置', JSON.stringify(this.updateLogConfig));
+      } else {
+        this.errorMessage = '未找到更新日志配置';
+        this.isLoading = false;
+        console.warn('OnlineUpdateLogDialog 未找到更新日志配置');
+      }
+    } catch (error) {
+      console.error('OnlineUpdateLogDialog 加载更新日志配置失败:', error);
+      this.errorMessage = '加载配置失败';
+      this.isLoading = false;
+    }
+  }
+
   /**
    * 记录已显示的版本,避免重复显示
    */
@@ -88,10 +104,7 @@ export default struct OnlineUpdateLog {
   aboutToDisappear() {
     try {
       console.info('OnlineUpdateLogDialog aboutToDisappear');
-      // 清理WebView控制器
-      if (this.webViewController) {
-        // 这里可以添加WebView的清理逻辑,如果需要的话
-      }
+      // 清理资源
     } catch (error) {
       console.error('OnlineUpdateLogDialog aboutToDisappear error:', error);
     }
@@ -99,40 +112,70 @@ export default struct OnlineUpdateLog {
 
   build() {
     Column() {
-
-
-      // 版本信息和进度条
+      // 标题区域 - 优化设计
       Column() {
-        // 进度条 - 使用主题色
-        if (this.progressVisible && this.progressValue < 100) {
-          Column() {
-            Progress({ value: this.progressValue, total: 100, type: ProgressType.Linear })
-              .width('100%')
-              .height(4)
-              .color(this.themeColor)
-              .backgroundColor(this.isDarkMode ? '#4A4A4A' : '#E0E0E0')
-              .borderRadius(2)
-            
-            Text(`加载中... ${this.progressValue}%`)
-              .fontSize(10)
-              .fontColor(this.isDarkMode ? '#E0E0E0' : Color.Gray)
-              .margin({ top: 4 })
-              .alignSelf(ItemAlign.End)
-          }
-          .width('100%')
+        // 图标装饰
+        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: 20, right: 20, top: 12, bottom: 8 })
-      .backgroundColor(this.isDarkMode ? '#3A3A3A' : '#F8F9FA')
+      .padding({ left: 24, right: 24, top: 20, bottom: 16 })
+      .backgroundColor(this.isDarkMode ? '#2A2A2A' : Color.White)
       .borderRadius({
-        topLeft: 0,
-        topRight: 0,
-        bottomLeft: 8,
-        bottomRight: 8
+        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
       })
 
-      // WebView内容区域 - 完全参考WebIndex.ets的实现
+      // 内容区域
       if (this.errorMessage) {
         // 错误状态
         Column() {
@@ -151,20 +194,20 @@ export default struct OnlineUpdateLog {
             width: 1,
             color: this.isDarkMode ? '#666666' : '#FED7D7'
           })
-          
+
           Text('加载失败')
             .fontSize(16)
             .fontColor(this.isDarkMode ? Color.White : Color.Black)
             .fontWeight(FontWeight.Medium)
             .margin({ top: 16 })
-          
+
           Text(this.errorMessage)
             .fontSize(12)
             .fontColor(this.isDarkMode ? '#E0E0E0' : Color.Gray)
             .margin({ top: 8, left: 20, right: 20 })
             .textAlign(TextAlign.Center)
             .maxLines(3)
-          
+
           Button('重试')
             .fontSize(14)
             .backgroundColor(this.themeColor)
@@ -175,14 +218,8 @@ export default struct OnlineUpdateLog {
             .margin({ top: 20 })
             .onClick(() => {
               try {
-                this.errorMessage = '';
-                this.isLoading = true;
-                this.progressValue = 0;
-                this.progressVisible = true;
-                // 重新加载
-                if (this.webViewController) {
-                  this.webViewController.refresh();
-                }
+                // 重新加载配置
+                this.loadUpdateLogConfig();
               } catch (error) {
                 console.error('OnlineUpdateLogDialog 重试失败:', error);
                 this.errorMessage = '重试失败,请稍后再试';
@@ -195,70 +232,276 @@ export default struct OnlineUpdateLog {
         .alignItems(HorizontalAlign.Center)
         .padding(20)
         .backgroundColor(this.isDarkMode ? '#2C2C2C' : Color.White)
+      } else if (this.isLoading) {
+        // 加载状态 - 优化设计
+        Column() {
+          // 加载动画
+          LoadingProgress()
+            .width(48)
+            .height(48)
+            .color(this.themeColor)
+            .margin({ bottom: 20 })
+          
+          Text('正在加载更新日志...')
+            .fontSize(16)
+            .fontColor(this.isDarkMode ? '#F0F0F0' : '#2A2A2A')
+            .fontWeight(FontWeight.Medium)
+            .margin({ bottom: 8 })
+          
+          Text('请稍候')
+            .fontSize(13)
+            .fontColor(this.isDarkMode ? '#B0B0B0' : '#888888')
+        }
+        .width('100%')
+        .height(400)
+        .justifyContent(FlexAlign.Center)
+        .alignItems(HorizontalAlign.Center)
+        .backgroundColor(this.isDarkMode ? '#1E1E1E' : '#F5F7FA')
+        .borderRadius({
+          topLeft: 0,
+          topRight: 0,
+          bottomLeft: 12,
+          bottomRight: 12
+        })
       } else {
-        // WebView内容 - 完全按照WebIndex.ets的方式实现
-        Web({
-          src: this.updateLogUrl,
-          controller: this.webViewController
+        // 更新日志内容
+        if (!this.updateLogConfig || !this.updateLogConfig.logs || this.updateLogConfig.logs.length === 0) {
+                  // 无数据状态 - 优化设计
+        Column() {
+          // 空状态图标
+          Column() {
+            Text('📋')
+              .fontSize(36)
+          }
+          .width(80)
+          .height(80)
+          .backgroundColor(this.isDarkMode ? '#3A3A3A' : '#F5F7FA')
+          .borderRadius(40)
+          .justifyContent(FlexAlign.Center)
+          .alignItems(HorizontalAlign.Center)
+          .margin({ bottom: 20 })
+          .shadow({
+            radius: 8,
+            color: this.isDarkMode ? 'rgba(0,0,0,0.3)' : 'rgba(0,0,0,0.06)',
+            offsetX: 0,
+            offsetY: 4
+          })
+          
+          Text('暂无更新日志')
+            .fontSize(18)
+            .fontColor(this.isDarkMode ? '#F0F0F0' : '#2A2A2A')
+            .fontWeight(FontWeight.Medium)
+            .margin({ bottom: 8 })
+          
+          Text('当前版本已是最新内容')
+            .fontSize(13)
+            .fontColor(this.isDarkMode ? '#B0B0B0' : '#888888')
+        }
+        .width('100%')
+        .height(400)
+        .justifyContent(FlexAlign.Center)
+        .alignItems(HorizontalAlign.Center)
+        .backgroundColor(this.isDarkMode ? '#1E1E1E' : '#F5F7FA')
+        .borderRadius({
+          topLeft: 0,
+          topRight: 0,
+          bottomLeft: 12,
+          bottomRight: 12
         })
-          .width('100%')
-          .height(350)
-          .borderRadius(12)
-          .layoutWeight(1)
-          .backgroundColor(this.isDarkMode ? '#2C2C2C' : Color.White)
-          // .border({
-          //   width: 1,
-          //   color: this.isDarkMode ? '#333333' : '#E0E0E0'
-          // })
-          .margin({ left: 12, right: 12, bottom: 8 })
-          .darkMode(this.isDarkMode ? WebDarkMode.On : WebDarkMode.Off)
-          .forceDarkAccess(this.isDarkMode)
-          .onProgressChange((event) => {
-            if (event) {
-              console.info('OnlineUpdateLogDialog WebView进度:', event.newProgress);
-              this.progressValue = event.newProgress;
+        } else {
+          // 更新日志列表 - 优化设计
+          Scroll() {
+            Column({ space: 20 }) {
+              ForEach(this.updateLogConfig.logs, (logItem: UpdateLogItemType, index: number) => {
+                this.buildLogItemCard(logItem, index)
+              })
               
-              // 进度完成时隐藏进度条
-              if (event.newProgress >= 100) {
-                setTimeout(() => {
-                  this.progressVisible = false;
-                  this.isLoading = false;
-                }, 500);
-              }
+              // 底部间距
+              Column()
+                .height(20)
             }
+            .padding({ left: 20, right: 20, top: 16, bottom: 4 })
+          }
+          .width('100%')
+          .height(400)
+          .backgroundColor(this.isDarkMode ? '#1E1E1E' : '#F5F7FA')
+          .borderRadius({
+            topLeft: 0,
+            topRight: 0,
+            bottomLeft: 12,
+            bottomRight: 12
           })
-          .onPageBegin(() => {
-            console.info('OnlineUpdateLogDialog WebView开始加载:', this.updateLogUrl);
-            this.isLoading = true;
-            this.errorMessage = '';
-            this.progressValue = 0;
-            this.progressVisible = true;
-          })
-          .onPageEnd(() => {
-            console.info('OnlineUpdateLogDialog WebView加载完成');
-            this.isLoading = false;
-            setTimeout(() => {
-              this.progressVisible = false;
-            }, 1000);
-          })
-          .onErrorReceive((event) => {
-            const errorInfo = event?.error?.getErrorInfo() || '网络错误';
-            console.error('OnlineUpdateLogDialog WebView加载错误:', errorInfo);
-            this.isLoading = false;
-            this.progressVisible = false;
-            this.errorMessage = `加载失败:${errorInfo}`;
-          })
+          .scrollable(ScrollDirection.Vertical)
+          .scrollBar(BarState.Auto)
+          .edgeEffect(EdgeEffect.Spring)
+        }
       }
     }
-    .backgroundColor(this.isDarkMode ? '#2C2C2C' : Color.White)
-    .borderRadius(12)
-    .width('92%')
-    .constraintSize({ maxHeight: '85%' })
+    .backgroundColor('transparent')
+    .borderRadius(16)
+    .width('95%')
+    .constraintSize({ maxHeight: '88%' })
+    .shadow({
+      radius: 24,
+      color: this.isDarkMode ? 'rgba(0,0,0,0.6)' : 'rgba(0,0,0,0.12)',
+      offsetX: 0,
+      offsetY: 8
+    })
+    .clip(true)
+  }
+
+
+
+  /**
+   * 构建单个更新日志卡片
+   */
+  @Builder
+  buildLogItemCard(logItem: UpdateLogItemType, index: number) {
+    Column() {
+      // 版本号和日期头部 - 重新设计
+      Row() {
+        // 版本号标签
+        Row() {
+          Text('v')
+            .fontSize(12)
+            .fontColor(Color.White)
+            .fontWeight(FontWeight.Medium)
+          Text(logItem.version)
+            .fontSize(16)
+            .fontColor(Color.White)
+            .fontWeight(FontWeight.Bold)
+        }
+        .padding({ left: 12, right: 12, top: 6, bottom: 6 })
+        .backgroundColor(this.themeColor)
+        .borderRadius(16)
+        .shadow({
+          radius: 4,
+          color: this.themeColor + '40',
+          offsetX: 0,
+          offsetY: 2
+        })
+        
+        Blank()
+        
+        // 日期标签
+        Text(logItem.date)
+          .fontSize(11)
+          .fontColor(this.isDarkMode ? '#B0B0B0' : '#888888')
+          .padding({ left: 8, right: 8, top: 4, bottom: 4 })
+          .backgroundColor(this.isDarkMode ? '#3A3A3A' : '#F0F0F0')
+          .borderRadius(8)
+      }
+      .width('100%')
+      .margin({ bottom: 16 })
+      
+      // 更新标题
+      if (logItem.title) {
+        Text(logItem.title)
+          .fontSize(15)
+          .fontColor(this.isDarkMode ? '#F0F0F0' : '#1A1A1A')
+          .fontWeight(FontWeight.Medium)
+          .textAlign(TextAlign.Start)
+          .width('100%')
+          .margin({ bottom: 16 })
+          .lineHeight(22)
+      }
+      
+      // 更新内容区域
+      Column({ space: 12 }) {
+        // 新功能
+        if (logItem.features && logItem.features.length > 0) {
+          this.buildUpdateSection('✨ 新功能', logItem.features, '#FF6B6B')
+        }
+        
+        // 优化改进  
+        if (logItem.improvements && logItem.improvements.length > 0) {
+          this.buildUpdateSection('🔧 优化改进', logItem.improvements, '#4ECDC4')
+        }
+        
+        // 问题修复
+        if (logItem.fixes && logItem.fixes.length > 0) {
+          this.buildUpdateSection('🐛 问题修复', logItem.fixes, '#45B7D1')
+        }
+      }
+      .width('100%')
+    }
+    .width('100%')
+    .padding(20)
+    .backgroundColor(this.isDarkMode ? '#2A2A2A' : Color.White)
+    .borderRadius(16)
     .shadow({
-      radius: 16,
-      color: this.isDarkMode ? 'rgba(0,0,0,0.8)' : 'rgba(0,0,0,0.15)',
+      radius: 12,
+      color: this.isDarkMode ? 'rgba(0,0,0,0.4)' : 'rgba(0,0,0,0.08)',
       offsetX: 0,
       offsetY: 4
     })
+    .border({
+      width: 1,
+      color: this.isDarkMode ? '#3A3A3A' : '#F0F0F0'
+    })
+    .transition(TransitionEffect.OPACITY.animation({ duration: 300, delay: index * 100 }))
+  }
+
+  /**
+   * 构建更新内容分区
+   */
+  @Builder
+  buildUpdateSection(title: string, items: string[], accentColor: string = this.themeColor) {
+    Column() {
+      // 分区标题 - 重新设计
+      Row() {
+        // 左侧装饰线
+        Column()
+          .width(3)
+          .height(20)
+          .backgroundColor(accentColor)
+          .borderRadius(2)
+          .margin({ right: 8 })
+        
+        Text(title)
+          .fontSize(14)
+          .fontWeight(FontWeight.Bold)
+          .fontColor(this.isDarkMode ? '#F0F0F0' : '#2A2A2A')
+          .textAlign(TextAlign.Start)
+      }
+      .width('100%')
+      .margin({ bottom: 10 })
+      
+      // 分区内容列表 - 优化设计
+      Column({ space: 8 }) {
+        ForEach(items, (item: string, index: number) => {
+          Row() {
+            // 圆点装饰
+            Column()
+              .width(6)
+              .height(6)
+              .backgroundColor(accentColor)
+              .borderRadius(3)
+              .margin({ right: 12, top: 8 })
+            
+            Text(item)
+              .fontSize(13)
+              .fontColor(this.isDarkMode ? '#E0E0E0' : '#4A4A4A')
+              .layoutWeight(1)
+              .textAlign(TextAlign.Start)
+              .lineHeight(20)
+          }
+          .width('100%')
+          .alignItems(VerticalAlign.Top)
+          .padding({ left: 8, right: 4, top: 2, bottom: 2 })
+          .backgroundColor(this.isDarkMode ? 'rgba(255,255,255,0.02)' : 'rgba(0,0,0,0.02)')
+          .borderRadius(8)
+        })
+      }
+      .width('100%')
+    }
+    .width('100%')
+    .padding({ left: 8, right: 8, top: 8, bottom: 8 })
+    .backgroundColor(this.isDarkMode ? 'rgba(255,255,255,0.03)' : 'rgba(0,0,0,0.02)')
+    .borderRadius(12)
+    .border({
+      width: 1,
+      color: this.isDarkMode ? 'rgba(255,255,255,0.05)' : 'rgba(0,0,0,0.06)'
+    })
   }
 }

+ 5 - 1
entry/src/main/ets/pages/NewIndex.ets

@@ -85,7 +85,10 @@ struct NewIndex {
   @StorageProp('windowHeight') windowHeight: number = 0;
   @StorageProp('isHiCarStatus') isHiCarStatus: boolean = false;
   @StorageProp('curDisplayIsHiCar') curDisplayIsHiCar: boolean = false;
-  @State isShowUpdateDialog: boolean = false //是否显示更新日志开关
+  /**
+   * 是否显示更新日志开关
+   */
+  @State isShowUpdateDialog: boolean = false
   /** 标题栏配置模型 */
   @State titleBarModel: TitleBar.Model = new TitleBar.Model()
     .setTitleTextStyle(FontStyle.Normal)
@@ -259,6 +262,7 @@ struct NewIndex {
           this.isShowUpdateDialog = !this.isShowUpdateDialog
           UpdateLogManager.markCurrentVersionShown()
       }
+      this.isShowUpdateDialog = true;//调试期间显示更新日志,测试完成后请删除
     } catch (error) {
       console.error('NewIndex checkAndShowUpdateLog error:', error);
     }