ForCAX/entry/src/main/ets/pages/Info.ets
JackLee 50bcf7b678 1-去掉启动页,增加自定义启动页
2-支持重复加载page功能
3-调整TitleBar栏.subBar栏,footBar栏采用Display尺寸进行设定,不再受窗体尺寸变化而缩放.目前只支持缩放的是中间的显示栏区域.
4-修复部分设定BUG.
5-首启动页暂时还未完工,临时加载页面.
6-字体释放不再强制要求自启动
7-页面组件部分没有设定
2026-04-27 19:20:53 +08:00

103 lines
3.3 KiB
Plaintext

import { mdwInfo } from './dispwininfo/DispWinInfo';
import { LoadPageType } from '../entryability/InitWindow';
import { common } from '@kit.AbilityKit';
import { SWInfo } from './subpages/info/SWInfo';
import { SWSrc } from './subpages/info/SWSrc';
import { SWEnv } from './subpages/info/SWEnv';
const TabsBarStr:Array<string>=['运行检测','软件介绍','更新日志','开源信息','关于']
@Entry
@ComponentV2
struct Info {
//顶部导航组件
private titleBarTabs: TabsController = new TabsController();
//当前的顶部导航选择页
@Local selectedIndex: number = 0; // 当前选中的索引
build() {
Flex({ direction: FlexDirection.Column }){
Scroll() {
Row({space:0}) {
Blank().layoutWeight(1)
ForEach(TabsBarStr, (item: string, index: number) => {
Button(){
Column(){
Text(item)
.height('95%')
.fontSize(index === this.selectedIndex ? 20 : 16)
.fontWeight(index === this.selectedIndex ? FontWeight.Bold : FontWeight.Normal)
.backgroundColor(Color.Transparent)
Divider()
.height('5%')
.vertical(false)
.strokeWidth(2)
.lineCap(LineCapStyle.Round)
.color(Color.Grey)
.align(Alignment.Top)
.visibility(index === this.selectedIndex?Visibility.Visible:Visibility.Hidden)
}.width('100%')
.height('100%')
}
.width('7%')
.backgroundColor(index === this.selectedIndex ? $r('sys.color.container_modal_button_normal_baseboard') : Color.Transparent)
.type(ButtonType.Normal)
.onClick(() => {
this.titleBarTabs.changeIndex(index);
this.selectedIndex = index;
})
})
Blank().layoutWeight(1)
}
}
.height('5%')
.align(Alignment.Center)
.scrollable(ScrollDirection.Horizontal)
.scrollBar(BarState.Off)
.margin({ top: 0,left:0,bottom:0,right:0})
//分割线
Divider()
.vertical(false)
.strokeWidth(1)
.lineCap(LineCapStyle.Round)
.width('100%')
.backgroundColor(Color.Grey)
Tabs({barPosition: BarPosition.Start, index: this.selectedIndex,controller: this.titleBarTabs}){
TabContent() {
SWEnv();
}
TabContent() {
SWInfo();
}
TabContent() {
}
TabContent() {
SWSrc()
}
TabContent() {
}
}
.height('90%')
.scrollable(true)
.barHeight(0)
.barMode(BarMode.Fixed)
Row(){
Blank().layoutWeight(1)
Checkbox({ name: 'checkbox1', group: 'checkboxGroup' })
.onChange((value: boolean) => {
console.info('Checkbox1 change is'+ value);
})
Text('下次启动不再显示').fontSize(18)
Button('确定')
.onClick(()=>{
let ctx=this.getUIContext().getHostContext() as common.UIAbilityContext;
ctx.eventHub.emit('EMIT_LOADMAINPAGE',LoadPageType.STAGE)
})
Blank().layoutWeight(1)
}.height('5%')
.justifyContent(FlexAlign.Center)
}.margin({ top:'1%', left: 0, bottom: '1%', right:0 })
}
}