Showing
2 changed files
with
19 additions
and
2 deletions
| @@ -13,7 +13,7 @@ import { | @@ -13,7 +13,7 @@ import { | ||
| 13 | PeopleShipUserDetailData, | 13 | PeopleShipUserDetailData, |
| 14 | ArticleCountData | 14 | ArticleCountData |
| 15 | } from 'wdBean' | 15 | } from 'wdBean' |
| 16 | -import { EmptyComponent } from '../view/EmptyComponent' | 16 | +import { EmptyComponent,WDViewDefaultType } from '../view/EmptyComponent' |
| 17 | import { CustomTitleUI } from '../reusable/CustomTitleUI' | 17 | import { CustomTitleUI } from '../reusable/CustomTitleUI' |
| 18 | 18 | ||
| 19 | @Entry | 19 | @Entry |
| @@ -41,6 +41,7 @@ struct PeopleShipHomePage { | @@ -41,6 +41,7 @@ struct PeopleShipHomePage { | ||
| 41 | @State isLoading: boolean = true | 41 | @State isLoading: boolean = true |
| 42 | @State topSafeHeight: number = AppStorage.get<number>('topSafeHeight') || 0 | 42 | @State topSafeHeight: number = AppStorage.get<number>('topSafeHeight') || 0 |
| 43 | @State isConnectNetwork : boolean = NetworkUtil.isNetConnected() | 43 | @State isConnectNetwork : boolean = NetworkUtil.isNetConnected() |
| 44 | + @State isHasHomePage: boolean = true | ||
| 44 | 45 | ||
| 45 | onPageShow(): void { | 46 | onPageShow(): void { |
| 46 | WindowModel.shared.setWindowSystemBarProperties({ statusBarContentColor: '#ffffff'}) | 47 | WindowModel.shared.setWindowSystemBarProperties({ statusBarContentColor: '#ffffff'}) |
| @@ -60,6 +61,7 @@ struct PeopleShipHomePage { | @@ -60,6 +61,7 @@ struct PeopleShipHomePage { | ||
| 60 | 61 | ||
| 61 | build() { | 62 | build() { |
| 62 | if(this.isConnectNetwork){ | 63 | if(this.isConnectNetwork){ |
| 64 | + if (this.isHasHomePage){ | ||
| 63 | Stack({ alignContent: Alignment.TopStart }) { | 65 | Stack({ alignContent: Alignment.TopStart }) { |
| 64 | Stack({ alignContent: Alignment.Top }){ | 66 | Stack({ alignContent: Alignment.Top }){ |
| 65 | // 顶部图片 | 67 | // 顶部图片 |
| @@ -145,6 +147,14 @@ struct PeopleShipHomePage { | @@ -145,6 +147,14 @@ struct PeopleShipHomePage { | ||
| 145 | .margin({top:px2vp(this.topSafeHeight)}) | 147 | .margin({top:px2vp(this.topSafeHeight)}) |
| 146 | } | 148 | } |
| 147 | .width('100%') | 149 | .width('100%') |
| 150 | + }else { | ||
| 151 | + Column(){ | ||
| 152 | + CustomTitleUI({ titleName: "" }) | ||
| 153 | + EmptyComponent({emptyType:WDViewDefaultType.WDViewDefaultType_NoUserHomepage}).height('70%') | ||
| 154 | + }.width("100%") | ||
| 155 | + .height("100%") | ||
| 156 | + .padding({top:px2vp(this.topSafeHeight)}) | ||
| 157 | + } | ||
| 148 | }else{ | 158 | }else{ |
| 149 | Column(){ | 159 | Column(){ |
| 150 | CustomTitleUI({ titleName: "" }) | 160 | CustomTitleUI({ titleName: "" }) |
| @@ -184,6 +194,7 @@ struct PeopleShipHomePage { | @@ -184,6 +194,7 @@ struct PeopleShipHomePage { | ||
| 184 | 194 | ||
| 185 | } catch (exception) { | 195 | } catch (exception) { |
| 186 | this.isLoading = false | 196 | this.isLoading = false |
| 197 | + this.isHasHomePage = false | ||
| 187 | } | 198 | } |
| 188 | } | 199 | } |
| 189 | 200 |
| @@ -44,7 +44,9 @@ export const enum WDViewDefaultType { | @@ -44,7 +44,9 @@ export const enum WDViewDefaultType { | ||
| 44 | // 17. 暂无评论快来抢沙发 | 44 | // 17. 暂无评论快来抢沙发 |
| 45 | WDViewDefaultType_NoComment1, | 45 | WDViewDefaultType_NoComment1, |
| 46 | // 18. 内容找不到了 | 46 | // 18. 内容找不到了 |
| 47 | - WDViewDefaultType_NoContent2 | 47 | + WDViewDefaultType_NoContent2, |
| 48 | + // 19. 暂时无法查看该创作者主页 | ||
| 49 | + WDViewDefaultType_NoUserHomepage | ||
| 48 | } | 50 | } |
| 49 | 51 | ||
| 50 | /** | 52 | /** |
| @@ -213,6 +215,8 @@ export struct EmptyComponent { | @@ -213,6 +215,8 @@ export struct EmptyComponent { | ||
| 213 | contentString = '暂无评论,快来抢沙发' | 215 | contentString = '暂无评论,快来抢沙发' |
| 214 | } else if (this.emptyType === WDViewDefaultType.WDViewDefaultType_NoContent2) { | 216 | } else if (this.emptyType === WDViewDefaultType.WDViewDefaultType_NoContent2) { |
| 215 | contentString = '内容找不到了' | 217 | contentString = '内容找不到了' |
| 218 | + } else if (this.emptyType === WDViewDefaultType.WDViewDefaultType_NoUserHomepage){ | ||
| 219 | + contentString = '暂时无法查看该创作者主页' | ||
| 216 | } | 220 | } |
| 217 | 221 | ||
| 218 | return contentString | 222 | return contentString |
| @@ -249,6 +253,8 @@ export struct EmptyComponent { | @@ -249,6 +253,8 @@ export struct EmptyComponent { | ||
| 249 | this.emptyType === WDViewDefaultType.WDViewDefaultType_NoFollow || | 253 | this.emptyType === WDViewDefaultType.WDViewDefaultType_NoFollow || |
| 250 | this.emptyType === WDViewDefaultType.WDViewDefaultType_NoContent2) { | 254 | this.emptyType === WDViewDefaultType.WDViewDefaultType_NoContent2) { |
| 251 | imageString = $r('app.media.icon_no_appointmentMade1') | 255 | imageString = $r('app.media.icon_no_appointmentMade1') |
| 256 | + }else if (this.emptyType === WDViewDefaultType.WDViewDefaultType_NoUserHomepage){ | ||
| 257 | + imageString = $r('app.media.icon_no_master1') | ||
| 252 | } | 258 | } |
| 253 | return imageString | 259 | return imageString |
| 254 | } | 260 | } |
-
Please register or login to post a comment