diff --git a/assets/file.json b/assets/file.json index 2ab6a9a..5214c6e 100644 --- a/assets/file.json +++ b/assets/file.json @@ -1,3 +1,3 @@ [ - "assets/miniapp/mhtControl_1.0.66.zip" + "assets/miniapp/mhtControl_1.0.68.zip" ] \ No newline at end of file diff --git a/assets/miniapp/mhtControl_1.0.66.zip b/assets/miniapp/mhtControl_1.0.66.zip deleted file mode 100644 index 108021b..0000000 Binary files a/assets/miniapp/mhtControl_1.0.66.zip and /dev/null differ diff --git a/assets/miniapp/mhtControl_1.0.65.zip b/assets/miniapp/mhtControl_1.0.68.zip similarity index 97% rename from assets/miniapp/mhtControl_1.0.65.zip rename to assets/miniapp/mhtControl_1.0.68.zip index ab3e0ef..349a17f 100644 Binary files a/assets/miniapp/mhtControl_1.0.65.zip and b/assets/miniapp/mhtControl_1.0.68.zip differ diff --git a/lib/component/base/SleepCalendarWidget.dart b/lib/component/base/SleepCalendarWidget.dart index 9a1dd7e..ed631f9 100644 --- a/lib/component/base/SleepCalendarWidget.dart +++ b/lib/component/base/SleepCalendarWidget.dart @@ -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 { Future 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; }, diff --git a/lib/controller/device/body_device_controller.dart b/lib/controller/device/body_device_controller.dart index 23d73a1..e237f62 100644 --- a/lib/controller/device/body_device_controller.dart +++ b/lib/controller/device/body_device_controller.dart @@ -223,8 +223,7 @@ class BodyDeviceController extends GetControllerEx { 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) { diff --git a/lib/pages/device/instant_body_page.dart b/lib/pages/device/instant_body_page.dart index b43f433..f3da037 100644 --- a/lib/pages/device/instant_body_page.dart +++ b/lib/pages/device/instant_body_page.dart @@ -291,16 +291,16 @@ class _InstantBodyPageState extends State .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 .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 .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 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)), ), diff --git a/lib/pages/main_bottom/home_page.dart b/lib/pages/main_bottom/home_page.dart index 29f0168..0594d3c 100644 --- a/lib/pages/main_bottom/home_page.dart +++ b/lib/pages/main_bottom/home_page.dart @@ -383,6 +383,7 @@ class _HomePageState extends State { .currentColor.sc4, ), ), + ].divide(SizedBox( width: 20.rpx, )), diff --git a/lib/pages/main_bottom/main_page_bottom_change.dart b/lib/pages/main_bottom/main_page_bottom_change.dart index 0eb2b2f..dd8ca18 100644 --- a/lib/pages/main_bottom/main_page_bottom_change.dart +++ b/lib/pages/main_bottom/main_page_bottom_change.dart @@ -81,27 +81,27 @@ class MainPageBottomChange extends GetView { 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, diff --git a/lib/pages/mh_page/device/mht_wifi_page_after.dart b/lib/pages/mh_page/device/mht_wifi_page_after.dart index 9190c48..8f22cb1 100644 --- a/lib/pages/mh_page/device/mht_wifi_page_after.dart +++ b/lib/pages/mh_page/device/mht_wifi_page_after.dart @@ -42,6 +42,7 @@ class _MHTWifiAfterPageState extends State { Timer? _timeoutTimer; StreamSubscription>? _scanSubscription; bool _isDisposed = false; + ScanResult? targetDevice; @override void initState() { @@ -916,7 +917,7 @@ class _MHTWifiAfterPageState extends State { _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 { _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 { Future _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) { diff --git a/lib/pages/mh_page/homepage/controller/mht_home_controller.dart b/lib/pages/mh_page/homepage/controller/mht_home_controller.dart index 8fa1a38..80381cb 100644 --- a/lib/pages/mh_page/homepage/controller/mht_home_controller.dart +++ b/lib/pages/mh_page/homepage/controller/mht_home_controller.dart @@ -434,6 +434,7 @@ class MHTHomeController extends GetControllerEx { 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 { queryParams.add("mac=$mac"); } queryParams.add("time=$timestamp"); + queryParams.add("sleepType=1"); if (queryParams.isNotEmpty) { queryUrl += "?${queryParams.join("&")}"; diff --git a/lib/pages/mh_page/homepage/mht_sleep_report_page.dart b/lib/pages/mh_page/homepage/mht_sleep_report_page.dart index 6421bd1..e433950 100644 --- a/lib/pages/mh_page/homepage/mht_sleep_report_page.dart +++ b/lib/pages/mh_page/homepage/mht_sleep_report_page.dart @@ -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 { padding: EdgeInsets.fromLTRB( 0, 30.rpx, 0, 0), child: Center( - child:CircularProgressIndicator( - strokeWidth: 2, - valueColor: AlwaysStoppedAnimation( - themeController.currentColor.sc1, - ), - ),), + child: CircularProgressIndicator( + strokeWidth: 2, + valueColor: + AlwaysStoppedAnimation( + themeController.currentColor.sc1, + ), + ), + ), ) : hasValidData ? Column( @@ -682,11 +685,17 @@ class _MhtSleepReportPageState extends State { 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); diff --git a/lib/pages/mh_page/homepage/new_Home_page.dart b/lib/pages/mh_page/homepage/new_Home_page.dart index 20997ce..e3ecaee 100644 --- a/lib/pages/mh_page/homepage/new_Home_page.dart +++ b/lib/pages/mh_page/homepage/new_Home_page.dart @@ -285,10 +285,11 @@ class _NewHomePageState extends State { 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( diff --git a/lib/pages/mh_page/test/WebviewTestModel.dart b/lib/pages/mh_page/test/WebviewTestModel.dart index 9357c8c..7bd55dc 100644 --- a/lib/pages/mh_page/test/WebviewTestModel.dart +++ b/lib/pages/mh_page/test/WebviewTestModel.dart @@ -44,10 +44,11 @@ class WebviewTestController extends GetControllerEx { 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 { }); }, 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 { }); } - final normalizedMac = mac.replaceAll(":", "").toUpperCase(); if (deviceId != null && @@ -291,7 +291,7 @@ class WebviewTestController extends GetControllerEx { 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 { // } // 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 { 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 { "data": {"mac".tr: mac}, }); if (success) { - ef.log("✅ 已取消监听:$mac"); + // ef.log("✅ 已取消监听:$mac"); } } } @@ -435,7 +446,7 @@ class WebviewTestController extends GetControllerEx { "data": {"mac".tr: mac}, }); if (success) { - ef.log("✅ 开始监听新设备:$mac"); + // ef.log("✅ 开始监听新设备:$mac"); } } } @@ -470,25 +481,6 @@ class WebviewTestController extends GetControllerEx { 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 { @@ -634,19 +626,67 @@ class WebviewTestView extends GetComponent { 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( - 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( + Colors.white), + ), + ], ), ), - ); + ), + ], + ); }), ), ), diff --git a/lib/pages/sleep_report/new_sleep_report_page.dart b/lib/pages/sleep_report/new_sleep_report_page.dart index cca313c..40a7421 100644 --- a/lib/pages/sleep_report/new_sleep_report_page.dart +++ b/lib/pages/sleep_report/new_sleep_report_page.dart @@ -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 { 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 { 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 { : '未知数据'.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 { '${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 { : '未知数据'.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 { '${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 { 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 { 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 { 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 { 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 { 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 { 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 { 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;