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
yangchenggong1_wd
2024-03-07 16:51:21 +0800
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
e482f899561f6afe59439cff2f0a30a1cd69f8b7
e482f899
1 parent
b7fc98b7
desc:个人中心 UI 界面绘制
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
152 additions
and
2 deletions
PeopleDaily_Harmony/wdComponent/src/main/ets/components/page/MinePageComponent.ets
PeopleDaily_Harmony/wdComponent/src/main/resources/base/element/color.json
PeopleDaily_Harmony/wdComponent/src/main/resources/base/media/mine_grade_bg.png
PeopleDaily_Harmony/wdComponent/src/main/resources/base/media/mine_head_bg.png
PeopleDaily_Harmony/wdComponent/src/main/resources/base/media/mine_head_icon.png
PeopleDaily_Harmony/wdComponent/src/main/resources/base/media/mine_sign_icon.png
PeopleDaily_Harmony/wdComponent/src/main/resources/base/media/mine_user_edit.png
PeopleDaily_Harmony/wdKit/src/main/ets/utils/AppContext.ets
PeopleDaily_Harmony/wdComponent/src/main/ets/components/page/MinePageComponent.ets
View file @
e482f89
import router from '@ohos.router';
import common from '@ohos.app.ability.common';
const TAG = 'PageComponent';
/**
...
...
@@ -5,9 +7,146 @@ const TAG = 'PageComponent';
*/
@Component
export struct MinePageComponent {
// TODO 待完善
//是否是创作者
@State isActive:boolean = false
@State isLogin:boolean = true
private context = getContext(this) as common.UIAbilityContext
aboutToAppear(){
// TODO 获取用户信息
}
build() {
Text('我的页面')
Column(){
Stack({alignContent:Alignment.Top}){
Image($r('app.media.mine_head_bg'))
.setFullWidth()
.height('50%')
.objectFit(ImageFit.Auto)
this.TopUI()
}.setFullWidthAndHeight()
.backgroundColor($r('app.color.color_F5F5F5'))
}.setFullWidthAndHeight()
}
@Builder TopUI(){
Column(){
//头像层
this.HeaderUI()
//Grid 区域
this.GridUI()
//Card
this.CardUI()
//滑动区域
this.ScrollUI()
}
.padding({left:11,right:11})
.setFullWidthAndHeight()
}
@Builder HeaderUI(){
Row(){
//头像
Stack(){
Button({type:ButtonType.Circle})
.backgroundColor($r('app.color.white'))
.width(74)
.height(74)
Image($r('app.media.mine_head_icon'))
.width(70)
.height(70)
.objectFit(ImageFit.Cover)
.borderRadius(50)
}.width(74)
.height(74)
//昵称信息
Column(){
Row(){
Text("人民日报网友ABCDEF")
.fontColor($r('app.color.white'))
Image($r('app.media.mine_user_edit'))
.width(20)
.height(20)
}
Text("等级8")
.textAlign(TextAlign.Center)
.backgroundImage($r('app.media.mine_grade_bg'))
.backgroundImageSize({width:55})
.fontColor($r('app.color.white'))
.fontSize(12)
.width(40)
.margin({top:20})
}.alignItems(HorizontalAlign.Start)
.width(200)
.margin({left:10})
Blank()
Stack({alignContent:Alignment.Start}){
Text("签到")
.textAlign(TextAlign.Center)
.borderRadius({ topLeft:10,bottomLeft:10})
.width(50)
.fontColor($r('app.color.white'))
.backgroundColor($r('app.color.color_FFC460'))
.margin({left:20})
Image($r("app.media.mine_sign_icon"))
.width(30)
.height(30)
}.width(60)
}
.setFullWidth()
.margin({top:30})
}
@Builder GridUI(){
Column(){
}
}
@Builder CardUI(){
Row(){
}
}
@Builder ScrollUI(){
Column(){
Scroll(){
}
}
}
@Styles setFullWidthAndHeight(){
.width('100%')
.height('100%')
}
@Styles setFullWidth(){
.width('100%')
}
@Styles setFullHeight(){
.width('100%')
}
change(){
router.pushUrl({
url: 'pages/IndexPage',
params: {
}
}).catch((error: Error) => {
});
}
}
...
...
PeopleDaily_Harmony/wdComponent/src/main/resources/base/element/color.json
View file @
e482f89
...
...
@@ -47,6 +47,14 @@
{
"name"
:
"color_80000000"
,
"value"
:
"#80000000"
},
{
"name"
:
"color_F5F5F5"
,
"value"
:
"#F5F5F5"
},
{
"name"
:
"color_FFC460"
,
"value"
:
"#FFC460"
}
]
}
\ No newline at end of file
...
...
PeopleDaily_Harmony/wdComponent/src/main/resources/base/media/mine_grade_bg.png
0 → 100644
View file @
e482f89
661 Bytes
PeopleDaily_Harmony/wdComponent/src/main/resources/base/media/mine_head_bg.png
0 → 100644
View file @
e482f89
129 KB
PeopleDaily_Harmony/wdComponent/src/main/resources/base/media/mine_head_icon.png
0 → 100644
View file @
e482f89
165 KB
PeopleDaily_Harmony/wdComponent/src/main/resources/base/media/mine_sign_icon.png
0 → 100644
View file @
e482f89
3.36 KB
PeopleDaily_Harmony/wdComponent/src/main/resources/base/media/mine_user_edit.png
0 → 100644
View file @
e482f89
276 Bytes
PeopleDaily_Harmony/wdKit/src/main/ets/utils/AppContext.ets
View file @
e482f89
/**
* 应用ability上下文管理类
*/
import common from '@ohos.app.ability.common';
export class AppContext {
private static sContext: Context;
private context = getContext(this) as common.UIAbilityContext
public static init(abilityContext: Context) {
this.sContext = abilityContext;
...
...
@@ -11,4 +13,5 @@ export class AppContext {
public static getAbilityContext() {
return this.sContext;
}
}
\ No newline at end of file
...
...
Please
register
or
login
to post a comment