Commit 188573f7ffda51d12e989089f85683d6504eeeb0

Authored by wdn127929
1 parent 57951b00

预订数据导出UI

@@ -18,19 +18,17 @@ if (flutterRoot == null) { @@ -18,19 +18,17 @@ if (flutterRoot == null) {
18 18
19 19
20 20
21 -def flutterVersionCode = "518" 21 +def flutterVersionCode = "519"
22 if (flutterVersionCode == null) { 22 if (flutterVersionCode == null) {
23 - flutterVersionCode = '518'  
24 -  
25 - 23 + flutterVersionCode = '519'
26 24
27 } 25 }
28 26
29 27
30 -def flutterVersionName = "5.1.8" 28 +def flutterVersionName = "5.1.9"
31 29
32 if (flutterVersionName == null) { 30 if (flutterVersionName == null) {
33 - flutterVersionName = '5.1.8' 31 + flutterVersionName = '5.1.9'
34 32
35 33
36 } 34 }
  1 +import 'package:common_utils/common_utils.dart';
  2 +import 'package:flutter/material.dart';
  3 +import 'package:flutter_picker/Picker.dart';
  4 +import 'package:flutter_screenutil/flutter_screenutil.dart';
  5 +import 'package:one_key/res/colors.dart';
  6 +import 'package:one_key/widgets/round_button.dart';
  7 +import 'package:one_key/widgets/system_app_bar.dart';
  8 +import 'package:one_key/widgets/v_empty_view.dart';
  9 +
  10 +import '../../../../utils/dialog_util.dart';
  11 +import '../../../../utils/screen_util.dart';
  12 +import '../../../../utils/utils.dart';
  13 +import '../../../../widgets/h_empty_view.dart';
  14 +
  15 +/**
  16 + * 导出预订数据
  17 + */
  18 +
  19 +class ExportBookDataPage extends StatefulWidget {
  20 + ExportBookDataPage({Key key}) : super(key: key);
  21 +
  22 + @override
  23 + _ExportBookDataPageState createState() => _ExportBookDataPageState();
  24 +}
  25 +
  26 +class _ExportBookDataPageState extends State<ExportBookDataPage> {
  27 + final GlobalKey<ScaffoldState> scaffoldKey = GlobalKey<ScaffoldState>();
  28 + String fromDate = '点击选择'; //有效期开始时间
  29 + String endDate = '点击选择'; //有效期结束时间
  30 + String timeType = '点击选择'; //时间类型
  31 +
  32 + List<String> data = ['到店时间', '下单时间'];
  33 + int timeIndex;
  34 +
  35 + ///时间选择
  36 + Widget _select(String title, String hintText, GestureTapCallback onTap) {
  37 + return InkWell(
  38 + onTap: onTap,
  39 + child: Container(
  40 + height: w(48),
  41 + padding: EdgeInsets.symmetric(vertical: ScreenUtil().setWidth(28)),
  42 + child: Row(
  43 + crossAxisAlignment: CrossAxisAlignment.center,
  44 + mainAxisAlignment: MainAxisAlignment.center,
  45 + children: [
  46 + Container(
  47 + // height: ScreenUtil().setWidth(40),
  48 + // color: Colors.red,
  49 + child: Text(
  50 + title,
  51 + style: TextStyle(
  52 + color: MyColours.color_515151,
  53 + fontSize: ScreenUtil().setSp(32)),
  54 + ),
  55 + ),
  56 + HEmptyView(20),
  57 + Spacer(),
  58 + Text(hintText,
  59 + style: TextStyle(
  60 + color: hintText == '点击选择'
  61 + ? MyColours.color_999999
  62 + : MyColours.color_515151,
  63 + fontSize: ScreenUtil().setSp(32),
  64 + )),
  65 + HEmptyView(16),
  66 + Image.asset(
  67 + Utils.getImgPath('arrow_right_new'),
  68 + width: ScreenUtil().setWidth(20),
  69 + ),
  70 + HEmptyView(32),
  71 + ],
  72 + ),
  73 + ),
  74 + );
  75 + }
  76 +
  77 + List<Widget> itemWidget() {
  78 + List<Widget> data = [];
  79 + for (var i = 0; i < 10; i++) {
  80 + data.add(
  81 + GestureDetector(
  82 + onTap: () {},
  83 + child: Container(
  84 + height: w(34),
  85 + padding:
  86 + EdgeInsets.symmetric(horizontal: ScreenUtil().setWidth(20)),
  87 + decoration: false
  88 + ? BoxDecoration(
  89 + color: MyColours.color_438E93,
  90 + borderRadius:
  91 + BorderRadius.circular(ScreenUtil().setWidth(10)))
  92 + : BoxDecoration(
  93 + color: MyColours.color_ffffff,
  94 + borderRadius:
  95 + BorderRadius.circular(ScreenUtil().setWidth(10)),
  96 + border: Border.all(
  97 + color: MyColours.color_515151,
  98 + width: ScreenUtil().setWidth(2))),
  99 + child: Row(mainAxisSize: MainAxisSize.min, children: <Widget>[
  100 + Flexible(
  101 + child: Text(
  102 + '下单时间',
  103 + style: TextStyle(
  104 + fontSize: ScreenUtil().setSp(28),
  105 + color:
  106 + false ? MyColours.color_ffffff : MyColours.color_515151,
  107 + ),
  108 + overflow: TextOverflow.ellipsis,
  109 + )),
  110 + ]),
  111 + )),
  112 + );
  113 + }
  114 + return data;
  115 + }
  116 +
  117 + @override
  118 + Widget build(BuildContext context) {
  119 + return Scaffold(
  120 + key: scaffoldKey,
  121 + backgroundColor: MyColours.color_f3f3f3,
  122 + appBar: SystemAppBar('预订数据导出'),
  123 + body: SingleChildScrollView(
  124 + // controller: controller,
  125 + child: Column(
  126 + children: [
  127 + VEmptyView(10),
  128 + Container(
  129 + padding: EdgeInsets.only(left: w(16)),
  130 + color: MyColours.color_ffffff,
  131 + child: Column(
  132 + crossAxisAlignment: CrossAxisAlignment.start,
  133 + children: [
  134 + VEmptyView(20),
  135 + _select('时间类型', timeType, () {
  136 + DialogUtil.showSelectCusmanDialog(context, data, (value) {
  137 + if (value != null) {
  138 + setState(() {
  139 + timeIndex = value.first;
  140 + timeType = data[timeIndex];
  141 + });
  142 + }
  143 + },
  144 + cancelText: '',
  145 + title: '选择宴会类型',
  146 + selecteds: timeIndex == null ? [] : [timeIndex])
  147 + .then((value) {});
  148 + }),
  149 + Container(
  150 + height: ScreenUtil().setWidth(1),
  151 + color: MyColours.color_E7E7E7,
  152 + ),
  153 + VEmptyView(20),
  154 + _select('开始日期', fromDate, () {
  155 + DialogUtil.showPickerDateTime24(context, scaffoldKey,
  156 + (value) {
  157 + // {'text': picker.adapter.text, 'select': selecteds}
  158 + if (value != null) {
  159 + setState(() {
  160 + print(value);
  161 + fromDate = DateUtil.formatDateStr(value,
  162 + format: DateFormats.y_mo_d);
  163 + });
  164 + }
  165 + },
  166 + yearBegin: 1900,
  167 + minValue: DateTime(1900),
  168 + dateTime: DateUtil.getDateTime(fromDate),
  169 + pickerDateTimeType: PickerDateTimeType.kYMD,
  170 + onCancel: () {});
  171 + }),
  172 + Container(
  173 + height: ScreenUtil().setWidth(1),
  174 + color: MyColours.color_E7E7E7,
  175 + ),
  176 + VEmptyView(20),
  177 + _select('结束日期', endDate, () {
  178 + DialogUtil.showPickerDateTime24(context, scaffoldKey,
  179 + (value) {
  180 + // {'text': picker.adapter.text, 'select': selecteds}
  181 + if (value != null) {
  182 + setState(() {
  183 + print(value);
  184 + endDate = DateUtil.formatDateStr(value,
  185 + format: DateFormats.y_mo_d);
  186 + });
  187 + }
  188 + },
  189 + yearBegin: 1900,
  190 + minValue: DateTime(1900),
  191 + dateTime: DateUtil.getDateTime(endDate),
  192 + pickerDateTimeType: PickerDateTimeType.kYMD,
  193 + onCancel: () {});
  194 + }),
  195 + Container(
  196 + height: ScreenUtil().setWidth(2),
  197 + color: MyColours.color_E7E7E7,
  198 + ),
  199 + VEmptyView(20),
  200 + Container(
  201 + // height: ScreenUtil().setWidth(40),
  202 + // color: Colors.red,
  203 + child: Text(
  204 + '导出字段选择:',
  205 + style: TextStyle(
  206 + color: MyColours.color_515151,
  207 + fontSize: ScreenUtil().setSp(32)),
  208 + ),
  209 + ),
  210 + VEmptyView(30),
  211 + Wrap(
  212 + runSpacing: w(10),
  213 + spacing: w(10),
  214 + children: itemWidget(),
  215 + ),
  216 + VEmptyView(30),
  217 + Container(
  218 + height: ScreenUtil().setWidth(2),
  219 + color: MyColours.color_E7E7E7,
  220 + ),
  221 + VEmptyView(20),
  222 + ],
  223 + ),
  224 + ),
  225 + VEmptyView(26),
  226 + RoundButton(
  227 + text: '导出数据',
  228 + width: w(218),
  229 + height: w(43),
  230 + gradientStart: MyColours.color_f3f3f3,
  231 + gradientEnd: MyColours.color_f3f3f3,
  232 + textColor: MyColours.color_438E93,
  233 + borderColor: MyColours.color_438E93,
  234 + radius: r(10),
  235 + fontSize: 32,
  236 + isBold: true,
  237 + )
  238 + ],
  239 + ),
  240 + ),
  241 + );
  242 + }
  243 +}
@@ -1572,42 +1572,74 @@ class _StoreCustomerHomeLeftPageState extends State<StoreCustomerHomeLeftPage> { @@ -1572,42 +1572,74 @@ class _StoreCustomerHomeLeftPageState extends State<StoreCustomerHomeLeftPage> {
1572 Container( 1572 Container(
1573 color: MyColours.color_FAFAFA, 1573 color: MyColours.color_FAFAFA,
1574 padding: EdgeInsets.only( 1574 padding: EdgeInsets.only(
1575 - top: w(13), bottom: w(26), left: w(45), right: (45)),  
1576 - child: Stack( 1575 + top: w(13), bottom: w(26), left: w(19), right: (19)),
  1576 + child: Row(
  1577 + mainAxisAlignment: MainAxisAlignment.spaceBetween,
1577 children: [ 1578 children: [
1578 - RoundButton(  
1579 - onPressed: () {  
1580 - NavigatorUtil.goMarketingRecordsPage(  
1581 - context, FromPage.FromPageStoreCustomer, {  
1582 - 'object':  
1583 - widget.customerProvider.storeSunmodel.sellerUser  
1584 - });  
1585 - },  
1586 - text: '历史营销记录',  
1587 - fontSize: 32,  
1588 - isBold: true,  
1589 - // margin: EdgeInsets.only(  
1590 - // top: w(13),  
1591 - // bottom: w(26),  
1592 - // left: w(45),  
1593 - // right: (45)),  
1594 - textColor: MyColours.color_F8F9FD,  
1595 - gradientStart: MyColours.color_199095,  
1596 - gradientEnd: MyColours.color_199095,  
1597 - borderColor: MyColours.color_199095,  
1598 - height: ScreenUtil().setWidth(86),  
1599 - // width: ScreenUtil().setWidth(260),  
1600 - radius: ScreenUtil().setWidth(10),  
1601 - ),  
1602 - showWarning  
1603 - ? Positioned(  
1604 - right: ScreenUtil().setWidth(30),  
1605 - top: ScreenUtil().setWidth(45 / 2),  
1606 - child: Image.asset(  
1607 - Utils.getImgPath('warning'),  
1608 - width: ScreenUtil().setWidth(35),  
1609 - ))  
1610 - : SizedBox() 1579 + Expanded(
  1580 + flex: 1,
  1581 + child: RoundButton(
  1582 + onPressed: () {
  1583 + NavigatorUtil.goExportBookDataPage(
  1584 + context,
  1585 + );
  1586 + },
  1587 + text: '预订数据导出',
  1588 + fontSize: 32,
  1589 + isBold: true,
  1590 + // margin: EdgeInsets.only(
  1591 + // top: w(13),
  1592 + // bottom: w(26),
  1593 + // left: w(45),
  1594 + // right: (45)),
  1595 + textColor: MyColours.color_199095,
  1596 + gradientStart: MyColours.color_ffffff,
  1597 + gradientEnd: MyColours.color_ffffff,
  1598 + borderColor: MyColours.color_199095,
  1599 + height: ScreenUtil().setWidth(86),
  1600 + width: ScreenUtil().setWidth(333),
  1601 + radius: ScreenUtil().setWidth(10),
  1602 + )),
  1603 + HEmptyView(30),
  1604 + Expanded(
  1605 + flex: 1,
  1606 + child: Stack(
  1607 + children: [
  1608 + RoundButton(
  1609 + onPressed: () {
  1610 + NavigatorUtil.goMarketingRecordsPage(
  1611 + context, FromPage.FromPageStoreCustomer, {
  1612 + 'object': widget
  1613 + .customerProvider.storeSunmodel.sellerUser
  1614 + });
  1615 + },
  1616 + text: '历史营销记录',
  1617 + fontSize: 32,
  1618 + isBold: true,
  1619 + // margin: EdgeInsets.only(
  1620 + // top: w(13),
  1621 + // bottom: w(26),
  1622 + // left: w(45),
  1623 + // right: (45)),
  1624 + textColor: MyColours.color_F8F9FD,
  1625 + gradientStart: MyColours.color_199095,
  1626 + gradientEnd: MyColours.color_199095,
  1627 + borderColor: MyColours.color_199095,
  1628 + height: ScreenUtil().setWidth(86),
  1629 + // width: ScreenUtil().setWidth(333),
  1630 + radius: ScreenUtil().setWidth(10),
  1631 + ),
  1632 + showWarning
  1633 + ? Positioned(
  1634 + right: ScreenUtil().setWidth(15),
  1635 + top: ScreenUtil().setWidth(45 / 2),
  1636 + child: Image.asset(
  1637 + Utils.getImgPath('warning'),
  1638 + width: ScreenUtil().setWidth(35),
  1639 + ))
  1640 + : SizedBox()
  1641 + ],
  1642 + ))
1611 ], 1643 ],
1612 )) 1644 ))
1613 ]); 1645 ]);
@@ -1883,4 +1883,13 @@ class NavigatorUtil { @@ -1883,4 +1883,13 @@ class NavigatorUtil {
1883 "${Routes.areas_select_page}?rid=$rid&name=${Uri.encodeComponent(name)}", 1883 "${Routes.areas_select_page}?rid=$rid&name=${Uri.encodeComponent(name)}",
1884 replace: replace); 1884 replace: replace);
1885 } 1885 }
  1886 +
  1887 + ///预订数据导出
  1888 + static Future<dynamic> goExportBookDataPage(
  1889 + BuildContext context, {
  1890 + replace = false,
  1891 + }) {
  1892 + return _navigateTo(context, "${Routes.export_book_data_page}",
  1893 + replace: replace);
  1894 + }
1886 } 1895 }
@@ -192,6 +192,7 @@ import '../pages/message/message_recharge_info_page.dart'; @@ -192,6 +192,7 @@ import '../pages/message/message_recharge_info_page.dart';
192 import '../pages/my/comment_manage/comment_manage_home_page.dart'; 192 import '../pages/my/comment_manage/comment_manage_home_page.dart';
193 import '../pages/my/customer_type/my_customer/my_customer_home_page.dart'; 193 import '../pages/my/customer_type/my_customer/my_customer_home_page.dart';
194 import '../pages/my/customer_type/store_customer/day_order_page.dart'; 194 import '../pages/my/customer_type/store_customer/day_order_page.dart';
  195 +import '../pages/my/customer_type/store_customer/export_book_data_page.dart';
195 import '../pages/my/customer_type/store_customer/month_order_page.dart'; 196 import '../pages/my/customer_type/store_customer/month_order_page.dart';
196 import '../pages/my/customer_type/store_customer/store_customer_home_page.dart'; 197 import '../pages/my/customer_type/store_customer/store_customer_home_page.dart';
197 import '../pages/my/customer_type/store_customer/store_customer_home_left_page_n.dart'; 198 import '../pages/my/customer_type/store_customer/store_customer_home_left_page_n.dart';
@@ -3213,3 +3214,13 @@ var areasSelectPageHandle = new Handler( @@ -3213,3 +3214,13 @@ var areasSelectPageHandle = new Handler(
3213 create: (_) => MyTableManageHomeModel(), 3214 create: (_) => MyTableManageHomeModel(),
3214 child: AreasSelectPage(rid: rid, name: name)); 3215 child: AreasSelectPage(rid: rid, name: name));
3215 }); 3216 });
  3217 +
  3218 +//预订数据导出
  3219 +
  3220 +var exportBookDataPageHandle = new Handler(
  3221 + handlerFunc: (BuildContext context, Map<String, List<Object>> params) {
  3222 + // String rid = params["rid"].first;
  3223 + // String name = params["name"].first;
  3224 + return ChangeNotifierProvider<CustomerProvider>(
  3225 + create: (_) => CustomerProvider(), child: ExportBookDataPage());
  3226 +});
@@ -305,6 +305,10 @@ class Routes { @@ -305,6 +305,10 @@ class Routes {
305 305
306 static String areas_select_page = "/areas_select_page"; //区域选择页面 306 static String areas_select_page = "/areas_select_page"; //区域选择页面
307 307
  308 + static String export_book_data_page = "/export_book_data_page"; //预订数据导出页面
  309 +
  310 +
  311 +
308 static void configureRoutes(FluroRouter router) { 312 static void configureRoutes(FluroRouter router) {
309 router.notFoundHandler = new Handler( 313 router.notFoundHandler = new Handler(
310 handlerFunc: (BuildContext context, Map<String, List<String>> params) { 314 handlerFunc: (BuildContext context, Map<String, List<String>> params) {
@@ -568,5 +572,9 @@ class Routes { @@ -568,5 +572,9 @@ class Routes {
568 router.define(verify_food_page, handler: verifyFoodPageHandle); 572 router.define(verify_food_page, handler: verifyFoodPageHandle);
569 573
570 router.define(areas_select_page, handler: areasSelectPageHandle); 574 router.define(areas_select_page, handler: areasSelectPageHandle);
  575 +
  576 +router.define(export_book_data_page, handler: exportBookDataPageHandle);
  577 +
  578 +
571 } 579 }
572 } 580 }
@@ -63,11 +63,9 @@ class DialogUtil { @@ -63,11 +63,9 @@ class DialogUtil {
63 static showAuthorityDestination( 63 static showAuthorityDestination(
64 BuildContext context, String name, String title, String subTitle) async { 64 BuildContext context, String name, String title, String subTitle) async {
65 Timer _timer = Timer(const Duration(seconds: 5), () { 65 Timer _timer = Timer(const Duration(seconds: 5), () {
66 -  
67 // if(!TickerMode.of(context)){ 66 // if(!TickerMode.of(context)){
68 - Navigator.of(context).pop(true); 67 + Navigator.of(context).pop(true);
69 // } 68 // }
70 -  
71 }); 69 });
72 final action = await showDialog( 70 final action = await showDialog(
73 context: context, 71 context: context,
@@ -7210,9 +7208,17 @@ class DialogUtil { @@ -7210,9 +7208,17 @@ class DialogUtil {
7210 static Future showPickerDateTime24(BuildContext context, 7208 static Future showPickerDateTime24(BuildContext context,
7211 GlobalKey<ScaffoldState> scaffoldKey, ValueChanged valueChanged, 7209 GlobalKey<ScaffoldState> scaffoldKey, ValueChanged valueChanged,
7212 {int pickerDateTimeType = PickerDateTimeType.kYMDHMS, 7210 {int pickerDateTimeType = PickerDateTimeType.kYMDHMS,
  7211 + int yearBegin,
  7212 + DateTime minValue,
7213 List<int> selecteds, 7213 List<int> selecteds,
7214 VoidCallback onCancel, 7214 VoidCallback onCancel,
7215 DateTime dateTime}) { 7215 DateTime dateTime}) {
  7216 + if (yearBegin == null) {
  7217 + yearBegin = DateTime.now().year;
  7218 + }
  7219 + if (minValue == null) {
  7220 + minValue = DateTime.now();
  7221 + }
7216 new Picker( 7222 new Picker(
7217 selecteds: selecteds, 7223 selecteds: selecteds,
7218 adapter: new DateTimePickerAdapter( 7224 adapter: new DateTimePickerAdapter(
@@ -7223,9 +7229,9 @@ class DialogUtil { @@ -7223,9 +7229,9 @@ class DialogUtil {
7223 daySuffix: "日", 7229 daySuffix: "日",
7224 minHour: 00, 7230 minHour: 00,
7225 maxHour: 23, 7231 maxHour: 23,
7226 - yearBegin: DateTime.now().year, 7232 + yearBegin: yearBegin,
7227 yearEnd: 2030, 7233 yearEnd: 2030,
7228 - minValue: DateTime.now(), 7234 + minValue: minValue,
7229 value: dateTime), 7235 value: dateTime),
7230 title: new Text(""), 7236 title: new Text(""),
7231 height: ScreenUtil().setWidth(480), 7237 height: ScreenUtil().setWidth(480),