update fixed submit page

add bee divider
add fixed add page
update some pages
fixed some issues
hmxc
张萌 4 years ago
parent 4a25f07e8a
commit 9b1f35039c

@ -8,6 +8,7 @@ const kForeGroundColor = Color(0xFFFFFFFF);
const kPrimaryColor=Color(0xFFFFC40C);
const kDarkPrimaryColor=Color(0xFFFF8200);
const kDangerColor=Color(0xFFFF3B30);
const kEstateName='宁波华悦茂峰';
class BaseStyle {
///
static final double fontSize18 = 18.sp;

@ -61,5 +61,5 @@ class _Manager {
String get fixedSubmit => '/user/reportRepair/list';
///访
String get insertVisitorInfo => 'user/visitorAccess/insertVisitorInfo';
String get insertVisitorInfo => '/user/visitorAccess/insertVisitorInfo';
}

@ -48,6 +48,9 @@ class UserDetailModel {
roomStatus = json['roomStatus'];
nickName = json['nickName'];
estateNames = json['estateNames'].cast<String>();
if (json['estateNames']==null) {
estateNames=[];
}
}
Map<String, dynamic> toJson() {

@ -1,12 +1,12 @@
import 'dart:ui';
import 'package:akuCommunity/base/base_style.dart';
import 'package:akuCommunity/widget/horizontal_image_view.dart';
import 'package:bot_toast/bot_toast.dart';
import 'package:flutter/material.dart';
import 'package:flutter/cupertino.dart';
import 'package:flutter_icons/flutter_icons.dart';
import 'package:akuCommunity/utils/headers.dart';
import 'package:akuCommunity/widget/expandable_text.dart';
import 'package:akuCommunity/widget/image_grid.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart';
import 'package:get/get.dart';
import 'package:velocity_x/velocity_x.dart';
@ -177,7 +177,7 @@ class _TrendCardState extends State<TrendCard> {
padding: EdgeInsets.only(left: 95.w),
child: Column(
children: [
ImageGrid(widget.imageUrl),
HorizontalImageView(widget.imageUrl),
SizedBox(height: 20.w),
Stack(
children: [

@ -45,7 +45,7 @@ class _ConvenientPhonePageState extends State<ConvenientPhonePage> {
crossAxisAlignment: CrossAxisAlignment.start,
children: [
model.name.text.black.size(32.sp).make(),
12.heightBox,
12.w.heightBox,
model.tel.text.color(Color(0xFF999999)).size(28.sp).make(),
],
).expand(),
@ -70,7 +70,7 @@ class _ConvenientPhonePageState extends State<ConvenientPhonePage> {
// child: Column(
// children: [
// title.text.black.size(32.sp).make(),
// 45.heightBox,
// 45.w.heightBox,
// ],
// ),
// ),

@ -1,3 +1,4 @@
import 'package:akuCommunity/widget/horizontal_image_view.dart';
import 'package:flutter/material.dart';
import 'package:flutter/cupertino.dart';
import 'package:flutter_icons/flutter_icons.dart';
@ -5,7 +6,6 @@ import 'package:akuCommunity/utils/headers.dart';
import 'package:akuCommunity/base/base_style.dart';
import 'package:akuCommunity/widget/cached_image_wrapper.dart';
import 'package:akuCommunity/widget/expandable_text.dart';
import 'package:akuCommunity/widget/image_grid.dart';
class GoodsCommentsCard extends StatefulWidget {
final String imagePath,
@ -97,7 +97,7 @@ class _GoodsCommentsCardState extends State<GoodsCommentsCard> {
expand: false,
),
),
ImageGrid(contentImageList),
HorizontalImageView(contentImageList),
],
),
);

@ -1,6 +1,7 @@
import 'package:akuCommunity/constants/api.dart';
import 'package:akuCommunity/utils/network/base_model.dart';
import 'package:akuCommunity/utils/network/net_util.dart';
import 'package:flustars/flustars.dart';
class ManagerFunc {
static insertVisitorInfo(int id, int type, String name, int sex, String tel,
@ -13,7 +14,7 @@ class ManagerFunc {
'sex': sex,
'tel': tel,
'carNum': carNum,
'expectedVisitDate': expectedVisitDate.toIso8601String(),
'expectedVisitDate': DateUtil.formatDate(expectedVisitDate,format: "yyyy-MM-dd HH:mm:ss")
},
showMessage: true);
return baseModel;

@ -41,7 +41,7 @@ class _ChangeNickNameState extends State<ChangeNickName> {
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
55.heightBox,
55.w.heightBox,
'昵称'.text.black.size(28.sp).make(),
TextFormField(
controller: _textEditingController,
@ -59,7 +59,7 @@ class _ChangeNickNameState extends State<ChangeNickName> {
)),
),
),
150.heightBox,
150.w.heightBox,
MaterialButton(
onPressed: () {
userProvider.setName(_textEditingController.text);
@ -71,7 +71,7 @@ class _ChangeNickNameState extends State<ChangeNickName> {
minWidth: 686.w,
height: 85.w,
),
24.heightBox,
24.w.heightBox,
'为保护个人隐私,在与邻里交往时显示昵称,默认为真实姓名,您可自行修改'
.text
.color(Color(0xFF999999))

@ -69,7 +69,7 @@ class _UpdateTelPageState extends State<UpdateTelPage> {
padding: EdgeInsets.symmetric(horizontal: 32.w),
child: ListView(
children: [
55.heightBox,
55.w.heightBox,
'旧号码'.text.black.size(28.sp).make(),
TextFormField(
inputFormatters: [
@ -88,7 +88,7 @@ class _UpdateTelPageState extends State<UpdateTelPage> {
)),
),
),
24.heightBox,
24.w.heightBox,
'新号码'.text.black.size(28.sp).make(),
TextFormField(
inputFormatters: [
@ -141,7 +141,7 @@ class _UpdateTelPageState extends State<UpdateTelPage> {
),
),
),
24.heightBox,
24.w.heightBox,
'验证码'.text.black.size(28.sp).make(),
TextFormField(
inputFormatters: [
@ -160,7 +160,7 @@ class _UpdateTelPageState extends State<UpdateTelPage> {
)),
),
),
64.heightBox,
64.w.heightBox,
MaterialButton(
onPressed: () {
if (TextUtil.isEmpty(_oldTelController.text)) {
@ -181,7 +181,7 @@ class _UpdateTelPageState extends State<UpdateTelPage> {
minWidth: 686.w,
height: 85.w,
),
24.heightBox,
24.w.heightBox,
'注:新手机号将作为您的登录凭证'
.text
.color(Color(0xFF999999))

@ -1,8 +1,8 @@
import 'package:akuCommunity/base/base_style.dart';
import 'package:akuCommunity/constants/api.dart';
import 'package:akuCommunity/model/user/fixed_submit_model.dart';
import 'package:akuCommunity/pages/things_page/widget/add_fixed_submit_page.dart';
import 'package:akuCommunity/pages/things_page/widget/bee_list_view.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:akuCommunity/widget/horizontal_image_view.dart';
@ -11,6 +11,7 @@ import 'package:flutter_easyrefresh/easy_refresh.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/page_router.dart';
class FixedSubmitPage extends StatefulWidget {
FixedSubmitPage({Key key}) : super(key: key);
@ -117,13 +118,15 @@ class _FixedSubmitPageState extends State<FixedSubmitPage> {
return _buildCard(items[index]);
},
separatorBuilder: (context, index) {
return 24.heightBox;
return 24.w.heightBox;
},
itemCount: items.length);
},
).expand(),
MaterialButton(
onPressed: () {},
onPressed: () {
AddFixedSubmitPage().to();
},
child: '新增'.text.bold.color(ktextPrimary).size(32.sp).make(),
minWidth: double.infinity,
height: 98.w,

@ -1,11 +1,11 @@
import 'package:akuCommunity/pages/things_page/things_evaluate_page/things_evaluate_page.dart';
import 'package:akuCommunity/widget/bee_scaffold.dart';
import 'package:akuCommunity/widget/horizontal_image_view.dart';
import 'package:flutter/material.dart';
import 'package:flutter/cupertino.dart';
import 'package:akuCommunity/utils/headers.dart';
import 'package:akuCommunity/widget/expandable_text.dart';
import 'package:akuCommunity/routers/page_routers.dart';
import '../widget/image_grid.dart';
import 'widget/goods_info_card.dart';
import 'package:velocity_x/velocity_x.dart';
@ -53,7 +53,7 @@ class _ThingsDetailPageState extends State<ThingsDetailPage> {
expand: false,
),
SizedBox(height: 29.w),
imageList.length != 0 ? ImageGrid(imageList) : SizedBox(),
imageList.length != 0 ? HorizontalImageView(imageList) : SizedBox(),
SizedBox(height: 24.w),
Text(
time,

@ -0,0 +1,211 @@
import 'package:akuCommunity/base/base_style.dart';
import 'package:akuCommunity/provider/user_provider.dart';
import 'package:akuCommunity/widget/bee_divider.dart';
import 'package:akuCommunity/widget/bee_scaffold.dart';
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:provider/provider.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart';
import 'package:velocity_x/velocity_x.dart';
import 'package:akuCommunity/const/resource.dart';
import 'package:akuCommunity/extensions/widget_list_ext.dart';
class AddFixedSubmitPage extends StatefulWidget {
AddFixedSubmitPage({Key key}) : super(key: key);
@override
_AddFixedSubmitPageState createState() => _AddFixedSubmitPageState();
}
class _AddFixedSubmitPageState extends State<AddFixedSubmitPage> {
List<String> _buttons = ['公区保修', '家庭维修'];
int _groupValue;
Widget _buildHouseCard(
String title,
String detail,
) {
return Padding(
padding: EdgeInsets.all(32.w),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
'报修房屋'.text.black.size(28.sp).make(),
32.w.heightBox,
GestureDetector(
onTap: () {},
child: Row(
children: [
Image.asset(
R.ASSETS_ICONS_HOUSE_PNG,
width: 60.w,
height: 60.w,
),
40.w.widthBox,
Expanded(
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
title.text.black.size(32.sp).bold.make(),
10.w.heightBox,
detail.text.black.size(32.sp).bold.make()
],
),
),
// Icon(
// CupertinoIcons.chevron_forward,
// size: 40.w,
// ),
],
),
),
24.w.heightBox,
BeeDivider.horizontal(),
],
),
);
}
Widget _selectButton(
String title,
int value,
) {
return FlatButton(
minWidth: 200.w,
height: 72.w,
onPressed: () {
setState(() {
_groupValue = value;
});
},
child: title.text
.color(_groupValue == value ? ktextPrimary : ktextSubColor)
.size(32.sp)
.make(),
padding: EdgeInsets.symmetric(horizontal: 34.w, vertical: 14.w),
shape: RoundedRectangleBorder(
side: BorderSide(
color: _groupValue == value ? kPrimaryColor : ktextSubColor,
width: 3.w),
borderRadius: BorderRadius.circular(36.w)),
);
}
Widget _selectType() {
return Padding(
padding: EdgeInsets.all(32.w),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
'请选择服务类型'.text.black.size(28.sp).make(),
24.w.heightBox,
Row(
children: <Widget>[
...List.generate(_buttons.length,
(index) => _selectButton(_buttons[index], index)),
].sepWidget(separate: 20.w.widthBox),
),
16.w.heightBox,
],
),
);
}
Widget _buildReportCard() {
return Padding(
padding: EdgeInsets.all(32.w),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
'请输入报修内容'.text.black.size(28.sp).make(),
24.w.heightBox,
Container(
padding: EdgeInsets.symmetric(horizontal: 24.w, vertical: 24.w),
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(8.w),
border: Border.all(color: Color(0xFFD4CFBE), width: 1.w)),
constraints: BoxConstraints(
minHeight: 304.w,
),
width: 686.w,
child: TextField(
maxLines: 10,
minLines: 5,
decoration: InputDecoration(
border: InputBorder.none,
hintText: '请简要描述一下你要告知我的事情,以便于我们更好的处理……',
hintStyle: TextStyle(color: ktextSubColor, fontSize: 28.sp),
contentPadding: EdgeInsets.zero,
),
),
),
],
),
);
}
Widget _addImages() {
return Padding(
padding: EdgeInsets.all(32.w),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
'添加图片信息(${0}/9)'.text.black.size(28.sp).make(),
24.w.heightBox,
Row(
children: [
InkWell(
onTap: () {},
child: Container(
alignment: Alignment.center,
width: 218.w,
height: 218.w,
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(8.w),
border: Border.all(color: Color(0xFF979797), width: 1.w),
),
child: '+'.text.black.size(100).bold.make(),
),
),
],
),
],
),
);
}
@override
Widget build(BuildContext context) {
UserProvider userProvider = Provider.of<UserProvider>(context);
return BeeScaffold(
title: '报事报修',
body: Column(
children: [
ListView(
children: [
_buildHouseCard(
kEstateName,
userProvider.userDetailModel.estateNames.isEmpty
? ''
: userProvider.userDetailModel.estateNames[0]),
_selectType(),
_buildReportCard(),
_addImages(),
],
).expand(),
MaterialButton(
minWidth: double.infinity,
height: 98.w,
onPressed: () {},
child: '确认提交'.text.black.bold.size(32.sp).make(),
color: kPrimaryColor,
elevation: 0,
)
.box
.padding(EdgeInsets.only(
bottom: MediaQuery.of(context).padding.bottom))
.make()
],
),
);
}
}

@ -1,59 +0,0 @@
import 'dart:math';
import 'package:flutter/material.dart';
import 'package:flutter/cupertino.dart';
import 'package:akuCommunity/utils/fade_route.dart';
import 'package:akuCommunity/widget/gallery_photo_view_wrapper.dart';
class ImageGrid extends StatelessWidget {
final List<String> imageUrl;
ImageGrid(this.imageUrl, {Key key}) : super(key: key);
final Random _random = new Random();
int next(int min, int max) => min + _random.nextInt(max - min);
List imageModel() {
List imgList = List();
for (int x = 0; x < imageUrl.length; x++) {
GalleryExampleItem item = GalleryExampleItem();
item.id = '${next(x + 100, x + 1000)}';
item.resource = imageUrl[x];
imgList.add(item);
}
return imgList;
}
@override
Widget build(BuildContext context) {
return Container(
child: GridView.builder(
shrinkWrap: true,
physics: NeverScrollableScrollPhysics(),
gridDelegate: SliverGridDelegateWithFixedCrossAxisCount(
crossAxisCount: 4,
crossAxisSpacing: 5,
mainAxisSpacing: 5,
),
itemCount: imageUrl.length,
itemBuilder: (BuildContext context, int index) {
return AspectRatio(
aspectRatio: 1,
child: GalleryExampleItemThumbnail(
galleryExampleItem: imageModel()[index],
onTap: () {
Navigator.of(context).push(new FadeRoute(
page: GalleryPhotoViewWrapper(
galleryItems: imageModel(),
backgroundDecoration: const BoxDecoration(
color: Colors.black,
),
initialIndex: index,
),
));
},
),
);
},
),
);
}
}

@ -1,10 +1,10 @@
import 'package:akuCommunity/pages/things_page/things_detail_page/things_detail_page.dart';
import 'package:akuCommunity/widget/horizontal_image_view.dart';
import 'package:flutter/material.dart';
import 'package:flutter/cupertino.dart';
import 'package:akuCommunity/utils/headers.dart';
import 'package:akuCommunity/routers/page_routers.dart';
import 'package:akuCommunity/widget/expandable_text.dart';
import 'image_grid.dart';
class ThingsCard extends StatefulWidget {
final String time, tag, content;
@ -76,7 +76,7 @@ class _ThingsCardState extends State<ThingsCard> {
expand: false,
),
SizedBox(height: 29.w),
imageList.length != 0 ? ImageGrid(imageList) : SizedBox()
imageList.length != 0 ? HorizontalImageView(imageList) : SizedBox()
],
),
),

@ -9,6 +9,7 @@ import 'package:akuCommunity/base/assets_image.dart';
import 'package:flutter_icons/flutter_icons.dart';
import 'package:akuCommunity/utils/headers.dart';
import 'package:akuCommunity/widget/common_input.dart';
import 'package:get/get.dart';
import 'package:provider/provider.dart';
import 'package:velocity_x/velocity_x.dart';
@ -272,6 +273,7 @@ class _VisitorAccessPageState extends State<VisitorAccessPage> {
onTap: () {
ManagerFunc.insertVisitorInfo(id, type, _userName.text, _selectSex, tel,
_userCarNum.text, dateTime);
Get.back();
},
child: Container(
alignment: Alignment.center,
@ -309,13 +311,13 @@ class _VisitorAccessPageState extends State<VisitorAccessPage> {
}
Widget build(BuildContext context) {
UserProvider userProvider=Provider.of<UserProvider>(context);
UserProvider userProvider = Provider.of<UserProvider>(context);
return BeeScaffold(
title: '访客通行',
actions: [
InkWell(
onTap: () {
VisitorRecordPage().to;
VisitorRecordPage().to();
},
child: Container(
padding: EdgeInsets.fromLTRB(32.w, 28.w, 32.w, 20.w),
@ -343,10 +345,9 @@ class _VisitorAccessPageState extends State<VisitorAccessPage> {
_selectTime(),
SizedBox(height: 64.w),
_create(
userProvider.userDetailModel.id,
userProvider.userDetailModel.type,
userProvider.userDetailModel.tel
),
userProvider.userDetailModel.id,
userProvider.userDetailModel.type,
userProvider.userDetailModel.tel),
_tips(),
],
),

@ -5,6 +5,7 @@ import 'package:akuCommunity/pages/sign/sign_func.dart';
import 'package:akuCommunity/utils/hive_store.dart';
import 'package:akuCommunity/utils/network/base_model.dart';
import 'package:akuCommunity/utils/network/net_util.dart';
import 'package:flustars/flustars.dart';
import 'package:flutter/material.dart';
class UserProvider extends ChangeNotifier {
@ -76,11 +77,11 @@ class UserProvider extends ChangeNotifier {
Future setBirthday(DateTime date) async {
BaseModel baseModel = await NetUtil().post(
API.user.setBirthday,
params: {'birthday': date.toIso8601String()},
params: {'birthday': DateUtil.formatDate(date,format: "yyyy-MM-dd HH:mm:ss")},
showMessage: true,
);
if (baseModel.status) {
_userInfoModel.birthday = date.toIso8601String();
_userInfoModel.birthday = DateUtil.formatDate(date,format: "yyyy-MM-dd HH:mm:ss");
notifyListeners();
}
}

@ -0,0 +1,52 @@
import 'package:flutter/material.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart';
class BeeDivider extends StatelessWidget {
final double thickness;
final double indent;
final double endIndent;
final Color color;
final bool isHorizontal;
BeeDivider(
{Key key,
this.thickness,
this.indent,
this.endIndent,
this.color,
this.isHorizontal})
: super(key: key);
BeeDivider.horizontal({
Key key,
}) : indent = 0,
endIndent = 0,
thickness = 1.w,
color = Color(0xFFE8E8E8),
isHorizontal = true,
super(key: key);
BeeDivider.vertical({
Key key,
}) : indent = 0,
endIndent = 0,
thickness = 1.w,
color = Color(0xFFE8E8E8),
isHorizontal = false,
super(key: key);
@override
Widget build(BuildContext context) {
return isHorizontal
? Divider(
height: 0,
thickness: this.thickness ?? 1.w,
indent: this.indent ?? 0,
endIndent: this.endIndent ?? 0,
color: this.color ?? Color(0xFFE8E8E8),
)
: VerticalDivider(
width: 0,
thickness: this.thickness ?? 1.w,
indent: this.indent ?? 0,
endIndent: this.endIndent ?? 0,
color: this.color ?? Color(0xFFE8E8E8),
);
}
}

@ -1,59 +0,0 @@
import 'dart:math';
import 'package:flutter/material.dart';
import 'package:flutter/cupertino.dart';
import 'package:akuCommunity/utils/fade_route.dart';
import 'package:akuCommunity/widget/gallery_photo_view_wrapper.dart';
class ImageGrid extends StatelessWidget {
final List<String> imageUrl;
ImageGrid(this.imageUrl, {Key key}) : super(key: key);
final Random _random = new Random();
int next(int min, int max) => min + _random.nextInt(max - min);
List imageModel() {
List imgList = List();
for (int x = 0; x < imageUrl.length; x++) {
GalleryExampleItem item = GalleryExampleItem();
item.id = '${next(x + 100, x + 1000)}';
item.resource = imageUrl[x];
imgList.add(item);
}
return imgList;
}
@override
Widget build(BuildContext context) {
return Container(
child: GridView.builder(
shrinkWrap: true,
physics: NeverScrollableScrollPhysics(),
gridDelegate: SliverGridDelegateWithFixedCrossAxisCount(
crossAxisCount: 4,
crossAxisSpacing: 5,
mainAxisSpacing: 5,
),
itemCount: imageUrl.length,
itemBuilder: (BuildContext context, int index) {
return AspectRatio(
aspectRatio: 1,
child: GalleryExampleItemThumbnail(
galleryExampleItem: imageModel()[index],
onTap: () {
Navigator.of(context).push(new FadeRoute(
page: GalleryPhotoViewWrapper(
galleryItems: imageModel(),
backgroundDecoration: const BoxDecoration(
color: Colors.black,
),
initialIndex: index,
),
));
},
),
);
},
),
);
}
}
Loading…
Cancel
Save