Merge remote-tracking branch 'origin/master'

This commit is contained in:
czz
2025-07-09 14:37:17 +08:00
10 changed files with 81 additions and 21 deletions

Binary file not shown.

View File

@@ -251,7 +251,7 @@ Future<void> showHaveBindDialog(BuildContext context) async {
mainAxisAlignment: MainAxisAlignment.center, mainAxisAlignment: MainAxisAlignment.center,
children: [ children: [
Text( Text(
'知道了'.tr, '返回'.tr,
style: TextStyle( style: TextStyle(
color: themeController.currentColor.sc3, color: themeController.currentColor.sc3,
fontFamily: 'Inter', fontFamily: 'Inter',
@@ -935,7 +935,7 @@ Future<void> showTipDialog(
child: Container( child: Container(
decoration: BoxDecoration( decoration: BoxDecoration(
color: backgroundColor ?? Colors.white, color: backgroundColor ?? Colors.white,
borderRadius: BorderRadius.circular(20.0), borderRadius: BorderRadius.circular(8.0),
), ),
padding: EdgeInsetsDirectional.fromSTEB(64.rpx, 0, 64.rpx, 0), padding: EdgeInsetsDirectional.fromSTEB(64.rpx, 0, 64.rpx, 0),
child: Container( child: Container(
@@ -963,8 +963,9 @@ Future<void> showTipDialog(
Get.back(); // 关闭对话框 Get.back(); // 关闭对话框
}, },
colors: [ colors: [
stringToColor("FCFCFC"), stringToColor("1592AA"),
stringToColor("CEECE3"), stringToColor("0C83A7"),
stringToColor("006FA3"),
], ],
child: Container( child: Container(
width: MediaQuery.sizeOf(context).width, width: MediaQuery.sizeOf(context).width,
@@ -978,9 +979,9 @@ Future<void> showTipDialog(
mainAxisAlignment: MainAxisAlignment.center, mainAxisAlignment: MainAxisAlignment.center,
children: [ children: [
Text( Text(
'知道了'.tr, '确定'.tr,
style: TextStyle( style: TextStyle(
color: stringToColor("#333333"), color: Colors.white,
fontFamily: 'Inter', fontFamily: 'Inter',
fontSize: AppConstants().normal_text_fontSize, fontSize: AppConstants().normal_text_fontSize,
letterSpacing: 0.0, letterSpacing: 0.0,

View File

@@ -205,7 +205,7 @@ class _MHTBlueteethDevicePageState extends State<MHTBlueteethDevicePage> {
} }
void _startPeriodicScan() { void _startPeriodicScan() {
_timer = Timer.periodic(Duration(seconds: 10), (timer) { _timer = Timer.periodic(Duration(seconds: 3), (timer) {
if (mhtBlueToothController.shouldScan.value && !isScanning) { if (mhtBlueToothController.shouldScan.value && !isScanning) {
_removeOldDevices(); // 先清理老旧设备 _removeOldDevices(); // 先清理老旧设备
_startScanning(); _startScanning();

View File

@@ -734,7 +734,7 @@ class _MHTCalibrationPageState extends State<MHTCalibrationPage> {
void _startPollingProgress( void _startPollingProgress(
String serviceAddress, String progressApi, bool isSecondStep) { String serviceAddress, String progressApi, bool isSecondStep) {
_requestProgress(serviceAddress, progressApi, isSecondStep); // _requestProgress(serviceAddress, progressApi, isSecondStep);
_pollingTimer = Timer.periodic(Duration(seconds: 1), (_) { _pollingTimer = Timer.periodic(Duration(seconds: 1), (_) {
_requestProgress(serviceAddress, progressApi, isSecondStep); _requestProgress(serviceAddress, progressApi, isSecondStep);
}); });
@@ -866,6 +866,14 @@ class _MHTCalibrationPageState extends State<MHTCalibrationPage> {
void _handleCalibrationFailure(String message) { void _handleCalibrationFailure(String message) {
_pollingTimer?.cancel(); _pollingTimer?.cancel();
if (deviceCalibrationController.cd.value != 10000) {
TopSlideNotification.show(
context,
text: message,
textColor: themeController.currentColor.sc9,
);
}
deviceCalibrationController.statusContext.value = ""; deviceCalibrationController.statusContext.value = "";
deviceCalibrationController.bed_calibration.value == 0; deviceCalibrationController.bed_calibration.value == 0;
blueteethBindController.cid?.value = ""; blueteethBindController.cid?.value = "";
@@ -875,11 +883,6 @@ class _MHTCalibrationPageState extends State<MHTCalibrationPage> {
deviceCalibrationController.cd.value = 10000; deviceCalibrationController.cd.value = 10000;
deviceCalibrationController.updateAll(); deviceCalibrationController.updateAll();
failureNotifier.value = true; failureNotifier.value = true;
TopSlideNotification.show(
context,
text: message,
textColor: themeController.currentColor.sc9,
);
} }
void _startCalibration(bool isSecondStep) { void _startCalibration(bool isSecondStep) {
@@ -904,7 +907,7 @@ class _MHTCalibrationPageState extends State<MHTCalibrationPage> {
data["side"] = currentCalibrationStep.value == 1 ? "A" : "B"; data["side"] = currentCalibrationStep.value == 1 ? "A" : "B";
} }
} }
data['cancel'] = true;
requestWithLog( requestWithLog(
logTitle: "设备校准", logTitle: "设备校准",
method: MyHttpMethod.post, method: MyHttpMethod.post,

View File

@@ -11,6 +11,7 @@ import 'package:vbvs_app/component/tool/CustomCard.dart';
import 'package:vbvs_app/component/tool/TopSlideNotification.dart'; import 'package:vbvs_app/component/tool/TopSlideNotification.dart';
import 'package:vbvs_app/pages/common/selectDialog.dart'; import 'package:vbvs_app/pages/common/selectDialog.dart';
import 'package:vbvs_app/pages/mh_page/device/controller/mht_bluetooth_controller.dart'; import 'package:vbvs_app/pages/mh_page/device/controller/mht_bluetooth_controller.dart';
import 'package:vbvs_app/pages/mh_page/homepage/controller/mht_home_controller.dart';
class MHTPeopleInfoPage extends StatefulWidget { class MHTPeopleInfoPage extends StatefulWidget {
const MHTPeopleInfoPage({Key? key}) : super(key: key); const MHTPeopleInfoPage({Key? key}) : super(key: key);
@@ -192,6 +193,8 @@ class _MHTPeopleInfoPageState extends State<MHTPeopleInfoPage> {
await _savePersonData(person, context); await _savePersonData(person, context);
} }
TopSlideNotification.show(context, text: "保存成功"); TopSlideNotification.show(context, text: "保存成功");
MHTHomeController mhtHomeController = Get.find();
mhtHomeController.getPersonList();
Get.offNamed("/bindDeviceSuccess"); Get.offNamed("/bindDeviceSuccess");
}, },
colors: const [ colors: const [

View File

@@ -107,12 +107,14 @@ class _MHTWifiPageState extends State<MHTWifiPage> {
// 导航到下一页 // 导航到下一页
if (blueteethBindController.wifiStatus.value != 1) { if (blueteethBindController.wifiStatus.value != 1) {
showConfirmDialog(context, Container(), "未配置网络提示".tr, onConfirm: () { showConfirmDialog(context, Container(), "未配置网络提示".tr, onConfirm: () async {
_cleanupResources(); _cleanupResources();
await _disconnectDevice();
Get.toNamed("/calibrationPage"); Get.toNamed("/calibrationPage");
}, onCancel: () {}); }, onCancel: () {});
} else { } else {
_cleanupResources(); _cleanupResources();
await _disconnectDevice();
Get.toNamed("/calibrationPage"); Get.toNamed("/calibrationPage");
} }
} }
@@ -1101,7 +1103,7 @@ class _MHTWifiPageState extends State<MHTWifiPage> {
); );
} }
void _disconnectDevice() async { Future<void> _disconnectDevice() async {
try { try {
THapp bledevice = THapp(device: widget.deviceInfo.scanResult.device); THapp bledevice = THapp(device: widget.deviceInfo.scanResult.device);
await bledevice.disconnect(); await bledevice.disconnect();

View File

@@ -77,10 +77,45 @@ class _MhtSleepReportPageState extends State<MhtSleepReportPage> {
Obx(() { Obx(() {
if (userInfoController.model.login! == null || if (userInfoController.model.login! == null ||
userInfoController.model.login! == 0) { userInfoController.model.login! == 0) {
return Text( return Center(
"登录查看睡眠报告".tr, child: InkWell(
style: onTap: () => Get.toNamed("/loginPage"),
TextStyle(color: Colors.white, fontSize: 30.rpx), child: RichText(
text: TextSpan(
children: [
WidgetSpan(
child: Stack(
children: [
Text(
"登录",
style: TextStyle(
color: stringToColor("#84F5FF"),
fontSize: 30.rpx,
),
),
Positioned(
bottom: 0, // 控制下划线与文字的间距
left: 0,
right: 0,
child: Container(
height: 1, // 下划线粗细
color: stringToColor("#84F5FF"),
),
),
],
),
),
TextSpan(
text: "查看睡眠报告",
style: TextStyle(
color: Colors.white,
fontSize: 30.rpx,
),
),
],
),
),
),
); );
} }
return Container(); return Container();

View File

@@ -10,10 +10,13 @@ import 'package:vbvs_app/common/util/FitTool.dart';
import 'package:vbvs_app/common/util/MyUtils.dart'; import 'package:vbvs_app/common/util/MyUtils.dart';
import 'package:vbvs_app/component/tool/CustomCard.dart'; import 'package:vbvs_app/component/tool/CustomCard.dart';
import 'package:vbvs_app/component/tool/TopSlideNotification.dart'; import 'package:vbvs_app/component/tool/TopSlideNotification.dart';
import 'package:vbvs_app/controller/home/home_controller.dart';
import 'package:vbvs_app/controller/main_bottom/global_controller.dart'; import 'package:vbvs_app/controller/main_bottom/global_controller.dart';
import 'package:vbvs_app/controller/mh_controller/people_info_controller.dart'; import 'package:vbvs_app/controller/mh_controller/people_info_controller.dart';
import 'package:vbvs_app/pages/common/selectDialog.dart'; import 'package:vbvs_app/pages/common/selectDialog.dart';
import 'package:vbvs_app/pages/mh_page/homepage/controller/mht_home_controller.dart';
import 'package:vbvs_app/pages/mh_page/test/WebviewTestModel.dart';
class PeopleInfoPage extends GetView<PeopleInfoController> { class PeopleInfoPage extends GetView<PeopleInfoController> {
Map data; Map data;
@@ -129,6 +132,13 @@ class PeopleInfoPage extends GetView<PeopleInfoController> {
TopSlideNotification.show(context, TopSlideNotification.show(context,
text: "更新成功".tr, text: "更新成功".tr,
textColor: Color(0XFF00C1AA)); textColor: Color(0XFF00C1AA));
MHTHomeController mhtHomeController =
Get.find();
mhtHomeController.getPersonList();
WebviewTestController
webviewTestController = Get.find();
webviewTestController
.queryPersonInfoByMac();
} catch (e) { } catch (e) {
print("保存失败:$e"); print("保存失败:$e");
TopSlideNotification.show(context, TopSlideNotification.show(context,

View File

@@ -1447,6 +1447,8 @@ class MHTLoginPage extends GetView<MHTLoginController> {
// "/#/pages/agreement/agreement?type=2&hideHead=true", // "/#/pages/agreement/agreement?type=2&hideHead=true",
// btnName: // btnName:
// "同意并继续"); // "同意并继续");
Get.toNamed(
"/userAgreementPage");
}, },
child: Text( child: Text(
'《用户协议》'.tr, '《用户协议》'.tr,
@@ -1491,6 +1493,8 @@ class MHTLoginPage extends GetView<MHTLoginController> {
// "/#/pages/agreement/agreement?type=1&hideHead=true", // "/#/pages/agreement/agreement?type=1&hideHead=true",
// btnName: // btnName:
// "同意并继续"); // "同意并继续");
Get.toNamed(
"/privacyPolicyPage");
}, },
child: Text( child: Text(
'《隐私协议》'.tr, '《隐私协议》'.tr,

View File

@@ -129,7 +129,9 @@ var mhonGenerateRoute = (RouteSettings settings) {
settings.name != "/otherLoginPage" && settings.name != "/otherLoginPage" &&
settings.name != "/mianPageBottomChange" && settings.name != "/mianPageBottomChange" &&
settings.name != "/registerPage" && settings.name != "/registerPage" &&
settings.name != "/findPasswordPage") { settings.name != "/findPasswordPage" &&
settings.name != "/userAgreementPage" &&
settings.name != "/privacyPolicyPage") {
// TopSlideNotification.show( // TopSlideNotification.show(
// navigatorKey.currentContext!, // navigatorKey.currentContext!,
// text: "必须登录提示".tr, // text: "必须登录提示".tr,