diff --git a/assets/mhlangs/zh_CN.json b/assets/mhlangs/zh_CN.json index 00f6324..13fa1a0 100644 --- a/assets/mhlangs/zh_CN.json +++ b/assets/mhlangs/zh_CN.json @@ -212,5 +212,6 @@ "本月平均分": "本月平均分", "每日得分": "每日得分", "每日得分介绍": "每日得分介绍", - "与上月对比": "与上月对比" + "与上月对比": "与上月对比", + "设备状态":"设备状态" } \ No newline at end of file diff --git a/lib/component/home_page/SleepDataModuleWidget.dart b/lib/component/home_page/SleepDataModuleWidget.dart index d1699b9..677d810 100644 --- a/lib/component/home_page/SleepDataModuleWidget.dart +++ b/lib/component/home_page/SleepDataModuleWidget.dart @@ -55,8 +55,8 @@ class _SleepDataModuleWidgetState extends State { var report = sleepReportController.sleepReport; List> levelGroups = []; if (widget.sleepReportData != null) { - report = widget.sleepReportData; - } + report.value = widget.sleepReportData; + } if (report != null) { var colorMap = Map.from(report.value['info']['color']); diff --git a/lib/component/img/img_preview_widget.dart b/lib/component/img/img_preview_widget.dart index d3735f9..832ec07 100644 --- a/lib/component/img/img_preview_widget.dart +++ b/lib/component/img/img_preview_widget.dart @@ -23,9 +23,7 @@ class ImgPreviewWidget extends GetView { constraints: BoxConstraints( minHeight: 140, ), - decoration: BoxDecoration( - color: Colors.white, - ), + decoration: BoxDecoration(), child: Column( mainAxisSize: MainAxisSize.max, mainAxisAlignment: MainAxisAlignment.start, @@ -35,7 +33,7 @@ class ImgPreviewWidget extends GetView { width: MediaQuery.sizeOf(context).width, height: MediaQuery.sizeOf(context).height * 0.116, decoration: BoxDecoration( - color: Color(0xFFF3F5F6), + color: Colors.transparent, borderRadius: BorderRadius.circular(8), ), child: ClipRRect( diff --git a/lib/controller/sleep/sleep_report_controller.dart b/lib/controller/sleep/sleep_report_controller.dart index 77da6c2..626c1cd 100644 --- a/lib/controller/sleep/sleep_report_controller.dart +++ b/lib/controller/sleep/sleep_report_controller.dart @@ -27,8 +27,7 @@ class SleepReportModel { class SleepReportController extends GetControllerEx { Rx selectedDate = Rx(null); RxMap sleepReport = {}.obs; - - var isLoading = false.obs; + RxBool isLoading = false.obs; // 每种类型对应一份数据 diff --git a/lib/pages/device_bind/componnet/bind_dialog.dart b/lib/pages/device_bind/componnet/bind_dialog.dart index c0a1148..dea8329 100644 --- a/lib/pages/device_bind/componnet/bind_dialog.dart +++ b/lib/pages/device_bind/componnet/bind_dialog.dart @@ -920,7 +920,7 @@ Future showTipDialog( BuildContext context, Widget widget, { Color? backgroundColor, - Co + List? colors, }) { ThemeController themeController = Get.find(); // BlueteethBindController blueteethBindController = Get.find(); @@ -961,10 +961,11 @@ Future showTipDialog( onTap: () { Get.back(); // 关闭对话框 }, - colors: [ - themeController.currentColor.sc1, - themeController.currentColor.sc2, - ], + colors: colors ?? + [ + themeController.currentColor.sc1, + themeController.currentColor.sc2, + ], child: Container( width: MediaQuery.sizeOf(context).width, height: MediaQuery.sizeOf(context).height * 0.055, @@ -999,9 +1000,6 @@ Future showTipDialog( ); } - - - Future showUnBindTipDialog( BuildContext context, Widget widget, { diff --git a/lib/pages/mh_page/LanguagePage.dart b/lib/pages/mh_page/LanguagePage.dart index 2ed9759..89426a0 100644 --- a/lib/pages/mh_page/LanguagePage.dart +++ b/lib/pages/mh_page/LanguagePage.dart @@ -111,6 +111,7 @@ class LanguagePage extends GetView { Widget _buildItem(BuildContext context, int index, MHLanguageModel model) { return GestureDetector( + behavior: HitTestBehavior.opaque, onTap: () { controller.selectLanguage.value = model; }, diff --git a/lib/pages/mh_page/Vital_signs_sensor.dart b/lib/pages/mh_page/Vital_signs_sensor.dart index 2a4b944..ed4c37c 100644 --- a/lib/pages/mh_page/Vital_signs_sensor.dart +++ b/lib/pages/mh_page/Vital_signs_sensor.dart @@ -129,7 +129,7 @@ class VitalWidget extends StatelessWidget { @override Widget build(BuildContext context) { final String id = data['mac'] ?? '--'; - final int? timestamp = data['create_time']; + final int? timestamp = data['status']['updateTime']; final String time = (timestamp != null) ? DateFormat('yyyy-MM-dd HH:mm') .format(DateTime.fromMillisecondsSinceEpoch(timestamp)) @@ -215,7 +215,7 @@ class VitalWidget extends StatelessWidget { width: MediaQuery.sizeOf(context).width * 0.14, constraints: BoxConstraints(minWidth: 106.rpx), child: Text( - "设备状态", + "设备状态".tr, style: TextStyle( color: stringToColor("#929699"), fontSize: 26.rpx, @@ -245,7 +245,7 @@ class VitalWidget extends StatelessWidget { text: TextSpan( text: "信号强度".tr, // 文本前缀部分 style: TextStyle( - color: themeController.currentColor.sc3, + color: Colors.black, fontSize: AppConstants().title_text_fontSize, ), @@ -264,6 +264,12 @@ class VitalWidget extends StatelessWidget { ), ), ), + backgroundColor: Color(0xFFFFFFFF), + colors: [ + Color(0XFF1592AA), + Color(0xFF0C83A7), + Color(0xFF006FA3) + ], ); }, @@ -290,7 +296,7 @@ class VitalWidget extends StatelessWidget { text: TextSpan( text: "是否在床".tr, // 文本前缀部分 style: TextStyle( - color: themeController.currentColor.sc3, + color: Colors.black, fontSize: AppConstants().title_text_fontSize, ), @@ -309,6 +315,12 @@ class VitalWidget extends StatelessWidget { ), ), ), + backgroundColor: Color(0xFFFFFFFF), + colors: [ + Color(0XFF1592AA), + Color(0xFF0C83A7), + Color(0xFF006FA3) + ], ); }, child: SizedBox( @@ -338,7 +350,7 @@ class VitalWidget extends StatelessWidget { text: TextSpan( text: "设备故障".tr, // 文本前缀部分 style: TextStyle( - color: themeController.currentColor.sc9, + color: Colors.black, fontSize: AppConstants().title_text_fontSize, ), @@ -357,6 +369,12 @@ class VitalWidget extends StatelessWidget { ), ), ), + backgroundColor: Color(0xFFFFFFFF), + colors: [ + Color(0XFF1592AA), + Color(0xFF0C83A7), + Color(0xFF006FA3) + ], ); }, child: SizedBox( @@ -404,7 +422,7 @@ class VitalWidget extends StatelessWidget { text: TextSpan( text: "网络状态".tr, // 文本前缀部分 style: TextStyle( - color: themeController.currentColor.sc3, + color: Colors.black, fontSize: AppConstants().title_text_fontSize, ), @@ -424,6 +442,12 @@ class VitalWidget extends StatelessWidget { ), ), ), + backgroundColor: Color(0xFFFFFFFF), + colors: [ + Color(0XFF1592AA), + Color(0xFF0C83A7), + Color(0xFF006FA3) + ], ); }, child: SizedBox( diff --git a/lib/pages/mh_page/apply_repair_page.dart b/lib/pages/mh_page/apply_repair_page.dart index 4665eee..61ec15c 100644 --- a/lib/pages/mh_page/apply_repair_page.dart +++ b/lib/pages/mh_page/apply_repair_page.dart @@ -702,388 +702,7 @@ class ApplyRepairPage extends GetView { ), ), - // 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( diff --git a/lib/pages/mh_page/new_mine_page.dart b/lib/pages/mh_page/new_mine_page.dart index 63df525..586a772 100644 --- a/lib/pages/mh_page/new_mine_page.dart +++ b/lib/pages/mh_page/new_mine_page.dart @@ -277,9 +277,9 @@ class _MinePageState extends State { _buildListTile('assets/img/icon/mydevice.svg', "我的智能设备", "我绑定或关联的智能床,智能床垫等智能设备", showTopLine: true, path: "/deviceListPage"), - _buildListTile('assets/img/icon/order.svg', - '我的订单', '快捷查看我在网上的订单记录', - path: ""), + // _buildListTile('assets/img/icon/order.svg', + // '我的订单', '快捷查看我在网上的订单记录', + // path: ""), _buildListTile('assets/img/icon/store.svg', '门店体验', '如果想免费体验智能设备,可在此进行提前预约', path: "/experienceStorePage"), diff --git a/lib/pages/mh_page/repair_history_page.dart b/lib/pages/mh_page/repair_history_page.dart index 84babac..72e7a9e 100644 --- a/lib/pages/mh_page/repair_history_page.dart +++ b/lib/pages/mh_page/repair_history_page.dart @@ -23,52 +23,7 @@ class RepairHistoryListPage extends GetView { @override Widget build(BuildContext context) { - // controller.model.applyRepairModel = ApplyRepairModel() - // ..id = 1001 - // ..apply_name = '张三' - // ..tel = '13812345678' - // ..desc = '床垫传感器失灵,无法监测心率和呼吸' - // ..create_time = DateTime.parse('2025-05-01 10:00:00') - // ..device_type = 1 - // ..device_category = 'BY-H' - // ..device_id = 'BD202505011001' - // ..device_name = '智能床垫 BY-H 型号' - // ..issue_img = [ - // 'https://example.com/img1.jpg', - // 'https://example.com/img2.jpg' - // ] - // ..imagesLImit = 3 - // ..img_bucket = 'mianhuatang_repair' - // ..status = '待处理' - // ..select_device = '床垫/BY-H/智能床垫' - // ..device_list = ['床垫/BY-H/智能床垫', '床垫/BY-A/智能床垫', '床垫/BY-C/智能床垫'] - // ..score = null - // ..score_time = null - // ..messageType = 1 - // ..repairId = 1001; - - controller.model.repairProcessList = [ - RepairProcessModel() - ..status = '申请提交' - ..create_time = DateTime.parse('2025-05-01 10:05:00') - ..desc = '用户提交了维修申请' - ..record_id = 1001 - ..deal_user = null, - RepairProcessModel() - ..status = '客服受理' - ..create_time = DateTime.parse('2025-05-01 10:20:00') - ..desc = '客服已联系用户确认问题' - ..record_id = 1001 - ..deal_user = 2001, - RepairProcessModel() - ..status = '维修完成' - ..create_time = DateTime.parse('2025-05-02 15:30:00') - ..desc = '维修人员完成修复,等待用户确认' - ..record_id = 1001 - ..deal_user = 3001, - ]; - - final List events = controller.model.repairProcessList; + List list = data['flow']; return LayoutBuilder(builder: (context, cc) { bodysize = cc; return WillPopScope( @@ -156,7 +111,7 @@ class RepairHistoryListPage extends GetView { child: Text( // 'SWES01号智能一键入眠床', data['device'][0]['name'] ?? - '未命名', + '-', style: TextStyle( fontFamily: 'Readex Pro', fontSize: 30.rpx, @@ -171,9 +126,9 @@ class RepairHistoryListPage extends GetView { -1, 0), child: Text( '系列:' + - (data['device'][0][ - 'device_category'] ?? - '未命名'), + (data['device'][0] + ['category'] ?? + '-'), style: TextStyle( fontFamily: 'Readex Pro', color: @@ -188,13 +143,10 @@ class RepairHistoryListPage extends GetView { const AlignmentDirectional( -1, 0), child: Text( - '类型:' + - getDeviceTypeName( - controller - .model - .applyRepairModel - ?.device_type, - ), + '型号:' + + (data['device'][0] + ['series'] ?? + '-'), style: TextStyle( fontFamily: 'Readex Pro', color: @@ -210,11 +162,8 @@ class RepairHistoryListPage extends GetView { -1, 0), child: Text( '序列号:' + - (controller - .model - .applyRepairModel! - .device_id ?? - '未命名'), + (data['device'][0]['mac'] ?? + '-'), style: TextStyle( fontFamily: 'Readex Pro', color: @@ -229,13 +178,7 @@ class RepairHistoryListPage extends GetView { const AlignmentDirectional( -1, 0), child: Text( - '报修单号:' + - (controller - .model - .applyRepairModel! - .id - .toString() ?? - '未命名'), + '报修单号:' + (data['_id'] ?? '-'), style: TextStyle( fontFamily: 'Readex Pro', color: @@ -251,9 +194,10 @@ class RepairHistoryListPage extends GetView { -1, 0), child: Text( '提交时间:' + - (MyUtils.formatDateTimeDay( - data['device'][0] - ['create_time']!)), + (MyUtils + .timestampToDateString( + data[ + 'create_time']!)), style: TextStyle( fontFamily: 'Readex Pro', color: @@ -301,14 +245,14 @@ class RepairHistoryListPage extends GetView { child: Container( width: 100, height: 100, - child: Obx(() => ListView( + child: ListView( shrinkWrap: true, scrollDirection: Axis.horizontal, children: getImage( - controller - .model - .applyRepairModel!) + data['device'] + [0] + ['img']!) .divide( const SizedBox( width: 12, @@ -316,7 +260,7 @@ class RepairHistoryListPage extends GetView { .addToStart( const SizedBox( width: 0, - ))))), + )))), )), ] .divide(const SizedBox(height: 5)) @@ -350,9 +294,9 @@ class RepairHistoryListPage extends GetView { shrinkWrap: true, // 让ListView根据内容自适应高度 physics: const NeverScrollableScrollPhysics(), // 禁用内部滚动,交由外部滚动视图处理 - itemCount: events.length, + itemCount: list.length, itemBuilder: (context, index) { - bool isLast = index == events.length - 1; + bool isLast = index == list.length - 1; return TimelineTile( isFirst: index == 0, isLast: isLast, @@ -360,7 +304,7 @@ class RepairHistoryListPage extends GetView { alignment: TimelineAlign.start, // 线条左对齐 lineXY: 0.5, // 线条和圆圈相对位置 indicatorStyle: IndicatorStyle( - width: 15, // 圆圈的宽度 + width: 15.rpx, // 圆圈的宽度 padding: const EdgeInsets.all( 1), // 避免线条进入圆圈内部 indicatorXY: 0.2, // 圆圈居中 @@ -389,302 +333,300 @@ class RepairHistoryListPage extends GetView { endChild: Padding( padding: const EdgeInsets.all(8.0), child: RepairStatusWidget( - index: index, - repairInfoController: controller, - ), + data: data['flow'][index]), ), ); }, ), ), - 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, 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) - .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( - 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, - ), - ), - ), - ), - 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, - ), - ], - ), - ], - ), - ), - ), - ), - ] - .divide( - const SizedBox(height: 0)) - .addToStart(const SizedBox( - height: 5, - )) - .addToEnd(const SizedBox( - height: 15, - )), - ), - ), - ), - ), - ); - } - return Container(); - }), + // 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, 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) + // .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( + // 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, + // ), + // ), + // ), + // ), + // 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, + // ), + // ], + // ), + // ], + // ), + // ), + // ), + // ), + // ] + // .divide( + // const SizedBox(height: 0)) + // .addToStart(const SizedBox( + // height: 5, + // )) + // .addToEnd(const SizedBox( + // height: 15, + // )), + // ), + // ), + // ), + // ), + // ); + // } + // return Container(); + // }), ], ), ), @@ -705,10 +647,10 @@ class RepairHistoryListPage extends GetView { }); } - List getImage(ApplyRepairModel applyRepairModel) { + List getImage(List imgurl) { List images = []; ApplyRepairController controller = Get.find(); - applyRepairModel.issue_img!.forEach((element) async { + imgurl!.forEach((element) async { images.add( Container( // height: 10, @@ -716,27 +658,13 @@ class RepairHistoryListPage extends GetView { child: ImgPreviewWidget( imgUrl: element, - index: applyRepairModel.issue_img!.indexOf(element), + index: imgurl!.indexOf(element), applyRepairController: controller, isDel: false, ), ), ); }); - return images; } - - String getDeviceTypeName(int? type) { - switch (type) { - case 1: - return '体征检测设备'; - case 2: - return '智能床'; - case 3: - return '智能床垫'; - default: - return '未知设备'; - } - } } diff --git a/lib/pages/mh_page/repair_history_widget.dart b/lib/pages/mh_page/repair_history_widget.dart index 49ac4a5..053157e 100644 --- a/lib/pages/mh_page/repair_history_widget.dart +++ b/lib/pages/mh_page/repair_history_widget.dart @@ -30,13 +30,13 @@ class RepairHistoryWidget extends GetView { highlightColor: Color(0XFF055466), padding: EdgeInsets.only(top: 0), onTap: () { - TopSlideNotification.show( - context, - text: "功能开发中...", - ); + // TopSlideNotification.show( + // context, + // text: "功能开发中...", + // ); - // Get.toNamed("/repairHistoryListPage", - // arguments: repairListController.model.repairList[index]); + Get.toNamed("/repairHistoryListPage", + arguments: repairListController.model.repairList[index]); }, child: Container( // height: 119.rpx, @@ -63,8 +63,8 @@ class RepairHistoryWidget extends GetView { crossAxisAlignment: CrossAxisAlignment.start, children: [ Text( - repairListController.model.repairList[index]['device'][0]['name'] - ?? + repairListController.model.repairList[index]['device'] + [0]['name'] ?? '', style: TextStyle( color: Colors.white, fontSize: 30.rpx, height: 1), diff --git a/lib/pages/mh_page/repair_process_widget.dart b/lib/pages/mh_page/repair_process_widget.dart index c4ab871..086e701 100644 --- a/lib/pages/mh_page/repair_process_widget.dart +++ b/lib/pages/mh_page/repair_process_widget.dart @@ -1,116 +1,103 @@ import 'package:ef/ef.dart'; import 'package:flutter/material.dart'; -import 'package:vbvs_app/common/color/appColors.dart'; -import 'package:vbvs_app/common/color/repair_status.dart'; import 'package:vbvs_app/common/util/FitTool.dart'; import 'package:vbvs_app/common/util/MyUtils.dart'; -import 'package:vbvs_app/controller/mh_controller/repair_info_controller.dart'; - -import '../../common/color/appFontsize.dart'; class RepairStatusWidget extends GetView { - int index; - RepairInfoController repairInfoController; - - RepairStatusWidget( - {required this.index, required this.repairInfoController}) {} + Map data; + RepairStatusWidget({required this.data}) {} @override Widget build(BuildContext context) { - return Padding( - padding: EdgeInsetsDirectional.fromSTEB(0, 0, 0, 0), - child: Container( - width: MediaQuery.sizeOf(context).width, - decoration: BoxDecoration( - // color: Colors.white, + return Container( + width: MediaQuery.sizeOf(context).width, + child: Column( + mainAxisSize: MainAxisSize.max, + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Text( + // '2023-08-22 12:12:44', + MyUtils.timestampToDateString(data["create_time"]), + style: TextStyle( + fontFamily: 'Readex Pro', + fontSize: 21.rpx, + letterSpacing: 0, + color: Colors.white, + // index == + // repairInfoController + // .model.repairProcessList.length - + // 1 + // ? Colors.white + // : Colors.white, ), - child: Container( - width: MediaQuery.sizeOf(context).width, - decoration: BoxDecoration( - // color: Colors.white, - borderRadius: BorderRadius.circular(8), ), - child: Column( - mainAxisSize: MainAxisSize.max, - children: [ - Align( - alignment: AlignmentDirectional(-1, 0), - child: Padding( - padding: EdgeInsetsDirectional.fromSTEB(0, 0, 0, 10), - child: Text( - // '2023-08-22 12:12:44', - MyUtils.formatDateTime(repairInfoController - .model.repairProcessList[index].create_time!) ?? - '未知时间', - style: TextStyle( - fontFamily: 'Readex Pro', - fontSize: 26.rpx, - letterSpacing: 0, - color: index == - repairInfoController - .model.repairProcessList.length - - 1 - ? Colors.white - : Colors.white, - ), - ), - ), - ), - Align( - alignment: AlignmentDirectional(-1, 0), - child: Padding( - padding: EdgeInsetsDirectional.fromSTEB(0, 0, 0, 10), - child: Text( - // '审核中', - repairInfoController - .model.repairProcessList[index].status ?? - '未知状态', - style: TextStyle( - fontFamily: 'Readex Pro', - fontSize: 26.rpx, - letterSpacing: 0, - color: repairInfoController - .model.repairProcessList[index].status == - RepairStatus.pending - ? AppColors().check_Color - : repairInfoController.model.repairProcessList[index] - .status == - RepairStatus.approved || - repairInfoController.model - .repairProcessList[index].status == - '维修中' - ? AppColors().repair_Color - : repairInfoController.model - .repairProcessList[index].status == - RepairStatus.completed - ? AppColors().finish_Color - : AppColors().unOp_Color, // 根据状态设置文字颜色 - ), - ), - ), - ), - Align( - alignment: AlignmentDirectional(-1, 0), - child: Text( - // repairProcessModel.content ?? '未备注', - (repairInfoController - .model.repairProcessList[index].desc?.isEmpty ?? - true) - ? '未备注' - : repairInfoController - .model.repairProcessList[index].desc!, - style: TextStyle( - fontFamily: 'Readex Pro', - color: Colors.white, - fontSize: 20.rpx, - letterSpacing: 0, - ), - ), - ), - ], + Text( + // '审核中', + mapStatusText(data['status']), + style: TextStyle( + fontFamily: 'Readex Pro', + fontSize: 26.rpx, + letterSpacing: 0, + color: Colors.white, + // repairInfoController + // .model.repairProcessList[index].status == + // RepairStatus.pending + // ? AppColors().check_Color + // : repairInfoController.model.repairProcessList[index] + // .status == + // RepairStatus.approved || + // repairInfoController.model + // .repairProcessList[index].status == + // '维修中' + // ? AppColors().repair_Color + // : repairInfoController.model + // .repairProcessList[index].status == + // RepairStatus.completed + // ? AppColors().finish_Color + // : AppColors().unOp_Color, // 根据状态设置文字颜色 + ), ), - ), + + // Align( + // alignment: AlignmentDirectional(-1, 0), + // child: Text( + // // repairProcessModel.content ?? '未备注', + // (repairInfoController + // .model.repairProcessList[index].desc?.isEmpty ?? + // true) + // ? '未备注' + // : repairInfoController + // .model.repairProcessList[index].desc!, + // style: TextStyle( + // fontFamily: 'Readex Pro', + // color: Colors.white, + // fontSize: 20.rpx, + // letterSpacing: 0, + // ), + // ), + // ), + ], ), ); } + + /// 状态码映射为文字描述 + static String mapStatusText(int status) { + switch (status) { + case 1: + return '审核中'; + case 2: + return '亩核通过'; + case 3: + return '维修中'; + case 4: + return '维修完成'; + case 5: + return '已完成'; + case 6: + return '已评价'; + default: + return '未知状态'; + } + } } diff --git a/lib/pages/mh_page/room_picker.dart b/lib/pages/mh_page/room_picker.dart index fdb0234..376d13c 100644 --- a/lib/pages/mh_page/room_picker.dart +++ b/lib/pages/mh_page/room_picker.dart @@ -19,12 +19,16 @@ class RoomPickerPage extends StatefulWidget { class _RoomPickerPageState extends State { late Map editedData; RxList rooms = [].obs; + late FixedExtentScrollController scrollController; DeviceListController deviceListController = Get.find(); + int selectedIndex = 0; + Key key = Key(DateTime.now().toString()); @override void initState() { super.initState(); - editedData = Map.from(widget.data); // 创建副本 + editedData = Map.from(widget.data); getRoomList(); + scrollController = FixedExtentScrollController(initialItem: 0); } getRoomList() async { @@ -32,18 +36,34 @@ class _RoomPickerPageState extends State { String serviceName = ServiceConstant.server_service; String serviceApi = ServiceConstant.room_list; String queryUrl = "$serviceAddress$serviceName$serviceApi"; - requestWithLog( + + await requestWithLog( logTitle: '查询房间列表', method: MyHttpMethod.get, queryUrl: queryUrl, onSuccess: (res) { rooms.assignAll(res.data); - setState(() => selectedIndex = 0); + // 如果传入 roomName,匹配对应索引 + String? roomName = widget.data['roomName']; + if (roomName != null && roomName.isNotEmpty) { + int index = rooms.indexWhere((e) => e['name'] == roomName); + if (index != -1) { + selectedIndex = index; + } else { + selectedIndex = 0; // 找不到时默认选第一个 + } + } else { + selectedIndex = 0; + } + scrollController = + FixedExtentScrollController(initialItem: selectedIndex); + setState(() { + key = Key(DateTime.now().toString()); + }); // 更新 UI }, ); } - int selectedIndex = 0; BoxConstraints? bodysize; @override Widget build(BuildContext context) { @@ -172,6 +192,8 @@ class _RoomPickerPageState extends State { // 滚轮列表 Obx( () => ListWheelScrollView.useDelegate( + key: key, + controller: scrollController, itemExtent: 120.rpx, perspective: 0.003, physics: const FixedExtentScrollPhysics(), diff --git a/lib/pages/sleep_report/component/MonthDataWidget.dart b/lib/pages/sleep_report/component/MonthDataWidget.dart index 334c1ee..75a62c4 100644 --- a/lib/pages/sleep_report/component/MonthDataWidget.dart +++ b/lib/pages/sleep_report/component/MonthDataWidget.dart @@ -88,7 +88,7 @@ Widget MonthDataWidget( showLabel: sleepReport['scoreList']['type'], ), SleepCard( - sleepReport: sleepReport['cwl'], + sleepReport: sleepReport, highlightItem: data['itemName'], ), IndicatorCompareCard( diff --git a/lib/pages/sleep_report/component/SleepChartWidget.dart b/lib/pages/sleep_report/component/SleepChartWidget.dart index 2744a72..7ee1456 100644 --- a/lib/pages/sleep_report/component/SleepChartWidget.dart +++ b/lib/pages/sleep_report/component/SleepChartWidget.dart @@ -56,10 +56,16 @@ class SleepChartContainer extends StatelessWidget { tipText, style: TextStyle( fontSize: 26.rpx, - color: themeController.currentColor.sc3, + color: Colors.black, ), ), ), + backgroundColor: Color(0xFFFFFFFF), + colors: [ + Color(0XFF1592AA), + Color(0xFF0C83A7), + Color(0xFF006FA3) + ], ); }, child: Container( diff --git a/lib/pages/sleep_report/component/TrendDataTablePage.dart b/lib/pages/sleep_report/component/TrendDataTablePage.dart index 370db8d..a4df616 100644 --- a/lib/pages/sleep_report/component/TrendDataTablePage.dart +++ b/lib/pages/sleep_report/component/TrendDataTablePage.dart @@ -55,10 +55,16 @@ class _TrendDataTablePageState extends State { widget.tipText, style: TextStyle( fontSize: 26.rpx, - color: themeController.currentColor.sc3, + color: Colors.black, ), ), ), + backgroundColor: Color(0xFFFFFFFF), + colors: [ + Color(0XFF1592AA), + Color(0xFF0C83A7), + Color(0xFF006FA3) + ], ); }, child: Container( diff --git a/lib/pages/sleep_report/component/TrendDataTextPage.dart b/lib/pages/sleep_report/component/TrendDataTextPage.dart index a772ac3..379a996 100644 --- a/lib/pages/sleep_report/component/TrendDataTextPage.dart +++ b/lib/pages/sleep_report/component/TrendDataTextPage.dart @@ -67,9 +67,15 @@ class IndicatorCompareCard extends StatelessWidget { tooltip!.tr, style: TextStyle( fontSize: 26.rpx, - color: themeController.currentColor.sc3, + color: Colors.black, ), ), + backgroundColor: Color(0xFFFFFFFF), + colors: [ + Color(0XFF1592AA), + Color(0xFF0C83A7), + Color(0xFF006FA3) + ], ); }, child: Container(