# Conflicts:
#	lib/constants/api.dart
hmxc
张萌 4 years ago
commit bdc2e5922a

@ -62,4 +62,7 @@ class _Manager {
///访 ///访
String get insertVisitorInfo => '/user/visitorAccess/insertVisitorInfo'; String get insertVisitorInfo => '/user/visitorAccess/insertVisitorInfo';
///
String get articleOut => '/user/articleOut/list';
} }

@ -0,0 +1,40 @@
class GoodsOutModel {
int id;
String name;
int weight;
String expectedTime;
int approach;
int status;
String movingCompanyTel;
GoodsOutModel(
{this.id,
this.name,
this.weight,
this.expectedTime,
this.approach,
this.status,
this.movingCompanyTel});
GoodsOutModel.fromJson(Map<String, dynamic> json) {
id = json['id'];
name = json['name'];
weight = json['weight'];
expectedTime = json['expectedTime'];
approach = json['approach'];
status = json['status'];
movingCompanyTel = json['movingCompanyTel'];
}
Map<String, dynamic> toJson() {
final Map<String, dynamic> data = new Map<String, dynamic>();
data['id'] = this.id;
data['name'] = this.name;
data['weight'] = this.weight;
data['expectedTime'] = this.expectedTime;
data['approach'] = this.approach;
data['status'] = this.status;
data['movingCompanyTel'] = this.movingCompanyTel;
return data;
}
}

@ -1,3 +1,4 @@
import 'package:akuCommunity/widget/picker/bee_date_picker.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:flutter/cupertino.dart'; import 'package:flutter/cupertino.dart';
import 'package:flutter_icons/flutter_icons.dart'; import 'package:flutter_icons/flutter_icons.dart';
@ -30,24 +31,24 @@ class _CommonPickerState extends State<CommonPicker> {
margin: EdgeInsets.only(right: 30.w), margin: EdgeInsets.only(right: 30.w),
child: Text( child: Text(
widget.title, widget.title,
style: TextStyle( style: TextStyle(fontSize: 28.sp, color: Color(0xff333333)),
fontSize: 28.sp, color: Color(0xff333333)),
), ),
), ),
InkWell( InkWell(
onTap: () { onTap: () {
switch (widget.title) { switch (widget.title) {
case '出户时间': case '出户时间':
DatePicker.showDatePicker(context, BeeDatePicker.pick(DateTime.now());
showTitleActions: true, // DatePicker.showDatePicker(context,
minTime: DateTime(2020, 1, 1), // showTitleActions: true,
maxTime: DateTime(2020, 12, 31), onChanged: (date) { // minTime: DateTime(2020, 1, 1),
print('change $date in time zone ' + // maxTime: DateTime(2020, 12, 31), onChanged: (date) {
date.timeZoneOffset.inHours.toString()); // print('change $date in time zone ' +
}, onConfirm: (date) { // date.timeZoneOffset.inHours.toString());
pickerData = date.toString().substring(0, 11); // }, onConfirm: (date) {
setState(() {}); // pickerData = date.toString().substring(0, 11);
}, currentTime: DateTime.now(), locale: LocaleType.zh); // setState(() {});
// }, currentTime: DateTime.now(), locale: LocaleType.zh);
break; break;
case '物品名称': case '物品名称':
Picker( Picker(
@ -92,9 +93,7 @@ class _CommonPickerState extends State<CommonPicker> {
children: [ children: [
Text( Text(
pickerData, pickerData,
style: TextStyle( style: TextStyle(fontSize: 28.sp, color: Color(0xff999999)),
fontSize: 28.sp,
color: Color(0xff999999)),
), ),
Icon( Icon(
AntDesign.right, AntDesign.right,

@ -1,8 +1,12 @@
import 'package:akuCommunity/constants/api.dart';
import 'package:akuCommunity/model/manager/goods_out_model.dart';
import 'package:akuCommunity/pages/goods_deto_page/deto_create_page/deto_create_page.dart'; import 'package:akuCommunity/pages/goods_deto_page/deto_create_page/deto_create_page.dart';
import 'package:akuCommunity/pages/things_page/widget/bee_list_view.dart';
import 'package:akuCommunity/utils/headers.dart'; import 'package:akuCommunity/utils/headers.dart';
import 'package:akuCommunity/widget/bee_scaffold.dart'; import 'package:akuCommunity/widget/bee_scaffold.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:flutter/cupertino.dart'; import 'package:flutter/cupertino.dart';
import 'package:flutter_easyrefresh/easy_refresh.dart';
import 'package:pull_to_refresh/pull_to_refresh.dart'; import 'package:pull_to_refresh/pull_to_refresh.dart';
import 'package:akuCommunity/widget/bottom_button.dart'; import 'package:akuCommunity/widget/bottom_button.dart';
import 'widget/goods_info_card.dart'; import 'widget/goods_info_card.dart';
@ -15,118 +19,36 @@ class GoodsDetoPage extends StatefulWidget {
} }
class _GoodsDetoPageState extends State<GoodsDetoPage> { class _GoodsDetoPageState extends State<GoodsDetoPage> {
List<String> _listImage = [ EasyRefreshController _refreshController = EasyRefreshController();
'https://timgsa.baidu.com/timg?image&quality=80&size=b9999_10000&sec=1600160449547&di=21b73a9a117988683773490f1230dacf&imgtype=0&src=http%3A%2F%2Ffile3.youboy.com%2Fd%2F157%2F50%2F46%2F1%2F873561.jpg',
'https://timgsa.baidu.com/timg?image&quality=80&size=b9999_10000&sec=1600160548603&di=56a586397e8d4223f10a8912c011f46a&imgtype=0&src=http%3A%2F%2Fimages.paiming.net%2Fimages%2Fupload%2F20181025%2F20181025113249_2421.jpg',
'https://timgsa.baidu.com/timg?image&quality=80&size=b9999_10000&sec=1600160568752&di=dc5e904c452f8b59a6b0526861d67697&imgtype=0&src=http%3A%2F%2Fwww.llfbj.com%2Fuploads%2Fallimg%2F160218%2F1-16021R22K2V9.jpg',
'https://timgsa.baidu.com/timg?image&quality=80&size=b9999_10000&sec=1600160586384&di=28d8cd4a547baa87571e03a5e6ffda03&imgtype=0&src=http%3A%2F%2Fdownload.img.dns4.cn%2Fpic%2F209211%2Fp2%2F20171115151608_6648_zs.jpg%3F308*308',
'https://timgsa.baidu.com/timg?image&quality=80&size=b9999_10000&sec=1600160602710&di=8c44c989c744c94bedf58d64f3db2abd&imgtype=0&src=http%3A%2F%2Ftu.ossfiles.cn%3A9186%2Fgroup3%2FM00%2F0F%2FFE%2FrBpVfl88i4mAARmAAACZsU16st0080.jpg',
'https://timgsa.baidu.com/timg?image&quality=80&size=b9999_10000&sec=1600160627146&di=3b38d04039273ef288f2fe8307c503bc&imgtype=0&src=http%3A%2F%2Ffile5.youboy.com%2Fd%2F158%2F85%2F68%2F1%2F237131s.jpg'
];
List<Map<String, dynamic>> _listView = [
{
'status': '已提交',
'details': <Map<String, dynamic>>[
{'title': '物品重量', 'content': '< 50kg'},
{'title': '出户时间', 'content': '2020-10-10 12:00'},
{'title': '物品名称', 'content': '家具'},
{'title': '搬运方式', 'content': '搬家公司'}
]
},
{
'status': '已出户',
'details': <Map<String, dynamic>>[
{'title': '物品重量', 'content': '< 50kg'},
{'title': '出户时间', 'content': '2020-10-10 12:00'},
{'title': '实际出户时间', 'content': '2020-10-10 14:00'},
{'title': '物品名称', 'content': '全部'},
{'title': '搬运方式', 'content': '自己搬家'}
]
},
{
'status': '已驳回',
'details': <Map<String, dynamic>>[
{'title': '物品重量', 'content': '< 50kg'},
{'title': '出户时间', 'content': '2020-10-10 12:00'},
{'title': '实际出户时间', 'content': '2020-10-10 14:00'},
{'title': '物品名称', 'content': '全部'},
{'title': '搬运方式', 'content': '自己搬家'}
]
}
];
RefreshController _refreshController =
RefreshController(initialRefresh: false);
@override
void initState() {
super.initState();
}
void _onRefresh() async {
await Future.delayed(Duration(milliseconds: 1500));
_refreshController.refreshCompleted();
}
void _onLoading() async {
await Future.delayed(Duration(milliseconds: 1500));
if (mounted) setState(() {});
_refreshController.loadComplete();
}
@override
void dispose() {
super.dispose();
_refreshController.dispose();
}
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
return BeeScaffold( return BeeScaffold(
title: '物品出户', title: '物品出户',
body: Stack( body: Padding(
children: [ padding: EdgeInsets.only(bottom: 98.w),
Padding( child: BeeListView(
padding: EdgeInsets.only(bottom: 98.w), controller: _refreshController,
child: RefreshConfiguration( path: API.manager.articleOut,
hideFooterWhenNotFull: true, convert: (model) {
child: SmartRefresher( return model.tableList
controller: _refreshController, .map((e) => GoodsOutModel.fromJson(e))
header: WaterDropHeader(), .toList();
footer: ClassicFooter(), },
onRefresh: _onRefresh, builder: (items) {
onLoading: _onLoading, return ListView.builder(
enablePullUp: true, itemBuilder: (context, index) {
child: CustomScrollView( return GoodsInfoCard();
slivers: [
SliverList(
delegate: SliverChildBuilderDelegate(
(BuildContext context, int index) => GoodsInfoCard(
listImage: _listImage,
status: _listView[index]['status'],
detoInfoList: _listView[index]['details'],
),
childCount: _listView.length,
),
)
],
),
),
),
),
Positioned(
bottom: 0,
child: BottomButton(
title: '新增',
fun: () {
DetoCreatePage().to();
}, },
), itemCount: items.length,
), );
], },
),
),
bottomNavi: BottomButton(
title: '新增',
fun: () {
DetoCreatePage().to();
},
), ),
); );
} }

@ -21,10 +21,7 @@ class _FeedBackPageState extends State<FeedBackPage> {
Widget _containerTextField() { Widget _containerTextField() {
return Container( return Container(
padding: EdgeInsets.only( padding: EdgeInsets.only(top: 24.w, left: 24.w, right: 32.w),
top: 24.w,
left: 24.w,
right: 32.w),
decoration: BoxDecoration( decoration: BoxDecoration(
borderRadius: BorderRadius.all(Radius.circular(6)), borderRadius: BorderRadius.all(Radius.circular(6)),
border: Border.all(color: Color(0xffd4cfbe), width: 1.0), border: Border.all(color: Color(0xffd4cfbe), width: 1.0),
@ -62,18 +59,13 @@ class _FeedBackPageState extends State<FeedBackPage> {
return InkWell( return InkWell(
onTap: () { onTap: () {
if (TextUtil.isEmpty(_ideaContent.text)) if (TextUtil.isEmpty(_ideaContent.text))
BotToast.showText(text:'意见不能为空'); BotToast.showText(text: '意见不能为空');
else { else {
showDialog( var cancelAction = BotToast.showLoading();
context: context,
child: Center(
child: CupertinoActivityIndicator(),
),
);
Future.delayed(Duration(milliseconds: 1000 + Random().nextInt(1000)), Future.delayed(Duration(milliseconds: 1000 + Random().nextInt(1000)),
() { () {
BotToast.showText(text:'提交成功'); BotToast.showText(text: '提交成功');
Get.back(); cancelAction();
Get.back(); Get.back();
}); });
} }
@ -122,18 +114,14 @@ class _FeedBackPageState extends State<FeedBackPage> {
SizedBox(height: 76.w), SizedBox(height: 76.w),
Text( Text(
'意见反馈', '意见反馈',
style: TextStyle( style: TextStyle(fontSize: 28.sp, color: Color(0xff333333)),
fontSize: 28.sp,
color: Color(0xff333333)),
), ),
SizedBox(height: 24.w), SizedBox(height: 24.w),
_containerTextField(), _containerTextField(),
SizedBox(height: 24.w), SizedBox(height: 24.w),
Text( Text(
'添加图片信息(0/9)', '添加图片信息(0/9)',
style: TextStyle( style: TextStyle(fontSize: 28.sp, color: Color(0xff333333)),
fontSize: 28.sp,
color: Color(0xff333333)),
), ),
SizedBox(height: 24.w), SizedBox(height: 24.w),
CommonImagePicker(), CommonImagePicker(),

@ -0,0 +1,59 @@
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:get/get.dart';
import 'package:velocity_x/velocity_x.dart';
class BeeDatePicker {
static Future<DateTime> pick(DateTime initDate) async {
return await Get.bottomSheet(_BeeDatePicker(date: initDate));
}
}
class _BeeDatePicker extends StatefulWidget {
final DateTime date;
_BeeDatePicker({Key key, @required this.date}) : super(key: key);
@override
__BeeDatePickerState createState() => __BeeDatePickerState();
}
class __BeeDatePickerState extends State<_BeeDatePicker> {
DateTime _date = DateTime.now();
@override
void initState() {
super.initState();
_date = widget.date ?? DateTime.now();
}
@override
Widget build(BuildContext context) {
return SizedBox(
child: Material(
borderRadius: BorderRadius.vertical(top: Radius.circular(10)),
child: Column(
children: [
SizedBox(
height: 48,
child: NavigationToolbar(
leading: TextButton(
onPressed: Get.back,
child: '取消'.text.black.make(),
),
trailing: TextButton(
onPressed: () => Get.back(result: _date),
child: '确定'.text.black.make(),
),
),
),
CupertinoDatePicker(
initialDateTime: _date,
onDateTimeChanged: (date) => _date = date,
mode: CupertinoDatePickerMode.date,
).expand(),
],
),
),
height: Get.height / 3,
);
}
}
Loading…
Cancel
Save