diff --git a/star_lock/lib/main/lockDetail/passwordKey/passwordKey_perpetual/passwordKey_perpetual_logic.dart b/star_lock/lib/main/lockDetail/passwordKey/passwordKey_perpetual/passwordKey_perpetual_logic.dart index d761dbc1..9ae822f0 100644 --- a/star_lock/lib/main/lockDetail/passwordKey/passwordKey_perpetual/passwordKey_perpetual_logic.dart +++ b/star_lock/lib/main/lockDetail/passwordKey/passwordKey_perpetual/passwordKey_perpetual_logic.dart @@ -79,6 +79,8 @@ class PasswordKeyPerpetualLogic extends BaseGetXController { //清空码 getKeyType = '4'; } + print('得到的类型为getKeyType$getKeyType'); + if (state.widgetType.value != '0' && state.widgetType.value != '2' && state.widgetType.value != '5') { diff --git a/star_lock/lib/main/lockDetail/passwordKey/passwordKey_perpetual/passwordKey_perpetual_page.dart b/star_lock/lib/main/lockDetail/passwordKey/passwordKey_perpetual/passwordKey_perpetual_page.dart index 0b65cdfb..d6c63233 100644 --- a/star_lock/lib/main/lockDetail/passwordKey/passwordKey_perpetual/passwordKey_perpetual_page.dart +++ b/star_lock/lib/main/lockDetail/passwordKey/passwordKey_perpetual/passwordKey_perpetual_page.dart @@ -49,12 +49,13 @@ class _PasswordKeyPerpetualPageState extends State { if (!state.isInitialized.value) { state.isInitialized.value = true; state.keyInfo.value = widget.getKeyInfo; - state.widgetType.value = widget.type; } } @override Widget build(BuildContext context) { + state.widgetType.value = widget.type; + return SingleChildScrollView( child: Obx(() => indexChangeWidget()), ); @@ -290,19 +291,11 @@ class _PasswordKeyPerpetualPageState extends State { isHaveLine: true, isHaveDirection: true, action: () { - // Pickers.showDatePicker(context, mode: DateMode.H, onConfirm: (p) { - // state.effectiveDateTime.value = DateTime.parse( - // '${p.year}-${intToStr(p.month!)}-${intToStr(p.day!)} ${intToStr(p.hour!)}'); - // state.loopEffectiveDate.value = - // "${formatDate(state.effectiveDateTime.value, [HH])}:00"; - // state.loopStartHours.value = p.hour!; - // state.selectEffectiveDate.value = state.loopEffectiveDate.value; - // }); Pickers.showDatePicker(context, mode: DateMode.H, onConfirm: (p) { DateTime selectedDateTime = DateTime( - p.year!, - p.month!, - p.day!, + DateTime.now().year, + DateTime.now().month, + DateTime.now().day, p.hour!, ); @@ -311,8 +304,8 @@ class _PasswordKeyPerpetualPageState extends State { state.loopEffectiveDate.value = "${formatDate(state.effectiveDateTime.value, [HH])}:00"; state.loopStartHours.value = p.hour!; - state.selectEffectiveDate.value = - state.loopEffectiveDate.value; + // state.selectEffectiveDate.value = + // formatDate(state.effectiveDateTime.value, [HH]); } else { // 处理日期不合法的情况,可以使用默认值或者其他策略 } @@ -323,19 +316,11 @@ class _PasswordKeyPerpetualPageState extends State { rightTitle: state.loopFailureDate.value, isHaveDirection: true, action: () { - // Pickers.showDatePicker(context, mode: DateMode.H, onConfirm: (p) { - // state.failureDateTime.value = DateTime.parse( - // '${p.year}-${intToStr(p.month!)}-${intToStr(p.day!)} ${intToStr(p.hour!)}'); - // state.loopFailureDate.value = - // "${formatDate(state.failureDateTime.value, [HH])}:00"; - // state.loopEndHours.value = p.hour!; - // state.selectFailureDate.value = state.loopFailureDate.value; - // }); Pickers.showDatePicker(context, mode: DateMode.H, onConfirm: (p) { DateTime selectedDateTime = DateTime( - p.year!, - p.month!, - p.day!, + DateTime.now().year, + DateTime.now().month, + DateTime.now().day, p.hour!, ); @@ -344,7 +329,8 @@ class _PasswordKeyPerpetualPageState extends State { state.loopFailureDate.value = "${formatDate(state.failureDateTime.value, [HH])}:00"; state.loopEndHours.value = p.hour!; - state.selectFailureDate.value = state.loopFailureDate.value; + // state.selectFailureDate.value = + // formatDate(state.failureDateTime.value, [HH]); } else { // 处理日期不合法的情况,可以使用默认值或者其他策略 } diff --git a/star_lock/lib/network/api_provider_base.dart b/star_lock/lib/network/api_provider_base.dart index cfd44cec..796d5700 100644 --- a/star_lock/lib/network/api_provider_base.dart +++ b/star_lock/lib/network/api_provider_base.dart @@ -56,9 +56,7 @@ class BaseProvider extends GetConnect with Api { body: rs as T, statusText: res.statusText, ); - }else{ - - } + } else {} // print('得到的数据======>bodyString:${res.bodyString} body:${res.body} bodyBytes:${res.bodyBytes} status:${res.status} statusText:${res.statusText} statusCode:${res.statusCode}'); getDataResult(res.body); return res;