Merge remote-tracking branch 'origin/master'
This commit is contained in:
@@ -251,7 +251,7 @@ Future<void> showHaveBindDialog(BuildContext context) async {
|
||||
mainAxisAlignment: MainAxisAlignment.center,
|
||||
children: [
|
||||
Text(
|
||||
'知道了'.tr,
|
||||
'返回'.tr,
|
||||
style: TextStyle(
|
||||
color: themeController.currentColor.sc3,
|
||||
fontFamily: 'Inter',
|
||||
@@ -935,7 +935,7 @@ Future<void> showTipDialog(
|
||||
child: Container(
|
||||
decoration: BoxDecoration(
|
||||
color: backgroundColor ?? Colors.white,
|
||||
borderRadius: BorderRadius.circular(20.0),
|
||||
borderRadius: BorderRadius.circular(8.0),
|
||||
),
|
||||
padding: EdgeInsetsDirectional.fromSTEB(64.rpx, 0, 64.rpx, 0),
|
||||
child: Container(
|
||||
@@ -963,8 +963,9 @@ Future<void> showTipDialog(
|
||||
Get.back(); // 关闭对话框
|
||||
},
|
||||
colors: [
|
||||
stringToColor("FCFCFC"),
|
||||
stringToColor("CEECE3"),
|
||||
stringToColor("1592AA"),
|
||||
stringToColor("0C83A7"),
|
||||
stringToColor("006FA3"),
|
||||
],
|
||||
child: Container(
|
||||
width: MediaQuery.sizeOf(context).width,
|
||||
@@ -978,9 +979,9 @@ Future<void> showTipDialog(
|
||||
mainAxisAlignment: MainAxisAlignment.center,
|
||||
children: [
|
||||
Text(
|
||||
'知道了'.tr,
|
||||
'确定'.tr,
|
||||
style: TextStyle(
|
||||
color: stringToColor("#333333"),
|
||||
color: Colors.white,
|
||||
fontFamily: 'Inter',
|
||||
fontSize: AppConstants().normal_text_fontSize,
|
||||
letterSpacing: 0.0,
|
||||
|
||||
@@ -205,7 +205,7 @@ class _MHTBlueteethDevicePageState extends State<MHTBlueteethDevicePage> {
|
||||
}
|
||||
|
||||
void _startPeriodicScan() {
|
||||
_timer = Timer.periodic(Duration(seconds: 10), (timer) {
|
||||
_timer = Timer.periodic(Duration(seconds: 3), (timer) {
|
||||
if (mhtBlueToothController.shouldScan.value && !isScanning) {
|
||||
_removeOldDevices(); // 先清理老旧设备
|
||||
_startScanning();
|
||||
|
||||
@@ -734,7 +734,7 @@ class _MHTCalibrationPageState extends State<MHTCalibrationPage> {
|
||||
|
||||
void _startPollingProgress(
|
||||
String serviceAddress, String progressApi, bool isSecondStep) {
|
||||
_requestProgress(serviceAddress, progressApi, isSecondStep);
|
||||
// _requestProgress(serviceAddress, progressApi, isSecondStep);
|
||||
_pollingTimer = Timer.periodic(Duration(seconds: 1), (_) {
|
||||
_requestProgress(serviceAddress, progressApi, isSecondStep);
|
||||
});
|
||||
@@ -866,6 +866,14 @@ class _MHTCalibrationPageState extends State<MHTCalibrationPage> {
|
||||
|
||||
void _handleCalibrationFailure(String message) {
|
||||
_pollingTimer?.cancel();
|
||||
if (deviceCalibrationController.cd.value != 10000) {
|
||||
TopSlideNotification.show(
|
||||
context,
|
||||
text: message,
|
||||
textColor: themeController.currentColor.sc9,
|
||||
);
|
||||
}
|
||||
|
||||
deviceCalibrationController.statusContext.value = "";
|
||||
deviceCalibrationController.bed_calibration.value == 0;
|
||||
blueteethBindController.cid?.value = "";
|
||||
@@ -875,11 +883,6 @@ class _MHTCalibrationPageState extends State<MHTCalibrationPage> {
|
||||
deviceCalibrationController.cd.value = 10000;
|
||||
deviceCalibrationController.updateAll();
|
||||
failureNotifier.value = true;
|
||||
TopSlideNotification.show(
|
||||
context,
|
||||
text: message,
|
||||
textColor: themeController.currentColor.sc9,
|
||||
);
|
||||
}
|
||||
|
||||
void _startCalibration(bool isSecondStep) {
|
||||
@@ -904,7 +907,7 @@ class _MHTCalibrationPageState extends State<MHTCalibrationPage> {
|
||||
data["side"] = currentCalibrationStep.value == 1 ? "A" : "B";
|
||||
}
|
||||
}
|
||||
|
||||
data['cancel'] = true;
|
||||
requestWithLog(
|
||||
logTitle: "设备校准",
|
||||
method: MyHttpMethod.post,
|
||||
|
||||
@@ -11,6 +11,7 @@ import 'package:vbvs_app/component/tool/CustomCard.dart';
|
||||
import 'package:vbvs_app/component/tool/TopSlideNotification.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/homepage/controller/mht_home_controller.dart';
|
||||
|
||||
class MHTPeopleInfoPage extends StatefulWidget {
|
||||
const MHTPeopleInfoPage({Key? key}) : super(key: key);
|
||||
@@ -192,6 +193,8 @@ class _MHTPeopleInfoPageState extends State<MHTPeopleInfoPage> {
|
||||
await _savePersonData(person, context);
|
||||
}
|
||||
TopSlideNotification.show(context, text: "保存成功");
|
||||
MHTHomeController mhtHomeController = Get.find();
|
||||
mhtHomeController.getPersonList();
|
||||
Get.offNamed("/bindDeviceSuccess");
|
||||
},
|
||||
colors: const [
|
||||
|
||||
@@ -107,12 +107,14 @@ class _MHTWifiPageState extends State<MHTWifiPage> {
|
||||
|
||||
// 导航到下一页
|
||||
if (blueteethBindController.wifiStatus.value != 1) {
|
||||
showConfirmDialog(context, Container(), "未配置网络提示".tr, onConfirm: () {
|
||||
showConfirmDialog(context, Container(), "未配置网络提示".tr, onConfirm: () async {
|
||||
_cleanupResources();
|
||||
await _disconnectDevice();
|
||||
Get.toNamed("/calibrationPage");
|
||||
}, onCancel: () {});
|
||||
} else {
|
||||
_cleanupResources();
|
||||
await _disconnectDevice();
|
||||
Get.toNamed("/calibrationPage");
|
||||
}
|
||||
}
|
||||
@@ -1101,7 +1103,7 @@ class _MHTWifiPageState extends State<MHTWifiPage> {
|
||||
);
|
||||
}
|
||||
|
||||
void _disconnectDevice() async {
|
||||
Future<void> _disconnectDevice() async {
|
||||
try {
|
||||
THapp bledevice = THapp(device: widget.deviceInfo.scanResult.device);
|
||||
await bledevice.disconnect();
|
||||
|
||||
@@ -77,10 +77,45 @@ class _MhtSleepReportPageState extends State<MhtSleepReportPage> {
|
||||
Obx(() {
|
||||
if (userInfoController.model.login! == null ||
|
||||
userInfoController.model.login! == 0) {
|
||||
return Text(
|
||||
"登录查看睡眠报告".tr,
|
||||
style:
|
||||
TextStyle(color: Colors.white, fontSize: 30.rpx),
|
||||
return Center(
|
||||
child: InkWell(
|
||||
onTap: () => Get.toNamed("/loginPage"),
|
||||
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();
|
||||
|
||||
@@ -10,10 +10,13 @@ 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/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/mh_controller/people_info_controller.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> {
|
||||
Map data;
|
||||
@@ -129,6 +132,13 @@ class PeopleInfoPage extends GetView<PeopleInfoController> {
|
||||
TopSlideNotification.show(context,
|
||||
text: "更新成功".tr,
|
||||
textColor: Color(0XFF00C1AA));
|
||||
MHTHomeController mhtHomeController =
|
||||
Get.find();
|
||||
mhtHomeController.getPersonList();
|
||||
WebviewTestController
|
||||
webviewTestController = Get.find();
|
||||
webviewTestController
|
||||
.queryPersonInfoByMac();
|
||||
} catch (e) {
|
||||
print("保存失败:$e");
|
||||
TopSlideNotification.show(context,
|
||||
|
||||
@@ -1447,6 +1447,8 @@ class MHTLoginPage extends GetView<MHTLoginController> {
|
||||
// "/#/pages/agreement/agreement?type=2&hideHead=true",
|
||||
// btnName:
|
||||
// "同意并继续");
|
||||
Get.toNamed(
|
||||
"/userAgreementPage");
|
||||
},
|
||||
child: Text(
|
||||
'《用户协议》'.tr,
|
||||
@@ -1491,6 +1493,8 @@ class MHTLoginPage extends GetView<MHTLoginController> {
|
||||
// "/#/pages/agreement/agreement?type=1&hideHead=true",
|
||||
// btnName:
|
||||
// "同意并继续");
|
||||
Get.toNamed(
|
||||
"/privacyPolicyPage");
|
||||
},
|
||||
child: Text(
|
||||
'《隐私协议》'.tr,
|
||||
|
||||
Reference in New Issue
Block a user