34 lines
1.3 KiB
Dart
Executable File
34 lines
1.3 KiB
Dart
Executable File
|
|
import 'package:get/get.dart';
|
|
import 'package:star_lock/tools/baseGetXController.dart';
|
|
import '../dateTool.dart';
|
|
import 'seletKeyCyclicDate_state.dart';
|
|
|
|
class SeletKeyCyclicDateLogic extends BaseGetXController {
|
|
SeletKeyCyclicDateState state = SeletKeyCyclicDateState();
|
|
|
|
void subBtnAction(){
|
|
final String starDateTimestamp = DateTool().dateToTimestamp(state.starDate.value, 1).toString();
|
|
final String endDateTimestamp = DateTool().dateToTimestamp(state.endDate.value, 1).toString();
|
|
final String starTimeTimestamp = DateTool().dateToTimestamp(state.starTime.value, 0).toString();
|
|
final String endTimeTimestamp = DateTool().dateToTimestamp(state.endTime.value, 0).toString();
|
|
|
|
if (int.parse(starDateTimestamp) > int.parse(endDateTimestamp)) {
|
|
showToast('失效日期需晚于生效日期'.tr);
|
|
return;
|
|
}
|
|
|
|
if (int.parse(starTimeTimestamp) >= int.parse(endTimeTimestamp)) {
|
|
showToast('失效时间需晚于生效时间'.tr);
|
|
return;
|
|
}
|
|
final Map<String, dynamic> resultMap = {};
|
|
resultMap['starDate'] = state.starDate.value;
|
|
resultMap['endDate'] = state.endDate.value;
|
|
resultMap['starTime'] = state.starTime.value;
|
|
resultMap['endTime'] = state.endTime.value;
|
|
resultMap['validityValue'] = state.weekDay.value;
|
|
Get.back(result: resultMap);
|
|
}
|
|
|
|
} |