Commit 05716b0f by 吴春元

bug 修改

parent e6f370e1
......@@ -82,6 +82,12 @@ android {
signingConfig signingConfigs.debug
}
}
//自定义打包时apk名字
android.applicationVariants.all { variant ->
variant.outputs.all {
outputFileName = "special_equipment${variant.versionName}.apk"
}
}
}
flutter {
......
......@@ -25,11 +25,11 @@
<key>CFBundlePackageType</key>
<string>APPL</string>
<key>CFBundleShortVersionString</key>
<string>1.0.5</string>
<string>1.0.6</string>
<key>CFBundleSignature</key>
<string>????</string>
<key>CFBundleVersion</key>
<string>5</string>
<string>6</string>
<key>LSRequiresIPhoneOS</key>
<true/>
<key>NSCameraUsageDescription</key>
......
// ignore_for_file: unnecessary_brace_in_string_interps, non_constant_identifier_names
class Api {
static var IS_DEBUG = false;
static var IS_DEBUG = true;
// static String URL =
// IS_DEBUG ? "https://special.sxyztech.cn/" : "http://192.168.19.165:2212/";
static String URL =
IS_DEBUG ? "https://special.sxyztech.cn/" : "http://192.168.19.165:2212/";
///演示 ip
static String URL = "http://47.92.138.92:8009/";
// static String URL = "http://47.92.138.92:8009/";
// static String URL = "http://192.168.19.164:8087/";
......
......@@ -116,9 +116,9 @@ class _ExamResultPageState extends State<ExamResultPage> {
Text(
examResultDataBo!.score!.round().toString(),
style: TextStyle(
color: examResultDataBo!.score! < 90
? Colors.red
: Colors.green,
color: examResultDataBo!.score! >= 90
? Colors.green
: Colors.red,
fontSize: 20,
fontWeight: FontWeight.bold),
),
......
......@@ -12,6 +12,7 @@ import 'package:package_info/package_info.dart';
import 'package:special_equipment_flutter/common/edgeInsets_const.dart';
import 'package:special_equipment_flutter/common/route_string.dart';
import 'package:special_equipment_flutter/dio/http_utils.dart';
import 'package:special_equipment_flutter/model/app_is_open.dart';
import 'package:special_equipment_flutter/model/check_update.dart';
import 'package:special_equipment_flutter/model/count_bo.dart';
import 'package:special_equipment_flutter/model/echart_bo.dart';
......@@ -84,13 +85,15 @@ class _HomePageState extends State<HomePage>
OverseerHistoryListBo? mOverseerHistoryListBo = OverseerHistoryListBo();
int mOverseerHistoryCount = 0;
List<HistoryListData>? mHistoryListData = [];
String? isOpen = '0';
//声明,后面需要销毁
//声明,后面需要销毁
StreamSubscription? event;
@override
void initState() {
super.initState();
doAppIsOpen();
///获取版本
checkUpdateVersion();
......@@ -146,6 +149,20 @@ class _HomePageState extends State<HomePage>
getDeviceData();
}
///版本显示控制
void doAppIsOpen() {
if (Platform.isIOS) {
HttpUtils.doAppIsOpen(context, onSuccess: (value) {
AppIsOpen appIsOpen = value;
if (mounted) {
setState(() {
isOpen = appIsOpen.appIsOpen!;
});
}
});
}
}
///获取监察记录列表
void getOverseerHistoryList() {
HttpUtils.getPapers(context, StorageUtil.getInstance().getUserId(), 1, 10)
......@@ -327,6 +344,7 @@ class _HomePageState extends State<HomePage>
} else {
getQuestionsPerson();
}
doAppIsOpen();
});
},
child: CustomScrollView(
......@@ -386,6 +404,7 @@ class _HomePageState extends State<HomePage>
///统计
// buildSliverStatistics(context),
///监察人员
] else if (isInspectorRoles(
StorageUtil.getInstance().getRoleNames())!) ...[
......@@ -400,13 +419,22 @@ class _HomePageState extends State<HomePage>
///日管控整改、周排查整改、月调度整改布局
buildSliverRiskDayWeekMonth(),
if (!isRolesName1(StorageUtil.getInstance().getRoleNames())!) ...[
///统计
buildSliverStatistics(context)
] else ...[
if (Platform.isIOS) ...[
if (isOpen == '1') ...[
buildSliverToBoxAdapter(
'assets/examine/exam_title_icon.png', '考核练习'),
buildSliverGridExamination(),
///统计
// buildSliverStatistics(context),
]
] else ...[
buildSliverToBoxAdapter(
'assets/examine/exam_title_icon.png', '考核练习'),
buildSliverGridExamination(),
]
]
]
],
),
......
......@@ -222,8 +222,8 @@ class _OverseerHistroyDetailsPageState
),
child: Column(
children: [
buildTitleContainer(Icons.event_repeat,
ColorConst.blueColor, '考核状态', Colors.black54),
buildTitleContainer(Icons.person_pin,
ColorConst.blueColor, '考核', Colors.black54),
Container(
padding: const EdgeInsets.only(
left: 30, right: 15, top: 0, bottom: 15),
......
......@@ -34,6 +34,8 @@ class _OverseerHistoryListPageState extends State<OverseerHistoryListPage> {
List<HistoryListData>? mHistoryListData = [];
int page = 1;
bool isLastPage = true;
OverseerHistoryListBo? mOverseerHistoryListBo = OverseerHistoryListBo();
int mOverseerHistoryCount = 0;
@override
void initState() {
......@@ -45,16 +47,18 @@ class _OverseerHistoryListPageState extends State<OverseerHistoryListPage> {
void getOverseerHistoryList() {
HttpUtils.getPapers(context, StorageUtil.getInstance().getUserId(), 1, 10)
.then((value) {
OverseerHistoryListBo mOverseerHistoryListBo = value;
mOverseerHistoryListBo = value;
if (mounted) {
setState(() {
mOverseerHistoryCount = mOverseerHistoryListBo!.count!;
if (page == 1) {
mHistoryListData!.clear();
}
List<HistoryListData>? rows = mOverseerHistoryListBo.data;
List<HistoryListData>? rows = mOverseerHistoryListBo!.data;
mHistoryListData!.addAll(rows!);
int totalPage =
StringUtils.totalPage(mOverseerHistoryListBo.count, 10);
StringUtils.totalPage(mOverseerHistoryListBo!.count, 10);
print('$totalPage==== $page');
if (totalPage == page) {
isLastPage = true;
......@@ -114,6 +118,38 @@ class _OverseerHistoryListPageState extends State<OverseerHistoryListPage> {
Column buildBody() {
return Column(
children: [
Container(
width: double.infinity,
margin:
const EdgeInsets.only(left: 10, right: 10, top: 10, bottom: 0),
padding: const EdgeInsets.only(left: 10, 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.rich(
softWrap: true,
TextSpan(children: [
const TextSpan(
text: "历史监察记录共 ",
style: TextStyle(fontSize: 14, color: Colors.orange)),
TextSpan(
text: mOverseerHistoryListBo != null
? mOverseerHistoryCount.toString()
: '0',
style: const TextStyle(
fontSize: 18,
color: Colors.orange,
fontWeight: FontWeight.bold)),
const TextSpan(
text: " 条",
style: TextStyle(fontSize: 14, color: Colors.orange))
])),
),
//文章列表
ListView.separated(
shrinkWrap: true,
......@@ -137,20 +173,20 @@ class _OverseerHistoryListPageState extends State<OverseerHistoryListPage> {
InkWell buildItem(int index, BuildContext context) {
return InkWell(
onTap: () {
// Get.toNamed(RouteString.DAY_INSPECT_SUBMIT_SY,
// arguments: {'argsData': widget.args, 'listBo': list(index)})
// ?.then((value) {
// if (value != null && value) {
// getData();
// }
// });
Get.toNamed(RouteString.OVERSEER_HISTROY_DETAILS_PAGE, arguments: {
'id': mHistoryListData![index].id,
})?.then((value) {
if (value != null && value) {
getOverseerHistoryList();
}
});
},
child: Card(
elevation: 10,
shadowColor: mHistoryListData![index].incomplete != 0
? ColorConst.orangeColor
: ColorConst.greenColor,
margin: const EdgeInsets.only(left: 0, right: 0, top: 15, bottom: 0),
margin: const EdgeInsets.only(left: 0, right: 0, top: 10, bottom: 0),
shape: const RoundedRectangleBorder(
borderRadius: BorderRadius.all(Radius.circular(10)),
),
......@@ -281,8 +317,9 @@ class _OverseerHistoryListPageState extends State<OverseerHistoryListPage> {
mHistoryListData!
.removeAt(index);
//发出通知
EventBusUtils.getInstance()
?.fire("2");
// EventBusUtils.getInstance()
// ?.fire("2");
mOverseerHistoryCount--;
ToastUtils.showCenter('删除成功');
Get.back();
});
......
......@@ -312,6 +312,9 @@ class _OverseerSettingsState extends State<OverseerSettingsPage> {
controller: singleZJText,
onChanged: (num) {
setState(() {
if (num.isEmpty) {
num = '0';
}
if (mDataEq != null &&
int.parse(num) > mDataEq!.dxNum!) {
ToastUtils.showCenter(
......@@ -347,6 +350,9 @@ class _OverseerSettingsState extends State<OverseerSettingsPage> {
controller: judgmentZJText,
onChanged: (num) {
setState(() {
if (num.isEmpty) {
num = '0';
}
if (mDataEq != null &&
int.parse(num) > mDataEq!.pdNum!) {
ToastUtils.showCenter(
......@@ -429,6 +435,9 @@ class _OverseerSettingsState extends State<OverseerSettingsPage> {
controller: singleAQYText,
onChanged: (num) {
setState(() {
if (num.isEmpty) {
num = '0';
}
if (mDataEq != null &&
int.parse(num) > mDataEq!.dxNum!) {
ToastUtils.showCenter(
......@@ -464,6 +473,9 @@ class _OverseerSettingsState extends State<OverseerSettingsPage> {
controller: judgmentAQYText,
onChanged: (num) {
setState(() {
if (num.isEmpty) {
num = '0';
}
if (mDataEq != null &&
int.parse(num) > mDataEq!.pdNum!) {
ToastUtils.showCenter(
......@@ -820,15 +832,19 @@ class _OverseerSettingsState extends State<OverseerSettingsPage> {
}
bool isSafety = false;
bool isSafety1 = false;
bool isSafety2 = false;
for (var i = 0; i < userSafetyDirectorList!.length; i++) {
if (userSafetyDirectorList![i].isChecked!) {
isSafety = true;
isSafety1 = true;
}
}
for (var i = 0; i < userSafetyOfficerList!.length; i++) {
if (userSafetyOfficerList![i].isChecked!) {
isSafety = true;
isSafety2 = true;
}
}
......@@ -837,10 +853,18 @@ class _OverseerSettingsState extends State<OverseerSettingsPage> {
return;
}
if (allZJ == 0 && allAQY == 0) {
ToastUtils.showCenter('总题数不能为 0');
if (isSafety1) {
if (allZJ == 0) {
ToastUtils.showCenter('【安全总监】总题数不能为 0');
return;
}
}
if (isSafety2) {
if (allAQY == 0) {
ToastUtils.showCenter('【安全员】总题数不能为 0');
return;
}
}
Get.dialog(AlertDialog(
title: const Text("温馨提示"),
......
......@@ -171,7 +171,7 @@ class _RegisterPage2State extends State<RegisterPage2> {
),
child: const Text(
softWrap: true,
'密码至少包含以下 3 种类别:大写字母、小写字母、数字、特殊符号、8-20位',
'密码至少包含以下 3 种类别:大写字母、小写字母、数字、特殊符号( @#*. )、8-20位',
style: TextStyle(color: Colors.orange, fontSize: 12),
),
),
......@@ -470,7 +470,7 @@ class _RegisterPage2State extends State<RegisterPage2> {
if (!StringUtils.isValidPassword(passwordText!.text)) {
passwordFocusNode!.requestFocus();
ToastUtils.showCenter('密码至少包含以下 3 种类别:大写字母、小写字母、数字、特殊符号、8-20位');
ToastUtils.showCenter('密码至少包含以下 3 种类别:大写字母、小写字母、数字、特殊符号(@#*.)、8-20位');
return;
}
......
......@@ -261,7 +261,7 @@ class _UserSettingsPageState extends State<UserSettingsPage> {
),
child: const Text(
softWrap: true,
'密码至少包含以下 3 种类别:大写字母、小写字母、数字、特殊符号、8-20位',
'密码至少包含以下 3 种类别:大写字母、小写字母、数字、特殊符号( @#*. )、8-20位',
style: TextStyle(color: Colors.orange, fontSize: 12),
),
),
......@@ -1058,7 +1058,7 @@ class _UserSettingsPageState extends State<UserSettingsPage> {
if (!StringUtils.isValidPassword(passwordText!.text)) {
passwordFocusNode!.requestFocus();
ToastUtils.showCenter(
'密码至少包含以下 3 种类别:大写字母、小写字母、数字、特殊符号、8-20位');
'密码至少包含以下 3 种类别:大写字母、小写字母、数字、特殊符号(@#*.)、8-20位');
return;
}
if (okPasswordText!.text.isEmpty) {
......@@ -1075,7 +1075,7 @@ class _UserSettingsPageState extends State<UserSettingsPage> {
if (!StringUtils.isValidPassword(passwordText!.text)) {
passwordFocusNode!.requestFocus();
ToastUtils.showCenter(
'密码至少包含以下 3 种类别:大写字母、小写字母、数字、特殊符号、8-20位');
'密码至少包含以下 3 种类别:大写字母、小写字母、数字、特殊符号(@#*.)、8-20位');
return;
}
if (okPasswordText!.text.isEmpty) {
......
......@@ -16,7 +16,7 @@ publish_to: 'none' # Remove this line if you wish to publish to pub.dev
# https://developer.apple.com/library/archive/documentation/General/Reference/InfoPlistKeyReference/Articles/CoreFoundationKeys.html
# In Windows, build-name is used as the major, minor, and patch parts
# of the product and file versions while build-number is used as the build suffix.
version: 1.0.5+5
version: 1.0.6+6
environment:
sdk: '>=3.1.3 <4.0.0'
......
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