bugfix
This commit is contained in:
@@ -28,8 +28,6 @@ PODS:
|
|||||||
- geolocator_apple (1.2.0):
|
- geolocator_apple (1.2.0):
|
||||||
- Flutter
|
- Flutter
|
||||||
- FlutterMacOS
|
- FlutterMacOS
|
||||||
- image_gallery_saver (2.0.2):
|
|
||||||
- Flutter
|
|
||||||
- image_picker_ios (0.0.1):
|
- image_picker_ios (0.0.1):
|
||||||
- Flutter
|
- Flutter
|
||||||
- mobile_scanner (7.0.0):
|
- mobile_scanner (7.0.0):
|
||||||
@@ -43,6 +41,8 @@ PODS:
|
|||||||
- FlutterMacOS
|
- FlutterMacOS
|
||||||
- permission_handler_apple (9.3.0):
|
- permission_handler_apple (9.3.0):
|
||||||
- Flutter
|
- Flutter
|
||||||
|
- saver_gallery (0.0.1):
|
||||||
|
- Flutter
|
||||||
- shared_preferences_foundation (0.0.1):
|
- shared_preferences_foundation (0.0.1):
|
||||||
- Flutter
|
- Flutter
|
||||||
- FlutterMacOS
|
- FlutterMacOS
|
||||||
@@ -59,12 +59,12 @@ DEPENDENCIES:
|
|||||||
- flutter_native_splash (from `.symlinks/plugins/flutter_native_splash/ios`)
|
- flutter_native_splash (from `.symlinks/plugins/flutter_native_splash/ios`)
|
||||||
- flutter_pdfview (from `.symlinks/plugins/flutter_pdfview/ios`)
|
- flutter_pdfview (from `.symlinks/plugins/flutter_pdfview/ios`)
|
||||||
- geolocator_apple (from `.symlinks/plugins/geolocator_apple/darwin`)
|
- 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`)
|
- image_picker_ios (from `.symlinks/plugins/image_picker_ios/ios`)
|
||||||
- mobile_scanner (from `.symlinks/plugins/mobile_scanner/darwin`)
|
- mobile_scanner (from `.symlinks/plugins/mobile_scanner/darwin`)
|
||||||
- package_info_plus (from `.symlinks/plugins/package_info_plus/ios`)
|
- package_info_plus (from `.symlinks/plugins/package_info_plus/ios`)
|
||||||
- path_provider_foundation (from `.symlinks/plugins/path_provider_foundation/darwin`)
|
- path_provider_foundation (from `.symlinks/plugins/path_provider_foundation/darwin`)
|
||||||
- permission_handler_apple (from `.symlinks/plugins/permission_handler_apple/ios`)
|
- 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`)
|
- shared_preferences_foundation (from `.symlinks/plugins/shared_preferences_foundation/darwin`)
|
||||||
- url_launcher_ios (from `.symlinks/plugins/url_launcher_ios/ios`)
|
- url_launcher_ios (from `.symlinks/plugins/url_launcher_ios/ios`)
|
||||||
|
|
||||||
@@ -96,8 +96,6 @@ EXTERNAL SOURCES:
|
|||||||
:path: ".symlinks/plugins/flutter_pdfview/ios"
|
:path: ".symlinks/plugins/flutter_pdfview/ios"
|
||||||
geolocator_apple:
|
geolocator_apple:
|
||||||
:path: ".symlinks/plugins/geolocator_apple/darwin"
|
:path: ".symlinks/plugins/geolocator_apple/darwin"
|
||||||
image_gallery_saver:
|
|
||||||
:path: ".symlinks/plugins/image_gallery_saver/ios"
|
|
||||||
image_picker_ios:
|
image_picker_ios:
|
||||||
:path: ".symlinks/plugins/image_picker_ios/ios"
|
:path: ".symlinks/plugins/image_picker_ios/ios"
|
||||||
mobile_scanner:
|
mobile_scanner:
|
||||||
@@ -108,6 +106,8 @@ EXTERNAL SOURCES:
|
|||||||
:path: ".symlinks/plugins/path_provider_foundation/darwin"
|
:path: ".symlinks/plugins/path_provider_foundation/darwin"
|
||||||
permission_handler_apple:
|
permission_handler_apple:
|
||||||
:path: ".symlinks/plugins/permission_handler_apple/ios"
|
:path: ".symlinks/plugins/permission_handler_apple/ios"
|
||||||
|
saver_gallery:
|
||||||
|
:path: ".symlinks/plugins/saver_gallery/ios"
|
||||||
shared_preferences_foundation:
|
shared_preferences_foundation:
|
||||||
:path: ".symlinks/plugins/shared_preferences_foundation/darwin"
|
:path: ".symlinks/plugins/shared_preferences_foundation/darwin"
|
||||||
url_launcher_ios:
|
url_launcher_ios:
|
||||||
@@ -126,13 +126,13 @@ SPEC CHECKSUMS:
|
|||||||
flutter_native_splash: c32d145d68aeda5502d5f543ee38c192065986cf
|
flutter_native_splash: c32d145d68aeda5502d5f543ee38c192065986cf
|
||||||
flutter_pdfview: 32bf27bda6fd85b9dd2c09628a824df5081246cf
|
flutter_pdfview: 32bf27bda6fd85b9dd2c09628a824df5081246cf
|
||||||
geolocator_apple: ab36aa0e8b7d7a2d7639b3b4e48308394e8cef5e
|
geolocator_apple: ab36aa0e8b7d7a2d7639b3b4e48308394e8cef5e
|
||||||
image_gallery_saver: 14711d79da40581063e8842a11acf1969d781ed7
|
|
||||||
image_picker_ios: e0ece4aa2a75771a7de3fa735d26d90817041326
|
image_picker_ios: e0ece4aa2a75771a7de3fa735d26d90817041326
|
||||||
mobile_scanner: 9157936403f5a0644ca3779a38ff8404c5434a93
|
mobile_scanner: 9157936403f5a0644ca3779a38ff8404c5434a93
|
||||||
OrderedSet: e539b66b644ff081c73a262d24ad552a69be3a94
|
OrderedSet: e539b66b644ff081c73a262d24ad552a69be3a94
|
||||||
package_info_plus: af8e2ca6888548050f16fa2f1938db7b5a5df499
|
package_info_plus: af8e2ca6888548050f16fa2f1938db7b5a5df499
|
||||||
path_provider_foundation: bb55f6dbba17d0dccd6737fe6f7f34fbd0376880
|
path_provider_foundation: bb55f6dbba17d0dccd6737fe6f7f34fbd0376880
|
||||||
permission_handler_apple: 4ed2196e43d0651e8ff7ca3483a069d469701f2d
|
permission_handler_apple: 4ed2196e43d0651e8ff7ca3483a069d469701f2d
|
||||||
|
saver_gallery: af2d0c762dafda254e0ad025ef0dabd6506cd490
|
||||||
shared_preferences_foundation: 7036424c3d8ec98dfe75ff1667cb0cd531ec82bb
|
shared_preferences_foundation: 7036424c3d8ec98dfe75ff1667cb0cd531ec82bb
|
||||||
url_launcher_ios: 7a95fa5b60cc718a708b8f2966718e93db0cef1b
|
url_launcher_ios: 7a95fa5b60cc718a708b8f2966718e93db0cef1b
|
||||||
|
|
||||||
|
|||||||
@@ -132,7 +132,7 @@ class ReservationModel {
|
|||||||
id: json['id']?.toString() ?? '',
|
id: json['id']?.toString() ?? '',
|
||||||
stationId: json['stationId']?.toString() ?? '',
|
stationId: json['stationId']?.toString() ?? '',
|
||||||
plateNumber: json['plateNumber']?.toString() ?? '---',
|
plateNumber: json['plateNumber']?.toString() ?? '---',
|
||||||
amount: '${json['hydAmount']?.toString() ?? '0'}kg',
|
amount: '${json['hydAmount']?.toString() ?? '0'}',
|
||||||
time: timeRange,
|
time: timeRange,
|
||||||
contactPerson: json['contacts']?.toString() ?? '',
|
contactPerson: json['contacts']?.toString() ?? '',
|
||||||
contactPhone: json['phone']?.toString() ?? '',
|
contactPhone: json['phone']?.toString() ?? '',
|
||||||
@@ -416,6 +416,7 @@ class SiteController extends GetxController with BaseControllerMixin {
|
|||||||
Container(
|
Container(
|
||||||
width: 80.w,
|
width: 80.w,
|
||||||
child: TextField(
|
child: TextField(
|
||||||
|
enabled: !isEdit,
|
||||||
controller: plateController,
|
controller: plateController,
|
||||||
style: TextStyle(
|
style: TextStyle(
|
||||||
color: const Color.fromRGBO(51, 51, 51, 1),
|
color: const Color.fromRGBO(51, 51, 51, 1),
|
||||||
@@ -664,7 +665,6 @@ class SiteController extends GetxController with BaseControllerMixin {
|
|||||||
plateNumber: item.plateNumber,
|
plateNumber: item.plateNumber,
|
||||||
isEdit: true,
|
isEdit: true,
|
||||||
);
|
);
|
||||||
Get.back();
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
//订单确认
|
//订单确认
|
||||||
@@ -694,11 +694,9 @@ class SiteController extends GetxController with BaseControllerMixin {
|
|||||||
plateNumber: plateController.text,
|
plateNumber: plateController.text,
|
||||||
isAdd: true,
|
isAdd: true,
|
||||||
);
|
);
|
||||||
Get.back();
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
//有预约订单确认
|
//有预约订单确认
|
||||||
Get.back();
|
|
||||||
final num addHydAmount =
|
final num addHydAmount =
|
||||||
num.tryParse(amountController.text) ?? 0;
|
num.tryParse(amountController.text) ?? 0;
|
||||||
upDataService(
|
upDataService(
|
||||||
@@ -731,7 +729,6 @@ class SiteController extends GetxController with BaseControllerMixin {
|
|||||||
flex: 1,
|
flex: 1,
|
||||||
child: OutlinedButton(
|
child: OutlinedButton(
|
||||||
onPressed: () {
|
onPressed: () {
|
||||||
Get.back();
|
|
||||||
if (!isEdit && !isAdd) {
|
if (!isEdit && !isAdd) {
|
||||||
upDataService(
|
upDataService(
|
||||||
id,
|
id,
|
||||||
@@ -743,6 +740,8 @@ class SiteController extends GetxController with BaseControllerMixin {
|
|||||||
gunNumber: selectedGun.value,
|
gunNumber: selectedGun.value,
|
||||||
plateNumber: plateController.text,
|
plateNumber: plateController.text,
|
||||||
);
|
);
|
||||||
|
} else {
|
||||||
|
Get.back();
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
style: OutlinedButton.styleFrom(
|
style: OutlinedButton.styleFrom(
|
||||||
@@ -796,56 +795,54 @@ class SiteController extends GetxController with BaseControllerMixin {
|
|||||||
|
|
||||||
/// 保存图片到相册
|
/// 保存图片到相册
|
||||||
Future<void> saveImageToLocal(String url) async {
|
Future<void> saveImageToLocal(String url) async {
|
||||||
|
// 1. 权限请求
|
||||||
|
if (Platform.isAndroid) {
|
||||||
|
dio.PermissionStatus status;
|
||||||
|
|
||||||
// 1. 权限请求
|
final deviceInfo = await DeviceInfoPlugin().androidInfo;
|
||||||
if (Platform.isAndroid) {
|
final sdkInt = deviceInfo.version.sdkInt;
|
||||||
dio.PermissionStatus status;
|
|
||||||
|
|
||||||
final deviceInfo = await DeviceInfoPlugin().androidInfo;
|
if (sdkInt <= 32) {
|
||||||
final sdkInt = deviceInfo.version.sdkInt;
|
status = await Permission.storage.request();
|
||||||
|
|
||||||
if (sdkInt <= 32) {
|
|
||||||
status = await Permission.storage.request();
|
|
||||||
} else {
|
|
||||||
status = await Permission.photos.request();
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!status.isGranted) {
|
|
||||||
showErrorToast("请在系统设置中开启存储权限");
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
} else {
|
} else {
|
||||||
var status = await Permission.photos.request();
|
status = await Permission.photos.request();
|
||||||
if (!status.isGranted) {
|
|
||||||
showErrorToast("请在系统设置中开启相册权限");
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
showLoading("正在保存...");
|
if (!status.isGranted) {
|
||||||
|
showErrorToast("请在系统设置中开启存储权限");
|
||||||
// 2. 下载图片
|
return;
|
||||||
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("保存失败");
|
|
||||||
}
|
}
|
||||||
|
} 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) {
|
Widget buildInfoTag(String label, List<String> images) {
|
||||||
@@ -1065,7 +1062,6 @@ class SiteController extends GetxController with BaseControllerMixin {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
Get.back(); // 关闭弹窗
|
|
||||||
upDataService(
|
upDataService(
|
||||||
id,
|
id,
|
||||||
1,
|
1,
|
||||||
@@ -1149,7 +1145,7 @@ class SiteController extends GetxController with BaseControllerMixin {
|
|||||||
'appointment/orderAddHyd/completeOrder',
|
'appointment/orderAddHyd/completeOrder',
|
||||||
data: {
|
data: {
|
||||||
'id': id,
|
'id': id,
|
||||||
'addStatus': addStatus, //完成使用 完成1,未加2
|
'addStatus': addStatus, //完成使用 完成1,未加2`
|
||||||
"addHydAmount": addHydAmount,
|
"addHydAmount": addHydAmount,
|
||||||
"plateNumber": plateNumber,
|
"plateNumber": plateNumber,
|
||||||
if (gunNumber != null && gunNumber.isNotEmpty) "gunNumber": gunNumber,
|
if (gunNumber != null && gunNumber.isNotEmpty) "gunNumber": gunNumber,
|
||||||
@@ -1167,6 +1163,8 @@ class SiteController extends GetxController with BaseControllerMixin {
|
|||||||
} else {
|
} else {
|
||||||
showToast(result.message);
|
showToast(result.message);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Get.back();
|
||||||
dismissLoading();
|
dismissLoading();
|
||||||
|
|
||||||
//1完成 2未加 -1拒绝
|
//1完成 2未加 -1拒绝
|
||||||
|
|||||||
Reference in New Issue
Block a user