Showing
8 changed files
with
237 additions
and
3 deletions
| @@ -3,6 +3,7 @@ import 'package:flutter_screenutil/flutter_screenutil.dart'; | @@ -3,6 +3,7 @@ import 'package:flutter_screenutil/flutter_screenutil.dart'; | ||
| 3 | import 'package:one_key/widgets/v_empty_view.dart'; | 3 | import 'package:one_key/widgets/v_empty_view.dart'; |
| 4 | import 'package:provider/provider.dart'; | 4 | import 'package:provider/provider.dart'; |
| 5 | 5 | ||
| 6 | +import '../../../../app.dart'; | ||
| 6 | import '../../../../provider/user_model.dart'; | 7 | import '../../../../provider/user_model.dart'; |
| 7 | import '../../../../res/colors.dart'; | 8 | import '../../../../res/colors.dart'; |
| 8 | import '../../../../utils/screen_util.dart'; | 9 | import '../../../../utils/screen_util.dart'; |
| @@ -313,6 +314,11 @@ class _ChefIntroducePageState extends State<ChefIntroducePage> { | @@ -313,6 +314,11 @@ class _ChefIntroducePageState extends State<ChefIntroducePage> { | ||
| 313 | 314 | ||
| 314 | ///图文合并 | 315 | ///图文合并 |
| 315 | Widget _mergingWidget() { | 316 | Widget _mergingWidget() { |
| 317 | + Color themColor = MyColours.color_0C0F0E; | ||
| 318 | + int colorValue = App.sp.get("themeColor"); | ||
| 319 | + if (colorValue != null) { | ||
| 320 | + themColor = Color(colorValue); | ||
| 321 | + } | ||
| 316 | return Column( | 322 | return Column( |
| 317 | children: [ | 323 | children: [ |
| 318 | Stack( | 324 | Stack( |
| @@ -333,7 +339,7 @@ class _ChefIntroducePageState extends State<ChefIntroducePage> { | @@ -333,7 +339,7 @@ class _ChefIntroducePageState extends State<ChefIntroducePage> { | ||
| 333 | begin: Alignment.topCenter, | 339 | begin: Alignment.topCenter, |
| 334 | end: Alignment.bottomCenter, | 340 | end: Alignment.bottomCenter, |
| 335 | colors: [ | 341 | colors: [ |
| 336 | - MyColours.color_0C0F0E, | 342 | + themColor, |
| 337 | MyColours.color_4D0C0F0E, | 343 | MyColours.color_4D0C0F0E, |
| 338 | ], | 344 | ], |
| 339 | ), | 345 | ), |
| 1 | +import 'package:flutter/material.dart'; | ||
| 2 | +import 'package:flutter_screenutil/flutter_screenutil.dart'; | ||
| 3 | +import 'package:provider/provider.dart'; | ||
| 4 | + | ||
| 5 | +import '../../../../provider/marketing_center_provider.dart'; | ||
| 6 | +import '../../../../res/colors.dart'; | ||
| 7 | +import '../../../../utils/screen_util.dart'; | ||
| 8 | +import '../../../../utils/utils.dart'; | ||
| 9 | +import '../../../../widgets/round_button.dart'; | ||
| 10 | +import '../../../../widgets/system_app_bar.dart'; | ||
| 11 | +import '../../../../widgets/v_empty_view.dart'; | ||
| 12 | + | ||
| 13 | +/*** | ||
| 14 | + * 菜品展示 | ||
| 15 | + */ | ||
| 16 | + | ||
| 17 | +class DishShowPage extends StatefulWidget { | ||
| 18 | + DishShowPage({Key key}) : super(key: key); | ||
| 19 | + | ||
| 20 | + @override | ||
| 21 | + _DishShowPageState createState() => _DishShowPageState(); | ||
| 22 | +} | ||
| 23 | + | ||
| 24 | +class _DishShowPageState extends State<DishShowPage> { | ||
| 25 | + MarketingCenterProvider marketingCenterProvider; | ||
| 26 | + bool addDish = false; | ||
| 27 | + | ||
| 28 | + Widget _item(String title, {bool select, GestureTapCallback onTap}) { | ||
| 29 | + return InkWell( | ||
| 30 | + onTap: onTap, | ||
| 31 | + child: Container( | ||
| 32 | + decoration: BoxDecoration( | ||
| 33 | + border: Border( | ||
| 34 | + bottom: BorderSide( | ||
| 35 | + color: MyColours.color_E7E7E7, width: w(0.5)))), | ||
| 36 | + margin: EdgeInsets.only(left: w(16)), | ||
| 37 | + padding: EdgeInsets.only(top: w(12), bottom: w(12), right: w(16)), | ||
| 38 | + child: Row( | ||
| 39 | + children: [ | ||
| 40 | + Text( | ||
| 41 | + title, | ||
| 42 | + style: TextStyle( | ||
| 43 | + color: MyColours.color_515151, | ||
| 44 | + fontSize: ScreenUtil().setWidth(32)), | ||
| 45 | + ), | ||
| 46 | + Spacer(), | ||
| 47 | + Container( | ||
| 48 | + padding: | ||
| 49 | + EdgeInsets.symmetric(horizontal: w(7), vertical: w(4)), | ||
| 50 | + child: Image.asset( | ||
| 51 | + Utils.getImgPath(select ? 'swich_on' : 'swich_off'), | ||
| 52 | + width: w(44), | ||
| 53 | + ), | ||
| 54 | + ) | ||
| 55 | + ], | ||
| 56 | + ))); | ||
| 57 | + } | ||
| 58 | + | ||
| 59 | + Widget _uploadImage(bool hasupload, {EdgeInsets padding = EdgeInsets.zero}) { | ||
| 60 | + return InkWell( | ||
| 61 | + onTap: () {}, | ||
| 62 | + child: hasupload | ||
| 63 | + ? InkWell( | ||
| 64 | + onTap: () { | ||
| 65 | + print('object'); | ||
| 66 | + }, | ||
| 67 | + child: Stack(alignment: Alignment.bottomCenter, children: [ | ||
| 68 | + Image.network( | ||
| 69 | + 'https://www.ssfiction.com/wp-content/uploads/2020/08/20200805_5f2b1669e9a24.jpg', | ||
| 70 | + fit: BoxFit.cover, | ||
| 71 | + height: w(280), | ||
| 72 | + ), | ||
| 73 | + Container( | ||
| 74 | + width: w(150), | ||
| 75 | + height: w(30), | ||
| 76 | + color: MyColours.color_4D000000, | ||
| 77 | + margin: padding, | ||
| 78 | + alignment: Alignment.center, | ||
| 79 | + child: Text( | ||
| 80 | + '点击图片可以更换', | ||
| 81 | + style: TextStyle( | ||
| 82 | + color: MyColours.color_F8F9FD, | ||
| 83 | + fontSize: font(14), | ||
| 84 | + fontWeight: FontWeight.bold), | ||
| 85 | + )), | ||
| 86 | + ])) | ||
| 87 | + : Container( | ||
| 88 | + color: MyColours.color_d9d9d9, | ||
| 89 | + width: double.infinity, | ||
| 90 | + height: w(280), | ||
| 91 | + padding: padding, | ||
| 92 | + child: Column( | ||
| 93 | + mainAxisAlignment: MainAxisAlignment.center, | ||
| 94 | + children: [ | ||
| 95 | + Image.asset( | ||
| 96 | + Utils.getImgPath('add_img'), | ||
| 97 | + width: w(63), | ||
| 98 | + ), | ||
| 99 | + VEmptyView(28), | ||
| 100 | + Container( | ||
| 101 | + width: w(139), | ||
| 102 | + height: w(60), | ||
| 103 | + child: Text( | ||
| 104 | + '点击上传照片\n为了更好的效果\n建议上传4:3照片', | ||
| 105 | + textAlign: TextAlign.center, | ||
| 106 | + style: TextStyle( | ||
| 107 | + height: 1.4, | ||
| 108 | + color: MyColours.color_ffffff, | ||
| 109 | + fontSize: font(14), | ||
| 110 | + fontWeight: FontWeight.bold), | ||
| 111 | + )) | ||
| 112 | + ], | ||
| 113 | + ), | ||
| 114 | + )); | ||
| 115 | + } | ||
| 116 | + | ||
| 117 | + @override | ||
| 118 | + Widget build(BuildContext context) { | ||
| 119 | + marketingCenterProvider = | ||
| 120 | + Provider.of<MarketingCenterProvider>(context, listen: true); | ||
| 121 | + | ||
| 122 | + return Scaffold( | ||
| 123 | + backgroundColor: MyColours.color_ffffff, | ||
| 124 | + appBar: SystemAppBar( | ||
| 125 | + '招牌菜展示', | ||
| 126 | + onTap: () { | ||
| 127 | + Navigator.pop(context); | ||
| 128 | + }, | ||
| 129 | + ), | ||
| 130 | + body: Column(children: [ | ||
| 131 | + Expanded( | ||
| 132 | + child: SingleChildScrollView( | ||
| 133 | + child: Column(children: [ | ||
| 134 | + _item('附加招牌菜展示', select: addDish, onTap: () { | ||
| 135 | + setState(() { | ||
| 136 | + addDish = !addDish; | ||
| 137 | + }); | ||
| 138 | + }), | ||
| 139 | + VEmptyView(24), | ||
| 140 | + Container( | ||
| 141 | + alignment: Alignment.centerLeft, | ||
| 142 | + padding: EdgeInsets.only(left: w(16)), | ||
| 143 | + height: w(48), | ||
| 144 | + child: Text( | ||
| 145 | + '效果预览', | ||
| 146 | + style: TextStyle( | ||
| 147 | + fontSize: font(16), color: MyColours.color_515151), | ||
| 148 | + ), | ||
| 149 | + ), | ||
| 150 | + addDish | ||
| 151 | + ? Column( | ||
| 152 | + children: [ | ||
| 153 | + VEmptyView(24), | ||
| 154 | + _uploadImage(false), | ||
| 155 | + VEmptyView(18), | ||
| 156 | + _uploadImage(true), | ||
| 157 | + VEmptyView(18), | ||
| 158 | + _uploadImage(true), | ||
| 159 | + VEmptyView(18), | ||
| 160 | + ], | ||
| 161 | + ) | ||
| 162 | + : SizedBox() | ||
| 163 | + ]))), | ||
| 164 | + Container( | ||
| 165 | + color: MyColours.color_ffffff, | ||
| 166 | + padding: EdgeInsets.only( | ||
| 167 | + left: w(45), right: w(45), top: w(12), bottom: w(25)), | ||
| 168 | + child: RoundButton( | ||
| 169 | + text: '保存', | ||
| 170 | + gradientStart: MyColours.color_199095, | ||
| 171 | + gradientEnd: MyColours.color_199095, | ||
| 172 | + // borderColor: MyColours.color_999999, | ||
| 173 | + radius: r(5), | ||
| 174 | + fontSize: 34, | ||
| 175 | + height: w(40), | ||
| 176 | + isBold: true, | ||
| 177 | + onPressed: () {}, | ||
| 178 | + ), | ||
| 179 | + ) | ||
| 180 | + ])); | ||
| 181 | + } | ||
| 182 | +} |
| @@ -5,6 +5,7 @@ import 'package:one_key/utils/utils.dart'; | @@ -5,6 +5,7 @@ import 'package:one_key/utils/utils.dart'; | ||
| 5 | import 'package:one_key/widgets/system_app_bar.dart'; | 5 | import 'package:one_key/widgets/system_app_bar.dart'; |
| 6 | import 'package:one_key/widgets/v_empty_view.dart'; | 6 | import 'package:one_key/widgets/v_empty_view.dart'; |
| 7 | 7 | ||
| 8 | +import '../../../../app.dart'; | ||
| 8 | import '../../../../models/theme_color_model.dart'; | 9 | import '../../../../models/theme_color_model.dart'; |
| 9 | import '../../../../res/colors.dart'; | 10 | import '../../../../res/colors.dart'; |
| 10 | import '../../../../utils/screen_util.dart'; | 11 | import '../../../../utils/screen_util.dart'; |
| @@ -40,6 +41,18 @@ class _FirstImagePageState extends State<FirstImagePage> { | @@ -40,6 +41,18 @@ class _FirstImagePageState extends State<FirstImagePage> { | ||
| 40 | 41 | ||
| 41 | ///初始化主题颜色 | 42 | ///初始化主题颜色 |
| 42 | _initThemeColor() { | 43 | _initThemeColor() { |
| 44 | + int colorValue = App.sp.get("themeColor"); | ||
| 45 | + | ||
| 46 | + if (colorValue != null) { | ||
| 47 | + //缓存里有设置好的主题色 | ||
| 48 | + if (colorValue == MyColours.color_0C0F0E.value) { | ||
| 49 | + themeColorIndex = 0; | ||
| 50 | + } else if (colorValue == MyColours.color_0143A3.value) { | ||
| 51 | + themeColorIndex = 1; | ||
| 52 | + } else if (colorValue == MyColours.color_438E93.value) { | ||
| 53 | + themeColorIndex = 2; | ||
| 54 | + } | ||
| 55 | + } | ||
| 43 | ThemeColorModel colorModel = ThemeColorModel(); | 56 | ThemeColorModel colorModel = ThemeColorModel(); |
| 44 | colorModel.name = '睿智黑'; | 57 | colorModel.name = '睿智黑'; |
| 45 | colorModel.color = MyColours.color_0C0F0E; | 58 | colorModel.color = MyColours.color_0C0F0E; |
| @@ -190,6 +203,8 @@ class _FirstImagePageState extends State<FirstImagePage> { | @@ -190,6 +203,8 @@ class _FirstImagePageState extends State<FirstImagePage> { | ||
| 190 | setState(() { | 203 | setState(() { |
| 191 | themeColorIndex = object; | 204 | themeColorIndex = object; |
| 192 | }); | 205 | }); |
| 206 | + App.sp.setInt("themeColor", | ||
| 207 | + themeColorData[themeColorIndex].color.value); | ||
| 193 | }); | 208 | }); |
| 194 | }), | 209 | }), |
| 195 | VEmptyView(24), | 210 | VEmptyView(24), |
| @@ -3,6 +3,7 @@ import 'package:flutter_screenutil/flutter_screenutil.dart'; | @@ -3,6 +3,7 @@ import 'package:flutter_screenutil/flutter_screenutil.dart'; | ||
| 3 | import 'package:one_key/widgets/v_empty_view.dart'; | 3 | import 'package:one_key/widgets/v_empty_view.dart'; |
| 4 | import 'package:provider/provider.dart'; | 4 | import 'package:provider/provider.dart'; |
| 5 | 5 | ||
| 6 | +import '../../../../app.dart'; | ||
| 6 | import '../../../../provider/user_model.dart'; | 7 | import '../../../../provider/user_model.dart'; |
| 7 | import '../../../../res/colors.dart'; | 8 | import '../../../../res/colors.dart'; |
| 8 | import '../../../../utils/screen_util.dart'; | 9 | import '../../../../utils/screen_util.dart'; |
| @@ -286,6 +287,11 @@ class _StoreIntroducePageState extends State<StoreIntroducePage> { | @@ -286,6 +287,11 @@ class _StoreIntroducePageState extends State<StoreIntroducePage> { | ||
| 286 | 287 | ||
| 287 | ///图文合并 | 288 | ///图文合并 |
| 288 | Widget _mergingWidget() { | 289 | Widget _mergingWidget() { |
| 290 | + Color themColor = MyColours.color_0C0F0E; | ||
| 291 | + int colorValue = App.sp.get("themeColor"); | ||
| 292 | + if (colorValue != null) { | ||
| 293 | + themColor = Color(colorValue); | ||
| 294 | + } | ||
| 289 | return Column( | 295 | return Column( |
| 290 | children: [ | 296 | children: [ |
| 291 | Stack( | 297 | Stack( |
| @@ -306,7 +312,7 @@ class _StoreIntroducePageState extends State<StoreIntroducePage> { | @@ -306,7 +312,7 @@ class _StoreIntroducePageState extends State<StoreIntroducePage> { | ||
| 306 | begin: Alignment.topCenter, | 312 | begin: Alignment.topCenter, |
| 307 | end: Alignment.bottomCenter, | 313 | end: Alignment.bottomCenter, |
| 308 | colors: [ | 314 | colors: [ |
| 309 | - MyColours.color_0C0F0E, | 315 | + themColor, |
| 310 | MyColours.color_4D0C0F0E, | 316 | MyColours.color_4D0C0F0E, |
| 311 | ], | 317 | ], |
| 312 | ), | 318 | ), |
| @@ -155,7 +155,9 @@ class _MarketingCenterHomePageState extends State<MarketingCenterHomePage> { | @@ -155,7 +155,9 @@ class _MarketingCenterHomePageState extends State<MarketingCenterHomePage> { | ||
| 155 | _item('主厨介绍展示', onTap: () { | 155 | _item('主厨介绍展示', onTap: () { |
| 156 | NavigatorUtil.goChefIntroducePage(context); | 156 | NavigatorUtil.goChefIntroducePage(context); |
| 157 | }), | 157 | }), |
| 158 | - _item('招牌菜展示', onTap: () {}), | 158 | + _item('招牌菜展示', onTap: () { |
| 159 | + NavigatorUtil.goDishShowPage(context); | ||
| 160 | + }), | ||
| 159 | _item('营销及客户互动功能', onTap: () {}), | 161 | _item('营销及客户互动功能', onTap: () {}), |
| 160 | ], | 162 | ], |
| 161 | ), | 163 | ), |
| @@ -1428,4 +1428,13 @@ class NavigatorUtil { | @@ -1428,4 +1428,13 @@ class NavigatorUtil { | ||
| 1428 | return _navigateTo(context, "${Routes.chef_introduce_page}", | 1428 | return _navigateTo(context, "${Routes.chef_introduce_page}", |
| 1429 | replace: replace); | 1429 | replace: replace); |
| 1430 | } | 1430 | } |
| 1431 | + | ||
| 1432 | + ///预订安排通知定制------附加招牌菜展示 | ||
| 1433 | + static Future<dynamic> goDishShowPage( | ||
| 1434 | + BuildContext context, { | ||
| 1435 | + replace = false, | ||
| 1436 | + }) { | ||
| 1437 | + return _navigateTo(context, "${Routes.dish_show_page}", | ||
| 1438 | + replace: replace); | ||
| 1439 | + } | ||
| 1431 | } | 1440 | } |
| @@ -179,6 +179,7 @@ import '../pages/my/feast_manage/feast_wine_manage_edit_page.dart'; | @@ -179,6 +179,7 @@ import '../pages/my/feast_manage/feast_wine_manage_edit_page.dart'; | ||
| 179 | import '../pages/my/feast_manage/feast_wine_manage_page.dart'; | 179 | import '../pages/my/feast_manage/feast_wine_manage_page.dart'; |
| 180 | import '../pages/my/marketing_center/book_notification/book_info_page.dart'; | 180 | import '../pages/my/marketing_center/book_notification/book_info_page.dart'; |
| 181 | import '../pages/my/marketing_center/book_notification/chef_introduce_page.dart'; | 181 | import '../pages/my/marketing_center/book_notification/chef_introduce_page.dart'; |
| 182 | +import '../pages/my/marketing_center/book_notification/dish_show_page.dart'; | ||
| 182 | import '../pages/my/marketing_center/book_notification/first_image_page.dart'; | 183 | import '../pages/my/marketing_center/book_notification/first_image_page.dart'; |
| 183 | import '../pages/my/marketing_center/book_notification/store_introduce_page.dart'; | 184 | import '../pages/my/marketing_center/book_notification/store_introduce_page.dart'; |
| 184 | import '../pages/my/marketing_center/marketing_center_home_page.dart'; | 185 | import '../pages/my/marketing_center/marketing_center_home_page.dart'; |
| @@ -2340,3 +2341,13 @@ var chefIntroducePageHandle = new Handler( | @@ -2340,3 +2341,13 @@ var chefIntroducePageHandle = new Handler( | ||
| 2340 | return ChangeNotifierProvider<MarketingCenterProvider>( | 2341 | return ChangeNotifierProvider<MarketingCenterProvider>( |
| 2341 | create: (_) => MarketingCenterProvider(), child: ChefIntroducePage()); | 2342 | create: (_) => MarketingCenterProvider(), child: ChefIntroducePage()); |
| 2342 | }); | 2343 | }); |
| 2344 | + | ||
| 2345 | +//我的----营销中心-招牌菜展示 | ||
| 2346 | +var dishShowPageHandle = new Handler( | ||
| 2347 | + handlerFunc: (BuildContext context, Map<dynamic, List<Object>> params) { | ||
| 2348 | + // String idstr = params["idstr"].first; | ||
| 2349 | + // NotebookDetail detailEntity = NotebookDetail.fromJson(json | ||
| 2350 | + // .decode(FluroConvertUtils.fluroCnParamsDecode(params["detail"].first))); | ||
| 2351 | + return ChangeNotifierProvider<MarketingCenterProvider>( | ||
| 2352 | + create: (_) => MarketingCenterProvider(), child: DishShowPage()); | ||
| 2353 | +}); |
| @@ -197,6 +197,7 @@ class Routes { | @@ -197,6 +197,7 @@ class Routes { | ||
| 197 | "/store_introduce_page"; //预订安排通知定制------店铺介绍 | 197 | "/store_introduce_page"; //预订安排通知定制------店铺介绍 |
| 198 | static String chef_introduce_page = | 198 | static String chef_introduce_page = |
| 199 | "/chef_introduce_page"; //预订安排通知定制------主厨介绍 | 199 | "/chef_introduce_page"; //预订安排通知定制------主厨介绍 |
| 200 | + static String dish_show_page = "/dish_show_page"; //预订安排通知定制------招牌菜介绍 | ||
| 200 | 201 | ||
| 201 | static void configureRoutes(FluroRouter router) { | 202 | static void configureRoutes(FluroRouter router) { |
| 202 | router.notFoundHandler = new Handler( | 203 | router.notFoundHandler = new Handler( |
| @@ -387,5 +388,7 @@ class Routes { | @@ -387,5 +388,7 @@ class Routes { | ||
| 387 | router.define(book_info_page, handler: bookInfoPageHandle); | 388 | router.define(book_info_page, handler: bookInfoPageHandle); |
| 388 | router.define(store_introduce_page, handler: storeIntroducePageHandle); | 389 | router.define(store_introduce_page, handler: storeIntroducePageHandle); |
| 389 | router.define(chef_introduce_page, handler: chefIntroducePageHandle); | 390 | router.define(chef_introduce_page, handler: chefIntroducePageHandle); |
| 391 | + | ||
| 392 | + router.define(dish_show_page, handler: dishShowPageHandle); | ||
| 390 | } | 393 | } |
| 391 | } | 394 | } |
-
Please register or login to post a comment