Commit f49f0be1ecfba07c8fbcb889a4b6fe33141def8c

Authored by wdn127929
1 parent 0ebe4d23

模版---颜色

@@ -9,6 +9,7 @@ import 'package:one_key/widgets/system_app_bar.dart'; @@ -9,6 +9,7 @@ import 'package:one_key/widgets/system_app_bar.dart';
9 import 'package:one_key/widgets/v_empty_view.dart'; 9 import 'package:one_key/widgets/v_empty_view.dart';
10 import 'package:provider/provider.dart'; 10 import 'package:provider/provider.dart';
11 11
  12 +import '../../../../constant/state.dart';
12 import '../../../../models/get_seller_info_model.dart'; 13 import '../../../../models/get_seller_info_model.dart';
13 import '../../../../models/mark_data_model.dart'; 14 import '../../../../models/mark_data_model.dart';
14 import '../../../../provider/base_info_provider.dart'; 15 import '../../../../provider/base_info_provider.dart';
@@ -17,6 +18,7 @@ import '../../../../provider/store_base_info_provider.dart'; @@ -17,6 +18,7 @@ import '../../../../provider/store_base_info_provider.dart';
17 import '../../../../provider/user_model.dart'; 18 import '../../../../provider/user_model.dart';
18 import '../../../../res/colors.dart'; 19 import '../../../../res/colors.dart';
19 import '../../../../utils/screen_util.dart'; 20 import '../../../../utils/screen_util.dart';
  21 +import '../../../../widgets/page_exception.dart';
20 import '../../../../widgets/round_button.dart'; 22 import '../../../../widgets/round_button.dart';
21 import '../../personnel_type/base_info_personnal_page.dart'; 23 import '../../personnel_type/base_info_personnal_page.dart';
22 24
@@ -307,357 +309,384 @@ class _BookInfoPageState extends State<BookInfoPage> { @@ -307,357 +309,384 @@ class _BookInfoPageState extends State<BookInfoPage> {
307 _storeBaseIndoProvider = 309 _storeBaseIndoProvider =
308 Provider.of<StoreBaseIndoProvider>(context, listen: false); 310 Provider.of<StoreBaseIndoProvider>(context, listen: false);
309 return Scaffold( 311 return Scaffold(
310 - backgroundColor: MyColours.color_ffffff,  
311 - appBar: SystemAppBar(  
312 - '预订信息展示',  
313 - onTap: () {  
314 - Navigator.pop(context);  
315 - },  
316 - ),  
317 - body: Column(  
318 - children: [  
319 - Expanded(  
320 - child: SingleChildScrollView(  
321 - child: Column(children: [  
322 - _item('展示餐厅前台电话号码', select: addPhone, onTap: () {  
323 - setState(() {  
324 - addPhone = !addPhone;  
325 - });  
326 - }),  
327 - VEmptyView(24),  
328 - _item('附加餐厅经理名片', select: addManager, onTap: () {  
329 - setState(() {  
330 - addManager = !addManager;  
331 - });  
332 - }),  
333 - VEmptyView(24),  
334 - _item('附加停车信息', select: addParking, onTap: () {  
335 - setState(() {  
336 - addParking = !addParking;  
337 - });  
338 - }),  
339 - VEmptyView(24),  
340 - //输入框  
341 - addParking  
342 - ? Container(  
343 - width: double.infinity,  
344 - margin: EdgeInsets.symmetric(  
345 - horizontal: ScreenUtil().setWidth(40)),  
346 - padding: EdgeInsets.symmetric(  
347 - horizontal: ScreenUtil().setWidth(40),  
348 - vertical: ScreenUtil().setWidth(20)),  
349 - alignment: Alignment.topLeft,  
350 - decoration: BoxDecoration(  
351 - color: MyColours.color_ffffff,  
352 - border: Border.all(  
353 - color: MyColours.color_DBDBDB,  
354 - width: ScreenUtil().setWidth(2)),  
355 - borderRadius:  
356 - BorderRadius.circular(ScreenUtil().setWidth(20))),  
357 - child: TextField(  
358 - controller: parkingIncoC,  
359 - focusNode: parkingIncoNode,  
360 - style: TextStyle(  
361 - color: MyColours.color_515151,  
362 - fontSize: ScreenUtil().setSp(28),  
363 - textBaseline: TextBaseline.alphabetic),  
364 - textAlignVertical: TextAlignVertical.center,  
365 - maxLines: 5,  
366 - maxLength: 38,  
367 - decoration: InputDecoration(  
368 - hintText: "点击录入停车信息,最多38个汉字。",  
369 - hintStyle: TextStyle(  
370 - color: MyColours.color_999999,  
371 - fontSize: ScreenUtil().setSp(28),  
372 - ),  
373 - contentPadding: EdgeInsets.zero,  
374 - border:  
375 - OutlineInputBorder(borderSide: BorderSide.none),  
376 - ),  
377 - keyboardType: TextInputType.text,  
378 - onChanged: (value) {  
379 - setState(() {  
380 - // currentRemark = value ?? "";  
381 - });  
382 - }),  
383 - )  
384 - : SizedBox(),  
385 - addParking ? VEmptyView(24) : SizedBox(),  
386 - addParking  
387 - ? Padding(  
388 - padding: EdgeInsets.symmetric(horizontal: w(20)),  
389 - child: MyDivider(  
390 - double.infinity,  
391 - w(0.5),  
392 - color: MyColours.color_DBDBDB,  
393 - ))  
394 - : SizedBox(),  
395 - VEmptyView(24),  
396 - Container(  
397 - alignment: Alignment.centerLeft,  
398 - padding: EdgeInsets.only(  
399 - left: w(16), top: w(12), bottom: w(12), right: w(16)),  
400 - child: Text(  
401 - '效果预览',  
402 - style: TextStyle(  
403 - color: MyColours.color_515151,  
404 - fontSize: ScreenUtil().setWidth(32)),  
405 - ),  
406 - ),  
407 - VEmptyView(24),  
408 - Container(  
409 - width: double.infinity,  
410 - margin: EdgeInsets.symmetric(horizontal: w(10)),  
411 - padding: EdgeInsets.symmetric(horizontal: w(8)),  
412 - decoration: BoxDecoration(  
413 - border: Border(  
414 - left: BorderSide(  
415 - width: w(2), color: MyColours.color_EEAE74))),  
416 - child: Column(  
417 - crossAxisAlignment: CrossAxisAlignment.start,  
418 - children: [  
419 - Text(  
420 - '尊敬的贵宾,您好!',  
421 - style: TextStyle(  
422 - color: MyColours.color_000000, fontSize: font(14)),  
423 - ),  
424 - VEmptyView(10),  
425 - Text('非常感谢您选择【${sellername}】!',  
426 - style: TextStyle(  
427 - color: MyColours.color_000000, fontSize: font(14))),  
428 - VEmptyView(30),  
429 - _itemTitleAndSubTtile('日期', '${date}'),  
430 - VEmptyView(10),  
431 - _itemTitleAndSubTtile('餐段', '${dsolt}'),  
432 - VEmptyView(10),  
433 - marketingCenterProvider.tableOuterList.length > 0 &&  
434 - marketingCenterProvider  
435 - .tableOuterList[0].list.length >  
436 - 0  
437 - ? _itemTitleAndSubTtile('包间',  
438 - '${marketingCenterProvider.tableOuterList[0].name}${marketingCenterProvider.tableOuterList[0].list[0].name}')  
439 - : SizedBox(),  
440 - VEmptyView(10),  
441 - marketingCenterProvider.tableOuterList.length > 0 &&  
442 - marketingCenterProvider  
443 - .tableOuterList[0].list.length >  
444 - 0  
445 - ? _itemTitleAndSubTtile('人数',  
446 - '${marketingCenterProvider.tableOuterList[0].list[0].tableNum}')  
447 - : SizedBox(),  
448 - VEmptyView(10),  
449 - // _itemTitleAndSubTtile('地址', '${address}'),  
450 - // VEmptyView(10), 312 + backgroundColor: MyColours.color_ffffff,
  313 + appBar: SystemAppBar(
  314 + '预订信息展示',
  315 + onTap: () {
  316 + Navigator.pop(context);
  317 + },
  318 + ),
  319 + body: Consumer<MarketingCenterProvider>(builder: (context1, model, _) {
  320 + if (model.pageStateBookInfo != PageState.Success) {
  321 + return ExceptionPage(
  322 + pageState: model.pageStateBookInfo,
  323 + callback: () async {},
  324 + emptyMsg: "暂时没有预订信息展示哦",
  325 + emptyImg: "empty_search",
  326 + showMsg: "加载中,请稍后...",
  327 + );
  328 + } else {
  329 + return Column(
  330 + children: [
  331 + Expanded(
  332 + child: SingleChildScrollView(
  333 + child: Column(children: [
  334 + _item('展示餐厅前台电话号码', select: addPhone, onTap: () {
  335 + setState(() {
  336 + addPhone = !addPhone;
  337 + });
  338 + }),
  339 + VEmptyView(24),
  340 + _item('附加餐厅经理名片', select: addManager, onTap: () {
  341 + setState(() {
  342 + addManager = !addManager;
  343 + });
  344 + }),
  345 + VEmptyView(24),
  346 + _item('附加停车信息', select: addParking, onTap: () {
  347 + setState(() {
  348 + addParking = !addParking;
  349 + });
  350 + }),
  351 + VEmptyView(24),
  352 + //输入框
451 addParking 353 addParking
452 - ? _itemTitleAndSubTtile('停车', '${parkingIncoC.text}')  
453 - : SizedBox(),  
454 - addParking ? VEmptyView(10) : SizedBox(),  
455 - if (addPhone) _itemTitleAndSubTtile('联系', '${sellerphone}'),  
456 - VEmptyView(20),  
457 - addManager  
458 - ? Row(  
459 - children: [  
460 - HEmptyView(20),  
461 - ClipRRect(  
462 - borderRadius: BorderRadius.circular(r(35)),  
463 - child: Image.network(  
464 - _baseIndoProvider.baseInfoSunModel == null ||  
465 - _baseIndoProvider  
466 - .baseInfoSunModel.photo ==  
467 - null ||  
468 - _baseIndoProvider  
469 - .baseInfoSunModel.photo ==  
470 - ''  
471 - ? 'http://nosqn.colorcun.com/yd_person.png'  
472 - : _baseIndoProvider  
473 - .baseInfoSunModel.photo,  
474 - fit: BoxFit.cover,  
475 - width: w(70),  
476 - height: w(70),  
477 - ),  
478 - ),  
479 - HEmptyView(20),  
480 - // Spacer(),  
481 - Expanded(  
482 - child: Column(  
483 - crossAxisAlignment: CrossAxisAlignment.start,  
484 - children: [  
485 - Text(  
486 - '专属服务:${_baseIndoProvider.baseInfoSunModel == null || _baseIndoProvider.baseInfoSunModel.name == null ? Provider.of<UserModel>(context, listen: false).user.nickName : _baseIndoProvider.baseInfoSunModel.name}',  
487 - style: TextStyle(  
488 - color: MyColours.color_999999,  
489 - fontWeight: FontWeight.bold,  
490 - fontSize: font(12)), 354 + ? Container(
  355 + width: double.infinity,
  356 + margin: EdgeInsets.symmetric(
  357 + horizontal: ScreenUtil().setWidth(40)),
  358 + padding: EdgeInsets.symmetric(
  359 + horizontal: ScreenUtil().setWidth(40),
  360 + vertical: ScreenUtil().setWidth(20)),
  361 + alignment: Alignment.topLeft,
  362 + decoration: BoxDecoration(
  363 + color: MyColours.color_ffffff,
  364 + border: Border.all(
  365 + color: MyColours.color_DBDBDB,
  366 + width: ScreenUtil().setWidth(2)),
  367 + borderRadius: BorderRadius.circular(
  368 + ScreenUtil().setWidth(20))),
  369 + child: TextField(
  370 + controller: parkingIncoC,
  371 + focusNode: parkingIncoNode,
  372 + style: TextStyle(
  373 + color: MyColours.color_515151,
  374 + fontSize: ScreenUtil().setSp(28),
  375 + textBaseline: TextBaseline.alphabetic),
  376 + textAlignVertical: TextAlignVertical.center,
  377 + maxLines: 5,
  378 + maxLength: 38,
  379 + decoration: InputDecoration(
  380 + hintText: "点击录入停车信息,最多38个汉字。",
  381 + hintStyle: TextStyle(
  382 + color: MyColours.color_999999,
  383 + fontSize: ScreenUtil().setSp(28),
491 ), 384 ),
492 - VEmptyView(16),  
493 - Text(  
494 - '服务电话:${_baseIndoProvider.baseInfoSunModel == null || _baseIndoProvider.baseInfoSunModel.phone == null ? Provider.of<UserModel>(context, listen: false).user.userphone : _baseIndoProvider.baseInfoSunModel.phone}',  
495 - style: TextStyle(  
496 - color: MyColours.color_999999,  
497 - fontWeight: FontWeight.bold,  
498 - fontSize: font(12)),  
499 - ),  
500 - ],  
501 - )),  
502 - HEmptyView(10),  
503 - Column(  
504 - crossAxisAlignment: CrossAxisAlignment.start,  
505 - children: [  
506 - RoundButton(  
507 - width: w(72),  
508 - height: w(22),  
509 - text: '拨打电话',  
510 - gradientStart: MyColours.color_ffffff,  
511 - gradientEnd: MyColours.color_ffffff,  
512 - borderColor: MyColours.color_0143A3,  
513 - textColor: MyColours.color_0143A3,  
514 - radius: r(11),  
515 - fontSize: 24,  
516 - isBold: true,  
517 - onPressed: () {},  
518 - ),  
519 - VEmptyView(16),  
520 - RoundButton(  
521 - width: w(72),  
522 - height: w(22),  
523 - text: '复制微信号',  
524 - gradientStart: MyColours.color_ffffff,  
525 - gradientEnd: MyColours.color_ffffff,  
526 - borderColor: MyColours.color_0143A3,  
527 - textColor: MyColours.color_0143A3,  
528 - radius: r(11),  
529 - fontSize: 24,  
530 - isBold: true,  
531 - onPressed: () {},  
532 - ),  
533 - ],  
534 - )  
535 - ], 385 + contentPadding: EdgeInsets.zero,
  386 + border: OutlineInputBorder(
  387 + borderSide: BorderSide.none),
  388 + ),
  389 + keyboardType: TextInputType.text,
  390 + onChanged: (value) {
  391 + setState(() {
  392 + // currentRemark = value ?? "";
  393 + });
  394 + }),
536 ) 395 )
537 : SizedBox(), 396 : SizedBox(),
538 - addManager ? VEmptyView(10) : SizedBox(),  
539 - Text('欢迎垂询,恭候光临!', 397 + addParking ? VEmptyView(24) : SizedBox(),
  398 + addParking
  399 + ? Padding(
  400 + padding: EdgeInsets.symmetric(horizontal: w(20)),
  401 + child: MyDivider(
  402 + double.infinity,
  403 + w(0.5),
  404 + color: MyColours.color_DBDBDB,
  405 + ))
  406 + : SizedBox(),
  407 + VEmptyView(24),
  408 + Container(
  409 + alignment: Alignment.centerLeft,
  410 + padding: EdgeInsets.only(
  411 + left: w(16), top: w(12), bottom: w(12), right: w(16)),
  412 + child: Text(
  413 + '效果预览',
540 style: TextStyle( 414 style: TextStyle(
541 - color: MyColours.color_000000, fontSize: font(14))),  
542 - ],  
543 - ),  
544 - ),  
545 - VEmptyView(20),  
546 - Container(  
547 - width: double.infinity,  
548 - margin: EdgeInsets.symmetric(horizontal: w(20)),  
549 - padding:  
550 - EdgeInsets.symmetric(horizontal: w(15), vertical: w(12)),  
551 - decoration: BoxDecoration(  
552 - color: MyColours.color_d9d9d9,  
553 - borderRadius: BorderRadius.circular(r(5))),  
554 - child: Row(  
555 - children: [  
556 - Image.asset(  
557 - Utils.getImgPath('location_blue'),  
558 - width: w(16), 415 + color: MyColours.color_515151,
  416 + fontSize: ScreenUtil().setWidth(32)),
  417 + ),
559 ), 418 ),
560 - HEmptyView(28),  
561 - Expanded(  
562 - child: Column(  
563 - crossAxisAlignment: CrossAxisAlignment.start,  
564 - children: [  
565 - Text('${sellername}',  
566 - style: TextStyle(  
567 - color: MyColours.color_000000,  
568 - fontWeight: FontWeight.bold,  
569 - fontSize: font(14))),  
570 - VEmptyView(10),  
571 - Text('${address ?? ''}', 419 + VEmptyView(24),
  420 + Container(
  421 + width: double.infinity,
  422 + margin: EdgeInsets.symmetric(horizontal: w(10)),
  423 + padding: EdgeInsets.symmetric(horizontal: w(8)),
  424 + decoration: BoxDecoration(
  425 + border: Border(
  426 + left: BorderSide(
  427 + width: w(2), color: MyColours.color_EEAE74))),
  428 + child: Column(
  429 + crossAxisAlignment: CrossAxisAlignment.start,
  430 + children: [
  431 + Text(
  432 + '尊敬的贵宾,您好!',
572 style: TextStyle( 433 style: TextStyle(
573 - height: 1.3,  
574 color: MyColours.color_000000, 434 color: MyColours.color_000000,
575 - fontSize: font(14))),  
576 - ],  
577 - ))  
578 - ],  
579 - ),  
580 - ),  
581 - VEmptyView(16)  
582 - ]),  
583 - )),  
584 - Container(  
585 - color: MyColours.color_ffffff,  
586 - padding: EdgeInsets.only(  
587 - left: w(45), right: w(45), top: w(12), bottom: w(25)),  
588 - child: RoundButton(  
589 - text: '保存',  
590 - gradientStart: MyColours.color_199095,  
591 - gradientEnd: MyColours.color_199095,  
592 - // borderColor: MyColours.color_999999,  
593 - radius: r(5),  
594 - fontSize: 34,  
595 - height: w(40),  
596 - isBold: true,  
597 - onPressed: () async {  
598 - FocusScope.of(context).requestFocus(FocusNode()); //点击空白处隐藏键盘  
599 -  
600 - if (addParking && parkingIncoC.text.trim().length == 0) {  
601 - Utils.showToast('请输入停车信息!');  
602 - return false;  
603 - }  
604 -  
605 - //接口  
606 - Map reserveData = {  
607 - 'swich_phone': addPhone ? '1' : '0',  
608 - 'swich_manager': addManager ? '1' : '0',  
609 - 'swich_park': addParking ? '1' : '0',  
610 - 'park_info': parkingIncoC.text,  
611 - 'seller_name': sellername,  
612 - 'date': dateValue,  
613 - 'dsolt': dsolt,  
614 - 'room': marketingCenterProvider.tableOuterList.length > 0 &&  
615 - marketingCenterProvider  
616 - .tableOuterList[0].list.length >  
617 - 0  
618 - ? '${marketingCenterProvider.tableOuterList[0].name}${marketingCenterProvider.tableOuterList[0].list[0].name}'  
619 - : '',  
620 - 'pnum': marketingCenterProvider.tableOuterList.length > 0 &&  
621 - marketingCenterProvider  
622 - .tableOuterList[0].list.length >  
623 - 0  
624 - ? '${marketingCenterProvider.tableOuterList[0].list[0].tableNum}'  
625 - : '',  
626 - 'address': '${address}',  
627 - 'seller_phone': '${sellerphone}',  
628 - 'manager_image':  
629 - _baseIndoProvider.baseInfoSunModel.photo == null ||  
630 - _baseIndoProvider.baseInfoSunModel.photo == ''  
631 - ? 'http://nosqn.colorcun.com/yd_person.png'  
632 - : _baseIndoProvider.baseInfoSunModel.photo,  
633 - 'manager_name': '${_baseIndoProvider.baseInfoSunModel.name}',  
634 - 'manager_phone':  
635 - '${_baseIndoProvider.baseInfoSunModel.phone}',  
636 - 'manager_wechat':  
637 - '${_baseIndoProvider.baseInfoSunModel.wechat}',  
638 - 'long': long,  
639 - 'lat': lat  
640 - };  
641 -  
642 - Map<String, String> params = {  
643 - 'sid': Provider.of<UserModel>(context, listen: false)  
644 - .user  
645 - .sellerid,  
646 - 'reserve': json.encode(reserveData)  
647 - };  
648 -  
649 - bool success = await marketingCenterProvider  
650 - .setSellerTemplateConf(context, params, showLoading: true);  
651 - if (success) {  
652 -  
653 - Utils.showToast('保存成功');  
654 - Navigator.pop(context);  
655 - }  
656 - },  
657 - ),  
658 - )  
659 - ],  
660 - ),  
661 - ); 435 + fontSize: font(14)),
  436 + ),
  437 + VEmptyView(10),
  438 + Text('非常感谢您选择【${sellername}】!',
  439 + style: TextStyle(
  440 + color: MyColours.color_000000,
  441 + fontSize: font(14))),
  442 + VEmptyView(30),
  443 + _itemTitleAndSubTtile('日期', '${date}'),
  444 + VEmptyView(10),
  445 + _itemTitleAndSubTtile('餐段', '${dsolt}'),
  446 + VEmptyView(10),
  447 + marketingCenterProvider.tableOuterList.length > 0 &&
  448 + marketingCenterProvider
  449 + .tableOuterList[0].list.length >
  450 + 0
  451 + ? _itemTitleAndSubTtile('包间',
  452 + '${marketingCenterProvider.tableOuterList[0].name}${marketingCenterProvider.tableOuterList[0].list[0].name}')
  453 + : SizedBox(),
  454 + VEmptyView(10),
  455 + marketingCenterProvider.tableOuterList.length > 0 &&
  456 + marketingCenterProvider
  457 + .tableOuterList[0].list.length >
  458 + 0
  459 + ? _itemTitleAndSubTtile('人数',
  460 + '${marketingCenterProvider.tableOuterList[0].list[0].tableNum}')
  461 + : SizedBox(),
  462 + VEmptyView(10),
  463 + // _itemTitleAndSubTtile('地址', '${address}'),
  464 + // VEmptyView(10),
  465 + addParking
  466 + ? _itemTitleAndSubTtile(
  467 + '停车', '${parkingIncoC.text}')
  468 + : SizedBox(),
  469 + addParking ? VEmptyView(10) : SizedBox(),
  470 + if (addPhone)
  471 + _itemTitleAndSubTtile('联系', '${sellerphone}'),
  472 + VEmptyView(20),
  473 + addManager
  474 + ? Row(
  475 + children: [
  476 + HEmptyView(20),
  477 + ClipRRect(
  478 + borderRadius:
  479 + BorderRadius.circular(r(35)),
  480 + child: Image.network(
  481 + _baseIndoProvider.baseInfoSunModel ==
  482 + null ||
  483 + _baseIndoProvider
  484 + .baseInfoSunModel
  485 + .photo ==
  486 + null ||
  487 + _baseIndoProvider
  488 + .baseInfoSunModel
  489 + .photo ==
  490 + ''
  491 + ? 'http://nosqn.colorcun.com/yd_person.png'
  492 + : _baseIndoProvider
  493 + .baseInfoSunModel.photo,
  494 + fit: BoxFit.cover,
  495 + width: w(70),
  496 + height: w(70),
  497 + ),
  498 + ),
  499 + HEmptyView(20),
  500 + // Spacer(),
  501 + Expanded(
  502 + child: Column(
  503 + crossAxisAlignment:
  504 + CrossAxisAlignment.start,
  505 + children: [
  506 + Text(
  507 + '专属服务:${_baseIndoProvider.baseInfoSunModel == null || _baseIndoProvider.baseInfoSunModel.name == null ? Provider.of<UserModel>(context, listen: false).user.nickName : _baseIndoProvider.baseInfoSunModel.name}',
  508 + style: TextStyle(
  509 + color: MyColours.color_999999,
  510 + fontWeight: FontWeight.bold,
  511 + fontSize: font(12)),
  512 + ),
  513 + VEmptyView(16),
  514 + Text(
  515 + '服务电话:${_baseIndoProvider.baseInfoSunModel == null || _baseIndoProvider.baseInfoSunModel.phone == null ? Provider.of<UserModel>(context, listen: false).user.userphone : _baseIndoProvider.baseInfoSunModel.phone}',
  516 + style: TextStyle(
  517 + color: MyColours.color_999999,
  518 + fontWeight: FontWeight.bold,
  519 + fontSize: font(12)),
  520 + ),
  521 + ],
  522 + )),
  523 + HEmptyView(10),
  524 + Column(
  525 + crossAxisAlignment:
  526 + CrossAxisAlignment.start,
  527 + children: [
  528 + RoundButton(
  529 + width: w(72),
  530 + height: w(22),
  531 + text: '拨打电话',
  532 + gradientStart: MyColours.color_ffffff,
  533 + gradientEnd: MyColours.color_ffffff,
  534 + borderColor: MyColours.color_0143A3,
  535 + textColor: MyColours.color_0143A3,
  536 + radius: r(11),
  537 + fontSize: 24,
  538 + isBold: true,
  539 + onPressed: () {},
  540 + ),
  541 + VEmptyView(16),
  542 + RoundButton(
  543 + width: w(72),
  544 + height: w(22),
  545 + text: '复制微信号',
  546 + gradientStart: MyColours.color_ffffff,
  547 + gradientEnd: MyColours.color_ffffff,
  548 + borderColor: MyColours.color_0143A3,
  549 + textColor: MyColours.color_0143A3,
  550 + radius: r(11),
  551 + fontSize: 24,
  552 + isBold: true,
  553 + onPressed: () {},
  554 + ),
  555 + ],
  556 + )
  557 + ],
  558 + )
  559 + : SizedBox(),
  560 + addManager ? VEmptyView(10) : SizedBox(),
  561 + Text('欢迎垂询,恭候光临!',
  562 + style: TextStyle(
  563 + color: MyColours.color_000000,
  564 + fontSize: font(14))),
  565 + ],
  566 + ),
  567 + ),
  568 + VEmptyView(20),
  569 + Container(
  570 + width: double.infinity,
  571 + margin: EdgeInsets.symmetric(horizontal: w(20)),
  572 + padding: EdgeInsets.symmetric(
  573 + horizontal: w(15), vertical: w(12)),
  574 + decoration: BoxDecoration(
  575 + color: MyColours.color_d9d9d9,
  576 + borderRadius: BorderRadius.circular(r(5))),
  577 + child: Row(
  578 + children: [
  579 + Image.asset(
  580 + Utils.getImgPath('location_blue'),
  581 + width: w(16),
  582 + ),
  583 + HEmptyView(28),
  584 + Expanded(
  585 + child: Column(
  586 + crossAxisAlignment: CrossAxisAlignment.start,
  587 + children: [
  588 + Text('${sellername}',
  589 + style: TextStyle(
  590 + color: MyColours.color_000000,
  591 + fontWeight: FontWeight.bold,
  592 + fontSize: font(14))),
  593 + VEmptyView(10),
  594 + Text('${address ?? ''}',
  595 + style: TextStyle(
  596 + height: 1.3,
  597 + color: MyColours.color_000000,
  598 + fontSize: font(14))),
  599 + ],
  600 + ))
  601 + ],
  602 + ),
  603 + ),
  604 + VEmptyView(16)
  605 + ]),
  606 + )),
  607 + Container(
  608 + color: MyColours.color_ffffff,
  609 + padding: EdgeInsets.only(
  610 + left: w(45), right: w(45), top: w(12), bottom: w(25)),
  611 + child: RoundButton(
  612 + text: '保存',
  613 + gradientStart: MyColours.color_199095,
  614 + gradientEnd: MyColours.color_199095,
  615 + // borderColor: MyColours.color_999999,
  616 + radius: r(5),
  617 + fontSize: 34,
  618 + height: w(40),
  619 + isBold: true,
  620 + onPressed: () async {
  621 + FocusScope.of(context)
  622 + .requestFocus(FocusNode()); //点击空白处隐藏键盘
  623 +
  624 + if (addParking && parkingIncoC.text.trim().length == 0) {
  625 + Utils.showToast('请输入停车信息!');
  626 + return false;
  627 + }
  628 +
  629 + //接口
  630 + Map reserveData = {
  631 + 'swich_phone': addPhone ? '1' : '0',
  632 + 'swich_manager': addManager ? '1' : '0',
  633 + 'swich_park': addParking ? '1' : '0',
  634 + 'park_info': parkingIncoC.text,
  635 + 'seller_name': sellername,
  636 + 'date': dateValue,
  637 + 'dsolt': dsolt,
  638 + 'room': marketingCenterProvider.tableOuterList.length >
  639 + 0 &&
  640 + marketingCenterProvider
  641 + .tableOuterList[0].list.length >
  642 + 0
  643 + ? '${marketingCenterProvider.tableOuterList[0].name}${marketingCenterProvider.tableOuterList[0].list[0].name}'
  644 + : '',
  645 + 'pnum': marketingCenterProvider.tableOuterList.length >
  646 + 0 &&
  647 + marketingCenterProvider
  648 + .tableOuterList[0].list.length >
  649 + 0
  650 + ? '${marketingCenterProvider.tableOuterList[0].list[0].tableNum}'
  651 + : '',
  652 + 'address': '${address}',
  653 + 'seller_phone': '${sellerphone}',
  654 + 'manager_image':
  655 + _baseIndoProvider.baseInfoSunModel.photo == null ||
  656 + _baseIndoProvider.baseInfoSunModel.photo ==
  657 + ''
  658 + ? 'http://nosqn.colorcun.com/yd_person.png'
  659 + : _baseIndoProvider.baseInfoSunModel.photo,
  660 + 'manager_name':
  661 + '${_baseIndoProvider.baseInfoSunModel.name}',
  662 + 'manager_phone':
  663 + '${_baseIndoProvider.baseInfoSunModel.phone}',
  664 + 'manager_wechat':
  665 + '${_baseIndoProvider.baseInfoSunModel.wechat}',
  666 + 'long': long,
  667 + 'lat': lat
  668 + };
  669 +
  670 + Map<String, String> params = {
  671 + 'sid': Provider.of<UserModel>(context, listen: false)
  672 + .user
  673 + .sellerid,
  674 + 'reserve': json.encode(reserveData)
  675 + };
  676 +
  677 + bool success = await marketingCenterProvider
  678 + .setSellerTemplateConf(context, params,
  679 + showLoading: true);
  680 + if (success) {
  681 + Utils.showToast('保存成功');
  682 + Navigator.pop(context);
  683 + }
  684 + },
  685 + ),
  686 + )
  687 + ],
  688 + );
  689 + }
  690 + }));
662 } 691 }
663 } 692 }
@@ -2,11 +2,13 @@ import 'package:cached_network_image/cached_network_image.dart'; @@ -2,11 +2,13 @@ import 'package:cached_network_image/cached_network_image.dart';
2 import 'package:flutter/material.dart'; 2 import 'package:flutter/material.dart';
3 import 'package:flutter_screenutil/flutter_screenutil.dart'; 3 import 'package:flutter_screenutil/flutter_screenutil.dart';
4 import 'package:one_key/pages/my/marketing_center/theme_model.dart'; 4 import 'package:one_key/pages/my/marketing_center/theme_model.dart';
  5 +import 'package:one_key/route/navigator_util.dart';
5 import 'package:one_key/widgets/system_app_bar.dart'; 6 import 'package:one_key/widgets/system_app_bar.dart';
6 import 'package:one_key/widgets/v_empty_view.dart'; 7 import 'package:one_key/widgets/v_empty_view.dart';
7 8
8 import '../../../res/colors.dart'; 9 import '../../../res/colors.dart';
9 import '../../../utils/dialog_util.dart'; 10 import '../../../utils/dialog_util.dart';
  11 +import '../../../utils/event_bus.dart';
10 import '../../../utils/screen_util.dart'; 12 import '../../../utils/screen_util.dart';
11 import '../../../utils/utils.dart'; 13 import '../../../utils/utils.dart';
12 import '../../../widgets/MyDivider.dart'; 14 import '../../../widgets/MyDivider.dart';
@@ -28,83 +30,121 @@ class InvitationThemeHomePage extends StatefulWidget { @@ -28,83 +30,121 @@ class InvitationThemeHomePage extends StatefulWidget {
28 } 30 }
29 31
30 class _InvitationThemeHomePageState extends State<InvitationThemeHomePage> { 32 class _InvitationThemeHomePageState extends State<InvitationThemeHomePage> {
31 - // 主题数据  
32 - Map<String, ThemeModel> themeDatas = {};  
33 -  
34 ScrollController controller = ScrollController(); 33 ScrollController controller = ScrollController();
35 34
36 //当前店铺选中的颜色和板式 35 //当前店铺选中的颜色和板式
37 36
38 - String themeColor = '摩洛哥蓝';  
39 - String themeType = '4'; //模版类型 37 + String themeColor;
  38 + String themeType = '1'; //模版类型
40 // int indexSelectColor = 0; //选中第几个模版 (有配色选中index) 39 // int indexSelectColor = 0; //选中第几个模版 (有配色选中index)
41 // int indexSelectNoColor = 0; //选中第几个模版 (无配色选中index) 40 // int indexSelectNoColor = 0; //选中第几个模版 (无配色选中index)
42 - List<ThemeSunModel> themeDatasno = []; 41 + List<ThemeSunModel> themesDatas = [];
43 42
44 ThemeModel themeModelCurrunt; //有配色对应的当前页面模版数据 43 ThemeModel themeModelCurrunt; //有配色对应的当前页面模版数据
45 44
  45 + // Map<String, dynamic> json1 = {
  46 + // 'color_name': '黑蓝过渡',
  47 + // 'color_value_s': 'FF42A5FF',
  48 + // 'color_value_m': 'FF000000',
  49 + // 'color_value_e': 'FF42A5FF',
  50 + // 'urls': urls
  51 + // };
  52 +
  53 + // ThemeModel themeModel1 = ThemeModel.fromJson(json1);
  54 + // themeDatas['黑蓝过渡'] = themeModel1;
  55 +
46 @override 56 @override
47 void initState() { 57 void initState() {
48 super.initState(); 58 super.initState();
49 59
50 - // //模版1  
51 - Map<String, dynamic> jsonSun11 = {  
52 - 'name': '1 经典图片式',  
53 - 'id': '1',  
54 - 'url': 'https://qn.colorcun.com/template/jingdianbianyi.png',  
55 - };  
56 - ThemeSunModel themeSunModel11 = ThemeSunModel.fromJson(jsonSun11);  
57 - themeDatasno.add(themeSunModel11); 60 + //模版1
  61 + _addModel1();
58 62
59 - //黑蓝过度  
60 - _addHeilanguodu(); 63 + //模版2
  64 + _addModel2();
61 65
62 - //石绿过度  
63 - _addShilvuodu(); 66 + //模版3
  67 + _addModel3();
64 68
65 - //中国红过度  
66 - _addZhongguohongguodu(); 69 + //模版4
  70 + _addModel4();
67 71
68 - //群青过度  
69 - _addQunqingguodu(); 72 + //模版5
  73 + _addModel5();
  74 +
  75 + //模版6
  76 + _addModel6();
70 77
71 - //深中国红  
72 - _addShenzhongguohong(); 78 + //模版7
  79 + _addModel7();
73 80
74 - //中国红  
75 - _addZhongguohong(); 81 + WidgetsBinding.instance.addPostFrameCallback((_) {
  82 + bus.on("theme_color_type", (arg) {
  83 + themeColor = arg['themeColor'];
  84 + themeType = arg['themeType'];
76 85
77 - //蓝采和  
78 - _addLancaihe(); 86 + themesDatas[
  87 + themesDatas.indexWhere((element) => element.id == themeType)]
  88 + .themeColorDefault = themeColor;
79 89
80 - //石绿  
81 - _addShilv(); 90 + setState(() {});
  91 + });
  92 + });
82 93
83 - //姜黄  
84 - _addJianghuang(); 94 + // //石绿过度
  95 + // _addShilvuodu();
85 96
86 - //金黄  
87 - _addJinhuang(); 97 + // //中国红过度
  98 + // _addZhongguohongguodu();
88 99
89 - //苍黄  
90 - _addCanghuang(); 100 + // //群青过度
  101 + // _addQunqingguodu();
91 102
92 - //群青  
93 - _addQunqing(); 103 + // //深中国红
  104 + // _addShenzhongguohong();
94 105
95 - //摩洛哥蓝  
96 - _addMoluogelan(); 106 + // //中国红
  107 + // _addZhongguohong();
97 108
98 - print(themeDatas); 109 + // //蓝采和
  110 + // _addLancaihe();
99 111
100 - Map<String, String> map = {  
101 - 'color': convert.jsonEncode(themeDatas),  
102 - 'no_color': convert.jsonEncode(themeDatasno)  
103 - };  
104 - print(map); 112 + // //石绿
  113 + // _addShilv();
  114 +
  115 + // //姜黄
  116 + // _addJianghuang();
  117 +
  118 + // //金黄
  119 + // _addJinhuang();
  120 +
  121 + // //苍黄
  122 + // _addCanghuang();
  123 +
  124 + // //群青
  125 + // _addQunqing();
  126 +
  127 + // //摩洛哥蓝
  128 + // _addMoluogelan();
  129 +
  130 + print(themesDatas);
  131 + String ddd = convert.jsonEncode(themesDatas);
  132 + print(ddd);
  133 + // Map<String, String> map = {
  134 + // 'color': convert.jsonEncode(themeDatas),
  135 + // 'no_color': convert.jsonEncode(themesDatas)
  136 + // };
  137 + // print(map);
  138 + }
  139 +
  140 + @override
  141 + void dispose() {
  142 + bus.off('theme_color_type');
  143 + super.dispose();
105 } 144 }
106 145
107 - _addMoluogelan() { 146 +/**
  147 + * _addMoluogelan() {
108 List<ThemeSunModel> urls = []; 148 List<ThemeSunModel> urls = [];
109 149
110 // //模版1 150 // //模版1
@@ -715,67 +755,7 @@ class _InvitationThemeHomePageState extends State<InvitationThemeHomePage> { @@ -715,67 +755,7 @@ class _InvitationThemeHomePageState extends State<InvitationThemeHomePage> {
715 ThemeModel themeModel1 = ThemeModel.fromJson(json1); 755 ThemeModel themeModel1 = ThemeModel.fromJson(json1);
716 // themeDatas.add(themeModel1); 756 // themeDatas.add(themeModel1);
717 themeDatas['深中国红'] = themeModel1; 757 themeDatas['深中国红'] = themeModel1;
718 - }  
719 -  
720 - _addHeilanguodu() {  
721 - List<ThemeSunModel> urls = [];  
722 - //模版3  
723 - Map<String, dynamic> jsonSun13 = {  
724 - 'name': '3 简洁信息图文A(多色)',  
725 - 'id': '3',  
726 - 'url': 'https://qn.colorcun.com/template/heilanguodu-3.png',  
727 - };  
728 - ThemeSunModel themeSunModel13 = ThemeSunModel.fromJson(jsonSun13);  
729 - urls.add(themeSunModel13);  
730 - //模版4  
731 - Map<String, dynamic> jsonSun14 = {  
732 - 'name': '4 半屏邀请函A(多色)',  
733 - 'id': '4',  
734 - 'url': 'https://qn.colorcun.com/template/heilanguodu-4.png',  
735 - };  
736 - ThemeSunModel themeSunModel14 = ThemeSunModel.fromJson(jsonSun14);  
737 - urls.add(themeSunModel14);  
738 -  
739 - //模版5  
740 - Map<String, dynamic> jsonSun15 = {  
741 - 'name': '5 半屏邀请函B(多色)',  
742 - 'id': '5',  
743 - 'url': 'https://qn.colorcun.com/template/heilanguodu-5.png',  
744 - };  
745 - ThemeSunModel themeSunModel15 = ThemeSunModel.fromJson(jsonSun15);  
746 - urls.add(themeSunModel15);  
747 -  
748 - //模版6  
749 - Map<String, dynamic> jsonSun16 = {  
750 - 'name': '6 无预订包间图片A(多色)',  
751 - 'id': '6',  
752 - 'url': 'https://qn.colorcun.com/template/heilanguodu-6.png',  
753 - };  
754 - ThemeSunModel themeSunModel16 = ThemeSunModel.fromJson(jsonSun16);  
755 - urls.add(themeSunModel16);  
756 -  
757 - //模版7  
758 - Map<String, dynamic> jsonSun17 = {  
759 - 'name': '7 无预订包间图片B',  
760 - 'id': '7',  
761 - 'url': 'https://qn.colorcun.com/template/heilanguodu-7.png',  
762 - };  
763 - ThemeSunModel themeSunModel17 = ThemeSunModel.fromJson(jsonSun17);  
764 - urls.add(themeSunModel17);  
765 -  
766 - Map<String, dynamic> json1 = {  
767 - 'color_name': '黑蓝过渡',  
768 - 'color_value_s': 'FF42A5FF',  
769 - 'color_value_m': 'FF000000',  
770 - 'color_value_e': 'FF42A5FF',  
771 - 'urls': urls  
772 - };  
773 -  
774 - ThemeModel themeModel1 = ThemeModel.fromJson(json1);  
775 - themeDatas['黑蓝过渡'] = themeModel1;  
776 - }  
777 -  
778 - _addShilvuodu() { 758 + _addShilvuodu() {
779 List<ThemeSunModel> urls = []; 759 List<ThemeSunModel> urls = [];
780 //模版3 760 //模版3
781 Map<String, dynamic> jsonSun13 = { 761 Map<String, dynamic> jsonSun13 = {
@@ -952,28 +932,712 @@ class _InvitationThemeHomePageState extends State<InvitationThemeHomePage> { @@ -952,28 +932,712 @@ class _InvitationThemeHomePageState extends State<InvitationThemeHomePage> {
952 themeDatas['群青过渡'] = themeModel1; 932 themeDatas['群青过渡'] = themeModel1;
953 } 933 }
954 934
955 - _selectTheme(String id) {  
956 - List<ThemeSunModel> temp = [];  
957 - temp.addAll(themeModelCurrunt.urls);  
958 - temp.addAll(themeDatasno);  
959 - List<String> tempUrls = temp.map((e) => e.url).toList();  
960 -  
961 - // List<String> temp =  
962 - // themeModel.urls.map((e) => e.url).toList();  
963 - // print(temp);  
964 -  
965 - // List<String> temp =  
966 - // themeDatasno.map((e) => e.url).toList();  
967 - print(temp);  
968 - _showPhotoView(  
969 - context, temp.indexWhere((element) => element.id == id), tempUrls,  
970 - (index) {  
971 - //选中的index  
972 - themeType = temp[index].id; //当前选中模版的id  
973 - setState(() {});  
974 - }); 935 + }
  936 +*/
  937 +
  938 + _addModel1() {
  939 + // //模版1
  940 + Map<String, dynamic> jsonSun11 = {
  941 + 'name': '1 经典图片式',
  942 + 'id': '1',
  943 + 'url': 'https://qn.colorcun.com/template/jingdianbianyi.png',
  944 + };
  945 + ThemeSunModel themeSunModel11 = ThemeSunModel.fromJson(jsonSun11);
  946 + themesDatas.add(themeSunModel11);
  947 + }
  948 +
  949 + _addModel2() {
  950 + // //模版2
  951 + Map<String, dynamic> jsonSun12 = {
  952 + 'name': '2 简洁图文A(多色)',
  953 + 'id': '2',
  954 + 'colors': [
  955 + {
  956 + 'color_name': '深中国红',
  957 + 'color_value_s': 'FF86201B',
  958 + 'color_value_m': 'FF86201B',
  959 + 'color_value_e': 'FF86201B',
  960 + 'lite_class': 'crimson',
  961 + 'url': 'https://qn.colorcun.com/template/shenzhongguohong-2.png'
  962 + },
  963 + {
  964 + 'color_name': '中国红',
  965 + 'color_value_s': 'FFAF231C',
  966 + 'color_value_m': 'FFAF231C',
  967 + 'color_value_e': 'FFAF231C',
  968 + 'lite_class': 'chinaRed',
  969 + 'url': 'https://qn.colorcun.com/template/zhongguohong-2.png'
  970 + },
  971 + {
  972 + 'color_name': '蓝采和',
  973 + 'color_value_s': 'FF06436F',
  974 + 'color_value_m': 'FF06436F',
  975 + 'color_value_e': 'FF06436F',
  976 + 'lite_class': 'lanCaiHe',
  977 + 'url': 'https://qn.colorcun.com/template/lancaihe-2.png'
  978 + },
  979 + {
  980 + 'color_name': '石绿',
  981 + 'color_value_s': 'FF206864',
  982 + 'color_value_m': 'FF206864',
  983 + 'color_value_e': 'FF206864',
  984 + 'lite_class': 'stoneGreen',
  985 + 'url': 'https://qn.colorcun.com/template/shilv-2.png'
  986 + },
  987 + {
  988 + 'color_name': '姜黄',
  989 + 'color_value_s': 'FFB39437',
  990 + 'color_value_m': 'FFB39437',
  991 + 'color_value_e': 'FFB39437',
  992 + 'lite_class': 'turmeric',
  993 + 'url': 'https://qn.colorcun.com/template/jianghuang-2.png',
  994 + },
  995 + {
  996 + 'color_name': '苍黄',
  997 + 'color_value_s': 'FFC85306',
  998 + 'color_value_m': 'FFC85306',
  999 + 'color_value_e': 'FFC85306',
  1000 + 'lite_class': 'greenishYellow',
  1001 + 'url': 'https://qn.colorcun.com/template/canghuang-2.png',
  1002 + },
  1003 + {
  1004 + 'color_name': '金黄',
  1005 + 'color_value_s': 'FFC67B3A',
  1006 + 'color_value_m': 'FFC67B3A',
  1007 + 'color_value_e': 'FFC67B3A',
  1008 + 'lite_class': 'golden',
  1009 + 'url': 'https://qn.colorcun.com/template/jinhuang-2.png',
  1010 + },
  1011 + {
  1012 + 'color_name': '群青',
  1013 + 'color_value_s': 'FF0143A3',
  1014 + 'color_value_m': 'FF0143A3',
  1015 + 'color_value_e': 'FF0143A3',
  1016 + 'lite_class': 'ultramarine',
  1017 + 'url': 'https://qn.colorcun.com/template/qunqing-2.png',
  1018 + },
  1019 + {
  1020 + 'color_name': '摩洛哥蓝',
  1021 + 'color_value_s': 'FF19516A',
  1022 + 'color_value_m': 'FF19516A',
  1023 + 'color_value_e': 'FF19516A',
  1024 + 'lite_class': 'moroccanBlue',
  1025 + 'url': 'https://qn.colorcun.com/template/moluogelan-2.png',
  1026 + }
  1027 + ]
  1028 + };
  1029 +
  1030 + ThemeSunModel themeSunModel12 = ThemeSunModel.fromJson(jsonSun12);
  1031 + themesDatas.add(themeSunModel12);
975 } 1032 }
976 1033
  1034 + _addModel3() {
  1035 + // //模版3
  1036 + Map<String, dynamic> jsonSun12 = {
  1037 + 'name': '3 简洁信息图文A(多色)',
  1038 + 'id': '3',
  1039 + 'colors': [
  1040 + {
  1041 + 'color_name': '黑蓝过渡',
  1042 + 'color_value_s': 'FF42A5FF',
  1043 + 'color_value_m': 'FF000000',
  1044 + 'color_value_e': 'FF42A5FF',
  1045 + 'lite_class': 'blackBlueGradient',
  1046 + 'url': 'https://qn.colorcun.com/template/heilanguodu-3.png'
  1047 + },
  1048 + {
  1049 + 'color_name': '石绿过渡',
  1050 + 'color_value_s': 'FF438E93',
  1051 + 'color_value_m': 'FF206864',
  1052 + 'color_value_e': 'FF42A5FF',
  1053 + 'lite_class': 'stoneGreenGradient',
  1054 + 'url': 'https://qn.colorcun.com/template/shilvguodu-3.png'
  1055 + },
  1056 + {
  1057 + 'color_name': '中国红过渡',
  1058 + 'color_value_s': 'FFAF231C',
  1059 + 'color_value_m': 'FF86201B',
  1060 + 'color_value_e': 'FFAF231C',
  1061 + 'lite_class': 'chinaRedGradient',
  1062 + 'url': 'https://qn.colorcun.com/template/zhongguohongguodu-3.png'
  1063 + },
  1064 + {
  1065 + 'color_name': '群青过渡',
  1066 + 'color_value_s': 'FF4C8DAD',
  1067 + 'color_value_m': 'FF0143A3',
  1068 + 'color_value_e': 'FF42A5FF',
  1069 + 'lite_class': 'ultramarineGradient',
  1070 + 'url': 'https://qn.colorcun.com/template/qunqingguodu-3.png'
  1071 + },
  1072 + {
  1073 + 'color_name': '深中国红',
  1074 + 'color_value_s': 'FF86201B',
  1075 + 'color_value_m': 'FF86201B',
  1076 + 'color_value_e': 'FF86201B',
  1077 + 'lite_class': 'crimson',
  1078 + 'url': 'https://qn.colorcun.com/template/shenzhongguohong-3.png'
  1079 + },
  1080 + {
  1081 + 'color_name': '中国红',
  1082 + 'color_value_s': 'FFAF231C',
  1083 + 'color_value_m': 'FFAF231C',
  1084 + 'color_value_e': 'FFAF231C',
  1085 + 'lite_class': 'chinaRed',
  1086 + 'url': 'https://qn.colorcun.com/template/zhongguohong-3.png'
  1087 + },
  1088 + {
  1089 + 'color_name': '蓝采和',
  1090 + 'color_value_s': 'FF06436F',
  1091 + 'color_value_m': 'FF06436F',
  1092 + 'color_value_e': 'FF06436F',
  1093 + 'lite_class': 'lanCaiHe',
  1094 + 'url': 'https://qn.colorcun.com/template/lancaihe-3.png'
  1095 + },
  1096 + {
  1097 + 'color_name': '石绿',
  1098 + 'color_value_s': 'FF206864',
  1099 + 'color_value_m': 'FF206864',
  1100 + 'color_value_e': 'FF206864',
  1101 + 'lite_class': 'stoneGreen',
  1102 + 'url': 'https://qn.colorcun.com/template/shilv-3.png'
  1103 + },
  1104 + {
  1105 + 'color_name': '姜黄',
  1106 + 'color_value_s': 'FFB39437',
  1107 + 'color_value_m': 'FFB39437',
  1108 + 'color_value_e': 'FFB39437',
  1109 + 'lite_class': 'turmeric',
  1110 + 'url': 'https://qn.colorcun.com/template/jianghuang-3.png',
  1111 + },
  1112 + {
  1113 + 'color_name': '苍黄',
  1114 + 'color_value_s': 'FFC85306',
  1115 + 'color_value_m': 'FFC85306',
  1116 + 'color_value_e': 'FFC85306',
  1117 + 'lite_class': 'greenishYellow',
  1118 + 'url': 'https://qn.colorcun.com/template/canghuang-3.png',
  1119 + },
  1120 + {
  1121 + 'color_name': '金黄',
  1122 + 'color_value_s': 'FFC67B3A',
  1123 + 'color_value_m': 'FFC67B3A',
  1124 + 'color_value_e': 'FFC67B3A',
  1125 + 'lite_class': 'golden',
  1126 + 'url': 'https://qn.colorcun.com/template/jinhuang-3.png',
  1127 + },
  1128 + {
  1129 + 'color_name': '群青',
  1130 + 'color_value_s': 'FF0143A3',
  1131 + 'color_value_m': 'FF0143A3',
  1132 + 'color_value_e': 'FF0143A3',
  1133 + 'lite_class': 'ultramarine',
  1134 + 'url': 'https://qn.colorcun.com/template/qunqing-3.png',
  1135 + },
  1136 + {
  1137 + 'color_name': '摩洛哥蓝',
  1138 + 'color_value_s': 'FF19516A',
  1139 + 'color_value_m': 'FF19516A',
  1140 + 'color_value_e': 'FF19516A',
  1141 + 'lite_class': 'moroccanBlue',
  1142 + 'url': 'https://qn.colorcun.com/template/moluogelan-3.png',
  1143 + }
  1144 + ]
  1145 + };
  1146 +
  1147 + ThemeSunModel themeSunModel12 = ThemeSunModel.fromJson(jsonSun12);
  1148 + themesDatas.add(themeSunModel12);
  1149 + }
  1150 +
  1151 + _addModel4() {
  1152 + // //模版4
  1153 + Map<String, dynamic> jsonSun12 = {
  1154 + 'name': '4 半屏邀请函A(多色)',
  1155 + 'id': '4',
  1156 + 'colors': [
  1157 + {
  1158 + 'color_name': '黑蓝过渡',
  1159 + 'color_value_s': 'FF42A5FF',
  1160 + 'color_value_m': 'FF000000',
  1161 + 'color_value_e': 'FF42A5FF',
  1162 + 'lite_class': 'blackBlueGradient',
  1163 + 'url': 'https://qn.colorcun.com/template/heilanguodu-4.png'
  1164 + },
  1165 + {
  1166 + 'color_name': '石绿过渡',
  1167 + 'color_value_s': 'FF438E93',
  1168 + 'color_value_m': 'FF206864',
  1169 + 'color_value_e': 'FF42A5FF',
  1170 + 'lite_class': 'stoneGreenGradient',
  1171 + 'url': 'https://qn.colorcun.com/template/shilvguodu-4.png'
  1172 + },
  1173 + {
  1174 + 'color_name': '中国红过渡',
  1175 + 'color_value_s': 'FFAF231C',
  1176 + 'color_value_m': 'FF86201B',
  1177 + 'color_value_e': 'FFAF231C',
  1178 + 'lite_class': 'chinaRedGradient',
  1179 + 'url': 'https://qn.colorcun.com/template/zhongguohongguodu-4.png'
  1180 + },
  1181 + {
  1182 + 'color_name': '群青过渡',
  1183 + 'color_value_s': 'FF4C8DAD',
  1184 + 'color_value_m': 'FF0143A3',
  1185 + 'color_value_e': 'FF42A5FF',
  1186 + 'lite_class': 'ultramarineGradient',
  1187 + 'url': 'https://qn.colorcun.com/template/qunqingguodu-4.png'
  1188 + },
  1189 + {
  1190 + 'color_name': '深中国红',
  1191 + 'color_value_s': 'FF86201B',
  1192 + 'color_value_m': 'FF86201B',
  1193 + 'color_value_e': 'FF86201B',
  1194 + 'lite_class': 'crimson',
  1195 + 'url': 'https://qn.colorcun.com/template/shenzhongguohong-4.png'
  1196 + },
  1197 + {
  1198 + 'color_name': '中国红',
  1199 + 'color_value_s': 'FFAF231C',
  1200 + 'color_value_m': 'FFAF231C',
  1201 + 'color_value_e': 'FFAF231C',
  1202 + 'lite_class': 'chinaRed',
  1203 + 'url': 'https://qn.colorcun.com/template/zhongguohong-4.png'
  1204 + },
  1205 + {
  1206 + 'color_name': '蓝采和',
  1207 + 'color_value_s': 'FF06436F',
  1208 + 'color_value_m': 'FF06436F',
  1209 + 'color_value_e': 'FF06436F',
  1210 + 'lite_class': 'lanCaiHe',
  1211 + 'url': 'https://qn.colorcun.com/template/lancaihe-4.png'
  1212 + },
  1213 + {
  1214 + 'color_name': '石绿',
  1215 + 'color_value_s': 'FF206864',
  1216 + 'color_value_m': 'FF206864',
  1217 + 'color_value_e': 'FF206864',
  1218 + 'lite_class': 'stoneGreen',
  1219 + 'url': 'https://qn.colorcun.com/template/shilv-4.png'
  1220 + },
  1221 + {
  1222 + 'color_name': '姜黄',
  1223 + 'color_value_s': 'FFB39437',
  1224 + 'color_value_m': 'FFB39437',
  1225 + 'color_value_e': 'FFB39437',
  1226 + 'lite_class': 'turmeric',
  1227 + 'url': 'https://qn.colorcun.com/template/jianghuang-4.png',
  1228 + },
  1229 + {
  1230 + 'color_name': '苍黄',
  1231 + 'color_value_s': 'FFC85306',
  1232 + 'color_value_m': 'FFC85306',
  1233 + 'color_value_e': 'FFC85306',
  1234 + 'lite_class': 'greenishYellow',
  1235 + 'url': 'https://qn.colorcun.com/template/canghuang-4.png',
  1236 + },
  1237 + {
  1238 + 'color_name': '金黄',
  1239 + 'color_value_s': 'FFC67B3A',
  1240 + 'color_value_m': 'FFC67B3A',
  1241 + 'color_value_e': 'FFC67B3A',
  1242 + 'lite_class': 'golden',
  1243 + 'url': 'https://qn.colorcun.com/template/jinhuang-4.png',
  1244 + },
  1245 + {
  1246 + 'color_name': '群青',
  1247 + 'color_value_s': 'FF0143A3',
  1248 + 'color_value_m': 'FF0143A3',
  1249 + 'color_value_e': 'FF0143A3',
  1250 + 'lite_class': 'ultramarine',
  1251 + 'url': 'https://qn.colorcun.com/template/qunqing-4.png',
  1252 + },
  1253 + {
  1254 + 'color_name': '摩洛哥蓝',
  1255 + 'color_value_s': 'FF19516A',
  1256 + 'color_value_m': 'FF19516A',
  1257 + 'color_value_e': 'FF19516A',
  1258 + 'lite_class': 'moroccanBlue',
  1259 + 'url': 'https://qn.colorcun.com/template/moluogelan-4.png',
  1260 + }
  1261 + ]
  1262 + };
  1263 +
  1264 + ThemeSunModel themeSunModel12 = ThemeSunModel.fromJson(jsonSun12);
  1265 + themesDatas.add(themeSunModel12);
  1266 + }
  1267 +
  1268 + _addModel5() {
  1269 + // //模版5
  1270 + Map<String, dynamic> jsonSun12 = {
  1271 + 'name': '5 半屏邀请函B(多色)',
  1272 + 'id': '5',
  1273 + 'colors': [
  1274 + {
  1275 + 'color_name': '黑蓝过渡',
  1276 + 'color_value_s': 'FF42A5FF',
  1277 + 'color_value_m': 'FF000000',
  1278 + 'color_value_e': 'FF42A5FF',
  1279 + 'lite_class': 'blackBlueGradient',
  1280 + 'url': 'https://qn.colorcun.com/template/heilanguodu-5.png'
  1281 + },
  1282 + {
  1283 + 'color_name': '石绿过渡',
  1284 + 'color_value_s': 'FF438E93',
  1285 + 'color_value_m': 'FF206864',
  1286 + 'color_value_e': 'FF42A5FF',
  1287 + 'lite_class': 'stoneGreenGradient',
  1288 + 'url': 'https://qn.colorcun.com/template/shilvguodu-5.png'
  1289 + },
  1290 + {
  1291 + 'color_name': '中国红过渡',
  1292 + 'color_value_s': 'FFAF231C',
  1293 + 'color_value_m': 'FF86201B',
  1294 + 'color_value_e': 'FFAF231C',
  1295 + 'lite_class': 'chinaRedGradient',
  1296 + 'url': 'https://qn.colorcun.com/template/zhongguohongguodu-5.png'
  1297 + },
  1298 + {
  1299 + 'color_name': '群青过渡',
  1300 + 'color_value_s': 'FF4C8DAD',
  1301 + 'color_value_m': 'FF0143A3',
  1302 + 'color_value_e': 'FF42A5FF',
  1303 + 'lite_class': 'ultramarineGradient',
  1304 + 'url': 'https://qn.colorcun.com/template/qunqingguodu-5.png'
  1305 + },
  1306 + {
  1307 + 'color_name': '深中国红',
  1308 + 'color_value_s': 'FF86201B',
  1309 + 'color_value_m': 'FF86201B',
  1310 + 'color_value_e': 'FF86201B',
  1311 + 'lite_class': 'crimson',
  1312 + 'url': 'https://qn.colorcun.com/template/shenzhongguohong-5.png'
  1313 + },
  1314 + {
  1315 + 'color_name': '中国红',
  1316 + 'color_value_s': 'FFAF231C',
  1317 + 'color_value_m': 'FFAF231C',
  1318 + 'color_value_e': 'FFAF231C',
  1319 + 'lite_class': 'chinaRed',
  1320 + 'url': 'https://qn.colorcun.com/template/zhongguohong-5.png'
  1321 + },
  1322 + {
  1323 + 'color_name': '蓝采和',
  1324 + 'color_value_s': 'FF06436F',
  1325 + 'color_value_m': 'FF06436F',
  1326 + 'color_value_e': 'FF06436F',
  1327 + 'lite_class': 'lanCaiHe',
  1328 + 'url': 'https://qn.colorcun.com/template/lancaihe-5.png'
  1329 + },
  1330 + {
  1331 + 'color_name': '石绿',
  1332 + 'color_value_s': 'FF206864',
  1333 + 'color_value_m': 'FF206864',
  1334 + 'color_value_e': 'FF206864',
  1335 + 'lite_class': 'stoneGreen',
  1336 + 'url': 'https://qn.colorcun.com/template/shilv-5.png'
  1337 + },
  1338 + {
  1339 + 'color_name': '姜黄',
  1340 + 'color_value_s': 'FFB39437',
  1341 + 'color_value_m': 'FFB39437',
  1342 + 'color_value_e': 'FFB39437',
  1343 + 'lite_class': 'turmeric',
  1344 + 'url': 'https://qn.colorcun.com/template/jianghuang-5.png',
  1345 + },
  1346 + {
  1347 + 'color_name': '苍黄',
  1348 + 'color_value_s': 'FFC85306',
  1349 + 'color_value_m': 'FFC85306',
  1350 + 'color_value_e': 'FFC85306',
  1351 + 'lite_class': 'greenishYellow',
  1352 + 'url': 'https://qn.colorcun.com/template/canghuang-5.png',
  1353 + },
  1354 + {
  1355 + 'color_name': '金黄',
  1356 + 'color_value_s': 'FFC67B3A',
  1357 + 'color_value_m': 'FFC67B3A',
  1358 + 'color_value_e': 'FFC67B3A',
  1359 + 'lite_class': 'golden',
  1360 + 'url': 'https://qn.colorcun.com/template/jinhuang-5.png',
  1361 + },
  1362 + {
  1363 + 'color_name': '群青',
  1364 + 'color_value_s': 'FF0143A3',
  1365 + 'color_value_m': 'FF0143A3',
  1366 + 'color_value_e': 'FF0143A3',
  1367 + 'lite_class': 'ultramarine',
  1368 + 'url': 'https://qn.colorcun.com/template/qunqing-5.png',
  1369 + },
  1370 + {
  1371 + 'color_name': '摩洛哥蓝',
  1372 + 'color_value_s': 'FF19516A',
  1373 + 'color_value_m': 'FF19516A',
  1374 + 'color_value_e': 'FF19516A',
  1375 + 'lite_class': 'moroccanBlue',
  1376 + 'url': 'https://qn.colorcun.com/template/moluogelan-5.png',
  1377 + }
  1378 + ]
  1379 + };
  1380 +
  1381 + ThemeSunModel themeSunModel12 = ThemeSunModel.fromJson(jsonSun12);
  1382 + themesDatas.add(themeSunModel12);
  1383 + }
  1384 +
  1385 + _addModel6() {
  1386 + // //模版6
  1387 + Map<String, dynamic> jsonSun12 = {
  1388 + 'name': '6 无预订包间图片A(多色)',
  1389 + 'id': '6',
  1390 + 'colors': [
  1391 + {
  1392 + 'color_name': '黑蓝过渡',
  1393 + 'color_value_s': 'FF42A5FF',
  1394 + 'color_value_m': 'FF000000',
  1395 + 'color_value_e': 'FF42A5FF',
  1396 + 'lite_class': 'blackBlueGradient',
  1397 + 'url': 'https://qn.colorcun.com/template/heilanguodu-6.png'
  1398 + },
  1399 + {
  1400 + 'color_name': '石绿过渡',
  1401 + 'color_value_s': 'FF438E93',
  1402 + 'color_value_m': 'FF206864',
  1403 + 'color_value_e': 'FF42A5FF',
  1404 + 'lite_class': 'stoneGreenGradient',
  1405 + 'url': 'https://qn.colorcun.com/template/shilvguodu-6.png'
  1406 + },
  1407 + {
  1408 + 'color_name': '中国红过渡',
  1409 + 'color_value_s': 'FFAF231C',
  1410 + 'color_value_m': 'FF86201B',
  1411 + 'color_value_e': 'FFAF231C',
  1412 + 'lite_class': 'chinaRedGradient',
  1413 + 'url': 'https://qn.colorcun.com/template/zhongguohongguodu-6.png'
  1414 + },
  1415 + {
  1416 + 'color_name': '群青过渡',
  1417 + 'color_value_s': 'FF4C8DAD',
  1418 + 'color_value_m': 'FF0143A3',
  1419 + 'color_value_e': 'FF42A5FF',
  1420 + 'lite_class': 'ultramarineGradient',
  1421 + 'url': 'https://qn.colorcun.com/template/qunqingguodu-6.png'
  1422 + },
  1423 + {
  1424 + 'color_name': '深中国红',
  1425 + 'color_value_s': 'FF86201B',
  1426 + 'color_value_m': 'FF86201B',
  1427 + 'color_value_e': 'FF86201B',
  1428 + 'lite_class': 'crimson',
  1429 + 'url': 'https://qn.colorcun.com/template/shenzhongguohong-6.png'
  1430 + },
  1431 + {
  1432 + 'color_name': '中国红',
  1433 + 'color_value_s': 'FFAF231C',
  1434 + 'color_value_m': 'FFAF231C',
  1435 + 'color_value_e': 'FFAF231C',
  1436 + 'lite_class': 'chinaRed',
  1437 + 'url': 'https://qn.colorcun.com/template/zhongguohong-6.png'
  1438 + },
  1439 + {
  1440 + 'color_name': '蓝采和',
  1441 + 'color_value_s': 'FF06436F',
  1442 + 'color_value_m': 'FF06436F',
  1443 + 'color_value_e': 'FF06436F',
  1444 + 'lite_class': 'lanCaiHe',
  1445 + 'url': 'https://qn.colorcun.com/template/lancaihe-6.png'
  1446 + },
  1447 + {
  1448 + 'color_name': '石绿',
  1449 + 'color_value_s': 'FF206864',
  1450 + 'color_value_m': 'FF206864',
  1451 + 'color_value_e': 'FF206864',
  1452 + 'lite_class': 'stoneGreen',
  1453 + 'url': 'https://qn.colorcun.com/template/shilv-6.png'
  1454 + },
  1455 + {
  1456 + 'color_name': '姜黄',
  1457 + 'color_value_s': 'FFB39437',
  1458 + 'color_value_m': 'FFB39437',
  1459 + 'color_value_e': 'FFB39437',
  1460 + 'lite_class': 'turmeric',
  1461 + 'url': 'https://qn.colorcun.com/template/jianghuang-6.png',
  1462 + },
  1463 + {
  1464 + 'color_name': '苍黄',
  1465 + 'color_value_s': 'FFC85306',
  1466 + 'color_value_m': 'FFC85306',
  1467 + 'color_value_e': 'FFC85306',
  1468 + 'lite_class': 'greenishYellow',
  1469 + 'url': 'https://qn.colorcun.com/template/canghuang-6.png',
  1470 + },
  1471 + {
  1472 + 'color_name': '金黄',
  1473 + 'color_value_s': 'FFC67B3A',
  1474 + 'color_value_m': 'FFC67B3A',
  1475 + 'color_value_e': 'FFC67B3A',
  1476 + 'lite_class': 'golden',
  1477 + 'url': 'https://qn.colorcun.com/template/jinhuang-6.png',
  1478 + },
  1479 + {
  1480 + 'color_name': '群青',
  1481 + 'color_value_s': 'FF0143A3',
  1482 + 'color_value_m': 'FF0143A3',
  1483 + 'color_value_e': 'FF0143A3',
  1484 + 'lite_class': 'ultramarine',
  1485 + 'url': 'https://qn.colorcun.com/template/qunqing-6.png',
  1486 + },
  1487 + {
  1488 + 'color_name': '摩洛哥蓝',
  1489 + 'color_value_s': 'FF19516A',
  1490 + 'color_value_m': 'FF19516A',
  1491 + 'color_value_e': 'FF19516A',
  1492 + 'lite_class': 'moroccanBlue',
  1493 + 'url': 'https://qn.colorcun.com/template/moluogelan-6.png',
  1494 + }
  1495 + ]
  1496 + };
  1497 +
  1498 + ThemeSunModel themeSunModel12 = ThemeSunModel.fromJson(jsonSun12);
  1499 + themesDatas.add(themeSunModel12);
  1500 + }
  1501 +
  1502 + _addModel7() {
  1503 + // //模版7
  1504 + Map<String, dynamic> jsonSun12 = {
  1505 + 'name': '7 无预订包间图片B',
  1506 + 'id': '7',
  1507 + 'colors': [
  1508 + {
  1509 + 'color_name': '黑蓝过渡',
  1510 + 'color_value_s': 'FF42A5FF',
  1511 + 'color_value_m': 'FF000000',
  1512 + 'color_value_e': 'FF42A5FF',
  1513 + 'lite_class': 'blackBlueGradient',
  1514 + 'url': 'https://qn.colorcun.com/template/heilanguodu-7.png'
  1515 + },
  1516 + {
  1517 + 'color_name': '石绿过渡',
  1518 + 'color_value_s': 'FF438E93',
  1519 + 'color_value_m': 'FF206864',
  1520 + 'color_value_e': 'FF42A5FF',
  1521 + 'lite_class': 'stoneGreenGradient',
  1522 + 'url': 'https://qn.colorcun.com/template/shilvguodu-7.png'
  1523 + },
  1524 + {
  1525 + 'color_name': '中国红过渡',
  1526 + 'color_value_s': 'FFAF231C',
  1527 + 'color_value_m': 'FF86201B',
  1528 + 'color_value_e': 'FFAF231C',
  1529 + 'lite_class': 'chinaRedGradient',
  1530 + 'url': 'https://qn.colorcun.com/template/zhongguohongguodu-7.png'
  1531 + },
  1532 + {
  1533 + 'color_name': '群青过渡',
  1534 + 'color_value_s': 'FF4C8DAD',
  1535 + 'color_value_m': 'FF0143A3',
  1536 + 'color_value_e': 'FF42A5FF',
  1537 + 'lite_class': 'ultramarineGradient',
  1538 + 'url': 'https://qn.colorcun.com/template/qunqingguodu-7.png'
  1539 + },
  1540 + {
  1541 + 'color_name': '深中国红',
  1542 + 'color_value_s': 'FF86201B',
  1543 + 'color_value_m': 'FF86201B',
  1544 + 'color_value_e': 'FF86201B',
  1545 + 'lite_class': 'crimson',
  1546 + 'url': 'https://qn.colorcun.com/template/shenzhongguohong-7.png'
  1547 + },
  1548 + {
  1549 + 'color_name': '中国红',
  1550 + 'color_value_s': 'FFAF231C',
  1551 + 'color_value_m': 'FFAF231C',
  1552 + 'color_value_e': 'FFAF231C',
  1553 + 'lite_class': 'chinaRed',
  1554 + 'url': 'https://qn.colorcun.com/template/zhongguohong-7.png'
  1555 + },
  1556 + {
  1557 + 'color_name': '蓝采和',
  1558 + 'color_value_s': 'FF06436F',
  1559 + 'color_value_m': 'FF06436F',
  1560 + 'color_value_e': 'FF06436F',
  1561 + 'lite_class': 'lanCaiHe',
  1562 + 'url': 'https://qn.colorcun.com/template/lancaihe-7.png'
  1563 + },
  1564 + {
  1565 + 'color_name': '石绿',
  1566 + 'color_value_s': 'FF206864',
  1567 + 'color_value_m': 'FF206864',
  1568 + 'color_value_e': 'FF206864',
  1569 + 'lite_class': 'stoneGreen',
  1570 + 'url': 'https://qn.colorcun.com/template/shilv-7.png'
  1571 + },
  1572 + {
  1573 + 'color_name': '姜黄',
  1574 + 'color_value_s': 'FFB39437',
  1575 + 'color_value_m': 'FFB39437',
  1576 + 'color_value_e': 'FFB39437',
  1577 + 'lite_class': 'turmeric',
  1578 + 'url': 'https://qn.colorcun.com/template/jianghuang-7.png',
  1579 + },
  1580 + {
  1581 + 'color_name': '苍黄',
  1582 + 'color_value_s': 'FFC85306',
  1583 + 'color_value_m': 'FFC85306',
  1584 + 'color_value_e': 'FFC85306',
  1585 + 'lite_class': 'greenishYellow',
  1586 + 'url': 'https://qn.colorcun.com/template/canghuang-7.png',
  1587 + },
  1588 + {
  1589 + 'color_name': '金黄',
  1590 + 'color_value_s': 'FFC67B3A',
  1591 + 'color_value_m': 'FFC67B3A',
  1592 + 'color_value_e': 'FFC67B3A',
  1593 + 'lite_class': 'golden',
  1594 + 'url': 'https://qn.colorcun.com/template/jinhuang-7.png',
  1595 + },
  1596 + {
  1597 + 'color_name': '群青',
  1598 + 'color_value_s': 'FF0143A3',
  1599 + 'color_value_m': 'FF0143A3',
  1600 + 'color_value_e': 'FF0143A3',
  1601 + 'lite_class': 'ultramarine',
  1602 + 'url': 'https://qn.colorcun.com/template/qunqing-7.png',
  1603 + },
  1604 + {
  1605 + 'color_name': '摩洛哥蓝',
  1606 + 'color_value_s': 'FF19516A',
  1607 + 'color_value_m': 'FF19516A',
  1608 + 'color_value_e': 'FF19516A',
  1609 + 'lite_class': 'moroccanBlue',
  1610 + 'url': 'https://qn.colorcun.com/template/moluogelan-7.png',
  1611 + }
  1612 + ]
  1613 + };
  1614 +
  1615 + ThemeSunModel themeSunModel12 = ThemeSunModel.fromJson(jsonSun12);
  1616 + themesDatas.add(themeSunModel12);
  1617 + }
  1618 +
  1619 + // _selectTheme(String id) {
  1620 + // List<ThemeSunModel> temp = [];
  1621 + // temp.addAll(themeModelCurrunt.urls);
  1622 + // temp.addAll(themesDatas);
  1623 + // List<String> tempUrls = temp.map((e) => e.url).toList();
  1624 +
  1625 + // // List<String> temp =
  1626 + // // themeModel.urls.map((e) => e.url).toList();
  1627 + // // print(temp);
  1628 +
  1629 + // // List<String> temp =
  1630 + // // themesDatas.map((e) => e.url).toList();
  1631 + // print(temp);
  1632 + // _showPhotoView(
  1633 + // context, temp.indexWhere((element) => element.id == id), tempUrls,
  1634 + // (index) {
  1635 + // //选中的index
  1636 + // themeType = temp[index].id; //当前选中模版的id
  1637 + // setState(() {});
  1638 + // });
  1639 + // }
  1640 +
977 _showPhotoView(BuildContext context, int index, List<String> imgs, 1641 _showPhotoView(BuildContext context, int index, List<String> imgs,
978 CustomCallBack callback, 1642 CustomCallBack callback,
979 {isShow = false, List dashName}) async { 1643 {isShow = false, List dashName}) async {
@@ -1047,75 +1711,13 @@ class _InvitationThemeHomePageState extends State<InvitationThemeHomePage> { @@ -1047,75 +1711,13 @@ class _InvitationThemeHomePageState extends State<InvitationThemeHomePage> {
1047 child: SingleChildScrollView( 1711 child: SingleChildScrollView(
1048 child: Column( 1712 child: Column(
1049 children: [ 1713 children: [
1050 - InkWell(  
1051 - onTap: () {  
1052 - List<ThemeModel> themeShow = [];  
1053 - themeDatas.forEach((key, value) {  
1054 - themeShow.add(value);  
1055 - });  
1056 - DialogUtil.showThemeColorSelectDialogNew(context, themeShow,  
1057 - callback: (object) {  
1058 - print(object);  
1059 - setState(() {  
1060 - themeColor = object;  
1061 - });  
1062 - });  
1063 - },  
1064 - child: Padding(  
1065 - padding: EdgeInsets.only(  
1066 - left: w(16), top: w(12), bottom: w(12), right: w(24)),  
1067 - child: Row(  
1068 - mainAxisAlignment: MainAxisAlignment.spaceBetween,  
1069 - children: [  
1070 - Text(  
1071 - '主题颜色选择',  
1072 - style: TextStyle(  
1073 - color: MyColours.color_515151,  
1074 - fontSize: font(16)),  
1075 - ),  
1076 - Spacer(),  
1077 - Text(  
1078 - themeDatas[themeColor].colorName,  
1079 - style: TextStyle(  
1080 - color: MyColours.color_515151,  
1081 - fontSize: font(16)),  
1082 - ),  
1083 - Container(  
1084 - padding: EdgeInsets.symmetric(  
1085 - horizontal: w(11), vertical: w(4)),  
1086 - child: Image.asset(  
1087 - "assets/arrow_right_new.png",  
1088 - width: w(9),  
1089 - height: w(16),  
1090 - ),  
1091 - )  
1092 - // RoundButton(  
1093 - // text: '预览',  
1094 - // gradientStart: MyColours.color_ffffff,  
1095 - // gradientEnd: MyColours.color_ffffff,  
1096 - // borderColor: MyColours.color_438E93,  
1097 - // textColor: MyColours.color_438E93,  
1098 - // radius: ScreenUtil().setWidth(22),  
1099 - // fontSize: 24,  
1100 - // width: w(72),  
1101 - // height: ScreenUtil().setWidth(44),  
1102 - // isBold: true,  
1103 - // onPressed: () {  
1104 - // NavigatorUtil.goMarkingPreviewPage(context);  
1105 - // },  
1106 - // ),  
1107 - ]))),  
1108 - Padding(  
1109 - padding: EdgeInsets.only(left: w(16)),  
1110 - child: MyDivider(double.infinity, w(0.5),  
1111 - color: MyColours.color_E7E7E7)),  
1112 VEmptyView(24), 1714 VEmptyView(24),
1113 GridView.builder( 1715 GridView.builder(
1114 padding: EdgeInsets.symmetric(horizontal: w(16)), 1716 padding: EdgeInsets.symmetric(horizontal: w(16)),
1115 controller: controller, 1717 controller: controller,
1116 // padding: EdgeInsets.only(top: ScreenUtil().getAdapterSize(10)), 1718 // padding: EdgeInsets.only(top: ScreenUtil().getAdapterSize(10)),
1117 shrinkWrap: true, 1719 shrinkWrap: true,
1118 - itemCount: themeDatas[themeColor].urls.length, 1720 + itemCount: themesDatas.length,
1119 //SliverGridDelegateWithFixedCrossAxisCount 构建一个横轴固定数量Widget 1721 //SliverGridDelegateWithFixedCrossAxisCount 构建一个横轴固定数量Widget
1120 gridDelegate: SliverGridDelegateWithFixedCrossAxisCount( 1722 gridDelegate: SliverGridDelegateWithFixedCrossAxisCount(
1121 //横轴元素个数 1723 //横轴元素个数
@@ -1128,28 +1730,40 @@ class _InvitationThemeHomePageState extends State<InvitationThemeHomePage> { @@ -1128,28 +1730,40 @@ class _InvitationThemeHomePageState extends State<InvitationThemeHomePage> {
1128 childAspectRatio: 1730 childAspectRatio:
1129 (ScreenUtil().screenWidth - w(62)) / 2 / 370), 1731 (ScreenUtil().screenWidth - w(62)) / 2 / 370),
1130 itemBuilder: (BuildContext context, int index) { 1732 itemBuilder: (BuildContext context, int index) {
1131 - themeModelCurrunt = themeDatas[themeColor]; 1733 + ThemeSunModel themeSunModel = themesDatas[index];
1132 return InkWell( 1734 return InkWell(
1133 onTap: () { 1735 onTap: () {
1134 - _selectTheme(themeDatas[themeColor].urls[index].id); 1736 + // _selectTheme(themeDatas[themeColor].urls[index].id);
  1737 + //跳转到下一页
  1738 + NavigatorUtil.goInvitationThemeHomePreviewPage(
  1739 + context, themeSunModel);
1135 }, 1740 },
1136 child: Container( 1741 child: Container(
1137 decoration: BoxDecoration( 1742 decoration: BoxDecoration(
1138 borderRadius: BorderRadius.circular(r(10)), 1743 borderRadius: BorderRadius.circular(r(10)),
1139 border: Border.all( 1744 border: Border.all(
1140 - color: themeType ==  
1141 - themeModelCurrunt.urls[index].id 1745 + color: themeType == themeSunModel.id
1142 ? MyColours.color_005AA7 1746 ? MyColours.color_005AA7
1143 : MyColours.color_DBDBDB, 1747 : MyColours.color_DBDBDB,
1144 - width: themeType ==  
1145 - themeModelCurrunt.urls[index].id 1748 + width: themeType == themeSunModel.id
1146 ? w(2) 1749 ? w(2)
1147 : w(1))), 1750 : w(1))),
1148 child: Column( 1751 child: Column(
1149 children: [ 1752 children: [
1150 VEmptyView(10), 1753 VEmptyView(10),
1151 CachedNetworkImage( 1754 CachedNetworkImage(
1152 - imageUrl: themeModelCurrunt.urls[index].url, 1755 + imageUrl: themeSunModel.colors == null ||
  1756 + themeSunModel.colors.length == 0
  1757 + ? themeSunModel.url
  1758 + : themeSunModel
  1759 + .colors[themeColor == null
  1760 + ? 0
  1761 + : themeSunModel.colors.indexWhere(
  1762 + (element) =>
  1763 + element.colorName ==
  1764 + themeSunModel
  1765 + .themeColorDefault)]
  1766 + .url,
1153 width: (ScreenUtil().screenWidth - w(62)) / 2, 1767 width: (ScreenUtil().screenWidth - w(62)) / 2,
1154 height: w(348), 1768 height: w(348),
1155 fit: BoxFit.fitWidth, 1769 fit: BoxFit.fitWidth,
@@ -1161,7 +1775,7 @@ class _InvitationThemeHomePageState extends State<InvitationThemeHomePage> { @@ -1161,7 +1775,7 @@ class _InvitationThemeHomePageState extends State<InvitationThemeHomePage> {
1161 vertical: w(6), horizontal: w(2)), 1775 vertical: w(6), horizontal: w(2)),
1162 width: double.infinity, 1776 width: double.infinity,
1163 child: Text( 1777 child: Text(
1164 - themeModelCurrunt.urls[index].name, 1778 + themeSunModel.name,
1165 maxLines: 1, 1779 maxLines: 1,
1166 overflow: TextOverflow.ellipsis, 1780 overflow: TextOverflow.ellipsis,
1167 textAlign: TextAlign.left, 1781 textAlign: TextAlign.left,
@@ -1174,143 +1788,6 @@ class _InvitationThemeHomePageState extends State<InvitationThemeHomePage> { @@ -1174,143 +1788,6 @@ class _InvitationThemeHomePageState extends State<InvitationThemeHomePage> {
1174 ), 1788 ),
1175 )); 1789 ));
1176 }), 1790 }),
1177 - InkWell(  
1178 - onTap: () {  
1179 - List<ThemeModel> themeShow = [];  
1180 - themeDatas.forEach((key, value) {  
1181 - themeShow.add(value);  
1182 - });  
1183 - DialogUtil.showThemeColorSelectDialogNew(context, themeShow,  
1184 - callback: (object) {  
1185 - print(object);  
1186 - setState(() {  
1187 - themeColor = object;  
1188 - });  
1189 - });  
1190 - },  
1191 - child: Padding(  
1192 - padding: EdgeInsets.only(  
1193 - left: w(16), top: w(12), bottom: w(12), right: w(24)),  
1194 - child: Row(  
1195 - mainAxisAlignment: MainAxisAlignment.spaceBetween,  
1196 - children: [  
1197 - Text(  
1198 - '无配色主题',  
1199 - style: TextStyle(  
1200 - color: MyColours.color_515151,  
1201 - fontSize: font(16)),  
1202 - ),  
1203 - // Spacer(),  
1204 - // Text(  
1205 - // themeDatas[themeColor].colorName,  
1206 - // style: TextStyle(  
1207 - // color: MyColours.color_515151,  
1208 - // fontSize: font(16)),  
1209 - // ),  
1210 - // Container(  
1211 - // padding: EdgeInsets.symmetric(  
1212 - // horizontal: w(11), vertical: w(4)),  
1213 - // child: Image.asset(  
1214 - // "assets/arrow_right_new.png",  
1215 - // width: w(9),  
1216 - // height: w(16),  
1217 - // ),  
1218 - // )  
1219 - // RoundButton(  
1220 - // text: '预览',  
1221 - // gradientStart: MyColours.color_ffffff,  
1222 - // gradientEnd: MyColours.color_ffffff,  
1223 - // borderColor: MyColours.color_438E93,  
1224 - // textColor: MyColours.color_438E93,  
1225 - // radius: ScreenUtil().setWidth(22),  
1226 - // fontSize: 24,  
1227 - // width: w(72),  
1228 - // height: ScreenUtil().setWidth(44),  
1229 - // isBold: true,  
1230 - // onPressed: () {  
1231 - // NavigatorUtil.goMarkingPreviewPage(context);  
1232 - // },  
1233 - // ),  
1234 - ]))),  
1235 - Padding(  
1236 - padding: EdgeInsets.only(left: w(16)),  
1237 - child: MyDivider(double.infinity, w(0.5),  
1238 - color: MyColours.color_E7E7E7)),  
1239 - VEmptyView(24),  
1240 - GridView.builder(  
1241 - padding: EdgeInsets.symmetric(horizontal: w(16)),  
1242 - controller: controller,  
1243 - // padding: EdgeInsets.only(top: ScreenUtil().getAdapterSize(10)),  
1244 - shrinkWrap: true,  
1245 - itemCount: themeDatasno.length,  
1246 - //SliverGridDelegateWithFixedCrossAxisCount 构建一个横轴固定数量Widget  
1247 - gridDelegate: SliverGridDelegateWithFixedCrossAxisCount(  
1248 - //横轴元素个数  
1249 - crossAxisCount: 2,  
1250 - //纵轴间距  
1251 - mainAxisSpacing: w(15),  
1252 - //横轴间距  
1253 - crossAxisSpacing: w(15),  
1254 - //子组件宽高长度比例  
1255 - childAspectRatio:  
1256 - (ScreenUtil().screenWidth - w(62)) / 2 / 370),  
1257 - itemBuilder: (BuildContext context, int index) {  
1258 - ThemeSunModel themeModel = themeDatasno[index];  
1259 - return InkWell(  
1260 - // onTap: () {  
1261 - // List<String> temp =  
1262 - // themeDatasno.map((e) => e.url).toList();  
1263 - // print(temp);  
1264 - // _showPhotoView(context, index,  
1265 - // themeDatasno.map((e) => e.url).toList(), (index) {  
1266 - // //  
1267 - // themeType = themeDatasno[index].id;  
1268 - // setState(() {});  
1269 - // });  
1270 - // },  
1271 - onTap: () {  
1272 - _selectTheme(themeModel.id);  
1273 - },  
1274 - child: Container(  
1275 - decoration: BoxDecoration(  
1276 - borderRadius: BorderRadius.circular(r(10)),  
1277 - border: Border.all(  
1278 - color: themeType == themeDatasno[index].id  
1279 - ? MyColours.color_005AA7  
1280 - : MyColours.color_DBDBDB,  
1281 - width: themeType == themeDatasno[index].id  
1282 - ? w(2)  
1283 - : w(1))),  
1284 - child: Column(  
1285 - children: [  
1286 - VEmptyView(10),  
1287 - CachedNetworkImage(  
1288 - imageUrl: themeModel.url,  
1289 - width: (ScreenUtil().screenWidth - w(62)) / 2,  
1290 - height: w(348),  
1291 - fit: BoxFit.fitWidth,  
1292 - alignment: Alignment.topCenter,  
1293 - ),  
1294 - VEmptyView(20),  
1295 - Container(  
1296 - padding: EdgeInsets.symmetric(  
1297 - vertical: w(6), horizontal: w(2)),  
1298 - width: double.infinity,  
1299 - child: Text(  
1300 - themeModel.name,  
1301 - maxLines: 1,  
1302 - overflow: TextOverflow.ellipsis,  
1303 - textAlign: TextAlign.left,  
1304 - style: TextStyle(  
1305 - color: MyColours.color_000000,  
1306 - fontSize: font(14)),  
1307 - ),  
1308 - ),  
1309 - ],  
1310 - ),  
1311 - ));  
1312 - }),  
1313 - VEmptyView(20)  
1314 ], 1791 ],
1315 ))) 1792 )))
1316 ], 1793 ],
  1 +import 'package:cached_network_image/cached_network_image.dart';
  2 +import 'package:flutter/material.dart';
  3 +import 'package:flutter_screenutil/flutter_screenutil.dart';
  4 +import 'package:one_key/pages/my/marketing_center/theme_model.dart';
  5 +import 'package:one_key/widgets/system_app_bar.dart';
  6 +import 'package:one_key/widgets/v_empty_view.dart';
  7 +
  8 +import '../../../res/colors.dart';
  9 +import '../../../utils/dialog_util.dart';
  10 +import '../../../utils/event_bus.dart';
  11 +import '../../../utils/screen_util.dart';
  12 +import '../../../utils/utils.dart';
  13 +import '../../../widgets/MyDivider.dart';
  14 +import '../../../widgets/round_button.dart';
  15 +import '../../online_check/photo_view_wiget.dart';
  16 +
  17 +import 'dart:convert' as convert;
  18 +
  19 +/**
  20 + *
  21 + * 邀请函主题选择页面预览
  22 + */
  23 +
  24 +class InvitationThemeHomePreviewPage extends StatefulWidget {
  25 + final ThemeSunModel themeSunModel;
  26 + InvitationThemeHomePreviewPage({Key key, this.themeSunModel})
  27 + : super(key: key);
  28 +
  29 + @override
  30 + _InvitationThemeHomePreviewPageState createState() =>
  31 + _InvitationThemeHomePreviewPageState();
  32 +}
  33 +
  34 +class _InvitationThemeHomePreviewPageState
  35 + extends State<InvitationThemeHomePreviewPage> {
  36 + ScrollController controller = ScrollController();
  37 +
  38 + //当前店铺选中的颜色和板式
  39 +
  40 + String themeColor;
  41 + String themeType; //模版类型
  42 + String url;
  43 +
  44 + ThemeModel themeModelCurrunt; //有配色对应的当前页面模版数据
  45 +
  46 + @override
  47 + void initState() {
  48 + super.initState();
  49 + if (widget.themeSunModel.colors.length > 0) {
  50 + themeColor = widget.themeSunModel.colors[0].colorName;
  51 + url = widget.themeSunModel.colors[0].url;
  52 + } else {
  53 + url = widget.themeSunModel.url;
  54 + }
  55 +
  56 + themeType = widget.themeSunModel.id;
  57 + }
  58 +
  59 + // _selectTheme(String id) {
  60 + // List<ThemeSunModel> temp = [];
  61 + // temp.addAll(themeModelCurrunt.urls);
  62 + // temp.addAll(themeDatasno);
  63 + // List<String> tempUrls = temp.map((e) => e.url).toList();
  64 +
  65 + // // List<String> temp =
  66 + // // themeModel.urls.map((e) => e.url).toList();
  67 + // // print(temp);
  68 +
  69 + // // List<String> temp =
  70 + // // themeDatasno.map((e) => e.url).toList();
  71 + // print(temp);
  72 + // _showPhotoView(
  73 + // context, temp.indexWhere((element) => element.id == id), tempUrls,
  74 + // (index) {
  75 + // //选中的index
  76 + // themeType = temp[index].id; //当前选中模版的id
  77 + // setState(() {});
  78 + // });
  79 + // }
  80 +
  81 + _showPhotoView(BuildContext context, int index, List<String> imgs,
  82 + {isShow = false, List dashName}) async {
  83 + // if (imgs.length == 1 &&
  84 + // imgs[0] ==
  85 + // 'http://nosqn.colorcun.com/custom/lite-online/image/def-banner.png') {
  86 + // imgs[0] = 'http://nosqn.colorcun.com/app/seller-hj-empty.png';
  87 + // }
  88 + Utils.setBarStatus(false, color: Colors.black);
  89 + dynamic result = await showGeneralDialog(
  90 + context: context,
  91 + barrierDismissible: false,
  92 + // barrierColor: Colors.red,
  93 + barrierLabel:
  94 + MaterialLocalizations.of(context).modalBarrierDismissLabel,
  95 + transitionDuration: const Duration(milliseconds: 150),
  96 + pageBuilder: (BuildContext context, Animation animation,
  97 + Animation secondaryAnimation) {
  98 + Widget child = Stack(
  99 + alignment: Alignment.bottomCenter,
  100 + children: <Widget>[
  101 + PhotoPreview(
  102 + initialIndex: index,
  103 + photoList: imgs,
  104 + isShow: isShow,
  105 + dashName: dashName,
  106 + needMask: false,
  107 + needTap: false,
  108 + callback: (curruntIndex) {
  109 + //选中某个模版
  110 + // callback(curruntIndex);
  111 + },
  112 + ),
  113 + // Positioned(
  114 + // bottom: w(20),
  115 + // child: InkWell(
  116 + // onTap: () {
  117 + // callback(index);
  118 + // },
  119 + // child: Container(
  120 + // padding: EdgeInsets.symmetric(
  121 + // horizontal: w(30), vertical: w(10)),
  122 + // decoration: BoxDecoration(
  123 + // color: MyColours.color_ffffff,
  124 + // borderRadius: BorderRadius.circular(r(30)),
  125 + // ),
  126 + // child: Text(
  127 + // '应用',
  128 + // style: TextStyle(
  129 + // decoration: TextDecoration.none,
  130 + // color: MyColours.color_515151,
  131 + // fontSize: font(16)),
  132 + // ),
  133 + // ),
  134 + // ))
  135 + ],
  136 + );
  137 + return Material(child: child);
  138 + });
  139 + Utils.setBarStatus(true, color: Colors.white);
  140 + }
  141 +
  142 + @override
  143 + Widget build(BuildContext context) {
  144 + return Scaffold(
  145 + backgroundColor: MyColours.color_ffffff,
  146 + appBar: SystemAppBar('客户通知设置'),
  147 + body: Column(
  148 + children: [
  149 + Expanded(
  150 + child: SingleChildScrollView(
  151 + child: Column(
  152 + children: [
  153 + if (themeColor != null)
  154 + InkWell(
  155 + onTap: () {
  156 + DialogUtil.showThemeColorSelectDialogNew(
  157 + context, widget.themeSunModel.colors,
  158 + callback: (object) {
  159 + print(object);
  160 + setState(() {
  161 + themeColor = object;
  162 + url = widget
  163 + .themeSunModel
  164 + .colors[widget.themeSunModel.colors.indexWhere(
  165 + (element) => element.colorName == object)]
  166 + .url;
  167 + });
  168 + });
  169 + },
  170 + child: Padding(
  171 + padding: EdgeInsets.only(
  172 + left: w(16),
  173 + top: w(12),
  174 + bottom: w(12),
  175 + right: w(24)),
  176 + child: Row(
  177 + mainAxisAlignment: MainAxisAlignment.spaceBetween,
  178 + children: [
  179 + Text(
  180 + '主题颜色选择',
  181 + style: TextStyle(
  182 + color: MyColours.color_515151,
  183 + fontSize: font(16)),
  184 + ),
  185 + Spacer(),
  186 + Text(
  187 + themeColor,
  188 + style: TextStyle(
  189 + color: MyColours.color_515151,
  190 + fontSize: font(16)),
  191 + ),
  192 + Container(
  193 + padding: EdgeInsets.symmetric(
  194 + horizontal: w(11), vertical: w(4)),
  195 + child: Image.asset(
  196 + "assets/arrow_right_new.png",
  197 + width: w(9),
  198 + height: w(16),
  199 + ),
  200 + )
  201 + // RoundButton(
  202 + // text: '预览',
  203 + // gradientStart: MyColours.color_ffffff,
  204 + // gradientEnd: MyColours.color_ffffff,
  205 + // borderColor: MyColours.color_438E93,
  206 + // textColor: MyColours.color_438E93,
  207 + // radius: ScreenUtil().setWidth(22),
  208 + // fontSize: 24,
  209 + // width: w(72),
  210 + // height: ScreenUtil().setWidth(44),
  211 + // isBold: true,
  212 + // onPressed: () {
  213 + // NavigatorUtil.goMarkingPreviewPage(context);
  214 + // },
  215 + // ),
  216 + ]))),
  217 + if (themeColor != null)
  218 + Padding(
  219 + padding: EdgeInsets.only(left: w(16)),
  220 + child: MyDivider(double.infinity, w(0.5),
  221 + color: MyColours.color_E7E7E7)),
  222 + VEmptyView(24),
  223 + Container(
  224 + width: double.infinity,
  225 + alignment: Alignment.centerLeft,
  226 + padding: EdgeInsets.only(
  227 + left: w(16), top: w(12), bottom: w(12), right: w(16)),
  228 + child: Text(
  229 + '效果预览',
  230 + style: TextStyle(
  231 + color: MyColours.color_515151, fontSize: font(16)),
  232 + )),
  233 + VEmptyView(24),
  234 + InkWell(
  235 + onTap: () {
  236 + _showPhotoView(context, 0, [url]);
  237 + },
  238 + child: CachedNetworkImage(
  239 + imageUrl: url,
  240 + width: ScreenUtil().screenWidth - w(32),
  241 + fit: BoxFit.fitWidth,
  242 + alignment: Alignment.topCenter,
  243 + )),
  244 + ],
  245 + ))),
  246 + Container(
  247 + padding: EdgeInsets.only(
  248 + top: w(12), bottom: w(25), left: w(45), right: w(45)),
  249 + child: RoundButton(
  250 + onPressed: () {
  251 + //选择当前模版+主题色
  252 + bus.emit('theme_color_type', {
  253 + 'themeColor': themeColor,
  254 + 'themeType': themeType,
  255 + });
  256 + Navigator.pop(context);
  257 + },
  258 + text: '确定',
  259 + fontSize: 32,
  260 + isBold: true,
  261 + textColor: MyColours.color_F8F9FD,
  262 + height: ScreenUtil().setWidth(43 * 2),
  263 + // width: ScreenUtil().setWidth(130 * 2),
  264 + radius: ScreenUtil().setWidth(10),
  265 + )),
  266 + ],
  267 + ),
  268 + );
  269 + }
  270 +}
@@ -5,7 +5,8 @@ class ThemeModel { @@ -5,7 +5,8 @@ class ThemeModel {
5 String colorValueS; //渐变色起始值 5 String colorValueS; //渐变色起始值
6 String colorValueM; //渐变色中间值 6 String colorValueM; //渐变色中间值
7 String colorValueE; //渐变色结束值 7 String colorValueE; //渐变色结束值
8 - List<ThemeSunModel> urls; //当前色值下的模版链接集合 8 + String liteClass; //小程序classname
  9 + String url; //当前配色对应的图片
9 10
10 ThemeModel(); 11 ThemeModel();
11 12
@@ -14,16 +15,8 @@ class ThemeModel { @@ -14,16 +15,8 @@ class ThemeModel {
14 colorValueS = json['color_value_s']; 15 colorValueS = json['color_value_s'];
15 colorValueM = json['color_value_m']; 16 colorValueM = json['color_value_m'];
16 colorValueE = json['color_value_e']; 17 colorValueE = json['color_value_e'];
17 - urls = <ThemeSunModel>[];  
18 - if (json['urls'] != null) {  
19 - json['urls'].forEach((v) {  
20 - if (v is ThemeSunModel) {  
21 - urls.add(v);  
22 - } else {  
23 - urls.add(new ThemeSunModel.fromJson(v));  
24 - }  
25 - });  
26 - } 18 + liteClass = json['lite_class'];
  19 + url = json['url'];
27 } 20 }
28 21
29 Map<String, dynamic> toJson() => <String, dynamic>{ 22 Map<String, dynamic> toJson() => <String, dynamic>{
@@ -31,25 +24,41 @@ class ThemeModel { @@ -31,25 +24,41 @@ class ThemeModel {
31 "color_value_s": colorValueS, 24 "color_value_s": colorValueS,
32 "color_value_m": colorValueM, 25 "color_value_m": colorValueM,
33 "color_value_e": colorValueE, 26 "color_value_e": colorValueE,
34 - 'urls': urls 27 + 'lite_class': liteClass,
  28 + 'url': url
35 }; 29 };
36 } 30 }
37 31
38 class ThemeSunModel { 32 class ThemeSunModel {
39 String name; //模版名称 33 String name; //模版名称
40 String id; //模版编号 34 String id; //模版编号
41 - String url; //当前色值下的模版链接 35 + String url; //模版示意图
  36 + List<ThemeModel> colors; //当前模版的可用色值
  37 + String themeColorDefault; //模版默认主题色
42 38
43 ThemeSunModel(); 39 ThemeSunModel();
44 40
45 - factory ThemeSunModel.fromJson(Map<String, dynamic> json) => ThemeSunModel()  
46 - ..name = json["name"]  
47 - ..id = json["id"]  
48 - ..url = json["url"]; 41 + ThemeSunModel.fromJson(Map<String, dynamic> json) {
  42 + name = json["name"];
  43 + id = json["id"];
49 44
50 - Map<String, dynamic> toJson() => <String, dynamic>{  
51 - "name": name,  
52 - "id": id,  
53 - "url": url,  
54 - }; 45 + url = json['url'];
  46 +
  47 + colors = <ThemeModel>[];
  48 + if (json['colors'] != null) {
  49 + json['colors'].forEach((v) {
  50 + if (v is ThemeModel) {
  51 + colors.add(v);
  52 + } else {
  53 + colors.add(new ThemeModel.fromJson(v));
  54 + }
  55 + });
  56 + }
  57 + if (colors.length > 0) {
  58 + themeColorDefault = colors[0].colorName;
  59 + }
  60 + }
  61 +
  62 + Map<String, dynamic> toJson() =>
  63 + <String, dynamic>{"name": name, "id": id, "colors": colors, 'url': url};
55 } 64 }
@@ -22,6 +22,7 @@ class MarketingCenterProvider extends ChangeNotifier { @@ -22,6 +22,7 @@ class MarketingCenterProvider extends ChangeNotifier {
22 22
23 PageState pageState = PageState.Loading; 23 PageState pageState = PageState.Loading;
24 PageState pageStateRechargeHome = PageState.Loading; 24 PageState pageStateRechargeHome = PageState.Loading;
  25 + PageState pageStateBookInfo = PageState.Loading;
25 26
26 List<RechargeListSunModel> rechargeList = []; 27 List<RechargeListSunModel> rechargeList = [];
27 28
@@ -41,6 +41,7 @@ import '../models/setmeal_by_id_model.dart'; @@ -41,6 +41,7 @@ import '../models/setmeal_by_id_model.dart';
41 import '../models/setmeal_model.dart'; 41 import '../models/setmeal_model.dart';
42 import '../models/wine_manage_model.dart'; 42 import '../models/wine_manage_model.dart';
43 import '../models/wine_model.dart'; 43 import '../models/wine_model.dart';
  44 +import '../pages/my/marketing_center/theme_model.dart';
44 45
45 class NavigatorUtil { 46 class NavigatorUtil {
46 static Future _navigateTo(BuildContext context, String path, 47 static Future _navigateTo(BuildContext context, String path,
@@ -1836,4 +1837,15 @@ class NavigatorUtil { @@ -1836,4 +1837,15 @@ class NavigatorUtil {
1836 return _navigateTo(context, "${Routes.invitation_theme_home_page}", 1837 return _navigateTo(context, "${Routes.invitation_theme_home_page}",
1837 replace: replace); 1838 replace: replace);
1838 } 1839 }
  1840 +
  1841 + /// 邀请函主题选择预览
  1842 + static Future<dynamic> goInvitationThemeHomePreviewPage(
  1843 + BuildContext context,
  1844 + ThemeSunModel themeSunModel, {
  1845 + replace = false,
  1846 + }) {
  1847 + return _navigateTo(context,
  1848 + "${Routes.invitation_theme_home_preview_page}?themeSunModel=${FluroConvertUtils.object2string(themeSunModel)}",
  1849 + replace: replace);
  1850 + }
1839 } 1851 }
@@ -211,6 +211,7 @@ import '../pages/my/marketing_center/book_notification/store_introduce_page.dart @@ -211,6 +211,7 @@ import '../pages/my/marketing_center/book_notification/store_introduce_page.dart
211 import '../pages/my/marketing_center/comments_setting_page.dart'; 211 import '../pages/my/marketing_center/comments_setting_page.dart';
212 import '../pages/my/marketing_center/customer_notice_setting_page.dart'; 212 import '../pages/my/marketing_center/customer_notice_setting_page.dart';
213 import '../pages/my/marketing_center/invitation_theme_home_page.dart'; 213 import '../pages/my/marketing_center/invitation_theme_home_page.dart';
  214 +import '../pages/my/marketing_center/invitation_theme_home_preview_page.dart';
214 import '../pages/my/marketing_center/marketing_center_home_page.dart'; 215 import '../pages/my/marketing_center/marketing_center_home_page.dart';
215 import '../pages/my/marketing_center/order_setting_manager_page.dart'; 216 import '../pages/my/marketing_center/order_setting_manager_page.dart';
216 import '../pages/my/marketing_center/order_setting_page.dart'; 217 import '../pages/my/marketing_center/order_setting_page.dart';
@@ -220,6 +221,7 @@ import '../pages/my/marketing_center/recharge/recharge_history_page.dart'; @@ -220,6 +221,7 @@ import '../pages/my/marketing_center/recharge/recharge_history_page.dart';
220 import '../pages/my/marketing_center/recharge/recharge_home_page.dart'; 221 import '../pages/my/marketing_center/recharge/recharge_home_page.dart';
221 import '../pages/my/marketing_center/recharge/recharge_select_store_coupon_page.dart'; 222 import '../pages/my/marketing_center/recharge/recharge_select_store_coupon_page.dart';
222 import '../pages/my/marketing_center/recharge/recharge_setting_page.dart'; 223 import '../pages/my/marketing_center/recharge/recharge_setting_page.dart';
  224 +import '../pages/my/marketing_center/theme_model.dart';
223 import '../pages/my/menu_type/menu_add_dishes_page.dart'; 225 import '../pages/my/menu_type/menu_add_dishes_page.dart';
224 // import '../pages/my/menu_type/menu_add_dishes_page_new.dart'; 226 // import '../pages/my/menu_type/menu_add_dishes_page_new.dart';
225 import '../pages/my/menu_type/menu_dish_method_page.dart'; 227 import '../pages/my/menu_type/menu_dish_method_page.dart';
@@ -3112,3 +3114,19 @@ var invitationThemeHomePageHandle = new Handler( @@ -3112,3 +3114,19 @@ var invitationThemeHomePageHandle = new Handler(
3112 create: (_) => MarketingCenterProvider(), 3114 create: (_) => MarketingCenterProvider(),
3113 child: InvitationThemeHomePage()); 3115 child: InvitationThemeHomePage());
3114 }); 3116 });
  3117 +
  3118 +//邀请函主题选择预览
  3119 +var invitationThemeHomePreviewPage = new Handler(
  3120 + handlerFunc: (BuildContext context, Map<String, List<Object>> params) {
  3121 + // String year = params["year"].first;
  3122 + // String month = params["month"].first;
  3123 + // String day = params["day"].first;
  3124 + // String uid = params["uid"].first;
  3125 +
  3126 + ThemeSunModel themeSunModel = ThemeSunModel.fromJson(json
  3127 + .decode(FluroConvertUtils.fluroCnParamsDecode(params["themeSunModel"].first)));
  3128 +
  3129 + return ChangeNotifierProvider<MarketingCenterProvider>(
  3130 + create: (_) => MarketingCenterProvider(),
  3131 + child: InvitationThemeHomePreviewPage(themeSunModel:themeSunModel));
  3132 +});
@@ -293,8 +293,11 @@ class Routes { @@ -293,8 +293,11 @@ class Routes {
293 293
294 static String collect_store_info_page = "/collect_store_info_page"; // 店铺信息收集 294 static String collect_store_info_page = "/collect_store_info_page"; // 店铺信息收集
295 295
296 - static String invitation_theme_home_page = "/invitation_theme_home_page"; //邀请函主题选择  
297 - 296 + static String invitation_theme_home_page =
  297 + "/invitation_theme_home_page"; //邀请函主题选择
  298 +
  299 + static String invitation_theme_home_preview_page =
  300 + "/invitation_theme_home_preview_page"; //邀请函主题选择预览页
298 301
299 static void configureRoutes(FluroRouter router) { 302 static void configureRoutes(FluroRouter router) {
300 router.notFoundHandler = new Handler( 303 router.notFoundHandler = new Handler(
@@ -550,13 +553,11 @@ class Routes { @@ -550,13 +553,11 @@ class Routes {
550 553
551 router.define(collect_store_info_page, handler: collectStoreInfoPageHandle); 554 router.define(collect_store_info_page, handler: collectStoreInfoPageHandle);
552 555
  556 + router.define(invitation_theme_home_page,
  557 + handler: invitationThemeHomePageHandle);
553 558
554 -router.define(invitation_theme_home_page, handler:invitationThemeHomePageHandle);  
555 -  
556 -  
557 -  
558 -  
559 -  
560 - 559 + router.define(invitation_theme_home_preview_page,
  560 + handler: invitationThemeHomePreviewPage);
  561 +
561 } 562 }
562 } 563 }