fix some issues

hmxc
张萌 3 years ago
parent f9acb4e8d6
commit 29350221f6

@ -1,26 +1,24 @@
// Flutter imports: // Flutter imports:
import 'package:aku_community_manager/const/api.dart'; import 'package:aku_community_manager/const/api.dart';
// Project imports:
import 'package:aku_community_manager/const/resource.dart';
import 'package:aku_community_manager/provider/message_provider.dart'; import 'package:aku_community_manager/provider/message_provider.dart';
import 'package:aku_community_manager/style/app_style.dart';
import 'package:aku_community_manager/ui/home/messages/comment_message.dart';
import 'package:aku_community_manager/ui/home/messages/system/system_message.dart';
import 'package:aku_community_manager/ui/widgets/common/aku_button.dart'; import 'package:aku_community_manager/ui/widgets/common/aku_button.dart';
import 'package:aku_community_manager/ui/widgets/common/aku_scaffold.dart';
import 'package:aku_community_manager/utils/network/base_model.dart'; import 'package:aku_community_manager/utils/network/base_model.dart';
import 'package:aku_community_manager/utils/network/net_util.dart'; import 'package:aku_community_manager/utils/network/net_util.dart';
import 'package:flutter/material.dart';
// Package imports: // Package imports:
import 'package:dio/dio.dart'; import 'package:dio/dio.dart';
import 'package:flutter/material.dart';
import 'package:flutter_easyrefresh/easy_refresh.dart'; import 'package:flutter_easyrefresh/easy_refresh.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart'; import 'package:flutter_screenutil/flutter_screenutil.dart';
import 'package:get/get.dart' hide Response; import 'package:get/get.dart' hide Response;
import 'package:get/instance_manager.dart'; import 'package:get/instance_manager.dart';
import 'package:provider/provider.dart'; import 'package:provider/provider.dart';
// Project imports:
import 'package:aku_community_manager/const/resource.dart';
import 'package:aku_community_manager/style/app_style.dart';
import 'package:aku_community_manager/ui/home/messages/comment_message.dart';
import 'package:aku_community_manager/ui/home/messages/system/system_message.dart';
import 'package:aku_community_manager/ui/widgets/common/aku_scaffold.dart';
class Message extends StatefulWidget { class Message extends StatefulWidget {
Message({Key? key}) : super(key: key); Message({Key? key}) : super(key: key);
@ -30,6 +28,7 @@ class Message extends StatefulWidget {
class _MessageState extends State<Message> { class _MessageState extends State<Message> {
EasyRefreshController _refreshController = EasyRefreshController(); EasyRefreshController _refreshController = EasyRefreshController();
Widget _messageTypeImage(String type) { Widget _messageTypeImage(String type) {
late String path; late String path;
Color? ca; Color? ca;
@ -156,7 +155,9 @@ class _MessageState extends State<Message> {
messageProvider.sysDate, messageProvider.sysDate,
_messageTypeImage('系统消息'), _messageTypeImage('系统消息'),
'系统消息', '系统消息',
'你有一条新的${messageProvider.sysMesTypeString}待处理', messageProvider.sysMessage == 0
? '暂无新的系统消息'
: '你有一条新的${messageProvider.sysMesTypeString}待处理',
messageProvider.sysMessage, messageProvider.sysMessage,
onpressed: () async { onpressed: () async {
BaseModel baseModel = BaseModel baseModel =
@ -174,7 +175,7 @@ class _MessageState extends State<Message> {
messageProvider.commentDate, messageProvider.commentDate,
_messageTypeImage('评论消息'), _messageTypeImage('评论消息'),
'评论消息', '评论消息',
'你有一条新的评论回复', messageProvider.commentMessage == 0 ? '暂无新的评论消息' : '你有一条新的评论回复',
messageProvider.commentMessage, messageProvider.commentMessage,
onpressed: () async { onpressed: () async {
BaseModel baseModel = BaseModel baseModel =

@ -1,18 +1,6 @@
// Dart imports: // Dart imports:
import 'dart:async'; import 'dart:async';
// Flutter imports:
import 'package:aku_community_manager/ui/login/login_page.dart';
import 'package:aku_community_manager/ui/widgets/common/aku_material_button.dart';
import 'package:flutter/material.dart';
import 'package:bot_toast/bot_toast.dart';
import 'package:dio/dio.dart';
import 'package:get/get.dart' hide Response;
import 'package:pin_input_text_field/pin_input_text_field.dart';
import 'package:power_logger/power_logger.dart';
import 'package:provider/provider.dart';
// Project imports: // Project imports:
import 'package:aku_community_manager/const/api.dart'; import 'package:aku_community_manager/const/api.dart';
import 'package:aku_community_manager/provider/user_provider.dart'; import 'package:aku_community_manager/provider/user_provider.dart';
@ -20,9 +8,19 @@ import 'package:aku_community_manager/style/app_style.dart';
import 'package:aku_community_manager/tools/screen_tool.dart'; import 'package:aku_community_manager/tools/screen_tool.dart';
import 'package:aku_community_manager/tools/widget_tool.dart'; import 'package:aku_community_manager/tools/widget_tool.dart';
import 'package:aku_community_manager/ui/home/home_page.dart'; import 'package:aku_community_manager/ui/home/home_page.dart';
// Flutter imports:
import 'package:aku_community_manager/ui/login/login_page.dart';
import 'package:aku_community_manager/ui/widgets/common/aku_back_button.dart'; import 'package:aku_community_manager/ui/widgets/common/aku_back_button.dart';
import 'package:aku_community_manager/ui/widgets/common/aku_material_button.dart';
import 'package:aku_community_manager/ui/widgets/common/aku_scaffold.dart'; import 'package:aku_community_manager/ui/widgets/common/aku_scaffold.dart';
import 'package:aku_community_manager/utils/network/net_util.dart'; import 'package:aku_community_manager/utils/network/net_util.dart';
import 'package:bot_toast/bot_toast.dart';
import 'package:dio/dio.dart';
import 'package:flutter/material.dart';
import 'package:get/get.dart' hide Response;
import 'package:pin_input_text_field/pin_input_text_field.dart';
import 'package:power_logger/power_logger.dart';
import 'package:provider/provider.dart';
class LoginSMSPage extends StatefulWidget { class LoginSMSPage extends StatefulWidget {
final String phone; final String phone;
@ -129,7 +127,7 @@ class _LoginSMSPageState extends State<LoginSMSPage> {
if (response.data['status'] == true) { if (response.data['status'] == true) {
await userProvider.setLogin(response.data['token']); await userProvider.setLogin(response.data['token']);
cancel(); cancel();
Get.offAll(HomePage()); Get.offAll(() => HomePage());
} else { } else {
_textEditingController.clear(); _textEditingController.clear();
cancel(); cancel();

@ -1,27 +1,29 @@
// Flutter imports: // Flutter imports:
import 'package:aku_community_manager/models/manager/facilities/facilities_check_list_model.dart'; import 'package:aku_community_manager/models/manager/facilities/facilities_check_list_model.dart';
// Project imports:
import 'package:aku_community_manager/style/app_style.dart';
import 'package:aku_community_manager/tools/aku_divider.dart';
import 'package:aku_community_manager/ui/manage_pages/facilities/facilities_inspect_report_page.dart'; import 'package:aku_community_manager/ui/manage_pages/facilities/facilities_inspect_report_page.dart';
import 'package:aku_community_manager/ui/manage_pages/facilities/facilities_map.dart'; import 'package:aku_community_manager/ui/manage_pages/facilities/facilities_map.dart';
import 'package:aku_community_manager/ui/widgets/common/aku_material_button.dart'; import 'package:aku_community_manager/ui/widgets/common/aku_material_button.dart';
import 'package:common_utils/common_utils.dart'; import 'package:common_utils/common_utils.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
// Package imports: // Package imports:
import 'package:flutter_screenutil/flutter_screenutil.dart'; import 'package:flutter_screenutil/flutter_screenutil.dart';
import 'package:get/get.dart'; import 'package:get/get.dart';
import 'package:velocity_x/velocity_x.dart'; import 'package:velocity_x/velocity_x.dart';
// Project imports:
import 'package:aku_community_manager/style/app_style.dart';
import 'package:aku_community_manager/tools/aku_divider.dart';
class FacilitiesCard extends StatefulWidget { class FacilitiesCard extends StatefulWidget {
final int index; final int index;
final int facilitiesType; final int facilitiesType;
final FacilitiesCheckListModel model; final FacilitiesCheckListModel model;
final VoidCallback? callRefresh; final VoidCallback? callRefresh;
FacilitiesCard( FacilitiesCard(
{Key? key, required this.index, required this.model, required this.facilitiesType, this.callRefresh}) {Key? key,
required this.index,
required this.model,
required this.facilitiesType,
this.callRefresh})
: super(key: key); : super(key: key);
@override @override
@ -123,13 +125,14 @@ class _FacilitiesCardState extends State<FacilitiesCard> {
_buildTile( _buildTile(
R.ASSETS_MANAGE_CLOCK_PNG, R.ASSETS_MANAGE_CLOCK_PNG,
'检查提交时间', '检查提交时间',
DateUtil.formatDateStr(widget.model.checkDate!, DateUtil.formatDateStr(widget.model.checkDate ?? '',
format: 'yyyy-MM-dd HH:mm')), format: 'yyyy-MM-dd HH:mm')),
]; ];
case 2: case 2:
return [ return [
15.w.heightBox, 15.w.heightBox,
_buildTile(R.ASSETS_MANAGE_CLOCK_PNG, '未完成原因', widget.model.detail!, _buildTile(
R.ASSETS_MANAGE_CLOCK_PNG, '未完成原因', widget.model.detail ?? '',
color: Colors.red), color: Colors.red),
15.w.heightBox, 15.w.heightBox,
_buildTile(R.ASSETS_MANAGE_CLOCK_PNG, '规定任务时间', _buildTile(R.ASSETS_MANAGE_CLOCK_PNG, '规定任务时间',

@ -4,12 +4,12 @@ import 'package:flutter/material.dart';
///map ///map
class FacilitiesMap { class FacilitiesMap {
/// ///
static Map<int, String> inspectStatus = {1: '待检查', 2: '未完成', 3: '已检查'}; static Map<int, String> inspectStatus = {1: '待检查', 3: '未完成', 2: '已完成'};
/// ///
static Map<int, Color> insepectColor = { static Map<int, Color> insepectColor = {
1: Color(0xFFF49F02), 1: Color(0xFFF49F02),
2: Color(0xFF666666), 2: Color(0xFF999999),
3: Color(0xFF999999) 3: Color(0xFF666666)
}; };
} }

@ -91,7 +91,7 @@ class _SettingsPageState extends State<SettingsPage> {
color: AppStyle.primaryColor, color: AppStyle.primaryColor,
onPressed: () { onPressed: () {
userProvider.logout(); userProvider.logout();
Get.offAll(HomePage()); Get.offAll(() => HomePage());
}, },
child: Text( child: Text(
'退出登录', '退出登录',

@ -1,13 +1,6 @@
// Dart imports: // Dart imports:
import 'dart:io'; import 'dart:io';
// Package imports:
import 'package:bot_toast/bot_toast.dart';
import 'package:dio/dio.dart';
import 'package:get/get.dart' hide Response, FormData, MultipartFile;
import 'package:power_logger/power_logger.dart';
import 'package:provider/provider.dart';
// Project imports: // Project imports:
import 'package:aku_community_manager/const/api.dart'; import 'package:aku_community_manager/const/api.dart';
import 'package:aku_community_manager/provider/user_provider.dart'; import 'package:aku_community_manager/provider/user_provider.dart';
@ -15,6 +8,12 @@ import 'package:aku_community_manager/ui/login/login_page.dart';
import 'package:aku_community_manager/utils/network/base_file_model.dart'; import 'package:aku_community_manager/utils/network/base_file_model.dart';
import 'package:aku_community_manager/utils/network/base_list_model.dart'; import 'package:aku_community_manager/utils/network/base_list_model.dart';
import 'package:aku_community_manager/utils/network/base_model.dart'; import 'package:aku_community_manager/utils/network/base_model.dart';
// Package imports:
import 'package:bot_toast/bot_toast.dart';
import 'package:dio/dio.dart';
import 'package:get/get.dart' hide Response, FormData, MultipartFile;
import 'package:power_logger/power_logger.dart';
import 'package:provider/provider.dart';
class NetUtil { class NetUtil {
Dio? _dio; Dio? _dio;
@ -142,7 +141,7 @@ class NetUtil {
} else { } else {
for (var item in files) { for (var item in files) {
BaseFileModel model = await NetUtil().upload(api, item); BaseFileModel model = await NetUtil().upload(api, item);
urls.add(model.url??''); urls.add(model.url ?? '');
} }
} }
@ -176,7 +175,7 @@ class NetUtil {
final userProvider = Provider.of<UserProvider>(Get.context!, listen: false); final userProvider = Provider.of<UserProvider>(Get.context!, listen: false);
if (!model.status! && model.message == '登录失效,请登录' && userProvider.isLogin) { if (!model.status! && model.message == '登录失效,请登录' && userProvider.isLogin) {
userProvider.logout(); userProvider.logout();
Get.offAll(LoginPage()); Get.offAll(() => LoginPage());
} }
if (!model.status! || showMessage) { if (!model.status! || showMessage) {
BotToast.showText(text: model.message!); BotToast.showText(text: model.message!);

Loading…
Cancel
Save