更新睡眠报告正式地址

This commit is contained in:
wyf
2025-08-30 09:15:18 +08:00
parent ae6933bd96
commit f7b11fbb7e
14 changed files with 278 additions and 168 deletions

View File

@@ -1,5 +1,6 @@
import 'package:flutter/material.dart';
import 'package:get/get.dart';
import 'package:vbvs_app/common/color/ServiceConstant.dart';
import 'package:vbvs_app/common/color/appConstants.dart';
import 'package:vbvs_app/common/util/FitTool.dart';
import 'package:vbvs_app/common/util/MyUtils.dart';
@@ -66,11 +67,17 @@ class _SleepCalendarWidgetState extends State<SleepCalendarWidget> {
Future<void> fetchDate(DateTime timeStamp) async {
final dateStr = timeStamp.toString().split(' ')[0];
String serviceAddress = ServiceConstant.service_address;
String serviceName = ServiceConstant.server_service;
String serviceApi = ServiceConstant.sleep_report;
String queryUrl =
"$serviceAddress$serviceName$serviceApi?mac=${widget.mac}&time=$dateStr&type=3&sleepType=2";
await requestWithLog(
logTitle: "查询睡眠报告",
method: MyHttpMethod.get,
queryUrl:
"https://sleepdata.he-info.com/api/analysis/sleep/analysis?mac=${widget.mac}&time=$dateStr&type=3",
// queryUrl:
// "https://sleepdata.he-info.com/api/analysis/sleep/analysis?mac=${widget.mac}&time=$dateStr&type=3",
queryUrl: queryUrl,
onSuccess: (res) {
sleepDate.value = res.data;
},

View File

@@ -223,8 +223,7 @@ class BodyDeviceController extends GetControllerEx<BodyDeviceModel> {
sleepReportData[mac] = []; // 初始化当前设备的数据列表
String queryUrl =
"$serviceAddress$serviceName$serviceApi?mac=$mac&time=${DateTime.now().millisecondsSinceEpoch}";
"$serviceAddress$serviceName$serviceApi?mac=$mac&time=${DateTime.now().millisecondsSinceEpoch}&sleepType=1";
try {
String? language = "";
if (languageController.selectLanguage != null) {

View File

@@ -291,16 +291,16 @@ class _InstantBodyPageState extends State<InstantBodyPage>
.currentColor.sc4,
),
),
Text(
'实时体征.年龄'.tr,
style: TextStyle(
fontFamily: 'Inter',
fontSize: 26.rpx,
letterSpacing: 0.0,
color: themeController
.currentColor.sc4,
),
),
// Text(
// '实时体征.年龄'.tr,
// style: TextStyle(
// fontFamily: 'Inter',
// fontSize: 26.rpx,
// letterSpacing: 0.0,
// color: themeController
// .currentColor.sc4,
// ),
// ),
].divide(
SizedBox(height: 34.rpx)),
),
@@ -318,16 +318,16 @@ class _InstantBodyPageState extends State<InstantBodyPage>
.currentColor.sc3,
),
),
Text(
'${MyUtils.getAgeByDate(MyUtils.formatBirthdayTime(device['person']?['birthday'])) ?? '未知数据'.tr}',
style: TextStyle(
fontFamily: 'Inter',
fontSize: 26.rpx,
letterSpacing: 0.0,
color: themeController
.currentColor.sc3,
),
),
// Text(
// '${MyUtils.getAgeByDate(MyUtils.formatBirthdayTime(device['person']?['birthday'])) ?? '未知数据'.tr}',
// style: TextStyle(
// fontFamily: 'Inter',
// fontSize: 26.rpx,
// letterSpacing: 0.0,
// color: themeController
// .currentColor.sc3,
// ),
// ),
].divide(
SizedBox(height: 34.rpx)),
),
@@ -363,16 +363,16 @@ class _InstantBodyPageState extends State<InstantBodyPage>
.currentColor.sc4,
),
),
Text(
'实时体征.体重'.tr,
style: TextStyle(
fontFamily: 'Inter',
fontSize: 26.rpx,
letterSpacing: 0.0,
color: themeController
.currentColor.sc4,
),
),
// Text(
// '实时体征.体重'.tr,
// style: TextStyle(
// fontFamily: 'Inter',
// fontSize: 26.rpx,
// letterSpacing: 0.0,
// color: themeController
// .currentColor.sc4,
// ),
// ),
].divide(
SizedBox(height: 34.rpx)),
),
@@ -395,16 +395,16 @@ class _InstantBodyPageState extends State<InstantBodyPage>
overflow:
TextOverflow.ellipsis,
),
Text(
'${device['person']?['weight'] ?? '未知数据'.tr}kg',
style: TextStyle(
fontFamily: 'Inter',
fontSize: 26.rpx,
letterSpacing: 0.0,
color: themeController
.currentColor.sc3,
),
),
// Text(
// '${device['person']?['weight'] ?? '未知数据'.tr}kg',
// style: TextStyle(
// fontFamily: 'Inter',
// fontSize: 26.rpx,
// letterSpacing: 0.0,
// color: themeController
// .currentColor.sc3,
// ),
// ),
].divide(
SizedBox(height: 34.rpx)),
),

View File

@@ -383,6 +383,7 @@ class _HomePageState extends State<HomePage> {
.currentColor.sc4,
),
),
].divide(SizedBox(
width: 20.rpx,
)),

View File

@@ -81,27 +81,27 @@ class MainPageBottomChange extends GetView<MainPageController> {
final getStorage = GetStorage();
@override
Widget build(BuildContext context) {
Future.delayed(const Duration(milliseconds: 0), () {
String? isShowYingShiDialog = getStorage.read("isShowYingShiDialog");
if (isShowYingShiDialog == null || isShowYingShiDialog != "true") {
String btnName = "同意".tr;
String cancelName = "取消".tr;
if (Platform.isAndroid) {
cancelName = "退出".tr;
}
showCustomConfirmOfWebViewDialog(context, "隐私协议".tr, getPrivacy(1),
btnName: btnName, showCancel: true, cancelName: cancelName)
.then((e) {
if (e == "confirm") {
getStorage.write("isShowYingShiDialog", "true");
} else {
if (cancelName == "退出") {
SystemNavigator.pop();
}
}
});
}
});
// Future.delayed(const Duration(milliseconds: 0), () {
// String? isShowYingShiDialog = getStorage.read("isShowYingShiDialog");
// if (isShowYingShiDialog == null || isShowYingShiDialog != "true") {
// String btnName = "同意".tr;
// String cancelName = "取消".tr;
// if (Platform.isAndroid) {
// cancelName = "退出".tr;
// }
// showCustomConfirmOfWebViewDialog(context, "隐私协议".tr, getPrivacy(1),
// btnName: btnName, showCancel: true, cancelName: cancelName)
// .then((e) {
// if (e == "confirm") {
// getStorage.write("isShowYingShiDialog", "true");
// } else {
// if (cancelName == "退出") {
// SystemNavigator.pop();
// }
// }
// });
// }
// });
return PopScope(
canPop: false,

View File

@@ -42,6 +42,7 @@ class _MHTWifiAfterPageState extends State<MHTWifiAfterPage> {
Timer? _timeoutTimer;
StreamSubscription<List<ScanResult>>? _scanSubscription;
bool _isDisposed = false;
ScanResult? targetDevice;
@override
void initState() {
@@ -916,7 +917,7 @@ class _MHTWifiAfterPageState extends State<MHTWifiAfterPage> {
_scanSubscription = FlutterBluePlus.scanResults.listen((results) async {
if (_isDisposed) return;
ScanResult? targetDevice;
for (var r in results) {
if (r.advertisementData.manufacturerData.containsKey(0xFFED)) {
@@ -937,7 +938,7 @@ class _MHTWifiAfterPageState extends State<MHTWifiAfterPage> {
_scanSubscription?.cancel();
try {
THapp bledevice = THapp(device: targetDevice.device);
THapp bledevice = THapp(device: targetDevice!.device);
await bledevice.device.connect();
var res2 = bledevice.isConnected;
@@ -1085,7 +1086,8 @@ class _MHTWifiAfterPageState extends State<MHTWifiAfterPage> {
Future<void> _disconnectDevice() async {
try {
THapp bledevice = THapp(device: widget.deviceInfo.scanResult.device);
// THapp bledevice = THapp(device: widget.deviceInfo.scanResult.device);
THapp bledevice = THapp(device: targetDevice!.device);
await bledevice.disconnect();
DailyLogUtils.writeLog("关闭蓝牙连接成功".tr);
} catch (e) {

View File

@@ -434,6 +434,7 @@ class MHTHomeController extends GetControllerEx<MHTHomeModel> {
queryParams.add("mac=$mac");
}
queryParams.add("time=$timestamp");
queryParams.add("sleepType=1");
if (queryParams.isNotEmpty) {
queryUrl += "?${queryParams.join("&")}";
@@ -502,6 +503,7 @@ class MHTHomeController extends GetControllerEx<MHTHomeModel> {
queryParams.add("mac=$mac");
}
queryParams.add("time=$timestamp");
queryParams.add("sleepType=1");
if (queryParams.isNotEmpty) {
queryUrl += "?${queryParams.join("&")}";

View File

@@ -4,6 +4,7 @@ import 'package:ef/ef.dart';
import 'package:flutter/material.dart';
import 'package:flutter_svg/svg.dart';
import 'package:flutterflow_ui/flutterflow_ui.dart';
import 'package:vbvs_app/common/color/ServiceConstant.dart';
import 'package:vbvs_app/common/color/appConstants.dart';
import 'package:vbvs_app/common/color/app_uri_status.dart';
import 'package:vbvs_app/common/util/FitTool.dart';
@@ -501,12 +502,14 @@ class _MhtSleepReportPageState extends State<MhtSleepReportPage> {
padding: EdgeInsets.fromLTRB(
0, 30.rpx, 0, 0),
child: Center(
child:CircularProgressIndicator(
strokeWidth: 2,
valueColor: AlwaysStoppedAnimation<Color>(
themeController.currentColor.sc1,
),
),),
child: CircularProgressIndicator(
strokeWidth: 2,
valueColor:
AlwaysStoppedAnimation<Color>(
themeController.currentColor.sc1,
),
),
),
)
: hasValidData
? Column(
@@ -682,11 +685,17 @@ class _MhtSleepReportPageState extends State<MhtSleepReportPage> {
void loadSleepReport(String data) {
isLoading.value = true;
String serviceAddress = ServiceConstant.service_address;
String serviceName = ServiceConstant.server_service;
String serviceApi = ServiceConstant.sleep_report;
String queryUrl =
"$serviceAddress$serviceName$serviceApi?mac=${homeController.selectDevcie.value}&time=${data}&type=1&sleepType=2";
requestWithLog(
logTitle: "查询睡眠报告",
method: MyHttpMethod.get,
queryUrl:
"https://sleepdata.he-info.com/api/analysis/sleep/analysis?mac=${homeController.selectDevcie.value}&time=${data}&type=1",
// queryUrl:
// "https://sleepdata.he-info.com/api/analysis/sleep/analysis?mac=${homeController.selectDevcie.value}&time=${data}&type=1",
queryUrl: queryUrl,
onSuccess: (res) {
isLoading.value = false;
print(res);

View File

@@ -285,10 +285,11 @@ class _NewHomePageState extends State<NewHomePage> {
clipBehavior: Clip.antiAlias,
decoration: BoxDecoration(
shape: BoxShape.circle),
child: Image.network(
weatherModelController
.model.weatherIconurl!,
fit: BoxFit.cover,
child: SvgPicture.asset(
"assets/images/weather/${weatherModelController.model.weatherIconurl}-fill.svg",
// fit: BoxFit.cover,
color: themeController
.currentColor.sc4,
),
),
].divide(SizedBox(

View File

@@ -44,10 +44,11 @@ class WebviewTestController extends GetControllerEx<WebviewTestModel> {
web = WebviewHelper(
isheadless: false,
jsbridge: buildsdk(
// father: this,
// clientId: '494641114',
// dbgserverUrl: 'ws://192.168.1.2:9001',
),
// father: this,
// clientId: '123',
// clientId: '494641114',
// dbgserverUrl: 'ws://192.168.1.2:9001',
),
settings: buildsettings(),
params: PlatformHeadlessInAppWebViewCreationParams(
onLoadStop: (controller, url) {
@@ -56,9 +57,9 @@ class WebviewTestController extends GetControllerEx<WebviewTestModel> {
});
},
onLoadResource: (controller, resource) {
sourceTime = web.requestTimestamp;
ef.log("[请求资源时间]${web.requestTimestamp}");
_startMonitoringIfNeeded();
// sourceTime = web.requestTimestamp;
// ef.log("[请求资源时间]${web.requestTimestamp}");`
// _startMonitoringIfNeeded();
},
),
);
@@ -113,7 +114,6 @@ class WebviewTestController extends GetControllerEx<WebviewTestModel> {
});
}
final normalizedMac = mac.replaceAll(":", "").toUpperCase();
if (deviceId != null &&
@@ -291,7 +291,7 @@ class WebviewTestController extends GetControllerEx<WebviewTestModel> {
return true;
});
bridge.sdk.updatePermisson((args) async {
ef.log('获取权限: $args[0]');
// ef.log('获取权限: $args[0]');
try {
if (MainPageBBottomChange.getCurrentIndex() != 2) {
return false;
@@ -331,6 +331,17 @@ class WebviewTestController extends GetControllerEx<WebviewTestModel> {
// }
// return true;
// });
bridge.sdk.loadFinish((args) async {
ef.log('[资源加载完成]: $args[0]');
try {
loadRecource.value = true;
updateAll();
return true;
} catch (e) {
ef.log("[资源加载完成]:$e");
}
return true;
});
});
} catch (e, s) {
ef.log('$e,$s');
@@ -371,7 +382,7 @@ class WebviewTestController extends GetControllerEx<WebviewTestModel> {
ws = Easyws(
url: ServiceConstant.webSocketService,
onData: (data) {
ef.log("ws recv =>$data");
// ef.log("ws recv =>$data");
try {
var tmp;
if (data is String) {
@@ -412,7 +423,7 @@ class WebviewTestController extends GetControllerEx<WebviewTestModel> {
"data": {"mac".tr: mac},
});
if (success) {
ef.log("✅ 已取消监听:$mac");
// ef.log("✅ 已取消监听:$mac");
}
}
}
@@ -435,7 +446,7 @@ class WebviewTestController extends GetControllerEx<WebviewTestModel> {
"data": {"mac".tr: mac},
});
if (success) {
ef.log("✅ 开始监听新设备:$mac");
// ef.log("✅ 开始监听新设备:$mac");
}
}
}
@@ -470,25 +481,6 @@ class WebviewTestController extends GetControllerEx<WebviewTestModel> {
ef.log('$e,$s');
}
}
void _startMonitoringIfNeeded() {
// 如果定时器已启动,则无需重新启动
if (_resourceLoadTimer != null) return;
_resourceLoadTimer = Timer.periodic(Duration(seconds: 1), (timer) {
int now = DateTime.now().millisecondsSinceEpoch;
if (sourceTime == 0) return; // 还未加载任何资源
if (now - sourceTime > 3000) {
ef.log("[资源加载完成] 当前时间: $now, 上次请求时间: $sourceTime");
_resourceLoadTimer?.cancel();
_resourceLoadTimer = null;
loadRecource.value = true;
updateAll();
}
});
}
}
class WebviewTestView extends GetComponent<WebviewTestController> {
@@ -634,19 +626,67 @@ class WebviewTestView extends GetComponent<WebviewTestController> {
child: Align(
alignment: Alignment.topLeft,
child: Obx(() {
int? aa = MainPageBBottomChange.getCurrentIndex();
print(aa);
// return (controller.ready.value && (MainPageBBottomChange.getCurrentIndex() == 2))
return (controller.ready.value)
? controller.web.build()
: Center(
child: CircularProgressIndicator(
strokeWidth: 2,
valueColor: AlwaysStoppedAnimation<Color>(
themeController.currentColor.sc1,
// return (controller.ready.value && (MainPageBBottomChange.getCurrentIndex() == 2)&& controller.loadRecource.value == true)
// return Stack(children: [
// controller.ready.value
// ? controller.web.build()
// : Container(),
// Text("1222121212"),
// ]);
// return Stack(
// children: [
// controller.ready.value
// ? controller.web.build()
// : Container(),
// // 只有 loadRecource == false 时才显示覆盖文字
// if (!controller.loadRecource.value)
// Positioned.fill(
// child: Container(
// color: Colors.black54, // 半透明遮罩,可选
// alignment: Alignment.center,
// child: Text(
// "资源加载中...",
// style: TextStyle(
// color: Colors.red,
// fontSize: 30.rpx,
// fontWeight: FontWeight.bold,
// ),
// ),
// ),
// ),
// ],
// );
return Stack(
children: [
controller.ready.value
? controller.web.build()
: Container(),
if (!controller.loadRecource.value)
Positioned.fill(
child: Container(
decoration: BoxDecoration(
image: DecorationImage(
image: AssetImage(
'assets/images/new_background.png'),
fit: BoxFit.fill,
),
),
alignment: Alignment.center,
child: Column(
mainAxisSize: MainAxisSize.min,
children: [
CircularProgressIndicator(
valueColor: AlwaysStoppedAnimation<Color>(
Colors.white),
),
],
),
),
);
),
],
);
}),
),
),

View File

@@ -4,6 +4,7 @@ import 'package:ef/ef.dart';
import 'package:flutter/material.dart';
import 'package:flutter_svg/svg.dart';
import 'package:flutterflow_ui/flutterflow_ui.dart';
import 'package:vbvs_app/common/color/ServiceConstant.dart';
import 'package:vbvs_app/common/color/appConstants.dart';
import 'package:vbvs_app/common/util/FitTool.dart';
import 'package:vbvs_app/common/util/MyUtils.dart';
@@ -78,12 +79,19 @@ class _NewSleepReportPageState extends State<NewSleepReportPage> {
sleepReportController.model.type = 1;
}
String serviceAddress = ServiceConstant.service_address;
String serviceName = ServiceConstant.server_service;
String serviceApi = ServiceConstant.sleep_report;
String date = MyUtils.formatToDate(widget.data['date']);
String queryUrl =
"$serviceAddress$serviceName$serviceApi?mac=${widget.data['mac']}&time=$date&type=${sleepReportController.model.type}&type=1&sleepType=2";
requestWithLog(
logTitle: "查询睡眠报告",
method: MyHttpMethod.get,
queryUrl:
"https://sleepdata.he-info.com/api/analysis/sleep/analysis?mac=${widget.data['mac']}&time=$date&type=${sleepReportController.model.type}",
// queryUrl:
// "https://sleepdata.he-info.com/api/analysis/sleep/analysis?mac=${widget.data['mac']}&time=$date&type=${sleepReportController.model.type}",
queryUrl: queryUrl,
onSuccess: (res) {
sleepReportController.sleepReport.value = res.data;
sleepReportController.updateAll();
@@ -408,7 +416,7 @@ class _NewSleepReportPageState extends State<NewSleepReportPage> {
flex: 2,
child: Padding(
padding: EdgeInsets.fromLTRB(
16.rpx, 0, 0, 0),
16.rpx, 36.rpx, 0, 36.rpx),
child: Column(
children: [
_buildBaselineRow(
@@ -425,13 +433,13 @@ class _NewSleepReportPageState extends State<NewSleepReportPage> {
: '未知数据'.tr,
themeController: themeController,
),
SizedBox(height: 34.rpx),
_buildBaselineRow(
label: '年龄'.tr,
value:
'${MyUtils.getAgeByDate(MyUtils.formatBirthdayTime(widget.data['person']?['birthday'])) ?? '未知数据'.tr}',
themeController: themeController,
),
// SizedBox(height: 34.rpx),
// _buildBaselineRow(
// label: '年龄'.tr,
// value:
// '${MyUtils.getAgeByDate(MyUtils.formatBirthdayTime(widget.data['person']?['birthday'])) ?? '未知数据'.tr}',
// themeController: themeController,
// ),
],
),
),
@@ -451,13 +459,13 @@ class _NewSleepReportPageState extends State<NewSleepReportPage> {
'${widget.data['code'] ?? widget.data['mac']}',
themeController: themeController,
),
SizedBox(height: 34.rpx),
_buildBaselineRow(
label: '体重'.tr,
value:
'${widget.data['person']?['weight'] ?? '未知数据'.tr}kg',
themeController: themeController,
),
// SizedBox(height: 34.rpx),
// _buildBaselineRow(
// label: '体重'.tr,
// value:
// '${widget.data['person']?['weight'] ?? '未知数据'.tr}kg',
// themeController: themeController,
// ),
],
),
),
@@ -790,13 +798,13 @@ class _NewSleepReportPageState extends State<NewSleepReportPage> {
: '未知数据'.tr,
themeController: themeController,
),
SizedBox(height: 34.rpx),
_buildBaselineRow(
label: '年龄'.tr,
value:
'${MyUtils.getAgeByDate(MyUtils.formatBirthdayTime(widget.data['person']?['birthday'])) ?? '未知数据'.tr}',
themeController: themeController,
),
// SizedBox(height: 34.rpx),
// _buildBaselineRow(
// label: '年龄'.tr,
// value:
// '${MyUtils.getAgeByDate(MyUtils.formatBirthdayTime(widget.data['person']?['birthday'])) ?? '未知数据'.tr}',
// themeController: themeController,
// ),
],
),
),
@@ -814,13 +822,13 @@ class _NewSleepReportPageState extends State<NewSleepReportPage> {
'${widget.data['code'] ?? widget.data['mac']}',
themeController: themeController,
),
SizedBox(height: 34.rpx),
_buildBaselineRow(
label: '体重'.tr,
value:
'${widget.data['person']?['weight'] ?? '未知数据'.tr}kg',
themeController: themeController,
),
// SizedBox(height: 34.rpx),
// _buildBaselineRow(
// label: '体重'.tr,
// value:
// '${widget.data['person']?['weight'] ?? '未知数据'.tr}kg',
// themeController: themeController,
// ),
],
),
),
@@ -940,11 +948,17 @@ class _NewSleepReportPageState extends State<NewSleepReportPage> {
sleepReportController.selectedDate.value;
// String date = MyUtils.formatToDate(widget.data['date']);
String data = MyUtils.formatDate(calendarController.selectedDate.value!);
String serviceAddress = ServiceConstant.service_address;
String serviceName = ServiceConstant.server_service;
String serviceApi = ServiceConstant.sleep_report;
String queryUrl =
"$serviceAddress$serviceName$serviceApi?mac=${widget.data['mac']}&time=${data}&type=${sleepReportController.model.type}&sleepType=2";
requestWithLog(
logTitle: "查询睡眠报告",
method: MyHttpMethod.get,
queryUrl:
"https://sleepdata.he-info.com/api/analysis/sleep/analysis?mac=${widget.data['mac']}&time=${data}&type=${sleepReportController.model.type}",
// queryUrl:
// "https://sleepdata.he-info.com/api/analysis/sleep/analysis?mac=${widget.data['mac']}&time=${data}&type=${sleepReportController.model.type}",
queryUrl: queryUrl,
onSuccess: (res) {
print(res);
sleepReportController.sleepReport.value = res.data;
@@ -1025,11 +1039,17 @@ class _NewSleepReportPageState extends State<NewSleepReportPage> {
calendarController.selectedDate.value = targetDate;
String data = MyUtils.formatDate(targetDate);
String serviceAddress = ServiceConstant.service_address;
String serviceName = ServiceConstant.server_service;
String serviceApi = ServiceConstant.sleep_report;
String queryUrl =
"$serviceAddress$serviceName$serviceApi?mac=${widget.data['mac']}&time=${data}&type=${sleepReportController.model.type}&sleepType=2";
requestWithLog(
logTitle: "查询睡眠报告",
method: MyHttpMethod.get,
queryUrl:
"https://sleepdata.he-info.com/api/analysis/sleep/analysis?mac=${widget.data['mac']}&time=${data}&type=${sleepReportController.model.type}",
// queryUrl:
// "https://sleepdata.he-info.com/api/analysis/sleep/analysis?mac=${widget.data['mac']}&time=${data}&type=${sleepReportController.model.type}",
queryUrl: queryUrl,
onSuccess: (res) {
print(res);
sleepReportController.sleepReport.value = res.data;
@@ -1069,11 +1089,17 @@ class _NewSleepReportPageState extends State<NewSleepReportPage> {
sleepReportController.selectedDate.value;
// String date = MyUtils.formatToDate(widget.data['date']);
String data = MyUtils.formatDate(calendarController.selectedDate.value!);
String serviceAddress = ServiceConstant.service_address;
String serviceName = ServiceConstant.server_service;
String serviceApi = ServiceConstant.sleep_report;
String queryUrl =
"$serviceAddress$serviceName$serviceApi?mac=${widget.data['mac']}&time=${data}&type=${sleepReportController.model.type}&sleepType=2";
requestWithLog(
logTitle: "查询睡眠报告",
method: MyHttpMethod.get,
queryUrl:
"https://sleepdata.he-info.com/api/analysis/sleep/analysis?mac=${widget.data['mac']}&time=${data}&type=${sleepReportController.model.type}",
// queryUrl:
// "https://sleepdata.he-info.com/api/analysis/sleep/analysis?mac=${widget.data['mac']}&time=${data}&type=${sleepReportController.model.type}",
queryUrl: queryUrl,
onSuccess: (res) {
print(res);
sleepReportController.sleepReport.value = res.data;
@@ -1162,11 +1188,17 @@ class _NewSleepReportPageState extends State<NewSleepReportPage> {
String data = MyUtils.formatDate(
calendarController.selectedDate.value!);
String serviceAddress = ServiceConstant.service_address;
String serviceName = ServiceConstant.server_service;
String serviceApi = ServiceConstant.sleep_report;
String queryUrl =
"$serviceAddress$serviceName$serviceApi?mac=${widget.data['mac']}&time=${data}&type=${sleepReportController.model.type}&sleepType=2";
requestWithLog(
logTitle: "查询睡眠报告",
method: MyHttpMethod.get,
queryUrl:
"https://sleepdata.he-info.com/api/analysis/sleep/analysis?mac=${widget.data['mac']}&time=${data}&type=${sleepReportController.model.type}",
// queryUrl:
// "https://sleepdata.he-info.com/api/analysis/sleep/analysis?mac=${widget.data['mac']}&time=${data}&type=${sleepReportController.model.type}",
queryUrl: queryUrl,
onSuccess: (res) {
print(res);
sleepReportController.sleepReport.value = res.data;
@@ -1204,11 +1236,17 @@ class _NewSleepReportPageState extends State<NewSleepReportPage> {
calendarController.selectedDate.value = newDate;
String data = MyUtils.formatDate(
calendarController.selectedDate.value!);
String serviceAddress = ServiceConstant.service_address;
String serviceName = ServiceConstant.server_service;
String serviceApi = ServiceConstant.sleep_report;
String queryUrl =
"$serviceAddress$serviceName$serviceApi?mac=${widget.data['mac']}&time=${data}&type=${sleepReportController.model.type}&sleepType=2";
requestWithLog(
logTitle: "查询睡眠报告",
method: MyHttpMethod.get,
queryUrl:
"https://sleepdata.he-info.com/api/analysis/sleep/analysis?mac=${widget.data['mac']}&time=${data}&type=${sleepReportController.model.type}",
// queryUrl:
// "https://sleepdata.he-info.com/api/analysis/sleep/analysis?mac=${widget.data['mac']}&time=${data}&type=${sleepReportController.model.type}",
queryUrl: queryUrl,
onSuccess: (res) {
print(res);
sleepReportController.sleepReport.value =
@@ -1313,11 +1351,17 @@ class _NewSleepReportPageState extends State<NewSleepReportPage> {
sleepReportController.isLoading.value = true;
String data = MyUtils.formatDate(calendarController.selectedDate.value!);
String serviceAddress = ServiceConstant.service_address;
String serviceName = ServiceConstant.server_service;
String serviceApi = ServiceConstant.sleep_report;
String queryUrl =
"$serviceAddress$serviceName$serviceApi?mac=${widget.data['mac']}&time=$data&type=$type&sleepType=2";
await requestWithLog(
logTitle: "查询睡眠报告",
method: MyHttpMethod.get,
queryUrl:
"https://sleepdata.he-info.com/api/analysis/sleep/analysis?mac=${widget.data['mac']}&time=$data&type=$type",
// queryUrl:
// "https://sleepdata.he-info.com/api/analysis/sleep/analysis?mac=${widget.data['mac']}&time=$data&type=$type",
queryUrl: queryUrl,
onSuccess: (res) {
sleepReportController.sleepReport.value = res.data;
},
@@ -1389,12 +1433,17 @@ class _NewSleepReportPageState extends State<NewSleepReportPage> {
String dateStr = MyUtils.formatToDate(widget.data['date']);
sleepReportController.isLoading.value = true;
String serviceAddress = ServiceConstant.service_address;
String serviceName = ServiceConstant.server_service;
String serviceApi = ServiceConstant.sleep_report;
String queryUrl =
"$serviceAddress$serviceName$serviceApi?mac=${widget.data['mac']}&time=$dateStr&type=${sleepReportController.model.type}&sleepType=2";
requestWithLog(
logTitle: "查询睡眠报告",
method: MyHttpMethod.get,
queryUrl:
"https://sleepdata.he-info.com/api/analysis/sleep/analysis?mac=${widget.data['mac']}&time=$dateStr&type=${sleepReportController.model.type}",
// queryUrl:
// "https://sleepdata.he-info.com/api/analysis/sleep/analysis?mac=${widget.data['mac']}&time=$dateStr&type=${sleepReportController.model.type}",
queryUrl: queryUrl,
onSuccess: (res) {
sleepReportController.isLoading.value = false;
sleepReportController.sleepReport.value = res.data;