Commit ac7b0a8918f61b7c2749d534666f4ae89128e676

Authored by wdn127929
1 parent 42ca4dee

ui 222

... ... @@ -261,7 +261,7 @@ class _CustomerDetailPageState extends State<CustomerDetailPage> {
)),
InkWell(
onTap: () {
// NavigatorUtil.goMarketingRecordsDetailPage(context);
NavigatorUtil.goCustomerOrderPage(context);
},
child: Text('更多',
style: TextStyle(
... ...
import 'package:flutter/material.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart';
import 'package:one_key/res/colors.dart';
import 'package:one_key/utils/utils.dart';
import 'package:one_key/widgets/MyDivider.dart';
import 'package:one_key/widgets/h_empty_view.dart';
import 'package:one_key/widgets/system_app_bar.dart';
import 'package:one_key/widgets/v_empty_view.dart';
class CustomerOrderPage extends StatefulWidget {
CustomerOrderPage({Key key}) : super(key: key);
@override
_CustomerOrderPageState createState() => _CustomerOrderPageState();
}
class _CustomerOrderPageState extends State<CustomerOrderPage> {
int year = DateTime.now().year;
@override
Widget build(BuildContext context) {
return Scaffold(
backgroundColor: Color.fromRGBO(246, 248, 250, 1),
appBar: SystemAppBar(
'客户订单',
onTap: () {
Navigator.pop(context);
},
),
body: Padding(
padding: EdgeInsets.symmetric(
horizontal: ScreenUtil().setWidth(40),
vertical: ScreenUtil().setWidth(40)),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Row(
children: [
InkWell(
onTap: () {
setState(() {
year--;
});
},
child: Image.asset(
Utils.getImgPath('c_arrow_left'),
width: ScreenUtil().setWidth(24),
)),
Padding(
padding: EdgeInsets.symmetric(
horizontal: ScreenUtil().setWidth(20)),
child: Text(
'${year}年',
style: TextStyle(
fontSize: ScreenUtil().setSp(34),
color: MyColours.color_333333),
),
),
InkWell(
onTap: () {
if (year >= DateTime.now().year) {
return;
}
setState(() {
year++;
});
},
child: Image.asset(
Utils.getImgPath(year != DateTime.now().year
? 'c_arrow_right'
: 'c_arrow_right_gray'),
width: ScreenUtil().setWidth(24),
))
],
),
VEmptyView(20),
Wrap(
children: [
Text(
'全年累计',
style: TextStyle(
fontSize: ScreenUtil().setSp(24),
color: MyColours.color_353535),
),
Text(
' 2000 ',
style: TextStyle(
fontSize: ScreenUtil().setSp(24),
color: MyColours.color_199095),
),
Text(
'单',
style: TextStyle(
fontSize: ScreenUtil().setSp(24),
color: MyColours.color_353535),
),
HEmptyView(20),
Text(
'全年取消',
style: TextStyle(
fontSize: ScreenUtil().setSp(24),
color: MyColours.color_353535),
),
Text(
' 2000 ',
style: TextStyle(
fontSize: ScreenUtil().setSp(24),
color: MyColours.color_199095),
),
Text(
'单',
style: TextStyle(
fontSize: ScreenUtil().setSp(24),
color: MyColours.color_353535),
),
],
),
VEmptyView(20),
Wrap(
children: [
Text(
'记录全额订单:',
style: TextStyle(
fontSize: ScreenUtil().setSp(24),
color: MyColours.color_353535),
),
Text(
'2000 ',
style: TextStyle(
fontSize: ScreenUtil().setSp(24),
color: MyColours.color_353535),
),
Text(
'单',
style: TextStyle(
fontSize: ScreenUtil().setSp(24),
color: MyColours.color_353535),
),
HEmptyView(20),
Text(
'记录人数订单:',
style: TextStyle(
fontSize: ScreenUtil().setSp(24),
color: MyColours.color_353535),
),
Text(
'2000 ',
style: TextStyle(
fontSize: ScreenUtil().setSp(24),
color: MyColours.color_353535),
),
Text(
'单',
style: TextStyle(
fontSize: ScreenUtil().setSp(24),
color: MyColours.color_353535),
),
],
),
VEmptyView(20),
Wrap(
children: [
Text(
'总消费:',
style: TextStyle(
fontSize: ScreenUtil().setSp(24),
color: MyColours.color_353535),
),
Text(
'2000 ',
style: TextStyle(
fontSize: ScreenUtil().setSp(24),
color: MyColours.color_353535),
),
Text(
'元',
style: TextStyle(
fontSize: ScreenUtil().setSp(24),
color: MyColours.color_353535),
),
HEmptyView(20),
Text(
'总人数:',
style: TextStyle(
fontSize: ScreenUtil().setSp(24),
color: MyColours.color_353535),
),
Text(
'2000 ',
style: TextStyle(
fontSize: ScreenUtil().setSp(24),
color: MyColours.color_353535),
),
Text(
'人',
style: TextStyle(
fontSize: ScreenUtil().setSp(24),
color: MyColours.color_353535),
),
HEmptyView(20),
Text(
'人均:',
style: TextStyle(
fontSize: ScreenUtil().setSp(24),
color: MyColours.color_353535),
),
Text(
'2000 ',
style: TextStyle(
fontSize: ScreenUtil().setSp(24),
color: MyColours.color_353535),
),
Text(
'元/人',
style: TextStyle(
fontSize: ScreenUtil().setSp(24),
color: MyColours.color_353535),
),
],
),
VEmptyView(20),
MyDivider(
double.infinity,
ScreenUtil().setWidth(1),
color: MyColours.color_E0E0E0,
),
VEmptyView(20),
Expanded(
child: ListView.builder(
shrinkWrap: true,
itemCount: 10,
// controller: controller,
itemBuilder: (BuildContext context, int index) {
return Row(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
CircleAvatar(
radius: ScreenUtil().setWidth(10),
backgroundColor: MyColours.color_199095,
),
HEmptyView(20),
Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Wrap(
children: [
Text(
'[已完成]',
style: TextStyle(
fontSize: ScreenUtil().setSp(24),
color: MyColours.color_353535),
),
HEmptyView(10),
Text(
'42天前',
style: TextStyle(
fontSize: ScreenUtil().setSp(24),
color: MyColours.color_353535),
),
HEmptyView(10),
Text(
'2021-09-29',
style: TextStyle(
fontSize: ScreenUtil().setSp(24),
color: MyColours.color_353535),
),
HEmptyView(10),
Text(
'午餐',
style: TextStyle(
fontSize: ScreenUtil().setSp(24),
color: MyColours.color_353535),
),
HEmptyView(10),
Text(
'【201】',
style: TextStyle(
fontSize: ScreenUtil().setSp(24),
color: MyColours.color_353535),
),
],
),
VEmptyView(20),
Row(
children: [
Text(
'人数:',
style: TextStyle(
fontSize: ScreenUtil().setSp(24),
color: MyColours.color_353535),
),
Text(
'未记录',
style: TextStyle(
fontSize: ScreenUtil().setSp(24),
color: MyColours.color_353535),
),
HEmptyView(20),
Text(
'消费:',
style: TextStyle(
fontSize: ScreenUtil().setSp(24),
color: MyColours.color_353535),
),
Text(
'未记录',
style: TextStyle(
fontSize: ScreenUtil().setSp(24),
color: MyColours.color_353535),
),
],
),
VEmptyView(20),
Text(
'客户经理:xxx 18739837273',
style: TextStyle(
fontSize: ScreenUtil().setSp(24),
color: MyColours.color_353535),
),
VEmptyView(40),
],
)
],
);
},
))
],
)));
}
}
... ...
... ... @@ -585,4 +585,13 @@ class NavigatorUtil {
return _navigateTo(context, "${Routes.festival_edit_page}",
replace: replace);
}
///客户订单
static Future<dynamic> goCustomerOrderPage(
BuildContext context, {
replace = false,
}) {
return _navigateTo(context, "${Routes.customer_order_page}",
replace: replace);
}
}
... ...
... ... @@ -43,6 +43,7 @@ import 'package:one_key/pages/message/message_order_menu.dart';
import 'package:one_key/pages/my/customer_type/customer_detail_edit_page.dart';
import 'package:one_key/pages/my/customer_type/customer_detail_page.dart';
import 'package:one_key/pages/my/customer_type/customer_list_page.dart';
import 'package:one_key/pages/my/customer_type/customer_order_page.dart';
import 'package:one_key/pages/my/customer_type/customer_setting_page.dart';
import 'package:one_key/pages/my/customer_type/festival_edit_page.dart';
import 'package:one_key/pages/my/customer_type/make_marking_page.dart';
... ... @@ -911,4 +912,13 @@ var festivalEditPageHandle = new Handler(
create: (_) => CustomerProvider(), child: FestivalEditPage());
});
///客户订单
var customerOrderPageHandle = new Handler(
handlerFunc: (BuildContext context, Map<dynamic, List<Object>> params) {
// String idstr = params["idstr"].first;
// UserHistoryEntity userHistoryEntity = UserHistoryEntity.fromJson(json.decode(
// FluroConvertUtils.fluroCnParamsDecode(
// params["userHistoryEntity"].first)));
return ChangeNotifierProvider<CustomerProvider>(
create: (_) => CustomerProvider(), child: CustomerOrderPage());
});
... ...
... ... @@ -80,6 +80,9 @@ class Routes {
static String festival_edit_page =
"/festival_edit_page"; //编辑纪念日
static String customer_order_page =
"/customer_order_page"; //客户订单
static void configureRoutes(FluroRouter router) {
... ... @@ -168,6 +171,10 @@ class Routes {
handler: customerDetailEditPageHandle);
router.define(festival_edit_page,
handler: festivalEditPageHandle);
router.define(customer_order_page,
handler: customerOrderPageHandle);
}
}
... ...
... ... @@ -2348,6 +2348,7 @@ class DialogUtil {
String yearStr = '选填';
String monthStr = '';
String dayStr = '';
bool gongli = true;
final action = await showDialog(
context: context,
barrierDismissible: true,
... ... @@ -2468,36 +2469,86 @@ class DialogUtil {
Row(
children: [
InkWell(
onTap: () {
if (gongli) {
return;
}
stateSetter(() {
gongli = !gongli;
});
if (dayStr != '') {
List dayList = updateDay(
gongli,
yearStr == '选填'
? DateTime.now()
.year
.toString()
: yearStr,
monthStr == ''
? DateTime.now()
.month
.toString()
: monthStr);
if (!dayList.contains(dayStr)) {
stateSetter(() {
dayStr = '';
});
}
}
},
child: Container(
padding: EdgeInsets.symmetric(
horizontal: ScreenUtil().setWidth(5),
vertical: ScreenUtil().setWidth(6)),
decoration: BoxDecoration(
color: true
? MyColours.color_199095
: MyColours.color_ffffff,
borderRadius: BorderRadius.only(
topLeft: Radius.circular(
ScreenUtil().setWidth(10)),
bottomLeft: Radius.circular(
ScreenUtil().setWidth(10))),
border: Border.all(
color: MyColours.color_199095,
width: ScreenUtil().setWidth(2))),
child: Text('公历',
style: TextStyle(
fontSize: ScreenUtil().setSp(28),
color: true
? MyColours.color_ffffff
: MyColours.color_333333)),
)),
padding: EdgeInsets.symmetric(
horizontal: ScreenUtil().setWidth(5),
vertical: ScreenUtil().setWidth(6)),
decoration: BoxDecoration(
color: gongli
? MyColours.color_199095
: MyColours.color_ffffff,
borderRadius: BorderRadius.only(
topLeft: Radius.circular(
ScreenUtil().setWidth(10)),
bottomLeft: Radius.circular(
ScreenUtil().setWidth(10))),
border: Border.all(
color: MyColours.color_199095,
width: ScreenUtil().setWidth(2))),
child: Text('公历',
style: TextStyle(
fontSize: ScreenUtil().setSp(28),
color: gongli
? MyColours.color_ffffff
: MyColours.color_333333)),
)),
InkWell(
onTap: () {
if (!gongli) {
return;
}
stateSetter(() {
gongli = !gongli;
});
if (dayStr != '') {
List dayList = updateDay(
gongli,
yearStr == '选填'
? DateTime.now().year.toString()
: yearStr,
monthStr == ''
? DateTime.now().month.toString()
: monthStr);
if (!dayList.contains(dayStr)) {
stateSetter(() {
dayStr = '';
});
}
}
},
child: Container(
padding: EdgeInsets.symmetric(
horizontal: ScreenUtil().setWidth(5),
vertical: ScreenUtil().setWidth(6)),
decoration: BoxDecoration(
color: false
color: !gongli
? MyColours.color_199095
: MyColours.color_ffffff,
borderRadius: BorderRadius.only(
... ... @@ -2511,7 +2562,7 @@ class DialogUtil {
child: Text('农历',
style: TextStyle(
fontSize: ScreenUtil().setSp(28),
color: false
color: !gongli
? MyColours.color_ffffff
: MyColours.color_333333))),
),
... ... @@ -2520,7 +2571,7 @@ class DialogUtil {
onTap: () {
incrementCounterYear(
context,
true,
gongli,
yearStr == '选填'
? DateTime.now().year.toString()
: yearStr, (year) {
... ... @@ -2572,7 +2623,7 @@ class DialogUtil {
onTap: () {
incrementCounterMonth(
context,
true,
gongli,
yearStr == '选填'
? DateTime.now().year.toString()
: yearStr,
... ... @@ -2585,7 +2636,7 @@ class DialogUtil {
});
if (dayStr != '') {
List dayList = updateDay(
true,
gongli,
yearStr == '选填'
? DateTime.now()
.year
... ... @@ -2646,7 +2697,7 @@ class DialogUtil {
onTap: () {
incrementCounterDay(
context,
true,
gongli,
yearStr == '选填'
? DateTime.now().year.toString()
: yearStr,
... ...
... ... @@ -111,7 +111,7 @@ class _PickBodyDayState extends State<PickBodyDay> {
dayController =
new FixedExtentScrollController(initialItem: int.parse(widget.day) - 1);
sDay = widget.day;
DateTime today = DateTime.now();
// DateTime today = DateTime.now();
// 请空之前的数据
... ... @@ -377,7 +377,6 @@ class _PickBodyDayState extends State<PickBodyDay> {
])));
}
List<Widget> XZItem(_data, type) {
List<Widget> list = new List();
... ...
... ... @@ -28,28 +28,29 @@ List updateDay(bool gongli, String year, String month) {
}
return yday;
} else {
int count1 = getYangliDay(int.parse(year), int.parse(month));
int count = getNongliDay(int.parse(year), int.parse(month));
print('count---$count1');
print('农历天数count---$count');
List yday = [];
for (int m = 1; m < count1 + 1; m++) {
for (int m = 1; m < count + 1; m++) {
yday.add('$m');
}
int count = getNongliDay(int.parse(year), int.parse(month));
print('农历的天数==${count}');
// int count = getNongliDay(int.parse(year), int.parse(month));
List old = yday;
// print('农历的天数==${count}');
List newDay = old.sublist(0, count);
// List old = yday;
print(old);
// List newDay = old.sublist(0, count);
print(newDay);
// print(old);
yday = newDay;
// print(newDay);
// yday = newDay;
return yday;
}
}
... ... @@ -117,8 +118,8 @@ class _PickBodyMonthState extends State<PickBodyMonth> {
// 获取当天的日期,年份默认选择的是2000年,月份默认是6月,日期默认是15日,时间默认是不详
monthController = new FixedExtentScrollController(
initialItem: int.parse(widget.month) - 1);
DateTime today = DateTime.now();
// DateTime today = DateTime.now();
sMonth = widget.month;
// 请空之前的数据
yMonth = [];
... ...