|
|
|
import 'package:flutter/material.dart';
|
|
|
|
import 'package:flutter_screenutil/flutter_screenutil.dart';
|
|
|
|
import 'package:one_key/utils/utils.dart';
|
|
|
|
import 'package:one_key/widgets/h_empty_view.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 '../../../../widgets/round_button.dart';
|
|
|
|
import '../../../../widgets/system_app_bar.dart';
|
|
|
|
|
|
|
|
/**
|
|
|
|
* 营销及客户互动
|
|
|
|
*/
|
|
|
|
|
|
|
|
class MarkingInteractionPage extends StatefulWidget {
|
|
|
|
MarkingInteractionPage({Key key}) : super(key: key);
|
|
|
|
|
|
|
|
@override
|
|
|
|
_MarkingInteractionPageState createState() => _MarkingInteractionPageState();
|
|
|
|
}
|
|
|
|
|
|
|
|
class _MarkingInteractionPageState extends State<MarkingInteractionPage> {
|
|
|
|
TextEditingController welcomeTextC = TextEditingController(); //欢迎语
|
|
|
|
FocusNode welcomeTextNode = FocusNode(); //
|
|
|
|
@override
|
|
|
|
void initState() {
|
|
|
|
super.initState();
|
|
|
|
}
|
|
|
|
|
|
|
|
///客户互动及店铺推广
|
|
|
|
Widget _storeItemWidget(String title, String content, {bool select = false}) {
|
|
|
|
return Container(
|
|
|
|
margin: EdgeInsets.only(top: w(12), left: w(32)),
|
|
|
|
padding: EdgeInsets.only(bottom: w(16)),
|
|
|
|
decoration: BoxDecoration(
|
|
|
|
border: Border(
|
|
|
|
bottom:
|
|
|
|
BorderSide(width: w(0.5), color: MyColours.color_E7E7E7))),
|
|
|
|
child: Column(
|
|
|
|
children: [
|
|
|
|
Row(
|
|
|
|
children: [
|
|
|
|
Image.asset(
|
|
|
|
Utils.getImgPath(select ? 'f_select' : 'f_select_not'),
|
|
|
|
width: w(20),
|
|
|
|
),
|
|
|
|
HEmptyView(20),
|
|
|
|
Text(
|
|
|
|
title,
|
|
|
|
style: TextStyle(
|
|
|
|
fontSize: font(14), color: MyColours.color_515151),
|
|
|
|
)
|
|
|
|
],
|
|
|
|
),
|
|
|
|
VEmptyView(20),
|
|
|
|
Padding(
|
|
|
|
padding: EdgeInsets.symmetric(horizontal: w(16)),
|
|
|
|
child: Text(
|
|
|
|
content,
|
|
|
|
style: TextStyle(
|
|
|
|
height: 1.5,
|
|
|
|
fontSize: font(14),
|
|
|
|
color: MyColours.color_515151),
|
|
|
|
),
|
|
|
|
)
|
|
|
|
],
|
|
|
|
),
|
|
|
|
);
|
|
|
|
}
|
|
|
|
|
|
|
|
///标题
|
|
|
|
Widget _headItem(String title) {
|
|
|
|
return Container(
|
|
|
|
width: double.infinity,
|
|
|
|
alignment: Alignment.centerLeft,
|
|
|
|
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: Text(
|
|
|
|
title,
|
|
|
|
style: TextStyle(
|
|
|
|
color: MyColours.color_515151, fontSize: ScreenUtil().setWidth(32)),
|
|
|
|
),
|
|
|
|
);
|
|
|
|
}
|
|
|
|
|
|
|
|
///营销推广
|
|
|
|
Widget _markingItem(String selectTitle, String title, String content,
|
|
|
|
String subtile, String discount,
|
|
|
|
{VoidCallback onPressed, bool select = false}) {
|
|
|
|
return Container(
|
|
|
|
margin: EdgeInsets.only(left: w(21), top: w(12), right: w(21)),
|
|
|
|
child: Column(
|
|
|
|
children: [
|
|
|
|
Row(
|
|
|
|
children: [
|
|
|
|
Image.asset(
|
|
|
|
Utils.getImgPath(select ? 'f_select' : 'f_select_not'),
|
|
|
|
width: w(20),
|
|
|
|
),
|
|
|
|
HEmptyView(20),
|
|
|
|
Text(
|
|
|
|
selectTitle,
|
|
|
|
style: TextStyle(
|
|
|
|
fontSize: font(14), color: MyColours.color_515151),
|
|
|
|
)
|
|
|
|
],
|
|
|
|
),
|
|
|
|
VEmptyView(20),
|
|
|
|
Container(
|
|
|
|
padding: EdgeInsets.all(w(12)),
|
|
|
|
decoration: BoxDecoration(
|
|
|
|
borderRadius: BorderRadiusDirectional.circular(r(8)),
|
|
|
|
border: Border.all(width: w(1), color: MyColours.color_DBDBDB)),
|
|
|
|
child: Row(
|
|
|
|
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
|
|
|
children: [
|
|
|
|
Column(
|
|
|
|
crossAxisAlignment: CrossAxisAlignment.start,
|
|
|
|
children: [
|
|
|
|
Row(
|
|
|
|
children: [
|
|
|
|
Text(
|
|
|
|
title,
|
|
|
|
style: TextStyle(
|
|
|
|
fontSize: font(14),
|
|
|
|
fontWeight: FontWeight.bold,
|
|
|
|
color: MyColours.color_515151),
|
|
|
|
),
|
|
|
|
HEmptyView(20),
|
|
|
|
subtile != ''
|
|
|
|
? Text(
|
|
|
|
'¥${subtile}',
|
|
|
|
style: TextStyle(
|
|
|
|
fontSize: font(7),
|
|
|
|
fontWeight: FontWeight.bold,
|
|
|
|
color: MyColours.color_E34D59),
|
|
|
|
)
|
|
|
|
: SizedBox(),
|
|
|
|
HEmptyView(10),
|
|
|
|
discount != ''
|
|
|
|
? Container(
|
|
|
|
padding: EdgeInsets.symmetric(
|
|
|
|
horizontal: w(3), vertical: w(2)),
|
|
|
|
decoration: BoxDecoration(
|
|
|
|
borderRadius: BorderRadius.circular(r(3)),
|
|
|
|
border: Border.all(
|
|
|
|
width: w(0.5),
|
|
|
|
color: MyColours.color_E34D59)),
|
|
|
|
child: Text(
|
|
|
|
discount,
|
|
|
|
style: TextStyle(
|
|
|
|
color: MyColours.color_E34D59,
|
|
|
|
fontSize: font(7)),
|
|
|
|
),
|
|
|
|
)
|
|
|
|
: SizedBox(),
|
|
|
|
],
|
|
|
|
),
|
|
|
|
VEmptyView(20),
|
|
|
|
Text(
|
|
|
|
content,
|
|
|
|
style: TextStyle(
|
|
|
|
fontSize: font(10),
|
|
|
|
fontWeight: FontWeight.bold,
|
|
|
|
color: MyColours.color_515151),
|
|
|
|
)
|
|
|
|
],
|
|
|
|
),
|
|
|
|
RoundButton(
|
|
|
|
text: '切换活动',
|
|
|
|
width: w(72),
|
|
|
|
height: w(22),
|
|
|
|
gradientStart: MyColours.color_ffffff,
|
|
|
|
gradientEnd: MyColours.color_ffffff,
|
|
|
|
borderColor: MyColours.color_438E93,
|
|
|
|
textColor: MyColours.color_438E93,
|
|
|
|
radius: r(11),
|
|
|
|
fontSize: 24,
|
|
|
|
isBold: true,
|
|
|
|
onPressed: onPressed,
|
|
|
|
)
|
|
|
|
],
|
|
|
|
),
|
|
|
|
)
|
|
|
|
],
|
|
|
|
),
|
|
|
|
);
|
|
|
|
}
|
|
|
|
|
|
|
|
///营销推广
|
|
|
|
Widget _markingOtherItem({VoidCallback onPressed, bool select = false}) {
|
|
|
|
return Container(
|
|
|
|
margin: EdgeInsets.only(left: w(21), top: w(12), right: w(21)),
|
|
|
|
child: Column(children: [
|
|
|
|
Row(
|
|
|
|
children: [
|
|
|
|
Image.asset(
|
|
|
|
Utils.getImgPath(select ? 'f_select' : 'f_select_not'),
|
|
|
|
width: w(20),
|
|
|
|
),
|
|
|
|
HEmptyView(20),
|
|
|
|
Text(
|
|
|
|
'推荐店内充值优惠活动链接',
|
|
|
|
style: TextStyle(
|
|
|
|
fontSize: font(14), color: MyColours.color_515151),
|
|
|
|
)
|
|
|
|
],
|
|
|
|
),
|
|
|
|
VEmptyView(24),
|
|
|
|
Container(
|
|
|
|
height: w(180),
|
|
|
|
child: true
|
|
|
|
? Image.network(
|
|
|
|
'https://www.ssfiction.com/wp-content/uploads/2020/08/20200805_5f2b1669e9a24.jpg',
|
|
|
|
fit: BoxFit.contain,
|
|
|
|
)
|
|
|
|
: Column(
|
|
|
|
mainAxisAlignment: MainAxisAlignment.center,
|
|
|
|
children: [
|
|
|
|
Image.asset(
|
|
|
|
Utils.getImgPath('add_img_grey'),
|
|
|
|
width: w(63),
|
|
|
|
),
|
|
|
|
VEmptyView(28),
|
|
|
|
Padding(
|
|
|
|
padding: EdgeInsets.symmetric(
|
|
|
|
vertical: w(10),
|
|
|
|
),
|
|
|
|
child: Text(
|
|
|
|
'点击上传餐厅logo',
|
|
|
|
style: TextStyle(
|
|
|
|
color: MyColours.color_999999,
|
|
|
|
fontSize: font(14),
|
|
|
|
fontWeight: FontWeight.bold),
|
|
|
|
),
|
|
|
|
)
|
|
|
|
],
|
|
|
|
)),
|
|
|
|
Container(
|
|
|
|
width: double.infinity,
|
|
|
|
alignment: Alignment.center,
|
|
|
|
padding: EdgeInsets.symmetric(
|
|
|
|
horizontal: ScreenUtil().setWidth(40),
|
|
|
|
),
|
|
|
|
child: TextField(
|
|
|
|
controller: welcomeTextC,
|
|
|
|
focusNode: welcomeTextNode,
|
|
|
|
style: TextStyle(
|
|
|
|
color: MyColours.color_000000,
|
|
|
|
fontSize: ScreenUtil().setSp(40),
|
|
|
|
textBaseline: TextBaseline.alphabetic),
|
|
|
|
textAlign: TextAlign.center,
|
|
|
|
maxLines: 1,
|
|
|
|
// maxLength: 38,
|
|
|
|
decoration: InputDecoration(
|
|
|
|
hintText: "点这里输入餐厅欢迎语",
|
|
|
|
hintStyle: TextStyle(
|
|
|
|
color: MyColours.color_000000,
|
|
|
|
fontSize: ScreenUtil().setSp(40),
|
|
|
|
),
|
|
|
|
contentPadding: EdgeInsets.zero,
|
|
|
|
border: OutlineInputBorder(borderSide: BorderSide.none),
|
|
|
|
),
|
|
|
|
keyboardType: TextInputType.text,
|
|
|
|
onChanged: (value) {
|
|
|
|
setState(() {
|
|
|
|
// currentRemark = value ?? "";
|
|
|
|
});
|
|
|
|
}),
|
|
|
|
),
|
|
|
|
VEmptyView(40),
|
|
|
|
Container(
|
|
|
|
width: w(188),
|
|
|
|
height: w(22),
|
|
|
|
alignment: Alignment.center,
|
|
|
|
decoration: BoxDecoration(
|
|
|
|
borderRadius: BorderRadius.circular(r(11)),
|
|
|
|
gradient: LinearGradient(stops: [
|
|
|
|
-0.57,
|
|
|
|
0.55,
|
|
|
|
1.48
|
|
|
|
], colors: [
|
|
|
|
MyColours.color_4C8DAD,
|
|
|
|
MyColours.color_0143A3,
|
|
|
|
MyColours.color_42A5FF
|
|
|
|
], begin: Alignment.centerLeft, end: Alignment.centerRight)),
|
|
|
|
child: RoundButton(
|
|
|
|
width: w(186),
|
|
|
|
height: w(20),
|
|
|
|
text: '点击了解更多会员优惠政策',
|
|
|
|
gradientStart: MyColours.color_ffffff,
|
|
|
|
gradientEnd: MyColours.color_ffffff,
|
|
|
|
borderColor: Colors.transparent,
|
|
|
|
// borderColor: MyColours.color_999999,
|
|
|
|
textColor: MyColours.color_999999,
|
|
|
|
radius: r(11),
|
|
|
|
fontSize: 24,
|
|
|
|
|
|
|
|
isBold: true,
|
|
|
|
onPressed: () {},
|
|
|
|
)),
|
|
|
|
VEmptyView(18),
|
|
|
|
Container(
|
|
|
|
height: w(28),
|
|
|
|
alignment: Alignment.center,
|
|
|
|
child: Text(
|
|
|
|
Provider.of<UserModel>(context, listen: false).user.sellername,
|
|
|
|
style:
|
|
|
|
TextStyle(fontSize: font(14), color: MyColours.color_515151),
|
|
|
|
),
|
|
|
|
),
|
|
|
|
VEmptyView(20)
|
|
|
|
]));
|
|
|
|
}
|
|
|
|
|
|
|
|
@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: [
|
|
|
|
_headItem('客户互动及店铺推广'),
|
|
|
|
_storeItemWidget('允许顾客转发邀请函给同行客人。',
|
|
|
|
'同行客人可以从电子邀请函了解预订信息、一键导航到店,快速联系餐厅服务人员。还可以了解更多餐厅介绍、各种活动。'),
|
|
|
|
_storeItemWidget('向被邀请客人开放“确认到店”功能。',
|
|
|
|
'被邀客人点击确认到店后,方便请客人了解被邀客人是否确认,同时,被邀客人的信息会加入到餐厅客户池中,方便餐厅维护客户。'),
|
|
|
|
_storeItemWidget('向客人开放“在线预订”功能。',
|
|
|
|
'客人和被邀客人可以通过邀请函,直接点击在线预订,向商家提交预订需求,无需通过电话,经理可以详细了解客户需求并安排预订。'),
|
|
|
|
_storeItemWidget('向被邀请客人开放“提前点餐”功能。',
|
|
|
|
'请客人从预定安排直接预先选菜,到店后确认下单,无需服务员花费时间给客户点餐,可以为餐厅节源提效。'),
|
|
|
|
VEmptyView(24),
|
|
|
|
_headItem('预订安排中附带的营销推广'),
|
|
|
|
VEmptyView(24),
|
|
|
|
_markingItem('推荐店内代金券优惠', '200元代金券', '周一到周五可用,消费满600元可用一张。',
|
|
|
|
'100', '5折'),
|
|
|
|
_markingItem(
|
|
|
|
'推荐店内充值单一优惠活动',
|
|
|
|
'充1000赠300',
|
|
|
|
'会员充值满1000元赠余额200元;\n会员充值满1000元赠余额200元;\n会员充值满1000元赠余额200元;',
|
|
|
|
'',
|
|
|
|
''),
|
|
|
|
_markingOtherItem()
|
|
|
|
],
|
|
|
|
),
|
|
|
|
)),
|
|
|
|
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: () {},
|
|
|
|
),
|
|
|
|
)
|
|
|
|
],
|
|
|
|
));
|
|
|
|
}
|
|
|
|
} |
...
|
...
|
|