|
|
|
|
@ -17,8 +17,11 @@ import 'package:diplomaticquarterapp/services/authentication/auth_provider.dart'
|
|
|
|
|
import 'package:diplomaticquarterapp/services/livecare_services/livecare_provider.dart';
|
|
|
|
|
import 'package:diplomaticquarterapp/uitl/app_shared_preferences.dart';
|
|
|
|
|
import 'package:diplomaticquarterapp/uitl/app_toast.dart';
|
|
|
|
|
import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart';
|
|
|
|
|
import 'package:diplomaticquarterapp/uitl/utils.dart';
|
|
|
|
|
import 'package:diplomaticquarterapp/widgets/dialogs/confirm_dialog.dart';
|
|
|
|
|
import 'package:diplomaticquarterapp/widgets/in_app_browser/InAppBrowser.dart';
|
|
|
|
|
import 'package:flutter/cupertino.dart';
|
|
|
|
|
import 'package:flutter/material.dart';
|
|
|
|
|
import 'package:smart_progress_bar/smart_progress_bar.dart';
|
|
|
|
|
|
|
|
|
|
@ -81,7 +84,13 @@ class _clinic_listState extends State<ClinicList> {
|
|
|
|
|
service
|
|
|
|
|
.getERAppointmentFees(selectedClinicID, context)
|
|
|
|
|
.then((res) {
|
|
|
|
|
erAppointmentFeesResponse = ERAppointmentFeesResponse.fromJson(res);
|
|
|
|
|
if (res['HasAppointment'] == true) {
|
|
|
|
|
isError = true;
|
|
|
|
|
showLiveCareCancelDialog(res['ErrorEndUserMessage'], res);
|
|
|
|
|
} else {
|
|
|
|
|
erAppointmentFeesResponse = ERAppointmentFeesResponse.fromJson(res);
|
|
|
|
|
isError = false;
|
|
|
|
|
}
|
|
|
|
|
})
|
|
|
|
|
.catchError((err) {
|
|
|
|
|
print(err);
|
|
|
|
|
@ -97,10 +106,57 @@ class _clinic_listState extends State<ClinicList> {
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
showLiveCareCancelDialog(String msg, res) {
|
|
|
|
|
ConfirmDialog dialog = new ConfirmDialog(
|
|
|
|
|
context: context,
|
|
|
|
|
confirmMessage: msg,
|
|
|
|
|
okText: TranslationBase.of(context).confirm,
|
|
|
|
|
cancelText: TranslationBase.of(context).cancel_nocaps,
|
|
|
|
|
okFunction: () =>
|
|
|
|
|
{cancelAppointment(res)},
|
|
|
|
|
cancelFunction: () => {});
|
|
|
|
|
dialog.showAlertDialog(context);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
cancelAppointment(res) {
|
|
|
|
|
AppoitmentAllHistoryResultList appo = AppoitmentAllHistoryResultList();
|
|
|
|
|
appo.clinicID = res['ClinicID'];
|
|
|
|
|
appo.doctorID = res['DoctorID'];
|
|
|
|
|
appo.endTime = res['EndTime'];
|
|
|
|
|
appo.projectID = res['ProjectID'];
|
|
|
|
|
appo.startTime = res['StrAppointmentDate'];
|
|
|
|
|
appo.appointmentNo = res['AppointmentID'];
|
|
|
|
|
appo.isLiveCareAppointment = true;
|
|
|
|
|
appo.originalClinicID = 0;
|
|
|
|
|
appo.originalProjectID = res['ProjectID'];
|
|
|
|
|
appo.appointmentDate = res['AppointmentDate'];
|
|
|
|
|
|
|
|
|
|
ConfirmDialog.closeAlertDialog(context);
|
|
|
|
|
DoctorsListService service = new DoctorsListService();
|
|
|
|
|
service
|
|
|
|
|
.cancelAppointment(appo, context)
|
|
|
|
|
.then((res) {
|
|
|
|
|
print(res);
|
|
|
|
|
if (res['MessageStatus'] == 1) {
|
|
|
|
|
AppToast.showSuccessToast(message: res['ErrorEndUserMessage']);
|
|
|
|
|
} else {
|
|
|
|
|
AppToast.showErrorToast(message: res['ErrorEndUserMessage']);
|
|
|
|
|
}
|
|
|
|
|
})
|
|
|
|
|
.catchError((err) {
|
|
|
|
|
print(err);
|
|
|
|
|
})
|
|
|
|
|
.showProgressBar(
|
|
|
|
|
text: "Loading", backgroundColor: Colors.blue.withOpacity(0.6))
|
|
|
|
|
.then((value) {
|
|
|
|
|
startLiveCare();
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
getERAppointmentTime(GetERAppointmentFeesList getERAppointmentFeesList) {
|
|
|
|
|
LiveCareService service = new LiveCareService();
|
|
|
|
|
service.getERAppointmentTime(selectedClinicID, context).then((res) {
|
|
|
|
|
print(res['WatingtimeInteger']);
|
|
|
|
|
print(res);
|
|
|
|
|
showLiveCarePaymentDialog(
|
|
|
|
|
getERAppointmentFeesList, res['WatingtimeInteger']);
|
|
|
|
|
}).catchError((err) {
|
|
|
|
|
|