fix:调整循环密码的失效时间问题
This commit is contained in:
parent
f17a7feb9c
commit
493fc19033
@ -295,21 +295,24 @@ class _PasswordKeyPerpetualPageState extends State<PasswordKeyPerpetualPage>
|
|||||||
action: () {
|
action: () {
|
||||||
final PDuration selectDate =
|
final PDuration selectDate =
|
||||||
PDuration.parse(DateTime.tryParse(state.endTime.value));
|
PDuration.parse(DateTime.tryParse(state.endTime.value));
|
||||||
Pickers.showDatePicker(context,
|
Pickers.showDatePicker(
|
||||||
selectDate: selectDate,
|
context,
|
||||||
// maxDate传入三年以后得今天的时间
|
selectDate: selectDate,
|
||||||
maxDate: PDuration(
|
// maxDate传入三年以后得今天的时间
|
||||||
year: DateTime.now().year + 3,
|
maxDate: PDuration(
|
||||||
month: DateTime.now().month,
|
year: DateTime.now().year + 3,
|
||||||
day: DateTime.now().day),
|
month: DateTime.now().month,
|
||||||
minDate: PDuration(
|
day: DateTime.now().day),
|
||||||
year: DateTime.now().year,
|
minDate: PDuration(
|
||||||
month: DateTime.now().month,
|
year: DateTime.now().year,
|
||||||
day: DateTime.now().day),
|
month: DateTime.now().month,
|
||||||
mode: DateMode.YMDH,
|
day: DateTime.now().day),
|
||||||
hourShow24: true, onConfirm: (PDuration p) {
|
mode: DateMode.YMDH,
|
||||||
state.endTime.value = DateTool().getYMDHNDateString(p, 4);
|
hourShow24: true,
|
||||||
});
|
onConfirm: (PDuration p) {
|
||||||
|
state.endTime.value = DateTool().getYMDHNDateString(p, 4);
|
||||||
|
},
|
||||||
|
);
|
||||||
}),
|
}),
|
||||||
Container(height: 10.h),
|
Container(height: 10.h),
|
||||||
],
|
],
|
||||||
@ -427,19 +430,20 @@ class _PasswordKeyPerpetualPageState extends State<PasswordKeyPerpetualPage>
|
|||||||
CommonDataManage().currentKeyInfo.model ==
|
CommonDataManage().currentKeyInfo.model ==
|
||||||
IoModelVendor.model_XL_WIFI),
|
IoModelVendor.model_XL_WIFI),
|
||||||
child: CommonItem(
|
child: CommonItem(
|
||||||
leftTitel: '结束日期'.tr,
|
leftTitel: '结束日期'.tr,
|
||||||
rightTitle: state.endTime.value,
|
rightTitle: state.endTime.value,
|
||||||
isHaveLine: true,
|
isHaveLine: true,
|
||||||
isHaveDirection: true,
|
isHaveDirection: true,
|
||||||
action: () {
|
action: () {
|
||||||
final PDuration selectDate =
|
final PDuration selectDate =
|
||||||
PDuration.parse(DateTime.tryParse(state.endTime.value));
|
PDuration.parse(DateTime.tryParse(state.endTime.value));
|
||||||
Pickers.showDatePicker(context,
|
Pickers.showDatePicker(context,
|
||||||
selectDate: selectDate,
|
selectDate: selectDate,
|
||||||
mode: DateMode.YMDH, onConfirm: (PDuration p) {
|
mode: DateMode.YMDH, onConfirm: (PDuration p) {
|
||||||
state.endTime.value = DateTool().getYMDHNDateString(p, 4);
|
state.endTime.value = DateTool().getYMDHNDateString(p, 4);
|
||||||
});
|
});
|
||||||
}),
|
},
|
||||||
|
),
|
||||||
),
|
),
|
||||||
CommonItem(
|
CommonItem(
|
||||||
leftTitel: '生效时间'.tr,
|
leftTitel: '生效时间'.tr,
|
||||||
@ -458,20 +462,26 @@ class _PasswordKeyPerpetualPageState extends State<PasswordKeyPerpetualPage>
|
|||||||
}, hourShow24: true);
|
}, hourShow24: true);
|
||||||
}),
|
}),
|
||||||
CommonItem(
|
CommonItem(
|
||||||
leftTitel: '失效时间'.tr,
|
leftTitel: '失效时间'.tr,
|
||||||
rightTitle: state.loopFailureDate.value,
|
rightTitle: state.loopFailureDate.value,
|
||||||
isHaveDirection: true,
|
isHaveDirection: true,
|
||||||
action: () {
|
action: () {
|
||||||
final PDuration selectDate = PDuration.parse(
|
final PDuration selectDate = PDuration.parse(
|
||||||
DateTool().dateToDateTime(state.loopFailureDate.value, 0));
|
DateTool().dateToDateTime(state.loopFailureDate.value, 0));
|
||||||
Pickers.showDatePicker(context,
|
Pickers.showDatePicker(
|
||||||
selectDate: selectDate,
|
context,
|
||||||
mode: DateMode.H, onConfirm: (PDuration p) {
|
selectDate: selectDate,
|
||||||
|
mode: DateMode.H,
|
||||||
|
onConfirm: (PDuration p) {
|
||||||
state.loopFailureDate.value =
|
state.loopFailureDate.value =
|
||||||
DateTool().getYMDHNDateString(p, 5);
|
DateTool().getYMDHNDateString(p, 5);
|
||||||
state.loopEndHours.value = p.hour!;
|
state.loopEndHours.value = p.hour!;
|
||||||
}, hourShow24: true);
|
state.endTime.value = DateTool().getYMDHNDateString(p, 4);
|
||||||
}),
|
},
|
||||||
|
hourShow24: true,
|
||||||
|
);
|
||||||
|
},
|
||||||
|
),
|
||||||
],
|
],
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user