Commit 41c53bf0de66790a87f730266bc1277fdff93d0b

Authored by wdn127929
1 parent cdb61cc6

模版选择OK

@@ -22,6 +22,9 @@ class MarkDataModel extends Object { @@ -22,6 +22,9 @@ class MarkDataModel extends Object {
22 MarkMarketingModel marketing; 22 MarkMarketingModel marketing;
23 String isNewTemplate; 23 String isNewTemplate;
24 24
  25 + String type;
  26 + String liteClass;
  27 +
25 MarkDataModel(this.id, this.sid, this.home, this.reserve, this.store, 28 MarkDataModel(this.id, this.sid, this.home, this.reserve, this.store,
26 this.chef, this.signboard, this.marketing, this.isNewTemplate); 29 this.chef, this.signboard, this.marketing, this.isNewTemplate);
27 30
@@ -52,7 +55,9 @@ class MarkDataModel extends Object { @@ -52,7 +55,9 @@ class MarkDataModel extends Object {
52 ? new MarkMarketingModel.fromJson(convert.jsonDecode(json['marketing'])) 55 ? new MarkMarketingModel.fromJson(convert.jsonDecode(json['marketing']))
53 : null; // 56 : null; //
54 57
55 - isNewTemplate = json['is_new_template'] ?? "0"; 58 + isNewTemplate = json['is_new_template'] ?? '';
  59 + type = json['type'] ?? '';
  60 + liteClass = json['lite_class'] ?? '';
56 } 61 }
57 62
58 Map<String, dynamic> toJson() { 63 Map<String, dynamic> toJson() {
@@ -67,6 +72,8 @@ class MarkDataModel extends Object { @@ -67,6 +72,8 @@ class MarkDataModel extends Object {
67 data['signboard'] = this.signboard; 72 data['signboard'] = this.signboard;
68 data['marketing'] = this.marketing; 73 data['marketing'] = this.marketing;
69 data['is_new_template'] = this.isNewTemplate; 74 data['is_new_template'] = this.isNewTemplate;
  75 + data['type'] = this.type;
  76 + data['lite_class'] = this.liteClass;
70 return data; 77 return data;
71 } 78 }
72 } 79 }
  1 +import 'dart:convert';
  2 +
  3 +class SellerTemplateColorListModel {
  4 + int ret;
  5 + List<SellerTemplateColorListSunModel> data;
  6 + String msg;
  7 +
  8 + SellerTemplateColorListModel({this.ret, this.data, this.msg});
  9 +
  10 + SellerTemplateColorListModel.fromJson(Map<String, dynamic> json) {
  11 + ret = json['ret'];
  12 + if (json['data'] != null) {
  13 + data = <SellerTemplateColorListSunModel>[];
  14 + json['data'].forEach((v) {
  15 + data.add(new SellerTemplateColorListSunModel.fromJson(v));
  16 + });
  17 + }
  18 + msg = json['msg'];
  19 + }
  20 +
  21 + Map<String, dynamic> toJson() {
  22 + final Map<String, dynamic> data = new Map<String, dynamic>();
  23 + data['ret'] = this.ret;
  24 + if (this.data != null) {
  25 + data['data'] = this.data.map((v) => v.toJson()).toList();
  26 + }
  27 + data['msg'] = this.msg;
  28 + return data;
  29 + }
  30 +}
  31 +
  32 +class SellerTemplateColorListSunModel {
  33 + String id;
  34 + String templateName;
  35 + List<ColorListModel> colors;
  36 + String url;
  37 + String themeColorDefault; //模版默认主题色
  38 +
  39 + SellerTemplateColorListSunModel(
  40 + {this.id, this.templateName, this.colors, this.url});
  41 +
  42 + SellerTemplateColorListSunModel.fromJson(Map<String, dynamic> json) {
  43 + id = json['id'];
  44 + templateName = json['template_name'];
  45 + colors = <ColorListModel>[];
  46 + if (json['colors'] != null &&
  47 + json['colors'] != '[]' &&
  48 + json['colors'] != '') {
  49 + if (json['colors'] is String) {
  50 + jsonDecode(json['colors']).forEach((v) {
  51 + colors.add(new ColorListModel.fromJson(v));
  52 + });
  53 + } else {
  54 + json['colors'].forEach((v) {
  55 + colors.add(new ColorListModel.fromJson(v));
  56 + });
  57 + }
  58 + }
  59 + if (json['theme_color_default'] != null) {
  60 + themeColorDefault = json['theme_color_default'];
  61 + } else {
  62 + if (colors.length > 0) {
  63 + themeColorDefault = colors[0].colorName;
  64 + }
  65 + }
  66 +
  67 + url = json['url'];
  68 + }
  69 +
  70 + Map<String, dynamic> toJson() {
  71 + final Map<String, dynamic> data = new Map<String, dynamic>();
  72 + data['id'] = this.id;
  73 + data['template_name'] = this.templateName;
  74 + data['colors'] = this.colors;
  75 +
  76 + data['url'] = this.url;
  77 + data['theme_color_default'] = this.themeColorDefault;
  78 + return data;
  79 + }
  80 +}
  81 +
  82 +class ColorListModel {
  83 + String colorName;
  84 + String colorValueS;
  85 + String colorValueM;
  86 + String colorValueE;
  87 + String liteClass;
  88 + String url;
  89 +
  90 + ColorListModel(
  91 + {this.colorName,
  92 + this.colorValueS,
  93 + this.colorValueM,
  94 + this.colorValueE,
  95 + this.liteClass,
  96 + this.url});
  97 +
  98 + ColorListModel.fromJson(Map<String, dynamic> json) {
  99 + colorName = json['color_name'];
  100 + colorValueS = json['color_value_s'];
  101 + colorValueM = json['color_value_m'];
  102 + colorValueE = json['color_value_e'];
  103 + liteClass = json['lite_class'];
  104 + url = json['url'];
  105 + }
  106 +
  107 + Map<String, dynamic> toJson() {
  108 + final Map<String, dynamic> data = new Map<String, dynamic>();
  109 + data['color_name'] = this.colorName;
  110 + data['color_value_s'] = this.colorValueS;
  111 + data['color_value_m'] = this.colorValueM;
  112 + data['color_value_e'] = this.colorValueE;
  113 + data['lite_class'] = this.liteClass;
  114 + data['url'] = this.url;
  115 + return data;
  116 + }
  117 +}
@@ -465,9 +465,10 @@ class HttpUrl { @@ -465,9 +465,10 @@ class HttpUrl {
465 static const String set_seller_collect = 465 static const String set_seller_collect =
466 "?service=App.SellerVersion.SetSellerCollect"; // 收集店铺信息 466 "?service=App.SellerVersion.SetSellerCollect"; // 收集店铺信息
467 467
468 -  
469 - static const String get_seller_version = 468 + static const String get_seller_version =
470 "?service=App.SellerVersion.GetSellerVersion"; // 获取商家的版本信息 469 "?service=App.SellerVersion.GetSellerVersion"; // 获取商家的版本信息
471 - 470 +
  471 + static const String get_seller_template_color_list =
  472 + "?service=App.Seller.GetSellerTemplateColorList"; // 模板/颜色配置信息
472 473
473 } 474 }
1 import 'package:flutter/material.dart'; 1 import 'package:flutter/material.dart';
  2 +import 'package:one_key/models/seller_template_color_list_model.dart';
2 import 'package:one_key/widgets/system_app_bar.dart'; 3 import 'package:one_key/widgets/system_app_bar.dart';
3 import 'package:provider/provider.dart'; 4 import 'package:provider/provider.dart';
4 5
@@ -6,11 +7,13 @@ import '../../../provider/marketing_center_provider.dart'; @@ -6,11 +7,13 @@ import '../../../provider/marketing_center_provider.dart';
6 import '../../../provider/user_model.dart'; 7 import '../../../provider/user_model.dart';
7 import '../../../res/colors.dart'; 8 import '../../../res/colors.dart';
8 import '../../../route/navigator_util.dart'; 9 import '../../../route/navigator_util.dart';
  10 +import '../../../utils/event_bus.dart';
9 import '../../../utils/screen_util.dart'; 11 import '../../../utils/screen_util.dart';
10 import '../../../utils/utils.dart'; 12 import '../../../utils/utils.dart';
11 import '../../../widgets/MyDivider.dart'; 13 import '../../../widgets/MyDivider.dart';
12 import '../../../widgets/h_empty_view.dart'; 14 import '../../../widgets/h_empty_view.dart';
13 import '../../../widgets/round_button.dart'; 15 import '../../../widgets/round_button.dart';
  16 +import '../../online_check/photo_view_wiget.dart';
14 17
15 /** 18 /**
16 * 客户通知设置 19 * 客户通知设置
@@ -27,6 +30,8 @@ class _CustomerNoticeSettingPageState extends State<CustomerNoticeSettingPage> { @@ -27,6 +30,8 @@ class _CustomerNoticeSettingPageState extends State<CustomerNoticeSettingPage> {
27 bool selectSms = false; //取消预订发送短信默认关闭 30 bool selectSms = false; //取消预订发送短信默认关闭
28 bool select = false; //启用预订安排通知图文模式 31 bool select = false; //启用预订安排通知图文模式
29 MarketingCenterProvider marketingCenterProvider; 32 MarketingCenterProvider marketingCenterProvider;
  33 + String themeName = '';
  34 + String previewUrl = ''; //效果预览的图片链接
30 35
31 @override 36 @override
32 void initState() { 37 void initState() {
@@ -34,9 +39,23 @@ class _CustomerNoticeSettingPageState extends State<CustomerNoticeSettingPage> { @@ -34,9 +39,23 @@ class _CustomerNoticeSettingPageState extends State<CustomerNoticeSettingPage> {
34 39
35 WidgetsBinding.instance.addPostFrameCallback((_) { 40 WidgetsBinding.instance.addPostFrameCallback((_) {
36 getDzSellerConf(); 41 getDzSellerConf();
  42 + _getThemeData();
  43 + bus.on("theme_color_type_name", (arg) {
  44 + themeName = arg['templateName'];
  45 +
  46 + previewUrl = arg['url'];
  47 +
  48 + setState(() {});
  49 + });
37 }); 50 });
38 } 51 }
39 52
  53 + @override
  54 + void dispose() {
  55 + bus.off('theme_color_type_name');
  56 + super.dispose();
  57 + }
  58 +
40 getDzSellerConf() async { 59 getDzSellerConf() async {
41 bool success = await marketingCenterProvider.getDzSellerConf(context); 60 bool success = await marketingCenterProvider.getDzSellerConf(context);
42 if (success && marketingCenterProvider.dzSellerConfModel != null) { 61 if (success && marketingCenterProvider.dzSellerConfModel != null) {
@@ -50,6 +69,67 @@ class _CustomerNoticeSettingPageState extends State<CustomerNoticeSettingPage> { @@ -50,6 +69,67 @@ class _CustomerNoticeSettingPageState extends State<CustomerNoticeSettingPage> {
50 } 69 }
51 } 70 }
52 71
  72 + _getThemeData() async {
  73 + Future.wait<bool>(
  74 + [_getSellerTemplateColorList(), getSellerTemplateConf(context)])
  75 + .then((results) async {
  76 + print(results[0]);
  77 + if (results[0] && results[1]) {
  78 + //成功
  79 +
  80 + int index = marketingCenterProvider.templeteDatas.indexWhere(
  81 + (element) =>
  82 + element.id == marketingCenterProvider.markDataModel.type);
  83 + themeName = marketingCenterProvider.templeteDatas[index].templateName;
  84 + if (marketingCenterProvider.templeteDatas[index].colors.length > 0) {
  85 + // 多配色主题
  86 +
  87 + List<ColorListModel> colors =
  88 + marketingCenterProvider.templeteDatas[index].colors;
  89 +
  90 + previewUrl = colors[colors.indexWhere((element) =>
  91 + element.liteClass ==
  92 + marketingCenterProvider.markDataModel.liteClass)]
  93 + .url;
  94 + } else {
  95 + previewUrl = marketingCenterProvider.templeteDatas[index].url;
  96 + }
  97 + setState(() {});
  98 + } else {
  99 + // if (!results[0]) {
  100 + // //没有优惠券
  101 + // } else {}
  102 + // if (!results[1]) {
  103 + // //没有营销中心数据
  104 + // } else {}
  105 + setState(() {});
  106 + }
  107 + }).catchError((e) {
  108 + print(e);
  109 + });
  110 + }
  111 +
  112 + Future<bool> getSellerTemplateConf(BuildContext context) async {
  113 + bool success = await marketingCenterProvider.getSellerTemplateConf(context);
  114 + if (success &&
  115 + marketingCenterProvider.markDataModel != null &&
  116 + marketingCenterProvider.markDataModel.type != '') {
  117 + return true;
  118 + } else {
  119 + return false;
  120 + }
  121 + }
  122 +
  123 + ///获取后台配置的模版数据
  124 + Future<bool> _getSellerTemplateColorList() async {
  125 + bool success =
  126 + await marketingCenterProvider.getSellerTemplateColorList(context);
  127 + if (success) {
  128 + return true;
  129 + }
  130 + return false;
  131 + }
  132 +
53 ///保存接口 133 ///保存接口
54 _setData() async { 134 _setData() async {
55 Future.wait<bool>([ 135 Future.wait<bool>([
@@ -102,6 +182,67 @@ class _CustomerNoticeSettingPageState extends State<CustomerNoticeSettingPage> { @@ -102,6 +182,67 @@ class _CustomerNoticeSettingPageState extends State<CustomerNoticeSettingPage> {
102 } 182 }
103 } 183 }
104 184
  185 + _showPhotoView(BuildContext context, int index, List<String> imgs,
  186 + {isShow = false, List dashName}) async {
  187 + // if (imgs.length == 1 &&
  188 + // imgs[0] ==
  189 + // 'http://nosqn.colorcun.com/custom/lite-online/image/def-banner.png') {
  190 + // imgs[0] = 'http://nosqn.colorcun.com/app/seller-hj-empty.png';
  191 + // }
  192 + Utils.setBarStatus(false, color: Colors.black);
  193 + dynamic result = await showGeneralDialog(
  194 + context: context,
  195 + barrierDismissible: false,
  196 + // barrierColor: Colors.red,
  197 + barrierLabel:
  198 + MaterialLocalizations.of(context).modalBarrierDismissLabel,
  199 + transitionDuration: const Duration(milliseconds: 150),
  200 + pageBuilder: (BuildContext context, Animation animation,
  201 + Animation secondaryAnimation) {
  202 + Widget child = Stack(
  203 + alignment: Alignment.bottomCenter,
  204 + children: <Widget>[
  205 + PhotoPreview(
  206 + initialIndex: index,
  207 + photoList: imgs,
  208 + isShow: isShow,
  209 + dashName: dashName,
  210 + needMask: false,
  211 + needTap: false,
  212 + callback: (curruntIndex) {
  213 + //选中某个模版
  214 + // callback(curruntIndex);
  215 + },
  216 + ),
  217 + // Positioned(
  218 + // bottom: w(20),
  219 + // child: InkWell(
  220 + // onTap: () {
  221 + // callback(index);
  222 + // },
  223 + // child: Container(
  224 + // padding: EdgeInsets.symmetric(
  225 + // horizontal: w(30), vertical: w(10)),
  226 + // decoration: BoxDecoration(
  227 + // color: MyColours.color_ffffff,
  228 + // borderRadius: BorderRadius.circular(r(30)),
  229 + // ),
  230 + // child: Text(
  231 + // '应用',
  232 + // style: TextStyle(
  233 + // decoration: TextDecoration.none,
  234 + // color: MyColours.color_515151,
  235 + // fontSize: font(16)),
  236 + // ),
  237 + // ),
  238 + // ))
  239 + ],
  240 + );
  241 + return Material(child: child);
  242 + });
  243 + Utils.setBarStatus(true, color: Colors.white);
  244 + }
  245 +
105 Widget _item(String title, {GestureTapCallback onTap}) { 246 Widget _item(String title, {GestureTapCallback onTap}) {
106 return InkWell( 247 return InkWell(
107 onTap: onTap, 248 onTap: onTap,
@@ -217,13 +358,16 @@ class _CustomerNoticeSettingPageState extends State<CustomerNoticeSettingPage> { @@ -217,13 +358,16 @@ class _CustomerNoticeSettingPageState extends State<CustomerNoticeSettingPage> {
217 color: MyColours.color_515151, 358 color: MyColours.color_515151,
218 fontSize: font(16)), 359 fontSize: font(16)),
219 ), 360 ),
220 - Spacer(),  
221 - Text(  
222 - '经典图片', 361 + HEmptyView(20),
  362 +
  363 + Expanded(
  364 + child: Text(
  365 + themeName,
  366 + textAlign: TextAlign.right,
223 style: TextStyle( 367 style: TextStyle(
224 color: MyColours.color_515151, 368 color: MyColours.color_515151,
225 fontSize: font(16)), 369 fontSize: font(16)),
226 - ), 370 + )),
227 Container( 371 Container(
228 padding: EdgeInsets.symmetric( 372 padding: EdgeInsets.symmetric(
229 horizontal: w(11), vertical: w(4)), 373 horizontal: w(11), vertical: w(4)),
@@ -292,7 +436,13 @@ class _CustomerNoticeSettingPageState extends State<CustomerNoticeSettingPage> { @@ -292,7 +436,13 @@ class _CustomerNoticeSettingPageState extends State<CustomerNoticeSettingPage> {
292 textColor: MyColours.color_438E93, 436 textColor: MyColours.color_438E93,
293 isBold: true, 437 isBold: true,
294 onPressed: () async { 438 onPressed: () async {
295 - NavigatorUtil.goMarkingPreviewPage(context); 439 + // NavigatorUtil.goMarkingPreviewPage(context);
  440 + if (previewUrl == '') {
  441 + Utils.showToast('暂时没有可预览的图文信息');
  442 + return;
  443 + }
  444 + //
  445 + _showPhotoView(context, 0, [previewUrl]);
296 }), 446 }),
297 HEmptyView(30), 447 HEmptyView(30),
298 Expanded( 448 Expanded(
1 import 'package:cached_network_image/cached_network_image.dart'; 1 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/models/seller_template_color_list_model.dart';
4 import 'package:one_key/pages/my/marketing_center/theme_model.dart'; 5 import 'package:one_key/pages/my/marketing_center/theme_model.dart';
5 import 'package:one_key/route/navigator_util.dart'; 6 import 'package:one_key/route/navigator_util.dart';
6 import 'package:one_key/widgets/system_app_bar.dart'; 7 import 'package:one_key/widgets/system_app_bar.dart';
7 import 'package:one_key/widgets/v_empty_view.dart'; 8 import 'package:one_key/widgets/v_empty_view.dart';
  9 +import 'package:provider/provider.dart';
8 10
  11 +import '../../../constant/state.dart';
  12 +import '../../../provider/marketing_center_provider.dart';
9 import '../../../res/colors.dart'; 13 import '../../../res/colors.dart';
10 import '../../../utils/dialog_util.dart'; 14 import '../../../utils/dialog_util.dart';
11 import '../../../utils/event_bus.dart'; 15 import '../../../utils/event_bus.dart';
12 import '../../../utils/screen_util.dart'; 16 import '../../../utils/screen_util.dart';
13 import '../../../utils/utils.dart'; 17 import '../../../utils/utils.dart';
14 import '../../../widgets/MyDivider.dart'; 18 import '../../../widgets/MyDivider.dart';
  19 +import '../../../widgets/page_exception.dart';
15 import '../../online_check/photo_view_wiget.dart'; 20 import '../../online_check/photo_view_wiget.dart';
16 21
17 import 'dart:convert' as convert; 22 import 'dart:convert' as convert;
@@ -32,109 +37,44 @@ class InvitationThemeHomePage extends StatefulWidget { @@ -32,109 +37,44 @@ class InvitationThemeHomePage extends StatefulWidget {
32 class _InvitationThemeHomePageState extends State<InvitationThemeHomePage> { 37 class _InvitationThemeHomePageState extends State<InvitationThemeHomePage> {
33 ScrollController controller = ScrollController(); 38 ScrollController controller = ScrollController();
34 39
  40 + MarketingCenterProvider marketingCenterProvider;
  41 +
35 //当前店铺选中的颜色和板式 42 //当前店铺选中的颜色和板式
36 43
37 String themeColor; 44 String themeColor;
38 String themeType = '1'; //模版类型 45 String themeType = '1'; //模版类型
39 // int indexSelectColor = 0; //选中第几个模版 (有配色选中index) 46 // int indexSelectColor = 0; //选中第几个模版 (有配色选中index)
40 // int indexSelectNoColor = 0; //选中第几个模版 (无配色选中index) 47 // int indexSelectNoColor = 0; //选中第几个模版 (无配色选中index)
41 - List<ThemeSunModel> themesDatas = [];  
42 -  
43 - ThemeModel themeModelCurrunt; //有配色对应的当前页面模版数据  
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 - // }; 48 + // List<ThemeSunModel> marketingCenterProvider.templeteDatas = [];
52 49
53 - // ThemeModel themeModel1 = ThemeModel.fromJson(json1);  
54 - // themeDatas['黑蓝过渡'] = themeModel1; 50 + // ThemeModel themeModelCurrunt; //有配色对应的当前页面模版数据
55 51
56 @override 52 @override
57 void initState() { 53 void initState() {
58 super.initState(); 54 super.initState();
59 55
60 - //模版1  
61 - _addModel1();  
62 -  
63 - //模版2  
64 - _addModel2();  
65 -  
66 - //模版3  
67 - _addModel3();  
68 -  
69 - //模版4  
70 - _addModel4();  
71 -  
72 - //模版5  
73 - _addModel5();  
74 -  
75 - //模版6  
76 - _addModel6();  
77 -  
78 - //模版7  
79 - _addModel7();  
80 -  
81 WidgetsBinding.instance.addPostFrameCallback((_) { 56 WidgetsBinding.instance.addPostFrameCallback((_) {
  57 + _getThemeData();
82 bus.on("theme_color_type", (arg) { 58 bus.on("theme_color_type", (arg) {
83 themeColor = arg['themeColor']; 59 themeColor = arg['themeColor'];
84 themeType = arg['themeType']; 60 themeType = arg['themeType'];
85 -  
86 - themesDatas[  
87 - themesDatas.indexWhere((element) => element.id == themeType)]  
88 - .themeColorDefault = themeColor;  
89 - 61 + SellerTemplateColorListSunModel themeSunModel =
  62 + marketingCenterProvider.templeteDatas[marketingCenterProvider
  63 + .templeteDatas
  64 + .indexWhere((element) => element.id == themeType)];
  65 + themeSunModel.themeColorDefault = themeColor;
  66 + bus.emit('theme_color_type_name', {
  67 + 'templateName': themeSunModel.templateName,
  68 + 'url': themeSunModel.colors.length == 0
  69 + ? themeSunModel.url
  70 + : themeSunModel
  71 + .colors[themeSunModel.colors
  72 + .indexWhere((element) => element.colorName == themeColor)]
  73 + .url
  74 + });
90 setState(() {}); 75 setState(() {});
91 }); 76 });
92 }); 77 });
93 -  
94 - // //石绿过度  
95 - // _addShilvuodu();  
96 -  
97 - // //中国红过度  
98 - // _addZhongguohongguodu();  
99 -  
100 - // //群青过度  
101 - // _addQunqingguodu();  
102 -  
103 - // //深中国红  
104 - // _addShenzhongguohong();  
105 -  
106 - // //中国红  
107 - // _addZhongguohong();  
108 -  
109 - // //蓝采和  
110 - // _addLancaihe();  
111 -  
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 } 78 }
139 79
140 @override 80 @override
@@ -143,1501 +83,66 @@ class _InvitationThemeHomePageState extends State<InvitationThemeHomePage> { @@ -143,1501 +83,66 @@ class _InvitationThemeHomePageState extends State<InvitationThemeHomePage> {
143 super.dispose(); 83 super.dispose();
144 } 84 }
145 85
146 -/**  
147 - * _addMoluogelan() {  
148 - List<ThemeSunModel> urls = [];  
149 -  
150 - // //模版1  
151 - // Map<String, dynamic> jsonSun11 = {  
152 - // 'name': '1 经典图片式',  
153 - // 'id': '1',  
154 - // 'url': 'https://qn.colorcun.com/template/jingdianbianyi.png',  
155 - // };  
156 - // ThemeSunModel themeSunModel11 = ThemeSunModel.fromJson(jsonSun11);  
157 - // urls.add(themeSunModel11);  
158 -  
159 - //模版2  
160 - Map<String, dynamic> jsonSun12 = {  
161 - 'name': '2 简洁图文A(多色)',  
162 - 'id': '2',  
163 - 'url': 'https://qn.colorcun.com/template/moluogelan-2.png',  
164 - };  
165 - ThemeSunModel themeSunModel12 = ThemeSunModel.fromJson(jsonSun12);  
166 - urls.add(themeSunModel12);  
167 - //模版3  
168 - Map<String, dynamic> jsonSun13 = {  
169 - 'name': '3 简洁信息图文A(多色)',  
170 - 'id': '3',  
171 - 'url': 'https://qn.colorcun.com/template/moluogelan-3.png',  
172 - };  
173 - ThemeSunModel themeSunModel13 = ThemeSunModel.fromJson(jsonSun13);  
174 - urls.add(themeSunModel13);  
175 - //模版4  
176 - Map<String, dynamic> jsonSun14 = {  
177 - 'name': '4 半屏邀请函A(多色)',  
178 - 'id': '4',  
179 - 'url': 'https://qn.colorcun.com/template/moluogelan-4.png',  
180 - };  
181 - ThemeSunModel themeSunModel14 = ThemeSunModel.fromJson(jsonSun14);  
182 - urls.add(themeSunModel14);  
183 -  
184 - //模版5  
185 - Map<String, dynamic> jsonSun15 = {  
186 - 'name': '5 半屏邀请函B(多色)',  
187 - 'id': '5',  
188 - 'url': 'https://qn.colorcun.com/template/moluogelan-5.png',  
189 - };  
190 - ThemeSunModel themeSunModel15 = ThemeSunModel.fromJson(jsonSun15);  
191 - urls.add(themeSunModel15);  
192 -  
193 - //模版6  
194 - Map<String, dynamic> jsonSun16 = {  
195 - 'name': '6 无预订包间图片A(多色)',  
196 - 'id': '6',  
197 - 'url': 'https://qn.colorcun.com/template/moluogelan-6.png',  
198 - };  
199 - ThemeSunModel themeSunModel16 = ThemeSunModel.fromJson(jsonSun16);  
200 - urls.add(themeSunModel16);  
201 -  
202 - //模版7  
203 - Map<String, dynamic> jsonSun17 = {  
204 - 'name': '7 无预订包间图片B',  
205 - 'id': '7',  
206 - 'url': 'https://qn.colorcun.com/template/moluogelan-7.png',  
207 - };  
208 - ThemeSunModel themeSunModel17 = ThemeSunModel.fromJson(jsonSun17);  
209 - urls.add(themeSunModel17);  
210 -  
211 - Map<String, dynamic> json1 = {  
212 - 'color_name': '摩洛哥蓝',  
213 - 'color_value_s': 'FF19516A',  
214 - 'color_value_m': 'FF19516A',  
215 - 'color_value_e': 'FF19516A',  
216 - 'urls': urls  
217 - };  
218 -  
219 - ThemeModel themeModel1 = ThemeModel.fromJson(json1);  
220 - // themeDatas.add(themeModel1);  
221 - themeDatas['摩洛哥蓝'] = themeModel1;  
222 - }  
223 -  
224 - _addQunqing() {  
225 - List<ThemeSunModel> urls = [];  
226 - //模版2  
227 - Map<String, dynamic> jsonSun12 = {  
228 - 'name': '2 简洁图文A(多色)',  
229 - 'id': '2',  
230 - 'url': 'https://qn.colorcun.com/template/qunqing-2.png',  
231 - };  
232 - ThemeSunModel themeSunModel12 = ThemeSunModel.fromJson(jsonSun12);  
233 - urls.add(themeSunModel12);  
234 - //模版3  
235 - Map<String, dynamic> jsonSun13 = {  
236 - 'name': '3 简洁信息图文A(多色)',  
237 - 'id': '3',  
238 - 'url': 'https://qn.colorcun.com/template/qunqing-3.png',  
239 - };  
240 - ThemeSunModel themeSunModel13 = ThemeSunModel.fromJson(jsonSun13);  
241 - urls.add(themeSunModel13);  
242 - //模版4  
243 - Map<String, dynamic> jsonSun14 = {  
244 - 'name': '4 半屏邀请函A(多色)',  
245 - 'id': '4',  
246 - 'url': 'https://qn.colorcun.com/template/qunqing-4.png',  
247 - };  
248 - ThemeSunModel themeSunModel14 = ThemeSunModel.fromJson(jsonSun14);  
249 - urls.add(themeSunModel14);  
250 -  
251 - //模版5  
252 - Map<String, dynamic> jsonSun15 = {  
253 - 'name': '5 半屏邀请函B(多色)',  
254 - 'id': '5',  
255 - 'url': 'https://qn.colorcun.com/template/qunqing-5.png',  
256 - };  
257 - ThemeSunModel themeSunModel15 = ThemeSunModel.fromJson(jsonSun15);  
258 - urls.add(themeSunModel15);  
259 -  
260 - //模版6  
261 - Map<String, dynamic> jsonSun16 = {  
262 - 'name': '6 无预订包间图片A(多色)',  
263 - 'id': '6',  
264 - 'url': 'https://qn.colorcun.com/template/qunqing-6.png',  
265 - };  
266 - ThemeSunModel themeSunModel16 = ThemeSunModel.fromJson(jsonSun16);  
267 - urls.add(themeSunModel16);  
268 -  
269 - //模版7  
270 - Map<String, dynamic> jsonSun17 = {  
271 - 'name': '7 无预订包间图片B',  
272 - 'id': '7',  
273 - 'url': 'https://qn.colorcun.com/template/qunqing-7.png',  
274 - };  
275 - ThemeSunModel themeSunModel17 = ThemeSunModel.fromJson(jsonSun17);  
276 - urls.add(themeSunModel17);  
277 -  
278 - Map<String, dynamic> json1 = {  
279 - 'color_name': '群青',  
280 - 'color_value_s': 'FF0143A3',  
281 - 'color_value_m': 'FF0143A3',  
282 - 'color_value_e': 'FF0143A3',  
283 - 'urls': urls  
284 - };  
285 -  
286 - ThemeModel themeModel1 = ThemeModel.fromJson(json1);  
287 - // themeDatas.add(themeModel1);  
288 - themeDatas['群青'] = themeModel1;  
289 - }  
290 -  
291 - _addCanghuang() {  
292 - List<ThemeSunModel> urls = [];  
293 - //模版2  
294 - Map<String, dynamic> jsonSun12 = {  
295 - 'name': '2 简洁图文A(多色)',  
296 - 'id': '2',  
297 - 'url': 'https://qn.colorcun.com/template/canghuang-2.png',  
298 - };  
299 - ThemeSunModel themeSunModel12 = ThemeSunModel.fromJson(jsonSun12);  
300 - urls.add(themeSunModel12);  
301 - //模版3  
302 - Map<String, dynamic> jsonSun13 = {  
303 - 'name': '3 简洁信息图文A(多色)',  
304 - 'id': '3',  
305 - 'url': 'https://qn.colorcun.com/template/canghuang-3.png',  
306 - };  
307 - ThemeSunModel themeSunModel13 = ThemeSunModel.fromJson(jsonSun13);  
308 - urls.add(themeSunModel13);  
309 - //模版4  
310 - Map<String, dynamic> jsonSun14 = {  
311 - 'name': '4 半屏邀请函A(多色)',  
312 - 'id': '4',  
313 - 'url': 'https://qn.colorcun.com/template/canghuang-4.png',  
314 - };  
315 - ThemeSunModel themeSunModel14 = ThemeSunModel.fromJson(jsonSun14);  
316 - urls.add(themeSunModel14);  
317 -  
318 - //模版5  
319 - Map<String, dynamic> jsonSun15 = {  
320 - 'name': '5 半屏邀请函B(多色)',  
321 - 'id': '5',  
322 - 'url': 'https://qn.colorcun.com/template/canghuang-5.png',  
323 - };  
324 - ThemeSunModel themeSunModel15 = ThemeSunModel.fromJson(jsonSun15);  
325 - urls.add(themeSunModel15);  
326 -  
327 - //模版6  
328 - Map<String, dynamic> jsonSun16 = {  
329 - 'name': '6 无预订包间图片A(多色)',  
330 - 'id': '6',  
331 - 'url': 'https://qn.colorcun.com/template/canghuang-6.png',  
332 - };  
333 - ThemeSunModel themeSunModel16 = ThemeSunModel.fromJson(jsonSun16);  
334 - urls.add(themeSunModel16);  
335 -  
336 - //模版7  
337 - Map<String, dynamic> jsonSun17 = {  
338 - 'name': '7 无预订包间图片B',  
339 - 'id': '7',  
340 - 'url': 'https://qn.colorcun.com/template/canghuang-7.png',  
341 - };  
342 - ThemeSunModel themeSunModel17 = ThemeSunModel.fromJson(jsonSun17);  
343 - urls.add(themeSunModel17);  
344 -  
345 - Map<String, dynamic> json1 = {  
346 - 'color_name': '苍黄',  
347 - 'color_value_s': 'FFC85306',  
348 - 'color_value_m': 'FFC85306',  
349 - 'color_value_e': 'FFC85306',  
350 - 'urls': urls  
351 - };  
352 -  
353 - ThemeModel themeModel1 = ThemeModel.fromJson(json1);  
354 - // themeDatas.add(themeModel1);  
355 - themeDatas['苍黄'] = themeModel1;  
356 - }  
357 -  
358 - _addJinhuang() {  
359 - List<ThemeSunModel> urls = [];  
360 - //模版2  
361 - Map<String, dynamic> jsonSun12 = {  
362 - 'name': '2 简洁图文A(多色)',  
363 - 'id': '2',  
364 - 'url': 'https://qn.colorcun.com/template/jinhuang-2.png',  
365 - };  
366 - ThemeSunModel themeSunModel12 = ThemeSunModel.fromJson(jsonSun12);  
367 - urls.add(themeSunModel12);  
368 - //模版3  
369 - Map<String, dynamic> jsonSun13 = {  
370 - 'name': '3 简洁信息图文A(多色)',  
371 - 'id': '3',  
372 - 'url': 'https://qn.colorcun.com/template/jinhuang-3.png',  
373 - };  
374 - ThemeSunModel themeSunModel13 = ThemeSunModel.fromJson(jsonSun13);  
375 - urls.add(themeSunModel13);  
376 - //模版4  
377 - Map<String, dynamic> jsonSun14 = {  
378 - 'name': '4 半屏邀请函A(多色)',  
379 - 'id': '4',  
380 - 'url': 'https://qn.colorcun.com/template/jinhuang-4.png',  
381 - };  
382 - ThemeSunModel themeSunModel14 = ThemeSunModel.fromJson(jsonSun14);  
383 - urls.add(themeSunModel14);  
384 -  
385 - //模版5  
386 - Map<String, dynamic> jsonSun15 = {  
387 - 'name': '5 半屏邀请函B(多色)',  
388 - 'id': '5',  
389 - 'url': 'https://qn.colorcun.com/template/jinhuang-5.png',  
390 - };  
391 - ThemeSunModel themeSunModel15 = ThemeSunModel.fromJson(jsonSun15);  
392 - urls.add(themeSunModel15);  
393 -  
394 - //模版6  
395 - Map<String, dynamic> jsonSun16 = {  
396 - 'name': '6 无预订包间图片A(多色)',  
397 - 'id': '6',  
398 - 'url': 'https://qn.colorcun.com/template/jinhuang-6.png',  
399 - };  
400 - ThemeSunModel themeSunModel16 = ThemeSunModel.fromJson(jsonSun16);  
401 - urls.add(themeSunModel16);  
402 -  
403 - //模版7  
404 - Map<String, dynamic> jsonSun17 = {  
405 - 'name': '7 无预订包间图片B',  
406 - 'id': '7',  
407 - 'url': 'https://qn.colorcun.com/template/jinhuang-7.png',  
408 - };  
409 - ThemeSunModel themeSunModel17 = ThemeSunModel.fromJson(jsonSun17);  
410 - urls.add(themeSunModel17);  
411 -  
412 - Map<String, dynamic> json1 = {  
413 - 'color_name': '金黄',  
414 - 'color_value_s': 'FFC67B3A',  
415 - 'color_value_m': 'FFC67B3A',  
416 - 'color_value_e': 'FFC67B3A',  
417 - 'urls': urls  
418 - };  
419 -  
420 - ThemeModel themeModel1 = ThemeModel.fromJson(json1);  
421 - // themeDatas.add(themeModel1);  
422 - themeDatas['金黄'] = themeModel1;  
423 - }  
424 -  
425 - _addJianghuang() {  
426 - List<ThemeSunModel> urls = [];  
427 - //模版2  
428 - Map<String, dynamic> jsonSun12 = {  
429 - 'name': '2 简洁图文A(多色)',  
430 - 'id': '2',  
431 - 'url': 'https://qn.colorcun.com/template/jianghuang-2.png',  
432 - };  
433 - ThemeSunModel themeSunModel12 = ThemeSunModel.fromJson(jsonSun12);  
434 - urls.add(themeSunModel12);  
435 - //模版3  
436 - Map<String, dynamic> jsonSun13 = {  
437 - 'name': '3 简洁信息图文A(多色)',  
438 - 'id': '3',  
439 - 'url': 'https://qn.colorcun.com/template/jianghuang-3.png',  
440 - };  
441 - ThemeSunModel themeSunModel13 = ThemeSunModel.fromJson(jsonSun13);  
442 - urls.add(themeSunModel13);  
443 - //模版4  
444 - Map<String, dynamic> jsonSun14 = {  
445 - 'name': '4 半屏邀请函A(多色)',  
446 - 'id': '4',  
447 - 'url': 'https://qn.colorcun.com/template/jianghuang-4.png',  
448 - };  
449 - ThemeSunModel themeSunModel14 = ThemeSunModel.fromJson(jsonSun14);  
450 - urls.add(themeSunModel14);  
451 -  
452 - //模版5  
453 - Map<String, dynamic> jsonSun15 = {  
454 - 'name': '5 半屏邀请函B(多色)',  
455 - 'id': '5',  
456 - 'url': 'https://qn.colorcun.com/template/jianghuang-5.png',  
457 - };  
458 - ThemeSunModel themeSunModel15 = ThemeSunModel.fromJson(jsonSun15);  
459 - urls.add(themeSunModel15);  
460 -  
461 - //模版6  
462 - Map<String, dynamic> jsonSun16 = {  
463 - 'name': '6 无预订包间图片A(多色)',  
464 - 'id': '6',  
465 - 'url': 'https://qn.colorcun.com/template/jianghuang-6.png',  
466 - };  
467 - ThemeSunModel themeSunModel16 = ThemeSunModel.fromJson(jsonSun16);  
468 - urls.add(themeSunModel16);  
469 -  
470 - //模版7  
471 - Map<String, dynamic> jsonSun17 = {  
472 - 'name': '7 无预订包间图片B',  
473 - 'id': '7',  
474 - 'url': 'https://qn.colorcun.com/template/jianghuang-7.png',  
475 - };  
476 - ThemeSunModel themeSunModel17 = ThemeSunModel.fromJson(jsonSun17);  
477 - urls.add(themeSunModel17);  
478 -  
479 - Map<String, dynamic> json1 = {  
480 - 'color_name': '姜黄',  
481 - 'color_value_s': 'FFB39437',  
482 - 'color_value_m': 'FFB39437',  
483 - 'color_value_e': 'FFB39437',  
484 - 'urls': urls  
485 - };  
486 -  
487 - ThemeModel themeModel1 = ThemeModel.fromJson(json1);  
488 - // themeDatas.add(themeModel1);  
489 - themeDatas['姜黄'] = themeModel1;  
490 - }  
491 -  
492 - _addShilv() {  
493 - List<ThemeSunModel> urls = [];  
494 - //模版2  
495 - Map<String, dynamic> jsonSun12 = {  
496 - 'name': '2 简洁图文A(多色)',  
497 - 'id': '2',  
498 - 'url': 'https://qn.colorcun.com/template/shilv-2.png',  
499 - };  
500 - ThemeSunModel themeSunModel12 = ThemeSunModel.fromJson(jsonSun12);  
501 - urls.add(themeSunModel12);  
502 - //模版3  
503 - Map<String, dynamic> jsonSun13 = {  
504 - 'name': '3 简洁信息图文A(多色)',  
505 - 'id': '3',  
506 - 'url': 'https://qn.colorcun.com/template/shilv-3.png',  
507 - };  
508 - ThemeSunModel themeSunModel13 = ThemeSunModel.fromJson(jsonSun13);  
509 - urls.add(themeSunModel13);  
510 - //模版4  
511 - Map<String, dynamic> jsonSun14 = {  
512 - 'name': '4 半屏邀请函A(多色)',  
513 - 'id': '4',  
514 - 'url': 'https://qn.colorcun.com/template/shilv-4.png',  
515 - };  
516 - ThemeSunModel themeSunModel14 = ThemeSunModel.fromJson(jsonSun14);  
517 - urls.add(themeSunModel14);  
518 -  
519 - //模版5  
520 - Map<String, dynamic> jsonSun15 = {  
521 - 'name': '5 半屏邀请函B(多色)',  
522 - 'id': '5',  
523 - 'url': 'https://qn.colorcun.com/template/shilv-5.png',  
524 - };  
525 - ThemeSunModel themeSunModel15 = ThemeSunModel.fromJson(jsonSun15);  
526 - urls.add(themeSunModel15);  
527 -  
528 - //模版6  
529 - Map<String, dynamic> jsonSun16 = {  
530 - 'name': '6 无预订包间图片A(多色)',  
531 - 'id': '6',  
532 - 'url': 'https://qn.colorcun.com/template/shilv-6.png',  
533 - };  
534 - ThemeSunModel themeSunModel16 = ThemeSunModel.fromJson(jsonSun16);  
535 - urls.add(themeSunModel16);  
536 -  
537 - //模版7  
538 - Map<String, dynamic> jsonSun17 = {  
539 - 'name': '7 无预订包间图片B',  
540 - 'id': '7',  
541 - 'url': 'https://qn.colorcun.com/template/shilv-7.png',  
542 - };  
543 - ThemeSunModel themeSunModel17 = ThemeSunModel.fromJson(jsonSun17);  
544 - urls.add(themeSunModel17);  
545 -  
546 - Map<String, dynamic> json1 = {  
547 - 'color_name': '石绿',  
548 - 'color_value_s': 'FF206864',  
549 - 'color_value_m': 'FF206864',  
550 - 'color_value_e': 'FF206864',  
551 - 'urls': urls  
552 - };  
553 -  
554 - ThemeModel themeModel1 = ThemeModel.fromJson(json1);  
555 - // themeDatas.add(themeModel1);  
556 - themeDatas['石绿'] = themeModel1;  
557 - }  
558 -  
559 - _addLancaihe() {  
560 - List<ThemeSunModel> urls = [];  
561 - //模版2  
562 - Map<String, dynamic> jsonSun12 = {  
563 - 'name': '2 简洁图文A(多色)',  
564 - 'id': '2',  
565 - 'url': 'https://qn.colorcun.com/template/lancaihe-2.png',  
566 - };  
567 - ThemeSunModel themeSunModel12 = ThemeSunModel.fromJson(jsonSun12);  
568 - urls.add(themeSunModel12);  
569 - //模版3  
570 - Map<String, dynamic> jsonSun13 = {  
571 - 'name': '3 简洁信息图文A(多色)',  
572 - 'id': '3',  
573 - 'url': 'https://qn.colorcun.com/template/lancaihe-3.png',  
574 - };  
575 - ThemeSunModel themeSunModel13 = ThemeSunModel.fromJson(jsonSun13);  
576 - urls.add(themeSunModel13);  
577 - //模版4  
578 - Map<String, dynamic> jsonSun14 = {  
579 - 'name': '4 半屏邀请函A(多色)',  
580 - 'id': '4',  
581 - 'url': 'https://qn.colorcun.com/template/lancaihe-4.png',  
582 - };  
583 - ThemeSunModel themeSunModel14 = ThemeSunModel.fromJson(jsonSun14);  
584 - urls.add(themeSunModel14); 86 + _getThemeData() async {
  87 + Future.wait<bool>(
  88 + [_getSellerTemplateColorList(), getSellerTemplateConf(context)])
  89 + .then((results) async {
  90 + print(results[0]);
  91 + if (results[0] && results[1]) {
  92 + //成功
  93 + marketingCenterProvider.pageStateThemeHome = PageState.Success;
  94 + int index = marketingCenterProvider.templeteDatas.indexWhere(
  95 + (element) =>
  96 + element.id == marketingCenterProvider.markDataModel.type);
  97 + themeType = marketingCenterProvider.templeteDatas[index].id;
  98 +
  99 + List<ColorListModel> colors =
  100 + marketingCenterProvider.templeteDatas[index].colors;
  101 + themeColor = colors[colors.indexWhere((element) =>
  102 + element.liteClass ==
  103 + marketingCenterProvider.markDataModel.liteClass)]
  104 + .colorName;
  105 + marketingCenterProvider.templeteDatas[index].themeColorDefault =
  106 + themeColor;
585 107
586 - //模版5  
587 - Map<String, dynamic> jsonSun15 = {  
588 - 'name': '5 半屏邀请函B(多色)',  
589 - 'id': '5',  
590 - 'url': 'https://qn.colorcun.com/template/lancaihe-5.png',  
591 - };  
592 - ThemeSunModel themeSunModel15 = ThemeSunModel.fromJson(jsonSun15);  
593 - urls.add(themeSunModel15);  
594 -  
595 - //模版6  
596 - Map<String, dynamic> jsonSun16 = {  
597 - 'name': '6 无预订包间图片A(多色)',  
598 - 'id': '6',  
599 - 'url': 'https://qn.colorcun.com/template/lancaihe-6.png',  
600 - };  
601 - ThemeSunModel themeSunModel16 = ThemeSunModel.fromJson(jsonSun16);  
602 - urls.add(themeSunModel16);  
603 -  
604 - //模版7  
605 - Map<String, dynamic> jsonSun17 = {  
606 - 'name': '7 无预订包间图片B',  
607 - 'id': '7',  
608 - 'url': 'https://qn.colorcun.com/template/lancaihe-7.png',  
609 - };  
610 - ThemeSunModel themeSunModel17 = ThemeSunModel.fromJson(jsonSun17);  
611 - urls.add(themeSunModel17);  
612 -  
613 - Map<String, dynamic> json1 = {  
614 - 'color_name': '蓝采和',  
615 - 'color_value_s': 'FF06436F',  
616 - 'color_value_m': 'FF06436F',  
617 - 'color_value_e': 'FF06436F',  
618 - 'urls': urls  
619 - };  
620 -  
621 - ThemeModel themeModel1 = ThemeModel.fromJson(json1);  
622 - // themeDatas.add(themeModel1);  
623 - themeDatas['蓝采和'] = themeModel1;  
624 - }  
625 -  
626 - _addZhongguohong() {  
627 - List<ThemeSunModel> urls = [];  
628 - //模版2  
629 - Map<String, dynamic> jsonSun12 = {  
630 - 'name': '2 简洁图文A(多色)',  
631 - 'id': '2',  
632 - 'url': 'https://qn.colorcun.com/template/zhongguohong-2.png',  
633 - };  
634 - ThemeSunModel themeSunModel12 = ThemeSunModel.fromJson(jsonSun12);  
635 - urls.add(themeSunModel12);  
636 - //模版3  
637 - Map<String, dynamic> jsonSun13 = {  
638 - 'name': '3 简洁信息图文A(多色)',  
639 - 'id': '3',  
640 - 'url': 'https://qn.colorcun.com/template/zhongguohong-3.png',  
641 - };  
642 - ThemeSunModel themeSunModel13 = ThemeSunModel.fromJson(jsonSun13);  
643 - urls.add(themeSunModel13);  
644 - //模版4  
645 - Map<String, dynamic> jsonSun14 = {  
646 - 'name': '4 半屏邀请函A(多色)',  
647 - 'id': '4',  
648 - 'url': 'https://qn.colorcun.com/template/zhongguohong-4.png',  
649 - };  
650 - ThemeSunModel themeSunModel14 = ThemeSunModel.fromJson(jsonSun14);  
651 - urls.add(themeSunModel14);  
652 -  
653 - //模版5  
654 - Map<String, dynamic> jsonSun15 = {  
655 - 'name': '5 半屏邀请函B(多色)',  
656 - 'id': '5',  
657 - 'url': 'https://qn.colorcun.com/template/zhongguohong-5.png',  
658 - };  
659 - ThemeSunModel themeSunModel15 = ThemeSunModel.fromJson(jsonSun15);  
660 - urls.add(themeSunModel15);  
661 -  
662 - //模版6  
663 - Map<String, dynamic> jsonSun16 = {  
664 - 'name': '6 无预订包间图片A(多色)',  
665 - 'id': '6',  
666 - 'url': 'https://qn.colorcun.com/template/zhongguohong-6.png',  
667 - };  
668 - ThemeSunModel themeSunModel16 = ThemeSunModel.fromJson(jsonSun16);  
669 - urls.add(themeSunModel16);  
670 -  
671 - //模版7  
672 - Map<String, dynamic> jsonSun17 = {  
673 - 'name': '7 无预订包间图片B',  
674 - 'id': '7',  
675 - 'url': 'https://qn.colorcun.com/template/zhongguohong-7.png',  
676 - };  
677 - ThemeSunModel themeSunModel17 = ThemeSunModel.fromJson(jsonSun17);  
678 - urls.add(themeSunModel17);  
679 -  
680 - Map<String, dynamic> json1 = {  
681 - 'color_name': '中国红',  
682 - 'color_value_s': 'FFAF231C',  
683 - 'color_value_m': 'FFAF231C',  
684 - 'color_value_e': 'FFAF231C',  
685 - 'urls': urls  
686 - };  
687 -  
688 - ThemeModel themeModel1 = ThemeModel.fromJson(json1);  
689 - // themeDatas.add(themeModel1);  
690 - themeDatas['中国红'] = themeModel1;  
691 - }  
692 -  
693 - _addShenzhongguohong() {  
694 - List<ThemeSunModel> urls = [];  
695 - //模版2  
696 - Map<String, dynamic> jsonSun12 = {  
697 - 'name': '2 简洁图文A(多色)',  
698 - 'id': '2',  
699 - 'url': 'https://qn.colorcun.com/template/shenzhongguohong-2.png',  
700 - };  
701 - ThemeSunModel themeSunModel12 = ThemeSunModel.fromJson(jsonSun12);  
702 - urls.add(themeSunModel12);  
703 - //模版3  
704 - Map<String, dynamic> jsonSun13 = {  
705 - 'name': '3 简洁信息图文A(多色)',  
706 - 'id': '3',  
707 - 'url': 'https://qn.colorcun.com/template/shenzhongguohong-3.png',  
708 - };  
709 - ThemeSunModel themeSunModel13 = ThemeSunModel.fromJson(jsonSun13);  
710 - urls.add(themeSunModel13);  
711 - //模版4  
712 - Map<String, dynamic> jsonSun14 = {  
713 - 'name': '4 半屏邀请函A(多色)',  
714 - 'id': '4',  
715 - 'url': 'https://qn.colorcun.com/template/shenzhongguohong-4.png',  
716 - };  
717 - ThemeSunModel themeSunModel14 = ThemeSunModel.fromJson(jsonSun14);  
718 - urls.add(themeSunModel14);  
719 -  
720 - //模版5  
721 - Map<String, dynamic> jsonSun15 = {  
722 - 'name': '5 半屏邀请函B(多色)',  
723 - 'id': '5',  
724 - 'url': 'https://qn.colorcun.com/template/shenzhongguohong-5.png',  
725 - };  
726 - ThemeSunModel themeSunModel15 = ThemeSunModel.fromJson(jsonSun15);  
727 - urls.add(themeSunModel15);  
728 -  
729 - //模版6  
730 - Map<String, dynamic> jsonSun16 = {  
731 - 'name': '6 无预订包间图片A(多色)',  
732 - 'id': '6',  
733 - 'url': 'https://qn.colorcun.com/template/shenzhongguohong-6.png',  
734 - };  
735 - ThemeSunModel themeSunModel16 = ThemeSunModel.fromJson(jsonSun16);  
736 - urls.add(themeSunModel16);  
737 -  
738 - //模版7  
739 - Map<String, dynamic> jsonSun17 = {  
740 - 'name': '7 无预订包间图片B',  
741 - 'id': '7',  
742 - 'url': 'https://qn.colorcun.com/template/shenzhongguohong-7.png',  
743 - };  
744 - ThemeSunModel themeSunModel17 = ThemeSunModel.fromJson(jsonSun17);  
745 - urls.add(themeSunModel17);  
746 -  
747 - Map<String, dynamic> json1 = {  
748 - 'color_name': '深中国红',  
749 - 'color_value_s': 'FF86201B',  
750 - 'color_value_m': 'FF86201B',  
751 - 'color_value_e': 'FF86201B',  
752 - 'urls': urls  
753 - };  
754 -  
755 - ThemeModel themeModel1 = ThemeModel.fromJson(json1);  
756 - // themeDatas.add(themeModel1);  
757 - themeDatas['深中国红'] = themeModel1;  
758 - _addShilvuodu() {  
759 - List<ThemeSunModel> urls = [];  
760 - //模版3  
761 - Map<String, dynamic> jsonSun13 = {  
762 - 'name': '3 简洁信息图文A(多色)',  
763 - 'id': '3',  
764 - 'url': 'https://qn.colorcun.com/template/shilvguodu-3.png',  
765 - };  
766 - ThemeSunModel themeSunModel13 = ThemeSunModel.fromJson(jsonSun13);  
767 - urls.add(themeSunModel13);  
768 - //模版4  
769 - Map<String, dynamic> jsonSun14 = {  
770 - 'name': '4 半屏邀请函A(多色)',  
771 - 'id': '4',  
772 - 'url': 'https://qn.colorcun.com/template/shilvguodu-4.png',  
773 - };  
774 - ThemeSunModel themeSunModel14 = ThemeSunModel.fromJson(jsonSun14);  
775 - urls.add(themeSunModel14);  
776 -  
777 - //模版5  
778 - Map<String, dynamic> jsonSun15 = {  
779 - 'name': '5 半屏邀请函B(多色)',  
780 - 'id': '5',  
781 - 'url': 'https://qn.colorcun.com/template/shilvguodu-5.png',  
782 - };  
783 - ThemeSunModel themeSunModel15 = ThemeSunModel.fromJson(jsonSun15);  
784 - urls.add(themeSunModel15);  
785 -  
786 - //模版6  
787 - Map<String, dynamic> jsonSun16 = {  
788 - 'name': '6 无预订包间图片A(多色)',  
789 - 'id': '6',  
790 - 'url': 'https://qn.colorcun.com/template/shilvguodu-6.png',  
791 - };  
792 - ThemeSunModel themeSunModel16 = ThemeSunModel.fromJson(jsonSun16);  
793 - urls.add(themeSunModel16);  
794 -  
795 - //模版7  
796 - Map<String, dynamic> jsonSun17 = {  
797 - 'name': '7 无预订包间图片B',  
798 - 'id': '7',  
799 - 'url': 'https://qn.colorcun.com/template/shilvguodu-7.png',  
800 - };  
801 - ThemeSunModel themeSunModel17 = ThemeSunModel.fromJson(jsonSun17);  
802 - urls.add(themeSunModel17);  
803 -  
804 - Map<String, dynamic> json1 = {  
805 - 'color_name': '石绿过渡',  
806 - 'color_value_s': 'FF438E93',  
807 - 'color_value_m': 'FF206864',  
808 - 'color_value_e': 'FF42A5FF',  
809 - 'urls': urls  
810 - };  
811 -  
812 - ThemeModel themeModel1 = ThemeModel.fromJson(json1);  
813 - // themeDatas.add(themeModel1);  
814 - themeDatas['石绿过渡'] = themeModel1;  
815 - }  
816 -  
817 - _addZhongguohongguodu() {  
818 - List<ThemeSunModel> urls = [];  
819 - //模版3  
820 - Map<String, dynamic> jsonSun13 = {  
821 - 'name': '3 简洁信息图文A(多色)',  
822 - 'id': '3',  
823 - 'url': 'https://qn.colorcun.com/template/zhongguohongguodu-3.png',  
824 - };  
825 - ThemeSunModel themeSunModel13 = ThemeSunModel.fromJson(jsonSun13);  
826 - urls.add(themeSunModel13);  
827 - //模版4  
828 - Map<String, dynamic> jsonSun14 = {  
829 - 'name': '4 半屏邀请函A(多色)',  
830 - 'id': '4',  
831 - 'url': 'https://qn.colorcun.com/template/zhongguohongguodu-4.png',  
832 - };  
833 - ThemeSunModel themeSunModel14 = ThemeSunModel.fromJson(jsonSun14);  
834 - urls.add(themeSunModel14);  
835 -  
836 - //模版5  
837 - Map<String, dynamic> jsonSun15 = {  
838 - 'name': '5 半屏邀请函B(多色)',  
839 - 'id': '5',  
840 - 'url': 'https://qn.colorcun.com/template/zhongguohongguodu-5.png',  
841 - };  
842 - ThemeSunModel themeSunModel15 = ThemeSunModel.fromJson(jsonSun15);  
843 - urls.add(themeSunModel15);  
844 -  
845 - //模版6  
846 - Map<String, dynamic> jsonSun16 = {  
847 - 'name': '6 无预订包间图片A(多色)',  
848 - 'id': '6',  
849 - 'url': 'https://qn.colorcun.com/template/zhongguohongguodu-6.png',  
850 - };  
851 - ThemeSunModel themeSunModel16 = ThemeSunModel.fromJson(jsonSun16);  
852 - urls.add(themeSunModel16);  
853 -  
854 - //模版7  
855 - Map<String, dynamic> jsonSun17 = {  
856 - 'name': '7 无预订包间图片B',  
857 - 'id': '7',  
858 - 'url': 'https://qn.colorcun.com/template/zhongguohongguodu-7.png',  
859 - };  
860 - ThemeSunModel themeSunModel17 = ThemeSunModel.fromJson(jsonSun17);  
861 - urls.add(themeSunModel17);  
862 -  
863 - Map<String, dynamic> json1 = {  
864 - 'color_name': '中国红过渡',  
865 - 'color_value_s': 'FFAF231C',  
866 - 'color_value_m': 'FF86201B',  
867 - 'color_value_e': 'FFAF231C',  
868 - 'urls': urls  
869 - };  
870 -  
871 - ThemeModel themeModel1 = ThemeModel.fromJson(json1);  
872 - // themeDatas.add(themeModel1);  
873 - themeDatas['中国红过渡'] = themeModel1;  
874 - }  
875 -  
876 - _addQunqingguodu() {  
877 - List<ThemeSunModel> urls = [];  
878 - //模版3  
879 - Map<String, dynamic> jsonSun13 = {  
880 - 'name': '3 简洁信息图文A(多色)',  
881 - 'id': '3',  
882 - 'url': 'https://qn.colorcun.com/template/qunqingguodu-3.png',  
883 - };  
884 - ThemeSunModel themeSunModel13 = ThemeSunModel.fromJson(jsonSun13);  
885 - urls.add(themeSunModel13);  
886 - //模版4  
887 - Map<String, dynamic> jsonSun14 = {  
888 - 'name': '4 半屏邀请函A(多色)',  
889 - 'id': '4',  
890 - 'url': 'https://qn.colorcun.com/template/qunqingguodu-4.png',  
891 - };  
892 - ThemeSunModel themeSunModel14 = ThemeSunModel.fromJson(jsonSun14);  
893 - urls.add(themeSunModel14);  
894 -  
895 - //模版5  
896 - Map<String, dynamic> jsonSun15 = {  
897 - 'name': '5 半屏邀请函B(多色)',  
898 - 'id': '5',  
899 - 'url': 'https://qn.colorcun.com/template/qunqingguodu-5.png',  
900 - };  
901 - ThemeSunModel themeSunModel15 = ThemeSunModel.fromJson(jsonSun15);  
902 - urls.add(themeSunModel15);  
903 -  
904 - //模版6  
905 - Map<String, dynamic> jsonSun16 = {  
906 - 'name': '6 无预订包间图片A(多色)',  
907 - 'id': '6',  
908 - 'url': 'https://qn.colorcun.com/template/qunqingguodu-6.png',  
909 - };  
910 - ThemeSunModel themeSunModel16 = ThemeSunModel.fromJson(jsonSun16);  
911 - urls.add(themeSunModel16);  
912 -  
913 - //模版7  
914 - Map<String, dynamic> jsonSun17 = {  
915 - 'name': '7 无预订包间图片B',  
916 - 'id': '7',  
917 - 'url': 'https://qn.colorcun.com/template/qunqingguodu-7.png',  
918 - };  
919 - ThemeSunModel themeSunModel17 = ThemeSunModel.fromJson(jsonSun17);  
920 - urls.add(themeSunModel17);  
921 -  
922 - Map<String, dynamic> json1 = {  
923 - 'color_name': '群青过渡',  
924 - 'color_value_s': 'FF4C8DAD',  
925 - 'color_value_m': 'FF0143A3',  
926 - 'color_value_e': 'FF42A5FF',  
927 - 'urls': urls  
928 - };  
929 -  
930 - ThemeModel themeModel1 = ThemeModel.fromJson(json1);  
931 - // themeDatas.add(themeModel1);  
932 - themeDatas['群青过渡'] = themeModel1;  
933 - }  
934 -  
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);  
1032 - }  
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); 108 + setState(() {});
  109 + } else {
  110 + marketingCenterProvider.pageStateThemeHome =
  111 + PageState.ConnectivityError;
  112 + // if (!results[0]) {
  113 + // //没有优惠券
  114 + // } else {}
  115 + // if (!results[1]) {
  116 + // //没有营销中心数据
  117 + // } else {}
  118 + setState(() {});
  119 + }
  120 + }).catchError((e) {
  121 + print(e);
  122 + });
1266 } 123 }
1267 124
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); 125 + Future<bool> getSellerTemplateConf(BuildContext context) async {
  126 + bool success = await marketingCenterProvider.getSellerTemplateConf(context);
  127 + if (success &&
  128 + marketingCenterProvider.markDataModel != null &&
  129 + marketingCenterProvider.markDataModel.type != '') {
  130 + return true;
  131 + } else {
  132 + return false;
  133 + }
1383 } 134 }
1384 135
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); 136 + ///获取后台配置的模版数据
  137 + Future<bool> _getSellerTemplateColorList() async {
  138 + bool success =
  139 + await marketingCenterProvider.getSellerTemplateColorList(context);
  140 + if (success) {
  141 + return true;
  142 + }
  143 + return false;
1500 } 144 }
1501 145
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 -  
1641 _showPhotoView(BuildContext context, int index, List<String> imgs, 146 _showPhotoView(BuildContext context, int index, List<String> imgs,
1642 CustomCallBack callback, 147 CustomCallBack callback,
1643 {isShow = false, List dashName}) async { 148 {isShow = false, List dashName}) async {
@@ -1702,96 +207,112 @@ class _InvitationThemeHomePageState extends State<InvitationThemeHomePage> { @@ -1702,96 +207,112 @@ class _InvitationThemeHomePageState extends State<InvitationThemeHomePage> {
1702 207
1703 @override 208 @override
1704 Widget build(BuildContext context) { 209 Widget build(BuildContext context) {
  210 + marketingCenterProvider =
  211 + Provider.of<MarketingCenterProvider>(context, listen: true);
1705 return Scaffold( 212 return Scaffold(
1706 backgroundColor: MyColours.color_ffffff, 213 backgroundColor: MyColours.color_ffffff,
1707 appBar: SystemAppBar('客户通知设置'), 214 appBar: SystemAppBar('客户通知设置'),
1708 - body: Column(  
1709 - children: [  
1710 - Expanded(  
1711 - child: SingleChildScrollView(  
1712 - child: Column( 215 + body: Consumer<MarketingCenterProvider>(builder: (context1, model, _) {
  216 + if (model.pageStateThemeHome != PageState.Success) {
  217 + return ExceptionPage(
  218 + pageState: model.pageStateThemeHome,
  219 + callback: () async {},
  220 + emptyMsg: "暂时没有预订信息展示哦",
  221 + emptyImg: "empty_search",
  222 + showMsg: "加载中,请稍后...",
  223 + );
  224 + } else {
  225 + return Column(
1713 children: [ 226 children: [
1714 - VEmptyView(24),  
1715 - GridView.builder(  
1716 - padding: EdgeInsets.symmetric(horizontal: w(16)),  
1717 - controller: controller,  
1718 - // padding: EdgeInsets.only(top: ScreenUtil().getAdapterSize(10)),  
1719 - shrinkWrap: true,  
1720 - itemCount: themesDatas.length,  
1721 - //SliverGridDelegateWithFixedCrossAxisCount 构建一个横轴固定数量Widget  
1722 - gridDelegate: SliverGridDelegateWithFixedCrossAxisCount(  
1723 - //横轴元素个数  
1724 - crossAxisCount: 2,  
1725 - //纵轴间距  
1726 - mainAxisSpacing: w(15),  
1727 - //横轴间距  
1728 - crossAxisSpacing: w(15),  
1729 - //子组件宽高长度比例  
1730 - childAspectRatio:  
1731 - (ScreenUtil().screenWidth - w(62)) / 2 / 370),  
1732 - itemBuilder: (BuildContext context, int index) {  
1733 - ThemeSunModel themeSunModel = themesDatas[index];  
1734 - return InkWell(  
1735 - onTap: () {  
1736 - // _selectTheme(themeDatas[themeColor].urls[index].id);  
1737 - //跳转到下一页  
1738 - NavigatorUtil.goInvitationThemeHomePreviewPage(  
1739 - context, themeSunModel);  
1740 - },  
1741 - child: Container(  
1742 - decoration: BoxDecoration(  
1743 - borderRadius: BorderRadius.circular(r(10)),  
1744 - border: Border.all(  
1745 - color: themeType == themeSunModel.id  
1746 - ? MyColours.color_005AA7  
1747 - : MyColours.color_DBDBDB,  
1748 - width: themeType == themeSunModel.id  
1749 - ? w(2)  
1750 - : w(1))),  
1751 - child: Column(  
1752 - children: [  
1753 - VEmptyView(10),  
1754 - CachedNetworkImage(  
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,  
1767 - width: (ScreenUtil().screenWidth - w(62)) / 2,  
1768 - height: w(348),  
1769 - fit: BoxFit.fitWidth,  
1770 - alignment: Alignment.topCenter, 227 + Expanded(
  228 + child: SingleChildScrollView(
  229 + child: Column(
  230 + children: [
  231 + VEmptyView(24),
  232 + GridView.builder(
  233 + padding: EdgeInsets.symmetric(horizontal: w(16)),
  234 + controller: controller,
  235 + // padding: EdgeInsets.only(top: ScreenUtil().getAdapterSize(10)),
  236 + shrinkWrap: true,
  237 + itemCount: marketingCenterProvider.templeteDatas.length,
  238 + //SliverGridDelegateWithFixedCrossAxisCount 构建一个横轴固定数量Widget
  239 + gridDelegate: SliverGridDelegateWithFixedCrossAxisCount(
  240 + //横轴元素个数
  241 + crossAxisCount: 2,
  242 + //纵轴间距
  243 + mainAxisSpacing: w(15),
  244 + //横轴间距
  245 + crossAxisSpacing: w(15),
  246 + //子组件宽高长度比例
  247 + childAspectRatio:
  248 + (ScreenUtil().screenWidth - w(62)) / 2 / 370),
  249 + itemBuilder: (BuildContext context, int index) {
  250 + SellerTemplateColorListSunModel themeSunModel =
  251 + marketingCenterProvider.templeteDatas[index];
  252 + return InkWell(
  253 + onTap: () {
  254 + // _selectTheme(themeDatas[themeColor].urls[index].id);
  255 + //跳转到下一页
  256 + NavigatorUtil.goInvitationThemeHomePreviewPage(
  257 + context, themeSunModel);
  258 + },
  259 + child: Container(
  260 + decoration: BoxDecoration(
  261 + borderRadius: BorderRadius.circular(r(10)),
  262 + border: Border.all(
  263 + color: themeType == themeSunModel.id
  264 + ? MyColours.color_005AA7
  265 + : MyColours.color_DBDBDB,
  266 + width: themeType == themeSunModel.id
  267 + ? w(2)
  268 + : w(1))),
  269 + child: Column(
  270 + children: [
  271 + VEmptyView(10),
  272 + CachedNetworkImage(
  273 + imageUrl: themeSunModel.colors == null ||
  274 + themeSunModel.colors.length == 0
  275 + ? themeSunModel.url
  276 + : themeSunModel
  277 + .colors[themeColor == null
  278 + ? 0
  279 + : themeSunModel.colors
  280 + .indexWhere((element) =>
  281 + element.colorName ==
  282 + themeSunModel
  283 + .themeColorDefault)]
  284 + .url,
  285 + width:
  286 + (ScreenUtil().screenWidth - w(62)) / 2,
  287 + height: w(348),
  288 + fit: BoxFit.fitWidth,
  289 + alignment: Alignment.topCenter,
  290 + ),
  291 + VEmptyView(20),
  292 + Container(
  293 + padding: EdgeInsets.symmetric(
  294 + vertical: w(6), horizontal: w(2)),
  295 + width: double.infinity,
  296 + child: Text(
  297 + themeSunModel.templateName,
  298 + maxLines: 1,
  299 + overflow: TextOverflow.ellipsis,
  300 + textAlign: TextAlign.left,
  301 + style: TextStyle(
  302 + color: MyColours.color_000000,
  303 + fontSize: font(14)),
  304 + ),
  305 + )
  306 + ],
1771 ), 307 ),
1772 - VEmptyView(20),  
1773 - Container(  
1774 - padding: EdgeInsets.symmetric(  
1775 - vertical: w(6), horizontal: w(2)),  
1776 - width: double.infinity,  
1777 - child: Text(  
1778 - themeSunModel.name,  
1779 - maxLines: 1,  
1780 - overflow: TextOverflow.ellipsis,  
1781 - textAlign: TextAlign.left,  
1782 - style: TextStyle(  
1783 - color: MyColours.color_000000,  
1784 - fontSize: font(14)),  
1785 - ),  
1786 - )  
1787 - ],  
1788 - ),  
1789 - ));  
1790 - }), 308 + ));
  309 + }),
  310 + ],
  311 + )))
1791 ], 312 ],
1792 - )))  
1793 - ],  
1794 - ), 313 + );
  314 + }
  315 + }),
1795 ); 316 );
1796 } 317 }
1797 } 318 }
@@ -4,7 +4,11 @@ import 'package:flutter_screenutil/flutter_screenutil.dart'; @@ -4,7 +4,11 @@ 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/widgets/system_app_bar.dart'; 5 import 'package:one_key/widgets/system_app_bar.dart';
6 import 'package:one_key/widgets/v_empty_view.dart'; 6 import 'package:one_key/widgets/v_empty_view.dart';
  7 +import 'package:provider/provider.dart';
7 8
  9 +import '../../../models/seller_template_color_list_model.dart';
  10 +import '../../../provider/marketing_center_provider.dart';
  11 +import '../../../provider/user_model.dart';
8 import '../../../res/colors.dart'; 12 import '../../../res/colors.dart';
9 import '../../../utils/dialog_util.dart'; 13 import '../../../utils/dialog_util.dart';
10 import '../../../utils/event_bus.dart'; 14 import '../../../utils/event_bus.dart';
@@ -22,7 +26,7 @@ import 'dart:convert' as convert; @@ -22,7 +26,7 @@ import 'dart:convert' as convert;
22 */ 26 */
23 27
24 class InvitationThemeHomePreviewPage extends StatefulWidget { 28 class InvitationThemeHomePreviewPage extends StatefulWidget {
25 - final ThemeSunModel themeSunModel; 29 + final SellerTemplateColorListSunModel themeSunModel;
26 InvitationThemeHomePreviewPage({Key key, this.themeSunModel}) 30 InvitationThemeHomePreviewPage({Key key, this.themeSunModel})
27 : super(key: key); 31 : super(key: key);
28 32
@@ -33,6 +37,7 @@ class InvitationThemeHomePreviewPage extends StatefulWidget { @@ -33,6 +37,7 @@ class InvitationThemeHomePreviewPage extends StatefulWidget {
33 37
34 class _InvitationThemeHomePreviewPageState 38 class _InvitationThemeHomePreviewPageState
35 extends State<InvitationThemeHomePreviewPage> { 39 extends State<InvitationThemeHomePreviewPage> {
  40 + MarketingCenterProvider marketingCenterProvider;
36 ScrollController controller = ScrollController(); 41 ScrollController controller = ScrollController();
37 42
38 //当前店铺选中的颜色和板式 43 //当前店铺选中的颜色和板式
@@ -46,11 +51,20 @@ class _InvitationThemeHomePreviewPageState @@ -46,11 +51,20 @@ class _InvitationThemeHomePreviewPageState
46 @override 51 @override
47 void initState() { 52 void initState() {
48 super.initState(); 53 super.initState();
49 - if (widget.themeSunModel.colors.length > 0) {  
50 - themeColor = widget.themeSunModel.colors[0].colorName;  
51 - url = widget.themeSunModel.colors[0].url; 54 + if (widget.themeSunModel.themeColorDefault != null) {
  55 + themeColor = widget.themeSunModel.themeColorDefault;
  56 + url = widget
  57 + .themeSunModel
  58 + .colors[widget.themeSunModel.colors
  59 + .indexWhere((element) => element.colorName == themeColor)]
  60 + .url;
52 } else { 61 } else {
53 - url = widget.themeSunModel.url; 62 + if (widget.themeSunModel.colors.length > 0) {
  63 + themeColor = widget.themeSunModel.colors[0].colorName;
  64 + url = widget.themeSunModel.colors[0].url;
  65 + } else {
  66 + url = widget.themeSunModel.url;
  67 + }
54 } 68 }
55 69
56 themeType = widget.themeSunModel.id; 70 themeType = widget.themeSunModel.id;
@@ -141,6 +155,8 @@ class _InvitationThemeHomePreviewPageState @@ -141,6 +155,8 @@ class _InvitationThemeHomePreviewPageState
141 155
142 @override 156 @override
143 Widget build(BuildContext context) { 157 Widget build(BuildContext context) {
  158 + marketingCenterProvider =
  159 + Provider.of<MarketingCenterProvider>(context, listen: true);
144 return Scaffold( 160 return Scaffold(
145 backgroundColor: MyColours.color_ffffff, 161 backgroundColor: MyColours.color_ffffff,
146 appBar: SystemAppBar('客户通知设置'), 162 appBar: SystemAppBar('客户通知设置'),
@@ -247,13 +263,34 @@ class _InvitationThemeHomePreviewPageState @@ -247,13 +263,34 @@ class _InvitationThemeHomePreviewPageState
247 padding: EdgeInsets.only( 263 padding: EdgeInsets.only(
248 top: w(12), bottom: w(25), left: w(45), right: w(45)), 264 top: w(12), bottom: w(25), left: w(45), right: w(45)),
249 child: RoundButton( 265 child: RoundButton(
250 - onPressed: () {  
251 - //选择当前模版+主题色  
252 - bus.emit('theme_color_type', {  
253 - 'themeColor': themeColor,  
254 - 'themeType': themeType,  
255 - });  
256 - Navigator.pop(context); 266 + onPressed: () async {
  267 + //接口成功后刷新并返回前一页
  268 + //接口
  269 +
  270 + Map<String, String> params = {
  271 + 'sid': Provider.of<UserModel>(context, listen: false)
  272 + .user
  273 + .sellerid,
  274 + 'type': themeType,
  275 + 'lite_class': widget
  276 + .themeSunModel
  277 + .colors[widget.themeSunModel.colors.indexWhere(
  278 + (element) => element.colorName == themeColor)]
  279 + .liteClass
  280 + };
  281 +
  282 + bool success = await marketingCenterProvider
  283 + .setSellerTemplateConf(context, params,
  284 + showLoading: true);
  285 + if (success) {
  286 + Utils.showToast('设置成功');
  287 + //选择当前模版+主题色
  288 + bus.emit('theme_color_type', {
  289 + 'themeColor': themeColor,
  290 + 'themeType': themeType,
  291 + });
  292 + Navigator.pop(context);
  293 + }
257 }, 294 },
258 text: '确定', 295 text: '确定',
259 fontSize: 32, 296 fontSize: 32,
@@ -35,12 +35,16 @@ class _MarketingCenterHomePageState extends State<MarketingCenterHomePage> { @@ -35,12 +35,16 @@ class _MarketingCenterHomePageState extends State<MarketingCenterHomePage> {
35 // bool selectShowPrice = true; //分享排菜单给客户时展示菜品价格 35 // bool selectShowPrice = true; //分享排菜单给客户时展示菜品价格
36 CollectStoreProvider collectStoreProvider; 36 CollectStoreProvider collectStoreProvider;
37 37
  38 +
  39 +
38 @override 40 @override
39 void initState() { 41 void initState() {
40 super.initState(); 42 super.initState();
41 43
42 WidgetsBinding.instance.addPostFrameCallback((_) { 44 WidgetsBinding.instance.addPostFrameCallback((_) {
43 getSellerVersion(); 45 getSellerVersion();
  46 +
  47 +
44 }); 48 });
45 } 49 }
46 50
@@ -147,6 +151,7 @@ class _MarketingCenterHomePageState extends State<MarketingCenterHomePage> { @@ -147,6 +151,7 @@ class _MarketingCenterHomePageState extends State<MarketingCenterHomePage> {
147 @override 151 @override
148 void dispose() { 152 void dispose() {
149 EventBus().emit('changeStatusColor'); 153 EventBus().emit('changeStatusColor');
  154 +
150 super.dispose(); 155 super.dispose();
151 } 156 }
152 157
@@ -9,6 +9,7 @@ import '../constant/error.dart'; @@ -9,6 +9,7 @@ import '../constant/error.dart';
9 import '../models/GetDzSellerConfModel.dart'; 9 import '../models/GetDzSellerConfModel.dart';
10 import '../models/mark_data_model.dart'; 10 import '../models/mark_data_model.dart';
11 import '../models/recharge_notice_model.dart'; 11 import '../models/recharge_notice_model.dart';
  12 +import '../models/seller_template_color_list_model.dart';
12 import '../models/tableOuter.dart'; 13 import '../models/tableOuter.dart';
13 import '../net/base_resp.dart'; 14 import '../net/base_resp.dart';
14 import '../net/dio_util.dart'; 15 import '../net/dio_util.dart';
@@ -22,7 +23,9 @@ class MarketingCenterProvider extends ChangeNotifier { @@ -22,7 +23,9 @@ class MarketingCenterProvider extends ChangeNotifier {
22 23
23 PageState pageState = PageState.Loading; 24 PageState pageState = PageState.Loading;
24 PageState pageStateRechargeHome = PageState.Loading; 25 PageState pageStateRechargeHome = PageState.Loading;
25 - PageState pageStateBookInfo = PageState.Loading; 26 + PageState pageStateBookInfo = PageState.Loading;
  27 + PageState pageStateThemeHome = PageState.Loading;
  28 +
26 29
27 List<RechargeListSunModel> rechargeList = []; 30 List<RechargeListSunModel> rechargeList = [];
28 31
@@ -37,6 +40,7 @@ class MarketingCenterProvider extends ChangeNotifier { @@ -37,6 +40,7 @@ class MarketingCenterProvider extends ChangeNotifier {
37 40
38 RechargeNoticeSunModel rechargeNoticeSunModel; 41 RechargeNoticeSunModel rechargeNoticeSunModel;
39 GetDzSellerConfSunModel dzSellerConfModel; 42 GetDzSellerConfSunModel dzSellerConfModel;
  43 + List<SellerTemplateColorListSunModel> templeteDatas = []; //后台配置的模版数据
40 44
41 //获取桌位列表 45 //获取桌位列表
42 getTableList(context, {needLoading = true}) async { 46 getTableList(context, {needLoading = true}) async {
@@ -72,6 +76,33 @@ class MarketingCenterProvider extends ChangeNotifier { @@ -72,6 +76,33 @@ class MarketingCenterProvider extends ChangeNotifier {
72 return false; 76 return false;
73 } 77 }
74 78
  79 + // 模板/颜色配置信息
  80 +
  81 + Future<bool> getSellerTemplateColorList(BuildContext context,
  82 + {bool showLoading = true}) async {
  83 + Map<String, String> params = {
  84 + 'sid': Provider.of<UserModel>(context, listen: false).user.sellerid
  85 + };
  86 + BaseResp<dynamic> baseResp = await DioUtil()
  87 + .request<dynamic>(
  88 + context, Method.get, HttpUrl.get_seller_template_color_list,
  89 + data: params, showLoading: showLoading)
  90 + .catchError((error) {
  91 + print(error.toString());
  92 + Utils.showToast('请求失败,请重试');
  93 + return false;
  94 + });
  95 + if (baseResp.code == Constant.status_success) {
  96 + templeteDatas =
  97 + SellerTemplateColorListModel.fromJson(baseResp.responseData).data;
  98 + notifyListeners();
  99 + return true;
  100 + } else {
  101 + Utils.showToast(baseResp.msg ?? '请求失败,请重试');
  102 + }
  103 + return false;
  104 + }
  105 +
75 // 商家设置预订安排模板页面 106 // 商家设置预订安排模板页面
76 Future<bool> setSellerTemplateConf( 107 Future<bool> setSellerTemplateConf(
77 BuildContext context, Map<String, String> params, 108 BuildContext context, Map<String, String> params,
@@ -36,6 +36,7 @@ import '../models/out_wine_record_model.dart'; @@ -36,6 +36,7 @@ import '../models/out_wine_record_model.dart';
36 import '../models/plan_cook_by_rid_model.dart'; 36 import '../models/plan_cook_by_rid_model.dart';
37 import '../models/plan_cook_list_model.dart'; 37 import '../models/plan_cook_list_model.dart';
38 import '../models/recharge_list_model.dart'; 38 import '../models/recharge_list_model.dart';
  39 +import '../models/seller_template_color_list_model.dart';
39 import '../models/set_xuan_tai_model.dart'; 40 import '../models/set_xuan_tai_model.dart';
40 import '../models/setmeal_by_id_model.dart'; 41 import '../models/setmeal_by_id_model.dart';
41 import '../models/setmeal_model.dart'; 42 import '../models/setmeal_model.dart';
@@ -1841,7 +1842,7 @@ class NavigatorUtil { @@ -1841,7 +1842,7 @@ class NavigatorUtil {
1841 /// 邀请函主题选择预览 1842 /// 邀请函主题选择预览
1842 static Future<dynamic> goInvitationThemeHomePreviewPage( 1843 static Future<dynamic> goInvitationThemeHomePreviewPage(
1843 BuildContext context, 1844 BuildContext context,
1844 - ThemeSunModel themeSunModel, { 1845 + SellerTemplateColorListSunModel themeSunModel, {
1845 replace = false, 1846 replace = false,
1846 }) { 1847 }) {
1847 return _navigateTo(context, 1848 return _navigateTo(context,
@@ -160,6 +160,7 @@ import '../models/month_statics_model.dart'; @@ -160,6 +160,7 @@ import '../models/month_statics_model.dart';
160 import '../models/out_wine_record_model.dart'; 160 import '../models/out_wine_record_model.dart';
161 import '../models/plan_cook_by_rid_model.dart'; 161 import '../models/plan_cook_by_rid_model.dart';
162 import '../models/plan_cook_list_model.dart'; 162 import '../models/plan_cook_list_model.dart';
  163 +import '../models/seller_template_color_list_model.dart';
163 import '../models/set_xuan_tai_model.dart'; 164 import '../models/set_xuan_tai_model.dart';
164 import '../models/setmeal_by_id_model.dart'; 165 import '../models/setmeal_by_id_model.dart';
165 import '../models/setmeal_model.dart'; 166 import '../models/setmeal_model.dart';
@@ -3123,10 +3124,12 @@ var invitationThemeHomePreviewPage = new Handler( @@ -3123,10 +3124,12 @@ var invitationThemeHomePreviewPage = new Handler(
3123 // String day = params["day"].first; 3124 // String day = params["day"].first;
3124 // String uid = params["uid"].first; 3125 // String uid = params["uid"].first;
3125 3126
3126 - ThemeSunModel themeSunModel = ThemeSunModel.fromJson(json  
3127 - .decode(FluroConvertUtils.fluroCnParamsDecode(params["themeSunModel"].first))); 3127 + SellerTemplateColorListSunModel themeSunModel =
  3128 + SellerTemplateColorListSunModel.fromJson(json.decode(
  3129 + FluroConvertUtils.fluroCnParamsDecode(
  3130 + params["themeSunModel"].first)));
3128 3131
3129 return ChangeNotifierProvider<MarketingCenterProvider>( 3132 return ChangeNotifierProvider<MarketingCenterProvider>(
3130 create: (_) => MarketingCenterProvider(), 3133 create: (_) => MarketingCenterProvider(),
3131 - child: InvitationThemeHomePreviewPage(themeSunModel:themeSunModel)); 3134 + child: InvitationThemeHomePreviewPage(themeSunModel: themeSunModel));
3132 }); 3135 });
@@ -38,6 +38,7 @@ import 'package:url_launcher/url_launcher.dart'; @@ -38,6 +38,7 @@ import 'package:url_launcher/url_launcher.dart';
38 38
39 import '../models/cookbook_model.dart'; 39 import '../models/cookbook_model.dart';
40 import '../models/radio_model.dart'; 40 import '../models/radio_model.dart';
  41 +import '../models/seller_template_color_list_model.dart';
41 import '../models/seller_version_model.dart'; 42 import '../models/seller_version_model.dart';
42 import '../models/theme_color_model.dart'; 43 import '../models/theme_color_model.dart';
43 import '../pages/my/marketing_center/theme_model.dart'; 44 import '../pages/my/marketing_center/theme_model.dart';
@@ -6281,7 +6282,7 @@ class DialogUtil { @@ -6281,7 +6282,7 @@ class DialogUtil {
6281 6282
6282 //主题颜色选择弹框 6283 //主题颜色选择弹框
6283 static showThemeColorSelectDialogNew( 6284 static showThemeColorSelectDialogNew(
6284 - BuildContext context, List<ThemeModel> themeShow, 6285 + BuildContext context, List<ColorListModel> themeShow,
6285 {CustomCallBack callback}) { 6286 {CustomCallBack callback}) {
6286 ScrollController controller = ScrollController(); 6287 ScrollController controller = ScrollController();
6287 return showModalBottomSheet( 6288 return showModalBottomSheet(