yangchenggong1_wd

desc:点击头像展示头像,用户信息删除更新,

@@ -124,4 +124,6 @@ export class WDRouterPage { @@ -124,4 +124,6 @@ export class WDRouterPage {
124 static themeListPage = new WDRouterPage("wdComponent", "ets/components/page/ThemeListPage"); 124 static themeListPage = new WDRouterPage("wdComponent", "ets/components/page/ThemeListPage");
125 // 栏目页面、频道详情 125 // 栏目页面、频道详情
126 static columnPage = new WDRouterPage("phone", "ets/pages/column/ColumnPage"); 126 static columnPage = new WDRouterPage("phone", "ets/pages/column/ColumnPage");
  127 + //展示头像
  128 + static showUserHeaderPage = new WDRouterPage("wdComponent", "ets/pages/ShowUserHeaderPage");
127 } 129 }
@@ -29,13 +29,11 @@ struct MineHomePage { @@ -29,13 +29,11 @@ struct MineHomePage {
29 registTime:number = 0//账号注册时间 29 registTime:number = 0//账号注册时间
30 @State registerTimeForDay:number = 0 30 @State registerTimeForDay:number = 0
31 31
32 - aboutToAppear(){ 32 + onPageShow(): void {
33 this.getUserInfo() 33 this.getUserInfo()
34 this.getUserLevel() 34 this.getUserLevel()
35 } 35 }
36 36
37 -  
38 -  
39 build() { 37 build() {
40 Stack({ alignContent: Alignment.Top }){ 38 Stack({ alignContent: Alignment.Top }){
41 Image($r('app.media.title_bg')) 39 Image($r('app.media.title_bg'))
@@ -65,9 +63,8 @@ struct MineHomePage { @@ -65,9 +63,8 @@ struct MineHomePage {
65 .height('130lpx') 63 .height('130lpx')
66 .objectFit(ImageFit.Cover) 64 .objectFit(ImageFit.Cover)
67 }.onClick(()=>{ 65 }.onClick(()=>{
68 - //TODO 显示头像  
69 - let params = {'userId': "531267787833221"} as Record<string, string>;  
70 - WDRouterRule.jumpWithPage(WDRouterPage.otherNormalUserHomePagePage,params) 66 + let params = {'headPhotoUrl': this.headPhotoUrl} as Record<string, string>;
  67 + WDRouterRule.jumpWithPage(WDRouterPage.showUserHeaderPage,params)
71 }).width('135lpx') 68 }).width('135lpx')
72 .height('135lpx') 69 .height('135lpx')
73 70
@@ -370,6 +367,9 @@ struct MineHomePage { @@ -370,6 +367,9 @@ struct MineHomePage {
370 if(StringUtils.isNotEmpty(value.introduction)){ 367 if(StringUtils.isNotEmpty(value.introduction)){
371 this.desc = value.introduction 368 this.desc = value.introduction
372 this.isHasIntroduction = true 369 this.isHasIntroduction = true
  370 + }else{
  371 + this.desc = "点击添加简介,让大家认识你"
  372 + this.isHasIntroduction = false
373 } 373 }
374 this.browseNum = value.browseNum 374 this.browseNum = value.browseNum
375 this.commentNum = value.commentNum 375 this.commentNum = value.commentNum
  1 +import { router } from '@kit.ArkUI';
  2 +
  3 +@Entry
  4 +@Component
  5 +struct ShowUserHeaderPage {
  6 + @State headPhotoUrl: string = '';
  7 + @State params:Record<string, string> = router.getParams() as Record<string, string>;
  8 +
  9 + onPageShow() {
  10 + this.headPhotoUrl = this.params?.['headPhotoUrl'];
  11 + }
  12 +
  13 + build() {
  14 + Row() {
  15 + Image(this.headPhotoUrl)
  16 + .alt($r('app.media.default_head'))
  17 + .width('720lpx')
  18 + .height('720lpx')
  19 + .objectFit(ImageFit.Auto)
  20 + .clip(new Circle({ width: '720lpx', height: '720lpx' }))
  21 + }
  22 + .width('100%')
  23 + .height('100%')
  24 + .alignItems(VerticalAlign.Center)
  25 + .backgroundColor($r('app.color.color_000000'))
  26 + .onClick(()=>{
  27 + router.back()
  28 + })
  29 + }
  30 +}
@@ -21,6 +21,7 @@ @@ -21,6 +21,7 @@
21 "components/page/LiveMorePage", 21 "components/page/LiveMorePage",
22 "components/page/ReserveMorePage", 22 "components/page/ReserveMorePage",
23 "pages/VideoPlayPage", 23 "pages/VideoPlayPage",
24 - "components/page/ThemeListPage" 24 + "components/page/ThemeListPage",
  25 + "pages/ShowUserHeaderPage"
25 ] 26 ]
26 } 27 }