diff --git a/lib/common/color/ServiceConstant.dart b/lib/common/color/ServiceConstant.dart index 5504953..cecc407 100644 --- a/lib/common/color/ServiceConstant.dart +++ b/lib/common/color/ServiceConstant.dart @@ -27,6 +27,7 @@ class ServiceConstant { static String user_setting = "/api/user/config";//查询和更新用户自定义配置 static String room_list = "/api/room/info"; //查询房间列表 static String issue_list = "/api/help/list"; //问题与帮助列表 + static String logService = "$service_address/vsbs_log"; static const String webSocketService = "wss://$baseHost/vsbs_ws_gateway/ws"; diff --git a/lib/controller/mh_controller/message_controller.dart b/lib/controller/mh_controller/message_controller.dart index f4389dd..4863ff6 100644 --- a/lib/controller/mh_controller/message_controller.dart +++ b/lib/controller/mh_controller/message_controller.dart @@ -50,7 +50,7 @@ class MhMessageController extends GetControllerEx { String serviceApi = ServiceConstant.message_list; String messageType = "app_system"; if (model.type == 1) { - messageType = "app_body"; + messageType = "app_vsm"; } else { messageType = "app_system"; } diff --git a/lib/pages/main_bottom/component/main_page_b_bottom_change.dart b/lib/pages/main_bottom/component/main_page_b_bottom_change.dart index 9ddef08..63b8299 100644 --- a/lib/pages/main_bottom/component/main_page_b_bottom_change.dart +++ b/lib/pages/main_bottom/component/main_page_b_bottom_change.dart @@ -1,6 +1,7 @@ import 'package:flutter/material.dart'; import 'package:vbvs_app/pages/common/bezier_bottom_navigation_bar.dart'; import 'package:vbvs_app/pages/mh_page/MattressControl.dart'; +import 'package:vbvs_app/pages/mh_page/device_list.dart'; import 'package:vbvs_app/pages/mh_page/homepage/mht_sleep_report_page.dart'; import 'package:vbvs_app/pages/mh_page/homepage/new_Home_page.dart'; import 'package:vbvs_app/pages/mh_page/new_mine_page.dart'; @@ -31,7 +32,7 @@ class _HomePageState extends State // Text('报告'), // RegisterPage(), // ShareDeviceWidget(), - MhtSleepReportPage(), + DeviceListPage(), // FindPasswordPage(), // Smys(), MattressControlPage(), diff --git a/lib/pages/main_bottom/message_page.dart b/lib/pages/main_bottom/message_page.dart index 160c355..69edcab 100644 --- a/lib/pages/main_bottom/message_page.dart +++ b/lib/pages/main_bottom/message_page.dart @@ -102,152 +102,6 @@ class _MessagePageState extends State { child: Column( children: [ SizedBox(height: 40.rpx), - // Expanded( - // child: Stack( - // alignment: Alignment.bottomLeft, - // children: [ - // Row( - // mainAxisAlignment: MainAxisAlignment.start, - // children: [ - // Obx(() { - // return ClickableContainer( - // padding: EdgeInsets.all(0), - // backgroundColor: Colors.transparent, - // highlightColor: - // themeController.currentColor.sc21, - // borderRadius: 8.rpx, - // onTap: () => _onTabChanged(0), - // child: Container( - // width: 160.rpx, - // alignment: Alignment.center, - // child: Stack( - // alignment: Alignment.center, - // clipBehavior: Clip.none, - // children: [ - // Text( - // '体征消息'.tr, - // style: FlutterFlowTheme.of(context) - // .bodyMedium - // .override( - // fontFamily: 'Inter', - // fontSize: AppConstants() - // .title_text_fontSize, - // color: - // messageController - // .model.type == - // 2 - // ? themeController - // .currentColor.sc3 - // : themeController - // .currentColor.sc2, - // ), - // ), - // Obx(() { - // return messageController.model - // .body_message_read == - // 1 - // ? Positioned( - // top: -4, - // right: -14, - // child: Container( - // width: 8, - // height: 8, - // decoration: - // const BoxDecoration( - // color: Colors.red, - // shape: BoxShape.circle, - // ), - // ), - // ) - // : const SizedBox.shrink(); - // }), - // ], - // ), - // ), - // ); - // }), - // Obx(() { - // return ClickableContainer( - // padding: EdgeInsets.all(0), - // backgroundColor: Colors.transparent, - // highlightColor: - // themeController.currentColor.sc21, - // borderRadius: 8.rpx, - // onTap: () => _onTabChanged(1), - // child: Container( - // width: 160.rpx, - // alignment: Alignment.center, - // child: Stack( - // alignment: Alignment.center, - // clipBehavior: Clip.none, - // children: [ - // Text( - // '系统消息'.tr, - // style: FlutterFlowTheme.of(context) - // .bodyMedium - // .override( - // fontFamily: 'Inter', - // fontSize: AppConstants() - // .title_text_fontSize, - // color: - // messageController - // .model.type == - // 1 - // ? themeController - // .currentColor.sc3 - // : themeController - // .currentColor.sc2, - // ), - // ), - // Obx(() { - // return messageController.model - // .system_message_read == - // 1 - // ? Positioned( - // top: -4, - // right: -14, - // child: Container( - // width: 8, - // height: 8, - // decoration: - // const BoxDecoration( - // color: Colors.red, - // shape: BoxShape.circle, - // ), - // ), - // ) - // : const SizedBox.shrink(); - // }), - // ], - // ), - // ), - // ); - // }), - // ].divide(SizedBox(width: 10.rpx)), - // ), - // Obx(() { - // double lineWidth = 170.rpx; - // return AnimatedPositioned( - // duration: const Duration(milliseconds: 300), - // curve: Curves.easeInOut, - // bottom: 0, - // left: messageController.model.type == 1 - // ? 0 - // : 170.rpx, - // child: Container( - // width: lineWidth, - // height: 4.rpx, - // decoration: BoxDecoration( - // color: themeController.currentColor.sc2, - // borderRadius: BorderRadius.circular(2.rpx), - // ), - // ), - // ); - // }), - // ], - // ), - // ), - Expanded( child: Stack( alignment: Alignment.bottomLeft, @@ -407,7 +261,6 @@ class _MessagePageState extends State { ], ), ), - SizedBox(height: 17.rpx), ], ), diff --git a/lib/pages/mh_page/MattressControl.dart b/lib/pages/mh_page/MattressControl.dart index e86e6cd..5e54853 100644 --- a/lib/pages/mh_page/MattressControl.dart +++ b/lib/pages/mh_page/MattressControl.dart @@ -135,9 +135,17 @@ class _MattressControlPageState extends State { child: Column( mainAxisAlignment: MainAxisAlignment.center, children: [ - _buildBedImageSection(context), - _buildModeSelector(context), - Expanded(child: _buildControlCards(context)), + Center( + child: Text( + "等待引入", + style: TextStyle( + color: Colors.white, + ), + )) + + // _buildBedImageSection(context), + // _buildModeSelector(context), + // Expanded(child: _buildControlCards(context)), ], ), ), diff --git a/lib/pages/mh_page/applyRepair/apply_repair_success.dart b/lib/pages/mh_page/applyRepair/apply_repair_success.dart new file mode 100644 index 0000000..8dc8d5e --- /dev/null +++ b/lib/pages/mh_page/applyRepair/apply_repair_success.dart @@ -0,0 +1,350 @@ +import 'package:ef/ef.dart'; +import 'package:flutter/material.dart'; +import 'package:flutter_svg/svg.dart'; +import 'package:flutterflow_ui/flutterflow_ui.dart'; +import 'package:vbvs_app/common/color/appConstants.dart'; +import 'package:vbvs_app/common/util/FitTool.dart'; +import 'package:vbvs_app/component/tool/ClickableContainer.dart'; +import 'package:vbvs_app/component/tool/CustomCard.dart'; +import 'package:vbvs_app/controller/device/blueteeth_bind_controller.dart'; +import 'package:vbvs_app/controller/main_bottom/global_controller.dart'; +import 'package:vbvs_app/controller/theme_controller/ThemeController.dart'; +import 'package:vbvs_app/controller/user_info_controller.dart'; + +class ApplyRepairSuccess extends StatefulWidget { + const ApplyRepairSuccess({super.key}); + + @override + State createState() => _ApplyRepairSuccessState(); +} + +class _ApplyRepairSuccessState extends State { + GlobalController globalController = Get.find(); + UserInfoController userInfoController = Get.find(); + BlueteethBindController blueteethBindController = Get.find(); + ThemeController themeController = Get.find(); + + @override + void initState() { + super.initState(); + } + + @override + Widget build(BuildContext context) { + return LayoutBuilder( + builder: (context, bodySize) => GestureDetector( + onTap: () => FocusScope.of(context).unfocus(), + child: Container( + decoration: 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: themeController.currentColor.sc3, + ), + titleSpacing: 0, + // leading: returnIconButtom, + title: Container( + width: double.infinity, + height: 180.rpx, + child: Stack( + alignment: Alignment.center, + children: [ + /// 居中标题 + Text( + '报修成功标题'.tr, + style: FlutterFlowTheme.of(context).bodyMedium.override( + fontFamily: 'Readex Pro', + color: themeController.currentColor.sc3, + letterSpacing: 0, + fontSize: 30.rpx, + ), + ), + + /// 左边返回按钮 + // Positioned( + // left: 0, + // child: returnIconButtom, + // ), + Positioned( + left: 40.rpx, + child: ClickableContainer( + onTap: () { + Get.offNamed("/mianPageBottomChange"); + }, + backgroundColor: Colors.transparent, + highlightColor: Colors + .grey, // 可以设置为 themeController.currentColor.sc3 之类 + borderRadius: 8.rpx, + padding: EdgeInsets.all(8.rpx), // 增加可点击区域 + child: SvgPicture.asset( + 'assets/img/icon/close.svg', + width: 25.rpx, + height: 25.rpx, + color: themeController.currentColor.sc3, + ), + ), + ), + ], + ), + ), + + actions: [], + centerTitle: false, + ), + + body: SafeArea( + top: true, + child: Padding( + padding: EdgeInsetsDirectional.fromSTEB(113.rpx, 0, 113.rpx, 0), + child: Column( + mainAxisAlignment: MainAxisAlignment.start, + mainAxisSize: MainAxisSize.max, + children: [ + Container( + height: bodySize.maxHeight * 0.15, + ), + Padding( + padding: EdgeInsetsDirectional.fromSTEB(0, 0.rpx, 0, 0), + child: Container( + width: 148.rpx, + height: 148.rpx, + // width: double.infinity, + decoration: BoxDecoration(), + child: SvgPicture.asset('assets/img/icon/tick.svg', + fit: BoxFit.cover, color: Color(0XFF84F5FF)), + ), + ), + Padding( + padding: EdgeInsetsDirectional.fromSTEB(0, 42.rpx, 0, 0), + child: Container( + width: double.infinity, + decoration: BoxDecoration(), + child: Align( + alignment: AlignmentDirectional(0, 0), + child: Text( + '报修成功'.tr, + style: FlutterFlowTheme.of(context) + .bodyMedium + .override( + fontFamily: 'Inter', + fontSize: 30.rpx, + letterSpacing: 0.0, + color: themeController.currentColor.sc3, + ), + ), + ), + ), + ), + + SizedBox( + height: 90.rpx, + ), + // Padding( + // padding: + // EdgeInsetsDirectional.fromSTEB(0, 265.rpx, 0, 0), + // child: Container( + // width: double.infinity, + // decoration: BoxDecoration(), + // child: Align( + // alignment: AlignmentDirectional(0, 0), + // child: Text( + // '绑定成功.分享标题'.tr, + // style: FlutterFlowTheme.of(context) + // .bodyMedium + // .override( + // fontFamily: 'Inter', + // fontSize: 30.rpx, + // letterSpacing: 0.0, + // color: themeController.currentColor.sc3, + // ), + // ), + // ), + // ), + // ), + // Padding( + // padding: EdgeInsetsDirectional.fromSTEB(0, 48.rpx, 0, 0), + // child: Container( + // width: double.infinity, + // decoration: BoxDecoration(), + // child: Align( + // alignment: AlignmentDirectional(-1, 0), + // child: Text( + // '报修成功标语'.tr, + // style: FlutterFlowTheme.of(context) + // .bodyMedium + // .override( + // fontFamily: 'Inter', + // fontSize: 26.rpx, + // letterSpacing: 0.0, + // color: themeController.currentColor.sc4, + // ), + // ), + // ), + // ), + // ), + + Padding( + padding: EdgeInsetsDirectional.fromSTEB(0, 110.rpx, 0, 0), + child: CustomCard( + borderRadius: + AppConstants().button_container_radius, // 圆角半径 + gradientDirection: GradientDirection.vertical, + onTap: () async { + Get.toNamed("/repairListPage"); + }, + colors: [ + Color(0xFFFCFCFC), + Color(0xFFF8FAF9), + Color(0XFFECF6F3), + Color(0XFFD9F0E9), + Color(0xFFCEECE3) + ], + child: Container( + width: MediaQuery.sizeOf(context).width * 0.66, + height: MediaQuery.sizeOf(context).height * 0.055, + constraints: BoxConstraints( + minWidth: 500.rpx, + minHeight: 90.rpx, + ), + child: Row( + mainAxisSize: MainAxisSize.max, + mainAxisAlignment: MainAxisAlignment.center, + children: [ + Padding( + padding: EdgeInsetsDirectional.fromSTEB( + 0, 2.rpx, 0, 0), + child: SvgPicture.asset( + 'assets/img/icon/history.svg', + width: 25.rpx, + height: 25.rpx, // 如果 SVG 中没有固定颜色,可以这样设置 + color: Color(0xFF011D33), + ), + ), + Text( + '查看报修历史'.tr, + style: FlutterFlowTheme.of(context) + .bodyMedium + .override( + color: Color(0xFF011D33), + fontFamily: 'Inter', + fontSize: AppConstants() + .normal_text_fontSize, // 自定义字体大小 + letterSpacing: 0.0, + ), + ), + ].divide(SizedBox(width: 17.rpx)), + ), + ), + ), + ), + Padding( + padding: EdgeInsetsDirectional.fromSTEB(0, 18.rpx, 0, 0), + child: CustomCard( + borderRadius: + AppConstants().button_container_radius, // 圆角半径 + gradientDirection: GradientDirection.vertical, + onTap: () { + Get.offNamed("/mianPageBottomChange"); + }, + colors: [ + // 渐变色 + Color(0xFFFCFCFC), + Color(0xFFF8FAF9), + Color(0XFFECF6F3), + Color(0XFFD9F0E9), + Color(0xFFCEECE3) + ], + + child: Container( + width: MediaQuery.sizeOf(context).width * 0.66, + 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: FlutterFlowTheme.of(context) + .bodyMedium + .override( + color: Color(0xFF011D33), + fontFamily: 'Inter', + fontSize: AppConstants() + .normal_text_fontSize, // 自定义字体大小 + letterSpacing: 0.0, + ), + ), + ].divide(SizedBox(width: 17.rpx)), + ), + ), + ), + ), + ], + ), + ), + ), + ), + ), + ), + ); + } + + Widget _buildDeviceCard(BuildContext context, + {required String title, required String imageUrl, required String type}) { + return CustomCard( + borderRadius: 20.rpx, // 圆角大小 + onTap: () { + if (type != null) { + if (type == '1') { + Get.toNamed("/blueteethDevice"); + } + } + }, + + colors: [themeController.currentColor.sc17], // 背景色 + child: Container( + width: double.infinity, + height: MediaQuery.sizeOf(context).height * 0.135, + constraints: BoxConstraints( + minHeight: 220.rpx, + ), + padding: EdgeInsetsDirectional.fromSTEB(77.rpx, 0, 21.rpx, 0), + child: Row( + mainAxisSize: MainAxisSize.max, + mainAxisAlignment: MainAxisAlignment.spaceBetween, + children: [ + Text( + title, + style: FlutterFlowTheme.of(context).bodyMedium.override( + fontFamily: 'Inter', + color: const Color(0xFFC2CED7), + fontSize: 30.rpx, + letterSpacing: 0.0, + ), + ), + ClipRRect( + borderRadius: BorderRadius.circular(8.rpx), + child: Image.asset( + imageUrl, + width: 212.rpx, + height: 168.rpx, + ), + ), + ], + ), + ), + ); + } +} diff --git a/lib/pages/mh_page/apply_repair_page.dart b/lib/pages/mh_page/apply_repair_page.dart index a70b9be..4eb0ec1 100644 --- a/lib/pages/mh_page/apply_repair_page.dart +++ b/lib/pages/mh_page/apply_repair_page.dart @@ -1,19 +1,25 @@ import 'package:ef/ef.dart'; import 'package:flutter/material.dart'; import 'package:flutterflow_ui/flutterflow_ui.dart'; +import 'package:vbvs_app/common/color/ServiceConstant.dart'; import 'package:vbvs_app/common/color/appConstants.dart'; import 'package:vbvs_app/common/color/appFontsize.dart'; +import 'package:vbvs_app/common/color/app_uri_status.dart'; import 'package:vbvs_app/common/util/FitTool.dart'; import 'package:vbvs_app/common/util/MyUtils.dart'; +import 'package:vbvs_app/common/util/requestWithLog.dart'; import 'package:vbvs_app/component/img/img_default_widget.dart'; import 'package:vbvs_app/component/img/img_preview_widget.dart'; import 'package:vbvs_app/component/tool/CustomCard.dart'; +import 'package:vbvs_app/component/tool/TopSlideNotification.dart'; import 'package:vbvs_app/controller/mh_controller/apply_repair_controller.dart'; +import 'package:vbvs_app/controller/repair/repair_controller.dart'; +import 'package:vbvs_app/model/api_response.dart'; class ApplyRepairPage extends GetView { final scaffoldKey = GlobalKey(); BoxConstraints? bodysize; - + RepairController repairController = Get.find(); // ApplyRepairPage() { // controller.attr.value.listenlists.clear(); // controller.getDeviceList(); @@ -24,6 +30,9 @@ class ApplyRepairPage extends GetView { // controller.model.device_id = ""; // } + final List repairItemKeys = []; + final GlobalKey contactKey = GlobalKey(); + final GlobalKey phoneKey = GlobalKey(); @override Widget build(BuildContext context) { var tmpcontroller = @@ -869,8 +878,45 @@ class ApplyRepairPage extends GetView { .model.issue_img!.isEmpty) Flexible( child: InkWell( - onTap: () { - // controller.uploadImg(); + onTap: () async { + ApiResponse apiResponse = + await repairController + .uploadImg(); + // print(apiResponse); + // if (apiResponse.code == + // HttpStatusCodes.ok) { + // print(widget.model); + // // setState(() { + // // widget.model['path'] = apiResponse.data['path']; + // // }); + // widget.model['path'] = + // apiResponse + // .data['path']; + // repairController.repairList + // .refresh(); // 通知 Obx 更新(如果用了 GetX) + // print(widget.model); + // } else { + // if (widget.model['path'] == + // null || + // widget.model['path'] + // .isEmpty + // ) { + // TopSlideNotification.show( + // context, + // text: apiResponse.msg!, + // textColor: apiResponse + // .code == + // HttpStatusCodes + // .ok + // ? themeController + // .currentColor + // .sc2 + // : themeController + // .currentColor + // .sc9, + // ); + // } + // } }, child: Container( width: @@ -1330,445 +1376,418 @@ class ApplyRepairPage extends GetView { ), Padding( padding: EdgeInsetsDirectional.fromSTEB( - 0, 26.rpx, 0, 0), + 0, 48.rpx, 0, 0), child: Container( width: bodysize!.maxWidth, height: bodysize!.maxHeight * 0.17, - constraints: const BoxConstraints( - minHeight: 222, + constraints: BoxConstraints( + minHeight: 345.rpx, ), decoration: BoxDecoration( color: Color(0XFF003058), borderRadius: BorderRadius.circular(16), ), - child: Container( - width: bodysize!.maxWidth, - height: bodysize!.maxHeight * 1, - decoration: BoxDecoration( - borderRadius: BorderRadius.circular(16), - ), - child: Column( - mainAxisSize: MainAxisSize.max, - children: [ - Align( - alignment: - const AlignmentDirectional( - 0, 0), - child: Padding( - padding: - const EdgeInsetsDirectional - .fromSTEB(0, 15, 0, 15), - child: Text( - '联系方式', - style: - FlutterFlowTheme.of(context) - .bodyMedium - .override( - fontFamily: - 'Readex Pro', - color: Colors.white, - fontSize: 30.rpx, - letterSpacing: 0, - fontWeight: - FontWeight.w600, - ), - ), + 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: FlutterFlowTheme.of( + context) + .bodyMedium + .override( + 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, 0), - 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: - const BoxConstraints( - minWidth: 60, - ), - // decoration: - // BoxDecoration( - // color: FlutterFlowTheme.of( - // context) - // .secondaryBackground, - // ), - child: Row( - mainAxisSize: - MainAxisSize - .max, - children: [ - Text( - '联系人', - style: FlutterFlowTheme.of(context).bodyMedium.override( - fontFamily: - 'Readex Pro', - fontSize: 26 - .rpx, - letterSpacing: - 0, - color: Colors - .white), - ), - ], - ), - ), - Expanded( - child: Container( - width: MediaQuery + ), + 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) - .width, - height: 100, - decoration: - BoxDecoration( - color: Colors - .white, - borderRadius: - BorderRadius - .circular( - 8), - ), - child: - TextFormField( - // autofocus: true, - onChanged: - (value) { - controller - .model - .apply_name = - value; - }, - initialValue: - controller - .model - .apply_name, - obscureText: - false, - textAlignVertical: - TextAlignVertical - .center, - decoration: - InputDecoration( - contentPadding: - const EdgeInsetsDirectional - .fromSTEB( - 10, - 10, - 10, - 14), - labelStyle: FlutterFlowTheme.of( - context) - .labelMedium - .override( - fontFamily: - 'Readex Pro', - letterSpacing: - 0, - ), - hintStyle: FlutterFlowTheme.of( - context) - .labelMedium - .override( - 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: FlutterFlowTheme.of( - context) - .bodyMedium - .override( - fontFamily: - 'Readex Pro', - 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) - .height * - 0.038, - constraints: - const BoxConstraints( - minWidth: 60, - ), - child: Row( - mainAxisSize: - MainAxisSize - .max, - children: [ - Text( - '手机号码', - style: FlutterFlowTheme.of(context).bodyMedium.override( - fontFamily: - 'Readex Pro', - fontSize: 26 - .rpx, - letterSpacing: - 0, - color: Colors - .white), - ), - ], - ), + constraints: + BoxConstraints( + minWidth: 60.rpx, ), - Expanded( - child: Container( - width: 100, - height: 100, - decoration: - BoxDecoration( - color: Colors - .white, - borderRadius: - BorderRadius - .circular( - 8), + // decoration: + // BoxDecoration( + // color: FlutterFlowTheme.of( + // context) + // .secondaryBackground, + // ), + child: Row( + mainAxisSize: + MainAxisSize + .max, + children: [ + Text( + '联系人', + style: FlutterFlowTheme.of(context).bodyMedium.override( + fontFamily: + 'Readex Pro', + fontSize: 26 + .rpx, + letterSpacing: + 0, + color: Colors + .white), ), - child: - TextFormField( - // autofocus: true, - onChanged: - (value) { - controller - .model - .tel = - value; - }, - initialValue: - controller - .model - .tel, - obscureText: - false, - textAlignVertical: - TextAlignVertical - .center, - decoration: - InputDecoration( - contentPadding: - const EdgeInsetsDirectional - .fromSTEB( - 10, - 10, - 10, - 14), - labelStyle: FlutterFlowTheme.of( - context) - .labelMedium - .override( - fontFamily: - 'Readex Pro', - letterSpacing: - 0, - ), - hintStyle: FlutterFlowTheme.of( - context) - .labelMedium - .override( - 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: FlutterFlowTheme.of( + ], + ), + ), + Expanded( + child: Container( + width: MediaQuery + .sizeOf( context) - .bodyMedium + .width, + height: 100, + decoration: + BoxDecoration( + color: Colors + .white, + borderRadius: + BorderRadius + .circular( + 8), + ), + child: + TextFormField( + // autofocus: true, + onChanged: + (value) { + controller + .model + .apply_name = + value; + }, + initialValue: + controller + .model + .apply_name, + obscureText: + false, + textAlignVertical: + TextAlignVertical + .center, + decoration: + InputDecoration( + contentPadding: + const EdgeInsetsDirectional + .fromSTEB( + 10, + 10, + 10, + 14), + labelStyle: FlutterFlowTheme.of( + context) + .labelMedium .override( fontFamily: 'Readex Pro', letterSpacing: 0, ), + hintStyle: FlutterFlowTheme.of( + context) + .labelMedium + .override( + 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: FlutterFlowTheme.of( + context) + .bodyMedium + .override( + fontFamily: + 'Readex Pro', + letterSpacing: + 0, + ), ), ), - ].divide( - const SizedBox( - width: 13)), - ), + ), + ].divide(const SizedBox( + width: 13)), ), ), - ].divide(const SizedBox( - height: 15)), - ), + ), + 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: FlutterFlowTheme.of(context).bodyMedium.override( + 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, + onChanged: + (value) { + controller + .model + .tel = + value; + }, + initialValue: + controller + .model + .tel, + obscureText: + false, + textAlignVertical: + TextAlignVertical + .center, + decoration: + InputDecoration( + contentPadding: + const EdgeInsetsDirectional + .fromSTEB( + 10, + 10, + 10, + 14), + labelStyle: FlutterFlowTheme.of( + context) + .labelMedium + .override( + fontFamily: + 'Readex Pro', + letterSpacing: + 0, + ), + hintStyle: FlutterFlowTheme.of( + context) + .labelMedium + .override( + 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: FlutterFlowTheme.of( + context) + .bodyMedium + .override( + fontFamily: + 'Readex Pro', + letterSpacing: + 0, + ), + ), + ), + ), + ].divide(const SizedBox( + width: 13)), + ), + ), + ), + ].divide( + const SizedBox(height: 15)), ), ), ), - ], - ), + ), + ], ), ), ), @@ -1785,31 +1804,60 @@ class ApplyRepairPage extends GetView { width: bodysize!.maxWidth, height: bodysize!.maxHeight * 0.056, decoration: BoxDecoration( - color: FlutterFlowTheme.of(context) - .secondaryBackground, borderRadius: BorderRadius.circular(16.rpx), ), child: CustomCard( borderRadius: 16.rpx, gradientDirection: GradientDirection.vertical, - onTap: () { - // print('Button pressed ...'); - // controller.submitRepair(context).then((msg) { - // if (msg.isEmpty) { - // MessageListController messageListController = - // Get.find(); - // messageListController.addMessage(); - // Get.to(() => ApplyRepairSuccessPage(), - // arguments: {'model': controller.model}); - // controller.model = - // ApplyRepairModel(); // 在 submitRepair 完成后执行 - // controller.updateAll(); - // } - // }).catchError((error) { - // // 错误处理 - // print('Error: $error'); - // }); - controller.submitRepair(context); + onTap: () async { + Get.toNamed("/applyRepairSuccess"); + // TopSlideNotification.show( + // context, + // text: "功能开发中...", + // ); + + // 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 = { + // "device": repairController.repairList.value, + // "type": repairController.device_type.value, + // "contacts": { + // "name": repairController.name.value, + // "phone": repairController.phone.value + // }, + // }; + // ApiResponse apiResponse = await requestWithLog( + // logTitle: "提交报修信息", + // method: MyHttpMethod.post, + // queryUrl: queryUrl, + // data: data, + // onSuccess: (res) { + // TopSlideNotification.show(context, + // text: res.msg!); + // // Get.back(); + // Get.toNamed("/applyRepairSuccess"); + // }, + // onFailure: (res) { + // TopSlideNotification.show(context, + // text: res.msg!, + // textColor: + // themeController.currentColor.sc9); + // }, + // ); + // } }, colors: const [ Color(0xFFFCFCFC), @@ -1880,4 +1928,73 @@ class ApplyRepairPage extends GetView { ); }).toList(); } + + String checkRepairParam() { + String errormsg = ""; + + // 检查报修项 + for (var i = 0; i < repairController.repairList.length; i++) { + final item = repairController.repairList[i]; + + if (item["path"] == null || item["path"].toString().isEmpty) { + _scrollToKey(repairItemKeys[i]); + // return "第 ${i + 1} 项图片未上传"; + return "图片未上传".tr; + } + if (item["id"] == null || item["id"].toString().isEmpty) { + _scrollToKey(repairItemKeys[i]); + // return "第 ${i + 1} 项设备未选择"; + return "设备未选择".tr; + } + if (item["param"] == null || item["param"].toString().isEmpty) { + _scrollToKey(repairItemKeys[i]); + // return "第 ${i + 1} 项参数未填写"; + return "参数未填写".tr; + } + if (item["issue"] == null || item["issue"].toString().isEmpty) { + _scrollToKey(repairItemKeys[i]); + // return "第 ${i + 1} 项问题描述未填写"; + return "问题描述未填写".tr; + } + if (item["issue"] != null && item["issue"].toString().trim().isNotEmpty) { + final issueText = item["issue"].toString().trim(); + final charCount = issueText.runes.length; + + if (charCount > 60) { + _scrollToKey(repairItemKeys[i]); + return "问题描述最多输入60个字".tr; + } + } else { + _scrollToKey(repairItemKeys[i]); + return "问题描述不能为空".tr; + } + } + + // 检查联系人 + if (repairController.name.trim().isEmpty) { + _scrollToKey(contactKey); + return "联系人不能为空".tr; + } + if (repairController.phone.trim().isEmpty) { + _scrollToKey(phoneKey); + return "联系电话不能为空".tr; + } + if (!MyUtils.isValidPhoneNumber(repairController.phone.trim())) { + _scrollToKey(phoneKey); + return "无效的手机号码".tr; + } + + return errormsg; + } + + // 新增滚动方法 + void _scrollToKey(GlobalKey key) { + WidgetsBinding.instance.addPostFrameCallback((_) { + Scrollable.ensureVisible( + key.currentContext!, + duration: Duration(milliseconds: 300), + curve: Curves.easeInOut, + ); + }); + } } diff --git a/lib/pages/mh_page/bluetooth.dart b/lib/pages/mh_page/bluetooth.dart index f213056..01e5344 100644 --- a/lib/pages/mh_page/bluetooth.dart +++ b/lib/pages/mh_page/bluetooth.dart @@ -5,6 +5,7 @@ import 'package:flutter_svg/svg.dart'; import 'package:vbvs_app/common/util/FitTool.dart'; import 'package:vbvs_app/common/util/MyUtils.dart'; import 'package:vbvs_app/component/tool/ClickableContainer.dart'; +import 'package:vbvs_app/component/tool/TopSlideNotification.dart'; class BluetoothPage extends GetView { Map data; @@ -135,18 +136,14 @@ class BluetoothPage extends GetView { arguments: data), _buildMenuButton( context, '房间选择', "/roomPickerPage"), - _buildMenuButton( - context, '设备校准', "/devicePeopleInfo"), - _buildMenuButton( - context, '体征传感器', "/devicePeopleInfo"), - _buildMenuButton( - context, 'WIFI配置', "/devicePeopleInfo"), + _buildMenuButton(context, '设备校准', ""), + _buildMenuButton(context, '体征传感器', ""), + _buildMenuButton(context, 'WIFI配置', ""), _buildMenuButton( context, '睡眠习惯', "/sleepHabitPage"), _buildMenuButton( context, '分享设备', "/deviceSharePage"), - _buildMenuButton( - context, '解绑', "/devicePeopleInfo"), + _buildMenuButton(context, '解绑', ""), ], ), ), @@ -172,6 +169,11 @@ class BluetoothPage extends GetView { } else { Get.toNamed(path!); } + } else { + TopSlideNotification.show( + context, + text: "功能开发中...", + ); } }, child: Container( diff --git a/lib/pages/mh_page/book_info_page.dart b/lib/pages/mh_page/book_info_page.dart index c0b2772..fc8cafa 100644 --- a/lib/pages/mh_page/book_info_page.dart +++ b/lib/pages/mh_page/book_info_page.dart @@ -7,6 +7,7 @@ import 'package:vbvs_app/common/util/FitTool.dart'; import 'package:vbvs_app/common/util/MyUtils.dart'; import 'package:vbvs_app/component/base/THFlutterFlowDropDown.dart'; import 'package:vbvs_app/component/tool/CustomCard.dart'; +import 'package:vbvs_app/component/tool/TopSlideNotification.dart'; import 'package:vbvs_app/controller/mh_controller/book_info_controller.dart'; import 'package:vbvs_app/pages/common/selectDialog.dart'; import 'package:vbvs_app/pages/mh_page/book_date_widget.dart'; @@ -584,39 +585,39 @@ class BookInfoPage extends GetView { borderRadius: 16.rpx, gradientDirection: GradientDirection.vertical, onTap: () { - if (controller.model.select_time_index == null) { - showToast("请选择体验时间"); - return; - } - if (controller.model.userName == null || - controller.model.userName == "") { - showToast("请输入姓名"); - return; - } - if (controller.model.userPhone == null || - controller.model.userPhone == "") { - showToast("请输入手机号"); - return; - } - if (MyUtils.isValidPhoneNumber( - controller.model.userPhone!) == - false) { - showToast("请输入正确的手机号"); - return; - } - controller.submitData(data["id"]).then((d) { - if (d.data["status"] == 2) { - d.data["addressDetail"] = data['addressDetail']; - d.data["name"] = data["name"]; - controller.messageAdd(d.data); - Get.offAndToNamed("/bookSuccessPage", - arguments: {"data": d.data}); - } else { - showToast("预约失败"); - } - }).catchError((d) { - showToast("预约失败"); - }); + // if (controller.model.select_time_index == null) { + // showToast("请选择体验时间"); + // return; + // } + // if (controller.model.userName == null || + // controller.model.userName == "") { + // showToast("请输入姓名"); + // return; + // } + // if (controller.model.userPhone == null || + // controller.model.userPhone == "") { + // showToast("请输入手机号"); + // return; + // } + // if (MyUtils.isValidPhoneNumber( + // controller.model.userPhone!) == + // false) { + // showToast("请输入正确的手机号"); + // return; + // } + // controller.submitData(data["id"]).then((d) { + // if (d.data["status"] == 2) { + // d.data["addressDetail"] = data['addressDetail']; + // d.data["name"] = data["name"]; + // controller.messageAdd(d.data); + // Get.offAndToNamed("/bookSuccessPage", + // arguments: {"data": d.data}); + // } else { + // showToast("预约失败"); + // } + // }).catchError((d) { + // showToast("预约失败"); + // }); // Get.toNamed("/bookSuccessPage", arguments: { // "data": { // "id": "7fbfbd614ef5befa3d8a84730f666853", @@ -678,6 +679,10 @@ class BookInfoPage extends GetView { // "storeAddress": null // }, // }); + TopSlideNotification.show( + context, + text: "功能开发中...", + ); }, colors: const [ Color(0xFFFCFCFC), diff --git a/lib/pages/mh_page/device_people_info.dart b/lib/pages/mh_page/device_people_info.dart index b8c3c5c..94e8bf5 100644 --- a/lib/pages/mh_page/device_people_info.dart +++ b/lib/pages/mh_page/device_people_info.dart @@ -35,6 +35,9 @@ class DevicePeopleInfo extends GetView { @override Widget build(BuildContext context) { + WidgetsBinding.instance.addPostFrameCallback((_) { + controller.initData(data['mac']); + }); return LayoutBuilder( builder: (context, boxConstraints) => GestureDetector( onTap: () => FocusScope.of(context).unfocus(), diff --git a/lib/pages/mh_page/edit_bed.dart b/lib/pages/mh_page/edit_bed.dart index c8faf45..7e9f7d3 100644 --- a/lib/pages/mh_page/edit_bed.dart +++ b/lib/pages/mh_page/edit_bed.dart @@ -1,20 +1,37 @@ import 'package:ef/base/widget/flutterflow/FlutterFlowTheme.dart'; import 'package:ef/ef.dart'; import 'package:flutter/material.dart'; +import 'package:vbvs_app/common/color/ServiceConstant.dart'; import 'package:vbvs_app/common/util/FitTool.dart'; import 'package:vbvs_app/common/util/MyUtils.dart'; +import 'package:vbvs_app/common/util/requestWithLog.dart'; import 'package:vbvs_app/component/tool/CustomCard.dart'; class EditBedPage extends StatefulWidget { - const EditBedPage({Key? key}) : super(key: key); + final Map data; + EditBedPage({Key? key, required this.data}); @override _EditBedPageState createState() => _EditBedPageState(); } BoxConstraints? bodysize; -RxString _bedName = "".obs; class _EditBedPageState extends State { + late Map editedData; + late TextEditingController _nameController; //名称文本输入框 + @override + void initState() { + super.initState(); + editedData = Map.from(widget.data); // 创建副本 + _nameController = TextEditingController(text: editedData['name']); + } + + @override + void dispose() { + _nameController.dispose(); // 记得释放Controller + super.dispose(); + } + @override Widget build(BuildContext context) { return LayoutBuilder(builder: (context, cc) { @@ -94,12 +111,13 @@ class _EditBedPageState extends State { width: 0))), child: TextFormField( // autofocus: true, + controller: _nameController, obscureText: false, onChanged: (val) { - // controller.model.name = val; + editedData['name'] = val; }, textAlign: TextAlign.center, - initialValue: _bedName.value, + initialValue: widget.data['name'], decoration: InputDecoration( hintText: "请输入床的名称", contentPadding: @@ -172,7 +190,25 @@ class _EditBedPageState extends State { child: CustomCard( borderRadius: 16.rpx, gradientDirection: GradientDirection.vertical, - onTap: () {}, + onTap: () async { + String serviceAddress = + ServiceConstant.service_address; + String serviceName = + ServiceConstant.server_service; + String serviceApi = ServiceConstant.person_info; + String queryUrl = + "$serviceAddress$serviceName$serviceApi"; + await requestWithLog( + logTitle: "更新设备信息", + method: MyHttpMethod.put, + queryUrl: queryUrl, + data: { + "id": editedData["id"], + "name": editedData["name"], + }, + onSuccess: (res) {}, + ); + }, colors: const [ Color(0xFFFCFCFC), Color(0xFFF8FAF9), diff --git a/lib/pages/mh_page/issue_preview_widget.dart b/lib/pages/mh_page/issue_preview_widget.dart index b7b1a81..5fa9613 100644 --- a/lib/pages/mh_page/issue_preview_widget.dart +++ b/lib/pages/mh_page/issue_preview_widget.dart @@ -3,6 +3,7 @@ import 'package:flutter/material.dart'; import 'package:flutter_svg/svg.dart'; import 'package:vbvs_app/common/util/FitTool.dart'; import 'package:vbvs_app/component/tool/ClickableContainer.dart'; +import 'package:vbvs_app/component/tool/TopSlideNotification.dart'; import 'package:vbvs_app/controller/mh_controller/issue_controller.dart'; import 'package:vbvs_app/controller/mh_controller/issue_preview_controller.dart'; @@ -21,13 +22,17 @@ class IssuePreviewWidget extends GetView { Widget build(BuildContext context) { return InkWell( onTap: () async { - issueListController.model.selectedIndex = index; - issueListController.updateAll(); - await Future.delayed(Duration(milliseconds: 100)); - issueListController.model.selectedIndex = -1; - issueListController.updateAll(); - var article = issueListController.model.issueList![index]; - Get.toNamed("/helpArticle", arguments: article); + // issueListController.model.selectedIndex = index; + // issueListController.updateAll(); + // await Future.delayed(Duration(milliseconds: 100)); + // issueListController.model.selectedIndex = -1; + // issueListController.updateAll(); + // var article = issueListController.model.issueList![index]; + // Get.toNamed("/helpArticle", arguments: article); + TopSlideNotification.show( + context, + text: "功能开发中...", + ); }, child: Obx(() { return Container( diff --git a/lib/pages/mh_page/message_page.dart b/lib/pages/mh_page/message_page.dart index 5bc81f4..6fea360 100644 --- a/lib/pages/mh_page/message_page.dart +++ b/lib/pages/mh_page/message_page.dart @@ -77,65 +77,65 @@ class _MessagePageState extends State { @override Widget build(BuildContext context) { - messageController.messageList.value = [ - { - "_id": "6836c3ee4e626030c8000000", - "type": "app_vsm", - "data": { - "title": "实时监测通知", - "val": [ - {"k": "设备ID", "v": "48ca43b1b454"}, - {"k": "使用人员", "v": "bb"}, - {"k": "消息类型", "v": "呼吸异常"}, - {"k": "检测值", "v": '26'}, - {"k": "检测时间", "v": "2025-05-28 16:06:07"} - ] - }, - "level": 3, - "tid": "67f5d96e26ef310463000000", - "uid": "68319fe9702cc59bd1000000", - "status": 0, - "createTime": "1748419566651" - }, - { - "_id": "6836c3e84e625f30c8000000", - "type": "app_vsm", - "data": { - "title": "实时监测通知", - "val": [ - {"k": "设备ID", "v": "48ca43b1b454"}, - {"k": "使用人员", "v": "bb"}, - {"k": "消息类型", "v": "心率异常"}, - {"k": "检测值", "v": '115'}, - {"k": "检测时间", "v": "2025-05-28 16:06:00"} - ] - }, - "level": 3, - "tid": "67f5d96e26ef310463000000", - "uid": "68319fe9702cc59bd1000000", - "status": 0, - "createTime": "1748419560486" - }, - { - "_id": "6836bd0c4e625e30c8000000", - "type": "app_vsm", - "data": { - "title": "实时监测通知", - "val": [ - {"k": "设备ID", "v": "48ca43b1b454"}, - {"k": "使用人员", "v": "bb"}, - {"k": "消息类型", "v": "心率异常"}, - {"k": "检测值", "v": '107'}, - {"k": "检测时间", "v": "1748417761000"} - ] - }, - "level": 3, - "tid": "67f5d96e26ef310463000000", - "uid": "68319fe9702cc59bd1000000", - "status": 0, - "createTime": "1748417804381" - } - ]; + // messageController.messageList.value = [ + // { + // "_id": "6836c3ee4e626030c8000000", + // "type": "app_vsm", + // "data": { + // "title": "实时监测通知", + // "val": [ + // {"k": "设备ID", "v": "48ca43b1b454"}, + // {"k": "使用人员", "v": "bb"}, + // {"k": "消息类型", "v": "呼吸异常"}, + // {"k": "检测值", "v": '26'}, + // {"k": "检测时间", "v": "2025-05-28 16:06:07"} + // ] + // }, + // "level": 3, + // "tid": "67f5d96e26ef310463000000", + // "uid": "68319fe9702cc59bd1000000", + // "status": 0, + // "createTime": "1748419566651" + // }, + // { + // "_id": "6836c3e84e625f30c8000000", + // "type": "app_vsm", + // "data": { + // "title": "实时监测通知", + // "val": [ + // {"k": "设备ID", "v": "48ca43b1b454"}, + // {"k": "使用人员", "v": "bb"}, + // {"k": "消息类型", "v": "心率异常"}, + // {"k": "检测值", "v": '115'}, + // {"k": "检测时间", "v": "2025-05-28 16:06:00"} + // ] + // }, + // "level": 3, + // "tid": "67f5d96e26ef310463000000", + // "uid": "68319fe9702cc59bd1000000", + // "status": 0, + // "createTime": "1748419560486" + // }, + // { + // "_id": "6836bd0c4e625e30c8000000", + // "type": "app_vsm", + // "data": { + // "title": "实时监测通知", + // "val": [ + // {"k": "设备ID", "v": "48ca43b1b454"}, + // {"k": "使用人员", "v": "bb"}, + // {"k": "消息类型", "v": "心率异常"}, + // {"k": "检测值", "v": '107'}, + // {"k": "检测时间", "v": "1748417761000"} + // ] + // }, + // "level": 3, + // "tid": "67f5d96e26ef310463000000", + // "uid": "68319fe9702cc59bd1000000", + // "status": 0, + // "createTime": "1748417804381" + // } + // ]; SystemChrome.setSystemUIOverlayStyle(const SystemUiOverlayStyle( statusBarColor: Colors.transparent, @@ -239,13 +239,13 @@ class _MessagePageState extends State { onPageChanged: _onPageChanged, children: [ Obx(() { - final list = messageController.messageList.value; + final list = messageController.messageList; return list.isEmpty ? const NullDataWidget() : _buildMessageListView(list); }), Obx(() { - final list = messageController.messageList.value; + final list = messageController.messageList; return list.isEmpty ? const NullDataWidget() : _buildMessageListView(list); diff --git a/lib/pages/mh_page/my_experience_widget.dart b/lib/pages/mh_page/my_experience_widget.dart index 8f2bbc0..de35e9c 100644 --- a/lib/pages/mh_page/my_experience_widget.dart +++ b/lib/pages/mh_page/my_experience_widget.dart @@ -5,6 +5,8 @@ import 'package:vbvs_app/common/util/FitTool.dart'; import 'package:vbvs_app/common/util/MyUtils.dart'; import 'package:vbvs_app/controller/mh_controller/my_experience_list_controller.dart'; +import 'package:vbvs_app/pages/common/selectDialog.dart'; +import 'package:vbvs_app/pages/mh_page/app_map_location.dart'; import '../../common/color/appFontsize.dart'; @@ -263,27 +265,27 @@ class MyExperienceWidget extends GetView { Flexible( child: InkWell( onTap: () { - // AppMapLocation.checkInstalledApps() - // .then((d) { - // if (AppMapLocation - // .availableMapsToNames.isEmpty) { - // showToast("未检测到导航软件"); - // } else { - // showOneSelectionDialog(context, - // title: "选择地图", - // arr: AppMapLocation - // .availableMapsToNames, - // checkChange: (index) { - // AppMapLocation.launchMap( - // index, - // data["name"], - // double.parse( - // "${data["latitude"]}"), - // double.parse( - // "${data["longitude"]}")); - // }); - // } - // }); + AppMapLocation.checkInstalledApps() + .then((d) { + if (AppMapLocation + .availableMapsToNames.isEmpty) { + showToast("未检测到导航软件"); + } else { + showOneSelectionDialog(context, + title: "选择地图", + arr: AppMapLocation + .availableMapsToNames, + checkChange: (index) { + AppMapLocation.launchMap( + index, + data["name"], + double.parse( + "${data["latitude"]}"), + double.parse( + "${data["longitude"]}")); + }); + } + }); }, child: Container( width: MediaQuery.sizeOf(context).width * diff --git a/lib/pages/mh_page/new_mine_page.dart b/lib/pages/mh_page/new_mine_page.dart index dcb2399..27c6ad6 100644 --- a/lib/pages/mh_page/new_mine_page.dart +++ b/lib/pages/mh_page/new_mine_page.dart @@ -236,7 +236,9 @@ class _MinePageState extends State { Padding( padding: EdgeInsets.only(top: 46.rpx, bottom: 109.rpx), child: ElevatedButton( - onPressed: () {}, + onPressed: () { + Get.toNamed("/deviceListPage"); + }, style: ElevatedButton.styleFrom( tapTargetSize: MaterialTapTargetSize.shrinkWrap, backgroundColor: const Color(0XFF85F5FF), diff --git a/lib/pages/mh_page/repair_list.dart b/lib/pages/mh_page/repair_list.dart index ca43998..e86730e 100644 --- a/lib/pages/mh_page/repair_list.dart +++ b/lib/pages/mh_page/repair_list.dart @@ -1,4 +1,5 @@ import 'package:ef/ef.dart'; +import 'package:flutter/gestures.dart'; import 'package:flutter/material.dart'; import 'package:vbvs_app/common/util/FitTool.dart'; import 'package:vbvs_app/common/util/MyUtils.dart'; @@ -151,6 +152,12 @@ class DeviceRepairPage extends GetView { Colors.white, decorationThickness: 4.rpx, ), + recognizer: + TapGestureRecognizer() + ..onTap = () { + MyUtils.makePhoneCall( + "400-8756-966"); + }, ), TextSpan( text: " 反馈。", diff --git a/lib/pages/mh_page/smys.dart b/lib/pages/mh_page/smys.dart index 2930c2b..2819f75 100644 --- a/lib/pages/mh_page/smys.dart +++ b/lib/pages/mh_page/smys.dart @@ -130,7 +130,7 @@ class Smys extends GetView { .bodyMedium .override( fontFamily: 'Readex Pro', - color: Color(0xFF9EA4B7), + color: Colors.white, fontSize: 26.rpx, letterSpacing: 0, ), @@ -185,7 +185,7 @@ class Smys extends GetView { .bodyMedium .override( fontFamily: 'Readex Pro', - color: Color(0xFF9EA4B7), + color: Colors.white, fontSize: 26.rpx, letterSpacing: 0, ), @@ -263,7 +263,7 @@ class Smys extends GetView { .bodyMedium .override( fontFamily: 'Readex Pro', - color: Color(0xFF9EA4B7), + color: Colors.white, fontSize: 26.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 0c76e34..78ab7be 100644 --- a/lib/pages/mh_page/user/page/rxhx_mht.dart +++ b/lib/pages/mh_page/user/page/rxhx_mht.dart @@ -637,7 +637,7 @@ class _RxhxMhtState extends State { .bodyMedium .override( fontFamily: 'Readex Pro', - color: Colors.white, + color: Color(0xFF929699), fontSize: 20.rpx, letterSpacing: 0, ), diff --git a/lib/routers/mh_routers.dart b/lib/routers/mh_routers.dart index 62386a4..b828425 100644 --- a/lib/routers/mh_routers.dart +++ b/lib/routers/mh_routers.dart @@ -9,6 +9,7 @@ import 'package:vbvs_app/pages/main_bottom/component/main_page_b_bottom_change.d import 'package:vbvs_app/pages/mh_page/HomeDeviceType.dart'; import 'package:vbvs_app/pages/mh_page/LanguagePage.dart'; import 'package:vbvs_app/pages/mh_page/address_list_page.dart'; +import 'package:vbvs_app/pages/mh_page/applyRepair/apply_repair_success.dart'; import 'package:vbvs_app/pages/mh_page/apply_repair_page.dart'; import 'package:vbvs_app/pages/mh_page/book_info_page.dart'; import 'package:vbvs_app/pages/mh_page/book_success_page.dart'; @@ -68,7 +69,7 @@ var mhroutes = { '/syms': (context) => Smys(), "/applyRepairPage": (context) => ApplyRepairPage(), "/roomPickerPage": (context) => RoomPickerPage(), - "/editBedPage": (context) => EditBedPage(), + "/editBedPage": (context, {arguments}) => EditBedPage(data: arguments), "/experienceStorePage": (context) => ExperienceStorePage(), "/bookInfoPage": (context, {arguments}) => BookInfoPage(data: arguments["data"]), @@ -89,9 +90,10 @@ var mhroutes = { "/bindDeviceSuccess": (contxt) => MHTBindDeviceSuccess(), "/newSleepReportPage": (contxt, {arguments}) => NewSleepReportPage(data: arguments), - "/rxhxMht": (context) => RxhxMht(), - "/helpArticle": (contxt, {arguments}) => HelpArticle(article: arguments), + "/rxhxMht": (context) => RxhxMht(), + "/helpArticle": (contxt, {arguments}) => HelpArticle(article: arguments), "/mHTPeopleInfoPage": (contxt) => MHTPeopleInfoPage(), + "/applyRepairSuccess": (contxt) => ApplyRepairSuccess(), }; var mhonGenerateRoute = (RouteSettings settings) { final String? name = settings.name; // 获取路由名称,如 /news 或 /search