更新
This commit is contained in:
@@ -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();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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");
|
||||
|
||||
@@ -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: () {
|
||||
|
||||
Reference in New Issue
Block a user