样式调整

This commit is contained in:
2026-01-29 17:01:21 +08:00
parent e59b89c225
commit 1177be821a
12 changed files with 260 additions and 501 deletions

View File

@@ -363,10 +363,10 @@ class C_ReservationController extends GetxController with BaseControllerMixin {
(s) => s.hydrogenId == selectedStationId.value,
);
if (selectedStation.siteStatusName != "营运中") {
/*if (selectedStation.siteStatusName != "营运中") {
showToast("该站点${selectedStation.siteStatusName},暂无法预约");
return;
}
}*/
showLoading("提交中");
@@ -552,7 +552,7 @@ class C_ReservationController extends GetxController with BaseControllerMixin {
getUserBindCarInfo();
getSiteList();
startAutoRefresh();
_msgNotice();
msgNotice();
if (!init) {
_setupListener();
@@ -562,7 +562,7 @@ class C_ReservationController extends GetxController with BaseControllerMixin {
bool isNotice = false;
Future<void> _msgNotice() async {
Future<void> msgNotice() async {
final Map<String, dynamic> requestData = {
'appFlag': 1,
'isRead': 1,
@@ -578,6 +578,7 @@ class C_ReservationController extends GetxController with BaseControllerMixin {
if (result.code == 0 && result.data != null) {
String total = result.data["total"].toString();
isNotice = int.parse(total) > 0;
updateUi();
}
}
}
@@ -656,8 +657,13 @@ class C_ReservationController extends GetxController with BaseControllerMixin {
var result = BaseModel.fromJson(responseData.data);
final value = double.tryParse(
result.data["fillingWeight"]?.toString() ?? '0',
) ?? 0;
final String formatted = value.toStringAsFixed(2);
fillingWeight =
"${result.data["fillingWeight"]}${result.data["fillingWeightUnit"]}";
"$formatted${result.data["fillingWeightUnit"]}";
fillingTimes = "${result.data["fillingTimes"]}${result.data["fillingTimesUnit"]}";
updateUi();

View File

@@ -152,7 +152,13 @@ class ReservationPage extends GetView<C_ReservationController> {
),
),
IconButton(
onPressed: () => Get.to(() => const MessagePage()),
onPressed: () async{
var scanResult = await Get.to(() => const MessagePage());
if (scanResult == null) {
controller.msgNotice();
}
},
icon: Badge(
smallSize: 8,
backgroundColor: controller.isNotice
@@ -519,7 +525,7 @@ class ReservationPage extends GetView<C_ReservationController> {
color: Colors.white,
shape: RoundedRectangleBorder(borderRadius: BorderRadius.circular(8)),
child: Padding(
padding: const EdgeInsets.all(13.0),
padding: EdgeInsets.all(13.0),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
@@ -570,15 +576,19 @@ class ReservationPage extends GetView<C_ReservationController> {
children: [
IconButton(
onPressed: () => _updateAmount(-1),
icon: const Icon(Icons.remove, size: 18, color: Colors.grey),
icon: Icon(Icons.remove, size: 14.sp, color: Colors.grey),
),
Text(
"${controller.amountController.text} Kg",
style: const TextStyle(fontSize: 14, color: Colors.black87),
"${controller.amountController.text}Kg",
style: TextStyle(
fontSize: 11.sp,
color: Colors.black87,
fontWeight: FontWeight.w500,
),
),
IconButton(
onPressed: () => _updateAmount(1),
icon: const Icon(Icons.add, size: 18, color: Colors.grey),
icon: Icon(Icons.add, size: 14.sp, color: Colors.grey),
),
],
),
@@ -758,6 +768,9 @@ class ReservationPage extends GetView<C_ReservationController> {
controller.amountController.text = newAmount.toStringAsFixed(2);
}
//更新进度条
controller.current = newAmount;
// 移动光标到末尾,防止光标跳到前面
controller.amountController.selection = TextSelection.fromPosition(
TextPosition(offset: controller.amountController.text.length),