Showing
4 changed files
with
175 additions
and
145 deletions
| @@ -99,9 +99,9 @@ class _NoteBookChangeFPageOnlyState extends State<NoteBookChangeFPageOnly> { | @@ -99,9 +99,9 @@ class _NoteBookChangeFPageOnlyState extends State<NoteBookChangeFPageOnly> { | ||
| 99 | String dateText = ""; //当前显示日期时间 | 99 | String dateText = ""; //当前显示日期时间 |
| 100 | 100 | ||
| 101 | int currTimeIndex = 2; | 101 | int currTimeIndex = 2; |
| 102 | - String? morning; //早市时间段 | ||
| 103 | - String? noon; //午市时间段 | ||
| 104 | - String? night; //晚市时间段 | 102 | + // String? morning; //早市时间段 |
| 103 | + // String? noon; //午市时间段 | ||
| 104 | + // String? night; //晚市时间段 | ||
| 105 | NotebookDetail? detailEntity; | 105 | NotebookDetail? detailEntity; |
| 106 | 106 | ||
| 107 | late StoreBaseIndoProvider storeBaseIndoProvider; | 107 | late StoreBaseIndoProvider storeBaseIndoProvider; |
| @@ -115,13 +115,13 @@ class _NoteBookChangeFPageOnlyState extends State<NoteBookChangeFPageOnly> { | @@ -115,13 +115,13 @@ class _NoteBookChangeFPageOnlyState extends State<NoteBookChangeFPageOnly> { | ||
| 115 | void initState() { | 115 | void initState() { |
| 116 | super.initState(); | 116 | super.initState(); |
| 117 | 117 | ||
| 118 | - if (App.sp!.containsKey('user')) { | ||
| 119 | - String s = App.sp!.getString('user')!; | ||
| 120 | - User _user = User.fromJson(json.decode(s)); | ||
| 121 | - morning = _user.morning!.isEmpty ? "00:00-00:00" : _user.morning; | ||
| 122 | - noon = _user.noon!.isEmpty ? "00:00-00:00" : _user.noon; | ||
| 123 | - night = _user.night!.isEmpty ? "00:00-00:00" : _user.night; | ||
| 124 | - } | 118 | + // if (App.sp!.containsKey('user')) { |
| 119 | + // String s = App.sp!.getString('user')!; | ||
| 120 | + // User _user = User.fromJson(json.decode(s)); | ||
| 121 | + // morning = _user.morning!.isEmpty ? "00:00-00:00" : _user.morning; | ||
| 122 | + // noon = _user.noon!.isEmpty ? "00:00-00:00" : _user.noon; | ||
| 123 | + // night = _user.night!.isEmpty ? "00:00-00:00" : _user.night; | ||
| 124 | + // } | ||
| 125 | 125 | ||
| 126 | _nameNode.addListener(() { | 126 | _nameNode.addListener(() { |
| 127 | if (_nameNode.hasFocus) { | 127 | if (_nameNode.hasFocus) { |
| @@ -271,14 +271,17 @@ class _NoteBookChangeFPageOnlyState extends State<NoteBookChangeFPageOnly> { | @@ -271,14 +271,17 @@ class _NoteBookChangeFPageOnlyState extends State<NoteBookChangeFPageOnly> { | ||
| 271 | 271 | ||
| 272 | print(detailEntity); | 272 | print(detailEntity); |
| 273 | if (detailEntity!.phone != '0') { | 273 | if (detailEntity!.phone != '0') { |
| 274 | - _notebookDetailChangeModel.phoneController.text = detailEntity!.phone??""; | 274 | + _notebookDetailChangeModel.phoneController.text = |
| 275 | + detailEntity!.phone ?? ""; | ||
| 275 | } | 276 | } |
| 276 | if (detailEntity!.rnameStr != '') { | 277 | if (detailEntity!.rnameStr != '') { |
| 277 | - _notebookDetailChangeModel.nameController.text = detailEntity!.rname??""; | 278 | + _notebookDetailChangeModel.nameController.text = |
| 279 | + detailEntity!.rname ?? ""; | ||
| 278 | } | 280 | } |
| 279 | 281 | ||
| 280 | if (detailEntity!.cusdem != '' && detailEntity!.cusdem != null) { | 282 | if (detailEntity!.cusdem != '' && detailEntity!.cusdem != null) { |
| 281 | - _notebookDetailChangeModel.customController.text = detailEntity!.cusdem??""; | 283 | + _notebookDetailChangeModel.customController.text = |
| 284 | + detailEntity!.cusdem ?? ""; | ||
| 282 | } | 285 | } |
| 283 | 286 | ||
| 284 | _notebookDetailChangeModel.initSexList(); | 287 | _notebookDetailChangeModel.initSexList(); |
| @@ -798,11 +801,11 @@ class _NoteBookChangeFPageOnlyState extends State<NoteBookChangeFPageOnly> { | @@ -798,11 +801,11 @@ class _NoteBookChangeFPageOnlyState extends State<NoteBookChangeFPageOnly> { | ||
| 798 | // }); | 801 | // }); |
| 799 | // } | 802 | // } |
| 800 | _getContactData() async { | 803 | _getContactData() async { |
| 801 | - Contact? contact = await _contactPicker.selectPhoneNumber(); | 804 | + Contact? contact = await _contactPicker.selectPhoneNumber(); |
| 802 | if (contact != null) { | 805 | if (contact != null) { |
| 803 | setState(() { | 806 | setState(() { |
| 804 | String? fullName = | 807 | String? fullName = |
| 805 | - contact.fullName?.replaceAll(new RegExp(r"\s+\b|\b\s"), "") ??''; | 808 | + contact.fullName?.replaceAll(new RegExp(r"\s+\b|\b\s"), "") ?? ''; |
| 806 | // String phone = (contact.phoneNumbers![0] | 809 | // String phone = (contact.phoneNumbers![0] |
| 807 | // .replaceAll(new RegExp(r"\s+\b|\b\s"), "")); | 810 | // .replaceAll(new RegExp(r"\s+\b|\b\s"), "")); |
| 808 | // if (fullName == null) { | 811 | // if (fullName == null) { |
| @@ -811,7 +814,8 @@ class _NoteBookChangeFPageOnlyState extends State<NoteBookChangeFPageOnly> { | @@ -811,7 +814,8 @@ class _NoteBookChangeFPageOnlyState extends State<NoteBookChangeFPageOnly> { | ||
| 811 | // fullName = contact.fullName!; | 814 | // fullName = contact.fullName!; |
| 812 | // } | 815 | // } |
| 813 | _notebookDetailChangeModel.phoneController.text = | 816 | _notebookDetailChangeModel.phoneController.text = |
| 814 | - (contact.selectedPhoneNumber?.replaceAll(new RegExp(r"\s+"), ""))??''; | 817 | + (contact.selectedPhoneNumber?.replaceAll(new RegExp(r"\s+"), "")) ?? |
| 818 | + ''; | ||
| 815 | nameStr = fullName; | 819 | nameStr = fullName; |
| 816 | // _homeEnterModel.nameController.text = fullName + _nameSuffix(); | 820 | // _homeEnterModel.nameController.text = fullName + _nameSuffix(); |
| 817 | _addNameSuffix(fullName, _nameSuffix()); | 821 | _addNameSuffix(fullName, _nameSuffix()); |
| @@ -1012,15 +1016,14 @@ class _NoteBookChangeFPageOnlyState extends State<NoteBookChangeFPageOnly> { | @@ -1012,15 +1016,14 @@ class _NoteBookChangeFPageOnlyState extends State<NoteBookChangeFPageOnly> { | ||
| 1012 | //如果不允许变更过去餐段订单的时间,则开始判断 | 1016 | //如果不允许变更过去餐段订单的时间,则开始判断 |
| 1013 | //连个条件同时成立: 1.订单的时间是过去 2. 时间改变 | 1017 | //连个条件同时成立: 1.订单的时间是过去 2. 时间改变 |
| 1014 | if (!isSetOver) { | 1018 | if (!isSetOver) { |
| 1015 | - String? times; | 1019 | + String? times = '00:00-00:00'; |
| 1016 | //找到当前餐段对应的时间段 | 1020 | //找到当前餐段对应的时间段 |
| 1017 | - if (currTimeIndex == 1) { | ||
| 1018 | - times = morning; | ||
| 1019 | - } else if (currTimeIndex == 2) { | ||
| 1020 | - times = noon; | ||
| 1021 | - } else if (currTimeIndex == 3) { | ||
| 1022 | - times = night; | 1021 | + int index = storeBaseIndoProvider.dayDateData! |
| 1022 | + .indexWhere((element) => element.ddateSolt == '${currTimeIndex}'); | ||
| 1023 | + if (index != -1) { | ||
| 1024 | + times = storeBaseIndoProvider.dayDateData![index].mdate; | ||
| 1023 | } | 1025 | } |
| 1026 | + | ||
| 1024 | //else if (currTimeIndex == 4) { | 1027 | //else if (currTimeIndex == 4) { |
| 1025 | // times = meal1; | 1028 | // times = meal1; |
| 1026 | // } else if (currTimeIndex == 5) { | 1029 | // } else if (currTimeIndex == 5) { |
| @@ -1308,22 +1311,26 @@ class _NoteBookChangeFPageOnlyState extends State<NoteBookChangeFPageOnly> { | @@ -1308,22 +1311,26 @@ class _NoteBookChangeFPageOnlyState extends State<NoteBookChangeFPageOnly> { | ||
| 1308 | 1311 | ||
| 1309 | //选中的时间+餐段组合的时间戳结束日期和现在比较,< 现在,则会变更到过去 | 1312 | //选中的时间+餐段组合的时间戳结束日期和现在比较,< 现在,则会变更到过去 |
| 1310 | 1313 | ||
| 1311 | - String? times; | 1314 | + String times = '00:00-00:00'; |
| 1315 | + //找到当前餐段对应的时间段 | ||
| 1312 | //找到当前餐段对应的时间段 | 1316 | //找到当前餐段对应的时间段 |
| 1313 | - if (currTimeIndex == 1) { | ||
| 1314 | - times = morning; | ||
| 1315 | - } else if (currTimeIndex == 2) { | ||
| 1316 | - times = noon; | ||
| 1317 | - } else if (currTimeIndex == 3) { | ||
| 1318 | - times = night; | 1317 | + int index = storeBaseIndoProvider |
| 1318 | + .dayDateData! | ||
| 1319 | + .indexWhere((element) => | ||
| 1320 | + element.ddateSolt == | ||
| 1321 | + '${currTimeIndex}'); | ||
| 1322 | + if (index != -1) { | ||
| 1323 | + times = storeBaseIndoProvider | ||
| 1324 | + .dayDateData![index].mdate!; | ||
| 1319 | } | 1325 | } |
| 1326 | + | ||
| 1320 | //else if (currTimeIndex == 4) { | 1327 | //else if (currTimeIndex == 4) { |
| 1321 | // times = meal1; | 1328 | // times = meal1; |
| 1322 | // } else if (currTimeIndex == 5) { | 1329 | // } else if (currTimeIndex == 5) { |
| 1323 | // times = meal2; | 1330 | // times = meal2; |
| 1324 | // } | 1331 | // } |
| 1325 | //组装时间戳 | 1332 | //组装时间戳 |
| 1326 | - List<String> datas = times!.split('-'); | 1333 | + List<String> datas = times.split('-'); |
| 1327 | // DateTime selectStime = DateTime.parse('${dateTimeSelect.year}' + | 1334 | // DateTime selectStime = DateTime.parse('${dateTimeSelect.year}' + |
| 1328 | // '-' + | 1335 | // '-' + |
| 1329 | // '${dateTimeSelect.month}' + | 1336 | // '${dateTimeSelect.month}' + |
| @@ -2329,6 +2336,16 @@ class _NoteBookChangeFPageOnlyState extends State<NoteBookChangeFPageOnly> { | @@ -2329,6 +2336,16 @@ class _NoteBookChangeFPageOnlyState extends State<NoteBookChangeFPageOnly> { | ||
| 2329 | FocusScope.of(context) | 2336 | FocusScope.of(context) |
| 2330 | .requestFocus(FocusNode()); //点击空白处隐藏键盘 | 2337 | .requestFocus(FocusNode()); //点击空白处隐藏键盘 |
| 2331 | print(detailEntity!.uid); | 2338 | print(detailEntity!.uid); |
| 2339 | + String? times = '00:00-00:00'; | ||
| 2340 | + //找到当前餐段对应的时间段 | ||
| 2341 | + int index = storeBaseIndoProvider.dayDateData! | ||
| 2342 | + .indexWhere((element) => | ||
| 2343 | + element.ddateSolt == | ||
| 2344 | + '${currTimeIndex}'); | ||
| 2345 | + if (index != -1) { | ||
| 2346 | + times = storeBaseIndoProvider | ||
| 2347 | + .dayDateData![index].mdate; | ||
| 2348 | + } | ||
| 2332 | 2349 | ||
| 2333 | SunReserveInfoModel? _model = | 2350 | SunReserveInfoModel? _model = |
| 2334 | _notebookDetailChangeModel | 2351 | _notebookDetailChangeModel |
| @@ -2342,9 +2359,7 @@ class _NoteBookChangeFPageOnlyState extends State<NoteBookChangeFPageOnly> { | @@ -2342,9 +2359,7 @@ class _NoteBookChangeFPageOnlyState extends State<NoteBookChangeFPageOnly> { | ||
| 2342 | detailEntity!.uid, | 2359 | detailEntity!.uid, |
| 2343 | currTimeIndex, | 2360 | currTimeIndex, |
| 2344 | dateTime, | 2361 | dateTime, |
| 2345 | - morning, | ||
| 2346 | - noon, | ||
| 2347 | - night) | 2362 | + times ) |
| 2348 | : await _notebookDetailChangeModel | 2363 | : await _notebookDetailChangeModel |
| 2349 | .setReserveInfoOnly( | 2364 | .setReserveInfoOnly( |
| 2350 | context, | 2365 | context, |
| @@ -2352,9 +2367,7 @@ class _NoteBookChangeFPageOnlyState extends State<NoteBookChangeFPageOnly> { | @@ -2352,9 +2367,7 @@ class _NoteBookChangeFPageOnlyState extends State<NoteBookChangeFPageOnly> { | ||
| 2352 | detailEntity!.uid, | 2367 | detailEntity!.uid, |
| 2353 | currTimeIndex, | 2368 | currTimeIndex, |
| 2354 | dateTime, | 2369 | dateTime, |
| 2355 | - morning, | ||
| 2356 | - noon, | ||
| 2357 | - night); | 2370 | + times ); |
| 2358 | if (_model != null) { | 2371 | if (_model != null) { |
| 2359 | if (ObjectUtil.isNotEmpty(_model.row) || | 2372 | if (ObjectUtil.isNotEmpty(_model.row) || |
| 2360 | ObjectUtil.isNotEmpty(_model.row!.id)) { | 2373 | ObjectUtil.isNotEmpty(_model.row!.id)) { |
| @@ -394,40 +394,43 @@ class NotebookDetailPageState extends State<NotebookDetailPage> { | @@ -394,40 +394,43 @@ class NotebookDetailPageState extends State<NotebookDetailPage> { | ||
| 394 | _initTime(int dateSolt) { | 394 | _initTime(int dateSolt) { |
| 395 | ddateHm = detailModel!.detailModelAllSunModel!.ddateStr; | 395 | ddateHm = detailModel!.detailModelAllSunModel!.ddateStr; |
| 396 | // UserModel userModel = Provider.of<UserModel>(context, listen: false); | 396 | // UserModel userModel = Provider.of<UserModel>(context, listen: false); |
| 397 | - String str = detailModel!.detailModelAllSunModel!.mdate == null | 397 | + String str = detailModel!.detailModelAllSunModel!.mdate == null || detailModel!.detailModelAllSunModel!.mdate == '' |
| 398 | ? "00:00-00:00" | 398 | ? "00:00-00:00" |
| 399 | : detailModel!.detailModelAllSunModel!.mdate!; | 399 | : detailModel!.detailModelAllSunModel!.mdate!; |
| 400 | - if (dateSolt == 1) { | ||
| 401 | - //早餐 | ||
| 402 | - | ||
| 403 | - str == "00:00-00:00" | ||
| 404 | - ? dailyList = [] | ||
| 405 | - : dailyList = _getHourAndMinute(str, 1); | ||
| 406 | - } else if (dateSolt == 2) { | ||
| 407 | - //午餐 | ||
| 408 | - | ||
| 409 | - str == "00:00-00:00" | 400 | + str == "00:00-00:00" |
| 410 | ? dailyList = [] | 401 | ? dailyList = [] |
| 411 | - : dailyList = _getHourAndMinute(str, 2); | ||
| 412 | - } else if (dateSolt == 3) { | ||
| 413 | - //晚餐 | ||
| 414 | - | ||
| 415 | - str == "00:00-00:00" | ||
| 416 | - ? dailyList = [] | ||
| 417 | - : dailyList = _getHourAndMinute(str, 3); | ||
| 418 | - } else if (dateSolt == 4) { | ||
| 419 | - //晚餐 | ||
| 420 | - | ||
| 421 | - str == "00:00-00:00" | ||
| 422 | - ? dailyList = [] | ||
| 423 | - : dailyList = _getHourAndMinute(str, 4); | ||
| 424 | - } else if (dateSolt == 5) { | ||
| 425 | - //晚餐 | ||
| 426 | - | ||
| 427 | - str == "00:00-00:00" | ||
| 428 | - ? dailyList = [] | ||
| 429 | - : dailyList = _getHourAndMinute(str, 5); | ||
| 430 | - } | 402 | + : dailyList = _getHourAndMinute(str, dateSolt ); |
| 403 | + // if (dateSolt == 1) { | ||
| 404 | + // //早餐 | ||
| 405 | + | ||
| 406 | + // str == "00:00-00:00" | ||
| 407 | + // ? dailyList = [] | ||
| 408 | + // : dailyList = _getHourAndMinute(str, 1); | ||
| 409 | + // } else if (dateSolt == 2) { | ||
| 410 | + // //午餐 | ||
| 411 | + | ||
| 412 | + // str == "00:00-00:00" | ||
| 413 | + // ? dailyList = [] | ||
| 414 | + // : dailyList = _getHourAndMinute(str, 2); | ||
| 415 | + // } else if (dateSolt == 3) { | ||
| 416 | + // //晚餐 | ||
| 417 | + | ||
| 418 | + // str == "00:00-00:00" | ||
| 419 | + // ? dailyList = [] | ||
| 420 | + // : dailyList = _getHourAndMinute(str, 3); | ||
| 421 | + // } else if (dateSolt == 4) { | ||
| 422 | + // //晚餐 | ||
| 423 | + | ||
| 424 | + // str == "00:00-00:00" | ||
| 425 | + // ? dailyList = [] | ||
| 426 | + // : dailyList = _getHourAndMinute(str, 4); | ||
| 427 | + // } else if (dateSolt == 5) { | ||
| 428 | + // //晚餐 | ||
| 429 | + | ||
| 430 | + // str == "00:00-00:00" | ||
| 431 | + // ? dailyList = [] | ||
| 432 | + // : dailyList = _getHourAndMinute(str, 5); | ||
| 433 | + // } | ||
| 431 | } | 434 | } |
| 432 | 435 | ||
| 433 | // //根据获取时间 11:00-12:30 获取30分钟间隔组装的数组 | 436 | // //根据获取时间 11:00-12:30 获取30分钟间隔组装的数组 |
| @@ -1240,40 +1240,43 @@ class InvicationPageState extends State<InvicationPage> | @@ -1240,40 +1240,43 @@ class InvicationPageState extends State<InvicationPage> | ||
| 1240 | ///初始化时间 半个小时 | 1240 | ///初始化时间 半个小时 |
| 1241 | _initTime(int dateSolt) { | 1241 | _initTime(int dateSolt) { |
| 1242 | // UserModel userModel = Provider.of<UserModel>(context, listen: false); | 1242 | // UserModel userModel = Provider.of<UserModel>(context, listen: false); |
| 1243 | - String str = detailModel.detailModelAllSunModel!.mdate == null | 1243 | + String str = detailModel.detailModelAllSunModel!.mdate == null||detailModel.detailModelAllSunModel!.mdate == '' |
| 1244 | ? "00:00-00:00" | 1244 | ? "00:00-00:00" |
| 1245 | : detailModel.detailModelAllSunModel!.mdate!; | 1245 | : detailModel.detailModelAllSunModel!.mdate!; |
| 1246 | - if (dateSolt == 1) { | ||
| 1247 | - //早餐 | ||
| 1248 | - | ||
| 1249 | - str == "00:00-00:00" | ||
| 1250 | - ? dailyList = [] | ||
| 1251 | - : dailyList = _getHourAndMinute(str, 1); | ||
| 1252 | - } else if (dateSolt == 2) { | ||
| 1253 | - //午餐 | ||
| 1254 | - | ||
| 1255 | - str == "00:00-00:00" | 1246 | + str == "00:00-00:00" |
| 1256 | ? dailyList = [] | 1247 | ? dailyList = [] |
| 1257 | - : dailyList = _getHourAndMinute(str, 2); | ||
| 1258 | - } else if (dateSolt == 3) { | ||
| 1259 | - //晚餐 | ||
| 1260 | - | ||
| 1261 | - str == "00:00-00:00" | ||
| 1262 | - ? dailyList = [] | ||
| 1263 | - : dailyList = _getHourAndMinute(str, 3); | ||
| 1264 | - } else if (dateSolt == 4) { | ||
| 1265 | - //晚餐 | ||
| 1266 | - | ||
| 1267 | - str == "00:00-00:00" | ||
| 1268 | - ? dailyList = [] | ||
| 1269 | - : dailyList = _getHourAndMinute(str, 4); | ||
| 1270 | - } else if (dateSolt == 5) { | ||
| 1271 | - //晚餐 | ||
| 1272 | - | ||
| 1273 | - str == "00:00-00:00" | ||
| 1274 | - ? dailyList = [] | ||
| 1275 | - : dailyList = _getHourAndMinute(str, 5); | ||
| 1276 | - } | 1248 | + : dailyList = _getHourAndMinute(str, dateSolt); |
| 1249 | + // if (dateSolt == 1) { | ||
| 1250 | + // //早餐 | ||
| 1251 | + | ||
| 1252 | + // str == "00:00-00:00" | ||
| 1253 | + // ? dailyList = [] | ||
| 1254 | + // : dailyList = _getHourAndMinute(str, 1); | ||
| 1255 | + // } else if (dateSolt == 2) { | ||
| 1256 | + // //午餐 | ||
| 1257 | + | ||
| 1258 | + // str == "00:00-00:00" | ||
| 1259 | + // ? dailyList = [] | ||
| 1260 | + // : dailyList = _getHourAndMinute(str, 2); | ||
| 1261 | + // } else if (dateSolt == 3) { | ||
| 1262 | + // //晚餐 | ||
| 1263 | + | ||
| 1264 | + // str == "00:00-00:00" | ||
| 1265 | + // ? dailyList = [] | ||
| 1266 | + // : dailyList = _getHourAndMinute(str, 3); | ||
| 1267 | + // } else if (dateSolt == 4) { | ||
| 1268 | + // //晚餐 | ||
| 1269 | + | ||
| 1270 | + // str == "00:00-00:00" | ||
| 1271 | + // ? dailyList = [] | ||
| 1272 | + // : dailyList = _getHourAndMinute(str, 4); | ||
| 1273 | + // } else if (dateSolt == 5) { | ||
| 1274 | + // //晚餐 | ||
| 1275 | + | ||
| 1276 | + // str == "00:00-00:00" | ||
| 1277 | + // ? dailyList = [] | ||
| 1278 | + // : dailyList = _getHourAndMinute(str, 5); | ||
| 1279 | + // } | ||
| 1277 | ddateHm = detailModel.detailModelAllSunModel!.ddateStr; | 1280 | ddateHm = detailModel.detailModelAllSunModel!.ddateStr; |
| 1278 | ddateIndex = dailyList.indexOf(ddateHm); | 1281 | ddateIndex = dailyList.indexOf(ddateHm); |
| 1279 | } | 1282 | } |
| @@ -471,14 +471,15 @@ class NotebookDetailChangeModelOnly with ChangeNotifier { | @@ -471,14 +471,15 @@ class NotebookDetailChangeModelOnly with ChangeNotifier { | ||
| 471 | 471 | ||
| 472 | ///录入更改内部预订 | 472 | ///录入更改内部预订 |
| 473 | Future<SunReserveInfoModel?> setReserveInfoOnly( | 473 | Future<SunReserveInfoModel?> setReserveInfoOnly( |
| 474 | - BuildContext context, | ||
| 475 | - String? nameStr, | ||
| 476 | - String? uid, | ||
| 477 | - int currTimeIndex, | ||
| 478 | - DateTime dateTime, | ||
| 479 | - String? morning, | ||
| 480 | - String? noon, | ||
| 481 | - String? night) async { | 474 | + BuildContext context, |
| 475 | + String? nameStr, | ||
| 476 | + String? uid, | ||
| 477 | + int currTimeIndex, | ||
| 478 | + DateTime dateTime, | ||
| 479 | + String? times, | ||
| 480 | + // String? noon, | ||
| 481 | + // String? night | ||
| 482 | + ) async { | ||
| 482 | UserModel userModel = Provider.of<UserModel>(context, listen: false); | 483 | UserModel userModel = Provider.of<UserModel>(context, listen: false); |
| 483 | if (phoneController.text.trim().length > 0) { | 484 | if (phoneController.text.trim().length > 0) { |
| 484 | //判断是否可以输入自己的手机号 | 485 | //判断是否可以输入自己的手机号 |
| @@ -545,22 +546,26 @@ class NotebookDetailChangeModelOnly with ChangeNotifier { | @@ -545,22 +546,26 @@ class NotebookDetailChangeModelOnly with ChangeNotifier { | ||
| 545 | late String timeStrStart; | 546 | late String timeStrStart; |
| 546 | late String timeStrEnd; | 547 | late String timeStrEnd; |
| 547 | 548 | ||
| 548 | - if (currTimeIndex == 1) { | ||
| 549 | - //早市 | ||
| 550 | - List timem = morning!.split('-'); | ||
| 551 | - timeStrStart = ymd + ' ' + timem[0] + ':00'; | ||
| 552 | - timeStrEnd = ymd + ' ' + timem[1] + ':00'; | ||
| 553 | - } else if (currTimeIndex == 2) { | ||
| 554 | - //午市 | ||
| 555 | - List timem = noon!.split('-'); | ||
| 556 | - timeStrStart = ymd + ' ' + timem[0] + ':00'; | ||
| 557 | - timeStrEnd = ymd + ' ' + timem[1] + ':00'; | ||
| 558 | - } else if (currTimeIndex == 3) { | ||
| 559 | - //晚市 | ||
| 560 | - List timem = night!.split('-'); | ||
| 561 | - timeStrStart = ymd + ' ' + timem[0] + ':00'; | ||
| 562 | - timeStrEnd = ymd + ' ' + timem[1] + ':00'; | ||
| 563 | - } | 549 | + List timem = times!.split('-'); |
| 550 | + timeStrStart = ymd + ' ' + timem[0] + ':00'; | ||
| 551 | + timeStrEnd = ymd + ' ' + timem[1] + ':00'; | ||
| 552 | + | ||
| 553 | + // if (currTimeIndex == 1) { | ||
| 554 | + // //早市 | ||
| 555 | + // List timem = morning!.split('-'); | ||
| 556 | + // timeStrStart = ymd + ' ' + timem[0] + ':00'; | ||
| 557 | + // timeStrEnd = ymd + ' ' + timem[1] + ':00'; | ||
| 558 | + // } else if (currTimeIndex == 2) { | ||
| 559 | + // //午市 | ||
| 560 | + // List timem = noon!.split('-'); | ||
| 561 | + // timeStrStart = ymd + ' ' + timem[0] + ':00'; | ||
| 562 | + // timeStrEnd = ymd + ' ' + timem[1] + ':00'; | ||
| 563 | + // } else if (currTimeIndex == 3) { | ||
| 564 | + // //晚市 | ||
| 565 | + // List timem = night!.split('-'); | ||
| 566 | + // timeStrStart = ymd + ' ' + timem[0] + ':00'; | ||
| 567 | + // timeStrEnd = ymd + ' ' + timem[1] + ':00'; | ||
| 568 | + // } | ||
| 564 | 569 | ||
| 565 | int? startM = DateUtil.getDateMsByTimeStr(timeStrStart); | 570 | int? startM = DateUtil.getDateMsByTimeStr(timeStrStart); |
| 566 | int? endM = DateUtil.getDateMsByTimeStr(timeStrEnd); | 571 | int? endM = DateUtil.getDateMsByTimeStr(timeStrEnd); |
| @@ -632,14 +637,16 @@ class NotebookDetailChangeModelOnly with ChangeNotifier { | @@ -632,14 +637,16 @@ class NotebookDetailChangeModelOnly with ChangeNotifier { | ||
| 632 | 637 | ||
| 633 | //更改在线预订 | 638 | //更改在线预订 |
| 634 | Future<SunReserveInfoModel?> updateOnlineReserveInfoOnly( | 639 | Future<SunReserveInfoModel?> updateOnlineReserveInfoOnly( |
| 635 | - BuildContext context, | ||
| 636 | - String? nameStr, | ||
| 637 | - String? uid, | ||
| 638 | - int currTimeIndex, | ||
| 639 | - DateTime dateTime, | ||
| 640 | - String? morning, | ||
| 641 | - String? noon, | ||
| 642 | - String? night) async { | 640 | + BuildContext context, |
| 641 | + String? nameStr, | ||
| 642 | + String? uid, | ||
| 643 | + int currTimeIndex, | ||
| 644 | + DateTime dateTime, | ||
| 645 | + String? times, | ||
| 646 | + // String? morning, | ||
| 647 | + // String? noon, | ||
| 648 | + // String? night | ||
| 649 | + ) async { | ||
| 643 | UserModel userModel = Provider.of<UserModel>(context, listen: false); | 650 | UserModel userModel = Provider.of<UserModel>(context, listen: false); |
| 644 | if (phoneController.text.trim().length > 0) { | 651 | if (phoneController.text.trim().length > 0) { |
| 645 | //判断是否可以输入自己的手机号 | 652 | //判断是否可以输入自己的手机号 |
| @@ -710,22 +717,26 @@ class NotebookDetailChangeModelOnly with ChangeNotifier { | @@ -710,22 +717,26 @@ class NotebookDetailChangeModelOnly with ChangeNotifier { | ||
| 710 | late String timeStrStart; | 717 | late String timeStrStart; |
| 711 | late String timeStrEnd; | 718 | late String timeStrEnd; |
| 712 | 719 | ||
| 713 | - if (currTimeIndex == 1) { | ||
| 714 | - //早市 | ||
| 715 | - List timem = morning!.split('-'); | ||
| 716 | - timeStrStart = ymd + ' ' + timem[0] + ':00'; | ||
| 717 | - timeStrEnd = ymd + ' ' + timem[1] + ':00'; | ||
| 718 | - } else if (currTimeIndex == 2) { | ||
| 719 | - //午市 | ||
| 720 | - List timem = noon!.split('-'); | ||
| 721 | - timeStrStart = ymd + ' ' + timem[0] + ':00'; | ||
| 722 | - timeStrEnd = ymd + ' ' + timem[1] + ':00'; | ||
| 723 | - } else if (currTimeIndex == 3) { | ||
| 724 | - //晚市 | ||
| 725 | - List timem = night!.split('-'); | 720 | + List timem =times!.split('-'); |
| 726 | timeStrStart = ymd + ' ' + timem[0] + ':00'; | 721 | timeStrStart = ymd + ' ' + timem[0] + ':00'; |
| 727 | timeStrEnd = ymd + ' ' + timem[1] + ':00'; | 722 | timeStrEnd = ymd + ' ' + timem[1] + ':00'; |
| 728 | - } | 723 | + |
| 724 | + // if (currTimeIndex == 1) { | ||
| 725 | + // //早市 | ||
| 726 | + // List timem = morning!.split('-'); | ||
| 727 | + // timeStrStart = ymd + ' ' + timem[0] + ':00'; | ||
| 728 | + // timeStrEnd = ymd + ' ' + timem[1] + ':00'; | ||
| 729 | + // } else if (currTimeIndex == 2) { | ||
| 730 | + // //午市 | ||
| 731 | + // List timem = noon!.split('-'); | ||
| 732 | + // timeStrStart = ymd + ' ' + timem[0] + ':00'; | ||
| 733 | + // timeStrEnd = ymd + ' ' + timem[1] + ':00'; | ||
| 734 | + // } else if (currTimeIndex == 3) { | ||
| 735 | + // //晚市 | ||
| 736 | + // List timem = night!.split('-'); | ||
| 737 | + // timeStrStart = ymd + ' ' + timem[0] + ':00'; | ||
| 738 | + // timeStrEnd = ymd + ' ' + timem[1] + ':00'; | ||
| 739 | + // } | ||
| 729 | 740 | ||
| 730 | int? startM = DateUtil.getDateMsByTimeStr(timeStrStart); | 741 | int? startM = DateUtil.getDateMsByTimeStr(timeStrStart); |
| 731 | int? endM = DateUtil.getDateMsByTimeStr(timeStrEnd); | 742 | int? endM = DateUtil.getDateMsByTimeStr(timeStrEnd); |
-
Please register or login to post a comment