Commit 93ffde6bb4038b759bb9fe963a36f407947baa5b

Authored by wdn127929
1 parent 4779ef0c

主题选择本地数据

@@ -47,7 +47,7 @@ class SellerVersionSunModel { @@ -47,7 +47,7 @@ class SellerVersionSunModel {
47 this.edate, 47 this.edate,
48 this.cdate}); 48 this.cdate});
49 49
50 - SellerVersionSunModel.fromJson(Map<String, dynamic> json) { 50 + SellerVersionSunModel.fromJson(Map<String, dynamic> json){
51 id = json['id']; 51 id = json['id'];
52 sid = json['sid']; 52 sid = json['sid'];
53 vid = json['vid']; 53 vid = json['vid'];
@@ -58,7 +58,7 @@ class SellerVersionSunModel { @@ -58,7 +58,7 @@ class SellerVersionSunModel {
58 // edate = json['vid'] == '4' ? '1695005146' : '1694832346'; 58 // edate = json['vid'] == '4' ? '1695005146' : '1694832346';
59 edate = json['edate']; 59 edate = json['edate'];
60 cdate = json['cdate']; 60 cdate = json['cdate'];
61 - } 61 + }
62 62
63 Map<String, dynamic> toJson() { 63 Map<String, dynamic> toJson() {
64 final Map<String, dynamic> data = new Map<String, dynamic>(); 64 final Map<String, dynamic> data = new Map<String, dynamic>();
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/pages/my/marketing_center/theme_model.dart';
4 import 'package:one_key/widgets/system_app_bar.dart'; 5 import 'package:one_key/widgets/system_app_bar.dart';
5 import 'package:one_key/widgets/v_empty_view.dart'; 6 import 'package:one_key/widgets/v_empty_view.dart';
6 7
7 import '../../../res/colors.dart'; 8 import '../../../res/colors.dart';
  9 +import '../../../utils/dialog_util.dart';
8 import '../../../utils/screen_util.dart'; 10 import '../../../utils/screen_util.dart';
9 import '../../../utils/utils.dart'; 11 import '../../../utils/utils.dart';
10 import '../../../widgets/MyDivider.dart'; 12 import '../../../widgets/MyDivider.dart';
11 import '../../online_check/photo_view_wiget.dart'; 13 import '../../online_check/photo_view_wiget.dart';
12 14
  15 +import 'dart:convert' as convert;
  16 +
13 /** 17 /**
14 * 18 *
15 * 邀请函主题选择页面 19 * 邀请函主题选择页面
@@ -24,8 +28,928 @@ class InvitationThemeHomePage extends StatefulWidget { @@ -24,8 +28,928 @@ class InvitationThemeHomePage extends StatefulWidget {
24 } 28 }
25 29
26 class _InvitationThemeHomePageState extends State<InvitationThemeHomePage> { 30 class _InvitationThemeHomePageState extends State<InvitationThemeHomePage> {
  31 + // 主题数据
  32 + Map<String, ThemeModel> themeDatas = {};
  33 +
27 ScrollController controller = ScrollController(); 34 ScrollController controller = ScrollController();
28 35
  36 + //当前店铺选中的颜色和板式
  37 +
  38 + String themeColor = '摩洛哥蓝';
  39 + String themeType = '4';
  40 + int indexSelect = 0; //选中第几个模版
  41 +
  42 + List<ThemeSunModel> themeDatasno = [];
  43 +
  44 + @override
  45 + void initState() {
  46 + super.initState();
  47 +
  48 + // //模版1
  49 + Map<String, dynamic> jsonSun11 = {
  50 + 'name': '1 经典图片式',
  51 + 'id': '1',
  52 + 'url': 'https://qn.colorcun.com/template/jingdianbianyi.png',
  53 + };
  54 + ThemeSunModel themeSunModel11 = ThemeSunModel.fromJson(jsonSun11);
  55 + themeDatasno.add(themeSunModel11);
  56 +
  57 + //黑蓝过度
  58 + _addHeilanguodu();
  59 +
  60 + //石绿过度
  61 + _addShilvuodu();
  62 +
  63 + //中国红过度
  64 + _addZhongguohongguodu();
  65 +
  66 + //群青过度
  67 + _addQunqingguodu();
  68 +
  69 + //深中国红
  70 + _addShenzhongguohong();
  71 +
  72 + //中国红
  73 + _addZhongguohong();
  74 +
  75 + //蓝采和
  76 + _addLancaihe();
  77 +
  78 + //石绿
  79 + _addShilv();
  80 +
  81 + //姜黄
  82 + _addJianghuang();
  83 +
  84 + //金黄
  85 + _addJinhuang();
  86 +
  87 + //苍黄
  88 + _addCanghuang();
  89 +
  90 + //群青
  91 + _addQunqing();
  92 +
  93 + //摩洛哥蓝
  94 + _addMoluogelan();
  95 +
  96 + print(themeDatas);
  97 +
  98 + Map<String, String> map = {
  99 + 'color': convert.jsonEncode(themeDatas),
  100 + 'no_color': convert.jsonEncode(themeDatasno)
  101 + };
  102 + print(map);
  103 + }
  104 +
  105 + _addMoluogelan() {
  106 + List<ThemeSunModel> urls = [];
  107 +
  108 + // //模版1
  109 + // Map<String, dynamic> jsonSun11 = {
  110 + // 'name': '1 经典图片式',
  111 + // 'id': '1',
  112 + // 'url': 'https://qn.colorcun.com/template/jingdianbianyi.png',
  113 + // };
  114 + // ThemeSunModel themeSunModel11 = ThemeSunModel.fromJson(jsonSun11);
  115 + // urls.add(themeSunModel11);
  116 +
  117 + //模版2
  118 + Map<String, dynamic> jsonSun12 = {
  119 + 'name': '2 简洁图文A(多色)',
  120 + 'id': '2',
  121 + 'url': 'https://qn.colorcun.com/template/moluogelan-2.png',
  122 + };
  123 + ThemeSunModel themeSunModel12 = ThemeSunModel.fromJson(jsonSun12);
  124 + urls.add(themeSunModel12);
  125 + //模版3
  126 + Map<String, dynamic> jsonSun13 = {
  127 + 'name': '3 简洁信息图文A(多色)',
  128 + 'id': '3',
  129 + 'url': 'https://qn.colorcun.com/template/moluogelan-3.png',
  130 + };
  131 + ThemeSunModel themeSunModel13 = ThemeSunModel.fromJson(jsonSun13);
  132 + urls.add(themeSunModel13);
  133 + //模版4
  134 + Map<String, dynamic> jsonSun14 = {
  135 + 'name': '4 半屏邀请函A(多色)',
  136 + 'id': '4',
  137 + 'url': 'https://qn.colorcun.com/template/moluogelan-4.png',
  138 + };
  139 + ThemeSunModel themeSunModel14 = ThemeSunModel.fromJson(jsonSun14);
  140 + urls.add(themeSunModel14);
  141 +
  142 + //模版5
  143 + Map<String, dynamic> jsonSun15 = {
  144 + 'name': '5 半屏邀请函B(多色)',
  145 + 'id': '5',
  146 + 'url': 'https://qn.colorcun.com/template/moluogelan-5.png',
  147 + };
  148 + ThemeSunModel themeSunModel15 = ThemeSunModel.fromJson(jsonSun15);
  149 + urls.add(themeSunModel15);
  150 +
  151 + //模版6
  152 + Map<String, dynamic> jsonSun16 = {
  153 + 'name': '6 无预订包间图片A(多色)',
  154 + 'id': '6',
  155 + 'url': 'https://qn.colorcun.com/template/moluogelan-6.png',
  156 + };
  157 + ThemeSunModel themeSunModel16 = ThemeSunModel.fromJson(jsonSun16);
  158 + urls.add(themeSunModel16);
  159 +
  160 + //模版7
  161 + Map<String, dynamic> jsonSun17 = {
  162 + 'name': '7 无预订包间图片B',
  163 + 'id': '7',
  164 + 'url': 'https://qn.colorcun.com/template/moluogelan-7.png',
  165 + };
  166 + ThemeSunModel themeSunModel17 = ThemeSunModel.fromJson(jsonSun17);
  167 + urls.add(themeSunModel17);
  168 +
  169 + Map<String, dynamic> json1 = {
  170 + 'color_name': '摩洛哥蓝',
  171 + 'color_value_s': 'FF19516A',
  172 + 'color_value_m': 'FF19516A',
  173 + 'color_value_e': 'FF19516A',
  174 + 'urls': urls
  175 + };
  176 +
  177 + ThemeModel themeModel1 = ThemeModel.fromJson(json1);
  178 + // themeDatas.add(themeModel1);
  179 + themeDatas['摩洛哥蓝'] = themeModel1;
  180 + }
  181 +
  182 + _addQunqing() {
  183 + List<ThemeSunModel> urls = [];
  184 + //模版2
  185 + Map<String, dynamic> jsonSun12 = {
  186 + 'name': '2 简洁图文A(多色)',
  187 + 'id': '2',
  188 + 'url': 'https://qn.colorcun.com/template/qunqing-2.png',
  189 + };
  190 + ThemeSunModel themeSunModel12 = ThemeSunModel.fromJson(jsonSun12);
  191 + urls.add(themeSunModel12);
  192 + //模版3
  193 + Map<String, dynamic> jsonSun13 = {
  194 + 'name': '3 简洁信息图文A(多色)',
  195 + 'id': '3',
  196 + 'url': 'https://qn.colorcun.com/template/qunqing-3.png',
  197 + };
  198 + ThemeSunModel themeSunModel13 = ThemeSunModel.fromJson(jsonSun13);
  199 + urls.add(themeSunModel13);
  200 + //模版4
  201 + Map<String, dynamic> jsonSun14 = {
  202 + 'name': '4 半屏邀请函A(多色)',
  203 + 'id': '4',
  204 + 'url': 'https://qn.colorcun.com/template/qunqing-4.png',
  205 + };
  206 + ThemeSunModel themeSunModel14 = ThemeSunModel.fromJson(jsonSun14);
  207 + urls.add(themeSunModel14);
  208 +
  209 + //模版5
  210 + Map<String, dynamic> jsonSun15 = {
  211 + 'name': '5 半屏邀请函B(多色)',
  212 + 'id': '5',
  213 + 'url': 'https://qn.colorcun.com/template/qunqing-5.png',
  214 + };
  215 + ThemeSunModel themeSunModel15 = ThemeSunModel.fromJson(jsonSun15);
  216 + urls.add(themeSunModel15);
  217 +
  218 + //模版6
  219 + Map<String, dynamic> jsonSun16 = {
  220 + 'name': '6 无预订包间图片A(多色)',
  221 + 'id': '6',
  222 + 'url': 'https://qn.colorcun.com/template/qunqing-6.png',
  223 + };
  224 + ThemeSunModel themeSunModel16 = ThemeSunModel.fromJson(jsonSun16);
  225 + urls.add(themeSunModel16);
  226 +
  227 + //模版7
  228 + Map<String, dynamic> jsonSun17 = {
  229 + 'name': '7 无预订包间图片B',
  230 + 'id': '7',
  231 + 'url': 'https://qn.colorcun.com/template/qunqing-7.png',
  232 + };
  233 + ThemeSunModel themeSunModel17 = ThemeSunModel.fromJson(jsonSun17);
  234 + urls.add(themeSunModel17);
  235 +
  236 + Map<String, dynamic> json1 = {
  237 + 'color_name': '群青',
  238 + 'color_value_s': 'FF0143A3',
  239 + 'color_value_m': 'FF0143A3',
  240 + 'color_value_e': 'FF0143A3',
  241 + 'urls': urls
  242 + };
  243 +
  244 + ThemeModel themeModel1 = ThemeModel.fromJson(json1);
  245 + // themeDatas.add(themeModel1);
  246 + themeDatas['群青'] = themeModel1;
  247 + }
  248 +
  249 + _addCanghuang() {
  250 + List<ThemeSunModel> urls = [];
  251 + //模版2
  252 + Map<String, dynamic> jsonSun12 = {
  253 + 'name': '2 简洁图文A(多色)',
  254 + 'id': '2',
  255 + 'url': 'https://qn.colorcun.com/template/canghuang-2.png',
  256 + };
  257 + ThemeSunModel themeSunModel12 = ThemeSunModel.fromJson(jsonSun12);
  258 + urls.add(themeSunModel12);
  259 + //模版3
  260 + Map<String, dynamic> jsonSun13 = {
  261 + 'name': '3 简洁信息图文A(多色)',
  262 + 'id': '3',
  263 + 'url': 'https://qn.colorcun.com/template/canghuang-3.png',
  264 + };
  265 + ThemeSunModel themeSunModel13 = ThemeSunModel.fromJson(jsonSun13);
  266 + urls.add(themeSunModel13);
  267 + //模版4
  268 + Map<String, dynamic> jsonSun14 = {
  269 + 'name': '4 半屏邀请函A(多色)',
  270 + 'id': '4',
  271 + 'url': 'https://qn.colorcun.com/template/canghuang-4.png',
  272 + };
  273 + ThemeSunModel themeSunModel14 = ThemeSunModel.fromJson(jsonSun14);
  274 + urls.add(themeSunModel14);
  275 +
  276 + //模版5
  277 + Map<String, dynamic> jsonSun15 = {
  278 + 'name': '5 半屏邀请函B(多色)',
  279 + 'id': '5',
  280 + 'url': 'https://qn.colorcun.com/template/canghuang-5.png',
  281 + };
  282 + ThemeSunModel themeSunModel15 = ThemeSunModel.fromJson(jsonSun15);
  283 + urls.add(themeSunModel15);
  284 +
  285 + //模版6
  286 + Map<String, dynamic> jsonSun16 = {
  287 + 'name': '6 无预订包间图片A(多色)',
  288 + 'id': '6',
  289 + 'url': 'https://qn.colorcun.com/template/canghuang-6.png',
  290 + };
  291 + ThemeSunModel themeSunModel16 = ThemeSunModel.fromJson(jsonSun16);
  292 + urls.add(themeSunModel16);
  293 +
  294 + //模版7
  295 + Map<String, dynamic> jsonSun17 = {
  296 + 'name': '7 无预订包间图片B',
  297 + 'id': '7',
  298 + 'url': 'https://qn.colorcun.com/template/canghuang-7.png',
  299 + };
  300 + ThemeSunModel themeSunModel17 = ThemeSunModel.fromJson(jsonSun17);
  301 + urls.add(themeSunModel17);
  302 +
  303 + Map<String, dynamic> json1 = {
  304 + 'color_name': '苍黄',
  305 + 'color_value_s': 'FFC85306',
  306 + 'color_value_m': 'FFC85306',
  307 + 'color_value_e': 'FFC85306',
  308 + 'urls': urls
  309 + };
  310 +
  311 + ThemeModel themeModel1 = ThemeModel.fromJson(json1);
  312 + // themeDatas.add(themeModel1);
  313 + themeDatas['苍黄'] = themeModel1;
  314 + }
  315 +
  316 + _addJinhuang() {
  317 + List<ThemeSunModel> urls = [];
  318 + //模版2
  319 + Map<String, dynamic> jsonSun12 = {
  320 + 'name': '2 简洁图文A(多色)',
  321 + 'id': '2',
  322 + 'url': 'https://qn.colorcun.com/template/jinhuang-2.png',
  323 + };
  324 + ThemeSunModel themeSunModel12 = ThemeSunModel.fromJson(jsonSun12);
  325 + urls.add(themeSunModel12);
  326 + //模版3
  327 + Map<String, dynamic> jsonSun13 = {
  328 + 'name': '3 简洁信息图文A(多色)',
  329 + 'id': '3',
  330 + 'url': 'https://qn.colorcun.com/template/jinhuang-3.png',
  331 + };
  332 + ThemeSunModel themeSunModel13 = ThemeSunModel.fromJson(jsonSun13);
  333 + urls.add(themeSunModel13);
  334 + //模版4
  335 + Map<String, dynamic> jsonSun14 = {
  336 + 'name': '4 半屏邀请函A(多色)',
  337 + 'id': '4',
  338 + 'url': 'https://qn.colorcun.com/template/jinhuang-4.png',
  339 + };
  340 + ThemeSunModel themeSunModel14 = ThemeSunModel.fromJson(jsonSun14);
  341 + urls.add(themeSunModel14);
  342 +
  343 + //模版5
  344 + Map<String, dynamic> jsonSun15 = {
  345 + 'name': '5 半屏邀请函B(多色)',
  346 + 'id': '5',
  347 + 'url': 'https://qn.colorcun.com/template/jinhuang-5.png',
  348 + };
  349 + ThemeSunModel themeSunModel15 = ThemeSunModel.fromJson(jsonSun15);
  350 + urls.add(themeSunModel15);
  351 +
  352 + //模版6
  353 + Map<String, dynamic> jsonSun16 = {
  354 + 'name': '6 无预订包间图片A(多色)',
  355 + 'id': '6',
  356 + 'url': 'https://qn.colorcun.com/template/jinhuang-6.png',
  357 + };
  358 + ThemeSunModel themeSunModel16 = ThemeSunModel.fromJson(jsonSun16);
  359 + urls.add(themeSunModel16);
  360 +
  361 + //模版7
  362 + Map<String, dynamic> jsonSun17 = {
  363 + 'name': '7 无预订包间图片B',
  364 + 'id': '7',
  365 + 'url': 'https://qn.colorcun.com/template/jinhuang-7.png',
  366 + };
  367 + ThemeSunModel themeSunModel17 = ThemeSunModel.fromJson(jsonSun17);
  368 + urls.add(themeSunModel17);
  369 +
  370 + Map<String, dynamic> json1 = {
  371 + 'color_name': '金黄',
  372 + 'color_value_s': 'FFC67B3A',
  373 + 'color_value_m': 'FFC67B3A',
  374 + 'color_value_e': 'FFC67B3A',
  375 + 'urls': urls
  376 + };
  377 +
  378 + ThemeModel themeModel1 = ThemeModel.fromJson(json1);
  379 + // themeDatas.add(themeModel1);
  380 + themeDatas['金黄'] = themeModel1;
  381 + }
  382 +
  383 + _addJianghuang() {
  384 + List<ThemeSunModel> urls = [];
  385 + //模版2
  386 + Map<String, dynamic> jsonSun12 = {
  387 + 'name': '2 简洁图文A(多色)',
  388 + 'id': '2',
  389 + 'url': 'https://qn.colorcun.com/template/jianghuang-2.png',
  390 + };
  391 + ThemeSunModel themeSunModel12 = ThemeSunModel.fromJson(jsonSun12);
  392 + urls.add(themeSunModel12);
  393 + //模版3
  394 + Map<String, dynamic> jsonSun13 = {
  395 + 'name': '3 简洁信息图文A(多色)',
  396 + 'id': '3',
  397 + 'url': 'https://qn.colorcun.com/template/jianghuang-3.png',
  398 + };
  399 + ThemeSunModel themeSunModel13 = ThemeSunModel.fromJson(jsonSun13);
  400 + urls.add(themeSunModel13);
  401 + //模版4
  402 + Map<String, dynamic> jsonSun14 = {
  403 + 'name': '4 半屏邀请函A(多色)',
  404 + 'id': '4',
  405 + 'url': 'https://qn.colorcun.com/template/jianghuang-4.png',
  406 + };
  407 + ThemeSunModel themeSunModel14 = ThemeSunModel.fromJson(jsonSun14);
  408 + urls.add(themeSunModel14);
  409 +
  410 + //模版5
  411 + Map<String, dynamic> jsonSun15 = {
  412 + 'name': '5 半屏邀请函B(多色)',
  413 + 'id': '5',
  414 + 'url': 'https://qn.colorcun.com/template/jianghuang-5.png',
  415 + };
  416 + ThemeSunModel themeSunModel15 = ThemeSunModel.fromJson(jsonSun15);
  417 + urls.add(themeSunModel15);
  418 +
  419 + //模版6
  420 + Map<String, dynamic> jsonSun16 = {
  421 + 'name': '6 无预订包间图片A(多色)',
  422 + 'id': '6',
  423 + 'url': 'https://qn.colorcun.com/template/jianghuang-6.png',
  424 + };
  425 + ThemeSunModel themeSunModel16 = ThemeSunModel.fromJson(jsonSun16);
  426 + urls.add(themeSunModel16);
  427 +
  428 + //模版7
  429 + Map<String, dynamic> jsonSun17 = {
  430 + 'name': '7 无预订包间图片B',
  431 + 'id': '7',
  432 + 'url': 'https://qn.colorcun.com/template/jianghuang-7.png',
  433 + };
  434 + ThemeSunModel themeSunModel17 = ThemeSunModel.fromJson(jsonSun17);
  435 + urls.add(themeSunModel17);
  436 +
  437 + Map<String, dynamic> json1 = {
  438 + 'color_name': '姜黄',
  439 + 'color_value_s': 'FFB39437',
  440 + 'color_value_m': 'FFB39437',
  441 + 'color_value_e': 'FFB39437',
  442 + 'urls': urls
  443 + };
  444 +
  445 + ThemeModel themeModel1 = ThemeModel.fromJson(json1);
  446 + // themeDatas.add(themeModel1);
  447 + themeDatas['姜黄'] = themeModel1;
  448 + }
  449 +
  450 + _addShilv() {
  451 + List<ThemeSunModel> urls = [];
  452 + //模版2
  453 + Map<String, dynamic> jsonSun12 = {
  454 + 'name': '2 简洁图文A(多色)',
  455 + 'id': '2',
  456 + 'url': 'https://qn.colorcun.com/template/shilv-2.png',
  457 + };
  458 + ThemeSunModel themeSunModel12 = ThemeSunModel.fromJson(jsonSun12);
  459 + urls.add(themeSunModel12);
  460 + //模版3
  461 + Map<String, dynamic> jsonSun13 = {
  462 + 'name': '3 简洁信息图文A(多色)',
  463 + 'id': '3',
  464 + 'url': 'https://qn.colorcun.com/template/shilv-3.png',
  465 + };
  466 + ThemeSunModel themeSunModel13 = ThemeSunModel.fromJson(jsonSun13);
  467 + urls.add(themeSunModel13);
  468 + //模版4
  469 + Map<String, dynamic> jsonSun14 = {
  470 + 'name': '4 半屏邀请函A(多色)',
  471 + 'id': '4',
  472 + 'url': 'https://qn.colorcun.com/template/shilv-4.png',
  473 + };
  474 + ThemeSunModel themeSunModel14 = ThemeSunModel.fromJson(jsonSun14);
  475 + urls.add(themeSunModel14);
  476 +
  477 + //模版5
  478 + Map<String, dynamic> jsonSun15 = {
  479 + 'name': '5 半屏邀请函B(多色)',
  480 + 'id': '5',
  481 + 'url': 'https://qn.colorcun.com/template/shilv-5.png',
  482 + };
  483 + ThemeSunModel themeSunModel15 = ThemeSunModel.fromJson(jsonSun15);
  484 + urls.add(themeSunModel15);
  485 +
  486 + //模版6
  487 + Map<String, dynamic> jsonSun16 = {
  488 + 'name': '6 无预订包间图片A(多色)',
  489 + 'id': '6',
  490 + 'url': 'https://qn.colorcun.com/template/shilv-6.png',
  491 + };
  492 + ThemeSunModel themeSunModel16 = ThemeSunModel.fromJson(jsonSun16);
  493 + urls.add(themeSunModel16);
  494 +
  495 + //模版7
  496 + Map<String, dynamic> jsonSun17 = {
  497 + 'name': '7 无预订包间图片B',
  498 + 'id': '7',
  499 + 'url': 'https://qn.colorcun.com/template/shilv-7.png',
  500 + };
  501 + ThemeSunModel themeSunModel17 = ThemeSunModel.fromJson(jsonSun17);
  502 + urls.add(themeSunModel17);
  503 +
  504 + Map<String, dynamic> json1 = {
  505 + 'color_name': '石绿',
  506 + 'color_value_s': 'FF206864',
  507 + 'color_value_m': 'FF206864',
  508 + 'color_value_e': 'FF206864',
  509 + 'urls': urls
  510 + };
  511 +
  512 + ThemeModel themeModel1 = ThemeModel.fromJson(json1);
  513 + // themeDatas.add(themeModel1);
  514 + themeDatas['石绿'] = themeModel1;
  515 + }
  516 +
  517 + _addLancaihe() {
  518 + List<ThemeSunModel> urls = [];
  519 + //模版2
  520 + Map<String, dynamic> jsonSun12 = {
  521 + 'name': '2 简洁图文A(多色)',
  522 + 'id': '2',
  523 + 'url': 'https://qn.colorcun.com/template/lancaihe-2.png',
  524 + };
  525 + ThemeSunModel themeSunModel12 = ThemeSunModel.fromJson(jsonSun12);
  526 + urls.add(themeSunModel12);
  527 + //模版3
  528 + Map<String, dynamic> jsonSun13 = {
  529 + 'name': '3 简洁信息图文A(多色)',
  530 + 'id': '3',
  531 + 'url': 'https://qn.colorcun.com/template/lancaihe-3.png',
  532 + };
  533 + ThemeSunModel themeSunModel13 = ThemeSunModel.fromJson(jsonSun13);
  534 + urls.add(themeSunModel13);
  535 + //模版4
  536 + Map<String, dynamic> jsonSun14 = {
  537 + 'name': '4 半屏邀请函A(多色)',
  538 + 'id': '4',
  539 + 'url': 'https://qn.colorcun.com/template/lancaihe-4.png',
  540 + };
  541 + ThemeSunModel themeSunModel14 = ThemeSunModel.fromJson(jsonSun14);
  542 + urls.add(themeSunModel14);
  543 +
  544 + //模版5
  545 + Map<String, dynamic> jsonSun15 = {
  546 + 'name': '5 半屏邀请函B(多色)',
  547 + 'id': '5',
  548 + 'url': 'https://qn.colorcun.com/template/lancaihe-5.png',
  549 + };
  550 + ThemeSunModel themeSunModel15 = ThemeSunModel.fromJson(jsonSun15);
  551 + urls.add(themeSunModel15);
  552 +
  553 + //模版6
  554 + Map<String, dynamic> jsonSun16 = {
  555 + 'name': '6 无预订包间图片A(多色)',
  556 + 'id': '6',
  557 + 'url': 'https://qn.colorcun.com/template/lancaihe-6.png',
  558 + };
  559 + ThemeSunModel themeSunModel16 = ThemeSunModel.fromJson(jsonSun16);
  560 + urls.add(themeSunModel16);
  561 +
  562 + //模版7
  563 + Map<String, dynamic> jsonSun17 = {
  564 + 'name': '7 无预订包间图片B',
  565 + 'id': '7',
  566 + 'url': 'https://qn.colorcun.com/template/lancaihe-7.png',
  567 + };
  568 + ThemeSunModel themeSunModel17 = ThemeSunModel.fromJson(jsonSun17);
  569 + urls.add(themeSunModel17);
  570 +
  571 + Map<String, dynamic> json1 = {
  572 + 'color_name': '蓝采和',
  573 + 'color_value_s': 'FF06436F',
  574 + 'color_value_m': 'FF06436F',
  575 + 'color_value_e': 'FF06436F',
  576 + 'urls': urls
  577 + };
  578 +
  579 + ThemeModel themeModel1 = ThemeModel.fromJson(json1);
  580 + // themeDatas.add(themeModel1);
  581 + themeDatas['蓝采和'] = themeModel1;
  582 + }
  583 +
  584 + _addZhongguohong() {
  585 + List<ThemeSunModel> urls = [];
  586 + //模版2
  587 + Map<String, dynamic> jsonSun12 = {
  588 + 'name': '2 简洁图文A(多色)',
  589 + 'id': '2',
  590 + 'url': 'https://qn.colorcun.com/template/zhongguohong-2.png',
  591 + };
  592 + ThemeSunModel themeSunModel12 = ThemeSunModel.fromJson(jsonSun12);
  593 + urls.add(themeSunModel12);
  594 + //模版3
  595 + Map<String, dynamic> jsonSun13 = {
  596 + 'name': '3 简洁信息图文A(多色)',
  597 + 'id': '3',
  598 + 'url': 'https://qn.colorcun.com/template/zhongguohong-3.png',
  599 + };
  600 + ThemeSunModel themeSunModel13 = ThemeSunModel.fromJson(jsonSun13);
  601 + urls.add(themeSunModel13);
  602 + //模版4
  603 + Map<String, dynamic> jsonSun14 = {
  604 + 'name': '4 半屏邀请函A(多色)',
  605 + 'id': '4',
  606 + 'url': 'https://qn.colorcun.com/template/zhongguohong-4.png',
  607 + };
  608 + ThemeSunModel themeSunModel14 = ThemeSunModel.fromJson(jsonSun14);
  609 + urls.add(themeSunModel14);
  610 +
  611 + //模版5
  612 + Map<String, dynamic> jsonSun15 = {
  613 + 'name': '5 半屏邀请函B(多色)',
  614 + 'id': '5',
  615 + 'url': 'https://qn.colorcun.com/template/zhongguohong-5.png',
  616 + };
  617 + ThemeSunModel themeSunModel15 = ThemeSunModel.fromJson(jsonSun15);
  618 + urls.add(themeSunModel15);
  619 +
  620 + //模版6
  621 + Map<String, dynamic> jsonSun16 = {
  622 + 'name': '6 无预订包间图片A(多色)',
  623 + 'id': '6',
  624 + 'url': 'https://qn.colorcun.com/template/zhongguohong-6.png',
  625 + };
  626 + ThemeSunModel themeSunModel16 = ThemeSunModel.fromJson(jsonSun16);
  627 + urls.add(themeSunModel16);
  628 +
  629 + //模版7
  630 + Map<String, dynamic> jsonSun17 = {
  631 + 'name': '7 无预订包间图片B',
  632 + 'id': '7',
  633 + 'url': 'https://qn.colorcun.com/template/zhongguohong-7.png',
  634 + };
  635 + ThemeSunModel themeSunModel17 = ThemeSunModel.fromJson(jsonSun17);
  636 + urls.add(themeSunModel17);
  637 +
  638 + Map<String, dynamic> json1 = {
  639 + 'color_name': '中国红',
  640 + 'color_value_s': 'FFAF231C',
  641 + 'color_value_m': 'FFAF231C',
  642 + 'color_value_e': 'FFAF231C',
  643 + 'urls': urls
  644 + };
  645 +
  646 + ThemeModel themeModel1 = ThemeModel.fromJson(json1);
  647 + // themeDatas.add(themeModel1);
  648 + themeDatas['中国红'] = themeModel1;
  649 + }
  650 +
  651 + _addShenzhongguohong() {
  652 + List<ThemeSunModel> urls = [];
  653 + //模版2
  654 + Map<String, dynamic> jsonSun12 = {
  655 + 'name': '2 简洁图文A(多色)',
  656 + 'id': '2',
  657 + 'url': 'https://qn.colorcun.com/template/shenzhongguohong-2.png',
  658 + };
  659 + ThemeSunModel themeSunModel12 = ThemeSunModel.fromJson(jsonSun12);
  660 + urls.add(themeSunModel12);
  661 + //模版3
  662 + Map<String, dynamic> jsonSun13 = {
  663 + 'name': '3 简洁信息图文A(多色)',
  664 + 'id': '3',
  665 + 'url': 'https://qn.colorcun.com/template/shenzhongguohong-3.png',
  666 + };
  667 + ThemeSunModel themeSunModel13 = ThemeSunModel.fromJson(jsonSun13);
  668 + urls.add(themeSunModel13);
  669 + //模版4
  670 + Map<String, dynamic> jsonSun14 = {
  671 + 'name': '4 半屏邀请函A(多色)',
  672 + 'id': '4',
  673 + 'url': 'https://qn.colorcun.com/template/shenzhongguohong-4.png',
  674 + };
  675 + ThemeSunModel themeSunModel14 = ThemeSunModel.fromJson(jsonSun14);
  676 + urls.add(themeSunModel14);
  677 +
  678 + //模版5
  679 + Map<String, dynamic> jsonSun15 = {
  680 + 'name': '5 半屏邀请函B(多色)',
  681 + 'id': '5',
  682 + 'url': 'https://qn.colorcun.com/template/shenzhongguohong-5.png',
  683 + };
  684 + ThemeSunModel themeSunModel15 = ThemeSunModel.fromJson(jsonSun15);
  685 + urls.add(themeSunModel15);
  686 +
  687 + //模版6
  688 + Map<String, dynamic> jsonSun16 = {
  689 + 'name': '6 无预订包间图片A(多色)',
  690 + 'id': '6',
  691 + 'url': 'https://qn.colorcun.com/template/shenzhongguohong-6.png',
  692 + };
  693 + ThemeSunModel themeSunModel16 = ThemeSunModel.fromJson(jsonSun16);
  694 + urls.add(themeSunModel16);
  695 +
  696 + //模版7
  697 + Map<String, dynamic> jsonSun17 = {
  698 + 'name': '7 无预订包间图片B',
  699 + 'id': '7',
  700 + 'url': 'https://qn.colorcun.com/template/shenzhongguohong-7.png',
  701 + };
  702 + ThemeSunModel themeSunModel17 = ThemeSunModel.fromJson(jsonSun17);
  703 + urls.add(themeSunModel17);
  704 +
  705 + Map<String, dynamic> json1 = {
  706 + 'color_name': '深中国红',
  707 + 'color_value_s': 'FF86201B',
  708 + 'color_value_m': 'FF86201B',
  709 + 'color_value_e': 'FF86201B',
  710 + 'urls': urls
  711 + };
  712 +
  713 + ThemeModel themeModel1 = ThemeModel.fromJson(json1);
  714 + // themeDatas.add(themeModel1);
  715 + themeDatas['深中国红'] = themeModel1;
  716 + }
  717 +
  718 + _addHeilanguodu() {
  719 + List<ThemeSunModel> urls = [];
  720 + //模版3
  721 + Map<String, dynamic> jsonSun13 = {
  722 + 'name': '3 简洁信息图文A(多色)',
  723 + 'id': '3',
  724 + 'url': 'https://qn.colorcun.com/template/heilanguodu-3.png',
  725 + };
  726 + ThemeSunModel themeSunModel13 = ThemeSunModel.fromJson(jsonSun13);
  727 + urls.add(themeSunModel13);
  728 + //模版4
  729 + Map<String, dynamic> jsonSun14 = {
  730 + 'name': '4 半屏邀请函A(多色)',
  731 + 'id': '4',
  732 + 'url': 'https://qn.colorcun.com/template/heilanguodu-4.png',
  733 + };
  734 + ThemeSunModel themeSunModel14 = ThemeSunModel.fromJson(jsonSun14);
  735 + urls.add(themeSunModel14);
  736 +
  737 + //模版5
  738 + Map<String, dynamic> jsonSun15 = {
  739 + 'name': '5 半屏邀请函B(多色)',
  740 + 'id': '5',
  741 + 'url': 'https://qn.colorcun.com/template/heilanguodu-5.png',
  742 + };
  743 + ThemeSunModel themeSunModel15 = ThemeSunModel.fromJson(jsonSun15);
  744 + urls.add(themeSunModel15);
  745 +
  746 + //模版6
  747 + Map<String, dynamic> jsonSun16 = {
  748 + 'name': '6 无预订包间图片A(多色)',
  749 + 'id': '6',
  750 + 'url': 'https://qn.colorcun.com/template/heilanguodu-6.png',
  751 + };
  752 + ThemeSunModel themeSunModel16 = ThemeSunModel.fromJson(jsonSun16);
  753 + urls.add(themeSunModel16);
  754 +
  755 + //模版7
  756 + Map<String, dynamic> jsonSun17 = {
  757 + 'name': '7 无预订包间图片B',
  758 + 'id': '7',
  759 + 'url': 'https://qn.colorcun.com/template/heilanguodu-7.png',
  760 + };
  761 + ThemeSunModel themeSunModel17 = ThemeSunModel.fromJson(jsonSun17);
  762 + urls.add(themeSunModel17);
  763 +
  764 + Map<String, dynamic> json1 = {
  765 + 'color_name': '黑蓝过渡',
  766 + 'color_value_s': 'FF42A5FF',
  767 + 'color_value_m': 'FF000000',
  768 + 'color_value_e': 'FF42A5FF',
  769 + 'urls': urls
  770 + };
  771 +
  772 + ThemeModel themeModel1 = ThemeModel.fromJson(json1);
  773 + themeDatas['黑蓝过渡'] = themeModel1;
  774 + }
  775 +
  776 + _addShilvuodu() {
  777 + List<ThemeSunModel> urls = [];
  778 + //模版3
  779 + Map<String, dynamic> jsonSun13 = {
  780 + 'name': '3 简洁信息图文A(多色)',
  781 + 'id': '3',
  782 + 'url': 'https://qn.colorcun.com/template/shilvguodu-3.png',
  783 + };
  784 + ThemeSunModel themeSunModel13 = ThemeSunModel.fromJson(jsonSun13);
  785 + urls.add(themeSunModel13);
  786 + //模版4
  787 + Map<String, dynamic> jsonSun14 = {
  788 + 'name': '4 半屏邀请函A(多色)',
  789 + 'id': '4',
  790 + 'url': 'https://qn.colorcun.com/template/shilvguodu-4.png',
  791 + };
  792 + ThemeSunModel themeSunModel14 = ThemeSunModel.fromJson(jsonSun14);
  793 + urls.add(themeSunModel14);
  794 +
  795 + //模版5
  796 + Map<String, dynamic> jsonSun15 = {
  797 + 'name': '5 半屏邀请函B(多色)',
  798 + 'id': '5',
  799 + 'url': 'https://qn.colorcun.com/template/shilvguodu-5.png',
  800 + };
  801 + ThemeSunModel themeSunModel15 = ThemeSunModel.fromJson(jsonSun15);
  802 + urls.add(themeSunModel15);
  803 +
  804 + //模版6
  805 + Map<String, dynamic> jsonSun16 = {
  806 + 'name': '6 无预订包间图片A(多色)',
  807 + 'id': '6',
  808 + 'url': 'https://qn.colorcun.com/template/shilvguodu-6.png',
  809 + };
  810 + ThemeSunModel themeSunModel16 = ThemeSunModel.fromJson(jsonSun16);
  811 + urls.add(themeSunModel16);
  812 +
  813 + //模版7
  814 + Map<String, dynamic> jsonSun17 = {
  815 + 'name': '7 无预订包间图片B',
  816 + 'id': '7',
  817 + 'url': 'https://qn.colorcun.com/template/shilvguodu-7.png',
  818 + };
  819 + ThemeSunModel themeSunModel17 = ThemeSunModel.fromJson(jsonSun17);
  820 + urls.add(themeSunModel17);
  821 +
  822 + Map<String, dynamic> json1 = {
  823 + 'color_name': '石绿过渡',
  824 + 'color_value_s': 'FF438E93',
  825 + 'color_value_m': 'FF206864',
  826 + 'color_value_e': 'FF42A5FF',
  827 + 'urls': urls
  828 + };
  829 +
  830 + ThemeModel themeModel1 = ThemeModel.fromJson(json1);
  831 + // themeDatas.add(themeModel1);
  832 + themeDatas['石绿过渡'] = themeModel1;
  833 + }
  834 +
  835 + _addZhongguohongguodu() {
  836 + List<ThemeSunModel> urls = [];
  837 + //模版3
  838 + Map<String, dynamic> jsonSun13 = {
  839 + 'name': '3 简洁信息图文A(多色)',
  840 + 'id': '3',
  841 + 'url': 'https://qn.colorcun.com/template/zhongguohongguodu-3.png',
  842 + };
  843 + ThemeSunModel themeSunModel13 = ThemeSunModel.fromJson(jsonSun13);
  844 + urls.add(themeSunModel13);
  845 + //模版4
  846 + Map<String, dynamic> jsonSun14 = {
  847 + 'name': '4 半屏邀请函A(多色)',
  848 + 'id': '4',
  849 + 'url': 'https://qn.colorcun.com/template/zhongguohongguodu-4.png',
  850 + };
  851 + ThemeSunModel themeSunModel14 = ThemeSunModel.fromJson(jsonSun14);
  852 + urls.add(themeSunModel14);
  853 +
  854 + //模版5
  855 + Map<String, dynamic> jsonSun15 = {
  856 + 'name': '5 半屏邀请函B(多色)',
  857 + 'id': '5',
  858 + 'url': 'https://qn.colorcun.com/template/zhongguohongguodu-5.png',
  859 + };
  860 + ThemeSunModel themeSunModel15 = ThemeSunModel.fromJson(jsonSun15);
  861 + urls.add(themeSunModel15);
  862 +
  863 + //模版6
  864 + Map<String, dynamic> jsonSun16 = {
  865 + 'name': '6 无预订包间图片A(多色)',
  866 + 'id': '6',
  867 + 'url': 'https://qn.colorcun.com/template/zhongguohongguodu-6.png',
  868 + };
  869 + ThemeSunModel themeSunModel16 = ThemeSunModel.fromJson(jsonSun16);
  870 + urls.add(themeSunModel16);
  871 +
  872 + //模版7
  873 + Map<String, dynamic> jsonSun17 = {
  874 + 'name': '7 无预订包间图片B',
  875 + 'id': '7',
  876 + 'url': 'https://qn.colorcun.com/template/zhongguohongguodu-7.png',
  877 + };
  878 + ThemeSunModel themeSunModel17 = ThemeSunModel.fromJson(jsonSun17);
  879 + urls.add(themeSunModel17);
  880 +
  881 + Map<String, dynamic> json1 = {
  882 + 'color_name': '中国红过渡',
  883 + 'color_value_s': 'FFAF231C',
  884 + 'color_value_m': 'FF86201B',
  885 + 'color_value_e': 'FFAF231C',
  886 + 'urls': urls
  887 + };
  888 +
  889 + ThemeModel themeModel1 = ThemeModel.fromJson(json1);
  890 + // themeDatas.add(themeModel1);
  891 + themeDatas['中国红过渡'] = themeModel1;
  892 + }
  893 +
  894 + _addQunqingguodu() {
  895 + List<ThemeSunModel> urls = [];
  896 + //模版3
  897 + Map<String, dynamic> jsonSun13 = {
  898 + 'name': '3 简洁信息图文A(多色)',
  899 + 'id': '3',
  900 + 'url': 'https://qn.colorcun.com/template/qunqingguodu-3.png',
  901 + };
  902 + ThemeSunModel themeSunModel13 = ThemeSunModel.fromJson(jsonSun13);
  903 + urls.add(themeSunModel13);
  904 + //模版4
  905 + Map<String, dynamic> jsonSun14 = {
  906 + 'name': '4 半屏邀请函A(多色)',
  907 + 'id': '4',
  908 + 'url': 'https://qn.colorcun.com/template/qunqingguodu-4.png',
  909 + };
  910 + ThemeSunModel themeSunModel14 = ThemeSunModel.fromJson(jsonSun14);
  911 + urls.add(themeSunModel14);
  912 +
  913 + //模版5
  914 + Map<String, dynamic> jsonSun15 = {
  915 + 'name': '5 半屏邀请函B(多色)',
  916 + 'id': '5',
  917 + 'url': 'https://qn.colorcun.com/template/qunqingguodu-5.png',
  918 + };
  919 + ThemeSunModel themeSunModel15 = ThemeSunModel.fromJson(jsonSun15);
  920 + urls.add(themeSunModel15);
  921 +
  922 + //模版6
  923 + Map<String, dynamic> jsonSun16 = {
  924 + 'name': '6 无预订包间图片A(多色)',
  925 + 'id': '6',
  926 + 'url': 'https://qn.colorcun.com/template/qunqingguodu-6.png',
  927 + };
  928 + ThemeSunModel themeSunModel16 = ThemeSunModel.fromJson(jsonSun16);
  929 + urls.add(themeSunModel16);
  930 +
  931 + //模版7
  932 + Map<String, dynamic> jsonSun17 = {
  933 + 'name': '7 无预订包间图片B',
  934 + 'id': '7',
  935 + 'url': 'https://qn.colorcun.com/template/qunqingguodu-7.png',
  936 + };
  937 + ThemeSunModel themeSunModel17 = ThemeSunModel.fromJson(jsonSun17);
  938 + urls.add(themeSunModel17);
  939 +
  940 + Map<String, dynamic> json1 = {
  941 + 'color_name': '群青过渡',
  942 + 'color_value_s': 'FF4C8DAD',
  943 + 'color_value_m': 'FF0143A3',
  944 + 'color_value_e': 'FF42A5FF',
  945 + 'urls': urls
  946 + };
  947 +
  948 + ThemeModel themeModel1 = ThemeModel.fromJson(json1);
  949 + // themeDatas.add(themeModel1);
  950 + themeDatas['群青过渡'] = themeModel1;
  951 + }
  952 +
29 _showPhotoView(BuildContext context, int index, List<String> imgs, 953 _showPhotoView(BuildContext context, int index, List<String> imgs,
30 {isShow = false, List dashName}) async { 954 {isShow = false, List dashName}) async {
31 // if (imgs.length == 1 && 955 // if (imgs.length == 1 &&
@@ -83,10 +1007,23 @@ class _InvitationThemeHomePageState extends State<InvitationThemeHomePage> { @@ -83,10 +1007,23 @@ class _InvitationThemeHomePageState extends State<InvitationThemeHomePage> {
83 body: Column( 1007 body: Column(
84 children: [ 1008 children: [
85 Expanded( 1009 Expanded(
86 - child: Column( 1010 + child: SingleChildScrollView(
  1011 + child: Column(
87 children: [ 1012 children: [
88 InkWell( 1013 InkWell(
89 - onTap: () {}, 1014 + onTap: () {
  1015 + List<ThemeModel> themeShow = [];
  1016 + themeDatas.forEach((key, value) {
  1017 + themeShow.add(value);
  1018 + });
  1019 + DialogUtil.showThemeColorSelectDialogNew(context, themeShow,
  1020 + callback: (object) {
  1021 + print(object);
  1022 + setState(() {
  1023 + themeColor = object;
  1024 + });
  1025 + });
  1026 + },
90 child: Padding( 1027 child: Padding(
91 padding: EdgeInsets.only( 1028 padding: EdgeInsets.only(
92 left: w(16), top: w(12), bottom: w(12), right: w(24)), 1029 left: w(16), top: w(12), bottom: w(12), right: w(24)),
@@ -101,7 +1038,7 @@ class _InvitationThemeHomePageState extends State<InvitationThemeHomePage> { @@ -101,7 +1038,7 @@ class _InvitationThemeHomePageState extends State<InvitationThemeHomePage> {
101 ), 1038 ),
102 Spacer(), 1039 Spacer(),
103 Text( 1040 Text(
104 - '群青绿', 1041 + themeDatas[themeColor].colorName,
105 style: TextStyle( 1042 style: TextStyle(
106 color: MyColours.color_515151, 1043 color: MyColours.color_515151,
107 fontSize: font(16)), 1044 fontSize: font(16)),
@@ -136,69 +1073,199 @@ class _InvitationThemeHomePageState extends State<InvitationThemeHomePage> { @@ -136,69 +1073,199 @@ class _InvitationThemeHomePageState extends State<InvitationThemeHomePage> {
136 child: MyDivider(double.infinity, w(0.5), 1073 child: MyDivider(double.infinity, w(0.5),
137 color: MyColours.color_E7E7E7)), 1074 color: MyColours.color_E7E7E7)),
138 VEmptyView(24), 1075 VEmptyView(24),
139 - Expanded(  
140 - child: GridView.builder(  
141 - padding: EdgeInsets.symmetric(horizontal: w(16)),  
142 - controller: controller,  
143 - // padding: EdgeInsets.only(top: ScreenUtil().getAdapterSize(10)),  
144 - shrinkWrap: true,  
145 - itemCount: 7,  
146 - //SliverGridDelegateWithFixedCrossAxisCount 构建一个横轴固定数量Widget  
147 - gridDelegate: SliverGridDelegateWithFixedCrossAxisCount(  
148 - //横轴元素个数  
149 - crossAxisCount: 2,  
150 - //纵轴间距  
151 - mainAxisSpacing: w(15),  
152 - //横轴间距  
153 - crossAxisSpacing: w(15),  
154 - //子组件宽高长度比例  
155 - childAspectRatio:  
156 - (ScreenUtil().screenWidth - w(62)) / 2 / 350),  
157 - itemBuilder: (BuildContext context, int index) {  
158 - return InkWell(  
159 - onTap: () {  
160 - _showPhotoView(context, 0, [  
161 - 'https://qn.colorcun.com/i_theme_1.png',  
162 - 'https://qn.colorcun.com/i_theme_1.png',  
163 - 'https://qn.colorcun.com/i_theme_1.png'  
164 - ]);  
165 - },  
166 - child: Container(  
167 - decoration: BoxDecoration(  
168 - borderRadius: BorderRadius.circular(r(10)),  
169 - border: Border.all(  
170 - color: true  
171 - ? MyColours.color_005AA7  
172 - : MyColours.color_DBDBDB,  
173 - width: true ? w(2) : w(1))),  
174 - child: Column(  
175 - children: [  
176 - CachedNetworkImage(  
177 - imageUrl:  
178 - 'https://qn.colorcun.com/i_theme_1.png',  
179 - width:  
180 - (ScreenUtil().screenWidth - w(62)) / 2,  
181 - // height: w(388),  
182 - ),  
183 - VEmptyView(10),  
184 - Padding(  
185 - padding:  
186 - EdgeInsets.symmetric(vertical: w(6)),  
187 - child: Text(  
188 - '1 经典图片式',  
189 - maxLines: 1,  
190 - overflow: TextOverflow.ellipsis,  
191 - style: TextStyle(  
192 - color: MyColours.color_000000,  
193 - fontSize: font(14)),  
194 - ),  
195 - )  
196 - ], 1076 + GridView.builder(
  1077 + padding: EdgeInsets.symmetric(horizontal: w(16)),
  1078 + controller: controller,
  1079 + // padding: EdgeInsets.only(top: ScreenUtil().getAdapterSize(10)),
  1080 + shrinkWrap: true,
  1081 + itemCount: themeDatas[themeColor].urls.length,
  1082 + //SliverGridDelegateWithFixedCrossAxisCount 构建一个横轴固定数量Widget
  1083 + gridDelegate: SliverGridDelegateWithFixedCrossAxisCount(
  1084 + //横轴元素个数
  1085 + crossAxisCount: 2,
  1086 + //纵轴间距
  1087 + mainAxisSpacing: w(15),
  1088 + //横轴间距
  1089 + crossAxisSpacing: w(15),
  1090 + //子组件宽高长度比例
  1091 + childAspectRatio:
  1092 + (ScreenUtil().screenWidth - w(62)) / 2 / 370),
  1093 + itemBuilder: (BuildContext context, int index) {
  1094 + ThemeModel themeModel = themeDatas[themeColor];
  1095 + return InkWell(
  1096 + onTap: () {
  1097 + List<String> temp =
  1098 + themeModel.urls.map((e) => e.url).toList();
  1099 + print(temp);
  1100 + _showPhotoView(context, indexSelect,
  1101 + themeModel.urls.map((e) => e.url).toList());
  1102 + },
  1103 + child: Container(
  1104 + decoration: BoxDecoration(
  1105 + borderRadius: BorderRadius.circular(r(10)),
  1106 + border: Border.all(
  1107 + color: indexSelect == index
  1108 + ? MyColours.color_005AA7
  1109 + : MyColours.color_DBDBDB,
  1110 + width: indexSelect == index ? w(2) : w(1))),
  1111 + child: Column(
  1112 + children: [
  1113 + VEmptyView(10),
  1114 + CachedNetworkImage(
  1115 + imageUrl: themeModel.urls[index].url,
  1116 + width: (ScreenUtil().screenWidth - w(62)) / 2,
  1117 + height: w(348),
  1118 + fit: BoxFit.fitWidth,
  1119 + alignment: Alignment.topCenter,
  1120 + ),
  1121 + VEmptyView(20),
  1122 + Container(
  1123 + padding: EdgeInsets.symmetric(
  1124 + vertical: w(6), horizontal: w(2)),
  1125 + width: double.infinity,
  1126 + child: Text(
  1127 + themeModel.urls[index].name,
  1128 + maxLines: 1,
  1129 + overflow: TextOverflow.ellipsis,
  1130 + textAlign: TextAlign.left,
  1131 + style: TextStyle(
  1132 + color: MyColours.color_000000,
  1133 + fontSize: font(14)),
  1134 + ),
  1135 + )
  1136 + ],
  1137 + ),
  1138 + ));
  1139 + }),
  1140 + InkWell(
  1141 + onTap: () {
  1142 + List<ThemeModel> themeShow = [];
  1143 + themeDatas.forEach((key, value) {
  1144 + themeShow.add(value);
  1145 + });
  1146 + DialogUtil.showThemeColorSelectDialogNew(context, themeShow,
  1147 + callback: (object) {
  1148 + print(object);
  1149 + setState(() {
  1150 + indexSelect = object;
  1151 + });
  1152 + });
  1153 + },
  1154 + child: Padding(
  1155 + padding: EdgeInsets.only(
  1156 + left: w(16), top: w(12), bottom: w(12), right: w(24)),
  1157 + child: Row(
  1158 + mainAxisAlignment: MainAxisAlignment.spaceBetween,
  1159 + children: [
  1160 + Text(
  1161 + '无配色主题',
  1162 + style: TextStyle(
  1163 + color: MyColours.color_515151,
  1164 + fontSize: font(16)),
  1165 + ),
  1166 + // Spacer(),
  1167 + // Text(
  1168 + // themeDatas[themeColor].colorName,
  1169 + // style: TextStyle(
  1170 + // color: MyColours.color_515151,
  1171 + // fontSize: font(16)),
  1172 + // ),
  1173 + // Container(
  1174 + // padding: EdgeInsets.symmetric(
  1175 + // horizontal: w(11), vertical: w(4)),
  1176 + // child: Image.asset(
  1177 + // "assets/arrow_right_new.png",
  1178 + // width: w(9),
  1179 + // height: w(16),
  1180 + // ),
  1181 + // )
  1182 + // RoundButton(
  1183 + // text: '预览',
  1184 + // gradientStart: MyColours.color_ffffff,
  1185 + // gradientEnd: MyColours.color_ffffff,
  1186 + // borderColor: MyColours.color_438E93,
  1187 + // textColor: MyColours.color_438E93,
  1188 + // radius: ScreenUtil().setWidth(22),
  1189 + // fontSize: 24,
  1190 + // width: w(72),
  1191 + // height: ScreenUtil().setWidth(44),
  1192 + // isBold: true,
  1193 + // onPressed: () {
  1194 + // NavigatorUtil.goMarkingPreviewPage(context);
  1195 + // },
  1196 + // ),
  1197 + ]))),
  1198 + Padding(
  1199 + padding: EdgeInsets.only(left: w(16)),
  1200 + child: MyDivider(double.infinity, w(0.5),
  1201 + color: MyColours.color_E7E7E7)),
  1202 + VEmptyView(24),
  1203 + GridView.builder(
  1204 + padding: EdgeInsets.symmetric(horizontal: w(16)),
  1205 + controller: controller,
  1206 + // padding: EdgeInsets.only(top: ScreenUtil().getAdapterSize(10)),
  1207 + shrinkWrap: true,
  1208 + itemCount: themeDatasno.length,
  1209 + //SliverGridDelegateWithFixedCrossAxisCount 构建一个横轴固定数量Widget
  1210 + gridDelegate: SliverGridDelegateWithFixedCrossAxisCount(
  1211 + //横轴元素个数
  1212 + crossAxisCount: 2,
  1213 + //纵轴间距
  1214 + mainAxisSpacing: w(15),
  1215 + //横轴间距
  1216 + crossAxisSpacing: w(15),
  1217 + //子组件宽高长度比例
  1218 + childAspectRatio:
  1219 + (ScreenUtil().screenWidth - w(62)) / 2 / 370),
  1220 + itemBuilder: (BuildContext context, int index) {
  1221 + ThemeSunModel themeModel = themeDatasno[index];
  1222 + return InkWell(
  1223 + onTap: () {
  1224 + List<String> temp =
  1225 + themeDatasno.map((e) => e.url).toList();
  1226 + print(temp);
  1227 + _showPhotoView(context, indexSelect,
  1228 + themeDatasno.map((e) => e.url).toList());
  1229 + },
  1230 + child: Container(
  1231 + decoration: BoxDecoration(
  1232 + borderRadius: BorderRadius.circular(r(10)),
  1233 + border: Border.all(
  1234 + color: indexSelect == index
  1235 + ? MyColours.color_005AA7
  1236 + : MyColours.color_DBDBDB,
  1237 + width: indexSelect == index ? w(2) : w(1))),
  1238 + child: Column(
  1239 + children: [
  1240 + VEmptyView(10),
  1241 + CachedNetworkImage(
  1242 + imageUrl: themeModel.url,
  1243 + width: (ScreenUtil().screenWidth - w(62)) / 2,
  1244 + height: w(348),
  1245 + fit: BoxFit.fitWidth,
  1246 + alignment: Alignment.topCenter,
197 ), 1247 ),
198 - ));  
199 - })) 1248 + VEmptyView(20),
  1249 + Container(
  1250 + padding: EdgeInsets.symmetric(
  1251 + vertical: w(6), horizontal: w(2)),
  1252 + width: double.infinity,
  1253 + child: Text(
  1254 + themeModel.name,
  1255 + maxLines: 1,
  1256 + overflow: TextOverflow.ellipsis,
  1257 + textAlign: TextAlign.left,
  1258 + style: TextStyle(
  1259 + color: MyColours.color_000000,
  1260 + fontSize: font(14)),
  1261 + ),
  1262 + )
  1263 + ],
  1264 + ),
  1265 + ));
  1266 + })
200 ], 1267 ],
201 - )) 1268 + )))
202 ], 1269 ],
203 ), 1270 ),
204 ); 1271 );
  1 +import 'package:flutter/material.dart';
  2 +
  3 +class ThemeModel {
  4 + String colorName;
  5 + String colorValueS; //渐变色起始值
  6 + String colorValueM; //渐变色中间值
  7 + String colorValueE; //渐变色结束值
  8 + List<ThemeSunModel> urls; //当前色值下的模版链接集合
  9 +
  10 + ThemeModel();
  11 +
  12 + ThemeModel.fromJson(Map<String, dynamic> json) {
  13 + colorName = json['color_name'];
  14 + colorValueS = json['color_value_s'];
  15 + colorValueM = json['color_value_m'];
  16 + colorValueE = json['color_value_e'];
  17 + urls = <ThemeSunModel>[];
  18 + if (json['urls'] != null) {
  19 + json['urls'].forEach((v) {
  20 + if (v is ThemeSunModel) {
  21 + urls.add(v);
  22 + } else {
  23 + urls.add(new ThemeSunModel.fromJson(v));
  24 + }
  25 + });
  26 + }
  27 + }
  28 +
  29 + Map<String, dynamic> toJson() => <String, dynamic>{
  30 + "color_name": colorName,
  31 + "color_value_s": colorValueS,
  32 + "color_value_m": colorValueM,
  33 + "color_value_e": colorValueE,
  34 + 'urls': urls
  35 + };
  36 +}
  37 +
  38 +class ThemeSunModel {
  39 + String name; //模版名称
  40 + String id; //模版编号
  41 + String url; //当前色值下的模版链接
  42 +
  43 + ThemeSunModel();
  44 +
  45 + factory ThemeSunModel.fromJson(Map<String, dynamic> json) => ThemeSunModel()
  46 + ..name = json["name"]
  47 + ..id = json["id"]
  48 + ..url = json["url"];
  49 +
  50 + Map<String, dynamic> toJson() => <String, dynamic>{
  51 + "name": name,
  52 + "id": id,
  53 + "url": url,
  54 + };
  55 +}
@@ -40,6 +40,7 @@ import '../models/cookbook_model.dart'; @@ -40,6 +40,7 @@ import '../models/cookbook_model.dart';
40 import '../models/radio_model.dart'; 40 import '../models/radio_model.dart';
41 import '../models/seller_version_model.dart'; 41 import '../models/seller_version_model.dart';
42 import '../models/theme_color_model.dart'; 42 import '../models/theme_color_model.dart';
  43 +import '../pages/my/marketing_center/theme_model.dart';
43 44
44 typedef CustomCallBack = void Function(Object object); 45 typedef CustomCallBack = void Function(Object object);
45 typedef CustomCallBackMap = void Function(Map<String, String> object); 46 typedef CustomCallBackMap = void Function(Map<String, String> object);
@@ -6279,6 +6280,108 @@ class DialogUtil { @@ -6279,6 +6280,108 @@ class DialogUtil {
6279 } 6280 }
6280 6281
6281 //主题颜色选择弹框 6282 //主题颜色选择弹框
  6283 + static showThemeColorSelectDialogNew(
  6284 + BuildContext context, List<ThemeModel> themeShow,
  6285 + {CustomCallBack callback}) {
  6286 + ScrollController controller = ScrollController();
  6287 + return showModalBottomSheet(
  6288 + context: context,
  6289 + isScrollControlled: true,
  6290 + shape: RoundedRectangleBorder(
  6291 + borderRadius: BorderRadius.only(
  6292 + topLeft: Radius.circular(30), topRight: Radius.circular(30)),
  6293 + ),
  6294 + builder: (context) {
  6295 + Widget widget = Container(
  6296 + width: double.infinity,
  6297 + // height: w(536),
  6298 + color: MyColours.color_ffffff,
  6299 + child: Stack(children: [
  6300 + SingleChildScrollView(
  6301 + controller: controller,
  6302 + child: Column(
  6303 + mainAxisSize: MainAxisSize.min,
  6304 + children: <Widget>[
  6305 + VEmptyView(174),
  6306 + GridView.builder(
  6307 + padding: EdgeInsets.symmetric(horizontal: w(16)),
  6308 + controller: controller,
  6309 + // padding: EdgeInsets.only(top: ScreenUtil().getAdapterSize(10)),
  6310 + shrinkWrap: true,
  6311 + itemCount: themeShow.length,
  6312 + //SliverGridDelegateWithFixedCrossAxisCount 构建一个横轴固定数量Widget
  6313 + gridDelegate:
  6314 + SliverGridDelegateWithFixedCrossAxisCount(
  6315 + //横轴元素个数
  6316 + crossAxisCount: 3,
  6317 + //纵轴间距
  6318 + mainAxisSpacing: w(20),
  6319 + //横轴间距
  6320 + crossAxisSpacing: w(20),
  6321 + //子组件宽高长度比例
  6322 + childAspectRatio: 5 / 3),
  6323 + itemBuilder: (BuildContext context, int index) {
  6324 + return InkWell(
  6325 + onTap: () {
  6326 + Navigator.pop(context);
  6327 + callback(themeShow[index].colorName);
  6328 + },
  6329 + child: Container(
  6330 + // width: w(100),
  6331 + height: w(60),
  6332 + alignment: Alignment.bottomCenter,
  6333 + decoration: BoxDecoration(
  6334 + gradient: LinearGradient(
  6335 + stops: [
  6336 + -0.5747,
  6337 + 0.5572,
  6338 + 1.4872
  6339 + ],
  6340 + colors: [
  6341 + Utils.hexStringColor(
  6342 + themeShow[index].colorValueS),
  6343 + Utils.hexStringColor(
  6344 + themeShow[index].colorValueM),
  6345 + Utils.hexStringColor(
  6346 + themeShow[index].colorValueE),
  6347 + ],
  6348 + begin: Alignment.topLeft,
  6349 + end: Alignment.bottomRight),
  6350 + ),
  6351 + child: Container(
  6352 + // width: w(100),
  6353 + // height: w(27),
  6354 + child: Text(themeShow[index].colorName,
  6355 + style: TextStyle(
  6356 + color: MyColours.color_ffffff,
  6357 + fontWeight: FontWeight.bold,
  6358 + fontSize: font(16))))));
  6359 + }),
  6360 + VEmptyView(82),
  6361 + ],
  6362 + )),
  6363 + Positioned(
  6364 + right: w(10),
  6365 + top: w(25),
  6366 + child: InkWell(
  6367 + onTap: () {
  6368 + Navigator.pop(context);
  6369 + },
  6370 + child: Padding(
  6371 + padding: EdgeInsets.symmetric(horizontal: w(18)),
  6372 + child: Text("取消",
  6373 + style: TextStyle(
  6374 + fontWeight: FontWeight.bold,
  6375 + fontSize: ScreenUtil().setSp(32),
  6376 + color: MyColours.color_000000)),
  6377 + ))),
  6378 + ]),
  6379 + );
  6380 + return widget;
  6381 + });
  6382 + }
  6383 +
  6384 + //主题颜色选择弹框
6282 static showThemeColorSelectDialog( 6385 static showThemeColorSelectDialog(
6283 BuildContext context, List<ThemeColorModel> themeColorData, 6386 BuildContext context, List<ThemeColorModel> themeColorData,
6284 {CustomCallBack callback}) { 6387 {CustomCallBack callback}) {
@@ -50,6 +50,38 @@ import '../models/recharge_list_model.dart'; @@ -50,6 +50,38 @@ import '../models/recharge_list_model.dart';
50 typedef BookTimeSetCallback = void Function(bool needChange); 50 typedef BookTimeSetCallback = void Function(bool needChange);
51 51
52 class Utils { 52 class Utils {
  53 + /// 十六进制颜色
  54 + /// colorString,字符串,例如:'0x000000' '0xff000000' '#000000' '#000000',
  55 + /// alpha,透明度[0.0, 1.0]
  56 + static Color hexStringColor(String colorString, {double alpha = 1}) {
  57 + colorString = '0x' + colorString;
  58 + if (alpha < 0) {
  59 + alpha = 0;
  60 + } else if (alpha > 1) {
  61 + alpha = 1;
  62 + }
  63 + String colorStr = colorString;
  64 + // colorString未带0xff前缀并且长度为6
  65 + if (!colorStr.startsWith('0xff') && colorStr.length == 6) {
  66 + colorStr = '0xff' + colorStr;
  67 + }
  68 + // colorString为8位,如0x000000
  69 + if (colorStr.startsWith('0x') && colorStr.length == 8) {
  70 + colorStr = colorStr.replaceRange(0, 2, '0xff');
  71 + }
  72 + // colorString为7位,如#000000
  73 + if (colorStr.startsWith('#') && colorStr.length == 7) {
  74 + colorStr = colorStr.replaceRange(0, 1, '0xff');
  75 + }
  76 + // 先分别获取色值的RGB通道
  77 + Color color = Color(int.parse(colorStr));
  78 + int red = color.red;
  79 + int green = color.green;
  80 + int blue = color.blue;
  81 + // 通过fromRGBO返回带透明度和RGB值的颜色
  82 + return Color.fromRGBO(red, green, blue, alpha);
  83 + }
  84 +
53 ///店铺是否过期 85 ///店铺是否过期
54 static isStoreEdate() { 86 static isStoreEdate() {
55 if (App.sp.containsKey('sellerEdate')) { 87 if (App.sp.containsKey('sellerEdate')) {