Commit 42f057589b0cfa10eaedf25a385fc9ca6db75730

Authored by wdn127929
1 parent 0fcf9bc2

ui

16.4 KB | W: | H:

6.13 KB | W: | H:

  • 2-up
  • Swipe
  • Onion skin
... ... @@ -8,6 +8,7 @@ import 'package:one_key/pages/my/customer_type/contant_list_page.dart';
import 'package:one_key/provider/customer_provider.dart';
import 'package:one_key/provider/user_model.dart';
import 'package:one_key/res/colors.dart';
import 'package:one_key/route/navigator_util.dart';
import 'package:one_key/utils/event_bus.dart';
import 'package:one_key/utils/utils.dart';
... ... @@ -92,6 +93,9 @@ class _CustomerListPageState extends State<CustomerListPage>
HEmptyView(20),
Expanded(
child: InkWell(
onTap: () {
NavigatorUtil.goMakeMarkingPage(context);
},
child: Container(
alignment: Alignment.center,
padding: EdgeInsets.all(ScreenUtil().setWidth(20)),
... ...
import 'package:common_utils/common_utils.dart';
import 'package:flutter/material.dart';
import 'package:flutter_screenutil/screenutil.dart';
import 'package:one_key/pages/coupon/coupon_page.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';
typedef ClickCallback = void Function(dynamic value);
class MakeMarkingPage extends StatefulWidget {
MakeMarkingPage({Key key}) : super(key: key);
@override
_MakeMarkingPageState createState() => _MakeMarkingPageState();
}
class _MakeMarkingPageState extends State<MakeMarkingPage> {
TextEditingController controller = TextEditingController();
List<String> couponList = [
'98折(ccccckkkkshjhjsjsvc)kkkkkk',
'fffff',
'fffff',
'ffsdfasfaf'
];
int couponSelectIndex = 0;
final GlobalKey<ScaffoldState> scaffoldKey = GlobalKey<ScaffoldState>();
FocusNode _focusNode = FocusNode();
bool showDateSelWidget = false;
String limitDate = '';
@override
void initState() {
super.initState();
_focusNode.addListener(() {
if (_focusNode.hasFocus) {
//有焦点
if (showDateSelWidget) {
Navigator.pop(context);
showDateSelWidget = false;
}
} else {
//失去焦点
// _editingController.text = '';
}
});
}
_buttonChoose(String title, ClickCallback callback) {
return InkWell(
onTap: () {
callback(title);
},
child: Padding(
padding: EdgeInsets.symmetric(
horizontal: ScreenUtil().setWidth(20),
vertical: ScreenUtil().setWidth(10)),
// height: ScreenUtil().setWidth(50),
// decoration: BoxDecoration(
// // border: Border.all(
// // width: ScreenUtil().setWidth(2),
// // color: MyColours.color_199095),
// borderRadius: BorderRadius.circular(ScreenUtil().setWidth(10))),
child: Row(
children: [
Expanded(
child: Text(
title,
overflow: TextOverflow.ellipsis,
style: TextStyle(
color: title == '时间(选填)' || title == '(选填)'
? MyColours.color_999999
: MyColours.color_199095,
fontSize: ScreenUtil().setWidth(30)),
)),
HEmptyView(10),
Image.asset(
Utils.getImgPath('c_arrow_down'),
width: ScreenUtil().setWidth(30),
// height: ScreenUtil().setWidth(10),
)
],
)));
}
///短信内容编辑UI
Widget _contentWidget(String hintText) {
return Container(
// height: ScreenUtil().setWidth(380),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
// Align(
// alignment: Alignment.centerLeft,
// child: Text(
// title,
// textAlign: TextAlign.left,
// style: TextStyle(
// color: MyColours.color_333333,
// fontWeight: FontWeight.bold,
// fontSize: ScreenUtil().setSp(34)),
// )),
// VEmptyView(30),
TextField(
controller: controller,
// keyboardType: TextInputType.number, //键盘类型,数字键盘
maxLines: 10,
focusNode: _focusNode,
// maxLength: 50,
// maxLengthEnforced: true,
style: TextStyle(
fontSize: ScreenUtil().setSp(28),
color: MyColours.color_333333), //输入文本的样式
decoration: InputDecoration(
contentPadding: EdgeInsets.all(ScreenUtil().setWidth(30)),
hintText: hintText,
hintStyle: TextStyle(
color: MyColours.color_999999,
fontSize: ScreenUtil().setSp(28),
),
fillColor: MyColours.color_F9F9F9,
// fillColor: Colors.red,
filled: true,
enabledBorder: OutlineInputBorder(
//未选中时候的颜色
borderRadius: BorderRadius.circular(ScreenUtil().setWidth(20)),
borderSide: BorderSide(
color: MyColours.color_cccccc,
width: ScreenUtil().setWidth(2)),
),
focusedBorder: OutlineInputBorder(
//选中时外边框颜色
borderRadius: BorderRadius.circular(ScreenUtil().setWidth(20)),
borderSide: BorderSide(
color: MyColours.app_main,
),
),
// border: OutlineInputBorder(
// borderRadius:
// BorderRadius.circular(ScreenUtil().setWidth(20)),
// borderSide: BorderSide(
// color: Colors.red, width: ScreenUtil().setWidth(2))),
),
onChanged: (value) {
setState(() {});
},
),
VEmptyView(20),
Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
InkWell(
onTap: () {
// NavigatorUtil.goMarketingRecordsDetailPage(context);
},
child: Padding(
padding: EdgeInsets.symmetric(
horizontal: ScreenUtil().setWidth(20)),
child: Text('清空',
style: TextStyle(
color: MyColours.color_199095,
fontSize: ScreenUtil().setSp(26))),
)),
Text('共 ${controller.text.length} 字 0 条短信',
style: TextStyle(
color: MyColours.color_333333,
fontSize: ScreenUtil().setSp(26))),
],
),
VEmptyView(40),
Row(children: [
Image.asset(
Utils.getImgPath(true ? 'c_mul_select' : 'c_mul_select_un'),
width: ScreenUtil().setWidth(30)),
HEmptyView(15),
Text(
'营销加入优惠',
style: TextStyle(
fontSize: ScreenUtil().setSp(36),
fontWeight: FontWeight.bold,
color: MyColours.color_333333),
),
]),
VEmptyView(30),
Row(children: [
Expanded(
child: Container(
height: ScreenUtil().setWidth(70),
// width: ScreenUtil().setWidth(130),
decoration: BoxDecoration(
borderRadius:
BorderRadius.circular(ScreenUtil().setWidth(10)),
color: Color.fromRGBO(239, 239, 239, 1)),
child:
_buttonChoose(couponList[couponSelectIndex], (value) {
FocusScope.of(context).requestFocus(FocusNode()); //隐藏键盘
DialogUtil.showSelectCusmanDialog(context, couponList,
(value) {
if (value != null) {
setState(() {
couponSelectIndex = value.first;
});
}
},
selecteds: couponSelectIndex == null
? []
: [couponSelectIndex])
.then((value) {});
}))),
HEmptyView(30),
InkWell(
onTap: () {
// NavigatorUtil.goMarketingRecordsDetailPage(context);
},
child: Text('创建新优惠',
style: TextStyle(
decoration: TextDecoration.underline,
color: MyColours.color_199095,
fontSize: ScreenUtil().setSp(26)))),
]),
VEmptyView(30),
Row(children: [
Image.asset(
Utils.getImgPath(true ? 'c_mul_select' : 'c_mul_select_un'),
width: ScreenUtil().setWidth(30)),
HEmptyView(15),
Text(
'客户经理不可修改短信内容',
style: TextStyle(
fontSize: ScreenUtil().setSp(26),
color: MyColours.color_333333),
),
]),
VEmptyView(30),
Row(children: [
Image.asset(
Utils.getImgPath(true ? 'c_mul_select' : 'c_mul_select_un'),
width: ScreenUtil().setWidth(30)),
HEmptyView(15),
Text(
'最晚完成期限',
style: TextStyle(
fontSize: ScreenUtil().setSp(26),
color: MyColours.color_333333),
),
HEmptyView(15),
InkWell(
onTap: () {
FocusScope.of(context).requestFocus(FocusNode()); //点击空白处隐藏键盘
//弹出时间选择器
// showPickerDateTime(context);
showDateSelWidget = true;
DialogUtil.showPickerDateTime24(
context,
scaffoldKey,
(value) {
// {'text': picker.adapter.text, 'select': selecteds}
if (value != null) {
setState(() {
print(value);
limitDate = DateUtil.formatDateStr(value,
format: DateFormats.full);
});
}
showDateSelWidget = false;
},
dateTime: DateUtil.getDateTime(limitDate),
onCancel: () {
showDateSelWidget = false;
});
},
child: Row(
children: [
Container(
// height: ScreenUtil().setWidth(70),
alignment: Alignment.center,
// width: ScreenUtil().setWidth(280),
padding: EdgeInsets.symmetric(
horizontal: ScreenUtil().setWidth(30)),
decoration: BoxDecoration(
border: Border(
bottom: BorderSide(
color: Color.fromRGBO(175, 176, 177, 1),
width: ScreenUtil().setWidth(2)))),
child: Text(
limitDate,
style: TextStyle(
fontSize: ScreenUtil().setSp(26),
color: MyColours.color_333333),
)),
Image.asset(
Utils.getImgPath('c_arrow_down'),
width: ScreenUtil().setWidth(30),
// height: ScreenUtil().setWidth(10),
)
],
),
),
]),
],
),
);
}
@override
Widget build(BuildContext context) {
return Scaffold(
backgroundColor: Color.fromRGBO(246, 248, 250, 1),
key: scaffoldKey,
appBar: SystemAppBar(
'创建营销任务',
onTap: () {
Navigator.pop(context);
},
),
body: Column(
children: [
Expanded(
child: SingleChildScrollView(
child: Column(
children: [
VEmptyView(10),
Container(
color: MyColours.color_199095,
padding: EdgeInsets.symmetric(
horizontal: ScreenUtil().setWidth(30),
vertical: ScreenUtil().setWidth(30)),
child: Row(
children: [
Expanded(
child: Text(
'已选[沉睡、活跃、流失]100位顾客',
style: TextStyle(
color: MyColours.color_ffffff,
fontSize: ScreenUtil().setSp(32)),
)),
HEmptyView(10),
InkWell(
onTap: () {
// NavigatorUtil.goMarketingRecordsDetailPage(context);
},
child: Text('查看',
style: TextStyle(
decoration: TextDecoration.underline,
color: MyColours.color_ffffff,
fontSize: ScreenUtil().setSp(26)))),
],
),
),
Padding(
padding: EdgeInsets.symmetric(
horizontal: ScreenUtil().setWidth(30),
),
child: Column(
children: [VEmptyView(50), _contentWidget('输入营销短信内容')],
),
)
],
),
)),
RoundButton(
text: '确认下发任务',
gradientStart: MyColours.color_199095,
gradientEnd: MyColours.color_199095,
// borderColor: MyColours.color_999999,
radius: ScreenUtil().setWidth(40),
height: ScreenUtil().setWidth(80),
fontSize: 26,
margin:
EdgeInsets.symmetric(horizontal: ScreenUtil().setWidth(230)),
isBold: false,
onPressed: () {
// NavigatorUtil.goEnterStoreEnvironmentPage(context);
},
),
VEmptyView(30),
RoundButton(
text: '取消',
gradientStart: MyColours.color_ffffff,
gradientEnd: MyColours.color_ffffff,
textColor: MyColours.color_199095,
borderColor: MyColours.color_199095,
radius: ScreenUtil().setWidth(40),
height: ScreenUtil().setWidth(80),
fontSize: 26,
margin:
EdgeInsets.symmetric(horizontal: ScreenUtil().setWidth(230)),
isBold: false,
onPressed: () {
// DialogUtil.cupertinoAlertDialog(context,
// title: "取消任务",
// content: "点击确定立即取消任务,已完成的客户经理继续生效",
// lTitle: "返回",
// rTitle: "确定取消", lCallback: () {
// print("返回");
// }, rCallback: () {
// print("确定取消任务");
// });
},
),
VEmptyView(40),
],
),
);
}
}
... ...
import 'package:flutter/material.dart';
import 'package:flutter_screenutil/flutter_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/row_multi_text.dart';
import 'package:one_key/widgets/system_app_bar.dart';
import 'package:one_key/widgets/v_empty_view.dart';
class MarketingRecordsDetailPage extends StatefulWidget {
MarketingRecordsDetailPage({Key key}) : super(key: key);
@override
_MarketingRecordsDetailPageState createState() =>
_MarketingRecordsDetailPageState();
}
class _MarketingRecordsDetailPageState
extends State<MarketingRecordsDetailPage> {
//构建经理btn
List<Widget> _buildLabelItem(List<String> data,
{Color bgColor = MyColours.color_199095}) {
List<Widget> items = [];
for (String item in data) {
items.add(InkWell(
onTap: () {},
child: Container(
// height: ScreenUtil().setWidth(40),
padding: EdgeInsets.symmetric(
horizontal: ScreenUtil().setWidth(20),
vertical: ScreenUtil().setWidth(6)),
decoration: BoxDecoration(
color: item.contains('未完成')
? Color.fromRGBO(207, 29, 35, 1)
: MyColours.color_199095,
borderRadius: BorderRadius.circular(ScreenUtil().setWidth(10))),
child: Text(
item,
style: TextStyle(
color: MyColours.color_ffffff,
fontSize: ScreenUtil().setSp(26),
),
),
)));
}
return items;
}
@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(30),
// vertical: ScreenUtil().setWidth(40)
),
child: Column(
children: [
Expanded(
child: SingleChildScrollView(
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Stack(
alignment: Alignment.bottomCenter,
children: [
Column(
children: [
RowMultiText(
'创建日期',
'2021-12-22',
textColor: MyColours.color_333333,
bgColor: Color.fromRGBO(246, 248, 250, 1),
),
RowMultiText(
'创建人',
'管理员',
textColor: MyColours.color_333333,
bgColor: Color.fromRGBO(246, 248, 250, 1),
),
],
),
Positioned(
child: Image.asset(
Utils.getImgPath('c_state_ing'),
width: ScreenUtil().setWidth(140),
))
],
),
RowMultiText(
'完成期限',
'2021-12-22 23:59:59',
textColor: MyColours.color_333333,
bgColor: Color.fromRGBO(246, 248, 250, 1),
),
RowMultiText(
'修改短信内容',
'可修改',
textColor: MyColours.color_333333,
bgColor: Color.fromRGBO(246, 248, 250, 1),
),
RowMultiText(
'优惠信息',
'98折(仅限菜品堂食)',
textColor: MyColours.color_333333,
bgColor: Color.fromRGBO(246, 248, 250, 1),
),
Padding(
padding: EdgeInsets.only(
top: ScreenUtil().setWidth(25),
bottom: ScreenUtil().setWidth(20)),
child: Text(
'短信内容',
style: TextStyle(
color: MyColours.color_333333,
fontSize: ScreenUtil().setSp(30)),
)),
Padding(
padding:
EdgeInsets.only(bottom: ScreenUtil().setWidth(25)),
child: Text(
'dfdsgdfgdksgsdkghjksdhgjskdhgjsdhgsjkhdgfjksdhgsdjfdgg\nhsdfgjgsjgdhsddhfghdgjsgjdg',
style: TextStyle(
color: MyColours.color_999999,
fontSize: ScreenUtil().setSp(30)),
)),
Padding(
padding: EdgeInsets.symmetric(
vertical: ScreenUtil().setWidth(25),
),
child: Row(
crossAxisAlignment: CrossAxisAlignment.center,
children: [
Text(
'总客户人数',
style: TextStyle(
color: MyColours.color_333333,
fontSize: ScreenUtil().setSp(30)),
),
Spacer(),
Text('55人',
style: TextStyle(
color: MyColours.color_333333,
fontSize: ScreenUtil().setSp(30))),
HEmptyView(10),
InkWell(
onTap: () {
// NavigatorUtil.goMarketingRecordsDetailPage(context);
},
child: Text('查看',
style: TextStyle(
decoration: TextDecoration.underline,
color: MyColours.color_199095,
fontSize: ScreenUtil().setSp(30)))),
])),
RowMultiText(
'参与经理',
'5人',
textColor: MyColours.color_333333,
bgColor: Color.fromRGBO(246, 248, 250, 1),
),
Padding(
padding: EdgeInsets.only(
bottom: ScreenUtil().setWidth(25),
),
child: Wrap(
spacing: ScreenUtil().setWidth(20),
runSpacing: ScreenUtil().setWidth(10),
children: _buildLabelItem([
'xx经理已完成',
'xx经理未完成',
'dfsdfsf',
'ff',
'ff',
'sfsuhfsuhfiuhfuaihuf'
]))),
]))),
RoundButton(
text: '催促未完成经理',
gradientStart: MyColours.color_199095,
gradientEnd: MyColours.color_199095,
// borderColor: MyColours.color_999999,
radius: ScreenUtil().setWidth(10),
height: ScreenUtil().setWidth(80),
fontSize: 26,
margin: EdgeInsets.symmetric(
horizontal: ScreenUtil().setWidth(200)),
isBold: false,
onPressed: () {
// NavigatorUtil.goEnterStoreEnvironmentPage(context);
},
),
VEmptyView(10),
RoundButton(
text: '取消任务',
gradientStart: MyColours.color_ffffff,
gradientEnd: MyColours.color_ffffff,
textColor: MyColours.color_199095,
// borderColor: MyColours.color_999999,
radius: ScreenUtil().setWidth(10),
height: ScreenUtil().setWidth(80),
fontSize: 26,
margin: EdgeInsets.symmetric(
horizontal: ScreenUtil().setWidth(200)),
isBold: false,
onPressed: () {
DialogUtil.cupertinoAlertDialog(context,
title: "取消任务",
content: "点击确定立即取消任务,已完成的客户经理继续生效",
lTitle: "返回",
rTitle: "确定取消", lCallback: () {
print("返回");
}, rCallback: () {
print("确定取消任务");
});
},
),
VEmptyView(30),
],
)),
);
}
}
... ...
import 'package:flutter/material.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart';
import 'package:one_key/res/colors.dart';
import 'package:one_key/route/navigator_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';
... ... @@ -74,11 +75,15 @@ class _MarketingRecordsPageState extends State<MarketingRecordsPage> {
color: MyColours.color_333333,
fontSize: ScreenUtil().setSp(26)))),
HEmptyView(10),
Text('查看详情',
style: TextStyle(
decoration: TextDecoration.underline,
color: MyColours.color_199095,
fontSize: ScreenUtil().setSp(26))),
InkWell(
onTap: () {
NavigatorUtil.goMarketingRecordsDetailPage(context);
},
child: Text('查看详情',
style: TextStyle(
decoration: TextDecoration.underline,
color: MyColours.color_199095,
fontSize: ScreenUtil().setSp(26)))),
],
));
}),
... ...
... ... @@ -540,4 +540,18 @@ class NavigatorUtil {
return _navigateTo(context, "${Routes.marketing_records_page}",
replace: replace);
}
/// 全店营销记录详情
static Future<dynamic> goMarketingRecordsDetailPage(BuildContext context,
{replace = false}) {
return _navigateTo(context, "${Routes.marketing_records_detail_page}",
replace: replace);
}
/// 创建营销
static Future<dynamic> goMakeMarkingPage(BuildContext context,
{replace = false}) {
return _navigateTo(context, "${Routes.make_marketing_page}",
replace: replace);
}
}
... ...
... ... @@ -41,6 +41,8 @@ import 'package:one_key/pages/login/web_page.dart';
import 'package:one_key/pages/message/message_order_menu.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/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';
import 'package:one_key/pages/my/customer_type/store_customer_page.dart';
import 'package:one_key/pages/my/personnel_type/personnel_detail_page.dart';
... ... @@ -851,3 +853,19 @@ var marketingRecordsPageHandle = new Handler(
return ChangeNotifierProvider<CustomerProvider>(
create: (_) => CustomerProvider(), child: MarketingRecordsPage());
});
///全店营销记录详情
var marketingRecordsDetailPageHandle = new Handler(
handlerFunc: (BuildContext context, Map<dynamic, List<Object>> params) {
// String idstr = params["idstr"].first;
return ChangeNotifierProvider<CustomerProvider>(
create: (_) => CustomerProvider(), child: MarketingRecordsDetailPage());
});
///创建营销
var makeMarkingPageHandle = new Handler(
handlerFunc: (BuildContext context, Map<dynamic, List<Object>> params) {
// String idstr = params["idstr"].first;
return ChangeNotifierProvider<CustomerProvider>(
create: (_) => CustomerProvider(), child: MakeMarkingPage());
});
... ...
... ... @@ -71,6 +71,11 @@ class Routes {
static String customer_list_page = "/customer_list_page"; //客情列表
static String customer_set_page = "/customer_set_page"; //客情设置
static String marketing_records_page = "/marketing_records_page"; //全店营销记录
static String marketing_records_detail_page =
"/marketing_records_detail_page"; //全店营销记录详情
static String make_marketing_page =
"/make_marketing_page"; //创建营销
static void configureRoutes(FluroRouter router) {
router.notFoundHandler = new Handler(
... ... @@ -150,6 +155,11 @@ class Routes {
router.define(customer_list_page, handler: customerListPageHandle);
router.define(customer_set_page, handler: customerSettingPageHandle);
router.define(marketing_records_page, handler: marketingRecordsPageHandle);
router.define(marketing_records_detail_page,
handler: marketingRecordsDetailPageHandle);
router.define(make_marketing_page,
handler: makeMarkingPageHandle);
}
}
... ...
... ... @@ -7,16 +7,16 @@ class RowMultiText extends StatelessWidget {
final String content;
final TextAlign textAlign;
final Color textColor;
final Color bgColor;
RowMultiText(this.title, this.content,
{this.textAlign = TextAlign.right,
this.textColor = MyColours.color_828282});
this.textColor = MyColours.color_828282,
this.bgColor = MyColours.color_ffffff});
@override
Widget build(BuildContext context) {
// TODO: implement build
return Container(
color: MyColours.color_ffffff,
color: bgColor,
width: double.infinity,
padding: EdgeInsets.symmetric(vertical: ScreenUtil().setWidth(25)),
alignment: Alignment.center,
... ...