地址接口的视线

This commit is contained in:
czz
2025-06-21 08:55:52 +08:00
parent d94a0c8a6c
commit 41adcedad7
38 changed files with 2399 additions and 2223 deletions

View File

@@ -73,7 +73,7 @@ class BezierBottomNavigationBar extends StatelessWidget {
fontSize: 22.rpx,
color: selectedIndex == i
? Colors.white
: Colors.grey.shade400,
: const Color(0XFF929699),
),
),
],

View File

@@ -381,7 +381,7 @@ Future<void> showWeightPickerDialog(
context,
weights,
tempIndex, // ✅ 传入 RxInt
unit: "cm",
unit: "kg",
),
),
],
@@ -408,7 +408,6 @@ Future<void> showHeightPickerDialog(
int selectedIndex = heights.indexOf(initialHeight);
// int tempIndex = selectedIndex;
final RxInt tempIndex = RxInt(selectedIndex); // ✅ 改为 RxInt
ThemeController themeController = Get.find();
await showDialog(

View File

@@ -17,20 +17,22 @@ class _MattressControlPageState extends State<MattressControlPage> {
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<MattressControlPage> {
"failure": 0,
"updateTime": -1
},
"code": "545024122617"
"code": "545024122666"
};
int selectedIndex = 1; // 当前选中的tab索引
@override
@@ -75,7 +77,7 @@ class _MattressControlPageState extends State<MattressControlPage> {
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<MattressControlPage> {
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<MattressControlPage> {
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<MattressControlPage> {
],
centerTitle: false,
),
body: SafeArea(
body: const SafeArea(
child: Column(
mainAxisAlignment: MainAxisAlignment.center,
children: [

View File

@@ -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(),
// ),
// ),
),
),
);

View File

@@ -15,9 +15,9 @@ class AddressListPage extends GetView<AddressListController> {
final scaffoldKey = GlobalKey<ScaffoldState>();
BoxConstraints? bodysize;
// AddressListPage() {
// controller.getAddressList();
// }
AddressListPage() {
controller.getAddressList();
}
@override
Widget build(BuildContext context) {
@@ -65,6 +65,7 @@ class AddressListPage extends GetView<AddressListController> {
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<AddressListController> {
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<Widget>)
.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<Widget>)
.divide(const SizedBox(height: 10))
.addToEnd(const SizedBox(
height:
AppConstants.list_end_height)),
)),
),
);
}
@@ -143,7 +119,7 @@ class AddressListPage extends GetView<AddressListController> {
),
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<AddressListController> {
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(
'添加新地址',

View File

@@ -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,
),
),
),
),
),
),
],
),
),
],

File diff suppressed because it is too large Load Diff

View File

@@ -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配置', ""),

View File

@@ -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,

View File

@@ -33,108 +33,107 @@ class _DeviceListPageState extends State<DeviceListPage> {
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,
// ),
),
));
});
}
}

View File

@@ -35,9 +35,6 @@ class DevicePeopleInfo extends GetView<PeopleInfoController> {
@override
Widget build(BuildContext context) {
WidgetsBinding.instance.addPostFrameCallback((_) {
controller.initData(data['mac']);
});
return LayoutBuilder(
builder: (context, boxConstraints) => GestureDetector(
onTap: () => FocusScope.of(context).unfocus(),

View File

@@ -434,22 +434,30 @@ class ShareDeviceWidget extends GetView<MHDeviceShareController> {
letterSpacing: 0.0,
),
),
Radio<int>(
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<int>(
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<MHDeviceShareController> {
letterSpacing: 0.0,
),
),
Radio<int>(
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<int>(
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), // 缩小视觉密度
))
],
),
),

File diff suppressed because it is too large Load Diff

View File

@@ -188,7 +188,7 @@ class _EditBedPageState extends State<EditBedPage> {
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<EditBedPage> {
method: MyHttpMethod.put,
queryUrl: queryUrl,
data: {
"id": editedData["id"],
"id": editedData["_id"],
"name": editedData["name"],
},
onSuccess: (res) {},
onSuccess: (res) {
'更新人员信息成功: $res';
},
);
},
colors: const [

View File

@@ -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<AddressNode>? 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,
),
),
),
);
},
);
}
}

View File

@@ -142,7 +142,7 @@ class _NewHomePageState extends State<NewHomePage> {
}),
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<NewHomePage> {
),
fillColor:
stringToColor(
"#184468"),
"##011D33"),
elevation: 2,
borderColor:
Colors.transparent,
@@ -482,6 +482,7 @@ class _NewHomePageState extends State<NewHomePage> {
isMultiSelect: false,
),
),
),
InkWell(
onTap: () {
@@ -559,7 +560,8 @@ class _NewHomePageState extends State<NewHomePage> {
.value
.length, (index) {
var day = homeController
.homeSleepDays[index];
.homeSleepDays[
index];
bool isSelected =
homeController
.selectedDayIndex
@@ -607,7 +609,7 @@ class _NewHomePageState extends State<NewHomePage> {
BoxDecoration(
color: isSelected
? stringToColor(
"#184468")
"#011D33")
: Colors
.transparent,
borderRadius:

File diff suppressed because it is too large Load Diff

View File

@@ -173,9 +173,7 @@ class DeviceRepairPage extends GetView<RepairListController> {
),
],
))),
SizedBox(height: 24.rpx),
InkWell(
onTap: () {
// bool isOk = true;

View File

@@ -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<RoomPickerPage> {
late Map<String, dynamic> editedData;
RxList rooms = [].obs;
@override
void initState() {
super.initState();
editedData = Map.from(widget.data); // 创建副本
getRoomList();
}
@@ -31,6 +35,7 @@ class _RoomPickerPageState extends State<RoomPickerPage> {
queryUrl: queryUrl,
onSuccess: (res) {
rooms.assignAll(res.data);
setState(() => selectedIndex = 0);
},
);
}
@@ -161,8 +166,32 @@ class _RoomPickerPageState extends State<RoomPickerPage> {
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),

View File

@@ -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"), //固定

View File

@@ -83,7 +83,7 @@ class _UpdateUserPageState extends State<EditUserPage> {
),
Positioned(
left: 0,
child: returnIconButtom,
child: returnIconButtomNew,
),
Positioned(
right: 20.rpx,

View File

@@ -591,8 +591,13 @@ class _RxhxMhtState extends State<RxhxMht> {
child: Center(
child: Text(
weeks[index],
style: const TextStyle(
color: Colors.white),
style: TextStyle(
color: controller.model
.rxhxWeeks[
index] ==
1
? Color(0XFF003058)
: Colors.white),
),
),
),

View File

@@ -491,6 +491,7 @@ class _ApplyRepairPageState extends State<ApplyRepairPage> {
cursorColor: themeController.currentColor.sc3,
onChanged: onChanged,
),
),
),
].divide(SizedBox(width: 24.rpx)),