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-05-28 16:52:10 +0800
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
2aad851588e09779884b90bdde206144bf3cd088
2aad8515
1 parent
2427fec5
feat:优化编辑资料
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
51 additions
and
33 deletions
sight_harmony/features/wdComponent/src/main/ets/components/page/EditUserInfoPage.ets
sight_harmony/features/wdComponent/src/main/ets/components/view/areaPickerDialog/DateCustomComponent.ets
sight_harmony/features/wdComponent/src/main/ets/components/view/areaPickerDialog/EditUserSexCustomDialog.ets
sight_harmony/features/wdComponent/src/main/ets/components/page/EditUserInfoPage.ets
View file @
2aad851
...
...
@@ -5,6 +5,7 @@ import EditInfoViewModel from '../../viewmodel/EditInfoViewModel';
import { WDRouterPage, WDRouterRule } from 'wdRouter';
import {AreaPickerDialog} from '../view/areaPickerDialog/AreaPickerDialog'
import {EditUserInfoCustomDialog} from '../view/areaPickerDialog/EditUserInfoCustomDialog'
import {EditUserSexCustomDialog} from '../view/areaPickerDialog/EditUserSexCustomDialog'
import { AreaListModel } from '../../model/AreaListModel';
import router from '@ohos.router';
import TrackingPageBrowseUtils from '../../utils/TrackingPageBrowseUtils'
...
...
@@ -58,6 +59,22 @@ struct EditUserInfoPage {
},
})
sexDialogController: CustomDialogController = new CustomDialogController({
builder: EditUserSexCustomDialog({
confirmCallback:(index)=>{
this.currentUserInfo.userExtend.sex = index;
this.currentUserInfo.editDataType = WDEditDataModelType.WDEditDataModelType_sex
this.updateEditModel()
}
}),
alignment: DialogAlignment.Bottom,
customStyle: true,
offset: {
dx: 0,
dy: -this.bottomSafeHeight
},
})
async aboutToAppear() {
let windowHight: window.Window = await window.getLastWindow(getContext(this));
this.bottomSafeHeight = px2vp(windowHight.getWindowAvoidArea(window.AvoidAreaType.TYPE_SYSTEM).bottomRect.height)
...
...
@@ -174,32 +191,8 @@ struct EditUserInfoPage {
this.dialogController.open()
} else if (i === 4) {
this.dateDialogController.open()
// DatePickerDialog.show({
// start:new Date('1900-1-1'),
// end:new Date(),
// selected:new Date,
// lunar:false,
// onAccept:(value:DatePickerResult) => {
// let mon = value.month as number + 1
// let monStr = mon < 10? '0'+mon.toString():mon.toString();
// let dayStr = value.day as number < 10? '0'+value.day:value.day;
// this.currentUserInfo.userExtend.birthday = value.year+'-'+monStr+'-'+dayStr;
// this.currentUserInfo.editDataType = WDEditDataModelType.WDEditDataModelType_birthday
// this.updateEditModel()
// }
// })
}else if(i === 5){
TextPickerDialog.show({
range:['男','女'],
canLoop:false,
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
this.updateEditModel()
}
})
this.sexDialogController.open()
}
})
}
...
...
sight_harmony/features/wdComponent/src/main/ets/components/view/areaPickerDialog/DateCustomComponent.ets
View file @
2aad851
...
...
@@ -14,14 +14,6 @@ export struct DateCustomComponent {
.onDateChange((value) => {
this.selectDate = value as Date
})
// .onDateChange:(value:DatePickerResult) => {
// let mon = value.month as number + 1
// let monStr = mon < 10? '0'+mon.toString():mon.toString();
// let dayStr = value.day as number < 10? '0'+value.day:value.day;
// this.currentUserInfo.userExtend.birthday = value.year+'-'+monStr+'-'+dayStr;
// this.currentUserInfo.editDataType = WDEditDataModelType.WDEditDataModelType_birthday
// this.updateEditModel()
// }
}.justifyContent(FlexAlign.Center)
}.height('100%')
}
...
...
sight_harmony/features/wdComponent/src/main/ets/components/view/areaPickerDialog/EditUserSexCustomDialog.ets
0 → 100644
View file @
2aad851
@CustomDialog
export struct EditUserSexCustomDialog {
controller: CustomDialogController
confirmCallback: (selectIndex:number) => void = () => {
}
build() {
Column(){
Button('男',{type:ButtonType.Normal}).height(45).width('100%').fontSize(14).fontColor('#222222').backgroundColor(0xffffff)
.onClick(()=>{
this.confirmCallback(1)
this.controller.close()
})
Divider()
.color('#f5f5f5')
.width('100%')
.strokeWidth(1)
Button('女',{type:ButtonType.Normal}).height(45).width('100%').fontSize(14).fontColor('#222222').backgroundColor(0xffffff)
.onClick(()=>{
this.confirmCallback(0)
this.controller.close()
})
Divider()
.color('#f5f5f5')
.width('100%')
.strokeWidth(5)
Button('取消',{type:ButtonType.Normal}).height(80).width('100%').fontSize(14).fontColor('#222222').backgroundColor(0xffffff)
.onClick(()=>{
this.controller.close()
})
}.height(176).width('100%').backgroundColor(Color.White)
}
}
\ No newline at end of file
...
...
Please
register
or
login
to post a comment