扫码结果处理

This commit is contained in:
2025-11-13 15:56:05 +08:00
parent 5c79a27ac4
commit feedc8c511
5 changed files with 139 additions and 55 deletions

View File

@@ -1,8 +1,9 @@
import 'package:dropdown_button2/dropdown_button2.dart';
import 'package:flutter/material.dart';
import 'package:get/get.dart';
import 'package:getx_scaffold/getx_scaffold.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 'controller.dart';
@@ -116,7 +117,7 @@ class ReservationPage extends GetView<ReservationController> {
children: [
Text(value, style: const TextStyle(fontSize: 15, fontWeight: FontWeight.bold)),
const SizedBox(height: 4),
Text(label, style: const TextStyle(color: Colors.grey, fontSize: 11 )),
Text(label, style: const TextStyle(color: Colors.grey, fontSize: 11)),
],
);
}
@@ -142,11 +143,7 @@ class ReservationPage extends GetView<ReservationController> {
),
),
const SizedBox(width: 8),
Icon(
Icons.propane_rounded,
size: 50,
color: Colors.blue.withOpacity(0.5),
),
Icon(Icons.propane_rounded, size: 50, color: Colors.blue.withOpacity(0.5)),
],
),
),
@@ -162,8 +159,18 @@ class ReservationPage extends GetView<ReservationController> {
const SizedBox(width: 8),
isButton
? GestureDetector(
onTap: () {
Get.to(() => const QrCodePage());
onTap: () async {
//判断是否绑定成功
var scanResult = await Get.to(() => const QrCodePage());
if (scanResult == true) {
VehicleInfo? bean = StorageService.to.vehicleInfo;
if (bean != null) {
showToast(
"已绑定${bean.plateNumber}-${StorageService.to.hasVehicleInfo}",
);
}
}
},
child: Container(
margin: EdgeInsetsGeometry.only(left: 10.w),
@@ -181,7 +188,10 @@ class ReservationPage extends GetView<ReservationController> {
Text(
value,
style: const TextStyle(
color: Colors.blue, fontSize: 11, fontWeight: FontWeight.w500),
color: Colors.blue,
fontSize: 11,
fontWeight: FontWeight.w500,
),
),
],
),
@@ -411,13 +421,9 @@ class ReservationPage extends GetView<ReservationController> {
),
dropdownStyleData: DropdownStyleData(
maxHeight: 200,
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(8),
),
),
menuItemStyleData: const MenuItemStyleData(
height: 40,
decoration: BoxDecoration(borderRadius: BorderRadius.circular(8)),
),
menuItemStyleData: const MenuItemStyleData(height: 40),
),
),
),