Ver Fonte

获取所有路线状态变化后缓存调整

daxu0403 há 7 anos atrás
pai
commit
d4373c03b9
2 ficheiros alterados com 14 adições e 1 exclusões
  1. 10 1
      lib/pages/my_page.dart
  2. 4 0
      lib/pages/order_taking_page.dart

+ 10 - 1
lib/pages/my_page.dart

@@ -99,8 +99,16 @@ class _MyPageState extends State < MyPage > with AutomaticKeepAliveClientMixin {
           check = true;
         });
       }
-      print(check);
     });
+    // getKey('btList').then((value){
+    //   //print(value);
+    //   if(value!=null && check==true){
+    //     List<BtInfoObj> tempList =json.decode(value);
+    //     setState(() {
+    //       btList=tempList;
+    //     });
+    //   }
+    // });
   }
 
   onEvent(Object obj) {
@@ -110,6 +118,7 @@ class _MyPageState extends State < MyPage > with AutomaticKeepAliveClientMixin {
       setState(() {
         btList = btSet.toList();
       });
+      //setKey('btList', btList.toString());
     }
   }
 

+ 4 - 0
lib/pages/order_taking_page.dart

@@ -316,23 +316,27 @@ class _OrderTakingPageState extends State < OrderTakingPage > with AutomaticKeep
   }
 
   void switchLine(BuildContext context) { //切换线路
+    print(checkStatusList.toString());
     lineIdStr = '';
     for (int i = 0; i < checkStatusList.length; i++) {
       if (checkStatusList[i]) {
         lineIdStr += lineList[i].id.toString() + ',';
       }
     }
+    print(lineIdStr);
     if (lineIdStr == '') {
       setState(() {
         orderList = [];
         hasNextPage = false;
       });
+      oldLineIdStr = lineIdStr;
        setKey('lineIdStr', lineIdStr);
       return;
     }
     lineIdStr = lineIdStr.substring(0, lineIdStr.length - 1);
 
     if (oldLineIdStr == lineIdStr) return;
+    print('11111');
     setState(() {
       orderList = [];
       hasNextPage = true;