|
...
|
...
|
@@ -2,13 +2,16 @@ 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/h_empty_view.dart';
|
|
|
|
import 'package:one_key/widgets/v_empty_view.dart';
|
|
|
|
import 'package:provider/provider.dart';
|
|
|
|
|
|
|
|
import '../../../provider/marketing_center_provider.dart';
|
|
|
|
import '../../../provider/user_model.dart';
|
|
|
|
import '../../../res/colors.dart';
|
|
|
|
import '../../../utils/event_bus.dart';
|
|
|
|
import '../../../utils/screen_util.dart';
|
|
|
|
import '../../../utils/utils.dart';
|
|
|
|
import '../../../widgets/round_button.dart';
|
|
|
|
import '../../../widgets/system_app_bar.dart';
|
|
|
|
|
|
...
|
...
|
@@ -26,6 +29,26 @@ class MarketingCenterHomePage extends StatefulWidget { |
|
|
|
|
|
|
|
class _MarketingCenterHomePageState extends State<MarketingCenterHomePage> {
|
|
|
|
MarketingCenterProvider marketingCenterProvider;
|
|
|
|
bool select = false;
|
|
|
|
|
|
|
|
@override
|
|
|
|
void initState() {
|
|
|
|
super.initState();
|
|
|
|
|
|
|
|
WidgetsBinding.instance.addPostFrameCallback((_) {
|
|
|
|
getSellerTemplateConf();
|
|
|
|
});
|
|
|
|
}
|
|
|
|
|
|
|
|
getSellerTemplateConf() async {
|
|
|
|
bool success = await marketingCenterProvider.getSellerTemplateConf(context);
|
|
|
|
if (success && marketingCenterProvider.markDataModel != null) {
|
|
|
|
select = marketingCenterProvider.markDataModel.isNewTemplate == '1'
|
|
|
|
? true
|
|
|
|
: false;
|
|
|
|
setState(() {});
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
Widget _item(String title, {GestureTapCallback onTap}) {
|
|
|
|
return InkWell(
|
|
...
|
...
|
@@ -78,93 +101,166 @@ class _MarketingCenterHomePageState extends State<MarketingCenterHomePage> { |
|
|
|
EventBus().emit('changeStatusColor');
|
|
|
|
Navigator.of(context).pop();
|
|
|
|
},
|
|
|
|
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: () {
|
|
|
|
NavigatorUtil.goMarkingPreviewPage(context);
|
|
|
|
},
|
|
|
|
),
|
|
|
|
])),
|
|
|
|
_item('首图形象展示', onTap: () {
|
|
|
|
NavigatorUtil.goFirstImagePage(context);
|
|
|
|
}),
|
|
|
|
_item('预订信息模块', onTap: () {
|
|
|
|
NavigatorUtil.goBookInfoPage(context);
|
|
|
|
}),
|
|
|
|
_item('店铺介绍展示', onTap: () {
|
|
|
|
NavigatorUtil.goStoreIntroducePage(context);
|
|
|
|
}),
|
|
|
|
_item('主厨介绍展示', onTap: () {
|
|
|
|
NavigatorUtil.goChefIntroducePage(context);
|
|
|
|
}),
|
|
|
|
_item('招牌菜展示', onTap: () {
|
|
|
|
NavigatorUtil.goDishShowPage(context);
|
|
|
|
}),
|
|
|
|
_item('营销及客户互动功能', onTap: () {
|
|
|
|
NavigatorUtil.goMarkingInteractionPage(context);
|
|
|
|
}),
|
|
|
|
],
|
|
|
|
),
|
|
|
|
child: Column(
|
|
|
|
children: [
|
|
|
|
Expanded(
|
|
|
|
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),
|
|
|
|
InkWell(
|
|
|
|
onTap: () {
|
|
|
|
setState(() {
|
|
|
|
select = !select;
|
|
|
|
});
|
|
|
|
},
|
|
|
|
child: 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)),
|
|
|
|
),
|
|
|
|
Spacer(),
|
|
|
|
Container(
|
|
|
|
padding: EdgeInsets.symmetric(
|
|
|
|
horizontal: w(7), vertical: w(4)),
|
|
|
|
child: Image.asset(
|
|
|
|
Utils.getImgPath(
|
|
|
|
select ? 'swich_on' : 'swich_off'),
|
|
|
|
width: w(44),
|
|
|
|
),
|
|
|
|
)
|
|
|
|
// 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: () {
|
|
|
|
// NavigatorUtil.goMarkingPreviewPage(context);
|
|
|
|
// },
|
|
|
|
// ),
|
|
|
|
]))),
|
|
|
|
_item('首图形象展示', onTap: () {
|
|
|
|
NavigatorUtil.goFirstImagePage(context);
|
|
|
|
}),
|
|
|
|
_item('预订信息模块', onTap: () {
|
|
|
|
NavigatorUtil.goBookInfoPage(context);
|
|
|
|
}),
|
|
|
|
_item('店铺介绍展示', onTap: () {
|
|
|
|
NavigatorUtil.goStoreIntroducePage(context);
|
|
|
|
}),
|
|
|
|
_item('主厨介绍展示', onTap: () {
|
|
|
|
NavigatorUtil.goChefIntroducePage(context);
|
|
|
|
}),
|
|
|
|
_item('招牌菜展示', onTap: () {
|
|
|
|
NavigatorUtil.goDishShowPage(context);
|
|
|
|
}),
|
|
|
|
_item('营销及客户互动功能', onTap: () {
|
|
|
|
NavigatorUtil.goMarkingInteractionPage(context);
|
|
|
|
}),
|
|
|
|
],
|
|
|
|
),
|
|
|
|
)),
|
|
|
|
Container(
|
|
|
|
color: MyColours.color_ffffff,
|
|
|
|
padding: EdgeInsets.only(
|
|
|
|
left: w(23), right: w(23), top: w(12), bottom: w(25)),
|
|
|
|
child: Row(
|
|
|
|
children: [
|
|
|
|
RoundButton(
|
|
|
|
text: '图文预览',
|
|
|
|
width: w(100),
|
|
|
|
gradientStart: MyColours.color_ffffff,
|
|
|
|
gradientEnd: MyColours.color_ffffff,
|
|
|
|
borderColor: MyColours.color_438E93,
|
|
|
|
radius: r(5),
|
|
|
|
fontSize: 32,
|
|
|
|
height: w(40),
|
|
|
|
textColor: MyColours.color_438E93,
|
|
|
|
isBold: true,
|
|
|
|
onPressed: () async {
|
|
|
|
NavigatorUtil.goMarkingPreviewPage(context);
|
|
|
|
}),
|
|
|
|
HEmptyView(30),
|
|
|
|
Expanded(
|
|
|
|
child: RoundButton(
|
|
|
|
text: '保存',
|
|
|
|
gradientStart: MyColours.color_199095,
|
|
|
|
gradientEnd: MyColours.color_199095,
|
|
|
|
// borderColor: MyColours.color_999999,
|
|
|
|
radius: r(5),
|
|
|
|
fontSize: 32,
|
|
|
|
height: w(40),
|
|
|
|
isBold: true,
|
|
|
|
onPressed: () async {
|
|
|
|
//调用接口
|
|
|
|
Map<String, String> params = {
|
|
|
|
'sid': Provider.of<UserModel>(context,
|
|
|
|
listen: false)
|
|
|
|
.user
|
|
|
|
.sellerid,
|
|
|
|
'key': 'is_new_template',
|
|
|
|
'value': select ? '1' : '0'
|
|
|
|
};
|
|
|
|
|
|
|
|
bool success = await marketingCenterProvider
|
|
|
|
.setConfing(context, params);
|
|
|
|
if (success) {}
|
|
|
|
}))
|
|
|
|
],
|
|
|
|
))
|
|
|
|
],
|
|
|
|
)));
|
|
|
|
}
|
|
|
|
} |
...
|
...
|
|