设备 预约接口
This commit is contained in:
@@ -25,10 +25,8 @@ class ServiceConstant {
|
||||
static String calibration_process = "/api/caibration";//校准进度
|
||||
static String submit_repair = "/api/device/repair";//提交报修
|
||||
static String user_setting = "/api/user/config";//查询和更新用户自定义配置
|
||||
|
||||
|
||||
|
||||
|
||||
static String room_list = "/api/room/info"; //查询房间列表
|
||||
static String issue_list = "/api/help/list"; //问题与帮助列表
|
||||
|
||||
static String logService = "$service_address/vsbs_log";
|
||||
static const String webSocketService = "wss://$baseHost/vsbs_ws_gateway/ws";
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
class CommonVariables {
|
||||
static bool isNetWorkOn = false;
|
||||
|
||||
static String supabaseUrl = "https://zhmht.swes.com.cn:3443";
|
||||
// 企业微信客服拉起的url地址
|
||||
static String wxKfUrl = "https://work.weixin.qq.com/kfid/kfcab6a07e8aac68945";
|
||||
// 企业微信ID
|
||||
|
||||
@@ -6,6 +6,7 @@ import 'package:flutter_svg/svg.dart';
|
||||
import 'package:intl/intl.dart';
|
||||
import 'package:url_launcher/url_launcher.dart';
|
||||
import 'package:vbvs_app/common/color/app_uri_status.dart';
|
||||
import 'package:vbvs_app/common/util/CommonVariables.dart';
|
||||
import 'package:vbvs_app/common/util/FitTool.dart';
|
||||
import 'package:vbvs_app/component/tool/ClickableContainer.dart';
|
||||
import 'package:vbvs_app/controller/mh_controller/mh_language_controller.dart';
|
||||
@@ -436,6 +437,16 @@ String time_08_Formatter_pattern(dynamic date, String pattern) {
|
||||
}
|
||||
}
|
||||
|
||||
String storagePubSrc =
|
||||
"${CommonVariables.supabaseUrl}/storage/v1/object/public/";
|
||||
|
||||
getStorageResourceUrl(String v) {
|
||||
if (v.contains('http')) {
|
||||
return v;
|
||||
}
|
||||
return storagePubSrc + v;
|
||||
}
|
||||
|
||||
enum LoadingDialogIcon { ble, wifi, none }
|
||||
|
||||
class LoadingDialog {
|
||||
|
||||
218
lib/controller/mh_controller/bedController.dart
Normal file
218
lib/controller/mh_controller/bedController.dart
Normal file
@@ -0,0 +1,218 @@
|
||||
import 'dart:async';
|
||||
import 'dart:convert';
|
||||
import 'dart:math';
|
||||
import 'dart:typed_data';
|
||||
|
||||
import 'package:ef/ef.dart';
|
||||
import 'package:json_annotation/json_annotation.dart';
|
||||
|
||||
part 'bedController.g.dart'; // 由json_serializable自动生成的部分
|
||||
|
||||
@JsonSerializable()
|
||||
class BedModel {
|
||||
int patternType = 2; //1.助眠 2.手动
|
||||
|
||||
int noAutoPattern = -1; //1 TV 2 零重力 3 阅读 4 放平
|
||||
int zhuMianPattern = -1; //1 一键放松 2 休闲模式 3腰部放松 4 腿部放松
|
||||
// int anMoleftRight = 1; //1.左侧律动 2右侧律动
|
||||
bool anMoStart = false; //启动按摩
|
||||
bool isAnMoBei = false; //背部律动
|
||||
bool isAnMoTui = false; //腿部律动
|
||||
int anMoPattern = -1; //1234分别为模式1、2、3、4
|
||||
double slideValue_bei = 1.0; //背部力度调节
|
||||
double slideValue_tui = 1.0; //腿部力度调节
|
||||
// bool isStart = false; //开启 关闭
|
||||
int timerPattern = 2; //定时设置 10、20、30分钟
|
||||
|
||||
bool isZhuMian = false; //一键助眠开启
|
||||
int zhuMainInitTime = 0;
|
||||
int zhuMainRunTime = 1800; //默认床垫30分钟,床为15分钟
|
||||
int zhuMainRunAllTime = 1800; //默认床垫30分钟,床为15分钟
|
||||
int useLastTime = DateTime.now().millisecondsSinceEpoch; //最新的使用时间
|
||||
|
||||
String? deviceMac; // 当前选中设备mac地址
|
||||
|
||||
List bodyData = [
|
||||
{"lastData": {}, "bodyData": []},
|
||||
{"lastData": {}, "bodyData": []}
|
||||
];
|
||||
|
||||
BedModel();
|
||||
|
||||
factory BedModel.fromJson(Map<String, dynamic> json) {
|
||||
try {
|
||||
return _$BedModelFromJson(json);
|
||||
} catch (e) {
|
||||
return BedModel();
|
||||
}
|
||||
}
|
||||
|
||||
Map<String, dynamic> toJson() => _$BedModelToJson(this);
|
||||
}
|
||||
|
||||
class BedController extends GetControllerEx<BedModel> {
|
||||
// WebsocketProp? websocketProp;
|
||||
|
||||
// ble.ConnectedDeviceProp? deviceProp;
|
||||
|
||||
// GlobalController get glcontroller => Get.find<GlobalController>();
|
||||
|
||||
Function? calibrationListenCall;
|
||||
|
||||
List pinlvTimerList = [null, null];
|
||||
|
||||
BedController() {
|
||||
attr = GetModel(BedModel()).obs;
|
||||
}
|
||||
|
||||
// @override
|
||||
// void onInit() {
|
||||
// super.onInit();
|
||||
// GlobalController globalController = Get.find();
|
||||
// Timer.periodic(Duration(milliseconds: 1000), (e) {
|
||||
// if (model.isZhuMian) {
|
||||
// var deviceInfo = globalController.model.deviceMain; //获取当前选中设备信息
|
||||
// if (deviceInfo != null &&
|
||||
// deviceInfo.isNotEmpty &&
|
||||
// model.deviceMac != deviceInfo["mac"]) {
|
||||
// model.deviceMac = deviceInfo["mac"];
|
||||
// String deviceType = deviceInfo["deviceType"]["id"];
|
||||
// if (deviceType == "1") {
|
||||
// //床
|
||||
// model.zhuMainRunTime = 900;
|
||||
// model.zhuMainRunAllTime = 900;
|
||||
// } else if (deviceType == "3") {
|
||||
// //床垫
|
||||
// model.zhuMainRunTime = 1800;
|
||||
// model.zhuMainRunAllTime = 1800;
|
||||
// }
|
||||
// }
|
||||
|
||||
// int time =
|
||||
// DateTime.now().millisecondsSinceEpoch - model.zhuMainInitTime;
|
||||
// time = time ~/ 1000;
|
||||
// if (time <= model.zhuMainRunAllTime) {
|
||||
// model.zhuMainRunTime = model.zhuMainRunAllTime - time;
|
||||
// } else {
|
||||
// model.isZhuMian = false;
|
||||
// model.zhuMainRunTime = 0;
|
||||
// }
|
||||
// }
|
||||
// updateAll();
|
||||
// });
|
||||
// }
|
||||
|
||||
// Future bleSendCode(d) async {
|
||||
// Completer completer = Completer();
|
||||
// bleSendCodeNext(completer, d);
|
||||
// return completer.future;
|
||||
// }
|
||||
|
||||
// Future bleSendCodeNext(Completer completer, d) async {
|
||||
// if (deviceProp == null) {
|
||||
// showToast("蓝牙设备尚未连接");
|
||||
// completer.completeError(Exception("蓝牙设备尚未连接"));
|
||||
// return;
|
||||
// }
|
||||
// if (deviceProp!.isClose) {
|
||||
// showToast("蓝牙已断开,请稍后再试");
|
||||
// completer.completeError(Exception("蓝牙已断开"));
|
||||
// return;
|
||||
// }
|
||||
// model.useLastTime = DateTime.now().millisecondsSinceEpoch;
|
||||
// deviceProp!.write(Uint8List.fromList(d), ([d]) {
|
||||
// completer.complete("success");
|
||||
// }, (d) {
|
||||
// completer.completeError(Exception("蓝牙发送失败"));
|
||||
// });
|
||||
// }
|
||||
|
||||
// websocketInit() {
|
||||
// websocketProp = WebsocketProp();
|
||||
// websocketProp!.initState(CommonVariables.wsUrl, {"message": onMessage});
|
||||
// }
|
||||
|
||||
// websocketSend(v) {
|
||||
// var deviceMain = glcontroller.model.deviceMain;
|
||||
// if (deviceMain == null || deviceMain["mac"] == null) {
|
||||
// return;
|
||||
// }
|
||||
// print("websocketSend 发送 $v");
|
||||
// websocketProp?.sendMessage(
|
||||
// {"type": "10002", "did": deviceMain["bindMacA"], "state": v});
|
||||
// if (deviceMain["bindMacB"] != null && deviceMain["bindMacB"] != "") {
|
||||
// websocketProp?.sendMessage(
|
||||
// {"type": "10002", "did": deviceMain["bindMacB"], "state": v});
|
||||
// }
|
||||
// }
|
||||
|
||||
// bodyDataHandle(index, data) {
|
||||
// var bodyData = model.bodyData[index]["bodyData"];
|
||||
// if (bodyData.length > 0 &&
|
||||
// data["data"]["deviceSendTime"] != null &&
|
||||
// data["data"]["deviceSendTime"] ==
|
||||
// bodyData[bodyData.length - 1]["deviceSendTime"]) {
|
||||
// return;
|
||||
// }
|
||||
// model.bodyData[index]["lastData"] = data["data"];
|
||||
// model.bodyData[index]["bodyData"].add(data["data"]);
|
||||
// if (model.bodyData[index]["bodyData"].length > 120) {
|
||||
// model.bodyData[index]["bodyData"].removeAt(0);
|
||||
// }
|
||||
// }
|
||||
|
||||
// onMessage(d) {
|
||||
// var data = jsonDecode(d);
|
||||
// if (calibrationListenCall != null) {
|
||||
// calibrationListenCall?.call(data);
|
||||
// return;
|
||||
// }
|
||||
// // print("receive ${data["data"]["deviceNo"]}");
|
||||
// String mac = "${data?["data"]?["deviceNo"]}".toUpperCase() ?? "";
|
||||
// if (CommonVariables.test) {
|
||||
// if (data["data"]["breathRate"] == 0) {
|
||||
// data["data"]["breathRate"] = Random().nextInt(10) + 10;
|
||||
// }
|
||||
// if (data["data"]["heartRate"] == 0) {
|
||||
// data["data"]["heartRate"] = Random().nextInt(10) + 60;
|
||||
// }
|
||||
// }
|
||||
// if ("${glcontroller.model.deviceMain["bindMacA"]}".length > 6 &&
|
||||
// mac == "${glcontroller.model.deviceMain["bindMacA"]}".toUpperCase()) {
|
||||
// bodyDataHandle(0, data);
|
||||
// } else if ("${glcontroller.model.deviceMain["bindMacB"]}".length > 6 &&
|
||||
// mac == "${glcontroller.model.deviceMain["bindMacB"]}".toUpperCase()) {
|
||||
// bodyDataHandle(1, data);
|
||||
// }
|
||||
// }
|
||||
|
||||
// anmoReset() {
|
||||
// pinlvTimerList = [null, null];
|
||||
// model.anMoStart = false; //启动按摩
|
||||
// model.isAnMoBei = false;
|
||||
// model.isAnMoTui = false;
|
||||
// model.anMoPattern = -1; //1234分别为模式1、2、3、4
|
||||
// model.slideValue_bei = 1.0; //背部力度调节
|
||||
// model.slideValue_tui = 1.0; //腿部力度调节
|
||||
// model.timerPattern = -1; //定时设置 10、20、30分钟
|
||||
// updateAll();
|
||||
// }
|
||||
|
||||
// resetParm() {
|
||||
// model.noAutoPattern = -1; //1 TV 2 零重力 3 阅读 4放平
|
||||
// model.zhuMianPattern = -1; //1 一键放松 2 休闲模式 3腰部放松 4 腿部放松
|
||||
// model.isZhuMian = false;
|
||||
// model.useLastTime = DateTime.now().millisecondsSinceEpoch;
|
||||
// model.bodyData = [
|
||||
// {"lastData": {}, "bodyData": []},
|
||||
// {"lastData": {}, "bodyData": []}
|
||||
// ];
|
||||
// anmoReset();
|
||||
// }
|
||||
|
||||
// anMoChange() {
|
||||
// model.zhuMianPattern = -1; //1 一键放松 2 休闲模式 3腰部放松 4 腿部放松
|
||||
// model.isZhuMian = false;
|
||||
// updateAll();
|
||||
// }
|
||||
}
|
||||
46
lib/controller/mh_controller/bedController.g.dart
Normal file
46
lib/controller/mh_controller/bedController.g.dart
Normal file
@@ -0,0 +1,46 @@
|
||||
// GENERATED CODE - DO NOT MODIFY BY HAND
|
||||
|
||||
part of 'bedController.dart';
|
||||
|
||||
// **************************************************************************
|
||||
// JsonSerializableGenerator
|
||||
// **************************************************************************
|
||||
|
||||
BedModel _$BedModelFromJson(Map<String, dynamic> json) => BedModel()
|
||||
..patternType = (json['patternType'] as num).toInt()
|
||||
..noAutoPattern = (json['noAutoPattern'] as num).toInt()
|
||||
..zhuMianPattern = (json['zhuMianPattern'] as num).toInt()
|
||||
..anMoStart = json['anMoStart'] as bool
|
||||
..isAnMoBei = json['isAnMoBei'] as bool
|
||||
..isAnMoTui = json['isAnMoTui'] as bool
|
||||
..anMoPattern = (json['anMoPattern'] as num).toInt()
|
||||
..slideValue_bei = (json['slideValue_bei'] as num).toDouble()
|
||||
..slideValue_tui = (json['slideValue_tui'] as num).toDouble()
|
||||
..timerPattern = (json['timerPattern'] as num).toInt()
|
||||
..isZhuMian = json['isZhuMian'] as bool
|
||||
..zhuMainInitTime = (json['zhuMainInitTime'] as num).toInt()
|
||||
..zhuMainRunTime = (json['zhuMainRunTime'] as num).toInt()
|
||||
..zhuMainRunAllTime = (json['zhuMainRunAllTime'] as num).toInt()
|
||||
..useLastTime = (json['useLastTime'] as num).toInt()
|
||||
..deviceMac = json['deviceMac'] as String?
|
||||
..bodyData = json['bodyData'] as List<dynamic>;
|
||||
|
||||
Map<String, dynamic> _$BedModelToJson(BedModel instance) => <String, dynamic>{
|
||||
'patternType': instance.patternType,
|
||||
'noAutoPattern': instance.noAutoPattern,
|
||||
'zhuMianPattern': instance.zhuMianPattern,
|
||||
'anMoStart': instance.anMoStart,
|
||||
'isAnMoBei': instance.isAnMoBei,
|
||||
'isAnMoTui': instance.isAnMoTui,
|
||||
'anMoPattern': instance.anMoPattern,
|
||||
'slideValue_bei': instance.slideValue_bei,
|
||||
'slideValue_tui': instance.slideValue_tui,
|
||||
'timerPattern': instance.timerPattern,
|
||||
'isZhuMian': instance.isZhuMian,
|
||||
'zhuMainInitTime': instance.zhuMainInitTime,
|
||||
'zhuMainRunTime': instance.zhuMainRunTime,
|
||||
'zhuMainRunAllTime': instance.zhuMainRunAllTime,
|
||||
'useLastTime': instance.useLastTime,
|
||||
'deviceMac': instance.deviceMac,
|
||||
'bodyData': instance.bodyData,
|
||||
};
|
||||
@@ -8,9 +8,7 @@ part of 'device_list_controller.dart';
|
||||
|
||||
DeviceListModel _$DeviceListModelFromJson(Map<String, dynamic> json) =>
|
||||
DeviceListModel()
|
||||
..deviceList = (json['deviceList'] as List<dynamic>)
|
||||
.map((e) => DeviceModel.fromJson(e as Map<String, dynamic>))
|
||||
.toList()
|
||||
..deviceList = json['deviceList'] as List<dynamic>
|
||||
..deviceListWyf = json['deviceListWyf'] as List<dynamic>;
|
||||
|
||||
Map<String, dynamic> _$DeviceListModelToJson(DeviceListModel instance) =>
|
||||
|
||||
@@ -1,6 +1,8 @@
|
||||
import 'package:ef/ef.dart';
|
||||
import 'package:json_annotation/json_annotation.dart';
|
||||
import 'package:vbvs_app/common/color/ServiceConstant.dart';
|
||||
import 'package:vbvs_app/common/color/appConstants.dart';
|
||||
import 'package:vbvs_app/common/util/requestWithLog.dart';
|
||||
|
||||
part 'issue_controller.g.dart';
|
||||
|
||||
@@ -22,34 +24,35 @@ class IssueListModel {
|
||||
}
|
||||
|
||||
class IssueListController extends GetControllerEx<IssueListModel> {
|
||||
// HelpRepository helpRepository = HelpRepository();
|
||||
IssueListController() {
|
||||
attr = GetModel(IssueListModel()).obs;
|
||||
}
|
||||
void onInit() async {
|
||||
super.onInit();
|
||||
await getIssueList();
|
||||
}
|
||||
|
||||
getIssueList() async {
|
||||
model.isLoading = true;
|
||||
updateAll();
|
||||
|
||||
// //初始化列表数据
|
||||
// Future<void> initData() async {
|
||||
// if (model.isLoading) {
|
||||
// return;
|
||||
// }
|
||||
// model.isLoading = true;
|
||||
// final List<dynamic> fetchedRepairs = await helpRepository.findHelpInfos(
|
||||
// limit: model.limit, offset: model.offset);
|
||||
// if (fetchedRepairs != null) {
|
||||
// List<IssueModel> infos = [];
|
||||
// List<dynamic> tmp = fetchedRepairs as List<dynamic>;
|
||||
// try {
|
||||
// // infos = tmp.map((repair) => IssueModel.fromJson(repair)).toList();
|
||||
// // model.issueList!.addAll(infos);
|
||||
// model.issueList.addAll(tmp);
|
||||
// } catch (e) {
|
||||
// print('Error parsing JSON: $e');
|
||||
// }
|
||||
// }
|
||||
// model.offset += model.limit; // 更新 offset,下一次查询跳过当前已经加载的记录
|
||||
// model.hasMore = fetchedRepairs.length == model.limit; // 判断是否还有更多数据
|
||||
// model.isLoading = false;
|
||||
// updateAll();
|
||||
// }
|
||||
String serviceAddress = ServiceConstant.service_address;
|
||||
String serviceName = ServiceConstant.server_service;
|
||||
String serviceApi = ServiceConstant.issue_list;
|
||||
String queryUrl = "$serviceAddress$serviceName$serviceApi";
|
||||
requestWithLog(
|
||||
logTitle: '获取所有的问题与帮助列表',
|
||||
method: MyHttpMethod.get,
|
||||
queryUrl: queryUrl,
|
||||
onSuccess: (res) {
|
||||
model.issueList = res.data;
|
||||
model.isLoading = false;
|
||||
updateAll();
|
||||
},
|
||||
onFailure: (e) {
|
||||
model.isLoading = false;
|
||||
updateAll();
|
||||
},
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,13 +1,15 @@
|
||||
import 'package:ef/ef.dart';
|
||||
import 'package:flutterflow_ui/flutterflow_ui.dart';
|
||||
import 'package:json_annotation/json_annotation.dart';
|
||||
import 'package:vbvs_app/common/color/ServiceConstant.dart';
|
||||
import 'package:vbvs_app/common/util/MyUtils.dart';
|
||||
import 'package:vbvs_app/common/util/requestWithLog.dart';
|
||||
import 'package:vbvs_app/controller/main_bottom/global_controller.dart';
|
||||
|
||||
part 'people_info_controller.g.dart'; // 由json_serializable自动生成的部分
|
||||
|
||||
@JsonSerializable()
|
||||
class PeopleInfoPojo {
|
||||
class PeopleInfoModel {
|
||||
String? name;
|
||||
String sex = "男";
|
||||
String? height;
|
||||
@@ -15,95 +17,71 @@ class PeopleInfoPojo {
|
||||
DateTime? birthday;
|
||||
String? phone;
|
||||
String? contact;
|
||||
List peopleList = [];
|
||||
PeopleInfoModel();
|
||||
|
||||
PeopleInfoPojo();
|
||||
|
||||
// // 从JSON反序列化时的异常处理
|
||||
|
||||
factory PeopleInfoPojo.fromJson(Map<String, dynamic> json) {
|
||||
factory PeopleInfoModel.fromJson(Map<String, dynamic> json) {
|
||||
try {
|
||||
return _$PeopleInfoPojoFromJson(json);
|
||||
return _$PeopleInfoModelFromJson(json);
|
||||
} catch (e) {
|
||||
// 在实际应用中,应该有更细致的异常处理策略和错误日志
|
||||
return PeopleInfoPojo(); // 或者返回一个带有错误信息的特定PeopleInfoModel实例
|
||||
return PeopleInfoModel(); // 或者返回一个带有错误信息的特定PeopleInfoModel实例
|
||||
}
|
||||
}
|
||||
|
||||
// 序列化为JSON时的异常处理
|
||||
Map<String, dynamic> toJson() => _$PeopleInfoPojoToJson(this);
|
||||
Map<String, dynamic> toJson() => _$PeopleInfoModelToJson(this);
|
||||
}
|
||||
|
||||
class PeopleInfoController extends GetControllerEx<PeopleInfoPojo> {
|
||||
class PeopleInfoController extends GetControllerEx<PeopleInfoModel> {
|
||||
PeopleInfoController() {
|
||||
attr = GetModel(PeopleInfoPojo()).obs;
|
||||
attr = GetModel(PeopleInfoModel()).obs;
|
||||
}
|
||||
|
||||
GlobalController get glcontroller => Get.find<GlobalController>();
|
||||
@override
|
||||
Future<void> initData(String mac) async {
|
||||
await getPeoples(mac); // 控制器创建时立即执行
|
||||
}
|
||||
|
||||
// getPeoples() async {
|
||||
// var arr = [];
|
||||
// String bindMacA =
|
||||
// glcontroller.getUpperCaseMac(glcontroller.model.deviceMain["bindMacA"]);
|
||||
// String bindMacB =
|
||||
// glcontroller.getUpperCaseMac(glcontroller.model.deviceMain["bindMacB"]);
|
||||
// arr.add(bindMacA);
|
||||
// if (bindMacB.length > 6) {
|
||||
// arr.add(bindMacB);
|
||||
// } else {
|
||||
// model.peopleList[1] = PeopleInfoPojo();
|
||||
// }
|
||||
// model.peopleList[0] = PeopleInfoPojo();
|
||||
// print("getuser $arr");
|
||||
// var data = await ef.from("app_personnel").select().inFilter("mac", arr);
|
||||
// print("getuser $data");
|
||||
// data?.forEach((d) {
|
||||
// PeopleInfoPojo peopleInfoPojo = PeopleInfoPojo();
|
||||
// peopleInfoPojo.name = d["name"];
|
||||
// peopleInfoPojo.sex = d["gender"] == 1 ? "男" : "女";
|
||||
// peopleInfoPojo.height = d["height"] == null ? null : "${d["height"]}";
|
||||
// peopleInfoPojo.weight = d["weight"] == null ? null : "${d["weight"]}";
|
||||
// if (d["birthday"] != null) {
|
||||
// peopleInfoPojo.birthday = DateTime.parse(d["birthday"]).toLocal();
|
||||
// }
|
||||
// peopleInfoPojo.tel = d["tel"];
|
||||
// peopleInfoPojo.emergencyContact = d["contact"];
|
||||
// if (glcontroller.getUpperCaseMac(d['mac']) == bindMacA) {
|
||||
// model.peopleList[0] = peopleInfoPojo;
|
||||
// }
|
||||
// if (glcontroller.getUpperCaseMac(d['mac']) == bindMacB) {
|
||||
// model.peopleList[1] = peopleInfoPojo;
|
||||
// }
|
||||
// });
|
||||
// updateAll();
|
||||
// attr.value.updateAll();
|
||||
// }
|
||||
getPeoples(String mac) async {
|
||||
String serviceAddress = ServiceConstant.service_address;
|
||||
String serviceName = ServiceConstant.server_service;
|
||||
String serviceApi = ServiceConstant.person_info;
|
||||
String queryUrl = "$serviceAddress$serviceName$serviceApi?mac=$mac";
|
||||
|
||||
// savePeoples() async {
|
||||
// String bindMacA =
|
||||
// glcontroller.getUpperCaseMac(glcontroller.model.deviceMain["bindMacA"]);
|
||||
// String bindMacB =
|
||||
// glcontroller.getUpperCaseMac(glcontroller.model.deviceMain["bindMacB"]);
|
||||
// List<Future> arr = [];
|
||||
// for (var i = 0; i < 2; i++) {
|
||||
// if (i == 1 && bindMacB.length < 6) {
|
||||
// break;
|
||||
// }
|
||||
// arr.add(ef.from("app_personnel").update({
|
||||
// "name": model.peopleList[i].name,
|
||||
// "gender": model.peopleList[i].sex == "男" ? 1 : 0,
|
||||
// "height": int.tryParse("${model.peopleList[i].height}"),
|
||||
// "weight": int.tryParse("${model.peopleList[i].weight}"),
|
||||
// "birthday": model.peopleList[i].birthday == null
|
||||
// ? null
|
||||
// : model.peopleList[i].birthday.toString(),
|
||||
// "tel": model.peopleList[i].tel,
|
||||
// "contact": model.peopleList[i].emergencyContact
|
||||
// }).eq("mac", i == 0 ? bindMacA : bindMacB));
|
||||
// }
|
||||
// return Future.wait(arr);
|
||||
// }
|
||||
requestWithLog(
|
||||
logTitle: "获取设备的人员信息列表",
|
||||
method: MyHttpMethod.get,
|
||||
queryUrl: queryUrl,
|
||||
onSuccess: (res) {
|
||||
if (res.data != null && res.data is List) {
|
||||
model.peopleList = res.data;
|
||||
updateAll();
|
||||
print("peopleList: ${model.peopleList}");
|
||||
}
|
||||
},
|
||||
onFailure: (err) {
|
||||
print("获取人员信息失败: $err");
|
||||
},
|
||||
);
|
||||
}
|
||||
|
||||
// Future saveOnePeople(mac, data) async {
|
||||
// return ef.from("app_personnel").update(data).eq("mac", mac);
|
||||
// }
|
||||
savePeoples(Map<String, dynamic> data) async {
|
||||
String serviceAddress = ServiceConstant.service_address;
|
||||
String serviceName = ServiceConstant.server_service;
|
||||
String serviceApi = ServiceConstant.person_info;
|
||||
String queryUrl = "$serviceAddress$serviceName$serviceApi";
|
||||
requestWithLog(
|
||||
logTitle: "更新人员信息",
|
||||
method: MyHttpMethod.put,
|
||||
queryUrl: queryUrl,
|
||||
data: data,
|
||||
onSuccess: (res) {
|
||||
print("更新人员信息成功: $res");
|
||||
},
|
||||
onFailure: (err) {
|
||||
print("更新人员信息失败: $err");
|
||||
},
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -6,8 +6,8 @@ part of 'people_info_controller.dart';
|
||||
// JsonSerializableGenerator
|
||||
// **************************************************************************
|
||||
|
||||
PeopleInfoPojo _$PeopleInfoPojoFromJson(Map<String, dynamic> json) =>
|
||||
PeopleInfoPojo()
|
||||
PeopleInfoModel _$PeopleInfoModelFromJson(Map<String, dynamic> json) =>
|
||||
PeopleInfoModel()
|
||||
..name = json['name'] as String?
|
||||
..sex = json['sex'] as String
|
||||
..height = json['height'] as String?
|
||||
@@ -15,16 +15,18 @@ PeopleInfoPojo _$PeopleInfoPojoFromJson(Map<String, dynamic> json) =>
|
||||
..birthday = json['birthday'] == null
|
||||
? null
|
||||
: DateTime.parse(json['birthday'] as String)
|
||||
..phone = json['tel'] as String?
|
||||
..contact = json['emergencyContact'] as String?;
|
||||
..phone = json['phone'] as String?
|
||||
..contact = json['contact'] as String?
|
||||
..peopleList = json['peopleList'] as List<dynamic>;
|
||||
|
||||
Map<String, dynamic> _$PeopleInfoPojoToJson(PeopleInfoPojo instance) =>
|
||||
Map<String, dynamic> _$PeopleInfoModelToJson(PeopleInfoModel instance) =>
|
||||
<String, dynamic>{
|
||||
'name': instance.name,
|
||||
'sex': instance.sex,
|
||||
'height': instance.height,
|
||||
'weight': instance.weight,
|
||||
'birthday': instance.birthday?.toIso8601String(),
|
||||
'tel': instance.phone,
|
||||
'emergencyContact': instance.contact,
|
||||
'phone': instance.phone,
|
||||
'contact': instance.contact,
|
||||
'peopleList': instance.peopleList,
|
||||
};
|
||||
|
||||
@@ -36,6 +36,7 @@ import 'package:vbvs_app/controller/message/message_review_controller.dart';
|
||||
import 'package:vbvs_app/controller/message/message_setting_controller.dart';
|
||||
import 'package:vbvs_app/controller/mh_controller/address_controller.dart';
|
||||
import 'package:vbvs_app/controller/mh_controller/address_list_controller.dart';
|
||||
import 'package:vbvs_app/controller/mh_controller/bedController.dart';
|
||||
import 'package:vbvs_app/controller/mh_controller/book_info_controller.dart';
|
||||
import 'package:vbvs_app/controller/mh_controller/device_list_controller.dart';
|
||||
import 'package:vbvs_app/controller/mh_controller/experience_store_list_page.dart';
|
||||
@@ -292,6 +293,13 @@ class MyApp extends StatelessWidget {
|
||||
debugShowCheckedModeBanner: false,
|
||||
title: '',
|
||||
theme: themeController.currentTheme,
|
||||
localizationsDelegates: const [
|
||||
GlobalMaterialLocalizations.delegate,
|
||||
GlobalWidgetsLocalizations.delegate,
|
||||
GlobalCupertinoLocalizations.delegate,
|
||||
],
|
||||
locale: Locale('zh', 'CN'), // 设置默认语言为中文
|
||||
|
||||
// home: MainPageBBottomChange(),
|
||||
// initialRoute: "/loginPage",
|
||||
initialRoute: "/mianPageBottomChange",
|
||||
@@ -336,7 +344,10 @@ class MyApp extends StatelessWidget {
|
||||
Get.lazyPut(() => MHTRegisterController()),
|
||||
Get.lazyPut(() => WeatherModelController()),
|
||||
Get.lazyPut(() => RegisterController()),
|
||||
Get.lazyPut(() => SleepingHabitController()),
|
||||
Get.lazyPut(() => BedController()),
|
||||
Get.lazyPut(() => UpdatePasswordController()),
|
||||
Get.lazyPut(() => IssueListController()),
|
||||
Get.lazyPut(() => DeviceListController()),
|
||||
Get.lazyPut(() => MHTBlueToothController()),
|
||||
Get.lazyPut(() => MHTHomeController()),
|
||||
|
||||
@@ -1058,6 +1058,7 @@ class _CalibrationPersonPageState extends State<CalibrationPersonPage> {
|
||||
);
|
||||
},
|
||||
onFailure: (res) {},
|
||||
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -16,36 +16,32 @@ class MattressControlPage extends StatefulWidget {
|
||||
class _MattressControlPageState extends State<MattressControlPage> {
|
||||
final controller = Get.put(ControlCardController());
|
||||
|
||||
final data ={
|
||||
"_id": "6840ee86693db58798000000",
|
||||
"uid": "68465947a0cff49592000000",
|
||||
"bind_type": 1,
|
||||
"device_type": 1,
|
||||
"mac": "B43A45C3E9A8",
|
||||
"bind_mac": null,
|
||||
"position": 0,
|
||||
"share_uid": null,
|
||||
"person": {
|
||||
"name": "bb",
|
||||
"gender": 0,
|
||||
"birthday": "2025/05/27",
|
||||
"weight": "10",
|
||||
"height": "100",
|
||||
"disease": []
|
||||
},
|
||||
"show": true,
|
||||
"create_time": 1749085830536,
|
||||
"shareNum": 0,
|
||||
"status": {
|
||||
"signal": -1,
|
||||
"status": 0,
|
||||
"inBed": 0,
|
||||
"upgrade": 0,
|
||||
"failure": 0,
|
||||
"updateTime": 1749110182000
|
||||
},
|
||||
"code": "B43A45C3E9A8"
|
||||
};
|
||||
final data = {
|
||||
"_id": "684bf0845a81f423c0000000",
|
||||
"uid": "68465947a0cff49592000000",
|
||||
"bind_type": 1,
|
||||
"device_type": 3,
|
||||
"mac": "545024122617",
|
||||
"bind_mac": null,
|
||||
"bind_mac_a": "48CA43B2E8C8",
|
||||
"bind_mac_b": "48CA43B2E8B0",
|
||||
"position": 0,
|
||||
"share_uid": null,
|
||||
"person": null,
|
||||
"op_type": null,
|
||||
"show": true,
|
||||
"create_time": 1749807236514,
|
||||
"shareNum": 0,
|
||||
"status": {
|
||||
"signal": -1,
|
||||
"status": 0,
|
||||
"inBed": 0,
|
||||
"upgrade": 0,
|
||||
"failure": 0,
|
||||
"updateTime": -1
|
||||
},
|
||||
"code": "545024122617"
|
||||
};
|
||||
int selectedIndex = 1; // 当前选中的tab索引
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
|
||||
@@ -150,9 +150,6 @@ class ApplyRepairPage extends GetView<ApplyRepairController> {
|
||||
fontSize:
|
||||
AppFontsize
|
||||
.title_size,
|
||||
fontWeight:
|
||||
FontWeight
|
||||
.bold,
|
||||
color: Colors
|
||||
.white // 加粗文字
|
||||
),
|
||||
@@ -200,9 +197,8 @@ class ApplyRepairPage extends GetView<ApplyRepairController> {
|
||||
style: FlutterFlowTheme.of(context).bodyMedium.override(
|
||||
fontFamily:
|
||||
'Readex Pro',
|
||||
fontSize:
|
||||
AppFontsize
|
||||
.normal_text_size,
|
||||
fontSize: 26
|
||||
.rpx,
|
||||
letterSpacing:
|
||||
0,
|
||||
color: Colors
|
||||
@@ -353,9 +349,8 @@ class ApplyRepairPage extends GetView<ApplyRepairController> {
|
||||
style: FlutterFlowTheme.of(context).bodyMedium.override(
|
||||
fontFamily:
|
||||
'Readex Pro',
|
||||
fontSize:
|
||||
AppFontsize
|
||||
.normal_text_size,
|
||||
fontSize: 26
|
||||
.rpx,
|
||||
letterSpacing:
|
||||
0,
|
||||
color: Colors
|
||||
@@ -524,9 +519,8 @@ class ApplyRepairPage extends GetView<ApplyRepairController> {
|
||||
style: FlutterFlowTheme.of(context).bodyMedium.override(
|
||||
fontFamily:
|
||||
'Readex Pro',
|
||||
fontSize:
|
||||
AppFontsize
|
||||
.normal_text_size,
|
||||
fontSize: 26
|
||||
.rpx,
|
||||
letterSpacing:
|
||||
0,
|
||||
color: Colors
|
||||
@@ -695,9 +689,8 @@ class ApplyRepairPage extends GetView<ApplyRepairController> {
|
||||
style: FlutterFlowTheme.of(context).bodyMedium.override(
|
||||
fontFamily:
|
||||
'Readex Pro',
|
||||
fontSize:
|
||||
AppFontsize
|
||||
.normal_text_size,
|
||||
fontSize: 26
|
||||
.rpx,
|
||||
letterSpacing:
|
||||
0,
|
||||
color: Colors
|
||||
@@ -1314,6 +1307,8 @@ class ApplyRepairPage extends GetView<ApplyRepairController> {
|
||||
10, 5, 10, 5),
|
||||
),
|
||||
maxLines: 4,
|
||||
maxLength:
|
||||
100, // ✅ 限制最多输入 100 字符
|
||||
style: FlutterFlowTheme.of(
|
||||
context)
|
||||
.bodyMedium
|
||||
@@ -1443,9 +1438,8 @@ class ApplyRepairPage extends GetView<ApplyRepairController> {
|
||||
style: FlutterFlowTheme.of(context).bodyMedium.override(
|
||||
fontFamily:
|
||||
'Readex Pro',
|
||||
fontSize:
|
||||
AppFontsize
|
||||
.small_text_size,
|
||||
fontSize: 26
|
||||
.rpx,
|
||||
letterSpacing:
|
||||
0,
|
||||
color: Colors
|
||||
@@ -1486,6 +1480,9 @@ class ApplyRepairPage extends GetView<ApplyRepairController> {
|
||||
.apply_name,
|
||||
obscureText:
|
||||
false,
|
||||
textAlignVertical:
|
||||
TextAlignVertical
|
||||
.center,
|
||||
decoration:
|
||||
InputDecoration(
|
||||
contentPadding:
|
||||
@@ -1624,9 +1621,8 @@ class ApplyRepairPage extends GetView<ApplyRepairController> {
|
||||
style: FlutterFlowTheme.of(context).bodyMedium.override(
|
||||
fontFamily:
|
||||
'Readex Pro',
|
||||
fontSize:
|
||||
AppFontsize
|
||||
.small_text_size,
|
||||
fontSize: 26
|
||||
.rpx,
|
||||
letterSpacing:
|
||||
0,
|
||||
color: Colors
|
||||
@@ -1664,6 +1660,9 @@ class ApplyRepairPage extends GetView<ApplyRepairController> {
|
||||
.tel,
|
||||
obscureText:
|
||||
false,
|
||||
textAlignVertical:
|
||||
TextAlignVertical
|
||||
.center,
|
||||
decoration:
|
||||
InputDecoration(
|
||||
contentPadding:
|
||||
|
||||
@@ -96,7 +96,7 @@ class BluetoothPage extends GetView {
|
||||
),
|
||||
|
||||
const SizedBox(height: 4),
|
||||
Text('MAC:4645146546',
|
||||
Text(data['mac']?.toString() ?? '未命名',
|
||||
style: TextStyle(
|
||||
color: Colors.white70, fontSize: 26.rpx)),
|
||||
|
||||
|
||||
@@ -37,7 +37,7 @@ class BookInfoPage extends GetView<BookInfoController> {
|
||||
),
|
||||
),
|
||||
child: Scaffold(
|
||||
resizeToAvoidBottomInset: false, // 自
|
||||
// resizeToAvoidBottomInset: false, // 自
|
||||
// key: scaffoldKey,
|
||||
backgroundColor: Colors.transparent,
|
||||
appBar: AppBar(
|
||||
@@ -323,6 +323,8 @@ class BookInfoPage extends GetView<BookInfoController> {
|
||||
onChanged: (d) {
|
||||
controller.model.userName = d;
|
||||
},
|
||||
enableInteractiveSelection:
|
||||
false,
|
||||
obscureText: false,
|
||||
decoration: InputDecoration(
|
||||
labelStyle:
|
||||
@@ -393,9 +395,8 @@ class BookInfoPage extends GetView<BookInfoController> {
|
||||
8),
|
||||
),
|
||||
contentPadding:
|
||||
const EdgeInsetsDirectional
|
||||
.fromSTEB(
|
||||
0, 0, 0, 12),
|
||||
EdgeInsets.symmetric(
|
||||
vertical: 0),
|
||||
),
|
||||
style:
|
||||
FlutterFlowTheme.of(context)
|
||||
@@ -417,6 +418,7 @@ class BookInfoPage extends GetView<BookInfoController> {
|
||||
),
|
||||
),
|
||||
),
|
||||
|
||||
getLine(),
|
||||
Padding(
|
||||
padding: EdgeInsetsDirectional.fromSTEB(
|
||||
@@ -545,9 +547,8 @@ class BookInfoPage extends GetView<BookInfoController> {
|
||||
8),
|
||||
),
|
||||
contentPadding:
|
||||
const EdgeInsetsDirectional
|
||||
.fromSTEB(
|
||||
0, 0, 0, 12),
|
||||
EdgeInsets.symmetric(
|
||||
vertical: 0),
|
||||
),
|
||||
style:
|
||||
FlutterFlowTheme.of(context)
|
||||
|
||||
@@ -33,57 +33,56 @@ class _DeviceListPageState extends State<DeviceListPage> {
|
||||
return LayoutBuilder(builder: (context, cc) {
|
||||
bodysize = cc;
|
||||
return GestureDetector(
|
||||
onTap: () => FocusScope.of(context).unfocus(),
|
||||
child: Container(
|
||||
decoration: const BoxDecoration(
|
||||
image: DecorationImage(
|
||||
image: AssetImage('assets/images/new_background.png'), // 本地图片
|
||||
fit: BoxFit.fill, // 填满整个 Container
|
||||
onTap: () => FocusScope.of(context).unfocus(),
|
||||
child: Scaffold(
|
||||
resizeToAvoidBottomInset: false,
|
||||
appBar: AppBar(
|
||||
backgroundColor: Colors.transparent,
|
||||
automaticallyImplyLeading: false,
|
||||
iconTheme: IconThemeData(color: Colors.white),
|
||||
titleSpacing: 0,
|
||||
// leading: returnIconButtomAddCallback(() {
|
||||
// controller.saveDataApi();
|
||||
// updateParm(isShowToast: false);
|
||||
// }),
|
||||
// leading: returnIconButtomNew,
|
||||
title: Container(
|
||||
width: double.infinity,
|
||||
height: 180.rpx,
|
||||
child: Stack(
|
||||
alignment: Alignment.center,
|
||||
children: [
|
||||
// 中间居中的标题
|
||||
Text(
|
||||
'设备列表',
|
||||
textAlign: TextAlign.center,
|
||||
style: TextStyle(
|
||||
color: Colors.white,
|
||||
fontSize: 30.rpx,
|
||||
),
|
||||
),
|
||||
// 左侧图标
|
||||
Positioned(
|
||||
left: 20.rpx,
|
||||
child: returnIconButtomNew,
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
|
||||
actions: [],
|
||||
centerTitle: false,
|
||||
),
|
||||
child: Scaffold(
|
||||
appBar: AppBar(
|
||||
backgroundColor: Colors.transparent,
|
||||
automaticallyImplyLeading: false,
|
||||
iconTheme: IconThemeData(color: Colors.white),
|
||||
titleSpacing: 0,
|
||||
// leading: returnIconButtomAddCallback(() {
|
||||
// controller.saveDataApi();
|
||||
// updateParm(isShowToast: false);
|
||||
// }),
|
||||
// leading: returnIconButtomNew,
|
||||
title: Container(
|
||||
width: double.infinity,
|
||||
height: 180.rpx,
|
||||
child: Stack(
|
||||
alignment: Alignment.center,
|
||||
children: [
|
||||
// 中间居中的标题
|
||||
Text(
|
||||
'设备列表',
|
||||
textAlign: TextAlign.center,
|
||||
style: TextStyle(
|
||||
color: Colors.white,
|
||||
fontSize: 30.rpx,
|
||||
),
|
||||
),
|
||||
// 左侧图标
|
||||
Positioned(
|
||||
left: 20.rpx,
|
||||
child: returnIconButtomNew,
|
||||
),
|
||||
],
|
||||
backgroundColor: Colors.transparent,
|
||||
body: Stack(
|
||||
children: [
|
||||
Positioned.fill(
|
||||
child: Image.asset(
|
||||
'assets/images/new_background.png',
|
||||
fit: BoxFit.fill,
|
||||
),
|
||||
),
|
||||
|
||||
actions: [],
|
||||
centerTitle: false,
|
||||
),
|
||||
backgroundColor: Colors.transparent,
|
||||
body: Container(
|
||||
width: bodysize!.maxWidth,
|
||||
height: bodysize!.maxHeight,
|
||||
child: Column(
|
||||
Column(
|
||||
mainAxisSize: MainAxisSize.max,
|
||||
children: [
|
||||
Padding(
|
||||
@@ -126,9 +125,16 @@ class _DeviceListPageState extends State<DeviceListPage> {
|
||||
}),
|
||||
],
|
||||
),
|
||||
),
|
||||
],
|
||||
)
|
||||
|
||||
// Container(
|
||||
// width: bodysize!.maxWidth,
|
||||
// height: bodysize!.maxHeight,
|
||||
|
||||
// ),
|
||||
),
|
||||
));
|
||||
);
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
@@ -8,34 +8,13 @@ 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/controller/main_bottom/global_controller.dart';
|
||||
import 'package:vbvs_app/controller/mh_controller/people_info_controller.dart';
|
||||
|
||||
class DevicePeopleInfo extends GetView {
|
||||
class DevicePeopleInfo extends GetView<PeopleInfoController> {
|
||||
Map data;
|
||||
DevicePeopleInfo({required this.data});
|
||||
|
||||
// get glController => Get.find<GlobalController>();
|
||||
// get bodyData => glController.model.mainDevicePeople;
|
||||
RxList<dynamic> peopleList = <dynamic>[].obs;
|
||||
Future<void> devicePeopleInfo() async {
|
||||
String serviceAddress = ServiceConstant.service_address;
|
||||
String serviceName = ServiceConstant.server_service;
|
||||
String serviceApi = ServiceConstant.person_info;
|
||||
String queryUrl =
|
||||
"$serviceAddress$serviceName$serviceApi?mac=${data["mac"]}";
|
||||
|
||||
requestWithLog(
|
||||
logTitle: "获取设备的人员信息列表",
|
||||
method: MyHttpMethod.get,
|
||||
queryUrl: queryUrl,
|
||||
onSuccess: (res) {
|
||||
if (res.data != null && res.data is List) {
|
||||
peopleList.assignAll(res.data);
|
||||
print("peopleList: $peopleList");
|
||||
}
|
||||
},
|
||||
);
|
||||
}
|
||||
|
||||
PeopleInfoController controller = Get.put(PeopleInfoController());
|
||||
getInfoRow(context, String str) {
|
||||
return Container(
|
||||
width: double.infinity,
|
||||
@@ -56,11 +35,6 @@ class DevicePeopleInfo extends GetView {
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
WidgetsBinding.instance.addPostFrameCallback((_) {
|
||||
if (data["device_type"] == 1 && peopleList.isEmpty) {
|
||||
devicePeopleInfo();
|
||||
}
|
||||
});
|
||||
return LayoutBuilder(
|
||||
builder: (context, boxConstraints) => GestureDetector(
|
||||
onTap: () => FocusScope.of(context).unfocus(),
|
||||
@@ -170,9 +144,10 @@ class DevicePeopleInfo extends GetView {
|
||||
],
|
||||
),
|
||||
)),
|
||||
if (data["device_type"] == 1 && peopleList.isNotEmpty)
|
||||
...List.generate(peopleList.length, (index) {
|
||||
final person = peopleList[index];
|
||||
if (controller.model.peopleList.isNotEmpty)
|
||||
...List.generate(controller.model.peopleList.length,
|
||||
(index) {
|
||||
final person = controller.model.peopleList[index];
|
||||
String location_ = '';
|
||||
if ("${data["bindMacB"]}".length > 6 &&
|
||||
(person["direction"] == 1 ||
|
||||
@@ -206,9 +181,8 @@ class DevicePeopleInfo extends GetView {
|
||||
),
|
||||
),
|
||||
if (location_.isNotEmpty)
|
||||
getInfoRow(context, "校准位置:$location_"),
|
||||
getInfoRow(
|
||||
context, "姓名:${person["name"] ?? "-"}"),
|
||||
getInfoRow(context,
|
||||
"姓名:${person["name"] ?? "-"}"),
|
||||
getInfoRow(context,
|
||||
"性别:${person["gender"] == null ? "-" : (person["gender"] == 1 ? "男" : "女")}"),
|
||||
getInfoRow(context,
|
||||
|
||||
@@ -147,7 +147,11 @@ class _ExperienceStorePageState extends State<ExperienceStorePage> {
|
||||
if (controller
|
||||
.model.experienceStoreModelList.length ==
|
||||
0) {
|
||||
return Empty();
|
||||
return CircularProgressIndicator(
|
||||
strokeWidth: 1,
|
||||
valueColor:
|
||||
AlwaysStoppedAnimation<Color>(Colors.white),
|
||||
);
|
||||
} else {
|
||||
return Container();
|
||||
}
|
||||
|
||||
136
lib/pages/mh_page/help/article.dart
Normal file
136
lib/pages/mh_page/help/article.dart
Normal file
@@ -0,0 +1,136 @@
|
||||
import 'package:ef/ef.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_inappwebview/flutter_inappwebview.dart';
|
||||
import 'package:vbvs_app/common/color/appColors.dart';
|
||||
import 'package:vbvs_app/common/util/MyUtils.dart';
|
||||
import 'package:vbvs_app/controller/user_info_controller.dart';
|
||||
|
||||
class HelpArticle extends StatelessWidget {
|
||||
Map article;
|
||||
HelpArticle({super.key, required this.article});
|
||||
|
||||
// get articleController => Get.find<ArticleController>();
|
||||
get userInfoController => Get.find<UserInfoController>();
|
||||
|
||||
var isLike = 0.obs;
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
String top_imgOrVideo = "";
|
||||
if (article['imgOrVideo'] == 0) {
|
||||
top_imgOrVideo =
|
||||
'''<img class="video" src="${getStorageResourceUrl(article['coverUrl'])}" />''';
|
||||
} else {
|
||||
top_imgOrVideo =
|
||||
'''<video controls class="video" src="${getStorageResourceUrl(article['videoUrl'])}" ></video>''';
|
||||
}
|
||||
String newText = article['text'];
|
||||
|
||||
RegExp("<img\\s*src=\"([^\"]*)\"")
|
||||
.allMatches(newText)
|
||||
.toList()
|
||||
.map((d) => d.group(1))
|
||||
.toList()
|
||||
.forEach((d) {
|
||||
newText = newText.replaceAll("$d", getStorageResourceUrl("$d"));
|
||||
});
|
||||
|
||||
String html = '''
|
||||
<html>
|
||||
<meta name="viewport" charset="UTF-8"
|
||||
content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0" />
|
||||
|
||||
<head>
|
||||
<title>Test Page</title>
|
||||
</head>
|
||||
<style>
|
||||
|
||||
body {
|
||||
width: 98%;
|
||||
margin: 0 auto;
|
||||
overflow-x: hidden;
|
||||
}
|
||||
|
||||
.video {
|
||||
width: 100%;
|
||||
height: 270px;
|
||||
background-color: #9EA4B7;
|
||||
border-radius: 6px;
|
||||
}
|
||||
</style>
|
||||
|
||||
<body>
|
||||
<div style="padding: 15px;width: calc(100% - 36px);">
|
||||
${top_imgOrVideo}
|
||||
<div style="height: 2px;width: 100%;background-color: #D6D6D6;margin: 15px 0 15px 0;"></div>
|
||||
<div style="line-height: 22px;font-size: 15px;">${article['title']}</div>
|
||||
<div style="display: flex;align-items: center;font-size: 13;margin-bottom: 24px;margin-top: 10px;">
|
||||
<div style="color: #182B7C;">${article['author']}</div>
|
||||
<div style="margin-left: 13px; color: #D3D3D3;">${time_08_Formatter(article['created_at'])}</div>
|
||||
</div>
|
||||
${newText}
|
||||
</div>
|
||||
</body>
|
||||
|
||||
</html>
|
||||
''';
|
||||
|
||||
print("$html");
|
||||
// articleController.readAdd(article['id']);
|
||||
String? uid = userInfoController.model.user?.uid;
|
||||
print("${userInfoController.model.user}");
|
||||
// uid = "sss";
|
||||
// if (uid != null) {
|
||||
// articleController.findIsLike(uid, article['id']).then((d) {
|
||||
// isLike.value = d;
|
||||
// });
|
||||
// }
|
||||
|
||||
return LayoutBuilder(
|
||||
builder: (context, boxConstraints) => GestureDetector(
|
||||
onTap: () => FocusScope.of(context).unfocus(),
|
||||
child: Scaffold(
|
||||
appBar: AppBar(
|
||||
backgroundColor: AppColors.bg_color,
|
||||
automaticallyImplyLeading: false,
|
||||
iconTheme: IconThemeData(color: Colors.white),
|
||||
titleSpacing: 0,
|
||||
leading: returnIconButtom,
|
||||
),
|
||||
body: SafeArea(
|
||||
top: true,
|
||||
child: Container(
|
||||
width: MediaQuery.sizeOf(context).width,
|
||||
height: MediaQuery.sizeOf(context).height,
|
||||
decoration: BoxDecoration(
|
||||
color: Colors.white,
|
||||
// color: AppColors.bg_color,
|
||||
// image: DecorationImage(
|
||||
// image: AssetImage("assets/images/background.png$test"),
|
||||
// fit: BoxFit.cover,
|
||||
// ),
|
||||
),
|
||||
child: Column(
|
||||
children: [
|
||||
Expanded(
|
||||
child: Container(
|
||||
// child: WebViewWidget(
|
||||
// controller: WebViewController()
|
||||
// ..setJavaScriptMode(JavaScriptMode.unrestricted)
|
||||
// ..loadHtmlString(html),
|
||||
// ),
|
||||
child: InAppWebView(
|
||||
initialData:
|
||||
InAppWebViewInitialData(data: html, encoding: ""),
|
||||
),
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
@@ -11,13 +11,9 @@ class IssueListPage extends GetView<IssueListController> {
|
||||
final scaffoldKey = GlobalKey<ScaffoldState>();
|
||||
BoxConstraints? bodysize;
|
||||
|
||||
final ScrollController scrollController = ScrollController();
|
||||
|
||||
IssueListController controller = Get.put(IssueListController());
|
||||
// ScrollController scrollController = ScrollController();
|
||||
// IssueListPage() {
|
||||
// controller.model.limit = AppConstants.limit;
|
||||
// controller.model.offset = 0;
|
||||
// controller.model.isLoading = false;
|
||||
// controller.model.hasMore = true;
|
||||
// controller.model.issueList!.clear();
|
||||
// controller.initData();
|
||||
|
||||
@@ -31,20 +27,10 @@ class IssueListPage extends GetView<IssueListController> {
|
||||
// });
|
||||
// }
|
||||
|
||||
// void initData() async {}
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return LayoutBuilder(builder: (context, cc) {
|
||||
bodysize = cc;
|
||||
controller.model.issueList = [
|
||||
{'title': 'APP如何连接我的智能床?'},
|
||||
{'title': '智能床如何连接网络?'},
|
||||
{'title': '跟换WIFI名称或密码,或者刚换了路由器后,我的智能床无法使用怎么办?'},
|
||||
{'title': '在APP中,如何查看我的睡眠报告?'},
|
||||
{'title': '在APP中,如何查看我的睡眠报告?'},
|
||||
{'title': '在APP中,如何查看我的睡眠报告?'}
|
||||
];
|
||||
return GestureDetector(
|
||||
onTap: () => FocusScope.of(context).unfocus(),
|
||||
child: Container(
|
||||
@@ -96,89 +82,120 @@ class IssueListPage extends GetView<IssueListController> {
|
||||
// color: Color(0xFFF6F6F6),
|
||||
),
|
||||
child: Obx(() {
|
||||
return Visibility(
|
||||
visible: controller.model.issueList != null &&
|
||||
controller.model.issueList!.isNotEmpty,
|
||||
replacement: Container(
|
||||
if (controller.model.isLoading) {
|
||||
return Center(child: CircularProgressIndicator()); // ✅ 加载中
|
||||
}
|
||||
|
||||
if (controller.model.issueList.isEmpty) {
|
||||
return Container(
|
||||
width: MediaQuery.sizeOf(context).width,
|
||||
height: 100,
|
||||
decoration: BoxDecoration(
|
||||
color: FlutterFlowTheme.of(context).secondaryBackground,
|
||||
),
|
||||
child: Padding(
|
||||
padding: EdgeInsetsDirectional.fromSTEB(31, 27, 0, 0),
|
||||
child: Column(
|
||||
mainAxisSize: MainAxisSize.max,
|
||||
children: [
|
||||
Align(
|
||||
alignment: AlignmentDirectional(-1, 0),
|
||||
child: Text(
|
||||
'暂无内容!',
|
||||
style: FlutterFlowTheme.of(context)
|
||||
.bodyMedium
|
||||
.override(
|
||||
fontFamily: 'Readex Pro',
|
||||
color: Color(0xFF9EA4B7),
|
||||
fontSize: AppFontsize.title_size,
|
||||
letterSpacing: 0,
|
||||
fontWeight: FontWeight.w600,
|
||||
),
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
child: Column(
|
||||
mainAxisSize: MainAxisSize.max,
|
||||
children: [
|
||||
// TitleComponentWidget(
|
||||
// titleName: '问题与帮助',
|
||||
// ),
|
||||
Flexible(
|
||||
child: Padding(
|
||||
padding:
|
||||
EdgeInsetsDirectional.fromSTEB(15, 13, 15, 15),
|
||||
child: Container(
|
||||
width: bodysize!.maxWidth,
|
||||
decoration: BoxDecoration(
|
||||
// color: Colors.white,
|
||||
// borderRadius: BorderRadius.circular(16),
|
||||
),
|
||||
child: Obx(() => ListView(
|
||||
controller: scrollController,
|
||||
padding: const EdgeInsets.fromLTRB(
|
||||
0,
|
||||
5,
|
||||
0,
|
||||
0,
|
||||
),
|
||||
shrinkWrap: true,
|
||||
scrollDirection: Axis.vertical,
|
||||
children: (controller.model.issueList!
|
||||
.asMap()
|
||||
.entries
|
||||
.map((e) => IssuePreviewWidget(
|
||||
index: e.key,
|
||||
issueListController: controller))
|
||||
.toList() as List<Widget>)
|
||||
// .divide(const SizedBox(
|
||||
// height: 30,
|
||||
// ))
|
||||
// .addToEnd(const SizedBox(
|
||||
// height: 26,
|
||||
// ))
|
||||
// .addToStart(SizedBox(
|
||||
// height: 16,
|
||||
// ))
|
||||
)),
|
||||
),
|
||||
child: Align(
|
||||
alignment: AlignmentDirectional(-1, 0),
|
||||
child: Text(
|
||||
'暂无内容!',
|
||||
style: FlutterFlowTheme.of(context)
|
||||
.bodyMedium
|
||||
.override(
|
||||
fontFamily: 'Readex Pro',
|
||||
color: Color(0xFF9EA4B7),
|
||||
fontSize: AppFontsize.title_size,
|
||||
fontWeight: FontWeight.w600,
|
||||
),
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
// 有数据时渲染列表
|
||||
return ListView(
|
||||
children: controller.model.issueList!
|
||||
.asMap()
|
||||
.entries
|
||||
.map((e) => IssuePreviewWidget(
|
||||
index: e.key,
|
||||
issueListController: controller,
|
||||
))
|
||||
.toList(),
|
||||
);
|
||||
}),
|
||||
|
||||
// Obx(() {
|
||||
// return Visibility(
|
||||
// visible: controller.model.issueList != null &&
|
||||
// controller.model.issueList.isNotEmpty,
|
||||
// replacement: Container(
|
||||
// width: MediaQuery.sizeOf(context).width,
|
||||
// height: 100,
|
||||
// decoration: BoxDecoration(
|
||||
// color: FlutterFlowTheme.of(context).secondaryBackground,
|
||||
// ),
|
||||
// child: Padding(
|
||||
// padding: EdgeInsetsDirectional.fromSTEB(31, 27, 0, 0),
|
||||
// child: Column(
|
||||
// mainAxisSize: MainAxisSize.max,
|
||||
// children: [
|
||||
// Align(
|
||||
// alignment: AlignmentDirectional(-1, 0),
|
||||
// child: Text(
|
||||
// '暂无内容!',
|
||||
// style: FlutterFlowTheme.of(context)
|
||||
// .bodyMedium
|
||||
// .override(
|
||||
// fontFamily: 'Readex Pro',
|
||||
// color: Color(0xFF9EA4B7),
|
||||
// fontSize: AppFontsize.title_size,
|
||||
// letterSpacing: 0,
|
||||
// fontWeight: FontWeight.w600,
|
||||
// ),
|
||||
// ),
|
||||
// ),
|
||||
// ],
|
||||
// ),
|
||||
// ),
|
||||
// ),
|
||||
// child: Column(
|
||||
// mainAxisSize: MainAxisSize.max,
|
||||
// children: [
|
||||
// // TitleComponentWidget(
|
||||
// // titleName: '问题与帮助',
|
||||
// // ),
|
||||
// Flexible(
|
||||
// child: Padding(
|
||||
// padding:
|
||||
// EdgeInsetsDirectional.fromSTEB(15, 13, 15, 15),
|
||||
// child: Container(
|
||||
// width: bodysize!.maxWidth,
|
||||
// decoration: BoxDecoration(
|
||||
// // color: Colors.white,
|
||||
// // borderRadius: BorderRadius.circular(16),
|
||||
// ),
|
||||
// child: Obx(() => ListView(
|
||||
// padding: const EdgeInsets.fromLTRB(
|
||||
// 0,
|
||||
// 5,
|
||||
// 0,
|
||||
// 0,
|
||||
// ),
|
||||
// shrinkWrap: true,
|
||||
// scrollDirection: Axis.vertical,
|
||||
// children: (controller.model.issueList!
|
||||
// .asMap()
|
||||
// .entries
|
||||
// .map((e) => IssuePreviewWidget(
|
||||
// index: e.key,
|
||||
// issueListController: controller))
|
||||
// .toList() as List<Widget>))),
|
||||
// ),
|
||||
// ),
|
||||
// ),
|
||||
// ],
|
||||
// ),
|
||||
// );
|
||||
// }),
|
||||
),
|
||||
),
|
||||
));
|
||||
|
||||
@@ -21,16 +21,17 @@ class IssuePreviewWidget extends GetView<IssuePreviewInfoController> {
|
||||
Widget build(BuildContext context) {
|
||||
return InkWell(
|
||||
onTap: () async {
|
||||
// issueListController.model.selectedIndex = index;
|
||||
// issueListController.updateAll();
|
||||
// await Future.delayed(Duration(milliseconds: 100));
|
||||
// issueListController.model.selectedIndex = -1;
|
||||
// issueListController.updateAll();
|
||||
// var article = issueListController.model.issueList![index];
|
||||
// Get.toNamed("/helpArticle", arguments: article);
|
||||
issueListController.model.selectedIndex = index;
|
||||
issueListController.updateAll();
|
||||
await Future.delayed(Duration(milliseconds: 100));
|
||||
issueListController.model.selectedIndex = -1;
|
||||
issueListController.updateAll();
|
||||
var article = issueListController.model.issueList![index];
|
||||
Get.toNamed("/helpArticle", arguments: article);
|
||||
},
|
||||
child: Obx(() {
|
||||
return Container(
|
||||
margin: EdgeInsets.only(left: 30.rpx, right: 30.rpx),
|
||||
alignment: Alignment.center,
|
||||
width: double.infinity,
|
||||
constraints: BoxConstraints(
|
||||
|
||||
@@ -82,6 +82,8 @@ class _MinePageState extends State<NewMinePage> {
|
||||
child: Scaffold(
|
||||
backgroundColor: Colors.transparent,
|
||||
appBar: AppBar(
|
||||
elevation: 0,
|
||||
surfaceTintColor: Colors.transparent,
|
||||
backgroundColor: Colors.transparent,
|
||||
iconTheme: const IconThemeData(color: Colors.white),
|
||||
automaticallyImplyLeading: false,
|
||||
@@ -116,20 +118,6 @@ class _MinePageState extends State<NewMinePage> {
|
||||
color: Colors.white,
|
||||
// color: Colors.white,
|
||||
))),
|
||||
// ClickableContainer(
|
||||
// backgroundColor: Colors.transparent,
|
||||
// highlightColor: Colors.transparent,
|
||||
// padding: EdgeInsets.only(right: 11.rpx),
|
||||
// onTap: () {
|
||||
|
||||
// },
|
||||
// child: Container(
|
||||
// height: 42.rpx,
|
||||
// width: 42.rpx,
|
||||
// child: SvgPicture.asset(
|
||||
// 'assets/img/icon/people_info.svg',
|
||||
// color: Colors.white,
|
||||
// ))),
|
||||
],
|
||||
),
|
||||
body: SafeArea(
|
||||
@@ -239,7 +227,7 @@ class _MinePageState extends State<NewMinePage> {
|
||||
margin: EdgeInsets.only(
|
||||
left: 30.rpx, right: 30.rpx, top: 94.rpx),
|
||||
child: Text(
|
||||
'对已绑定的智能设备进行个性化配置,以获得更好的体验,',
|
||||
'对已绑定的智能设备进行个性化配置,以获得更好的体验',
|
||||
style: TextStyle(
|
||||
fontSize: 26.rpx,
|
||||
color: const Color(0XFF929699),
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -1,8 +1,10 @@
|
||||
import 'package:ef/base/widget/flutterflow/FlutterFlowTheme.dart';
|
||||
import 'package:ef/ef.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:vbvs_app/common/color/ServiceConstant.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/CustomCard.dart';
|
||||
|
||||
class RoomPickerPage extends StatefulWidget {
|
||||
@@ -11,7 +13,28 @@ class RoomPickerPage extends StatefulWidget {
|
||||
}
|
||||
|
||||
class _RoomPickerPageState extends State<RoomPickerPage> {
|
||||
final List<String> rooms = ['主卧', '次卧', '儿童房', '客厅', '厨房', '书房', '阳台', '洗手间'];
|
||||
RxList rooms = [].obs;
|
||||
|
||||
@override
|
||||
void initState() {
|
||||
super.initState();
|
||||
getRoomList();
|
||||
}
|
||||
|
||||
getRoomList() async {
|
||||
String serviceAddress = ServiceConstant.service_address;
|
||||
String serviceName = ServiceConstant.server_service;
|
||||
String serviceApi = ServiceConstant.room_list;
|
||||
String queryUrl = "$serviceAddress$serviceName$serviceApi";
|
||||
requestWithLog(
|
||||
logTitle: '查询房间列表',
|
||||
method: MyHttpMethod.get,
|
||||
queryUrl: queryUrl,
|
||||
onSuccess: (res) {
|
||||
rooms.assignAll(res.data);
|
||||
},
|
||||
);
|
||||
}
|
||||
|
||||
int selectedIndex = 1;
|
||||
BoxConstraints? bodysize;
|
||||
@@ -63,21 +86,6 @@ class _RoomPickerPageState extends State<RoomPickerPage> {
|
||||
body: SafeArea(
|
||||
child: Column(
|
||||
children: [
|
||||
// 顶部标题栏
|
||||
// const Padding(
|
||||
// padding: EdgeInsets.symmetric(horizontal: 16.0, vertical: 12),
|
||||
// child: Row(
|
||||
// children: [
|
||||
// Icon(Icons.arrow_back_ios, color: Colors.white),
|
||||
// Spacer(),
|
||||
// Text(
|
||||
// '房间选择',
|
||||
// style: TextStyle(color: Colors.white, fontSize: 18),
|
||||
// ),
|
||||
// Spacer(flex: 2),
|
||||
// ],
|
||||
// ),
|
||||
// ),
|
||||
const Spacer(),
|
||||
// 滚轮选择器
|
||||
SizedBox(
|
||||
@@ -86,30 +94,33 @@ class _RoomPickerPageState extends State<RoomPickerPage> {
|
||||
alignment: Alignment.center,
|
||||
children: [
|
||||
// 滚轮列表
|
||||
ListWheelScrollView.useDelegate(
|
||||
itemExtent: 120.rpx,
|
||||
perspective: 0.003,
|
||||
physics: const FixedExtentScrollPhysics(),
|
||||
onSelectedItemChanged: (index) {
|
||||
setState(() => selectedIndex = index);
|
||||
},
|
||||
childDelegate: ListWheelChildBuilderDelegate(
|
||||
builder: (context, index) {
|
||||
if (index >= rooms.length) return null;
|
||||
final isSelected = index == selectedIndex;
|
||||
return Center(
|
||||
child: Text(
|
||||
rooms[index],
|
||||
style: TextStyle(
|
||||
fontSize: isSelected ? 36.rpx : 30.rpx,
|
||||
color: isSelected
|
||||
? Colors.white
|
||||
: const Color(0xFF929699),
|
||||
),
|
||||
),
|
||||
);
|
||||
Obx(
|
||||
() => ListWheelScrollView.useDelegate(
|
||||
itemExtent: 120.rpx,
|
||||
perspective: 0.003,
|
||||
physics: const FixedExtentScrollPhysics(),
|
||||
onSelectedItemChanged: (index) {
|
||||
setState(() => selectedIndex = index);
|
||||
},
|
||||
childCount: rooms.length,
|
||||
childDelegate: ListWheelChildBuilderDelegate(
|
||||
builder: (context, index) {
|
||||
if (index >= rooms.length) return null;
|
||||
final isSelected = index == selectedIndex;
|
||||
return Center(
|
||||
child: Text(
|
||||
rooms[index]['name'],
|
||||
style: TextStyle(
|
||||
fontSize:
|
||||
isSelected ? 36.rpx : 30.rpx,
|
||||
color: isSelected
|
||||
? Colors.white
|
||||
: const Color(0xFF929699),
|
||||
),
|
||||
),
|
||||
);
|
||||
},
|
||||
childCount: rooms.length,
|
||||
),
|
||||
),
|
||||
),
|
||||
|
||||
|
||||
@@ -69,7 +69,9 @@ class _SleepHabitPageState extends State<SleepHabitPage> {
|
||||
highlightColor: Color(0XFF055466),
|
||||
borderRadius: 16.rpx,
|
||||
padding: EdgeInsets.only(top: 0),
|
||||
onTap: () {},
|
||||
onTap: () {
|
||||
Get.toNamed('/rxhxMht');
|
||||
},
|
||||
child: Container(
|
||||
alignment: Alignment.center,
|
||||
width: bodysize!.maxWidth * 1,
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
import 'package:ef/ef.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_svg/svg.dart';
|
||||
import 'package:flutter_switch/flutter_switch.dart';
|
||||
import 'package:vbvs_app/common/util/FitTool.dart';
|
||||
import 'package:vbvs_app/common/util/MyUtils.dart';
|
||||
@@ -130,7 +131,7 @@ class Smys extends GetView<SleepingHabitController> {
|
||||
.override(
|
||||
fontFamily: 'Readex Pro',
|
||||
color: Color(0xFF9EA4B7),
|
||||
fontSize: 30.rpx,
|
||||
fontSize: 26.rpx,
|
||||
letterSpacing: 0,
|
||||
),
|
||||
),
|
||||
@@ -152,35 +153,7 @@ class Smys extends GetView<SleepingHabitController> {
|
||||
getmodel.model.smysIsStart = val;
|
||||
});
|
||||
},
|
||||
)
|
||||
// Switch.adaptive(
|
||||
// value: controller.model.smysIsStart,
|
||||
// onChanged: (newValue) async {
|
||||
// controller.attr.update((getmodel) {
|
||||
// getmodel.model.smysIsStart =
|
||||
// newValue;
|
||||
// });
|
||||
// // updateParm(errorccCallback: () {
|
||||
// // controller.attr.update((getmodel) {
|
||||
// // getmodel.model.smysIsStart = !newValue;
|
||||
// // });
|
||||
// // });
|
||||
// },
|
||||
// activeTrackColor: Color(0xFF6BFDAC),
|
||||
// inactiveTrackColor: Color(0xFF003058),
|
||||
// inactiveThumbColor: Color(0xFF011D33),
|
||||
// trackOutlineWidth: MaterialStateProperty
|
||||
// .resolveWith<double?>(
|
||||
// (Set<MaterialState> states) {
|
||||
// if (states.contains(
|
||||
// MaterialState.disabled)) {
|
||||
// return null;
|
||||
// }
|
||||
// return null; // Use the default width.
|
||||
// }),
|
||||
// ),
|
||||
|
||||
),
|
||||
)),
|
||||
],
|
||||
),
|
||||
)),
|
||||
@@ -213,7 +186,7 @@ class Smys extends GetView<SleepingHabitController> {
|
||||
.override(
|
||||
fontFamily: 'Readex Pro',
|
||||
color: Color(0xFF9EA4B7),
|
||||
fontSize: 30.rpx,
|
||||
fontSize: 26.rpx,
|
||||
letterSpacing: 0,
|
||||
),
|
||||
),
|
||||
@@ -242,18 +215,20 @@ class Smys extends GetView<SleepingHabitController> {
|
||||
.override(
|
||||
fontFamily: 'Readex Pro',
|
||||
color: Colors.white,
|
||||
fontSize: 36.rpx,
|
||||
fontSize: 26.rpx,
|
||||
letterSpacing: 0,
|
||||
),
|
||||
),
|
||||
SizedBox(
|
||||
width: 16.rpx,
|
||||
),
|
||||
Icon(
|
||||
Icons.expand_more,
|
||||
color: Colors.white,
|
||||
size: 40.rpx,
|
||||
),
|
||||
Container(
|
||||
height: 30.rpx,
|
||||
width: 30.rpx,
|
||||
child: SvgPicture.asset(
|
||||
'assets/img/icon/expand_more.svg',
|
||||
color: Colors.white,
|
||||
))
|
||||
],
|
||||
),
|
||||
),
|
||||
@@ -289,7 +264,7 @@ class Smys extends GetView<SleepingHabitController> {
|
||||
.override(
|
||||
fontFamily: 'Readex Pro',
|
||||
color: Color(0xFF9EA4B7),
|
||||
fontSize: 30.rpx,
|
||||
fontSize: 26.rpx,
|
||||
letterSpacing: 0,
|
||||
),
|
||||
),
|
||||
@@ -318,18 +293,20 @@ class Smys extends GetView<SleepingHabitController> {
|
||||
.override(
|
||||
fontFamily: 'Readex Pro',
|
||||
color: Colors.white,
|
||||
fontSize: 36.rpx,
|
||||
fontSize: 26.rpx,
|
||||
letterSpacing: 0,
|
||||
),
|
||||
),
|
||||
SizedBox(
|
||||
width: 16.rpx,
|
||||
),
|
||||
Icon(
|
||||
Icons.expand_more,
|
||||
color: Colors.white,
|
||||
size: 40.rpx,
|
||||
),
|
||||
Container(
|
||||
height: 30.rpx,
|
||||
width: 30.rpx,
|
||||
child: SvgPicture.asset(
|
||||
'assets/img/icon/expand_more.svg',
|
||||
color: Colors.white,
|
||||
))
|
||||
],
|
||||
),
|
||||
),
|
||||
|
||||
682
lib/pages/mh_page/user/page/rxhx_mht.dart
Normal file
682
lib/pages/mh_page/user/page/rxhx_mht.dart
Normal file
@@ -0,0 +1,682 @@
|
||||
import 'dart:async';
|
||||
import 'dart:math';
|
||||
import 'dart:typed_data';
|
||||
|
||||
import 'package:ef/ef.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_svg/svg.dart';
|
||||
import 'package:flutter_switch/flutter_switch.dart';
|
||||
import 'package:vbvs_app/common/util/FitTool.dart';
|
||||
import 'package:vbvs_app/common/util/MyUtils.dart';
|
||||
import 'package:vbvs_app/component/tool/CustomCard.dart';
|
||||
import 'package:vbvs_app/controller/mh_controller/bedController.dart';
|
||||
import 'package:vbvs_app/controller/mh_controller/sleeping_habit_controller.dart';
|
||||
import 'package:vbvs_app/pages/common/selectDialog.dart';
|
||||
|
||||
class RxhxMht extends StatefulWidget {
|
||||
const RxhxMht({super.key});
|
||||
|
||||
@override
|
||||
State<RxhxMht> createState() => _RxhxMhtState();
|
||||
}
|
||||
|
||||
class _RxhxMhtState extends State<RxhxMht> {
|
||||
get controller => Get.find<SleepingHabitController>();
|
||||
get bedController => Get.find<BedController>();
|
||||
List location = ["床垫全局", "床垫左侧", "床垫右侧"];
|
||||
|
||||
@override
|
||||
void initState() {
|
||||
super.initState();
|
||||
Timer(Duration.zero, () {
|
||||
resetRxhx();
|
||||
currentTimeSend();
|
||||
});
|
||||
}
|
||||
|
||||
resetRxhx() {
|
||||
controller.model.rxhxIsStart = false;
|
||||
controller.model.rxhxWakeTime = [7, 0];
|
||||
controller.model.rxhxIsAnMo = true;
|
||||
controller.model.rxhxWeeks = [0, 0, 0, 0, 0, 0, 0];
|
||||
controller.model.rxhxLocation = 0;
|
||||
controller.updateAll();
|
||||
}
|
||||
|
||||
@override
|
||||
dispose() {
|
||||
super.dispose();
|
||||
}
|
||||
|
||||
alarmChange() async {
|
||||
// List<int> arr = [0x30, 0x01];
|
||||
// arr.add(controller.model.rxhxIsStart ? 0x01 : 0x00);
|
||||
// arr.add(int.parse("${controller.model.rxhxWakeTime[0]}", radix: 16));
|
||||
// arr.add(int.parse("${controller.model.rxhxWakeTime[1]}", radix: 16));
|
||||
// arr.add(0);
|
||||
// int value = int.parse("${controller.model.rxhxWeeks[0]}") * 2 +
|
||||
// int.parse("${controller.model.rxhxWeeks[1]}") * 4 +
|
||||
// int.parse("${controller.model.rxhxWeeks[2]}") * 8 +
|
||||
// int.parse("${controller.model.rxhxWeeks[3]}") * 16 +
|
||||
// int.parse("${controller.model.rxhxWeeks[4]}") * 32 +
|
||||
// int.parse("${controller.model.rxhxWeeks[5]}") * 64 +
|
||||
// int.parse("${controller.model.rxhxWeeks[6]}") * 128;
|
||||
// arr.add(value);
|
||||
// arr.add(value > 1 ? 1 : 0);
|
||||
// arr.add((controller.model.rxhxIsAnMo ? 1 : 0) +
|
||||
// int.parse("${controller.model.rxhxLocation * 16}"));
|
||||
// var sendArr = getCode(arr);
|
||||
// List receive = [];
|
||||
// Function fun = (d) {
|
||||
// receive.add(d);
|
||||
// };
|
||||
// bedController.deviceProp?.receiveLogArr.add(fun);
|
||||
// for (var i = 0; i < 3; i++) {
|
||||
// bedController.bleSendCode(sendArr);
|
||||
// await Future.delayed(const Duration(milliseconds: 500));
|
||||
// print("$receive");
|
||||
// if (receive.length > 0) {
|
||||
// for (var i = 0; i < receive.length; i++) {
|
||||
// List<int> r = receive[i];
|
||||
// if (handleTimeResult(r, 0x30)) {
|
||||
// bedController.deviceProp?.receiveLogArr.remove(fun);
|
||||
// showToast("保存成功", color: color_success);
|
||||
// return;
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
// showToast("保存失败");
|
||||
// bedController.deviceProp?.receiveLogArr.remove(fun);
|
||||
}
|
||||
|
||||
handleTimeResult(List<int> r, int type) {
|
||||
if (r.length == 18 &&
|
||||
r[0] == 255 &&
|
||||
r[1] == 255 &&
|
||||
r[2] == 255 &&
|
||||
r[3] == 255 &&
|
||||
r[4] == 0 &&
|
||||
r[5] == 9 &&
|
||||
r[6] == type &&
|
||||
r[7] == 0x01) {
|
||||
if (r[8] == 0x01) {
|
||||
controller.model.rxhxIsStart = true;
|
||||
} else if (r[8] == 0x02 || r[8] == 0x00) {
|
||||
controller.model.rxhxIsStart = false;
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
controller.model.rxhxWakeTime[0] = int.parse(r[9].toRadixString(16));
|
||||
controller.model.rxhxWakeTime[1] = int.parse(r[10].toRadixString(16));
|
||||
for (var i = 0; i < 7; i++) {
|
||||
int v = pow(2, i + 1).toInt();
|
||||
controller.model.rxhxWeeks[i] = (v & r[12]) == v ? 1 : 0;
|
||||
}
|
||||
controller.model.rxhxIsAnMo = (r[14] & 0x0f) == 1 ? true : false;
|
||||
controller.model.rxhxLocation = (r[14] & 0xf0) >> 4;
|
||||
controller.updateAll();
|
||||
return true;
|
||||
}
|
||||
if (r[0] == 255 &&
|
||||
r[1] == 255 &&
|
||||
r[2] == 255 &&
|
||||
r[3] == 255 &&
|
||||
r[4] == 0 &&
|
||||
r[5] == 3 &&
|
||||
r[6] == type &&
|
||||
r[7] == 0x01 &&
|
||||
r[8] == 0x00 &&
|
||||
r.length == 12) {
|
||||
resetRxhx();
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
currentTimeSend() async {
|
||||
// DateTime date = DateTime.now();
|
||||
// List<int> arr = [0x20, 0x01];
|
||||
// arr.add(int.parse("${date.hour}", radix: 16));
|
||||
// arr.add(int.parse("${date.minute}", radix: 16));
|
||||
// arr.add(int.parse("${date.second}", radix: 16));
|
||||
// arr.add(int.parse("${date.weekday}", radix: 16));
|
||||
// arr.add(int.parse("${date.year}".substring(2), radix: 16));
|
||||
// arr.add(int.parse("${date.month}", radix: 16));
|
||||
// arr.add(int.parse("${date.day}", radix: 16));
|
||||
// var sendArr = getCode(arr);
|
||||
// List receive = [];
|
||||
// Function fun = (d) {
|
||||
// receive.add(d);
|
||||
// };
|
||||
// bedController.deviceProp?.receiveLogArr.add(fun);
|
||||
// bedController.bleSendCode(sendArr);
|
||||
// for (var i = 0; i < 3; i++) {
|
||||
// await Future.delayed(const Duration(milliseconds: 500));
|
||||
// print("$receive");
|
||||
// if (receive.length > 0) {
|
||||
// for (var i = 0; i < receive.length; i++) {
|
||||
// List<int> r = receive[i];
|
||||
// if (handleTimeResult(r, 0x20)) {
|
||||
// bedController.deviceProp?.receiveLogArr.remove(fun);
|
||||
// return;
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
// bedController.deviceProp?.receiveLogArr.remove(fun);
|
||||
}
|
||||
|
||||
getLine() {
|
||||
return Divider(
|
||||
color: const Color(0XFF929699),
|
||||
thickness: 0.5.rpx,
|
||||
height: 0,
|
||||
);
|
||||
}
|
||||
|
||||
List weeks = ["周一", "周二", "周三", "周四", "周五", "周六", "周日"];
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return LayoutBuilder(
|
||||
builder: (context, boxConstraints) => GestureDetector(
|
||||
onTap: () => FocusScope.of(context).unfocus(),
|
||||
child: Container(
|
||||
decoration: const BoxDecoration(
|
||||
image: DecorationImage(
|
||||
image: AssetImage('assets/images/new_background.png'), // 本地图片
|
||||
fit: BoxFit.fill, // 填满整个 Container
|
||||
),
|
||||
),
|
||||
child: Scaffold(
|
||||
backgroundColor: Colors.transparent,
|
||||
appBar: AppBar(
|
||||
backgroundColor: Colors.transparent,
|
||||
automaticallyImplyLeading: false,
|
||||
iconTheme: const IconThemeData(color: Colors.white),
|
||||
titleSpacing: 0,
|
||||
title: Container(
|
||||
width: double.infinity,
|
||||
height: 180.rpx,
|
||||
child: Stack(
|
||||
alignment: Alignment.center,
|
||||
children: [
|
||||
// 中间居中的标题
|
||||
Text(
|
||||
'柔性唤醒',
|
||||
textAlign: TextAlign.center,
|
||||
style: TextStyle(
|
||||
color: Colors.white,
|
||||
fontSize: 30.rpx,
|
||||
),
|
||||
),
|
||||
// 左侧图标
|
||||
Positioned(
|
||||
left: 20.rpx,
|
||||
child: returnIconButtomNew,
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
// leading: returnIconButtomAddCallback(() {
|
||||
// controller.saveDataApi();
|
||||
// }),
|
||||
|
||||
// Container(
|
||||
// width: double.infinity,
|
||||
// height: 70.rpx,
|
||||
// child: Row(
|
||||
// mainAxisSize: MainAxisSize.max,
|
||||
// mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||
// children: [
|
||||
// Text(
|
||||
// '柔性唤醒',
|
||||
// style: FlutterFlowTheme.of(context).bodyMedium.override(
|
||||
// fontFamily: 'Readex Pro',
|
||||
// color: Colors.white,
|
||||
// letterSpacing: 0,
|
||||
// fontSize: 30.rpx),
|
||||
// ),
|
||||
// InkWell(
|
||||
// onTap: () {
|
||||
// alarmChange();
|
||||
// },
|
||||
// child: Container(
|
||||
// margin: EdgeInsets.only(right: 30.rpx),
|
||||
// width: 140.rpx,
|
||||
// height: 66.rpx,
|
||||
// alignment: Alignment.center,
|
||||
// decoration: BoxDecoration(
|
||||
// borderRadius: BorderRadius.circular(5),
|
||||
// color: stringToColor("#182B7C")),
|
||||
// child: Text(
|
||||
// "保存",
|
||||
// style: FlutterFlowTheme.of(context)
|
||||
// .bodyMedium
|
||||
// .override(
|
||||
// fontFamily: 'Readex Pro',
|
||||
// color: stringToColor("#9EA4B7"),
|
||||
// letterSpacing: 0,
|
||||
// fontSize: 30.rpx),
|
||||
// ),
|
||||
// ),
|
||||
// )
|
||||
// ],
|
||||
// ),
|
||||
// ),
|
||||
actions: [],
|
||||
centerTitle: false,
|
||||
),
|
||||
body: SafeArea(
|
||||
top: true,
|
||||
child: Obx(
|
||||
() => Container(
|
||||
padding: EdgeInsets.only(left: 30.rpx, right: 30.rpx),
|
||||
width: MediaQuery.sizeOf(context).width,
|
||||
height: MediaQuery.sizeOf(context).height * 1.123,
|
||||
child: Column(
|
||||
mainAxisSize: MainAxisSize.max,
|
||||
children: [
|
||||
Container(
|
||||
margin: EdgeInsets.only(left: 40.rpx, right: 16.rpx),
|
||||
width: double.infinity,
|
||||
height: 90.rpx,
|
||||
decoration: const BoxDecoration(),
|
||||
child: Row(
|
||||
mainAxisSize: MainAxisSize.max,
|
||||
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||
children: [
|
||||
Text(
|
||||
'柔性唤醒功能',
|
||||
style: FlutterFlowTheme.of(context)
|
||||
.bodyMedium
|
||||
.override(
|
||||
fontFamily: 'Readex Pro',
|
||||
color: Colors.white,
|
||||
fontSize: 26.rpx,
|
||||
letterSpacing: 0,
|
||||
),
|
||||
),
|
||||
Container(
|
||||
|
||||
// height:
|
||||
// MediaQuery.sizeOf(context).height *
|
||||
// 0.04,
|
||||
child: FlutterSwitch(
|
||||
width: 70.rpx,
|
||||
height: 36.rpx,
|
||||
toggleSize: 30.rpx,
|
||||
activeColor: Color(0XFF6BFDAC),
|
||||
inactiveColor: Color(0XFF003058),
|
||||
toggleColor: Color(0xFF011D33),
|
||||
value: controller.model.smysIsStart,
|
||||
onToggle: (val) {
|
||||
controller.attr.update((getmodel) {
|
||||
getmodel.model.smysIsStart = val;
|
||||
});
|
||||
},
|
||||
)),
|
||||
// Container(
|
||||
// height:
|
||||
// MediaQuery.sizeOf(context).height * 0.04,
|
||||
// child: Switch.adaptive(
|
||||
// value: controller.model.rxhxIsStart,
|
||||
// onChanged: (newValue) async {
|
||||
// controller.attr.update((getmodel) {
|
||||
// getmodel.model.rxhxIsStart = newValue;
|
||||
// });
|
||||
// },
|
||||
// activeTrackColor: const Color(0xFFD3B684),
|
||||
// inactiveTrackColor: const Color(0xFF0A1562),
|
||||
// inactiveThumbColor: const Color(0xFF182B7C),
|
||||
// trackOutlineWidth: MaterialStateProperty
|
||||
// .resolveWith<double?>(
|
||||
// (Set<MaterialState> states) {
|
||||
// if (states
|
||||
// .contains(MaterialState.disabled)) {
|
||||
// return null;
|
||||
// }
|
||||
// return null; // Use the default width.
|
||||
// }),
|
||||
// ),
|
||||
// ),
|
||||
],
|
||||
),
|
||||
),
|
||||
getLine(),
|
||||
Container(
|
||||
margin: EdgeInsets.only(left: 40.rpx, right: 30.rpx),
|
||||
width: double.infinity,
|
||||
height: 90.rpx,
|
||||
decoration: const BoxDecoration(),
|
||||
child: Row(
|
||||
mainAxisSize: MainAxisSize.max,
|
||||
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||
children: [
|
||||
Text(
|
||||
'唤醒时间',
|
||||
style: FlutterFlowTheme.of(context)
|
||||
.bodyMedium
|
||||
.override(
|
||||
fontFamily: 'Readex Pro',
|
||||
color: Colors.white,
|
||||
fontSize: 26.rpx,
|
||||
letterSpacing: 0,
|
||||
),
|
||||
),
|
||||
InkWell(
|
||||
onTap: () async {
|
||||
showDayTimeSelectionDialog(context,
|
||||
dayTimeArr: controller.model.rxhxWakeTime,
|
||||
title: "唤醒时间", checkChange: (d) {
|
||||
controller.attr.update((getmodel) {
|
||||
getmodel.model.rxhxWakeTime = [
|
||||
int.parse("${d[0]}"),
|
||||
int.parse("${d[1]}")
|
||||
];
|
||||
});
|
||||
print("$d");
|
||||
});
|
||||
},
|
||||
child: Row(
|
||||
mainAxisSize: MainAxisSize.max,
|
||||
children: [
|
||||
Text(
|
||||
"${controller.model.rxhxWakeTimeToString}",
|
||||
style: FlutterFlowTheme.of(context)
|
||||
.bodyMedium
|
||||
.override(
|
||||
fontFamily: 'Readex Pro',
|
||||
color: Colors.white,
|
||||
fontSize: 26.rpx,
|
||||
letterSpacing: 0,
|
||||
),
|
||||
),
|
||||
SizedBox(
|
||||
width: 16.rpx,
|
||||
),
|
||||
Container(
|
||||
height: 30.rpx,
|
||||
width: 30.rpx,
|
||||
child: SvgPicture.asset(
|
||||
'assets/img/icon/expand_more.svg',
|
||||
color: Colors.white,
|
||||
))
|
||||
],
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
getLine(),
|
||||
Container(
|
||||
margin: EdgeInsets.only(left: 40.rpx, right: 30.rpx),
|
||||
width: double.infinity,
|
||||
height: 90.rpx,
|
||||
decoration: const BoxDecoration(),
|
||||
child: Row(
|
||||
mainAxisSize: MainAxisSize.max,
|
||||
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||
children: [
|
||||
Text(
|
||||
'按摩',
|
||||
style: FlutterFlowTheme.of(context)
|
||||
.bodyMedium
|
||||
.override(
|
||||
fontFamily: 'Readex Pro',
|
||||
color: Colors.white,
|
||||
fontSize: 26.rpx,
|
||||
letterSpacing: 0,
|
||||
),
|
||||
),
|
||||
InkWell(
|
||||
onTap: () {
|
||||
showOneSelectionDialog(
|
||||
context,
|
||||
arr: ['开', "关"],
|
||||
checkIndex:
|
||||
controller.model.rxhxIsAnMo ? 0 : 1,
|
||||
title: "按摩",
|
||||
checkChange: (index) {
|
||||
controller.attr.update((getmodel) {
|
||||
getmodel.model.rxhxIsAnMo =
|
||||
index == 0 ? true : false;
|
||||
});
|
||||
},
|
||||
);
|
||||
},
|
||||
child: Row(
|
||||
mainAxisSize: MainAxisSize.max,
|
||||
children: [
|
||||
Text(
|
||||
controller.model.rxhxIsAnMo ? '开' : '关',
|
||||
style: FlutterFlowTheme.of(context)
|
||||
.bodyMedium
|
||||
.override(
|
||||
fontFamily: 'Readex Pro',
|
||||
color: Colors.white,
|
||||
fontSize: 26.rpx,
|
||||
letterSpacing: 0,
|
||||
),
|
||||
),
|
||||
SizedBox(
|
||||
width: 16.rpx,
|
||||
),
|
||||
Container(
|
||||
height: 30.rpx,
|
||||
width: 30.rpx,
|
||||
child: SvgPicture.asset(
|
||||
'assets/img/icon/expand_more.svg',
|
||||
color: Colors.white,
|
||||
))
|
||||
],
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
getLine(),
|
||||
Container(
|
||||
margin: EdgeInsets.only(left: 40.rpx, right: 30.rpx),
|
||||
width: double.infinity,
|
||||
height: 90.rpx,
|
||||
decoration: const BoxDecoration(),
|
||||
child: Row(
|
||||
mainAxisSize: MainAxisSize.max,
|
||||
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||
children: [
|
||||
Text(
|
||||
'唤醒部位',
|
||||
style: FlutterFlowTheme.of(context)
|
||||
.bodyMedium
|
||||
.override(
|
||||
fontFamily: 'Readex Pro',
|
||||
color: Colors.white,
|
||||
fontSize: 26.rpx,
|
||||
letterSpacing: 0,
|
||||
),
|
||||
),
|
||||
InkWell(
|
||||
onTap: () {
|
||||
showOneSelectionDialog(
|
||||
context,
|
||||
arr: location,
|
||||
checkIndex: controller.model.rxhxLocation,
|
||||
title: "唤醒部位",
|
||||
checkChange: (index) {
|
||||
controller.attr.update((getmodel) {
|
||||
getmodel.model.rxhxLocation = index;
|
||||
});
|
||||
},
|
||||
);
|
||||
},
|
||||
child: Row(
|
||||
mainAxisSize: MainAxisSize.max,
|
||||
children: [
|
||||
Text(
|
||||
location[controller.model.rxhxLocation],
|
||||
style: FlutterFlowTheme.of(context)
|
||||
.bodyMedium
|
||||
.override(
|
||||
fontFamily: 'Readex Pro',
|
||||
color: Colors.white,
|
||||
fontSize: 26.rpx,
|
||||
letterSpacing: 0,
|
||||
),
|
||||
),
|
||||
SizedBox(
|
||||
width: 16.rpx,
|
||||
),
|
||||
Container(
|
||||
height: 30.rpx,
|
||||
width: 30.rpx,
|
||||
child: SvgPicture.asset(
|
||||
'assets/img/icon/expand_more.svg',
|
||||
color: Colors.white,
|
||||
))
|
||||
],
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
getLine(),
|
||||
Container(
|
||||
margin: EdgeInsets.only(
|
||||
top: 30.rpx,
|
||||
bottom: 30.rpx,
|
||||
left: 40.rpx,
|
||||
right: 30.rpx),
|
||||
width: double.infinity,
|
||||
decoration: const BoxDecoration(),
|
||||
child: Column(
|
||||
mainAxisSize: MainAxisSize.max,
|
||||
mainAxisAlignment: MainAxisAlignment.center,
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
Text(
|
||||
'自定义',
|
||||
style: FlutterFlowTheme.of(context)
|
||||
.bodyMedium
|
||||
.override(
|
||||
fontFamily: 'Readex Pro',
|
||||
color: Colors.white,
|
||||
fontSize: 26.rpx,
|
||||
letterSpacing: 0,
|
||||
),
|
||||
),
|
||||
Padding(
|
||||
padding: EdgeInsetsDirectional.fromSTEB(
|
||||
0, 20.rpx, 0, 0),
|
||||
child: Container(
|
||||
width: double.infinity,
|
||||
height:
|
||||
MediaQuery.sizeOf(context).height * 0.046,
|
||||
decoration: const BoxDecoration(),
|
||||
child: Row(
|
||||
mainAxisSize: MainAxisSize.max,
|
||||
mainAxisAlignment:
|
||||
MainAxisAlignment.spaceBetween,
|
||||
children: [
|
||||
...List.generate(7, (index) {
|
||||
return InkWell(
|
||||
onTap: () {
|
||||
controller.attr.update((getmodel) {
|
||||
getmodel.model
|
||||
.rxhxWeeks[index] = getmodel
|
||||
.model
|
||||
.rxhxWeeks[index] ==
|
||||
0
|
||||
? 1
|
||||
: 0;
|
||||
});
|
||||
},
|
||||
child: AspectRatio(
|
||||
aspectRatio: 1,
|
||||
child: ClipOval(
|
||||
child: Container(
|
||||
height: double.infinity,
|
||||
decoration: BoxDecoration(
|
||||
color: controller.model
|
||||
.rxhxWeeks[
|
||||
index] ==
|
||||
1
|
||||
? Color(0xFF84F5FF)
|
||||
: Color(0XFF003058)),
|
||||
child: Center(
|
||||
child: Text(
|
||||
weeks[index],
|
||||
style: const TextStyle(
|
||||
color: Colors.white),
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
);
|
||||
}),
|
||||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
getLine(),
|
||||
SizedBox(
|
||||
height: 30.rpx,
|
||||
),
|
||||
Container(
|
||||
margin: EdgeInsets.only(left: 26.rpx, right: 26.rpx),
|
||||
width: double.infinity,
|
||||
decoration: const BoxDecoration(),
|
||||
child: Text(
|
||||
'*注:开启该功能后,在设置的时间点,设备将启动一段固定时长的柔性唤醒功能。',
|
||||
style: FlutterFlowTheme.of(context)
|
||||
.bodyMedium
|
||||
.override(
|
||||
fontFamily: 'Readex Pro',
|
||||
color: Colors.white,
|
||||
fontSize: 20.rpx,
|
||||
letterSpacing: 0,
|
||||
),
|
||||
),
|
||||
),
|
||||
Spacer(),
|
||||
Padding(
|
||||
padding: EdgeInsets.only(bottom: 85.rpx),
|
||||
child: CustomCard(
|
||||
borderRadius: 16.rpx,
|
||||
gradientDirection: GradientDirection.vertical,
|
||||
onTap: () {},
|
||||
colors: const [
|
||||
Color(0xFFFCFCFC),
|
||||
Color(0xFFF8FAF9),
|
||||
Color(0XFFECF6F3),
|
||||
Color(0XFFD9F0E9),
|
||||
Color(0xFFCEECE3)
|
||||
],
|
||||
child: Container(
|
||||
width: double.infinity,
|
||||
height: 90.rpx,
|
||||
alignment: Alignment.center,
|
||||
decoration: BoxDecoration(
|
||||
borderRadius: BorderRadius.circular(6),
|
||||
),
|
||||
child: Text("完成",
|
||||
style: TextStyle(
|
||||
color: const Color(0xFF003058),
|
||||
fontSize: 26.rpx)),
|
||||
),
|
||||
))
|
||||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
)),
|
||||
);
|
||||
}
|
||||
}
|
||||
@@ -1,8 +1,10 @@
|
||||
import 'package:ef/ef.dart';
|
||||
import 'package:flutter/cupertino.dart';
|
||||
import 'package:vbvs_app/component/tool/TopSlideNotification.dart';
|
||||
|
||||
import 'package:vbvs_app/controller/theme_controller/ThemeController.dart';
|
||||
import 'package:vbvs_app/controller/user_info_controller.dart';
|
||||
import 'package:vbvs_app/main.dart';
|
||||
import 'package:vbvs_app/pages/main_bottom/component/main_page_b_bottom_change.dart';
|
||||
import 'package:vbvs_app/pages/mh_page/HomeDeviceType.dart';
|
||||
import 'package:vbvs_app/pages/mh_page/LanguagePage.dart';
|
||||
@@ -16,8 +18,10 @@ import 'package:vbvs_app/pages/mh_page/device/mht_blueteeth_device_page.dart';
|
||||
import 'package:vbvs_app/pages/mh_page/device/mht_device_calibration.dart';
|
||||
import 'package:vbvs_app/pages/mh_page/device/mht_wifi_page.dart';
|
||||
import 'package:vbvs_app/pages/mh_page/device_list.dart';
|
||||
import 'package:vbvs_app/pages/mh_page/device_people_info.dart';
|
||||
import 'package:vbvs_app/pages/mh_page/device_share_page.dart';
|
||||
import 'package:vbvs_app/pages/mh_page/edit_bed.dart';
|
||||
import 'package:vbvs_app/pages/mh_page/help/article.dart';
|
||||
import 'package:vbvs_app/pages/mh_page/user/page/edit_userinfo_page.dart';
|
||||
import 'package:vbvs_app/pages/mh_page/experience_store_page.dart';
|
||||
import 'package:vbvs_app/pages/mh_page/issue_list_page.dart';
|
||||
@@ -31,8 +35,10 @@ import 'package:vbvs_app/pages/mh_page/sleep_habit.dart';
|
||||
import 'package:vbvs_app/pages/mh_page/smys.dart';
|
||||
import 'package:vbvs_app/pages/mh_page/user/page/find_password_page.dart';
|
||||
import 'package:vbvs_app/pages/mh_page/user/page/mht_login_page.dart';
|
||||
import 'package:vbvs_app/pages/mh_page/user/page/rxhx_mht.dart';
|
||||
import 'package:vbvs_app/pages/mh_page/user/page/update_password_page.dart';
|
||||
import 'package:vbvs_app/pages/sleep_report/new_sleep_report_page.dart';
|
||||
import '../pages/mh_page/bluetooth.dart';
|
||||
import '../pages/mh_page/edit_address_page.dart';
|
||||
import '../pages/mh_page/message_page.dart';
|
||||
import '../pages/mh_page/new_settingPage.dart';
|
||||
@@ -43,7 +49,9 @@ var mhroutes = {
|
||||
"/mianPageBottomChange": (contxt) => MainPageBBottomChange(),
|
||||
"/homeDeviceType": (contxt) => HomeDeviceType(),
|
||||
"/editUserInfoPage": (contxt) => EditUserPage(),
|
||||
"/peopleInfoPage": (contxt) => PeopleInfoPage(),
|
||||
"/peopleInfoPage": (contxt, {arguments}) => PeopleInfoPage(
|
||||
data: arguments,
|
||||
),
|
||||
"/repairHistoryListPage": (contxt) => RepairHistoryListPage(),
|
||||
"/deviceRepairPage": (contxt) => DeviceRepairPage(),
|
||||
"/settingPage": (contxt) => SettingPage(),
|
||||
@@ -52,8 +60,9 @@ var mhroutes = {
|
||||
"/addressListPage": (contxt) => AddressListPage(),
|
||||
"/editAddressPage": (contxt) => EditAddressPage(),
|
||||
"/languagePage": (context) => LanguagePage(),
|
||||
// '/bluetoothPage': (context) => BluetoothPage(),
|
||||
// "/devicePeopleInfo": (context) => DevicePeopleInfo(),
|
||||
'/bluetoothPage': (context, {arguments}) => BluetoothPage(data: arguments),
|
||||
"/devicePeopleInfo": (context, {arguments}) =>
|
||||
DevicePeopleInfo(data: arguments),
|
||||
"/sleepHabitPage": (context) => SleepHabitPage(),
|
||||
'/syms': (context) => Smys(),
|
||||
"/applyRepairPage": (context) => ApplyRepairPage(),
|
||||
@@ -79,6 +88,8 @@ var mhroutes = {
|
||||
"/bindDeviceSuccess": (contxt) => MHTBindDeviceSuccess(),
|
||||
"/newSleepReportPage": (contxt, {arguments}) =>
|
||||
NewSleepReportPage(data: arguments),
|
||||
"/rxhxMht": (context) => RxhxMht(),
|
||||
"/helpArticle": (contxt, {arguments}) => HelpArticle(article: arguments),
|
||||
};
|
||||
var mhonGenerateRoute = (RouteSettings settings) {
|
||||
final String? name = settings.name; // 获取路由名称,如 /news 或 /search
|
||||
|
||||
Reference in New Issue
Block a user