补充空显示

This commit is contained in:
2025-11-18 17:52:04 +08:00
parent 12cd42fbf1
commit 02937f85cc
3 changed files with 9 additions and 5 deletions

View File

@@ -23,7 +23,6 @@ class ReservationController extends GetxController with BaseControllerMixin {
@override @override
void onInit() { void onInit() {
super.onInit(); super.onInit();
// 可以在这里从服务器加载站点的初始信息
renderData(); renderData();
} }
@@ -58,8 +57,13 @@ class ReservationController extends GetxController with BaseControllerMixin {
name = result.data["name"]; name = result.data["name"];
hydrogenId = result.data["hydrogenId"].toString(); hydrogenId = result.data["hydrogenId"].toString();
address = result.data["address"]; address = result.data["address"];
costPrice = result.data["costPrice"].toString(); var rawCostPrice = result.data["costPrice"];
customerPrice = result.data["customerPrice"].toString(); if (rawCostPrice != null && rawCostPrice.toString().isNotEmpty) {
costPrice = "¥$rawCostPrice";
} else {
costPrice = "暂无价格";
}
customerPrice = result.data["customerPrice"] ?? "暂无价格";
phone = result.data["phone"]; phone = result.data["phone"];
startBusiness = result.data["startBusiness"]; startBusiness = result.data["startBusiness"];
endBusiness = result.data["endBusiness"]; endBusiness = result.data["endBusiness"];

View File

@@ -71,7 +71,7 @@ class ReservationPage extends GetView<ReservationController> {
child: Row( child: Row(
mainAxisAlignment: MainAxisAlignment.spaceAround, mainAxisAlignment: MainAxisAlignment.spaceAround,
children: [ children: [
_buildHeaderStat('¥${controller.costPrice}', '氢气价格'), _buildHeaderStat(controller.costPrice, '氢气价格'),
_buildHeaderStat(controller.timeStr, '营业时间'), _buildHeaderStat(controller.timeStr, '营业时间'),
_buildHeaderStat('98%', '设备状态'), _buildHeaderStat('98%', '设备状态'),
], ],

View File

@@ -452,7 +452,7 @@ class C_ReservationController extends GetxController with BaseControllerMixin {
itemBuilder: (context, index) { itemBuilder: (context, index) {
final ReservationModel reservation = reservationList[index]; final ReservationModel reservation = reservationList[index];
return Card( return Card(
color: Color.fromARGB(255, 246, 248, 250), color: Colors.white,
margin: const EdgeInsets.only(bottom: 12.0), margin: const EdgeInsets.only(bottom: 12.0),
elevation: 1, elevation: 1,
shape: RoundedRectangleBorder( shape: RoundedRectangleBorder(