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-03-27 10:13:17 +0800
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
ec2e4341255c121e779d6cad549ff461554e1b35
ec2e4341
1 parent
1f17fc82
feat:优化编辑资料本地数据
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
23 additions
and
21 deletions
sight_harmony/features/wdComponent/src/main/ets/components/page/EditUserInfoPage.ets
sight_harmony/features/wdComponent/src/main/ets/model/EditInfoModel.ets
sight_harmony/features/wdComponent/src/main/ets/viewmodel/EditInfoViewModel.ets
sight_harmony/features/wdComponent/src/main/ets/components/page/EditUserInfoPage.ets
View file @
ec2e434
...
...
@@ -9,10 +9,10 @@ import { WDRouterPage, WDRouterRule } from 'wdRouter';
@Component
struct EditUserInfoPage {
private listData: EditListInfo[] = []
editM: editModel = new
editModel
// editM:
editModel
aboutToAppear() {
this.listData = EditInfoViewModel.getEditListInfo(this.editM)
//
this.listData = EditInfoViewModel.getEditListInfo(this.editM)
this.getAccountOwnerInfo()
}
...
...
@@ -20,7 +20,7 @@ struct EditUserInfoPage {
Row() {
Column() {
CustomTitleUI({titleName:'资料编辑'})
Image(
this.editM.userExtend.headPhotoUrl?this.editM.userExtend.headPhotoUrl:
'')
Image('')
.backgroundColor(Color.Gray)
.width(100)
.height(100)
...
...
@@ -111,7 +111,7 @@ struct EditUserInfoPage {
getAccountOwnerInfo(){
EditInfoViewModel.queryAccountOwnerInfo(1,getContext(this)).then((result) => {
this.editM = result
//
this.editM = result
});
}
...
...
sight_harmony/features/wdComponent/src/main/ets/model/EditInfoModel.ets
View file @
ec2e434
...
...
@@ -11,29 +11,29 @@ export class EditListInfo{
}
}
export
class
EditInfoModel{
export
interface
EditInfoModel{
//头像
headPhotoUrl:string
= ''
headPhotoUrl:string
//简介
introduction:string
= ''
introduction:string
//城市
city:string
= ''
city:string
//地区
county:string
= ''
county:string
//生日
birthday:string
= ''
birthday:string
//性别
sex:string
= ''
sex:string
}
export class editModel{
userName:string = ''
export interface editModel{
userName:string
userNameStatus:string
= ''
userNameStatus:string
phone:string
= ''
phone:string
headPhotoStatus:string
= ''
headPhotoStatus:string
userExtend:EditInfoModel
}
\ No newline at end of file
...
...
sight_harmony/features/wdComponent/src/main/ets/viewmodel/EditInfoViewModel.ets
View file @
ec2e434
...
...
@@ -29,11 +29,12 @@ class EditInfoViewModel {
getEditListInfo(item:editModel):EditListInfo[]{
this.editListData = [
new EditListInfo('昵称',item&&item.userName?item.userName:'待完善'),
new EditListInfo('简介',item&&item.userExtend.introduction?item.userExtend.introduction:'待完善'),
new EditListInfo('地区',item&&item.userExtend.city?item.userExtend.city:'待完善'),
new EditListInfo('生日',item&&item.userExtend.birthday?item.userExtend.birthday:'待完善'),
new EditListInfo('性别',item&&item.userExtend.sex?item.userExtend.sex:'待完善'),]
// new EditListInfo('昵称',item&&item.userName?item.userName:'待完善'),
// new EditListInfo('简介',item&&item.userExtend.introduction?item.userExtend.introduction:'待完善'),
// new EditListInfo('地区',item&&item.userExtend.city?item.userExtend.city:'待完善'),
// new EditListInfo('生日',item&&item.userExtend.birthday?item.userExtend.birthday:'待完善'),
// new EditListInfo('性别',item&&item.userExtend.sex?item.userExtend.sex:'待完善'),
]
return this.editListData
}
...
...
@@ -45,6 +46,7 @@ class EditInfoViewModel {
// let editM = navResDTO.data as EditInfoModel
// success(JSON.parse(navResDTO.data)
}
return this.GetqueryAccountOwnerLocal(context)
}).catch((error: Error) => {
Logger.info('EditInfoViewModel','EditInfoViewModel','EditInfoViewModel')
return this.GetqueryAccountOwnerLocal(context)
...
...
Please
register
or
login
to post a comment