Commit 188573f7ffda51d12e989089f85683d6504eeeb0

Authored by wdn127929
1 parent 57951b00

预订数据导出UI

... ... @@ -18,19 +18,17 @@ if (flutterRoot == null) {
def flutterVersionCode = "518"
def flutterVersionCode = "519"
if (flutterVersionCode == null) {
flutterVersionCode = '518'
flutterVersionCode = '519'
}
def flutterVersionName = "5.1.8"
def flutterVersionName = "5.1.9"
if (flutterVersionName == null) {
flutterVersionName = '5.1.8'
flutterVersionName = '5.1.9'
}
... ...
import 'package:common_utils/common_utils.dart';
import 'package:flutter/material.dart';
import 'package:flutter_picker/Picker.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart';
import 'package:one_key/res/colors.dart';
import 'package:one_key/widgets/round_button.dart';
import 'package:one_key/widgets/system_app_bar.dart';
import 'package:one_key/widgets/v_empty_view.dart';
import '../../../../utils/dialog_util.dart';
import '../../../../utils/screen_util.dart';
import '../../../../utils/utils.dart';
import '../../../../widgets/h_empty_view.dart';
/**
* 导出预订数据
*/
class ExportBookDataPage extends StatefulWidget {
ExportBookDataPage({Key key}) : super(key: key);
@override
_ExportBookDataPageState createState() => _ExportBookDataPageState();
}
class _ExportBookDataPageState extends State<ExportBookDataPage> {
final GlobalKey<ScaffoldState> scaffoldKey = GlobalKey<ScaffoldState>();
String fromDate = '点击选择'; //有效期开始时间
String endDate = '点击选择'; //有效期结束时间
String timeType = '点击选择'; //时间类型
List<String> data = ['到店时间', '下单时间'];
int timeIndex;
///时间选择
Widget _select(String title, String hintText, GestureTapCallback onTap) {
return InkWell(
onTap: onTap,
child: Container(
height: w(48),
padding: EdgeInsets.symmetric(vertical: ScreenUtil().setWidth(28)),
child: Row(
crossAxisAlignment: CrossAxisAlignment.center,
mainAxisAlignment: MainAxisAlignment.center,
children: [
Container(
// height: ScreenUtil().setWidth(40),
// color: Colors.red,
child: Text(
title,
style: TextStyle(
color: MyColours.color_515151,
fontSize: ScreenUtil().setSp(32)),
),
),
HEmptyView(20),
Spacer(),
Text(hintText,
style: TextStyle(
color: hintText == '点击选择'
? MyColours.color_999999
: MyColours.color_515151,
fontSize: ScreenUtil().setSp(32),
)),
HEmptyView(16),
Image.asset(
Utils.getImgPath('arrow_right_new'),
width: ScreenUtil().setWidth(20),
),
HEmptyView(32),
],
),
),
);
}
List<Widget> itemWidget() {
List<Widget> data = [];
for (var i = 0; i < 10; i++) {
data.add(
GestureDetector(
onTap: () {},
child: Container(
height: w(34),
padding:
EdgeInsets.symmetric(horizontal: ScreenUtil().setWidth(20)),
decoration: false
? BoxDecoration(
color: MyColours.color_438E93,
borderRadius:
BorderRadius.circular(ScreenUtil().setWidth(10)))
: BoxDecoration(
color: MyColours.color_ffffff,
borderRadius:
BorderRadius.circular(ScreenUtil().setWidth(10)),
border: Border.all(
color: MyColours.color_515151,
width: ScreenUtil().setWidth(2))),
child: Row(mainAxisSize: MainAxisSize.min, children: <Widget>[
Flexible(
child: Text(
'下单时间',
style: TextStyle(
fontSize: ScreenUtil().setSp(28),
color:
false ? MyColours.color_ffffff : MyColours.color_515151,
),
overflow: TextOverflow.ellipsis,
)),
]),
)),
);
}
return data;
}
@override
Widget build(BuildContext context) {
return Scaffold(
key: scaffoldKey,
backgroundColor: MyColours.color_f3f3f3,
appBar: SystemAppBar('预订数据导出'),
body: SingleChildScrollView(
// controller: controller,
child: Column(
children: [
VEmptyView(10),
Container(
padding: EdgeInsets.only(left: w(16)),
color: MyColours.color_ffffff,
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
VEmptyView(20),
_select('时间类型', timeType, () {
DialogUtil.showSelectCusmanDialog(context, data, (value) {
if (value != null) {
setState(() {
timeIndex = value.first;
timeType = data[timeIndex];
});
}
},
cancelText: '',
title: '选择宴会类型',
selecteds: timeIndex == null ? [] : [timeIndex])
.then((value) {});
}),
Container(
height: ScreenUtil().setWidth(1),
color: MyColours.color_E7E7E7,
),
VEmptyView(20),
_select('开始日期', fromDate, () {
DialogUtil.showPickerDateTime24(context, scaffoldKey,
(value) {
// {'text': picker.adapter.text, 'select': selecteds}
if (value != null) {
setState(() {
print(value);
fromDate = DateUtil.formatDateStr(value,
format: DateFormats.y_mo_d);
});
}
},
yearBegin: 1900,
minValue: DateTime(1900),
dateTime: DateUtil.getDateTime(fromDate),
pickerDateTimeType: PickerDateTimeType.kYMD,
onCancel: () {});
}),
Container(
height: ScreenUtil().setWidth(1),
color: MyColours.color_E7E7E7,
),
VEmptyView(20),
_select('结束日期', endDate, () {
DialogUtil.showPickerDateTime24(context, scaffoldKey,
(value) {
// {'text': picker.adapter.text, 'select': selecteds}
if (value != null) {
setState(() {
print(value);
endDate = DateUtil.formatDateStr(value,
format: DateFormats.y_mo_d);
});
}
},
yearBegin: 1900,
minValue: DateTime(1900),
dateTime: DateUtil.getDateTime(endDate),
pickerDateTimeType: PickerDateTimeType.kYMD,
onCancel: () {});
}),
Container(
height: ScreenUtil().setWidth(2),
color: MyColours.color_E7E7E7,
),
VEmptyView(20),
Container(
// height: ScreenUtil().setWidth(40),
// color: Colors.red,
child: Text(
'导出字段选择:',
style: TextStyle(
color: MyColours.color_515151,
fontSize: ScreenUtil().setSp(32)),
),
),
VEmptyView(30),
Wrap(
runSpacing: w(10),
spacing: w(10),
children: itemWidget(),
),
VEmptyView(30),
Container(
height: ScreenUtil().setWidth(2),
color: MyColours.color_E7E7E7,
),
VEmptyView(20),
],
),
),
VEmptyView(26),
RoundButton(
text: '导出数据',
width: w(218),
height: w(43),
gradientStart: MyColours.color_f3f3f3,
gradientEnd: MyColours.color_f3f3f3,
textColor: MyColours.color_438E93,
borderColor: MyColours.color_438E93,
radius: r(10),
fontSize: 32,
isBold: true,
)
],
),
),
);
}
}
... ...
... ... @@ -1572,42 +1572,74 @@ class _StoreCustomerHomeLeftPageState extends State<StoreCustomerHomeLeftPage> {
Container(
color: MyColours.color_FAFAFA,
padding: EdgeInsets.only(
top: w(13), bottom: w(26), left: w(45), right: (45)),
child: Stack(
top: w(13), bottom: w(26), left: w(19), right: (19)),
child: Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
RoundButton(
onPressed: () {
NavigatorUtil.goMarketingRecordsPage(
context, FromPage.FromPageStoreCustomer, {
'object':
widget.customerProvider.storeSunmodel.sellerUser
});
},
text: '历史营销记录',
fontSize: 32,
isBold: true,
// margin: EdgeInsets.only(
// top: w(13),
// bottom: w(26),
// left: w(45),
// right: (45)),
textColor: MyColours.color_F8F9FD,
gradientStart: MyColours.color_199095,
gradientEnd: MyColours.color_199095,
borderColor: MyColours.color_199095,
height: ScreenUtil().setWidth(86),
// width: ScreenUtil().setWidth(260),
radius: ScreenUtil().setWidth(10),
),
showWarning
? Positioned(
right: ScreenUtil().setWidth(30),
top: ScreenUtil().setWidth(45 / 2),
child: Image.asset(
Utils.getImgPath('warning'),
width: ScreenUtil().setWidth(35),
))
: SizedBox()
Expanded(
flex: 1,
child: RoundButton(
onPressed: () {
NavigatorUtil.goExportBookDataPage(
context,
);
},
text: '预订数据导出',
fontSize: 32,
isBold: true,
// margin: EdgeInsets.only(
// top: w(13),
// bottom: w(26),
// left: w(45),
// right: (45)),
textColor: MyColours.color_199095,
gradientStart: MyColours.color_ffffff,
gradientEnd: MyColours.color_ffffff,
borderColor: MyColours.color_199095,
height: ScreenUtil().setWidth(86),
width: ScreenUtil().setWidth(333),
radius: ScreenUtil().setWidth(10),
)),
HEmptyView(30),
Expanded(
flex: 1,
child: Stack(
children: [
RoundButton(
onPressed: () {
NavigatorUtil.goMarketingRecordsPage(
context, FromPage.FromPageStoreCustomer, {
'object': widget
.customerProvider.storeSunmodel.sellerUser
});
},
text: '历史营销记录',
fontSize: 32,
isBold: true,
// margin: EdgeInsets.only(
// top: w(13),
// bottom: w(26),
// left: w(45),
// right: (45)),
textColor: MyColours.color_F8F9FD,
gradientStart: MyColours.color_199095,
gradientEnd: MyColours.color_199095,
borderColor: MyColours.color_199095,
height: ScreenUtil().setWidth(86),
// width: ScreenUtil().setWidth(333),
radius: ScreenUtil().setWidth(10),
),
showWarning
? Positioned(
right: ScreenUtil().setWidth(15),
top: ScreenUtil().setWidth(45 / 2),
child: Image.asset(
Utils.getImgPath('warning'),
width: ScreenUtil().setWidth(35),
))
: SizedBox()
],
))
],
))
]);
... ...
... ... @@ -1883,4 +1883,13 @@ class NavigatorUtil {
"${Routes.areas_select_page}?rid=$rid&name=${Uri.encodeComponent(name)}",
replace: replace);
}
///预订数据导出
static Future<dynamic> goExportBookDataPage(
BuildContext context, {
replace = false,
}) {
return _navigateTo(context, "${Routes.export_book_data_page}",
replace: replace);
}
}
... ...
... ... @@ -192,6 +192,7 @@ import '../pages/message/message_recharge_info_page.dart';
import '../pages/my/comment_manage/comment_manage_home_page.dart';
import '../pages/my/customer_type/my_customer/my_customer_home_page.dart';
import '../pages/my/customer_type/store_customer/day_order_page.dart';
import '../pages/my/customer_type/store_customer/export_book_data_page.dart';
import '../pages/my/customer_type/store_customer/month_order_page.dart';
import '../pages/my/customer_type/store_customer/store_customer_home_page.dart';
import '../pages/my/customer_type/store_customer/store_customer_home_left_page_n.dart';
... ... @@ -3213,3 +3214,13 @@ var areasSelectPageHandle = new Handler(
create: (_) => MyTableManageHomeModel(),
child: AreasSelectPage(rid: rid, name: name));
});
//预订数据导出
var exportBookDataPageHandle = new Handler(
handlerFunc: (BuildContext context, Map<String, List<Object>> params) {
// String rid = params["rid"].first;
// String name = params["name"].first;
return ChangeNotifierProvider<CustomerProvider>(
create: (_) => CustomerProvider(), child: ExportBookDataPage());
});
... ...
... ... @@ -305,6 +305,10 @@ class Routes {
static String areas_select_page = "/areas_select_page"; //区域选择页面
static String export_book_data_page = "/export_book_data_page"; //预订数据导出页面
static void configureRoutes(FluroRouter router) {
router.notFoundHandler = new Handler(
handlerFunc: (BuildContext context, Map<String, List<String>> params) {
... ... @@ -568,5 +572,9 @@ class Routes {
router.define(verify_food_page, handler: verifyFoodPageHandle);
router.define(areas_select_page, handler: areasSelectPageHandle);
router.define(export_book_data_page, handler: exportBookDataPageHandle);
}
}
... ...
... ... @@ -63,11 +63,9 @@ class DialogUtil {
static showAuthorityDestination(
BuildContext context, String name, String title, String subTitle) async {
Timer _timer = Timer(const Duration(seconds: 5), () {
// if(!TickerMode.of(context)){
Navigator.of(context).pop(true);
Navigator.of(context).pop(true);
// }
});
final action = await showDialog(
context: context,
... ... @@ -7210,9 +7208,17 @@ class DialogUtil {
static Future showPickerDateTime24(BuildContext context,
GlobalKey<ScaffoldState> scaffoldKey, ValueChanged valueChanged,
{int pickerDateTimeType = PickerDateTimeType.kYMDHMS,
int yearBegin,
DateTime minValue,
List<int> selecteds,
VoidCallback onCancel,
DateTime dateTime}) {
if (yearBegin == null) {
yearBegin = DateTime.now().year;
}
if (minValue == null) {
minValue = DateTime.now();
}
new Picker(
selecteds: selecteds,
adapter: new DateTimePickerAdapter(
... ... @@ -7223,9 +7229,9 @@ class DialogUtil {
daySuffix: "日",
minHour: 00,
maxHour: 23,
yearBegin: DateTime.now().year,
yearBegin: yearBegin,
yearEnd: 2030,
minValue: DateTime.now(),
minValue: minValue,
value: dateTime),
title: new Text(""),
height: ScreenUtil().setWidth(480),
... ...