logo 预约弹出列表
车辆无绑定弹窗
This commit is contained in:
@@ -2,6 +2,7 @@ import 'package:get/get.dart';
|
||||
import 'package:getx_scaffold/getx_scaffold.dart';
|
||||
import 'package:ln_jq_app/common/model/base_model.dart';
|
||||
import 'package:ln_jq_app/common/model/vehicle_info.dart';
|
||||
import 'package:ln_jq_app/pages/qr_code/view.dart';
|
||||
import 'package:ln_jq_app/storage_service.dart';
|
||||
|
||||
import 'certificate_viewer_page.dart';
|
||||
@@ -27,6 +28,33 @@ class CarInfoController extends GetxController with BaseControllerMixin {
|
||||
super.onInit();
|
||||
getUserBindCarInfo();
|
||||
}
|
||||
@override
|
||||
void onReady() {
|
||||
super.onReady();
|
||||
// 如果未绑定车辆,且本次会话尚未提示过,则弹出提示
|
||||
if (!StorageService.to.hasShownBindVehicleDialog) {
|
||||
Future.delayed(const Duration(milliseconds: 500), () {
|
||||
DialogX.to.showConfirmDialog(
|
||||
title: '当前尚未绑定车辆',
|
||||
confirmText: "去绑定",
|
||||
cancelText: "稍后",
|
||||
onConfirm: () {
|
||||
doQrCode();
|
||||
},
|
||||
);
|
||||
// 标记为已显示,本次会话不再提示
|
||||
StorageService.to.markBindVehicleDialogAsShown();
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
void doQrCode() async {
|
||||
var scanResult = await Get.to(() => const QrCodePage());
|
||||
if (scanResult == true) {
|
||||
getUserBindCarInfo();
|
||||
refreshAppui();
|
||||
}
|
||||
}
|
||||
|
||||
void getUserBindCarInfo() async {
|
||||
if (StorageService.to.hasVehicleInfo) {
|
||||
|
||||
@@ -173,12 +173,7 @@ class CarInfoPage extends GetView<CarInfoController> {
|
||||
isButton
|
||||
? GestureDetector(
|
||||
onTap: () async {
|
||||
//判断是否绑定成功
|
||||
var scanResult = await Get.to(() => const QrCodePage());
|
||||
if (scanResult == true) {
|
||||
controller.getUserBindCarInfo();
|
||||
refreshAppui();
|
||||
}
|
||||
controller.doQrCode();
|
||||
},
|
||||
child: Container(
|
||||
margin: EdgeInsetsGeometry.only(left: 10.w),
|
||||
|
||||
Reference in New Issue
Block a user