yangchenggong1_wd

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

... ... @@ -124,4 +124,6 @@ export class WDRouterPage {
static themeListPage = new WDRouterPage("wdComponent", "ets/components/page/ThemeListPage");
// 栏目页面、频道详情
static columnPage = new WDRouterPage("phone", "ets/pages/column/ColumnPage");
//展示头像
static showUserHeaderPage = new WDRouterPage("wdComponent", "ets/pages/ShowUserHeaderPage");
}
... ...
... ... @@ -29,13 +29,11 @@ struct MineHomePage {
registTime:number = 0//账号注册时间
@State registerTimeForDay:number = 0
aboutToAppear(){
onPageShow(): void {
this.getUserInfo()
this.getUserLevel()
}
build() {
Stack({ alignContent: Alignment.Top }){
Image($r('app.media.title_bg'))
... ... @@ -65,9 +63,8 @@ struct MineHomePage {
.height('130lpx')
.objectFit(ImageFit.Cover)
}.onClick(()=>{
//TODO 显示头像
let params = {'userId': "531267787833221"} as Record<string, string>;
WDRouterRule.jumpWithPage(WDRouterPage.otherNormalUserHomePagePage,params)
let params = {'headPhotoUrl': this.headPhotoUrl} as Record<string, string>;
WDRouterRule.jumpWithPage(WDRouterPage.showUserHeaderPage,params)
}).width('135lpx')
.height('135lpx')
... ... @@ -370,6 +367,9 @@ struct MineHomePage {
if(StringUtils.isNotEmpty(value.introduction)){
this.desc = value.introduction
this.isHasIntroduction = true
}else{
this.desc = "点击添加简介,让大家认识你"
this.isHasIntroduction = false
}
this.browseNum = value.browseNum
this.commentNum = value.commentNum
... ...
import { router } from '@kit.ArkUI';
@Entry
@Component
struct ShowUserHeaderPage {
@State headPhotoUrl: string = '';
@State params:Record<string, string> = router.getParams() as Record<string, string>;
onPageShow() {
this.headPhotoUrl = this.params?.['headPhotoUrl'];
}
build() {
Row() {
Image(this.headPhotoUrl)
.alt($r('app.media.default_head'))
.width('720lpx')
.height('720lpx')
.objectFit(ImageFit.Auto)
.clip(new Circle({ width: '720lpx', height: '720lpx' }))
}
.width('100%')
.height('100%')
.alignItems(VerticalAlign.Center)
.backgroundColor($r('app.color.color_000000'))
.onClick(()=>{
router.back()
})
}
}
\ No newline at end of file
... ...
... ... @@ -21,6 +21,7 @@
"components/page/LiveMorePage",
"components/page/ReserveMorePage",
"pages/VideoPlayPage",
"components/page/ThemeListPage"
"components/page/ThemeListPage",
"pages/ShowUserHeaderPage"
]
}
\ No newline at end of file
... ...