This commit is contained in:
2026-03-03 13:09:10 +08:00
parent 6997b4ac9e
commit ce6bd3edd2
2 changed files with 54 additions and 56 deletions

View File

@@ -28,8 +28,6 @@ PODS:
- geolocator_apple (1.2.0):
- Flutter
- FlutterMacOS
- image_gallery_saver (2.0.2):
- Flutter
- image_picker_ios (0.0.1):
- Flutter
- mobile_scanner (7.0.0):
@@ -43,6 +41,8 @@ PODS:
- FlutterMacOS
- permission_handler_apple (9.3.0):
- Flutter
- saver_gallery (0.0.1):
- Flutter
- shared_preferences_foundation (0.0.1):
- Flutter
- FlutterMacOS
@@ -59,12 +59,12 @@ DEPENDENCIES:
- flutter_native_splash (from `.symlinks/plugins/flutter_native_splash/ios`)
- flutter_pdfview (from `.symlinks/plugins/flutter_pdfview/ios`)
- geolocator_apple (from `.symlinks/plugins/geolocator_apple/darwin`)
- image_gallery_saver (from `.symlinks/plugins/image_gallery_saver/ios`)
- image_picker_ios (from `.symlinks/plugins/image_picker_ios/ios`)
- mobile_scanner (from `.symlinks/plugins/mobile_scanner/darwin`)
- package_info_plus (from `.symlinks/plugins/package_info_plus/ios`)
- path_provider_foundation (from `.symlinks/plugins/path_provider_foundation/darwin`)
- permission_handler_apple (from `.symlinks/plugins/permission_handler_apple/ios`)
- saver_gallery (from `.symlinks/plugins/saver_gallery/ios`)
- shared_preferences_foundation (from `.symlinks/plugins/shared_preferences_foundation/darwin`)
- url_launcher_ios (from `.symlinks/plugins/url_launcher_ios/ios`)
@@ -96,8 +96,6 @@ EXTERNAL SOURCES:
:path: ".symlinks/plugins/flutter_pdfview/ios"
geolocator_apple:
:path: ".symlinks/plugins/geolocator_apple/darwin"
image_gallery_saver:
:path: ".symlinks/plugins/image_gallery_saver/ios"
image_picker_ios:
:path: ".symlinks/plugins/image_picker_ios/ios"
mobile_scanner:
@@ -108,6 +106,8 @@ EXTERNAL SOURCES:
:path: ".symlinks/plugins/path_provider_foundation/darwin"
permission_handler_apple:
:path: ".symlinks/plugins/permission_handler_apple/ios"
saver_gallery:
:path: ".symlinks/plugins/saver_gallery/ios"
shared_preferences_foundation:
:path: ".symlinks/plugins/shared_preferences_foundation/darwin"
url_launcher_ios:
@@ -126,13 +126,13 @@ SPEC CHECKSUMS:
flutter_native_splash: c32d145d68aeda5502d5f543ee38c192065986cf
flutter_pdfview: 32bf27bda6fd85b9dd2c09628a824df5081246cf
geolocator_apple: ab36aa0e8b7d7a2d7639b3b4e48308394e8cef5e
image_gallery_saver: 14711d79da40581063e8842a11acf1969d781ed7
image_picker_ios: e0ece4aa2a75771a7de3fa735d26d90817041326
mobile_scanner: 9157936403f5a0644ca3779a38ff8404c5434a93
OrderedSet: e539b66b644ff081c73a262d24ad552a69be3a94
package_info_plus: af8e2ca6888548050f16fa2f1938db7b5a5df499
path_provider_foundation: bb55f6dbba17d0dccd6737fe6f7f34fbd0376880
permission_handler_apple: 4ed2196e43d0651e8ff7ca3483a069d469701f2d
saver_gallery: af2d0c762dafda254e0ad025ef0dabd6506cd490
shared_preferences_foundation: 7036424c3d8ec98dfe75ff1667cb0cd531ec82bb
url_launcher_ios: 7a95fa5b60cc718a708b8f2966718e93db0cef1b

View File

@@ -132,7 +132,7 @@ class ReservationModel {
id: json['id']?.toString() ?? '',
stationId: json['stationId']?.toString() ?? '',
plateNumber: json['plateNumber']?.toString() ?? '---',
amount: '${json['hydAmount']?.toString() ?? '0'}kg',
amount: '${json['hydAmount']?.toString() ?? '0'}',
time: timeRange,
contactPerson: json['contacts']?.toString() ?? '',
contactPhone: json['phone']?.toString() ?? '',
@@ -416,6 +416,7 @@ class SiteController extends GetxController with BaseControllerMixin {
Container(
width: 80.w,
child: TextField(
enabled: !isEdit,
controller: plateController,
style: TextStyle(
color: const Color.fromRGBO(51, 51, 51, 1),
@@ -664,7 +665,6 @@ class SiteController extends GetxController with BaseControllerMixin {
plateNumber: item.plateNumber,
isEdit: true,
);
Get.back();
return;
}
//订单确认
@@ -694,11 +694,9 @@ class SiteController extends GetxController with BaseControllerMixin {
plateNumber: plateController.text,
isAdd: true,
);
Get.back();
return;
}
//有预约订单确认
Get.back();
final num addHydAmount =
num.tryParse(amountController.text) ?? 0;
upDataService(
@@ -731,7 +729,6 @@ class SiteController extends GetxController with BaseControllerMixin {
flex: 1,
child: OutlinedButton(
onPressed: () {
Get.back();
if (!isEdit && !isAdd) {
upDataService(
id,
@@ -743,6 +740,8 @@ class SiteController extends GetxController with BaseControllerMixin {
gunNumber: selectedGun.value,
plateNumber: plateController.text,
);
} else {
Get.back();
}
},
style: OutlinedButton.styleFrom(
@@ -796,56 +795,54 @@ class SiteController extends GetxController with BaseControllerMixin {
/// 保存图片到相册
Future<void> saveImageToLocal(String url) async {
// 1. 权限请求
if (Platform.isAndroid) {
dio.PermissionStatus status;
// 1. 权限请求
if (Platform.isAndroid) {
dio.PermissionStatus status;
final deviceInfo = await DeviceInfoPlugin().androidInfo;
final sdkInt = deviceInfo.version.sdkInt;
final deviceInfo = await DeviceInfoPlugin().androidInfo;
final sdkInt = deviceInfo.version.sdkInt;
if (sdkInt <= 32) {
status = await Permission.storage.request();
} else {
status = await Permission.photos.request();
}
if (!status.isGranted) {
showErrorToast("请在系统设置中开启存储权限");
return;
}
if (sdkInt <= 32) {
status = await Permission.storage.request();
} else {
var status = await Permission.photos.request();
if (!status.isGranted) {
showErrorToast("请在系统设置中开启相册权限");
return;
}
status = await Permission.photos.request();
}
showLoading("正在保存...");
// 2. 下载图片
var response = await Dio().get(
url,
options: Options(responseType: ResponseType.bytes),
);
// 3. 保存到相册
final result = await SaverGallery.saveImage(
Uint8List.fromList(response.data),
quality: 100,
fileName: "certificate_${DateTime.now().millisecondsSinceEpoch}",
skipIfExists: false,
);
dismissLoading();
if (result.isSuccess) {
showSuccessToast("图片已保存至相册");
} else {
showErrorToast("保存失败");
if (!status.isGranted) {
showErrorToast("请在系统设置中开启存储权限");
return;
}
} else {
var status = await Permission.photos.request();
if (!status.isGranted) {
showErrorToast("请在系统设置中开启相册权限");
return;
}
}
showLoading("正在保存...");
// 2. 下载图片
var response = await Dio().get(
url,
options: Options(responseType: ResponseType.bytes),
);
// 3. 保存到相册
final result = await SaverGallery.saveImage(
Uint8List.fromList(response.data),
quality: 100,
fileName: "certificate_${DateTime.now().millisecondsSinceEpoch}",
skipIfExists: false,
);
dismissLoading();
if (result.isSuccess) {
showSuccessToast("图片已保存至相册");
} else {
showErrorToast("保存失败");
}
}
Widget buildInfoTag(String label, List<String> images) {
@@ -1065,7 +1062,6 @@ class SiteController extends GetxController with BaseControllerMixin {
return;
}
Get.back(); // 关闭弹窗
upDataService(
id,
1,
@@ -1149,7 +1145,7 @@ class SiteController extends GetxController with BaseControllerMixin {
'appointment/orderAddHyd/completeOrder',
data: {
'id': id,
'addStatus': addStatus, //完成使用 完成1,未加2
'addStatus': addStatus, //完成使用 完成1,未加2`
"addHydAmount": addHydAmount,
"plateNumber": plateNumber,
if (gunNumber != null && gunNumber.isNotEmpty) "gunNumber": gunNumber,
@@ -1167,6 +1163,8 @@ class SiteController extends GetxController with BaseControllerMixin {
} else {
showToast(result.message);
}
Get.back();
dismissLoading();
//1完成 2未加 -1拒绝