4/3/9
This commit is contained in:
@@ -107,7 +107,9 @@ class OrderRequestController extends GetxController {
|
||||
// }
|
||||
}
|
||||
|
||||
void refuseOrder(orderID) async {
|
||||
void refuseOrder(
|
||||
orderID,
|
||||
) async {
|
||||
await CRUD().postFromDialogue(link: AppLink.addDriverOrder, payload: {
|
||||
//TODO need review
|
||||
'driver_id': box.read(BoxName.driverID),
|
||||
@@ -134,4 +136,34 @@ class OrderRequestController extends GetxController {
|
||||
Get.back();
|
||||
// Get.offAll(HomeCaptain());
|
||||
}
|
||||
|
||||
addRideToNotificationDriverString(
|
||||
orderID,
|
||||
String startLocation,
|
||||
String endLocation,
|
||||
String date,
|
||||
String time,
|
||||
String price,
|
||||
String passengerId,
|
||||
String status,
|
||||
String carType,
|
||||
String passengerRate,
|
||||
String priceForPassenger,
|
||||
String distance,
|
||||
) async {
|
||||
await CRUD().post(link: AppLink.addWaitingRide, payload: {
|
||||
'id': orderID,
|
||||
'start_location': startLocation,
|
||||
'end_location': endLocation,
|
||||
'date': date,
|
||||
'time': time,
|
||||
'price': price,
|
||||
'passenger_id': passengerId,
|
||||
'status': status,
|
||||
'carType': carType,
|
||||
'passengerRate': passengerRate,
|
||||
'price_for_passenger': priceForPassenger,
|
||||
'distance': distance,
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
@@ -834,6 +834,7 @@ class MapPassengerController extends GetxController {
|
||||
endNameAddress,
|
||||
box.read(BoxName.carType),
|
||||
kazan.toStringAsFixed(0),
|
||||
passengerRate.toStringAsFixed(2),
|
||||
];
|
||||
print(body);
|
||||
FirebaseMessagesController().sendNotificationToDriverMapPolyline(
|
||||
@@ -2327,6 +2328,7 @@ class MapPassengerController extends GetxController {
|
||||
recentPlaces = await sql.getAllData(TableName.recentLocations);
|
||||
}
|
||||
|
||||
double passengerRate = 5;
|
||||
getKazanPercent() async {
|
||||
var res = await CRUD().get(link: AppLink.getKazanPercent);
|
||||
if (res != 'failure') {
|
||||
@@ -2337,6 +2339,13 @@ class MapPassengerController extends GetxController {
|
||||
}
|
||||
}
|
||||
|
||||
getPassengerRate() async {
|
||||
var res = await CRUD().get(link: AppLink.getPassengerRate);
|
||||
if (res != 'failure') {
|
||||
passengerRate = double.parse(jsonDecode(res)['message'][0]['rating']);
|
||||
}
|
||||
}
|
||||
|
||||
@override
|
||||
void onInit() async {
|
||||
mapAPIKEY = await storage.read(key: BoxName.mapAPIKEY);
|
||||
@@ -2345,6 +2354,7 @@ class MapPassengerController extends GetxController {
|
||||
await getLocation();
|
||||
await addToken();
|
||||
await getKazanPercent();
|
||||
await getPassengerRate();
|
||||
startMarkerReloading();
|
||||
// await getCarsLocationByPassenger();
|
||||
// await getNearestDriverByPassengerLocation();
|
||||
|
||||
Reference in New Issue
Block a user