diff --git a/lib/config/config.dart b/lib/config/config.dart index c697f9f9..a9aacb75 100644 --- a/lib/config/config.dart +++ b/lib/config/config.dart @@ -19,8 +19,8 @@ var PACKAGES_ORDERS = '/api/orders'; var PACKAGES_ORDER_HISTORY = '/api/orders/items'; var PACKAGES_TAMARA_OPT = '/api/orders/paymentoptions/tamara'; // var BASE_URL = 'http://10.50.100.198:3334/'; - var BASE_URL = 'https://uat.hmgwebservices.com/'; -// var BASE_URL = 'https://hmgwebservices.com/'; +// var BASE_URL = 'https://uat.hmgwebservices.com/'; +var BASE_URL = 'https://hmgwebservices.com/'; // Pharmacy UAT URLs // var BASE_PHARMACY_URL = 'https://uat.hmgwebservices.com/epharmacy/api/'; diff --git a/lib/config/localized_values.dart b/lib/config/localized_values.dart index fc913a3d..ac845410 100644 --- a/lib/config/localized_values.dart +++ b/lib/config/localized_values.dart @@ -1381,7 +1381,7 @@ const Map localizedValues = { "order-overview": {"en": "Order Overview", "ar": "ملخص الطلب"}, "shipping-address": {"en": "Delivery Address", "ar": "عنوان التوصيل"}, "pharmacy-relogin": {"en": "Your session has timed out, please try again", "ar": "انتهت مهلة جلسة الخاص بها. يرجى المحاولة مرة أخرى"}, - "ancillary-orders": {"en": "Ancillary Orders", "ar": "الأوامر التبعية"}, + "ancillary-orders": {"en": "Ancillary Orders", "ar": "الطلبات الاضافية"}, "onlineCheckInAgreement": { "en": "The online check-in is for non-life threatening situationCall the red crescent (number) or go to the nearest emergency department if there are: signs of stroke or heart attack history of seizure or syncope there is limb or life threatening injury picture of severe injuries​", diff --git a/lib/core/service/client/base_app_client.dart b/lib/core/service/client/base_app_client.dart index 61aa3d1d..8e864293 100644 --- a/lib/core/service/client/base_app_client.dart +++ b/lib/core/service/client/base_app_client.dart @@ -16,7 +16,6 @@ import 'package:diplomaticquarterapp/uitl/utils.dart'; import 'package:diplomaticquarterapp/widgets/transitions/fade_page.dart'; import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; -import 'package:flutter_inappwebview/flutter_inappwebview.dart'; import 'package:http/http.dart' as http; import 'package:provider/provider.dart'; @@ -44,7 +43,8 @@ class BaseAppClient { Function(String error, int statusCode) onFailure, bool isAllowAny = false, bool isExternal = false, - bool isRCService = false, bool bypassConnectionCheck = false}) async { + bool isRCService = false, + bool bypassConnectionCheck = false}) async { String url; if (isExternal) { url = endPoint; @@ -137,9 +137,11 @@ class BaseAppClient { body.removeWhere((key, value) => key == null || value == null); - print("URL : $url"); - final jsonBody = json.encode(body); - print(jsonBody); + if (BASE_URL == "https://uat.hmgwebservices.com/") { + print("URL : $url"); + final jsonBody = json.encode(body); + print(jsonBody); + } if (await Utils.checkConnection(bypassConnectionCheck: bypassConnectionCheck)) { final response = await http.post(Uri.parse(url.trim()), body: json.encode(body), headers: headers); @@ -883,14 +885,12 @@ class BaseAppClient { return token; } - - logApiFullUrlError(String fullUrl, error, code){ + logApiFullUrlError(String fullUrl, error, code) { final endpoint = Uri.parse(fullUrl).pathSegments.last; logApiEndpointError(endpoint, error, code); } - logApiEndpointError(String endPoint, error, code){ + logApiEndpointError(String endPoint, error, code) { _analytics.errorTracking.log(endPoint, error: error); } - } diff --git a/lib/models/rrt/RRTRequestModel.dart b/lib/models/rrt/RRTRequestModel.dart new file mode 100644 index 00000000..f4322fde --- /dev/null +++ b/lib/models/rrt/RRTRequestModel.dart @@ -0,0 +1,75 @@ +class RRTRequestModel { + num patientId; + int patientOutSa; + bool isOutPatient; + int nearestProjectId; + num longitude; + num latitude; + String additionalDetails; + String nationality; + num paymentAmount; + List procedures; + + RRTRequestModel( + {this.patientId, + this.patientOutSa, + this.isOutPatient, + this.nearestProjectId, + this.longitude, + this.latitude, + this.additionalDetails, + this.nationality, + this.paymentAmount, + this.procedures}); + + RRTRequestModel.fromJson(Map json) { + patientId = json['patientId']; + patientOutSa = json['patientOutSa']; + isOutPatient = json['isOutPatient']; + nearestProjectId = json['nearestProjectId']; + longitude = json['longitude']; + latitude = json['latitude']; + additionalDetails = json['additionalDetails']; + nationality = json['nationality']; + paymentAmount = json['paymentAmount']; + if (json['procedures'] != null) { + procedures = []; + json['procedures'].forEach((v) { + procedures.add(new Procedures.fromJson(v)); + }); + } + } + + Map toJson() { + final Map data = new Map(); + data['patientId'] = this.patientId; + data['patientOutSa'] = this.patientOutSa; + data['isOutPatient'] = this.isOutPatient; + data['nearestProjectId'] = this.nearestProjectId; + data['longitude'] = this.longitude; + data['latitude'] = this.latitude; + data['additionalDetails'] = this.additionalDetails; + data['nationality'] = this.nationality; + data['paymentAmount'] = this.paymentAmount; + if (this.procedures != null) { + data['procedures'] = this.procedures.map((v) => v.toJson()).toList(); + } + return data; + } +} + +class Procedures { + String serviceID; + + Procedures({this.serviceID}); + + Procedures.fromJson(Map json) { + serviceID = json['ServiceID']; + } + + Map toJson() { + final Map data = new Map(); + data['ServiceID'] = this.serviceID; + return data; + } +} diff --git a/lib/pages/ErService/rapid-response-team/rrt-place-order.dart b/lib/pages/ErService/rapid-response-team/rrt-place-order.dart index a7a00b08..ec28ac05 100644 --- a/lib/pages/ErService/rapid-response-team/rrt-place-order.dart +++ b/lib/pages/ErService/rapid-response-team/rrt-place-order.dart @@ -3,6 +3,7 @@ import 'package:diplomaticquarterapp/core/service/AlHabibMedicalService/customer import 'package:diplomaticquarterapp/core/viewModels/er/rrt-view-model.dart'; import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart'; import 'package:diplomaticquarterapp/models/rrt/RRTProcedureList.dart'; +import 'package:diplomaticquarterapp/models/rrt/RRTRequestModel.dart'; import 'package:diplomaticquarterapp/models/rrt/service_price.dart'; import 'package:diplomaticquarterapp/pages/AlHabibMedicalService/ComprehensiveMedicalCheckup/Dialog/confirm_dialog.dart'; import 'package:diplomaticquarterapp/pages/ErService/rapid-response-team/rrt-main-screen.dart'; @@ -173,20 +174,34 @@ class RRTPlaceOrderPage extends StatelessWidget { if (selectedAddress != null && selectedAddress.latLong != null && selectedAddress.latLong.isNotEmpty && selectedAddress.latLong.split(',').length > 1) { GifLoaderDialogUtils.showMyDialog(_context); + RRTRequestModel rrtRequestModel = new RRTRequestModel(); + Procedures procedures = new Procedures(); + rrtRequestModel.procedures = []; + Map params = {}; var cordinates = selectedAddress.latLong.split(','); var latlng = LatLng(double.parse(cordinates.first), double.parse(cordinates.last)); - params['latitude'] = latlng.latitude; - params['longitude'] = latlng.longitude; - params['additionalDetails'] = noteController.text; - params['nationality'] = projectViewModel.user.nationalityID; - params['paymentAmount'] = selectedProcedure.patientShareWithTax; - params['procedureId'] = selectedProcedure.procedureID; - - // var response = await viewModel.createOrder(params); - // var requestId = await viewModel.createOrder(params); - var requestId = await viewModel.createOrderRC(params); + procedures.serviceID = selectedProcedure.procedureID; + + rrtRequestModel.latitude = latlng.latitude; + rrtRequestModel.longitude = latlng.longitude; + rrtRequestModel.additionalDetails = noteController.text; + rrtRequestModel.nationality = projectViewModel.user.nationalityID; + rrtRequestModel.paymentAmount = selectedProcedure.patientShareWithTax; + rrtRequestModel.nearestProjectId = 0; + rrtRequestModel.patientId = projectViewModel.user.patientID; + rrtRequestModel.patientOutSa = projectViewModel.user.outSA; + rrtRequestModel.procedures.add(procedures); + + // params['latitude'] = latlng.latitude; + // params['longitude'] = latlng.longitude; + // params['additionalDetails'] = noteController.text; + // params['nationality'] = projectViewModel.user.nationalityID; + // params['paymentAmount'] = selectedProcedure.patientShareWithTax; + // params['procedureId'] = selectedProcedure.procedureID; + + var requestId = await viewModel.createOrderRC(rrtRequestModel.toJson()); GifLoaderDialogUtils.hideDialog(_context); diff --git a/lib/pages/ToDoList/ToDo.dart b/lib/pages/ToDoList/ToDo.dart index 41a22c0b..1dfe7110 100644 --- a/lib/pages/ToDoList/ToDo.dart +++ b/lib/pages/ToDoList/ToDo.dart @@ -149,69 +149,74 @@ class _ToDoState extends State with SingleTickerProviderStateMixin { Row( mainAxisAlignment: MainAxisAlignment.spaceBetween, children: [ - Row( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - Padding( - padding: const EdgeInsets.only(top: 4.0), - child: widget.appoList[index].clinicID == 265 - ? Container( - margin: EdgeInsets.only(left: 5.0, right: 5.0), - child: SvgPicture.asset("assets/images/new/CoronaIcon.svg", width: 35.0, height: 35.0), - ) - : widget.appoList[index].isLiveCareAppointment - ? SvgPicture.asset("assets/images/new/virtual.svg") - : SvgPicture.asset("assets/images/new/hospital-visit.svg"), - - // SvgPicture.asset("assets/images/new/virtual.svg"), - ), - Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - Padding( - padding: const EdgeInsets.only(left: 8.0, right: 8.0), - child: Text( - widget.appoList[index].clinicID == 265 - ? TranslationBase.of(context).covidTestTodo - : widget.appoList[index].isLiveCareAppointment - ? TranslationBase.of(context).liveCareAppo - : TranslationBase.of(context).walkinAppo, - style: TextStyle(fontSize: 12, fontWeight: FontWeight.w600, color: Color(0xff2B353E), letterSpacing: -0.48)), - ), - Padding( - padding: const EdgeInsets.only(left: 8.0, right: 8.0), - child: CountdownTimer( - controller: - new CountdownTimerController(endTime: DateTime.now().millisecondsSinceEpoch + (widget.appoList[index].remaniningHoursTocanPay * 1000) * 60), - widgetBuilder: (_, CurrentRemainingTime time) { - return time != null - ? Text( - '${time.days != null ? time.days : "0"}:${time.hours != null ? time.hours.toString().length == 1 ? "0" + time.hours.toString() : time.hours : "00"}:${time.min}:${time.sec} ' + - TranslationBase.of(context).upcomingTimeLeft, - style: TextStyle(fontSize: 12, fontWeight: FontWeight.w600, color: CustomColors.accentColor, letterSpacing: -0.48)) - : Container(); - }, + Expanded( + flex: 2, + child: Row( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Padding( + padding: const EdgeInsets.only(top: 4.0), + child: widget.appoList[index].clinicID == 265 + ? Container( + margin: EdgeInsets.only(left: 5.0, right: 5.0), + child: SvgPicture.asset("assets/images/new/CoronaIcon.svg", width: 35.0, height: 35.0), + ) + : widget.appoList[index].isLiveCareAppointment + ? SvgPicture.asset("assets/images/new/virtual.svg") + : SvgPicture.asset("assets/images/new/hospital-visit.svg"), + + // SvgPicture.asset("assets/images/new/virtual.svg"), + ), + Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Padding( + padding: const EdgeInsets.only(left: 8.0, right: 8.0), + child: Text( + widget.appoList[index].clinicID == 265 + ? TranslationBase.of(context).covidTestTodo + : widget.appoList[index].isLiveCareAppointment + ? TranslationBase.of(context).liveCareAppo + : TranslationBase.of(context).walkinAppo, + style: TextStyle(fontSize: 12, fontWeight: FontWeight.w600, color: Color(0xff2B353E), letterSpacing: -0.48)), ), - ), - ], - ), - ], - ), - Container( - child: InkWell( - onTap: () { - performNextAction(widget.appoList[index]); - }, - child: Container( - padding: EdgeInsets.symmetric(vertical: 8, horizontal: 14), - decoration: BoxDecoration( - color: getNextActionButtonColor(widget.appoList[index].nextAction), - border: Border.all(color: Colors.white, width: 1), - borderRadius: BorderRadius.circular(6), + Padding( + padding: const EdgeInsets.only(left: 8.0, right: 8.0), + child: CountdownTimer( + controller: + new CountdownTimerController(endTime: DateTime.now().millisecondsSinceEpoch + (widget.appoList[index].remaniningHoursTocanPay * 1000) * 60), + widgetBuilder: (_, CurrentRemainingTime time) { + return time != null + ? Text( + '${time.days != null ? time.days : "0"}:${time.hours != null ? time.hours.toString().length == 1 ? "0" + time.hours.toString() : time.hours : "00"}:${time.min}:${time.sec} \n' + + TranslationBase.of(context).upcomingTimeLeft, + style: TextStyle(fontSize: 12, fontWeight: FontWeight.w600, color: CustomColors.accentColor, letterSpacing: -0.48)) + : Container(); + }, + ), + ), + ], ), - child: Text( - getNextActionText(widget.appoList[index].nextAction), - style: TextStyle(fontSize: 12, fontWeight: FontWeight.w600, color: Colors.white, letterSpacing: -0.4), + ], + ), + ), + Expanded( + child: Container( + child: InkWell( + onTap: () { + performNextAction(widget.appoList[index]); + }, + child: Container( + padding: EdgeInsets.symmetric(vertical: 8, horizontal: 14), + decoration: BoxDecoration( + color: getNextActionButtonColor(widget.appoList[index].nextAction), + border: Border.all(color: Colors.white, width: 1), + borderRadius: BorderRadius.circular(6), + ), + child: Text( + getNextActionText(widget.appoList[index].nextAction), + style: TextStyle(fontSize: 12, fontWeight: FontWeight.w600, color: Colors.white, letterSpacing: -0.4), + ), ), ), ), diff --git a/lib/pages/ToDoList/payment_method_select.dart b/lib/pages/ToDoList/payment_method_select.dart index c3af41a3..b76ac855 100644 --- a/lib/pages/ToDoList/payment_method_select.dart +++ b/lib/pages/ToDoList/payment_method_select.dart @@ -192,55 +192,55 @@ class _PaymentMethodState extends State { ), ), ), - Container( - width: double.infinity, - child: InkWell( - onTap: () { - updateSelectedPaymentMethod("TAMARA"); - }, - child: Card( - elevation: 0.0, - margin: EdgeInsets.fromLTRB(8.0, 16.0, 8.0, 8.0), - color: Colors.white, - shape: RoundedRectangleBorder( - borderRadius: BorderRadius.circular(10), - side: selectedPaymentMethod == "TAMARA" ? BorderSide(color: Colors.green, width: 2.0) : BorderSide(color: Colors.transparent, width: 0.0), - ), - child: Padding( - padding: const EdgeInsets.all(12.0), - child: Row( - children: [ - Container( - width: 24, - height: 24, - decoration: containerColorRadiusBorderWidth(selectedPaymentMethod == "TAMARA" ? CustomColors.accentColor : Colors.transparent, 100, Colors.grey, 0.5), - ), - mWidth(12), - Container( - height: 60.0, - padding: EdgeInsets.all(0.0), - width: 60, - child: Image.asset("assets/images/new/payment/tamara.png"), - ), - mFlex(1), - if (selectedPaymentMethod == "TAMARA") - Container( - decoration: containerRadius(CustomColors.green, 200), - padding: EdgeInsets.only(top: 6, bottom: 6, left: 12, right: 12), - child: Text( - TranslationBase.of(context).paymentSelected, - style: TextStyle( - color: Colors.white, - fontSize: 11, - ), - ), - ), - ], - ), - ), - ), - ), - ), + // Container( + // width: double.infinity, + // child: InkWell( + // onTap: () { + // updateSelectedPaymentMethod("TAMARA"); + // }, + // child: Card( + // elevation: 0.0, + // margin: EdgeInsets.fromLTRB(8.0, 16.0, 8.0, 8.0), + // color: Colors.white, + // shape: RoundedRectangleBorder( + // borderRadius: BorderRadius.circular(10), + // side: selectedPaymentMethod == "TAMARA" ? BorderSide(color: Colors.green, width: 2.0) : BorderSide(color: Colors.transparent, width: 0.0), + // ), + // child: Padding( + // padding: const EdgeInsets.all(12.0), + // child: Row( + // children: [ + // Container( + // width: 24, + // height: 24, + // decoration: containerColorRadiusBorderWidth(selectedPaymentMethod == "TAMARA" ? CustomColors.accentColor : Colors.transparent, 100, Colors.grey, 0.5), + // ), + // mWidth(12), + // Container( + // height: 60.0, + // padding: EdgeInsets.all(0.0), + // width: 60, + // child: Image.asset("assets/images/new/payment/tamara.png"), + // ), + // mFlex(1), + // if (selectedPaymentMethod == "TAMARA") + // Container( + // decoration: containerRadius(CustomColors.green, 200), + // padding: EdgeInsets.only(top: 6, bottom: 6, left: 12, right: 12), + // child: Text( + // TranslationBase.of(context).paymentSelected, + // style: TextStyle( + // color: Colors.white, + // fontSize: 11, + // ), + // ), + // ), + // ], + // ), + // ), + // ), + // ), + // ), if (widget.isShowInstallments) Container( width: double.infinity, diff --git a/lib/uitl/utils.dart b/lib/uitl/utils.dart index a416da03..da65edbd 100644 --- a/lib/uitl/utils.dart +++ b/lib/uitl/utils.dart @@ -363,13 +363,13 @@ class Utils { )); medical.add(InkWell( - onTap: () => projectViewModel.havePrivilege(14) ? Navigator.push(context, FadePage(page: AnicllaryOrders())) : null, + onTap: () => projectViewModel.havePrivilege(85) ? Navigator.push(context, FadePage(page: AnicllaryOrders())) : null, child: MedicalProfileItem( title: TranslationBase.of(context).anicllaryOrders, - imagePath: 'assets/images/al-habib_online_payment_service_icon.png', - isPngImage: true, + imagePath: 'ancillary.svg', + isPngImage: false, subTitle: TranslationBase.of(context).myInvoice, - isEnable: projectViewModel.havePrivilege(14), + isEnable: projectViewModel.havePrivilege(85), ), )); diff --git a/lib/widgets/in_app_browser/InAppBrowser.dart b/lib/widgets/in_app_browser/InAppBrowser.dart index 5562469b..2a8721ae 100644 --- a/lib/widgets/in_app_browser/InAppBrowser.dart +++ b/lib/widgets/in_app_browser/InAppBrowser.dart @@ -32,13 +32,13 @@ class MyInAppBrowser extends InAppBrowser { static String APPLE_PAY_PAYFORT_URL = 'https://hmgwebservices.com/PayFortWebLive/PayFortApi/MakeApplePayRequest'; // Payfort Payment Gateway URL LIVE // static String APPLE_PAY_PAYFORT_URL = 'https://hmgwebservices.com/PayFortWeb/PayFortApi/MakeApplePayRequest'; // Payfort Payment Gateway URL UAT - // static String SERVICE_URL = 'https://hmgwebservices.com/PayFortWeb/pages/SendPayFortRequest.aspx'; // Payfort Payment Gateway URL UAT + static String SERVICE_URL = 'https://hmgwebservices.com/PayFortWeb/pages/SendPayFortRequest.aspx'; // Payfort Payment Gateway URL UAT - static String SERVICE_URL = 'https://hmgwebservices.com/PayFortWebLive/pages/SendPayFortRequest.aspx'; //Payfort Payment Gateway URL LIVE + // static String SERVICE_URL = 'https://hmgwebservices.com/PayFortWebLive/pages/SendPayFortRequest.aspx'; //Payfort Payment Gateway URL LIVE - // static String PREAUTH_SERVICE_URL = 'https://hmgwebservices.com/PayFortWeb/pages/SendPayFortRequest.aspx'; // Payfort PreAuth Payment Gateway URL UAT + static String PREAUTH_SERVICE_URL = 'https://hmgwebservices.com/PayFortWeb/pages/SendPayFortRequest.aspx'; // Payfort PreAuth Payment Gateway URL UAT - static String PREAUTH_SERVICE_URL = 'https://hmgwebservices.com/PayFortWebLive/pages/SendPayFortRequest.aspx'; //Payfort PreAuth Payment Gateway URL Live Store + // static String PREAUTH_SERVICE_URL = 'https://hmgwebservices.com/PayFortWebLive/pages/SendPayFortRequest.aspx'; //Payfort PreAuth Payment Gateway URL Live Store // static String PRESCRIPTION_PAYMENT_WITH_ORDERID = // 'https://uat.hmgwebservices.com/epharmacy/checkout/OpcCompleteRedirectionPaymentClientbyOrder?orderID=';