diff --git a/lib/main/lockDetail/card/cardList/cardList_logic.dart b/lib/main/lockDetail/card/cardList/cardList_logic.dart index a11cd18c..022ff0fb 100755 --- a/lib/main/lockDetail/card/cardList/cardList_logic.dart +++ b/lib/main/lockDetail/card/cardList/cardList_logic.dart @@ -28,6 +28,7 @@ class CardListLogic extends BaseGetXController { // 获取解析后的数据 late StreamSubscription _replySubscription; + void _initReplySubscription() { _replySubscription = EventBusManager().eventBus!.on().listen((Reply reply) { @@ -69,11 +70,15 @@ class CardListLogic extends BaseGetXController { userID: (await Storage.getUid())!, cardNo: state.deletCardNo, useCountLimit: 0xffff, - operate: state.isDeletAll == true ? 3 : 2, // 0:注册 1:修改 2:删除 3:删除全部 + operate: state.isDeletAll == true ? 3 : 2, + // 0:注册 1:修改 2:删除 3:删除全部 isAdmin: 0, - isForce: 0, // 是否是胁迫 - isRound: 0, // 是否是循环 - weekRound: 0, // 周循环 + isForce: 0, + // 是否是胁迫 + isRound: 0, + // 是否是循环 + weekRound: 0, + // 周循环 startDate: 0x11223344, endDate: 0x11223344, startTime: '0', @@ -116,11 +121,15 @@ class CardListLogic extends BaseGetXController { userID: (await Storage.getUid())!, cardNo: state.deletCardNo, useCountLimit: 0xffff, - operate: state.isDeletAll == true ? 3 : 2, // 0:注册 1:修改 2:删除 3:删除全部 + operate: state.isDeletAll == true ? 3 : 2, + // 0:注册 1:修改 2:删除 3:删除全部 isAdmin: 0, - isForce: 0, // 是否是胁迫 - isRound: 0, // 是否是循环 - weekRound: 0, // 周循环 + isForce: 0, + // 是否是胁迫 + isRound: 0, + // 是否是循环 + weekRound: 0, + // 周循环 startDate: 0x11223344, endDate: 0x11223344, startTime: '0', @@ -193,6 +202,7 @@ class CardListLogic extends BaseGetXController { // 监听修改完详情之后刷新列表 late StreamSubscription _teamEvent; + void _initRefreshAction() { _teamEvent = eventBus .on() @@ -240,6 +250,7 @@ class CardListLogic extends BaseGetXController { _initRefreshAction(); } + await getICCardListData(isRefresh: true); } @override diff --git a/lib/main/lockDetail/card/cardList/cardList_page.dart b/lib/main/lockDetail/card/cardList/cardList_page.dart index 705d5c8c..f5fe77e1 100755 --- a/lib/main/lockDetail/card/cardList/cardList_page.dart +++ b/lib/main/lockDetail/card/cardList/cardList_page.dart @@ -31,24 +31,24 @@ class _CardListPageState extends State with RouteAware { final CardListLogic logic = Get.put(CardListLogic()); final CardListState state = Get.find().state; - Future getHttpData({required bool isRefresh}) async { - final bool? isDemoMode = await Storage.getBool(ifIsDemoModeOrNot); - if (isDemoMode == false) { - logic - .getICCardListData(isRefresh: isRefresh) - .then((FingerprintListDataEntity value) { - if (mounted) { - setState(() {}); - } - }); - } - } + // Future logic.getICCardListData({required bool isRefresh}) async { + // final bool? isDemoMode = await Storage.getBool(ifIsDemoModeOrNot); + // if (isDemoMode == false) { + // logic + // .getICCardListData(isRefresh: isRefresh) + // .then((FingerprintListDataEntity value) { + // if (mounted) { + // setState(() {}); + // } + // }); + // } + // } @override void initState() { super.initState(); - getHttpData(isRefresh: true); + // logic.getICCardListData(isRefresh: true); } @override @@ -92,17 +92,17 @@ class _CardListPageState extends State with RouteAware { ), body: EasyRefreshTool( onRefresh: () { - getHttpData(isRefresh: true); + logic.getICCardListData(isRefresh: true); }, onLoad: () { - getHttpData(isRefresh: false); + logic.getICCardListData(isRefresh: false); }, child: Column( children: [ KeySearchWidget( editingController: state.searchController, onSubmittedAction: () { - getHttpData(isRefresh: true); + logic.getICCardListData(isRefresh: true); }, ), SizedBox(height: 20.h), @@ -115,10 +115,10 @@ class _CardListPageState extends State with RouteAware { 'fromType': 1 // 1从添加钥匙列表进入 2从考勤添加员工入口进入 })! .then((value) { - getHttpData(isRefresh: true); + logic.getICCardListData(isRefresh: true); }); // if (data != null) { - // getHttpData(isRefresh: true); + // logic.getICCardListData(isRefresh: true); // } }, ), @@ -180,9 +180,9 @@ class _CardListPageState extends State with RouteAware { arguments: { 'fingerprintItemData': fingerprintItemData, })! - .then((value) => getHttpData(isRefresh: true)); + .then((value) => logic.getICCardListData(isRefresh: true)); // if (data != null) { - // getHttpData(isRefresh: true); + // logic.getICCardListData(isRefresh: true); // } }), );