This commit is contained in:
wsl
2025-07-01 11:52:25 +08:00
83 changed files with 5526 additions and 3411 deletions

View File

@@ -43,8 +43,8 @@
<application
android:usesCleartextTraffic="true"
android:name="${applicationName}"
android:icon="@mipmap/ic_launcher"
android:label="太和e护"
android:icon="@mipmap/ic_launchermh"
android:label="眠花糖"
android:enableOnBackInvokedCallback="true"
>
<activity

View File

@@ -1,5 +1,10 @@
<<<<<<< HEAD
sdk.dir=C:\\Users\\Administrator\\AppData\\Local\\Android\\sdk
flutter.sdk=C:\\dev\\flutter
=======
sdk.dir=C:\\Users\\wyf\\AppData\\Local\\Android\\sdk
flutter.sdk=D:\\flutter_res\\flutter
>>>>>>> 13eb25e1c30dcd81c87aa85bcb5306ca0931ed21
flutter.buildMode=debug
flutter.versionName=1.0.0
flutter.versionCode=1

View File

@@ -0,0 +1 @@
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" fill="none" version="1.1" width="30" height="30" viewBox="0 0 30 30"><g><g><g><g></g></g><g><g><g><path d="M15.00048859375,18.657226875C14.87255859375,18.657226875,14.74462859375,18.608396875,14.64648859375,18.510746875C14.64648859375,18.510746875,8.33154259375,12.195312875,8.33154259375,12.195312875C8.13623049375,11.999999875,8.13623049375,11.683593875,8.33154259375,11.488280875C8.52636759375,11.292968775,8.84326159375,11.292968775,9.03857459375,11.488280875C9.03857459375,11.488280875,15.00048859375,17.450196875,15.00048859375,17.450196875C15.00048859375,17.450196875,20.96235859375,11.488280875,20.96235859375,11.488280875C21.15725859375,11.292968775,21.473658593750002,11.292968775,21.66945859375,11.488280875C21.86425859375,11.683593875,21.86425859375,11.999999875,21.66945859375,12.195312875C21.66945859375,12.195312875,15.35351859375,18.510746875,15.35351859375,18.510746875C15.256348593750001,18.608396875,15.12841859375,18.657226875,15.00048859375,18.657226875C15.00048859375,18.657226875,15.00048859375,18.657226875,15.00048859375,18.657226875Z" fill="#333333" fill-opacity="1"/></g></g></g></g></g></svg>

After

Width:  |  Height:  |  Size: 1.2 KiB

File diff suppressed because one or more lines are too long

Before

Width:  |  Height:  |  Size: 6.9 KiB

After

Width:  |  Height:  |  Size: 13 KiB

View File

@@ -171,5 +171,40 @@
"用户协议": "用户协议",
"隐私协议": "隐私协议",
"退出登录": "退出登录",
"注销账号": "注销账号"
"注销账号": "注销账号",
"我的智能设备": "我的智能设备",
"解绑成功": "解绑成功",
"解绑失败": "解绑失败",
"睡眠隐私": "睡眠隐私",
"睡眠隐私功能": "睡眠隐私功能",
"开始时间": "开始时间",
"结束时间": "结束时间",
"取消": "取消",
"确认": "确认",
"时": "时",
"分": "分",
"选择性别": "选择性别",
"*注:开启睡眠隐私功能后,在设置的时间段内,将不会采集您的睡眠数据。": "*注:开启睡眠隐私功能后,在设置时间段内,将不会采集您的睡眠数据。",
"柔性唤醒": "柔性唤醒",
"睡眠银色": "睡眠隐私",
"睡眠习惯": "睡眠习惯",
"允许对方查看设备": "允许对方查看设备",
"允许对方控制设备": "允许对方控制设备",
"已分享用户": "已分享用户",
"发送邀请": "发送邀请",
"仅允许对方查看该设备": "仅允许对方查看该设备",
"允许对方控制该设备": "允许对方控制该设备",
"点击复制APP下载链接": "点击复制APP下载链接",
"评价": "评价",
"我要评价": "我要评价",
"更新成功": "更新成功",
"更新失败": "更新失败",
"完成": "完成",
"请输入正确的联系人电话": "请输入正确的联系人电话",
"请选择体重": "请输入体重",
"请选择身高": "请输入身高",
"人员资料": "人员资料",
"请输入姓名": "请输入姓名",
"解除分享":"解除分享"
}

View File

@@ -2,6 +2,7 @@ import 'dart:ui';
import 'package:vbvs_app/common/util/FitTool.dart';
import 'package:vbvs_app/common/util/MyUtils.dart';
import 'package:vbvs_app/enum/APPPackageType.dart';
class AppConstants {
// App-related constants
@@ -46,5 +47,6 @@ class AppConstants {
];
//系统参数
int ent_type = 1;//1.默认太和 2.欢睡
//运行打包APP模式
int ent_type = APPPackageType.TH.code;//1.默认太和 2.欢睡 3.眠花糖
}

View File

@@ -26,21 +26,25 @@ class DailyLogUtils {
// 写入 info 日志(原 writeLog 保留)
static Future<void> writeLog(String content) async {
print("[dailylog-->info] $content]");
await _writeLogWithLevel('INFO', content);
}
// 写入 warning 日志
static Future<void> writeWarning(String content) async {
print("[dailylog-->waring] $content]");
await _writeLogWithLevel('WARNING', content);
}
// 写入 error 日志
static Future<void> writeError(String content) async {
print("[dailylog-->error] $content]");
await _writeLogWithLevel('ERROR', content);
}
// 写入 debug 日志
static Future<void> writeDebug(String content) async {
print("[dailylog-->debug] $content]");
await _writeLogWithLevel('DEBUG', content);
}

View File

@@ -382,7 +382,7 @@ var returnIconButtom = IconButton(
var returnIconButtomNew = ClickableContainer(
backgroundColor: Colors.transparent,
highlightColor: Colors.transparent,
padding: EdgeInsets.only(right: 0),
padding: EdgeInsets.fromLTRB(20.rpx, 20.rpx, 20.rpx, 20.rpx),
onTap: () => Get.back(),
child: Container(
// height: 42.rpx,

View File

@@ -31,10 +31,11 @@ class SleepdateWidget extends StatelessWidget {
color: isSelected ? highlightColor : Colors.transparent, // 使用传入的颜色
),
child: Padding(
padding: EdgeInsetsDirectional.fromSTEB(10.rpx, 10.rpx, 10.rpx, 10.rpx),
padding:
EdgeInsetsDirectional.fromSTEB(10.rpx, 10.rpx, 10.rpx, 10.rpx),
child: Container(
decoration: BoxDecoration(
color: Color(0xFFDC1C1C),
color: Color(0xFF757575),
shape: BoxShape.circle,
),
alignment: Alignment.center,

View File

@@ -3,13 +3,14 @@ import 'package:flutter/material.dart';
import 'package:flutter_city_picker/model/address.dart';
import 'package:flutterflow_ui/flutterflow_ui.dart';
import 'package:json_annotation/json_annotation.dart';
import 'package:lpinyin/lpinyin.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/component/tool/TopSlideNotification.dart';
import 'package:vbvs_app/controller/user_info_controller.dart';
import 'package:vbvs_app/model/user_data.dart';
import 'package:lpinyin/lpinyin.dart';
// import 'package:lpinyin/lpinyin.dart';
part 'address_controller.g.dart';
@JsonSerializable()
@@ -209,6 +210,7 @@ class AddressController extends GetControllerEx<AddressModel> {
// 工具:中文首字母转大写英文(你也可以用更专业的拼音库)
String _getLetter(String name) {
// return name;
if (name.isEmpty) return "#";
String pinyin = PinyinHelper.getPinyinE(name,
separator: '', defPinyin: '', format: PinyinFormat.WITHOUT_TONE);

View File

@@ -8,6 +8,7 @@ import 'package:vbvs_app/common/color/ServiceConstant.dart';
import 'package:vbvs_app/common/color/app_uri_status.dart';
import 'package:vbvs_app/common/util/DailyLogUtils.dart';
import 'package:vbvs_app/common/util/MyUtils.dart';
import 'package:vbvs_app/common/util/requestWithLog.dart';
import 'package:vbvs_app/controller/mh_controller/device.dart';
import 'package:vbvs_app/model/api_response.dart';
@@ -19,7 +20,6 @@ class DeviceListModel {
//设备列表
List<dynamic> deviceList = [];
@JsonKey(ignore: true)
String? keyword;
@JsonKey(ignore: true)
@@ -39,8 +39,8 @@ class DeviceListController extends GetControllerEx<DeviceListModel> {
getDeviceList() async {
try {
String search = (model.keyword != null && model.keyword!.isNotEmpty)
? "?key=${model.keyword}"
: "";
? "?key=${model.keyword}&ncs=1"
: "?ncs=1";
ApiResponse apiResponse = ApiResponse(code: -1, msg: "设备.设备列表请求失败".tr);
String serviceAddress = ServiceConstant.service_address;
String serviceName = ServiceConstant.server_service;
@@ -70,4 +70,35 @@ class DeviceListController extends GetControllerEx<DeviceListModel> {
}
return ApiResponse(code: -1, msg: "未知错误".tr); // Default return statement
}
//主动解绑设备
Future<String> unbindDevice(Map<dynamic, dynamic> device) async {
String serviceAddress = ServiceConstant.service_address;
String serviceName = ServiceConstant.server_service;
String serviceApi = ServiceConstant.device_bind;
String queryUrl = "${serviceAddress}${serviceName}${serviceApi}";
String msg = '';
int type = device['bind_type'];
await requestWithLog(
logTitle: '解绑设备',
method: MyHttpMethod.delete,
queryUrl: queryUrl,
data: {"mac": device['mac']},
onSuccess: (res) {
if (type == 1) {
msg = '解绑成功'.tr;
} else {
msg = '删除成功'.tr;
}
},
onFailure: (res) {
if (type == 1) {
msg = '解绑失败'.tr;
} else {
msg = '删除失败'.tr;
}
},
);
return msg;
}
}

View File

@@ -1,19 +1,28 @@
import 'dart:convert';
import 'package:EasyDartModule/EasyDartModule.dart';
import 'package:dio/dio.dart';
import 'package:dio/src/form_data.dart' as formdata;
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/color/app_uri_status.dart';
import 'package:vbvs_app/common/util/DailyLogUtils.dart';
import 'package:vbvs_app/common/util/MyUtils.dart';
import 'package:vbvs_app/common/util/requestWithLog.dart';
import 'package:vbvs_app/model/api_response.dart';
part 'mhdevice_share_controller.g.dart';
@JsonSerializable()
class MHDeviceShareModel {
String? phone;
String? account;
int? type = 1;
String? msg;
int? show = 0;
int? code = 0;
int limit = AppConstants.limit;
int offset = 0;
bool isLoading = false;
@@ -37,86 +46,142 @@ class MHDeviceShareController extends GetControllerEx<MHDeviceShareModel> {
attr = GetModel(MHDeviceShareModel()).obs;
}
// RxString account = "".obs;
// RxString msg = "".obs;
// RxInt code = 0.obs;
@override
void onInit() {
Future<void> onInit() async {
super.onInit();
model.shareUser = [
{
'userName': '张三',
'opType': 1, // 允许控制
},
{
'userName': '李四',
'opType': 2, // 仅查看
},
{
'userName': '王五',
'opType': 1,
},
];
update(); // 刷新UI
await shareDeviceList(Get.arguments["mac"]);
}
// Future<String> sendInvite(String? phone, String mac) async {
// if (phone == null || phone.isEmpty) {
// return "手机号不能为空";
// }
// if (!MyUtils.isValidPhoneNumber(phone)) {
// return "手机号格式不正确";
// }
// var type = model.type;
// try {
// var aa = await ApiService.requestNoInfo.post("/api/device/info/share",
// data: formdata.FormData.fromMap(
// {"mac": mac, "tel": phone, "type": type}));
// return "";
// } catch (e) {
// if (e is DioError) {
// // 返回 DioError 的 message 属性
// return e.message!;
// } else {
// // 处理其他类型的错误
// return e.toString();
// }
// }
// }
// Future<void> initData() async {
// //todo 请求分享列表
// var deviceController = Get.find<GlobalController>();
// var query = {
// "mac": deviceController.model.deviceMain['mac'],
// };
// var data = await ApiService.request
// .get("/api/device/info/share", data: formdata.FormData.fromMap(query));
// if (data.data["data"] != null) {
// try {
// List<dynamic> tmp = data.data["data"] as List<dynamic>;
// model.shareUser = tmp;
// } catch (e) {
// print(e);
// }
// } else {
// model.shareUser = [];
// }
// updateAll();
// }
// //保存
// saveShareDevice(Map shareInfo, RxInt type) async {
// return await ApiService.request.put("/api/device/info/share",
// data: formdata.FormData.fromMap({
// "mac": shareInfo['mac'],
// "tel": shareInfo['tel'],
// "type": type.value
// }));
// }
// //删除
// deleteShare(Map shareInfo) async {
// return await ApiService.request.delete("/api/device/info/share",
// data: formdata.FormData.fromMap(
// {"mac": shareInfo['mac'], "tel": shareInfo['tel']}));
// }
Future<ApiResponse> shareDevice(String mac) async {
ApiResponse apiResponse = ApiResponse(code: -1, msg: "请求失败".tr);
EasyDartModule.logger.info("分享设备");
DailyLogUtils.writeLog("分享设备");
try {
model.account = model.account!.trim();
if (model.account == null || model.account!.isEmpty) {
apiResponse.msg = "请输入手机号".tr;
return apiResponse;
}
if (!MyUtils.isValidPhoneNumber(model.account!) &&
!MyUtils.isValidEmail(model.account!)) {
apiResponse.msg = '请输入正确的手机号/邮箱号'.tr;
return apiResponse;
}
String serviceAddress = ServiceConstant.service_address;
String serviceName = ServiceConstant.server_service;
String serviceApi = ServiceConstant.device_share;
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";
}
}
var data = {"type": model.type, "userName": model.account, "mac": mac};
var response =
await EasyDartModule.dio.post(queryUrl, data: jsonEncode(data));
if (response != null) {
var responseData =
response.data is String ? jsonDecode(response.data) : response.data;
ApiResponse res =
ApiResponse.fromJson(responseData, (object) => object);
if (res.code != HttpStatusCodes.ok) {
if (res.msg == null || res.msg!.isEmpty) {
res.msg = apiResponse.msg;
}
} else {
if (res.msg == null || res.msg!.isEmpty) {
res.msg = "操作成功".tr;
}
}
if (res.code != HttpStatusCodes.ok) {
model.msg = res.msg!;
}
model.code = res.code!;
updateAll();
return res;
} else {
return ApiResponse(code: -1, msg: "服务器.失败".tr);
}
} catch (e) {
EasyDartModule.logger.info("分享设备失败:${e.toString()}");
DailyLogUtils.writeLog("分享设备失败:${e.toString()}");
return ApiResponse(code: -1, msg: "服务器.失败".tr);
}
}
shareDeviceList(String mac) async {
String serviceAddress = ServiceConstant.service_address;
String serviceName = ServiceConstant.server_service;
String serviceApi = ServiceConstant.device_share;
String queryUrl = "${serviceAddress}${serviceName}${serviceApi}?mac=$mac";
await requestWithLog(
logTitle: '分享用户列表',
method: MyHttpMethod.get,
queryUrl: queryUrl,
onSuccess: (res) => {
model.shareUser = res.data,
updateAll(),
},
);
}
Future<ApiResponse> confirmShare(String shareCode) async {
EasyDartModule.logger.info("确认消息分享");
DailyLogUtils.writeLog("确认消息分享");
try {
ApiResponse apiResponse = ApiResponse(code: -1, msg: "请求失败".tr);
if (shareCode == null || shareCode.isEmpty) {
apiResponse.msg = "请求失败".tr;
return apiResponse;
}
String serviceAddress = ServiceConstant.service_address;
String serviceName = ServiceConstant.server_service;
String serviceApi = ServiceConstant.device_share;
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";
}
}
final data = {
"code": shareCode,
};
var response =
await EasyDartModule.dio.put(queryUrl, data: jsonEncode(data));
if (response != null) {
if (response.data['code'] != HttpStatusCodes.ok) {
apiResponse.msg = response.data['msg'];
apiResponse.code = response.data['code'];
return apiResponse;
}
var responseData =
response.data is String ? jsonDecode(response.data) : response.data;
ApiResponse res =
ApiResponse.fromJson(responseData, (object) => object);
MyUtils.formatResponse(res, "操作成功".tr, "操作失败".tr);
return res;
} else {
return ApiResponse(code: -1, msg: "服务器.失败".tr);
}
} catch (e) {
EasyDartModule.logger.info("确认消息分享失败->$e");
DailyLogUtils.writeLog("确认消息分享失败->$e");
return ApiResponse(code: -1, msg: "服务器.失败".tr);
}
}
}

View File

@@ -8,10 +8,11 @@ part of 'mhdevice_share_controller.dart';
MHDeviceShareModel _$MHDeviceShareModelFromJson(Map<String, dynamic> json) =>
MHDeviceShareModel()
..phone = json['phone'] as String?
..account = json['account'] as String?
..type = (json['type'] as num?)?.toInt()
..msg = json['msg'] as String?
..show = (json['show'] as num?)?.toInt()
..code = (json['code'] as num?)?.toInt()
..limit = (json['limit'] as num).toInt()
..offset = (json['offset'] as num).toInt()
..isLoading = json['isLoading'] as bool
@@ -21,10 +22,11 @@ MHDeviceShareModel _$MHDeviceShareModelFromJson(Map<String, dynamic> json) =>
Map<String, dynamic> _$MHDeviceShareModelToJson(MHDeviceShareModel instance) =>
<String, dynamic>{
'phone': instance.phone,
'account': instance.account,
'type': instance.type,
'msg': instance.msg,
'show': instance.show,
'code': instance.code,
'limit': instance.limit,
'offset': instance.offset,
'isLoading': instance.isLoading,

View File

@@ -39,7 +39,7 @@ class RepairListController extends GetControllerEx<RepairListModel> {
String serviceName = ServiceConstant.server_service;
String serviceApi = ServiceConstant.submit_repair;
String queryUrl = "${serviceAddress}${serviceName}${serviceApi}";
requestWithLog(
await requestWithLog(
logTitle: "查询报修数据",
method: MyHttpMethod.get,
queryUrl: queryUrl,

View File

@@ -12,9 +12,7 @@ RepairListModel _$RepairListModelFromJson(Map<String, dynamic> json) =>
..offset = (json['offset'] as num).toInt()
..isLoading = json['isLoading'] as bool
..hasMore = json['hasMore'] as bool
..repairList = (json['repairList'] as List<dynamic>)
.map((e) => ApplyRepairModel.fromJson(e as Map<String, dynamic>))
.toList();
..repairList = json['repairList'] as List<dynamic>;
Map<String, dynamic> _$RepairListModelToJson(RepairListModel instance) =>
<String, dynamic>{

View File

@@ -0,0 +1,11 @@
enum APPPackageType {
TH(1, '太和'),
HUANSHUI(2, '欢睡'),
MHT(3, '眠花糖'),
;
final int code;
final String description;
const APPPackageType(this.code, this.description);
}

View File

@@ -12,7 +12,6 @@ import 'package:fluwx/fluwx.dart';
import 'package:get_storage/get_storage.dart';
import 'package:localstorage/localstorage.dart';
import 'package:syncfusion_localizations/syncfusion_localizations.dart';
import 'package:vbvs_app/common/color/AppGlobal.dart';
import 'package:vbvs_app/common/color/ServiceConstant.dart';
import 'package:vbvs_app/common/util/CheckNetwork.dart';
import 'package:vbvs_app/common/util/CommonVariables.dart';
@@ -194,8 +193,6 @@ void initEasyDartModule() {
//初始化
}
Future<void> initLogin() async {
// 初始化控制器
Get.put(UserInfoController());
@@ -358,6 +355,8 @@ class MyApp extends StatelessWidget {
Get.lazyPut(() => MHTDeviceCalibrationController()),
Get.lazyPut(() => SleepReportController()),
Get.lazyPut(() => CalendarController()),
Get.lazyPut(() => UserPdfController()),
Get.lazyPut(() => PrivacyPdfController()),
Get.put(WebviewTestController()),
]));
}

View File

@@ -714,13 +714,13 @@ Future showDayTimeSelectionDialog(
width: 100.rpx,
height: 60.rpx,
alignment: Alignment.center,
child: Text("取消",
child: Text("取消".tr,
style: TextStyle(
fontSize: 30.rpx, color: Colors.white)),
),
),
Text(
title,
title.tr,
style: TextStyle(
fontFamily: 'Readex Pro',
color: themeController.currentColor.sc3,
@@ -742,7 +742,7 @@ Future showDayTimeSelectionDialog(
width: 100.rpx,
height: 60.rpx,
alignment: Alignment.center,
child: Text("确认",
child: Text("确认".tr,
style: TextStyle(
fontSize: 30.rpx, color: Colors.white)),
),
@@ -778,7 +778,7 @@ Future showDayTimeSelectionDialog(
context,
hours,
hoursIndex,
unit: "",
unit: "".tr,
),
),
Expanded(
@@ -786,7 +786,7 @@ Future showDayTimeSelectionDialog(
context,
minutes,
minutesIndex,
unit: "",
unit: "".tr,
),
),
],
@@ -856,12 +856,12 @@ Future showOneSelectionDialog(
alignment: Alignment.center,
width: 100.rpx,
height: 60.rpx,
child: Text("取消",
child: Text("取消".tr,
style: TextStyle(
fontSize: 30.rpx, color: Colors.white)),
),
),
Text(title,
Text(title.tr,
style: TextStyle(
fontFamily: 'Readex Pro',
color: Colors.white,
@@ -879,7 +879,7 @@ Future showOneSelectionDialog(
alignment: Alignment.center,
width: 100.rpx,
height: 60.rpx,
child: Text("确认",
child: Text("确认".tr,
style: TextStyle(
fontSize: 30.rpx, color: Colors.white)),
),

View File

@@ -1128,3 +1128,235 @@ Future<void> showUnBindTipDialog(
},
);
}
Future<void> showUnbindConfirmDialog({
required BuildContext context,
required VoidCallback onConfirm,
required VoidCallback onCancel,
required String title,
}) async {
await showDialog(
context: context,
barrierDismissible: true,
builder: (BuildContext context) {
return FrostedDialog(
blurSigma: 3.0,
child: Container(
width: 520.rpx,
height: 460.rpx,
decoration: BoxDecoration(
color: Colors.white,
borderRadius: BorderRadius.circular(20.0),
),
child: Padding(
padding: EdgeInsets.only(
left: 45.rpx, right: 45.rpx, top: 90.rpx, bottom: 60.rpx),
child: Column(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
mainAxisSize: MainAxisSize.min,
children: [
Text(
title,
style: TextStyle(
fontSize: 30.rpx,
color: Colors.black,
),
),
const SizedBox(height: 12),
RichText(
textAlign: TextAlign.center,
text: TextSpan(
style: TextStyle(fontSize: 26.rpx, color: Colors.black87),
children: [
TextSpan(
text: '该设备只可被一个用户绑定,',
style: TextStyle(fontSize: 26.rpx)),
TextSpan(
text: '解绑后',
style: TextStyle(color: Colors.red, fontSize: 26.rpx),
),
TextSpan(
text: '其他用户才可以绑定',
style: TextStyle(fontSize: 26.rpx)),
],
),
),
const SizedBox(height: 24),
Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
CustomCard(
gradientDirection: GradientDirection.vertical,
borderRadius: 16.rpx,
onTap: () {
Get.back();
onCancel();
},
colors: [
Color(0xFF1592AA),
Color(0XFF0C83A7),
Color(0XFF006FA3)
],
child: Container(
width: 200.rpx,
height: 90.rpx,
alignment: Alignment.center,
child: Text(
'取消',
style: TextStyle(
fontSize: 26.rpx, color: Colors.white),
),
)),
CustomCard(
borderRadius: 16.rpx,
onTap: () {
Get.back();
onConfirm();
},
colors: [
Color(0xFF1592AA),
Color(0XFF0C83A7),
Color(0XFF006FA3)
],
child: Container(
width: 200.rpx,
height: 90.rpx,
alignment: Alignment.center,
child: Text(
'解绑',
style: TextStyle(
fontSize: 26.rpx, color: Colors.white),
),
))
// _buildButton(
// text: '解绑',
// onPressed: () {
// Navigator.pop(context);
// onConfirm();
// },
// isGradient: true,
// ),
],
)
],
),
),
));
},
);
}
Future<void> showDeleteDeviceConfirmDialog({
required BuildContext context,
required VoidCallback onConfirm,
required VoidCallback onCancel,
required String title,
}) async {
await showDialog(
context: context,
barrierDismissible: true,
builder: (BuildContext context) {
return FrostedDialog(
blurSigma: 3.0,
child: Container(
width: 520.rpx,
height: 460.rpx,
decoration: BoxDecoration(
color: Colors.white,
borderRadius: BorderRadius.circular(20.0),
),
child: Padding(
padding: EdgeInsets.only(
left: 45.rpx, right: 45.rpx, top: 90.rpx, bottom: 60.rpx),
child: Column(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
mainAxisSize: MainAxisSize.min,
children: [
Text(
title,
style: TextStyle(
fontSize: 30.rpx,
color: Colors.black,
),
),
const SizedBox(height: 12),
RichText(
textAlign: TextAlign.center,
text: TextSpan(
style: TextStyle(fontSize: 26.rpx, color: Colors.black87),
children: [
TextSpan(
text: '删除后,',
style:
TextStyle(color: Colors.red, fontSize: 26.rpx)),
TextSpan(
text: '该设备的历史数据将被清除',
style: TextStyle(fontSize: 26.rpx),
),
],
),
),
const SizedBox(height: 24),
Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
CustomCard(
gradientDirection: GradientDirection.vertical,
borderRadius: 16.rpx,
onTap: () {
Get.back();
onCancel();
},
colors: [
Color(0xFF1592AA),
Color(0XFF0C83A7),
Color(0XFF006FA3)
],
child: Container(
width: 200.rpx,
height: 90.rpx,
alignment: Alignment.center,
child: Text(
'取消',
style: TextStyle(
fontSize: 26.rpx, color: Colors.white),
),
)),
CustomCard(
borderRadius: 16.rpx,
onTap: () {
Get.back();
onConfirm();
},
colors: [
Color(0xFF1592AA),
Color(0XFF0C83A7),
Color(0XFF006FA3)
],
child: Container(
width: 200.rpx,
height: 90.rpx,
alignment: Alignment.center,
child: Text(
'删除',
style: TextStyle(
fontSize: 26.rpx, color: Colors.white),
),
))
// _buildButton(
// text: '解绑',
// onPressed: () {
// Navigator.pop(context);
// onConfirm();
// },
// isGradient: true,
// ),
],
)
],
),
),
));
},
);
}

View File

@@ -1,12 +1,32 @@
import 'package:ef/ef.dart';
import 'package:flutter/material.dart';
import 'package:vbvs_app/pages/common/bezier_bottom_navigation_bar.dart';
import 'package:vbvs_app/pages/mh_page/MattressControl.dart';
import 'package:vbvs_app/pages/mh_page/device_list.dart';
import 'package:vbvs_app/pages/mh_page/homepage/mht_sleep_report_page.dart';
import 'package:vbvs_app/pages/mh_page/homepage/new_Home_page.dart';
import 'package:vbvs_app/pages/mh_page/new_mine_page.dart';
import 'package:vbvs_app/pages/mh_page/test/WebviewTestModel.dart';
class MainPageBBottomChange extends StatefulWidget {
// 全局 key用于静态访问 _HomePageState
static final GlobalKey<_HomePageState> globalKey =
GlobalKey<_HomePageState>();
MainPageBBottomChange({Key? key}) : super(key: globalKey);
// 静态方法:外部调用,跳转 tab
static void jumpTo(int index) {
final state = globalKey.currentState;
if (state != null) {
state.switchTab(index);
}
}
static int? getCurrentIndex() {
final state = globalKey.currentState;
return state?.selectedIndex;
}
@override
_HomePageState createState() => _HomePageState();
}
@@ -55,6 +75,7 @@ class _HomePageState extends State<MainPageBBottomChange>
void _onTabTapped(int index) {
setState(() {
dealWebSource(index);
final begin = currentPosition;
final end = index.toDouble();
_positionAnimation = Tween<double>(begin: begin, end: end).animate(
@@ -95,4 +116,31 @@ class _HomePageState extends State<MainPageBBottomChange>
),
);
}
void switchTab(int index) {
final begin = currentPosition;
final end = index.toDouble();
_positionAnimation = Tween<double>(begin: begin, end: end).animate(
CurvedAnimation(parent: _controller, curve: Curves.easeOut),
)..addListener(() {
setState(() {});
});
_controller.forward(from: 0.0);
currentPosition = end;
setState(() {
selectedIndex = index;
});
}
Future<void> dealWebSource(int index) async {
WebviewTestController webviewTestController = Get.find();
if (index == 2) {
await webviewTestController.web.jsbridge?.dart.pageActive();
} else {
await webviewTestController.web.jsbridge?.dart.pageInActive();
}
}
}

View File

@@ -49,7 +49,7 @@ class _BackMovementPageState extends State<BackMovementPage> {
),
// 左侧图标
Positioned(
left: 20.rpx,
left: 0.rpx,
child: returnIconButtomNew,
),
],

View File

@@ -58,7 +58,7 @@ class _HomeDeviceTypeState extends State<HomeDeviceType> {
),
// 左侧图标
Positioned(
left: 20.rpx,
left: 0.rpx,
child: returnIconButtom,
),
],

View File

@@ -12,16 +12,16 @@ class LanguagePage extends GetView<MHLanguageController> {
// }
MHLanguageController controller = Get.find();
BoxConstraints? bodysize;
List<String> languageList = [
'简体中文',
'繁體中文',
'English',
];
final Map<String, String> languageMap = {
'简体中文': 'zh_CN',
'繁體中文': 'zh_TW',
'English': 'en_US',
};
// List<String> languageList = [
// '简体中文',
// '繁體中文',
// 'English',
// ];
// final Map<String, String> languageMap = {
// '简体中文': 'zh_CN',
// '繁體中文': 'zh_TW',
// 'English': 'en_US',
// };
// class _LanguagePageState extends State<LanguagePage> {
RxBool checkboxValue = false.obs;
@@ -56,7 +56,7 @@ class LanguagePage extends GetView<MHLanguageController> {
children: [
// 中间居中的标题
Text(
'切换语言',
'切换语言'.tr,
textAlign: TextAlign.center,
style: TextStyle(
color: Colors.white,

View File

@@ -3,8 +3,6 @@ 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/ClickableContainer.dart';
import 'package:vbvs_app/pages/mh_page/test/WebviewTestModel.dart';
class MattressControlPage extends StatefulWidget {
@@ -17,35 +15,6 @@ class MattressControlPage extends StatefulWidget {
class _MattressControlPageState extends State<MattressControlPage> {
final controller = Get.put(ControlCardController());
final data = {
"_id": "333330000000000000000000",
"uid": "684b90df767e00004e0072e2",
"bind_type": 1,
"device_type": 3,
"mac": "545024122666",
"bind_mac": null,
"bind_mac_a": "B43A45C3D411",
"bind_mac_b": "B43A45C3D388",
"position": 0,
"share_uid": null,
"person": null,
"op_type": null,
"show": true,
"create_time": 1750121686274,
"room_id": "684395bf9ef8601da20f6475",
"roomName": "主卧",
"shareNum": 0,
"status": {
"signal": -1,
"status": 0,
"inBed": 0,
"upgrade": 0,
"failure": 0,
"updateTime": -1
},
"code": "545024122666",
"blueToothStatus": 1
};
int selectedIndex = 1; // 当前选中的tab索引
@override
Widget build(BuildContext context) {
@@ -138,9 +107,9 @@ class _MattressControlPageState extends State<MattressControlPage> {
body: SafeArea(
child: WebviewTestView(
oncreate: (widget) {
return WebviewTestController();
},
// oncreate: (widget) {
// return WebviewTestController();
// },
),
),
))));

View File

@@ -39,7 +39,7 @@ class _MhMessageListWidgetState extends State<MhMessageListWidget> {
highlightColor: Color(0xFF055466),
borderRadius: 20.rpx,
padding:
EdgeInsetsDirectional.fromSTEB(31.rpx, 33.rpx, 0.rpx, 33.rpx),
EdgeInsetsDirectional.fromSTEB(31.rpx, 33.rpx, 26.rpx, 26.rpx),
onTap: () {},
child: Column(
mainAxisSize: MainAxisSize.max,
@@ -95,65 +95,64 @@ class _MhMessageListWidgetState extends State<MhMessageListWidget> {
),
].divide(SizedBox(width: 30.rpx)),
),
],
),
),
if (messageInfo['type'] == 'app_system')
Positioned(
bottom: 46.rpx,
right: 20.rpx,
child: Container(
width: 123.rpx,
height: 47.rpx,
// // right: 26.rpx,
// left: 26.rpx,
Container(
// width: 123.rpx,
height: 61.rpx,
child: CustomCard(
borderRadius: AppConstants().button_container_radius, // 直角
colors: messageInfo['status'] == 1
? [
themeController.currentColor.sc1,
themeController.currentColor.sc2
]
: [themeController.currentColor.sc4], // 单色背景
borderRadius: 16.rpx, // 直角
gradientDirection: GradientDirection.vertical,
colors: [Color(0xFF84F5FF)],
enableAnimation: true, // 有点击缩放动画
enableGradient: false, // 不用渐变
onTap: () {
if (messageInfo['status'] == 1) {
showConfirmDialog(context, Container(), "是否确认接受该设备".tr,
onConfirm: () async {
ApiResponse apiResponse = await deviceShareController
.confirmShare(messageInfo['data']['shareCode']);
if (apiResponse.code == HttpStatusCodes.ok) {
TopSlideNotification.show(
context,
text: apiResponse.msg!,
textColor: themeController.currentColor.sc2,
);
messageController.getMessageList();
messageController.updateAll();
} else {
TopSlideNotification.show(
context,
text: apiResponse.msg!,
textColor: themeController.currentColor.sc9,
);
messageController.getMessageList();
messageController.updateAll();
}
}, onCancel: () {});
}
// if (messageInfo['status'] == 1) {
// showConfirmDialog(
// context, Container(), "是否确认接受该设备".tr,
// onConfirm: () async {
// ApiResponse apiResponse =
// await deviceShareController.confirmShare(
// messageInfo['data']['shareCode']);
// if (apiResponse.code == HttpStatusCodes.ok) {
// TopSlideNotification.show(
// context,
// text: apiResponse.msg!,
// textColor: themeController.currentColor.sc2,
// );
// messageController.getMessageList();
// messageController.updateAll();
// } else {
// TopSlideNotification.show(
// context,
// text: apiResponse.msg!,
// textColor: themeController.currentColor.sc9,
// );
// messageController.getMessageList();
// messageController.updateAll();
// }
// }, onCancel: () {});
// }
Get.toNamed('/messageDetail', arguments: messageInfo);
},
child: Center(
child: Text(
getMessageStatus(messageInfo['status']),
// getMessageStatus(messageInfo['status']),
"查看详情",
style: TextStyle(
fontFamily: 'Inter',
fontSize: 26.rpx,
letterSpacing: 0.0,
color: Colors.white,
color: Color(0xFF011D33),
),
),
),
),
),
],
),
),
],
);

View File

@@ -0,0 +1,319 @@
import 'package:ef/base/widget/flutterflow/FlutterFlowTheme.dart';
import 'package:ef/ef.dart';
import 'package:flutter/material.dart';
import 'package:flutterflow_ui/flutterflow_ui.dart';
import 'package:vbvs_app/common/color/appColors.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/component/tool/CustomCard.dart';
import 'package:vbvs_app/controller/mh_controller/mhdevice_share_controller.dart';
import 'package:vbvs_app/pages/common/selectDialog.dart';
import '../../common/color/appFontsize.dart';
class ShareDeviceDetailWidget extends GetView {
final scaffoldKey = GlobalKey<ScaffoldState>();
@override
Widget build(BuildContext context) {
MHDeviceShareController deviceShareController = Get.find();
var shareInfo = deviceShareController.model.mainShare;
RxInt type = 1.obs;
type.value = shareInfo['op_type'];
return GestureDetector(
onTap: () => FocusScope.of(context).unfocus(),
child: Scaffold(
key: scaffoldKey,
backgroundColor: FlutterFlowTheme.of(context).primaryBackground,
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: 0.rpx,
child: returnIconButtomNew,
),
],
),
),
actions: [],
centerTitle: false,
),
body: Container(
width: MediaQuery.sizeOf(context).width,
height: MediaQuery.sizeOf(context).height * 1,
decoration: BoxDecoration(
color: Color(0xFFF6F6F6),
),
child: Padding(
padding: EdgeInsetsDirectional.fromSTEB(15, 0, 15, 0),
child: Column(
mainAxisSize: MainAxisSize.max,
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
Padding(
padding: EdgeInsetsDirectional.fromSTEB(0, 13, 0, 0),
child: Container(
width: MediaQuery.sizeOf(context).width,
decoration: BoxDecoration(
color: FlutterFlowTheme.of(context).secondaryBackground,
borderRadius: BorderRadius.circular(8),
),
child: Padding(
padding: EdgeInsetsDirectional.fromSTEB(16, 13, 16, 15),
child: Column(
mainAxisSize: MainAxisSize.max,
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Column(
mainAxisSize: MainAxisSize.max,
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Text(
'${shareInfo['userName']}',
style: FlutterFlowTheme.of(context)
.bodyMedium
.override(
fontFamily: 'Readex Pro',
color: Color(0xFF333333),
fontSize: 15,
letterSpacing: 0.0,
fontWeight: FontWeight.bold,
),
),
Text(
'分享时间:${MyUtils.timestampToDateString(int.parse(shareInfo['startTime'].toString()))}',
style: FlutterFlowTheme.of(context)
.bodyMedium
.override(
fontFamily: 'Readex Pro',
color: Color(0xFF9EA4B7),
fontSize: 11,
letterSpacing: 0.0,
),
),
].divide(SizedBox(height: 5)),
),
Obx(
() => GestureDetector(
onTap: () {
// 当点击时,将 type 设置为 0允许控制
type.value = 1;
controller.updateAll();
},
child: Container(
width: MediaQuery.sizeOf(context).width,
constraints: BoxConstraints(
minHeight: 46,
),
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(0),
),
child: Row(
mainAxisSize: MainAxisSize.max,
mainAxisAlignment:
MainAxisAlignment.spaceBetween,
children: [
Text(
'允许对方控制该设备'.tr,
style: FlutterFlowTheme.of(context)
.bodyMedium
.override(
fontFamily: 'Readex Pro',
color: Color(0xFF333333),
fontSize: 13,
letterSpacing: 0.0,
),
),
Align(
alignment: AlignmentDirectional(0, -1),
child: Icon(
type.value == 1
? Icons.check_circle // 选中时为实心圆
: Icons
.radio_button_unchecked, // 未选中时为空心圆
color: type.value == 1
? Color(0xFFD3B684) // 选中时的颜色
: Colors.grey, // 未选中时的颜色
size: 18,
),
),
],
),
),
),
),
Obx(
() => GestureDetector(
onTap: () {
// 当点击时,将 type 设置为 1仅允许查看
type.value = 2;
controller.updateAll();
},
child: Container(
width: MediaQuery.sizeOf(context).width,
constraints: BoxConstraints(
minHeight: 46,
),
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(0),
),
child: Row(
mainAxisSize: MainAxisSize.max,
mainAxisAlignment:
MainAxisAlignment.spaceBetween,
children: [
Text(
'仅允许对方查看该设备'.tr,
style: FlutterFlowTheme.of(context)
.bodyMedium
.override(
fontFamily: 'Readex Pro',
color: Color(0xFF333333),
fontSize: 13,
letterSpacing: 0.0,
),
),
Align(
alignment: AlignmentDirectional(0, -1),
child: Icon(
type.value == 2
? Icons.check_circle // 选中时为实心圆
: Icons
.radio_button_unchecked, // 未选中时为空心圆
color: type.value == 2
? Color(0xFFD3B684) // 选中时的颜色
: Colors.grey, // 未选中时的颜色
size: 18,
),
),
],
),
),
),
),
].divide(SizedBox(height: 13)),
),
),
),
),
Padding(
padding: EdgeInsetsDirectional.fromSTEB(
15, 0, 15, AppConstants.page_button_bottom_padding),
child: Container(
width: MediaQuery.sizeOf(context).width,
height: MediaQuery.sizeOf(context).height * 0.056,
constraints: BoxConstraints(
minHeight: 46,
),
decoration: BoxDecoration(
color: FlutterFlowTheme.of(context).secondaryBackground,
),
child: Container(
width: MediaQuery.sizeOf(context).width,
height: MediaQuery.sizeOf(context).height * 0.056,
decoration: BoxDecoration(
color:
FlutterFlowTheme.of(context).secondaryBackground,
borderRadius: BorderRadius.circular(12),
),
child: CustomCard(
borderRadius: 16.rpx,
gradientDirection: GradientDirection.vertical,
onTap: () async {},
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("解除分享".tr,
style: TextStyle(
color: const Color(0xFF003058),
fontSize: 30.rpx,
)),
),
)
// FFButtonWidget(
// onPressed: () {
// showCustomConfirmDialog(context, "是否确定删除?").then((v) {
// if ('confirm' == v) {
// // deviceShareController
// // .deleteShare(shareInfo)
// // .then((d) {
// // deviceShareController.initData();
// // deviceShareController.updateAll();
// // Get.back();
// // });
// // print("showCustomConfirmDialog $v");
// }
// });
// },
// text: '删除',
// options: FFButtonOptions(
// height: 40,
// padding: EdgeInsetsDirectional.fromSTEB(24, 0, 24, 0),
// iconPadding:
// EdgeInsetsDirectional.fromSTEB(0, 0, 0, 0),
// color: Color(0xFFE55E92),
// textStyle:
// FlutterFlowTheme.of(context).titleSmall.override(
// fontFamily: 'Readex Pro',
// color: Colors.white,
// fontSize: 13,
// letterSpacing: 0.0,
// ),
// elevation: 3,
// borderSide: BorderSide(
// color: Colors.transparent,
// width: 1,
// ),
// borderRadius: BorderRadius.circular(8),
// ),
// ),
),
),
),
],
),
),
),
),
);
}
}

View File

@@ -20,7 +20,7 @@ class ShareUserWidget extends GetView {
onTap: () {
repairListController.model.mainShare =
repairListController.model.shareUser![index];
Get.toNamed('/share_device_user_detail');
Get.toNamed('/shareDeviceDetail');
},
child: Container(
width: MediaQuery.sizeOf(context).width,
@@ -77,10 +77,10 @@ class ShareUserWidget extends GetView {
child: Align(
alignment: const AlignmentDirectional(-1, 0),
child: Text(
info['opType'] == 1
? '允许对方控制该设备'
: info['opType'] == 2
? '仅允许对方查看该设备'
info['op_type'] == 1
? '允许对方控制该设备'.tr
: info['op_type'] == 2
? '仅允许对方查看该设备'.tr
: '',
style: TextStyle(
fontFamily: 'Readex Pro',

View File

@@ -0,0 +1,128 @@
import 'package:ef/ef.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/component/tool/WebViewWidget.dart';
class MhAboutUsPage extends StatefulWidget {
late MyWebView webView;
MhAboutUsPage({super.key});
@override
State<MhAboutUsPage> createState() => _MhAboutUsPageState();
}
class _MhAboutUsPageState extends State<MhAboutUsPage> {
@override
void initState() {
super.initState();
// pdfController.loadPdf();
widget.webView = MyWebView(
url: AppConstants().ent_type == 1
? "https://mp.weixin.qq.com/s/BrD3fTT2J2R-DxZrUuM4rw"
: "https://mp.weixin.qq.com/s/7BvvprVDqX1eOzM3Lms8dg",
onLoad: () {
print('网页载入完毕');
},
);
}
@override
Widget build(BuildContext context) {
return LayoutBuilder(
builder: (context, bodySize) => GestureDetector(
onTap: () => FocusScope.of(context).unfocus(),
child: Container(
decoration: BoxDecoration(
image: DecorationImage(
image: AssetImage('assets/images/new_background.png'), // 本地图片
fit: BoxFit.fill, // 填满整个 Container
),
),
child: Scaffold(
backgroundColor: Colors.transparent, // 加上这一行
appBar: AppBar(
backgroundColor: Colors.transparent,
// backgroundColor: Colors.transparent,
automaticallyImplyLeading: false,
iconTheme: IconThemeData(color: themeController.currentColor.sc3),
titleSpacing: 0,
// leading: returnIconButtom,
title: Container(
width: double.infinity,
height: 180.rpx,
child: Stack(
alignment: Alignment.center,
children: [
/// 居中标题
Text('关于我们'.tr,
style: TextStyle(
fontFamily: 'Readex Pro',
color: themeController.currentColor.sc3,
letterSpacing: 0,
fontSize: 30.rpx,
)),
/// 左边返回按钮
Positioned(
left: 0,
child: returnIconButtomNew,
),
],
),
),
actions: [],
centerTitle: false,
),
// body: SafeArea(
// top: true,
// child: Padding(
// padding: EdgeInsets.symmetric(horizontal: 30.rpx),
// child: Column(
// children: [
// Expanded(
// child: Obx(() {
// if (pdfController.localPdfPath.value == null) {
// return Center(child: CircularProgressIndicator());
// } else {
// return PDFView(
// filePath: pdfController.localPdfPath.value!,
// autoSpacing: false,
// enableSwipe: true,
// swipeHorizontal: false,
// pageSnap: true,
// fitEachPage: true,
// defaultPage: 0,
// onRender: (pages) => print('PDF 渲染完成,共 $pages 页'),
// onError: (error) => print('PDF 加载错误: $error'),
// );
// }
// }),
// ),
// ],
// ),
// ),
// ),
body: SafeArea(
top: true,
child: Padding(
padding: EdgeInsets.symmetric(horizontal: 0.rpx),
child: Column(children: [
Expanded(
child: Container(
child: widget.webView,
),
),
]),
),
),
),
),
),
);
}
}

View File

@@ -56,7 +56,7 @@ class AddressListPage extends GetView<AddressListController> {
),
// 左侧图标
Positioned(
left: 20.rpx,
left: 0.rpx,
child: returnIconButtomNew,
),
],
@@ -71,37 +71,76 @@ class AddressListPage extends GetView<AddressListController> {
child: Column(
mainAxisSize: MainAxisSize.max,
children: [
// Obx(() {
// if (controller.model.addressList!.isEmpty) {
// // 如果地址列表为空,显示 EmptyMessageWidget
// return Expanded(child: NullDataWidget());
// } else {
// // 如果地址列表不为空,显示地址列表
// return Expanded(
// child: Container(
// width: bodysize!.maxWidth,
// height: bodysize!.maxHeight * 1,
// decoration: BoxDecoration(),
// child: Obx(() => ListView(
// shrinkWrap: true,
// scrollDirection: Axis.vertical,
// children: (controller.model.addressList!
// .asMap()
// .entries
// .map((e) => AddressModuleWidget(
// index: e.key,
// addressListController:
// controller,
// ))
// .toList() as List<Widget>)
// .divide(const SizedBox(height: 10))
// .addToEnd(const SizedBox(
// height:
// AppConstants.list_end_height)),
// )),
// ),
// );
// }
// }),
Obx(() {
if (controller.model.addressList!.isEmpty) {
// 如果地址列表为空,显示 EmptyMessageWidget
return Expanded(child: NullDataWidget());
} else {
// 如果地址列表不为空,显示地址列表
final originList = controller.model.addressList ?? [];
// 拆出默认地址
final defaultItem = originList.firstWhere(
(e) => e["default"] == 1,
orElse: () => null,
);
// 其他非默认地址
final others =
originList.where((e) => e["default"] != 1).toList();
// 新的展示顺序列表(默认地址排前面)
final reorderedList = [
if (defaultItem != null) defaultItem,
...others,
];
return Expanded(
child: Container(
width: bodysize!.maxWidth,
height: bodysize!.maxHeight * 1,
decoration: BoxDecoration(),
child: Obx(() => ListView(
child: ListView(
shrinkWrap: true,
scrollDirection: Axis.vertical,
children: (controller.model.addressList!
.asMap()
.entries
.map((e) => AddressModuleWidget(
index: e.key,
addressListController:
controller,
))
.toList() as List<Widget>)
padding: EdgeInsets.zero,
children: reorderedList
.map((item) {
final realIndex =
originList.indexOf(item); // 保留原始 index
return AddressModuleWidget(
index: realIndex,
addressListController: controller,
);
})
.toList()
.divide(const SizedBox(height: 10))
.addToEnd(const SizedBox(
height:
AppConstants.list_end_height)),
)),
height: AppConstants.list_end_height)),
),
);
}
}),
Align(
alignment: AlignmentDirectional(0, 1),

View File

@@ -38,7 +38,7 @@ class _ApplyRepairSuccessState extends State<ApplyRepairSuccess> {
decoration: BoxDecoration(
image: DecorationImage(
image: AssetImage('assets/images/new_background.png'), // 本地图片
fit: BoxFit.fill, // 填满整个 Container
fit: BoxFit.contain, // 填满整个 Container
),
),
child: Scaffold(
@@ -119,7 +119,7 @@ class _ApplyRepairSuccessState extends State<ApplyRepairSuccess> {
// width: double.infinity,
decoration: BoxDecoration(),
child: SvgPicture.asset('assets/img/icon/tick.svg',
fit: BoxFit.cover, color: Color(0XFF84F5FF)),
fit: BoxFit.contain, color: Color(0XFF84F5FF)),
),
),
Padding(

View File

@@ -79,7 +79,7 @@ class ApplyRepairPage extends GetView<ApplyRepairController> {
),
// 左侧图标
Positioned(
left: 20.rpx,
left: 0.rpx,
child: returnIconButtomNew,
),
],
@@ -1168,90 +1168,100 @@ class ApplyRepairPage extends GetView<ApplyRepairController> {
child:
TextFormField(
// autofocus: true,
obscureText:
false,
onChanged:
(value) {
(val) {
controller
.model
.apply_name =
value;
val;
},
obscureText:
false,
decoration:
InputDecoration(
isDense: true,
contentPadding:
EdgeInsets
.symmetric(
vertical:
25.rpx,
horizontal:
26.rpx,
),
labelStyle:
const TextStyle(
TextStyle(
fontFamily:
'Readex Pro',
letterSpacing:
0,
),
hintStyle:
const TextStyle(
TextStyle(
fontFamily:
'Readex Pro',
letterSpacing:
0,
),
enabledBorder:
OutlineInputBorder(
UnderlineInputBorder(
borderSide:
BorderSide(
color: const Color(
const BorderSide(
color: Color(
0x00000000),
width:
1.rpx,
width: 2,
),
borderRadius:
BorderRadius.circular(
AppConstants().normal_container_radius),
BorderRadius
.circular(8),
),
focusedBorder:
OutlineInputBorder(
UnderlineInputBorder(
borderSide:
BorderSide(
color: Colors
.transparent,
width:
1.rpx,
const BorderSide(
color: Color(
0x00000000),
width: 2,
),
borderRadius:
BorderRadius.circular(
8.rpx),
BorderRadius
.circular(8),
),
errorBorder:
OutlineInputBorder(
UnderlineInputBorder(
borderSide:
BorderSide(
//
width:
1.rpx,
const BorderSide(
color: Color(
0x00000000),
width: 2,
),
borderRadius:
BorderRadius.circular(
8.rpx),
BorderRadius
.circular(8),
),
focusedErrorBorder:
OutlineInputBorder(
UnderlineInputBorder(
borderSide:
BorderSide(
//
width:
1.rpx,
const BorderSide(
color: Color(
0x00000000),
width: 2,
),
borderRadius:
BorderRadius.circular(
8.rpx),
BorderRadius
.circular(8),
),
),
style: TextStyle(
style:
TextStyle(
fontFamily:
'Readex Pro',
letterSpacing:
0,
color: Colors
.black,
fontSize:
26.rpx),
26.rpx,
),
),
),
),
@@ -1324,90 +1334,100 @@ class ApplyRepairPage extends GetView<ApplyRepairController> {
child:
TextFormField(
// autofocus: true,
obscureText:
false,
onChanged:
(value) {
(val) {
controller
.model
.tel =
value;
val;
},
obscureText:
false,
decoration:
InputDecoration(
isDense: true,
contentPadding:
EdgeInsets
.symmetric(
vertical:
25.rpx,
horizontal:
26.rpx,
),
labelStyle:
const TextStyle(
TextStyle(
fontFamily:
'Readex Pro',
letterSpacing:
0,
),
hintStyle:
const TextStyle(
TextStyle(
fontFamily:
'Readex Pro',
letterSpacing:
0,
),
enabledBorder:
OutlineInputBorder(
UnderlineInputBorder(
borderSide:
BorderSide(
color: const Color(
const BorderSide(
color: Color(
0x00000000),
width:
1.rpx,
width: 2,
),
borderRadius:
BorderRadius.circular(
AppConstants().normal_container_radius),
BorderRadius
.circular(8),
),
focusedBorder:
OutlineInputBorder(
UnderlineInputBorder(
borderSide:
BorderSide(
color: Colors
.transparent,
width:
1.rpx,
const BorderSide(
color: Color(
0x00000000),
width: 2,
),
borderRadius:
BorderRadius.circular(
8.rpx),
BorderRadius
.circular(8),
),
errorBorder:
OutlineInputBorder(
UnderlineInputBorder(
borderSide:
BorderSide(
//
width:
1.rpx,
const BorderSide(
color: Color(
0x00000000),
width: 2,
),
borderRadius:
BorderRadius.circular(
8.rpx),
BorderRadius
.circular(8),
),
focusedErrorBorder:
OutlineInputBorder(
UnderlineInputBorder(
borderSide:
BorderSide(
//
width:
1.rpx,
const BorderSide(
color: Color(
0x00000000),
width: 2,
),
borderRadius:
BorderRadius.circular(
8.rpx),
BorderRadius
.circular(8),
),
),
style: TextStyle(
style:
TextStyle(
fontFamily:
'Readex Pro',
letterSpacing:
0,
color: Colors
.black,
fontSize:
26.rpx),
26.rpx,
),
),
),
),

View File

@@ -6,13 +6,28 @@ import 'package:vbvs_app/common/util/FitTool.dart';
import 'package:vbvs_app/common/util/MyUtils.dart';
import 'package:vbvs_app/component/tool/ClickableContainer.dart';
import 'package:vbvs_app/component/tool/TopSlideNotification.dart';
import 'package:vbvs_app/controller/mh_controller/device_list_controller.dart';
import 'package:vbvs_app/model/api_response.dart';
import 'package:vbvs_app/pages/device_bind/componnet/bind_dialog.dart';
import 'package:vbvs_app/pages/mh_page/test/WebviewTestModel.dart';
class BluetoothPage extends GetView {
Map data;
BluetoothPage({required this.data});
class BluetoothPage extends StatefulWidget {
final Map data;
BluetoothPage({Key? key, required this.data});
@override
_BluetoothPageState createState() => _BluetoothPageState();
}
class _BluetoothPageState extends State<BluetoothPage> {
late RxMap<String, dynamic> obsData;
@override
void initState() {
super.initState();
obsData = Map<String, dynamic>.from(widget.data).obs; // 复制成 obs
}
BoxConstraints? bodysize;
DeviceListController deviceListController = Get.find();
@override
Widget build(BuildContext context) {
return LayoutBuilder(builder: (context, cc) {
@@ -50,7 +65,7 @@ class BluetoothPage extends GetView {
),
// 左侧图标
Positioned(
left: 20.rpx,
left: 0.rpx,
child: returnIconButtomNew,
),
],
@@ -72,7 +87,7 @@ class BluetoothPage extends GetView {
mainAxisAlignment: MainAxisAlignment.center,
children: [
Text(
data['name']?.toString() ?? '未命名',
obsData['name']?.toString() ?? '未命名',
style: TextStyle(
color: Colors.white,
fontSize: 40.rpx,
@@ -83,9 +98,15 @@ class BluetoothPage extends GetView {
backgroundColor: Colors.transparent,
highlightColor: const Color(0xFF055466),
padding: EdgeInsets.only(left: 0),
onTap: () {
Get.toNamed("/editBedPage",
arguments: data);
onTap: () async {
var x = await Get.toNamed(
"/editBedPage",
arguments: obsData);
if (x != null) {
setState(() {
obsData.addAll(x); // 值更新后主动刷新页面
});
}
},
child: Container(
width: 42.rpx,
@@ -98,7 +119,7 @@ class BluetoothPage extends GetView {
),
const SizedBox(height: 4),
Text(data['mac']?.toString() ?? '未命名',
Text(obsData['mac']?.toString() ?? '未命名',
style: TextStyle(
color: Colors.white70, fontSize: 26.rpx)),
@@ -107,7 +128,7 @@ class BluetoothPage extends GetView {
// 蓝牙连接状态
Column(
children: [
data['blueToothStatus'] == 1
obsData['blueToothStatus'] == 1
? SvgPicture.asset(
'assets/img/icon/blue_fail.svg',
width: 68.rpx,
@@ -121,11 +142,11 @@ class BluetoothPage extends GetView {
SizedBox(height: 4),
//下面文字和颜色也根据上面变化
Text(
data['blueToothStatus'] == 1
obsData['blueToothStatus'] == 1
? '未连接'
: '已连接',
style: TextStyle(
color: data['blueToothStatus'] == 1
color: obsData['blueToothStatus'] == 1
? Color(0xFFFF7159)
: Color(0xFF6BFDAC),
fontSize: 26.rpx)),
@@ -143,21 +164,74 @@ class BluetoothPage extends GetView {
children: [
_buildMenuButton(
context, '详情', "/devicePeopleInfo",
arguments: data),
arguments: obsData),
_buildMenuButton(
context, '人员资料', "/peopleInfoPage",
arguments: data),
arguments: obsData,),
_buildMenuButton(
context, '房间选择', "/roomPickerPage",
arguments: data),
arguments: obsData),
_buildMenuButton(context, '设备校准', ""),
_buildMenuButton(context, '体征传感器', ""),
_buildMenuButton(context, 'WIFI配置', ""),
_buildMenuButton(
context, '睡眠习惯', "/sleepHabitPage"),
_buildMenuButton(
context, '分享设备', "/deviceSharePage"),
_buildMenuButton(context, '解绑', ""),
context, '分享设备', "/deviceSharePage",
arguments: obsData),
_buildMenuButton(
context,
obsData['bind_type'] == 1 ? '解绑' : '删除',
"",
onTap: () {
if (obsData['bind_type'] == 1) {
// 解绑弹窗
showUnbindConfirmDialog(
context: context,
title: "是否进行解绑?",
onConfirm: () async {
await deviceListController
.unbindDevice(obsData);
await deviceListController
.getDeviceList();
try {
WebviewTestController
webviewTestController =
Get.find();
webviewTestController
.web.jsbridge?.dart
.unBindDevice();
} catch (e) {
ef.log("[h5]通知列表更新报错:$e");
}
Get.toNamed("/mianPageBottomChange");
// 执行解绑逻辑
},
onCancel: () {
// 点击取消后的逻辑
},
);
} else if (obsData['bind_type'] == 2) {
// 删除弹窗
showDeleteDeviceConfirmDialog(
context: context,
title: "是否进行删除?",
onConfirm: () async {
await deviceListController
.unbindDevice(
obsData,
);
await deviceListController
.getDeviceList();
Get.toNamed("/mianPageBottomChange");
},
onCancel: () {
// 点击取消后的逻辑
},
);
}
},
),
],
),
),
@@ -168,8 +242,13 @@ class BluetoothPage extends GetView {
});
}
Widget _buildMenuButton(BuildContext context, String title, String? path,
{Map<dynamic, dynamic>? arguments}) {
Widget _buildMenuButton(
BuildContext context,
String title,
String? path, {
Map<dynamic, dynamic>? arguments,
VoidCallback? onTap,
}) {
return Padding(
padding: EdgeInsets.only(bottom: 19.rpx),
child: ClickableContainer(
@@ -177,7 +256,21 @@ class BluetoothPage extends GetView {
highlightColor: Color(0XFF055466),
padding: EdgeInsets.only(left: 0),
onTap: () {
if (path?.isNotEmpty == true) {
// if (path?.isNotEmpty == true) {
// if (arguments != null) {
// Get.toNamed(path!, arguments: arguments);
// } else {
// Get.toNamed(path!);
// }
// } else {
// TopSlideNotification.show(
// context,
// text: "功能开发中...",
// );
// }
if (onTap != null) {
onTap(); // 优先执行自定义逻辑
} else if (path?.isNotEmpty == true) {
if (arguments != null) {
Get.toNamed(path!, arguments: arguments);
} else {

View File

@@ -63,7 +63,7 @@ class BookInfoPage extends GetView<BookInfoController> {
),
// 左侧图标
Positioned(
left: 20.rpx,
left: 0.rpx,
child: returnIconButtomNew,
),
],

View File

@@ -62,7 +62,7 @@ class BookSuccessPage extends GetView {
),
// 左侧图标
Positioned(
left: 20.rpx,
left: 0.rpx,
child: returnIconButtomNew,
),
],

View File

@@ -157,6 +157,8 @@ void showBindDoubleDialog(
);
}
Future<void> showUnBindDeviceDialog(BuildContext context) async {}
Future<void> showHaveBindDialog(BuildContext context) async {
ThemeController themeController = Get.find();

View File

@@ -49,7 +49,7 @@ class DeletedAccountPage extends GetView {
),
// 左侧图标
Positioned(
left: 20.rpx,
left: 0.rpx,
child: returnIconButtomNew,
),
],

View File

@@ -20,6 +20,8 @@ import 'package:vbvs_app/model/api_response.dart';
import 'package:vbvs_app/pages/mh_page/component/mht_bind_dialog.dart';
import 'package:vbvs_app/pages/mh_page/device/controller/mht_bluetooth_controller.dart';
import 'package:vbvs_app/pages/mh_page/device/model/BlueToothDataModel.dart';
import 'package:vbvs_app/pages/mh_page/homepage/controller/mht_home_controller.dart';
import 'package:vbvs_app/pages/mh_page/test/WebviewTestModel.dart';
class DeviceComponentWidget extends StatefulWidget {
BlueToothDataModel bleDevice;
@@ -36,6 +38,7 @@ class DeviceComponentWidget extends StatefulWidget {
class _DeviceComponentWidgetState extends State<DeviceComponentWidget> {
ThemeController themeController = Get.find();
MHTBlueToothController blueteethBindController = Get.find();
MHTHomeController homeController = Get.find();
var lisObj;
@override
@@ -225,6 +228,40 @@ class _DeviceComponentWidgetState extends State<DeviceComponentWidget> {
TopSlideNotification.show(context,
text: response.msg!);
if (response.code == HttpStatusCodes.ok) {
try {
WebviewTestController webviewTestController =
Get.find();
webviewTestController.web.jsbridge?.dart
.unBindDevice();
} catch (e) {
ef.log("[h5]通知列表更新报错:$e");
}
homeController.getPersonList();
//请求绑定设备列表
// homeController.getSleepReport();
homeController.getDeviceNum().then((apiResponse) {
if (apiResponse.code != HttpStatusCodes.ok) {
TopSlideNotification.show(
Get.context!,
text: apiResponse.msg!,
textColor: themeController.currentColor.sc9,
);
}
});
homeController
.getDeviceList(group: 'room')
.then((apiResponse) {
if (apiResponse.code != HttpStatusCodes.ok) {
TopSlideNotification.show(
Get.context!,
text: apiResponse.msg!,
textColor: themeController.currentColor.sc9,
);
} else {
//请求睡眠报告
// deviceController.getSleepReport();
}
});
//更新设备绑定流程
Get.toNamed("/mHTwifiPage",
arguments: widget.bleDevice);
@@ -242,6 +279,7 @@ class _DeviceComponentWidgetState extends State<DeviceComponentWidget> {
textColor: themeController.currentColor.sc9,
);
}
blueteethBindController.resumeScanning();
},
onCancel: () {
print('用户点击了取消');
@@ -262,11 +300,12 @@ class _DeviceComponentWidgetState extends State<DeviceComponentWidget> {
DailyLogUtils.writeLog("连接异常: $e");
} finally {
// 确保在任何情况下都恢复扫描
if (blueteethBindController
.currentDeviceMac.value.isEmpty) {
// if (blueteethBindController
// .currentDeviceMac.value.isEmpty) {
// blueteethBindController.resumeScanning();
// }
blueteethBindController.resumeScanning();
}
}
},
colors: [stringToColor("1592AA"), stringToColor("006FA3")],
child: Container(
@@ -468,7 +507,7 @@ class _DeviceComponentWidgetState extends State<DeviceComponentWidget> {
blueteethBindController.blueConnectFlag.value = 2;
blueteethBindController.currentDevice = bledevice;
await Future.delayed(Duration(seconds: 2));
var read = bledevice.getresource('fff0/fff1');
await read!.characteristic.setNotifyValue(true);
var write = bledevice.getresource('fff0/fff2');

View File

@@ -25,9 +25,9 @@ class DeviceInfoWidget extends GetView {
child: Container(
// width: MediaQuery.sizeOf(context).width,
height: 381.rpx,
constraints: BoxConstraints(
minHeight: 140,
),
// constraints: BoxConstraints(
// minHeight: 140,
// ),
decoration: BoxDecoration(
color: Color(0xFF003058),
borderRadius: BorderRadius.circular(16.rpx),
@@ -37,9 +37,9 @@ class DeviceInfoWidget extends GetView {
child: Container(
// width: MediaQuery.sizeOf(context).width,
height: 381.rpx,
constraints: BoxConstraints(
minHeight: 106,
),
// constraints: BoxConstraints(
// minHeight: 106,
// ),
child: Container(
// width: MediaQuery.sizeOf(context).width,
@@ -96,88 +96,99 @@ class DeviceInfoWidget extends GetView {
mainAxisSize: MainAxisSize.max,
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Row(
mainAxisSize: MainAxisSize.max,
children: [
Expanded(
child: RichText(
text: TextSpan(
children: [
TextSpan(
text: '设备ID' +
(deviceListController.model
.deviceList[
index]['_id'] ??
''),
style: TextStyle(
fontFamily: 'Readex Pro',
color: Color(0xFFC8CBD2),
fontSize: 26.rpx,
letterSpacing: 0,
height: 1),
),
// TextSpan(
// text:
// ' (${deviceListController.model.deviceList[index]['status'] ?? ''})',
// style: TextStyle(
// fontFamily: 'Readex Pro',
// color: deviceListController
// .model
// .deviceList[
// index]
// ['status'] ==
// '在线'
// ? Color(
// 0xFF07C160) // 在线的颜色
// : Color(
// 0xFFEA7CA7), // 离线的颜色
// fontSize: 26.rpx,
// letterSpacing: 0,
// ),
// ),
],
),
maxLines: 1, // 限制显示一行
overflow: TextOverflow
.ellipsis, // 超出部分显示省略号
),
),
],
),
Align(
alignment: AlignmentDirectional(-1, 0),
child: Text(
'房间:' +
_buildInfoRow(
'设备ID',
deviceListController
.model.deviceList[index]["_id"] ??
'',
valueColor: (deviceListController
.model.deviceList[index]
["status"]?["status"]) ==
1
? Color(0xFF929699)
: null),
_buildInfoRow(
'房间',
deviceListController.model
.deviceList[index]["roomName"] ??
'',
valueColor: (deviceListController
.model.deviceList[index]
["status"]?["status"]) ==
1
? Color(0xFF929699)
: null),
_buildInfoRow(
'设备状态',
(deviceListController
.model.deviceList[index]
['roomName'] ??
''),
style: TextStyle(
fontFamily: 'Readex Pro',
color: Color(0xFFC8CBD2),
fontSize: 26.rpx,
letterSpacing: 0,
height: 1),
),
),
Align(
alignment: AlignmentDirectional(-1, 0),
child: Text(
'设备状态:' +
(deviceListController
.model
.deviceList[index]["status"]
?["status"]
?.toString() ??
''),
style: TextStyle(
fontFamily: 'Readex Pro',
color: Color(0xFFC8CBD2),
fontSize: 26.rpx,
letterSpacing: 0,
height: 1),
),
)
["status"]?["status"]) ==
1
? '在线'
: '离线',
valueColor: (deviceListController
.model.deviceList[index]
["status"]?["status"]) ==
1
? Color(0xFF6BFDAC)
: Color(0xFFFF7159)),
// Row(
// mainAxisSize: MainAxisSize.max,
// children: [
// Expanded(
// child: RichText(
// text: TextSpan(
// children: [
// TextSpan(
// text: '设备ID' +
// (deviceListController.model
// .deviceList[
// index]['_id'] ??
// ''),
// style: TextStyle(
// fontFamily: 'Readex Pro',
// color: Color(0xFFC8CBD2),
// fontSize: 26.rpx,
// letterSpacing: 0,
// height: 1),
// ),
// ],
// ),
// maxLines: 1, // 限制显示一行
// overflow: TextOverflow
// .ellipsis, // 超出部分显示省略号
// ),
// ),
// ],
// ),
// Align(
// alignment: AlignmentDirectional(-1, 0),
// child: Text(
// '房间:' +
// (deviceListController
// .model.deviceList[index]
// ['roomName'] ??
// ''),
// style: TextStyle(
// fontFamily: 'Readex Pro',
// color: Color(0xFFC8CBD2),
// fontSize: 26.rpx,
// letterSpacing: 0,
// height: 1),
// ),
// ),
// Align(
// alignment: AlignmentDirectional(-1, 0),
// child: Text(
// '设备状态:${(deviceListController.model.deviceList[index]["status"]?["status"]) == 1 ? '在线' : '离线'}',
// style: TextStyle(
// fontFamily: 'Readex Pro',
// color: Color(0xFFC8CBD2),
// fontSize: 26.rpx,
// letterSpacing: 0,
// height: 1),
// ),
// )
].divide(SizedBox(height: 36.rpx)),
),
),
@@ -186,7 +197,7 @@ class DeviceInfoWidget extends GetView {
Align(
alignment: AlignmentDirectional(0, 0),
child: Container(
width: MediaQuery.sizeOf(context).width * 0.21,
width: 150.rpx,
height: 90.rpx,
child: FFButtonWidget(
onPressed: () {
@@ -239,7 +250,9 @@ class DeviceInfoWidget extends GetView {
children: [
InkWell(
onTap: () async {
await Get.toNamed("/deviceSharePage");
await Get.toNamed("/deviceSharePage",
arguments: deviceListController
.model.deviceList[index]);
// if (device['type'] == 1) {
// globalController.model.deviceMain = device;
// await Get.toNamed("/deviceSharePage");
@@ -409,4 +422,25 @@ class DeviceInfoWidget extends GetView {
),
);
}
Widget _buildInfoRow(String label, String value, {Color? valueColor}) {
return Row(
mainAxisSize: MainAxisSize.min,
children: [
Text(
'$label ',
style:
TextStyle(color: Color(0XFF929699), fontSize: 26.rpx, height: 1),
),
Flexible(
child: Text(
value,
style: TextStyle(
color: valueColor ?? Colors.white, fontSize: 26.rpx, height: 1),
overflow: TextOverflow.ellipsis,
),
),
],
);
}
}

View File

@@ -601,6 +601,11 @@ class _MHTBlueteethDevicePageState extends State<MHTBlueteethDevicePage> {
Obx(() {
if (mhtBlueToothController
.model.deviceDataStatus!.isNotEmpty) {
final sortedList = mhtBlueToothController
.model.deviceDataStatus!
.toList()
..sort((a, b) => b.scanResult.rssi
.compareTo(a.scanResult.rssi));
return Expanded(
child: Container(
width: double.infinity,
@@ -608,8 +613,7 @@ class _MHTBlueteethDevicePageState extends State<MHTBlueteethDevicePage> {
child: Column(
mainAxisSize: MainAxisSize.max,
children: [
...mhtBlueToothController
.model.deviceDataStatus!
...sortedList
.map((device) {
return DeviceComponentWidget(
bleDevice: device,

View File

@@ -8,6 +8,7 @@ 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/DailyLogUtils.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';
@@ -66,10 +67,12 @@ class _MHTWifiPageState extends State<MHTWifiPage> {
blueteethBindController.updateAll();
}
@override
@override
void dispose() {
_isDisposed = true;
_cleanupResources();
_disconnectDevice();
super.dispose();
}
@@ -1097,4 +1100,14 @@ class _MHTWifiPageState extends State<MHTWifiPage> {
onFailure: (res) {},
);
}
void _disconnectDevice() async {
try {
THapp bledevice = THapp(device: widget.deviceInfo.scanResult.device);
await bledevice.disconnect();
DailyLogUtils.writeLog("关闭蓝牙连接成功");
} catch (e) {
DailyLogUtils.writeError("关闭蓝牙连接失败: $e");
}
}
}

View File

@@ -70,7 +70,7 @@ class _DeviceListPageState extends State<DeviceListPage> {
),
// 左侧图标
Positioned(
left: 20.rpx,
left: 0.rpx,
child: returnIconButtomNew,
),
],

View File

@@ -74,7 +74,7 @@ class DevicePeopleInfo extends GetView<PeopleInfoController> {
),
// 左侧图标
Positioned(
left: 20.rpx,
left: 0.rpx,
child: returnIconButtomNew,
),
],
@@ -146,13 +146,13 @@ class DevicePeopleInfo extends GetView<PeopleInfoController> {
...List.generate(controller.model.peopleList.length,
(index) {
final person = controller.model.peopleList[index];
String location_ = '';
if ("${data["bindMacB"]}".length > 6 &&
(person["direction"] == 1 ||
person["direction"] == 2)) {
location_ =
person["direction"] == 1 ? '左侧' : '右侧';
}
// String location_ = '';
// if ("${data["bindMacB"]}".length > 6 &&
// (person["direction"] == 1 ||
// person["direction"] == 2)) {
// location_ =
// person["direction"] == 1 ? '左侧' : '右侧';
// }
return ClickableContainer(
backgroundColor: Color(0xFF003058),
@@ -176,9 +176,8 @@ class DevicePeopleInfo extends GetView<PeopleInfoController> {
),
),
),
if (location_.isNotEmpty)
getInfoRow(context,
"姓名:${person["name"] ?? "-"}"),
getInfoRow(
context, "姓名:${person["name"] ?? "-"}"),
getInfoRow(context,
"性别:${person["gender"] == null ? "-" : (person["gender"] == 1 ? "" : "")}"),
getInfoRow(context,

View File

@@ -3,40 +3,31 @@ import 'package:flutter/material.dart';
import 'package:flutter/services.dart';
import 'package:flutterflow_ui/flutterflow_ui.dart';
import 'package:vbvs_app/common/color/appConstants.dart';
import 'package:vbvs_app/common/util/CommonVariables.dart';
import 'package:vbvs_app/common/color/app_uri_status.dart';
import 'package:vbvs_app/common/util/FitTool.dart';
import 'package:vbvs_app/common/util/MyUtils.dart';
import 'package:vbvs_app/component/NullDataComponentWidget.dart';
import 'package:vbvs_app/component/tool/ClickableContainer.dart';
import 'package:vbvs_app/controller/main_bottom/global_controller.dart';
import 'package:vbvs_app/component/tool/TopSlideNotification.dart';
import 'package:vbvs_app/controller/mh_controller/mhdevice_share_controller.dart';
import 'package:vbvs_app/pages/mh_page/EmptyMessageWidget.dart';
import 'package:vbvs_app/model/api_response.dart';
import 'package:vbvs_app/pages/mh_page/ShareUserWidget.dart';
class ShareDeviceWidget extends GetView<MHDeviceShareController> {
var data;
ShareDeviceWidget({super.key, required this.data});
final scaffoldKey = GlobalKey<ScaffoldState>();
final ScrollController scrollController = ScrollController();
// ShareDeviceWidget() {
// controller.initData();
// scrollController.addListener(() {
// if (scrollController.position.pixels ==
// scrollController.position.maxScrollExtent &&
// controller.model.hasMore) {
// controller.initData();
// controller.updateAll();
// }
// });
// }
final _formKey = GlobalKey<FormState>();
final _phoneController = TextEditingController();
@override
Widget build(BuildContext context) {
var deviceController = Get.find<GlobalController>();
controller.model.msg = "";
controller.model.show = 0;
controller.model.code = 0;
controller.model.type = 1;
controller.model.account = '';
return GestureDetector(
onTap: () => FocusScope.of(context).unfocus(),
child: Container(
@@ -69,7 +60,7 @@ class ShareDeviceWidget extends GetView<MHDeviceShareController> {
),
// 左侧图标
Positioned(
left: 20.rpx,
left: 0.rpx,
child: returnIconButtomNew,
),
],
@@ -122,7 +113,7 @@ class ShareDeviceWidget extends GetView<MHDeviceShareController> {
),
),
Text(
'设备ID${deviceController.model.deviceMain['mac']}',
'设备ID${data['mac']}',
style: TextStyle(
fontFamily: 'Readex Pro',
color: const Color(0xFF6BFDAC),
@@ -152,7 +143,7 @@ class ShareDeviceWidget extends GetView<MHDeviceShareController> {
child: TextFormField(
controller: _phoneController,
decoration: InputDecoration(
hintText: '请输入对方手机号',
hintText: '请输入对方手机号/邮箱号',
hintStyle: TextStyle(
fontFamily: 'Readex Pro',
color:
@@ -192,82 +183,12 @@ class ShareDeviceWidget extends GetView<MHDeviceShareController> {
color: Colors.white,
fontSize: 36.rpx,
),
validator: (value) {
if (value == null ||
value.isEmpty) {
return '手机号不能为空';
}
final phoneReg =
RegExp(r'^1[3-9]\d{9}$');
if (!phoneReg.hasMatch(value)) {
return '请输入正确的手机号';
}
return null;
},
onChanged: (value) {
controller.model.phone = value;
controller.model.account =
value;
},
),
)
// TextFormField(
// // controller: _model.textController,
// // focusNode: _model.textFieldFocusNode,
// // autofocus: true,
// obscureText: false,
// decoration: InputDecoration(
// hintText: '请输入对方手机号',
// hintStyle: FlutterFlowTheme.of(
// context)
// .labelMedium
// .override(
// fontFamily: 'Readex Pro',
// color:
// const Color(0xFFD2D2D2),
// fontSize: 13,
// letterSpacing: 0.0,
// ),
// enabledBorder:
// const UnderlineInputBorder(
// borderSide: BorderSide(
// color: Color(0xFFCCCCCC),
// width: 1),
// ),
// focusedBorder:
// const UnderlineInputBorder(
// borderSide: BorderSide(
// color: Color(0xFF929699),
// width: 0),
// ),
// errorBorder:
// const UnderlineInputBorder(
// borderSide: BorderSide(
// color: Colors.red, width: 1),
// ),
// focusedErrorBorder:
// const UnderlineInputBorder(
// borderSide: BorderSide(
// color: Colors.redAccent,
// width: 1.5),
// ),
// contentPadding:
// const EdgeInsets.only(
// left: 10, bottom: 5),
// ),
// style: FlutterFlowTheme.of(context)
// .bodyMedium
// .override(
// fontFamily: 'Readex Pro',
// fontSize: 13,
// letterSpacing: 0.0,
// ),
// onChanged: (value) {
// controller.model.phone = value;
// },
// // validator: _model.textControllerValidator
// // .asValidator(context),
// ),
),
)),
),
),
ClickableContainer(
@@ -292,119 +213,7 @@ class ShareDeviceWidget extends GetView<MHDeviceShareController> {
),
),
)),
// Container(
// width: MediaQuery.sizeOf(context).width,
// constraints: const BoxConstraints(
// minHeight: 46,
// ),
// decoration: BoxDecoration(
// borderRadius: BorderRadius.circular(0),
// ),
// child: Align(
// alignment:
// const AlignmentDirectional(0, 0),
// child: Obx(() {
// if (controller.model.show == 0) {
// return Container();
// } else {
// return GestureDetector(
// onTap: controller
// .model.msg!.isNotEmpty
// ? () {
// Clipboard.setData(
// ClipboardData(
// text: CommonVariables
// .shareText));
// showToast(
// "复制成功粘贴分享APP下载链接",
// color: color_success);
// }
// : null, // 不可点击时设置为 null
// child: RichText(
// textAlign: TextAlign
// .center, // 设置整个 RichText 内容居中
// text: TextSpan(
// children:
// controller.model.msg!
// .isNotEmpty
// ? [
// TextSpan(
// text: controller
// .model
// .msg! +
// "!", // 第一部分文本
// style: FlutterFlowTheme.of(
// context)
// .bodyMedium
// .override(
// fontFamily:
// 'Readex Pro',
// color: const Color(
// 0xFFE55E92), // 设置为粉红色
// fontSize:
// 26.rpx,
// letterSpacing:
// 0.0,
// ),
// ),
// const TextSpan(
// text:
// '\n', // 添加换行
// ),
// WidgetSpan(
// child: SizedBox(
// height: 20
// .rpx), // 添加间距
// ),
// TextSpan(
// text:
// '点击复制APP下载链接', // 第二部分文本
// style: FlutterFlowTheme.of(
// context)
// .bodyMedium
// .override(
// fontFamily:
// 'Readex Pro',
// color: const Color(
// 0xFF1890FF), // 设置为蓝色
// fontSize:
// 20.rpx,
// letterSpacing:
// 0.0,
// decoration:
// TextDecoration
// .underline, // 添加下划线
// ),
// ),
// ]
// : [
// TextSpan(
// text:
// '发送成功!', // 当 msg 为空时显示的文本
// style: FlutterFlowTheme.of(
// context)
// .bodyMedium
// .override(
// fontFamily:
// 'Readex Pro',
// color: const Color(
// 0xFF07C160), // 设置为绿色
// fontSize:
// 20.rpx,
// letterSpacing:
// 0.0,
// ),
// ),
// ],
// ),
// ),
// );
// }
// })),
// ),
Obx(
() => GestureDetector(
GestureDetector(
onTap: () {
// 当点击时,将 type 设置为 0允许控制
controller.model.type = 1;
@@ -417,8 +226,7 @@ class ShareDeviceWidget extends GetView<MHDeviceShareController> {
minHeight: 46,
),
decoration: BoxDecoration(
borderRadius:
BorderRadius.circular(0),
borderRadius: BorderRadius.circular(0),
),
child: Row(
mainAxisSize: MainAxisSize.max,
@@ -426,7 +234,7 @@ class ShareDeviceWidget extends GetView<MHDeviceShareController> {
MainAxisAlignment.spaceBetween,
children: [
Text(
'允许对方控制该设备',
'允许对方控制该设备'.tr,
style: TextStyle(
fontFamily: 'Readex Pro',
color: Colors.white,
@@ -434,50 +242,190 @@ class ShareDeviceWidget extends GetView<MHDeviceShareController> {
letterSpacing: 0.0,
),
),
Theme(
data:
Theme.of(context).copyWith(
unselectedWidgetColor: Color(
0xFFC8CBD2), // 改变未选中状态边框颜色
Obx(() {
double h = 33.rpx;
bool check =
controller.model.type == 1;
return Container(
height: 33.rpx,
child: AspectRatio(
aspectRatio: 1,
child: Center(
child: Container(
height: h,
width: h,
decoration: BoxDecoration(
borderRadius:
BorderRadius.circular(
h / 2),
border: Border.all(
width: check ? 1 : 0.5,
color:
Color(0xFFC8CBD2),
),
child: Radio<int>(
value: 1,
groupValue:
controller.model.type,
onChanged: (value) {
controller.model.type =
value!;
controller.updateAll();
},
activeColor:
const Color(0xFF6BFDAC),
materialTapTargetSize:
MaterialTapTargetSize
.shrinkWrap, // 减少内边距
visualDensity: VisualDensity(
horizontal: -4,
vertical: -4), // 缩小视觉密度
))
),
child: check
? Center(
child: ClipOval(
child: Container(
width: h * 0.6,
height: h * 0.6,
color: const Color(
0xFF6BFDAC),
),
),
)
: null,
),
),
),
);
}),
],
),
),
),
),
Obx(
() => GestureDetector(
// Obx(
// () => GestureDetector(
// onTap: () {
// controller.model.type = 2;
// controller.updateAll();
// },
// child: Container(
// width: MediaQuery.sizeOf(context).width,
// constraints: const BoxConstraints(
// minHeight: 46,
// ),
// decoration: BoxDecoration(
// borderRadius:
// BorderRadius.circular(0),
// ),
// child: Row(
// mainAxisSize: MainAxisSize.max,
// mainAxisAlignment:
// MainAxisAlignment.spaceBetween,
// children: [
// Text(
// '仅允许对方查看该设备'.tr,
// style: TextStyle(
// fontFamily: 'Readex Pro',
// color: Colors.white,
// fontSize: 26.rpx,
// letterSpacing: 0.0,
// ),
// ),
// // Theme(
// // data:
// // Theme.of(context).copyWith(
// // unselectedWidgetColor: Color(
// // 0xFFC8CBD2), // 改变未选中状态边框颜色
// // ),
// // child: Radio<int>(
// // value: 2,
// // groupValue:
// // controller.model.type,
// // onChanged: (value) {
// // controller.model.type =
// // value!;
// // controller.updateAll();
// // },
// // activeColor:
// // const Color(0xFF6BFDAC),
// // materialTapTargetSize:
// // MaterialTapTargetSize
// // .shrinkWrap, // 减少内边距
// // visualDensity: VisualDensity(
// // horizontal: -4,
// // vertical: -4), // 缩小视觉密度
// // ))
// ClipOval(
// child: Container(
// height:
// MediaQuery.sizeOf(context)
// .height *
// 0.0449,
// child: AspectRatio(
// aspectRatio: 1,
// child: Center(
// child: LayoutBuilder(
// builder: (context,
// constraints) {
// double h =
// MediaQuery.sizeOf(
// context)
// .height *
// 0.0326;
// bool check = controller
// .model.type ==
// 2;
// if (check) {
// return Container(
// height: h,
// width: h,
// decoration:
// BoxDecoration(
// borderRadius:
// BorderRadius
// .circular(
// h / 2),
// border: Border.all(
// width: 1,
// color: Color(
// 0xFF6BFDAC)),
// ),
// child: Center(
// child: ClipOval(
// child: Container(
// width:
// h * 0.6,
// height:
// h * 0.6,
// color: Color(
// 0xFF6BFDAC)),
// ),
// ),
// );
// } else {
// return Container(
// height: h,
// width: h,
// decoration:
// BoxDecoration(
// borderRadius:
// BorderRadius
// .circular(
// h / 2),
// border: Border.all(
// width: 0.5,
// color: Colors
// .white),
// ),
// );
// }
// },
// ),
// ),
// ),
// ),
// ),
// ],
// ),
// ),
// ),
// ),
GestureDetector(
onTap: () {
// 当点击时,将 type 设置为 1仅允许查看
controller.model.type = 2;
controller.updateAll();
},
child: Container(
width: MediaQuery.sizeOf(context).width,
constraints: const BoxConstraints(
minHeight: 46,
),
constraints:
const BoxConstraints(minHeight: 46),
decoration: BoxDecoration(
borderRadius:
BorderRadius.circular(0),
borderRadius: BorderRadius.circular(0),
),
child: Row(
mainAxisSize: MainAxisSize.max,
@@ -485,7 +433,7 @@ class ShareDeviceWidget extends GetView<MHDeviceShareController> {
MainAxisAlignment.spaceBetween,
children: [
Text(
'仅允许对方查看该设备',
'仅允许对方查看该设备'.tr,
style: TextStyle(
fontFamily: 'Readex Pro',
color: Colors.white,
@@ -493,35 +441,52 @@ class ShareDeviceWidget extends GetView<MHDeviceShareController> {
letterSpacing: 0.0,
),
),
Theme(
data:
Theme.of(context).copyWith(
unselectedWidgetColor: Color(
0xFFC8CBD2), // 改变未选中状态边框颜色
// ✅ 只包住响应式控件部分
Obx(() {
double h = 33.rpx;
bool check =
controller.model.type == 2;
return Container(
height: 33.rpx,
child: AspectRatio(
aspectRatio: 1,
child: Center(
child: Container(
height: h,
width: h,
decoration: BoxDecoration(
borderRadius:
BorderRadius.circular(
h / 2),
border: Border.all(
width: check ? 1 : 0.5,
color:
Color(0xFFC8CBD2),
),
child: Radio<int>(
value: 2,
groupValue:
controller.model.type,
onChanged: (value) {
controller.model.type =
value!;
controller.updateAll();
},
activeColor:
const Color(0xFF6BFDAC),
materialTapTargetSize:
MaterialTapTargetSize
.shrinkWrap, // 减少内边距
visualDensity: VisualDensity(
horizontal: -4,
vertical: -4), // 缩小视觉密度
))
),
child: check
? Center(
child: ClipOval(
child: Container(
width: h * 0.6,
height: h * 0.6,
color: const Color(
0xFF6BFDAC),
),
),
)
: null,
),
),
),
);
}),
],
),
),
),
),
Align(
alignment: const AlignmentDirectional(0, 0),
child: Padding(
@@ -534,18 +499,21 @@ class ShareDeviceWidget extends GetView<MHDeviceShareController> {
child: FFButtonWidget(
onPressed: () async {
//todo 1:验证用户是否存在 2发送邀请
// controller.model.show = 1;
// String msg =
// await controller.sendInvite(
// controller.model.phone,
// deviceController
// .model.deviceMain['mac']);
// if (msg != null && msg.isNotEmpty) {
// controller.model.msg = msg;
// }
// controller.updateAll();
ApiResponse apiResponse =
await controller
.shareDevice(data['mac']);
if (apiResponse.code ==
HttpStatusCodes.ok) {
TopSlideNotification.show(context,
text: apiResponse.msg!);
} else {
TopSlideNotification.show(context,
text: apiResponse.msg!,
textColor: themeController
.currentColor.sc9);
}
},
text: '发送邀请',
text: '发送邀请'.tr,
options: FFButtonOptions(
height: 60.rpx,
padding:
@@ -588,7 +556,7 @@ class ShareDeviceWidget extends GetView<MHDeviceShareController> {
padding: const EdgeInsetsDirectional
.fromSTEB(14, 0, 0, 16),
child: Text(
'已分享用户',
'已分享用户'.tr,
style: TextStyle(
fontFamily: 'Readex Pro',
color: Colors.white,
@@ -617,10 +585,11 @@ class ShareDeviceWidget extends GetView<MHDeviceShareController> {
// .bodyMedium, // 可根据需要自定义样式
// ),
// );
return EmptyMessageWidget(
imagePath:
"assets/images/emptyUser.png",
);
return NullDataWidget();
// EmptyMessageWidget(
// imagePath:
// "assets/images/emptyUser.png",
// );
}
// 否则显示正常的 ListView

View File

@@ -2,6 +2,7 @@ import 'package:ef/ef.dart';
import 'package:flutter/material.dart';
import 'package:flutter_city_picker/listener/picker_listener.dart';
import 'package:flutter_city_picker/model/address.dart';
import 'package:flutter_svg/svg.dart';
import 'package:flutterflow_ui/flutterflow_ui.dart';
import 'package:vbvs_app/common/color/appConstants.dart';
@@ -79,7 +80,7 @@ class EditAddressPage extends GetView<AddressController>
),
// 左侧图标
Positioned(
left: 20.rpx,
left: 0.rpx,
child: returnIconButtomNew,
),
],
@@ -739,6 +740,158 @@ class EditAddressPage extends GetView<AddressController>
],
),
),
// Expanded(
// child: InkWell(
// onTap: () {
// CityPicker.show(
// context:
// context,
// cityPickerListener:
// this,
// // 在大屏/Web 上最大宽度为 600px
// // 移除内边距
// );
// },
// child: Container(
// width: 100,
// height: 100,
// decoration:
// BoxDecoration(
// color: const Color(
// 0xFFF3F5F6),
// borderRadius:
// BorderRadius
// .circular(
// 8),
// ),
// alignment:
// Alignment
// .center,
// child: Obx(() {
// return TextFormField(
// enabled:
// false,
// controller: controller.onReDraw(
// TextEditingController(
// text:
// controller.model.all_address),
// (val) {
// val.text =
// controller.model.all_address ??
// "";
// }),
// // autofocus: true,
// obscureText:
// false,
// maxLines: 1,
// textAlignVertical:
// TextAlignVertical
// .center, // 垂直居中
// decoration: InputDecoration(
// contentPadding: EdgeInsets.symmetric(
// vertical:
// 25.rpx,
// horizontal:
// 26.rpx,
// ),
// labelStyle: TextStyle(
// fontFamily:
// 'Readex Pro',
// letterSpacing:
// 0,
// ),
// hintStyle: TextStyle(
// fontFamily:
// 'Readex Pro',
// letterSpacing:
// 0,
// ),
// enabledBorder: UnderlineInputBorder(
// borderSide:
// const BorderSide(
// color:
// Color(0x00000000),
// width:
// 2,
// ),
// borderRadius:
// BorderRadius.circular(8),
// ),
// disabledBorder: UnderlineInputBorder(
// borderSide:
// const BorderSide(
// color:
// Color(0x00000000),
// width:
// 0,
// ),
// borderRadius:
// BorderRadius.circular(8),
// ),
// focusedBorder: UnderlineInputBorder(
// borderSide:
// const BorderSide(
// color:
// Color(0x00000000),
// width:
// 2,
// ),
// borderRadius:
// BorderRadius.circular(8),
// ),
// errorBorder: UnderlineInputBorder(
// borderSide:
// const BorderSide(
// color:
// Color(0x00000000),
// width:
// 2,
// ),
// borderRadius:
// BorderRadius.circular(8),
// ),
// focusedErrorBorder: UnderlineInputBorder(
// borderSide:
// const BorderSide(
// color:
// Color(0x00000000),
// width:
// 2,
// ),
// borderRadius:
// BorderRadius.circular(8),
// ),
// suffixIcon: Transform.rotate(
// angle:
// 1.5708, // 90 度相当于 pi / 2 弧度
// child:
// Icon(
// Icons.arrow_forward_ios,
// color:
// Colors.black,
// size:
// 26.rpx,
// ),
// )),
// style:
// TextStyle(
// fontFamily:
// 'Readex Pro',
// letterSpacing:
// 0,
// color: Color(
// 0xFF333333),
// fontSize:
// 26.rpx,
// overflow:
// TextOverflow
// .ellipsis,
// ),
// );
// })),
// ),
// ),
Expanded(
child: InkWell(
onTap: () {
@@ -747,8 +900,6 @@ class EditAddressPage extends GetView<AddressController>
context,
cityPickerListener:
this,
// 在大屏/Web 上最大宽度为 600px
// 移除内边距
);
},
child: Container(
@@ -767,128 +918,53 @@ class EditAddressPage extends GetView<AddressController>
Alignment
.center,
child: Obx(() {
return TextFormField(
enabled:
false,
controller: controller.onReDraw(
TextEditingController(
text:
controller.model.all_address),
(val) {
val.text =
controller.model.all_address ??
"";
}),
// autofocus: true,
obscureText:
false,
textAlignVertical:
TextAlignVertical
.center, // 垂直居中
decoration: InputDecoration(
contentPadding: EdgeInsets.symmetric(
vertical:
25.rpx,
horizontal:
26.rpx,
),
labelStyle: TextStyle(
fontFamily:
'Readex Pro',
letterSpacing:
0,
),
hintStyle: TextStyle(
fontFamily:
'Readex Pro',
letterSpacing:
0,
),
enabledBorder: UnderlineInputBorder(
borderSide:
const BorderSide(
color:
Color(0x00000000),
width:
2,
),
borderRadius:
BorderRadius.circular(8),
),
disabledBorder: UnderlineInputBorder(
borderSide:
const BorderSide(
color:
Color(0x00000000),
width:
0,
),
borderRadius:
BorderRadius.circular(8),
),
focusedBorder: UnderlineInputBorder(
borderSide:
const BorderSide(
color:
Color(0x00000000),
width:
2,
),
borderRadius:
BorderRadius.circular(8),
),
errorBorder: UnderlineInputBorder(
borderSide:
const BorderSide(
color:
Color(0x00000000),
width:
2,
),
borderRadius:
BorderRadius.circular(8),
),
focusedErrorBorder: UnderlineInputBorder(
borderSide:
const BorderSide(
color:
Color(0x00000000),
width:
2,
),
borderRadius:
BorderRadius.circular(8),
),
suffixIcon: Transform.rotate(
angle:
1.5708, // 90 度相当于 pi / 2 弧度
return Row(
children: [
Expanded(
child:
Icon(
Icons.arrow_forward_ios,
color:
Colors.black,
size:
26.rpx,
),
)),
Padding(
padding: EdgeInsets.only(
left: 27
.rpx,
right:
10.rpx),
child:
Text(
controller.model.all_address ??
'',
maxLines:
1,
overflow:
TextOverflow.ellipsis,
style:
TextStyle(
fontFamily:
'Readex Pro',
letterSpacing:
0,
color: Color(
0xFF333333),
color:
Color(0xFF333333),
fontSize:
26.rpx,
overflow:
TextOverflow
.ellipsis,
),
),
)),
Padding(
padding:
EdgeInsets.only(right: 27.rpx),
child: Container(
height: 30.rpx,
width: 30.rpx,
child: SvgPicture.asset(
'assets/img/icon/expand_more.svg',
color: Colors.black,
)))
],
);
})),
}),
),
),
)
].divide(const SizedBox(
width: 15)),
),

View File

@@ -6,6 +6,9 @@ import 'package:vbvs_app/common/util/MyUtils.dart';
import 'package:vbvs_app/common/util/requestWithLog.dart';
import 'package:vbvs_app/component/tool/CustomCard.dart';
import 'package:vbvs_app/component/tool/TopSlideNotification.dart';
import 'package:vbvs_app/controller/mh_controller/device_list_controller.dart';
import 'package:vbvs_app/pages/mh_page/bluetooth.dart';
import 'package:vbvs_app/pages/mh_page/test/WebviewTestModel.dart';
class EditBedPage extends StatefulWidget {
final Map data;
@@ -19,6 +22,7 @@ BoxConstraints? bodysize;
class _EditBedPageState extends State<EditBedPage> {
late Map<String, dynamic> editedData;
late TextEditingController _nameController; //名称文本输入框
DeviceListController deviceListController = Get.find();
@override
void initState() {
super.initState();
@@ -71,7 +75,7 @@ class _EditBedPageState extends State<EditBedPage> {
),
// 左侧图标
Positioned(
left: 20.rpx,
left: 0.rpx,
child: returnIconButtomNew,
),
],
@@ -117,7 +121,7 @@ class _EditBedPageState extends State<EditBedPage> {
editedData['name'] = val;
},
textAlign: TextAlign.center,
initialValue: widget.data['name'],
decoration: InputDecoration(
hintText: "请输入床的名称",
contentPadding:
@@ -205,6 +209,16 @@ class _EditBedPageState extends State<EditBedPage> {
onSuccess: (res) {
TopSlideNotification.show(context,
text: "修改名称成功".tr);
deviceListController.getDeviceList();
try {
WebviewTestController
webviewTestController = Get.find();
webviewTestController.web.jsbridge?.dart
.alterDevice();
} catch (e) {
ef.log("[h5]通知列表更新错误:$e");
}
Get.back(result: editedData);
},
);
},
@@ -222,7 +236,7 @@ class _EditBedPageState extends State<EditBedPage> {
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(6),
),
child: Text("完成",
child: Text("完成".tr,
style: TextStyle(
color: const Color(0xFF003058),
fontSize: 26.rpx)),

View File

@@ -11,6 +11,7 @@ import 'package:vbvs_app/common/util/FitTool.dart';
import 'package:vbvs_app/common/util/MyUtils.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/mh_controller/experience_store_list_page.dart';
import 'package:vbvs_app/controller/weather/weather_controller.dart';
import 'package:vbvs_app/pages/mh_page/Empty.dart';
@@ -94,7 +95,7 @@ class _ExperienceStorePageState extends State<ExperienceStorePage> {
),
// 左侧图标
Positioned(
left: 20.rpx,
left: 0.rpx,
child: returnIconButtomNew,
),
Positioned(
@@ -104,7 +105,9 @@ class _ExperienceStorePageState extends State<ExperienceStorePage> {
highlightColor: Color(0xFF055466),
padding: EdgeInsets.only(left: 0),
onTap: () {
Get.toNamed("/myExperiencePage");
TopSlideNotification.show(context,
text: "待开发功能".tr);
// Get.toNamed("/myExperiencePage");
},
child: SvgPicture.asset(
'assets/img/icon/history_store.svg',

View File

@@ -2,135 +2,147 @@ 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/FitTool.dart';
import 'package:vbvs_app/common/util/MyUtils.dart';
import 'package:vbvs_app/controller/user_info_controller.dart';
class HelpArticle extends StatelessWidget {
Map article;
class HelpArticle extends StatefulWidget {
final Map article;
HelpArticle({super.key, required this.article});
// get articleController => Get.find<ArticleController>();
get userInfoController => Get.find<UserInfoController>();
@override
State<HelpArticle> createState() => _HelpArticleState();
}
var isLike = 0.obs;
class _HelpArticleState extends State<HelpArticle> {
bool isLoading = true;
@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(),
return 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: AppColors.bg_color,
backgroundColor: Colors.transparent,
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(
title: SizedBox(
width: double.infinity,
height: 180.rpx,
child: Stack(
alignment: Alignment.center,
children: [
// 中间居中的标题
Text(
'问题与帮助',
textAlign: TextAlign.center,
style: TextStyle(
color: Colors.white,
// color: AppColors.bg_color,
// image: DecorationImage(
// image: AssetImage("assets/images/background.png$test"),
// fit: BoxFit.cover,
// ),
fontSize: 30.rpx,
),
),
// 左侧图标
Positioned(
left: 0.rpx,
child: returnIconButtomNew,
),
],
),
),
actions: [],
centerTitle: false,
),
body: Padding(
padding: EdgeInsets.only(left: 30.rpx, right: 30.rpx),
child: Column(
children: [
Expanded(
child: Container(
// child: WebViewWidget(
// controller: WebViewController()
// ..setJavaScriptMode(JavaScriptMode.unrestricted)
// ..loadHtmlString(html),
// ),
child: InAppWebView(
initialData:
InAppWebViewInitialData(data: html, encoding: ""),
Container(
padding: EdgeInsets.only(
left: 26.rpx, top: 53.rpx, bottom: 15.rpx),
alignment: Alignment.centerLeft,
child: Text(
widget.article['title'],
style: TextStyle(
color: Colors.white,
fontSize: 30.rpx,
),
),
),
Divider(
color: Color(0XFF929699),
thickness: 0.5.rpx,
),
Expanded(
child: Stack(
children: [
InAppWebView(
initialData: InAppWebViewInitialData(
data: wrapHtml(widget.article['content']),
),
initialSettings: InAppWebViewSettings(
transparentBackground: true,
),
onLoadStop: (controller, url) {
setState(() {
isLoading = false;
});
},
),
if (isLoading)
Container(
color: const Color(0xFF042C46),
alignment: Alignment.center,
child: const CircularProgressIndicator(
valueColor:
AlwaysStoppedAnimation<Color>(Colors.white),
),
),
],
),
),
],
),
),
),
);
)));
}
String wrapHtml(String htmlContent) {
return """
<!DOCTYPE html>
<html lang="zh">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<style>
body {
color: #929699;
background-color: transparent;
font-family: sans-serif;
padding: 0;
font-size: 18;
}
p, li {
line-height: 1.6;
}
ol {
padding-left: 20px;
}
strong {
color: #6BFDAC;
}
</style>
</head>
<body>
$htmlContent
</body>
</html>
""";
}
}

View File

@@ -2,9 +2,12 @@ import 'package:ef/ef.dart';
import 'package:flutter/material.dart';
import 'package:flutterflow_ui/flutterflow_ui.dart';
import 'package:vbvs_app/common/color/appConstants.dart';
import 'package:vbvs_app/common/util/DailyLogUtils.dart';
import 'package:vbvs_app/common/util/FitTool.dart';
import 'package:vbvs_app/component/tool/CustomCard.dart';
import 'package:vbvs_app/component/tool/TopSlideNotification.dart';
import 'package:vbvs_app/pages/main_bottom/component/main_page_b_bottom_change.dart';
import 'package:vbvs_app/pages/mh_page/test/WebviewTestModel.dart';
class HomeDeviceStausWidget extends StatefulWidget {
final deviceStatus;
@@ -72,9 +75,22 @@ class _HomeDeviceStausWidgetState extends State<HomeDeviceStausWidget> {
CustomCard(
gradientDirection: GradientDirection.vertical,
borderRadius: 10.rpx,
onTap: () {
// 点击回调逻辑放这里
TopSlideNotification.show(context,text: "功能开发中...".tr);
onTap: () async {
try {
var device = widget.deviceStatus;
WebviewTestController webviewTestController = Get.find();
var future = webviewTestController.web.jsbridge?.dart
.appToHtmlDevice(device);
Future.delayed(Duration(seconds: 5), () {
return;
});
await future;
await webviewTestController.web.jsbridge?.dart
.pageActive();
MainPageBBottomChange.jumpTo(2);
} catch (e) {
DailyLogUtils.writeError("发生异常: $e");
}
},
colors:
AppConstants().mhtButtongradientColors, // 你原本没有渐变,单色即可

View File

@@ -39,6 +39,7 @@ class MHTHomeController extends GetControllerEx<MHTHomeModel> {
RxInt bindDeviceNum = 0.obs; //设备数量
RxMap deviceList = {}.obs; //设备列表
RxList deviceListForWeb = [].obs; //h5设备列表
RxMap<String, List<dynamic>> sleepReportData =
<String, List<dynamic>>{}.obs; //睡眠报告
RxList personnelList = [].obs; //人员信息列表
@@ -49,12 +50,13 @@ class MHTHomeController extends GetControllerEx<MHTHomeModel> {
var sleepDays = [].obs;
var homeSleepDays = [].obs;
var selectedDayIndex = (6).obs;
var selectDevcie = ''.obs;
var selectPerson = {}.obs;
bool initDeviceFlag = false;
Future<ApiResponse> getDeviceNum() async {
try {
ApiResponse apiResponse = ApiResponse(code: -1, msg: "设备.设备列表请求失败".tr);
@@ -159,6 +161,68 @@ class MHTHomeController extends GetControllerEx<MHTHomeModel> {
return ApiResponse(code: -1, msg: "未知错误".tr); // Default return statement
}
Future<ApiResponse> getDeviceListForWeb(
{String? key, String? group, int? bindType}) async {
try {
ApiResponse apiResponse = ApiResponse(code: -1, msg: "设备.设备列表请求失败".tr);
String serviceAddress = ServiceConstant.service_address;
String serviceName = ServiceConstant.server_service;
String serviceApi = ServiceConstant.device_list;
// 初始URL
String queryUrl = "$serviceAddress$serviceName$serviceApi";
// 用Map统一管理query参数
Map<String, String> queryParams = {};
if (key != null && key.isNotEmpty) {
queryParams['key'] = key;
}
if (group != null && group.isNotEmpty) {
queryParams['group'] = group;
}
if (bindType != null) {
queryParams['bindType'] = bindType.toString();
}
String? language = "";
if (languageController.selectLanguage != null) {
language = languageController.selectLanguage.value!.language_code;
}
if (language != null && language.isNotEmpty) {
queryParams['lang'] = language;
}
// 拼接完整URL
if (queryParams.isNotEmpty) {
queryUrl += '?' + Uri(queryParameters: queryParams).query;
}
var response = await EasyDartModule.dio.get(queryUrl);
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);
if (res.code == HttpStatusCodes.ok) {
deviceListForWeb.value = res.data!;
updateAll();
return res;
}
} else {
return ApiResponse(code: -1, msg: "服务器.失败".tr);
}
return apiResponse;
} catch (e) {
EasyDartModule.logger.info("设备请求列表: $e");
DailyLogUtils.writeLog("设备请求列表: $e");
}
return ApiResponse(code: -1, msg: "未知错误".tr); // Default return statement
}
Future<ApiResponse> deleteDevice(Map<String, dynamic> device) async {
try {
ApiResponse apiResponse = ApiResponse(code: -1, msg: "请求失败".tr);
@@ -428,6 +492,7 @@ class MHTHomeController extends GetControllerEx<MHTHomeModel> {
},
);
}
Future<void> getHomeSleeps(String? mac) async {
String serviceAddress = ServiceConstant.service_address;
String serviceName = ServiceConstant.server_service;
@@ -495,4 +560,79 @@ class MHTHomeController extends GetControllerEx<MHTHomeModel> {
},
);
}
//开启定时器
void startTimer(args) {
var tmp = args[0];
String serviceAddress = ServiceConstant.service_address;
String serviceName = ServiceConstant.server_service;
String serviceApi = ServiceConstant.user_setting;
String type = "control_${tmp['mac']}";
String queryUrl = "${serviceAddress}${serviceName}${serviceApi}";
var data = {
"type": type,
"duration": tmp['duration'],
"mac": tmp['mac'],
"time": tmp['startTime'],
};
requestWithLog(
logTitle: "更新控制倒计时",
method: MyHttpMethod.put,
queryUrl: queryUrl,
data: data,
onSuccess: (res) {});
}
//关闭定时器
void cancelTimer(args) {
var tmp = args[0];
String serviceAddress = ServiceConstant.service_address;
String serviceName = ServiceConstant.server_service;
String serviceApi = ServiceConstant.user_setting;
String type = "control_${tmp['mac']}";
String queryUrl = "${serviceAddress}${serviceName}${serviceApi}";
var data = {
"type": type,
"duration": 0,
"mac": tmp['mac'],
"time": tmp['startTime'],
};
requestWithLog(
logTitle: "查询控制倒计时",
method: MyHttpMethod.put,
queryUrl: queryUrl,
data: data,
onSuccess: (res) {});
}
//恢复
restoreTimer(args) async {
var data = {};
try {
var tmp = args[0];
String serviceAddress = ServiceConstant.service_address;
String serviceName = ServiceConstant.server_service;
String serviceApi = ServiceConstant.user_setting;
String type = "control_${tmp}";
String queryUrl =
"${serviceAddress}${serviceName}${serviceApi}?type=$type";
await requestWithLog(
logTitle: "查询控制倒计时",
method: MyHttpMethod.get,
queryUrl: queryUrl,
onSuccess: (res) {
if (res.data != null) {
data = res.data;
}
},
onFailure: (res) {
data = {};
},
);
} catch (e) {
ef.log("$e");
}
return data;
}
}

View File

@@ -273,6 +273,7 @@ class _MhtSleepReportPageState extends State<MhtSleepReportPage> {
'backgroundImg':
'assets/images/new_background.png',
'arrow': false,
'noBackImg':true,
},
),
);

View File

@@ -115,6 +115,39 @@ class _NewHomePageState extends State<NewHomePage> {
// deviceController.getSleepReport();
}
});
if (userInfoController.model.login == 1) {
//查询人员信息列表
deviceController.getPersonList();
//请求绑定设备列表
// homeController.getSleepReport();
deviceController.getDeviceNum().then((apiResponse) {
if (apiResponse.code != HttpStatusCodes.ok) {
TopSlideNotification.show(
Get.context!,
text: apiResponse.msg!,
textColor: themeController.currentColor.sc9,
);
}
});
deviceController.getDeviceList(group: 'room').then((apiResponse) {
if (apiResponse.code != HttpStatusCodes.ok) {
TopSlideNotification.show(
Get.context!,
text: apiResponse.msg!,
textColor: themeController.currentColor.sc9,
);
} else {
//请求睡眠报告
// deviceController.getSleepReport();
}
});
}
WidgetsBinding.instance.addPostFrameCallback((_) {
if (homeController.homeSleepDays.value.isNotEmpty) {
homeController.selectedDayIndex.value =
homeController.homeSleepDays.value.length - 1;
}
});
int login = userInfoController.model.login!;
return GestureDetector(
onTap: () => FocusScope.of(context).unfocus(),
@@ -138,7 +171,14 @@ class _NewHomePageState extends State<NewHomePage> {
children: [
// 左侧头像
Obx(() {
return userInfo(userInfoController.model.login);
return InkWell(
onTap: () {
if (userInfoController.model.login == 0) {
Get.toNamed("/loginPage");
}
},
child: userInfo(userInfoController.model.login),
);
}),
const Spacer(), // 左右分隔
FloatingSvgIcon(
@@ -332,7 +372,7 @@ class _NewHomePageState extends State<NewHomePage> {
MediaQuery.sizeOf(context).height *
0.184,
constraints: BoxConstraints(
minHeight: 350.rpx,
minHeight: 354.rpx,
),
decoration: BoxDecoration(
color: stringToColor("#003058"),
@@ -345,8 +385,8 @@ class _NewHomePageState extends State<NewHomePage> {
Padding(
padding:
EdgeInsetsDirectional.fromSTEB(
30.rpx,
16.rpx,
20.rpx,
20.rpx,
16.rpx,
25.rpx),
child: Container(
@@ -786,10 +826,15 @@ class _NewHomePageState extends State<NewHomePage> {
child: Row(
mainAxisSize: MainAxisSize.min,
children: [
Icon(
Icons.add,
size: 60.rpx,
color: stringToColor("#85F5FF"),
// Icon(
// Icons.add,
// size: 60.rpx,
// color: stringToColor("#85F5FF"),
// ),
SvgPicture.asset(
'assets/images/icon/add.svg',
width: 42.rpx,
height: 42.rpx,
),
SizedBox(width: 20.rpx),
Text(

View File

@@ -64,7 +64,7 @@ class IssueListPage extends GetView<IssueListController> {
),
// 左侧图标
Positioned(
left: 20.rpx,
left: 0.rpx,
child: returnIconButtomNew,
),
],

View File

@@ -27,12 +27,12 @@ class IssuePreviewWidget extends GetView<IssuePreviewInfoController> {
// await Future.delayed(Duration(milliseconds: 100));
// issueListController.model.selectedIndex = -1;
// issueListController.updateAll();
// var article = issueListController.model.issueList![index];
// Get.toNamed("/helpArticle", arguments: article);
TopSlideNotification.show(
context,
text: "功能开发中...",
);
var article = issueListController.model.issueList![index];
Get.toNamed("/helpArticle", arguments: article);
// TopSlideNotification.show(
// context,
// text: "功能开发中...",
// );
},
child: Obx(() {
return Container(

View File

@@ -0,0 +1,262 @@
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/appFontsize.dart';
import 'package:vbvs_app/common/color/app_uri_status.dart';
import 'package:vbvs_app/common/util/FitTool.dart';
import 'package:vbvs_app/common/util/MyUtils.dart';
import 'package:vbvs_app/component/tool/TopSlideNotification.dart';
import 'package:vbvs_app/controller/mh_controller/message_controller.dart';
import 'package:vbvs_app/controller/mh_controller/mhdevice_share_controller.dart';
import 'package:vbvs_app/model/api_response.dart';
class MessageDetailPage extends StatefulWidget {
final data;
const MessageDetailPage({super.key, required this.data});
@override
_MessageDetailPageState createState() => _MessageDetailPageState();
}
class _MessageDetailPageState extends State<MessageDetailPage> {
MHDeviceShareController controller = Get.find();
MhMessageController messageController = Get.find();
@override
Widget build(BuildContext context) {
var messageInfo = widget.data;
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(
appBar: AppBar(
backgroundColor: Colors.transparent,
automaticallyImplyLeading: false,
iconTheme:
IconThemeData(color: themeController.currentColor.sc3),
titleSpacing: 0,
title: SizedBox(
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: 0.rpx,
child: returnIconButtomNew,
),
],
),
),
actions: const [],
centerTitle: false,
),
backgroundColor: Colors.transparent,
body: SafeArea(
top: true,
child: Padding(
padding: EdgeInsets.only(top: 30.rpx),
child: Column(
children: [
Padding(
padding:
EdgeInsets.only(left: 30.rpx, right: 30.rpx),
child: Container(
decoration: BoxDecoration(
color: Color(0XFF003058),
borderRadius: BorderRadius.circular(16.rpx),
),
child: Padding(
padding: EdgeInsets.only(
left: 30.rpx,
top: 20.rpx,
bottom: 20.rpx),
child: Column(
crossAxisAlignment:
CrossAxisAlignment.start,
children: [
Container(
width: double.infinity,
constraints: BoxConstraints(
minHeight: 66.rpx),
child: Align(
alignment:
AlignmentDirectional(-1, 0),
child: Text(
"${messageInfo['data']['title']}",
style: TextStyle(
fontFamily: 'Inter',
fontSize: 30.rpx,
letterSpacing: 0.0,
color: themeController
.currentColor.sc3,
),
),
),
),
Row(
mainAxisSize: MainAxisSize.max,
children: [
Container(
constraints: BoxConstraints(
minWidth: 30.rpx,
maxWidth: 140.rpx),
child: Column(
crossAxisAlignment:
CrossAxisAlignment.start,
children: messageInfo['data']
['val']
.map<Widget>((mapItem) =>
_buildInfoItem(
context,
mapItem['k'] ??
''))
.toList(),
),
),
Container(
constraints: BoxConstraints(
minWidth: 30.rpx),
child: Column(
crossAxisAlignment:
CrossAxisAlignment.start,
children: messageInfo['data']
['val']
.map<Widget>((mapItem) =>
_buildValueItem(
context,
mapItem['v'] ??
''))
.toList(),
),
),
].divide(SizedBox(width: 30.rpx)),
),
],
))),
),
const Spacer(),
bottomIcon(context)
],
)),
),
),
),
));
}
Container bottomIcon(BuildContext context) {
return Container(
height: 120.rpx,
decoration: BoxDecoration(
color: Color(0xFF003058),
),
width: double.infinity,
child: TextButton(
onPressed: () async {
if (widget.data['status'] == 1) {
ApiResponse apiResponse =
await controller.confirmShare(widget.data['data']['shareCode']);
if (apiResponse.code == HttpStatusCodes.ok) {
TopSlideNotification.show(context,
text: apiResponse.msg!, textColor: Color(0xFF00C1AA));
messageController.getMessageList();
messageController.updateAll();
} else {
TopSlideNotification.show(context,
text: apiResponse.msg!, textColor: Color(0XFFFF7159));
messageController.getMessageList();
messageController.updateAll();
}
}
},
child: Text(
getStatusText(widget.data['status']),
style: TextStyle(
fontFamily: 'Readex Pro',
color: widget.data['data']['status'] == 1
? Colors.white
: Color(0xFF929699),
fontSize: 26.rpx,
letterSpacing: 0,
),
),
),
);
}
Widget _buildInfoItem(BuildContext context, String label) {
return Container(
constraints: BoxConstraints(
minHeight: 62.rpx,
),
child: Align(
alignment: AlignmentDirectional(-1, 0),
child: Text(
overflow: TextOverflow.ellipsis,
maxLines: 1,
label.tr,
style: TextStyle(
fontFamily: 'Inter',
fontSize: 26.rpx,
letterSpacing: 0.0,
color: themeController.currentColor.sc4,
),
),
),
);
}
Widget _buildValueItem(BuildContext context, value) {
return Container(
constraints: BoxConstraints(
minHeight: 62.rpx,
),
child: Align(
alignment: AlignmentDirectional(-1, 0),
child: Text(
overflow: TextOverflow.ellipsis,
maxLines: 1,
"${value}",
style: TextStyle(
fontFamily: 'Inter',
fontSize: 26.rpx,
letterSpacing: 0.0,
color: themeController.currentColor.sc3,
),
),
),
);
}
String getStatusText(int status) {
switch (status) {
case 1:
return '同意';
case 2:
return '已同意';
case 3:
return '已过期';
default:
return '未知状态';
}
}
}

View File

@@ -175,7 +175,7 @@ class _MessagePageState extends State<MessagePage> {
),
// 左侧图标
Positioned(
left: 20.rpx,
left: 0.rpx,
child: returnIconButtomNew,
),
],
@@ -261,6 +261,7 @@ class _MessagePageState extends State<MessagePage> {
),
),
);
}
Container bottomIcon(BuildContext context) {

View File

@@ -88,7 +88,7 @@ class _MyExperiencePageState extends State<MyExperiencePage> {
),
// 左侧图标
Positioned(
left: 20.rpx,
left: 0.rpx,
child: returnIconButtomNew,
),
],

View File

@@ -141,7 +141,7 @@ class _MinePageState extends State<NewMinePage> {
userInfoController
.model.user!.avatar!.isEmpty
? Image.asset(
"assets/images/people_avatar.png",
"assets/images/default_avatar.png",
fit: BoxFit.cover,
)
: Image.network(
@@ -149,7 +149,7 @@ class _MinePageState extends State<NewMinePage> {
fit: BoxFit.cover,
))
: Image.asset(
"assets/images/people_avatar.png",
"assets/images/default_avatar.png",
fit: BoxFit.cover,
),
),
@@ -250,7 +250,7 @@ class _MinePageState extends State<NewMinePage> {
),
),
child: Text(
'我的智能',
'我的智能设备'.tr,
style: TextStyle(
fontSize: 26.rpx, color: const Color(0xFF003058)),
),

View File

@@ -63,7 +63,7 @@ class _SettingPageState extends State<SettingPage> {
),
// 左侧图标
Positioned(
left: 20.rpx,
left: 0.rpx,
child: returnIconButtomNew,
),
],
@@ -288,7 +288,9 @@ class _SettingPageState extends State<SettingPage> {
.currentColor.sc21, // 点击时的背景色
padding: EdgeInsetsDirectional.fromSTEB(
0.rpx, 0.rpx, 0.rpx, 0.rpx),
onTap: () {},
onTap: () {
Get.toNamed('/aboutUs');
},
child: Container(
child: Padding(
padding: EdgeInsetsDirectional.fromSTEB(
@@ -335,8 +337,7 @@ class _SettingPageState extends State<SettingPage> {
padding: EdgeInsetsDirectional.fromSTEB(
40.rpx, 0.rpx, 40.rpx, 0.rpx),
onTap: () {
TopSlideNotification.show(context,
text: "待开发功能".tr);
Get.toNamed("/userAgreementPage");
},
child: Container(
child: Padding(
@@ -384,8 +385,7 @@ class _SettingPageState extends State<SettingPage> {
padding: EdgeInsetsDirectional.fromSTEB(
0.rpx, 0.rpx, 0.rpx, 0.rpx),
onTap: () {
TopSlideNotification.show(context,
text: "待开发功能".tr);
Get.toNamed("/privacyPolicyPage");
},
child: Container(
child: Padding(
@@ -568,8 +568,10 @@ class _SettingPageState extends State<SettingPage> {
),
),
Text(
AppConstants().ent_type == 1? 'Copyright © 202-2025 嘉兴太和信息技术有限责任公司 版权所有'
.tr:"Copyright © 202-2025 杭州欢睡科技有限公司 版权所有",
AppConstants().ent_type == 1
? 'Copyright © 202-2025 嘉兴太和信息技术有限责任公司 版权所有'
.tr
: "Copyright © 202-2025 杭州欢睡科技有限公司 版权所有",
style: TextStyle(
color: themeController.currentColor.sc4,
fontFamily: 'Inter',

View File

@@ -4,10 +4,12 @@ import 'package:ef/ef.dart';
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:flutter/widgets.dart';
import 'package:flutter_svg/svg.dart';
import 'package:flutterflow_ui/flutterflow_ui.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/component/tool/TopSlideNotification.dart';
import 'package:vbvs_app/controller/main_bottom/global_controller.dart';
import 'package:vbvs_app/controller/mh_controller/people_info_controller.dart';
@@ -58,7 +60,7 @@ class PeopleInfoPage extends GetView<PeopleInfoController> {
children: [
// 中间居中的标题
Text(
'人员资料',
'人员资料'.tr,
textAlign: TextAlign.center,
style: TextStyle(
color: Colors.white,
@@ -67,7 +69,7 @@ class PeopleInfoPage extends GetView<PeopleInfoController> {
),
// 左侧图标
Positioned(
left: 20.rpx,
left: 0.rpx,
child: returnIconButtomNew,
),
Positioned(
@@ -89,7 +91,9 @@ class PeopleInfoPage extends GetView<PeopleInfoController> {
d['height'].toString().isNotEmpty &&
int.tryParse(d['height'].toString()) ==
null) {
showToast("$prefix身高请输入数字");
TopSlideNotification.show(context,
text: "请选择身高".tr,
textColor: Color(0xFFFF7159));
isValid = false;
break;
}
@@ -98,16 +102,9 @@ class PeopleInfoPage extends GetView<PeopleInfoController> {
d['weight'].toString().isNotEmpty &&
int.tryParse(d['weight'].toString()) ==
null) {
showToast("$prefix体重请输入数字");
isValid = false;
break;
}
if (d['tel'] != null &&
d['tel'].toString().isNotEmpty &&
!MyUtils.isValidPhoneNumber(
d['tel'].toString())) {
showToast("$prefix请输入正确的电话");
TopSlideNotification.show(context,
text: "请选择体重".tr,
textColor: Color(0xFFFF7159));
isValid = false;
break;
}
@@ -116,7 +113,9 @@ class PeopleInfoPage extends GetView<PeopleInfoController> {
d['contact'].toString().isNotEmpty &&
!MyUtils.isValidPhoneNumber(
d['contact'].toString())) {
showToast("$prefix请输入正确的紧急联系人电话");
TopSlideNotification.show(context,
text: "请输入正确的联系人电话".tr,
textColor: Color(0xFFFF7159));
isValid = false;
break;
}
@@ -126,13 +125,15 @@ class PeopleInfoPage extends GetView<PeopleInfoController> {
if (isValid) {
for (var data in controller.model.peopleList) {
try {
await controller.savePeoples(
data); // 注意:你这个方法名是 savePeoples建议改成 savePerson
showToast("保存成功(${data['mac']}",
color: color_success);
await controller.savePeoples(data);
TopSlideNotification.show(context,
text: "更新成功".tr,
textColor: Color(0XFF00C1AA));
} catch (e) {
print("保存失败:$e");
showToast("保存失败(${data['mac']}");
TopSlideNotification.show(context,
text: "更新失败".tr,
textColor: Color(0xFFFF7159));
}
}
}
@@ -153,7 +154,7 @@ class PeopleInfoPage extends GetView<PeopleInfoController> {
// color: stringToColor("#182B7C"),
// ),
child: Text(
"保存",
"保存".tr,
style: TextStyle(
fontFamily: 'Readex Pro',
color: Color(0XFF011D33),
@@ -391,12 +392,16 @@ class PeopleInfoPage extends GetView<PeopleInfoController> {
SizedBox(
width: 16.rpx,
),
Icon(
Icons.expand_more,
color:
Colors.white,
size: 48.rpx,
),
Container(
height: 30.rpx,
width: 30.rpx,
child:
SvgPicture
.asset(
'assets/img/icon/expand_more.svg',
color: Colors
.white,
))
],
),
],
@@ -560,11 +565,15 @@ class PeopleInfoPage extends GetView<PeopleInfoController> {
),
SizedBox(
width: 16.rpx),
Icon(
Icons.expand_more,
color:
Colors.white,
size: 48.rpx),
Container(
height: 30.rpx,
width: 30.rpx,
child: SvgPicture
.asset(
'assets/img/icon/expand_more.svg',
color: Colors
.white,
))
],
),
],
@@ -649,12 +658,16 @@ class PeopleInfoPage extends GetView<PeopleInfoController> {
),
SizedBox(
width: 16.rpx),
Icon(
Icons
.expand_more,
Container(
height: 30.rpx,
width: 30.rpx,
child:
SvgPicture
.asset(
'assets/img/icon/expand_more.svg',
color: Colors
.white,
size: 48.rpx),
))
],
),
],
@@ -769,12 +782,16 @@ class PeopleInfoPage extends GetView<PeopleInfoController> {
SizedBox(
width: 16.rpx,
),
Icon(
Icons.expand_more,
color:
Colors.white,
size: 48.rpx,
),
Container(
height: 30.rpx,
width: 30.rpx,
child:
SvgPicture
.asset(
'assets/img/icon/expand_more.svg',
color: Colors
.white,
))
],
),
],

View File

@@ -0,0 +1,121 @@
import 'package:ef/ef.dart';
import 'package:flutter/material.dart';
import 'package:flutter_pdfview/flutter_pdfview.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/setting/pdf/PrivacyPdfController.dart';
class PrivacyPolicyPage extends StatefulWidget {
PrivacyPolicyPage({super.key});
@override
State<PrivacyPolicyPage> createState() => _PrivacyPolicyPageState();
}
class _PrivacyPolicyPageState extends State<PrivacyPolicyPage> {
PrivacyPdfController pdfController = Get.find();
@override
void initState() {
super.initState();
String language = "zh_CN"; // 默认语言
int ent_type = AppConstants().ent_type;
if (languageController.selectLanguage?.value?.language_code != null) {
language = languageController.selectLanguage!.value!.language_code!;
} // 根据 ent_type 拼接不同的文件名
String pdfName =
ent_type == 1 ? "$language.pdf" : "${language}_$ent_type.pdf";
pdfController.loadPdf(
2,
"https://vsbst-api.he-info.cn/vsbs_sotrage/privacy-scheme/$pdfName",
);
}
@override
Widget build(BuildContext context) {
return LayoutBuilder(
builder: (context, bodySize) => GestureDetector(
onTap: () => FocusScope.of(context).unfocus(),
child: Container(
decoration: BoxDecoration(
image: DecorationImage(
image: AssetImage('assets/images/new_background.png'), // 本地图片
fit: BoxFit.fill, // 填满整个 Container
),
),
child: Scaffold(
backgroundColor: Colors.transparent, // 加上这一行
appBar: AppBar(
backgroundColor: themeController.currentColor.sc17,
automaticallyImplyLeading: false,
iconTheme: IconThemeData(
color: themeController.currentColor.sc3,
),
titleSpacing: 0,
// leading: returnIconButtom,
title: Container(
width: double.infinity,
height: 180.rpx,
child: Stack(
alignment: Alignment.center,
children: [
/// 居中标题
Text(
'隐私协议'.tr,
style: TextStyle(
fontFamily: 'Readex Pro',
color: themeController.currentColor.sc3,
letterSpacing: 0,
fontSize: 30.rpx,
),
),
/// 左边返回按钮
Positioned(
left: 0,
child: returnIconButtomNew,
),
],
),
),
actions: [],
centerTitle: false,
),
body: SafeArea(
top: true,
child: Padding(
padding: EdgeInsets.symmetric(horizontal: 0.rpx),
child: Column(
children: [
Expanded(
child: Obx(() {
if (pdfController.localPdfPath.value == null) {
return Center(child: CircularProgressIndicator());
} else {
return PDFView(
filePath: pdfController.localPdfPath.value!,
autoSpacing: false,
enableSwipe: true,
swipeHorizontal: false,
pageSnap: true,
fitEachPage: true,
defaultPage: 0,
onRender: (pages) => print('PDF 渲染完成,共 $pages'),
onError: (error) => print('PDF 加载错误: $error'),
);
}
}),
),
],
),
),
),
),
),
),
);
}
}

View File

@@ -106,7 +106,7 @@ class RepairHistoryListPage extends GetView<RepairInfoController> {
),
// 左侧图标
Positioned(
left: 20.rpx,
left: 0.rpx,
child: returnIconButtomNew,
),
],

View File

@@ -3,6 +3,7 @@ import 'package:flutter/gestures.dart';
import 'package:flutter/material.dart';
import 'package:vbvs_app/common/util/FitTool.dart';
import 'package:vbvs_app/common/util/MyUtils.dart';
import 'package:vbvs_app/component/NullDataComponentWidget.dart';
import 'package:vbvs_app/component/tool/CustomCard.dart';
import 'package:vbvs_app/controller/mh_controller/apply_repair_controller.dart';
import 'package:vbvs_app/controller/mh_controller/repair_list_controller.dart';
@@ -75,7 +76,7 @@ class DeviceRepairPage extends GetView<RepairListController> {
),
// 左侧图标
Positioned(
left: 20.rpx,
left: 0.rpx,
child: returnIconButtomNew,
),
],
@@ -257,7 +258,7 @@ class DeviceRepairPage extends GetView<RepairListController> {
))
.toList(),
)
: EmptyMessageWidget();
: NullDataWidget();
}),
),
],

View File

@@ -5,6 +5,9 @@ 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';
import 'package:vbvs_app/component/tool/TopSlideNotification.dart';
import 'package:vbvs_app/controller/mh_controller/device_list_controller.dart';
import 'package:vbvs_app/pages/mh_page/test/WebviewTestModel.dart';
class RoomPickerPage extends StatefulWidget {
final Map data;
@@ -16,7 +19,7 @@ class RoomPickerPage extends StatefulWidget {
class _RoomPickerPageState extends State<RoomPickerPage> {
late Map<String, dynamic> editedData;
RxList rooms = [].obs;
DeviceListController deviceListController = Get.find();
@override
void initState() {
super.initState();
@@ -79,7 +82,7 @@ class _RoomPickerPageState extends State<RoomPickerPage> {
),
// 左侧图标
Positioned(
left: 20.rpx,
left: 0.rpx,
child: returnIconButtomNew,
),
],
@@ -186,7 +189,25 @@ class _RoomPickerPageState extends State<RoomPickerPage> {
"roomId": rooms[selectedIndex]['_id'],
},
onSuccess: (res) {
'更新人员信息成功: $res';
TopSlideNotification.show(context,
text: "更新成功".tr,
textColor: Color(0XFF00C1AA));
deviceListController.getDeviceList();
try {
WebviewTestController
webviewTestController = Get.find();
webviewTestController.web.jsbridge?.dart
.alterDevice();
} catch (e) {
ef.log("[h5]通知列表更新错误:$e");
}
Get.back(result:editedData);
},
onFailure: (res) {
TopSlideNotification.show(context,
text: "更新失败".tr,
textColor: Color(0xFFFF7159));
},
);
} catch (e) {
@@ -207,7 +228,7 @@ class _RoomPickerPageState extends State<RoomPickerPage> {
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(6),
),
child: Text("完成",
child: Text("完成".tr,
style: TextStyle(
color: const Color(0xFF003058),
fontSize: 30.rpx,

View File

@@ -42,7 +42,7 @@ class ScorePage extends GetView<mh.ScoreController> {
children: [
// 中间居中的标题
Text(
'评价',
'评价'.tr,
textAlign: TextAlign.center,
style: TextStyle(
color: Colors.white,
@@ -51,7 +51,7 @@ class ScorePage extends GetView<mh.ScoreController> {
),
// 左侧图标
Positioned(
left: 20.rpx,
left: 0.rpx,
child: returnIconButtomNew,
),
],
@@ -107,7 +107,7 @@ class ScorePage extends GetView<mh.ScoreController> {
alignment:
AlignmentDirectional(0, 0),
child: Text(
'我要评价',
'我要评价'.tr,
style: TextStyle(
fontFamily: 'Readex Pro',
fontSize: 30.rpx,

View File

@@ -117,6 +117,9 @@ class SearchWidget extends GetView {
// validator: _model
// .textControllerValidator
// .asValidator(context),
onChanged: (d) {
onChange?.call(d);
},
),
),
),
@@ -126,6 +129,10 @@ class SearchWidget extends GetView {
),
Padding(
padding: EdgeInsetsDirectional.fromSTEB(26.rpx, 0, 0, 0),
child: InkWell(
onTap: () {
findCallback?.call();
},
child: Row(
mainAxisSize: MainAxisSize.max,
children: [
@@ -147,7 +154,7 @@ class SearchWidget extends GetView {
),
].divide(SizedBox(width: 26.rpx)),
),
),
)),
],
),
),

View File

@@ -40,7 +40,7 @@ class _SleepHabitPageState extends State<SleepHabitPage> {
children: [
// 中间居中的标题
Text(
'设备报修',
'睡眠习惯'.tr,
textAlign: TextAlign.center,
style: TextStyle(
color: Colors.white,
@@ -49,7 +49,7 @@ class _SleepHabitPageState extends State<SleepHabitPage> {
),
// 左侧图标
Positioned(
left: 20.rpx,
left: 0.rpx,
child: returnIconButtomNew,
),
],
@@ -77,7 +77,7 @@ class _SleepHabitPageState extends State<SleepHabitPage> {
width: bodysize!.maxWidth * 1,
height: bodysize!.maxHeight * 0.056,
child: Text(
'柔性唤醒',
'柔性唤醒'.tr,
style: TextStyle(
fontSize: 26.rpx, color: Colors.white),
))),
@@ -95,7 +95,7 @@ class _SleepHabitPageState extends State<SleepHabitPage> {
width: bodysize!.maxWidth * 1,
height: bodysize!.maxHeight * 0.056,
child: Text(
'睡眠隐私',
'睡眠隐私'.tr,
style: TextStyle(
fontSize: 26.rpx, color: Colors.white),
)))

View File

@@ -66,7 +66,7 @@ class Smys extends GetView<SleepingHabitController> {
children: [
// 中间居中的标题
Text(
'睡眠隐私',
'睡眠隐私'.tr,
textAlign: TextAlign.center,
style: TextStyle(
color: Colors.white,
@@ -75,7 +75,7 @@ class Smys extends GetView<SleepingHabitController> {
),
// 左侧图标
Positioned(
left: 20.rpx,
left: 0.rpx,
child: returnIconButtomNew,
),
],
@@ -125,7 +125,7 @@ class Smys extends GetView<SleepingHabitController> {
MainAxisAlignment.spaceBetween,
children: [
Text(
'睡眠隐私功能',
'睡眠隐私功能'.tr,
style: TextStyle(
fontFamily: 'Readex Pro',
color: Color(0xFF9EA4B7),
@@ -156,9 +156,24 @@ class Smys extends GetView<SleepingHabitController> {
),
)),
// getLine(),
Container(
InkWell(
onTap: () async {
showDayTimeSelectionDialog(context,
dayTimeArr: controller.model.smysStartTime,
title: "开始时间".tr, checkChange: (d) {
controller.attr.update((getmodel) {
getmodel.model.smysStartTime = [
int.parse("${d[0]}"),
int.parse("${d[1]}")
];
});
// updateParm();
});
},
child: Container(
width: double.infinity,
height: MediaQuery.sizeOf(context).height * 0.055,
height:
MediaQuery.sizeOf(context).height * 0.055,
decoration: BoxDecoration(
border: Border(
bottom: BorderSide(
@@ -178,7 +193,7 @@ class Smys extends GetView<SleepingHabitController> {
MainAxisAlignment.spaceBetween,
children: [
Text(
'开始时间',
'开始时间'.tr,
style: TextStyle(
fontFamily: 'Readex Pro',
color: Color(0xFF9EA4B7),
@@ -186,22 +201,7 @@ class Smys extends GetView<SleepingHabitController> {
letterSpacing: 0,
),
),
InkWell(
onTap: () async {
showDayTimeSelectionDialog(context,
dayTimeArr:
controller.model.smysStartTime,
title: "开始时间", checkChange: (d) {
controller.attr.update((getmodel) {
getmodel.model.smysStartTime = [
int.parse("${d[0]}"),
int.parse("${d[1]}")
];
});
// updateParm();
});
},
child: Row(
Row(
mainAxisSize: MainAxisSize.max,
children: [
Text(
@@ -225,12 +225,26 @@ class Smys extends GetView<SleepingHabitController> {
))
],
),
),
],
),
)),
),
// getLine(),
Container(
InkWell(
onTap: () async {
showDayTimeSelectionDialog(context,
dayTimeArr: controller.model.smysEndTime,
title: "结束时间".tr, checkChange: (d) {
controller.attr.update((getmodel) {
getmodel.model.smysEndTime = [
int.parse("${d[0]}"),
int.parse("${d[1]}")
];
});
// updateParm();
});
},
child: Container(
width: double.infinity,
height: MediaQuery.sizeOf(context).height * 0.055,
decoration: BoxDecoration(
@@ -252,7 +266,7 @@ class Smys extends GetView<SleepingHabitController> {
MainAxisAlignment.spaceBetween,
children: [
Text(
'结束时间',
'结束时间'.tr,
style: TextStyle(
fontFamily: 'Readex Pro',
color: Color(0xFF9EA4B7),
@@ -260,22 +274,7 @@ class Smys extends GetView<SleepingHabitController> {
letterSpacing: 0,
),
),
InkWell(
onTap: () async {
showDayTimeSelectionDialog(context,
dayTimeArr:
controller.model.smysEndTime,
title: "结束时间", checkChange: (d) {
controller.attr.update((getmodel) {
getmodel.model.smysEndTime = [
int.parse("${d[0]}"),
int.parse("${d[1]}")
];
});
// updateParm();
});
},
child: Row(
Row(
mainAxisSize: MainAxisSize.max,
children: [
Text(
@@ -299,12 +298,11 @@ class Smys extends GetView<SleepingHabitController> {
))
],
),
),
],
),
),
),
// getLine(),
), // getLine(),
SizedBox(
height: 30.rpx,
),
@@ -314,7 +312,7 @@ class Smys extends GetView<SleepingHabitController> {
width: double.infinity,
decoration: BoxDecoration(),
child: Text(
'*注:开启睡眠隐私功能后,在设置的时间段内,将不会采集您的睡眠数据。',
'*注:开启睡眠隐私功能后,在设置的时间段内,将不会采集您的睡眠数据。'.tr,
style: TextStyle(
fontFamily: 'Readex Pro',
color: Color(0xFF9EA4B7),

View File

@@ -1,9 +1,16 @@
import 'dart:async';
import 'dart:convert';
import 'package:EasyDartModule/EasyDartModule.dart' as edm;
import 'package:easydevice/easydevice.dart';
import 'package:easyweb/base/easyws.dart';
import 'package:easyweb/base/minisdk.dart';
import 'package:easyweb/easyweb.dart';
import 'package:ef/ef.dart';
import 'package:flutter/material.dart';
import 'package:easyweb/base/minisdk.dart';
import 'package:easydevice/easydevice.dart';
import 'package:vbvs_app/common/color/ServiceConstant.dart';
import 'package:vbvs_app/common/util/FitTool.dart';
import 'package:vbvs_app/common/util/requestWithLog.dart';
import 'package:vbvs_app/controller/user_info_controller.dart';
import 'package:vbvs_app/pages/mh_page/homepage/controller/mht_home_controller.dart';
@@ -16,12 +23,16 @@ class WebviewTestModel {
}
class WebviewTestController extends GetControllerEx<WebviewTestModel> {
var selectDevice;
var bluetooth = false;
var selectDevice = {};
var lastSelectDevice = {};
var bluetooth = 0;
List personList = [];
List instantData = [];
WebviewTestController() : super(WebviewTestModel()) {
web = WebviewHelper(
jsbridge: buildsdk(
father: this,
// father: this,
// clientId: '494641114',
// dbgserverUrl: 'ws://192.168.1.2:9001',
),
@@ -46,12 +57,32 @@ class WebviewTestController extends GetControllerEx<WebviewTestModel> {
bridge.sdk.updateDeviceRoute((args) async {
ef.log('updateDeviceRoute: $args');
selectDevice['blueToothStatus'] = bluetooth;
Get.toNamed("$args[0]", arguments: selectDevice);
Get.toNamed("${args[0]}", arguments: selectDevice);
return true;
});
bridge.sdk.selectDevice((args) async {
<<<<<<< HEAD
ef.log('selectDevice: $args');
selectDevice = args[0];
=======
try {
ef.log('selectDevice: $args');
selectDevice = args[0];
await queryPersonInfoByMac();
if (selectDevice != null &&
selectDevice.isNotEmpty &&
selectDevice['mac'] != null &&
(selectDevice['mac'] != args[0]['mac'])) {
lastSelectDevice = selectDevice;
}
dealInstantData(selectDevice);
} catch (e) {
ef.log("[aaaa]$e");
}
//查询人员信息
>>>>>>> 13eb25e1c30dcd81c87aa85bcb5306ca0931ed21
return true;
});
bridge.sdk.updateBlueToothStatus((args) async {
@@ -59,6 +90,57 @@ class WebviewTestController extends GetControllerEx<WebviewTestModel> {
bluetooth = args[0];
return true;
});
//sdk定义接口
bridge.sdk.querySelectDevice((args) async {
ef.log('updateBlueToothStatus: $args');
// bluetooth = args[0];
MHTHomeController deviceController = Get.find();
final allDevices = deviceController.deviceList.values
.expand((list) => list)
.toList();
return allDevices;
});
//请求token信息
bridge.sdk.queryUserToken((args) async {
ef.log('queryUserToken: $args');
// bluetooth = args[0];
return edm.EasyDartModule.dio.token;
});
//请求设备人员信息
bridge.sdk.queryPersonInfo((args) async {
ef.log('queryPersonInfo: $args');
// bluetooth = args[0];
return personList;
});
//请求实时体征数据
bridge.sdk.queryInstantData((args) async {
ef.log('queryInstantData: $args');
// bluetooth = args[0];
return instantData;
});
bridge.sdk.queryInstantData((args) async {
ef.log('queryInstantData: $args');
// bluetooth = args[0];
return instantData;
});
bridge.sdk.startTimer((args) async {
ef.log('queryInstantData: $args');
MHTHomeController homeController = Get.find();
homeController.startTimer(args);
return true;
});
bridge.sdk.cancelTimer((args) async {
ef.log('queryInstantData: $args');
MHTHomeController homeController = Get.find();
homeController.cancelTimer(args);
return true;
});
bridge.sdk.restoreTimer((args) async {
ef.log('queryInstantData: $args');
MHTHomeController homeController = Get.find();
var data = await homeController.restoreTimer(args);
return data;
});
});
web
//.file(
@@ -80,6 +162,116 @@ class WebviewTestController extends GetControllerEx<WebviewTestModel> {
late WebviewHelper web;
var ready = false.obs;
var cnt = 0.obs;
Future<void> queryPersonInfoByMac() async {
UserInfoController userInfoController = Get.find();
String serviceAddress = ServiceConstant.service_address;
String serviceName = ServiceConstant.server_service;
String serviceApi = ServiceConstant.person_info;
String queryUrl =
"${serviceAddress}${serviceName}${serviceApi}?mac=${selectDevice['mac']}";
try {
final res = await requestWithLog(
logTitle: "查询设备绑定人员列表",
method: MyHttpMethod.get,
queryUrl: queryUrl,
onSuccess: (res) {
personList = res.data;
});
} catch (e) {
print("查询设备绑定列表失败: $e");
}
}
void dealInstantData(selectDevice) {
//处理实时数据
// edm.EasyDartModule.websocket.sendData(
// jsonEncode(WebSocketMessage(path: "/vsbs/web/rt/marttress", type: 2)));
lastSelectDevice;
var ws;
ws = Easyws(
url: ServiceConstant.webSocketService,
onData: (data) {
ef.log("ws recv =>$data");
try {
var tmp;
if (data is String) {
tmp = jsonDecode(data); // 只有是 String 才 decode
} else if (data is Map<String, dynamic>) {
tmp = data; // 直接用
} else {
print("未知数据格式");
}
if (tmp['data'] != null && tmp['data'] is Map) {
var newData = tmp['data'];
var mac = newData['mac'];
if (mac != null) {
// 删除已有的同 mac 项
instantData.removeWhere((element) => element['mac'] == mac);
// 添加新的数据
instantData.add(newData);
}
}
} catch (e) {
ef.log("ws error =>$e");
}
},
onStateChange: (x) {
ef.log("ws =>$x");
if (x == EasywsState.connected) {
try {
if (lastSelectDevice != null && lastSelectDevice.isNotEmpty) {
List<String?> oldMacList = [
lastSelectDevice['bind_mac_a'],
lastSelectDevice['bind_mac_b'],
];
for (String? mac in oldMacList) {
if (mac != null && mac.isNotEmpty) {
bool success = ws.send({
"type": 2,
"path": "/vsbs/web/rt/marttress",
"data": {"mac": mac},
});
if (success) {
ef.log("✅ 已取消监听:$mac");
}
}
}
}
} catch (e) {
ef.log("❌ 取消旧设备监听失败: $e");
}
try {
// 2. 开始监听新设备A/B 都监听)
if (selectDevice != null && selectDevice.isNotEmpty) {
List<String?> newMacList = [
selectDevice['bind_mac_a'],
selectDevice['bind_mac_b'],
];
for (String? mac in newMacList) {
if (mac != null && mac.isNotEmpty) {
bool success = ws.send({
"type": 1,
"path": "/vsbs/web/rt/marttress",
"data": {"mac": mac},
});
if (success) {
ef.log("✅ 开始监听新设备:$mac");
}
}
}
// 更新记录
lastSelectDevice = selectDevice;
}
} catch (e) {
ef.log("❌ 监听新设备失败: $e");
}
}
},
);
ws.connect();
}
//EasyFlutter End
}
@@ -90,7 +282,7 @@ class WebviewTestView extends GetComponent<WebviewTestController> {
Widget build(BuildContext context) {
UserInfoController userInfoController = Get.find();
MHTHomeController deviceController = Get.find();
deviceController.getDeviceList(group: 'room').then((x) {
deviceController.getDeviceList().then((x) {
if (controller.web.jsbridge!.inited) {
//发送测试消息给webview
controller.web.jsbridge!.dart

View File

@@ -82,7 +82,7 @@ class _UpdateUserPageState extends State<EditUserPage> {
),
),
Positioned(
left: 20.rpx,
left: 0.rpx,
child: returnIconButtomNew,
),
Positioned(

View File

@@ -70,7 +70,7 @@ class FindPasswordPage extends GetView<FindPasswordController> {
),
// 左侧图标
Positioned(
left: 20.rpx,
left: 0.rpx,
child: returnIconButtomNew,
),
],

File diff suppressed because it is too large Load Diff

View File

@@ -56,7 +56,7 @@ class RegisterPage extends GetView<MHTRegisterController> {
),
),
Positioned(
left: 20.rpx,
left: 0.rpx,
child: returnIconButtomNew,
),
],

View File

@@ -219,52 +219,6 @@ class _RxhxMhtState extends State<RxhxMht> {
],
),
),
// leading: returnIconButtomAddCallback(() {
// controller.saveDataApi();
// }),
// Container(
// width: double.infinity,
// height: 70.rpx,
// child: Row(
// mainAxisSize: MainAxisSize.max,
// mainAxisAlignment: MainAxisAlignment.spaceBetween,
// children: [
// Text(
// '柔性唤醒',
// style: TextStyle(
// 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,
),
@@ -343,8 +297,23 @@ class _RxhxMhtState extends State<RxhxMht> {
),
),
getLine(),
Container(
margin: EdgeInsets.only(left: 40.rpx, right: 30.rpx),
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: Container(
margin:
EdgeInsets.only(left: 40.rpx, right: 30.rpx),
width: double.infinity,
height: 90.rpx,
decoration: const BoxDecoration(),
@@ -361,21 +330,7 @@ class _RxhxMhtState extends State<RxhxMht> {
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(
Row(
mainAxisSize: MainAxisSize.max,
children: [
Text(
@@ -399,19 +354,36 @@ class _RxhxMhtState extends State<RxhxMht> {
))
],
),
),
],
),
),
),
getLine(),
Container(
margin: EdgeInsets.only(left: 40.rpx, right: 30.rpx),
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: 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,
mainAxisAlignment:
MainAxisAlignment.spaceBetween,
children: [
Text(
'按摩',
@@ -422,23 +394,7 @@ class _RxhxMhtState extends State<RxhxMht> {
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(
Row(
mainAxisSize: MainAxisSize.max,
children: [
Text(
@@ -462,29 +418,10 @@ class _RxhxMhtState extends State<RxhxMht> {
))
],
),
),
],
),
)),
),
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: TextStyle(
fontFamily: 'Readex Pro',
color: Colors.white,
fontSize: 26.rpx,
letterSpacing: 0,
),
),
InkWell(
onTap: () {
showOneSelectionDialog(
@@ -499,7 +436,27 @@ class _RxhxMhtState extends State<RxhxMht> {
},
);
},
child: 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: TextStyle(
fontFamily: 'Readex Pro',
color: Colors.white,
fontSize: 26.rpx,
letterSpacing: 0,
),
),
Row(
mainAxisSize: MainAxisSize.max,
children: [
Text(
@@ -523,9 +480,8 @@ class _RxhxMhtState extends State<RxhxMht> {
))
],
),
),
],
),
)),
),
getLine(),
Container(
@@ -550,65 +506,120 @@ class _RxhxMhtState extends State<RxhxMht> {
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: TextStyle(
// color: controller.model
// .rxhxWeeks[
// index] ==
// 1
// ? Color(0XFF003058)
// : Colors.white),
// ),
// ),
// ),
// ),
// ),
// );
// }),
// ],
// ),
// ),
// ),
Padding(
padding: EdgeInsetsDirectional.fromSTEB(
0, 20.rpx, 0, 0),
child: Container(
child: SizedBox(
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) {
children: List.generate(7, (index) {
final bool selected =
controller.model.rxhxWeeks[index] ==
1;
return InkWell(
onTap: () {
controller.attr.update((getmodel) {
getmodel.model.rxhxWeeks[index] =
getmodel.model
.rxhxWeeks[index] = getmodel
.model
.rxhxWeeks[index] ==
0
? 1
: 0;
});
},
child: AspectRatio(
aspectRatio: 1,
child: ClipOval(
borderRadius: BorderRadius.circular(
50), // 点击水波圆角区域
child: Container(
height: double.infinity,
width: MediaQuery.sizeOf(context)
.height *
0.046, // 保证是正圆
height: MediaQuery.sizeOf(context)
.height *
0.046,
decoration: BoxDecoration(
color: controller.model
.rxhxWeeks[
index] ==
1
? Color(0xFF84F5FF)
: Color(0XFF003058)),
child: Center(
shape: BoxShape.circle,
color: selected
? const Color(0xFF84F5FF)
: const Color(0xFF003058),
),
alignment: Alignment.center,
child: Text(
weeks[index],
style: TextStyle(
color: controller.model
.rxhxWeeks[
index] ==
1
? Color(0XFF003058)
: Colors.white),
),
),
color: selected
? const Color(0xFF003058)
: Colors.white,
),
),
),
);
}),
],
),
),
),
)
],
),
),
@@ -624,7 +635,7 @@ class _RxhxMhtState extends State<RxhxMht> {
'*注:开启该功能后,在设置的时间点,设备将启动一段固定时长的柔性唤醒功能。',
style: TextStyle(
fontFamily: 'Readex Pro',
color: Colors.white,
color: Color(0xFF929699),
fontSize: 20.rpx,
letterSpacing: 0,
),

View File

@@ -0,0 +1,126 @@
import 'package:ef/ef.dart';
import 'package:flutter/material.dart';
import 'package:flutter_pdfview/flutter_pdfview.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/setting/pdf/UserPdfController.dart';
class UserAgreementPage extends StatefulWidget {
UserAgreementPage({super.key});
@override
State<UserAgreementPage> createState() => _UserAgreementPageState();
}
class _UserAgreementPageState extends State<UserAgreementPage> {
UserPdfController pdfController = Get.find();
@override
void initState() {
super.initState();
String language = "zh_CN"; // 默认语言
if (languageController.selectLanguage?.value?.language_code != null) {
language = languageController.selectLanguage!.value!.language_code!;
}
int ent_type = AppConstants().ent_type;
// 根据 ent_type 拼接不同的文件名
String pdfName =
ent_type == 1 ? "$language.pdf" : "${language}_$ent_type.pdf";
pdfController.loadPdf(
1,
"https://vsbst-api.he-info.cn/vsbs_sotrage/user-scheme/$pdfName",
);
}
@override
Widget build(BuildContext context) {
return LayoutBuilder(
builder: (context, bodySize) => GestureDetector(
onTap: () => FocusScope.of(context).unfocus(),
child: Container(
decoration: 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: IconThemeData(
color: themeController.currentColor.sc3,
),
titleSpacing: 0,
// leading: returnIconButtom,
title: Container(
width: double.infinity,
height: 180.rpx,
child: Stack(
alignment: Alignment.center,
children: [
/// 居中标题
Text(
'用户协议'.tr,
style: TextStyle(
fontFamily: 'Readex Pro',
color: themeController.currentColor.sc3,
letterSpacing: 0,
fontSize: 30.rpx,
),
),
/// 左边返回按钮
Positioned(
left: 0,
child: returnIconButtomNew,
),
],
),
),
actions: [],
centerTitle: false,
),
body: SafeArea(
top: true,
child: Padding(
padding: EdgeInsets.symmetric(horizontal: 0.rpx),
child: Column(
children: [
Expanded(
child: Obx(() {
if (pdfController.localPdfPath.value == null) {
return Center(child: CircularProgressIndicator());
} else {
return PDFView(
filePath: pdfController.localPdfPath.value!,
autoSpacing: false,
enableSwipe: true,
swipeHorizontal: false,
pageSnap: true,
fitEachPage: true,
defaultPage: 0,
onRender: (pages) => print('PDF 渲染完成,共 $pages'),
onError: (error) => print('PDF 加载错误: $error'),
);
}
}),
),
],
),
),
),
),
),
),
);
}
}

View File

@@ -179,8 +179,8 @@ class _MHTNewSleepReportPageState extends State<MHTNewSleepReportPage> {
if (widget.data['arrow'] == null ||
widget.data['arrow'] == true)
Positioned(
left: 0,
child: returnIconButtom,
left: 20,
child: returnIconButtomNew,
),
],
),

View File

@@ -122,8 +122,8 @@ class _NewSleepReportPageState extends State<NewSleepReportPage> {
/// 左边返回按钮
Positioned(
left: 0,
child: returnIconButtom,
left: 20,
child: returnIconButtomNew,
),
],
),

View File

@@ -13,6 +13,7 @@ import 'package:vbvs_app/controller/home/home_controller.dart';
import 'package:vbvs_app/controller/sleep/sleep_report_controller.dart';
import 'package:vbvs_app/language/AppLanguage.dart';
import 'package:vbvs_app/pages/common/selectDialog.dart';
import 'package:vbvs_app/pages/main_bottom/component/main_page_b_bottom_change.dart';
import 'package:vbvs_app/pages/sleep_report/component/AIAdviceWidget.dart';
import 'package:vbvs_app/pages/sleep_report/component/BreatheCard.dart';
import 'package:vbvs_app/pages/sleep_report/component/BreathePauseNewWidget.dart';
@@ -91,8 +92,16 @@ class _NewSleepReportPageState extends State<NewSleepReportPage> {
_scrollToTargetComponent(sleepReportController.sleepReport);
},
onFailure: (res) {
if (MainPageBBottomChange.getCurrentIndex() != null) {
if (MainPageBBottomChange.getCurrentIndex() == 1) {
TopSlideNotification.show(context,
text: res.msg!, textColor: themeController.currentColor.sc9);
}
} else {
TopSlideNotification.show(context,
text: res.msg!, textColor: themeController.currentColor.sc9);
}
sleepReportController.sleepReport.value = {};
sleepReportController.updateAll();
print(res);
@@ -149,8 +158,20 @@ class _NewSleepReportPageState extends State<NewSleepReportPage> {
builder: (context, bodySize) => GestureDetector(
onTap: () => FocusScope.of(context).unfocus(),
child: Container(
// decoration: BoxDecoration(
// image: DecorationImage(
// image: (widget.data['backgroundImg'] != null &&
// widget.data['backgroundImg'].toString().isNotEmpty)
// ? AssetImage(widget.data['backgroundImg'])
// : AssetImage('assets/img/bgNoImg.png') as ImageProvider,
// fit: BoxFit.fill,
// ),
// ),
decoration: BoxDecoration(
image: DecorationImage(
image: (widget.data['noBackImg'] != null &&
widget.data['noBackImg'] == true)
? null // ✅ 不要背景图
: DecorationImage(
image: (widget.data['backgroundImg'] != null &&
widget.data['backgroundImg'].toString().isNotEmpty)
? AssetImage(widget.data['backgroundImg'])
@@ -158,6 +179,7 @@ class _NewSleepReportPageState extends State<NewSleepReportPage> {
fit: BoxFit.fill,
),
),
child: Scaffold(
backgroundColor: Colors.transparent, // 背景透明
appBar: AppBar(
@@ -189,7 +211,7 @@ class _NewSleepReportPageState extends State<NewSleepReportPage> {
widget.data['arrow'] == true)
Positioned(
left: 0,
child: returnIconButtom,
child: returnIconButtomNew,
),
],
),

View File

@@ -77,7 +77,7 @@ class _SleepReportPageState extends State<SleepReportPage> {
/// 左边返回按钮
Positioned(
left: 0,
child: returnIconButtom,
child: returnIconButtomNew,
),
],
),

View File

@@ -57,15 +57,13 @@ class _AboutUsPageState extends State<AboutUsPage> {
alignment: Alignment.center,
children: [
/// 居中标题
Text(
'关于我们'.tr,
Text('关于我们'.tr,
style: TextStyle(
fontFamily: 'Readex Pro',
color: themeController.currentColor.sc3,
letterSpacing: 0,
fontSize: 30.rpx,
),
),
)),
/// 左边返回按钮
Positioned(

View File

@@ -1,5 +1,6 @@
import 'package:ef/ef.dart';
import 'package:flutter/cupertino.dart';
import 'package:path/path.dart';
import 'package:vbvs_app/component/tool/TopSlideNotification.dart';
import 'package:vbvs_app/controller/theme_controller/ThemeController.dart';
@@ -8,6 +9,8 @@ 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';
import 'package:vbvs_app/pages/mh_page/ShareDeviceDetailWidget.dart';
import 'package:vbvs_app/pages/mh_page/about_us.dart';
import 'package:vbvs_app/pages/mh_page/address_list_page.dart';
import 'package:vbvs_app/pages/mh_page/applyRepair/apply_repair_success.dart';
import 'package:vbvs_app/pages/mh_page/apply_repair_page.dart';
@@ -24,6 +27,8 @@ 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/homepage/new_Home_page.dart';
import 'package:vbvs_app/pages/mh_page/privacy_policy.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';
@@ -39,9 +44,11 @@ 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/mh_page/user_agreement_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/messageDetail.dart';
import '../pages/mh_page/message_page.dart';
import '../pages/mh_page/new_settingPage.dart';
@@ -49,6 +56,7 @@ ThemeController themeController = Get.find();
var mhroutes = {
"/mianPageBottomChange": (contxt) => MainPageBBottomChange(),
"/homePage": (context) => NewHomePage(),
"/homeDeviceType": (contxt) => HomeDeviceType(),
"/editUserInfoPage": (contxt) => EditUserPage(),
"/peopleInfoPage": (contxt, {arguments}) => PeopleInfoPage(
@@ -81,7 +89,8 @@ var mhroutes = {
"/findPasswordPage": (context) => FindPasswordPage(),
"/loginPage": (context) => MHTLoginPage(),
"/updatePasswordPage": (context) => UpdatePasswordPage(),
"/deviceSharePage": (context) => ShareDeviceWidget(),
"/deviceSharePage": (context, {arguments}) =>
ShareDeviceWidget(data: arguments),
"/deviceListPage": (context) => DeviceListPage(),
"/mHTDeviceTypePage": (context, {arguments}) => MHTBindDeviceTypePage(),
"/mHTBlueteethDevicePage": (context, {arguments}) =>
@@ -95,6 +104,12 @@ var mhroutes = {
"/helpArticle": (contxt, {arguments}) => HelpArticle(article: arguments),
"/mHTPeopleInfoPage": (contxt) => MHTPeopleInfoPage(),
"/applyRepairSuccess": (contxt) => ApplyRepairSuccess(),
"/aboutUs": (contxt) => MhAboutUsPage(),
"/userAgreementPage": (context) => UserAgreementPage(),
"/privacyPolicyPage": (context) => PrivacyPolicyPage(),
"/shareDeviceDetail": (context) => ShareDeviceDetailWidget(),
"/messageDetail": (context, {arguments}) =>
MessageDetailPage(data: arguments),
};
var mhonGenerateRoute = (RouteSettings settings) {
final String? name = settings.name; // 获取路由名称,如 /news 或 /search

View File

@@ -444,7 +444,11 @@ packages:
description:
path: "."
ref: main
<<<<<<< HEAD
resolved-ref: "840bcea66ee9222d9698a58f12a06107f337b59f"
=======
resolved-ref: f307495aac440031d119a728beaccf5d33003932
>>>>>>> 13eb25e1c30dcd81c87aa85bcb5306ca0931ed21
url: "https://gitea.wslpc.real.he-info.cn:94/flutter/easydevice.git"
source: git
version: "0.0.1"
@@ -452,8 +456,13 @@ packages:
dependency: "direct main"
description:
path: "."
<<<<<<< HEAD
ref: main
resolved-ref: "13a86afdcf71b55017ebf7ee2c22af211e642603"
=======
ref: e86d515f77
resolved-ref: e86d515f77a736a5e6f09036e5e022153cde425d
>>>>>>> 13eb25e1c30dcd81c87aa85bcb5306ca0931ed21
url: "https://gitea.wslpc.real.he-info.cn:94/flutter/easyweb.git"
source: git
version: "0.0.1"

View File

@@ -66,7 +66,7 @@ dependencies:
easyweb:
git:
url: https://gitea.wslpc.real.he-info.cn:94/flutter/easyweb.git
ref: main
ref: e86d515f77
archive: ^4.0.0