|
|
|
@ -27,14 +27,14 @@ class _TradeSummary extends State<TradeSummary> {
|
|
|
|
|
int expensesSelect = 0; |
|
|
|
|
int dateIndex = 0; |
|
|
|
|
String selectedDate = ""; |
|
|
|
|
String dayDate = "${DateTime.now().year}年${ DateTime.now().month}月${ DateTime.now().day}日"; |
|
|
|
|
String dayDate = "${DateFormat("yyyy年MM月dd日").format(DateTime.now())}"; |
|
|
|
|
String weekDate =""; |
|
|
|
|
String weekDateNum = "${DateTime.now().year}年${ DateTime.now().month}月${ DateTime.now().day}日 至 " |
|
|
|
|
"${DateFormat("yyyy年MM月dd日").format(DateTime.parse(DateTime.now().add(Duration(days:6)).toString().substring(0,10)))}"; |
|
|
|
|
String weekDateNum = "${DateFormat("yyyy年MM月dd日").format(DateTime.now().subtract(Duration(days:6)))} 至 " |
|
|
|
|
"${DateFormat("yyyy年MM月dd日").format(DateTime.now())}"; |
|
|
|
|
String monthlyDate =""; |
|
|
|
|
String monthlyDateNum = "${DateTime.now().year}年${ DateTime.now().month}月"; |
|
|
|
|
String monthlyDateNum = "${DateFormat("yyyy年MM月").format(DateTime.now())}"; |
|
|
|
|
String customDate =""; |
|
|
|
|
String customDateNum = "${DateTime.now().year}年${ DateTime.now().month}月${ DateTime.now().day}日"; |
|
|
|
|
String customDateNum = "${DateFormat("yyyy年MM月dd日").format(DateTime.now())}"; |
|
|
|
|
List<LineChartSample2Data> lineChartSample2DataAmount = |
|
|
|
|
[LineChartSample2Data(0,40,"2023-03-09"), |
|
|
|
|
LineChartSample2Data(1,10,"2023-03-10"), |
|
|
|
@ -295,14 +295,19 @@ class _TradeSummary extends State<TradeSummary> {
|
|
|
|
|
|
|
|
|
|
String timeDate(){ |
|
|
|
|
if(dateIndex == 0){ |
|
|
|
|
return (selectedDate == "" || selectedDate == null) ? "${dayDate}(今日)":"${DateFormat("yyyy年MM月dd日").format(DateTime.parse(selectedDate))}(今日)"; |
|
|
|
|
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}(当月)":"${(DateFormat("yyyy年MM月dd日").format(DateTime.parse(monthlyDate)).substring(0,8))}(当月)";} |
|
|
|
|
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;} |
|
|
|
|
return (customDate == "" || customDate == null) ? "${customDateNum??""}(今日)" : customDate;} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
///经营分析 |
|
|
|
@ -383,7 +388,7 @@ class _TradeSummary extends State<TradeSummary> {
|
|
|
|
|
margin: EdgeInsets.only(bottom:30.h), |
|
|
|
|
), |
|
|
|
|
if(operateSelect== 0) |
|
|
|
|
Padding(padding: EdgeInsets.symmetric(horizontal: 20.w), |
|
|
|
|
Container(padding: EdgeInsets.symmetric(horizontal: 20.w), |
|
|
|
|
child:LineChartSample2(lineChartSample2DataAmount,"金额"),), |
|
|
|
|
if(operateSelect == 1) |
|
|
|
|
Padding(padding: EdgeInsets.symmetric(horizontal: 20.w), |
|
|
|
|