Commit c7a2c67d by York

样式 历史问题调整 增加提示性语言

parent e9d7e7c9
......@@ -3,15 +3,15 @@
class Api {
static var IS_DEBUG = true;
// static String URL =
// IS_DEBUG ? "https://special.sxyztech.cn/" : "http://192.168.19.165:2222/";
static String URL =
IS_DEBUG ? "https://special.sxyztech.cn/" : "http://192.168.19.165:2222/";
///演示 ip
// static String URL = "http://47.92.138.92:8009/";
// static String URL = "http://192.168.19.164:8087/";
// static String URL = "http://192.168.19.165:2222/";
static String URL = "http://192.168.19.215:8181/";
// static String URL = "http://192.168.19.215:8181/";
static String START_URL = "special/a/",
END_URL = "__ajax=true&mobileLogin=true";
......
......@@ -1311,11 +1311,12 @@ class HttpUtils {
}
///获取练习题库
static Future getTestQuestions(
BuildContext context, typeId, questionNum, dxNum, pdNum) async {
static Future getTestQuestions(BuildContext context, typeId, positionType,
questionNum, dxNum, pdNum) async {
Map<String, dynamic> params = {
'user.id': StorageUtil.getInstance().getUserId(),
'type.id': typeId,
'positionType': positionType,
'questionNum': questionNum,
'dxNum': dxNum,
'pdNum': pdNum
......
class RoleList {
String? id;
String? name;
}
......@@ -87,7 +87,7 @@ class _ExamResultPageState extends State<ExamResultPage> {
])),
),
Container(
height: 300,
height: 350,
width: double.infinity,
margin:
const EdgeInsets.only(top: 5, left: 15, right: 15, bottom: 15),
......@@ -98,28 +98,34 @@ class _ExamResultPageState extends State<ExamResultPage> {
),
child: Column(
children: [
const Row(
Row(
mainAxisAlignment: MainAxisAlignment.center,
children: [
Text(
Container(
height: 40,
),
const Text(
'—————— ',
style: TextStyle(color: ColorConst.grayf5Color),
),
Text('本次考核成绩'),
Text(
const Text(
'本次考核成绩',
style: TextStyle(fontSize: 16),
),
const Text(
' ——————',
style: TextStyle(color: ColorConst.grayf5Color),
)
],
),
const SizedBox(height: 10),
// const SizedBox(height: 10),
Text(
examResultDataBo!.score!.round().toString(),
style: TextStyle(
color: examResultDataBo!.score! >= 90
? Colors.green
: Colors.red,
fontSize: 20,
fontSize: 50,
fontWeight: FontWeight.bold),
),
const SizedBox(height: 20),
......
......@@ -37,11 +37,13 @@ class TestPageState extends State<TestPage> with TickerProviderStateMixin {
List<ExamQuestionTestList>? examQuestionDList = []; //选择题
List<ExamQuestionTestList>? examQuestionPList = []; //判断题
TestSubmitBo? mTestSubmitBo;
var positionType = '';
@override
void initState() {
super.initState();
mTestSubmitBo = widget.arguments['mTestSubmitBo'];
positionType = widget.arguments['positionType'];
getQuestionsData();
_controller = AnimationController(
......@@ -57,7 +59,7 @@ class TestPageState extends State<TestPage> with TickerProviderStateMixin {
///获取考核试卷
void getQuestionsData() {
HttpUtils.getTestQuestions(
context, mTestSubmitBo!.mEquiList!.id, "0", "0", "0")
context, mTestSubmitBo!.mEquiList!.id, positionType, "0", "0", "0")
.then((value) {
TestQuestionsBo listBo = value;
if (mounted) {
......
......@@ -6,15 +6,19 @@ import 'package:special_equipment_flutter/dio/http_utils.dart';
import 'package:special_equipment_flutter/model/exam/eq_question_bo.dart';
import 'package:special_equipment_flutter/model/exam/equipment_list_bo.dart';
import 'package:special_equipment_flutter/model/exam/test_setting_bo.dart';
import 'package:special_equipment_flutter/model/role_bo.dart';
import 'package:special_equipment_flutter/utils/storage_util.dart';
import 'package:special_equipment_flutter/utils/toast_utils.dart';
import 'package:special_equipment_flutter/widgets/custom_button.dart';
import 'package:special_equipment_flutter/widgets/custom_textfield.dart';
import 'package:special_equipment_flutter/widgets/tip.dart';
///测试练习设置
class TestSettingPage extends StatefulWidget {
TestSettingPage({super.key});
var arguments = Get.arguments;
@override
State<TestSettingPage> createState() => _TestSettingPageState();
}
......@@ -22,6 +26,8 @@ class TestSettingPage extends StatefulWidget {
class _TestSettingPageState extends State<TestSettingPage> {
TextEditingController? equipmentText = TextEditingController();
FocusNode? equipmentFocusNode = FocusNode();
TextEditingController? roleText = TextEditingController();
FocusNode? roleFocusNode = FocusNode();
TextEditingController? singleText = TextEditingController();
FocusNode? singleZJFocusNode = FocusNode();
TextEditingController? judgmentText = TextEditingController();
......@@ -29,12 +35,54 @@ class _TestSettingPageState extends State<TestSettingPage> {
int allQuestions = 0;
EquiList? mEquiList;
DataEq? mDataEq;
var unitType = '1';
List<UserData>? roleUserLists = [];
var roleId = '', roleName = '';
@override
void initState() {
super.initState();
// getFindQuestionNum();
// getFindEqQuestionNum(true);
unitType = widget.arguments['unitType'];
String roles = widget.arguments['roles'];
var roleLists = roles.split(',');
if (roleLists.contains('主要负责人')) {
roleLists.remove('主要负责人');
}
for (var name in roleLists) {
UserData mUserData = UserData();
mUserData.roleName = name;
///使用单位
if (unitType == '1') {
if (name == '安全员') {
mUserData.roleId = '2';
}
if (name == '安全总监') {
mUserData.roleId = '1';
}
}
///生产单位
if (unitType == '2') {
if (name == '质量安全员') {
mUserData.roleId = '2';
}
if (name == '质量安全总监') {
mUserData.roleId = '1';
}
}
roleUserLists!.add(mUserData);
}
if (roleUserLists!.length == 1) {
roleId = roleUserLists![0].roleId!;
// roleName = roleUserLists![0].roleName!;
roleText!.text = roleUserLists![0].roleName!;
}
getEquipmentList();
}
......@@ -113,7 +161,7 @@ class _TestSettingPageState extends State<TestSettingPage> {
children: [
Image.asset('assets/home/rigister_bg.png'),
Container(
height: 230,
height: 280,
margin:
const EdgeInsets.only(left: 15, top: 130, right: 15, bottom: 0),
decoration: const BoxDecoration(
......@@ -174,96 +222,152 @@ class _TestSettingPageState extends State<TestSettingPage> {
}
});
}),
const SizedBox(height: 20),
// const Row(children: [
// Icon(Icons.drive_file_rename_outline_rounded,
// color: ColorConst.orangeColor, size: 15),
// Text('设置题数', style: TextStyle(fontSize: 14))
// ]),
// const SizedBox(height: 10),
// Container(
// padding:
// const EdgeInsets.only(left: 5, top: 0, right: 5, bottom: 0),
// child: Row(
const SizedBox(height: 10),
Row(children: [
const Icon(Icons.touch_app,
color: ColorConst.orangeColor, size: 15),
Text('身份${unitType == "1" ? "-(使用单位)" : "-(生产单位)"}',
style: const TextStyle(fontSize: 14))
]),
const SizedBox(height: 5),
CustomTextField(
enabled: true,
readOnly: true,
hintText: '请选择身份',
controller: roleText,
focusNode: roleFocusNode,
onTop: () {
showDialog(
context: context,
builder: (context) {
return AlertDialog(
contentPadding: EdgeInsets.all(0.0),
titlePadding: const EdgeInsets.only(
left: 20, right: 20, top: 20, bottom: 10),
title: Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
const Text('请选择您的身份'),
InkWell(
onTap: () {
Get.back();
},
child: const Icon(
Icons.clear,
size: 30,
color: Colors.grey,
),
)
],
),
content: SingleChildScrollView(
physics: const NeverScrollableScrollPhysics(),
child: Column(
children: [
buildListContent(),
Container(
height: 10,
)
],
),
),
);
});
// showDialog(
// context: context,
// builder: (context) {
// return AlertDialog(
// titlePadding: const EdgeInsets.only(
// left: 20, right: 20, top: 20, bottom: 0),
// title: Row(
// mainAxisAlignment: MainAxisAlignment.spaceBetween,
// children: [
// Row(children: [
// const Text('单选题数', style: TextStyle(fontSize: 14)),
// SizedBox(
// width: 40,
// height: 30,
// child: TextFormField(
// textAlign: TextAlign.center,
// inputFormatters: [
// FilteringTextInputFormatter.digitsOnly,
// LengthLimitingTextInputFormatter(3),
// // 设置输入长度限制
// ],
// focusNode: singleZJFocusNode,
// controller: singleText,
// onChanged: (num) {
// setState(() {
// if (mDataEq != null &&
// int.parse(num) > mDataEq!.dxNum!) {
// ToastUtils.showCenter('题库只有${mDataEq!.dxNum}道单选题');
// setState(() {
// singleText!.text = mDataEq!.dxNum.toString();
// });
// }
// allQuestions = (singleText!.text.isNotEmpty
// ? int.parse(singleText!.text)
// : 0) +
// (judgmentText!.text.isNotEmpty
// ? int.parse(judgmentText!.text)
// : 0);
// });
// const Text('请选择您的身份'),
// InkWell(
// onTap: () {
// Get.back();
// },
// child: const Icon(
// Icons.clear,
// size: 30,
// color: Colors.grey,
// ),
// )
// ]),
// Row(children: [
// const Text('判断题数', style: TextStyle(fontSize: 14)),
// SizedBox(
// width: 40,
// height: 30,
// child: TextFormField(
// textAlign: TextAlign.center,
// inputFormatters: [
// FilteringTextInputFormatter.digitsOnly,
// LengthLimitingTextInputFormatter(3),
// ],
// focusNode: judgmentZJFocusNode,
// controller: judgmentText,
// onChanged: (num) {
// ),
// content: StatefulBuilder(
// builder: (context, StateSetter setState) {
// return ListView.builder(
// shrinkWrap: true,
// itemCount: roleUserLists!.length,
// itemBuilder: (context, index) {
// return ListTile(
// title: Text(roleUserLists![index].roleName!),
// onTap: () {
// setState(() {
// if (mDataEq != null &&
// int.parse(num) > mDataEq!.pdNum!) {
// ToastUtils.showCenter('题库只有${mDataEq!.pdNum}道判断题');
// roleText!.text =
// roleUserLists![index].roleName!;
// roleId = roleUserLists![index].roleId!;
// Navigator.pop(context); // 关闭弹窗
// });
// },
// );
// },
// );
// },
// ),
// );
// },
// );
// Get.toNamed(RouteString.EQUIPMENT_LIST_PAGE, arguments: {
// 'officeId': StorageUtil.getInstance().getOfficeId()
// })?.then((map) {
// if (map != null) {
// mEquiList = map;
// setState(() {
// judgmentText!.text = mDataEq!.pdNum.toString();
// equipmentText!.text = mEquiList!.name!;
// // getFindEqQuestionNum(false);
// });
// }
// allQuestions = (judgmentText!.text.isNotEmpty
// ? int.parse(judgmentText!.text)
// : 0) +
// (singleText!.text.isNotEmpty
// ? int.parse(singleText!.text)
// : 0);
// });
// },
// ),
// )
// ]),
// Text('总题数: ${allQuestions.toString()}',
// style: const TextStyle(color: Colors.grey, fontSize: 14)),
// ],
// ),
// ),
}),
// const Tip('小提示:【安全员、安全总监】身份可进行测试练习', marginLeft: 5),
const Tip('小提示:【安全员、安全总监】可进行测试练习',
marginLeft: 5, marginTop: 5, marginRight: 10),
const SizedBox(height: 20),
],
),
);
}
Widget buildListContent() {
List<InkWell> textList = [];
for (var item in roleUserLists!) {
textList.add(InkWell(
onTap: () {
setState(() {
roleText!.text = item.roleName!;
roleId = item.roleId!;
Navigator.pop(context); // 关闭弹窗
});
},
child: Container(
width: double.infinity,
padding:
const EdgeInsets.only(left: 10, top: 10, right: 10, bottom: 10),
child: Text(item.roleName!, textAlign: TextAlign.center),
),
));
}
return Column(
mainAxisSize: MainAxisSize.min,
children: textList,
);
}
Container buildTopTitle(BuildContext context) {
return Container(
margin: const EdgeInsets.only(top: 50),
......@@ -314,7 +418,7 @@ class _TestSettingPageState extends State<TestSettingPage> {
///交卷
Container buildSubmit() {
return Container(
margin: const EdgeInsets.only(top: 40, bottom: 0),
// margin: const EdgeInsets.only(top: 10, bottom: 0),
padding: const EdgeInsets.only(left: 20, right: 20, top: 15, bottom: 0),
width: double.infinity,
decoration: const BoxDecoration(
......@@ -327,6 +431,10 @@ class _TestSettingPageState extends State<TestSettingPage> {
ToastUtils.showCenter('请选择设备类型');
return;
}
if (roleText!.text.isEmpty) {
ToastUtils.showCenter('请选择身份');
return;
}
// if (allQuestions == 0) {
// ToastUtils.showCenter('总题数不能为 0');
// return;
......@@ -338,8 +446,10 @@ class _TestSettingPageState extends State<TestSettingPage> {
// mTestSubmitBo.pdQuestionsNum = judgmentText!.text.isNotEmpty
// ? int.parse(judgmentText!.text)
// : 0;
Get.offNamed(RouteString.TEST_PAGE,
arguments: {'mTestSubmitBo': mTestSubmitBo})?.then((value) {
Get.offNamed(RouteString.TEST_PAGE, arguments: {
'mTestSubmitBo': mTestSubmitBo,
'positionType': roleId
})?.then((value) {
if (value != null && value) {}
});
},
......
......@@ -18,6 +18,7 @@ import 'package:special_equipment_flutter/utils/sp_account_utils.dart';
import 'package:special_equipment_flutter/utils/storage_util.dart';
import 'package:special_equipment_flutter/utils/toast_utils.dart';
import 'package:special_equipment_flutter/widgets/custom_button.dart';
import 'package:special_equipment_flutter/widgets/tip.dart';
import '../../dio/api.dart';
......@@ -240,7 +241,7 @@ class EditTextState extends State<EditTextWidget>
],
),
),
GestureDetector(
InkWell(
onTap: () {
// List<UserBo> userList =
// StorageUtil.getInstance().getUserList();
......@@ -248,12 +249,13 @@ class EditTextState extends State<EditTextWidget>
if (listAccount.isNotEmpty) {
showDialog(
context: context,
builder: (BuildContext context) {
builder: (context) {
return AlertDialog(
contentPadding: EdgeInsets.all(0.0),
titlePadding: const EdgeInsets.only(
left: 20,
right: 20,
top: 10,
top: 20,
bottom: 10),
title: Row(
mainAxisAlignment:
......@@ -272,56 +274,251 @@ class EditTextState extends State<EditTextWidget>
)
],
),
actions: <Widget>[
ListView.separated(
scrollDirection: Axis.vertical,
shrinkWrap: true,
itemCount: listAccount.length,
itemBuilder: (BuildContext context,
int index) {
return InkWell(
splashColor:
ColorConst.themeBgColor,
content: SingleChildScrollView(
physics:
const NeverScrollableScrollPhysics(),
child: Column(
children: [
buildListContent(),
Container(
height: 10,
)
],
),
),
);
});
// showDialog(
// context: context,
// builder: (BuildContext context) {
// return AlertDialog(
// titlePadding: const EdgeInsets.only(
// left: 20,
// right: 20,
// top: 10,
// bottom: 10),
// title: Row(
// mainAxisAlignment:
// MainAxisAlignment.spaceBetween,
// children: [
// const Text('历史登录账号、密码'),
// InkWell(
// onTap: () {
// Get.back();
// },
// child: const Icon(
// Icons.clear,
// size: 30,
// color: Colors.grey,
// ),
// )
// ],
// ),
// actions: <Widget>[
// ListView.separated(
// scrollDirection: Axis.vertical,
// shrinkWrap: true,
// itemCount: listAccount.length,
// itemBuilder: (BuildContext context,
// int index) {
// return InkWell(
// splashColor:
// ColorConst.themeBgColor,
// onTap: () {
// setState(() {
// phoneController.value =
// phoneController.value
// .copyWith(
// text: listAccount[
// index]
// .account);
// passController.value =
// passController.value
// .copyWith(
// text: listAccount[
// index]
// .password);
// Get.back();
// });
// },
// child: Padding(
// padding:
// const EdgeInsets.only(
// left: 10),
// child: Row(
// mainAxisAlignment:
// MainAxisAlignment
// .spaceBetween,
// children: [
// Row(
// children: [
// const Icon(
// Icons.person,
// size: 20,
// color: Colors.grey,
// ),
// Text(
// listAccount[index]
// .account!,
// style: const TextStyle(
// fontSize: 16,
// color: ColorConst
// .blueColor),
// ),
// ],
// ),
// InkWell(
// onTap: () {
// setState(() {
// showDialog(
// context:
// context,
// builder:
// (context) {
// return AlertDialog(
// content: Text(
// "您确定要清除【${listAccount[index].account}】这个历史纪录账号吗?"),
// actions: [
// TextButton(
// child: const Text(
// "取消"),
// onPressed:
// () {
// Navigator.of(context)
// .pop();
// },
// ),
// TextButton(
// child: const Text(
// "确定"),
// onPressed:
// () {
// ToastUtils.showCenter("已清除【${listAccount[index].account}】的历史账号");
// SPAccountUtil.delUser(listAccount[index],
// index);
// debugPrint(jsonEncode(listAccount));
// listAccount.remove(listAccount[index]);
// Get.back();
// Get.back();
// })
// ],
// );
// });
// });
// },
// child: const Padding(
// padding:
// EdgeInsets.all(
// 13.0),
// child: Icon(
// Icons.clear,
// size: 18,
// color: Colors.grey,
// ),
// ),
// )
// ],
// ),
// ),
// );
// },
// separatorBuilder:
// (BuildContext context,
// int index) {
// return Container(
// height: 1,
// color: Colors.grey[100],
// );
// },
// )
// ],
// );
// },
// );
} else {
ToastUtils.showCenter('暂无历史登录账号');
}
});
},
child: Container(
margin: const EdgeInsets.only(bottom: 3),
padding: const EdgeInsets.all(10),
child: const Text(
'历史登录账号>',
style: TextStyle(color: ColorConst.blueColor),
),
),
),
],
),
const SizedBox(height: 40), //密码和登录按钮间距
//嵌套SizedBox, 设置button的宽高
buildLogin(),
if (Platform.isIOS) ...[
if (isOpen == '1') ...[
const SizedBox(height: 15), //密码和登录按钮间距
buildRigister(),
const Tip('初次使用,请先完成单位账号注册',
marginTop: 0, width: 280),
]
] else ...[
const SizedBox(height: 15), //密码和登录按钮间距
buildRigister(),
const Tip('初次使用,请先完成单位账号注册', marginTop: 0, width: 280),
]
],
)),
const Spacer(),
const Align(
alignment: Alignment.bottomCenter,
child: Text('晋ICP备19001455号-3A',
style: TextStyle(color: Colors.grey)),
),
Align(
alignment: Alignment.bottomCenter,
child: Text('版本: $versionName',
style: const TextStyle(color: Colors.grey)),
),
const SizedBox(height: 25) //版本号底部距离
],
),
));
}
Widget buildListContent() {
List<InkWell> textList = [];
for (int index = 0; index < listAccount.length; index++) {
textList.add(InkWell(
splashColor: ColorConst.themeBgColor,
onTap: () {
setState(() {
phoneController.value =
phoneController.value
.copyWith(
text: listAccount[
index]
.account);
passController.value =
passController.value
.copyWith(
text: listAccount[
index]
.password);
phoneController.value = phoneController.value
.copyWith(text: listAccount[index].account);
passController.value = passController.value
.copyWith(text: listAccount[index].password);
Get.back();
});
},
child: Padding(
child: Container(
width: double.infinity,
padding:
const EdgeInsets.only(
left: 10),
const EdgeInsets.only(left: 20, top: 0, right: 10, bottom: 0),
child: Row(
mainAxisAlignment:
MainAxisAlignment
.spaceBetween,
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
Row(
children: [
Icon(
const Icon(
Icons.person,
size: 25,
size: 20,
color: Colors.grey,
),
Text(
listAccount[index]
.account!,
listAccount[index].account!,
style: const TextStyle(
fontSize: 16,
color: ColorConst
.blueColor),
fontSize: 16, color: ColorConst.blueColor),
),
],
),
......@@ -329,31 +526,25 @@ class EditTextState extends State<EditTextWidget>
onTap: () {
setState(() {
showDialog(
context:
context,
builder:
(context) {
context: context,
builder: (context) {
return AlertDialog(
content: Text(
"您确定要清除【${listAccount[index].account}】这个历史纪录账号吗?"),
actions: [
TextButton(
child: const Text(
"取消"),
onPressed:
() {
Navigator.of(context)
.pop();
child: const Text("取消"),
onPressed: () {
Navigator.of(context).pop();
},
),
TextButton(
child: const Text(
"确定"),
onPressed:
() {
ToastUtils.showCenter("已清除【${listAccount[index].account}】的历史账号");
SPAccountUtil.delUser(listAccount[index],
index);
child: const Text("确定"),
onPressed: () {
ToastUtils.showCenter(
"已清除【${listAccount[index].account}】的历史账号");
SPAccountUtil.delUser(
listAccount[index], index);
debugPrint(jsonEncode(listAccount));
listAccount.remove(listAccount[index]);
Get.back();
......@@ -365,9 +556,7 @@ class EditTextState extends State<EditTextWidget>
});
},
child: const Padding(
padding:
EdgeInsets.all(
13.0),
padding: EdgeInsets.all(13.0),
child: Icon(
Icons.clear,
size: 18,
......@@ -378,66 +567,13 @@ class EditTextState extends State<EditTextWidget>
],
),
),
);
},
separatorBuilder:
(BuildContext context,
int index) {
return Container(
height: 1,
color: Colors.grey[100],
);
},
)
],
);
},
);
} else {
ToastUtils.showCenter('暂无历史登录账号');
));
}
});
},
child: Container(
margin: const EdgeInsets.only(bottom: 3),
child: const Text(
'历史登录账号>',
style: TextStyle(color: ColorConst.blueColor),
),
),
),
],
),
const SizedBox(height: 40), //密码和登录按钮间距
//嵌套SizedBox, 设置button的宽高
buildLogin(),
if (Platform.isIOS) ...[
if (isOpen == '1') ...[
const SizedBox(height: 15), //密码和登录按钮间距
buildRigister()
]
] else ...[
const SizedBox(height: 15), //密码和登录按钮间距
buildRigister()
]
],
)),
const Spacer(),
const Align(
alignment: Alignment.bottomCenter,
child: Text('晋ICP备19001455号-3A',
style: TextStyle(color: Colors.grey)),
),
Align(
alignment: Alignment.bottomCenter,
child: Text('版本: $versionName',
style: const TextStyle(color: Colors.grey)),
),
const SizedBox(height: 25) //版本号底部距离
],
),
));
return Column(
mainAxisSize: MainAxisSize.min,
children: textList,
);
}
List<UserBo> listAccount = [];
......@@ -508,7 +644,7 @@ class EditTextState extends State<EditTextWidget>
Widget buildTitle() {
return const Text(
'晋特助手',
'晋特助手',
style: TextStyle(
fontSize: 25,
color: ColorConst.blueColor,
......
......@@ -40,6 +40,7 @@ import 'package:special_equipment_flutter/widgets/custom_button.dart';
import 'package:special_equipment_flutter/widgets/divider_custom.dart';
import 'package:special_equipment_flutter/widgets/easy_refresh_header1.dart';
import 'package:special_equipment_flutter/widgets/emptyI_img_widget.dart';
import 'package:special_equipment_flutter/widgets/tip.dart';
import 'package:url_launcher/url_launcher.dart';
import '../../common/color_const.dart';
......@@ -170,6 +171,7 @@ class _HomePageState extends State<HomePage>
BannerListBo mBannerListBo = value;
if (mounted) {
setState(() {
bannerList!.clear();
List<Data>? mList = mBannerListBo.data;
for (var item in mList!) {
if (item.advertisPosition == "0") {
......@@ -367,6 +369,11 @@ class _HomePageState extends State<HomePage>
header: TaurusHeaders(),
onRefresh: () async {
setState(() {
// Future.delayed(const Duration(seconds: 2), () {
// // 延迟执行的代码
// getBannerList();
// });
getBannerList();
getCount();
getDeviceData();
......@@ -975,25 +982,7 @@ class _HomePageState extends State<HomePage>
// buildTitle(Icons.equalizer, '考核练习'),
// buildSliverGridExamination()
if (name == '考核练习') ...[
Container(
alignment: Alignment.centerLeft,
margin: const EdgeInsets.only(left: 10, right: 10, top: 10),
padding: const EdgeInsets.only(
left: 5, right: 5, top: 3, bottom: 3),
decoration: BoxDecoration(
color: Colors.orange[50],
borderRadius: const BorderRadius.only(
topLeft: Radius.circular(5),
topRight: Radius.circular(5),
bottomLeft: Radius.circular(5),
bottomRight: Radius.circular(5)),
),
child: const Text(
softWrap: true,
'小提示:【安全监察人】会对各单位监督抽查【考核】.',
style: TextStyle(color: Colors.orange, fontSize: 13),
),
),
const Tip('小提示:【安全监察人】向各单位开启监督抽查【考核】'),
]
],
)));
......@@ -1656,8 +1645,10 @@ class _HomePageState extends State<HomePage>
// if (value != null && value) {}
// });
Get.toNamed(RouteString.TEST_SETTING_PAGE, arguments: {})
?.then((value) {
Get.toNamed(RouteString.TEST_SETTING_PAGE, arguments: {
'roles': roleNamesText(unitId),
'unitType': unitId
})?.then((value) {
if (value != null && value) {}
});
break;
......@@ -1886,12 +1877,16 @@ class _HomePageState extends State<HomePage>
centerTitle: true,
background: Stack(
children: [
// Image.asset('assets/home/top_bg_icon.png',
// width: MediaQuery.of(context).size.width, fit: BoxFit.fill),
if (bannerList!.isEmpty) ...[
Image.asset('assets/banner/banner0.png',
width: MediaQuery.of(context).size.width,
height: MediaQuery.of(context).size.height,
fit: BoxFit.fill)
] else ...[
CardSwiper(
bannerList: bannerList,
),
)
],
Positioned(
bottom: SizeConfig.isIpad()! ? 190 : 5,
// left: SizeConfig.isIpad()!
......
......@@ -41,7 +41,7 @@ class EquipmentPersonnelTable extends StatelessWidget {
),
child: Column(
children: [
buildTitle(Icons.compare, '设备人员对比'),
buildTitle(Icons.compare, '设备人员对比表格'),
Container(
alignment: Alignment.centerLeft,
margin: const EdgeInsets.only(left: 5, right: 5, top: 5),
......@@ -57,7 +57,7 @@ class EquipmentPersonnelTable extends StatelessWidget {
),
child: const Text(
softWrap: true,
'设备人员对比表格,是对比每个设备是否配备了相关负责人员,请在【用户设置】内配置相关负责人员.',
'小提示:对比每个设备是否配备了相关负责人员,请在【用户设置】内配置相关负责人员.',
style: TextStyle(color: Colors.orange, fontSize: 13),
),
),
......
......@@ -12,6 +12,7 @@ import 'package:special_equipment_flutter/utils/toast_utils.dart';
import 'package:special_equipment_flutter/widgets/custom_button.dart';
import 'package:special_equipment_flutter/widgets/custom_textfield.dart';
import 'package:special_equipment_flutter/widgets/divider_custom.dart';
import 'package:special_equipment_flutter/widgets/tip.dart';
///公司账号注册
class RegisterPage2 extends StatefulWidget {
......@@ -118,24 +119,11 @@ class _RegisterPage2State extends State<RegisterPage2> {
onChanged: (text) {
if (text.length >= 6) {}
}),
Container(
width: 1080,
margin: const EdgeInsets.only(left: 5, right: 5, top: 5),
padding:
const EdgeInsets.only(left: 5, right: 5, top: 3, bottom: 3),
decoration: BoxDecoration(
color: Colors.orange[50],
borderRadius: const BorderRadius.only(
topLeft: Radius.circular(5),
topRight: Radius.circular(5),
bottomLeft: Radius.circular(5),
bottomRight: Radius.circular(5)),
),
child: const Text(
softWrap: true,
const Tip(
'登录名仅支持字母+数字组合、纯字母、6-20位',
style: TextStyle(color: Colors.orange, fontSize: 12),
),
marginTop: 5,
marginLeft: 5,
marginRight: 5,
),
const SizedBox(height: 8),
......@@ -157,23 +145,11 @@ class _RegisterPage2State extends State<RegisterPage2> {
controller: passwordText,
focusNode: passwordFocusNode,
isNoChinese: true),
Container(
margin: const EdgeInsets.only(left: 5, right: 5, top: 5),
padding:
const EdgeInsets.only(left: 5, right: 5, top: 3, bottom: 3),
decoration: BoxDecoration(
color: Colors.orange[50],
borderRadius: const BorderRadius.only(
topLeft: Radius.circular(5),
topRight: Radius.circular(5),
bottomLeft: Radius.circular(5),
bottomRight: Radius.circular(5)),
),
child: const Text(
softWrap: true,
const Tip(
'密码至少包含以下 5 种类别:大写字母、小写字母、数字、特殊符号( @#*. )、8-20位',
style: TextStyle(color: Colors.orange, fontSize: 12),
),
marginTop: 5,
marginLeft: 5,
marginRight: 5,
),
const SizedBox(height: 8),
Container(
......@@ -194,6 +170,8 @@ class _RegisterPage2State extends State<RegisterPage2> {
controller: okPasswordText,
focusNode: okPasswordFocusNode,
isNoChinese: true),
const Tip('请填写简易的【登录名和密码】,避免忘记',
marginTop: 5, marginLeft: 5, marginRight: 5),
const SizedBox(height: 8),
Container(
margin: const EdgeInsets.only(left: 5, right: 5),
......
......@@ -17,6 +17,7 @@ import 'package:special_equipment_flutter/utils/toast_utils.dart';
import 'package:special_equipment_flutter/widgets/emptyI_img_widget.dart';
import 'package:special_equipment_flutter/widgets/first_refresh_widget.dart';
import 'package:special_equipment_flutter/widgets/number_to_chinese.dart';
import 'package:special_equipment_flutter/widgets/tip.dart';
import '../../../../common/color_const.dart';
import '../../../../widgets/custom_button.dart';
......@@ -142,31 +143,17 @@ class _InspectListSyPageState extends State<InspectListSyPage>
backgroundColor: Colors.grey[100],
body: Column(
children: [
Container(
alignment: Alignment.centerLeft,
margin: const EdgeInsets.only(left: 10, right: 10, top: 10),
padding:
const EdgeInsets.only(left: 5, right: 5, top: 3, bottom: 3),
decoration: BoxDecoration(
color: Colors.orange[50],
borderRadius: const BorderRadius.only(
topLeft: Radius.circular(5),
topRight: Radius.circular(5),
bottomLeft: Radius.circular(5),
bottomRight: Radius.circular(5)),
),
child: Text(
softWrap: true,
Tip(
type == '1'
? '小提示:当天新建的设备和用户,会在第二天生成【日管控】任务.'
? '小提示:当天新建的设备和用户,会在第二天生成【日管控】任务'
: type == '2'
? '小提示:【周排查】可在 每周四-周日 完成任务.'
? '小提示:周排查【每周四-周日】完成排查任务'
: type == '3'
? '小提示:【月调度】可在 每月25日-月底 完成任务.'
? '小提示:月调度【每月25日-月底】完成调度任务'
: '',
style: const TextStyle(color: Colors.orange, fontSize: 14),
),
),
marginTop: 5,
marginLeft: 10,
marginRight: 10),
Expanded(
flex: 1,
child: EasyRefresh(
......
......@@ -11,6 +11,7 @@ import 'package:special_equipment_flutter/utils/string_utils.dart';
import 'package:special_equipment_flutter/utils/toast_utils.dart';
import 'package:special_equipment_flutter/widgets/custom_button.dart';
import 'package:special_equipment_flutter/widgets/custom_textfield.dart';
import 'package:special_equipment_flutter/widgets/tip.dart';
import '../../../model/user_list.dart';
......@@ -287,6 +288,8 @@ class _UserSettingsPageState extends State<UserSettingsPage> {
controller: okPasswordText,
focusNode: okPasswordFocusNode,
isNoChinese: true),
const Tip('请填写简易的【登录名和密码】,避免忘记',
marginTop: 5, marginLeft: 5, marginRight: 5),
const SizedBox(height: 8),
const Row(children: [
Icon(Icons.drive_file_rename_outline_rounded,
......
import 'package:flutter/material.dart';
///分割线
class Tip extends StatelessWidget {
final String? text;
final double? marginTop, marginBottom, marginLeft, marginRight;
final MaterialColor? color;
final double? width;
const Tip(this.text,
{super.key,
this.width=double.infinity,
this.color = Colors.orange,
this.marginTop = 10,
this.marginBottom = 0,
this.marginLeft = 10,
this.marginRight = 10});
@override
Widget build(BuildContext context) {
return Container(
width: width!,
alignment: Alignment.centerLeft,
margin: EdgeInsets.only(
top: marginTop!,
bottom: marginBottom!,
left: marginLeft!,
right: marginRight!),
// margin: const EdgeInsets.only(left: 5, right: 10, top: 10),
padding: const EdgeInsets.only(left: 5, right: 5, top: 3, bottom: 3),
decoration: BoxDecoration(
color: Colors.orange[50],
borderRadius: const BorderRadius.all(Radius.circular(5)),
),
child: Text(
softWrap: true,
text!,
style: TextStyle(color: color!, fontSize: 13),
),
);
}
}
......@@ -138,7 +138,8 @@ flutter:
- assets/examine/no_pass_icon.png
- assets/examine/examine_gary_icon.png
- assets/examine/history_icon.png
- assets/name.pdf
- assets/banner/banner0.png
- assets/banner/banner1.png
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment