Showing
4 changed files
with
26 additions
and
19 deletions
| @@ -29,7 +29,8 @@ export struct Card17Component { | @@ -29,7 +29,8 @@ export struct Card17Component { | ||
| 29 | // 三个图, | 29 | // 三个图, |
| 30 | GridRow({ gutter: 2 }) { | 30 | GridRow({ gutter: 2 }) { |
| 31 | GridCol({ span: { xs: 8 } }) { | 31 | GridCol({ span: { xs: 8 } }) { |
| 32 | - Image(this.contentDTO.fullColumnImgUrls[0].url) | 32 | + Image(this.contentDTO.fullColumnImgUrls.length > 0 ?this.contentDTO.fullColumnImgUrls[0].url:'') |
| 33 | + .backgroundColor('#f5f5f5') | ||
| 33 | .width(CommonConstants.FULL_WIDTH) | 34 | .width(CommonConstants.FULL_WIDTH) |
| 34 | .aspectRatio(16 / 9) | 35 | .aspectRatio(16 / 9) |
| 35 | .borderRadius({ | 36 | .borderRadius({ |
| @@ -39,7 +40,8 @@ export struct Card17Component { | @@ -39,7 +40,8 @@ export struct Card17Component { | ||
| 39 | } | 40 | } |
| 40 | 41 | ||
| 41 | GridCol({ span: { xs: 4 } }) { | 42 | GridCol({ span: { xs: 4 } }) { |
| 42 | - Image(this.contentDTO.fullColumnImgUrls[1].url) | 43 | + Image(this.contentDTO.fullColumnImgUrls.length > 1? this.contentDTO.fullColumnImgUrls[1].url:'') |
| 44 | + .backgroundColor('#f5f5f5') | ||
| 43 | .width(CommonConstants.FULL_WIDTH) | 45 | .width(CommonConstants.FULL_WIDTH) |
| 44 | .aspectRatio(16 / 9) | 46 | .aspectRatio(16 / 9) |
| 45 | .margin({ bottom: 1 }) | 47 | .margin({ bottom: 1 }) |
| @@ -54,7 +56,8 @@ export struct Card17Component { | @@ -54,7 +56,8 @@ export struct Card17Component { | ||
| 54 | } | 56 | } |
| 55 | 57 | ||
| 56 | GridCol({ span: { xs: 4 } }) { | 58 | GridCol({ span: { xs: 4 } }) { |
| 57 | - Image(this.contentDTO.fullColumnImgUrls[2].url) | 59 | + Image(this.contentDTO.fullColumnImgUrls.length > 2? this.contentDTO.fullColumnImgUrls[2].url:'') |
| 60 | + .backgroundColor('#f5f5f5') | ||
| 58 | .width(CommonConstants.FULL_WIDTH) | 61 | .width(CommonConstants.FULL_WIDTH) |
| 59 | .aspectRatio(16 / 9) | 62 | .aspectRatio(16 / 9) |
| 60 | .margin({ top: 1 }) | 63 | .margin({ top: 1 }) |
| @@ -51,11 +51,7 @@ struct EditUserIntroductionPage { | @@ -51,11 +51,7 @@ struct EditUserIntroductionPage { | ||
| 51 | .borderRadius(5) | 51 | .borderRadius(5) |
| 52 | .margin(30) | 52 | .margin(30) |
| 53 | .onClick(()=>{ | 53 | .onClick(()=>{ |
| 54 | - let currentUserInfo:editModel = new editModel() | ||
| 55 | - currentUserInfo.userExtend.introduction = this.introduction | ||
| 56 | - currentUserInfo.editDataType = WDEditDataModelType.WDEditDataModelType_intro | ||
| 57 | - this.updateEditModel(currentUserInfo) | ||
| 58 | - | 54 | + this.updateEditModel() |
| 59 | let params: editModelParams = { | 55 | let params: editModelParams = { |
| 60 | introduction: this.introduction | 56 | introduction: this.introduction |
| 61 | } | 57 | } |
| @@ -68,7 +64,10 @@ struct EditUserIntroductionPage { | @@ -68,7 +64,10 @@ struct EditUserIntroductionPage { | ||
| 68 | } | 64 | } |
| 69 | 65 | ||
| 70 | 66 | ||
| 71 | - updateEditModel(Info:editModel){ | ||
| 72 | - EditInfoViewModel.updateUserInfo(Info) | 67 | + updateEditModel(){ |
| 68 | + let currentUserInfo:editModel = new editModel() | ||
| 69 | + currentUserInfo.userExtend.introduction = this.introduction | ||
| 70 | + currentUserInfo.editDataType = WDEditDataModelType.WDEditDataModelType_intro | ||
| 71 | + EditInfoViewModel.updateUserInfo(currentUserInfo) | ||
| 73 | } | 72 | } |
| 74 | } | 73 | } |
| @@ -2,6 +2,8 @@ import { CustomTitleUI } from '../reusable/CustomTitleUI' | @@ -2,6 +2,8 @@ import { CustomTitleUI } from '../reusable/CustomTitleUI' | ||
| 2 | import router from '@ohos.router' | 2 | import router from '@ohos.router' |
| 3 | import { editModel, editModelParams, WDEditDataModelType } from '../../model/EditInfoModel' | 3 | import { editModel, editModelParams, WDEditDataModelType } from '../../model/EditInfoModel' |
| 4 | import EditInfoViewModel from '../../viewmodel/EditInfoViewModel'; | 4 | import EditInfoViewModel from '../../viewmodel/EditInfoViewModel'; |
| 5 | +// import { encryptMessage } from '../../../utils/cryptoUtil' | ||
| 6 | +import { encryptMessage } from 'wdLogin/src/main/ets/utils/cryptoUtil' | ||
| 5 | @Entry | 7 | @Entry |
| 6 | @Component | 8 | @Component |
| 7 | struct EditUserNikeNamePage { | 9 | struct EditUserNikeNamePage { |
| @@ -51,13 +53,17 @@ struct EditUserNikeNamePage { | @@ -51,13 +53,17 @@ struct EditUserNikeNamePage { | ||
| 51 | .borderRadius(5) | 53 | .borderRadius(5) |
| 52 | .margin(30) | 54 | .margin(30) |
| 53 | .onClick(()=>{ | 55 | .onClick(()=>{ |
| 54 | - | ||
| 55 | ///内部更新 | 56 | ///内部更新 |
| 57 | + this.updateEditModel() | ||
| 58 | + }) | ||
| 59 | + } | ||
| 60 | + } | ||
| 61 | + | ||
| 62 | + async updateEditModel(){ | ||
| 56 | let currentUserInfo:editModel = new editModel() | 63 | let currentUserInfo:editModel = new editModel() |
| 57 | - currentUserInfo.userExtend.introduction = this.nikeName | 64 | + currentUserInfo.userName = await encryptMessage(this.nikeName); |
| 58 | currentUserInfo.editDataType = WDEditDataModelType.WDEditDataModelType_nickname | 65 | currentUserInfo.editDataType = WDEditDataModelType.WDEditDataModelType_nickname |
| 59 | - this.updateEditModel(currentUserInfo) | ||
| 60 | - | 66 | + EditInfoViewModel.updateUserInfo(currentUserInfo).then(()=>{ |
| 61 | let params: editModelParams = { | 67 | let params: editModelParams = { |
| 62 | userName: this.nikeName | 68 | userName: this.nikeName |
| 63 | } | 69 | } |
| @@ -67,9 +73,4 @@ struct EditUserNikeNamePage { | @@ -67,9 +73,4 @@ struct EditUserNikeNamePage { | ||
| 67 | }) | 73 | }) |
| 68 | }) | 74 | }) |
| 69 | } | 75 | } |
| 70 | - } | ||
| 71 | - | ||
| 72 | - updateEditModel(Info:editModel){ | ||
| 73 | - EditInfoViewModel.updateUserInfo(Info) | ||
| 74 | - } | ||
| 75 | } | 76 | } |
| @@ -53,8 +53,12 @@ class MyCollectionViewModel { | @@ -53,8 +53,12 @@ class MyCollectionViewModel { | ||
| 53 | let headers: HashMap<string, string> = HttpUrlUtils.getCommonHeaders() | 53 | let headers: HashMap<string, string> = HttpUrlUtils.getCommonHeaders() |
| 54 | WDHttp.post<ResponseDTO>(HttpUrlUtils.getExecuteCollcetUrl(),params,headers).then((navResDTO: ResponseDTO) => { | 54 | WDHttp.post<ResponseDTO>(HttpUrlUtils.getExecuteCollcetUrl(),params,headers).then((navResDTO: ResponseDTO) => { |
| 55 | if (navResDTO.code == 0) { | 55 | if (navResDTO.code == 0) { |
| 56 | + if(params.status === 1){ | ||
| 57 | + promptAction.showToast({ message: '收藏成功' }) | ||
| 58 | + } else { | ||
| 56 | promptAction.showToast({ message: '删除成功' }) | 59 | promptAction.showToast({ message: '删除成功' }) |
| 57 | } | 60 | } |
| 61 | + } | ||
| 58 | }) | 62 | }) |
| 59 | .catch((error: Error) => { | 63 | .catch((error: Error) => { |
| 60 | Logger.info(TAG,'executeCollcet','ResponseDTO') | 64 | Logger.info(TAG,'executeCollcet','ResponseDTO') |
-
Please register or login to post a comment