Commit 54dbe176eb68f24422614f3c7bb5e41c214b3fd3

Authored by wdn127929
1 parent 33a8aff4

店铺简介------图文分开

  1 +import 'package:flutter/material.dart';
  2 +import 'package:flutter_screenutil/flutter_screenutil.dart';
  3 +import 'package:one_key/widgets/v_empty_view.dart';
  4 +import 'package:provider/provider.dart';
  5 +
  6 +import '../../../../provider/user_model.dart';
  7 +import '../../../../res/colors.dart';
  8 +import '../../../../utils/screen_util.dart';
  9 +import '../../../../utils/utils.dart';
  10 +import '../../../../widgets/MyDivider.dart';
  11 +import '../../../../widgets/common_button_flat.dart';
  12 +import '../../../../widgets/round_button.dart';
  13 +import '../../../../widgets/system_app_bar.dart';
  14 +
  15 +/***
  16 + *
  17 + *
  18 + * 店铺介绍
  19 + */
  20 +
  21 +class StoreIntroducePage extends StatefulWidget {
  22 + StoreIntroducePage({Key key}) : super(key: key);
  23 +
  24 + @override
  25 + _StoreIntroducePageState createState() => _StoreIntroducePageState();
  26 +}
  27 +
  28 +class _StoreIntroducePageState extends State<StoreIntroducePage> {
  29 + int currIndex = 0; //样式按钮默认选中第一个
  30 +
  31 + String sellername; //店铺名称
  32 +
  33 + TextEditingController storeIntroduceC = TextEditingController();
  34 + FocusNode storeIntroduceNode = FocusNode();
  35 +
  36 + @override
  37 + void initState() {
  38 + super.initState();
  39 +
  40 + WidgetsBinding.instance.addPostFrameCallback((_) async {
  41 + UserModel userModel = Provider.of<UserModel>(context, listen: false);
  42 + sellername = userModel.user.sellername;
  43 + setState(() {});
  44 + });
  45 + }
  46 +
  47 + ///图文合并,图文分开,无文字
  48 + Widget _selectBtnWidget() {
  49 + return Container(
  50 + decoration: BoxDecoration(
  51 + border: Border(
  52 + bottom:
  53 + BorderSide(color: MyColours.color_E7E7E7, width: w(0.5)))),
  54 + margin: EdgeInsets.only(left: w(16)),
  55 + padding: EdgeInsets.only(top: w(12), bottom: w(12), right: w(16)),
  56 + child: Row(
  57 + mainAxisAlignment: MainAxisAlignment.spaceBetween,
  58 + children: [
  59 + Text(
  60 + '附加餐厅介绍',
  61 + style: TextStyle(
  62 + color: MyColours.color_515151,
  63 + fontSize: ScreenUtil().setWidth(32)),
  64 + ),
  65 + Container(
  66 + height: ScreenUtil().setWidth(74),
  67 + decoration: BoxDecoration(
  68 + color: Color.fromRGBO(232, 232, 232, 1),
  69 + borderRadius: BorderRadius.circular(
  70 + r(11),
  71 + ),
  72 + // border: Border.all(
  73 + // width: w(1), color: MyColours.color_438E93),
  74 + ),
  75 + child: Row(
  76 + // mainAxisAlignment: MainAxisAlignment.spaceEvenly,
  77 + // crossAxisAlignment: CrossAxisAlignment.center,
  78 + children: <Widget>[
  79 + CommonButtonFlat(
  80 + content: "无文字",
  81 + state: currIndex == 0 ? 1 : 0,
  82 + fontSize: 28,
  83 + right: false,
  84 + width: w(52),
  85 + onPress: () {
  86 + if (currIndex == 0) return;
  87 + setState(() {
  88 + currIndex = 0;
  89 + });
  90 + },
  91 + ),
  92 + currIndex == 2
  93 + ? MyDivider(
  94 + ScreenUtil().setWidth(4),
  95 + ScreenUtil().setWidth(46),
  96 + color: MyColours.color_dfdfdf,
  97 + )
  98 + : SizedBox(),
  99 + CommonButtonFlat(
  100 + content: "图文合并",
  101 + state: currIndex == 1 ? 1 : 0,
  102 + fontSize: 28,
  103 + width: w(66),
  104 + left: false,
  105 + right: false,
  106 + onPress: () {
  107 + if (currIndex == 1) return;
  108 + setState(() {
  109 + currIndex = 1;
  110 + });
  111 + },
  112 + ),
  113 + currIndex == 0
  114 + ? MyDivider(
  115 + ScreenUtil().setWidth(4),
  116 + ScreenUtil().setWidth(46),
  117 + color: MyColours.color_dfdfdf,
  118 + )
  119 + : SizedBox(),
  120 + Container(
  121 + child: CommonButtonFlat(
  122 + content: "图文分开",
  123 + left: false,
  124 + state: currIndex == 2 ? 1 : 0,
  125 + fontSize: 28,
  126 + width: w(66),
  127 + onPress: () {
  128 + if (currIndex == 2) return;
  129 + setState(() {
  130 + currIndex = 2;
  131 + });
  132 + },
  133 + )),
  134 + ],
  135 + ),
  136 + ),
  137 + ],
  138 + ));
  139 + }
  140 +
  141 + Widget _introduceWidget() {
  142 + return Container(
  143 + alignment: Alignment.centerLeft,
  144 + padding: EdgeInsets.all(w(15)),
  145 + child: Column(
  146 + crossAxisAlignment: CrossAxisAlignment.start,
  147 + children: [
  148 + Text(
  149 + 'Introduce',
  150 + style: TextStyle(color: MyColours.color_B39437, fontSize: font(14)),
  151 + ),
  152 + Text(
  153 + '品牌介绍',
  154 + style: TextStyle(color: MyColours.color_B39437, fontSize: font(14)),
  155 + ),
  156 + VEmptyView(16),
  157 + Text(
  158 + '${sellername}',
  159 + style: TextStyle(color: MyColours.color_515151, fontSize: font(14)),
  160 + ),
  161 + VEmptyView(32),
  162 + Container(
  163 + width: double.infinity,
  164 + margin: EdgeInsets.symmetric(horizontal: w(10)),
  165 + padding: EdgeInsets.symmetric(horizontal: w(8)),
  166 + decoration: BoxDecoration(
  167 + border: Border(
  168 + left: BorderSide(
  169 + width: w(2), color: MyColours.color_EEAE74))),
  170 + child: Container(
  171 + width: double.infinity,
  172 + padding: EdgeInsets.symmetric(
  173 + horizontal: ScreenUtil().setWidth(12),
  174 + ),
  175 + alignment: Alignment.topLeft,
  176 + child: TextField(
  177 + textAlign: TextAlign.left,
  178 + controller: storeIntroduceC,
  179 + focusNode: storeIntroduceNode,
  180 + style: TextStyle(
  181 + height: 2,
  182 + color: MyColours.color_515151,
  183 + fontSize: ScreenUtil().setSp(20),
  184 + textBaseline: TextBaseline.alphabetic),
  185 + textAlignVertical: TextAlignVertical.center,
  186 + maxLines: 7,
  187 + decoration: InputDecoration(
  188 + hintText: "点这里录入餐厅介绍文字",
  189 + hintStyle: TextStyle(
  190 + color: MyColours.color_999999,
  191 + fontSize: ScreenUtil().setSp(20),
  192 + ),
  193 + contentPadding: EdgeInsets.zero,
  194 + border: OutlineInputBorder(borderSide: BorderSide.none),
  195 + ),
  196 + keyboardType: TextInputType.text,
  197 + onChanged: (value) {
  198 + setState(() {
  199 + // currentRemark = value ?? "";
  200 + });
  201 + }),
  202 + )),
  203 + ],
  204 + ),
  205 + );
  206 + }
  207 +
  208 + Widget _uploadImage(bool hasupload) {
  209 + return InkWell(
  210 + onTap: () {},
  211 + child: hasupload
  212 + ? InkWell(
  213 + onTap: () {
  214 + print('object');
  215 + },
  216 + child: Stack(alignment: Alignment.bottomCenter, children: [
  217 + Image.network(
  218 + 'https://www.ssfiction.com/wp-content/uploads/2020/08/20200805_5f2b1669e9a24.jpg',
  219 + fit: BoxFit.cover,
  220 + height: w(280),
  221 + ),
  222 + Container(
  223 + height: w(25),
  224 + alignment: Alignment.center,
  225 + child: Text(
  226 + '点击图片可以更换',
  227 + style: TextStyle(
  228 + color: MyColours.color_F8F9FD,
  229 + fontSize: font(14),
  230 + fontWeight: FontWeight.bold),
  231 + )),
  232 + ]))
  233 + : Container(
  234 + color: MyColours.color_d9d9d9,
  235 + width: double.infinity,
  236 + height: w(280),
  237 + child: Column(
  238 + children: [
  239 + VEmptyView(80),
  240 + Image.asset(
  241 + Utils.getImgPath('add_img'),
  242 + width: w(63),
  243 + ),
  244 + VEmptyView(28),
  245 + Container(
  246 + width: w(139),
  247 + height: w(60),
  248 + child: Text(
  249 + '点击上传照片\n为了更好的效果\n建议上传4:3照片',
  250 + textAlign: TextAlign.center,
  251 + style: TextStyle(
  252 + height: 1.4,
  253 + color: MyColours.color_ffffff,
  254 + fontSize: font(14),
  255 + fontWeight: FontWeight.bold),
  256 + ))
  257 + ],
  258 + ),
  259 + ));
  260 + }
  261 +
  262 + @override
  263 + Widget build(BuildContext context) {
  264 + return Scaffold(
  265 + backgroundColor: MyColours.color_ffffff,
  266 + appBar: SystemAppBar(
  267 + '店铺介绍',
  268 + onTap: () {
  269 + Navigator.pop(context);
  270 + },
  271 + ),
  272 + body: Column(
  273 + children: [
  274 + Expanded(
  275 + child: SingleChildScrollView(
  276 + child: Column(
  277 + children: [
  278 + _selectBtnWidget(),
  279 + VEmptyView(24),
  280 + Container(
  281 + alignment: Alignment.centerLeft,
  282 + padding: EdgeInsets.only(left: w(16)),
  283 + height: w(48),
  284 + child: Text(
  285 + '效果预览',
  286 + style: TextStyle(
  287 + fontSize: font(16), color: MyColours.color_515151),
  288 + ),
  289 + ),
  290 + VEmptyView(24),
  291 + _introduceWidget(),
  292 + VEmptyView(18),
  293 + _uploadImage(false),
  294 + VEmptyView(18),
  295 + _uploadImage(true),
  296 + VEmptyView(18),
  297 + _uploadImage(false),
  298 + VEmptyView(18),
  299 + _uploadImage(true),
  300 + VEmptyView(18),
  301 + ],
  302 + ),
  303 + )),
  304 + Container(
  305 + color: MyColours.color_ffffff,
  306 + padding: EdgeInsets.only(
  307 + left: w(45), right: w(45), top: w(12), bottom: w(25)),
  308 + child: RoundButton(
  309 + text: '保存',
  310 + gradientStart: MyColours.color_199095,
  311 + gradientEnd: MyColours.color_199095,
  312 + // borderColor: MyColours.color_999999,
  313 + radius: r(5),
  314 + fontSize: 34,
  315 + height: w(40),
  316 + isBold: true,
  317 + onPressed: () {},
  318 + ),
  319 + )
  320 + ],
  321 + ));
  322 + }
  323 +}
@@ -149,7 +149,9 @@ class _MarketingCenterHomePageState extends State<MarketingCenterHomePage> { @@ -149,7 +149,9 @@ class _MarketingCenterHomePageState extends State<MarketingCenterHomePage> {
149 _item('预订信息模块', onTap: () { 149 _item('预订信息模块', onTap: () {
150 NavigatorUtil.goBookInfoPage(context); 150 NavigatorUtil.goBookInfoPage(context);
151 }), 151 }),
152 - _item('店铺介绍展示', onTap: () {}), 152 + _item('店铺介绍展示', onTap: () {
  153 + NavigatorUtil.goStoreIntroducePage(context);
  154 + }),
153 _item('主厨介绍展示', onTap: () {}), 155 _item('主厨介绍展示', onTap: () {}),
154 _item('招牌菜展示', onTap: () {}), 156 _item('招牌菜展示', onTap: () {}),
155 _item('营销及客户互动功能', onTap: () {}), 157 _item('营销及客户互动功能', onTap: () {}),
1 import 'package:flutter/material.dart'; 1 import 'package:flutter/material.dart';
2 2
3 class MyColours { 3 class MyColours {
  4 + static const Color color_B39437 = Color(0xFFB39437);
4 static const Color color_EEAE74 = Color(0xFFEEAE74); 5 static const Color color_EEAE74 = Color(0xFFEEAE74);
5 static const Color color_C76216 = Color(0xFFC76216); 6 static const Color color_C76216 = Color(0xFFC76216);
6 static const Color color_0C0F0E = Color(0xFF0C0F0E); 7 static const Color color_0C0F0E = Color(0xFF0C0F0E);
@@ -1410,4 +1410,13 @@ class NavigatorUtil { @@ -1410,4 +1410,13 @@ class NavigatorUtil {
1410 }) { 1410 }) {
1411 return _navigateTo(context, "${Routes.book_info_page}", replace: replace); 1411 return _navigateTo(context, "${Routes.book_info_page}", replace: replace);
1412 } 1412 }
  1413 +
  1414 + ///预订安排通知定制------店铺介绍
  1415 + static Future<dynamic> goStoreIntroducePage(
  1416 + BuildContext context, {
  1417 + replace = false,
  1418 + }) {
  1419 + return _navigateTo(context, "${Routes.store_introduce_page}",
  1420 + replace: replace);
  1421 + }
1413 } 1422 }
@@ -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/first_image_page.dart'; 181 import '../pages/my/marketing_center/book_notification/first_image_page.dart';
  182 +import '../pages/my/marketing_center/book_notification/store_introduce_page.dart';
182 import '../pages/my/marketing_center/marketing_center_home_page.dart'; 183 import '../pages/my/marketing_center/marketing_center_home_page.dart';
183 import '../pages/my/plan_dish/final_plan_dish_page.dart'; 184 import '../pages/my/plan_dish/final_plan_dish_page.dart';
184 import '../pages/my/plan_dish/my_plan_dish_home_page.dart'; 185 import '../pages/my/plan_dish/my_plan_dish_home_page.dart';
@@ -2318,3 +2319,13 @@ var bookInfoPageHandle = new Handler( @@ -2318,3 +2319,13 @@ var bookInfoPageHandle = new Handler(
2318 child: ChangeNotifierProvider<StoreBaseIndoProvider>( 2319 child: ChangeNotifierProvider<StoreBaseIndoProvider>(
2319 create: (_) => StoreBaseIndoProvider(), child: BookInfoPage()))); 2320 create: (_) => StoreBaseIndoProvider(), child: BookInfoPage())));
2320 }); 2321 });
  2322 +
  2323 +//我的----营销中心-店铺介绍
  2324 +var storeIntroducePageHandle = new Handler(
  2325 + handlerFunc: (BuildContext context, Map<dynamic, List<Object>> params) {
  2326 + // String idstr = params["idstr"].first;
  2327 + // NotebookDetail detailEntity = NotebookDetail.fromJson(json
  2328 + // .decode(FluroConvertUtils.fluroCnParamsDecode(params["detail"].first)));
  2329 + return ChangeNotifierProvider<MarketingCenterProvider>(
  2330 + create: (_) => MarketingCenterProvider(), child: StoreIntroducePage());
  2331 +});
@@ -193,6 +193,8 @@ class Routes { @@ -193,6 +193,8 @@ class Routes {
193 "/marketing_center_home_page"; //我的---营销中心 193 "/marketing_center_home_page"; //我的---营销中心
194 static String first_image_page = "/first_image_page"; //预订安排通知定制------首图形象展示 194 static String first_image_page = "/first_image_page"; //预订安排通知定制------首图形象展示
195 static String book_info_page = "/book_info_page"; //预订安排通知定制------预订信息展示 195 static String book_info_page = "/book_info_page"; //预订安排通知定制------预订信息展示
  196 + static String store_introduce_page =
  197 + "/store_introduce_page"; //预订安排通知定制------店铺介绍
196 198
197 static void configureRoutes(FluroRouter router) { 199 static void configureRoutes(FluroRouter router) {
198 router.notFoundHandler = new Handler( 200 router.notFoundHandler = new Handler(
@@ -381,5 +383,6 @@ class Routes { @@ -381,5 +383,6 @@ class Routes {
381 router.define(first_image_page, handler: firstImagePageHandle); 383 router.define(first_image_page, handler: firstImagePageHandle);
382 384
383 router.define(book_info_page, handler: bookInfoPageHandle); 385 router.define(book_info_page, handler: bookInfoPageHandle);
  386 + router.define(store_introduce_page, handler: storeIntroducePageHandle);
384 } 387 }
385 } 388 }
@@ -94,6 +94,52 @@ class CommonButtonFlat extends StatelessWidget { @@ -94,6 +94,52 @@ class CommonButtonFlat extends StatelessWidget {
94 )); 94 ));
95 fontColor = MyColours.color_fefefe; 95 fontColor = MyColours.color_fefefe;
96 break; 96 break;
  97 + case 10:
  98 + boxDecoration = BoxDecoration(
  99 + color: MyColours.color_ffffff,
  100 + // gradient: LinearGradient(
  101 + // colors: [Color(0xff199095), Color(0xff36C3C7)],
  102 + // begin: Alignment.topCenter,
  103 + // end: Alignment.bottomCenter),
  104 + borderRadius: BorderRadius.only(
  105 + topLeft: left
  106 + ? Radius.circular(ScreenUtil().setWidth(20))
  107 + : Radius.circular(0),
  108 + bottomLeft: left
  109 + ? Radius.circular(ScreenUtil().setWidth(20))
  110 + : Radius.circular(0),
  111 + topRight: right
  112 + ? Radius.circular(ScreenUtil().setWidth(20))
  113 + : Radius.circular(0),
  114 + bottomRight: right
  115 + ? Radius.circular(ScreenUtil().setWidth(20))
  116 + : Radius.circular(0),
  117 + ));
  118 + fontColor = MyColours.color_999999;
  119 + break;
  120 + case 11:
  121 + boxDecoration = BoxDecoration(
  122 + color: MyColours.color_199095,
  123 + // gradient: LinearGradient(
  124 + // colors: [Color(0xff199095), Color(0xff36C3C7)],
  125 + // begin: Alignment.topCenter,
  126 + // end: Alignment.bottomCenter),
  127 + borderRadius: BorderRadius.only(
  128 + topLeft: left
  129 + ? Radius.circular(ScreenUtil().setWidth(20))
  130 + : Radius.circular(0),
  131 + bottomLeft: left
  132 + ? Radius.circular(ScreenUtil().setWidth(20))
  133 + : Radius.circular(0),
  134 + topRight: right
  135 + ? Radius.circular(ScreenUtil().setWidth(20))
  136 + : Radius.circular(0),
  137 + bottomRight: right
  138 + ? Radius.circular(ScreenUtil().setWidth(20))
  139 + : Radius.circular(0),
  140 + ));
  141 + fontColor = MyColours.color_ffffff;
  142 + break;
97 // case 2: 143 // case 2:
98 // boxDecoration = BoxDecoration( 144 // boxDecoration = BoxDecoration(
99 // color: MyColours.color_199095, 145 // color: MyColours.color_199095,