wangliang_wd

feat:优化编辑资料本地数据

... ... @@ -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
});
}
... ...
... ... @@ -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
... ...
... ... @@ -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)
... ...