Commit b68e17971dcc19b4b69820124ab277ad05dd9c1c

Authored by wdn127929
1 parent 18dc71fb

uiui

... ... @@ -388,7 +388,9 @@ class _CustomerDetailPageState extends State<CustomerDetailPage> {
height: ScreenUtil().setWidth(50),
fontSize: 26,
isBold: false,
onPressed: () {},
onPressed: () {
NavigatorUtil.goFestivalEditPage(context);
},
),
],
),
... ...
import 'package:flutter/material.dart';
import 'package:flutter_screenutil/screenutil.dart';
import 'package:one_key/res/colors.dart';
import 'package:one_key/utils/dialog_util.dart';
import 'package:one_key/utils/utils.dart';
import 'package:one_key/widgets/h_empty_view.dart';
import 'package:one_key/widgets/round_button.dart';
import 'package:one_key/widgets/system_app_bar.dart';
import 'package:one_key/widgets/v_empty_view.dart';
class FestivalEditPage extends StatefulWidget {
FestivalEditPage({Key key}) : super(key: key);
@override
_FestivalEditPageState createState() => _FestivalEditPageState();
}
class _FestivalEditPageState extends State<FestivalEditPage> {
@override
Widget build(BuildContext context) {
return Scaffold(
backgroundColor: MyColours.color_ffffff,
appBar: SystemAppBar(
'纪念日',
onTap: () {
Navigator.pop(context);
},
),
body: Padding(
padding: EdgeInsets.symmetric(
horizontal: ScreenUtil().setWidth(40),
vertical: ScreenUtil().setWidth(40)),
child: Column(children: [
Expanded(
child: ListView.builder(
shrinkWrap: true,
itemCount: 10,
itemBuilder: (BuildContext context, int index) {
return InkWell(
onTap: () {
DialogUtil.festivalAlertDialog(context, 'ggg', 700,
rCallback: (name) {
// _addCookbookClass(name, showLoading: true);
});
},
child: Padding(
padding: EdgeInsets.symmetric(
horizontal: ScreenUtil().setWidth(20),
vertical: ScreenUtil().setWidth(20)),
child: Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
Expanded(
child: Text(
'本人生日:12月18日(公历)',
overflow: TextOverflow.ellipsis,
style: TextStyle(
fontSize: ScreenUtil().setSp(26),
color: MyColours.color_333333),
)),
HEmptyView(10),
Image.asset(
Utils.getImgPath('c_edit'),
width: ScreenUtil().setWidth(40),
// height: ScreenUtil().setWidth(10),
)
],
),
));
},
)),
RoundButton(
text: '新增',
radius: ScreenUtil().setWidth(10),
margin:
EdgeInsets.symmetric(horizontal: ScreenUtil().setWidth(90)),
height: ScreenUtil().setWidth(80),
fontSize: 26,
isBold: false,
onPressed: () {},
),
VEmptyView(30)
])));
}
}
... ...
... ... @@ -575,4 +575,13 @@ class NavigatorUtil {
return _navigateTo(context, "${Routes.customer_edit_detail_page}",
replace: replace);
}
///纪念日
static Future<dynamic> goFestivalEditPage(
BuildContext context, {
replace = false,
}) {
return _navigateTo(context, "${Routes.festival_edit_page}",
replace: replace);
}
}
... ...
... ... @@ -44,6 +44,7 @@ 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_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';
import 'package:one_key/pages/my/customer_type/marketing_records_detail_page.dart';
import 'package:one_key/pages/my/customer_type/marketing_records_page.dart';
... ... @@ -897,3 +898,16 @@ var customerDetailEditPageHandle = new Handler(
return ChangeNotifierProvider<CustomerProvider>(
create: (_) => CustomerProvider(), child: CustomerDetailEditPage());
});
///纪念日
var festivalEditPageHandle = 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: FestivalEditPage());
});
... ...
... ... @@ -78,6 +78,10 @@ class Routes {
static String customer_edit_detail_page =
"/customer_edit_detail_page"; //编辑客户详情
static String festival_edit_page =
"/festival_edit_page"; //编辑纪念日
static void configureRoutes(FluroRouter router) {
router.notFoundHandler = new Handler(
handlerFunc: (BuildContext context, Map<String, List<String>> params) {
... ... @@ -160,7 +164,10 @@ class Routes {
handler: marketingRecordsDetailPageHandle);
router.define(make_marketing_page, handler: makeMarkingPageHandle);
router.define(customer_detail_page, handler: customerDetailPageHandle);
router.define(customer_edit_detail_page, handler: customerDetailEditPageHandle);
router.define(customer_edit_detail_page,
handler: customerDetailEditPageHandle);
router.define(festival_edit_page,
handler: festivalEditPageHandle);
}
}
... ...
... ... @@ -1304,7 +1304,7 @@ class DialogUtil {
color: MyColours.color_ffffff,
child: Column(
children: <Widget>[
TableCalendar(
TableCalendar(
// rowHeight: ScreenUtil().setWidth(100),
calendarController: _calendarController,
initialSelectedDay: selectDateTime,
... ... @@ -1536,10 +1536,10 @@ class DialogUtil {
// bottom: 0,
// top: ScreenUtil().setWidth(30),
// child: buildMarker(date)),
// Align(
// alignment: Alignment.bottomCenter,
// child: buildMarker(date),
// )
// Align(
// alignment: Alignment.bottomCenter,
// child: buildMarker(date),
// )
// );
// }
... ... @@ -2339,6 +2339,330 @@ class DialogUtil {
);
}
static Future festivalAlertDialog(
BuildContext context, String name, double height,
{CustomCallBack rCallback, double fontSize = 28}) async {
final action = await showDialog(
context: context,
barrierDismissible: true,
builder: (BuildContext context) {
TextEditingController controller = TextEditingController();
controller.text = name;
return Scaffold(
backgroundColor: Colors.transparent,
body: Center(
child: Container(
padding:
EdgeInsets.symmetric(horizontal: ScreenUtil().setWidth(72)),
height: ScreenUtil().setWidth(height),
decoration: BoxDecoration(
borderRadius:
BorderRadius.circular(ScreenUtil().setWidth(30))),
child: Card(
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.all(
Radius.circular(ScreenUtil().setWidth(30)))), //设置圆角
child: Padding(
padding: EdgeInsets.symmetric(
horizontal: ScreenUtil().setWidth(40)),
child: Column(
children: [
// VEmptyView(60),
Stack(children: [
Container(
padding: EdgeInsets.only(
top: ScreenUtil().setWidth(60),
bottom: ScreenUtil().setWidth(50)),
// color: Colors.red,
alignment: Alignment.center,
child: Text('纪念日名称',
style: TextStyle(
fontSize: ScreenUtil().setSp(fontSize),
color: MyColours.color_353535)),
),
Positioned(
right: 0,
top: ScreenUtil().setWidth(36),
child: Text('删除',
style: TextStyle(
decoration: TextDecoration.underline,
fontSize: ScreenUtil().setSp(26),
color: MyColours.color_199095)))
]),
Container(
height: ScreenUtil().setWidth(40),
// color: Colors.red,
padding: EdgeInsets.symmetric(
horizontal: ScreenUtil().setWidth(68)),
alignment: Alignment.center,
child: Material(
color: Colors.transparent,
child: TextField(
controller: controller,
maxLines: 1,
// //光标颜色
// cursorColor:
// widget.isSelect ? Colors.white : MyColours.color_199095,
// //输入文本的样式
// inputFormatters: lenghtLimit
// ? [
// LengthLimitingTextInputFormatter(10),
// ]
// : [],
textAlignVertical:
TextAlignVertical.bottom,
textAlign: TextAlign.center,
style: TextStyle(
fontSize: ScreenUtil().setSp(26),
),
decoration: InputDecoration(
border: OutlineInputBorder(
borderSide: BorderSide.none),
hintText: '例:本人生日',
hintStyle: TextStyle(
color: MyColours.color_999999,
fontSize: ScreenUtil().setSp(26),
),
enabledBorder: new UnderlineInputBorder(
borderSide: BorderSide.none,
),
focusedBorder: new UnderlineInputBorder(
borderSide: BorderSide.none,
),
),
onChanged: (value) {
name = value;
},
onEditingComplete: () {
FocusScope.of(context).requestFocus(
FocusNode()); //点击空白处隐藏键盘
},
keyboardType: TextInputType.text))),
// VEmptyView(28),
MyDivider(ScreenUtil().setWidth(280 * 2),
ScreenUtil().setWidth(2),
color: MyColours.color_efefef),
Container(
padding: EdgeInsets.only(
top: ScreenUtil().setWidth(40),
bottom: ScreenUtil().setWidth(50)),
// color: Colors.red,
alignment: Alignment.center,
child: Text('纪念日日期',
style: TextStyle(
fontSize: ScreenUtil().setSp(fontSize),
color: MyColours.color_353535)),
),
Row(
children: [
InkWell(
child: Container(
padding: EdgeInsets.symmetric(
horizontal: ScreenUtil().setWidth(10),
vertical: ScreenUtil().setWidth(10)),
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)),
)),
InkWell(
child: Container(
padding: EdgeInsets.symmetric(
horizontal: ScreenUtil().setWidth(10),
vertical: ScreenUtil().setWidth(10)),
decoration: BoxDecoration(
color: false
? MyColours.color_199095
: MyColours.color_ffffff,
borderRadius: BorderRadius.only(
topRight: Radius.circular(
ScreenUtil().setWidth(10)),
bottomRight: 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: false
? MyColours.color_ffffff
: MyColours.color_333333))),
),
],
),
Row(
children: [
InkWell(
child: Container(
height: ScreenUtil().setWidth(47 * 2),
alignment: Alignment.center,
child: Text(
'取消',
style: TextStyle(
color: MyColours.color_199095,
fontSize: ScreenUtil().setWidth(34)),
),
),
onTap: () {
Navigator.of(context).pop();
},
),
InkWell(
child: Container(
height: ScreenUtil().setWidth(47 * 2),
alignment: Alignment.center,
child: Text(
'保存',
style: TextStyle(
color: MyColours.color_199095,
fontSize: ScreenUtil().setWidth(34)),
),
),
onTap: () {
if (name == '' || name.trim().length == 0) {
Utils.showToast('请输入纪念日名称');
return;
}
Navigator.of(context).pop();
rCallback(name);
},
)
],
)
],
)),
),
),
));
},
);
}
// static Future festivalAlertDialog(BuildContext context,
// {String title = "标题",
// String text = "内容",
// String hintText = "内容",
// String lTitle = "取消",
// String rTitle = "确定",
// String toast = '请输入',
// VoidCallback lCallback,
// bool lenghtLimit = false,
// TextInputType keyboardType = TextInputType.text,
// CustomCallBack rCallback}) {
// String name = text;
// TextEditingController controller = TextEditingController();
// controller.text = text;
// showCupertinoDialog(
// context: context,
// builder: (context) {
// return Stack(children: [
// CupertinoAlertDialog(
// title: title != ''
// ? Text(title,
// style: TextStyle(
// fontWeight: FontWeight.bold,
// fontSize: ScreenUtil().setSp(30),
// ))
// : SizedBox(),
// content: Material(
// color: Colors.transparent,
// child: TextField(
// controller: controller,
// maxLines: 1,
// autofocus: true,
// // //光标颜色
// // cursorColor:
// // widget.isSelect ? Colors.white : MyColours.color_199095,
// //输入文本的样式
// inputFormatters: lenghtLimit
// ? [
// LengthLimitingTextInputFormatter(10),
// ]
// : [],
// textAlignVertical: TextAlignVertical.bottom,
// textAlign: TextAlign.center,
// style: TextStyle(
// fontSize: ScreenUtil().setSp(28),
// ),
// decoration: InputDecoration(
// border: OutlineInputBorder(borderSide: BorderSide.none),
// hintText: hintText,
// hintStyle: TextStyle(
// color: MyColours.color_999999,
// fontSize: ScreenUtil().setSp(28),
// ),
// enabledBorder: new UnderlineInputBorder(
// borderSide: BorderSide.none,
// ),
// focusedBorder: new UnderlineInputBorder(
// borderSide: BorderSide.none,
// ),
// ),
// onChanged: (value) {
// name = value;
// },
// onEditingComplete: () {
// FocusScope.of(context)
// .requestFocus(FocusNode()); //点击空白处隐藏键盘
// },
// keyboardType: keyboardType)),
// actions: [
// CupertinoDialogAction(
// child: Text(lTitle,
// style: TextStyle(
// fontSize: ScreenUtil().setSp(34),
// color: MyColours.color_666666)),
// onPressed: () {
// Navigator.of(context).pop();
// lCallback();
// },
// ),
// CupertinoDialogAction(
// child: Text(rTitle,
// style: TextStyle(
// fontSize: ScreenUtil().setSp(34),
// color: MyColours.color_199095)),
// onPressed: () {
// if (name == '' || name.trim().length == 0) {
// Utils.showToast(toast);
// return;
// }
// Navigator.of(context).pop();
// rCallback(name);
// },
// ),
// ],
// ),
// Positioned(
// right: 0,
// top: 0,
// child: Text('删除',
// style: TextStyle(
// fontWeight: FontWeight.bold,
// fontSize: ScreenUtil().setSp(30),
// color: MyColours.color_199095)))
// ]);
// },
// );
// }
//输入弹框
static Future textfeildAlertDialog(BuildContext context,
{String title = "标题",
... ...