Merge branch 'master' of http://git.it.real.he-info.cn:90/r/~enchantedwyf/vbvs_app
This commit is contained in:
File diff suppressed because one or more lines are too long
|
Before Width: | Height: | Size: 6.9 KiB After Width: | Height: | Size: 13 KiB |
@@ -205,6 +205,8 @@
|
||||
"请选择身高": "请输入身高",
|
||||
"人员资料": "人员资料",
|
||||
"请输入姓名": "请输入姓名",
|
||||
"解除分享":"解除分享"
|
||||
|
||||
"解除分享": "解除分享",
|
||||
"最高分": "最高分",
|
||||
"最低分": "最低分",
|
||||
"本周平均分":"本周平均分"
|
||||
}
|
||||
@@ -4,7 +4,7 @@ import 'package:vbvs_app/common/util/FitTool.dart';
|
||||
import 'package:vbvs_app/common/util/MyUtils.dart';
|
||||
import 'package:vbvs_app/enum/APPPackageType.dart';
|
||||
|
||||
class AppConstants {
|
||||
class AppConstants {
|
||||
// App-related constants
|
||||
static const int code_time = 60; //验证码倒计时
|
||||
static const int limit = 10; //分页数量
|
||||
@@ -48,5 +48,5 @@ class AppConstants {
|
||||
|
||||
//系统参数
|
||||
//运行打包APP模式
|
||||
int ent_type = APPPackageType.TH.code;//1.默认太和 2.欢睡 3.眠花糖
|
||||
int ent_type = APPPackageType.MHT.code; //1.默认太和 2.欢睡 3.眠花糖
|
||||
}
|
||||
|
||||
@@ -81,6 +81,10 @@ class WeatherModelController extends GetControllerEx<WeatherModel> {
|
||||
List<Placemark> placemarks = [];
|
||||
// placemarks = await placemarkFromCoordinates(position.latitude, position.longitude,
|
||||
// localeIdentifier: language);
|
||||
placemarks = await placemarkFromCoordinates(
|
||||
position.latitude,
|
||||
position.longitude,
|
||||
);
|
||||
|
||||
if (placemarks.isNotEmpty) {
|
||||
model.cityName = placemarks[0].locality ?? "未知数据".tr;
|
||||
|
||||
@@ -195,9 +195,9 @@ Future showDateSelectionDialog(BuildContext context,
|
||||
width: 100.rpx,
|
||||
height: 60.rpx,
|
||||
alignment: Alignment.center,
|
||||
child: Text("确认",
|
||||
child: Text("确定",
|
||||
style: TextStyle(
|
||||
fontSize: 30.rpx, color: Colors.white)),
|
||||
fontSize: 30.rpx, color: stringToColor("#84F5FF"))),
|
||||
),
|
||||
),
|
||||
],
|
||||
@@ -348,10 +348,10 @@ Future<void> showWeightPickerDialog(
|
||||
width: 100.rpx,
|
||||
height: 60.rpx,
|
||||
child: Text(
|
||||
"确认",
|
||||
"确定",
|
||||
style: TextStyle(
|
||||
fontSize: 30.rpx,
|
||||
color: Colors.white,
|
||||
color: stringToColor("#84F5FF"),
|
||||
),
|
||||
),
|
||||
)),
|
||||
@@ -475,10 +475,10 @@ Future<void> showHeightPickerDialog(
|
||||
width: 100.rpx,
|
||||
height: 60.rpx,
|
||||
child: Text(
|
||||
"确认",
|
||||
"确定",
|
||||
style: TextStyle(
|
||||
fontSize: 30.rpx,
|
||||
color: Colors.white,
|
||||
color: stringToColor("#84F5FF"),
|
||||
),
|
||||
),
|
||||
)),
|
||||
@@ -701,7 +701,7 @@ Future showDayTimeSelectionDialog(
|
||||
mainAxisSize: MainAxisSize.min,
|
||||
crossAxisAlignment: CrossAxisAlignment.center,
|
||||
children: <Widget>[
|
||||
// 顶部栏:取消 - 标题 - 确认
|
||||
// 顶部栏:取消 - 标题 - 确定
|
||||
Row(
|
||||
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||
children: [
|
||||
@@ -742,9 +742,9 @@ Future showDayTimeSelectionDialog(
|
||||
width: 100.rpx,
|
||||
height: 60.rpx,
|
||||
alignment: Alignment.center,
|
||||
child: Text("确认".tr,
|
||||
child: Text("确定".tr,
|
||||
style: TextStyle(
|
||||
fontSize: 30.rpx, color: Colors.white)),
|
||||
fontSize: 30.rpx, color: stringToColor("#84F5FF"))),
|
||||
),
|
||||
),
|
||||
],
|
||||
@@ -879,9 +879,9 @@ Future showOneSelectionDialog(
|
||||
alignment: Alignment.center,
|
||||
width: 100.rpx,
|
||||
height: 60.rpx,
|
||||
child: Text("确认".tr,
|
||||
child: Text("确定".tr,
|
||||
style: TextStyle(
|
||||
fontSize: 30.rpx, color: Colors.white)),
|
||||
fontSize: 30.rpx, color: stringToColor("#84F5FF"))),
|
||||
),
|
||||
),
|
||||
],
|
||||
|
||||
@@ -138,7 +138,7 @@ class _HomePageState extends State<MainPageBBottomChange>
|
||||
Future<void> dealWebSource(int index) async {
|
||||
WebviewTestController webviewTestController = Get.find();
|
||||
if (index == 2) {
|
||||
await webviewTestController.web.jsbridge?.dart.pageActive();
|
||||
await webviewTestController.web.jsbridge?.dart.pageActive(true);
|
||||
} else {
|
||||
await webviewTestController.web.jsbridge?.dart.pageInActive();
|
||||
}
|
||||
|
||||
@@ -65,7 +65,7 @@ class LanguagePage extends GetView<MHLanguageController> {
|
||||
),
|
||||
// 左侧图标
|
||||
Positioned(
|
||||
left: 20.rpx,
|
||||
left: 0.rpx,
|
||||
child: returnIconButtomNew,
|
||||
),
|
||||
],
|
||||
|
||||
@@ -9,6 +9,7 @@ import 'package:vbvs_app/component/tool/TopSlideNotification.dart';
|
||||
import 'package:vbvs_app/controller/mh_controller/device_list_controller.dart';
|
||||
import 'package:vbvs_app/model/api_response.dart';
|
||||
import 'package:vbvs_app/pages/device_bind/componnet/bind_dialog.dart';
|
||||
import 'package:vbvs_app/pages/mh_page/homepage/controller/mht_home_controller.dart';
|
||||
import 'package:vbvs_app/pages/mh_page/test/WebviewTestModel.dart';
|
||||
|
||||
class BluetoothPage extends StatefulWidget {
|
||||
@@ -166,8 +167,11 @@ class _BluetoothPageState extends State<BluetoothPage> {
|
||||
context, '详情', "/devicePeopleInfo",
|
||||
arguments: obsData),
|
||||
_buildMenuButton(
|
||||
context, '人员资料', "/peopleInfoPage",
|
||||
arguments: obsData,),
|
||||
context,
|
||||
'人员资料',
|
||||
"/peopleInfoPage",
|
||||
arguments: obsData,
|
||||
),
|
||||
_buildMenuButton(
|
||||
context, '房间选择', "/roomPickerPage",
|
||||
arguments: obsData),
|
||||
@@ -194,6 +198,10 @@ class _BluetoothPageState extends State<BluetoothPage> {
|
||||
.unbindDevice(obsData);
|
||||
await deviceListController
|
||||
.getDeviceList();
|
||||
MHTHomeController homeController =
|
||||
Get.find();
|
||||
homeController.selectDevcie.value =
|
||||
"";
|
||||
try {
|
||||
WebviewTestController
|
||||
webviewTestController =
|
||||
|
||||
@@ -25,10 +25,12 @@ import 'package:vbvs_app/pages/mh_page/test/WebviewTestModel.dart';
|
||||
|
||||
class DeviceComponentWidget extends StatefulWidget {
|
||||
BlueToothDataModel bleDevice;
|
||||
var deviceType;
|
||||
|
||||
DeviceComponentWidget({
|
||||
super.key,
|
||||
required this.bleDevice,
|
||||
required this.deviceType,
|
||||
});
|
||||
|
||||
@override
|
||||
@@ -212,8 +214,8 @@ class _DeviceComponentWidgetState extends State<DeviceComponentWidget> {
|
||||
blueteethBindController.currentDeviceMac.value =
|
||||
widget.bleDevice.mac;
|
||||
blueteethBindController.updateAll();
|
||||
String mac =
|
||||
await getBindTHMAC(context, widget.bleDevice);
|
||||
String mac = await getBindTHMAC(
|
||||
context, widget.bleDevice, widget.deviceType);
|
||||
if (mac != null && mac.isNotEmpty) {
|
||||
bool flag =
|
||||
await fillTHMac(mac, widget.bleDevice, context);
|
||||
@@ -481,19 +483,17 @@ class _DeviceComponentWidgetState extends State<DeviceComponentWidget> {
|
||||
);
|
||||
}
|
||||
|
||||
//获取传感器mac
|
||||
//获取智能床/床垫mac
|
||||
Future<String> getBindTHMAC(
|
||||
BuildContext context, BlueToothDataModel device) async {
|
||||
BuildContext context, BlueToothDataModel device, Map deviceType) async {
|
||||
const int maxRetries = 2;
|
||||
const Duration timeout = Duration(seconds: 5);
|
||||
String? macAddress;
|
||||
|
||||
try {
|
||||
// 连接设备
|
||||
THapp bledevice = THapp(device: device.scanResult.device);
|
||||
await bledevice.connect();
|
||||
await bledevice.connect();
|
||||
var res2 = bledevice.isConnected;
|
||||
|
||||
if (!res2) {
|
||||
edm.EasyDartModule.logger.error("蓝牙连接失败");
|
||||
DailyLogUtils.printLog("蓝牙连接失败");
|
||||
@@ -504,58 +504,18 @@ class _DeviceComponentWidgetState extends State<DeviceComponentWidget> {
|
||||
);
|
||||
throw Exception("蓝牙连接失败");
|
||||
}
|
||||
|
||||
blueteethBindController.blueConnectFlag.value = 2;
|
||||
blueteethBindController.currentDevice = bledevice;
|
||||
await Future.delayed(Duration(seconds: 2));
|
||||
var read = bledevice.getresource('fff0/fff1');
|
||||
await read!.characteristic.setNotifyValue(true);
|
||||
var write = bledevice.getresource('fff0/fff2');
|
||||
|
||||
for (int attempt = 0; attempt < maxRetries; attempt++) {
|
||||
var completer = Completer<String>();
|
||||
|
||||
StreamSubscription? subscription;
|
||||
subscription = read.characteristic.onValueReceived.listen((onData) {
|
||||
if (onData.length >= 14) {
|
||||
// 按照你提供的协议,返回数据长度至少 17字节,这里保险起见 14起步
|
||||
String parsedMac = parseMacFromBleResponse(onData);
|
||||
completer.complete(parsedMac);
|
||||
}
|
||||
});
|
||||
|
||||
// 发送查询命令
|
||||
var order = [
|
||||
0xFF,
|
||||
0xFF,
|
||||
0xFF,
|
||||
0xFF,
|
||||
0x00,
|
||||
0x03,
|
||||
0x40,
|
||||
0x01,
|
||||
0x01,
|
||||
0x00,
|
||||
0x45,
|
||||
0xFD
|
||||
];
|
||||
await write!.characteristic.write(order);
|
||||
|
||||
try {
|
||||
macAddress = await completer.future.timeout(timeout);
|
||||
await subscription.cancel();
|
||||
break; // 成功拿到,跳出重试
|
||||
} catch (e) {
|
||||
await subscription.cancel();
|
||||
if (attempt == maxRetries - 1) {
|
||||
TopSlideNotification.show(
|
||||
context,
|
||||
text: "获取MAC地址超时,请重试".tr,
|
||||
textColor: themeController.currentColor.sc9,
|
||||
);
|
||||
throw Exception("获取MAC地址失败");
|
||||
}
|
||||
}
|
||||
if (deviceType['type'] == 3) {
|
||||
//智能床垫
|
||||
macAddress = await getMacFromType3(bledevice, timeout);
|
||||
} else if (deviceType['type'] == 2) {
|
||||
//智能床
|
||||
macAddress = await getMacFromType2(bledevice, timeout);
|
||||
} else {
|
||||
throw Exception("不支持的设备类型");
|
||||
}
|
||||
|
||||
if (macAddress == null) {
|
||||
@@ -629,6 +589,87 @@ class _DeviceComponentWidgetState extends State<DeviceComponentWidget> {
|
||||
);
|
||||
return flag;
|
||||
}
|
||||
|
||||
Future<String> getMacFromType3(THapp bledevice, Duration timeout) async {
|
||||
final read = bledevice.getresource('fff0/fff1');
|
||||
await read!.characteristic.setNotifyValue(true);
|
||||
final write = bledevice.getresource('fff0/fff2');
|
||||
|
||||
const int maxRetries = 2;
|
||||
for (int attempt = 0; attempt < maxRetries; attempt++) {
|
||||
final completer = Completer<String>();
|
||||
final subscription = read.characteristic.onValueReceived.listen((data) {
|
||||
if (data.length >= 14) {
|
||||
completer.complete(parseMacFromBleResponse(data));
|
||||
}
|
||||
});
|
||||
|
||||
final order = [
|
||||
0xFF,
|
||||
0xFF,
|
||||
0xFF,
|
||||
0xFF,
|
||||
0x00,
|
||||
0x03,
|
||||
0x40,
|
||||
0x01,
|
||||
0x01,
|
||||
0x00,
|
||||
0x45,
|
||||
0xFD
|
||||
];
|
||||
await write!.characteristic.write(order);
|
||||
|
||||
try {
|
||||
final mac = await completer.future.timeout(timeout);
|
||||
await subscription.cancel();
|
||||
return mac;
|
||||
} catch (_) {
|
||||
await subscription.cancel();
|
||||
if (attempt == maxRetries - 1) rethrow;
|
||||
}
|
||||
}
|
||||
throw Exception("获取MAC超时");
|
||||
}
|
||||
|
||||
Future<String> getMacFromType2(THapp bledevice, Duration timeout) async {
|
||||
try {
|
||||
final read = bledevice.getresource('ffe0/ffe1');
|
||||
await read!.characteristic.setNotifyValue(true);
|
||||
|
||||
final write =
|
||||
bledevice.getresource('ffe0/ffe1'); // 与 read 同 characteristic
|
||||
const int maxRetries = 2;
|
||||
for (int attempt = 0; attempt < maxRetries; attempt++) {
|
||||
final completer = Completer<String>();
|
||||
final subscription = read.characteristic.onValueReceived.listen((data) {
|
||||
if (data.length >= 17) {
|
||||
completer.complete(parseMacFromTH2Response(data));
|
||||
}
|
||||
});
|
||||
|
||||
final order = [0xFF, 0xFF, 0xFF, 0xFF, 0x01, 0x00, 0x0C, 0x0B, 0x0A];
|
||||
int checksum = order.reduce((a, b) => a + b) & 0xFFFF;
|
||||
order.add(checksum & 0xFF); // 低位
|
||||
order.add((checksum >> 8) & 0xFF); // 高位
|
||||
|
||||
await write!.characteristic.write(order);
|
||||
|
||||
try {
|
||||
final mac = await completer.future.timeout(timeout);
|
||||
await subscription.cancel();
|
||||
return mac;
|
||||
} catch (_) {
|
||||
await subscription.cancel();
|
||||
if (attempt == maxRetries - 1) rethrow;
|
||||
}
|
||||
}
|
||||
} catch (e) {
|
||||
ef.log("[获取设备 MAC]:失败:$e");
|
||||
}
|
||||
|
||||
throw Exception("获取MAC超时");
|
||||
}
|
||||
}
|
||||
|
||||
String parseMacFromBleResponse(List<int> data) {
|
||||
@@ -650,3 +691,21 @@ String parseMacFromBleResponse(List<int> data) {
|
||||
throw Exception("BLE返回数据格式不正确");
|
||||
}
|
||||
}
|
||||
|
||||
String parseMacFromTH2Response(List<int> data) {
|
||||
if (data.length < 17) {
|
||||
throw Exception("数据长度不足,无法解析MAC");
|
||||
}
|
||||
|
||||
int status = data[8];
|
||||
if (status != 0x03 && status != 0x04) {
|
||||
throw Exception("未连接心率带");
|
||||
}
|
||||
|
||||
// 提取9~14字节的MAC地址
|
||||
List<int> macBytes = data.sublist(9, 15);
|
||||
return macBytes
|
||||
.map((b) => b.toRadixString(16).padLeft(2, '0'))
|
||||
.join(":")
|
||||
.toUpperCase();
|
||||
}
|
||||
|
||||
@@ -4,11 +4,14 @@ import 'package:flutter_svg/flutter_svg.dart';
|
||||
import 'package:flutterflow_ui/flutterflow_ui.dart';
|
||||
|
||||
import 'package:vbvs_app/common/color/appFontsize.dart';
|
||||
import 'package:vbvs_app/common/util/DailyLogUtils.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';
|
||||
import 'package:vbvs_app/pages/main_bottom/component/main_page_b_bottom_change.dart';
|
||||
import 'package:vbvs_app/pages/mh_page/test/WebviewTestModel.dart';
|
||||
|
||||
class DeviceInfoWidget extends GetView {
|
||||
int index;
|
||||
@@ -200,8 +203,26 @@ class DeviceInfoWidget extends GetView {
|
||||
width: 150.rpx,
|
||||
height: 90.rpx,
|
||||
child: FFButtonWidget(
|
||||
onPressed: () {
|
||||
// deviceControllerChange(device);
|
||||
onPressed: () async {
|
||||
try {
|
||||
WebviewTestController webviewTestController =
|
||||
Get.find();
|
||||
var future = webviewTestController
|
||||
.web.jsbridge?.dart
|
||||
.appToHtmlDevice(device);
|
||||
Future.delayed(Duration(seconds: 5), () {
|
||||
return;
|
||||
});
|
||||
await future;
|
||||
await webviewTestController.web.jsbridge?.dart
|
||||
.pageActive(false);
|
||||
MainPageBBottomChange.jumpTo(2);
|
||||
Get.until((route) =>
|
||||
Get.currentRoute ==
|
||||
"/mianPageBottomChange");
|
||||
} catch (e) {
|
||||
DailyLogUtils.writeError("发生异常: $e");
|
||||
}
|
||||
},
|
||||
text: '控制',
|
||||
options: FFButtonOptions(
|
||||
|
||||
@@ -124,7 +124,7 @@ class _MHTBindDeviceTypePageState extends State<MHTBindDeviceTypePage> {
|
||||
bottom: 26.rpx), // 添加每个设备之间的间隔
|
||||
child: _buildDeviceCard(
|
||||
context,
|
||||
title: device['name'], // 这里假设 device 是一个 Map
|
||||
title: device['name'],
|
||||
imageUrl: device['image'],
|
||||
type: device['type'],
|
||||
desc: device['desc'] ?? [],
|
||||
|
||||
@@ -19,8 +19,8 @@ import 'package:vbvs_app/pages/mh_page/device/controller/mht_bluetooth_controlle
|
||||
import 'package:vbvs_app/pages/mh_page/device/model/BlueToothDataModel.dart';
|
||||
|
||||
class MHTBlueteethDevicePage extends StatefulWidget {
|
||||
var data;
|
||||
MHTBlueteethDevicePage({super.key, required this.data});
|
||||
var deviceType;
|
||||
MHTBlueteethDevicePage({super.key, required this.deviceType});
|
||||
|
||||
@override
|
||||
State<MHTBlueteethDevicePage> createState() => _MHTBlueteethDevicePageState();
|
||||
@@ -146,10 +146,8 @@ class _MHTBlueteethDevicePageState extends State<MHTBlueteethDevicePage> {
|
||||
final filteredResults = results.where((r) {
|
||||
final localName = r.advertisementData.localName;
|
||||
final isTarget = r.rssi > signalThreshold &&
|
||||
isTargetDevice(localName, widget.data['reg'].cast<String>());
|
||||
|
||||
isTargetDevice(localName, widget.deviceType['reg'].cast<String>());
|
||||
if (!isTarget) return false;
|
||||
|
||||
final name = r.advertisementData.advName.toLowerCase();
|
||||
String macAddress = r.device.remoteId.str;
|
||||
final mac = macAddress.replaceAll(':', '');
|
||||
@@ -164,14 +162,34 @@ class _MHTBlueteethDevicePageState extends State<MHTBlueteethDevicePage> {
|
||||
return true;
|
||||
}).map((r) {
|
||||
return BlueToothDataModel.fromScanResult(
|
||||
r, widget.data['type']?.toInt(),
|
||||
r, widget.deviceType['type']?.toInt(),
|
||||
bind: false,
|
||||
name: r.advertisementData.localName,
|
||||
mac: r.device.remoteId.str.replaceAll(':', ''));
|
||||
}).toList();
|
||||
|
||||
final currentDevices = mhtBlueToothController.model.blueRawData ?? [];
|
||||
final newDevices = <BlueToothDataModel>[];
|
||||
|
||||
for (var newDevice in filteredResults) {
|
||||
// 检查设备是否已存在
|
||||
final existingIndex =
|
||||
currentDevices.indexWhere((d) => d.mac == newDevice.mac);
|
||||
|
||||
if (existingIndex >= 0) {
|
||||
// 更新已有设备信息(如信号强度)
|
||||
currentDevices[existingIndex] = newDevice;
|
||||
} else {
|
||||
// 添加新设备
|
||||
newDevices.add(newDevice);
|
||||
}
|
||||
}
|
||||
|
||||
setState(() {
|
||||
mhtBlueToothController.model.blueRawData = filteredResults;
|
||||
mhtBlueToothController.model.blueRawData = [
|
||||
...currentDevices,
|
||||
...newDevices
|
||||
];
|
||||
});
|
||||
});
|
||||
|
||||
@@ -189,6 +207,7 @@ class _MHTBlueteethDevicePageState extends State<MHTBlueteethDevicePage> {
|
||||
void _startPeriodicScan() {
|
||||
_timer = Timer.periodic(Duration(seconds: 10), (timer) {
|
||||
if (mhtBlueToothController.shouldScan.value && !isScanning) {
|
||||
_removeOldDevices(); // 先清理老旧设备
|
||||
_startScanning();
|
||||
}
|
||||
});
|
||||
@@ -617,6 +636,7 @@ class _MHTBlueteethDevicePageState extends State<MHTBlueteethDevicePage> {
|
||||
.map((device) {
|
||||
return DeviceComponentWidget(
|
||||
bleDevice: device,
|
||||
deviceType: widget.deviceType,
|
||||
);
|
||||
})
|
||||
.toList()
|
||||
@@ -693,4 +713,20 @@ class _MHTBlueteethDevicePageState extends State<MHTBlueteethDevicePage> {
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
void _removeOldDevices() {
|
||||
final now = DateTime.now();
|
||||
final currentDevices = mhtBlueToothController.model.blueRawData ?? [];
|
||||
|
||||
// 移除30秒内未出现的设备
|
||||
final updatedDevices = currentDevices.where((device) {
|
||||
return now.difference(device.lastSeen) < Duration(seconds: 30);
|
||||
}).toList();
|
||||
|
||||
if (updatedDevices.length != currentDevices.length) {
|
||||
setState(() {
|
||||
mhtBlueToothController.model.blueRawData = updatedDevices;
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -39,7 +39,7 @@ class _MHTPeopleInfoPageState extends State<MHTPeopleInfoPage> {
|
||||
peopleList.add({
|
||||
'mac': device?.macA,
|
||||
'gender': "男",
|
||||
'id':device!.macAID,
|
||||
'id': device!.macAID,
|
||||
});
|
||||
|
||||
// Initialize person B if exists
|
||||
@@ -47,7 +47,7 @@ class _MHTPeopleInfoPageState extends State<MHTPeopleInfoPage> {
|
||||
peopleList.add({
|
||||
'mac': device.macB,
|
||||
'gender': "男",
|
||||
'id':device!.macBID,
|
||||
'id': device!.macBID,
|
||||
});
|
||||
}
|
||||
|
||||
@@ -113,7 +113,7 @@ class _MHTPeopleInfoPageState extends State<MHTPeopleInfoPage> {
|
||||
? DateFormat('yyyy-MM-dd').format(personData['birthday'])
|
||||
: personData['birthday'],
|
||||
'contact': personData['contact'],
|
||||
'id':personData['id'],
|
||||
'id': personData['id'],
|
||||
};
|
||||
await requestWithLog(
|
||||
logTitle: "保存用户信息",
|
||||
@@ -124,7 +124,8 @@ class _MHTPeopleInfoPageState extends State<MHTPeopleInfoPage> {
|
||||
print(res);
|
||||
},
|
||||
onFailure: (res) {
|
||||
TopSlideNotification.show(context,text: res.msg!,textColor: themeController.currentColor.sc9);
|
||||
TopSlideNotification.show(context,
|
||||
text: res.msg!, textColor: themeController.currentColor.sc9);
|
||||
print(res);
|
||||
},
|
||||
);
|
||||
@@ -306,42 +307,42 @@ class _MHTPeopleInfoPageState extends State<MHTPeopleInfoPage> {
|
||||
width: double.infinity,
|
||||
height: 90.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),
|
||||
() {
|
||||
showOneSelectionDialog(context,
|
||||
arr: ["女", "男"],
|
||||
checkIndex: peopleList[index]
|
||||
['gender'] ==
|
||||
"女"
|
||||
? 0
|
||||
: 1, checkChange: (sindex) {
|
||||
setState(() {
|
||||
peopleList[index]['gender'] =
|
||||
sindex == 0 ? "女" : "男";
|
||||
});
|
||||
}).then((d) {});
|
||||
child: InkWell(
|
||||
onTap: () {
|
||||
FocusScope.of(context)
|
||||
.requestFocus(FocusNode());
|
||||
Future.delayed(
|
||||
const Duration(milliseconds: 250),
|
||||
() {
|
||||
showOneSelectionDialog(context,
|
||||
arr: ["女", "男"],
|
||||
checkIndex: peopleList[index]
|
||||
['gender'] ==
|
||||
"女"
|
||||
? 0
|
||||
: 1, checkChange: (sindex) {
|
||||
setState(() {
|
||||
peopleList[index]['gender'] =
|
||||
sindex == 0 ? "女" : "男";
|
||||
});
|
||||
},
|
||||
child: Row(
|
||||
}).then((d) {});
|
||||
});
|
||||
},
|
||||
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(
|
||||
@@ -365,8 +366,8 @@ class _MHTPeopleInfoPageState extends State<MHTPeopleInfoPage> {
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
],
|
||||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
getLine(),
|
||||
@@ -376,43 +377,43 @@ class _MHTPeopleInfoPageState extends State<MHTPeopleInfoPage> {
|
||||
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,
|
||||
child: InkWell(
|
||||
onTap: () {
|
||||
FocusScope.of(context)
|
||||
.requestFocus(FocusNode());
|
||||
Future.delayed(
|
||||
const Duration(milliseconds: 250),
|
||||
() {
|
||||
showHeightPickerDialog(
|
||||
context,
|
||||
initialHeight: int.tryParse(
|
||||
peopleList[index]['height'] ??
|
||||
'170') ??
|
||||
170,
|
||||
onConfirm: (int selectedHeight) {
|
||||
setState(() {
|
||||
peopleList[index]['height'] =
|
||||
selectedHeight.toString();
|
||||
});
|
||||
},
|
||||
);
|
||||
});
|
||||
},
|
||||
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: int.tryParse(
|
||||
peopleList[index]
|
||||
['height'] ??
|
||||
'170') ??
|
||||
170,
|
||||
onConfirm: (int selectedHeight) {
|
||||
setState(() {
|
||||
peopleList[index]['height'] =
|
||||
selectedHeight.toString();
|
||||
});
|
||||
},
|
||||
);
|
||||
});
|
||||
},
|
||||
child: Row(
|
||||
Row(
|
||||
children: [
|
||||
Text(
|
||||
peopleList[index]['height'] !=
|
||||
@@ -431,8 +432,8 @@ class _MHTPeopleInfoPageState extends State<MHTPeopleInfoPage> {
|
||||
size: 48.rpx),
|
||||
],
|
||||
),
|
||||
),
|
||||
],
|
||||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
getLine(),
|
||||
@@ -442,39 +443,40 @@ class _MHTPeopleInfoPageState extends State<MHTPeopleInfoPage> {
|
||||
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,
|
||||
child: InkWell(
|
||||
onTap: () {
|
||||
FocusScope.of(context)
|
||||
.requestFocus(FocusNode());
|
||||
Future.delayed(
|
||||
const Duration(milliseconds: 250),
|
||||
() {
|
||||
showWeightPickerDialog(
|
||||
context,
|
||||
initialWeight: "50",
|
||||
onConfirm: (int selectedWeight) {
|
||||
setState(() {
|
||||
peopleList[index]['weight'] =
|
||||
selectedWeight.toString();
|
||||
});
|
||||
},
|
||||
);
|
||||
});
|
||||
},
|
||||
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: "0",
|
||||
onConfirm: (int selectedWeight) {
|
||||
setState(() {
|
||||
peopleList[index]['weight'] =
|
||||
selectedWeight.toString();
|
||||
});
|
||||
},
|
||||
);
|
||||
});
|
||||
},
|
||||
child: Row(
|
||||
Row(
|
||||
children: [
|
||||
Text(
|
||||
peopleList[index]['weight'] !=
|
||||
@@ -493,8 +495,8 @@ class _MHTPeopleInfoPageState extends State<MHTPeopleInfoPage> {
|
||||
size: 48.rpx),
|
||||
],
|
||||
),
|
||||
),
|
||||
],
|
||||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
getLine(),
|
||||
@@ -504,46 +506,44 @@ class _MHTPeopleInfoPageState extends State<MHTPeopleInfoPage> {
|
||||
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: peopleList[index]
|
||||
['birthday'] is DateTime
|
||||
? peopleList[index]
|
||||
['birthday']
|
||||
: DateTime.tryParse(
|
||||
peopleList[index][
|
||||
'birthday'] ??
|
||||
'') ??
|
||||
DateTime.now(),
|
||||
checkChange: (DateTime d) {
|
||||
setState(() {
|
||||
peopleList[index]['birthday'] =
|
||||
d;
|
||||
});
|
||||
}).then((d) {});
|
||||
child: InkWell(
|
||||
onTap: () {
|
||||
FocusScope.of(context)
|
||||
.requestFocus(FocusNode());
|
||||
Future.delayed(
|
||||
const Duration(milliseconds: 250),
|
||||
() {
|
||||
showDateSelectionDialog(context,
|
||||
checkDate: peopleList[index]
|
||||
['birthday'] is DateTime
|
||||
? peopleList[index]['birthday']
|
||||
: DateTime.tryParse(
|
||||
peopleList[index]
|
||||
['birthday'] ??
|
||||
'') ??
|
||||
DateTime.now(),
|
||||
checkChange: (DateTime d) {
|
||||
setState(() {
|
||||
peopleList[index]['birthday'] = d;
|
||||
});
|
||||
},
|
||||
child: Row(
|
||||
}).then((d) {});
|
||||
});
|
||||
},
|
||||
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(
|
||||
@@ -574,8 +574,8 @@ class _MHTPeopleInfoPageState extends State<MHTPeopleInfoPage> {
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
],
|
||||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
getLine(),
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import 'package:flutter_blue_plus/flutter_blue_plus.dart';
|
||||
|
||||
class BlueToothDataModel {
|
||||
String name;//设备型号
|
||||
String name; // 设备型号
|
||||
bool bind;
|
||||
String mac;
|
||||
ScanResult scanResult;
|
||||
@@ -10,6 +10,7 @@ class BlueToothDataModel {
|
||||
int type;
|
||||
String? macAID;
|
||||
String? macBID;
|
||||
DateTime lastSeen; // 添加的最后可见时间字段
|
||||
|
||||
BlueToothDataModel({
|
||||
this.name = '',
|
||||
@@ -19,6 +20,7 @@ class BlueToothDataModel {
|
||||
required this.type,
|
||||
this.macA = '',
|
||||
this.macB = '',
|
||||
required this.lastSeen, // 添加到构造函数参数
|
||||
});
|
||||
|
||||
factory BlueToothDataModel.fromScanResult(ScanResult result, int type,
|
||||
@@ -28,6 +30,14 @@ class BlueToothDataModel {
|
||||
name.isNotEmpty ? name : (result.advertisementData.localName ?? '');
|
||||
|
||||
return BlueToothDataModel(
|
||||
name: finalName, bind: bind, mac: mac, scanResult: result, type: type);
|
||||
name: finalName,
|
||||
bind: bind,
|
||||
mac: mac,
|
||||
scanResult: result,
|
||||
type: type,
|
||||
macA: '', // 保持原有默认值
|
||||
macB: '', // 保持原有默认值
|
||||
lastSeen: DateTime.now(), // 设置为当前时间
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -86,7 +86,7 @@ class _HomeDeviceStausWidgetState extends State<HomeDeviceStausWidget> {
|
||||
});
|
||||
await future;
|
||||
await webviewTestController.web.jsbridge?.dart
|
||||
.pageActive();
|
||||
.pageActive(false);
|
||||
MainPageBBottomChange.jumpTo(2);
|
||||
} catch (e) {
|
||||
DailyLogUtils.writeError("发生异常: $e");
|
||||
|
||||
@@ -4,6 +4,7 @@ import 'package:flutterflow_ui/flutterflow_ui.dart';
|
||||
import 'package:vbvs_app/common/color/app_uri_status.dart';
|
||||
import 'package:vbvs_app/common/util/FitTool.dart';
|
||||
import 'package:vbvs_app/common/util/MyUtils.dart';
|
||||
import 'package:vbvs_app/component/NullDataComponentWidget.dart';
|
||||
import 'package:vbvs_app/component/tool/TopSlideNotification.dart';
|
||||
import 'package:vbvs_app/controller/user_info_controller.dart';
|
||||
import 'package:vbvs_app/pages/mh_page/homepage/controller/mht_home_controller.dart';
|
||||
@@ -38,11 +39,11 @@ class _MhtSleepReportPageState extends State<MhtSleepReportPage> {
|
||||
deviceController.getDeviceList(group: 'room').then((apiResponse) {
|
||||
if (apiResponse.code != HttpStatusCodes.ok) {
|
||||
if (context.mounted) {
|
||||
TopSlideNotification.show(
|
||||
context,
|
||||
text: apiResponse.msg!,
|
||||
textColor: themeController.currentColor.sc9,
|
||||
);
|
||||
// TopSlideNotification.show(
|
||||
// context,
|
||||
// text: apiResponse.msg!,
|
||||
// textColor: themeController.currentColor.sc9,
|
||||
// );
|
||||
}
|
||||
} else {
|
||||
//请求睡眠报告
|
||||
@@ -257,6 +258,9 @@ class _MhtSleepReportPageState extends State<MhtSleepReportPage> {
|
||||
),
|
||||
);
|
||||
}
|
||||
if (userInfoController.model.login != null &&
|
||||
userInfoController.model.login == 1)
|
||||
return Expanded(child: NullDataWidget());
|
||||
return Container();
|
||||
}),
|
||||
|
||||
@@ -273,7 +277,7 @@ class _MhtSleepReportPageState extends State<MhtSleepReportPage> {
|
||||
'backgroundImg':
|
||||
'assets/images/new_background.png',
|
||||
'arrow': false,
|
||||
'noBackImg':true,
|
||||
'noBackImg': true,
|
||||
},
|
||||
),
|
||||
);
|
||||
|
||||
@@ -45,20 +45,20 @@ class _NewHomePageState extends State<NewHomePage> {
|
||||
// homeController.getSleepReport();
|
||||
deviceController.getDeviceNum().then((apiResponse) {
|
||||
if (apiResponse.code != HttpStatusCodes.ok) {
|
||||
TopSlideNotification.show(
|
||||
Get.context!,
|
||||
text: apiResponse.msg!,
|
||||
textColor: themeController.currentColor.sc9,
|
||||
);
|
||||
// TopSlideNotification.show(
|
||||
// Get.context!,
|
||||
// text: apiResponse.msg!,
|
||||
// textColor: themeController.currentColor.sc9,
|
||||
// );
|
||||
}
|
||||
});
|
||||
deviceController.getDeviceList(group: 'room').then((apiResponse) {
|
||||
if (apiResponse.code != HttpStatusCodes.ok) {
|
||||
TopSlideNotification.show(
|
||||
Get.context!,
|
||||
text: apiResponse.msg!,
|
||||
textColor: themeController.currentColor.sc9,
|
||||
);
|
||||
// TopSlideNotification.show(
|
||||
// Get.context!,
|
||||
// text: apiResponse.msg!,
|
||||
// textColor: themeController.currentColor.sc9,
|
||||
// );
|
||||
} else {
|
||||
//请求睡眠报告
|
||||
// deviceController.getSleepReport();
|
||||
@@ -105,11 +105,11 @@ class _NewHomePageState extends State<NewHomePage> {
|
||||
Widget build(BuildContext context) {
|
||||
deviceController.getDeviceList(group: 'room').then((apiResponse) {
|
||||
if (apiResponse.code != HttpStatusCodes.ok) {
|
||||
TopSlideNotification.show(
|
||||
context,
|
||||
text: apiResponse.msg!,
|
||||
textColor: themeController.currentColor.sc9,
|
||||
);
|
||||
// TopSlideNotification.show(
|
||||
// context,
|
||||
// text: apiResponse.msg!,
|
||||
// textColor: themeController.currentColor.sc9,
|
||||
// );
|
||||
} else {
|
||||
//请求睡眠报告
|
||||
// deviceController.getSleepReport();
|
||||
@@ -121,21 +121,21 @@ class _NewHomePageState extends State<NewHomePage> {
|
||||
//请求绑定设备列表
|
||||
// homeController.getSleepReport();
|
||||
deviceController.getDeviceNum().then((apiResponse) {
|
||||
if (apiResponse.code != HttpStatusCodes.ok) {
|
||||
TopSlideNotification.show(
|
||||
Get.context!,
|
||||
text: apiResponse.msg!,
|
||||
textColor: themeController.currentColor.sc9,
|
||||
);
|
||||
}
|
||||
// if (apiResponse.code != HttpStatusCodes.ok) {
|
||||
// TopSlideNotification.show(
|
||||
// Get.context!,
|
||||
// text: apiResponse.msg!,
|
||||
// textColor: themeController.currentColor.sc9,
|
||||
// );
|
||||
// }
|
||||
});
|
||||
deviceController.getDeviceList(group: 'room').then((apiResponse) {
|
||||
if (apiResponse.code != HttpStatusCodes.ok) {
|
||||
TopSlideNotification.show(
|
||||
Get.context!,
|
||||
text: apiResponse.msg!,
|
||||
textColor: themeController.currentColor.sc9,
|
||||
);
|
||||
// TopSlideNotification.show(
|
||||
// Get.context!,
|
||||
// text: apiResponse.msg!,
|
||||
// textColor: themeController.currentColor.sc9,
|
||||
// );
|
||||
} else {
|
||||
//请求睡眠报告
|
||||
// deviceController.getSleepReport();
|
||||
|
||||
@@ -310,7 +310,7 @@ class PeopleInfoPage extends GetView<PeopleInfoController> {
|
||||
decoration: BoxDecoration(),
|
||||
child: InkWell(
|
||||
onTap: () {
|
||||
// 触摸收起键盘
|
||||
// 延迟执行的代码
|
||||
FocusScope.of(context)
|
||||
.requestFocus(
|
||||
FocusNode());
|
||||
@@ -318,7 +318,6 @@ class PeopleInfoPage extends GetView<PeopleInfoController> {
|
||||
const Duration(
|
||||
milliseconds:
|
||||
250), () {
|
||||
// 延迟执行的代码
|
||||
showOneSelectionDialog(
|
||||
context,
|
||||
arr: ["女", "男"],
|
||||
@@ -338,12 +337,6 @@ class PeopleInfoPage extends GetView<PeopleInfoController> {
|
||||
sindex; // 👈 保存为 0 / 1
|
||||
controller
|
||||
.updateAll();
|
||||
print(
|
||||
"gender $sindex");
|
||||
}).then((d) {
|
||||
// Timer(Duration.zero, () {
|
||||
// FocusScope.of(context).unfocus();
|
||||
// });
|
||||
});
|
||||
});
|
||||
},
|
||||
@@ -409,77 +402,6 @@ class PeopleInfoPage extends GetView<PeopleInfoController> {
|
||||
)),
|
||||
),
|
||||
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,
|
||||
@@ -489,25 +411,26 @@ class PeopleInfoPage extends GetView<PeopleInfoController> {
|
||||
decoration: BoxDecoration(),
|
||||
child: InkWell(
|
||||
onTap: () {
|
||||
// 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;
|
||||
|
||||
FocusScope.of(context)
|
||||
.unfocus();
|
||||
.requestFocus(
|
||||
FocusNode());
|
||||
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:
|
||||
@@ -591,7 +514,8 @@ class PeopleInfoPage extends GetView<PeopleInfoController> {
|
||||
child: InkWell(
|
||||
onTap: () {
|
||||
FocusScope.of(context)
|
||||
.unfocus();
|
||||
.requestFocus(
|
||||
FocusNode());
|
||||
Future.delayed(
|
||||
const Duration(
|
||||
milliseconds:
|
||||
@@ -674,7 +598,6 @@ class PeopleInfoPage extends GetView<PeopleInfoController> {
|
||||
),
|
||||
)),
|
||||
),
|
||||
|
||||
getLine(),
|
||||
Obx(
|
||||
() => Container(
|
||||
@@ -686,7 +609,7 @@ class PeopleInfoPage extends GetView<PeopleInfoController> {
|
||||
decoration: BoxDecoration(),
|
||||
child: InkWell(
|
||||
onTap: () {
|
||||
// 触摸收起键盘
|
||||
// 延迟执行的代码
|
||||
FocusScope.of(context)
|
||||
.requestFocus(
|
||||
FocusNode());
|
||||
@@ -694,7 +617,6 @@ class PeopleInfoPage extends GetView<PeopleInfoController> {
|
||||
const Duration(
|
||||
milliseconds:
|
||||
250), () {
|
||||
// 延迟执行的代码
|
||||
showDateSelectionDialog(
|
||||
context,
|
||||
checkDate: controller
|
||||
@@ -718,10 +640,6 @@ class PeopleInfoPage extends GetView<PeopleInfoController> {
|
||||
controller
|
||||
.updateAll();
|
||||
print("$d");
|
||||
}).then((d) {
|
||||
// Timer(Duration.zero, () {
|
||||
// FocusScope.of(context).unfocus();
|
||||
// });
|
||||
});
|
||||
});
|
||||
},
|
||||
|
||||
@@ -71,7 +71,6 @@ class _PrivacyPolicyPageState extends State<PrivacyPolicyPage> {
|
||||
fontSize: 30.rpx,
|
||||
),
|
||||
),
|
||||
|
||||
/// 左边返回按钮
|
||||
Positioned(
|
||||
left: 0,
|
||||
|
||||
@@ -32,10 +32,17 @@ class WebviewTestController extends GetControllerEx<WebviewTestModel> {
|
||||
WebviewTestController() : super(WebviewTestModel()) {
|
||||
web = WebviewHelper(
|
||||
jsbridge: buildsdk(
|
||||
<<<<<<< HEAD
|
||||
// father: this,
|
||||
// clientId: '494641114',
|
||||
// dbgserverUrl: 'ws://192.168.1.2:9001',
|
||||
),
|
||||
=======
|
||||
father: this,
|
||||
clientId: '494641114',
|
||||
// dbgserverUrl: 'ws://192.168.1.2:9001',
|
||||
),
|
||||
>>>>>>> 58b2bebe936bdd7239529662ef20b531f2143de4
|
||||
settings: buildsettings(),
|
||||
params: PlatformHeadlessInAppWebViewCreationParams(
|
||||
initialUrlRequest: URLRequest(
|
||||
@@ -90,6 +97,7 @@ class WebviewTestController extends GetControllerEx<WebviewTestModel> {
|
||||
ef.log('updateBlueToothStatus: $args');
|
||||
// bluetooth = args[0];
|
||||
MHTHomeController deviceController = Get.find();
|
||||
await deviceController.getDeviceList(group: 'room');
|
||||
final allDevices = deviceController.deviceList.values
|
||||
.expand((list) => list)
|
||||
.toList();
|
||||
@@ -112,12 +120,7 @@ class WebviewTestController extends GetControllerEx<WebviewTestModel> {
|
||||
ef.log('queryInstantData: $args');
|
||||
// bluetooth = args[0];
|
||||
return instantData;
|
||||
});
|
||||
bridge.sdk.queryInstantData((args) async {
|
||||
ef.log('queryInstantData: $args');
|
||||
// bluetooth = args[0];
|
||||
return instantData;
|
||||
});
|
||||
});
|
||||
bridge.sdk.startTimer((args) async {
|
||||
ef.log('queryInstantData: $args');
|
||||
MHTHomeController homeController = Get.find();
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:fl_chart/fl_chart.dart';
|
||||
import 'package:vbvs_app/common/color/appConstants.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:vbvs_app/common/util/FitTool.dart';
|
||||
import 'package:vbvs_app/common/util/MyUtils.dart';
|
||||
|
||||
|
||||
@@ -148,13 +148,16 @@ class _HeartChangeWidgetState extends State<HeartChangeWidget> {
|
||||
alignment: MainAxisAlignment.center,
|
||||
widget1: Row(
|
||||
children: [
|
||||
Text(
|
||||
'${data['name']}',
|
||||
maxLines: 1,
|
||||
overflow: TextOverflow.ellipsis,
|
||||
style: TextStyle(
|
||||
color: themeController.currentColor.sc3,
|
||||
fontSize: AppConstants().normal_text_fontSize,
|
||||
Expanded(
|
||||
child: Text(
|
||||
'${data['name']}',
|
||||
maxLines: 1,
|
||||
overflow: TextOverflow.ellipsis,
|
||||
style: TextStyle(
|
||||
color: themeController.currentColor.sc3,
|
||||
fontSize:
|
||||
AppConstants().normal_text_fontSize,
|
||||
),
|
||||
),
|
||||
),
|
||||
ClickableContainer(
|
||||
@@ -261,7 +264,7 @@ class _HeartChangeWidgetState extends State<HeartChangeWidget> {
|
||||
),
|
||||
);
|
||||
} catch (e) {
|
||||
es.EasyDartModule.logger.error("打鼾监测绘制异常${e}");
|
||||
es.EasyDartModule.logger.error("打鼾监测绘制异常${e}");
|
||||
return Container();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -6,10 +6,10 @@ import 'package:vbvs_app/common/color/appConstants.dart';
|
||||
import 'package:vbvs_app/common/util/FitTool.dart';
|
||||
import 'package:vbvs_app/common/util/MyUtils.dart';
|
||||
import 'package:vbvs_app/common/util/requestWithLog.dart';
|
||||
import 'package:vbvs_app/component/NullDataComponentWidget.dart';
|
||||
import 'package:vbvs_app/component/tool/ClickableContainer.dart';
|
||||
import 'package:vbvs_app/component/tool/TopSlideNotification.dart';
|
||||
import 'package:vbvs_app/controller/date/CalendarController.dart';
|
||||
import 'package:vbvs_app/controller/home/home_controller.dart';
|
||||
import 'package:vbvs_app/controller/sleep/sleep_report_controller.dart';
|
||||
import 'package:vbvs_app/language/AppLanguage.dart';
|
||||
import 'package:vbvs_app/pages/common/selectDialog.dart';
|
||||
@@ -147,8 +147,15 @@ class _NewSleepReportPageState extends State<NewSleepReportPage> {
|
||||
_scrollToTargetComponent(sleepReportController.sleepReport);
|
||||
},
|
||||
onFailure: (res) {
|
||||
TopSlideNotification.show(context,
|
||||
text: res.msg!, textColor: themeController.currentColor.sc9);
|
||||
if (MainPageBBottomChange.getCurrentIndex() != null) {
|
||||
if (MainPageBBottomChange.getCurrentIndex() == 1) {
|
||||
TopSlideNotification.show(context,
|
||||
text: res.msg!, textColor: themeController.currentColor.sc9);
|
||||
}
|
||||
} else {
|
||||
TopSlideNotification.show(context,
|
||||
text: res.msg!, textColor: themeController.currentColor.sc9);
|
||||
}
|
||||
sleepReportController.sleepReport.value = {};
|
||||
sleepReportController.updateAll();
|
||||
print(res);
|
||||
@@ -609,6 +616,12 @@ class _NewSleepReportPageState extends State<NewSleepReportPage> {
|
||||
),
|
||||
),
|
||||
),
|
||||
if (sleepReport.value == null ||
|
||||
sleepReport.value.isEmpty)
|
||||
Container(
|
||||
height: 500.rpx,
|
||||
child: NullDataWidget(),
|
||||
),
|
||||
Padding(
|
||||
padding: EdgeInsetsDirectional.fromSTEB(
|
||||
30.rpx, 0.rpx, 30.rpx, 0),
|
||||
@@ -851,8 +864,16 @@ class _NewSleepReportPageState extends State<NewSleepReportPage> {
|
||||
sleepReportController.updateAll();
|
||||
},
|
||||
onFailure: (res) {
|
||||
TopSlideNotification.show(context,
|
||||
text: res.msg!, textColor: themeController.currentColor.sc9);
|
||||
if (MainPageBBottomChange.getCurrentIndex() != null) {
|
||||
if (MainPageBBottomChange.getCurrentIndex() == 1) {
|
||||
TopSlideNotification.show(context,
|
||||
text: res.msg!,
|
||||
textColor: themeController.currentColor.sc9);
|
||||
}
|
||||
} else {
|
||||
TopSlideNotification.show(context,
|
||||
text: res.msg!, textColor: themeController.currentColor.sc9);
|
||||
}
|
||||
sleepReportController.sleepReport.value = {};
|
||||
sleepReportController.updateAll();
|
||||
print(res);
|
||||
@@ -890,8 +911,16 @@ class _NewSleepReportPageState extends State<NewSleepReportPage> {
|
||||
sleepReportController.updateAll();
|
||||
},
|
||||
onFailure: (res) {
|
||||
TopSlideNotification.show(context,
|
||||
text: res.msg!, textColor: themeController.currentColor.sc9);
|
||||
if (MainPageBBottomChange.getCurrentIndex() != null) {
|
||||
if (MainPageBBottomChange.getCurrentIndex() == 1) {
|
||||
TopSlideNotification.show(context,
|
||||
text: res.msg!,
|
||||
textColor: themeController.currentColor.sc9);
|
||||
}
|
||||
} else {
|
||||
TopSlideNotification.show(context,
|
||||
text: res.msg!, textColor: themeController.currentColor.sc9);
|
||||
}
|
||||
sleepReportController.sleepReport.value = {};
|
||||
sleepReportController.updateAll();
|
||||
print(res);
|
||||
@@ -974,9 +1003,17 @@ class _NewSleepReportPageState extends State<NewSleepReportPage> {
|
||||
sleepReportController.updateAll();
|
||||
},
|
||||
onFailure: (res) {
|
||||
TopSlideNotification.show(context,
|
||||
text: res.msg!,
|
||||
textColor: themeController.currentColor.sc9);
|
||||
if (MainPageBBottomChange.getCurrentIndex() != null) {
|
||||
if (MainPageBBottomChange.getCurrentIndex() == 1) {
|
||||
TopSlideNotification.show(context,
|
||||
text: res.msg!,
|
||||
textColor: themeController.currentColor.sc9);
|
||||
}
|
||||
} else {
|
||||
TopSlideNotification.show(context,
|
||||
text: res.msg!,
|
||||
textColor: themeController.currentColor.sc9);
|
||||
}
|
||||
sleepReportController.sleepReport.value = {};
|
||||
sleepReportController.updateAll();
|
||||
print(res);
|
||||
|
||||
@@ -94,7 +94,7 @@ var mhroutes = {
|
||||
"/deviceListPage": (context) => DeviceListPage(),
|
||||
"/mHTDeviceTypePage": (context, {arguments}) => MHTBindDeviceTypePage(),
|
||||
"/mHTBlueteethDevicePage": (context, {arguments}) =>
|
||||
MHTBlueteethDevicePage(data: arguments),
|
||||
MHTBlueteethDevicePage(deviceType: arguments),
|
||||
"/mHTwifiPage": (contxt, {arguments}) => MHTWifiPage(deviceInfo: arguments),
|
||||
"/calibrationPage": (contxt) => MHTCalibrationPage(),
|
||||
"/bindDeviceSuccess": (contxt) => MHTBindDeviceSuccess(),
|
||||
|
||||
@@ -65,7 +65,7 @@ dependencies:
|
||||
easyweb:
|
||||
git:
|
||||
url: https://gitea.wslpc.real.he-info.cn:94/flutter/easyweb.git
|
||||
ref: e86d515f77
|
||||
ref: main
|
||||
archive: ^4.0.0
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user