Update: 2026-08-01 05:29:35
This commit is contained in:
@@ -26,7 +26,7 @@ class AppLink {
|
||||
static String get locationServer => locationServerSide;
|
||||
|
||||
static String get locationServerSide {
|
||||
return 'https://api.intaleqapp.com/loction_server/intaleq/ride/location';
|
||||
return 'https://api.intaleqapp.com/loction_server/siro/ride/location';
|
||||
}
|
||||
|
||||
static String get locationSocketUrl {
|
||||
@@ -251,8 +251,10 @@ class AppLink {
|
||||
static String get paymobPayoutDriverWallet =>
|
||||
"$paymentServer/ride/payMob/paymob_driver/paymob_payout.php";
|
||||
|
||||
static String get addSeferWallet => "$paymentServer/ride/intaleqWallet/add.php";
|
||||
static String get getSeferWallet => "$paymentServer/ride/intaleqWallet/get.php";
|
||||
static String get addSeferWallet =>
|
||||
"$paymentServer/ride/intaleqWallet/add.php";
|
||||
static String get getSeferWallet =>
|
||||
"$paymentServer/ride/intaleqWallet/get.php";
|
||||
static String get addDriverPaymentPoints =>
|
||||
"$paymentServer/ride/driverPayment/add.php";
|
||||
static String get addPaymentTokenDriver =>
|
||||
|
||||
@@ -449,13 +449,8 @@ class LoginDriverController extends GetxController {
|
||||
box.write(BoxName.carTypeOfDriver, 'Awfar Car');
|
||||
}
|
||||
|
||||
// ✅ الحصول على توكن access بدل registration قبل أي طلبات بعد تسجيل الدخول
|
||||
Log.print('🔑 Getting access token after login...');
|
||||
String fingerPrint = await DeviceHelper.getDeviceFingerprint();
|
||||
// await storage.write(
|
||||
// key: BoxName.fingerPrint, value: fingerPrint.toString());
|
||||
// await getJWT();
|
||||
// Log.print('🔑 Access token obtained.');
|
||||
// (لا داعي لتوليد توكن جديد هنا، فعملية OTP قد زودتنا بتوكن Access صحيح وتم حفظه في الذاكرة)
|
||||
Log.print('✅ Access token is already saved from the login process.');
|
||||
|
||||
// add invitations
|
||||
if (box.read(BoxName.isInstall) == null ||
|
||||
@@ -483,6 +478,8 @@ class LoginDriverController extends GetxController {
|
||||
final serverFp = serverData['data'][0]['fingerPrint'].toString();
|
||||
final tokenMismatch =
|
||||
storedToken.isNotEmpty && serverToken != storedToken;
|
||||
|
||||
String fingerPrint = await DeviceHelper.getDeviceFingerprint();
|
||||
Log.print(
|
||||
'🔍 [FP_COMPARE] serverFp: $serverFp | localFp: ${fingerPrint.toString()} | tokenMismatch: $tokenMismatch | serverToken: $serverToken | storedToken: $storedToken');
|
||||
if (tokenMismatch) {
|
||||
|
||||
@@ -88,6 +88,12 @@ class PhoneAuthHelper {
|
||||
if (isRegistered) {
|
||||
// ✅ السائق مسجل مسبقًا - سجل دخوله واذهب إلى الصفحة الرئيسية
|
||||
final driver = data['message']['driver'];
|
||||
final jwt = data['message']['jwt'];
|
||||
|
||||
if (jwt != null) {
|
||||
await storage.write(key: BoxName.jwt, value: jwt.toString());
|
||||
}
|
||||
|
||||
// mySnackbarSuccess('Welcome back, ${driver['first_name']}!');
|
||||
|
||||
// حفظ بيانات السائق إذا أردت:
|
||||
|
||||
@@ -45,7 +45,7 @@ class DestinationController extends GetxController {
|
||||
|
||||
if (response != null && response is Map && response['status'] == 'success') {
|
||||
final data = response['message'];
|
||||
if (data != null) {
|
||||
if (data != null && data is Map) {
|
||||
final lat = double.tryParse(data['target_latitude']?.toString() ?? '0') ?? 0.0;
|
||||
final lng = double.tryParse(data['target_longitude']?.toString() ?? '0') ?? 0.0;
|
||||
activeLatLng = LatLng(lat, lng);
|
||||
|
||||
@@ -939,7 +939,7 @@ class HomeCaptainController extends GetxController {
|
||||
bool isZeroCommissionActive = false;
|
||||
|
||||
getCountRideToday() async {
|
||||
var res = await CRUD().get(
|
||||
var res = await CRUD().getWallet(
|
||||
link: AppLink.getCountRide,
|
||||
payload: {'driver_id': box.read(BoxName.driverID).toString()});
|
||||
data = jsonDecode(res);
|
||||
|
||||
@@ -320,11 +320,13 @@ class UserHeader extends StatelessWidget {
|
||||
fontSize: 18,
|
||||
shadows: [Shadow(blurRadius: 2, color: Colors.black26)]),
|
||||
),
|
||||
accountEmail:
|
||||
(box.read(BoxName.emailDriver).toString().contains('siroapp') ||
|
||||
box.read(BoxName.emailDriver).toString().contains('intaleqapp'))
|
||||
? Text('Your email not updated yet'.tr)
|
||||
: Text(box.read(BoxName.emailDriver)),
|
||||
accountEmail: (box
|
||||
.read(BoxName.emailDriver)
|
||||
.toString()
|
||||
.contains('siroapp') ||
|
||||
box.read(BoxName.emailDriver).toString().contains('intaleqapp'))
|
||||
? Text('Your email not updated yet'.tr)
|
||||
: Text(box.read(BoxName.emailDriver)),
|
||||
currentAccountPicture: GetBuilder<ImageController>(
|
||||
builder: (controller) => Stack(
|
||||
clipBehavior: Clip.none,
|
||||
@@ -334,7 +336,8 @@ class UserHeader extends StatelessWidget {
|
||||
shape: BoxShape.circle,
|
||||
border: Border.all(color: Colors.white, width: 2),
|
||||
boxShadow: [
|
||||
BoxShadow(color: Colors.black.withValues(alpha: 0.3), blurRadius: 5)
|
||||
BoxShadow(
|
||||
color: Colors.black.withValues(alpha: 0.3), blurRadius: 5)
|
||||
],
|
||||
),
|
||||
child: controller.isloading
|
||||
@@ -349,13 +352,17 @@ class UserHeader extends StatelessWidget {
|
||||
: null,
|
||||
|
||||
// [تعديل هام]: في حال فشل تحميل الصورة (غير موجودة)
|
||||
onBackgroundImageError: (exception, stackTrace) {
|
||||
// طباعة الخطأ في الكونسول للتوضيح
|
||||
debugPrint(
|
||||
"Profile image not found or error loading: $exception");
|
||||
// استدعاء نافذة التنبيه
|
||||
_showUploadPhotoDialog(context, controller);
|
||||
},
|
||||
onBackgroundImageError: (box
|
||||
.read(BoxName.driverPhotoUrl)
|
||||
?.toString()
|
||||
.isNotEmpty ==
|
||||
true)
|
||||
? (exception, stackTrace) {
|
||||
debugPrint(
|
||||
"Profile image not found or error loading: $exception");
|
||||
_showUploadPhotoDialog(context, controller);
|
||||
}
|
||||
: null,
|
||||
|
||||
// أيقونة بديلة تظهر في الخلفية إذا لم تكن الصورة موجودة
|
||||
backgroundColor: Colors.grey.shade300,
|
||||
|
||||
@@ -50,7 +50,7 @@ try {
|
||||
//$con->exec("SET time_zone = '+03:00'");
|
||||
// --- JWT Authentication ---
|
||||
// include "encrypt_decrypt.php";
|
||||
include "functions.php"; // Include the functions file
|
||||
include __DIR__ . "/functions.php"; // Include the functions file
|
||||
|
||||
|
||||
$decodedToken = authenticateJWT(); // Call the authentication function
|
||||
|
||||
@@ -30,8 +30,8 @@ try {
|
||||
} else {
|
||||
// إنشاء فاتورة جديدة برقم عشوائي
|
||||
$invoice_number = random_int(100000, 999999);
|
||||
$stmtIns = $con->prepare("INSERT INTO invoices_shamcash (invoice_number, driverID, phone, amount, status, created_at) VALUES (?, ?, ?, ?, 'pending', NOW())");
|
||||
$stmtIns->execute([$invoice_number, $driverID, $phone ?: null, $amount]);
|
||||
$stmtIns = $con->prepare("INSERT INTO invoices_shamcash (invoice_number, driverID, amount, status, created_at) VALUES (?, ?, ?, 'pending', NOW())");
|
||||
$stmtIns->execute([$invoice_number, $driverID, $amount]);
|
||||
}
|
||||
|
||||
echo json_encode([
|
||||
|
||||
Reference in New Issue
Block a user