更新安卓通知栏提示
This commit is contained in:
@@ -40,14 +40,6 @@ class _InstantBodyPageState extends State<InstantBodyPage>
|
||||
DeviceTypeController deviceTypeController = Get.find();
|
||||
|
||||
int maxBodyMotion = 1;
|
||||
// String breathState = "否";
|
||||
// String inBed = "离床".tr;
|
||||
// String onlineState = "离线".tr;
|
||||
// Timer? _onlineTimer; // 添加 Timer 引用
|
||||
// int bodyMotion = 0;
|
||||
// int breathrate = 0;
|
||||
// String snores = "否".tr;
|
||||
// int heartrate = 0;
|
||||
String breathState = "-";
|
||||
String inBed = "-";
|
||||
String onlineState = "离线".tr;
|
||||
@@ -71,9 +63,22 @@ class _InstantBodyPageState extends State<InstantBodyPage>
|
||||
|
||||
void _initWebSocket() {
|
||||
// 发送WebSocket请求
|
||||
if (widget.personInfo['status'] != null) {
|
||||
try {
|
||||
onlineState =
|
||||
widget.personInfo['status']['status'] == 1 ? "在线".tr : "离线".tr;
|
||||
if (widget.personInfo['status']['status'] != 0) {
|
||||
inBed = widget.personInfo['status']['inBed'] == 1 ? "在床".tr : "离床".tr;
|
||||
}
|
||||
} catch (e) {
|
||||
edm.EasyDartModule.logger
|
||||
.error("[webscoekt]格式化数据错误-->${{"mac": widget.personInfo['mac']}}");
|
||||
}
|
||||
}
|
||||
edm.EasyDartModule.logger
|
||||
.info("[webscoekt]发送请求:数据-->${{"mac": widget.personInfo['mac']}}");
|
||||
DailyLogUtils.writeLog("[webscoekt]发送请求:数据-->${{"mac": widget.personInfo['mac']}}");
|
||||
DailyLogUtils.writeLog(
|
||||
"[webscoekt]发送请求:数据-->${{"mac": widget.personInfo['mac']}}");
|
||||
edm.EasyDartModule.websocket.sendData(jsonEncode(WebSocketMessage(
|
||||
path: "/vsbs/web/rt/marttress",
|
||||
type: 1,
|
||||
@@ -105,10 +110,10 @@ class _InstantBodyPageState extends State<InstantBodyPage>
|
||||
|
||||
void _startOnlineTimer() {
|
||||
_onlineTimer?.cancel(); // 取消之前的定时器
|
||||
_onlineTimer = Timer.periodic(Duration(seconds: 30), (timer) {
|
||||
_onlineTimer = Timer.periodic(Duration(seconds: 60), (timer) {
|
||||
if (mounted) {
|
||||
setState(() {
|
||||
edm.EasyDartModule.logger.info("30 秒内没有接收到数据,设置为离线");
|
||||
edm.EasyDartModule.logger.info("60 秒内没有接收到数据,设置为离线");
|
||||
onlineState = "离线".tr; // 30 秒内没有接收到数据,设置为离线
|
||||
inBed = "-";
|
||||
bodyMotion = -1;
|
||||
@@ -124,35 +129,50 @@ class _InstantBodyPageState extends State<InstantBodyPage>
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
Map device = widget.personInfo;
|
||||
CommonVariables.callMap["/vsbs/web/rt/marttress"] = (data) {
|
||||
inBed = data["inBed"];
|
||||
// 心率 呼吸 体动 呼吸暂停
|
||||
if ("离床".tr == inBed) {
|
||||
breathState = "否".tr;
|
||||
bodyMotion = 0;
|
||||
breathrate = 0;
|
||||
heartrate = 0;
|
||||
snores = "否".tr;
|
||||
} else {
|
||||
breathState = data["breathState"] == null || data["breathState"] == ""
|
||||
? "-"
|
||||
: data["breathState"].toString().tr;
|
||||
|
||||
bodyMotion = data['bodyMotion'] == null ? 0 : data['bodyMotion'];
|
||||
breathrate = data["breathRate"] == null ? 0 : data["breathRate"];
|
||||
heartrate = data['heartRate'] == null ? 0 : data['heartRate'];
|
||||
snores = data['snores'] == null || data['snores'] == ""
|
||||
? "否".tr
|
||||
: data['snores'].tr;
|
||||
}
|
||||
|
||||
if (mounted) {
|
||||
setState(() {
|
||||
try {
|
||||
CommonVariables.callMap["/vsbs/web/rt/marttress"] = (data) {
|
||||
if (data['status'] == "离线") {
|
||||
inBed = "-";
|
||||
bodyMotion = -1;
|
||||
heartrate = -1;
|
||||
snores = "-";
|
||||
breathrate = -1;
|
||||
breathState = "-";
|
||||
return;
|
||||
}
|
||||
inBed = data["inBed"];
|
||||
// 心率 呼吸 体动 呼吸暂停
|
||||
if ("离床".tr == inBed) {
|
||||
breathState = "否".tr;
|
||||
bodyMotion = 0;
|
||||
breathrate = 0;
|
||||
heartrate = 0;
|
||||
snores = "否".tr;
|
||||
} else {
|
||||
onlineState = "在线".tr; // 接收到数据,设置为在线
|
||||
});
|
||||
}
|
||||
_startOnlineTimer(); // 重置定时器
|
||||
};
|
||||
breathState = data["breathState"] == null || data["breathState"] == ""
|
||||
? "-"
|
||||
: data["breathState"].toString().tr;
|
||||
|
||||
bodyMotion = data['bodyMotion'] == null ? -1 : data['bodyMotion'];
|
||||
breathrate = data["breathRate"] == null ? -1 : data["breathRate"];
|
||||
heartrate = data['heartRate'] == null ? -1 : data['heartRate'];
|
||||
snores =
|
||||
data['snores'] == null || data['snores'] == "" ? "否".tr : "是".tr;
|
||||
}
|
||||
|
||||
if (mounted) {
|
||||
setState(() {
|
||||
onlineState = "在线".tr; // 接收到数据,设置为在线
|
||||
});
|
||||
}
|
||||
_startOnlineTimer(); // 重置定时器
|
||||
};
|
||||
} catch (e) {
|
||||
print(e);
|
||||
edm.EasyDartModule.logger
|
||||
.error("[webscoekt]格式化数据错误-->${{"mac": widget.personInfo['mac']}}");
|
||||
}
|
||||
|
||||
return LayoutBuilder(
|
||||
builder: (context, bodySize) => GestureDetector(
|
||||
@@ -215,20 +235,6 @@ class _InstantBodyPageState extends State<InstantBodyPage>
|
||||
top: true,
|
||||
child: Stack(
|
||||
children: [
|
||||
// 背景图只占一半高度
|
||||
// Align(
|
||||
// alignment: Alignment.center,
|
||||
// child: SizedBox(
|
||||
// height: 1000.rpx, // 你可以根据需要调整图片最大高度
|
||||
// width: 1000.rpx, // 或设置 double.infinity 占满宽度
|
||||
// child: Image.asset(
|
||||
// (onlineState == "离线".tr || inBed == '离床'.tr)
|
||||
// ? 'assets/img/black_body_still.png'
|
||||
// : 'assets/img/body_black.gif',
|
||||
// fit: BoxFit.contain, // 保持原始比例,不拉伸
|
||||
// ),
|
||||
// ),
|
||||
// ),
|
||||
Align(
|
||||
alignment: Alignment.center,
|
||||
child: FractionallySizedBox(
|
||||
@@ -435,16 +441,6 @@ class _InstantBodyPageState extends State<InstantBodyPage>
|
||||
padding: EdgeInsetsDirectional.fromSTEB(
|
||||
30.rpx, 0, 30.rpx, 0),
|
||||
child: Container(
|
||||
// decoration: BoxDecoration(
|
||||
// image: DecorationImage(
|
||||
// image: AssetImage(
|
||||
// onlineState == "离线".tr
|
||||
// ? 'assets/img/black_body_still.png' // 静态图
|
||||
// : 'assets/img/body_black.gif', // 动图
|
||||
// ),
|
||||
// fit: BoxFit.cover,
|
||||
// ),
|
||||
// ),
|
||||
child: Column(
|
||||
children: [
|
||||
Row(
|
||||
|
||||
@@ -8,6 +8,7 @@ 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/DailyLogUtils.dart';
|
||||
import 'package:vbvs_app/common/util/FitTool.dart';
|
||||
import 'package:vbvs_app/common/util/MyUtils.dart';
|
||||
import 'package:vbvs_app/common/util/requestWithLog.dart';
|
||||
@@ -23,6 +24,7 @@ import 'package:vbvs_app/controller/user_info_controller.dart';
|
||||
import 'package:vbvs_app/model/BleDeviceData.dart';
|
||||
import 'package:vbvs_app/pages/device_bind/blueteeth_device_page.dart';
|
||||
import 'package:vbvs_app/pages/device_bind/componnet/bind_dialog.dart';
|
||||
import 'package:EasyDartModule/EasyDartModule.dart' as edm;
|
||||
|
||||
class AfterWifiPagePerson extends StatefulWidget {
|
||||
var type;
|
||||
@@ -118,24 +120,24 @@ class _AfterWifiPagePersonState extends State<AfterWifiPagePerson> {
|
||||
return SizedBox(
|
||||
width: 24.rpx,
|
||||
height: 24.rpx,
|
||||
child:CircularProgressIndicator(
|
||||
strokeWidth: 2,
|
||||
valueColor: AlwaysStoppedAnimation<Color>(
|
||||
themeController.currentColor.sc1,
|
||||
),
|
||||
),
|
||||
child: CircularProgressIndicator(
|
||||
strokeWidth: 2,
|
||||
valueColor: AlwaysStoppedAnimation<Color>(
|
||||
themeController.currentColor.sc1,
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
if (blueteethBindController.netType.value == 0) {
|
||||
return SizedBox(
|
||||
width: 24.rpx,
|
||||
height: 24.rpx,
|
||||
child:CircularProgressIndicator(
|
||||
strokeWidth: 2,
|
||||
valueColor: AlwaysStoppedAnimation<Color>(
|
||||
themeController.currentColor.sc1,
|
||||
),
|
||||
),
|
||||
child: CircularProgressIndicator(
|
||||
strokeWidth: 2,
|
||||
valueColor: AlwaysStoppedAnimation<Color>(
|
||||
themeController.currentColor.sc1,
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
if (blueteethBindController.wifiConnectStatus.value ==
|
||||
@@ -143,12 +145,12 @@ class _AfterWifiPagePersonState extends State<AfterWifiPagePerson> {
|
||||
return SizedBox(
|
||||
width: 24.rpx,
|
||||
height: 24.rpx,
|
||||
child:CircularProgressIndicator(
|
||||
strokeWidth: 2,
|
||||
valueColor: AlwaysStoppedAnimation<Color>(
|
||||
themeController.currentColor.sc1,
|
||||
),
|
||||
),
|
||||
child: CircularProgressIndicator(
|
||||
strokeWidth: 2,
|
||||
valueColor: AlwaysStoppedAnimation<Color>(
|
||||
themeController.currentColor.sc1,
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
return Container();
|
||||
@@ -638,12 +640,16 @@ class _AfterWifiPagePersonState extends State<AfterWifiPagePerson> {
|
||||
width: 32.rpx,
|
||||
height: 32.rpx,
|
||||
child:
|
||||
CircularProgressIndicator(
|
||||
strokeWidth: 2,
|
||||
valueColor: AlwaysStoppedAnimation<Color>(
|
||||
themeController.currentColor.sc1,
|
||||
),
|
||||
),
|
||||
CircularProgressIndicator(
|
||||
strokeWidth: 2,
|
||||
valueColor:
|
||||
AlwaysStoppedAnimation<
|
||||
Color>(
|
||||
themeController
|
||||
.currentColor
|
||||
.sc1,
|
||||
),
|
||||
),
|
||||
)
|
||||
else
|
||||
getWifiIconByRsso(
|
||||
@@ -835,6 +841,8 @@ class _AfterWifiPagePersonState extends State<AfterWifiPagePerson> {
|
||||
if (onData.status == BleEventType.recvLineLog) {
|
||||
final line = onData.val;
|
||||
print("[bleee]:" + line);
|
||||
edm.EasyDartModule.logger.info("[bleee]:" + line);
|
||||
DailyLogUtils.writeLog("[bleee]:" + line);
|
||||
}
|
||||
});
|
||||
}
|
||||
@@ -980,6 +988,8 @@ class _AfterWifiPagePersonState extends State<AfterWifiPagePerson> {
|
||||
if (onData.status == BleEventType.recvLineLog) {
|
||||
final line = onData.val;
|
||||
print("[bleee]:" + line);
|
||||
edm.EasyDartModule.logger.info("[bleee]:" + line);
|
||||
DailyLogUtils.writeLog("[bleee]:" + line);
|
||||
}
|
||||
if (onData.status == BleEventType.ready) {
|
||||
aa = await getDeviceNetVersion(
|
||||
|
||||
@@ -172,24 +172,29 @@ class _BlueteethDevicePageState extends State<BlueteethDevicePage> {
|
||||
}
|
||||
|
||||
// 显示权限被拒绝的提示
|
||||
// void _showPermissionDeniedDialog(BuildContext context) {
|
||||
// showDialog(
|
||||
// context: context,
|
||||
// builder: (BuildContext context) {
|
||||
// return AlertDialog(
|
||||
// title: Text("权限提示".tr),
|
||||
// content: Text("应用需要蓝牙和位置权限才能扫描设备。请授予权限。".tr),
|
||||
// actions: [
|
||||
// TextButton(
|
||||
// onPressed: () {
|
||||
// Navigator.of(context).pop();
|
||||
// },
|
||||
// child: Text("确定".tr),
|
||||
// ),
|
||||
// ],
|
||||
// );
|
||||
// },
|
||||
// );
|
||||
// }
|
||||
void _showPermissionDeniedDialog(BuildContext context) {
|
||||
showDialog(
|
||||
context: context,
|
||||
builder: (BuildContext context) {
|
||||
return AlertDialog(
|
||||
title: Text("权限提示".tr),
|
||||
content: Text("应用需要蓝牙和位置权限才能扫描设备。请授予权限。".tr),
|
||||
actions: [
|
||||
TextButton(
|
||||
onPressed: () {
|
||||
Navigator.of(context).pop();
|
||||
},
|
||||
child: Text("确定".tr),
|
||||
),
|
||||
],
|
||||
);
|
||||
},
|
||||
);
|
||||
TopSlideNotification.show(context,
|
||||
text: "应用需要蓝牙和位置权限才能扫描设备。请授予权限。".tr,
|
||||
textColor: themeController.currentColor.sc9);
|
||||
}
|
||||
|
||||
// 开始扫描蓝牙设备
|
||||
|
||||
@@ -8,6 +8,7 @@ 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/DailyLogUtils.dart';
|
||||
import 'package:vbvs_app/common/util/FitTool.dart';
|
||||
import 'package:vbvs_app/common/util/MyUtils.dart';
|
||||
import 'package:vbvs_app/common/util/requestWithLog.dart';
|
||||
@@ -23,6 +24,7 @@ import 'package:vbvs_app/controller/user_info_controller.dart';
|
||||
import 'package:vbvs_app/model/BleDeviceData.dart';
|
||||
import 'package:vbvs_app/pages/device_bind/blueteeth_device_page.dart';
|
||||
import 'package:vbvs_app/pages/device_bind/componnet/bind_dialog.dart';
|
||||
import 'package:EasyDartModule/EasyDartModule.dart' as edm;
|
||||
|
||||
class WifiPage extends StatefulWidget {
|
||||
var type; //为空,首次绑定 不为空,从设备列表进入
|
||||
@@ -64,6 +66,8 @@ class _WifiPageState extends State<WifiPage> {
|
||||
if (onData.status == BleEventType.recvLineLog) {
|
||||
final line = onData.val;
|
||||
print("[bleee]:" + line);
|
||||
edm.EasyDartModule.logger.info("[bleee]:" + line);
|
||||
DailyLogUtils.writeLog("[bleee]:" + line);
|
||||
}
|
||||
if (onData.status == BleEventType.ready) {
|
||||
aa = await getDeviceNetVersion(
|
||||
@@ -880,6 +884,8 @@ class _WifiPageState extends State<WifiPage> {
|
||||
if (onData.status == BleEventType.recvLineLog) {
|
||||
final line = onData.val;
|
||||
print("[bleee]:" + line);
|
||||
edm.EasyDartModule.logger.info("[bleee]:" + line);
|
||||
DailyLogUtils.writeLog("[bleee]:" + line);
|
||||
}
|
||||
// if (onData.status == BleEventType.ready) {
|
||||
// // showLoadingDialog(context, title: "获取wifi列表中...".tr);
|
||||
@@ -965,7 +971,7 @@ class _WifiPageState extends State<WifiPage> {
|
||||
decoration: BoxDecoration(shape: BoxShape.circle),
|
||||
child: Image.asset("assets/img/wifi3.png"),
|
||||
);
|
||||
} else if (rssi >=AppConstants().wifi3) {
|
||||
} else if (rssi >= AppConstants().wifi3) {
|
||||
return Container(
|
||||
width: 40.rpx,
|
||||
height: 40.rpx,
|
||||
|
||||
@@ -8,6 +8,7 @@ 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/DailyLogUtils.dart';
|
||||
import 'package:vbvs_app/common/util/FitTool.dart';
|
||||
import 'package:vbvs_app/common/util/MyUtils.dart';
|
||||
import 'package:vbvs_app/common/util/requestWithLog.dart';
|
||||
@@ -23,6 +24,7 @@ import 'package:vbvs_app/controller/user_info_controller.dart';
|
||||
import 'package:vbvs_app/model/BleDeviceData.dart';
|
||||
import 'package:vbvs_app/pages/device_bind/blueteeth_device_page.dart';
|
||||
import 'package:vbvs_app/pages/device_bind/componnet/bind_dialog.dart';
|
||||
import 'package:EasyDartModule/EasyDartModule.dart' as edm;
|
||||
|
||||
class WifiPagePerson extends StatefulWidget {
|
||||
var type;
|
||||
@@ -835,6 +837,8 @@ class _WifiPagePersonState extends State<WifiPagePerson> {
|
||||
if (onData.status == BleEventType.recvLineLog) {
|
||||
final line = onData.val;
|
||||
print("[bleee]:" + line);
|
||||
edm.EasyDartModule.logger.info("[bleee]:" + line);
|
||||
DailyLogUtils.writeLog("[bleee]:" + line);
|
||||
}
|
||||
});
|
||||
}
|
||||
@@ -980,6 +984,8 @@ class _WifiPagePersonState extends State<WifiPagePerson> {
|
||||
if (onData.status == BleEventType.recvLineLog) {
|
||||
final line = onData.val;
|
||||
print("[bleee]:" + line);
|
||||
edm.EasyDartModule.logger.info("[bleee]:" + line);
|
||||
DailyLogUtils.writeLog("[bleee]:" + line);
|
||||
}
|
||||
if (onData.status == BleEventType.ready) {
|
||||
aa = await getDeviceNetVersion(
|
||||
|
||||
@@ -6,6 +6,7 @@ import 'package:ef/ef.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter/services.dart';
|
||||
import 'package:get_storage/get_storage.dart';
|
||||
import 'package:vbvs_app/common/color/appConstants.dart';
|
||||
import 'package:vbvs_app/common/util/CommonVariables.dart';
|
||||
import 'package:vbvs_app/common/util/MyUtils.dart';
|
||||
import 'package:vbvs_app/component/tool/TopSlideNotification.dart';
|
||||
@@ -13,6 +14,7 @@ import 'package:vbvs_app/controller/mh_controller/mh_language_controller.dart';
|
||||
import 'package:vbvs_app/controller/user_info_controller.dart';
|
||||
import 'package:vbvs_app/model/WebSocketMessage.dart';
|
||||
import 'package:vbvs_app/pages/common/bezier_bottom_navigation_bar.dart';
|
||||
import 'package:vbvs_app/pages/common/selectDialog.dart';
|
||||
import 'package:vbvs_app/pages/mh_page/MattressControl.dart';
|
||||
import 'package:vbvs_app/pages/mh_page/homepage/mht_sleep_report_page.dart';
|
||||
import 'package:vbvs_app/pages/mh_page/homepage/new_Home_page.dart';
|
||||
@@ -124,27 +126,27 @@ class _HomePageState extends State<MainPageBBottomChange>
|
||||
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 Obx(() {
|
||||
final currentLanguage =
|
||||
languageController.selectLanguage.value; // 监听此变量变化
|
||||
|
||||
@@ -383,7 +383,7 @@ class _HomePageState extends State<HomePage> {
|
||||
.currentColor.sc4,
|
||||
),
|
||||
),
|
||||
|
||||
|
||||
].divide(SizedBox(
|
||||
width: 20.rpx,
|
||||
)),
|
||||
|
||||
@@ -81,27 +81,27 @@ class MainPageBottomChange extends GetView<MainPageController> {
|
||||
final getStorage = GetStorage();
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
Future.delayed(const Duration(milliseconds: 0), () {
|
||||
String? isShowYingShiDialog = getStorage.read("isShowYingShiDialog");
|
||||
if (isShowYingShiDialog == null || isShowYingShiDialog != "true") {
|
||||
String btnName = "同意".tr;
|
||||
String cancelName = "取消".tr;
|
||||
if (Platform.isAndroid) {
|
||||
cancelName = "退出".tr;
|
||||
}
|
||||
showCustomConfirmOfWebViewDialog(context, "隐私协议".tr, getPrivacy(1),
|
||||
btnName: btnName, showCancel: true, cancelName: cancelName)
|
||||
.then((e) {
|
||||
if (e == "confirm") {
|
||||
getStorage.write("isShowYingShiDialog", "true");
|
||||
} else {
|
||||
if (cancelName == "退出") {
|
||||
SystemNavigator.pop();
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
// Future.delayed(const Duration(milliseconds: 0), () {
|
||||
// String? isShowYingShiDialog = getStorage.read("isShowYingShiDialog");
|
||||
// if (isShowYingShiDialog == null || isShowYingShiDialog != "true") {
|
||||
// String btnName = "同意".tr;
|
||||
// String cancelName = "取消".tr;
|
||||
// if (Platform.isAndroid) {
|
||||
// cancelName = "退出".tr;
|
||||
// }
|
||||
// showCustomConfirmOfWebViewDialog(context, "隐私协议".tr, getPrivacy(1),
|
||||
// btnName: btnName, showCancel: true, cancelName: cancelName)
|
||||
// .then((e) {
|
||||
// if (e == "confirm") {
|
||||
// getStorage.write("isShowYingShiDialog", "true");
|
||||
// } else {
|
||||
// if (cancelName == "退出") {
|
||||
// SystemNavigator.pop();
|
||||
// }
|
||||
// }
|
||||
// });
|
||||
// }
|
||||
// });
|
||||
|
||||
return PopScope(
|
||||
canPop: false,
|
||||
|
||||
@@ -5,6 +5,7 @@ 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/DailyLogUtils.dart';
|
||||
import 'package:vbvs_app/common/util/FitTool.dart';
|
||||
import 'package:vbvs_app/common/util/MyUtils.dart';
|
||||
import 'package:vbvs_app/common/util/requestWithLog.dart';
|
||||
@@ -610,7 +611,7 @@ class _MinePageState extends State<MinePage> {
|
||||
.currentColor.sc21, // 点击时的背景色
|
||||
padding: EdgeInsetsDirectional.fromSTEB(
|
||||
40.rpx, 0.rpx, 40.rpx, 0.rpx),
|
||||
onTap: () {
|
||||
onTap: () async {
|
||||
UserInfoController userInfoController =
|
||||
Get.find();
|
||||
if (userInfoController.model.login !=
|
||||
@@ -622,7 +623,20 @@ class _MinePageState extends State<MinePage> {
|
||||
themeController.currentColor.sc9,
|
||||
);
|
||||
Get.toNamed("/loginPage");
|
||||
} else {}
|
||||
} else {
|
||||
String logContent =
|
||||
await DailyLogUtils.readLogByDate(
|
||||
DateTime(2025, 9, 4));
|
||||
print(logContent);
|
||||
// DailyLogUtils.readTodayLog();
|
||||
// DailyLogUtils.listLogFiles();
|
||||
await DailyLogUtils.writeLog(
|
||||
"测试日志内容"); // 确保写入日志
|
||||
await DailyLogUtils
|
||||
.exportAllLogs(); // 导出并分享
|
||||
|
||||
// DailyLogUtils.exportAllLogs();
|
||||
}
|
||||
},
|
||||
child: Container(
|
||||
child: Padding(
|
||||
@@ -660,7 +674,7 @@ class _MinePageState extends State<MinePage> {
|
||||
mainAxisSize: MainAxisSize.max,
|
||||
children: [
|
||||
Text(
|
||||
'V1.0.2506.06',
|
||||
'V1.0.2509.04',
|
||||
style: TextStyle(
|
||||
fontFamily: 'Inter',
|
||||
color: Color(0xFFD9E3EB),
|
||||
|
||||
282
lib/pages/mh_page/CommonMessageSettingPage.dart
Normal file
282
lib/pages/mh_page/CommonMessageSettingPage.dart
Normal file
@@ -0,0 +1,282 @@
|
||||
import 'dart:async';
|
||||
|
||||
import 'package:ef/ef.dart';
|
||||
import 'package:flutter/material.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';
|
||||
import 'package:vbvs_app/common/util/requestWithLog.dart';
|
||||
import 'package:vbvs_app/component/base/GradientSwitch.dart';
|
||||
import 'package:vbvs_app/component/tool/TopSlideNotification.dart';
|
||||
import 'package:vbvs_app/controller/message/common_message_setting_controller.dart';
|
||||
import 'package:vbvs_app/controller/theme_controller/ThemeController.dart';
|
||||
import 'package:vbvs_app/pages/mh_page/user/controller/mht_login_controller.dart';
|
||||
|
||||
class MHTCommonMessageSettingPage extends StatefulWidget {
|
||||
MHTCommonMessageSettingPage({super.key});
|
||||
|
||||
@override
|
||||
State<MHTCommonMessageSettingPage> createState() =>
|
||||
_CommonMessageSettingPageState();
|
||||
}
|
||||
|
||||
class _CommonMessageSettingPageState
|
||||
extends State<MHTCommonMessageSettingPage> {
|
||||
final ThemeController themeController = Get.find();
|
||||
CommonMessageSettingController commonMessageSettingController = Get.find();
|
||||
|
||||
@override
|
||||
void initState() {
|
||||
super.initState();
|
||||
commonMessageSettingController.getAppSleepNotify();
|
||||
_fetchDeviceList();
|
||||
}
|
||||
|
||||
Future<void> _fetchDeviceList() async {
|
||||
String serviceAddress = ServiceConstant.service_address;
|
||||
String serviceName = ServiceConstant.server_service;
|
||||
String serviceApi = ServiceConstant.user_setting;
|
||||
String type = "user_message_setting";
|
||||
String queryUrl = "${serviceAddress}${serviceName}${serviceApi}?type=$type";
|
||||
requestWithLog(
|
||||
logTitle: "查询用户消息配置",
|
||||
method: MyHttpMethod.get,
|
||||
queryUrl: queryUrl,
|
||||
onSuccess: (res) {
|
||||
if (res.data == null || res.data.isEmpty) {
|
||||
var data = {
|
||||
"type": type,
|
||||
"setting": 1,
|
||||
"appSetting": 1,
|
||||
"serviceSetting": 1,
|
||||
"tipSetting": 1,
|
||||
"deviceUpgradeSetting": 1,
|
||||
"deviceIssueSetting": 1,
|
||||
};
|
||||
requestWithLog(
|
||||
logTitle: "更新用户消息配置",
|
||||
method: MyHttpMethod.put,
|
||||
queryUrl: queryUrl,
|
||||
data: data,
|
||||
onSuccess: (res) {
|
||||
requestWithLog(
|
||||
logTitle: "查询用户消息配置",
|
||||
method: MyHttpMethod.get,
|
||||
queryUrl: queryUrl,
|
||||
onSuccess: (res) {
|
||||
if (res.data != null && res.data.isNotEmpty) {
|
||||
var datalist = res.data;
|
||||
commonMessageSettingController.model.setting =
|
||||
datalist['setting'];
|
||||
commonMessageSettingController.model.appSetting =
|
||||
datalist['appSetting'];
|
||||
commonMessageSettingController.model.serviceSetting =
|
||||
datalist['serviceSetting'];
|
||||
commonMessageSettingController.model.tipSetting =
|
||||
datalist['tipSetting'];
|
||||
commonMessageSettingController.model.deviceUpgradeSetting =
|
||||
datalist['deviceUpgradeSetting'];
|
||||
commonMessageSettingController.model.deviceIssueSetting =
|
||||
datalist['deviceIssueSetting'];
|
||||
commonMessageSettingController.updateAll();
|
||||
}
|
||||
},
|
||||
);
|
||||
|
||||
//
|
||||
},
|
||||
);
|
||||
} else {
|
||||
var datalist = res.data;
|
||||
commonMessageSettingController.model.setting = datalist['setting'];
|
||||
commonMessageSettingController.model.appSetting =
|
||||
datalist['appSetting'];
|
||||
commonMessageSettingController.model.serviceSetting =
|
||||
datalist['serviceSetting'];
|
||||
commonMessageSettingController.model.tipSetting =
|
||||
datalist['tipSetting'];
|
||||
commonMessageSettingController.model.deviceUpgradeSetting =
|
||||
datalist['deviceUpgradeSetting'];
|
||||
commonMessageSettingController.model.deviceIssueSetting =
|
||||
datalist['deviceIssueSetting'];
|
||||
commonMessageSettingController.updateAll();
|
||||
}
|
||||
},
|
||||
onFailure: (res) {
|
||||
print(res);
|
||||
},
|
||||
);
|
||||
}
|
||||
|
||||
@override
|
||||
void dispose() {
|
||||
super.dispose();
|
||||
}
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return LayoutBuilder(
|
||||
builder: (context, bodysize) => GestureDetector(
|
||||
// onTap: () => FocusScope.of(context).unfocus(),,
|
||||
child: Container(
|
||||
decoration: BoxDecoration(
|
||||
image: DecorationImage(
|
||||
image: AssetImage('assets/images/new_background.png'), // 本地图片
|
||||
fit: BoxFit.fill,
|
||||
),
|
||||
),
|
||||
child: Scaffold(
|
||||
backgroundColor: Colors.transparent,
|
||||
appBar: AppBar(
|
||||
backgroundColor: Colors.transparent,
|
||||
automaticallyImplyLeading: false,
|
||||
iconTheme: IconThemeData(
|
||||
color: themeController.currentColor.sc3,
|
||||
),
|
||||
titleSpacing: 0,
|
||||
title: Container(
|
||||
width: double.infinity,
|
||||
height: 180.rpx,
|
||||
child: Stack(
|
||||
alignment: Alignment.center,
|
||||
children: [
|
||||
/// 居中标题
|
||||
Text(
|
||||
'消息通知'.tr,
|
||||
style: TextStyle(
|
||||
fontFamily: 'ReadexPro',
|
||||
color: themeController.currentColor.sc3,
|
||||
letterSpacing: 0,
|
||||
fontSize: 30.rpx,
|
||||
),
|
||||
),
|
||||
Positioned(
|
||||
left: 0,
|
||||
child: returnIconButtomAddCallback(() {}),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
actions: [],
|
||||
centerTitle: false,
|
||||
),
|
||||
body: GestureDetector(
|
||||
child: SafeArea(
|
||||
top: true,
|
||||
child: Padding(
|
||||
padding: EdgeInsetsDirectional.fromSTEB(0.rpx, 0, 0.rpx, 0),
|
||||
child: SingleChildScrollView(
|
||||
child: Column(
|
||||
mainAxisSize: MainAxisSize.min,
|
||||
children: [
|
||||
Padding(
|
||||
padding:
|
||||
EdgeInsetsDirectional.fromSTEB(0, 30.rpx, 0, 0),
|
||||
child: Container(
|
||||
width: double.infinity,
|
||||
constraints: BoxConstraints(
|
||||
minHeight: 90.rpx,
|
||||
),
|
||||
decoration: BoxDecoration(
|
||||
color: themeController.currentColor.sc5),
|
||||
child: Padding(
|
||||
padding: EdgeInsetsDirectional.fromSTEB(
|
||||
30.rpx, 15.rpx, 30.rpx, 15.rpx),
|
||||
child: Row(
|
||||
mainAxisSize: MainAxisSize.max,
|
||||
mainAxisAlignment:
|
||||
MainAxisAlignment.spaceBetween,
|
||||
children: [
|
||||
Expanded(
|
||||
child: Text(
|
||||
"睡眠报告通知".tr,
|
||||
style: TextStyle(
|
||||
color:
|
||||
themeController.currentColor.sc3,
|
||||
fontSize: AppConstants()
|
||||
.title_text_fontSize),
|
||||
),
|
||||
),
|
||||
Obx(() {
|
||||
return GradientSwitch(
|
||||
value: commonMessageSettingController
|
||||
.model.sleepReportSetting ==
|
||||
1
|
||||
? true
|
||||
: false,
|
||||
onChanged: (val) async {
|
||||
// String serviceAddress =
|
||||
// ServiceConstant.service_address;
|
||||
// String serviceName =
|
||||
// ServiceConstant.server_service;
|
||||
// String serviceApi = ServiceConstant
|
||||
// .app_system_push_message;
|
||||
// String queryUrl =
|
||||
// "${serviceAddress}${serviceName}${serviceApi}";
|
||||
// var data = {
|
||||
// "type": type,
|
||||
// "setting": val == true ? 1 : 0,
|
||||
// "appSetting":
|
||||
// commonMessageSettingController
|
||||
// .model.appSetting,
|
||||
// "serviceSetting":
|
||||
// commonMessageSettingController
|
||||
// .model.serviceSetting,
|
||||
// "tipSetting":
|
||||
// commonMessageSettingController
|
||||
// .model.tipSetting,
|
||||
// "deviceUpgradeSetting":
|
||||
// commonMessageSettingController
|
||||
// .model.deviceUpgradeSetting,
|
||||
// "deviceIssueSetting":
|
||||
// commonMessageSettingController
|
||||
// .model.deviceIssueSetting,
|
||||
// };
|
||||
// requestWithLog(
|
||||
// logTitle: "更新消息推送状态",
|
||||
// method: MyHttpMethod.put,
|
||||
// queryUrl: queryUrl,
|
||||
// data: data,
|
||||
// onSuccess: (res) {
|
||||
// _fetchDeviceList();
|
||||
// commonMessageSettingController
|
||||
// .updateAll();
|
||||
// });
|
||||
await commonMessageSettingController
|
||||
.updateSleepNotify(val);
|
||||
await commonMessageSettingController
|
||||
.getAppSleepNotify();
|
||||
commonMessageSettingController
|
||||
.updateAll();
|
||||
},
|
||||
activeGradient: LinearGradient(
|
||||
colors: [
|
||||
themeController.currentColor.sc1,
|
||||
themeController.currentColor.sc2
|
||||
],
|
||||
),
|
||||
activeThumbColor: Colors.white,
|
||||
inactiveThumbColor:
|
||||
stringToColor("#A2A4A9"),
|
||||
inactiveColor: stringToColor("#161B28"),
|
||||
);
|
||||
}),
|
||||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
@@ -25,6 +25,7 @@ import 'package:vbvs_app/model/BleDeviceData.dart';
|
||||
import 'package:vbvs_app/pages/device_bind/blueteeth_device_page.dart';
|
||||
import 'package:vbvs_app/pages/mh_page/component/mht_bind_dialog.dart';
|
||||
import 'package:vbvs_app/pages/mh_page/device/model/BlueToothDataModel.dart';
|
||||
import 'package:EasyDartModule/EasyDartModule.dart' as edm;
|
||||
|
||||
class MHTWifiPage extends StatefulWidget {
|
||||
BlueToothDataModel deviceInfo;
|
||||
@@ -648,7 +649,7 @@ class _MHTWifiPageState extends State<MHTWifiPage> {
|
||||
valueColor:
|
||||
AlwaysStoppedAnimation<
|
||||
Color>(
|
||||
Colors.white,
|
||||
Colors.white,
|
||||
),
|
||||
),
|
||||
)
|
||||
@@ -847,6 +848,8 @@ class _MHTWifiPageState extends State<MHTWifiPage> {
|
||||
if (onData.status == BleEventType.recvLineLog) {
|
||||
final line = onData.val;
|
||||
print("[bleee]:" + line);
|
||||
edm.EasyDartModule.logger.info("[bleee]:" + line);
|
||||
DailyLogUtils.writeLog("[bleee]:" + line);
|
||||
}
|
||||
});
|
||||
}
|
||||
@@ -982,6 +985,8 @@ class _MHTWifiPageState extends State<MHTWifiPage> {
|
||||
if (onData.status == BleEventType.recvLineLog) {
|
||||
final line = onData.val;
|
||||
print("[bleee]:" + line);
|
||||
edm.EasyDartModule.logger.info("[bleee]:" + line);
|
||||
DailyLogUtils.writeLog("[bleee]:" + line);
|
||||
}
|
||||
if (onData.status == BleEventType.ready) {
|
||||
var aa = await getDeviceNetVersion(
|
||||
|
||||
@@ -23,6 +23,7 @@ import 'package:vbvs_app/controller/user_info_controller.dart';
|
||||
import 'package:vbvs_app/model/BleDeviceData.dart';
|
||||
import 'package:vbvs_app/pages/device_bind/blueteeth_device_page.dart';
|
||||
import 'package:vbvs_app/pages/mh_page/component/mht_bind_dialog.dart';
|
||||
import 'package:EasyDartModule/EasyDartModule.dart' as edm;
|
||||
|
||||
class MHTWifiAfterPage extends StatefulWidget {
|
||||
var deviceInfo;
|
||||
@@ -823,6 +824,8 @@ class _MHTWifiAfterPageState extends State<MHTWifiAfterPage> {
|
||||
if (onData.status == BleEventType.recvLineLog) {
|
||||
final line = onData.val;
|
||||
print("[bleee]:" + line);
|
||||
edm.EasyDartModule.logger.info("[bleee]:" + line);
|
||||
DailyLogUtils.writeLog("[bleee]:" + line);
|
||||
}
|
||||
});
|
||||
}
|
||||
@@ -917,8 +920,6 @@ class _MHTWifiAfterPageState extends State<MHTWifiAfterPage> {
|
||||
_scanSubscription = FlutterBluePlus.scanResults.listen((results) async {
|
||||
if (_isDisposed) return;
|
||||
|
||||
|
||||
|
||||
for (var r in results) {
|
||||
if (r.advertisementData.manufacturerData.containsKey(0xFFED)) {
|
||||
List<int> rawData = r.advertisementData.manufacturerData[0xFFED]!;
|
||||
@@ -958,6 +959,8 @@ class _MHTWifiAfterPageState extends State<MHTWifiAfterPage> {
|
||||
if (onData.status == BleEventType.recvLineLog) {
|
||||
final line = onData.val;
|
||||
print("[bleee]:" + line);
|
||||
edm.EasyDartModule.logger.info("[bleee]:" + line);
|
||||
DailyLogUtils.writeLog("[bleee]:" + line);
|
||||
}
|
||||
if (onData.status == BleEventType.ready) {
|
||||
var aa = await getDeviceNetVersion(
|
||||
|
||||
@@ -12,6 +12,7 @@ import 'package:vbvs_app/common/util/MyUtils.dart';
|
||||
import 'package:vbvs_app/common/util/requestWithLog.dart';
|
||||
import 'package:vbvs_app/component/tool/TopSlideNotification.dart';
|
||||
import 'package:vbvs_app/model/api_response.dart';
|
||||
import 'package:vbvs_app/pages/main_bottom/component/main_page_b_bottom_change.dart';
|
||||
|
||||
part 'mht_home_controller.g.dart'; // 由json_serializable自动生成的部分
|
||||
|
||||
@@ -59,6 +60,15 @@ class MHTHomeController extends GetControllerEx<MHTHomeModel> {
|
||||
|
||||
bool initDeviceFlag = false;
|
||||
|
||||
RxMap selectedReportData = {}.obs;
|
||||
RxInt refreshReportTrigger = 0.obs;
|
||||
|
||||
void openReport(Map<String, dynamic> data) {
|
||||
selectedReportData.value = data;
|
||||
refreshReportTrigger.value++; // 每次+1,触发监听
|
||||
MainPageBBottomChange.jumpTo(1); // 切到报告页
|
||||
}
|
||||
|
||||
Future<ApiResponse> getDeviceNum() async {
|
||||
try {
|
||||
ApiResponse apiResponse = ApiResponse(code: -1, msg: "设备列表请求失败".tr);
|
||||
|
||||
@@ -8,13 +8,12 @@ import 'package:flutterflow_ui/flutterflow_ui.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';
|
||||
import 'package:vbvs_app/common/util/JPushUtil.dart';
|
||||
import 'package:vbvs_app/common/util/MyUtils.dart';
|
||||
import 'package:vbvs_app/component/NullDataComponentWidget.dart';
|
||||
import 'package:vbvs_app/component/tool/ClickableContainer.dart';
|
||||
import 'package:vbvs_app/controller/user_info_controller.dart';
|
||||
import 'package:vbvs_app/controller/weather/weather_controller.dart';
|
||||
import 'package:vbvs_app/enum/APPPackageType.dart';
|
||||
import 'package:vbvs_app/pages/mh_page/FloatingSvgIcon.dart';
|
||||
import 'package:vbvs_app/pages/mh_page/component/mht_bind_dialog.dart';
|
||||
import 'package:vbvs_app/pages/mh_page/homepage/component/HomeDeviceWidget.dart';
|
||||
import 'package:vbvs_app/pages/mh_page/homepage/controller/mht_home_controller.dart';
|
||||
@@ -75,6 +74,9 @@ class _NewHomePageState extends State<NewHomePage> {
|
||||
homeController.homeSleepDays.value.length - 1;
|
||||
}
|
||||
});
|
||||
WidgetsBinding.instance.addPostFrameCallback((_) {
|
||||
_onReady();
|
||||
});
|
||||
try {
|
||||
_newVersionSubscription =
|
||||
ef.kvRoot.appmanger.onAppUpdate.listen((MiniAppPkg pkg) {
|
||||
@@ -573,7 +575,19 @@ class _NewHomePageState extends State<NewHomePage> {
|
||||
'reportPadding': false,
|
||||
},
|
||||
);
|
||||
}
|
||||
// 保存当前选中的mac到全局状态
|
||||
// homeController.selectDevcie
|
||||
// .value =
|
||||
// formFieldController
|
||||
// .value!;
|
||||
// homeController.selectPerson
|
||||
// .value =
|
||||
// personInfo.value;
|
||||
|
||||
// // 使用底部tab跳转到第二个页面
|
||||
// MainPageBBottomChange
|
||||
// .jumpTo(1);
|
||||
}
|
||||
},
|
||||
child: Row(
|
||||
mainAxisSize:
|
||||
@@ -983,6 +997,23 @@ class _NewHomePageState extends State<NewHomePage> {
|
||||
if (value is String) return int.tryParse(value);
|
||||
return null;
|
||||
}
|
||||
|
||||
void _onReady() {
|
||||
// 页面渲染完成后执行的逻辑,比如处理通知跳转
|
||||
_handlePendingRoute();
|
||||
}
|
||||
|
||||
void _handlePendingRoute() {
|
||||
var pending = JPushUtil.box.read("pendingRoute");
|
||||
if (pending != null) {
|
||||
String route = pending["route"];
|
||||
var args = pending["arguments"];
|
||||
Future.delayed(const Duration(milliseconds: 300), () {
|
||||
Get.toNamed(route, arguments: args);
|
||||
});
|
||||
JPushUtil.box.remove("pendingRoute");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
class ScoreItem {
|
||||
|
||||
@@ -156,6 +156,67 @@ class _SettingPageState extends State<SettingPage> {
|
||||
),
|
||||
),
|
||||
),
|
||||
ClickableContainer(
|
||||
backgroundColor:
|
||||
Colors.transparent, // 容器背景色
|
||||
highlightColor: themeController
|
||||
.currentColor.sc21, // 点击时的背景色
|
||||
padding: EdgeInsetsDirectional.fromSTEB(
|
||||
40.rpx, 0.rpx, 40.rpx, 0.rpx),
|
||||
onTap: () {
|
||||
Get.toNamed("/commonMessageSettingPage");
|
||||
},
|
||||
child: Container(
|
||||
child: Padding(
|
||||
padding: EdgeInsetsDirectional.fromSTEB(
|
||||
0.rpx, 30.rpx, 0.rpx, 30.rpx),
|
||||
child: Row(
|
||||
mainAxisSize: MainAxisSize.max,
|
||||
mainAxisAlignment:
|
||||
MainAxisAlignment.spaceBetween,
|
||||
children: [
|
||||
Row(
|
||||
mainAxisSize: MainAxisSize.max,
|
||||
children: [
|
||||
Text('通知设置'.tr,
|
||||
style: TextStyle(
|
||||
fontSize: 30.rpx,
|
||||
color: Colors.white,
|
||||
height: 1)),
|
||||
].divide(SizedBox(width: 22.rpx)),
|
||||
),
|
||||
SvgPicture.asset(
|
||||
'assets/img/icon/arrow_right.svg',
|
||||
width: 8.rpx,
|
||||
height: 15
|
||||
.rpx, // 如果 SVG 中没有固定颜色,可以这样设置
|
||||
color: themeController
|
||||
.currentColor.sc3,
|
||||
),
|
||||
// Row(
|
||||
// mainAxisSize: MainAxisSize.max,
|
||||
// children: [
|
||||
// Text(
|
||||
// '深色',
|
||||
// style: FlutterFlowTheme.of(
|
||||
// context)
|
||||
// .bodyMedium
|
||||
// .override(
|
||||
// fontFamily: 'Inter',
|
||||
// color:
|
||||
// Color(0xFFD9E3EB),
|
||||
// fontSize: 26.rpx,
|
||||
// letterSpacing: 0.0,
|
||||
// ),
|
||||
// ),
|
||||
|
||||
// ].divide(SizedBox(width: 28.rpx)),
|
||||
// ),
|
||||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
ClickableContainer(
|
||||
backgroundColor:
|
||||
Colors.transparent, // 容器背景色
|
||||
|
||||
@@ -45,8 +45,8 @@ class WebviewTestController extends GetControllerEx<WebviewTestModel> {
|
||||
isheadless: false,
|
||||
jsbridge: buildsdk(
|
||||
// father: this,
|
||||
// clientId: '123',
|
||||
// clientId: '494641114',
|
||||
// clientId: '123',
|
||||
// dbgserverUrl: 'ws://192.168.1.2:9001',
|
||||
),
|
||||
settings: buildsettings(),
|
||||
@@ -69,9 +69,7 @@ class WebviewTestController extends GetControllerEx<WebviewTestModel> {
|
||||
bridge: bridge,
|
||||
onConnect: (args1, args2) {
|
||||
final devices = args1.devices as Map<String, dynamic>;
|
||||
final mac = args2 as String;
|
||||
|
||||
// Android: key 就是 mac,直接找
|
||||
final mac = args2 as String;
|
||||
if (devices.containsKey(mac)) {
|
||||
final device = devices[mac];
|
||||
ef.log('Minibleapp connected(Android): $mac -> $device');
|
||||
|
||||
@@ -141,7 +141,7 @@ class MHTLoginController extends GetControllerEx<LoginModel> {
|
||||
"type": type,
|
||||
"userName": account,
|
||||
"password": password,
|
||||
'khCode':'mht',
|
||||
'khCode': 'mht',
|
||||
};
|
||||
String serviceAddress = ServiceConstant.service_address;
|
||||
String serviceName = ServiceConstant.server_service;
|
||||
@@ -164,6 +164,8 @@ class MHTLoginController extends GetControllerEx<LoginModel> {
|
||||
final box = GetStorage();
|
||||
box.write('token', token); // 存储 token
|
||||
box.write('user', userInfoController.model.user!.toJson()); // 存储用户信息
|
||||
//todo 更新消息通知
|
||||
updateAppSystemNotify(true);
|
||||
},
|
||||
onFailure: (res) {
|
||||
message = res.msg!;
|
||||
@@ -341,3 +343,26 @@ class MHTLoginController extends GetControllerEx<LoginModel> {
|
||||
corpId: CommonVariables.wxCorpId, url: CommonVariables.wxKfUrl));
|
||||
}
|
||||
}
|
||||
|
||||
Future<void> updateAppSystemNotify(bool status) async {
|
||||
final box = GetStorage();
|
||||
var data = {
|
||||
"pid": box.read("rid"),
|
||||
"status": status,
|
||||
};
|
||||
String serviceAddress = ServiceConstant.service_address;
|
||||
String serviceName = ServiceConstant.server_service;
|
||||
String serviceApi = ServiceConstant.app_system_push_message;
|
||||
String queryUrl = "${serviceAddress}${serviceName}${serviceApi}";
|
||||
await requestWithLog(
|
||||
logTitle: "激活消息通知",
|
||||
method: MyHttpMethod.put,
|
||||
queryUrl: queryUrl,
|
||||
data: data,
|
||||
onSuccess: (res) {
|
||||
print(res);
|
||||
},
|
||||
onFailure: (res) {
|
||||
print(res);
|
||||
});
|
||||
}
|
||||
|
||||
@@ -8,12 +8,14 @@ import 'package:vbvs_app/common/color/appFontsize.dart';
|
||||
import 'package:vbvs_app/common/util/CheckNetwork.dart';
|
||||
import 'package:vbvs_app/common/util/CommonVariables.dart';
|
||||
import 'package:vbvs_app/common/util/FitTool.dart';
|
||||
import 'package:vbvs_app/common/util/JPushUtil.dart';
|
||||
import 'package:vbvs_app/common/util/MyUtils.dart';
|
||||
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/time/countdown_controller.dart';
|
||||
import 'package:vbvs_app/controller/user_info_controller.dart';
|
||||
import 'package:vbvs_app/enum/APPPackageType.dart';
|
||||
import 'package:vbvs_app/pages/mh_page/user/controller/mht_login_controller.dart';
|
||||
import 'package:vbvs_app/pages/mh_page/user/controller/mht_register_controller.dart';
|
||||
|
||||
@@ -95,6 +97,9 @@ class MHTLoginPage extends GetView<MHTLoginController> {
|
||||
controller.fluwxCancelable?.cancel();
|
||||
// 登录成功移出网络检查监听
|
||||
Checknetwork.subscription?.cancel();
|
||||
if (AppConstants().ent_type == APPPackageType.MHT.code) {
|
||||
await JPushUtil.initJPush();
|
||||
}
|
||||
Get.offAndToNamed("/mianPageBottomChange");
|
||||
}
|
||||
// TODO 操作全部跳转页面前成功以后移除监听,防止重复监听,其他方式登录成功也需要移出监听
|
||||
@@ -1261,10 +1266,39 @@ class MHTLoginPage extends GetView<MHTLoginController> {
|
||||
registerController = Get.find();
|
||||
registerController
|
||||
.model.register_agree = false;
|
||||
if (AppConstants().ent_type ==
|
||||
APPPackageType.MHT.code) {
|
||||
await JPushUtil.initJPush();
|
||||
}
|
||||
Get.offAndToNamed(
|
||||
"/mianPageBottomChange");
|
||||
//登陆成功
|
||||
//
|
||||
// box.write(
|
||||
// "needSleepReport", "true");
|
||||
// if (box.read("needSleepReport") !=
|
||||
// null &&
|
||||
// box.read("needSleepReport") ==
|
||||
// "true") {
|
||||
// box.remove("needSleepReport");
|
||||
// await box.save();
|
||||
// var person = box.read(
|
||||
// "needSleepReport_person");
|
||||
// var mac = box
|
||||
// .read("needSleepReport_mac");
|
||||
// Get.toNamed(
|
||||
// "/newSleepReportPage",
|
||||
// arguments: {
|
||||
// 'mac': mac,
|
||||
// 'type': 1,
|
||||
// "person": person,
|
||||
// 'backgroundImg':
|
||||
// 'assets/images/new_background.png',
|
||||
// 'date': DateTime.now()
|
||||
// .millisecondsSinceEpoch,
|
||||
// 'person_show': false,
|
||||
// 'reportPadding': false,
|
||||
// },
|
||||
// );
|
||||
// }
|
||||
}
|
||||
},
|
||||
colors: [
|
||||
|
||||
@@ -141,7 +141,7 @@ class _CommonMessageSettingPageState extends State<CommonMessageSettingPage> {
|
||||
children: [
|
||||
/// 居中标题
|
||||
Text(
|
||||
'消息通知'.tr,
|
||||
'通知设置'.tr,
|
||||
style: TextStyle(
|
||||
fontFamily: 'ReadexPro',
|
||||
color: themeController.currentColor.sc3,
|
||||
|
||||
Reference in New Issue
Block a user