Commit 54dbe176eb68f24422614f3c7bb5e41c214b3fd3

Authored by wdn127929
1 parent 33a8aff4

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

import 'package:flutter/material.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart';
import 'package:one_key/widgets/v_empty_view.dart';
import 'package:provider/provider.dart';
import '../../../../provider/user_model.dart';
import '../../../../res/colors.dart';
import '../../../../utils/screen_util.dart';
import '../../../../utils/utils.dart';
import '../../../../widgets/MyDivider.dart';
import '../../../../widgets/common_button_flat.dart';
import '../../../../widgets/round_button.dart';
import '../../../../widgets/system_app_bar.dart';
/***
*
*
* 店铺介绍
*/
class StoreIntroducePage extends StatefulWidget {
StoreIntroducePage({Key key}) : super(key: key);
@override
_StoreIntroducePageState createState() => _StoreIntroducePageState();
}
class _StoreIntroducePageState extends State<StoreIntroducePage> {
int currIndex = 0; //样式按钮默认选中第一个
String sellername; //店铺名称
TextEditingController storeIntroduceC = TextEditingController();
FocusNode storeIntroduceNode = FocusNode();
@override
void initState() {
super.initState();
WidgetsBinding.instance.addPostFrameCallback((_) async {
UserModel userModel = Provider.of<UserModel>(context, listen: false);
sellername = userModel.user.sellername;
setState(() {});
});
}
///图文合并,图文分开,无文字
Widget _selectBtnWidget() {
return 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(16)),
child: Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
Text(
'附加餐厅介绍',
style: TextStyle(
color: MyColours.color_515151,
fontSize: ScreenUtil().setWidth(32)),
),
Container(
height: ScreenUtil().setWidth(74),
decoration: BoxDecoration(
color: Color.fromRGBO(232, 232, 232, 1),
borderRadius: BorderRadius.circular(
r(11),
),
// border: Border.all(
// width: w(1), color: MyColours.color_438E93),
),
child: Row(
// mainAxisAlignment: MainAxisAlignment.spaceEvenly,
// crossAxisAlignment: CrossAxisAlignment.center,
children: <Widget>[
CommonButtonFlat(
content: "无文字",
state: currIndex == 0 ? 1 : 0,
fontSize: 28,
right: false,
width: w(52),
onPress: () {
if (currIndex == 0) return;
setState(() {
currIndex = 0;
});
},
),
currIndex == 2
? MyDivider(
ScreenUtil().setWidth(4),
ScreenUtil().setWidth(46),
color: MyColours.color_dfdfdf,
)
: SizedBox(),
CommonButtonFlat(
content: "图文合并",
state: currIndex == 1 ? 1 : 0,
fontSize: 28,
width: w(66),
left: false,
right: false,
onPress: () {
if (currIndex == 1) return;
setState(() {
currIndex = 1;
});
},
),
currIndex == 0
? MyDivider(
ScreenUtil().setWidth(4),
ScreenUtil().setWidth(46),
color: MyColours.color_dfdfdf,
)
: SizedBox(),
Container(
child: CommonButtonFlat(
content: "图文分开",
left: false,
state: currIndex == 2 ? 1 : 0,
fontSize: 28,
width: w(66),
onPress: () {
if (currIndex == 2) return;
setState(() {
currIndex = 2;
});
},
)),
],
),
),
],
));
}
Widget _introduceWidget() {
return Container(
alignment: Alignment.centerLeft,
padding: EdgeInsets.all(w(15)),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Text(
'Introduce',
style: TextStyle(color: MyColours.color_B39437, fontSize: font(14)),
),
Text(
'品牌介绍',
style: TextStyle(color: MyColours.color_B39437, fontSize: font(14)),
),
VEmptyView(16),
Text(
'${sellername}',
style: TextStyle(color: MyColours.color_515151, fontSize: font(14)),
),
VEmptyView(32),
Container(
width: double.infinity,
margin: EdgeInsets.symmetric(horizontal: w(10)),
padding: EdgeInsets.symmetric(horizontal: w(8)),
decoration: BoxDecoration(
border: Border(
left: BorderSide(
width: w(2), color: MyColours.color_EEAE74))),
child: Container(
width: double.infinity,
padding: EdgeInsets.symmetric(
horizontal: ScreenUtil().setWidth(12),
),
alignment: Alignment.topLeft,
child: TextField(
textAlign: TextAlign.left,
controller: storeIntroduceC,
focusNode: storeIntroduceNode,
style: TextStyle(
height: 2,
color: MyColours.color_515151,
fontSize: ScreenUtil().setSp(20),
textBaseline: TextBaseline.alphabetic),
textAlignVertical: TextAlignVertical.center,
maxLines: 7,
decoration: InputDecoration(
hintText: "点这里录入餐厅介绍文字",
hintStyle: TextStyle(
color: MyColours.color_999999,
fontSize: ScreenUtil().setSp(20),
),
contentPadding: EdgeInsets.zero,
border: OutlineInputBorder(borderSide: BorderSide.none),
),
keyboardType: TextInputType.text,
onChanged: (value) {
setState(() {
// currentRemark = value ?? "";
});
}),
)),
],
),
);
}
Widget _uploadImage(bool hasupload) {
return InkWell(
onTap: () {},
child: hasupload
? InkWell(
onTap: () {
print('object');
},
child: Stack(alignment: Alignment.bottomCenter, children: [
Image.network(
'https://www.ssfiction.com/wp-content/uploads/2020/08/20200805_5f2b1669e9a24.jpg',
fit: BoxFit.cover,
height: w(280),
),
Container(
height: w(25),
alignment: Alignment.center,
child: Text(
'点击图片可以更换',
style: TextStyle(
color: MyColours.color_F8F9FD,
fontSize: font(14),
fontWeight: FontWeight.bold),
)),
]))
: Container(
color: MyColours.color_d9d9d9,
width: double.infinity,
height: w(280),
child: Column(
children: [
VEmptyView(80),
Image.asset(
Utils.getImgPath('add_img'),
width: w(63),
),
VEmptyView(28),
Container(
width: w(139),
height: w(60),
child: Text(
'点击上传照片\n为了更好的效果\n建议上传4:3照片',
textAlign: TextAlign.center,
style: TextStyle(
height: 1.4,
color: MyColours.color_ffffff,
fontSize: font(14),
fontWeight: FontWeight.bold),
))
],
),
));
}
@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: [
_selectBtnWidget(),
VEmptyView(24),
Container(
alignment: Alignment.centerLeft,
padding: EdgeInsets.only(left: w(16)),
height: w(48),
child: Text(
'效果预览',
style: TextStyle(
fontSize: font(16), color: MyColours.color_515151),
),
),
VEmptyView(24),
_introduceWidget(),
VEmptyView(18),
_uploadImage(false),
VEmptyView(18),
_uploadImage(true),
VEmptyView(18),
_uploadImage(false),
VEmptyView(18),
_uploadImage(true),
VEmptyView(18),
],
),
)),
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: () {},
),
)
],
));
}
}
... ...
... ... @@ -149,7 +149,9 @@ class _MarketingCenterHomePageState extends State<MarketingCenterHomePage> {
_item('预订信息模块', onTap: () {
NavigatorUtil.goBookInfoPage(context);
}),
_item('店铺介绍展示', onTap: () {}),
_item('店铺介绍展示', onTap: () {
NavigatorUtil.goStoreIntroducePage(context);
}),
_item('主厨介绍展示', onTap: () {}),
_item('招牌菜展示', onTap: () {}),
_item('营销及客户互动功能', onTap: () {}),
... ...
import 'package:flutter/material.dart';
class MyColours {
static const Color color_B39437 = Color(0xFFB39437);
static const Color color_EEAE74 = Color(0xFFEEAE74);
static const Color color_C76216 = Color(0xFFC76216);
static const Color color_0C0F0E = Color(0xFF0C0F0E);
... ...
... ... @@ -1410,4 +1410,13 @@ class NavigatorUtil {
}) {
return _navigateTo(context, "${Routes.book_info_page}", replace: replace);
}
///预订安排通知定制------店铺介绍
static Future<dynamic> goStoreIntroducePage(
BuildContext context, {
replace = false,
}) {
return _navigateTo(context, "${Routes.store_introduce_page}",
replace: replace);
}
}
... ...
... ... @@ -179,6 +179,7 @@ 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/book_info_page.dart';
import '../pages/my/marketing_center/book_notification/first_image_page.dart';
import '../pages/my/marketing_center/book_notification/store_introduce_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';
... ... @@ -2318,3 +2319,13 @@ var bookInfoPageHandle = new Handler(
child: ChangeNotifierProvider<StoreBaseIndoProvider>(
create: (_) => StoreBaseIndoProvider(), child: BookInfoPage())));
});
//我的----营销中心-店铺介绍
var storeIntroducePageHandle = 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: StoreIntroducePage());
});
... ...
... ... @@ -193,6 +193,8 @@ class Routes {
"/marketing_center_home_page"; //我的---营销中心
static String first_image_page = "/first_image_page"; //预订安排通知定制------首图形象展示
static String book_info_page = "/book_info_page"; //预订安排通知定制------预订信息展示
static String store_introduce_page =
"/store_introduce_page"; //预订安排通知定制------店铺介绍
static void configureRoutes(FluroRouter router) {
router.notFoundHandler = new Handler(
... ... @@ -381,5 +383,6 @@ class Routes {
router.define(first_image_page, handler: firstImagePageHandle);
router.define(book_info_page, handler: bookInfoPageHandle);
router.define(store_introduce_page, handler: storeIntroducePageHandle);
}
}
... ...
... ... @@ -94,6 +94,52 @@ class CommonButtonFlat extends StatelessWidget {
));
fontColor = MyColours.color_fefefe;
break;
case 10:
boxDecoration = BoxDecoration(
color: MyColours.color_ffffff,
// gradient: LinearGradient(
// colors: [Color(0xff199095), Color(0xff36C3C7)],
// begin: Alignment.topCenter,
// end: Alignment.bottomCenter),
borderRadius: BorderRadius.only(
topLeft: left
? Radius.circular(ScreenUtil().setWidth(20))
: Radius.circular(0),
bottomLeft: left
? Radius.circular(ScreenUtil().setWidth(20))
: Radius.circular(0),
topRight: right
? Radius.circular(ScreenUtil().setWidth(20))
: Radius.circular(0),
bottomRight: right
? Radius.circular(ScreenUtil().setWidth(20))
: Radius.circular(0),
));
fontColor = MyColours.color_999999;
break;
case 11:
boxDecoration = BoxDecoration(
color: MyColours.color_199095,
// gradient: LinearGradient(
// colors: [Color(0xff199095), Color(0xff36C3C7)],
// begin: Alignment.topCenter,
// end: Alignment.bottomCenter),
borderRadius: BorderRadius.only(
topLeft: left
? Radius.circular(ScreenUtil().setWidth(20))
: Radius.circular(0),
bottomLeft: left
? Radius.circular(ScreenUtil().setWidth(20))
: Radius.circular(0),
topRight: right
? Radius.circular(ScreenUtil().setWidth(20))
: Radius.circular(0),
bottomRight: right
? Radius.circular(ScreenUtil().setWidth(20))
: Radius.circular(0),
));
fontColor = MyColours.color_ffffff;
break;
// case 2:
// boxDecoration = BoxDecoration(
// color: MyColours.color_199095,
... ...