更新首页数据滚动效果
This commit is contained in:
@@ -103,35 +103,6 @@ class _EPageState extends State<EPage> with AutomaticKeepAliveClientMixin {
|
||||
);
|
||||
}
|
||||
|
||||
// Widget _buildLoggedInContent() {
|
||||
// return Obx(() {
|
||||
// if (finalUri.isEmpty) {
|
||||
// return Center(child: CircularProgressIndicator());
|
||||
// }
|
||||
|
||||
// return Stack(
|
||||
// children: [
|
||||
// InAppWebView(
|
||||
// initialUrlRequest: URLRequest(url: WebUri(finalUri.value)),
|
||||
// onLoadStart: (controller, url) {
|
||||
// isPageLoading.value = true;
|
||||
// },
|
||||
// onLoadStop: (controller, url) {
|
||||
// isPageLoading.value = false;
|
||||
// },
|
||||
// ),
|
||||
// ValueListenableBuilder<bool>(
|
||||
// valueListenable: isPageLoading,
|
||||
// builder: (context, isLoading, child) {
|
||||
// return isLoading
|
||||
// ? Center(child: CircularProgressIndicator())
|
||||
// : SizedBox.shrink();
|
||||
// },
|
||||
// ),
|
||||
// ],
|
||||
// );
|
||||
// });
|
||||
// }
|
||||
Widget _buildLoggedInContent() {
|
||||
return Obx(() {
|
||||
if (finalUri.isEmpty) {
|
||||
@@ -233,7 +204,7 @@ class _EPageState extends State<EPage> with AutomaticKeepAliveClientMixin {
|
||||
item['person']['name'] != null &&
|
||||
item['person']['name'].toString().trim().isNotEmpty)
|
||||
? item['person']['name'] + "_${mac}"
|
||||
: '未命名'.tr + "_${mac}";
|
||||
: '体征检测设备'.tr + "_${mac}";
|
||||
return {
|
||||
'mac': mac,
|
||||
'name': name,
|
||||
@@ -274,71 +245,4 @@ class _EPageState extends State<EPage> with AutomaticKeepAliveClientMixin {
|
||||
ef.log(e.toString());
|
||||
}
|
||||
}
|
||||
|
||||
// Future<void> getDeviceList() async {
|
||||
// try {
|
||||
// BodyDeviceController bodyDeviceController = Get.find();
|
||||
// ApiResponse apiResponse =
|
||||
// await bodyDeviceController.getDeviceList(isAllDevice: true);
|
||||
|
||||
// // 调试:打印返回的数据结构
|
||||
// print('API响应数据: $apiResponse');
|
||||
// print('API响应数据类型: ${apiResponse.data.runtimeType}');
|
||||
// print('API响应数据内容: ${apiResponse.data}');
|
||||
|
||||
// if (apiResponse.code == HttpStatusCodes.ok) {
|
||||
// List<dynamic> rawList = apiResponse.data;
|
||||
|
||||
// // 调试:检查 rawList 的类型和内容
|
||||
// print('rawList 类型: ${rawList.runtimeType}');
|
||||
// print('rawList 长度: ${rawList.length}');
|
||||
// if (rawList.isNotEmpty) {
|
||||
// print('rawList[0] 类型: ${rawList[0].runtimeType}');
|
||||
// print('rawList[0] 内容: ${rawList[0]}');
|
||||
// }
|
||||
|
||||
// // 安全处理:确保每个元素都是 Map
|
||||
// List<Map<String, dynamic>> newList =
|
||||
// rawList.whereType<Map>().map((item) {
|
||||
// // 调试每个 item
|
||||
// print('处理 item: $item');
|
||||
// print('item 类型: ${item.runtimeType}');
|
||||
|
||||
// String mac = (item['mac'] ?? '').toString();
|
||||
// String name = '未命名'.tr + "_${mac}";
|
||||
|
||||
// if (item['person'] != null && item['person'] is Map) {
|
||||
// var person = item['person'] as Map;
|
||||
// if (person['name'] != null &&
|
||||
// person['name'].toString().trim().isNotEmpty) {
|
||||
// name = '${person['name']}_${mac}';
|
||||
// }
|
||||
// }
|
||||
|
||||
// return {
|
||||
// 'mac': mac,
|
||||
// 'name': name,
|
||||
// };
|
||||
// }).toList();
|
||||
|
||||
// deviceList.value = newList;
|
||||
|
||||
// // 拼接参数 person
|
||||
// if (deviceList.isNotEmpty) {
|
||||
// // JSON 编码整个 deviceList 对象数组
|
||||
// String personParam = Uri.encodeComponent(jsonEncode(deviceList));
|
||||
// finalUri.value = "${widget.sleepUri}?person=$personParam";
|
||||
// } else {
|
||||
// finalUri.value = widget.sleepUri;
|
||||
// }
|
||||
// }
|
||||
|
||||
// // ... 后续语言处理代码不变
|
||||
// } catch (e) {
|
||||
// print('getDeviceList 错误详情: $e');
|
||||
// print('错误堆栈: ${e}');
|
||||
// ef.log(e.toString());
|
||||
// }
|
||||
// }
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user