|
@@ -36,7 +36,8 @@ import { ScanFilePage } from './ScanFilePage';
|
|
|
import { AboutPage } from './AboutPage';
|
|
import { AboutPage } from './AboutPage';
|
|
|
import { smartMobilityCommon } from '@kit.CarKit';
|
|
import { smartMobilityCommon } from '@kit.CarKit';
|
|
|
import { UpdateLogManager } from '../common/util/UpdateLogManager';
|
|
import { UpdateLogManager } from '../common/util/UpdateLogManager';
|
|
|
-import OnlineUpdateLogDialog from '../dialog/OnlineUpdateLogDialog';
|
|
|
|
|
|
|
+import OnlineUpdateLogDialog from '../dialog/OnlineUpdateLog';
|
|
|
|
|
+import OnlineUpdateLog from '../dialog/OnlineUpdateLog';
|
|
|
|
|
|
|
|
const TAG = 'NewIndex'; // 日志标签
|
|
const TAG = 'NewIndex'; // 日志标签
|
|
|
|
|
|
|
@@ -80,6 +81,7 @@ struct NewIndex {
|
|
|
@StorageProp('windowWidth') windowWidth: number = 0;
|
|
@StorageProp('windowWidth') windowWidth: number = 0;
|
|
|
@StorageProp('windowHeight') windowHeight: number = 0;
|
|
@StorageProp('windowHeight') windowHeight: number = 0;
|
|
|
@StorageProp('isHiCarStatus') isHiCarStatus: boolean = false;
|
|
@StorageProp('isHiCarStatus') isHiCarStatus: boolean = false;
|
|
|
|
|
+ @State isShowUpdateDialog: boolean = false //是否显示更新日志开关
|
|
|
/** 标题栏配置模型 */
|
|
/** 标题栏配置模型 */
|
|
|
@State titleBarModel: TitleBar.Model = new TitleBar.Model()
|
|
@State titleBarModel: TitleBar.Model = new TitleBar.Model()
|
|
|
.setTitleTextStyle(FontStyle.Normal)
|
|
.setTitleTextStyle(FontStyle.Normal)
|
|
@@ -250,56 +252,15 @@ struct NewIndex {
|
|
|
try {
|
|
try {
|
|
|
const shouldShow = await UpdateLogManager.checkAndShowUpdateLog();
|
|
const shouldShow = await UpdateLogManager.checkAndShowUpdateLog();
|
|
|
if (shouldShow) {
|
|
if (shouldShow) {
|
|
|
- // 延迟显示,确保页面完全加载
|
|
|
|
|
- setTimeout(() => {
|
|
|
|
|
- this.showUpdateLogDialog();
|
|
|
|
|
- }, 3000); // 3秒延迟,确保主页面完全加载
|
|
|
|
|
|
|
+ this.isShowUpdateDialog = !this.isShowUpdateDialog
|
|
|
}
|
|
}
|
|
|
} catch (error) {
|
|
} catch (error) {
|
|
|
console.error('NewIndex checkAndShowUpdateLog error:', error);
|
|
console.error('NewIndex checkAndShowUpdateLog error:', error);
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
- /** 更新日志弹窗控制器 */
|
|
|
|
|
- private updateLogDialogController?: CustomDialogController;
|
|
|
|
|
|
|
|
|
|
- /**
|
|
|
|
|
- * 显示更新日志弹窗
|
|
|
|
|
- */
|
|
|
|
|
- private showUpdateLogDialog() {
|
|
|
|
|
- try {
|
|
|
|
|
- // 如果已有弹窗,先关闭
|
|
|
|
|
- if (this.updateLogDialogController) {
|
|
|
|
|
- this.updateLogDialogController.close();
|
|
|
|
|
- this.updateLogDialogController = undefined;
|
|
|
|
|
- }
|
|
|
|
|
-
|
|
|
|
|
- // 创建弹窗控制器
|
|
|
|
|
- this.updateLogDialogController = new CustomDialogController({
|
|
|
|
|
- builder: OnlineUpdateLogDialog({
|
|
|
|
|
- onClose: () => {
|
|
|
|
|
- // 弹窗关闭回调
|
|
|
|
|
- if (this.updateLogDialogController) {
|
|
|
|
|
- this.updateLogDialogController.close();
|
|
|
|
|
- this.updateLogDialogController = undefined;
|
|
|
|
|
- }
|
|
|
|
|
- }
|
|
|
|
|
- }),
|
|
|
|
|
- autoCancel: false,
|
|
|
|
|
- alignment: DialogAlignment.Center,
|
|
|
|
|
- customStyle: true,
|
|
|
|
|
- cancel: () => {
|
|
|
|
|
- console.info('NewIndex 更新日志弹窗被取消');
|
|
|
|
|
- this.updateLogDialogController = undefined;
|
|
|
|
|
- }
|
|
|
|
|
- });
|
|
|
|
|
|
|
|
|
|
- this.updateLogDialogController.open();
|
|
|
|
|
- console.info('NewIndex 更新日志弹窗已显示');
|
|
|
|
|
- } catch (error) {
|
|
|
|
|
- console.error('NewIndex 显示更新日志弹窗失败:', error);
|
|
|
|
|
- }
|
|
|
|
|
- }
|
|
|
|
|
|
|
|
|
|
/**
|
|
/**
|
|
|
* 页面消失生命周期钩子
|
|
* 页面消失生命周期钩子
|
|
@@ -310,12 +271,7 @@ struct NewIndex {
|
|
|
this.breakpointSystem.unregister();
|
|
this.breakpointSystem.unregister();
|
|
|
emitter.off(888);
|
|
emitter.off(888);
|
|
|
emitter.off(1001);
|
|
emitter.off(1001);
|
|
|
-
|
|
|
|
|
- // 清理更新日志弹窗
|
|
|
|
|
- if (this.updateLogDialogController) {
|
|
|
|
|
- this.updateLogDialogController.close();
|
|
|
|
|
- this.updateLogDialogController = undefined;
|
|
|
|
|
- }
|
|
|
|
|
|
|
+
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
build() {
|
|
build() {
|
|
@@ -353,6 +309,14 @@ struct NewIndex {
|
|
|
})
|
|
})
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
|
|
+ .bindSheet($$this.isShowUpdateDialog, this.updateSheet(), {
|
|
|
|
|
+ height: '90%',
|
|
|
|
|
+ dragBar: true,
|
|
|
|
|
+ preferType: this.currentBreakpoint !== BreakpointTypeEnum.SM ? SheetType.CENTER : SheetType.BOTTOM,
|
|
|
|
|
+ showClose: true,
|
|
|
|
|
+ blurStyle: BlurStyle.Regular,
|
|
|
|
|
+ title: { title: '更新日志' }
|
|
|
|
|
+ })
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
.showControlButton(false)
|
|
.showControlButton(false)
|
|
@@ -800,6 +764,19 @@ struct NewIndex {
|
|
|
});
|
|
});
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
|
|
+ @Builder
|
|
|
|
|
+ updateSheet() {
|
|
|
|
|
+ Scroll() {
|
|
|
|
|
+ Column() {
|
|
|
|
|
+ OnlineUpdateLog()
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+ .width('100%')
|
|
|
|
|
+ .height('100%')
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
// /**
|
|
// /**
|
|
|
// * ================== 穿山甲广告相关 ==================
|
|
// * ================== 穿山甲广告相关 ==================
|
|
|
// */
|
|
// */
|