diff --git a/ln_jq_app/lib/pages/b_page/site/view.dart b/ln_jq_app/lib/pages/b_page/site/view.dart index dd24765..b1a77db 100644 --- a/ln_jq_app/lib/pages/b_page/site/view.dart +++ b/ln_jq_app/lib/pages/b_page/site/view.dart @@ -18,7 +18,7 @@ class SitePage extends GetView { id: 'site', builder: (_) { return Scaffold( - backgroundColor: Color(0xFFF5F7F9), + backgroundColor: Color.fromRGBO(247, 249, 251, 1), body: SingleChildScrollView(child: _buildView(context)), ); }, @@ -60,7 +60,7 @@ class SitePage extends GetView { '历史记录', style: TextStyle( fontSize: 14.sp, - fontWeight: FontWeight.w500, + fontWeight: FontWeight.bold, color: Color.fromRGBO(156, 163, 175, 1), ), ), @@ -267,36 +267,78 @@ class SitePage extends GetView { //搜索输入框,提示可以输入车牌或者手机 Widget _buildSearchView() { return Padding( - padding: const EdgeInsets.fromLTRB(16, 12, 16, 0), + padding: EdgeInsets.fromLTRB(0, 0, 0, 8.h), child: Row( children: [ Expanded( child: SizedBox( - height: 44, + height: 42.h, child: TextField( + textAlignVertical: TextAlignVertical.center, controller: controller.searchController, // 绑定控制器 decoration: InputDecoration( - hintText: '输入车牌号或完整手机号查询', - contentPadding: const EdgeInsets.symmetric(horizontal: 16), + filled: true, + isDense: true, + fillColor: Colors.white, + hintText: '输入车牌号或手机号搜索...', + contentPadding: const EdgeInsets.symmetric( + vertical: 12, + horizontal: 16, + ), border: OutlineInputBorder( - borderRadius: BorderRadius.circular(22), - borderSide: BorderSide(color: Colors.grey.shade300), + borderRadius: BorderRadius.circular(12), + borderSide: BorderSide(color: Color.fromRGBO(229, 231, 235, 1)), ), enabledBorder: OutlineInputBorder( - borderRadius: BorderRadius.circular(22), - borderSide: BorderSide(color: Colors.grey.shade300), + borderRadius: BorderRadius.circular(12), + borderSide: BorderSide(color: Color.fromRGBO(229, 231, 235, 1)), ), focusedBorder: OutlineInputBorder( - borderRadius: BorderRadius.circular(22), - borderSide: BorderSide(color: Get.theme.primaryColor, width: 1.5), + borderRadius: BorderRadius.circular(12), + borderSide: BorderSide( + color: Color.fromRGBO(229, 231, 235, 1), + width: 1.5, + ), ), // 清除按钮 - suffixIcon: IconButton( - icon: const Icon(Icons.clear, size: 20), - onPressed: () { - controller.searchController.clear(); - controller.fetchReservationData(); // 清除后也刷新一次 - }, + suffix: Row( + mainAxisSize: MainAxisSize.min, + children: [ + IconButton( + icon: const Icon(Icons.clear, size: 20), + onPressed: () { + controller.searchController.clear(); + controller.fetchReservationData(); // 清除后也刷新一次 + }, + ), + GestureDetector( + onTap: () { + // 点击“搜索”按钮时触发 + FocusScope.of(Get.context!).unfocus(); // 收起键盘 + controller.fetchReservationData(); + }, + child: Container( + padding: EdgeInsets.only( + left: 16.w, + right: 16.h, + top: 4.5.h, + bottom: 4.5.h, + ), + decoration: BoxDecoration( + color: Color.fromRGBO(1, 113, 55, 1), + borderRadius: BorderRadius.circular(8), + ), + child: Text( + "搜索", + style: TextStyle( + color: Colors.white, + fontWeight: FontWeight.w500, + fontSize: 12.sp, + ), + ), + ), + ), + ], ), ), onSubmitted: (value) { @@ -306,40 +348,6 @@ class SitePage extends GetView { ), ), ), - const SizedBox(width: 10), - ElevatedButton( - onPressed: () { - // 点击“搜索”按钮时触发 - FocusScope.of(Get.context!).unfocus(); // 收起键盘 - controller.fetchReservationData(); - }, - style: ElevatedButton.styleFrom( - shape: const CircleBorder(), - padding: const EdgeInsets.all(8), - ), - child: const Icon(Icons.search_rounded), - ), - ], - ), - ); - } - - /// 构建单个统计项 - Widget _buildStatItem(String value, String label, {Color valueColor = Colors.blue}) { - return Expanded( - child: Column( - mainAxisSize: MainAxisSize.min, - children: [ - Text( - value, - style: TextStyle( - fontSize: 18, - fontWeight: FontWeight.bold, - color: valueColor, - ), - ), - const SizedBox(height: 4), - Text(label, style: const TextStyle(fontSize: 14, color: Colors.grey)), ], ), );