Commit 93ffde6bb4038b759bb9fe963a36f407947baa5b

Authored by wdn127929
1 parent 4779ef0c

主题选择本地数据

... ... @@ -47,7 +47,7 @@ class SellerVersionSunModel {
this.edate,
this.cdate});
SellerVersionSunModel.fromJson(Map<String, dynamic> json) {
SellerVersionSunModel.fromJson(Map<String, dynamic> json){
id = json['id'];
sid = json['sid'];
vid = json['vid'];
... ... @@ -58,7 +58,7 @@ class SellerVersionSunModel {
// edate = json['vid'] == '4' ? '1695005146' : '1694832346';
edate = json['edate'];
cdate = json['cdate'];
}
}
Map<String, dynamic> toJson() {
final Map<String, dynamic> data = new Map<String, dynamic>();
... ...
import 'package:cached_network_image/cached_network_image.dart';
import 'package:flutter/material.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart';
import 'package:one_key/pages/my/marketing_center/theme_model.dart';
import 'package:one_key/widgets/system_app_bar.dart';
import 'package:one_key/widgets/v_empty_view.dart';
import '../../../res/colors.dart';
import '../../../utils/dialog_util.dart';
import '../../../utils/screen_util.dart';
import '../../../utils/utils.dart';
import '../../../widgets/MyDivider.dart';
import '../../online_check/photo_view_wiget.dart';
import 'dart:convert' as convert;
/**
*
* 邀请函主题选择页面
... ... @@ -24,8 +28,928 @@ class InvitationThemeHomePage extends StatefulWidget {
}
class _InvitationThemeHomePageState extends State<InvitationThemeHomePage> {
// 主题数据
Map<String, ThemeModel> themeDatas = {};
ScrollController controller = ScrollController();
//当前店铺选中的颜色和板式
String themeColor = '摩洛哥蓝';
String themeType = '4';
int indexSelect = 0; //选中第几个模版
List<ThemeSunModel> themeDatasno = [];
@override
void initState() {
super.initState();
// //模版1
Map<String, dynamic> jsonSun11 = {
'name': '1 经典图片式',
'id': '1',
'url': 'https://qn.colorcun.com/template/jingdianbianyi.png',
};
ThemeSunModel themeSunModel11 = ThemeSunModel.fromJson(jsonSun11);
themeDatasno.add(themeSunModel11);
//黑蓝过度
_addHeilanguodu();
//石绿过度
_addShilvuodu();
//中国红过度
_addZhongguohongguodu();
//群青过度
_addQunqingguodu();
//深中国红
_addShenzhongguohong();
//中国红
_addZhongguohong();
//蓝采和
_addLancaihe();
//石绿
_addShilv();
//姜黄
_addJianghuang();
//金黄
_addJinhuang();
//苍黄
_addCanghuang();
//群青
_addQunqing();
//摩洛哥蓝
_addMoluogelan();
print(themeDatas);
Map<String, String> map = {
'color': convert.jsonEncode(themeDatas),
'no_color': convert.jsonEncode(themeDatasno)
};
print(map);
}
_addMoluogelan() {
List<ThemeSunModel> urls = [];
// //模版1
// Map<String, dynamic> jsonSun11 = {
// 'name': '1 经典图片式',
// 'id': '1',
// 'url': 'https://qn.colorcun.com/template/jingdianbianyi.png',
// };
// ThemeSunModel themeSunModel11 = ThemeSunModel.fromJson(jsonSun11);
// urls.add(themeSunModel11);
//模版2
Map<String, dynamic> jsonSun12 = {
'name': '2 简洁图文A(多色)',
'id': '2',
'url': 'https://qn.colorcun.com/template/moluogelan-2.png',
};
ThemeSunModel themeSunModel12 = ThemeSunModel.fromJson(jsonSun12);
urls.add(themeSunModel12);
//模版3
Map<String, dynamic> jsonSun13 = {
'name': '3 简洁信息图文A(多色)',
'id': '3',
'url': 'https://qn.colorcun.com/template/moluogelan-3.png',
};
ThemeSunModel themeSunModel13 = ThemeSunModel.fromJson(jsonSun13);
urls.add(themeSunModel13);
//模版4
Map<String, dynamic> jsonSun14 = {
'name': '4 半屏邀请函A(多色)',
'id': '4',
'url': 'https://qn.colorcun.com/template/moluogelan-4.png',
};
ThemeSunModel themeSunModel14 = ThemeSunModel.fromJson(jsonSun14);
urls.add(themeSunModel14);
//模版5
Map<String, dynamic> jsonSun15 = {
'name': '5 半屏邀请函B(多色)',
'id': '5',
'url': 'https://qn.colorcun.com/template/moluogelan-5.png',
};
ThemeSunModel themeSunModel15 = ThemeSunModel.fromJson(jsonSun15);
urls.add(themeSunModel15);
//模版6
Map<String, dynamic> jsonSun16 = {
'name': '6 无预订包间图片A(多色)',
'id': '6',
'url': 'https://qn.colorcun.com/template/moluogelan-6.png',
};
ThemeSunModel themeSunModel16 = ThemeSunModel.fromJson(jsonSun16);
urls.add(themeSunModel16);
//模版7
Map<String, dynamic> jsonSun17 = {
'name': '7 无预订包间图片B',
'id': '7',
'url': 'https://qn.colorcun.com/template/moluogelan-7.png',
};
ThemeSunModel themeSunModel17 = ThemeSunModel.fromJson(jsonSun17);
urls.add(themeSunModel17);
Map<String, dynamic> json1 = {
'color_name': '摩洛哥蓝',
'color_value_s': 'FF19516A',
'color_value_m': 'FF19516A',
'color_value_e': 'FF19516A',
'urls': urls
};
ThemeModel themeModel1 = ThemeModel.fromJson(json1);
// themeDatas.add(themeModel1);
themeDatas['摩洛哥蓝'] = themeModel1;
}
_addQunqing() {
List<ThemeSunModel> urls = [];
//模版2
Map<String, dynamic> jsonSun12 = {
'name': '2 简洁图文A(多色)',
'id': '2',
'url': 'https://qn.colorcun.com/template/qunqing-2.png',
};
ThemeSunModel themeSunModel12 = ThemeSunModel.fromJson(jsonSun12);
urls.add(themeSunModel12);
//模版3
Map<String, dynamic> jsonSun13 = {
'name': '3 简洁信息图文A(多色)',
'id': '3',
'url': 'https://qn.colorcun.com/template/qunqing-3.png',
};
ThemeSunModel themeSunModel13 = ThemeSunModel.fromJson(jsonSun13);
urls.add(themeSunModel13);
//模版4
Map<String, dynamic> jsonSun14 = {
'name': '4 半屏邀请函A(多色)',
'id': '4',
'url': 'https://qn.colorcun.com/template/qunqing-4.png',
};
ThemeSunModel themeSunModel14 = ThemeSunModel.fromJson(jsonSun14);
urls.add(themeSunModel14);
//模版5
Map<String, dynamic> jsonSun15 = {
'name': '5 半屏邀请函B(多色)',
'id': '5',
'url': 'https://qn.colorcun.com/template/qunqing-5.png',
};
ThemeSunModel themeSunModel15 = ThemeSunModel.fromJson(jsonSun15);
urls.add(themeSunModel15);
//模版6
Map<String, dynamic> jsonSun16 = {
'name': '6 无预订包间图片A(多色)',
'id': '6',
'url': 'https://qn.colorcun.com/template/qunqing-6.png',
};
ThemeSunModel themeSunModel16 = ThemeSunModel.fromJson(jsonSun16);
urls.add(themeSunModel16);
//模版7
Map<String, dynamic> jsonSun17 = {
'name': '7 无预订包间图片B',
'id': '7',
'url': 'https://qn.colorcun.com/template/qunqing-7.png',
};
ThemeSunModel themeSunModel17 = ThemeSunModel.fromJson(jsonSun17);
urls.add(themeSunModel17);
Map<String, dynamic> json1 = {
'color_name': '群青',
'color_value_s': 'FF0143A3',
'color_value_m': 'FF0143A3',
'color_value_e': 'FF0143A3',
'urls': urls
};
ThemeModel themeModel1 = ThemeModel.fromJson(json1);
// themeDatas.add(themeModel1);
themeDatas['群青'] = themeModel1;
}
_addCanghuang() {
List<ThemeSunModel> urls = [];
//模版2
Map<String, dynamic> jsonSun12 = {
'name': '2 简洁图文A(多色)',
'id': '2',
'url': 'https://qn.colorcun.com/template/canghuang-2.png',
};
ThemeSunModel themeSunModel12 = ThemeSunModel.fromJson(jsonSun12);
urls.add(themeSunModel12);
//模版3
Map<String, dynamic> jsonSun13 = {
'name': '3 简洁信息图文A(多色)',
'id': '3',
'url': 'https://qn.colorcun.com/template/canghuang-3.png',
};
ThemeSunModel themeSunModel13 = ThemeSunModel.fromJson(jsonSun13);
urls.add(themeSunModel13);
//模版4
Map<String, dynamic> jsonSun14 = {
'name': '4 半屏邀请函A(多色)',
'id': '4',
'url': 'https://qn.colorcun.com/template/canghuang-4.png',
};
ThemeSunModel themeSunModel14 = ThemeSunModel.fromJson(jsonSun14);
urls.add(themeSunModel14);
//模版5
Map<String, dynamic> jsonSun15 = {
'name': '5 半屏邀请函B(多色)',
'id': '5',
'url': 'https://qn.colorcun.com/template/canghuang-5.png',
};
ThemeSunModel themeSunModel15 = ThemeSunModel.fromJson(jsonSun15);
urls.add(themeSunModel15);
//模版6
Map<String, dynamic> jsonSun16 = {
'name': '6 无预订包间图片A(多色)',
'id': '6',
'url': 'https://qn.colorcun.com/template/canghuang-6.png',
};
ThemeSunModel themeSunModel16 = ThemeSunModel.fromJson(jsonSun16);
urls.add(themeSunModel16);
//模版7
Map<String, dynamic> jsonSun17 = {
'name': '7 无预订包间图片B',
'id': '7',
'url': 'https://qn.colorcun.com/template/canghuang-7.png',
};
ThemeSunModel themeSunModel17 = ThemeSunModel.fromJson(jsonSun17);
urls.add(themeSunModel17);
Map<String, dynamic> json1 = {
'color_name': '苍黄',
'color_value_s': 'FFC85306',
'color_value_m': 'FFC85306',
'color_value_e': 'FFC85306',
'urls': urls
};
ThemeModel themeModel1 = ThemeModel.fromJson(json1);
// themeDatas.add(themeModel1);
themeDatas['苍黄'] = themeModel1;
}
_addJinhuang() {
List<ThemeSunModel> urls = [];
//模版2
Map<String, dynamic> jsonSun12 = {
'name': '2 简洁图文A(多色)',
'id': '2',
'url': 'https://qn.colorcun.com/template/jinhuang-2.png',
};
ThemeSunModel themeSunModel12 = ThemeSunModel.fromJson(jsonSun12);
urls.add(themeSunModel12);
//模版3
Map<String, dynamic> jsonSun13 = {
'name': '3 简洁信息图文A(多色)',
'id': '3',
'url': 'https://qn.colorcun.com/template/jinhuang-3.png',
};
ThemeSunModel themeSunModel13 = ThemeSunModel.fromJson(jsonSun13);
urls.add(themeSunModel13);
//模版4
Map<String, dynamic> jsonSun14 = {
'name': '4 半屏邀请函A(多色)',
'id': '4',
'url': 'https://qn.colorcun.com/template/jinhuang-4.png',
};
ThemeSunModel themeSunModel14 = ThemeSunModel.fromJson(jsonSun14);
urls.add(themeSunModel14);
//模版5
Map<String, dynamic> jsonSun15 = {
'name': '5 半屏邀请函B(多色)',
'id': '5',
'url': 'https://qn.colorcun.com/template/jinhuang-5.png',
};
ThemeSunModel themeSunModel15 = ThemeSunModel.fromJson(jsonSun15);
urls.add(themeSunModel15);
//模版6
Map<String, dynamic> jsonSun16 = {
'name': '6 无预订包间图片A(多色)',
'id': '6',
'url': 'https://qn.colorcun.com/template/jinhuang-6.png',
};
ThemeSunModel themeSunModel16 = ThemeSunModel.fromJson(jsonSun16);
urls.add(themeSunModel16);
//模版7
Map<String, dynamic> jsonSun17 = {
'name': '7 无预订包间图片B',
'id': '7',
'url': 'https://qn.colorcun.com/template/jinhuang-7.png',
};
ThemeSunModel themeSunModel17 = ThemeSunModel.fromJson(jsonSun17);
urls.add(themeSunModel17);
Map<String, dynamic> json1 = {
'color_name': '金黄',
'color_value_s': 'FFC67B3A',
'color_value_m': 'FFC67B3A',
'color_value_e': 'FFC67B3A',
'urls': urls
};
ThemeModel themeModel1 = ThemeModel.fromJson(json1);
// themeDatas.add(themeModel1);
themeDatas['金黄'] = themeModel1;
}
_addJianghuang() {
List<ThemeSunModel> urls = [];
//模版2
Map<String, dynamic> jsonSun12 = {
'name': '2 简洁图文A(多色)',
'id': '2',
'url': 'https://qn.colorcun.com/template/jianghuang-2.png',
};
ThemeSunModel themeSunModel12 = ThemeSunModel.fromJson(jsonSun12);
urls.add(themeSunModel12);
//模版3
Map<String, dynamic> jsonSun13 = {
'name': '3 简洁信息图文A(多色)',
'id': '3',
'url': 'https://qn.colorcun.com/template/jianghuang-3.png',
};
ThemeSunModel themeSunModel13 = ThemeSunModel.fromJson(jsonSun13);
urls.add(themeSunModel13);
//模版4
Map<String, dynamic> jsonSun14 = {
'name': '4 半屏邀请函A(多色)',
'id': '4',
'url': 'https://qn.colorcun.com/template/jianghuang-4.png',
};
ThemeSunModel themeSunModel14 = ThemeSunModel.fromJson(jsonSun14);
urls.add(themeSunModel14);
//模版5
Map<String, dynamic> jsonSun15 = {
'name': '5 半屏邀请函B(多色)',
'id': '5',
'url': 'https://qn.colorcun.com/template/jianghuang-5.png',
};
ThemeSunModel themeSunModel15 = ThemeSunModel.fromJson(jsonSun15);
urls.add(themeSunModel15);
//模版6
Map<String, dynamic> jsonSun16 = {
'name': '6 无预订包间图片A(多色)',
'id': '6',
'url': 'https://qn.colorcun.com/template/jianghuang-6.png',
};
ThemeSunModel themeSunModel16 = ThemeSunModel.fromJson(jsonSun16);
urls.add(themeSunModel16);
//模版7
Map<String, dynamic> jsonSun17 = {
'name': '7 无预订包间图片B',
'id': '7',
'url': 'https://qn.colorcun.com/template/jianghuang-7.png',
};
ThemeSunModel themeSunModel17 = ThemeSunModel.fromJson(jsonSun17);
urls.add(themeSunModel17);
Map<String, dynamic> json1 = {
'color_name': '姜黄',
'color_value_s': 'FFB39437',
'color_value_m': 'FFB39437',
'color_value_e': 'FFB39437',
'urls': urls
};
ThemeModel themeModel1 = ThemeModel.fromJson(json1);
// themeDatas.add(themeModel1);
themeDatas['姜黄'] = themeModel1;
}
_addShilv() {
List<ThemeSunModel> urls = [];
//模版2
Map<String, dynamic> jsonSun12 = {
'name': '2 简洁图文A(多色)',
'id': '2',
'url': 'https://qn.colorcun.com/template/shilv-2.png',
};
ThemeSunModel themeSunModel12 = ThemeSunModel.fromJson(jsonSun12);
urls.add(themeSunModel12);
//模版3
Map<String, dynamic> jsonSun13 = {
'name': '3 简洁信息图文A(多色)',
'id': '3',
'url': 'https://qn.colorcun.com/template/shilv-3.png',
};
ThemeSunModel themeSunModel13 = ThemeSunModel.fromJson(jsonSun13);
urls.add(themeSunModel13);
//模版4
Map<String, dynamic> jsonSun14 = {
'name': '4 半屏邀请函A(多色)',
'id': '4',
'url': 'https://qn.colorcun.com/template/shilv-4.png',
};
ThemeSunModel themeSunModel14 = ThemeSunModel.fromJson(jsonSun14);
urls.add(themeSunModel14);
//模版5
Map<String, dynamic> jsonSun15 = {
'name': '5 半屏邀请函B(多色)',
'id': '5',
'url': 'https://qn.colorcun.com/template/shilv-5.png',
};
ThemeSunModel themeSunModel15 = ThemeSunModel.fromJson(jsonSun15);
urls.add(themeSunModel15);
//模版6
Map<String, dynamic> jsonSun16 = {
'name': '6 无预订包间图片A(多色)',
'id': '6',
'url': 'https://qn.colorcun.com/template/shilv-6.png',
};
ThemeSunModel themeSunModel16 = ThemeSunModel.fromJson(jsonSun16);
urls.add(themeSunModel16);
//模版7
Map<String, dynamic> jsonSun17 = {
'name': '7 无预订包间图片B',
'id': '7',
'url': 'https://qn.colorcun.com/template/shilv-7.png',
};
ThemeSunModel themeSunModel17 = ThemeSunModel.fromJson(jsonSun17);
urls.add(themeSunModel17);
Map<String, dynamic> json1 = {
'color_name': '石绿',
'color_value_s': 'FF206864',
'color_value_m': 'FF206864',
'color_value_e': 'FF206864',
'urls': urls
};
ThemeModel themeModel1 = ThemeModel.fromJson(json1);
// themeDatas.add(themeModel1);
themeDatas['石绿'] = themeModel1;
}
_addLancaihe() {
List<ThemeSunModel> urls = [];
//模版2
Map<String, dynamic> jsonSun12 = {
'name': '2 简洁图文A(多色)',
'id': '2',
'url': 'https://qn.colorcun.com/template/lancaihe-2.png',
};
ThemeSunModel themeSunModel12 = ThemeSunModel.fromJson(jsonSun12);
urls.add(themeSunModel12);
//模版3
Map<String, dynamic> jsonSun13 = {
'name': '3 简洁信息图文A(多色)',
'id': '3',
'url': 'https://qn.colorcun.com/template/lancaihe-3.png',
};
ThemeSunModel themeSunModel13 = ThemeSunModel.fromJson(jsonSun13);
urls.add(themeSunModel13);
//模版4
Map<String, dynamic> jsonSun14 = {
'name': '4 半屏邀请函A(多色)',
'id': '4',
'url': 'https://qn.colorcun.com/template/lancaihe-4.png',
};
ThemeSunModel themeSunModel14 = ThemeSunModel.fromJson(jsonSun14);
urls.add(themeSunModel14);
//模版5
Map<String, dynamic> jsonSun15 = {
'name': '5 半屏邀请函B(多色)',
'id': '5',
'url': 'https://qn.colorcun.com/template/lancaihe-5.png',
};
ThemeSunModel themeSunModel15 = ThemeSunModel.fromJson(jsonSun15);
urls.add(themeSunModel15);
//模版6
Map<String, dynamic> jsonSun16 = {
'name': '6 无预订包间图片A(多色)',
'id': '6',
'url': 'https://qn.colorcun.com/template/lancaihe-6.png',
};
ThemeSunModel themeSunModel16 = ThemeSunModel.fromJson(jsonSun16);
urls.add(themeSunModel16);
//模版7
Map<String, dynamic> jsonSun17 = {
'name': '7 无预订包间图片B',
'id': '7',
'url': 'https://qn.colorcun.com/template/lancaihe-7.png',
};
ThemeSunModel themeSunModel17 = ThemeSunModel.fromJson(jsonSun17);
urls.add(themeSunModel17);
Map<String, dynamic> json1 = {
'color_name': '蓝采和',
'color_value_s': 'FF06436F',
'color_value_m': 'FF06436F',
'color_value_e': 'FF06436F',
'urls': urls
};
ThemeModel themeModel1 = ThemeModel.fromJson(json1);
// themeDatas.add(themeModel1);
themeDatas['蓝采和'] = themeModel1;
}
_addZhongguohong() {
List<ThemeSunModel> urls = [];
//模版2
Map<String, dynamic> jsonSun12 = {
'name': '2 简洁图文A(多色)',
'id': '2',
'url': 'https://qn.colorcun.com/template/zhongguohong-2.png',
};
ThemeSunModel themeSunModel12 = ThemeSunModel.fromJson(jsonSun12);
urls.add(themeSunModel12);
//模版3
Map<String, dynamic> jsonSun13 = {
'name': '3 简洁信息图文A(多色)',
'id': '3',
'url': 'https://qn.colorcun.com/template/zhongguohong-3.png',
};
ThemeSunModel themeSunModel13 = ThemeSunModel.fromJson(jsonSun13);
urls.add(themeSunModel13);
//模版4
Map<String, dynamic> jsonSun14 = {
'name': '4 半屏邀请函A(多色)',
'id': '4',
'url': 'https://qn.colorcun.com/template/zhongguohong-4.png',
};
ThemeSunModel themeSunModel14 = ThemeSunModel.fromJson(jsonSun14);
urls.add(themeSunModel14);
//模版5
Map<String, dynamic> jsonSun15 = {
'name': '5 半屏邀请函B(多色)',
'id': '5',
'url': 'https://qn.colorcun.com/template/zhongguohong-5.png',
};
ThemeSunModel themeSunModel15 = ThemeSunModel.fromJson(jsonSun15);
urls.add(themeSunModel15);
//模版6
Map<String, dynamic> jsonSun16 = {
'name': '6 无预订包间图片A(多色)',
'id': '6',
'url': 'https://qn.colorcun.com/template/zhongguohong-6.png',
};
ThemeSunModel themeSunModel16 = ThemeSunModel.fromJson(jsonSun16);
urls.add(themeSunModel16);
//模版7
Map<String, dynamic> jsonSun17 = {
'name': '7 无预订包间图片B',
'id': '7',
'url': 'https://qn.colorcun.com/template/zhongguohong-7.png',
};
ThemeSunModel themeSunModel17 = ThemeSunModel.fromJson(jsonSun17);
urls.add(themeSunModel17);
Map<String, dynamic> json1 = {
'color_name': '中国红',
'color_value_s': 'FFAF231C',
'color_value_m': 'FFAF231C',
'color_value_e': 'FFAF231C',
'urls': urls
};
ThemeModel themeModel1 = ThemeModel.fromJson(json1);
// themeDatas.add(themeModel1);
themeDatas['中国红'] = themeModel1;
}
_addShenzhongguohong() {
List<ThemeSunModel> urls = [];
//模版2
Map<String, dynamic> jsonSun12 = {
'name': '2 简洁图文A(多色)',
'id': '2',
'url': 'https://qn.colorcun.com/template/shenzhongguohong-2.png',
};
ThemeSunModel themeSunModel12 = ThemeSunModel.fromJson(jsonSun12);
urls.add(themeSunModel12);
//模版3
Map<String, dynamic> jsonSun13 = {
'name': '3 简洁信息图文A(多色)',
'id': '3',
'url': 'https://qn.colorcun.com/template/shenzhongguohong-3.png',
};
ThemeSunModel themeSunModel13 = ThemeSunModel.fromJson(jsonSun13);
urls.add(themeSunModel13);
//模版4
Map<String, dynamic> jsonSun14 = {
'name': '4 半屏邀请函A(多色)',
'id': '4',
'url': 'https://qn.colorcun.com/template/shenzhongguohong-4.png',
};
ThemeSunModel themeSunModel14 = ThemeSunModel.fromJson(jsonSun14);
urls.add(themeSunModel14);
//模版5
Map<String, dynamic> jsonSun15 = {
'name': '5 半屏邀请函B(多色)',
'id': '5',
'url': 'https://qn.colorcun.com/template/shenzhongguohong-5.png',
};
ThemeSunModel themeSunModel15 = ThemeSunModel.fromJson(jsonSun15);
urls.add(themeSunModel15);
//模版6
Map<String, dynamic> jsonSun16 = {
'name': '6 无预订包间图片A(多色)',
'id': '6',
'url': 'https://qn.colorcun.com/template/shenzhongguohong-6.png',
};
ThemeSunModel themeSunModel16 = ThemeSunModel.fromJson(jsonSun16);
urls.add(themeSunModel16);
//模版7
Map<String, dynamic> jsonSun17 = {
'name': '7 无预订包间图片B',
'id': '7',
'url': 'https://qn.colorcun.com/template/shenzhongguohong-7.png',
};
ThemeSunModel themeSunModel17 = ThemeSunModel.fromJson(jsonSun17);
urls.add(themeSunModel17);
Map<String, dynamic> json1 = {
'color_name': '深中国红',
'color_value_s': 'FF86201B',
'color_value_m': 'FF86201B',
'color_value_e': 'FF86201B',
'urls': urls
};
ThemeModel themeModel1 = ThemeModel.fromJson(json1);
// themeDatas.add(themeModel1);
themeDatas['深中国红'] = themeModel1;
}
_addHeilanguodu() {
List<ThemeSunModel> urls = [];
//模版3
Map<String, dynamic> jsonSun13 = {
'name': '3 简洁信息图文A(多色)',
'id': '3',
'url': 'https://qn.colorcun.com/template/heilanguodu-3.png',
};
ThemeSunModel themeSunModel13 = ThemeSunModel.fromJson(jsonSun13);
urls.add(themeSunModel13);
//模版4
Map<String, dynamic> jsonSun14 = {
'name': '4 半屏邀请函A(多色)',
'id': '4',
'url': 'https://qn.colorcun.com/template/heilanguodu-4.png',
};
ThemeSunModel themeSunModel14 = ThemeSunModel.fromJson(jsonSun14);
urls.add(themeSunModel14);
//模版5
Map<String, dynamic> jsonSun15 = {
'name': '5 半屏邀请函B(多色)',
'id': '5',
'url': 'https://qn.colorcun.com/template/heilanguodu-5.png',
};
ThemeSunModel themeSunModel15 = ThemeSunModel.fromJson(jsonSun15);
urls.add(themeSunModel15);
//模版6
Map<String, dynamic> jsonSun16 = {
'name': '6 无预订包间图片A(多色)',
'id': '6',
'url': 'https://qn.colorcun.com/template/heilanguodu-6.png',
};
ThemeSunModel themeSunModel16 = ThemeSunModel.fromJson(jsonSun16);
urls.add(themeSunModel16);
//模版7
Map<String, dynamic> jsonSun17 = {
'name': '7 无预订包间图片B',
'id': '7',
'url': 'https://qn.colorcun.com/template/heilanguodu-7.png',
};
ThemeSunModel themeSunModel17 = ThemeSunModel.fromJson(jsonSun17);
urls.add(themeSunModel17);
Map<String, dynamic> json1 = {
'color_name': '黑蓝过渡',
'color_value_s': 'FF42A5FF',
'color_value_m': 'FF000000',
'color_value_e': 'FF42A5FF',
'urls': urls
};
ThemeModel themeModel1 = ThemeModel.fromJson(json1);
themeDatas['黑蓝过渡'] = themeModel1;
}
_addShilvuodu() {
List<ThemeSunModel> urls = [];
//模版3
Map<String, dynamic> jsonSun13 = {
'name': '3 简洁信息图文A(多色)',
'id': '3',
'url': 'https://qn.colorcun.com/template/shilvguodu-3.png',
};
ThemeSunModel themeSunModel13 = ThemeSunModel.fromJson(jsonSun13);
urls.add(themeSunModel13);
//模版4
Map<String, dynamic> jsonSun14 = {
'name': '4 半屏邀请函A(多色)',
'id': '4',
'url': 'https://qn.colorcun.com/template/shilvguodu-4.png',
};
ThemeSunModel themeSunModel14 = ThemeSunModel.fromJson(jsonSun14);
urls.add(themeSunModel14);
//模版5
Map<String, dynamic> jsonSun15 = {
'name': '5 半屏邀请函B(多色)',
'id': '5',
'url': 'https://qn.colorcun.com/template/shilvguodu-5.png',
};
ThemeSunModel themeSunModel15 = ThemeSunModel.fromJson(jsonSun15);
urls.add(themeSunModel15);
//模版6
Map<String, dynamic> jsonSun16 = {
'name': '6 无预订包间图片A(多色)',
'id': '6',
'url': 'https://qn.colorcun.com/template/shilvguodu-6.png',
};
ThemeSunModel themeSunModel16 = ThemeSunModel.fromJson(jsonSun16);
urls.add(themeSunModel16);
//模版7
Map<String, dynamic> jsonSun17 = {
'name': '7 无预订包间图片B',
'id': '7',
'url': 'https://qn.colorcun.com/template/shilvguodu-7.png',
};
ThemeSunModel themeSunModel17 = ThemeSunModel.fromJson(jsonSun17);
urls.add(themeSunModel17);
Map<String, dynamic> json1 = {
'color_name': '石绿过渡',
'color_value_s': 'FF438E93',
'color_value_m': 'FF206864',
'color_value_e': 'FF42A5FF',
'urls': urls
};
ThemeModel themeModel1 = ThemeModel.fromJson(json1);
// themeDatas.add(themeModel1);
themeDatas['石绿过渡'] = themeModel1;
}
_addZhongguohongguodu() {
List<ThemeSunModel> urls = [];
//模版3
Map<String, dynamic> jsonSun13 = {
'name': '3 简洁信息图文A(多色)',
'id': '3',
'url': 'https://qn.colorcun.com/template/zhongguohongguodu-3.png',
};
ThemeSunModel themeSunModel13 = ThemeSunModel.fromJson(jsonSun13);
urls.add(themeSunModel13);
//模版4
Map<String, dynamic> jsonSun14 = {
'name': '4 半屏邀请函A(多色)',
'id': '4',
'url': 'https://qn.colorcun.com/template/zhongguohongguodu-4.png',
};
ThemeSunModel themeSunModel14 = ThemeSunModel.fromJson(jsonSun14);
urls.add(themeSunModel14);
//模版5
Map<String, dynamic> jsonSun15 = {
'name': '5 半屏邀请函B(多色)',
'id': '5',
'url': 'https://qn.colorcun.com/template/zhongguohongguodu-5.png',
};
ThemeSunModel themeSunModel15 = ThemeSunModel.fromJson(jsonSun15);
urls.add(themeSunModel15);
//模版6
Map<String, dynamic> jsonSun16 = {
'name': '6 无预订包间图片A(多色)',
'id': '6',
'url': 'https://qn.colorcun.com/template/zhongguohongguodu-6.png',
};
ThemeSunModel themeSunModel16 = ThemeSunModel.fromJson(jsonSun16);
urls.add(themeSunModel16);
//模版7
Map<String, dynamic> jsonSun17 = {
'name': '7 无预订包间图片B',
'id': '7',
'url': 'https://qn.colorcun.com/template/zhongguohongguodu-7.png',
};
ThemeSunModel themeSunModel17 = ThemeSunModel.fromJson(jsonSun17);
urls.add(themeSunModel17);
Map<String, dynamic> json1 = {
'color_name': '中国红过渡',
'color_value_s': 'FFAF231C',
'color_value_m': 'FF86201B',
'color_value_e': 'FFAF231C',
'urls': urls
};
ThemeModel themeModel1 = ThemeModel.fromJson(json1);
// themeDatas.add(themeModel1);
themeDatas['中国红过渡'] = themeModel1;
}
_addQunqingguodu() {
List<ThemeSunModel> urls = [];
//模版3
Map<String, dynamic> jsonSun13 = {
'name': '3 简洁信息图文A(多色)',
'id': '3',
'url': 'https://qn.colorcun.com/template/qunqingguodu-3.png',
};
ThemeSunModel themeSunModel13 = ThemeSunModel.fromJson(jsonSun13);
urls.add(themeSunModel13);
//模版4
Map<String, dynamic> jsonSun14 = {
'name': '4 半屏邀请函A(多色)',
'id': '4',
'url': 'https://qn.colorcun.com/template/qunqingguodu-4.png',
};
ThemeSunModel themeSunModel14 = ThemeSunModel.fromJson(jsonSun14);
urls.add(themeSunModel14);
//模版5
Map<String, dynamic> jsonSun15 = {
'name': '5 半屏邀请函B(多色)',
'id': '5',
'url': 'https://qn.colorcun.com/template/qunqingguodu-5.png',
};
ThemeSunModel themeSunModel15 = ThemeSunModel.fromJson(jsonSun15);
urls.add(themeSunModel15);
//模版6
Map<String, dynamic> jsonSun16 = {
'name': '6 无预订包间图片A(多色)',
'id': '6',
'url': 'https://qn.colorcun.com/template/qunqingguodu-6.png',
};
ThemeSunModel themeSunModel16 = ThemeSunModel.fromJson(jsonSun16);
urls.add(themeSunModel16);
//模版7
Map<String, dynamic> jsonSun17 = {
'name': '7 无预订包间图片B',
'id': '7',
'url': 'https://qn.colorcun.com/template/qunqingguodu-7.png',
};
ThemeSunModel themeSunModel17 = ThemeSunModel.fromJson(jsonSun17);
urls.add(themeSunModel17);
Map<String, dynamic> json1 = {
'color_name': '群青过渡',
'color_value_s': 'FF4C8DAD',
'color_value_m': 'FF0143A3',
'color_value_e': 'FF42A5FF',
'urls': urls
};
ThemeModel themeModel1 = ThemeModel.fromJson(json1);
// themeDatas.add(themeModel1);
themeDatas['群青过渡'] = themeModel1;
}
_showPhotoView(BuildContext context, int index, List<String> imgs,
{isShow = false, List dashName}) async {
// if (imgs.length == 1 &&
... ... @@ -83,10 +1007,23 @@ class _InvitationThemeHomePageState extends State<InvitationThemeHomePage> {
body: Column(
children: [
Expanded(
child: Column(
child: SingleChildScrollView(
child: Column(
children: [
InkWell(
onTap: () {},
onTap: () {
List<ThemeModel> themeShow = [];
themeDatas.forEach((key, value) {
themeShow.add(value);
});
DialogUtil.showThemeColorSelectDialogNew(context, themeShow,
callback: (object) {
print(object);
setState(() {
themeColor = object;
});
});
},
child: Padding(
padding: EdgeInsets.only(
left: w(16), top: w(12), bottom: w(12), right: w(24)),
... ... @@ -101,7 +1038,7 @@ class _InvitationThemeHomePageState extends State<InvitationThemeHomePage> {
),
Spacer(),
Text(
'群青绿',
themeDatas[themeColor].colorName,
style: TextStyle(
color: MyColours.color_515151,
fontSize: font(16)),
... ... @@ -136,69 +1073,199 @@ class _InvitationThemeHomePageState extends State<InvitationThemeHomePage> {
child: MyDivider(double.infinity, w(0.5),
color: MyColours.color_E7E7E7)),
VEmptyView(24),
Expanded(
child: GridView.builder(
padding: EdgeInsets.symmetric(horizontal: w(16)),
controller: controller,
// padding: EdgeInsets.only(top: ScreenUtil().getAdapterSize(10)),
shrinkWrap: true,
itemCount: 7,
//SliverGridDelegateWithFixedCrossAxisCount 构建一个横轴固定数量Widget
gridDelegate: SliverGridDelegateWithFixedCrossAxisCount(
//横轴元素个数
crossAxisCount: 2,
//纵轴间距
mainAxisSpacing: w(15),
//横轴间距
crossAxisSpacing: w(15),
//子组件宽高长度比例
childAspectRatio:
(ScreenUtil().screenWidth - w(62)) / 2 / 350),
itemBuilder: (BuildContext context, int index) {
return InkWell(
onTap: () {
_showPhotoView(context, 0, [
'https://qn.colorcun.com/i_theme_1.png',
'https://qn.colorcun.com/i_theme_1.png',
'https://qn.colorcun.com/i_theme_1.png'
]);
},
child: Container(
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(r(10)),
border: Border.all(
color: true
? MyColours.color_005AA7
: MyColours.color_DBDBDB,
width: true ? w(2) : w(1))),
child: Column(
children: [
CachedNetworkImage(
imageUrl:
'https://qn.colorcun.com/i_theme_1.png',
width:
(ScreenUtil().screenWidth - w(62)) / 2,
// height: w(388),
),
VEmptyView(10),
Padding(
padding:
EdgeInsets.symmetric(vertical: w(6)),
child: Text(
'1 经典图片式',
maxLines: 1,
overflow: TextOverflow.ellipsis,
style: TextStyle(
color: MyColours.color_000000,
fontSize: font(14)),
),
)
],
GridView.builder(
padding: EdgeInsets.symmetric(horizontal: w(16)),
controller: controller,
// padding: EdgeInsets.only(top: ScreenUtil().getAdapterSize(10)),
shrinkWrap: true,
itemCount: themeDatas[themeColor].urls.length,
//SliverGridDelegateWithFixedCrossAxisCount 构建一个横轴固定数量Widget
gridDelegate: SliverGridDelegateWithFixedCrossAxisCount(
//横轴元素个数
crossAxisCount: 2,
//纵轴间距
mainAxisSpacing: w(15),
//横轴间距
crossAxisSpacing: w(15),
//子组件宽高长度比例
childAspectRatio:
(ScreenUtil().screenWidth - w(62)) / 2 / 370),
itemBuilder: (BuildContext context, int index) {
ThemeModel themeModel = themeDatas[themeColor];
return InkWell(
onTap: () {
List<String> temp =
themeModel.urls.map((e) => e.url).toList();
print(temp);
_showPhotoView(context, indexSelect,
themeModel.urls.map((e) => e.url).toList());
},
child: Container(
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(r(10)),
border: Border.all(
color: indexSelect == index
? MyColours.color_005AA7
: MyColours.color_DBDBDB,
width: indexSelect == index ? w(2) : w(1))),
child: Column(
children: [
VEmptyView(10),
CachedNetworkImage(
imageUrl: themeModel.urls[index].url,
width: (ScreenUtil().screenWidth - w(62)) / 2,
height: w(348),
fit: BoxFit.fitWidth,
alignment: Alignment.topCenter,
),
VEmptyView(20),
Container(
padding: EdgeInsets.symmetric(
vertical: w(6), horizontal: w(2)),
width: double.infinity,
child: Text(
themeModel.urls[index].name,
maxLines: 1,
overflow: TextOverflow.ellipsis,
textAlign: TextAlign.left,
style: TextStyle(
color: MyColours.color_000000,
fontSize: font(14)),
),
)
],
),
));
}),
InkWell(
onTap: () {
List<ThemeModel> themeShow = [];
themeDatas.forEach((key, value) {
themeShow.add(value);
});
DialogUtil.showThemeColorSelectDialogNew(context, themeShow,
callback: (object) {
print(object);
setState(() {
indexSelect = object;
});
});
},
child: Padding(
padding: EdgeInsets.only(
left: w(16), top: w(12), bottom: w(12), right: w(24)),
child: Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
Text(
'无配色主题',
style: TextStyle(
color: MyColours.color_515151,
fontSize: font(16)),
),
// Spacer(),
// Text(
// themeDatas[themeColor].colorName,
// style: TextStyle(
// color: MyColours.color_515151,
// fontSize: font(16)),
// ),
// Container(
// padding: EdgeInsets.symmetric(
// horizontal: w(11), vertical: w(4)),
// child: Image.asset(
// "assets/arrow_right_new.png",
// width: w(9),
// height: w(16),
// ),
// )
// RoundButton(
// text: '预览',
// gradientStart: MyColours.color_ffffff,
// gradientEnd: MyColours.color_ffffff,
// borderColor: MyColours.color_438E93,
// textColor: MyColours.color_438E93,
// radius: ScreenUtil().setWidth(22),
// fontSize: 24,
// width: w(72),
// height: ScreenUtil().setWidth(44),
// isBold: true,
// onPressed: () {
// NavigatorUtil.goMarkingPreviewPage(context);
// },
// ),
]))),
Padding(
padding: EdgeInsets.only(left: w(16)),
child: MyDivider(double.infinity, w(0.5),
color: MyColours.color_E7E7E7)),
VEmptyView(24),
GridView.builder(
padding: EdgeInsets.symmetric(horizontal: w(16)),
controller: controller,
// padding: EdgeInsets.only(top: ScreenUtil().getAdapterSize(10)),
shrinkWrap: true,
itemCount: themeDatasno.length,
//SliverGridDelegateWithFixedCrossAxisCount 构建一个横轴固定数量Widget
gridDelegate: SliverGridDelegateWithFixedCrossAxisCount(
//横轴元素个数
crossAxisCount: 2,
//纵轴间距
mainAxisSpacing: w(15),
//横轴间距
crossAxisSpacing: w(15),
//子组件宽高长度比例
childAspectRatio:
(ScreenUtil().screenWidth - w(62)) / 2 / 370),
itemBuilder: (BuildContext context, int index) {
ThemeSunModel themeModel = themeDatasno[index];
return InkWell(
onTap: () {
List<String> temp =
themeDatasno.map((e) => e.url).toList();
print(temp);
_showPhotoView(context, indexSelect,
themeDatasno.map((e) => e.url).toList());
},
child: Container(
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(r(10)),
border: Border.all(
color: indexSelect == index
? MyColours.color_005AA7
: MyColours.color_DBDBDB,
width: indexSelect == index ? w(2) : w(1))),
child: Column(
children: [
VEmptyView(10),
CachedNetworkImage(
imageUrl: themeModel.url,
width: (ScreenUtil().screenWidth - w(62)) / 2,
height: w(348),
fit: BoxFit.fitWidth,
alignment: Alignment.topCenter,
),
));
}))
VEmptyView(20),
Container(
padding: EdgeInsets.symmetric(
vertical: w(6), horizontal: w(2)),
width: double.infinity,
child: Text(
themeModel.name,
maxLines: 1,
overflow: TextOverflow.ellipsis,
textAlign: TextAlign.left,
style: TextStyle(
color: MyColours.color_000000,
fontSize: font(14)),
),
)
],
),
));
})
],
))
)))
],
),
);
... ...
import 'package:flutter/material.dart';
class ThemeModel {
String colorName;
String colorValueS; //渐变色起始值
String colorValueM; //渐变色中间值
String colorValueE; //渐变色结束值
List<ThemeSunModel> urls; //当前色值下的模版链接集合
ThemeModel();
ThemeModel.fromJson(Map<String, dynamic> json) {
colorName = json['color_name'];
colorValueS = json['color_value_s'];
colorValueM = json['color_value_m'];
colorValueE = json['color_value_e'];
urls = <ThemeSunModel>[];
if (json['urls'] != null) {
json['urls'].forEach((v) {
if (v is ThemeSunModel) {
urls.add(v);
} else {
urls.add(new ThemeSunModel.fromJson(v));
}
});
}
}
Map<String, dynamic> toJson() => <String, dynamic>{
"color_name": colorName,
"color_value_s": colorValueS,
"color_value_m": colorValueM,
"color_value_e": colorValueE,
'urls': urls
};
}
class ThemeSunModel {
String name; //模版名称
String id; //模版编号
String url; //当前色值下的模版链接
ThemeSunModel();
factory ThemeSunModel.fromJson(Map<String, dynamic> json) => ThemeSunModel()
..name = json["name"]
..id = json["id"]
..url = json["url"];
Map<String, dynamic> toJson() => <String, dynamic>{
"name": name,
"id": id,
"url": url,
};
}
... ...
... ... @@ -40,6 +40,7 @@ import '../models/cookbook_model.dart';
import '../models/radio_model.dart';
import '../models/seller_version_model.dart';
import '../models/theme_color_model.dart';
import '../pages/my/marketing_center/theme_model.dart';
typedef CustomCallBack = void Function(Object object);
typedef CustomCallBackMap = void Function(Map<String, String> object);
... ... @@ -6279,6 +6280,108 @@ class DialogUtil {
}
//主题颜色选择弹框
static showThemeColorSelectDialogNew(
BuildContext context, List<ThemeModel> themeShow,
{CustomCallBack callback}) {
ScrollController controller = ScrollController();
return showModalBottomSheet(
context: context,
isScrollControlled: true,
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.only(
topLeft: Radius.circular(30), topRight: Radius.circular(30)),
),
builder: (context) {
Widget widget = Container(
width: double.infinity,
// height: w(536),
color: MyColours.color_ffffff,
child: Stack(children: [
SingleChildScrollView(
controller: controller,
child: Column(
mainAxisSize: MainAxisSize.min,
children: <Widget>[
VEmptyView(174),
GridView.builder(
padding: EdgeInsets.symmetric(horizontal: w(16)),
controller: controller,
// padding: EdgeInsets.only(top: ScreenUtil().getAdapterSize(10)),
shrinkWrap: true,
itemCount: themeShow.length,
//SliverGridDelegateWithFixedCrossAxisCount 构建一个横轴固定数量Widget
gridDelegate:
SliverGridDelegateWithFixedCrossAxisCount(
//横轴元素个数
crossAxisCount: 3,
//纵轴间距
mainAxisSpacing: w(20),
//横轴间距
crossAxisSpacing: w(20),
//子组件宽高长度比例
childAspectRatio: 5 / 3),
itemBuilder: (BuildContext context, int index) {
return InkWell(
onTap: () {
Navigator.pop(context);
callback(themeShow[index].colorName);
},
child: Container(
// width: w(100),
height: w(60),
alignment: Alignment.bottomCenter,
decoration: BoxDecoration(
gradient: LinearGradient(
stops: [
-0.5747,
0.5572,
1.4872
],
colors: [
Utils.hexStringColor(
themeShow[index].colorValueS),
Utils.hexStringColor(
themeShow[index].colorValueM),
Utils.hexStringColor(
themeShow[index].colorValueE),
],
begin: Alignment.topLeft,
end: Alignment.bottomRight),
),
child: Container(
// width: w(100),
// height: w(27),
child: Text(themeShow[index].colorName,
style: TextStyle(
color: MyColours.color_ffffff,
fontWeight: FontWeight.bold,
fontSize: font(16))))));
}),
VEmptyView(82),
],
)),
Positioned(
right: w(10),
top: w(25),
child: InkWell(
onTap: () {
Navigator.pop(context);
},
child: Padding(
padding: EdgeInsets.symmetric(horizontal: w(18)),
child: Text("取消",
style: TextStyle(
fontWeight: FontWeight.bold,
fontSize: ScreenUtil().setSp(32),
color: MyColours.color_000000)),
))),
]),
);
return widget;
});
}
//主题颜色选择弹框
static showThemeColorSelectDialog(
BuildContext context, List<ThemeColorModel> themeColorData,
{CustomCallBack callback}) {
... ...
... ... @@ -50,6 +50,38 @@ import '../models/recharge_list_model.dart';
typedef BookTimeSetCallback = void Function(bool needChange);
class Utils {
/// 十六进制颜色
/// colorString,字符串,例如:'0x000000' '0xff000000' '#000000' '#000000',
/// alpha,透明度[0.0, 1.0]
static Color hexStringColor(String colorString, {double alpha = 1}) {
colorString = '0x' + colorString;
if (alpha < 0) {
alpha = 0;
} else if (alpha > 1) {
alpha = 1;
}
String colorStr = colorString;
// colorString未带0xff前缀并且长度为6
if (!colorStr.startsWith('0xff') && colorStr.length == 6) {
colorStr = '0xff' + colorStr;
}
// colorString为8位,如0x000000
if (colorStr.startsWith('0x') && colorStr.length == 8) {
colorStr = colorStr.replaceRange(0, 2, '0xff');
}
// colorString为7位,如#000000
if (colorStr.startsWith('#') && colorStr.length == 7) {
colorStr = colorStr.replaceRange(0, 1, '0xff');
}
// 先分别获取色值的RGB通道
Color color = Color(int.parse(colorStr));
int red = color.red;
int green = color.green;
int blue = color.blue;
// 通过fromRGBO返回带透明度和RGB值的颜色
return Color.fromRGBO(red, green, blue, alpha);
}
///店铺是否过期
static isStoreEdate() {
if (App.sp.containsKey('sellerEdate')) {
... ...