|
|
@@ -1,10 +1,12 @@
|
|
|
import {
|
|
|
BasicType,
|
|
|
DiaLogCompControl,
|
|
|
+ DiaLogSheetControl,
|
|
|
IBestToast,
|
|
|
userInfo,
|
|
|
UserInfo,
|
|
|
YTAvoid,
|
|
|
+ YtDatePicker,
|
|
|
YTHeader,
|
|
|
YTLog,
|
|
|
YTPhotoHelper,
|
|
|
@@ -62,11 +64,11 @@ struct SettingPage {
|
|
|
text: '生日',
|
|
|
click: () => {
|
|
|
// this.openReviseNameBuilder()
|
|
|
+ this.openTimePickerBuilder()
|
|
|
}
|
|
|
},
|
|
|
]
|
|
|
|
|
|
-
|
|
|
private options: BasicType[] = [
|
|
|
{
|
|
|
text: '拍照',
|
|
|
@@ -121,6 +123,23 @@ struct SettingPage {
|
|
|
})
|
|
|
}
|
|
|
|
|
|
+ // 打开时间选择器弹窗
|
|
|
+ openTimePickerBuilder() {
|
|
|
+ let control = new DiaLogSheetControl(this.getUIContext(), false)
|
|
|
+ yTRouter.router2BottomDialog({
|
|
|
+ param: { text: this.userInfo.getName() ?? this.userInfo.getPhoneNumber() ?? this.userInfo.getId()?.toString() },
|
|
|
+ control: control,
|
|
|
+ builder: () => {
|
|
|
+ this.DatePickerBuilder(control, '2025-11-04')
|
|
|
+ }
|
|
|
+ }, (info: PopInfo) => {
|
|
|
+ let ans = info.result as string
|
|
|
+ // YTUserRequest.changeNickname(ans, () => {
|
|
|
+ // IBestToast.show({ message: '名称修改成功' })
|
|
|
+ // })
|
|
|
+ })
|
|
|
+ }
|
|
|
+
|
|
|
build() {
|
|
|
Column() {
|
|
|
YTHeader({ defaultStyle: { title: '用户设置' }, bgc: Color.White })
|
|
|
@@ -270,4 +289,24 @@ struct SettingPage {
|
|
|
.alignItems(HorizontalAlign.Center)
|
|
|
.padding({left: 32, right: 32, top: 16, bottom: 8})
|
|
|
}
|
|
|
+
|
|
|
+ // 时间选择器
|
|
|
+ @Builder
|
|
|
+ DatePickerBuilder(control: DiaLogSheetControl, date: string){
|
|
|
+ YtDatePicker({
|
|
|
+ selectDateBack: (date?: Date): boolean => {
|
|
|
+ if(!date) return control._onBackPress()
|
|
|
+ // 转换为 YY-MM-DD HH:mm:ss 格式
|
|
|
+ const year = date.getFullYear().toString();
|
|
|
+ const month = (date.getMonth() + 1).toString().padStart(2, '0');
|
|
|
+ const day = date.getDate().toString().padStart(2, '0');
|
|
|
+
|
|
|
+ const result = `${year}-${month}-${day}`;
|
|
|
+ return control._onBackPress(result)
|
|
|
+ },
|
|
|
+ selectedDate: date ? new Date(date) : new Date(),
|
|
|
+ linearInfo: { colors: [['#FFF6F6F6', 1]] },
|
|
|
+ needCancel: true
|
|
|
+ })
|
|
|
+}
|
|
|
}
|