Commit d887e3bcb97676545e4a4748b591efbc7ab5fc9d

Authored by wdn127929
1 parent 93806064

营销及客户互动UI ok

  1 +import 'package:flutter/material.dart';
  2 +import 'package:flutter_screenutil/flutter_screenutil.dart';
  3 +import 'package:one_key/utils/utils.dart';
  4 +import 'package:one_key/widgets/h_empty_view.dart';
  5 +import 'package:one_key/widgets/v_empty_view.dart';
  6 +import 'package:provider/provider.dart';
  7 +
  8 +import '../../../../provider/user_model.dart';
  9 +import '../../../../res/colors.dart';
  10 +import '../../../../utils/screen_util.dart';
  11 +import '../../../../widgets/round_button.dart';
  12 +import '../../../../widgets/system_app_bar.dart';
  13 +
  14 +/**
  15 + * 营销及客户互动
  16 + */
  17 +
  18 +class MarkingInteractionPage extends StatefulWidget {
  19 + MarkingInteractionPage({Key key}) : super(key: key);
  20 +
  21 + @override
  22 + _MarkingInteractionPageState createState() => _MarkingInteractionPageState();
  23 +}
  24 +
  25 +class _MarkingInteractionPageState extends State<MarkingInteractionPage> {
  26 + TextEditingController welcomeTextC = TextEditingController(); //欢迎语
  27 + FocusNode welcomeTextNode = FocusNode(); //
  28 + @override
  29 + void initState() {
  30 + super.initState();
  31 + }
  32 +
  33 + ///客户互动及店铺推广
  34 + Widget _storeItemWidget(String title, String content, {bool select = false}) {
  35 + return Container(
  36 + margin: EdgeInsets.only(top: w(12), left: w(32)),
  37 + padding: EdgeInsets.only(bottom: w(16)),
  38 + decoration: BoxDecoration(
  39 + border: Border(
  40 + bottom:
  41 + BorderSide(width: w(0.5), color: MyColours.color_E7E7E7))),
  42 + child: Column(
  43 + children: [
  44 + Row(
  45 + children: [
  46 + Image.asset(
  47 + Utils.getImgPath(select ? 'f_select' : 'f_select_not'),
  48 + width: w(20),
  49 + ),
  50 + HEmptyView(20),
  51 + Text(
  52 + title,
  53 + style: TextStyle(
  54 + fontSize: font(14), color: MyColours.color_515151),
  55 + )
  56 + ],
  57 + ),
  58 + VEmptyView(20),
  59 + Padding(
  60 + padding: EdgeInsets.symmetric(horizontal: w(16)),
  61 + child: Text(
  62 + content,
  63 + style: TextStyle(
  64 + height: 1.5,
  65 + fontSize: font(14),
  66 + color: MyColours.color_515151),
  67 + ),
  68 + )
  69 + ],
  70 + ),
  71 + );
  72 + }
  73 +
  74 + ///标题
  75 + Widget _headItem(String title) {
  76 + return Container(
  77 + width: double.infinity,
  78 + alignment: Alignment.centerLeft,
  79 + decoration: BoxDecoration(
  80 + border: Border(
  81 + bottom:
  82 + BorderSide(color: MyColours.color_E7E7E7, width: w(0.5)))),
  83 + margin: EdgeInsets.only(left: w(16)),
  84 + padding: EdgeInsets.only(top: w(12), bottom: w(12), right: w(16)),
  85 + child: Text(
  86 + title,
  87 + style: TextStyle(
  88 + color: MyColours.color_515151, fontSize: ScreenUtil().setWidth(32)),
  89 + ),
  90 + );
  91 + }
  92 +
  93 + ///营销推广
  94 + Widget _markingItem(String selectTitle, String title, String content,
  95 + String subtile, String discount,
  96 + {VoidCallback onPressed, bool select = false}) {
  97 + return Container(
  98 + margin: EdgeInsets.only(left: w(21), top: w(12), right: w(21)),
  99 + child: Column(
  100 + children: [
  101 + Row(
  102 + children: [
  103 + Image.asset(
  104 + Utils.getImgPath(select ? 'f_select' : 'f_select_not'),
  105 + width: w(20),
  106 + ),
  107 + HEmptyView(20),
  108 + Text(
  109 + selectTitle,
  110 + style: TextStyle(
  111 + fontSize: font(14), color: MyColours.color_515151),
  112 + )
  113 + ],
  114 + ),
  115 + VEmptyView(20),
  116 + Container(
  117 + padding: EdgeInsets.all(w(12)),
  118 + decoration: BoxDecoration(
  119 + borderRadius: BorderRadiusDirectional.circular(r(8)),
  120 + border: Border.all(width: w(1), color: MyColours.color_DBDBDB)),
  121 + child: Row(
  122 + mainAxisAlignment: MainAxisAlignment.spaceBetween,
  123 + children: [
  124 + Column(
  125 + crossAxisAlignment: CrossAxisAlignment.start,
  126 + children: [
  127 + Row(
  128 + children: [
  129 + Text(
  130 + title,
  131 + style: TextStyle(
  132 + fontSize: font(14),
  133 + fontWeight: FontWeight.bold,
  134 + color: MyColours.color_515151),
  135 + ),
  136 + HEmptyView(20),
  137 + subtile != ''
  138 + ? Text(
  139 + '¥${subtile}',
  140 + style: TextStyle(
  141 + fontSize: font(7),
  142 + fontWeight: FontWeight.bold,
  143 + color: MyColours.color_E34D59),
  144 + )
  145 + : SizedBox(),
  146 + HEmptyView(10),
  147 + discount != ''
  148 + ? Container(
  149 + padding: EdgeInsets.symmetric(
  150 + horizontal: w(3), vertical: w(2)),
  151 + decoration: BoxDecoration(
  152 + borderRadius: BorderRadius.circular(r(3)),
  153 + border: Border.all(
  154 + width: w(0.5),
  155 + color: MyColours.color_E34D59)),
  156 + child: Text(
  157 + discount,
  158 + style: TextStyle(
  159 + color: MyColours.color_E34D59,
  160 + fontSize: font(7)),
  161 + ),
  162 + )
  163 + : SizedBox(),
  164 + ],
  165 + ),
  166 + VEmptyView(20),
  167 + Text(
  168 + content,
  169 + style: TextStyle(
  170 + fontSize: font(10),
  171 + fontWeight: FontWeight.bold,
  172 + color: MyColours.color_515151),
  173 + )
  174 + ],
  175 + ),
  176 + RoundButton(
  177 + text: '切换活动',
  178 + width: w(72),
  179 + height: w(22),
  180 + gradientStart: MyColours.color_ffffff,
  181 + gradientEnd: MyColours.color_ffffff,
  182 + borderColor: MyColours.color_438E93,
  183 + textColor: MyColours.color_438E93,
  184 + radius: r(11),
  185 + fontSize: 24,
  186 + isBold: true,
  187 + onPressed: onPressed,
  188 + )
  189 + ],
  190 + ),
  191 + )
  192 + ],
  193 + ),
  194 + );
  195 + }
  196 +
  197 + ///营销推广
  198 + Widget _markingOtherItem({VoidCallback onPressed, bool select = false}) {
  199 + return Container(
  200 + margin: EdgeInsets.only(left: w(21), top: w(12), right: w(21)),
  201 + child: Column(children: [
  202 + Row(
  203 + children: [
  204 + Image.asset(
  205 + Utils.getImgPath(select ? 'f_select' : 'f_select_not'),
  206 + width: w(20),
  207 + ),
  208 + HEmptyView(20),
  209 + Text(
  210 + '推荐店内充值优惠活动链接',
  211 + style: TextStyle(
  212 + fontSize: font(14), color: MyColours.color_515151),
  213 + )
  214 + ],
  215 + ),
  216 + VEmptyView(24),
  217 + Container(
  218 + height: w(180),
  219 + child: true
  220 + ? Image.network(
  221 + 'https://www.ssfiction.com/wp-content/uploads/2020/08/20200805_5f2b1669e9a24.jpg',
  222 + fit: BoxFit.contain,
  223 + )
  224 + : Column(
  225 + mainAxisAlignment: MainAxisAlignment.center,
  226 + children: [
  227 + Image.asset(
  228 + Utils.getImgPath('add_img_grey'),
  229 + width: w(63),
  230 + ),
  231 + VEmptyView(28),
  232 + Padding(
  233 + padding: EdgeInsets.symmetric(
  234 + vertical: w(10),
  235 + ),
  236 + child: Text(
  237 + '点击上传餐厅logo',
  238 + style: TextStyle(
  239 + color: MyColours.color_999999,
  240 + fontSize: font(14),
  241 + fontWeight: FontWeight.bold),
  242 + ),
  243 + )
  244 + ],
  245 + )),
  246 + Container(
  247 + width: double.infinity,
  248 + alignment: Alignment.center,
  249 + padding: EdgeInsets.symmetric(
  250 + horizontal: ScreenUtil().setWidth(40),
  251 + ),
  252 + child: TextField(
  253 + controller: welcomeTextC,
  254 + focusNode: welcomeTextNode,
  255 + style: TextStyle(
  256 + color: MyColours.color_000000,
  257 + fontSize: ScreenUtil().setSp(40),
  258 + textBaseline: TextBaseline.alphabetic),
  259 + textAlign: TextAlign.center,
  260 + maxLines: 1,
  261 + // maxLength: 38,
  262 + decoration: InputDecoration(
  263 + hintText: "点这里输入餐厅欢迎语",
  264 + hintStyle: TextStyle(
  265 + color: MyColours.color_000000,
  266 + fontSize: ScreenUtil().setSp(40),
  267 + ),
  268 + contentPadding: EdgeInsets.zero,
  269 + border: OutlineInputBorder(borderSide: BorderSide.none),
  270 + ),
  271 + keyboardType: TextInputType.text,
  272 + onChanged: (value) {
  273 + setState(() {
  274 + // currentRemark = value ?? "";
  275 + });
  276 + }),
  277 + ),
  278 + VEmptyView(40),
  279 + Container(
  280 + width: w(188),
  281 + height: w(22),
  282 + alignment: Alignment.center,
  283 + decoration: BoxDecoration(
  284 + borderRadius: BorderRadius.circular(r(11)),
  285 + gradient: LinearGradient(stops: [
  286 + -0.57,
  287 + 0.55,
  288 + 1.48
  289 + ], colors: [
  290 + MyColours.color_4C8DAD,
  291 + MyColours.color_0143A3,
  292 + MyColours.color_42A5FF
  293 + ], begin: Alignment.centerLeft, end: Alignment.centerRight)),
  294 + child: RoundButton(
  295 + width: w(186),
  296 + height: w(20),
  297 + text: '点击了解更多会员优惠政策',
  298 + gradientStart: MyColours.color_ffffff,
  299 + gradientEnd: MyColours.color_ffffff,
  300 + borderColor: Colors.transparent,
  301 + // borderColor: MyColours.color_999999,
  302 + textColor: MyColours.color_999999,
  303 + radius: r(11),
  304 + fontSize: 24,
  305 +
  306 + isBold: true,
  307 + onPressed: () {},
  308 + )),
  309 + VEmptyView(18),
  310 + Container(
  311 + height: w(28),
  312 + alignment: Alignment.center,
  313 + child: Text(
  314 + Provider.of<UserModel>(context, listen: false).user.sellername,
  315 + style:
  316 + TextStyle(fontSize: font(14), color: MyColours.color_515151),
  317 + ),
  318 + ),
  319 + VEmptyView(20)
  320 + ]));
  321 + }
  322 +
  323 + @override
  324 + Widget build(BuildContext context) {
  325 + return Scaffold(
  326 + backgroundColor: MyColours.color_ffffff,
  327 + appBar: SystemAppBar(
  328 + '营销及客户互动',
  329 + onTap: () {
  330 + Navigator.pop(context);
  331 + },
  332 + ),
  333 + body: Column(
  334 + children: [
  335 + Expanded(
  336 + child: SingleChildScrollView(
  337 + child: Column(
  338 + children: [
  339 + _headItem('客户互动及店铺推广'),
  340 + _storeItemWidget('允许顾客转发邀请函给同行客人。',
  341 + '同行客人可以从电子邀请函了解预订信息、一键导航到店,快速联系餐厅服务人员。还可以了解更多餐厅介绍、各种活动。'),
  342 + _storeItemWidget('向被邀请客人开放“确认到店”功能。',
  343 + '被邀客人点击确认到店后,方便请客人了解被邀客人是否确认,同时,被邀客人的信息会加入到餐厅客户池中,方便餐厅维护客户。'),
  344 + _storeItemWidget('向客人开放“在线预订”功能。',
  345 + '客人和被邀客人可以通过邀请函,直接点击在线预订,向商家提交预订需求,无需通过电话,经理可以详细了解客户需求并安排预订。'),
  346 + _storeItemWidget('向被邀请客人开放“提前点餐”功能。',
  347 + '请客人从预定安排直接预先选菜,到店后确认下单,无需服务员花费时间给客户点餐,可以为餐厅节源提效。'),
  348 + VEmptyView(24),
  349 + _headItem('预订安排中附带的营销推广'),
  350 + VEmptyView(24),
  351 + _markingItem('推荐店内代金券优惠', '200元代金券', '周一到周五可用,消费满600元可用一张。',
  352 + '100', '5折'),
  353 + _markingItem(
  354 + '推荐店内充值单一优惠活动',
  355 + '充1000赠300',
  356 + '会员充值满1000元赠余额200元;\n会员充值满1000元赠余额200元;\n会员充值满1000元赠余额200元;',
  357 + '',
  358 + ''),
  359 + _markingOtherItem()
  360 + ],
  361 + ),
  362 + )),
  363 + Container(
  364 + color: MyColours.color_ffffff,
  365 + padding: EdgeInsets.only(
  366 + left: w(45), right: w(45), top: w(12), bottom: w(25)),
  367 + child: RoundButton(
  368 + text: '保存',
  369 + gradientStart: MyColours.color_199095,
  370 + gradientEnd: MyColours.color_199095,
  371 + // borderColor: MyColours.color_999999,
  372 + radius: r(5),
  373 + fontSize: 34,
  374 + height: w(40),
  375 + isBold: true,
  376 + onPressed: () {},
  377 + ),
  378 + )
  379 + ],
  380 + ));
  381 + }
  382 +}
@@ -158,7 +158,9 @@ class _MarketingCenterHomePageState extends State<MarketingCenterHomePage> { @@ -158,7 +158,9 @@ class _MarketingCenterHomePageState extends State<MarketingCenterHomePage> {
158 _item('招牌菜展示', onTap: () { 158 _item('招牌菜展示', onTap: () {
159 NavigatorUtil.goDishShowPage(context); 159 NavigatorUtil.goDishShowPage(context);
160 }), 160 }),
161 - _item('营销及客户互动功能', onTap: () {}), 161 + _item('营销及客户互动功能', onTap: () {
  162 + NavigatorUtil.goMarkingInteractionPage(context);
  163 + }),
162 ], 164 ],
163 ), 165 ),
164 ))); 166 )));
1 import 'package:flutter/material.dart'; 1 import 'package:flutter/material.dart';
2 2
3 class MyColours { 3 class MyColours {
  4 + static const Color color_42A5FF = Color(0xFF42A5FF);
  5 + static const Color color_4C8DAD = Color(0xFF4C8DAD);
4 static const Color color_4D0C0F0E = Color(0x4D0C0F0E); 6 static const Color color_4D0C0F0E = Color(0x4D0C0F0E);
5 static const Color color_4D000000 = Color(0x4D000000); 7 static const Color color_4D000000 = Color(0x4D000000);
6 static const Color color_B39437 = Color(0xFFB39437); 8 static const Color color_B39437 = Color(0xFFB39437);
@@ -1434,7 +1434,15 @@ class NavigatorUtil { @@ -1434,7 +1434,15 @@ class NavigatorUtil {
1434 BuildContext context, { 1434 BuildContext context, {
1435 replace = false, 1435 replace = false,
1436 }) { 1436 }) {
1437 - return _navigateTo(context, "${Routes.dish_show_page}", 1437 + return _navigateTo(context, "${Routes.dish_show_page}", replace: replace);
  1438 + }
  1439 +
  1440 + ///预订安排通知定制------客户互动及店铺推广
  1441 + static Future<dynamic> goMarkingInteractionPage(
  1442 + BuildContext context, {
  1443 + replace = false,
  1444 + }) {
  1445 + return _navigateTo(context, "${Routes.marking_interaction_page}",
1438 replace: replace); 1446 replace: replace);
1439 } 1447 }
1440 } 1448 }
@@ -84,6 +84,7 @@ import 'package:one_key/pages/my/customer_type/store_customer/store_customer_pag @@ -84,6 +84,7 @@ import 'package:one_key/pages/my/customer_type/store_customer/store_customer_pag
84 import 'package:one_key/pages/my/feast_manage/feast_deposit_manage_page.dart'; 84 import 'package:one_key/pages/my/feast_manage/feast_deposit_manage_page.dart';
85 import 'package:one_key/pages/my/feast_manage/feast_personal_page.dart'; 85 import 'package:one_key/pages/my/feast_manage/feast_personal_page.dart';
86 import 'package:one_key/pages/my/feast_manage/feast_setmeal_manage_page.dart'; 86 import 'package:one_key/pages/my/feast_manage/feast_setmeal_manage_page.dart';
  87 +import 'package:one_key/pages/my/marketing_center/book_notification/marking_interaction_page.dart';
87 import 'package:one_key/pages/my/personnel_type/base_info_personnal_page.dart'; 88 import 'package:one_key/pages/my/personnel_type/base_info_personnal_page.dart';
88 import 'package:one_key/pages/my/personnel_type/personnel_detail_page.dart'; 89 import 'package:one_key/pages/my/personnel_type/personnel_detail_page.dart';
89 import 'package:one_key/pages/my/personnel_type/personnel_manage_page.dart'; 90 import 'package:one_key/pages/my/personnel_type/personnel_manage_page.dart';
@@ -2351,3 +2352,14 @@ var dishShowPageHandle = new Handler( @@ -2351,3 +2352,14 @@ var dishShowPageHandle = new Handler(
2351 return ChangeNotifierProvider<MarketingCenterProvider>( 2352 return ChangeNotifierProvider<MarketingCenterProvider>(
2352 create: (_) => MarketingCenterProvider(), child: DishShowPage()); 2353 create: (_) => MarketingCenterProvider(), child: DishShowPage());
2353 }); 2354 });
  2355 +
  2356 +//我的----营销中心-客户互动及店铺推广
  2357 +var markingInteractionPageHandle = new Handler(
  2358 + handlerFunc: (BuildContext context, Map<dynamic, List<Object>> params) {
  2359 + // String idstr = params["idstr"].first;
  2360 + // NotebookDetail detailEntity = NotebookDetail.fromJson(json
  2361 + // .decode(FluroConvertUtils.fluroCnParamsDecode(params["detail"].first)));
  2362 + return ChangeNotifierProvider<MarketingCenterProvider>(
  2363 + create: (_) => MarketingCenterProvider(),
  2364 + child: MarkingInteractionPage());
  2365 +});
@@ -199,6 +199,9 @@ class Routes { @@ -199,6 +199,9 @@ class Routes {
199 "/chef_introduce_page"; //预订安排通知定制------主厨介绍 199 "/chef_introduce_page"; //预订安排通知定制------主厨介绍
200 static String dish_show_page = "/dish_show_page"; //预订安排通知定制------招牌菜介绍 200 static String dish_show_page = "/dish_show_page"; //预订安排通知定制------招牌菜介绍
201 201
  202 + static String marking_interaction_page =
  203 + "/marking_interaction_page"; //预订安排通知定制------客户互动及店铺推广
  204 +
202 static void configureRoutes(FluroRouter router) { 205 static void configureRoutes(FluroRouter router) {
203 router.notFoundHandler = new Handler( 206 router.notFoundHandler = new Handler(
204 handlerFunc: (BuildContext context, Map<String, List<String>> params) { 207 handlerFunc: (BuildContext context, Map<String, List<String>> params) {
@@ -390,5 +393,7 @@ class Routes { @@ -390,5 +393,7 @@ class Routes {
390 router.define(chef_introduce_page, handler: chefIntroducePageHandle); 393 router.define(chef_introduce_page, handler: chefIntroducePageHandle);
391 394
392 router.define(dish_show_page, handler: dishShowPageHandle); 395 router.define(dish_show_page, handler: dishShowPageHandle);
  396 + router.define(marking_interaction_page,
  397 + handler: markingInteractionPageHandle);
393 } 398 }
394 } 399 }