|
...
|
...
|
@@ -36,6 +36,8 @@ import 'dart:convert' as convert; |
|
|
|
class NotebookDetailModel extends ChangeNotifier {
|
|
|
|
PageState pageState = PageState.Loading;
|
|
|
|
PageState pageStateChange = PageState.Loading;
|
|
|
|
PageState pageStateSim = PageState.Loading;
|
|
|
|
|
|
|
|
|
|
|
|
String selectNum;
|
|
|
|
int selectIndex;
|
|
...
|
...
|
@@ -403,7 +405,9 @@ class NotebookDetailModel extends ChangeNotifier { |
|
|
|
return null;
|
|
|
|
});
|
|
|
|
if (baseResp.code == Constant.status_success) {
|
|
|
|
return GetReserveTypeFieldModel.fromJson(baseResp.responseData).data;
|
|
|
|
reserveTypes =
|
|
|
|
GetReserveTypeFieldModel.fromJson(baseResp.responseData).data;
|
|
|
|
return reserveTypes;
|
|
|
|
} else {
|
|
|
|
pageState = PageState.ConnectivityError;
|
|
|
|
if (baseResp != null) {
|
|
...
|
...
|
@@ -413,6 +417,51 @@ class NotebookDetailModel extends ChangeNotifier { |
|
|
|
return null;
|
|
|
|
}
|
|
|
|
|
|
|
|
///获取已预订订单
|
|
|
|
Future<NotebookDetail> getReserveDetailSim(
|
|
|
|
BuildContext context, Map<String, String> params,
|
|
|
|
{isShowLoading = true, bool showCircle = false}) async {
|
|
|
|
if (isShowLoading) {
|
|
|
|
pageStateSim = PageState.Loading;
|
|
|
|
notifyListeners();
|
|
|
|
}
|
|
|
|
BaseResp<Map<String, dynamic>> baseResp = await DioUtil()
|
|
|
|
.request<Map<String, dynamic>>(
|
|
|
|
context, Method.post, HttpUrl.reserve_detail,
|
|
|
|
data: params, showLoading: isShowLoading ? false : showCircle)
|
|
|
|
.catchError((error) {
|
|
|
|
print(error.toString());
|
|
|
|
if (error is MyError) {
|
|
|
|
switch (error.type) {
|
|
|
|
case 1:
|
|
|
|
pageStateSim = PageState.ConnectivityError;
|
|
|
|
break;
|
|
|
|
case 2:
|
|
|
|
pageStateSim = PageState.ConnectivityTimeOut;
|
|
|
|
break;
|
|
|
|
default:
|
|
|
|
pageStateSim = PageState.ConnectivityError;
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
notifyListeners();
|
|
|
|
});
|
|
|
|
if (baseResp.code == Constant.status_success) {
|
|
|
|
if (baseResp.data.isEmpty) {
|
|
|
|
pageStateSim = PageState.Empty;
|
|
|
|
} else {
|
|
|
|
pageStateSim = PageState.Success;
|
|
|
|
}
|
|
|
|
notifyListeners();
|
|
|
|
return NotebookDetail.fromJson(baseResp.data);
|
|
|
|
} else {
|
|
|
|
pageStateSim = PageState.ConnectivityError;
|
|
|
|
if (baseResp != null) {
|
|
|
|
Utils.showToast(baseResp.msg ?? "");
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
///获取已预订订单
|
|
|
|
Future<NotebookDetail> getReserveDetail(
|
|
|
|
BuildContext context, Map<String, String> params,
|
...
|
...
|
|