修复 网络连接的问题

添加 巡检管理首页
hmxc
张萌 4 years ago
parent 7c7d114d5c
commit b160e2a9ba

@ -4,4 +4,5 @@
to allow setting breakpoints, to provide hot reload, etc. to allow setting breakpoints, to provide hot reload, etc.
--> -->
<uses-permission android:name="android.permission.INTERNET"/> <uses-permission android:name="android.permission.INTERNET"/>
<application android:usesCleartextTraffic="true"/>
</manifest> </manifest>

@ -26,5 +26,7 @@
<!-- Don't delete the meta-data below. <!-- Don't delete the meta-data below.
This is used by the Flutter tool to generate GeneratedPluginRegistrant.java --> This is used by the Flutter tool to generate GeneratedPluginRegistrant.java -->
<meta-data android:name="flutterEmbedding" android:value="2" /> <meta-data android:name="flutterEmbedding" android:value="2" />
<meta-data android:name="io.flutter.network-policy"
android:resource="@xml/network_security_config"/>
</application> </application>
</manifest> </manifest>

@ -0,0 +1,4 @@
<?xml version="1.0" encoding="utf-8"?>
<network-security-config>
<base-config cleartextTrafficPermitted="true" />
</network-security-config>

@ -43,7 +43,7 @@
97C146FB1CF9000F007C117D /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = "<group>"; }; 97C146FB1CF9000F007C117D /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = "<group>"; };
97C146FD1CF9000F007C117D /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = "<group>"; }; 97C146FD1CF9000F007C117D /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = "<group>"; };
97C147001CF9000F007C117D /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreen.storyboard; sourceTree = "<group>"; }; 97C147001CF9000F007C117D /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreen.storyboard; sourceTree = "<group>"; };
97C147021CF9000F007C117D /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = "<group>"; }; 97C147021CF9000F007C117D /* Info-Debug.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = "Info-Debug.plist"; sourceTree = "<group>"; };
BB0EBAE2C9CD25508CE8905A /* Pods-Runner.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Runner.debug.xcconfig"; path = "Target Support Files/Pods-Runner/Pods-Runner.debug.xcconfig"; sourceTree = "<group>"; }; BB0EBAE2C9CD25508CE8905A /* Pods-Runner.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Runner.debug.xcconfig"; path = "Target Support Files/Pods-Runner/Pods-Runner.debug.xcconfig"; sourceTree = "<group>"; };
D3841BBC25E0B59A00442C11 /* 小蜜蜂智慧社区管家端.entitlements */ = {isa = PBXFileReference; lastKnownFileType = text.plist.entitlements; path = "小蜜蜂智慧社区管家端.entitlements"; sourceTree = "<group>"; }; D3841BBC25E0B59A00442C11 /* 小蜜蜂智慧社区管家端.entitlements */ = {isa = PBXFileReference; lastKnownFileType = text.plist.entitlements; path = "小蜜蜂智慧社区管家端.entitlements"; sourceTree = "<group>"; };
EAD6594E3E9D112D0B561296 /* Pods-Runner.profile.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Runner.profile.xcconfig"; path = "Target Support Files/Pods-Runner/Pods-Runner.profile.xcconfig"; sourceTree = "<group>"; }; EAD6594E3E9D112D0B561296 /* Pods-Runner.profile.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Runner.profile.xcconfig"; path = "Target Support Files/Pods-Runner/Pods-Runner.profile.xcconfig"; sourceTree = "<group>"; };
@ -117,7 +117,7 @@
97C146FA1CF9000F007C117D /* Main.storyboard */, 97C146FA1CF9000F007C117D /* Main.storyboard */,
97C146FD1CF9000F007C117D /* Assets.xcassets */, 97C146FD1CF9000F007C117D /* Assets.xcassets */,
97C146FF1CF9000F007C117D /* LaunchScreen.storyboard */, 97C146FF1CF9000F007C117D /* LaunchScreen.storyboard */,
97C147021CF9000F007C117D /* Info.plist */, 97C147021CF9000F007C117D /* Info-Debug.plist */,
1498D2321E8E86230040F4C2 /* GeneratedPluginRegistrant.h */, 1498D2321E8E86230040F4C2 /* GeneratedPluginRegistrant.h */,
1498D2331E8E89220040F4C2 /* GeneratedPluginRegistrant.m */, 1498D2331E8E89220040F4C2 /* GeneratedPluginRegistrant.m */,
74858FAE1ED2DC5600515810 /* AppDelegate.swift */, 74858FAE1ED2DC5600515810 /* AppDelegate.swift */,

@ -65,5 +65,10 @@
</array> </array>
<key>UIViewControllerBasedStatusBarAppearance</key> <key>UIViewControllerBasedStatusBarAppearance</key>
<false/> <false/>
<key>NSAppTransportSecurity</key>
<dict>
<key>NSAllowsArbitraryLoads</key>
<true/>
</dict>
</dict> </dict>
</plist> </plist>

@ -137,6 +137,9 @@ class _Manage {
///id ///id
String get goodsOutContactOwner => '/user/articleOut/contactOwner'; String get goodsOutContactOwner => '/user/articleOut/contactOwner';
///
String get inspectionList => '/user/inspection/list';
} }
class _Upload { class _Upload {

@ -0,0 +1,44 @@
class InspectionListModel {
int id;
String code;
String name;
String beginDate;
String endDate;
String actualBeginDate;
String actualEndDate;
int status;
InspectionListModel(
{this.id,
this.code,
this.name,
this.beginDate,
this.endDate,
this.actualBeginDate,
this.actualEndDate,
this.status});
InspectionListModel.fromJson(Map<String, dynamic> json) {
id = json['id'];
code = json['code'];
name = json['name'];
beginDate = json['beginDate'];
endDate = json['endDate'];
actualBeginDate = json['actualBeginDate'];
actualEndDate = json['actualEndDate'];
status = json['status'];
}
Map<String, dynamic> toJson() {
final Map<String, dynamic> data = new Map<String, dynamic>();
data['id'] = this.id;
data['code'] = this.code;
data['name'] = this.name;
data['beginDate'] = this.beginDate;
data['endDate'] = this.endDate;
data['actualBeginDate'] = this.actualBeginDate;
data['actualEndDate'] = this.actualEndDate;
data['status'] = this.status;
return data;
}
}

@ -9,6 +9,19 @@ export 'package:aku_community_manager/const/resource.dart';
// //
const kEstateName = '深圳华茂悦峰'; const kEstateName = '深圳华茂悦峰';
//
const kPrimaryColor = Color(0xFFFDCF12);
const kMinorColor = Color(0xFFFFDF5D);
const kSubColor = Color(0xFF3F8FFE);
//
///
const primaryTextColor = Color(0xFF333333);
///
const minorTextColor = Color(0xFF999999);
///
const backgroundColor = Color(0xFFF9F9F9);
class AppStyle { class AppStyle {
// //

@ -1,66 +1,94 @@
// Flutter imports: import 'package:aku_community_manager/models/manager/inspection/inspection_list_model.dart';
import 'package:flutter/material.dart';
// Package imports:
import 'package:aku_ui/common_widgets/aku_common_widgets.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart';
import 'package:get/get.dart';
import 'package:get/instance_manager.dart';
// Project imports:
import 'package:aku_community_manager/const/resource.dart';
import 'package:aku_community_manager/mock_models/manage_models/manage_model.dart';
import 'package:aku_community_manager/style/app_style.dart'; import 'package:aku_community_manager/style/app_style.dart';
import 'package:aku_community_manager/tools/widget_tool.dart'; import 'package:aku_ui/aku_ui.dart';
import 'package:aku_community_manager/ui/manage_pages/inspection_manage/inspection_manage_details_page.dart'; import 'package:common_utils/common_utils.dart';
import 'package:flutter/material.dart';
import 'package:velocity_x/velocity_x.dart';
class InspectionManageCard { class InspectionManageCard extends StatefulWidget {
final InspectionManageCardModel cardModel; final InspectionListModel cardModel;
final bool extra; final bool extra;
InspectionManageCard(this.cardModel, {this.extra = true}); InspectionManageCard({Key key, this.cardModel, this.extra = true})
: super(key: key);
Widget inspectionManageCard() { @override
_InspectionManageCardState createState() => _InspectionManageCardState();
}
class _InspectionManageCardState extends State<InspectionManageCard> {
@override
Widget build(BuildContext context) {
TextStyle _textstyle = TextStyle _textstyle =
TextStyle(color: AppStyle.minorTextColor, fontSize: 28.sp); TextStyle(color: AppStyle.minorTextColor, fontSize: 28.sp);
Map<int, String> _inspectionStatus = {
1: '待巡检',
2: '已巡检',
};
Color _inspectionColor(int status) {
switch (status) {
case 1:
return Color(0xFF4501);
break;
case 2:
return Color(0x999999);
default:
return Colors.black;
}
}
return Column( return Column(
mainAxisSize: MainAxisSize.min, mainAxisSize: MainAxisSize.min,
children: [ children: [
AkuBox.h(16), 16.w.heightBox,
AkuButton( AkuButton(
onPressed: extra onPressed: widget.extra
? () { ? () {
Get.to(InspectionManageDetailsPage( // Get.to(
cardModel: cardModel, // InspectionManageDetailsPage(
)); // widget.cardModel: widget.cardModel,
// ),
// );
} }
: () {}, : () {},
child: Container( child: Container(
alignment: Alignment.centerLeft, alignment: Alignment.centerLeft,
padding: EdgeInsets.only( padding: EdgeInsets.only(
left: 24.w, right: 24.w, bottom: extra ? 48.w : 40.w), left: 24.w, right: 24.w, bottom: widget.extra ? 48.w : 40.w),
width: double.infinity, width: double.infinity,
height: extra ? 362.w : 270.w, height: widget.extra ? 362.w : 270.w,
decoration: BoxDecoration( decoration: BoxDecoration(
borderRadius: BorderRadius.circular(8.w), borderRadius: BorderRadius.circular(8.w),
color: Color(0xFFFFFFFF)), color: Color(0xFFFFFFFF)),
child: Column(children: [ child: Column(children: [
Container( Container(
height: extra ? 93.w : 86.w, height: widget.extra ? 93.w : 86.w,
width: double.infinity, width: double.infinity,
alignment: Alignment.centerLeft, alignment: Alignment.centerLeft,
child: Text( child: Row(
cardModel.title, children: [
Text(
'1号巡检任务',
style: TextStyle( style: TextStyle(
color: AppStyle.primaryTextColor, color: AppStyle.primaryTextColor,
fontSize: extra ? 32.sp : 36.sp, fontSize: widget.extra ? 32.sp : 36.sp,
fontWeight: FontWeight.bold), fontWeight: FontWeight.bold),
)), ),
extra Spacer(),
_inspectionStatus[widget.cardModel.status]
.text
.color(_inspectionColor(widget.cardModel.status))
.bold
.size(28.sp)
.make()
],
),
),
widget.extra
? Divider( ? Divider(
height: 1.w, height: 1.w,
) )
: SizedBox(), : SizedBox(),
extra ? AkuBox.h(24) : SizedBox(), widget.extra ? 24.w.heightBox : SizedBox(),
Row( Row(
children: [ children: [
Image.asset( Image.asset(
@ -68,14 +96,14 @@ class InspectionManageCard {
width: 40.w, width: 40.w,
height: 40.w, height: 40.w,
), ),
AkuBox.w(4), 4.w.widthBox,
Text( Text(
'巡检日期', '巡检编号',
style: _textstyle, style: _textstyle,
), ),
Spacer(), Spacer(),
Text( Text(
cardModel.date, widget.cardModel.code,
style: AppStyle().primaryStyle, style: AppStyle().primaryStyle,
) )
], ],
@ -88,16 +116,19 @@ class InspectionManageCard {
width: 40.w, width: 40.w,
height: 40.w, height: 40.w,
), ),
AkuBox.w(4), 4.w.widthBox,
Text('巡检周期', style: _textstyle), Text('规定巡检时间', style: _textstyle),
Spacer(), Spacer(),
Text( Text(
cardModel.cycle, '${DateUtil.formatDateStr(widget.cardModel.beginDate, format: "yyyy-MM-dd HH:mm")}${DateUtil.formatDateStr(widget.cardModel.endDate, format: "HH:mm")}',
style: AppStyle().primaryStyle, style: AppStyle().primaryStyle,
), ),
], ],
), ),
Spacer(), Spacer(),
...widget.cardModel.actualBeginDate == null
? [SizedBox()]
: [
Row( Row(
children: [ children: [
Image.asset( Image.asset(
@ -105,20 +136,21 @@ class InspectionManageCard {
width: 40.w, width: 40.w,
height: 40.w, height: 40.w,
), ),
AkuBox.w(4), 4.w.widthBox,
Text( Text(
'巡检时间', '开始巡检时间',
style: _textstyle, style: _textstyle,
), ),
Spacer(), Spacer(),
Text( Text(
cardModel.time, '${DateUtil.formatDateStr(widget.cardModel.actualBeginDate, format: "yyyy-MM-dd HH:mm")}',
style: AppStyle().primaryStyle, style: AppStyle().primaryStyle,
), ),
], ],
), ),
extra ? Spacer() : SizedBox(), Spacer(),
extra ],
widget.cardModel.actualEndDate == null
? Row( ? Row(
children: [ children: [
Image.asset( Image.asset(
@ -126,16 +158,14 @@ class InspectionManageCard {
width: 40.w, width: 40.w,
height: 40.w, height: 40.w,
), ),
AkuBox.w(4), 4.w.widthBox,
Text( Text(
'巡检人员', '结束巡检时间',
style: _textstyle, style: _textstyle,
), ),
Spacer(), Spacer(),
Text( Text(
cardModel.persons.length > 2 '${DateUtil.formatDateStr(widget.cardModel.actualEndDate, format: "yyyy-MM-dd HH:mm")}',
? '${cardModel.persons[0]}${cardModel.persons[1]}'
: cardModel.persons[0],
style: AppStyle().primaryStyle, style: AppStyle().primaryStyle,
), ),
], ],

@ -9,7 +9,6 @@ import 'package:aku_community_manager/const/resource.dart';
import 'package:aku_community_manager/mock_models/manage_models/manage_model.dart'; import 'package:aku_community_manager/mock_models/manage_models/manage_model.dart';
import 'package:aku_community_manager/style/app_style.dart'; import 'package:aku_community_manager/style/app_style.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/manage_pages/inspection_manage/inspection_manage_card.dart';
import 'package:aku_community_manager/ui/widgets/common/aku_scaffold.dart'; import 'package:aku_community_manager/ui/widgets/common/aku_scaffold.dart';
class InspectionManageDetailsPage extends StatelessWidget { class InspectionManageDetailsPage extends StatelessWidget {
@ -22,7 +21,7 @@ class InspectionManageDetailsPage extends StatelessWidget {
title: '巡检详情', title: '巡检详情',
body: Column( body: Column(
children: [ children: [
InspectionManageCard(cardModel, extra: false).inspectionManageCard(), // InspectionManageCard(cardModel:cardModel, extra: false),
Container( Container(
width: double.infinity, width: double.infinity,
color: Color(0xFFFFFFFF), color: Color(0xFFFFFFFF),

@ -1,14 +1,16 @@
// Flutter imports: // Flutter imports:
import 'package:aku_community_manager/const/api.dart';
import 'package:aku_community_manager/models/manager/inspection/inspection_list_model.dart';
import 'package:aku_community_manager/ui/manage_pages/inspection_manage/inspection_manage_card.dart';
import 'package:aku_community_manager/ui/widgets/common/bee_list_view.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:flutter_easyrefresh/easy_refresh.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart';
import 'package:velocity_x/velocity_x.dart';
// Package imports: // Package imports:
import 'package:flutter_screenutil/flutter_screenutil.dart';
import 'package:provider/provider.dart';
// Project imports: // Project imports:
import 'package:aku_community_manager/provider/manage_provider.dart';
import 'package:aku_community_manager/style/app_style.dart';
import 'package:aku_community_manager/ui/manage_pages/inspection_manage/inspection_manage_card.dart';
import 'package:aku_community_manager/ui/widgets/common/aku_scaffold.dart'; import 'package:aku_community_manager/ui/widgets/common/aku_scaffold.dart';
class InspectionManagePage extends StatefulWidget { class InspectionManagePage extends StatefulWidget {
@ -19,17 +21,41 @@ class InspectionManagePage extends StatefulWidget {
} }
class _InspectionManagePageState extends State<InspectionManagePage> { class _InspectionManagePageState extends State<InspectionManagePage> {
EasyRefreshController _easyRefreshController;
@override
void initState() {
_easyRefreshController = EasyRefreshController();
super.initState();
}
@override
void dispose() {
_easyRefreshController?.dispose();
super.dispose();
}
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
final _inspectionManageModel =
Provider.of<InspectionManageProvider>(context);
return AkuScaffold( return AkuScaffold(
title: '巡检管理', title: '巡检管理',
body: ListView( body: BeeListView(
padding: EdgeInsets.only(left: 32.w, right: 32.w, bottom: 40.w), path: API.manage.inspectionList,
children: _inspectionManageModel.inspectionManageModels controller: _easyRefreshController,
.map((e) => InspectionManageCard(e).inspectionManageCard()) convert: (models) {
.toList(), return models.tableList
.map((e) => InspectionListModel.fromJson(e))
.toList();
},
builder: (items) {
return ListView.separated(
itemBuilder: (context, index) {
return InspectionManageCard(cardModel: items[index]);
},
separatorBuilder: (_, __) {
return 8.w.heightBox;
},
itemCount: items.length);
},
), ),
); );
} }

@ -41,7 +41,7 @@ class _SplashPageState extends State<SplashPage> {
void initState() { void initState() {
super.initState(); super.initState();
Future.delayed(Duration(milliseconds: 300), () { Future.delayed(Duration(milliseconds: 300), () {
if (mounted) PowerLogger.init(context, debug: DevUtil.isDev); if (mounted) PowerLogger.start(context, debug: DevUtil.isDev);
}); });
Future.delayed(Duration(milliseconds: 2000), () async { Future.delayed(Duration(milliseconds: 2000), () async {
await _originOp(); await _originOp();

Loading…
Cancel
Save