logo 预约弹出列表
车辆无绑定弹窗
This commit is contained in:
@@ -9,6 +9,7 @@ import 'package:ln_jq_app/common/model/base_model.dart';
|
||||
import 'package:ln_jq_app/common/model/station_model.dart';
|
||||
import 'package:ln_jq_app/common/model/vehicle_info.dart';
|
||||
import 'package:ln_jq_app/pages/b_page/site/controller.dart';
|
||||
import 'package:ln_jq_app/pages/qr_code/view.dart';
|
||||
import 'package:ln_jq_app/storage_service.dart';
|
||||
|
||||
import '../../../common/styles/theme.dart';
|
||||
@@ -304,7 +305,7 @@ class C_ReservationController extends GetxController with BaseControllerMixin {
|
||||
showToast("请先选择加氢站");
|
||||
return;
|
||||
}
|
||||
// 将选择的日期和时间组合成一个完整的 DateTime 对象
|
||||
// 将选择的日期和时间组合成一个完整的 DateTime 对象
|
||||
final reservationStartDateTime = DateTime(
|
||||
selectedDate.value.year,
|
||||
selectedDate.value.month,
|
||||
@@ -353,6 +354,11 @@ class C_ReservationController extends GetxController with BaseControllerMixin {
|
||||
var result = BaseModel.fromJson(responseData.data);
|
||||
if (result.code == 0) {
|
||||
showSuccessToast("预约成功");
|
||||
|
||||
//打开预约列表
|
||||
Future.delayed(const Duration(milliseconds: 800), () {
|
||||
getReservationList();
|
||||
});
|
||||
} else {
|
||||
showErrorToast(result.message);
|
||||
}
|
||||
@@ -606,6 +612,14 @@ class C_ReservationController extends GetxController with BaseControllerMixin {
|
||||
}
|
||||
}
|
||||
|
||||
void doQrCode() async {
|
||||
var scanResult = await Get.to(() => const QrCodePage());
|
||||
if (scanResult == true) {
|
||||
getUserBindCarInfo();
|
||||
refreshAppui();
|
||||
}
|
||||
}
|
||||
|
||||
void getJqinfo() async {
|
||||
try {
|
||||
HttpService.to.setBaseUrl(AppTheme.test_service_url);
|
||||
@@ -707,6 +721,22 @@ class C_ReservationController extends GetxController with BaseControllerMixin {
|
||||
dismissLoading();
|
||||
HttpService.to.setBaseUrl(AppTheme.test_service_url);
|
||||
HttpService.to.dio.options.headers = originalHeaders;
|
||||
|
||||
// 如果未绑定车辆,且本次会话尚未提示过,则弹出提示
|
||||
if (!StorageService.to.hasShownBindVehicleDialog) {
|
||||
Future.delayed(const Duration(milliseconds: 500), () {
|
||||
DialogX.to.showConfirmDialog(
|
||||
title: '当前尚未绑定车辆',
|
||||
confirmText: "去绑定",
|
||||
cancelText: "稍后",
|
||||
onConfirm: () {
|
||||
doQrCode();
|
||||
},
|
||||
);
|
||||
// 标记为已显示,本次会话不再提示
|
||||
StorageService.to.markBindVehicleDialogAsShown();
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user