Merge remote-tracking branch 'origin/master'
This commit is contained in:
@@ -4,7 +4,7 @@ flutter.sdk=C:\\dev\\flutter
|
|||||||
flutter.buildMode=release
|
flutter.buildMode=release
|
||||||
flutter.versionName=1.0.0
|
flutter.versionName=1.0.0
|
||||||
flutter.versionCode=1
|
flutter.versionCode=1
|
||||||
flutter.minSdkVersion=21
|
flutter.minSdkVersion=22
|
||||||
flutter.targetSdkVersion=35
|
flutter.targetSdkVersion=35
|
||||||
flutter.compileSdkVersion=35
|
flutter.compileSdkVersion=35
|
||||||
flutter.ndkVersion=28.0.12433566
|
flutter.ndkVersion=28.0.12433566
|
||||||
@@ -1,3 +1,3 @@
|
|||||||
[
|
[
|
||||||
"assets/miniapp/mhtControl_1.0.0.zip"
|
"assets/miniapp/mhtControl_1.0.30.zip"
|
||||||
]
|
]
|
||||||
@@ -213,5 +213,6 @@
|
|||||||
"每日得分": "每日得分",
|
"每日得分": "每日得分",
|
||||||
"每日得分介绍": "每日得分介绍",
|
"每日得分介绍": "每日得分介绍",
|
||||||
"与上月对比": "与上月对比",
|
"与上月对比": "与上月对比",
|
||||||
"设备状态":"设备状态"
|
"设备状态":"设备状态",
|
||||||
|
"校准未完成提示":"校准还未完成,是否确认退出校准流程?"
|
||||||
}
|
}
|
||||||
Binary file not shown.
@@ -2,9 +2,11 @@ class CommonVariables {
|
|||||||
static bool isNetWorkOn = false;
|
static bool isNetWorkOn = false;
|
||||||
static String supabaseUrl = "https://zhmht.swes.com.cn:3443";
|
static String supabaseUrl = "https://zhmht.swes.com.cn:3443";
|
||||||
// 企业微信客服拉起的url地址
|
// 企业微信客服拉起的url地址
|
||||||
static String wxKfUrl = "https://work.weixin.qq.com/kfid/kfcab6a07e8aac68945";
|
// static String wxKfUrl = "https://work.weixin.qq.com/kfid/kfcab6a07e8aac68945";
|
||||||
|
static String wxKfUrl = "https://work.weixin.qq.com/kfid/kfc7d2337b9c07b1269";
|
||||||
// 企业微信ID
|
// 企业微信ID
|
||||||
static String wxCorpId = "wwc17348c75dbde1dc";
|
// static String wxCorpId = "wwc17348c75dbde1dc";
|
||||||
|
static String wxCorpId = "ww51feda6026280cd0";
|
||||||
//ICP备案号
|
//ICP备案号
|
||||||
static String ICPRightCode = "皖ICP备2024068219号-1A";
|
static String ICPRightCode = "皖ICP备2024068219号-1A";
|
||||||
//公司名称
|
//公司名称
|
||||||
|
|||||||
@@ -140,10 +140,13 @@ Future<void> initWX() async {
|
|||||||
Fluwx fluwx = Fluwx();
|
Fluwx fluwx = Fluwx();
|
||||||
fluwx.registerApi(
|
fluwx.registerApi(
|
||||||
//请填写自己的微信appid
|
//请填写自己的微信appid
|
||||||
appId: "wxeb2688220799e2c5",
|
// appId: "wxeb2688220799e2c5",//太和
|
||||||
|
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/",
|
||||||
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
Timer? _messageTimer;
|
Timer? _messageTimer;
|
||||||
|
|||||||
@@ -226,6 +226,9 @@ class _HomePageState extends State<MainPageBBottomChange>
|
|||||||
//如果当前没有连接该设备,则返回
|
//如果当前没有连接该设备,则返回
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
if (webviewTestController.selectDevice['blueToothStatus']!=2) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
edm.EasyDartModule.websocket.sendData(jsonEncode(WebSocketMessage(
|
edm.EasyDartModule.websocket.sendData(jsonEncode(WebSocketMessage(
|
||||||
to: data['from'],
|
to: data['from'],
|
||||||
// to: ef.kvRoot.websocketId,
|
// to: ef.kvRoot.websocketId,
|
||||||
|
|||||||
@@ -236,11 +236,11 @@ class _BluetoothPageState extends State<BluetoothPage> {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
}),
|
}),
|
||||||
_buildMenuButton(context, '设备校准', ""),
|
_buildMenuButton(context, '设备校准', "/mhtCalibrationAfterPage", arguments: obsData,),
|
||||||
_buildMenuButton(
|
_buildMenuButton(
|
||||||
context, '体征传感器', "/vitalSignsSensorPage",
|
context, '体征传感器', "/vitalSignsSensorPage",
|
||||||
arguments: obsData),
|
arguments: obsData),
|
||||||
_buildMenuButton(context, 'WIFI配置', ""),
|
_buildMenuButton(context, 'WIFI配置', "/mhtWifiAfterPage",arguments: obsData,),
|
||||||
// _buildMenuButton(
|
// _buildMenuButton(
|
||||||
// context, '睡眠习惯', "/sleepHabitPage"),
|
// context, '睡眠习惯', "/sleepHabitPage"),
|
||||||
_buildMenuButton(
|
_buildMenuButton(
|
||||||
|
|||||||
1016
lib/pages/mh_page/device/mht_device_calibration_after.dart
Normal file
1016
lib/pages/mh_page/device/mht_device_calibration_after.dart
Normal file
File diff suppressed because it is too large
Load Diff
@@ -68,7 +68,6 @@ class _MHTWifiPageState extends State<MHTWifiPage> {
|
|||||||
blueteethBindController.updateAll();
|
blueteethBindController.updateAll();
|
||||||
}
|
}
|
||||||
|
|
||||||
@override
|
|
||||||
@override
|
@override
|
||||||
void dispose() {
|
void dispose() {
|
||||||
_isDisposed = true;
|
_isDisposed = true;
|
||||||
|
|||||||
1089
lib/pages/mh_page/device/mht_wifi_page_after.dart
Normal file
1089
lib/pages/mh_page/device/mht_wifi_page_after.dart
Normal file
File diff suppressed because it is too large
Load Diff
@@ -3,7 +3,9 @@ import 'package:flutter/material.dart';
|
|||||||
import 'package:flutter/services.dart';
|
import 'package:flutter/services.dart';
|
||||||
import 'package:flutter_svg/svg.dart';
|
import 'package:flutter_svg/svg.dart';
|
||||||
import 'package:flutterflow_ui/flutterflow_ui.dart';
|
import 'package:flutterflow_ui/flutterflow_ui.dart';
|
||||||
|
import 'package:fluwx/fluwx.dart';
|
||||||
import 'package:vbvs_app/common/color/appConstants.dart';
|
import 'package:vbvs_app/common/color/appConstants.dart';
|
||||||
|
import 'package:vbvs_app/common/util/CommonVariables.dart';
|
||||||
import 'package:vbvs_app/common/util/FitTool.dart';
|
import 'package:vbvs_app/common/util/FitTool.dart';
|
||||||
import 'package:vbvs_app/common/util/MyUtils.dart';
|
import 'package:vbvs_app/common/util/MyUtils.dart';
|
||||||
import 'package:vbvs_app/component/tool/ClickableContainer.dart';
|
import 'package:vbvs_app/component/tool/ClickableContainer.dart';
|
||||||
@@ -13,6 +15,8 @@ import 'package:vbvs_app/controller/theme_controller/ThemeController.dart';
|
|||||||
import 'package:vbvs_app/controller/user_info_controller.dart';
|
import 'package:vbvs_app/controller/user_info_controller.dart';
|
||||||
import 'dart:ui' as ui;
|
import 'dart:ui' as ui;
|
||||||
|
|
||||||
|
import 'package:vbvs_app/pages/mh_page/user/controller/mht_login_controller.dart';
|
||||||
|
|
||||||
class NewMinePage extends StatefulWidget {
|
class NewMinePage extends StatefulWidget {
|
||||||
const NewMinePage({super.key});
|
const NewMinePage({super.key});
|
||||||
|
|
||||||
@@ -302,7 +306,14 @@ class _MinePageState extends State<NewMinePage> {
|
|||||||
'assets/img/icon/customer_service.svg',
|
'assets/img/icon/customer_service.svg',
|
||||||
'在线客服',
|
'在线客服',
|
||||||
'购买和使用智能床过程中,如果遇到疑问可与客服进行联系',
|
'购买和使用智能床过程中,如果遇到疑问可与客服进行联系',
|
||||||
path: ""),
|
path: "",
|
||||||
|
onTap: () async {
|
||||||
|
MHTLoginController mhtLoginController =
|
||||||
|
Get.find<MHTLoginController>();
|
||||||
|
await mhtLoginController
|
||||||
|
.openWeChatCustomerService(context);
|
||||||
|
},
|
||||||
|
),
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
@@ -334,20 +345,24 @@ class _MinePageState extends State<NewMinePage> {
|
|||||||
String svgPath,
|
String svgPath,
|
||||||
String title,
|
String title,
|
||||||
String subtitle, {
|
String subtitle, {
|
||||||
// VoidCallback? onTap,
|
|
||||||
String? path,
|
String? path,
|
||||||
bool showTopLine = false,
|
bool showTopLine = false,
|
||||||
|
VoidCallback? onTap, // ✅ 新增可选 onTap 参数
|
||||||
}) {
|
}) {
|
||||||
return ClickableContainer(
|
return ClickableContainer(
|
||||||
backgroundColor: Colors.transparent,
|
backgroundColor: Colors.transparent,
|
||||||
highlightColor: Colors.white,
|
highlightColor: Colors.white,
|
||||||
padding: EdgeInsets.all(0.rpx),
|
padding: EdgeInsets.all(0.rpx),
|
||||||
onTap: () {
|
onTap: () {
|
||||||
|
if (onTap != null) {
|
||||||
|
onTap(); // ✅ 使用外部传入的 onTap
|
||||||
|
} else {
|
||||||
if (path == null || path.isEmpty) {
|
if (path == null || path.isEmpty) {
|
||||||
TopSlideNotification.show(context, text: "待开发功能".tr);
|
TopSlideNotification.show(context, text: "待开发功能".tr);
|
||||||
} else {
|
} else {
|
||||||
Get.toNamed(path);
|
Get.toNamed(path);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
},
|
},
|
||||||
child: Container(
|
child: Container(
|
||||||
decoration: BoxDecoration(
|
decoration: BoxDecoration(
|
||||||
@@ -363,18 +378,16 @@ class _MinePageState extends State<NewMinePage> {
|
|||||||
padding: EdgeInsets.fromLTRB(40.rpx, 0.rpx, 40.rpx, 0.rpx),
|
padding: EdgeInsets.fromLTRB(40.rpx, 0.rpx, 40.rpx, 0.rpx),
|
||||||
child: Row(
|
child: Row(
|
||||||
children: [
|
children: [
|
||||||
Container(
|
SvgPicture.asset(
|
||||||
child: SvgPicture.asset(
|
|
||||||
svgPath,
|
svgPath,
|
||||||
width: 42.rpx,
|
width: 42.rpx,
|
||||||
height: 42.rpx,
|
height: 42.rpx,
|
||||||
),
|
),
|
||||||
),
|
|
||||||
SizedBox(width: 30.rpx),
|
SizedBox(width: 30.rpx),
|
||||||
Expanded(
|
Expanded(
|
||||||
child: Column(
|
child: Column(
|
||||||
crossAxisAlignment: CrossAxisAlignment.start,
|
crossAxisAlignment: CrossAxisAlignment.start,
|
||||||
mainAxisAlignment: MainAxisAlignment.center, // 垂直方向居中对齐
|
mainAxisAlignment: MainAxisAlignment.center,
|
||||||
children: [
|
children: [
|
||||||
Text(
|
Text(
|
||||||
title,
|
title,
|
||||||
@@ -383,7 +396,6 @@ class _MinePageState extends State<NewMinePage> {
|
|||||||
fontSize: 30.rpx,
|
fontSize: 30.rpx,
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
// SizedBox(height: 6.rpx), // 加点间距
|
|
||||||
Text(
|
Text(
|
||||||
subtitle,
|
subtitle,
|
||||||
style: TextStyle(
|
style: TextStyle(
|
||||||
@@ -392,7 +404,7 @@ class _MinePageState extends State<NewMinePage> {
|
|||||||
),
|
),
|
||||||
maxLines: 1,
|
maxLines: 1,
|
||||||
overflow: TextOverflow.ellipsis,
|
overflow: TextOverflow.ellipsis,
|
||||||
softWrap: true, // 允许换行
|
softWrap: true,
|
||||||
),
|
),
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
@@ -408,11 +420,14 @@ class _MinePageState extends State<NewMinePage> {
|
|||||||
child: SvgPicture.asset(
|
child: SvgPicture.asset(
|
||||||
'assets/img/icon/expand.svg',
|
'assets/img/icon/expand.svg',
|
||||||
color: Colors.white,
|
color: Colors.white,
|
||||||
))),
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
));
|
),
|
||||||
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
Widget _buildSettingButton() {
|
Widget _buildSettingButton() {
|
||||||
|
|||||||
@@ -86,6 +86,7 @@ class WebviewTestController extends GetControllerEx<WebviewTestModel> {
|
|||||||
bridge.sdk.updateBlueToothStatus((args) async {
|
bridge.sdk.updateBlueToothStatus((args) async {
|
||||||
ef.log('updateBlueToothStatus: $args');
|
ef.log('updateBlueToothStatus: $args');
|
||||||
bluetooth = args[0];
|
bluetooth = args[0];
|
||||||
|
selectDevice['blueToothStatus'] = bluetooth;
|
||||||
return true;
|
return true;
|
||||||
});
|
});
|
||||||
//sdk定义接口
|
//sdk定义接口
|
||||||
@@ -145,7 +146,7 @@ class WebviewTestController extends GetControllerEx<WebviewTestModel> {
|
|||||||
ef.log('更新睡眠习惯: $args[0]');
|
ef.log('更新睡眠习惯: $args[0]');
|
||||||
try {
|
try {
|
||||||
MHTBlueToothController blueToothController = Get.find();
|
MHTBlueToothController blueToothController = Get.find();
|
||||||
blueToothController.saveHabitData(args[0]);
|
await blueToothController.saveHabitData(args[0]);
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
ef.log("[更新睡眠习惯失败]:$e");
|
ef.log("[更新睡眠习惯失败]:$e");
|
||||||
}
|
}
|
||||||
@@ -172,6 +173,16 @@ class WebviewTestController extends GetControllerEx<WebviewTestModel> {
|
|||||||
}
|
}
|
||||||
return true;
|
return true;
|
||||||
});
|
});
|
||||||
|
// bridge.sdk.bluetoothConnect((args) async {
|
||||||
|
// ef.log('[蓝牙连接失败]: $args[0]');
|
||||||
|
// try {
|
||||||
|
// selectDevice['blueToothStatus'] = 2;
|
||||||
|
// return true;
|
||||||
|
// } catch (e) {
|
||||||
|
// ef.log("[蓝牙连接失败]:$e");
|
||||||
|
// }
|
||||||
|
// return true;
|
||||||
|
// });
|
||||||
});
|
});
|
||||||
} catch (e, s) {
|
} catch (e, s) {
|
||||||
ef.log('$e,$s');
|
ef.log('$e,$s');
|
||||||
|
|||||||
@@ -6,11 +6,14 @@ import 'package:fluwx/fluwx.dart';
|
|||||||
import 'package:get_storage/get_storage.dart';
|
import 'package:get_storage/get_storage.dart';
|
||||||
import 'package:json_annotation/json_annotation.dart';
|
import 'package:json_annotation/json_annotation.dart';
|
||||||
import 'package:vbvs_app/common/color/ServiceConstant.dart';
|
import 'package:vbvs_app/common/color/ServiceConstant.dart';
|
||||||
|
import 'package:vbvs_app/common/color/app_uri_status.dart';
|
||||||
|
import 'package:vbvs_app/common/util/CommonVariables.dart';
|
||||||
import 'package:vbvs_app/common/util/MyUtils.dart';
|
import 'package:vbvs_app/common/util/MyUtils.dart';
|
||||||
import 'package:vbvs_app/common/util/requestWithLog.dart';
|
import 'package:vbvs_app/common/util/requestWithLog.dart';
|
||||||
import 'package:vbvs_app/component/tool/TopSlideNotification.dart';
|
import 'package:vbvs_app/component/tool/TopSlideNotification.dart';
|
||||||
import 'package:vbvs_app/controller/time/countdown_controller.dart';
|
import 'package:vbvs_app/controller/time/countdown_controller.dart';
|
||||||
import 'package:vbvs_app/controller/user_info_controller.dart';
|
import 'package:vbvs_app/controller/user_info_controller.dart';
|
||||||
|
import 'package:vbvs_app/model/api_response.dart';
|
||||||
import 'package:vbvs_app/model/user_data.dart';
|
import 'package:vbvs_app/model/user_data.dart';
|
||||||
import 'package:vbvs_app/pages/mh_page/user/controller/mht_register_controller.dart';
|
import 'package:vbvs_app/pages/mh_page/user/controller/mht_register_controller.dart';
|
||||||
|
|
||||||
@@ -247,12 +250,54 @@ class MHTLoginController extends GetControllerEx<LoginModel> {
|
|||||||
// await repository.logout();
|
// await repository.logout();
|
||||||
}
|
}
|
||||||
|
|
||||||
loginByWechatCode(String code) async {
|
Future<int> loginByWechatCode(String code) async {
|
||||||
// return await repository.loginByWechatCode(code);
|
String serviceAddress = ServiceConstant.service_address;
|
||||||
|
String serviceName = ServiceConstant.server_service;
|
||||||
|
String serviceApi = ServiceConstant.login;
|
||||||
|
String queryUrl = "${serviceAddress}${serviceName}${serviceApi}";
|
||||||
|
String? language = "";
|
||||||
|
var data = {
|
||||||
|
"type": 2,
|
||||||
|
"password": code,
|
||||||
|
"khCode": "mht",
|
||||||
|
};
|
||||||
|
ApiResponse apiResponse = await requestWithLog(
|
||||||
|
logTitle: "微信登录",
|
||||||
|
method: MyHttpMethod.post,
|
||||||
|
queryUrl: queryUrl,
|
||||||
|
data: data);
|
||||||
|
if (apiResponse.code == HttpStatusCodes.ok) {
|
||||||
|
UserInfoController userInfoController = Get.find();
|
||||||
|
userInfoController.model.login = 1;
|
||||||
|
userInfoController.model.user = UserModel.fromJson(apiResponse.data);
|
||||||
|
String token = apiResponse.rawResponse.headers['token']!.first;
|
||||||
|
EasyDartModule.dio.token = token;
|
||||||
|
final box = GetStorage();
|
||||||
|
box.write('token', token); // 存储 token
|
||||||
|
box.write('user', userInfoController.model.user!.toJson()); // 存储用户信息
|
||||||
|
}
|
||||||
|
return apiResponse.code!;
|
||||||
}
|
}
|
||||||
|
|
||||||
//注销账号
|
//注销账号
|
||||||
deletedAccount() async {
|
deletedAccount() async {
|
||||||
// return await repository.deletedAccount();
|
// return await repository.deletedAccount();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Future<void> openWeChatCustomerService(BuildContext context) async {
|
||||||
|
bool isWeChatInstalled = await fluwx.isWeChatInstalled;
|
||||||
|
if (!isWeChatInstalled) {
|
||||||
|
TopSlideNotification.show(context,
|
||||||
|
text: "请先安装微信APP,再联系客服".tr,
|
||||||
|
textColor: themeController.currentColor.sc9);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
TopSlideNotification.show(
|
||||||
|
context,
|
||||||
|
text: "正在打开微信客服...".tr,
|
||||||
|
);
|
||||||
|
await fluwx.open(
|
||||||
|
target: CustomerServiceChat(
|
||||||
|
corpId: CommonVariables.wxCorpId, url: CommonVariables.wxKfUrl));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -91,8 +91,8 @@ class MHTLoginPage extends GetView<MHTLoginController> {
|
|||||||
textColor: themeController.currentColor.sc9);
|
textColor: themeController.currentColor.sc9);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
String msg = await controller.loginByWechatCode(code);
|
int rescode = await controller.loginByWechatCode(code);
|
||||||
if (msg.isEmpty) {
|
if (rescode == 1) {
|
||||||
// TODO 操作全部跳转页面前成功以后移除监听,防止重复监听,其他方式登录成功也需要移出监听
|
// TODO 操作全部跳转页面前成功以后移除监听,防止重复监听,其他方式登录成功也需要移出监听
|
||||||
controller.fluwxCancelable?.cancel();
|
controller.fluwxCancelable?.cancel();
|
||||||
// 登录成功移出网络检查监听
|
// 登录成功移出网络检查监听
|
||||||
@@ -1786,24 +1786,28 @@ class MHTLoginPage extends GetView<MHTLoginController> {
|
|||||||
padding: EdgeInsets.zero,
|
padding: EdgeInsets.zero,
|
||||||
onTap: () async {
|
onTap: () async {
|
||||||
// loginController.model.isIos == true &&
|
// loginController.model.isIos == true &&
|
||||||
// if (loginController
|
MHTRegisterController
|
||||||
// .model.register_agree ==
|
registerController = Get.find();
|
||||||
// null ||
|
if (registerController
|
||||||
// loginController
|
.model.register_agree ==
|
||||||
// .model.register_agree !=
|
null ||
|
||||||
// true) {
|
registerController
|
||||||
// TopSlideNotification.show(
|
.model.register_agree !=
|
||||||
// context,
|
true) {
|
||||||
// text: "登录页.未同意协议".tr,
|
TopSlideNotification.show(
|
||||||
// textColor:
|
context,
|
||||||
// themeController.currentColor.sc9,
|
text: "登录页.未同意协议".tr,
|
||||||
// );
|
textColor:
|
||||||
// return;
|
themeController.currentColor.sc9,
|
||||||
// }
|
);
|
||||||
// await loginController
|
return;
|
||||||
// .wxLoginSendAuth(context);
|
}
|
||||||
TopSlideNotification.show(context,
|
MHTLoginController loginController =
|
||||||
text: "测试阶段,暂不支持".tr);
|
Get.find();
|
||||||
|
await loginController
|
||||||
|
.wxLoginSendAuth();
|
||||||
|
// TopSlideNotification.show(context,
|
||||||
|
// text: "测试阶段,暂不支持".tr);
|
||||||
},
|
},
|
||||||
child: Container(
|
child: Container(
|
||||||
width: 90.rpx,
|
width: 90.rpx,
|
||||||
|
|||||||
@@ -43,7 +43,17 @@ class _SleepScoreWidgetState extends State<SleepScoreWidget> {
|
|||||||
List showLabel = widget.sleepReport['score']['type'];
|
List showLabel = widget.sleepReport['score']['type'];
|
||||||
List stages = widget.sleepReport['score']['stages'];
|
List stages = widget.sleepReport['score']['stages'];
|
||||||
List<SegmentData> segments = parseSegments(widget.sleepReport);
|
List<SegmentData> segments = parseSegments(widget.sleepReport);
|
||||||
|
int level = widget.sleepReport['score']['level'];
|
||||||
|
// 查找与 level 匹配的 map
|
||||||
|
String? matchedColor;
|
||||||
|
final matchedLabel = showLabel.firstWhere(
|
||||||
|
(item) => item['level'] == level,
|
||||||
|
orElse: () => null,
|
||||||
|
);
|
||||||
|
|
||||||
|
if (matchedLabel != null) {
|
||||||
|
matchedColor = matchedLabel['color'];
|
||||||
|
}
|
||||||
return Container(
|
return Container(
|
||||||
width: double.infinity,
|
width: double.infinity,
|
||||||
// decoration: BoxDecoration(color: Colors.green),
|
// decoration: BoxDecoration(color: Colors.green),
|
||||||
@@ -81,7 +91,11 @@ class _SleepScoreWidgetState extends State<SleepScoreWidget> {
|
|||||||
Text(
|
Text(
|
||||||
'${widget.sleepReport['score']?['avg']}',
|
'${widget.sleepReport['score']?['avg']}',
|
||||||
style: TextStyle(
|
style: TextStyle(
|
||||||
color: Colors.white,
|
// color: Colors.white,
|
||||||
|
color: stringToColor(
|
||||||
|
matchedColor?.trim().isEmpty ?? true
|
||||||
|
? "#FFFFFF"
|
||||||
|
: matchedColor!),
|
||||||
fontSize: 48.rpx,
|
fontSize: 48.rpx,
|
||||||
letterSpacing: 0.0,
|
letterSpacing: 0.0,
|
||||||
),
|
),
|
||||||
@@ -103,7 +117,12 @@ class _SleepScoreWidgetState extends State<SleepScoreWidget> {
|
|||||||
Text(
|
Text(
|
||||||
'${getSleepLevel(widget.sleepReport)}',
|
'${getSleepLevel(widget.sleepReport)}',
|
||||||
style: TextStyle(
|
style: TextStyle(
|
||||||
color: stringToColor("#FF9F66"),
|
// color: stringToColor("#FF9F66"),
|
||||||
|
color: stringToColor(
|
||||||
|
matchedColor?.trim().isEmpty ?? true
|
||||||
|
? "#FFFFFF"
|
||||||
|
: matchedColor!),
|
||||||
|
|
||||||
fontSize: 48.rpx,
|
fontSize: 48.rpx,
|
||||||
letterSpacing: 0.0,
|
letterSpacing: 0.0,
|
||||||
),
|
),
|
||||||
@@ -139,7 +158,11 @@ class _SleepScoreWidgetState extends State<SleepScoreWidget> {
|
|||||||
Text(
|
Text(
|
||||||
'${widget.sleepReport['score']?['score']}',
|
'${widget.sleepReport['score']?['score']}',
|
||||||
style: TextStyle(
|
style: TextStyle(
|
||||||
color: stringToColor("#FF9F66"),
|
// color: stringToColor("#FF9F66"),
|
||||||
|
color: stringToColor(
|
||||||
|
matchedColor?.trim().isEmpty ?? true
|
||||||
|
? "#FFFFFF"
|
||||||
|
: matchedColor!),
|
||||||
fontSize: 100.rpx),
|
fontSize: 100.rpx),
|
||||||
),
|
),
|
||||||
],
|
],
|
||||||
|
|||||||
@@ -21,8 +21,10 @@ import 'package:vbvs_app/pages/mh_page/device/mht_bind_device_success.dart';
|
|||||||
import 'package:vbvs_app/pages/mh_page/device/mht_bind_device_type.dart';
|
import 'package:vbvs_app/pages/mh_page/device/mht_bind_device_type.dart';
|
||||||
import 'package:vbvs_app/pages/mh_page/device/mht_blueteeth_device_page.dart';
|
import 'package:vbvs_app/pages/mh_page/device/mht_blueteeth_device_page.dart';
|
||||||
import 'package:vbvs_app/pages/mh_page/device/mht_device_calibration.dart';
|
import 'package:vbvs_app/pages/mh_page/device/mht_device_calibration.dart';
|
||||||
|
import 'package:vbvs_app/pages/mh_page/device/mht_device_calibration_after.dart';
|
||||||
import 'package:vbvs_app/pages/mh_page/device/mht_people_info.dart';
|
import 'package:vbvs_app/pages/mh_page/device/mht_people_info.dart';
|
||||||
import 'package:vbvs_app/pages/mh_page/device/mht_wifi_page.dart';
|
import 'package:vbvs_app/pages/mh_page/device/mht_wifi_page.dart';
|
||||||
|
import 'package:vbvs_app/pages/mh_page/device/mht_wifi_page_after.dart';
|
||||||
import 'package:vbvs_app/pages/mh_page/device_list.dart';
|
import 'package:vbvs_app/pages/mh_page/device_list.dart';
|
||||||
import 'package:vbvs_app/pages/mh_page/device_people_info.dart';
|
import 'package:vbvs_app/pages/mh_page/device_people_info.dart';
|
||||||
import 'package:vbvs_app/pages/mh_page/device_share_page.dart';
|
import 'package:vbvs_app/pages/mh_page/device_share_page.dart';
|
||||||
@@ -100,6 +102,8 @@ var mhroutes = {
|
|||||||
MHTBlueteethDevicePage(deviceType: arguments),
|
MHTBlueteethDevicePage(deviceType: arguments),
|
||||||
"/mHTwifiPage": (contxt, {arguments}) => MHTWifiPage(deviceInfo: arguments),
|
"/mHTwifiPage": (contxt, {arguments}) => MHTWifiPage(deviceInfo: arguments),
|
||||||
"/calibrationPage": (contxt) => MHTCalibrationPage(),
|
"/calibrationPage": (contxt) => MHTCalibrationPage(),
|
||||||
|
"/mhtCalibrationAfterPage": (contxt, {arguments}) =>
|
||||||
|
MHTCalibrationAfterPage(deviceInfo: arguments),
|
||||||
"/bindDeviceSuccess": (contxt) => MHTBindDeviceSuccess(),
|
"/bindDeviceSuccess": (contxt) => MHTBindDeviceSuccess(),
|
||||||
"/newSleepReportPage": (contxt, {arguments}) =>
|
"/newSleepReportPage": (contxt, {arguments}) =>
|
||||||
NewSleepReportPage(data: arguments),
|
NewSleepReportPage(data: arguments),
|
||||||
@@ -119,6 +123,8 @@ var mhroutes = {
|
|||||||
"/vitalSignsSensorPage": (context, {arguments}) => VitalSignsSensorPage(
|
"/vitalSignsSensorPage": (context, {arguments}) => VitalSignsSensorPage(
|
||||||
data: arguments,
|
data: arguments,
|
||||||
),
|
),
|
||||||
|
"/mhtWifiAfterPage": (contxt, {arguments}) =>
|
||||||
|
MHTWifiAfterPage(deviceInfo: arguments),
|
||||||
};
|
};
|
||||||
var mhonGenerateRoute = (RouteSettings settings) {
|
var mhonGenerateRoute = (RouteSettings settings) {
|
||||||
final String? name = settings.name; // 获取路由名称,如 /news 或 /search
|
final String? name = settings.name; // 获取路由名称,如 /news 或 /search
|
||||||
|
|||||||
10
pubspec.yaml
10
pubspec.yaml
@@ -7,6 +7,16 @@ version: 1.0.0+1
|
|||||||
environment:
|
environment:
|
||||||
sdk: ^3.5.4
|
sdk: ^3.5.4
|
||||||
|
|
||||||
|
fluwx:
|
||||||
|
app_id: 'wx929c548fea6af9c7' #填写自己的 WeChat app id.
|
||||||
|
debug_logging: false # Logging in debug mode.
|
||||||
|
android:
|
||||||
|
# interrupt_wx_request: true # Defaults to true.
|
||||||
|
# flutter_activity: 'MainActivity' # Defaults to app's launcher
|
||||||
|
ios:
|
||||||
|
universal_link: https://zhmht.swes.com.cn
|
||||||
|
no_pay: true # Set to true to disable payment.
|
||||||
|
|
||||||
dependencies:
|
dependencies:
|
||||||
qr_flutter: ^4.1.0
|
qr_flutter: ^4.1.0
|
||||||
flutter:
|
flutter:
|
||||||
|
|||||||
Reference in New Issue
Block a user