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
wangliang_wd
2024-04-16 17:12:52 +0800
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
3a9df105f11bd1cd288905fffb2cb9046e132ded
3a9df105
1 parent
8f2697bb
feat:优化缺省页,增加我的收藏缺省页展示
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
63 additions
and
12 deletions
sight_harmony/features/wdComponent/src/main/ets/components/page/MyCollectionListPage.ets
sight_harmony/features/wdComponent/src/main/ets/components/view/EmptyComponent.ets
sight_harmony/features/wdComponent/src/main/resources/base/media/icon_no_collection.png
sight_harmony/features/wdComponent/src/main/resources/base/media/icon_no_content.png
sight_harmony/features/wdComponent/src/main/ets/components/page/MyCollectionListPage.ets
View file @
3a9df10
...
...
@@ -2,7 +2,7 @@ import { CustomTitleAndEditUI } from '../reusable/CustomTitleAndEditUI'
import MyCollectionViewModel from '../../viewmodel/MyCollectionViewModel';
import PageModel from '../../viewmodel/PageModel';
import { CommonConstants, ViewType } from 'wdConstant'
import { EmptyComponent } from '../view/EmptyComponent'
import { EmptyComponent
,WDViewDefaultType
} from '../view/EmptyComponent'
import { ErrorComponent } from '../view/ErrorComponent'
import RefreshLayout from './RefreshLayout'
import { RefreshLayoutBean } from './RefreshLayoutBean';
...
...
@@ -43,7 +43,7 @@ struct MyCollectionListPage {
}else if(this.browSingModel.viewType == ViewType.ERROR){
ErrorComponent()
}else if(this.browSingModel.viewType == ViewType.EMPTY){
EmptyComponent()
EmptyComponent(
{emptyType:WDViewDefaultType.WDViewDefaultType_NoCollection}
)
}else {
this.ListLayout()
}
...
...
sight_harmony/features/wdComponent/src/main/ets/components/view/EmptyComponent.ets
View file @
3a9df10
...
...
@@ -4,6 +4,42 @@ import { Logger } from 'wdKit';
const TAG = 'EmptyComponent';
/**
* WDViewDefaultType 缺省页
*/
export const enum WDViewDefaultType {
///默认
WDViewDefaultType_Default,
///无网
WDViewDefaultType_NoNetwork,
///暂无内容(列表页)
WDViewDefaultType_NoListContent,
///内容找不到了(内容详情页)
WDViewDefaultType_NoContent,
///无搜索内容
WDViewDefaultType_NoSearchResult,
///无消息内容
WDViewDefaultType_NoMessage,
///无收藏内容
WDViewDefaultType_NoCollection,
///无历史记录
WDViewDefaultType_NoHistory,
///网络失败
WDViewDefaultType_NetworkFailed,
///内容获取失败
WDViewDefaultType_ContentFailed,
///无预约内容
WDViewDefaultType_NoBooking,
///无评论内容
WDViewDefaultType_NoComment,
///暂无作品
WDViewDefaultType_NoCreation,
///该号主无法访问
WDViewDefaultType_NoVisitAccount,
///暂无关注
WDViewDefaultType_NoFollow
}
/**
* 空数据/无数据
*/
@Component
...
...
@@ -11,18 +47,19 @@ 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_Default
/**
* The empty image width percentage setting.
*/
readonly EMPTY_IMAGE_WIDTH: string = '
50
%';
readonly EMPTY_IMAGE_WIDTH: string = '
15
%';
/**
* The empty image height percentage setting.
*/
readonly EMPTY_IMAGE_HEIGHT: string = '
30
%';
readonly EMPTY_IMAGE_HEIGHT: string = '
15
%';
/**
* The empty data text component margin top.
*/
readonly EMPTY_TIP_TEXT_MARGIN_TOP: string = '
2%
';
readonly EMPTY_TIP_TEXT_MARGIN_TOP: string = '
10
';
/**
* The empty data text opacity.
*/
...
...
@@ -38,11 +75,11 @@ export struct EmptyComponent {
@Builder
noProgrammeData() {
Column() {
// Image($r('app.media.icon_no_content'))
// .width(this.EMPTY_IMAGE_WIDTH)
// .height(this.EMPTY_IMAGE_HEIGHT)
// .objectFit(ImageFit.Contain)
// // .border({ width: 1, color: Color.Red, radius: 6 })
Image(this.buildNoDataTipImage())
.width('this.EMPTY_IMAGE_WIDTH')
.height(this.EMPTY_IMAGE_HEIGHT)
.objectFit(ImageFit.Contain)
// .border({ width: 1, color: Color.Red, radius: 6 })
Text(this.buildNoDataTip())
.fontSize($r('app.float.normal_text_size'))
...
...
@@ -59,8 +96,22 @@ export struct EmptyComponent {
.height(this.emptyHeight)
}
buildNoDataTip(): Resource | string {
buildNoDataTip(): string {
Logger.info(TAG, "buildNoDataTip");
let contentString: string = '暂无内容'
if (this.emptyType === WDViewDefaultType.WDViewDefaultType_NoCollection) {
contentString = '暂无收藏'
}
return contentString
}
buildNoDataTipImage(): Resource | string {
Logger.info(TAG, "buildNoDataTip");
return $r('app.string.load_net_data_none')
let imageString: Resource | string = $r('app.media.icon_no_content')
if (this.emptyType === WDViewDefaultType.WDViewDefaultType_NoCollection) {
imageString = $r('app.media.icon_no_collection')
}
return imageString
}
}
\ No newline at end of file
...
...
sight_harmony/features/wdComponent/src/main/resources/base/media/icon_no_collection.png
0 → 100644
View file @
3a9df10
64.2 KB
sight_harmony/features/wdComponent/src/main/resources/base/media/icon_no_content.png
0 → 100644
View file @
3a9df10
54.3 KB
Please
register
or
login
to post a comment