更新
This commit is contained in:
@@ -40,7 +40,7 @@ class DynamicReportDetailWidget extends StatelessWidget {
|
||||
child: Column(
|
||||
mainAxisSize: MainAxisSize.max,
|
||||
children: [
|
||||
_buildHeader(context),
|
||||
_buildHeader(context,targetDevice),
|
||||
SizedBox(
|
||||
height: 33.rpx,
|
||||
),
|
||||
@@ -54,21 +54,30 @@ class DynamicReportDetailWidget extends StatelessWidget {
|
||||
);
|
||||
}
|
||||
|
||||
Widget _buildHeader(BuildContext context) {
|
||||
Widget _buildHeader(BuildContext context, Map targetDevice) {
|
||||
return Container(
|
||||
width: double.infinity,
|
||||
child: Row(
|
||||
mainAxisSize: MainAxisSize.max,
|
||||
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||
children: [
|
||||
Text(
|
||||
'${targetDevice['person']?['name'] == null ? '未命名'.tr : targetDevice['person']['name']}',
|
||||
style: FlutterFlowTheme.of(context).bodyMedium.override(
|
||||
fontFamily: 'Inter',
|
||||
fontSize: 30.rpx,
|
||||
letterSpacing: 0.0,
|
||||
color: themeController.currentColor.sc3,
|
||||
),
|
||||
ClickableContainer(
|
||||
backgroundColor: Colors.transparent,
|
||||
highlightColor: themeController.currentColor.sc3.withOpacity(0.2),
|
||||
borderRadius: 0,
|
||||
padding: EdgeInsets.zero,
|
||||
onTap: () async {
|
||||
await Get.toNamed("/bodyDevice",arguments: targetDevice);
|
||||
},
|
||||
child: Text(
|
||||
'${targetDevice['person']?['name'] == null ? '未命名'.tr : targetDevice['person']['name']}',
|
||||
style: FlutterFlowTheme.of(context).bodyMedium.override(
|
||||
fontFamily: 'Inter',
|
||||
fontSize: 30.rpx,
|
||||
letterSpacing: 0.0,
|
||||
color: themeController.currentColor.sc3,
|
||||
),
|
||||
),
|
||||
),
|
||||
ClickableContainer(
|
||||
backgroundColor: Colors.transparent,
|
||||
@@ -136,16 +145,11 @@ class DynamicReportDetailWidget extends StatelessWidget {
|
||||
}
|
||||
|
||||
Widget _buildSleepDataModuleWidgets() {
|
||||
// bool hasData = sleepDataModuleWidgets.any((w) {
|
||||
// final data = w.data;
|
||||
// return data['state'] != null &&
|
||||
// data['state'].toString().trim().isNotEmpty;
|
||||
// });
|
||||
bool hasData = sleepDataModuleWidgets.length > 0;
|
||||
|
||||
if (!hasData) {
|
||||
return Container(
|
||||
height: 100.rpx,
|
||||
height: 200.rpx,
|
||||
alignment: Alignment.center,
|
||||
child: Text(
|
||||
'暂无数据'.tr,
|
||||
@@ -160,6 +164,7 @@ class DynamicReportDetailWidget extends StatelessWidget {
|
||||
|
||||
return Container(
|
||||
width: double.infinity,
|
||||
height: 200.rpx,
|
||||
child: SingleChildScrollView(
|
||||
scrollDirection: Axis.horizontal,
|
||||
child: Row(
|
||||
|
||||
@@ -63,6 +63,8 @@ class _SleepDataModuleWidgetState extends State<SleepDataModuleWidget> {
|
||||
letterSpacing: 0.0,
|
||||
color: themeController.currentColor.sc3,
|
||||
),
|
||||
maxLines: 1,
|
||||
overflow: TextOverflow.ellipsis,
|
||||
),
|
||||
Row(
|
||||
mainAxisSize: MainAxisSize.max,
|
||||
@@ -80,6 +82,8 @@ class _SleepDataModuleWidgetState extends State<SleepDataModuleWidget> {
|
||||
letterSpacing: 0.0,
|
||||
color: themeController.currentColor.sc3,
|
||||
),
|
||||
maxLines: 1,
|
||||
overflow: TextOverflow.ellipsis,
|
||||
),
|
||||
Padding(
|
||||
padding: EdgeInsetsDirectional.fromSTEB(0, 0, 0, 10.rpx),
|
||||
@@ -91,6 +95,8 @@ class _SleepDataModuleWidgetState extends State<SleepDataModuleWidget> {
|
||||
letterSpacing: 0.0,
|
||||
color: themeController.currentColor.sc3,
|
||||
),
|
||||
maxLines: 1,
|
||||
overflow: TextOverflow.ellipsis,
|
||||
),
|
||||
),
|
||||
],
|
||||
|
||||
@@ -113,11 +113,13 @@ class _SleepDateWidgetState extends State<SleepDateWidget> {
|
||||
Text(
|
||||
(widget.score?.isEmpty ?? true) ? '--' : widget.score!,
|
||||
style: FlutterFlowTheme.of(context).bodyMedium.override(
|
||||
fontFamily: 'Inter',
|
||||
fontSize: 48.rpx,
|
||||
letterSpacing: 0.0,
|
||||
color: widget.textColor ??
|
||||
themeController.currentColor.sc4),
|
||||
fontFamily: 'Inter',
|
||||
fontSize: 48.rpx,
|
||||
letterSpacing: 0.0,
|
||||
color: widget.textColor ??
|
||||
themeController.currentColor.sc4,
|
||||
fontWeight: FontWeight.bold, // 加粗
|
||||
),
|
||||
),
|
||||
if ((widget.score?.trim().isNotEmpty ?? false))
|
||||
Padding(
|
||||
|
||||
@@ -52,7 +52,7 @@ class SelectableTagButton extends StatelessWidget {
|
||||
? null
|
||||
: Border.all(
|
||||
color: themeController.currentColor.sc4,
|
||||
width: 1.rpx,
|
||||
width: 0.5.rpx,
|
||||
), // 未选中时无边框
|
||||
borderRadius: BorderRadius.circular(12.0), // 如果需要圆角
|
||||
),
|
||||
|
||||
@@ -220,7 +220,7 @@ getDeviceWifiStatus(THapp tHapp, int times) async {
|
||||
}
|
||||
}
|
||||
|
||||
Future<String> getDeviceNetVersion(THapp tHapp, int times) async {
|
||||
Future<String> getDeviceNetVersion(THapp tHapp, int times) async {
|
||||
edm.EasyDartModule.logger.info("发送请求设备的网络信息");
|
||||
DailyLogUtils.writeLog("发送请求设备的网络信息");
|
||||
print("ls /root/mnt");
|
||||
@@ -237,6 +237,8 @@ getDeviceWifiStatus(THapp tHapp, int times) async {
|
||||
netType = "wifi";
|
||||
} else if (log.contains("a76xx.json")) {
|
||||
netType = "4g";
|
||||
} else {
|
||||
netType = "unknown";
|
||||
}
|
||||
ss.over = true;
|
||||
ss.result = netType;
|
||||
|
||||
@@ -15,6 +15,8 @@ part 'device_share_list_controller.g.dart'; // 由json_serializable自动生成
|
||||
class DeviceShareListModel {
|
||||
String? key; //关键字搜索
|
||||
int? all = 0; //是否全选 0:不全选 1:全选
|
||||
String? accountKey = 'uid';//账户key
|
||||
|
||||
DeviceShareListModel();
|
||||
|
||||
// 从JSON反序列化时的异常处理
|
||||
@@ -50,17 +52,17 @@ class DeviceShareListController extends GetControllerEx<DeviceShareListModel> {
|
||||
String serviceApi = ServiceConstant.device_share;
|
||||
String queryUrl = "${serviceAddress}${serviceName}${serviceApi}"
|
||||
"${key != null ? '?key=$key&' : '?'}mac=$mac";
|
||||
String? language = "";
|
||||
if (languageController.selectLanguage != null) {
|
||||
language = languageController.selectLanguage.value!.language_code;
|
||||
}
|
||||
if (language != null && language.isNotEmpty) {
|
||||
if (queryUrl.contains("?")) {
|
||||
queryUrl += "&lang=$language";
|
||||
} else {
|
||||
queryUrl += "?lang=$language";
|
||||
}
|
||||
String? language = "";
|
||||
if (languageController.selectLanguage != null) {
|
||||
language = languageController.selectLanguage.value!.language_code;
|
||||
}
|
||||
if (language != null && language.isNotEmpty) {
|
||||
if (queryUrl.contains("?")) {
|
||||
queryUrl += "&lang=$language";
|
||||
} else {
|
||||
queryUrl += "?lang=$language";
|
||||
}
|
||||
}
|
||||
var response = await EasyDartModule.dio.get(queryUrl);
|
||||
if (response != null) {
|
||||
var responseData =
|
||||
@@ -95,16 +97,16 @@ String? language = "";
|
||||
String serviceApi = ServiceConstant.share_deleted;
|
||||
String queryUrl = "${serviceAddress}${serviceName}${serviceApi}";
|
||||
String? language = "";
|
||||
if (languageController.selectLanguage != null) {
|
||||
language = languageController.selectLanguage.value!.language_code;
|
||||
}
|
||||
if (language != null && language.isNotEmpty) {
|
||||
if (queryUrl.contains("?")) {
|
||||
queryUrl += "&lang=$language";
|
||||
} else {
|
||||
queryUrl += "?lang=$language";
|
||||
}
|
||||
if (languageController.selectLanguage != null) {
|
||||
language = languageController.selectLanguage.value!.language_code;
|
||||
}
|
||||
if (language != null && language.isNotEmpty) {
|
||||
if (queryUrl.contains("?")) {
|
||||
queryUrl += "&lang=$language";
|
||||
} else {
|
||||
queryUrl += "?lang=$language";
|
||||
}
|
||||
}
|
||||
final data = {
|
||||
"mac": "",
|
||||
};
|
||||
|
||||
@@ -38,13 +38,13 @@ class PersonController extends GetControllerEx<PersonModel> {
|
||||
attr = GetModel(PersonModel()).obs;
|
||||
}
|
||||
RxList selectedDiseaseIds = [].obs;
|
||||
|
||||
|
||||
RxString currentPersonId = "".obs;
|
||||
RxString name = "".obs;
|
||||
RxInt gender = 1.obs;
|
||||
RxString birthday = "".obs;
|
||||
RxInt weight = 65.obs;
|
||||
RxInt height = 175.obs;
|
||||
RxString weight = "".obs;
|
||||
RxString height = "".obs;
|
||||
DateTime? dateTime = DateTime.now(); //选择时间
|
||||
RxList diseaseList = [].obs;
|
||||
|
||||
@@ -70,15 +70,15 @@ class PersonController extends GetControllerEx<PersonModel> {
|
||||
apiResponse.msg = "请输入姓名".tr;
|
||||
return apiResponse;
|
||||
}
|
||||
// if (birthday.value.isEmpty) {
|
||||
// apiResponse.msg = "请选择生日".tr;
|
||||
// return apiResponse;
|
||||
// }
|
||||
if (weight.value == 0) {
|
||||
if (birthday.value.isEmpty) {
|
||||
apiResponse.msg = "请选择生日".tr;
|
||||
return apiResponse;
|
||||
}
|
||||
if (weight == null || weight.value.isEmpty) {
|
||||
apiResponse.msg = "请输入体重".tr;
|
||||
return apiResponse;
|
||||
}
|
||||
if (height.value == 0) {
|
||||
if (height == null || height.value.isEmpty) {
|
||||
apiResponse.msg = "请输入身高".tr;
|
||||
return apiResponse;
|
||||
}
|
||||
@@ -90,7 +90,7 @@ class PersonController extends GetControllerEx<PersonModel> {
|
||||
"birthday": (birthday.value == null || birthday.value!.isEmpty)
|
||||
? MyUtils.formatBindTime(dateTime!)
|
||||
: birthday.value,
|
||||
"weight": weight.value,
|
||||
"weight": weight!.value,
|
||||
"height": height.value,
|
||||
"disease": selectedDiseaseIds.value,
|
||||
};
|
||||
|
||||
@@ -76,7 +76,7 @@ class RepairController extends GetControllerEx<RepairModel> {
|
||||
}
|
||||
}
|
||||
var formData = dio.FormData.fromMap({
|
||||
"type": 1,
|
||||
"type": 2,
|
||||
"file": await dio.MultipartFile.fromFile(
|
||||
image.path, // 确保 image 是 File 类型
|
||||
filename: image.path.split('/').last,
|
||||
@@ -105,4 +105,75 @@ class RepairController extends GetControllerEx<RepairModel> {
|
||||
return ApiResponse(code: -1, msg: "服务器.失败".tr);
|
||||
}
|
||||
}
|
||||
|
||||
// Future<ApiResponse> uploadImg() async {
|
||||
// EasyDartModule.logger.info("请求上传媒体文件");
|
||||
// DailyLogUtils.writeLog("请求上传媒体文件");
|
||||
// final ImagePicker picker = ImagePicker();
|
||||
// final XFile? file = await picker.pickMedia(); // ✅ 支持图片或视频
|
||||
|
||||
// try {
|
||||
// ApiResponse apiResponse = ApiResponse(code: -1, msg: "我的.媒体上传失败".tr);
|
||||
// if (file == null) {
|
||||
// apiResponse.msg = "我的.未选择文件".tr;
|
||||
// return apiResponse;
|
||||
// }
|
||||
|
||||
// final String filePath = file.path;
|
||||
// final String fileName = filePath.split('/').last;
|
||||
// final int fileSize = await file.length();
|
||||
|
||||
// final isImage = filePath.endsWith(".jpg") ||
|
||||
// filePath.endsWith(".jpeg") ||
|
||||
// filePath.endsWith(".png") ||
|
||||
// filePath.endsWith(".gif");
|
||||
// final isVideo = filePath.endsWith(".mp4") ||
|
||||
// filePath.endsWith(".mov") ||
|
||||
// filePath.endsWith(".avi") ||
|
||||
// filePath.endsWith(".mkv");
|
||||
|
||||
// // 限制大小
|
||||
// if (isImage && fileSize > 1048576 * 5) {
|
||||
// apiResponse.msg = "上传限制(图片最大5MB)".tr;
|
||||
// return apiResponse;
|
||||
// } else if (isVideo && fileSize > 1048576 * 50) {
|
||||
// apiResponse.msg = "上传限制(视频最大50MB)".tr;
|
||||
// return apiResponse;
|
||||
// }
|
||||
|
||||
// // 构建上传地址
|
||||
// String queryUrl =
|
||||
// "${ServiceConstant.service_address}${ServiceConstant.server_service}${ServiceConstant.upload_file}";
|
||||
// String? language =
|
||||
// languageController.selectLanguage?.value?.language_code;
|
||||
// if (language != null && language.isNotEmpty) {
|
||||
// queryUrl +=
|
||||
// queryUrl.contains("?") ? "&lang=$language" : "?lang=$language";
|
||||
// }
|
||||
|
||||
// // 构建 formData
|
||||
// var formData = dio.FormData.fromMap({
|
||||
// "type": 2,
|
||||
// "file": await dio.MultipartFile.fromFile(filePath, filename: fileName),
|
||||
// });
|
||||
|
||||
// var response = await EasyDartModule.dio.post(queryUrl, data: formData);
|
||||
// if (response != null) {
|
||||
// var responseData =
|
||||
// response.data is String ? jsonDecode(response.data) : response.data;
|
||||
// ApiResponse res =
|
||||
// ApiResponse.fromJson(responseData, (object) => object);
|
||||
// MyUtils.formatResponse(res, "我的.上传成功".tr, "我的.媒体上传失败".tr);
|
||||
// updateAll();
|
||||
// return res;
|
||||
// } else {
|
||||
// return ApiResponse(code: -1, msg: "服务器.失败".tr);
|
||||
// }
|
||||
// } catch (e) {
|
||||
// EasyDartModule.logger.error("上传媒体失败->$e");
|
||||
// DailyLogUtils.writeError("上传媒体失败->$e");
|
||||
// return ApiResponse(code: -1, msg: "服务器.失败".tr);
|
||||
// }
|
||||
// }
|
||||
|
||||
}
|
||||
|
||||
@@ -307,6 +307,7 @@ class WeatherModelController extends GetControllerEx<WeatherModel> {
|
||||
// 获取天气信息
|
||||
Future<void> _getCurrentWeather() async {
|
||||
if (model.latitude == null || model.longitude == null) {
|
||||
EasyDartModule.logger.error("获取天气失败:位置数据获取失败");
|
||||
return; // 如果位置数据没有获取到,则不更新天气
|
||||
}
|
||||
String? language = "zh_CN";
|
||||
@@ -341,14 +342,13 @@ class WeatherModelController extends GetControllerEx<WeatherModel> {
|
||||
model.current_temperature = weather.temperature?.celsius?.toInt();
|
||||
model.wind_speed = weather.windSpeed?.toInt();
|
||||
model.weatherIcon = weather.weatherIcon;
|
||||
|
||||
if (model.weatherIcon != null) {
|
||||
model.weatherIconurl =
|
||||
"https://openweathermap.org/img/w/${model.weatherIcon}.png";
|
||||
}
|
||||
|
||||
updateAll(); // 更新 UI
|
||||
} catch (e) {
|
||||
EasyDartModule.logger.error("获取天气失败: $e");
|
||||
print('获取天气失败: $e');
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
import 'dart:async';
|
||||
|
||||
import 'package:ef/ef.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_svg/svg.dart';
|
||||
@@ -18,7 +17,8 @@ import 'package:vbvs_app/controller/theme_controller/ThemeController.dart';
|
||||
import 'package:vbvs_app/pages/device/component/DeviceDataComponentWidget.dart';
|
||||
|
||||
class BodyDeviceWidget extends StatefulWidget {
|
||||
const BodyDeviceWidget({super.key});
|
||||
var type;
|
||||
BodyDeviceWidget({super.key, required this.type});
|
||||
|
||||
@override
|
||||
State<BodyDeviceWidget> createState() => _BodyDevicePageState();
|
||||
@@ -29,6 +29,7 @@ class _BodyDevicePageState extends State<BodyDeviceWidget> {
|
||||
final BodyDeviceController bodyDeviceController = Get.find();
|
||||
HomeController homeController = Get.find();
|
||||
final GlobalKey addIconKey = GlobalKey();
|
||||
final ScrollController _scrollController = ScrollController();
|
||||
OverlayEntry? _popupEntry;
|
||||
Timer? _timer;
|
||||
|
||||
@@ -36,7 +37,6 @@ class _BodyDevicePageState extends State<BodyDeviceWidget> {
|
||||
final renderBox =
|
||||
addIconKey.currentContext?.findRenderObject() as RenderBox?;
|
||||
if (renderBox == null) return;
|
||||
|
||||
final position = renderBox.localToGlobal(Offset.zero);
|
||||
final size = renderBox.size;
|
||||
double popupWidth = 190.rpx;
|
||||
@@ -44,7 +44,7 @@ class _BodyDevicePageState extends State<BodyDeviceWidget> {
|
||||
// 移除之前的弹窗
|
||||
_popupEntry?.remove();
|
||||
|
||||
// 创建新的 OverlayEntry
|
||||
// 创建新的OverlayEntry
|
||||
_popupEntry = OverlayEntry(
|
||||
builder: (context) => Stack(
|
||||
children: [
|
||||
@@ -54,7 +54,6 @@ class _BodyDevicePageState extends State<BodyDeviceWidget> {
|
||||
color: Colors.transparent,
|
||||
onDismiss: _hidePopup,
|
||||
),
|
||||
|
||||
// 弹窗内容
|
||||
Positioned(
|
||||
top: position.dy + size.height + 26.rpx,
|
||||
@@ -143,7 +142,7 @@ class _BodyDevicePageState extends State<BodyDeviceWidget> {
|
||||
),
|
||||
);
|
||||
|
||||
// 插入新的 OverlayEntry
|
||||
// 插入新的OverlayEntry
|
||||
Overlay.of(context)!.insert(_popupEntry!);
|
||||
}
|
||||
|
||||
@@ -156,17 +155,39 @@ class _BodyDevicePageState extends State<BodyDeviceWidget> {
|
||||
void initState() {
|
||||
bodyDeviceController.keyWord.value = "";
|
||||
super.initState();
|
||||
// 初次请求一次
|
||||
_fetchDeviceList();
|
||||
|
||||
// 每 5 秒定时请求一次
|
||||
// 处理传入的type参数
|
||||
if (widget.type != null && widget.type is Map) {
|
||||
final bindType = widget.type['bind_type'];
|
||||
final mac = widget.type['mac'];
|
||||
|
||||
if (bindType != null) {
|
||||
bodyDeviceController.model.type = bindType;
|
||||
homeController.model.type = bindType;
|
||||
}
|
||||
|
||||
// 初次请求设备列表
|
||||
_fetchDeviceList().then((_) {
|
||||
if (mac != null) {
|
||||
// 延迟执行以确保列表已渲染
|
||||
WidgetsBinding.instance.addPostFrameCallback((_) {
|
||||
_scrollToDeviceWithMac(mac);
|
||||
});
|
||||
}
|
||||
});
|
||||
} else {
|
||||
// 没有传入type时的默认逻辑
|
||||
_fetchDeviceList();
|
||||
}
|
||||
|
||||
// 每5秒定时请求一次
|
||||
_timer = Timer.periodic(Duration(seconds: 5), (timer) {
|
||||
_fetchDeviceList();
|
||||
});
|
||||
}
|
||||
|
||||
void _fetchDeviceList() {
|
||||
bodyDeviceController.getDeviceList().then((apiResponse) {
|
||||
Future<void> _fetchDeviceList() async {
|
||||
await bodyDeviceController.getDeviceList().then((apiResponse) {
|
||||
if (apiResponse.code != HttpStatusCodes.ok) {
|
||||
TopSlideNotification.show(
|
||||
Get.context!,
|
||||
@@ -177,9 +198,32 @@ class _BodyDevicePageState extends State<BodyDeviceWidget> {
|
||||
});
|
||||
}
|
||||
|
||||
void _scrollToDeviceWithMac(String mac) {
|
||||
final deviceList = bodyDeviceController.deviceList.value;
|
||||
final index = deviceList.indexWhere((device) => device['mac'] == mac);
|
||||
|
||||
if (index != -1 && _scrollController.hasClients) {
|
||||
// 动态计算高度:最小为 501.rpx,最大为 26.6% 屏幕高度
|
||||
final screenHeight = MediaQuery.of(Get.context!).size.height;
|
||||
final dynamicItemHeight = (screenHeight * 0.266).rpx;
|
||||
final itemHeight =
|
||||
dynamicItemHeight < 501.rpx ? 501.rpx : dynamicItemHeight;
|
||||
|
||||
final spacing = 25.rpx;
|
||||
final targetPosition = index * (itemHeight + spacing);
|
||||
|
||||
_scrollController.animateTo(
|
||||
targetPosition,
|
||||
duration: const Duration(milliseconds: 500),
|
||||
curve: Curves.easeInOut,
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
@override
|
||||
void dispose() {
|
||||
_timer?.cancel(); // 页面销毁时取消定时器
|
||||
_scrollController.dispose();
|
||||
super.dispose();
|
||||
}
|
||||
|
||||
@@ -189,16 +233,14 @@ class _BodyDevicePageState extends State<BodyDeviceWidget> {
|
||||
builder: (context, bodysize) => GestureDetector(
|
||||
onTap: () => FocusScope.of(context).unfocus(),
|
||||
child: Container(
|
||||
// width: bodysize.maxWidth,
|
||||
// height: bodysize.maxHeight * 1,
|
||||
decoration: BoxDecoration(
|
||||
image: DecorationImage(
|
||||
image: AssetImage('assets/img/bgNoImg.png'), // 本地图片
|
||||
fit: BoxFit.fill, // 填满整个 Container
|
||||
image: AssetImage('assets/img/bgNoImg.png'),
|
||||
fit: BoxFit.fill,
|
||||
),
|
||||
),
|
||||
child: Scaffold(
|
||||
backgroundColor: Colors.transparent, // 加上这一行
|
||||
backgroundColor: Colors.transparent,
|
||||
appBar: AppBar(
|
||||
backgroundColor: themeController.currentColor.sc17,
|
||||
automaticallyImplyLeading: false,
|
||||
@@ -216,7 +258,7 @@ class _BodyDevicePageState extends State<BodyDeviceWidget> {
|
||||
Text(
|
||||
'体征检测设备.标题'.tr,
|
||||
style: TextStyle(
|
||||
fontFamily: 'Readex Pro',
|
||||
fontFamily: 'ReadexPro',
|
||||
color: themeController.currentColor.sc3,
|
||||
letterSpacing: 0,
|
||||
fontSize: 30.rpx,
|
||||
@@ -224,7 +266,6 @@ class _BodyDevicePageState extends State<BodyDeviceWidget> {
|
||||
),
|
||||
Positioned(
|
||||
left: 0,
|
||||
// child: returnIconButtom,
|
||||
child: returnIconButtomAddCallback(() {
|
||||
bodyDeviceController.getDeviceNum();
|
||||
bodyDeviceController.getDeviceList();
|
||||
@@ -316,10 +357,8 @@ class _BodyDevicePageState extends State<BodyDeviceWidget> {
|
||||
mainAxisSize: MainAxisSize.max,
|
||||
children: [
|
||||
Container(
|
||||
width:
|
||||
160.rpx, // 固定宽度为 160.rpx
|
||||
alignment:
|
||||
Alignment.center, // 文字居中
|
||||
width: 160.rpx,
|
||||
alignment: Alignment.center,
|
||||
child: Text(
|
||||
'体征检测设备.我的e护'.tr,
|
||||
style: FlutterFlowTheme.of(
|
||||
@@ -372,10 +411,8 @@ class _BodyDevicePageState extends State<BodyDeviceWidget> {
|
||||
mainAxisSize: MainAxisSize.max,
|
||||
children: [
|
||||
Container(
|
||||
width:
|
||||
160.rpx, // 固定宽度为 160.rpx
|
||||
alignment:
|
||||
Alignment.center, // 文字居中
|
||||
width: 160.rpx,
|
||||
alignment: Alignment.center,
|
||||
child: Text(
|
||||
'体征检测设备.云关爱'.tr,
|
||||
style: FlutterFlowTheme.of(
|
||||
@@ -407,19 +444,18 @@ class _BodyDevicePageState extends State<BodyDeviceWidget> {
|
||||
],
|
||||
),
|
||||
Obx(() {
|
||||
// 横线宽度固定为 160.rpx
|
||||
// 横线宽度固定为160.rpx
|
||||
double lineWidth = 160.rpx;
|
||||
|
||||
return AnimatedPositioned(
|
||||
duration: Duration(milliseconds: 300),
|
||||
curve: Curves.easeInOut,
|
||||
bottom: 0,
|
||||
left: bodyDeviceController.model.type ==
|
||||
1
|
||||
? 0
|
||||
: 160.rpx, // 第二个按钮横线从 160.rpx 开始
|
||||
left:
|
||||
bodyDeviceController.model.type == 1
|
||||
? 0
|
||||
: 160.rpx,
|
||||
child: Container(
|
||||
width: lineWidth, // 横线宽度固定为 160.rpx
|
||||
width: lineWidth,
|
||||
height: 4.rpx,
|
||||
decoration: BoxDecoration(
|
||||
color: themeController
|
||||
@@ -482,12 +518,12 @@ class _BodyDevicePageState extends State<BodyDeviceWidget> {
|
||||
.of(context)
|
||||
.labelMedium
|
||||
.override(
|
||||
fontFamily: 'Inter',
|
||||
fontSize: 26.rpx,
|
||||
letterSpacing: 0.0,
|
||||
color: themeController
|
||||
.currentColor
|
||||
.sc4),
|
||||
fontFamily: 'Inter',
|
||||
fontSize: 26.rpx,
|
||||
letterSpacing: 0.0,
|
||||
color: themeController
|
||||
.currentColor.sc4,
|
||||
),
|
||||
enabledBorder:
|
||||
OutlineInputBorder(
|
||||
borderSide: BorderSide(
|
||||
@@ -625,6 +661,7 @@ class _BodyDevicePageState extends State<BodyDeviceWidget> {
|
||||
padding: EdgeInsetsDirectional.fromSTEB(
|
||||
30.rpx, 26.rpx, 30.rpx, 0),
|
||||
child: SingleChildScrollView(
|
||||
controller: _scrollController,
|
||||
child: Column(
|
||||
mainAxisSize: MainAxisSize.max,
|
||||
children: bodyDeviceController
|
||||
@@ -653,7 +690,7 @@ class _BodyDevicePageState extends State<BodyDeviceWidget> {
|
||||
Widget _buildDeviceCard(BuildContext context,
|
||||
{required String title, required String imageUrl, required String type}) {
|
||||
return CustomCard(
|
||||
borderRadius: 20.rpx, // 圆角大小
|
||||
borderRadius: 20.rpx,
|
||||
onTap: () {
|
||||
if (type != null) {
|
||||
if (type == '1') {
|
||||
@@ -661,7 +698,7 @@ class _BodyDevicePageState extends State<BodyDeviceWidget> {
|
||||
}
|
||||
}
|
||||
},
|
||||
colors: [themeController.currentColor.sc17], // 背景色
|
||||
colors: [themeController.currentColor.sc17],
|
||||
child: Container(
|
||||
width: double.infinity,
|
||||
height: MediaQuery.sizeOf(context).height * 0.135,
|
||||
|
||||
@@ -97,7 +97,7 @@ class _DeviceDataComponentWidgetState extends State<DeviceDataComponentWidget> {
|
||||
final menuWidth = _calculateMaxMenuItemWidth(allTexts, textStyle);
|
||||
popupWidth = menuWidth;
|
||||
// 计算弹窗需要的实际高度(估算)
|
||||
final estimatedItemHeight = 60.rpx; // 每个菜单项的估算高度
|
||||
final estimatedItemHeight = 66.rpx; // 每个菜单项的估算高度
|
||||
//todo 更新菜单项,需要在此添加数量
|
||||
final itemCount =
|
||||
widget.device['bind_type'] == BindType.active.code ? 9 : 5;
|
||||
@@ -210,7 +210,9 @@ class _DeviceDataComponentWidgetState extends State<DeviceDataComponentWidget> {
|
||||
// ),
|
||||
child: Column(
|
||||
mainAxisSize: MainAxisSize.min,
|
||||
children: _buildMenuItems(),
|
||||
children: _buildMenuItems().divide(SizedBox(
|
||||
height: 6.rpx,
|
||||
)),
|
||||
),
|
||||
);
|
||||
|
||||
@@ -228,7 +230,9 @@ class _DeviceDataComponentWidgetState extends State<DeviceDataComponentWidget> {
|
||||
|
||||
// 构建共享设备的菜单项
|
||||
Widget _buildSharedDeviceContent(Widget content) {
|
||||
return content;
|
||||
return IntrinsicWidth(
|
||||
child: content,
|
||||
);
|
||||
}
|
||||
|
||||
// 构建菜单项列表
|
||||
@@ -299,7 +303,8 @@ class _DeviceDataComponentWidgetState extends State<DeviceDataComponentWidget> {
|
||||
_popupEntry?.remove();
|
||||
_popupEntry = null;
|
||||
BlueteethBindController blueteethBindController = Get.find();
|
||||
blueteethBindController.currentDeviceMac?.value = widget.device['mac'];
|
||||
blueteethBindController.currentDeviceMac?.value =
|
||||
widget.device['mac'];
|
||||
Get.toNamed("/calibrationPage", arguments: 2);
|
||||
},
|
||||
),
|
||||
@@ -342,7 +347,9 @@ class _DeviceDataComponentWidgetState extends State<DeviceDataComponentWidget> {
|
||||
},
|
||||
),
|
||||
_buildMenuItem(
|
||||
text: "体征检测设备.删除".tr,
|
||||
text: widget.device['bind_type'] == BindType.active.code
|
||||
? "解绑".tr
|
||||
: "删除".tr,
|
||||
onTap: () {
|
||||
setState(() {
|
||||
_isPopupOpen = false;
|
||||
@@ -745,13 +752,15 @@ class _DeviceDataComponentWidgetState extends State<DeviceDataComponentWidget> {
|
||||
),
|
||||
),
|
||||
Text(
|
||||
'uusne12',
|
||||
(widget.device['source']?.toString().isEmpty ?? true)
|
||||
? '未知数据'.tr
|
||||
: widget.device['source'].toString(),
|
||||
style:
|
||||
FlutterFlowTheme.of(context).bodyMedium.override(
|
||||
fontFamily: 'Inter',
|
||||
fontSize: 26.rpx,
|
||||
letterSpacing: 0.0,
|
||||
color: themeController.currentColor.sc4,
|
||||
color: themeController.currentColor.sc3,
|
||||
),
|
||||
),
|
||||
].divide(SizedBox(width: 34.rpx)),
|
||||
@@ -798,7 +807,9 @@ class _DeviceDataComponentWidgetState extends State<DeviceDataComponentWidget> {
|
||||
mainAxisSize: MainAxisSize.max,
|
||||
children: [
|
||||
if (widget.device['status']['signal'] != null &&
|
||||
widget.device['status']['signal'] != -1)
|
||||
widget.device['status']['signal'] != -1 &&
|
||||
widget.device['status']['status'] != null &&
|
||||
widget.device['status']['status'] == 1)
|
||||
ClickableContainer(
|
||||
backgroundColor: Colors.transparent,
|
||||
highlightColor: Colors.grey, // 或根据你主题定制颜色
|
||||
@@ -842,7 +853,9 @@ class _DeviceDataComponentWidgetState extends State<DeviceDataComponentWidget> {
|
||||
fit: BoxFit.fill,
|
||||
),
|
||||
),
|
||||
if (widget.device['status']['inBed'] != null)
|
||||
if (widget.device['status']['inBed'] != null &&
|
||||
widget.device['status']['status'] != null &&
|
||||
widget.device['status']['status'] == 1)
|
||||
ClickableContainer(
|
||||
backgroundColor: Colors.transparent,
|
||||
highlightColor: Colors.grey, // 可根据需要更换颜色
|
||||
@@ -889,7 +902,9 @@ class _DeviceDataComponentWidgetState extends State<DeviceDataComponentWidget> {
|
||||
),
|
||||
),
|
||||
),
|
||||
if (widget.device['status']['failure'] != 0)
|
||||
if (widget.device['status']['failure'] != 0 &&
|
||||
widget.device['status']['status'] != null &&
|
||||
widget.device['status']['status'] == 1)
|
||||
ClickableContainer(
|
||||
backgroundColor: Colors.transparent,
|
||||
highlightColor: Colors.grey, // 可自定义点击水波纹颜色
|
||||
@@ -934,7 +949,9 @@ class _DeviceDataComponentWidgetState extends State<DeviceDataComponentWidget> {
|
||||
),
|
||||
),
|
||||
),
|
||||
if (widget.device['status']['upgrade'] != 0)
|
||||
if (widget.device['status']['upgrade'] != 0 &&
|
||||
widget.device['status']['status'] != null &&
|
||||
widget.device['status']['status'] == 1)
|
||||
ClickableContainer(
|
||||
backgroundColor: Colors.transparent,
|
||||
highlightColor: Colors.grey, // 可自定义点击效果颜色
|
||||
@@ -954,7 +971,8 @@ class _DeviceDataComponentWidgetState extends State<DeviceDataComponentWidget> {
|
||||
),
|
||||
),
|
||||
),
|
||||
if (widget.device['status']['status'] != null)
|
||||
if (widget.device['status']['status'] != null &&
|
||||
widget.device['status']['status'] == 0)
|
||||
ClickableContainer(
|
||||
backgroundColor: Colors.transparent,
|
||||
highlightColor: Colors.grey, // 可替换为点击高亮色
|
||||
@@ -997,9 +1015,10 @@ class _DeviceDataComponentWidgetState extends State<DeviceDataComponentWidget> {
|
||||
width: 27.rpx,
|
||||
height: 27.rpx,
|
||||
child: SvgPicture.asset(
|
||||
widget.device['status']['status'] == 1
|
||||
? 'assets/img/icon/device_online.svg'
|
||||
: 'assets/img/icon/device_offline.svg',
|
||||
// widget.device['status']['status'] == 1
|
||||
// ? 'assets/img/icon/device_online.svg'
|
||||
// : 'assets/img/icon/device_offline.svg',
|
||||
'assets/img/icon/device_issue.svg',
|
||||
fit: BoxFit.cover,
|
||||
),
|
||||
),
|
||||
@@ -1017,44 +1036,92 @@ class _DeviceDataComponentWidgetState extends State<DeviceDataComponentWidget> {
|
||||
Row(
|
||||
mainAxisAlignment: MainAxisAlignment.spaceAround,
|
||||
children: [
|
||||
CustomCard(
|
||||
borderRadius: AppConstants().button_container_radius,
|
||||
onTap: () async {
|
||||
// personController.currentPersonId = widget.device
|
||||
if (widget.device['person'] != null) {
|
||||
personController.currentPersonId.value =
|
||||
widget.device['_id'];
|
||||
personController.name.value =
|
||||
widget.device['person']['name'];
|
||||
personController.gender.value =
|
||||
widget.device['person']['gender'] ?? 1;
|
||||
personController.weight.value =
|
||||
widget.device['person']['weight'] ?? 0;
|
||||
personController.height.value =
|
||||
widget.device['person']['height'] ?? 0;
|
||||
personController.selectedDiseaseIds.value =
|
||||
widget.device['person']['disease'] ?? [];
|
||||
personController.birthday.value =
|
||||
widget.device['person']['birthday'] ?? '';
|
||||
personController.dateTime = MyUtils.formatBirthdayTime(
|
||||
widget.device['person']['birthday']);
|
||||
} else {
|
||||
personController.currentPersonId.value =
|
||||
widget.device['_id'];
|
||||
}
|
||||
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),
|
||||
Expanded(
|
||||
// 使用 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.gender.value =
|
||||
widget.device['person']['gender'] ?? 1;
|
||||
personController.weight?.value =
|
||||
widget.device['person']['weight'].toString() ??
|
||||
"";
|
||||
personController.height.value =
|
||||
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.currentPersonId.value =
|
||||
widget.device['_id'];
|
||||
}
|
||||
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: FlutterFlowTheme.of(context)
|
||||
.bodyMedium
|
||||
.override(
|
||||
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: () {
|
||||
Get.toNamed("/instantBodyPage",
|
||||
arguments: widget.device);
|
||||
},
|
||||
colors: [
|
||||
themeController.currentColor.sc1,
|
||||
themeController.currentColor.sc2,
|
||||
],
|
||||
child: Container(
|
||||
width: MediaQuery.sizeOf(context).width * 0.19,
|
||||
alignment: Alignment.center,
|
||||
height: MediaQuery.sizeOf(context).height * 0.0037,
|
||||
constraints: BoxConstraints(
|
||||
minWidth: 143.rpx,
|
||||
@@ -1063,10 +1130,9 @@ class _DeviceDataComponentWidgetState extends State<DeviceDataComponentWidget> {
|
||||
child: Row(
|
||||
mainAxisSize: MainAxisSize.max,
|
||||
mainAxisAlignment: MainAxisAlignment.center,
|
||||
crossAxisAlignment: CrossAxisAlignment.center,
|
||||
children: [
|
||||
Text(
|
||||
"体征检测设备.人员资料".tr,
|
||||
"体征检测设备.实时体征".tr,
|
||||
style: FlutterFlowTheme.of(context)
|
||||
.bodyMedium
|
||||
.override(
|
||||
@@ -1082,112 +1148,104 @@ class _DeviceDataComponentWidgetState extends State<DeviceDataComponentWidget> {
|
||||
),
|
||||
),
|
||||
),
|
||||
CustomCard(
|
||||
borderRadius: AppConstants().button_container_radius,
|
||||
onTap: () {
|
||||
Get.toNamed("/instantBodyPage", arguments: widget.device);
|
||||
},
|
||||
colors: [
|
||||
themeController.currentColor.sc1,
|
||||
themeController.currentColor.sc2,
|
||||
],
|
||||
child: Container(
|
||||
width: MediaQuery.sizeOf(context).width * 0.19,
|
||||
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: FlutterFlowTheme.of(context)
|
||||
.bodyMedium
|
||||
.override(
|
||||
color: themeController.currentColor.sc3,
|
||||
fontFamily: 'Inter',
|
||||
fontSize: AppConstants().normal_text_fontSize,
|
||||
letterSpacing: 0.0,
|
||||
),
|
||||
],
|
||||
),
|
||||
SizedBox(
|
||||
height: 20.rpx,
|
||||
),
|
||||
Row(
|
||||
mainAxisAlignment: MainAxisAlignment.spaceAround,
|
||||
children: [
|
||||
Expanded(
|
||||
// 使用 Expanded 来占据屏幕宽度的一半
|
||||
child: CustomCard(
|
||||
borderRadius: AppConstants().button_container_radius,
|
||||
onTap: () {
|
||||
TopSlideNotification.show(context, text: "待开发功能".tr);
|
||||
},
|
||||
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,
|
||||
),
|
||||
].divide(SizedBox(width: 17.rpx)),
|
||||
child: Row(
|
||||
mainAxisSize: MainAxisSize.max,
|
||||
mainAxisAlignment: MainAxisAlignment.center,
|
||||
children: [
|
||||
Text(
|
||||
"体征检测设备.消息回看".tr,
|
||||
style: FlutterFlowTheme.of(context)
|
||||
.bodyMedium
|
||||
.override(
|
||||
color: themeController.currentColor.sc3,
|
||||
fontFamily: 'Inter',
|
||||
fontSize:
|
||||
AppConstants().normal_text_fontSize,
|
||||
letterSpacing: 0.0,
|
||||
),
|
||||
),
|
||||
].divide(SizedBox(width: 17.rpx)),
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
CustomCard(
|
||||
borderRadius: AppConstants().button_container_radius,
|
||||
onTap: () {
|
||||
TopSlideNotification.show(context, text: "待开发功能".tr);
|
||||
},
|
||||
colors: [
|
||||
themeController.currentColor.sc1,
|
||||
themeController.currentColor.sc2,
|
||||
],
|
||||
child: Container(
|
||||
width: MediaQuery.sizeOf(context).width * 0.19,
|
||||
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: FlutterFlowTheme.of(context)
|
||||
.bodyMedium
|
||||
.override(
|
||||
color: themeController.currentColor.sc3,
|
||||
fontFamily: 'Inter',
|
||||
fontSize: AppConstants().normal_text_fontSize,
|
||||
letterSpacing: 0.0,
|
||||
),
|
||||
),
|
||||
].divide(SizedBox(width: 17.rpx)),
|
||||
),
|
||||
),
|
||||
SizedBox(
|
||||
width: 20.rpx,
|
||||
),
|
||||
CustomCard(
|
||||
borderRadius: AppConstants().button_container_radius,
|
||||
onTap: () {
|
||||
String mac = widget.device['mac'];
|
||||
String sleepReportUrl =
|
||||
"${ServiceConstant.sleep_report_url}?mac=${mac}&token=${ServiceConstant.sleep_token}";
|
||||
Get.toNamed("/sleepReportPage",
|
||||
arguments: sleepReportUrl);
|
||||
},
|
||||
colors: [
|
||||
themeController.currentColor.sc1,
|
||||
themeController.currentColor.sc2,
|
||||
],
|
||||
child: Container(
|
||||
width: MediaQuery.sizeOf(context).width * 0.19,
|
||||
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: FlutterFlowTheme.of(context)
|
||||
.bodyMedium
|
||||
.override(
|
||||
color: themeController.currentColor.sc3,
|
||||
fontFamily: 'Inter',
|
||||
fontSize: AppConstants().normal_text_fontSize,
|
||||
letterSpacing: 0.0,
|
||||
),
|
||||
Expanded(
|
||||
// 使用 Expanded 来占据屏幕宽度的一半
|
||||
child: CustomCard(
|
||||
borderRadius: AppConstants().button_container_radius,
|
||||
onTap: () {
|
||||
String mac = widget.device['mac'];
|
||||
String sleepReportUrl =
|
||||
"${ServiceConstant.sleep_report_url}?mac=${mac}&token=${ServiceConstant.sleep_token}";
|
||||
Get.toNamed("/sleepReportPage",
|
||||
arguments: sleepReportUrl);
|
||||
},
|
||||
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,
|
||||
),
|
||||
].divide(SizedBox(width: 17.rpx)),
|
||||
child: Row(
|
||||
mainAxisSize: MainAxisSize.max,
|
||||
mainAxisAlignment: MainAxisAlignment.center,
|
||||
children: [
|
||||
Text(
|
||||
"体征检测设备.健康报告".tr,
|
||||
style: FlutterFlowTheme.of(context)
|
||||
.bodyMedium
|
||||
.override(
|
||||
color: themeController.currentColor.sc3,
|
||||
fontFamily: 'Inter',
|
||||
fontSize:
|
||||
AppConstants().normal_text_fontSize,
|
||||
letterSpacing: 0.0,
|
||||
),
|
||||
),
|
||||
].divide(SizedBox(width: 17.rpx)),
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
|
||||
@@ -173,354 +173,375 @@ class _InstantBodyPageState extends State<InstantBodyPage> {
|
||||
),
|
||||
body: SafeArea(
|
||||
top: true,
|
||||
child: Padding(
|
||||
padding:
|
||||
EdgeInsetsDirectional.fromSTEB(0.rpx, 29.rpx, 0.rpx, 0.rpx),
|
||||
child: Column(
|
||||
mainAxisSize: MainAxisSize.max,
|
||||
children: [
|
||||
Padding(
|
||||
padding: EdgeInsetsDirectional.fromSTEB(
|
||||
30.rpx, 0.rpx, 30.rpx, 120.rpx),
|
||||
child: ClickableContainer(
|
||||
backgroundColor: themeController.currentColor.sc5,
|
||||
highlightColor:
|
||||
themeController.currentColor.sc5, // 或你希望的点击水波纹颜色
|
||||
borderRadius: AppConstants()
|
||||
.normal_container_radius, // 如果你想加圆角可以设置 eg. 12.rpx
|
||||
padding: EdgeInsets.zero,
|
||||
onTap: () {
|
||||
print('点击了体征卡片');
|
||||
},
|
||||
child: Row(
|
||||
mainAxisSize: MainAxisSize.max,
|
||||
children: [
|
||||
Expanded(
|
||||
flex: 1,
|
||||
child: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
Row(
|
||||
children: [
|
||||
Column(
|
||||
crossAxisAlignment:
|
||||
CrossAxisAlignment.end,
|
||||
children: [
|
||||
Text(
|
||||
'实时体征.姓名'.tr,
|
||||
style: FlutterFlowTheme.of(context)
|
||||
.bodyMedium
|
||||
.override(
|
||||
fontFamily: 'Inter',
|
||||
fontSize: 26.rpx,
|
||||
letterSpacing: 0.0,
|
||||
color: themeController
|
||||
.currentColor.sc4,
|
||||
),
|
||||
),
|
||||
Text(
|
||||
'实时体征.年龄'.tr,
|
||||
style: FlutterFlowTheme.of(context)
|
||||
.bodyMedium
|
||||
.override(
|
||||
fontFamily: 'Inter',
|
||||
fontSize: 26.rpx,
|
||||
letterSpacing: 0.0,
|
||||
color: themeController
|
||||
.currentColor.sc4,
|
||||
),
|
||||
),
|
||||
].divide(SizedBox(height: 34.rpx)),
|
||||
),
|
||||
Column(
|
||||
crossAxisAlignment:
|
||||
CrossAxisAlignment.start,
|
||||
children: [
|
||||
Text(
|
||||
'${device['person']?['name'] ?? '未命名'.tr}',
|
||||
style: FlutterFlowTheme.of(context)
|
||||
.bodyMedium
|
||||
.override(
|
||||
fontFamily: 'Inter',
|
||||
fontSize: 26.rpx,
|
||||
letterSpacing: 0.0,
|
||||
color: themeController
|
||||
.currentColor.sc3,
|
||||
),
|
||||
),
|
||||
Text(
|
||||
'${MyUtils.getAgeByDate(MyUtils.formatBirthdayTime(device['person']?['birthday'])) ?? '未知数据'.tr}',
|
||||
style: FlutterFlowTheme.of(context)
|
||||
.bodyMedium
|
||||
.override(
|
||||
fontFamily: 'Inter',
|
||||
fontSize: 26.rpx,
|
||||
letterSpacing: 0.0,
|
||||
color: themeController
|
||||
.currentColor.sc3,
|
||||
),
|
||||
),
|
||||
].divide(SizedBox(height: 34.rpx)),
|
||||
),
|
||||
]
|
||||
.divide(SizedBox(width: 33.rpx))
|
||||
.addToStart(SizedBox(width: 37.rpx)),
|
||||
),
|
||||
]
|
||||
.addToStart(SizedBox(height: 36.rpx))
|
||||
.addToEnd(SizedBox(height: 36.rpx)),
|
||||
),
|
||||
),
|
||||
Expanded(
|
||||
flex: 1,
|
||||
child: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
Row(
|
||||
children: [
|
||||
Column(
|
||||
crossAxisAlignment:
|
||||
CrossAxisAlignment.end,
|
||||
children: [
|
||||
Text(
|
||||
'实时体征.设备ID'.tr,
|
||||
style: FlutterFlowTheme.of(context)
|
||||
.bodyMedium
|
||||
.override(
|
||||
fontFamily: 'Inter',
|
||||
fontSize: 26.rpx,
|
||||
letterSpacing: 0.0,
|
||||
color: themeController
|
||||
.currentColor.sc4,
|
||||
),
|
||||
),
|
||||
Text(
|
||||
'实时体征.体重'.tr,
|
||||
style: FlutterFlowTheme.of(context)
|
||||
.bodyMedium
|
||||
.override(
|
||||
fontFamily: 'Inter',
|
||||
fontSize: 26.rpx,
|
||||
letterSpacing: 0.0,
|
||||
color: themeController
|
||||
.currentColor.sc4,
|
||||
),
|
||||
),
|
||||
].divide(SizedBox(height: 34.rpx)),
|
||||
),
|
||||
Column(
|
||||
crossAxisAlignment:
|
||||
CrossAxisAlignment.start,
|
||||
children: [
|
||||
Text(
|
||||
'${device['code'] ?? '未知数据'.tr}',
|
||||
// "D11250300003",
|
||||
style: FlutterFlowTheme.of(context)
|
||||
.bodyMedium
|
||||
.override(
|
||||
fontFamily: 'Inter',
|
||||
fontSize: 26.rpx,
|
||||
letterSpacing: 0.0,
|
||||
color: themeController
|
||||
.currentColor.sc3,
|
||||
),
|
||||
),
|
||||
Text(
|
||||
'${device['person']?['weight'] ?? '未知数据'.tr}kg',
|
||||
style: FlutterFlowTheme.of(context)
|
||||
.bodyMedium
|
||||
.override(
|
||||
fontFamily: 'Inter',
|
||||
fontSize: 26.rpx,
|
||||
letterSpacing: 0.0,
|
||||
color: themeController
|
||||
.currentColor.sc3,
|
||||
),
|
||||
),
|
||||
].divide(SizedBox(height: 34.rpx)),
|
||||
),
|
||||
]
|
||||
.divide(SizedBox(width: 33.rpx))
|
||||
.addToStart(SizedBox(width: 37.rpx)),
|
||||
),
|
||||
]
|
||||
.addToStart(SizedBox(height: 36.rpx))
|
||||
.addToEnd(SizedBox(height: 36.rpx)),
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
child: Container(
|
||||
decoration: BoxDecoration(
|
||||
image: DecorationImage(
|
||||
image: AssetImage(
|
||||
(onlineState == "离线".tr || inBed == '离床'.tr)
|
||||
? 'assets/img/black_body_still.png' // 静态图
|
||||
: 'assets/img/body_black.gif', // 动图
|
||||
),
|
||||
Expanded(
|
||||
child: SingleChildScrollView(
|
||||
child: Column(
|
||||
children: [
|
||||
Padding(
|
||||
padding: EdgeInsetsDirectional.fromSTEB(
|
||||
66.rpx, 0, 66.rpx, 0),
|
||||
child: Container(
|
||||
|
||||
decoration: BoxDecoration(
|
||||
image: DecorationImage(
|
||||
image: AssetImage(
|
||||
onlineState == "离线".tr
|
||||
? 'assets/img/black_body_still.jpg' // 静态图
|
||||
: 'assets/img/body_black.gif', // 动图
|
||||
),
|
||||
fit: BoxFit.cover,
|
||||
fit: BoxFit.cover,
|
||||
),
|
||||
),
|
||||
child: Padding(
|
||||
padding: EdgeInsetsDirectional.fromSTEB(
|
||||
0.rpx, 29.rpx, 0.rpx, 0.rpx),
|
||||
child: Column(
|
||||
mainAxisSize: MainAxisSize.max,
|
||||
children: [
|
||||
Padding(
|
||||
padding: EdgeInsetsDirectional.fromSTEB(
|
||||
30.rpx, 0.rpx, 30.rpx, 120.rpx),
|
||||
child: ClickableContainer(
|
||||
backgroundColor: themeController.currentColor.sc5,
|
||||
highlightColor:
|
||||
themeController.currentColor.sc5, // 或你希望的点击水波纹颜色
|
||||
borderRadius: AppConstants()
|
||||
.normal_container_radius, // 如果你想加圆角可以设置 eg. 12.rpx
|
||||
padding: EdgeInsets.zero,
|
||||
onTap: () {
|
||||
print('点击了体征卡片');
|
||||
},
|
||||
child: Row(
|
||||
mainAxisSize: MainAxisSize.max,
|
||||
children: [
|
||||
Expanded(
|
||||
flex: 1,
|
||||
child: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
Row(
|
||||
children: [
|
||||
Column(
|
||||
crossAxisAlignment:
|
||||
CrossAxisAlignment.end,
|
||||
children: [
|
||||
Text(
|
||||
'实时体征.姓名'.tr,
|
||||
style:
|
||||
FlutterFlowTheme.of(context)
|
||||
.bodyMedium
|
||||
.override(
|
||||
fontFamily: 'Inter',
|
||||
fontSize: 26.rpx,
|
||||
letterSpacing: 0.0,
|
||||
color: themeController
|
||||
.currentColor.sc4,
|
||||
),
|
||||
),
|
||||
Text(
|
||||
'实时体征.年龄'.tr,
|
||||
style:
|
||||
FlutterFlowTheme.of(context)
|
||||
.bodyMedium
|
||||
.override(
|
||||
fontFamily: 'Inter',
|
||||
fontSize: 26.rpx,
|
||||
letterSpacing: 0.0,
|
||||
color: themeController
|
||||
.currentColor.sc4,
|
||||
),
|
||||
),
|
||||
].divide(SizedBox(height: 34.rpx)),
|
||||
),
|
||||
Column(
|
||||
crossAxisAlignment:
|
||||
CrossAxisAlignment.start,
|
||||
children: [
|
||||
Text(
|
||||
'${device['person']?['name'] ?? '未命名'.tr}',
|
||||
style:
|
||||
FlutterFlowTheme.of(context)
|
||||
.bodyMedium
|
||||
.override(
|
||||
fontFamily: 'Inter',
|
||||
fontSize: 26.rpx,
|
||||
letterSpacing: 0.0,
|
||||
color: themeController
|
||||
.currentColor.sc3,
|
||||
),
|
||||
),
|
||||
Text(
|
||||
'${MyUtils.getAgeByDate(MyUtils.formatBirthdayTime(device['person']?['birthday'])) ?? '未知数据'.tr}',
|
||||
style:
|
||||
FlutterFlowTheme.of(context)
|
||||
.bodyMedium
|
||||
.override(
|
||||
fontFamily: 'Inter',
|
||||
fontSize: 26.rpx,
|
||||
letterSpacing: 0.0,
|
||||
color: themeController
|
||||
.currentColor.sc3,
|
||||
),
|
||||
),
|
||||
].divide(SizedBox(height: 34.rpx)),
|
||||
),
|
||||
]
|
||||
.divide(SizedBox(width: 33.rpx))
|
||||
.addToStart(SizedBox(width: 37.rpx)),
|
||||
),
|
||||
]
|
||||
.addToStart(SizedBox(height: 36.rpx))
|
||||
.addToEnd(SizedBox(height: 36.rpx)),
|
||||
),
|
||||
),
|
||||
child: Column(
|
||||
children: [
|
||||
Row(
|
||||
mainAxisAlignment:
|
||||
MainAxisAlignment.spaceBetween,
|
||||
children: [
|
||||
DeviceStatusInfoWidget(
|
||||
title: "在离床".tr,
|
||||
iconAsset:
|
||||
"assets/img/icon/bed_status.svg",
|
||||
value: inBed,
|
||||
),
|
||||
DeviceStatusInfoWidget(
|
||||
title: "体动".tr,
|
||||
iconAsset:
|
||||
"assets/img/icon/bodymotion.svg",
|
||||
value: (bodyMotion == null ||
|
||||
bodyMotion == -1)
|
||||
? "未知数据".tr
|
||||
: "$bodyMotion",
|
||||
),
|
||||
],
|
||||
),
|
||||
Row(
|
||||
mainAxisAlignment:
|
||||
MainAxisAlignment.spaceBetween,
|
||||
children: [
|
||||
DeviceStatusInfoWidget(
|
||||
title: "心率".tr,
|
||||
iconAsset: "assets/img/icon/heart.svg",
|
||||
value: (heartrate == null ||
|
||||
heartrate == -1)
|
||||
? "未知数据".tr
|
||||
: "$heartrate",
|
||||
),
|
||||
DeviceStatusInfoWidget(
|
||||
title: "打鼾".tr,
|
||||
iconAsset: "assets/img/icon/snore.svg",
|
||||
value: '${snores}'.tr,
|
||||
),
|
||||
],
|
||||
),
|
||||
Row(
|
||||
mainAxisAlignment:
|
||||
MainAxisAlignment.spaceBetween,
|
||||
children: [
|
||||
DeviceStatusInfoWidget(
|
||||
title: "呼吸".tr,
|
||||
iconAsset:
|
||||
"assets/img/icon/breathe.svg",
|
||||
value: (breathrate == null ||
|
||||
breathrate == -1)
|
||||
? "未知数据".tr
|
||||
: "$breathrate",
|
||||
),
|
||||
DeviceStatusInfoWidget(
|
||||
title: "呼吸暂停".tr,
|
||||
iconAsset:
|
||||
"assets/img/icon/breathe_pause.svg",
|
||||
value: '${breathState}',
|
||||
),
|
||||
],
|
||||
),
|
||||
].divide(SizedBox(height: 49.rpx)),
|
||||
),
|
||||
),
|
||||
),
|
||||
Padding(
|
||||
padding: EdgeInsetsDirectional.fromSTEB(
|
||||
0.rpx, 67.rpx, 0.rpx, 0.rpx),
|
||||
child: Container(
|
||||
height: 40.rpx,
|
||||
child: Text(
|
||||
bodyMotion >= maxBodyMotion ? '请保持静止'.tr : "",
|
||||
style: FlutterFlowTheme.of(context)
|
||||
.bodyMedium
|
||||
.override(
|
||||
fontFamily: 'Inter',
|
||||
fontSize: 26.rpx,
|
||||
letterSpacing: 0.0,
|
||||
color: themeController.currentColor.sc9,
|
||||
Expanded(
|
||||
flex: 1,
|
||||
child: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
Row(
|
||||
children: [
|
||||
Column(
|
||||
crossAxisAlignment:
|
||||
CrossAxisAlignment.end,
|
||||
children: [
|
||||
Text(
|
||||
'实时体征.设备ID'.tr,
|
||||
style:
|
||||
FlutterFlowTheme.of(context)
|
||||
.bodyMedium
|
||||
.override(
|
||||
fontFamily: 'Inter',
|
||||
fontSize: 26.rpx,
|
||||
letterSpacing: 0.0,
|
||||
color: themeController
|
||||
.currentColor.sc4,
|
||||
),
|
||||
),
|
||||
Text(
|
||||
'实时体征.体重'.tr,
|
||||
style:
|
||||
FlutterFlowTheme.of(context)
|
||||
.bodyMedium
|
||||
.override(
|
||||
fontFamily: 'Inter',
|
||||
fontSize: 26.rpx,
|
||||
letterSpacing: 0.0,
|
||||
color: themeController
|
||||
.currentColor.sc4,
|
||||
),
|
||||
),
|
||||
].divide(SizedBox(height: 34.rpx)),
|
||||
),
|
||||
Column(
|
||||
crossAxisAlignment:
|
||||
CrossAxisAlignment.start,
|
||||
children: [
|
||||
Text(
|
||||
'${device['code'] ?? '未知数据'.tr}',
|
||||
// "D11250300003",
|
||||
style:
|
||||
FlutterFlowTheme.of(context)
|
||||
.bodyMedium
|
||||
.override(
|
||||
fontFamily: 'Inter',
|
||||
fontSize: 26.rpx,
|
||||
letterSpacing: 0.0,
|
||||
color: themeController
|
||||
.currentColor.sc3,
|
||||
),
|
||||
),
|
||||
Text(
|
||||
'${device['person']?['weight'] ?? '未知数据'.tr}kg',
|
||||
style:
|
||||
FlutterFlowTheme.of(context)
|
||||
.bodyMedium
|
||||
.override(
|
||||
fontFamily: 'Inter',
|
||||
fontSize: 26.rpx,
|
||||
letterSpacing: 0.0,
|
||||
color: themeController
|
||||
.currentColor.sc3,
|
||||
),
|
||||
),
|
||||
].divide(SizedBox(height: 34.rpx)),
|
||||
),
|
||||
]
|
||||
.divide(SizedBox(width: 33.rpx))
|
||||
.addToStart(SizedBox(width: 37.rpx)),
|
||||
),
|
||||
]
|
||||
.addToStart(SizedBox(height: 36.rpx))
|
||||
.addToEnd(SizedBox(height: 36.rpx)),
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
// SizedBox(
|
||||
// height: 207.rpx,
|
||||
// ),
|
||||
],
|
||||
),
|
||||
)),
|
||||
ClickableContainer(
|
||||
backgroundColor: Colors.transparent, // 可自定义背景色
|
||||
highlightColor: Colors.white, // 点击涟漪颜色
|
||||
borderRadius: 16.rpx, // 圆角大小,可按需调整
|
||||
padding: EdgeInsetsDirectional.fromSTEB(
|
||||
30.rpx, 0.rpx, 30.rpx, 0.rpx),
|
||||
onTap: () {},
|
||||
child: Container(
|
||||
padding: EdgeInsetsDirectional.fromSTEB(
|
||||
26.rpx, 26.rpx, 26.rpx, 26.rpx),
|
||||
decoration: BoxDecoration(
|
||||
// color: FlutterFlowTheme.of(context)
|
||||
// .primaryBackground
|
||||
// .withOpacity(0.6), // 半透明背景
|
||||
borderRadius: BorderRadius.circular(16.rpx),
|
||||
border: Border.all(
|
||||
color: themeController.currentColor.sc4
|
||||
.withOpacity(0.5),
|
||||
width: 0.5.rpx,
|
||||
],
|
||||
),
|
||||
),
|
||||
child: Row(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
),
|
||||
Expanded(
|
||||
child: SingleChildScrollView(
|
||||
child: Column(
|
||||
children: [
|
||||
Padding(
|
||||
padding: EdgeInsetsDirectional.fromSTEB(
|
||||
0, 8.rpx, 0, 0),
|
||||
66.rpx, 0, 66.rpx, 0),
|
||||
child: Container(
|
||||
width: 23.rpx,
|
||||
height: 23.rpx,
|
||||
// width: double.infinity,
|
||||
decoration: BoxDecoration(),
|
||||
child: SvgPicture.asset(
|
||||
'assets/img/icon/tips.svg',
|
||||
fit: BoxFit.cover,
|
||||
color: themeController.currentColor.sc4,
|
||||
// decoration: BoxDecoration(
|
||||
// image: DecorationImage(
|
||||
// image: AssetImage(
|
||||
// onlineState == "离线".tr
|
||||
// ? 'assets/img/black_body_still.png' // 静态图
|
||||
// : 'assets/img/body_black.gif', // 动图
|
||||
// ),
|
||||
// fit: BoxFit.cover,
|
||||
// ),
|
||||
// ),
|
||||
child: Column(
|
||||
children: [
|
||||
Row(
|
||||
mainAxisAlignment:
|
||||
MainAxisAlignment.spaceBetween,
|
||||
children: [
|
||||
DeviceStatusInfoWidget(
|
||||
title: "在离床".tr,
|
||||
iconAsset:
|
||||
"assets/img/icon/bed_status.svg",
|
||||
value: inBed,
|
||||
),
|
||||
DeviceStatusInfoWidget(
|
||||
title: "体动".tr,
|
||||
iconAsset:
|
||||
"assets/img/icon/bodymotion.svg",
|
||||
value: (bodyMotion == null ||
|
||||
bodyMotion == -1)
|
||||
? "未知数据".tr
|
||||
: "$bodyMotion",
|
||||
),
|
||||
],
|
||||
),
|
||||
Row(
|
||||
mainAxisAlignment:
|
||||
MainAxisAlignment.spaceBetween,
|
||||
children: [
|
||||
DeviceStatusInfoWidget(
|
||||
title: "心率".tr,
|
||||
iconAsset:
|
||||
"assets/img/icon/heart.svg",
|
||||
value: (heartrate == null ||
|
||||
heartrate == -1)
|
||||
? "未知数据".tr
|
||||
: "$heartrate",
|
||||
),
|
||||
DeviceStatusInfoWidget(
|
||||
title: "打鼾".tr,
|
||||
iconAsset:
|
||||
"assets/img/icon/snore.svg",
|
||||
value: '${snores}'.tr,
|
||||
),
|
||||
],
|
||||
),
|
||||
Row(
|
||||
mainAxisAlignment:
|
||||
MainAxisAlignment.spaceBetween,
|
||||
children: [
|
||||
DeviceStatusInfoWidget(
|
||||
title: "呼吸".tr,
|
||||
iconAsset:
|
||||
"assets/img/icon/breathe.svg",
|
||||
value: (breathrate == null ||
|
||||
breathrate == -1)
|
||||
? "未知数据".tr
|
||||
: "$breathrate",
|
||||
),
|
||||
DeviceStatusInfoWidget(
|
||||
title: "呼吸暂停".tr,
|
||||
iconAsset:
|
||||
"assets/img/icon/breathe_pause.svg",
|
||||
value: '${breathState}',
|
||||
),
|
||||
],
|
||||
),
|
||||
].divide(SizedBox(height: 49.rpx)),
|
||||
),
|
||||
),
|
||||
),
|
||||
Expanded(
|
||||
child: Text(
|
||||
'实时体征.提示'.tr,
|
||||
style: FlutterFlowTheme.of(context)
|
||||
.bodyMedium
|
||||
.override(
|
||||
fontFamily: 'Inter',
|
||||
letterSpacing: 0.0,
|
||||
color: themeController.currentColor.sc4,
|
||||
),
|
||||
Padding(
|
||||
padding: EdgeInsetsDirectional.fromSTEB(
|
||||
0.rpx, 67.rpx, 0.rpx, 0.rpx),
|
||||
child: Container(
|
||||
height: 40.rpx,
|
||||
child: Text(
|
||||
bodyMotion >= maxBodyMotion ? '请保持静止'.tr : "",
|
||||
style: FlutterFlowTheme.of(context)
|
||||
.bodyMedium
|
||||
.override(
|
||||
fontFamily: 'Inter',
|
||||
fontSize: 26.rpx,
|
||||
letterSpacing: 0.0,
|
||||
color: themeController.currentColor.sc9,
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
].divide(SizedBox(width: 23.rpx)),
|
||||
// SizedBox(
|
||||
// height: 207.rpx,
|
||||
// ),
|
||||
],
|
||||
),
|
||||
)),
|
||||
ClickableContainer(
|
||||
backgroundColor: Colors.transparent, // 可自定义背景色
|
||||
highlightColor: Colors.white, // 点击涟漪颜色
|
||||
borderRadius: 16.rpx, // 圆角大小,可按需调整
|
||||
padding: EdgeInsetsDirectional.fromSTEB(
|
||||
30.rpx, 0.rpx, 30.rpx, 0.rpx),
|
||||
onTap: () {},
|
||||
child: Container(
|
||||
padding: EdgeInsetsDirectional.fromSTEB(
|
||||
26.rpx, 26.rpx, 26.rpx, 26.rpx),
|
||||
decoration: BoxDecoration(
|
||||
// color: FlutterFlowTheme.of(context)
|
||||
// .primaryBackground
|
||||
// .withOpacity(0.6), // 半透明背景
|
||||
borderRadius: BorderRadius.circular(16.rpx),
|
||||
border: Border.all(
|
||||
color: themeController.currentColor.sc4
|
||||
.withOpacity(0.5),
|
||||
width: 0.5.rpx,
|
||||
),
|
||||
),
|
||||
child: Row(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
Padding(
|
||||
padding: EdgeInsetsDirectional.fromSTEB(
|
||||
0, 8.rpx, 0, 0),
|
||||
child: Container(
|
||||
width: 23.rpx,
|
||||
height: 23.rpx,
|
||||
// width: double.infinity,
|
||||
decoration: BoxDecoration(),
|
||||
child: SvgPicture.asset(
|
||||
'assets/img/icon/tips.svg',
|
||||
fit: BoxFit.cover,
|
||||
color: themeController.currentColor.sc4,
|
||||
),
|
||||
),
|
||||
),
|
||||
Expanded(
|
||||
child: Text(
|
||||
'实时体征.提示'.tr,
|
||||
style: FlutterFlowTheme.of(context)
|
||||
.bodyMedium
|
||||
.override(
|
||||
fontFamily: 'Inter',
|
||||
letterSpacing: 0.0,
|
||||
color: themeController.currentColor.sc4,
|
||||
),
|
||||
),
|
||||
),
|
||||
].divide(SizedBox(width: 23.rpx)),
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
SizedBox(
|
||||
height: 26.rpx,
|
||||
),
|
||||
],
|
||||
SizedBox(
|
||||
height: 26.rpx,
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
|
||||
@@ -24,10 +24,25 @@ class _DeviceShareInfoWidgetState extends State<DeviceShareInfoWidget> {
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
bool selected = false;
|
||||
final key = deviceShareListController.model.accountKey;
|
||||
|
||||
final matchedValues = [];
|
||||
for (final item in widget.data) {
|
||||
if (item is Map && item.containsKey(key)) {
|
||||
final value = item[key];
|
||||
if (value != null) {
|
||||
final strValue = value.toString();
|
||||
if (strValue.isNotEmpty) {
|
||||
matchedValues.add(strValue);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return ClickableContainer(
|
||||
backgroundColor: themeController.currentColor.sc5,
|
||||
highlightColor: themeController.currentColor.sc3,
|
||||
highlightColor: themeController.currentColor.sc4,
|
||||
borderRadius: 20.rpx,
|
||||
padding: EdgeInsetsDirectional.fromSTEB(0.rpx, 33.rpx, 0.rpx, 33.rpx),
|
||||
onTap: () {},
|
||||
@@ -35,6 +50,11 @@ class _DeviceShareInfoWidgetState extends State<DeviceShareInfoWidget> {
|
||||
mainAxisSize: MainAxisSize.max,
|
||||
children: [
|
||||
Obx(() {
|
||||
// 判断当前项是否被选中
|
||||
var aa = deviceShareListController.selectedShareInfo;
|
||||
print(aa);
|
||||
final isSelected = matchedValues.any((v) =>
|
||||
deviceShareListController.selectedShareInfo.value.contains(v));
|
||||
return Theme(
|
||||
data: ThemeData(
|
||||
checkboxTheme: CheckboxThemeData(
|
||||
@@ -47,18 +67,52 @@ class _DeviceShareInfoWidgetState extends State<DeviceShareInfoWidget> {
|
||||
unselectedWidgetColor: Color(0xFFD3D3D3),
|
||||
),
|
||||
child: Checkbox(
|
||||
value: deviceShareListController.selectedShareInfo.value
|
||||
.contains(widget.data[0]['k']),
|
||||
value: isSelected,
|
||||
onChanged: (newValue) async {
|
||||
if (newValue != null) {
|
||||
if (newValue == true) {
|
||||
deviceShareListController.selectedShareInfo.value
|
||||
.add(widget.data[0]['k']);
|
||||
} else {
|
||||
deviceShareListController.selectedShareInfo.value
|
||||
.remove(widget.data[0]['k']);
|
||||
final key = deviceShareListController.model.accountKey;
|
||||
// 提取包含指定 key 的 value
|
||||
final List<String> matchedValues = [];
|
||||
for (final item in widget.data) {
|
||||
if (item is Map && item.containsKey(key)) {
|
||||
final value = item[key];
|
||||
if (value != null) {
|
||||
final strValue = value.toString();
|
||||
if (strValue.isNotEmpty) {
|
||||
matchedValues.add(strValue);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
if (newValue == true) {
|
||||
// 添加匹配值到已选列表中(避免重复)
|
||||
for (final v in matchedValues) {
|
||||
if (!deviceShareListController.selectedShareInfo.value
|
||||
.contains(v)) {
|
||||
deviceShareListController.selectedShareInfo.value
|
||||
.add(v);
|
||||
}
|
||||
}
|
||||
} else {
|
||||
// 从已选列表中移除匹配值
|
||||
deviceShareListController.selectedShareInfo.value
|
||||
.removeWhere((v) => matchedValues.contains(v));
|
||||
}
|
||||
|
||||
// 刷新 UI 和全选状态
|
||||
final selectedCount =
|
||||
deviceShareListController.selectedShareInfo.length;
|
||||
final totalCount =
|
||||
deviceShareListController.shareInfoList.length;
|
||||
|
||||
deviceShareListController.model.all =
|
||||
(selectedCount == totalCount) ? 1 : 0;
|
||||
|
||||
deviceShareListController.selectedShareInfo.refresh();
|
||||
deviceShareListController.updateAll();
|
||||
}
|
||||
|
||||
final selectedCount =
|
||||
deviceShareListController.selectedShareInfo.length;
|
||||
final totalCount =
|
||||
@@ -66,8 +120,7 @@ class _DeviceShareInfoWidgetState extends State<DeviceShareInfoWidget> {
|
||||
|
||||
deviceShareListController.model.all =
|
||||
(selectedCount == totalCount) ? 1 : 0;
|
||||
deviceShareListController.selectedShareInfo
|
||||
.refresh(); // ✅ 关键代码
|
||||
deviceShareListController.selectedShareInfo.refresh();
|
||||
deviceShareListController.updateAll();
|
||||
},
|
||||
side: BorderSide(
|
||||
@@ -91,22 +144,52 @@ class _DeviceShareInfoWidgetState extends State<DeviceShareInfoWidget> {
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: List.generate(widget.data.length, (index) {
|
||||
final item = widget.data[index];
|
||||
if (item is Map &&
|
||||
item.containsKey('show') &&
|
||||
item['show'] == false) {
|
||||
return Container();
|
||||
}
|
||||
return Container(
|
||||
constraints: BoxConstraints(
|
||||
minHeight: 62.rpx,
|
||||
),
|
||||
child: Align(
|
||||
alignment: AlignmentDirectional(-1, 0),
|
||||
child: Text(
|
||||
"${item['k']}" + ":" + "${item['v']}",
|
||||
style:
|
||||
FlutterFlowTheme.of(context).bodyMedium.override(
|
||||
fontFamily: 'Inter',
|
||||
fontSize: 26.rpx,
|
||||
letterSpacing: 0.0,
|
||||
color: themeController.currentColor.sc3,
|
||||
),
|
||||
),
|
||||
child: Row(
|
||||
children: [
|
||||
SizedBox(
|
||||
width: 105.rpx,
|
||||
child: Align(
|
||||
alignment: AlignmentDirectional(-1, 0),
|
||||
child: Text(
|
||||
"${item['k']}",
|
||||
style: FlutterFlowTheme.of(context)
|
||||
.bodyMedium
|
||||
.override(
|
||||
fontFamily: 'Inter',
|
||||
fontSize: 26.rpx,
|
||||
letterSpacing: 0.0,
|
||||
color: themeController.currentColor.sc4,
|
||||
),
|
||||
maxLines: 1,
|
||||
overflow: TextOverflow.ellipsis,
|
||||
),
|
||||
),
|
||||
),
|
||||
Text(
|
||||
"${item['v']}",
|
||||
style: FlutterFlowTheme.of(context)
|
||||
.bodyMedium
|
||||
.override(
|
||||
fontFamily: 'Inter',
|
||||
fontSize: 26.rpx,
|
||||
letterSpacing: 0.0,
|
||||
color: themeController.currentColor.sc3,
|
||||
),
|
||||
maxLines: 1,
|
||||
overflow: TextOverflow.ellipsis,
|
||||
),
|
||||
].divide(SizedBox(
|
||||
width: 34.rpx,
|
||||
)),
|
||||
),
|
||||
);
|
||||
}),
|
||||
|
||||
@@ -8,7 +8,6 @@ import 'package:vbvs_app/common/util/DailyLogUtils.dart';
|
||||
import 'package:vbvs_app/common/util/FitTool.dart';
|
||||
import 'package:vbvs_app/component/tool/ClickableContainer.dart';
|
||||
import 'package:vbvs_app/component/tool/TopSlideNotification.dart';
|
||||
import 'package:vbvs_app/component/tool/cmd.dart';
|
||||
import 'package:vbvs_app/controller/device/blueteeth_bind_controller.dart';
|
||||
import 'package:vbvs_app/controller/theme_controller/ThemeController.dart';
|
||||
import 'package:vbvs_app/model/BleDeviceData.dart';
|
||||
@@ -86,7 +85,8 @@ class _SingleBlueteethDeviceCompoentWidgetState
|
||||
TopSlideNotification.show(context, text: response.msg!);
|
||||
if (response.code == HttpStatusCodes.ok) {
|
||||
// showLoadingDialog(context); // 显示 loading
|
||||
Get.toNamed("/personPage");
|
||||
// Get.toNamed("/personPage");
|
||||
Get.toNamed("/wifiPage");
|
||||
THapp bledevice = THapp(device: widget.bleDevice.device);
|
||||
blueteethBindController.currentDevice = bledevice;
|
||||
// await bledevice.device.connect();
|
||||
|
||||
@@ -530,9 +530,9 @@ void showConfirmDialog(
|
||||
CustomCard(
|
||||
borderRadius: AppConstants().button_container_radius,
|
||||
onTap: () {
|
||||
Get.back();
|
||||
onConfirm();
|
||||
// await Future.delayed(Duration(milliseconds: 300));
|
||||
Get.back();
|
||||
},
|
||||
colors: [
|
||||
themeController.currentColor.sc1,
|
||||
|
||||
@@ -28,6 +28,7 @@ class CalibrationPage extends StatefulWidget {
|
||||
class _CalibrationPageState extends State<CalibrationPage> {
|
||||
DeviceCalibrationController deviceCalibrationController = Get.find();
|
||||
BlueteethBindController blueteethBindController = Get.find();
|
||||
int flag = 0; //默认没有开始校准过
|
||||
@override
|
||||
void initState() {
|
||||
super.initState();
|
||||
@@ -89,8 +90,32 @@ class _CalibrationPageState extends State<CalibrationPage> {
|
||||
child: CustomCard(
|
||||
borderRadius: 20.rpx,
|
||||
onTap: () async {
|
||||
// Get.toNamed("/personPage");
|
||||
Get.toNamed("/bindDeviceSuccess");
|
||||
if (flag != 0) {
|
||||
showConfirmDialog(
|
||||
context, Container(), "校准未完成提示".tr,
|
||||
onConfirm: () async {
|
||||
await Get.toNamed("/personPage");
|
||||
print("object");
|
||||
deviceCalibrationController.process.value = 0;
|
||||
deviceCalibrationController
|
||||
.bed_calibration.value = 0;
|
||||
deviceCalibrationController
|
||||
.position_calibration.value = 0;
|
||||
blueteethBindController.cid!.value = "";
|
||||
deviceCalibrationController.complete = false;
|
||||
}, onCancel: () {});
|
||||
} else {
|
||||
await Get.toNamed("/personPage");
|
||||
deviceCalibrationController.process.value = 0;
|
||||
deviceCalibrationController
|
||||
.bed_calibration.value = 0;
|
||||
deviceCalibrationController
|
||||
.position_calibration.value = 0;
|
||||
blueteethBindController.cid!.value = "";
|
||||
deviceCalibrationController.complete = false;
|
||||
}
|
||||
|
||||
// Get.toNamed("/bindDeviceSuccess");
|
||||
},
|
||||
colors: [
|
||||
themeController.currentColor.sc1,
|
||||
@@ -491,6 +516,7 @@ class _CalibrationPageState extends State<CalibrationPage> {
|
||||
borderRadius:
|
||||
AppConstants().button_container_radius, // 圆角半径
|
||||
onTap: () async {
|
||||
flag = 1;
|
||||
if (deviceCalibrationController.complete) {
|
||||
showConfirmDialog(
|
||||
context, Container(), "校准已经完成,是否重新开始校准?",
|
||||
@@ -504,7 +530,7 @@ class _CalibrationPageState extends State<CalibrationPage> {
|
||||
.position_calibration.value = 0;
|
||||
blueteethBindController.cid!.value = "";
|
||||
deviceCalibrationController.complete = false;
|
||||
|
||||
|
||||
String serviceAddress =
|
||||
"https://caibration.he-info.cn";
|
||||
String calibrationApi =
|
||||
@@ -589,6 +615,7 @@ class _CalibrationPageState extends State<CalibrationPage> {
|
||||
currStep == 5 &&
|
||||
status == true) {
|
||||
// 第二步完成:per >= 100 && currStep == 5 && status == true
|
||||
flag = 0;
|
||||
pollingTimer?.cancel();
|
||||
TopSlideNotification.show(context,
|
||||
text: "设备校准完成".tr);
|
||||
|
||||
@@ -2,14 +2,17 @@ import 'package:ef/ef.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_svg/svg.dart';
|
||||
import 'package:flutterflow_ui/flutterflow_ui.dart';
|
||||
import 'package:vbvs_app/common/color/ServiceConstant.dart';
|
||||
import 'package:vbvs_app/common/color/appConstants.dart';
|
||||
import 'package:vbvs_app/common/util/FitTool.dart';
|
||||
import 'package:vbvs_app/common/util/MyUtils.dart';
|
||||
import 'package:vbvs_app/common/util/requestWithLog.dart';
|
||||
import 'package:vbvs_app/component/NullDataComponentWidget.dart';
|
||||
import 'package:vbvs_app/component/tool/ClickableContainer.dart';
|
||||
import 'package:vbvs_app/component/tool/TopSlideNotification.dart';
|
||||
import 'package:vbvs_app/controller/device/device_share_list_controller.dart';
|
||||
import 'package:vbvs_app/model/BleDeviceData.dart';
|
||||
import 'package:vbvs_app/pages/device_bind/componnet/DeviceShareInfoWidget.dart';
|
||||
import 'package:vbvs_app/pages/device_bind/componnet/bind_dialog.dart';
|
||||
|
||||
class DeviceShareListPage extends StatefulWidget {
|
||||
String device = "";
|
||||
@@ -27,7 +30,10 @@ class _DeviceShareListPageState extends State<DeviceShareListPage> {
|
||||
deviceShareListController.model.key = null;
|
||||
deviceShareListController.shareInfoList.value = [];
|
||||
deviceShareListController.selectedShareInfo.value = [];
|
||||
deviceShareListController.getDeviceShareList(widget.device);
|
||||
deviceShareListController.model.all = 0;
|
||||
deviceShareListController.getDeviceShareList(widget.device).then((value) {
|
||||
deviceShareListController.updateAll();
|
||||
});
|
||||
super.initState();
|
||||
}
|
||||
|
||||
@@ -70,7 +76,6 @@ class _DeviceShareListPageState extends State<DeviceShareListPage> {
|
||||
fontSize: 30.rpx,
|
||||
),
|
||||
),
|
||||
//todo 返回刷新列表
|
||||
Positioned(
|
||||
left: 0,
|
||||
child: returnIconButtom,
|
||||
@@ -207,8 +212,8 @@ class _DeviceShareListPageState extends State<DeviceShareListPage> {
|
||||
fontSize: 26.rpx,
|
||||
letterSpacing: 0.0,
|
||||
),
|
||||
cursorColor: themeController
|
||||
.currentColor.sc3,
|
||||
cursorColor:
|
||||
themeController.currentColor.sc3,
|
||||
),
|
||||
),
|
||||
),
|
||||
@@ -253,6 +258,10 @@ class _DeviceShareListPageState extends State<DeviceShareListPage> {
|
||||
// themeController.currentColor.sc9,
|
||||
// );
|
||||
// }
|
||||
deviceShareListController
|
||||
.getDeviceShareList(widget.device,
|
||||
key: deviceShareListController
|
||||
.model.key);
|
||||
},
|
||||
padding: EdgeInsets.symmetric(
|
||||
horizontal: 10.rpx, vertical: 6.rpx),
|
||||
@@ -310,15 +319,40 @@ class _DeviceShareListPageState extends State<DeviceShareListPage> {
|
||||
: true,
|
||||
onChanged: (newValue) async {
|
||||
if (newValue == true) {
|
||||
// 设置为全选
|
||||
deviceShareListController.model.all =
|
||||
1;
|
||||
deviceShareListController
|
||||
.selectedShareInfo.value =
|
||||
deviceShareListController
|
||||
.shareInfoList
|
||||
.map((e) => e['id'] as String)
|
||||
.toList();
|
||||
try {
|
||||
deviceShareListController
|
||||
.model.all = 1;
|
||||
|
||||
final key =
|
||||
deviceShareListController
|
||||
.model.accountKey;
|
||||
final List<String> selectedList =
|
||||
[];
|
||||
|
||||
final allShareInfo =
|
||||
deviceShareListController
|
||||
.shareInfoList;
|
||||
for (final sublist
|
||||
in allShareInfo) {
|
||||
if (sublist is List) {
|
||||
for (final item in sublist) {
|
||||
if (item is Map &&
|
||||
item.containsKey(key)) {
|
||||
selectedList.add(item[key]);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
deviceShareListController
|
||||
.selectedShareInfo
|
||||
.value = selectedList;
|
||||
|
||||
print("已全选: $selectedList");
|
||||
} catch (e) {
|
||||
print("全选失败: $e");
|
||||
}
|
||||
} else {
|
||||
// 取消全选
|
||||
deviceShareListController.model.all =
|
||||
@@ -356,19 +390,56 @@ class _DeviceShareListPageState extends State<DeviceShareListPage> {
|
||||
),
|
||||
ClickableContainer(
|
||||
onTap: () async {
|
||||
//todo 删除分享
|
||||
// ApiResponse apiResponse =
|
||||
// await deviceShareListController
|
||||
// .deleteShareDevice();
|
||||
// if (apiResponse.code == HttpStatusCodes.ok) {
|
||||
// TopSlideNotification.show(context,
|
||||
// text: apiResponse.msg!);
|
||||
// } else {
|
||||
// TopSlideNotification.show(context,
|
||||
// text: apiResponse.msg!,
|
||||
// textColor:
|
||||
// themeController.currentColor.sc9);
|
||||
// }
|
||||
showConfirmDialog(context, Container(), "删除提示".tr,
|
||||
onConfirm: () async {
|
||||
if (deviceShareListController
|
||||
.selectedShareInfo ==
|
||||
null ||
|
||||
deviceShareListController
|
||||
.selectedShareInfo.isEmpty) {
|
||||
TopSlideNotification.show(context,
|
||||
text: "删除错误提示".tr,
|
||||
textColor:
|
||||
themeController.currentColor.sc9);
|
||||
return;
|
||||
}
|
||||
String serviceAddress =
|
||||
ServiceConstant.service_address;
|
||||
String serviceName =
|
||||
ServiceConstant.server_service;
|
||||
String serviceApi = ServiceConstant.device_bind;
|
||||
String queryUrl =
|
||||
"${serviceAddress}${serviceName}${serviceApi}";
|
||||
final data = {
|
||||
"mac": widget.device,
|
||||
"uid": deviceShareListController
|
||||
.selectedShareInfo.value
|
||||
.join(','),
|
||||
};
|
||||
await requestWithLog(
|
||||
logTitle: "删除分享设备",
|
||||
method: MyHttpMethod.delete,
|
||||
queryUrl: queryUrl,
|
||||
data: data,
|
||||
onSuccess: (res) {
|
||||
TopSlideNotification.show(context,
|
||||
text: res.msg!);
|
||||
deviceShareListController.model.all = 0;
|
||||
deviceShareListController
|
||||
.selectedShareInfo.value = [];
|
||||
deviceShareListController
|
||||
.getDeviceShareList(widget.device);
|
||||
deviceShareListController.updateAll();
|
||||
},
|
||||
onFailure: (res) {
|
||||
TopSlideNotification.show(context,
|
||||
text: res.msg!,
|
||||
textColor:
|
||||
themeController.currentColor.sc9);
|
||||
deviceShareListController.updateAll();
|
||||
},
|
||||
);
|
||||
}, onCancel: () {});
|
||||
},
|
||||
padding: EdgeInsets.symmetric(
|
||||
horizontal: 20.rpx, vertical: 10.rpx),
|
||||
@@ -387,28 +458,27 @@ class _DeviceShareListPageState extends State<DeviceShareListPage> {
|
||||
],
|
||||
),
|
||||
),
|
||||
Expanded(
|
||||
child: deviceShareListController
|
||||
.shareInfoList.value.isNotEmpty
|
||||
? SingleChildScrollView(
|
||||
child: Obx(() {
|
||||
var selected = deviceShareListController
|
||||
.selectedShareInfo.value;
|
||||
return Column(
|
||||
children: deviceShareListController
|
||||
.shareInfoList.value
|
||||
Obx(() {
|
||||
final list =
|
||||
deviceShareListController.shareInfoList.value;
|
||||
final selected =
|
||||
deviceShareListController.selectedShareInfo.value;
|
||||
|
||||
return Expanded(
|
||||
child: list.isNotEmpty
|
||||
? SingleChildScrollView(
|
||||
child: Column(
|
||||
children: list
|
||||
.map((item) =>
|
||||
DeviceShareInfoWidget(data: item))
|
||||
.toList()
|
||||
.divide(SizedBox(height: 30.rpx))
|
||||
.addToEnd(SizedBox(
|
||||
height: 30.rpx,
|
||||
)),
|
||||
);
|
||||
}),
|
||||
)
|
||||
: NullDataWidget(),
|
||||
),
|
||||
.addToEnd(SizedBox(height: 30.rpx)),
|
||||
),
|
||||
)
|
||||
: NullDataWidget(),
|
||||
);
|
||||
})
|
||||
].divide(SizedBox(height: 30.rpx)),
|
||||
),
|
||||
),
|
||||
@@ -419,42 +489,3 @@ class _DeviceShareListPageState extends State<DeviceShareListPage> {
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
BleDeviceData parseBleData(List<int> data) {
|
||||
if (data.length < 18) {
|
||||
throw Exception('BLE广播数据长度不足18字节');
|
||||
}
|
||||
|
||||
int type = data[0];
|
||||
int sn = data[1];
|
||||
|
||||
// 设备唯一ID (6字节),格式化为 MAC 地址样式
|
||||
String deviceId =
|
||||
List.generate(6, (i) => data[2 + i].toRadixString(16).padLeft(2, '0'))
|
||||
.join(":")
|
||||
.toUpperCase();
|
||||
|
||||
int bre = data[8];
|
||||
int ht = data[9];
|
||||
int active = data[10];
|
||||
int flag = data[11];
|
||||
|
||||
// version 是4字节 uint,大端字节序
|
||||
int version =
|
||||
(data[12] << 24) | (data[13] << 16) | (data[14] << 8) | data[15];
|
||||
|
||||
// qsn 是2字节 ushort,大端字节序
|
||||
int qsn = (data[16] << 8) | data[17];
|
||||
|
||||
return BleDeviceData(
|
||||
type: type,
|
||||
sn: sn,
|
||||
deviceId: deviceId,
|
||||
bre: bre,
|
||||
ht: ht,
|
||||
active: active,
|
||||
flag: flag,
|
||||
version: version,
|
||||
qsn: qsn,
|
||||
);
|
||||
}
|
||||
|
||||
@@ -72,7 +72,7 @@ class _WifiPageState extends State<WifiPage> {
|
||||
}
|
||||
if (onData.status == BleEventType.ready) {
|
||||
aa = await getDeviceNetVersion(
|
||||
blueteethBindController.currentDevice!, 1);
|
||||
blueteethBindController.currentDevice!, 2);
|
||||
if (aa == "4g") {
|
||||
TopSlideNotification.show(
|
||||
context,
|
||||
@@ -84,6 +84,12 @@ class _WifiPageState extends State<WifiPage> {
|
||||
Future.delayed(const Duration(seconds: 1), () {
|
||||
Get.toNamed("/calibrationPage", arguments: 1);
|
||||
});
|
||||
} else if (aa == 'unknown') {
|
||||
TopSlideNotification.show(
|
||||
context,
|
||||
text: "获取设备网络类型失败".tr,
|
||||
textColor: themeController.currentColor.sc9,
|
||||
);
|
||||
} else {
|
||||
await initWifiStatusAndWifiList();
|
||||
}
|
||||
@@ -1020,6 +1026,7 @@ class _WifiPageState extends State<WifiPage> {
|
||||
text: "4g设备配置wifi提示".tr,
|
||||
textColor: themeController.currentColor.sc9,
|
||||
);
|
||||
Get.back();
|
||||
});
|
||||
return;
|
||||
} else {
|
||||
|
||||
@@ -3,14 +3,12 @@ import 'package:flutter/material.dart';
|
||||
import 'package:flutter_svg/svg.dart';
|
||||
import 'package:flutterflow_ui/flutterflow_ui.dart';
|
||||
import 'package:fluwx/fluwx.dart';
|
||||
import 'package:vbvs_app/common/color/ServiceConstant.dart';
|
||||
import 'package:vbvs_app/common/color/appConstants.dart';
|
||||
import 'package:vbvs_app/common/color/app_uri_status.dart';
|
||||
import 'package:vbvs_app/common/util/CheckNetwork.dart';
|
||||
import 'package:vbvs_app/common/util/CommonVariables.dart';
|
||||
import 'package:vbvs_app/common/util/FitTool.dart';
|
||||
import 'package:vbvs_app/common/util/MyUtils.dart';
|
||||
import 'package:vbvs_app/common/util/requestWithLog.dart';
|
||||
import 'package:vbvs_app/component/tool/ClickableContainer.dart';
|
||||
import 'package:vbvs_app/component/tool/CustomCard.dart';
|
||||
import 'package:vbvs_app/component/tool/TopSlideNotification.dart';
|
||||
|
||||
@@ -231,9 +231,10 @@ class _HomePageState extends State<HomePage> {
|
||||
padding: EdgeInsetsDirectional.fromSTEB(
|
||||
AppConstants().content_left_right_padding,
|
||||
0,
|
||||
AppConstants().content_left_right_padding,
|
||||
0,
|
||||
0),
|
||||
child: Container(
|
||||
// color: Colors.red,
|
||||
width: double.infinity,
|
||||
child: Row(
|
||||
mainAxisSize: MainAxisSize.max,
|
||||
@@ -307,7 +308,7 @@ class _HomePageState extends State<HomePage> {
|
||||
return Row(
|
||||
children: [
|
||||
Text(
|
||||
"${weatherModelController.model.cityName??'未知数据'.tr}",
|
||||
"${weatherModelController.model.cityName ?? '未知数据'.tr}",
|
||||
style: TextStyle(
|
||||
color: themeController
|
||||
.currentColor.sc4,
|
||||
@@ -372,7 +373,7 @@ class _HomePageState extends State<HomePage> {
|
||||
backgroundColor: Colors.transparent,
|
||||
highlightColor:
|
||||
themeController.currentColor.sc16,
|
||||
padding: EdgeInsets.all(8.rpx),
|
||||
padding: EdgeInsets.all(0.rpx),
|
||||
onTap: () {
|
||||
UserInfoController userInfoController =
|
||||
Get.find();
|
||||
|
||||
@@ -49,8 +49,8 @@ class _EPageState extends State<PersonPage> {
|
||||
personController.name.value = '';
|
||||
personController.gender.value = 1;
|
||||
personController.birthday.value = "";
|
||||
personController.weight.value = 65;
|
||||
personController.dateTime = DateTime.now();
|
||||
personController.weight.value = "";
|
||||
personController.dateTime = null;
|
||||
}
|
||||
|
||||
@override
|
||||
@@ -107,8 +107,8 @@ class _EPageState extends State<PersonPage> {
|
||||
if (apiRespons.code == HttpStatusCodes.ok) {
|
||||
TopSlideNotification.show(context,
|
||||
text: apiRespons.msg!);
|
||||
// Get.offAllNamed("/bindDeviceSuccess");
|
||||
Get.toNamed("/wifiPage");
|
||||
Get.offAllNamed("/bindDeviceSuccess");
|
||||
// Get.toNamed("/wifiPage");
|
||||
} else {
|
||||
TopSlideNotification.show(context,
|
||||
text: apiRespons.msg!,
|
||||
@@ -200,6 +200,7 @@ class _EPageState extends State<PersonPage> {
|
||||
fontFamily: 'Inter',
|
||||
fontSize: 26.rpx,
|
||||
letterSpacing: 0.0,
|
||||
color: themeController.currentColor.sc4,
|
||||
),
|
||||
enabledBorder: OutlineInputBorder(
|
||||
borderSide: BorderSide(
|
||||
@@ -440,6 +441,7 @@ class _EPageState extends State<PersonPage> {
|
||||
personController.dateTime = d;
|
||||
personController.updateAll();
|
||||
},
|
||||
title: "生日".tr
|
||||
);
|
||||
});
|
||||
},
|
||||
@@ -499,8 +501,7 @@ class _EPageState extends State<PersonPage> {
|
||||
.height.value
|
||||
.toString(),
|
||||
onChanged: (value) {
|
||||
personController.height.value =
|
||||
int.tryParse(value) ?? 0;
|
||||
personController.height.value = value;
|
||||
},
|
||||
autofocus: false,
|
||||
obscureText: false,
|
||||
@@ -573,7 +574,8 @@ class _EPageState extends State<PersonPage> {
|
||||
Obx(() {
|
||||
final height =
|
||||
personController.height.value;
|
||||
return height == 0
|
||||
return (height == null ||
|
||||
height.isEmpty)
|
||||
? const SizedBox.shrink() // 不显示任何内容
|
||||
: Text(
|
||||
'${height}cm',
|
||||
@@ -621,12 +623,10 @@ class _EPageState extends State<PersonPage> {
|
||||
FilteringTextInputFormatter
|
||||
.digitsOnly,
|
||||
],
|
||||
initialValue: personController
|
||||
.weight.value
|
||||
.toString(),
|
||||
initialValue:
|
||||
personController.weight.value,
|
||||
onChanged: (value) {
|
||||
personController.weight.value =
|
||||
int.tryParse(value) ?? 0;
|
||||
personController.weight.value = value;
|
||||
},
|
||||
autofocus: false,
|
||||
obscureText: false,
|
||||
@@ -699,7 +699,8 @@ class _EPageState extends State<PersonPage> {
|
||||
Obx(() {
|
||||
final weight =
|
||||
personController.weight.value;
|
||||
return weight == 0
|
||||
return (weight == null ||
|
||||
weight.isEmpty)
|
||||
? const SizedBox.shrink() // 不显示任何内容
|
||||
: Text(
|
||||
'${weight}kg',
|
||||
@@ -768,7 +769,6 @@ class _EPageState extends State<PersonPage> {
|
||||
}
|
||||
personController.model.read = 0;
|
||||
personController.updateAll();
|
||||
|
||||
},
|
||||
);
|
||||
}).toList(),
|
||||
|
||||
@@ -3,6 +3,7 @@ import 'package:flutter/cupertino.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:vbvs_app/common/color/appConstants.dart';
|
||||
import 'package:vbvs_app/common/util/FitTool.dart';
|
||||
import 'package:vbvs_app/common/util/MyUtils.dart';
|
||||
import 'package:vbvs_app/controller/theme_controller/ThemeController.dart';
|
||||
|
||||
Future showDateSelectionDialog(BuildContext context,
|
||||
@@ -68,70 +69,76 @@ Future showDateSelectionDialog(BuildContext context,
|
||||
color: themeController.currentColor.sc5,
|
||||
alignment: Alignment.centerLeft,
|
||||
height: 80.rpx,
|
||||
child: Row(
|
||||
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||
crossAxisAlignment: CrossAxisAlignment.center,
|
||||
children: [
|
||||
InkWell(
|
||||
child: Text(
|
||||
"日期.取消".tr,
|
||||
child: Padding(
|
||||
padding: EdgeInsets.only(left: 30.rpx, right: 30.rpx),
|
||||
child: Row(
|
||||
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||
crossAxisAlignment: CrossAxisAlignment.center,
|
||||
children: [
|
||||
InkWell(
|
||||
child: Text(
|
||||
"日期.取消".tr,
|
||||
style: FlutterFlowTheme.of(context)
|
||||
.bodyMedium
|
||||
.override(
|
||||
fontFamily: 'Readex Pro',
|
||||
color:
|
||||
themeController.currentColor.sc3,
|
||||
letterSpacing: 0,
|
||||
fontSize: AppConstants()
|
||||
.normal_text_fontSize),
|
||||
),
|
||||
onTap: () {
|
||||
Get.back();
|
||||
},
|
||||
),
|
||||
Text(
|
||||
"$title",
|
||||
style: FlutterFlowTheme.of(context)
|
||||
.bodyMedium
|
||||
.override(
|
||||
fontFamily: 'Readex Pro',
|
||||
color: themeController.currentColor.sc3,
|
||||
letterSpacing: 0,
|
||||
fontSize: AppConstants()
|
||||
.normal_text_fontSize),
|
||||
fontSize:
|
||||
AppConstants().title_text_fontSize),
|
||||
),
|
||||
onTap: () {
|
||||
Get.back();
|
||||
},
|
||||
),
|
||||
Text(
|
||||
"$title",
|
||||
style: FlutterFlowTheme.of(context)
|
||||
.bodyMedium
|
||||
.override(
|
||||
fontFamily: 'Readex Pro',
|
||||
color: themeController.currentColor.sc3,
|
||||
letterSpacing: 0,
|
||||
fontSize:
|
||||
AppConstants().title_text_fontSize),
|
||||
),
|
||||
// closeIconWhite,
|
||||
InkWell(
|
||||
child: Text(
|
||||
"日期.确定".tr,
|
||||
style: FlutterFlowTheme.of(context)
|
||||
.bodyMedium
|
||||
.override(
|
||||
fontFamily: 'Readex Pro',
|
||||
color: themeController.currentColor.sc3,
|
||||
letterSpacing: 0,
|
||||
fontSize: AppConstants()
|
||||
.normal_text_fontSize),
|
||||
),
|
||||
onTap: () {
|
||||
checkChange?.call(DateTime(years[yearIndex],
|
||||
months[monthIndex], days[dayIndex]));
|
||||
Get.back();
|
||||
},
|
||||
)
|
||||
],
|
||||
// closeIconWhite,
|
||||
InkWell(
|
||||
child: Text(
|
||||
"日期.确定".tr,
|
||||
style: FlutterFlowTheme.of(context)
|
||||
.bodyMedium
|
||||
.override(
|
||||
fontFamily: 'Readex Pro',
|
||||
color:
|
||||
themeController.currentColor.sc2,
|
||||
letterSpacing: 0,
|
||||
fontSize: AppConstants()
|
||||
.normal_text_fontSize),
|
||||
),
|
||||
onTap: () {
|
||||
checkChange?.call(DateTime(years[yearIndex],
|
||||
months[monthIndex], days[dayIndex]));
|
||||
Get.back();
|
||||
},
|
||||
)
|
||||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
Container(
|
||||
height: 240.rpx,
|
||||
margin: EdgeInsets.only(top: 60.rpx, bottom: 60.rpx),
|
||||
padding: EdgeInsets.only(left: 30.rpx, right: 30.rpx),
|
||||
child: Container(
|
||||
child: Row(
|
||||
children: [
|
||||
Expanded(
|
||||
child: Container(
|
||||
padding: EdgeInsets.only(
|
||||
left: 40.rpx, right: 30.rpx),
|
||||
padding: EdgeInsets.symmetric(horizontal: 30.rpx),
|
||||
child: Row(
|
||||
mainAxisAlignment: MainAxisAlignment.center, // ✅ 整体居中
|
||||
crossAxisAlignment: CrossAxisAlignment.center,
|
||||
children: [
|
||||
Row(
|
||||
children: [
|
||||
SizedBox(
|
||||
width: 120.rpx,
|
||||
child: getOnePicker(context, years, yearIndex,
|
||||
(d) {
|
||||
yearIndex = d;
|
||||
@@ -147,26 +154,18 @@ Future showDateSelectionDialog(BuildContext context,
|
||||
.day;
|
||||
days_select.value =
|
||||
days.sublist(0, day_len);
|
||||
}),
|
||||
}, "年".tr),
|
||||
),
|
||||
),
|
||||
Container(
|
||||
child: Text(
|
||||
"年",
|
||||
style: FlutterFlowTheme.of(context)
|
||||
.bodyMedium
|
||||
.override(
|
||||
fontFamily: 'Readex Pro',
|
||||
color:
|
||||
themeController.currentColor.sc3,
|
||||
letterSpacing: 0,
|
||||
fontSize: 30.rpx),
|
||||
),
|
||||
),
|
||||
Expanded(
|
||||
child: Container(
|
||||
padding: EdgeInsets.only(
|
||||
left: 30.rpx, right: 30.rpx),
|
||||
],
|
||||
),
|
||||
|
||||
SizedBox(width: 100.rpx),
|
||||
|
||||
// 月
|
||||
Row(
|
||||
children: [
|
||||
SizedBox(
|
||||
width: 80.rpx,
|
||||
child: getOnePicker(
|
||||
context, months, monthIndex, (d) {
|
||||
monthIndex = d;
|
||||
@@ -182,58 +181,29 @@ Future showDateSelectionDialog(BuildContext context,
|
||||
.day;
|
||||
days_select.value =
|
||||
days.sublist(0, day_len);
|
||||
}, "月".tr),
|
||||
),
|
||||
],
|
||||
),
|
||||
|
||||
SizedBox(width: 100.rpx),
|
||||
|
||||
Row(
|
||||
children: [
|
||||
SizedBox(
|
||||
width: 80.rpx,
|
||||
child: Obx(() {
|
||||
return getOnePicker(
|
||||
context, days_select, dayIndex, (d) {
|
||||
dayIndex = d;
|
||||
}, "日".tr);
|
||||
}),
|
||||
),
|
||||
),
|
||||
Container(
|
||||
child: Text(
|
||||
"月",
|
||||
style: FlutterFlowTheme.of(context)
|
||||
.bodyMedium
|
||||
.override(
|
||||
fontFamily: 'Readex Pro',
|
||||
color:
|
||||
themeController.currentColor.sc3,
|
||||
letterSpacing: 0,
|
||||
fontSize: 30.rpx),
|
||||
),
|
||||
),
|
||||
Expanded(
|
||||
child: Container(
|
||||
padding: EdgeInsets.only(
|
||||
left: 30.rpx, right: 40.rpx),
|
||||
child: Obx(
|
||||
() {
|
||||
// print("${dayIndex} ${day_len}");
|
||||
return getOnePicker(
|
||||
context,
|
||||
days_select,
|
||||
dayIndex,
|
||||
(d) {
|
||||
dayIndex = d;
|
||||
},
|
||||
);
|
||||
},
|
||||
),
|
||||
),
|
||||
),
|
||||
Container(
|
||||
child: Text(
|
||||
"日",
|
||||
style: FlutterFlowTheme.of(context)
|
||||
.bodyMedium
|
||||
.override(
|
||||
fontFamily: 'Readex Pro',
|
||||
color:
|
||||
themeController.currentColor.sc3,
|
||||
letterSpacing: 0,
|
||||
fontSize: 30.rpx),
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
],
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
)
|
||||
],
|
||||
),
|
||||
),
|
||||
@@ -246,9 +216,20 @@ Future showDateSelectionDialog(BuildContext context,
|
||||
);
|
||||
}
|
||||
|
||||
getOnePicker(context, List arr, int checkIndex, Function onSelectedItemChanged,
|
||||
TextStyle _unitStyle(BuildContext context) {
|
||||
return FlutterFlowTheme.of(context).bodyMedium.override(
|
||||
fontFamily: 'Readex Pro',
|
||||
color: themeController.currentColor.sc3,
|
||||
fontSize: 30.rpx,
|
||||
letterSpacing: 0,
|
||||
);
|
||||
}
|
||||
|
||||
getOnePicker(BuildContext context, List arr, int checkIndex,
|
||||
Function onSelectedItemChanged, String unit,
|
||||
{bool looping = false}) {
|
||||
ThemeController themeController = Get.find();
|
||||
|
||||
return CupertinoPicker(
|
||||
key: UniqueKey(),
|
||||
useMagnifier: false,
|
||||
@@ -258,24 +239,22 @@ getOnePicker(context, List arr, int checkIndex, Function onSelectedItemChanged,
|
||||
squeeze: 1,
|
||||
looping: looping,
|
||||
scrollController: FixedExtentScrollController(initialItem: checkIndex),
|
||||
selectionOverlay: Container(),
|
||||
selectionOverlay: Container(), // 不要默认选中遮罩
|
||||
onSelectedItemChanged: (int value) {
|
||||
// print("$value");
|
||||
onSelectedItemChanged.call(value);
|
||||
},
|
||||
children: [
|
||||
...List.generate(arr.length, (index) {
|
||||
return Container(
|
||||
alignment: Alignment.center,
|
||||
width: 400.rpx,
|
||||
child: Text("${arr[index]}",
|
||||
style: FlutterFlowTheme.of(context).bodyMedium.override(
|
||||
fontFamily: 'Readex Pro',
|
||||
color: themeController.currentColor.sc3,
|
||||
letterSpacing: 0,
|
||||
fontSize: 30.rpx)),
|
||||
);
|
||||
})
|
||||
],
|
||||
children: List.generate(arr.length, (index) {
|
||||
return Container(
|
||||
alignment: Alignment.center,
|
||||
child: Text(
|
||||
"${arr[index]}$unit", // ✅ 每项都带单位
|
||||
style: FlutterFlowTheme.of(context).bodyMedium.override(
|
||||
fontFamily: 'Readex Pro',
|
||||
color: themeController.currentColor.sc3,
|
||||
fontSize: 30.rpx,
|
||||
),
|
||||
),
|
||||
);
|
||||
}),
|
||||
);
|
||||
}
|
||||
|
||||
@@ -38,6 +38,7 @@ class _UpdatePageState extends State<UpdatePersonPage> {
|
||||
@override
|
||||
void initState() {
|
||||
super.initState();
|
||||
personController.dateTime = null;
|
||||
personController.getDiseaseData().then((apiResponse) {
|
||||
if (apiResponse.code != HttpStatusCodes.ok) {
|
||||
TopSlideNotification.show(
|
||||
@@ -108,7 +109,6 @@ class _UpdatePageState extends State<UpdatePersonPage> {
|
||||
if (apiRespons.code == HttpStatusCodes.ok) {
|
||||
TopSlideNotification.show(context,
|
||||
text: apiRespons.msg!);
|
||||
|
||||
} else {
|
||||
TopSlideNotification.show(context,
|
||||
text: apiRespons.msg!,
|
||||
@@ -201,6 +201,8 @@ class _UpdatePageState extends State<UpdatePersonPage> {
|
||||
fontFamily: 'Inter',
|
||||
fontSize: 26.rpx,
|
||||
letterSpacing: 0.0,
|
||||
color: themeController
|
||||
.currentColor.sc4,
|
||||
),
|
||||
enabledBorder: OutlineInputBorder(
|
||||
borderSide: BorderSide(
|
||||
@@ -269,7 +271,7 @@ class _UpdatePageState extends State<UpdatePersonPage> {
|
||||
mainAxisSize: MainAxisSize.max,
|
||||
mainAxisAlignment:
|
||||
MainAxisAlignment.center,
|
||||
children: [
|
||||
children: [
|
||||
Obx(
|
||||
() {
|
||||
bool isMaleGreyed =
|
||||
@@ -441,6 +443,7 @@ class _UpdatePageState extends State<UpdatePersonPage> {
|
||||
personController.dateTime = d;
|
||||
personController.updateAll();
|
||||
},
|
||||
title: "生日".tr,
|
||||
);
|
||||
});
|
||||
},
|
||||
@@ -488,7 +491,7 @@ class _UpdatePageState extends State<UpdatePersonPage> {
|
||||
alignment: AlignmentDirectional(0, 0),
|
||||
child: Stack(
|
||||
alignment: Alignment.center,
|
||||
children: [
|
||||
children: [
|
||||
TextFormField(
|
||||
keyboardType: TextInputType.number,
|
||||
inputFormatters: [
|
||||
@@ -499,8 +502,7 @@ class _UpdatePageState extends State<UpdatePersonPage> {
|
||||
.height.value
|
||||
.toString(),
|
||||
onChanged: (value) {
|
||||
personController.height.value =
|
||||
int.tryParse(value) ?? 0;
|
||||
personController.height.value = value;
|
||||
},
|
||||
autofocus: false,
|
||||
obscureText: false,
|
||||
@@ -573,7 +575,8 @@ class _UpdatePageState extends State<UpdatePersonPage> {
|
||||
Obx(() {
|
||||
final height =
|
||||
personController.height.value;
|
||||
return height == 0
|
||||
return (height == null ||
|
||||
height.isEmpty)
|
||||
? const SizedBox.shrink() // 不显示任何内容
|
||||
: Text(
|
||||
'${height}cm',
|
||||
@@ -625,8 +628,7 @@ class _UpdatePageState extends State<UpdatePersonPage> {
|
||||
.weight.value
|
||||
.toString(),
|
||||
onChanged: (value) {
|
||||
personController.weight.value =
|
||||
int.tryParse(value) ?? 0;
|
||||
personController.weight.value = value;
|
||||
},
|
||||
autofocus: false,
|
||||
obscureText: false,
|
||||
@@ -698,8 +700,9 @@ class _UpdatePageState extends State<UpdatePersonPage> {
|
||||
),
|
||||
Obx(() {
|
||||
final weight =
|
||||
personController.weight.value;
|
||||
return weight == 0
|
||||
personController.weight?.value;
|
||||
return (weight == null ||
|
||||
weight.isEmpty)
|
||||
? const SizedBox.shrink() // 不显示任何内容
|
||||
: Text(
|
||||
'${weight}kg',
|
||||
|
||||
@@ -304,8 +304,7 @@ class _RepairModelWidgetState extends State<RepairModelWidget> {
|
||||
color: themeController.currentColor.sc3,
|
||||
fontSize: AppConstants().normal_text_fontSize,
|
||||
),
|
||||
cursorColor: themeController
|
||||
.currentColor.sc3,
|
||||
cursorColor: themeController.currentColor.sc3,
|
||||
),
|
||||
),
|
||||
),
|
||||
@@ -313,7 +312,7 @@ class _RepairModelWidgetState extends State<RepairModelWidget> {
|
||||
backgroundColor: themeController.currentColor.sc15,
|
||||
highlightColor: themeController.currentColor.sc21,
|
||||
borderRadius: 20.rpx,
|
||||
padding: EdgeInsets.zero, // 原来没有额外 padding,这里保持一致
|
||||
padding: EdgeInsets.zero,
|
||||
onTap: () async {
|
||||
ApiResponse apiResponse = await repairController.uploadImg();
|
||||
print(apiResponse);
|
||||
|
||||
@@ -83,7 +83,7 @@ class _LanguageSettingState extends State<LanguageSetting> {
|
||||
children: [
|
||||
Padding(
|
||||
padding: EdgeInsetsDirectional.fromSTEB(
|
||||
30.rpx, 25.rpx, 30.rpx, 0),
|
||||
0.rpx, 25.rpx, 0.rpx, 0),
|
||||
child: Container(
|
||||
width: double.infinity,
|
||||
decoration: BoxDecoration(
|
||||
|
||||
@@ -15,21 +15,21 @@ class PrivacySchemePage extends StatefulWidget {
|
||||
class _PrivacySchemePageState extends State<PrivacySchemePage> {
|
||||
PrivacyPdfController pdfController = Get.find();
|
||||
|
||||
@override
|
||||
void initState() {
|
||||
super.initState();
|
||||
String language = "zh_CN"; // 默认语言
|
||||
@override
|
||||
void initState() {
|
||||
super.initState();
|
||||
String language = "zh_CN"; // 默认语言
|
||||
|
||||
if (languageController.selectLanguage?.value?.language_code != null) {
|
||||
language = languageController.selectLanguage!.value!.language_code!;
|
||||
if (languageController.selectLanguage?.value?.language_code != null) {
|
||||
language = languageController.selectLanguage!.value!.language_code!;
|
||||
}
|
||||
|
||||
pdfController.loadPdf(
|
||||
2,
|
||||
"https://vsbst-api.he-info.cn/vsbs_sotrage/privacy-scheme/$language.pdf",
|
||||
);
|
||||
}
|
||||
|
||||
pdfController.loadPdf(2,
|
||||
"https://vsbst-api.he-info.cn/vsbs_sotrage/privacy-scheme/$language.pdf",
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return LayoutBuilder(
|
||||
@@ -84,7 +84,7 @@ void initState() {
|
||||
body: SafeArea(
|
||||
top: true,
|
||||
child: Padding(
|
||||
padding: EdgeInsets.symmetric(horizontal: 30.rpx),
|
||||
padding: EdgeInsets.symmetric(horizontal: 0.rpx),
|
||||
child: Column(
|
||||
children: [
|
||||
Expanded(
|
||||
|
||||
@@ -85,7 +85,7 @@ class _UserSchemePageState extends State<UserSchemePage> {
|
||||
body: SafeArea(
|
||||
top: true,
|
||||
child: Padding(
|
||||
padding: EdgeInsets.symmetric(horizontal: 30.rpx),
|
||||
padding: EdgeInsets.symmetric(horizontal: 0.rpx),
|
||||
child: Column(
|
||||
children: [
|
||||
Expanded(
|
||||
|
||||
@@ -57,7 +57,7 @@ var routes = {
|
||||
"/updateUserPage": (contxt) => UpdateUserPage(),
|
||||
"/settingPage": (contxt) => SettingPage(),
|
||||
"/aboutUsPage": (contxt) => AboutUsPage(),
|
||||
"/bodyDevice": (contxt) => BodyDeviceWidget(),
|
||||
"/bodyDevice": (contxt,{arguments}) => BodyDeviceWidget(type:arguments),
|
||||
"/deviceTypeList": (contxt) => DeviceTypeListPage(),
|
||||
"/deviceDetail": (contxt, {arguments}) => DeviceDetailPage(device: arguments),
|
||||
"/instantBodyPage": (contxt, {arguments}) =>
|
||||
|
||||
Reference in New Issue
Block a user