Commit 41c53bf0de66790a87f730266bc1277fdff93d0b

Authored by wdn127929
1 parent cdb61cc6

模版选择OK

... ... @@ -22,6 +22,9 @@ class MarkDataModel extends Object {
MarkMarketingModel marketing;
String isNewTemplate;
String type;
String liteClass;
MarkDataModel(this.id, this.sid, this.home, this.reserve, this.store,
this.chef, this.signboard, this.marketing, this.isNewTemplate);
... ... @@ -52,7 +55,9 @@ class MarkDataModel extends Object {
? new MarkMarketingModel.fromJson(convert.jsonDecode(json['marketing']))
: null; //
isNewTemplate = json['is_new_template'] ?? "0";
isNewTemplate = json['is_new_template'] ?? '';
type = json['type'] ?? '';
liteClass = json['lite_class'] ?? '';
}
Map<String, dynamic> toJson() {
... ... @@ -67,6 +72,8 @@ class MarkDataModel extends Object {
data['signboard'] = this.signboard;
data['marketing'] = this.marketing;
data['is_new_template'] = this.isNewTemplate;
data['type'] = this.type;
data['lite_class'] = this.liteClass;
return data;
}
}
... ...
import 'dart:convert';
class SellerTemplateColorListModel {
int ret;
List<SellerTemplateColorListSunModel> data;
String msg;
SellerTemplateColorListModel({this.ret, this.data, this.msg});
SellerTemplateColorListModel.fromJson(Map<String, dynamic> json) {
ret = json['ret'];
if (json['data'] != null) {
data = <SellerTemplateColorListSunModel>[];
json['data'].forEach((v) {
data.add(new SellerTemplateColorListSunModel.fromJson(v));
});
}
msg = json['msg'];
}
Map<String, dynamic> toJson() {
final Map<String, dynamic> data = new Map<String, dynamic>();
data['ret'] = this.ret;
if (this.data != null) {
data['data'] = this.data.map((v) => v.toJson()).toList();
}
data['msg'] = this.msg;
return data;
}
}
class SellerTemplateColorListSunModel {
String id;
String templateName;
List<ColorListModel> colors;
String url;
String themeColorDefault; //模版默认主题色
SellerTemplateColorListSunModel(
{this.id, this.templateName, this.colors, this.url});
SellerTemplateColorListSunModel.fromJson(Map<String, dynamic> json) {
id = json['id'];
templateName = json['template_name'];
colors = <ColorListModel>[];
if (json['colors'] != null &&
json['colors'] != '[]' &&
json['colors'] != '') {
if (json['colors'] is String) {
jsonDecode(json['colors']).forEach((v) {
colors.add(new ColorListModel.fromJson(v));
});
} else {
json['colors'].forEach((v) {
colors.add(new ColorListModel.fromJson(v));
});
}
}
if (json['theme_color_default'] != null) {
themeColorDefault = json['theme_color_default'];
} else {
if (colors.length > 0) {
themeColorDefault = colors[0].colorName;
}
}
url = json['url'];
}
Map<String, dynamic> toJson() {
final Map<String, dynamic> data = new Map<String, dynamic>();
data['id'] = this.id;
data['template_name'] = this.templateName;
data['colors'] = this.colors;
data['url'] = this.url;
data['theme_color_default'] = this.themeColorDefault;
return data;
}
}
class ColorListModel {
String colorName;
String colorValueS;
String colorValueM;
String colorValueE;
String liteClass;
String url;
ColorListModel(
{this.colorName,
this.colorValueS,
this.colorValueM,
this.colorValueE,
this.liteClass,
this.url});
ColorListModel.fromJson(Map<String, dynamic> json) {
colorName = json['color_name'];
colorValueS = json['color_value_s'];
colorValueM = json['color_value_m'];
colorValueE = json['color_value_e'];
liteClass = json['lite_class'];
url = json['url'];
}
Map<String, dynamic> toJson() {
final Map<String, dynamic> data = new Map<String, dynamic>();
data['color_name'] = this.colorName;
data['color_value_s'] = this.colorValueS;
data['color_value_m'] = this.colorValueM;
data['color_value_e'] = this.colorValueE;
data['lite_class'] = this.liteClass;
data['url'] = this.url;
return data;
}
}
... ...
... ... @@ -465,9 +465,10 @@ class HttpUrl {
static const String set_seller_collect =
"?service=App.SellerVersion.SetSellerCollect"; // 收集店铺信息
static const String get_seller_version =
static const String get_seller_version =
"?service=App.SellerVersion.GetSellerVersion"; // 获取商家的版本信息
static const String get_seller_template_color_list =
"?service=App.Seller.GetSellerTemplateColorList"; // 模板/颜色配置信息
}
... ...
import 'package:flutter/material.dart';
import 'package:one_key/models/seller_template_color_list_model.dart';
import 'package:one_key/widgets/system_app_bar.dart';
import 'package:provider/provider.dart';
... ... @@ -6,11 +7,13 @@ import '../../../provider/marketing_center_provider.dart';
import '../../../provider/user_model.dart';
import '../../../res/colors.dart';
import '../../../route/navigator_util.dart';
import '../../../utils/event_bus.dart';
import '../../../utils/screen_util.dart';
import '../../../utils/utils.dart';
import '../../../widgets/MyDivider.dart';
import '../../../widgets/h_empty_view.dart';
import '../../../widgets/round_button.dart';
import '../../online_check/photo_view_wiget.dart';
/**
* 客户通知设置
... ... @@ -27,6 +30,8 @@ class _CustomerNoticeSettingPageState extends State<CustomerNoticeSettingPage> {
bool selectSms = false; //取消预订发送短信默认关闭
bool select = false; //启用预订安排通知图文模式
MarketingCenterProvider marketingCenterProvider;
String themeName = '';
String previewUrl = ''; //效果预览的图片链接
@override
void initState() {
... ... @@ -34,9 +39,23 @@ class _CustomerNoticeSettingPageState extends State<CustomerNoticeSettingPage> {
WidgetsBinding.instance.addPostFrameCallback((_) {
getDzSellerConf();
_getThemeData();
bus.on("theme_color_type_name", (arg) {
themeName = arg['templateName'];
previewUrl = arg['url'];
setState(() {});
});
});
}
@override
void dispose() {
bus.off('theme_color_type_name');
super.dispose();
}
getDzSellerConf() async {
bool success = await marketingCenterProvider.getDzSellerConf(context);
if (success && marketingCenterProvider.dzSellerConfModel != null) {
... ... @@ -50,6 +69,67 @@ class _CustomerNoticeSettingPageState extends State<CustomerNoticeSettingPage> {
}
}
_getThemeData() async {
Future.wait<bool>(
[_getSellerTemplateColorList(), getSellerTemplateConf(context)])
.then((results) async {
print(results[0]);
if (results[0] && results[1]) {
//成功
int index = marketingCenterProvider.templeteDatas.indexWhere(
(element) =>
element.id == marketingCenterProvider.markDataModel.type);
themeName = marketingCenterProvider.templeteDatas[index].templateName;
if (marketingCenterProvider.templeteDatas[index].colors.length > 0) {
// 多配色主题
List<ColorListModel> colors =
marketingCenterProvider.templeteDatas[index].colors;
previewUrl = colors[colors.indexWhere((element) =>
element.liteClass ==
marketingCenterProvider.markDataModel.liteClass)]
.url;
} else {
previewUrl = marketingCenterProvider.templeteDatas[index].url;
}
setState(() {});
} else {
// if (!results[0]) {
// //没有优惠券
// } else {}
// if (!results[1]) {
// //没有营销中心数据
// } else {}
setState(() {});
}
}).catchError((e) {
print(e);
});
}
Future<bool> getSellerTemplateConf(BuildContext context) async {
bool success = await marketingCenterProvider.getSellerTemplateConf(context);
if (success &&
marketingCenterProvider.markDataModel != null &&
marketingCenterProvider.markDataModel.type != '') {
return true;
} else {
return false;
}
}
///获取后台配置的模版数据
Future<bool> _getSellerTemplateColorList() async {
bool success =
await marketingCenterProvider.getSellerTemplateColorList(context);
if (success) {
return true;
}
return false;
}
///保存接口
_setData() async {
Future.wait<bool>([
... ... @@ -102,6 +182,67 @@ class _CustomerNoticeSettingPageState extends State<CustomerNoticeSettingPage> {
}
}
_showPhotoView(BuildContext context, int index, List<String> imgs,
{isShow = false, List dashName}) async {
// if (imgs.length == 1 &&
// imgs[0] ==
// 'http://nosqn.colorcun.com/custom/lite-online/image/def-banner.png') {
// imgs[0] = 'http://nosqn.colorcun.com/app/seller-hj-empty.png';
// }
Utils.setBarStatus(false, color: Colors.black);
dynamic result = await showGeneralDialog(
context: context,
barrierDismissible: false,
// barrierColor: Colors.red,
barrierLabel:
MaterialLocalizations.of(context).modalBarrierDismissLabel,
transitionDuration: const Duration(milliseconds: 150),
pageBuilder: (BuildContext context, Animation animation,
Animation secondaryAnimation) {
Widget child = Stack(
alignment: Alignment.bottomCenter,
children: <Widget>[
PhotoPreview(
initialIndex: index,
photoList: imgs,
isShow: isShow,
dashName: dashName,
needMask: false,
needTap: false,
callback: (curruntIndex) {
//选中某个模版
// callback(curruntIndex);
},
),
// Positioned(
// bottom: w(20),
// child: InkWell(
// onTap: () {
// callback(index);
// },
// child: Container(
// padding: EdgeInsets.symmetric(
// horizontal: w(30), vertical: w(10)),
// decoration: BoxDecoration(
// color: MyColours.color_ffffff,
// borderRadius: BorderRadius.circular(r(30)),
// ),
// child: Text(
// '应用',
// style: TextStyle(
// decoration: TextDecoration.none,
// color: MyColours.color_515151,
// fontSize: font(16)),
// ),
// ),
// ))
],
);
return Material(child: child);
});
Utils.setBarStatus(true, color: Colors.white);
}
Widget _item(String title, {GestureTapCallback onTap}) {
return InkWell(
onTap: onTap,
... ... @@ -217,13 +358,16 @@ class _CustomerNoticeSettingPageState extends State<CustomerNoticeSettingPage> {
color: MyColours.color_515151,
fontSize: font(16)),
),
Spacer(),
Text(
'经典图片',
HEmptyView(20),
Expanded(
child: Text(
themeName,
textAlign: TextAlign.right,
style: TextStyle(
color: MyColours.color_515151,
fontSize: font(16)),
),
)),
Container(
padding: EdgeInsets.symmetric(
horizontal: w(11), vertical: w(4)),
... ... @@ -292,7 +436,13 @@ class _CustomerNoticeSettingPageState extends State<CustomerNoticeSettingPage> {
textColor: MyColours.color_438E93,
isBold: true,
onPressed: () async {
NavigatorUtil.goMarkingPreviewPage(context);
// NavigatorUtil.goMarkingPreviewPage(context);
if (previewUrl == '') {
Utils.showToast('暂时没有可预览的图文信息');
return;
}
//
_showPhotoView(context, 0, [previewUrl]);
}),
HEmptyView(30),
Expanded(
... ...
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/models/seller_template_color_list_model.dart';
import 'package:one_key/pages/my/marketing_center/theme_model.dart';
import 'package:one_key/route/navigator_util.dart';
import 'package:one_key/widgets/system_app_bar.dart';
import 'package:one_key/widgets/v_empty_view.dart';
import 'package:provider/provider.dart';
import '../../../constant/state.dart';
import '../../../provider/marketing_center_provider.dart';
import '../../../res/colors.dart';
import '../../../utils/dialog_util.dart';
import '../../../utils/event_bus.dart';
import '../../../utils/screen_util.dart';
import '../../../utils/utils.dart';
import '../../../widgets/MyDivider.dart';
import '../../../widgets/page_exception.dart';
import '../../online_check/photo_view_wiget.dart';
import 'dart:convert' as convert;
... ... @@ -32,109 +37,44 @@ class InvitationThemeHomePage extends StatefulWidget {
class _InvitationThemeHomePageState extends State<InvitationThemeHomePage> {
ScrollController controller = ScrollController();
MarketingCenterProvider marketingCenterProvider;
//当前店铺选中的颜色和板式
String themeColor;
String themeType = '1'; //模版类型
// int indexSelectColor = 0; //选中第几个模版 (有配色选中index)
// int indexSelectNoColor = 0; //选中第几个模版 (无配色选中index)
List<ThemeSunModel> themesDatas = [];
ThemeModel themeModelCurrunt; //有配色对应的当前页面模版数据
// Map<String, dynamic> json1 = {
// 'color_name': '黑蓝过渡',
// 'color_value_s': 'FF42A5FF',
// 'color_value_m': 'FF000000',
// 'color_value_e': 'FF42A5FF',
// 'urls': urls
// };
// List<ThemeSunModel> marketingCenterProvider.templeteDatas = [];
// ThemeModel themeModel1 = ThemeModel.fromJson(json1);
// themeDatas['黑蓝过渡'] = themeModel1;
// ThemeModel themeModelCurrunt; //有配色对应的当前页面模版数据
@override
void initState() {
super.initState();
//模版1
_addModel1();
//模版2
_addModel2();
//模版3
_addModel3();
//模版4
_addModel4();
//模版5
_addModel5();
//模版6
_addModel6();
//模版7
_addModel7();
WidgetsBinding.instance.addPostFrameCallback((_) {
_getThemeData();
bus.on("theme_color_type", (arg) {
themeColor = arg['themeColor'];
themeType = arg['themeType'];
themesDatas[
themesDatas.indexWhere((element) => element.id == themeType)]
.themeColorDefault = themeColor;
SellerTemplateColorListSunModel themeSunModel =
marketingCenterProvider.templeteDatas[marketingCenterProvider
.templeteDatas
.indexWhere((element) => element.id == themeType)];
themeSunModel.themeColorDefault = themeColor;
bus.emit('theme_color_type_name', {
'templateName': themeSunModel.templateName,
'url': themeSunModel.colors.length == 0
? themeSunModel.url
: themeSunModel
.colors[themeSunModel.colors
.indexWhere((element) => element.colorName == themeColor)]
.url
});
setState(() {});
});
});
// //石绿过度
// _addShilvuodu();
// //中国红过度
// _addZhongguohongguodu();
// //群青过度
// _addQunqingguodu();
// //深中国红
// _addShenzhongguohong();
// //中国红
// _addZhongguohong();
// //蓝采和
// _addLancaihe();
// //石绿
// _addShilv();
// //姜黄
// _addJianghuang();
// //金黄
// _addJinhuang();
// //苍黄
// _addCanghuang();
// //群青
// _addQunqing();
// //摩洛哥蓝
// _addMoluogelan();
print(themesDatas);
String ddd = convert.jsonEncode(themesDatas);
print(ddd);
// Map<String, String> map = {
// 'color': convert.jsonEncode(themeDatas),
// 'no_color': convert.jsonEncode(themesDatas)
// };
// print(map);
}
@override
... ... @@ -143,1501 +83,66 @@ class _InvitationThemeHomePageState extends State<InvitationThemeHomePage> {
super.dispose();
}
/**
* _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);
_getThemeData() async {
Future.wait<bool>(
[_getSellerTemplateColorList(), getSellerTemplateConf(context)])
.then((results) async {
print(results[0]);
if (results[0] && results[1]) {
//成功
marketingCenterProvider.pageStateThemeHome = PageState.Success;
int index = marketingCenterProvider.templeteDatas.indexWhere(
(element) =>
element.id == marketingCenterProvider.markDataModel.type);
themeType = marketingCenterProvider.templeteDatas[index].id;
List<ColorListModel> colors =
marketingCenterProvider.templeteDatas[index].colors;
themeColor = colors[colors.indexWhere((element) =>
element.liteClass ==
marketingCenterProvider.markDataModel.liteClass)]
.colorName;
marketingCenterProvider.templeteDatas[index].themeColorDefault =
themeColor;
//模版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;
_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;
}
}
*/
_addModel1() {
// //模版1
Map<String, dynamic> jsonSun11 = {
'name': '1 经典图片式',
'id': '1',
'url': 'https://qn.colorcun.com/template/jingdianbianyi.png',
};
ThemeSunModel themeSunModel11 = ThemeSunModel.fromJson(jsonSun11);
themesDatas.add(themeSunModel11);
}
_addModel2() {
// //模版2
Map<String, dynamic> jsonSun12 = {
'name': '2 简洁图文A(多色)',
'id': '2',
'colors': [
{
'color_name': '深中国红',
'color_value_s': 'FF86201B',
'color_value_m': 'FF86201B',
'color_value_e': 'FF86201B',
'lite_class': 'crimson',
'url': 'https://qn.colorcun.com/template/shenzhongguohong-2.png'
},
{
'color_name': '中国红',
'color_value_s': 'FFAF231C',
'color_value_m': 'FFAF231C',
'color_value_e': 'FFAF231C',
'lite_class': 'chinaRed',
'url': 'https://qn.colorcun.com/template/zhongguohong-2.png'
},
{
'color_name': '蓝采和',
'color_value_s': 'FF06436F',
'color_value_m': 'FF06436F',
'color_value_e': 'FF06436F',
'lite_class': 'lanCaiHe',
'url': 'https://qn.colorcun.com/template/lancaihe-2.png'
},
{
'color_name': '石绿',
'color_value_s': 'FF206864',
'color_value_m': 'FF206864',
'color_value_e': 'FF206864',
'lite_class': 'stoneGreen',
'url': 'https://qn.colorcun.com/template/shilv-2.png'
},
{
'color_name': '姜黄',
'color_value_s': 'FFB39437',
'color_value_m': 'FFB39437',
'color_value_e': 'FFB39437',
'lite_class': 'turmeric',
'url': 'https://qn.colorcun.com/template/jianghuang-2.png',
},
{
'color_name': '苍黄',
'color_value_s': 'FFC85306',
'color_value_m': 'FFC85306',
'color_value_e': 'FFC85306',
'lite_class': 'greenishYellow',
'url': 'https://qn.colorcun.com/template/canghuang-2.png',
},
{
'color_name': '金黄',
'color_value_s': 'FFC67B3A',
'color_value_m': 'FFC67B3A',
'color_value_e': 'FFC67B3A',
'lite_class': 'golden',
'url': 'https://qn.colorcun.com/template/jinhuang-2.png',
},
{
'color_name': '群青',
'color_value_s': 'FF0143A3',
'color_value_m': 'FF0143A3',
'color_value_e': 'FF0143A3',
'lite_class': 'ultramarine',
'url': 'https://qn.colorcun.com/template/qunqing-2.png',
},
{
'color_name': '摩洛哥蓝',
'color_value_s': 'FF19516A',
'color_value_m': 'FF19516A',
'color_value_e': 'FF19516A',
'lite_class': 'moroccanBlue',
'url': 'https://qn.colorcun.com/template/moluogelan-2.png',
}
]
};
ThemeSunModel themeSunModel12 = ThemeSunModel.fromJson(jsonSun12);
themesDatas.add(themeSunModel12);
}
_addModel3() {
// //模版3
Map<String, dynamic> jsonSun12 = {
'name': '3 简洁信息图文A(多色)',
'id': '3',
'colors': [
{
'color_name': '黑蓝过渡',
'color_value_s': 'FF42A5FF',
'color_value_m': 'FF000000',
'color_value_e': 'FF42A5FF',
'lite_class': 'blackBlueGradient',
'url': 'https://qn.colorcun.com/template/heilanguodu-3.png'
},
{
'color_name': '石绿过渡',
'color_value_s': 'FF438E93',
'color_value_m': 'FF206864',
'color_value_e': 'FF42A5FF',
'lite_class': 'stoneGreenGradient',
'url': 'https://qn.colorcun.com/template/shilvguodu-3.png'
},
{
'color_name': '中国红过渡',
'color_value_s': 'FFAF231C',
'color_value_m': 'FF86201B',
'color_value_e': 'FFAF231C',
'lite_class': 'chinaRedGradient',
'url': 'https://qn.colorcun.com/template/zhongguohongguodu-3.png'
},
{
'color_name': '群青过渡',
'color_value_s': 'FF4C8DAD',
'color_value_m': 'FF0143A3',
'color_value_e': 'FF42A5FF',
'lite_class': 'ultramarineGradient',
'url': 'https://qn.colorcun.com/template/qunqingguodu-3.png'
},
{
'color_name': '深中国红',
'color_value_s': 'FF86201B',
'color_value_m': 'FF86201B',
'color_value_e': 'FF86201B',
'lite_class': 'crimson',
'url': 'https://qn.colorcun.com/template/shenzhongguohong-3.png'
},
{
'color_name': '中国红',
'color_value_s': 'FFAF231C',
'color_value_m': 'FFAF231C',
'color_value_e': 'FFAF231C',
'lite_class': 'chinaRed',
'url': 'https://qn.colorcun.com/template/zhongguohong-3.png'
},
{
'color_name': '蓝采和',
'color_value_s': 'FF06436F',
'color_value_m': 'FF06436F',
'color_value_e': 'FF06436F',
'lite_class': 'lanCaiHe',
'url': 'https://qn.colorcun.com/template/lancaihe-3.png'
},
{
'color_name': '石绿',
'color_value_s': 'FF206864',
'color_value_m': 'FF206864',
'color_value_e': 'FF206864',
'lite_class': 'stoneGreen',
'url': 'https://qn.colorcun.com/template/shilv-3.png'
},
{
'color_name': '姜黄',
'color_value_s': 'FFB39437',
'color_value_m': 'FFB39437',
'color_value_e': 'FFB39437',
'lite_class': 'turmeric',
'url': 'https://qn.colorcun.com/template/jianghuang-3.png',
},
{
'color_name': '苍黄',
'color_value_s': 'FFC85306',
'color_value_m': 'FFC85306',
'color_value_e': 'FFC85306',
'lite_class': 'greenishYellow',
'url': 'https://qn.colorcun.com/template/canghuang-3.png',
},
{
'color_name': '金黄',
'color_value_s': 'FFC67B3A',
'color_value_m': 'FFC67B3A',
'color_value_e': 'FFC67B3A',
'lite_class': 'golden',
'url': 'https://qn.colorcun.com/template/jinhuang-3.png',
},
{
'color_name': '群青',
'color_value_s': 'FF0143A3',
'color_value_m': 'FF0143A3',
'color_value_e': 'FF0143A3',
'lite_class': 'ultramarine',
'url': 'https://qn.colorcun.com/template/qunqing-3.png',
},
{
'color_name': '摩洛哥蓝',
'color_value_s': 'FF19516A',
'color_value_m': 'FF19516A',
'color_value_e': 'FF19516A',
'lite_class': 'moroccanBlue',
'url': 'https://qn.colorcun.com/template/moluogelan-3.png',
}
]
};
ThemeSunModel themeSunModel12 = ThemeSunModel.fromJson(jsonSun12);
themesDatas.add(themeSunModel12);
}
_addModel4() {
// //模版4
Map<String, dynamic> jsonSun12 = {
'name': '4 半屏邀请函A(多色)',
'id': '4',
'colors': [
{
'color_name': '黑蓝过渡',
'color_value_s': 'FF42A5FF',
'color_value_m': 'FF000000',
'color_value_e': 'FF42A5FF',
'lite_class': 'blackBlueGradient',
'url': 'https://qn.colorcun.com/template/heilanguodu-4.png'
},
{
'color_name': '石绿过渡',
'color_value_s': 'FF438E93',
'color_value_m': 'FF206864',
'color_value_e': 'FF42A5FF',
'lite_class': 'stoneGreenGradient',
'url': 'https://qn.colorcun.com/template/shilvguodu-4.png'
},
{
'color_name': '中国红过渡',
'color_value_s': 'FFAF231C',
'color_value_m': 'FF86201B',
'color_value_e': 'FFAF231C',
'lite_class': 'chinaRedGradient',
'url': 'https://qn.colorcun.com/template/zhongguohongguodu-4.png'
},
{
'color_name': '群青过渡',
'color_value_s': 'FF4C8DAD',
'color_value_m': 'FF0143A3',
'color_value_e': 'FF42A5FF',
'lite_class': 'ultramarineGradient',
'url': 'https://qn.colorcun.com/template/qunqingguodu-4.png'
},
{
'color_name': '深中国红',
'color_value_s': 'FF86201B',
'color_value_m': 'FF86201B',
'color_value_e': 'FF86201B',
'lite_class': 'crimson',
'url': 'https://qn.colorcun.com/template/shenzhongguohong-4.png'
},
{
'color_name': '中国红',
'color_value_s': 'FFAF231C',
'color_value_m': 'FFAF231C',
'color_value_e': 'FFAF231C',
'lite_class': 'chinaRed',
'url': 'https://qn.colorcun.com/template/zhongguohong-4.png'
},
{
'color_name': '蓝采和',
'color_value_s': 'FF06436F',
'color_value_m': 'FF06436F',
'color_value_e': 'FF06436F',
'lite_class': 'lanCaiHe',
'url': 'https://qn.colorcun.com/template/lancaihe-4.png'
},
{
'color_name': '石绿',
'color_value_s': 'FF206864',
'color_value_m': 'FF206864',
'color_value_e': 'FF206864',
'lite_class': 'stoneGreen',
'url': 'https://qn.colorcun.com/template/shilv-4.png'
},
{
'color_name': '姜黄',
'color_value_s': 'FFB39437',
'color_value_m': 'FFB39437',
'color_value_e': 'FFB39437',
'lite_class': 'turmeric',
'url': 'https://qn.colorcun.com/template/jianghuang-4.png',
},
{
'color_name': '苍黄',
'color_value_s': 'FFC85306',
'color_value_m': 'FFC85306',
'color_value_e': 'FFC85306',
'lite_class': 'greenishYellow',
'url': 'https://qn.colorcun.com/template/canghuang-4.png',
},
{
'color_name': '金黄',
'color_value_s': 'FFC67B3A',
'color_value_m': 'FFC67B3A',
'color_value_e': 'FFC67B3A',
'lite_class': 'golden',
'url': 'https://qn.colorcun.com/template/jinhuang-4.png',
},
{
'color_name': '群青',
'color_value_s': 'FF0143A3',
'color_value_m': 'FF0143A3',
'color_value_e': 'FF0143A3',
'lite_class': 'ultramarine',
'url': 'https://qn.colorcun.com/template/qunqing-4.png',
},
{
'color_name': '摩洛哥蓝',
'color_value_s': 'FF19516A',
'color_value_m': 'FF19516A',
'color_value_e': 'FF19516A',
'lite_class': 'moroccanBlue',
'url': 'https://qn.colorcun.com/template/moluogelan-4.png',
}
]
};
ThemeSunModel themeSunModel12 = ThemeSunModel.fromJson(jsonSun12);
themesDatas.add(themeSunModel12);
setState(() {});
} else {
marketingCenterProvider.pageStateThemeHome =
PageState.ConnectivityError;
// if (!results[0]) {
// //没有优惠券
// } else {}
// if (!results[1]) {
// //没有营销中心数据
// } else {}
setState(() {});
}
}).catchError((e) {
print(e);
});
}
_addModel5() {
// //模版5
Map<String, dynamic> jsonSun12 = {
'name': '5 半屏邀请函B(多色)',
'id': '5',
'colors': [
{
'color_name': '黑蓝过渡',
'color_value_s': 'FF42A5FF',
'color_value_m': 'FF000000',
'color_value_e': 'FF42A5FF',
'lite_class': 'blackBlueGradient',
'url': 'https://qn.colorcun.com/template/heilanguodu-5.png'
},
{
'color_name': '石绿过渡',
'color_value_s': 'FF438E93',
'color_value_m': 'FF206864',
'color_value_e': 'FF42A5FF',
'lite_class': 'stoneGreenGradient',
'url': 'https://qn.colorcun.com/template/shilvguodu-5.png'
},
{
'color_name': '中国红过渡',
'color_value_s': 'FFAF231C',
'color_value_m': 'FF86201B',
'color_value_e': 'FFAF231C',
'lite_class': 'chinaRedGradient',
'url': 'https://qn.colorcun.com/template/zhongguohongguodu-5.png'
},
{
'color_name': '群青过渡',
'color_value_s': 'FF4C8DAD',
'color_value_m': 'FF0143A3',
'color_value_e': 'FF42A5FF',
'lite_class': 'ultramarineGradient',
'url': 'https://qn.colorcun.com/template/qunqingguodu-5.png'
},
{
'color_name': '深中国红',
'color_value_s': 'FF86201B',
'color_value_m': 'FF86201B',
'color_value_e': 'FF86201B',
'lite_class': 'crimson',
'url': 'https://qn.colorcun.com/template/shenzhongguohong-5.png'
},
{
'color_name': '中国红',
'color_value_s': 'FFAF231C',
'color_value_m': 'FFAF231C',
'color_value_e': 'FFAF231C',
'lite_class': 'chinaRed',
'url': 'https://qn.colorcun.com/template/zhongguohong-5.png'
},
{
'color_name': '蓝采和',
'color_value_s': 'FF06436F',
'color_value_m': 'FF06436F',
'color_value_e': 'FF06436F',
'lite_class': 'lanCaiHe',
'url': 'https://qn.colorcun.com/template/lancaihe-5.png'
},
{
'color_name': '石绿',
'color_value_s': 'FF206864',
'color_value_m': 'FF206864',
'color_value_e': 'FF206864',
'lite_class': 'stoneGreen',
'url': 'https://qn.colorcun.com/template/shilv-5.png'
},
{
'color_name': '姜黄',
'color_value_s': 'FFB39437',
'color_value_m': 'FFB39437',
'color_value_e': 'FFB39437',
'lite_class': 'turmeric',
'url': 'https://qn.colorcun.com/template/jianghuang-5.png',
},
{
'color_name': '苍黄',
'color_value_s': 'FFC85306',
'color_value_m': 'FFC85306',
'color_value_e': 'FFC85306',
'lite_class': 'greenishYellow',
'url': 'https://qn.colorcun.com/template/canghuang-5.png',
},
{
'color_name': '金黄',
'color_value_s': 'FFC67B3A',
'color_value_m': 'FFC67B3A',
'color_value_e': 'FFC67B3A',
'lite_class': 'golden',
'url': 'https://qn.colorcun.com/template/jinhuang-5.png',
},
{
'color_name': '群青',
'color_value_s': 'FF0143A3',
'color_value_m': 'FF0143A3',
'color_value_e': 'FF0143A3',
'lite_class': 'ultramarine',
'url': 'https://qn.colorcun.com/template/qunqing-5.png',
},
{
'color_name': '摩洛哥蓝',
'color_value_s': 'FF19516A',
'color_value_m': 'FF19516A',
'color_value_e': 'FF19516A',
'lite_class': 'moroccanBlue',
'url': 'https://qn.colorcun.com/template/moluogelan-5.png',
}
]
};
ThemeSunModel themeSunModel12 = ThemeSunModel.fromJson(jsonSun12);
themesDatas.add(themeSunModel12);
Future<bool> getSellerTemplateConf(BuildContext context) async {
bool success = await marketingCenterProvider.getSellerTemplateConf(context);
if (success &&
marketingCenterProvider.markDataModel != null &&
marketingCenterProvider.markDataModel.type != '') {
return true;
} else {
return false;
}
}
_addModel6() {
// //模版6
Map<String, dynamic> jsonSun12 = {
'name': '6 无预订包间图片A(多色)',
'id': '6',
'colors': [
{
'color_name': '黑蓝过渡',
'color_value_s': 'FF42A5FF',
'color_value_m': 'FF000000',
'color_value_e': 'FF42A5FF',
'lite_class': 'blackBlueGradient',
'url': 'https://qn.colorcun.com/template/heilanguodu-6.png'
},
{
'color_name': '石绿过渡',
'color_value_s': 'FF438E93',
'color_value_m': 'FF206864',
'color_value_e': 'FF42A5FF',
'lite_class': 'stoneGreenGradient',
'url': 'https://qn.colorcun.com/template/shilvguodu-6.png'
},
{
'color_name': '中国红过渡',
'color_value_s': 'FFAF231C',
'color_value_m': 'FF86201B',
'color_value_e': 'FFAF231C',
'lite_class': 'chinaRedGradient',
'url': 'https://qn.colorcun.com/template/zhongguohongguodu-6.png'
},
{
'color_name': '群青过渡',
'color_value_s': 'FF4C8DAD',
'color_value_m': 'FF0143A3',
'color_value_e': 'FF42A5FF',
'lite_class': 'ultramarineGradient',
'url': 'https://qn.colorcun.com/template/qunqingguodu-6.png'
},
{
'color_name': '深中国红',
'color_value_s': 'FF86201B',
'color_value_m': 'FF86201B',
'color_value_e': 'FF86201B',
'lite_class': 'crimson',
'url': 'https://qn.colorcun.com/template/shenzhongguohong-6.png'
},
{
'color_name': '中国红',
'color_value_s': 'FFAF231C',
'color_value_m': 'FFAF231C',
'color_value_e': 'FFAF231C',
'lite_class': 'chinaRed',
'url': 'https://qn.colorcun.com/template/zhongguohong-6.png'
},
{
'color_name': '蓝采和',
'color_value_s': 'FF06436F',
'color_value_m': 'FF06436F',
'color_value_e': 'FF06436F',
'lite_class': 'lanCaiHe',
'url': 'https://qn.colorcun.com/template/lancaihe-6.png'
},
{
'color_name': '石绿',
'color_value_s': 'FF206864',
'color_value_m': 'FF206864',
'color_value_e': 'FF206864',
'lite_class': 'stoneGreen',
'url': 'https://qn.colorcun.com/template/shilv-6.png'
},
{
'color_name': '姜黄',
'color_value_s': 'FFB39437',
'color_value_m': 'FFB39437',
'color_value_e': 'FFB39437',
'lite_class': 'turmeric',
'url': 'https://qn.colorcun.com/template/jianghuang-6.png',
},
{
'color_name': '苍黄',
'color_value_s': 'FFC85306',
'color_value_m': 'FFC85306',
'color_value_e': 'FFC85306',
'lite_class': 'greenishYellow',
'url': 'https://qn.colorcun.com/template/canghuang-6.png',
},
{
'color_name': '金黄',
'color_value_s': 'FFC67B3A',
'color_value_m': 'FFC67B3A',
'color_value_e': 'FFC67B3A',
'lite_class': 'golden',
'url': 'https://qn.colorcun.com/template/jinhuang-6.png',
},
{
'color_name': '群青',
'color_value_s': 'FF0143A3',
'color_value_m': 'FF0143A3',
'color_value_e': 'FF0143A3',
'lite_class': 'ultramarine',
'url': 'https://qn.colorcun.com/template/qunqing-6.png',
},
{
'color_name': '摩洛哥蓝',
'color_value_s': 'FF19516A',
'color_value_m': 'FF19516A',
'color_value_e': 'FF19516A',
'lite_class': 'moroccanBlue',
'url': 'https://qn.colorcun.com/template/moluogelan-6.png',
}
]
};
ThemeSunModel themeSunModel12 = ThemeSunModel.fromJson(jsonSun12);
themesDatas.add(themeSunModel12);
///获取后台配置的模版数据
Future<bool> _getSellerTemplateColorList() async {
bool success =
await marketingCenterProvider.getSellerTemplateColorList(context);
if (success) {
return true;
}
return false;
}
_addModel7() {
// //模版7
Map<String, dynamic> jsonSun12 = {
'name': '7 无预订包间图片B',
'id': '7',
'colors': [
{
'color_name': '黑蓝过渡',
'color_value_s': 'FF42A5FF',
'color_value_m': 'FF000000',
'color_value_e': 'FF42A5FF',
'lite_class': 'blackBlueGradient',
'url': 'https://qn.colorcun.com/template/heilanguodu-7.png'
},
{
'color_name': '石绿过渡',
'color_value_s': 'FF438E93',
'color_value_m': 'FF206864',
'color_value_e': 'FF42A5FF',
'lite_class': 'stoneGreenGradient',
'url': 'https://qn.colorcun.com/template/shilvguodu-7.png'
},
{
'color_name': '中国红过渡',
'color_value_s': 'FFAF231C',
'color_value_m': 'FF86201B',
'color_value_e': 'FFAF231C',
'lite_class': 'chinaRedGradient',
'url': 'https://qn.colorcun.com/template/zhongguohongguodu-7.png'
},
{
'color_name': '群青过渡',
'color_value_s': 'FF4C8DAD',
'color_value_m': 'FF0143A3',
'color_value_e': 'FF42A5FF',
'lite_class': 'ultramarineGradient',
'url': 'https://qn.colorcun.com/template/qunqingguodu-7.png'
},
{
'color_name': '深中国红',
'color_value_s': 'FF86201B',
'color_value_m': 'FF86201B',
'color_value_e': 'FF86201B',
'lite_class': 'crimson',
'url': 'https://qn.colorcun.com/template/shenzhongguohong-7.png'
},
{
'color_name': '中国红',
'color_value_s': 'FFAF231C',
'color_value_m': 'FFAF231C',
'color_value_e': 'FFAF231C',
'lite_class': 'chinaRed',
'url': 'https://qn.colorcun.com/template/zhongguohong-7.png'
},
{
'color_name': '蓝采和',
'color_value_s': 'FF06436F',
'color_value_m': 'FF06436F',
'color_value_e': 'FF06436F',
'lite_class': 'lanCaiHe',
'url': 'https://qn.colorcun.com/template/lancaihe-7.png'
},
{
'color_name': '石绿',
'color_value_s': 'FF206864',
'color_value_m': 'FF206864',
'color_value_e': 'FF206864',
'lite_class': 'stoneGreen',
'url': 'https://qn.colorcun.com/template/shilv-7.png'
},
{
'color_name': '姜黄',
'color_value_s': 'FFB39437',
'color_value_m': 'FFB39437',
'color_value_e': 'FFB39437',
'lite_class': 'turmeric',
'url': 'https://qn.colorcun.com/template/jianghuang-7.png',
},
{
'color_name': '苍黄',
'color_value_s': 'FFC85306',
'color_value_m': 'FFC85306',
'color_value_e': 'FFC85306',
'lite_class': 'greenishYellow',
'url': 'https://qn.colorcun.com/template/canghuang-7.png',
},
{
'color_name': '金黄',
'color_value_s': 'FFC67B3A',
'color_value_m': 'FFC67B3A',
'color_value_e': 'FFC67B3A',
'lite_class': 'golden',
'url': 'https://qn.colorcun.com/template/jinhuang-7.png',
},
{
'color_name': '群青',
'color_value_s': 'FF0143A3',
'color_value_m': 'FF0143A3',
'color_value_e': 'FF0143A3',
'lite_class': 'ultramarine',
'url': 'https://qn.colorcun.com/template/qunqing-7.png',
},
{
'color_name': '摩洛哥蓝',
'color_value_s': 'FF19516A',
'color_value_m': 'FF19516A',
'color_value_e': 'FF19516A',
'lite_class': 'moroccanBlue',
'url': 'https://qn.colorcun.com/template/moluogelan-7.png',
}
]
};
ThemeSunModel themeSunModel12 = ThemeSunModel.fromJson(jsonSun12);
themesDatas.add(themeSunModel12);
}
// _selectTheme(String id) {
// List<ThemeSunModel> temp = [];
// temp.addAll(themeModelCurrunt.urls);
// temp.addAll(themesDatas);
// List<String> tempUrls = temp.map((e) => e.url).toList();
// // List<String> temp =
// // themeModel.urls.map((e) => e.url).toList();
// // print(temp);
// // List<String> temp =
// // themesDatas.map((e) => e.url).toList();
// print(temp);
// _showPhotoView(
// context, temp.indexWhere((element) => element.id == id), tempUrls,
// (index) {
// //选中的index
// themeType = temp[index].id; //当前选中模版的id
// setState(() {});
// });
// }
_showPhotoView(BuildContext context, int index, List<String> imgs,
CustomCallBack callback,
{isShow = false, List dashName}) async {
... ... @@ -1702,96 +207,112 @@ class _InvitationThemeHomePageState extends State<InvitationThemeHomePage> {
@override
Widget build(BuildContext context) {
marketingCenterProvider =
Provider.of<MarketingCenterProvider>(context, listen: true);
return Scaffold(
backgroundColor: MyColours.color_ffffff,
appBar: SystemAppBar('客户通知设置'),
body: Column(
children: [
Expanded(
child: SingleChildScrollView(
child: Column(
body: Consumer<MarketingCenterProvider>(builder: (context1, model, _) {
if (model.pageStateThemeHome != PageState.Success) {
return ExceptionPage(
pageState: model.pageStateThemeHome,
callback: () async {},
emptyMsg: "暂时没有预订信息展示哦",
emptyImg: "empty_search",
showMsg: "加载中,请稍后...",
);
} else {
return Column(
children: [
VEmptyView(24),
GridView.builder(
padding: EdgeInsets.symmetric(horizontal: w(16)),
controller: controller,
// padding: EdgeInsets.only(top: ScreenUtil().getAdapterSize(10)),
shrinkWrap: true,
itemCount: themesDatas.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 themeSunModel = themesDatas[index];
return InkWell(
onTap: () {
// _selectTheme(themeDatas[themeColor].urls[index].id);
//跳转到下一页
NavigatorUtil.goInvitationThemeHomePreviewPage(
context, themeSunModel);
},
child: Container(
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(r(10)),
border: Border.all(
color: themeType == themeSunModel.id
? MyColours.color_005AA7
: MyColours.color_DBDBDB,
width: themeType == themeSunModel.id
? w(2)
: w(1))),
child: Column(
children: [
VEmptyView(10),
CachedNetworkImage(
imageUrl: themeSunModel.colors == null ||
themeSunModel.colors.length == 0
? themeSunModel.url
: themeSunModel
.colors[themeColor == null
? 0
: themeSunModel.colors.indexWhere(
(element) =>
element.colorName ==
themeSunModel
.themeColorDefault)]
.url,
width: (ScreenUtil().screenWidth - w(62)) / 2,
height: w(348),
fit: BoxFit.fitWidth,
alignment: Alignment.topCenter,
Expanded(
child: SingleChildScrollView(
child: Column(
children: [
VEmptyView(24),
GridView.builder(
padding: EdgeInsets.symmetric(horizontal: w(16)),
controller: controller,
// padding: EdgeInsets.only(top: ScreenUtil().getAdapterSize(10)),
shrinkWrap: true,
itemCount: marketingCenterProvider.templeteDatas.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) {
SellerTemplateColorListSunModel themeSunModel =
marketingCenterProvider.templeteDatas[index];
return InkWell(
onTap: () {
// _selectTheme(themeDatas[themeColor].urls[index].id);
//跳转到下一页
NavigatorUtil.goInvitationThemeHomePreviewPage(
context, themeSunModel);
},
child: Container(
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(r(10)),
border: Border.all(
color: themeType == themeSunModel.id
? MyColours.color_005AA7
: MyColours.color_DBDBDB,
width: themeType == themeSunModel.id
? w(2)
: w(1))),
child: Column(
children: [
VEmptyView(10),
CachedNetworkImage(
imageUrl: themeSunModel.colors == null ||
themeSunModel.colors.length == 0
? themeSunModel.url
: themeSunModel
.colors[themeColor == null
? 0
: themeSunModel.colors
.indexWhere((element) =>
element.colorName ==
themeSunModel
.themeColorDefault)]
.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(
themeSunModel.templateName,
maxLines: 1,
overflow: TextOverflow.ellipsis,
textAlign: TextAlign.left,
style: TextStyle(
color: MyColours.color_000000,
fontSize: font(14)),
),
)
],
),
VEmptyView(20),
Container(
padding: EdgeInsets.symmetric(
vertical: w(6), horizontal: w(2)),
width: double.infinity,
child: Text(
themeSunModel.name,
maxLines: 1,
overflow: TextOverflow.ellipsis,
textAlign: TextAlign.left,
style: TextStyle(
color: MyColours.color_000000,
fontSize: font(14)),
),
)
],
),
));
}),
));
}),
],
)))
],
)))
],
),
);
}
}),
);
}
}
... ...
... ... @@ -4,7 +4,11 @@ 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 'package:provider/provider.dart';
import '../../../models/seller_template_color_list_model.dart';
import '../../../provider/marketing_center_provider.dart';
import '../../../provider/user_model.dart';
import '../../../res/colors.dart';
import '../../../utils/dialog_util.dart';
import '../../../utils/event_bus.dart';
... ... @@ -22,7 +26,7 @@ import 'dart:convert' as convert;
*/
class InvitationThemeHomePreviewPage extends StatefulWidget {
final ThemeSunModel themeSunModel;
final SellerTemplateColorListSunModel themeSunModel;
InvitationThemeHomePreviewPage({Key key, this.themeSunModel})
: super(key: key);
... ... @@ -33,6 +37,7 @@ class InvitationThemeHomePreviewPage extends StatefulWidget {
class _InvitationThemeHomePreviewPageState
extends State<InvitationThemeHomePreviewPage> {
MarketingCenterProvider marketingCenterProvider;
ScrollController controller = ScrollController();
//当前店铺选中的颜色和板式
... ... @@ -46,11 +51,20 @@ class _InvitationThemeHomePreviewPageState
@override
void initState() {
super.initState();
if (widget.themeSunModel.colors.length > 0) {
themeColor = widget.themeSunModel.colors[0].colorName;
url = widget.themeSunModel.colors[0].url;
if (widget.themeSunModel.themeColorDefault != null) {
themeColor = widget.themeSunModel.themeColorDefault;
url = widget
.themeSunModel
.colors[widget.themeSunModel.colors
.indexWhere((element) => element.colorName == themeColor)]
.url;
} else {
url = widget.themeSunModel.url;
if (widget.themeSunModel.colors.length > 0) {
themeColor = widget.themeSunModel.colors[0].colorName;
url = widget.themeSunModel.colors[0].url;
} else {
url = widget.themeSunModel.url;
}
}
themeType = widget.themeSunModel.id;
... ... @@ -141,6 +155,8 @@ class _InvitationThemeHomePreviewPageState
@override
Widget build(BuildContext context) {
marketingCenterProvider =
Provider.of<MarketingCenterProvider>(context, listen: true);
return Scaffold(
backgroundColor: MyColours.color_ffffff,
appBar: SystemAppBar('客户通知设置'),
... ... @@ -247,13 +263,34 @@ class _InvitationThemeHomePreviewPageState
padding: EdgeInsets.only(
top: w(12), bottom: w(25), left: w(45), right: w(45)),
child: RoundButton(
onPressed: () {
//选择当前模版+主题色
bus.emit('theme_color_type', {
'themeColor': themeColor,
'themeType': themeType,
});
Navigator.pop(context);
onPressed: () async {
//接口成功后刷新并返回前一页
//接口
Map<String, String> params = {
'sid': Provider.of<UserModel>(context, listen: false)
.user
.sellerid,
'type': themeType,
'lite_class': widget
.themeSunModel
.colors[widget.themeSunModel.colors.indexWhere(
(element) => element.colorName == themeColor)]
.liteClass
};
bool success = await marketingCenterProvider
.setSellerTemplateConf(context, params,
showLoading: true);
if (success) {
Utils.showToast('设置成功');
//选择当前模版+主题色
bus.emit('theme_color_type', {
'themeColor': themeColor,
'themeType': themeType,
});
Navigator.pop(context);
}
},
text: '确定',
fontSize: 32,
... ...
... ... @@ -35,12 +35,16 @@ class _MarketingCenterHomePageState extends State<MarketingCenterHomePage> {
// bool selectShowPrice = true; //分享排菜单给客户时展示菜品价格
CollectStoreProvider collectStoreProvider;
@override
void initState() {
super.initState();
WidgetsBinding.instance.addPostFrameCallback((_) {
getSellerVersion();
});
}
... ... @@ -147,6 +151,7 @@ class _MarketingCenterHomePageState extends State<MarketingCenterHomePage> {
@override
void dispose() {
EventBus().emit('changeStatusColor');
super.dispose();
}
... ...
... ... @@ -9,6 +9,7 @@ import '../constant/error.dart';
import '../models/GetDzSellerConfModel.dart';
import '../models/mark_data_model.dart';
import '../models/recharge_notice_model.dart';
import '../models/seller_template_color_list_model.dart';
import '../models/tableOuter.dart';
import '../net/base_resp.dart';
import '../net/dio_util.dart';
... ... @@ -22,7 +23,9 @@ class MarketingCenterProvider extends ChangeNotifier {
PageState pageState = PageState.Loading;
PageState pageStateRechargeHome = PageState.Loading;
PageState pageStateBookInfo = PageState.Loading;
PageState pageStateBookInfo = PageState.Loading;
PageState pageStateThemeHome = PageState.Loading;
List<RechargeListSunModel> rechargeList = [];
... ... @@ -37,6 +40,7 @@ class MarketingCenterProvider extends ChangeNotifier {
RechargeNoticeSunModel rechargeNoticeSunModel;
GetDzSellerConfSunModel dzSellerConfModel;
List<SellerTemplateColorListSunModel> templeteDatas = []; //后台配置的模版数据
//获取桌位列表
getTableList(context, {needLoading = true}) async {
... ... @@ -72,6 +76,33 @@ class MarketingCenterProvider extends ChangeNotifier {
return false;
}
// 模板/颜色配置信息
Future<bool> getSellerTemplateColorList(BuildContext context,
{bool showLoading = true}) async {
Map<String, String> params = {
'sid': Provider.of<UserModel>(context, listen: false).user.sellerid
};
BaseResp<dynamic> baseResp = await DioUtil()
.request<dynamic>(
context, Method.get, HttpUrl.get_seller_template_color_list,
data: params, showLoading: showLoading)
.catchError((error) {
print(error.toString());
Utils.showToast('请求失败,请重试');
return false;
});
if (baseResp.code == Constant.status_success) {
templeteDatas =
SellerTemplateColorListModel.fromJson(baseResp.responseData).data;
notifyListeners();
return true;
} else {
Utils.showToast(baseResp.msg ?? '请求失败,请重试');
}
return false;
}
// 商家设置预订安排模板页面
Future<bool> setSellerTemplateConf(
BuildContext context, Map<String, String> params,
... ...
... ... @@ -36,6 +36,7 @@ import '../models/out_wine_record_model.dart';
import '../models/plan_cook_by_rid_model.dart';
import '../models/plan_cook_list_model.dart';
import '../models/recharge_list_model.dart';
import '../models/seller_template_color_list_model.dart';
import '../models/set_xuan_tai_model.dart';
import '../models/setmeal_by_id_model.dart';
import '../models/setmeal_model.dart';
... ... @@ -1841,7 +1842,7 @@ class NavigatorUtil {
/// 邀请函主题选择预览
static Future<dynamic> goInvitationThemeHomePreviewPage(
BuildContext context,
ThemeSunModel themeSunModel, {
SellerTemplateColorListSunModel themeSunModel, {
replace = false,
}) {
return _navigateTo(context,
... ...
... ... @@ -160,6 +160,7 @@ import '../models/month_statics_model.dart';
import '../models/out_wine_record_model.dart';
import '../models/plan_cook_by_rid_model.dart';
import '../models/plan_cook_list_model.dart';
import '../models/seller_template_color_list_model.dart';
import '../models/set_xuan_tai_model.dart';
import '../models/setmeal_by_id_model.dart';
import '../models/setmeal_model.dart';
... ... @@ -3123,10 +3124,12 @@ var invitationThemeHomePreviewPage = new Handler(
// String day = params["day"].first;
// String uid = params["uid"].first;
ThemeSunModel themeSunModel = ThemeSunModel.fromJson(json
.decode(FluroConvertUtils.fluroCnParamsDecode(params["themeSunModel"].first)));
SellerTemplateColorListSunModel themeSunModel =
SellerTemplateColorListSunModel.fromJson(json.decode(
FluroConvertUtils.fluroCnParamsDecode(
params["themeSunModel"].first)));
return ChangeNotifierProvider<MarketingCenterProvider>(
create: (_) => MarketingCenterProvider(),
child: InvitationThemeHomePreviewPage(themeSunModel:themeSunModel));
child: InvitationThemeHomePreviewPage(themeSunModel: themeSunModel));
});
... ...
... ... @@ -38,6 +38,7 @@ import 'package:url_launcher/url_launcher.dart';
import '../models/cookbook_model.dart';
import '../models/radio_model.dart';
import '../models/seller_template_color_list_model.dart';
import '../models/seller_version_model.dart';
import '../models/theme_color_model.dart';
import '../pages/my/marketing_center/theme_model.dart';
... ... @@ -6281,7 +6282,7 @@ class DialogUtil {
//主题颜色选择弹框
static showThemeColorSelectDialogNew(
BuildContext context, List<ThemeModel> themeShow,
BuildContext context, List<ColorListModel> themeShow,
{CustomCallBack callback}) {
ScrollController controller = ScrollController();
return showModalBottomSheet(
... ...