Scooter order payment screen fix

This commit is contained in:
2026-09-15 21:28:33 +03:00
parent 153a763b6f
commit 3a74b8017d
2 changed files with 2 additions and 6 deletions

View File

@@ -30,7 +30,6 @@ class ScooterOrder {
final double mileage; final double mileage;
final double avgSpeed; final double avgSpeed;
final String payTotalPricePrint; final String payTotalPricePrint;
final double unpayTotalPrice;
final String unpayTotalPricePrint; final String unpayTotalPricePrint;
final String totalOrderPricePrint; final String totalOrderPricePrint;
final bool hasFine; final bool hasFine;
@@ -66,7 +65,6 @@ class ScooterOrder {
required this.avgSpeed, required this.avgSpeed,
required this.payTotalPricePrint, // оплачено required this.payTotalPricePrint, // оплачено
required this.unpayTotalPricePrint, //неоплачено required this.unpayTotalPricePrint, //неоплачено
required this.unpayTotalPrice, //неоплачено
required this.totalOrderPricePrint, //общая required this.totalOrderPricePrint, //общая
required this.hasFine, required this.hasFine,
}); });
@@ -117,7 +115,6 @@ class ScooterOrder {
avgSpeed: (json['avgSpeed'] as num?)?.toDouble() ?? 0.0, avgSpeed: (json['avgSpeed'] as num?)?.toDouble() ?? 0.0,
payTotalPricePrint: paymentInfo?['payTotalPricePrint'] ?? '', payTotalPricePrint: paymentInfo?['payTotalPricePrint'] ?? '',
unpayTotalPricePrint: paymentInfo?['unpayTotalPricePrint'] ?? '', unpayTotalPricePrint: paymentInfo?['unpayTotalPricePrint'] ?? '',
unpayTotalPrice: (paymentInfo?['unpayTotalPrice'] as num?)?.toDouble() ?? 0.0,
totalOrderPricePrint: paymentInfo?['totalOrderPricePrint'] ?? '', totalOrderPricePrint: paymentInfo?['totalOrderPricePrint'] ?? '',
hasFine: paymentInfo?['hasFine'] ?? false, hasFine: paymentInfo?['hasFine'] ?? false,
); );

View File

@@ -115,7 +115,7 @@ class _PaymentConfirmScreenContent extends StatelessWidget {
); );
} }
final hasNoDebt = (order?.unpayTotalPrice ?? 0) == 0; final hasNoDebt = order?.status == "Paid";
return Column( return Column(
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
@@ -206,7 +206,6 @@ class _PaymentConfirmScreenContent extends StatelessWidget {
), ),
), ),
// 🔹 КАРТА ОПЛАТЫ (Отображается только если есть долг)
if (!hasNoDebt) ...[ if (!hasNoDebt) ...[
const SizedBox(height: 40), const SizedBox(height: 40),
(state.useBalance || state.selectedCard != null) (state.useBalance || state.selectedCard != null)
@@ -342,7 +341,7 @@ class _PaymentConfirmScreenContent extends StatelessWidget {
} }
}, },
builder: (context, state) { builder: (context, state) {
final hasNoDebt = (state.order?.unpayTotalPrice ?? 0) == 0; final hasNoDebt = state.order?.status == "Paid";
return GradientButton( return GradientButton(
text: state.status == PaymentConfirmStatus.loading text: state.status == PaymentConfirmStatus.loading