Commit a8c8efe5846e71b9590047556b0e46eba62ca987

Authored by wdn127929
1 parent ab7ebb3b

设置营销中心----客户通知页面设置选项

... ... @@ -48,6 +48,9 @@ class GetDzSellerConfSunModel {
String isShowPrice;
String isOpenCancel;
String isNotice;
String isMarketing;
GetDzSellerConfSunModel(
{this.id,
this.sid,
... ... @@ -67,7 +70,9 @@ class GetDzSellerConfSunModel {
this.isStoreSms,
this.storeDate,
this.isShowPrice,
this.isOpenCancel});
this.isOpenCancel,
this.isNotice,
this.isMarketing});
GetDzSellerConfSunModel.fromJson(Map<String, dynamic> json) {
id = json['id'];
... ... @@ -91,6 +96,8 @@ class GetDzSellerConfSunModel {
storeDate = json['store_date'];
isShowPrice = json['is_show_price'];
isOpenCancel = json['is_open_cancel_temp'];
isNotice = json['is_seller_notice'];
isMarketing = json['is_seller_marketing'];
}
Map<String, dynamic> toJson() {
... ... @@ -114,6 +121,8 @@ class GetDzSellerConfSunModel {
data['store_date'] = this.storeDate;
data['is_show_price'] = this.isShowPrice;
data['is_open_cancel_temp'] = this.isOpenCancel;
data['is_seller_notice'] = this.isNotice;
data['is_seller_marketing'] = this.isMarketing;
return data;
}
... ...
... ... @@ -96,6 +96,7 @@ class HandleOnlinePageState extends State<HandleOnlinePage> {
});
if (detailEntity.status == "6") {
//已拒绝不跳转
setMessageStatus();
if (refuseDialogState != null) {
refuseDialogState(() {});
}
... ... @@ -363,7 +364,7 @@ class HandleOnlinePageState extends State<HandleOnlinePage> {
"mid": widget.mid,
"cause": json.encode(causeMap),
"uid": userModel.user.openid,
'note_name':userModel.user.account,
'note_name': userModel.user.account,
};
if (status == "6") {
isPause = (ac == "1" ? true : false);
... ... @@ -579,8 +580,8 @@ class HandleOnlinePageState extends State<HandleOnlinePage> {
height: 84,
fontSize: 34,
onPress: () async {
Map map =
await NavigatorUtil.goSelectTableFPage(
Map map = await NavigatorUtil
.goSelectTableFPage(
context,
widget.rid,
int.parse(detailEntity.ddate) *
... ...
... ... @@ -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();
}))
],
))
],
);
}
}));
}
}
... ...
... ... @@ -25,7 +25,7 @@ class MarketingCenterProvider extends ChangeNotifier {
PageState pageStateRechargeHome = PageState.Loading;
PageState pageStateBookInfo = PageState.Loading;
PageState pageStateThemeHome = PageState.Loading;
PageState pageStateSetting = PageState.Loading;
List<RechargeListSunModel> rechargeList = [];
... ... @@ -64,6 +64,7 @@ class MarketingCenterProvider extends ChangeNotifier {
.catchError((error) {
print(error.toString());
Utils.showToast('请求失败,请重试');
return false;
});
if (baseResp.code == Constant.status_success) {
... ...