Browse Source

日期选择更改;

点单页范围更改;
wr_2023_business
wurong 2 years ago
parent
commit
c3ef37c8ae
  1. 3
      lib/business_system/date_select/custom_page.dart
  2. 21
      lib/business_system/date_select/monthly_report_page.dart
  3. 2
      lib/business_system/home/business_home_page.dart
  4. 1
      lib/business_system/home/home_view/my_line_chart.dart
  5. 23
      lib/business_system/home/overview/trade_summary.dart
  6. 8
      lib/store/store_view/store_info.dart

3
lib/business_system/date_select/custom_page.dart

@ -66,6 +66,9 @@ class _CustomPage extends State<CustomPage>{
initialSelectedRange: PickerDateRange( initialSelectedRange: PickerDateRange(
DateTime.now().subtract(const Duration(days: 4)), DateTime.now().subtract(const Duration(days: 4)),
DateTime.now().add(const Duration(days: 3))), DateTime.now().add(const Duration(days: 3))),
startRangeSelectionColor: Color(0xFF30415B),
endRangeSelectionColor: Color(0xFF30415B),
todayHighlightColor: Color(0xFF30415B),
), ),
) )
], ],

21
lib/business_system/date_select/monthly_report_page.dart

@ -1,6 +1,4 @@
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:intl/intl.dart';
import 'package:syncfusion_flutter_datepicker/datepicker.dart'; import 'package:syncfusion_flutter_datepicker/datepicker.dart';
import '../../view_widget/my_appbar.dart'; import '../../view_widget/my_appbar.dart';
@ -52,32 +50,15 @@ class _MonthlyReportPage extends State<MonthlyReportPage>{
children: <Widget>[ children: <Widget>[
Positioned( Positioned(
left: 0, left: 0,
right: 0,
top: 0, top: 0,
height: 80,
child: Column(
mainAxisAlignment: MainAxisAlignment.spaceEvenly,
mainAxisSize: MainAxisSize.min,
crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[
Text('Selected date: ' + _monthlyDate),
],
),
),
Positioned(
left: 0,
top: 80,
right: 0, right: 0,
bottom: 0, bottom: 0,
child: SfDateRangePicker( child: SfDateRangePicker(
onSelectionChanged: _onSelectionChanged, onSelectionChanged: _onSelectionChanged,
selectionMode: DateRangePickerSelectionMode.single, selectionMode: DateRangePickerSelectionMode.single,
// selectionShape: DateRangePickerSelectionShape.rectangle,
// initialSelectedRange: PickerDateRange(
// DateTime.now().subtract(const Duration(days: 4)),
// DateTime.now().add(const Duration(days: 3))),
view: DateRangePickerView.year, view: DateRangePickerView.year,
controller: _controller, controller: _controller,
selectionColor: Color(0xFF30415B),
), ),
) )
], ],

2
lib/business_system/home/business_home_page.dart

@ -598,7 +598,7 @@ class _BusinessHomePage extends State<BusinessHomePage>
child: salesVolumeItem(), child: salesVolumeItem(),
); );
}, },
) ),
], ],
), ),
); );

1
lib/business_system/home/home_view/my_line_chart.dart

@ -171,6 +171,7 @@ class _LineChartSample2State extends State<LineChartSample2> {
tooltipPadding: const EdgeInsets.symmetric(vertical:5,horizontal:6), tooltipPadding: const EdgeInsets.symmetric(vertical:5,horizontal:6),
tooltipMargin: 5, tooltipMargin: 5,
tooltipRoundedRadius: 2, tooltipRoundedRadius: 2,
tooltipHorizontalAlignment: FLHorizontalAlignment.center,
getTooltipItems: (touchedSpots) { getTooltipItems: (touchedSpots) {
return touchedSpots.map((LineBarSpot touchedSpot) { return touchedSpots.map((LineBarSpot touchedSpot) {
return LineTooltipItem( return LineTooltipItem(

23
lib/business_system/home/overview/trade_summary.dart

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

8
lib/store/store_view/store_info.dart

@ -177,10 +177,10 @@ class _StoreInfoView extends State<StoreInfoView> {
), ),
), ),
SizedBox( SizedBox(
width: 16.w, width: 8.w,
), ),
GestureDetector( GestureDetector(
behavior: HitTestBehavior.opaque, behavior: HitTestBehavior.translucent,
onTap: () { onTap: () {
Navigator.of(context).pushNamed( Navigator.of(context).pushNamed(
'/router/location_map', '/router/location_map',
@ -192,7 +192,7 @@ class _StoreInfoView extends State<StoreInfoView> {
); );
}, },
child:Container( child:Container(
padding:EdgeInsets.only(right: 8.w) , padding:EdgeInsets.only(left: 8.w,right: 8.w) ,
child: Image.asset( child: Image.asset(
"assets/image/icon_union_location.webp", "assets/image/icon_union_location.webp",
width: 24.w, width: 24.w,
@ -202,7 +202,7 @@ class _StoreInfoView extends State<StoreInfoView> {
), ),
if((widget?.storeInfo?.tel ?? "") != "") if((widget?.storeInfo?.tel ?? "") != "")
GestureDetector( GestureDetector(
behavior: HitTestBehavior.opaque, behavior: HitTestBehavior.translucent,
onTap: () { onTap: () {
showCallMobile(); showCallMobile();
}, },

Loading…
Cancel
Save