更新版本迭代重新登录
This commit is contained in:
@@ -599,7 +599,7 @@ class _MHTPeopleInfoPageState extends State<MHTPeopleInfoPage> {
|
||||
MainAxisAlignment.spaceBetween,
|
||||
children: [
|
||||
Text(
|
||||
'联系人',
|
||||
'联系方式'.tr,
|
||||
style: TextStyle(
|
||||
fontFamily: 'Readex Pro',
|
||||
color: Color(0xFF9EA4B7),
|
||||
@@ -622,7 +622,7 @@ class _MHTPeopleInfoPageState extends State<MHTPeopleInfoPage> {
|
||||
decoration: InputDecoration(
|
||||
fillColor: Colors.transparent,
|
||||
filled: true,
|
||||
hintText: "请输入联系人",
|
||||
hintText: "请输入联系方式",
|
||||
hintStyle: TextStyle(
|
||||
color: Colors.white),
|
||||
border: InputBorder.none,
|
||||
|
||||
@@ -2,6 +2,7 @@ import 'dart:convert';
|
||||
|
||||
import 'package:EasyDartModule/EasyDartModule.dart';
|
||||
import 'package:ef/ef.dart';
|
||||
import 'package:flutter/src/widgets/framework.dart';
|
||||
import 'package:flutterflow_ui/flutterflow_ui.dart';
|
||||
import 'package:json_annotation/json_annotation.dart';
|
||||
import 'package:vbvs_app/common/color/ServiceConstant.dart';
|
||||
@@ -9,6 +10,7 @@ import 'package:vbvs_app/common/color/app_uri_status.dart';
|
||||
import 'package:vbvs_app/common/util/DailyLogUtils.dart';
|
||||
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';
|
||||
|
||||
part 'mht_home_controller.g.dart'; // 由json_serializable自动生成的部分
|
||||
@@ -480,7 +482,7 @@ class MHTHomeController extends GetControllerEx<MHTHomeModel> {
|
||||
);
|
||||
}
|
||||
|
||||
Future<void> getHomeSleeps(String? mac) async {
|
||||
Future<void> getHomeSleeps(String? mac, BuildContext context) async {
|
||||
String serviceAddress = ServiceConstant.service_address;
|
||||
String serviceName = ServiceConstant.server_service;
|
||||
String serviceApi = ServiceConstant.sleep_report;
|
||||
@@ -544,6 +546,8 @@ class MHTHomeController extends GetControllerEx<MHTHomeModel> {
|
||||
},
|
||||
onFailure: (res) {
|
||||
EasyDartModule.logger.warning("请求睡眠信息列表失败: ${res.msg}");
|
||||
TopSlideNotification.show(context,
|
||||
text: "请求失败".tr, textColor: themeController.currentColor.sc9);
|
||||
},
|
||||
);
|
||||
}
|
||||
|
||||
@@ -308,55 +308,108 @@ class _NewHomePageState extends State<NewHomePage> {
|
||||
Obx(() {
|
||||
if (userInfoController.model.login! == null ||
|
||||
userInfoController.model.login! == 0) {
|
||||
// return Padding(
|
||||
// padding: EdgeInsetsDirectional.fromSTEB(
|
||||
// 30.rpx, 0, 30.rpx, 80.rpx),
|
||||
// child: ClickableContainer(
|
||||
// backgroundColor: Colors.transparent,
|
||||
// highlightColor: Colors.transparent,
|
||||
// padding: EdgeInsets.all(0),
|
||||
// onTap: () {
|
||||
// if (userInfoController.model.login == null ||
|
||||
// userInfoController.model.login == 0) {
|
||||
// TopSlideNotification.show(context,
|
||||
// text: "请先登录".tr,
|
||||
// textColor: themeController.currentColor.sc9);
|
||||
// Get.toNamed("/loginPage");
|
||||
// } else {
|
||||
// Get.toNamed("/mHTDeviceTypePage");
|
||||
// }
|
||||
// },
|
||||
// child: Container(
|
||||
// width: MediaQuery.sizeOf(context).width,
|
||||
// height: 302.rpx,
|
||||
// padding:
|
||||
// EdgeInsets.only(top: 90.rpx, bottom: 80.rpx),
|
||||
// decoration: BoxDecoration(
|
||||
// borderRadius: BorderRadius.circular(borderRadius),
|
||||
// border: Border.all(
|
||||
// color: stringToColor("#85F5FF"), // 边框颜色
|
||||
// width: 1.rpx, // 边框宽度
|
||||
// ),
|
||||
// ),
|
||||
// child: Column(
|
||||
// mainAxisSize: MainAxisSize.max,
|
||||
// mainAxisAlignment: MainAxisAlignment.center,
|
||||
// children: [
|
||||
// SvgPicture.asset(
|
||||
// 'assets/images/icon/add.svg',
|
||||
// width: 42.rpx,
|
||||
// height: 42.rpx,
|
||||
// ),
|
||||
// SizedBox(
|
||||
// height: 32.rpx,
|
||||
// ),
|
||||
// Text(
|
||||
// '添加一台新设备'.tr,
|
||||
// style: TextStyle(
|
||||
// color: stringToColor("#85F5FF"),
|
||||
// fontSize:
|
||||
// AppConstants().normal_text_fontSize,
|
||||
// letterSpacing: 0,
|
||||
// ),
|
||||
// ),
|
||||
// ],
|
||||
// ),
|
||||
// ),
|
||||
// ),
|
||||
// );
|
||||
|
||||
return Padding(
|
||||
padding: EdgeInsetsDirectional.fromSTEB(
|
||||
30.rpx, 0, 30.rpx, 80.rpx),
|
||||
30.rpx, 0.rpx, 30.rpx, 100.rpx),
|
||||
child: ClickableContainer(
|
||||
backgroundColor: Colors.transparent,
|
||||
highlightColor: Colors.transparent,
|
||||
padding: EdgeInsets.all(0),
|
||||
onTap: () {
|
||||
if (userInfoController.model.login == null ||
|
||||
userInfoController.model.login == 0) {
|
||||
TopSlideNotification.show(context,
|
||||
text: "请先登录".tr,
|
||||
textColor: themeController.currentColor.sc9);
|
||||
Get.toNamed("/loginPage");
|
||||
} else {
|
||||
Get.toNamed("/mHTDeviceTypePage");
|
||||
}
|
||||
// 点击逻辑
|
||||
Get.toNamed("/mHTDeviceTypePage");
|
||||
},
|
||||
backgroundColor: Colors.transparent,
|
||||
highlightColor: themeController.currentColor
|
||||
.sc21, // 这里可以自定义高亮色,透明就用 Colors.transparent
|
||||
borderRadius: borderRadius,
|
||||
padding: EdgeInsetsDirectional.fromSTEB(
|
||||
0.rpx, 0, 0.rpx, 0),
|
||||
child: Container(
|
||||
width: MediaQuery.sizeOf(context).width,
|
||||
height: 302.rpx,
|
||||
padding:
|
||||
EdgeInsets.only(top: 90.rpx, bottom: 80.rpx),
|
||||
height: 92.rpx,
|
||||
alignment: Alignment.center,
|
||||
decoration: BoxDecoration(
|
||||
borderRadius: BorderRadius.circular(borderRadius),
|
||||
border: Border.all(
|
||||
color: stringToColor("#85F5FF"), // 边框颜色
|
||||
width: 1.rpx, // 边框宽度
|
||||
),
|
||||
borderRadius: BorderRadius.circular(borderRadius),
|
||||
),
|
||||
child: Column(
|
||||
mainAxisSize: MainAxisSize.max,
|
||||
mainAxisAlignment: MainAxisAlignment.center,
|
||||
child: Row(
|
||||
mainAxisSize: MainAxisSize.min,
|
||||
children: [
|
||||
// Icon(
|
||||
// Icons.add,
|
||||
// size: 60.rpx,
|
||||
// color: stringToColor("#85F5FF"),
|
||||
// ),
|
||||
SvgPicture.asset(
|
||||
'assets/images/icon/add.svg',
|
||||
width: 42.rpx,
|
||||
height: 42.rpx,
|
||||
),
|
||||
SizedBox(
|
||||
height: 32.rpx,
|
||||
),
|
||||
SizedBox(width: 20.rpx),
|
||||
Text(
|
||||
'添加一台新设备'.tr,
|
||||
'添加新设备'.tr,
|
||||
style: TextStyle(
|
||||
fontFamily: 'Readex Pro',
|
||||
color: stringToColor("#85F5FF"),
|
||||
fontSize:
|
||||
AppConstants().normal_text_fontSize,
|
||||
letterSpacing: 0,
|
||||
fontSize: 26.rpx,
|
||||
),
|
||||
),
|
||||
],
|
||||
@@ -381,8 +434,8 @@ class _NewHomePageState extends State<NewHomePage> {
|
||||
personInfo.value = list[0];
|
||||
homeController.selectPerson.value = list[0];
|
||||
homeController.selectDevcie.value = list[0]["mac"];
|
||||
deviceController
|
||||
.getHomeSleeps(formFieldController.value);
|
||||
deviceController.getHomeSleeps(
|
||||
formFieldController.value, context);
|
||||
homeController.updateAll();
|
||||
});
|
||||
}
|
||||
@@ -492,7 +545,8 @@ class _NewHomePageState extends State<NewHomePage> {
|
||||
deviceController
|
||||
.getHomeSleeps(
|
||||
formFieldController
|
||||
.value);
|
||||
.value,
|
||||
context);
|
||||
homeController
|
||||
.updateAll();
|
||||
}
|
||||
@@ -741,59 +795,113 @@ class _NewHomePageState extends State<NewHomePage> {
|
||||
),
|
||||
),
|
||||
if (homeController.bindDeviceNum.value == 0)
|
||||
// Padding(
|
||||
// padding: EdgeInsetsDirectional.fromSTEB(
|
||||
// 30.rpx, 0, 30.rpx, 80.rpx),
|
||||
// child: ClickableContainer(
|
||||
// backgroundColor: Colors.transparent,
|
||||
// highlightColor: Colors.transparent,
|
||||
// padding: EdgeInsets.all(0),
|
||||
// onTap: () {
|
||||
// if (userInfoController.model.login ==
|
||||
// null ||
|
||||
// userInfoController.model.login == 0) {
|
||||
// TopSlideNotification.show(context,
|
||||
// text: "请先登录".tr,
|
||||
// textColor:
|
||||
// themeController.currentColor.sc9);
|
||||
// Get.toNamed("/loginPage");
|
||||
// } else {
|
||||
// Get.toNamed("/mHTDeviceTypePage");
|
||||
// }
|
||||
// },
|
||||
// child: Container(
|
||||
// width: MediaQuery.sizeOf(context).width,
|
||||
// height: 302.rpx,
|
||||
// padding: EdgeInsets.only(
|
||||
// top: 90.rpx, bottom: 80.rpx),
|
||||
// decoration: BoxDecoration(
|
||||
// borderRadius:
|
||||
// BorderRadius.circular(borderRadius),
|
||||
// border: Border.all(
|
||||
// color: stringToColor("#85F5FF"), // 边框颜色
|
||||
// width: 1.rpx, // 边框宽度
|
||||
// ),
|
||||
// ),
|
||||
// child: Column(
|
||||
// mainAxisSize: MainAxisSize.max,
|
||||
// mainAxisAlignment:
|
||||
// MainAxisAlignment.center,
|
||||
// children: [
|
||||
// SvgPicture.asset(
|
||||
// 'assets/images/icon/add.svg',
|
||||
// width: 42.rpx,
|
||||
// height: 42.rpx,
|
||||
// ),
|
||||
// SizedBox(
|
||||
// height: 32.rpx,
|
||||
// ),
|
||||
// Text(
|
||||
// '添加一台新设备'.tr,
|
||||
// style: TextStyle(
|
||||
// color: stringToColor("#85F5FF"),
|
||||
// fontSize: AppConstants()
|
||||
// .normal_text_fontSize,
|
||||
// letterSpacing: 0,
|
||||
// ),
|
||||
// ),
|
||||
// ],
|
||||
// ),
|
||||
// ),
|
||||
// ),
|
||||
// ),
|
||||
|
||||
Padding(
|
||||
padding: EdgeInsetsDirectional.fromSTEB(
|
||||
30.rpx, 0, 30.rpx, 80.rpx),
|
||||
30.rpx, 0.rpx, 30.rpx, 100.rpx),
|
||||
child: ClickableContainer(
|
||||
backgroundColor: Colors.transparent,
|
||||
highlightColor: Colors.transparent,
|
||||
padding: EdgeInsets.all(0),
|
||||
onTap: () {
|
||||
if (userInfoController.model.login ==
|
||||
null ||
|
||||
userInfoController.model.login == 0) {
|
||||
TopSlideNotification.show(context,
|
||||
text: "请先登录".tr,
|
||||
textColor:
|
||||
themeController.currentColor.sc9);
|
||||
Get.toNamed("/loginPage");
|
||||
} else {
|
||||
Get.toNamed("/mHTDeviceTypePage");
|
||||
}
|
||||
// 点击逻辑
|
||||
Get.toNamed("/mHTDeviceTypePage");
|
||||
},
|
||||
backgroundColor: Colors.transparent,
|
||||
highlightColor: themeController.currentColor
|
||||
.sc21, // 这里可以自定义高亮色,透明就用 Colors.transparent
|
||||
borderRadius: borderRadius,
|
||||
padding: EdgeInsetsDirectional.fromSTEB(
|
||||
0.rpx, 0, 0.rpx, 0),
|
||||
child: Container(
|
||||
width: MediaQuery.sizeOf(context).width,
|
||||
height: 302.rpx,
|
||||
padding: EdgeInsets.only(
|
||||
top: 90.rpx, bottom: 80.rpx),
|
||||
height: 92.rpx,
|
||||
alignment: Alignment.center,
|
||||
decoration: BoxDecoration(
|
||||
borderRadius:
|
||||
BorderRadius.circular(borderRadius),
|
||||
border: Border.all(
|
||||
color: stringToColor("#85F5FF"), // 边框颜色
|
||||
width: 1.rpx, // 边框宽度
|
||||
),
|
||||
borderRadius:
|
||||
BorderRadius.circular(borderRadius),
|
||||
),
|
||||
child: Column(
|
||||
mainAxisSize: MainAxisSize.max,
|
||||
mainAxisAlignment:
|
||||
MainAxisAlignment.center,
|
||||
child: Row(
|
||||
mainAxisSize: MainAxisSize.min,
|
||||
children: [
|
||||
// Icon(
|
||||
// Icons.add,
|
||||
// size: 60.rpx,
|
||||
// color: stringToColor("#85F5FF"),
|
||||
// ),
|
||||
SvgPicture.asset(
|
||||
'assets/images/icon/add.svg',
|
||||
width: 42.rpx,
|
||||
height: 42.rpx,
|
||||
),
|
||||
SizedBox(
|
||||
height: 32.rpx,
|
||||
),
|
||||
SizedBox(width: 20.rpx),
|
||||
Text(
|
||||
'添加一台新设备'.tr,
|
||||
'添加新设备'.tr,
|
||||
style: TextStyle(
|
||||
fontFamily: 'Readex Pro',
|
||||
color: stringToColor("#85F5FF"),
|
||||
fontSize: AppConstants()
|
||||
.normal_text_fontSize,
|
||||
letterSpacing: 0,
|
||||
fontSize: 26.rpx,
|
||||
),
|
||||
),
|
||||
],
|
||||
|
||||
@@ -10,6 +10,8 @@ import 'package:vbvs_app/component/tool/TopSlideNotification.dart';
|
||||
import 'package:vbvs_app/controller/mh_controller/message_controller.dart';
|
||||
import 'package:vbvs_app/controller/mh_controller/mhdevice_share_controller.dart';
|
||||
import 'package:vbvs_app/model/api_response.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 MessageDetailPage extends StatefulWidget {
|
||||
final data;
|
||||
@@ -183,6 +185,45 @@ class _MessageDetailPageState extends State<MessageDetailPage> {
|
||||
messageController.getMessageList(widget.data['type']);
|
||||
messageController.updateAll();
|
||||
//todo 更新设备列表
|
||||
MHTHomeController homeController = Get.find();
|
||||
//更新设备列表
|
||||
homeController.getPersonList();
|
||||
//请求绑定设备列表
|
||||
// homeController.getSleepReport();
|
||||
homeController.getDeviceNum().then((apiResponse) {
|
||||
if (apiResponse.code != HttpStatusCodes.ok) {
|
||||
TopSlideNotification.show(
|
||||
Get.context!,
|
||||
text: apiResponse.msg!,
|
||||
textColor: themeController.currentColor.sc9,
|
||||
);
|
||||
}
|
||||
});
|
||||
homeController.getDeviceList(group: 'room').then((apiResponse) {
|
||||
if (apiResponse.code != HttpStatusCodes.ok) {
|
||||
try {
|
||||
WebviewTestController webviewTestController = Get.find();
|
||||
webviewTestController.web.jsbridge?.dart.alterDevice();
|
||||
} catch (e) {
|
||||
ef.log("[h5]通知列表更新报错:$e");
|
||||
}
|
||||
TopSlideNotification.show(
|
||||
Get.context!,
|
||||
text: apiResponse.msg!,
|
||||
textColor: themeController.currentColor.sc9,
|
||||
);
|
||||
} else {
|
||||
//请求睡眠报告
|
||||
// deviceController.getSleepReport();
|
||||
}
|
||||
});
|
||||
WidgetsBinding.instance.addPostFrameCallback((_) {
|
||||
if (homeController.homeSleepDays.value.isNotEmpty) {
|
||||
homeController.selectedDayIndex.value =
|
||||
homeController.homeSleepDays.value.length - 1;
|
||||
}
|
||||
});
|
||||
await homeController.getPersonList();
|
||||
} else {
|
||||
TopSlideNotification.show(context,
|
||||
text: apiResponse.msg!, textColor: Color(0XFFFF7159));
|
||||
|
||||
@@ -318,6 +318,20 @@ class _MinePageState extends State<NewMinePage> {
|
||||
'购买和使用智能床过程中,如果遇到疑问可与客服进行联系',
|
||||
path: "",
|
||||
onTap: () async {
|
||||
UserInfoController userInfoController =
|
||||
Get.find();
|
||||
int loginStatus =
|
||||
userInfoController.model.login!;
|
||||
if (loginStatus != 1) {
|
||||
TopSlideNotification.show(
|
||||
context,
|
||||
text: "必须登录提示".tr,
|
||||
textColor:
|
||||
themeController.currentColor.sc9,
|
||||
);
|
||||
Get.toNamed("/loginPage");
|
||||
return;
|
||||
}
|
||||
MHTLoginController mhtLoginController =
|
||||
Get.find<MHTLoginController>();
|
||||
await mhtLoginController
|
||||
|
||||
@@ -37,8 +37,8 @@ class WebviewTestController extends GetControllerEx<WebviewTestModel> {
|
||||
web = WebviewHelper(
|
||||
isheadless: false,
|
||||
jsbridge: buildsdk(
|
||||
// father: this,
|
||||
// clientId: '494641114',
|
||||
father: this,
|
||||
clientId: '494641114',
|
||||
// dbgserverUrl: 'ws://192.168.1.2:9001',
|
||||
),
|
||||
settings: buildsettings(),
|
||||
|
||||
@@ -184,10 +184,11 @@ class MHTLoginPage extends GetView<MHTLoginController> {
|
||||
}
|
||||
|
||||
if (Platform.isAndroid) {
|
||||
var flag = await _handleBackPressed(context); // 自定义返回逻辑
|
||||
if (flag) {
|
||||
SystemNavigator.pop();
|
||||
}
|
||||
// var flag = await _handleBackPressed(context); // 自定义返回逻辑
|
||||
// if (flag) {
|
||||
// SystemNavigator.pop();
|
||||
// }
|
||||
Get.back();
|
||||
}
|
||||
},
|
||||
child: Align(
|
||||
@@ -961,10 +962,8 @@ class MHTLoginPage extends GetView<MHTLoginController> {
|
||||
),
|
||||
),
|
||||
),
|
||||
|
||||
);
|
||||
}),
|
||||
|
||||
Obx(() {
|
||||
return Visibility(
|
||||
visible: controller.model.loginStyle == 2
|
||||
@@ -1221,7 +1220,6 @@ class MHTLoginPage extends GetView<MHTLoginController> {
|
||||
),
|
||||
),
|
||||
),
|
||||
|
||||
);
|
||||
}),
|
||||
Padding(
|
||||
|
||||
Reference in New Issue
Block a user