From 41adcedad7f83e8691a01290626968d17daa86e8 Mon Sep 17 00:00:00 2001 From: czz <862977248@qq.com> Date: Sat, 21 Jun 2025 08:55:52 +0800 Subject: [PATCH] =?UTF-8?q?=E5=9C=B0=E5=9D=80=E6=8E=A5=E5=8F=A3=E7=9A=84?= =?UTF-8?q?=E8=A7=86=E7=BA=BF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../main/res/mipmap-hdpi/ic_launchermh.png | Bin 0 -> 3574 bytes .../main/res/mipmap-mdpi/ic_launchermh.png | Bin 0 -> 2644 bytes .../main/res/mipmap-xhdpi/ic_launchermh.png | Bin 0 -> 4924 bytes .../main/res/mipmap-xxhdpi/ic_launchermh.png | Bin 0 -> 7751 bytes .../main/res/mipmap-xxxhdpi/ic_launchermh.png | Bin 0 -> 10835 bytes lib/common/color/ServiceConstant.dart | 64 +- .../mh_controller/address_controller.dart | 244 ++-- .../mh_controller/address_controller.g.dart | 12 +- .../address_list_controller.dart | 79 +- .../apply_repair_controller.dart | 19 +- .../mh_controller/device_list_controller.dart | 2 +- .../device_list_controller.g.dart | 5 +- lib/controller/repair/repair_controller.dart | 4 +- lib/controller/user_info_controller.g.dart | 2 - .../common/bezier_bottom_navigation_bar.dart | 2 +- lib/pages/common/selectDialog.dart | 3 +- lib/pages/mh_page/MattressControl.dart | 38 +- lib/pages/mh_page/ShareUserWidget.dart | 62 +- lib/pages/mh_page/address_list_page.dart | 85 +- lib/pages/mh_page/address_module_widget.dart | 278 ++-- lib/pages/mh_page/apply_repair_page.dart | 1050 +++++++-------- lib/pages/mh_page/bluetooth.dart | 5 +- lib/pages/mh_page/device/device.dart | 66 +- lib/pages/mh_page/device_list.dart | 191 ++- lib/pages/mh_page/device_people_info.dart | 3 - lib/pages/mh_page/device_share_page.dart | 80 +- lib/pages/mh_page/edit_address_page.dart | 962 +++++++------ lib/pages/mh_page/edit_bed.dart | 8 +- .../homepage/component/citypicker.dart | 105 ++ lib/pages/mh_page/homepage/new_Home_page.dart | 10 +- lib/pages/mh_page/people_info.dart | 1194 ++++++++++------- lib/pages/mh_page/repair_list.dart | 2 - lib/pages/mh_page/room_picker.dart | 31 +- lib/pages/mh_page/searchWidget.dart | 2 +- .../mh_page/user/page/edit_userinfo_page.dart | 2 +- lib/pages/mh_page/user/page/rxhx_mht.dart | 9 +- lib/pages/repair/apply_repair_page.dart | 1 + lib/routers/mh_routers.dart | 2 +- 38 files changed, 2399 insertions(+), 2223 deletions(-) create mode 100644 android/app/src/main/res/mipmap-hdpi/ic_launchermh.png create mode 100644 android/app/src/main/res/mipmap-mdpi/ic_launchermh.png create mode 100644 android/app/src/main/res/mipmap-xhdpi/ic_launchermh.png create mode 100644 android/app/src/main/res/mipmap-xxhdpi/ic_launchermh.png create mode 100644 android/app/src/main/res/mipmap-xxxhdpi/ic_launchermh.png create mode 100644 lib/pages/mh_page/homepage/component/citypicker.dart diff --git a/android/app/src/main/res/mipmap-hdpi/ic_launchermh.png b/android/app/src/main/res/mipmap-hdpi/ic_launchermh.png new file mode 100644 index 0000000000000000000000000000000000000000..17f82651c826329ba9a16dcb97a53f2246519202 GIT binary patch literal 3574 zcmV004R>004l5008;`004mK004C`008P>0026e000+ooVrmw00006 zVoOIv0RI600RN!9r;`8x4R1+AK~#9!-JE}L6y+JmKkwe%-d%oNF28e0Krp06gGhxS zND(R$tti!^BeneFSgci*pKdKDOKdhlMux3EHP!O8 zqNp!7H&^<{4UjDFx*T``SUBAZO_s>AAS+A8>9nA#psFg0q8?Nf?rdqPtW5}@pgU~> zo(1ITR%$Xt2*}Nqak;E0iU)lpCXN4=W{x-<5-yi@6t_u;7{;+I z?btCxBC#Sgw9 zEmZ;FY`?^o=ZbmnBX`_B7K^~`wnZryQr;|B>#ZynEVKTh&$PQ(=>>y4c3*249DuY` zg~#q|rSyWqxcxFSZ3rPut!0A5P(RfO%d`Wuc|#|%O}nwK4!M#}Sf-j@=Gro2%jG~oMw8iZv$}6 z@?P%Sbei;3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7*EE({4Z|(ng&|w7NL#cDL79dVYBcO*EqK;yx$j z*u!iWV~gerBUwrxAX3*@C0Rw1Rsv=mqntVi6MDAaB!mDDXrd2wZ+1A5n;D#x5-Q7G#Anj z#9+e=!z8D}hQ|$$*nr`RTk?Yf5jj9tfo>p1z@r6M<0hXSC&?y$U>;>~l{Ju>$o~ot z{aRYUz|Y2)ky7W3_JpM5SHl)bSa=_tc>z6mFy>XV+G;K?MSv{%E2R2rXauc6!bcxF zc@z&S#wzyb>bATJLlg1qN7EL7yC|xp(cxq{Y5COVqv|2hM8kt-nRfx2$dIFfs>qtW zt!86j0Ovh^khIQq>S zX5pVePA-iJV+`Jqgp2-M?) za{uoil2GS5-h9PAHM1-W7X<1Ho1_NNVzpx@m@%+YDMPnVn>#S4v|n%~Z#v5JxU>Jm zHt~SDE13?_H_OVB#j13LhE3`am5YaeYiST%=juLAE-6t7;m{=~{ZLD+l;@RpiHKVe zHN5?AZX26J6Hsg1zC&*kR$4@$zGN?DaRngo-Rd;_mY04Oj34(avuf>fNVCZ65T0(b z_lka;ySDWj*omAl=2Bl?Quca|s(4P+PJ9+8vtu6zL|~wcTgp%qze1Ji!onc+#)Fc` z6qC>e!70)0_oqBBpiBYvun)p;%MGti#Z`>e5OdmL;Jr_qlm=aE5&jvfx(kq#Qk1Ox I`0eNa0hBCD)Bpeg literal 0 HcmV?d00001 diff --git a/android/app/src/main/res/mipmap-xxxhdpi/ic_launchermh.png b/android/app/src/main/res/mipmap-xxxhdpi/ic_launchermh.png new file mode 100644 index 0000000000000000000000000000000000000000..d31b2cbbf6200134134d0801b4d5ca8758666fd1 GIT binary patch literal 10835 zcmW++1z1#F6TZ9T(h`b-G)PIeq=3??q=0k_(#=u=l7dQiH`0i(i*$F#E+x5i=fB_o z>~r_VdCr{oo;x$|oS74;q4t&#?-?Ed0ECJPa$4v!{J#Si8~v}f=zxPhVOqFf|JD>oH(;A7zm)?X z{`+OO79|1z+n}PH%sa1nl)tavyQ%tzi*$ZhE0#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l%6D_WBR2#NErr4bRwG56%A}*(#39JucvbiB zbd*djQW<-fF1y!txp(}tXWp26>buh9Q1r~>!=D4uaXTNK!#d|oJ?cemdyMhd{j4(c6@clfxuva+)NlMKW0NQRbt)*5?nqK z172pTIFU1QD33lTOYPSR-x(RM|6J;F9}c_(D*4R<;IA#4&_J=_Nq}7VHB}6gg(XC; z`*i+HbX@s)_am&s0+EAff3<8oZR+eKps(5=cd^Ov^cspyE<~jVG8^UbCi?TM-Shy9 zPdD|oXG;jLIiWaTPRn9QLOZ}gZ2Bb~mb$N9qehhe7@RR0!oov>0tk>E)q+8cp&gPo zXG9$CThBCm#jng;o;$)oq$FKC6hHtmos^}CIeB(DCy*6~HmJzJCA+|RiH);PiM#sf z&;AY4#)k$qSM|;g-JLiefVr9ekDwe9;w<&MUi}hT-C4qqLE8UtKFl9|7M@_}6`dZG zwFpk9zS6Veh)&%>myy=SZk`Q|{h_tJC8xtq*?g@3+5K7j*=r#hnQgOU5`~B{Mm+lE^?`j1XDR4jokRkGv|=P>)ouJAs|TpP zHJVbc^L_i;_8kJpFL>40bzKdMV(o4%)iGDs!MEe9rN3k#1!?lK9*ib@cm?qF54C+$@EUY{ z9FAO_DeYl7nu|FviphH}yELN*?AZivh}1P;+kg-40sHy|N^OYx{|6-k=|PZh0A&Dk zoOj<@I-rfVxmi-Z4wevmoqC^n{M#da9VSb2xfAvw8-?Cf$X+Jw6;_7}CC$|{0)OW!{qw;d$v)>DpU77qV}^v=Te}L{Oej_fy(b3l%I@q0ZI{O^~7)yz!fwI zXh1$PK>2!EwD&be#@H}}WNmFf9(E?JP+z)~-krIfnRh-oggA_+V>=VTO?z=__W)-; f;~YPQ!w1l{oQ>;16c&0XC;%wRtI1Wq{uul}s7o!a literal 0 HcmV?d00001 diff --git a/lib/common/color/ServiceConstant.dart b/lib/common/color/ServiceConstant.dart index cecc407..b97a506 100644 --- a/lib/common/color/ServiceConstant.dart +++ b/lib/common/color/ServiceConstant.dart @@ -1,45 +1,45 @@ class ServiceConstant { - static const String baseHost = "vsbs-test.he-info.cn";//服务地址 + static const String baseHost = "vsbs-test.he-info.cn"; //服务地址 // static const String baseHost = "vsbst-api.he-info.cn";//服务地址 static const String service_address = "http://$baseHost"; - static String server_service = "/vsbs_app_server";//服务名称 + static String server_service = "/vsbs_app_server"; //服务名称 - static String send_code = "/api/verifycode/send";//发送验证码 - static String login = "/api/user/login";//登录 - static String get_bluetooth_device_status = "/api/device/status/info";//设备绑定状态 - static String device_bind = "/api/device/bind";//设备绑定 - static String device_type = "/api/device/type/list";//设备类型 - static String upload_file = "/api/file/info";//上传文件 - static String user_info = "/api/user/info";//更新用户资料,查询用户信息 - static String device_list = "/api/device/list";//绑定设备列表 - static String person_info = "/api/personnel/info";//用户资料 - static String sleep_report = "/api/device/sleep/data";//睡眠报告 - static String device_share = "/api/device/share";//分享设备 - static String message_list = "/api/mesasge/list";//消息列表 - static String message_read = "/api/mesasge/read";//消息未读数量 - static String device_show = "/api/device/bind";//更新设备绑定 - static String disease_list = "/api/personnel/disease/list";//获取疾病类型 - static String share_deleted = "";//删除分享 - static String start_calibration = "/api/caibration";//开始校准 - static String calibration_process = "/api/caibration";//校准进度 - static String submit_repair = "/api/device/repair";//提交报修 - static String user_setting = "/api/user/config";//查询和更新用户自定义配置 + static String send_code = "/api/verifycode/send"; //发送验证码 + static String login = "/api/user/login"; //登录 + static String get_bluetooth_device_status = + "/api/device/status/info"; //设备绑定状态 + static String device_bind = "/api/device/bind"; //设备绑定 + static String device_type = "/api/device/type/list"; //设备类型 + static String upload_file = "/api/file/info"; //上传文件 + static String user_info = "/api/user/info"; //更新用户资料,查询用户信息 + static String device_list = "/api/device/list"; //绑定设备列表 + static String person_info = "/api/personnel/info"; //用户资料 + static String sleep_report = "/api/device/sleep/data"; //睡眠报告 + static String device_share = "/api/device/share"; //分享设备 + static String message_list = "/api/mesasge/list"; //消息列表 + static String message_read = "/api/mesasge/read"; //消息未读数量 + static String device_show = "/api/device/bind"; //更新设备绑定 + static String disease_list = "/api/personnel/disease/list"; //获取疾病类型 + static String share_deleted = ""; //删除分享 + static String start_calibration = "/api/caibration"; //开始校准 + static String calibration_process = "/api/caibration"; //校准进度 + static String submit_repair = "/api/device/repair"; //提交报修 + static String user_setting = "/api/user/config"; //查询和更新用户自定义配置 static String room_list = "/api/room/info"; //查询房间列表 static String issue_list = "/api/help/list"; //问题与帮助列表 - + static String city_data = "/api/city/data/info"; //城市数据 + static String address_list = "/api/addresss/list"; //查询地址列表 + static String add_address = "/api/addresss/info"; //添加地址 static String logService = "$service_address/vsbs_log"; static const String webSocketService = "wss://$baseHost/vsbs_ws_gateway/ws"; static const String sleep_token = "HdAMjzqiYQKsmHRyEFKhfRGQ"; - static const String sleep_report_url = "https://alltoone.he-info.cn/h5/#/mattress/sleep/sleep"; - - - static const String user_register = "/api/user/register";//用户注册 - static const String user_forgot = "/api/user/forgot";//找回密码 - static const String user_changePassword = "/api/user/changePassword";//修改密码 - static const String personnel_info = "/api/personnel/info";//人员信息列表 - - + static const String sleep_report_url = + "https://alltoone.he-info.cn/h5/#/mattress/sleep/sleep"; + static const String user_register = "/api/user/register"; //用户注册 + static const String user_forgot = "/api/user/forgot"; //找回密码 + static const String user_changePassword = "/api/user/changePassword"; //修改密码 + static const String personnel_info = "/api/personnel/info"; //人员信息列表 } diff --git a/lib/controller/mh_controller/address_controller.dart b/lib/controller/mh_controller/address_controller.dart index 48d41dc..f675ffe 100644 --- a/lib/controller/mh_controller/address_controller.dart +++ b/lib/controller/mh_controller/address_controller.dart @@ -1,10 +1,15 @@ import 'package:ef/ef.dart'; +import 'package:flutter/material.dart'; import 'package:flutter_city_picker/model/address.dart'; import 'package:flutterflow_ui/flutterflow_ui.dart'; import 'package:json_annotation/json_annotation.dart'; +import 'package:vbvs_app/common/color/ServiceConstant.dart'; +import 'package:vbvs_app/common/util/MyUtils.dart'; +import 'package:vbvs_app/common/util/requestWithLog.dart'; +import 'package:vbvs_app/component/tool/TopSlideNotification.dart'; import 'package:vbvs_app/controller/user_info_controller.dart'; import 'package:vbvs_app/model/user_data.dart'; - +import 'package:lpinyin/lpinyin.dart'; part 'address_controller.g.dart'; @JsonSerializable() @@ -14,10 +19,11 @@ class AddressModel { String? city; //市 String? county; //区 String? street; //街道 - String? detail; //详细信息 + String? address; //详细信息 String? name; //名字 - String? phone; //手机号 - bool? ischecked = false; //是否默认 + String? tel; //手机号 + @JsonKey(name: 'default') + int? default_ = 0; //是否默认 int currentType = 0; String? all_address; @@ -52,105 +58,161 @@ class AddressController extends GetControllerEx { address["street"] = model.addressList![3].name; // 第四个元素为街道 } } - address['detail'] = model.detail; + address['address'] = model.address; address['name'] = model.name; - address['phone'] = model.phone; - address['isChecked'] = model.ischecked; + address['tel'] = model.tel; + address['default'] = model.default_; - // try { - // final data = await ef.client.rpc("get_now_datetime"); - // final response = await ef.client.from("app_user_address").update({ - // 'province': address["province"], - // 'city': address["city"], - // 'county': address["county"], - // 'street': address["street"], - // 'detail': address["detail"], - // 'name': address["name"], - // 'phone': address["phone"], - // 'ischecked': address['isChecked'] ? 1 : 0, - // 'update_time': - // DateFormat("yyyy-MM-dd HH:mm:ss").parse("$data").toString(), - // }).eq("id", address['id']); - // } catch (e) { - // print('Error fetching repairs: $e'); - // return e.toString(); - // } + String serviceAddress = ServiceConstant.service_address; + String serviceName = ServiceConstant.server_service; + String serviceApi = ServiceConstant.add_address; + String queryUrl = "${serviceAddress}${serviceName}${serviceApi}"; + await requestWithLog( + logTitle: "更新地址", + method: MyHttpMethod.put, + queryUrl: queryUrl, + data: { + "id": address['_id'], + "default": address['default'], + "name": address['name'], + "tel": address['tel'], + // "area": address['all_address'], + "address": address['address'], + "province": address['province'], + "city": address['city'], + "county": address['county'], + "street": address['street'], + }, + onSuccess: (res) { + if (res.code == 1) { + print("更新地址成功"); + } + }, + ); return ''; } - addAddress(AddressModel model) async { - // try { - // final UserInfoController userInfoController = - // Get.find(); - // UserModel user = userInfoController.model.user!; + Future addAddress(AddressModel model, BuildContext context) async { + try { + final UserInfoController userInfoController = + Get.find(); + UserModel user = userInfoController.model.user!; - // // 设置省市区街道名称 - // if (model.addressList != null && model.addressList!.isNotEmpty) { - // if (model.addressList!.length > 0) - // model.province = model.addressList![0].name; // 第一个元素为省 - // if (model.addressList!.length > 1) - // model.city = model.addressList![1].name; // 第二个元素为市 - // if (model.addressList!.length > 2) - // model.county = model.addressList![2].name; // 第三个元素为区 - // if (model.addressList!.length > 3) - // model.street = model.addressList![3].name; // 第四个元素为街道 - // } + // 设置省市区街道名称 + if (model.addressList != null && model.addressList!.isNotEmpty) { + if (model.addressList!.length > 0) + model.province = model.addressList![0].name; + if (model.addressList!.length > 1) + model.city = model.addressList![1].name; + if (model.addressList!.length > 2) + model.county = model.addressList![2].name; + if (model.addressList!.length > 3) + model.street = model.addressList![3].name; + } - // // 查询数据库是否已有该用户的地址 - // final existingAddresses = await ef.client - // .from('app_user_address') - // .select() - // .eq('user_id', user.uid!); + // 查询现有地址判断是否设置为默认 + String listUrl = + "${ServiceConstant.service_address}${ServiceConstant.server_service}${ServiceConstant.address_list}"; + final listRes = await requestWithLog( + logTitle: "查询地址列表", + method: MyHttpMethod.get, + queryUrl: listUrl, + ); + if (listRes.data.length <= 0) { + model.default_ = 1; + } + // 添加地址 + String addUrl = + "${ServiceConstant.service_address}${ServiceConstant.server_service}${ServiceConstant.add_address}"; + final addRes = await requestWithLog( + logTitle: '添加地址', + method: MyHttpMethod.post, + queryUrl: addUrl, + data: model.toJson(), + ); - // // 如果没有地址,将新增地址默认选中 - // if (existingAddresses.isEmpty) { - // model.ischecked = true; - // } else if (model.ischecked == true) { - // // 如果新地址被选中,将其他地址的 `ischecked` 字段设为 `0` - // await ef.client - // .from('app_user_address') - // .update({'ischecked': 0}).eq('user_id', user.uid!); - // } - - // // 添加新地址 - // final response = await ef.client.from('app_user_address').insert({ - // 'province': model.province, - // 'city': model.city, - // 'county': model.county, - // 'street': model.street, - // 'detail': model.detail, - // 'name': model.name, - // 'phone': model.phone, - // 'ischecked': model.ischecked! ? 1 : 0, - // 'user_id': user.uid, - // }); - // } catch (e) { - // print(e); - // } + if (addRes.code == 1) { + TopSlideNotification.show(context, text: "添加成功".tr); + } + } catch (e) { + print(e); + } } - Future> getData({int? level, int? pid}) async { - // 构建查询 - return []; - // var query = ef.from("app_area_city").select(); + List? _cityCache; - // // 如果 pid 不为 null,添加 pid 的条件 - // if (pid != null) { - // query = query.eq("pid", pid); - // } - // if (level != null) { - // query = query.eq("deep", level); - // } - // List arr = await query; + Future _loadCityDataOnce() async { + if (_cityCache != null) return; - // List addressNodes = arr.map((item) { - // return AddressNode.fromJson({ - // "name": item["ext_name"], // ext_name 对应 name - // "code": item["id"], // id 对应 code - // "letter": item["pinyin_prefix_upper"], // pinyin_prefix_upper 对应 letter - // }); - // }).toList(); + String country = "CN"; + String queryUrl = + "${ServiceConstant.service_address}${ServiceConstant.server_service}${ServiceConstant.city_data}?country=$country"; - // return addressNodes; + await requestWithLog( + logTitle: "查询城市数据", + method: MyHttpMethod.get, + queryUrl: queryUrl, + onSuccess: (res) { + if (res.data != null && res.data is List) { + // 提取所有 data 并展开成一个统一列表 + _cityCache = res.data + .where((e) => e["data"] != null && e["data"] is List) + .expand((e) => e["data"] as List) + .toList(); + } + }, + ); + } + + // 构建查询 + Future> getData({int? level, String? parentCode}) async { + await _loadCityDataOnce(); // 确保只加载一次 + if (_cityCache == null) return []; + + // 获取省级数据 + if (parentCode == null || parentCode.isEmpty) { + return _cityCache!.map((item) { + return AddressNode.fromJson({ + "name": item["name"], + "code": item["code"], + "letter": _getLetter(item["name"]), + }); + }).toList(); + } + + // 递归查找下级 + final parent = _findNodeByCode(_cityCache!, parentCode); + if (parent == null || parent["children"] == null) return []; + + List children = parent["children"]; + return children.map((item) { + return AddressNode.fromJson({ + "name": item["name"], + "code": item["code"], + "letter": _getLetter(item["name"]), + }); + }).toList(); + } + + Map? _findNodeByCode(List list, String code) { + for (var item in list) { + if (item is Map) { + if (item["code"] == code) return item; + if (item["children"] != null && item["children"] is List) { + var result = _findNodeByCode(item["children"], code); + if (result != null) return result; + } + } + } + return null; + } + +// 工具:中文首字母转大写英文(你也可以用更专业的拼音库) + String _getLetter(String name) { + if (name.isEmpty) return "#"; + String pinyin = PinyinHelper.getPinyinE(name, + separator: '', defPinyin: '', format: PinyinFormat.WITHOUT_TONE); + if (pinyin.isEmpty) return "#"; + return pinyin[0].toUpperCase(); } } diff --git a/lib/controller/mh_controller/address_controller.g.dart b/lib/controller/mh_controller/address_controller.g.dart index 2e0927c..9df01c5 100644 --- a/lib/controller/mh_controller/address_controller.g.dart +++ b/lib/controller/mh_controller/address_controller.g.dart @@ -11,10 +11,10 @@ AddressModel _$AddressModelFromJson(Map json) => AddressModel() ..city = json['city'] as String? ..county = json['county'] as String? ..street = json['street'] as String? - ..detail = json['detail'] as String? + ..address = json['address'] as String? ..name = json['name'] as String? - ..phone = json['phone'] as String? - ..ischecked = json['ischecked'] as bool? + ..tel = json['tel'] as String? + ..default_ = (json['default'] as num?)?.toInt() ..currentType = (json['currentType'] as num).toInt() ..all_address = json['all_address'] as String?; @@ -24,10 +24,10 @@ Map _$AddressModelToJson(AddressModel instance) => 'city': instance.city, 'county': instance.county, 'street': instance.street, - 'detail': instance.detail, + 'address': instance.address, 'name': instance.name, - 'phone': instance.phone, - 'ischecked': instance.ischecked, + 'tel': instance.tel, + 'default': instance.default_, 'currentType': instance.currentType, 'all_address': instance.all_address, }; diff --git a/lib/controller/mh_controller/address_list_controller.dart b/lib/controller/mh_controller/address_list_controller.dart index 25b0456..7849683 100644 --- a/lib/controller/mh_controller/address_list_controller.dart +++ b/lib/controller/mh_controller/address_list_controller.dart @@ -1,6 +1,7 @@ import 'package:ef/ef.dart'; import 'package:json_annotation/json_annotation.dart'; - +import 'package:vbvs_app/common/color/ServiceConstant.dart'; +import 'package:vbvs_app/common/util/requestWithLog.dart'; part 'address_list_controller.g.dart'; @@ -23,42 +24,48 @@ class AddressListController extends GetControllerEx { attr = GetModel(AddressListModel()).obs; } - // getAddressList() async { - // await ApiService.request.get("/api/address/info/list").then((d) { - // model.addressList = d.data["data"] ?? []; - // updateAll(); - // }).catchError((e) { - // print("$e"); - // }); - // } + getAddressList() async { + String serviceAddress = ServiceConstant.service_address; + String serviceName = ServiceConstant.server_service; + String serviceApi = ServiceConstant.address_list; + String queryUrl = "$serviceAddress$serviceName$serviceApi"; - // //更新默认 - // Future updateDefault(address) async { - // var id = address['id']; - // var uid = address['userId']; - // try { - // await ef.client - // .from("app_user_address") - // .update({ - // 'ischecked': 0, - // }) - // .eq("user_id", address['userId']) - // .eq("ischecked", 1); - // await ef.client.from("app_user_address").update({ - // 'ischecked': 1, - // }).eq("id", address['id']); - // } catch (e) { - // print('Error fetching repairs: $e'); - // } - // } + requestWithLog( + logTitle: '查询地址列表', + method: MyHttpMethod.get, + queryUrl: queryUrl, + onSuccess: (res) { + // 安全检查 res.data 是否为 List + if (res.data != null && res.data is List && res.data.isNotEmpty) { + model.addressList = res.data; + } else { + model.addressList = []; // 设为空数组,防止空指针问题 + } + updateAll(); + }, + onFailure: (err) { + model.addressList = []; // 请求失败时也清空列表以防旧数据残留 + updateAll(); + }, + ); + } // // 删除地址 - // Future deleteAddress(String id) async { - // try { - // await ef.client.from("app_user_address").delete().eq("id", id); - // print("Address with ID $id has been successfully deleted."); - // } catch (e) { - // print("Error deleting address with ID $id: $e"); - // } - // } + Future deleteAddress(String id) async { + String serviceAddress = ServiceConstant.service_address; + String serviceName = ServiceConstant.server_service; + String serviceApi = ServiceConstant.add_address; + String queryUrl = "$serviceAddress$serviceName$serviceApi?id=$id"; + requestWithLog( + logTitle: '删除地址', + method: MyHttpMethod.delete, + queryUrl: queryUrl, + onSuccess: (res) { + getAddressList(); + }, + onFailure: (err) { + getAddressList(); + }, + ); + } } diff --git a/lib/controller/mh_controller/apply_repair_controller.dart b/lib/controller/mh_controller/apply_repair_controller.dart index 7343622..f900fb6 100644 --- a/lib/controller/mh_controller/apply_repair_controller.dart +++ b/lib/controller/mh_controller/apply_repair_controller.dart @@ -6,6 +6,7 @@ import 'package:vbvs_app/common/color/repair_status.dart'; import 'package:vbvs_app/common/util/MyUtils.dart'; import 'package:vbvs_app/common/util/myDialog/my_dialog_controller.dart'; import 'package:vbvs_app/common/util/requestWithLog.dart'; +import 'package:vbvs_app/controller/mh_controller/device_list_controller.dart'; import 'package:vbvs_app/controller/user_info_controller.dart'; import 'package:vbvs_app/model/user_data.dart'; @@ -216,16 +217,14 @@ class ApplyRepairController extends GetControllerEx { return message; } - // Future getDeviceList() async { - // final UserInfoController userInfoController = - // Get.find(); - // // UserModel loginUser = userInfoController.model.user!; - // DeviceListController deviceListController = Get.find(); - // await deviceListController.getDeviceList(); - // var aa = deviceListController.model.deviceListWyf; - // ApplyRepairController applyRepairController = Get.find(); - // applyRepairController.model.device_list = aa; - // } + Future getDeviceList() async { + // UserModel loginUser = userInfoController.model.user!; + DeviceListController deviceListController = Get.find(); + await deviceListController.getDeviceList(); + var aa = deviceListController.model.deviceList; + ApplyRepairController applyRepairController = Get.find(); + applyRepairController.model.device_list = aa; + } // String getPublicUrl(String path) { // try { diff --git a/lib/controller/mh_controller/device_list_controller.dart b/lib/controller/mh_controller/device_list_controller.dart index ff5b058..17e523a 100644 --- a/lib/controller/mh_controller/device_list_controller.dart +++ b/lib/controller/mh_controller/device_list_controller.dart @@ -18,7 +18,7 @@ part 'device_list_controller.g.dart'; class DeviceListModel { //设备列表 List deviceList = []; - List deviceListWyf = []; + @JsonKey(ignore: true) String? keyword; diff --git a/lib/controller/mh_controller/device_list_controller.g.dart b/lib/controller/mh_controller/device_list_controller.g.dart index 0c92bc2..9cb69ac 100644 --- a/lib/controller/mh_controller/device_list_controller.g.dart +++ b/lib/controller/mh_controller/device_list_controller.g.dart @@ -7,12 +7,9 @@ part of 'device_list_controller.dart'; // ************************************************************************** DeviceListModel _$DeviceListModelFromJson(Map json) => - DeviceListModel() - ..deviceList = json['deviceList'] as List - ..deviceListWyf = json['deviceListWyf'] as List; + DeviceListModel()..deviceList = json['deviceList'] as List; Map _$DeviceListModelToJson(DeviceListModel instance) => { 'deviceList': instance.deviceList, - 'deviceListWyf': instance.deviceListWyf, }; diff --git a/lib/controller/repair/repair_controller.dart b/lib/controller/repair/repair_controller.dart index a3689f3..b909bf2 100644 --- a/lib/controller/repair/repair_controller.dart +++ b/lib/controller/repair/repair_controller.dart @@ -19,8 +19,8 @@ class RepairModel { // String? issue; //问题描述 String? fileUrl; //文件地址 String? mac; //状态 - String? desc;//问题描述 - List? img;//上传图片 + String? desc; //问题描述 + List? img; //上传图片 RepairModel(); factory RepairModel.fromJson(Map json) { try { diff --git a/lib/controller/user_info_controller.g.dart b/lib/controller/user_info_controller.g.dart index 3c95bf2..a0bde94 100644 --- a/lib/controller/user_info_controller.g.dart +++ b/lib/controller/user_info_controller.g.dart @@ -18,7 +18,6 @@ UserInfoModel _$UserInfoModelFromJson(Map json) => ..deviceId = json['deviceId'] as String? ..deviceModel = json['deviceModel'] as String? ..appVersion = json['appVersion'] as String? - ..img_bucket = json['img_bucket'] as String? ..login = (json['login'] as num?)?.toInt() ..deviceBindNum = (json['deviceBindNum'] as num?)?.toInt() ..loginPhone = (json['loginPhone'] as num?)?.toInt(); @@ -33,7 +32,6 @@ Map _$UserInfoModelToJson(UserInfoModel instance) => 'deviceId': instance.deviceId, 'deviceModel': instance.deviceModel, 'appVersion': instance.appVersion, - 'img_bucket': instance.img_bucket, 'login': instance.login, 'deviceBindNum': instance.deviceBindNum, 'loginPhone': instance.loginPhone, diff --git a/lib/pages/common/bezier_bottom_navigation_bar.dart b/lib/pages/common/bezier_bottom_navigation_bar.dart index 1d411a6..0b15fcb 100644 --- a/lib/pages/common/bezier_bottom_navigation_bar.dart +++ b/lib/pages/common/bezier_bottom_navigation_bar.dart @@ -73,7 +73,7 @@ class BezierBottomNavigationBar extends StatelessWidget { fontSize: 22.rpx, color: selectedIndex == i ? Colors.white - : Colors.grey.shade400, + : const Color(0XFF929699), ), ), ], diff --git a/lib/pages/common/selectDialog.dart b/lib/pages/common/selectDialog.dart index cd0c840..52591c7 100644 --- a/lib/pages/common/selectDialog.dart +++ b/lib/pages/common/selectDialog.dart @@ -381,7 +381,7 @@ Future showWeightPickerDialog( context, weights, tempIndex, // ✅ 传入 RxInt - unit: "cm", + unit: "kg", ), ), ], @@ -408,7 +408,6 @@ Future showHeightPickerDialog( int selectedIndex = heights.indexOf(initialHeight); // int tempIndex = selectedIndex; final RxInt tempIndex = RxInt(selectedIndex); // ✅ 改为 RxInt - ThemeController themeController = Get.find(); await showDialog( diff --git a/lib/pages/mh_page/MattressControl.dart b/lib/pages/mh_page/MattressControl.dart index 5e54853..55856b5 100644 --- a/lib/pages/mh_page/MattressControl.dart +++ b/lib/pages/mh_page/MattressControl.dart @@ -17,20 +17,22 @@ class _MattressControlPageState extends State { final controller = Get.put(ControlCardController()); final data = { - "_id": "684bf0845a81f423c0000000", - "uid": "68465947a0cff49592000000", + "_id": "333330000000000000000000", + "uid": "684b90df767e00004e0072e2", "bind_type": 1, "device_type": 3, - "mac": "545024122617", + "mac": "545024122666", "bind_mac": null, - "bind_mac_a": "48CA43B2E8C8", - "bind_mac_b": "48CA43B2E8B0", + "bind_mac_a": "B43A45C3D411", + "bind_mac_b": "B43A45C3D388", "position": 0, "share_uid": null, "person": null, "op_type": null, "show": true, - "create_time": 1749807236514, + "create_time": 1750121686274, + "room_id": "684395bf9ef8601da20f6475", + "roomName": "主卧", "shareNum": 0, "status": { "signal": -1, @@ -40,7 +42,7 @@ class _MattressControlPageState extends State { "failure": 0, "updateTime": -1 }, - "code": "545024122617" + "code": "545024122666" }; int selectedIndex = 1; // 当前选中的tab索引 @override @@ -75,7 +77,7 @@ class _MattressControlPageState extends State { SizedBox(width: 26.rpx), Container( decoration: BoxDecoration( - color: Color(0xFF003058), + color: const Color(0xFF003058), borderRadius: BorderRadius.circular(30.rpx), ), constraints: BoxConstraints( @@ -90,6 +92,11 @@ class _MattressControlPageState extends State { underline: const SizedBox(), dropdownColor: Colors.blueGrey, iconEnabledColor: Colors.white, + icon: Icon( + Icons.keyboard_arrow_down, // 最常用的向下箭头 + color: Colors.white, + size: 30.rpx, + ), style: const TextStyle(color: Colors.white), isExpanded: true, items: const [ @@ -113,11 +120,16 @@ class _MattressControlPageState extends State { highlightColor: Colors.transparent, padding: EdgeInsets.only(right: 69.rpx), onTap: () {}, - child: Icon( - Icons.bluetooth, - color: Colors.white, - size: 42.rpx, + child: Image.asset( + 'assets/images/active_bluetooth.png', + width: 42.rpx, + height: 42.rpx, ), + // Icon( + // Icons.bluetooth, + // color: Colors.white, + // size: 42.rpx, + // ), ), ClickableContainer( backgroundColor: Colors.transparent, @@ -131,7 +143,7 @@ class _MattressControlPageState extends State { ], centerTitle: false, ), - body: SafeArea( + body: const SafeArea( child: Column( mainAxisAlignment: MainAxisAlignment.center, children: [ diff --git a/lib/pages/mh_page/ShareUserWidget.dart b/lib/pages/mh_page/ShareUserWidget.dart index 9b3130f..08f9ed8 100644 --- a/lib/pages/mh_page/ShareUserWidget.dart +++ b/lib/pages/mh_page/ShareUserWidget.dart @@ -51,14 +51,10 @@ class ShareUserWidget extends GetView { height: 42.rpx, child: SvgPicture.asset('assets/img/icon/default_head.svg'), ), - Expanded( child: Container( margin: EdgeInsetsDirectional.only(start: 30.rpx, end: 30.rpx), - // width: MediaQuery.sizeOf(context).width * 0.5, - // height: MediaQuery.sizeOf(context).height * 0.075, - child: Column( mainAxisSize: MainAxisSize.max, children: [ @@ -72,6 +68,7 @@ class ShareUserWidget extends GetView { color: Colors.white, fontSize: 30.rpx, letterSpacing: 0.0, + height: 1, ), ), ), @@ -90,6 +87,7 @@ class ShareUserWidget extends GetView { color: const Color(0xFFC8CBD2), fontSize: 20.rpx, letterSpacing: 0.0, + height: 1, ), ), ), @@ -98,44 +96,6 @@ class ShareUserWidget extends GetView { ), ), ), - // Container( - // width: MediaQuery.sizeOf(context).width * 0.2, - // height: MediaQuery.sizeOf(context).height * 0.075, - // constraints: const BoxConstraints( - // maxWidth: 130, - // ), - // decoration: BoxDecoration( - // - // ), - // child: Row( - // mainAxisSize: MainAxisSize.max, - // mainAxisAlignment: MainAxisAlignment.spaceBetween, - // children: [ - // Align( - // alignment: const AlignmentDirectional(0, 0), - // child: Text( - // ' ', - // style: TextStyle( - // fontFamily: 'Readex Pro', - // color: const Color(0xFF333333), - // fontSize: 13, - // letterSpacing: 0.0, - // ), - // ), - // ), - // Flexible( - // child: Align( - // alignment: const AlignmentDirectional(0, 0.05), - // child: Icon( - // Icons.arrow_forward_ios, - // color: FlutterFlowTheme.of(context).secondaryText, - // size: 10, - // ), - // ), - // ), - // ].divide(const SizedBox(width: 27)), - // ), - // ), ClickableContainer( backgroundColor: Colors.transparent, highlightColor: Colors.transparent, @@ -147,25 +107,9 @@ class ShareUserWidget extends GetView { child: SvgPicture.asset( 'assets/img/icon/expand.svg', color: Colors.white, - ) - // Icon( - // Icons.arrow_forward_ios, - // color: Colors.white, - // // size: 14.rpx, - // ), - )), + ))), ], ), - // Container( - // width: MediaQuery.sizeOf(context).width, - // height: MediaQuery.sizeOf(context).height * 0.09, - // child: Container( - // width: MediaQuery.sizeOf(context).width, - // height: MediaQuery.sizeOf(context).height * 0.09, - // decoration: BoxDecoration(), - - // ), - // ), ), ), ); diff --git a/lib/pages/mh_page/address_list_page.dart b/lib/pages/mh_page/address_list_page.dart index 299303f..191c1c2 100644 --- a/lib/pages/mh_page/address_list_page.dart +++ b/lib/pages/mh_page/address_list_page.dart @@ -15,9 +15,9 @@ class AddressListPage extends GetView { final scaffoldKey = GlobalKey(); BoxConstraints? bodysize; - // AddressListPage() { - // controller.getAddressList(); - // } + AddressListPage() { + controller.getAddressList(); + } @override Widget build(BuildContext context) { @@ -65,6 +65,7 @@ class AddressListPage extends GetView { centerTitle: false, ), body: Container( + margin: EdgeInsets.only(top: 30.rpx), width: bodysize!.maxWidth, height: bodysize!.maxHeight * 1, child: Column( @@ -80,49 +81,24 @@ class AddressListPage extends GetView { child: Container( width: bodysize!.maxWidth, height: bodysize!.maxHeight * 1, - decoration: BoxDecoration( - color: Color(0xFFF6F6F6), - ), - child: Column( - mainAxisSize: MainAxisSize.max, - children: [ - Align( - alignment: AlignmentDirectional(-1, 0), - child: Padding( - padding: EdgeInsetsDirectional.fromSTEB( - 31, 27, 0, 26), - child: Text( - '我的地址', - style: TextStyle( - fontFamily: 'Readex Pro', - fontSize: AppFontsize.title_size, - letterSpacing: 0, - fontWeight: FontWeight.w600, - ), - ), - ), - ), - Expanded( - child: Obx(() => ListView( - shrinkWrap: true, - scrollDirection: Axis.vertical, - children: (controller.model.addressList! - .asMap() - .entries - .map((e) => AddressModuleWidget( - index: e.key, - addressListController: - controller, - )) - .toList() as List) - .divide(const SizedBox(height: 10)) - .addToEnd(const SizedBox( - height: AppConstants - .list_end_height)), - )), - ), - ], - ), + decoration: BoxDecoration(), + child: Obx(() => ListView( + shrinkWrap: true, + scrollDirection: Axis.vertical, + children: (controller.model.addressList! + .asMap() + .entries + .map((e) => AddressModuleWidget( + index: e.key, + addressListController: + controller, + )) + .toList() as List) + .divide(const SizedBox(height: 10)) + .addToEnd(const SizedBox( + height: + AppConstants.list_end_height)), + )), ), ); } @@ -143,7 +119,7 @@ class AddressListPage extends GetView { ), child: TextButton( onPressed: () { - controller.model.address = {'isChecked': false}; + controller.model.address = {'default': 0}; controller.model.type = 1; Get.toNamed("/editAddressPage"); }, @@ -167,20 +143,7 @@ class AddressListPage extends GetView { width: 42.rpx, height: 42.rpx, ), - // Text( - // '+', - // style: FlutterFlowTheme.of(context) - // .titleSmall - // .override( - // fontFamily: 'Readex Pro', - // color: Color(0xFF85F5FF), - // fontSize: - // AppFontsize.normal_text_size + - // 12, // 让加号比文字稍大 - // letterSpacing: 0, - // ), - // ), - //), + SizedBox(width: 10), // 加号和文字间距 Text( '添加新地址', diff --git a/lib/pages/mh_page/address_module_widget.dart b/lib/pages/mh_page/address_module_widget.dart index 07a6ffb..0314dd8 100644 --- a/lib/pages/mh_page/address_module_widget.dart +++ b/lib/pages/mh_page/address_module_widget.dart @@ -2,8 +2,8 @@ import 'package:ef/ef.dart'; import 'package:flutter/material.dart'; import 'package:flutterflow_ui/flutterflow_ui.dart'; import 'package:flutter_slidable/flutter_slidable.dart'; +import 'package:vbvs_app/common/util/FitTool.dart'; import 'package:vbvs_app/controller/mh_controller/address_list_controller.dart'; - import '../../common/color/appFontsize.dart'; class AddressModuleWidget extends GetView { @@ -20,14 +20,14 @@ class AddressModuleWidget extends GetView { return SingleChildScrollView( child: SlidableAutoCloseBehavior( child: Padding( - padding: EdgeInsetsDirectional.fromSTEB(15, 0, 15, 0), + padding: EdgeInsetsDirectional.fromSTEB(30.rpx, 0, 30.rpx, 0), child: Container( width: MediaQuery.sizeOf(context).width, constraints: BoxConstraints( - minHeight: 100, + minHeight: 220.rpx, ), decoration: BoxDecoration( - color: Colors.white, + color: Color(0xFF003058), borderRadius: BorderRadius.circular(16), ), child: Slidable( @@ -38,12 +38,12 @@ class AddressModuleWidget extends GetView { Expanded( child: InkWell( onTap: () async { - // await addressListController.deleteAddress( - // addressListController.model.addressList[index] - // ['id']); - // addressListController.model.addressList.removeAt(index); + await addressListController.deleteAddress( + addressListController.model.addressList[index] + ['_id']); + addressListController.model.addressList.removeAt(index); - // addressListController.updateAll(); + addressListController.updateAll(); }, child: Container( margin: EdgeInsets.only(left: 30), @@ -62,184 +62,128 @@ class AddressModuleWidget extends GetView { ], ), child: Padding( - padding: EdgeInsetsDirectional.fromSTEB(15, 13, 15, 10), + padding: EdgeInsetsDirectional.fromSTEB( + 30.rpx, 20.rpx, 30.rpx, 20.rpx), child: Container( width: MediaQuery.sizeOf(context).width, height: MediaQuery.sizeOf(context).height * 0.123, child: Column( mainAxisSize: MainAxisSize.max, children: [ - Expanded( - child: Container( - width: MediaQuery.sizeOf(context).width, - height: MediaQuery.sizeOf(context).height * 0.08, - constraints: BoxConstraints( - minHeight: 112, - ), + Container( + height: 60.rpx, child: Row( - mainAxisSize: MainAxisSize.max, mainAxisAlignment: MainAxisAlignment.spaceBetween, children: [ - Container( - width: MediaQuery.sizeOf(context).width * 0.7, - height: - MediaQuery.sizeOf(context).height * 0.08, - constraints: BoxConstraints( - minHeight: 112, - ), - child: Column( - mainAxisSize: MainAxisSize.max, - children: [ - Flexible( - child: Align( - alignment: AlignmentDirectional(-1, 0), - child: Text( - [ - addressListController.model - .addressList[index]['province'], - addressListController.model - .addressList[index]['city'], - addressListController.model - .addressList[index]['county'], - addressListController.model - .addressList[index]['street'] - ] - .where((element) => - element != null && - element.isNotEmpty) - .join(' '), - style: TextStyle( - fontFamily: 'Readex Pro', - color: Color(0xFF333333), - fontSize: - AppFontsize.normal_text_size, - letterSpacing: 0, - ), - ), - ), - ), - Flexible( - child: Align( - alignment: AlignmentDirectional(-1, 0), - child: Text( - addressListController - .model - .addressList[index] - ['detail'] - ?.isEmpty ?? - true - ? '无详细地址' - : addressListController.model - .addressList[index]['detail'], - style: TextStyle( - fontFamily: 'Readex Pro', - color: Color(0xFF333333), - fontSize: - AppFontsize.normal_text_size, - letterSpacing: 0, - ), - ), - ), - ), - Flexible( - child: Align( - alignment: AlignmentDirectional(-1, 0), - child: Text( - '${addressListController.model.addressList[index]['name']} ' + - '${addressListController.model.addressList[index]['phone']} ', - style: TextStyle( - fontFamily: 'Readex Pro', - color: Color(0xFF333333), - fontSize: - AppFontsize.normal_text_size, - letterSpacing: 0, - ), - ), - ), - ), - ].divide(SizedBox(height: 5)), + Expanded( + child: Text( + [ + addressListController + .model.addressList[index]['province'], + addressListController + .model.addressList[index]['city'], + addressListController + .model.addressList[index]['county'], + addressListController + .model.addressList[index]['street'] + ] + .where((element) => + element != null && element.isNotEmpty) + .join(' '), + style: TextStyle( + fontFamily: 'Readex Pro', + color: Colors.white, + fontSize: AppFontsize.normal_text_size, + letterSpacing: 0, + ), ), ), - Align( - alignment: AlignmentDirectional(1, -1), - child: Theme( - data: ThemeData( - checkboxTheme: CheckboxThemeData( - visualDensity: VisualDensity.compact, - materialTapTargetSize: - MaterialTapTargetSize.shrinkWrap, - shape: RoundedRectangleBorder( - borderRadius: BorderRadius.circular(64), + Obx(() => Visibility( + visible: addressListController.model + .addressList[index]["default"] == + 1, + child: Container( + width: 71.rpx, + height: 36.rpx, + child: ElevatedButton( + onPressed: () {}, + child: Text( + '默认', + style: TextStyle( + color: Color(0XFF6BFDAC), + fontSize: 20.rpx, + ), + ), + style: ElevatedButton.styleFrom( + backgroundColor: + const Color(0x4D6BFDAC), + padding: EdgeInsets.zero, + ), ), ), - unselectedWidgetColor: Color(0xFFD3D3D3), - ), - child: Obx(() { - return Checkbox( - value: addressListController - .model.addressList[index] - ['isChecked'] ?? - false, - onChanged: (newValue) async { - // if (newValue == true) { - // for (var i = 0; - // i < - // addressListController - // .model.addressList.length; - // i++) { - // addressListController - // .model.addressList[i] - // ['isChecked'] = false; - // } - // addressListController - // .model.addressList[index] - // ['isChecked'] = newValue; - // addressListController.updateDefault( - // addressListController - // .model.addressList[index]); - // } - // addressListController.updateAll(); - }, - side: BorderSide( - width: 1.5, - color: Colors.white, - ), - activeColor: const Color(0xFFd3b684), - // checkColor: - // FlutterFlowTheme.of(context).info, - ); - }), - ), - ) + )) ], + )), + Container( + height: 60.rpx, + alignment: Alignment.centerLeft, + child: Text( + addressListController.model + .addressList[index]['address']?.isEmpty ?? + true + ? '无详细地址' + : addressListController.model.addressList[index] + ['address'], + style: TextStyle( + fontFamily: 'Readex Pro', + color: Colors.white, + fontSize: AppFontsize.normal_text_size, + letterSpacing: 0, ), ), ), - Align( - alignment: AlignmentDirectional(1, 0), - child: InkWell( - onTap: () { - addressListController.model.address = - addressListController.model.addressList[index]; - addressListController.model.type = 2; - Get.toNamed("/editAddressPage"); - }, - child: Container( - width: 100, - height: MediaQuery.sizeOf(context).height * 0.03, - child: Align( - alignment: AlignmentDirectional(1, 0), - child: Text( - '编辑', - style: TextStyle( - fontFamily: 'Readex Pro', - color: Color(0xFF9EA4B7), - fontSize: AppFontsize.small_text_size, - letterSpacing: 0, + Container( + height: 60.rpx, + child: Row( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + children: [ + Text( + '${addressListController.model.addressList[index]['name']} ' + + '${addressListController.model.addressList[index]['tel']} ', + style: TextStyle( + fontFamily: 'Readex Pro', + color: Colors.white, + fontSize: AppFontsize.normal_text_size, + letterSpacing: 0, + ), + ), + InkWell( + onTap: () { + addressListController.model.address = + addressListController + .model.addressList[index]; + addressListController.model.type = 2; + Get.toNamed("/editAddressPage"); + }, + child: Container( + width: 100, + height: + MediaQuery.sizeOf(context).height * 0.03, + child: Align( + alignment: AlignmentDirectional(1, 0), + child: Text( + '编辑', + style: TextStyle( + fontFamily: 'Readex Pro', + color: Color(0xFF84F5FF), + fontSize: AppFontsize.small_text_size, + letterSpacing: 0, + ), + ), ), ), ), - ), + ], ), ), ], diff --git a/lib/pages/mh_page/apply_repair_page.dart b/lib/pages/mh_page/apply_repair_page.dart index 15a1180..b77b3b6 100644 --- a/lib/pages/mh_page/apply_repair_page.dart +++ b/lib/pages/mh_page/apply_repair_page.dart @@ -20,15 +20,15 @@ class ApplyRepairPage extends GetView { final scaffoldKey = GlobalKey(); BoxConstraints? bodysize; RepairController repairController = Get.find(); - // ApplyRepairPage() { - // controller.attr.value.listenlists.clear(); - // controller.getDeviceList(); - // controller.model.device_type = ""; - // controller.model.select_device = ""; - // controller.model.device_category = ""; - // controller.model.device_name = ""; - // controller.model.device_id = ""; - // } + ApplyRepairPage() { + controller.attr.value.listenlists.clear(); + controller.getDeviceList(); + controller.model.device_type = ""; + controller.model.select_device = ""; + controller.model.device_category = ""; + controller.model.device_name = ""; + controller.model.device_id = ""; + } final List repairItemKeys = []; final GlobalKey contactKey = GlobalKey(); @@ -118,7 +118,7 @@ class ApplyRepairPage extends GetView { maxHeight: 500.rpx, ), decoration: BoxDecoration( - color: Color(0XFF003058), + color: const Color(0XFF003058), borderRadius: BorderRadius.circular(16.rpx), ), @@ -231,7 +231,7 @@ class ApplyRepairPage extends GetView { .model .device_list! .map((device) => { - 'id': device['id'].toString(), // 提取设备 ID + 'id': device['_id'].toString(), // 提取设备 ID 'name': device['name'].toString(), // 提取设备名称 }) .toList(); @@ -249,13 +249,15 @@ class ApplyRepairPage extends GetView { String>( controller: tmpcontroller, + fillColor: + Colors.white, // 控件区域背景色 options: deviceIds, // 下拉菜单选项为设备的 ID optionLabels: deviceNames, // 下拉菜单显示的内容为设备名称 onChanged: (val) { - var selectedDevice = controller.model.device_list!.firstWhere((device) => device['id'].toString() == val); + var selectedDevice = controller.model.device_list!.firstWhere((device) => device['_id'].toString() == val); controller.model.select_device = val; controller.model.device_type = selectedDevice['type'] == 1 ? '床' : '床垫'; controller.model.device_category = selectedDevice['deviceSeries']['name'] ?? '未知型号'; // 获取设备型号 @@ -268,18 +270,21 @@ class ApplyRepairPage extends GetView { height: 56, searchHintTextStyle: - TextStyle( + const TextStyle( fontFamily: 'Readex Pro', letterSpacing: 0, ), + searchTextStyle: - TextStyle( + const TextStyle( fontFamily: 'Readex Pro', letterSpacing: 0, ), textStyle: TextStyle( fontFamily: 'Readex Pro', + color: Colors.black, + fontSize: 26.rpx, letterSpacing: 0, ), hintText: @@ -287,9 +292,9 @@ class ApplyRepairPage extends GetView { searchHintText: '查找', icon: - Icon( + const Icon( Icons.keyboard_arrow_down_rounded, - color: Colors.white, + color: Colors.black, size: 24, ), // fillColor: @@ -368,124 +373,107 @@ class ApplyRepairPage extends GetView { ), Expanded( child: Container( - width: 100, - height: 100, - decoration: - BoxDecoration( - color: Colors - .white, - borderRadius: - BorderRadius - .circular(8), - ), - child: - Obx(() { - return TextFormField( - // autofocus: true, - controller: - controller - .onReDraw( - TextEditingController( - text: - controller.model.device_category ?? ""), - (value) => - { - value.text = - controller.model.device_category ?? "" - }, - ), - onChanged: - (value) { - controller + width: 100, + height: 100, + decoration: + BoxDecoration( + color: Colors + .white, + borderRadius: + BorderRadius + .circular( + 8), + ), + child: + TextFormField( + // autofocus: true, + onChanged: + (value) { + controller .model - .device_category = value; - }, - // initialValue: - // controller - // .model - // .device_category, - obscureText: - false, - decoration: - InputDecoration( - labelStyle: - TextStyle( - fontFamily: - 'Readex Pro', - letterSpacing: - 0, - ), - hintStyle: - TextStyle( - fontFamily: - 'Readex Pro', - letterSpacing: - 0, - ), - enabledBorder: - UnderlineInputBorder( - borderSide: - const BorderSide( - color: - Color(0x00000000), - width: - 2, - ), - borderRadius: - BorderRadius.circular(8), - ), - focusedBorder: - UnderlineInputBorder( - borderSide: - const BorderSide( - color: - Color(0x00000000), - width: - 2, - ), - borderRadius: - BorderRadius.circular(8), - ), - errorBorder: - UnderlineInputBorder( - borderSide: - const BorderSide( - color: - Color(0x00000000), - width: - 2, - ), - borderRadius: - BorderRadius.circular(8), - ), - focusedErrorBorder: - UnderlineInputBorder( - borderSide: - const BorderSide( - color: - Color(0x00000000), - width: - 2, - ), - borderRadius: - BorderRadius.circular(8), - ), - contentPadding: const EdgeInsetsDirectional - .fromSTEB( - 10, - 0, - 10, - 18), + .device_type = + value; + }, + obscureText: + false, + decoration: + InputDecoration( + isDense: + true, + labelStyle: + const TextStyle( + fontFamily: + 'Readex Pro', + letterSpacing: + 0, + ), + hintStyle: + const TextStyle( + fontFamily: + 'Readex Pro', + letterSpacing: + 0, + ), + enabledBorder: + OutlineInputBorder( + borderSide: + BorderSide( + color: const Color( + 0x00000000), + width: 1 + .rpx, ), - style: - TextStyle( - fontFamily: - 'Readex Pro', - letterSpacing: - 0, + borderRadius: + BorderRadius.circular( + AppConstants().normal_container_radius), + ), + focusedBorder: + OutlineInputBorder( + borderSide: + BorderSide( + color: Colors + .transparent, + width: 1 + .rpx, ), - ); - })), + borderRadius: + BorderRadius.circular( + 8.rpx), + ), + errorBorder: + OutlineInputBorder( + borderSide: + BorderSide( + // + width: 1 + .rpx, + ), + borderRadius: + BorderRadius.circular( + 8.rpx), + ), + focusedErrorBorder: + OutlineInputBorder( + borderSide: + BorderSide( + // + width: 1 + .rpx, + ), + borderRadius: + BorderRadius.circular( + 8.rpx), + ), + ), + style: TextStyle( + letterSpacing: + 0, + color: Colors + .black, + fontSize: + 26.rpx), + ), + ), ), ].divide(SizedBox( width: 26.rpx)), @@ -538,124 +526,107 @@ class ApplyRepairPage extends GetView { ), Expanded( child: Container( - width: 100, - height: 100, - decoration: - BoxDecoration( - color: Colors - .white, - borderRadius: - BorderRadius - .circular(8), - ), - child: - Obx(() { - return TextFormField( - // autofocus: true, - controller: - controller - .onReDraw( - TextEditingController( - text: - controller.model.device_category ?? ""), - (value) => - { - value.text = - controller.model.device_category ?? "" - }, - ), - onChanged: - (value) { - controller + width: 100, + height: 100, + decoration: + BoxDecoration( + color: Colors + .white, + borderRadius: + BorderRadius + .circular( + 8), + ), + child: + TextFormField( + // autofocus: true, + onChanged: + (value) { + controller .model - .device_category = value; - }, - // initialValue: - // controller - // .model - // .device_category, - obscureText: - false, - decoration: - InputDecoration( - labelStyle: - TextStyle( - fontFamily: - 'Readex Pro', - letterSpacing: - 0, - ), - hintStyle: - TextStyle( - fontFamily: - 'Readex Pro', - letterSpacing: - 0, - ), - enabledBorder: - UnderlineInputBorder( - borderSide: - const BorderSide( - color: - Color(0x00000000), - width: - 2, - ), - borderRadius: - BorderRadius.circular(8), - ), - focusedBorder: - UnderlineInputBorder( - borderSide: - const BorderSide( - color: - Color(0x00000000), - width: - 2, - ), - borderRadius: - BorderRadius.circular(8), - ), - errorBorder: - UnderlineInputBorder( - borderSide: - const BorderSide( - color: - Color(0x00000000), - width: - 2, - ), - borderRadius: - BorderRadius.circular(8), - ), - focusedErrorBorder: - UnderlineInputBorder( - borderSide: - const BorderSide( - color: - Color(0x00000000), - width: - 2, - ), - borderRadius: - BorderRadius.circular(8), - ), - contentPadding: const EdgeInsetsDirectional - .fromSTEB( - 10, - 0, - 10, - 18), + .device_category = + value; + }, + obscureText: + false, + decoration: + InputDecoration( + isDense: + true, + labelStyle: + const TextStyle( + fontFamily: + 'Readex Pro', + letterSpacing: + 0, + ), + hintStyle: + const TextStyle( + fontFamily: + 'Readex Pro', + letterSpacing: + 0, + ), + enabledBorder: + OutlineInputBorder( + borderSide: + BorderSide( + color: const Color( + 0x00000000), + width: 1 + .rpx, ), - style: - TextStyle( - fontFamily: - 'Readex Pro', - letterSpacing: - 0, + borderRadius: + BorderRadius.circular( + AppConstants().normal_container_radius), + ), + focusedBorder: + OutlineInputBorder( + borderSide: + BorderSide( + color: Colors + .transparent, + width: 1 + .rpx, ), - ); - })), + borderRadius: + BorderRadius.circular( + 8.rpx), + ), + errorBorder: + OutlineInputBorder( + borderSide: + BorderSide( + // + width: 1 + .rpx, + ), + borderRadius: + BorderRadius.circular( + 8.rpx), + ), + focusedErrorBorder: + OutlineInputBorder( + borderSide: + BorderSide( + // + width: 1 + .rpx, + ), + borderRadius: + BorderRadius.circular( + 8.rpx), + ), + ), + style: TextStyle( + letterSpacing: + 0, + color: Colors + .black, + fontSize: + 26.rpx), + ), + ), ), ].divide(SizedBox( width: 26.rpx)), @@ -708,124 +679,107 @@ class ApplyRepairPage extends GetView { ), Expanded( child: Container( - width: 100, - height: 100, - decoration: - BoxDecoration( - color: const Color( - 0xFFF3F5F6), - borderRadius: - BorderRadius - .circular(8), - ), - child: - Obx(() { - return TextFormField( - // autofocus: true, - controller: - controller - .onReDraw( - TextEditingController( - text: - controller.model.device_id ?? ""), - (value) => - { - value.text = - controller.model.device_id ?? "" - }, - ), - onChanged: - (value) { - controller + width: 100, + height: 100, + decoration: + BoxDecoration( + color: const Color( + 0xFFF3F5F6), + borderRadius: + BorderRadius + .circular( + 8), + ), + child: + TextFormField( + // autofocus: true, + onChanged: + (value) { + controller .model - .device_id = value; - }, - // initialValue: - // controller - // .model - // .device_id, - obscureText: - false, - decoration: - InputDecoration( - labelStyle: - TextStyle( - fontFamily: - 'Readex Pro', - letterSpacing: - 0, - ), - hintStyle: - TextStyle( - fontFamily: - 'Readex Pro', - letterSpacing: - 0, - ), - enabledBorder: - UnderlineInputBorder( - borderSide: - const BorderSide( - color: - Color(0x00000000), - width: - 2, - ), - borderRadius: - BorderRadius.circular(8), - ), - focusedBorder: - UnderlineInputBorder( - borderSide: - const BorderSide( - color: - Color(0x00000000), - width: - 2, - ), - borderRadius: - BorderRadius.circular(8), - ), - errorBorder: - UnderlineInputBorder( - borderSide: - const BorderSide( - color: - Color(0x00000000), - width: - 2, - ), - borderRadius: - BorderRadius.circular(8), - ), - focusedErrorBorder: - UnderlineInputBorder( - borderSide: - const BorderSide( - color: - Color(0x00000000), - width: - 2, - ), - borderRadius: - BorderRadius.circular(8), - ), - contentPadding: const EdgeInsetsDirectional - .fromSTEB( - 10, - 0, - 10, - 18), + .device_id = + value; + }, + obscureText: + false, + decoration: + InputDecoration( + isDense: + true, + labelStyle: + const TextStyle( + fontFamily: + 'Readex Pro', + letterSpacing: + 0, + ), + hintStyle: + const TextStyle( + fontFamily: + 'Readex Pro', + letterSpacing: + 0, + ), + enabledBorder: + OutlineInputBorder( + borderSide: + BorderSide( + color: const Color( + 0x00000000), + width: 1 + .rpx, ), - style: - TextStyle( - fontFamily: - 'Readex Pro', - letterSpacing: - 0, + borderRadius: + BorderRadius.circular( + AppConstants().normal_container_radius), + ), + focusedBorder: + OutlineInputBorder( + borderSide: + BorderSide( + color: Colors + .transparent, + width: 1 + .rpx, ), - ); - })), + borderRadius: + BorderRadius.circular( + 8.rpx), + ), + errorBorder: + OutlineInputBorder( + borderSide: + BorderSide( + // + width: 1 + .rpx, + ), + borderRadius: + BorderRadius.circular( + 8.rpx), + ), + focusedErrorBorder: + OutlineInputBorder( + borderSide: + BorderSide( + // + width: 1 + .rpx, + ), + borderRadius: + BorderRadius.circular( + 8.rpx), + ), + ), + style: TextStyle( + letterSpacing: + 0, + color: Colors + .black, + fontSize: + 26.rpx), + ), + ), ), ].divide(SizedBox( width: 26.rpx)), @@ -853,7 +807,7 @@ class ApplyRepairPage extends GetView { minHeight: 345.rpx, ), decoration: BoxDecoration( - color: Color(0XFF003058), + color: const Color(0XFF003058), borderRadius: BorderRadius.circular(16.rpx), ), @@ -862,7 +816,7 @@ class ApplyRepairPage extends GetView { width: bodysize!.maxWidth, height: bodysize!.maxHeight * 0.17, decoration: BoxDecoration( - color: Color(0XFF003058), + color: const Color(0XFF003058), borderRadius: BorderRadius.circular(16.rpx), ), @@ -881,41 +835,43 @@ class ApplyRepairPage extends GetView { 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, - // ); - // } - // } + print(apiResponse); + if (apiResponse.code == + HttpStatusCodes.ok) { + print(controller.model); + // setState(() { + // controller.model['path'] = apiResponse.data['path']; + // }); + controller.model.issue_img! + .add(apiResponse + .data['path']); + repairController.repairList + .refresh(); // 通知 Obx 更新(如果用了 GetX) + print(controller.model); + } else { + if (controller.model + .issue_img == + null || + controller + .model + .issue_img! + .isEmpty) { + TopSlideNotification.show( + context, + text: apiResponse.msg!, + textColor: apiResponse + .code == + HttpStatusCodes + .ok + ? themeController + .currentColor + .sc2 + : themeController + .currentColor + .sc9, + ); + } + } }, child: Container( width: @@ -1022,7 +978,8 @@ class ApplyRepairPage extends GetView { const BoxConstraints( minHeight: 250, ), - decoration: BoxDecoration( + decoration: + const BoxDecoration( color: Colors.white, ), child: Column( @@ -1046,8 +1003,9 @@ class ApplyRepairPage extends GetView { 0.2, height: 21, decoration: - BoxDecoration( - color: Colors.white, + const BoxDecoration( + color: + Colors.white, ), child: Container( width: MediaQuery @@ -1057,8 +1015,9 @@ class ApplyRepairPage extends GetView { 0.2, height: 21, decoration: - BoxDecoration( - color: Colors.white, + const BoxDecoration( + color: Colors + .white, ), child: Row( mainAxisSize: @@ -1139,15 +1098,17 @@ class ApplyRepairPage extends GetView { minHeight: 152, ), decoration: - BoxDecoration( - color: Colors.white, + const BoxDecoration( + color: + Colors.white, ), child: Container( width: 100, height: 100, decoration: - BoxDecoration( - color: Colors.white, + const BoxDecoration( + color: Colors + .white, ), child: Obx(() => ListView( shrinkWrap: true, @@ -1184,7 +1145,7 @@ class ApplyRepairPage extends GetView { minHeight: 345.rpx, ), decoration: BoxDecoration( - color: Color(0xFF003058), + color: const Color(0xFF003058), borderRadius: BorderRadius.circular(16.rpx), ), @@ -1253,21 +1214,21 @@ class ApplyRepairPage extends GetView { decoration: InputDecoration( hintText: '问题描述(100个字以内)', labelStyle: TextStyle( - fontFamily: - 'Readex Pro', - fontSize: AppFontsize - .normal_text_size, - letterSpacing: 0, - color: Color( - 0XFF929699)), + fontFamily: + 'Readex Pro', + fontSize: AppFontsize + .normal_text_size, + letterSpacing: 0, + color: const Color( + 0XFF929699)), hintStyle: TextStyle( - fontFamily: - 'Readex Pro', - fontSize: AppFontsize - .normal_text_size, - letterSpacing: 0, - color: Color( - 0XFF929699)), + fontFamily: + 'Readex Pro', + fontSize: AppFontsize + .normal_text_size, + letterSpacing: 0, + color: const Color( + 0XFF929699)), enabledBorder: UnderlineInputBorder( borderSide: @@ -1352,7 +1313,7 @@ class ApplyRepairPage extends GetView { minHeight: 345.rpx, ), decoration: BoxDecoration( - color: Color(0XFF003058), + color: const Color(0XFF003058), borderRadius: BorderRadius.circular(16), ), child: Column( @@ -1368,12 +1329,12 @@ class ApplyRepairPage extends GetView { child: Text( '联系方式', style: TextStyle( - fontFamily: 'Readex Pro', - color: Colors.white, - fontSize: 30.rpx, - letterSpacing: 0, - fontWeight: FontWeight.w600, - ), + fontFamily: 'Readex Pro', + color: Colors.white, + fontSize: 30.rpx, + letterSpacing: 0, + fontWeight: FontWeight.w600, + ), ), ), ), @@ -1471,91 +1432,83 @@ class ApplyRepairPage extends GetView { .apply_name = value; }, - initialValue: - controller - .model - .apply_name, obscureText: false, - textAlignVertical: - TextAlignVertical - .center, decoration: InputDecoration( - contentPadding: - const EdgeInsetsDirectional - .fromSTEB( - 10, - 10, - 10, - 14), - labelStyle: TextStyle( - fontFamily: - 'Readex Pro', - letterSpacing: - 0, - ), - hintStyle: TextStyle( - fontFamily: - 'Readex Pro', - letterSpacing: - 0, - ), + isDense: true, + labelStyle: + const TextStyle( + fontFamily: + 'Readex Pro', + letterSpacing: + 0, + ), + hintStyle: + const TextStyle( + fontFamily: + 'Readex Pro', + letterSpacing: + 0, + ), enabledBorder: - UnderlineInputBorder( + OutlineInputBorder( borderSide: - const BorderSide( - color: Color( + BorderSide( + color: const Color( 0x00000000), - width: 2, + width: + 1.rpx, ), borderRadius: - BorderRadius - .circular(8), + BorderRadius.circular( + AppConstants().normal_container_radius), ), focusedBorder: - UnderlineInputBorder( + OutlineInputBorder( borderSide: - const BorderSide( - color: Color( - 0x00000000), - width: 2, + BorderSide( + color: Colors + .transparent, + width: + 1.rpx, ), borderRadius: - BorderRadius - .circular(8), + BorderRadius.circular( + 8.rpx), ), errorBorder: - UnderlineInputBorder( + OutlineInputBorder( borderSide: - const BorderSide( - color: Color( - 0x00000000), - width: 2, + BorderSide( + // + width: + 1.rpx, ), borderRadius: - BorderRadius - .circular(8), + BorderRadius.circular( + 8.rpx), ), focusedErrorBorder: - UnderlineInputBorder( + OutlineInputBorder( borderSide: - const BorderSide( - color: Color( - 0x00000000), - width: 2, + BorderSide( + // + width: + 1.rpx, ), borderRadius: - BorderRadius - .circular(8), + BorderRadius.circular( + 8.rpx), ), ), style: TextStyle( - fontFamily: - 'Readex Pro', - letterSpacing: - 0, - ), + letterSpacing: + 0, + color: Colors + .black, + fontSize: + 26.rpx), ), ), ), @@ -1635,91 +1588,83 @@ class ApplyRepairPage extends GetView { .tel = value; }, - initialValue: - controller - .model - .tel, obscureText: false, - textAlignVertical: - TextAlignVertical - .center, decoration: InputDecoration( - contentPadding: - const EdgeInsetsDirectional - .fromSTEB( - 10, - 10, - 10, - 14), - labelStyle: TextStyle( - fontFamily: - 'Readex Pro', - letterSpacing: - 0, - ), - hintStyle: TextStyle( - fontFamily: - 'Readex Pro', - letterSpacing: - 0, - ), + isDense: true, + labelStyle: + const TextStyle( + fontFamily: + 'Readex Pro', + letterSpacing: + 0, + ), + hintStyle: + const TextStyle( + fontFamily: + 'Readex Pro', + letterSpacing: + 0, + ), enabledBorder: - UnderlineInputBorder( + OutlineInputBorder( borderSide: - const BorderSide( - color: Color( + BorderSide( + color: const Color( 0x00000000), - width: 2, + width: + 1.rpx, ), borderRadius: - BorderRadius - .circular(8), + BorderRadius.circular( + AppConstants().normal_container_radius), ), focusedBorder: - UnderlineInputBorder( + OutlineInputBorder( borderSide: - const BorderSide( - color: Color( - 0x00000000), - width: 2, + BorderSide( + color: Colors + .transparent, + width: + 1.rpx, ), borderRadius: - BorderRadius - .circular(8), + BorderRadius.circular( + 8.rpx), ), errorBorder: - UnderlineInputBorder( + OutlineInputBorder( borderSide: - const BorderSide( - color: Color( - 0x00000000), - width: 2, + BorderSide( + // + width: + 1.rpx, ), borderRadius: - BorderRadius - .circular(8), + BorderRadius.circular( + 8.rpx), ), focusedErrorBorder: - UnderlineInputBorder( + OutlineInputBorder( borderSide: - const BorderSide( - color: Color( - 0x00000000), - width: 2, + BorderSide( + // + width: + 1.rpx, ), borderRadius: - BorderRadius - .circular(8), + BorderRadius.circular( + 8.rpx), ), ), style: TextStyle( - fontFamily: - 'Readex Pro', - letterSpacing: - 0, - ), + letterSpacing: + 0, + color: Colors + .black, + fontSize: + 26.rpx), ), ), ), @@ -1757,12 +1702,11 @@ class ApplyRepairPage extends GetView { borderRadius: 16.rpx, gradientDirection: GradientDirection.vertical, onTap: () async { - Get.toNamed("/applyRepairSuccess"); - // TopSlideNotification.show( - // context, - // text: "功能开发中...", - // ); - + TopSlideNotification.show( + context, + text: "功能开发中...", + ); + // Get.toNamed("/applyRepairSuccess"); // String msg = checkRepairParam(); // if (msg.isNotEmpty) { // TopSlideNotification.show(context, @@ -1804,7 +1748,7 @@ class ApplyRepairPage extends GetView { // themeController.currentColor.sc9); // }, // ); - // } + //} }, colors: const [ Color(0xFFFCFCFC), @@ -1937,7 +1881,7 @@ class ApplyRepairPage extends GetView { WidgetsBinding.instance.addPostFrameCallback((_) { Scrollable.ensureVisible( key.currentContext!, - duration: Duration(milliseconds: 300), + duration: const Duration(milliseconds: 300), curve: Curves.easeInOut, ); }); diff --git a/lib/pages/mh_page/bluetooth.dart b/lib/pages/mh_page/bluetooth.dart index 01e5344..0075f95 100644 --- a/lib/pages/mh_page/bluetooth.dart +++ b/lib/pages/mh_page/bluetooth.dart @@ -84,7 +84,8 @@ class BluetoothPage extends GetView { highlightColor: const Color(0xFF055466), padding: EdgeInsets.only(left: 0), onTap: () { - Get.toNamed("/editBedPage"); + Get.toNamed("/editBedPage", + arguments: data); }, child: Container( width: 42.rpx, @@ -135,7 +136,7 @@ class BluetoothPage extends GetView { context, '人员资料', "/peopleInfoPage", arguments: data), _buildMenuButton( - context, '房间选择', "/roomPickerPage"), + context, '房间选择', "/roomPickerPage",arguments: data), _buildMenuButton(context, '设备校准', ""), _buildMenuButton(context, '体征传感器', ""), _buildMenuButton(context, 'WIFI配置', ""), diff --git a/lib/pages/mh_page/device/device.dart b/lib/pages/mh_page/device/device.dart index 2a798e0..2ba275a 100644 --- a/lib/pages/mh_page/device/device.dart +++ b/lib/pages/mh_page/device/device.dart @@ -6,6 +6,7 @@ import 'package:flutterflow_ui/flutterflow_ui.dart'; import 'package:vbvs_app/common/color/appFontsize.dart'; import 'package:vbvs_app/common/util/FitTool.dart'; import 'package:vbvs_app/common/util/MyUtils.dart'; +import 'package:vbvs_app/component/tool/TopSlideNotification.dart'; import 'package:vbvs_app/controller/main_bottom/global_controller.dart'; import 'package:vbvs_app/controller/mh_controller/device_list_controller.dart'; @@ -115,25 +116,25 @@ class DeviceInfoWidget extends GetView { letterSpacing: 0, height: 1), ), - TextSpan( - text: - ' (${deviceListController.model.deviceList[index]['status'] ?? ''})', - style: TextStyle( - fontFamily: 'Readex Pro', - color: deviceListController - .model - .deviceList[ - index] - ['status'] == - '在线' - ? Color( - 0xFF07C160) // 在线的颜色 - : Color( - 0xFFEA7CA7), // 离线的颜色 - fontSize: 26.rpx, - letterSpacing: 0, - ), - ), + // TextSpan( + // text: + // ' (${deviceListController.model.deviceList[index]['status'] ?? ''})', + // style: TextStyle( + // fontFamily: 'Readex Pro', + // color: deviceListController + // .model + // .deviceList[ + // index] + // ['status'] == + // '在线' + // ? Color( + // 0xFF07C160) // 在线的颜色 + // : Color( + // 0xFFEA7CA7), // 离线的颜色 + // fontSize: 26.rpx, + // letterSpacing: 0, + // ), + // ), ], ), maxLines: 1, // 限制显示一行 @@ -196,7 +197,7 @@ class DeviceInfoWidget extends GetView { color: Color(0XFF85F5FF), textStyle: TextStyle( fontFamily: 'Readex Pro', - color: Colors.white, + color: Color(0xFF011D33), fontSize: 28.rpx, letterSpacing: 0, ), @@ -238,11 +239,12 @@ class DeviceInfoWidget extends GetView { children: [ InkWell( onTap: () async { - if (device['type'] == 1) { - globalController.model.deviceMain = device; - await Get.toNamed("/deviceShare"); - globalController.getDeviceList(); - } + await Get.toNamed("/deviceSharePage"); + // if (device['type'] == 1) { + // globalController.model.deviceMain = device; + // await Get.toNamed("/deviceSharePage"); + // globalController.getDeviceList(); + // } }, child: Container( height: MediaQuery.sizeOf(context).height * 0.1, @@ -351,11 +353,15 @@ class DeviceInfoWidget extends GetView { ), InkWell( onTap: () { - var a = [device["bindMacA"]]; - if ("${device["bindMacB"]}".length > 6) { - a.add(device["bindMacB"]); - } - Get.toNamed("/sleepWebview", arguments: a); + TopSlideNotification.show( + context, + text: "功能开发中...", + ); + // var a = [device["bindMacA"]]; + // if ("${device["bindMacB"]}".length > 6) { + // a.add(device["bindMacB"]); + // } + // Get.toNamed("/sleepWebview", arguments: a); }, child: Container( height: MediaQuery.sizeOf(context).height * 0.1, diff --git a/lib/pages/mh_page/device_list.dart b/lib/pages/mh_page/device_list.dart index 85b91fc..f200b5c 100644 --- a/lib/pages/mh_page/device_list.dart +++ b/lib/pages/mh_page/device_list.dart @@ -33,108 +33,107 @@ class _DeviceListPageState extends State { return LayoutBuilder(builder: (context, cc) { bodysize = cc; return GestureDetector( - onTap: () => FocusScope.of(context).unfocus(), - child: Scaffold( - resizeToAvoidBottomInset: false, - appBar: AppBar( - backgroundColor: Colors.transparent, - automaticallyImplyLeading: false, - iconTheme: IconThemeData(color: Colors.white), - titleSpacing: 0, - // leading: returnIconButtomAddCallback(() { - // controller.saveDataApi(); - // updateParm(isShowToast: false); - // }), - // leading: returnIconButtomNew, - title: Container( - width: double.infinity, - height: 180.rpx, - child: Stack( - alignment: Alignment.center, - children: [ - // 中间居中的标题 - Text( - '设备列表', - textAlign: TextAlign.center, - style: TextStyle( - color: Colors.white, - fontSize: 30.rpx, - ), - ), - // 左侧图标 - Positioned( - left: 20.rpx, - child: returnIconButtomNew, - ), - ], - ), + onTap: () => FocusScope.of(context).unfocus(), + child: Container( + decoration: const BoxDecoration( + image: DecorationImage( + image: AssetImage('assets/images/new_background.png'), // 本地图片 + fit: BoxFit.fill, // 填满整个 Container ), - - actions: [], - centerTitle: false, ), - backgroundColor: Colors.transparent, - body: Stack( - children: [ - Positioned.fill( - child: Image.asset( - 'assets/images/new_background.png', - fit: BoxFit.fill, - ), - ), - Column( - mainAxisSize: MainAxisSize.max, - children: [ - Padding( - padding: EdgeInsetsDirectional.fromSTEB(0, 10, 0, 23), - child: SearchWidget( - keyword: controller.model.keyword, - color: controller.model.color, - hint: "检索设备", - onChange: (d) { - controller.model.keyword = d; - }, - findCallback: () { - controller.getDeviceList(); - }, - ), - ), - Obx(() { - if (controller.model.deviceList == null || - controller.model.deviceList.isEmpty) { - return Expanded(child: NullDataWidget()); - } - - // 如果 deviceList 不为空,渲染列表 - return Expanded( - child: ListView( - shrinkWrap: true, - scrollDirection: Axis.vertical, - children: controller.model.deviceList - .asMap() - .entries - .map((e) => DeviceInfoWidget( - index: e.key, - deviceListController: controller, - )) - .toList() - .divide(const SizedBox(height: 10)) - .addToEnd(const SizedBox(height: 100)), + child: Scaffold( + resizeToAvoidBottomInset: false, + appBar: AppBar( + backgroundColor: Colors.transparent, + automaticallyImplyLeading: false, + iconTheme: IconThemeData(color: Colors.white), + titleSpacing: 0, + // leading: returnIconButtomAddCallback(() { + // controller.saveDataApi(); + // updateParm(isShowToast: false); + // }), + // leading: returnIconButtomNew, + title: Container( + width: double.infinity, + height: 180.rpx, + child: Stack( + alignment: Alignment.center, + children: [ + // 中间居中的标题 + Text( + '设备列表', + textAlign: TextAlign.center, + style: TextStyle( + color: Colors.white, + fontSize: 30.rpx, + ), ), - ); - }), - ], + // 左侧图标 + Positioned( + left: 20.rpx, + child: returnIconButtomNew, + ), + ], + ), + ), + + actions: [], + centerTitle: false, ), - ], - ) + backgroundColor: Colors.transparent, + body: Container( + child: Column( + mainAxisSize: MainAxisSize.max, + children: [ + Padding( + padding: EdgeInsetsDirectional.fromSTEB(0, 10, 0, 23), + child: SearchWidget( + keyword: controller.model.keyword, + color: controller.model.color, + hint: "检索设备", + onChange: (d) { + controller.model.keyword = d; + }, + findCallback: () { + controller.getDeviceList(); + }, + ), + ), + Obx(() { + if (controller.model.deviceList == null || + controller.model.deviceList.isEmpty) { + return Expanded(child: NullDataWidget()); + } - // Container( - // width: bodysize!.maxWidth, - // height: bodysize!.maxHeight, + // 如果 deviceList 不为空,渲染列表 + return Expanded( + child: ListView( + shrinkWrap: true, + scrollDirection: Axis.vertical, + children: controller.model.deviceList + .asMap() + .entries + .map((e) => DeviceInfoWidget( + index: e.key, + deviceListController: controller, + )) + .toList() + .divide(const SizedBox(height: 10)) + .addToEnd(const SizedBox(height: 100)), + ), + ); + }), + ], + ), + ) - // ), - ), - ); + // Container( + // width: bodysize!.maxWidth, + // height: bodysize!.maxHeight, + + // ), + ), + )); }); } } diff --git a/lib/pages/mh_page/device_people_info.dart b/lib/pages/mh_page/device_people_info.dart index 6b1ce1e..f3b971c 100644 --- a/lib/pages/mh_page/device_people_info.dart +++ b/lib/pages/mh_page/device_people_info.dart @@ -35,9 +35,6 @@ 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/device_share_page.dart b/lib/pages/mh_page/device_share_page.dart index 1315d8e..9a4d110 100644 --- a/lib/pages/mh_page/device_share_page.dart +++ b/lib/pages/mh_page/device_share_page.dart @@ -434,22 +434,30 @@ class ShareDeviceWidget extends GetView { letterSpacing: 0.0, ), ), - Radio( - value: 1, - groupValue: controller.model.type, - onChanged: (value) { - controller.model.type = value!; - controller.updateAll(); - }, - activeColor: - const Color(0xFF6BFDAC), - materialTapTargetSize: - MaterialTapTargetSize - .shrinkWrap, // 减少内边距 - visualDensity: VisualDensity( - horizontal: -4, - vertical: -4), // 缩小视觉密度 - ) + Theme( + data: + Theme.of(context).copyWith( + unselectedWidgetColor: Color( + 0xFFC8CBD2), // 改变未选中状态边框颜色 + ), + child: Radio( + value: 1, + groupValue: + controller.model.type, + onChanged: (value) { + controller.model.type = + value!; + controller.updateAll(); + }, + activeColor: + const Color(0xFF6BFDAC), + materialTapTargetSize: + MaterialTapTargetSize + .shrinkWrap, // 减少内边距 + visualDensity: VisualDensity( + horizontal: -4, + vertical: -4), // 缩小视觉密度 + )) ], ), ), @@ -485,22 +493,30 @@ class ShareDeviceWidget extends GetView { letterSpacing: 0.0, ), ), - Radio( - value: 2, - groupValue: controller.model.type, - onChanged: (value) { - controller.model.type = value!; - controller.updateAll(); - }, - activeColor: - const Color(0xFF6BFDAC), - materialTapTargetSize: - MaterialTapTargetSize - .shrinkWrap, // 减少内边距 - visualDensity: VisualDensity( - horizontal: -4, - vertical: -4), // 缩小视觉密度 - ) + Theme( + data: + Theme.of(context).copyWith( + unselectedWidgetColor: Color( + 0xFFC8CBD2), // 改变未选中状态边框颜色 + ), + child: Radio( + value: 2, + groupValue: + controller.model.type, + onChanged: (value) { + controller.model.type = + value!; + controller.updateAll(); + }, + activeColor: + const Color(0xFF6BFDAC), + materialTapTargetSize: + MaterialTapTargetSize + .shrinkWrap, // 减少内边距 + visualDensity: VisualDensity( + horizontal: -4, + vertical: -4), // 缩小视觉密度 + )) ], ), ), diff --git a/lib/pages/mh_page/edit_address_page.dart b/lib/pages/mh_page/edit_address_page.dart index c639c08..2100c6e 100644 --- a/lib/pages/mh_page/edit_address_page.dart +++ b/lib/pages/mh_page/edit_address_page.dart @@ -1,6 +1,6 @@ import 'package:ef/ef.dart'; import 'package:flutter/material.dart'; -import 'package:flutter_city_picker/city_picker.dart'; +import 'package:flutter_city_picker/listener/picker_listener.dart'; import 'package:flutter_city_picker/model/address.dart'; import 'package:flutterflow_ui/flutterflow_ui.dart'; @@ -11,6 +11,7 @@ import 'package:vbvs_app/common/util/MyUtils.dart'; import 'package:vbvs_app/component/tool/CustomCard.dart'; import 'package:vbvs_app/controller/mh_controller/address_controller.dart'; import 'package:vbvs_app/controller/mh_controller/address_list_controller.dart'; +import 'package:vbvs_app/pages/mh_page/homepage/component/citypicker.dart'; class EditAddressPage extends GetView implements CityPickerListener { @@ -36,12 +37,12 @@ class EditAddressPage extends GetView AddressListController addressListController = Get.find(); var address = Map.from(addressListController.model.address); - controller.model.ischecked = address['isChecked']; + controller.model.default_ = address['default']; controller.model.all_address = getAddressDesc(address); - controller.model.detail = address['detail']; + controller.model.address = address['address']; controller.model.name = address['name']; - controller.model.phone = address['phone']; - controller.model.ischecked = address['isChecked']; + controller.model.tel = address['tel']; + return LayoutBuilder(builder: (context, cc) { bodysize = cc; return GestureDetector( @@ -61,11 +62,6 @@ class EditAddressPage extends GetView automaticallyImplyLeading: false, iconTheme: IconThemeData(color: Colors.white), titleSpacing: 0, - // leading: returnIconButtomAddCallback(() { - // controller.saveDataApi(); - // updateParm(isShowToast: false); - // }), - // leading: returnIconButtomNew, title: Container( width: double.infinity, height: 180.rpx, @@ -89,7 +85,6 @@ class EditAddressPage extends GetView ], ), ), - actions: [], centerTitle: false, ), @@ -181,38 +176,34 @@ class EditAddressPage extends GetView -1, 0), child: Text( '地址信息', - style: TextStyle( - fontFamily: - 'Readex Pro', - color: Colors - .white, - fontSize: - AppFontsize - .title_size, - letterSpacing: - 0, - fontWeight: - FontWeight - .w600, - ), + style: + TextStyle( + fontFamily: + 'Readex Pro', + color: Colors + .white, + fontSize: + AppFontsize + .title_size, + letterSpacing: + 0, + fontWeight: + FontWeight + .w600, + ), ), ), ), ), Container( - width: - MediaQuery.sizeOf( - context) - .width * - 0.17, height: MediaQuery.sizeOf( context) .height * 0.038, constraints: - const BoxConstraints( - maxWidth: 55, + BoxConstraints( + minWidth: 104.rpx, ), decoration: BoxDecoration(), @@ -238,8 +229,10 @@ class EditAddressPage extends GetView 0), child: Container( - width: 18, - height: 18, + width: + 60.rpx, + height: + 60.rpx, decoration: const BoxDecoration(), child: @@ -248,51 +241,73 @@ class EditAddressPage extends GetView const AlignmentDirectional( 0, 0), - child: Theme( - data: ThemeData( - checkboxTheme: - CheckboxThemeData( - visualDensity: VisualDensity.compact, - materialTapTargetSize: MaterialTapTargetSize.shrinkWrap, - shape: RoundedRectangleBorder( - borderRadius: BorderRadius.circular(64), - ), + child: + Theme( + data: + ThemeData( + checkboxTheme: + CheckboxThemeData( + visualDensity: + VisualDensity.compact, + materialTapTargetSize: + MaterialTapTargetSize.shrinkWrap, + shape: + RoundedRectangleBorder( + borderRadius: BorderRadius.circular(64), ), - unselectedWidgetColor: - const Color(0xFFD3D3D3), ), - child: Obx(() { - return Checkbox( - value: controller.model.ischecked, - onChanged: (newValue) async { - controller.model.ischecked = newValue; - controller.updateAll(); - }, - side: BorderSide( - width: 1.5, - color:Colors.white, - ), - activeColor: const Color(0xFF84F5FF), - checkColor: Color(0xFF011D33), - ); - })), + unselectedWidgetColor: + const Color(0xFFD3D3D3), + ), + child: Obx( + () { + return Checkbox( + value: + controller.model.default_ == 1, + onChanged: + (newValue) { + controller.model.default_ = (newValue ?? false) ? 1 : 0; + controller.updateAll(); + }, + side: + const BorderSide( + width: 1.5, + color: Colors.white, + ), + activeColor: + const Color(0xFF84F5FF), + checkColor: + const Color(0xFF011D33), + // Add this to prevent double triggers + materialTapTargetSize: + MaterialTapTargetSize.shrinkWrap, + ); + }), + ), ), ), ), ), - Text( - '默认', - style: TextStyle( - fontFamily: - 'Readex Pro', - fontSize: - AppFontsize - .normal_text_size, - letterSpacing: - 0, - color: Color( - 0XFF84F5FF)), - ), + Obx( + () => Text( + '默认', + style: + TextStyle( + fontFamily: + 'Readex Pro', + fontSize: + 26.rpx, + letterSpacing: + 0, + color: controller.model.default_ == + 1 + ? const Color( + 0XFF84F5FF) + : Colors + .white, + ), + ), + ) ], ), ), @@ -344,15 +359,15 @@ class EditAddressPage extends GetView Text( '收件人', style: TextStyle( - fontFamily: - 'Readex Pro', - fontSize: - AppFontsize - .normal_text_size, - letterSpacing: - 0, - color: Colors - .white), + fontFamily: + 'Readex Pro', + fontSize: + AppFontsize + .normal_text_size, + letterSpacing: + 0, + color: Colors + .white), ), ], ), @@ -379,200 +394,34 @@ class EditAddressPage extends GetView controller.model .name = val; }, + initialValue: address[ 'name'], decoration: InputDecoration( contentPadding: - const EdgeInsetsDirectional - .fromSTEB( - 10, - 0, - 10, - 18), - labelStyle: TextStyle( - fontFamily: - 'Readex Pro', - letterSpacing: - 0, - ), - hintStyle: TextStyle( - fontFamily: - 'Readex Pro', - letterSpacing: - 0, - ), - enabledBorder: - UnderlineInputBorder( - borderSide: - const BorderSide( - color: Color( - 0x00000000), - width: 2, - ), - borderRadius: - BorderRadius - .circular( - 8), + EdgeInsets + .symmetric( + vertical: + 25.rpx, + horizontal: + 26.rpx, ), - focusedBorder: - UnderlineInputBorder( - borderSide: - const BorderSide( - color: Color( - 0x00000000), - width: 2, - ), - borderRadius: - BorderRadius - .circular( - 8), + labelStyle: + TextStyle( + fontFamily: + 'Readex Pro', + letterSpacing: + 0, ), - errorBorder: - UnderlineInputBorder( - borderSide: - const BorderSide( - color: Color( - 0x00000000), - width: 2, - ), - borderRadius: - BorderRadius - .circular( - 8), + hintStyle: + TextStyle( + fontFamily: + 'Readex Pro', + letterSpacing: + 0, ), - focusedErrorBorder: - UnderlineInputBorder( - borderSide: - const BorderSide( - color: Color( - 0x00000000), - width: 2, - ), - borderRadius: - BorderRadius - .circular( - 8), - ), - ), - style:TextStyle( - fontFamily: - 'Readex Pro', - letterSpacing: - 0, - ), - ), - ), - ), - ].divide(const SizedBox( - width: 15)), - ), - ), - 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: - MediaQuery.sizeOf( - context) - .width * - 0.17, - height: - MediaQuery.sizeOf( - context) - .height * - 0.038, - constraints: - BoxConstraints( - minWidth: - 105.rpx, - maxWidth: - 105.rpx), - decoration: - BoxDecoration(), - child: Row( - mainAxisSize: - MainAxisSize - .max, - children: [ - Text( - '手机号', - style: TextStyle( - fontFamily: - 'Readex Pro', - fontSize: - AppFontsize - .normal_text_size, - letterSpacing: - 0, - color: Colors - .white, - ), - ), - ], - ), - ), - Expanded( - child: Container( - width: 100, - height: 100, - decoration: - BoxDecoration( - borderRadius: - BorderRadius - .circular( - 8), - color: - Colors.white, - ), - child: - TextFormField( - // autofocus: true, - onChanged: (val) { - controller.model - .phone = - val; - }, - obscureText: - false, - initialValue: - address[ - 'phone'], - decoration: - InputDecoration( - contentPadding: - const EdgeInsetsDirectional - .fromSTEB( - 10, - 0, - 10, - 18), - labelStyle: TextStyle( - fontFamily: - 'Readex Pro', - letterSpacing: - 0, - ), - hintStyle: TextStyle( - fontFamily: - 'Readex Pro', - letterSpacing: - 0, - ), enabledBorder: UnderlineInputBorder( borderSide: @@ -627,11 +476,195 @@ class EditAddressPage extends GetView ), ), style: TextStyle( - fontFamily: - 'Readex Pro', - letterSpacing: - 0, + fontFamily: + 'Readex Pro', + letterSpacing: + 0, + color: Colors + .black, + fontSize: + 26.rpx, + ), + ), + ), + ), + ].divide(const SizedBox( + width: 15)), + ), + ), + 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: + MediaQuery.sizeOf( + context) + .width * + 0.17, + height: + MediaQuery.sizeOf( + context) + .height * + 0.038, + constraints: + BoxConstraints( + minWidth: + 105.rpx, + maxWidth: + 105.rpx), + decoration: + BoxDecoration(), + child: Row( + mainAxisSize: + MainAxisSize + .max, + children: [ + Text( + '手机号', + style: + TextStyle( + fontFamily: + 'Readex Pro', + fontSize: + AppFontsize + .normal_text_size, + letterSpacing: + 0, + color: Colors + .white, + ), + ), + ], + ), + ), + Expanded( + child: Container( + width: 100, + height: 100, + decoration: + BoxDecoration( + borderRadius: + BorderRadius + .circular( + 8), + color: + Colors.white, + ), + child: + TextFormField( + // autofocus: true, + onChanged: (val) { + controller.model + .tel = val; + }, + textAlignVertical: + TextAlignVertical + .center, // 垂直居中 + obscureText: + false, + initialValue: + address[ + 'tel'], + decoration: + InputDecoration( + contentPadding: + EdgeInsets + .symmetric( + vertical: + 25.rpx, + horizontal: + 26.rpx, + ), + labelStyle: + TextStyle( + fontFamily: + 'Readex Pro', + letterSpacing: + 0, + ), + hintStyle: + TextStyle( + fontFamily: + 'Readex Pro', + letterSpacing: + 0, + ), + enabledBorder: + UnderlineInputBorder( + borderSide: + const BorderSide( + color: Color( + 0x00000000), + width: 2, ), + borderRadius: + BorderRadius + .circular( + 8), + ), + focusedBorder: + UnderlineInputBorder( + borderSide: + const BorderSide( + color: Color( + 0x00000000), + width: 2, + ), + borderRadius: + BorderRadius + .circular( + 8), + ), + errorBorder: + UnderlineInputBorder( + borderSide: + const BorderSide( + color: Color( + 0x00000000), + width: 2, + ), + borderRadius: + BorderRadius + .circular( + 8), + ), + focusedErrorBorder: + UnderlineInputBorder( + borderSide: + const BorderSide( + color: Color( + 0x00000000), + width: 2, + ), + borderRadius: + BorderRadius + .circular( + 8), + ), + ), + style: TextStyle( + fontFamily: + 'Readex Pro', + letterSpacing: + 0, + color: Colors + .black, + fontSize: + 26.rpx, + ), ), ), ), @@ -678,27 +711,29 @@ class EditAddressPage extends GetView .max, children: [ InkWell( - // onTap: () { - // CityPicker - // .show( - // context: - // context, - // cityPickerListener: - // this, - // ); - // }, + onTap: () { + // CityPicker + // .show( + // context: + // context, + // cityPickerListener: + // this, + // ); + }, child: Text( '所在地区', - style: TextStyle( - fontFamily: - 'Readex Pro', - fontSize: - AppFontsize.normal_text_size, - letterSpacing: - 0, - color: Colors - .white, - ), + style: + TextStyle( + fontFamily: + 'Readex Pro', + fontSize: + AppFontsize + .normal_text_size, + letterSpacing: + 0, + color: Colors + .white, + ), ), ), ], @@ -712,6 +747,8 @@ class EditAddressPage extends GetView context, cityPickerListener: this, + // 在大屏/Web 上最大宽度为 600px + // 移除内边距 ); }, child: Container( @@ -726,6 +763,9 @@ class EditAddressPage extends GetView .circular( 8), ), + alignment: + Alignment + .center, child: Obx(() { return TextFormField( enabled: @@ -735,23 +775,35 @@ class EditAddressPage extends GetView text: controller.model.all_address), (val) { - val.text = controller - .model - .all_address; + val.text = + controller.model.all_address ?? + ""; }), // autofocus: true, obscureText: false, + textAlignVertical: + TextAlignVertical + .center, // 垂直居中 decoration: InputDecoration( - contentPadding: const EdgeInsetsDirectional.fromSTEB(10, 0, 10, 18), + contentPadding: EdgeInsets.symmetric( + vertical: + 25.rpx, + horizontal: + 26.rpx, + ), labelStyle: TextStyle( - fontFamily: 'Readex Pro', - letterSpacing: 0, - ), + fontFamily: + 'Readex Pro', + letterSpacing: + 0, + ), hintStyle: TextStyle( - fontFamily: 'Readex Pro', - letterSpacing: 0, - ), + fontFamily: + 'Readex Pro', + letterSpacing: + 0, + ), enabledBorder: UnderlineInputBorder( borderSide: const BorderSide( @@ -814,17 +866,25 @@ class EditAddressPage extends GetView Icon( Icons.arrow_forward_ios, color: - Colors.white, + Colors.black, size: - 12, + 26.rpx, ), )), - style: TextStyle( - fontFamily: - 'Readex Pro', - letterSpacing: - 0, - ), + style: + TextStyle( + fontFamily: + 'Readex Pro', + letterSpacing: + 0, + color: Color( + 0xFF333333), + fontSize: + 26.rpx, + overflow: + TextOverflow + .ellipsis, + ), ); })), ), @@ -882,7 +942,7 @@ class EditAddressPage extends GetView children: [ Text( '详细地址', - style:TextStyle( + style: TextStyle( fontFamily: 'Readex Pro', fontSize: @@ -934,36 +994,39 @@ class EditAddressPage extends GetView (val) { controller .model - .detail = + .address = val; }, initialValue: address[ - 'detail'], + 'address'], maxLines: 2, obscureText: false, decoration: InputDecoration( contentPadding: - const EdgeInsetsDirectional - .fromSTEB( - 10, - 10, - 10, - 10), - labelStyle: TextStyle( - fontFamily: - 'Readex Pro', - letterSpacing: - 0, - ), - hintStyle: TextStyle( - fontFamily: - 'Readex Pro', - letterSpacing: - 0, - ), + EdgeInsets + .symmetric( + vertical: + 10.rpx, + horizontal: + 26.rpx, + ), + labelStyle: + TextStyle( + fontFamily: + 'Readex Pro', + letterSpacing: + 0, + ), + hintStyle: + TextStyle( + fontFamily: + 'Readex Pro', + letterSpacing: + 0, + ), enabledBorder: UnderlineInputBorder( borderSide: @@ -1013,12 +1076,17 @@ class EditAddressPage extends GetView .circular(8), ), ), - style: TextStyle( - fontFamily: - 'Readex Pro', - letterSpacing: - 0, - ), + style: + TextStyle( + fontFamily: + 'Readex Pro', + letterSpacing: + 0, + color: Colors + .black, + fontSize: + 26.rpx, + ), ), ), ), @@ -1049,42 +1117,43 @@ class EditAddressPage extends GetView child: CustomCard( borderRadius: 16.rpx, gradientDirection: GradientDirection.vertical, - onTap: () { - // if (controller.model.all_address == null || - // controller.model.all_address!.isEmpty) { - // showToast("地址不能为空"); - // return; - // } - // if (controller.model.name == null || - // controller.model.name!.isEmpty) { - // showToast("名字不能为空"); - // return; - // } - // if (controller.model.detail == null || - // controller.model.detail!.isEmpty) { - // showToast("详细地址不能为空"); - // return; - // } - // if (controller.model.phone == null || - // controller.model.phone!.isEmpty) { - // showToast("手机号不能为空"); - // return; - // } - // if (!MyUtils.isValidPhoneNumber( - // controller.model.phone!)) { - // showToast("无效的手机号码"); - // return; - // } - // if (addressListController.model.type == 1) { - // await controller.addAddress(controller.model); - // } else { - // await controller.updateAddress( - // address, controller.model); - // } - // await addressListController.getAddressList(); - // Get.back(); - // controller.model = AddressModel(); - // controller.updateAll(); + onTap: () async { + if (controller.model.all_address == null || + controller.model.all_address!.isEmpty) { + showToast("地址不能为空"); + return; + } + if (controller.model.name == null || + controller.model.name!.isEmpty) { + showToast("名字不能为空"); + return; + } + if (controller.model.address == null || + controller.model.address!.isEmpty) { + showToast("详细地址不能为空"); + return; + } + if (controller.model.tel == null || + controller.model.tel!.isEmpty) { + showToast("手机号不能为空"); + return; + } + if (!MyUtils.isValidPhoneNumber( + controller.model.tel!)) { + showToast("无效的手机号码"); + return; + } + if (addressListController.model.type == 1) { + await controller.addAddress( + controller.model, context); + } else { + await controller.updateAddress( + address, controller.model); + } + await addressListController.getAddressList(); + Get.back(); + controller.model = AddressModel(); + controller.updateAll(); }, colors: const [ Color(0xFFFCFCFC), @@ -1103,98 +1172,14 @@ class EditAddressPage extends GetView child: Text( "保存", style: TextStyle( - fontFamily: 'Readex Pro', - color: stringToColor("#011D33"), - letterSpacing: 0, - fontSize: 30.rpx, - ), + fontFamily: 'Readex Pro', + color: stringToColor("#011D33"), + letterSpacing: 0, + fontSize: 30.rpx, + ), ), ), - ) - - // Container( - // width: bodysize!.maxWidth, - // height: bodysize!.maxHeight * 0.056, - // decoration: BoxDecoration( - // color: FlutterFlowTheme.of(context) - // .secondaryBackground, - // ), - // child: - - // Container( - // width: bodysize!.maxWidth, - // height: bodysize!.maxHeight * 0.056, - // decoration: BoxDecoration( - // color: FlutterFlowTheme.of(context) - // .secondaryBackground, - // borderRadius: BorderRadius.circular(12), - // ), - // child: FFButtonWidget( - // onPressed: () async { - // // if (controller.model.all_address == null || - // // controller.model.all_address!.isEmpty) { - // // showToast("地址不能为空"); - // // return; - // // } - // // if (controller.model.name == null || - // // controller.model.name!.isEmpty) { - // // showToast("名字不能为空"); - // // return; - // // } - // // if (controller.model.detail == null || - // // controller.model.detail!.isEmpty) { - // // showToast("详细地址不能为空"); - // // return; - // // } - // // if (controller.model.phone == null || - // // controller.model.phone!.isEmpty) { - // // showToast("手机号不能为空"); - // // return; - // // } - // // if (!MyUtils.isValidPhoneNumber( - // // controller.model.phone!)) { - // // showToast("无效的手机号码"); - // // return; - // // } - // // if (addressListController.model.type == 1) { - // // await controller.addAddress(controller.model); - // // } else { - // // await controller.updateAddress( - // // address, controller.model); - // // } - // // await addressListController.getAddressList(); - // // Get.back(); - // // controller.model = AddressModel(); - // // controller.updateAll(); - // }, - // text: '确定', - // options: FFButtonOptions( - // height: 40, - // padding: const EdgeInsetsDirectional.fromSTEB( - // 24, 0, 24, 0), - // iconPadding: - // const EdgeInsetsDirectional.fromSTEB( - // 0, 0, 0, 0), - // color: const Color(0xFFD3B684), - // textStyle: FlutterFlowTheme.of(context) - // .titleSmall - // .override( - // fontFamily: 'Readex Pro', - // color: Colors.white, - // fontSize: AppFontsize.normal_text_size, - // letterSpacing: 0, - // ), - // elevation: 0, - // borderSide: const BorderSide( - // color: Colors.transparent, - // width: 1, - // ), - // borderRadius: BorderRadius.circular(6), - // ), - // ), - // ), - // ), - ), + )), ], ), ), @@ -1205,28 +1190,9 @@ class EditAddressPage extends GetView @override Future> onDataLoad( int index, String code, String name) async { - debugPrint("onDataLoad ---> $index $name"); + debugPrint("onDataLoad ---> index=$index, code=$code, name=$name"); - if (index == 0) { - await Future.delayed(const Duration(milliseconds: 200)); - return HttpUtils.getCityData("", index); - } else { - if (controller.model.currentType == 0) { - return Future.value([]); - } else if (controller.model.currentType == 1) { - if (index == 2) { - return Future.value([]); - } - return HttpUtils.getCityData(code, index); - } else if (controller.model.currentType == 2) { - if (index == 3) { - return Future.value([]); - } - return HttpUtils.getCityData(code, index); - } else { - return HttpUtils.getCityData(code, index); - } - } + return HttpUtils.getCityData(code, index); } @override @@ -1268,20 +1234,28 @@ class EditAddressPage extends GetView } } +// class HttpUtils { +// static Future> getCityData(String code, int index) async { +// final AddressController addressController = Get.find(); +// addressController.model.currentType = 1; + +// if (code.isEmpty) { +// addressController.updateAll(); +// return addressController.getData(); +// } +// addressController.model.currentType = index + 1; +// //控制选择区域层级 1.省 2.市 3.区 4.街道 +// if (addressController.model.currentType > 3) { +// return []; +// } +// return addressController.getData(); +// } +// } class HttpUtils { static Future> getCityData(String code, int index) async { - final AddressController addressController = Get.find(); - addressController.model.currentType = 1; + final AddressController controller = Get.find(); + controller.model.currentType = index; - if (code.isEmpty) { - addressController.updateAll(); - return addressController.getData(level: 0); - } - addressController.model.currentType = index + 1; - //控制选择区域层级 1.省 2.市 3.区 4.街道 - if (addressController.model.currentType > 3) { - return []; - } - return addressController.getData(pid: int.parse(code)); + return controller.getData(parentCode: code, level: index); } } diff --git a/lib/pages/mh_page/edit_bed.dart b/lib/pages/mh_page/edit_bed.dart index b056d80..1d64fd8 100644 --- a/lib/pages/mh_page/edit_bed.dart +++ b/lib/pages/mh_page/edit_bed.dart @@ -188,7 +188,7 @@ class _EditBedPageState extends State { ServiceConstant.service_address; String serviceName = ServiceConstant.server_service; - String serviceApi = ServiceConstant.person_info; + String serviceApi = ServiceConstant.device_show; String queryUrl = "$serviceAddress$serviceName$serviceApi"; await requestWithLog( @@ -196,10 +196,12 @@ class _EditBedPageState extends State { method: MyHttpMethod.put, queryUrl: queryUrl, data: { - "id": editedData["id"], + "id": editedData["_id"], "name": editedData["name"], }, - onSuccess: (res) {}, + onSuccess: (res) { + '更新人员信息成功: $res'; + }, ); }, colors: const [ diff --git a/lib/pages/mh_page/homepage/component/citypicker.dart b/lib/pages/mh_page/homepage/component/citypicker.dart new file mode 100644 index 0000000..ab62fd8 --- /dev/null +++ b/lib/pages/mh_page/homepage/component/citypicker.dart @@ -0,0 +1,105 @@ +import 'package:flutter/material.dart'; +import 'package:flutter_city_picker/listener/picker_listener.dart'; +import 'package:flutter_city_picker/model/address.dart'; +import 'package:flutter_city_picker/view/city_picker.dart'; + +class CityPicker { + /// 展示 + static void show({ + required BuildContext context, + AnimationController? animController, + double opacity = 0.5, + bool dismissible = true, + double height = 500.0, + double titleHeight = 50.0, + double corner = 20.0, + Color? backgroundColor, + double paddingLeft = 15.0, + Widget? titleWidget, + String? selectText, + Widget? closeWidget, + double tabHeight = 40.0, + bool showTabIndicator = true, + double tabPadding = 10.0, + Color? tabIndicatorColor, + double tabIndicatorHeight = 3.0, + double labelTextSize = 15.0, + Color? selectedLabelColor, + Color? unselectedLabelColor, + double itemHeadHeight = 30.0, + Color? itemHeadBackgroundColor, + Color? itemHeadLineColor, + double itemHeadLineHeight = 0.1, + TextStyle? itemHeadTextStyle, + double itemHeight = 40.0, + double indexBarWidth = 28, + double indexBarItemHeight = 20, + Color indexBarBackgroundColor = Colors.black12, + TextStyle? indexBarTextStyle, + Widget? itemSelectedIconWidget, + TextStyle? itemSelectedTextStyle, + TextStyle? itemUnSelectedTextStyle, + List? initialAddress, + required CityPickerListener cityPickerListener, + }) { + showGeneralDialog( + context: context, + barrierColor: Colors.black.withOpacity(opacity), + barrierDismissible: dismissible, + barrierLabel: MaterialLocalizations.of(context).modalBarrierDismissLabel, + transitionDuration: const Duration(milliseconds: 300), + pageBuilder: (context, animation, secondaryAnimation) { + return Align( + alignment: Alignment.bottomCenter, + child: Material( + color: Colors.transparent, + child: Container( + width: MediaQuery.of(context).size.width, + height: height, + decoration: BoxDecoration( + color: backgroundColor ?? Colors.white, + borderRadius: BorderRadius.only( + topLeft: Radius.circular(corner), + topRight: Radius.circular(corner), + ), + ), + child: CityPickerWidget( + height: height, + titleHeight: titleHeight, + corner: corner, + backgroundColor: backgroundColor, + paddingLeft: paddingLeft, + titleWidget: titleWidget, + selectText: selectText, + closeWidget: closeWidget, + tabHeight: tabHeight, + showTabIndicator: showTabIndicator, + tabPadding: tabPadding, + tabIndicatorColor: tabIndicatorColor, + tabIndicatorHeight: tabIndicatorHeight, + labelTextSize: labelTextSize, + selectedLabelColor: selectedLabelColor, + unselectedLabelColor: unselectedLabelColor, + itemHeadHeight: itemHeadHeight, + itemHeadBackgroundColor: itemHeadBackgroundColor, + itemHeadLineColor: itemHeadLineColor, + itemHeadLineHeight: itemHeadLineHeight, + itemHeadTextStyle: itemHeadTextStyle, + itemHeight: itemHeight, + indexBarWidth: indexBarWidth, + indexBarItemHeight: indexBarItemHeight, + indexBarBackgroundColor: indexBarBackgroundColor, + indexBarTextStyle: indexBarTextStyle, + itemSelectedIconWidget: itemSelectedIconWidget, + itemSelectedTextStyle: itemSelectedTextStyle, + itemUnSelectedTextStyle: itemUnSelectedTextStyle, + initialAddress: initialAddress, + cityPickerListener: cityPickerListener, + ), + ), + ), + ); + }, + ); + } +} \ No newline at end of file diff --git a/lib/pages/mh_page/homepage/new_Home_page.dart b/lib/pages/mh_page/homepage/new_Home_page.dart index 1ac7cf7..f88b6dc 100644 --- a/lib/pages/mh_page/homepage/new_Home_page.dart +++ b/lib/pages/mh_page/homepage/new_Home_page.dart @@ -142,7 +142,7 @@ class _NewHomePageState extends State { }), const Spacer(), // 左右分隔 FloatingSvgIcon( - assetPath: 'assets/img/icon/xiaoe.svg', + assetPath: 'assets/img/icon/xiaoyi.svg', width: 60.rpx, height: 60.rpx, onTap: () { @@ -463,7 +463,7 @@ class _NewHomePageState extends State { ), fillColor: stringToColor( - "#184468"), + "##011D33"), elevation: 2, borderColor: Colors.transparent, @@ -482,6 +482,7 @@ class _NewHomePageState extends State { isMultiSelect: false, ), ), + ), InkWell( onTap: () { @@ -559,7 +560,8 @@ class _NewHomePageState extends State { .value .length, (index) { var day = homeController - .homeSleepDays[index]; + .homeSleepDays[ + index]; bool isSelected = homeController .selectedDayIndex @@ -607,7 +609,7 @@ class _NewHomePageState extends State { BoxDecoration( color: isSelected ? stringToColor( - "#184468") + "#011D33") : Colors .transparent, borderRadius: diff --git a/lib/pages/mh_page/people_info.dart b/lib/pages/mh_page/people_info.dart index 72b0233..175bc7d 100644 --- a/lib/pages/mh_page/people_info.dart +++ b/lib/pages/mh_page/people_info.dart @@ -28,10 +28,6 @@ class PeopleInfoPage extends GetView { PeopleInfoController controller = Get.put(PeopleInfoController()); @override Widget build(BuildContext context) { - // 初始化只做一次 - WidgetsBinding.instance.addPostFrameCallback((_) { - controller.initData(data['mac']); - }); return LayoutBuilder( builder: (context, boxConstraints) => GestureDetector( onTap: () { @@ -175,529 +171,705 @@ class PeopleInfoPage extends GetView { body: SafeArea( top: true, child: Container( - padding: EdgeInsets.only(left: 30.rpx, right: 30.rpx), - width: MediaQuery.sizeOf(context).width, - height: MediaQuery.sizeOf(context).height * 1.123, - // decoration: BoxDecoration( - // color: Colors.transparent, - // image: DecorationImage( - // image: AssetImage("assets/images/background.png"), - // fit: BoxFit.cover, - // ), - // ), - child: SingleChildScrollView( - child: Column( - children: [ - if (controller.model.peopleList.isNotEmpty) - ...List.generate(controller.model.peopleList.length, - (index) { - final person = controller.model.peopleList[index]; - String location_ = ''; - // if ("${data["bindMacB"]}".length > 6 && - // (person["direction"] == 1 || - // person["direction"] == 2)) { - // location_ = person["direction"] == 1 ? '左侧' : '右侧'; - // } - return Column( - mainAxisSize: MainAxisSize.max, - crossAxisAlignment: CrossAxisAlignment.start, + padding: EdgeInsets.only(left: 30.rpx, right: 30.rpx), + width: MediaQuery.sizeOf(context).width, + height: MediaQuery.sizeOf(context).height * 1.123, + // decoration: BoxDecoration( + // color: Colors.transparent, + // image: DecorationImage( + // image: AssetImage("assets/images/background.png"), + // fit: BoxFit.cover, + // ), + // ), + child: SingleChildScrollView( + child: Obx(() => Column( children: [ - Container( - margin: EdgeInsets.only( - left: 18.rpx, - top: index == 0 ? 30.rpx : 90.rpx, - bottom: 20.rpx), - child: Text( - "人员资料${index == 0 ? "A" : "B"}", - style: TextStyle( - color: Colors.white, fontSize: 30.rpx), - ), - ), - Container( - child: Column( - children: [ - getLine(), - Obx( - () => Container( - width: double.infinity, - height: 90.rpx, + if (controller.model.peopleList.isNotEmpty) + ...List.generate( + controller.model.peopleList.length, + (index) { + final person = + controller.model.peopleList[index]; + String location_ = ''; + // if ("${data["bindMacB"]}".length > 6 && + // (person["direction"] == 1 || + // person["direction"] == 2)) { + // location_ = person["direction"] == 1 ? '左侧' : '右侧'; + // } + return Column( + mainAxisSize: MainAxisSize.max, + crossAxisAlignment: + CrossAxisAlignment.start, + children: [ + Container( margin: EdgeInsets.only( - left: 40.rpx, right: 35.rpx), - decoration: BoxDecoration(), - child: Row( - mainAxisSize: MainAxisSize.max, - mainAxisAlignment: - MainAxisAlignment.spaceBetween, - children: [ - Text( - '姓名', - style: TextStyle( - fontFamily: 'Readex Pro', - color: Color(0xFF9EA4B7), - fontSize: 30.rpx, - letterSpacing: 0, - ), - ), - Container( - width: 300.rpx, - child: TextField( - obscureText: false, - textAlign: TextAlign.right, - style: TextStyle( - fontSize: 30.rpx, - color: Colors.white), - decoration: - const InputDecoration( - fillColor: - Colors.transparent, - filled: true, - hintText: "请输入姓名", - hintStyle: TextStyle( - color: - Colors.white), - border: - InputBorder.none, - contentPadding: - EdgeInsets.all(0)), - onChanged: (value) { - controller.model - .peopleList[index] - ["name"] = value; - }, - controller: controller.onReDraw( - TextEditingController( - text: controller.model - .peopleList[ - index] - ["name"] ?? - ""), - (textEditingController) { - textEditingController - .text = controller.model - .peopleList[index] - ["name"] ?? - ""; - }, "people_name_$index"), - ), - ), - ], + left: 18.rpx, + top: index == 0 ? 30.rpx : 90.rpx, + bottom: 20.rpx), + child: Text( + "人员资料${index == 0 ? "A" : "B"}", + style: TextStyle( + color: Colors.white, + fontSize: 30.rpx), ), ), - ), - getLine(), - Obx( - () => Container( - margin: EdgeInsets.only( - left: 40.rpx, right: 35.rpx), - width: double.infinity, - height: 90.rpx, - decoration: BoxDecoration(), - child: Row( - mainAxisSize: MainAxisSize.max, - mainAxisAlignment: - MainAxisAlignment.spaceBetween, + Container( + child: Column( children: [ - Text( - '性别', - style: TextStyle( - fontFamily: 'Readex Pro', - color: Color(0xFF9EA4B7), - fontSize: 30.rpx, - letterSpacing: 0, + getLine(), + Obx( + () => Container( + width: double.infinity, + height: 90.rpx, + margin: EdgeInsets.only( + left: 40.rpx, + right: 35.rpx), + decoration: BoxDecoration(), + child: Row( + mainAxisSize: + MainAxisSize.max, + mainAxisAlignment: + MainAxisAlignment + .spaceBetween, + children: [ + Text( + '姓名', + style: TextStyle( + fontFamily: + 'Readex Pro', + color: + Color(0xFF9EA4B7), + fontSize: 30.rpx, + letterSpacing: 0, + ), + ), + Container( + width: 300.rpx, + child: TextField( + obscureText: false, + textAlign: + TextAlign.right, + style: TextStyle( + fontSize: 30.rpx, + color: + Colors.white), + decoration: + const InputDecoration( + fillColor: Colors + .transparent, + filled: true, + hintText: + "请输入姓名", + hintStyle: TextStyle( + color: Colors + .white), + border: + InputBorder + .none, + contentPadding: + EdgeInsets + .all( + 0)), + onChanged: (value) { + controller.model + .peopleList[ + index] + ["name"] = value; + }, + controller: controller.onReDraw( + TextEditingController( + text: controller + .model + .peopleList[index] + [ + "name"] ?? + ""), + (textEditingController) { + textEditingController + .text = controller + .model + .peopleList[ + index]["name"] ?? + ""; + }, "people_name_$index"), + ), + ), + ], + ), ), ), - InkWell( - onTap: () { - // 触摸收起键盘 - FocusScope.of(context) - .requestFocus(FocusNode()); - Future.delayed( - const Duration( - milliseconds: 250), () { - // 延迟执行的代码 - showOneSelectionDialog( - context, - arr: ["女", "男"], - checkIndex: controller + getLine(), + Obx( + () => Container( + margin: EdgeInsets.only( + left: 40.rpx, + right: 35.rpx), + width: double.infinity, + height: 90.rpx, + decoration: BoxDecoration(), + child: InkWell( + onTap: () { + // 触摸收起键盘 + FocusScope.of(context) + .requestFocus( + FocusNode()); + Future.delayed( + const Duration( + milliseconds: + 250), () { + // 延迟执行的代码 + showOneSelectionDialog( + context, + arr: ["女", "男"], + checkIndex: controller + .model + .peopleList[index] + [ + 'gender'] == + "女" + ? 0 + : 1, + checkChange: + (sindex) { + controller.model.peopleList[ + index] + ['gender'] = + sindex; // 👈 保存为 0 / 1 + controller + .updateAll(); + print( + "gender $sindex"); + }).then((d) { + // Timer(Duration.zero, () { + // FocusScope.of(context).unfocus(); + // }); + }); + }); + }, + child: Row( + mainAxisSize: + MainAxisSize.max, + mainAxisAlignment: + MainAxisAlignment + .spaceBetween, + children: [ + Text( + '性别', + style: TextStyle( + fontFamily: + 'Readex Pro', + color: Color( + 0xFF9EA4B7), + fontSize: 30.rpx, + letterSpacing: 0, + ), + ), + Row( + mainAxisSize: + MainAxisSize.max, + children: [ + Container( + width: 200.rpx, + child: Text( + '${controller.model.peopleList[index]['gender'] == 1 ? '男' : '女'}', + textAlign: + TextAlign + .right, + style: + TextStyle( + fontFamily: + 'Readex Pro', + color: Colors + .white, + fontSize: + 30.rpx, + letterSpacing: + 0, + ), + ), + ), + SizedBox( + width: 16.rpx, + ), + Icon( + Icons.expand_more, + color: + Colors.white, + size: 48.rpx, + ), + ], + ), + ], + ), + )), + ), + getLine(), + // Container( + // width: double.infinity, + // height: 90.rpx, + // margin: EdgeInsets.only( + // left: 40.rpx, right: 35.rpx), + // decoration: BoxDecoration(), + // child: Row( + // mainAxisSize: MainAxisSize.max, + // mainAxisAlignment: + // MainAxisAlignment.spaceBetween, + // children: [ + // Text( + // '身高(cm)', + // style: TextStyle( + // fontFamily: 'Readex Pro', + // color: Color(0xFF9EA4B7), + // fontSize: 30.rpx, + // letterSpacing: 0, + // ), + // ), + // InkWell( + // onTap: () { + // FocusScope.of(context).unfocus(); + // Future.delayed( + // const Duration( + // milliseconds: 250), () { + // showHeightPickerDialog( + // context, + // initialHeight: controller + // .model + // .peopleList[index] + // ['height'] ?? + // 170, + // onConfirm: + // (int selectedHeight) { + // controller.model.peopleList[ + // index]['height'] = + // selectedHeight + // .toString(); + // controller.updateAll(); + // print( + // "身高: $selectedHeight cm"); + // }, + // ); + // }); + // }, + // child: Row( + // children: [ + // Text( + // controller.model.peopleList[ + // index] + // ['height'] != + // null + // ? "${controller.model.peopleList[index]['height']} cm" + // : '', + // style: TextStyle( + // fontFamily: 'Readex Pro', + // color: Colors.white, + // fontSize: 30.rpx, + // ), + // ), + // SizedBox(width: 16.rpx), + // Icon(Icons.expand_more, + // color: Colors.white, + // size: 48.rpx), + // ], + // ), + // ), + // ], + // ), + // ), + Container( + width: double.infinity, + height: 90.rpx, + margin: EdgeInsets.only( + left: 40.rpx, + right: 35.rpx), + decoration: BoxDecoration(), + child: InkWell( + onTap: () { + FocusScope.of(context) + .unfocus(); + Future.delayed( + const Duration( + milliseconds: 250), + () { + // Convert string height to int for initial value + final currentHeight = + controller.model + .peopleList[ + index]['height']; + final initialHeight = + currentHeight != null + ? int.tryParse( + currentHeight + .toString()) ?? + 170 + : 170; + + showHeightPickerDialog( + context, + initialHeight: + initialHeight, + onConfirm: (int + selectedHeight) { + controller.model.peopleList[ + index] + ['height'] = + selectedHeight + .toString(); + controller + .updateAll(); + print( + "身高: $selectedHeight cm"); + }, + ); + }); + }, + child: Row( + mainAxisSize: + MainAxisSize.max, + mainAxisAlignment: + MainAxisAlignment + .spaceBetween, + children: [ + Text( + '身高(cm)', + style: TextStyle( + fontFamily: + 'Readex Pro', + color: + Color(0xFF9EA4B7), + fontSize: 30.rpx, + letterSpacing: 0, + ), + ), + Row( + children: [ + Text( + controller.model.peopleList[ + index] + [ + 'height'] != + null + ? "${controller.model.peopleList[index]['height']} cm" + : '', + style: TextStyle( + fontFamily: + 'Readex Pro', + color: + Colors.white, + fontSize: 30.rpx, + ), + ), + SizedBox( + width: 16.rpx), + Icon( + Icons.expand_more, + color: + Colors.white, + size: 48.rpx), + ], + ), + ], + ), + )), + getLine(), + Obx( + () => Container( + width: double.infinity, + height: 90.rpx, + margin: EdgeInsets.only( + left: 40.rpx, + right: 35.rpx), + decoration: BoxDecoration(), + child: InkWell( + onTap: () { + FocusScope.of(context) + .unfocus(); + Future.delayed( + const Duration( + milliseconds: + 250), () { + showWeightPickerDialog( + context, + initialWeight: controller .model .peopleList[ index] - ['gender'] == - "女" - ? 0 - : 1, - checkChange: (sindex) { - controller.model.peopleList[ - index]['gender'] = - sindex; // 👈 保存为 0 / 1 - controller.updateAll(); - print("gender $sindex"); - }).then((d) { - // Timer(Duration.zero, () { - // FocusScope.of(context).unfocus(); - // }); - }); - }); - }, - child: Row( - mainAxisSize: MainAxisSize.max, - children: [ - Container( - width: 200.rpx, - child: Text( - '${controller.model.peopleList[index]['gender'] == 1 ? '男' : '女'}', - textAlign: - TextAlign.right, - style: TextStyle( - fontFamily: - 'Readex Pro', - color: Colors.white, - fontSize: 30.rpx, - letterSpacing: 0, - ), + ['weight'] ?? + "", + onConfirm: (int + selectedWeight) { + controller.model.peopleList[ + index] + ['weight'] = + selectedWeight + .toString(); // ✅ 转成字符串 + controller + .updateAll(); + print( + "体重: $selectedWeight kg"); + }, + ); + }); + }, + child: Row( + mainAxisSize: + MainAxisSize.max, + mainAxisAlignment: + MainAxisAlignment + .spaceBetween, + children: [ + Text( + '体重(kg)', + style: TextStyle( + fontFamily: + 'Readex Pro', + color: Color( + 0xFF9EA4B7), + fontSize: 30.rpx, + letterSpacing: 0, + ), + ), + Row( + children: [ + Text( + controller.model.peopleList[ + index] + [ + 'weight'] != + null + ? "${controller.model.peopleList[index]['weight']} kg" + : '', + style: TextStyle( + fontFamily: + 'Readex Pro', + color: Colors + .white, + fontSize: + 30.rpx, + ), + ), + SizedBox( + width: 16.rpx), + Icon( + Icons + .expand_more, + color: Colors + .white, + size: 48.rpx), + ], + ), + ], ), - ), - SizedBox( - width: 16.rpx, - ), - Icon( - Icons.expand_more, - color: Colors.white, - size: 48.rpx, - ), - ], - ), + )), ), - ], - ), - ), - ), - getLine(), - Container( - width: double.infinity, - height: 90.rpx, - margin: EdgeInsets.only( - left: 40.rpx, right: 35.rpx), - decoration: BoxDecoration(), - child: Row( - mainAxisSize: MainAxisSize.max, - mainAxisAlignment: - MainAxisAlignment.spaceBetween, - children: [ - Text( - '身高(cm)', - style: TextStyle( - fontFamily: 'Readex Pro', - color: Color(0xFF9EA4B7), - fontSize: 30.rpx, - letterSpacing: 0, - ), - ), - InkWell( - onTap: () { - FocusScope.of(context).unfocus(); - Future.delayed( - const Duration( - milliseconds: 250), () { - showHeightPickerDialog( - context, - initialHeight: controller - .model - .peopleList[index] - ['height'] ?? - 170, - onConfirm: - (int selectedHeight) { - controller.model.peopleList[ - index]['height'] = - selectedHeight - .toString(); - controller.updateAll(); - print( - "身高: $selectedHeight cm"); - }, - ); - }); - }, - child: Row( - children: [ - Text( - controller.model.peopleList[ - index] - ['height'] != - null - ? "${controller.model.peopleList[index]['height']} cm" - : '', - style: TextStyle( - fontFamily: 'Readex Pro', - color: Colors.white, - fontSize: 30.rpx, - ), - ), - SizedBox(width: 16.rpx), - Icon(Icons.expand_more, - color: Colors.white, - size: 48.rpx), - ], - ), - ), - ], - ), - ), - getLine(), - Container( - width: double.infinity, - height: 90.rpx, - margin: EdgeInsets.only( - left: 40.rpx, right: 35.rpx), - decoration: BoxDecoration(), - child: Row( - mainAxisSize: MainAxisSize.max, - mainAxisAlignment: - MainAxisAlignment.spaceBetween, - children: [ - Text( - '体重(kg)', - style: TextStyle( - fontFamily: 'Readex Pro', - color: Color(0xFF9EA4B7), - fontSize: 30.rpx, - letterSpacing: 0, - ), - ), - InkWell( - onTap: () { - FocusScope.of(context).unfocus(); - Future.delayed( - const Duration( - milliseconds: 250), () { - showWeightPickerDialog( - context, - initialWeight: controller - .model - .peopleList[index] - ['weight'] ?? - "", - onConfirm: - (int selectedWeight) { - controller.model.peopleList[ - index]['weight'] = - selectedWeight - .toString(); // ✅ 转成字符串 - controller.updateAll(); - print( - "体重: $selectedWeight kg"); - }, - ); - }); - }, - child: Row( - children: [ - Text( - controller.model.peopleList[ - index] - ['weight'] != - null - ? "${controller.model.peopleList[index]['weight']} kg" - : '', - style: TextStyle( - fontFamily: 'Readex Pro', - color: Colors.white, - fontSize: 30.rpx, - ), - ), - SizedBox(width: 16.rpx), - Icon(Icons.expand_more, - color: Colors.white, - size: 48.rpx), - ], - ), - ), - ], - ), - ), - getLine(), - Obx( - () => Container( - width: double.infinity, - height: 90.rpx, - margin: EdgeInsets.only( - left: 40.rpx, right: 35.rpx), - decoration: BoxDecoration(), - child: Row( - mainAxisSize: MainAxisSize.max, - mainAxisAlignment: - MainAxisAlignment.spaceBetween, - children: [ - Text( - '生日', - style: TextStyle( - fontFamily: 'Readex Pro', - color: Color(0xFF9EA4B7), - fontSize: 30.rpx, - letterSpacing: 0, - ), - ), - InkWell( - onTap: () { - // 触摸收起键盘 - FocusScope.of(context) - .requestFocus(FocusNode()); - Future.delayed( - const Duration( - milliseconds: 250), () { - // 延迟执行的代码 - showDateSelectionDialog( - context, - checkDate: controller - .model - .peopleList[index] - ['birthday'] - is DateTime - ? controller.model - .peopleList[index] - ['birthday'] - : DateTime.tryParse( - controller.model.peopleList[index]['birthday'] ?? - '') ?? - DateTime.now(), - checkChange: (DateTime d) { - controller.model - .peopleList[index] - ['birthday'] = d; - controller.updateAll(); - print("$d"); - }).then((d) { - // Timer(Duration.zero, () { - // FocusScope.of(context).unfocus(); - // }); - }); - }); - }, - child: Row( - mainAxisSize: MainAxisSize.max, - children: [ - Container( - constraints: BoxConstraints( - minWidth: 200.rpx), - child: Text( - controller.model.peopleList[ - index][ - 'birthday'] != - null - ? time_08_Formatter_pattern( - controller.model - .peopleList[ - index] - ['birthday'], - "yyyy年MM月dd日") - : '', - textAlign: - TextAlign.right, - style: TextStyle( - fontFamily: - 'Readex Pro', - color: Colors.white, - fontSize: 30.rpx, - letterSpacing: 0, - ), - ), - ), - SizedBox( - width: 16.rpx, - ), - Icon( - Icons.expand_more, - color: Colors.white, - size: 48.rpx, - ), - ], - ), - ), - ], - ), - ), - ), - getLine(), - Container( - width: double.infinity, - height: 90.rpx, - margin: EdgeInsets.only( - left: 40.rpx, right: 35.rpx), - decoration: BoxDecoration(), - child: Row( - mainAxisSize: MainAxisSize.max, - mainAxisAlignment: - MainAxisAlignment.spaceBetween, - children: [ - Text( - '联系人', - style: TextStyle( - fontFamily: 'Readex Pro', - color: Color(0xFF9EA4B7), - fontSize: 30.rpx, - letterSpacing: 0, - ), - ), - Container( - width: 300.rpx, - child: TextField( - obscureText: false, - keyboardType: - TextInputType.number, - textInputAction: - TextInputAction.done, - textAlign: TextAlign.right, - style: TextStyle( - fontSize: 30.rpx, - color: Colors.white), - decoration: InputDecoration( - fillColor: Colors.transparent, - filled: true, - hintText: "请输入联系人", - hintStyle: TextStyle( - color: Colors.white), - border: InputBorder.none, - contentPadding: - EdgeInsets.all(0)), - onChanged: (value) { - controller - .model.peopleList[index] - ['contact'] = value; - controller.updateAll(); - }, - controller: controller.onReDraw( - TextEditingController( - text: controller.model + + getLine(), + Obx( + () => Container( + width: double.infinity, + height: 90.rpx, + margin: EdgeInsets.only( + left: 40.rpx, + right: 35.rpx), + decoration: BoxDecoration(), + child: InkWell( + onTap: () { + // 触摸收起键盘 + FocusScope.of(context) + .requestFocus( + FocusNode()); + Future.delayed( + const Duration( + milliseconds: + 250), () { + // 延迟执行的代码 + showDateSelectionDialog( + context, + checkDate: controller + .model + .peopleList[index]['birthday'] + is DateTime + ? controller + .model + .peopleList[index] + ['birthday'] + : DateTime.tryParse( + controller.model.peopleList[index]['birthday'] ?? + '') ?? + DateTime.now(), + checkChange: + (DateTime d) { + controller.model .peopleList[ index] - ['contact'] ?? - ""), - (textEditingController) { - textEditingController - .text = controller.model - .peopleList[index] - ['contact'] ?? - ""; - }, "contact_$index"), + ['birthday'] = d; + controller + .updateAll(); + print("$d"); + }).then((d) { + // Timer(Duration.zero, () { + // FocusScope.of(context).unfocus(); + // }); + }); + }); + }, + child: Row( + mainAxisSize: + MainAxisSize.max, + mainAxisAlignment: + MainAxisAlignment + .spaceBetween, + children: [ + Text( + '生日', + style: TextStyle( + fontFamily: + 'Readex Pro', + color: Color( + 0xFF9EA4B7), + fontSize: 30.rpx, + letterSpacing: 0, + ), + ), + Row( + mainAxisSize: + MainAxisSize.max, + children: [ + Container( + constraints: + BoxConstraints( + minWidth: + 200.rpx), + child: Text( + controller.model.peopleList[index] + [ + 'birthday'] != + null + ? time_08_Formatter_pattern( + controller + .model + .peopleList[index]['birthday'], + "yyyy年MM月dd日") + : '', + textAlign: + TextAlign + .right, + style: + TextStyle( + fontFamily: + 'Readex Pro', + color: Colors + .white, + fontSize: + 30.rpx, + letterSpacing: + 0, + ), + ), + ), + SizedBox( + width: 16.rpx, + ), + Icon( + Icons.expand_more, + color: + Colors.white, + size: 48.rpx, + ), + ], + ), + ], + ), + )), ), - ), - ], - ), - ), - getLine(), - ], - ), - ) + getLine(), + Container( + width: double.infinity, + height: 90.rpx, + margin: EdgeInsets.only( + left: 40.rpx, right: 35.rpx), + decoration: BoxDecoration(), + child: Row( + mainAxisSize: MainAxisSize.max, + mainAxisAlignment: + MainAxisAlignment + .spaceBetween, + children: [ + Text( + '联系人', + style: TextStyle( + fontFamily: 'Readex Pro', + color: Color(0xFF9EA4B7), + fontSize: 30.rpx, + letterSpacing: 0, + ), + ), + Container( + width: 300.rpx, + child: TextField( + obscureText: false, + keyboardType: + TextInputType.number, + textInputAction: + TextInputAction.done, + textAlign: + TextAlign.right, + style: TextStyle( + fontSize: 30.rpx, + color: Colors.white), + decoration: InputDecoration( + fillColor: Colors + .transparent, + filled: true, + hintText: "请输入联系人", + hintStyle: TextStyle( + color: + Colors.white), + border: + InputBorder.none, + contentPadding: + EdgeInsets.all( + 0)), + onChanged: (value) { + controller.model + .peopleList[ + index] + ['contact'] = value; + controller.updateAll(); + }, + controller: controller.onReDraw( + TextEditingController( + text: controller + .model + .peopleList[index] + [ + 'contact'] ?? + ""), + (textEditingController) { + textEditingController + .text = controller + .model + .peopleList[ + index]['contact'] ?? + ""; + }, "contact_$index"), + ), + ), + ], + ), + ), + getLine(), + ], + ), + ) + ], + ); + }), + SizedBox( + height: 100.rpx, + ), ], - ); - }), - SizedBox( - height: 100.rpx, - ), - ], - )), - ), + )), + )), ), ), )), diff --git a/lib/pages/mh_page/repair_list.dart b/lib/pages/mh_page/repair_list.dart index 46d182e..18effa6 100644 --- a/lib/pages/mh_page/repair_list.dart +++ b/lib/pages/mh_page/repair_list.dart @@ -173,9 +173,7 @@ class DeviceRepairPage extends GetView { ), ], ))), - SizedBox(height: 24.rpx), - InkWell( onTap: () { // bool isOk = true; diff --git a/lib/pages/mh_page/room_picker.dart b/lib/pages/mh_page/room_picker.dart index 936e17f..6a0b87d 100644 --- a/lib/pages/mh_page/room_picker.dart +++ b/lib/pages/mh_page/room_picker.dart @@ -7,16 +7,20 @@ import 'package:vbvs_app/common/util/requestWithLog.dart'; import 'package:vbvs_app/component/tool/CustomCard.dart'; class RoomPickerPage extends StatefulWidget { + final Map data; + RoomPickerPage({Key? key, required this.data}); @override _RoomPickerPageState createState() => _RoomPickerPageState(); } class _RoomPickerPageState extends State { + late Map editedData; RxList rooms = [].obs; @override void initState() { super.initState(); + editedData = Map.from(widget.data); // 创建副本 getRoomList(); } @@ -31,6 +35,7 @@ class _RoomPickerPageState extends State { queryUrl: queryUrl, onSuccess: (res) { rooms.assignAll(res.data); + setState(() => selectedIndex = 0); }, ); } @@ -161,8 +166,32 @@ class _RoomPickerPageState extends State { child: CustomCard( borderRadius: 16.rpx, gradientDirection: GradientDirection.vertical, - onTap: () { + onTap: () async { // Get.toNamed("/applyRepairPage"); + try { + String serviceAddress = + ServiceConstant.service_address; + String serviceName = + ServiceConstant.server_service; + String serviceApi = + ServiceConstant.device_show; + String queryUrl = + "$serviceAddress$serviceName$serviceApi"; + await requestWithLog( + logTitle: "更新设备信息", + method: MyHttpMethod.put, + queryUrl: queryUrl, + data: { + "id": editedData["_id"], + "roomId": rooms[selectedIndex]['_id'], + }, + onSuccess: (res) { + '更新人员信息成功: $res'; + }, + ); + } catch (e) { + print(e); + } }, colors: const [ Color(0xFFFCFCFC), diff --git a/lib/pages/mh_page/searchWidget.dart b/lib/pages/mh_page/searchWidget.dart index ddaeae9..3e5b0b7 100644 --- a/lib/pages/mh_page/searchWidget.dart +++ b/lib/pages/mh_page/searchWidget.dart @@ -130,7 +130,7 @@ class SearchWidget extends GetView { mainAxisSize: MainAxisSize.max, children: [ SizedBox( - height: 50.rpx, + height: 30.rpx, child: VerticalDivider( thickness: 2.rpx, color: stringToColor("#333333"), //固定 diff --git a/lib/pages/mh_page/user/page/edit_userinfo_page.dart b/lib/pages/mh_page/user/page/edit_userinfo_page.dart index 6b9208e..fe2c56f 100644 --- a/lib/pages/mh_page/user/page/edit_userinfo_page.dart +++ b/lib/pages/mh_page/user/page/edit_userinfo_page.dart @@ -83,7 +83,7 @@ class _UpdateUserPageState extends State { ), Positioned( left: 0, - child: returnIconButtom, + child: returnIconButtomNew, ), Positioned( right: 20.rpx, diff --git a/lib/pages/mh_page/user/page/rxhx_mht.dart b/lib/pages/mh_page/user/page/rxhx_mht.dart index a9d6b38..924a696 100644 --- a/lib/pages/mh_page/user/page/rxhx_mht.dart +++ b/lib/pages/mh_page/user/page/rxhx_mht.dart @@ -591,8 +591,13 @@ class _RxhxMhtState extends State { child: Center( child: Text( weeks[index], - style: const TextStyle( - color: Colors.white), + style: TextStyle( + color: controller.model + .rxhxWeeks[ + index] == + 1 + ? Color(0XFF003058) + : Colors.white), ), ), ), diff --git a/lib/pages/repair/apply_repair_page.dart b/lib/pages/repair/apply_repair_page.dart index 26d5318..78fa88a 100644 --- a/lib/pages/repair/apply_repair_page.dart +++ b/lib/pages/repair/apply_repair_page.dart @@ -491,6 +491,7 @@ class _ApplyRepairPageState extends State { cursorColor: themeController.currentColor.sc3, onChanged: onChanged, ), + ), ), ].divide(SizedBox(width: 24.rpx)), diff --git a/lib/routers/mh_routers.dart b/lib/routers/mh_routers.dart index 827784f..ad3a64c 100644 --- a/lib/routers/mh_routers.dart +++ b/lib/routers/mh_routers.dart @@ -68,7 +68,7 @@ var mhroutes = { "/sleepHabitPage": (context) => SleepHabitPage(), '/syms': (context) => Smys(), "/applyRepairPage": (context) => ApplyRepairPage(), - "/roomPickerPage": (context) => RoomPickerPage(), + "/roomPickerPage": (context, {arguments}) => RoomPickerPage(data: arguments), "/editBedPage": (context, {arguments}) => EditBedPage(data: arguments), "/experienceStorePage": (context) => ExperienceStorePage(), "/bookInfoPage": (context, {arguments}) =>