Bladeren bron

签到签出的入口和接口的修改。
搜索的TitleBar的修改与封装

liukai 8 maanden geleden
bovenliggende
commit
be30a01957

+ 2 - 1
packages/cpt_auth/lib/modules/main/main_controller.dart

@@ -5,6 +5,7 @@ import 'package:domain/repository/auth_repository.dart';
 import 'package:get/get.dart';
 import 'package:plugin_basic/service/user_service.dart';
 import 'package:plugin_platform/engine/toast/toast_engine.dart';
+import 'package:router/componentRouter/component_router_service.dart';
 import 'package:widgets/load_state_layout.dart';
 import 'package:widgets/widget_export.dart';
 
@@ -115,7 +116,7 @@ class MainController extends GetxController {
         ToastEngine.show("进入 Job List 模块");
         break;
       case 'sign':
-        ToastEngine.show("进入 Sign in Sign out 模块");
+       ComponentRouterServices.jobService.startSignInSignOutPage();
         break;
       case 'devices':
         ToastEngine.show("进入 Devices 模块");

+ 7 - 10
packages/cpt_job/lib/modules/sign_in_sign_out/sign_in_sign_out_controller.dart

@@ -24,7 +24,7 @@ class SignInSignOutController extends GetxController with DioCancelableMixin {
 
   //页面的列表数据
   List<AttendanceList> datas = [];
-  String? keyword;
+  String keyword = "";
   Rx<DateTime> startDate = DateTime.now().obs;
   Rx<DateTime> endDate = DateTime.now().obs;
 
@@ -61,10 +61,8 @@ class SignInSignOutController extends GetxController with DioCancelableMixin {
       changeLoadingState(LoadState.State_Loading);
     }
 
-    final String? token = UserService.to.token;
     //获取到数据
     var result = await jobRepository.fetchAttendanceList(
-      token,
       keyword,
       DateTimeUtils.formatDate(startDate.value, format: "yyyy-MM-dd"),
       DateTimeUtils.formatDate(endDate.value, format: "yyyy-MM-dd"),
@@ -106,7 +104,6 @@ class SignInSignOutController extends GetxController with DioCancelableMixin {
     final String? token = UserService.to.token;
 
     var result = await jobRepository.submitCheckInOut(
-      token,
       item.appliedId.toString(),
       byteData,
       isCheckIn: isCheckIn,
@@ -131,9 +128,8 @@ class SignInSignOutController extends GetxController with DioCancelableMixin {
   }
 
   //执行搜索
-  void doSearch() {
-    var keywordController = state.formData['keyword']!['controller'];
-    keyword = keywordController.text;
+  void doSearch(String keyword) {
+    this.keyword = keyword;
     refreshController.callRefresh();
   }
 
@@ -173,11 +169,12 @@ class SignInSignOutController extends GetxController with DioCancelableMixin {
 
   /// 重置筛选条件
   void resetFiltering() {
-    var keywordController = state.formData['keyword']!['controller'];
-    keywordController.text = "";
-    keyword = null;
+    keyword = "";
+    state.searchController.text = "";
     startDate.value = DateTime.now();
     endDate.value = DateTime.now();
+    update();
+
     refreshController.callRefresh();
   }
 

+ 151 - 126
packages/cpt_job/lib/modules/sign_in_sign_out/sign_in_sign_out_page.dart

@@ -16,6 +16,7 @@ import 'package:shared/utils/screen_util.dart';
 import 'package:shared/utils/util.dart';
 import 'package:widgets/ext/ex_widget.dart';
 import 'package:widgets/load_state_layout.dart';
+import 'package:widgets/my_appbar.dart';
 import 'package:widgets/my_button.dart';
 import 'package:widgets/my_load_image.dart';
 import 'package:widgets/my_text_field.dart';
@@ -32,11 +33,7 @@ class SignInSignOutPage extends BaseStatefulPage<SignInSignOutController> {
 
   //启动当前页面
   static void startInstance() {
-    return Get.start(RouterPath.JOB_SIGN_IN_SIGN_OUT, launchModel: LaunchModel.singleTask);
-  }
-
-  static void startWithPop() {
-    Get.startWithPop(RouterPath.JOB_SIGN_IN_SIGN_OUT);
+    return Get.start(RouterPath.JOB_SIGN_IN_SIGN_OUT);
   }
 
   @override
@@ -94,51 +91,79 @@ class _SignInSignOutPageState extends BaseState<SignInSignOutPage, SignInSignOut
     return autoCtlGetBuilder(
       builder: (controller) {
         return Scaffold(
-          body: Container(
-            width: double.infinity,
-            height: double.infinity,
-            decoration: const BoxDecoration(
-              gradient: LinearGradient(
-                colors: [
-                  Color(0xFF091D44),
-                  Color(0xFF245A8A),
-                  Color(0xFF7F7CEC),
+          extendBodyBehindAppBar: true,
+          appBar: MyAppBar.appSearchBar(
+            context,
+            value: controller.keyword,
+            hintText: 'Name/Mobile'.tr,
+            controller: state.searchController,
+            onSearch: (keyword) {
+              controller.doSearch(keyword);
+            },
+            actions: [
+              MyButton(
+                onPressed: () {
+                  controller.resetFiltering();
+                },
+                text: "Reset".tr,
+                textColor: ColorConstants.white,
+                backgroundColor: hexToColor("#2BA9F9", opacity: 0.5),
+                radius: 17.25,
+                minWidth: 60,
+                minHeight: 35,
+              ).marginOnly(right: 15)
+            ],
+          ),
+          body: SafeArea(
+            bottom: true,
+            top: false,
+            child: Container(
+              width: double.infinity,
+              height: double.infinity,
+              padding: EdgeInsets.only(top: kToolbarHeight + ScreenUtil.getStatusBarH(context) + 1),
+              decoration: const BoxDecoration(
+                gradient: LinearGradient(
+                  colors: [
+                    Color(0xFF091D44),
+                    Color(0xFF245A8A),
+                    Color(0xFF7F7CEC),
+                  ],
+                  begin: Alignment.topCenter,
+                  end: Alignment.bottomCenter,
+                ),
+              ),
+              child: Column(
+                children: [
+                  //顶部的搜索标题布局
+                  // _buildSearchTitleBar(),
+
+                  // Container(color: Color(0XFF415B7C), height: 0.5, margin: EdgeInsets.only(top: 12)),
+
+                  _buildFilterDateWidget(),
+
+                  EasyRefresh(
+                    controller: controller.refreshController,
+                    onRefresh: controller.onRefresh,
+                    child: LoadStateLayout(
+                      state: controller.loadingState,
+                      errorMessage: controller.errorMessage,
+                      errorRetry: () {
+                        controller.retryRequest();
+                      },
+                      successSliverWidget: [
+                        SliverList(
+                            delegate: SliverChildBuilderDelegate(
+                          (context, index) {
+                            return _buildAttendanceItem(controller, index, () {});
+                          },
+                          childCount: controller.datas.length,
+                        ))
+                      ],
+                    ),
+                  ).expanded(),
                 ],
-                begin: Alignment.topCenter,
-                end: Alignment.bottomCenter,
               ),
             ),
-            child: Column(
-              children: [
-                //顶部的搜索标题布局
-                _buildSearchTitleBar(),
-
-                Container(color: Color(0XFF415B7C), height: 0.5, margin: EdgeInsets.only(top: 12)),
-
-                _buildFilterDateWidget(),
-
-                EasyRefresh(
-                  controller: controller.refreshController,
-                  onRefresh: controller.onRefresh,
-                  child: LoadStateLayout(
-                    state: controller.loadingState,
-                    errorMessage: controller.errorMessage,
-                    errorRetry: () {
-                      controller.retryRequest();
-                    },
-                    successSliverWidget: [
-                      SliverList(
-                          delegate: SliverChildBuilderDelegate(
-                        (context, index) {
-                          return _buildAttendanceItem(controller, index, () {});
-                        },
-                        childCount: controller.datas.length,
-                      ))
-                    ],
-                  ),
-                ).expanded(),
-              ],
-            ),
           ),
         );
       },
@@ -146,85 +171,85 @@ class _SignInSignOutPageState extends BaseState<SignInSignOutPage, SignInSignOut
   }
 
   /// 顶部的搜索栏布局
-  Widget _buildSearchTitleBar() {
-    return Row(
-      mainAxisSize: MainAxisSize.max,
-      crossAxisAlignment: CrossAxisAlignment.center,
-      children: [
-        Container(
-          height: 35,
-          padding: EdgeInsets.only(left: 15, right: 11),
-          margin: EdgeInsets.only(left: 15, right: 10),
-          decoration: BoxDecoration(
-            color: Color(0xFF4DCFF6).withOpacity(0.2), // 设置背景颜色和不透明度
-            borderRadius: BorderRadius.circular(17.25), // 设置圆角
-          ),
-          child: Row(
-            mainAxisSize: MainAxisSize.max,
-            crossAxisAlignment: CrossAxisAlignment.center,
-            children: [
-              //输入框
-              IgnoreKeyboardDismiss(
-                child: TextField(
-                  cursorColor: ColorConstants.white,
-                  cursorWidth: 1.5,
-                  autofocus: false,
-                  maxLines: 1,
-                  minLines: 1,
-                  // 是否自动获取焦点
-                  focusNode: state.formData['keyword']!['focusNode'],
-                  // 焦点控制
-                  controller: state.formData['keyword']!['controller'],
-                  // 与输入框交互控制器
-                  //装饰
-                  decoration: InputDecoration(
-                    isDense: true,
-                    //清除垂直方向的填充
-                    isCollapsed: true,
-                    //让文字垂直居中
-                    border: InputBorder.none,
-                    hintText: state.formData['keyword']!['hintText'],
-                    hintStyle: TextStyle(
-                      color: hexToColor("#AECAE5"),
-                      fontSize: 15.0,
-                      fontWeight: FontWeight.w400,
-                    ),
-                  ),
-                  style: TextStyle(
-                    color: ColorConstants.white,
-                    fontSize: 15.0,
-                    fontWeight: FontWeight.w400,
-                  ),
-                  // 键盘动作右下角图标
-                  textInputAction: TextInputAction.search,
-                  textAlignVertical: TextAlignVertical.center,
-                  onSubmitted: (value) {
-                    controller.doSearch();
-                  }, //输入框完成触发
-                ),
-              ).expanded(),
-
-              //搜索图标
-              MyAssetImage(Assets.cptJobSearchIcon, width: 15, height: 15).marginOnly(left: 10).onTap(() {
-                controller.doSearch();
-              }),
-            ],
-          ),
-        ).expanded(),
-        MyButton(
-          onPressed: () {
-            controller.resetFiltering();
-          },
-          text: "Reset".tr,
-          textColor: ColorConstants.white,
-          backgroundColor: hexToColor("#2BA9F9", opacity: 0.5),
-          radius: 17.25,
-          minWidth: 60,
-          minHeight: 35,
-        )
-      ],
-    ).marginOnly(top: ScreenUtil.getStatusBarH(context) + 5, right: 12);
-  }
+  // Widget _buildSearchTitleBar() {
+  //   return Row(
+  //     mainAxisSize: MainAxisSize.max,
+  //     crossAxisAlignment: CrossAxisAlignment.center,
+  //     children: [
+  //       Container(
+  //         height: 35,
+  //         padding: EdgeInsets.only(left: 15, right: 11),
+  //         margin: EdgeInsets.only(left: 15, right: 10),
+  //         decoration: BoxDecoration(
+  //           color: Color(0xFF4DCFF6).withOpacity(0.2), // 设置背景颜色和不透明度
+  //           borderRadius: BorderRadius.circular(17.25), // 设置圆角
+  //         ),
+  //         child: Row(
+  //           mainAxisSize: MainAxisSize.max,
+  //           crossAxisAlignment: CrossAxisAlignment.center,
+  //           children: [
+  //             //输入框
+  //             IgnoreKeyboardDismiss(
+  //               child: TextField(
+  //                 cursorColor: ColorConstants.white,
+  //                 cursorWidth: 1.5,
+  //                 autofocus: false,
+  //                 maxLines: 1,
+  //                 minLines: 1,
+  //                 // 是否自动获取焦点
+  //                 focusNode: state.formData['keyword']!['focusNode'],
+  //                 // 焦点控制
+  //                 controller: state.formData['keyword']!['controller'],
+  //                 // 与输入框交互控制器
+  //                 //装饰
+  //                 decoration: InputDecoration(
+  //                   isDense: true,
+  //                   //清除垂直方向的填充
+  //                   isCollapsed: true,
+  //                   //让文字垂直居中
+  //                   border: InputBorder.none,
+  //                   hintText: state.formData['keyword']!['hintText'],
+  //                   hintStyle: TextStyle(
+  //                     color: hexToColor("#AECAE5"),
+  //                     fontSize: 15.0,
+  //                     fontWeight: FontWeight.w400,
+  //                   ),
+  //                 ),
+  //                 style: TextStyle(
+  //                   color: ColorConstants.white,
+  //                   fontSize: 15.0,
+  //                   fontWeight: FontWeight.w400,
+  //                 ),
+  //                 // 键盘动作右下角图标
+  //                 textInputAction: TextInputAction.search,
+  //                 textAlignVertical: TextAlignVertical.center,
+  //                 onSubmitted: (value) {
+  //                   controller.doSearch();
+  //                 }, //输入框完成触发
+  //               ),
+  //             ).expanded(),
+  //
+  //             //搜索图标
+  //             MyAssetImage(Assets.cptJobSearchIcon, width: 15, height: 15).marginOnly(left: 10).onTap(() {
+  //               controller.doSearch();
+  //             }),
+  //           ],
+  //         ),
+  //       ).expanded(),
+  //       MyButton(
+  //         onPressed: () {
+  //           controller.resetFiltering();
+  //         },
+  //         text: "Reset".tr,
+  //         textColor: ColorConstants.white,
+  //         backgroundColor: hexToColor("#2BA9F9", opacity: 0.5),
+  //         radius: 17.25,
+  //         minWidth: 60,
+  //         minHeight: 35,
+  //       )
+  //     ],
+  //   ).marginOnly(top: ScreenUtil.getStatusBarH(context) + 5, right: 12);
+  // }
 
   /// 时间筛选布局
   Widget _buildFilterDateWidget() {

+ 3 - 10
packages/cpt_job/lib/modules/sign_in_sign_out/sign_in_sign_out_state.dart

@@ -4,14 +4,7 @@ import 'package:flutter/material.dart';
 import 'package:plugin_basic/basic_export.dart';
 
 class SignInSignOutState {
-  //表单的校验与数据
-  Map<String, Map<String, dynamic>> formData = {
-    'keyword': {
-      'value': '',
-      'controller': TextEditingController(),
-      'focusNode': FocusNode(),
-      'hintText': 'Name/Mobile'.tr,
-      'obsecure': false,
-    },
-  };
+
+  final TextEditingController searchController = TextEditingController();
+
 }

+ 2 - 2
packages/cpt_job/lib/router/job_service_impl.dart

@@ -22,8 +22,8 @@ class JobServiceImpl extends GetxService implements JobService {
 
   // 启动签到签出页面
   @override
-  void startWithPopSignInSignOutPage() {
-    SignInSignOutPage.startWithPop();
+  void startSignInSignOutPage() {
+    SignInSignOutPage.startInstance();
   }
 
 }

+ 1 - 4
packages/cs_domain/lib/repository/job_repository.dart

@@ -18,14 +18,12 @@ class JobRepository extends GetxService {
 
   /// 获取当前酒店的考勤成员列表
   Future<HttpResult<AttendanceEntity>> fetchAttendanceList(
-    String? token,
     String? keyword,
     String? startDate,
     String? endDate, {
     CancelToken? cancelToken,
   }) async {
     Map<String, String> params = {};
-    params["token"] = token ?? "";
     params["cur_page"] = "1";
     params["page_size"] = "9999";
 
@@ -57,7 +55,6 @@ class JobRepository extends GetxService {
 
   /// 用户上传考勤
   Future<HttpResult<CheckSuccessEntity>> submitCheckInOut(
-    String? token,
     String? appliedId,
     ByteData? byteData, {
     bool isCheckIn = false,
@@ -65,7 +62,6 @@ class JobRepository extends GetxService {
   }) async {
     //Post请求
     Map<String, String> params = {};
-    params['token'] = token ?? "";
     params['applied_id'] = appliedId ?? "";
     params['check_type'] = isCheckIn ? "1" : "2";
 
@@ -93,4 +89,5 @@ class JobRepository extends GetxService {
     }
     return result.convert<CheckSuccessEntity>();
   }
+
 }

+ 1 - 0
packages/cs_resources/lib/local/language/en_US.dart

@@ -54,6 +54,7 @@ const Map<String, String> en_US = {
   'Account Deactivation': 'Account Deactivation',
   'Logout': 'Logout',
   'Old Password': 'Old Password',
+  'Settings': 'Settings',
 
   //插件的国际化
   'Pull to refresh': 'Pull to refresh',

+ 1 - 0
packages/cs_resources/lib/local/language/zh_CN.dart

@@ -54,6 +54,7 @@ const Map<String, String> zh_CN = {
   'Account Deactivation': '停用账户',
   'Logout': '登出',
   'Old Password': '旧密码',
+  'Settings': '设置',
 
   //插件的国际化
   'Pull to refresh': '下拉刷新',

+ 1 - 1
packages/cs_router/lib/componentRouter/job_service.dart

@@ -4,6 +4,6 @@
  */
 abstract class JobService {
 
-  void startWithPopSignInSignOutPage();
+  void startSignInSignOutPage();
 
 }

+ 34 - 41
packages/cs_widgets/lib/my_appbar.dart

@@ -23,19 +23,16 @@ class MyAppBar {
       backgroundColor: backgroundColor,
       surfaceTintColor: backgroundColor,
       systemOverlayStyle: systemUiOverlayStyle,
-      leading: Container(
-        padding: const EdgeInsets.only(top: 3.5),
-        child: IconButton(
-          icon: MyAssetImage(backIconPath ?? Assets.baseLibWhiteBack, width: backIconWidth ?? 11, height: backIconHeight ?? 18),
-          onPressed: () {
-            if (backCallback != null) {
-              backCallback();
-            } else {
-              Get.back();
-              // Navigator.pop(context);
-            }
-          },
-        ),
+      leading: IconButton(
+        icon: MyAssetImage(backIconPath ?? Assets.baseLibWhiteBack, width: backIconWidth ?? 11, height: backIconHeight ?? 18),
+        onPressed: () {
+          if (backCallback != null) {
+            backCallback();
+          } else {
+            Get.back();
+            // Navigator.pop(context);
+          }
+        },
       ),
       centerTitle: true,
       title: Text(
@@ -64,55 +61,51 @@ class MyAppBar {
     return SizedBox(width: width);
   }
 
-
   /// 带搜索的AppBar
   static AppBar appSearchBar(BuildContext context,
       {void Function()? backCallback,
-      String? backPath,
-      Color textColor = Colors.black,
-      Color backgroundColor = Colors.white,
+      String? value,
+      String? hintText,
+      Color textColor = Colors.white,
+      Color backgroundColor = Colors.transparent,
       ValueChanged<String>? onSearch,
       ValueChanged<String>? onChanged,
-      VoidCallback? onClear,
+      SystemUiOverlayStyle? systemUiOverlayStyle,
+      TextEditingController? controller,
       List<Widget>? actions}) {
     return AppBar(
-      backgroundColor: DarkThemeUtil.multiColors(backgroundColor, darkColor: ColorConstants.darkBlackItem),
-      surfaceTintColor: DarkThemeUtil.multiColors(backgroundColor, darkColor: ColorConstants.darkBlackItem),
+      backgroundColor: backgroundColor,
+      surfaceTintColor: backgroundColor,
+      systemOverlayStyle: systemUiOverlayStyle,
       // 标题与其他控件的间隔
       titleSpacing: 0,
-      leadingWidth: 40,
-      leading: Container(
-        padding: const EdgeInsets.only(top: 3.5),
-        child: IconButton(
-          icon: Get.isDarkMode
-              ? MyAssetImage(backPath ?? Assets.baseLibWhiteBack, width: 11, height: 18)
-              : MyAssetImage(backPath ?? Assets.baseLibBlackBack, width: 11, height: 18),
-          onPressed: () {
-            if (backCallback != null) {
-              backCallback();
-            } else {
-              Get.back();
-              // Navigator.pop(context);
-            }
-          },
-        ),
+      leading: IconButton(
+        icon: MyAssetImage(Assets.baseLibWhiteBack, width: 11, height: 18),
+        onPressed: () {
+          if (backCallback != null) {
+            backCallback();
+          } else {
+            Get.back();
+            // Navigator.pop(context);
+          }
+        },
       ),
       centerTitle: true,
       title: SearchAppBar(
         onSearch: onSearch,
-        onClear: onClear,
         onChanged: onChanged,
-        borderRadius: 13,
-        height: 28,
+        value: value,
+        hintText: hintText,
+        controller: controller,
       ),
       actions: actions,
       elevation: 0.0,
       bottom: PreferredSize(
           preferredSize: const Size.fromHeight(0.5),
           child: Divider(
-            height: 1.0,
+            height: 0.5,
             indent: 0.0,
-            color: DarkThemeUtil.multiColors(ColorConstants.dividerA6, darkColor: ColorConstants.darkBlackItemDivider),
+            color: ColorConstants.dividerBar,
           )),
     );
   }

+ 69 - 147
packages/cs_widgets/lib/search_app_bar.dart

@@ -10,49 +10,21 @@ import 'package:cs_resources/constants/color_constants.dart';
 class SearchAppBar extends StatefulWidget {
   SearchAppBar({
     Key? key,
-    // this.backPath,
-    this.borderRadius = 5,
+    this.value,
     this.autoFocus = false,
     this.focusNode,
     this.controller,
-    this.height = 35,
-    this.value,
-    // this.leading,
-    this.backgroundColor,
-    this.suffix,
     this.actions = const [],
     this.hintText,
     this.onTap,
-    this.onClear,
-    this.onCancel,
     this.onChanged,
     this.onSearch,
-    // this.onRightTap,
   }) : super(key: key);
 
-  final double? borderRadius;
   final bool? autoFocus;
   final FocusNode? focusNode;
   final TextEditingController? controller;
 
-  // 输入框高度 默认35
-  final double height;
-
-  // 默认值
-  final String? value;
-
-  //配置暗黑模式
-  // final String? backPath;
-
-  // 最前面的组件
-  // final Widget? leading;
-
-  // 背景色
-  final Color? backgroundColor;
-
-  // 搜索框内部后缀组件
-  final Widget? suffix;
-
   // 搜索框右侧组件
   final List<Widget> actions;
 
@@ -62,11 +34,7 @@ class SearchAppBar extends StatefulWidget {
   // 输入框点击回调
   final VoidCallback? onTap;
 
-  // 清除输入框内容回调
-  final VoidCallback? onClear;
-
-  // 清除输入框内容并取消输入
-  final VoidCallback? onCancel;
+  String? value;
 
   // 输入框内容改变
   final ValueChanged<String>? onChanged;
@@ -74,9 +42,6 @@ class SearchAppBar extends StatefulWidget {
   // 点击键盘搜索
   final ValueChanged<String>? onSearch;
 
-  // 点击右边widget
-  // final VoidCallback? onRightTap;
-
   @override
   _SearchAppBarState createState() => _SearchAppBarState();
 }
@@ -97,143 +62,100 @@ class _SearchAppBarState extends State<SearchAppBar> {
   void initState() {
     _controller = widget.controller ?? TextEditingController();
     _focusNode = widget.focusNode ?? FocusNode();
+    //赋值要显示的文本
     if (widget.value != null) _controller?.text = widget.value ?? "";
-    // 焦点获取失去监听
-    _focusNode?.addListener(() => setState(() {}));
-    // 文本输入监听
-    _controller?.addListener(() {
-      setState(() {});
-    });
+
     super.initState();
   }
 
-  // 清除输入框内容
-  void _onClearInput() {
+  // 更新输入框的文本内容
+  void updateValue(String newValue) {
     setState(() {
-      _controller?.clear();
+      _controller?.text = newValue;
     });
-    widget.onClear?.call();
   }
 
-  // 取消输入框编辑失去焦点
-  void _onCancelInput() {
+  //失去焦点和隐藏软键盘
+  void _unFocus() {
     setState(() {
-      _controller?.clear();
-      _focusNode?.unfocus(); //失去焦点
+      _focusNode?.unfocus();
     });
-    // 执行onCancel
-    widget.onCancel?.call();
   }
 
-  Widget _suffix() {
-    if (!isTextEmpty) {
-      return InkWell(
-        onTap: _onClearInput,
-        child: SizedBox(
-          width: widget.height,
-          height: widget.height,
-          child: Icon(Icons.cancel, size: 22, color: DarkThemeUtil.multiColors(const Color(0xFF999999), darkColor: Colors.white)),
-        ),
-      );
+  @override
+  void didUpdateWidget(covariant SearchAppBar oldWidget) {
+    super.didUpdateWidget(oldWidget);
+    if (widget.value != oldWidget.value) {
+      _controller?.text = widget.value ?? "";
     }
-    return widget.suffix ?? SizedBox();
-  }
-
-  List<Widget> _actions() {
-    List<Widget> list = [];
-    // if (isFocus || !isTextEmpty) {
-    //   list.add(InkWell(
-    //     onTap: widget.onRightTap ?? _onCancelInput,
-    //     child: Container(
-    //       constraints: BoxConstraints(minWidth: 48.w),
-    //       alignment: Alignment.center,
-    //       child: MyText(
-    //         '搜索',
-    //         fontColor: MyColors.color_666666,
-    //         fontSize: 14.sp,
-    //       ),
-    //     ),
-    //   ));
-    // } else if (!isActionEmpty) {
-    //   list.addAll(widget.actions);
-    // }
-    return list;
   }
 
   @override
   Widget build(BuildContext context) {
     return Container(
-      margin: const EdgeInsetsDirectional.only(end: 10),
-      height: widget.height,
+      height: 35,
+      padding: EdgeInsets.only(left: 15, right: 11),
+      margin: EdgeInsets.only(right: 15),
       decoration: BoxDecoration(
-        borderRadius: BorderRadius.circular(widget.borderRadius ?? 0),
-        border: Border.all(width: 0.5, color: DarkThemeUtil.multiColors(Colors.black, darkColor: Colors.white)!),
+        color: Color(0xFF4DCFF6).withOpacity(0.2), // 设置背景颜色和不透明度
+        borderRadius: BorderRadius.circular(17.25), // 设置圆角
       ),
       child: Row(
+        mainAxisSize: MainAxisSize.max,
         crossAxisAlignment: CrossAxisAlignment.center,
         children: [
-          //间距
-          SizedBox(width: 10),
-
-          //Search Icon
-          MyAssetImage(
-            Assets.baseLibBlackBack,
-            width: 16,
-            height: 16,
-            color: DarkThemeUtil.multiColors(null, darkColor: Colors.white),
-          ).onTap(() {
-            String? searchStr = _controller?.text;
-
-            if (widget.onSearch != null) {
-              widget.onSearch!(searchStr!);
-            }
-          }),
-
-          //间距
-          SizedBox(width: 8),
-
           //输入框
-          Expanded(
-            // 权重
-            child: IgnoreKeyboardDismiss(
-              child: TextField(
-                cursorColor: ColorConstants.appBlue,
-                autofocus: widget.autoFocus ?? false,
-                // 是否自动获取焦点
-                focusNode: _focusNode,
-                // 焦点控制
-                controller: _controller,
-                // 与输入框交互控制器
-                //装饰
-                decoration: InputDecoration(
-                  isDense: true,
-                  //清除垂直方向的填充
-                  isCollapsed: true,
-                  //让文字垂直居中
-                  border: InputBorder.none,
-                  hintText: widget.hintText ?? '搜索'.tr,
-                  hintStyle: const TextStyle(
-                    fontSize: 15,
-                    color: const Color(0xff777777),
-                    fontWeight: FontWeight.w500,
-                  ),
-                ),
-                style: TextStyle(
-                  fontSize: 15,
-                  color: DarkThemeUtil.multiColors(Colors.black, darkColor: Colors.white),
-                  fontWeight: FontWeight.w500,
+          IgnoreKeyboardDismiss(
+            child: TextField(
+              cursorColor: ColorConstants.white,
+              cursorWidth: 1.5,
+              autofocus: false,
+              maxLines: 1,
+              minLines: 1,
+              // 是否自动获取焦点
+              focusNode: _focusNode,
+              // 焦点控制
+              controller: _controller,
+              // 与输入框交互控制器
+              //装饰
+              decoration: InputDecoration(
+                isDense: true,
+                //清除垂直方向的填充
+                isCollapsed: true,
+                //让文字垂直居中
+                border: InputBorder.none,
+                hintText: widget.hintText,
+                hintStyle: TextStyle(
+                  color: hexToColor("#AECAE5"),
+                  fontSize: 15.0,
+                  fontWeight: FontWeight.w400,
                 ),
-                // 键盘动作右下角图标
-                textInputAction: TextInputAction.search,
-                textAlignVertical: TextAlignVertical.center,
-                onTap: widget.onTap,
-                // 输入框内容改变回调
-                onChanged: widget.onChanged,
-                onSubmitted: widget.onSearch, //输入框完成触发
               ),
+              style: TextStyle(
+                color: ColorConstants.white,
+                fontSize: 15.0,
+                fontWeight: FontWeight.w400,
+              ),
+              // 键盘动作右下角图标
+              textInputAction: TextInputAction.search,
+              textAlignVertical: TextAlignVertical.center,
+              onSubmitted: (value) {
+                widget.onSearch?.call(value);
+                _unFocus();
+              },
+              //输入框完成触发
+              onChanged: (value) {
+                widget.value = value;
+                widget.onChanged?.call(value);
+              },
             ),
-          ),
-          _suffix(),
+          ).expanded(),
+
+          //搜索图标
+          MyAssetImage(Assets.cptJobSearchIcon, width: 15, height: 15).marginOnly(left: 10).onTap(() {
+            widget.onSearch?.call(_controller?.text ?? "");
+            _unFocus();
+          }),
         ],
       ),
     );