4/3/9
This commit is contained in:
@@ -82,6 +82,8 @@ class AppLink {
|
||||
"$ride/notificationPassenger/update.php";
|
||||
//-----------------Driver NotificationCaptain------------------
|
||||
static String addNotificationCaptain = "$ride/notificationCaptain/add.php";
|
||||
static String addWaitingRide = "$ride/notificationCaptain/addWaitingRide.php";
|
||||
static String getRideWaiting = "$ride/notificationCaptain/getRideWaiting.php";
|
||||
static String getNotificationCaptain = "$ride/notificationCaptain/get.php";
|
||||
static String updateNotificationCaptain =
|
||||
"$ride/notificationCaptain/update.php";
|
||||
@@ -133,6 +135,7 @@ class AppLink {
|
||||
static String addRateToPassenger = "$ride/rate/add.php";
|
||||
static String addRateToDriver = "$ride/rate/addRateToDriver.php";
|
||||
static String getDriverRate = "$ride/rate/getDriverRate.php";
|
||||
static String getPassengerRate = "$ride/rate/getPassengerRate.php";
|
||||
|
||||
////////////////emails ============//
|
||||
static String sendEmailToPassengerForTripDetails =
|
||||
|
||||
@@ -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();
|
||||
|
||||
@@ -479,7 +479,7 @@ class MyTranslation extends Translations {
|
||||
"المسافة من الراكب إلى الوجهة هي ",
|
||||
'Cost Of Trip IS ': "تكلفة الرحلة هي ",
|
||||
'Accept Order': "اقبل الطلب",
|
||||
'rejct your order.': "رفض طلبك.",
|
||||
'reject your order.': "رفض طلبك.",
|
||||
'Bottom Bar Example': "مثال لشريط الأسفل",
|
||||
'Statistics': "الإحصائيات",
|
||||
'Scan Id': "مسح الهوية",
|
||||
|
||||
@@ -389,7 +389,7 @@ class OrderRequestPage extends StatelessWidget {
|
||||
FirebaseMessagesController()
|
||||
.sendNotificationToPassengerToken(
|
||||
'Refused Ride',
|
||||
'${box.read(BoxName.nameDriver)} ${'rejct your order.'.tr}',
|
||||
'${box.read(BoxName.nameDriver)} ${'reject your order.'.tr}',
|
||||
arguments['DriverList'][9].toString(),
|
||||
// box.read(BoxName.tokenDriver).toString(),
|
||||
bodyToPassenger,
|
||||
@@ -397,6 +397,19 @@ class OrderRequestPage extends StatelessWidget {
|
||||
orderRequestController.refuseOrder(
|
||||
myList[16].toString(),
|
||||
);
|
||||
orderRequestController.addRideToNotificationDriverString(
|
||||
myList[16].toString(),
|
||||
myList[0].toString(),
|
||||
myList[1].toString(),
|
||||
'${DateTime.now().year}-${DateTime.now().month}-${DateTime.now().day}',
|
||||
'${DateTime.now().hour}:${DateTime.now().minute}',
|
||||
myList[2].toString(),
|
||||
myList[7].toString(),
|
||||
'wait',
|
||||
myList[31].toString(),
|
||||
myList[33].toString(),
|
||||
myList[2].toString(),
|
||||
myList[5].toString());
|
||||
},
|
||||
kolor: AppColor.redColor,
|
||||
),
|
||||
|
||||
Reference in New Issue
Block a user