Showing
4 changed files
with
65 additions
and
8 deletions
| @@ -7,7 +7,7 @@ import {AreaPickerDialog} from '../view/areaPickerDialog/AreaPickerDialog' | @@ -7,7 +7,7 @@ import {AreaPickerDialog} from '../view/areaPickerDialog/AreaPickerDialog' | ||
| 7 | import {EditUserInfoCustomDialog} from '../view/areaPickerDialog/EditUserInfoCustomDialog' | 7 | import {EditUserInfoCustomDialog} from '../view/areaPickerDialog/EditUserInfoCustomDialog' |
| 8 | import {EditUserSexCustomDialog} from '../view/areaPickerDialog/EditUserSexCustomDialog' | 8 | import {EditUserSexCustomDialog} from '../view/areaPickerDialog/EditUserSexCustomDialog' |
| 9 | import {CustomDialogUI} from '../view/areaPickerDialog/CustomDialogUI' | 9 | import {CustomDialogUI} from '../view/areaPickerDialog/CustomDialogUI' |
| 10 | -import {AreaListModel } from '../../model/AreaListModel'; | 10 | +import { AreaListManageModel, AreaListModel } from '../../model/AreaListModel'; |
| 11 | import router from '@ohos.router'; | 11 | import router from '@ohos.router'; |
| 12 | import TrackingPageBrowseUtils from '../../utils/TrackingPageBrowseUtils' | 12 | import TrackingPageBrowseUtils from '../../utils/TrackingPageBrowseUtils' |
| 13 | import { TrackConstants } from 'wdTracking/Index'; | 13 | import { TrackConstants } from 'wdTracking/Index'; |
| @@ -34,11 +34,16 @@ struct EditUserInfoPage { | @@ -34,11 +34,16 @@ struct EditUserInfoPage { | ||
| 34 | 34 | ||
| 35 | dialogController: CustomDialogController = new CustomDialogController({ | 35 | dialogController: CustomDialogController = new CustomDialogController({ |
| 36 | builder: AreaPickerDialog({dataSource:this.dataSource,firstSelect:this.firstSelect,secondSelect:this.secondSelect,thirdSelect:this.thirdSelect, | 36 | builder: AreaPickerDialog({dataSource:this.dataSource,firstSelect:this.firstSelect,secondSelect:this.secondSelect,thirdSelect:this.thirdSelect, |
| 37 | - confirmCallback:(province:string,city:string,county:string,address:string)=>{ | ||
| 38 | - this.currentUserInfo.userExtend.province = province; | ||
| 39 | - this.currentUserInfo.userExtend.city = city; | ||
| 40 | - this.currentUserInfo.userExtend.county = county; | 37 | + confirmCallback:(province:AreaListManageModel,city:AreaListManageModel,county:AreaListManageModel,address:string)=>{ |
| 38 | + this.currentUserInfo.userExtend.province = province.label; | ||
| 39 | + this.currentUserInfo.userExtend.city = city.label; | ||
| 40 | + this.currentUserInfo.userExtend.county = county.label; | ||
| 41 | this.currentUserInfo.userExtend.address = address; | 41 | this.currentUserInfo.userExtend.address = address; |
| 42 | + | ||
| 43 | + this.currentUserInfo.userExtend.provinceCode = province.code; | ||
| 44 | + this.currentUserInfo.userExtend.cityCode = city.code; | ||
| 45 | + this.currentUserInfo.userExtend.districtCode = county.code; | ||
| 46 | + | ||
| 42 | this.currentUserInfo.editDataType = WDEditDataModelType.WDEditDataModelType_region | 47 | this.currentUserInfo.editDataType = WDEditDataModelType.WDEditDataModelType_region |
| 43 | this.updateEditModel() | 48 | this.updateEditModel() |
| 44 | this.getAreaIndex() | 49 | this.getAreaIndex() |
| @@ -115,7 +120,6 @@ struct EditUserInfoPage { | @@ -115,7 +120,6 @@ struct EditUserInfoPage { | ||
| 115 | } | 120 | } |
| 116 | 121 | ||
| 117 | this.getAccountOwnerInfo() | 122 | this.getAccountOwnerInfo() |
| 118 | - this.getAreaList() | ||
| 119 | } | 123 | } |
| 120 | 124 | ||
| 121 | onPageShow(){ | 125 | onPageShow(){ |
| @@ -280,6 +284,7 @@ struct EditUserInfoPage { | @@ -280,6 +284,7 @@ struct EditUserInfoPage { | ||
| 280 | this.currentUserInfo = editModel as editModel; | 284 | this.currentUserInfo = editModel as editModel; |
| 281 | this.listData.push(...EditInfoViewModel.getEditListInfo(editModel)) | 285 | this.listData.push(...EditInfoViewModel.getEditListInfo(editModel)) |
| 282 | }); | 286 | }); |
| 287 | + this.getAreaList() | ||
| 283 | }else { | 288 | }else { |
| 284 | EditInfoViewModel.queryPeopleAccountOwnerInfo(getContext(this)).then((peopleItem) => { | 289 | EditInfoViewModel.queryPeopleAccountOwnerInfo(getContext(this)).then((peopleItem) => { |
| 285 | EditInfoViewModel.queryAccountOwnerInfo(getContext(this)).then((editM) => { | 290 | EditInfoViewModel.queryAccountOwnerInfo(getContext(this)).then((editM) => { |
| @@ -290,6 +295,7 @@ struct EditUserInfoPage { | @@ -290,6 +295,7 @@ struct EditUserInfoPage { | ||
| 290 | this.currentUserInfo = editM as editModel; | 295 | this.currentUserInfo = editM as editModel; |
| 291 | this.listData.push(...EditInfoViewModel.getEditListInfo(editM)) | 296 | this.listData.push(...EditInfoViewModel.getEditListInfo(editM)) |
| 292 | }); | 297 | }); |
| 298 | + this.getAreaList() | ||
| 293 | }); | 299 | }); |
| 294 | } | 300 | } |
| 295 | } | 301 | } |
| @@ -17,7 +17,7 @@ export struct AreaPickerDialog { | @@ -17,7 +17,7 @@ export struct AreaPickerDialog { | ||
| 17 | secondSelect:number = 0 | 17 | secondSelect:number = 0 |
| 18 | thirdSelect:number = 0 | 18 | thirdSelect:number = 0 |
| 19 | 19 | ||
| 20 | - confirmCallback: (province:string,city:string,county:string,address:string) => void = () => { | 20 | + confirmCallback: (province:AreaListManageModel,city:AreaListManageModel,county:AreaListManageModel,address:string) => void = () => { |
| 21 | 21 | ||
| 22 | } | 22 | } |
| 23 | 23 | ||
| @@ -43,7 +43,7 @@ export struct AreaPickerDialog { | @@ -43,7 +43,7 @@ export struct AreaPickerDialog { | ||
| 43 | Button('提交',{type:ButtonType.Normal}) | 43 | Button('提交',{type:ButtonType.Normal}) |
| 44 | .onClick(()=> { | 44 | .onClick(()=> { |
| 45 | this.controller.close() | 45 | this.controller.close() |
| 46 | - this.confirmCallback(this.currentFirst.label,this.currentSecondBean.label,this.currentThirdBean.label,this.currentFirst.label+this.currentSecondBean.label+this.currentThirdBean.label); | 46 | + this.confirmCallback(this.currentFirst,this.currentSecondBean,this.currentThirdBean,this.currentFirst.label+this.currentSecondBean.label+this.currentThirdBean.label); |
| 47 | }) | 47 | }) |
| 48 | .width(60) | 48 | .width(60) |
| 49 | .backgroundColor(0xffffff) | 49 | .backgroundColor(0xffffff) |
| @@ -39,11 +39,17 @@ export class EditInfoModel{ | @@ -39,11 +39,17 @@ export class EditInfoModel{ | ||
| 39 | address:string = '' | 39 | address:string = '' |
| 40 | //生日 | 40 | //生日 |
| 41 | birthday:string = '' | 41 | birthday:string = '' |
| 42 | + | ||
| 43 | + creatorId:string = '' | ||
| 42 | //性别 | 44 | //性别 |
| 43 | sex:number = 0 | 45 | sex:number = 0 |
| 44 | 46 | ||
| 45 | airec:number = 0 | 47 | airec:number = 0 |
| 46 | 48 | ||
| 49 | + districtCode:string = '' | ||
| 50 | + provinceCode:string = '' | ||
| 51 | + cityCode:string = '' | ||
| 52 | + | ||
| 47 | } | 53 | } |
| 48 | 54 | ||
| 49 | export class editModel{ | 55 | export class editModel{ |
| @@ -84,6 +90,14 @@ export interface editModelParams { | @@ -84,6 +90,14 @@ export interface editModelParams { | ||
| 84 | birthday?:string; | 90 | birthday?:string; |
| 85 | //性别 | 91 | //性别 |
| 86 | sex?:string; | 92 | sex?:string; |
| 93 | + | ||
| 94 | + ///人民号 | ||
| 95 | + name?: string; | ||
| 96 | + districtCode?:string; | ||
| 97 | + countryCode?:string; | ||
| 98 | + provinceCode?:string; | ||
| 99 | + cityCode?:string; | ||
| 100 | + creatorId?:string; | ||
| 87 | } | 101 | } |
| 88 | 102 | ||
| 89 | 103 |
| @@ -139,6 +139,8 @@ class EditInfoViewModel { | @@ -139,6 +139,8 @@ class EditInfoViewModel { | ||
| 139 | } | 139 | } |
| 140 | 140 | ||
| 141 | updateUserInfo(item:editModel):Promise<ResponseDTO> { | 141 | updateUserInfo(item:editModel):Promise<ResponseDTO> { |
| 142 | + | ||
| 143 | + if (item.userType === 1){ | ||
| 142 | if (item.editDataType == WDEditDataModelType.WDEditDataModelType_head) { | 144 | if (item.editDataType == WDEditDataModelType.WDEditDataModelType_head) { |
| 143 | } else if (item.editDataType == WDEditDataModelType.WDEditDataModelType_nickname) { | 145 | } else if (item.editDataType == WDEditDataModelType.WDEditDataModelType_nickname) { |
| 144 | this.params = { userName: item.userName } | 146 | this.params = { userName: item.userName } |
| @@ -171,6 +173,41 @@ class EditInfoViewModel { | @@ -171,6 +173,41 @@ class EditInfoViewModel { | ||
| 171 | promptAction.showToast({ message: error.message }) | 173 | promptAction.showToast({ message: error.message }) |
| 172 | }) | 174 | }) |
| 173 | }) | 175 | }) |
| 176 | + }else { | ||
| 177 | + let url = '' | ||
| 178 | + if (item.editDataType == WDEditDataModelType.WDEditDataModelType_head) { | ||
| 179 | + url = '/api/rmrb-creator-user/c/rmrb-creator-user/creator/updateIcon' | ||
| 180 | + } else if (item.editDataType == WDEditDataModelType.WDEditDataModelType_nickname) { | ||
| 181 | + this.params = { name: item.userName} | ||
| 182 | + url = '/api/rmrb-creator-user/c/rmrb-creator-user/creator/updateName' | ||
| 183 | + } else if (item.editDataType == WDEditDataModelType.WDEditDataModelType_intro) { | ||
| 184 | + this.params = { introduction: item.userExtend.introduction } | ||
| 185 | + url = '/api/rmrb-creator-user/c/rmrb-creator-user/creator/updateIntroduction' | ||
| 186 | + } else if (item.editDataType == WDEditDataModelType.WDEditDataModelType_region) { | ||
| 187 | + this.params = {provinceCode:item.userExtend.provinceCode,cityCode:item.userExtend.cityCode, districtCode: item.userExtend.districtCode ,countryCode:'86'} | ||
| 188 | + url = '/api/rmrb-creator-user/c/rmrb-creator-user/creator/updateArea' | ||
| 189 | + } | ||
| 190 | + | ||
| 191 | + this.params.creatorId = item.userExtend.creatorId | ||
| 192 | + | ||
| 193 | + return new Promise((success, error) => { | ||
| 194 | + this.BasePostRequest(url,this.params) | ||
| 195 | + .then((navResDTO: ResponseDTO) => { | ||
| 196 | + if (navResDTO.code == 0) { | ||
| 197 | + promptAction.showToast({ message: '您的资料已提交' }) | ||
| 198 | + success(navResDTO) | ||
| 199 | + }else { | ||
| 200 | + promptAction.showToast({ message: navResDTO.message }) | ||
| 201 | + } | ||
| 202 | + }) | ||
| 203 | + .catch((error: Error) => { | ||
| 204 | + Logger.info(TAG,'updateUserInfo','EditInfoViewModel') | ||
| 205 | + promptAction.showToast({ message: error.message }) | ||
| 206 | + }) | ||
| 207 | + }) | ||
| 208 | + } | ||
| 209 | + | ||
| 210 | + | ||
| 174 | } | 211 | } |
| 175 | } | 212 | } |
| 176 | 213 |
-
Please register or login to post a comment