This commit is contained in:
2026-01-15 09:30:47 +08:00
parent d1b7a9eb76
commit d8f335eb4e
7 changed files with 120 additions and 25 deletions

View File

@@ -1,3 +1,6 @@
import java.util.Properties
import java.io.FileInputStream
plugins { plugins {
id("com.android.application") id("com.android.application")
id("kotlin-android") id("kotlin-android")
@@ -5,6 +8,14 @@ plugins {
id("dev.flutter.flutter-gradle-plugin") id("dev.flutter.flutter-gradle-plugin")
} }
val keystoreProperties = Properties()
val keystorePropertiesFile = rootProject.file("key.properties")
if (keystorePropertiesFile.exists()) {
keystorePropertiesFile.inputStream().use { input ->
keystoreProperties.load(input.reader(Charsets.UTF_8))
}
}
android { android {
namespace = "com.lnkj.ln_jq_app" namespace = "com.lnkj.ln_jq_app"
compileSdk = flutter.compileSdkVersion compileSdk = flutter.compileSdkVersion
@@ -30,11 +41,26 @@ android {
versionName = "1.2.2" versionName = "1.2.2"
} }
signingConfigs {
create("release") {
keyAlias = keystoreProperties["keyAlias"] as String?
keyPassword = keystoreProperties["keyPassword"] as String?
val storeFilePath = keystoreProperties["storeFile"] as String?
storeFile = if (storeFilePath != null) file(storeFilePath) else null
storePassword = keystoreProperties["storePassword"] as String?
}
}
buildTypes { buildTypes {
release { getByName("release") {
// TODO: Add your own signing config for the release build. // 使用上面定义的 release 签名
// Signing with the debug keys for now, so `flutter run --release` works. signingConfig = signingConfigs.getByName("release")
signingConfig = signingConfigs.getByName("debug")
// 修复混淆规则引用语法
proguardFiles(
getDefaultProguardFile("proguard-android-optimize.txt"),
"proguard-rules.pro"
)
} }
} }
} }

View File

@@ -0,0 +1,61 @@
# Please add these rules to your existing keep rules in order to suppress warnings.
# This is generated automatically by the Android Gradle plugin.
# 忽略 Google Play Core 相关的缺失警告(解决你目前的报错)
-dontwarn com.google.android.play.core.**
# Flutter 基础规则
-keep class io.flutter.app.** { *; }
-keep class io.flutter.plugin.** { *; }
-keep class io.flutter.util.** { *; }
-keep class io.flutter.view.** { *; }
-keep class io.flutter.** { *; }
-keep class io.flutter.plugins.** { *; }
-dontwarn com.huawei.android.os.BuildEx$VERSION
-dontwarn com.huawei.hianalytics.process.HiAnalyticsConfig$Builder
-dontwarn com.huawei.hianalytics.process.HiAnalyticsConfig
-dontwarn com.huawei.hianalytics.process.HiAnalyticsInstance$Builder
-dontwarn com.huawei.hianalytics.process.HiAnalyticsInstance
-dontwarn com.huawei.hianalytics.process.HiAnalyticsManager
-dontwarn com.huawei.hianalytics.util.HiAnalyticTools
-dontwarn com.huawei.hms.availableupdate.UpdateAdapterMgr
-dontwarn com.huawei.libcore.io.ExternalStorageFile
-dontwarn com.huawei.libcore.io.ExternalStorageFileInputStream
-dontwarn com.huawei.libcore.io.ExternalStorageFileOutputStream
-dontwarn com.huawei.libcore.io.ExternalStorageRandomAccessFile
-dontwarn org.android.netutil.PingEntry
-dontwarn org.android.netutil.PingResponse
-dontwarn org.android.netutil.PingTask
-dontwarn org.bouncycastle.crypto.BlockCipher
-dontwarn org.bouncycastle.crypto.engines.AESEngine
-dontwarn org.bouncycastle.crypto.prng.SP800SecureRandom
-dontwarn org.bouncycastle.crypto.prng.SP800SecureRandomBuilder
-keepclasseswithmembernames class ** {
native <methods>;
}
-keepattributes Signature
-keep class sun.misc.Unsafe { *; }
-keep class com.taobao.** {*;}
-keep class com.alibaba.** {*;}
-keep class com.alipay.** {*;}
-keep class com.ut.** {*;}
-keep class com.ta.** {*;}
-keep class anet.**{*;}
-keep class anetwork.**{*;}
-keep class org.android.spdy.**{*;}
-keep class org.android.agoo.**{*;}
-keep class android.os.**{*;}
-keep class org.json.**{*;}
-dontwarn com.taobao.**
-dontwarn com.alibaba.**
-dontwarn com.alipay.**
-dontwarn anet.**
-dontwarn org.android.spdy.**
-dontwarn org.android.agoo.**
-dontwarn anetwork.**
-dontwarn com.ut.**
-dontwarn com.ta.**

View File

@@ -66,10 +66,13 @@ class ReservationController extends GetxController with BaseControllerMixin {
final jobDataResult = BaseModel.fromJson(jobData.data); final jobDataResult = BaseModel.fromJson(jobData.data);
if (jobDataResult.code == 0) { if (jobDataResult.code == 0) {
try { try {
jobId = jobDataResult.data["id"] ?? ""; final List<dynamic> dataList = jobDataResult.data is List ? jobDataResult.data : [];
String endTime = jobDataResult.data["endTime"] ?? ""; final firstJob = dataList[0];
String beginTime = jobDataResult.data["beginTime"] ?? "";
String hydStatus = jobDataResult.data["hydStatus"] ?? ""; jobId = firstJob["id"] ?? "";
String endTime = firstJob["endTime"] ?? "";
String beginTime = firstJob["beginTime"] ?? "";
String hydStatus = firstJob["hydStatus"].toString() ?? "";
String hydStatusStr = ""; String hydStatusStr = "";
if (hydStatus == "0") { if (hydStatus == "0") {
hydStatusStr = "营运中"; hydStatusStr = "营运中";
@@ -112,7 +115,9 @@ class ReservationController extends GetxController with BaseControllerMixin {
} }
} }
} catch (e) { } catch (e) {
Logger.d("解析失败: $e"); Logger.d("解析失败或者没返回信息: $e");
jobTipStr = "";
} }
} }
} }
@@ -282,6 +287,7 @@ class ReservationController extends GetxController with BaseControllerMixin {
'appointment/station/updateStationStatus', 'appointment/station/updateStationStatus',
data: { data: {
'hydrogenId': hydrogenId, 'hydrogenId': hydrogenId,
'name': name,
'siteStatus': selectedOperationStatus == "营运中" 'siteStatus': selectedOperationStatus == "营运中"
? "0" ? "0"
: selectedOperationStatus == "维修中" : selectedOperationStatus == "维修中"
@@ -309,6 +315,9 @@ class ReservationController extends GetxController with BaseControllerMixin {
var result = BaseModel.fromJson(responseData.data); var result = BaseModel.fromJson(responseData.data);
if (result.code == 0) { if (result.code == 0) {
showSuccessToast("保存成功,已同步通知对应司机"); showSuccessToast("保存成功,已同步通知对应司机");
//重新刷新页面
renderData();
} }
dismissLoading(); dismissLoading();
} catch (e) { } catch (e) {
@@ -325,10 +334,7 @@ class ReservationController extends GetxController with BaseControllerMixin {
DialogX.to.showConfirmDialog( DialogX.to.showConfirmDialog(
title: '当前设置详情', title: '当前设置详情',
content: Text( content: Text(jobDetailsStr, style: const TextStyle(fontSize: 15, height: 1.5)),
jobDetailsStr,
style: const TextStyle(fontSize: 15, height: 1.5),
),
confirmText: '好的', confirmText: '好的',
cancelText: '取消设置', cancelText: '取消设置',
onCancel: () { onCancel: () {
@@ -342,9 +348,7 @@ class ReservationController extends GetxController with BaseControllerMixin {
void _cancelJob() async { void _cancelJob() async {
showLoading("正在取消..."); showLoading("正在取消...");
try { try {
var response = await HttpService.to.delete( var response = await HttpService.to.delete('appointment/job/hyd/$jobId');
'appointment/job/hyd/$jobId',
);
dismissLoading(); dismissLoading();
if (response != null) { if (response != null) {

View File

@@ -197,6 +197,7 @@ class ReservationPage extends GetView<ReservationController> {
controller.jobTipStr, controller.jobTipStr,
style: TextStyle(color: Colors.yellow[800], fontSize: 14), style: TextStyle(color: Colors.yellow[800], fontSize: 14),
), ),
SizedBox(width: 2.w),
Icon(AntdIcon.question_circle, size: 14, color: Colors.yellow[800]), Icon(AntdIcon.question_circle, size: 14, color: Colors.yellow[800]),
], ],
), ),

View File

@@ -57,7 +57,7 @@ class MineController extends GetxController with BaseControllerMixin {
_fetchAccidentCount(), // 请求2事故数 _fetchAccidentCount(), // 请求2事故数
_fetchBreakRulesCount(), // 请求3违章数 _fetchBreakRulesCount(), // 请求3违章数
_rating(), // 司机评分 _rating(), // 司机评分
_msgNotice(), // 红点消息 msgNotice(), // 红点消息
]); ]);
await renderViolation(); await renderViolation();
@@ -69,7 +69,7 @@ class MineController extends GetxController with BaseControllerMixin {
} }
} }
Future<void> _msgNotice() async { Future<void> msgNotice() async {
final Map<String, dynamic> requestData = { final Map<String, dynamic> requestData = {
'appFlag': 1, 'appFlag': 1,
'isRead': 1, 'isRead': 1,

View File

@@ -82,9 +82,12 @@ class MinePage extends GetView<MineController> {
), ),
), ),
IconButton( IconButton(
onPressed: () { onPressed: () async {
// 跳转消息中心 // 跳转消息中心
Get.to(() => const MessagePage()); var scanResult = await Get.to(() => const MessagePage());
if (scanResult == null) {
controller.msgNotice();
}
}, },
// 这里的 style 是为了模拟你图片里的灰色圆形背景 // 这里的 style 是为了模拟你图片里的灰色圆形背景
style: IconButton.styleFrom( style: IconButton.styleFrom(

View File

@@ -341,12 +341,12 @@ class C_ReservationController extends GetxController with BaseControllerMixin {
final startTimeStr = final startTimeStr =
'$dateStr ${_formatTimeOfDay(startTime.value)}:00'; // Use helper directly '$dateStr ${_formatTimeOfDay(startTime.value)}:00'; // Use helper directly
if (lastSuccessfulReservation != null && /*if (lastSuccessfulReservation != null &&
lastSuccessfulReservation!.id == selectedStationId.value && lastSuccessfulReservation!.id == selectedStationId.value &&
lastSuccessfulReservation!.startTime == startTimeStr) { lastSuccessfulReservation!.startTime == startTimeStr) {
showToast("请勿重复提交相同时间段的预约,可在“查看预约”中修改"); showToast("请勿重复提交相同时间段的预约,可在“查看预约”中修改");
return; return;
} }*/
final reservationEndDateTime = DateTime( final reservationEndDateTime = DateTime(
selectedDate.value.year, selectedDate.value.year,