diff --git a/lib/main.dart b/lib/main.dart index ffaba28..606e03c 100644 --- a/lib/main.dart +++ b/lib/main.dart @@ -1,4 +1,5 @@ // Flutter imports: +import 'package:aku_community_manager/style/apptheme.dart'; import 'package:aku_community_manager/utils/dev_util.dart'; import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; @@ -81,6 +82,7 @@ class MyApp extends StatelessWidget { builder: () { return GetMaterialApp( title: '小蜜蜂管家', + theme: AppTheme.themeData, home: SplashPage(), builder: BotToastInit(), navigatorObservers: [ diff --git a/lib/models/manager/inspection/inspection_point_submit_model.dart b/lib/models/manager/inspection/inspection_point_submit_model.dart index 2c9a831..5c2627c 100644 --- a/lib/models/manager/inspection/inspection_point_submit_model.dart +++ b/lib/models/manager/inspection/inspection_point_submit_model.dart @@ -5,13 +5,20 @@ class InspectionPointSubmitModel { List executeCheckList; File inspectionFaceImg; File inspectionSpaceImg; - String inspectionFaceImgPath; - String inspectionSpaceImgPath; + List inspectionFaceImgPath; + List inspectionSpaceImgPath; InspectionPointSubmitModel(this.executePointId, this.executeCheckList, {this.inspectionFaceImg, this.inspectionSpaceImg, this.inspectionFaceImgPath, this.inspectionSpaceImgPath}); + // Map executeCheckListToJson() { + // final Map + // if (this.executeCheckList != null) { + // this.executeCheckList.map((e) => e.toJson()).toList(); + // return + // } else {} + // } } class ExecuteCheckList { @@ -19,4 +26,13 @@ class ExecuteCheckList { int status; String remarks; ExecuteCheckList(this.id, this.status, this.remarks); + + Map toJson() { + final Map data = { + "id": this.id, + "status": this.status, + "remarks": this.remarks, + }; + return data; + } } diff --git a/lib/style/apptheme.dart b/lib/style/apptheme.dart new file mode 100644 index 0000000..d96b50f --- /dev/null +++ b/lib/style/apptheme.dart @@ -0,0 +1,109 @@ +import 'package:flutter/material.dart'; +import 'package:flutter_screenutil/flutter_screenutil.dart'; + +class AppTheme { + static ThemeData get themeData { + return ThemeData(primarySwatch: Colors.blue).copyWith( + primaryColor: Color(0xFFFFD000), + accentColor: Color(0xFFFFD000), + textTheme: TextTheme().copyWith( + headline3: TextStyle( + fontSize: 40.sp, + color: Color(0xFF333333), + fontWeight: FontWeight.bold, + ), + subtitle1: TextStyle( + fontSize: 32.sp, + color: Color(0xFF333333), + ), + subtitle2: TextStyle( + fontSize: 28.sp, + color: Color(0xFF333333), + ), + bodyText1: TextStyle( + fontSize: 24.sp, + color: Color(0xFF333333), + ), + ), + floatingActionButtonTheme: FloatingActionButtonThemeData().copyWith( + backgroundColor: Color(0xFFFFD000), + ), + appBarTheme: AppBarTheme( + elevation: 0, + centerTitle: true, + brightness: Brightness.light, + textTheme: TextTheme( + headline6: TextStyle( + color: Color(0xFF333333), + fontSize: 36.sp, + fontWeight: FontWeight.bold, + ), + ), + ), + tabBarTheme: TabBarTheme( + labelColor: Color(0xFF333333), + labelStyle: TextStyle( + fontSize: 28.sp, + fontWeight: FontWeight.w600, + ), + unselectedLabelStyle: TextStyle( + fontSize: 28.sp, + ), + indicatorSize: TabBarIndicatorSize.label, + ), + bottomNavigationBarTheme: BottomNavigationBarThemeData( + selectedItemColor: Color(0xFF333333), + selectedLabelStyle: TextStyle( + fontWeight: FontWeight.bold, + ), + type: BottomNavigationBarType.fixed, + unselectedLabelStyle: TextStyle(), + ), + radioTheme: RadioThemeData( + fillColor: MaterialStateProperty.resolveWith((states) { + if (states.contains(MaterialState.selected)) return Color(0xFFFFD000); + return null; + }), + ), + elevatedButtonTheme: ElevatedButtonThemeData( + style: ButtonStyle( + backgroundColor: MaterialStateProperty.resolveWith((states) { + if (states.contains(MaterialState.disabled)) + return Color(0xFFFFF4D7); + return Color(0xFFFFD000); + }), + elevation: MaterialStateProperty.all(0), + foregroundColor: MaterialStateProperty.resolveWith((states) { + if (states.contains(MaterialState.disabled)) + return Color(0xFF666666); + return Color(0xFF333333); + }), + textStyle: MaterialStateProperty.all(TextStyle( + fontSize: 32.sp, + fontWeight: FontWeight.bold, + )), + padding: MaterialStateProperty.all( + EdgeInsets.symmetric(horizontal: 76.w, vertical: 22.w), + ), + enableFeedback: true, + ), + ), + textButtonTheme: TextButtonThemeData( + style: ButtonStyle( + overlayColor: MaterialStateProperty.resolveWith((states) { + if (states.contains(MaterialState.disabled)) + return Color(0xFFFFF4D7); + return Color(0xFFFFD000).withOpacity(0.2); + }), + foregroundColor: MaterialStateProperty.resolveWith((states) { + if (states.contains(MaterialState.disabled)) + return Color(0xFF666666); + return Color(0xFF333333); + }), + ), + ), + materialTapTargetSize: MaterialTapTargetSize.shrinkWrap, + dividerColor: Color(0xFFE8E8E8), + ); + } +} diff --git a/lib/ui/manage_pages/inspection_manage/inspection_point_input_page.dart b/lib/ui/manage_pages/inspection_manage/inspection_point_input_page.dart index bba4a11..bda4e8a 100644 --- a/lib/ui/manage_pages/inspection_manage/inspection_point_input_page.dart +++ b/lib/ui/manage_pages/inspection_manage/inspection_point_input_page.dart @@ -7,7 +7,6 @@ import 'package:aku_community_manager/ui/widgets/app_widgets/aku_pick_image_widg import 'package:aku_community_manager/ui/widgets/app_widgets/aku_single_check_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/net_util.dart'; import 'package:aku_ui/aku_ui.dart'; import 'package:bot_toast/bot_toast.dart'; import 'package:flutter/material.dart'; @@ -80,10 +79,13 @@ class _InspectionPointInputPageState extends State { bottom: AkuButton( onPressed: canSubmit ? () async { - _submitModel.inspectionFaceImgPath = - await ManageFunc.uploadFace(_submitModel.inspectionFaceImg); - _submitModel.inspectionSpaceImg = await ManageFunc.uploadSpace( - _submitModel.inspectionSpaceImg); + _submitModel.inspectionFaceImgPath.add( + await ManageFunc.uploadFace( + _submitModel.inspectionFaceImg)); + + _submitModel.inspectionSpaceImgPath.add( + await ManageFunc.uploadSpace( + _submitModel.inspectionSpaceImg)); BaseModel baseModel = await ManageFunc.getSubmitPoint(_submitModel); if (baseModel.status) { diff --git a/lib/ui/sub_pages/manage_func.dart b/lib/ui/sub_pages/manage_func.dart index 1608fc6..dfc5a76 100644 --- a/lib/ui/sub_pages/manage_func.dart +++ b/lib/ui/sub_pages/manage_func.dart @@ -74,9 +74,9 @@ class ManageFunc { BaseModel baseModel = await NetUtil().post(API.manage.submitPointDetail, params: { "executePointId": model.executePointId, - "executeCheckList": model.executeCheckList, - "inspectionFaceImg": [], - "inspectionSpaceImg": [] + // "executeCheckList": ExecuteCheckList(id, status, remarks).toJson(), + "inspectionFaceImg": model.inspectionFaceImgPath, + "inspectionSpaceImg": model.inspectionSpaceImgPath }); return baseModel;