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
douaojie
2024-04-24 15:48:59 +0800
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
f63a80ed7eaaf44623d44edb1055634efc86a456
f63a80ed
1 parent
a38f85e9
fix: 缺省图晚上
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
57 additions
and
22 deletions
sight_harmony/features/wdComponent/src/main/ets/components/skeleton/DefaultPage.ets
sight_harmony/features/wdComponent/src/main/ets/components/view/EmptyComponent.ets
sight_harmony/features/wdComponent/src/main/ets/components/skeleton/DefaultPage.ets
View file @
f63a80e
...
...
@@ -3,6 +3,8 @@ import { EmptyComponent } from '../view/EmptyComponent'
@Entry
@Component
export struct DefaultPage {
@State type: number = 1
retry() {
console.log('daj点击了重试')
}
...
...
@@ -10,10 +12,14 @@ export struct DefaultPage {
build() {
Row() {
EmptyComponent({
emptyType: 8, emptyButton: true, retry: () => {
emptyType: this.type,
emptyButton: true,
retry: () => {
this.retry()
}
})
// .height('612lpx')
// .width('100%')
}
}
}
\ No newline at end of file
...
...
sight_harmony/features/wdComponent/src/main/ets/components/view/EmptyComponent.ets
View file @
f63a80e
...
...
@@ -7,39 +7,39 @@ const TAG = 'EmptyComponent';
* WDViewDefaultType 缺省页
*/
export const enum WDViewDefaultType {
///
1
.默认
///
0
.默认
WDViewDefaultType_Default,
///
2
.无网
///
1
.无网
WDViewDefaultType_NoNetwork,
///
3
.暂无内容(列表页)
///
2
.暂无内容(列表页)
WDViewDefaultType_NoListContent,
///
4
.内容找不到了(内容详情页)
///
3
.内容找不到了(内容详情页)
WDViewDefaultType_NoContent,
///
5
.无搜索内容
///
4
.无搜索内容
WDViewDefaultType_NoSearchResult,
///
6
.无消息内容
///
5
.无消息内容
WDViewDefaultType_NoMessage,
///
7
.无收藏内容
///
6
.无收藏内容
WDViewDefaultType_NoCollection,
///
8
.无历史记录
///
7
.无历史记录
WDViewDefaultType_NoHistory,
///
9
.网络失败 请稍后重试-倒计时
///
8
.网络失败 请稍后重试-倒计时
WDViewDefaultType_NetworkFailed,
///
10
.内容获取失败
///
9
.内容获取失败
WDViewDefaultType_ContentFailed,
/// 1
1
.无预约内容
/// 1
0
.无预约内容
WDViewDefaultType_NoBooking,
/// 1
2
.无评论内容
/// 1
1
.无评论内容
WDViewDefaultType_NoComment,
/// 1
3
.暂无作品
/// 1
2
.暂无作品
WDViewDefaultType_NoCreation,
/// 1
4
.该号主无法访问
/// 1
3
.该号主无法访问
WDViewDefaultType_NoVisitAccount,
/// 1
5
.暂无关注
/// 1
4
.暂无关注
WDViewDefaultType_NoFollow,
/// 1
8.视频
加载失败
/// 1
5.视频图集
加载失败
WDViewDefaultType_NoVideo,
/// 1
9
.暂无内容1
/// 1
6
.暂无内容1
WDViewDefaultType_NoContent1,
}
...
...
@@ -52,7 +52,7 @@ export struct EmptyComponent {
// private emptySize: SizeOptions = {};
@State emptyWidth: string | number = CommonConstants.FULL_PARENT;
@State emptyHeight: string | number = CommonConstants.FULL_PARENT;
@Link emptyType: number
@Link emptyType: number
; // 缺省图类型,传枚举
@State emptyButton: boolean = false
@State timeNum: number = 10
/**
...
...
@@ -127,8 +127,8 @@ export struct EmptyComponent {
// .height(this.EMPTY_IMAGE_HEIGHT)
Text(this.emptyType !== 8 ? this.buildNoDataTip() : `${this.buildNoDataTip()}(${this.timeNum}s)`)
.fontSize($r('app.float.normal_text_size'))
.fontColor('#000000')
.fontSize($r('app.float.font_size_14'))
.fontColor('#FF999999')
.fontWeight(FontWeight.Normal)
.opacity(this.TEXT_OPACITY)
.margin({ top: this.EMPTY_TIP_TEXT_MARGIN_TOP })
...
...
@@ -136,7 +136,8 @@ export struct EmptyComponent {
Logger.info(TAG, `noProgrammeData onClick event?.source: ${event.source}`);
})
if (this.emptyButton) {
if (this.isShowButton()) {
if (this.emptyType !== 15) {
Button('点击重试')
.type(ButtonType.Normal)
.width(80)
...
...
@@ -145,17 +146,37 @@ export struct EmptyComponent {
.fontColor('#FF666666')
.border({ width: 1 })
.borderColor('#FFEDEDED')
.borderRadius(4)
.fontSize($r('app.float.font_size_12'))
.margin({ top: 16 })
.padding(0)
.onClick(() => {
this.retry()
})
} else {
Button('点击重试')
.type(ButtonType.Normal)
.width(80)
.height(28)
.backgroundColor(Color.Black)
.fontColor('#FFCCCCCC')
.border({ width: 1 })
.borderColor('#4DFFFFFF')
.borderRadius(4)
.fontSize($r('app.float.font_size_12'))
.margin({ top: 16 })
.padding(0)
.onClick(() => {
this.retry()
})
}
}
}
.justifyContent(FlexAlign.Center)
.width(this.emptyWidth)
.height(this.emptyHeight)
// .backgroundColor(Color.Black)
}
buildNoDataTip(): string {
...
...
@@ -224,4 +245,12 @@ export struct EmptyComponent {
}
return imageString
}
isShowButton() {
if (this.emptyType === 1 || this.emptyType === 9 || this.emptyType === 15) {
return true
} else {
return false
}
}
}
...
...
Please
register
or
login
to post a comment