|
...
|
...
|
@@ -4,6 +4,7 @@ import 'package:one_key/widgets/system_app_bar.dart'; |
|
|
|
import 'package:one_key/widgets/v_empty_view.dart';
|
|
|
|
import 'package:provider/provider.dart';
|
|
|
|
|
|
|
|
import '../../../constant/state.dart';
|
|
|
|
import '../../../provider/marketing_center_provider.dart';
|
|
|
|
import '../../../provider/user_model.dart';
|
|
|
|
import '../../../res/colors.dart';
|
|
...
|
...
|
@@ -13,6 +14,7 @@ import '../../../utils/screen_util.dart'; |
|
|
|
import '../../../utils/utils.dart';
|
|
|
|
import '../../../widgets/MyDivider.dart';
|
|
|
|
import '../../../widgets/h_empty_view.dart';
|
|
|
|
import '../../../widgets/page_exception.dart';
|
|
|
|
import '../../../widgets/round_button.dart';
|
|
|
|
import '../../online_check/photo_view_wiget.dart';
|
|
|
|
|
|
...
|
...
|
@@ -68,8 +70,19 @@ class _CustomerNoticeSettingPageState extends State<CustomerNoticeSettingPage> { |
|
|
|
cancelSms = marketingCenterProvider.dzSellerConfModel.isOpenCancel == '1'
|
|
|
|
? true
|
|
|
|
: false;
|
|
|
|
setState(() {});
|
|
|
|
|
|
|
|
noticeSms = marketingCenterProvider.dzSellerConfModel.isNotice == '1'
|
|
|
|
? true
|
|
|
|
: false;
|
|
|
|
marketingSms =
|
|
|
|
marketingCenterProvider.dzSellerConfModel.isMarketing == '1'
|
|
|
|
? true
|
|
|
|
: false;
|
|
|
|
marketingCenterProvider.pageStateSetting = PageState.Success;
|
|
|
|
} else {
|
|
|
|
marketingCenterProvider.pageStateSetting = PageState.ConnectivityError;
|
|
|
|
}
|
|
|
|
setState(() {});
|
|
|
|
}
|
|
|
|
|
|
|
|
_getThemeData() async {
|
|
...
|
...
|
@@ -137,6 +150,8 @@ class _CustomerNoticeSettingPageState extends State<CustomerNoticeSettingPage> { |
|
|
|
_setData() async {
|
|
|
|
Future.wait<bool>([
|
|
|
|
_setCancelSMS(),
|
|
|
|
_setNotice(),
|
|
|
|
_setMarketing(),
|
|
|
|
_setNewType(),
|
|
|
|
]).then((results) {
|
|
|
|
print(results[0]);
|
|
...
|
...
|
@@ -149,7 +164,7 @@ class _CustomerNoticeSettingPageState extends State<CustomerNoticeSettingPage> { |
|
|
|
});
|
|
|
|
}
|
|
|
|
|
|
|
|
///启用预订安排通知图文模式
|
|
|
|
///客户取消预订时自动发送通知短信
|
|
|
|
Future<bool> _setCancelSMS({bool isShowLoading = true}) async {
|
|
|
|
Map<String, String> params = {
|
|
|
|
'sid': Provider.of<UserModel>(context, listen: false).user.sellerid,
|
|
...
|
...
|
@@ -167,6 +182,42 @@ class _CustomerNoticeSettingPageState extends State<CustomerNoticeSettingPage> { |
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
///使用店铺手机发送通知短信
|
|
|
|
Future<bool> _setNotice({bool isShowLoading = true}) async {
|
|
|
|
Map<String, String> params = {
|
|
|
|
'sid': Provider.of<UserModel>(context, listen: false).user.sellerid,
|
|
|
|
'key': 'is_seller_notice',
|
|
|
|
'value': noticeSms ? '1' : '0'
|
|
|
|
};
|
|
|
|
|
|
|
|
bool success = await marketingCenterProvider.setConfing(context, params,
|
|
|
|
needToast: false);
|
|
|
|
|
|
|
|
if (success) {
|
|
|
|
return true;
|
|
|
|
} else {
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
///使用店铺手机发送营销短信
|
|
|
|
Future<bool> _setMarketing({bool isShowLoading = true}) async {
|
|
|
|
Map<String, String> params = {
|
|
|
|
'sid': Provider.of<UserModel>(context, listen: false).user.sellerid,
|
|
|
|
'key': 'is_seller_marketing',
|
|
|
|
'value': marketingSms ? '1' : '0'
|
|
|
|
};
|
|
|
|
|
|
|
|
bool success = await marketingCenterProvider.setConfing(context, params,
|
|
|
|
needToast: false);
|
|
|
|
|
|
|
|
if (success) {
|
|
|
|
return true;
|
|
|
|
} else {
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
///启用预订安排通知图文模式
|
|
|
|
Future<bool> _setNewType({bool isShowLoading = true}) async {
|
|
|
|
Map<String, String> params = {
|
|
...
|
...
|
@@ -278,15 +329,12 @@ class _CustomerNoticeSettingPageState extends State<CustomerNoticeSettingPage> { |
|
|
|
)));
|
|
|
|
}
|
|
|
|
|
|
|
|
Widget _itemSmsWidget(bool isSelect, String title) {
|
|
|
|
Widget _itemSmsWidget(bool isSelect, String title,
|
|
|
|
{GestureTapCallback onTap}) {
|
|
|
|
return Column(
|
|
|
|
children: [
|
|
|
|
InkWell(
|
|
|
|
onTap: () {
|
|
|
|
setState(() {
|
|
|
|
isSelect = !isSelect;
|
|
|
|
});
|
|
|
|
},
|
|
|
|
onTap: onTap,
|
|
|
|
child: Padding(
|
|
|
|
padding: EdgeInsets.only(
|
|
|
|
left: w(16), top: w(14), bottom: w(3), right: w(12)),
|
|
...
|
...
|
@@ -300,7 +348,7 @@ class _CustomerNoticeSettingPageState extends State<CustomerNoticeSettingPage> { |
|
|
|
),
|
|
|
|
Spacer(),
|
|
|
|
Container(
|
|
|
|
padding: EdgeInsets.symmetric(
|
|
|
|
margin: EdgeInsets.symmetric(
|
|
|
|
horizontal: w(7), vertical: w(4)),
|
|
|
|
child: Image.asset(
|
|
|
|
Utils.getImgPath(isSelect ? 'swich_on' : 'swich_off'),
|
|
...
|
...
|
@@ -352,151 +400,182 @@ class _CustomerNoticeSettingPageState extends State<CustomerNoticeSettingPage> { |
|
|
|
marketingCenterProvider =
|
|
|
|
Provider.of<MarketingCenterProvider>(context, listen: true);
|
|
|
|
return Scaffold(
|
|
|
|
backgroundColor: MyColours.color_ffffff,
|
|
|
|
appBar: SystemAppBar('客户通知设置'),
|
|
|
|
body: Column(
|
|
|
|
children: [
|
|
|
|
Expanded(
|
|
|
|
child: SingleChildScrollView(
|
|
|
|
child: Padding(
|
|
|
|
padding: EdgeInsets.only(left: w(16)),
|
|
|
|
child: Column(
|
|
|
|
crossAxisAlignment: CrossAxisAlignment.start,
|
|
|
|
children: [
|
|
|
|
_title('短信通知'),
|
|
|
|
_itemSmsWidget(cancelSms, '客户取消预订时自动发送通知短信'),
|
|
|
|
_itemSmsWidget(noticeSms, '使用店铺手机发送通知短信'),
|
|
|
|
_itemSmsWidget(marketingSms, '使用店铺手机发送营销短信'),
|
|
|
|
VEmptyView(24),
|
|
|
|
|
|
|
|
_title('微信通知'),
|
|
|
|
VEmptyView(24),
|
|
|
|
|
|
|
|
InkWell(
|
|
|
|
onTap: () {
|
|
|
|
NavigatorUtil.goInvitationThemeHomePage(context);
|
|
|
|
},
|
|
|
|
child: Padding(
|
|
|
|
padding: EdgeInsets.only(
|
|
|
|
left: w(16),
|
|
|
|
top: w(14),
|
|
|
|
bottom: w(3),
|
|
|
|
right: w(12)),
|
|
|
|
child: Row(
|
|
|
|
mainAxisAlignment:
|
|
|
|
MainAxisAlignment.spaceBetween,
|
|
|
|
children: [
|
|
|
|
Text(
|
|
|
|
'客户通知主题选择',
|
|
|
|
style: TextStyle(
|
|
|
|
color: MyColours.color_515151,
|
|
|
|
fontSize: font(14)),
|
|
|
|
),
|
|
|
|
HEmptyView(20),
|
|
|
|
|
|
|
|
Expanded(
|
|
|
|
child: Text(
|
|
|
|
themeName,
|
|
|
|
textAlign: TextAlign.right,
|
|
|
|
style: TextStyle(
|
|
|
|
color: MyColours.color_515151,
|
|
|
|
fontSize: font(14)),
|
|
|
|
)),
|
|
|
|
Container(
|
|
|
|
padding: EdgeInsets.symmetric(
|
|
|
|
horizontal: w(11), vertical: w(4)),
|
|
|
|
child: Image.asset(
|
|
|
|
"assets/arrow_right_new.png",
|
|
|
|
width: w(9),
|
|
|
|
height: w(16),
|
|
|
|
),
|
|
|
|
)
|
|
|
|
// 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);
|
|
|
|
// },
|
|
|
|
// ),
|
|
|
|
]))),
|
|
|
|
Padding(
|
|
|
|
padding: EdgeInsets.only(left: w(16),right: w(12)),
|
|
|
|
child: MyDivider(double.infinity, w(0.5),
|
|
|
|
color: MyColours.color_E7E7E7)),
|
|
|
|
// _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);
|
|
|
|
}),
|
|
|
|
],
|
|
|
|
backgroundColor: MyColours.color_ffffff,
|
|
|
|
appBar: SystemAppBar('客户通知设置'),
|
|
|
|
body: Consumer<MarketingCenterProvider>(builder: (context1, model, _) {
|
|
|
|
if (model.pageState != PageState.Success) {
|
|
|
|
return ExceptionPage(
|
|
|
|
pageState: model.pageState,
|
|
|
|
callback: () async {
|
|
|
|
getDzSellerConf();
|
|
|
|
_getThemeData();
|
|
|
|
},
|
|
|
|
emptyMsg: "暂时没有客户通知设置哦",
|
|
|
|
emptyImg: "empty_search",
|
|
|
|
showMsg: "加载中,请稍后...",
|
|
|
|
);
|
|
|
|
} else {
|
|
|
|
return Column(
|
|
|
|
children: [
|
|
|
|
Expanded(
|
|
|
|
child: SingleChildScrollView(
|
|
|
|
child: Padding(
|
|
|
|
padding: EdgeInsets.only(left: w(16)),
|
|
|
|
child: Column(
|
|
|
|
crossAxisAlignment: CrossAxisAlignment.start,
|
|
|
|
children: [
|
|
|
|
_title('短信通知'),
|
|
|
|
_itemSmsWidget(cancelSms, '客户取消预订时自动发送通知短信',
|
|
|
|
onTap: () {
|
|
|
|
setState(() {
|
|
|
|
cancelSms = !cancelSms;
|
|
|
|
});
|
|
|
|
}),
|
|
|
|
_itemSmsWidget(noticeSms, '使用店铺手机发送通知短信', onTap: () {
|
|
|
|
setState(() {
|
|
|
|
noticeSms = !noticeSms;
|
|
|
|
});
|
|
|
|
}),
|
|
|
|
_itemSmsWidget(marketingSms, '使用店铺手机发送营销短信',
|
|
|
|
onTap: () {
|
|
|
|
setState(() {
|
|
|
|
marketingSms = !marketingSms;
|
|
|
|
});
|
|
|
|
}),
|
|
|
|
VEmptyView(24),
|
|
|
|
|
|
|
|
_title('微信通知'),
|
|
|
|
VEmptyView(24),
|
|
|
|
|
|
|
|
InkWell(
|
|
|
|
onTap: () {
|
|
|
|
NavigatorUtil.goInvitationThemeHomePage(
|
|
|
|
context);
|
|
|
|
},
|
|
|
|
child: Padding(
|
|
|
|
padding: EdgeInsets.only(
|
|
|
|
left: w(16),
|
|
|
|
top: w(14),
|
|
|
|
bottom: w(3),
|
|
|
|
right: w(12)),
|
|
|
|
child: Row(
|
|
|
|
mainAxisAlignment:
|
|
|
|
MainAxisAlignment.spaceBetween,
|
|
|
|
children: [
|
|
|
|
Text(
|
|
|
|
'客户通知主题选择',
|
|
|
|
style: TextStyle(
|
|
|
|
color: MyColours.color_515151,
|
|
|
|
fontSize: font(14)),
|
|
|
|
),
|
|
|
|
HEmptyView(20),
|
|
|
|
|
|
|
|
Expanded(
|
|
|
|
child: Text(
|
|
|
|
themeName,
|
|
|
|
textAlign: TextAlign.right,
|
|
|
|
style: TextStyle(
|
|
|
|
color: MyColours.color_515151,
|
|
|
|
fontSize: font(14)),
|
|
|
|
)),
|
|
|
|
Container(
|
|
|
|
padding: EdgeInsets.symmetric(
|
|
|
|
horizontal: w(11),
|
|
|
|
vertical: w(4)),
|
|
|
|
child: Image.asset(
|
|
|
|
"assets/arrow_right_new.png",
|
|
|
|
width: w(9),
|
|
|
|
height: w(16),
|
|
|
|
),
|
|
|
|
)
|
|
|
|
// 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);
|
|
|
|
// },
|
|
|
|
// ),
|
|
|
|
]))),
|
|
|
|
Padding(
|
|
|
|
padding:
|
|
|
|
EdgeInsets.only(left: w(16), right: w(12)),
|
|
|
|
child: MyDivider(double.infinity, w(0.5),
|
|
|
|
color: MyColours.color_E7E7E7)),
|
|
|
|
// _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);
|
|
|
|
// if (previewUrl == '') {
|
|
|
|
// Utils.showToast('暂时没有可预览的图文信息');
|
|
|
|
// return;
|
|
|
|
// }
|
|
|
|
// //
|
|
|
|
// _showPhotoView(context, 0, [previewUrl]);
|
|
|
|
// }),
|
|
|
|
// 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 {
|
|
|
|
//调用接口
|
|
|
|
_setData();
|
|
|
|
}))
|
|
|
|
],
|
|
|
|
))
|
|
|
|
],
|
|
|
|
),
|
|
|
|
);
|
|
|
|
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);
|
|
|
|
// if (previewUrl == '') {
|
|
|
|
// Utils.showToast('暂时没有可预览的图文信息');
|
|
|
|
// return;
|
|
|
|
// }
|
|
|
|
// //
|
|
|
|
// _showPhotoView(context, 0, [previewUrl]);
|
|
|
|
// }),
|
|
|
|
// 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 {
|
|
|
|
//调用接口
|
|
|
|
_setData();
|
|
|
|
}))
|
|
|
|
],
|
|
|
|
))
|
|
|
|
],
|
|
|
|
);
|
|
|
|
}
|
|
|
|
}));
|
|
|
|
}
|
|
|
|
} |
...
|
...
|
|