diff --git a/star_lock/ios/Podfile.lock b/star_lock/ios/Podfile.lock index bdf57692..485df03f 100644 --- a/star_lock/ios/Podfile.lock +++ b/star_lock/ios/Podfile.lock @@ -125,8 +125,6 @@ PODS: - Flutter - package_info_plus (0.4.5): - Flutter - - partial_media_permissions (0.0.1): - - Flutter - path_provider_foundation (0.0.1): - Flutter - FlutterMacOS @@ -186,7 +184,6 @@ DEPENDENCIES: - just_audio (from `.symlinks/plugins/just_audio/ios`) - network_info_plus (from `.symlinks/plugins/network_info_plus/ios`) - package_info_plus (from `.symlinks/plugins/package_info_plus/ios`) - - partial_media_permissions (from `.symlinks/plugins/partial_media_permissions/ios`) - path_provider_foundation (from `.symlinks/plugins/path_provider_foundation/darwin`) - permission_handler_apple (from `.symlinks/plugins/permission_handler_apple/ios`) - shared_preferences_foundation (from `.symlinks/plugins/shared_preferences_foundation/darwin`) @@ -277,8 +274,6 @@ EXTERNAL SOURCES: :path: ".symlinks/plugins/network_info_plus/ios" package_info_plus: :path: ".symlinks/plugins/package_info_plus/ios" - partial_media_permissions: - :path: ".symlinks/plugins/partial_media_permissions/ios" path_provider_foundation: :path: ".symlinks/plugins/path_provider_foundation/darwin" permission_handler_apple: @@ -340,7 +335,6 @@ SPEC CHECKSUMS: just_audio: baa7252489dbcf47a4c7cc9ca663e9661c99aafa network_info_plus: 6d0c3eb8367b8164fa3fb0c19875e3f59d49697f package_info_plus: 6c92f08e1f853dc01228d6f553146438dafcd14e - partial_media_permissions: 0fd34002b1dbfd5e8b4c60eb0d99e8e755a77f76 path_provider_foundation: 3784922295ac71e43754bd15e0653ccfd36a147c permission_handler_apple: 9878588469a2b0d0fc1e048d9f43605f92e6cec2 ReachabilitySwift: 2128f3a8c9107e1ad33574c6e58e8285d460b149 diff --git a/star_lock/lib/main/lockDetail/fingerprint/fingerprintDetail/fingerprintDetail_logic.dart b/star_lock/lib/main/lockDetail/fingerprint/fingerprintDetail/fingerprintDetail_logic.dart index b1a01f56..b720e72a 100644 --- a/star_lock/lib/main/lockDetail/fingerprint/fingerprintDetail/fingerprintDetail_logic.dart +++ b/star_lock/lib/main/lockDetail/fingerprint/fingerprintDetail/fingerprintDetail_logic.dart @@ -32,7 +32,6 @@ class FingerprintDetailLogic extends BaseGetXController{ // 添加指纹开始 Future _replyAddFingerprintBegin(Reply reply) async { - int status = reply.data[2]; switch(status){ case 0x00: diff --git a/star_lock/lib/main/lockDetail/passwordKey/passwordKeyDetail/passwordKeyDetail_logic.dart b/star_lock/lib/main/lockDetail/passwordKey/passwordKeyDetail/passwordKeyDetail_logic.dart index bcd11bc7..34a698cc 100644 --- a/star_lock/lib/main/lockDetail/passwordKey/passwordKeyDetail/passwordKeyDetail_logic.dart +++ b/star_lock/lib/main/lockDetail/passwordKey/passwordKeyDetail/passwordKeyDetail_logic.dart @@ -24,7 +24,7 @@ class PasswordKeyDetailLogic extends BaseGetXController { void _initReplySubscription() { _replySubscription = EventBusManager().eventBus!.on().listen((reply) async { // 设置自定义密码 - if (reply is SenderCustomPasswordsReply) { + if (reply is SenderCustomPasswordsReply && state.ifCurrentScreen.value == true) { int status = reply.data[2]; switch (status) { case 0x00: diff --git a/star_lock/lib/main/lockDetail/passwordKey/passwordKeyDetail/passwordKeyDetail_page.dart b/star_lock/lib/main/lockDetail/passwordKey/passwordKeyDetail/passwordKeyDetail_page.dart index 81b243ae..eea0b79f 100644 --- a/star_lock/lib/main/lockDetail/passwordKey/passwordKeyDetail/passwordKeyDetail_page.dart +++ b/star_lock/lib/main/lockDetail/passwordKey/passwordKeyDetail/passwordKeyDetail_page.dart @@ -267,11 +267,11 @@ class _PasswordKeyDetailPageState extends State return senderDate; } - void showCupertinoAlertDialog( - BuildContext context, TextEditingController inputController) { + void showCupertinoAlertDialog(BuildContext context, TextEditingController inputController) { showDialog( context: context, builder: (BuildContext context) { + state.ifCurrentScreen.value = true; return ShowTFView( title: inputController == state.inputNameController ? "${TranslationLoader.lanKeys!.amend!.tr}${TranslationLoader.lanKeys!.name!.tr}" diff --git a/star_lock/lib/main/lockDetail/passwordKey/passwordKeyDetailChangeDate/passwordKeyDetailChangeDate_page.dart b/star_lock/lib/main/lockDetail/passwordKey/passwordKeyDetailChangeDate/passwordKeyDetailChangeDate_page.dart index 2790d7f7..62ec91fc 100644 --- a/star_lock/lib/main/lockDetail/passwordKey/passwordKeyDetailChangeDate/passwordKeyDetailChangeDate_page.dart +++ b/star_lock/lib/main/lockDetail/passwordKey/passwordKeyDetailChangeDate/passwordKeyDetailChangeDate_page.dart @@ -2,6 +2,7 @@ import 'package:date_format/date_format.dart'; import 'package:flutter/material.dart'; import 'package:flutter_screenutil/flutter_screenutil.dart'; import 'package:get/get.dart'; +import 'package:star_lock/app_settings/app_settings.dart'; import 'package:star_lock/main/lockDetail/passwordKey/passwordKeyDetailChangeDate/passwordKeyDetailChangeDate_logic.dart'; import 'package:star_lock/tools/pickers/pickers.dart'; import 'package:star_lock/tools/pickers/time_picker/model/date_mode.dart'; @@ -43,9 +44,16 @@ class _PasswordKeyDetailChangeDatePage style: TextStyle(color: Colors.white, fontSize: 24.sp), ), onPressed: () { - // if (state.lockId.value != 0 && state.pwdId.value.isNotEmpty) { + if (state.itemData.value.startDate! >= state.itemData.value.endDate!) { + logic.showToast("失效时间要大于生效时间".tr); + return; + } + + if (DateTime.now().millisecondsSinceEpoch >= state.itemData.value.endDate!) { + logic.showToast("失效时间要大于当前时间".tr); + return; + } logic.senderCustomPasswords(); - // } }, ), ], @@ -55,89 +63,77 @@ class _PasswordKeyDetailChangeDatePage } Widget buildMainUI() { - String getStartDate = ""; - String getEndDate = ""; - if (state.itemData.value.startDate != 0) { - DateTime startDateStr = - DateTime.fromMillisecondsSinceEpoch(state.itemData.value.startDate!); - getStartDate = startDateStr.toLocal().toString().substring(0, 16); - } else { - // DateTime startDateStr = - // DateTime.fromMillisecondsSinceEpoch(DateTime.now().millisecondsSinceEpoch); - // getStartDate = startDateStr.toLocal().toString().substring(0, 16); - - getStartDate = "${formatDate(DateTime.now(), [ - yyyy, - '-', - mm, - '-', - dd, - ' ', - HH, - ])}:00"; //生效时间 - // state.selectEffectiveDate.value = getStartDate; - state.itemData.value.startDate = - DateTime.parse(getStartDate).millisecondsSinceEpoch; - } - - if (state.itemData.value.endDate != 0) { - DateTime endDateStr = - DateTime.fromMillisecondsSinceEpoch(state.itemData.value.endDate!); - getEndDate = endDateStr.toLocal().toString().substring(0, 16); - } else { - // DateTime endDateStr = - // DateTime.fromMillisecondsSinceEpoch(DateTime.now().millisecondsSinceEpoch); - // getEndDate = endDateStr.toLocal().toString().substring(0, 16); - - getEndDate = "${formatDate(DateTime.now(), [ - yyyy, - '-', - mm, - '-', - dd, - ' ', - HH, - ])}:00"; //失效时间 - state.itemData.value.endDate = - DateTime.parse(getEndDate).millisecondsSinceEpoch; - } + // String getStartDate = ""; + // String getEndDate = ""; + // if (state.itemData.value.startDate != 0) { + // DateTime startDateStr = + // DateTime.fromMillisecondsSinceEpoch(state.itemData.value.startDate!); + // getStartDate = startDateStr.toLocal().toString().substring(0, 16); + // } else { + // // DateTime startDateStr = + // // DateTime.fromMillisecondsSinceEpoch(DateTime.now().millisecondsSinceEpoch); + // // getStartDate = startDateStr.toLocal().toString().substring(0, 16); + // + // getStartDate = "${formatDate(DateTime.now(), [ + // yyyy, + // '-', + // mm, + // '-', + // dd, + // ' ', + // HH, + // ])}:00"; //生效时间 + // // state.selectEffectiveDate.value = getStartDate; + // state.itemData.value.startDate = + // DateTime.parse(getStartDate).millisecondsSinceEpoch; + // } + // + // if (state.itemData.value.endDate != 0) { + // DateTime endDateStr = + // DateTime.fromMillisecondsSinceEpoch(state.itemData.value.endDate!); + // getEndDate = endDateStr.toLocal().toString().substring(0, 16); + // } else { + // // DateTime endDateStr = + // // DateTime.fromMillisecondsSinceEpoch(DateTime.now().millisecondsSinceEpoch); + // // getEndDate = endDateStr.toLocal().toString().substring(0, 16); + // + // getEndDate = "${formatDate(DateTime.now(), [ + // yyyy, + // '-', + // mm, + // '-', + // dd, + // ' ', + // HH, + // ])}:00"; //失效时间 + // state.itemData.value.endDate = + // DateTime.parse(getEndDate).millisecondsSinceEpoch; + // } return Column( children: [ Obx(() => CommonItem( leftTitel: TranslationLoader.lanKeys!.effectiveTime!.tr, - rightTitle: state.selectEffectiveDate.value.isNotEmpty - ? state.selectEffectiveDate.value - : getStartDate, + rightTitle: state.selectEffectiveDate.value, isHaveLine: true, isHaveDirection: true, action: () { PDuration selectDate = PDuration.parse( DateTime.parse(state.selectEffectiveDate.value)); - Pickers.showDatePicker(context, - selectDate: selectDate, mode: DateMode.YMDH, onConfirm: (p) { - state.selectEffectiveDate.value = - DateTool().getYMDHNDateString(p, 1); - // state.effectiveDateTime = DateTime.parse(state.selectEffectiveDate.value); - state.itemData.value.startDate = DateTool().dateToTimestamp( - state.selectEffectiveDate.value, 1); //更新开始时间 + Pickers.showDatePicker(context, selectDate: selectDate, mode: DateMode.YMDHM, onConfirm: (p) { + state.selectEffectiveDate.value = DateTool().getYMDHNDateString(p, 1); + state.itemData.value.startDate = DateTool().dateToTimestamp(state.selectEffectiveDate.value, 1); //更新开始时间 }); })), Obx(() => CommonItem( leftTitel: TranslationLoader.lanKeys!.failureTime!.tr, - rightTitle: state.selectFailureDate.value.isNotEmpty - ? state.selectFailureDate.value - : getEndDate, + rightTitle: state.selectFailureDate.value, isHaveDirection: true, action: () { - PDuration selectDate = PDuration.parse( - DateTime.parse(state.selectFailureDate.value)); - Pickers.showDatePicker(context, - selectDate: selectDate, mode: DateMode.YMDH, onConfirm: (p) { - state.selectFailureDate.value = - DateTool().getYMDHNDateString(p, 1); - state.itemData.value.endDate = DateTool() - .dateToTimestamp(state.selectFailureDate.value, 1); //更新结束时间 + PDuration selectDate = PDuration.parse(DateTime.parse(state.selectFailureDate.value)); + Pickers.showDatePicker(context, selectDate: selectDate, mode: DateMode.YMDHM, onConfirm: (p) { + state.selectFailureDate.value = DateTool().getYMDHNDateString(p, 1); + state.itemData.value.endDate = DateTool().dateToTimestamp(state.selectFailureDate.value, 1); //更新结束时间 }); })), ], diff --git a/star_lock/lib/main/lockDetail/passwordKey/passwordKeyDetailChangeDate/passwordKeyDetailChangeDate_state.dart b/star_lock/lib/main/lockDetail/passwordKey/passwordKeyDetailChangeDate/passwordKeyDetailChangeDate_state.dart index d3695f16..40d099f8 100644 --- a/star_lock/lib/main/lockDetail/passwordKey/passwordKeyDetailChangeDate/passwordKeyDetailChangeDate_state.dart +++ b/star_lock/lib/main/lockDetail/passwordKey/passwordKeyDetailChangeDate/passwordKeyDetailChangeDate_state.dart @@ -1,6 +1,7 @@ import 'package:flutter/material.dart'; import 'package:get/get.dart'; import 'package:star_lock/main/lockDetail/passwordKey/passwordKeyList/passwordKeyListEntity.dart'; +import 'package:star_lock/tools/dateTool.dart'; class PasswordKeyDetailChangeDateState { final itemData = PasswordKeyListItem().obs; @@ -15,6 +16,8 @@ class PasswordKeyDetailChangeDateState { Map map = Get.arguments; if ((map["itemData"] != null)) { itemData.value = map["itemData"]; + selectEffectiveDate.value = itemData.value.startDate == 0 ? DateTool().getNowDateWithType(2) : DateTool().dateToYMDHNString(itemData.value.startDate.toString()); + selectFailureDate.value = itemData.value.endDate == 0 ? DateTool().getNowDateWithType(2) : DateTool().dateToYMDHNString(itemData.value.endDate.toString()); } } } diff --git a/star_lock/pubspec.yaml b/star_lock/pubspec.yaml index 4814127d..9c25ad60 100644 --- a/star_lock/pubspec.yaml +++ b/star_lock/pubspec.yaml @@ -41,8 +41,9 @@ publish_to: 'none' # Remove this line if you wish to publish to pub.dev # 1.0.31+2024050301 打包鑫锁提审华为 # 1.0.32+2024051001:打包给欧阳回归测试 # 1.0.33+2024051401:打包给欧阳回归测试 +# 1.0.34+2024051402:打包给欧阳回归测试 -version: 1.0.33+2024051401 +version: 1.0.34+2024051402 environment: sdk: '>=2.12.0 <3.0.0'