|
|
@@ -26,6 +26,7 @@ class _OrderTakingPageState extends State < OrderTakingPage > with AutomaticKeep
|
|
|
List < bool > checkStatusList = [];
|
|
|
bool showLineStatus = true;
|
|
|
String lineIdStr = '';
|
|
|
+ String oldLineIdStr = '';
|
|
|
int page = 1;
|
|
|
@override
|
|
|
void initState() {
|
|
|
@@ -290,10 +291,6 @@ class _OrderTakingPageState extends State < OrderTakingPage > with AutomaticKeep
|
|
|
}
|
|
|
|
|
|
void switchLine(BuildContext context) { //切换线路
|
|
|
- setState(() {
|
|
|
- orderList = [];
|
|
|
- hasNextPage =true;
|
|
|
- });
|
|
|
lineIdStr = '';
|
|
|
for (int i = 0; i < checkStatusList.length; i++) {
|
|
|
if (checkStatusList[i]) {
|
|
|
@@ -301,6 +298,11 @@ class _OrderTakingPageState extends State < OrderTakingPage > with AutomaticKeep
|
|
|
}
|
|
|
}
|
|
|
lineIdStr = lineIdStr.substring(0, lineIdStr.length - 1);
|
|
|
+ if(oldLineIdStr==lineIdStr) return;
|
|
|
+ setState(() {
|
|
|
+ orderList = [];
|
|
|
+ hasNextPage =true;
|
|
|
+ });
|
|
|
getOrderList(stationId, lineIdStr, page).then((resp) {
|
|
|
if(isNotError(context, resp)){
|
|
|
OrderListObj tempObj =OrderListObj.fromJson(resp.data);
|
|
|
@@ -308,6 +310,7 @@ class _OrderTakingPageState extends State < OrderTakingPage > with AutomaticKeep
|
|
|
orderList = tempObj.data.items;
|
|
|
hasNextPage = tempObj.data.hasNextPage;
|
|
|
});
|
|
|
+ oldLineIdStr =lineIdStr;
|
|
|
}
|
|
|
});
|
|
|
}
|