修改选择器样式
This commit is contained in:
@@ -39,7 +39,7 @@ android {
|
|||||||
namespace = "com.taihe.vbvs_app"
|
namespace = "com.taihe.vbvs_app"
|
||||||
// compileSdk = flutter.compileSdkVersion
|
// compileSdk = flutter.compileSdkVersion
|
||||||
compileSdk = localProperties.getProperty('flutter.compileSdkVersion').toInteger()
|
compileSdk = localProperties.getProperty('flutter.compileSdkVersion').toInteger()
|
||||||
// ndkVersion = flutter.ndkVersion
|
|
||||||
ndkVersion = localProperties.getProperty('flutter.ndkVersion')
|
ndkVersion = localProperties.getProperty('flutter.ndkVersion')
|
||||||
|
|
||||||
// 编译的jvm版本
|
// 编译的jvm版本
|
||||||
@@ -93,7 +93,7 @@ android {
|
|||||||
}
|
}
|
||||||
debug {
|
debug {
|
||||||
debuggable true
|
debuggable true
|
||||||
signingConfig signingConfigs.release
|
// signingConfig signingConfigs.release
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
15
assets/langs/mh_zh_CN.json
Normal file
15
assets/langs/mh_zh_CN.json
Normal file
@@ -0,0 +1,15 @@
|
|||||||
|
{
|
||||||
|
"语言名称": "简体中文",
|
||||||
|
"菜单": {
|
||||||
|
"首页": "首页",
|
||||||
|
"报告": "报告",
|
||||||
|
"控制": "控制",
|
||||||
|
"我的": "我的"
|
||||||
|
},
|
||||||
|
"标题": {
|
||||||
|
"智能床名称": "智能床名称",
|
||||||
|
"设置": "设置",
|
||||||
|
"详情": "详情",
|
||||||
|
"人员资料": "人员资料"
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -1,7 +1,7 @@
|
|||||||
import 'package:ef/ef.dart';
|
import 'package:ef/ef.dart';
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
|
|
||||||
import '../../controller/mh/apply_repair_controller.dart';
|
import '../../controller/mh_controller/apply_repair_controller.dart';
|
||||||
|
|
||||||
|
|
||||||
class ImgPreviewDefaultWidget extends GetView {
|
class ImgPreviewDefaultWidget extends GetView {
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
import 'package:ef/ef.dart';
|
import 'package:ef/ef.dart';
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
import '../../common/color/appFontsize.dart';
|
import '../../common/color/appFontsize.dart';
|
||||||
import '../../controller/mh/apply_repair_controller.dart';
|
import '../../controller/mh_controller/apply_repair_controller.dart';
|
||||||
|
|
||||||
class ImgPreviewWidget extends GetView {
|
class ImgPreviewWidget extends GetView {
|
||||||
String imgUrl;
|
String imgUrl;
|
||||||
|
|||||||
@@ -2,8 +2,8 @@ import 'package:ef/ef.dart';
|
|||||||
import 'package:flutter_city_picker/model/address.dart';
|
import 'package:flutter_city_picker/model/address.dart';
|
||||||
import 'package:flutterflow_ui/flutterflow_ui.dart';
|
import 'package:flutterflow_ui/flutterflow_ui.dart';
|
||||||
import 'package:json_annotation/json_annotation.dart';
|
import 'package:json_annotation/json_annotation.dart';
|
||||||
import 'package:vbvs_app/controller/mh/user_data.dart';
|
import 'package:vbvs_app/controller/mh_controller/user_data.dart';
|
||||||
import 'package:vbvs_app/controller/mh/muser_info_controller.dart';
|
import 'package:vbvs_app/controller/mh_controller/muser_info_controller.dart';
|
||||||
|
|
||||||
part 'address_controller.g.dart';
|
part 'address_controller.g.dart';
|
||||||
|
|
||||||
149
lib/controller/mh_controller/find_password_controller.dart
Normal file
149
lib/controller/mh_controller/find_password_controller.dart
Normal file
@@ -0,0 +1,149 @@
|
|||||||
|
import 'package:ef/ef.dart';
|
||||||
|
import 'package:flutter/src/widgets/framework.dart';
|
||||||
|
import 'package:json_annotation/json_annotation.dart';
|
||||||
|
|
||||||
|
part 'find_password_controller.g.dart';
|
||||||
|
|
||||||
|
@JsonSerializable()
|
||||||
|
class FindPasswordModel {
|
||||||
|
String? phone; //手机号
|
||||||
|
String? code; //验证码
|
||||||
|
|
||||||
|
bool? register_agree; //注册协议
|
||||||
|
|
||||||
|
String? pd; //密码
|
||||||
|
String? confirm; //验证密码
|
||||||
|
bool? pdshow = true; //是否显示密码
|
||||||
|
bool? cpdshow = true; //是否显示密码
|
||||||
|
|
||||||
|
FindPasswordModel();
|
||||||
|
static FindPasswordModel fromJson(Map<String, dynamic> json) =>
|
||||||
|
_$FindPasswordModelFromJson(json);
|
||||||
|
Map<String, dynamic> toJson() => _$FindPasswordModelToJson(this);
|
||||||
|
}
|
||||||
|
|
||||||
|
class FindPasswordController extends GetControllerEx<FindPasswordModel> {
|
||||||
|
// final UserRepository repository = UserRepository();
|
||||||
|
FindPasswordController() {
|
||||||
|
attr = GetModel(FindPasswordModel()).obs;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Future<String> getCode(BuildContext context) async {
|
||||||
|
// String message = "";
|
||||||
|
// final MyDialogController myDialogController =
|
||||||
|
// Get.find<MyDialogController>();
|
||||||
|
// if (model.phone == null || model.phone!.isEmpty) {
|
||||||
|
// message = "请输入手机号";
|
||||||
|
// showToast(message);
|
||||||
|
// return message;
|
||||||
|
// }
|
||||||
|
// if (!MyUtils.isValidPhoneNumber(model.phone!)) {
|
||||||
|
// message = '请输入正确的手机号';
|
||||||
|
// showToast(message);
|
||||||
|
// return message;
|
||||||
|
// }
|
||||||
|
// message = await repository.sendResetCode(model.phone!);
|
||||||
|
// if (message.isNotEmpty) {
|
||||||
|
// showToast("发送验证码失败或已到限制数量,请稍候或一小时/一天后再试!");
|
||||||
|
// return message;
|
||||||
|
// } else {
|
||||||
|
// showToast("发送验证码成功!", color: color_success);
|
||||||
|
// }
|
||||||
|
// return '';
|
||||||
|
// }
|
||||||
|
|
||||||
|
// //确认验证码
|
||||||
|
// Future<String> confirmCode(BuildContext context) async {
|
||||||
|
// String message = "";
|
||||||
|
// final MyDialogController myDialogController =
|
||||||
|
// Get.find<MyDialogController>();
|
||||||
|
// if (model.phone == null || model.phone!.isEmpty) {
|
||||||
|
// message = "请输入手机号";
|
||||||
|
// showToast(message);
|
||||||
|
// return message;
|
||||||
|
// }
|
||||||
|
// if (!MyUtils.isValidPhoneNumber(model.phone!)) {
|
||||||
|
// message = '请输入正确的手机号';
|
||||||
|
// showToast(message);
|
||||||
|
// return message;
|
||||||
|
// }
|
||||||
|
// if (model.code == null || model.code!.isEmpty) {
|
||||||
|
// message = "请输入验证码";
|
||||||
|
// showToast(message);
|
||||||
|
// return message;
|
||||||
|
// }
|
||||||
|
// if (model.pd == null || model.pd!.isEmpty) {
|
||||||
|
// message = "请输入密码";
|
||||||
|
// showToast(message);
|
||||||
|
// return message;
|
||||||
|
// }
|
||||||
|
// // if (model.pd!.length < 8) {
|
||||||
|
// // message = "密码长度必须至少8位";
|
||||||
|
// // showToast(message);
|
||||||
|
// // return message;
|
||||||
|
// // }
|
||||||
|
// // bool hasUppercase = model.pd!.contains(RegExp(r'[A-Z]'));
|
||||||
|
// // bool hasLowercase = model.pd!.contains(RegExp(r'[a-z]'));
|
||||||
|
// // bool hasSpecialCharacters =
|
||||||
|
// // model.pd!.contains(RegExp(r'[!@#$%^&*(),.?":{}|<>]'));
|
||||||
|
// // if (!hasUppercase) {
|
||||||
|
// // message = "密码必须包含至少一个大写字母";
|
||||||
|
// // showToast(message);
|
||||||
|
// // return message;
|
||||||
|
// // }
|
||||||
|
|
||||||
|
// // if (!hasLowercase) {
|
||||||
|
// // message = "密码必须包含至少一个小写字母";
|
||||||
|
// // showToast(message);
|
||||||
|
// // return message;
|
||||||
|
// // }
|
||||||
|
|
||||||
|
// // if (!hasSpecialCharacters) {
|
||||||
|
// // message = "密码必须包含至少一个特殊字符";
|
||||||
|
// // showToast(message);
|
||||||
|
// // return message;
|
||||||
|
// // }
|
||||||
|
// String passwordMsg = "1.密码长度必须至少8位\n2.密码需要字母加数字\n3.特殊字符或大写字母至少包含一个";
|
||||||
|
// bool hasUppercase = model.pd!.contains(RegExp(r'[A-Z]'));
|
||||||
|
// bool hasDigit = model.pd!.contains(RegExp(r'[0-9]'));
|
||||||
|
// bool hasSpecialCharacters =
|
||||||
|
// model.pd!.contains(RegExp(r'[!@#$%^&*(),.?":{}|<>]'));
|
||||||
|
// bool hasLetter = model.pd!.contains(RegExp(r'[a-zA-Z]'));
|
||||||
|
|
||||||
|
// if (model.pd!.length < 8) {
|
||||||
|
// message = passwordMsg;
|
||||||
|
// showToast(message, closeTime: 5);
|
||||||
|
// return message;
|
||||||
|
// }
|
||||||
|
|
||||||
|
// if (!hasLetter || !hasDigit) {
|
||||||
|
// message = passwordMsg;
|
||||||
|
// showToast(message);
|
||||||
|
// return message;
|
||||||
|
// }
|
||||||
|
|
||||||
|
// if (!(hasSpecialCharacters || hasUppercase)) {
|
||||||
|
// message = passwordMsg;
|
||||||
|
// showToast(message);
|
||||||
|
// return message;
|
||||||
|
// }
|
||||||
|
|
||||||
|
// if (model.confirm == null || model.confirm!.isEmpty) {
|
||||||
|
// message = "请输入确认密码";
|
||||||
|
// showToast(message);
|
||||||
|
// return message;
|
||||||
|
// }
|
||||||
|
// if (model.pd != model.confirm) {
|
||||||
|
// message = "两次密码不一致";
|
||||||
|
// showToast(message);
|
||||||
|
// return message;
|
||||||
|
// }
|
||||||
|
// message =
|
||||||
|
// await repository.confirmCode(model.phone!, model.code!, model.pd!);
|
||||||
|
// if (message.isNotEmpty) {
|
||||||
|
// showToast("更新失败,请稍后再试");
|
||||||
|
// return message;
|
||||||
|
// }
|
||||||
|
// return '';
|
||||||
|
// }
|
||||||
|
}
|
||||||
28
lib/controller/mh_controller/find_password_controller.g.dart
Normal file
28
lib/controller/mh_controller/find_password_controller.g.dart
Normal file
@@ -0,0 +1,28 @@
|
|||||||
|
// GENERATED CODE - DO NOT MODIFY BY HAND
|
||||||
|
|
||||||
|
part of 'find_password_controller.dart';
|
||||||
|
|
||||||
|
// **************************************************************************
|
||||||
|
// JsonSerializableGenerator
|
||||||
|
// **************************************************************************
|
||||||
|
|
||||||
|
FindPasswordModel _$FindPasswordModelFromJson(Map<String, dynamic> json) =>
|
||||||
|
FindPasswordModel()
|
||||||
|
..phone = json['phone'] as String?
|
||||||
|
..code = json['code'] as String?
|
||||||
|
..register_agree = json['register_agree'] as bool?
|
||||||
|
..pd = json['pd'] as String?
|
||||||
|
..confirm = json['confirm'] as String?
|
||||||
|
..pdshow = json['pdshow'] as bool?
|
||||||
|
..cpdshow = json['cpdshow'] as bool?;
|
||||||
|
|
||||||
|
Map<String, dynamic> _$FindPasswordModelToJson(FindPasswordModel instance) =>
|
||||||
|
<String, dynamic>{
|
||||||
|
'phone': instance.phone,
|
||||||
|
'code': instance.code,
|
||||||
|
'register_agree': instance.register_agree,
|
||||||
|
'pd': instance.pd,
|
||||||
|
'confirm': instance.confirm,
|
||||||
|
'pdshow': instance.pdshow,
|
||||||
|
'cpdshow': instance.cpdshow,
|
||||||
|
};
|
||||||
@@ -6,7 +6,7 @@ import 'package:json_annotation/json_annotation.dart';
|
|||||||
|
|
||||||
import 'package:path/path.dart' as p;
|
import 'package:path/path.dart' as p;
|
||||||
|
|
||||||
import 'package:vbvs_app/controller/mh/user_data.dart';
|
import 'package:vbvs_app/controller/mh_controller/user_data.dart';
|
||||||
part 'muser_info_controller.g.dart';
|
part 'muser_info_controller.g.dart';
|
||||||
|
|
||||||
@JsonSerializable()
|
@JsonSerializable()
|
||||||
128
lib/controller/mh_controller/register_controller.dart
Normal file
128
lib/controller/mh_controller/register_controller.dart
Normal file
@@ -0,0 +1,128 @@
|
|||||||
|
import 'package:ef/ef.dart';
|
||||||
|
import 'package:flutter/src/widgets/framework.dart';
|
||||||
|
import 'package:json_annotation/json_annotation.dart';
|
||||||
|
|
||||||
|
part 'register_controller.g.dart';
|
||||||
|
|
||||||
|
@JsonSerializable()
|
||||||
|
class RegisterModel {
|
||||||
|
String? register_phone; //注册手机号
|
||||||
|
String? register_pd; //注册密码
|
||||||
|
String? register_confirm_pd; //注册确认密码
|
||||||
|
String? register_code; //注册验证码
|
||||||
|
|
||||||
|
bool? register_agree = false; //注册协议
|
||||||
|
|
||||||
|
bool? pdshow = true; //是否显示密码
|
||||||
|
bool? cpdshow = true; //是否显示密码
|
||||||
|
|
||||||
|
RegisterModel();
|
||||||
|
static RegisterModel fromJson(Map<String, dynamic> json) =>
|
||||||
|
_$RegisterModelFromJson(json);
|
||||||
|
Map<String, dynamic> toJson() => _$RegisterModelToJson(this);
|
||||||
|
}
|
||||||
|
|
||||||
|
class RegisterController extends GetControllerEx<RegisterModel> {
|
||||||
|
// final UserRepository repository = UserRepository();
|
||||||
|
RegisterController() {
|
||||||
|
attr = GetModel(RegisterModel()).obs;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Future<String> registerUser(BuildContext context) async {
|
||||||
|
// String message = "";
|
||||||
|
// final MyDialogController myDialogController =
|
||||||
|
// Get.find<MyDialogController>();
|
||||||
|
// if (model.register_phone == null || model.register_phone!.isEmpty) {
|
||||||
|
// message = "请输入手机号";
|
||||||
|
// showToast(message);
|
||||||
|
// return message;
|
||||||
|
// }
|
||||||
|
// if (!MyUtils.isValidPhoneNumber(model.register_phone!)) {
|
||||||
|
// message = '请输入正确的手机号';
|
||||||
|
// showToast(message);
|
||||||
|
// return message;
|
||||||
|
// }
|
||||||
|
// if (model.register_pd == null || model.register_pd!.isEmpty) {
|
||||||
|
// message = "请输入密码";
|
||||||
|
// showToast(message);
|
||||||
|
// return message;
|
||||||
|
// }
|
||||||
|
// String passwordMsg = "1.密码长度必须至少8位\n2.密码需要字母加数字\n3.特殊字符和大写字母至少包含一个";
|
||||||
|
// bool hasUppercase = model.register_pd!.contains(RegExp(r'[A-Z]'));
|
||||||
|
// bool hasDigit = model.register_pd!.contains(RegExp(r'[0-9]'));
|
||||||
|
// bool hasSpecialCharacters =
|
||||||
|
// model.register_pd!.contains(RegExp(r'[!@#$%^&*(),.?":{}|<>]'));
|
||||||
|
// bool hasLetter = model.register_pd!.contains(RegExp(r'[a-zA-Z]'));
|
||||||
|
|
||||||
|
// if (model.register_pd!.length < 8) {
|
||||||
|
// message = passwordMsg;
|
||||||
|
// showToast(message);
|
||||||
|
// return message;
|
||||||
|
// }
|
||||||
|
|
||||||
|
// if (!hasLetter || !hasDigit) {
|
||||||
|
// message = passwordMsg;
|
||||||
|
// showToast(message);
|
||||||
|
// return message;
|
||||||
|
// }
|
||||||
|
|
||||||
|
// if (!(hasSpecialCharacters || hasUppercase)) {
|
||||||
|
// message = passwordMsg;
|
||||||
|
// showToast(message);
|
||||||
|
// return message;
|
||||||
|
// }
|
||||||
|
// if (model.register_confirm_pd == null ||
|
||||||
|
// model.register_confirm_pd!.isEmpty) {
|
||||||
|
// message = "请输入确认密码";
|
||||||
|
// showToast(message);
|
||||||
|
// return message;
|
||||||
|
// }
|
||||||
|
// if (model.register_pd != model.register_confirm_pd) {
|
||||||
|
// message = "两次密码不一致";
|
||||||
|
// showToast(message);
|
||||||
|
// return message;
|
||||||
|
// }
|
||||||
|
// if (model.register_code == null || model.register_code!.isEmpty) {
|
||||||
|
// message = "请输入验证码";
|
||||||
|
// showToast(message);
|
||||||
|
// return message;
|
||||||
|
// }
|
||||||
|
// if (model.register_agree == null || model.register_agree != true) {
|
||||||
|
// message = "需要同意协议";
|
||||||
|
// showToast(message);
|
||||||
|
// return message;
|
||||||
|
// }
|
||||||
|
// message = await repository.createUser(
|
||||||
|
// model.register_pd!, model.register_phone!, model.register_code!);
|
||||||
|
// if (message.isNotEmpty) {
|
||||||
|
// showToast(message);
|
||||||
|
// return message;
|
||||||
|
// }
|
||||||
|
|
||||||
|
// return "";
|
||||||
|
// }
|
||||||
|
|
||||||
|
// Future<String> getCode(BuildContext context) async {
|
||||||
|
// String message = "";
|
||||||
|
// final MyDialogController myDialogController =
|
||||||
|
// Get.find<MyDialogController>();
|
||||||
|
// if (model.register_phone == null || model.register_phone!.isEmpty) {
|
||||||
|
// message = "请输入手机号";
|
||||||
|
// showToast(message);
|
||||||
|
// return message;
|
||||||
|
// }
|
||||||
|
// if (!MyUtils.isValidPhoneNumber(model.register_phone!)) {
|
||||||
|
// message = '请输入正确的手机号';
|
||||||
|
// showToast(message);
|
||||||
|
// return message;
|
||||||
|
// }
|
||||||
|
// message = await repository.sendRegisterCode(model.register_phone!);
|
||||||
|
// if (message.isNotEmpty) {
|
||||||
|
// showToast("发送失败,请稍后再试!");
|
||||||
|
// return "发送失败,请稍后再试!";
|
||||||
|
// } else {
|
||||||
|
// showToast("发送验证码成功!", color: color_success);
|
||||||
|
// }
|
||||||
|
// return '';
|
||||||
|
// }
|
||||||
|
}
|
||||||
28
lib/controller/mh_controller/register_controller.g.dart
Normal file
28
lib/controller/mh_controller/register_controller.g.dart
Normal file
@@ -0,0 +1,28 @@
|
|||||||
|
// GENERATED CODE - DO NOT MODIFY BY HAND
|
||||||
|
|
||||||
|
part of 'register_controller.dart';
|
||||||
|
|
||||||
|
// **************************************************************************
|
||||||
|
// JsonSerializableGenerator
|
||||||
|
// **************************************************************************
|
||||||
|
|
||||||
|
RegisterModel _$RegisterModelFromJson(Map<String, dynamic> json) =>
|
||||||
|
RegisterModel()
|
||||||
|
..register_phone = json['register_phone'] as String?
|
||||||
|
..register_pd = json['register_pd'] as String?
|
||||||
|
..register_confirm_pd = json['register_confirm_pd'] as String?
|
||||||
|
..register_code = json['register_code'] as String?
|
||||||
|
..register_agree = json['register_agree'] as bool?
|
||||||
|
..pdshow = json['pdshow'] as bool?
|
||||||
|
..cpdshow = json['cpdshow'] as bool?;
|
||||||
|
|
||||||
|
Map<String, dynamic> _$RegisterModelToJson(RegisterModel instance) =>
|
||||||
|
<String, dynamic>{
|
||||||
|
'register_phone': instance.register_phone,
|
||||||
|
'register_pd': instance.register_pd,
|
||||||
|
'register_confirm_pd': instance.register_confirm_pd,
|
||||||
|
'register_code': instance.register_code,
|
||||||
|
'register_agree': instance.register_agree,
|
||||||
|
'pdshow': instance.pdshow,
|
||||||
|
'cpdshow': instance.cpdshow,
|
||||||
|
};
|
||||||
@@ -1,7 +1,7 @@
|
|||||||
import 'package:ef/ef.dart';
|
import 'package:ef/ef.dart';
|
||||||
import 'package:json_annotation/json_annotation.dart';
|
import 'package:json_annotation/json_annotation.dart';
|
||||||
import 'package:vbvs_app/controller/mh/apply_repair_controller.dart';
|
import 'package:vbvs_app/controller/mh_controller/apply_repair_controller.dart';
|
||||||
import 'package:vbvs_app/controller/mh/repair_process.dart';
|
import 'package:vbvs_app/controller/mh_controller/repair_process.dart';
|
||||||
|
|
||||||
part 'repair_info_controller.g.dart';
|
part 'repair_info_controller.g.dart';
|
||||||
|
|
||||||
@@ -21,9 +21,9 @@ class RepairListModel {
|
|||||||
|
|
||||||
class RepairListController extends GetControllerEx<RepairListModel> {
|
class RepairListController extends GetControllerEx<RepairListModel> {
|
||||||
// RepairRepository repairRepository = RepairRepository();
|
// RepairRepository repairRepository = RepairRepository();
|
||||||
// RepairListController() {
|
RepairListController() {
|
||||||
// attr = GetModel(RepairListModel()).obs;
|
attr = GetModel(RepairListModel()).obs;
|
||||||
// }
|
}
|
||||||
|
|
||||||
// //初始化列表数据
|
// //初始化列表数据
|
||||||
// Future<void> initData() async {
|
// Future<void> initData() async {
|
||||||
@@ -52,32 +52,4 @@ class RepairListController extends GetControllerEx<RepairListModel> {
|
|||||||
// Future<String> addScore(int id, int score) async {
|
// Future<String> addScore(int id, int score) async {
|
||||||
// return await repairRepository.addScore(id, score);
|
// return await repairRepository.addScore(id, score);
|
||||||
// }
|
// }
|
||||||
@override
|
|
||||||
void onInit() {
|
|
||||||
super.onInit();
|
|
||||||
loadMockRepairList();
|
|
||||||
}
|
|
||||||
|
|
||||||
void loadMockRepairList() {
|
|
||||||
model.repairList = [
|
|
||||||
ApplyRepairModel()
|
|
||||||
..id = 1001
|
|
||||||
..device_category = '智能床垫 BY-H'
|
|
||||||
..status = '待维修'
|
|
||||||
..create_time = DateTime.now().subtract(Duration(days: 1))
|
|
||||||
..device_id = 'BYH-001',
|
|
||||||
ApplyRepairModel()
|
|
||||||
..id = 1002
|
|
||||||
..device_category = '智能床垫 BY-A'
|
|
||||||
..status = '维修中'
|
|
||||||
..create_time = DateTime.now().subtract(Duration(days: 2))
|
|
||||||
..device_id = 'BYA-002',
|
|
||||||
ApplyRepairModel()
|
|
||||||
..id = 1003
|
|
||||||
..device_category = '智能床垫 BY-C'
|
|
||||||
..status = '已完成'
|
|
||||||
..create_time = DateTime.now().subtract(Duration(days: 3))
|
|
||||||
..device_id = 'BYC-003',
|
|
||||||
];
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
@@ -1,195 +1,9 @@
|
|||||||
// import 'dart:async';
|
|
||||||
// import 'package:EasyDartModule/EasyDartModule.dart';
|
|
||||||
// import 'package:ef/ef.dart';
|
|
||||||
// import 'package:geocoding/geocoding.dart';
|
|
||||||
// import 'package:geolocator/geolocator.dart';
|
|
||||||
// import 'package:json_annotation/json_annotation.dart';
|
|
||||||
// import 'package:vbvs_app/common/util/CommonVariables.dart';
|
|
||||||
// import 'package:vbvs_app/common/util/MyUtils.dart';
|
|
||||||
// import 'package:vbvs_app/controller/setting/language/language_controller.dart';
|
|
||||||
// import 'package:weather/weather.dart';
|
|
||||||
|
|
||||||
// part 'weather_controller.g.dart';
|
|
||||||
|
|
||||||
// @JsonSerializable()
|
|
||||||
// class WeatherModel {
|
|
||||||
// double? longitude; //经度
|
|
||||||
// double? latitude; //纬度
|
|
||||||
// String? weather_info = ''; //天气
|
|
||||||
// int? current_temperature; //温度
|
|
||||||
// int? min_temperature; //温度
|
|
||||||
// int? max_temperature; //温度
|
|
||||||
// String? wind_direction; //风向
|
|
||||||
// int? wind_speed; //风速等级
|
|
||||||
// String? cityName; // 新增城市名字段
|
|
||||||
// String? weatherIcon; // 新增天气图标字段
|
|
||||||
// String? weatherIconurl; // 新增天气图标字段
|
|
||||||
|
|
||||||
// WeatherModel();
|
|
||||||
// static WeatherModel fromJson(Map<String, dynamic> json) =>
|
|
||||||
// _$WeatherModelFromJson(json);
|
|
||||||
// Map<String, dynamic> toJson() => _$WeatherModelToJson(this);
|
|
||||||
// }
|
|
||||||
|
|
||||||
// class WeatherModelController extends GetControllerEx<WeatherModel> {
|
|
||||||
// LanguageController languageController = Get.find();
|
|
||||||
// WeatherModelController() {
|
|
||||||
// attr = GetModel(WeatherModel()).obs;
|
|
||||||
// weatherFactory = WeatherFactory(CommonVariables.weather_apiKey,
|
|
||||||
// language: Language.CHINESE_SIMPLIFIED);
|
|
||||||
// }
|
|
||||||
|
|
||||||
// Timer? _timer;
|
|
||||||
|
|
||||||
// late WeatherFactory weatherFactory;
|
|
||||||
|
|
||||||
// @override
|
|
||||||
// Future<void> onInit() async {
|
|
||||||
// super.onInit();
|
|
||||||
// await _getCurrentLocationAndWeather();
|
|
||||||
// // 启动定时器,每5秒执行一次 getCurrentWeather 方法
|
|
||||||
// _timer = Timer.periodic(Duration(seconds: 5), (timer) {
|
|
||||||
// _getCurrentLocationAndWeather();
|
|
||||||
// });
|
|
||||||
// }
|
|
||||||
|
|
||||||
// @override
|
|
||||||
// void onClose() {
|
|
||||||
// // 取消定时器
|
|
||||||
// _timer?.cancel();
|
|
||||||
// super.onClose();
|
|
||||||
// }
|
|
||||||
|
|
||||||
// Future<void> _getCurrentLocationAndWeather() async {
|
|
||||||
// try {
|
|
||||||
// Position position = await _determinePosition();
|
|
||||||
|
|
||||||
// String? language = "zh_CN";
|
|
||||||
// if (languageController.selectLanguage != null) {
|
|
||||||
// language = languageController.selectLanguage.value!.language_code;
|
|
||||||
// }
|
|
||||||
// List<Placemark> placemarks = await placemarkFromCoordinates(
|
|
||||||
// position.latitude, position.longitude,
|
|
||||||
// localeIdentifier: "${language}");
|
|
||||||
// if (placemarks.isNotEmpty) {
|
|
||||||
// model.cityName = placemarks[0].locality ?? "未知数据".tr;
|
|
||||||
// }
|
|
||||||
// getCurrentWeather(position.latitude, position.longitude);
|
|
||||||
// } catch (e) {
|
|
||||||
// print(e);
|
|
||||||
// EasyDartModule.logger.error("获取位置和天气失败: $e");
|
|
||||||
// }
|
|
||||||
// }
|
|
||||||
|
|
||||||
// Future<Position> _determinePosition() async {
|
|
||||||
// bool serviceEnabled;
|
|
||||||
// LocationPermission permission;
|
|
||||||
|
|
||||||
// // 检查位置服务是否启用
|
|
||||||
// serviceEnabled = await Geolocator.isLocationServiceEnabled();
|
|
||||||
// if (!serviceEnabled) {
|
|
||||||
// // 位置服务未启用,返回默认位置
|
|
||||||
// return Future.error('Location services are disabled.');
|
|
||||||
// }
|
|
||||||
|
|
||||||
// permission = await Geolocator.checkPermission();
|
|
||||||
// if (permission == LocationPermission.denied) {
|
|
||||||
// permission = await Geolocator.requestPermission();
|
|
||||||
// if (permission == LocationPermission.denied) {
|
|
||||||
// // 权限被拒绝,返回默认位置
|
|
||||||
// return Future.error('Location permissions are denied');
|
|
||||||
// }
|
|
||||||
// }
|
|
||||||
|
|
||||||
// if (permission == LocationPermission.deniedForever) {
|
|
||||||
// // 权限被永久拒绝,返回默认位置
|
|
||||||
// return Future.error(
|
|
||||||
// 'Location permissions are permanently denied, we cannot request permissions.');
|
|
||||||
// }
|
|
||||||
|
|
||||||
// // 获取当前位置
|
|
||||||
// return await Geolocator.getCurrentPosition();
|
|
||||||
// }
|
|
||||||
|
|
||||||
// Future<Weather> getCurrentWeather(
|
|
||||||
// double latitude,
|
|
||||||
// double longitude,
|
|
||||||
// ) async {
|
|
||||||
// try {
|
|
||||||
// weatherFactory.language = Language.CHINESE_SIMPLIFIED;
|
|
||||||
// String? language = "zh_CN";
|
|
||||||
// if (languageController.selectLanguage != null) {
|
|
||||||
// language = languageController.selectLanguage.value!.language_code;
|
|
||||||
// }
|
|
||||||
// if (language == "zh_CN") {
|
|
||||||
// weatherFactory.language = Language.CHINESE_SIMPLIFIED;
|
|
||||||
// } else {
|
|
||||||
// weatherFactory.language = Language.ENGLISH;
|
|
||||||
// }
|
|
||||||
// Weather weather =
|
|
||||||
// await weatherFactory.currentWeatherByLocation(latitude, longitude);
|
|
||||||
// model.weather_info = weather.weatherDescription;
|
|
||||||
// model.min_temperature = weather.tempMin?.celsius?.toInt();
|
|
||||||
// model.max_temperature = weather.tempMax?.celsius?.toInt();
|
|
||||||
// model.current_temperature = weather.temperature?.celsius?.toInt();
|
|
||||||
// model.wind_speed = weather.windSpeed?.toInt();
|
|
||||||
// model.weatherIcon = weather.weatherIcon;
|
|
||||||
// if (model.weatherIcon != null) {
|
|
||||||
// model.weatherIconurl =
|
|
||||||
// "https://openweathermap.org/img/w/${model.weatherIcon}.png";
|
|
||||||
// }
|
|
||||||
|
|
||||||
// // model.wind_direction = getDirectionByDegree(weather.windDegree);
|
|
||||||
// updateAll();
|
|
||||||
// return weather;
|
|
||||||
// } catch (e) {
|
|
||||||
// print('Error: $e');
|
|
||||||
// rethrow;
|
|
||||||
// }
|
|
||||||
// }
|
|
||||||
|
|
||||||
// Future<List<Weather>> getWeatherForecast(
|
|
||||||
// double latitude, double longitude) async {
|
|
||||||
// try {
|
|
||||||
// return await weatherFactory.fiveDayForecastByLocation(
|
|
||||||
// latitude, longitude);
|
|
||||||
// } catch (e) {
|
|
||||||
// print('Error: $e');
|
|
||||||
// rethrow;
|
|
||||||
// }
|
|
||||||
// }
|
|
||||||
|
|
||||||
// String? getDirectionByDegree(double? windDegree) {
|
|
||||||
// if (windDegree == null) return null;
|
|
||||||
|
|
||||||
// if (windDegree >= 337.5 || windDegree < 22.5) {
|
|
||||||
// return '主页.天气.方向.北'.tr + '主页.天气.方向.单位'.tr;
|
|
||||||
// } else if (windDegree >= 22.5 && windDegree < 67.5) {
|
|
||||||
// return '主页.天气.方向.东北'.tr + '主页.天气.方向.单位'.tr;
|
|
||||||
// } else if (windDegree >= 67.5 && windDegree < 112.5) {
|
|
||||||
// return '主页.天气.方向.东'.tr + '主页.天气.方向.单位'.tr;
|
|
||||||
// } else if (windDegree >= 112.5 && windDegree < 157.5) {
|
|
||||||
// return '主页.天气.方向.东南'.tr + '主页.天气.方向.单位'.tr;
|
|
||||||
// } else if (windDegree >= 157.5 && windDegree < 202.5) {
|
|
||||||
// return '主页.天气.方向.南'.tr + '主页.天气.方向.单位'.tr;
|
|
||||||
// } else if (windDegree >= 202.5 && windDegree < 247.5) {
|
|
||||||
// return '主页.天气.方向.西南'.tr + '主页.天气.方向.单位'.tr;
|
|
||||||
// } else if (windDegree >= 247.5 && windDegree < 292.5) {
|
|
||||||
// return '主页.天气.方向.西'.tr + '主页.天气.方向.单位'.tr;
|
|
||||||
// } else if (windDegree >= 292.5 && windDegree < 337.5) {
|
|
||||||
// return '主页.天气.方向.西北'.tr + '主页.天气.方向.单位'.tr;
|
|
||||||
// } else {
|
|
||||||
// return null;
|
|
||||||
// }
|
|
||||||
// }
|
|
||||||
// }
|
|
||||||
|
|
||||||
import 'dart:async';
|
import 'dart:async';
|
||||||
|
|
||||||
import 'package:EasyDartModule/EasyDartModule.dart';
|
import 'package:EasyDartModule/EasyDartModule.dart';
|
||||||
import 'package:ef/ef.dart';
|
import 'package:ef/ef.dart';
|
||||||
import 'package:geocoding/geocoding.dart';
|
// import 'package:geocoding/geocoding.dart';
|
||||||
import 'package:geolocator/geolocator.dart';
|
// import 'package:geolocator/geolocator.dart';
|
||||||
import 'package:json_annotation/json_annotation.dart';
|
import 'package:json_annotation/json_annotation.dart';
|
||||||
import 'package:vbvs_app/common/util/CommonVariables.dart';
|
import 'package:vbvs_app/common/util/CommonVariables.dart';
|
||||||
import 'package:vbvs_app/controller/setting/language/language_controller.dart';
|
import 'package:vbvs_app/controller/setting/language/language_controller.dart';
|
||||||
@@ -223,148 +37,148 @@ class WeatherModelController extends GetControllerEx<WeatherModel> {
|
|||||||
LanguageController languageController = Get.find();
|
LanguageController languageController = Get.find();
|
||||||
WeatherModelController() {
|
WeatherModelController() {
|
||||||
attr = GetModel(WeatherModel()).obs;
|
attr = GetModel(WeatherModel()).obs;
|
||||||
weatherFactory = WeatherFactory(CommonVariables.weather_apiKey,
|
// weatherFactory = WeatherFactory(CommonVariables.weather_apiKey,
|
||||||
language: Language.CHINESE_SIMPLIFIED);
|
// language: Language.CHINESE_SIMPLIFIED);
|
||||||
}
|
}
|
||||||
|
|
||||||
Timer? _weatherTimer;
|
// Timer? _weatherTimer;
|
||||||
Timer? _locationTimer;
|
// Timer? _locationTimer;
|
||||||
|
|
||||||
late WeatherFactory weatherFactory;
|
// late WeatherFactory weatherFactory;
|
||||||
|
|
||||||
@override
|
// @override
|
||||||
Future<void> onInit() async {
|
// Future<void> onInit() async {
|
||||||
super.onInit();
|
// super.onInit();
|
||||||
await _getCurrentLocation();
|
// await _getCurrentLocation();
|
||||||
_weatherTimer = Timer.periodic(Duration(seconds: 5), (timer) {
|
// _weatherTimer = Timer.periodic(Duration(seconds: 5), (timer) {
|
||||||
_getCurrentWeather(); // 每 5 秒更新一次天气
|
// _getCurrentWeather(); // 每 5 秒更新一次天气
|
||||||
});
|
// });
|
||||||
|
|
||||||
_locationTimer = Timer.periodic(Duration(minutes: 10), (timer) {
|
// _locationTimer = Timer.periodic(Duration(minutes: 10), (timer) {
|
||||||
_getCurrentLocation(); // 每 10 分钟更新一次位置
|
// _getCurrentLocation(); // 每 10 分钟更新一次位置
|
||||||
});
|
// });
|
||||||
}
|
// }
|
||||||
|
|
||||||
@override
|
// @override
|
||||||
void onClose() {
|
// void onClose() {
|
||||||
_weatherTimer?.cancel(); // 取消天气更新定时器
|
// _weatherTimer?.cancel(); // 取消天气更新定时器
|
||||||
_locationTimer?.cancel(); // 取消位置更新定时器
|
// _locationTimer?.cancel(); // 取消位置更新定时器
|
||||||
super.onClose();
|
// super.onClose();
|
||||||
}
|
// }
|
||||||
|
|
||||||
// 获取当前位置并存储到 model
|
// // 获取当前位置并存储到 model
|
||||||
Future<void> _getCurrentLocation() async {
|
// Future<void> _getCurrentLocation() async {
|
||||||
try {
|
// try {
|
||||||
Position position = await _determinePosition();
|
// Position position = await _determinePosition();
|
||||||
if (position == null) {
|
// if (position == null) {
|
||||||
throw Exception("获取位置失败");
|
// throw Exception("获取位置失败");
|
||||||
}
|
// }
|
||||||
|
|
||||||
String? language = "zh_CN";
|
// String? language = "zh_CN";
|
||||||
if (languageController.selectLanguage != null) {
|
// if (languageController.selectLanguage != null) {
|
||||||
language = languageController.selectLanguage.value!.language_code;
|
// language = languageController.selectLanguage.value!.language_code;
|
||||||
}
|
// }
|
||||||
List<Placemark> placemarks = await placemarkFromCoordinates(
|
// List<Placemark> placemarks = await placemarkFromCoordinates(
|
||||||
position.latitude, position.longitude,
|
// position.latitude, position.longitude,
|
||||||
localeIdentifier: language);
|
// localeIdentifier: language);
|
||||||
|
|
||||||
if (placemarks.isNotEmpty) {
|
// if (placemarks.isNotEmpty) {
|
||||||
model.cityName = placemarks[0].locality ?? "未知数据".tr;
|
// model.cityName = placemarks[0].locality ?? "未知数据".tr;
|
||||||
model.latitude = position.latitude;
|
// model.latitude = position.latitude;
|
||||||
model.longitude = position.longitude;
|
// model.longitude = position.longitude;
|
||||||
}
|
// }
|
||||||
|
|
||||||
// 调用获取天气方法
|
// // 调用获取天气方法
|
||||||
_getCurrentWeather();
|
// _getCurrentWeather();
|
||||||
} catch (e) {
|
// } catch (e) {
|
||||||
print(e);
|
// print(e);
|
||||||
EasyDartModule.logger.error("获取位置失败: $e");
|
// EasyDartModule.logger.error("获取位置失败: $e");
|
||||||
}
|
// }
|
||||||
}
|
// }
|
||||||
|
|
||||||
// 获取当前位置
|
// // 获取当前位置
|
||||||
Future<Position> _determinePosition() async {
|
// Future<Position> _determinePosition() async {
|
||||||
bool serviceEnabled;
|
// bool serviceEnabled;
|
||||||
LocationPermission permission;
|
// LocationPermission permission;
|
||||||
|
|
||||||
serviceEnabled = await Geolocator.isLocationServiceEnabled();
|
// serviceEnabled = await Geolocator.isLocationServiceEnabled();
|
||||||
if (!serviceEnabled) {
|
// if (!serviceEnabled) {
|
||||||
return Future.error('位置服务未启用');
|
// return Future.error('位置服务未启用');
|
||||||
}
|
// }
|
||||||
|
|
||||||
permission = await Geolocator.checkPermission();
|
// permission = await Geolocator.checkPermission();
|
||||||
if (permission == LocationPermission.denied) {
|
// if (permission == LocationPermission.denied) {
|
||||||
permission = await Geolocator.requestPermission();
|
// permission = await Geolocator.requestPermission();
|
||||||
if (permission == LocationPermission.denied) {
|
// if (permission == LocationPermission.denied) {
|
||||||
return Future.error('位置权限被拒绝');
|
// return Future.error('位置权限被拒绝');
|
||||||
}
|
// }
|
||||||
}
|
// }
|
||||||
|
|
||||||
if (permission == LocationPermission.deniedForever) {
|
// if (permission == LocationPermission.deniedForever) {
|
||||||
return Future.error('位置权限被永久拒绝');
|
// return Future.error('位置权限被永久拒绝');
|
||||||
}
|
// }
|
||||||
|
|
||||||
return await Geolocator.getCurrentPosition();
|
// return await Geolocator.getCurrentPosition();
|
||||||
}
|
// }
|
||||||
|
|
||||||
// 获取天气信息
|
// // 获取天气信息
|
||||||
Future<void> _getCurrentWeather() async {
|
// Future<void> _getCurrentWeather() async {
|
||||||
if (model.latitude == null || model.longitude == null) {
|
// if (model.latitude == null || model.longitude == null) {
|
||||||
EasyDartModule.logger.error("获取天气失败:位置数据获取失败");
|
// EasyDartModule.logger.error("获取天气失败:位置数据获取失败");
|
||||||
return; // 如果位置数据没有获取到,则不更新天气
|
// return; // 如果位置数据没有获取到,则不更新天气
|
||||||
}
|
// }
|
||||||
String? language = "zh_CN";
|
// String? language = "zh_CN";
|
||||||
if (languageController.selectLanguage != null) {
|
// if (languageController.selectLanguage != null) {
|
||||||
language = languageController.selectLanguage.value!.language_code;
|
// language = languageController.selectLanguage.value!.language_code;
|
||||||
}
|
// }
|
||||||
List<Placemark> placemarks = await placemarkFromCoordinates(
|
// List<Placemark> placemarks = await placemarkFromCoordinates(
|
||||||
model.latitude!, model.longitude!,
|
// model.latitude!, model.longitude!,
|
||||||
localeIdentifier: language);
|
// localeIdentifier: language);
|
||||||
|
|
||||||
if (placemarks.isNotEmpty) {
|
// if (placemarks.isNotEmpty) {
|
||||||
model.cityName = placemarks[0].locality ?? "未知数据".tr;
|
// model.cityName = placemarks[0].locality ?? "未知数据".tr;
|
||||||
}
|
// }
|
||||||
|
|
||||||
try {
|
// try {
|
||||||
weatherFactory.language = Language.CHINESE_SIMPLIFIED;
|
// weatherFactory.language = Language.CHINESE_SIMPLIFIED;
|
||||||
String? language = "zh_CN";
|
// String? language = "zh_CN";
|
||||||
if (languageController.selectLanguage != null) {
|
// if (languageController.selectLanguage != null) {
|
||||||
language = languageController.selectLanguage.value!.language_code;
|
// language = languageController.selectLanguage.value!.language_code;
|
||||||
}
|
// }
|
||||||
if (language == "zh_CN") {
|
// if (language == "zh_CN") {
|
||||||
weatherFactory.language = Language.CHINESE_SIMPLIFIED;
|
// weatherFactory.language = Language.CHINESE_SIMPLIFIED;
|
||||||
} else {
|
// } else {
|
||||||
weatherFactory.language = Language.ENGLISH;
|
// weatherFactory.language = Language.ENGLISH;
|
||||||
}
|
// }
|
||||||
Weather weather = await weatherFactory.currentWeatherByLocation(
|
// Weather weather = await weatherFactory.currentWeatherByLocation(
|
||||||
model.latitude!, model.longitude!);
|
// model.latitude!, model.longitude!);
|
||||||
|
|
||||||
model.weather_info = weather.weatherDescription;
|
// model.weather_info = weather.weatherDescription;
|
||||||
model.min_temperature = weather.tempMin?.celsius?.toInt();
|
// model.min_temperature = weather.tempMin?.celsius?.toInt();
|
||||||
model.max_temperature = weather.tempMax?.celsius?.toInt();
|
// model.max_temperature = weather.tempMax?.celsius?.toInt();
|
||||||
model.current_temperature = weather.temperature?.celsius?.toInt();
|
// model.current_temperature = weather.temperature?.celsius?.toInt();
|
||||||
model.wind_speed = weather.windSpeed?.toInt();
|
// model.wind_speed = weather.windSpeed?.toInt();
|
||||||
model.weatherIcon = weather.weatherIcon;
|
// model.weatherIcon = weather.weatherIcon;
|
||||||
if (model.weatherIcon != null) {
|
// if (model.weatherIcon != null) {
|
||||||
model.weatherIconurl =
|
// model.weatherIconurl =
|
||||||
"https://openweathermap.org/img/w/${model.weatherIcon}.png";
|
// "https://openweathermap.org/img/w/${model.weatherIcon}.png";
|
||||||
}
|
// }
|
||||||
updateAll(); // 更新 UI
|
// updateAll(); // 更新 UI
|
||||||
} catch (e) {
|
// } catch (e) {
|
||||||
EasyDartModule.logger.error("获取天气失败: $e");
|
// EasyDartModule.logger.error("获取天气失败: $e");
|
||||||
print('获取天气失败: $e');
|
// print('获取天气失败: $e');
|
||||||
}
|
// }
|
||||||
}
|
// }
|
||||||
|
|
||||||
// 获取 5 天天气预报
|
// // 获取 5 天天气预报
|
||||||
Future<List<Weather>> getWeatherForecast(
|
// Future<List<Weather>> getWeatherForecast(
|
||||||
double latitude, double longitude) async {
|
// double latitude, double longitude) async {
|
||||||
try {
|
// try {
|
||||||
return await weatherFactory.fiveDayForecastByLocation(
|
// return await weatherFactory.fiveDayForecastByLocation(
|
||||||
latitude, longitude);
|
// latitude, longitude);
|
||||||
} catch (e) {
|
// } catch (e) {
|
||||||
print('获取天气预报失败: $e');
|
// print('获取天气预报失败: $e');
|
||||||
rethrow;
|
// rethrow;
|
||||||
}
|
// }
|
||||||
}
|
// }
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -33,20 +33,22 @@ import 'package:vbvs_app/controller/message/common_message_setting_controller.da
|
|||||||
import 'package:vbvs_app/controller/message/message_controller.dart';
|
import 'package:vbvs_app/controller/message/message_controller.dart';
|
||||||
import 'package:vbvs_app/controller/message/message_review_controller.dart';
|
import 'package:vbvs_app/controller/message/message_review_controller.dart';
|
||||||
import 'package:vbvs_app/controller/message/message_setting_controller.dart';
|
import 'package:vbvs_app/controller/message/message_setting_controller.dart';
|
||||||
import 'package:vbvs_app/controller/mh/address_controller.dart';
|
import 'package:vbvs_app/controller/mh_controller/address_controller.dart';
|
||||||
import 'package:vbvs_app/controller/mh/address_list_controller.dart';
|
import 'package:vbvs_app/controller/mh_controller/address_list_controller.dart';
|
||||||
import 'package:vbvs_app/controller/mh/book_info_controller.dart';
|
import 'package:vbvs_app/controller/mh_controller/book_info_controller.dart';
|
||||||
import 'package:vbvs_app/controller/mh/experience_store_list_page.dart';
|
import 'package:vbvs_app/controller/mh_controller/experience_store_list_page.dart';
|
||||||
import 'package:vbvs_app/controller/mh/issue_controller.dart';
|
import 'package:vbvs_app/controller/mh_controller/find_password_controller.dart';
|
||||||
import 'package:vbvs_app/controller/mh/issue_preview_controller.dart';
|
import 'package:vbvs_app/controller/mh_controller/issue_controller.dart';
|
||||||
import 'package:vbvs_app/controller/mh/message_controller.dart';
|
import 'package:vbvs_app/controller/mh_controller/issue_preview_controller.dart';
|
||||||
import 'package:vbvs_app/controller/mh/muser_info_controller.dart';
|
import 'package:vbvs_app/controller/mh_controller/message_controller.dart';
|
||||||
import 'package:vbvs_app/controller/mh/my_experience_list_controller.dart';
|
import 'package:vbvs_app/controller/mh_controller/muser_info_controller.dart';
|
||||||
import 'package:vbvs_app/controller/mh/people_info_controller.dart';
|
import 'package:vbvs_app/controller/mh_controller/my_experience_list_controller.dart';
|
||||||
import 'package:vbvs_app/controller/mh/repair_info_controller.dart';
|
import 'package:vbvs_app/controller/mh_controller/people_info_controller.dart';
|
||||||
import 'package:vbvs_app/controller/mh/repair_list_controller.dart';
|
import 'package:vbvs_app/controller/mh_controller/register_controller.dart';
|
||||||
import 'package:vbvs_app/controller/mh/score_controller.dart';
|
import 'package:vbvs_app/controller/mh_controller/repair_info_controller.dart';
|
||||||
import 'package:vbvs_app/controller/mh/sleeping_habit_controller.dart';
|
import 'package:vbvs_app/controller/mh_controller/repair_list_controller.dart';
|
||||||
|
import 'package:vbvs_app/controller/mh_controller/score_controller.dart';
|
||||||
|
import 'package:vbvs_app/controller/mh_controller/sleeping_habit_controller.dart';
|
||||||
import 'package:vbvs_app/controller/person/person_controller.dart';
|
import 'package:vbvs_app/controller/person/person_controller.dart';
|
||||||
import 'package:vbvs_app/controller/repair/repair_controller.dart';
|
import 'package:vbvs_app/controller/repair/repair_controller.dart';
|
||||||
import 'package:vbvs_app/controller/setting/language/language_controller.dart';
|
import 'package:vbvs_app/controller/setting/language/language_controller.dart';
|
||||||
@@ -60,11 +62,13 @@ import 'package:vbvs_app/language/AppLanguage.dart';
|
|||||||
import 'package:vbvs_app/model/CustomThemeColor.dart';
|
import 'package:vbvs_app/model/CustomThemeColor.dart';
|
||||||
import 'package:vbvs_app/model/api_response.dart';
|
import 'package:vbvs_app/model/api_response.dart';
|
||||||
import 'package:vbvs_app/model/user_data.dart';
|
import 'package:vbvs_app/model/user_data.dart';
|
||||||
import 'package:vbvs_app/pages/device_control/MattressControl.dart';
|
import 'package:vbvs_app/pages/mh_page/BackMovement.dart';
|
||||||
|
import 'package:vbvs_app/pages/mh_page/MattressControl.dart';
|
||||||
|
import 'package:vbvs_app/pages/mh_page/people_info.dart';
|
||||||
import 'package:vbvs_app/pages/main_bottom/component/main_page_b_bottom_change.dart';
|
import 'package:vbvs_app/pages/main_bottom/component/main_page_b_bottom_change.dart';
|
||||||
import 'package:vbvs_app/routers/mh_routers.dart';
|
import 'package:vbvs_app/routers/mh_routers.dart';
|
||||||
|
|
||||||
import 'controller/mh/apply_repair_controller.dart';
|
import 'controller/mh_controller/apply_repair_controller.dart';
|
||||||
import 'controller/user_info_controller.dart';
|
import 'controller/user_info_controller.dart';
|
||||||
import 'routers/routers.dart';
|
import 'routers/routers.dart';
|
||||||
|
|
||||||
@@ -209,66 +213,12 @@ Future<void> initLogin() async {
|
|||||||
// 根据token去请求
|
// 根据token去请求
|
||||||
// await userInfoController.autoLogin(token);
|
// await userInfoController.autoLogin(token);
|
||||||
EasyDartModule.dio.token = token;
|
EasyDartModule.dio.token = token;
|
||||||
// await dealBindProcess();
|
|
||||||
} else {
|
} else {
|
||||||
// 如果没有 token,则将用户标记为未登录
|
// 如果没有 token,则将用户标记为未登录
|
||||||
userInfoController.model.login = 0;
|
userInfoController.model.login = 0;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
//处理绑定未完成的数据
|
|
||||||
Future<void> dealBindProcess() async {
|
|
||||||
UserInfoController userInfoController = Get.find();
|
|
||||||
String serviceAddress = ServiceConstant.service_address;
|
|
||||||
String serviceName = ServiceConstant.server_service;
|
|
||||||
String serviceApi = ServiceConstant.device_list;
|
|
||||||
String queryUrl = "${serviceAddress}${serviceName}${serviceApi}?bindType=1";
|
|
||||||
userInfoController.device_bind_status = [];
|
|
||||||
|
|
||||||
try {
|
|
||||||
final res = await requestWithLog(
|
|
||||||
logTitle: "查询设备绑定列表",
|
|
||||||
method: MyHttpMethod.get,
|
|
||||||
queryUrl: queryUrl,
|
|
||||||
);
|
|
||||||
|
|
||||||
List data = res.data ?? [];
|
|
||||||
if (data.isNotEmpty) {
|
|
||||||
// 使用 Future.wait 等待所有设备的查询完成
|
|
||||||
await Future.wait(
|
|
||||||
data.map((element) async {
|
|
||||||
String mac = element['mac'];
|
|
||||||
String type = "device_bind_status_$mac";
|
|
||||||
String queryUrl =
|
|
||||||
"${serviceAddress}${serviceName}${ServiceConstant.user_setting}?type=${type}";
|
|
||||||
|
|
||||||
try {
|
|
||||||
final res = await requestWithLog(
|
|
||||||
logTitle: "查询绑定流程",
|
|
||||||
method: MyHttpMethod.get,
|
|
||||||
queryUrl: queryUrl,
|
|
||||||
);
|
|
||||||
|
|
||||||
if (res.data != null && res.data.isNotEmpty) {
|
|
||||||
bool celibration = res.data['celibration'];
|
|
||||||
bool person_info = res.data['person_info'];
|
|
||||||
bool wifi = res.data['wifi'];
|
|
||||||
if (!celibration || !person_info || !wifi) {
|
|
||||||
res.data['device_info'] = element;
|
|
||||||
userInfoController.device_bind_status.add(res.data);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
} catch (e) {
|
|
||||||
print("查询绑定流程失败: $e");
|
|
||||||
}
|
|
||||||
}),
|
|
||||||
);
|
|
||||||
}
|
|
||||||
} catch (e) {
|
|
||||||
print("查询设备绑定列表失败: $e");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
class MyApp extends StatelessWidget {
|
class MyApp extends StatelessWidget {
|
||||||
MyApp({super.key});
|
MyApp({super.key});
|
||||||
final ThemeController themeController = Get.put(ThemeController());
|
final ThemeController themeController = Get.put(ThemeController());
|
||||||
@@ -295,6 +245,8 @@ class MyApp extends StatelessWidget {
|
|||||||
Get.lazyPut(() => IssuePreviewInfoController()),
|
Get.lazyPut(() => IssuePreviewInfoController()),
|
||||||
Get.lazyPut(() => IssueListController()),
|
Get.lazyPut(() => IssueListController()),
|
||||||
Get.lazyPut(() => ApplyRepairController()),
|
Get.lazyPut(() => ApplyRepairController()),
|
||||||
|
Get.lazyPut(() => RegisterController()),
|
||||||
|
Get.lazyPut(() => FindPasswordController()),
|
||||||
Get.lazyPut(() => SleepingHabitController()),
|
Get.lazyPut(() => SleepingHabitController()),
|
||||||
Get.lazyPut(() => PeopleInfoController()),
|
Get.lazyPut(() => PeopleInfoController()),
|
||||||
Get.lazyPut(() => MainPageController()),
|
Get.lazyPut(() => MainPageController()),
|
||||||
@@ -363,7 +315,7 @@ class MyApp extends StatelessWidget {
|
|||||||
]));
|
]));
|
||||||
}
|
}
|
||||||
|
|
||||||
final selectapp = "th";
|
final selectapp = "mht";
|
||||||
// This widget is the root of your application.
|
// This widget is the root of your application.
|
||||||
@override
|
@override
|
||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
|
|||||||
@@ -22,66 +22,71 @@ class BezierBottomNavigationBar extends StatelessWidget {
|
|||||||
@override
|
@override
|
||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
final itemCount = path.length;
|
final itemCount = path.length;
|
||||||
return SizedBox(
|
return Material(
|
||||||
height: 130.rpx,
|
// ✅ 整个底部栏使用一个透明 Material 包裹
|
||||||
child: Stack(
|
type: MaterialType.transparency,
|
||||||
children: [
|
child: SizedBox(
|
||||||
Positioned.fill(
|
height: 130.rpx,
|
||||||
child: CustomPaint(
|
child: Stack(
|
||||||
size: Size(MediaQuery.of(context).size.width, 130.rpx),
|
children: [
|
||||||
painter: BezierPainter(
|
Positioned.fill(
|
||||||
position: animatedPosition,
|
child: CustomPaint(
|
||||||
itemCount: itemCount,
|
size: Size(MediaQuery.of(context).size.width, 130.rpx),
|
||||||
|
painter: BezierPainter(
|
||||||
|
position: animatedPosition,
|
||||||
|
itemCount: itemCount,
|
||||||
|
),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
),
|
Row(
|
||||||
Row(
|
children: path.asMap().entries.map((entry) {
|
||||||
children: path.asMap().entries.map((entry) {
|
final i = entry.key;
|
||||||
final i = entry.key;
|
final icon = entry.value;
|
||||||
final icon = entry.value;
|
return Expanded(
|
||||||
return Expanded(
|
child: InkWell(
|
||||||
child: GestureDetector(
|
onTap: () => onTap(i),
|
||||||
// 用 InkWell 替换 GestureDetector,支持点击反馈
|
splashColor: Colors.transparent,
|
||||||
onTap: () => onTap(i),
|
highlightColor: Colors.transparent,
|
||||||
// splashColor: Colors.transparent, // 可选:关闭 splash 效果
|
focusColor: Colors.transparent,
|
||||||
// highlightColor: Colors.transparent, // 可选:关闭高亮效果
|
hoverColor: Colors.transparent,
|
||||||
child: SizedBox.expand(
|
child: SizedBox.expand(
|
||||||
child: Padding(
|
child: Padding(
|
||||||
padding: EdgeInsets.only(top: 14.rpx),
|
padding: EdgeInsets.only(top: 14.rpx),
|
||||||
child: Column(
|
child: Column(
|
||||||
mainAxisAlignment: MainAxisAlignment.start,
|
mainAxisAlignment: MainAxisAlignment.start,
|
||||||
children: [
|
children: [
|
||||||
Padding(
|
Padding(
|
||||||
padding: EdgeInsets.only(top: 11.rpx),
|
padding: EdgeInsets.only(top: 11.rpx),
|
||||||
child: SvgPicture.asset(icon,
|
child: SvgPicture.asset(
|
||||||
width: 42.rpx,
|
icon,
|
||||||
height: 42.rpx,
|
width: 42.rpx,
|
||||||
color: selectedIndex == i
|
height: 42.rpx,
|
||||||
? Colors.white
|
color: selectedIndex == i
|
||||||
: Color(0XFF929699)),
|
? Colors.white
|
||||||
|
: const Color(0XFF929699),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
const SizedBox(height: 3),
|
||||||
|
Text(
|
||||||
|
titles[i],
|
||||||
|
style: TextStyle(
|
||||||
|
fontSize: 22.rpx,
|
||||||
|
color: selectedIndex == i
|
||||||
|
? Colors.white
|
||||||
|
: Colors.grey.shade400,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
],
|
||||||
),
|
),
|
||||||
SizedBox(height: 3),
|
|
||||||
Text(
|
|
||||||
titles[i],
|
|
||||||
style: TextStyle(
|
|
||||||
fontSize: 22.rpx,
|
|
||||||
color: selectedIndex == i
|
|
||||||
? Colors.white
|
|
||||||
: Colors.grey.shade400,
|
|
||||||
),
|
|
||||||
),
|
|
||||||
],
|
|
||||||
),
|
|
||||||
)
|
|
||||||
// 关键点:撑满 Expanded 区域
|
|
||||||
|
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
);
|
),
|
||||||
}).toList(),
|
);
|
||||||
),
|
}).toList(),
|
||||||
],
|
),
|
||||||
),
|
],
|
||||||
|
),
|
||||||
|
),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
File diff suppressed because it is too large
Load Diff
@@ -1,46 +0,0 @@
|
|||||||
// import 'package:map_launcher/map_launcher.dart';
|
|
||||||
|
|
||||||
// class AppMapLocation {
|
|
||||||
// static List<AvailableMap> availableMaps = [];
|
|
||||||
// static List availableMapsToNames = [];
|
|
||||||
|
|
||||||
// static Future<void> checkInstalledApps() async {
|
|
||||||
// availableMaps = await MapLauncher.installedMaps;
|
|
||||||
// availableMapsToNames = availableMaps.map((AvailableMap m) {
|
|
||||||
// String v = "";
|
|
||||||
// switch (m.mapType) {
|
|
||||||
// case MapType.baidu:
|
|
||||||
// v = '百度地图';
|
|
||||||
// break;
|
|
||||||
// case MapType.tencent:
|
|
||||||
// v = '腾讯地图';
|
|
||||||
// break;
|
|
||||||
// case MapType.amap:
|
|
||||||
// v = '高德地图';
|
|
||||||
// break;
|
|
||||||
// case MapType.apple:
|
|
||||||
// v = 'Apple地图';
|
|
||||||
// break;
|
|
||||||
// case MapType.google:
|
|
||||||
// v = 'Google地图';
|
|
||||||
// break;
|
|
||||||
// case MapType.googleGo:
|
|
||||||
// v = 'Google地图Go';
|
|
||||||
// break;
|
|
||||||
// case MapType.petal:
|
|
||||||
// v = 'Petal地图';
|
|
||||||
// break;
|
|
||||||
// default:
|
|
||||||
// v = m.mapName;
|
|
||||||
// }
|
|
||||||
// return v;
|
|
||||||
// }).toList();
|
|
||||||
// }
|
|
||||||
|
|
||||||
// static void launchMap(index, title, double latitude, double longitude) async {
|
|
||||||
// await availableMaps[index].showMarker(
|
|
||||||
// coords: Coords(latitude, longitude),
|
|
||||||
// title: title,
|
|
||||||
// );
|
|
||||||
// }
|
|
||||||
// }
|
|
||||||
@@ -1,304 +0,0 @@
|
|||||||
import 'package:ef/ef.dart';
|
|
||||||
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/color/app_uri_status.dart';
|
|
||||||
import 'package:vbvs_app/common/util/FitTool.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/message/message_controller.dart';
|
|
||||||
import 'package:vbvs_app/controller/theme_controller/ThemeController.dart';
|
|
||||||
import 'package:vbvs_app/pages/main_bottom/component/MessageWidgetWidget.dart';
|
|
||||||
|
|
||||||
class MessagePage extends StatefulWidget {
|
|
||||||
const MessagePage({super.key});
|
|
||||||
|
|
||||||
@override
|
|
||||||
State<MessagePage> createState() => _MessagePageState();
|
|
||||||
}
|
|
||||||
|
|
||||||
class _MessagePageState extends State<MessagePage> {
|
|
||||||
ThemeController themeController = Get.find();
|
|
||||||
MessageController messageController = Get.find();
|
|
||||||
late PageController _pageController;
|
|
||||||
|
|
||||||
@override
|
|
||||||
void initState() {
|
|
||||||
super.initState();
|
|
||||||
_pageController =
|
|
||||||
PageController(initialPage: messageController.model.type == 1 ? 0 : 1);
|
|
||||||
messageController.getMessageStatus();
|
|
||||||
_fetchMessageData();
|
|
||||||
}
|
|
||||||
|
|
||||||
void _fetchMessageData() {
|
|
||||||
String type = messageController.model.type == 1 ? "app_vsm" : "app_system";
|
|
||||||
messageController.updateMessageStatus(type: type);
|
|
||||||
messageController.getMessageList().then((response) {
|
|
||||||
if (response.code != HttpStatusCodes.ok) {
|
|
||||||
TopSlideNotification.show(
|
|
||||||
Get.context!,
|
|
||||||
text: response.msg ?? "服务器.失败".tr,
|
|
||||||
textColor: themeController.currentColor.sc9,
|
|
||||||
);
|
|
||||||
}
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
void _onTabChanged(int index) {
|
|
||||||
messageController.model.type = index == 0 ? 1 : 2;
|
|
||||||
messageController.updateAll();
|
|
||||||
_fetchMessageData();
|
|
||||||
_pageController.animateToPage(index,
|
|
||||||
duration: const Duration(milliseconds: 300), curve: Curves.easeInOut);
|
|
||||||
}
|
|
||||||
|
|
||||||
void _onPageChanged(int index) {
|
|
||||||
int newType = index == 0 ? 1 : 2;
|
|
||||||
if (messageController.model.type != newType) {
|
|
||||||
messageController.model.type = newType;
|
|
||||||
messageController.updateAll();
|
|
||||||
_fetchMessageData();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
@override
|
|
||||||
void dispose() {
|
|
||||||
_pageController.dispose();
|
|
||||||
super.dispose();
|
|
||||||
}
|
|
||||||
|
|
||||||
@override
|
|
||||||
Widget build(BuildContext context) {
|
|
||||||
SystemChrome.setSystemUIOverlayStyle(const SystemUiOverlayStyle(
|
|
||||||
statusBarColor: Colors.transparent,
|
|
||||||
statusBarIconBrightness: Brightness.light,
|
|
||||||
));
|
|
||||||
|
|
||||||
return LayoutBuilder(
|
|
||||||
builder: (context, boxConstraints) => GestureDetector(
|
|
||||||
onTap: () => FocusScope.of(context).unfocus(),
|
|
||||||
child: Container(
|
|
||||||
decoration: const BoxDecoration(
|
|
||||||
image: DecorationImage(
|
|
||||||
image: AssetImage('assets/img/bgNoImg.png'),
|
|
||||||
fit: BoxFit.fill,
|
|
||||||
),
|
|
||||||
),
|
|
||||||
child: Scaffold(
|
|
||||||
appBar: AppBar(
|
|
||||||
backgroundColor: themeController.currentColor.sc17,
|
|
||||||
automaticallyImplyLeading: false,
|
|
||||||
iconTheme: IconThemeData(color: themeController.currentColor.sc3),
|
|
||||||
toolbarHeight: 140.rpx,
|
|
||||||
titleSpacing: 0,
|
|
||||||
title: Padding(
|
|
||||||
padding: EdgeInsetsDirectional.fromSTEB(40.rpx, 0, 0, 0),
|
|
||||||
child: Container(
|
|
||||||
width: double.infinity,
|
|
||||||
height: 140.rpx,
|
|
||||||
child: Column(
|
|
||||||
children: [
|
|
||||||
SizedBox(height: 40.rpx),
|
|
||||||
Expanded(
|
|
||||||
child: Stack(
|
|
||||||
alignment: Alignment.bottomLeft,
|
|
||||||
children: [
|
|
||||||
Row(
|
|
||||||
mainAxisAlignment: MainAxisAlignment.start,
|
|
||||||
children: [
|
|
||||||
Obx(() {
|
|
||||||
return ClickableContainer(
|
|
||||||
padding: EdgeInsets.all(0),
|
|
||||||
backgroundColor: Colors.transparent,
|
|
||||||
highlightColor:
|
|
||||||
themeController.currentColor.sc21,
|
|
||||||
borderRadius: 8.rpx,
|
|
||||||
onTap: () => _onTabChanged(0),
|
|
||||||
child: Container(
|
|
||||||
width: 160.rpx,
|
|
||||||
alignment: Alignment.center,
|
|
||||||
child: Stack(
|
|
||||||
alignment: Alignment.center,
|
|
||||||
clipBehavior: Clip.none,
|
|
||||||
children: [
|
|
||||||
Text(
|
|
||||||
'体征消息'.tr,
|
|
||||||
style: FlutterFlowTheme.of(context)
|
|
||||||
.bodyMedium
|
|
||||||
.override(
|
|
||||||
fontFamily: 'Inter',
|
|
||||||
fontSize: AppConstants()
|
|
||||||
.title_text_fontSize,
|
|
||||||
color:
|
|
||||||
messageController
|
|
||||||
.model.type ==
|
|
||||||
2
|
|
||||||
? themeController
|
|
||||||
.currentColor.sc3
|
|
||||||
: themeController
|
|
||||||
.currentColor.sc2,
|
|
||||||
),
|
|
||||||
),
|
|
||||||
Obx(() {
|
|
||||||
return messageController.model
|
|
||||||
.body_message_read ==
|
|
||||||
1
|
|
||||||
? Positioned(
|
|
||||||
top: -4,
|
|
||||||
right: -14,
|
|
||||||
child: Container(
|
|
||||||
width: 8,
|
|
||||||
height: 8,
|
|
||||||
decoration:
|
|
||||||
const BoxDecoration(
|
|
||||||
color: Colors.red,
|
|
||||||
shape: BoxShape.circle,
|
|
||||||
),
|
|
||||||
),
|
|
||||||
)
|
|
||||||
: const SizedBox.shrink();
|
|
||||||
}),
|
|
||||||
],
|
|
||||||
),
|
|
||||||
),
|
|
||||||
);
|
|
||||||
}),
|
|
||||||
Obx(() {
|
|
||||||
return ClickableContainer(
|
|
||||||
padding: EdgeInsets.all(0),
|
|
||||||
backgroundColor: Colors.transparent,
|
|
||||||
highlightColor:
|
|
||||||
themeController.currentColor.sc21,
|
|
||||||
borderRadius: 8.rpx,
|
|
||||||
onTap: () => _onTabChanged(1),
|
|
||||||
child: Container(
|
|
||||||
width: 160.rpx,
|
|
||||||
alignment: Alignment.center,
|
|
||||||
child: Stack(
|
|
||||||
alignment: Alignment.center,
|
|
||||||
clipBehavior: Clip.none,
|
|
||||||
children: [
|
|
||||||
Text(
|
|
||||||
'系统消息'.tr,
|
|
||||||
style: FlutterFlowTheme.of(context)
|
|
||||||
.bodyMedium
|
|
||||||
.override(
|
|
||||||
fontFamily: 'Inter',
|
|
||||||
fontSize: AppConstants()
|
|
||||||
.title_text_fontSize,
|
|
||||||
color:
|
|
||||||
messageController
|
|
||||||
.model.type ==
|
|
||||||
1
|
|
||||||
? themeController
|
|
||||||
.currentColor.sc3
|
|
||||||
: themeController
|
|
||||||
.currentColor.sc2,
|
|
||||||
),
|
|
||||||
),
|
|
||||||
Obx(() {
|
|
||||||
return messageController.model
|
|
||||||
.system_message_read ==
|
|
||||||
1
|
|
||||||
? Positioned(
|
|
||||||
top: -4,
|
|
||||||
right: -14,
|
|
||||||
child: Container(
|
|
||||||
width: 8,
|
|
||||||
height: 8,
|
|
||||||
decoration:
|
|
||||||
const BoxDecoration(
|
|
||||||
color: Colors.red,
|
|
||||||
shape: BoxShape.circle,
|
|
||||||
),
|
|
||||||
),
|
|
||||||
)
|
|
||||||
: const SizedBox.shrink();
|
|
||||||
}),
|
|
||||||
],
|
|
||||||
),
|
|
||||||
),
|
|
||||||
);
|
|
||||||
}),
|
|
||||||
].divide(SizedBox(width: 10.rpx)),
|
|
||||||
),
|
|
||||||
Obx(() {
|
|
||||||
double lineWidth = 170.rpx;
|
|
||||||
return AnimatedPositioned(
|
|
||||||
duration: const Duration(milliseconds: 300),
|
|
||||||
curve: Curves.easeInOut,
|
|
||||||
bottom: 0,
|
|
||||||
left: messageController.model.type == 1
|
|
||||||
? 0
|
|
||||||
: 170.rpx,
|
|
||||||
child: Container(
|
|
||||||
width: lineWidth,
|
|
||||||
height: 4.rpx,
|
|
||||||
decoration: BoxDecoration(
|
|
||||||
color: themeController.currentColor.sc2,
|
|
||||||
borderRadius: BorderRadius.circular(2.rpx),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
);
|
|
||||||
}),
|
|
||||||
],
|
|
||||||
),
|
|
||||||
),
|
|
||||||
SizedBox(height: 17.rpx),
|
|
||||||
],
|
|
||||||
),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
actions: const [],
|
|
||||||
centerTitle: false,
|
|
||||||
),
|
|
||||||
backgroundColor: Colors.transparent,
|
|
||||||
body: SafeArea(
|
|
||||||
top: true,
|
|
||||||
child: PageView(
|
|
||||||
controller: _pageController,
|
|
||||||
onPageChanged: _onPageChanged,
|
|
||||||
children: [
|
|
||||||
Obx(() {
|
|
||||||
final list = messageController.messageList.value;
|
|
||||||
return list.isEmpty
|
|
||||||
? const NullDataWidget()
|
|
||||||
: _buildMessageListView(list);
|
|
||||||
}),
|
|
||||||
Obx(() {
|
|
||||||
final list = messageController.messageList.value;
|
|
||||||
return list.isEmpty
|
|
||||||
? const NullDataWidget()
|
|
||||||
: _buildMessageListView(list);
|
|
||||||
}),
|
|
||||||
],
|
|
||||||
),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
Widget _buildMessageListView(List dataList) {
|
|
||||||
return Container(
|
|
||||||
width: double.infinity,
|
|
||||||
padding: EdgeInsets.symmetric(horizontal: 30.rpx),
|
|
||||||
child: SingleChildScrollView(
|
|
||||||
child: Column(
|
|
||||||
children: [
|
|
||||||
SizedBox(height: 30.rpx),
|
|
||||||
...dataList
|
|
||||||
.map((item) => MessageWidgetWidget(data: item))
|
|
||||||
.toList()
|
|
||||||
.divide(SizedBox(height: 30.rpx)),
|
|
||||||
SizedBox(height: 30.rpx),
|
|
||||||
],
|
|
||||||
),
|
|
||||||
),
|
|
||||||
);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,144 +0,0 @@
|
|||||||
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/util/MyUtils.dart';
|
|
||||||
import 'package:vbvs_app/controller/mh/repair_info_controller.dart';
|
|
||||||
import 'package:vbvs_app/controller/mh/repair_list_controller.dart';
|
|
||||||
import 'package:vbvs_app/pages/device_control/ColorChangeOnTap.dart';
|
|
||||||
|
|
||||||
import '../../common/color/appFontsize.dart';
|
|
||||||
|
|
||||||
class RepairHistoryWidget extends GetView<RepairInfoController> {
|
|
||||||
int index;
|
|
||||||
RepairListController repairListController;
|
|
||||||
|
|
||||||
RepairHistoryWidget(
|
|
||||||
{required this.index, required this.repairListController}) {}
|
|
||||||
|
|
||||||
@override
|
|
||||||
Widget build(BuildContext context) {
|
|
||||||
int tmp = index;
|
|
||||||
index = tmp;
|
|
||||||
return ColorChangeOnPress(
|
|
||||||
pressColor: AppColors().press_color, // 按下时的颜色
|
|
||||||
shouldNavigate: true, // 是否需要跳转
|
|
||||||
routeName: "/repairHistoryListPage", // 路由名称
|
|
||||||
topLeft: 16,
|
|
||||||
topRight: 16,
|
|
||||||
bottomLeft: 16,
|
|
||||||
bottomRight: 16,
|
|
||||||
onTap: () async {
|
|
||||||
// print("object");
|
|
||||||
// final RepairInfoController repairInfoController =
|
|
||||||
// Get.find<RepairInfoController>();
|
|
||||||
// await repairInfoController
|
|
||||||
// .initData(repairListController.model.repairList[index])
|
|
||||||
// .then((_) {
|
|
||||||
// repairInfoController.updateAll();
|
|
||||||
// // Get.toNamed("/repairHistoryListPage"); // 这个在 ColorChangeOnPress 中已经处理
|
|
||||||
// });
|
|
||||||
},
|
|
||||||
child: Container(
|
|
||||||
width: MediaQuery.sizeOf(context).width,
|
|
||||||
constraints: BoxConstraints(
|
|
||||||
minHeight: 70,
|
|
||||||
),
|
|
||||||
child: Padding(
|
|
||||||
padding: EdgeInsetsDirectional.fromSTEB(15, 14, 15, 13),
|
|
||||||
child: Row(
|
|
||||||
mainAxisSize: MainAxisSize.max,
|
|
||||||
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
|
||||||
children: [
|
|
||||||
Container(
|
|
||||||
width: MediaQuery.sizeOf(context).width * 0.5,
|
|
||||||
child: Column(
|
|
||||||
mainAxisSize: MainAxisSize.max,
|
|
||||||
children: [
|
|
||||||
Align(
|
|
||||||
alignment: AlignmentDirectional(-1, 0),
|
|
||||||
child: Text(
|
|
||||||
repairListController
|
|
||||||
.model.repairList[index].device_category ??
|
|
||||||
'',
|
|
||||||
style: FlutterFlowTheme.of(context).bodyMedium.override(
|
|
||||||
fontFamily: 'Readex Pro',
|
|
||||||
color: Color(0xFF333333),
|
|
||||||
fontSize: AppFontsize.title_size,
|
|
||||||
letterSpacing: 0,
|
|
||||||
),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
Align(
|
|
||||||
alignment: AlignmentDirectional(-1, 0),
|
|
||||||
child: Text(
|
|
||||||
"报修单号:${repairListController.model.repairList[index].id}",
|
|
||||||
style: FlutterFlowTheme.of(context).bodyMedium.override(
|
|
||||||
fontFamily: 'Readex Pro',
|
|
||||||
color: Color(0xFFC8CBD2),
|
|
||||||
fontSize: AppFontsize.small_text_size,
|
|
||||||
letterSpacing: 0,
|
|
||||||
),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
Align(
|
|
||||||
alignment: AlignmentDirectional(-1, 0),
|
|
||||||
child: Text(
|
|
||||||
"提交时间:" +
|
|
||||||
(MyUtils.formatDateTime(repairListController
|
|
||||||
.model.repairList[index].create_time!) ??
|
|
||||||
''),
|
|
||||||
style: FlutterFlowTheme.of(context).bodyMedium.override(
|
|
||||||
fontFamily: 'Readex Pro',
|
|
||||||
color: Color(0xFFC8CBD2),
|
|
||||||
fontSize: AppFontsize.small_text_size,
|
|
||||||
letterSpacing: 0,
|
|
||||||
),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
],
|
|
||||||
),
|
|
||||||
),
|
|
||||||
Container(
|
|
||||||
width: MediaQuery.sizeOf(context).width * 0.2,
|
|
||||||
height: MediaQuery.sizeOf(context).height * 0.075,
|
|
||||||
constraints: BoxConstraints(
|
|
||||||
maxWidth: 130,
|
|
||||||
),
|
|
||||||
child: Row(
|
|
||||||
mainAxisSize: MainAxisSize.max,
|
|
||||||
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
|
||||||
children: [
|
|
||||||
Align(
|
|
||||||
alignment: AlignmentDirectional(0, 0),
|
|
||||||
child: Text(
|
|
||||||
repairListController.model.repairList[index].status ??
|
|
||||||
'',
|
|
||||||
style: FlutterFlowTheme.of(context).bodyMedium.override(
|
|
||||||
fontFamily: 'Readex Pro',
|
|
||||||
color: Color(0xFF333333),
|
|
||||||
fontSize: AppFontsize.normal_text_size,
|
|
||||||
letterSpacing: 0,
|
|
||||||
),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
Flexible(
|
|
||||||
child: Align(
|
|
||||||
alignment: AlignmentDirectional(0, 0.05),
|
|
||||||
child: Icon(
|
|
||||||
Icons.arrow_forward_ios,
|
|
||||||
color: FlutterFlowTheme.of(context).secondaryText,
|
|
||||||
size: 10,
|
|
||||||
),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
].divide(SizedBox(width: 27)),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
],
|
|
||||||
),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,575 +0,0 @@
|
|||||||
import 'package:ef/ef.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/tool/ClickableContainer.dart';
|
|
||||||
import 'package:vbvs_app/component/tool/CustomCard.dart';
|
|
||||||
import 'package:vbvs_app/controller/mh/apply_repair_controller.dart';
|
|
||||||
import 'package:vbvs_app/controller/mh/repair_list_controller.dart';
|
|
||||||
|
|
||||||
|
|
||||||
class DeviceRepairPage extends GetView<RepairListController> {
|
|
||||||
final scaffoldKey = GlobalKey<ScaffoldState>();
|
|
||||||
BoxConstraints? bodysize;
|
|
||||||
|
|
||||||
// final ScrollController scrollController = ScrollController();
|
|
||||||
// final RepairListController controller = Get.find();
|
|
||||||
|
|
||||||
// DeviceRepairPage() {
|
|
||||||
// controller.model.limit = AppConstants.limit;
|
|
||||||
// controller.model.offset = 0;
|
|
||||||
// controller.model.isLoading = false;
|
|
||||||
// controller.model.hasMore = true;
|
|
||||||
// controller.model.repairList.clear();
|
|
||||||
// controller.initData();
|
|
||||||
// Get.put(RepairListController());
|
|
||||||
|
|
||||||
// scrollController.addListener(() {
|
|
||||||
// if (scrollController.position.pixels ==
|
|
||||||
// scrollController.position.maxScrollExtent &&
|
|
||||||
// controller.model.hasMore) {
|
|
||||||
// controller.initData();
|
|
||||||
// controller.updateAll();
|
|
||||||
// }
|
|
||||||
// });
|
|
||||||
// }
|
|
||||||
final List<ApplyRepairModel> mockData = List.generate(4, (index) {
|
|
||||||
return ApplyRepairModel()
|
|
||||||
..device_name = "SWESO1号智能一键入眠床"
|
|
||||||
..status = index == 0 ? "已提交" : "已完成"
|
|
||||||
..create_time = DateTime(2024, 5, 12, 12, 5, 12);
|
|
||||||
});
|
|
||||||
@override
|
|
||||||
Widget build(BuildContext context) {
|
|
||||||
return LayoutBuilder(builder: (context, cc) {
|
|
||||||
bodysize = cc;
|
|
||||||
return GestureDetector(
|
|
||||||
onTap: () => FocusScope.of(context).unfocus(),
|
|
||||||
child: Container(
|
|
||||||
decoration: const BoxDecoration(
|
|
||||||
image: DecorationImage(
|
|
||||||
image: AssetImage('assets/images/new_background.png'), // 本地图片
|
|
||||||
fit: BoxFit.fill, // 填满整个 Container
|
|
||||||
),
|
|
||||||
),
|
|
||||||
child: Scaffold(
|
|
||||||
// key: scaffoldKey,
|
|
||||||
backgroundColor: Colors.transparent,
|
|
||||||
appBar: AppBar(
|
|
||||||
backgroundColor: Colors.transparent,
|
|
||||||
iconTheme: const IconThemeData(color: Colors.white),
|
|
||||||
automaticallyImplyLeading: false,
|
|
||||||
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,
|
|
||||||
),
|
|
||||||
],
|
|
||||||
),
|
|
||||||
),
|
|
||||||
centerTitle: false,
|
|
||||||
),
|
|
||||||
body: SafeArea(
|
|
||||||
top: true,
|
|
||||||
child: Padding(
|
|
||||||
padding: EdgeInsets.fromLTRB(30.rpx, 6.rpx, 30.rpx, 0),
|
|
||||||
child: Column(
|
|
||||||
crossAxisAlignment: CrossAxisAlignment.start,
|
|
||||||
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
|
||||||
children: [
|
|
||||||
// 报修须知
|
|
||||||
Container(
|
|
||||||
height: 412.rpx,
|
|
||||||
decoration: BoxDecoration(
|
|
||||||
border: Border.all(
|
|
||||||
color: Color(0XFFC8CBD2), width: 0.rpx),
|
|
||||||
borderRadius: BorderRadius.circular(10),
|
|
||||||
),
|
|
||||||
child: Padding(
|
|
||||||
padding: EdgeInsets.fromLTRB(
|
|
||||||
27.rpx, 49.rpx, 43.rpx, 39.rpx),
|
|
||||||
child: Column(
|
|
||||||
crossAxisAlignment:
|
|
||||||
CrossAxisAlignment.center,
|
|
||||||
children: [
|
|
||||||
// 固定的标题部分
|
|
||||||
Text(
|
|
||||||
"报修须知",
|
|
||||||
style: TextStyle(
|
|
||||||
fontSize: 30.rpx,
|
|
||||||
fontWeight: FontWeight.bold,
|
|
||||||
color: Colors.white,
|
|
||||||
),
|
|
||||||
textAlign: TextAlign.center,
|
|
||||||
),
|
|
||||||
SizedBox(height: 33.rpx),
|
|
||||||
// 可滚动的正文部分,限定高度
|
|
||||||
Expanded(
|
|
||||||
child: SingleChildScrollView(
|
|
||||||
child: RichText(
|
|
||||||
text: TextSpan(
|
|
||||||
style: TextStyle(
|
|
||||||
color: Color(0XFF929699),
|
|
||||||
fontSize: 26.rpx,
|
|
||||||
),
|
|
||||||
children: [
|
|
||||||
TextSpan(
|
|
||||||
text:
|
|
||||||
"尊敬的用户,感谢您选择我司产品。在使用过程中,如果设备出现故障需要维修,请首先确认设备是否正确连接控制器或网络,检查设置是否正常,排除误操作问题。若问题依然存在,请记录下设备名称、设备编号、和具体故障内容,方便我们快速地为您提供帮助。您可以通过智慧棉花糖APP保修页面直接报修或拨打 ",
|
|
||||||
style: TextStyle(
|
|
||||||
color:
|
|
||||||
Color(0XFF929699),
|
|
||||||
fontSize: 26.rpx,
|
|
||||||
height: 1.3)),
|
|
||||||
TextSpan(
|
|
||||||
text: "400-8756-966",
|
|
||||||
style: TextStyle(
|
|
||||||
color: Colors.white,
|
|
||||||
// height: 1.3,
|
|
||||||
decoration: TextDecoration
|
|
||||||
.underline, // 添加下划线
|
|
||||||
decorationColor:
|
|
||||||
Colors.white,
|
|
||||||
decorationThickness: 4.rpx,
|
|
||||||
),
|
|
||||||
),
|
|
||||||
TextSpan(
|
|
||||||
text: " 反馈。",
|
|
||||||
style: TextStyle(
|
|
||||||
color:
|
|
||||||
Color(0XFF929699),
|
|
||||||
fontSize: 26.rpx,
|
|
||||||
height: 1.3)),
|
|
||||||
],
|
|
||||||
),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
],
|
|
||||||
))),
|
|
||||||
|
|
||||||
SizedBox(height: 24.rpx),
|
|
||||||
|
|
||||||
InkWell(
|
|
||||||
onTap: () {
|
|
||||||
// bool isOk = true;
|
|
||||||
// for (var i = 0; i < 2; i++) {
|
|
||||||
// var d = controller.model.peopleList[i];
|
|
||||||
// print("${d.toJson()}");
|
|
||||||
// String before = "人员信息${i == 0 ? "A" : "B"}:";
|
|
||||||
// if (isOk &&
|
|
||||||
// d.height != null &&
|
|
||||||
// d.height != "" &&
|
|
||||||
// int.tryParse("${d.height}") == null) {
|
|
||||||
// showToast("$before身高请输入数字");
|
|
||||||
// isOk = false;
|
|
||||||
// }
|
|
||||||
// if (isOk &&
|
|
||||||
// d.weight != null &&
|
|
||||||
// d.weight != "" &&
|
|
||||||
// int.tryParse("${d.weight}") == null) {
|
|
||||||
// showToast("$before体重请输入数字");
|
|
||||||
// isOk = false;
|
|
||||||
// }
|
|
||||||
// if (isOk &&
|
|
||||||
// d.tel != null &&
|
|
||||||
// d.tel != "" &&
|
|
||||||
// MyUtils.isValidPhoneNumber("${d.tel}") ==
|
|
||||||
// false) {
|
|
||||||
// showToast("$before请输入正确的电话");
|
|
||||||
// isOk = false;
|
|
||||||
// }
|
|
||||||
// if (isOk &&
|
|
||||||
// d.emergencyContact != null &&
|
|
||||||
// d.emergencyContact != "" &&
|
|
||||||
// MyUtils.isValidPhoneNumber(
|
|
||||||
// "${d.emergencyContact}") ==
|
|
||||||
// false) {
|
|
||||||
// showToast("$before请输入正确的紧急联系人电话");
|
|
||||||
// isOk = false;
|
|
||||||
// }
|
|
||||||
// if (isOk) {
|
|
||||||
// controller.savePeoples().then((d) {
|
|
||||||
// showToast("保存成功", color: color_success);
|
|
||||||
// }).catchError((d) {
|
|
||||||
// print("$d");
|
|
||||||
// showToast("保存失败");
|
|
||||||
// });
|
|
||||||
// }
|
|
||||||
// }
|
|
||||||
// controller.model.peopleList.forEach((d) {});
|
|
||||||
},
|
|
||||||
child: CustomCard(
|
|
||||||
borderRadius: 10,
|
|
||||||
gradientDirection: GradientDirection.vertical,
|
|
||||||
onTap: () {
|
|
||||||
Get.toNamed("/applyRepairPage");
|
|
||||||
},
|
|
||||||
colors: const [
|
|
||||||
Color(0xFFFCFCFC),
|
|
||||||
Color(0xFFF8FAF9),
|
|
||||||
Color(0XFFECF6F3),
|
|
||||||
Color(0XFFD9F0E9),
|
|
||||||
Color(0xFFCEECE3)
|
|
||||||
],
|
|
||||||
child: Container(
|
|
||||||
width: double.infinity,
|
|
||||||
height: 90.rpx,
|
|
||||||
alignment: Alignment.center,
|
|
||||||
decoration: BoxDecoration(
|
|
||||||
borderRadius: BorderRadius.circular(6),
|
|
||||||
),
|
|
||||||
child: Text(
|
|
||||||
"我要报修",
|
|
||||||
style: FlutterFlowTheme.of(context)
|
|
||||||
.bodyMedium
|
|
||||||
.override(
|
|
||||||
fontFamily: 'Readex Pro',
|
|
||||||
color: stringToColor("#011D33"),
|
|
||||||
letterSpacing: 0,
|
|
||||||
fontSize: 30.rpx,
|
|
||||||
),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
)),
|
|
||||||
|
|
||||||
SizedBox(height: 235.rpx),
|
|
||||||
|
|
||||||
// 报修历史标题
|
|
||||||
Container(
|
|
||||||
width: double.infinity,
|
|
||||||
child: Text("报修历史",
|
|
||||||
style: TextStyle(
|
|
||||||
color: Colors.white,
|
|
||||||
fontSize: 30.rpx,
|
|
||||||
height: 1)),
|
|
||||||
),
|
|
||||||
|
|
||||||
SizedBox(height: 32.rpx),
|
|
||||||
|
|
||||||
// 报修历史列表
|
|
||||||
Expanded(
|
|
||||||
child: ListView.builder(
|
|
||||||
itemCount: mockData.length,
|
|
||||||
itemBuilder: (context, index) {
|
|
||||||
final item = mockData[index];
|
|
||||||
return ClickableContainer(
|
|
||||||
backgroundColor: Colors.transparent,
|
|
||||||
highlightColor: Color(0XFF055466),
|
|
||||||
padding: EdgeInsets.only(top: 0),
|
|
||||||
onTap: () {
|
|
||||||
Get.toNamed("/repairHistoryListPage");
|
|
||||||
},
|
|
||||||
child: Container(
|
|
||||||
height: 119.rpx,
|
|
||||||
// margin: const EdgeInsets.only(bottom: 10),
|
|
||||||
// padding: const EdgeInsets.symmetric(
|
|
||||||
// vertical: 12, horizontal: 16),
|
|
||||||
decoration: BoxDecoration(
|
|
||||||
// color: const Color(0xFF06486F),
|
|
||||||
border: Border(
|
|
||||||
top: index == 0
|
|
||||||
? BorderSide(
|
|
||||||
color:
|
|
||||||
const Color(0xFF929699),
|
|
||||||
width: 1.rpx)
|
|
||||||
: BorderSide.none,
|
|
||||||
bottom: BorderSide(
|
|
||||||
color: const Color(0xFF929699),
|
|
||||||
width: 1.rpx),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
child: Padding(
|
|
||||||
padding: EdgeInsets.fromLTRB(
|
|
||||||
17.rpx, 0, 30.rpx, 0),
|
|
||||||
child: Row(
|
|
||||||
mainAxisAlignment:
|
|
||||||
MainAxisAlignment.spaceBetween,
|
|
||||||
crossAxisAlignment:
|
|
||||||
CrossAxisAlignment.center,
|
|
||||||
children: [
|
|
||||||
// 左侧设备信息
|
|
||||||
Column(
|
|
||||||
mainAxisAlignment:
|
|
||||||
MainAxisAlignment.center,
|
|
||||||
crossAxisAlignment:
|
|
||||||
CrossAxisAlignment.start,
|
|
||||||
children: [
|
|
||||||
Text(
|
|
||||||
item.device_name ?? '',
|
|
||||||
style: TextStyle(
|
|
||||||
color: Colors.white,
|
|
||||||
fontSize: 30.rpx),
|
|
||||||
),
|
|
||||||
const SizedBox(height: 4),
|
|
||||||
Text(
|
|
||||||
"提交时间:${item.create_time?.toString().substring(0, 19) ?? ''}",
|
|
||||||
style: TextStyle(
|
|
||||||
color: Colors.white60,
|
|
||||||
fontSize: 20.rpx),
|
|
||||||
),
|
|
||||||
],
|
|
||||||
),
|
|
||||||
// 右侧状态
|
|
||||||
Row(
|
|
||||||
children: [
|
|
||||||
Text(
|
|
||||||
item.status ?? '',
|
|
||||||
style: TextStyle(
|
|
||||||
color: Colors.white,
|
|
||||||
fontSize: 26.rpx),
|
|
||||||
),
|
|
||||||
Icon(Icons.arrow_forward_ios,
|
|
||||||
color: Colors.white,
|
|
||||||
size: 30.rpx),
|
|
||||||
],
|
|
||||||
)
|
|
||||||
],
|
|
||||||
),
|
|
||||||
)));
|
|
||||||
},
|
|
||||||
),
|
|
||||||
),
|
|
||||||
],
|
|
||||||
),
|
|
||||||
))
|
|
||||||
// Container(
|
|
||||||
// width: bodysize!.maxWidth,
|
|
||||||
// height: bodysize!.maxHeight * 1,
|
|
||||||
// decoration: BoxDecoration(
|
|
||||||
// color: Color(0xFFF6F6F6),
|
|
||||||
// ),
|
|
||||||
// child: Column(
|
|
||||||
// mainAxisSize: MainAxisSize.max,
|
|
||||||
// children: [
|
|
||||||
// // TitleComponentWidget(
|
|
||||||
// // titleName: '设备报修',
|
|
||||||
// // ),
|
|
||||||
// Expanded(
|
|
||||||
// child: Padding(
|
|
||||||
// padding: EdgeInsetsDirectional.fromSTEB(15, 0, 15, 0),
|
|
||||||
// child: Container(
|
|
||||||
// width: bodysize!.maxWidth,
|
|
||||||
// height: bodysize!.maxHeight * 0.9,
|
|
||||||
// decoration: BoxDecoration(
|
|
||||||
// color: Color(0xFFF6F6F6),
|
|
||||||
// ),
|
|
||||||
// child: Column(
|
|
||||||
// mainAxisSize: MainAxisSize.max,
|
|
||||||
// children: [
|
|
||||||
// Padding(
|
|
||||||
// padding:
|
|
||||||
// EdgeInsetsDirectional.fromSTEB(0, 14, 0, 13),
|
|
||||||
// child: Container(
|
|
||||||
// width: bodysize!.maxWidth,
|
|
||||||
// height: bodysize!.maxHeight * 0.186,
|
|
||||||
// constraints: BoxConstraints(
|
|
||||||
// minHeight: 170,
|
|
||||||
// ),
|
|
||||||
// decoration: BoxDecoration(
|
|
||||||
// color: FlutterFlowTheme.of(context)
|
|
||||||
// .secondaryBackground,
|
|
||||||
// borderRadius: BorderRadius.circular(16),
|
|
||||||
// border: Border.all(
|
|
||||||
// color: Colors.white,
|
|
||||||
// ),
|
|
||||||
// ),
|
|
||||||
// child: Column(
|
|
||||||
// mainAxisSize: MainAxisSize.max,
|
|
||||||
// children: [
|
|
||||||
// Padding(
|
|
||||||
// padding: EdgeInsetsDirectional.fromSTEB(
|
|
||||||
// 0, 14, 0, 18),
|
|
||||||
// child: Text(
|
|
||||||
// '报修须知',
|
|
||||||
// style: FlutterFlowTheme.of(context)
|
|
||||||
// .bodyMedium
|
|
||||||
// .override(
|
|
||||||
// fontFamily: 'Readex Pro',
|
|
||||||
// fontSize: AppFontsize.title_size,
|
|
||||||
// letterSpacing: 0,
|
|
||||||
// fontWeight: FontWeight.w600,
|
|
||||||
// ),
|
|
||||||
// ),
|
|
||||||
// ),
|
|
||||||
// Flexible(
|
|
||||||
// child: Padding(
|
|
||||||
// padding: EdgeInsetsDirectional.fromSTEB(
|
|
||||||
// 14, 0, 14, 14), // 应用 padding
|
|
||||||
// child: SingleChildScrollView(
|
|
||||||
// child: Column(
|
|
||||||
// mainAxisSize: MainAxisSize.max,
|
|
||||||
// children: [
|
|
||||||
// Text(
|
|
||||||
// '尊敬的用户,感谢您选择我司产品。在使用过程中,如果设备出现故障或需要维修,请首先确认设备是否正确连接电源和网络,检查设置是否正常,排除基本操作问题。若问题依然存在,请记录下设备名称、设备型号、和具体故障情况等,方便我们更快速地为您提供帮助。您可以通过智慧眠花糖APP保修或者直接拨打400-8756-966反馈。',
|
|
||||||
// style: FlutterFlowTheme.of(
|
|
||||||
// context)
|
|
||||||
// .bodyMedium
|
|
||||||
// .override(
|
|
||||||
// fontFamily: 'Readex Pro',
|
|
||||||
// color: Color(0xFF333333),
|
|
||||||
// fontSize: AppFontsize
|
|
||||||
// .small_text_size,
|
|
||||||
// letterSpacing: 0,
|
|
||||||
// lineHeight: 1.5,
|
|
||||||
// ),
|
|
||||||
// ),
|
|
||||||
// // 如果需要,可以在 Text 下面添加其他小部件
|
|
||||||
// ],
|
|
||||||
// ),
|
|
||||||
// ),
|
|
||||||
// ),
|
|
||||||
// )
|
|
||||||
// ],
|
|
||||||
// ),
|
|
||||||
// ),
|
|
||||||
// ),
|
|
||||||
// Padding(
|
|
||||||
// padding:
|
|
||||||
// EdgeInsetsDirectional.fromSTEB(0, 0, 0, 42),
|
|
||||||
// child: Container(
|
|
||||||
// width: bodysize!.maxWidth,
|
|
||||||
// height: 46,
|
|
||||||
// decoration: BoxDecoration(
|
|
||||||
// color: FlutterFlowTheme.of(context)
|
|
||||||
// .secondaryBackground,
|
|
||||||
// borderRadius: BorderRadius.circular(16),
|
|
||||||
// ),
|
|
||||||
// child: Container(
|
|
||||||
// width: bodysize!.maxWidth,
|
|
||||||
// height: bodysize!.maxHeight * 0.056,
|
|
||||||
// decoration: BoxDecoration(
|
|
||||||
// color: FlutterFlowTheme.of(context)
|
|
||||||
// .secondaryBackground,
|
|
||||||
// borderRadius: BorderRadius.circular(16),
|
|
||||||
// ),
|
|
||||||
// child: FFButtonWidget(
|
|
||||||
// onPressed: () {
|
|
||||||
// Get.toNamed("/applyRepairPage");
|
|
||||||
// },
|
|
||||||
// text: '我要报修',
|
|
||||||
// options: FFButtonOptions(
|
|
||||||
// height: 46,
|
|
||||||
// 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: AppFontsize.title_size,
|
|
||||||
// letterSpacing: 0,
|
|
||||||
// ),
|
|
||||||
// elevation: 0,
|
|
||||||
// borderSide: BorderSide(
|
|
||||||
// color: Colors.transparent,
|
|
||||||
// width: 1,
|
|
||||||
// ),
|
|
||||||
// borderRadius: BorderRadius.circular(8),
|
|
||||||
// ),
|
|
||||||
// ),
|
|
||||||
// ),
|
|
||||||
// ),
|
|
||||||
// ),
|
|
||||||
// Expanded(
|
|
||||||
// child: Container(
|
|
||||||
// width: bodysize!.maxWidth,
|
|
||||||
// height: bodysize!.maxHeight * 1,
|
|
||||||
// decoration: BoxDecoration(
|
|
||||||
// color: Color(0xFFF6F6F6),
|
|
||||||
// ),
|
|
||||||
// child: Column(
|
|
||||||
// mainAxisSize: MainAxisSize.max,
|
|
||||||
// children: [
|
|
||||||
// Align(
|
|
||||||
// alignment: AlignmentDirectional(-1, 0),
|
|
||||||
// child: Padding(
|
|
||||||
// padding: EdgeInsetsDirectional.fromSTEB(
|
|
||||||
// 14, 0, 0, 17),
|
|
||||||
// child: Text(
|
|
||||||
// '报修历史',
|
|
||||||
// style: FlutterFlowTheme.of(context)
|
|
||||||
// .bodyMedium
|
|
||||||
// .override(
|
|
||||||
// fontFamily: 'Readex Pro',
|
|
||||||
// color: Color(0xFF333333),
|
|
||||||
// fontSize: AppFontsize.title_size,
|
|
||||||
// letterSpacing: 0,
|
|
||||||
// fontWeight: FontWeight.w600,
|
|
||||||
// ),
|
|
||||||
// ),
|
|
||||||
// ),
|
|
||||||
// ),
|
|
||||||
// Obx(() {
|
|
||||||
// return Visibility(
|
|
||||||
// visible:
|
|
||||||
// controller.model.repairList != null &&
|
|
||||||
// controller
|
|
||||||
// .model.repairList!.isNotEmpty,
|
|
||||||
// replacement:
|
|
||||||
// EmptyMessageWidget(),
|
|
||||||
// child: Expanded(
|
|
||||||
// // child: Obx(() =>
|
|
||||||
// child: ListView(
|
|
||||||
// controller:
|
|
||||||
// scrollController, // 绑定 ScrollController
|
|
||||||
// shrinkWrap: true,
|
|
||||||
// scrollDirection: Axis.vertical,
|
|
||||||
// children: (controller
|
|
||||||
// .model.repairList
|
|
||||||
// .asMap()
|
|
||||||
// .entries
|
|
||||||
// .map((e) =>
|
|
||||||
// RepairHistoryWidget(
|
|
||||||
// index: e.key,
|
|
||||||
// repairListController:
|
|
||||||
// controller))
|
|
||||||
// .toList() as List<Widget>)
|
|
||||||
// .divide(const SizedBox(
|
|
||||||
// height: 13,
|
|
||||||
// ))
|
|
||||||
// .addToEnd(SizedBox(
|
|
||||||
// height: AppConstants
|
|
||||||
// .list_end_height,
|
|
||||||
// )))
|
|
||||||
// // ),
|
|
||||||
// ),
|
|
||||||
// );
|
|
||||||
// }),
|
|
||||||
// ],
|
|
||||||
// ),
|
|
||||||
// ),
|
|
||||||
// ),
|
|
||||||
// ],
|
|
||||||
// ),
|
|
||||||
// ),
|
|
||||||
// ),
|
|
||||||
// ),
|
|
||||||
// ],
|
|
||||||
// ),
|
|
||||||
// ),
|
|
||||||
),
|
|
||||||
));
|
|
||||||
});
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -153,10 +153,12 @@
|
|||||||
// }
|
// }
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
import 'package:vbvs_app/pages/common/bezier_bottom_navigation_bar.dart';
|
import 'package:vbvs_app/pages/common/bezier_bottom_navigation_bar.dart';
|
||||||
import 'package:vbvs_app/pages/device_control/MattressControl.dart';
|
import 'package:vbvs_app/pages/mh_page/MattressControl.dart';
|
||||||
import 'package:vbvs_app/pages/device_control/new_Home_page.dart';
|
import 'package:vbvs_app/pages/mh_page/find_password_page.dart';
|
||||||
import 'package:vbvs_app/pages/device_control/new_mine_page.dart';
|
import 'package:vbvs_app/pages/mh_page/new_Home_page.dart';
|
||||||
import 'package:vbvs_app/pages/device_control/score_page.dart';
|
import 'package:vbvs_app/pages/mh_page/new_mine_page.dart';
|
||||||
|
import 'package:vbvs_app/pages/mh_page/register_page.dart';
|
||||||
|
import 'package:vbvs_app/pages/mh_page/score_page.dart';
|
||||||
|
|
||||||
class MainPageBBottomChange extends StatefulWidget {
|
class MainPageBBottomChange extends StatefulWidget {
|
||||||
@override
|
@override
|
||||||
@@ -182,7 +184,8 @@ class _HomePageState extends State<MainPageBBottomChange>
|
|||||||
NewHomePage(),
|
NewHomePage(),
|
||||||
// PeopleInfoPage(),
|
// PeopleInfoPage(),
|
||||||
// Text('报告'),
|
// Text('报告'),
|
||||||
ScorePage(),
|
RegisterPage(),
|
||||||
|
// FindPasswordPage(),
|
||||||
// Smys(),
|
// Smys(),
|
||||||
MattressControlPage(),
|
MattressControlPage(),
|
||||||
NewMinePage()
|
NewMinePage()
|
||||||
|
|||||||
224
lib/pages/mh_page/MhMessageList.dart
Normal file
224
lib/pages/mh_page/MhMessageList.dart
Normal file
@@ -0,0 +1,224 @@
|
|||||||
|
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/color/app_uri_status.dart';
|
||||||
|
import 'package:vbvs_app/common/util/FitTool.dart';
|
||||||
|
import 'package:vbvs_app/component/tool/ClickableContainer.dart';
|
||||||
|
import 'package:vbvs_app/component/tool/CustomCard.dart';
|
||||||
|
import 'package:vbvs_app/component/tool/TopSlideNotification.dart';
|
||||||
|
import 'package:vbvs_app/controller/device/device_share_controller.dart';
|
||||||
|
import 'package:vbvs_app/controller/message/message_controller.dart';
|
||||||
|
import 'package:vbvs_app/controller/theme_controller/ThemeController.dart';
|
||||||
|
import 'package:vbvs_app/enum/MessageStatus.dart';
|
||||||
|
import 'package:vbvs_app/model/api_response.dart';
|
||||||
|
import 'package:vbvs_app/pages/device_bind/componnet/bind_dialog.dart';
|
||||||
|
|
||||||
|
class MhMessageListWidget extends StatefulWidget {
|
||||||
|
final data;
|
||||||
|
|
||||||
|
const MhMessageListWidget({super.key, required this.data});
|
||||||
|
|
||||||
|
@override
|
||||||
|
State<MhMessageListWidget> createState() => _MhMessageListWidgetState();
|
||||||
|
}
|
||||||
|
|
||||||
|
class _MhMessageListWidgetState extends State<MhMessageListWidget> {
|
||||||
|
ThemeController themeController = Get.find();
|
||||||
|
MessageController messageController = Get.find();
|
||||||
|
DeviceShareController deviceShareController = Get.find();
|
||||||
|
|
||||||
|
@override
|
||||||
|
Widget build(BuildContext context) {
|
||||||
|
var messageInfo = widget.data;
|
||||||
|
print(messageInfo);
|
||||||
|
return Stack(
|
||||||
|
children: [
|
||||||
|
ClickableContainer(
|
||||||
|
backgroundColor: Color(0xFF003058),
|
||||||
|
highlightColor: Color(0xFF055466),
|
||||||
|
borderRadius: 20.rpx,
|
||||||
|
padding:
|
||||||
|
EdgeInsetsDirectional.fromSTEB(31.rpx, 33.rpx, 0.rpx, 33.rpx),
|
||||||
|
onTap: () {},
|
||||||
|
child: Column(
|
||||||
|
mainAxisSize: MainAxisSize.max,
|
||||||
|
children: [
|
||||||
|
Container(
|
||||||
|
width: double.infinity,
|
||||||
|
constraints: BoxConstraints(
|
||||||
|
minHeight: 66.rpx,
|
||||||
|
),
|
||||||
|
child: Align(
|
||||||
|
alignment: AlignmentDirectional(-1, 0),
|
||||||
|
child: Text(
|
||||||
|
// '实时监测结果通知'.tr,
|
||||||
|
"${messageInfo['data']['title']}",
|
||||||
|
style: FlutterFlowTheme.of(context).bodyMedium.override(
|
||||||
|
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(
|
||||||
|
mainAxisSize: MainAxisSize.max,
|
||||||
|
crossAxisAlignment: CrossAxisAlignment.start,
|
||||||
|
children: messageInfo['data']['val']
|
||||||
|
.map<Widget>((mapItem) =>
|
||||||
|
_buildInfoItem(context, mapItem['k'] ?? ''))
|
||||||
|
.toList(),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
Container(
|
||||||
|
constraints: BoxConstraints(
|
||||||
|
minWidth: 30.rpx,
|
||||||
|
),
|
||||||
|
child: Column(
|
||||||
|
mainAxisSize: MainAxisSize.max,
|
||||||
|
crossAxisAlignment: CrossAxisAlignment.start,
|
||||||
|
children: messageInfo['data']['val']
|
||||||
|
.map<Widget>((mapItem) =>
|
||||||
|
_buildValueItem(context, mapItem['v'] ?? ''))
|
||||||
|
.toList(),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
].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,
|
||||||
|
child: CustomCard(
|
||||||
|
borderRadius: AppConstants().button_container_radius, // 直角
|
||||||
|
colors: messageInfo['status'] == 1
|
||||||
|
? [
|
||||||
|
themeController.currentColor.sc1,
|
||||||
|
themeController.currentColor.sc2
|
||||||
|
]
|
||||||
|
: [themeController.currentColor.sc4], // 单色背景
|
||||||
|
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: () {});
|
||||||
|
}
|
||||||
|
},
|
||||||
|
child: Center(
|
||||||
|
child: Text(
|
||||||
|
getMessageStatus(messageInfo['status']),
|
||||||
|
style: FlutterFlowTheme.of(context).bodyMedium.override(
|
||||||
|
fontFamily: 'Inter',
|
||||||
|
fontSize: 26.rpx,
|
||||||
|
letterSpacing: 0.0,
|
||||||
|
color: Colors.white,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
],
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
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: FlutterFlowTheme.of(context).bodyMedium.override(
|
||||||
|
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: FlutterFlowTheme.of(context).bodyMedium.override(
|
||||||
|
fontFamily: 'Inter',
|
||||||
|
fontSize: 26.rpx,
|
||||||
|
letterSpacing: 0.0,
|
||||||
|
color: themeController.currentColor.sc3,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
String getMessageStatus(int status) {
|
||||||
|
if (status == null) {
|
||||||
|
return '未知数据'.tr;
|
||||||
|
}
|
||||||
|
if (status == MessageStatus.noNeed.code) {
|
||||||
|
return '无需处理'.tr;
|
||||||
|
}
|
||||||
|
if (status == MessageStatus.pending.code) {
|
||||||
|
return "待处理".tr;
|
||||||
|
}
|
||||||
|
if (status == MessageStatus.completed.code) {
|
||||||
|
return "已处理".tr;
|
||||||
|
}
|
||||||
|
if (status == MessageStatus.timeout.code) {
|
||||||
|
return "已超时".tr;
|
||||||
|
}
|
||||||
|
return '未知数据'.tr;
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -5,9 +5,9 @@ import 'package:vbvs_app/common/color/appConstants.dart';
|
|||||||
import 'package:vbvs_app/common/color/appFontsize.dart';
|
import 'package:vbvs_app/common/color/appFontsize.dart';
|
||||||
import 'package:vbvs_app/common/util/FitTool.dart';
|
import 'package:vbvs_app/common/util/FitTool.dart';
|
||||||
import 'package:vbvs_app/common/util/MyUtils.dart';
|
import 'package:vbvs_app/common/util/MyUtils.dart';
|
||||||
import 'package:vbvs_app/controller/mh/address_list_controller.dart';
|
import 'package:vbvs_app/controller/mh_controller/address_list_controller.dart';
|
||||||
import 'package:vbvs_app/pages/device_control/EmptyMessageWidget.dart';
|
import 'package:vbvs_app/pages/mh_page/EmptyMessageWidget.dart';
|
||||||
import 'package:vbvs_app/pages/device_control/address_module_widget.dart';
|
import 'package:vbvs_app/pages/mh_page/address_module_widget.dart';
|
||||||
|
|
||||||
class AddressListPage extends GetView<AddressListController> {
|
class AddressListPage extends GetView<AddressListController> {
|
||||||
final scaffoldKey = GlobalKey<ScaffoldState>();
|
final scaffoldKey = GlobalKey<ScaffoldState>();
|
||||||
@@ -2,7 +2,7 @@ import 'package:ef/ef.dart';
|
|||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
import 'package:flutterflow_ui/flutterflow_ui.dart';
|
import 'package:flutterflow_ui/flutterflow_ui.dart';
|
||||||
import 'package:flutter_slidable/flutter_slidable.dart';
|
import 'package:flutter_slidable/flutter_slidable.dart';
|
||||||
import 'package:vbvs_app/controller/mh/address_list_controller.dart';
|
import 'package:vbvs_app/controller/mh_controller/address_list_controller.dart';
|
||||||
|
|
||||||
import '../../common/color/appFontsize.dart';
|
import '../../common/color/appFontsize.dart';
|
||||||
|
|
||||||
46
lib/pages/mh_page/app_map_location.dart
Normal file
46
lib/pages/mh_page/app_map_location.dart
Normal file
@@ -0,0 +1,46 @@
|
|||||||
|
import 'package:map_launcher/map_launcher.dart';
|
||||||
|
|
||||||
|
class AppMapLocation {
|
||||||
|
static List<AvailableMap> availableMaps = [];
|
||||||
|
static List availableMapsToNames = [];
|
||||||
|
|
||||||
|
static Future<void> checkInstalledApps() async {
|
||||||
|
availableMaps = await MapLauncher.installedMaps;
|
||||||
|
availableMapsToNames = availableMaps.map((AvailableMap m) {
|
||||||
|
String v = "";
|
||||||
|
switch (m.mapType) {
|
||||||
|
case MapType.baidu:
|
||||||
|
v = '百度地图';
|
||||||
|
break;
|
||||||
|
case MapType.tencent:
|
||||||
|
v = '腾讯地图';
|
||||||
|
break;
|
||||||
|
case MapType.amap:
|
||||||
|
v = '高德地图';
|
||||||
|
break;
|
||||||
|
case MapType.apple:
|
||||||
|
v = 'Apple地图';
|
||||||
|
break;
|
||||||
|
case MapType.google:
|
||||||
|
v = 'Google地图';
|
||||||
|
break;
|
||||||
|
case MapType.googleGo:
|
||||||
|
v = 'Google地图Go';
|
||||||
|
break;
|
||||||
|
case MapType.petal:
|
||||||
|
v = 'Petal地图';
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
v = m.mapName;
|
||||||
|
}
|
||||||
|
return v;
|
||||||
|
}).toList();
|
||||||
|
}
|
||||||
|
|
||||||
|
static void launchMap(index, title, double latitude, double longitude) async {
|
||||||
|
await availableMaps[index].showMarker(
|
||||||
|
coords: Coords(latitude, longitude),
|
||||||
|
title: title,
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -8,7 +8,7 @@ import 'package:vbvs_app/common/util/MyUtils.dart';
|
|||||||
import 'package:vbvs_app/component/img/img_default_widget.dart';
|
import 'package:vbvs_app/component/img/img_default_widget.dart';
|
||||||
import 'package:vbvs_app/component/img/img_preview_widget.dart';
|
import 'package:vbvs_app/component/img/img_preview_widget.dart';
|
||||||
import 'package:vbvs_app/component/tool/CustomCard.dart';
|
import 'package:vbvs_app/component/tool/CustomCard.dart';
|
||||||
import 'package:vbvs_app/controller/mh/apply_repair_controller.dart';
|
import 'package:vbvs_app/controller/mh_controller/apply_repair_controller.dart';
|
||||||
|
|
||||||
class ApplyRepairPage extends GetView<ApplyRepairController> {
|
class ApplyRepairPage extends GetView<ApplyRepairController> {
|
||||||
final scaffoldKey = GlobalKey<ScaffoldState>();
|
final scaffoldKey = GlobalKey<ScaffoldState>();
|
||||||
@@ -1790,7 +1790,7 @@ class ApplyRepairPage extends GetView<ApplyRepairController> {
|
|||||||
borderRadius: BorderRadius.circular(16.rpx),
|
borderRadius: BorderRadius.circular(16.rpx),
|
||||||
),
|
),
|
||||||
child: CustomCard(
|
child: CustomCard(
|
||||||
borderRadius: 10,
|
borderRadius: 16.rpx,
|
||||||
gradientDirection: GradientDirection.vertical,
|
gradientDirection: GradientDirection.vertical,
|
||||||
onTap: () {
|
onTap: () {
|
||||||
// print('Button pressed ...');
|
// print('Button pressed ...');
|
||||||
@@ -1,7 +1,7 @@
|
|||||||
import 'package:ef/ef.dart';
|
import 'package:ef/ef.dart';
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
import 'package:vbvs_app/common/util/MyUtils.dart';
|
import 'package:vbvs_app/common/util/MyUtils.dart';
|
||||||
import 'package:vbvs_app/controller/mh/book_info_controller.dart';
|
import 'package:vbvs_app/controller/mh_controller/book_info_controller.dart';
|
||||||
|
|
||||||
class BookDateWidget extends GetView<BookInfoController> {
|
class BookDateWidget extends GetView<BookInfoController> {
|
||||||
// final String week;
|
// final String week;
|
||||||
@@ -1,15 +1,13 @@
|
|||||||
import 'package:ef/ef.dart';
|
import 'package:ef/ef.dart';
|
||||||
import 'package:flutter/material.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/color/appConstants.dart';
|
||||||
import 'package:vbvs_app/common/color/appFontsize.dart';
|
import 'package:vbvs_app/common/color/appFontsize.dart';
|
||||||
import 'package:vbvs_app/common/util/FitTool.dart';
|
import 'package:vbvs_app/common/util/FitTool.dart';
|
||||||
import 'package:vbvs_app/common/util/MyUtils.dart';
|
import 'package:vbvs_app/common/util/MyUtils.dart';
|
||||||
import 'package:vbvs_app/component/tool/CustomCard.dart';
|
import 'package:vbvs_app/component/tool/CustomCard.dart';
|
||||||
import 'package:vbvs_app/controller/mh/book_info_controller.dart';
|
import 'package:vbvs_app/controller/mh_controller/book_info_controller.dart';
|
||||||
import 'package:vbvs_app/pages/common/selectDialog.dart';
|
import 'package:vbvs_app/pages/common/selectDialog.dart';
|
||||||
import 'package:vbvs_app/pages/device_control/book_date_widget.dart';
|
import 'package:vbvs_app/pages/mh_page/book_date_widget.dart';
|
||||||
|
|
||||||
class BookInfoPage extends GetView<BookInfoController> {
|
class BookInfoPage extends GetView<BookInfoController> {
|
||||||
final scaffoldKey = GlobalKey<ScaffoldState>();
|
final scaffoldKey = GlobalKey<ScaffoldState>();
|
||||||
@@ -651,7 +649,7 @@ class BookInfoPage extends GetView<BookInfoController> {
|
|||||||
padding: const EdgeInsetsDirectional.fromSTEB(
|
padding: const EdgeInsetsDirectional.fromSTEB(
|
||||||
15, 0, 15, AppConstants.page_button_bottom_padding),
|
15, 0, 15, AppConstants.page_button_bottom_padding),
|
||||||
child: CustomCard(
|
child: CustomCard(
|
||||||
borderRadius: 10,
|
borderRadius: 16.rpx,
|
||||||
gradientDirection: GradientDirection.vertical,
|
gradientDirection: GradientDirection.vertical,
|
||||||
onTap: () {
|
onTap: () {
|
||||||
// if (controller.model.select_time_index == null) {
|
// if (controller.model.select_time_index == null) {
|
||||||
@@ -131,29 +131,29 @@ class BookSuccessPage extends GetView {
|
|||||||
SizedBox(height: 20), // 上间距
|
SizedBox(height: 20), // 上间距
|
||||||
for (var item in infoList)
|
for (var item in infoList)
|
||||||
Container(
|
Container(
|
||||||
height: 60.rpx,
|
height: 60.rpx,
|
||||||
padding: EdgeInsets.symmetric(horizontal: 35),
|
padding:
|
||||||
alignment: Alignment.centerLeft,
|
EdgeInsets.symmetric(horizontal: 35.rpx),
|
||||||
child: Row(
|
alignment: Alignment.centerLeft,
|
||||||
children: [
|
child: Row(
|
||||||
Text(
|
children: [
|
||||||
item['label']!,
|
Text(
|
||||||
style: TextStyle(
|
item['label']!,
|
||||||
color: Color(0XFF929699),
|
style: TextStyle(
|
||||||
fontSize: 26.rpx,
|
color: Color(0XFF929699),
|
||||||
|
fontSize: 26.rpx,
|
||||||
|
),
|
||||||
),
|
),
|
||||||
),
|
SizedBox(width: 30.rpx),
|
||||||
SizedBox(width: 35.rpx),
|
Text(
|
||||||
Text(
|
item['value']!,
|
||||||
item['value']!,
|
style: TextStyle(
|
||||||
style: TextStyle(
|
color: Colors.white,
|
||||||
color: Colors.white,
|
fontSize: 26.rpx,
|
||||||
fontSize: 26.rpx,
|
),
|
||||||
),
|
),
|
||||||
),
|
],
|
||||||
],
|
)),
|
||||||
),
|
|
||||||
),
|
|
||||||
|
|
||||||
SizedBox(height: 60.rpx), // 空间隔断
|
SizedBox(height: 60.rpx), // 空间隔断
|
||||||
Padding(
|
Padding(
|
||||||
@@ -162,41 +162,59 @@ class BookSuccessPage extends GetView {
|
|||||||
mainAxisAlignment: MainAxisAlignment.center,
|
mainAxisAlignment: MainAxisAlignment.center,
|
||||||
children: [
|
children: [
|
||||||
SizedBox(
|
SizedBox(
|
||||||
width: 200.rpx,
|
width: 200.rpx,
|
||||||
height: 60.rpx,
|
height: 60.rpx,
|
||||||
child: ElevatedButton(
|
child: ElevatedButton(
|
||||||
onPressed: () {},
|
style: ElevatedButton.styleFrom(
|
||||||
child: Text("关闭",
|
backgroundColor: Color(0xFF84F5FF),
|
||||||
style: TextStyle(
|
padding: EdgeInsets.zero, // 去除文字内边距
|
||||||
|
tapTargetSize: MaterialTapTargetSize
|
||||||
|
.shrinkWrap, // 去除额外点击区域
|
||||||
|
// shape:
|
||||||
|
// RoundedRectangleBorder(), // 可选:去除默认圆角
|
||||||
|
),
|
||||||
|
onPressed: () {},
|
||||||
|
child: Center(
|
||||||
|
// 保证文字居中
|
||||||
|
child: Text(
|
||||||
|
"关闭",
|
||||||
|
style: TextStyle(
|
||||||
color: Color(0XFF011D33),
|
color: Color(0XFF011D33),
|
||||||
fontSize: 26.rpx)),
|
fontSize: 26.rpx,
|
||||||
style: ElevatedButton.styleFrom(
|
),
|
||||||
backgroundColor: Color(0xFF84F5FF),
|
),
|
||||||
// minimumSize: Size(0, 60),
|
),
|
||||||
),
|
)),
|
||||||
),
|
|
||||||
),
|
|
||||||
SizedBox(width: 60.rpx),
|
SizedBox(width: 60.rpx),
|
||||||
SizedBox(
|
SizedBox(
|
||||||
width: 200.rpx,
|
width: 200.rpx,
|
||||||
height: 60.rpx,
|
height: 60.rpx,
|
||||||
child: ElevatedButton(
|
child: ElevatedButton(
|
||||||
onPressed: () {},
|
style: ElevatedButton.styleFrom(
|
||||||
child: Text("我的预约",
|
backgroundColor: Color(0xFF84F5FF),
|
||||||
style: TextStyle(
|
padding: EdgeInsets.zero, // 去除文字内边距
|
||||||
|
tapTargetSize: MaterialTapTargetSize
|
||||||
|
.shrinkWrap, // 去除额外点击区域
|
||||||
|
// shape:
|
||||||
|
// RoundedRectangleBorder(), // 可选:去除默认圆角
|
||||||
|
),
|
||||||
|
onPressed: () {},
|
||||||
|
child: Center(
|
||||||
|
// 保证文字居中
|
||||||
|
child: Text(
|
||||||
|
"我的预约",
|
||||||
|
style: TextStyle(
|
||||||
color: Color(0XFF011D33),
|
color: Color(0XFF011D33),
|
||||||
fontSize: 26.rpx)),
|
fontSize: 26.rpx,
|
||||||
style: ElevatedButton.styleFrom(
|
),
|
||||||
backgroundColor: Color(0xFF84F5FF),
|
),
|
||||||
// minimumSize: Size(0, 60),
|
),
|
||||||
),
|
))
|
||||||
),
|
|
||||||
)
|
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
|
|
||||||
SizedBox(height: 80), // 下间距
|
SizedBox(height: 80.rpx), // 下间距
|
||||||
],
|
],
|
||||||
)),
|
)),
|
||||||
),
|
),
|
||||||
@@ -9,8 +9,8 @@ import 'package:vbvs_app/common/color/appFontsize.dart';
|
|||||||
import 'package:vbvs_app/common/util/FitTool.dart';
|
import 'package:vbvs_app/common/util/FitTool.dart';
|
||||||
import 'package:vbvs_app/common/util/MyUtils.dart';
|
import 'package:vbvs_app/common/util/MyUtils.dart';
|
||||||
import 'package:vbvs_app/component/tool/CustomCard.dart';
|
import 'package:vbvs_app/component/tool/CustomCard.dart';
|
||||||
import 'package:vbvs_app/controller/mh/address_controller.dart';
|
import 'package:vbvs_app/controller/mh_controller/address_controller.dart';
|
||||||
import 'package:vbvs_app/controller/mh/address_list_controller.dart';
|
import 'package:vbvs_app/controller/mh_controller/address_list_controller.dart';
|
||||||
|
|
||||||
class EditAddressPage extends GetView<AddressController>
|
class EditAddressPage extends GetView<AddressController>
|
||||||
implements CityPickerListener {
|
implements CityPickerListener {
|
||||||
@@ -1091,7 +1091,7 @@ class EditAddressPage extends GetView<AddressController>
|
|||||||
padding: const EdgeInsetsDirectional.fromSTEB(15, 0,
|
padding: const EdgeInsetsDirectional.fromSTEB(15, 0,
|
||||||
15, AppConstants.page_button_bottom_padding),
|
15, AppConstants.page_button_bottom_padding),
|
||||||
child: CustomCard(
|
child: CustomCard(
|
||||||
borderRadius: 10,
|
borderRadius: 16.rpx,
|
||||||
gradientDirection: GradientDirection.vertical,
|
gradientDirection: GradientDirection.vertical,
|
||||||
onTap: () {
|
onTap: () {
|
||||||
// if (controller.model.all_address == null ||
|
// if (controller.model.all_address == null ||
|
||||||
@@ -170,7 +170,7 @@ class _EditBedPageState extends State<EditBedPage> {
|
|||||||
padding: EdgeInsets.only(
|
padding: EdgeInsets.only(
|
||||||
left: 30.rpx, right: 30.rpx, bottom: 85.rpx),
|
left: 30.rpx, right: 30.rpx, bottom: 85.rpx),
|
||||||
child: CustomCard(
|
child: CustomCard(
|
||||||
borderRadius: 10,
|
borderRadius: 16.rpx,
|
||||||
gradientDirection: GradientDirection.vertical,
|
gradientDirection: GradientDirection.vertical,
|
||||||
onTap: () {},
|
onTap: () {},
|
||||||
colors: const [
|
colors: const [
|
||||||
@@ -1,4 +1,5 @@
|
|||||||
import 'package:ef/base/widget/flutterflow/FlutterFlowTheme.dart';
|
import 'package:ef/base/widget/flutterflow/FlutterFlowTheme.dart';
|
||||||
|
import 'package:ef/ef.dart';
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
|
|
||||||
import 'package:get/get.dart';
|
import 'package:get/get.dart';
|
||||||
@@ -6,7 +7,7 @@ import 'package:vbvs_app/common/util/FitTool.dart';
|
|||||||
import 'package:vbvs_app/common/util/MyUtils.dart';
|
import 'package:vbvs_app/common/util/MyUtils.dart';
|
||||||
import 'package:vbvs_app/component/tool/CustomCard.dart';
|
import 'package:vbvs_app/component/tool/CustomCard.dart';
|
||||||
|
|
||||||
import '../../controller/mh/muser_info_controller.dart';
|
import '../../controller/mh_controller/muser_info_controller.dart';
|
||||||
|
|
||||||
class EditUserInfoPage extends GetView<MUserInfoController> {
|
class EditUserInfoPage extends GetView<MUserInfoController> {
|
||||||
final scaffoldKey = GlobalKey<ScaffoldState>();
|
final scaffoldKey = GlobalKey<ScaffoldState>();
|
||||||
@@ -15,6 +16,7 @@ class EditUserInfoPage extends GetView<MUserInfoController> {
|
|||||||
// UserInfoController controller = Get.find();
|
// UserInfoController controller = Get.find();
|
||||||
// controller.model.user!.tmpHead = controller.model.user!.head;
|
// controller.model.user!.tmpHead = controller.model.user!.head;
|
||||||
// }
|
// }
|
||||||
|
MUserInfoController controller = Get.find();
|
||||||
|
|
||||||
@override
|
@override
|
||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
@@ -59,7 +61,7 @@ class EditUserInfoPage extends GetView<MUserInfoController> {
|
|||||||
Positioned(
|
Positioned(
|
||||||
right: 30.rpx,
|
right: 30.rpx,
|
||||||
child: CustomCard(
|
child: CustomCard(
|
||||||
borderRadius: 10,
|
borderRadius: 16.rpx,
|
||||||
gradientDirection: GradientDirection.vertical,
|
gradientDirection: GradientDirection.vertical,
|
||||||
onTap: () {},
|
onTap: () {},
|
||||||
colors: const [
|
colors: const [
|
||||||
@@ -139,11 +141,36 @@ class EditUserInfoPage extends GetView<MUserInfoController> {
|
|||||||
),
|
),
|
||||||
),
|
),
|
||||||
alignment: Alignment(0, 0),
|
alignment: Alignment(0, 0),
|
||||||
child: Text(
|
child: TextField(
|
||||||
'玛利亚',
|
obscureText: false,
|
||||||
style: TextStyle(
|
keyboardType: TextInputType.number,
|
||||||
color: Color(0XFFFFFFFF), fontSize: 26.rpx),
|
textInputAction: TextInputAction.done,
|
||||||
|
textAlign: TextAlign.center,
|
||||||
|
style: TextStyle(fontSize: 30.rpx, color: Colors.white),
|
||||||
|
decoration: InputDecoration(
|
||||||
|
fillColor: Colors.transparent,
|
||||||
|
filled: true,
|
||||||
|
hintText: "请输入昵称",
|
||||||
|
hintStyle: TextStyle(color: Colors.white),
|
||||||
|
border: InputBorder.none,
|
||||||
|
contentPadding: EdgeInsets.all(0)),
|
||||||
|
onChanged: (value) {
|
||||||
|
controller.model.user?.nickName = value;
|
||||||
|
controller.updateAll();
|
||||||
|
},
|
||||||
|
controller: controller.onReDraw(
|
||||||
|
TextEditingController(
|
||||||
|
text: controller.model.user?.nickName ?? ""),
|
||||||
|
(textEditingController) {
|
||||||
|
textEditingController.text =
|
||||||
|
controller.model.user?.nickName ?? "";
|
||||||
|
}),
|
||||||
),
|
),
|
||||||
|
// Text(
|
||||||
|
// '玛利亚',
|
||||||
|
// style: TextStyle(
|
||||||
|
// color: Color(0XFFFFFFFF), fontSize: 26.rpx),
|
||||||
|
// ),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
],
|
],
|
||||||
@@ -10,10 +10,10 @@ import 'package:vbvs_app/common/color/appFontsize.dart';
|
|||||||
import 'package:vbvs_app/common/util/FitTool.dart';
|
import 'package:vbvs_app/common/util/FitTool.dart';
|
||||||
import 'package:vbvs_app/common/util/MyUtils.dart';
|
import 'package:vbvs_app/common/util/MyUtils.dart';
|
||||||
import 'package:vbvs_app/component/tool/ClickableContainer.dart';
|
import 'package:vbvs_app/component/tool/ClickableContainer.dart';
|
||||||
import 'package:vbvs_app/controller/mh/experience_store_list_page.dart';
|
import 'package:vbvs_app/controller/mh_controller/experience_store_list_page.dart';
|
||||||
import 'package:vbvs_app/pages/device_control/Empty.dart';
|
import 'package:vbvs_app/pages/mh_page/Empty.dart';
|
||||||
import 'package:vbvs_app/pages/device_control/experience_store_widget.dart';
|
import 'package:vbvs_app/pages/mh_page/experience_store_widget.dart';
|
||||||
import 'package:vbvs_app/pages/device_control/searchWidget.dart';
|
import 'package:vbvs_app/pages/mh_page/searchWidget.dart';
|
||||||
|
|
||||||
class ExperienceStorePage extends GetView<ExperienceStoreListController> {
|
class ExperienceStorePage extends GetView<ExperienceStoreListController> {
|
||||||
ExperienceStorePage({super.key});
|
ExperienceStorePage({super.key});
|
||||||
@@ -3,9 +3,9 @@ import 'package:flutter/material.dart';
|
|||||||
import 'package:flutter_svg/svg.dart';
|
import 'package:flutter_svg/svg.dart';
|
||||||
import 'package:flutterflow_ui/flutterflow_ui.dart';
|
import 'package:flutterflow_ui/flutterflow_ui.dart';
|
||||||
import 'package:vbvs_app/common/util/FitTool.dart';
|
import 'package:vbvs_app/common/util/FitTool.dart';
|
||||||
import 'package:vbvs_app/controller/mh/book_info_controller.dart';
|
import 'package:vbvs_app/controller/mh_controller/book_info_controller.dart';
|
||||||
import 'package:vbvs_app/pages/common/selectDialog.dart';
|
import 'package:vbvs_app/pages/common/selectDialog.dart';
|
||||||
import 'package:vbvs_app/pages/device_control/app_map_location.dart';
|
import 'package:vbvs_app/pages/mh_page/app_map_location.dart';
|
||||||
|
|
||||||
import '../../common/color/appFontsize.dart';
|
import '../../common/color/appFontsize.dart';
|
||||||
import '../../common/util/MyUtils.dart';
|
import '../../common/util/MyUtils.dart';
|
||||||
@@ -188,7 +188,7 @@ class ExperienceStoreWidget extends GetView {
|
|||||||
Flexible(
|
Flexible(
|
||||||
child: InkWell(
|
child: InkWell(
|
||||||
onTap: () async {
|
onTap: () async {
|
||||||
// //"latitude" -> "31.858934" "longitude" -> "117.282166"
|
//"latitude" -> "31.858934" "longitude" -> "117.282166"
|
||||||
// AppMapLocation.checkInstalledApps()
|
// AppMapLocation.checkInstalledApps()
|
||||||
// .then((d) {
|
// .then((d) {
|
||||||
// if (AppMapLocation
|
// if (AppMapLocation
|
||||||
630
lib/pages/mh_page/find_password_page.dart
Normal file
630
lib/pages/mh_page/find_password_page.dart
Normal file
@@ -0,0 +1,630 @@
|
|||||||
|
import 'package:ef/ef.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/tool/CustomCard.dart';
|
||||||
|
import 'package:vbvs_app/controller/mh_controller/find_password_controller.dart';
|
||||||
|
import 'package:vbvs_app/controller/time/countdown_controller.dart';
|
||||||
|
|
||||||
|
class FindPasswordPage extends GetView<FindPasswordController> {
|
||||||
|
final scaffoldKey = GlobalKey<ScaffoldState>();
|
||||||
|
BoxConstraints? bodysize;
|
||||||
|
|
||||||
|
final ScrollController _scrollController = ScrollController();
|
||||||
|
final FocusNode _focusNode1 = FocusNode();
|
||||||
|
final FocusNode _focusNode2 = FocusNode();
|
||||||
|
|
||||||
|
FindPasswordPage() {
|
||||||
|
controller.model.pdshow = true;
|
||||||
|
controller.model.cpdshow = true;
|
||||||
|
_focusNode1.addListener(() {
|
||||||
|
if (_focusNode1.hasFocus) {
|
||||||
|
MyUtils.scrollToFocusedInput(_focusNode1, _scrollController);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
_focusNode2.addListener(() {
|
||||||
|
if (_focusNode2.hasFocus) {
|
||||||
|
MyUtils.scrollToFocusedInput(_focusNode2, _scrollController);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
@override
|
||||||
|
Widget build(BuildContext context) {
|
||||||
|
return LayoutBuilder(builder: (context, cc) {
|
||||||
|
bodysize = cc;
|
||||||
|
return GestureDetector(
|
||||||
|
onTap: () => FocusScope.of(context).unfocus(),
|
||||||
|
child: Container(
|
||||||
|
decoration: const BoxDecoration(
|
||||||
|
image: DecorationImage(
|
||||||
|
image: AssetImage('assets/images/new_background.png'), // 本地图片
|
||||||
|
fit: BoxFit.fill, // 填满整个 Container
|
||||||
|
),
|
||||||
|
),
|
||||||
|
child: Scaffold(
|
||||||
|
// key: scaffoldKey,
|
||||||
|
backgroundColor: Colors.transparent,
|
||||||
|
appBar: AppBar(
|
||||||
|
backgroundColor: Colors.transparent,
|
||||||
|
automaticallyImplyLeading: false,
|
||||||
|
iconTheme: IconThemeData(color: Colors.white),
|
||||||
|
titleSpacing: 0,
|
||||||
|
title: Container(
|
||||||
|
width: double.infinity,
|
||||||
|
height: 180.rpx,
|
||||||
|
child: Stack(
|
||||||
|
alignment: Alignment.center,
|
||||||
|
children: [
|
||||||
|
// 中间居中的标题
|
||||||
|
Text(
|
||||||
|
'找回密码',
|
||||||
|
textAlign: TextAlign.center,
|
||||||
|
style: TextStyle(
|
||||||
|
color: Colors.white,
|
||||||
|
fontSize: 30.rpx,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
// 左侧图标
|
||||||
|
Positioned(
|
||||||
|
left: 20.rpx,
|
||||||
|
child: returnIconButtomNew,
|
||||||
|
),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
),
|
||||||
|
actions: [],
|
||||||
|
centerTitle: false,
|
||||||
|
),
|
||||||
|
body: SingleChildScrollView(
|
||||||
|
controller: _scrollController,
|
||||||
|
child: Container(
|
||||||
|
width: bodysize!.maxWidth,
|
||||||
|
height: bodysize!.maxHeight * 1,
|
||||||
|
child: Column(
|
||||||
|
mainAxisSize: MainAxisSize.max,
|
||||||
|
children: [
|
||||||
|
// TitleComponentWidget(
|
||||||
|
// titleName: '找回密码',
|
||||||
|
// ),
|
||||||
|
Expanded(
|
||||||
|
child: Padding(
|
||||||
|
padding: EdgeInsetsDirectional.fromSTEB(
|
||||||
|
98.rpx, 0, 98.rpx, 0),
|
||||||
|
child: Container(
|
||||||
|
width: bodysize!.maxWidth,
|
||||||
|
height: bodysize!.maxHeight * 0.886,
|
||||||
|
decoration: BoxDecoration(),
|
||||||
|
child: Container(
|
||||||
|
width: bodysize!.maxWidth,
|
||||||
|
height: bodysize!.maxHeight * 1,
|
||||||
|
decoration: BoxDecoration(),
|
||||||
|
child: Column(
|
||||||
|
mainAxisSize: MainAxisSize.max,
|
||||||
|
children: [
|
||||||
|
Padding(
|
||||||
|
padding: EdgeInsetsDirectional.fromSTEB(
|
||||||
|
0, 184.rpx, 0, 0),
|
||||||
|
child: Container(
|
||||||
|
width: bodysize!.maxWidth,
|
||||||
|
height: 92.rpx,
|
||||||
|
decoration: BoxDecoration(),
|
||||||
|
child: Container(
|
||||||
|
width: bodysize!.maxWidth,
|
||||||
|
height: bodysize!.maxHeight * 0.06,
|
||||||
|
decoration: BoxDecoration(
|
||||||
|
color: Color(0xFFF3F5F6),
|
||||||
|
borderRadius:
|
||||||
|
BorderRadius.circular(12),
|
||||||
|
),
|
||||||
|
child: Align(
|
||||||
|
alignment:
|
||||||
|
AlignmentDirectional(0, 0),
|
||||||
|
child: TextFormField(
|
||||||
|
// focusNode: _focusNode1,
|
||||||
|
onChanged: (value) {
|
||||||
|
controller.model.phone = value;
|
||||||
|
},
|
||||||
|
// autofocus: true,
|
||||||
|
obscureText: false,
|
||||||
|
decoration: InputDecoration(
|
||||||
|
labelStyle:
|
||||||
|
FlutterFlowTheme.of(context)
|
||||||
|
.labelMedium
|
||||||
|
.override(
|
||||||
|
fontFamily:
|
||||||
|
'Readex Pro',
|
||||||
|
fontSize: 20.rpx,
|
||||||
|
letterSpacing: 0,
|
||||||
|
),
|
||||||
|
hintText: '请输入手机号',
|
||||||
|
hintStyle: FlutterFlowTheme.of(
|
||||||
|
context)
|
||||||
|
.labelMedium
|
||||||
|
.override(
|
||||||
|
fontFamily: 'Readex Pro',
|
||||||
|
color: Color(0xFF929699),
|
||||||
|
fontSize: 20.rpx,
|
||||||
|
letterSpacing: 0,
|
||||||
|
),
|
||||||
|
enabledBorder: InputBorder.none,
|
||||||
|
focusedBorder: InputBorder.none,
|
||||||
|
errorBorder: InputBorder.none,
|
||||||
|
focusedErrorBorder:
|
||||||
|
InputBorder.none,
|
||||||
|
contentPadding:
|
||||||
|
EdgeInsetsDirectional
|
||||||
|
.fromSTEB(20.rpx, 0, 0,
|
||||||
|
10.rpx),
|
||||||
|
),
|
||||||
|
style:
|
||||||
|
FlutterFlowTheme.of(context)
|
||||||
|
.bodyMedium
|
||||||
|
.override(
|
||||||
|
fontFamily:
|
||||||
|
'Readex Pro',
|
||||||
|
fontSize: 20.rpx,
|
||||||
|
letterSpacing: 0,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
Padding(
|
||||||
|
padding: EdgeInsetsDirectional.fromSTEB(
|
||||||
|
0, 32.rpx, 0, 0),
|
||||||
|
child: Container(
|
||||||
|
width: bodysize!.maxWidth,
|
||||||
|
height: 92.rpx,
|
||||||
|
decoration: BoxDecoration(),
|
||||||
|
child: Stack(
|
||||||
|
children: [
|
||||||
|
Align(
|
||||||
|
alignment:
|
||||||
|
AlignmentDirectional(0, 0),
|
||||||
|
child: Container(
|
||||||
|
width: bodysize!.maxWidth,
|
||||||
|
height: 92.rpx,
|
||||||
|
decoration: BoxDecoration(
|
||||||
|
color: Color(0xFFF3F5F6),
|
||||||
|
borderRadius:
|
||||||
|
BorderRadius.circular(12),
|
||||||
|
),
|
||||||
|
child: Align(
|
||||||
|
alignment:
|
||||||
|
AlignmentDirectional(
|
||||||
|
0, 0),
|
||||||
|
child: TextFormField(
|
||||||
|
// autofocus: true,
|
||||||
|
// focusNode: _focusNode2,
|
||||||
|
onChanged: (value) {
|
||||||
|
controller.model.code =
|
||||||
|
value;
|
||||||
|
},
|
||||||
|
obscureText: false,
|
||||||
|
decoration: InputDecoration(
|
||||||
|
labelStyle:
|
||||||
|
FlutterFlowTheme.of(
|
||||||
|
context)
|
||||||
|
.labelMedium
|
||||||
|
.override(
|
||||||
|
fontFamily:
|
||||||
|
'Readex Pro',
|
||||||
|
fontSize:
|
||||||
|
20.rpx,
|
||||||
|
letterSpacing:
|
||||||
|
0,
|
||||||
|
),
|
||||||
|
hintText: '请输验证码',
|
||||||
|
hintStyle:
|
||||||
|
FlutterFlowTheme.of(
|
||||||
|
context)
|
||||||
|
.labelMedium
|
||||||
|
.override(
|
||||||
|
fontFamily:
|
||||||
|
'Readex Pro',
|
||||||
|
color: Color(
|
||||||
|
0xFF929699),
|
||||||
|
fontSize:
|
||||||
|
20.rpx,
|
||||||
|
letterSpacing:
|
||||||
|
0,
|
||||||
|
),
|
||||||
|
enabledBorder:
|
||||||
|
InputBorder.none,
|
||||||
|
focusedBorder:
|
||||||
|
InputBorder.none,
|
||||||
|
errorBorder:
|
||||||
|
InputBorder.none,
|
||||||
|
focusedErrorBorder:
|
||||||
|
InputBorder.none,
|
||||||
|
contentPadding:
|
||||||
|
EdgeInsetsDirectional
|
||||||
|
.fromSTEB(20.rpx,
|
||||||
|
0, 0, 10.rpx),
|
||||||
|
),
|
||||||
|
style: FlutterFlowTheme.of(
|
||||||
|
context)
|
||||||
|
.bodyMedium
|
||||||
|
.override(
|
||||||
|
fontFamily:
|
||||||
|
'Readex Pro',
|
||||||
|
fontSize: 20.rpx,
|
||||||
|
letterSpacing: 0,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
Align(
|
||||||
|
alignment: AlignmentDirectional(
|
||||||
|
0.2, 0.3),
|
||||||
|
child: Container(
|
||||||
|
width: 3,
|
||||||
|
height: 30,
|
||||||
|
decoration: BoxDecoration(
|
||||||
|
color: Color(0xFFCCCCCC),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
Align(
|
||||||
|
alignment:
|
||||||
|
AlignmentDirectional(0.9, 0),
|
||||||
|
child: Container(
|
||||||
|
width:
|
||||||
|
bodysize!.maxWidth * 0.157,
|
||||||
|
height:
|
||||||
|
bodysize!.maxHeight * 0.014,
|
||||||
|
constraints: BoxConstraints(
|
||||||
|
minWidth: 118,
|
||||||
|
minHeight: 30,
|
||||||
|
),
|
||||||
|
decoration: BoxDecoration(),
|
||||||
|
child: Align(
|
||||||
|
alignment:
|
||||||
|
AlignmentDirectional(
|
||||||
|
0, 0),
|
||||||
|
child: Obx(() {
|
||||||
|
final CountdownController
|
||||||
|
countdownController =
|
||||||
|
Get.find<
|
||||||
|
CountdownController>();
|
||||||
|
return InkWell(
|
||||||
|
onTap: () async {
|
||||||
|
// if (countdownController
|
||||||
|
// .countdown.value !=
|
||||||
|
// 0) {
|
||||||
|
// return;
|
||||||
|
// }
|
||||||
|
// if (CommonVariables
|
||||||
|
// .isNetWorkOn ==
|
||||||
|
// false) {
|
||||||
|
// showToast(
|
||||||
|
// "网络未连接,请开启设备网络后重试");
|
||||||
|
// return;
|
||||||
|
// }
|
||||||
|
// String msg =
|
||||||
|
// await controller
|
||||||
|
// .getCode(context);
|
||||||
|
// if (msg.isNotEmpty) {
|
||||||
|
// return;
|
||||||
|
// }
|
||||||
|
// countdownController
|
||||||
|
// .countdown
|
||||||
|
// .value ==
|
||||||
|
// 0
|
||||||
|
// ? countdownController
|
||||||
|
// .startCountdown(
|
||||||
|
// AppConstants
|
||||||
|
// .code_time)
|
||||||
|
// : null;
|
||||||
|
},
|
||||||
|
child: Text(
|
||||||
|
countdownController
|
||||||
|
.countdown
|
||||||
|
.value ==
|
||||||
|
0
|
||||||
|
? '获取验证码'
|
||||||
|
: '${countdownController.countdown.value}秒',
|
||||||
|
style: TextStyle(
|
||||||
|
fontFamily:
|
||||||
|
'Readex Pro',
|
||||||
|
color:
|
||||||
|
Color(0xFF333333),
|
||||||
|
fontSize: 20.rpx,
|
||||||
|
letterSpacing: 0,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
);
|
||||||
|
}),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
Padding(
|
||||||
|
padding: EdgeInsetsDirectional.fromSTEB(
|
||||||
|
0, 32.rpx, 0, 0),
|
||||||
|
child: Container(
|
||||||
|
width: bodysize!.maxWidth,
|
||||||
|
height: 92.rpx,
|
||||||
|
decoration: BoxDecoration(),
|
||||||
|
child: Container(
|
||||||
|
width: bodysize!.maxWidth,
|
||||||
|
height: bodysize!.maxHeight * 0.06,
|
||||||
|
decoration: BoxDecoration(
|
||||||
|
color: Color(0xFFF3F5F6),
|
||||||
|
borderRadius:
|
||||||
|
BorderRadius.circular(12),
|
||||||
|
),
|
||||||
|
child: Align(
|
||||||
|
alignment:
|
||||||
|
AlignmentDirectional(0, 0),
|
||||||
|
child: Obx(() {
|
||||||
|
return TextFormField(
|
||||||
|
// autofocus: true,
|
||||||
|
// focusNode: _focusNode1,
|
||||||
|
onChanged: (value) {
|
||||||
|
controller.model.pd = value;
|
||||||
|
},
|
||||||
|
// obscureText: true,
|
||||||
|
obscureText:
|
||||||
|
controller.model.pdshow!,
|
||||||
|
decoration: InputDecoration(
|
||||||
|
labelStyle:
|
||||||
|
FlutterFlowTheme.of(
|
||||||
|
context)
|
||||||
|
.labelMedium
|
||||||
|
.override(
|
||||||
|
fontFamily:
|
||||||
|
'Readex Pro',
|
||||||
|
fontSize: 20.rpx,
|
||||||
|
letterSpacing: 0,
|
||||||
|
),
|
||||||
|
hintText: '请输入新密码',
|
||||||
|
hintStyle: FlutterFlowTheme
|
||||||
|
.of(context)
|
||||||
|
.labelMedium
|
||||||
|
.override(
|
||||||
|
fontFamily:
|
||||||
|
'Readex Pro',
|
||||||
|
color:
|
||||||
|
Color(0xFF929699),
|
||||||
|
fontSize: 20.rpx,
|
||||||
|
letterSpacing: 0,
|
||||||
|
),
|
||||||
|
enabledBorder:
|
||||||
|
InputBorder.none,
|
||||||
|
focusedBorder:
|
||||||
|
InputBorder.none,
|
||||||
|
errorBorder: InputBorder.none,
|
||||||
|
focusedErrorBorder:
|
||||||
|
InputBorder.none,
|
||||||
|
contentPadding:
|
||||||
|
EdgeInsetsDirectional
|
||||||
|
.fromSTEB(
|
||||||
|
10, 10, 0, 0),
|
||||||
|
suffixIcon: IconButton(
|
||||||
|
icon: Icon(
|
||||||
|
// 根据 pdshow 控制图标
|
||||||
|
controller.model.pdshow!
|
||||||
|
? Icons.visibility_off
|
||||||
|
: Icons.visibility,
|
||||||
|
color: Color(0xFF333333),
|
||||||
|
size: 16,
|
||||||
|
),
|
||||||
|
onPressed: () {
|
||||||
|
// 切换 pdshow 状态
|
||||||
|
controller.model.pdshow =
|
||||||
|
!controller
|
||||||
|
.model.pdshow!;
|
||||||
|
controller.updateAll();
|
||||||
|
},
|
||||||
|
),
|
||||||
|
),
|
||||||
|
style:
|
||||||
|
FlutterFlowTheme.of(context)
|
||||||
|
.bodyMedium
|
||||||
|
.override(
|
||||||
|
fontFamily:
|
||||||
|
'Readex Pro',
|
||||||
|
fontSize: 20.rpx,
|
||||||
|
letterSpacing: 0,
|
||||||
|
),
|
||||||
|
);
|
||||||
|
}),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
Padding(
|
||||||
|
padding: EdgeInsetsDirectional.fromSTEB(
|
||||||
|
0, 32.rpx, 0, 0),
|
||||||
|
child: Container(
|
||||||
|
width: bodysize!.maxWidth,
|
||||||
|
height: 92.rpx,
|
||||||
|
decoration: BoxDecoration(),
|
||||||
|
child: Container(
|
||||||
|
width: bodysize!.maxWidth,
|
||||||
|
height: bodysize!.maxHeight * 0.06,
|
||||||
|
decoration: BoxDecoration(
|
||||||
|
color: Color(0xFFF3F5F6),
|
||||||
|
borderRadius:
|
||||||
|
BorderRadius.circular(12),
|
||||||
|
),
|
||||||
|
child: Align(
|
||||||
|
alignment:
|
||||||
|
AlignmentDirectional(0, 0),
|
||||||
|
child: Obx(() {
|
||||||
|
return TextFormField(
|
||||||
|
// autofocus: true,
|
||||||
|
// focusNode: _focusNode2,
|
||||||
|
onChanged: (value) {
|
||||||
|
controller.model.confirm =
|
||||||
|
value;
|
||||||
|
},
|
||||||
|
// obscureText: true,
|
||||||
|
obscureText:
|
||||||
|
controller.model.cpdshow!,
|
||||||
|
decoration: InputDecoration(
|
||||||
|
labelStyle:
|
||||||
|
FlutterFlowTheme.of(
|
||||||
|
context)
|
||||||
|
.labelMedium
|
||||||
|
.override(
|
||||||
|
fontFamily:
|
||||||
|
'Readex Pro',
|
||||||
|
fontSize: 20.rpx,
|
||||||
|
letterSpacing: 0,
|
||||||
|
),
|
||||||
|
hintText: '确认新密码',
|
||||||
|
hintStyle: FlutterFlowTheme
|
||||||
|
.of(context)
|
||||||
|
.labelMedium
|
||||||
|
.override(
|
||||||
|
fontFamily:
|
||||||
|
'Readex Pro',
|
||||||
|
color:
|
||||||
|
Color(0xFF929699),
|
||||||
|
fontSize: 20.rpx,
|
||||||
|
letterSpacing: 0,
|
||||||
|
),
|
||||||
|
enabledBorder:
|
||||||
|
InputBorder.none,
|
||||||
|
focusedBorder:
|
||||||
|
InputBorder.none,
|
||||||
|
errorBorder: InputBorder.none,
|
||||||
|
focusedErrorBorder:
|
||||||
|
InputBorder.none,
|
||||||
|
contentPadding:
|
||||||
|
EdgeInsetsDirectional
|
||||||
|
.fromSTEB(
|
||||||
|
10, 10, 0, 0),
|
||||||
|
suffixIcon: IconButton(
|
||||||
|
icon: Icon(
|
||||||
|
// 根据 pdshow 控制图标
|
||||||
|
controller.model.cpdshow!
|
||||||
|
? Icons.visibility_off
|
||||||
|
: Icons.visibility,
|
||||||
|
color: Color(0xFF333333),
|
||||||
|
size: 16,
|
||||||
|
),
|
||||||
|
onPressed: () {
|
||||||
|
// 切换 pdshow 状态
|
||||||
|
controller.model.cpdshow =
|
||||||
|
!controller
|
||||||
|
.model.cpdshow!;
|
||||||
|
controller.updateAll();
|
||||||
|
},
|
||||||
|
),
|
||||||
|
),
|
||||||
|
style:
|
||||||
|
FlutterFlowTheme.of(context)
|
||||||
|
.bodyMedium
|
||||||
|
.override(
|
||||||
|
fontFamily:
|
||||||
|
'Readex Pro',
|
||||||
|
fontSize: 20.rpx,
|
||||||
|
letterSpacing: 0,
|
||||||
|
),
|
||||||
|
);
|
||||||
|
}),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
Padding(
|
||||||
|
padding: EdgeInsetsDirectional.fromSTEB(
|
||||||
|
42.rpx, 38.rpx, 42.rpx, 0),
|
||||||
|
child: Container(
|
||||||
|
width: bodysize!.maxWidth,
|
||||||
|
height: bodysize!.maxHeight * 0.022,
|
||||||
|
constraints: BoxConstraints(
|
||||||
|
minWidth: 466,
|
||||||
|
minHeight: 30,
|
||||||
|
),
|
||||||
|
decoration: BoxDecoration(),
|
||||||
|
child: Container(
|
||||||
|
width: bodysize!.maxWidth,
|
||||||
|
height: bodysize!.maxHeight * 0.022,
|
||||||
|
constraints: BoxConstraints(
|
||||||
|
minWidth: 466,
|
||||||
|
minHeight: 30,
|
||||||
|
),
|
||||||
|
decoration: BoxDecoration(),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
Padding(
|
||||||
|
padding: EdgeInsetsDirectional.fromSTEB(
|
||||||
|
0, 58.rpx, 0, 0),
|
||||||
|
child: Container(
|
||||||
|
width: bodysize!.maxWidth,
|
||||||
|
height: bodysize!.maxHeight * 0.056,
|
||||||
|
decoration: BoxDecoration(),
|
||||||
|
child: CustomCard(
|
||||||
|
borderRadius: 16.rpx,
|
||||||
|
gradientDirection:
|
||||||
|
GradientDirection.vertical,
|
||||||
|
onTap: () {
|
||||||
|
// if (CommonVariables.isNetWorkOn ==
|
||||||
|
// false) {
|
||||||
|
// showToast("网络未连接,请开启设备网络后重试");
|
||||||
|
// return;
|
||||||
|
// }
|
||||||
|
// String msg = await controller
|
||||||
|
// .confirmCode(context);
|
||||||
|
// if (msg.isEmpty) {
|
||||||
|
// // Get.toNamed("/userInfoPage");
|
||||||
|
// // Get.toNamed("/resetPasswordPage");
|
||||||
|
// Get.toNamed("/loginPage");
|
||||||
|
// }
|
||||||
|
},
|
||||||
|
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(
|
||||||
|
16.rpx),
|
||||||
|
),
|
||||||
|
child: Text(
|
||||||
|
"提交",
|
||||||
|
style: FlutterFlowTheme.of(
|
||||||
|
context)
|
||||||
|
.bodyMedium
|
||||||
|
.override(
|
||||||
|
fontFamily: 'Readex Pro',
|
||||||
|
color: Color(0XFF003058),
|
||||||
|
letterSpacing: 0,
|
||||||
|
fontSize: 30.rpx,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
)),
|
||||||
|
),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
),
|
||||||
|
)),
|
||||||
|
));
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -3,9 +3,9 @@ import 'package:flutter/material.dart';
|
|||||||
import 'package:vbvs_app/common/color/appFontsize.dart';
|
import 'package:vbvs_app/common/color/appFontsize.dart';
|
||||||
import 'package:vbvs_app/common/util/FitTool.dart';
|
import 'package:vbvs_app/common/util/FitTool.dart';
|
||||||
import 'package:vbvs_app/common/util/MyUtils.dart';
|
import 'package:vbvs_app/common/util/MyUtils.dart';
|
||||||
import 'package:vbvs_app/pages/device_control/issue_preview_widget.dart';
|
import 'package:vbvs_app/pages/mh_page/issue_preview_widget.dart';
|
||||||
|
|
||||||
import '../../controller/mh/issue_controller.dart';
|
import '../../controller/mh_controller/issue_controller.dart';
|
||||||
|
|
||||||
class IssueListPage extends GetView<IssueListController> {
|
class IssueListPage extends GetView<IssueListController> {
|
||||||
final scaffoldKey = GlobalKey<ScaffoldState>();
|
final scaffoldKey = GlobalKey<ScaffoldState>();
|
||||||
@@ -3,8 +3,8 @@ import 'package:flutter/material.dart';
|
|||||||
import 'package:flutter_svg/svg.dart';
|
import 'package:flutter_svg/svg.dart';
|
||||||
import 'package:vbvs_app/common/util/FitTool.dart';
|
import 'package:vbvs_app/common/util/FitTool.dart';
|
||||||
import 'package:vbvs_app/component/tool/ClickableContainer.dart';
|
import 'package:vbvs_app/component/tool/ClickableContainer.dart';
|
||||||
import 'package:vbvs_app/controller/mh/issue_controller.dart';
|
import 'package:vbvs_app/controller/mh_controller/issue_controller.dart';
|
||||||
import 'package:vbvs_app/controller/mh/issue_preview_controller.dart';
|
import 'package:vbvs_app/controller/mh_controller/issue_preview_controller.dart';
|
||||||
|
|
||||||
import '../../common/color/appFontsize.dart';
|
import '../../common/color/appFontsize.dart';
|
||||||
|
|
||||||
@@ -11,9 +11,9 @@ import 'package:vbvs_app/common/util/MyUtils.dart';
|
|||||||
import 'package:vbvs_app/component/NullDataComponentWidget.dart';
|
import 'package:vbvs_app/component/NullDataComponentWidget.dart';
|
||||||
import 'package:vbvs_app/component/tool/ClickableContainer.dart';
|
import 'package:vbvs_app/component/tool/ClickableContainer.dart';
|
||||||
import 'package:vbvs_app/component/tool/TopSlideNotification.dart';
|
import 'package:vbvs_app/component/tool/TopSlideNotification.dart';
|
||||||
import 'package:vbvs_app/controller/mh/message_controller.dart';
|
import 'package:vbvs_app/controller/mh_controller/message_controller.dart';
|
||||||
import 'package:vbvs_app/controller/theme_controller/ThemeController.dart';
|
import 'package:vbvs_app/controller/theme_controller/ThemeController.dart';
|
||||||
import 'package:vbvs_app/pages/main_bottom/component/MessageWidgetWidget.dart';
|
import 'package:vbvs_app/pages/mh_page/MhMessageList.dart';
|
||||||
|
|
||||||
class MessagePage extends StatefulWidget {
|
class MessagePage extends StatefulWidget {
|
||||||
const MessagePage({super.key});
|
const MessagePage({super.key});
|
||||||
@@ -406,7 +406,7 @@ class _MessagePageState extends State<MessagePage> {
|
|||||||
children: [
|
children: [
|
||||||
SizedBox(height: 30.rpx),
|
SizedBox(height: 30.rpx),
|
||||||
...dataList
|
...dataList
|
||||||
.map((item) => MessageWidgetWidget(data: item))
|
.map((item) => MhMessageListWidget(data: item))
|
||||||
.toList()
|
.toList()
|
||||||
.divide(SizedBox(height: 30.rpx)),
|
.divide(SizedBox(height: 30.rpx)),
|
||||||
SizedBox(height: 30.rpx),
|
SizedBox(height: 30.rpx),
|
||||||
@@ -6,9 +6,9 @@ import 'package:vbvs_app/common/color/appColors.dart';
|
|||||||
import 'package:vbvs_app/common/color/appConstants.dart';
|
import 'package:vbvs_app/common/color/appConstants.dart';
|
||||||
import 'package:vbvs_app/common/util/FitTool.dart';
|
import 'package:vbvs_app/common/util/FitTool.dart';
|
||||||
import 'package:vbvs_app/common/util/MyUtils.dart';
|
import 'package:vbvs_app/common/util/MyUtils.dart';
|
||||||
import 'package:vbvs_app/controller/mh/my_experience_list_controller.dart';
|
import 'package:vbvs_app/controller/mh_controller/my_experience_list_controller.dart';
|
||||||
import 'package:vbvs_app/pages/device_control/Empty.dart';
|
import 'package:vbvs_app/pages/mh_page/Empty.dart';
|
||||||
import 'package:vbvs_app/pages/device_control/my_experience_widget.dart';
|
import 'package:vbvs_app/pages/mh_page/my_experience_widget.dart';
|
||||||
|
|
||||||
class MyExperiencePage extends StatefulWidget {
|
class MyExperiencePage extends StatefulWidget {
|
||||||
const MyExperiencePage({super.key});
|
const MyExperiencePage({super.key});
|
||||||
@@ -20,29 +20,29 @@ class MyExperiencePage extends StatefulWidget {
|
|||||||
class _MyExperiencePageState extends State<MyExperiencePage> {
|
class _MyExperiencePageState extends State<MyExperiencePage> {
|
||||||
ScrollController scrollController = ScrollController();
|
ScrollController scrollController = ScrollController();
|
||||||
int runTime = 0;
|
int runTime = 0;
|
||||||
@override
|
// @override
|
||||||
void initState() {
|
// void initState() {
|
||||||
super.initState();
|
// super.initState();
|
||||||
Timer(Duration.zero, () {
|
// Timer(Duration.zero, () {
|
||||||
controller.resetParm();
|
// controller.resetParm();
|
||||||
controller.getAllBook();
|
// controller.getAllBook();
|
||||||
controller.page = 0;
|
// controller.page = 0;
|
||||||
controller.getData();
|
// controller.getData();
|
||||||
scrollController.addListener(() {
|
// scrollController.addListener(() {
|
||||||
print(
|
// print(
|
||||||
"${scrollController.position.pixels} ${scrollController.position.maxScrollExtent}");
|
// "${scrollController.position.pixels} ${scrollController.position.maxScrollExtent}");
|
||||||
int ctime = DateTime.now().millisecondsSinceEpoch;
|
// int ctime = DateTime.now().millisecondsSinceEpoch;
|
||||||
if (ctime - runTime > 100 &&
|
// if (ctime - runTime > 100 &&
|
||||||
scrollController.position.pixels + 80 >
|
// scrollController.position.pixels + 80 >
|
||||||
scrollController.position.maxScrollExtent) {
|
// scrollController.position.maxScrollExtent) {
|
||||||
runTime = ctime;
|
// runTime = ctime;
|
||||||
print(
|
// print(
|
||||||
"bottom get more data ${scrollController.position.pixels} ${scrollController.position.maxScrollExtent}");
|
// "bottom get more data ${scrollController.position.pixels} ${scrollController.position.maxScrollExtent}");
|
||||||
controller.getData();
|
// controller.getData();
|
||||||
}
|
// }
|
||||||
});
|
// });
|
||||||
});
|
// });
|
||||||
}
|
// }
|
||||||
|
|
||||||
get controller => Get.find<BookExperienceListController>();
|
get controller => Get.find<BookExperienceListController>();
|
||||||
final scaffoldKey = GlobalKey<ScaffoldState>();
|
final scaffoldKey = GlobalKey<ScaffoldState>();
|
||||||
@@ -4,7 +4,7 @@ import 'package:flutterflow_ui/flutterflow_ui.dart';
|
|||||||
import 'package:vbvs_app/common/util/FitTool.dart';
|
import 'package:vbvs_app/common/util/FitTool.dart';
|
||||||
import 'package:vbvs_app/common/util/MyUtils.dart';
|
import 'package:vbvs_app/common/util/MyUtils.dart';
|
||||||
|
|
||||||
import 'package:vbvs_app/controller/mh/my_experience_list_controller.dart';
|
import 'package:vbvs_app/controller/mh_controller/my_experience_list_controller.dart';
|
||||||
|
|
||||||
import '../../common/color/appFontsize.dart';
|
import '../../common/color/appFontsize.dart';
|
||||||
|
|
||||||
@@ -8,7 +8,7 @@ import 'package:vbvs_app/common/util/MyUtils.dart';
|
|||||||
import 'package:vbvs_app/component/tool/ClickableContainer.dart';
|
import 'package:vbvs_app/component/tool/ClickableContainer.dart';
|
||||||
import 'package:vbvs_app/controller/device/body_device_controller.dart';
|
import 'package:vbvs_app/controller/device/body_device_controller.dart';
|
||||||
import 'package:vbvs_app/controller/main_bottom/global_controller.dart';
|
import 'package:vbvs_app/controller/main_bottom/global_controller.dart';
|
||||||
import 'package:vbvs_app/controller/mh/muser_info_controller.dart';
|
import 'package:vbvs_app/controller/mh_controller/muser_info_controller.dart';
|
||||||
|
|
||||||
|
|
||||||
class NewHomePage extends StatefulWidget {
|
class NewHomePage extends StatefulWidget {
|
||||||
@@ -497,7 +497,7 @@ class _NewHomePageState extends State<NewHomePage> {
|
|||||||
Alignment
|
Alignment
|
||||||
.center,
|
.center,
|
||||||
child: Text(
|
child: Text(
|
||||||
'${day['scoreType'] ?? "暂无".tr}',
|
'${day['scoreType'] ?? "暂无"}',
|
||||||
style: FlutterFlowTheme.of(
|
style: FlutterFlowTheme.of(
|
||||||
context)
|
context)
|
||||||
.bodyMedium
|
.bodyMedium
|
||||||
@@ -5,7 +5,7 @@ import 'package:flutter_svg/svg.dart';
|
|||||||
import 'package:vbvs_app/common/util/FitTool.dart';
|
import 'package:vbvs_app/common/util/FitTool.dart';
|
||||||
import 'package:vbvs_app/component/tool/ClickableContainer.dart';
|
import 'package:vbvs_app/component/tool/ClickableContainer.dart';
|
||||||
import 'package:vbvs_app/controller/main_bottom/global_controller.dart';
|
import 'package:vbvs_app/controller/main_bottom/global_controller.dart';
|
||||||
import 'package:vbvs_app/controller/mh/muser_info_controller.dart';
|
import 'package:vbvs_app/controller/mh_controller/muser_info_controller.dart';
|
||||||
import 'package:vbvs_app/controller/theme_controller/ThemeController.dart';
|
import 'package:vbvs_app/controller/theme_controller/ThemeController.dart';
|
||||||
|
|
||||||
import 'package:vbvs_app/enum/LoginStatus.dart';
|
import 'package:vbvs_app/enum/LoginStatus.dart';
|
||||||
@@ -217,7 +217,7 @@ class _MinePageState extends State<NewMinePage> {
|
|||||||
|
|
||||||
Container(
|
Container(
|
||||||
margin: EdgeInsets.only(
|
margin: EdgeInsets.only(
|
||||||
left: 60.rpx, right: 60.rpx, top: 94.rpx),
|
left: 30.rpx, right: 30.rpx, top: 94.rpx),
|
||||||
child: Text(
|
child: Text(
|
||||||
'对已绑定的智能设备进行个性化配置,以获得更好的体验,',
|
'对已绑定的智能设备进行个性化配置,以获得更好的体验,',
|
||||||
style: TextStyle(
|
style: TextStyle(
|
||||||
@@ -261,29 +261,28 @@ class _MinePageState extends State<NewMinePage> {
|
|||||||
children: [
|
children: [
|
||||||
_buildListTile(
|
_buildListTile(
|
||||||
Icons.receipt_long, '我的订单', '快捷查看我在网上的订单记录',
|
Icons.receipt_long, '我的订单', '快捷查看我在网上的订单记录',
|
||||||
showTopLine: true),
|
showTopLine: true, path: "/issueListpage"),
|
||||||
_buildListTile(Icons.store_mall_directory, '门店体验',
|
_buildListTile(Icons.store_mall_directory, '门店体验',
|
||||||
'如果想免费体验智能设备,可在此进行提前预约',
|
'如果想免费体验智能设备,可在此进行提前预约',
|
||||||
path: "/experienceStorePage"),
|
path: "/experienceStorePage"),
|
||||||
_buildListTile(
|
_buildListTile(
|
||||||
Icons.build,
|
Icons.build,
|
||||||
'设备报修',
|
'设备报修',
|
||||||
'当您的智能设备需要报修时,可以通过该功能联系解决',
|
'当您的智能设备需要报修时,可以通过该功能联系解决,',
|
||||||
path: '/deviceRepairPage',
|
path: '/deviceRepairPage',
|
||||||
),
|
),
|
||||||
_buildListTile(
|
_buildListTile(
|
||||||
Icons.shopping_cart, '网上商城', '最新的智能产品线上购买服务'),
|
Icons.shopping_cart, '网上商城', '最新的智能产品线上购买服务',
|
||||||
|
path: "/issueListpage"),
|
||||||
_buildListTile(
|
_buildListTile(
|
||||||
Icons.location_on, '地址管理', '用于收货和报修时联系您',
|
Icons.location_on, '地址管理', '用于收货和报修时联系您',
|
||||||
path: "/addressListPage"),
|
path: "/addressListPage"),
|
||||||
_buildListTile(Icons.help_outline, '问题与帮助',
|
_buildListTile(Icons.help_outline, '问题与帮助',
|
||||||
'常见的问题汇总,如:智能床连接流程、如何查看睡眠报告',
|
'常见的问题汇总,如:智能床连接流程、如何查看睡眠报告',
|
||||||
path: "/issueListpage"),
|
path: "/issueListpage"),
|
||||||
_buildListTile(
|
_buildListTile(Icons.headset_mic, '在线客服',
|
||||||
Icons.headset_mic,
|
'购买和使用智能床过程中,如果遇到疑问可与客服进行联系',
|
||||||
'在线客服',
|
path: "/issueListpage"),
|
||||||
'购买和使用智能床过程中,如果遇到疑问可与客服进行联系',
|
|
||||||
),
|
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
@@ -10,7 +10,7 @@ import 'package:vbvs_app/common/util/FitTool.dart';
|
|||||||
import 'package:vbvs_app/common/util/MyUtils.dart';
|
import 'package:vbvs_app/common/util/MyUtils.dart';
|
||||||
import 'package:vbvs_app/component/tool/CustomCard.dart';
|
import 'package:vbvs_app/component/tool/CustomCard.dart';
|
||||||
import 'package:vbvs_app/controller/main_bottom/global_controller.dart';
|
import 'package:vbvs_app/controller/main_bottom/global_controller.dart';
|
||||||
import 'package:vbvs_app/controller/mh/people_info_controller.dart';
|
import 'package:vbvs_app/controller/mh_controller/people_info_controller.dart';
|
||||||
import 'package:vbvs_app/pages/common/selectDialog.dart';
|
import 'package:vbvs_app/pages/common/selectDialog.dart';
|
||||||
|
|
||||||
class PeopleInfoPage extends StatefulWidget {
|
class PeopleInfoPage extends StatefulWidget {
|
||||||
@@ -91,7 +91,7 @@ class _PeopleInfoState extends State<PeopleInfoPage> {
|
|||||||
Positioned(
|
Positioned(
|
||||||
right: 30.rpx,
|
right: 30.rpx,
|
||||||
child: CustomCard(
|
child: CustomCard(
|
||||||
borderRadius: 10,
|
borderRadius: 16.rpx,
|
||||||
gradientDirection: GradientDirection.vertical,
|
gradientDirection: GradientDirection.vertical,
|
||||||
onTap: () {
|
onTap: () {
|
||||||
// bool isOk = true;
|
// bool isOk = true;
|
||||||
@@ -269,6 +269,7 @@ class _PeopleInfoState extends State<PeopleInfoPage> {
|
|||||||
),
|
),
|
||||||
),
|
),
|
||||||
getLine(),
|
getLine(),
|
||||||
|
|
||||||
Container(
|
Container(
|
||||||
width: double.infinity,
|
width: double.infinity,
|
||||||
height: MediaQuery.sizeOf(context).height *
|
height: MediaQuery.sizeOf(context).height *
|
||||||
@@ -280,7 +281,7 @@ class _PeopleInfoState extends State<PeopleInfoPage> {
|
|||||||
MainAxisAlignment.spaceBetween,
|
MainAxisAlignment.spaceBetween,
|
||||||
children: [
|
children: [
|
||||||
Text(
|
Text(
|
||||||
'性名',
|
'姓名',
|
||||||
style: FlutterFlowTheme.of(context)
|
style: FlutterFlowTheme.of(context)
|
||||||
.bodyMedium
|
.bodyMedium
|
||||||
.override(
|
.override(
|
||||||
@@ -447,48 +448,60 @@ class _PeopleInfoState extends State<PeopleInfoPage> {
|
|||||||
letterSpacing: 0,
|
letterSpacing: 0,
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
Container(
|
InkWell(
|
||||||
width: 300.rpx,
|
onTap: () {
|
||||||
child: TextField(
|
FocusScope.of(context).unfocus();
|
||||||
obscureText: false,
|
Future.delayed(
|
||||||
keyboardType: TextInputType.number,
|
const Duration(
|
||||||
textInputAction:
|
milliseconds: 250), () {
|
||||||
TextInputAction.done,
|
showHeightPickerDialog(
|
||||||
textAlign: TextAlign.right,
|
context,
|
||||||
style: TextStyle(
|
initialHeight: controller
|
||||||
fontSize: 30.rpx,
|
.model
|
||||||
color: Colors.white),
|
.peopleList[index]
|
||||||
decoration: InputDecoration(
|
.height ??
|
||||||
fillColor: Colors.transparent,
|
170,
|
||||||
filled: true,
|
onConfirm:
|
||||||
hintText: "请输入身高(厘米)",
|
(int selectedHeight) {
|
||||||
hintStyle: TextStyle(
|
|
||||||
color: Colors.white),
|
|
||||||
border: InputBorder.none,
|
|
||||||
contentPadding:
|
|
||||||
EdgeInsets.all(0)),
|
|
||||||
onChanged: (value) {
|
|
||||||
controller.model.peopleList[index]
|
|
||||||
.height = value;
|
|
||||||
controller.updateAll();
|
|
||||||
},
|
|
||||||
controller: controller.onReDraw(
|
|
||||||
TextEditingController(
|
|
||||||
text: controller
|
|
||||||
.model
|
|
||||||
.peopleList[index]
|
|
||||||
.height ??
|
|
||||||
""),
|
|
||||||
(textEditingController) {
|
|
||||||
textEditingController.text =
|
|
||||||
controller
|
controller
|
||||||
.model
|
.model
|
||||||
.peopleList[index]
|
.peopleList[index]
|
||||||
.height ??
|
.height =
|
||||||
"";
|
selectedHeight.toString();
|
||||||
}, "people_height_$index"),
|
controller.updateAll();
|
||||||
|
print(
|
||||||
|
"身高: $selectedHeight cm");
|
||||||
|
},
|
||||||
|
);
|
||||||
|
});
|
||||||
|
},
|
||||||
|
child: Row(
|
||||||
|
children: [
|
||||||
|
Text(
|
||||||
|
controller
|
||||||
|
.model
|
||||||
|
.peopleList[index]
|
||||||
|
.height !=
|
||||||
|
null
|
||||||
|
? "${controller.model.peopleList[index].height} cm"
|
||||||
|
: '',
|
||||||
|
style:
|
||||||
|
FlutterFlowTheme.of(context)
|
||||||
|
.bodyMedium
|
||||||
|
.override(
|
||||||
|
fontFamily:
|
||||||
|
'Readex Pro',
|
||||||
|
color: Colors.white,
|
||||||
|
fontSize: 30.rpx,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
SizedBox(width: 16.rpx),
|
||||||
|
Icon(Icons.expand_more,
|
||||||
|
color: Colors.white,
|
||||||
|
size: 48.rpx),
|
||||||
|
],
|
||||||
),
|
),
|
||||||
)
|
),
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
@@ -514,46 +527,59 @@ class _PeopleInfoState extends State<PeopleInfoPage> {
|
|||||||
letterSpacing: 0,
|
letterSpacing: 0,
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
Container(
|
InkWell(
|
||||||
width: 300.rpx,
|
onTap: () {
|
||||||
child: TextField(
|
FocusScope.of(context).unfocus();
|
||||||
obscureText: false,
|
Future.delayed(
|
||||||
keyboardType: TextInputType.number,
|
const Duration(
|
||||||
textInputAction:
|
milliseconds: 250), () {
|
||||||
TextInputAction.done,
|
showWeightPickerDialog(
|
||||||
textAlign: TextAlign.right,
|
context,
|
||||||
style: TextStyle(
|
initialWeight: controller
|
||||||
fontSize: 30.rpx,
|
.model
|
||||||
color: Colors.white),
|
.peopleList[index]
|
||||||
decoration: InputDecoration(
|
.weight ??
|
||||||
fillColor: Colors.transparent,
|
"",
|
||||||
filled: true,
|
onConfirm:
|
||||||
hintText: "请输入体重(公斤)",
|
(int selectedWeight) {
|
||||||
hintStyle: TextStyle(
|
|
||||||
color: Colors.white),
|
|
||||||
border: InputBorder.none,
|
|
||||||
contentPadding:
|
|
||||||
EdgeInsets.all(0)),
|
|
||||||
onChanged: (value) {
|
|
||||||
controller.model.peopleList[index]
|
|
||||||
.weight = value;
|
|
||||||
controller.updateAll();
|
|
||||||
},
|
|
||||||
controller: controller.onReDraw(
|
|
||||||
TextEditingController(
|
|
||||||
text: controller
|
|
||||||
.model
|
|
||||||
.peopleList[index]
|
|
||||||
.weight ??
|
|
||||||
""),
|
|
||||||
(textEditingController) {
|
|
||||||
textEditingController.text =
|
|
||||||
controller
|
controller
|
||||||
.model
|
.model
|
||||||
.peopleList[index]
|
.peopleList[index]
|
||||||
.weight ??
|
.weight =
|
||||||
"";
|
selectedWeight
|
||||||
}, "people_weight_$index"),
|
.toString(); // ✅ 转成字符串
|
||||||
|
controller.updateAll();
|
||||||
|
print(
|
||||||
|
"体重: $selectedWeight kg");
|
||||||
|
},
|
||||||
|
);
|
||||||
|
});
|
||||||
|
},
|
||||||
|
child: Row(
|
||||||
|
children: [
|
||||||
|
Text(
|
||||||
|
controller
|
||||||
|
.model
|
||||||
|
.peopleList[index]
|
||||||
|
.weight !=
|
||||||
|
null
|
||||||
|
? "${controller.model.peopleList[index].weight} kg"
|
||||||
|
: '',
|
||||||
|
style:
|
||||||
|
FlutterFlowTheme.of(context)
|
||||||
|
.bodyMedium
|
||||||
|
.override(
|
||||||
|
fontFamily:
|
||||||
|
'Readex Pro',
|
||||||
|
color: Colors.white,
|
||||||
|
fontSize: 30.rpx,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
SizedBox(width: 16.rpx),
|
||||||
|
Icon(Icons.expand_more,
|
||||||
|
color: Colors.white,
|
||||||
|
size: 48.rpx),
|
||||||
|
],
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
],
|
],
|
||||||
@@ -661,73 +687,6 @@ class _PeopleInfoState extends State<PeopleInfoPage> {
|
|||||||
),
|
),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
// getLine(),
|
|
||||||
// Container(
|
|
||||||
// width: double.infinity,
|
|
||||||
// height: MediaQuery.sizeOf(context).height *
|
|
||||||
// 0.064,
|
|
||||||
// decoration: BoxDecoration(),
|
|
||||||
// child: Row(
|
|
||||||
// mainAxisSize: MainAxisSize.max,
|
|
||||||
// mainAxisAlignment:
|
|
||||||
// MainAxisAlignment.spaceBetween,
|
|
||||||
// children: [
|
|
||||||
// Text(
|
|
||||||
// '电话',
|
|
||||||
// style: FlutterFlowTheme.of(context)
|
|
||||||
// .bodyMedium
|
|
||||||
// .override(
|
|
||||||
// fontFamily: 'Readex Pro',
|
|
||||||
// color: Color(0xFF9EA4B7),
|
|
||||||
// fontSize: 30.rpx,
|
|
||||||
// letterSpacing: 0,
|
|
||||||
// ),
|
|
||||||
// ),
|
|
||||||
// Container(
|
|
||||||
// width: 300.rpx,
|
|
||||||
// child: TextField(
|
|
||||||
// obscureText: false,
|
|
||||||
// keyboardType: TextInputType.number,
|
|
||||||
// textInputAction:
|
|
||||||
// TextInputAction.done,
|
|
||||||
// textAlign: TextAlign.right,
|
|
||||||
// style: TextStyle(
|
|
||||||
// fontSize: 30.rpx,
|
|
||||||
// color: Colors.white),
|
|
||||||
// decoration: InputDecoration(
|
|
||||||
// fillColor: Colors.transparent,
|
|
||||||
// filled: true,
|
|
||||||
// hintText: "请输入电话",
|
|
||||||
// hintStyle: TextStyle(
|
|
||||||
// color: Colors.white),
|
|
||||||
// border: InputBorder.none,
|
|
||||||
// contentPadding:
|
|
||||||
// EdgeInsets.all(0)),
|
|
||||||
// onChanged: (value) {
|
|
||||||
// controller.model.peopleList[index]
|
|
||||||
// .tel = value;
|
|
||||||
// controller.updateAll();
|
|
||||||
// },
|
|
||||||
// controller: controller.onReDraw(
|
|
||||||
// TextEditingController(
|
|
||||||
// text: controller
|
|
||||||
// .model
|
|
||||||
// .peopleList[index]
|
|
||||||
// .tel ??
|
|
||||||
// ""),
|
|
||||||
// (textEditingController) {
|
|
||||||
// textEditingController.text =
|
|
||||||
// controller
|
|
||||||
// .model
|
|
||||||
// .peopleList[index]
|
|
||||||
// .tel ??
|
|
||||||
// "";
|
|
||||||
// }, "people_tel_$index"),
|
|
||||||
// ),
|
|
||||||
// ),
|
|
||||||
// ],
|
|
||||||
// ),
|
|
||||||
// ),
|
|
||||||
getLine(),
|
getLine(),
|
||||||
Container(
|
Container(
|
||||||
width: double.infinity,
|
width: double.infinity,
|
||||||
823
lib/pages/mh_page/register_page.dart
Normal file
823
lib/pages/mh_page/register_page.dart
Normal file
@@ -0,0 +1,823 @@
|
|||||||
|
import 'package:ef/ef.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/tool/CustomCard.dart';
|
||||||
|
import 'package:vbvs_app/controller/mh_controller/register_controller.dart';
|
||||||
|
import 'package:vbvs_app/controller/time/countdown_controller.dart';
|
||||||
|
import 'package:vbvs_app/pages/common/selectDialog.dart';
|
||||||
|
|
||||||
|
class RegisterPage extends GetView<RegisterController> {
|
||||||
|
final scaffoldKey = GlobalKey<ScaffoldState>();
|
||||||
|
BoxConstraints? bodysize;
|
||||||
|
|
||||||
|
final ScrollController _scrollController = ScrollController();
|
||||||
|
// final FocusNode _focusNode1 = FocusNode();
|
||||||
|
// final FocusNode _focusNode2 = FocusNode();
|
||||||
|
// final FocusNode _focusNode3 = FocusNode();
|
||||||
|
// final FocusNode _focusNode4 = FocusNode();
|
||||||
|
|
||||||
|
RegisterPage() {
|
||||||
|
controller.model.pdshow = true;
|
||||||
|
controller.model.cpdshow = true;
|
||||||
|
Get.put(RegisterController());
|
||||||
|
|
||||||
|
// _focusNode1.addListener(() {
|
||||||
|
// if (_focusNode1.hasFocus) {
|
||||||
|
// MyUtils.scrollToFocusedInput(_focusNode1, _scrollController);
|
||||||
|
// }
|
||||||
|
// });
|
||||||
|
// _focusNode2.addListener(() {
|
||||||
|
// if (_focusNode2.hasFocus) {
|
||||||
|
// MyUtils.scrollToFocusedInput(_focusNode2, _scrollController);
|
||||||
|
// }
|
||||||
|
// });
|
||||||
|
// _focusNode3.addListener(() {
|
||||||
|
// if (_focusNode3.hasFocus) {
|
||||||
|
// MyUtils.scrollToFocusedInput(_focusNode3, _scrollController);
|
||||||
|
// }
|
||||||
|
// });
|
||||||
|
// _focusNode4.addListener(() {
|
||||||
|
// if (_focusNode4.hasFocus) {
|
||||||
|
// MyUtils.scrollToFocusedInput(_focusNode4, _scrollController);
|
||||||
|
// }
|
||||||
|
// });
|
||||||
|
}
|
||||||
|
|
||||||
|
@override
|
||||||
|
Widget build(BuildContext context) {
|
||||||
|
return LayoutBuilder(builder: (context, cc) {
|
||||||
|
bodysize = cc;
|
||||||
|
|
||||||
|
return GestureDetector(
|
||||||
|
// onTap: () => FocusScope.of(context).unfocus(),
|
||||||
|
child: Container(
|
||||||
|
decoration: const BoxDecoration(
|
||||||
|
image: DecorationImage(
|
||||||
|
image: AssetImage('assets/images/new_background.png'), // 本地图片
|
||||||
|
fit: BoxFit.fill, // 填满整个 Container
|
||||||
|
),
|
||||||
|
),
|
||||||
|
child: Scaffold(
|
||||||
|
backgroundColor: Colors.transparent,
|
||||||
|
// key: scaffoldKey,
|
||||||
|
appBar: AppBar(
|
||||||
|
backgroundColor: Colors.transparent,
|
||||||
|
automaticallyImplyLeading: false,
|
||||||
|
iconTheme: IconThemeData(color: Colors.white),
|
||||||
|
titleSpacing: 0,
|
||||||
|
title: Container(
|
||||||
|
width: double.infinity,
|
||||||
|
height: 180.rpx,
|
||||||
|
child: Stack(
|
||||||
|
alignment: Alignment.center,
|
||||||
|
children: [
|
||||||
|
// 中间居中的标题
|
||||||
|
Text(
|
||||||
|
'用户注册',
|
||||||
|
textAlign: TextAlign.center,
|
||||||
|
style: TextStyle(
|
||||||
|
color: Colors.white,
|
||||||
|
fontSize: 30.rpx,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
// 左侧图标
|
||||||
|
Positioned(
|
||||||
|
left: 20.rpx,
|
||||||
|
child: returnIconButtomNew,
|
||||||
|
),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
),
|
||||||
|
actions: [],
|
||||||
|
centerTitle: false,
|
||||||
|
),
|
||||||
|
body: SingleChildScrollView(
|
||||||
|
controller: _scrollController,
|
||||||
|
child: Container(
|
||||||
|
width: bodysize!.maxWidth,
|
||||||
|
height: bodysize!.maxHeight * 1,
|
||||||
|
child: Column(
|
||||||
|
mainAxisSize: MainAxisSize.max,
|
||||||
|
children: [
|
||||||
|
// TitleComponentWidget(
|
||||||
|
// titleName: '用户注册',
|
||||||
|
// ),
|
||||||
|
Expanded(
|
||||||
|
child: Padding(
|
||||||
|
padding: EdgeInsetsDirectional.fromSTEB(
|
||||||
|
98.rpx, 0, 98.rpx, 0),
|
||||||
|
child: Container(
|
||||||
|
width: bodysize!.maxWidth,
|
||||||
|
height: bodysize!.maxHeight * 0.886,
|
||||||
|
child: Container(
|
||||||
|
width: bodysize!.maxWidth,
|
||||||
|
height: bodysize!.maxHeight * 1,
|
||||||
|
child: Column(
|
||||||
|
mainAxisSize: MainAxisSize.max,
|
||||||
|
children: [
|
||||||
|
Padding(
|
||||||
|
padding: EdgeInsetsDirectional.fromSTEB(
|
||||||
|
0, 184.rpx, 0, 0),
|
||||||
|
child: Container(
|
||||||
|
width: bodysize!.maxWidth,
|
||||||
|
height: 92.rpx,
|
||||||
|
decoration: BoxDecoration(),
|
||||||
|
child: Container(
|
||||||
|
width: bodysize!.maxWidth,
|
||||||
|
height: bodysize!.maxHeight * 0.06,
|
||||||
|
decoration: BoxDecoration(
|
||||||
|
color: Color(0xFFF3F5F6),
|
||||||
|
borderRadius: BorderRadius.circular(12),
|
||||||
|
),
|
||||||
|
child: Align(
|
||||||
|
alignment: AlignmentDirectional(0, 0),
|
||||||
|
child: TextFormField(
|
||||||
|
// autofocus: true,
|
||||||
|
// focusNode: _focusNode1,
|
||||||
|
onChanged: (value) {
|
||||||
|
controller.model.register_phone =
|
||||||
|
value;
|
||||||
|
},
|
||||||
|
obscureText: false,
|
||||||
|
decoration: InputDecoration(
|
||||||
|
labelStyle:
|
||||||
|
FlutterFlowTheme.of(context)
|
||||||
|
.labelMedium
|
||||||
|
.override(
|
||||||
|
fontFamily: 'Readex Pro',
|
||||||
|
fontSize: 20.rpx,
|
||||||
|
letterSpacing: 0,
|
||||||
|
),
|
||||||
|
hintText: '请输入手机号',
|
||||||
|
hintStyle:
|
||||||
|
FlutterFlowTheme.of(context)
|
||||||
|
.labelMedium
|
||||||
|
.override(
|
||||||
|
fontFamily: 'Readex Pro',
|
||||||
|
color: Color(0xFF929699),
|
||||||
|
fontSize: 20.rpx,
|
||||||
|
letterSpacing: 0,
|
||||||
|
),
|
||||||
|
enabledBorder: InputBorder.none,
|
||||||
|
focusedBorder: InputBorder.none,
|
||||||
|
errorBorder: InputBorder.none,
|
||||||
|
focusedErrorBorder:
|
||||||
|
InputBorder.none,
|
||||||
|
contentPadding:
|
||||||
|
EdgeInsetsDirectional.fromSTEB(
|
||||||
|
20.rpx, 0, 0, 10.rpx),
|
||||||
|
),
|
||||||
|
style: FlutterFlowTheme.of(context)
|
||||||
|
.bodyMedium
|
||||||
|
.override(
|
||||||
|
fontFamily: 'Readex Pro',
|
||||||
|
fontSize: 20.rpx,
|
||||||
|
letterSpacing: 0,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
Padding(
|
||||||
|
padding: EdgeInsetsDirectional.fromSTEB(
|
||||||
|
0, 32.rpx, 0, 0),
|
||||||
|
child: Container(
|
||||||
|
width: bodysize!.maxWidth,
|
||||||
|
height: 92.rpx,
|
||||||
|
decoration: BoxDecoration(),
|
||||||
|
child: Container(
|
||||||
|
width: bodysize!.maxWidth,
|
||||||
|
height: bodysize!.maxHeight * 0.06,
|
||||||
|
decoration: BoxDecoration(
|
||||||
|
color: Color(0xFFF3F5F6),
|
||||||
|
borderRadius: BorderRadius.circular(12),
|
||||||
|
),
|
||||||
|
child: Align(
|
||||||
|
alignment: AlignmentDirectional(0, 0),
|
||||||
|
child: Obx(() {
|
||||||
|
return TextFormField(
|
||||||
|
// autofocus: true,
|
||||||
|
// focusNode: _focusNode2,
|
||||||
|
onChanged: (value) {
|
||||||
|
controller.model.register_pd =
|
||||||
|
value;
|
||||||
|
},
|
||||||
|
// obscureText: true,
|
||||||
|
obscureText:
|
||||||
|
controller.model.pdshow!,
|
||||||
|
decoration: InputDecoration(
|
||||||
|
labelStyle:
|
||||||
|
FlutterFlowTheme.of(context)
|
||||||
|
.labelMedium
|
||||||
|
.override(
|
||||||
|
fontFamily:
|
||||||
|
'Readex Pro',
|
||||||
|
fontSize: 20.rpx,
|
||||||
|
letterSpacing: 0,
|
||||||
|
),
|
||||||
|
hintText: '请输入密码',
|
||||||
|
hintStyle: FlutterFlowTheme.of(
|
||||||
|
context)
|
||||||
|
.labelMedium
|
||||||
|
.override(
|
||||||
|
fontFamily: 'Readex Pro',
|
||||||
|
color: Color(0xFF929699),
|
||||||
|
fontSize: 20.rpx,
|
||||||
|
letterSpacing: 0,
|
||||||
|
),
|
||||||
|
enabledBorder: InputBorder.none,
|
||||||
|
focusedBorder: InputBorder.none,
|
||||||
|
errorBorder: InputBorder.none,
|
||||||
|
focusedErrorBorder:
|
||||||
|
InputBorder.none,
|
||||||
|
contentPadding:
|
||||||
|
EdgeInsetsDirectional
|
||||||
|
.fromSTEB(20.rpx,
|
||||||
|
20.rpx, 0, 0),
|
||||||
|
suffixIcon: IconButton(
|
||||||
|
icon: Icon(
|
||||||
|
// 根据 pdshow 控制图标
|
||||||
|
controller.model.pdshow!
|
||||||
|
? Icons.visibility_off
|
||||||
|
: Icons.visibility,
|
||||||
|
color: Color(0xFF333333),
|
||||||
|
size: 16,
|
||||||
|
),
|
||||||
|
onPressed: () {
|
||||||
|
// 切换 pdshow 状态
|
||||||
|
controller.model.pdshow =
|
||||||
|
!controller
|
||||||
|
.model.pdshow!;
|
||||||
|
controller.updateAll();
|
||||||
|
},
|
||||||
|
),
|
||||||
|
),
|
||||||
|
style:
|
||||||
|
FlutterFlowTheme.of(context)
|
||||||
|
.bodyMedium
|
||||||
|
.override(
|
||||||
|
fontFamily:
|
||||||
|
'Readex Pro',
|
||||||
|
fontSize: 20.rpx,
|
||||||
|
letterSpacing: 0,
|
||||||
|
),
|
||||||
|
);
|
||||||
|
})),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
Padding(
|
||||||
|
padding: EdgeInsetsDirectional.fromSTEB(
|
||||||
|
0, 32.rpx, 0, 0),
|
||||||
|
child: Container(
|
||||||
|
width: bodysize!.maxWidth,
|
||||||
|
height: 92.rpx,
|
||||||
|
decoration: BoxDecoration(),
|
||||||
|
child: Container(
|
||||||
|
width: bodysize!.maxWidth,
|
||||||
|
height: bodysize!.maxHeight * 0.06,
|
||||||
|
decoration: BoxDecoration(
|
||||||
|
color: Color(0xFFF3F5F6),
|
||||||
|
borderRadius: BorderRadius.circular(12),
|
||||||
|
),
|
||||||
|
child: Align(
|
||||||
|
alignment: AlignmentDirectional(0, 0),
|
||||||
|
child: Obx(() {
|
||||||
|
return TextFormField(
|
||||||
|
// autofocus: true,
|
||||||
|
onChanged: (value) {
|
||||||
|
controller.model
|
||||||
|
.register_confirm_pd =
|
||||||
|
value;
|
||||||
|
},
|
||||||
|
// focusNode: _focusNode3,
|
||||||
|
// obscureText: true,
|
||||||
|
obscureText:
|
||||||
|
controller.model.cpdshow!,
|
||||||
|
decoration: InputDecoration(
|
||||||
|
labelStyle:
|
||||||
|
FlutterFlowTheme.of(context)
|
||||||
|
.labelMedium
|
||||||
|
.override(
|
||||||
|
fontFamily:
|
||||||
|
'Readex Pro',
|
||||||
|
fontSize: 20.rpx,
|
||||||
|
letterSpacing: 0,
|
||||||
|
),
|
||||||
|
hintText: '确认密码',
|
||||||
|
hintStyle: FlutterFlowTheme.of(
|
||||||
|
context)
|
||||||
|
.labelMedium
|
||||||
|
.override(
|
||||||
|
fontFamily: 'Readex Pro',
|
||||||
|
color: Color(0xFF929699),
|
||||||
|
fontSize: 20.rpx,
|
||||||
|
letterSpacing: 0,
|
||||||
|
),
|
||||||
|
enabledBorder: InputBorder.none,
|
||||||
|
focusedBorder: InputBorder.none,
|
||||||
|
errorBorder: InputBorder.none,
|
||||||
|
focusedErrorBorder:
|
||||||
|
InputBorder.none,
|
||||||
|
contentPadding:
|
||||||
|
EdgeInsetsDirectional
|
||||||
|
.fromSTEB(20.rpx,
|
||||||
|
20.rpx, 0, 0),
|
||||||
|
suffixIcon: IconButton(
|
||||||
|
icon: Icon(
|
||||||
|
// 根据 pdshow 控制图标
|
||||||
|
controller.model.pdshow!
|
||||||
|
? Icons.visibility_off
|
||||||
|
: Icons.visibility,
|
||||||
|
color: Color(0xFF333333),
|
||||||
|
size: 16,
|
||||||
|
),
|
||||||
|
onPressed: () {
|
||||||
|
// 切换 pdshow 状态
|
||||||
|
controller.model.cpdshow =
|
||||||
|
!controller
|
||||||
|
.model.cpdshow!;
|
||||||
|
controller.updateAll();
|
||||||
|
},
|
||||||
|
),
|
||||||
|
),
|
||||||
|
style:
|
||||||
|
FlutterFlowTheme.of(context)
|
||||||
|
.bodyMedium
|
||||||
|
.override(
|
||||||
|
fontFamily:
|
||||||
|
'Readex Pro',
|
||||||
|
fontSize: 20.rpx,
|
||||||
|
letterSpacing: 0,
|
||||||
|
),
|
||||||
|
);
|
||||||
|
})),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
Padding(
|
||||||
|
padding: EdgeInsetsDirectional.fromSTEB(
|
||||||
|
0, 32.rpx, 0, 0),
|
||||||
|
child: Container(
|
||||||
|
width: bodysize!.maxWidth,
|
||||||
|
height: 92.rpx,
|
||||||
|
decoration: BoxDecoration(),
|
||||||
|
child: Stack(
|
||||||
|
children: [
|
||||||
|
Align(
|
||||||
|
alignment: AlignmentDirectional(0, 0),
|
||||||
|
child: Container(
|
||||||
|
width: bodysize!.maxWidth,
|
||||||
|
height: 92.rpx,
|
||||||
|
decoration: BoxDecoration(
|
||||||
|
color: Color(0xFFF3F5F6),
|
||||||
|
borderRadius:
|
||||||
|
BorderRadius.circular(12),
|
||||||
|
),
|
||||||
|
child: Align(
|
||||||
|
alignment:
|
||||||
|
AlignmentDirectional(0, 0),
|
||||||
|
child: TextFormField(
|
||||||
|
// autofocus: true,
|
||||||
|
onChanged: (value) {
|
||||||
|
controller.model
|
||||||
|
.register_code = value;
|
||||||
|
},
|
||||||
|
// focusNode: _focusNode4,
|
||||||
|
obscureText: false,
|
||||||
|
decoration: InputDecoration(
|
||||||
|
labelStyle:
|
||||||
|
FlutterFlowTheme.of(
|
||||||
|
context)
|
||||||
|
.labelMedium
|
||||||
|
.override(
|
||||||
|
fontFamily:
|
||||||
|
'Readex Pro',
|
||||||
|
fontSize: 20.rpx,
|
||||||
|
letterSpacing: 0,
|
||||||
|
),
|
||||||
|
hintText: '请输验证码',
|
||||||
|
hintStyle: FlutterFlowTheme
|
||||||
|
.of(context)
|
||||||
|
.labelMedium
|
||||||
|
.override(
|
||||||
|
fontFamily:
|
||||||
|
'Readex Pro',
|
||||||
|
color:
|
||||||
|
Color(0xFF929699),
|
||||||
|
fontSize: 20.rpx,
|
||||||
|
letterSpacing: 0,
|
||||||
|
),
|
||||||
|
enabledBorder:
|
||||||
|
InputBorder.none,
|
||||||
|
focusedBorder:
|
||||||
|
InputBorder.none,
|
||||||
|
errorBorder: InputBorder.none,
|
||||||
|
focusedErrorBorder:
|
||||||
|
InputBorder.none,
|
||||||
|
contentPadding:
|
||||||
|
EdgeInsetsDirectional
|
||||||
|
.fromSTEB(20.rpx, 0,
|
||||||
|
0, 10.rpx),
|
||||||
|
),
|
||||||
|
style:
|
||||||
|
FlutterFlowTheme.of(context)
|
||||||
|
.bodyMedium
|
||||||
|
.override(
|
||||||
|
fontFamily:
|
||||||
|
'Readex Pro',
|
||||||
|
fontSize: 20.rpx,
|
||||||
|
letterSpacing: 0,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
Align(
|
||||||
|
alignment:
|
||||||
|
AlignmentDirectional(0.2, 0.1),
|
||||||
|
child: Container(
|
||||||
|
width: 3,
|
||||||
|
height: 30,
|
||||||
|
decoration: BoxDecoration(
|
||||||
|
color: Color(0xFFCCCCCC),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
Align(
|
||||||
|
alignment:
|
||||||
|
AlignmentDirectional(0.9, 0),
|
||||||
|
child: Container(
|
||||||
|
width: bodysize!.maxWidth * 0.157,
|
||||||
|
height: bodysize!.maxHeight * 0.014,
|
||||||
|
constraints: BoxConstraints(
|
||||||
|
minWidth: 118,
|
||||||
|
minHeight: 30,
|
||||||
|
),
|
||||||
|
decoration: BoxDecoration(),
|
||||||
|
child: Align(
|
||||||
|
alignment:
|
||||||
|
AlignmentDirectional(0, 0),
|
||||||
|
child: Obx(() {
|
||||||
|
final CountdownController
|
||||||
|
countdownController =
|
||||||
|
Get.find<
|
||||||
|
CountdownController>();
|
||||||
|
return InkWell(
|
||||||
|
onTap: () async {
|
||||||
|
// if (countdownController
|
||||||
|
// .countdown.value !=
|
||||||
|
// 0) {
|
||||||
|
// return;
|
||||||
|
// }
|
||||||
|
// if (CommonVariables
|
||||||
|
// .isNetWorkOn ==
|
||||||
|
// false) {
|
||||||
|
// showToast(
|
||||||
|
// "网络未连接,请开启设备网络后重试");
|
||||||
|
// return;
|
||||||
|
// }
|
||||||
|
// String msg =
|
||||||
|
// await controller
|
||||||
|
// .getCode(context);
|
||||||
|
// if (msg.isNotEmpty) {
|
||||||
|
// return;
|
||||||
|
// }
|
||||||
|
// countdownController
|
||||||
|
// .countdown
|
||||||
|
// .value ==
|
||||||
|
// 0
|
||||||
|
// ? countdownController
|
||||||
|
// .startCountdown(
|
||||||
|
// AppConstants
|
||||||
|
// .code_time)
|
||||||
|
// : null;
|
||||||
|
},
|
||||||
|
child: Text(
|
||||||
|
countdownController
|
||||||
|
.countdown
|
||||||
|
.value ==
|
||||||
|
0
|
||||||
|
? '获取验证码'
|
||||||
|
: '${countdownController.countdown.value}秒',
|
||||||
|
style: TextStyle(
|
||||||
|
fontFamily: 'Readex Pro',
|
||||||
|
color: Color(0xFF333333),
|
||||||
|
fontSize: 20.rpx,
|
||||||
|
letterSpacing: 0,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
);
|
||||||
|
}),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
Padding(
|
||||||
|
padding: EdgeInsetsDirectional.fromSTEB(
|
||||||
|
0, 19, 0, 0),
|
||||||
|
child: Container(
|
||||||
|
width: bodysize!.maxWidth,
|
||||||
|
height: bodysize!.maxHeight * 0.022,
|
||||||
|
constraints: BoxConstraints(
|
||||||
|
minWidth: 466,
|
||||||
|
minHeight: 30,
|
||||||
|
),
|
||||||
|
decoration: BoxDecoration(),
|
||||||
|
child: Container(
|
||||||
|
width: bodysize!.maxWidth,
|
||||||
|
height: bodysize!.maxHeight * 0.022,
|
||||||
|
constraints: BoxConstraints(
|
||||||
|
minWidth: 466,
|
||||||
|
minHeight: 30,
|
||||||
|
),
|
||||||
|
decoration: BoxDecoration(),
|
||||||
|
child: Row(
|
||||||
|
mainAxisSize: MainAxisSize.max,
|
||||||
|
mainAxisAlignment:
|
||||||
|
MainAxisAlignment.start,
|
||||||
|
children: [
|
||||||
|
Align(
|
||||||
|
alignment:
|
||||||
|
AlignmentDirectional(0, 0),
|
||||||
|
child: Padding(
|
||||||
|
padding: EdgeInsetsDirectional
|
||||||
|
.fromSTEB(0, 3, 0, 0),
|
||||||
|
child: Container(
|
||||||
|
width: 36,
|
||||||
|
height: 36,
|
||||||
|
decoration: BoxDecoration(),
|
||||||
|
child: Align(
|
||||||
|
alignment:
|
||||||
|
AlignmentDirectional(
|
||||||
|
0, 0),
|
||||||
|
child: Theme(
|
||||||
|
data: ThemeData(
|
||||||
|
checkboxTheme:
|
||||||
|
CheckboxThemeData(
|
||||||
|
visualDensity:
|
||||||
|
VisualDensity
|
||||||
|
.compact,
|
||||||
|
materialTapTargetSize:
|
||||||
|
MaterialTapTargetSize
|
||||||
|
.shrinkWrap,
|
||||||
|
shape:
|
||||||
|
RoundedRectangleBorder(
|
||||||
|
borderRadius:
|
||||||
|
BorderRadius
|
||||||
|
.circular(
|
||||||
|
64),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
unselectedWidgetColor:
|
||||||
|
Color(0xFFD3D3D3),
|
||||||
|
),
|
||||||
|
child: Obx(
|
||||||
|
() => Checkbox(
|
||||||
|
value: controller
|
||||||
|
.model
|
||||||
|
.register_agree ??
|
||||||
|
false,
|
||||||
|
onChanged:
|
||||||
|
(newValue) async {
|
||||||
|
controller.model
|
||||||
|
.register_agree =
|
||||||
|
newValue;
|
||||||
|
|
||||||
|
controller
|
||||||
|
.updateAll();
|
||||||
|
// 获取设备信息,需要用户点击确认隐私协议与用户协议选择框时才能获取
|
||||||
|
// if (newValue ==
|
||||||
|
// true) {
|
||||||
|
// Deviceconfig
|
||||||
|
// .initPlatformState();
|
||||||
|
// }
|
||||||
|
},
|
||||||
|
side: BorderSide(
|
||||||
|
width: 1.5,
|
||||||
|
color: FlutterFlowTheme
|
||||||
|
.of(context)
|
||||||
|
.secondaryText,
|
||||||
|
),
|
||||||
|
activeColor:
|
||||||
|
const Color(
|
||||||
|
0xFF84F5FF),
|
||||||
|
checkColor:
|
||||||
|
Color(0xFF003058),
|
||||||
|
visualDensity:
|
||||||
|
VisualDensity(
|
||||||
|
horizontal:
|
||||||
|
-4.0,
|
||||||
|
vertical:
|
||||||
|
-4.0), // 变小
|
||||||
|
),
|
||||||
|
)),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
Flexible(
|
||||||
|
child: Padding(
|
||||||
|
padding: EdgeInsetsDirectional
|
||||||
|
.fromSTEB(0, 0, 0, 0),
|
||||||
|
child: Container(
|
||||||
|
width:
|
||||||
|
MediaQuery.sizeOf(context)
|
||||||
|
.width *
|
||||||
|
0.622,
|
||||||
|
height:
|
||||||
|
MediaQuery.sizeOf(context)
|
||||||
|
.height *
|
||||||
|
1,
|
||||||
|
constraints: BoxConstraints(
|
||||||
|
minWidth: 466,
|
||||||
|
minHeight: 30,
|
||||||
|
),
|
||||||
|
decoration: BoxDecoration(),
|
||||||
|
child: Container(
|
||||||
|
width: 100,
|
||||||
|
height: 100,
|
||||||
|
decoration: BoxDecoration(),
|
||||||
|
child: Row(
|
||||||
|
mainAxisSize:
|
||||||
|
MainAxisSize.max,
|
||||||
|
children: [
|
||||||
|
Align(
|
||||||
|
alignment:
|
||||||
|
AlignmentDirectional(
|
||||||
|
0, 0),
|
||||||
|
child: Text(
|
||||||
|
'我已阅读并同意',
|
||||||
|
style: FlutterFlowTheme
|
||||||
|
.of(context)
|
||||||
|
.bodyMedium
|
||||||
|
.override(
|
||||||
|
fontFamily:
|
||||||
|
'Readex Pro',
|
||||||
|
color: Colors
|
||||||
|
.white,
|
||||||
|
fontSize: 12,
|
||||||
|
letterSpacing:
|
||||||
|
0,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
Align(
|
||||||
|
alignment:
|
||||||
|
AlignmentDirectional(
|
||||||
|
0, 0),
|
||||||
|
child: InkWell(
|
||||||
|
onTap: () {
|
||||||
|
showCustomConfirmOfWebViewDialog(
|
||||||
|
context,
|
||||||
|
"用户协议",
|
||||||
|
"/#/pages/agreement/agreement?type=2&hideHead=true");
|
||||||
|
},
|
||||||
|
child: Text(
|
||||||
|
'《用户协议》',
|
||||||
|
style: FlutterFlowTheme
|
||||||
|
.of(context)
|
||||||
|
.bodyMedium
|
||||||
|
.override(
|
||||||
|
fontFamily:
|
||||||
|
'Readex Pro',
|
||||||
|
color: Color(
|
||||||
|
0xFF1890FF),
|
||||||
|
fontSize: 12,
|
||||||
|
letterSpacing:
|
||||||
|
0,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
Align(
|
||||||
|
alignment:
|
||||||
|
AlignmentDirectional(
|
||||||
|
0, 0),
|
||||||
|
child: Text(
|
||||||
|
'与',
|
||||||
|
style: FlutterFlowTheme
|
||||||
|
.of(context)
|
||||||
|
.bodyMedium
|
||||||
|
.override(
|
||||||
|
fontFamily:
|
||||||
|
'Readex Pro',
|
||||||
|
color: Colors
|
||||||
|
.white,
|
||||||
|
fontSize: 12,
|
||||||
|
letterSpacing:
|
||||||
|
0,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
Align(
|
||||||
|
alignment:
|
||||||
|
AlignmentDirectional(
|
||||||
|
0, 0),
|
||||||
|
child: InkWell(
|
||||||
|
onTap: () {
|
||||||
|
showCustomConfirmOfWebViewDialog(
|
||||||
|
context,
|
||||||
|
"隐私协议",
|
||||||
|
"/#/pages/agreement/agreement?type=1&hideHead=true");
|
||||||
|
},
|
||||||
|
child: Text(
|
||||||
|
'《隐私协议》',
|
||||||
|
style: FlutterFlowTheme
|
||||||
|
.of(context)
|
||||||
|
.bodyMedium
|
||||||
|
.override(
|
||||||
|
fontFamily:
|
||||||
|
'Readex Pro',
|
||||||
|
color: Color(
|
||||||
|
0xFF1890FF),
|
||||||
|
fontSize: 12,
|
||||||
|
letterSpacing:
|
||||||
|
0,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
Padding(
|
||||||
|
padding: EdgeInsetsDirectional.fromSTEB(
|
||||||
|
0, 29, 0, 0),
|
||||||
|
child: Container(
|
||||||
|
width: bodysize!.maxWidth,
|
||||||
|
height: bodysize!.maxHeight * 0.056,
|
||||||
|
decoration: BoxDecoration(),
|
||||||
|
child: CustomCard(
|
||||||
|
borderRadius: 16.rpx,
|
||||||
|
gradientDirection:
|
||||||
|
GradientDirection.vertical,
|
||||||
|
onTap: () {
|
||||||
|
// if (CommonVariables.isNetWorkOn ==
|
||||||
|
// false) {
|
||||||
|
// showToast("网络未连接,请开启设备网络后重试");
|
||||||
|
// return;
|
||||||
|
// }
|
||||||
|
// String msg = await controller
|
||||||
|
// .registerUser(context);
|
||||||
|
// if (msg == null || msg.isEmpty) {
|
||||||
|
// Get.toNamed("/loginPage");
|
||||||
|
// }
|
||||||
|
},
|
||||||
|
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(16.rpx),
|
||||||
|
),
|
||||||
|
child: Text(
|
||||||
|
"提交",
|
||||||
|
style: FlutterFlowTheme.of(context)
|
||||||
|
.bodyMedium
|
||||||
|
.override(
|
||||||
|
fontFamily: 'Readex Pro',
|
||||||
|
color:
|
||||||
|
stringToColor("#011D33"),
|
||||||
|
letterSpacing: 0,
|
||||||
|
fontSize: 30.rpx,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
)),
|
||||||
|
),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
),
|
||||||
|
)),
|
||||||
|
));
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -7,12 +7,12 @@ import 'package:vbvs_app/common/color/appFontsize.dart';
|
|||||||
import 'package:vbvs_app/common/color/repair_status.dart';
|
import 'package:vbvs_app/common/color/repair_status.dart';
|
||||||
import 'package:vbvs_app/common/util/FitTool.dart';
|
import 'package:vbvs_app/common/util/FitTool.dart';
|
||||||
import 'package:vbvs_app/common/util/MyUtils.dart';
|
import 'package:vbvs_app/common/util/MyUtils.dart';
|
||||||
import 'package:vbvs_app/controller/mh/repair_process.dart';
|
import 'package:vbvs_app/controller/mh_controller/repair_process.dart';
|
||||||
import 'package:vbvs_app/pages/device_control/repair_process_widget.dart';
|
import 'package:vbvs_app/pages/mh_page/repair_process_widget.dart';
|
||||||
|
|
||||||
import '../../component/img/img_preview_widget.dart';
|
import '../../component/img/img_preview_widget.dart';
|
||||||
import '../../controller/mh/apply_repair_controller.dart';
|
import '../../controller/mh_controller/apply_repair_controller.dart';
|
||||||
import '../../controller/mh/repair_info_controller.dart';
|
import '../../controller/mh_controller/repair_info_controller.dart';
|
||||||
|
|
||||||
class RepairHistoryListPage extends GetView<RepairInfoController> {
|
class RepairHistoryListPage extends GetView<RepairInfoController> {
|
||||||
final scaffoldKey = GlobalKey<ScaffoldState>();
|
final scaffoldKey = GlobalKey<ScaffoldState>();
|
||||||
@@ -131,9 +131,8 @@ class RepairHistoryListPage extends GetView<RepairInfoController> {
|
|||||||
mainAxisSize: MainAxisSize.max,
|
mainAxisSize: MainAxisSize.max,
|
||||||
children: [
|
children: [
|
||||||
Padding(
|
Padding(
|
||||||
padding:
|
padding: EdgeInsetsDirectional.fromSTEB(
|
||||||
const EdgeInsetsDirectional.fromSTEB(
|
0, 0, 0, 20.rpx),
|
||||||
0, 0, 0, 10),
|
|
||||||
child: Container(
|
child: Container(
|
||||||
width: MediaQuery.sizeOf(context).width,
|
width: MediaQuery.sizeOf(context).width,
|
||||||
decoration: BoxDecoration(
|
decoration: BoxDecoration(
|
||||||
@@ -141,8 +140,9 @@ class RepairHistoryListPage extends GetView<RepairInfoController> {
|
|||||||
borderRadius: BorderRadius.circular(8),
|
borderRadius: BorderRadius.circular(8),
|
||||||
),
|
),
|
||||||
child: Padding(
|
child: Padding(
|
||||||
padding: const EdgeInsetsDirectional
|
padding:
|
||||||
.fromSTEB(17, 10, 0, 0),
|
EdgeInsetsDirectional.fromSTEB(
|
||||||
|
34.rpx, 10, 0, 0),
|
||||||
child: Container(
|
child: Container(
|
||||||
decoration: const BoxDecoration(),
|
decoration: const BoxDecoration(),
|
||||||
child: Column(
|
child: Column(
|
||||||
@@ -450,13 +450,14 @@ class RepairHistoryListPage extends GetView<RepairInfoController> {
|
|||||||
.status &&
|
.status &&
|
||||||
controller.model.applyRepairModel!
|
controller.model.applyRepairModel!
|
||||||
.score ==
|
.score ==
|
||||||
null)
|
null) {
|
||||||
return Align(
|
return Align(
|
||||||
alignment:
|
alignment:
|
||||||
const AlignmentDirectional(1, 0),
|
const AlignmentDirectional(1, 0),
|
||||||
child: Padding(
|
child: Padding(
|
||||||
padding: const EdgeInsetsDirectional
|
padding:
|
||||||
.fromSTEB(17, 33, 0, 24),
|
EdgeInsetsDirectional.fromSTEB(
|
||||||
|
34.rpx, 66.rpx, 0, 48.rpx),
|
||||||
child: Container(
|
child: Container(
|
||||||
width: 61,
|
width: 61,
|
||||||
height: MediaQuery.sizeOf(context)
|
height: MediaQuery.sizeOf(context)
|
||||||
@@ -510,6 +511,7 @@ class RepairHistoryListPage extends GetView<RepairInfoController> {
|
|||||||
),
|
),
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
|
}
|
||||||
return Container();
|
return Container();
|
||||||
}),
|
}),
|
||||||
Obx(() {
|
Obx(() {
|
||||||
@@ -518,17 +520,17 @@ class RepairHistoryListPage extends GetView<RepairInfoController> {
|
|||||||
.status &&
|
.status &&
|
||||||
controller.model.applyRepairModel!
|
controller.model.applyRepairModel!
|
||||||
.score !=
|
.score !=
|
||||||
null)
|
null) {
|
||||||
return Padding(
|
return Padding(
|
||||||
padding: const EdgeInsetsDirectional
|
padding: EdgeInsetsDirectional.fromSTEB(
|
||||||
.fromSTEB(0, 0, 0, 5),
|
0, 0, 0, 10.rpx),
|
||||||
child: Container(
|
child: Container(
|
||||||
width:
|
width:
|
||||||
MediaQuery.sizeOf(context).width,
|
MediaQuery.sizeOf(context).width,
|
||||||
decoration: BoxDecoration(
|
decoration: BoxDecoration(
|
||||||
color: Colors.white, //true
|
color: Colors.white, //true
|
||||||
borderRadius:
|
borderRadius:
|
||||||
BorderRadius.circular(8),
|
BorderRadius.circular(16.rpx),
|
||||||
),
|
),
|
||||||
child: Padding(
|
child: Padding(
|
||||||
padding: const EdgeInsetsDirectional
|
padding: const EdgeInsetsDirectional
|
||||||
@@ -578,9 +580,9 @@ class RepairHistoryListPage extends GetView<RepairInfoController> {
|
|||||||
-1, 0),
|
-1, 0),
|
||||||
child: Padding(
|
child: Padding(
|
||||||
padding:
|
padding:
|
||||||
const EdgeInsetsDirectional
|
EdgeInsetsDirectional
|
||||||
.fromSTEB(
|
.fromSTEB(34.rpx,
|
||||||
17, 0, 0, 0),
|
0, 0, 0),
|
||||||
child: Container(
|
child: Container(
|
||||||
width:
|
width:
|
||||||
MediaQuery.sizeOf(
|
MediaQuery.sizeOf(
|
||||||
@@ -602,13 +604,12 @@ class RepairHistoryListPage extends GetView<RepairInfoController> {
|
|||||||
const AlignmentDirectional(
|
const AlignmentDirectional(
|
||||||
-1, 0),
|
-1, 0),
|
||||||
child: Padding(
|
child: Padding(
|
||||||
padding:
|
padding: EdgeInsetsDirectional
|
||||||
const EdgeInsetsDirectional
|
.fromSTEB(
|
||||||
.fromSTEB(
|
|
||||||
0,
|
0,
|
||||||
0,
|
0,
|
||||||
0,
|
0,
|
||||||
10),
|
20.rpx),
|
||||||
child: Text(
|
child: Text(
|
||||||
// '2023-08-22 12:12:44',
|
// '2023-08-22 12:12:44',
|
||||||
MyUtils.formatDateTime(
|
MyUtils.formatDateTime(
|
||||||
@@ -751,6 +752,7 @@ class RepairHistoryListPage extends GetView<RepairInfoController> {
|
|||||||
),
|
),
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
|
}
|
||||||
return Container();
|
return Container();
|
||||||
}),
|
}),
|
||||||
],
|
],
|
||||||
211
lib/pages/mh_page/repair_history_widget.dart
Normal file
211
lib/pages/mh_page/repair_history_widget.dart
Normal file
@@ -0,0 +1,211 @@
|
|||||||
|
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/util/FitTool.dart';
|
||||||
|
import 'package:vbvs_app/common/util/MyUtils.dart';
|
||||||
|
import 'package:vbvs_app/component/tool/ClickableContainer.dart';
|
||||||
|
import 'package:vbvs_app/controller/mh_controller/repair_info_controller.dart';
|
||||||
|
import 'package:vbvs_app/controller/mh_controller/repair_list_controller.dart';
|
||||||
|
import 'package:vbvs_app/pages/mh_page/ColorChangeOnTap.dart';
|
||||||
|
|
||||||
|
import '../../common/color/appFontsize.dart';
|
||||||
|
|
||||||
|
class RepairHistoryWidget extends GetView<RepairInfoController> {
|
||||||
|
int index;
|
||||||
|
RepairListController repairListController;
|
||||||
|
|
||||||
|
RepairHistoryWidget(
|
||||||
|
{required this.index, required this.repairListController}) {}
|
||||||
|
|
||||||
|
@override
|
||||||
|
Widget build(BuildContext context) {
|
||||||
|
int tmp = index;
|
||||||
|
index = tmp;
|
||||||
|
// return ColorChangeOnPress(
|
||||||
|
// pressColor: AppColors().press_color, // 按下时的颜色
|
||||||
|
// shouldNavigate: true, // 是否需要跳转
|
||||||
|
// routeName: "/repairHistoryListPage", // 路由名称
|
||||||
|
// topLeft: 16,
|
||||||
|
// topRight: 16,
|
||||||
|
// bottomLeft: 16,
|
||||||
|
// bottomRight: 16,
|
||||||
|
// onTap: () async {
|
||||||
|
// print("object");
|
||||||
|
// final RepairInfoController repairInfoController =
|
||||||
|
// Get.find<RepairInfoController>();
|
||||||
|
// await repairInfoController
|
||||||
|
// .initData(repairListController.model.repairList[index])
|
||||||
|
// .then((_) {
|
||||||
|
// repairInfoController.updateAll();
|
||||||
|
// // Get.toNamed("/repairHistoryListPage"); // 这个在 ColorChangeOnPress 中已经处理
|
||||||
|
// });
|
||||||
|
// },
|
||||||
|
// child: Container(
|
||||||
|
// width: MediaQuery.sizeOf(context).width,
|
||||||
|
// constraints: BoxConstraints(
|
||||||
|
// minHeight: 70,
|
||||||
|
// ),
|
||||||
|
// child: Padding(
|
||||||
|
// padding: EdgeInsetsDirectional.fromSTEB(15, 14, 15, 13),
|
||||||
|
// child: Row(
|
||||||
|
// mainAxisSize: MainAxisSize.max,
|
||||||
|
// mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||||
|
// children: [
|
||||||
|
// Container(
|
||||||
|
// width: MediaQuery.sizeOf(context).width * 0.5,
|
||||||
|
// child: Column(
|
||||||
|
// mainAxisSize: MainAxisSize.max,
|
||||||
|
// children: [
|
||||||
|
// Align(
|
||||||
|
// alignment: AlignmentDirectional(-1, 0),
|
||||||
|
// child: Text(
|
||||||
|
// repairListController
|
||||||
|
// .model.repairList[index].device_category ??
|
||||||
|
// '',
|
||||||
|
// style: FlutterFlowTheme.of(context).bodyMedium.override(
|
||||||
|
// fontFamily: 'Readex Pro',
|
||||||
|
// color: Color(0xFF333333),
|
||||||
|
// fontSize: 30.rpx,
|
||||||
|
// letterSpacing: 0,
|
||||||
|
// ),
|
||||||
|
// ),
|
||||||
|
// ),
|
||||||
|
// Align(
|
||||||
|
// alignment: AlignmentDirectional(-1, 0),
|
||||||
|
// child: Text(
|
||||||
|
// "报修单号:${repairListController.model.repairList[index].id}",
|
||||||
|
// style: FlutterFlowTheme.of(context).bodyMedium.override(
|
||||||
|
// fontFamily: 'Readex Pro',
|
||||||
|
// color: Color(0xFFC8CBD2),
|
||||||
|
// fontSize: AppFontsize.small_text_size,
|
||||||
|
// letterSpacing: 0,
|
||||||
|
// ),
|
||||||
|
// ),
|
||||||
|
// ),
|
||||||
|
// Align(
|
||||||
|
// alignment: AlignmentDirectional(-1, 0),
|
||||||
|
// child: Text(
|
||||||
|
// "提交时间:" +
|
||||||
|
// (MyUtils.formatDateTime(repairListController
|
||||||
|
// .model.repairList[index].create_time!) ??
|
||||||
|
// ''),
|
||||||
|
// style: FlutterFlowTheme.of(context).bodyMedium.override(
|
||||||
|
// fontFamily: 'Readex Pro',
|
||||||
|
// color: Color(0xFFC8CBD2),
|
||||||
|
// fontSize: AppFontsize.small_text_size,
|
||||||
|
// letterSpacing: 0,
|
||||||
|
// ),
|
||||||
|
// ),
|
||||||
|
// ),
|
||||||
|
// ],
|
||||||
|
// ),
|
||||||
|
// ),
|
||||||
|
// Container(
|
||||||
|
// width: MediaQuery.sizeOf(context).width * 0.2,
|
||||||
|
// height: MediaQuery.sizeOf(context).height * 0.075,
|
||||||
|
// constraints: BoxConstraints(
|
||||||
|
// maxWidth: 130,
|
||||||
|
// ),
|
||||||
|
// child: Row(
|
||||||
|
// mainAxisSize: MainAxisSize.max,
|
||||||
|
// mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||||
|
// children: [
|
||||||
|
// Align(
|
||||||
|
// alignment: AlignmentDirectional(0, 0),
|
||||||
|
// child: Text(
|
||||||
|
// repairListController.model.repairList[index].status ??
|
||||||
|
// '',
|
||||||
|
// style: FlutterFlowTheme.of(context).bodyMedium.override(
|
||||||
|
// fontFamily: 'Readex Pro',
|
||||||
|
// color: Color(0xFF333333),
|
||||||
|
// fontSize: AppFontsize.normal_text_size,
|
||||||
|
// letterSpacing: 0,
|
||||||
|
// ),
|
||||||
|
// ),
|
||||||
|
// ),
|
||||||
|
// Flexible(
|
||||||
|
// child: Align(
|
||||||
|
// alignment: AlignmentDirectional(0, 0.05),
|
||||||
|
// child: Icon(
|
||||||
|
// Icons.arrow_forward_ios,
|
||||||
|
// color: FlutterFlowTheme.of(context).secondaryText,
|
||||||
|
// size: 10,
|
||||||
|
// ),
|
||||||
|
// ),
|
||||||
|
// ),
|
||||||
|
// ].divide(SizedBox(width: 27)),
|
||||||
|
// ),
|
||||||
|
// ),
|
||||||
|
// ],
|
||||||
|
// ),
|
||||||
|
// ),
|
||||||
|
// ),
|
||||||
|
// );
|
||||||
|
|
||||||
|
return ClickableContainer(
|
||||||
|
backgroundColor: Colors.transparent,
|
||||||
|
highlightColor: Color(0XFF055466),
|
||||||
|
padding: EdgeInsets.only(top: 0),
|
||||||
|
onTap: () {
|
||||||
|
Get.toNamed("/repairHistoryListPage");
|
||||||
|
},
|
||||||
|
child: Container(
|
||||||
|
// height: 119.rpx,
|
||||||
|
height: MediaQuery.sizeOf(context).height * 0.0733,
|
||||||
|
decoration: BoxDecoration(
|
||||||
|
// color: const Color(0xFF06486F),
|
||||||
|
border: Border(
|
||||||
|
top: index == 0
|
||||||
|
? BorderSide(color: const Color(0xFF929699), width: 1.rpx)
|
||||||
|
: BorderSide.none,
|
||||||
|
bottom:
|
||||||
|
BorderSide(color: const Color(0xFF929699), width: 1.rpx),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
child: Padding(
|
||||||
|
padding: EdgeInsets.fromLTRB(17.rpx, 0, 30.rpx, 0),
|
||||||
|
child: Row(
|
||||||
|
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||||
|
crossAxisAlignment: CrossAxisAlignment.center,
|
||||||
|
children: [
|
||||||
|
// 左侧设备信息
|
||||||
|
Column(
|
||||||
|
mainAxisAlignment: MainAxisAlignment.center,
|
||||||
|
crossAxisAlignment: CrossAxisAlignment.start,
|
||||||
|
children: [
|
||||||
|
Text(
|
||||||
|
repairListController
|
||||||
|
.model.repairList[index].device_category ??
|
||||||
|
'',
|
||||||
|
style: TextStyle(
|
||||||
|
color: Colors.white, fontSize: 30.rpx, height: 1),
|
||||||
|
),
|
||||||
|
const SizedBox(height: 4),
|
||||||
|
Text(
|
||||||
|
"提交时间:" +
|
||||||
|
(MyUtils.formatDateTime(repairListController
|
||||||
|
.model.repairList[index].create_time!) ??
|
||||||
|
''),
|
||||||
|
style: TextStyle(
|
||||||
|
color: Colors.white60, fontSize: 20.rpx, height: 1),
|
||||||
|
),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
// 右侧状态
|
||||||
|
Row(
|
||||||
|
children: [
|
||||||
|
Text(
|
||||||
|
repairListController.model.repairList[index].status ??
|
||||||
|
'',
|
||||||
|
style: TextStyle(color: Colors.white, fontSize: 26.rpx),
|
||||||
|
),
|
||||||
|
Icon(Icons.arrow_forward_ios,
|
||||||
|
color: Colors.white, size: 30.rpx),
|
||||||
|
],
|
||||||
|
)
|
||||||
|
],
|
||||||
|
),
|
||||||
|
)));
|
||||||
|
}
|
||||||
|
}
|
||||||
387
lib/pages/mh_page/repair_list.dart
Normal file
387
lib/pages/mh_page/repair_list.dart
Normal file
@@ -0,0 +1,387 @@
|
|||||||
|
import 'package:ef/ef.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/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';
|
||||||
|
import 'package:vbvs_app/pages/mh_page/EmptyMessageWidget.dart';
|
||||||
|
import 'package:vbvs_app/pages/mh_page/repair_history_widget.dart';
|
||||||
|
|
||||||
|
class DeviceRepairPage extends GetView<RepairListController> {
|
||||||
|
final scaffoldKey = GlobalKey<ScaffoldState>();
|
||||||
|
BoxConstraints? bodysize;
|
||||||
|
final ScrollController scrollController = ScrollController();
|
||||||
|
// final ScrollController scrollController = ScrollController();
|
||||||
|
final RepairListController controller = Get.find();
|
||||||
|
|
||||||
|
// DeviceRepairPage() {
|
||||||
|
// controller.model.limit = AppConstants.limit;
|
||||||
|
// controller.model.offset = 0;
|
||||||
|
// controller.model.isLoading = false;
|
||||||
|
// controller.model.hasMore = true;
|
||||||
|
// controller.model.repairList.clear();
|
||||||
|
// controller.initData();
|
||||||
|
// Get.put(RepairListController());
|
||||||
|
|
||||||
|
// scrollController.addListener(() {
|
||||||
|
// if (scrollController.position.pixels ==
|
||||||
|
// scrollController.position.maxScrollExtent &&
|
||||||
|
// controller.model.hasMore) {
|
||||||
|
// controller.initData();
|
||||||
|
// controller.updateAll();
|
||||||
|
// }
|
||||||
|
// });
|
||||||
|
// }
|
||||||
|
|
||||||
|
// final List<ApplyRepairModel> mockData
|
||||||
|
|
||||||
|
@override
|
||||||
|
Widget build(BuildContext context) {
|
||||||
|
return LayoutBuilder(builder: (context, cc) {
|
||||||
|
bodysize = cc;
|
||||||
|
controller.model.repairList = List.generate(4, (index) {
|
||||||
|
return ApplyRepairModel()
|
||||||
|
..device_category = "SWESO1号智能一键入眠床"
|
||||||
|
..status = index == 0 ? "已提交" : "已完成"
|
||||||
|
..create_time = DateTime(2024, 5, 12, 12, 5, 12);
|
||||||
|
});
|
||||||
|
return GestureDetector(
|
||||||
|
onTap: () => FocusScope.of(context).unfocus(),
|
||||||
|
child: Container(
|
||||||
|
decoration: const BoxDecoration(
|
||||||
|
image: DecorationImage(
|
||||||
|
image: AssetImage('assets/images/new_background.png'), // 本地图片
|
||||||
|
fit: BoxFit.fill, // 填满整个 Container
|
||||||
|
),
|
||||||
|
),
|
||||||
|
child: Scaffold(
|
||||||
|
// key: scaffoldKey,
|
||||||
|
backgroundColor: Colors.transparent,
|
||||||
|
appBar: AppBar(
|
||||||
|
backgroundColor: Colors.transparent,
|
||||||
|
iconTheme: const IconThemeData(color: Colors.white),
|
||||||
|
automaticallyImplyLeading: false,
|
||||||
|
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,
|
||||||
|
),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
),
|
||||||
|
centerTitle: false,
|
||||||
|
),
|
||||||
|
body: SafeArea(
|
||||||
|
top: true,
|
||||||
|
child: Padding(
|
||||||
|
padding: EdgeInsets.fromLTRB(30.rpx, 6.rpx, 30.rpx, 0),
|
||||||
|
child: Column(
|
||||||
|
crossAxisAlignment: CrossAxisAlignment.start,
|
||||||
|
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||||
|
children: [
|
||||||
|
// 报修须知
|
||||||
|
Container(
|
||||||
|
height: 412.rpx,
|
||||||
|
decoration: BoxDecoration(
|
||||||
|
border: Border.all(
|
||||||
|
color: Color(0XFFC8CBD2), width: 0.rpx),
|
||||||
|
borderRadius: BorderRadius.circular(10),
|
||||||
|
),
|
||||||
|
child: Padding(
|
||||||
|
padding: EdgeInsets.fromLTRB(
|
||||||
|
27.rpx, 49.rpx, 43.rpx, 39.rpx),
|
||||||
|
child: Column(
|
||||||
|
crossAxisAlignment:
|
||||||
|
CrossAxisAlignment.center,
|
||||||
|
children: [
|
||||||
|
// 固定的标题部分
|
||||||
|
Text(
|
||||||
|
"报修须知",
|
||||||
|
style: TextStyle(
|
||||||
|
fontSize: 30.rpx,
|
||||||
|
fontWeight: FontWeight.bold,
|
||||||
|
color: Colors.white,
|
||||||
|
),
|
||||||
|
textAlign: TextAlign.center,
|
||||||
|
),
|
||||||
|
SizedBox(height: 33.rpx),
|
||||||
|
// 可滚动的正文部分,限定高度
|
||||||
|
Expanded(
|
||||||
|
child: SingleChildScrollView(
|
||||||
|
child: RichText(
|
||||||
|
text: TextSpan(
|
||||||
|
style: TextStyle(
|
||||||
|
color: Color(0XFF929699),
|
||||||
|
fontSize: 26.rpx,
|
||||||
|
),
|
||||||
|
children: [
|
||||||
|
TextSpan(
|
||||||
|
text:
|
||||||
|
"尊敬的用户,感谢您选择我司产品。在使用过程中,如果设备出现故障需要维修,请首先确认设备是否正确连接控制器或网络,检查设置是否正常,排除误操作问题。若问题依然存在,请记录下设备名称、设备编号、和具体故障内容,方便我们快速地为您提供帮助。您可以通过智慧棉花糖APP保修页面直接报修或拨打 ",
|
||||||
|
style: TextStyle(
|
||||||
|
color:
|
||||||
|
Color(0XFF929699),
|
||||||
|
fontSize: 26.rpx,
|
||||||
|
height: 1.3)),
|
||||||
|
TextSpan(
|
||||||
|
text: "400-8756-966",
|
||||||
|
style: TextStyle(
|
||||||
|
color: Colors.white,
|
||||||
|
// height: 1.3,
|
||||||
|
decoration: TextDecoration
|
||||||
|
.underline, // 添加下划线
|
||||||
|
decorationColor:
|
||||||
|
Colors.white,
|
||||||
|
decorationThickness: 4.rpx,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
TextSpan(
|
||||||
|
text: " 反馈。",
|
||||||
|
style: TextStyle(
|
||||||
|
color:
|
||||||
|
Color(0XFF929699),
|
||||||
|
fontSize: 26.rpx,
|
||||||
|
height: 1.3)),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
],
|
||||||
|
))),
|
||||||
|
|
||||||
|
SizedBox(height: 24.rpx),
|
||||||
|
|
||||||
|
InkWell(
|
||||||
|
onTap: () {
|
||||||
|
// bool isOk = true;
|
||||||
|
// for (var i = 0; i < 2; i++) {
|
||||||
|
// var d = controller.model.peopleList[i];
|
||||||
|
// print("${d.toJson()}");
|
||||||
|
// String before = "人员信息${i == 0 ? "A" : "B"}:";
|
||||||
|
// if (isOk &&
|
||||||
|
// d.height != null &&
|
||||||
|
// d.height != "" &&
|
||||||
|
// int.tryParse("${d.height}") == null) {
|
||||||
|
// showToast("$before身高请输入数字");
|
||||||
|
// isOk = false;
|
||||||
|
// }
|
||||||
|
// if (isOk &&
|
||||||
|
// d.weight != null &&
|
||||||
|
// d.weight != "" &&
|
||||||
|
// int.tryParse("${d.weight}") == null) {
|
||||||
|
// showToast("$before体重请输入数字");
|
||||||
|
// isOk = false;
|
||||||
|
// }
|
||||||
|
// if (isOk &&
|
||||||
|
// d.tel != null &&
|
||||||
|
// d.tel != "" &&
|
||||||
|
// MyUtils.isValidPhoneNumber("${d.tel}") ==
|
||||||
|
// false) {
|
||||||
|
// showToast("$before请输入正确的电话");
|
||||||
|
// isOk = false;
|
||||||
|
// }
|
||||||
|
// if (isOk &&
|
||||||
|
// d.emergencyContact != null &&
|
||||||
|
// d.emergencyContact != "" &&
|
||||||
|
// MyUtils.isValidPhoneNumber(
|
||||||
|
// "${d.emergencyContact}") ==
|
||||||
|
// false) {
|
||||||
|
// showToast("$before请输入正确的紧急联系人电话");
|
||||||
|
// isOk = false;
|
||||||
|
// }
|
||||||
|
// if (isOk) {
|
||||||
|
// controller.savePeoples().then((d) {
|
||||||
|
// showToast("保存成功", color: color_success);
|
||||||
|
// }).catchError((d) {
|
||||||
|
// print("$d");
|
||||||
|
// showToast("保存失败");
|
||||||
|
// });
|
||||||
|
// }
|
||||||
|
// }
|
||||||
|
// controller.model.peopleList.forEach((d) {});
|
||||||
|
},
|
||||||
|
child: CustomCard(
|
||||||
|
borderRadius: 16.rpx,
|
||||||
|
gradientDirection: GradientDirection.vertical,
|
||||||
|
onTap: () {
|
||||||
|
Get.toNamed("/applyRepairPage");
|
||||||
|
},
|
||||||
|
colors: const [
|
||||||
|
Color(0xFFFCFCFC),
|
||||||
|
Color(0xFFF8FAF9),
|
||||||
|
Color(0XFFECF6F3),
|
||||||
|
Color(0XFFD9F0E9),
|
||||||
|
Color(0xFFCEECE3)
|
||||||
|
],
|
||||||
|
child: Container(
|
||||||
|
width: double.infinity,
|
||||||
|
height: 90.rpx,
|
||||||
|
alignment: Alignment.center,
|
||||||
|
decoration: BoxDecoration(
|
||||||
|
borderRadius: BorderRadius.circular(6),
|
||||||
|
),
|
||||||
|
child: Text(
|
||||||
|
"我要报修",
|
||||||
|
style: FlutterFlowTheme.of(context)
|
||||||
|
.bodyMedium
|
||||||
|
.override(
|
||||||
|
fontFamily: 'Readex Pro',
|
||||||
|
color: stringToColor("#011D33"),
|
||||||
|
letterSpacing: 0,
|
||||||
|
fontSize: 30.rpx,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
)),
|
||||||
|
|
||||||
|
SizedBox(height: 235.rpx),
|
||||||
|
|
||||||
|
// 报修历史标题
|
||||||
|
Container(
|
||||||
|
width: double.infinity,
|
||||||
|
child: Text("报修历史",
|
||||||
|
style: TextStyle(
|
||||||
|
color: Colors.white,
|
||||||
|
fontSize: 30.rpx,
|
||||||
|
height: 1)),
|
||||||
|
),
|
||||||
|
|
||||||
|
SizedBox(height: 32.rpx),
|
||||||
|
|
||||||
|
// 报修历史列表
|
||||||
|
// Expanded(
|
||||||
|
// child: ListView.builder(
|
||||||
|
// itemCount: mockData.length,
|
||||||
|
// itemBuilder: (context, index) {
|
||||||
|
// final item = mockData[index];
|
||||||
|
// return ClickableContainer(
|
||||||
|
// backgroundColor: Colors.transparent,
|
||||||
|
// highlightColor: Color(0XFF055466),
|
||||||
|
// padding: EdgeInsets.only(top: 0),
|
||||||
|
// onTap: () {
|
||||||
|
// Get.toNamed("/repairHistoryListPage");
|
||||||
|
// },
|
||||||
|
// child: Container(
|
||||||
|
// height: 119.rpx,
|
||||||
|
// // margin: const EdgeInsets.only(bottom: 10),
|
||||||
|
// // padding: const EdgeInsets.symmetric(
|
||||||
|
// // vertical: 12, horizontal: 16),
|
||||||
|
// decoration: BoxDecoration(
|
||||||
|
// // color: const Color(0xFF06486F),
|
||||||
|
// border: Border(
|
||||||
|
// top: index == 0
|
||||||
|
// ? BorderSide(
|
||||||
|
// color:
|
||||||
|
// const Color(0xFF929699),
|
||||||
|
// width: 1.rpx)
|
||||||
|
// : BorderSide.none,
|
||||||
|
// bottom: BorderSide(
|
||||||
|
// color: const Color(0xFF929699),
|
||||||
|
// width: 1.rpx),
|
||||||
|
// ),
|
||||||
|
// ),
|
||||||
|
// child: Padding(
|
||||||
|
// padding: EdgeInsets.fromLTRB(
|
||||||
|
// 17.rpx, 0, 30.rpx, 0),
|
||||||
|
// child: Row(
|
||||||
|
// mainAxisAlignment:
|
||||||
|
// MainAxisAlignment.spaceBetween,
|
||||||
|
// crossAxisAlignment:
|
||||||
|
// CrossAxisAlignment.center,
|
||||||
|
// children: [
|
||||||
|
// // 左侧设备信息
|
||||||
|
// Column(
|
||||||
|
// mainAxisAlignment:
|
||||||
|
// MainAxisAlignment.center,
|
||||||
|
// crossAxisAlignment:
|
||||||
|
// CrossAxisAlignment.start,
|
||||||
|
// children: [
|
||||||
|
// Text(
|
||||||
|
// item.device_name ?? '',
|
||||||
|
// style: TextStyle(
|
||||||
|
// color: Colors.white,
|
||||||
|
// fontSize: 30.rpx),
|
||||||
|
// ),
|
||||||
|
// const SizedBox(height: 4),
|
||||||
|
// Text(
|
||||||
|
// "提交时间:${item.create_time?.toString().substring(0, 19) ?? ''}",
|
||||||
|
// style: TextStyle(
|
||||||
|
// color: Colors.white60,
|
||||||
|
// fontSize: 20.rpx),
|
||||||
|
// ),
|
||||||
|
// ],
|
||||||
|
// ),
|
||||||
|
// // 右侧状态
|
||||||
|
// Row(
|
||||||
|
// children: [
|
||||||
|
// Text(
|
||||||
|
// item.status ?? '',
|
||||||
|
// style: TextStyle(
|
||||||
|
// color: Colors.white,
|
||||||
|
// fontSize: 26.rpx),
|
||||||
|
// ),
|
||||||
|
// Icon(Icons.arrow_forward_ios,
|
||||||
|
// color: Colors.white,
|
||||||
|
// size: 30.rpx),
|
||||||
|
// ],
|
||||||
|
// )
|
||||||
|
// ],
|
||||||
|
// ),
|
||||||
|
// )));
|
||||||
|
// },
|
||||||
|
// ),
|
||||||
|
// ),
|
||||||
|
|
||||||
|
Obx(() {
|
||||||
|
return Visibility(
|
||||||
|
visible: controller.model.repairList != null &&
|
||||||
|
controller.model.repairList!.isNotEmpty,
|
||||||
|
replacement: EmptyMessageWidget(),
|
||||||
|
child: Expanded(
|
||||||
|
child: Obx(() => ListView(
|
||||||
|
controller:
|
||||||
|
scrollController, // 绑定 ScrollController
|
||||||
|
shrinkWrap: true,
|
||||||
|
scrollDirection: Axis.vertical,
|
||||||
|
children: (controller.model.repairList
|
||||||
|
.asMap()
|
||||||
|
.entries
|
||||||
|
.map((e) => RepairHistoryWidget(
|
||||||
|
index: e.key,
|
||||||
|
repairListController: controller))
|
||||||
|
.toList() as List<Widget>)
|
||||||
|
// .divide(const SizedBox(
|
||||||
|
// height: 13,
|
||||||
|
// ))
|
||||||
|
// .addToEnd(SizedBox(
|
||||||
|
// height: AppConstants.list_end_height,
|
||||||
|
// ))
|
||||||
|
)),
|
||||||
|
),
|
||||||
|
);
|
||||||
|
}),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
))),
|
||||||
|
));
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -2,8 +2,9 @@ import 'package:ef/ef.dart';
|
|||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
import 'package:vbvs_app/common/color/appColors.dart';
|
import 'package:vbvs_app/common/color/appColors.dart';
|
||||||
import 'package:vbvs_app/common/color/repair_status.dart';
|
import 'package:vbvs_app/common/color/repair_status.dart';
|
||||||
|
import 'package:vbvs_app/common/util/FitTool.dart';
|
||||||
import 'package:vbvs_app/common/util/MyUtils.dart';
|
import 'package:vbvs_app/common/util/MyUtils.dart';
|
||||||
import 'package:vbvs_app/controller/mh/repair_info_controller.dart';
|
import 'package:vbvs_app/controller/mh_controller/repair_info_controller.dart';
|
||||||
|
|
||||||
import '../../common/color/appFontsize.dart';
|
import '../../common/color/appFontsize.dart';
|
||||||
|
|
||||||
@@ -43,7 +44,7 @@ class RepairStatusWidget extends GetView {
|
|||||||
'未知时间',
|
'未知时间',
|
||||||
style: FlutterFlowTheme.of(context).bodyMedium.override(
|
style: FlutterFlowTheme.of(context).bodyMedium.override(
|
||||||
fontFamily: 'Readex Pro',
|
fontFamily: 'Readex Pro',
|
||||||
fontSize: AppFontsize.normal_text_size,
|
fontSize: 26.rpx,
|
||||||
letterSpacing: 0,
|
letterSpacing: 0,
|
||||||
color: index ==
|
color: index ==
|
||||||
repairInfoController
|
repairInfoController
|
||||||
@@ -66,7 +67,7 @@ class RepairStatusWidget extends GetView {
|
|||||||
'未知状态',
|
'未知状态',
|
||||||
style: FlutterFlowTheme.of(context).bodyMedium.override(
|
style: FlutterFlowTheme.of(context).bodyMedium.override(
|
||||||
fontFamily: 'Readex Pro',
|
fontFamily: 'Readex Pro',
|
||||||
fontSize: AppFontsize.normal_text_size,
|
fontSize: 26.rpx,
|
||||||
letterSpacing: 0,
|
letterSpacing: 0,
|
||||||
color: repairInfoController
|
color: repairInfoController
|
||||||
.model.repairProcessList[index].status ==
|
.model.repairProcessList[index].status ==
|
||||||
@@ -107,7 +108,7 @@ class RepairStatusWidget extends GetView {
|
|||||||
style: FlutterFlowTheme.of(context).bodyMedium.override(
|
style: FlutterFlowTheme.of(context).bodyMedium.override(
|
||||||
fontFamily: 'Readex Pro',
|
fontFamily: 'Readex Pro',
|
||||||
color: Colors.white,
|
color: Colors.white,
|
||||||
fontSize: AppFontsize.small_text_size,
|
fontSize: 20.rpx,
|
||||||
letterSpacing: 0,
|
letterSpacing: 0,
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
@@ -149,7 +149,7 @@ class _RoomPickerPageState extends State<RoomPickerPage> {
|
|||||||
width: double.infinity,
|
width: double.infinity,
|
||||||
height: 50,
|
height: 50,
|
||||||
child: CustomCard(
|
child: CustomCard(
|
||||||
borderRadius: 10,
|
borderRadius: 16.rpx,
|
||||||
gradientDirection: GradientDirection.vertical,
|
gradientDirection: GradientDirection.vertical,
|
||||||
onTap: () {
|
onTap: () {
|
||||||
// Get.toNamed("/applyRepairPage");
|
// Get.toNamed("/applyRepairPage");
|
||||||
@@ -5,10 +5,7 @@ import 'package:vbvs_app/common/color/appConstants.dart';
|
|||||||
import 'package:vbvs_app/common/util/FitTool.dart';
|
import 'package:vbvs_app/common/util/FitTool.dart';
|
||||||
import 'package:vbvs_app/common/util/MyUtils.dart';
|
import 'package:vbvs_app/common/util/MyUtils.dart';
|
||||||
import 'package:vbvs_app/component/tool/CustomCard.dart';
|
import 'package:vbvs_app/component/tool/CustomCard.dart';
|
||||||
import 'package:vbvs_app/controller/mh/score_controller.dart' as mh;
|
import 'package:vbvs_app/controller/mh_controller/score_controller.dart' as mh;
|
||||||
|
|
||||||
import '../../common/color/appFontsize.dart';
|
|
||||||
|
|
||||||
class ScorePage extends GetView<mh.ScoreController> {
|
class ScorePage extends GetView<mh.ScoreController> {
|
||||||
BoxConstraints? bodysize;
|
BoxConstraints? bodysize;
|
||||||
final scaffoldKey = GlobalKey<ScaffoldState>();
|
final scaffoldKey = GlobalKey<ScaffoldState>();
|
||||||
@@ -425,7 +422,7 @@ class ScorePage extends GetView<mh.ScoreController> {
|
|||||||
// ),
|
// ),
|
||||||
|
|
||||||
child: CustomCard(
|
child: CustomCard(
|
||||||
borderRadius: 10,
|
borderRadius: 16.rpx,
|
||||||
gradientDirection: GradientDirection.vertical,
|
gradientDirection: GradientDirection.vertical,
|
||||||
onTap: () {
|
onTap: () {
|
||||||
Get.toNamed("/applyRepairPage");
|
Get.toNamed("/applyRepairPage");
|
||||||
@@ -3,8 +3,6 @@ import 'package:flutter/material.dart';
|
|||||||
import 'package:flutter_svg/flutter_svg.dart';
|
import 'package:flutter_svg/flutter_svg.dart';
|
||||||
import 'package:flutterflow_ui/flutterflow_ui.dart';
|
import 'package:flutterflow_ui/flutterflow_ui.dart';
|
||||||
import 'package:vbvs_app/common/util/FitTool.dart';
|
import 'package:vbvs_app/common/util/FitTool.dart';
|
||||||
|
|
||||||
import '../../common/color/appFontsize.dart';
|
|
||||||
import '../../common/util/MyUtils.dart';
|
import '../../common/util/MyUtils.dart';
|
||||||
|
|
||||||
class SearchWidget extends GetView {
|
class SearchWidget extends GetView {
|
||||||
@@ -163,106 +161,7 @@ class SearchWidget extends GetView {
|
|||||||
),
|
),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
// Container(
|
|
||||||
// width: MediaQuery.sizeOf(context).width,
|
|
||||||
// height: 44,
|
|
||||||
// decoration: BoxDecoration(
|
|
||||||
// // color: Colors.red,
|
|
||||||
// borderRadius: BorderRadius.circular(50.rpx),
|
|
||||||
// ),
|
|
||||||
// child: Container(
|
|
||||||
// width: MediaQuery.sizeOf(context).width,
|
|
||||||
// height: 44,
|
|
||||||
// decoration: BoxDecoration(
|
|
||||||
// color: valueOrDefault<Color>(
|
|
||||||
// color,
|
|
||||||
// Color(0xFF821111),
|
|
||||||
// ),
|
|
||||||
// borderRadius: BorderRadius.circular(50),
|
|
||||||
// ),
|
|
||||||
// child: Stack(
|
|
||||||
// children: [
|
|
||||||
// Align(
|
|
||||||
// alignment: AlignmentDirectional(0, 0),
|
|
||||||
// child: Padding(
|
|
||||||
// padding: EdgeInsetsDirectional.fromSTEB(0, 6, 0, 6),
|
|
||||||
// child: Container(
|
|
||||||
// padding: EdgeInsets.only(right: 30.rpx),
|
|
||||||
// width: double.infinity,
|
|
||||||
// height: 70.rpx,
|
|
||||||
// decoration: BoxDecoration(
|
|
||||||
// borderRadius: BorderRadius.circular(10.rpx)),
|
|
||||||
// child: TextField(
|
|
||||||
// controller: TextEditingController(text: keyword),
|
|
||||||
// onChanged: (d) {
|
|
||||||
// onChange?.call(d);
|
|
||||||
// },
|
|
||||||
// style: TextStyle(
|
|
||||||
// fontSize: 28.rpx, color: stringToColor("#C8CBD2")),
|
|
||||||
// decoration: InputDecoration(
|
|
||||||
// contentPadding:
|
|
||||||
// EdgeInsets.only(top: 0, bottom: 0, right: 20.rpx),
|
|
||||||
// border: OutlineInputBorder(
|
|
||||||
// borderSide: BorderSide.none,
|
|
||||||
// borderRadius: BorderRadius.circular(50.rpx)),
|
|
||||||
// filled: true,
|
|
||||||
// hintText: "$hint",
|
|
||||||
// hintStyle: TextStyle(color: stringToColor("#c8cbd2")),
|
|
||||||
// fillColor: stringToColor("#FFFFFF"),
|
|
||||||
// // prefixIcon: Icon(
|
|
||||||
// // Icons.search,
|
|
||||||
// // size: 42.rpx,
|
|
||||||
// // color: stringToColor("#D3B684"),
|
|
||||||
// // ),
|
|
||||||
// prefixIcon: Container(
|
|
||||||
// padding: EdgeInsets.all(15.rpx), // 可根据需求调整内边距
|
|
||||||
// child: SvgPicture.asset(
|
|
||||||
// 'assets/images/search.svg',
|
|
||||||
// fit: BoxFit.contain, // 确保 SVG 图像不会超出边界
|
|
||||||
// color: stringToColor("#D3B684"),
|
|
||||||
// ),
|
|
||||||
// ),
|
|
||||||
// ),
|
|
||||||
// ),
|
|
||||||
// ),
|
|
||||||
// )),
|
|
||||||
// Align(
|
|
||||||
// alignment: AlignmentDirectional(0.95, 0),
|
|
||||||
// child: Padding(
|
|
||||||
// padding: EdgeInsetsDirectional.fromSTEB(0, 5, 0, 5),
|
|
||||||
// child: InkWell(
|
|
||||||
// onTap: () {
|
|
||||||
// findCallback?.call();
|
|
||||||
// },
|
|
||||||
// child: Container(
|
|
||||||
// width: 50,
|
|
||||||
// // height: 50,
|
|
||||||
// height: MediaQuery.sizeOf(context).height * 1,
|
|
||||||
// decoration: BoxDecoration(
|
|
||||||
// color: Color(0xFFD3B684),
|
|
||||||
// borderRadius: BorderRadius.circular(50),
|
|
||||||
// ),
|
|
||||||
// child: Align(
|
|
||||||
// alignment: AlignmentDirectional(0, 0),
|
|
||||||
// child: Text(
|
|
||||||
// '搜索',
|
|
||||||
// style:
|
|
||||||
// FlutterFlowTheme.of(context).bodyMedium.override(
|
|
||||||
// fontFamily: 'Readex Pro',
|
|
||||||
// color: Colors.white,
|
|
||||||
// fontSize: AppFontsize.normal_text_size,
|
|
||||||
// letterSpacing: 0,
|
|
||||||
// ),
|
|
||||||
// ),
|
|
||||||
// ),
|
|
||||||
// ),
|
|
||||||
// ),
|
|
||||||
// ),
|
|
||||||
// ),
|
|
||||||
// ],
|
|
||||||
// ),
|
|
||||||
// ),
|
|
||||||
// ),
|
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -1,12 +1,11 @@
|
|||||||
import 'package:ef/ef.dart';
|
import 'package:ef/ef.dart';
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
import 'package:flutter_switch/flutter_switch.dart';
|
import 'package:flutter_switch/flutter_switch.dart';
|
||||||
import 'package:vbvs_app/common/color/appColors.dart';
|
|
||||||
import 'package:vbvs_app/common/util/FitTool.dart';
|
import 'package:vbvs_app/common/util/FitTool.dart';
|
||||||
import 'package:vbvs_app/common/util/MyUtils.dart';
|
import 'package:vbvs_app/common/util/MyUtils.dart';
|
||||||
import 'package:vbvs_app/pages/common/selectDialog.dart';
|
import 'package:vbvs_app/pages/common/selectDialog.dart';
|
||||||
|
|
||||||
import '../../controller/mh/sleeping_habit_controller.dart';
|
import '../../controller/mh_controller/sleeping_habit_controller.dart';
|
||||||
|
|
||||||
//睡眠隐私
|
//睡眠隐私
|
||||||
class Smys extends GetView<SleepingHabitController> {
|
class Smys extends GetView<SleepingHabitController> {
|
||||||
@@ -1,33 +1,35 @@
|
|||||||
import 'package:ef/ef.dart';
|
import 'package:ef/ef.dart';
|
||||||
import 'package:flutter/cupertino.dart';
|
import 'package:flutter/cupertino.dart';
|
||||||
import 'package:path/path.dart';
|
import 'package:path/path.dart';
|
||||||
import 'package:vbvs_app/controller/mh/muser_info_controller.dart';
|
import 'package:vbvs_app/controller/mh_controller/muser_info_controller.dart';
|
||||||
|
|
||||||
import 'package:vbvs_app/controller/theme_controller/ThemeController.dart';
|
import 'package:vbvs_app/controller/theme_controller/ThemeController.dart';
|
||||||
|
|
||||||
import 'package:vbvs_app/pages/device_control/HomeDeviceType.dart';
|
import 'package:vbvs_app/pages/mh_page/HomeDeviceType.dart';
|
||||||
import 'package:vbvs_app/pages/device_control/LanguagePage.dart';
|
import 'package:vbvs_app/pages/mh_page/LanguagePage.dart';
|
||||||
import 'package:vbvs_app/pages/device_control/address_list_page.dart';
|
import 'package:vbvs_app/pages/mh_page/address_list_page.dart';
|
||||||
import 'package:vbvs_app/pages/device_control/apply_repair_page.dart';
|
import 'package:vbvs_app/pages/mh_page/apply_repair_page.dart';
|
||||||
import 'package:vbvs_app/pages/device_control/book_info_page.dart';
|
import 'package:vbvs_app/pages/mh_page/book_info_page.dart';
|
||||||
import 'package:vbvs_app/pages/device_control/book_success_page.dart';
|
import 'package:vbvs_app/pages/mh_page/book_success_page.dart';
|
||||||
import 'package:vbvs_app/pages/device_control/device_people_info.dart';
|
import 'package:vbvs_app/pages/mh_page/device_people_info.dart';
|
||||||
import 'package:vbvs_app/pages/device_control/edit_bed.dart';
|
import 'package:vbvs_app/pages/mh_page/edit_bed.dart';
|
||||||
import 'package:vbvs_app/pages/device_control/edit_userinfo_page.dart';
|
import 'package:vbvs_app/pages/mh_page/edit_userinfo_page.dart';
|
||||||
import 'package:vbvs_app/pages/device_control/experience_store_page.dart';
|
import 'package:vbvs_app/pages/mh_page/experience_store_page.dart';
|
||||||
import 'package:vbvs_app/pages/device_control/issue_list_page.dart';
|
import 'package:vbvs_app/pages/mh_page/find_password_page.dart';
|
||||||
import 'package:vbvs_app/pages/device_control/my_experience_page.dart';
|
import 'package:vbvs_app/pages/mh_page/issue_list_page.dart';
|
||||||
import 'package:vbvs_app/pages/device_control/people_info.dart';
|
import 'package:vbvs_app/pages/mh_page/my_experience_page.dart';
|
||||||
import 'package:vbvs_app/pages/device_control/repair_history_page.dart';
|
import 'package:vbvs_app/pages/mh_page/people_info.dart';
|
||||||
import 'package:vbvs_app/pages/device_control/repair_list.dart';
|
import 'package:vbvs_app/pages/mh_page/register_page.dart';
|
||||||
import 'package:vbvs_app/pages/device_control/room_picker.dart';
|
import 'package:vbvs_app/pages/mh_page/repair_history_page.dart';
|
||||||
import 'package:vbvs_app/pages/device_control/sleep_habit.dart';
|
import 'package:vbvs_app/pages/mh_page/repair_list.dart';
|
||||||
import 'package:vbvs_app/pages/device_control/smys.dart';
|
import 'package:vbvs_app/pages/mh_page/room_picker.dart';
|
||||||
|
import 'package:vbvs_app/pages/mh_page/sleep_habit.dart';
|
||||||
|
import 'package:vbvs_app/pages/mh_page/smys.dart';
|
||||||
|
|
||||||
import '../pages/device_control/bluetooth.dart';
|
import '../pages/mh_page/bluetooth.dart';
|
||||||
import '../pages/device_control/edit_address_page.dart';
|
import '../pages/mh_page/edit_address_page.dart';
|
||||||
import '../pages/device_control/message_page.dart';
|
import '../pages/mh_page/message_page.dart';
|
||||||
import '../pages/device_control/new_settingPage.dart';
|
import '../pages/mh_page/new_settingPage.dart';
|
||||||
|
|
||||||
ThemeController themeController = Get.find();
|
ThemeController themeController = Get.find();
|
||||||
|
|
||||||
@@ -55,6 +57,8 @@ var mhroutes = {
|
|||||||
"/bookSuccessPage": (contxt, {arguments}) =>
|
"/bookSuccessPage": (contxt, {arguments}) =>
|
||||||
BookSuccessPage(data: arguments["data"]),
|
BookSuccessPage(data: arguments["data"]),
|
||||||
"/myExperiencePage": (context) => MyExperiencePage(),
|
"/myExperiencePage": (context) => MyExperiencePage(),
|
||||||
|
"/registerPage": (context) => RegisterPage(),
|
||||||
|
"/findPasswordPage": (context) => FindPasswordPage(),
|
||||||
};
|
};
|
||||||
var mhonGenerateRoute = (RouteSettings settings) {
|
var mhonGenerateRoute = (RouteSettings settings) {
|
||||||
final String? name = settings.name; // 获取路由名称,如 /news 或 /search
|
final String? name = settings.name; // 获取路由名称,如 /news 或 /search
|
||||||
|
|||||||
@@ -58,6 +58,7 @@ dependencies:
|
|||||||
# fl_chart: ^1.0.0
|
# fl_chart: ^1.0.0
|
||||||
video_player: ^2.9.5
|
video_player: ^2.9.5
|
||||||
chewie: ^1.10.0
|
chewie: ^1.10.0
|
||||||
|
map_launcher: ^3.5.0
|
||||||
gif: ^2.3.0
|
gif: ^2.3.0
|
||||||
|
|
||||||
dev_dependencies:
|
dev_dependencies:
|
||||||
@@ -73,6 +74,7 @@ dependency_overrides:
|
|||||||
data_table_2: 2.5.16 # 2.5.17版本以后会报错,data_table_2.dart:525:47: Error:The method 'withValues' isn't defined ffor the class 'Color'
|
data_table_2: 2.5.16 # 2.5.17版本以后会报错,data_table_2.dart:525:47: Error:The method 'withValues' isn't defined ffor the class 'Color'
|
||||||
flutter_blue_plus: 1.34.5 # 1.35.0 版本android连接蓝牙有问题
|
flutter_blue_plus: 1.34.5 # 1.35.0 版本android连接蓝牙有问题
|
||||||
geolocator: 13.0.3
|
geolocator: 13.0.3
|
||||||
|
geolocator_android: 4.4.1
|
||||||
geocoding: 2.1.0
|
geocoding: 2.1.0
|
||||||
|
|
||||||
flutter:
|
flutter:
|
||||||
|
|||||||
Reference in New Issue
Block a user