更新特殊处理测试账号

This commit is contained in:
wyf
2025-10-16 10:10:15 +08:00
parent aae9e551d3
commit 6862b97e17
10 changed files with 553 additions and 360 deletions

View File

@@ -54,14 +54,16 @@ class AppConstants {
//系统参数 //系统参数
//运行打包APP模式 //运行打包APP模式
int ent_type = APPPackageType.MHT.code; //1.默认太和 2.欢睡 3.眠花糖 // int ent_type = APPPackageType.MHT.code; //1.默认太和 2.欢睡 3.眠花糖
// int ent_type = APPPackageType.TH.code; //1.默认太和 2.欢睡 3.眠花糖 int ent_type = APPPackageType.TH.code; //1.默认太和 2.欢睡 3.眠花糖
// int ent_type = APPPackageType.HUANSHUI.code; //1.默认太和 2.欢睡 3.眠花糖 // int ent_type = APPPackageType.HUANSHUI.code; //1.默认太和 2.欢睡 3.眠花糖
int text_length = 8; int text_length = 8;
int wifi1 = -45; int wifi1 = -45;
int wifi2 = -60; int wifi2 = -60;
int wifi3 = -75; int wifi3 = -75;
static bool is_test_account = true; //是否测试账号
} }
//获取协议地址 //获取协议地址

View File

@@ -74,6 +74,7 @@ class _DynamicReportDetailWidgetState extends State<DynamicReportDetailWidget> {
SizedBox(height: 33.rpx), SizedBox(height: 33.rpx),
_buildSleepDateWidgets(), _buildSleepDateWidgets(),
SizedBox(height: 20.rpx), SizedBox(height: 20.rpx),
if (!AppConstants.is_test_account)
_buildSleepDataModuleWidgets(), _buildSleepDataModuleWidgets(),
], ],
), ),
@@ -104,6 +105,7 @@ class _DynamicReportDetailWidgetState extends State<DynamicReportDetailWidget> {
), ),
), ),
), ),
if (!AppConstants.is_test_account)
ClickableContainer( ClickableContainer(
backgroundColor: Colors.transparent, backgroundColor: Colors.transparent,
highlightColor: themeController.currentColor.sc3, highlightColor: themeController.currentColor.sc3,

View File

@@ -140,6 +140,7 @@ class _SleepDateWidgetState extends State<SleepDateWidget> {
], ],
), ),
), ),
if (!AppConstants.is_test_account)
Container( Container(
width: 0.2.rpx, width: 0.2.rpx,
height: 2.4.rpx, height: 2.4.rpx,
@@ -156,11 +157,11 @@ class _SleepDateWidgetState extends State<SleepDateWidget> {
: widget.comment!, : widget.comment!,
options: FFButtonOptions( options: FFButtonOptions(
height: 40.rpx, height: 40.rpx,
padding: padding: EdgeInsetsDirectional.fromSTEB(
EdgeInsetsDirectional.fromSTEB(16.rpx, 0, 16.rpx, 0), 16.rpx, 0, 16.rpx, 0),
iconPadding: EdgeInsetsDirectional.fromSTEB(0, 0, 0, 0), iconPadding: EdgeInsetsDirectional.fromSTEB(0, 0, 0, 0),
color: color: widget.textColor ??
widget.textColor ?? themeController.currentColor.sc4, themeController.currentColor.sc4,
textStyle: TextStyle( textStyle: TextStyle(
// fontFamily: 'Inter Tight', // fontFamily: 'Inter Tight',
color: themeController.currentColor.sc3, color: themeController.currentColor.sc3,

View File

@@ -105,6 +105,11 @@ class LoginController extends GetControllerEx<LoginModel> {
UserInfoController userInfoController = Get.find(); UserInfoController userInfoController = Get.find();
userInfoController.model.login = 1; userInfoController.model.login = 1;
userInfoController.model.user = UserModel.fromJson(res.data); userInfoController.model.user = UserModel.fromJson(res.data);
if (res.data['test'] != null && res.data['test'] == true) {
AppConstants.is_test_account = true;
} else {
AppConstants.is_test_account = false;
}
String token = response.headers['token']!.first; String token = response.headers['token']!.first;
EasyDartModule.dio.token = token; EasyDartModule.dio.token = token;
final box = GetStorage(); final box = GetStorage();
@@ -178,11 +183,14 @@ class LoginController extends GetControllerEx<LoginModel> {
res.msg = "其他手机登录页.发送成功".tr; res.msg = "其他手机登录页.发送成功".tr;
} }
} }
EasyDartModule.logger.info('msg:发送验证码成功');
return res; return res;
} else { } else {
EasyDartModule.logger.error('msg:发送验证码失败:${response}');
return ApiResponse(code: -1, msg: "失败".tr); return ApiResponse(code: -1, msg: "失败".tr);
} }
} catch (e) { } catch (e) {
EasyDartModule.logger.error('msg:发送验证码失败:${e}');
return ApiResponse(code: -1, msg: "失败".tr); return ApiResponse(code: -1, msg: "失败".tr);
} }
} }

View File

@@ -225,6 +225,11 @@ class UserInfoController extends GetControllerEx<UserInfoModel> {
MyUtils.formatResponse(apiResponse, "保存成功".tr, "保存失败".tr); MyUtils.formatResponse(apiResponse, "保存成功".tr, "保存失败".tr);
if (res.code == HttpStatusCodes.ok) { if (res.code == HttpStatusCodes.ok) {
UserInfoController userInfoController = Get.find(); UserInfoController userInfoController = Get.find();
if (res.data['test'] != null && res.data['test'] == true) {
AppConstants.is_test_account = true;
} else {
AppConstants.is_test_account = false;
}
userInfoController.model.user = UserModel.fromJson(res.data); userInfoController.model.user = UserModel.fromJson(res.data);
final box = GetStorage(); final box = GetStorage();
box.write('user', userInfoController.model.user!.toJson()); // 存储用户信息 box.write('user', userInfoController.model.user!.toJson()); // 存储用户信息

View File

@@ -189,12 +189,12 @@ Future<void> initWX() async {
Fluwx fluwx = Fluwx(); Fluwx fluwx = Fluwx();
fluwx.registerApi( fluwx.registerApi(
//请填写自己的微信appid //请填写自己的微信appid
// appId: "wxeb2688220799e2c5", //太和 appId: "wxeb2688220799e2c5", //太和
appId: "wx929c548fea6af9c7", //眠花糖 // appId: "wx929c548fea6af9c7", //眠花糖
doOnAndroid: true, doOnAndroid: true,
doOnIOS: true, doOnIOS: true,
// universalLink: "https://app.he-info.com/theh/", universalLink: "https://app.he-info.com/theh/",
universalLink: "https://zhmht.swes.com.cn/app/", // universalLink: "https://zhmht.swes.com.cn/app/",
); );
} }
@@ -629,7 +629,10 @@ void initEasyDartModule() {
try { try {
EasyDartModule.init( EasyDartModule.init(
loggerConfig: loggerConfig:
LoggerConfig(host: ServiceConstant.logService, serviceName: "智慧眠花糖在线2025-10-9"), // LoggerConfig(host: ServiceConstant.logService, serviceName: "智慧眠花糖在线2025-10-9"),
LoggerConfig(
host: ServiceConstant.logService,
serviceName: "太和e护在线2025-10-14"),
webSocketConfig: webSocketConfig:
WebSocketConfig(ServiceConstant.webSocketService, (data) { WebSocketConfig(ServiceConstant.webSocketService, (data) {
// 接收到服务消息 // 接收到服务消息
@@ -701,7 +704,9 @@ Future<void> initLogin() async {
EasyDartModule.dio.token = null; EasyDartModule.dio.token = null;
} else { } else {
userInfoController.model.login = 1; userInfoController.model.login = 1;
if (AppConstants().ent_type == APPPackageType.MHT.code) {
await JPushUtil.initJPush(); await JPushUtil.initJPush();
}
updateAppSystemNotify(true); updateAppSystemNotify(true);
} }
} else { } else {
@@ -713,6 +718,11 @@ Future<void> initLogin() async {
if (userMap != null) { if (userMap != null) {
UserModel user = UserModel.fromJson(userMap); UserModel user = UserModel.fromJson(userMap);
userInfoController.model.user = user; userInfoController.model.user = user;
if (user.test != null && (user.test)!) {
AppConstants.is_test_account = true;
} else {
AppConstants.is_test_account = false;
}
} }
} catch (e) { } catch (e) {
print(e); print(e);

View File

@@ -16,6 +16,7 @@ class UserModel {
String? status; String? status;
int? created_at; int? created_at;
String? email; String? email;
bool? test;
UserModel(); UserModel();
static UserModel fromJson(Map<String, dynamic> json) => static UserModel fromJson(Map<String, dynamic> json) =>

View File

@@ -1025,6 +1025,7 @@ class _DeviceDataComponentWidgetState extends State<DeviceDataComponentWidget> {
color: themeController.currentColor.sc4, color: themeController.currentColor.sc4,
), ),
SizedBox(height: 5.rpx), SizedBox(height: 5.rpx),
if (!AppConstants.is_test_account)
Row( Row(
mainAxisAlignment: MainAxisAlignment.spaceAround, mainAxisAlignment: MainAxisAlignment.spaceAround,
children: [ children: [
@@ -1099,7 +1100,8 @@ class _DeviceDataComponentWidgetState extends State<DeviceDataComponentWidget> {
style: TextStyle( style: TextStyle(
color: themeController.currentColor.sc3, color: themeController.currentColor.sc3,
fontFamily: 'Inter', fontFamily: 'Inter',
fontSize: AppConstants().normal_text_fontSize, fontSize:
AppConstants().normal_text_fontSize,
letterSpacing: 0.0, letterSpacing: 0.0,
), ),
), ),
@@ -1151,9 +1153,11 @@ class _DeviceDataComponentWidgetState extends State<DeviceDataComponentWidget> {
), ),
], ],
), ),
if (!AppConstants.is_test_account)
SizedBox( SizedBox(
height: 20.rpx, height: 20.rpx,
), ),
if (!AppConstants.is_test_account)
Row( Row(
mainAxisAlignment: MainAxisAlignment.spaceAround, mainAxisAlignment: MainAxisAlignment.spaceAround,
children: [ children: [
@@ -1189,7 +1193,8 @@ class _DeviceDataComponentWidgetState extends State<DeviceDataComponentWidget> {
style: TextStyle( style: TextStyle(
color: themeController.currentColor.sc3, color: themeController.currentColor.sc3,
fontFamily: 'Inter', fontFamily: 'Inter',
fontSize: AppConstants().normal_text_fontSize, fontSize:
AppConstants().normal_text_fontSize,
letterSpacing: 0.0, letterSpacing: 0.0,
), ),
), ),
@@ -1244,7 +1249,142 @@ class _DeviceDataComponentWidgetState extends State<DeviceDataComponentWidget> {
style: TextStyle( style: TextStyle(
color: themeController.currentColor.sc3, color: themeController.currentColor.sc3,
fontFamily: 'Inter', fontFamily: 'Inter',
fontSize: AppConstants().normal_text_fontSize, fontSize:
AppConstants().normal_text_fontSize,
letterSpacing: 0.0,
),
),
].divide(SizedBox(width: 17.rpx)),
),
),
),
),
),
],
),
if (AppConstants.is_test_account)
Row(
mainAxisAlignment: MainAxisAlignment.spaceAround,
children: [
Expanded(
child: CustomCard(
borderRadius: AppConstants().button_container_radius,
onTap: () async {
if (widget.device['person'] != null) {
personController.currentPersonId.value =
widget.device['_id'];
personController.name.value =
widget.device['person']['name'];
personController.update_person_mac.value =
widget.device['mac'];
personController.gender.value =
widget.device['person']['gender'] ?? 1;
personController.weight?.value =
widget.device['person']['weight'] == null
? ''
: widget.device['person']['weight']
.toString();
personController.height.value =
widget.device['person']['height'] == null
? ''
: widget.device['person']['height']
.toString();
personController.selectedDiseaseIds.value =
widget.device['person']['disease'] ?? [];
personController.birthday.value =
widget.device['person']['birthday'] ?? '';
personController.dateTime =
MyUtils.formatBirthdayTime(
widget.device['person']['birthday']);
} else {
personController.update_person_mac.value =
widget.device['mac'];
personController.currentPersonId.value =
widget.device['_id'];
personController.name.value = "";
personController.gender.value = 1;
personController.dateTime = null;
personController.height.value = "";
personController.weight.value = "";
personController.diseaseList.value = [];
}
await Get.toNamed("/updatePersonPage",
arguments: widget.device['bind_type']);
bodyDeviceController.getDeviceList();
},
colors: [
themeController.currentColor.sc1,
themeController.currentColor.sc2,
],
child: Padding(
padding: EdgeInsetsDirectional.fromSTEB(
0.rpx, 0.rpx, 0.rpx, 0.rpx),
child: Container(
alignment: Alignment.center,
height: MediaQuery.sizeOf(context).height * 0.0037,
constraints: BoxConstraints(
minWidth: 143.rpx,
minHeight: 61.rpx,
),
child: Row(
mainAxisSize: MainAxisSize.max,
mainAxisAlignment: MainAxisAlignment.center,
children: [
Text(
"体征检测设备.人员资料".tr,
style: TextStyle(
color: themeController.currentColor.sc3,
fontFamily: 'Inter',
fontSize:
AppConstants().normal_text_fontSize,
letterSpacing: 0.0,
),
),
].divide(SizedBox(width: 17.rpx)),
),
),
),
),
),
SizedBox(
width: 20.rpx,
),
Expanded(
// 使用 Expanded 来占据屏幕宽度的一半
child: CustomCard(
borderRadius: AppConstants().button_container_radius,
onTap: () {
// TopSlideNotification.show(context, text: "待开发功能".tr);
Get.toNamed("/messageReviewPage",
arguments: widget.device);
},
colors: [
themeController.currentColor.sc1,
themeController.currentColor.sc2,
],
child: Padding(
padding: EdgeInsetsDirectional.fromSTEB(
0.rpx, 0.rpx, 0.rpx, 0.rpx),
child: Container(
alignment: Alignment.center,
height: MediaQuery.sizeOf(context).height * 0.0037,
constraints: BoxConstraints(
minWidth: 143.rpx,
minHeight: 61.rpx,
),
child: Row(
mainAxisSize: MainAxisSize.max,
mainAxisAlignment: MainAxisAlignment.center,
children: [
Text(
"体征检测设备.消息回看".tr,
style: TextStyle(
color: themeController.currentColor.sc3,
fontFamily: 'Inter',
fontSize:
AppConstants().normal_text_fontSize,
letterSpacing: 0.0, letterSpacing: 0.0,
), ),
), ),

View File

@@ -109,6 +109,7 @@ class _MessagePageState extends State<MessagePage> {
Row( Row(
children: [ children: [
// 第一个容器,宽度占屏幕一半 // 第一个容器,宽度占屏幕一半
if (!AppConstants.is_test_account)
Obx(() { Obx(() {
return Expanded( return Expanded(
child: ClickableContainer( child: ClickableContainer(
@@ -228,6 +229,7 @@ class _MessagePageState extends State<MessagePage> {
], ],
), ),
// 动画线 // 动画线
if (!AppConstants.is_test_account)
Obx(() { Obx(() {
double lineWidth = double lineWidth =
MediaQuery.sizeOf(context).width * 0.5 - MediaQuery.sizeOf(context).width * 0.5 -
@@ -245,7 +247,29 @@ class _MessagePageState extends State<MessagePage> {
height: 4.rpx, height: 4.rpx,
decoration: BoxDecoration( decoration: BoxDecoration(
color: themeController.currentColor.sc2, color: themeController.currentColor.sc2,
borderRadius: BorderRadius.circular(2.rpx), borderRadius:
BorderRadius.circular(2.rpx),
),
),
);
}),
if (AppConstants.is_test_account)
Obx(() {
double lineWidth = MediaQuery.sizeOf(context)
.width; // 每个容器占宽度的一半
messageController.model.type == 2;
return AnimatedPositioned(
duration: const Duration(milliseconds: 300),
curve: Curves.easeInOut,
bottom: 0,
left: 0, // 动态设置左侧位置
child: Container(
width: lineWidth,
height: 4.rpx,
decoration: BoxDecoration(
color: themeController.currentColor.sc2,
borderRadius:
BorderRadius.circular(2.rpx),
), ),
), ),
); );

View File

@@ -674,7 +674,7 @@ class _MinePageState extends State<MinePage> {
mainAxisSize: MainAxisSize.max, mainAxisSize: MainAxisSize.max,
children: [ children: [
Text( Text(
'V1.0.2509.19', 'V1.0.2510.14',
style: TextStyle( style: TextStyle(
fontFamily: 'Inter', fontFamily: 'Inter',
color: Color(0xFFD9E3EB), color: Color(0xFFD9E3EB),