Commit 7df6abad77cb7724ad5ff99a5c65e7166cfcb19a

Authored by 蓋亞光
1 parent c2e14607

1. 更改预订跨年bug修复

2. 已预订列表增加我录入的筛选
@@ -11,14 +11,14 @@ if (flutterRoot == null) { @@ -11,14 +11,14 @@ if (flutterRoot == null) {
11 throw new GradleException("Flutter SDK not found. Define location with flutter.sdk in the local.properties file.") 11 throw new GradleException("Flutter SDK not found. Define location with flutter.sdk in the local.properties file.")
12 } 12 }
13 13
14 -def flutterVersionCode = "141" 14 +def flutterVersionCode = "145"
15 if (flutterVersionCode == null) { 15 if (flutterVersionCode == null) {
16 - flutterVersionCode = '141' 16 + flutterVersionCode = '145'
17 } 17 }
18 18
19 -def flutterVersionName = "1.4.1" 19 +def flutterVersionName = "1.4.5"
20 if (flutterVersionName == null) { 20 if (flutterVersionName == null) {
21 - flutterVersionName = '1.4.1' 21 + flutterVersionName = '1.4.5'
22 } 22 }
23 23
24 apply plugin: 'com.android.application' 24 apply plugin: 'com.android.application'
1 -196f9f292c7f47fcf809595ac8fc6ce8  
  1 +c71e777004aab201609920eac28801f9
@@ -146,4 +146,4 @@ SPEC CHECKSUMS: @@ -146,4 +146,4 @@ SPEC CHECKSUMS:
146 146
147 PODFILE CHECKSUM: a75497545d4391e2d394c3668e20cfb1c2bbd4aa 147 PODFILE CHECKSUM: a75497545d4391e2d394c3668e20cfb1c2bbd4aa
148 148
149 -COCOAPODS: 1.9.3 149 +COCOAPODS: 1.9.1
@@ -406,7 +406,7 @@ @@ -406,7 +406,7 @@
406 CODE_SIGN_ENTITLEMENTS = Runner/RunnerProfile.entitlements; 406 CODE_SIGN_ENTITLEMENTS = Runner/RunnerProfile.entitlements;
407 CODE_SIGN_IDENTITY = "Apple Development"; 407 CODE_SIGN_IDENTITY = "Apple Development";
408 CODE_SIGN_STYLE = Automatic; 408 CODE_SIGN_STYLE = Automatic;
409 - CURRENT_PROJECT_VERSION = 136; 409 + CURRENT_PROJECT_VERSION = 145;
410 DEVELOPMENT_TEAM = 8J59HM8B82; 410 DEVELOPMENT_TEAM = 8J59HM8B82;
411 ENABLE_BITCODE = NO; 411 ENABLE_BITCODE = NO;
412 FRAMEWORK_SEARCH_PATHS = ( 412 FRAMEWORK_SEARCH_PATHS = (
@@ -419,7 +419,7 @@ @@ -419,7 +419,7 @@
419 "$(inherited)", 419 "$(inherited)",
420 "$(PROJECT_DIR)/Flutter", 420 "$(PROJECT_DIR)/Flutter",
421 ); 421 );
422 - MARKETING_VERSION = 1.3.6; 422 + MARKETING_VERSION = 1.4.5;
423 PRODUCT_BUNDLE_IDENTIFIER = com.naji.reserveLine; 423 PRODUCT_BUNDLE_IDENTIFIER = com.naji.reserveLine;
424 PRODUCT_NAME = "一键订"; 424 PRODUCT_NAME = "一键订";
425 PROVISIONING_PROFILE_SPECIFIER = ""; 425 PROVISIONING_PROFILE_SPECIFIER = "";
@@ -548,7 +548,7 @@ @@ -548,7 +548,7 @@
548 CODE_SIGN_ENTITLEMENTS = Runner/Runner.entitlements; 548 CODE_SIGN_ENTITLEMENTS = Runner/Runner.entitlements;
549 CODE_SIGN_IDENTITY = "Apple Development"; 549 CODE_SIGN_IDENTITY = "Apple Development";
550 CODE_SIGN_STYLE = Automatic; 550 CODE_SIGN_STYLE = Automatic;
551 - CURRENT_PROJECT_VERSION = 136; 551 + CURRENT_PROJECT_VERSION = 145;
552 DEVELOPMENT_TEAM = 8J59HM8B82; 552 DEVELOPMENT_TEAM = 8J59HM8B82;
553 ENABLE_BITCODE = NO; 553 ENABLE_BITCODE = NO;
554 FRAMEWORK_SEARCH_PATHS = ( 554 FRAMEWORK_SEARCH_PATHS = (
@@ -561,7 +561,7 @@ @@ -561,7 +561,7 @@
561 "$(inherited)", 561 "$(inherited)",
562 "$(PROJECT_DIR)/Flutter", 562 "$(PROJECT_DIR)/Flutter",
563 ); 563 );
564 - MARKETING_VERSION = 1.3.6; 564 + MARKETING_VERSION = 1.4.5;
565 PRODUCT_BUNDLE_IDENTIFIER = com.naji.reserveLine; 565 PRODUCT_BUNDLE_IDENTIFIER = com.naji.reserveLine;
566 PRODUCT_NAME = "一键订"; 566 PRODUCT_NAME = "一键订";
567 PROVISIONING_PROFILE_SPECIFIER = ""; 567 PROVISIONING_PROFILE_SPECIFIER = "";
@@ -581,7 +581,7 @@ @@ -581,7 +581,7 @@
581 CODE_SIGN_ENTITLEMENTS = Runner/Runner.entitlements; 581 CODE_SIGN_ENTITLEMENTS = Runner/Runner.entitlements;
582 CODE_SIGN_IDENTITY = "Apple Development"; 582 CODE_SIGN_IDENTITY = "Apple Development";
583 CODE_SIGN_STYLE = Automatic; 583 CODE_SIGN_STYLE = Automatic;
584 - CURRENT_PROJECT_VERSION = 136; 584 + CURRENT_PROJECT_VERSION = 145;
585 DEVELOPMENT_TEAM = 8J59HM8B82; 585 DEVELOPMENT_TEAM = 8J59HM8B82;
586 ENABLE_BITCODE = NO; 586 ENABLE_BITCODE = NO;
587 FRAMEWORK_SEARCH_PATHS = ( 587 FRAMEWORK_SEARCH_PATHS = (
@@ -594,7 +594,7 @@ @@ -594,7 +594,7 @@
594 "$(inherited)", 594 "$(inherited)",
595 "$(PROJECT_DIR)/Flutter", 595 "$(PROJECT_DIR)/Flutter",
596 ); 596 );
597 - MARKETING_VERSION = 1.3.6; 597 + MARKETING_VERSION = 1.4.5;
598 PRODUCT_BUNDLE_IDENTIFIER = com.naji.reserveLine; 598 PRODUCT_BUNDLE_IDENTIFIER = com.naji.reserveLine;
599 PRODUCT_NAME = "一键订"; 599 PRODUCT_NAME = "一键订";
600 PROVISIONING_PROFILE_SPECIFIER = ""; 600 PROVISIONING_PROFILE_SPECIFIER = "";
@@ -115,7 +115,7 @@ class NotebookDetail { @@ -115,7 +115,7 @@ class NotebookDetail {
115 String get ddateMd { 115 String get ddateMd {
116 DateTime dateTime = 116 DateTime dateTime =
117 DateTime.fromMillisecondsSinceEpoch(int.parse(ddate) * 1000); 117 DateTime.fromMillisecondsSinceEpoch(int.parse(ddate) * 1000);
118 - String md = Utils.addZeroNumber(dateTime.month) + 118 + String md ="${dateTime.year}年"+Utils.addZeroNumber(dateTime.month) +
119 "月" + 119 "月" +
120 Utils.addZeroNumber(dateTime.day) + 120 Utils.addZeroNumber(dateTime.day) +
121 "日"; 121 "日";
@@ -57,6 +57,7 @@ class HandleOnlinePageState extends State<HandleOnlinePage> { @@ -57,6 +57,7 @@ class HandleOnlinePageState extends State<HandleOnlinePage> {
57 57
58 bool isRefused = false; //是否已拒绝 58 bool isRefused = false; //是否已拒绝
59 bool isPause = false; //是否暂停预订 59 bool isPause = false; //是否暂停预订
  60 + bool isSelf=false;//订单是否自己处理
60 StateSetter refuseDialogState; //决绝弹框setState 61 StateSetter refuseDialogState; //决绝弹框setState
61 62
62 @override 63 @override
@@ -91,7 +92,11 @@ class HandleOnlinePageState extends State<HandleOnlinePage> { @@ -91,7 +92,11 @@ class HandleOnlinePageState extends State<HandleOnlinePage> {
91 } 92 }
92 } 93 }
93 }); 94 });
94 - if (detailEntity.status != "0" && !isPause) { 95 + if(detailEntity.status=="6"){//已拒绝不跳转
  96 + if(refuseDialogState!=null){
  97 + refuseDialogState((){});
  98 + }
  99 + }else if (detailEntity.status != "0") {//已拒绝
95 //已处理 100 //已处理
96 Future.delayed(Duration(milliseconds: 200), () { 101 Future.delayed(Duration(milliseconds: 200), () {
97 NavigatorUtil.goNotebookDetailPage(context, detailEntity.id, 102 NavigatorUtil.goNotebookDetailPage(context, detailEntity.id,
@@ -183,7 +188,6 @@ class HandleOnlinePageState extends State<HandleOnlinePage> { @@ -183,7 +188,6 @@ class HandleOnlinePageState extends State<HandleOnlinePage> {
183 VEmptyView(20), 188 VEmptyView(20),
184 GestureDetector( 189 GestureDetector(
185 onTap: () { 190 onTap: () {
186 - Navigator.of(context).pop();  
187 setReserveStatus("6"); 191 setReserveStatus("6");
188 }, 192 },
189 child: Container( 193 child: Container(
@@ -304,6 +308,9 @@ class HandleOnlinePageState extends State<HandleOnlinePage> { @@ -304,6 +308,9 @@ class HandleOnlinePageState extends State<HandleOnlinePage> {
304 ], 308 ],
305 ), 309 ),
306 ); 310 );
  311 + if(detailEntity.status=="6"&&isSelf==false){//订单已被拒绝
  312 + Navigator.of(context).pop();
  313 + }
307 return container; 314 return container;
308 }, 315 },
309 ); 316 );
@@ -342,20 +349,21 @@ class HandleOnlinePageState extends State<HandleOnlinePage> { @@ -342,20 +349,21 @@ class HandleOnlinePageState extends State<HandleOnlinePage> {
342 "cause": json.encode(causeMap) 349 "cause": json.encode(causeMap)
343 }; 350 };
344 if (status == "6") { 351 if (status == "6") {
345 - isPause = true; 352 + isPause = (ac=="1"?true:false);
346 params['ac'] = ac; //0=直接拒绝 1=拒绝并暂停预订 353 params['ac'] = ac; //0=直接拒绝 1=拒绝并暂停预订
347 } 354 }
348 bool success = await detailModel.setReserveStatus(context, params, 355 bool success = await detailModel.setReserveStatus(context, params,
349 - ifPush: (isPause ? false : true), showLoading: true); 356 + ifPush: (status=="6" ? false : true), showLoading: true);
350 if (success != null && success) { 357 if (success != null && success) {
351 bus.emit("refresh_book_list"); 358 bus.emit("refresh_book_list");
352 if (status == "6") { 359 if (status == "6") {
353 isRefused = true; 360 isRefused = true;
354 - }  
355 - if (isPause) { 361 + isSelf=true;
356 _getOrderListData(); 362 _getOrderListData();
357 - refuseDialogState(() {});  
358 } 363 }
  364 + }else{
  365 + isSelf=false;
  366 + _getOrderListData();
359 } 367 }
360 } 368 }
361 369
  1 +import 'package:common_utils/common_utils.dart';
1 import 'package:flutter/material.dart'; 2 import 'package:flutter/material.dart';
2 import 'package:flutter_screenutil/flutter_screenutil.dart'; 3 import 'package:flutter_screenutil/flutter_screenutil.dart';
3 import 'package:one_key/models/message.dart'; 4 import 'package:one_key/models/message.dart';
  5 +import 'package:one_key/pages/detail/handle_online_page.dart';
  6 +import 'package:one_key/pages/home/home_page.dart';
4 import 'package:one_key/provider/message_dialog_model.dart'; 7 import 'package:one_key/provider/message_dialog_model.dart';
5 import 'package:one_key/provider/user_model.dart'; 8 import 'package:one_key/provider/user_model.dart';
6 import 'package:one_key/res/colors.dart'; 9 import 'package:one_key/res/colors.dart';
@@ -10,6 +13,8 @@ import 'package:one_key/widgets/h_empty_view.dart'; @@ -10,6 +13,8 @@ import 'package:one_key/widgets/h_empty_view.dart';
10 import 'package:one_key/widgets/v_empty_view.dart'; 13 import 'package:one_key/widgets/v_empty_view.dart';
11 import 'package:provider/provider.dart'; 14 import 'package:provider/provider.dart';
12 15
  16 +import '../../app.dart';
  17 +
13 class MessageDialogItem extends StatelessWidget { 18 class MessageDialogItem extends StatelessWidget {
14 19
15 final Message message; 20 final Message message;
@@ -20,7 +20,6 @@ import 'package:one_key/widgets/page_exception.dart'; @@ -20,7 +20,6 @@ import 'package:one_key/widgets/page_exception.dart';
20 import 'package:provider/provider.dart'; 20 import 'package:provider/provider.dart';
21 21
22 class NoteBookPage extends StatefulWidget { 22 class NoteBookPage extends StatefulWidget {
23 -  
24 @override 23 @override
25 State<StatefulWidget> createState() { 24 State<StatefulWidget> createState() {
26 // TODO: implement createState 25 // TODO: implement createState
@@ -41,6 +40,8 @@ class NoteBookPageState extends State<NoteBookPage> { @@ -41,6 +40,8 @@ class NoteBookPageState extends State<NoteBookPage> {
41 40
42 UserModel userModel; 41 UserModel userModel;
43 42
  43 + int tabIndex = 0; //当前选中的tab 标签
  44 +
44 @override 45 @override
45 void initState() { 46 void initState() {
46 // TODO: implement initState 47 // TODO: implement initState
@@ -275,6 +276,116 @@ class NoteBookPageState extends State<NoteBookPage> { @@ -275,6 +276,116 @@ class NoteBookPageState extends State<NoteBookPage> {
275 _reserveCountDay(); 276 _reserveCountDay();
276 } 277 }
277 278
  279 + Widget _buildTabbar() {
  280 + Container container = Container(
  281 + color: MyColours.color_ffffff,
  282 + width: double.infinity,
  283 + padding: EdgeInsets.only(left: ScreenUtil().setWidth(20),top: ScreenUtil().setWidth(20)),
  284 + child: Row(
  285 + mainAxisSize: MainAxisSize.min,
  286 + children: <Widget>[
  287 + Container(
  288 + padding: EdgeInsets.symmetric(horizontal: ScreenUtil().setWidth(20)),
  289 + child: GestureDetector(
  290 + onTap: () {
  291 + setState(() {
  292 + tabIndex = 0;
  293 + });
  294 + },
  295 + child: Column(
  296 + mainAxisAlignment: MainAxisAlignment.center,
  297 + children: <Widget>[
  298 + Text(
  299 + "全部预订",
  300 + style: TextStyle(
  301 + color: tabIndex == 0
  302 + ? MyColours.color_353535
  303 + : MyColours.color_999999,
  304 + fontSize: tabIndex == 0
  305 + ? ScreenUtil().setSp(36)
  306 + : ScreenUtil().setSp(28),
  307 + fontWeight: tabIndex == 0
  308 + ? FontWeight.bold
  309 + : FontWeight.normal),
  310 + ),
  311 + Align(
  312 + alignment: Alignment.bottomCenter,
  313 + child: Container(
  314 + height: ScreenUtil().setWidth(6),
  315 + width: ScreenUtil().setWidth(60),
  316 + margin:
  317 + EdgeInsets.only(top: ScreenUtil().setWidth(8)),
  318 + decoration: tabIndex == 0
  319 + ? BoxDecoration(color: MyColours.color_199095,borderRadius: BorderRadius.circular(
  320 + ScreenUtil()
  321 + .setWidth(
  322 + 6)))
  323 + : BoxDecoration(
  324 + color: MyColours.color_ffffff,
  325 + borderRadius: BorderRadius.circular(
  326 + ScreenUtil()
  327 + .setWidth(
  328 + 6))
  329 + ),
  330 + ),
  331 + ),
  332 + ],
  333 + )),
  334 + ),
  335 + Container(
  336 + padding: EdgeInsets.symmetric(horizontal: ScreenUtil().setWidth(20)),
  337 + child: GestureDetector(
  338 + onTap: () {
  339 + setState(() {
  340 + tabIndex = 1;
  341 + });
  342 + },
  343 + child: Column(
  344 + mainAxisAlignment: MainAxisAlignment.center,
  345 + children: <Widget>[
  346 + Text(
  347 + "我录入的",
  348 + style: TextStyle(
  349 + color: tabIndex == 1
  350 + ? MyColours.color_353535
  351 + : MyColours.color_999999,
  352 + fontSize: tabIndex == 1
  353 + ? ScreenUtil().setSp(36)
  354 + : ScreenUtil().setSp(28),
  355 + fontWeight: tabIndex == 1
  356 + ? FontWeight.bold
  357 + : FontWeight.normal),
  358 + ),
  359 + Align(
  360 + alignment: Alignment.bottomCenter,
  361 + child: Container(
  362 + height: ScreenUtil().setWidth(6),
  363 + width: ScreenUtil().setWidth(60),
  364 + margin:
  365 + EdgeInsets.only(top: ScreenUtil().setWidth(8)),
  366 + decoration: tabIndex == 1
  367 + ? BoxDecoration(color: MyColours.color_199095,borderRadius: BorderRadius.circular(
  368 + ScreenUtil()
  369 + .setWidth(
  370 + 6)))
  371 + : BoxDecoration(
  372 + color: MyColours.color_ffffff,
  373 + borderRadius: BorderRadius.circular(
  374 + ScreenUtil()
  375 + .setWidth(
  376 + 6))
  377 + ),
  378 + ),
  379 + ),
  380 + ],
  381 + )),
  382 + ),
  383 + ],
  384 + ),
  385 + );
  386 + return container;
  387 + }
  388 +
278 @override 389 @override
279 Widget build(BuildContext context) { 390 Widget build(BuildContext context) {
280 // TODO: implement build 391 // TODO: implement build
@@ -284,10 +395,7 @@ class NoteBookPageState extends State<NoteBookPage> { @@ -284,10 +395,7 @@ class NoteBookPageState extends State<NoteBookPage> {
284 color: MyColours.color_f5f5f5, 395 color: MyColours.color_f5f5f5,
285 child: Column( 396 child: Column(
286 children: <Widget>[ 397 children: <Widget>[
287 - MyAppBar(  
288 - "已预订",  
289 - showBack: false,  
290 - ), 398 + _buildTabbar(),
291 Container( 399 Container(
292 color: MyColours.color_ffffff, 400 color: MyColours.color_ffffff,
293 width: double.infinity, 401 width: double.infinity,
@@ -597,7 +597,7 @@ class NotebookDetailChangeModel with ChangeNotifier { @@ -597,7 +597,7 @@ class NotebookDetailChangeModel with ChangeNotifier {
597 mdStr = item['title']; 597 mdStr = item['title'];
598 } 598 }
599 } 599 }
600 - String timeNowYear = DateUtil.formatDate(DateTime.now(), format: 'yyyy'); 600 + String timeNowYear = DateUtil.formatDate(DateUtil.getDateTimeByMs(int.parse(detailEntity.ddate)*1000), format: 'yyyy');
601 String ymyStr = timeNowYear + '-' + mdStr; //年月日 601 String ymyStr = timeNowYear + '-' + mdStr; //年月日
602 String timeStr = ymyStr + ' ' + ddateStr + ':00'; 602 String timeStr = ymyStr + ' ' + ddateStr + ':00';
603 // int start = DateUtil.getDateMsByTimeStr(timeStr); 603 // int start = DateUtil.getDateMsByTimeStr(timeStr);
@@ -716,7 +716,7 @@ class NotebookDetailChangeModel with ChangeNotifier { @@ -716,7 +716,7 @@ class NotebookDetailChangeModel with ChangeNotifier {
716 mdStr = item['title']; 716 mdStr = item['title'];
717 } 717 }
718 } 718 }
719 - String timeNowYear = DateUtil.formatDate(DateTime.now(), format: 'yyyy'); 719 + String timeNowYear = DateUtil.formatDate(DateUtil.getDateTimeByMs(int.parse(detailEntity.ddate)*1000), format: 'yyyy');
720 String ymyStr = timeNowYear + '-' + mdStr; //年月日 720 String ymyStr = timeNowYear + '-' + mdStr; //年月日
721 String timeStr = ymyStr + ' ' + ddateStr + ':00'; 721 String timeStr = ymyStr + ' ' + ddateStr + ':00';
722 // int start = DateUtil.getDateMsByTimeStr(timeStr); 722 // int start = DateUtil.getDateMsByTimeStr(timeStr);
@@ -105,15 +105,15 @@ class NotebookDetailModel extends ChangeNotifier { @@ -105,15 +105,15 @@ class NotebookDetailModel extends ChangeNotifier {
105 .catchError((error) { 105 .catchError((error) {
106 print(error.toString()); 106 print(error.toString());
107 }); 107 });
108 - if (baseResp == null) return false;  
109 - if (baseResp.code == Constant.status_success) { 108 + if (baseResp == null)return false;
  109 + if (baseResp.code == Constant.status_success&&baseResp.data!=null) {
110 if (ifPush) { 110 if (ifPush) {
111 NavigatorUtil.goNotebookDetailPage(context, params["rid"], 111 NavigatorUtil.goNotebookDetailPage(context, params["rid"],
112 replace: true); 112 replace: true);
113 } 113 }
114 return true; 114 return true;
115 } else { 115 } else {
116 - Utils.showToast(baseResp.msg); 116 + Utils.showToast("订单已被处理");
117 return false; 117 return false;
118 } 118 }
119 } 119 }
@@ -20,7 +20,7 @@ import '../app.dart'; @@ -20,7 +20,7 @@ import '../app.dart';
20 20
21 class Utils { 21 class Utils {
22 static void showToast(String msg) { 22 static void showToast(String msg) {
23 - Fluttertoast.showToast(msg: msg, gravity: ToastGravity.CENTER); 23 + Fluttertoast.showToast(msg: msg, toastLength:Toast.LENGTH_LONG,gravity: ToastGravity.CENTER);
24 } 24 }
25 25
26 //本地图片资源路径 26 //本地图片资源路径