Commit f174a346e7252c3c8e99e8ccd3c6f36a0227c4d5

Authored by wdn127929
1 parent cc65b6f4

多时段部分UI

@@ -18,19 +18,19 @@ if (flutterRoot == null) { @@ -18,19 +18,19 @@ if (flutterRoot == null) {
18 18
19 19
20 20
21 -def flutterVersionCode = "530" 21 +def flutterVersionCode = "531"
22 if (flutterVersionCode == null) { 22 if (flutterVersionCode == null) {
23 - flutterVersionCode = '530' 23 + flutterVersionCode = '531'
24 24
25 25
26 26
27 } 27 }
28 28
29 29
30 -def flutterVersionName = "5.3.0" 30 +def flutterVersionName = "5.3.1"
31 31
32 if (flutterVersionName == null) { 32 if (flutterVersionName == null) {
33 - flutterVersionName = '5.3.0' 33 + flutterVersionName = '5.3.1'
34 34
35 35
36 } 36 }
  1 +import 'package:flutter/material.dart';
  2 +import 'package:one_key/res/colors.dart';
  3 +import 'package:one_key/widgets/system_app_bar.dart';
  4 +import 'package:one_key/widgets/v_empty_view.dart';
  5 +
  6 +import '../../../utils/screen_util.dart';
  7 +import '../../../widgets/round_button.dart';
  8 +
  9 +/**
  10 + * 设置的多时段列表
  11 + */
  12 +
  13 +class BookTimeSettingListPage extends StatefulWidget {
  14 + const BookTimeSettingListPage();
  15 +
  16 + @override
  17 + State<BookTimeSettingListPage> createState() =>
  18 + _BookTimeSettingListPageState();
  19 +}
  20 +
  21 +class _BookTimeSettingListPageState extends State<BookTimeSettingListPage> {
  22 + List<Widget> listWidget() {
  23 + List<Widget> datas = [];
  24 + for (int i = 0; i < 10; i++) {
  25 + datas.add(
  26 + Text(
  27 + '25-01-28 除夕',
  28 + style: TextStyle(fontSize: font(10), color: MyColours.color_515151),
  29 + ),
  30 + );
  31 + }
  32 + return datas;
  33 + }
  34 +
  35 + List<Widget> listWidgetTime() {
  36 + List<Widget> datas = [];
  37 + for (int i = 0; i < 10; i++) {
  38 + datas.add(
  39 + Text(
  40 + '25-01-28 除夕',
  41 + style: TextStyle(fontSize: font(10), color: MyColours.color_515151),
  42 + ),
  43 + );
  44 + }
  45 + return datas;
  46 + }
  47 +
  48 + @override
  49 + Widget build(BuildContext context) {
  50 + return Scaffold(
  51 + backgroundColor: MyColours.color_f3f3f3,
  52 + appBar: SystemAppBar('多时段预订'),
  53 + body: Column(
  54 + children: [
  55 + VEmptyView(32),
  56 + Expanded(
  57 + child: ListView.builder(
  58 + itemCount: 10,
  59 + shrinkWrap: true,
  60 + itemBuilder: (context, index) {
  61 + return Container(
  62 + margin: EdgeInsets.only(
  63 + left: w(20), right: w(20), bottom: w(10)),
  64 + decoration: BoxDecoration(
  65 + borderRadius: BorderRadius.circular(r(8))),
  66 + child: Column(
  67 + children: [
  68 + Container(
  69 + height: w(33),
  70 + decoration: BoxDecoration(
  71 + color: MyColours.color_438E93,
  72 + borderRadius: BorderRadius.only(
  73 + topLeft: Radius.circular(r(8)),
  74 + topRight: Radius.circular(r(8)),
  75 + )),
  76 + child: Row(
  77 + children: [
  78 + Text(
  79 + '每周固定/指定日期',
  80 + style: TextStyle(
  81 + fontSize: font(18),
  82 + color: MyColours.color_ffffff),
  83 + )
  84 + ],
  85 + ),
  86 + ),
  87 + VEmptyView(16),
  88 + Wrap(
  89 + spacing: w(10),
  90 + children: listWidget(),
  91 + ),
  92 + ],
  93 + ),
  94 + );
  95 + })),
  96 + Container(
  97 + color: MyColours.color_ffffff,
  98 + padding: EdgeInsets.only(
  99 + left: w(45), top: w(12), bottom: w(25), right: w(45)),
  100 + child: RoundButton(
  101 + text: '保存',
  102 + // width: ScreenUtil().setWidth(280 * 2),
  103 + height: w(41),
  104 + radius: r(5),
  105 + isBold: true,
  106 + fontSize: 32,
  107 + onPressed: () {}))
  108 + ],
  109 + ),
  110 + );
  111 + }
  112 +}
@@ -85,6 +85,12 @@ class _StoreBaseInfoPageState extends State<StoreBaseInfoPage> { @@ -85,6 +85,12 @@ class _StoreBaseInfoPageState extends State<StoreBaseInfoPage> {
85 MarketingCenterProvider marketingCenterProvider; 85 MarketingCenterProvider marketingCenterProvider;
86 List<String> imgAll = []; 86 List<String> imgAll = [];
87 87
  88 + TextEditingController _booktime1 = TextEditingController();
  89 + TextEditingController _booktime2 = TextEditingController();
  90 + TextEditingController _booktime3 = TextEditingController();
  91 + TextEditingController _booktime4 = TextEditingController();
  92 + TextEditingController _booktime5 = TextEditingController();
  93 +
88 ///获取接单时间接口 94 ///获取接单时间接口
89 _getReceiveOrdersTime() async { 95 _getReceiveOrdersTime() async {
90 GetSellerInfoSunModel model = await bookSetTimeModel.getSellerById(context); 96 GetSellerInfoSunModel model = await bookSetTimeModel.getSellerById(context);
@@ -110,6 +116,12 @@ class _StoreBaseInfoPageState extends State<StoreBaseInfoPage> { @@ -110,6 +116,12 @@ class _StoreBaseInfoPageState extends State<StoreBaseInfoPage> {
110 @override 116 @override
111 void initState() { 117 void initState() {
112 super.initState(); 118 super.initState();
  119 +
  120 + _booktime1.text = '早茶';
  121 + _booktime2.text = '午餐';
  122 + _booktime3.text = '晚餐';
  123 + _booktime4.text = '夜宵';
  124 +
113 mapAddress = { 125 mapAddress = {
114 "address": '点击选择', 126 "address": '点击选择',
115 'lat': '', 127 'lat': '',
@@ -121,7 +133,7 @@ class _StoreBaseInfoPageState extends State<StoreBaseInfoPage> { @@ -121,7 +133,7 @@ class _StoreBaseInfoPageState extends State<StoreBaseInfoPage> {
121 noon.end = '14:30'; 133 noon.end = '14:30';
122 night.start = '16:00'; 134 night.start = '16:00';
123 night.end = '21:00'; 135 night.end = '21:00';
124 - swichState = [false, true, true]; 136 + swichState = [false, true, true, false, false];
125 Utils.changeStatusColor(color: MyColours.color_F8F9FD); 137 Utils.changeStatusColor(color: MyColours.color_F8F9FD);
126 _scrollController = ScrollController(); 138 _scrollController = ScrollController();
127 receiveOrdersTime.start = '08:00'; 139 receiveOrdersTime.start = '08:00';
@@ -762,7 +774,7 @@ class _StoreBaseInfoPageState extends State<StoreBaseInfoPage> { @@ -762,7 +774,7 @@ class _StoreBaseInfoPageState extends State<StoreBaseInfoPage> {
762 context, afterImg, 774 context, afterImg,
763 needResize: true); 775 needResize: true);
764 776
765 - print(Utils.size(newImg.length)); 777 + print(Utils.size(newImg.length));
766 if (newImg != null) { 778 if (newImg != null) {
767 String path = await Utils.saveImage(newImg); 779 String path = await Utils.saveImage(newImg);
768 if (path == null) { 780 if (path == null) {
@@ -1295,26 +1307,77 @@ class _StoreBaseInfoPageState extends State<StoreBaseInfoPage> { @@ -1295,26 +1307,77 @@ class _StoreBaseInfoPageState extends State<StoreBaseInfoPage> {
1295 ); 1307 );
1296 } 1308 }
1297 1309
1298 - Widget _itemMorningNoonAngNight(String title, int tag) {  
1299 - return InkWell(  
1300 - onTap: () {  
1301 - setState(() {  
1302 - swichState[tag] = !swichState[tag];  
1303 - });  
1304 - },  
1305 - child: Row(  
1306 - mainAxisAlignment: MainAxisAlignment.spaceBetween,  
1307 - children: [  
1308 - Text(title,  
1309 - style: TextStyle(  
1310 - fontSize: ScreenUtil().setSp(28),  
1311 - color: MyColours.color_999999)),  
1312 - Image.asset(  
1313 - Utils.getImgPath(  
1314 - swichState[tag] ? 'store_swich_on' : 'store_swich_off'),  
1315 - width: ScreenUtil().setWidth(38 * 2)),  
1316 - ],  
1317 - ), 1310 + Widget _itemMorningNoonAngNight(int tag, TextEditingController booktimes) {
  1311 + return Row(
  1312 + mainAxisAlignment: MainAxisAlignment.spaceBetween,
  1313 + children: [
  1314 + Expanded(
  1315 + child: Container(
  1316 + // height: ScreenUtil().setWidth(50),
  1317 + // padding: EdgeInsets.symmetric(horizontal: ScreenUtil().setWidth(24)),
  1318 + decoration: BoxDecoration(
  1319 + color: MyColours.color_F8F9FD,
  1320 + borderRadius: BorderRadius.circular(ScreenUtil().setWidth(28))),
  1321 + child: TextField(
  1322 + controller: booktimes,
  1323 + maxLines: 1,
  1324 + // inputFormatters: [
  1325 + // LengthLimitingTextInputFormatter(
  1326 + // 15),
  1327 + // // FilteringTextInputFormatter.digitsOnly
  1328 + // ],
  1329 +
  1330 + // //光标颜色
  1331 + // cursorColor:
  1332 + // widget.isSelect ? Colors.white : MyColours.color_199095,
  1333 + //输入文本的样式
  1334 + style: TextStyle(
  1335 + fontSize: ScreenUtil().setSp(28),
  1336 + color: MyColours.color_515151),
  1337 + focusNode: _phoneFocusNode,
  1338 + decoration: InputDecoration(
  1339 + border: OutlineInputBorder(borderSide: BorderSide.none),
  1340 + hintText: '请输入餐段名称',
  1341 + hintStyle: TextStyle(
  1342 + color: MyColours.color_BFC4D4,
  1343 + fontSize: ScreenUtil().setSp(28),
  1344 + ),
  1345 + contentPadding: EdgeInsets.zero,
  1346 + isCollapsed: true, //重点,相当于高度包裹的意思,必须设置为true,不然有默认奇妙的最小高度
  1347 + enabledBorder: new UnderlineInputBorder(
  1348 + borderSide: BorderSide.none,
  1349 + ),
  1350 +
  1351 + focusedBorder: new UnderlineInputBorder(
  1352 + borderSide: BorderSide.none,
  1353 + ),
  1354 + ),
  1355 + onChanged: (value) {
  1356 + // if (editingController == _nameController) {
  1357 + // _nameController.text = value;
  1358 + // }
  1359 + },
  1360 + onEditingComplete: () {
  1361 + FocusScope.of(context).requestFocus(FocusNode()); //点击空白处隐藏键盘
  1362 + },
  1363 + keyboardType: TextInputType.text,
  1364 + ),
  1365 + )),
  1366 + // Text(title,
  1367 + // style: TextStyle(
  1368 + // fontSize: ScreenUtil().setSp(28),
  1369 + // color: MyColours.color_999999)),
  1370 + InkWell(
  1371 + onTap: () {
  1372 + setState(() {
  1373 + swichState[tag] = !swichState[tag];
  1374 + });
  1375 + },
  1376 + child: Image.asset(
  1377 + Utils.getImgPath(
  1378 + swichState[tag] ? 'store_swich_on' : 'store_swich_off'),
  1379 + width: ScreenUtil().setWidth(38 * 2))),
  1380 + ],
1318 ); 1381 );
1319 } 1382 }
1320 1383
@@ -2113,27 +2176,73 @@ class _StoreBaseInfoPageState extends State<StoreBaseInfoPage> { @@ -2113,27 +2176,73 @@ class _StoreBaseInfoPageState extends State<StoreBaseInfoPage> {
2113 ), 2176 ),
2114 child: Column( 2177 child: Column(
2115 children: [ 2178 children: [
2116 - _itemMorningNoonAngNight('早市:', 0), 2179 + _itemMorningNoonAngNight(0, _booktime1),
2117 VEmptyView(34), 2180 VEmptyView(34),
2118 swichState[0] 2181 swichState[0]
2119 ? _itemBookTime( 2182 ? _itemBookTime(
2120 morning.start, morning.end, 0) 2183 morning.start, morning.end, 0)
2121 : SizedBox(), 2184 : SizedBox(),
2122 VEmptyView(32), 2185 VEmptyView(32),
2123 - _itemMorningNoonAngNight('午市:', 1), 2186 + _itemMorningNoonAngNight(1, _booktime2),
2124 VEmptyView(34), 2187 VEmptyView(34),
2125 swichState[1] 2188 swichState[1]
2126 ? _itemBookTime(noon.start, noon.end, 1) 2189 ? _itemBookTime(noon.start, noon.end, 1)
2127 : SizedBox(), 2190 : SizedBox(),
2128 VEmptyView(32), 2191 VEmptyView(32),
2129 - _itemMorningNoonAngNight('晚市:', 2), 2192 + _itemMorningNoonAngNight(2, _booktime3),
2130 VEmptyView(34), 2193 VEmptyView(34),
2131 swichState[2] 2194 swichState[2]
2132 ? _itemBookTime( 2195 ? _itemBookTime(
2133 night.start, night.end, 2) 2196 night.start, night.end, 2)
2134 : SizedBox(), 2197 : SizedBox(),
  2198 + VEmptyView(32),
  2199 + _itemMorningNoonAngNight(3, _booktime4),
  2200 + VEmptyView(34),
  2201 + swichState[3]
  2202 + ? _itemBookTime(
  2203 + night.start, night.end, 3)
  2204 + : SizedBox(),
  2205 + VEmptyView(32),
  2206 + _itemMorningNoonAngNight(4, _booktime5),
  2207 + VEmptyView(34),
  2208 + swichState[4]
  2209 + ? _itemBookTime(
  2210 + night.start, night.end, 4)
  2211 + : SizedBox(),
2135 ], 2212 ],
2136 )), 2213 )),
  2214 + VEmptyView(34),
  2215 + InkWell(
  2216 + onTap: () {
  2217 + NavigatorUtil.goBookTimeSettingListPage(
  2218 + context);
  2219 + },
  2220 + child: Padding(
  2221 + padding: EdgeInsets.symmetric(
  2222 + horizontal: ScreenUtil().setWidth(24)),
  2223 + child: Container(
  2224 + height: ScreenUtil().setWidth(40),
  2225 + child: Row(
  2226 + crossAxisAlignment:
  2227 + CrossAxisAlignment.center,
  2228 + mainAxisAlignment:
  2229 + MainAxisAlignment.spaceBetween,
  2230 + children: [
  2231 + Text('指定日期多时段预订设置',
  2232 + style: TextStyle(
  2233 + color: MyColours.color_999999,
  2234 + fontSize:
  2235 + ScreenUtil().setSp(28),
  2236 + )),
  2237 + Spacer(),
  2238 + Image.asset(
  2239 + Utils.getImgPath('arrow_right_new'),
  2240 + width: ScreenUtil().setWidth(16),
  2241 + height: ScreenUtil().setWidth(28),
  2242 + )
  2243 + ],
  2244 + ),
  2245 + ))),
2137 VEmptyView(96), 2246 VEmptyView(96),
2138 Text('接单时间', 2247 Text('接单时间',
2139 style: TextStyle( 2248 style: TextStyle(
@@ -2267,5 +2267,16 @@ class NavigatorUtil { @@ -2267,5 +2267,16 @@ class NavigatorUtil {
2267 } 2267 }
2268 2268
2269 2269
  2270 +
  2271 +///多时段预订设置列表
  2272 + static Future<dynamic> goBookTimeSettingListPage(
  2273 + BuildContext context, {
  2274 +
  2275 + replace = false,
  2276 + }) {
  2277 + return _navigateTo(context, "${Routes.book_time_setting_list_page}",
  2278 + replace: replace);
  2279 + }
  2280 +
2270 2281
2271 } 2282 }
@@ -199,6 +199,7 @@ import '../pages/login/collect_store_info_page.dart'; @@ -199,6 +199,7 @@ import '../pages/login/collect_store_info_page.dart';
199 import '../pages/login/complete_create_store.dart'; 199 import '../pages/login/complete_create_store.dart';
200 import '../pages/login/web_page.dart'; 200 import '../pages/login/web_page.dart';
201 import '../pages/message/message_recharge_info_page.dart'; 201 import '../pages/message/message_recharge_info_page.dart';
  202 +import '../pages/my/book_time_setting/book_time_setting_list_page.dart';
202 import '../pages/my/comment_manage/comment_manage_home_page.dart'; 203 import '../pages/my/comment_manage/comment_manage_home_page.dart';
203 import '../pages/my/customer_type/my_customer/my_customer_home_page.dart'; 204 import '../pages/my/customer_type/my_customer/my_customer_home_page.dart';
204 import '../pages/my/customer_type/store_customer/day_order_page.dart'; 205 import '../pages/my/customer_type/store_customer/day_order_page.dart';
@@ -3892,3 +3893,21 @@ var wineSettingMsgPageHandle = new Handler( @@ -3892,3 +3893,21 @@ var wineSettingMsgPageHandle = new Handler(
3892 child: WineSettingMsgPage())); 3893 child: WineSettingMsgPage()));
3893 }); 3894 });
3894 3895
  3896 +
  3897 +
  3898 +
  3899 +
  3900 +///多时段预订设置列表
  3901 +var bookTimeSettingListPageHandle = new Handler(
  3902 + handlerFunc: (BuildContext context, Map<String, List<Object>> params) {
  3903 + // String rid = params["rid"].first;
  3904 + // // String smsTemplate = params["smsTemplate"].first;
  3905 + // CouponUse use = CouponUse.fromJson(
  3906 + // json.decode(FluroConvertUtils.fluroCnParamsDecode(params["use"].first)));
  3907 + // CouponSunModel couponSunModel = CouponSunModel.fromJson(json.decode(
  3908 + // FluroConvertUtils.fluroCnParamsDecode(params["couponSunModel"].first)));
  3909 + return ChangeNotifierProvider<MarketingCenterProvider>(
  3910 + create: (_) => MarketingCenterProvider(),
  3911 + child: BookTimeSettingListPage());
  3912 +});
  3913 +
@@ -390,7 +390,12 @@ class Routes { @@ -390,7 +390,12 @@ class Routes {
390 390
391 static String wine_setting_msg_page = 391 static String wine_setting_msg_page =
392 "/wine_setting_msg_page"; //存酒短信模版设置 392 "/wine_setting_msg_page"; //存酒短信模版设置
  393 +
  394 +
  395 + static String book_time_setting_list_page =
  396 + "/book_time_setting_list_page"; //多时段预订列表
393 397
  398 +
394 399
395 400
396 401
@@ -733,6 +738,9 @@ router.define(select_table_f_or_reserve, handler: handleSelectTableFOrReserveHan @@ -733,6 +738,9 @@ router.define(select_table_f_or_reserve, handler: handleSelectTableFOrReserveHan
733 738
734 router.define(mini_program_setting_page, handler: miniprogramSettingPageHandle); 739 router.define(mini_program_setting_page, handler: miniprogramSettingPageHandle);
735 router.define(wine_setting_msg_page, handler:wineSettingMsgPageHandle); 740 router.define(wine_setting_msg_page, handler:wineSettingMsgPageHandle);
  741 +
  742 + router.define(book_time_setting_list_page, handler:bookTimeSettingListPageHandle);
  743 +
736 744
737 745
738 746