From 489e907e00cd5ef4ecb33b6c5d49749580581316 Mon Sep 17 00:00:00 2001 From: wyf <494641114@qq.com> Date: Wed, 21 May 2025 09:53:32 +0800 Subject: [PATCH] =?UTF-8?q?=E6=9B=B4=E6=96=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .idea/misc.xml | 2 +- android/app/build.gradle | 4 +- android/gradle.properties | 1 + assets/langs/zh_CN.json | 4 +- lib/common/util/CommonVariables.dart | 4 +- .../main_bottom/global_controller.dart | 6 - lib/controller/person/person_controller.dart | 14 +- lib/controller/setting/pdf/PdfController.dart | 24 - lib/main.dart | 10 +- lib/pages/common/selectDialog.dart | 9 +- lib/pages/device/BodyDeviceWidget.dart | 19 +- .../component/DeviceDataComponentWidget.dart | 6 +- lib/pages/device_bind/device_calibration.dart | 478 ++++++++++-------- lib/pages/main_bottom/help_page.dart | 34 +- lib/pages/main_bottom/home_page.dart | 27 +- lib/pages/main_bottom/mine_page.dart | 2 +- lib/pages/main_bottom/sleep_report_page.dart | 30 -- lib/pages/person/update_person_page.dart | 75 +-- lib/pages/user/about_us_page.dart | 443 ++-------------- lib/pages/user/setting_page.dart | 10 +- lib/routers/routers.dart | 4 + macos/Flutter/GeneratedPluginRegistrant.swift | 2 + pubspec.lock | 150 ++++-- pubspec.yaml | 7 +- .../flutter/generated_plugin_registrant.cc | 3 + windows/flutter/generated_plugins.cmake | 1 + 26 files changed, 516 insertions(+), 853 deletions(-) delete mode 100644 lib/controller/setting/pdf/PdfController.dart delete mode 100644 lib/pages/main_bottom/sleep_report_page.dart diff --git a/.idea/misc.xml b/.idea/misc.xml index 639900d..7134f8d 100644 --- a/.idea/misc.xml +++ b/.idea/misc.xml @@ -1,6 +1,6 @@ - + \ No newline at end of file diff --git a/android/app/build.gradle b/android/app/build.gradle index 40473e1..6ef8d98 100644 --- a/android/app/build.gradle +++ b/android/app/build.gradle @@ -35,12 +35,12 @@ if (flutterVersionName == null) { flutterVersionName = "1.0.4" } -android { +android { namespace = "com.taihe.vbvs_app" // compileSdk = flutter.compileSdkVersion compileSdk = localProperties.getProperty('flutter.compileSdkVersion').toInteger() // ndkVersion = flutter.ndkVersion - ndkVersion = localProperties.getProperty('flutter.ndkVersion') + ndkVersion = localProperties.getProperty('flutter.ndkVersion') // 编译的jvm版本 compileOptions { diff --git a/android/gradle.properties b/android/gradle.properties index 3b5b324..1600540 100644 --- a/android/gradle.properties +++ b/android/gradle.properties @@ -1,3 +1,4 @@ org.gradle.jvmargs=-Xmx4G -XX:+HeapDumpOnOutOfMemoryError android.useAndroidX=true android.enableJetifier=true + diff --git a/assets/langs/zh_CN.json b/assets/langs/zh_CN.json index 4efe637..9dd66f4 100644 --- a/assets/langs/zh_CN.json +++ b/assets/langs/zh_CN.json @@ -358,6 +358,8 @@ "微信客服提示":"请先安装微信APP,再联系客服", "打开微信客服提示":"正在打开微信客服...", "身高":"身高", - "身高输入提示":"请输入身高" + "身高输入提示":"请输入身高", + "用户协议":"用户协议", + "隐私协议":"隐私协议" } \ No newline at end of file diff --git a/lib/common/util/CommonVariables.dart b/lib/common/util/CommonVariables.dart index f7cbaf4..5732723 100644 --- a/lib/common/util/CommonVariables.dart +++ b/lib/common/util/CommonVariables.dart @@ -1,7 +1,6 @@ class CommonVariables { static bool isNetWorkOn = false; - // 企业微信客服拉起的url地址 static String wxKfUrl = "https://work.weixin.qq.com/kfid/kfcab6a07e8aac68945"; // 企业微信ID @@ -14,4 +13,7 @@ class CommonVariables { static String ICPTime = "2022-2025"; static Map callMap = {}; + + static const String weather_apiKey = + '40e23445cf0a29561af2b5b7d506a38b'; // 替换为你的 API 密钥 } diff --git a/lib/controller/main_bottom/global_controller.dart b/lib/controller/main_bottom/global_controller.dart index 6373562..08ad35b 100644 --- a/lib/controller/main_bottom/global_controller.dart +++ b/lib/controller/main_bottom/global_controller.dart @@ -160,12 +160,6 @@ class GlobalController extends GetControllerEx { return "$mac".toUpperCase(); } - getDeviceType() async { - var rs = - await ef.from("app_device_type").select().order("id", ascending: true); - model.deviceType = rs.where((d) => d["page"] != null).toList(); - updateAll(); - } getDeviceList({int time = 1}) async { await EasyDartModule.dio.get("/api/device/info/list").then((d) { diff --git a/lib/controller/person/person_controller.dart b/lib/controller/person/person_controller.dart index a2447b1..c8b9187 100644 --- a/lib/controller/person/person_controller.dart +++ b/lib/controller/person/person_controller.dart @@ -38,19 +38,7 @@ class PersonController extends GetControllerEx { attr = GetModel(PersonModel()).obs; } RxList selectedDiseaseIds = [].obs; - // RxList diseaseList = [ - // {'id': 1, 'name': '高血压'}, - // {'id': 2, 'name': '糖尿病'}, - // {'id': 3, 'name': '冠心病'}, - // {'id': 4, 'name': '哮喘'}, - // {'id': 5, 'name': '脑卒中'}, - // {'id': 6, 'name': '慢性肾病'}, - // {'id': 7, 'name': '慢阻肺'}, - // {'id': 8, 'name': '类风湿关节炎'}, - // {'id': 9, 'name': '类风湿关节炎类风湿关节炎'}, - // {'id': 10, 'name': '类风湿关节炎类风湿关节炎类风湿关节炎'}, - // ].obs; - + RxString currentPersonId = "".obs; RxString name = "".obs; RxInt gender = 1.obs; diff --git a/lib/controller/setting/pdf/PdfController.dart b/lib/controller/setting/pdf/PdfController.dart deleted file mode 100644 index a6e0504..0000000 --- a/lib/controller/setting/pdf/PdfController.dart +++ /dev/null @@ -1,24 +0,0 @@ -import 'dart:io'; - -import 'package:flutter/services.dart'; -import 'package:get/get.dart'; -import 'package:path/path.dart' as p; -import 'package:path_provider/path_provider.dart'; - -class PdfController extends GetxController { - var localPdfPath = Rx(null); - - // 加载 PDF 文件 - Future loadPdf() async { - final byteData = await rootBundle.load('assets/img/test.pdf'); - final tempDir = await getTemporaryDirectory(); - - // 使用 path 包拼接路径 - final filePath = p.join(tempDir.path, 'test.pdf'); - final file = File(filePath); - - // 保存文件到临时目录 - await file.writeAsBytes(byteData.buffer.asUint8List()); - localPdfPath.value = filePath; // 更新 PDF 路径 - } -} diff --git a/lib/main.dart b/lib/main.dart index 9fcf502..7defdfa 100644 --- a/lib/main.dart +++ b/lib/main.dart @@ -31,10 +31,12 @@ import 'package:vbvs_app/controller/message/message_controller.dart'; import 'package:vbvs_app/controller/person/person_controller.dart'; import 'package:vbvs_app/controller/repair/repair_controller.dart'; import 'package:vbvs_app/controller/setting/language/language_controller.dart'; -import 'package:vbvs_app/controller/setting/pdf/PdfController.dart'; +import 'package:vbvs_app/controller/setting/pdf/PrivacyPdfController.dart'; +import 'package:vbvs_app/controller/setting/pdf/UserPdfController.dart'; import 'package:vbvs_app/controller/sleep/sleep_report_controller.dart'; import 'package:vbvs_app/controller/theme_controller/ThemeController.dart'; import 'package:vbvs_app/controller/time/countdown_controller.dart'; +import 'package:vbvs_app/controller/weather/weather_controller.dart'; import 'package:vbvs_app/language/AppLanguage.dart'; import 'package:vbvs_app/model/CustomThemeColor.dart'; import 'package:vbvs_app/model/user_data.dart'; @@ -60,6 +62,8 @@ Future main() async { await initLogin(); await initLog(); await messageStatus(); + + startMessagePolling(); // 检查网络 Checknetwork.checkNetwork(); @@ -225,6 +229,7 @@ class MyApp extends StatelessWidget { initialBinding: BindingsBuilder(() => [ // Get.lazyPut(() => UserInfoController()), Get.put(GlobalController()), + Get.put(WeatherModelController()), Get.lazyPut(() => MainPageController()), Get.lazyPut(() => BlueteethBindController()), Get.lazyPut(() => PersonController()), @@ -237,7 +242,8 @@ class MyApp extends StatelessWidget { Get.lazyPut(() => DeviceShareListController()), Get.lazyPut(() => DeviceCalibrationController()), Get.lazyPut(() => RepairController()), - Get.lazyPut(() => PdfController()), + Get.lazyPut(() => UserPdfController()), + Get.lazyPut(() => PrivacyPdfController()), Get.lazyPut(() => CalendarController()), Get.lazyPut(() => SleepReportController()), ])); diff --git a/lib/pages/common/selectDialog.dart b/lib/pages/common/selectDialog.dart index b8f497c..3e44ba6 100644 --- a/lib/pages/common/selectDialog.dart +++ b/lib/pages/common/selectDialog.dart @@ -7,7 +7,6 @@ import 'package:vbvs_app/common/util/MyUtils.dart'; import 'package:vbvs_app/component/base/SleepCalendarWidget.dart'; import 'package:vbvs_app/controller/device/device_calibration_controller.dart'; import 'package:vbvs_app/controller/theme_controller/ThemeController.dart'; -import 'package:vbvs_app/enum/CalendarType.dart'; getOnePicker(context, List arr, int checkIndex, Function onSelectedItemChanged, {bool looping = false}) { @@ -881,9 +880,13 @@ void showProgressDialog( ), ), Container( - width: progress * + // width: progress * + // MediaQuery.of(context).size.width * + // 0.4, + width: progress / + 100 * MediaQuery.of(context).size.width * - 0.8, + 0.8, // 进度条宽度按比例计算,最大宽度是屏幕宽度的 0.8 height: 21.rpx, decoration: BoxDecoration( gradient: LinearGradient( diff --git a/lib/pages/device/BodyDeviceWidget.dart b/lib/pages/device/BodyDeviceWidget.dart index fc88665..5ff6052 100644 --- a/lib/pages/device/BodyDeviceWidget.dart +++ b/lib/pages/device/BodyDeviceWidget.dart @@ -13,6 +13,7 @@ import 'package:vbvs_app/component/tool/ClickableContainer.dart'; import 'package:vbvs_app/component/tool/CustomCard.dart'; import 'package:vbvs_app/component/tool/TopSlideNotification.dart'; import 'package:vbvs_app/controller/device/body_device_controller.dart'; +import 'package:vbvs_app/controller/home/home_controller.dart'; import 'package:vbvs_app/controller/theme_controller/ThemeController.dart'; import 'package:vbvs_app/pages/device/component/DeviceDataComponentWidget.dart'; @@ -26,6 +27,7 @@ class BodyDeviceWidget extends StatefulWidget { class _BodyDevicePageState extends State { final ThemeController themeController = Get.find(); final BodyDeviceController bodyDeviceController = Get.find(); + HomeController homeController = Get.find(); final GlobalKey addIconKey = GlobalKey(); OverlayEntry? _popupEntry; Timer? _timer; @@ -300,9 +302,15 @@ class _BodyDevicePageState extends State { onTap: () async { bodyDeviceController.model.type = 1; + homeController.model.type = 1; await bodyDeviceController .getDeviceList(); + await bodyDeviceController + .getDeviceList(); + await bodyDeviceController + .getSleepReport(); bodyDeviceController.updateAll(); + homeController.updateAll(); }, child: Column( mainAxisSize: MainAxisSize.max, @@ -348,11 +356,17 @@ class _BodyDevicePageState extends State { borderRadius: 8.rpx, padding: EdgeInsets.all(0), onTap: () async { + homeController.model.type = 2; bodyDeviceController.model.type = 2; await bodyDeviceController .getDeviceList(); + await bodyDeviceController + .getDeviceList(); + await bodyDeviceController + .getSleepReport(); bodyDeviceController.updateAll(); + homeController.updateAll(); }, child: Column( mainAxisSize: MainAxisSize.max, @@ -536,8 +550,8 @@ class _BodyDevicePageState extends State { color: themeController .currentColor.sc3, ), - cursorColor: themeController - .currentColor.sc3, + cursorColor: themeController + .currentColor.sc3, ), ), ), @@ -601,7 +615,6 @@ class _BodyDevicePageState extends State { ), ), ), - Obx(() { final isEmpty = bodyDeviceController.deviceList.value.isEmpty; diff --git a/lib/pages/device/component/DeviceDataComponentWidget.dart b/lib/pages/device/component/DeviceDataComponentWidget.dart index 44592ff..33875cc 100644 --- a/lib/pages/device/component/DeviceDataComponentWidget.dart +++ b/lib/pages/device/component/DeviceDataComponentWidget.dart @@ -299,7 +299,7 @@ class _DeviceDataComponentWidgetState extends State { _popupEntry?.remove(); _popupEntry = null; BlueteethBindController blueteethBindController = Get.find(); - blueteethBindController.currentDeviceMac = widget.device['mac']; + blueteethBindController.currentDeviceMac?.value = widget.device['mac']; Get.toNamed("/calibrationPage", arguments: 2); }, ), @@ -745,7 +745,7 @@ class _DeviceDataComponentWidgetState extends State { ), ), Text( - '张三', + 'uusne12', style: FlutterFlowTheme.of(context).bodyMedium.override( fontFamily: 'Inter', @@ -1030,6 +1030,8 @@ class _DeviceDataComponentWidgetState extends State { widget.device['person']['gender'] ?? 1; personController.weight.value = widget.device['person']['weight'] ?? 0; + personController.height.value = + widget.device['person']['height'] ?? 0; personController.selectedDiseaseIds.value = widget.device['person']['disease'] ?? []; personController.birthday.value = diff --git a/lib/pages/device_bind/device_calibration.dart b/lib/pages/device_bind/device_calibration.dart index e87f88e..13682a4 100644 --- a/lib/pages/device_bind/device_calibration.dart +++ b/lib/pages/device_bind/device_calibration.dart @@ -90,7 +90,7 @@ class _CalibrationPageState extends State { borderRadius: 20.rpx, onTap: () async { // Get.toNamed("/personPage"); - Get.toNamed("/bindDeviceSuccess"); + Get.toNamed("/bindDeviceSuccess"); }, colors: [ themeController.currentColor.sc1, @@ -490,110 +490,6 @@ class _CalibrationPageState extends State { child: CustomCard( borderRadius: AppConstants().button_container_radius, // 圆角半径 - // onTap: () async { - // BlueteethBindController blueteethBindController = - // Get.find(); - // String serviceAddress = "http://192.168.1.80:8086"; - // String serviceApi = ServiceConstant.start_calibration; - // String queryUrl = "${serviceAddress}${serviceApi}"; - // requestWithLog( - // logTitle: "设备校准", - // method: MyHttpMethod.post, - // queryUrl: queryUrl, - // data: { - // "macA": blueteethBindController.currentDeviceMac, - // if (blueteethBindController.cid!.value.isNotEmpty) - // "id": blueteethBindController.cid!.value, - // }, - // onSuccess: (res) { - // String cid = res.rawResponse.data['cid']; - // blueteethBindController.cid!.value = cid; - // final ValueNotifier progressNotifier = - // ValueNotifier(0.0); - // final ValueNotifier failureNotifier = - // ValueNotifier(false); - // Timer? pollingTimer; - // // 定义请求函数 - // void requestCalibrationProgress() { - // String serviceAddress = - // "http://192.168.1.80:8086"; - // String serviceApi = - // ServiceConstant.calibration_process; - // String queryUrl = - // "${serviceAddress}${serviceApi}?id=$cid"; - // requestWithLog( - // logTitle: "设备校准进度", - // method: MyHttpMethod.get, - // queryUrl: queryUrl, - // onSuccess: (res) { - // print(res); - // deviceCalibrationController.tips.value = - // res.data['statusText']; - // if (res.data['per'] == 100) { - // TopSlideNotification.show(context, - // text: deviceCalibrationController - // .tips.value); - // } - // double process = - // (res.data['per'] ?? 0).toDouble(); - // progressNotifier.value = process; - // if (process >= 100) { - // if (deviceCalibrationController - // .process.value == - // 0) { - // deviceCalibrationController - // .bed_calibration.value = 1; - // deviceCalibrationController.updateAll(); - // } - // if (deviceCalibrationController - // .process.value == - // 1) { - // deviceCalibrationController - // .position_calibration.value = 1; - // deviceCalibrationController.updateAll(); - // } - // deviceCalibrationController - // .process.value = 1; - // deviceCalibrationController.updateAll(); - // pollingTimer?.cancel(); - // } - // }, - // onFailure: (res) { - // pollingTimer?.cancel(); - // failureNotifier.value = true; - // TopSlideNotification.show( - // context, - // text: res.msg ?? "服务器.失败".tr, - // textColor: - // themeController.currentColor.sc9, - // ); - // }, - // ); - // } - - // // 启动轮询 - // pollingTimer = - // Timer.periodic(Duration(seconds: 2), (timer) { - // requestCalibrationProgress(); - // }); - - // // 初始调用一次 - // requestCalibrationProgress(); - - // // 显示进度弹窗 - // showProgressDialog( - // context, progressNotifier, failureNotifier); - // }, - // onFailure: (res) { - // TopSlideNotification.show( - // context, - // text: res.msg ?? "服务器.失败".tr, - // textColor: themeController.currentColor.sc9, - // ); - // }, - // ); - // }, - onTap: () async { if (deviceCalibrationController.complete) { showConfirmDialog( @@ -608,139 +504,279 @@ class _CalibrationPageState extends State { .position_calibration.value = 0; blueteethBindController.cid!.value = ""; deviceCalibrationController.complete = false; - }, onCancel: () {}); - } + + String serviceAddress = + "https://caibration.he-info.cn"; + String calibrationApi = + ServiceConstant.start_calibration; + String progressApi = + ServiceConstant.calibration_process; - BlueteethBindController blueteethBindController = - Get.find(); - String serviceAddress = "https://caibration.he-info.cn/"; - String calibrationApi = - ServiceConstant.start_calibration; - String progressApi = - ServiceConstant.calibration_process; + String queryUrl = + "$serviceAddress$calibrationApi"; - String queryUrl = "$serviceAddress$calibrationApi"; + final ValueNotifier progressNotifier = + ValueNotifier(0.0); + final ValueNotifier failureNotifier = + ValueNotifier(false); + Timer? pollingTimer; - final ValueNotifier progressNotifier = - ValueNotifier(0.0); - final ValueNotifier failureNotifier = - ValueNotifier(false); - Timer? pollingTimer; + Map data = { + "macA": blueteethBindController + .currentDeviceMac!.value, + }; - Map data = { - "macA": blueteethBindController.currentDeviceMac, - }; - - // 是否是二次点击(有cid表示进行第二阶段) - bool isSecondStep = - blueteethBindController.cid?.value.isNotEmpty ?? + // 是否是二次点击(有cid表示进行第二阶段) + bool isSecondStep = blueteethBindController + .cid?.value.isNotEmpty ?? false; - if (isSecondStep) { - data["id"] = blueteethBindController.cid!.value; - } - - // 发起校准请求 - requestWithLog( - logTitle: "设备校准", - method: MyHttpMethod.post, - queryUrl: queryUrl, - data: data, - onSuccess: (res) { - if (!isSecondStep) { - // 保存第一次获取的 cid - String cid = res.rawResponse.data['cid']; - blueteethBindController.cid!.value = cid; + if (isSecondStep) { + data["id"] = blueteethBindController.cid!.value; } - void requestCalibrationProgress() { - String cid = blueteethBindController.cid!.value; - String progressUrl = - "$serviceAddress$progressApi?id=$cid"; - requestWithLog( - logTitle: "设备校准进度", - method: MyHttpMethod.get, - queryUrl: progressUrl, - onSuccess: (res) { - final data = res.data; - double per = (data['per'] ?? 0).toDouble(); - int currStep = data['currStep'] ?? -1; - bool status = data['status'] ?? false; - String tips = data['statusText'] ?? ''; + // 发起校准请求 + requestWithLog( + logTitle: "设备校准", + method: MyHttpMethod.post, + queryUrl: queryUrl, + data: data, + onSuccess: (res) { + if (!isSecondStep) { + // 保存第一次获取的 cid + String cid = res.rawResponse.data['cid']; + blueteethBindController.cid!.value = cid; + } - deviceCalibrationController.tips.value = - tips; - // progressNotifier.value = - // (res.data['per'] ?? 0) / 100.0; - progressNotifier.value = per; + void requestCalibrationProgress() { + String cid = + blueteethBindController.cid!.value; + String progressUrl = + "$serviceAddress$progressApi?id=$cid"; + requestWithLog( + logTitle: "设备校准进度", + method: MyHttpMethod.get, + queryUrl: progressUrl, + onSuccess: (res) { + final data = res.data; + double per = + (data['per'] ?? 0).toDouble(); + int currStep = data['currStep'] ?? -1; + bool status = data['status'] ?? false; + String tips = data['statusText'] ?? ''; - if (!isSecondStep && per >= 100) { - // 第一步完成:仅 per >= 100 - pollingTimer?.cancel(); - TopSlideNotification.show(context, - text: tips); - deviceCalibrationController - .process.value = 1; - deviceCalibrationController - .bed_calibration.value = 1; + deviceCalibrationController.tips.value = + tips; - deviceCalibrationController.updateAll(); - } + progressNotifier.value = per; + if (!isSecondStep && per >= 20) { + progressNotifier.value = 100; + // 第一步完成:仅 per >= 100 + pollingTimer?.cancel(); + TopSlideNotification.show(context, + text: tips); + deviceCalibrationController + .process.value = 1; + deviceCalibrationController + .bed_calibration.value = 1; - if (isSecondStep && - per >= 100 && - currStep == 5 && - status == true) { - // 第二步完成:per >= 100 && currStep == 5 && status == true - pollingTimer?.cancel(); - TopSlideNotification.show(context, - text: "设备校准完成".tr); - // 可在这里执行校准完成后的业务逻辑更新 - deviceCalibrationController - .bed_calibration.value = 1; - deviceCalibrationController - .position_calibration.value = 1; - deviceCalibrationController - .process.value = 1; - deviceCalibrationController.complete = - true; - deviceCalibrationController.updateAll(); - } - }, - onFailure: (res) { - pollingTimer?.cancel(); - failureNotifier.value = true; - TopSlideNotification.show( - context, - text: res.msg ?? "服务器.失败".tr, - textColor: - themeController.currentColor.sc9, + deviceCalibrationController + .updateAll(); + } + + if (isSecondStep && + per >= 100 && + currStep == 5 && + status == true) { + // 第二步完成:per >= 100 && currStep == 5 && status == true + pollingTimer?.cancel(); + TopSlideNotification.show(context, + text: "设备校准完成".tr); + // 可在这里执行校准完成后的业务逻辑更新 + deviceCalibrationController + .bed_calibration.value = 1; + deviceCalibrationController + .position_calibration.value = 1; + deviceCalibrationController + .process.value = 1; + deviceCalibrationController.complete = + true; + deviceCalibrationController + .updateAll(); + } + }, + onFailure: (res) { + pollingTimer?.cancel(); + failureNotifier.value = true; + TopSlideNotification.show( + context, + text: res.msg ?? "服务器.失败".tr, + textColor: + themeController.currentColor.sc9, + ); + }, ); - }, - ); - } + } - // 初始调用一次 - requestCalibrationProgress(); + // 初始调用一次 + requestCalibrationProgress(); - // 开始轮询 - pollingTimer = - Timer.periodic(Duration(seconds: 2), (_) { - requestCalibrationProgress(); - }); + // 开始轮询 + pollingTimer = + Timer.periodic(Duration(seconds: 2), (_) { + requestCalibrationProgress(); + }); - // 显示进度弹窗 - showProgressDialog( - context, progressNotifier, failureNotifier); - }, - onFailure: (res) { - TopSlideNotification.show( - context, - text: res.msg ?? "服务器.失败".tr, - textColor: themeController.currentColor.sc9, + // 显示进度弹窗 + showProgressDialog(context, progressNotifier, + failureNotifier); + }, + onFailure: (res) { + TopSlideNotification.show( + context, + text: res.msg ?? "服务器.失败".tr, + textColor: themeController.currentColor.sc9, + ); + }, ); - }, - ); + }, onCancel: () { + return; + }); + } else { + BlueteethBindController blueteethBindController = + Get.find(); + String serviceAddress = + "https://caibration.he-info.cn"; + String calibrationApi = + ServiceConstant.start_calibration; + String progressApi = + ServiceConstant.calibration_process; + + String queryUrl = "$serviceAddress$calibrationApi"; + + final ValueNotifier progressNotifier = + ValueNotifier(0.0); + final ValueNotifier failureNotifier = + ValueNotifier(false); + Timer? pollingTimer; + + Map data = { + "macA": blueteethBindController + .currentDeviceMac!.value, + }; + + // 是否是二次点击(有cid表示进行第二阶段) + bool isSecondStep = + blueteethBindController.cid?.value.isNotEmpty ?? + false; + + if (isSecondStep) { + data["id"] = blueteethBindController.cid!.value; + } + + // 发起校准请求 + requestWithLog( + logTitle: "设备校准", + method: MyHttpMethod.post, + queryUrl: queryUrl, + data: data, + onSuccess: (res) { + if (!isSecondStep) { + // 保存第一次获取的 cid + String cid = res.rawResponse.data['cid']; + blueteethBindController.cid!.value = cid; + } + + void requestCalibrationProgress() { + String cid = + blueteethBindController.cid!.value; + String progressUrl = + "$serviceAddress$progressApi?id=$cid"; + requestWithLog( + logTitle: "设备校准进度", + method: MyHttpMethod.get, + queryUrl: progressUrl, + onSuccess: (res) { + final data = res.data; + double per = + (data['per'] ?? 0).toDouble(); + int currStep = data['currStep'] ?? -1; + bool status = data['status'] ?? false; + String tips = data['statusText'] ?? ''; + + deviceCalibrationController.tips.value = + tips; + + progressNotifier.value = per; + if (!isSecondStep && per >= 20) { + progressNotifier.value = 100; + // 第一步完成:仅 per >= 100 + pollingTimer?.cancel(); + TopSlideNotification.show(context, + text: tips); + deviceCalibrationController + .process.value = 1; + deviceCalibrationController + .bed_calibration.value = 1; + + deviceCalibrationController.updateAll(); + } + + if (isSecondStep && + per >= 100 && + currStep == 5 && + status == true) { + // 第二步完成:per >= 100 && currStep == 5 && status == true + pollingTimer?.cancel(); + TopSlideNotification.show(context, + text: "设备校准完成".tr); + // 可在这里执行校准完成后的业务逻辑更新 + deviceCalibrationController + .bed_calibration.value = 1; + deviceCalibrationController + .position_calibration.value = 1; + deviceCalibrationController + .process.value = 1; + deviceCalibrationController.complete = + true; + deviceCalibrationController.updateAll(); + } + }, + onFailure: (res) { + pollingTimer?.cancel(); + failureNotifier.value = true; + TopSlideNotification.show( + context, + text: res.msg ?? "服务器.失败".tr, + textColor: + themeController.currentColor.sc9, + ); + }, + ); + } + + // 初始调用一次 + requestCalibrationProgress(); + + // 开始轮询 + pollingTimer = + Timer.periodic(Duration(seconds: 2), (_) { + requestCalibrationProgress(); + }); + + // 显示进度弹窗 + showProgressDialog( + context, progressNotifier, failureNotifier); + }, + onFailure: (res) { + TopSlideNotification.show( + context, + text: res.msg ?? "服务器.失败".tr, + textColor: themeController.currentColor.sc9, + ); + }, + ); + } }, colors: [ diff --git a/lib/pages/main_bottom/help_page.dart b/lib/pages/main_bottom/help_page.dart index b96d349..c84bd1f 100644 --- a/lib/pages/main_bottom/help_page.dart +++ b/lib/pages/main_bottom/help_page.dart @@ -3,7 +3,6 @@ import 'package:flutter/material.dart'; import 'package:vbvs_app/common/util/FitTool.dart'; import 'package:vbvs_app/common/util/MyUtils.dart'; import 'package:vbvs_app/component/tool/WebViewWidget.dart'; -import 'package:vbvs_app/controller/setting/pdf/PdfController.dart'; class HelpPage extends StatefulWidget { late MyWebView webView; @@ -14,7 +13,7 @@ class HelpPage extends StatefulWidget { } class _HelpPageState extends State { - PdfController pdfController = Get.find(); + // PdfController pdfController = Get.find(); @override void initState() { @@ -78,36 +77,7 @@ class _HelpPageState extends State { actions: [], centerTitle: false, ), - - // body: SafeArea( - // top: true, - // child: Padding( - // padding: EdgeInsets.symmetric(horizontal: 30.rpx), - // child: Column( - // children: [ - // Expanded( - // child: Obx(() { - // if (pdfController.localPdfPath.value == null) { - // return Center(child: CircularProgressIndicator()); - // } else { - // return PDFView( - // filePath: pdfController.localPdfPath.value!, - // autoSpacing: false, - // enableSwipe: true, - // swipeHorizontal: false, - // pageSnap: true, - // fitEachPage: true, - // defaultPage: 0, - // onRender: (pages) => print('PDF 渲染完成,共 $pages 页'), - // onError: (error) => print('PDF 加载错误: $error'), - // ); - // } - // }), - // ), - // ], - // ), - // ), - // ), + body: SafeArea( top: true, child: Padding( diff --git a/lib/pages/main_bottom/home_page.dart b/lib/pages/main_bottom/home_page.dart index 12fbf80..0bad425 100644 --- a/lib/pages/main_bottom/home_page.dart +++ b/lib/pages/main_bottom/home_page.dart @@ -18,6 +18,7 @@ import 'package:vbvs_app/controller/home/home_controller.dart'; import 'package:vbvs_app/controller/main_bottom/global_controller.dart'; import 'package:vbvs_app/controller/theme_controller/ThemeController.dart'; import 'package:vbvs_app/controller/user_info_controller.dart'; +import 'package:vbvs_app/controller/weather/weather_controller.dart'; import 'package:vbvs_app/enum/LoginStatus.dart'; class HomePage extends StatefulWidget { @@ -33,6 +34,7 @@ class _HomePageState extends State { ThemeController themeController = Get.find(); BodyDeviceController deviceController = Get.find(); HomeController homeController = Get.find(); + WeatherModelController weatherModelController = Get.find(); final GlobalKey addIconKey = GlobalKey(); OverlayEntry? _popupEntry; @@ -301,15 +303,18 @@ class _HomePageState extends State { .normal_text_fontSize, ), ), - Text( - "嘉兴 晴", - style: TextStyle( - color: themeController - .currentColor.sc4, - fontSize: AppConstants() - .normal_text_fontSize, - ), - ), + Obx(() { + return Text( + "嘉兴 " + + "${weatherModelController.model.weather_info ?? '未知数据'.tr}", + style: TextStyle( + color: themeController + .currentColor.sc4, + fontSize: AppConstants() + .normal_text_fontSize, + ), + ); + }), ], ), ); @@ -362,11 +367,11 @@ class _HomePageState extends State { backgroundColor: Colors.transparent, // 容器背景色 highlightColor: themeController .currentColor.sc21, // 点击时的背景色 - onTap: () { + onTap: () async { print('点击了容器'); if (userInfoController.model.login == LoginStatus.LOGIN.code) { - Get.toNamed("/bodyDevice"); + await Get.toNamed("/bodyDevice"); } else { TopSlideNotification.show( context, diff --git a/lib/pages/main_bottom/mine_page.dart b/lib/pages/main_bottom/mine_page.dart index 7da451c..c18dc60 100644 --- a/lib/pages/main_bottom/mine_page.dart +++ b/lib/pages/main_bottom/mine_page.dart @@ -693,7 +693,7 @@ class _MinePageState extends State { mainAxisSize: MainAxisSize.max, children: [ Text( - 'V1.0.2504.12', + 'V1.0.2505.20', style: FlutterFlowTheme.of(context) .bodyMedium diff --git a/lib/pages/main_bottom/sleep_report_page.dart b/lib/pages/main_bottom/sleep_report_page.dart deleted file mode 100644 index 39e769d..0000000 --- a/lib/pages/main_bottom/sleep_report_page.dart +++ /dev/null @@ -1,30 +0,0 @@ -import 'package:ef/ef.dart'; -import 'package:flutter/material.dart'; -import 'package:vbvs_app/controller/main_bottom/global_controller.dart'; -import 'package:vbvs_app/controller/user_info_controller.dart'; - -class SleepReportPage extends StatefulWidget { - const SleepReportPage({super.key}); - - @override - State createState() => _SleepReportPageState(); -} - -class _SleepReportPageState extends State { - GlobalController globalController = Get.find(); - UserInfoController userInfoController = Get.find(); - @override - Widget build(BuildContext context) { - return LayoutBuilder( - builder: (context, boxConstraints) => GestureDetector( - onTap: () => FocusScope.of(context).unfocus(), - child: Scaffold( - body: SafeArea( - top: true, - child: Text("睡眠报告"), - ), - ), - ), - ); - } -} diff --git a/lib/pages/person/update_person_page.dart b/lib/pages/person/update_person_page.dart index 55e46cf..e8ff9b6 100644 --- a/lib/pages/person/update_person_page.dart +++ b/lib/pages/person/update_person_page.dart @@ -108,6 +108,7 @@ class _UpdatePageState extends State { if (apiRespons.code == HttpStatusCodes.ok) { TopSlideNotification.show(context, text: apiRespons.msg!); + } else { TopSlideNotification.show(context, text: apiRespons.msg!, @@ -268,79 +269,7 @@ class _UpdatePageState extends State { mainAxisSize: MainAxisSize.max, mainAxisAlignment: MainAxisAlignment.center, - children: [ - // Column( - // mainAxisSize: MainAxisSize.max, - // children: [ - // Container( - // width: 90.rpx, - // height: 90.rpx, - // decoration: BoxDecoration(), - // child: Container( - // clipBehavior: Clip.antiAlias, - // decoration: BoxDecoration( - // shape: BoxShape.circle, - // ), - // child: ColorFiltered( - // colorFilter: ColorFilter.mode( - // Colors.grey.withOpacity( - // 0.6), // 这里控制灰色度的强度 - // BlendMode.saturation, // 将图像变成灰度 - // ), - // child: Image.asset( - // "assets/img/man.png", - // fit: BoxFit.cover, - // ), - // ), - // ), - // ), - // Text( - // '男'.tr, - // style: FlutterFlowTheme.of(context) - // .bodyMedium - // .override( - // fontFamily: 'Inter', - // color: themeController - // .currentColor.sc3, - // fontSize: 26.rpx, - // letterSpacing: 0.0, - // ), - // ), - // ].divide(SizedBox(height: 14.rpx)), - // ), - // Column( - // mainAxisSize: MainAxisSize.max, - // children: [ - // Container( - // width: 90.rpx, - // height: 90.rpx, - // decoration: BoxDecoration(), - // child: Container( - // clipBehavior: Clip.antiAlias, - // decoration: BoxDecoration( - // shape: BoxShape.circle, - // ), - // child: Image.asset( - // "assets/img/woman.png", - // fit: BoxFit.cover, - // ), - // ), - // ), - // Text( - // '女'.tr, - // style: FlutterFlowTheme.of(context) - // .bodyMedium - // .override( - // fontFamily: 'Inter', - // color: themeController - // .currentColor.sc3, - // fontSize: 26.rpx, - // letterSpacing: 0.0, - // ), - // ), - // ].divide(SizedBox(height: 14.rpx)), - // ), - + children: [ Obx( () { bool isMaleGreyed = diff --git a/lib/pages/user/about_us_page.dart b/lib/pages/user/about_us_page.dart index 627dbdc..f099fb0 100644 --- a/lib/pages/user/about_us_page.dart +++ b/lib/pages/user/about_us_page.dart @@ -1,36 +1,34 @@ import 'package:ef/ef.dart'; import 'package:flutter/material.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'; -import 'package:vbvs_app/component/tool/CustomCard.dart'; -import 'package:vbvs_app/controller/device/blueteeth_bind_controller.dart'; -import 'package:vbvs_app/controller/main_bottom/global_controller.dart'; -import 'package:vbvs_app/controller/theme_controller/ThemeController.dart'; -import 'package:vbvs_app/controller/user_info_controller.dart'; -// import 'package:easydevice/easydevice.dart'; - +import 'package:vbvs_app/component/tool/WebViewWidget.dart'; class AboutUsPage extends StatefulWidget { - const AboutUsPage({super.key}); + late MyWebView webView; + AboutUsPage({super.key}); @override State createState() => _AboutUsPageState(); } class _AboutUsPageState extends State { - GlobalController globalController = Get.find(); - UserInfoController userInfoController = Get.find(); - BlueteethBindController blueteethBindController = Get.find(); - ThemeController themeController = Get.find(); + @override void initState() { super.initState(); + // pdfController.loadPdf(); + widget.webView = MyWebView( + url: "https://mp.weixin.qq.com/s/IAr4RNBy0hGJXGKyMxe7eQ", + onLoad: () { + print('网页载入完毕'); + }, + ); } @override - Widget build(BuildContext context) { + Widget build(BuildContext context) { return LayoutBuilder( builder: (context, bodySize) => GestureDetector( onTap: () => FocusScope.of(context).unfocus(), @@ -45,10 +43,9 @@ class _AboutUsPageState extends State { backgroundColor: Colors.transparent, // 加上这一行 appBar: AppBar( backgroundColor: themeController.currentColor.sc17, + // backgroundColor: Colors.transparent, automaticallyImplyLeading: false, - iconTheme: IconThemeData( - color: themeController.currentColor.sc3, - ), + iconTheme: IconThemeData(color: themeController.currentColor.sc3), titleSpacing: 0, // leading: returnIconButtom, title: Container( @@ -59,7 +56,7 @@ class _AboutUsPageState extends State { children: [ /// 居中标题 Text( - '关于我们.标题'.tr, + '关于我们'.tr, style: FlutterFlowTheme.of(context).bodyMedium.override( fontFamily: 'Readex Pro', color: themeController.currentColor.sc3, @@ -80,336 +77,47 @@ class _AboutUsPageState extends State { actions: [], centerTitle: false, ), + + // body: SafeArea( + // top: true, + // child: Padding( + // padding: EdgeInsets.symmetric(horizontal: 30.rpx), + // child: Column( + // children: [ + // Expanded( + // child: Obx(() { + // if (pdfController.localPdfPath.value == null) { + // return Center(child: CircularProgressIndicator()); + // } else { + // return PDFView( + // filePath: pdfController.localPdfPath.value!, + // autoSpacing: false, + // enableSwipe: true, + // swipeHorizontal: false, + // pageSnap: true, + // fitEachPage: true, + // defaultPage: 0, + // onRender: (pages) => print('PDF 渲染完成,共 $pages 页'), + // onError: (error) => print('PDF 加载错误: $error'), + // ); + // } + // }), + // ), + // ], + // ), + // ), + // ), body: SafeArea( top: true, child: Padding( - padding: EdgeInsetsDirectional.fromSTEB(30.rpx, 0, 30.rpx, 0), - child: SingleChildScrollView( - child: Column( - mainAxisSize: MainAxisSize.max, - children: [ - // Padding( - // padding: EdgeInsetsDirectional.fromSTEB( - // 30.rpx, 25.rpx, 30.rpx, 0), - // child: Container( - // width: double.infinity, - // decoration: BoxDecoration( - // color: Color(0xFF242835), - // borderRadius: BorderRadius.circular( - // AppConstants().normal_container_radius), - // ), - // child: Padding( - // padding: EdgeInsetsDirectional.fromSTEB( - // 0.rpx, 0, 0.rpx, 0), - // child: Column( - // mainAxisSize: MainAxisSize.max, - // children: [ - // ClickableContainer( - // backgroundColor: Colors.transparent, // 容器背景色 - // highlightColor: themeController - // .currentColor.sc21, // 点击时的背景色 - // padding: EdgeInsetsDirectional.fromSTEB( - // 40.rpx, 0.rpx, 40.rpx, 0.rpx), - // onTap: () { - // print('点击了容器'); - // }, - // child: Container( - // child: Padding( - // padding: EdgeInsetsDirectional.fromSTEB( - // 0.rpx, 20.rpx, 0.rpx, 20.rpx), - // child: Row( - // mainAxisSize: MainAxisSize.max, - // mainAxisAlignment: - // MainAxisAlignment.spaceBetween, - // children: [ - // Row( - // mainAxisSize: MainAxisSize.max, - // children: [ - // Text( - // '设置页.主题模式'.tr, - // style: - // FlutterFlowTheme.of(context) - // .bodyMedium - // .override( - // fontFamily: 'Inter', - // color: themeController - // .currentColor.sc3, - // fontSize: AppConstants() - // .title_text_fontSize, - // letterSpacing: 0.0, - // ), - // ), - // ].divide(SizedBox(width: 22.rpx)), - // ), - // Row( - // mainAxisSize: MainAxisSize.max, - // children: [ - // Text( - // '深色', - // style: - // FlutterFlowTheme.of(context) - // .bodyMedium - // .override( - // fontFamily: 'Inter', - // color: - // Color(0xFFD9E3EB), - // fontSize: 26.rpx, - // letterSpacing: 0.0, - // ), - // ), - // SvgPicture.asset( - // 'assets/img/icon/arrow_right.svg', - // width: 8.rpx, - // height: 15 - // .rpx, // 如果 SVG 中没有固定颜色,可以这样设置 - // color: themeController - // .currentColor.sc3, - // ), - // ].divide(SizedBox(width: 28.rpx)), - // ), - // ], - // ), - // ), - // ), - // ), - // ClickableContainer( - // backgroundColor: Colors.transparent, // 容器背景色 - // highlightColor: themeController - // .currentColor.sc21, // 点击时的背景色 - // padding: EdgeInsetsDirectional.fromSTEB( - // 40.rpx, 0.rpx, 40.rpx, 0.rpx), - // onTap: () { - // print('点击了容器'); - // }, - // child: Container( - // child: Padding( - // padding: EdgeInsetsDirectional.fromSTEB( - // 0.rpx, 20.rpx, 0.rpx, 20.rpx), - // child: Row( - // mainAxisSize: MainAxisSize.max, - // mainAxisAlignment: - // MainAxisAlignment.spaceBetween, - // children: [ - // Row( - // mainAxisSize: MainAxisSize.max, - // children: [ - // Text( - // '设置页.选择语言'.tr, - // style: - // FlutterFlowTheme.of(context) - // .bodyMedium - // .override( - // fontFamily: 'Inter', - // color: themeController - // .currentColor.sc3, - // fontSize: AppConstants() - // .title_text_fontSize, - // letterSpacing: 0.0, - // ), - // ), - // ].divide(SizedBox(width: 22.rpx)), - // ), - // Row( - // mainAxisSize: MainAxisSize.max, - // children: [ - // Text( - // '中文', - // style: - // FlutterFlowTheme.of(context) - // .bodyMedium - // .override( - // fontFamily: 'Inter', - // color: - // Color(0xFFD9E3EB), - // fontSize: 26.rpx, - // letterSpacing: 0.0, - // ), - // ), - // SvgPicture.asset( - // 'assets/img/icon/arrow_right.svg', - // width: 8.rpx, - // height: 15 - // .rpx, // 如果 SVG 中没有固定颜色,可以这样设置 - // color: themeController - // .currentColor.sc3, - // ), - // ].divide(SizedBox(width: 28.rpx)), - // ), - // ], - // ), - // ), - // ), - // ), - // ClickableContainer( - // backgroundColor: Colors.transparent, // 容器背景色 - // highlightColor: themeController - // .currentColor.sc21, // 点击时的背景色 - // padding: EdgeInsetsDirectional.fromSTEB( - // 0.rpx, 0.rpx, 0.rpx, 0.rpx), - // onTap: () { - // print('点击了容器'); - // }, - // child: Container( - // child: Padding( - // padding: EdgeInsetsDirectional.fromSTEB( - // 40.rpx, 20.rpx, 40.rpx, 20.rpx), - // child: Row( - // mainAxisSize: MainAxisSize.max, - // mainAxisAlignment: - // MainAxisAlignment.spaceBetween, - // children: [ - // Row( - // mainAxisSize: MainAxisSize.max, - // children: [ - // Text( - // '设置页.关于我们'.tr, - // style: - // FlutterFlowTheme.of(context) - // .bodyMedium - // .override( - // fontFamily: 'Inter', - // color: themeController - // .currentColor.sc3, - // fontSize: AppConstants() - // .title_text_fontSize, - // letterSpacing: 0.0, - // ), - // ), - // ].divide(SizedBox(width: 22.rpx)), - // ), - // SvgPicture.asset( - // 'assets/img/icon/arrow_right.svg', - // width: 8.rpx, - // height: - // 14.rpx, // 如果 SVG 中没有固定颜色,可以这样设置 - // color: themeController - // .currentColor.sc3, - // ), - // ], - // ), - // ), - // ), - // ), - // ClickableContainer( - // backgroundColor: Colors.transparent, // 容器背景色 - // highlightColor: themeController - // .currentColor.sc21, // 点击时的背景色 - // padding: EdgeInsetsDirectional.fromSTEB( - // 40.rpx, 0.rpx, 40.rpx, 0.rpx), - // onTap: () { - // print('点击了容器'); - // }, - // child: Container( - // child: Padding( - // padding: EdgeInsetsDirectional.fromSTEB( - // 0.rpx, 20.rpx, 0.rpx, 20.rpx), - // child: Row( - // mainAxisSize: MainAxisSize.max, - // mainAxisAlignment: - // MainAxisAlignment.spaceBetween, - // children: [ - // Row( - // mainAxisSize: MainAxisSize.max, - // children: [ - // Text( - // '设置页.用户协议'.tr, - // style: - // FlutterFlowTheme.of(context) - // .bodyMedium - // .override( - // fontFamily: 'Inter', - // color: themeController - // .currentColor.sc3, - // fontSize: AppConstants() - // .title_text_fontSize, - // letterSpacing: 0.0, - // ), - // ), - // ].divide(SizedBox(width: 22.rpx)), - // ), - // SvgPicture.asset( - // 'assets/img/icon/arrow_right.svg', - // width: 8.rpx, - // height: - // 15.rpx, // 如果 SVG 中没有固定颜色,可以这样设置 - // color: themeController - // .currentColor.sc3, - // ), - // ], - // ), - // ), - // ), - // ), - // ClickableContainer( - // backgroundColor: Colors.transparent, // 容器背景色 - // highlightColor: themeController - // .currentColor.sc21, // 点击时的背景色 - // padding: EdgeInsetsDirectional.fromSTEB( - // 0.rpx, 0.rpx, 0.rpx, 0.rpx), - // onTap: () { - // print('点击了容器'); - // }, - // child: Container( - // child: Padding( - // padding: EdgeInsetsDirectional.fromSTEB( - // 40.rpx, 20.rpx, 40.rpx, 20.rpx), - // child: Row( - // mainAxisSize: MainAxisSize.max, - // mainAxisAlignment: - // MainAxisAlignment.spaceBetween, - // children: [ - // Row( - // mainAxisSize: MainAxisSize.max, - // children: [ - // Text( - // '设置页.隐私协议'.tr, - // style: - // FlutterFlowTheme.of(context) - // .bodyMedium - // .override( - // fontFamily: 'Inter', - // color: themeController - // .currentColor.sc3, - // fontSize: AppConstants() - // .title_text_fontSize, - // letterSpacing: 0.0, - // ), - // ), - // ].divide(SizedBox(width: 22.rpx)), - // ), - // SvgPicture.asset( - // 'assets/img/icon/arrow_right.svg', - // width: 8.rpx, - // height: - // 14.rpx, // 如果 SVG 中没有固定颜色,可以这样设置 - // color: themeController - // .currentColor.sc3, - // ), - // ], - // ), - // ), - // ), - // ), - // ] - // .divide(SizedBox(height: 0.rpx)) - // .addToStart(SizedBox(height: 30.rpx)) - // .addToEnd(SizedBox(height: 30.rpx)), - // ), - // ), - // ), - // ), - SizedBox( - height: 30.rpx, - ), - Text( - "企业简介\n\n\n嘉兴太和信息技术有限公司成立于2013年,是一家以传感技术、室内定位技术和人工智能技术为基础的国家高新技术企业,AI非接触生命体征传感器、高精度室内外一体定位平台、AI视频分析系统、射频消融等技术成果,目前已经拥有30多类知识产权证书,多项专利技术处于行业领先水平。\n\n\n我司研发的“非接触式生命体征传感器”是一款基于BCG信号原理,通过检测人体心脏搏动引起的微小振动的传感器系统。传感器系统通过将人体微弱的心跳、呼吸信号转换未电信号,进行相关生命体征分析。该传感器可为用户提供高灵敏度和精确度检测结构,适用于需要非接触式、高分辨率的监测场景。该系统的硬件、软件及生产维护均由我司自主开发和管理,拥有完全自主知识产权,并已申请多项国家专利,可依据用户需求定制个性化方案。\n\n\n该产品置于床垫下方使用,全程完全无感。采集的体征数据通过睡眠健康管理平台实时显示用户的健康状态,并对每次的睡眠报告进行系统化归档管理,支持长期查询。一旦用户在使用过程中出现异常情况,系统可及时做出判断并反馈预警信息和建议。目前,心率监测的准确度可达97%以上,呼吸监测的准确度可达95%以上,其他生理指标的监测精度也显著优于同类产品。该产品主体材质均采用符合国家标准的环保材料,部分硅胶配件达到食品级安全标准。产品尺寸可根据需求进行定制,适用于单人床、双人床、婴儿床、椅子及枕头等多种场景。\n\n\n睡眠健康管理平台通过实时预警与远程管理,提升睡眠质量及慢病干预效率,助力养老院、月子中心、康复中心、智能寝具等行业降本增效,实现精准健康的科学管理。", - style: TextStyle( - fontSize: AppConstants().normal_text_fontSize, - color: themeController.currentColor.sc3), - ), - ], + padding: EdgeInsets.symmetric(horizontal: 30.rpx), + child: Column(children: [ + Expanded( + child: Container( + child: widget.webView, + ), ), - ), + ]), ), ), ), @@ -417,51 +125,4 @@ class _AboutUsPageState extends State { ), ); } - - Widget _buildDeviceCard(BuildContext context, - {required String title, required String imageUrl, required String type}) { - return CustomCard( - borderRadius: 20.rpx, // 圆角大小 - onTap: () { - if (type != null) { - if (type == '1') { - Get.toNamed("/blueteethDevice"); - } - } - }, - - colors: [themeController.currentColor.sc17], // 背景色 - child: Container( - width: double.infinity, - height: MediaQuery.sizeOf(context).height * 0.135, - constraints: BoxConstraints( - minHeight: 220.rpx, - ), - padding: EdgeInsetsDirectional.fromSTEB(77.rpx, 0, 21.rpx, 0), - child: Row( - mainAxisSize: MainAxisSize.max, - mainAxisAlignment: MainAxisAlignment.spaceBetween, - children: [ - Text( - title, - style: FlutterFlowTheme.of(context).bodyMedium.override( - fontFamily: 'Inter', - color: const Color(0xFFC2CED7), - fontSize: 30.rpx, - letterSpacing: 0.0, - ), - ), - ClipRRect( - borderRadius: BorderRadius.circular(8.rpx), - child: Image.asset( - imageUrl, - width: 212.rpx, - height: 168.rpx, - ), - ), - ], - ), - ), - ); - } } diff --git a/lib/pages/user/setting_page.dart b/lib/pages/user/setting_page.dart index 1f1b3e0..cde09a6 100644 --- a/lib/pages/user/setting_page.dart +++ b/lib/pages/user/setting_page.dart @@ -313,8 +313,9 @@ class _SettingPageState extends State { padding: EdgeInsetsDirectional.fromSTEB( 40.rpx, 0.rpx, 40.rpx, 0.rpx), onTap: () { - TopSlideNotification.show(context, - text: "待开发功能".tr); + // TopSlideNotification.show(context, + // text: "待开发功能".tr); + Get.toNamed("/userSchemePage"); }, child: Container( child: Padding( @@ -364,8 +365,9 @@ class _SettingPageState extends State { padding: EdgeInsetsDirectional.fromSTEB( 0.rpx, 0.rpx, 0.rpx, 0.rpx), onTap: () { - TopSlideNotification.show(context, - text: "待开发功能".tr); + // TopSlideNotification.show(context, + // text: "待开发功能".tr); + Get.toNamed("/privacyPage"); }, child: Container( child: Padding( diff --git a/lib/routers/routers.dart b/lib/routers/routers.dart index 74cb16a..123eb05 100644 --- a/lib/routers/routers.dart +++ b/lib/routers/routers.dart @@ -32,8 +32,10 @@ import 'package:vbvs_app/pages/setting/language_setting.dart'; import 'package:vbvs_app/pages/sleep_report/new_sleep_report_page.dart'; import 'package:vbvs_app/pages/sleep_report/sleep_report_page.dart'; import 'package:vbvs_app/pages/user/about_us_page.dart'; +import 'package:vbvs_app/pages/user/privacy_scheme_page.dart'; import 'package:vbvs_app/pages/user/setting_page.dart'; import 'package:vbvs_app/pages/user/update_user_page.dart'; +import 'package:vbvs_app/pages/user/user_scheme_page.dart'; ThemeController themeController = Get.find(); @@ -75,6 +77,8 @@ var routes = { "/repairListPage": (contxt) => RepairListPage(), "/newSleepReportPage": (contxt, {arguments}) => NewSleepReportPage(date: arguments), + "/userSchemePage": (contxt) => UserSchemePage(), + "/privacyPage": (contxt) => PrivacySchemePage(), }; var onGenerateRoute = (RouteSettings settings) { diff --git a/macos/Flutter/GeneratedPluginRegistrant.swift b/macos/Flutter/GeneratedPluginRegistrant.swift index 58fabef..3ff2e26 100644 --- a/macos/Flutter/GeneratedPluginRegistrant.swift +++ b/macos/Flutter/GeneratedPluginRegistrant.swift @@ -13,6 +13,7 @@ import flutter_blue_plus import flutter_inappwebview_macos import flutter_localization import flutter_web_auth_2 +import geolocator_apple import google_sign_in_ios import mobile_scanner import package_info_plus @@ -33,6 +34,7 @@ func RegisterGeneratedPlugins(registry: FlutterPluginRegistry) { InAppWebViewFlutterPlugin.register(with: registry.registrar(forPlugin: "InAppWebViewFlutterPlugin")) FlutterLocalizationPlugin.register(with: registry.registrar(forPlugin: "FlutterLocalizationPlugin")) FlutterWebAuth2Plugin.register(with: registry.registrar(forPlugin: "FlutterWebAuth2Plugin")) + GeolocatorPlugin.register(with: registry.registrar(forPlugin: "GeolocatorPlugin")) FLTGoogleSignInPlugin.register(with: registry.registrar(forPlugin: "FLTGoogleSignInPlugin")) MobileScannerPlugin.register(with: registry.registrar(forPlugin: "MobileScannerPlugin")) FPPPackageInfoPlusPlugin.register(with: registry.registrar(forPlugin: "FPPPackageInfoPlusPlugin")) diff --git a/pubspec.lock b/pubspec.lock index 9a48be4..888b9b9 100644 --- a/pubspec.lock +++ b/pubspec.lock @@ -6,7 +6,7 @@ packages: description: path: "." ref: master - resolved-ref: "700479d131b6230d87aebae94ea610ca3a8decfc" + resolved-ref: cff5448fe07ca7f2141dcb1b7c5ee430ca44d64d url: "http://git.real.he-info.cn:8080/r/~qmqz/EasyDartModule.git" source: git version: "1.0.0" @@ -507,7 +507,7 @@ packages: description: path: "." ref: main - resolved-ref: d0019caff020ccfda92c337d0d9a4e4670eecc54 + resolved-ref: "623980055c62d475ab13921d520eacac237ca070" url: "http://admin@git.real.he-info.cn:8080/r/ef.git" source: git version: "0.0.1" @@ -848,10 +848,90 @@ packages: dependency: transitive description: name: functions_client - sha256: a49876ebae32a50eb62483c5c5ac80ed0d8da34f98ccc23986b03a8d28cee07c + sha256: b410e4d609522357396cd84bb9a8f6e3a4561b5f7d3ce82267f6f1c2af42f16b url: "https://pub.flutter-io.cn" source: hosted - version: "2.4.1" + version: "2.4.2" + geocoding: + dependency: "direct main" + description: + name: geocoding + sha256: b34c0501bbbaf3190b85bef3078b27cf66c28a8915c6d3af50d67f356aa7da31 + url: "https://pub.flutter-io.cn" + source: hosted + version: "2.1.0" + geocoding_android: + dependency: transitive + description: + name: geocoding_android + sha256: "609db1d71bc364dd9d0616f72a41c01e0c74f3a3807efb85e0d5a67e57baf50f" + url: "https://pub.flutter-io.cn" + source: hosted + version: "2.1.2" + geocoding_ios: + dependency: transitive + description: + name: geocoding_ios + sha256: "8f79e380abb640ef4d88baee8bb65390058c802601158d0813dc990b36b189d2" + url: "https://pub.flutter-io.cn" + source: hosted + version: "2.1.1" + geocoding_platform_interface: + dependency: transitive + description: + name: geocoding_platform_interface + sha256: "8848605d307d844d89937cdb4b8ad7dfa880552078f310fa24d8a460f6dddab4" + url: "https://pub.flutter-io.cn" + source: hosted + version: "2.0.1" + geolocator: + dependency: "direct main" + description: + name: geolocator + sha256: afebc912cbe6496e8823e064ca519afb5610072bb9c4a9feea715f6feb4f7f28 + url: "https://pub.flutter-io.cn" + source: hosted + version: "13.0.3" + geolocator_android: + dependency: transitive + description: + name: geolocator_android + sha256: fcb1760a50d7500deca37c9a666785c047139b5f9ee15aa5469fae7dbbe3170d + url: "https://pub.flutter-io.cn" + source: hosted + version: "4.6.2" + geolocator_apple: + dependency: transitive + description: + name: geolocator_apple + sha256: dbdd8789d5aaf14cf69f74d4925ad1336b4433a6efdf2fce91e8955dc921bf22 + url: "https://pub.flutter-io.cn" + source: hosted + version: "2.3.13" + geolocator_platform_interface: + dependency: transitive + description: + name: geolocator_platform_interface + sha256: "30cb64f0b9adcc0fb36f628b4ebf4f731a2961a0ebd849f4b56200205056fe67" + url: "https://pub.flutter-io.cn" + source: hosted + version: "4.2.6" + geolocator_web: + dependency: transitive + description: + name: geolocator_web + sha256: b1ae9bdfd90f861fde8fd4f209c37b953d65e92823cb73c7dee1fa021b06f172 + url: "https://pub.flutter-io.cn" + source: hosted + version: "4.1.3" + geolocator_windows: + dependency: transitive + description: + name: geolocator_windows + sha256: "175435404d20278ffd220de83c2ca293b73db95eafbdc8131fe8609be1421eb6" + url: "https://pub.flutter-io.cn" + source: hosted + version: "0.2.5" get: dependency: transitive description: @@ -944,10 +1024,10 @@ packages: dependency: transitive description: name: gotrue - sha256: d6362dff9a54f8c1c372bb137c858b4024c16407324d34e6473e59623c9b9f50 + sha256: "04a6efacffd42773ed96dc752f19bb20a1fbc383e81ba82659072b775cf62912" url: "https://pub.flutter-io.cn" source: hosted - version: "2.11.1" + version: "2.12.0" graphs: dependency: transitive description: @@ -984,10 +1064,10 @@ packages: dependency: transitive description: name: http - sha256: fe7ab022b76f3034adc518fb6ea04a82387620e19977665ea18d30a1cf43442f + sha256: "2c11f3f94c687ee9bad77c171151672986360b2b001d109814ee7140b2cf261b" url: "https://pub.flutter-io.cn" source: hosted - version: "1.3.0" + version: "1.4.0" http2: dependency: transitive description: @@ -1282,7 +1362,7 @@ packages: path: "." ref: main resolved-ref: "7302210bd91f839b7ed63c6aa94af6c75f25c67a" - url: "https://git.wslpc.real.he-info.cn:94/r/mongows.git" + url: "https://gitea.wslpc.real.he-info.cn:94/flutter/mongows.git" source: git version: "0.10.3" mqtt5_client: @@ -1569,10 +1649,10 @@ packages: dependency: transitive description: name: postgrest - sha256: b74dc0f57b5dca5ce9f57a54b08110bf41d6fc8a0483c0fec10c79e9aa0fb2bb + sha256: "10b81a23b1c829ccadf68c626b4d66666453a1474d24c563f313f5ca7851d575" url: "https://pub.flutter-io.cn" source: hosted - version: "2.4.1" + version: "2.4.2" power_extensions: dependency: transitive description: @@ -1593,10 +1673,10 @@ packages: dependency: transitive description: name: provider - sha256: "489024f942069c2920c844ee18bb3d467c69e48955a4f32d1677f71be103e310" + sha256: "4abbd070a04e9ddc287673bf5a030c7ca8b685ff70218720abab8b092f53dd84" url: "https://pub.flutter-io.cn" source: hosted - version: "6.1.4" + version: "6.1.5" pub_semver: dependency: transitive description: @@ -1641,10 +1721,10 @@ packages: dependency: transitive description: name: realtime_client - sha256: e3089dac2121917cc0c72d42ab056fea0abbaf3c2229048fc50e64bafc731adf + sha256: "3a0a99b5bd0fc3b35e8ee846d9a22fa2c2117f7ef1cb73d1e5f08f6c3d09c4e9" url: "https://pub.flutter-io.cn" source: hosted - version: "2.4.2" + version: "2.5.0" redis: dependency: transitive description: @@ -1902,10 +1982,10 @@ packages: dependency: transitive description: name: storage_client - sha256: "9f9ed283943313b23a1b27139bb18986e9b152a6d34530232c702c468d98e91a" + sha256: "09bac4d75eea58e8113ca928e6655a09cc8059e6d1b472ee801f01fde815bcfc" url: "https://pub.flutter-io.cn" source: hosted - version: "2.3.1" + version: "2.4.0" stream_channel: dependency: transitive description: @@ -1942,18 +2022,18 @@ packages: dependency: transitive description: name: supabase - sha256: c3ebddba69ddcf16d8b78e8c44c4538b0193d1cf944fde3b72eb5b279892a370 + sha256: f00172f5f0b2148ea1c573f52862d50cacb6f353f579f741fa35e51704845958 url: "https://pub.flutter-io.cn" source: hosted - version: "2.6.3" + version: "2.7.0" supabase_flutter: dependency: transitive description: name: supabase_flutter - sha256: "3b5b5b492e342f63f301605d0c66f6528add285b5744f53c9fd9abd5ffdbce5b" + sha256: d88eccf9e46e57129725a08e72a3109b6f780921fdc27fe3d7669a11ae80906b url: "https://pub.flutter-io.cn" source: hosted - version: "2.8.4" + version: "2.9.0" syncfusion_flutter_core: dependency: transitive description: @@ -2006,10 +2086,10 @@ packages: dependency: transitive description: name: timeago - sha256: "054cedf68706bb142839ba0ae6b135f6b68039f0b8301cbe8784ae653d5ff8de" + sha256: b05159406a97e1cbb2b9ee4faa9fb096fe0e2dfcd8b08fcd2a00553450d3422e url: "https://pub.flutter-io.cn" source: hosted - version: "3.7.0" + version: "3.7.1" timing: dependency: transitive description: @@ -2178,6 +2258,14 @@ packages: url: "https://pub.flutter-io.cn" source: hosted version: "1.1.1" + weather: + dependency: "direct main" + description: + name: weather + sha256: "7d49931907242b2ae13f772ff9a721c51d54944f46e527ae41de68cb5c971267" + url: "https://pub.flutter-io.cn" + source: hosted + version: "3.2.1" web: dependency: transitive description: @@ -2190,10 +2278,10 @@ packages: dependency: transitive description: name: web_socket - sha256: bfe6f435f6ec49cb6c01da1e275ae4228719e59a6b067048c51e72d9d63bcc4b + sha256: "34d64019aa8e36bf9842ac014bb5d2f5586ca73df5e4d9bf5c936975cae6982c" url: "https://pub.flutter-io.cn" source: hosted - version: "1.0.0" + version: "1.0.1" web_socket_channel: dependency: transitive description: @@ -2222,18 +2310,18 @@ packages: dependency: transitive description: name: webview_flutter_platform_interface - sha256: "18b1640839cf6546784a524c72aded5b6e86b23e7167dc2311cc96f7658b64bd" + sha256: "7cb32b21825bd65569665c32bb00a34ded5779786d6201f5350979d2d529940d" url: "https://pub.flutter-io.cn" source: hosted - version: "2.11.0" + version: "2.13.0" webview_flutter_wkwebview: dependency: transitive description: name: webview_flutter_wkwebview - sha256: c9f9be526fa0d3347374ceaa05c4b3acb85f4f112abd62f7d74b7d301fa515ff + sha256: a3d461fe3467014e05f3ac4962e5fdde2a4bf44c561cb53e9ae5c586600fdbc3 url: "https://pub.flutter-io.cn" source: hosted - version: "3.20.0" + version: "3.22.0" webviewx_plus: dependency: transitive description: @@ -2294,10 +2382,10 @@ packages: dependency: transitive description: name: yet_another_json_isolate - sha256: "56155e9e0002cc51ea7112857bbcdc714d4c35e176d43e4d3ee233009ff410c9" + sha256: fe45897501fa156ccefbfb9359c9462ce5dec092f05e8a56109db30be864f01e url: "https://pub.flutter-io.cn" source: hosted - version: "2.0.3" + version: "2.1.0" sdks: dart: ">=3.5.4 <4.0.0" flutter: ">=3.24.0" diff --git a/pubspec.yaml b/pubspec.yaml index 55f0319..d3ab8f2 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -33,7 +33,7 @@ dependencies: flutter_blue_plus: ^1.35.3 permission_handler: ^12.0.0+1 loading_indicator: ^3.1.1 - # geolocator: ^13.0.4 + geolocator: ^13.0.1 easydevice: path: C:\Users\wyf\Desktop\blue\easydevice # url: http:///enchantedwyf@git.it.real.he-info.cn:90/r/easydevice.git @@ -49,6 +49,8 @@ dependencies: google_sign_in: ^6.2.1 path: ^1.8.0 flutter_pdfview: ^1.4.0+1 + weather: ^3.1.1 + geocoding: ^2.1.0 dev_dependencies: @@ -63,6 +65,9 @@ dependency_overrides: collection: ^1.19.0 data_table_2: 2.5.16 # 2.5.17版本以后会报错,data_table_2.dart:525:47: Error:The method 'withValues' isn't defined ffor the class 'Color' flutter_blue_plus: 1.34.5 # 1.35.0 版本android连接蓝牙有问题 + geolocator: 13.0.3 + geocoding: 2.1.0 + flutter: diff --git a/windows/flutter/generated_plugin_registrant.cc b/windows/flutter/generated_plugin_registrant.cc index cb06e77..631a4db 100644 --- a/windows/flutter/generated_plugin_registrant.cc +++ b/windows/flutter/generated_plugin_registrant.cc @@ -10,6 +10,7 @@ #include #include #include +#include #include #include #include @@ -24,6 +25,8 @@ void RegisterPlugins(flutter::PluginRegistry* registry) { registry->GetRegistrarForPlugin("FlutterInappwebviewWindowsPluginCApi")); FlutterLocalizationPluginCApiRegisterWithRegistrar( registry->GetRegistrarForPlugin("FlutterLocalizationPluginCApi")); + GeolocatorWindowsRegisterWithRegistrar( + registry->GetRegistrarForPlugin("GeolocatorWindows")); PermissionHandlerWindowsPluginRegisterWithRegistrar( registry->GetRegistrarForPlugin("PermissionHandlerWindowsPlugin")); RivePluginRegisterWithRegistrar( diff --git a/windows/flutter/generated_plugins.cmake b/windows/flutter/generated_plugins.cmake index 3fc750f..40ebb0a 100644 --- a/windows/flutter/generated_plugins.cmake +++ b/windows/flutter/generated_plugins.cmake @@ -7,6 +7,7 @@ list(APPEND FLUTTER_PLUGIN_LIST connectivity_plus flutter_inappwebview_windows flutter_localization + geolocator_windows permission_handler_windows rive_common url_launcher_windows