样式调整

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

@@ -34,10 +34,10 @@ class CarInfoController extends GetxController with BaseControllerMixin {
void onInit() {
super.onInit();
getUserBindCarInfo();
_msgNotice();
msgNotice();
}
Future<void> _msgNotice() async {
Future<void> msgNotice() async {
final Map<String, dynamic> requestData = {
'appFlag': 1,
'isRead': 1,
@@ -53,6 +53,7 @@ class CarInfoController extends GetxController with BaseControllerMixin {
if (result.code == 0 && result.data != null) {
String total = result.data["total"].toString();
isNotice = int.parse(total) > 0;
updateUi();
}
}
}

View File

@@ -133,8 +133,11 @@ class CarInfoPage extends GetView<CarInfoController> {
),
),
IconButton(
onPressed: () {
Get.to(() => const MessagePage());
onPressed: () async{
var scanResult = await Get.to(() => const MessagePage());
if (scanResult == null) {
controller.msgNotice();
}
},
style: IconButton.styleFrom(
backgroundColor: Colors.grey[100],
@@ -345,7 +348,7 @@ class CarInfoPage extends GetView<CarInfoController> {
),
const SizedBox(height: 9),
SizedBox(
height: 336.h, // 给定一个高度,或者使用别的方式布局
height: 356.h, // 给定一个高度,或者使用别的方式布局
child: TabBarView(
children: [
_buildCertificateContent('行驶证', controller.drivingAttachments),
@@ -379,7 +382,7 @@ class CarInfoPage extends GetView<CarInfoController> {
Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
_buildCertDetailItem('所属公司', controller.rentFromCompany, isFull: true),
_buildCertDetailItem('所属公司', controller.rentFromCompany, isFull: false),
_buildCertDetailItem('运营城市', controller.address),
],
),

View File

@@ -140,8 +140,12 @@ class MinePage extends GetView<MineController> {
),
),
IconButton(
onPressed: () {
Get.to(() => const MessagePage());
onPressed: () async{
var scanResult = await Get.to(() => const MessagePage());
if (scanResult == null) {
controller.msgNotice();
}
},
style: IconButton.styleFrom(
backgroundColor: Colors.grey[100],

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),