* 'master' of 192.168.2.201:laiiihz/akuCommunity: update router update base style rewrite fixed submit page add bee map tool update home grid button add fixed submit pagehmxc
commit
77c41ac248
@ -0,0 +1,127 @@
|
|||||||
|
import 'package:akuCommunity/base/base_style.dart';
|
||||||
|
import 'package:akuCommunity/pages/things_page/widget/image_grid.dart';
|
||||||
|
import 'package:akuCommunity/utils/bee_map.dart';
|
||||||
|
import 'package:akuCommunity/widget/bee_scaffold.dart';
|
||||||
|
import 'package:flutter/material.dart';
|
||||||
|
import 'package:flutter_screenutil/flutter_screenutil.dart';
|
||||||
|
import 'package:velocity_x/velocity_x.dart';
|
||||||
|
import 'package:akuCommunity/extensions/num_ext.dart';
|
||||||
|
import 'package:akuCommunity/extensions/widget_list_ext.dart';
|
||||||
|
|
||||||
|
class FixedSubmitPage extends StatefulWidget {
|
||||||
|
FixedSubmitPage({Key key}) : super(key: key);
|
||||||
|
|
||||||
|
@override
|
||||||
|
_FixedSubmitPageState createState() => _FixedSubmitPageState();
|
||||||
|
}
|
||||||
|
|
||||||
|
class FixedSubmitMode {
|
||||||
|
int tag;
|
||||||
|
int state;
|
||||||
|
String text;
|
||||||
|
List<String> images;
|
||||||
|
FixedSubmitMode(this.tag, this.state, this.text, this.images);
|
||||||
|
}
|
||||||
|
|
||||||
|
class _FixedSubmitPageState extends State<FixedSubmitPage> {
|
||||||
|
List<FixedSubmitMode> _model = [
|
||||||
|
FixedSubmitMode(1, 0, '家里的冰箱坏了,师傅赶紧来看看', <String>[
|
||||||
|
'https://ss1.bdstatic.com/70cFuXSh_Q1YnxGkpoWK1HF6hhy/it/u=466219337,2269488732&fm=15&gp=0.jpg',
|
||||||
|
'https://ss1.bdstatic.com/70cFvXSh_Q1YnxGkpoWK1HF6hhy/it/u=907707978,1526051881&fm=26&gp=0.jpg',
|
||||||
|
]),
|
||||||
|
FixedSubmitMode(0, 3, '我觉得我们小区的绿化可以再多一点', <String>[
|
||||||
|
'https://dss2.bdstatic.com/70cFvnSh_Q1YnxGkpoWK1HF6hhy/it/u=111636878,534819054&fm=26&gp=0.jpg',
|
||||||
|
'https://dss2.bdstatic.com/70cFvnSh_Q1YnxGkpoWK1HF6hhy/it/u=3834533673,769780989&fm=26&gp=0.jpg',
|
||||||
|
'https://dss1.bdstatic.com/70cFuXSh_Q1YnxGkpoWK1HF6hhy/it/u=1683501076,3787404077&fm=26&gp=0.jpg',
|
||||||
|
'https://dss0.bdstatic.com/70cFuHSh_Q1YnxGkpoWK1HF6hhy/it/u=1040644610,2290865162&fm=26&gp=0.jpg',
|
||||||
|
]),
|
||||||
|
];
|
||||||
|
Color _getColor(int state) {
|
||||||
|
switch (state) {
|
||||||
|
case 0:
|
||||||
|
case 1:
|
||||||
|
return kDarkPrimaryColor;
|
||||||
|
case 2:
|
||||||
|
case 3:
|
||||||
|
case 4:
|
||||||
|
return ktextSubColor;
|
||||||
|
default:
|
||||||
|
return kPrimaryColor;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
Widget _buildCard(int fixedTag, int state, String text, List<String> images) {
|
||||||
|
return Container(
|
||||||
|
decoration: BoxDecoration(
|
||||||
|
color: kForeGroundColor, borderRadius: BorderRadius.circular(8.w)),
|
||||||
|
padding: EdgeInsets.symmetric(horizontal: 24.w, vertical: 24.w),
|
||||||
|
child: Column(
|
||||||
|
crossAxisAlignment: CrossAxisAlignment.start,
|
||||||
|
children: [
|
||||||
|
Row(
|
||||||
|
children: [
|
||||||
|
BeeMap()
|
||||||
|
.fixTag[fixedTag]
|
||||||
|
.text
|
||||||
|
.color(ktextPrimary)
|
||||||
|
.bold
|
||||||
|
.size(32.sp)
|
||||||
|
.make(),
|
||||||
|
Spacer(),
|
||||||
|
BeeMap()
|
||||||
|
.fixState[state]
|
||||||
|
.text
|
||||||
|
.color(_getColor(state))
|
||||||
|
.size(24.sp)
|
||||||
|
.make(),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
24.hb,
|
||||||
|
Divider(
|
||||||
|
thickness: 1.w,
|
||||||
|
height: 0,
|
||||||
|
),
|
||||||
|
24.hb,
|
||||||
|
text.text.color(ktextSubColor).size(28.sp).ellipsis.make(),
|
||||||
|
16.hb,
|
||||||
|
images.length != 0 ? ImageGrid(images) : SizedBox(),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
@override
|
||||||
|
Widget build(BuildContext context) {
|
||||||
|
return BeeScaffold(
|
||||||
|
title: '报事报修',
|
||||||
|
body: Column(
|
||||||
|
children: [
|
||||||
|
Expanded(
|
||||||
|
child: ListView(
|
||||||
|
padding: EdgeInsets.all(32.w),
|
||||||
|
children: [
|
||||||
|
..._model
|
||||||
|
.map((e) => _buildCard(e.tag, e.state, e.text, e.images))
|
||||||
|
.toList()
|
||||||
|
].sepWidget(separate: 24.hb),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
Padding(
|
||||||
|
padding:
|
||||||
|
EdgeInsets.only(bottom: MediaQuery.of(context).padding.bottom),
|
||||||
|
child: MaterialButton(
|
||||||
|
color: kPrimaryColor,
|
||||||
|
onPressed: () {},
|
||||||
|
child: '新增'.text.bold.color(ktextPrimary).size(32.sp).make(),
|
||||||
|
minWidth: double.infinity,
|
||||||
|
height: 98.w,
|
||||||
|
elevation: 0,
|
||||||
|
materialTapTargetSize: MaterialTapTargetSize.shrinkWrap,
|
||||||
|
padding: EdgeInsets.zero,
|
||||||
|
),
|
||||||
|
)
|
||||||
|
],
|
||||||
|
),
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,8 @@
|
|||||||
|
class BeeMap {
|
||||||
|
Map<int, String> fixTag = {
|
||||||
|
0: '公区报修',
|
||||||
|
1: '家庭报修',
|
||||||
|
};
|
||||||
|
|
||||||
|
Map<int, String> fixState = {0: '待分配', 1: '维修中', 2: '已处理',3:'已完成',4:'已取消'};
|
||||||
|
}
|
@ -0,0 +1,104 @@
|
|||||||
|
import 'package:akuCommunity/pages/convenient_phone/convenient_phone_page.dart';
|
||||||
|
import 'package:akuCommunity/pages/industry_committee/industry_committee_page.dart';
|
||||||
|
import 'package:akuCommunity/pages/life_pay/life_pay_page.dart';
|
||||||
|
import 'package:akuCommunity/pages/open_door_page/open_door_page.dart';
|
||||||
|
import 'package:akuCommunity/pages/things_page/fixed_submit_page.dart';
|
||||||
|
import 'package:akuCommunity/pages/things_page/things_page.dart';
|
||||||
|
import 'package:akuCommunity/pages/total_application_page/total_applications_page.dart';
|
||||||
|
import 'package:akuCommunity/pages/visitor_access_page/visitor_access_page.dart';
|
||||||
|
import 'package:akuCommunity/routers/page_routers.dart';
|
||||||
|
import 'package:flutter/material.dart';
|
||||||
|
import 'package:flutter_screenutil/flutter_screenutil.dart';
|
||||||
|
import 'package:akuCommunity/const/resource.dart';
|
||||||
|
import 'package:get/get.dart';
|
||||||
|
|
||||||
|
class HomeGridButton extends StatefulWidget {
|
||||||
|
final int crossCount;
|
||||||
|
HomeGridButton({Key key, this.crossCount}) : super(key: key);
|
||||||
|
|
||||||
|
@override
|
||||||
|
_HomeGridButtonState createState() => _HomeGridButtonState();
|
||||||
|
}
|
||||||
|
|
||||||
|
class GridButton {
|
||||||
|
String title;
|
||||||
|
String path;
|
||||||
|
VoidCallback onTap;
|
||||||
|
GridButton(this.title, this.path, this.onTap);
|
||||||
|
}
|
||||||
|
|
||||||
|
class _HomeGridButtonState extends State<HomeGridButton> {
|
||||||
|
List<GridButton> _gridList = [
|
||||||
|
GridButton('一键开门', R.ASSETS_ICONS_TOOL_YJKM_PNG, () {
|
||||||
|
Get.to(OpenDoorPage());
|
||||||
|
}),
|
||||||
|
GridButton('访客通行', R.ASSETS_ICONS_TOOL_FKYQ_PNG, () {
|
||||||
|
Get.to(VisitorAccessPage());
|
||||||
|
}),
|
||||||
|
GridButton('报事报修', R.ASSETS_ICONS_TOOL_BSBX_PNG, () {
|
||||||
|
Get.to(FixedSubmitPage());
|
||||||
|
}),
|
||||||
|
GridButton('生活缴费', R.ASSETS_ICONS_TOOL_SHJF_PNG, () {
|
||||||
|
Get.to(LifePayPage());
|
||||||
|
}),
|
||||||
|
GridButton('业委会', R.ASSETS_ICONS_TOOL_YWH_PNG, () {
|
||||||
|
Get.to(IndustryCommitteePage());
|
||||||
|
}),
|
||||||
|
GridButton('建议咨询', R.ASSETS_ICONS_TOOL_JYTS_PNG, () {
|
||||||
|
Get.to(ThingsPage(
|
||||||
|
bundle: Bundle()
|
||||||
|
..putMap('things', {
|
||||||
|
'title': '建议咨询',
|
||||||
|
'treeList': <Map<String, dynamic>>[
|
||||||
|
{'name': '您的建议'},
|
||||||
|
{'name': '您的咨询'},
|
||||||
|
]
|
||||||
|
}),
|
||||||
|
));
|
||||||
|
}),
|
||||||
|
GridButton('便民电话', R.ASSETS_ICONS_TOOL_BMDH_PNG, () {
|
||||||
|
Get.to(ConvenientPhonePage());
|
||||||
|
}),
|
||||||
|
GridButton('全部应用', R.ASSETS_ICONS_TOOL_QBYY_PNG, () {
|
||||||
|
Get.to(TotalApplicationsPage());
|
||||||
|
}),
|
||||||
|
];
|
||||||
|
@override
|
||||||
|
Widget build(BuildContext context) {
|
||||||
|
return GridView.builder(
|
||||||
|
padding: EdgeInsets.zero,
|
||||||
|
shrinkWrap: true,
|
||||||
|
physics: NeverScrollableScrollPhysics(),
|
||||||
|
itemCount: _gridList.length,
|
||||||
|
itemBuilder: (BuildContext context, int index) {
|
||||||
|
return InkWell(
|
||||||
|
onTap: _gridList[index].onTap,
|
||||||
|
child: Container(
|
||||||
|
alignment: Alignment.center,
|
||||||
|
child: Column(
|
||||||
|
mainAxisAlignment: MainAxisAlignment.center,
|
||||||
|
crossAxisAlignment: CrossAxisAlignment.center,
|
||||||
|
children: <Widget>[
|
||||||
|
Image.asset(
|
||||||
|
_gridList[index].path,
|
||||||
|
height: 53.w,
|
||||||
|
width: 53.w,
|
||||||
|
fit: BoxFit.cover,
|
||||||
|
),
|
||||||
|
SizedBox(height: 5),
|
||||||
|
Text(
|
||||||
|
_gridList[index].title,
|
||||||
|
style: TextStyle(fontSize: 24.sp),
|
||||||
|
)
|
||||||
|
],
|
||||||
|
),
|
||||||
|
),
|
||||||
|
);
|
||||||
|
},
|
||||||
|
gridDelegate: SliverGridDelegateWithFixedCrossAxisCount(
|
||||||
|
crossAxisCount: widget.crossCount,
|
||||||
|
mainAxisSpacing: 6.0,
|
||||||
|
childAspectRatio: 1.0),
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
Loading…
Reference in new issue