|
|
@ -2,6 +2,7 @@ import 'package:flutter/cupertino.dart'; |
|
|
|
import 'package:flutter/material.dart'; |
|
|
|
import 'package:flutter/material.dart'; |
|
|
|
import 'package:huixiang/view_widget/classic_header.dart'; |
|
|
|
import 'package:huixiang/view_widget/classic_header.dart'; |
|
|
|
import 'package:huixiang/view_widget/my_footer.dart'; |
|
|
|
import 'package:huixiang/view_widget/my_footer.dart'; |
|
|
|
|
|
|
|
import 'package:intl/intl.dart'; |
|
|
|
import 'package:pull_to_refresh/pull_to_refresh.dart'; |
|
|
|
import 'package:pull_to_refresh/pull_to_refresh.dart'; |
|
|
|
import 'package:flutter_screenutil/flutter_screenutil.dart'; |
|
|
|
import 'package:flutter_screenutil/flutter_screenutil.dart'; |
|
|
|
|
|
|
|
|
|
|
@ -34,6 +35,16 @@ class _TradeOrder extends State<TradeOrder> { |
|
|
|
LineChartSample2Data(4,5,"2023-03-13"), |
|
|
|
LineChartSample2Data(4,5,"2023-03-13"), |
|
|
|
LineChartSample2Data(5,55,"2023-03-14"), |
|
|
|
LineChartSample2Data(5,55,"2023-03-14"), |
|
|
|
LineChartSample2Data(6,98,"2023-03-15")]; |
|
|
|
LineChartSample2Data(6,98,"2023-03-15")]; |
|
|
|
|
|
|
|
int dateIndex = 0; |
|
|
|
|
|
|
|
String selectedDate = ""; |
|
|
|
|
|
|
|
String dayDate = "${DateFormat("yyyy年MM月dd日").format(DateTime.now())}"; |
|
|
|
|
|
|
|
String weekDate =""; |
|
|
|
|
|
|
|
String weekDateNum = "${DateFormat("yyyy年MM月dd日").format(DateTime.now().subtract(Duration(days:6)))} 至 " |
|
|
|
|
|
|
|
"${DateFormat("yyyy年MM月dd日").format(DateTime.now())}"; |
|
|
|
|
|
|
|
String monthlyDate =""; |
|
|
|
|
|
|
|
String monthlyDateNum = "${DateFormat("yyyy年MM月").format(DateTime.now())}"; |
|
|
|
|
|
|
|
String customDate =""; |
|
|
|
|
|
|
|
String customDateNum = "${DateFormat("yyyy年MM月dd日").format(DateTime.now())}"; |
|
|
|
|
|
|
|
|
|
|
|
@override |
|
|
|
@override |
|
|
|
void dispose() { |
|
|
|
void dispose() { |
|
|
@ -93,100 +104,163 @@ class _TradeOrder extends State<TradeOrder> { |
|
|
|
top: 16.h, right: 20.w, left: 20.w, bottom: 12.h), |
|
|
|
top: 16.h, right: 20.w, left: 20.w, bottom: 12.h), |
|
|
|
child: Row( |
|
|
|
child: Row( |
|
|
|
children: [ |
|
|
|
children: [ |
|
|
|
Expanded(child: Container( |
|
|
|
Expanded(child: GestureDetector( |
|
|
|
alignment: Alignment.center, |
|
|
|
behavior: HitTestBehavior.opaque, |
|
|
|
decoration: BoxDecoration( |
|
|
|
onTap: (){ |
|
|
|
borderRadius: BorderRadius.circular(2), |
|
|
|
setState((){ |
|
|
|
color: Color(0xFF30415B), |
|
|
|
dateIndex = 0; |
|
|
|
), |
|
|
|
}); |
|
|
|
padding: EdgeInsets.symmetric(vertical: 9.h), |
|
|
|
}, |
|
|
|
child: Text( |
|
|
|
child: Container( |
|
|
|
"日报", |
|
|
|
alignment: Alignment.center, |
|
|
|
style: TextStyle( |
|
|
|
decoration: BoxDecoration( |
|
|
|
fontSize: 12.sp, |
|
|
|
borderRadius: BorderRadius.circular(2), |
|
|
|
fontWeight: MyFontWeight.medium, |
|
|
|
color: dateIndex == 0 ? Color(0xFF30415B):Colors.transparent, |
|
|
|
color: Colors.white, |
|
|
|
|
|
|
|
), |
|
|
|
), |
|
|
|
), |
|
|
|
padding: EdgeInsets.symmetric(vertical: 9.h), |
|
|
|
),), |
|
|
|
child: Text( |
|
|
|
Expanded(child: Container( |
|
|
|
"日报", |
|
|
|
alignment: Alignment.center, |
|
|
|
style: TextStyle( |
|
|
|
decoration: BoxDecoration( |
|
|
|
fontSize: 12.sp, |
|
|
|
borderRadius: BorderRadius.circular(2), |
|
|
|
fontWeight: MyFontWeight.medium, |
|
|
|
// color: Color(0xFF30415B), |
|
|
|
color: dateIndex == 0 ? Colors.white:Color(0xFF30415B), |
|
|
|
), |
|
|
|
), |
|
|
|
padding: EdgeInsets.symmetric(vertical: 9.h), |
|
|
|
|
|
|
|
child: Text( |
|
|
|
|
|
|
|
"周报", |
|
|
|
|
|
|
|
style: TextStyle( |
|
|
|
|
|
|
|
fontSize: 12.sp, |
|
|
|
|
|
|
|
fontWeight: MyFontWeight.medium, |
|
|
|
|
|
|
|
color: Color(0xFF30415B), |
|
|
|
|
|
|
|
), |
|
|
|
), |
|
|
|
), |
|
|
|
), |
|
|
|
),), |
|
|
|
)), |
|
|
|
Expanded(child: Container( |
|
|
|
Expanded(child: GestureDetector( |
|
|
|
alignment: Alignment.center, |
|
|
|
behavior: HitTestBehavior.opaque, |
|
|
|
decoration: BoxDecoration( |
|
|
|
onTap: (){ |
|
|
|
borderRadius: BorderRadius.circular(2), |
|
|
|
setState((){ |
|
|
|
// color: Color(0xFF30415B), |
|
|
|
dateIndex = 1; |
|
|
|
), |
|
|
|
});}, |
|
|
|
padding: EdgeInsets.symmetric(vertical: 9.h), |
|
|
|
child: Container( |
|
|
|
child: Text( |
|
|
|
alignment: Alignment.center, |
|
|
|
"月报", |
|
|
|
decoration: BoxDecoration( |
|
|
|
style: TextStyle( |
|
|
|
borderRadius: BorderRadius.circular(2), |
|
|
|
fontSize: 12.sp, |
|
|
|
color: dateIndex == 1 ? Color(0xFF30415B):Colors.transparent, |
|
|
|
fontWeight: MyFontWeight.medium, |
|
|
|
|
|
|
|
color: Color(0xFF30415B), |
|
|
|
|
|
|
|
), |
|
|
|
), |
|
|
|
), |
|
|
|
padding: EdgeInsets.symmetric(vertical: 9.h), |
|
|
|
),), |
|
|
|
child: Text( |
|
|
|
Expanded(child: Container( |
|
|
|
"周报", |
|
|
|
alignment: Alignment.center, |
|
|
|
style: TextStyle( |
|
|
|
decoration: BoxDecoration( |
|
|
|
fontSize: 12.sp, |
|
|
|
borderRadius: BorderRadius.circular(2), |
|
|
|
fontWeight: MyFontWeight.medium, |
|
|
|
// color: Color(0xFF30415B), |
|
|
|
color: dateIndex == 1 ? Colors.white:Color(0xFF30415B), |
|
|
|
), |
|
|
|
), |
|
|
|
padding: EdgeInsets.symmetric(vertical: 9.h), |
|
|
|
|
|
|
|
child: Text( |
|
|
|
|
|
|
|
"自定义", |
|
|
|
|
|
|
|
style: TextStyle( |
|
|
|
|
|
|
|
fontSize: 12.sp, |
|
|
|
|
|
|
|
fontWeight: MyFontWeight.medium, |
|
|
|
|
|
|
|
color: Color(0xFF30415B), |
|
|
|
|
|
|
|
), |
|
|
|
), |
|
|
|
), |
|
|
|
),)), |
|
|
|
),), |
|
|
|
Expanded(child: GestureDetector( |
|
|
|
|
|
|
|
behavior: HitTestBehavior.opaque, |
|
|
|
|
|
|
|
onTap: (){ |
|
|
|
|
|
|
|
setState((){ |
|
|
|
|
|
|
|
dateIndex = 2; |
|
|
|
|
|
|
|
}); |
|
|
|
|
|
|
|
}, |
|
|
|
|
|
|
|
child: Container( |
|
|
|
|
|
|
|
alignment: Alignment.center, |
|
|
|
|
|
|
|
decoration: BoxDecoration( |
|
|
|
|
|
|
|
borderRadius: BorderRadius.circular(2), |
|
|
|
|
|
|
|
color: dateIndex == 2 ? Color(0xFF30415B):Colors.transparent, |
|
|
|
|
|
|
|
), |
|
|
|
|
|
|
|
padding: EdgeInsets.symmetric(vertical: 9.h), |
|
|
|
|
|
|
|
child: Text( |
|
|
|
|
|
|
|
"月报", |
|
|
|
|
|
|
|
style: TextStyle( |
|
|
|
|
|
|
|
fontSize: 12.sp, |
|
|
|
|
|
|
|
fontWeight: MyFontWeight.medium, |
|
|
|
|
|
|
|
color: dateIndex == 2 ? Colors.white:Color(0xFF30415B), |
|
|
|
|
|
|
|
), |
|
|
|
|
|
|
|
), |
|
|
|
|
|
|
|
),)), |
|
|
|
|
|
|
|
Expanded(child: GestureDetector( |
|
|
|
|
|
|
|
behavior: HitTestBehavior.opaque, |
|
|
|
|
|
|
|
onTap: (){ |
|
|
|
|
|
|
|
setState((){ |
|
|
|
|
|
|
|
dateIndex = 3; |
|
|
|
|
|
|
|
}); |
|
|
|
|
|
|
|
}, |
|
|
|
|
|
|
|
child: Container( |
|
|
|
|
|
|
|
alignment: Alignment.center, |
|
|
|
|
|
|
|
decoration: BoxDecoration( |
|
|
|
|
|
|
|
borderRadius: BorderRadius.circular(2), |
|
|
|
|
|
|
|
color: dateIndex == 3 ? Color(0xFF30415B):Colors.transparent, |
|
|
|
|
|
|
|
), |
|
|
|
|
|
|
|
padding: EdgeInsets.symmetric(vertical: 9.h), |
|
|
|
|
|
|
|
child: Text( |
|
|
|
|
|
|
|
"自定义", |
|
|
|
|
|
|
|
style: TextStyle( |
|
|
|
|
|
|
|
fontSize: 12.sp, |
|
|
|
|
|
|
|
fontWeight: MyFontWeight.medium, |
|
|
|
|
|
|
|
color: dateIndex == 3 ? Colors.white:Color(0xFF30415B), |
|
|
|
|
|
|
|
), |
|
|
|
|
|
|
|
), |
|
|
|
|
|
|
|
),)), |
|
|
|
], |
|
|
|
], |
|
|
|
), |
|
|
|
), |
|
|
|
), |
|
|
|
), |
|
|
|
Align(alignment: Alignment.center, |
|
|
|
Align(alignment: Alignment.center, |
|
|
|
child: Container( |
|
|
|
child: GestureDetector( |
|
|
|
width: 154.w, |
|
|
|
behavior: HitTestBehavior.opaque, |
|
|
|
alignment: Alignment.center, |
|
|
|
onTap: (){ |
|
|
|
padding: EdgeInsets.all(8), |
|
|
|
if(dateIndex == 0){ |
|
|
|
decoration: BoxDecoration( |
|
|
|
Navigator.of(context).pushNamed('/router/day_report_page').then((value) { |
|
|
|
color: Color(0xFFF6F6F6), |
|
|
|
setState((){ |
|
|
|
borderRadius: BorderRadius.circular(2), |
|
|
|
selectedDate = value; |
|
|
|
), |
|
|
|
}); |
|
|
|
margin: EdgeInsets.only(bottom:16.h), |
|
|
|
}); |
|
|
|
child: Row( |
|
|
|
} |
|
|
|
children: [ |
|
|
|
else if(dateIndex == 1){ |
|
|
|
Padding(padding: EdgeInsets.only(right: 20.w), |
|
|
|
Navigator.of(context).pushNamed('/router/week_report_page').then((value) { |
|
|
|
child: Text( |
|
|
|
setState((){ |
|
|
|
"2023年06月01日(今日)", |
|
|
|
weekDate = value; |
|
|
|
style: TextStyle( |
|
|
|
}); |
|
|
|
fontSize: 10.sp, |
|
|
|
}); |
|
|
|
fontWeight: MyFontWeight.regular, |
|
|
|
} |
|
|
|
color: Colors.black, |
|
|
|
else if(dateIndex == 2){ |
|
|
|
|
|
|
|
Navigator.of(context).pushNamed('/router/monthly_report_page').then((value) { |
|
|
|
|
|
|
|
setState((){ |
|
|
|
|
|
|
|
monthlyDate = value; |
|
|
|
|
|
|
|
}); |
|
|
|
|
|
|
|
}); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
else if(dateIndex == 3){ |
|
|
|
|
|
|
|
Navigator.of(context).pushNamed('/router/custom_page').then((value){ |
|
|
|
|
|
|
|
setState((){ |
|
|
|
|
|
|
|
customDate = value; |
|
|
|
|
|
|
|
}); |
|
|
|
|
|
|
|
}); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
}, |
|
|
|
|
|
|
|
child: Container( |
|
|
|
|
|
|
|
width: 194.w, |
|
|
|
|
|
|
|
alignment: Alignment.center, |
|
|
|
|
|
|
|
padding: EdgeInsets.all(8), |
|
|
|
|
|
|
|
decoration: BoxDecoration( |
|
|
|
|
|
|
|
color: Color(0xFFF6F6F6), |
|
|
|
|
|
|
|
borderRadius: BorderRadius.circular(2), |
|
|
|
|
|
|
|
), |
|
|
|
|
|
|
|
margin: EdgeInsets.only(bottom:16.h), |
|
|
|
|
|
|
|
child: Row( |
|
|
|
|
|
|
|
children: [ |
|
|
|
|
|
|
|
Expanded(child:Container( |
|
|
|
|
|
|
|
alignment: Alignment.center, |
|
|
|
|
|
|
|
child: Text( |
|
|
|
|
|
|
|
timeDate(), |
|
|
|
|
|
|
|
style: TextStyle( |
|
|
|
|
|
|
|
fontSize: 10.sp, |
|
|
|
|
|
|
|
fontWeight: MyFontWeight.regular, |
|
|
|
|
|
|
|
color: Colors.black, |
|
|
|
|
|
|
|
), |
|
|
|
), |
|
|
|
), |
|
|
|
),), |
|
|
|
)), |
|
|
|
Image.asset( |
|
|
|
Image.asset( |
|
|
|
"assets/image/bs_calendar_logo.webp", |
|
|
|
"assets/image/bs_calendar_logo.webp", |
|
|
|
width:15, |
|
|
|
width:15, |
|
|
|
height:15, |
|
|
|
height:15, |
|
|
|
), |
|
|
|
), |
|
|
|
], |
|
|
|
], |
|
|
|
|
|
|
|
), |
|
|
|
), |
|
|
|
), |
|
|
|
),), |
|
|
|
),), |
|
|
|
Padding(padding:EdgeInsets.only(left:16.w,bottom:15.h), |
|
|
|
Padding(padding:EdgeInsets.only(left:16.w,bottom:15.h), |
|
|
@ -208,6 +282,23 @@ class _TradeOrder extends State<TradeOrder> { |
|
|
|
); |
|
|
|
); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
String timeDate(){ |
|
|
|
|
|
|
|
if(dateIndex == 0){ |
|
|
|
|
|
|
|
return (selectedDate == "" || selectedDate == null) ? "${dayDate ?? ""}(今日)":(dayDate == DateFormat("yyyy年MM月dd日").format(DateTime.parse(selectedDate)) |
|
|
|
|
|
|
|
?"${DateFormat("yyyy年MM月dd日").format(DateTime.parse(selectedDate))}(今日)":DateFormat("yyyy年MM月dd日").format(DateTime.parse(selectedDate))); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
else if(dateIndex == 1){ |
|
|
|
|
|
|
|
return (weekDate == "" || weekDate == null) ? weekDateNum : weekDate;} |
|
|
|
|
|
|
|
else if(dateIndex == 2){ |
|
|
|
|
|
|
|
return (monthlyDate == "" || monthlyDate == null) ? "${monthlyDateNum ?? ""}(当月)": |
|
|
|
|
|
|
|
(monthlyDateNum == (DateFormat("yyyy年MM月dd日").format(DateTime.parse(monthlyDate)).substring(0,8))? |
|
|
|
|
|
|
|
"${(DateFormat("yyyy年MM月dd日").format(DateTime.parse(monthlyDate)).substring(0,8))}(当月)" |
|
|
|
|
|
|
|
:DateFormat("yyyy年MM月dd日").format(DateTime.parse(monthlyDate)).substring(0,8)); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
else if(dateIndex == 3){ |
|
|
|
|
|
|
|
return (customDate == "" || customDate == null) ? "${customDateNum??""}(今日)" : customDate;} |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
///订单金额 |
|
|
|
///订单金额 |
|
|
|
Widget orderAmount(){ |
|
|
|
Widget orderAmount(){ |
|
|
|
return Column( |
|
|
|
return Column( |
|
|
|