二维码扫描,从相册中扫

权限说明
This commit is contained in:
2025-11-13 14:29:20 +08:00
parent c4f34f3e00
commit 5c79a27ac4
9 changed files with 546 additions and 37 deletions

View File

@@ -30,7 +30,7 @@ class ReservationController extends GetxController with BaseControllerMixin {
final TextEditingController amountController = TextEditingController();
// 车牌号
final TextEditingController plateNumberController = TextEditingController(text: "浙F");
TextEditingController plateNumberController = TextEditingController();
// 加氢站
final List<String> stationOptions = [
@@ -343,6 +343,7 @@ class ReservationController extends GetxController with BaseControllerMixin {
String name = "";
String leftHydrogen = "";
String workEfficiency = "";
//累计数据
String fillingWeight = "";
String fillingTimes = "";
@@ -352,10 +353,10 @@ class ReservationController extends GetxController with BaseControllerMixin {
void onInit() {
phone = StorageService.to.phone ?? "";
name = StorageService.to.name ?? "";
plateNumberController = TextEditingController(text: plateNumber);
getCatinfo();
getJqinfo();
// getSiteList();
getSiteList();
super.onInit();
}
@@ -363,7 +364,7 @@ class ReservationController extends GetxController with BaseControllerMixin {
try {
HttpService.to.setBaseUrl(AppTheme.test_service_url);
var responseData = await HttpService.to.get(
'appointment/truck/history-filling-summary?vin=LSFGL23Z2ND214377'
'appointment/truck/history-filling-summary?vin=LSFGL23Z2ND214377',
);
if (responseData == null || responseData.data == null) {
showToast('服务暂不可用,请稍后');
@@ -372,7 +373,8 @@ class ReservationController extends GetxController with BaseControllerMixin {
var result = BaseModel.fromJson(responseData.data);
fillingWeight = "${result.data["fillingWeight"]}${result.data["fillingWeightUnit"]}";
fillingWeight =
"${result.data["fillingWeight"]}${result.data["fillingWeightUnit"]}";
fillingTimes = "${result.data["fillingTimes"]}${result.data["fillingTimesUnit"]}";
updateUi();
@@ -411,6 +413,7 @@ class ReservationController extends GetxController with BaseControllerMixin {
}
void getSiteList() async {
showLoading("加载中");
final originalHeaders = Map<String, dynamic>.from(HttpService.to.dio.options.headers);
try {
HttpService.to.setBaseUrl(AppTheme.jiaqing_service_url);
@@ -420,10 +423,12 @@ class ReservationController extends GetxController with BaseControllerMixin {
if (responseData == null && responseData!.data == null) {
showToast('暂时无法获取站点信息');
dismissLoading();
return;
}
try {
dismissLoading();
var result = BaseModel.fromJson(responseData.data);
// showToast(result.data["data"].toString());
} catch (e) {
@@ -431,6 +436,7 @@ class ReservationController extends GetxController with BaseControllerMixin {
}
} catch (e) {
} finally {
dismissLoading();
HttpService.to.setBaseUrl(AppTheme.test_service_url);
HttpService.to.dio.options.headers = originalHeaders;
}