Toggle navigation
Toggle navigation
This project
Loading...
Sign in
developOne
/
harmonyPool
Go to a project
Toggle navigation
Projects
Groups
Snippets
Help
Toggle navigation pinning
Project
Activity
Repository
Pipelines
Graphs
Issues
0
Merge Requests
0
Wiki
Network
Create a new issue
Builds
Commits
Authored by
yangchenggong1_wd
2024-09-19 15:06:02 +0800
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
f1c0e4f35c9adeb54cec23ef723248bc733e1705
f1c0e4f3
1 parent
d2352f90
fix |> 17457 无网络时进入协议节目鸿蒙与安卓显示不一致
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
29 additions
and
7 deletions
sight_harmony/features/wdComponent/src/main/resources/base/media/icon_arrow_left_white.png → sight_harmony/AppScope/resources/base/media/icon_arrow_left_white.png
sight_harmony/features/wdLogin/src/main/ets/pages/login/EmptyComponent.ets
sight_harmony/
features/wdComponent/src/main
/resources/base/media/icon_arrow_left_white.png → sight_harmony/
AppScope
/resources/base/media/icon_arrow_left_white.png
View file @
f1c0e4f
570 Bytes
sight_harmony/features/wdLogin/src/main/ets/pages/login/EmptyComponent.ets
View file @
f1c0e4f
import { CommonConstants } from 'wdConstant';
import { Logger } from 'wdKit';
import { router } from '@kit.ArkUI';
const TAG = 'EmptyComponent';
...
...
@@ -19,11 +20,15 @@ export const enum WDViewDefaultType {
@Preview
@Component
export struct EmptyComponent {
// private emptySize: SizeOptions = {};
@State emptyWidth: string | number = CommonConstants.FULL_PARENT;
@State emptyHeight: string | number = CommonConstants.FULL_PARENT;
@State emptyType: number = WDViewDefaultType.WDViewDefaultType_
NoNetwork
; // 缺省图类型,传枚举
@State emptyType: number = WDViewDefaultType.WDViewDefaultType_
Default
; // 缺省图类型,传枚举
@State emptyButton: boolean = false
@State isBlack: boolean = false // 背景是否为黑色 默认白色
@State timeNum: number = 10
///占位图上是否显示返回按钮
@State showBackButton: boolean = true
/**
* The empty image width percentage setting.
*/
...
...
@@ -39,13 +44,27 @@ export struct EmptyComponent {
/**
* The empty data text opacity.
*/
readonly TEXT_OPACITY: number = 0.4;
private timer: number = -1
readonly TEXT_OPACITY: number = 1.0;
retry: () => void = () => {
}
build() {
Stack({alignContent:Alignment.Bottom}) {
this.noProgrammeData();
if (this.showBackButton) {
Image($r("app.media.icon_arrow_left_white"))
.width(24)
.height(24)
.onClick(() => {
router.back();
})
.position({
bottom: 15,
left: 16
})
}
}
}
/**
...
...
@@ -64,17 +83,18 @@ export struct EmptyComponent {
.fontWeight(FontWeight.Normal)
.opacity(this.TEXT_OPACITY)
.margin({ top: this.EMPTY_TIP_TEXT_MARGIN_TOP })
.fontColor('#666666')
.onClick((event: ClickEvent) => {
Logger.info(TAG, `noProgrammeData onClick event?.source: ${event.source}`);
})
if (this.isShowButton()) {
if (this.emptyType !== 15) {
if (this.emptyType !== 15
&& !this.isBlack
) {
Button('点击重试')
.type(ButtonType.Normal)
.width(80)
.height(28)
.backgroundColor(
'#fffffff'
)
.backgroundColor(
Color.White
)
.fontColor('#FF666666')
.border({ width: 1 })
.borderColor('#FFEDEDED')
...
...
@@ -106,7 +126,9 @@ export struct EmptyComponent {
}
.justifyContent(FlexAlign.Center)
.width(this.emptyWidth)
.layoutWeight(1)
.height(this.emptyHeight)
}
buildNoDataTip(): string {
...
...
@@ -120,7 +142,7 @@ export struct EmptyComponent {
buildNoDataTipImage(): Resource | string {
Logger.info(TAG, "buildNoDataTip");
let imageString: Resource | string =
""
let imageString: Resource | string =
$r('app.media.icon_no_net1')
if (this.emptyType === WDViewDefaultType.WDViewDefaultType_NoNetwork) {
imageString = $r('app.media.icon_no_net1')
}
...
...
@@ -128,7 +150,7 @@ export struct EmptyComponent {
}
isShowButton() {
if (this.emptyType === 1 || this.emptyType === 9 || this.emptyType === 15) {
if (this.emptyType === 1 || this.emptyType === 9 || this.emptyType === 15
&& this.emptyButton
) {
return true
} else {
return false
...
...
Please
register
or
login
to post a comment