更新安卓通知栏提示
This commit is contained in:
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: [
|
||||
|
||||
Reference in New Issue
Block a user