diff --git a/assets/img/errorImg.jpeg b/assets/img/errorImg.jpeg deleted file mode 100644 index f99ae21..0000000 Binary files a/assets/img/errorImg.jpeg and /dev/null differ diff --git a/assets/img/errorImg.png b/assets/img/errorImg.png new file mode 100644 index 0000000..f3483c7 Binary files /dev/null and b/assets/img/errorImg.png differ diff --git a/assets/langs/zh_CN.json b/assets/langs/zh_CN.json index b2e369c..39402c3 100644 --- a/assets/langs/zh_CN.json +++ b/assets/langs/zh_CN.json @@ -95,7 +95,7 @@ "欢迎使用太和e护":"欢迎使用太和e护", "科技睡眠 洞悉万千":"科技睡眠 洞悉万千", "本机号码一键登录/注册":"本机号码一键登录/注册", - "其他手机号码":"其他手机号码", + "其他手机号码":"其他账号登录", "协议1":"登录时将自动注册,且代表您同意", "协议2":"《用户协议》", "协议3":"和", @@ -338,7 +338,7 @@ "图片未上传":"图片未上传", "设备未选择":"设备未选择", "参数未填写":"参数未填写", - "问题描述未填写":"请上传图片", + "问题描述未填写":"问题描述未填写", "编辑":"编辑", "滑动退出提醒":"再按一次退出程序", "操作说明":"操作说明", @@ -366,5 +366,6 @@ "删除错误提示":"请至少选择一项", "解绑":"解绑", "删除":"删除", - "校准未完成提示":"校准还未完成,是否确认退出校准流程?" + "校准未完成提示":"校准还未完成,是否确认退出校准流程?", + "确定":"确定" } \ No newline at end of file diff --git a/lib/common/color/ServiceConstant.dart b/lib/common/color/ServiceConstant.dart index 82aad70..b686db4 100644 --- a/lib/common/color/ServiceConstant.dart +++ b/lib/common/color/ServiceConstant.dart @@ -22,7 +22,7 @@ class ServiceConstant { static String share_deleted = "";//删除分享 static String start_calibration = "/api/caibration";//开始校准 static String calibration_process = "/api/caibration";//校准进度 - static String submit_repair = "";//提交报修 + static String submit_repair = "/api/device/repair";//提交报修 diff --git a/lib/controller/device/device_share_list_controller.g.dart b/lib/controller/device/device_share_list_controller.g.dart index 2a86f8e..f1734c4 100644 --- a/lib/controller/device/device_share_list_controller.g.dart +++ b/lib/controller/device/device_share_list_controller.g.dart @@ -10,11 +10,13 @@ DeviceShareListModel _$DeviceShareListModelFromJson( Map json) => DeviceShareListModel() ..key = json['key'] as String? - ..all = (json['all'] as num?)?.toInt(); + ..all = (json['all'] as num?)?.toInt() + ..accountKey = json['accountKey'] as String?; Map _$DeviceShareListModelToJson( DeviceShareListModel instance) => { 'key': instance.key, 'all': instance.all, + 'accountKey': instance.accountKey, }; diff --git a/lib/controller/repair/repair_controller.dart b/lib/controller/repair/repair_controller.dart index ffd3bed..3a3659b 100644 --- a/lib/controller/repair/repair_controller.dart +++ b/lib/controller/repair/repair_controller.dart @@ -16,8 +16,11 @@ part 'repair_controller.g.dart'; // 由json_serializable自动生成的部分 class RepairModel { String? id; //设备id String? param; //设备参数 - String? issue; //问题描述 + // String? issue; //问题描述 String? fileUrl; //文件地址 + String? mac; //状态 + String? desc;//问题描述 + List? img;//上传图片 RepairModel(); factory RepairModel.fromJson(Map json) { try { @@ -140,7 +143,7 @@ class RepairController extends GetControllerEx { // apiResponse.msg = "上传限制(视频最大50MB)".tr; // return apiResponse; // } - + // // 构建上传地址 // String queryUrl = // "${ServiceConstant.service_address}${ServiceConstant.server_service}${ServiceConstant.upload_file}"; @@ -175,5 +178,4 @@ class RepairController extends GetControllerEx { // return ApiResponse(code: -1, msg: "服务器.失败".tr); // } // } - } diff --git a/lib/controller/repair/repair_controller.g.dart b/lib/controller/repair/repair_controller.g.dart index 0c7f59d..918a388 100644 --- a/lib/controller/repair/repair_controller.g.dart +++ b/lib/controller/repair/repair_controller.g.dart @@ -9,13 +9,17 @@ part of 'repair_controller.dart'; RepairModel _$RepairModelFromJson(Map json) => RepairModel() ..id = json['id'] as String? ..param = json['param'] as String? - ..issue = json['issue'] as String? - ..fileUrl = json['fileUrl'] as String?; + ..fileUrl = json['fileUrl'] as String? + ..mac = json['mac'] as String? + ..desc = json['desc'] as String? + ..img = json['img'] as List?; Map _$RepairModelToJson(RepairModel instance) => { 'id': instance.id, 'param': instance.param, - 'issue': instance.issue, 'fileUrl': instance.fileUrl, + 'mac': instance.mac, + 'desc': instance.desc, + 'img': instance.img, }; diff --git a/lib/controller/weather/weather_controller.g.dart b/lib/controller/weather/weather_controller.g.dart index 7920345..f30dbc7 100644 --- a/lib/controller/weather/weather_controller.g.dart +++ b/lib/controller/weather/weather_controller.g.dart @@ -15,7 +15,9 @@ WeatherModel _$WeatherModelFromJson(Map json) => WeatherModel() ..max_temperature = (json['max_temperature'] as num?)?.toInt() ..wind_direction = json['wind_direction'] as String? ..wind_speed = (json['wind_speed'] as num?)?.toInt() - ..cityName = json['cityName'] as String?; + ..cityName = json['cityName'] as String? + ..weatherIcon = json['weatherIcon'] as String? + ..weatherIconurl = json['weatherIconurl'] as String?; Map _$WeatherModelToJson(WeatherModel instance) => { @@ -28,4 +30,6 @@ Map _$WeatherModelToJson(WeatherModel instance) => 'wind_direction': instance.wind_direction, 'wind_speed': instance.wind_speed, 'cityName': instance.cityName, + 'weatherIcon': instance.weatherIcon, + 'weatherIconurl': instance.weatherIconurl, }; diff --git a/lib/pages/device/component/DeviceDataComponentWidget.dart b/lib/pages/device/component/DeviceDataComponentWidget.dart index f077303..83661c4 100644 --- a/lib/pages/device/component/DeviceDataComponentWidget.dart +++ b/lib/pages/device/component/DeviceDataComponentWidget.dart @@ -404,7 +404,8 @@ class _DeviceDataComponentWidgetState extends State { void _showRenameDialog() { personController.currentPersonId.value = widget.device['_id']; personController.name.value = ""; - showConfirmDialog( + String text = "确定".tr; + showSingleConfirmDialog( context, Padding( padding: EdgeInsetsDirectional.fromSTEB(0.rpx, 41.rpx, 0.rpx, 0), @@ -476,6 +477,7 @@ class _DeviceDataComponentWidgetState extends State { onCancel: () { print('用户点击了取消'); }, + confirmText: text, ); } diff --git a/lib/pages/device/device_detail.dart b/lib/pages/device/device_detail.dart index 94f8ffc..c681766 100644 --- a/lib/pages/device/device_detail.dart +++ b/lib/pages/device/device_detail.dart @@ -96,193 +96,23 @@ class _DeviceDetailPageState extends State { ), child: Padding( padding: EdgeInsetsDirectional.fromSTEB( - 50.rpx, 0.rpx, 0.rpx, 0.rpx), - child: Row( + 0.rpx, 92.rpx, 0.rpx, 0.rpx), + child: Column( + mainAxisAlignment: MainAxisAlignment.center, mainAxisSize: MainAxisSize.min, children: [ - Column( - mainAxisSize: MainAxisSize.min, - crossAxisAlignment: CrossAxisAlignment.end, - children: [ - Container( - width: MediaQuery.sizeOf(context).width * 0.267, - height: MediaQuery.sizeOf(context).width * 0.267, - constraints: BoxConstraints( - minWidth: 200.rpx, - minHeight: 200.rpx, - ), - decoration: BoxDecoration(), - ), - Container( - height: 50.rpx, - decoration: BoxDecoration(), - ), - Container( - height: 50.rpx, - decoration: BoxDecoration(), - child: Align( - alignment: AlignmentDirectional(-1.rpx, 0.rpx), - child: Text( - '设备详情.设备名称'.tr, - style: FlutterFlowTheme.of(context) - .bodyMedium - .override( - fontFamily: 'Inter', - fontSize: 26.rpx, - letterSpacing: 0.rpx, - color: themeController.currentColor.sc4, - ), - ), - ), - ), - Container( - height: 50.rpx, - decoration: BoxDecoration(), - child: Align( - alignment: AlignmentDirectional(-1.rpx, 0.rpx), - child: Text( - '设备详情.MAC'.tr, - style: FlutterFlowTheme.of(context) - .bodyMedium - .override( - fontFamily: 'Inter', - fontSize: 26.rpx, - letterSpacing: 0.rpx, - color: themeController.currentColor.sc4, - ), - ), - ), - ), - Container( - height: 50.rpx, - decoration: BoxDecoration(), - child: Align( - alignment: AlignmentDirectional(-1.rpx, 0.rpx), - child: Text( - '设备详情.型号'.tr, - style: FlutterFlowTheme.of(context) - .bodyMedium - .override( - fontFamily: 'Inter', - fontSize: 26.rpx, - letterSpacing: 0.rpx, - color: themeController.currentColor.sc4, - ), - ), - ), - ), - Container( - height: 50.rpx, - decoration: BoxDecoration(), - child: Align( - alignment: AlignmentDirectional(-1.rpx, 0.rpx), - child: Text( - '设备详情.版本'.tr, - style: FlutterFlowTheme.of(context) - .bodyMedium - .override( - fontFamily: 'Inter', - fontSize: 26.rpx, - letterSpacing: 0.rpx, - color: themeController.currentColor.sc4, - ), - ), - ), - ), - Container( - height: 50.rpx, - decoration: BoxDecoration(), - child: Align( - alignment: AlignmentDirectional(-1.rpx, 0.rpx), - child: Text( - '设备详情.网络状态'.tr, - style: FlutterFlowTheme.of(context) - .bodyMedium - .override( - fontFamily: 'Inter', - fontSize: 26.rpx, - letterSpacing: 0.rpx, - color: themeController.currentColor.sc4, - ), - ), - ), - ), - Container( - height: 50.rpx, - decoration: BoxDecoration(), - child: Align( - alignment: AlignmentDirectional(-1.rpx, 0.rpx), - child: Text( - '设备详情.故障状态'.tr, - style: FlutterFlowTheme.of(context) - .bodyMedium - .override( - fontFamily: 'Inter', - fontSize: 26.rpx, - letterSpacing: 0.rpx, - color: themeController.currentColor.sc4, - ), - ), - ), - ), - Container( - height: 50.rpx, - decoration: BoxDecoration(), - child: Align( - alignment: AlignmentDirectional(-1.rpx, 0.rpx), - child: Text( - '设备详情.更新状态'.tr, - style: FlutterFlowTheme.of(context) - .bodyMedium - .override( - fontFamily: 'Inter', - fontSize: 26.rpx, - letterSpacing: 0.rpx, - color: themeController.currentColor.sc4, - ), - ), - ), - ), - Container( - height: 50.rpx, - decoration: BoxDecoration(), - child: Align( - alignment: AlignmentDirectional(-1.rpx, 0.rpx), - child: Text( - '设备详情.更新时间'.tr, - style: FlutterFlowTheme.of(context) - .bodyMedium - .override( - fontFamily: 'Inter', - fontSize: 26.rpx, - letterSpacing: 0.rpx, - color: themeController.currentColor.sc4, - ), - ), - ), - ), - ] - .divide(SizedBox(height: 34.rpx)) - .addToStart(SizedBox(height: 92.rpx)) - .addToEnd(SizedBox(height: 97.rpx)), - ), - Column( - mainAxisSize: MainAxisSize.min, - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - Container( - width: MediaQuery.sizeOf(context).width * 0.267, - height: MediaQuery.sizeOf(context).width * 0.267, - constraints: BoxConstraints( - minWidth: 200.rpx, - minHeight: 200.rpx, - ), - decoration: BoxDecoration( - color: Colors.transparent, - ), - child: (widget.device['code'] - ?.toString() - .isNotEmpty ?? + Container( + width: MediaQuery.sizeOf(context).width * 0.267, + height: MediaQuery.sizeOf(context).width * 0.267, + constraints: BoxConstraints( + minWidth: 200.rpx, + minHeight: 200.rpx, + ), + decoration: BoxDecoration( + color: Colors.transparent, + ), + child: + (widget.device['code']?.toString().isNotEmpty ?? false) ? QrImageView( data: widget.device['code'].toString(), @@ -290,182 +120,439 @@ class _DeviceDetailPageState extends State { size: 200.0.rpx, ) : Image.asset( - "assets/img/errorImg.jpeg", + "assets/img/errorImg.png", fit: BoxFit.cover, ), - ), - Container( - height: 50.rpx, - decoration: BoxDecoration(), - child: Align( - alignment: AlignmentDirectional(-1.rpx, 0.rpx), - child: Text( - (widget.device['code'] ?? '') - .toString() - .isNotEmpty - ? widget.device['code'].toString() - : '未知数据'.tr, - style: FlutterFlowTheme.of(context) - .bodyMedium - .override( - fontFamily: 'Inter', - fontSize: 26.rpx, - letterSpacing: 0.rpx, - color: themeController.currentColor.sc3, - ), - ), - ), - ), - Container( - height: 50.rpx, - decoration: BoxDecoration(), - child: Align( - alignment: AlignmentDirectional(-1.rpx, 0.rpx), - child: Text( - '${widget.device['person']?['name'] ?? '未命名'.tr}', - style: FlutterFlowTheme.of(context) - .bodyMedium - .override( - fontFamily: 'Inter', - fontSize: 26.rpx, - letterSpacing: 0.rpx, - color: themeController.currentColor.sc3, - ), - ), - ), - ), - Container( - height: 50.rpx, - decoration: BoxDecoration(), - child: Align( - alignment: AlignmentDirectional(-1.rpx, 0.rpx), - child: Text( - '${widget.device['mac'] ?? '-'.tr}', - style: FlutterFlowTheme.of(context) - .bodyMedium - .override( - fontFamily: 'Inter', - fontSize: 26.rpx, - letterSpacing: 0.rpx, - color: themeController.currentColor.sc3, - ), - ), - ), - ), - Container( - height: 50.rpx, - decoration: BoxDecoration(), - child: Align( - alignment: AlignmentDirectional(-1.rpx, 0.rpx), - child: Text( - '-', - style: FlutterFlowTheme.of(context) - .bodyMedium - .override( - fontFamily: 'Inter', - fontSize: 26.rpx, - letterSpacing: 0.rpx, - color: themeController.currentColor.sc3, - ), - ), - ), - ), - Container( - height: 50.rpx, - decoration: BoxDecoration(), - child: Align( - alignment: AlignmentDirectional(-1.rpx, 0.rpx), - child: Text( - '-', - style: FlutterFlowTheme.of(context) - .bodyMedium - .override( - fontFamily: 'Inter', - fontSize: 26.rpx, - letterSpacing: 0.rpx, - color: themeController.currentColor.sc3, - ), - ), - ), - ), - Container( - height: 50.rpx, - decoration: BoxDecoration(), - child: Align( - alignment: AlignmentDirectional(-1.rpx, 0.rpx), - child: Text( - '${widget.device['status']['status'] == 1 ? '在线'.tr : '离线'.tr}', - style: FlutterFlowTheme.of(context) - .bodyMedium - .override( - fontFamily: 'Inter', - fontSize: 26.rpx, - letterSpacing: 0.rpx, - color: themeController.currentColor.sc3, - ), - ), - ), - ), - Container( - height: 50.rpx, - decoration: BoxDecoration(), - child: Align( - alignment: AlignmentDirectional(-1.rpx, 0.rpx), - child: Text( - '${widget.device['status']['failure'] == 1 ? '有故障'.tr : '无故障'.tr}', - style: FlutterFlowTheme.of(context) - .bodyMedium - .override( - fontFamily: 'Inter', - fontSize: 26.rpx, - letterSpacing: 0.rpx, - color: themeController.currentColor.sc3, - ), - ), - ), - ), - Container( - height: 50.rpx, - decoration: BoxDecoration(), - child: Align( - alignment: AlignmentDirectional(-1.rpx, 0.rpx), - child: Text( - '${widget.device['status']['upgrade'] == 1 ? '有更新'.tr : '无更新'.tr}', - style: FlutterFlowTheme.of(context) - .bodyMedium - .override( - fontFamily: 'Inter', - fontSize: 26.rpx, - letterSpacing: 0.rpx, - color: themeController.currentColor.sc3, - ), - ), - ), - ), - Container( - height: 50.rpx, - decoration: BoxDecoration(), - child: Align( - alignment: AlignmentDirectional(-1.rpx, 0.rpx), - child: Text( - '${widget.device['status']?['updateTime'] == null ? '-'.tr : MyUtils.timestampToDateString(widget.device['status']?['updateTime'])}', - style: FlutterFlowTheme.of(context) - .bodyMedium - .override( - fontFamily: 'Inter', - fontSize: 26.rpx, - letterSpacing: 0.rpx, - color: themeController.currentColor.sc3, - ), - ), - ), - ), - ] - .divide(SizedBox(height: 34.rpx)) - .addToStart(SizedBox(height: 92.rpx)) - .addToEnd(SizedBox(height: 97.rpx)), ), - ].divide(SizedBox(width: 34.rpx)), + Container( + height: 50.rpx, + decoration: BoxDecoration(), + child: Text( + (widget.device['code'] ?? '').toString().isNotEmpty + ? widget.device['code'].toString() + : '未知数据'.tr, + style: FlutterFlowTheme.of(context) + .bodyMedium + .override( + fontFamily: 'Inter', + fontSize: 26.rpx, + letterSpacing: 0.rpx, + color: themeController.currentColor.sc3, + ), + ), + ), + Row( + mainAxisSize: MainAxisSize.min, + children: [ + Column( + mainAxisSize: MainAxisSize.min, + crossAxisAlignment: CrossAxisAlignment.end, + children: [ + // Container( + // width: + // MediaQuery.sizeOf(context).width * 0.267, + // height: + // MediaQuery.sizeOf(context).width * 0.267, + // constraints: BoxConstraints( + // minWidth: 200.rpx, + // minHeight: 200.rpx, + // ), + // decoration: BoxDecoration(), + // ), + // Container( + // height: 50.rpx, + // decoration: BoxDecoration(), + // ), + + Container( + height: 50.rpx, + decoration: BoxDecoration(), + child: Align( + alignment: + AlignmentDirectional(-1.rpx, 0.rpx), + child: Text( + '设备详情.设备名称'.tr, + style: FlutterFlowTheme.of(context) + .bodyMedium + .override( + fontFamily: 'Inter', + fontSize: 26.rpx, + letterSpacing: 0.rpx, + color: themeController + .currentColor.sc4, + ), + ), + ), + ), + Container( + height: 50.rpx, + decoration: BoxDecoration(), + child: Align( + alignment: + AlignmentDirectional(-1.rpx, 0.rpx), + child: Text( + '设备详情.MAC'.tr, + style: FlutterFlowTheme.of(context) + .bodyMedium + .override( + fontFamily: 'Inter', + fontSize: 26.rpx, + letterSpacing: 0.rpx, + color: themeController + .currentColor.sc4, + ), + ), + ), + ), + Container( + height: 50.rpx, + decoration: BoxDecoration(), + child: Align( + alignment: + AlignmentDirectional(-1.rpx, 0.rpx), + child: Text( + '设备详情.型号'.tr, + style: FlutterFlowTheme.of(context) + .bodyMedium + .override( + fontFamily: 'Inter', + fontSize: 26.rpx, + letterSpacing: 0.rpx, + color: themeController + .currentColor.sc4, + ), + ), + ), + ), + Container( + height: 50.rpx, + decoration: BoxDecoration(), + child: Align( + alignment: + AlignmentDirectional(-1.rpx, 0.rpx), + child: Text( + '设备详情.版本'.tr, + style: FlutterFlowTheme.of(context) + .bodyMedium + .override( + fontFamily: 'Inter', + fontSize: 26.rpx, + letterSpacing: 0.rpx, + color: themeController + .currentColor.sc4, + ), + ), + ), + ), + Container( + height: 50.rpx, + decoration: BoxDecoration(), + child: Align( + alignment: + AlignmentDirectional(-1.rpx, 0.rpx), + child: Text( + '设备详情.网络状态'.tr, + style: FlutterFlowTheme.of(context) + .bodyMedium + .override( + fontFamily: 'Inter', + fontSize: 26.rpx, + letterSpacing: 0.rpx, + color: themeController + .currentColor.sc4, + ), + ), + ), + ), + Container( + height: 50.rpx, + decoration: BoxDecoration(), + child: Align( + alignment: + AlignmentDirectional(-1.rpx, 0.rpx), + child: Text( + '设备详情.故障状态'.tr, + style: FlutterFlowTheme.of(context) + .bodyMedium + .override( + fontFamily: 'Inter', + fontSize: 26.rpx, + letterSpacing: 0.rpx, + color: themeController + .currentColor.sc4, + ), + ), + ), + ), + Container( + height: 50.rpx, + decoration: BoxDecoration(), + child: Align( + alignment: + AlignmentDirectional(-1.rpx, 0.rpx), + child: Text( + '设备详情.更新状态'.tr, + style: FlutterFlowTheme.of(context) + .bodyMedium + .override( + fontFamily: 'Inter', + fontSize: 26.rpx, + letterSpacing: 0.rpx, + color: themeController + .currentColor.sc4, + ), + ), + ), + ), + Container( + height: 50.rpx, + decoration: BoxDecoration(), + child: Align( + alignment: + AlignmentDirectional(-1.rpx, 0.rpx), + child: Text( + '设备详情.更新时间'.tr, + style: FlutterFlowTheme.of(context) + .bodyMedium + .override( + fontFamily: 'Inter', + fontSize: 26.rpx, + letterSpacing: 0.rpx, + color: themeController + .currentColor.sc4, + ), + ), + ), + ), + ] + .divide(SizedBox(height: 34.rpx)) + .addToStart(SizedBox(height: 92.rpx)) + .addToEnd(SizedBox(height: 97.rpx)), + ), + Column( + mainAxisSize: MainAxisSize.min, + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + // Container( + // width: + // MediaQuery.sizeOf(context).width * 0.267, + // height: + // MediaQuery.sizeOf(context).width * 0.267, + // constraints: BoxConstraints( + // minWidth: 200.rpx, + // minHeight: 200.rpx, + // ), + // decoration: BoxDecoration( + // color: Colors.transparent, + // ), + // child: (widget.device['code'] + // ?.toString() + // .isNotEmpty ?? + // false) + // ? QrImageView( + // data: + // widget.device['code'].toString(), + // version: QrVersions.auto, + // size: 200.0.rpx, + // ) + // : Image.asset( + // "assets/img/errorImg.jpeg", + // fit: BoxFit.cover, + // ), + // ), + // Container( + // height: 50.rpx, + // decoration: BoxDecoration(), + // child: Align( + // alignment: + // AlignmentDirectional(-1.rpx, 0.rpx), + // child: Text( + // (widget.device['code'] ?? '') + // .toString() + // .isNotEmpty + // ? widget.device['code'].toString() + // : '未知数据'.tr, + // style: FlutterFlowTheme.of(context) + // .bodyMedium + // .override( + // fontFamily: 'Inter', + // fontSize: 26.rpx, + // letterSpacing: 0.rpx, + // color: themeController + // .currentColor.sc3, + // ), + // ), + // ), + // ), + + Container( + height: 50.rpx, + decoration: BoxDecoration(), + child: Align( + alignment: + AlignmentDirectional(-1.rpx, 0.rpx), + child: Text( + '${widget.device['person']?['name'] ?? '未命名'.tr}', + style: FlutterFlowTheme.of(context) + .bodyMedium + .override( + fontFamily: 'Inter', + fontSize: 26.rpx, + letterSpacing: 0.rpx, + color: themeController + .currentColor.sc3, + ), + ), + ), + ), + Container( + height: 50.rpx, + decoration: BoxDecoration(), + child: Align( + alignment: + AlignmentDirectional(-1.rpx, 0.rpx), + child: Text( + '${widget.device['mac'] ?? '-'.tr}', + style: FlutterFlowTheme.of(context) + .bodyMedium + .override( + fontFamily: 'Inter', + fontSize: 26.rpx, + letterSpacing: 0.rpx, + color: themeController + .currentColor.sc3, + ), + ), + ), + ), + Container( + height: 50.rpx, + decoration: BoxDecoration(), + child: Align( + alignment: + AlignmentDirectional(-1.rpx, 0.rpx), + child: Text( + '-', + style: FlutterFlowTheme.of(context) + .bodyMedium + .override( + fontFamily: 'Inter', + fontSize: 26.rpx, + letterSpacing: 0.rpx, + color: themeController + .currentColor.sc3, + ), + ), + ), + ), + Container( + height: 50.rpx, + decoration: BoxDecoration(), + child: Align( + alignment: + AlignmentDirectional(-1.rpx, 0.rpx), + child: Text( + '-', + style: FlutterFlowTheme.of(context) + .bodyMedium + .override( + fontFamily: 'Inter', + fontSize: 26.rpx, + letterSpacing: 0.rpx, + color: themeController + .currentColor.sc3, + ), + ), + ), + ), + Container( + height: 50.rpx, + decoration: BoxDecoration(), + child: Align( + alignment: + AlignmentDirectional(-1.rpx, 0.rpx), + child: Text( + '${widget.device['status']['status'] == 1 ? '在线'.tr : '离线'.tr}', + style: FlutterFlowTheme.of(context) + .bodyMedium + .override( + fontFamily: 'Inter', + fontSize: 26.rpx, + letterSpacing: 0.rpx, + color: themeController + .currentColor.sc3, + ), + ), + ), + ), + Container( + height: 50.rpx, + decoration: BoxDecoration(), + child: Align( + alignment: + AlignmentDirectional(-1.rpx, 0.rpx), + child: Text( + '${widget.device['status']['failure'] == 1 ? '有故障'.tr : '无故障'.tr}', + style: FlutterFlowTheme.of(context) + .bodyMedium + .override( + fontFamily: 'Inter', + fontSize: 26.rpx, + letterSpacing: 0.rpx, + color: themeController + .currentColor.sc3, + ), + ), + ), + ), + Container( + height: 50.rpx, + decoration: BoxDecoration(), + child: Align( + alignment: + AlignmentDirectional(-1.rpx, 0.rpx), + child: Text( + '${widget.device['status']['upgrade'] == 1 ? '有更新'.tr : '无更新'.tr}', + style: FlutterFlowTheme.of(context) + .bodyMedium + .override( + fontFamily: 'Inter', + fontSize: 26.rpx, + letterSpacing: 0.rpx, + color: themeController + .currentColor.sc3, + ), + ), + ), + ), + Container( + height: 50.rpx, + decoration: BoxDecoration(), + child: Align( + alignment: + AlignmentDirectional(-1.rpx, 0.rpx), + child: Text( + '${widget.device['status']?['updateTime'] == null ? '-'.tr : MyUtils.timestampToDateString(widget.device['status']?['updateTime'])}', + style: FlutterFlowTheme.of(context) + .bodyMedium + .override( + fontFamily: 'Inter', + fontSize: 26.rpx, + letterSpacing: 0.rpx, + color: themeController + .currentColor.sc3, + ), + ), + ), + ), + ] + .divide(SizedBox(height: 34.rpx)) + .addToStart(SizedBox(height: 92.rpx)) + .addToEnd(SizedBox(height: 97.rpx)), + ), + ].divide(SizedBox(width: 34.rpx)), + ), + ], ), ), ), diff --git a/lib/pages/device_bind/componnet/bind_dialog.dart b/lib/pages/device_bind/componnet/bind_dialog.dart index 798d0f0..19bfe71 100644 --- a/lib/pages/device_bind/componnet/bind_dialog.dart +++ b/lib/pages/device_bind/componnet/bind_dialog.dart @@ -579,6 +579,148 @@ void showConfirmDialog( ); } + +void showSingleConfirmDialog( + BuildContext context, + Widget widget, + String title, { + required VoidCallback onConfirm, + required VoidCallback onCancel, + String confirmText = "确定", +}) { + ThemeController themeController = Get.find(); + BlueteethBindController blueteethBindController = Get.find(); + + showDialog( + context: context, + barrierDismissible: true, + barrierColor: Colors.black.withOpacity(0.5), // 背景模糊色 + builder: (BuildContext context) { + return FrostedDialog( + blurSigma: 3.0, + child: Container( + decoration: BoxDecoration( + color: themeController.currentColor.sc17, + borderRadius: BorderRadius.circular(20.0), + ), + padding: EdgeInsetsDirectional.fromSTEB(31.rpx, 0, 31.rpx, 0), + child: Container( + width: double.infinity, + constraints: BoxConstraints( + maxHeight: MediaQuery.sizeOf(context).height * 0.656, + ), + child: Column( + mainAxisSize: MainAxisSize.min, + children: [ + // 标题 + Row( + mainAxisAlignment: MainAxisAlignment.end, + children: [ + ClickableContainer( + backgroundColor: Colors.transparent, // 容器背景色 + highlightColor: + themeController.currentColor.sc21, // 点击时的背景色 + padding: EdgeInsets.zero, // 这里去掉外部的 padding,避免影响点击范围 + onTap: () { + Get.back(); + onCancel(); + }, + child: Padding( + // padding: + // EdgeInsetsDirectional.fromSTEB(0, 33.rpx, 0, 0.rpx), + padding: EdgeInsetsDirectional.fromSTEB( + 33.rpx, 33.rpx, 33.rpx, 33.rpx), + child: SvgPicture.asset( + 'assets/img/icon/close.svg', + width: 25.rpx, + height: 25.rpx, // 如果 SVG 中没有固定颜色,使用 color 设置 + color: themeController.currentColor.sc3, + ), + ), + ), + ], + ), + Align( + alignment: AlignmentDirectional(0, 0), + child: Padding( + padding: EdgeInsetsDirectional.fromSTEB( + 33.rpx, 60.rpx, 33.rpx, 33.rpx), + child: Text( + title, + style: FlutterFlowTheme.of(context).bodyMedium.override( + fontFamily: 'Inter', + fontSize: 30.rpx, + letterSpacing: 0.0, + color: themeController.currentColor.sc3, + ), + ), + ), + ), + Padding( + padding: EdgeInsetsDirectional.fromSTEB( + 33.rpx, 0.rpx, 33.rpx, 0.rpx), + child: widget, + ), + Padding( + padding: EdgeInsetsDirectional.fromSTEB( + 33.rpx, 58.rpx, 33.rpx, 60.rpx), + child: Row( + mainAxisAlignment: MainAxisAlignment.center, + children: [ + + CustomCard( + borderRadius: AppConstants().button_container_radius, + onTap: () { + Get.back(); + onConfirm(); + // await Future.delayed(Duration(milliseconds: 300)); + }, + colors: [ + themeController.currentColor.sc1, + themeController.currentColor.sc2, + ], + child: Container( + width: MediaQuery.sizeOf(context).width * 0.43, + height: MediaQuery.sizeOf(context).height * 0.055, + constraints: BoxConstraints( + minWidth: 160.rpx, + minHeight: 90.rpx, + ), + child: Row( + mainAxisSize: MainAxisSize.max, + mainAxisAlignment: MainAxisAlignment.center, + children: [ + Text( + confirmText, + style: FlutterFlowTheme.of(context) + .bodyMedium + .override( + color: themeController.currentColor.sc3, + fontFamily: 'Inter', + fontSize: + AppConstants().normal_text_fontSize, + letterSpacing: 0.0, + ), + ), + ].divide(SizedBox(width: 17.rpx)), + ), + ), + ), + + ].divide(SizedBox( + width: 70.rpx, + )), + ), + ), + ], + ), + ), + ), + ); + }, + ); +} + void showWifiDialog( BuildContext context, Widget widget, diff --git a/lib/pages/person/person_page.dart b/lib/pages/person/person_page.dart index c8bb7fd..c7c7d3a 100644 --- a/lib/pages/person/person_page.dart +++ b/lib/pages/person/person_page.dart @@ -108,7 +108,7 @@ class _EPageState extends State { TopSlideNotification.show(context, text: apiRespons.msg!); Get.offAllNamed("/bindDeviceSuccess"); - // Get.toNamed("/wifiPage"); + // Get.toNamed("/wifiPage"); } else { TopSlideNotification.show(context, text: apiRespons.msg!, @@ -200,7 +200,8 @@ class _EPageState extends State { fontFamily: 'Inter', fontSize: 26.rpx, letterSpacing: 0.0, - color: themeController.currentColor.sc4, + color: themeController + .currentColor.sc4, ), enabledBorder: OutlineInputBorder( borderSide: BorderSide( @@ -286,26 +287,11 @@ class _EPageState extends State { Container( width: 90.rpx, height: 90.rpx, - decoration: BoxDecoration(), - child: Container( - clipBehavior: - Clip.antiAlias, - decoration: BoxDecoration( - shape: BoxShape.circle, - ), - child: ColorFiltered( - colorFilter: isMaleGreyed - ? ColorFilter.mode( - Colors.grey - .withOpacity( - 0.6), - BlendMode - .saturation) - : ColorFilter.mode( - Colors - .transparent, - BlendMode - .saturation), + child: ClipOval( + child: Opacity( + opacity: isMaleGreyed + ? 0.4 + : 1.0, // 控制透明度 child: Image.asset( "assets/img/man.png", fit: BoxFit.cover, @@ -355,28 +341,13 @@ class _EPageState extends State { Container( width: 90.rpx, height: 90.rpx, - decoration: BoxDecoration(), - child: Container( - clipBehavior: - Clip.antiAlias, - decoration: BoxDecoration( - shape: BoxShape.circle, - ), - child: ColorFiltered( - colorFilter: isFemaleGreyed - ? ColorFilter.mode( - Colors.grey - .withOpacity( - 0.6), - BlendMode - .saturation) - : ColorFilter.mode( - Colors - .transparent, - BlendMode - .saturation), + child: ClipOval( + child: Opacity( + opacity: isFemaleGreyed + ? 0.4 + : 1.0, // 控制透明度 child: Image.asset( - "assets/img/woman.png", + "assets/img/man.png", fit: BoxFit.cover, ), ), @@ -431,18 +402,16 @@ class _EPageState extends State { .requestFocus(FocusNode()); Future.delayed(Duration(milliseconds: 250), () { - showDateSelectionDialog( - context, - checkDate: personController.dateTime ?? - DateTime.now(), - checkChange: (DateTime d) { - personController.birthday.value = - MyUtils.formatBindTime(d); - personController.dateTime = d; - personController.updateAll(); - }, - title: "生日".tr - ); + showDateSelectionDialog(context, + checkDate: + personController.dateTime ?? + DateTime.now(), + checkChange: (DateTime d) { + personController.birthday.value = + MyUtils.formatBindTime(d); + personController.dateTime = d; + personController.updateAll(); + }, title: "生日".tr); }); }, child: Center( diff --git a/lib/pages/person/update_person_page.dart b/lib/pages/person/update_person_page.dart index 8e31e20..4015bd1 100644 --- a/lib/pages/person/update_person_page.dart +++ b/lib/pages/person/update_person_page.dart @@ -288,26 +288,11 @@ class _UpdatePageState extends State { Container( width: 90.rpx, height: 90.rpx, - decoration: BoxDecoration(), - child: Container( - clipBehavior: - Clip.antiAlias, - decoration: BoxDecoration( - shape: BoxShape.circle, - ), - child: ColorFiltered( - colorFilter: isMaleGreyed - ? ColorFilter.mode( - Colors.grey - .withOpacity( - 0.6), - BlendMode - .saturation) - : ColorFilter.mode( - Colors - .transparent, - BlendMode - .saturation), + child: ClipOval( + child: Opacity( + opacity: isMaleGreyed + ? 0.4 + : 1.0, // 控制透明度 child: Image.asset( "assets/img/man.png", fit: BoxFit.cover, @@ -357,28 +342,13 @@ class _UpdatePageState extends State { Container( width: 90.rpx, height: 90.rpx, - decoration: BoxDecoration(), - child: Container( - clipBehavior: - Clip.antiAlias, - decoration: BoxDecoration( - shape: BoxShape.circle, - ), - child: ColorFiltered( - colorFilter: isFemaleGreyed - ? ColorFilter.mode( - Colors.grey - .withOpacity( - 0.6), - BlendMode - .saturation) - : ColorFilter.mode( - Colors - .transparent, - BlendMode - .saturation), + child: ClipOval( + child: Opacity( + opacity: isFemaleGreyed + ? 0.4 + : 1.0, // 控制透明度 child: Image.asset( - "assets/img/woman.png", + "assets/img/man.png", fit: BoxFit.cover, ), ), diff --git a/lib/pages/repair/apply_repair_page.dart b/lib/pages/repair/apply_repair_page.dart index ffaddcd..2a8ac14 100644 --- a/lib/pages/repair/apply_repair_page.dart +++ b/lib/pages/repair/apply_repair_page.dart @@ -328,8 +328,12 @@ class _ApplyRepairPageState extends State { String queryUrl = "$serviceAddress$serviceName$serviceApi"; var data = { - "repairList": repairController.repairList, + "device": repairController.repairList, "type": repairController.device_type.value, + "contacts": { + "name": repairController.name.value, + "phone": repairController.phone.value + }, }; ApiResponse apiResponse = await requestWithLog( logTitle: "提交报修信息", @@ -478,7 +482,6 @@ class _ApplyRepairPageState extends State { cursorColor: themeController.currentColor.sc3, onChanged: onChanged, ), - ), ), ].divide(SizedBox(width: 24.rpx)), diff --git a/lib/pages/repair/component/RepairHistoryInfoWidget.dart b/lib/pages/repair/component/RepairHistoryInfoWidget.dart index 7a9e94c..7df5732 100644 --- a/lib/pages/repair/component/RepairHistoryInfoWidget.dart +++ b/lib/pages/repair/component/RepairHistoryInfoWidget.dart @@ -4,6 +4,7 @@ import 'package:flutter/material.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/routers/routers.dart'; @@ -28,14 +29,17 @@ class _RepairHistoryInfoWidgetState extends State { @override Widget build(BuildContext context) { - return CustomCard( + return ClickableContainer( borderRadius: AppConstants().normal_container_radius, onTap: () { //跳转详情 }, - colors: [ - themeController.currentColor.sc5, - ], + // colors: [ + // themeController.currentColor.sc5, + // ], + backgroundColor: Colors.transparent, + highlightColor: themeController.currentColor.sc21, + padding: EdgeInsetsDirectional.fromSTEB(0.rpx, 0.rpx, 0.rpx, 0.rpx), child: Container( width: double.infinity, decoration: BoxDecoration( diff --git a/lib/pages/repair/component/RepairModelWidget.dart b/lib/pages/repair/component/RepairModelWidget.dart index c9c3690..ba9e562 100644 --- a/lib/pages/repair/component/RepairModelWidget.dart +++ b/lib/pages/repair/component/RepairModelWidget.dart @@ -326,13 +326,16 @@ class _RepairModelWidgetState extends State { .refresh(); // 通知 Obx 更新(如果用了 GetX) print(widget.model); } else { - TopSlideNotification.show( - context, - text: apiResponse.msg!, - textColor: apiResponse.code == HttpStatusCodes.ok - ? themeController.currentColor.sc2 - : themeController.currentColor.sc9, - ); + 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: SizedBox( diff --git a/lib/pages/repair/repair_list_page.dart b/lib/pages/repair/repair_list_page.dart index f6b73fd..2c7503b 100644 --- a/lib/pages/repair/repair_list_page.dart +++ b/lib/pages/repair/repair_list_page.dart @@ -1,13 +1,8 @@ import 'package:ef/ef.dart'; import 'package:flutter/material.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/common/util/MyUtils.dart'; -import 'package:vbvs_app/controller/device/body_device_controller.dart'; -import 'package:vbvs_app/controller/device/device_type_controller.dart'; -import 'package:vbvs_app/controller/repair/repair_controller.dart'; -import 'package:vbvs_app/controller/theme_controller/ThemeController.dart'; import 'package:vbvs_app/pages/repair/component/RepairHistoryInfoWidget.dart'; class RepairListPage extends StatefulWidget {