diff --git a/assets/miniapp/mhtControl_1.0.0.zip b/assets/miniapp/mhtControl_1.0.0.zip index 7b2ce61..f214280 100644 Binary files a/assets/miniapp/mhtControl_1.0.0.zip and b/assets/miniapp/mhtControl_1.0.0.zip differ diff --git a/lib/pages/device/BodyDeviceWidget.dart b/lib/pages/device/BodyDeviceWidget.dart index dde45a0..362c2c6 100644 --- a/lib/pages/device/BodyDeviceWidget.dart +++ b/lib/pages/device/BodyDeviceWidget.dart @@ -237,7 +237,7 @@ class _BodyDevicePageState extends State { Widget build(BuildContext context) { return LayoutBuilder( builder: (context, bodysize) => GestureDetector( - onTap: () => FocusScope.of(context).unfocus(), + // onTap: () => FocusScope.of(context).unfocus(),, child: Container( decoration: BoxDecoration( image: DecorationImage( diff --git a/lib/pages/device/component/MessageSetting.dart b/lib/pages/device/component/MessageSetting.dart index 882505a..0eb2bec 100644 --- a/lib/pages/device/component/MessageSetting.dart +++ b/lib/pages/device/component/MessageSetting.dart @@ -169,7 +169,6 @@ class _MessageSettingPageState extends State { print(res); }, ); - } @override @@ -181,7 +180,7 @@ class _MessageSettingPageState extends State { Widget build(BuildContext context) { return LayoutBuilder( builder: (context, bodysize) => GestureDetector( - onTap: () => FocusScope.of(context).unfocus(), + // onTap: () => FocusScope.of(context).unfocus(),, child: Container( decoration: BoxDecoration( image: DecorationImage( diff --git a/lib/pages/device/device_detail.dart b/lib/pages/device/device_detail.dart index 58a42a1..cb13b2a 100644 --- a/lib/pages/device/device_detail.dart +++ b/lib/pages/device/device_detail.dart @@ -35,7 +35,7 @@ class _DeviceDetailPageState extends State { Widget build(BuildContext context) { return LayoutBuilder( builder: (context, bodySize) => GestureDetector( - onTap: () => FocusScope.of(context).unfocus(), + // onTap: () => FocusScope.of(context).unfocus(),, child: Container( decoration: BoxDecoration( image: DecorationImage( diff --git a/lib/pages/device/instant_body_page.dart b/lib/pages/device/instant_body_page.dart index de7657e..de05b55 100644 --- a/lib/pages/device/instant_body_page.dart +++ b/lib/pages/device/instant_body_page.dart @@ -148,7 +148,7 @@ class _InstantBodyPageState extends State return LayoutBuilder( builder: (context, bodySize) => GestureDetector( - onTap: () => FocusScope.of(context).unfocus(), + // onTap: () => FocusScope.of(context).unfocus(),, child: Container( decoration: BoxDecoration( image: DecorationImage( diff --git a/lib/pages/device/message_review_page.dart b/lib/pages/device/message_review_page.dart index a8ace63..f8a3cbb 100644 --- a/lib/pages/device/message_review_page.dart +++ b/lib/pages/device/message_review_page.dart @@ -38,7 +38,7 @@ class _MessageReviewPageState extends State { Widget build(BuildContext context) { return LayoutBuilder( builder: (context, bodysize) => GestureDetector( - onTap: () => FocusScope.of(context).unfocus(), + // onTap: () => FocusScope.of(context).unfocus(),, child: Container( decoration: BoxDecoration( image: DecorationImage( diff --git a/lib/pages/device_bind/after/after_device_calibration_person.dart b/lib/pages/device_bind/after/after_device_calibration_person.dart index 7713fca..89098fe 100644 --- a/lib/pages/device_bind/after/after_device_calibration_person.dart +++ b/lib/pages/device_bind/after/after_device_calibration_person.dart @@ -61,7 +61,7 @@ class _AfterCalibrationPersonPageState return WillPopScope( child: LayoutBuilder( builder: (context, bodySize) => GestureDetector( - onTap: () => FocusScope.of(context).unfocus(), + // onTap: () => FocusScope.of(context).unfocus(),, child: Container( decoration: BoxDecoration( image: DecorationImage( diff --git a/lib/pages/device_bind/after/after_update_person_page.dart b/lib/pages/device_bind/after/after_update_person_page.dart index 30c7e61..35bb45c 100644 --- a/lib/pages/device_bind/after/after_update_person_page.dart +++ b/lib/pages/device_bind/after/after_update_person_page.dart @@ -55,7 +55,7 @@ class _AfterUpdatePersonPageState extends State { Widget build(BuildContext context) { return LayoutBuilder( builder: (context, bodySize) => GestureDetector( - onTap: () => FocusScope.of(context).unfocus(), + // onTap: () => FocusScope.of(context).unfocus(),, child: Container( decoration: BoxDecoration( image: DecorationImage( diff --git a/lib/pages/device_bind/after/after_wifi_page_person.dart b/lib/pages/device_bind/after/after_wifi_page_person.dart index a127709..d9696a4 100644 --- a/lib/pages/device_bind/after/after_wifi_page_person.dart +++ b/lib/pages/device_bind/after/after_wifi_page_person.dart @@ -71,7 +71,7 @@ class _AfterWifiPagePersonState extends State { Widget build(BuildContext context) { return LayoutBuilder( builder: (context, bodySize) => GestureDetector( - onTap: () => FocusScope.of(context).unfocus(), + // onTap: () => FocusScope.of(context).unfocus(),, child: Container( decoration: BoxDecoration( image: DecorationImage( diff --git a/lib/pages/device_bind/bind_device_success.dart b/lib/pages/device_bind/bind_device_success.dart index 74b48f4..5a3db8f 100644 --- a/lib/pages/device_bind/bind_device_success.dart +++ b/lib/pages/device_bind/bind_device_success.dart @@ -37,7 +37,7 @@ class _EPageState extends State { Widget build(BuildContext context) { return LayoutBuilder( builder: (context, bodySize) => GestureDetector( - onTap: () => FocusScope.of(context).unfocus(), + // onTap: () => FocusScope.of(context).unfocus(),, child: Container( decoration: BoxDecoration( image: DecorationImage( diff --git a/lib/pages/device_bind/blueteeth_device_page.dart b/lib/pages/device_bind/blueteeth_device_page.dart index 0dd834f..8ede1b0 100644 --- a/lib/pages/device_bind/blueteeth_device_page.dart +++ b/lib/pages/device_bind/blueteeth_device_page.dart @@ -271,7 +271,7 @@ class _BlueteethDevicePageState extends State { Widget build(BuildContext context) { return LayoutBuilder( builder: (context, boxConstraints) => GestureDetector( - onTap: () => FocusScope.of(context).unfocus(), + // onTap: () => FocusScope.of(context).unfocus(),, child: Container( decoration: BoxDecoration( image: DecorationImage( diff --git a/lib/pages/device_bind/componnet/MessageSetting.dart b/lib/pages/device_bind/componnet/MessageSetting.dart index 6c00700..4b9845d 100644 --- a/lib/pages/device_bind/componnet/MessageSetting.dart +++ b/lib/pages/device_bind/componnet/MessageSetting.dart @@ -43,7 +43,7 @@ class _MessageSettingPageState extends State { requestWithLog( logTitle: "查询用户消息配置", method: MyHttpMethod.get, - queryUrl: queryUrl, + queryUrl: queryUrl, onSuccess: (res) { if (res.data == null || res.data.isEmpty) { var data = { @@ -169,7 +169,6 @@ class _MessageSettingPageState extends State { print(res); }, ); - } @override @@ -181,7 +180,7 @@ class _MessageSettingPageState extends State { Widget build(BuildContext context) { return LayoutBuilder( builder: (context, bodysize) => GestureDetector( - onTap: () => FocusScope.of(context).unfocus(), + // onTap: () => FocusScope.of(context).unfocus(),, child: Container( decoration: BoxDecoration( image: DecorationImage( @@ -442,7 +441,9 @@ class _MessageSettingPageState extends State { ], ), Text( - AppConstants().ent_type == 1? "APP消息介绍".tr:"打开“欢睡科技”APP,可以查看该设备的消息内容", + AppConstants().ent_type == 1 + ? "APP消息介绍".tr + : "打开“欢睡科技”APP,可以查看该设备的消息内容", style: TextStyle( color: themeController.currentColor.sc4, fontSize: AppConstants() @@ -548,7 +549,9 @@ class _MessageSettingPageState extends State { ], ), Text( - AppConstants().ent_type == 1? "服务号消息介绍".tr:"无需打开“欢睡科技”APP,关注欢睡智能睡眠研究所服务号后,微信内即可接收该设备消息推送", + AppConstants().ent_type == 1 + ? "服务号消息介绍".tr + : "无需打开“欢睡科技”APP,关注欢睡智能睡眠研究所服务号后,微信内即可接收该设备消息推送", style: TextStyle( color: themeController.currentColor.sc4, fontSize: AppConstants() diff --git a/lib/pages/device_bind/device_calibration.dart b/lib/pages/device_bind/device_calibration.dart index 38d0f37..0a40f7a 100644 --- a/lib/pages/device_bind/device_calibration.dart +++ b/lib/pages/device_bind/device_calibration.dart @@ -59,7 +59,7 @@ class _CalibrationPageState extends State { return WillPopScope( child: LayoutBuilder( builder: (context, bodySize) => GestureDetector( - onTap: () => FocusScope.of(context).unfocus(), + // onTap: () => FocusScope.of(context).unfocus(),, child: Container( decoration: BoxDecoration( image: DecorationImage( diff --git a/lib/pages/device_bind/device_calibration_copy.dart b/lib/pages/device_bind/device_calibration_copy.dart index 342f41a..050b779 100644 --- a/lib/pages/device_bind/device_calibration_copy.dart +++ b/lib/pages/device_bind/device_calibration_copy.dart @@ -50,7 +50,7 @@ class _CalibrationPageState extends State { return WillPopScope( child: LayoutBuilder( builder: (context, bodySize) => GestureDetector( - onTap: () => FocusScope.of(context).unfocus(), + // onTap: () => FocusScope.of(context).unfocus(),, child: Container( decoration: BoxDecoration( image: DecorationImage( diff --git a/lib/pages/device_bind/device_calibration_person.dart b/lib/pages/device_bind/device_calibration_person.dart index 4f73dea..ffc4c39 100644 --- a/lib/pages/device_bind/device_calibration_person.dart +++ b/lib/pages/device_bind/device_calibration_person.dart @@ -59,7 +59,7 @@ class _CalibrationPersonPageState extends State { return WillPopScope( child: LayoutBuilder( builder: (context, bodySize) => GestureDetector( - onTap: () => FocusScope.of(context).unfocus(), + // onTap: () => FocusScope.of(context).unfocus(),, child: Container( decoration: BoxDecoration( image: DecorationImage( diff --git a/lib/pages/device_bind/device_share_list_page.dart b/lib/pages/device_bind/device_share_list_page.dart index be6a2b3..9d7118b 100644 --- a/lib/pages/device_bind/device_share_list_page.dart +++ b/lib/pages/device_bind/device_share_list_page.dart @@ -46,7 +46,7 @@ class _DeviceShareListPageState extends State { Widget build(BuildContext context) { return LayoutBuilder( builder: (context, boxConstraints) => GestureDetector( - onTap: () => FocusScope.of(context).unfocus(), + // onTap: () => FocusScope.of(context).unfocus(),, child: Container( decoration: BoxDecoration( image: DecorationImage( @@ -175,8 +175,7 @@ class _DeviceShareListPageState extends State { ), errorBorder: OutlineInputBorder( borderSide: BorderSide( - color: - Colors.white, + color: Colors.white, width: 1.rpx, ), borderRadius: @@ -185,8 +184,7 @@ class _DeviceShareListPageState extends State { focusedErrorBorder: OutlineInputBorder( borderSide: BorderSide( - color: - Colors.white, + color: Colors.white, width: 1.rpx, ), borderRadius: diff --git a/lib/pages/device_bind/device_share_page.dart b/lib/pages/device_bind/device_share_page.dart index d99125f..545900e 100644 --- a/lib/pages/device_bind/device_share_page.dart +++ b/lib/pages/device_bind/device_share_page.dart @@ -39,7 +39,7 @@ class _DeviceSharePageState extends State { RxBool flag2 = false.obs; return LayoutBuilder( builder: (context, bodySize) => GestureDetector( - onTap: () => FocusScope.of(context).unfocus(), + // onTap: () => FocusScope.of(context).unfocus(),, child: Container( decoration: BoxDecoration( image: DecorationImage( diff --git a/lib/pages/device_bind/device_type.dart b/lib/pages/device_bind/device_type.dart index 4a48436..862fbae 100644 --- a/lib/pages/device_bind/device_type.dart +++ b/lib/pages/device_bind/device_type.dart @@ -218,8 +218,7 @@ class _EPageState extends State { }, side: BorderSide( width: 1.5, - color: - Colors.white, + color: Colors.white, ), activeColor: stringToColor("#16C89F"), @@ -295,7 +294,7 @@ class _EPageState extends State { } return LayoutBuilder( builder: (context, bodySize) => GestureDetector( - onTap: () => FocusScope.of(context).unfocus(), + // onTap: () => FocusScope.of(context).unfocus(),, child: Container( decoration: BoxDecoration( image: DecorationImage( diff --git a/lib/pages/device_bind/device_type_list.dart b/lib/pages/device_bind/device_type_list.dart index 0de7656..4726c2e 100644 --- a/lib/pages/device_bind/device_type_list.dart +++ b/lib/pages/device_bind/device_type_list.dart @@ -45,7 +45,7 @@ class _DeviceTypeListPageState extends State { Widget build(BuildContext context) { return LayoutBuilder( builder: (context, bodySize) => GestureDetector( - onTap: () => FocusScope.of(context).unfocus(), + // onTap: () => FocusScope.of(context).unfocus(),, child: Container( decoration: BoxDecoration( image: DecorationImage( diff --git a/lib/pages/device_bind/wifi_page.dart b/lib/pages/device_bind/wifi_page.dart index 0030f52..25255d9 100644 --- a/lib/pages/device_bind/wifi_page.dart +++ b/lib/pages/device_bind/wifi_page.dart @@ -130,7 +130,7 @@ class _WifiPageState extends State { print("object"); return LayoutBuilder( builder: (context, bodySize) => GestureDetector( - onTap: () => FocusScope.of(context).unfocus(), + // onTap: () => FocusScope.of(context).unfocus(),, child: Container( decoration: BoxDecoration( image: DecorationImage( @@ -516,7 +516,9 @@ class _WifiPageState extends State { ), filled: false, - fillColor: Colors.white, + fillColor: + Colors + .white, suffixIcon: InkWell( onTap: diff --git a/lib/pages/device_bind/wifi_page_person.dart b/lib/pages/device_bind/wifi_page_person.dart index d2720e3..dd4163d 100644 --- a/lib/pages/device_bind/wifi_page_person.dart +++ b/lib/pages/device_bind/wifi_page_person.dart @@ -71,7 +71,7 @@ class _WifiPagePersonState extends State { Widget build(BuildContext context) { return LayoutBuilder( builder: (context, bodySize) => GestureDetector( - onTap: () => FocusScope.of(context).unfocus(), + // onTap: () => FocusScope.of(context).unfocus(),, child: Container( decoration: BoxDecoration( image: DecorationImage( @@ -459,7 +459,9 @@ class _WifiPagePersonState extends State { ), filled: false, - fillColor: Colors.white, + fillColor: + Colors + .white, suffixIcon: InkWell( onTap: diff --git a/lib/pages/login/login.dart b/lib/pages/login/login.dart index 5e52960..6dfce1e 100644 --- a/lib/pages/login/login.dart +++ b/lib/pages/login/login.dart @@ -87,481 +87,467 @@ class _EPageState extends State { Widget build(BuildContext context) { return LayoutBuilder( builder: (context, bodysize) => GestureDetector( - onTap: () => FocusScope.of(context).unfocus(), + // onTap: () => FocusScope.of(context).unfocus(),, child: Container( - decoration: BoxDecoration( - image: DecorationImage( - image: AssetImage('assets/img/bgImage.png'), // 本地图片 - fit: BoxFit.fill, // 填满整个 Container - ), - ), - child: Scaffold( - resizeToAvoidBottomInset: false, - backgroundColor: Colors.transparent, - body: SafeArea( - top: true, - child: Padding( - padding: - EdgeInsetsDirectional.fromSTEB(75.rpx, 0.rpx, 75.rpx, 0), - child: Column( - mainAxisSize: MainAxisSize.max, - crossAxisAlignment: CrossAxisAlignment.start, + decoration: BoxDecoration( + image: DecorationImage( + image: AssetImage('assets/img/bgImage.png'), // 本地图片 + fit: BoxFit.fill, // 填满整个 Container + ), + ), + child: Scaffold( + resizeToAvoidBottomInset: false, + backgroundColor: Colors.transparent, + body: SafeArea( + top: true, + child: Padding( + padding: EdgeInsetsDirectional.fromSTEB(75.rpx, 0.rpx, 75.rpx, 0), + child: Column( + mainAxisSize: MainAxisSize.max, + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Column( children: [ - Column( + SizedBox( + height: 66.rpx, + ), + ClickableContainer( + backgroundColor: Colors.transparent, // 容器背景色 + highlightColor: + themeController.currentColor.sc21, // 点击时的背景色 + padding: EdgeInsets.zero, // 这里去掉外部的 padding,避免影响点击范围 + onTap: () { + Get.back(); + }, + child: Padding( + padding: EdgeInsetsDirectional.fromSTEB( + 16.rpx, 10.rpx, 16.rpx, 10.rpx), + child: SvgPicture.asset( + 'assets/img/icon/close.svg', + width: 25.rpx, + height: 25.rpx, // 如果 SVG 中没有固定颜色,使用 color 设置 + color: themeController.currentColor.sc3, + ), + ), + ), + ], + ), + Expanded( + child: SingleChildScrollView( + child: Column( + mainAxisSize: MainAxisSize.max, children: [ + Align( + alignment: AlignmentDirectional(-1, 0), + child: Padding( + padding: EdgeInsetsDirectional.fromSTEB( + 0, 141.rpx, 0, 0), + child: Container( + width: double.infinity, + decoration: BoxDecoration(), + child: Align( + alignment: AlignmentDirectional(0, 0), + child: Text( + '登录页.欢迎使用太和e护'.tr, + style: TextStyle( + fontFamily: 'Inter', + fontSize: 48.rpx, + letterSpacing: 0.0, + //todo 颜色 + color: themeController.currentColor.sc3, + ), + ), + ), + ), + ), + ), + Align( + alignment: AlignmentDirectional(-1, 0), + child: Padding( + padding: EdgeInsetsDirectional.fromSTEB( + 0, 15.rpx, 0, 0), + child: Container( + width: double.infinity, + decoration: BoxDecoration(), + child: Align( + alignment: AlignmentDirectional(0, 0), + child: Text( + '登录页.科技睡眠 洞悉万千'.tr, + style: TextStyle( + fontFamily: 'Inter', + fontSize: 30.rpx, + letterSpacing: 0.0, + //todo 颜色 + color: themeController.currentColor.sc3, + ), + ), + ), + ), + ), + ), + Align( + alignment: AlignmentDirectional(-1, 0), + child: Padding( + padding: EdgeInsetsDirectional.fromSTEB( + 0, 95.rpx, 0, 0), + child: Container( + width: double.infinity, + decoration: BoxDecoration(), + child: Align( + alignment: AlignmentDirectional(0, 0), + child: Text( + '139****0733', + style: TextStyle( + fontFamily: 'Inter', + fontSize: 48.rpx, + letterSpacing: 0.0, + //todo 颜色 + color: themeController.currentColor.sc3, + ), + ), + ), + ), + ), + ), + Padding( + padding: + EdgeInsetsDirectional.fromSTEB(0, 35.rpx, 0, 0), + child: CustomCard( + borderRadius: AppConstants() + .button_container_radius, // 圆角半径 + onTap: () { + TopSlideNotification.show(context, + text: "待开发功能".tr); + bool agree = + loginController.model.register_agree!; + if (!agree) { + print('未授权 ...'); + } else { + print('已授权 ...'); + } + }, + colors: [ + //todo 颜色 + themeController.currentColor.sc1, + themeController.currentColor.sc2, + ], // 渐变色是同一个色,也可以根据需要调整 + + child: Container( + width: bodysize.maxWidth, + height: + MediaQuery.sizeOf(context).height * 0.055, + constraints: BoxConstraints( + minWidth: 500.rpx, + minHeight: 90.rpx, + ), + child: Row( + mainAxisSize: MainAxisSize.max, + mainAxisAlignment: MainAxisAlignment.center, + children: [ + Expanded( + child: Text( + textAlign: TextAlign.center, + '登录页.本机号码一键登录/注册'.tr, + style: TextStyle( + //todo 颜色 + color: + themeController.currentColor.sc3, + fontFamily: 'Inter', + fontSize: AppConstants() + .normal_text_fontSize, + letterSpacing: 0.0, + ), + maxLines: 1, + overflow: TextOverflow.ellipsis, + ), + ), + ].divide(SizedBox( + width: 17.rpx, + )), + ), + ), + ), + ), SizedBox( - height: 66.rpx, + height: 20.rpx, ), ClickableContainer( backgroundColor: Colors.transparent, // 容器背景色 highlightColor: themeController.currentColor.sc21, // 点击时的背景色 - padding: - EdgeInsets.zero, // 这里去掉外部的 padding,避免影响点击范围 + padding: EdgeInsetsDirectional.fromSTEB( + 16.rpx, 10.rpx, 16.rpx, 10.rpx), onTap: () { - Get.back(); + print('点击了容器'); + Get.toNamed("/otherLoginPage"); }, - child: Padding( - padding: EdgeInsetsDirectional.fromSTEB( - 16.rpx, 10.rpx, 16.rpx, 10.rpx), - child: SvgPicture.asset( - 'assets/img/icon/close.svg', - width: 25.rpx, - height: 25.rpx, // 如果 SVG 中没有固定颜色,使用 color 设置 + child: Text( + '登录页.其他手机号码'.tr, // 子组件内容 + style: TextStyle( + fontFamily: 'Inter', + fontSize: 26.rpx, color: themeController.currentColor.sc3, ), + maxLines: 1, + overflow: TextOverflow.ellipsis, + ), + ), + Padding( + padding: EdgeInsetsDirectional.fromSTEB( + 25.rpx, 136.rpx, 25.rpx, 50.rpx), + child: Container( + width: double.infinity, + decoration: BoxDecoration(), + child: Row( + mainAxisSize: MainAxisSize.max, + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Theme( + data: ThemeData( + checkboxTheme: CheckboxThemeData( + visualDensity: VisualDensity.compact, + materialTapTargetSize: + MaterialTapTargetSize.shrinkWrap, + shape: RoundedRectangleBorder( + borderRadius: + BorderRadius.circular(64), + ), + ), + unselectedWidgetColor: + Color(0xFFD3D3D3), + ), + child: Obx( + () => Checkbox( + value: loginController + .model.register_agree ?? + false, + onChanged: (newValue) async { + loginController.model + .register_agree = newValue; + loginController.updateAll(); + // 获取设备信息,需要用户点击确认隐私协议与用户协议选择框时才能获取 + // if (newValue == true) { + // Deviceconfig + // .initPlatformState(); + // } + }, + side: BorderSide( + width: 1.5, + color: Colors.white, + ), + activeColor: stringToColor("#FF9F66"), + checkColor: Colors.white, + ), + )), + Expanded( + child: Padding( + padding: EdgeInsetsDirectional.fromSTEB( + 0.rpx, 10.rpx, 0.rpx, 0.rpx), + child: Container( + width: bodysize.maxWidth, + constraints: BoxConstraints( + minWidth: 500.rpx, + minHeight: 90.rpx, + ), + child: RichText( + text: TextSpan( + children: [ + TextSpan( + text: '登录页.协议1'.tr, + style: TextStyle( + fontFamily: 'Inter', + letterSpacing: 0.0, + fontSize: 26.rpx, + color: Colors + .white, // 可以调整为你想要的颜色 + ), + ), + TextSpan( + text: '登录页.协议2'.tr, + style: TextStyle( + fontFamily: 'Inter', + letterSpacing: 0.0, + fontSize: 26.rpx, + color: + stringToColor("#FF9F66"), + ), + ), + TextSpan( + text: '登录页.协议3'.tr, + style: TextStyle( + fontFamily: 'Inter', + letterSpacing: 0.0, + fontSize: 26.rpx, + color: Colors + .white, // 可以调整为你想要的颜色 + ), + ), + TextSpan( + text: '登录页.协议4'.tr, + style: TextStyle( + fontFamily: 'Inter', + letterSpacing: 0.0, + fontSize: 26.rpx, + color: + stringToColor("#FF9F66"), + ), + ), + TextSpan( + text: '登录页.协议5'.tr, + style: TextStyle( + fontFamily: 'Inter', + letterSpacing: 0.0, + fontSize: 26.rpx, + color: Colors + .white, // 可以调整为你想要的颜色 + ), + ), + TextSpan( + text: '登录页.协议6'.tr, + style: TextStyle( + fontFamily: 'Inter', + letterSpacing: 0.0, + fontSize: 26.rpx, + color: + stringToColor("#FF9F66"), + ), + ), + ], + ), + ), + ), + ), + ), + ].divide(SizedBox(width: 18.rpx)), + ), ), ), ], ), - Expanded( - child: SingleChildScrollView( - child: Column( - mainAxisSize: MainAxisSize.max, - children: [ - Align( - alignment: AlignmentDirectional(-1, 0), - child: Padding( - padding: EdgeInsetsDirectional.fromSTEB( - 0, 141.rpx, 0, 0), - child: Container( - width: double.infinity, - decoration: BoxDecoration(), - child: Align( - alignment: AlignmentDirectional(0, 0), - child: Text( - '登录页.欢迎使用太和e护'.tr, - style: TextStyle( - fontFamily: 'Inter', - fontSize: 48.rpx, - letterSpacing: 0.0, - //todo 颜色 - color: - themeController.currentColor.sc3, - ), - ), - ), - ), - ), - ), - Align( - alignment: AlignmentDirectional(-1, 0), - child: Padding( - padding: EdgeInsetsDirectional.fromSTEB( - 0, 15.rpx, 0, 0), - child: Container( - width: double.infinity, - decoration: BoxDecoration(), - child: Align( - alignment: AlignmentDirectional(0, 0), - child: Text( - '登录页.科技睡眠 洞悉万千'.tr, - style: TextStyle( - fontFamily: 'Inter', - fontSize: 30.rpx, - letterSpacing: 0.0, - //todo 颜色 - color: - themeController.currentColor.sc3, - ), - ), - ), - ), - ), - ), - Align( - alignment: AlignmentDirectional(-1, 0), - child: Padding( - padding: EdgeInsetsDirectional.fromSTEB( - 0, 95.rpx, 0, 0), - child: Container( - width: double.infinity, - decoration: BoxDecoration(), - child: Align( - alignment: AlignmentDirectional(0, 0), - child: Text( - '139****0733', - style: TextStyle( - fontFamily: 'Inter', - fontSize: 48.rpx, - letterSpacing: 0.0, - //todo 颜色 - color: - themeController.currentColor.sc3, - ), - ), - ), - ), - ), - ), - Padding( - padding: EdgeInsetsDirectional.fromSTEB( - 0, 35.rpx, 0, 0), - child: CustomCard( - borderRadius: AppConstants() - .button_container_radius, // 圆角半径 - onTap: () { - TopSlideNotification.show(context, - text: "待开发功能".tr); - bool agree = - loginController.model.register_agree!; - if (!agree) { - print('未授权 ...'); - } else { - print('已授权 ...'); - } - }, - colors: [ - //todo 颜色 - themeController.currentColor.sc1, - themeController.currentColor.sc2, - ], // 渐变色是同一个色,也可以根据需要调整 - - child: Container( - width: bodysize.maxWidth, - height: MediaQuery.sizeOf(context).height * - 0.055, - constraints: BoxConstraints( - minWidth: 500.rpx, - minHeight: 90.rpx, - ), - child: Row( - mainAxisSize: MainAxisSize.max, - mainAxisAlignment: - MainAxisAlignment.center, - children: [ - Expanded( - child: Text( - textAlign: TextAlign.center, - '登录页.本机号码一键登录/注册'.tr, - style: TextStyle( - //todo 颜色 - color: themeController - .currentColor.sc3, - fontFamily: 'Inter', - fontSize: AppConstants() - .normal_text_fontSize, - letterSpacing: 0.0, - ), - maxLines: 1, - overflow: TextOverflow.ellipsis, - ), - ), - ].divide(SizedBox( - width: 17.rpx, - )), - ), - ), - ), - ), - SizedBox( - height: 20.rpx, - ), - ClickableContainer( - backgroundColor: Colors.transparent, // 容器背景色 - highlightColor: themeController - .currentColor.sc21, // 点击时的背景色 - padding: EdgeInsetsDirectional.fromSTEB( - 16.rpx, 10.rpx, 16.rpx, 10.rpx), - onTap: () { - print('点击了容器'); - Get.toNamed("/otherLoginPage"); - }, - child: Text( - '登录页.其他手机号码'.tr, // 子组件内容 - style: TextStyle( - fontFamily: 'Inter', - fontSize: 26.rpx, - color: themeController.currentColor.sc3, - ), - maxLines: 1, - overflow: TextOverflow.ellipsis, - ), - ), - Padding( - padding: EdgeInsetsDirectional.fromSTEB( - 25.rpx, 136.rpx, 25.rpx, 50.rpx), - child: Container( - width: double.infinity, - decoration: BoxDecoration(), - child: Row( - mainAxisSize: MainAxisSize.max, - crossAxisAlignment: - CrossAxisAlignment.start, - children: [ - Theme( - data: ThemeData( - checkboxTheme: CheckboxThemeData( - visualDensity: - VisualDensity.compact, - materialTapTargetSize: - MaterialTapTargetSize - .shrinkWrap, - shape: RoundedRectangleBorder( - borderRadius: - BorderRadius.circular(64), - ), - ), - unselectedWidgetColor: - Color(0xFFD3D3D3), - ), - child: Obx( - () => Checkbox( - value: loginController - .model.register_agree ?? - false, - onChanged: (newValue) async { - loginController.model - .register_agree = newValue; - loginController.updateAll(); - // 获取设备信息,需要用户点击确认隐私协议与用户协议选择框时才能获取 - // if (newValue == true) { - // Deviceconfig - // .initPlatformState(); - // } - }, - side: BorderSide( - width: 1.5, - color: Colors.white, - ), - activeColor: - stringToColor("#FF9F66"), - checkColor: - Colors.white, - ), - )), - Expanded( - child: Padding( - padding: - EdgeInsetsDirectional.fromSTEB( - 0.rpx, 10.rpx, 0.rpx, 0.rpx), - child: Container( - width: bodysize.maxWidth, - constraints: BoxConstraints( - minWidth: 500.rpx, - minHeight: 90.rpx, - ), - child: RichText( - text: TextSpan( - children: [ - TextSpan( - text: '登录页.协议1'.tr, - style: TextStyle( - fontFamily: 'Inter', - letterSpacing: 0.0, - fontSize: 26.rpx, - color: Colors - .white, // 可以调整为你想要的颜色 - ), - ), - TextSpan( - text: '登录页.协议2'.tr, - style: TextStyle( - fontFamily: 'Inter', - letterSpacing: 0.0, - fontSize: 26.rpx, - color: stringToColor( - "#FF9F66"), - ), - ), - TextSpan( - text: '登录页.协议3'.tr, - style: TextStyle( - fontFamily: 'Inter', - letterSpacing: 0.0, - fontSize: 26.rpx, - color: Colors - .white, // 可以调整为你想要的颜色 - ), - ), - TextSpan( - text: '登录页.协议4'.tr, - style: TextStyle( - fontFamily: 'Inter', - letterSpacing: 0.0, - fontSize: 26.rpx, - color: stringToColor( - "#FF9F66"), - ), - ), - TextSpan( - text: '登录页.协议5'.tr, - style: TextStyle( - fontFamily: 'Inter', - letterSpacing: 0.0, - fontSize: 26.rpx, - color: Colors - .white, // 可以调整为你想要的颜色 - ), - ), - TextSpan( - text: '登录页.协议6'.tr, - style: TextStyle( - fontFamily: 'Inter', - letterSpacing: 0.0, - fontSize: 26.rpx, - color: stringToColor( - "#FF9F66"), - ), - ), - ], - ), - ), - ), - ), - ), - ].divide(SizedBox(width: 18.rpx)), - ), - ), - ), - ], + ), + ), + Container( + width: double.infinity, + height: MediaQuery.sizeOf(context).height * 0.136, + constraints: BoxConstraints( + minHeight: 220.rpx, + ), + decoration: BoxDecoration(), + child: Column( + mainAxisSize: MainAxisSize.max, + children: [ + Padding( + padding: + EdgeInsetsDirectional.fromSTEB(0, 0, 0, 36.rpx), + child: Text( + '登录页.其他登录方式'.tr, + style: TextStyle( + fontFamily: 'Inter', + fontSize: 26.rpx, + letterSpacing: 0.0, + color: themeController.currentColor.sc3, + ), ), ), - ), - Container( - width: double.infinity, - height: MediaQuery.sizeOf(context).height * 0.136, - constraints: BoxConstraints( - minHeight: 220.rpx, - ), - decoration: BoxDecoration(), - child: Column( + Row( mainAxisSize: MainAxisSize.max, + mainAxisAlignment: MainAxisAlignment.center, children: [ - Padding( - padding: EdgeInsetsDirectional.fromSTEB( - 0, 0, 0, 36.rpx), - child: Text( - '登录页.其他登录方式'.tr, - style: TextStyle( - fontFamily: 'Inter', - fontSize: 26.rpx, - letterSpacing: 0.0, - color: themeController.currentColor.sc3, + ClickableContainer( + backgroundColor: Colors.white, // 背景色 + highlightColor: Colors.grey, // 点击水波纹颜色 + borderRadius: 999.rpx, + padding: EdgeInsets.zero, + // onTap: () { + // TopSlideNotification.show(context, + // text: "待开发功能".tr); + // }, + onTap: () async { + //loginController.model.isIos == true && + if (loginController.model.register_agree == + null || + loginController.model.register_agree != + true) { + TopSlideNotification.show( + context, + text: "登录页.未同意协议".tr, + textColor: themeController.currentColor.sc9, + ); + return; + } + await loginController.wxLoginSendAuth(context); + }, + child: Container( + width: 91.rpx, + height: 91.rpx, + clipBehavior: Clip.antiAlias, + decoration: BoxDecoration( + shape: BoxShape.circle, + ), + child: Image.asset( + "assets/img/wechat.png", + width: 30.rpx, + height: 30.rpx, ), ), ), - Row( - mainAxisSize: MainAxisSize.max, - mainAxisAlignment: MainAxisAlignment.center, - children: [ - ClickableContainer( - backgroundColor: Colors.white, // 背景色 - highlightColor: Colors.grey, // 点击水波纹颜色 - borderRadius: 999.rpx, - padding: EdgeInsets.zero, - // onTap: () { - // TopSlideNotification.show(context, - // text: "待开发功能".tr); - // }, - onTap: () async { - //loginController.model.isIos == true && - if (loginController.model.register_agree == - null || - loginController.model.register_agree != - true) { - TopSlideNotification.show( - context, - text: "登录页.未同意协议".tr, - textColor: - themeController.currentColor.sc9, - ); - return; - } - await loginController - .wxLoginSendAuth(context); - }, - child: Container( - width: 91.rpx, - height: 91.rpx, - clipBehavior: Clip.antiAlias, - decoration: BoxDecoration( - shape: BoxShape.circle, - ), - child: Image.asset( - "assets/img/wechat.png", - width: 30.rpx, - height: 30.rpx, - ), - ), + ClickableContainer( + backgroundColor: Colors.white, + highlightColor: Colors.grey, + borderRadius: 999.rpx, + padding: EdgeInsets.zero, + onTap: () { + TopSlideNotification.show(context, + text: "待开发功能".tr); + }, + child: Container( + width: 91.rpx, + height: 91.rpx, + clipBehavior: Clip.antiAlias, + decoration: BoxDecoration( + shape: BoxShape.circle, ), - ClickableContainer( - backgroundColor: Colors.white, - highlightColor: Colors.grey, - borderRadius: 999.rpx, - padding: EdgeInsets.zero, - onTap: () { - TopSlideNotification.show(context, - text: "待开发功能".tr); - }, - child: Container( - width: 91.rpx, - height: 91.rpx, - clipBehavior: Clip.antiAlias, - decoration: BoxDecoration( - shape: BoxShape.circle, - ), - child: Image.asset( - "assets/img/tel.png", - width: 30.rpx, - height: 30.rpx, - ), - ), + child: Image.asset( + "assets/img/tel.png", + width: 30.rpx, + height: 30.rpx, ), - ClickableContainer( - backgroundColor: Colors.white, - highlightColor: Colors.grey, - borderRadius: 999.rpx, - padding: EdgeInsets.zero, - onTap: () { - TopSlideNotification.show(context, - text: "待开发功能".tr); - }, - child: Container( - width: 91.rpx, - height: 91.rpx, - clipBehavior: Clip.antiAlias, - decoration: BoxDecoration( - shape: BoxShape.circle, - ), - child: Image.asset( - "assets/img/google.png", - width: 30.rpx, - height: 30.rpx, - ), - ), - ), - ].divide(SizedBox(width: 35.rpx)), + ), ), - ], + ClickableContainer( + backgroundColor: Colors.white, + highlightColor: Colors.grey, + borderRadius: 999.rpx, + padding: EdgeInsets.zero, + onTap: () { + TopSlideNotification.show(context, + text: "待开发功能".tr); + }, + child: Container( + width: 91.rpx, + height: 91.rpx, + clipBehavior: Clip.antiAlias, + decoration: BoxDecoration( + shape: BoxShape.circle, + ), + child: Image.asset( + "assets/img/google.png", + width: 30.rpx, + height: 30.rpx, + ), + ), + ), + ].divide(SizedBox(width: 35.rpx)), ), - ), - ], + ], + ), ), - ), + ], ), ), - )), + ), + ), + )), ); } } diff --git a/lib/pages/login/other_login.dart b/lib/pages/login/other_login.dart index 5dfa408..b665561 100644 --- a/lib/pages/login/other_login.dart +++ b/lib/pages/login/other_login.dart @@ -99,823 +99,782 @@ class _OtherLoginPageState extends State { Widget build(BuildContext context) { return LayoutBuilder( builder: (context, bodysize) => GestureDetector( - onTap: () => FocusScope.of(context).unfocus(), + // onTap: () => FocusScope.of(context).unfocus(),, child: Container( - decoration: BoxDecoration( - image: DecorationImage( - image: AssetImage('assets/img/bgImage.png'), // 本地图片 - fit: BoxFit.fill, // 填满整个 Container - ), - ), - child: Scaffold( - resizeToAvoidBottomInset: false, - backgroundColor: Colors.transparent, - body: SafeArea( - top: true, - child: Padding( - padding: - EdgeInsetsDirectional.fromSTEB(75.rpx, 0.rpx, 75.rpx, 0), - child: Column( - mainAxisSize: MainAxisSize.max, - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - SizedBox( - height: 66.rpx, - ), - ClickableContainer( - backgroundColor: Colors.transparent, // 容器背景色 - highlightColor: - themeController.currentColor.sc21, // 点击时的背景色 - padding: EdgeInsets.zero, // 这里去掉外部的 padding,避免影响点击范围 - onTap: () { - Get.back(); - }, - child: Padding( - padding: EdgeInsetsDirectional.fromSTEB( - 0.rpx, 10.rpx, 16.rpx, 10.rpx), - // child: SvgPicture.asset( - // 'assets/img/icon/arrow_left.svg', - // width: 25.rpx, - // height: 25.rpx, // 如果 SVG 中没有固定颜色,使用 color 设置 - // color: themeController.currentColor.sc3, - // ), - child: returnIconButtomNew, - ), - ), - Expanded( - child: SingleChildScrollView( - child: Column( - mainAxisSize: MainAxisSize.max, - children: [ - Align( - alignment: AlignmentDirectional(-1, 0), - child: Padding( - padding: EdgeInsetsDirectional.fromSTEB( - 0, 141.rpx, 0, 0), - child: Container( - width: double.infinity, - decoration: BoxDecoration(), - child: Align( - alignment: AlignmentDirectional(0, 0), - child: Text( - AppConstants().ent_type == 1 - ? '登录页.欢迎使用太和e护'.tr - : "欢迎使用欢睡科技", - style: TextStyle( - fontFamily: 'Inter', - fontSize: 48.rpx, - letterSpacing: 0.0, - color: - themeController.currentColor.sc3, - ), - ), - ), - ), - ), - ), - Align( - alignment: AlignmentDirectional(-1, 0), - child: Padding( - padding: EdgeInsetsDirectional.fromSTEB( - 0, 15.rpx, 0, 0), - child: Container( - width: double.infinity, - decoration: BoxDecoration(), - child: Align( - alignment: AlignmentDirectional(0, 0), - child: Text( - '登录页.科技睡眠 洞悉万千'.tr, - style: TextStyle( - fontFamily: 'Inter', - fontSize: 30.rpx, - letterSpacing: 0.0, - color: - themeController.currentColor.sc3, - ), - ), - ), - ), - ), - ), - Align( - alignment: AlignmentDirectional(-1, 0), - child: Padding( - padding: EdgeInsetsDirectional.fromSTEB( - 0, 95.rpx, 0, 0), - child: Container( - width: double.infinity, - height: bodysize.maxHeight * 0.056, - decoration: BoxDecoration( - color: Colors.transparent, - borderRadius: BorderRadius.circular( - AppConstants() - .button_container_radius), - border: Border.all( - color: themeController.currentColor.sc4 - .withOpacity(0.5), - width: AppConstants().border_width, - ), - ), - constraints: BoxConstraints( - minHeight: 90.rpx, - ), - child: Padding( - padding: EdgeInsetsDirectional.fromSTEB( - 35.rpx, 0, 35.rpx, 0), - child: Row( - mainAxisSize: MainAxisSize.max, - mainAxisAlignment: - MainAxisAlignment.spaceBetween, - children: [ - Expanded( - child: Container( - child: Align( - alignment: - AlignmentDirectional(-1, 0), - child: TextFormField( - onChanged: (value) { - loginController - .model.phone = value; - }, - autofocus: false, - obscureText: false, - decoration: InputDecoration( - isDense: true, - labelStyle: TextStyle( - fontFamily: 'Inter', - fontSize: 26.rpx, - letterSpacing: 0.0, - ), - hintText: '其他手机登录页.输入内容'.tr, - hintStyle: TextStyle( - fontFamily: 'Inter', - fontSize: 26.rpx, - letterSpacing: 0.0, - color: themeController - .currentColor.sc4, - ), - enabledBorder: - OutlineInputBorder( - borderSide: BorderSide( - color: - Color(0x00000000), - width: 1.rpx, - ), - borderRadius: - BorderRadius.circular( - 8.rpx), - ), - focusedBorder: - OutlineInputBorder( - borderSide: BorderSide( - color: - Color(0x00000000), - width: 1.rpx, - ), - borderRadius: - BorderRadius.circular( - 8.rpx), - ), - errorBorder: - OutlineInputBorder( - borderSide: BorderSide( - color: Colors.red, - width: 1.rpx, - ), - borderRadius: - BorderRadius.circular( - 8.rpx), - ), - focusedErrorBorder: - OutlineInputBorder( - borderSide: BorderSide( - color: Colors.red, - width: 1.rpx, - ), - borderRadius: - BorderRadius.circular( - 8.rpx), - ), - filled: false, - fillColor: Colors.white, - ), - style: TextStyle( - fontFamily: 'Inter', - fontSize: 26.rpx, - letterSpacing: 0.0, - color: themeController - .currentColor.sc3, - ), - cursorColor: themeController - .currentColor.sc3, - // validator: _model - // .textControllerValidator - // .asValidator(context), - ), - ), - ), - ), - ], - ), - ), - ), - ), - ), - Align( - alignment: AlignmentDirectional(-1, 0), - child: Padding( - padding: EdgeInsetsDirectional.fromSTEB( - 0, 26.rpx, 0, 0), - child: Container( - height: bodysize.maxHeight * 0.056, - width: double.infinity, - decoration: BoxDecoration( - color: Colors.transparent, - borderRadius: BorderRadius.circular( - AppConstants() - .button_container_radius), - border: Border.all( - color: themeController.currentColor.sc4 - .withOpacity(0.5), - width: AppConstants().border_width, - ), - ), - constraints: BoxConstraints( - minHeight: 90.rpx, - ), - child: Padding( - padding: EdgeInsetsDirectional.fromSTEB( - 35.rpx, 0, 35.rpx, 0), - child: Row( - mainAxisSize: MainAxisSize.max, - mainAxisAlignment: - MainAxisAlignment.spaceBetween, - children: [ - Expanded( - child: Container( - child: Align( - alignment: - AlignmentDirectional(-1, 0), - child: TextFormField( - onChanged: (value) { - loginController.model.code = - value; - }, - autofocus: false, - obscureText: false, - decoration: InputDecoration( - isDense: true, - labelStyle: TextStyle( - fontFamily: 'Inter', - fontSize: 26.rpx, - letterSpacing: 0.0, - ), - hintText: - '其他手机登录页.输入验证码'.tr, - hintStyle: TextStyle( - fontFamily: 'Inter', - fontSize: 26.rpx, - letterSpacing: 0.0, - color: themeController - .currentColor.sc4, - ), - enabledBorder: - OutlineInputBorder( - borderSide: BorderSide( - color: - Color(0x00000000), - width: 1.rpx, - ), - borderRadius: - BorderRadius.circular( - 8.rpx), - ), - focusedBorder: - OutlineInputBorder( - borderSide: BorderSide( - color: - Color(0x00000000), - width: 1.rpx, - ), - borderRadius: - BorderRadius.circular( - 8.rpx), - ), - errorBorder: - OutlineInputBorder( - borderSide: BorderSide( - color: Colors.red, - width: 1.rpx, - ), - borderRadius: - BorderRadius.circular( - 8.rpx), - ), - focusedErrorBorder: - OutlineInputBorder( - borderSide: BorderSide( - color: Colors.red, - width: 1.rpx, - ), - borderRadius: - BorderRadius.circular( - 8.rpx), - ), - filled: true, - fillColor: - Colors.transparent, - ), - style: TextStyle( - fontFamily: 'Inter', - fontSize: 26.rpx, - letterSpacing: 0.0, - color: themeController - .currentColor.sc3, - ), - cursorColor: themeController - .currentColor.sc3, - // validator: _model - // .textControllerValidator - // .asValidator(context), - ), - ), - ), - ), - Padding( - padding: - EdgeInsetsDirectional.fromSTEB( - 26.rpx, 0, 0, 0), - child: Row( - mainAxisSize: MainAxisSize.max, - children: [ - SizedBox( - height: 30.rpx, - child: VerticalDivider( - thickness: 2.rpx, - color: themeController - .currentColor.sc7, - ), - ), - Obx(() { - final CountdownController - countdownController = - Get.find< - CountdownController>(); - return InkWell( - onTap: () async { - try { - DailyLogUtils.writeLog( - "点击获取验证码"); - if (countdownController - .countdown - .value != - 0) { - return; - } - ApiResponse - apiResponse = - await loginController - .getCode( - context); - if (apiResponse.code != - HttpStatusCodes - .ok) { - TopSlideNotification - .show( - context, - text: apiResponse - .msg!, - textColor: - themeController - .currentColor - .sc9, - ); - await DailyLogUtils - .writeLog( - "获取验证码成功,${apiResponse}"); - return; - } else { - TopSlideNotification - .show( - context, - text: apiResponse - .msg!, - textColor: - themeController - .currentColor - .sc2, - ); - await DailyLogUtils - .writeLog( - "获取验证码失败,${apiResponse}"); - } - countdownController - .countdown - .value == - 0 - ? countdownController - .startCountdown( - AppConstants - .code_time) - : null; - } catch (e) { - await DailyLogUtils - .writeLog( - "获取验证码异常,${e}"); - edm.EasyDartModule - .logger - .info( - "获取验证码异常:${e}"); - } - }, - child: Container( - alignment: - Alignment.center, - constraints: - BoxConstraints( - minWidth: 150.rpx, - ), - child: Text( - countdownController - .countdown - .value == - 0 - ? '其他手机登录页.获取验证码'.tr - : '${countdownController.countdown.value}' + - "其他手机登录页.秒".tr, - style: TextStyle( - fontFamily: - 'Readex Pro', - color: themeController - .currentColor.sc2, - fontSize: AppConstants() - .title_text_fontSize, - letterSpacing: 0, - ), - ), - ), - ); - }), - ].divide(SizedBox(width: 26.rpx)), - ), - ), - ], - ), - ), - ), - ), - ), - Padding( - padding: EdgeInsetsDirectional.fromSTEB( - 0, 26.rpx, 0, 0), - child: CustomCard( - borderRadius: AppConstants() - .button_container_radius, // 圆角半径 - onTap: () async { - try { - DailyLogUtils.writeLog("点击登录"); - bool agree = - loginController.model.register_agree!; - if (!agree) { - TopSlideNotification.show( - context, - text: "登录页.未同意协议".tr, - textColor: - themeController.currentColor.sc9, - ); - } else { - ApiResponse apiResponse = - await loginController - .login(context); - if (apiResponse.code != - HttpStatusCodes.ok) { - TopSlideNotification.show( - context, - text: apiResponse.msg!, - textColor: themeController - .currentColor.sc9, - ); - } else { - // await dealBindProcess(); - CountdownController - countdownController = Get.find(); - countdownController.countdown.value = - 0; - // 登录成功,跳转到主页面 - TopSlideNotification.show( - context, - text: "其他手机登录页.登录成功".tr, - textColor: themeController - .currentColor.sc2, - ); - // Get.offAllNamed('/homePage'); - Get.offAllNamed( - "/mianPageBottomChange"); - } - } - } catch (e) { - await DailyLogUtils.writeLog("登录失败,${e}"); - edm.EasyDartModule.logger - .info("登录失败:${e}"); - } - }, - colors: [ - themeController.currentColor.sc1, - themeController.currentColor.sc2, - ], - - child: Container( - width: bodysize.maxWidth, - height: MediaQuery.sizeOf(context).height * - 0.055, - constraints: BoxConstraints( - minWidth: 500.rpx, - minHeight: 90.rpx, - ), - child: Row( - mainAxisSize: MainAxisSize.max, - mainAxisAlignment: - MainAxisAlignment.center, - children: [ - Text( - '其他手机登录页.登录'.tr, - style: TextStyle( - color: themeController - .currentColor.sc3, - fontFamily: 'Inter', - fontSize: AppConstants() - .normal_text_fontSize, - letterSpacing: 0.0, - ), - ), - ].divide(SizedBox( - width: 17.rpx, - )), - ), - ), - ), - ), - Padding( - padding: EdgeInsetsDirectional.fromSTEB( - 25.rpx, 42.rpx, 25.rpx, 50.rpx), - child: Container( - width: double.infinity, - decoration: BoxDecoration(), - child: Row( - mainAxisSize: MainAxisSize.max, - crossAxisAlignment: - CrossAxisAlignment.start, - children: [ - Theme( - data: ThemeData( - checkboxTheme: CheckboxThemeData( - visualDensity: - VisualDensity.compact, - materialTapTargetSize: - MaterialTapTargetSize - .shrinkWrap, - shape: RoundedRectangleBorder( - borderRadius: - BorderRadius.circular(64), - ), - ), - unselectedWidgetColor: - Color(0xFFD3D3D3), - ), - child: Obx( - () => Checkbox( - value: loginController - .model.register_agree ?? - false, - onChanged: (newValue) async { - loginController.model - .register_agree = newValue; - loginController.updateAll(); - // 获取设备信息,需要用户点击确认隐私协议与用户协议选择框时才能获取 - // if (newValue == true) { - // Deviceconfig - // .initPlatformState(); - // } - }, - side: BorderSide( - width: 1.5, - color: Colors.white, - ), - activeColor: - stringToColor("#FF9F66"), //固定 - checkColor: Colors.white, - ), - )), - Expanded( - child: Padding( - padding: - EdgeInsetsDirectional.fromSTEB( - 0.rpx, 10.rpx, 0.rpx, 0.rpx), - child: Container( - width: bodysize.maxWidth, - constraints: BoxConstraints( - minWidth: 500.rpx, - minHeight: 90.rpx, - ), - child: RichText( - text: TextSpan( - children: [ - TextSpan( - text: '登录页.协议1'.tr, - style: TextStyle( - fontFamily: 'Inter', - letterSpacing: 0.0, - fontSize: 20.rpx, - color: themeController - .currentColor.sc3, - ), - ), - TextSpan( - text: '登录页.协议2'.tr, - style: TextStyle( - fontFamily: 'Inter', - letterSpacing: 0.0, - fontSize: 20.rpx, - color: stringToColor( - "#FF9F66"), - ), - ), - TextSpan( - text: '登录页.协议3'.tr, - style: TextStyle( - fontFamily: 'Inter', - letterSpacing: 0.0, - fontSize: 20.rpx, - color: themeController - .currentColor.sc3, - ), - ), - TextSpan( - text: '登录页.协议4'.tr, - style: TextStyle( - fontFamily: 'Inter', - letterSpacing: 0.0, - fontSize: 20.rpx, - color: stringToColor( - "#FF9F66"), - ), - ), - TextSpan( - text: '登录页.协议5'.tr, - style: TextStyle( - fontFamily: 'Inter', - letterSpacing: 0.0, - fontSize: 20.rpx, - color: themeController - .currentColor.sc3, - ), - ), - TextSpan( - text: '登录页.协议6'.tr, - style: TextStyle( - fontFamily: 'Inter', - letterSpacing: 0.0, - fontSize: 20.rpx, - color: stringToColor( - "#FF9F66"), - ), - ), - ], - ), - ), - ), - ), - ), - ].divide(SizedBox(width: 18.rpx)), - ), - ), - ), - ], - ), - ), - ), - Container( - width: double.infinity, - height: MediaQuery.sizeOf(context).height * 0.136, - constraints: BoxConstraints( - minHeight: 220.rpx, - ), - decoration: BoxDecoration(), - child: Column( - mainAxisSize: MainAxisSize.max, - children: [ - Padding( + decoration: BoxDecoration( + image: DecorationImage( + image: AssetImage('assets/img/bgImage.png'), // 本地图片 + fit: BoxFit.fill, // 填满整个 Container + ), + ), + child: Scaffold( + resizeToAvoidBottomInset: false, + backgroundColor: Colors.transparent, + body: SafeArea( + top: true, + child: Padding( + padding: EdgeInsetsDirectional.fromSTEB(75.rpx, 0.rpx, 75.rpx, 0), + child: Column( + mainAxisSize: MainAxisSize.max, + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + SizedBox( + height: 66.rpx, + ), + ClickableContainer( + backgroundColor: Colors.transparent, // 容器背景色 + highlightColor: + themeController.currentColor.sc21, // 点击时的背景色 + padding: EdgeInsets.zero, // 这里去掉外部的 padding,避免影响点击范围 + onTap: () { + Get.back(); + }, + child: Padding( + padding: EdgeInsetsDirectional.fromSTEB( + 0.rpx, 10.rpx, 16.rpx, 10.rpx), + // child: SvgPicture.asset( + // 'assets/img/icon/arrow_left.svg', + // width: 25.rpx, + // height: 25.rpx, // 如果 SVG 中没有固定颜色,使用 color 设置 + // color: themeController.currentColor.sc3, + // ), + child: returnIconButtomNew, + ), + ), + Expanded( + child: SingleChildScrollView( + child: Column( + mainAxisSize: MainAxisSize.max, + children: [ + Align( + alignment: AlignmentDirectional(-1, 0), + child: Padding( padding: EdgeInsetsDirectional.fromSTEB( - 0, 0, 0, 36.rpx), - child: Text( - AppConstants().ent_type == 1 - ? '登录页.欢迎使用太和e护'.tr - : "欢迎使用欢睡科技", - style: TextStyle( - fontFamily: 'Inter', - fontSize: 26.rpx, - letterSpacing: 0.0, - color: themeController.currentColor.sc3, + 0, 141.rpx, 0, 0), + child: Container( + width: double.infinity, + decoration: BoxDecoration(), + child: Align( + alignment: AlignmentDirectional(0, 0), + child: Text( + AppConstants().ent_type == 1 + ? '登录页.欢迎使用太和e护'.tr + : "欢迎使用欢睡科技", + style: TextStyle( + fontFamily: 'Inter', + fontSize: 48.rpx, + letterSpacing: 0.0, + color: themeController.currentColor.sc3, + ), + ), ), ), ), - Row( - mainAxisSize: MainAxisSize.max, - mainAxisAlignment: MainAxisAlignment.center, - children: [ - ClickableContainer( - backgroundColor: Colors.white, // 背景色 - highlightColor: Colors.grey, // 点击水波纹颜色 - borderRadius: 999.rpx, - padding: EdgeInsets.zero, - onTap: () async { - //loginController.model.isIos == true && - if (loginController.model.register_agree == - null || - loginController.model.register_agree != - true) { + ), + Align( + alignment: AlignmentDirectional(-1, 0), + child: Padding( + padding: EdgeInsetsDirectional.fromSTEB( + 0, 15.rpx, 0, 0), + child: Container( + width: double.infinity, + decoration: BoxDecoration(), + child: Align( + alignment: AlignmentDirectional(0, 0), + child: Text( + '登录页.科技睡眠 洞悉万千'.tr, + style: TextStyle( + fontFamily: 'Inter', + fontSize: 30.rpx, + letterSpacing: 0.0, + color: themeController.currentColor.sc3, + ), + ), + ), + ), + ), + ), + Align( + alignment: AlignmentDirectional(-1, 0), + child: Padding( + padding: EdgeInsetsDirectional.fromSTEB( + 0, 95.rpx, 0, 0), + child: Container( + width: double.infinity, + height: bodysize.maxHeight * 0.056, + decoration: BoxDecoration( + color: Colors.transparent, + borderRadius: BorderRadius.circular( + AppConstants().button_container_radius), + border: Border.all( + color: themeController.currentColor.sc4 + .withOpacity(0.5), + width: AppConstants().border_width, + ), + ), + constraints: BoxConstraints( + minHeight: 90.rpx, + ), + child: Padding( + padding: EdgeInsetsDirectional.fromSTEB( + 35.rpx, 0, 35.rpx, 0), + child: Row( + mainAxisSize: MainAxisSize.max, + mainAxisAlignment: + MainAxisAlignment.spaceBetween, + children: [ + Expanded( + child: Container( + child: Align( + alignment: + AlignmentDirectional(-1, 0), + child: TextFormField( + onChanged: (value) { + loginController.model.phone = + value; + }, + autofocus: false, + obscureText: false, + decoration: InputDecoration( + isDense: true, + labelStyle: TextStyle( + fontFamily: 'Inter', + fontSize: 26.rpx, + letterSpacing: 0.0, + ), + hintText: '其他手机登录页.输入内容'.tr, + hintStyle: TextStyle( + fontFamily: 'Inter', + fontSize: 26.rpx, + letterSpacing: 0.0, + color: themeController + .currentColor.sc4, + ), + enabledBorder: + OutlineInputBorder( + borderSide: BorderSide( + color: Color(0x00000000), + width: 1.rpx, + ), + borderRadius: + BorderRadius.circular( + 8.rpx), + ), + focusedBorder: + OutlineInputBorder( + borderSide: BorderSide( + color: Color(0x00000000), + width: 1.rpx, + ), + borderRadius: + BorderRadius.circular( + 8.rpx), + ), + errorBorder: OutlineInputBorder( + borderSide: BorderSide( + color: Colors.red, + width: 1.rpx, + ), + borderRadius: + BorderRadius.circular( + 8.rpx), + ), + focusedErrorBorder: + OutlineInputBorder( + borderSide: BorderSide( + color: Colors.red, + width: 1.rpx, + ), + borderRadius: + BorderRadius.circular( + 8.rpx), + ), + filled: false, + fillColor: Colors.white, + ), + style: TextStyle( + fontFamily: 'Inter', + fontSize: 26.rpx, + letterSpacing: 0.0, + color: themeController + .currentColor.sc3, + ), + cursorColor: themeController + .currentColor.sc3, + // validator: _model + // .textControllerValidator + // .asValidator(context), + ), + ), + ), + ), + ], + ), + ), + ), + ), + ), + Align( + alignment: AlignmentDirectional(-1, 0), + child: Padding( + padding: EdgeInsetsDirectional.fromSTEB( + 0, 26.rpx, 0, 0), + child: Container( + height: bodysize.maxHeight * 0.056, + width: double.infinity, + decoration: BoxDecoration( + color: Colors.transparent, + borderRadius: BorderRadius.circular( + AppConstants().button_container_radius), + border: Border.all( + color: themeController.currentColor.sc4 + .withOpacity(0.5), + width: AppConstants().border_width, + ), + ), + constraints: BoxConstraints( + minHeight: 90.rpx, + ), + child: Padding( + padding: EdgeInsetsDirectional.fromSTEB( + 35.rpx, 0, 35.rpx, 0), + child: Row( + mainAxisSize: MainAxisSize.max, + mainAxisAlignment: + MainAxisAlignment.spaceBetween, + children: [ + Expanded( + child: Container( + child: Align( + alignment: + AlignmentDirectional(-1, 0), + child: TextFormField( + onChanged: (value) { + loginController.model.code = + value; + }, + autofocus: false, + obscureText: false, + decoration: InputDecoration( + isDense: true, + labelStyle: TextStyle( + fontFamily: 'Inter', + fontSize: 26.rpx, + letterSpacing: 0.0, + ), + hintText: '其他手机登录页.输入验证码'.tr, + hintStyle: TextStyle( + fontFamily: 'Inter', + fontSize: 26.rpx, + letterSpacing: 0.0, + color: themeController + .currentColor.sc4, + ), + enabledBorder: + OutlineInputBorder( + borderSide: BorderSide( + color: Color(0x00000000), + width: 1.rpx, + ), + borderRadius: + BorderRadius.circular( + 8.rpx), + ), + focusedBorder: + OutlineInputBorder( + borderSide: BorderSide( + color: Color(0x00000000), + width: 1.rpx, + ), + borderRadius: + BorderRadius.circular( + 8.rpx), + ), + errorBorder: OutlineInputBorder( + borderSide: BorderSide( + color: Colors.red, + width: 1.rpx, + ), + borderRadius: + BorderRadius.circular( + 8.rpx), + ), + focusedErrorBorder: + OutlineInputBorder( + borderSide: BorderSide( + color: Colors.red, + width: 1.rpx, + ), + borderRadius: + BorderRadius.circular( + 8.rpx), + ), + filled: true, + fillColor: Colors.transparent, + ), + style: TextStyle( + fontFamily: 'Inter', + fontSize: 26.rpx, + letterSpacing: 0.0, + color: themeController + .currentColor.sc3, + ), + cursorColor: themeController + .currentColor.sc3, + // validator: _model + // .textControllerValidator + // .asValidator(context), + ), + ), + ), + ), + Padding( + padding: EdgeInsetsDirectional.fromSTEB( + 26.rpx, 0, 0, 0), + child: Row( + mainAxisSize: MainAxisSize.max, + children: [ + SizedBox( + height: 30.rpx, + child: VerticalDivider( + thickness: 2.rpx, + color: themeController + .currentColor.sc7, + ), + ), + Obx(() { + final CountdownController + countdownController = + Get.find< + CountdownController>(); + return InkWell( + onTap: () async { + try { + DailyLogUtils.writeLog( + "点击获取验证码"); + if (countdownController + .countdown.value != + 0) { + return; + } + ApiResponse apiResponse = + await loginController + .getCode(context); + if (apiResponse.code != + HttpStatusCodes.ok) { + TopSlideNotification.show( + context, + text: apiResponse.msg!, + textColor: + themeController + .currentColor + .sc9, + ); + await DailyLogUtils.writeLog( + "获取验证码成功,${apiResponse}"); + return; + } else { + TopSlideNotification.show( + context, + text: apiResponse.msg!, + textColor: + themeController + .currentColor + .sc2, + ); + await DailyLogUtils.writeLog( + "获取验证码失败,${apiResponse}"); + } + countdownController + .countdown + .value == + 0 + ? countdownController + .startCountdown( + AppConstants + .code_time) + : null; + } catch (e) { + await DailyLogUtils + .writeLog( + "获取验证码异常,${e}"); + edm.EasyDartModule.logger + .info("获取验证码异常:${e}"); + } + }, + child: Container( + alignment: Alignment.center, + constraints: BoxConstraints( + minWidth: 150.rpx, + ), + child: Text( + countdownController + .countdown + .value == + 0 + ? '其他手机登录页.获取验证码'.tr + : '${countdownController.countdown.value}' + + "其他手机登录页.秒".tr, + style: TextStyle( + fontFamily: 'Readex Pro', + color: themeController + .currentColor.sc2, + fontSize: AppConstants() + .title_text_fontSize, + letterSpacing: 0, + ), + ), + ), + ); + }), + ].divide(SizedBox(width: 26.rpx)), + ), + ), + ], + ), + ), + ), + ), + ), + Padding( + padding: + EdgeInsetsDirectional.fromSTEB(0, 26.rpx, 0, 0), + child: CustomCard( + borderRadius: AppConstants() + .button_container_radius, // 圆角半径 + onTap: () async { + try { + DailyLogUtils.writeLog("点击登录"); + bool agree = + loginController.model.register_agree!; + if (!agree) { + TopSlideNotification.show( + context, + text: "登录页.未同意协议".tr, + textColor: + themeController.currentColor.sc9, + ); + } else { + ApiResponse apiResponse = + await loginController.login(context); + if (apiResponse.code != + HttpStatusCodes.ok) { TopSlideNotification.show( context, - text: "登录页.未同意协议".tr, + text: apiResponse.msg!, textColor: themeController.currentColor.sc9, ); - return; + } else { + // await dealBindProcess(); + CountdownController countdownController = + Get.find(); + countdownController.countdown.value = 0; + // 登录成功,跳转到主页面 + TopSlideNotification.show( + context, + text: "其他手机登录页.登录成功".tr, + textColor: + themeController.currentColor.sc2, + ); + // Get.offAllNamed('/homePage'); + Get.offAllNamed("/mianPageBottomChange"); } - await loginController - .wxLoginSendAuth(context); - }, - child: Container( - width: 91.rpx, - height: 91.rpx, - clipBehavior: Clip.antiAlias, - decoration: BoxDecoration( - shape: BoxShape.circle, - ), - child: Image.asset( - "assets/img/wechat.png", - width: 30.rpx, - height: 30.rpx, - ), - ), + } + } catch (e) { + await DailyLogUtils.writeLog("登录失败,${e}"); + edm.EasyDartModule.logger.info("登录失败:${e}"); + } + }, + colors: [ + themeController.currentColor.sc1, + themeController.currentColor.sc2, + ], + + child: Container( + width: bodysize.maxWidth, + height: + MediaQuery.sizeOf(context).height * 0.055, + constraints: BoxConstraints( + minWidth: 500.rpx, + minHeight: 90.rpx, ), - ClickableContainer( - backgroundColor: Colors.white, - highlightColor: Colors.grey, - borderRadius: 999.rpx, - padding: EdgeInsets.zero, - onTap: () { - TopSlideNotification.show(context, - text: "待开发功能".tr); - }, - child: Container( - width: 91.rpx, - height: 91.rpx, - clipBehavior: Clip.antiAlias, - decoration: BoxDecoration( - shape: BoxShape.circle, + child: Row( + mainAxisSize: MainAxisSize.max, + mainAxisAlignment: MainAxisAlignment.center, + children: [ + Text( + '其他手机登录页.登录'.tr, + style: TextStyle( + color: themeController.currentColor.sc3, + fontFamily: 'Inter', + fontSize: + AppConstants().normal_text_fontSize, + letterSpacing: 0.0, + ), ), - child: Image.asset( - "assets/img/tel.png", - width: 30.rpx, - height: 30.rpx, - ), - ), + ].divide(SizedBox( + width: 17.rpx, + )), ), - ClickableContainer( - backgroundColor: Colors.white, - highlightColor: Colors.grey, - borderRadius: 999.rpx, - padding: EdgeInsets.zero, - onTap: () { - TopSlideNotification.show(context, - text: "待开发功能".tr); - }, - child: Container( - width: 91.rpx, - height: 91.rpx, - clipBehavior: Clip.antiAlias, - decoration: BoxDecoration( - shape: BoxShape.circle, - ), - child: Image.asset( - "assets/img/google.png", - width: 30.rpx, - height: 30.rpx, - ), - ), - ), - ].divide(SizedBox(width: 35.rpx)), + ), ), - ], - ), + ), + Padding( + padding: EdgeInsetsDirectional.fromSTEB( + 25.rpx, 42.rpx, 25.rpx, 50.rpx), + child: Container( + width: double.infinity, + decoration: BoxDecoration(), + child: Row( + mainAxisSize: MainAxisSize.max, + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Theme( + data: ThemeData( + checkboxTheme: CheckboxThemeData( + visualDensity: VisualDensity.compact, + materialTapTargetSize: + MaterialTapTargetSize.shrinkWrap, + shape: RoundedRectangleBorder( + borderRadius: + BorderRadius.circular(64), + ), + ), + unselectedWidgetColor: + Color(0xFFD3D3D3), + ), + child: Obx( + () => Checkbox( + value: loginController + .model.register_agree ?? + false, + onChanged: (newValue) async { + loginController.model + .register_agree = newValue; + loginController.updateAll(); + // 获取设备信息,需要用户点击确认隐私协议与用户协议选择框时才能获取 + // if (newValue == true) { + // Deviceconfig + // .initPlatformState(); + // } + }, + side: BorderSide( + width: 1.5, + color: Colors.white, + ), + activeColor: + stringToColor("#FF9F66"), //固定 + checkColor: Colors.white, + ), + )), + Expanded( + child: Padding( + padding: EdgeInsetsDirectional.fromSTEB( + 0.rpx, 10.rpx, 0.rpx, 0.rpx), + child: Container( + width: bodysize.maxWidth, + constraints: BoxConstraints( + minWidth: 500.rpx, + minHeight: 90.rpx, + ), + child: RichText( + text: TextSpan( + children: [ + TextSpan( + text: '登录页.协议1'.tr, + style: TextStyle( + fontFamily: 'Inter', + letterSpacing: 0.0, + fontSize: 20.rpx, + color: themeController + .currentColor.sc3, + ), + ), + TextSpan( + text: '登录页.协议2'.tr, + style: TextStyle( + fontFamily: 'Inter', + letterSpacing: 0.0, + fontSize: 20.rpx, + color: + stringToColor("#FF9F66"), + ), + ), + TextSpan( + text: '登录页.协议3'.tr, + style: TextStyle( + fontFamily: 'Inter', + letterSpacing: 0.0, + fontSize: 20.rpx, + color: themeController + .currentColor.sc3, + ), + ), + TextSpan( + text: '登录页.协议4'.tr, + style: TextStyle( + fontFamily: 'Inter', + letterSpacing: 0.0, + fontSize: 20.rpx, + color: + stringToColor("#FF9F66"), + ), + ), + TextSpan( + text: '登录页.协议5'.tr, + style: TextStyle( + fontFamily: 'Inter', + letterSpacing: 0.0, + fontSize: 20.rpx, + color: themeController + .currentColor.sc3, + ), + ), + TextSpan( + text: '登录页.协议6'.tr, + style: TextStyle( + fontFamily: 'Inter', + letterSpacing: 0.0, + fontSize: 20.rpx, + color: + stringToColor("#FF9F66"), + ), + ), + ], + ), + ), + ), + ), + ), + ].divide(SizedBox(width: 18.rpx)), + ), + ), + ), + ], ), - ], + ), ), - ), + Container( + width: double.infinity, + height: MediaQuery.sizeOf(context).height * 0.136, + constraints: BoxConstraints( + minHeight: 220.rpx, + ), + decoration: BoxDecoration(), + child: Column( + mainAxisSize: MainAxisSize.max, + children: [ + Padding( + padding: + EdgeInsetsDirectional.fromSTEB(0, 0, 0, 36.rpx), + child: Text( + AppConstants().ent_type == 1 + ? '登录页.欢迎使用太和e护'.tr + : "欢迎使用欢睡科技", + style: TextStyle( + fontFamily: 'Inter', + fontSize: 26.rpx, + letterSpacing: 0.0, + color: themeController.currentColor.sc3, + ), + ), + ), + Row( + mainAxisSize: MainAxisSize.max, + mainAxisAlignment: MainAxisAlignment.center, + children: [ + ClickableContainer( + backgroundColor: Colors.white, // 背景色 + highlightColor: Colors.grey, // 点击水波纹颜色 + borderRadius: 999.rpx, + padding: EdgeInsets.zero, + onTap: () async { + //loginController.model.isIos == true && + if (loginController.model.register_agree == + null || + loginController.model.register_agree != + true) { + TopSlideNotification.show( + context, + text: "登录页.未同意协议".tr, + textColor: themeController.currentColor.sc9, + ); + return; + } + await loginController.wxLoginSendAuth(context); + }, + child: Container( + width: 91.rpx, + height: 91.rpx, + clipBehavior: Clip.antiAlias, + decoration: BoxDecoration( + shape: BoxShape.circle, + ), + child: Image.asset( + "assets/img/wechat.png", + width: 30.rpx, + height: 30.rpx, + ), + ), + ), + ClickableContainer( + backgroundColor: Colors.white, + highlightColor: Colors.grey, + borderRadius: 999.rpx, + padding: EdgeInsets.zero, + onTap: () { + TopSlideNotification.show(context, + text: "待开发功能".tr); + }, + child: Container( + width: 91.rpx, + height: 91.rpx, + clipBehavior: Clip.antiAlias, + decoration: BoxDecoration( + shape: BoxShape.circle, + ), + child: Image.asset( + "assets/img/tel.png", + width: 30.rpx, + height: 30.rpx, + ), + ), + ), + ClickableContainer( + backgroundColor: Colors.white, + highlightColor: Colors.grey, + borderRadius: 999.rpx, + padding: EdgeInsets.zero, + onTap: () { + TopSlideNotification.show(context, + text: "待开发功能".tr); + }, + child: Container( + width: 91.rpx, + height: 91.rpx, + clipBehavior: Clip.antiAlias, + decoration: BoxDecoration( + shape: BoxShape.circle, + ), + child: Image.asset( + "assets/img/google.png", + width: 30.rpx, + height: 30.rpx, + ), + ), + ), + ].divide(SizedBox(width: 35.rpx)), + ), + ], + ), + ), + ], ), ), - )), + ), + ), + )), ); } } diff --git a/lib/pages/main_bottom/e_page.dart b/lib/pages/main_bottom/e_page.dart index 802be75..f4d8b91 100644 --- a/lib/pages/main_bottom/e_page.dart +++ b/lib/pages/main_bottom/e_page.dart @@ -22,7 +22,7 @@ class _EPageState extends State { Widget build(BuildContext context) { return LayoutBuilder( builder: (context, boxConstraints) => GestureDetector( - onTap: () => FocusScope.of(context).unfocus(), + // onTap: () => FocusScope.of(context).unfocus(),, child: Scaffold( appBar: AppBar( backgroundColor: themeController.currentColor.sc17, diff --git a/lib/pages/main_bottom/follow_page.dart b/lib/pages/main_bottom/follow_page.dart index b8b2925..45c3a71 100644 --- a/lib/pages/main_bottom/follow_page.dart +++ b/lib/pages/main_bottom/follow_page.dart @@ -30,7 +30,7 @@ class _FollowPageState extends State { Widget build(BuildContext context) { return LayoutBuilder( builder: (context, bodySize) => GestureDetector( - onTap: () => FocusScope.of(context).unfocus(), + // onTap: () => FocusScope.of(context).unfocus(),, child: Container( // decoration: BoxDecoration( // image: DecorationImage( @@ -86,7 +86,9 @@ class _FollowPageState extends State { // child: widget.webView, decoration: BoxDecoration( image: DecorationImage( - image: AssetImage(AppConstants().ent_type == 1?'assets/img/followus.png':"assets/img/huanshuiF.png"), // 本地图片 + image: AssetImage(AppConstants().ent_type == 1 + ? 'assets/img/followus.png' + : "assets/img/huanshuiF.png"), // 本地图片 fit: BoxFit.cover, // 填满整个 Container ), ), diff --git a/lib/pages/main_bottom/help_page.dart b/lib/pages/main_bottom/help_page.dart index 934d8f5..1c36b7f 100644 --- a/lib/pages/main_bottom/help_page.dart +++ b/lib/pages/main_bottom/help_page.dart @@ -34,7 +34,7 @@ class _HelpPageState extends State { Widget build(BuildContext context) { return LayoutBuilder( builder: (context, bodySize) => GestureDetector( - onTap: () => FocusScope.of(context).unfocus(), + // onTap: () => FocusScope.of(context).unfocus(),, child: Container( decoration: BoxDecoration( image: DecorationImage( diff --git a/lib/pages/main_bottom/message_page.dart b/lib/pages/main_bottom/message_page.dart index 0240cba..367d897 100644 --- a/lib/pages/main_bottom/message_page.dart +++ b/lib/pages/main_bottom/message_page.dart @@ -79,7 +79,7 @@ class _MessagePageState extends State { return LayoutBuilder( builder: (context, boxConstraints) => GestureDetector( - onTap: () => FocusScope.of(context).unfocus(), + // onTap: () => FocusScope.of(context).unfocus(),, child: Container( decoration: const BoxDecoration( image: DecorationImage( @@ -253,7 +253,6 @@ class _MessagePageState extends State { ], ), ), - SizedBox(height: 17.rpx), ], ), diff --git a/lib/pages/main_bottom/mine_page.dart b/lib/pages/main_bottom/mine_page.dart index d23da87..2de91f9 100644 --- a/lib/pages/main_bottom/mine_page.dart +++ b/lib/pages/main_bottom/mine_page.dart @@ -39,7 +39,7 @@ class _MinePageState extends State { int login = userInfoController.model.login!; return LayoutBuilder( builder: (context, bodySize) => GestureDetector( - onTap: () => FocusScope.of(context).unfocus(), + // onTap: () => FocusScope.of(context).unfocus(),, child: Container( decoration: BoxDecoration( image: DecorationImage( diff --git a/lib/pages/mh_page/BackMovement.dart b/lib/pages/mh_page/BackMovement.dart index ef27e30..9ded08c 100644 --- a/lib/pages/mh_page/BackMovement.dart +++ b/lib/pages/mh_page/BackMovement.dart @@ -24,205 +24,198 @@ class _BackMovementPageState extends State { final double spacing = 34.rpx; final double buttonHeight = 101.rpx; return GestureDetector( - onTap: () => FocusScope.of(context).unfocus(), + // onTap: () => FocusScope.of(context).unfocus(),, child: Container( child: Scaffold( - appBar: AppBar( - iconTheme: IconThemeData(color: themeController.currentColor.sc3), - backgroundColor: const Color(0xFF011C33), // 统一背景色 - automaticallyImplyLeading: false, - titleSpacing: 0, - title: SizedBox( - width: double.infinity, - height: 180.rpx, - child: Stack( - alignment: Alignment.center, - children: [ - // 中间居中的标题 - Text( - '背部律动', - textAlign: TextAlign.center, - style: TextStyle( - color: Colors.white, - fontSize: 30.rpx, - ), - ), - // 左侧图标 - Positioned( - left: 0.rpx, - child: returnIconButtomNew, - ), - ], + appBar: AppBar( + iconTheme: IconThemeData(color: themeController.currentColor.sc3), + backgroundColor: const Color(0xFF011C33), // 统一背景色 + automaticallyImplyLeading: false, + titleSpacing: 0, + title: SizedBox( + width: double.infinity, + height: 180.rpx, + child: Stack( + alignment: Alignment.center, + children: [ + // 中间居中的标题 + Text( + '背部律动', + textAlign: TextAlign.center, + style: TextStyle( + color: Colors.white, + fontSize: 30.rpx, + ), ), - ), - centerTitle: false, + // 左侧图标 + Positioned( + left: 0.rpx, + child: returnIconButtomNew, + ), + ], ), - backgroundColor: const Color(0xFF011C33), - body: Padding( - padding: EdgeInsets.fromLTRB(0.rpx, 0, 0.rpx, 0), - child: Column( - // crossAxisAlignment: CrossAxisAlignment.center, - mainAxisAlignment: MainAxisAlignment.spaceBetween, + ), + centerTitle: false, + ), + backgroundColor: const Color(0xFF011C33), + body: Padding( + padding: EdgeInsets.fromLTRB(0.rpx, 0, 0.rpx, 0), + child: Column( + // crossAxisAlignment: CrossAxisAlignment.center, + mainAxisAlignment: MainAxisAlignment.spaceBetween, + children: [ + SingleChildScrollView( + child: Column( children: [ - SingleChildScrollView( - child: Column( - children: [ - SizedBox(height: 30.rpx), - Text( - '力度调节', - style: TextStyle(color: Colors.grey, fontSize: 30.rpx), - ), - SizedBox(height: 148.rpx), - Text( - intensity.toInt().toString(), - style: - TextStyle(color: Colors.white, fontSize: 160.rpx), - ), - SizedBox(height: 41.rpx), - SizedBox( - height: 451.rpx, // 外部容器高度固定 - child: Stack( - children: [ - // 左边的 强/弱 文本 - Positioned( - left: 0, - top: 0, - bottom: 0, - child: SizedBox( - width: 60.rpx, - child: Column( - mainAxisAlignment: - MainAxisAlignment.spaceBetween, - children: [ - Text('强', - style: TextStyle( - color: Colors.grey, - fontSize: 30.rpx)), - Text('弱', - style: TextStyle( - color: Colors.grey, - fontSize: 30.rpx)), - ], - ), - ), + SizedBox(height: 30.rpx), + Text( + '力度调节', + style: TextStyle(color: Colors.grey, fontSize: 30.rpx), + ), + SizedBox(height: 148.rpx), + Text( + intensity.toInt().toString(), + style: TextStyle(color: Colors.white, fontSize: 160.rpx), + ), + SizedBox(height: 41.rpx), + SizedBox( + height: 451.rpx, // 外部容器高度固定 + child: Stack( + children: [ + // 左边的 强/弱 文本 + Positioned( + left: 0, + top: 0, + bottom: 0, + child: SizedBox( + width: 60.rpx, + child: Column( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + children: [ + Text('强', + style: TextStyle( + color: Colors.grey, fontSize: 30.rpx)), + Text('弱', + style: TextStyle( + color: Colors.grey, fontSize: 30.rpx)), + ], ), + ), + ), - // 右侧 slider,27.rpx 后居中 - Positioned( - left: 60.rpx - 27.rpx, // 60 是文字宽度,27 是间隔 - right: 0, - top: 0, - bottom: 0, - child: Center( - child: Transform.rotate( - angle: -math.pi / 2, - child: ConstrainedBox( - constraints: BoxConstraints( - minHeight: 451.rpx, - maxHeight: 451.rpx, - ), - child: SliderTheme( - data: SliderTheme.of(context).copyWith( - trackHeight: 60.rpx, - thumbShape: RoundSliderThumbShape( - enabledThumbRadius: 45.rpx), - overlayShape: - const RoundSliderOverlayShape( - overlayRadius: 20), - ), - child: Slider( - value: intensity, - min: 1, - max: 6, - divisions: 7, - activeColor: Colors.cyanAccent, - inactiveColor: Colors.blue.shade900, - onChanged: (value) { - setState(() { - intensity = value; - }); - }, - ), - ), + // 右侧 slider,27.rpx 后居中 + Positioned( + left: 60.rpx - 27.rpx, // 60 是文字宽度,27 是间隔 + right: 0, + top: 0, + bottom: 0, + child: Center( + child: Transform.rotate( + angle: -math.pi / 2, + child: ConstrainedBox( + constraints: BoxConstraints( + minHeight: 451.rpx, + maxHeight: 451.rpx, + ), + child: SliderTheme( + data: SliderTheme.of(context).copyWith( + trackHeight: 60.rpx, + thumbShape: RoundSliderThumbShape( + enabledThumbRadius: 45.rpx), + overlayShape: const RoundSliderOverlayShape( + overlayRadius: 20), + ), + child: Slider( + value: intensity, + min: 1, + max: 6, + divisions: 7, + activeColor: Colors.cyanAccent, + inactiveColor: Colors.blue.shade900, + onChanged: (value) { + setState(() { + intensity = value; + }); + }, ), ), ), ), - ], - ), - ), - SizedBox(height: 118.rpx), - Padding( - padding: EdgeInsets.only( - left: 47.rpx), // 👈 控制间隔大小(也可以是 all / symmetric) - child: Align( - alignment: Alignment.centerLeft, - child: Text( - '按摩定时', - style: TextStyle( - color: Colors.white70, fontSize: 30.rpx), ), ), - ), - SizedBox(height: 74.rpx), - Padding( - padding: EdgeInsets.fromLTRB(40.rpx, 0, 40.rpx, 0), - child: Row( - mainAxisAlignment: MainAxisAlignment.spaceBetween, - children: - List.generate(timeOptions.length, (index) { - final min = timeOptions[index]; - final isSelected = selectedTime == min; - return SizedBox( - height: buttonHeight, - child: ElevatedButton( - onPressed: () { - setState(() { - selectedTime = min; - }); - }, - style: ElevatedButton.styleFrom( - backgroundColor: isSelected - ? Colors.cyanAccent - : Colors.blue.shade900, - foregroundColor: isSelected - ? Colors.black - : Colors.white, - shape: RoundedRectangleBorder( - borderRadius: BorderRadius.circular(6), - ), - ), - child: Text('$min分钟'), - )); - }), - )), - ], - )), - Padding( - padding: EdgeInsets.fromLTRB(30.rpx, 0, 30.rpx, - 81.rpx), // 👈 控制上方间隔(也可以用 all / symmetric) - child: OutlinedButton( - onPressed: () { - setState(() { - intensity = 4; - selectedTime = 10; - }); - }, - style: OutlinedButton.styleFrom( - side: const BorderSide(color: Color(0XFF74DAE5)), - foregroundColor: Colors.cyanAccent, - minimumSize: Size(bodysize.maxWidth, 92.rpx), - shape: RoundedRectangleBorder( - borderRadius: BorderRadius.circular(6), - ), - ), - child: const Text('恢复到默认设置'), + ], ), ), + SizedBox(height: 118.rpx), + Padding( + padding: EdgeInsets.only( + left: 47.rpx), // 👈 控制间隔大小(也可以是 all / symmetric) + child: Align( + alignment: Alignment.centerLeft, + child: Text( + '按摩定时', + style: + TextStyle(color: Colors.white70, fontSize: 30.rpx), + ), + ), + ), + SizedBox(height: 74.rpx), + Padding( + padding: EdgeInsets.fromLTRB(40.rpx, 0, 40.rpx, 0), + child: Row( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + children: List.generate(timeOptions.length, (index) { + final min = timeOptions[index]; + final isSelected = selectedTime == min; + return SizedBox( + height: buttonHeight, + child: ElevatedButton( + onPressed: () { + setState(() { + selectedTime = min; + }); + }, + style: ElevatedButton.styleFrom( + backgroundColor: isSelected + ? Colors.cyanAccent + : Colors.blue.shade900, + foregroundColor: + isSelected ? Colors.black : Colors.white, + shape: RoundedRectangleBorder( + borderRadius: BorderRadius.circular(6), + ), + ), + child: Text('$min分钟'), + )); + }), + )), ], + )), + Padding( + padding: EdgeInsets.fromLTRB(30.rpx, 0, 30.rpx, + 81.rpx), // 👈 控制上方间隔(也可以用 all / symmetric) + child: OutlinedButton( + onPressed: () { + setState(() { + intensity = 4; + selectedTime = 10; + }); + }, + style: OutlinedButton.styleFrom( + side: const BorderSide(color: Color(0XFF74DAE5)), + foregroundColor: Colors.cyanAccent, + minimumSize: Size(bodysize.maxWidth, 92.rpx), + shape: RoundedRectangleBorder( + borderRadius: BorderRadius.circular(6), + ), + ), + child: const Text('恢复到默认设置'), + ), ), - ), - ))); + ], + ), + ), + ))); }); } } diff --git a/lib/pages/mh_page/HomeDeviceType.dart b/lib/pages/mh_page/HomeDeviceType.dart index bf67a5c..d440ee9 100644 --- a/lib/pages/mh_page/HomeDeviceType.dart +++ b/lib/pages/mh_page/HomeDeviceType.dart @@ -5,7 +5,6 @@ import 'package:flutter/material.dart'; import 'package:vbvs_app/common/util/FitTool.dart'; import 'package:vbvs_app/common/util/MyUtils.dart'; - class HomeDeviceType extends StatefulWidget { HomeDeviceType({super.key}); @override @@ -25,85 +24,85 @@ class _HomeDeviceTypeState extends State { // } return LayoutBuilder( builder: (context, boxConstraints) => GestureDetector( - onTap: () => FocusScope.of(context).unfocus(), + // onTap: () => FocusScope.of(context).unfocus(),, child: Container( - decoration: const BoxDecoration( - image: DecorationImage( - image: AssetImage('assets/images/new_background.png'), // 本地图片 - fit: BoxFit.fill, // 填满整个 Container - ), - ), - child: Scaffold( - backgroundColor: Colors.transparent, - appBar: AppBar( - backgroundColor: Colors.transparent, - automaticallyImplyLeading: false, - iconTheme: const IconThemeData(color: Colors.white), - titleSpacing: 0, - // leading: returnIconButtom, - title: SizedBox( - width: double.infinity, - height: 180.rpx, - child: Stack( - alignment: Alignment.center, - children: [ - // 中间居中的标题 - Text( - '添加设备', - textAlign: TextAlign.center, - style: TextStyle( - color: Colors.white, - fontSize: 30.rpx, - ), - ), - // 左侧图标 - Positioned( - left: 0.rpx, - child: returnIconButtomNew, - ), - ], - ), - ), - - centerTitle: false, - ), - body: SafeArea( - top: true, - child: Container( - width: MediaQuery.sizeOf(context).width, - height: MediaQuery.sizeOf(context).height * 1.123, - // decoration: const BoxDecoration( - // image: DecorationImage( - // image: AssetImage("assets/images/new_background.png"), - // fit: BoxFit.cover, - // ), - // ), - child: SingleChildScrollView( - child: Column( - mainAxisSize: MainAxisSize.max, - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - Padding( - padding: EdgeInsetsDirectional.fromSTEB( - 48.rpx, 24.rpx, 0, 0), - child: Text( - '选择类型', - style: TextStyle( - fontFamily: 'Readex Pro', - color: Colors.white, - fontSize: 30.rpx, - letterSpacing: 0, - ), - ), - ), - _buildControlCard(context), - ], + decoration: const BoxDecoration( + image: DecorationImage( + image: AssetImage('assets/images/new_background.png'), // 本地图片 + fit: BoxFit.fill, // 填满整个 Container + ), + ), + child: Scaffold( + backgroundColor: Colors.transparent, + appBar: AppBar( + backgroundColor: Colors.transparent, + automaticallyImplyLeading: false, + iconTheme: const IconThemeData(color: Colors.white), + titleSpacing: 0, + // leading: returnIconButtom, + title: SizedBox( + width: double.infinity, + height: 180.rpx, + child: Stack( + alignment: Alignment.center, + children: [ + // 中间居中的标题 + Text( + '添加设备', + textAlign: TextAlign.center, + style: TextStyle( + color: Colors.white, + fontSize: 30.rpx, ), ), + // 左侧图标 + Positioned( + left: 0.rpx, + child: returnIconButtomNew, + ), + ], + ), + ), + + centerTitle: false, + ), + body: SafeArea( + top: true, + child: Container( + width: MediaQuery.sizeOf(context).width, + height: MediaQuery.sizeOf(context).height * 1.123, + // decoration: const BoxDecoration( + // image: DecorationImage( + // image: AssetImage("assets/images/new_background.png"), + // fit: BoxFit.cover, + // ), + // ), + child: SingleChildScrollView( + child: Column( + mainAxisSize: MainAxisSize.max, + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Padding( + padding: + EdgeInsetsDirectional.fromSTEB(48.rpx, 24.rpx, 0, 0), + child: Text( + '选择类型', + style: TextStyle( + fontFamily: 'Readex Pro', + color: Colors.white, + fontSize: 30.rpx, + letterSpacing: 0, + ), + ), + ), + _buildControlCard(context), + ], ), ), ), - )), + ), + ), + )), ); } } diff --git a/lib/pages/mh_page/MattressControl.dart b/lib/pages/mh_page/MattressControl.dart index 97f8e3b..37e21f7 100644 --- a/lib/pages/mh_page/MattressControl.dart +++ b/lib/pages/mh_page/MattressControl.dart @@ -20,7 +20,7 @@ class _MattressControlPageState extends State { Widget build(BuildContext context) { return LayoutBuilder( builder: (context, bodySize) => GestureDetector( - // onTap: () => FocusScope.of(context).unfocus(), + // // onTap: () => FocusScope.of(context).unfocus(),, child: Container( decoration: const BoxDecoration( image: DecorationImage( diff --git a/lib/pages/mh_page/ShareDeviceDetailWidget.dart b/lib/pages/mh_page/ShareDeviceDetailWidget.dart index ef4dfcb..0c2b028 100644 --- a/lib/pages/mh_page/ShareDeviceDetailWidget.dart +++ b/lib/pages/mh_page/ShareDeviceDetailWidget.dart @@ -23,7 +23,7 @@ class ShareDeviceDetailWidget extends GetView { type.value = shareInfo['op_type']; return GestureDetector( - onTap: () => FocusScope.of(context).unfocus(), + // onTap: () => FocusScope.of(context).unfocus(),, child: Scaffold( key: scaffoldKey, backgroundColor: FlutterFlowTheme.of(context).primaryBackground, diff --git a/lib/pages/mh_page/about_us.dart b/lib/pages/mh_page/about_us.dart index 8a785df..0e46000 100644 --- a/lib/pages/mh_page/about_us.dart +++ b/lib/pages/mh_page/about_us.dart @@ -44,7 +44,7 @@ class _MhAboutUsPageState extends State { Widget build(BuildContext context) { return LayoutBuilder( builder: (context, bodySize) => GestureDetector( - onTap: () => FocusScope.of(context).unfocus(), + // onTap: () => FocusScope.of(context).unfocus(),, child: Container( decoration: BoxDecoration( image: DecorationImage( diff --git a/lib/pages/mh_page/address_list_page.dart b/lib/pages/mh_page/address_list_page.dart index a6a3c35..bdc12a9 100644 --- a/lib/pages/mh_page/address_list_page.dart +++ b/lib/pages/mh_page/address_list_page.dart @@ -24,186 +24,185 @@ class AddressListPage extends GetView { return LayoutBuilder(builder: (context, cc) { bodysize = cc; return GestureDetector( - onTap: () => FocusScope.of(context).unfocus(), + // onTap: () => FocusScope.of(context).unfocus(),, child: Container( - decoration: const BoxDecoration( - image: DecorationImage( - image: AssetImage('assets/images/new_background.png'), // 本地图片 - fit: BoxFit.fill, // 填满整个 Container + decoration: const BoxDecoration( + image: DecorationImage( + image: AssetImage('assets/images/new_background.png'), // 本地图片 + fit: BoxFit.fill, // 填满整个 Container + ), + ), + child: Scaffold( + backgroundColor: Colors.transparent, + appBar: AppBar( + backgroundColor: Colors.transparent, + automaticallyImplyLeading: false, + iconTheme: IconThemeData(color: Colors.white), + titleSpacing: 0, + title: SizedBox( + width: double.infinity, + height: 180.rpx, + child: Stack( + alignment: Alignment.center, + children: [ + // 中间居中的标题 + Text( + '地址管理', + textAlign: TextAlign.center, + style: TextStyle( + color: Colors.white, + fontSize: 30.rpx, + ), + ), + // 左侧图标 + Positioned( + left: 0.rpx, + child: returnIconButtomNew, + ), + ], ), ), - child: Scaffold( - backgroundColor: Colors.transparent, - appBar: AppBar( - backgroundColor: Colors.transparent, - automaticallyImplyLeading: false, - iconTheme: IconThemeData(color: Colors.white), - titleSpacing: 0, - title: SizedBox( - width: double.infinity, - height: 180.rpx, - child: Stack( - alignment: Alignment.center, - children: [ - // 中间居中的标题 - Text( - '地址管理', - textAlign: TextAlign.center, - style: TextStyle( - color: Colors.white, - fontSize: 30.rpx, - ), + centerTitle: false, + ), + body: Container( + margin: EdgeInsets.only(top: 30.rpx), + width: bodysize!.maxWidth, + height: bodysize!.maxHeight * 1, + child: Column( + mainAxisSize: MainAxisSize.max, + children: [ + // Obx(() { + // if (controller.model.addressList!.isEmpty) { + // // 如果地址列表为空,显示 EmptyMessageWidget + // return Expanded(child: NullDataWidget()); + // } else { + // // 如果地址列表不为空,显示地址列表 + // return Expanded( + // child: Container( + // width: bodysize!.maxWidth, + // height: bodysize!.maxHeight * 1, + // decoration: BoxDecoration(), + // child: Obx(() => ListView( + // shrinkWrap: true, + // scrollDirection: Axis.vertical, + // children: (controller.model.addressList! + // .asMap() + // .entries + // .map((e) => AddressModuleWidget( + // index: e.key, + // addressListController: + // controller, + // )) + // .toList() as List) + // .divide(const SizedBox(height: 10)) + // .addToEnd(const SizedBox( + // height: + // AppConstants.list_end_height)), + // )), + // ), + // ); + // } + // }), + Obx(() { + final originList = controller.model.addressList ?? []; + + // 拆出默认地址 + final defaultItem = originList.firstWhere( + (e) => e["default"] == 1, + orElse: () => null, + ); + + // 其他非默认地址 + final others = + originList.where((e) => e["default"] != 1).toList(); + + // 新的展示顺序列表(默认地址排前面) + final reorderedList = [ + if (defaultItem != null) defaultItem, + ...others, + ]; + + return Expanded( + child: ListView( + shrinkWrap: true, + padding: EdgeInsets.zero, + children: reorderedList + .map((item) { + final realIndex = + originList.indexOf(item); // 保留原始 index + return AddressModuleWidget( + index: realIndex, + addressListController: controller, + ); + }) + .toList() + .divide(const SizedBox(height: 10)) + .addToEnd(const SizedBox( + height: AppConstants.list_end_height)), + ), + ); + }), + Align( + alignment: AlignmentDirectional(0, 1), + child: Padding( + padding: EdgeInsetsDirectional.fromSTEB( + 15, 15, 15, AppConstants.page_button_bottom_padding), + child: Container( + width: bodysize!.maxWidth, + height: bodysize!.maxHeight * 0.056, + decoration: BoxDecoration( + // color: Color(0xFFF6F6F6), + border: Border.all(width: 0, color: Color(0XFF85F5FF)), + borderRadius: BorderRadius.circular(12), ), - // 左侧图标 - Positioned( - left: 0.rpx, - child: returnIconButtomNew, - ), - ], - ), - ), - centerTitle: false, - ), - body: Container( - margin: EdgeInsets.only(top: 30.rpx), - width: bodysize!.maxWidth, - height: bodysize!.maxHeight * 1, - child: Column( - mainAxisSize: MainAxisSize.max, - children: [ - // Obx(() { - // if (controller.model.addressList!.isEmpty) { - // // 如果地址列表为空,显示 EmptyMessageWidget - // return Expanded(child: NullDataWidget()); - // } else { - // // 如果地址列表不为空,显示地址列表 - // return Expanded( - // child: Container( - // width: bodysize!.maxWidth, - // height: bodysize!.maxHeight * 1, - // decoration: BoxDecoration(), - // child: Obx(() => ListView( - // shrinkWrap: true, - // scrollDirection: Axis.vertical, - // children: (controller.model.addressList! - // .asMap() - // .entries - // .map((e) => AddressModuleWidget( - // index: e.key, - // addressListController: - // controller, - // )) - // .toList() as List) - // .divide(const SizedBox(height: 10)) - // .addToEnd(const SizedBox( - // height: - // AppConstants.list_end_height)), - // )), - // ), - // ); - // } - // }), - Obx(() { - final originList = controller.model.addressList ?? []; - - // 拆出默认地址 - final defaultItem = originList.firstWhere( - (e) => e["default"] == 1, - orElse: () => null, - ); - - // 其他非默认地址 - final others = - originList.where((e) => e["default"] != 1).toList(); - - // 新的展示顺序列表(默认地址排前面) - final reorderedList = [ - if (defaultItem != null) defaultItem, - ...others, - ]; - - return Expanded( - child: ListView( - shrinkWrap: true, - padding: EdgeInsets.zero, - children: reorderedList - .map((item) { - final realIndex = - originList.indexOf(item); // 保留原始 index - return AddressModuleWidget( - index: realIndex, - addressListController: controller, - ); - }) - .toList() - .divide(const SizedBox(height: 10)) - .addToEnd(const SizedBox( - height: AppConstants.list_end_height)), - ), - ); - }), - Align( - alignment: AlignmentDirectional(0, 1), - child: Padding( - padding: EdgeInsetsDirectional.fromSTEB(15, 15, 15, - AppConstants.page_button_bottom_padding), - child: Container( - width: bodysize!.maxWidth, - height: bodysize!.maxHeight * 0.056, - decoration: BoxDecoration( - // color: Color(0xFFF6F6F6), - border: - Border.all(width: 0, color: Color(0XFF85F5FF)), - borderRadius: BorderRadius.circular(12), + child: TextButton( + onPressed: () { + controller.model.address = {'default': 0}; + controller.model.type = 1; + Get.toNamed("/editAddressPage"); + }, + style: TextButton.styleFrom( + backgroundColor: Colors.transparent, + shape: RoundedRectangleBorder( + borderRadius: BorderRadius.circular(8), ), - child: TextButton( - onPressed: () { - controller.model.address = {'default': 0}; - controller.model.type = 1; - Get.toNamed("/editAddressPage"); - }, - style: TextButton.styleFrom( - backgroundColor: Colors.transparent, - shape: RoundedRectangleBorder( - borderRadius: BorderRadius.circular(8), + padding: + EdgeInsets.symmetric(horizontal: 24), // 按钮内边距 + ), + child: Row( + mainAxisAlignment: MainAxisAlignment.center, + children: [ + // Baseline( + // baselineType: TextBaseline.alphabetic, + // baseline: AppFontsize.normal_text_size * + // 1.6, // 调整基线位置 + SvgPicture.asset( + 'assets/img/icon/plus.svg', + width: 42.rpx, + height: 42.rpx, + ), + + SizedBox(width: 10), // 加号和文字间距 + Text( + '添加新地址', + style: TextStyle( + fontFamily: 'Readex Pro', + color: Color(0xFF85F5FF), + fontSize: AppFontsize.normal_text_size, + letterSpacing: 0, ), - padding: - EdgeInsets.symmetric(horizontal: 24), // 按钮内边距 ), - child: Row( - mainAxisAlignment: MainAxisAlignment.center, - children: [ - // Baseline( - // baselineType: TextBaseline.alphabetic, - // baseline: AppFontsize.normal_text_size * - // 1.6, // 调整基线位置 - SvgPicture.asset( - 'assets/img/icon/plus.svg', - width: 42.rpx, - height: 42.rpx, - ), - - SizedBox(width: 10), // 加号和文字间距 - Text( - '添加新地址', - style: TextStyle( - fontFamily: 'Readex Pro', - color: Color(0xFF85F5FF), - fontSize: AppFontsize.normal_text_size, - letterSpacing: 0, - ), - ), - ], - ), - ), + ], ), ), ), - ], + ), ), - ), + ], ), - )); + ), + ), + )); }); } } diff --git a/lib/pages/mh_page/applyRepair/apply_repair_success.dart b/lib/pages/mh_page/applyRepair/apply_repair_success.dart index d759b62..8d85348 100644 --- a/lib/pages/mh_page/applyRepair/apply_repair_success.dart +++ b/lib/pages/mh_page/applyRepair/apply_repair_success.dart @@ -33,7 +33,7 @@ class _ApplyRepairSuccessState extends State { Widget build(BuildContext context) { return LayoutBuilder( builder: (context, bodySize) => GestureDetector( - onTap: () => FocusScope.of(context).unfocus(), + // onTap: () => FocusScope.of(context).unfocus(),, child: Container( decoration: BoxDecoration( image: DecorationImage( diff --git a/lib/pages/mh_page/apply_repair_page.dart b/lib/pages/mh_page/apply_repair_page.dart index 5b0dccd..4665eee 100644 --- a/lib/pages/mh_page/apply_repair_page.dart +++ b/lib/pages/mh_page/apply_repair_page.dart @@ -46,325 +46,323 @@ class ApplyRepairPage extends GetView { return LayoutBuilder(builder: (context, cc) { bodysize = cc; return GestureDetector( - onTap: () => FocusScope.of(context).unfocus(), + // onTap: () => FocusScope.of(context).unfocus(),, child: Container( - decoration: const BoxDecoration( - image: DecorationImage( - image: AssetImage('assets/images/new_background.png'), // 本地图片 - fit: BoxFit.fill, // 填满整个 Container + decoration: const BoxDecoration( + image: DecorationImage( + image: AssetImage('assets/images/new_background.png'), // 本地图片 + fit: BoxFit.fill, // 填满整个 Container + ), + ), + child: Scaffold( + resizeToAvoidBottomInset: true, // 自动调整页面避免被键盘遮挡 + backgroundColor: Colors.transparent, + appBar: AppBar( + backgroundColor: Colors.transparent, + iconTheme: const IconThemeData(color: Colors.white), + automaticallyImplyLeading: false, + titleSpacing: 0, + title: SizedBox( + width: double.infinity, + height: 180.rpx, + child: Stack( + alignment: Alignment.center, + children: [ + // 中间居中的标题 + Text( + '申请报修', + textAlign: TextAlign.center, + style: TextStyle( + color: Colors.white, + fontSize: 30.rpx, + ), + ), + // 左侧图标 + Positioned( + left: 0.rpx, + child: returnIconButtomNew, + ), + ], ), ), - child: Scaffold( - resizeToAvoidBottomInset: true, // 自动调整页面避免被键盘遮挡 - backgroundColor: Colors.transparent, - appBar: AppBar( - backgroundColor: Colors.transparent, - iconTheme: const IconThemeData(color: Colors.white), - automaticallyImplyLeading: false, - titleSpacing: 0, - title: SizedBox( - width: double.infinity, - height: 180.rpx, - child: Stack( - alignment: Alignment.center, - children: [ - // 中间居中的标题 - Text( - '申请报修', - textAlign: TextAlign.center, - style: TextStyle( - color: Colors.white, - fontSize: 30.rpx, - ), - ), - // 左侧图标 - Positioned( - left: 0.rpx, - child: returnIconButtomNew, - ), - ], - ), - ), - centerTitle: false, - ), - body: Container( - width: bodysize!.maxWidth, - height: bodysize!.maxHeight * 1, - child: Column( - mainAxisSize: MainAxisSize.max, - children: [ - // TitleComponentWidget( - // titleName: '申请保修', - // ), - Flexible( - child: Padding( - padding: EdgeInsetsDirectional.fromSTEB( - 30.rpx, 0, 30.rpx, 30.rpx), - child: Container( - width: bodysize!.maxWidth, - height: 1000, - child: SingleChildScrollView( - child: Column( - mainAxisSize: MainAxisSize.max, - children: [ - Padding( + centerTitle: false, + ), + body: Container( + width: bodysize!.maxWidth, + height: bodysize!.maxHeight * 1, + child: Column( + mainAxisSize: MainAxisSize.max, + children: [ + // TitleComponentWidget( + // titleName: '申请保修', + // ), + Flexible( + child: Padding( + padding: EdgeInsetsDirectional.fromSTEB( + 30.rpx, 0, 30.rpx, 30.rpx), + child: Container( + width: bodysize!.maxWidth, + height: 1000, + child: SingleChildScrollView( + child: Column( + mainAxisSize: MainAxisSize.max, + children: [ + Padding( + padding: EdgeInsetsDirectional.fromSTEB( + 0, 27.rpx, 0, 0), + child: Container( + width: MediaQuery.sizeOf(context).width, + height: + MediaQuery.sizeOf(context).height * 0.247, + constraints: BoxConstraints( + minHeight: 500.rpx, + maxHeight: 500.rpx, + ), + decoration: BoxDecoration( + color: const Color(0XFF003058), + borderRadius: BorderRadius.circular(16.rpx), + ), + child: Padding( padding: EdgeInsetsDirectional.fromSTEB( - 0, 27.rpx, 0, 0), + 25.rpx, 27.rpx, 34.rpx, 0), child: Container( - width: MediaQuery.sizeOf(context).width, - height: MediaQuery.sizeOf(context).height * - 0.247, - constraints: BoxConstraints( - minHeight: 500.rpx, - maxHeight: 500.rpx, - ), - decoration: BoxDecoration( - color: const Color(0XFF003058), - borderRadius: - BorderRadius.circular(16.rpx), - ), - child: Padding( - padding: EdgeInsetsDirectional.fromSTEB( - 25.rpx, 27.rpx, 34.rpx, 0), - child: Container( - width: 100, - height: 100, - child: Container( - width: 100, - height: 100, - child: Column( - mainAxisSize: MainAxisSize.max, - children: [ - Align( + width: 100, + height: 100, + child: Container( + width: 100, + height: 100, + child: Column( + mainAxisSize: MainAxisSize.max, + children: [ + Align( + alignment: + const AlignmentDirectional( + 0, 0), + child: Container( + width: MediaQuery.sizeOf(context) + .width, + height: 44, + child: Align( alignment: const AlignmentDirectional( - 0, 0), - child: Container( - width: - MediaQuery.sizeOf(context) - .width, - height: 44, - child: Align( - alignment: - const AlignmentDirectional( - 0, -1), - child: Text( - '选择需要报修的设备', - style: TextStyle( - fontFamily: - 'Readex Pro', - letterSpacing: 0, - fontSize: AppFontsize - .title_size, - color: Colors - .white // 加粗文字 - ), - ), - ), + 0, -1), + child: Text( + '选择需要报修的设备', + style: TextStyle( + fontFamily: 'Readex Pro', + letterSpacing: 0, + fontSize: AppFontsize + .title_size, + color: + Colors.white // 加粗文字 + ), ), ), - Expanded( - child: Column( - mainAxisSize: - MainAxisSize.max, - children: [ - Flexible( - child: Container( - width: - MediaQuery.sizeOf( - context) - .width, - height: 10, - constraints: - BoxConstraints( - minHeight: 60.rpx, - ), - child: Row( - mainAxisSize: - MainAxisSize.max, - children: [ - Container( - width: 105.rpx, - height: MediaQuery - .sizeOf( - context) + ), + ), + Expanded( + child: Column( + mainAxisSize: MainAxisSize.max, + children: [ + Flexible( + child: Container( + width: MediaQuery.sizeOf( + context) + .width, + height: 10, + constraints: BoxConstraints( + minHeight: 60.rpx, + ), + child: Row( + mainAxisSize: + MainAxisSize.max, + children: [ + Container( + width: 105.rpx, + height: + MediaQuery.sizeOf( + context) .height * 0.038, - constraints: - const BoxConstraints( - minWidth: 60, - ), - child: Align( - alignment: - const AlignmentDirectional( - -1, 0), - child: Text( - '已绑设备', - style: TextStyle( - fontFamily: - 'Readex Pro', - fontSize: 26 - .rpx, - letterSpacing: - 0, - color: Colors - .white), - ), - ), + constraints: + const BoxConstraints( + minWidth: 60, + ), + child: Align( + alignment: + const AlignmentDirectional( + -1, 0), + child: Text( + '已绑设备', + style: TextStyle( + fontFamily: + 'Readex Pro', + fontSize: + 26.rpx, + letterSpacing: + 0, + color: Colors + .white), ), - Expanded( - child: Container( - width: 300, // 可以根据需要调整宽度 - height: 56, // 可以根据需要调整高度 - decoration: BoxDecoration( - borderRadius: - BorderRadius.circular( + ), + ), + Expanded( + child: Container( + width: + 300, // 可以根据需要调整宽度 + height: + 56, // 可以根据需要调整高度 + decoration: + BoxDecoration( + borderRadius: + BorderRadius + .circular( 8), - color: Colors - .white, - ), - // child: Obx( - // () { - // List> deviceOptions = controller - // .model - // .device_list! - // .map((device) => { - // 'mac': device['mac'].toString(), // 提取设备 Mac - // 'name': device['name'].toString(), // 提取设备名称 - // 'type': device['device_type'].toString() - // }) - // .toList(); + color: Colors + .white, + ), + // child: Obx( + // () { + // List> deviceOptions = controller + // .model + // .device_list! + // .map((device) => { + // 'mac': device['mac'].toString(), // 提取设备 Mac + // 'name': device['name'].toString(), // 提取设备名称 + // 'type': device['device_type'].toString() + // }) + // .toList(); - // // 提取 optionsLabel 和 optionsValue - // // List deviceNames = deviceOptions - // // .map((device) => device['name']!) // 用于显示的名称列表 - // // .toList(); - // List - // deviceNames = - // controller.model.device_list!.map((device) { - // final mac = - // device['mac']?.toString() ?? ''; - // final name = - // device['name']?.toString() ?? ''; - // final type = - // getDeviceTypeName(int.tryParse('${device['device_type']}')); + // // 提取 optionsLabel 和 optionsValue + // // List deviceNames = deviceOptions + // // .map((device) => device['name']!) // 用于显示的名称列表 + // // .toList(); + // List + // deviceNames = + // controller.model.device_list!.map((device) { + // final mac = + // device['mac']?.toString() ?? ''; + // final name = + // device['name']?.toString() ?? ''; + // final type = + // getDeviceTypeName(int.tryParse('${device['device_type']}')); - // return name.isNotEmpty - // ? '$name-MAC$mac' - // : '$type-MAC$mac'; - // }).toList(); + // return name.isNotEmpty + // ? '$name-MAC$mac' + // : '$type-MAC$mac'; + // }).toList(); - // List deviceMacs = deviceOptions - // .map((device) => device['mac']!) // 用于匹配的 ID 列表 - // .toList(); + // List deviceMacs = deviceOptions + // .map((device) => device['mac']!) // 用于匹配的 ID 列表 + // .toList(); - // return FlutterFlowDropDown< - // String>( - // controller: - // tmpcontroller, + // return FlutterFlowDropDown< + // String>( + // controller: + // tmpcontroller, - // fillColor: - // Colors.white, // 控件区域背景色 - // options: - // deviceMacs, // 下拉菜单选项为设备的 ID - // optionLabels: - // deviceNames, // 下拉菜单显示的内容为设备名称 - // onChanged: - // (val) { - // // var selectedDevice = controller.model.device_list!.firstWhere((device) => device['mac'].toString() == val); - // // controller.model.select_device = val; - // // controller.model.device_type = selectedDevice['device_type']; - // // // controller.model.device_category = selectedDevice['deviceSeries']['name'] ?? '未知型号'; // 获取设备型号 - // // controller.model.device_category = '未知型号'; - // // controller.model.device_id = selectedDevice['mac'] ?? '未知设备mac'; // 获取设备ID - // // controller.model.device_name = selectedDevice['name'] ?? '未知设备'; // 获取设备名称 - // // controller.updateAll(); + // fillColor: + // Colors.white, // 控件区域背景色 + // options: + // deviceMacs, // 下拉菜单选项为设备的 ID + // optionLabels: + // deviceNames, // 下拉菜单显示的内容为设备名称 + // onChanged: + // (val) { + // // var selectedDevice = controller.model.device_list!.firstWhere((device) => device['mac'].toString() == val); + // // controller.model.select_device = val; + // // controller.model.device_type = selectedDevice['device_type']; + // // // controller.model.device_category = selectedDevice['deviceSeries']['name'] ?? '未知型号'; // 获取设备型号 + // // controller.model.device_category = '未知型号'; + // // controller.model.device_id = selectedDevice['mac'] ?? '未知设备mac'; // 获取设备ID + // // controller.model.device_name = selectedDevice['name'] ?? '未知设备'; // 获取设备名称 + // // controller.updateAll(); - // var selectedDevice = controller.model.device_list!.firstWhere((device) => device['mac'].toString() == val); + // var selectedDevice = controller.model.device_list!.firstWhere((device) => device['mac'].toString() == val); - // final mac = selectedDevice['mac']?.toString() ?? '未知MAC'; - // final name = selectedDevice['name']?.toString(); - // final type = int.tryParse('${selectedDevice['device_type']}'); - // final typeName = getDeviceTypeName(type); + // final mac = selectedDevice['mac']?.toString() ?? '未知MAC'; + // final name = selectedDevice['name']?.toString(); + // final type = int.tryParse('${selectedDevice['device_type']}'); + // final typeName = getDeviceTypeName(type); - // controller.model.select_device = mac; - // controller.model.device_type = selectedDevice['device_type']; - // controller.model.device_category = '未知型号'; // 后续可替换成设备系列 + // controller.model.select_device = mac; + // controller.model.device_type = selectedDevice['device_type']; + // controller.model.device_category = '未知型号'; // 后续可替换成设备系列 - // // 如果 name 不为空则用 name,否则用 typeName-mac - // controller.model.device_name = (name != null && name.isNotEmpty) ? name : '$typeName-MAC$mac'; + // // 如果 name 不为空则用 name,否则用 typeName-mac + // controller.model.device_name = (name != null && name.isNotEmpty) ? name : '$typeName-MAC$mac'; - // controller.model.device_id = mac; + // controller.model.device_id = mac; - // controller.updateAll(); - // }, - // width: - // 300, - // height: - // 56, - // searchHintTextStyle: - // const TextStyle( - // fontFamily: 'Readex Pro', - // letterSpacing: 0, - // ), + // controller.updateAll(); + // }, + // width: + // 300, + // height: + // 56, + // searchHintTextStyle: + // const TextStyle( + // fontFamily: 'Readex Pro', + // letterSpacing: 0, + // ), - // searchTextStyle: - // const TextStyle( - // fontFamily: 'Readex Pro', - // letterSpacing: 0, - // ), - // textStyle: - // TextStyle( - // fontFamily: 'Readex Pro', - // color: Colors.black, - // fontSize: 26.rpx, - // letterSpacing: 0, - // ), - // hintText: - // '请选择绑定设备', - // searchHintText: - // '查找', - // icon: - // const Icon( - // Icons.keyboard_arrow_down_rounded, - // color: Colors.black, - // size: 24, - // ), - // // fillColor: - // // FlutterFlowTheme.of(context).secondaryBackground, - // elevation: - // 2, - // borderColor: - // Colors.white, - // borderWidth: - // 0, - // borderRadius: - // 8, - // margin: const EdgeInsetsDirectional.fromSTEB( - // 10, - // 4, - // 10, - // 4), - // hidesUnderline: - // true, - // isOverButton: - // false, - // isSearchable: - // false, - // isMultiSelect: - // false, - // ); - // }) - child: Obx(() { - final isDeviceListEmpty = controller - .model - .device_list - ?.isEmpty ?? - true; + // searchTextStyle: + // const TextStyle( + // fontFamily: 'Readex Pro', + // letterSpacing: 0, + // ), + // textStyle: + // TextStyle( + // fontFamily: 'Readex Pro', + // color: Colors.black, + // fontSize: 26.rpx, + // letterSpacing: 0, + // ), + // hintText: + // '请选择绑定设备', + // searchHintText: + // '查找', + // icon: + // const Icon( + // Icons.keyboard_arrow_down_rounded, + // color: Colors.black, + // size: 24, + // ), + // // fillColor: + // // FlutterFlowTheme.of(context).secondaryBackground, + // elevation: + // 2, + // borderColor: + // Colors.white, + // borderWidth: + // 0, + // borderRadius: + // 8, + // margin: const EdgeInsetsDirectional.fromSTEB( + // 10, + // 4, + // 10, + // 4), + // hidesUnderline: + // true, + // isOverButton: + // false, + // isSearchable: + // false, + // isMultiSelect: + // false, + // ); + // }) + child: Obx(() { + final isDeviceListEmpty = controller + .model + .device_list + ?.isEmpty ?? + true; - List< - Map> deviceOptions = controller + List> + deviceOptions = + controller .model .device_list! .map((device) => @@ -375,1261 +373,322 @@ class ApplyRepairPage extends GetView { }) .toList(); - List - deviceNames = - controller - .model - .device_list! - .map((device) { - final mac = - device['mac']?.toString() ?? - ''; - final name = - device['name']?.toString() ?? - ''; - final type = - getDeviceTypeName(int.tryParse('${device['device_type']}')); + List + deviceNames = + controller + .model + .device_list! + .map( + (device) { + final mac = + device['mac']?.toString() ?? + ''; + final name = + device['name']?.toString() ?? + ''; + final type = + getDeviceTypeName( + int.tryParse('${device['device_type']}')); - return name.isNotEmpty - ? '$name-MAC$mac' - : '$type-MAC$mac'; - }).toList(); + return name + .isNotEmpty + ? '$name-MAC$mac' + : '$type-MAC$mac'; + }).toList(); - List - deviceMacs = - deviceOptions - .map((device) => device['mac']!) - .toList(); + List + deviceMacs = + deviceOptions + .map((device) => + device['mac']!) + .toList(); - return AbsorbPointer( - absorbing: - isDeviceListEmpty, // 禁止点击 - child: FlutterFlowDropDown< - String>( - controller: - tmpcontroller, - fillColor: isDeviceListEmpty - ? Colors.grey[300]! - : Colors.white, - options: isDeviceListEmpty - ? [] - : deviceMacs, - optionLabels: isDeviceListEmpty + return AbsorbPointer( + absorbing: + isDeviceListEmpty, // 禁止点击 + child: FlutterFlowDropDown< + String>( + controller: + tmpcontroller, + fillColor: isDeviceListEmpty + ? Colors.grey[ + 300]! + : Colors + .white, + options: isDeviceListEmpty + ? [] + : deviceMacs, + optionLabels: + isDeviceListEmpty ? [] : deviceNames, - onChanged: - (val) { - var selectedDevice = controller.model.device_list!.firstWhere((device) => + onChanged: + (val) { + var selectedDevice = controller + .model + .device_list! + .firstWhere((device) => device['mac'].toString() == val); - final mac = - selectedDevice['mac']?.toString() ?? '未知MAC'; - final name = - selectedDevice['name']?.toString(); - final type = - int.tryParse('${selectedDevice['device_type']}'); - final typeName = - getDeviceTypeName(type); + final mac = + selectedDevice['mac']?.toString() ?? + '未知MAC'; + final name = + selectedDevice['name']?.toString(); + final type = + int.tryParse('${selectedDevice['device_type']}'); + final typeName = + getDeviceTypeName(type); - controller.model.select_device = - mac; - controller.model.device_type = - selectedDevice['device_type']; - controller.model.device_category = - '未知型号'; - controller.model.device_name = (name != null && name.isNotEmpty) - ? name - : '$typeName-MAC$mac'; - controller.model.device_id = - mac; + controller + .model + .select_device = mac; + controller + .model + .device_type = selectedDevice['device_type']; + controller + .model + .device_category = '未知型号'; + controller + .model + .device_name = (name != null && + name.isNotEmpty) + ? name + : '$typeName-MAC$mac'; + controller + .model + .device_id = mac; - controller.updateAll(); - }, - width: - 300, - height: - 56, - textStyle: - TextStyle( - fontFamily: - 'Readex Pro', - color: isDeviceListEmpty - ? Colors.grey - : Colors.black, - fontSize: - 26.rpx, - letterSpacing: - 0, - ), - hintText: isDeviceListEmpty - ? '暂无可选设备' - : '请选择绑定设备', - searchHintText: - '查找', - icon: - Icon( - Icons.keyboard_arrow_down_rounded, - color: isDeviceListEmpty - ? Colors.grey - : Colors.black, - size: - 24, - ), - elevation: - 2, - borderColor: - Colors.white, - borderWidth: - 0, - borderRadius: - 8, - margin: const EdgeInsetsDirectional - .fromSTEB( - 10, - 4, - 10, - 4), - hidesUnderline: - true, - isOverButton: - false, - isSearchable: - false, - isMultiSelect: - false, - ), - ); - }))), - ].divide(SizedBox( - width: 26.rpx)), - ), - ), - ), - Flexible( - child: Container( - width: - MediaQuery.sizeOf( - context) - .width, - height: 10, - constraints: - BoxConstraints( - minHeight: 60.rpx, - ), - child: Row( - mainAxisSize: - MainAxisSize.max, - children: [ - Container( - width: 105.rpx, - height: MediaQuery - .sizeOf( - context) - .height * - 0.038, - constraints: - const BoxConstraints( - minWidth: 60, - ), - child: Align( - alignment: - const AlignmentDirectional( - -1, 0), - child: Text( - '设备系列', - style: TextStyle( - fontFamily: - 'Readex Pro', - fontSize: 26 - .rpx, - letterSpacing: - 0, - color: Colors - .white), - ), - ), - ), - Expanded( - child: Container( - decoration: - BoxDecoration( - color: Colors - .white, - borderRadius: - BorderRadius - .circular( - 8), - ), - width: double - .infinity, - child: Padding( - padding: EdgeInsetsDirectional - .fromSTEB( - 35.rpx, - 0, - 35.rpx, - 0), - child: Row( - mainAxisSize: - MainAxisSize - .max, - mainAxisAlignment: - MainAxisAlignment - .spaceBetween, - children: [ - Expanded( - child: - Container( - child: - Align( - alignment: - AlignmentDirectional(-1, 0), - child: - TextFormField( - onChanged: (value) { - controller.model.device_series = value; - }, - autofocus: false, - obscureText: false, - decoration: InputDecoration( - contentPadding: EdgeInsets.all(0), - isDense: true, - labelStyle: TextStyle( - fontFamily: 'Inter', - fontSize: 26.rpx, - letterSpacing: 0.0, - ), - hintStyle: TextStyle( - fontFamily: 'Inter', - fontSize: 26.rpx, - letterSpacing: 0.0, - color: themeController.currentColor.sc4, - ), - enabledBorder: OutlineInputBorder( - borderSide: BorderSide( - color: Color(0x00000000), - width: 1.rpx, - ), - borderRadius: BorderRadius.circular(8.rpx), - ), - focusedBorder: OutlineInputBorder( - borderSide: BorderSide( - color: Color(0x00000000), - width: 1.rpx, - ), - borderRadius: BorderRadius.circular(8.rpx), - ), - errorBorder: OutlineInputBorder( - borderSide: BorderSide( - color: Colors.red, - width: 1.rpx, - ), - borderRadius: BorderRadius.circular(8.rpx), - ), - focusedErrorBorder: OutlineInputBorder( - borderSide: BorderSide( - color: Colors.red, - width: 1.rpx, - ), - borderRadius: BorderRadius.circular(8.rpx), - ), - filled: false, - fillColor: Colors.white, - ), - style: TextStyle( - fontFamily: 'Readex Pro', - letterSpacing: 0, - color: Colors.black, - fontSize: 26.rpx, - ), - // cursorColor: - // Colors.black, - // validator: _model - // .textControllerValidator - // .asValidator(context), - ), - ), - ), + controller + .updateAll(); + }, + width: + 300, + height: + 56, + textStyle: + TextStyle( + fontFamily: + 'Readex Pro', + color: isDeviceListEmpty + ? Colors.grey + : Colors.black, + fontSize: + 26.rpx, + letterSpacing: + 0, ), - ], - ), - ), - ), - ), - ].divide(SizedBox( - width: 26.rpx)), - ), - ), - ), - - // Flexible( - // child: Container( - // width: - // MediaQuery.sizeOf( - // context) - // .width, - // height: 10, - // constraints: - // BoxConstraints( - // minHeight: 60.rpx, - // ), - // child: Row( - // mainAxisSize: - // MainAxisSize.max, - // children: [ - // Container( - // width: 105.rpx, - // height: MediaQuery - // .sizeOf( - // context) - // .height * - // 0.038, - // constraints: - // const BoxConstraints( - // minWidth: 60, - // ), - // child: Align( - // alignment: - // const AlignmentDirectional( - // -1, 0), - // child: Text( - // '产品型号', - // style: TextStyle( - // fontFamily: - // 'Readex Pro', - // fontSize: 26 - // .rpx, - // letterSpacing: - // 0, - // color: Colors - // .white), - // ), - // ), - // ), - // // Expanded( - // // child: Container( - // // width: 100, - // // height: 100, - // // decoration: - // // BoxDecoration( - // // color: Colors - // // .white, - // // borderRadius: - // // BorderRadius - // // .circular(8), - // // ), - // // child: Padding( - // // padding: EdgeInsets.only(left: 26.rpx), - // // child: Align( - // // alignment: Alignment.centerLeft, - // // child: Obx(() => Text( - // // controller.model.device_category ?? '', - // // style: TextStyle(fontSize: 26.rpx, color: Colors.black), - // // ))))), - // // ), - // Expanded( - // child: Container( - // child: Align( - // alignment: - // AlignmentDirectional( - // -1, - // 0), - // child: - // TextFormField( - // onChanged: - // (value) { - // controller - // .model - // .device_category = value; - // }, - // autofocus: - // false, - // obscureText: - // false, - // decoration: - // InputDecoration( - // contentPadding: - // EdgeInsets.all( - // 0), - // isDense: - // true, - // labelStyle: - // TextStyle( - // fontFamily: - // 'Inter', - // fontSize: - // 26.rpx, - // letterSpacing: - // 0.0, - // ), - // hintStyle: - // TextStyle( - // fontFamily: - // 'Inter', - // fontSize: - // 26.rpx, - // letterSpacing: - // 0.0, - // color: themeController - // .currentColor - // .sc4, - // ), - // enabledBorder: - // OutlineInputBorder( - // borderSide: - // BorderSide( - // color: - // Color(0x00000000), - // width: - // 1.rpx, - // ), - // borderRadius: - // BorderRadius.circular(8.rpx), - // ), - // focusedBorder: - // OutlineInputBorder( - // borderSide: - // BorderSide( - // color: - // Color(0x00000000), - // width: - // 1.rpx, - // ), - // borderRadius: - // BorderRadius.circular(8.rpx), - // ), - // errorBorder: - // OutlineInputBorder( - // borderSide: - // BorderSide( - // color: - // Colors.red, - // width: - // 1.rpx, - // ), - // borderRadius: - // BorderRadius.circular(8.rpx), - // ), - // focusedErrorBorder: - // OutlineInputBorder( - // borderSide: - // BorderSide( - // color: - // Colors.red, - // width: - // 1.rpx, - // ), - // borderRadius: - // BorderRadius.circular(8.rpx), - // ), - // filled: - // false, - // fillColor: - // Colors - // .white, - // ), - // style: - // TextStyle( - // fontFamily: - // 'Readex Pro', - // letterSpacing: - // 0, - // color: Colors - // .black, - // fontSize: - // 26.rpx, - // ), - // // cursorColor: - // // Colors.black, - // // validator: _model - // // .textControllerValidator - // // .asValidator(context), - // ), - // ), - // ), - // ), - // ].divide(SizedBox( - // width: 26.rpx)), - // ), - // ), - // ), - // Flexible( - // child: Container( - // width: - // MediaQuery.sizeOf( - // context) - // .width, - // height: 10, - // constraints: - // BoxConstraints( - // minHeight: 60.rpx, - // ), - // child: Row( - // mainAxisSize: - // MainAxisSize.max, - // children: [ - // Container( - // width: 105.rpx, - // height: MediaQuery - // .sizeOf( - // context) - // .height * - // 0.038, - // constraints: - // const BoxConstraints( - // minWidth: 60, - // ), - // child: Align( - // alignment: - // const AlignmentDirectional( - // -1, 0), - // child: Text( - // '序列号', - // style: TextStyle( - // fontFamily: - // 'Readex Pro', - // fontSize: 26 - // .rpx, - // letterSpacing: - // 0, - // color: Colors - // .white), - // ), - // ), - // ), - // // Expanded( - // // child: Container( - // // width: 100, - // // height: 100, - // // decoration: - // // BoxDecoration( - // // color: Colors - // // .white, - // // borderRadius: - // // BorderRadius - // // .circular(8), - // // ), - // // child: Padding( - // // padding: EdgeInsets.only(left: 26.rpx), - // // child: Align( - // // alignment: Alignment.centerLeft, - // // child: Obx(() => Text( - // // controller.model.device_id ?? '', - // // style: TextStyle(fontSize: 26.rpx, color: Colors.black), - // // ))))), - // // ), - // Expanded( - // child: Container( - // child: Align( - // alignment: - // AlignmentDirectional( - // -1, - // 0), - // child: - // TextFormField( - // onChanged: - // (value) { - // controller - // .model - // .device_id = value; - // }, - // autofocus: - // false, - // obscureText: - // false, - // decoration: - // InputDecoration( - // contentPadding: - // EdgeInsets.all( - // 0), - // isDense: - // true, - // labelStyle: - // TextStyle( - // fontFamily: - // 'Inter', - // fontSize: - // 26.rpx, - // letterSpacing: - // 0.0, - // ), - // hintStyle: - // TextStyle( - // fontFamily: - // 'Inter', - // fontSize: - // 26.rpx, - // letterSpacing: - // 0.0, - // color: themeController - // .currentColor - // .sc4, - // ), - // enabledBorder: - // OutlineInputBorder( - // borderSide: - // BorderSide( - // color: - // Color(0x00000000), - // width: - // 1.rpx, - // ), - // borderRadius: - // BorderRadius.circular(8.rpx), - // ), - // focusedBorder: - // OutlineInputBorder( - // borderSide: - // BorderSide( - // color: - // Color(0x00000000), - // width: - // 1.rpx, - // ), - // borderRadius: - // BorderRadius.circular(8.rpx), - // ), - // errorBorder: - // OutlineInputBorder( - // borderSide: - // BorderSide( - // color: - // Colors.red, - // width: - // 1.rpx, - // ), - // borderRadius: - // BorderRadius.circular(8.rpx), - // ), - // focusedErrorBorder: - // OutlineInputBorder( - // borderSide: - // BorderSide( - // color: - // Colors.red, - // width: - // 1.rpx, - // ), - // borderRadius: - // BorderRadius.circular(8.rpx), - // ), - // filled: - // false, - // fillColor: - // Colors - // .white, - // ), - // style: - // TextStyle( - // fontFamily: - // 'Readex Pro', - // letterSpacing: - // 0, - // color: Colors - // .black, - // fontSize: - // 26.rpx, - // ), - // // cursorColor: - // // Colors.black, - // // validator: _model - // // .textControllerValidator - // // .asValidator(context), - // ), - // ), - // ), - // ), - // ].divide(SizedBox( - // width: 26.rpx)), - // ), - // ), - // ), - Flexible( - child: Container( - width: - MediaQuery.sizeOf( - context) - .width, - height: 10, - constraints: - BoxConstraints( - minHeight: 60.rpx, - ), - child: Row( - mainAxisSize: - MainAxisSize.max, - children: [ - Container( - width: 105.rpx, - height: MediaQuery - .sizeOf( - context) - .height * - 0.038, - constraints: - const BoxConstraints( - minWidth: 60, - ), - child: Align( - alignment: - const AlignmentDirectional( - -1, 0), - child: Text( - '产品型号', - style: TextStyle( - fontFamily: - 'Readex Pro', - fontSize: 26 - .rpx, - letterSpacing: - 0, - color: Colors - .white), - ), - ), - ), - Expanded( - child: Container( - decoration: - BoxDecoration( - color: Colors - .white, - borderRadius: - BorderRadius - .circular( - 8), - ), - width: double - .infinity, - child: Padding( - padding: EdgeInsetsDirectional - .fromSTEB( - 35.rpx, - 0, - 35.rpx, - 0), - child: Row( - mainAxisSize: - MainAxisSize - .max, - mainAxisAlignment: - MainAxisAlignment - .spaceBetween, - children: [ - Expanded( - child: - Container( - child: - Align( - alignment: - AlignmentDirectional(-1, 0), - child: - TextFormField( - onChanged: (value) { - controller.model.device_category = value; - }, - autofocus: false, - obscureText: false, - decoration: InputDecoration( - contentPadding: EdgeInsets.all(0), - isDense: true, - labelStyle: TextStyle( - fontFamily: 'Inter', - fontSize: 26.rpx, - letterSpacing: 0.0, - ), - hintStyle: TextStyle( - fontFamily: 'Inter', - fontSize: 26.rpx, - letterSpacing: 0.0, - color: themeController.currentColor.sc4, - ), - enabledBorder: OutlineInputBorder( - borderSide: BorderSide( - color: Color(0x00000000), - width: 1.rpx, - ), - borderRadius: BorderRadius.circular(8.rpx), - ), - focusedBorder: OutlineInputBorder( - borderSide: BorderSide( - color: Color(0x00000000), - width: 1.rpx, - ), - borderRadius: BorderRadius.circular(8.rpx), - ), - errorBorder: OutlineInputBorder( - borderSide: BorderSide( - color: Colors.red, - width: 1.rpx, - ), - borderRadius: BorderRadius.circular(8.rpx), - ), - focusedErrorBorder: OutlineInputBorder( - borderSide: BorderSide( - color: Colors.red, - width: 1.rpx, - ), - borderRadius: BorderRadius.circular(8.rpx), - ), - filled: false, - fillColor: Colors.white, - ), - style: TextStyle( - fontFamily: 'Readex Pro', - letterSpacing: 0, - color: Colors.black, - fontSize: 26.rpx, - ), - // cursorColor: - // Colors.black, - // validator: _model - // .textControllerValidator - // .asValidator(context), - ), - ), - ), + hintText: isDeviceListEmpty + ? '暂无可选设备' + : '请选择绑定设备', + searchHintText: + '查找', + icon: + Icon( + Icons + .keyboard_arrow_down_rounded, + color: isDeviceListEmpty + ? Colors.grey + : Colors.black, + size: + 24, ), - ], - ), - ), - ), - ), - ].divide(SizedBox( - width: 26.rpx)), - ), - ), - ), - Flexible( - child: Container( - width: - MediaQuery.sizeOf( - context) - .width, - height: 10, - constraints: - BoxConstraints( - minHeight: 60.rpx, - ), - child: Row( - mainAxisSize: - MainAxisSize.max, - children: [ - Container( - width: 105.rpx, - height: MediaQuery - .sizeOf( - context) - .height * - 0.038, - constraints: - const BoxConstraints( - minWidth: 60, - ), - child: Align( - alignment: - const AlignmentDirectional( - -1, 0), - child: Text( - '序列号', - style: TextStyle( - fontFamily: - 'Readex Pro', - fontSize: 26 - .rpx, - letterSpacing: + elevation: + 2, + borderColor: + Colors + .white, + borderWidth: 0, - color: Colors - .white), - ), - ), - ), - Expanded( - child: Container( - decoration: - BoxDecoration( - color: Colors - .white, - borderRadius: - BorderRadius - .circular( - 8), - ), - width: double - .infinity, - child: Padding( - padding: EdgeInsetsDirectional - .fromSTEB( - 35.rpx, - 0, - 35.rpx, - 0), - child: Row( - mainAxisSize: - MainAxisSize - .max, - mainAxisAlignment: - MainAxisAlignment - .spaceBetween, - children: [ - Expanded( - child: - Container( - child: - Align( - alignment: - AlignmentDirectional(-1, 0), - child: - TextFormField( - onChanged: (value) { - controller.model.device_id = value; - }, - autofocus: false, - obscureText: false, - decoration: InputDecoration( - contentPadding: EdgeInsets.all(0), - isDense: true, - labelStyle: TextStyle( - fontFamily: 'Inter', - fontSize: 26.rpx, - letterSpacing: 0.0, - ), - hintStyle: TextStyle( - fontFamily: 'Inter', - fontSize: 26.rpx, - letterSpacing: 0.0, - color: themeController.currentColor.sc4, - ), - enabledBorder: OutlineInputBorder( - borderSide: BorderSide( - color: Color(0x00000000), - width: 1.rpx, - ), - borderRadius: BorderRadius.circular(8.rpx), - ), - focusedBorder: OutlineInputBorder( - borderSide: BorderSide( - color: Color(0x00000000), - width: 1.rpx, - ), - borderRadius: BorderRadius.circular(8.rpx), - ), - errorBorder: OutlineInputBorder( - borderSide: BorderSide( - color: Colors.red, - width: 1.rpx, - ), - borderRadius: BorderRadius.circular(8.rpx), - ), - focusedErrorBorder: OutlineInputBorder( - borderSide: BorderSide( - color: Colors.red, - width: 1.rpx, - ), - borderRadius: BorderRadius.circular(8.rpx), - ), - filled: false, - fillColor: Colors.white, - ), - style: TextStyle( - fontFamily: 'Readex Pro', - letterSpacing: 0, - color: Colors.black, - fontSize: 26.rpx, - ), - // cursorColor: - // Colors.black, - // validator: _model - // .textControllerValidator - // .asValidator(context), - ), - ), - ), - ), - ], - ), - ), - ), - ), - ].divide(SizedBox( - width: 26.rpx)), - ), - ), + borderRadius: + 8, + margin: const EdgeInsetsDirectional + .fromSTEB( + 10, + 4, + 10, + 4), + hidesUnderline: + true, + isOverButton: + false, + isSearchable: + false, + isMultiSelect: + false, + ), + ); + }))), + ].divide(SizedBox( + width: 26.rpx)), ), - ].divide( - SizedBox(height: 30.rpx)), + ), ), - ) - ], - ), - ), - ), - ), - ), - ), - Padding( - padding: EdgeInsetsDirectional.fromSTEB( - 0, 26.rpx, 0, 0), - child: Container( - width: bodysize!.maxWidth, - height: bodysize!.maxHeight * 0.17, - constraints: BoxConstraints( - minHeight: 345.rpx, - ), - decoration: BoxDecoration( - color: const Color(0XFF003058), - borderRadius: - BorderRadius.circular(16.rpx), - ), - child: Obx(() { - return Container( - width: bodysize!.maxWidth, - height: bodysize!.maxHeight * 0.17, - decoration: BoxDecoration( - color: const Color(0XFF003058), - borderRadius: - BorderRadius.circular(16.rpx), - ), - child: Column( - mainAxisSize: MainAxisSize.max, - mainAxisAlignment: - MainAxisAlignment.center, - children: [ - if (controller.model.issue_img == - null || - controller - .model.issue_img!.isEmpty) - Flexible( - child: InkWell( - onTap: () async { - ApiResponse apiResponse = - await applyRepairController - .uploadImg(); - - if (apiResponse.code == - HttpStatusCodes.ok) { - } else { - if (controller.model - .issue_img == - null || - controller - .model - .issue_img! - .isEmpty) { - TopSlideNotification.show( - context, - text: apiResponse.msg!, - textColor: apiResponse - .code == - HttpStatusCodes - .ok - ? themeController - .currentColor - .sc2 - : themeController - .currentColor - .sc9, - ); - } - } - }, - child: Container( - width: - MediaQuery.sizeOf(context) - .width, - height: - MediaQuery.sizeOf(context) - .height * - 0.186, - child: Column( - mainAxisSize: - MainAxisSize.max, - mainAxisAlignment: - MainAxisAlignment - .center, - crossAxisAlignment: - CrossAxisAlignment - .center, - children: [ - Flexible( - child: Align( - alignment: - const AlignmentDirectional( - 0, 0), - // child: Icon( - // Icons - // .linked_camera_outlined, - // color: - // Color(0xFF9EA4B7), - // size: 40, - // ), - child: Container( - width: 50, - height: 50, - decoration: - BoxDecoration( - image: - DecorationImage( - fit: BoxFit - .cover, - image: - Image.asset( - 'assets/images/camera.png', - ).image, - ), - ), - ), - ), - ), - Flexible( - child: Container( - width: 138, - height: 31, - decoration: - BoxDecoration( - borderRadius: - BorderRadius - .circular( - 50), - border: Border.all( - color: const Color( - 0xFF9EA4B7), - ), + Flexible( + child: Container( + width: MediaQuery.sizeOf( + context) + .width, + height: 10, + constraints: BoxConstraints( + minHeight: 60.rpx, + ), + child: Row( + mainAxisSize: + MainAxisSize.max, + children: [ + Container( + width: 105.rpx, + height: + MediaQuery.sizeOf( + context) + .height * + 0.038, + constraints: + const BoxConstraints( + minWidth: 60, ), child: Align( alignment: const AlignmentDirectional( - 0, 0), + -1, 0), child: Text( - '上传设备故障照片', + '设备系列', style: TextStyle( - fontFamily: - 'Readex Pro', - color: const Color( - 0xFF9EA4B7), - fontSize: - AppFontsize - .normal_text_size, - letterSpacing: - 0, - ), + fontFamily: + 'Readex Pro', + fontSize: + 26.rpx, + letterSpacing: + 0, + color: Colors + .white), ), ), ), - ), - ], - ), - ), - )), - if (controller.model.issue_img != - null && - controller.model.issue_img! - .isNotEmpty) - Flexible( - child: Container( - width: - MediaQuery.sizeOf(context) - .width, - height: - MediaQuery.sizeOf(context) - .height * - 0.186, - constraints: - const BoxConstraints( - minHeight: 250, - ), - decoration: - const BoxDecoration( - color: Colors.white, - ), - child: Column( - mainAxisSize: - MainAxisSize.max, - children: [ - Align( - alignment: - const AlignmentDirectional( - 1, 0), - child: Padding( - padding: - const EdgeInsetsDirectional - .fromSTEB( - 0, 7, 21, 7), + Expanded( child: Container( - width: MediaQuery - .sizeOf( - context) - .width * - 0.2, - height: 21, decoration: - const BoxDecoration( + BoxDecoration( color: Colors.white, + borderRadius: + BorderRadius + .circular( + 8), ), - child: Container( - width: MediaQuery - .sizeOf( - context) - .width * - 0.2, - height: 21, - decoration: - const BoxDecoration( - color: Colors - .white, - ), + width: + double.infinity, + child: Padding( + padding: + EdgeInsetsDirectional + .fromSTEB( + 35.rpx, + 0, + 35.rpx, + 0), child: Row( mainAxisSize: MainAxisSize .max, mainAxisAlignment: MainAxisAlignment - .end, + .spaceBetween, children: [ - Text( - // '2', - controller - .model - .issue_img! - .length - .toString(), - style: - TextStyle( - fontFamily: - 'Readex Pro', - fontSize: - AppFontsize - .normal_text_size, - letterSpacing: - 0, - ), - ), - Text( - '/', - style: - TextStyle( - fontFamily: - 'Readex Pro', - fontSize: - AppFontsize - .normal_text_size, - letterSpacing: - 0, - ), - ), - Text( - '3', - style: - TextStyle( - fontFamily: - 'Readex Pro', - fontSize: - AppFontsize - .normal_text_size, - letterSpacing: - 0, + Expanded( + child: + Container( + child: + Align( + alignment: AlignmentDirectional( + -1, + 0), + child: + TextFormField( + onChanged: + (value) { + controller.model.device_series = + value; + }, + autofocus: + false, + obscureText: + false, + decoration: + InputDecoration( + contentPadding: + EdgeInsets.all(0), + isDense: + true, + labelStyle: + TextStyle( + fontFamily: 'Inter', + fontSize: 26.rpx, + letterSpacing: 0.0, + ), + hintStyle: + TextStyle( + fontFamily: 'Inter', + fontSize: 26.rpx, + letterSpacing: 0.0, + color: themeController.currentColor.sc4, + ), + enabledBorder: + OutlineInputBorder( + borderSide: BorderSide( + color: Color(0x00000000), + width: 1.rpx, + ), + borderRadius: BorderRadius.circular(8.rpx), + ), + focusedBorder: + OutlineInputBorder( + borderSide: BorderSide( + color: Color(0x00000000), + width: 1.rpx, + ), + borderRadius: BorderRadius.circular(8.rpx), + ), + errorBorder: + OutlineInputBorder( + borderSide: BorderSide( + color: Colors.red, + width: 1.rpx, + ), + borderRadius: BorderRadius.circular(8.rpx), + ), + focusedErrorBorder: + OutlineInputBorder( + borderSide: BorderSide( + color: Colors.red, + width: 1.rpx, + ), + borderRadius: BorderRadius.circular(8.rpx), + ), + filled: + false, + fillColor: + Colors.white, + ), + style: + TextStyle( + fontFamily: + 'Readex Pro', + letterSpacing: + 0, + color: + Colors.black, + fontSize: + 26.rpx, + ), + // cursorColor: + // Colors.black, + // validator: _model + // .textControllerValidator + // .asValidator(context), + ), + ), ), ), ], @@ -1637,739 +696,1689 @@ class ApplyRepairPage extends GetView { ), ), ), - ), - Flexible( - child: Padding( - padding: - const EdgeInsetsDirectional - .fromSTEB( - 0, 0, 21, 0), - child: Container( - width: MediaQuery - .sizeOf( - context) - .width, - height: MediaQuery - .sizeOf( - context) - .height * - 0.15, - constraints: - const BoxConstraints( - minHeight: 152, - ), - decoration: - const BoxDecoration( - color: - Colors.white, - ), - child: Container( - width: 100, - height: 100, - decoration: - const BoxDecoration( + ].divide(SizedBox( + width: 26.rpx)), + ), + ), + ), + + // Flexible( + // child: Container( + // width: + // MediaQuery.sizeOf( + // context) + // .width, + // height: 10, + // constraints: + // BoxConstraints( + // minHeight: 60.rpx, + // ), + // child: Row( + // mainAxisSize: + // MainAxisSize.max, + // children: [ + // Container( + // width: 105.rpx, + // height: MediaQuery + // .sizeOf( + // context) + // .height * + // 0.038, + // constraints: + // const BoxConstraints( + // minWidth: 60, + // ), + // child: Align( + // alignment: + // const AlignmentDirectional( + // -1, 0), + // child: Text( + // '产品型号', + // style: TextStyle( + // fontFamily: + // 'Readex Pro', + // fontSize: 26 + // .rpx, + // letterSpacing: + // 0, + // color: Colors + // .white), + // ), + // ), + // ), + // // Expanded( + // // child: Container( + // // width: 100, + // // height: 100, + // // decoration: + // // BoxDecoration( + // // color: Colors + // // .white, + // // borderRadius: + // // BorderRadius + // // .circular(8), + // // ), + // // child: Padding( + // // padding: EdgeInsets.only(left: 26.rpx), + // // child: Align( + // // alignment: Alignment.centerLeft, + // // child: Obx(() => Text( + // // controller.model.device_category ?? '', + // // style: TextStyle(fontSize: 26.rpx, color: Colors.black), + // // ))))), + // // ), + // Expanded( + // child: Container( + // child: Align( + // alignment: + // AlignmentDirectional( + // -1, + // 0), + // child: + // TextFormField( + // onChanged: + // (value) { + // controller + // .model + // .device_category = value; + // }, + // autofocus: + // false, + // obscureText: + // false, + // decoration: + // InputDecoration( + // contentPadding: + // EdgeInsets.all( + // 0), + // isDense: + // true, + // labelStyle: + // TextStyle( + // fontFamily: + // 'Inter', + // fontSize: + // 26.rpx, + // letterSpacing: + // 0.0, + // ), + // hintStyle: + // TextStyle( + // fontFamily: + // 'Inter', + // fontSize: + // 26.rpx, + // letterSpacing: + // 0.0, + // color: themeController + // .currentColor + // .sc4, + // ), + // enabledBorder: + // OutlineInputBorder( + // borderSide: + // BorderSide( + // color: + // Color(0x00000000), + // width: + // 1.rpx, + // ), + // borderRadius: + // BorderRadius.circular(8.rpx), + // ), + // focusedBorder: + // OutlineInputBorder( + // borderSide: + // BorderSide( + // color: + // Color(0x00000000), + // width: + // 1.rpx, + // ), + // borderRadius: + // BorderRadius.circular(8.rpx), + // ), + // errorBorder: + // OutlineInputBorder( + // borderSide: + // BorderSide( + // color: + // Colors.red, + // width: + // 1.rpx, + // ), + // borderRadius: + // BorderRadius.circular(8.rpx), + // ), + // focusedErrorBorder: + // OutlineInputBorder( + // borderSide: + // BorderSide( + // color: + // Colors.red, + // width: + // 1.rpx, + // ), + // borderRadius: + // BorderRadius.circular(8.rpx), + // ), + // filled: + // false, + // fillColor: + // Colors + // .white, + // ), + // style: + // TextStyle( + // fontFamily: + // 'Readex Pro', + // letterSpacing: + // 0, + // color: Colors + // .black, + // fontSize: + // 26.rpx, + // ), + // // cursorColor: + // // Colors.black, + // // validator: _model + // // .textControllerValidator + // // .asValidator(context), + // ), + // ), + // ), + // ), + // ].divide(SizedBox( + // width: 26.rpx)), + // ), + // ), + // ), + // Flexible( + // child: Container( + // width: + // MediaQuery.sizeOf( + // context) + // .width, + // height: 10, + // constraints: + // BoxConstraints( + // minHeight: 60.rpx, + // ), + // child: Row( + // mainAxisSize: + // MainAxisSize.max, + // children: [ + // Container( + // width: 105.rpx, + // height: MediaQuery + // .sizeOf( + // context) + // .height * + // 0.038, + // constraints: + // const BoxConstraints( + // minWidth: 60, + // ), + // child: Align( + // alignment: + // const AlignmentDirectional( + // -1, 0), + // child: Text( + // '序列号', + // style: TextStyle( + // fontFamily: + // 'Readex Pro', + // fontSize: 26 + // .rpx, + // letterSpacing: + // 0, + // color: Colors + // .white), + // ), + // ), + // ), + // // Expanded( + // // child: Container( + // // width: 100, + // // height: 100, + // // decoration: + // // BoxDecoration( + // // color: Colors + // // .white, + // // borderRadius: + // // BorderRadius + // // .circular(8), + // // ), + // // child: Padding( + // // padding: EdgeInsets.only(left: 26.rpx), + // // child: Align( + // // alignment: Alignment.centerLeft, + // // child: Obx(() => Text( + // // controller.model.device_id ?? '', + // // style: TextStyle(fontSize: 26.rpx, color: Colors.black), + // // ))))), + // // ), + // Expanded( + // child: Container( + // child: Align( + // alignment: + // AlignmentDirectional( + // -1, + // 0), + // child: + // TextFormField( + // onChanged: + // (value) { + // controller + // .model + // .device_id = value; + // }, + // autofocus: + // false, + // obscureText: + // false, + // decoration: + // InputDecoration( + // contentPadding: + // EdgeInsets.all( + // 0), + // isDense: + // true, + // labelStyle: + // TextStyle( + // fontFamily: + // 'Inter', + // fontSize: + // 26.rpx, + // letterSpacing: + // 0.0, + // ), + // hintStyle: + // TextStyle( + // fontFamily: + // 'Inter', + // fontSize: + // 26.rpx, + // letterSpacing: + // 0.0, + // color: themeController + // .currentColor + // .sc4, + // ), + // enabledBorder: + // OutlineInputBorder( + // borderSide: + // BorderSide( + // color: + // Color(0x00000000), + // width: + // 1.rpx, + // ), + // borderRadius: + // BorderRadius.circular(8.rpx), + // ), + // focusedBorder: + // OutlineInputBorder( + // borderSide: + // BorderSide( + // color: + // Color(0x00000000), + // width: + // 1.rpx, + // ), + // borderRadius: + // BorderRadius.circular(8.rpx), + // ), + // errorBorder: + // OutlineInputBorder( + // borderSide: + // BorderSide( + // color: + // Colors.red, + // width: + // 1.rpx, + // ), + // borderRadius: + // BorderRadius.circular(8.rpx), + // ), + // focusedErrorBorder: + // OutlineInputBorder( + // borderSide: + // BorderSide( + // color: + // Colors.red, + // width: + // 1.rpx, + // ), + // borderRadius: + // BorderRadius.circular(8.rpx), + // ), + // filled: + // false, + // fillColor: + // Colors + // .white, + // ), + // style: + // TextStyle( + // fontFamily: + // 'Readex Pro', + // letterSpacing: + // 0, + // color: Colors + // .black, + // fontSize: + // 26.rpx, + // ), + // // cursorColor: + // // Colors.black, + // // validator: _model + // // .textControllerValidator + // // .asValidator(context), + // ), + // ), + // ), + // ), + // ].divide(SizedBox( + // width: 26.rpx)), + // ), + // ), + // ), + Flexible( + child: Container( + width: MediaQuery.sizeOf( + context) + .width, + height: 10, + constraints: BoxConstraints( + minHeight: 60.rpx, + ), + child: Row( + mainAxisSize: + MainAxisSize.max, + children: [ + Container( + width: 105.rpx, + height: + MediaQuery.sizeOf( + context) + .height * + 0.038, + constraints: + const BoxConstraints( + minWidth: 60, + ), + child: Align( + alignment: + const AlignmentDirectional( + -1, 0), + child: Text( + '产品型号', + style: TextStyle( + fontFamily: + 'Readex Pro', + fontSize: + 26.rpx, + letterSpacing: + 0, color: Colors - .white, - ), - child: Obx(() => ListView( - shrinkWrap: true, - scrollDirection: Axis.horizontal, - children: getImage() - .divide(const SizedBox( - width: - 12, - )) - .addToStart(const SizedBox( - width: - 21, - ))))), + .white), + ), ), ), - ), - ], + Expanded( + child: Container( + decoration: + BoxDecoration( + color: + Colors.white, + borderRadius: + BorderRadius + .circular( + 8), + ), + width: + double.infinity, + child: Padding( + padding: + EdgeInsetsDirectional + .fromSTEB( + 35.rpx, + 0, + 35.rpx, + 0), + child: Row( + mainAxisSize: + MainAxisSize + .max, + mainAxisAlignment: + MainAxisAlignment + .spaceBetween, + children: [ + Expanded( + child: + Container( + child: + Align( + alignment: AlignmentDirectional( + -1, + 0), + child: + TextFormField( + onChanged: + (value) { + controller.model.device_category = + value; + }, + autofocus: + false, + obscureText: + false, + decoration: + InputDecoration( + contentPadding: + EdgeInsets.all(0), + isDense: + true, + labelStyle: + TextStyle( + fontFamily: 'Inter', + fontSize: 26.rpx, + letterSpacing: 0.0, + ), + hintStyle: + TextStyle( + fontFamily: 'Inter', + fontSize: 26.rpx, + letterSpacing: 0.0, + color: themeController.currentColor.sc4, + ), + enabledBorder: + OutlineInputBorder( + borderSide: BorderSide( + color: Color(0x00000000), + width: 1.rpx, + ), + borderRadius: BorderRadius.circular(8.rpx), + ), + focusedBorder: + OutlineInputBorder( + borderSide: BorderSide( + color: Color(0x00000000), + width: 1.rpx, + ), + borderRadius: BorderRadius.circular(8.rpx), + ), + errorBorder: + OutlineInputBorder( + borderSide: BorderSide( + color: Colors.red, + width: 1.rpx, + ), + borderRadius: BorderRadius.circular(8.rpx), + ), + focusedErrorBorder: + OutlineInputBorder( + borderSide: BorderSide( + color: Colors.red, + width: 1.rpx, + ), + borderRadius: BorderRadius.circular(8.rpx), + ), + filled: + false, + fillColor: + Colors.white, + ), + style: + TextStyle( + fontFamily: + 'Readex Pro', + letterSpacing: + 0, + color: + Colors.black, + fontSize: + 26.rpx, + ), + // cursorColor: + // Colors.black, + // validator: _model + // .textControllerValidator + // .asValidator(context), + ), + ), + ), + ), + ], + ), + ), + ), + ), + ].divide(SizedBox( + width: 26.rpx)), + ), ), ), - ), - ], - ), - ); - }), - ), - ), - Padding( - padding: EdgeInsetsDirectional.fromSTEB( - 0, 25.rpx, 0, 0), - child: Container( - width: bodysize!.maxWidth, - height: bodysize!.maxHeight * 0.17, - constraints: BoxConstraints( - minHeight: 345.rpx, - ), - decoration: BoxDecoration( - color: const Color(0xFF003058), - borderRadius: - BorderRadius.circular(16.rpx), - ), - child: Container( - width: bodysize!.maxWidth, - height: bodysize!.maxHeight * 0.19, - decoration: BoxDecoration( - borderRadius: - BorderRadius.circular(16.rpx), - ), - child: Column( - mainAxisSize: MainAxisSize.max, - children: [ - Align( - alignment: - const AlignmentDirectional( - 0, 0), - child: Padding( - padding: - const EdgeInsetsDirectional - .fromSTEB(0, 15, 0, 16), - child: Text( - '请描述一下您的问题', - style: TextStyle( - fontFamily: 'Readex Pro', - color: Colors.white, - fontSize: 30.rpx, - letterSpacing: 0, - fontWeight: FontWeight.w600, - ), - ), - ), - ), - Expanded( - child: Padding( - padding: EdgeInsetsDirectional - .fromSTEB(34.rpx, 0, 34.rpx, - 34.rpx), - child: Container( - width: - MediaQuery.sizeOf(context) + Flexible( + child: Container( + width: MediaQuery.sizeOf( + context) .width, - height: - MediaQuery.sizeOf(context) - .height * - 1, - constraints: BoxConstraints( - minHeight: 181.rpx, - ), - decoration: BoxDecoration( - color: - const Color(0xFFF3F5F6), - borderRadius: - BorderRadius.circular(8), - ), - child: TextFormField( - // autofocus: true, - onChanged: (value) { - controller.model.desc = - value; - }, - initialValue: - controller.model.desc, - obscureText: false, - - decoration: InputDecoration( - hintText: '问题描述(100个字以内)', - labelStyle: TextStyle( - fontFamily: - 'Readex Pro', - fontSize: AppFontsize - .normal_text_size, - letterSpacing: 0, - color: const Color( - 0XFF929699)), - hintStyle: TextStyle( - fontFamily: - 'Readex Pro', - fontSize: AppFontsize - .normal_text_size, - letterSpacing: 0, - color: const Color( - 0XFF929699)), - enabledBorder: - UnderlineInputBorder( - borderSide: - const BorderSide( - color: - Color(0x00000000), - width: 2, - ), - borderRadius: - BorderRadius.circular( - 8), + height: 10, + constraints: BoxConstraints( + minHeight: 60.rpx, ), - focusedBorder: - UnderlineInputBorder( - borderSide: - const BorderSide( - color: - Color(0x00000000), - width: 2, - ), - borderRadius: - BorderRadius.circular( - 8), + child: Row( + mainAxisSize: + MainAxisSize.max, + children: [ + Container( + width: 105.rpx, + height: + MediaQuery.sizeOf( + context) + .height * + 0.038, + constraints: + const BoxConstraints( + minWidth: 60, + ), + child: Align( + alignment: + const AlignmentDirectional( + -1, 0), + child: Text( + '序列号', + style: TextStyle( + fontFamily: + 'Readex Pro', + fontSize: + 26.rpx, + letterSpacing: + 0, + color: Colors + .white), + ), + ), + ), + Expanded( + child: Container( + decoration: + BoxDecoration( + color: + Colors.white, + borderRadius: + BorderRadius + .circular( + 8), + ), + width: + double.infinity, + child: Padding( + padding: + EdgeInsetsDirectional + .fromSTEB( + 35.rpx, + 0, + 35.rpx, + 0), + child: Row( + mainAxisSize: + MainAxisSize + .max, + mainAxisAlignment: + MainAxisAlignment + .spaceBetween, + children: [ + Expanded( + child: + Container( + child: + Align( + alignment: AlignmentDirectional( + -1, + 0), + child: + TextFormField( + onChanged: + (value) { + controller.model.device_id = + value; + }, + autofocus: + false, + obscureText: + false, + decoration: + InputDecoration( + contentPadding: + EdgeInsets.all(0), + isDense: + true, + labelStyle: + TextStyle( + fontFamily: 'Inter', + fontSize: 26.rpx, + letterSpacing: 0.0, + ), + hintStyle: + TextStyle( + fontFamily: 'Inter', + fontSize: 26.rpx, + letterSpacing: 0.0, + color: themeController.currentColor.sc4, + ), + enabledBorder: + OutlineInputBorder( + borderSide: BorderSide( + color: Color(0x00000000), + width: 1.rpx, + ), + borderRadius: BorderRadius.circular(8.rpx), + ), + focusedBorder: + OutlineInputBorder( + borderSide: BorderSide( + color: Color(0x00000000), + width: 1.rpx, + ), + borderRadius: BorderRadius.circular(8.rpx), + ), + errorBorder: + OutlineInputBorder( + borderSide: BorderSide( + color: Colors.red, + width: 1.rpx, + ), + borderRadius: BorderRadius.circular(8.rpx), + ), + focusedErrorBorder: + OutlineInputBorder( + borderSide: BorderSide( + color: Colors.red, + width: 1.rpx, + ), + borderRadius: BorderRadius.circular(8.rpx), + ), + filled: + false, + fillColor: + Colors.white, + ), + style: + TextStyle( + fontFamily: + 'Readex Pro', + letterSpacing: + 0, + color: + Colors.black, + fontSize: + 26.rpx, + ), + // cursorColor: + // Colors.black, + // validator: _model + // .textControllerValidator + // .asValidator(context), + ), + ), + ), + ), + ], + ), + ), + ), + ), + ].divide(SizedBox( + width: 26.rpx)), ), - errorBorder: - UnderlineInputBorder( - borderSide: - const BorderSide( - color: - Color(0x00000000), - width: 2, - ), - borderRadius: - BorderRadius.circular( - 8), - ), - focusedErrorBorder: - UnderlineInputBorder( - borderSide: - const BorderSide( - color: - Color(0x00000000), - width: 2, - ), - borderRadius: - BorderRadius.circular( - 8), - ), - // contentPadding: - // EdgeInsetsDirectional - // .fromSTEB(0, 0, 0, 12), - contentPadding: - const EdgeInsetsDirectional - .fromSTEB( - 10, 5, 10, 5), - ), - maxLines: 4, - maxLength: - 100, // ✅ 限制最多输入 100 字符 - style: TextStyle( - fontFamily: 'Readex Pro', - fontSize: AppFontsize - .normal_text_size, - letterSpacing: 0, ), ), - ), + ].divide( + SizedBox(height: 30.rpx)), ), - ), + ) ], ), ), ), ), - Padding( - padding: EdgeInsetsDirectional.fromSTEB( - 0, 48.rpx, 0, 0), - child: Container( + ), + ), + Padding( + padding: EdgeInsetsDirectional.fromSTEB( + 0, 26.rpx, 0, 0), + child: Container( + width: bodysize!.maxWidth, + height: bodysize!.maxHeight * 0.17, + constraints: BoxConstraints( + minHeight: 345.rpx, + ), + decoration: BoxDecoration( + color: const Color(0XFF003058), + borderRadius: BorderRadius.circular(16.rpx), + ), + child: Obx(() { + return Container( width: bodysize!.maxWidth, height: bodysize!.maxHeight * 0.17, - constraints: BoxConstraints( - minHeight: 345.rpx, - ), decoration: BoxDecoration( color: const Color(0XFF003058), - borderRadius: BorderRadius.circular(16), + borderRadius: + BorderRadius.circular(16.rpx), ), child: Column( mainAxisSize: MainAxisSize.max, + mainAxisAlignment: + MainAxisAlignment.center, children: [ - Align( - alignment: - const AlignmentDirectional(0, 0), - child: Padding( - padding: - EdgeInsetsDirectional.fromSTEB( - 0, 48.rpx, 0, 48.rpx), - child: Text( - '联系方式', - style: TextStyle( - fontFamily: 'Readex Pro', - color: Colors.white, - fontSize: 30.rpx, - letterSpacing: 0, - fontWeight: FontWeight.w600, - ), - ), - ), - ), - Expanded( - child: Padding( - padding: - EdgeInsetsDirectional.fromSTEB( - 25.rpx, 0, 34.rpx, 70.rpx), + if (controller.model.issue_img == + null || + controller.model.issue_img!.isEmpty) + Flexible( + child: InkWell( + onTap: () async { + ApiResponse apiResponse = + await applyRepairController + .uploadImg(); + + if (apiResponse.code == + HttpStatusCodes.ok) { + } else { + if (controller + .model.issue_img == + null || + controller.model.issue_img! + .isEmpty) { + TopSlideNotification.show( + context, + text: apiResponse.msg!, + textColor: apiResponse + .code == + HttpStatusCodes.ok + ? themeController + .currentColor.sc2 + : themeController + .currentColor.sc9, + ); + } + } + }, child: Container( width: MediaQuery.sizeOf(context) .width, height: MediaQuery.sizeOf(context) .height * - 1, + 0.186, + child: Column( + mainAxisSize: MainAxisSize.max, + mainAxisAlignment: + MainAxisAlignment.center, + crossAxisAlignment: + CrossAxisAlignment.center, + children: [ + Flexible( + child: Align( + alignment: + const AlignmentDirectional( + 0, 0), + // child: Icon( + // Icons + // .linked_camera_outlined, + // color: + // Color(0xFF9EA4B7), + // size: 40, + // ), + child: Container( + width: 50, + height: 50, + decoration: + BoxDecoration( + image: + DecorationImage( + fit: BoxFit.cover, + image: Image.asset( + 'assets/images/camera.png', + ).image, + ), + ), + ), + ), + ), + Flexible( + child: Container( + width: 138, + height: 31, + decoration: BoxDecoration( + borderRadius: + BorderRadius + .circular(50), + border: Border.all( + color: const Color( + 0xFF9EA4B7), + ), + ), + child: Align( + alignment: + const AlignmentDirectional( + 0, 0), + child: Text( + '上传设备故障照片', + style: TextStyle( + fontFamily: + 'Readex Pro', + color: const Color( + 0xFF9EA4B7), + fontSize: AppFontsize + .normal_text_size, + letterSpacing: 0, + ), + ), + ), + ), + ), + ], + ), + ), + )), + if (controller.model.issue_img != + null && + controller + .model.issue_img!.isNotEmpty) + Flexible( + child: Container( + width: MediaQuery.sizeOf(context) + .width, + height: MediaQuery.sizeOf(context) + .height * + 0.186, + constraints: const BoxConstraints( + minHeight: 250, + ), + decoration: const BoxDecoration( + color: Colors.white, + ), child: Column( mainAxisSize: MainAxisSize.max, children: [ - Flexible( - child: Container( - width: MediaQuery.sizeOf( - context) - .width, - height: MediaQuery.sizeOf( - context) - .height * - 0.038, - constraints: - BoxConstraints( - minHeight: 61.rpx, - ), - child: Row( - mainAxisSize: - MainAxisSize.max, - children: [ - Container( - width: 105.rpx, - height: MediaQuery - .sizeOf( - context) - .height * - 0.038, - constraints: - BoxConstraints( - minWidth: 60.rpx, - ), - // decoration: - // BoxDecoration( - // color: FlutterFlowTheme.of( - // context) - // .secondaryBackground, - // ), - child: Row( - mainAxisSize: - MainAxisSize - .max, - children: [ - Text( - '联系人', - style: TextStyle( - fontFamily: - 'Readex Pro', - fontSize: 26 - .rpx, - letterSpacing: - 0, - color: Colors - .white), - ), - ], - ), - ), - Expanded( - child: Container( - width: MediaQuery - .sizeOf( + Align( + alignment: + const AlignmentDirectional( + 1, 0), + child: Padding( + padding: + const EdgeInsetsDirectional + .fromSTEB( + 0, 7, 21, 7), + child: Container( + width: + MediaQuery.sizeOf( + context) + .width * + 0.2, + height: 21, + decoration: + const BoxDecoration( + color: Colors.white, + ), + child: Container( + width: + MediaQuery.sizeOf( context) - .width, - height: 100, - decoration: - BoxDecoration( - color: Colors - .white, - borderRadius: - BorderRadius - .circular( - 8), - ), - child: - TextFormField( - // autofocus: true, - obscureText: - false, - onChanged: - (val) { - controller - .model - .apply_name = - val; - }, - - decoration: - InputDecoration( - contentPadding: - EdgeInsets - .symmetric( - vertical: - 25.rpx, - horizontal: - 26.rpx, - ), - labelStyle: - TextStyle( - fontFamily: - 'Readex Pro', - letterSpacing: - 0, - ), - hintStyle: - TextStyle( - fontFamily: - 'Readex Pro', - letterSpacing: - 0, - ), - enabledBorder: - UnderlineInputBorder( - borderSide: - const BorderSide( - color: Color( - 0x00000000), - width: 2, - ), - borderRadius: - BorderRadius - .circular(8), - ), - focusedBorder: - UnderlineInputBorder( - borderSide: - const BorderSide( - color: Color( - 0x00000000), - width: 2, - ), - borderRadius: - BorderRadius - .circular(8), - ), - errorBorder: - UnderlineInputBorder( - borderSide: - const BorderSide( - color: Color( - 0x00000000), - width: 2, - ), - borderRadius: - BorderRadius - .circular(8), - ), - focusedErrorBorder: - UnderlineInputBorder( - borderSide: - const BorderSide( - color: Color( - 0x00000000), - width: 2, - ), - borderRadius: - BorderRadius - .circular(8), - ), - ), + .width * + 0.2, + height: 21, + decoration: + const BoxDecoration( + color: Colors.white, + ), + child: Row( + mainAxisSize: + MainAxisSize + .max, + mainAxisAlignment: + MainAxisAlignment + .end, + children: [ + Text( + // '2', + controller + .model + .issue_img! + .length + .toString(), style: TextStyle( fontFamily: 'Readex Pro', + fontSize: + AppFontsize + .normal_text_size, letterSpacing: 0, - color: Colors - .black, - fontSize: - 26.rpx, ), ), - ), + Text( + '/', + style: + TextStyle( + fontFamily: + 'Readex Pro', + fontSize: + AppFontsize + .normal_text_size, + letterSpacing: + 0, + ), + ), + Text( + '3', + style: + TextStyle( + fontFamily: + 'Readex Pro', + fontSize: + AppFontsize + .normal_text_size, + letterSpacing: + 0, + ), + ), + ], ), - ].divide(const SizedBox( - width: 13)), + ), ), ), ), Flexible( - child: Container( - width: MediaQuery.sizeOf( - context) - .width, - height: MediaQuery.sizeOf( - context) - .height * - 0.038, - constraints: - const BoxConstraints( - minHeight: 31, - ), - child: Row( - mainAxisSize: - MainAxisSize.max, - children: [ - Container( - width: 105.rpx, - height: MediaQuery - .sizeOf( - context) + child: Padding( + padding: + const EdgeInsetsDirectional + .fromSTEB( + 0, 0, 21, 0), + child: Container( + width: + MediaQuery.sizeOf( + context) + .width, + height: + MediaQuery.sizeOf( + context) .height * - 0.038, - constraints: - BoxConstraints( - minWidth: 60.rpx, + 0.15, + constraints: + const BoxConstraints( + minHeight: 152, + ), + decoration: + const BoxDecoration( + color: Colors.white, + ), + child: Container( + width: 100, + height: 100, + decoration: + const BoxDecoration( + color: + Colors.white, ), - child: Row( - mainAxisSize: - MainAxisSize - .max, - children: [ - Text( - '手机号码', - style: TextStyle( - fontFamily: - 'Readex Pro', - fontSize: 26 - .rpx, - letterSpacing: - 0, - color: Colors - .white), - ), - ], - ), - ), - Expanded( - child: Container( - width: 100, - height: 100, - decoration: - BoxDecoration( - color: Colors - .white, - borderRadius: - BorderRadius - .circular( - 8), - ), - child: - TextFormField( - // autofocus: true, - obscureText: - false, - onChanged: - (val) { - controller - .model - .tel = - val; - }, - - decoration: - InputDecoration( - contentPadding: - EdgeInsets - .symmetric( - vertical: - 25.rpx, - horizontal: - 26.rpx, - ), - labelStyle: - TextStyle( - fontFamily: - 'Readex Pro', - letterSpacing: - 0, - ), - hintStyle: - TextStyle( - fontFamily: - 'Readex Pro', - letterSpacing: - 0, - ), - enabledBorder: - UnderlineInputBorder( - borderSide: - const BorderSide( - color: Color( - 0x00000000), - width: 2, - ), - borderRadius: - BorderRadius - .circular(8), - ), - focusedBorder: - UnderlineInputBorder( - borderSide: - const BorderSide( - color: Color( - 0x00000000), - width: 2, - ), - borderRadius: - BorderRadius - .circular(8), - ), - errorBorder: - UnderlineInputBorder( - borderSide: - const BorderSide( - color: Color( - 0x00000000), - width: 2, - ), - borderRadius: - BorderRadius - .circular(8), - ), - focusedErrorBorder: - UnderlineInputBorder( - borderSide: - const BorderSide( - color: Color( - 0x00000000), - width: 2, - ), - borderRadius: - BorderRadius - .circular(8), - ), - ), - style: - TextStyle( - fontFamily: - 'Readex Pro', - letterSpacing: - 0, - color: Colors - .black, - fontSize: - 26.rpx, - ), - ), - ), - ), - ].divide(const SizedBox( - width: 13)), + child: Obx(() => ListView( + shrinkWrap: true, + scrollDirection: Axis.horizontal, + children: getImage() + .divide(const SizedBox( + width: 12, + )) + .addToStart(const SizedBox( + width: 21, + ))))), ), ), ), - ].divide( - const SizedBox(height: 15)), + ], + ), + ), + ), + ], + ), + ); + }), + ), + ), + Padding( + padding: EdgeInsetsDirectional.fromSTEB( + 0, 25.rpx, 0, 0), + child: Container( + width: bodysize!.maxWidth, + height: bodysize!.maxHeight * 0.17, + constraints: BoxConstraints( + minHeight: 345.rpx, + ), + decoration: BoxDecoration( + color: const Color(0xFF003058), + borderRadius: BorderRadius.circular(16.rpx), + ), + child: Container( + width: bodysize!.maxWidth, + height: bodysize!.maxHeight * 0.19, + decoration: BoxDecoration( + borderRadius: BorderRadius.circular(16.rpx), + ), + child: Column( + mainAxisSize: MainAxisSize.max, + children: [ + Align( + alignment: + const AlignmentDirectional(0, 0), + child: Padding( + padding: const EdgeInsetsDirectional + .fromSTEB(0, 15, 0, 16), + child: Text( + '请描述一下您的问题', + style: TextStyle( + fontFamily: 'Readex Pro', + color: Colors.white, + fontSize: 30.rpx, + letterSpacing: 0, + fontWeight: FontWeight.w600, + ), + ), + ), + ), + Expanded( + child: Padding( + padding: + EdgeInsetsDirectional.fromSTEB( + 34.rpx, 0, 34.rpx, 34.rpx), + child: Container( + width: MediaQuery.sizeOf(context) + .width, + height: MediaQuery.sizeOf(context) + .height * + 1, + constraints: BoxConstraints( + minHeight: 181.rpx, + ), + decoration: BoxDecoration( + color: const Color(0xFFF3F5F6), + borderRadius: + BorderRadius.circular(8), + ), + child: TextFormField( + // autofocus: true, + onChanged: (value) { + controller.model.desc = value; + }, + initialValue: + controller.model.desc, + obscureText: false, + + decoration: InputDecoration( + hintText: '问题描述(100个字以内)', + labelStyle: TextStyle( + fontFamily: 'Readex Pro', + fontSize: AppFontsize + .normal_text_size, + letterSpacing: 0, + color: const Color( + 0XFF929699)), + hintStyle: TextStyle( + fontFamily: 'Readex Pro', + fontSize: AppFontsize + .normal_text_size, + letterSpacing: 0, + color: const Color( + 0XFF929699)), + enabledBorder: + UnderlineInputBorder( + borderSide: const BorderSide( + color: Color(0x00000000), + width: 2, + ), + borderRadius: + BorderRadius.circular(8), + ), + focusedBorder: + UnderlineInputBorder( + borderSide: const BorderSide( + color: Color(0x00000000), + width: 2, + ), + borderRadius: + BorderRadius.circular(8), + ), + errorBorder: + UnderlineInputBorder( + borderSide: const BorderSide( + color: Color(0x00000000), + width: 2, + ), + borderRadius: + BorderRadius.circular(8), + ), + focusedErrorBorder: + UnderlineInputBorder( + borderSide: const BorderSide( + color: Color(0x00000000), + width: 2, + ), + borderRadius: + BorderRadius.circular(8), + ), + // contentPadding: + // EdgeInsetsDirectional + // .fromSTEB(0, 0, 0, 12), + contentPadding: + const EdgeInsetsDirectional + .fromSTEB(10, 5, 10, 5), + ), + maxLines: 4, + maxLength: 100, // ✅ 限制最多输入 100 字符 + style: TextStyle( + fontFamily: 'Readex Pro', + fontSize: AppFontsize + .normal_text_size, + letterSpacing: 0, ), ), ), ), - ], - ), + ), + ], ), ), - ], + ), ), - ), + Padding( + padding: EdgeInsetsDirectional.fromSTEB( + 0, 48.rpx, 0, 0), + child: Container( + width: bodysize!.maxWidth, + height: bodysize!.maxHeight * 0.17, + constraints: BoxConstraints( + minHeight: 345.rpx, + ), + decoration: BoxDecoration( + color: const Color(0XFF003058), + borderRadius: BorderRadius.circular(16), + ), + child: Column( + mainAxisSize: MainAxisSize.max, + children: [ + Align( + alignment: + const AlignmentDirectional(0, 0), + child: Padding( + padding: EdgeInsetsDirectional.fromSTEB( + 0, 48.rpx, 0, 48.rpx), + child: Text( + '联系方式', + style: TextStyle( + fontFamily: 'Readex Pro', + color: Colors.white, + fontSize: 30.rpx, + letterSpacing: 0, + fontWeight: FontWeight.w600, + ), + ), + ), + ), + Expanded( + child: Padding( + padding: EdgeInsetsDirectional.fromSTEB( + 25.rpx, 0, 34.rpx, 70.rpx), + child: Container( + width: + MediaQuery.sizeOf(context).width, + height: MediaQuery.sizeOf(context) + .height * + 1, + child: Column( + mainAxisSize: MainAxisSize.max, + children: [ + Flexible( + child: Container( + width: + MediaQuery.sizeOf(context) + .width, + height: + MediaQuery.sizeOf(context) + .height * + 0.038, + constraints: BoxConstraints( + minHeight: 61.rpx, + ), + child: Row( + mainAxisSize: + MainAxisSize.max, + children: [ + Container( + width: 105.rpx, + height: + MediaQuery.sizeOf( + context) + .height * + 0.038, + constraints: + BoxConstraints( + minWidth: 60.rpx, + ), + // decoration: + // BoxDecoration( + // color: FlutterFlowTheme.of( + // context) + // .secondaryBackground, + // ), + child: Row( + mainAxisSize: + MainAxisSize.max, + children: [ + Text( + '联系人', + style: TextStyle( + fontFamily: + 'Readex Pro', + fontSize: + 26.rpx, + letterSpacing: + 0, + color: Colors + .white), + ), + ], + ), + ), + Expanded( + child: Container( + width: + MediaQuery.sizeOf( + context) + .width, + height: 100, + decoration: + BoxDecoration( + color: Colors.white, + borderRadius: + BorderRadius + .circular( + 8), + ), + child: TextFormField( + // autofocus: true, + obscureText: false, + onChanged: (val) { + controller.model + .apply_name = + val; + }, + + decoration: + InputDecoration( + contentPadding: + EdgeInsets + .symmetric( + vertical: + 25.rpx, + horizontal: + 26.rpx, + ), + labelStyle: + TextStyle( + fontFamily: + 'Readex Pro', + letterSpacing: + 0, + ), + hintStyle: + TextStyle( + fontFamily: + 'Readex Pro', + letterSpacing: + 0, + ), + enabledBorder: + UnderlineInputBorder( + borderSide: + const BorderSide( + color: Color( + 0x00000000), + width: 2, + ), + borderRadius: + BorderRadius + .circular( + 8), + ), + focusedBorder: + UnderlineInputBorder( + borderSide: + const BorderSide( + color: Color( + 0x00000000), + width: 2, + ), + borderRadius: + BorderRadius + .circular( + 8), + ), + errorBorder: + UnderlineInputBorder( + borderSide: + const BorderSide( + color: Color( + 0x00000000), + width: 2, + ), + borderRadius: + BorderRadius + .circular( + 8), + ), + focusedErrorBorder: + UnderlineInputBorder( + borderSide: + const BorderSide( + color: Color( + 0x00000000), + width: 2, + ), + borderRadius: + BorderRadius + .circular( + 8), + ), + ), + style: TextStyle( + fontFamily: + 'Readex Pro', + letterSpacing: 0, + color: + Colors.black, + fontSize: 26.rpx, + ), + ), + ), + ), + ].divide(const SizedBox( + width: 13)), + ), + ), + ), + Flexible( + child: Container( + width: + MediaQuery.sizeOf(context) + .width, + height: + MediaQuery.sizeOf(context) + .height * + 0.038, + constraints: + const BoxConstraints( + minHeight: 31, + ), + child: Row( + mainAxisSize: + MainAxisSize.max, + children: [ + Container( + width: 105.rpx, + height: + MediaQuery.sizeOf( + context) + .height * + 0.038, + constraints: + BoxConstraints( + minWidth: 60.rpx, + ), + child: Row( + mainAxisSize: + MainAxisSize.max, + children: [ + Text( + '手机号码', + style: TextStyle( + fontFamily: + 'Readex Pro', + fontSize: + 26.rpx, + letterSpacing: + 0, + color: Colors + .white), + ), + ], + ), + ), + Expanded( + child: Container( + width: 100, + height: 100, + decoration: + BoxDecoration( + color: Colors.white, + borderRadius: + BorderRadius + .circular( + 8), + ), + child: TextFormField( + // autofocus: true, + obscureText: false, + onChanged: (val) { + controller.model + .tel = val; + }, + + decoration: + InputDecoration( + contentPadding: + EdgeInsets + .symmetric( + vertical: + 25.rpx, + horizontal: + 26.rpx, + ), + labelStyle: + TextStyle( + fontFamily: + 'Readex Pro', + letterSpacing: + 0, + ), + hintStyle: + TextStyle( + fontFamily: + 'Readex Pro', + letterSpacing: + 0, + ), + enabledBorder: + UnderlineInputBorder( + borderSide: + const BorderSide( + color: Color( + 0x00000000), + width: 2, + ), + borderRadius: + BorderRadius + .circular( + 8), + ), + focusedBorder: + UnderlineInputBorder( + borderSide: + const BorderSide( + color: Color( + 0x00000000), + width: 2, + ), + borderRadius: + BorderRadius + .circular( + 8), + ), + errorBorder: + UnderlineInputBorder( + borderSide: + const BorderSide( + color: Color( + 0x00000000), + width: 2, + ), + borderRadius: + BorderRadius + .circular( + 8), + ), + focusedErrorBorder: + UnderlineInputBorder( + borderSide: + const BorderSide( + color: Color( + 0x00000000), + width: 2, + ), + borderRadius: + BorderRadius + .circular( + 8), + ), + ), + style: TextStyle( + fontFamily: + 'Readex Pro', + letterSpacing: 0, + color: + Colors.black, + fontSize: 26.rpx, + ), + ), + ), + ), + ].divide(const SizedBox( + width: 13)), + ), + ), + ), + ].divide( + const SizedBox(height: 15)), + ), + ), + ), + ), + ], + ), + ), + ), + ], ), ), ), - Padding( - padding: EdgeInsetsDirectional.fromSTEB(30.rpx, 30.rpx, - 30.rpx, AppConstants.page_button_bottom_padding), - child: Container( - width: bodysize!.maxWidth, - height: bodysize!.maxHeight * 0.056, - decoration: BoxDecoration( - borderRadius: BorderRadius.circular(16.rpx), - ), - child: CustomCard( - borderRadius: 16.rpx, - gradientDirection: GradientDirection.vertical, - onTap: () async { - String msg = checkRepairParam(); - if (msg.isNotEmpty) { + ), + ), + Padding( + padding: EdgeInsetsDirectional.fromSTEB(30.rpx, 30.rpx, + 30.rpx, AppConstants.page_button_bottom_padding), + child: Container( + width: bodysize!.maxWidth, + height: bodysize!.maxHeight * 0.056, + decoration: BoxDecoration( + borderRadius: BorderRadius.circular(16.rpx), + ), + child: CustomCard( + borderRadius: 16.rpx, + gradientDirection: GradientDirection.vertical, + onTap: () async { + String msg = checkRepairParam(); + if (msg.isNotEmpty) { + TopSlideNotification.show(context, + text: msg, + textColor: themeController.currentColor.sc9); + } else { + String serviceAddress = + ServiceConstant.service_address; + String serviceName = ServiceConstant.server_service; + String serviceApi = ServiceConstant.submit_repair; + String queryUrl = + "$serviceAddress$serviceName$serviceApi"; + var data = { + "type": controller.model.device_type, + "contacts": { + "name": controller.model.apply_name, + "phone": controller.model.tel, + }, + "device": [ + { + "mac": controller.model.device_id, + "desc": controller.model.desc, + "img": controller.model.issue_img, + "category": controller.model.device_category, + "series": controller.model.device_series, + "name": controller.model.device_name + } + ], + }; + ApiResponse apiResponse = await requestWithLog( + logTitle: "提交报修信息", + method: MyHttpMethod.post, + queryUrl: queryUrl, + data: data, + onSuccess: (res) { TopSlideNotification.show(context, - text: msg, + text: res.msg!); + repairListController.getRepairList(); + Get.toNamed("/applyRepairSuccess"); + }, + onFailure: (res) { + TopSlideNotification.show(context, + text: res.msg!, textColor: themeController.currentColor.sc9); - } else { - String serviceAddress = - ServiceConstant.service_address; - String serviceName = - ServiceConstant.server_service; - String serviceApi = - ServiceConstant.submit_repair; - String queryUrl = - "$serviceAddress$serviceName$serviceApi"; - var data = { - "type": controller.model.device_type, - "contacts": { - "name": controller.model.apply_name, - "phone": controller.model.tel, - }, - "device": [ - { - "mac": controller.model.device_id, - "desc": controller.model.desc, - "img": controller.model.issue_img, - "category": - controller.model.device_category, - "series": controller.model.device_series, - "name": controller.model.device_name - } - ], - }; - ApiResponse apiResponse = await requestWithLog( - logTitle: "提交报修信息", - method: MyHttpMethod.post, - queryUrl: queryUrl, - data: data, - onSuccess: (res) { - TopSlideNotification.show(context, - text: res.msg!); - repairListController.getRepairList(); - Get.toNamed("/applyRepairSuccess"); - }, - onFailure: (res) { - TopSlideNotification.show(context, - text: res.msg!, - textColor: - themeController.currentColor.sc9); - }, - ); - controller.model = - ApplyRepairModel(); // 在 submitRepair 完成后执行 - controller.updateAll(); - } - }, - colors: const [ - Color(0xFFFCFCFC), - Color(0xFFF8FAF9), - Color(0XFFECF6F3), - Color(0XFFD9F0E9), - Color(0xFFCEECE3) - ], - child: Container( - width: double.infinity, - height: 90.rpx, - alignment: Alignment.center, - decoration: BoxDecoration( - borderRadius: BorderRadius.circular(6), - ), - child: Text( - "提交申请", - style: TextStyle( - fontFamily: 'Readex Pro', - color: stringToColor("#011D33"), - letterSpacing: 0, - fontSize: 30.rpx, - ), - ), + }, + ); + controller.model = + ApplyRepairModel(); // 在 submitRepair 完成后执行 + controller.updateAll(); + } + }, + colors: const [ + Color(0xFFFCFCFC), + Color(0xFFF8FAF9), + Color(0XFFECF6F3), + Color(0XFFD9F0E9), + Color(0xFFCEECE3) + ], + child: Container( + width: double.infinity, + height: 90.rpx, + alignment: Alignment.center, + decoration: BoxDecoration( + borderRadius: BorderRadius.circular(6), + ), + child: Text( + "提交申请", + style: TextStyle( + fontFamily: 'Readex Pro', + color: stringToColor("#011D33"), + letterSpacing: 0, + fontSize: 30.rpx, ), - )), - ), - ], + ), + ), + )), ), - ), + ], ), - )); + ), + ), + )); }); } diff --git a/lib/pages/mh_page/bluetooth.dart b/lib/pages/mh_page/bluetooth.dart index 771fd2b..89a30dc 100644 --- a/lib/pages/mh_page/bluetooth.dart +++ b/lib/pages/mh_page/bluetooth.dart @@ -67,7 +67,7 @@ class _BluetoothPageState extends State { bodysize = cc; final isBind = obsData['bind_type'] == 1; return GestureDetector( - onTap: () => FocusScope.of(context).unfocus(), + // onTap: () => FocusScope.of(context).unfocus(),, child: Container( decoration: const BoxDecoration( image: DecorationImage( diff --git a/lib/pages/mh_page/book_info_page.dart b/lib/pages/mh_page/book_info_page.dart index 17eceaf..af4de27 100644 --- a/lib/pages/mh_page/book_info_page.dart +++ b/lib/pages/mh_page/book_info_page.dart @@ -29,7 +29,7 @@ class BookInfoPage extends GetView { @override Widget build(BuildContext context) { return GestureDetector( - onTap: () => FocusScope.of(context).unfocus(), + // onTap: () => FocusScope.of(context).unfocus(),, child: Container( decoration: const BoxDecoration( image: DecorationImage( diff --git a/lib/pages/mh_page/book_success_page.dart b/lib/pages/mh_page/book_success_page.dart index df5c257..85f1ab7 100644 --- a/lib/pages/mh_page/book_success_page.dart +++ b/lib/pages/mh_page/book_success_page.dart @@ -24,203 +24,202 @@ class BookSuccessPage extends GetView { return LayoutBuilder(builder: (context, cc) { bodysize = cc; return GestureDetector( - onTap: () => FocusScope.of(context).unfocus(), + // onTap: () => FocusScope.of(context).unfocus(),, child: Container( - decoration: const BoxDecoration( - image: DecorationImage( - image: AssetImage('assets/images/new_background.png'), // 本地图片 - fit: BoxFit.fill, // 填满整个 Container + decoration: const BoxDecoration( + image: DecorationImage( + image: AssetImage('assets/images/new_background.png'), // 本地图片 + fit: BoxFit.fill, // 填满整个 Container + ), + ), + child: Scaffold( + // key: scaffoldKey, + backgroundColor: Colors.transparent, + appBar: AppBar( + backgroundColor: Colors.transparent, + automaticallyImplyLeading: false, + iconTheme: IconThemeData(color: Colors.white), + titleSpacing: 0, + // leading: returnIconButtomAddCallback(() { + // controller.saveDataApi(); + // updateParm(isShowToast: false); + // }), + // leading: returnIconButtomNew, + title: Container( + width: double.infinity, + height: 180.rpx, + child: Stack( + alignment: Alignment.center, + children: [ + // 中间居中的标题 + Text( + '我要预约', + textAlign: TextAlign.center, + style: TextStyle( + color: Colors.white, + fontSize: 30.rpx, + ), + ), + // 左侧图标 + Positioned( + left: 0.rpx, + child: returnIconButtomNew, + ), + ], ), ), - child: Scaffold( - // key: scaffoldKey, - backgroundColor: Colors.transparent, - appBar: AppBar( - backgroundColor: Colors.transparent, - automaticallyImplyLeading: false, - iconTheme: IconThemeData(color: Colors.white), - titleSpacing: 0, - // leading: returnIconButtomAddCallback(() { - // controller.saveDataApi(); - // updateParm(isShowToast: false); - // }), - // leading: returnIconButtomNew, - title: Container( - width: double.infinity, - height: 180.rpx, - child: Stack( - alignment: Alignment.center, + + actions: [], + centerTitle: false, + ), + + body: Container( + width: bodysize!.maxWidth, + height: bodysize!.maxHeight * 1, + child: Column( + mainAxisSize: MainAxisSize.max, + children: [ + Container( + width: bodysize!.maxWidth, + margin: EdgeInsets.only(top: 90.rpx), + child: Column( + mainAxisSize: MainAxisSize.max, children: [ - // 中间居中的标题 - Text( - '我要预约', - textAlign: TextAlign.center, - style: TextStyle( - color: Colors.white, - fontSize: 30.rpx, + Container( + width: 148.rpx, + height: 148.rpx, + clipBehavior: Clip.antiAlias, + decoration: const BoxDecoration( + shape: BoxShape.circle, + ), + child: Image.asset( + 'assets/images/success.png', + fit: BoxFit.contain, + color: Color(0xFF84F5FF), ), ), - // 左侧图标 - Positioned( - left: 0.rpx, - child: returnIconButtomNew, + Align( + alignment: const AlignmentDirectional(0, 0), + child: Text( + '预约成功!', + style: TextStyle( + fontFamily: 'Readex Pro', + fontSize: 30.rpx, + color: Colors.white, + letterSpacing: 0, + fontWeight: FontWeight.w600, + ), + ), ), - ], + ].divide(SizedBox(height: 30.rpx)), ), ), - - actions: [], - centerTitle: false, - ), - - body: Container( - width: bodysize!.maxWidth, - height: bodysize!.maxHeight * 1, - child: Column( - mainAxisSize: MainAxisSize.max, - children: [ - Container( - width: bodysize!.maxWidth, - margin: EdgeInsets.only(top: 90.rpx), + Container( + margin: + EdgeInsets.only(left: 30.rpx, right: 30.rpx, top: 55.rpx), + width: bodysize!.maxWidth, + decoration: BoxDecoration( + color: Color(0xFF003058), + borderRadius: BorderRadius.circular(16.rpx), + ), + child: SingleChildScrollView( child: Column( - mainAxisSize: MainAxisSize.max, - children: [ - Container( - width: 148.rpx, - height: 148.rpx, - clipBehavior: Clip.antiAlias, - decoration: const BoxDecoration( - shape: BoxShape.circle, - ), - child: Image.asset( - 'assets/images/success.png', - fit: BoxFit.contain, - color: Color(0xFF84F5FF), - ), - ), - Align( - alignment: const AlignmentDirectional(0, 0), - child: Text( - '预约成功!', - style: TextStyle( - fontFamily: 'Readex Pro', - fontSize: 30.rpx, - color: Colors.white, - letterSpacing: 0, - fontWeight: FontWeight.w600, - ), - ), - ), - ].divide(SizedBox(height: 30.rpx)), - ), - ), - Container( - margin: EdgeInsets.only( - left: 30.rpx, right: 30.rpx, top: 55.rpx), - width: bodysize!.maxWidth, - decoration: BoxDecoration( - color: Color(0xFF003058), - borderRadius: BorderRadius.circular(16.rpx), - ), - child: SingleChildScrollView( - child: Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - SizedBox(height: 20), // 上间距 - for (var item in infoList) - Container( - height: 60.rpx, - padding: - EdgeInsets.symmetric(horizontal: 35.rpx), - alignment: Alignment.centerLeft, - child: Row( - children: [ - Text( - item['label']!, - style: TextStyle( - color: Color(0XFF929699), - fontSize: 26.rpx, - ), - ), - SizedBox(width: 30.rpx), - Text( - item['value']!, - style: TextStyle( - color: Colors.white, - fontSize: 26.rpx, - ), - ), - ], - )), - - SizedBox(height: 60.rpx), // 空间隔断 - Padding( - padding: EdgeInsets.symmetric(horizontal: 35), + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + SizedBox(height: 20), // 上间距 + for (var item in infoList) + Container( + height: 60.rpx, + padding: EdgeInsets.symmetric(horizontal: 35.rpx), + alignment: Alignment.centerLeft, child: Row( - mainAxisAlignment: MainAxisAlignment.center, children: [ - SizedBox( - width: 200.rpx, - height: 60.rpx, - child: ElevatedButton( - style: ElevatedButton.styleFrom( - backgroundColor: Color(0xFF84F5FF), - padding: EdgeInsets.zero, // 去除文字内边距 - tapTargetSize: MaterialTapTargetSize - .shrinkWrap, // 去除额外点击区域 - // shape: - // RoundedRectangleBorder(), // 可选:去除默认圆角 - ), - onPressed: () {}, - child: Center( - // 保证文字居中 - child: Text( - "关闭", - style: TextStyle( - color: Color(0XFF011D33), - fontSize: 26.rpx, - ), - ), - ), - )), - SizedBox(width: 60.rpx), - SizedBox( - width: 200.rpx, - height: 60.rpx, - child: ElevatedButton( - style: ElevatedButton.styleFrom( - backgroundColor: Color(0xFF84F5FF), - padding: EdgeInsets.zero, // 去除文字内边距 - tapTargetSize: MaterialTapTargetSize - .shrinkWrap, // 去除额外点击区域 - // shape: - // RoundedRectangleBorder(), // 可选:去除默认圆角 - ), - onPressed: () {}, - child: Center( - // 保证文字居中 - child: Text( - "我的预约", - style: TextStyle( - color: Color(0XFF011D33), - fontSize: 26.rpx, - ), - ), - ), - )) + Text( + item['label']!, + style: TextStyle( + color: Color(0XFF929699), + fontSize: 26.rpx, + ), + ), + SizedBox(width: 30.rpx), + Text( + item['value']!, + style: TextStyle( + color: Colors.white, + fontSize: 26.rpx, + ), + ), ], - ), - ), + )), - SizedBox(height: 80.rpx), // 下间距 - ], - )), - ), - ], + SizedBox(height: 60.rpx), // 空间隔断 + Padding( + padding: EdgeInsets.symmetric(horizontal: 35), + child: Row( + mainAxisAlignment: MainAxisAlignment.center, + children: [ + SizedBox( + width: 200.rpx, + height: 60.rpx, + child: ElevatedButton( + style: ElevatedButton.styleFrom( + backgroundColor: Color(0xFF84F5FF), + padding: EdgeInsets.zero, // 去除文字内边距 + tapTargetSize: MaterialTapTargetSize + .shrinkWrap, // 去除额外点击区域 + // shape: + // RoundedRectangleBorder(), // 可选:去除默认圆角 + ), + onPressed: () {}, + child: Center( + // 保证文字居中 + child: Text( + "关闭", + style: TextStyle( + color: Color(0XFF011D33), + fontSize: 26.rpx, + ), + ), + ), + )), + SizedBox(width: 60.rpx), + SizedBox( + width: 200.rpx, + height: 60.rpx, + child: ElevatedButton( + style: ElevatedButton.styleFrom( + backgroundColor: Color(0xFF84F5FF), + padding: EdgeInsets.zero, // 去除文字内边距 + tapTargetSize: MaterialTapTargetSize + .shrinkWrap, // 去除额外点击区域 + // shape: + // RoundedRectangleBorder(), // 可选:去除默认圆角 + ), + onPressed: () {}, + child: Center( + // 保证文字居中 + child: Text( + "我的预约", + style: TextStyle( + color: Color(0XFF011D33), + fontSize: 26.rpx, + ), + ), + ), + )) + ], + ), + ), + + SizedBox(height: 80.rpx), // 下间距 + ], + )), ), - ), + ], ), - )); + ), + ), + )); }); } } diff --git a/lib/pages/mh_page/delete_account.dart b/lib/pages/mh_page/delete_account.dart index 146bfac..53aedd7 100644 --- a/lib/pages/mh_page/delete_account.dart +++ b/lib/pages/mh_page/delete_account.dart @@ -18,305 +18,296 @@ class DeletedAccountPage extends GetView { bodysize = cc; return GestureDetector( - onTap: () => FocusScope.of(context).unfocus(), + // onTap: () => FocusScope.of(context).unfocus(),, child: Container( - decoration: const BoxDecoration( - image: DecorationImage( - image: AssetImage('assets/images/new_background.png'), // 本地图片 - fit: BoxFit.fill, // 填满整个 Container + decoration: const BoxDecoration( + image: DecorationImage( + image: AssetImage('assets/images/new_background.png'), // 本地图片 + fit: BoxFit.fill, // 填满整个 Container + ), + ), + child: Scaffold( + appBar: AppBar( + backgroundColor: Colors.transparent, + automaticallyImplyLeading: false, + iconTheme: const IconThemeData(color: Colors.white), + titleSpacing: 0, + title: SizedBox( + width: double.infinity, + height: 180.rpx, + child: Stack( + alignment: Alignment.center, + children: [ + // 中间居中的标题 + Text( + '注销账号', + textAlign: TextAlign.center, + style: TextStyle( + color: Colors.white, + fontSize: 30.rpx, + ), + ), + // 左侧图标 + Positioned( + left: 0.rpx, + child: returnIconButtomNew, + ), + ], ), ), - child: Scaffold( - appBar: AppBar( - backgroundColor: Colors.transparent, - automaticallyImplyLeading: false, - iconTheme: const IconThemeData(color: Colors.white), - titleSpacing: 0, - title: SizedBox( - width: double.infinity, - height: 180.rpx, - child: Stack( - alignment: Alignment.center, - children: [ - // 中间居中的标题 - Text( - '注销账号', - textAlign: TextAlign.center, - style: TextStyle( - color: Colors.white, - fontSize: 30.rpx, - ), - ), - // 左侧图标 - Positioned( - left: 0.rpx, - child: returnIconButtomNew, - ), - ], - ), - ), - centerTitle: false, - ), - key: scaffoldKey, - backgroundColor: Colors.transparent, - body: Container( - width: bodysize!.maxWidth, - height: bodysize!.maxHeight * 1, - decoration: const BoxDecoration(), - child: Column( - mainAxisSize: MainAxisSize.max, - children: [ - Expanded( - child: Container( - width: MediaQuery.sizeOf(context).width, - height: 100, - child: SingleChildScrollView( - child: Column( - mainAxisSize: MainAxisSize.max, - children: [ - Padding( + centerTitle: false, + ), + key: scaffoldKey, + backgroundColor: Colors.transparent, + body: Container( + width: bodysize!.maxWidth, + height: bodysize!.maxHeight * 1, + decoration: const BoxDecoration(), + child: Column( + mainAxisSize: MainAxisSize.max, + children: [ + Expanded( + child: Container( + width: MediaQuery.sizeOf(context).width, + height: 100, + child: SingleChildScrollView( + child: Column( + mainAxisSize: MainAxisSize.max, + children: [ + Padding( + padding: const EdgeInsetsDirectional.fromSTEB( + 15, 33, 15, 0), + child: Container( + width: MediaQuery.sizeOf(context).width, + decoration: BoxDecoration( + borderRadius: BorderRadius.circular(12), + ), + child: Padding( padding: const EdgeInsetsDirectional.fromSTEB( - 15, 33, 15, 0), + 21, 0, 22, 0), child: Container( width: MediaQuery.sizeOf(context).width, - decoration: BoxDecoration( - borderRadius: BorderRadius.circular(12), - ), - child: Padding( - padding: - const EdgeInsetsDirectional.fromSTEB( - 21, 0, 22, 0), - child: Container( - width: MediaQuery.sizeOf(context).width, - child: SingleChildScrollView( - child: Column( - mainAxisSize: MainAxisSize.max, + child: SingleChildScrollView( + child: Column( + mainAxisSize: MainAxisSize.max, + mainAxisAlignment: + MainAxisAlignment.spaceBetween, + crossAxisAlignment: + CrossAxisAlignment.center, + children: [ + Container( + width: 50, + height: 50, + child: Image.asset( + 'assets/images/delete_account.png', + fit: BoxFit.cover, + color: Color(0XFF84F5FF), + ), + ), + const Text( + "注销智慧眠花糖账号", + style: TextStyle( + fontSize: 20, // 设置字体大小 + color: Color(0xFFFFFFFF), + // decoration: TextDecoration.underline, // 添加下划线 + ), + ), + Container( + child: Column( mainAxisAlignment: MainAxisAlignment.spaceBetween, crossAxisAlignment: - CrossAxisAlignment.center, + CrossAxisAlignment.start, children: [ - Container( - width: 50, - height: 50, - child: Image.asset( - 'assets/images/delete_account.png', - fit: BoxFit.cover, - color: Color(0XFF84F5FF), - ), - ), - const Text( - "注销智慧眠花糖账号", - style: TextStyle( - fontSize: 20, // 设置字体大小 - color: Color(0xFFFFFFFF), - // decoration: TextDecoration.underline, // 添加下划线 - ), - ), - Container( - child: Column( - mainAxisAlignment: - MainAxisAlignment - .spaceBetween, - crossAxisAlignment: - CrossAxisAlignment.start, - children: [ - RichText( - text: TextSpan( - text: "账号注销后,你将无法使用以下功能,", + RichText( + text: TextSpan( + text: "账号注销后,你将无法使用以下功能,", + style: TextStyle( + fontSize: AppFontsize + .normal_text_size, // 设置字体大小 + color: + Color(0xFF9AA0B3), // 默认颜色 + ), + children: [ + TextSpan( + text: + "并且当前有绑定以及被分享的智能床、智能床垫等设备的账号不能注销", style: TextStyle( fontSize: AppFontsize - .normal_text_size, // 设置字体大小 - color: Color( - 0xFF9AA0B3), // 默认颜色 + .normal_text_size, + color: const Color( + 0xFFFF7159), // 设置为#E45E91的颜色 ), - children: [ - TextSpan( - text: - "并且当前有绑定以及被分享的智能床、智能床垫等设备的账号不能注销", - style: TextStyle( - fontSize: AppFontsize - .normal_text_size, - color: const Color( - 0xFFFF7159), // 设置为#E45E91的颜色 - ), - ), - TextSpan( - text: - ",可先进行解绑后再进行注销操作。", - style: TextStyle( - fontSize: AppFontsize - .normal_text_size, - color: - Color(0xFF9AA0B3), - ), - ), - ], ), - ), - const SizedBox( - height: 24, - ), - Text( - "无法控制智能床、智能床垫等设备", - style: TextStyle( - fontSize: AppFontsize - .title_size, // 设置字体大小 - color: - const Color(0xFFFFFFFF), + TextSpan( + text: ",可先进行解绑后再进行注销操作。", + style: TextStyle( + fontSize: AppFontsize + .normal_text_size, + color: Color(0xFF9AA0B3), + ), ), - ), - const SizedBox( - height: 6, - ), - Text( - "你将无法控制你的智能床、智能床垫等设备,以及与其相关的各种操作。", - style: TextStyle( - fontSize: AppFontsize - .normal_text_size, // 设置字体大小 - color: Color(0xFF9AA0B3), - ), - ), - const SizedBox( - height: 24, - ), - Text( - "无法查询睡眠报告和体征数据", - style: TextStyle( - fontSize: AppFontsize - .title_size, // 设置字体大小 - color: - const Color(0xFFFFFFFF), - ), - ), - const SizedBox( - height: 6, - ), - Text( - "注销账号后你将查询不到你以前的睡眠报告和实时数据。", - style: TextStyle( - fontSize: AppFontsize - .normal_text_size, // 设置字体大小 - color: Color(0xFF9AA0B3), - ), - ), - const SizedBox( - height: 24, - ), - Text( - "无法使用的其他功能", - style: TextStyle( - fontSize: AppFontsize - .title_size, // 设置字体大小 - color: - const Color(0xFFFFFFFF), - ), - ), - const SizedBox( - height: 6, - ), - Text( - "包含设备报修、门店体验预约等。", - style: TextStyle( - fontSize: AppFontsize - .normal_text_size, // 设置字体大小 - color: Color(0xFF9AA0B3), - ), - ), - ], - )), - ] - .divide( - const SizedBox(height: 24)) - .addToStart( - const SizedBox(height: 14)) - .addToEnd( - const SizedBox(height: 17)), - ), - ), + ], + ), + ), + const SizedBox( + height: 24, + ), + Text( + "无法控制智能床、智能床垫等设备", + style: TextStyle( + fontSize: AppFontsize + .title_size, // 设置字体大小 + color: const Color(0xFFFFFFFF), + ), + ), + const SizedBox( + height: 6, + ), + Text( + "你将无法控制你的智能床、智能床垫等设备,以及与其相关的各种操作。", + style: TextStyle( + fontSize: AppFontsize + .normal_text_size, // 设置字体大小 + color: Color(0xFF9AA0B3), + ), + ), + const SizedBox( + height: 24, + ), + Text( + "无法查询睡眠报告和体征数据", + style: TextStyle( + fontSize: AppFontsize + .title_size, // 设置字体大小 + color: const Color(0xFFFFFFFF), + ), + ), + const SizedBox( + height: 6, + ), + Text( + "注销账号后你将查询不到你以前的睡眠报告和实时数据。", + style: TextStyle( + fontSize: AppFontsize + .normal_text_size, // 设置字体大小 + color: Color(0xFF9AA0B3), + ), + ), + const SizedBox( + height: 24, + ), + Text( + "无法使用的其他功能", + style: TextStyle( + fontSize: AppFontsize + .title_size, // 设置字体大小 + color: const Color(0xFFFFFFFF), + ), + ), + const SizedBox( + height: 6, + ), + Text( + "包含设备报修、门店体验预约等。", + style: TextStyle( + fontSize: AppFontsize + .normal_text_size, // 设置字体大小 + color: Color(0xFF9AA0B3), + ), + ), + ], + )), + ] + .divide(const SizedBox(height: 24)) + .addToStart( + const SizedBox(height: 14)) + .addToEnd(const SizedBox(height: 17)), ), ), ), ), - ], - ), - ), - ), - ), - Padding( - padding: EdgeInsetsDirectional.fromSTEB( - 15, 0, 15, AppConstants.page_button_bottom_padding), - child: Container( - width: bodysize!.maxWidth, - height: bodysize!.maxHeight * 0.056, - // decoration: BoxDecoration( - // color: - // FlutterFlowTheme.of(context).secondaryBackground, - // ), - child: Container( - width: bodysize!.maxWidth, - height: bodysize!.maxHeight * 0.056, - decoration: BoxDecoration( - // color: FlutterFlowTheme.of(context) - // .secondaryBackground, - borderRadius: BorderRadius.circular(12), - ), - child: FFButtonWidget( - onPressed: () async { - // showCustomConfirmDialog(context, "是否确认注销?") - // .then((v) async { - // if (v != "confirm") { - // return; - // } - // LoginController loginController = Get.find(); - // UserInfoController userInfoController = - // Get.find(); - // var code = await loginController.deletedAccount(); - // if (code != null && code == 1) { - // final box = GetStorage(); - // box.remove('user'); - // box.remove('token'); - // userInfoController.model.token = null; - // userInfoController.model.user = null; - // userInfoController.model.login = 0; - // userInfoController.model.message = 0; - // GlobalController globalController = - // Get.find(); - // globalController.resetParmAll(); - // Get.offAllNamed("/loginPage"); - // } - // }); - }, - text: '注销账号', - options: FFButtonOptions( - height: 40, - padding: const EdgeInsetsDirectional.fromSTEB( - 24, 0, 24, 0), - iconPadding: const EdgeInsetsDirectional.fromSTEB( - 0, 0, 0, 0), - color: const Color(0xFFFF7159), - textStyle: TextStyle( - fontFamily: 'Readex Pro', - color: Colors.white, - fontSize: AppFontsize.normal_text_size, - letterSpacing: 0, - ), - elevation: 0, - borderSide: const BorderSide( - color: Colors.transparent, - width: 1, - ), - borderRadius: BorderRadius.circular(8), ), ), + ], + ), + ), + ), + ), + Padding( + padding: EdgeInsetsDirectional.fromSTEB( + 15, 0, 15, AppConstants.page_button_bottom_padding), + child: Container( + width: bodysize!.maxWidth, + height: bodysize!.maxHeight * 0.056, + // decoration: BoxDecoration( + // color: + // FlutterFlowTheme.of(context).secondaryBackground, + // ), + child: Container( + width: bodysize!.maxWidth, + height: bodysize!.maxHeight * 0.056, + decoration: BoxDecoration( + // color: FlutterFlowTheme.of(context) + // .secondaryBackground, + borderRadius: BorderRadius.circular(12), + ), + child: FFButtonWidget( + onPressed: () async { + // showCustomConfirmDialog(context, "是否确认注销?") + // .then((v) async { + // if (v != "confirm") { + // return; + // } + // LoginController loginController = Get.find(); + // UserInfoController userInfoController = + // Get.find(); + // var code = await loginController.deletedAccount(); + // if (code != null && code == 1) { + // final box = GetStorage(); + // box.remove('user'); + // box.remove('token'); + // userInfoController.model.token = null; + // userInfoController.model.user = null; + // userInfoController.model.login = 0; + // userInfoController.model.message = 0; + // GlobalController globalController = + // Get.find(); + // globalController.resetParmAll(); + // Get.offAllNamed("/loginPage"); + // } + // }); + }, + text: '注销账号', + options: FFButtonOptions( + height: 40, + padding: const EdgeInsetsDirectional.fromSTEB( + 24, 0, 24, 0), + iconPadding: + const EdgeInsetsDirectional.fromSTEB(0, 0, 0, 0), + color: const Color(0xFFFF7159), + textStyle: TextStyle( + fontFamily: 'Readex Pro', + color: Colors.white, + fontSize: AppFontsize.normal_text_size, + letterSpacing: 0, + ), + elevation: 0, + borderSide: const BorderSide( + color: Colors.transparent, + width: 1, + ), + borderRadius: BorderRadius.circular(8), ), ), ), - ], + ), ), - ), + ], ), - )); + ), + ), + )); }); } diff --git a/lib/pages/mh_page/device/mht_bind_device_success.dart b/lib/pages/mh_page/device/mht_bind_device_success.dart index e1d19a6..8296a27 100644 --- a/lib/pages/mh_page/device/mht_bind_device_success.dart +++ b/lib/pages/mh_page/device/mht_bind_device_success.dart @@ -41,7 +41,7 @@ class _MHTBindDeviceSuccessState extends State { Widget build(BuildContext context) { return LayoutBuilder( builder: (context, bodySize) => GestureDetector( - onTap: () => FocusScope.of(context).unfocus(), + // onTap: () => FocusScope.of(context).unfocus(),, child: Container( decoration: BoxDecoration( image: DecorationImage( diff --git a/lib/pages/mh_page/device/mht_bind_device_type.dart b/lib/pages/mh_page/device/mht_bind_device_type.dart index ed059a1..0a17878 100644 --- a/lib/pages/mh_page/device/mht_bind_device_type.dart +++ b/lib/pages/mh_page/device/mht_bind_device_type.dart @@ -50,7 +50,7 @@ class _MHTBindDeviceTypePageState extends State { } return LayoutBuilder( builder: (context, bodySize) => GestureDetector( - onTap: () => FocusScope.of(context).unfocus(), + // onTap: () => FocusScope.of(context).unfocus(),, child: Container( decoration: BoxDecoration( image: DecorationImage( diff --git a/lib/pages/mh_page/device/mht_blueteeth_device_page.dart b/lib/pages/mh_page/device/mht_blueteeth_device_page.dart index c19d92b..5070eb9 100644 --- a/lib/pages/mh_page/device/mht_blueteeth_device_page.dart +++ b/lib/pages/mh_page/device/mht_blueteeth_device_page.dart @@ -209,7 +209,7 @@ class _MHTBlueteethDevicePageState extends State { ef.log("$e"); } finally { setState(() { - isScanning = false; + isScanning = false; }); } } @@ -287,7 +287,7 @@ class _MHTBlueteethDevicePageState extends State { Widget build(BuildContext context) { return LayoutBuilder( builder: (context, boxConstraints) => GestureDetector( - onTap: () => FocusScope.of(context).unfocus(), + // onTap: () => FocusScope.of(context).unfocus(),, child: Container( decoration: BoxDecoration( image: DecorationImage( diff --git a/lib/pages/mh_page/device/mht_device_calibration copy.dart b/lib/pages/mh_page/device/mht_device_calibration copy.dart index ff62d60..2e67f69 100644 --- a/lib/pages/mh_page/device/mht_device_calibration copy.dart +++ b/lib/pages/mh_page/device/mht_device_calibration copy.dart @@ -64,7 +64,7 @@ class _MHTCalibrationPageCopyState extends State { return WillPopScope( child: LayoutBuilder( builder: (context, bodySize) => GestureDetector( - onTap: () => FocusScope.of(context).unfocus(), + // onTap: () => FocusScope.of(context).unfocus(),, child: Container( decoration: BoxDecoration( image: DecorationImage( diff --git a/lib/pages/mh_page/device/mht_device_calibration.dart b/lib/pages/mh_page/device/mht_device_calibration.dart index e938fe8..533cfe7 100644 --- a/lib/pages/mh_page/device/mht_device_calibration.dart +++ b/lib/pages/mh_page/device/mht_device_calibration.dart @@ -73,7 +73,7 @@ class _MHTCalibrationPageState extends State { return WillPopScope( child: LayoutBuilder( builder: (context, bodySize) => GestureDetector( - onTap: () => FocusScope.of(context).unfocus(), + // onTap: () => FocusScope.of(context).unfocus(),, child: Container( decoration: const BoxDecoration( image: DecorationImage( diff --git a/lib/pages/mh_page/device/mht_wifi_page.dart b/lib/pages/mh_page/device/mht_wifi_page.dart index 24d0321..09bdbca 100644 --- a/lib/pages/mh_page/device/mht_wifi_page.dart +++ b/lib/pages/mh_page/device/mht_wifi_page.dart @@ -108,7 +108,8 @@ class _MHTWifiPageState extends State { // 导航到下一页 if (blueteethBindController.wifiStatus.value != 1) { - showConfirmDialog(context, Container(), "未配置网络提示".tr, onConfirm: () async { + showConfirmDialog(context, Container(), "未配置网络提示".tr, + onConfirm: () async { _cleanupResources(); await _disconnectDevice(); Get.toNamed("/calibrationPage"); @@ -124,7 +125,7 @@ class _MHTWifiPageState extends State { Widget build(BuildContext context) { return LayoutBuilder( builder: (context, bodySize) => GestureDetector( - onTap: () => FocusScope.of(context).unfocus(), + // onTap: () => FocusScope.of(context).unfocus(),, child: Container( decoration: BoxDecoration( image: DecorationImage( @@ -1104,7 +1105,7 @@ class _MHTWifiPageState extends State { ); } - Future _disconnectDevice() async { + Future _disconnectDevice() async { try { THapp bledevice = THapp(device: widget.deviceInfo.scanResult.device); await bledevice.disconnect(); diff --git a/lib/pages/mh_page/device_list.dart b/lib/pages/mh_page/device_list.dart index 973be21..475da32 100644 --- a/lib/pages/mh_page/device_list.dart +++ b/lib/pages/mh_page/device_list.dart @@ -33,107 +33,107 @@ class _DeviceListPageState extends State { return LayoutBuilder(builder: (context, cc) { bodysize = cc; return GestureDetector( - onTap: () => FocusScope.of(context).unfocus(), + // onTap: () => FocusScope.of(context).unfocus(),, child: Container( - decoration: const BoxDecoration( - image: DecorationImage( - image: AssetImage('assets/images/new_background.png'), // 本地图片 - fit: BoxFit.fill, // 填满整个 Container + decoration: const BoxDecoration( + image: DecorationImage( + image: AssetImage('assets/images/new_background.png'), // 本地图片 + fit: BoxFit.fill, // 填满整个 Container + ), + ), + child: Scaffold( + resizeToAvoidBottomInset: false, + appBar: AppBar( + backgroundColor: Colors.transparent, + automaticallyImplyLeading: false, + iconTheme: IconThemeData(color: Colors.white), + titleSpacing: 0, + // leading: returnIconButtomAddCallback(() { + // controller.saveDataApi(); + // updateParm(isShowToast: false); + // }), + // leading: returnIconButtomNew, + title: Container( + width: double.infinity, + height: 180.rpx, + child: Stack( + alignment: Alignment.center, + children: [ + // 中间居中的标题 + Text( + '设备列表', + textAlign: TextAlign.center, + style: TextStyle( + color: Colors.white, + fontSize: 30.rpx, + ), + ), + // 左侧图标 + Positioned( + left: 0.rpx, + child: returnIconButtomNew, + ), + ], + ), ), + + actions: [], + centerTitle: false, ), - child: Scaffold( - resizeToAvoidBottomInset: false, - appBar: AppBar( - backgroundColor: Colors.transparent, - automaticallyImplyLeading: false, - iconTheme: IconThemeData(color: Colors.white), - titleSpacing: 0, - // leading: returnIconButtomAddCallback(() { - // controller.saveDataApi(); - // updateParm(isShowToast: false); - // }), - // leading: returnIconButtomNew, - title: Container( - width: double.infinity, - height: 180.rpx, - child: Stack( - alignment: Alignment.center, - children: [ - // 中间居中的标题 - Text( - '设备列表', - textAlign: TextAlign.center, - style: TextStyle( - color: Colors.white, - fontSize: 30.rpx, - ), - ), - // 左侧图标 - Positioned( - left: 0.rpx, - child: returnIconButtomNew, - ), - ], + backgroundColor: Colors.transparent, + body: Container( + child: Column( + mainAxisSize: MainAxisSize.max, + children: [ + Padding( + padding: EdgeInsetsDirectional.fromSTEB(0, 10, 0, 23), + child: SearchWidget( + keyword: controller.model.keyword, + color: controller.model.color, + hint: "检索设备", + onChange: (d) { + controller.model.keyword = d; + }, + findCallback: () { + controller.getDeviceList(); + }, ), ), + Obx(() { + if (controller.model.deviceList == null || + controller.model.deviceList.isEmpty) { + return Expanded(child: NullDataWidget()); + } - actions: [], - centerTitle: false, - ), - backgroundColor: Colors.transparent, - body: Container( - child: Column( - mainAxisSize: MainAxisSize.max, - children: [ - Padding( - padding: EdgeInsetsDirectional.fromSTEB(0, 10, 0, 23), - child: SearchWidget( - keyword: controller.model.keyword, - color: controller.model.color, - hint: "检索设备", - onChange: (d) { - controller.model.keyword = d; - }, - findCallback: () { - controller.getDeviceList(); - }, - ), + // 如果 deviceList 不为空,渲染列表 + return Expanded( + child: ListView( + shrinkWrap: true, + scrollDirection: Axis.vertical, + children: controller.model.deviceList + .asMap() + .entries + .map((e) => DeviceInfoWidget( + index: e.key, + deviceListController: controller, + )) + .toList() + .divide(const SizedBox(height: 10)) + .addToEnd(const SizedBox(height: 100)), ), - Obx(() { - if (controller.model.deviceList == null || - controller.model.deviceList.isEmpty) { - return Expanded(child: NullDataWidget()); - } + ); + }), + ], + ), + ) - // 如果 deviceList 不为空,渲染列表 - return Expanded( - child: ListView( - shrinkWrap: true, - scrollDirection: Axis.vertical, - children: controller.model.deviceList - .asMap() - .entries - .map((e) => DeviceInfoWidget( - index: e.key, - deviceListController: controller, - )) - .toList() - .divide(const SizedBox(height: 10)) - .addToEnd(const SizedBox(height: 100)), - ), - ); - }), - ], - ), - ) + // Container( + // width: bodysize!.maxWidth, + // height: bodysize!.maxHeight, - // Container( - // width: bodysize!.maxWidth, - // height: bodysize!.maxHeight, - - // ), - ), - )); + // ), + ), + )); }); } } diff --git a/lib/pages/mh_page/device_people_info.dart b/lib/pages/mh_page/device_people_info.dart index 864d427..10286c8 100644 --- a/lib/pages/mh_page/device_people_info.dart +++ b/lib/pages/mh_page/device_people_info.dart @@ -36,177 +36,176 @@ class DevicePeopleInfo extends GetView { @override Widget build(BuildContext context) { WidgetsBinding.instance.addPostFrameCallback((_) { - controller.getPeoples (data['mac']); + controller.getPeoples(data['mac']); }); return LayoutBuilder( builder: (context, boxConstraints) => GestureDetector( - onTap: () => FocusScope.of(context).unfocus(), + // onTap: () => FocusScope.of(context).unfocus(),, child: Container( - decoration: const BoxDecoration( - image: DecorationImage( - image: AssetImage('assets/images/new_background.png'), // 本地图片 - fit: BoxFit.fill, // 填满整个 Container - ), - ), - child: Scaffold( + decoration: const BoxDecoration( + image: DecorationImage( + image: AssetImage('assets/images/new_background.png'), // 本地图片 + fit: BoxFit.fill, // 填满整个 Container + ), + ), + child: Scaffold( + backgroundColor: Colors.transparent, + appBar: AppBar( + backgroundColor: Colors.transparent, + automaticallyImplyLeading: false, + iconTheme: IconThemeData(color: Colors.white), + titleSpacing: 0, + title: AppBar( backgroundColor: Colors.transparent, - appBar: AppBar( - backgroundColor: Colors.transparent, - automaticallyImplyLeading: false, - iconTheme: IconThemeData(color: Colors.white), - titleSpacing: 0, - title: AppBar( - backgroundColor: Colors.transparent, - iconTheme: const IconThemeData(color: Colors.white), - automaticallyImplyLeading: false, - titleSpacing: 0, - title: SizedBox( - width: double.infinity, - height: 180.rpx, - child: Stack( - alignment: Alignment.center, - children: [ - // 中间居中的标题 - Text( - '详情', - textAlign: TextAlign.center, - style: TextStyle( - color: Colors.white, - fontSize: 30.rpx, - ), - ), - // 左侧图标 - Positioned( - left: 0.rpx, - child: returnIconButtomNew, - ), - ], - ), - ), - centerTitle: false, - ), - actions: [], - centerTitle: false, - ), - body: SafeArea( - top: true, - child: Obx( - () => Container( - padding: EdgeInsets.only( - left: 30.rpx, right: 30.rpx, top: 30.rpx), - width: MediaQuery.sizeOf(context).width, - height: MediaQuery.sizeOf(context).height * 1.123, - // decoration: BoxDecoration( - // // color: AppColors.bg_color, - // image: DecorationImage( - // image: AssetImage("assets/images/background.png"), - // fit: BoxFit.cover, - // ), - // ), - child: SingleChildScrollView( - child: Column( - mainAxisSize: MainAxisSize.max, - children: [ - ClickableContainer( - backgroundColor: Color(0xFFFF036060), - highlightColor: Colors.transparent, - borderRadius: 16.rpx, - padding: EdgeInsets.fromLTRB( - 30.rpx, 20.rpx, 0, 20.rpx), - onTap: () {}, - child: Container( - decoration: BoxDecoration( - borderRadius: - BorderRadius.circular(16.rpx)), - child: Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - Container( - alignment: Alignment.centerLeft, - child: Text( - '设备信息', - style: TextStyle( - fontFamily: 'Readex Pro', - color: Colors.white, - fontSize: 30.rpx, - ), - ), - ), - getInfoRow( - context, "名称:${data["name"] ?? "-"}"), - getInfoRow(context, - "房间:${data["roomName"] ?? "-"}"), - getInfoRow( - context, - "设备状态:${data["status"]?["status"] == 1 ? "已绑定" : data["status"]?["status"] == 0 ? "已绑定" : "-"}", - ), - getInfoRow( - context, "MAC:${data["mac"] ?? "-"}"), - ], - ), - )), - if (controller.model.peopleList.isNotEmpty) - ...List.generate(controller.model.peopleList.length, - (index) { - final person = controller.model.peopleList[index]; - // String location_ = ''; - // if ("${data["bindMacB"]}".length > 6 && - // (person["direction"] == 1 || - // person["direction"] == 2)) { - // location_ = - // person["direction"] == 1 ? '左侧' : '右侧'; - // } - - return ClickableContainer( - backgroundColor: Color(0xFF003058), - highlightColor: Color(0xFF036060), - borderRadius: 16.rpx, - padding: EdgeInsets.fromLTRB( - 30.rpx, 20.rpx, 30.rpx, 20.rpx), - onTap: () {}, - child: Column( - children: [ - Container( - width: double.infinity, - alignment: Alignment.centerLeft, - child: Text( - '人员资料${index == 0 ? "A" : "B"}', - style: TextStyle( - fontFamily: 'Readex Pro', - color: Colors.white, - fontSize: 32.rpx, - letterSpacing: 0, - ), - ), - ), - getInfoRow( - context, "姓名:${person["name"] ?? "-"}"), - getInfoRow(context, - "性别:${person["gender"] == null ? "-" : (person["gender"] == 1 ? "男" : "女")}"), - getInfoRow(context, - "身高:${person["height"] == null ? "-" : "${person["height"]}cm"}"), - getInfoRow(context, - "体重:${person["weight"] == null ? "-" : "${person["weight"]}kg"}"), - getInfoRow(context, - "生日:${person["birthday"] == null ? "-" : time_08_Formatter_pattern(person["birthday"], "yyyy年MM月dd日")}"), - getInfoRow( - context, "电话:${person["tel"] ?? "-"}"), - getInfoRow(context, - "紧急联系人:${person["contact"] ?? "-"}"), - ], - ), - ); - }) - ].divide(SizedBox( - height: 25.rpx, - )), + iconTheme: const IconThemeData(color: Colors.white), + automaticallyImplyLeading: false, + titleSpacing: 0, + title: SizedBox( + width: double.infinity, + height: 180.rpx, + child: Stack( + alignment: Alignment.center, + children: [ + // 中间居中的标题 + Text( + '详情', + textAlign: TextAlign.center, + style: TextStyle( + color: Colors.white, + fontSize: 30.rpx, ), ), + // 左侧图标 + Positioned( + left: 0.rpx, + child: returnIconButtomNew, + ), + ], + ), + ), + centerTitle: false, + ), + actions: [], + centerTitle: false, + ), + body: SafeArea( + top: true, + child: Obx( + () => Container( + padding: + EdgeInsets.only(left: 30.rpx, right: 30.rpx, top: 30.rpx), + width: MediaQuery.sizeOf(context).width, + height: MediaQuery.sizeOf(context).height * 1.123, + // decoration: BoxDecoration( + // // color: AppColors.bg_color, + // image: DecorationImage( + // image: AssetImage("assets/images/background.png"), + // fit: BoxFit.cover, + // ), + // ), + child: SingleChildScrollView( + child: Column( + mainAxisSize: MainAxisSize.max, + children: [ + ClickableContainer( + backgroundColor: Color(0xFFFF036060), + highlightColor: Colors.transparent, + borderRadius: 16.rpx, + padding: + EdgeInsets.fromLTRB(30.rpx, 20.rpx, 0, 20.rpx), + onTap: () {}, + child: Container( + decoration: BoxDecoration( + borderRadius: BorderRadius.circular(16.rpx)), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Container( + alignment: Alignment.centerLeft, + child: Text( + '设备信息', + style: TextStyle( + fontFamily: 'Readex Pro', + color: Colors.white, + fontSize: 30.rpx, + ), + ), + ), + getInfoRow( + context, "名称:${data["name"] ?? "-"}"), + getInfoRow( + context, "房间:${data["roomName"] ?? "-"}"), + getInfoRow( + context, + "设备状态:${data["status"]?["status"] == 1 ? "已绑定" : data["status"]?["status"] == 0 ? "已绑定" : "-"}", + ), + getInfoRow( + context, "MAC:${data["mac"] ?? "-"}"), + ], + ), + )), + if (controller.model.peopleList.isNotEmpty) + ...List.generate(controller.model.peopleList.length, + (index) { + final person = controller.model.peopleList[index]; + // String location_ = ''; + // if ("${data["bindMacB"]}".length > 6 && + // (person["direction"] == 1 || + // person["direction"] == 2)) { + // location_ = + // person["direction"] == 1 ? '左侧' : '右侧'; + // } + + return ClickableContainer( + backgroundColor: Color(0xFF003058), + highlightColor: Color(0xFF036060), + borderRadius: 16.rpx, + padding: EdgeInsets.fromLTRB( + 30.rpx, 20.rpx, 30.rpx, 20.rpx), + onTap: () {}, + child: Column( + children: [ + Container( + width: double.infinity, + alignment: Alignment.centerLeft, + child: Text( + '人员资料${index == 0 ? "A" : "B"}', + style: TextStyle( + fontFamily: 'Readex Pro', + color: Colors.white, + fontSize: 32.rpx, + letterSpacing: 0, + ), + ), + ), + getInfoRow( + context, "姓名:${person["name"] ?? "-"}"), + getInfoRow(context, + "性别:${person["gender"] == null ? "-" : (person["gender"] == 1 ? "男" : "女")}"), + getInfoRow(context, + "身高:${person["height"] == null ? "-" : "${person["height"]}cm"}"), + getInfoRow(context, + "体重:${person["weight"] == null ? "-" : "${person["weight"]}kg"}"), + getInfoRow(context, + "生日:${person["birthday"] == null ? "-" : time_08_Formatter_pattern(person["birthday"], "yyyy年MM月dd日")}"), + getInfoRow( + context, "电话:${person["tel"] ?? "-"}"), + getInfoRow(context, + "紧急联系人:${person["contact"] ?? "-"}"), + ], + ), + ); + }) + ].divide(SizedBox( + height: 25.rpx, + )), ), ), ), ), - )), + ), + ), + )), ); } } diff --git a/lib/pages/mh_page/device_share_page.dart b/lib/pages/mh_page/device_share_page.dart index 19f5ebd..6136d13 100644 --- a/lib/pages/mh_page/device_share_page.dart +++ b/lib/pages/mh_page/device_share_page.dart @@ -29,605 +29,589 @@ class ShareDeviceWidget extends GetView { controller.model.type = 1; controller.model.account = ''; return GestureDetector( - onTap: () => FocusScope.of(context).unfocus(), + // onTap: () => FocusScope.of(context).unfocus(),, child: Container( - decoration: const BoxDecoration( - image: DecorationImage( - image: AssetImage('assets/images/new_background.png'), // 本地图片 - fit: BoxFit.fill, // 填满整个 Container - ), - ), - child: Scaffold( - appBar: AppBar( - backgroundColor: Colors.transparent, - automaticallyImplyLeading: false, - iconTheme: const IconThemeData(color: Colors.white), - titleSpacing: 0, - title: Container( - width: double.infinity, - height: 180.rpx, - child: Stack( - alignment: Alignment.center, - children: [ - // 中间居中的标题 - Text( - '分享设备', - textAlign: TextAlign.center, - style: TextStyle( - color: Colors.white, - fontSize: 30.rpx, - ), - ), - // 左侧图标 - Positioned( - left: 0.rpx, - child: returnIconButtomNew, - ), - ], + decoration: const BoxDecoration( + image: DecorationImage( + image: AssetImage('assets/images/new_background.png'), // 本地图片 + fit: BoxFit.fill, // 填满整个 Container + ), + ), + child: Scaffold( + appBar: AppBar( + backgroundColor: Colors.transparent, + automaticallyImplyLeading: false, + iconTheme: const IconThemeData(color: Colors.white), + titleSpacing: 0, + title: Container( + width: double.infinity, + height: 180.rpx, + child: Stack( + alignment: Alignment.center, + children: [ + // 中间居中的标题 + Text( + '分享设备', + textAlign: TextAlign.center, + style: TextStyle( + color: Colors.white, + fontSize: 30.rpx, + ), ), - ), - actions: [], - centerTitle: false, + // 左侧图标 + Positioned( + left: 0.rpx, + child: returnIconButtomNew, + ), + ], ), - key: scaffoldKey, - backgroundColor: Colors.transparent, - body: SingleChildScrollView( - child: Container( - width: MediaQuery.sizeOf(context).width, - height: MediaQuery.sizeOf(context).height * 1, - child: Padding( - padding: - EdgeInsetsDirectional.fromSTEB(30.rpx, 0, 30.rpx, 0), - child: Column( - mainAxisSize: MainAxisSize.max, - children: [ - Padding( - padding: - EdgeInsetsDirectional.fromSTEB(0, 30.rpx, 0, 0), - child: Container( - width: MediaQuery.sizeOf(context).width, - decoration: BoxDecoration( - color: const Color(0xFF003058), - borderRadius: BorderRadius.circular(16.rpx), - ), - child: Padding( - padding: EdgeInsetsDirectional.fromSTEB( - 30.rpx, 49.rpx, 30.rpx, 80.rpx), - child: Column( + ), + actions: [], + centerTitle: false, + ), + key: scaffoldKey, + backgroundColor: Colors.transparent, + body: SingleChildScrollView( + child: Container( + width: MediaQuery.sizeOf(context).width, + height: MediaQuery.sizeOf(context).height * 1, + child: Padding( + padding: EdgeInsetsDirectional.fromSTEB(30.rpx, 0, 30.rpx, 0), + child: Column( + mainAxisSize: MainAxisSize.max, + children: [ + Padding( + padding: EdgeInsetsDirectional.fromSTEB(0, 30.rpx, 0, 0), + child: Container( + width: MediaQuery.sizeOf(context).width, + decoration: BoxDecoration( + color: const Color(0xFF003058), + borderRadius: BorderRadius.circular(16.rpx), + ), + child: Padding( + padding: EdgeInsetsDirectional.fromSTEB( + 30.rpx, 49.rpx, 30.rpx, 80.rpx), + child: Column( + mainAxisSize: MainAxisSize.max, + crossAxisAlignment: CrossAxisAlignment.center, + children: [ + Column( mainAxisSize: MainAxisSize.max, crossAxisAlignment: CrossAxisAlignment.center, children: [ - Column( + Text( + '将以下设备分享给您的家人或朋友 ', + style: TextStyle( + fontFamily: 'Readex Pro', + color: Colors.white, + fontSize: 30.rpx, + letterSpacing: 0.0, + height: 1, + ), + ), + Text( + '设备ID:${data['mac']}', + style: TextStyle( + fontFamily: 'Readex Pro', + color: const Color(0xFF6BFDAC), + fontSize: 26.rpx, + letterSpacing: 0.0, + height: 1), + ), + ].divide(SizedBox(height: 65.rpx)), + ), + Padding( + padding: EdgeInsetsDirectional.fromSTEB( + 0, 80.rpx, 0, 0), + child: Container( + width: MediaQuery.sizeOf(context).width, + constraints: const BoxConstraints( + minHeight: 46, + ), + decoration: BoxDecoration( + borderRadius: BorderRadius.circular(16.rpx), + ), + child: Align( + alignment: + const AlignmentDirectional(0, 0), + child: Form( + key: _formKey, + child: TextFormField( + controller: _phoneController, + textAlign: TextAlign.center, + decoration: InputDecoration( + hintText: '请输入对方手机号/邮箱号', + hintStyle: TextStyle( + fontFamily: 'Readex Pro', + color: const Color(0xFF929699), + fontSize: 36.rpx, + ), + enabledBorder: + const UnderlineInputBorder( + borderSide: BorderSide( + color: Color(0xFF929699), + width: 0), + ), + focusedBorder: + const UnderlineInputBorder( + borderSide: BorderSide( + color: Color(0xFF929699), + width: 0), + ), + errorBorder: + const UnderlineInputBorder( + borderSide: BorderSide( + color: Colors.red, width: 0), + ), + focusedErrorBorder: + const UnderlineInputBorder( + borderSide: BorderSide( + color: Colors.redAccent, + width: 0), + ), + contentPadding: + const EdgeInsets.only( + left: 10, bottom: 5), + ), + style: TextStyle( + fontFamily: 'Readex Pro', + color: Colors.white, + fontSize: 36.rpx, + ), + onChanged: (value) { + controller.model.account = value; + }, + ), + )), + ), + ), + ClickableContainer( + backgroundColor: Colors.transparent, + highlightColor: Colors.transparent, + padding: EdgeInsets.only(top: 30.rpx), + onTap: () {}, + child: Container( + decoration: const BoxDecoration( + border: Border( + bottom: BorderSide( + color: Color(0xFF85F5FF), + width: 0), // 下边线 + ), + ), + child: Text( + '点击复制APP下载链接', + style: TextStyle( + color: Color(0xFF85F5FF), // 蓝色文字 + + fontSize: 22.rpx, + ), + ), + )), + GestureDetector( + onTap: () { + // 当点击时,将 type 设置为 0(允许控制) + controller.model.type = 1; + controller.updateAll(); + }, + child: Container( + margin: EdgeInsets.only(top: 76.rpx), + width: MediaQuery.sizeOf(context).width, + constraints: const BoxConstraints( + minHeight: 46, + ), + decoration: BoxDecoration( + borderRadius: BorderRadius.circular(0), + ), + child: Row( mainAxisSize: MainAxisSize.max, - crossAxisAlignment: - CrossAxisAlignment.center, + mainAxisAlignment: + MainAxisAlignment.spaceBetween, children: [ Text( - '将以下设备分享给您的家人或朋友 ', + '允许对方控制和查看该设备'.tr, style: TextStyle( + fontFamily: 'Readex Pro', + color: Colors.white, + fontSize: 26.rpx, + letterSpacing: 0.0, + ), + ), + Obx(() { + double h = 33.rpx; + bool check = controller.model.type == 1; + + return Container( + height: 33.rpx, + child: AspectRatio( + aspectRatio: 1, + child: Center( + child: Container( + height: h, + width: h, + decoration: BoxDecoration( + borderRadius: + BorderRadius.circular( + h / 2), + border: Border.all( + width: check ? 1 : 0.5, + color: Color(0xFFC8CBD2), + ), + ), + child: check + ? Center( + child: ClipOval( + child: Container( + width: h * 0.6, + height: h * 0.6, + color: const Color( + 0xFF6BFDAC), + ), + ), + ) + : null, + ), + ), + ), + ); + }), + ], + ), + ), + ), + + // Obx( + // () => GestureDetector( + // onTap: () { + // controller.model.type = 2; + // controller.updateAll(); + // }, + // child: Container( + // width: MediaQuery.sizeOf(context).width, + // constraints: const BoxConstraints( + // minHeight: 46, + // ), + // decoration: BoxDecoration( + // borderRadius: + // BorderRadius.circular(0), + // ), + // child: Row( + // mainAxisSize: MainAxisSize.max, + // mainAxisAlignment: + // MainAxisAlignment.spaceBetween, + // children: [ + // Text( + // '仅允许对方查看该设备'.tr, + // style: TextStyle( + // fontFamily: 'Readex Pro', + // color: Colors.white, + // fontSize: 26.rpx, + // letterSpacing: 0.0, + // ), + // ), + // // Theme( + // // data: + // // Theme.of(context).copyWith( + // // unselectedWidgetColor: Color( + // // 0xFFC8CBD2), // 改变未选中状态边框颜色 + // // ), + // // child: Radio( + // // value: 2, + // // groupValue: + // // controller.model.type, + // // onChanged: (value) { + // // controller.model.type = + // // value!; + // // controller.updateAll(); + // // }, + // // activeColor: + // // const Color(0xFF6BFDAC), + // // materialTapTargetSize: + // // MaterialTapTargetSize + // // .shrinkWrap, // 减少内边距 + // // visualDensity: VisualDensity( + // // horizontal: -4, + // // vertical: -4), // 缩小视觉密度 + // // )) + // ClipOval( + // child: Container( + // height: + // MediaQuery.sizeOf(context) + // .height * + // 0.0449, + // child: AspectRatio( + // aspectRatio: 1, + // child: Center( + // child: LayoutBuilder( + // builder: (context, + // constraints) { + // double h = + // MediaQuery.sizeOf( + // context) + // .height * + // 0.0326; + // bool check = controller + // .model.type == + // 2; + // if (check) { + // return Container( + // height: h, + // width: h, + // decoration: + // BoxDecoration( + // borderRadius: + // BorderRadius + // .circular( + // h / 2), + // border: Border.all( + // width: 1, + // color: Color( + // 0xFF6BFDAC)), + // ), + // child: Center( + // child: ClipOval( + // child: Container( + // width: + // h * 0.6, + // height: + // h * 0.6, + // color: Color( + // 0xFF6BFDAC)), + // ), + // ), + // ); + // } else { + // return Container( + // height: h, + // width: h, + // decoration: + // BoxDecoration( + // borderRadius: + // BorderRadius + // .circular( + // h / 2), + // border: Border.all( + // width: 0.5, + // color: Colors + // .white), + // ), + // ); + // } + // }, + // ), + // ), + // ), + // ), + // ), + // ], + // ), + // ), + // ), + // ), + GestureDetector( + onTap: () { + controller.model.type = 2; + controller.updateAll(); + }, + child: Container( + width: MediaQuery.sizeOf(context).width, + constraints: + const BoxConstraints(minHeight: 46), + decoration: BoxDecoration( + borderRadius: BorderRadius.circular(0), + ), + child: Row( + mainAxisSize: MainAxisSize.max, + mainAxisAlignment: + MainAxisAlignment.spaceBetween, + children: [ + Text( + '仅允许对方查看该设备'.tr, + style: TextStyle( + fontFamily: 'Readex Pro', + color: Colors.white, + fontSize: 26.rpx, + letterSpacing: 0.0, + ), + ), + // ✅ 只包住响应式控件部分 + Obx(() { + double h = 33.rpx; + bool check = controller.model.type == 2; + + return Container( + height: 33.rpx, + child: AspectRatio( + aspectRatio: 1, + child: Center( + child: Container( + height: h, + width: h, + decoration: BoxDecoration( + borderRadius: + BorderRadius.circular( + h / 2), + border: Border.all( + width: check ? 1 : 0.5, + color: Color(0xFFC8CBD2), + ), + ), + child: check + ? Center( + child: ClipOval( + child: Container( + width: h * 0.6, + height: h * 0.6, + color: const Color( + 0xFF6BFDAC), + ), + ), + ) + : null, + ), + ), + ), + ); + }), + ], + ), + ), + ), + + Align( + alignment: const AlignmentDirectional(0, 0), + child: Padding( + padding: EdgeInsetsDirectional.fromSTEB( + 0, 46.rpx, 0, 0), + child: Container( + width: 108, + height: 31, + decoration: BoxDecoration(), + child: FFButtonWidget( + onPressed: () async { + //todo 1:验证用户是否存在 2:发送邀请 + ApiResponse apiResponse = + await controller + .shareDevice(data['mac']); + if (apiResponse.code == + HttpStatusCodes.ok) { + TopSlideNotification.show(context, + text: apiResponse.msg!); + } else { + TopSlideNotification.show(context, + text: apiResponse.msg!, + textColor: themeController + .currentColor.sc9); + } + }, + text: '发送邀请'.tr, + options: FFButtonOptions( + height: 60.rpx, + padding: EdgeInsetsDirectional.fromSTEB( + 30.rpx, 0, 30.rpx, 0), + color: const Color(0xFF84F5FF), + textStyle: TextStyle( + fontFamily: 'Readex Pro', + color: Color(0xFF011D33), + fontSize: 26.rpx, + letterSpacing: 0.0, + ), + elevation: 0, + borderRadius: BorderRadius.circular(50), + ), + ), + ), + ), + ), + ], + ), + ), + ), + ), + Expanded( + child: Padding( + padding: EdgeInsetsDirectional.fromSTEB( + 0, 100.rpx, 0, 32.rpx), + child: Container( + width: MediaQuery.sizeOf(context).width, + child: SingleChildScrollView( + child: Column( + mainAxisSize: MainAxisSize.max, + children: [ + Align( + alignment: const AlignmentDirectional(-1, 0), + child: Padding( + padding: + const EdgeInsetsDirectional.fromSTEB( + 14, 0, 0, 16), + child: Text( + '已分享用户'.tr, + style: TextStyle( fontFamily: 'Readex Pro', color: Colors.white, fontSize: 30.rpx, letterSpacing: 0.0, - height: 1, - ), - ), - Text( - '设备ID:${data['mac']}', - style: TextStyle( - fontFamily: 'Readex Pro', - color: const Color(0xFF6BFDAC), - fontSize: 26.rpx, - letterSpacing: 0.0, - height: 1), - ), - ].divide(SizedBox(height: 65.rpx)), - ), - Padding( - padding: EdgeInsetsDirectional.fromSTEB( - 0, 80.rpx, 0, 0), - child: Container( - width: MediaQuery.sizeOf(context).width, - constraints: const BoxConstraints( - minHeight: 46, - ), - decoration: BoxDecoration( - borderRadius: - BorderRadius.circular(16.rpx), - ), - child: Align( - alignment: - const AlignmentDirectional(0, 0), - child: Form( - key: _formKey, - child: TextFormField( - controller: _phoneController, - textAlign: TextAlign.center, - decoration: InputDecoration( - hintText: '请输入对方手机号/邮箱号', - hintStyle: TextStyle( - fontFamily: 'Readex Pro', - color: - const Color(0xFF929699), - fontSize: 36.rpx, - ), - enabledBorder: - const UnderlineInputBorder( - borderSide: BorderSide( - color: Color(0xFF929699), - width: 0), - ), - focusedBorder: - const UnderlineInputBorder( - borderSide: BorderSide( - color: Color(0xFF929699), - width: 0), - ), - errorBorder: - const UnderlineInputBorder( - borderSide: BorderSide( - color: Colors.red, - width: 0), - ), - focusedErrorBorder: - const UnderlineInputBorder( - borderSide: BorderSide( - color: Colors.redAccent, - width: 0), - ), - contentPadding: - const EdgeInsets.only( - left: 10, bottom: 5), - ), - style: TextStyle( - fontFamily: 'Readex Pro', - color: Colors.white, - fontSize: 36.rpx, - ), - onChanged: (value) { - controller.model.account = - value; - }, - ), - )), + height: 1), ), ), - ClickableContainer( - backgroundColor: Colors.transparent, - highlightColor: Colors.transparent, - padding: EdgeInsets.only(top: 30.rpx), - onTap: () {}, - child: Container( - decoration: const BoxDecoration( - border: Border( - bottom: BorderSide( - color: Color(0xFF85F5FF), - width: 0), // 下边线 - ), - ), - child: Text( - '点击复制APP下载链接', - style: TextStyle( - color: Color(0xFF85F5FF), // 蓝色文字 - - fontSize: 22.rpx, - ), - ), - )), - GestureDetector( - onTap: () { - // 当点击时,将 type 设置为 0(允许控制) - controller.model.type = 1; - controller.updateAll(); - }, - child: Container( - margin: EdgeInsets.only(top: 76.rpx), - width: MediaQuery.sizeOf(context).width, - constraints: const BoxConstraints( - minHeight: 46, - ), - decoration: BoxDecoration( - borderRadius: BorderRadius.circular(0), - ), - child: Row( - mainAxisSize: MainAxisSize.max, - mainAxisAlignment: - MainAxisAlignment.spaceBetween, - children: [ - Text( - '允许对方控制和查看该设备'.tr, - style: TextStyle( - fontFamily: 'Readex Pro', - color: Colors.white, - fontSize: 26.rpx, - letterSpacing: 0.0, - ), - ), - Obx(() { - double h = 33.rpx; - bool check = - controller.model.type == 1; - - return Container( - height: 33.rpx, - child: AspectRatio( - aspectRatio: 1, - child: Center( - child: Container( - height: h, - width: h, - decoration: BoxDecoration( - borderRadius: - BorderRadius.circular( - h / 2), - border: Border.all( - width: check ? 1 : 0.5, - color: - Color(0xFFC8CBD2), - ), - ), - child: check - ? Center( - child: ClipOval( - child: Container( - width: h * 0.6, - height: h * 0.6, - color: const Color( - 0xFF6BFDAC), - ), - ), - ) - : null, - ), - ), - ), - ); - }), - ], - ), - ), - ), - - // Obx( - // () => GestureDetector( - // onTap: () { - // controller.model.type = 2; - // controller.updateAll(); - // }, - // child: Container( - // width: MediaQuery.sizeOf(context).width, - // constraints: const BoxConstraints( - // minHeight: 46, - // ), - // decoration: BoxDecoration( - // borderRadius: - // BorderRadius.circular(0), - // ), - // child: Row( - // mainAxisSize: MainAxisSize.max, - // mainAxisAlignment: - // MainAxisAlignment.spaceBetween, - // children: [ - // Text( - // '仅允许对方查看该设备'.tr, - // style: TextStyle( - // fontFamily: 'Readex Pro', - // color: Colors.white, - // fontSize: 26.rpx, - // letterSpacing: 0.0, - // ), - // ), - // // Theme( - // // data: - // // Theme.of(context).copyWith( - // // unselectedWidgetColor: Color( - // // 0xFFC8CBD2), // 改变未选中状态边框颜色 - // // ), - // // child: Radio( - // // value: 2, - // // groupValue: - // // controller.model.type, - // // onChanged: (value) { - // // controller.model.type = - // // value!; - // // controller.updateAll(); - // // }, - // // activeColor: - // // const Color(0xFF6BFDAC), - // // materialTapTargetSize: - // // MaterialTapTargetSize - // // .shrinkWrap, // 减少内边距 - // // visualDensity: VisualDensity( - // // horizontal: -4, - // // vertical: -4), // 缩小视觉密度 - // // )) - // ClipOval( - // child: Container( - // height: - // MediaQuery.sizeOf(context) - // .height * - // 0.0449, - // child: AspectRatio( - // aspectRatio: 1, - // child: Center( - // child: LayoutBuilder( - // builder: (context, - // constraints) { - // double h = - // MediaQuery.sizeOf( - // context) - // .height * - // 0.0326; - // bool check = controller - // .model.type == - // 2; - // if (check) { - // return Container( - // height: h, - // width: h, - // decoration: - // BoxDecoration( - // borderRadius: - // BorderRadius - // .circular( - // h / 2), - // border: Border.all( - // width: 1, - // color: Color( - // 0xFF6BFDAC)), - // ), - // child: Center( - // child: ClipOval( - // child: Container( - // width: - // h * 0.6, - // height: - // h * 0.6, - // color: Color( - // 0xFF6BFDAC)), - // ), - // ), - // ); - // } else { - // return Container( - // height: h, - // width: h, - // decoration: - // BoxDecoration( - // borderRadius: - // BorderRadius - // .circular( - // h / 2), - // border: Border.all( - // width: 0.5, - // color: Colors - // .white), - // ), - // ); - // } - // }, - // ), - // ), - // ), - // ), - // ), - // ], - // ), - // ), - // ), - // ), - GestureDetector( - onTap: () { - controller.model.type = 2; - controller.updateAll(); - }, - child: Container( - width: MediaQuery.sizeOf(context).width, - constraints: - const BoxConstraints(minHeight: 46), - decoration: BoxDecoration( - borderRadius: BorderRadius.circular(0), - ), - child: Row( - mainAxisSize: MainAxisSize.max, - mainAxisAlignment: - MainAxisAlignment.spaceBetween, - children: [ - Text( - '仅允许对方查看该设备'.tr, - style: TextStyle( - fontFamily: 'Readex Pro', - color: Colors.white, - fontSize: 26.rpx, - letterSpacing: 0.0, - ), - ), - // ✅ 只包住响应式控件部分 - Obx(() { - double h = 33.rpx; - bool check = - controller.model.type == 2; - - return Container( - height: 33.rpx, - child: AspectRatio( - aspectRatio: 1, - child: Center( - child: Container( - height: h, - width: h, - decoration: BoxDecoration( - borderRadius: - BorderRadius.circular( - h / 2), - border: Border.all( - width: check ? 1 : 0.5, - color: - Color(0xFFC8CBD2), - ), - ), - child: check - ? Center( - child: ClipOval( - child: Container( - width: h * 0.6, - height: h * 0.6, - color: const Color( - 0xFF6BFDAC), - ), - ), - ) - : null, - ), - ), - ), - ); - }), - ], - ), - ), - ), - - Align( - alignment: const AlignmentDirectional(0, 0), - child: Padding( - padding: EdgeInsetsDirectional.fromSTEB( - 0, 46.rpx, 0, 0), - child: Container( - width: 108, - height: 31, - decoration: BoxDecoration(), - child: FFButtonWidget( - onPressed: () async { - //todo 1:验证用户是否存在 2:发送邀请 - ApiResponse apiResponse = - await controller - .shareDevice(data['mac']); - if (apiResponse.code == - HttpStatusCodes.ok) { - TopSlideNotification.show(context, - text: apiResponse.msg!); - } else { - TopSlideNotification.show(context, - text: apiResponse.msg!, - textColor: themeController - .currentColor.sc9); - } - }, - text: '发送邀请'.tr, - options: FFButtonOptions( - height: 60.rpx, - padding: - EdgeInsetsDirectional.fromSTEB( - 30.rpx, 0, 30.rpx, 0), - color: const Color(0xFF84F5FF), - textStyle: TextStyle( - fontFamily: 'Readex Pro', - color: Color(0xFF011D33), - fontSize: 26.rpx, - letterSpacing: 0.0, - ), - elevation: 0, - borderRadius: - BorderRadius.circular(50), - ), - ), - ), - ), - ), - ], - ), - ), - ), - ), - Expanded( - child: Padding( - padding: EdgeInsetsDirectional.fromSTEB( - 0, 100.rpx, 0, 32.rpx), - child: Container( - width: MediaQuery.sizeOf(context).width, - child: SingleChildScrollView( - child: Column( - mainAxisSize: MainAxisSize.max, - children: [ - Align( - alignment: - const AlignmentDirectional(-1, 0), - child: Padding( - padding: const EdgeInsetsDirectional - .fromSTEB(14, 0, 0, 16), - child: Text( - '已分享用户'.tr, - style: TextStyle( - fontFamily: 'Readex Pro', - color: Colors.white, - fontSize: 30.rpx, - letterSpacing: 0.0, - height: 1), - ), - ), - ), - Obx( - () { - // 检查 shareUser 是否为空或数量为 0 - if (controller.model.shareUser == - null || - controller - .model.shareUser!.isEmpty) { - // return Container( - // alignment: AlignmentDirectional - // .centerStart, // 确保文字靠左对齐 - // padding: EdgeInsets.symmetric( - // horizontal: 16.0), // 根据需要设置内边距 - // child: Text( - // "暂无分享!", - // textAlign: TextAlign.left, // 文字左对齐 - // style: FlutterFlowTheme.of(context) - // .bodyMedium, // 可根据需要自定义样式 - // ), - // ); - return NullDataWidget(); - // EmptyMessageWidget( - // imagePath: - // "assets/images/emptyUser.png", - // ); - } - - // 否则显示正常的 ListView - return ListView( - controller: - scrollController, // 绑定 ScrollController - shrinkWrap: true, - scrollDirection: Axis.vertical, - children: (controller.model.shareUser! - .asMap() - .entries - .map((e) => ShareUserWidget( - index: e.key, - repairListController: - controller)) - .toList() as List) - // .divide(const SizedBox( - // height: 13, - // )) - .addToEnd(const SizedBox( - height: - AppConstants.list_end_height, - )), - ); - }, - ), - ], ), - ), + Obx( + () { + // 检查 shareUser 是否为空或数量为 0 + if (controller.model.shareUser == null || + controller.model.shareUser!.isEmpty) { + // return Container( + // alignment: AlignmentDirectional + // .centerStart, // 确保文字靠左对齐 + // padding: EdgeInsets.symmetric( + // horizontal: 16.0), // 根据需要设置内边距 + // child: Text( + // "暂无分享!", + // textAlign: TextAlign.left, // 文字左对齐 + // style: FlutterFlowTheme.of(context) + // .bodyMedium, // 可根据需要自定义样式 + // ), + // ); + return NullDataWidget(); + // EmptyMessageWidget( + // imagePath: + // "assets/images/emptyUser.png", + // ); + } + + // 否则显示正常的 ListView + return ListView( + controller: + scrollController, // 绑定 ScrollController + shrinkWrap: true, + scrollDirection: Axis.vertical, + children: (controller.model.shareUser! + .asMap() + .entries + .map((e) => ShareUserWidget( + index: e.key, + repairListController: + controller)) + .toList() as List) + // .divide(const SizedBox( + // height: 13, + // )) + .addToEnd(const SizedBox( + height: AppConstants.list_end_height, + )), + ); + }, + ), + ], ), ), ), - ], + ), ), - ), + ], ), - )), - )); + ), + ), + )), + )); } } diff --git a/lib/pages/mh_page/edit_address_page.dart b/lib/pages/mh_page/edit_address_page.dart index 3e8b36a..171d9c9 100644 --- a/lib/pages/mh_page/edit_address_page.dart +++ b/lib/pages/mh_page/edit_address_page.dart @@ -47,7 +47,7 @@ class EditAddressPage extends GetView return LayoutBuilder(builder: (context, cc) { bodysize = cc; return GestureDetector( - onTap: () => FocusScope.of(context).unfocus(), + // onTap: () => FocusScope.of(context).unfocus(),, child: Container( decoration: const BoxDecoration( image: DecorationImage( diff --git a/lib/pages/mh_page/experience_store_page.dart b/lib/pages/mh_page/experience_store_page.dart index 760e8b9..5dd4e0f 100644 --- a/lib/pages/mh_page/experience_store_page.dart +++ b/lib/pages/mh_page/experience_store_page.dart @@ -62,133 +62,130 @@ class _ExperienceStorePageState extends State { bodysize = cc; return GestureDetector( - onTap: () => FocusScope.of(context).unfocus(), + // onTap: () => FocusScope.of(context).unfocus(),, child: Container( - decoration: const BoxDecoration( - image: DecorationImage( - image: AssetImage('assets/images/new_background.png'), // 本地图片 - fit: BoxFit.fill, // 填满整个 Container - ), - ), - child: Scaffold( - // key: scaffoldKey, - backgroundColor: Colors.transparent, - appBar: AppBar( - backgroundColor: Colors.transparent, - automaticallyImplyLeading: false, - iconTheme: IconThemeData(color: Colors.white), - titleSpacing: 0, - title: SizedBox( - width: double.infinity, - height: 180.rpx, - child: Stack( - alignment: Alignment.center, - children: [ - // 中间居中的标题 - Text( - '预约体验', - textAlign: TextAlign.center, - style: TextStyle( - color: Colors.white, - fontSize: 30.rpx, - ), - ), - // 左侧图标 - Positioned( - left: 0.rpx, - child: returnIconButtomNew, - ), - Positioned( - right: 30.rpx, - child: ClickableContainer( - backgroundColor: Colors.transparent, - highlightColor: Color(0xFF055466), - padding: EdgeInsets.only(left: 0), - onTap: () { - TopSlideNotification.show(context, - text: "待开发功能".tr); - // Get.toNamed("/myExperiencePage"); - }, - child: SvgPicture.asset( - 'assets/img/icon/history_store.svg', - width: 35.rpx, - height: 35.rpx, - color: Colors.white, - ))) - ], + decoration: const BoxDecoration( + image: DecorationImage( + image: AssetImage('assets/images/new_background.png'), // 本地图片 + fit: BoxFit.fill, // 填满整个 Container + ), + ), + child: Scaffold( + // key: scaffoldKey, + backgroundColor: Colors.transparent, + appBar: AppBar( + backgroundColor: Colors.transparent, + automaticallyImplyLeading: false, + iconTheme: IconThemeData(color: Colors.white), + titleSpacing: 0, + title: SizedBox( + width: double.infinity, + height: 180.rpx, + child: Stack( + alignment: Alignment.center, + children: [ + // 中间居中的标题 + Text( + '预约体验', + textAlign: TextAlign.center, + style: TextStyle( + color: Colors.white, + fontSize: 30.rpx, + ), ), - ), - centerTitle: false, + // 左侧图标 + Positioned( + left: 0.rpx, + child: returnIconButtomNew, + ), + Positioned( + right: 30.rpx, + child: ClickableContainer( + backgroundColor: Colors.transparent, + highlightColor: Color(0xFF055466), + padding: EdgeInsets.only(left: 0), + onTap: () { + TopSlideNotification.show(context, + text: "待开发功能".tr); + // Get.toNamed("/myExperiencePage"); + }, + child: SvgPicture.asset( + 'assets/img/icon/history_store.svg', + width: 35.rpx, + height: 35.rpx, + color: Colors.white, + ))) + ], ), - body: SingleChildScrollView( - child: Container( - width: bodysize!.maxWidth, - height: bodysize!.maxHeight * 1, - child: Column( - mainAxisSize: MainAxisSize.max, - children: [ - //todo + ), + centerTitle: false, + ), + body: SingleChildScrollView( + child: Container( + width: bodysize!.maxWidth, + height: bodysize!.maxHeight * 1, + child: Column( + mainAxisSize: MainAxisSize.max, + children: [ + //todo - Padding( - padding: EdgeInsetsDirectional.fromSTEB( - 0, 40.rpx, 0, 38.rpx), - child: SearchWidget( - keyword: controller.model.keyword, - color: controller.model.color, - hint: "请输入门店名称", - onChange: (d) { - controller.model.keyword = d; - }, - findCallback: () { - // controller.page = 0; - // controller.getData(); - }, - ), - ), - - Obx(() { - if (controller - .model.experienceStoreModelList.length == - 0) { - return CircularProgressIndicator( - strokeWidth: 1, - valueColor: - AlwaysStoppedAnimation(Colors.white), - ); - } else { - return Container(); - } - }), - - Expanded( - child: Obx(() => ListView( - controller: scrollController, - shrinkWrap: true, - scrollDirection: Axis.vertical, - children: List.generate( - controller - .model - .experienceStoreModelList - .length, (index) { - return ExperienceStoreWidget( - index: index, - data: controller.model - .experienceStoreModelList[index]); - }) - .divide(const SizedBox( - height: 25, - )) - .addToStart(SizedBox( - height: AppConstants.list_start_height, - )) - .addToEnd(SizedBox( - height: AppConstants.list_ano_end_height, - ))))), - ], + Padding( + padding: + EdgeInsetsDirectional.fromSTEB(0, 40.rpx, 0, 38.rpx), + child: SearchWidget( + keyword: controller.model.keyword, + color: controller.model.color, + hint: "请输入门店名称", + onChange: (d) { + controller.model.keyword = d; + }, + findCallback: () { + // controller.page = 0; + // controller.getData(); + }, + ), ), - ), - )), - )); + + Obx(() { + if (controller.model.experienceStoreModelList.length == + 0) { + return CircularProgressIndicator( + strokeWidth: 1, + valueColor: + AlwaysStoppedAnimation(Colors.white), + ); + } else { + return Container(); + } + }), + + Expanded( + child: Obx(() => ListView( + controller: scrollController, + shrinkWrap: true, + scrollDirection: Axis.vertical, + children: List.generate( + controller.model.experienceStoreModelList + .length, (index) { + return ExperienceStoreWidget( + index: index, + data: controller + .model.experienceStoreModelList[index]); + }) + .divide(const SizedBox( + height: 25, + )) + .addToStart(SizedBox( + height: AppConstants.list_start_height, + )) + .addToEnd(SizedBox( + height: AppConstants.list_ano_end_height, + ))))), + ], + ), + ), + )), + )); }); } } diff --git a/lib/pages/mh_page/homepage/mht_sleep_report_page.dart b/lib/pages/mh_page/homepage/mht_sleep_report_page.dart index a52f68d..f31bf19 100644 --- a/lib/pages/mh_page/homepage/mht_sleep_report_page.dart +++ b/lib/pages/mh_page/homepage/mht_sleep_report_page.dart @@ -52,315 +52,292 @@ class _MhtSleepReportPageState extends State { }); int login = userInfoController.model.login!; return GestureDetector( - onTap: () => FocusScope.of(context).unfocus(), + // // onTap: () => FocusScope.of(context).unfocus(),, child: Container( - decoration: const BoxDecoration( - image: DecorationImage( - image: AssetImage('assets/images/new_background.png'), // 本地图片 - fit: BoxFit.fill, // 填满整个 Container - ), - ), - child: Scaffold( - backgroundColor: Colors.transparent, - body: SafeArea( - child: Container( - width: MediaQuery.sizeOf(context).width, - height: MediaQuery.sizeOf(context).height, - child: Column( - mainAxisSize: MainAxisSize.max, - mainAxisAlignment: (userInfoController.model.login! != null && - userInfoController.model.login! == 1) - ? MainAxisAlignment.start - : MainAxisAlignment.center, - children: [ - //未登录 - Obx(() { - if (userInfoController.model.login! == null || - userInfoController.model.login! == 0) { - return Center( - child: InkWell( - onTap: () => Get.toNamed("/loginPage"), - child: RichText( - text: TextSpan( - children: [ - WidgetSpan( - child: Stack( - children: [ - Text( - "登录", - style: TextStyle( - color: stringToColor("#84F5FF"), - fontSize: 30.rpx, - ), - ), - Positioned( - bottom: 0, // 控制下划线与文字的间距 - left: 0, - right: 0, - child: Container( - height: 1, // 下划线粗细 - color: stringToColor("#84F5FF"), - ), - ), - ], + decoration: const BoxDecoration( + image: DecorationImage( + image: AssetImage('assets/images/new_background.png'), // 本地图片 + fit: BoxFit.fill, // 填满整个 Container + ), + ), + child: Scaffold( + backgroundColor: Colors.transparent, + body: SafeArea( + child: Container( + width: MediaQuery.sizeOf(context).width, + height: MediaQuery.sizeOf(context).height, + child: Column( + mainAxisSize: MainAxisSize.max, + mainAxisAlignment: (userInfoController.model.login! != null && + userInfoController.model.login! == 1) + ? MainAxisAlignment.start + : MainAxisAlignment.center, + children: [ + //未登录 + Obx(() { + if (userInfoController.model.login! == null || + userInfoController.model.login! == 0) { + return Center( + child: InkWell( + onTap: () => Get.toNamed("/loginPage"), + child: RichText( + text: TextSpan( + children: [ + WidgetSpan( + child: Stack( + children: [ + Text( + "登录", + style: TextStyle( + color: stringToColor("#84F5FF"), + fontSize: 30.rpx, + ), ), - ), - TextSpan( - text: "查看睡眠报告", + Positioned( + bottom: 0, // 控制下划线与文字的间距 + left: 0, + right: 0, + child: Container( + height: 1, // 下划线粗细 + color: stringToColor("#84F5FF"), + ), + ), + ], + ), + ), + TextSpan( + text: "查看睡眠报告", + style: TextStyle( + color: Colors.white, + fontSize: 30.rpx, + ), + ), + ], + ), + ), + ), + ); + } + return Container(); + }), + //已登录 + Obx(() { + if (userInfoController.model.login! != null && + userInfoController.model.login! == 1) { + final list = deviceController.personnelList.value; + // if (list.isNotEmpty && + // formFieldController.value == null) { + // WidgetsBinding.instance.addPostFrameCallback((_) { + // formFieldController.value = list[0]["mac"]; + // personInfo.value = list[0]; + // homeController.selectPerson.value = list[0]; + // homeController.selectDevcie.value = list[0]["mac"]; + // deviceController + // .getSleeps(formFieldController.value); + // homeController.updateAll(); + // }); + // } + if (list.isNotEmpty) { + WidgetsBinding.instance.addPostFrameCallback((_) { + formFieldController.value = list[0]["mac"]; + personInfo.value = list[0]; + homeController.selectPerson.value = list[0]; + homeController.selectDevcie.value = list[0]["mac"]; + deviceController.getSleeps(formFieldController.value); + homeController.updateAll(); + }); + } + //themeController.currentColor.sc5, + if (homeController.personnelList.value.length != 0) + return Padding( + padding: EdgeInsetsDirectional.fromSTEB( + 0.rpx, 40.rpx, 30.rpx, 10.rpx), + child: Container( + width: MediaQuery.sizeOf(context).width, + constraints: BoxConstraints( + minHeight: 60.rpx, + ), + decoration: BoxDecoration( + color: Colors.transparent, + borderRadius: BorderRadius.circular(20.rpx), + ), + child: Padding( + padding: EdgeInsetsDirectional.fromSTEB( + 30.rpx, 16.rpx, 16.rpx, 25.rpx), + child: Container( + width: MediaQuery.sizeOf(context).width, + child: Row( + mainAxisSize: MainAxisSize.max, + mainAxisAlignment: + MainAxisAlignment.spaceBetween, + children: [ + Text( + '健康报告'.tr, style: TextStyle( - color: Colors.white, + fontFamily: 'Readex Pro', + color: themeController.currentColor.sc3, + letterSpacing: 0, fontSize: 30.rpx, ), ), + ScrollbarTheme( + data: ScrollbarThemeData( + thumbColor: MaterialStateProperty.all( + Colors.transparent), + trackColor: MaterialStateProperty.all( + Colors.transparent), + trackBorderColor: + MaterialStateProperty.all( + Colors.transparent), + ), + child: ValueListenableBuilder( + valueListenable: formFieldController, + builder: (c, a, s) => ClipRRect( + borderRadius: + BorderRadius.circular(36.rpx), + child: Theme( + data: Theme.of(context).copyWith( + splashColor: Colors.transparent, + highlightColor: + Colors.transparent, + hoverColor: Colors.transparent, + ), + child: + FlutterFlowDropDown( + controller: formFieldController, + options: deviceController + .personnelList.value + .map( + (d) => "${d["mac"]}") + .toList(), + optionLabels: deviceController + .personnelList.value + .map((d) { + var s = d["name"] ?? d["mac"]; + if (s == null) { + return ""; + } else { + return "$s"; + } + }).toList(), + onChanged: (val) { + final list = deviceController + .personnelList.value; + final selectedPerson = + list.firstWhere( + (element) => + element['mac'] == val, + orElse: () => + null, // 防止找不到时报错 + ); + homeController.selectPerson + .value = selectedPerson; + personInfo.value = + selectedPerson; + + homeController + .selectedDayIndex = + (6).obs; + print("$val"); + if (val == null) { + homeController + .sleepDays.value = []; + } else { + homeController.selectDevcie + .value = + formFieldController + .value!; + deviceController.getSleeps( + formFieldController + .value); + homeController.updateAll(); + } + }, + width: 300.rpx, + height: 81.rpx, + maxHeight: 300.rpx, + textStyle: TextStyle( + fontSize: 28.rpx, + overflow: + TextOverflow.ellipsis, + color: Colors.white, + ), + hintText: '', + icon: Icon( + Icons + .keyboard_arrow_down_rounded, + color: + stringToColor("#FFFFFF"), + size: 30.rpx, + ), + fillColor: + stringToColor("#184468"), + elevation: 2, + borderColor: Colors.transparent, + borderWidth: 2, + borderRadius: 100.rpx, + margin: EdgeInsetsDirectional + .fromSTEB(32.rpx, 8.rpx, + 32.rpx, 8.rpx), + hidesUnderline: true, + isOverButton: false, + isSearchable: false, + isMultiSelect: false, + ), + ))), + ), ], ), ), ), - ); - } - return Container(); - }), - //已登录 - Obx(() { - if (userInfoController.model.login! != null && - userInfoController.model.login! == 1) { - final list = deviceController.personnelList.value; - // if (list.isNotEmpty && - // formFieldController.value == null) { - // WidgetsBinding.instance.addPostFrameCallback((_) { - // formFieldController.value = list[0]["mac"]; - // personInfo.value = list[0]; - // homeController.selectPerson.value = list[0]; - // homeController.selectDevcie.value = list[0]["mac"]; - // deviceController - // .getSleeps(formFieldController.value); - // homeController.updateAll(); - // }); - // } - if (list.isNotEmpty) { - WidgetsBinding.instance.addPostFrameCallback((_) { - formFieldController.value = list[0]["mac"]; - personInfo.value = list[0]; - homeController.selectPerson.value = list[0]; - homeController.selectDevcie.value = list[0]["mac"]; - deviceController - .getSleeps(formFieldController.value); - homeController.updateAll(); - }); - } - //themeController.currentColor.sc5, - if (homeController.personnelList.value.length != 0) - return Padding( - padding: EdgeInsetsDirectional.fromSTEB( - 0.rpx, 40.rpx, 30.rpx, 10.rpx), - child: Container( - width: MediaQuery.sizeOf(context).width, - constraints: BoxConstraints( - minHeight: 60.rpx, - ), - decoration: BoxDecoration( - color: Colors.transparent, - borderRadius: BorderRadius.circular(20.rpx), - ), - child: Padding( - padding: EdgeInsetsDirectional.fromSTEB( - 30.rpx, 16.rpx, 16.rpx, 25.rpx), - child: Container( - width: MediaQuery.sizeOf(context).width, - child: Row( - mainAxisSize: MainAxisSize.max, - mainAxisAlignment: - MainAxisAlignment.spaceBetween, - children: [ - Text( - '健康报告'.tr, - style: TextStyle( - fontFamily: 'Readex Pro', - color: - themeController.currentColor.sc3, - letterSpacing: 0, - fontSize: 30.rpx, - ), - ), - ScrollbarTheme( - data: ScrollbarThemeData( - thumbColor: MaterialStateProperty.all( - Colors.transparent), - trackColor: MaterialStateProperty.all( - Colors.transparent), - trackBorderColor: - MaterialStateProperty.all( - Colors.transparent), - ), - child: ValueListenableBuilder( - valueListenable: - formFieldController, - builder: (c, a, s) => ClipRRect( - borderRadius: - BorderRadius.circular( - 36.rpx), - child: Theme( - data: Theme.of(context) - .copyWith( - splashColor: - Colors.transparent, - highlightColor: - Colors.transparent, - hoverColor: - Colors.transparent, - ), - child: FlutterFlowDropDown< - String>( - controller: - formFieldController, - options: deviceController - .personnelList.value - .map((d) => - "${d["mac"]}") - .toList(), - optionLabels: - deviceController - .personnelList.value - .map((d) { - var s = - d["name"] ?? d["mac"]; - if (s == null) { - return ""; - } else { - return "$s"; - } - }).toList(), - onChanged: (val) { - final list = - deviceController - .personnelList - .value; - final selectedPerson = - list.firstWhere( - (element) => - element['mac'] == - val, - orElse: () => - null, // 防止找不到时报错 - ); - homeController - .selectPerson - .value = - selectedPerson; - personInfo.value = - selectedPerson; + ), + ); + } + if (userInfoController.model.login != null && + userInfoController.model.login == 1) + return Expanded(child: NullDataWidget()); + return Container(); + }), - homeController - .selectedDayIndex = - (6).obs; - print("$val"); - if (val == null) { - homeController.sleepDays - .value = []; - } else { - homeController - .selectDevcie - .value = - formFieldController - .value!; - deviceController.getSleeps( - formFieldController - .value); - homeController - .updateAll(); - } - }, - width: 300.rpx, - height: 81.rpx, - maxHeight: 300.rpx, - textStyle: TextStyle( - fontSize: 28.rpx, - overflow: - TextOverflow.ellipsis, - color: Colors.white, - ), - hintText: '', - icon: Icon( - Icons - .keyboard_arrow_down_rounded, - color: stringToColor( - "#FFFFFF"), - size: 30.rpx, - ), - fillColor: stringToColor( - "#184468"), - elevation: 2, - borderColor: - Colors.transparent, - borderWidth: 2, - borderRadius: 100.rpx, - margin: - EdgeInsetsDirectional - .fromSTEB( - 32.rpx, - 8.rpx, - 32.rpx, - 8.rpx), - hidesUnderline: true, - isOverButton: false, - isSearchable: false, - isMultiSelect: false, - ), - ))), - ), - ], - ), - ), - ), - ), - ); - } - if (userInfoController.model.login != null && - userInfoController.model.login == 1) - return Expanded(child: NullDataWidget()); - return Container(); - }), + Obx(() { + if (homeController.selectDevcie.value != null && + homeController.selectDevcie.value!.isNotEmpty && + deviceController.personnelList.value.isNotEmpty) + return Expanded( + child: NewSleepReportPage( + data: { + "tag": "123", + 'date': DateTime.now().millisecondsSinceEpoch, + 'mac': homeController.selectDevcie.value, + 'person': homeController.selectPerson.value, + 'backgroundImg': 'assets/images/new_background.png', + 'arrow': false, + 'noBackImg': true, + 'person_show': false, + }, + ), + ); + // } + return Container(); + }), - Obx(() { - if (homeController.selectDevcie.value != null && - homeController.selectDevcie.value!.isNotEmpty && - deviceController.personnelList.value.isNotEmpty) - return Expanded( - child: NewSleepReportPage( - data: { - "tag": "123", - 'date': DateTime.now().millisecondsSinceEpoch, - 'mac': homeController.selectDevcie.value, - 'person': homeController.selectPerson.value, - 'backgroundImg': - 'assets/images/new_background.png', - 'arrow': false, - 'noBackImg': true, - 'person_show': false, - }, - ), - ); - // } - return Container(); - }), - - // Expanded( - // child: NewSleepReportPage( - // data: { - // "tag": "123", - // 'date': DateTime.now().millisecondsSinceEpoch, - // 'mac': homeController.selectDevcie.value, - // 'person': homeController.selectPerson.value, - // 'backgroundImg': 'assets/images/new_background.png', - // }, - // ), - // ), - // } - ], - ), - ), + // Expanded( + // child: NewSleepReportPage( + // data: { + // "tag": "123", + // 'date': DateTime.now().millisecondsSinceEpoch, + // 'mac': homeController.selectDevcie.value, + // 'person': homeController.selectPerson.value, + // 'backgroundImg': 'assets/images/new_background.png', + // }, + // ), + // ), + // } + ], ), ), - )); + ), + ), + )); } } diff --git a/lib/pages/mh_page/homepage/mht_sleep_report_page_return.dart b/lib/pages/mh_page/homepage/mht_sleep_report_page_return.dart index 1777edc..d17212d 100644 --- a/lib/pages/mh_page/homepage/mht_sleep_report_page_return.dart +++ b/lib/pages/mh_page/homepage/mht_sleep_report_page_return.dart @@ -37,7 +37,7 @@ class _MhtSleepReportReturnPageState extends State { @override Widget build(BuildContext context) { return GestureDetector( - onTap: () => FocusScope.of(context).unfocus(), + // onTap: () => FocusScope.of(context).unfocus(),, child: Container( decoration: const BoxDecoration( image: DecorationImage( diff --git a/lib/pages/mh_page/homepage/new_Home_page.dart b/lib/pages/mh_page/homepage/new_Home_page.dart index 9ddffac..44e7fea 100644 --- a/lib/pages/mh_page/homepage/new_Home_page.dart +++ b/lib/pages/mh_page/homepage/new_Home_page.dart @@ -176,730 +176,698 @@ class _NewHomePageState extends State { }); int login = userInfoController.model.login!; return GestureDetector( - onTap: () => FocusScope.of(context).unfocus(), + // onTap: () => FocusScope.of(context).unfocus(),, child: Container( - decoration: const BoxDecoration( - image: DecorationImage( - image: AssetImage('assets/images/new_background.png'), // 本地图片 - fit: BoxFit.fill, // 填满整个 Container + decoration: const BoxDecoration( + image: DecorationImage( + image: AssetImage('assets/images/new_background.png'), // 本地图片 + fit: BoxFit.fill, // 填满整个 Container + ), + ), + child: Scaffold( + backgroundColor: Colors.transparent, + appBar: AppBar( + iconTheme: IconThemeData(color: themeController.currentColor.sc3), + backgroundColor: Colors.transparent, + automaticallyImplyLeading: false, + titleSpacing: 0, + title: Container( + height: 180.rpx, + child: Row( + children: [ + // 左侧头像 + Obx(() { + return InkWell( + onTap: () { + if (userInfoController.model.login == 0) { + Get.toNamed("/loginPage"); + } + }, + child: userInfo(userInfoController.model.login), + ); + }), + const Spacer(), // 左右分隔 + FloatingSvgIcon( + assetPath: 'assets/img/icon/xiaoyi.svg', + width: 60.rpx, + height: 60.rpx, + onTap: () { + // print("点击了小鹅图标"); + if (userInfoController.model.login == 0) { + Get.toNamed("/loginPage"); + } + Get.toNamed("/xiaoEPage", + arguments: + "https://xiaoe.he-info.cn/?mac=b43a45c3ddf4"); + }, + ), + SizedBox(width: 40.rpx), + ], ), ), - child: Scaffold( - backgroundColor: Colors.transparent, - appBar: AppBar( - iconTheme: IconThemeData(color: themeController.currentColor.sc3), - backgroundColor: Colors.transparent, - automaticallyImplyLeading: false, - titleSpacing: 0, - title: Container( - height: 180.rpx, - child: Row( - children: [ - // 左侧头像 - Obx(() { - return InkWell( - onTap: () { - if (userInfoController.model.login == 0) { - Get.toNamed("/loginPage"); - } - }, - child: userInfo(userInfoController.model.login), - ); - }), - const Spacer(), // 左右分隔 - FloatingSvgIcon( - assetPath: 'assets/img/icon/xiaoyi.svg', - width: 60.rpx, - height: 60.rpx, - onTap: () { - // print("点击了小鹅图标"); - if (userInfoController.model.login == 0) { - Get.toNamed("/loginPage"); - } - Get.toNamed("/xiaoEPage", - arguments: - "https://xiaoe.he-info.cn/?mac=b43a45c3ddf4"); - }, - ), - SizedBox(width: 40.rpx), - ], - ), - ), - ), - body: SafeArea( - child: Container( - width: MediaQuery.sizeOf(context).width, - height: MediaQuery.sizeOf(context).height * 1.123, - child: SingleChildScrollView( - child: Column( - mainAxisSize: MainAxisSize.max, - children: [ - //天气 - Container( - padding: - EdgeInsets.fromLTRB(26.rpx, 10.rpx, 26.rpx, 40.rpx), - width: double.infinity, - child: Padding( - padding: EdgeInsets.symmetric(horizontal: 0.rpx), - child: Column( - children: [ - Padding( - padding: - EdgeInsets.fromLTRB(17.rpx, 30.rpx, 0, 0), - child: Row( - children: [ - Obx(() { - return Row( - children: [ - Text( - "${weatherModelController.model.cityName ?? '未知数据'.tr}", - style: TextStyle( - color: Colors.white, - fontSize: AppConstants() - .normal_text_fontSize, - ), - ), - Text( - "${(weatherModelController.model.current_temperature != null && weatherModelController.model.current_temperature! > 0) ? weatherModelController.model.current_temperature : '未知数据'.tr}" + - "°C", - style: TextStyle( - color: Colors.white, - fontSize: AppConstants() - .normal_text_fontSize, - ), - ), - Text( - "${(weatherModelController.model.weather_info?.isNotEmpty ?? false) ? weatherModelController.model.weather_info : '未知数据'.tr}", - style: TextStyle( - color: Colors.white, - fontSize: AppConstants() - .normal_text_fontSize, - ), - ), - if (weatherModelController - .model.weatherIconurl != - null && - weatherModelController.model - .weatherIconurl!.isNotEmpty) - Container( - width: 35.rpx, - height: 26.rpx, - clipBehavior: Clip.antiAlias, - decoration: BoxDecoration( - shape: BoxShape.circle), - child: Image.network( - weatherModelController - .model.weatherIconurl!, - fit: BoxFit.cover, - ), - ), - ].divide(SizedBox( - width: 20.rpx, - )), - ); - }), - ], - ), - ), - ], - ), - ), - ), - //未登录 - Obx(() { - if (userInfoController.model.login! == null || - userInfoController.model.login! == 0) { - return Padding( - padding: EdgeInsetsDirectional.fromSTEB( - 30.rpx, 0, 30.rpx, 80.rpx), - child: ClickableContainer( - backgroundColor: Colors.transparent, - highlightColor: Colors.transparent, - padding: EdgeInsets.all(0), - onTap: () { - if (userInfoController.model.login == null || - userInfoController.model.login == 0) { - TopSlideNotification.show(context, - text: "请先登录".tr, - textColor: - themeController.currentColor.sc9); - Get.toNamed("/loginPage"); - } else { - Get.toNamed("/mHTDeviceTypePage"); - } - }, - child: Container( - width: MediaQuery.sizeOf(context).width, - height: 302.rpx, - padding: EdgeInsets.only( - top: 90.rpx, bottom: 80.rpx), - decoration: BoxDecoration( - borderRadius: - BorderRadius.circular(borderRadius), - border: Border.all( - color: stringToColor("#85F5FF"), // 边框颜色 - width: 1.rpx, // 边框宽度 - ), - ), - child: Column( - mainAxisSize: MainAxisSize.max, - mainAxisAlignment: MainAxisAlignment.center, - children: [ - SvgPicture.asset( - 'assets/images/icon/add.svg', - width: 42.rpx, - height: 42.rpx, - ), - SizedBox( - height: 32.rpx, - ), - Text( - '添加一台新设备'.tr, - style: TextStyle( - color: stringToColor("#85F5FF"), - fontSize: - AppConstants().normal_text_fontSize, - letterSpacing: 0, - ), - ), - ], - ), - ), - ), - ); - } - return Container(); - }), - //已登录 - Obx(() { - if (userInfoController.model.login! != null && - userInfoController.model.login! == 1) { - final list = deviceController.personnelList.value; - - // 当数据第一次到达时自动赋值 - if (list.isNotEmpty && - formFieldController.value == null) { - WidgetsBinding.instance.addPostFrameCallback((_) { - formFieldController.value = list[0]["mac"]; - personInfo.value = list[0]; - homeController.selectPerson.value = list[0]; - homeController.selectDevcie.value = - list[0]["mac"]; - deviceController - .getHomeSleeps(formFieldController.value); - homeController.updateAll(); - }); - } - return SingleChildScrollView( - child: Column( + ), + body: SafeArea( + child: Container( + width: MediaQuery.sizeOf(context).width, + height: MediaQuery.sizeOf(context).height * 1.123, + child: SingleChildScrollView( + child: Column( + mainAxisSize: MainAxisSize.max, + children: [ + //天气 + Container( + padding: + EdgeInsets.fromLTRB(26.rpx, 10.rpx, 26.rpx, 40.rpx), + width: double.infinity, + child: Padding( + padding: EdgeInsets.symmetric(horizontal: 0.rpx), + child: Column( + children: [ + Padding( + padding: EdgeInsets.fromLTRB(17.rpx, 30.rpx, 0, 0), + child: Row( children: [ - if (homeController.personnelList.value.length != - 0) - Padding( - padding: EdgeInsetsDirectional.fromSTEB( - 30.rpx, 40.rpx, 30.rpx, 10.rpx), - child: Container( - width: MediaQuery.sizeOf(context).width, - height: - MediaQuery.sizeOf(context).height * - 0.184, - constraints: BoxConstraints( - minHeight: 354.rpx, + Obx(() { + return Row( + children: [ + Text( + "${weatherModelController.model.cityName ?? '未知数据'.tr}", + style: TextStyle( + color: Colors.white, + fontSize: AppConstants() + .normal_text_fontSize, + ), ), - decoration: BoxDecoration( - color: stringToColor("#003058"), - borderRadius: - BorderRadius.circular(20.rpx), + Text( + "${(weatherModelController.model.current_temperature != null && weatherModelController.model.current_temperature! > 0) ? weatherModelController.model.current_temperature : '未知数据'.tr}" + + "°C", + style: TextStyle( + color: Colors.white, + fontSize: AppConstants() + .normal_text_fontSize, + ), ), - child: Column( - mainAxisSize: MainAxisSize.max, - children: [ - Padding( - padding: - EdgeInsetsDirectional.fromSTEB( - 20.rpx, - 20.rpx, - 16.rpx, - 25.rpx), - child: Container( - width: MediaQuery.sizeOf(context) - .width, - child: Row( - mainAxisSize: MainAxisSize.max, - mainAxisAlignment: - MainAxisAlignment - .spaceBetween, - children: [ - ScrollbarTheme( - data: ScrollbarThemeData( - thumbColor: - MaterialStateProperty - .all(Colors - .transparent), - trackColor: - MaterialStateProperty - .all(Colors - .transparent), - trackBorderColor: - MaterialStateProperty - .all(Colors - .transparent), - ), - child: - ValueListenableBuilder( - valueListenable: - formFieldController, - builder: (c, a, s) => - FlutterFlowDropDown< - String>( - controller: - formFieldController, - options: deviceController - .personnelList.value - .map((d) => - "${d["mac"]}") - .toList(), - optionLabels: - deviceController - .personnelList - .value - .map( - (d) { - var s = d["name"] ?? - d["mac"]; - if (s == null) { - return ""; - } else { - return "$s"; - } - }).toList(), - onChanged: (val) { - final list = - deviceController - .personnelList - .value; - final selectedPerson = - list.firstWhere( - (element) => - element[ - 'mac'] == - val, - orElse: () => - null, // 防止找不到时报错 - ); - homeController - .selectPerson - .value = - selectedPerson; - personInfo.value = - selectedPerson; - - homeController - .selectedDayIndex = - (6).obs; - print("$val"); - if (val == null) { - homeController - .homeSleepDays - .value = []; - } else { - homeController - .selectDevcie - .value = - formFieldController - .value!; - deviceController - .getHomeSleeps( - formFieldController - .value); - homeController - .updateAll(); - } - }, - width: 300.rpx, - height: 81.rpx, - maxHeight: 300.rpx, - textStyle: TextStyle( - fontSize: 28.rpx, - overflow: TextOverflow - .ellipsis, - color: Colors.white, - ), - hintText: '', - icon: Icon( - Icons - .keyboard_arrow_down_rounded, - color: stringToColor( - "#FFFFFF"), - size: 30.rpx, - ), - fillColor: - stringToColor( - "##011D33"), - elevation: 2, - borderColor: - Colors.transparent, - borderWidth: 2, - borderRadius: 100.rpx, - margin: - EdgeInsetsDirectional - .fromSTEB( - 32.rpx, - 8.rpx, - 32.rpx, - 8.rpx), - hidesUnderline: true, - isOverButton: false, - isSearchable: false, - isMultiSelect: false, - ), - ), - ), - InkWell( - onTap: () { - if (formFieldController - .value != - null) { - Get.toNamed( - "/newSleepReportPage", - arguments: { - 'mac': - formFieldController - .value!, - 'type': 1, - "person": personInfo - .value, - 'backgroundImg': - 'assets/images/new_background.png', - 'date': DateTime - .now() - .millisecondsSinceEpoch, - 'person_show': - false, - }, - ); - } - }, - child: Row( - mainAxisSize: - MainAxisSize.max, - children: [ - SizedBox( - width: 12.rpx, - ), - SvgPicture.asset( - "assets/images/table.svg", - width: 28.rpx, - height: 28.rpx, - color: stringToColor( - "#FFFFFF"), - ), - SizedBox( - width: 20.rpx, - ), - ], - ), - ), - ], - ), - ), - ), - if (homeController - .homeSleepDays.value.length == - 0) - Expanded(child: NullDataWidget()), - if (homeController - .homeSleepDays.value.length != - 0) - Container( - padding: EdgeInsets.only( - top: 0.rpx, - bottom: 20.rpx, - left: 16.rpx, - right: 16.rpx, - ), - width: double.infinity, - decoration: BoxDecoration(), - child: Obx(() => Row( - mainAxisSize: - MainAxisSize.max, - crossAxisAlignment: - CrossAxisAlignment - .start, - children: [ - ...List.generate( - homeController - .homeSleepDays - .value - .length, (index) { - var day = homeController - .homeSleepDays[ - index]; - bool isSelected = - homeController - .selectedDayIndex - .value == - index; - return Expanded( - child: - GestureDetector( - onTap: () { - homeController - .selectedDayIndex - .value = index; - int? timeMillis = - parseToInt(day[ - 'time']); - Get.toNamed( - "/newSleepReportPage", - arguments: { - 'date': - timeMillis, - 'mac': - formFieldController - .value!, - 'type': 1, - "person": - personInfo - .value, - 'backgroundImg': - 'assets/images/new_background.png', - 'date': - timeMillis, - // 'backgroundColor':stringToColor("#003058"), - 'person_show': - false, - }, - ); - }, - child: Container( - padding: - EdgeInsets - .only( - top: 10.rpx, - bottom: 20.rpx, - ), - width: 90.rpx, - decoration: - BoxDecoration( - color: isSelected - ? stringToColor( - "#011D33") - : Colors - .transparent, - borderRadius: - BorderRadius - .circular( - 8.rpx), - ), - child: Column( - mainAxisSize: - MainAxisSize - .max, - mainAxisAlignment: - MainAxisAlignment - .start, - crossAxisAlignment: - CrossAxisAlignment - .center, - children: [ - Text( - day['week'], - style: - TextStyle( - fontFamily: - 'Readex Pro', - fontSize: - 30.rpx, - letterSpacing: - 0, - color: stringToColor( - "#FFFFFF"), - ), - ), - SizedBox( - height: 12 - .rpx), - Text( - day['date'], - // "哈哈", - style: - TextStyle( - fontFamily: - 'Readex Pro', - letterSpacing: - 0, - fontSize: - 22.rpx, - color: stringToColor( - "#929699"), - ), - ), - SizedBox( - height: 39 - .rpx), - buildScoreOrIcon( - day['score']), - ], - ), - ), - ), - ); - }) - ], - )), - ), - ], + Text( + "${(weatherModelController.model.weather_info?.isNotEmpty ?? false) ? weatherModelController.model.weather_info : '未知数据'.tr}", + style: TextStyle( + color: Colors.white, + fontSize: AppConstants() + .normal_text_fontSize, + ), ), - ), - ), - if (homeController.bindDeviceNum.value != 0) - Padding( - padding: EdgeInsetsDirectional.fromSTEB( - 30.rpx, 40.rpx, 30.rpx, 100.rpx), - child: Column( - children: homeController - .deviceList.entries - .map((entry) => HomeDeviceWidget( - roomName: entry.key, - deviceStatusList: entry.value, - )) - .toList() - .divide(SizedBox(height: 30.rpx)), - ), - ), - if (homeController.bindDeviceNum.value == 0) - Padding( - padding: EdgeInsetsDirectional.fromSTEB( - 30.rpx, 0, 30.rpx, 80.rpx), - child: ClickableContainer( - backgroundColor: Colors.transparent, - highlightColor: Colors.transparent, - padding: EdgeInsets.all(0), - onTap: () { - if (userInfoController.model.login == - null || - userInfoController.model.login == - 0) { - TopSlideNotification.show(context, - text: "请先登录".tr, - textColor: themeController - .currentColor.sc9); - Get.toNamed("/loginPage"); - } else { - Get.toNamed("/mHTDeviceTypePage"); - } - }, - child: Container( - width: MediaQuery.sizeOf(context).width, - height: 302.rpx, - padding: EdgeInsets.only( - top: 90.rpx, bottom: 80.rpx), - decoration: BoxDecoration( - borderRadius: BorderRadius.circular( - borderRadius), - border: Border.all( - color: stringToColor( - "#85F5FF"), // 边框颜色 - width: 1.rpx, // 边框宽度 + if (weatherModelController + .model.weatherIconurl != + null && + weatherModelController + .model.weatherIconurl!.isNotEmpty) + Container( + width: 35.rpx, + height: 26.rpx, + clipBehavior: Clip.antiAlias, + decoration: BoxDecoration( + shape: BoxShape.circle), + child: Image.network( + weatherModelController + .model.weatherIconurl!, + fit: BoxFit.cover, ), ), - child: Column( - mainAxisSize: MainAxisSize.max, - mainAxisAlignment: - MainAxisAlignment.center, - children: [ - SvgPicture.asset( - 'assets/images/icon/add.svg', - width: 42.rpx, - height: 42.rpx, - ), - SizedBox( - height: 32.rpx, - ), - Text( - '添加一台新设备'.tr, - style: TextStyle( - color: stringToColor("#85F5FF"), - fontSize: AppConstants() - .normal_text_fontSize, - letterSpacing: 0, - ), - ), - ], - ), - ), - ), - ), - if (homeController.bindDeviceNum.value != 0) - Padding( - padding: EdgeInsetsDirectional.fromSTEB( - 30.rpx, 0.rpx, 30.rpx, 100.rpx), - child: ClickableContainer( - onTap: () { - // 点击逻辑 - Get.toNamed("/mHTDeviceTypePage"); - }, - backgroundColor: Colors.transparent, - highlightColor: themeController - .currentColor - .sc21, // 这里可以自定义高亮色,透明就用 Colors.transparent - borderRadius: borderRadius, - padding: EdgeInsetsDirectional.fromSTEB( - 0.rpx, 0, 0.rpx, 0), - child: Container( - height: 92.rpx, - alignment: Alignment.center, - decoration: BoxDecoration( - border: Border.all( - color: stringToColor( - "#85F5FF"), // 边框颜色 - width: 1.rpx, // 边框宽度 - ), - borderRadius: BorderRadius.circular( - borderRadius), - ), - child: Row( - mainAxisSize: MainAxisSize.min, - children: [ - // Icon( - // Icons.add, - // size: 60.rpx, - // color: stringToColor("#85F5FF"), - // ), - SvgPicture.asset( - 'assets/images/icon/add.svg', - width: 42.rpx, - height: 42.rpx, - ), - SizedBox(width: 20.rpx), - Text( - '添加新设备'.tr, - style: TextStyle( - fontFamily: 'Readex Pro', - color: stringToColor("#85F5FF"), - letterSpacing: 0, - fontSize: 30.rpx, - ), - ), - ], - ), - ), - ), - ), + ].divide(SizedBox( + width: 20.rpx, + )), + ); + }), ], ), - ); - } - return Container(); - }), - ], + ), + ], + ), + ), ), - ), + //未登录 + Obx(() { + if (userInfoController.model.login! == null || + userInfoController.model.login! == 0) { + return Padding( + padding: EdgeInsetsDirectional.fromSTEB( + 30.rpx, 0, 30.rpx, 80.rpx), + child: ClickableContainer( + backgroundColor: Colors.transparent, + highlightColor: Colors.transparent, + padding: EdgeInsets.all(0), + onTap: () { + if (userInfoController.model.login == null || + userInfoController.model.login == 0) { + TopSlideNotification.show(context, + text: "请先登录".tr, + textColor: themeController.currentColor.sc9); + Get.toNamed("/loginPage"); + } else { + Get.toNamed("/mHTDeviceTypePage"); + } + }, + child: Container( + width: MediaQuery.sizeOf(context).width, + height: 302.rpx, + padding: + EdgeInsets.only(top: 90.rpx, bottom: 80.rpx), + decoration: BoxDecoration( + borderRadius: BorderRadius.circular(borderRadius), + border: Border.all( + color: stringToColor("#85F5FF"), // 边框颜色 + width: 1.rpx, // 边框宽度 + ), + ), + child: Column( + mainAxisSize: MainAxisSize.max, + mainAxisAlignment: MainAxisAlignment.center, + children: [ + SvgPicture.asset( + 'assets/images/icon/add.svg', + width: 42.rpx, + height: 42.rpx, + ), + SizedBox( + height: 32.rpx, + ), + Text( + '添加一台新设备'.tr, + style: TextStyle( + color: stringToColor("#85F5FF"), + fontSize: + AppConstants().normal_text_fontSize, + letterSpacing: 0, + ), + ), + ], + ), + ), + ), + ); + } + return Container(); + }), + //已登录 + Obx(() { + if (userInfoController.model.login! != null && + userInfoController.model.login! == 1) { + final list = deviceController.personnelList.value; + + // 当数据第一次到达时自动赋值 + if (list.isNotEmpty && + formFieldController.value == null) { + WidgetsBinding.instance.addPostFrameCallback((_) { + formFieldController.value = list[0]["mac"]; + personInfo.value = list[0]; + homeController.selectPerson.value = list[0]; + homeController.selectDevcie.value = list[0]["mac"]; + deviceController + .getHomeSleeps(formFieldController.value); + homeController.updateAll(); + }); + } + return SingleChildScrollView( + child: Column( + children: [ + if (homeController.personnelList.value.length != 0) + Padding( + padding: EdgeInsetsDirectional.fromSTEB( + 30.rpx, 40.rpx, 30.rpx, 10.rpx), + child: Container( + width: MediaQuery.sizeOf(context).width, + height: + MediaQuery.sizeOf(context).height * 0.184, + constraints: BoxConstraints( + minHeight: 354.rpx, + ), + decoration: BoxDecoration( + color: stringToColor("#003058"), + borderRadius: BorderRadius.circular(20.rpx), + ), + child: Column( + mainAxisSize: MainAxisSize.max, + children: [ + Padding( + padding: EdgeInsetsDirectional.fromSTEB( + 20.rpx, 20.rpx, 16.rpx, 25.rpx), + child: Container( + width: + MediaQuery.sizeOf(context).width, + child: Row( + mainAxisSize: MainAxisSize.max, + mainAxisAlignment: + MainAxisAlignment.spaceBetween, + children: [ + ScrollbarTheme( + data: ScrollbarThemeData( + thumbColor: + MaterialStateProperty.all( + Colors.transparent), + trackColor: + MaterialStateProperty.all( + Colors.transparent), + trackBorderColor: + MaterialStateProperty.all( + Colors.transparent), + ), + child: ValueListenableBuilder( + valueListenable: + formFieldController, + builder: (c, a, s) => + FlutterFlowDropDown< + String>( + controller: + formFieldController, + options: deviceController + .personnelList.value + .map((d) => + "${d["mac"]}") + .toList(), + optionLabels: + deviceController + .personnelList.value + .map((d) { + var s = + d["name"] ?? d["mac"]; + if (s == null) { + return ""; + } else { + return "$s"; + } + }).toList(), + onChanged: (val) { + final list = + deviceController + .personnelList + .value; + final selectedPerson = + list.firstWhere( + (element) => + element['mac'] == + val, + orElse: () => + null, // 防止找不到时报错 + ); + homeController + .selectPerson + .value = + selectedPerson; + personInfo.value = + selectedPerson; + + homeController + .selectedDayIndex = + (6).obs; + print("$val"); + if (val == null) { + homeController + .homeSleepDays + .value = []; + } else { + homeController + .selectDevcie + .value = + formFieldController + .value!; + deviceController + .getHomeSleeps( + formFieldController + .value); + homeController + .updateAll(); + } + }, + width: 300.rpx, + height: 81.rpx, + maxHeight: 300.rpx, + textStyle: TextStyle( + fontSize: 28.rpx, + overflow: + TextOverflow.ellipsis, + color: Colors.white, + ), + hintText: '', + icon: Icon( + Icons + .keyboard_arrow_down_rounded, + color: stringToColor( + "#FFFFFF"), + size: 30.rpx, + ), + fillColor: stringToColor( + "##011D33"), + elevation: 2, + borderColor: + Colors.transparent, + borderWidth: 2, + borderRadius: 100.rpx, + margin: + EdgeInsetsDirectional + .fromSTEB( + 32.rpx, + 8.rpx, + 32.rpx, + 8.rpx), + hidesUnderline: true, + isOverButton: false, + isSearchable: false, + isMultiSelect: false, + ), + ), + ), + InkWell( + onTap: () { + if (formFieldController + .value != + null) { + Get.toNamed( + "/newSleepReportPage", + arguments: { + 'mac': + formFieldController + .value!, + 'type': 1, + "person": + personInfo.value, + 'backgroundImg': + 'assets/images/new_background.png', + 'date': DateTime.now() + .millisecondsSinceEpoch, + 'person_show': false, + }, + ); + } + }, + child: Row( + mainAxisSize: + MainAxisSize.max, + children: [ + SizedBox( + width: 12.rpx, + ), + SvgPicture.asset( + "assets/images/table.svg", + width: 28.rpx, + height: 28.rpx, + color: stringToColor( + "#FFFFFF"), + ), + SizedBox( + width: 20.rpx, + ), + ], + ), + ), + ], + ), + ), + ), + if (homeController + .homeSleepDays.value.length == + 0) + Expanded(child: NullDataWidget()), + if (homeController + .homeSleepDays.value.length != + 0) + Container( + padding: EdgeInsets.only( + top: 0.rpx, + bottom: 20.rpx, + left: 16.rpx, + right: 16.rpx, + ), + width: double.infinity, + decoration: BoxDecoration(), + child: Obx(() => Row( + mainAxisSize: MainAxisSize.max, + crossAxisAlignment: + CrossAxisAlignment.start, + children: [ + ...List.generate( + homeController + .homeSleepDays + .value + .length, (index) { + var day = homeController + .homeSleepDays[index]; + bool isSelected = + homeController + .selectedDayIndex + .value == + index; + return Expanded( + child: GestureDetector( + onTap: () { + homeController + .selectedDayIndex + .value = index; + int? timeMillis = + parseToInt( + day['time']); + Get.toNamed( + "/newSleepReportPage", + arguments: { + 'date': + timeMillis, + 'mac': + formFieldController + .value!, + 'type': 1, + "person": + personInfo + .value, + 'backgroundImg': + 'assets/images/new_background.png', + 'date': + timeMillis, + // 'backgroundColor':stringToColor("#003058"), + 'person_show': + false, + }, + ); + }, + child: Container( + padding: + EdgeInsets.only( + top: 10.rpx, + bottom: 20.rpx, + ), + width: 90.rpx, + decoration: + BoxDecoration( + color: isSelected + ? stringToColor( + "#011D33") + : Colors + .transparent, + borderRadius: + BorderRadius + .circular( + 8.rpx), + ), + child: Column( + mainAxisSize: + MainAxisSize + .max, + mainAxisAlignment: + MainAxisAlignment + .start, + crossAxisAlignment: + CrossAxisAlignment + .center, + children: [ + Text( + day['week'], + style: + TextStyle( + fontFamily: + 'Readex Pro', + fontSize: + 30.rpx, + letterSpacing: + 0, + color: stringToColor( + "#FFFFFF"), + ), + ), + SizedBox( + height: + 12.rpx), + Text( + day['date'], + // "哈哈", + style: + TextStyle( + fontFamily: + 'Readex Pro', + letterSpacing: + 0, + fontSize: + 22.rpx, + color: stringToColor( + "#929699"), + ), + ), + SizedBox( + height: + 39.rpx), + buildScoreOrIcon( + day['score']), + ], + ), + ), + ), + ); + }) + ], + )), + ), + ], + ), + ), + ), + if (homeController.bindDeviceNum.value != 0) + Padding( + padding: EdgeInsetsDirectional.fromSTEB( + 30.rpx, 40.rpx, 30.rpx, 100.rpx), + child: Column( + children: homeController.deviceList.entries + .map((entry) => HomeDeviceWidget( + roomName: entry.key, + deviceStatusList: entry.value, + )) + .toList() + .divide(SizedBox(height: 30.rpx)), + ), + ), + if (homeController.bindDeviceNum.value == 0) + Padding( + padding: EdgeInsetsDirectional.fromSTEB( + 30.rpx, 0, 30.rpx, 80.rpx), + child: ClickableContainer( + backgroundColor: Colors.transparent, + highlightColor: Colors.transparent, + padding: EdgeInsets.all(0), + onTap: () { + if (userInfoController.model.login == + null || + userInfoController.model.login == 0) { + TopSlideNotification.show(context, + text: "请先登录".tr, + textColor: + themeController.currentColor.sc9); + Get.toNamed("/loginPage"); + } else { + Get.toNamed("/mHTDeviceTypePage"); + } + }, + child: Container( + width: MediaQuery.sizeOf(context).width, + height: 302.rpx, + padding: EdgeInsets.only( + top: 90.rpx, bottom: 80.rpx), + decoration: BoxDecoration( + borderRadius: + BorderRadius.circular(borderRadius), + border: Border.all( + color: stringToColor("#85F5FF"), // 边框颜色 + width: 1.rpx, // 边框宽度 + ), + ), + child: Column( + mainAxisSize: MainAxisSize.max, + mainAxisAlignment: + MainAxisAlignment.center, + children: [ + SvgPicture.asset( + 'assets/images/icon/add.svg', + width: 42.rpx, + height: 42.rpx, + ), + SizedBox( + height: 32.rpx, + ), + Text( + '添加一台新设备'.tr, + style: TextStyle( + color: stringToColor("#85F5FF"), + fontSize: AppConstants() + .normal_text_fontSize, + letterSpacing: 0, + ), + ), + ], + ), + ), + ), + ), + if (homeController.bindDeviceNum.value != 0) + Padding( + padding: EdgeInsetsDirectional.fromSTEB( + 30.rpx, 0.rpx, 30.rpx, 100.rpx), + child: ClickableContainer( + onTap: () { + // 点击逻辑 + Get.toNamed("/mHTDeviceTypePage"); + }, + backgroundColor: Colors.transparent, + highlightColor: themeController.currentColor + .sc21, // 这里可以自定义高亮色,透明就用 Colors.transparent + borderRadius: borderRadius, + padding: EdgeInsetsDirectional.fromSTEB( + 0.rpx, 0, 0.rpx, 0), + child: Container( + height: 92.rpx, + alignment: Alignment.center, + decoration: BoxDecoration( + border: Border.all( + color: stringToColor("#85F5FF"), // 边框颜色 + width: 1.rpx, // 边框宽度 + ), + borderRadius: + BorderRadius.circular(borderRadius), + ), + child: Row( + mainAxisSize: MainAxisSize.min, + children: [ + // Icon( + // Icons.add, + // size: 60.rpx, + // color: stringToColor("#85F5FF"), + // ), + SvgPicture.asset( + 'assets/images/icon/add.svg', + width: 42.rpx, + height: 42.rpx, + ), + SizedBox(width: 20.rpx), + Text( + '添加新设备'.tr, + style: TextStyle( + fontFamily: 'Readex Pro', + color: stringToColor("#85F5FF"), + letterSpacing: 0, + fontSize: 30.rpx, + ), + ), + ], + ), + ), + ), + ), + ], + ), + ); + } + return Container(); + }), + ], ), ), ), - )); + ), + ), + )); } //1 :登录 0:未登录 diff --git a/lib/pages/mh_page/issue_list_page.dart b/lib/pages/mh_page/issue_list_page.dart index 22fd649..d538731 100644 --- a/lib/pages/mh_page/issue_list_page.dart +++ b/lib/pages/mh_page/issue_list_page.dart @@ -32,171 +32,171 @@ class IssueListPage extends GetView { return LayoutBuilder(builder: (context, cc) { bodysize = cc; return GestureDetector( - onTap: () => FocusScope.of(context).unfocus(), + // onTap: () => FocusScope.of(context).unfocus(),, child: Container( - decoration: const BoxDecoration( - image: DecorationImage( - image: AssetImage('assets/images/new_background.png'), // 本地图片 - fit: BoxFit.fill, // 填满整个 Container - ), - ), - child: Scaffold( - backgroundColor: Colors.transparent, - appBar: AppBar( - backgroundColor: Colors.transparent, - automaticallyImplyLeading: false, - iconTheme: IconThemeData(color: Colors.white), - titleSpacing: 0, - title: SizedBox( - width: double.infinity, - height: 180.rpx, - child: Stack( - alignment: Alignment.center, - children: [ - // 中间居中的标题 - Text( - '问题与帮助', - textAlign: TextAlign.center, - style: TextStyle( - color: Colors.white, - fontSize: 30.rpx, - ), - ), - // 左侧图标 - Positioned( - left: 0.rpx, - child: returnIconButtomNew, - ), - ], - ), - ), - actions: [], - centerTitle: false, - ), - // backgroundColor: FlutterFlowTheme.of(context).primaryBackground, - body: Container( - width: bodysize!.maxWidth, - height: bodysize!.maxHeight * 1, - decoration: BoxDecoration( - // color: AppColors.bg_color, - // color: Color(0xFFF6F6F6), + decoration: const BoxDecoration( + image: DecorationImage( + image: AssetImage('assets/images/new_background.png'), // 本地图片 + fit: BoxFit.fill, // 填满整个 Container + ), + ), + child: Scaffold( + backgroundColor: Colors.transparent, + appBar: AppBar( + backgroundColor: Colors.transparent, + automaticallyImplyLeading: false, + iconTheme: IconThemeData(color: Colors.white), + titleSpacing: 0, + title: SizedBox( + width: double.infinity, + height: 180.rpx, + child: Stack( + alignment: Alignment.center, + children: [ + // 中间居中的标题 + Text( + '问题与帮助', + textAlign: TextAlign.center, + style: TextStyle( + color: Colors.white, + fontSize: 30.rpx, ), - child: Obx(() { - if (controller.model.isLoading) { - return Center(child: CircularProgressIndicator()); // ✅ 加载中 - } - - if (controller.model.issueList.isEmpty) { - return Container( - width: MediaQuery.sizeOf(context).width, - height: 100, - child: Padding( - padding: EdgeInsetsDirectional.fromSTEB(31, 27, 0, 0), - child: Align( - alignment: AlignmentDirectional(-1, 0), - child: Text( - '暂无内容!', - style: TextStyle( - fontFamily: 'Readex Pro', - color: Color(0xFF9EA4B7), - fontSize: AppFontsize.title_size, - fontWeight: FontWeight.w600, - ), - ), - ), - ), - ); - } - - // 有数据时渲染列表 - return ListView( - children: controller.model.issueList! - .asMap() - .entries - .map((e) => IssuePreviewWidget( - index: e.key, - issueListController: controller, - )) - .toList(), - ); - }), - - // Obx(() { - // return Visibility( - // visible: controller.model.issueList != null && - // controller.model.issueList.isNotEmpty, - // replacement: Container( - // width: MediaQuery.sizeOf(context).width, - // height: 100, - // decoration: BoxDecoration( - // color: FlutterFlowTheme.of(context).secondaryBackground, - // ), - // child: Padding( - // padding: EdgeInsetsDirectional.fromSTEB(31, 27, 0, 0), - // child: Column( - // mainAxisSize: MainAxisSize.max, - // children: [ - // Align( - // alignment: AlignmentDirectional(-1, 0), - // child: Text( - // '暂无内容!', - // style: FlutterFlowTheme.of(context) - // .bodyMedium - // .override( - // fontFamily: 'Readex Pro', - // color: Color(0xFF9EA4B7), - // fontSize: AppFontsize.title_size, - // letterSpacing: 0, - // fontWeight: FontWeight.w600, - // ), - // ), - // ), - // ], - // ), - // ), - // ), - // child: Column( - // mainAxisSize: MainAxisSize.max, - // children: [ - // // TitleComponentWidget( - // // titleName: '问题与帮助', - // // ), - // Flexible( - // child: Padding( - // padding: - // EdgeInsetsDirectional.fromSTEB(15, 13, 15, 15), - // child: Container( - // width: bodysize!.maxWidth, - // decoration: BoxDecoration( - // // color: Colors.white, - // // borderRadius: BorderRadius.circular(16), - // ), - // child: Obx(() => ListView( - // padding: const EdgeInsets.fromLTRB( - // 0, - // 5, - // 0, - // 0, - // ), - // shrinkWrap: true, - // scrollDirection: Axis.vertical, - // children: (controller.model.issueList! - // .asMap() - // .entries - // .map((e) => IssuePreviewWidget( - // index: e.key, - // issueListController: controller)) - // .toList() as List))), - // ), - // ), - // ), - // ], - // ), - // ); - // }), + ), + // 左侧图标 + Positioned( + left: 0.rpx, + child: returnIconButtomNew, + ), + ], ), ), - )); + actions: [], + centerTitle: false, + ), + // backgroundColor: FlutterFlowTheme.of(context).primaryBackground, + body: Container( + width: bodysize!.maxWidth, + height: bodysize!.maxHeight * 1, + decoration: BoxDecoration( + // color: AppColors.bg_color, + // color: Color(0xFFF6F6F6), + ), + child: Obx(() { + if (controller.model.isLoading) { + return Center(child: CircularProgressIndicator()); // ✅ 加载中 + } + + if (controller.model.issueList.isEmpty) { + return Container( + width: MediaQuery.sizeOf(context).width, + height: 100, + child: Padding( + padding: EdgeInsetsDirectional.fromSTEB(31, 27, 0, 0), + child: Align( + alignment: AlignmentDirectional(-1, 0), + child: Text( + '暂无内容!', + style: TextStyle( + fontFamily: 'Readex Pro', + color: Color(0xFF9EA4B7), + fontSize: AppFontsize.title_size, + fontWeight: FontWeight.w600, + ), + ), + ), + ), + ); + } + + // 有数据时渲染列表 + return ListView( + children: controller.model.issueList! + .asMap() + .entries + .map((e) => IssuePreviewWidget( + index: e.key, + issueListController: controller, + )) + .toList(), + ); + }), + + // Obx(() { + // return Visibility( + // visible: controller.model.issueList != null && + // controller.model.issueList.isNotEmpty, + // replacement: Container( + // width: MediaQuery.sizeOf(context).width, + // height: 100, + // decoration: BoxDecoration( + // color: FlutterFlowTheme.of(context).secondaryBackground, + // ), + // child: Padding( + // padding: EdgeInsetsDirectional.fromSTEB(31, 27, 0, 0), + // child: Column( + // mainAxisSize: MainAxisSize.max, + // children: [ + // Align( + // alignment: AlignmentDirectional(-1, 0), + // child: Text( + // '暂无内容!', + // style: FlutterFlowTheme.of(context) + // .bodyMedium + // .override( + // fontFamily: 'Readex Pro', + // color: Color(0xFF9EA4B7), + // fontSize: AppFontsize.title_size, + // letterSpacing: 0, + // fontWeight: FontWeight.w600, + // ), + // ), + // ), + // ], + // ), + // ), + // ), + // child: Column( + // mainAxisSize: MainAxisSize.max, + // children: [ + // // TitleComponentWidget( + // // titleName: '问题与帮助', + // // ), + // Flexible( + // child: Padding( + // padding: + // EdgeInsetsDirectional.fromSTEB(15, 13, 15, 15), + // child: Container( + // width: bodysize!.maxWidth, + // decoration: BoxDecoration( + // // color: Colors.white, + // // borderRadius: BorderRadius.circular(16), + // ), + // child: Obx(() => ListView( + // padding: const EdgeInsets.fromLTRB( + // 0, + // 5, + // 0, + // 0, + // ), + // shrinkWrap: true, + // scrollDirection: Axis.vertical, + // children: (controller.model.issueList! + // .asMap() + // .entries + // .map((e) => IssuePreviewWidget( + // index: e.key, + // issueListController: controller)) + // .toList() as List))), + // ), + // ), + // ), + // ], + // ), + // ); + // }), + ), + ), + )); }); } } diff --git a/lib/pages/mh_page/message/messageDetail.dart b/lib/pages/mh_page/message/messageDetail.dart index 74fefed..1a1ec60 100644 --- a/lib/pages/mh_page/message/messageDetail.dart +++ b/lib/pages/mh_page/message/messageDetail.dart @@ -29,7 +29,7 @@ class _MessageDetailPageState extends State { var messageInfo = widget.data; return LayoutBuilder( builder: (context, boxConstraints) => GestureDetector( - onTap: () => FocusScope.of(context).unfocus(), + // onTap: () => FocusScope.of(context).unfocus(),, child: Container( decoration: const BoxDecoration( image: DecorationImage( diff --git a/lib/pages/mh_page/message_page.dart b/lib/pages/mh_page/message_page.dart index 36b69b8..82c51af 100644 --- a/lib/pages/mh_page/message_page.dart +++ b/lib/pages/mh_page/message_page.dart @@ -144,7 +144,7 @@ class _MessagePageState extends State { return LayoutBuilder( builder: (context, boxConstraints) => GestureDetector( - onTap: () => FocusScope.of(context).unfocus(), + // onTap: () => FocusScope.of(context).unfocus(),, child: Container( decoration: const BoxDecoration( image: DecorationImage( @@ -261,7 +261,6 @@ class _MessagePageState extends State { ), ), ); - } Container bottomIcon(BuildContext context) { diff --git a/lib/pages/mh_page/my_experience_page.dart b/lib/pages/mh_page/my_experience_page.dart index 9674f11..3119e99 100644 --- a/lib/pages/mh_page/my_experience_page.dart +++ b/lib/pages/mh_page/my_experience_page.dart @@ -50,103 +50,102 @@ class _MyExperiencePageState extends State { @override Widget build(BuildContext context) { return GestureDetector( - onTap: () => FocusScope.of(context).unfocus(), + // onTap: () => FocusScope.of(context).unfocus(),, child: Container( - decoration: const BoxDecoration( - image: DecorationImage( - image: AssetImage('assets/images/new_background.png'), // 本地图片 - fit: BoxFit.fill, // 填满整个 Container - ), - ), - child: Scaffold( - // key: scaffoldKey, - backgroundColor: Colors.transparent, - appBar: AppBar( - backgroundColor: Colors.transparent, - automaticallyImplyLeading: false, - iconTheme: IconThemeData(color: Colors.white), - titleSpacing: 0, - // leading: returnIconButtomAddCallback(() { - // controller.saveDataApi(); - // updateParm(isShowToast: false); - // }), - // leading: returnIconButtomNew, - title: Container( - width: double.infinity, - height: 180.rpx, - child: Stack( - alignment: Alignment.center, - children: [ - // 中间居中的标题 - Text( - '我的预约', - textAlign: TextAlign.center, - style: TextStyle( - color: Colors.white, - fontSize: 30.rpx, - ), - ), - // 左侧图标 - Positioned( - left: 0.rpx, - child: returnIconButtomNew, - ), - ], + decoration: const BoxDecoration( + image: DecorationImage( + image: AssetImage('assets/images/new_background.png'), // 本地图片 + fit: BoxFit.fill, // 填满整个 Container + ), + ), + child: Scaffold( + // key: scaffoldKey, + backgroundColor: Colors.transparent, + appBar: AppBar( + backgroundColor: Colors.transparent, + automaticallyImplyLeading: false, + iconTheme: IconThemeData(color: Colors.white), + titleSpacing: 0, + // leading: returnIconButtomAddCallback(() { + // controller.saveDataApi(); + // updateParm(isShowToast: false); + // }), + // leading: returnIconButtomNew, + title: Container( + width: double.infinity, + height: 180.rpx, + child: Stack( + alignment: Alignment.center, + children: [ + // 中间居中的标题 + Text( + '我的预约', + textAlign: TextAlign.center, + style: TextStyle( + color: Colors.white, + fontSize: 30.rpx, + ), ), - ), - - actions: [], - centerTitle: false, - ), - - body: Container( - width: MediaQuery.sizeOf(context).width, - height: MediaQuery.sizeOf(context).height * 1, - decoration: BoxDecoration( - color: Color(0xFFF6F6F6), - ), - child: Column( - mainAxisSize: MainAxisSize.max, - children: [ - // TitleComponentWidget( - // titleName: '我的预约', - // ), - Obx(() { - if (controller.model.bookInfoList.length == 0) { - return Empty(); - } else { - return Container(); - } - }), - Expanded( - child: Container( - width: MediaQuery.sizeOf(context).width, - height: MediaQuery.sizeOf(context).height * 1, - decoration: BoxDecoration(), - child: Obx(() => ListView( - controller: scrollController, - shrinkWrap: true, - scrollDirection: Axis.vertical, - children: [ - const SizedBox( - height: AppConstants.list_start_height), - ...List.generate( - controller.model.bookInfoList.length, - (index) { - return MyExperienceWidget( - index: index, - bookExperienceListController: controller); - }), - SizedBox( - height: AppConstants.list_end_height, - ) - ], - ))), - ) - ], - ), + // 左侧图标 + Positioned( + left: 0.rpx, + child: returnIconButtomNew, + ), + ], ), ), - )); + + actions: [], + centerTitle: false, + ), + + body: Container( + width: MediaQuery.sizeOf(context).width, + height: MediaQuery.sizeOf(context).height * 1, + decoration: BoxDecoration( + color: Color(0xFFF6F6F6), + ), + child: Column( + mainAxisSize: MainAxisSize.max, + children: [ + // TitleComponentWidget( + // titleName: '我的预约', + // ), + Obx(() { + if (controller.model.bookInfoList.length == 0) { + return Empty(); + } else { + return Container(); + } + }), + Expanded( + child: Container( + width: MediaQuery.sizeOf(context).width, + height: MediaQuery.sizeOf(context).height * 1, + decoration: BoxDecoration(), + child: Obx(() => ListView( + controller: scrollController, + shrinkWrap: true, + scrollDirection: Axis.vertical, + children: [ + const SizedBox( + height: AppConstants.list_start_height), + ...List.generate( + controller.model.bookInfoList.length, (index) { + return MyExperienceWidget( + index: index, + bookExperienceListController: controller); + }), + SizedBox( + height: AppConstants.list_end_height, + ) + ], + ))), + ) + ], + ), + ), + ), + )); } } diff --git a/lib/pages/mh_page/new_mine_page.dart b/lib/pages/mh_page/new_mine_page.dart index 76609c9..63df525 100644 --- a/lib/pages/mh_page/new_mine_page.dart +++ b/lib/pages/mh_page/new_mine_page.dart @@ -71,7 +71,7 @@ class _MinePageState extends State { int login = userInfoController.model.login!; return LayoutBuilder( builder: (context, bodySize) => GestureDetector( - onTap: () => FocusScope.of(context).unfocus(), + // onTap: () => FocusScope.of(context).unfocus(),, child: Container( decoration: const BoxDecoration( image: DecorationImage( diff --git a/lib/pages/mh_page/new_settingPage.dart b/lib/pages/mh_page/new_settingPage.dart index fea8db7..a4eab22 100644 --- a/lib/pages/mh_page/new_settingPage.dart +++ b/lib/pages/mh_page/new_settingPage.dart @@ -31,7 +31,7 @@ class _SettingPageState extends State { Widget build(BuildContext context) { return LayoutBuilder(builder: (context, bodySize) { return GestureDetector( - onTap: () => FocusScope.of(context).unfocus(), + // onTap: () => FocusScope.of(context).unfocus(),, child: Container( decoration: const BoxDecoration( image: DecorationImage( diff --git a/lib/pages/mh_page/privacy_policy.dart b/lib/pages/mh_page/privacy_policy.dart index 7879c0b..bd0f70a 100644 --- a/lib/pages/mh_page/privacy_policy.dart +++ b/lib/pages/mh_page/privacy_policy.dart @@ -37,7 +37,7 @@ class _PrivacyPolicyPageState extends State { Widget build(BuildContext context) { return LayoutBuilder( builder: (context, bodySize) => GestureDetector( - onTap: () => FocusScope.of(context).unfocus(), + // onTap: () => FocusScope.of(context).unfocus(),, child: Container( decoration: BoxDecoration( image: DecorationImage( @@ -71,6 +71,7 @@ class _PrivacyPolicyPageState extends State { fontSize: 30.rpx, ), ), + /// 左边返回按钮 Positioned( left: 0, diff --git a/lib/pages/mh_page/repair_history_page.dart b/lib/pages/mh_page/repair_history_page.dart index 211cd9e..84babac 100644 --- a/lib/pages/mh_page/repair_history_page.dart +++ b/lib/pages/mh_page/repair_history_page.dart @@ -73,485 +73,499 @@ class RepairHistoryListPage extends GetView { bodysize = cc; return WillPopScope( child: GestureDetector( - onTap: () => FocusScope.of(context).unfocus(), + // onTap: () => FocusScope.of(context).unfocus(),, child: Container( - decoration: const BoxDecoration( - image: DecorationImage( - image: AssetImage('assets/images/new_background.png'), // 本地图片 - fit: BoxFit.fill, // 填满整个 Container + decoration: const BoxDecoration( + image: DecorationImage( + image: AssetImage('assets/images/new_background.png'), // 本地图片 + fit: BoxFit.fill, // 填满整个 Container + ), + ), + child: Scaffold( + // key: scaffoldKey, + backgroundColor: Colors.transparent, + appBar: AppBar( + backgroundColor: Colors.transparent, + iconTheme: const IconThemeData(color: Colors.white), + automaticallyImplyLeading: false, + titleSpacing: 0, + title: SizedBox( + width: double.infinity, + height: 180.rpx, + child: Stack( + alignment: Alignment.center, + children: [ + // 中间居中的标题 + Text( + '详情', + textAlign: TextAlign.center, + style: TextStyle( + color: Colors.white, + fontSize: 30.rpx, + ), + ), + // 左侧图标 + Positioned( + left: 0.rpx, + child: returnIconButtomNew, + ), + ], ), ), - child: Scaffold( - // key: scaffoldKey, - backgroundColor: Colors.transparent, - appBar: AppBar( - backgroundColor: Colors.transparent, - iconTheme: const IconThemeData(color: Colors.white), - automaticallyImplyLeading: false, - titleSpacing: 0, - title: SizedBox( - width: double.infinity, - height: 180.rpx, - child: Stack( - alignment: Alignment.center, - children: [ - // 中间居中的标题 - Text( - '详情', - textAlign: TextAlign.center, - style: TextStyle( - color: Colors.white, - fontSize: 30.rpx, - ), - ), - // 左侧图标 - Positioned( - left: 0.rpx, - child: returnIconButtomNew, - ), - ], - ), - ), - centerTitle: false, - ), + centerTitle: false, + ), - body: Container( - width: bodysize!.maxWidth, - height: bodysize!.maxHeight * 1, - child: Column( - mainAxisSize: MainAxisSize.max, - children: [ - Expanded( - child: Padding( - padding: EdgeInsetsDirectional.fromSTEB( - 30.rpx, 30.rpx, 30.rpx, 0), - child: Container( - width: bodysize!.maxWidth, - height: bodysize!.maxHeight * 1, - child: SingleChildScrollView( - child: Column( - mainAxisSize: MainAxisSize.max, - children: [ - Padding( + body: Container( + width: bodysize!.maxWidth, + height: bodysize!.maxHeight * 1, + child: Column( + mainAxisSize: MainAxisSize.max, + children: [ + Expanded( + child: Padding( + padding: EdgeInsetsDirectional.fromSTEB( + 30.rpx, 30.rpx, 30.rpx, 0), + child: Container( + width: bodysize!.maxWidth, + height: bodysize!.maxHeight * 1, + child: SingleChildScrollView( + child: Column( + mainAxisSize: MainAxisSize.max, + children: [ + Padding( + padding: EdgeInsetsDirectional.fromSTEB( + 0, 0, 0, 20.rpx), + child: Container( + width: MediaQuery.sizeOf(context).width, + decoration: BoxDecoration( + color: Color(0xFF003058), //true + borderRadius: BorderRadius.circular(8), + ), + child: Padding( + padding: EdgeInsetsDirectional.fromSTEB( + 34.rpx, 10, 0, 0), + child: Container( + decoration: const BoxDecoration(), + child: Column( + mainAxisSize: MainAxisSize.max, + children: [ + Align( + alignment: + const AlignmentDirectional( + -1, 0), + child: Text( + // 'SWES01号智能一键入眠床', + data['device'][0]['name'] ?? + '未命名', + style: TextStyle( + fontFamily: 'Readex Pro', + fontSize: 30.rpx, + letterSpacing: 0, + color: Colors.white, + ), + ), + ), + Align( + alignment: + const AlignmentDirectional( + -1, 0), + child: Text( + '系列:' + + (data['device'][0][ + 'device_category'] ?? + '未命名'), + style: TextStyle( + fontFamily: 'Readex Pro', + color: + const Color(0xFF929699), + fontSize: 26.rpx, + letterSpacing: 0, + ), + ), + ), + Align( + alignment: + const AlignmentDirectional( + -1, 0), + child: Text( + '类型:' + + getDeviceTypeName( + controller + .model + .applyRepairModel + ?.device_type, + ), + style: TextStyle( + fontFamily: 'Readex Pro', + color: + const Color(0xFF929699), + fontSize: 26.rpx, + letterSpacing: 0, + ), + ), + ), + Align( + alignment: + const AlignmentDirectional( + -1, 0), + child: Text( + '序列号:' + + (controller + .model + .applyRepairModel! + .device_id ?? + '未命名'), + style: TextStyle( + fontFamily: 'Readex Pro', + color: + const Color(0xFF929699), + fontSize: 26.rpx, + letterSpacing: 0, + ), + ), + ), + Align( + alignment: + const AlignmentDirectional( + -1, 0), + child: Text( + '报修单号:' + + (controller + .model + .applyRepairModel! + .id + .toString() ?? + '未命名'), + style: TextStyle( + fontFamily: 'Readex Pro', + color: + const Color(0xFF929699), + fontSize: 26.rpx, + letterSpacing: 0, + ), + ), + ), + Align( + alignment: + const AlignmentDirectional( + -1, 0), + child: Text( + '提交时间:' + + (MyUtils.formatDateTimeDay( + data['device'][0] + ['create_time']!)), + style: TextStyle( + fontFamily: 'Readex Pro', + color: + const Color(0xFF929699), + fontSize: 26.rpx, + letterSpacing: 0, + ), + ), + ), + Align( + alignment: + const AlignmentDirectional( + -1, 0), + child: Text( + '问题描述:' + + (data['device'][0] + ['desc'] ?? + '未命名'), + style: TextStyle( + fontFamily: 'Readex Pro', + color: + const Color(0xFF929699), + fontSize: 26.rpx, + letterSpacing: 0, + ), + ), + ), + Padding( + padding: + const EdgeInsetsDirectional + .fromSTEB(0, 10, 0, 24), + child: Container( + width: + MediaQuery.sizeOf(context) + .width, + height: + MediaQuery.sizeOf(context) + .height * + 0.15, + constraints: + const BoxConstraints( + + // minHeight: 140, + ), + child: Container( + width: 100, + height: 100, + child: Obx(() => ListView( + shrinkWrap: true, + scrollDirection: + Axis.horizontal, + children: getImage( + controller + .model + .applyRepairModel!) + .divide( + const SizedBox( + width: 12, + )) + .addToStart( + const SizedBox( + width: 0, + ))))), + )), + ] + .divide(const SizedBox(height: 5)) + .addToStart(const SizedBox( + height: 5, + )), + ), + )), + ), + ), + Padding( + padding: const EdgeInsetsDirectional.fromSTEB( + 0, 25, 0, 25), // 设置上下间距为 34 + child: Align( + alignment: + AlignmentDirectional.centerStart, // 文字左对齐 + child: Text( + '报修状态', + style: TextStyle( + fontFamily: 'Readex Pro', + color: Colors.white, + fontSize: 30.rpx, + letterSpacing: 0.0, + ), + ), + ), + ), + Container( + width: bodysize!.maxWidth, // 设置宽度自适应 + child: ListView.builder( + shrinkWrap: true, // 让ListView根据内容自适应高度 + physics: + const NeverScrollableScrollPhysics(), // 禁用内部滚动,交由外部滚动视图处理 + itemCount: events.length, + itemBuilder: (context, index) { + bool isLast = index == events.length - 1; + return TimelineTile( + isFirst: index == 0, + isLast: isLast, + axis: TimelineAxis.vertical, // 垂直方向时间轴 + alignment: TimelineAlign.start, // 线条左对齐 + lineXY: 0.5, // 线条和圆圈相对位置 + indicatorStyle: IndicatorStyle( + width: 15, // 圆圈的宽度 + padding: const EdgeInsets.all( + 1), // 避免线条进入圆圈内部 + indicatorXY: 0.2, // 圆圈居中 + indicator: Container( + decoration: BoxDecoration( + shape: BoxShape.circle, + border: Border.all( + color: const Color( + 0xFFC8CBD2), // 最后一个元素为蓝色 + width: 1, + ), + color: stringToColor("#C8CBD2"), + ), + ), + ), + beforeLineStyle: LineStyle( + color: + stringToColor("#C8CBD2"), // 上方线条颜色 + thickness: 1, // 线条厚度 + ), + afterLineStyle: LineStyle( + color: stringToColor( + "#C8CBD2"), // 最后一个节点的线条颜色 + thickness: 1, // 线条厚度 + ), + endChild: Padding( + padding: const EdgeInsets.all(8.0), + child: RepairStatusWidget( + index: index, + repairInfoController: controller, + ), + ), + ); + }, + ), + ), + Obx(() { + if (RepairStatus.completed == + controller + .model.applyRepairModel!.status && + controller.model.applyRepairModel!.score == + null) { + return Align( + alignment: const AlignmentDirectional(1, 0), + child: Padding( + padding: EdgeInsetsDirectional.fromSTEB( + 34.rpx, 66.rpx, 0, 48.rpx), + child: Container( + width: 61, + height: + MediaQuery.sizeOf(context).height * + 0.03, + constraints: const BoxConstraints( + minHeight: 24, + ), + decoration: const BoxDecoration(), + child: FFButtonWidget( + onPressed: () { + Get.toNamed("/scorePage"); + }, + text: '待评价', + options: FFButtonOptions( + height: 40, + padding: const EdgeInsetsDirectional + .fromSTEB(0, 0, 0, 0), + iconPadding: + const EdgeInsetsDirectional + .fromSTEB(0, 0, 0, 0), + // color: FlutterFlowTheme.of(context) + // .secondaryBackground, + color: Colors.white, + textStyle: TextStyle( + fontFamily: 'Readex Pro', + // color: Color(0xFF333333), + // color: stringToColor("#D3B684"), + color: stringToColor("#117EFD"), + fontSize: 11, + letterSpacing: 0, + ), + elevation: 0, + borderSide: BorderSide( + // color: Color(0xFFC8CBD2), + // color: stringToColor("#D3B684"), + color: stringToColor("#117EFD"), + width: 1, + ), + borderRadius: + BorderRadius.circular(50), + ), + ), + ), + ), + ); + } + return Container(); + }), + Obx(() { + if (RepairStatus.completed == + controller + .model.applyRepairModel!.status && + controller.model.applyRepairModel!.score != + null) { + return Padding( padding: EdgeInsetsDirectional.fromSTEB( - 0, 0, 0, 20.rpx), + 0, 0, 0, 10.rpx), child: Container( width: MediaQuery.sizeOf(context).width, decoration: BoxDecoration( - color: Color(0xFF003058), //true - borderRadius: BorderRadius.circular(8), + color: Colors.white, //true + borderRadius: + BorderRadius.circular(16.rpx), ), child: Padding( - padding: - EdgeInsetsDirectional.fromSTEB( - 34.rpx, 10, 0, 0), - child: Container( - decoration: const BoxDecoration(), - child: Column( - mainAxisSize: MainAxisSize.max, - children: [ - Align( - alignment: - const AlignmentDirectional( - -1, 0), - child: Text( - // 'SWES01号智能一键入眠床', - data['device'][0]['name'] ?? - '未命名', - style: TextStyle( - fontFamily: 'Readex Pro', - fontSize: 30.rpx, - letterSpacing: 0, - color: Colors.white, - ), - ), - ), - Align( - alignment: - const AlignmentDirectional( - -1, 0), - child: Text( - '系列:' + - (data['device'][0][ - 'device_category'] ?? - '未命名'), - style: TextStyle( - fontFamily: 'Readex Pro', - color: const Color( - 0xFF929699), - fontSize: 26.rpx, - letterSpacing: 0, - ), - ), - ), - Align( - alignment: - const AlignmentDirectional( - -1, 0), - child: Text( - '类型:' + - getDeviceTypeName( - controller - .model - .applyRepairModel - ?.device_type, - ), - style: TextStyle( - fontFamily: 'Readex Pro', - color: const Color( - 0xFF929699), - fontSize: 26.rpx, - letterSpacing: 0, - ), - ), - ), - Align( - alignment: - const AlignmentDirectional( - -1, 0), - child: Text( - '序列号:' + - (controller - .model - .applyRepairModel! - .device_id ?? - '未命名'), - style: TextStyle( - fontFamily: 'Readex Pro', - color: const Color( - 0xFF929699), - fontSize: 26.rpx, - letterSpacing: 0, - ), - ), - ), - Align( - alignment: - const AlignmentDirectional( - -1, 0), - child: Text( - '报修单号:' + - (controller - .model - .applyRepairModel! - .id - .toString() ?? - '未命名'), - style: TextStyle( - fontFamily: 'Readex Pro', - color: const Color( - 0xFF929699), - fontSize: 26.rpx, - letterSpacing: 0, - ), - ), - ), - Align( - alignment: - const AlignmentDirectional( - -1, 0), - child: Text( - '提交时间:' + - (MyUtils.formatDateTimeDay( - data['device'][0][ - 'create_time']!)), - style: TextStyle( - fontFamily: 'Readex Pro', - color: const Color( - 0xFF929699), - fontSize: 26.rpx, - letterSpacing: 0, - ), - ), - ), - Align( - alignment: - const AlignmentDirectional( - -1, 0), - child: Text( - '问题描述:' + - (data['device'][0] - ['desc'] ?? - '未命名'), - style: TextStyle( - fontFamily: 'Readex Pro', - color: const Color( - 0xFF929699), - fontSize: 26.rpx, - letterSpacing: 0, - ), - ), - ), - Padding( - padding: - const EdgeInsetsDirectional - .fromSTEB( - 0, 10, 0, 24), - child: Container( - width: MediaQuery.sizeOf( - context) - .width, - height: MediaQuery.sizeOf( - context) - .height * - 0.15, - constraints: - const BoxConstraints( - - // minHeight: 140, - ), - child: Container( - width: 100, - height: 100, - child: Obx(() => - ListView( - shrinkWrap: - true, - scrollDirection: - Axis - .horizontal, - children: getImage(controller - .model - .applyRepairModel!) - .divide( - const SizedBox( - width: - 12, - )) - .addToStart( - const SizedBox( - width: - 0, - ))))), - )), - ] - .divide( - const SizedBox(height: 5)) - .addToStart(const SizedBox( - height: 5, - )), - ), - )), - ), - ), - Padding( - padding: - const EdgeInsetsDirectional.fromSTEB( - 0, 25, 0, 25), // 设置上下间距为 34 - child: Align( - alignment: AlignmentDirectional - .centerStart, // 文字左对齐 - child: Text( - '报修状态', - style: TextStyle( - fontFamily: 'Readex Pro', - color: Colors.white, - fontSize: 30.rpx, - letterSpacing: 0.0, - ), - ), - ), - ), - Container( - width: bodysize!.maxWidth, // 设置宽度自适应 - child: ListView.builder( - shrinkWrap: true, // 让ListView根据内容自适应高度 - physics: - const NeverScrollableScrollPhysics(), // 禁用内部滚动,交由外部滚动视图处理 - itemCount: events.length, - itemBuilder: (context, index) { - bool isLast = - index == events.length - 1; - return TimelineTile( - isFirst: index == 0, - isLast: isLast, - axis: - TimelineAxis.vertical, // 垂直方向时间轴 - alignment: - TimelineAlign.start, // 线条左对齐 - lineXY: 0.5, // 线条和圆圈相对位置 - indicatorStyle: IndicatorStyle( - width: 15, // 圆圈的宽度 - padding: const EdgeInsets.all( - 1), // 避免线条进入圆圈内部 - indicatorXY: 0.2, // 圆圈居中 - indicator: Container( - decoration: BoxDecoration( - shape: BoxShape.circle, - border: Border.all( - color: const Color( - 0xFFC8CBD2), // 最后一个元素为蓝色 - width: 1, - ), - color: stringToColor("#C8CBD2"), - ), - ), - ), - beforeLineStyle: LineStyle( - color: stringToColor( - "#C8CBD2"), // 上方线条颜色 - thickness: 1, // 线条厚度 - ), - afterLineStyle: LineStyle( - color: stringToColor( - "#C8CBD2"), // 最后一个节点的线条颜色 - thickness: 1, // 线条厚度 - ), - endChild: Padding( - padding: const EdgeInsets.all(8.0), - child: RepairStatusWidget( - index: index, - repairInfoController: controller, - ), - ), - ); - }, - ), - ), - Obx(() { - if (RepairStatus.completed == - controller.model.applyRepairModel! - .status && - controller.model.applyRepairModel! - .score == - null) { - return Align( - alignment: - const AlignmentDirectional(1, 0), - child: Padding( - padding: - EdgeInsetsDirectional.fromSTEB( - 34.rpx, 66.rpx, 0, 48.rpx), - child: Container( - width: 61, - height: MediaQuery.sizeOf(context) - .height * - 0.03, - constraints: const BoxConstraints( - minHeight: 24, - ), - decoration: const BoxDecoration(), - child: FFButtonWidget( - onPressed: () { - Get.toNamed("/scorePage"); - }, - text: '待评价', - options: FFButtonOptions( - height: 40, + padding: const EdgeInsetsDirectional + .fromSTEB(0, 0, 0, 0), + child: Container( + decoration: const BoxDecoration(), + child: Column( + mainAxisSize: MainAxisSize.max, + children: [ + Padding( padding: const EdgeInsetsDirectional - .fromSTEB(0, 0, 0, 0), - iconPadding: - const EdgeInsetsDirectional - .fromSTEB(0, 0, 0, 0), - // color: FlutterFlowTheme.of(context) - // .secondaryBackground, - color: Colors.white, - textStyle: TextStyle( - fontFamily: 'Readex Pro', - // color: Color(0xFF333333), - // color: stringToColor("#D3B684"), - color: - stringToColor("#117EFD"), - fontSize: 11, - letterSpacing: 0, - ), - elevation: 0, - borderSide: BorderSide( - // color: Color(0xFFC8CBD2), - // color: stringToColor("#D3B684"), - color: - stringToColor("#117EFD"), - width: 1, - ), - borderRadius: - BorderRadius.circular(50), - ), - ), - ), - ), - ); - } - return Container(); - }), - Obx(() { - if (RepairStatus.completed == - controller.model.applyRepairModel! - .status && - controller.model.applyRepairModel! - .score != - null) { - return Padding( - padding: EdgeInsetsDirectional.fromSTEB( - 0, 0, 0, 10.rpx), - child: Container( - width: - MediaQuery.sizeOf(context).width, - decoration: BoxDecoration( - color: Colors.white, //true - borderRadius: - BorderRadius.circular(16.rpx), - ), - child: Padding( - padding: const EdgeInsetsDirectional - .fromSTEB(0, 0, 0, 0), - child: Container( - decoration: const BoxDecoration(), - child: Column( - mainAxisSize: MainAxisSize.max, - children: [ - Padding( - padding: - const EdgeInsetsDirectional - .fromSTEB( - 17, 0, 30, 10), - child: Container( - width: MediaQuery.sizeOf( - context) + .fromSTEB( + 17, 0, 30, 10), + child: Container( + width: + MediaQuery.sizeOf(context) .width, - height: 30, - decoration: - const BoxDecoration(), - child: Align( - alignment: - const AlignmentDirectional( - -1, 0), - child: Text( - '评价状态', - style: TextStyle( - fontFamily: - 'Readex Pro', - color: const Color( - 0xFF333333), - fontSize: 15, - letterSpacing: 0.0, - ), - ), - ), - ), - ), - Align( + height: 30, + decoration: + const BoxDecoration(), + child: Align( alignment: const AlignmentDirectional( -1, 0), - child: Padding( - padding: - EdgeInsetsDirectional - .fromSTEB(34.rpx, - 0, 0, 0), - child: Container( - width: - MediaQuery.sizeOf( - context) - .width, - constraints: - const BoxConstraints( - minHeight: 24, + child: Text( + '评价状态', + style: TextStyle( + fontFamily: + 'Readex Pro', + color: const Color( + 0xFF333333), + fontSize: 15, + letterSpacing: 0.0, + ), + ), + ), + ), + ), + Align( + alignment: + const AlignmentDirectional( + -1, 0), + child: Padding( + padding: EdgeInsetsDirectional + .fromSTEB( + 34.rpx, 0, 0, 0), + child: Container( + width: MediaQuery.sizeOf( + context) + .width, + constraints: + const BoxConstraints( + minHeight: 24, + ), + decoration: + const BoxDecoration(), + child: // Generated code for this Column Widget... + Column( + mainAxisSize: + MainAxisSize.max, + children: [ + Align( + alignment: + const AlignmentDirectional( + -1, 0), + child: Padding( + padding: + EdgeInsetsDirectional + .fromSTEB( + 0, + 0, + 0, + 20.rpx), + child: Text( + // '2023-08-22 12:12:44', + MyUtils.formatDateTime( + controller + .model + .applyRepairModel! + .score_time!), + style: TextStyle( + fontFamily: + 'Readex Pro', + fontSize: + AppFontsize + .normal_text_size, + letterSpacing: + 0.0, + ), + ), + ), ), - decoration: - const BoxDecoration(), - child: // Generated code for this Column Widget... - Column( + Row( mainAxisSize: MainAxisSize.max, children: [ @@ -560,19 +574,15 @@ class RepairHistoryListPage extends GetView { const AlignmentDirectional( -1, 0), child: Padding( - padding: EdgeInsetsDirectional - .fromSTEB( + padding: + const EdgeInsetsDirectional + .fromSTEB( 0, 0, - 0, - 20.rpx), + 5, + 0), child: Text( - // '2023-08-22 12:12:44', - MyUtils.formatDateTime( - controller - .model - .applyRepairModel! - .score_time!), + '已评价', style: TextStyle( fontFamily: @@ -586,139 +596,106 @@ class RepairHistoryListPage extends GetView { ), ), ), - Row( - mainAxisSize: - MainAxisSize - .max, - children: [ - Align( - alignment: - const AlignmentDirectional( - -1, - 0), - child: - Padding( - padding: - const EdgeInsetsDirectional - .fromSTEB( - 0, - 0, - 5, - 0), - child: Text( - '已评价', - style: - TextStyle( - fontFamily: - 'Readex Pro', - fontSize: - AppFontsize.normal_text_size, - letterSpacing: - 0.0, - ), - ), - ), - ), - Icon( - Icons.star, - color: controller - .model - .applyRepairModel! - .score! >= - 1 - ? stringToColor( - "#F8AE00") - : stringToColor( - "#D0D0D0"), - size: 14, - ), - Icon( - Icons.star, - color: controller - .model - .applyRepairModel! - .score! >= - 2 - ? stringToColor( - "#F8AE00") - : stringToColor( - "#D0D0D0"), - size: 14, - ), - Icon( - Icons.star, - color: controller - .model - .applyRepairModel! - .score! >= - 3 - ? stringToColor( - "#F8AE00") - : stringToColor( - "#D0D0D0"), - size: 14, - ), - Icon( - Icons.star, - color: controller - .model - .applyRepairModel! - .score! >= - 4 - ? stringToColor( - "#F8AE00") - : stringToColor( - "#D0D0D0"), - size: 14, - ), - Icon( - Icons.star, - color: controller - .model - .applyRepairModel! - .score! >= - 5 - ? stringToColor( - "#F8AE00") - : stringToColor( - "#D0D0D0"), - size: 14, - ), - ], + Icon( + Icons.star, + color: controller + .model + .applyRepairModel! + .score! >= + 1 + ? stringToColor( + "#F8AE00") + : stringToColor( + "#D0D0D0"), + size: 14, + ), + Icon( + Icons.star, + color: controller + .model + .applyRepairModel! + .score! >= + 2 + ? stringToColor( + "#F8AE00") + : stringToColor( + "#D0D0D0"), + size: 14, + ), + Icon( + Icons.star, + color: controller + .model + .applyRepairModel! + .score! >= + 3 + ? stringToColor( + "#F8AE00") + : stringToColor( + "#D0D0D0"), + size: 14, + ), + Icon( + Icons.star, + color: controller + .model + .applyRepairModel! + .score! >= + 4 + ? stringToColor( + "#F8AE00") + : stringToColor( + "#D0D0D0"), + size: 14, + ), + Icon( + Icons.star, + color: controller + .model + .applyRepairModel! + .score! >= + 5 + ? stringToColor( + "#F8AE00") + : stringToColor( + "#D0D0D0"), + size: 14, ), ], ), - ), + ], ), ), - ] - .divide(const SizedBox( - height: 0)) - .addToStart(const SizedBox( - height: 5, - )) - .addToEnd(const SizedBox( - height: 15, - )), + ), ), - ), + ] + .divide( + const SizedBox(height: 0)) + .addToStart(const SizedBox( + height: 5, + )) + .addToEnd(const SizedBox( + height: 15, + )), ), ), - ); - } - return Container(); - }), - ], - ), - ), + ), + ), + ); + } + return Container(); + }), + ], ), ), ), - ], + ), ), - ), + ], ), - )), + ), + ), + )), onWillPop: () async { // 处理返回事件,比如弹出提示框等 print("页面返回事件"); diff --git a/lib/pages/mh_page/repair_list.dart b/lib/pages/mh_page/repair_list.dart index 5481b45..04e35b1 100644 --- a/lib/pages/mh_page/repair_list.dart +++ b/lib/pages/mh_page/repair_list.dart @@ -39,231 +39,221 @@ class DeviceRepairPage extends GetView { @override Widget build(BuildContext context) { - return LayoutBuilder(builder: (context, cc) { bodysize = cc; return GestureDetector( - onTap: () => FocusScope.of(context).unfocus(), + // onTap: () => FocusScope.of(context).unfocus(),, child: Container( - decoration: const BoxDecoration( - image: DecorationImage( - image: AssetImage('assets/images/new_background.png'), // 本地图片 - fit: BoxFit.fill, // 填满整个 Container - ), - ), - child: Scaffold( - // key: scaffoldKey, - backgroundColor: Colors.transparent, - appBar: AppBar( - backgroundColor: Colors.transparent, - iconTheme: const IconThemeData(color: Colors.white), - automaticallyImplyLeading: false, - titleSpacing: 0, - title: SizedBox( - width: double.infinity, - height: 180.rpx, - child: Stack( - alignment: Alignment.center, - children: [ - // 中间居中的标题 - Text( - '设备报修', - textAlign: TextAlign.center, - style: TextStyle( - color: Colors.white, - fontSize: 30.rpx, - ), - ), - // 左侧图标 - Positioned( - left: 0.rpx, - child: returnIconButtomNew, - ), - ], + decoration: const BoxDecoration( + image: DecorationImage( + image: AssetImage('assets/images/new_background.png'), // 本地图片 + fit: BoxFit.fill, // 填满整个 Container + ), + ), + child: Scaffold( + // key: scaffoldKey, + backgroundColor: Colors.transparent, + appBar: AppBar( + backgroundColor: Colors.transparent, + iconTheme: const IconThemeData(color: Colors.white), + automaticallyImplyLeading: false, + titleSpacing: 0, + title: SizedBox( + width: double.infinity, + height: 180.rpx, + child: Stack( + alignment: Alignment.center, + children: [ + // 中间居中的标题 + Text( + '设备报修', + textAlign: TextAlign.center, + style: TextStyle( + color: Colors.white, + fontSize: 30.rpx, + ), ), - ), - centerTitle: false, + // 左侧图标 + Positioned( + left: 0.rpx, + child: returnIconButtomNew, + ), + ], ), - body: SafeArea( - top: true, - child: Padding( - padding: EdgeInsets.fromLTRB(30.rpx, 6.rpx, 30.rpx, 0), - child: Column( - crossAxisAlignment: CrossAxisAlignment.start, - mainAxisAlignment: MainAxisAlignment.spaceBetween, - children: [ - // 报修须知 - Container( - height: 412.rpx, - decoration: BoxDecoration( - border: Border.all( - color: Color(0XFFC8CBD2), width: 0.rpx), - borderRadius: BorderRadius.circular(10), - ), - child: Padding( - padding: EdgeInsets.fromLTRB( - 27.rpx, 49.rpx, 43.rpx, 39.rpx), - child: Column( - crossAxisAlignment: - CrossAxisAlignment.center, - children: [ - // 固定的标题部分 - Text( - "报修须知", - style: TextStyle( - fontSize: 30.rpx, - fontWeight: FontWeight.bold, - color: Colors.white, - ), - textAlign: TextAlign.center, - ), - SizedBox(height: 33.rpx), - // 可滚动的正文部分,限定高度 - Expanded( - child: SingleChildScrollView( - child: RichText( - text: TextSpan( - style: TextStyle( - color: Color(0XFF929699), - fontSize: 26.rpx, - ), - children: [ - TextSpan( - text: - "尊敬的用户,感谢您选择我司产品。在使用过程中,如果设备出现故障需要维修,请首先确认设备是否正确连接控制器或网络,检查设置是否正常,排除误操作问题。若问题依然存在,请记录下设备名称、设备编号、和具体故障内容,方便我们快速地为您提供帮助。您可以通过智慧棉花糖APP保修页面直接报修或拨打 ", - style: TextStyle( - color: - Color(0XFF929699), - fontSize: 26.rpx, - height: 1.3)), - TextSpan( - text: "400-8756-966", - style: TextStyle( - color: Colors.white, - // height: 1.3, - decoration: TextDecoration - .underline, // 添加下划线 - decorationColor: - Colors.white, - decorationThickness: 4.rpx, - ), - recognizer: - TapGestureRecognizer() - ..onTap = () { - MyUtils.makePhoneCall( - "400-8756-966"); - }, - ), - TextSpan( - text: " 反馈。", - style: TextStyle( - color: - Color(0XFF929699), - fontSize: 26.rpx, - height: 1.3)), - ], - ), - ), - ), - ), - ], - ))), - SizedBox(height: 24.rpx), - InkWell( - onTap: () {}, - child: CustomCard( - borderRadius: 16.rpx, - gradientDirection: GradientDirection.vertical, - onTap: () { - Get.toNamed("/applyRepairPage"); - }, - colors: const [ - Color(0xFFFCFCFC), - Color(0xFFF8FAF9), - Color(0XFFECF6F3), - Color(0XFFD9F0E9), - Color(0xFFCEECE3) - ], - child: Container( - width: double.infinity, - height: 90.rpx, - alignment: Alignment.center, - decoration: BoxDecoration( - borderRadius: BorderRadius.circular(6), - ), - child: Text( - "我要报修", + ), + centerTitle: false, + ), + body: SafeArea( + top: true, + child: Padding( + padding: EdgeInsets.fromLTRB(30.rpx, 6.rpx, 30.rpx, 0), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + mainAxisAlignment: MainAxisAlignment.spaceBetween, + children: [ + // 报修须知 + Container( + height: 412.rpx, + decoration: BoxDecoration( + border: Border.all( + color: Color(0XFFC8CBD2), width: 0.rpx), + borderRadius: BorderRadius.circular(10), + ), + child: Padding( + padding: EdgeInsets.fromLTRB( + 27.rpx, 49.rpx, 43.rpx, 39.rpx), + child: Column( + crossAxisAlignment: CrossAxisAlignment.center, + children: [ + // 固定的标题部分 + Text( + "报修须知", style: TextStyle( - fontFamily: 'Readex Pro', - color: stringToColor("#011D33"), - letterSpacing: 0, fontSize: 30.rpx, + fontWeight: FontWeight.bold, + color: Colors.white, + ), + textAlign: TextAlign.center, + ), + SizedBox(height: 33.rpx), + // 可滚动的正文部分,限定高度 + Expanded( + child: SingleChildScrollView( + child: RichText( + text: TextSpan( + style: TextStyle( + color: Color(0XFF929699), + fontSize: 26.rpx, + ), + children: [ + TextSpan( + text: + "尊敬的用户,感谢您选择我司产品。在使用过程中,如果设备出现故障需要维修,请首先确认设备是否正确连接控制器或网络,检查设置是否正常,排除误操作问题。若问题依然存在,请记录下设备名称、设备编号、和具体故障内容,方便我们快速地为您提供帮助。您可以通过智慧棉花糖APP保修页面直接报修或拨打 ", + style: TextStyle( + color: Color(0XFF929699), + fontSize: 26.rpx, + height: 1.3)), + TextSpan( + text: "400-8756-966", + style: TextStyle( + color: Colors.white, + // height: 1.3, + decoration: TextDecoration + .underline, // 添加下划线 + decorationColor: Colors.white, + decorationThickness: 4.rpx, + ), + recognizer: TapGestureRecognizer() + ..onTap = () { + MyUtils.makePhoneCall( + "400-8756-966"); + }, + ), + TextSpan( + text: " 反馈。", + style: TextStyle( + color: Color(0XFF929699), + fontSize: 26.rpx, + height: 1.3)), + ], + ), + ), ), ), - ), - )), - SizedBox(height: 235.rpx), - // 报修历史标题 - Container( - width: double.infinity, - child: Text("报修历史", + ], + ))), + SizedBox(height: 24.rpx), + InkWell( + onTap: () {}, + child: CustomCard( + borderRadius: 16.rpx, + gradientDirection: GradientDirection.vertical, + onTap: () { + Get.toNamed("/applyRepairPage"); + }, + colors: const [ + Color(0xFFFCFCFC), + Color(0xFFF8FAF9), + Color(0XFFECF6F3), + Color(0XFFD9F0E9), + Color(0xFFCEECE3) + ], + child: Container( + width: double.infinity, + height: 90.rpx, + alignment: Alignment.center, + decoration: BoxDecoration( + borderRadius: BorderRadius.circular(6), + ), + child: Text( + "我要报修", style: TextStyle( - color: Colors.white, - fontSize: 30.rpx, - height: 1)), - ), - SizedBox(height: 32.rpx), - // Obx(() { - // return Visibility( - // visible: controller.model.repairList != null && - // controller.model.repairList!.isNotEmpty, - // replacement: EmptyMessageWidget(), - // child: Expanded( - // child: Obx(() => ListView( - // controller: - // scrollController, // 绑定 ScrollController - // shrinkWrap: true, - // scrollDirection: Axis.vertical, - // children: (controller.model.repairList - // .asMap() - // .entries - // .map((e) => RepairHistoryWidget( - // index: e.key, - // repairListController: controller)) - // .toList() as List))), - // ), - // ); - // }), - // 替换原来的 Obx(() => Visibility(...)) - Expanded( - child: Obx(() { - final hasData = - controller.model.repairList != null && - controller.model.repairList!.isNotEmpty; - return hasData - ? ListView( - controller: scrollController, - padding: EdgeInsets.zero, - shrinkWrap: true, - children: controller.model.repairList - .asMap() - .entries - .map((e) => RepairHistoryWidget( - index: e.key, - repairListController: - controller, - )) - .toList(), - ) - : NullDataWidget(); - }), - ), - ], + fontFamily: 'Readex Pro', + color: stringToColor("#011D33"), + letterSpacing: 0, + fontSize: 30.rpx, + ), + ), + ), + )), + SizedBox(height: 235.rpx), + // 报修历史标题 + Container( + width: double.infinity, + child: Text("报修历史", + style: TextStyle( + color: Colors.white, + fontSize: 30.rpx, + height: 1)), ), - ))), - )); + SizedBox(height: 32.rpx), + // Obx(() { + // return Visibility( + // visible: controller.model.repairList != null && + // controller.model.repairList!.isNotEmpty, + // replacement: EmptyMessageWidget(), + // child: Expanded( + // child: Obx(() => ListView( + // controller: + // scrollController, // 绑定 ScrollController + // shrinkWrap: true, + // scrollDirection: Axis.vertical, + // children: (controller.model.repairList + // .asMap() + // .entries + // .map((e) => RepairHistoryWidget( + // index: e.key, + // repairListController: controller)) + // .toList() as List))), + // ), + // ); + // }), + // 替换原来的 Obx(() => Visibility(...)) + Expanded( + child: Obx(() { + final hasData = controller.model.repairList != null && + controller.model.repairList!.isNotEmpty; + return hasData + ? ListView( + controller: scrollController, + padding: EdgeInsets.zero, + shrinkWrap: true, + children: controller.model.repairList + .asMap() + .entries + .map((e) => RepairHistoryWidget( + index: e.key, + repairListController: controller, + )) + .toList(), + ) + : NullDataWidget(); + }), + ), + ], + ), + ))), + )); }); } - - } diff --git a/lib/pages/mh_page/room_picker.dart b/lib/pages/mh_page/room_picker.dart index 0dec2df..79e2938 100644 --- a/lib/pages/mh_page/room_picker.dart +++ b/lib/pages/mh_page/room_picker.dart @@ -50,7 +50,7 @@ class _RoomPickerPageState extends State { return LayoutBuilder(builder: (context, cc) { bodysize = cc; return GestureDetector( - onTap: () => FocusScope.of(context).unfocus(), + // onTap: () => FocusScope.of(context).unfocus(),, child: Container( decoration: const BoxDecoration( image: DecorationImage( diff --git a/lib/pages/mh_page/score_page.dart b/lib/pages/mh_page/score_page.dart index 0299a3d..4a18c0b 100644 --- a/lib/pages/mh_page/score_page.dart +++ b/lib/pages/mh_page/score_page.dart @@ -6,6 +6,7 @@ import 'package:vbvs_app/common/util/FitTool.dart'; import 'package:vbvs_app/common/util/MyUtils.dart'; import 'package:vbvs_app/component/tool/CustomCard.dart'; import 'package:vbvs_app/controller/mh_controller/score_controller.dart' as mh; + class ScorePage extends GetView { BoxConstraints? bodysize; final scaffoldKey = GlobalKey(); @@ -18,432 +19,412 @@ class ScorePage extends GetView { return LayoutBuilder(builder: (context, cc) { bodysize = cc; return GestureDetector( - onTap: () => FocusScope.of(context).unfocus(), + // onTap: () => FocusScope.of(context).unfocus(),, child: Container( - decoration: const BoxDecoration( - image: DecorationImage( - image: AssetImage('assets/images/new_background.png'), // 本地图片 - fit: BoxFit.fill, // 填满整个 Container + decoration: const BoxDecoration( + image: DecorationImage( + image: AssetImage('assets/images/new_background.png'), // 本地图片 + fit: BoxFit.fill, // 填满整个 Container + ), + ), + child: Scaffold( + // key: scaffoldKey, + backgroundColor: Colors.transparent, + appBar: AppBar( + backgroundColor: Colors.transparent, + iconTheme: const IconThemeData(color: Colors.white), + automaticallyImplyLeading: false, + titleSpacing: 0, + title: SizedBox( + width: double.infinity, + height: 180.rpx, + child: Stack( + alignment: Alignment.center, + children: [ + // 中间居中的标题 + Text( + '评价'.tr, + textAlign: TextAlign.center, + style: TextStyle( + color: Colors.white, + fontSize: 30.rpx, + ), + ), + // 左侧图标 + Positioned( + left: 0.rpx, + child: returnIconButtomNew, + ), + ], ), ), - child: Scaffold( - // key: scaffoldKey, - backgroundColor: Colors.transparent, - appBar: AppBar( - backgroundColor: Colors.transparent, - iconTheme: const IconThemeData(color: Colors.white), - automaticallyImplyLeading: false, - titleSpacing: 0, - title: SizedBox( - width: double.infinity, - height: 180.rpx, - child: Stack( - alignment: Alignment.center, - children: [ - // 中间居中的标题 - Text( - '评价'.tr, - textAlign: TextAlign.center, - style: TextStyle( - color: Colors.white, - fontSize: 30.rpx, - ), - ), - // 左侧图标 - Positioned( - left: 0.rpx, - child: returnIconButtomNew, - ), - ], - ), - ), - centerTitle: false, - ), + centerTitle: false, + ), - body: Container( - width: bodysize!.maxWidth, - height: bodysize!.maxHeight * 1, - child: Column( - mainAxisSize: MainAxisSize.max, - children: [ - // TitleComponentWidget( - // titleName: '评价', - // ), - Expanded( - child: Container( - width: bodysize!.maxWidth, - child: SingleChildScrollView( - child: Column( - mainAxisSize: MainAxisSize.max, - children: [ - Padding( + body: Container( + width: bodysize!.maxWidth, + height: bodysize!.maxHeight * 1, + child: Column( + mainAxisSize: MainAxisSize.max, + children: [ + // TitleComponentWidget( + // titleName: '评价', + // ), + Expanded( + child: Container( + width: bodysize!.maxWidth, + child: SingleChildScrollView( + child: Column( + mainAxisSize: MainAxisSize.max, + children: [ + Padding( + padding: EdgeInsetsDirectional.fromSTEB( + 30.rpx, 26.rpx, 30.rpx, 0), + child: Container( + width: bodysize!.maxWidth, + constraints: BoxConstraints( + minWidth: 346, + minHeight: 115, + ), + decoration: BoxDecoration( + color: Color(0xFF003058), + borderRadius: BorderRadius.circular(16), + ), + child: Padding( padding: EdgeInsetsDirectional.fromSTEB( - 30.rpx, 26.rpx, 30.rpx, 0), + 22, 27, 17, 22), child: Container( width: bodysize!.maxWidth, - constraints: BoxConstraints( - minWidth: 346, - minHeight: 115, - ), decoration: BoxDecoration( color: Color(0xFF003058), borderRadius: BorderRadius.circular(16), ), - child: Padding( - padding: EdgeInsetsDirectional.fromSTEB( - 22, 27, 17, 22), - child: Container( - width: bodysize!.maxWidth, - decoration: BoxDecoration( - color: Color(0xFF003058), - borderRadius: BorderRadius.circular(16), + child: Column( + mainAxisSize: MainAxisSize.max, + mainAxisAlignment: + MainAxisAlignment.spaceBetween, + children: [ + Align( + alignment: AlignmentDirectional(0, 0), + child: Text( + '我要评价'.tr, + style: TextStyle( + fontFamily: 'Readex Pro', + fontSize: 30.rpx, + letterSpacing: 0, + color: Colors.white), + ), ), - child: Column( + Row( mainAxisSize: MainAxisSize.max, mainAxisAlignment: - MainAxisAlignment.spaceBetween, + MainAxisAlignment.center, children: [ - Align( - alignment: - AlignmentDirectional(0, 0), - child: Text( - '我要评价'.tr, - style: TextStyle( - fontFamily: 'Readex Pro', - fontSize: 30.rpx, - letterSpacing: 0, - color: Colors.white), - ), + InkWell( + onTap: () { + controller.model.score = 1; + controller.updateAll(); + }, + child: Obx(() { + return Icon( + Icons.star, + color: controller + .model.score! >= + 1 + ? stringToColor("#F8AE00") + : stringToColor("#D0D0D0"), + size: 40, + ); + }), ), - Row( - mainAxisSize: MainAxisSize.max, - mainAxisAlignment: - MainAxisAlignment.center, - children: [ - InkWell( - onTap: () { - controller.model.score = 1; - controller.updateAll(); - }, - child: Obx(() { - return Icon( - Icons.star, - color: controller - .model.score! >= - 1 - ? stringToColor( - "#F8AE00") - : stringToColor( - "#D0D0D0"), - size: 40, - ); - }), - ), - InkWell( - onTap: () { - controller.model.score = 2; - controller.updateAll(); - }, - child: Obx(() { - return Icon( - Icons.star, - color: controller - .model.score! >= - 2 - ? stringToColor( - "#F8AE00") - : stringToColor( - "#D0D0D0"), - size: 40, - ); - }), - ), - InkWell( - onTap: () { - controller.model.score = 3; - controller.updateAll(); - }, - child: Obx(() { - return Icon( - Icons.star, - color: controller - .model.score! >= - 3 - ? stringToColor( - "#F8AE00") - : stringToColor( - "#D0D0D0"), - size: 40, - ); - }), - ), - InkWell( - onTap: () { - controller.model.score = 4; - controller.updateAll(); - }, - child: Obx(() { - return Icon( - Icons.star, - color: controller - .model.score! >= - 4 - ? stringToColor( - "#F8AE00") - : stringToColor( - "#D0D0D0"), - size: 40, - ); - }), - ), - InkWell( - onTap: () { - controller.model.score = 5; - controller.updateAll(); - }, - child: Obx(() { - return Icon( - Icons.star, - color: controller - .model.score! >= - 5 - ? stringToColor( - "#F8AE00") - : stringToColor( - "#D0D0D0"), - size: 40, - ); - }), - ), - ].divide(SizedBox(width: 10)), + InkWell( + onTap: () { + controller.model.score = 2; + controller.updateAll(); + }, + child: Obx(() { + return Icon( + Icons.star, + color: controller + .model.score! >= + 2 + ? stringToColor("#F8AE00") + : stringToColor("#D0D0D0"), + size: 40, + ); + }), ), - ].divide(SizedBox(height: 26)), + InkWell( + onTap: () { + controller.model.score = 3; + controller.updateAll(); + }, + child: Obx(() { + return Icon( + Icons.star, + color: controller + .model.score! >= + 3 + ? stringToColor("#F8AE00") + : stringToColor("#D0D0D0"), + size: 40, + ); + }), + ), + InkWell( + onTap: () { + controller.model.score = 4; + controller.updateAll(); + }, + child: Obx(() { + return Icon( + Icons.star, + color: controller + .model.score! >= + 4 + ? stringToColor("#F8AE00") + : stringToColor("#D0D0D0"), + size: 40, + ); + }), + ), + InkWell( + onTap: () { + controller.model.score = 5; + controller.updateAll(); + }, + child: Obx(() { + return Icon( + Icons.star, + color: controller + .model.score! >= + 5 + ? stringToColor("#F8AE00") + : stringToColor("#D0D0D0"), + size: 40, + ); + }), + ), + ].divide(SizedBox(width: 10)), ), - ), + ].divide(SizedBox(height: 26)), ), ), ), - Padding( + ), + ), + Padding( + padding: EdgeInsetsDirectional.fromSTEB( + 30.rpx, 30.rpx, 30.rpx, 0), + child: Container( + width: bodysize!.maxWidth, + constraints: BoxConstraints( + minWidth: 346, + minHeight: 152, + ), + decoration: BoxDecoration( + color: Color(0xFF003058), + borderRadius: BorderRadius.circular(16.rpx), + ), + child: Padding( padding: EdgeInsetsDirectional.fromSTEB( - 30.rpx, 30.rpx, 30.rpx, 0), + 14, 14, 14, 21), child: Container( width: bodysize!.maxWidth, - constraints: BoxConstraints( - minWidth: 346, - minHeight: 152, - ), decoration: BoxDecoration( color: Color(0xFF003058), borderRadius: BorderRadius.circular(16.rpx), ), - child: Padding( - padding: EdgeInsetsDirectional.fromSTEB( - 14, 14, 14, 21), - child: Container( - width: bodysize!.maxWidth, - decoration: BoxDecoration( - color: Color(0xFF003058), - borderRadius: - BorderRadius.circular(16.rpx), + child: Column( + mainAxisSize: MainAxisSize.max, + children: [ + Align( + alignment: AlignmentDirectional(0, 0), + child: Obx(() { + String scoreText; + Color scoreColor; + if (controller.model.score == 1) { + scoreText = '差'; + scoreColor = + stringToColor("#E55E92"); + } else if (controller.model.score == + 2) { + scoreText = '较差'; + scoreColor = + stringToColor("#E55E92"); + } else if (controller.model.score == + 3) { + scoreText = '一般'; + scoreColor = + stringToColor("#07C160"); + } else if (controller.model.score == + 4) { + scoreText = '优秀'; + scoreColor = + stringToColor("#F8AE00"); + } else if (controller.model.score == + 5) { + scoreText = '完美'; + scoreColor = + stringToColor("#F8AE00"); + } else { + scoreText = '未评分'; // 如果没有评分显示默认文字 + scoreColor = Colors.grey; // 默认颜色 + } + return Text( + scoreText, + style: TextStyle( + fontFamily: 'Readex Pro', + fontSize: 30.rpx, + letterSpacing: 0, + color: scoreColor, + fontWeight: FontWeight.bold), + ); + }), ), - child: Column( - mainAxisSize: MainAxisSize.max, - children: [ - Align( - alignment: - AlignmentDirectional(0, 0), - child: Obx(() { - String scoreText; - Color scoreColor; - if (controller.model.score == 1) { - scoreText = '差'; - scoreColor = - stringToColor("#E55E92"); - } else if (controller - .model.score == - 2) { - scoreText = '较差'; - scoreColor = - stringToColor("#E55E92"); - } else if (controller - .model.score == - 3) { - scoreText = '一般'; - scoreColor = - stringToColor("#07C160"); - } else if (controller - .model.score == - 4) { - scoreText = '优秀'; - scoreColor = - stringToColor("#F8AE00"); - } else if (controller - .model.score == - 5) { - scoreText = '完美'; - scoreColor = - stringToColor("#F8AE00"); - } else { - scoreText = - '未评分'; // 如果没有评分显示默认文字 - scoreColor = - Colors.grey; // 默认颜色 - } - return Text( - scoreText, - style: TextStyle( - fontFamily: 'Readex Pro', - fontSize: 30.rpx, - letterSpacing: 0, - color: scoreColor, - fontWeight: - FontWeight.bold), - ); - }), + Align( + alignment: AlignmentDirectional(-1, 0), + child: Padding( + padding: + EdgeInsetsDirectional.fromSTEB( + 0, 17, 0, 0), + child: Text( + '再多的溢美之词,都比不上您真心的评价。我们愿付出200%的努力,只为您100%的满意~感谢您的支持与厚爱!', + style: TextStyle( + fontFamily: 'Readex Pro', + fontSize: 26.rpx, + letterSpacing: 0, + color: Color(0xFF9AA0B3)), ), - Align( - alignment: - AlignmentDirectional(-1, 0), - child: Padding( - padding: EdgeInsetsDirectional - .fromSTEB(0, 17, 0, 0), - child: Text( - '再多的溢美之词,都比不上您真心的评价。我们愿付出200%的努力,只为您100%的满意~感谢您的支持与厚爱!', - style: TextStyle( - fontFamily: 'Readex Pro', - fontSize: 26.rpx, - letterSpacing: 0, - color: Color(0xFF9AA0B3)), - ), - ), - ), - ], + ), ), - ), + ], ), ), ), - ], + ), ), - ), + ], ), ), - Padding( - padding: EdgeInsetsDirectional.fromSTEB( - 15, 0, 15, AppConstants.page_button_bottom_padding), - child: Container( - width: bodysize!.maxWidth, - height: bodysize!.maxHeight * 0.056, + ), + ), + Padding( + padding: EdgeInsetsDirectional.fromSTEB( + 15, 0, 15, AppConstants.page_button_bottom_padding), + child: Container( + width: bodysize!.maxWidth, + height: bodysize!.maxHeight * 0.056, + decoration: BoxDecoration( + borderRadius: BorderRadius.circular(16.rpx), + ), + // child: Container( + // width: bodysize!.maxWidth, + // height: bodysize!.maxHeight * 0.056, + // decoration: BoxDecoration( + // color: FlutterFlowTheme.of(context) + // .secondaryBackground, + // borderRadius: BorderRadius.circular(12), + // ), + // child: FFButtonWidget( + // onPressed: () { + // // RepairListController repairListController = + // // Get.find(); + // // RepairInfoController repairInfoController = + // // Get.find(); + // // repairListController + // // .addScore( + // // repairInfoController + // // .model.applyRepairModel!.id!, + // // controller.model.score!) + // // .then((String msg) { + // // if (msg != null && msg.isNotEmpty) { + // // MyDialogController myDialogController = + // // Get.find(); + // // showToast("评价失败,请稍后再试"); + // // } else { + // // MyDialogController myDialogController = + // // Get.find(); + // // myDialogController + // // .showCustomDialog(context, "评价成功", + // // textColor: stringToColor("#71E2A3")) + // // .then((_) { + // // // 弹窗关闭后执行的代码 + // // // Get.toNamed("/userInfoPage"); + // // repairInfoController.model.applyRepairModel! + // // .score = controller.model.score!; + // // repairInfoController.updateAll(); + // // Get.back(); + // // }).catchError((error) { + // // // 处理弹窗显示错误的逻辑 + // // print("弹窗显示失败: $error"); + // // }); + // // } + // // }); + // }, + // text: '确定', + // options: FFButtonOptions( + // height: 40, + // padding: + // EdgeInsetsDirectional.fromSTEB(24, 0, 24, 0), + // iconPadding: + // EdgeInsetsDirectional.fromSTEB(0, 0, 0, 0), + // color: Color(0xFFD3B684), + // textStyle: FlutterFlowTheme.of(context) + // .titleSmall + // .override( + // fontFamily: 'Readex Pro', + // color: Colors.white, + // fontSize: 13, + // letterSpacing: 0, + // ), + // elevation: 0, + // borderSide: BorderSide( + // color: Colors.transparent, + // width: 1, + // ), + // borderRadius: BorderRadius.circular(8), + // ), + // ), + // ), + + child: CustomCard( + borderRadius: 16.rpx, + gradientDirection: GradientDirection.vertical, + onTap: () { + Get.toNamed("/applyRepairPage"); + }, + colors: const [ + Color(0xFFFCFCFC), + Color(0xFFF8FAF9), + Color(0XFFECF6F3), + Color(0XFFD9F0E9), + Color(0xFFCEECE3) + ], + child: Container( + width: double.infinity, + height: 90.rpx, + alignment: Alignment.center, decoration: BoxDecoration( borderRadius: BorderRadius.circular(16.rpx), ), - // child: Container( - // width: bodysize!.maxWidth, - // height: bodysize!.maxHeight * 0.056, - // decoration: BoxDecoration( - // color: FlutterFlowTheme.of(context) - // .secondaryBackground, - // borderRadius: BorderRadius.circular(12), - // ), - // child: FFButtonWidget( - // onPressed: () { - // // RepairListController repairListController = - // // Get.find(); - // // RepairInfoController repairInfoController = - // // Get.find(); - // // repairListController - // // .addScore( - // // repairInfoController - // // .model.applyRepairModel!.id!, - // // controller.model.score!) - // // .then((String msg) { - // // if (msg != null && msg.isNotEmpty) { - // // MyDialogController myDialogController = - // // Get.find(); - // // showToast("评价失败,请稍后再试"); - // // } else { - // // MyDialogController myDialogController = - // // Get.find(); - // // myDialogController - // // .showCustomDialog(context, "评价成功", - // // textColor: stringToColor("#71E2A3")) - // // .then((_) { - // // // 弹窗关闭后执行的代码 - // // // Get.toNamed("/userInfoPage"); - // // repairInfoController.model.applyRepairModel! - // // .score = controller.model.score!; - // // repairInfoController.updateAll(); - // // Get.back(); - // // }).catchError((error) { - // // // 处理弹窗显示错误的逻辑 - // // print("弹窗显示失败: $error"); - // // }); - // // } - // // }); - // }, - // text: '确定', - // options: FFButtonOptions( - // height: 40, - // padding: - // EdgeInsetsDirectional.fromSTEB(24, 0, 24, 0), - // iconPadding: - // EdgeInsetsDirectional.fromSTEB(0, 0, 0, 0), - // color: Color(0xFFD3B684), - // textStyle: FlutterFlowTheme.of(context) - // .titleSmall - // .override( - // fontFamily: 'Readex Pro', - // color: Colors.white, - // fontSize: 13, - // letterSpacing: 0, - // ), - // elevation: 0, - // borderSide: BorderSide( - // color: Colors.transparent, - // width: 1, - // ), - // borderRadius: BorderRadius.circular(8), - // ), - // ), - // ), - - child: CustomCard( - borderRadius: 16.rpx, - gradientDirection: GradientDirection.vertical, - onTap: () { - Get.toNamed("/applyRepairPage"); - }, - colors: const [ - Color(0xFFFCFCFC), - Color(0xFFF8FAF9), - Color(0XFFECF6F3), - Color(0XFFD9F0E9), - Color(0xFFCEECE3) - ], - child: Container( - width: double.infinity, - height: 90.rpx, - alignment: Alignment.center, - decoration: BoxDecoration( - borderRadius: BorderRadius.circular(16.rpx), - ), - child: Text( - "提交", - style: TextStyle( - fontFamily: 'Readex Pro', - color: stringToColor("#011D33"), - letterSpacing: 0, - fontSize: 30.rpx, - ), - ), + child: Text( + "提交", + style: TextStyle( + fontFamily: 'Readex Pro', + color: stringToColor("#011D33"), + letterSpacing: 0, + fontSize: 30.rpx, ), - )), - ), - ], + ), + ), + )), ), - ), + ], ), - )); + ), + ), + )); }); } } diff --git a/lib/pages/mh_page/sleep_habit.dart b/lib/pages/mh_page/sleep_habit.dart index a4c3d3b..cd2d685 100644 --- a/lib/pages/mh_page/sleep_habit.dart +++ b/lib/pages/mh_page/sleep_habit.dart @@ -17,7 +17,7 @@ class _SleepHabitPageState extends State { return LayoutBuilder(builder: (context, cc) { bodysize = cc; return GestureDetector( - onTap: () => FocusScope.of(context).unfocus(), + // onTap: () => FocusScope.of(context).unfocus(),, child: Container( decoration: const BoxDecoration( image: DecorationImage( diff --git a/lib/pages/mh_page/smys.dart b/lib/pages/mh_page/smys.dart index 4d7b42b..19c7ba5 100644 --- a/lib/pages/mh_page/smys.dart +++ b/lib/pages/mh_page/smys.dart @@ -38,299 +38,294 @@ class Smys extends GetView { return LayoutBuilder( builder: (context, boxConstraints) => GestureDetector( - onTap: () => FocusScope.of(context).unfocus(), + // onTap: () => FocusScope.of(context).unfocus(),, child: Container( - decoration: const BoxDecoration( - image: DecorationImage( - image: AssetImage('assets/images/new_background.png'), // 本地图片 - fit: BoxFit.fill, // 填满整个 Container + decoration: const BoxDecoration( + image: DecorationImage( + image: AssetImage('assets/images/new_background.png'), // 本地图片 + fit: BoxFit.fill, // 填满整个 Container + ), + ), + child: Scaffold( + backgroundColor: Colors.transparent, + appBar: AppBar( + backgroundColor: Colors.transparent, + automaticallyImplyLeading: false, + iconTheme: IconThemeData(color: Colors.white), + titleSpacing: 0, + // leading: returnIconButtomAddCallback(() { + // controller.saveDataApi(); + // updateParm(isShowToast: false); + // }), + // leading: returnIconButtomNew, + title: Container( + width: double.infinity, + height: 180.rpx, + child: Stack( + alignment: Alignment.center, + children: [ + // 中间居中的标题 + Text( + '睡眠隐私'.tr, + textAlign: TextAlign.center, + style: TextStyle( + color: Colors.white, + fontSize: 30.rpx, + ), + ), + // 左侧图标 + Positioned( + left: 0.rpx, + child: returnIconButtomNew, + ), + ], ), ), - child: Scaffold( - backgroundColor: Colors.transparent, - appBar: AppBar( - backgroundColor: Colors.transparent, - automaticallyImplyLeading: false, - iconTheme: IconThemeData(color: Colors.white), - titleSpacing: 0, - // leading: returnIconButtomAddCallback(() { - // controller.saveDataApi(); - // updateParm(isShowToast: false); - // }), - // leading: returnIconButtomNew, - title: Container( - width: double.infinity, - height: 180.rpx, - child: Stack( - alignment: Alignment.center, + + actions: [], + centerTitle: false, + ), + body: SafeArea( + top: true, + child: Obx( + () => Container( + padding: EdgeInsets.only(left: 30.rpx, right: 30.rpx), + width: MediaQuery.sizeOf(context).width, + height: MediaQuery.sizeOf(context).height * 1.123, + // decoration: BoxDecoration( + // color: Colors.transparent, + // image: DecorationImage( + // image: AssetImage("assets/images/background.png"), + // fit: BoxFit.cover, + // ), + // ), + child: SingleChildScrollView( + child: Column( + mainAxisSize: MainAxisSize.max, children: [ - // 中间居中的标题 - Text( - '睡眠隐私'.tr, - textAlign: TextAlign.center, - style: TextStyle( - color: Colors.white, - fontSize: 30.rpx, - ), - ), - // 左侧图标 - Positioned( - left: 0.rpx, - child: returnIconButtomNew, - ), - ], - ), - ), - - actions: [], - centerTitle: false, - ), - body: SafeArea( - top: true, - child: Obx( - () => Container( - padding: EdgeInsets.only(left: 30.rpx, right: 30.rpx), - width: MediaQuery.sizeOf(context).width, - height: MediaQuery.sizeOf(context).height * 1.123, - // decoration: BoxDecoration( - // color: Colors.transparent, - // image: DecorationImage( - // image: AssetImage("assets/images/background.png"), - // fit: BoxFit.cover, - // ), - // ), - child: SingleChildScrollView( - child: Column( - mainAxisSize: MainAxisSize.max, - children: [ - Container( - width: double.infinity, - height: MediaQuery.sizeOf(context).height * 0.055, - decoration: BoxDecoration( - border: Border( - bottom: BorderSide( - color: const Color(0xFF929699), - width: 0.rpx), - ), - ), - constraints: BoxConstraints( - minHeight: 90.rpx, // 设置最小高度 - ), - child: Padding( - padding: EdgeInsets.fromLTRB( - 39.rpx, 0.rpx, 15.rpx, 0.rpx), - child: Row( - mainAxisSize: MainAxisSize.max, - mainAxisAlignment: - MainAxisAlignment.spaceBetween, - children: [ - Text( - '睡眠隐私功能'.tr, - style: TextStyle( - fontFamily: 'Readex Pro', - color: Color(0xFF9EA4B7), - fontSize: 26.rpx, - letterSpacing: 0, - ), - ), - Container( - - // height: - // MediaQuery.sizeOf(context).height * - // 0.04, - child: FlutterSwitch( - width: 70.rpx, - height: 36.rpx, - toggleSize: 30.rpx, - activeColor: Color(0XFF6BFDAC), - inactiveColor: Color(0XFF003058), - toggleColor: Color(0xFF011D33), - value: controller.model.smysIsStart, - onToggle: (val) { - controller.attr.update((getmodel) { - getmodel.model.smysIsStart = val; - }); - }, - )), - ], - ), - )), - // getLine(), - InkWell( - onTap: () async { - showDayTimeSelectionDialog(context, - dayTimeArr: controller.model.smysStartTime, - title: "开始时间".tr, checkChange: (d) { - controller.attr.update((getmodel) { - getmodel.model.smysStartTime = [ - int.parse("${d[0]}"), - int.parse("${d[1]}") - ]; - }); - // updateParm(); - }); - }, - child: Container( - width: double.infinity, - height: - MediaQuery.sizeOf(context).height * 0.055, - decoration: BoxDecoration( - border: Border( - bottom: BorderSide( - color: Color(0xFF929699), - // color: Colors.red, - width: 0.rpx), + Container( + width: double.infinity, + height: MediaQuery.sizeOf(context).height * 0.055, + decoration: BoxDecoration( + border: Border( + bottom: BorderSide( + color: const Color(0xFF929699), width: 0.rpx), + ), + ), + constraints: BoxConstraints( + minHeight: 90.rpx, // 设置最小高度 + ), + child: Padding( + padding: EdgeInsets.fromLTRB( + 39.rpx, 0.rpx, 15.rpx, 0.rpx), + child: Row( + mainAxisSize: MainAxisSize.max, + mainAxisAlignment: MainAxisAlignment.spaceBetween, + children: [ + Text( + '睡眠隐私功能'.tr, + style: TextStyle( + fontFamily: 'Readex Pro', + color: Color(0xFF9EA4B7), + fontSize: 26.rpx, + letterSpacing: 0, ), ), - constraints: BoxConstraints( - minHeight: 90.rpx, // 设置最小高度 - ), - child: Padding( - padding: EdgeInsets.fromLTRB( - 39.rpx, 0.rpx, 30.rpx, 0.rpx), - child: Row( + Container( + + // height: + // MediaQuery.sizeOf(context).height * + // 0.04, + child: FlutterSwitch( + width: 70.rpx, + height: 36.rpx, + toggleSize: 30.rpx, + activeColor: Color(0XFF6BFDAC), + inactiveColor: Color(0XFF003058), + toggleColor: Color(0xFF011D33), + value: controller.model.smysIsStart, + onToggle: (val) { + controller.attr.update((getmodel) { + getmodel.model.smysIsStart = val; + }); + }, + )), + ], + ), + )), + // getLine(), + InkWell( + onTap: () async { + showDayTimeSelectionDialog(context, + dayTimeArr: controller.model.smysStartTime, + title: "开始时间".tr, checkChange: (d) { + controller.attr.update((getmodel) { + getmodel.model.smysStartTime = [ + int.parse("${d[0]}"), + int.parse("${d[1]}") + ]; + }); + // updateParm(); + }); + }, + child: Container( + width: double.infinity, + height: MediaQuery.sizeOf(context).height * 0.055, + decoration: BoxDecoration( + border: Border( + bottom: BorderSide( + color: Color(0xFF929699), + // color: Colors.red, + width: 0.rpx), + ), + ), + constraints: BoxConstraints( + minHeight: 90.rpx, // 设置最小高度 + ), + child: Padding( + padding: EdgeInsets.fromLTRB( + 39.rpx, 0.rpx, 30.rpx, 0.rpx), + child: Row( + mainAxisSize: MainAxisSize.max, + mainAxisAlignment: + MainAxisAlignment.spaceBetween, + children: [ + Text( + '开始时间'.tr, + style: TextStyle( + fontFamily: 'Readex Pro', + color: Color(0xFF9EA4B7), + fontSize: 26.rpx, + letterSpacing: 0, + ), + ), + Row( mainAxisSize: MainAxisSize.max, - mainAxisAlignment: - MainAxisAlignment.spaceBetween, children: [ Text( - '开始时间'.tr, + "${controller.model.smysStartTimeToString}", style: TextStyle( fontFamily: 'Readex Pro', - color: Color(0xFF9EA4B7), + color: Colors.white, fontSize: 26.rpx, letterSpacing: 0, ), ), - Row( - mainAxisSize: MainAxisSize.max, - children: [ - Text( - "${controller.model.smysStartTimeToString}", - style: TextStyle( - fontFamily: 'Readex Pro', - color: Colors.white, - fontSize: 26.rpx, - letterSpacing: 0, - ), - ), - SizedBox( - width: 16.rpx, - ), - Container( - height: 30.rpx, - width: 30.rpx, - child: SvgPicture.asset( - 'assets/img/icon/expand_more.svg', - color: Colors.white, - )) - ], + SizedBox( + width: 16.rpx, ), + Container( + height: 30.rpx, + width: 30.rpx, + child: SvgPicture.asset( + 'assets/img/icon/expand_more.svg', + color: Colors.white, + )) ], ), - )), + ], + ), + )), + ), + // getLine(), + InkWell( + onTap: () async { + showDayTimeSelectionDialog(context, + dayTimeArr: controller.model.smysEndTime, + title: "结束时间".tr, checkChange: (d) { + controller.attr.update((getmodel) { + getmodel.model.smysEndTime = [ + int.parse("${d[0]}"), + int.parse("${d[1]}") + ]; + }); + // updateParm(); + }); + }, + child: Container( + width: double.infinity, + height: MediaQuery.sizeOf(context).height * 0.055, + decoration: BoxDecoration( + border: Border( + bottom: BorderSide( + color: const Color(0xFF929699), width: 0.rpx), + ), ), - // getLine(), - InkWell( - onTap: () async { - showDayTimeSelectionDialog(context, - dayTimeArr: controller.model.smysEndTime, - title: "结束时间".tr, checkChange: (d) { - controller.attr.update((getmodel) { - getmodel.model.smysEndTime = [ - int.parse("${d[0]}"), - int.parse("${d[1]}") - ]; - }); - // updateParm(); - }); - }, - child: Container( - width: double.infinity, - height: MediaQuery.sizeOf(context).height * 0.055, - decoration: BoxDecoration( - border: Border( - bottom: BorderSide( - color: const Color(0xFF929699), - width: 0.rpx), + constraints: BoxConstraints( + minHeight: 90.rpx, // 设置最小高度 + ), + child: Padding( + padding: EdgeInsets.fromLTRB( + 39.rpx, 0.rpx, 30.rpx, 0.rpx), + child: Row( + mainAxisSize: MainAxisSize.max, + mainAxisAlignment: MainAxisAlignment.spaceBetween, + children: [ + Text( + '结束时间'.tr, + style: TextStyle( + fontFamily: 'Readex Pro', + color: Color(0xFF9EA4B7), + fontSize: 26.rpx, + letterSpacing: 0, + ), ), - ), - constraints: BoxConstraints( - minHeight: 90.rpx, // 设置最小高度 - ), - child: Padding( - padding: EdgeInsets.fromLTRB( - 39.rpx, 0.rpx, 30.rpx, 0.rpx), - child: Row( + Row( mainAxisSize: MainAxisSize.max, - mainAxisAlignment: - MainAxisAlignment.spaceBetween, children: [ Text( - '结束时间'.tr, + "${controller.model.smysEndTimeToString}", style: TextStyle( fontFamily: 'Readex Pro', - color: Color(0xFF9EA4B7), + color: Colors.white, fontSize: 26.rpx, letterSpacing: 0, ), ), - Row( - mainAxisSize: MainAxisSize.max, - children: [ - Text( - "${controller.model.smysEndTimeToString}", - style: TextStyle( - fontFamily: 'Readex Pro', - color: Colors.white, - fontSize: 26.rpx, - letterSpacing: 0, - ), - ), - SizedBox( - width: 16.rpx, - ), - Container( - height: 30.rpx, - width: 30.rpx, - child: SvgPicture.asset( - 'assets/img/icon/expand_more.svg', - color: Colors.white, - )) - ], + SizedBox( + width: 16.rpx, ), + Container( + height: 30.rpx, + width: 30.rpx, + child: SvgPicture.asset( + 'assets/img/icon/expand_more.svg', + color: Colors.white, + )) ], ), - ), + ], ), - ), // getLine(), - SizedBox( - height: 30.rpx, ), - Padding( - padding: EdgeInsets.symmetric(horizontal: 25.rpx), - child: Container( - width: double.infinity, - decoration: BoxDecoration(), - child: Text( - '*注:开启睡眠隐私功能后,在设置的时间段内,将不会采集您的睡眠数据。'.tr, - style: TextStyle( - fontFamily: 'Readex Pro', - color: Color(0xFF9EA4B7), - fontSize: 20.rpx, - letterSpacing: 0, - ), - ), - ), - ) - ], + ), + ), // getLine(), + SizedBox( + height: 30.rpx, ), - ), + Padding( + padding: EdgeInsets.symmetric(horizontal: 25.rpx), + child: Container( + width: double.infinity, + decoration: BoxDecoration(), + child: Text( + '*注:开启睡眠隐私功能后,在设置的时间段内,将不会采集您的睡眠数据。'.tr, + style: TextStyle( + fontFamily: 'Readex Pro', + color: Color(0xFF9EA4B7), + fontSize: 20.rpx, + letterSpacing: 0, + ), + ), + ), + ) + ], ), ), ), ), - )), + ), + ), + )), ); } } diff --git a/lib/pages/mh_page/user/page/edit_userinfo_page.dart b/lib/pages/mh_page/user/page/edit_userinfo_page.dart index a0a64ce..27ef9a3 100644 --- a/lib/pages/mh_page/user/page/edit_userinfo_page.dart +++ b/lib/pages/mh_page/user/page/edit_userinfo_page.dart @@ -49,7 +49,7 @@ class _UpdateUserPageState extends State { int login = userInfoController.model.login!; return LayoutBuilder( builder: (context, bodySize) => GestureDetector( - onTap: () => FocusScope.of(context).unfocus(), + // onTap: () => FocusScope.of(context).unfocus(),, child: Container( decoration: BoxDecoration( image: DecorationImage( diff --git a/lib/pages/mh_page/user/page/find_password_page.dart b/lib/pages/mh_page/user/page/find_password_page.dart index 4c052fb..64b4c10 100644 --- a/lib/pages/mh_page/user/page/find_password_page.dart +++ b/lib/pages/mh_page/user/page/find_password_page.dart @@ -37,547 +37,518 @@ class FindPasswordPage extends GetView { return LayoutBuilder(builder: (context, cc) { bodysize = cc; return GestureDetector( - onTap: () => FocusScope.of(context).unfocus(), + // onTap: () => FocusScope.of(context).unfocus(),, child: Container( - decoration: const BoxDecoration( - image: DecorationImage( - image: AssetImage('assets/images/new_background.png'), // 本地图片 - fit: BoxFit.fill, // 填满整个 Container - ), - ), - child: Scaffold( - // key: scaffoldKey, - backgroundColor: Colors.transparent, - appBar: AppBar( - backgroundColor: Colors.transparent, - automaticallyImplyLeading: false, - iconTheme: IconThemeData(color: Colors.white), - titleSpacing: 0, - title: Container( - width: double.infinity, - height: 180.rpx, - child: Stack( - alignment: Alignment.center, - children: [ - // 中间居中的标题 - Text( - '找回密码'.tr, - textAlign: TextAlign.center, - style: TextStyle( - color: Colors.white, - fontSize: 30.rpx, - ), - ), - // 左侧图标 - Positioned( - left: 0.rpx, - child: returnIconButtomNew, - ), - ], + decoration: const BoxDecoration( + image: DecorationImage( + image: AssetImage('assets/images/new_background.png'), // 本地图片 + fit: BoxFit.fill, // 填满整个 Container + ), + ), + child: Scaffold( + // key: scaffoldKey, + backgroundColor: Colors.transparent, + appBar: AppBar( + backgroundColor: Colors.transparent, + automaticallyImplyLeading: false, + iconTheme: IconThemeData(color: Colors.white), + titleSpacing: 0, + title: Container( + width: double.infinity, + height: 180.rpx, + child: Stack( + alignment: Alignment.center, + children: [ + // 中间居中的标题 + Text( + '找回密码'.tr, + textAlign: TextAlign.center, + style: TextStyle( + color: Colors.white, + fontSize: 30.rpx, + ), ), - ), - actions: [], - centerTitle: false, + // 左侧图标 + Positioned( + left: 0.rpx, + child: returnIconButtomNew, + ), + ], ), - body: SingleChildScrollView( - controller: _scrollController, - child: Container( - width: bodysize!.maxWidth, - height: bodysize!.maxHeight * 1, - child: Column( - mainAxisSize: MainAxisSize.max, - children: [ - Expanded( - child: Padding( - padding: EdgeInsetsDirectional.fromSTEB( - 98.rpx, 0, 98.rpx, 0), - child: Container( - width: bodysize!.maxWidth, - height: bodysize!.maxHeight * 0.886, - decoration: BoxDecoration(), - child: Container( - width: bodysize!.maxWidth, - height: bodysize!.maxHeight * 1, - decoration: BoxDecoration(), - child: Column( - mainAxisSize: MainAxisSize.max, - children: [ - Padding( - padding: EdgeInsetsDirectional.fromSTEB( - 0, 184.rpx, 0, 0), - child: Container( - width: bodysize!.maxWidth, - height: 92.rpx, - decoration: BoxDecoration(), - child: Container( - width: bodysize!.maxWidth, - height: bodysize!.maxHeight * 0.06, - decoration: BoxDecoration( - color: Color(0xFFF3F5F6), - borderRadius: - BorderRadius.circular(12), + ), + actions: [], + centerTitle: false, + ), + body: SingleChildScrollView( + controller: _scrollController, + child: Container( + width: bodysize!.maxWidth, + height: bodysize!.maxHeight * 1, + child: Column( + mainAxisSize: MainAxisSize.max, + children: [ + Expanded( + child: Padding( + padding: EdgeInsetsDirectional.fromSTEB( + 98.rpx, 0, 98.rpx, 0), + child: Container( + width: bodysize!.maxWidth, + height: bodysize!.maxHeight * 0.886, + decoration: BoxDecoration(), + child: Container( + width: bodysize!.maxWidth, + height: bodysize!.maxHeight * 1, + decoration: BoxDecoration(), + child: Column( + mainAxisSize: MainAxisSize.max, + children: [ + Padding( + padding: EdgeInsetsDirectional.fromSTEB( + 0, 184.rpx, 0, 0), + child: Container( + width: bodysize!.maxWidth, + height: 92.rpx, + decoration: BoxDecoration(), + child: Container( + width: bodysize!.maxWidth, + height: bodysize!.maxHeight * 0.06, + decoration: BoxDecoration( + color: Color(0xFFF3F5F6), + borderRadius: BorderRadius.circular(12), + ), + child: Align( + alignment: AlignmentDirectional(0, 0), + child: TextFormField( + // focusNode: _focusNode1, + onChanged: (value) { + controller.model.phone = value; + }, + // autofocus: true, + obscureText: false, + decoration: InputDecoration( + labelStyle: TextStyle( + fontFamily: 'Readex Pro', + fontSize: 26.rpx, + letterSpacing: 0, + ), + hintText: '请输入手机号'.tr, + hintStyle: TextStyle( + fontFamily: 'Readex Pro', + color: Color(0xFF929699), + fontSize: 26.rpx, + letterSpacing: 0, + ), + enabledBorder: InputBorder.none, + focusedBorder: InputBorder.none, + errorBorder: InputBorder.none, + focusedErrorBorder: + InputBorder.none, + contentPadding: + EdgeInsetsDirectional.fromSTEB( + 20.rpx, 0, 0, 0.rpx), ), - child: Align( - alignment: - AlignmentDirectional(0, 0), - child: TextFormField( - // focusNode: _focusNode1, - onChanged: (value) { - controller.model.phone = value; - }, - // autofocus: true, - obscureText: false, - decoration: InputDecoration( - labelStyle: TextStyle( + style: TextStyle( + fontFamily: 'Readex Pro', + fontSize: 26.rpx, + letterSpacing: 0, + ), + ), + ), + ), + ), + ), + Padding( + padding: EdgeInsetsDirectional.fromSTEB( + 0, 32.rpx, 0, 0), + child: Container( + width: bodysize!.maxWidth, + height: 92.rpx, + decoration: BoxDecoration(), + child: Stack( + children: [ + Align( + alignment: AlignmentDirectional(0, 0), + child: Container( + width: bodysize!.maxWidth, + height: 92.rpx, + decoration: BoxDecoration( + color: Color(0xFFF3F5F6), + borderRadius: + BorderRadius.circular(12), + ), + child: Align( + alignment: + AlignmentDirectional(0, 0), + child: TextFormField( + // autofocus: true, + // focusNode: _focusNode2, + onChanged: (value) { + controller.model.code = value; + }, + obscureText: false, + decoration: InputDecoration( + labelStyle: TextStyle( + fontFamily: 'Readex Pro', + fontSize: 20.rpx, + letterSpacing: 0, + ), + hintText: '请输验证码'.tr, + hintStyle: TextStyle( + fontFamily: 'Readex Pro', + color: Color(0xFF929699), + fontSize: 26.rpx, + letterSpacing: 0, + ), + enabledBorder: + InputBorder.none, + focusedBorder: + InputBorder.none, + errorBorder: InputBorder.none, + focusedErrorBorder: + InputBorder.none, + contentPadding: + EdgeInsetsDirectional + .fromSTEB(20.rpx, 0, + 0, 0.rpx), + ), + style: TextStyle( fontFamily: 'Readex Pro', fontSize: 26.rpx, letterSpacing: 0, ), - hintText: '请输入手机号'.tr, - hintStyle: TextStyle( - fontFamily: 'Readex Pro', - color: Color(0xFF929699), - fontSize: 26.rpx, - letterSpacing: 0, - ), - enabledBorder: InputBorder.none, - focusedBorder: InputBorder.none, - errorBorder: InputBorder.none, - focusedErrorBorder: - InputBorder.none, - contentPadding: - EdgeInsetsDirectional - .fromSTEB(20.rpx, 0, 0, - 0.rpx), ), - style: TextStyle( + ), + ), + ), + Align( + alignment: + AlignmentDirectional(0.4, 0.1), + child: Container( + width: 1.rpx, + height: 38.rpx, + decoration: BoxDecoration( + color: stringToColor("#929699"), + ), + ), + ), + Align( + alignment: + AlignmentDirectional(1.2, 0), + child: Container( + width: bodysize!.maxWidth * 0.157, + height: bodysize!.maxHeight * 0.014, + constraints: BoxConstraints( + minWidth: 118, + minHeight: 30, + ), + decoration: BoxDecoration(), + child: Align( + alignment: + AlignmentDirectional(0, 0), + child: Obx(() { + final CountdownController + countdownController = + Get.find< + CountdownController>(); + return InkWell( + onTap: () async { + if (countdownController + .countdown.value != + 0) { + return; + } + if (CommonVariables + .isNetWorkOn == + false) { + TopSlideNotification.show( + context, + text: + "网络未连接,请开启设备网络后重试" + .tr, + textColor: + themeController + .currentColor + .sc9); + return; + } + String msg = + await controller + .getCode(context); + if (msg.isNotEmpty) { + return; + } + countdownController + .countdown + .value == + 0 + ? countdownController + .startCountdown( + AppConstants + .code_time) + : null; + }, + child: Text( + countdownController + .countdown + .value == + 0 + ? '获取验证码'.tr + : '${countdownController.countdown.value}' + + '秒'.tr, + style: TextStyle( + color: Color(0xFF333333), + fontSize: 20.rpx, + letterSpacing: 0, + ), + ), + ); + }), + ), + ), + ), + ], + ), + ), + ), + Padding( + padding: EdgeInsetsDirectional.fromSTEB( + 0, 32.rpx, 0, 0), + child: Container( + width: bodysize!.maxWidth, + height: 92.rpx, + decoration: BoxDecoration(), + child: Container( + width: bodysize!.maxWidth, + height: bodysize!.maxHeight * 0.06, + decoration: BoxDecoration( + color: Color(0xFFF3F5F6), + borderRadius: BorderRadius.circular(12), + ), + child: Align( + alignment: AlignmentDirectional(0, 0), + child: Obx(() { + return TextFormField( + // autofocus: true, + // focusNode: _focusNode1, + onChanged: (value) { + controller.model.pd = value; + }, + // obscureText: true, + obscureText: + controller.model.pdshow!, + decoration: InputDecoration( + labelStyle: TextStyle( fontFamily: 'Readex Pro', fontSize: 26.rpx, letterSpacing: 0, ), - ), - ), - ), - ), - ), - Padding( - padding: EdgeInsetsDirectional.fromSTEB( - 0, 32.rpx, 0, 0), - child: Container( - width: bodysize!.maxWidth, - height: 92.rpx, - decoration: BoxDecoration(), - child: Stack( - children: [ - Align( - alignment: - AlignmentDirectional(0, 0), - child: Container( - width: bodysize!.maxWidth, - height: 92.rpx, - decoration: BoxDecoration( - color: Color(0xFFF3F5F6), - borderRadius: - BorderRadius.circular(12), - ), - child: Align( - alignment: - AlignmentDirectional( - 0, 0), - child: TextFormField( - // autofocus: true, - // focusNode: _focusNode2, - onChanged: (value) { - controller.model.code = - value; - }, - obscureText: false, - decoration: InputDecoration( - labelStyle: TextStyle( - fontFamily: - 'Readex Pro', - fontSize: 20.rpx, - letterSpacing: 0, - ), - hintText: '请输验证码'.tr, - hintStyle: TextStyle( - fontFamily: - 'Readex Pro', - color: - Color(0xFF929699), - fontSize: 26.rpx, - letterSpacing: 0, - ), - enabledBorder: - InputBorder.none, - focusedBorder: - InputBorder.none, - errorBorder: - InputBorder.none, - focusedErrorBorder: - InputBorder.none, - contentPadding: - EdgeInsetsDirectional - .fromSTEB(20.rpx, - 0, 0, 0.rpx), - ), - style: TextStyle( - fontFamily: 'Readex Pro', - fontSize: 26.rpx, - letterSpacing: 0, - ), - ), - ), + hintText: '请输入新密码'.tr, + hintStyle: TextStyle( + fontFamily: 'Readex Pro', + color: Color(0xFF929699), + fontSize: 26.rpx, + letterSpacing: 0, ), - ), - Align( - alignment: AlignmentDirectional( - 0.4, 0.1), - child: Container( - width: 1.rpx, - height: 38.rpx, - decoration: BoxDecoration( - color: - stringToColor("#929699"), + enabledBorder: InputBorder.none, + focusedBorder: InputBorder.none, + errorBorder: InputBorder.none, + focusedErrorBorder: + InputBorder.none, + contentPadding: + EdgeInsetsDirectional + .fromSTEB( + 10, 26.rpx, 0, 0), + suffixIcon: IconButton( + icon: Icon( + // 根据 pdshow 控制图标 + controller.model.pdshow! + ? Icons.visibility_off + : Icons.visibility, + color: Color(0xFF333333), + size: 16, ), - ), - ), - Align( - alignment: - AlignmentDirectional(1.2, 0), - child: Container( - width: - bodysize!.maxWidth * 0.157, - height: - bodysize!.maxHeight * 0.014, - constraints: BoxConstraints( - minWidth: 118, - minHeight: 30, - ), - decoration: BoxDecoration(), - child: Align( - alignment: - AlignmentDirectional( - 0, 0), - child: Obx(() { - final CountdownController - countdownController = - Get.find< - CountdownController>(); - return InkWell( - onTap: () async { - if (countdownController - .countdown - .value != - 0) { - return; - } - if (CommonVariables - .isNetWorkOn == - false) { - TopSlideNotification.show( - context, - text: - "网络未连接,请开启设备网络后重试" - .tr, - textColor: - themeController - .currentColor - .sc9); - return; - } - String msg = - await controller - .getCode( - context); - if (msg.isNotEmpty) { - return; - } - countdownController - .countdown - .value == - 0 - ? countdownController - .startCountdown( - AppConstants - .code_time) - : null; - }, - child: Text( - countdownController - .countdown - .value == - 0 - ? '获取验证码'.tr - : '${countdownController.countdown.value}' + - '秒'.tr, - style: TextStyle( - color: - Color(0xFF333333), - fontSize: 20.rpx, - letterSpacing: 0, - ), - ), - ); - }), - ), - ), - ), - ], - ), - ), - ), - Padding( - padding: EdgeInsetsDirectional.fromSTEB( - 0, 32.rpx, 0, 0), - child: Container( - width: bodysize!.maxWidth, - height: 92.rpx, - decoration: BoxDecoration(), - child: Container( - width: bodysize!.maxWidth, - height: bodysize!.maxHeight * 0.06, - decoration: BoxDecoration( - color: Color(0xFFF3F5F6), - borderRadius: - BorderRadius.circular(12), - ), - child: Align( - alignment: - AlignmentDirectional(0, 0), - child: Obx(() { - return TextFormField( - // autofocus: true, - // focusNode: _focusNode1, - onChanged: (value) { - controller.model.pd = value; + onPressed: () { + // 切换 pdshow 状态 + controller.model.pdshow = + !controller.model.pdshow!; + controller.updateAll(); }, - // obscureText: true, - obscureText: - controller.model.pdshow!, - decoration: InputDecoration( - labelStyle: TextStyle( - fontFamily: 'Readex Pro', - fontSize: 26.rpx, - letterSpacing: 0, - ), - hintText: '请输入新密码'.tr, - hintStyle: TextStyle( - fontFamily: 'Readex Pro', - color: Color(0xFF929699), - fontSize: 26.rpx, - letterSpacing: 0, - ), - enabledBorder: - InputBorder.none, - focusedBorder: - InputBorder.none, - errorBorder: InputBorder.none, - focusedErrorBorder: - InputBorder.none, - contentPadding: - EdgeInsetsDirectional - .fromSTEB( - 10, 26.rpx, 0, 0), - suffixIcon: IconButton( - icon: Icon( - // 根据 pdshow 控制图标 - controller.model.pdshow! - ? Icons.visibility_off - : Icons.visibility, - color: Color(0xFF333333), - size: 16, - ), - onPressed: () { - // 切换 pdshow 状态 - controller.model.pdshow = - !controller - .model.pdshow!; - controller.updateAll(); - }, - ), - ), - style: TextStyle( - fontFamily: 'Readex Pro', - fontSize: 26.rpx, - letterSpacing: 0, - ), - ); - }), - ), - ), - ), - ), - Padding( - padding: EdgeInsetsDirectional.fromSTEB( - 0, 32.rpx, 0, 0), - child: Container( - width: bodysize!.maxWidth, - height: 92.rpx, - decoration: BoxDecoration(), - child: Container( - width: bodysize!.maxWidth, - height: bodysize!.maxHeight * 0.06, - decoration: BoxDecoration( - color: Color(0xFFF3F5F6), - borderRadius: - BorderRadius.circular(12), - ), - child: Align( - alignment: - AlignmentDirectional(0, 0), - child: Obx(() { - return TextFormField( - // autofocus: true, - // focusNode: _focusNode2, - onChanged: (value) { - controller.model.confirm = - value; - }, - // obscureText: true, - obscureText: - controller.model.cpdshow!, - decoration: InputDecoration( - labelStyle: TextStyle( - fontFamily: 'Readex Pro', - fontSize: 26.rpx, - letterSpacing: 0, - ), - hintText: '确认新密码', - hintStyle: TextStyle( - fontFamily: 'Readex Pro', - color: Color(0xFF929699), - fontSize: 26.rpx, - letterSpacing: 0, - ), - enabledBorder: - InputBorder.none, - focusedBorder: - InputBorder.none, - errorBorder: InputBorder.none, - focusedErrorBorder: - InputBorder.none, - contentPadding: - EdgeInsetsDirectional - .fromSTEB( - 10, 26.rpx, 0, 0), - suffixIcon: IconButton( - icon: Icon( - // 根据 pdshow 控制图标 - controller.model.cpdshow! - ? Icons.visibility_off - : Icons.visibility, - color: Color(0xFF333333), - size: 16, - ), - onPressed: () { - // 切换 pdshow 状态 - controller.model.cpdshow = - !controller - .model.cpdshow!; - controller.updateAll(); - }, - ), - ), - style: TextStyle( - fontFamily: 'Readex Pro', - fontSize: 26.rpx, - letterSpacing: 0, - ), - ); - }), - ), - ), - ), - ), - Padding( - padding: EdgeInsetsDirectional.fromSTEB( - 42.rpx, 38.rpx, 42.rpx, 0), - child: Container( - width: bodysize!.maxWidth, - height: bodysize!.maxHeight * 0.022, - constraints: BoxConstraints( - minWidth: 466, - minHeight: 30, - ), - decoration: BoxDecoration(), - child: Container( - width: bodysize!.maxWidth, - height: bodysize!.maxHeight * 0.022, - constraints: BoxConstraints( - minWidth: 466, - minHeight: 30, - ), - decoration: BoxDecoration(), - ), - ), - ), - Padding( - padding: EdgeInsetsDirectional.fromSTEB( - 0, 58.rpx, 0, 0), - child: Container( - width: bodysize!.maxWidth, - height: bodysize!.maxHeight * 0.056, - decoration: BoxDecoration(), - child: CustomCard( - borderRadius: 16.rpx, - gradientDirection: - GradientDirection.vertical, - onTap: () async { - if (CommonVariables.isNetWorkOn == - false) { - TopSlideNotification.show( - context, - text: "网络未连接,请开启设备网络后重试".tr, - textColor: themeController - .currentColor.sc9); - return; - } - String msg = await controller - .confirmCode(context); - if (msg.isEmpty) { - Get.toNamed("/loginPage"); - } - }, - colors: const [ - Color(0xFFFCFCFC), - Color(0xFFF8FAF9), - Color(0XFFECF6F3), - Color(0XFFD9F0E9), - Color(0xFFCEECE3) - ], - child: Container( - width: double.infinity, - height: 90.rpx, - alignment: Alignment.center, - decoration: BoxDecoration( - borderRadius: - BorderRadius.circular( - 16.rpx), - ), - child: Text( - "提交", - style: TextStyle( - fontFamily: 'Readex Pro', - color: Color(0XFF003058), - letterSpacing: 0, - fontSize: 26.rpx, - ), ), ), - )), + style: TextStyle( + fontFamily: 'Readex Pro', + fontSize: 26.rpx, + letterSpacing: 0, + ), + ); + }), + ), ), - ], + ), ), - ), + Padding( + padding: EdgeInsetsDirectional.fromSTEB( + 0, 32.rpx, 0, 0), + child: Container( + width: bodysize!.maxWidth, + height: 92.rpx, + decoration: BoxDecoration(), + child: Container( + width: bodysize!.maxWidth, + height: bodysize!.maxHeight * 0.06, + decoration: BoxDecoration( + color: Color(0xFFF3F5F6), + borderRadius: BorderRadius.circular(12), + ), + child: Align( + alignment: AlignmentDirectional(0, 0), + child: Obx(() { + return TextFormField( + // autofocus: true, + // focusNode: _focusNode2, + onChanged: (value) { + controller.model.confirm = value; + }, + // obscureText: true, + obscureText: + controller.model.cpdshow!, + decoration: InputDecoration( + labelStyle: TextStyle( + fontFamily: 'Readex Pro', + fontSize: 26.rpx, + letterSpacing: 0, + ), + hintText: '确认新密码', + hintStyle: TextStyle( + fontFamily: 'Readex Pro', + color: Color(0xFF929699), + fontSize: 26.rpx, + letterSpacing: 0, + ), + enabledBorder: InputBorder.none, + focusedBorder: InputBorder.none, + errorBorder: InputBorder.none, + focusedErrorBorder: + InputBorder.none, + contentPadding: + EdgeInsetsDirectional + .fromSTEB( + 10, 26.rpx, 0, 0), + suffixIcon: IconButton( + icon: Icon( + // 根据 pdshow 控制图标 + controller.model.cpdshow! + ? Icons.visibility_off + : Icons.visibility, + color: Color(0xFF333333), + size: 16, + ), + onPressed: () { + // 切换 pdshow 状态 + controller.model.cpdshow = + !controller + .model.cpdshow!; + controller.updateAll(); + }, + ), + ), + style: TextStyle( + fontFamily: 'Readex Pro', + fontSize: 26.rpx, + letterSpacing: 0, + ), + ); + }), + ), + ), + ), + ), + Padding( + padding: EdgeInsetsDirectional.fromSTEB( + 42.rpx, 38.rpx, 42.rpx, 0), + child: Container( + width: bodysize!.maxWidth, + height: bodysize!.maxHeight * 0.022, + constraints: BoxConstraints( + minWidth: 466, + minHeight: 30, + ), + decoration: BoxDecoration(), + child: Container( + width: bodysize!.maxWidth, + height: bodysize!.maxHeight * 0.022, + constraints: BoxConstraints( + minWidth: 466, + minHeight: 30, + ), + decoration: BoxDecoration(), + ), + ), + ), + Padding( + padding: EdgeInsetsDirectional.fromSTEB( + 0, 58.rpx, 0, 0), + child: Container( + width: bodysize!.maxWidth, + height: bodysize!.maxHeight * 0.056, + decoration: BoxDecoration(), + child: CustomCard( + borderRadius: 16.rpx, + gradientDirection: + GradientDirection.vertical, + onTap: () async { + if (CommonVariables.isNetWorkOn == + false) { + TopSlideNotification.show(context, + text: "网络未连接,请开启设备网络后重试".tr, + textColor: themeController + .currentColor.sc9); + return; + } + String msg = await controller + .confirmCode(context); + if (msg.isEmpty) { + Get.toNamed("/loginPage"); + } + }, + colors: const [ + Color(0xFFFCFCFC), + Color(0xFFF8FAF9), + Color(0XFFECF6F3), + Color(0XFFD9F0E9), + Color(0xFFCEECE3) + ], + child: Container( + width: double.infinity, + height: 90.rpx, + alignment: Alignment.center, + decoration: BoxDecoration( + borderRadius: + BorderRadius.circular(16.rpx), + ), + child: Text( + "提交", + style: TextStyle( + fontFamily: 'Readex Pro', + color: Color(0XFF003058), + letterSpacing: 0, + fontSize: 26.rpx, + ), + ), + ), + )), + ), + ], ), ), ), - ], + ), ), - ), - )), - )); + ], + ), + ), + )), + )); }); } } diff --git a/lib/pages/mh_page/user/page/mht_login_page.dart b/lib/pages/mh_page/user/page/mht_login_page.dart index 54e9341..065225f 100644 --- a/lib/pages/mh_page/user/page/mht_login_page.dart +++ b/lib/pages/mh_page/user/page/mht_login_page.dart @@ -134,7 +134,7 @@ class MHTLoginPage extends GetView { return LayoutBuilder(builder: (context, cc) { bodysize = cc; return GestureDetector( - onTap: () => FocusScope.of(context).unfocus(), + // onTap: () => FocusScope.of(context).unfocus(),, child: Container( decoration: const BoxDecoration( image: DecorationImage( @@ -1458,7 +1458,8 @@ class MHTLoginPage extends GetView { color: stringToColor( "FF9F66"), - fontSize: 23.rpx, + fontSize: + 23.rpx, letterSpacing: 0, ), @@ -1504,7 +1505,8 @@ class MHTLoginPage extends GetView { color: stringToColor( "FF9F66"), - fontSize: 23.rpx, + fontSize: + 23.rpx, letterSpacing: 0, ), diff --git a/lib/pages/mh_page/user/page/rxhx_mht.dart b/lib/pages/mh_page/user/page/rxhx_mht.dart index edae4ce..62d7334 100644 --- a/lib/pages/mh_page/user/page/rxhx_mht.dart +++ b/lib/pages/mh_page/user/page/rxhx_mht.dart @@ -181,59 +181,200 @@ class _RxhxMhtState extends State { Widget build(BuildContext context) { return LayoutBuilder( builder: (context, boxConstraints) => GestureDetector( - onTap: () => FocusScope.of(context).unfocus(), + // onTap: () => FocusScope.of(context).unfocus(),, child: Container( - decoration: const BoxDecoration( - image: DecorationImage( - image: AssetImage('assets/images/new_background.png'), // 本地图片 - fit: BoxFit.fill, // 填满整个 Container + decoration: const BoxDecoration( + image: DecorationImage( + image: AssetImage('assets/images/new_background.png'), // 本地图片 + fit: BoxFit.fill, // 填满整个 Container + ), + ), + child: Scaffold( + backgroundColor: Colors.transparent, + appBar: AppBar( + backgroundColor: Colors.transparent, + automaticallyImplyLeading: false, + iconTheme: const IconThemeData(color: Colors.white), + titleSpacing: 0, + title: Container( + width: double.infinity, + height: 180.rpx, + child: Stack( + alignment: Alignment.center, + children: [ + // 中间居中的标题 + Text( + '柔性唤醒', + textAlign: TextAlign.center, + style: TextStyle( + color: Colors.white, + fontSize: 30.rpx, + ), + ), + // 左侧图标 + Positioned( + left: 0.rpx, + child: returnIconButtomNew, + ), + ], ), ), - child: Scaffold( - backgroundColor: Colors.transparent, - appBar: AppBar( - backgroundColor: Colors.transparent, - automaticallyImplyLeading: false, - iconTheme: const IconThemeData(color: Colors.white), - titleSpacing: 0, - title: Container( - width: double.infinity, - height: 180.rpx, - child: Stack( - alignment: Alignment.center, - children: [ - // 中间居中的标题 - Text( - '柔性唤醒', - textAlign: TextAlign.center, - style: TextStyle( - color: Colors.white, - fontSize: 30.rpx, + actions: [], + centerTitle: false, + ), + body: SafeArea( + top: true, + child: Obx( + () => Container( + padding: EdgeInsets.only(left: 30.rpx, right: 30.rpx), + width: MediaQuery.sizeOf(context).width, + height: MediaQuery.sizeOf(context).height * 1.123, + child: Column( + mainAxisSize: MainAxisSize.max, + children: [ + Container( + margin: EdgeInsets.only(left: 40.rpx, right: 16.rpx), + width: double.infinity, + height: 90.rpx, + decoration: const BoxDecoration(), + child: Row( + mainAxisSize: MainAxisSize.max, + mainAxisAlignment: MainAxisAlignment.spaceBetween, + children: [ + Text( + '柔性唤醒功能', + style: TextStyle( + fontFamily: 'Readex Pro', + color: Colors.white, + fontSize: 26.rpx, + letterSpacing: 0, + ), + ), + Container( + + // height: + // MediaQuery.sizeOf(context).height * + // 0.04, + child: FlutterSwitch( + width: 70.rpx, + height: 36.rpx, + toggleSize: 30.rpx, + activeColor: Color(0XFF6BFDAC), + inactiveColor: Color(0XFF003058), + toggleColor: Color(0xFF011D33), + value: controller.model.smysIsStart, + onToggle: (val) { + controller.attr.update((getmodel) { + getmodel.model.smysIsStart = val; + }); + }, + )), + // Container( + // height: + // MediaQuery.sizeOf(context).height * 0.04, + // child: Switch.adaptive( + // value: controller.model.rxhxIsStart, + // onChanged: (newValue) async { + // controller.attr.update((getmodel) { + // getmodel.model.rxhxIsStart = newValue; + // }); + // }, + // activeTrackColor: const Color(0xFFD3B684), + // inactiveTrackColor: const Color(0xFF0A1562), + // inactiveThumbColor: const Color(0xFF182B7C), + // trackOutlineWidth: MaterialStateProperty + // .resolveWith( + // (Set states) { + // if (states + // .contains(MaterialState.disabled)) { + // return null; + // } + // return null; // Use the default width. + // }), + // ), + // ), + ], + ), + ), + getLine(), + InkWell( + onTap: () async { + showDayTimeSelectionDialog(context, + dayTimeArr: controller.model.rxhxWakeTime, + title: "唤醒时间", checkChange: (d) { + controller.attr.update((getmodel) { + getmodel.model.rxhxWakeTime = [ + int.parse("${d[0]}"), + int.parse("${d[1]}") + ]; + }); + print("$d"); + }); + }, + child: Container( + margin: EdgeInsets.only(left: 40.rpx, right: 30.rpx), + width: double.infinity, + height: 90.rpx, + decoration: const BoxDecoration(), + child: Row( + mainAxisSize: MainAxisSize.max, + mainAxisAlignment: MainAxisAlignment.spaceBetween, + children: [ + Text( + '唤醒时间', + style: TextStyle( + fontFamily: 'Readex Pro', + color: Colors.white, + fontSize: 26.rpx, + letterSpacing: 0, + ), + ), + Row( + mainAxisSize: MainAxisSize.max, + children: [ + Text( + "${controller.model.rxhxWakeTimeToString}", + style: TextStyle( + fontFamily: 'Readex Pro', + color: Colors.white, + fontSize: 26.rpx, + letterSpacing: 0, + ), + ), + SizedBox( + width: 16.rpx, + ), + Container( + height: 30.rpx, + width: 30.rpx, + child: SvgPicture.asset( + 'assets/img/icon/expand_more.svg', + color: Colors.white, + )) + ], + ), + ], ), ), - // 左侧图标 - Positioned( - left: 0.rpx, - child: returnIconButtomNew, - ), - ], - ), - ), - actions: [], - centerTitle: false, - ), - body: SafeArea( - top: true, - child: Obx( - () => Container( - padding: EdgeInsets.only(left: 30.rpx, right: 30.rpx), - width: MediaQuery.sizeOf(context).width, - height: MediaQuery.sizeOf(context).height * 1.123, - child: Column( - mainAxisSize: MainAxisSize.max, - children: [ - Container( - margin: EdgeInsets.only(left: 40.rpx, right: 16.rpx), + ), + getLine(), + InkWell( + onTap: () { + showOneSelectionDialog( + context, + arr: ['开', "关"], + checkIndex: controller.model.rxhxIsAnMo ? 0 : 1, + title: "按摩", + checkChange: (index) { + controller.attr.update((getmodel) { + getmodel.model.rxhxIsAnMo = + index == 0 ? true : false; + }); + }, + ); + }, + child: Container( + margin: EdgeInsets.only(left: 40.rpx, right: 30.rpx), width: double.infinity, height: 90.rpx, decoration: const BoxDecoration(), @@ -242,7 +383,7 @@ class _RxhxMhtState extends State { mainAxisAlignment: MainAxisAlignment.spaceBetween, children: [ Text( - '柔性唤醒功能', + '按摩', style: TextStyle( fontFamily: 'Readex Pro', color: Colors.white, @@ -250,255 +391,59 @@ class _RxhxMhtState extends State { letterSpacing: 0, ), ), - Container( - - // height: - // MediaQuery.sizeOf(context).height * - // 0.04, - child: FlutterSwitch( - width: 70.rpx, - height: 36.rpx, - toggleSize: 30.rpx, - activeColor: Color(0XFF6BFDAC), - inactiveColor: Color(0XFF003058), - toggleColor: Color(0xFF011D33), - value: controller.model.smysIsStart, - onToggle: (val) { - controller.attr.update((getmodel) { - getmodel.model.smysIsStart = val; - }); - }, - )), - // Container( - // height: - // MediaQuery.sizeOf(context).height * 0.04, - // child: Switch.adaptive( - // value: controller.model.rxhxIsStart, - // onChanged: (newValue) async { - // controller.attr.update((getmodel) { - // getmodel.model.rxhxIsStart = newValue; - // }); - // }, - // activeTrackColor: const Color(0xFFD3B684), - // inactiveTrackColor: const Color(0xFF0A1562), - // inactiveThumbColor: const Color(0xFF182B7C), - // trackOutlineWidth: MaterialStateProperty - // .resolveWith( - // (Set states) { - // if (states - // .contains(MaterialState.disabled)) { - // return null; - // } - // return null; // Use the default width. - // }), - // ), - // ), + Row( + mainAxisSize: MainAxisSize.max, + children: [ + Text( + controller.model.rxhxIsAnMo ? '开' : '关', + style: TextStyle( + fontFamily: 'Readex Pro', + color: Colors.white, + fontSize: 26.rpx, + letterSpacing: 0, + ), + ), + SizedBox( + width: 16.rpx, + ), + Container( + height: 30.rpx, + width: 30.rpx, + child: SvgPicture.asset( + 'assets/img/icon/expand_more.svg', + color: Colors.white, + )) + ], + ), ], - ), - ), - getLine(), - InkWell( - onTap: () async { - showDayTimeSelectionDialog(context, - dayTimeArr: controller.model.rxhxWakeTime, - title: "唤醒时间", checkChange: (d) { - controller.attr.update((getmodel) { - getmodel.model.rxhxWakeTime = [ - int.parse("${d[0]}"), - int.parse("${d[1]}") - ]; - }); - print("$d"); + )), + ), + getLine(), + InkWell( + onTap: () { + showOneSelectionDialog( + context, + arr: location, + checkIndex: controller.model.rxhxLocation, + title: "唤醒部位", + checkChange: (index) { + controller.attr.update((getmodel) { + getmodel.model.rxhxLocation = index; }); }, - child: Container( - margin: - EdgeInsets.only(left: 40.rpx, right: 30.rpx), - width: double.infinity, - height: 90.rpx, - decoration: const BoxDecoration(), - child: Row( - mainAxisSize: MainAxisSize.max, - mainAxisAlignment: MainAxisAlignment.spaceBetween, - children: [ - Text( - '唤醒时间', - style: TextStyle( - fontFamily: 'Readex Pro', - color: Colors.white, - fontSize: 26.rpx, - letterSpacing: 0, - ), - ), - Row( - mainAxisSize: MainAxisSize.max, - children: [ - Text( - "${controller.model.rxhxWakeTimeToString}", - style: TextStyle( - fontFamily: 'Readex Pro', - color: Colors.white, - fontSize: 26.rpx, - letterSpacing: 0, - ), - ), - SizedBox( - width: 16.rpx, - ), - Container( - height: 30.rpx, - width: 30.rpx, - child: SvgPicture.asset( - 'assets/img/icon/expand_more.svg', - color: Colors.white, - )) - ], - ), - ], - ), - ), - ), - getLine(), - InkWell( - onTap: () { - showOneSelectionDialog( - context, - arr: ['开', "关"], - checkIndex: controller.model.rxhxIsAnMo ? 0 : 1, - title: "按摩", - checkChange: (index) { - controller.attr.update((getmodel) { - getmodel.model.rxhxIsAnMo = - index == 0 ? true : false; - }); - }, - ); - }, - child: Container( - margin: - EdgeInsets.only(left: 40.rpx, right: 30.rpx), - width: double.infinity, - height: 90.rpx, - decoration: const BoxDecoration(), - child: Row( - mainAxisSize: MainAxisSize.max, - mainAxisAlignment: - MainAxisAlignment.spaceBetween, - children: [ - Text( - '按摩', - style: TextStyle( - fontFamily: 'Readex Pro', - color: Colors.white, - fontSize: 26.rpx, - letterSpacing: 0, - ), - ), - Row( - mainAxisSize: MainAxisSize.max, - children: [ - Text( - controller.model.rxhxIsAnMo ? '开' : '关', - style: TextStyle( - fontFamily: 'Readex Pro', - color: Colors.white, - fontSize: 26.rpx, - letterSpacing: 0, - ), - ), - SizedBox( - width: 16.rpx, - ), - Container( - height: 30.rpx, - width: 30.rpx, - child: SvgPicture.asset( - 'assets/img/icon/expand_more.svg', - color: Colors.white, - )) - ], - ), - ], - )), - ), - getLine(), - InkWell( - onTap: () { - showOneSelectionDialog( - context, - arr: location, - checkIndex: controller.model.rxhxLocation, - title: "唤醒部位", - checkChange: (index) { - controller.attr.update((getmodel) { - getmodel.model.rxhxLocation = index; - }); - }, - ); - }, - child: Container( - margin: - EdgeInsets.only(left: 40.rpx, right: 30.rpx), - width: double.infinity, - height: 90.rpx, - decoration: const BoxDecoration(), - child: Row( - mainAxisSize: MainAxisSize.max, - mainAxisAlignment: - MainAxisAlignment.spaceBetween, - children: [ - Text( - '唤醒部位', - style: TextStyle( - fontFamily: 'Readex Pro', - color: Colors.white, - fontSize: 26.rpx, - letterSpacing: 0, - ), - ), - Row( - mainAxisSize: MainAxisSize.max, - children: [ - Text( - location[controller.model.rxhxLocation], - style: TextStyle( - fontFamily: 'Readex Pro', - color: Colors.white, - fontSize: 26.rpx, - letterSpacing: 0, - ), - ), - SizedBox( - width: 16.rpx, - ), - Container( - height: 30.rpx, - width: 30.rpx, - child: SvgPicture.asset( - 'assets/img/icon/expand_more.svg', - color: Colors.white, - )) - ], - ), - ], - )), - ), - getLine(), - Container( - margin: EdgeInsets.only( - top: 30.rpx, - bottom: 30.rpx, - left: 40.rpx, - right: 30.rpx), + ); + }, + child: Container( + margin: EdgeInsets.only(left: 40.rpx, right: 30.rpx), width: double.infinity, + height: 90.rpx, decoration: const BoxDecoration(), - child: Column( + child: Row( mainAxisSize: MainAxisSize.max, - mainAxisAlignment: MainAxisAlignment.center, - crossAxisAlignment: CrossAxisAlignment.start, + mainAxisAlignment: MainAxisAlignment.spaceBetween, children: [ Text( - '自定义', + '唤醒部位', style: TextStyle( fontFamily: 'Readex Pro', color: Colors.white, @@ -506,175 +451,220 @@ class _RxhxMhtState extends State { letterSpacing: 0, ), ), - // Padding( - // padding: EdgeInsetsDirectional.fromSTEB( - // 0, 20.rpx, 0, 0), - // child: Container( - // width: double.infinity, - // height: - // MediaQuery.sizeOf(context).height * 0.046, - // decoration: const BoxDecoration(), - // child: Row( - // mainAxisSize: MainAxisSize.max, - // mainAxisAlignment: - // MainAxisAlignment.spaceBetween, - // children: [ - // ...List.generate(7, (index) { - // return InkWell( - // onTap: () { - // controller.attr.update((getmodel) { - // getmodel.model - // .rxhxWeeks[index] = getmodel - // .model - // .rxhxWeeks[index] == - // 0 - // ? 1 - // : 0; - // }); - // }, - // child: AspectRatio( - // aspectRatio: 1, - // child: ClipOval( - // child: Container( - // height: double.infinity, - // decoration: BoxDecoration( - // color: controller.model - // .rxhxWeeks[ - // index] == - // 1 - // ? Color(0xFF84F5FF) - // : Color(0XFF003058)), - // child: Center( - // child: Text( - // weeks[index], - // style: TextStyle( - // color: controller.model - // .rxhxWeeks[ - // index] == - // 1 - // ? Color(0XFF003058) - // : Colors.white), - // ), - // ), - // ), - // ), - // ), - // ); - // }), - // ], - // ), - // ), - // ), - Padding( - padding: EdgeInsetsDirectional.fromSTEB( - 0, 20.rpx, 0, 0), - child: SizedBox( - width: double.infinity, - height: - MediaQuery.sizeOf(context).height * 0.046, - child: Row( - mainAxisAlignment: - MainAxisAlignment.spaceBetween, - children: List.generate(7, (index) { - final bool selected = - controller.model.rxhxWeeks[index] == - 1; - return InkWell( - onTap: () { - controller.attr.update((getmodel) { - getmodel.model.rxhxWeeks[index] = - getmodel.model - .rxhxWeeks[index] == - 0 - ? 1 - : 0; - }); - }, - borderRadius: BorderRadius.circular( - 50), // 点击水波圆角区域 - child: Container( - width: MediaQuery.sizeOf(context) - .height * - 0.046, // 保证是正圆 - height: MediaQuery.sizeOf(context) - .height * - 0.046, - decoration: BoxDecoration( - shape: BoxShape.circle, - color: selected - ? const Color(0xFF84F5FF) - : const Color(0xFF003058), - ), - alignment: Alignment.center, - child: Text( - weeks[index], - style: TextStyle( - color: selected - ? const Color(0xFF003058) - : Colors.white, - ), - ), - ), - ); - }), + Row( + mainAxisSize: MainAxisSize.max, + children: [ + Text( + location[controller.model.rxhxLocation], + style: TextStyle( + fontFamily: 'Readex Pro', + color: Colors.white, + fontSize: 26.rpx, + letterSpacing: 0, + ), ), - ), - ) + SizedBox( + width: 16.rpx, + ), + Container( + height: 30.rpx, + width: 30.rpx, + child: SvgPicture.asset( + 'assets/img/icon/expand_more.svg', + color: Colors.white, + )) + ], + ), ], - ), - ), - getLine(), - SizedBox( - height: 30.rpx, - ), - Container( - margin: EdgeInsets.only(left: 26.rpx, right: 26.rpx), - width: double.infinity, - decoration: const BoxDecoration(), - child: Text( - '*注:开启该功能后,在设置的时间点,设备将启动一段固定时长的柔性唤醒功能。', + )), + ), + getLine(), + Container( + margin: EdgeInsets.only( + top: 30.rpx, + bottom: 30.rpx, + left: 40.rpx, + right: 30.rpx), + width: double.infinity, + decoration: const BoxDecoration(), + child: Column( + mainAxisSize: MainAxisSize.max, + mainAxisAlignment: MainAxisAlignment.center, + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Text( + '自定义', style: TextStyle( fontFamily: 'Readex Pro', - color: Color(0xFF929699), - fontSize: 20.rpx, + color: Colors.white, + fontSize: 26.rpx, letterSpacing: 0, ), ), - ), - Spacer(), - Padding( - padding: EdgeInsets.only(bottom: 85.rpx), - child: CustomCard( - borderRadius: 16.rpx, - gradientDirection: GradientDirection.vertical, - onTap: () {}, - colors: const [ - Color(0xFFFCFCFC), - Color(0xFFF8FAF9), - Color(0XFFECF6F3), - Color(0XFFD9F0E9), - Color(0xFFCEECE3) - ], - child: Container( - width: double.infinity, - height: 90.rpx, - alignment: Alignment.center, - decoration: BoxDecoration( - borderRadius: BorderRadius.circular(6), - ), - child: Text("完成", - style: TextStyle( - color: const Color(0xFF003058), - fontSize: 26.rpx)), + // Padding( + // padding: EdgeInsetsDirectional.fromSTEB( + // 0, 20.rpx, 0, 0), + // child: Container( + // width: double.infinity, + // height: + // MediaQuery.sizeOf(context).height * 0.046, + // decoration: const BoxDecoration(), + // child: Row( + // mainAxisSize: MainAxisSize.max, + // mainAxisAlignment: + // MainAxisAlignment.spaceBetween, + // children: [ + // ...List.generate(7, (index) { + // return InkWell( + // onTap: () { + // controller.attr.update((getmodel) { + // getmodel.model + // .rxhxWeeks[index] = getmodel + // .model + // .rxhxWeeks[index] == + // 0 + // ? 1 + // : 0; + // }); + // }, + // child: AspectRatio( + // aspectRatio: 1, + // child: ClipOval( + // child: Container( + // height: double.infinity, + // decoration: BoxDecoration( + // color: controller.model + // .rxhxWeeks[ + // index] == + // 1 + // ? Color(0xFF84F5FF) + // : Color(0XFF003058)), + // child: Center( + // child: Text( + // weeks[index], + // style: TextStyle( + // color: controller.model + // .rxhxWeeks[ + // index] == + // 1 + // ? Color(0XFF003058) + // : Colors.white), + // ), + // ), + // ), + // ), + // ), + // ); + // }), + // ], + // ), + // ), + // ), + Padding( + padding: + EdgeInsetsDirectional.fromSTEB(0, 20.rpx, 0, 0), + child: SizedBox( + width: double.infinity, + height: MediaQuery.sizeOf(context).height * 0.046, + child: Row( + mainAxisAlignment: + MainAxisAlignment.spaceBetween, + children: List.generate(7, (index) { + final bool selected = + controller.model.rxhxWeeks[index] == 1; + return InkWell( + onTap: () { + controller.attr.update((getmodel) { + getmodel.model.rxhxWeeks[index] = + getmodel.model.rxhxWeeks[index] == 0 + ? 1 + : 0; + }); + }, + borderRadius: + BorderRadius.circular(50), // 点击水波圆角区域 + child: Container( + width: MediaQuery.sizeOf(context).height * + 0.046, // 保证是正圆 + height: + MediaQuery.sizeOf(context).height * + 0.046, + decoration: BoxDecoration( + shape: BoxShape.circle, + color: selected + ? const Color(0xFF84F5FF) + : const Color(0xFF003058), + ), + alignment: Alignment.center, + child: Text( + weeks[index], + style: TextStyle( + color: selected + ? const Color(0xFF003058) + : Colors.white, + ), + ), + ), + ); + }), ), - )) - ], + ), + ) + ], + ), ), - ), + getLine(), + SizedBox( + height: 30.rpx, + ), + Container( + margin: EdgeInsets.only(left: 26.rpx, right: 26.rpx), + width: double.infinity, + decoration: const BoxDecoration(), + child: Text( + '*注:开启该功能后,在设置的时间点,设备将启动一段固定时长的柔性唤醒功能。', + style: TextStyle( + fontFamily: 'Readex Pro', + color: Color(0xFF929699), + fontSize: 20.rpx, + letterSpacing: 0, + ), + ), + ), + Spacer(), + Padding( + padding: EdgeInsets.only(bottom: 85.rpx), + child: CustomCard( + borderRadius: 16.rpx, + gradientDirection: GradientDirection.vertical, + onTap: () {}, + colors: const [ + Color(0xFFFCFCFC), + Color(0xFFF8FAF9), + Color(0XFFECF6F3), + Color(0XFFD9F0E9), + Color(0xFFCEECE3) + ], + child: Container( + width: double.infinity, + height: 90.rpx, + alignment: Alignment.center, + decoration: BoxDecoration( + borderRadius: BorderRadius.circular(6), + ), + child: Text("完成", + style: TextStyle( + color: const Color(0xFF003058), + fontSize: 26.rpx)), + ), + )) + ], ), ), ), - )), + ), + ), + )), ); } } diff --git a/lib/pages/mh_page/user/page/update_password_page.dart b/lib/pages/mh_page/user/page/update_password_page.dart index d0730f3..d08d5d0 100644 --- a/lib/pages/mh_page/user/page/update_password_page.dart +++ b/lib/pages/mh_page/user/page/update_password_page.dart @@ -33,7 +33,7 @@ class UpdatePasswordPage extends GetView { return LayoutBuilder(builder: (context, cc) { bodysize = cc; return GestureDetector( - onTap: () => FocusScope.of(context).unfocus(), + // onTap: () => FocusScope.of(context).unfocus(),, child: Container( decoration: BoxDecoration( image: DecorationImage( @@ -42,7 +42,7 @@ class UpdatePasswordPage extends GetView { ), ), child: Scaffold( - // key: scaffoldKey, + // key: scaffoldKey, appBar: AppBar( backgroundColor: Colors.transparent, // backgroundColor: Colors.transparent, @@ -601,7 +601,7 @@ class UpdatePasswordPage extends GetView { UnderlineInputBorder( borderSide: BorderSide( - color: Colors.red, + color: Colors.red, width: 2, ), borderRadius: @@ -753,7 +753,7 @@ class UpdatePasswordPage extends GetView { UnderlineInputBorder( borderSide: BorderSide( - color: Colors.red, + color: Colors.red, width: 2, ), borderRadius: diff --git a/lib/pages/mh_page/user_agreement_page.dart b/lib/pages/mh_page/user_agreement_page.dart index 5a91f46..d5ef420 100644 --- a/lib/pages/mh_page/user_agreement_page.dart +++ b/lib/pages/mh_page/user_agreement_page.dart @@ -41,7 +41,7 @@ class _UserAgreementPageState extends State { Widget build(BuildContext context) { return LayoutBuilder( builder: (context, bodySize) => GestureDetector( - onTap: () => FocusScope.of(context).unfocus(), + // onTap: () => FocusScope.of(context).unfocus(),, child: Container( decoration: BoxDecoration( image: DecorationImage( diff --git a/lib/pages/person/person_page.dart b/lib/pages/person/person_page.dart index fdacbfd..83ee585 100644 --- a/lib/pages/person/person_page.dart +++ b/lib/pages/person/person_page.dart @@ -61,7 +61,7 @@ class _EPageState extends State { Widget build(BuildContext context) { return LayoutBuilder( builder: (context, bodySize) => GestureDetector( - onTap: () => FocusScope.of(context).unfocus(), + // onTap: () => FocusScope.of(context).unfocus(),, child: Container( decoration: BoxDecoration( image: DecorationImage( diff --git a/lib/pages/person/update_person_page.dart b/lib/pages/person/update_person_page.dart index 22cd234..3565051 100644 --- a/lib/pages/person/update_person_page.dart +++ b/lib/pages/person/update_person_page.dart @@ -57,7 +57,7 @@ class _UpdatePageState extends State { Widget build(BuildContext context) { return LayoutBuilder( builder: (context, bodySize) => GestureDetector( - onTap: () => FocusScope.of(context).unfocus(), + // onTap: () => FocusScope.of(context).unfocus(),, child: Container( decoration: BoxDecoration( image: DecorationImage( diff --git a/lib/pages/repair/apply_repair_page.dart b/lib/pages/repair/apply_repair_page.dart index bc582df..40296b7 100644 --- a/lib/pages/repair/apply_repair_page.dart +++ b/lib/pages/repair/apply_repair_page.dart @@ -89,7 +89,7 @@ class _ApplyRepairPageState extends State { } return LayoutBuilder( builder: (context, bodysize) => GestureDetector( - onTap: () => FocusScope.of(context).unfocus(), + // onTap: () => FocusScope.of(context).unfocus(),, child: Container( decoration: BoxDecoration( image: DecorationImage( diff --git a/lib/pages/repair/apply_repair_success.dart b/lib/pages/repair/apply_repair_success.dart index 5a2a6b9..8f83c33 100644 --- a/lib/pages/repair/apply_repair_success.dart +++ b/lib/pages/repair/apply_repair_success.dart @@ -33,7 +33,7 @@ class _ApplyRepairSuccessState extends State { Widget build(BuildContext context) { return LayoutBuilder( builder: (context, bodySize) => GestureDetector( - onTap: () => FocusScope.of(context).unfocus(), + // onTap: () => FocusScope.of(context).unfocus(),, child: Container( decoration: BoxDecoration( image: DecorationImage( diff --git a/lib/pages/repair/repair_detail_page.dart b/lib/pages/repair/repair_detail_page.dart index 0330408..9d9e753 100644 --- a/lib/pages/repair/repair_detail_page.dart +++ b/lib/pages/repair/repair_detail_page.dart @@ -65,7 +65,7 @@ class _RepairDetailPageState extends State { Widget build(BuildContext context) { return LayoutBuilder( builder: (context, bodysize) => GestureDetector( - onTap: () => FocusScope.of(context).unfocus(), + // onTap: () => FocusScope.of(context).unfocus(),, child: Container( decoration: BoxDecoration( image: DecorationImage( diff --git a/lib/pages/repair/repair_list_page.dart b/lib/pages/repair/repair_list_page.dart index 469c9a9..a92f270 100644 --- a/lib/pages/repair/repair_list_page.dart +++ b/lib/pages/repair/repair_list_page.dart @@ -35,7 +35,7 @@ class _RepairListPageState extends State { Widget build(BuildContext context) { return LayoutBuilder( builder: (context, bodysize) => GestureDetector( - onTap: () => FocusScope.of(context).unfocus(), + // onTap: () => FocusScope.of(context).unfocus(),, child: Container( decoration: BoxDecoration( image: DecorationImage( diff --git a/lib/pages/setting/common_mesaage_setting.dart b/lib/pages/setting/common_mesaage_setting.dart index 3dc1aa1..2aca63b 100644 --- a/lib/pages/setting/common_mesaage_setting.dart +++ b/lib/pages/setting/common_mesaage_setting.dart @@ -116,7 +116,7 @@ class _CommonMessageSettingPageState extends State { Widget build(BuildContext context) { return LayoutBuilder( builder: (context, bodysize) => GestureDetector( - onTap: () => FocusScope.of(context).unfocus(), + // onTap: () => FocusScope.of(context).unfocus(),, child: Container( decoration: BoxDecoration( image: DecorationImage( diff --git a/lib/pages/setting/language_setting.dart b/lib/pages/setting/language_setting.dart index c518cb9..f2cc1ec 100644 --- a/lib/pages/setting/language_setting.dart +++ b/lib/pages/setting/language_setting.dart @@ -29,7 +29,7 @@ class _LanguageSettingState extends State { Widget build(BuildContext context) { return LayoutBuilder( builder: (context, bodySize) => GestureDetector( - onTap: () => FocusScope.of(context).unfocus(), + // onTap: () => FocusScope.of(context).unfocus(),, child: Container( decoration: BoxDecoration( image: DecorationImage( diff --git a/lib/pages/sleep_report/chart/SnoreChart.dart b/lib/pages/sleep_report/chart/SnoreChart.dart index 055cbad..dd6b5ac 100644 --- a/lib/pages/sleep_report/chart/SnoreChart.dart +++ b/lib/pages/sleep_report/chart/SnoreChart.dart @@ -214,7 +214,7 @@ class BarChartPainter extends CustomPainter { // 缓存 tip 信息 if (selectedBar == d) { tipText = - '${d.name}\n${d.value.toStringAsFixed(1)}\n${MyUtils.formatToHHmm(d.st)}'; + '${d.name}\n${d.value.toStringAsFixed(1)}次\n${MyUtils.formatToHHmm(d.st)}'; final tp = TextPainter( text: TextSpan( diff --git a/lib/pages/sleep_report/chart/TimeSeriesChart.dart b/lib/pages/sleep_report/chart/TimeSeriesChart.dart index b4975a4..ebb3ba6 100644 --- a/lib/pages/sleep_report/chart/TimeSeriesChart.dart +++ b/lib/pages/sleep_report/chart/TimeSeriesChart.dart @@ -84,9 +84,28 @@ class TimeSeriesChart extends StatelessWidget { final xLabels = _generateXLabels(); final midY = (yMin + yMax) / 2; - List spots = dataPoints.map((p) { - return FlSpot(_timeToX(p.timestamp.toDouble(), xLabels), p.value); - }).toList(); + // 将数据点分割成多个连续段,遇到value=-1时断开 + List> lineSegments = []; + List currentSegment = []; + + for (var point in dataPoints) { + if (point.value != -1) { + // 有效数据点,添加到当前段 + currentSegment.add(FlSpot( + _timeToX(point.timestamp.toDouble(), xLabels), + point.value, + )); + } else if (currentSegment.isNotEmpty) { + // 遇到无效点且当前段不为空,结束当前段 + lineSegments.add(currentSegment); + currentSegment = []; + } + } + + // 添加最后一个段(如果有) + if (currentSegment.isNotEmpty) { + lineSegments.add(currentSegment); + } return AspectRatio( aspectRatio: 2, @@ -204,15 +223,16 @@ class TimeSeriesChart extends StatelessWidget { top: BorderSide.none, ), ), - lineBarsData: [ - LineChartBarData( - spots: spots, + lineBarsData: lineSegments.map((segment) { + return LineChartBarData( + spots: segment, isCurved: false, color: themeController.currentColor.sc2, barWidth: 2, dotData: FlDotData(show: false), - ) - ], + preventCurveOverShooting: true, + ); + }).toList(), ), ), ); diff --git a/lib/pages/sleep_report/component/BreatheStandardWidget.dart b/lib/pages/sleep_report/component/BreatheStandardWidget.dart index 53cf8a2..dc02830 100644 --- a/lib/pages/sleep_report/component/BreatheStandardWidget.dart +++ b/lib/pages/sleep_report/component/BreatheStandardWidget.dart @@ -47,11 +47,21 @@ class _BreatheStandardWidgetState extends State { final endTime = widget.sleepReport['endTime']; List> data = (widget.sleepReport['brbc'] as List).cast>(); - final dataPoints = data.map((item) { - final x = item['st'] as int; - final y = (item['value'] as num).toDouble(); // 安全地转换为 double - return TimeSeriesPoint(x, y); - }).toList(); + List dataPoints = []; + + if (data != null && data.isNotEmpty) { + data.forEach((item) { + final x = item['st'] as int; + if (item['value'] == null || item['value'] == '') { + // return; + dataPoints.add(TimeSeriesPoint(x, -1)); + return; + } + final y = (item['value'] as num).toDouble(); // 安全地转换为 double + // return TimeSeriesPoint(x, y); + dataPoints.add(TimeSeriesPoint(x, y)); + }); + } List> brs = (widget.sleepReport['brs'] as List).cast>(); @@ -130,7 +140,8 @@ class _BreatheStandardWidgetState extends State { Container( child: Text( // "呼吸数据介绍".tr, - "呼吸数据是指用户在睡眠过程中呼吸的基本数据,是评估睡眠呼吸质量、筛查睡眠呼吸障碍的核心指标。".tr, + "呼吸数据是指用户在睡眠过程中呼吸的基本数据,是评估睡眠呼吸质量、筛查睡眠呼吸障碍的核心指标。" + .tr, style: TextStyle( fontSize: 26.rpx, color: themeController.currentColor.sc3, diff --git a/lib/pages/sleep_report/component/HeartRateStandardWidget.dart b/lib/pages/sleep_report/component/HeartRateStandardWidget.dart index 880f35a..36be4ca 100644 --- a/lib/pages/sleep_report/component/HeartRateStandardWidget.dart +++ b/lib/pages/sleep_report/component/HeartRateStandardWidget.dart @@ -10,6 +10,7 @@ import 'package:vbvs_app/pages/device_bind/componnet/bind_dialog.dart'; import 'package:vbvs_app/pages/sleep_report/chart/TimeSeriesChart.dart'; import 'package:EasyDartModule/EasyDartModule.dart' as es; +//心率基准 class HeartRateStandardWidget extends StatefulWidget { var sleepReport; HeartRateStandardWidget({super.key, required this.sleepReport}); @@ -48,11 +49,21 @@ class _HeartRateStandardWidgetState extends State { final endTime = widget.sleepReport['endTime']; List> data = (widget.sleepReport['hrbc'] as List).cast>(); - final dataPoints = data.map((item) { - final x = item['st'] as int; - final y = (item['value'] as num).toDouble(); // 安全地转换为 double - return TimeSeriesPoint(x, y); - }).toList(); + List dataPoints = []; + + if (data != null && data.isNotEmpty) { + data.forEach((item) { + final x = item['st'] as int; + if (item['value'] == null || item['value'] == '') { + // return; + dataPoints.add(TimeSeriesPoint(x, -1)); + return; + } + final y = (item['value'] as num).toDouble(); // 安全地转换为 double + // return TimeSeriesPoint(x, y); + dataPoints.add(TimeSeriesPoint(x, y)); + }); + } List> hrs = (widget.sleepReport['hrs'] as List).cast>(); @@ -129,7 +140,8 @@ class _HeartRateStandardWidgetState extends State { Container( child: Text( // "心率数据介绍".tr, - "心率数据是指用户在睡眠过程中基本心率数据,可初步判断睡眠中的心血管负荷及自主神经功能状态,为睡眠健康评估提供重要依据。".tr, + "心率数据是指用户在睡眠过程中基本心率数据,可初步判断睡眠中的心血管负荷及自主神经功能状态,为睡眠健康评估提供重要依据。" + .tr, style: TextStyle( fontSize: 26.rpx, color: themeController.currentColor.sc3, @@ -376,7 +388,7 @@ class _HeartRateStandardWidgetState extends State { ), ); } catch (e) { - es.EasyDartModule.logger.error("打鼾监测绘制异常${e}"); + es.EasyDartModule.logger.error("心率基准绘制异常${e}"); return Container(); } } diff --git a/lib/pages/sleep_report/mht_new_sleep_report_page.dart b/lib/pages/sleep_report/mht_new_sleep_report_page.dart index 78bb41e..46242d1 100644 --- a/lib/pages/sleep_report/mht_new_sleep_report_page.dart +++ b/lib/pages/sleep_report/mht_new_sleep_report_page.dart @@ -138,7 +138,7 @@ class _MHTNewSleepReportPageState extends State { double lineWidth = 115.rpx; return LayoutBuilder( builder: (context, bodySize) => GestureDetector( - onTap: () => FocusScope.of(context).unfocus(), + // onTap: () => FocusScope.of(context).unfocus(),, child: Container( decoration: BoxDecoration( image: DecorationImage( diff --git a/lib/pages/sleep_report/new_sleep_report_page copy.dart b/lib/pages/sleep_report/new_sleep_report_page copy.dart index 53becb0..8020048 100644 --- a/lib/pages/sleep_report/new_sleep_report_page copy.dart +++ b/lib/pages/sleep_report/new_sleep_report_page copy.dart @@ -88,7 +88,7 @@ class _NewSleepReportPageState extends State { double lineWidth = 115.rpx; return LayoutBuilder( builder: (context, bodySize) => GestureDetector( - onTap: () => FocusScope.of(context).unfocus(), + // onTap: () => FocusScope.of(context).unfocus(),, child: Container( decoration: BoxDecoration( image: DecorationImage( diff --git a/lib/pages/sleep_report/new_sleep_report_page.dart b/lib/pages/sleep_report/new_sleep_report_page.dart index 661423c..033f4a4 100644 --- a/lib/pages/sleep_report/new_sleep_report_page.dart +++ b/lib/pages/sleep_report/new_sleep_report_page.dart @@ -153,7 +153,7 @@ class _NewSleepReportPageState extends State { double lineWidth = 115.rpx; return LayoutBuilder( builder: (context, bodySize) => GestureDetector( - onTap: () => FocusScope.of(context).unfocus(), + // onTap: () => FocusScope.of(context).unfocus(),, child: Container( decoration: BoxDecoration( image: (widget.data['noBackImg'] != null && diff --git a/lib/pages/sleep_report/sleep_report_page.dart b/lib/pages/sleep_report/sleep_report_page.dart index 9903d58..db079ff 100644 --- a/lib/pages/sleep_report/sleep_report_page.dart +++ b/lib/pages/sleep_report/sleep_report_page.dart @@ -42,7 +42,7 @@ class _SleepReportPageState extends State { Widget build(BuildContext context) { return LayoutBuilder( builder: (context, bodySize) => GestureDetector( - onTap: () => FocusScope.of(context).unfocus(), + // onTap: () => FocusScope.of(context).unfocus(),, child: Container( decoration: BoxDecoration( image: DecorationImage( @@ -67,11 +67,11 @@ class _SleepReportPageState extends State { Text( '健康报告'.tr, style: TextStyle( - fontFamily: 'Readex Pro', - color: themeController.currentColor.sc3, - letterSpacing: 0, - fontSize: 30.rpx, - ), + fontFamily: 'Readex Pro', + color: themeController.currentColor.sc3, + letterSpacing: 0, + fontSize: 30.rpx, + ), ), /// 左边返回按钮 @@ -117,6 +117,4 @@ class _SleepReportPageState extends State { ), ); } - - } diff --git a/lib/pages/user/about_us_page.dart b/lib/pages/user/about_us_page.dart index e5f4e47..f1cb66e 100644 --- a/lib/pages/user/about_us_page.dart +++ b/lib/pages/user/about_us_page.dart @@ -20,8 +20,7 @@ class _AboutUsPageState extends State { // pdfController.loadPdf(); widget.webView = MyWebView( - url: - AppConstants().ent_type == 1 + url: AppConstants().ent_type == 1 ? "https://mp.weixin.qq.com/s/IAr4RNBy0hGJXGKyMxe7eQ" : "https://mp.weixin.qq.com/s/7BvvprVDqX1eOzM3Lms8dg", onLoad: () { @@ -34,7 +33,7 @@ class _AboutUsPageState extends State { Widget build(BuildContext context) { return LayoutBuilder( builder: (context, bodySize) => GestureDetector( - onTap: () => FocusScope.of(context).unfocus(), + // onTap: () => FocusScope.of(context).unfocus(),, child: Container( decoration: BoxDecoration( image: DecorationImage( diff --git a/lib/pages/user/privacy_scheme_page.dart b/lib/pages/user/privacy_scheme_page.dart index d04ec37..35f0d0d 100644 --- a/lib/pages/user/privacy_scheme_page.dart +++ b/lib/pages/user/privacy_scheme_page.dart @@ -37,7 +37,7 @@ class _PrivacySchemePageState extends State { Widget build(BuildContext context) { return LayoutBuilder( builder: (context, bodySize) => GestureDetector( - onTap: () => FocusScope.of(context).unfocus(), + // onTap: () => FocusScope.of(context).unfocus(),, child: Container( decoration: BoxDecoration( image: DecorationImage( diff --git a/lib/pages/user/setting_page.dart b/lib/pages/user/setting_page.dart index 012b339..c031a56 100644 --- a/lib/pages/user/setting_page.dart +++ b/lib/pages/user/setting_page.dart @@ -40,7 +40,7 @@ class _SettingPageState extends State { Widget build(BuildContext context) { return LayoutBuilder( builder: (context, bodySize) => GestureDetector( - onTap: () => FocusScope.of(context).unfocus(), + // onTap: () => FocusScope.of(context).unfocus(),, child: Container( decoration: BoxDecoration( image: DecorationImage( @@ -577,8 +577,10 @@ class _SettingPageState extends State { ), ), Text( - AppConstants().ent_type == 1? 'Copyright © 202-2025 嘉兴太和信息技术有限责任公司 版权所有' - .tr:"Copyright © 202-2025 杭州欢睡科技有限公司 版权所有", + AppConstants().ent_type == 1 + ? 'Copyright © 202-2025 嘉兴太和信息技术有限责任公司 版权所有' + .tr + : "Copyright © 202-2025 杭州欢睡科技有限公司 版权所有", style: TextStyle( color: themeController.currentColor.sc4, fontFamily: 'Inter', diff --git a/lib/pages/user/update_user_page.dart b/lib/pages/user/update_user_page.dart index 8539b11..b76330d 100644 --- a/lib/pages/user/update_user_page.dart +++ b/lib/pages/user/update_user_page.dart @@ -49,7 +49,7 @@ class _UpdateUserPageState extends State { int login = userInfoController.model.login!; return LayoutBuilder( builder: (context, bodySize) => GestureDetector( - onTap: () => FocusScope.of(context).unfocus(), + // onTap: () => FocusScope.of(context).unfocus(),, child: Container( decoration: BoxDecoration( image: DecorationImage( @@ -290,12 +290,12 @@ class _UpdateUserPageState extends State { filled: false, ), style: TextStyle( - fontFamily: 'Inter', - fontSize: 26.rpx, - letterSpacing: 0.0, - color: themeController - .currentColor.sc3, - ), + fontFamily: 'Inter', + fontSize: 26.rpx, + letterSpacing: 0.0, + color: themeController + .currentColor.sc3, + ), textAlign: TextAlign.center, cursorColor: themeController .currentColor.sc3, diff --git a/lib/pages/user/user_scheme_page.dart b/lib/pages/user/user_scheme_page.dart index 18b440b..41de4a0 100644 --- a/lib/pages/user/user_scheme_page.dart +++ b/lib/pages/user/user_scheme_page.dart @@ -41,7 +41,7 @@ class _UserSchemePageState extends State { Widget build(BuildContext context) { return LayoutBuilder( builder: (context, bodySize) => GestureDetector( - onTap: () => FocusScope.of(context).unfocus(), + // onTap: () => FocusScope.of(context).unfocus(),, child: Container( decoration: BoxDecoration( image: DecorationImage( diff --git a/lib/pages/xiaoe/xiaoe_page.dart b/lib/pages/xiaoe/xiaoe_page.dart index 4574c0c..0606827 100644 --- a/lib/pages/xiaoe/xiaoe_page.dart +++ b/lib/pages/xiaoe/xiaoe_page.dart @@ -42,7 +42,7 @@ class _XiaoEPageState extends State { Widget build(BuildContext context) { return LayoutBuilder( builder: (context, bodySize) => GestureDetector( - onTap: () => FocusScope.of(context).unfocus(), + // onTap: () => FocusScope.of(context).unfocus(),, child: Container( decoration: BoxDecoration( image: DecorationImage(