This commit is contained in:
wyf
2025-06-24 19:51:47 +08:00
parent a08574979e
commit 12c6a260c9
5 changed files with 44 additions and 12 deletions

View File

@@ -1,4 +1,4 @@
package com.taihe.mh_app
package com.taihe.vbvs_app
import io.flutter.embedding.android.FlutterActivity

View File

@@ -1,6 +1,6 @@
sdk.dir=C:\\Users\\wyf\\AppData\\Local\\Android\\sdk
flutter.sdk=D:\\flutter_res\\flutter
flutter.buildMode=release
flutter.buildMode=debug
flutter.versionName=1.0.0
flutter.versionCode=1
flutter.minSdkVersion=21

View File

@@ -9,7 +9,7 @@ import 'package:vbvs_app/common/util/requestWithLog.dart';
import 'package:vbvs_app/component/tool/TopSlideNotification.dart';
import 'package:vbvs_app/controller/user_info_controller.dart';
import 'package:vbvs_app/model/user_data.dart';
import 'package:lpinyin/lpinyin.dart';
// import 'package:lpinyin/lpinyin.dart';
part 'address_controller.g.dart';
@JsonSerializable()
@@ -209,10 +209,11 @@ class AddressController extends GetControllerEx<AddressModel> {
// 工具:中文首字母转大写英文(你也可以用更专业的拼音库)
String _getLetter(String name) {
if (name.isEmpty) return "#";
String pinyin = PinyinHelper.getPinyinE(name,
separator: '', defPinyin: '', format: PinyinFormat.WITHOUT_TONE);
if (pinyin.isEmpty) return "#";
return pinyin[0].toUpperCase();
return name;
// if (name.isEmpty) return "#";
// String pinyin = PinyinHelper.getPinyinE(name,
// separator: '', defPinyin: '', format: PinyinFormat.WITHOUT_TONE);
// if (pinyin.isEmpty) return "#";
// return pinyin[0].toUpperCase();
}
}

View File

@@ -81,12 +81,11 @@ class _HomeDeviceStausWidgetState extends State<HomeDeviceStausWidget> {
var future = webviewTestController.web.jsbridge?.dart
.appToHtmlDevice(device);
Future.delayed(Duration(seconds: 5), () {
TopSlideNotification.show(context, text: "控制界面初始化中,请稍后再试".tr);
Future.delayed(Duration(seconds: 5), () {
return;
});
await future; // 等待最终完成(即使超过 5 秒)
await future;
MainPageBBottomChange.jumpTo(2);
} catch (e) {
print("发生异常: $e");

View File

@@ -115,6 +115,39 @@ class _NewHomePageState extends State<NewHomePage> {
// deviceController.getSleepReport();
}
});
if (userInfoController.model.login == 1) {
//查询人员信息列表
deviceController.getPersonList();
//请求绑定设备列表
// homeController.getSleepReport();
deviceController.getDeviceNum().then((apiResponse) {
if (apiResponse.code != HttpStatusCodes.ok) {
TopSlideNotification.show(
Get.context!,
text: apiResponse.msg!,
textColor: themeController.currentColor.sc9,
);
}
});
deviceController.getDeviceList(group: 'room').then((apiResponse) {
if (apiResponse.code != HttpStatusCodes.ok) {
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;
}
});
int login = userInfoController.model.login!;
return GestureDetector(
onTap: () => FocusScope.of(context).unfocus(),
@@ -482,7 +515,6 @@ class _NewHomePageState extends State<NewHomePage> {
isMultiSelect: false,
),
),
),
InkWell(
onTap: () {