张善主

Merge remote-tracking branch 'origin/main'

... ... @@ -28,7 +28,7 @@ export struct Card5Component {
.width(CommonConstants.FULL_WIDTH)
.autoResize(true)
.borderRadius($r('app.float.image_border_radius'))
if (this.titleShowPolicy === 1 && this.contentDTO.newsTitle) {
if ((this.titleShowPolicy === 1 || this.contentDTO.titleShow === 1) && this.contentDTO.newsTitle) {
Row()
.width(CommonConstants.FULL_WIDTH)
.height(59)
... ...
... ... @@ -137,7 +137,7 @@ struct EditUserInfoPage {
TextPickerDialog.show({
range:['男','女'],
canLoop:false,
selected:0,
selected:this.currentUserInfo.userExtend.sex === 0?1:0,
onAccept:(value:TextPickerResult) => {
this.currentUserInfo.userExtend.sex = value.index == 0?1:0;
this.currentUserInfo.editDataType = WDEditDataModelType.WDEditDataModelType_sex
... ...
... ... @@ -52,22 +52,34 @@ struct EditUserIntroductionPage {
.margin(30)
.onClick(()=>{
this.updateEditModel()
let params: editModelParams = {
introduction: this.introduction
}
router.back({
url:'',
params:params
})
})
}
}
updateEditModel(){
if (this.params.editContent === this.introduction) {
this.goBack()
return
}
let currentUserInfo:editModel = new editModel()
currentUserInfo.userExtend.introduction = this.introduction
currentUserInfo.editDataType = WDEditDataModelType.WDEditDataModelType_intro
EditInfoViewModel.updateUserInfo(currentUserInfo)
EditInfoViewModel.updateUserInfo(currentUserInfo).then(()=>{
this.goBack()
}).catch(()=>{
this.goBack()
})
}
goBack(){
let params: editModelParams = {
introduction: this.introduction
}
router.back({
url:'',
params:params
})
}
}
\ No newline at end of file
... ...
... ... @@ -60,10 +60,22 @@ struct EditUserNikeNamePage {
}
async updateEditModel(){
if (this.params.editContent === this.nikeName) {
this.goBack()
return
}
let currentUserInfo:editModel = new editModel()
currentUserInfo.userName = await encryptMessage(this.nikeName);
currentUserInfo.editDataType = WDEditDataModelType.WDEditDataModelType_nickname
EditInfoViewModel.updateUserInfo(currentUserInfo).then(()=>{
this.goBack()
}).catch(()=>{
this.goBack()
})
}
goBack(){
let params: editModelParams = {
userName: this.nikeName
}
... ... @@ -71,6 +83,5 @@ struct EditUserNikeNamePage {
url:'',
params:params
})
})
}
}
\ No newline at end of file
... ...