From f5e978e32cf5d14b2c97f173cb7fc59cb5c61cf5 Mon Sep 17 00:00:00 2001 From: Daisy <> Date: Wed, 13 Dec 2023 18:08:31 +0800 Subject: [PATCH] =?UTF-8?q?=E5=BE=AA=E7=8E=AF=E5=AF=86=E7=A0=81=E6=97=A5?= =?UTF-8?q?=E6=9C=9F=E6=A0=BC=E5=BC=8F=E9=97=AE=E9=A2=98=E4=BF=AE=E5=A4=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../passwordKey_perpetual_logic.dart | 2 + .../passwordKey_perpetual_page.dart | 38 ++++++------------- star_lock/lib/network/api_provider_base.dart | 4 +- 3 files changed, 15 insertions(+), 29 deletions(-) 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;