调整
This commit is contained in:
@@ -91,10 +91,10 @@ class B_BaseWidgetsPage extends GetView<B_BaseWidgetsController> {
|
|||||||
id: 'b_baseWidgets',
|
id: 'b_baseWidgets',
|
||||||
builder: (_) {
|
builder: (_) {
|
||||||
return Scaffold(
|
return Scaffold(
|
||||||
extendBody: false,
|
extendBody: true,
|
||||||
resizeToAvoidBottomInset: false,
|
resizeToAvoidBottomInset: false,
|
||||||
bottomNavigationBar: _buildNavigationBar(),
|
bottomNavigationBar: _buildNavigationBar(),
|
||||||
body: SafeArea(child: _buildView()),
|
body: _buildView(),
|
||||||
);
|
);
|
||||||
},
|
},
|
||||||
);
|
);
|
||||||
|
|||||||
@@ -36,7 +36,7 @@ class ReservationPage extends GetView<ReservationController> {
|
|||||||
_buildSystemTips(),
|
_buildSystemTips(),
|
||||||
SizedBox(height: 24),
|
SizedBox(height: 24),
|
||||||
_buildLogoutButton(),
|
_buildLogoutButton(),
|
||||||
SizedBox(height: 40),
|
SizedBox(height: 75.h),
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
@@ -363,9 +363,9 @@ class ReservationPage extends GetView<ReservationController> {
|
|||||||
child: Text(
|
child: Text(
|
||||||
status,
|
status,
|
||||||
style: TextStyle(
|
style: TextStyle(
|
||||||
fontSize: 11.sp,
|
fontSize: 13.sp,
|
||||||
color: isSelected ? Colors.white : Color.fromRGBO(51, 51, 51, 1),
|
color: isSelected ? Colors.white : Color.fromRGBO(51, 51, 51, 1),
|
||||||
fontWeight: FontWeight.w400,
|
fontWeight: FontWeight.w500,
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
|
|||||||
@@ -6,6 +6,7 @@ import 'package:getx_scaffold/getx_scaffold.dart';
|
|||||||
import 'package:ln_jq_app/common/model/base_model.dart';
|
import 'package:ln_jq_app/common/model/base_model.dart';
|
||||||
import 'package:ln_jq_app/common/styles/theme.dart';
|
import 'package:ln_jq_app/common/styles/theme.dart';
|
||||||
import 'package:ln_jq_app/storage_service.dart';
|
import 'package:ln_jq_app/storage_service.dart';
|
||||||
|
import 'package:pull_to_refresh/pull_to_refresh.dart';
|
||||||
|
|
||||||
enum ReservationStatus {
|
enum ReservationStatus {
|
||||||
pending, // 待处理 ( addStatus: 0)
|
pending, // 待处理 ( addStatus: 0)
|
||||||
@@ -144,6 +145,7 @@ class SiteController extends GetxController with BaseControllerMixin {
|
|||||||
|
|
||||||
final TextEditingController searchController = TextEditingController();
|
final TextEditingController searchController = TextEditingController();
|
||||||
bool isNotice = false;
|
bool isNotice = false;
|
||||||
|
final RefreshController refreshController = RefreshController(initialRefresh: false);
|
||||||
|
|
||||||
@override
|
@override
|
||||||
bool get listenLifecycleEvent => true;
|
bool get listenLifecycleEvent => true;
|
||||||
@@ -200,6 +202,8 @@ class SiteController extends GetxController with BaseControllerMixin {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void onRefresh() => renderData(isRefresh: true);
|
||||||
|
|
||||||
///停止定时器的方法
|
///停止定时器的方法
|
||||||
void stopAutoRefresh() {
|
void stopAutoRefresh() {
|
||||||
// 如果定时器存在并且是激活状态,就取消它
|
// 如果定时器存在并且是激活状态,就取消它
|
||||||
@@ -222,7 +226,7 @@ class SiteController extends GetxController with BaseControllerMixin {
|
|||||||
'pageNum': 1,
|
'pageNum': 1,
|
||||||
'pageSize': 50, // 暂时不考虑分页,一次获取30条
|
'pageSize': 50, // 暂时不考虑分页,一次获取30条
|
||||||
'keyword': searchText, // 加氢站名称、手机号
|
'keyword': searchText, // 加氢站名称、手机号
|
||||||
'stationId': StorageService.to.userId
|
'stationId': StorageService.to.userId,
|
||||||
},
|
},
|
||||||
);
|
);
|
||||||
|
|
||||||
@@ -588,7 +592,7 @@ class SiteController extends GetxController with BaseControllerMixin {
|
|||||||
String orderTotalAmount = "";
|
String orderTotalAmount = "";
|
||||||
String orderUnfinishedAmount = "";
|
String orderUnfinishedAmount = "";
|
||||||
|
|
||||||
Future<void> renderData() async {
|
Future<void> renderData({bool isRefresh = false}) async {
|
||||||
try {
|
try {
|
||||||
var responseData = await HttpService.to.get(
|
var responseData = await HttpService.to.get(
|
||||||
'appointment/station/getStationInfoById?hydrogenId=${StorageService.to.userId}',
|
'appointment/station/getStationInfoById?hydrogenId=${StorageService.to.userId}',
|
||||||
@@ -621,6 +625,10 @@ class SiteController extends GetxController with BaseControllerMixin {
|
|||||||
} finally {
|
} finally {
|
||||||
//加载列表数据
|
//加载列表数据
|
||||||
fetchReservationData();
|
fetchReservationData();
|
||||||
|
|
||||||
|
if (isRefresh) {
|
||||||
|
refreshController.refreshCompleted();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -4,6 +4,7 @@ import 'package:ln_jq_app/common/login_util.dart';
|
|||||||
import 'package:ln_jq_app/common/styles/theme.dart';
|
import 'package:ln_jq_app/common/styles/theme.dart';
|
||||||
import 'package:ln_jq_app/pages/b_page/history/view.dart';
|
import 'package:ln_jq_app/pages/b_page/history/view.dart';
|
||||||
import 'package:ln_jq_app/pages/c_page/message/view.dart';
|
import 'package:ln_jq_app/pages/c_page/message/view.dart';
|
||||||
|
import 'package:pull_to_refresh/pull_to_refresh.dart';
|
||||||
|
|
||||||
import 'controller.dart';
|
import 'controller.dart';
|
||||||
|
|
||||||
@@ -19,7 +20,12 @@ class SitePage extends GetView<SiteController> {
|
|||||||
builder: (_) {
|
builder: (_) {
|
||||||
return Scaffold(
|
return Scaffold(
|
||||||
backgroundColor: Color.fromRGBO(247, 249, 251, 1),
|
backgroundColor: Color.fromRGBO(247, 249, 251, 1),
|
||||||
body: SingleChildScrollView(child: _buildView(context)),
|
body: SmartRefresher(
|
||||||
|
controller: controller.refreshController,
|
||||||
|
enablePullUp: false,
|
||||||
|
onRefresh: controller.onRefresh,
|
||||||
|
child: SingleChildScrollView(child: _buildView(context)),
|
||||||
|
),
|
||||||
);
|
);
|
||||||
},
|
},
|
||||||
);
|
);
|
||||||
@@ -127,10 +133,10 @@ class SitePage extends GetView<SiteController> {
|
|||||||
],
|
],
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
SizedBox(height: 35.h),
|
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
|
SizedBox(height: 75.h),
|
||||||
],
|
],
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
@@ -180,12 +186,11 @@ class SitePage extends GetView<SiteController> {
|
|||||||
),
|
),
|
||||||
),
|
),
|
||||||
IconButton(
|
IconButton(
|
||||||
onPressed: () async{
|
onPressed: () async {
|
||||||
var scanResult = await Get.to(() => const MessagePage());
|
var scanResult = await Get.to(() => const MessagePage());
|
||||||
if (scanResult == null) {
|
if (scanResult == null) {
|
||||||
controller.msgNotice();
|
controller.msgNotice();
|
||||||
}
|
}
|
||||||
|
|
||||||
},
|
},
|
||||||
style: IconButton.styleFrom(
|
style: IconButton.styleFrom(
|
||||||
backgroundColor: Colors.grey[100],
|
backgroundColor: Colors.grey[100],
|
||||||
@@ -495,7 +500,7 @@ class SitePage extends GetView<SiteController> {
|
|||||||
"预约量:${item.amount}",
|
"预约量:${item.amount}",
|
||||||
style: TextStyle(
|
style: TextStyle(
|
||||||
color: Color(0xFF00A870),
|
color: Color(0xFF00A870),
|
||||||
fontSize: 12.sp,
|
fontSize: 13.sp,
|
||||||
fontWeight: FontWeight.bold,
|
fontWeight: FontWeight.bold,
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
@@ -510,7 +515,7 @@ class SitePage extends GetView<SiteController> {
|
|||||||
"${item.contactPerson} | ${item.contactPhone}",
|
"${item.contactPerson} | ${item.contactPhone}",
|
||||||
style: TextStyle(
|
style: TextStyle(
|
||||||
color: Color(0xFF999999),
|
color: Color(0xFF999999),
|
||||||
fontSize: 12.sp,
|
fontSize: 13.sp,
|
||||||
fontWeight: FontWeight.w400,
|
fontWeight: FontWeight.w400,
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
|
|||||||
@@ -33,6 +33,8 @@ class C_ReservationController extends GetxController with BaseControllerMixin {
|
|||||||
@override
|
@override
|
||||||
String get builderId => 'reservation';
|
String get builderId => 'reservation';
|
||||||
|
|
||||||
|
C_ReservationController();
|
||||||
|
|
||||||
final DateTime _now = DateTime.now();
|
final DateTime _now = DateTime.now();
|
||||||
|
|
||||||
// 计算当前时间属于哪个1小时区间
|
// 计算当前时间属于哪个1小时区间
|
||||||
@@ -583,12 +585,6 @@ class C_ReservationController extends GetxController with BaseControllerMixin {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@override
|
|
||||||
void onPaused() {
|
|
||||||
stopAutoRefresh();
|
|
||||||
super.onPaused();
|
|
||||||
}
|
|
||||||
|
|
||||||
void startAutoRefresh() {
|
void startAutoRefresh() {
|
||||||
// 先停止已存在的定时器,防止重复启动
|
// 先停止已存在的定时器,防止重复启动
|
||||||
stopAutoRefresh();
|
stopAutoRefresh();
|
||||||
@@ -782,7 +778,7 @@ class C_ReservationController extends GetxController with BaseControllerMixin {
|
|||||||
if (stationOptions.isEmpty) {
|
if (stationOptions.isEmpty) {
|
||||||
showToast('附近暂无可用加氢站');
|
showToast('附近暂无可用加氢站');
|
||||||
} else {
|
} else {
|
||||||
showToast('站点列表已刷新');
|
// showToast('站点列表已刷新');
|
||||||
}
|
}
|
||||||
|
|
||||||
// 找到第一个可选的站点作为默认值
|
// 找到第一个可选的站点作为默认值
|
||||||
@@ -828,8 +824,30 @@ class C_ReservationController extends GetxController with BaseControllerMixin {
|
|||||||
return '$hour:$minute';
|
return '$hour:$minute';
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@override
|
||||||
|
void onDetached() {
|
||||||
|
super.onDetached();
|
||||||
|
Logger.d('aaa-onDetached');
|
||||||
|
}
|
||||||
|
|
||||||
|
@override
|
||||||
|
void onHidden() {
|
||||||
|
super.onHidden();
|
||||||
|
Logger.d('aaa-onHidden');
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@override
|
||||||
|
void onPaused() {
|
||||||
|
super.onPaused();
|
||||||
|
Logger.d('aaa-onPaused');
|
||||||
|
stopAutoRefresh();
|
||||||
|
}
|
||||||
|
|
||||||
@override
|
@override
|
||||||
void onClose() {
|
void onClose() {
|
||||||
|
super.onClose();
|
||||||
|
Logger.d('aaa-onClose');
|
||||||
amountController.dispose();
|
amountController.dispose();
|
||||||
plateNumberController.dispose();
|
plateNumberController.dispose();
|
||||||
if (_debounce != null) {
|
if (_debounce != null) {
|
||||||
@@ -837,6 +855,6 @@ class C_ReservationController extends GetxController with BaseControllerMixin {
|
|||||||
}
|
}
|
||||||
_sheetWorker?.dispose();
|
_sheetWorker?.dispose();
|
||||||
stopAutoRefresh();
|
stopAutoRefresh();
|
||||||
super.onClose();
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,17 +1,12 @@
|
|||||||
import 'package:dropdown_button2/dropdown_button2.dart';
|
import 'package:dropdown_button2/dropdown_button2.dart';
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
import 'package:flutter/services.dart';
|
|
||||||
import 'package:get/get.dart';
|
|
||||||
import 'package:getx_scaffold/getx_scaffold.dart';
|
import 'package:getx_scaffold/getx_scaffold.dart';
|
||||||
import 'package:ln_jq_app/common/login_util.dart';
|
import 'package:ln_jq_app/common/login_util.dart';
|
||||||
import 'package:ln_jq_app/common/model/station_model.dart';
|
import 'package:ln_jq_app/common/model/station_model.dart';
|
||||||
import 'package:ln_jq_app/common/styles/theme.dart';
|
|
||||||
import 'package:ln_jq_app/pages/c_page/message/view.dart';
|
import 'package:ln_jq_app/pages/c_page/message/view.dart';
|
||||||
import 'package:ln_jq_app/pages/qr_code/view.dart';
|
|
||||||
import 'package:ln_jq_app/storage_service.dart';
|
import 'package:ln_jq_app/storage_service.dart';
|
||||||
|
|
||||||
import 'controller.dart';
|
import 'controller.dart';
|
||||||
import 'reservation_list_bottomsheet.dart';
|
|
||||||
|
|
||||||
///加氢预约
|
///加氢预约
|
||||||
class ReservationPage extends GetView<C_ReservationController> {
|
class ReservationPage extends GetView<C_ReservationController> {
|
||||||
|
|||||||
@@ -68,13 +68,14 @@ class _LoginPageState extends State<LoginPage> with SingleTickerProviderStateMix
|
|||||||
|
|
||||||
return Scaffold(
|
return Scaffold(
|
||||||
backgroundColor: Colors.white,
|
backgroundColor: Colors.white,
|
||||||
|
resizeToAvoidBottomInset: false,
|
||||||
body: GestureDetector(
|
body: GestureDetector(
|
||||||
onTap: () {
|
onTap: () {
|
||||||
hideKeyboard();
|
hideKeyboard();
|
||||||
},
|
},
|
||||||
child: Stack(
|
child: Stack(
|
||||||
children: [
|
children: [
|
||||||
// 1. 顶部背景与装饰
|
//顶部背景与装饰
|
||||||
Positioned(
|
Positioned(
|
||||||
top: 0,
|
top: 0,
|
||||||
left: 0,
|
left: 0,
|
||||||
@@ -92,9 +93,9 @@ class _LoginPageState extends State<LoginPage> with SingleTickerProviderStateMix
|
|||||||
),
|
),
|
||||||
_buildBrandingHeader(),
|
_buildBrandingHeader(),
|
||||||
|
|
||||||
// 2. 登录表单主体
|
// 登录表单主体
|
||||||
Positioned(
|
Positioned(
|
||||||
top: 280.h,
|
top: 300.h,
|
||||||
left: 0,
|
left: 0,
|
||||||
right: 0,
|
right: 0,
|
||||||
bottom: 0,
|
bottom: 0,
|
||||||
|
|||||||
Reference in New Issue
Block a user