From 943f5a778afaa983b99a426cafeec43ca90cd01b Mon Sep 17 00:00:00 2001 From: czz <862977248@qq.com> Date: Fri, 27 Jun 2025 09:15:45 +0800 Subject: [PATCH] =?UTF-8?q?=E6=9B=B4=E6=96=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- assets/mhlangs/zh_CN.json | 335 ++++++------ lib/common/color/appConstants.dart | 2 +- .../mhdevice_share_controller.g.dart | 4 +- .../mh_controller/repair_list_controller.dart | 2 +- .../repair_list_controller.g.dart | 4 +- lib/main.dart | 3 +- lib/pages/common/selectDialog.dart | 16 +- lib/pages/mh_page/MattressControl.dart | 37 +- lib/pages/mh_page/ShareUserWidget.dart | 4 +- lib/pages/mh_page/about_us.dart | 128 +++++ lib/pages/mh_page/address_list_page.dart | 99 ++-- lib/pages/mh_page/apply_repair_page.dart | 192 ++++--- lib/pages/mh_page/device_share_page.dart | 380 +++++++++---- lib/pages/mh_page/edit_address_page.dart | 348 +++++++----- lib/pages/mh_page/edit_bed.dart | 5 +- lib/pages/mh_page/experience_store_page.dart | 5 +- lib/pages/mh_page/help/article.dart | 264 ++++------ lib/pages/mh_page/homepage/new_Home_page.dart | 1 + lib/pages/mh_page/new_mine_page.dart | 4 +- lib/pages/mh_page/new_settingPage.dart | 16 +- lib/pages/mh_page/people_info.dart | 101 ++-- lib/pages/mh_page/privacy_policy.dart | 121 +++++ lib/pages/mh_page/repair_list.dart | 3 +- lib/pages/mh_page/room_picker.dart | 13 +- lib/pages/mh_page/score_page.dart | 4 +- lib/pages/mh_page/sleep_habit.dart | 6 +- lib/pages/mh_page/smys.dart | 200 ++++--- lib/pages/mh_page/user/page/rxhx_mht.dart | 497 +++++++++--------- lib/pages/mh_page/user_agreement_page.dart | 126 +++++ .../mht_new_sleep_report_page.dart | 4 +- .../new_sleep_report_page copy.dart | 4 +- .../sleep_report/new_sleep_report_page.dart | 4 +- lib/pages/sleep_report/sleep_report_page.dart | 2 +- lib/pages/user/about_us_page.dart | 16 +- lib/routers/mh_routers.dart | 7 + pubspec.lock | 248 ++------- 36 files changed, 1850 insertions(+), 1355 deletions(-) create mode 100644 lib/pages/mh_page/about_us.dart create mode 100644 lib/pages/mh_page/privacy_policy.dart create mode 100644 lib/pages/mh_page/user_agreement_page.dart diff --git a/assets/mhlangs/zh_CN.json b/assets/mhlangs/zh_CN.json index 23bd1d3..844a75a 100644 --- a/assets/mhlangs/zh_CN.json +++ b/assets/mhlangs/zh_CN.json @@ -12,159 +12,159 @@ "详情": "详情", "人员资料": "人员资料" }, - "请输入手机号":"输入手机号码", - "请输入正确的手机号":"请输入正确的手机号", - "请输入密码":"请输入密码", - "密码格式提示":"1.密码长度必须至少8位\n2.密码需要字母加数字\n3.特殊字符和大写字母至少包含一个", - "请输入确认密码":"请输入确认密码", - "两次密码不一致":"两次密码不一致", - "请输入验证码":"请输入验证码", - "需要同意协议":"需要同意协议", - "请选择登录方式":"请选择登录方式", - "账户不能为空":"账户不能为空", - "密码不能为空":"密码不能为空", - "验证码不能为空":"验证码不能为空", - "密码登录":"密码登录", - "短信登录":"短信登录", - "获取验证码":"获取验证码", - "登录":"登录", - "找回密码":"找回密码", - "注册":"注册", - "我已阅读并同意":"我已阅读并同意", - "与":"与", - "《用户协议》":"《用户协议》", - "《隐私协议》":"《隐私协议》", - "注:首次登录会自动创建账号":"注:首次登录会自动创建账号", - "请输入新密码":"请输入新密码", - "确认新密码":"确认新密码", - "秒":"秒", - "添加一台新设备":"添加一台新设备", - "添加新设备":"添加新设备", - "网络未连接,请开启设备网络后重试":"网络未连接,请开启设备网络后重试", - "提交":"提交", - "发送验证码成功":"发送验证码成功", - "注册成功":"注册成功", - "再按一次退出程序":"再按一次退出程序成功", - "用户拒绝授权":"用户拒绝授权", - "用户取消授权":"用户取消授权", - "未命名":"未命名", - "编辑资料":"编辑资料", - "保存":"保存", - "点击更换头像":"点击更换头像", - "保存失败":"保存失败", - "昵称为空":"昵称为空", - "保存成功":"保存成功", - "请先登录":"请先登录", - "密码修改成功":"密码修改成功", - "未知数据":"-", - "必须登录提示":"请先登录!", - "输入验证码":"输入验证码", - "输入新密码":"输入新密码", - "确认验证码":"确认验证码", - "输入手机号码":"输入手机号码", - "操作成功":"操作成功", - "添加设备":"添加设备", - "扫描中":"扫描中...", - "检索设备":"检索设备", - "搜索":"搜索", - "匹配出的外围设备":"匹配出的外围设备", - "知道了":"知道了", - "蓝牙未开启":"蓝牙未开启", - "请先打开蓝牙在进行设备扫描":"请先打开蓝牙在进行设备扫描", - "等待扫描":"等待扫描", - "默认设备名称":"默认设备名称", - "连接异常":"连接异常", - "蓝牙绑定提示":"用手机进行设备添加时,请打开手机蓝牙搜索,靠近目标位置3米以内进行。", - "蓝牙连接成功":"蓝牙连接成功", - "蓝牙连接失败":"蓝牙连接失败,请重试", - "绑定失败请重试":"绑定失败请重试", - "无法绑定":"无法绑定!", - "无法绑定1":"检测到该设备", - "无法绑定2":"已被绑定", - "无法绑定3":",绑定前请先进行解绑,有疑问请联系客服", - "蓝牙绑定":{ - "标题":"蓝牙绑定", - "扫描":"扫描蓝牙设备中…", - "信号":"最小信号强度", - "搜索提示":"检索设备", - "搜索":"搜索", - "匹配":"匹配出的外围设备", - "信号强度":"信号强度", - "SN":"SN", - "蓝牙地址":"蓝牙地址", - "mac":"mac", - "网络":"网络", - "在线":"在线", - "离线":"离线", - "版本":"版本", - "默认设备名称":"未知设备", - "传感器":"传感器", - "可绑定":"可绑定", - "已被绑定":"已被绑定", - "双人版绑定标题":"该设备为双人版,请选择", - "绑定全部":"绑定全部", - "主设备":"主设备:", - "从设备":"从设备:", - "确定":"确定", - "取消":"取消", - "无法绑定":"无法绑定!", - "无法绑定1":"检测到该设备", - "无法绑定2":"已被绑定", - "无法绑定3":",绑定前请先进行解绑,有疑问请联系客服", - "知道了":"知道了", - "是":"是", - "否":"否", - "确定绑定提示":"确定绑定该设备吗?", - "连接成功":"蓝牙连接成功", - "连接异常":"蓝牙连接异常", - "连接":"连接", - "输入wifi密码":"请输入wifi密码", - "显示密码":"显示", - "不显示密码":"不显示" + "请输入手机号": "输入手机号码", + "请输入正确的手机号": "请输入正确的手机号", + "请输入密码": "请输入密码", + "密码格式提示": "1.密码长度必须至少8位\n2.密码需要字母加数字\n3.特殊字符和大写字母至少包含一个", + "请输入确认密码": "请输入确认密码", + "两次密码不一致": "两次密码不一致", + "请输入验证码": "请输入验证码", + "需要同意协议": "需要同意协议", + "请选择登录方式": "请选择登录方式", + "账户不能为空": "账户不能为空", + "密码不能为空": "密码不能为空", + "验证码不能为空": "验证码不能为空", + "密码登录": "密码登录", + "短信登录": "短信登录", + "获取验证码": "获取验证码", + "登录": "登录", + "找回密码": "找回密码", + "注册": "注册", + "我已阅读并同意": "我已阅读并同意", + "与": "与", + "《用户协议》": "《用户协议》", + "《隐私协议》": "《隐私协议》", + "注:首次登录会自动创建账号": "注:首次登录会自动创建账号", + "请输入新密码": "请输入新密码", + "确认新密码": "确认新密码", + "秒": "秒", + "添加一台新设备": "添加一台新设备", + "添加新设备": "添加新设备", + "网络未连接,请开启设备网络后重试": "网络未连接,请开启设备网络后重试", + "提交": "提交", + "发送验证码成功": "发送验证码成功", + "注册成功": "注册成功", + "再按一次退出程序": "再按一次退出程序成功", + "用户拒绝授权": "用户拒绝授权", + "用户取消授权": "用户取消授权", + "未命名": "未命名", + "编辑资料": "编辑资料", + "保存": "保存", + "点击更换头像": "点击更换头像", + "保存失败": "保存失败", + "昵称为空": "昵称为空", + "保存成功": "保存成功", + "请先登录": "请先登录", + "密码修改成功": "密码修改成功", + "未知数据": "-", + "必须登录提示": "请先登录!", + "输入验证码": "输入验证码", + "输入新密码": "输入新密码", + "确认验证码": "确认验证码", + "输入手机号码": "输入手机号码", + "操作成功": "操作成功", + "添加设备": "添加设备", + "扫描中": "扫描中...", + "检索设备": "检索设备", + "搜索": "搜索", + "匹配出的外围设备": "匹配出的外围设备", + "知道了": "知道了", + "蓝牙未开启": "蓝牙未开启", + "请先打开蓝牙在进行设备扫描": "请先打开蓝牙在进行设备扫描", + "等待扫描": "等待扫描", + "默认设备名称": "默认设备名称", + "连接异常": "连接异常", + "蓝牙绑定提示": "用手机进行设备添加时,请打开手机蓝牙搜索,靠近目标位置3米以内进行。", + "蓝牙连接成功": "蓝牙连接成功", + "蓝牙连接失败": "蓝牙连接失败,请重试", + "绑定失败请重试": "绑定失败请重试", + "无法绑定": "无法绑定!", + "无法绑定1": "检测到该设备", + "无法绑定2": "已被绑定", + "无法绑定3": ",绑定前请先进行解绑,有疑问请联系客服", + "蓝牙绑定": { + "标题": "蓝牙绑定", + "扫描": "扫描蓝牙设备中…", + "信号": "最小信号强度", + "搜索提示": "检索设备", + "搜索": "搜索", + "匹配": "匹配出的外围设备", + "信号强度": "信号强度", + "SN": "SN", + "蓝牙地址": "蓝牙地址", + "mac": "mac", + "网络": "网络", + "在线": "在线", + "离线": "离线", + "版本": "版本", + "默认设备名称": "未知设备", + "传感器": "传感器", + "可绑定": "可绑定", + "已被绑定": "已被绑定", + "双人版绑定标题": "该设备为双人版,请选择", + "绑定全部": "绑定全部", + "主设备": "主设备:", + "从设备": "从设备:", + "确定": "确定", + "取消": "取消", + "无法绑定": "无法绑定!", + "无法绑定1": "检测到该设备", + "无法绑定2": "已被绑定", + "无法绑定3": ",绑定前请先进行解绑,有疑问请联系客服", + "知道了": "知道了", + "是": "是", + "否": "否", + "确定绑定提示": "确定绑定该设备吗?", + "连接成功": "蓝牙连接成功", + "连接异常": "蓝牙连接异常", + "连接": "连接", + "输入wifi密码": "请输入wifi密码", + "显示密码": "显示", + "不显示密码": "不显示" }, - "wifi页":{ - "标题":"WIFI配置", - "跳过":"下一步", - "WLAN":"网络", - "未连接":"未连接", - "已连接":"已连接", - "可用WLAN":"可用WLAN", - "刷新":"刷新", - "密码为空":"密码不能为空", - "配网成功":"配网成功", - "配网失败":"配网失败", - "配网中":"配网中", - "需配网":"请给设备配置网络!" + "wifi页": { + "标题": "WIFI配置", + "跳过": "下一步", + "WLAN": "网络", + "未连接": "未连接", + "已连接": "已连接", + "可用WLAN": "可用WLAN", + "刷新": "刷新", + "密码为空": "密码不能为空", + "配网成功": "配网成功", + "配网失败": "配网失败", + "配网中": "配网中", + "需配网": "请给设备配置网络!" }, - "设备校准":"设备校准", - "离床校准":"离床校准", - "未完成":"未完成", - "已完成":"已完成", - "位置校准":"位置校准", - "床头":"床头", - "离床校准提示":"请校准人员暂时离开床铺且在校准期间保持周围安静", - "位置校准提示":"请校准人员到箭头指定一侧 平躺后点击开始,保持10秒", - "开始校准":"开始校准", - "校准完成":"校准完成!", - "绑定成功":{ - "标题":"绑定完成", - "绑定成功":"配置成功! ", - "分享标题":"是否进行分享?", - "分享内容":"设备绑定成功后,如需对朋友或家人共享我的睡眠情况,可以进行立即分享,分享成功后,对方即可享受查看该设备权限,可以收到该设备的睡眠报告。", - "立即分享":"立即分享", - "返回":"返回" + "设备校准": "设备校准", + "离床校准": "离床校准", + "未完成": "未完成", + "已完成": "已完成", + "位置校准": "位置校准", + "床头": "床头", + "离床校准提示": "请校准人员暂时离开床铺且在校准期间保持周围安静", + "位置校准提示": "请校准人员到箭头指定一侧 平躺后点击开始,保持10秒", + "开始校准": "开始校准", + "校准完成": "校准完成!", + "绑定成功": { + "标题": "绑定完成", + "绑定成功": "配置成功! ", + "分享标题": "是否进行分享?", + "分享内容": "设备绑定成功后,如需对朋友或家人共享我的睡眠情况,可以进行立即分享,分享成功后,对方即可享受查看该设备权限,可以收到该设备的睡眠报告。", + "立即分享": "立即分享", + "返回": "返回" }, - "设置页":{ - "标题":"设置", - "主题模式":"主题模式", - "选择语言":"选择语言", - "关于我们":"关于我们", - "用户协议":"用户协议", - "隐私协议":"隐私协议", - "退出登录":"退出登录", - "注销账号":"注销账号", - "退出成功":"退出成功", - "退出失败":"退出失败" + "设置页": { + "标题": "设置", + "主题模式": "主题模式", + "选择语言": "选择语言", + "关于我们": "关于我们", + "用户协议": "用户协议", + "隐私协议": "隐私协议", + "退出登录": "退出登录", + "注销账号": "注销账号", + "退出成功": "退出成功", + "退出失败": "退出失败" }, "操作成功": "操作成功", "关于我们": "关于我们", @@ -172,7 +172,38 @@ "隐私协议": "隐私协议", "退出登录": "退出登录", "注销账号": "注销账号", - "我的智能设备":"我的智能设备", + "我的智能设备": "我的智能设备", "解绑成功": "解绑成功", - "解绑失败": "解绑失败" + "解绑失败": "解绑失败", + "睡眠隐私": "睡眠隐私", + "睡眠隐私功能": "睡眠隐私功能", + "开始时间": "开始时间", + "结束时间": "结束时间", + "取消": "取消", + "确认": "确认", + "时": "时", + "分": "分", + "选择性别": "选择性别", + "*注:开启睡眠隐私功能后,在设置的时间段内,将不会采集您的睡眠数据。": "*注:开启睡眠隐私功能后,在设置时间段内,将不会采集您的睡眠数据。", + "柔性唤醒": "柔性唤醒", + "睡眠银色": "睡眠隐私", + "睡眠习惯": "睡眠习惯", + "允许对方查看设备": "允许对方查看设备", + "允许对方控制设备": "允许对方控制设备", + "已分享用户": "已分享用户", + "发送邀请": "发送邀请", + "仅允许对方查看该设备": "仅允许对方查看该设备", + "允许对方控制该设备": "允许对方控制该设备", + "点击复制APP下载链接": "点击复制APP下载链接", + "评价": "评价", + "我要评价": "我要评价", + "更新成功": "更新成功", + "更新失败": "更新失败", + "完成": "完成", + "请输入正确的联系人电话": "请输入正确的联系人电话", + "请选择体重": "请输入体重", + "请选择身高": "请输入身高", + "人员资料": "人员资料", + "请输入姓名": "请输入姓名" + } \ No newline at end of file diff --git a/lib/common/color/appConstants.dart b/lib/common/color/appConstants.dart index 60b737e..996e46e 100644 --- a/lib/common/color/appConstants.dart +++ b/lib/common/color/appConstants.dart @@ -3,7 +3,7 @@ import 'dart:ui'; import 'package:vbvs_app/common/util/FitTool.dart'; import 'package:vbvs_app/common/util/MyUtils.dart'; -class AppConstants { +class AppConstants { // App-related constants static const int code_time = 60; //验证码倒计时 static const int limit = 10; //分页数量 diff --git a/lib/controller/mh_controller/mhdevice_share_controller.g.dart b/lib/controller/mh_controller/mhdevice_share_controller.g.dart index 9da852a..4cceecd 100644 --- a/lib/controller/mh_controller/mhdevice_share_controller.g.dart +++ b/lib/controller/mh_controller/mhdevice_share_controller.g.dart @@ -12,6 +12,7 @@ MHDeviceShareModel _$MHDeviceShareModelFromJson(Map json) => ..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 json) => Map _$MHDeviceShareModelToJson(MHDeviceShareModel instance) => { - 'phone': instance.account, + 'account': instance.account, 'type': instance.type, 'msg': instance.msg, 'show': instance.show, + 'code': instance.code, 'limit': instance.limit, 'offset': instance.offset, 'isLoading': instance.isLoading, diff --git a/lib/controller/mh_controller/repair_list_controller.dart b/lib/controller/mh_controller/repair_list_controller.dart index 4661862..1d5f589 100644 --- a/lib/controller/mh_controller/repair_list_controller.dart +++ b/lib/controller/mh_controller/repair_list_controller.dart @@ -39,7 +39,7 @@ class RepairListController extends GetControllerEx { String serviceName = ServiceConstant.server_service; String serviceApi = ServiceConstant.submit_repair; String queryUrl = "${serviceAddress}${serviceName}${serviceApi}"; - requestWithLog( + await requestWithLog( logTitle: "查询报修数据", method: MyHttpMethod.get, queryUrl: queryUrl, diff --git a/lib/controller/mh_controller/repair_list_controller.g.dart b/lib/controller/mh_controller/repair_list_controller.g.dart index 0e260c6..274e511 100644 --- a/lib/controller/mh_controller/repair_list_controller.g.dart +++ b/lib/controller/mh_controller/repair_list_controller.g.dart @@ -12,9 +12,7 @@ RepairListModel _$RepairListModelFromJson(Map json) => ..offset = (json['offset'] as num).toInt() ..isLoading = json['isLoading'] as bool ..hasMore = json['hasMore'] as bool - ..repairList = (json['repairList'] as List) - .map((e) => ApplyRepairModel.fromJson(e as Map)) - .toList(); + ..repairList = json['repairList'] as List; Map _$RepairListModelToJson(RepairListModel instance) => { diff --git a/lib/main.dart b/lib/main.dart index 60faf3d..912d67f 100644 --- a/lib/main.dart +++ b/lib/main.dart @@ -194,8 +194,6 @@ void initEasyDartModule() { //初始化 } - - Future initLogin() async { // 初始化控制器 Get.put(UserInfoController()); @@ -358,6 +356,7 @@ class MyApp extends StatelessWidget { Get.lazyPut(() => MHTDeviceCalibrationController()), Get.lazyPut(() => SleepReportController()), Get.lazyPut(() => CalendarController()), + Get.lazyPut(() => UserPdfController()), Get.put(WebviewTestController()), ])); } diff --git a/lib/pages/common/selectDialog.dart b/lib/pages/common/selectDialog.dart index 52591c7..3284ddf 100644 --- a/lib/pages/common/selectDialog.dart +++ b/lib/pages/common/selectDialog.dart @@ -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)), ), diff --git a/lib/pages/mh_page/MattressControl.dart b/lib/pages/mh_page/MattressControl.dart index 74682fa..826a1de 100644 --- a/lib/pages/mh_page/MattressControl.dart +++ b/lib/pages/mh_page/MattressControl.dart @@ -17,35 +17,6 @@ class MattressControlPage extends StatefulWidget { class _MattressControlPageState extends State { 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,10 +109,10 @@ class _MattressControlPageState extends State { body: SafeArea( child: WebviewTestView( - // oncreate: (widget) { - // return WebviewTestController(); - // }, - ), + // oncreate: (widget) { + // return WebviewTestController(); + // }, + ), ), )))); } diff --git a/lib/pages/mh_page/ShareUserWidget.dart b/lib/pages/mh_page/ShareUserWidget.dart index 08f9ed8..c47fde7 100644 --- a/lib/pages/mh_page/ShareUserWidget.dart +++ b/lib/pages/mh_page/ShareUserWidget.dart @@ -78,9 +78,9 @@ class ShareUserWidget extends GetView { alignment: const AlignmentDirectional(-1, 0), child: Text( info['opType'] == 1 - ? '允许对方控制该设备' + ? '允许对方控制该设备'.tr : info['opType'] == 2 - ? '仅允许对方查看该设备' + ? '仅允许对方查看该设备'.tr : '', style: TextStyle( fontFamily: 'Readex Pro', diff --git a/lib/pages/mh_page/about_us.dart b/lib/pages/mh_page/about_us.dart new file mode 100644 index 0000000..c4e2d96 --- /dev/null +++ b/lib/pages/mh_page/about_us.dart @@ -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 createState() => _MhAboutUsPageState(); +} + +class _MhAboutUsPageState extends State { + @override + void initState() { + super.initState(); + // pdfController.loadPdf(); + + widget.webView = MyWebView( + url: AppConstants().ent_type == 1 + ? "https://mp.weixin.qq.com/s/IAr4RNBy0hGJXGKyMxe7eQ" + : "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: 20, + 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, + ), + ), + ]), + ), + ), + ), + ), + ), + ); + } +} diff --git a/lib/pages/mh_page/address_list_page.dart b/lib/pages/mh_page/address_list_page.dart index 191c1c2..0c07ab9 100644 --- a/lib/pages/mh_page/address_list_page.dart +++ b/lib/pages/mh_page/address_list_page.dart @@ -71,37 +71,76 @@ class AddressListPage extends GetView { 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) + // .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 { - // 如果地址列表不为空,显示地址列表 - 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) - .divide(const SizedBox(height: 10)) - .addToEnd(const SizedBox( - height: - AppConstants.list_end_height)), - )), - ), - ); - } + 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: ListView( + shrinkWrap: true, + 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)), + ), + ); }), Align( alignment: AlignmentDirectional(0, 1), diff --git a/lib/pages/mh_page/apply_repair_page.dart b/lib/pages/mh_page/apply_repair_page.dart index 8250901..7cbe9cf 100644 --- a/lib/pages/mh_page/apply_repair_page.dart +++ b/lib/pages/mh_page/apply_repair_page.dart @@ -1168,90 +1168,100 @@ class ApplyRepairPage extends GetView { 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( - letterSpacing: - 0, - color: Colors - .black, - fontSize: - 26.rpx), + style: + TextStyle( + fontFamily: + 'Readex Pro', + letterSpacing: + 0, + color: Colors + .black, + fontSize: + 26.rpx, + ), ), ), ), @@ -1324,90 +1334,100 @@ class ApplyRepairPage extends GetView { 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( - letterSpacing: - 0, - color: Colors - .black, - fontSize: - 26.rpx), + style: + TextStyle( + fontFamily: + 'Readex Pro', + letterSpacing: + 0, + color: Colors + .black, + fontSize: + 26.rpx, + ), ), ), ), diff --git a/lib/pages/mh_page/device_share_page.dart b/lib/pages/mh_page/device_share_page.dart index cdb0bf4..e720dea 100644 --- a/lib/pages/mh_page/device_share_page.dart +++ b/lib/pages/mh_page/device_share_page.dart @@ -4,16 +4,13 @@ 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/color/app_uri_status.dart'; -import 'package:vbvs_app/common/util/CommonVariables.dart'; import 'package:vbvs_app/common/util/FitTool.dart'; import 'package:vbvs_app/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/main_bottom/global_controller.dart'; import 'package:vbvs_app/controller/mh_controller/mhdevice_share_controller.dart'; import 'package:vbvs_app/model/api_response.dart'; -import 'package:vbvs_app/pages/mh_page/EmptyMessageWidget.dart'; import 'package:vbvs_app/pages/mh_page/ShareUserWidget.dart'; class ShareDeviceWidget extends GetView { @@ -216,125 +213,280 @@ class ShareDeviceWidget extends GetView { ), ), )), - Obx( - () => GestureDetector( - onTap: () { - // 当点击时,将 type 设置为 0(允许控制) - controller.model.type = 1; - controller.updateAll(); - }, - child: Container( - margin: EdgeInsets.only(top: 76.rpx), - 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( - '允许对方控制该设备', - style: TextStyle( - fontFamily: 'Readex Pro', - color: Colors.white, - fontSize: 26.rpx, - letterSpacing: 0.0, - ), + GestureDetector( + onTap: () { + // 当点击时,将 type 设置为 0(允许控制) + controller.model.type = 1; + controller.updateAll(); + }, + child: Container( + margin: EdgeInsets.only(top: 76.rpx), + 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), // 改变未选中状态边框颜色 + ), + 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: check + ? Center( + child: ClipOval( + child: Container( + width: h * 0.6, + height: h * 0.6, + color: const Color( + 0xFF6BFDAC), + ), + ), + ) + : null, + ), ), - child: Radio( - 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), // 缩小视觉密度 - )) - ], - ), + ), + ); + }), + ], ), ), ), - Obx( - () => GestureDetector( - onTap: () { - // 当点击时,将 type 设置为 1(仅允许查看) - 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( - '仅允许对方查看该设备', - style: TextStyle( - fontFamily: 'Readex Pro', - color: Colors.white, - fontSize: 26.rpx, - letterSpacing: 0.0, - ), + + // 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( + // // 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: () { + 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), // 改变未选中状态边框颜色 + ), + // ✅ 只包住响应式控件部分 + 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: check + ? Center( + child: ClipOval( + child: Container( + width: h * 0.6, + height: h * 0.6, + color: const Color( + 0xFF6BFDAC), + ), + ), + ) + : null, + ), ), - child: Radio( - 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), // 缩小视觉密度 - )) - ], - ), + ), + ); + }), + ], ), ), ), + Align( alignment: const AlignmentDirectional(0, 0), child: Padding( @@ -361,7 +513,7 @@ class ShareDeviceWidget extends GetView { .currentColor.sc9); } }, - text: '发送邀请', + text: '发送邀请'.tr, options: FFButtonOptions( height: 60.rpx, padding: @@ -404,7 +556,7 @@ class ShareDeviceWidget extends GetView { padding: const EdgeInsetsDirectional .fromSTEB(14, 0, 0, 16), child: Text( - '已分享用户', + '已分享用户'.tr, style: TextStyle( fontFamily: 'Readex Pro', color: Colors.white, diff --git a/lib/pages/mh_page/edit_address_page.dart b/lib/pages/mh_page/edit_address_page.dart index 2100c6e..09a6e24 100644 --- a/lib/pages/mh_page/edit_address_page.dart +++ b/lib/pages/mh_page/edit_address_page.dart @@ -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'; @@ -739,6 +740,158 @@ class EditAddressPage extends GetView ], ), ), + // 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,148 +900,71 @@ class EditAddressPage extends GetView 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, - textAlignVertical: - TextAlignVertical - .center, // 垂直居中 - decoration: InputDecoration( - contentPadding: EdgeInsets.symmetric( - vertical: - 25.rpx, - horizontal: + width: 100, + height: 100, + decoration: + BoxDecoration( + color: const Color( + 0xFFF3F5F6), + borderRadius: + BorderRadius + .circular( + 8), + ), + alignment: + Alignment + .center, + child: Obx(() { + return Row( + children: [ + Expanded( + child: + 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), + fontSize: 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, - ), - ); - })), + ), + )), + 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)), ), diff --git a/lib/pages/mh_page/edit_bed.dart b/lib/pages/mh_page/edit_bed.dart index 466f414..205e9cf 100644 --- a/lib/pages/mh_page/edit_bed.dart +++ b/lib/pages/mh_page/edit_bed.dart @@ -6,6 +6,7 @@ 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'; class EditBedPage extends StatefulWidget { final Map data; @@ -19,6 +20,7 @@ BoxConstraints? bodysize; class _EditBedPageState extends State { late Map editedData; late TextEditingController _nameController; //名称文本输入框 + DeviceListController deviceListController = Get.find(); @override void initState() { super.initState(); @@ -205,6 +207,7 @@ class _EditBedPageState extends State { onSuccess: (res) { TopSlideNotification.show(context, text: "修改名称成功".tr); + deviceListController.getDeviceList(); }, ); }, @@ -222,7 +225,7 @@ class _EditBedPageState extends State { decoration: BoxDecoration( borderRadius: BorderRadius.circular(6), ), - child: Text("完成", + child: Text("完成".tr, style: TextStyle( color: const Color(0xFF003058), fontSize: 26.rpx)), diff --git a/lib/pages/mh_page/experience_store_page.dart b/lib/pages/mh_page/experience_store_page.dart index f99f3bc..a3bb28c 100644 --- a/lib/pages/mh_page/experience_store_page.dart +++ b/lib/pages/mh_page/experience_store_page.dart @@ -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'; @@ -104,7 +105,9 @@ class _ExperienceStorePageState extends State { 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', diff --git a/lib/pages/mh_page/help/article.dart b/lib/pages/mh_page/help/article.dart index 2df7b39..66e6bd6 100644 --- a/lib/pages/mh_page/help/article.dart +++ b/lib/pages/mh_page/help/article.dart @@ -2,177 +2,116 @@ 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(); - get userInfoController => Get.find(); + @override + State createState() => _HelpArticleState(); +} - var isLike = 0.obs; - - // @override - // Widget build(BuildContext context) { - // String top_imgOrVideo = ""; - // if (article['imgOrVideo'] == 0) { - // top_imgOrVideo = - // ''''''; - // } else { - // top_imgOrVideo = - // ''''''; - // } - // String newText = article['text']; - - // RegExp(" d.group(1)) - // .toList() - // .forEach((d) { - // newText = newText.replaceAll("$d", getStorageResourceUrl("$d")); - // }); - - // String html = ''' - // - // - - // - // Test Page - // - // - - // - //
- // ${top_imgOrVideo} - //
- //
${article['title']}
- //
- //
${article['author']}
- //
${time_08_Formatter(article['created_at'])}
- //
- // ${newText} - //
- // - - // - // '''; - - // print("$html"); - // // articleController.readAdd(article['id']); - // String? uid = userInfoController.model.user?.uid; - // print("${userInfoController.model.user}"); - // // uid = "sss"; - // // if (uid != null) { - // // articleController.findIsLike(uid, article['id']).then((d) { - // // isLike.value = d; - // // }); - // // } - - // return LayoutBuilder( - // builder: (context, boxConstraints) => GestureDetector( - // onTap: () => FocusScope.of(context).unfocus(), - // child: Scaffold( - // appBar: AppBar( - // backgroundColor: AppColors.bg_color, - // automaticallyImplyLeading: false, - // iconTheme: IconThemeData(color: Colors.white), - // titleSpacing: 0, - // leading: returnIconButtom, - // ), - // body: SafeArea( - // top: true, - // child: Container( - // width: MediaQuery.sizeOf(context).width, - // height: MediaQuery.sizeOf(context).height, - // decoration: BoxDecoration( - // color: Colors.white, - // // color: AppColors.bg_color, - // // image: DecorationImage( - // // image: AssetImage("assets/images/background.png$test"), - // // fit: BoxFit.cover, - // // ), - // ), - // child: Column( - // children: [ - // Expanded( - // child: Container( - // // child: WebViewWidget( - // // controller: WebViewController() - // // ..setJavaScriptMode(JavaScriptMode.unrestricted) - // // ..loadHtmlString(html), - // // ), - // child: InAppWebView( - // initialData: - // InAppWebViewInitialData(data: html, encoding: ""), - // ), - // ), - // ), - // ], - // ), - // ), - // ), - // ), - // ), - // ); - // } +class _HelpArticleState extends State { + bool isLoading = true; + @override Widget build(BuildContext context) { - return Scaffold( - backgroundColor: const Color(0xFF042C46), - appBar: AppBar( - backgroundColor: const Color(0xFF042C46), - title: Text("问题与帮助", style: TextStyle(color: Colors.white)), - centerTitle: true, - leading: IconButton( - icon: Icon(Icons.arrow_back, color: Colors.white), - onPressed: () => Navigator.pop(context), + return Container( + decoration: const BoxDecoration( + image: DecorationImage( + image: AssetImage('assets/images/new_background.png'), // 本地图片 + fit: BoxFit.fill, // 填满整个 Container + ), ), - elevation: 0, - ), - body: Column( - children: [ - Container( - padding: const EdgeInsets.symmetric(horizontal: 16, vertical: 12), - alignment: Alignment.centerLeft, - child: Text( - article['title'], - style: const TextStyle( - color: Colors.white, - fontSize: 18, - fontWeight: FontWeight.bold), - ), - ), - Expanded( - child: InAppWebView( - initialData: InAppWebViewInitialData( - data: wrapHtml(article['content']), + child: Scaffold( + backgroundColor: Colors.transparent, + appBar: AppBar( + backgroundColor: Colors.transparent, + automaticallyImplyLeading: false, + iconTheme: IconThemeData(color: Colors.white), + 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: 20.rpx, + child: returnIconButtomNew, + ), + ], + ), ), + actions: [], + centerTitle: false, ), - ), - ], - ), - ); + body: Padding( + padding: EdgeInsets.only(left: 30.rpx, right: 30.rpx), + child: Column( + children: [ + 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(Colors.white), + ), + ), + ], + ), + ), + ], + ), + ))); } - /// 包装成完整 HTML 页面,添加适配样式 String wrapHtml(String htmlContent) { return """ @@ -182,11 +121,12 @@ class HelpArticle extends StatelessWidget {