基础布局
这个提交包含在:
父节点
348174c4c8
当前提交
82e14a060b
@ -43,6 +43,7 @@ export { WindowHelper } from './src/main/ets/utils/WindowHelper'
|
|||||||
* 自定义view
|
* 自定义view
|
||||||
*/
|
*/
|
||||||
export { LoadingView } from './src/main/ets/view/LoadingView'
|
export { LoadingView } from './src/main/ets/view/LoadingView'
|
||||||
|
export { SafeView } from './src/main/ets/view/SafeView'
|
||||||
/**
|
/**
|
||||||
* 自定义view
|
* 自定义view
|
||||||
*/
|
*/
|
||||||
|
|||||||
@ -1,17 +1,76 @@
|
|||||||
|
import { WindowHelper } from '../utils/WindowHelper'
|
||||||
|
import { inputMethod } from '@kit.IMEKit'
|
||||||
|
|
||||||
|
|
||||||
@Preview
|
@Preview
|
||||||
@Component
|
@Component
|
||||||
export struct SafeView {
|
export struct SafeView {
|
||||||
|
@Consume('pageInfos') pageInfos?: NavPathStack
|
||||||
@Link isLoading: boolean
|
@Link isLoading: boolean
|
||||||
|
@State _titleText: ResourceStr=''
|
||||||
|
private _onBackEvent?: () => void
|
||||||
|
|
||||||
@Builder
|
@Builder
|
||||||
doNothingBuilder() {
|
doNothingBuilder() {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
onBack(event: () => void) {
|
||||||
|
this._onBackEvent = event
|
||||||
|
return this
|
||||||
|
}
|
||||||
|
|
||||||
|
titleText(title: ResourceStr) {
|
||||||
|
this._titleText = title
|
||||||
|
return this
|
||||||
|
}
|
||||||
|
|
||||||
@BuilderParam customBuilderParam: () => void = this.doNothingBuilder
|
@BuilderParam customBuilderParam: () => void = this.doNothingBuilder
|
||||||
|
|
||||||
build() {
|
build() {
|
||||||
|
NavDestination() {
|
||||||
Stack() {
|
Stack() {
|
||||||
|
Column() {
|
||||||
|
Row()
|
||||||
|
.height(WindowHelper.topRectHeight)
|
||||||
|
.width('100%')
|
||||||
|
.backgroundColor('#999999')
|
||||||
|
Row() {
|
||||||
|
|
||||||
|
Image($r("app.media.base_back"))
|
||||||
|
.height(15)
|
||||||
|
.onClick(() => {
|
||||||
|
if (this._onBackEvent) {
|
||||||
|
this._onBackEvent()
|
||||||
|
} else if (this.pageInfos) {
|
||||||
|
this.pageInfos.pop()
|
||||||
|
}
|
||||||
|
})
|
||||||
|
|
||||||
|
Text(this._titleText ?? '')
|
||||||
|
.maxLines(1)
|
||||||
|
.ellipsisMode(EllipsisMode.CENTER)
|
||||||
|
.textOverflow({
|
||||||
|
overflow: TextOverflow.Ellipsis
|
||||||
|
})
|
||||||
|
|
||||||
|
Row() {
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
.justifyContent(FlexAlign.SpaceBetween)
|
||||||
|
.padding({
|
||||||
|
left: 15,
|
||||||
|
right: 15
|
||||||
|
})
|
||||||
|
.height(44)
|
||||||
|
.width('100%')
|
||||||
|
|
||||||
this.customBuilderParam()
|
this.customBuilderParam()
|
||||||
|
}
|
||||||
|
.width('100%')
|
||||||
|
.height('100%')
|
||||||
|
.justifyContent(FlexAlign.Start)
|
||||||
|
|
||||||
Column() {
|
Column() {
|
||||||
LoadingProgress()
|
LoadingProgress()
|
||||||
.color(Color.White)
|
.color(Color.White)
|
||||||
@ -26,5 +85,11 @@ export struct SafeView {
|
|||||||
.backgroundColor('#40000000')
|
.backgroundColor('#40000000')
|
||||||
.justifyContent(FlexAlign.Center)
|
.justifyContent(FlexAlign.Center)
|
||||||
}
|
}
|
||||||
|
}.onClick(() => {
|
||||||
|
inputMethod.getController().stopInputSession()
|
||||||
|
})
|
||||||
|
.hideTitleBar(true)
|
||||||
|
.width('100%')
|
||||||
|
.height('100%')
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
二进制文件未显示。
|
之后 宽度: | 高度: | 大小: 274 B |
二进制文件未显示。
|
之后 宽度: | 高度: | 大小: 438 B |
二进制文件未显示。
|
之后 宽度: | 高度: | 大小: 536 B |
二进制文件未显示。
|
之后 宽度: | 高度: | 大小: 922 B |
二进制文件未显示。
|
之后 宽度: | 高度: | 大小: 1.0 KiB |
正在加载...
在新工单中引用
屏蔽一个用户