Commit 85dbadd40cfc451349c66a540a2f29ee8b47c4e7

Authored by wdn127929
1 parent fc099bc3

首页形象展示部分UI

import 'package:flutter/material.dart';
class ThemeColorModel {
String name;
Color color;
}
... ...
import 'package:flutter/material.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart';
import 'package:one_key/utils/dialog_util.dart';
import 'package:one_key/widgets/system_app_bar.dart';
import 'package:one_key/widgets/v_empty_view.dart';
import '../../../../models/theme_color_model.dart';
import '../../../../res/colors.dart';
import '../../../../utils/screen_util.dart';
import '../../../../widgets/round_button.dart';
/**
* 首图形象展示
*/
class FirstImagePage extends StatefulWidget {
FirstImagePage({Key key}) : super(key: key);
@override
_FirstImagePageState createState() => _FirstImagePageState();
}
class _FirstImagePageState extends State<FirstImagePage> {
List<ThemeColorModel> themeColorData = [];
int themeColorIndex = 0;
@override
void initState() {
super.initState();
_initThemeColor();
}
///初始化主题颜色
_initThemeColor() {
ThemeColorModel colorModel = ThemeColorModel();
colorModel.name = '睿智黑';
colorModel.color = MyColours.color_0C0F0E;
themeColorData.add(colorModel);
ThemeColorModel colorModel1 = ThemeColorModel();
colorModel.name = '孔雀蓝';
colorModel.color = MyColours.color_0143A3;
themeColorData.add(colorModel1);
ThemeColorModel colorModel2 = ThemeColorModel();
colorModel.name = '群青绿';
colorModel.color = MyColours.color_438E93;
themeColorData.add(colorModel2);
}
Widget _item(String title, String subtitle, {GestureTapCallback onTap}) {
return InkWell(
onTap: onTap,
child: Container(
decoration: BoxDecoration(
border: Border(
bottom: BorderSide(
color: MyColours.color_E7E7E7, width: w(0.5)))),
margin: EdgeInsets.only(left: w(16)),
padding: EdgeInsets.only(top: w(12), bottom: w(12), right: w(12)),
child: Row(
children: [
Text(
title,
style: TextStyle(
color: MyColours.color_515151,
fontSize: ScreenUtil().setWidth(32)),
),
Spacer(),
Text(
subtitle,
style: TextStyle(
color: MyColours.color_515151,
fontSize: ScreenUtil().setWidth(32)),
),
Container(
padding:
EdgeInsets.symmetric(horizontal: w(7), vertical: w(4)),
child: Image.asset(
"assets/arrow_right_new.png",
width: ScreenUtil().setWidth(18),
height: ScreenUtil().setWidth(32),
),
)
],
)));
}
@override
Widget build(BuildContext context) {
return Scaffold(
backgroundColor: MyColours.color_ffffff,
appBar: SystemAppBar(
'首图形象展示',
onTap: () {
Navigator.pop(context);
},
),
body: Column(
children: [
Expanded(
child: SingleChildScrollView(
child: Column(
children: [
_item('主题颜色选择', themeColorData[themeColorIndex].name,
onTap: () {
DialogUtil.showThemeColorSelectDialog(context,
callback: (object) {
print(object);
setState(() {
themeColorIndex = object;
});
});
}),
VEmptyView(24),
Container(
height: w(48),
alignment: Alignment.centerLeft,
padding: EdgeInsets.symmetric(horizontal: w(16)),
child: Text(
'效果预览',
style: TextStyle(
color: MyColours.color_515151,
fontSize: ScreenUtil().setWidth(32)),
),
),
VEmptyView(24),
Container(
width: double.infinity,
height: w(165),
color: themeColorData[themeColorIndex].color,
)
],
),
)),
Container(
color: MyColours.color_ffffff,
padding: EdgeInsets.only(
left: w(45), right: w(45), top: w(12), bottom: w(25)),
child: RoundButton(
text: '保存',
gradientStart: MyColours.color_199095,
gradientEnd: MyColours.color_199095,
// borderColor: MyColours.color_999999,
radius: r(5),
fontSize: 34,
height: w(40),
isBold: true,
onPressed: () {},
),
)
],
),
);
}
}
... ...
import 'package:flutter/material.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart';
import 'package:one_key/route/navigator_util.dart';
import 'package:one_key/widgets/MyDivider.dart';
import 'package:one_key/widgets/v_empty_view.dart';
import 'package:provider/provider.dart';
import '../../../provider/marketing_center_provider.dart';
import '../../../res/colors.dart';
import '../../../utils/event_bus.dart';
import '../../../utils/screen_util.dart';
import '../../../widgets/round_button.dart';
import '../../../widgets/system_app_bar.dart';
... ... @@ -22,6 +26,40 @@ class MarketingCenterHomePage extends StatefulWidget {
class _MarketingCenterHomePageState extends State<MarketingCenterHomePage> {
MarketingCenterProvider marketingCenterProvider;
Widget _item(String title, {GestureTapCallback onTap}) {
return InkWell(
onTap: onTap,
child: Container(
decoration: BoxDecoration(
border: Border(
bottom: BorderSide(
color: MyColours.color_E7E7E7, width: w(0.5)))),
margin: EdgeInsets.only(
right: w(20), left: w(36), bottom: w(12), top: w(12)),
padding: EdgeInsets.only(top: w(12), bottom: w(12), right: w(12)),
child: Row(
children: [
Text(
title,
style: TextStyle(
color: MyColours.color_515151,
fontSize: ScreenUtil().setWidth(32)),
),
Spacer(),
Container(
padding:
EdgeInsets.symmetric(horizontal: w(7), vertical: w(4)),
child: Image.asset(
"assets/arrow_right_new.png",
width: ScreenUtil().setWidth(18),
height: ScreenUtil().setWidth(32),
),
)
],
)));
}
@override
Widget build(BuildContext context) {
marketingCenterProvider =
... ... @@ -40,28 +78,81 @@ class _MarketingCenterHomePageState extends State<MarketingCenterHomePage> {
EventBus().emit('changeStatusColor');
Navigator.of(context).pop();
},
child: Column(
children: [
Expanded(
child: SingleChildScrollView(
child: Column(
children: [],
),
)),
Container(
child: RoundButton(
text: '保存',
gradientStart: MyColours.color_199095,
gradientEnd: MyColours.color_199095,
// borderColor: MyColours.color_999999,
radius: ScreenUtil().setWidth(10),
fontSize: 34,
height: ScreenUtil().setWidth(80),
isBold: false,
onPressed: () {},
),
)
],
child: SingleChildScrollView(
child: Column(
children: [
InkWell(
onTap: () {
// NavigatorUtil.goWebPage(context, '隐私政策', "zc",
// need: true);
},
child: Padding(
padding: EdgeInsets.only(
left: w(16),
top: w(12),
bottom: w(12),
right: w(12)),
child: Row(
children: [
Text(
'会员充值优惠活动',
style: TextStyle(
color: MyColours.color_515151,
fontSize: ScreenUtil().setWidth(32)),
),
Spacer(),
Container(
padding: EdgeInsets.symmetric(
horizontal: w(7), vertical: w(4)),
child: Image.asset(
"assets/arrow_right_new.png",
width: ScreenUtil().setWidth(18),
height: ScreenUtil().setWidth(32),
),
)
],
))),
Padding(
padding: EdgeInsets.only(left: w(16)),
child: MyDivider(double.infinity, w(0.5),
color: MyColours.color_E7E7E7)),
VEmptyView(24),
Padding(
padding: EdgeInsets.only(
left: w(16), top: w(12), bottom: w(12), right: w(12)),
child: Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
Text(
'预订安排通知定制',
style: TextStyle(
color: MyColours.color_515151,
fontSize: ScreenUtil().setWidth(32)),
),
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: () {},
),
])),
_item('首图形象展示', onTap: () {
NavigatorUtil.goFirstImagePage(context);
}),
_item('预订信息模块', onTap: () {}),
_item('店铺介绍展示', onTap: () {}),
_item('主厨介绍展示', onTap: () {}),
_item('招牌菜展示', onTap: () {}),
_item('营销及客户互动功能', onTap: () {}),
],
),
)));
}
}
... ...
import 'package:flutter/material.dart';
class MyColours {
static const Color color_0143A3 = Color(0xFF0143A3);
static const Color color_438E93 = Color(0xFF438E93);
static const Color color_0C0F0E = Color(0xFF0C0F0E);
static const Color color_28323B = Color(0xFF28323B);
static const Color color_80438E93 = Color(0x80438E93);
static const Color color_303030 = Color(0xff303030);
... ... @@ -31,7 +34,6 @@ class MyColours {
static const Color color_E7E7E7 = Color(0xffE7E7E7);
static const Color color_E34D59 = Color(0xffE34D59);
static const Color color_515151 = Color(0xff515151);
static const Color color_438E93 = Color(0xff438E93);
static const Color color_27262B = Color(0xff27262B);
static const Color color_BFC4D4 = Color(0xffBFC4D4);
static const Color color_C9C9C9 = Color(0xffC9C9C9);
... ...
... ... @@ -1388,11 +1388,18 @@ class NavigatorUtil {
///我的-----营销中心
static Future<dynamic> goMarketingCenterHomePage(
BuildContext context,
{
BuildContext context, {
replace = false,
}) {
return _navigateTo(context, "${Routes.marketing_center_home_page}",
replace: replace);
}
///预订安排通知定制------首图形象展示
static Future<dynamic> goFirstImagePage(
BuildContext context, {
replace = false,
}) {
return _navigateTo(context, "${Routes.first_image_page}", replace: replace);
}
}
... ...
... ... @@ -177,6 +177,7 @@ import '../pages/my/feast_manage/feast_setmeal_manage_edit_page.dart';
import '../pages/my/feast_manage/feast_type_page.dart';
import '../pages/my/feast_manage/feast_wine_manage_edit_page.dart';
import '../pages/my/feast_manage/feast_wine_manage_page.dart';
import '../pages/my/marketing_center/book_notification/first_image_page.dart';
import '../pages/my/marketing_center/marketing_center_home_page.dart';
import '../pages/my/plan_dish/final_plan_dish_page.dart';
import '../pages/my/plan_dish/my_plan_dish_home_page.dart';
... ... @@ -2156,7 +2157,7 @@ var orderEditListShowPageHandle = new Handler(
data: res,
storeList: storeList,
mineList: mineList,
oftenList:oftenList,
oftenList: oftenList,
planPrice: planPrice,
planCookByRidSunModel: planCookByRidSunModel,
detailEntity: detailEntity,
... ... @@ -2287,11 +2288,18 @@ var marketingCenterHomePageHandle = new Handler(
handlerFunc: (BuildContext context, Map<dynamic, List<Object>> params) {
// String idstr = params["idstr"].first;
// NotebookDetail detailEntity = NotebookDetail.fromJson(json
// .decode(FluroConvertUtils.fluroCnParamsDecode(params["detail"].first)));
// .decode(FluroConvertUtils.fluroCnParamsDecode(params["detail"].first)));
return ChangeNotifierProvider<MarketingCenterProvider>(
create: (_) => MarketingCenterProvider(),
child: MarketingCenterHomePage());
});
//我的----营销中心
var firstImagePageHandle = new Handler(
handlerFunc: (BuildContext context, Map<dynamic, List<Object>> params) {
// String idstr = params["idstr"].first;
// NotebookDetail detailEntity = NotebookDetail.fromJson(json
// .decode(FluroConvertUtils.fluroCnParamsDecode(params["detail"].first)));
return ChangeNotifierProvider<MarketingCenterProvider>(
create: (_) => MarketingCenterProvider(), child: FirstImagePage());
});
... ...
... ... @@ -191,8 +191,7 @@ class Routes {
*/
static String marketing_center_home_page =
"/marketing_center_home_page"; //我的---营销中心
static String first_image_page = "/first_image_page"; //预订安排通知定制------首图形象展示
static void configureRoutes(FluroRouter router) {
router.notFoundHandler = new Handler(
... ... @@ -377,6 +376,11 @@ class Routes {
router.define(marketing_center_home_page,
handler: marketingCenterHomePageHandle);
router.define(first_image_page,
handler: firstImagePageHandle);
}
}
... ...
... ... @@ -4640,6 +4640,110 @@ class DialogUtil {
});
}
//主题颜色选择弹框
static showThemeColorSelectDialog(BuildContext context,
{CustomCallBack callback}) {
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(
child: Column(
mainAxisSize: MainAxisSize.min,
children: <Widget>[
VEmptyView(174),
InkWell(
onTap: () {
Navigator.pop(context);
callback(0);
},
child: Container(
width: double.infinity,
height: w(106),
color: MyColours.color_0C0F0E,
margin: EdgeInsets.symmetric(horizontal: w(30)),
padding: EdgeInsets.only(left: w(10), top: w(13)),
child: Container(
width: w(61),
height: w(27),
child: Text('睿智黑',
style: TextStyle(
color: MyColours.color_ffffff,
fontWeight: FontWeight.bold,
fontSize: font(16)))))),
VEmptyView(56),
InkWell(
onTap: () {
Navigator.pop(context);
callback(1);
},
child: Container(
color: MyColours.color_0143A3,
width: double.infinity,
height: w(106),
margin: EdgeInsets.symmetric(horizontal: w(30)),
padding: EdgeInsets.only(left: w(10), top: w(13)),
child: Container(
width: w(61),
height: w(27),
child: Text('孔雀蓝',
style: TextStyle(
color: MyColours.color_ffffff,
fontWeight: FontWeight.bold,
fontSize: font(16)))))),
VEmptyView(56),
InkWell(
onTap: () {
Navigator.pop(context);
callback(2);
},
child: Container(
color: MyColours.color_438E93,
width: double.infinity,
height: w(106),
margin: EdgeInsets.symmetric(horizontal: w(30)),
padding: EdgeInsets.only(left: w(10), top: w(13)),
child: Container(
width: w(61),
height: w(27),
child: Text('群青绿',
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 Future<int> showTableManagerDialog(
BuildContext context, t.Table table) {
... ... @@ -5170,7 +5274,6 @@ class DialogUtil {
padding:
EdgeInsets.symmetric(horizontal: ScreenUtil().setWidth(72)),
height: ScreenUtil().setWidth(height),
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(ScreenUtil().setWidth(30))),
child: Card(
... ...