Showing
7 changed files
with
834 additions
and
239 deletions
| @@ -46,6 +46,7 @@ class GetDzSellerConfSunModel { | @@ -46,6 +46,7 @@ class GetDzSellerConfSunModel { | ||
| 46 | String storeDate; | 46 | String storeDate; |
| 47 | 47 | ||
| 48 | String isShowPrice; | 48 | String isShowPrice; |
| 49 | + String isOpenCancel; | ||
| 49 | 50 | ||
| 50 | GetDzSellerConfSunModel( | 51 | GetDzSellerConfSunModel( |
| 51 | {this.id, | 52 | {this.id, |
| @@ -65,7 +66,8 @@ class GetDzSellerConfSunModel { | @@ -65,7 +66,8 @@ class GetDzSellerConfSunModel { | ||
| 65 | this.cdate, | 66 | this.cdate, |
| 66 | this.isStoreSms, | 67 | this.isStoreSms, |
| 67 | this.storeDate, | 68 | this.storeDate, |
| 68 | - this.isShowPrice}); | 69 | + this.isShowPrice, |
| 70 | + this.isOpenCancel}); | ||
| 69 | 71 | ||
| 70 | GetDzSellerConfSunModel.fromJson(Map<String, dynamic> json) { | 72 | GetDzSellerConfSunModel.fromJson(Map<String, dynamic> json) { |
| 71 | id = json['id']; | 73 | id = json['id']; |
| @@ -88,6 +90,7 @@ class GetDzSellerConfSunModel { | @@ -88,6 +90,7 @@ class GetDzSellerConfSunModel { | ||
| 88 | isStoreSms = json['is_store_sms']; | 90 | isStoreSms = json['is_store_sms']; |
| 89 | storeDate = json['store_date']; | 91 | storeDate = json['store_date']; |
| 90 | isShowPrice = json['is_show_price']; | 92 | isShowPrice = json['is_show_price']; |
| 93 | + isOpenCancel = json['is_open_cancel_temp']; | ||
| 91 | } | 94 | } |
| 92 | 95 | ||
| 93 | Map<String, dynamic> toJson() { | 96 | Map<String, dynamic> toJson() { |
| @@ -110,6 +113,8 @@ class GetDzSellerConfSunModel { | @@ -110,6 +113,8 @@ class GetDzSellerConfSunModel { | ||
| 110 | data['is_store_sms'] = this.isStoreSms; | 113 | data['is_store_sms'] = this.isStoreSms; |
| 111 | data['store_date'] = this.storeDate; | 114 | data['store_date'] = this.storeDate; |
| 112 | data['is_show_price'] = this.isShowPrice; | 115 | data['is_show_price'] = this.isShowPrice; |
| 116 | + data['is_open_cancel_temp'] = this.isOpenCancel; | ||
| 117 | + | ||
| 113 | return data; | 118 | return data; |
| 114 | } | 119 | } |
| 115 | } | 120 | } |
| 1 | +import 'package:flutter/material.dart'; | ||
| 2 | +import 'package:one_key/widgets/system_app_bar.dart'; | ||
| 3 | +import 'package:provider/provider.dart'; | ||
| 4 | + | ||
| 5 | +import '../../../provider/marketing_center_provider.dart'; | ||
| 6 | +import '../../../provider/user_model.dart'; | ||
| 7 | +import '../../../res/colors.dart'; | ||
| 8 | +import '../../../route/navigator_util.dart'; | ||
| 9 | +import '../../../utils/screen_util.dart'; | ||
| 10 | +import '../../../utils/utils.dart'; | ||
| 11 | +import '../../../widgets/MyDivider.dart'; | ||
| 12 | +import '../../../widgets/h_empty_view.dart'; | ||
| 13 | +import '../../../widgets/round_button.dart'; | ||
| 14 | + | ||
| 15 | +/** | ||
| 16 | + * 客户通知设置 | ||
| 17 | + */ | ||
| 18 | +class CustomerNoticeSettingPage extends StatefulWidget { | ||
| 19 | + CustomerNoticeSettingPage({Key key}) : super(key: key); | ||
| 20 | + | ||
| 21 | + @override | ||
| 22 | + _CustomerNoticeSettingPageState createState() => | ||
| 23 | + _CustomerNoticeSettingPageState(); | ||
| 24 | +} | ||
| 25 | + | ||
| 26 | +class _CustomerNoticeSettingPageState extends State<CustomerNoticeSettingPage> { | ||
| 27 | + bool selectSms = false; //取消预订发送短信默认关闭 | ||
| 28 | + bool select = false; //启用预订安排通知图文模式 | ||
| 29 | + MarketingCenterProvider marketingCenterProvider; | ||
| 30 | + | ||
| 31 | + @override | ||
| 32 | + void initState() { | ||
| 33 | + super.initState(); | ||
| 34 | + | ||
| 35 | + WidgetsBinding.instance.addPostFrameCallback((_) { | ||
| 36 | + getDzSellerConf(); | ||
| 37 | + }); | ||
| 38 | + } | ||
| 39 | + | ||
| 40 | + getDzSellerConf() async { | ||
| 41 | + bool success = await marketingCenterProvider.getDzSellerConf(context); | ||
| 42 | + if (success && marketingCenterProvider.dzSellerConfModel != null) { | ||
| 43 | + select = marketingCenterProvider.dzSellerConfModel.isNewTemplate == '1' | ||
| 44 | + ? true | ||
| 45 | + : false; | ||
| 46 | + selectSms = marketingCenterProvider.dzSellerConfModel.isOpenCancel == '1' | ||
| 47 | + ? true | ||
| 48 | + : false; | ||
| 49 | + setState(() {}); | ||
| 50 | + } | ||
| 51 | + } | ||
| 52 | + | ||
| 53 | + ///保存接口 | ||
| 54 | + _setData() async { | ||
| 55 | + Future.wait<bool>([ | ||
| 56 | + _setCancelSMS(), | ||
| 57 | + _setNewType(), | ||
| 58 | + ]).then((results) { | ||
| 59 | + print(results[0]); | ||
| 60 | + if (results[0] && results[1]) { | ||
| 61 | + Utils.showToast('设置成功'); | ||
| 62 | + } | ||
| 63 | + }).catchError((e) { | ||
| 64 | + Utils.showToast('设置失败,请重试'); | ||
| 65 | + print(e); | ||
| 66 | + }); | ||
| 67 | + } | ||
| 68 | + | ||
| 69 | + ///启用预订安排通知图文模式 | ||
| 70 | + Future<bool> _setCancelSMS({bool isShowLoading = true}) async { | ||
| 71 | + Map<String, String> params = { | ||
| 72 | + 'sid': Provider.of<UserModel>(context, listen: false).user.sellerid, | ||
| 73 | + 'key': 'is_open_cancel_temp', | ||
| 74 | + 'value': selectSms ? '1' : '0' | ||
| 75 | + }; | ||
| 76 | + | ||
| 77 | + bool success = await marketingCenterProvider.setConfing(context, params, | ||
| 78 | + needToast: false); | ||
| 79 | + | ||
| 80 | + if (success) { | ||
| 81 | + return true; | ||
| 82 | + } else { | ||
| 83 | + return false; | ||
| 84 | + } | ||
| 85 | + } | ||
| 86 | + | ||
| 87 | + ///启用预订安排通知图文模式 | ||
| 88 | + Future<bool> _setNewType({bool isShowLoading = true}) async { | ||
| 89 | + Map<String, String> params = { | ||
| 90 | + 'sid': Provider.of<UserModel>(context, listen: false).user.sellerid, | ||
| 91 | + 'key': 'is_new_template', | ||
| 92 | + 'value': select ? '1' : '0' | ||
| 93 | + }; | ||
| 94 | + | ||
| 95 | + bool success = await marketingCenterProvider.setConfing(context, params, | ||
| 96 | + needToast: false); | ||
| 97 | + | ||
| 98 | + if (success) { | ||
| 99 | + return true; | ||
| 100 | + } else { | ||
| 101 | + return false; | ||
| 102 | + } | ||
| 103 | + } | ||
| 104 | + | ||
| 105 | + Widget _item(String title, {GestureTapCallback onTap}) { | ||
| 106 | + return InkWell( | ||
| 107 | + onTap: onTap, | ||
| 108 | + child: Container( | ||
| 109 | + decoration: BoxDecoration( | ||
| 110 | + border: Border( | ||
| 111 | + bottom: BorderSide( | ||
| 112 | + color: MyColours.color_E7E7E7, width: w(0.5)))), | ||
| 113 | + margin: EdgeInsets.only( | ||
| 114 | + right: w(20), left: w(36), bottom: w(12), top: w(12)), | ||
| 115 | + padding: EdgeInsets.only(top: w(12), bottom: w(12), right: w(12)), | ||
| 116 | + child: Row( | ||
| 117 | + children: [ | ||
| 118 | + Text( | ||
| 119 | + title, | ||
| 120 | + style: TextStyle( | ||
| 121 | + color: MyColours.color_515151, fontSize: font(16)), | ||
| 122 | + ), | ||
| 123 | + Spacer(), | ||
| 124 | + Container( | ||
| 125 | + padding: | ||
| 126 | + EdgeInsets.symmetric(horizontal: w(7), vertical: w(4)), | ||
| 127 | + child: Image.asset( | ||
| 128 | + "assets/arrow_right_new.png", | ||
| 129 | + width: w(9), | ||
| 130 | + height: w(16), | ||
| 131 | + ), | ||
| 132 | + ) | ||
| 133 | + ], | ||
| 134 | + ))); | ||
| 135 | + } | ||
| 136 | + | ||
| 137 | + @override | ||
| 138 | + Widget build(BuildContext context) { | ||
| 139 | + marketingCenterProvider = | ||
| 140 | + Provider.of<MarketingCenterProvider>(context, listen: true); | ||
| 141 | + return Scaffold( | ||
| 142 | + backgroundColor: MyColours.color_ffffff, | ||
| 143 | + appBar: SystemAppBar('客户通知设置'), | ||
| 144 | + body: Column( | ||
| 145 | + children: [ | ||
| 146 | + Expanded( | ||
| 147 | + child: SingleChildScrollView( | ||
| 148 | + child: Column( | ||
| 149 | + children: [ | ||
| 150 | + InkWell( | ||
| 151 | + onTap: () { | ||
| 152 | + setState(() { | ||
| 153 | + selectSms = !selectSms; | ||
| 154 | + }); | ||
| 155 | + }, | ||
| 156 | + child: Padding( | ||
| 157 | + padding: EdgeInsets.only( | ||
| 158 | + left: w(16), | ||
| 159 | + top: w(12), | ||
| 160 | + bottom: w(12), | ||
| 161 | + right: w(12)), | ||
| 162 | + child: Row( | ||
| 163 | + mainAxisAlignment: MainAxisAlignment.spaceBetween, | ||
| 164 | + children: [ | ||
| 165 | + Text( | ||
| 166 | + '客户取消预订时自动发送通知短信', | ||
| 167 | + style: TextStyle( | ||
| 168 | + color: MyColours.color_515151, | ||
| 169 | + fontSize: font(16)), | ||
| 170 | + ), | ||
| 171 | + Spacer(), | ||
| 172 | + Container( | ||
| 173 | + padding: EdgeInsets.symmetric( | ||
| 174 | + horizontal: w(7), vertical: w(4)), | ||
| 175 | + child: Image.asset( | ||
| 176 | + Utils.getImgPath( | ||
| 177 | + selectSms ? 'swich_on' : 'swich_off'), | ||
| 178 | + width: w(44), | ||
| 179 | + ), | ||
| 180 | + ) | ||
| 181 | + // RoundButton( | ||
| 182 | + // text: '预览', | ||
| 183 | + // gradientStart: MyColours.color_ffffff, | ||
| 184 | + // gradientEnd: MyColours.color_ffffff, | ||
| 185 | + // borderColor: MyColours.color_438E93, | ||
| 186 | + // textColor: MyColours.color_438E93, | ||
| 187 | + // radius: ScreenUtil().setWidth(22), | ||
| 188 | + // fontSize: 24, | ||
| 189 | + // width: w(72), | ||
| 190 | + // height: ScreenUtil().setWidth(44), | ||
| 191 | + // isBold: true, | ||
| 192 | + // onPressed: () { | ||
| 193 | + // NavigatorUtil.goMarkingPreviewPage(context); | ||
| 194 | + // }, | ||
| 195 | + // ), | ||
| 196 | + ]))), | ||
| 197 | + Padding( | ||
| 198 | + padding: EdgeInsets.only(left: w(16)), | ||
| 199 | + child: MyDivider(double.infinity, w(0.5), | ||
| 200 | + color: MyColours.color_E7E7E7)), | ||
| 201 | + InkWell( | ||
| 202 | + onTap: () { | ||
| 203 | + setState(() { | ||
| 204 | + select = !select; | ||
| 205 | + }); | ||
| 206 | + }, | ||
| 207 | + child: Padding( | ||
| 208 | + padding: EdgeInsets.only( | ||
| 209 | + left: w(16), | ||
| 210 | + top: w(12), | ||
| 211 | + bottom: w(12), | ||
| 212 | + right: w(12)), | ||
| 213 | + child: Row( | ||
| 214 | + mainAxisAlignment: MainAxisAlignment.spaceBetween, | ||
| 215 | + children: [ | ||
| 216 | + Text( | ||
| 217 | + '启用预订安排通知图文模式', | ||
| 218 | + style: TextStyle( | ||
| 219 | + color: MyColours.color_515151, | ||
| 220 | + fontSize: font(16)), | ||
| 221 | + ), | ||
| 222 | + Spacer(), | ||
| 223 | + Container( | ||
| 224 | + padding: EdgeInsets.symmetric( | ||
| 225 | + horizontal: w(7), vertical: w(4)), | ||
| 226 | + child: Image.asset( | ||
| 227 | + Utils.getImgPath( | ||
| 228 | + select ? 'swich_on' : 'swich_off'), | ||
| 229 | + width: w(44), | ||
| 230 | + ), | ||
| 231 | + ) | ||
| 232 | + // RoundButton( | ||
| 233 | + // text: '预览', | ||
| 234 | + // gradientStart: MyColours.color_ffffff, | ||
| 235 | + // gradientEnd: MyColours.color_ffffff, | ||
| 236 | + // borderColor: MyColours.color_438E93, | ||
| 237 | + // textColor: MyColours.color_438E93, | ||
| 238 | + // radius: ScreenUtil().setWidth(22), | ||
| 239 | + // fontSize: 24, | ||
| 240 | + // width: w(72), | ||
| 241 | + // height: ScreenUtil().setWidth(44), | ||
| 242 | + // isBold: true, | ||
| 243 | + // onPressed: () { | ||
| 244 | + // NavigatorUtil.goMarkingPreviewPage(context); | ||
| 245 | + // }, | ||
| 246 | + // ), | ||
| 247 | + ]))), | ||
| 248 | + Padding( | ||
| 249 | + padding: EdgeInsets.only(left: w(16)), | ||
| 250 | + child: MyDivider(double.infinity, w(0.5), | ||
| 251 | + color: MyColours.color_E7E7E7)), | ||
| 252 | + _item('首图形象展示', onTap: () { | ||
| 253 | + NavigatorUtil.goFirstImagePage(context); | ||
| 254 | + }), | ||
| 255 | + _item('预订信息模块', onTap: () { | ||
| 256 | + NavigatorUtil.goBookInfoPage(context); | ||
| 257 | + }), | ||
| 258 | + _item('店铺介绍展示', onTap: () { | ||
| 259 | + NavigatorUtil.goStoreIntroducePage(context); | ||
| 260 | + }), | ||
| 261 | + _item('主厨介绍展示', onTap: () { | ||
| 262 | + NavigatorUtil.goChefIntroducePage(context); | ||
| 263 | + }), | ||
| 264 | + _item('招牌菜展示', onTap: () { | ||
| 265 | + NavigatorUtil.goDishShowPage(context); | ||
| 266 | + }), | ||
| 267 | + _item('营销及客户互动功能', onTap: () { | ||
| 268 | + NavigatorUtil.goMarkingInteractionPage(context); | ||
| 269 | + }), | ||
| 270 | + ], | ||
| 271 | + ), | ||
| 272 | + )), | ||
| 273 | + Container( | ||
| 274 | + color: MyColours.color_ffffff, | ||
| 275 | + padding: EdgeInsets.only( | ||
| 276 | + left: w(23), right: w(23), top: w(12), bottom: w(25)), | ||
| 277 | + child: Row( | ||
| 278 | + children: [ | ||
| 279 | + RoundButton( | ||
| 280 | + text: '图文预览', | ||
| 281 | + width: w(100), | ||
| 282 | + gradientStart: MyColours.color_ffffff, | ||
| 283 | + gradientEnd: MyColours.color_ffffff, | ||
| 284 | + borderColor: MyColours.color_438E93, | ||
| 285 | + radius: r(5), | ||
| 286 | + fontSize: 32, | ||
| 287 | + height: w(40), | ||
| 288 | + textColor: MyColours.color_438E93, | ||
| 289 | + isBold: true, | ||
| 290 | + onPressed: () async { | ||
| 291 | + NavigatorUtil.goMarkingPreviewPage(context); | ||
| 292 | + }), | ||
| 293 | + HEmptyView(30), | ||
| 294 | + Expanded( | ||
| 295 | + child: RoundButton( | ||
| 296 | + text: '保存', | ||
| 297 | + gradientStart: MyColours.color_199095, | ||
| 298 | + gradientEnd: MyColours.color_199095, | ||
| 299 | + // borderColor: MyColours.color_999999, | ||
| 300 | + radius: r(5), | ||
| 301 | + fontSize: 32, | ||
| 302 | + height: w(40), | ||
| 303 | + isBold: true, | ||
| 304 | + onPressed: () async { | ||
| 305 | + //调用接口 | ||
| 306 | + _setData(); | ||
| 307 | + })) | ||
| 308 | + ], | ||
| 309 | + )) | ||
| 310 | + ], | ||
| 311 | + ), | ||
| 312 | + ); | ||
| 313 | + } | ||
| 314 | +} |
| @@ -29,117 +29,117 @@ class MarketingCenterHomePage extends StatefulWidget { | @@ -29,117 +29,117 @@ class MarketingCenterHomePage extends StatefulWidget { | ||
| 29 | 29 | ||
| 30 | class _MarketingCenterHomePageState extends State<MarketingCenterHomePage> { | 30 | class _MarketingCenterHomePageState extends State<MarketingCenterHomePage> { |
| 31 | MarketingCenterProvider marketingCenterProvider; | 31 | MarketingCenterProvider marketingCenterProvider; |
| 32 | - bool select = false; //启用预订安排通知图文模式 | ||
| 33 | - bool selectShowPrice = true; //分享排菜单给客户时展示菜品价格 | 32 | + // bool select = false; //启用预订安排通知图文模式 |
| 33 | + // bool selectShowPrice = true; //分享排菜单给客户时展示菜品价格 | ||
| 34 | 34 | ||
| 35 | - @override | ||
| 36 | - void initState() { | ||
| 37 | - super.initState(); | 35 | + // @override |
| 36 | + // void initState() { | ||
| 37 | + // super.initState(); | ||
| 38 | 38 | ||
| 39 | - WidgetsBinding.instance.addPostFrameCallback((_) { | ||
| 40 | - getDzSellerConf(); | ||
| 41 | - }); | ||
| 42 | - } | 39 | + // WidgetsBinding.instance.addPostFrameCallback((_) { |
| 40 | + // getDzSellerConf(); | ||
| 41 | + // }); | ||
| 42 | + // } | ||
| 43 | 43 | ||
| 44 | - getDzSellerConf() async { | ||
| 45 | - bool success = await marketingCenterProvider.getDzSellerConf(context); | ||
| 46 | - if (success && marketingCenterProvider.dzSellerConfModel != null) { | ||
| 47 | - select = marketingCenterProvider.dzSellerConfModel.isNewTemplate == '1' | ||
| 48 | - ? true | ||
| 49 | - : false; | ||
| 50 | - selectShowPrice = | ||
| 51 | - marketingCenterProvider.dzSellerConfModel.isShowPrice == '1' | ||
| 52 | - ? true | ||
| 53 | - : false; | ||
| 54 | - setState(() {}); | ||
| 55 | - } | ||
| 56 | - } | 44 | + // getDzSellerConf() async { |
| 45 | + // bool success = await marketingCenterProvider.getDzSellerConf(context); | ||
| 46 | + // if (success && marketingCenterProvider.dzSellerConfModel != null) { | ||
| 47 | + // select = marketingCenterProvider.dzSellerConfModel.isNewTemplate == '1' | ||
| 48 | + // ? true | ||
| 49 | + // : false; | ||
| 50 | + // selectShowPrice = | ||
| 51 | + // marketingCenterProvider.dzSellerConfModel.isShowPrice == '1' | ||
| 52 | + // ? true | ||
| 53 | + // : false; | ||
| 54 | + // setState(() {}); | ||
| 55 | + // } | ||
| 56 | + // } | ||
| 57 | 57 | ||
| 58 | - Widget _item(String title, {GestureTapCallback onTap}) { | ||
| 59 | - return InkWell( | ||
| 60 | - onTap: onTap, | ||
| 61 | - child: Container( | ||
| 62 | - decoration: BoxDecoration( | ||
| 63 | - border: Border( | ||
| 64 | - bottom: BorderSide( | ||
| 65 | - color: MyColours.color_E7E7E7, width: w(0.5)))), | ||
| 66 | - margin: EdgeInsets.only( | ||
| 67 | - right: w(20), left: w(36), bottom: w(12), top: w(12)), | ||
| 68 | - padding: EdgeInsets.only(top: w(12), bottom: w(12), right: w(12)), | ||
| 69 | - child: Row( | ||
| 70 | - children: [ | ||
| 71 | - Text( | ||
| 72 | - title, | ||
| 73 | - style: TextStyle( | ||
| 74 | - color: MyColours.color_515151, | ||
| 75 | - fontSize: ScreenUtil().setWidth(32)), | ||
| 76 | - ), | ||
| 77 | - Spacer(), | ||
| 78 | - Container( | ||
| 79 | - padding: | ||
| 80 | - EdgeInsets.symmetric(horizontal: w(7), vertical: w(4)), | ||
| 81 | - child: Image.asset( | ||
| 82 | - "assets/arrow_right_new.png", | ||
| 83 | - width: ScreenUtil().setWidth(18), | ||
| 84 | - height: ScreenUtil().setWidth(32), | ||
| 85 | - ), | ||
| 86 | - ) | ||
| 87 | - ], | ||
| 88 | - ))); | ||
| 89 | - } | 58 | + // Widget _item(String title, {GestureTapCallback onTap}) { |
| 59 | + // return InkWell( | ||
| 60 | + // onTap: onTap, | ||
| 61 | + // child: Container( | ||
| 62 | + // decoration: BoxDecoration( | ||
| 63 | + // border: Border( | ||
| 64 | + // bottom: BorderSide( | ||
| 65 | + // color: MyColours.color_E7E7E7, width: w(0.5)))), | ||
| 66 | + // margin: EdgeInsets.only( | ||
| 67 | + // right: w(20), left: w(36), bottom: w(12), top: w(12)), | ||
| 68 | + // padding: EdgeInsets.only(top: w(12), bottom: w(12), right: w(12)), | ||
| 69 | + // child: Row( | ||
| 70 | + // children: [ | ||
| 71 | + // Text( | ||
| 72 | + // title, | ||
| 73 | + // style: TextStyle( | ||
| 74 | + // color: MyColours.color_515151, | ||
| 75 | + // fontSize: ScreenUtil().setWidth(32)), | ||
| 76 | + // ), | ||
| 77 | + // Spacer(), | ||
| 78 | + // Container( | ||
| 79 | + // padding: | ||
| 80 | + // EdgeInsets.symmetric(horizontal: w(7), vertical: w(4)), | ||
| 81 | + // child: Image.asset( | ||
| 82 | + // "assets/arrow_right_new.png", | ||
| 83 | + // width: ScreenUtil().setWidth(18), | ||
| 84 | + // height: ScreenUtil().setWidth(32), | ||
| 85 | + // ), | ||
| 86 | + // ) | ||
| 87 | + // ], | ||
| 88 | + // ))); | ||
| 89 | + // } | ||
| 90 | 90 | ||
| 91 | - ///分享排菜单给客户时展示菜品价格 | 91 | + // ///分享排菜单给客户时展示菜品价格 |
| 92 | 92 | ||
| 93 | - Future<bool> _setPriceShow({bool isShowLoading = true}) async { | ||
| 94 | - Map<String, String> params = { | ||
| 95 | - 'sid': Provider.of<UserModel>(context, listen: false).user.sellerid, | ||
| 96 | - 'key': 'is_show_price', | ||
| 97 | - 'value': selectShowPrice ? '1' : '0' | ||
| 98 | - }; | 93 | + // Future<bool> _setPriceShow({bool isShowLoading = true}) async { |
| 94 | + // Map<String, String> params = { | ||
| 95 | + // 'sid': Provider.of<UserModel>(context, listen: false).user.sellerid, | ||
| 96 | + // 'key': 'is_show_price', | ||
| 97 | + // 'value': selectShowPrice ? '1' : '0' | ||
| 98 | + // }; | ||
| 99 | 99 | ||
| 100 | - bool success = await marketingCenterProvider.setConfing(context, params, | ||
| 101 | - needToast: false); | 100 | + // bool success = await marketingCenterProvider.setConfing(context, params, |
| 101 | + // needToast: false); | ||
| 102 | 102 | ||
| 103 | - if (success) { | ||
| 104 | - return true; | ||
| 105 | - } else { | ||
| 106 | - return false; | ||
| 107 | - } | ||
| 108 | - } | 103 | + // if (success) { |
| 104 | + // return true; | ||
| 105 | + // } else { | ||
| 106 | + // return false; | ||
| 107 | + // } | ||
| 108 | + // } | ||
| 109 | 109 | ||
| 110 | - ///启用预订安排通知图文模式 | ||
| 111 | - Future<bool> _setNewType({bool isShowLoading = true}) async { | ||
| 112 | - Map<String, String> params = { | ||
| 113 | - 'sid': Provider.of<UserModel>(context, listen: false).user.sellerid, | ||
| 114 | - 'key': 'is_new_template', | ||
| 115 | - 'value': select ? '1' : '0' | ||
| 116 | - }; | 110 | + // ///启用预订安排通知图文模式 |
| 111 | + // Future<bool> _setNewType({bool isShowLoading = true}) async { | ||
| 112 | + // Map<String, String> params = { | ||
| 113 | + // 'sid': Provider.of<UserModel>(context, listen: false).user.sellerid, | ||
| 114 | + // 'key': 'is_new_template', | ||
| 115 | + // 'value': select ? '1' : '0' | ||
| 116 | + // }; | ||
| 117 | 117 | ||
| 118 | - bool success = await marketingCenterProvider.setConfing(context, params, | ||
| 119 | - needToast: false); | 118 | + // bool success = await marketingCenterProvider.setConfing(context, params, |
| 119 | + // needToast: false); | ||
| 120 | 120 | ||
| 121 | - if (success) { | ||
| 122 | - return true; | ||
| 123 | - } else { | ||
| 124 | - return false; | ||
| 125 | - } | ||
| 126 | - } | 121 | + // if (success) { |
| 122 | + // return true; | ||
| 123 | + // } else { | ||
| 124 | + // return false; | ||
| 125 | + // } | ||
| 126 | + // } | ||
| 127 | 127 | ||
| 128 | - ///保存接口 | ||
| 129 | - _setData() async { | ||
| 130 | - Future.wait<bool>([ | ||
| 131 | - _setPriceShow(), | ||
| 132 | - _setNewType(), | ||
| 133 | - ]).then((results) { | ||
| 134 | - print(results[0]); | ||
| 135 | - if (results[0] && results[1]) { | ||
| 136 | - Utils.showToast('设置成功'); | ||
| 137 | - } | ||
| 138 | - }).catchError((e) { | ||
| 139 | - Utils.showToast('设置失败,请重试'); | ||
| 140 | - print(e); | ||
| 141 | - }); | ||
| 142 | - } | 128 | + // ///保存接口 |
| 129 | + // _setData() async { | ||
| 130 | + // Future.wait<bool>([ | ||
| 131 | + // // _setPriceShow(), | ||
| 132 | + // _setNewType(), | ||
| 133 | + // ]).then((results) { | ||
| 134 | + // print(results[0]); | ||
| 135 | + // if (results[0] && results[1]) { | ||
| 136 | + // Utils.showToast('设置成功'); | ||
| 137 | + // } | ||
| 138 | + // }).catchError((e) { | ||
| 139 | + // Utils.showToast('设置失败,请重试'); | ||
| 140 | + // print(e); | ||
| 141 | + // }); | ||
| 142 | + // } | ||
| 143 | 143 | ||
| 144 | @override | 144 | @override |
| 145 | Widget build(BuildContext context) { | 145 | Widget build(BuildContext context) { |
| @@ -202,9 +202,7 @@ class _MarketingCenterHomePageState extends State<MarketingCenterHomePage> { | @@ -202,9 +202,7 @@ class _MarketingCenterHomePageState extends State<MarketingCenterHomePage> { | ||
| 202 | VEmptyView(24), | 202 | VEmptyView(24), |
| 203 | InkWell( | 203 | InkWell( |
| 204 | onTap: () { | 204 | onTap: () { |
| 205 | - setState(() { | ||
| 206 | - selectShowPrice = !selectShowPrice; | ||
| 207 | - }); | 205 | + NavigatorUtil.goOrderSettingPage(context); |
| 208 | }, | 206 | }, |
| 209 | child: Padding( | 207 | child: Padding( |
| 210 | padding: EdgeInsets.only( | 208 | padding: EdgeInsets.only( |
| @@ -213,52 +211,33 @@ class _MarketingCenterHomePageState extends State<MarketingCenterHomePage> { | @@ -213,52 +211,33 @@ class _MarketingCenterHomePageState extends State<MarketingCenterHomePage> { | ||
| 213 | bottom: w(12), | 211 | bottom: w(12), |
| 214 | right: w(12)), | 212 | right: w(12)), |
| 215 | child: Row( | 213 | child: Row( |
| 216 | - mainAxisAlignment: | ||
| 217 | - MainAxisAlignment.spaceBetween, | ||
| 218 | - children: [ | ||
| 219 | - Text( | ||
| 220 | - '分享排菜单给客户时展示菜品价格', | ||
| 221 | - style: TextStyle( | ||
| 222 | - color: MyColours.color_515151, | ||
| 223 | - fontSize: ScreenUtil().setWidth(32)), | 214 | + children: [ |
| 215 | + Text( | ||
| 216 | + '提前点菜', | ||
| 217 | + style: TextStyle( | ||
| 218 | + color: MyColours.color_515151, | ||
| 219 | + fontSize: ScreenUtil().setWidth(32)), | ||
| 220 | + ), | ||
| 221 | + Spacer(), | ||
| 222 | + Container( | ||
| 223 | + padding: EdgeInsets.symmetric( | ||
| 224 | + horizontal: w(7), vertical: w(4)), | ||
| 225 | + child: Image.asset( | ||
| 226 | + "assets/arrow_right_new.png", | ||
| 227 | + width: ScreenUtil().setWidth(18), | ||
| 228 | + height: ScreenUtil().setWidth(32), | ||
| 224 | ), | 229 | ), |
| 225 | - Spacer(), | ||
| 226 | - Container( | ||
| 227 | - padding: EdgeInsets.symmetric( | ||
| 228 | - horizontal: w(7), vertical: w(4)), | ||
| 229 | - child: Image.asset( | ||
| 230 | - Utils.getImgPath(selectShowPrice | ||
| 231 | - ? 'swich_on' | ||
| 232 | - : 'swich_off'), | ||
| 233 | - width: w(44), | ||
| 234 | - ), | ||
| 235 | - ) | ||
| 236 | - // RoundButton( | ||
| 237 | - // text: '预览', | ||
| 238 | - // gradientStart: MyColours.color_ffffff, | ||
| 239 | - // gradientEnd: MyColours.color_ffffff, | ||
| 240 | - // borderColor: MyColours.color_438E93, | ||
| 241 | - // textColor: MyColours.color_438E93, | ||
| 242 | - // radius: ScreenUtil().setWidth(22), | ||
| 243 | - // fontSize: 24, | ||
| 244 | - // width: w(72), | ||
| 245 | - // height: ScreenUtil().setWidth(44), | ||
| 246 | - // isBold: true, | ||
| 247 | - // onPressed: () { | ||
| 248 | - // NavigatorUtil.goMarkingPreviewPage(context); | ||
| 249 | - // }, | ||
| 250 | - // ), | ||
| 251 | - ]))), | 230 | + ) |
| 231 | + ], | ||
| 232 | + ))), | ||
| 252 | Padding( | 233 | Padding( |
| 253 | padding: EdgeInsets.only(left: w(16)), | 234 | padding: EdgeInsets.only(left: w(16)), |
| 254 | child: MyDivider(double.infinity, w(0.5), | 235 | child: MyDivider(double.infinity, w(0.5), |
| 255 | color: MyColours.color_E7E7E7)), | 236 | color: MyColours.color_E7E7E7)), |
| 256 | - VEmptyView(20), | 237 | + VEmptyView(24), |
| 257 | InkWell( | 238 | InkWell( |
| 258 | onTap: () { | 239 | onTap: () { |
| 259 | - setState(() { | ||
| 260 | - select = !select; | ||
| 261 | - }); | 240 | + NavigatorUtil.goCustomerNoticeSettingPage(context); |
| 262 | }, | 241 | }, |
| 263 | child: Padding( | 242 | child: Padding( |
| 264 | padding: EdgeInsets.only( | 243 | padding: EdgeInsets.only( |
| @@ -267,103 +246,194 @@ class _MarketingCenterHomePageState extends State<MarketingCenterHomePage> { | @@ -267,103 +246,194 @@ class _MarketingCenterHomePageState extends State<MarketingCenterHomePage> { | ||
| 267 | bottom: w(12), | 246 | bottom: w(12), |
| 268 | right: w(12)), | 247 | right: w(12)), |
| 269 | child: Row( | 248 | child: Row( |
| 270 | - mainAxisAlignment: | ||
| 271 | - MainAxisAlignment.spaceBetween, | ||
| 272 | - children: [ | ||
| 273 | - Text( | ||
| 274 | - '启用预订安排通知图文模式', | ||
| 275 | - style: TextStyle( | ||
| 276 | - color: MyColours.color_515151, | ||
| 277 | - fontSize: ScreenUtil().setWidth(32)), | 249 | + children: [ |
| 250 | + Text( | ||
| 251 | + '客户通知设置', | ||
| 252 | + style: TextStyle( | ||
| 253 | + color: MyColours.color_515151, | ||
| 254 | + fontSize: ScreenUtil().setWidth(32)), | ||
| 255 | + ), | ||
| 256 | + Spacer(), | ||
| 257 | + Container( | ||
| 258 | + padding: EdgeInsets.symmetric( | ||
| 259 | + horizontal: w(7), vertical: w(4)), | ||
| 260 | + child: Image.asset( | ||
| 261 | + "assets/arrow_right_new.png", | ||
| 262 | + width: ScreenUtil().setWidth(18), | ||
| 263 | + height: ScreenUtil().setWidth(32), | ||
| 278 | ), | 264 | ), |
| 279 | - Spacer(), | ||
| 280 | - Container( | ||
| 281 | - padding: EdgeInsets.symmetric( | ||
| 282 | - horizontal: w(7), vertical: w(4)), | ||
| 283 | - child: Image.asset( | ||
| 284 | - Utils.getImgPath( | ||
| 285 | - select ? 'swich_on' : 'swich_off'), | ||
| 286 | - width: w(44), | ||
| 287 | - ), | ||
| 288 | - ) | ||
| 289 | - // RoundButton( | ||
| 290 | - // text: '预览', | ||
| 291 | - // gradientStart: MyColours.color_ffffff, | ||
| 292 | - // gradientEnd: MyColours.color_ffffff, | ||
| 293 | - // borderColor: MyColours.color_438E93, | ||
| 294 | - // textColor: MyColours.color_438E93, | ||
| 295 | - // radius: ScreenUtil().setWidth(22), | ||
| 296 | - // fontSize: 24, | ||
| 297 | - // width: w(72), | ||
| 298 | - // height: ScreenUtil().setWidth(44), | ||
| 299 | - // isBold: true, | ||
| 300 | - // onPressed: () { | ||
| 301 | - // NavigatorUtil.goMarkingPreviewPage(context); | ||
| 302 | - // }, | ||
| 303 | - // ), | ||
| 304 | - ]))), | 265 | + ) |
| 266 | + ], | ||
| 267 | + ))), | ||
| 305 | Padding( | 268 | Padding( |
| 306 | padding: EdgeInsets.only(left: w(16)), | 269 | padding: EdgeInsets.only(left: w(16)), |
| 307 | child: MyDivider(double.infinity, w(0.5), | 270 | child: MyDivider(double.infinity, w(0.5), |
| 308 | color: MyColours.color_E7E7E7)), | 271 | color: MyColours.color_E7E7E7)), |
| 309 | - _item('首图形象展示', onTap: () { | ||
| 310 | - NavigatorUtil.goFirstImagePage(context); | ||
| 311 | - }), | ||
| 312 | - _item('预订信息模块', onTap: () { | ||
| 313 | - NavigatorUtil.goBookInfoPage(context); | ||
| 314 | - }), | ||
| 315 | - _item('店铺介绍展示', onTap: () { | ||
| 316 | - NavigatorUtil.goStoreIntroducePage(context); | ||
| 317 | - }), | ||
| 318 | - _item('主厨介绍展示', onTap: () { | ||
| 319 | - NavigatorUtil.goChefIntroducePage(context); | ||
| 320 | - }), | ||
| 321 | - _item('招牌菜展示', onTap: () { | ||
| 322 | - NavigatorUtil.goDishShowPage(context); | ||
| 323 | - }), | ||
| 324 | - _item('营销及客户互动功能', onTap: () { | ||
| 325 | - NavigatorUtil.goMarkingInteractionPage(context); | ||
| 326 | - }), | 272 | + VEmptyView(24), |
| 273 | + // InkWell( | ||
| 274 | + // onTap: () { | ||
| 275 | + // setState(() { | ||
| 276 | + // selectShowPrice = !selectShowPrice; | ||
| 277 | + // }); | ||
| 278 | + // }, | ||
| 279 | + // child: Padding( | ||
| 280 | + // padding: EdgeInsets.only( | ||
| 281 | + // left: w(16), | ||
| 282 | + // top: w(12), | ||
| 283 | + // bottom: w(12), | ||
| 284 | + // right: w(12)), | ||
| 285 | + // child: Row( | ||
| 286 | + // mainAxisAlignment: | ||
| 287 | + // MainAxisAlignment.spaceBetween, | ||
| 288 | + // children: [ | ||
| 289 | + // Text( | ||
| 290 | + // '分享排菜单给客户时展示菜品价格', | ||
| 291 | + // style: TextStyle( | ||
| 292 | + // color: MyColours.color_515151, | ||
| 293 | + // fontSize: ScreenUtil().setWidth(32)), | ||
| 294 | + // ), | ||
| 295 | + // Spacer(), | ||
| 296 | + // Container( | ||
| 297 | + // padding: EdgeInsets.symmetric( | ||
| 298 | + // horizontal: w(7), vertical: w(4)), | ||
| 299 | + // child: Image.asset( | ||
| 300 | + // Utils.getImgPath(selectShowPrice | ||
| 301 | + // ? 'swich_on' | ||
| 302 | + // : 'swich_off'), | ||
| 303 | + // width: w(44), | ||
| 304 | + // ), | ||
| 305 | + // ) | ||
| 306 | + // // RoundButton( | ||
| 307 | + // // text: '预览', | ||
| 308 | + // // gradientStart: MyColours.color_ffffff, | ||
| 309 | + // // gradientEnd: MyColours.color_ffffff, | ||
| 310 | + // // borderColor: MyColours.color_438E93, | ||
| 311 | + // // textColor: MyColours.color_438E93, | ||
| 312 | + // // radius: ScreenUtil().setWidth(22), | ||
| 313 | + // // fontSize: 24, | ||
| 314 | + // // width: w(72), | ||
| 315 | + // // height: ScreenUtil().setWidth(44), | ||
| 316 | + // // isBold: true, | ||
| 317 | + // // onPressed: () { | ||
| 318 | + // // NavigatorUtil.goMarkingPreviewPage(context); | ||
| 319 | + // // }, | ||
| 320 | + // // ), | ||
| 321 | + // ]))), | ||
| 322 | + // Padding( | ||
| 323 | + // padding: EdgeInsets.only(left: w(16)), | ||
| 324 | + // child: MyDivider(double.infinity, w(0.5), | ||
| 325 | + // color: MyColours.color_E7E7E7)), | ||
| 326 | + // VEmptyView(20), | ||
| 327 | + // InkWell( | ||
| 328 | + // onTap: () { | ||
| 329 | + // setState(() { | ||
| 330 | + // select = !select; | ||
| 331 | + // }); | ||
| 332 | + // }, | ||
| 333 | + // child: Padding( | ||
| 334 | + // padding: EdgeInsets.only( | ||
| 335 | + // left: w(16), | ||
| 336 | + // top: w(12), | ||
| 337 | + // bottom: w(12), | ||
| 338 | + // right: w(12)), | ||
| 339 | + // child: Row( | ||
| 340 | + // mainAxisAlignment: | ||
| 341 | + // MainAxisAlignment.spaceBetween, | ||
| 342 | + // children: [ | ||
| 343 | + // Text( | ||
| 344 | + // '启用预订安排通知图文模式', | ||
| 345 | + // style: TextStyle( | ||
| 346 | + // color: MyColours.color_515151, | ||
| 347 | + // fontSize: ScreenUtil().setWidth(32)), | ||
| 348 | + // ), | ||
| 349 | + // Spacer(), | ||
| 350 | + // Container( | ||
| 351 | + // padding: EdgeInsets.symmetric( | ||
| 352 | + // horizontal: w(7), vertical: w(4)), | ||
| 353 | + // child: Image.asset( | ||
| 354 | + // Utils.getImgPath( | ||
| 355 | + // select ? 'swich_on' : 'swich_off'), | ||
| 356 | + // width: w(44), | ||
| 357 | + // ), | ||
| 358 | + // ) | ||
| 359 | + // // RoundButton( | ||
| 360 | + // // text: '预览', | ||
| 361 | + // // gradientStart: MyColours.color_ffffff, | ||
| 362 | + // // gradientEnd: MyColours.color_ffffff, | ||
| 363 | + // // borderColor: MyColours.color_438E93, | ||
| 364 | + // // textColor: MyColours.color_438E93, | ||
| 365 | + // // radius: ScreenUtil().setWidth(22), | ||
| 366 | + // // fontSize: 24, | ||
| 367 | + // // width: w(72), | ||
| 368 | + // // height: ScreenUtil().setWidth(44), | ||
| 369 | + // // isBold: true, | ||
| 370 | + // // onPressed: () { | ||
| 371 | + // // NavigatorUtil.goMarkingPreviewPage(context); | ||
| 372 | + // // }, | ||
| 373 | + // // ), | ||
| 374 | + // ]))), | ||
| 375 | + // Padding( | ||
| 376 | + // padding: EdgeInsets.only(left: w(16)), | ||
| 377 | + // child: MyDivider(double.infinity, w(0.5), | ||
| 378 | + // color: MyColours.color_E7E7E7)), | ||
| 379 | + // _item('首图形象展示', onTap: () { | ||
| 380 | + // NavigatorUtil.goFirstImagePage(context); | ||
| 381 | + // }), | ||
| 382 | + // _item('预订信息模块', onTap: () { | ||
| 383 | + // NavigatorUtil.goBookInfoPage(context); | ||
| 384 | + // }), | ||
| 385 | + // _item('店铺介绍展示', onTap: () { | ||
| 386 | + // NavigatorUtil.goStoreIntroducePage(context); | ||
| 387 | + // }), | ||
| 388 | + // _item('主厨介绍展示', onTap: () { | ||
| 389 | + // NavigatorUtil.goChefIntroducePage(context); | ||
| 390 | + // }), | ||
| 391 | + // _item('招牌菜展示', onTap: () { | ||
| 392 | + // NavigatorUtil.goDishShowPage(context); | ||
| 393 | + // }), | ||
| 394 | + // _item('营销及客户互动功能', onTap: () { | ||
| 395 | + // NavigatorUtil.goMarkingInteractionPage(context); | ||
| 396 | + // }), | ||
| 327 | ], | 397 | ], |
| 328 | ), | 398 | ), |
| 329 | )), | 399 | )), |
| 330 | - Container( | ||
| 331 | - color: MyColours.color_ffffff, | ||
| 332 | - padding: EdgeInsets.only( | ||
| 333 | - left: w(23), right: w(23), top: w(12), bottom: w(25)), | ||
| 334 | - child: Row( | ||
| 335 | - children: [ | ||
| 336 | - RoundButton( | ||
| 337 | - text: '图文预览', | ||
| 338 | - width: w(100), | ||
| 339 | - gradientStart: MyColours.color_ffffff, | ||
| 340 | - gradientEnd: MyColours.color_ffffff, | ||
| 341 | - borderColor: MyColours.color_438E93, | ||
| 342 | - radius: r(5), | ||
| 343 | - fontSize: 32, | ||
| 344 | - height: w(40), | ||
| 345 | - textColor: MyColours.color_438E93, | ||
| 346 | - isBold: true, | ||
| 347 | - onPressed: () async { | ||
| 348 | - NavigatorUtil.goMarkingPreviewPage(context); | ||
| 349 | - }), | ||
| 350 | - HEmptyView(30), | ||
| 351 | - Expanded( | ||
| 352 | - child: RoundButton( | ||
| 353 | - text: '保存', | ||
| 354 | - gradientStart: MyColours.color_199095, | ||
| 355 | - gradientEnd: MyColours.color_199095, | ||
| 356 | - // borderColor: MyColours.color_999999, | ||
| 357 | - radius: r(5), | ||
| 358 | - fontSize: 32, | ||
| 359 | - height: w(40), | ||
| 360 | - isBold: true, | ||
| 361 | - onPressed: () async { | ||
| 362 | - //调用接口 | ||
| 363 | - _setData(); | ||
| 364 | - })) | ||
| 365 | - ], | ||
| 366 | - )) | 400 | + // Container( |
| 401 | + // color: MyColours.color_ffffff, | ||
| 402 | + // padding: EdgeInsets.only( | ||
| 403 | + // left: w(23), right: w(23), top: w(12), bottom: w(25)), | ||
| 404 | + // child: Row( | ||
| 405 | + // children: [ | ||
| 406 | + // RoundButton( | ||
| 407 | + // text: '图文预览', | ||
| 408 | + // width: w(100), | ||
| 409 | + // gradientStart: MyColours.color_ffffff, | ||
| 410 | + // gradientEnd: MyColours.color_ffffff, | ||
| 411 | + // borderColor: MyColours.color_438E93, | ||
| 412 | + // radius: r(5), | ||
| 413 | + // fontSize: 32, | ||
| 414 | + // height: w(40), | ||
| 415 | + // textColor: MyColours.color_438E93, | ||
| 416 | + // isBold: true, | ||
| 417 | + // onPressed: () async { | ||
| 418 | + // NavigatorUtil.goMarkingPreviewPage(context); | ||
| 419 | + // }), | ||
| 420 | + // HEmptyView(30), | ||
| 421 | + // Expanded( | ||
| 422 | + // child: RoundButton( | ||
| 423 | + // text: '保存', | ||
| 424 | + // gradientStart: MyColours.color_199095, | ||
| 425 | + // gradientEnd: MyColours.color_199095, | ||
| 426 | + // // borderColor: MyColours.color_999999, | ||
| 427 | + // radius: r(5), | ||
| 428 | + // fontSize: 32, | ||
| 429 | + // height: w(40), | ||
| 430 | + // isBold: true, | ||
| 431 | + // onPressed: () async { | ||
| 432 | + // //调用接口 | ||
| 433 | + // _setData(); | ||
| 434 | + // })) | ||
| 435 | + // ], | ||
| 436 | + // )) | ||
| 367 | ], | 437 | ], |
| 368 | ))); | 438 | ))); |
| 369 | } | 439 | } |
| 1 | +import 'package:flutter/material.dart'; | ||
| 2 | +import 'package:one_key/widgets/system_app_bar.dart'; | ||
| 3 | +import 'package:provider/provider.dart'; | ||
| 4 | + | ||
| 5 | +import '../../../provider/marketing_center_provider.dart'; | ||
| 6 | +import '../../../provider/user_model.dart'; | ||
| 7 | +import '../../../res/colors.dart'; | ||
| 8 | +import '../../../utils/screen_util.dart'; | ||
| 9 | +import '../../../utils/utils.dart'; | ||
| 10 | +import '../../../widgets/MyDivider.dart'; | ||
| 11 | +import '../../../widgets/round_button.dart'; | ||
| 12 | +import '../../../widgets/v_empty_view.dart'; | ||
| 13 | + | ||
| 14 | +/** | ||
| 15 | + * 提前点餐配置页面 | ||
| 16 | + */ | ||
| 17 | +class OrderSettingPage extends StatefulWidget { | ||
| 18 | + OrderSettingPage({Key key}) : super(key: key); | ||
| 19 | + | ||
| 20 | + @override | ||
| 21 | + _OrderSettingPageState createState() => _OrderSettingPageState(); | ||
| 22 | +} | ||
| 23 | + | ||
| 24 | +class _OrderSettingPageState extends State<OrderSettingPage> { | ||
| 25 | + MarketingCenterProvider marketingCenterProvider; | ||
| 26 | + bool selectShowPrice = true; //分享排菜单给客户时展示菜品价格 | ||
| 27 | + | ||
| 28 | + @override | ||
| 29 | + void initState() { | ||
| 30 | + super.initState(); | ||
| 31 | + | ||
| 32 | + WidgetsBinding.instance.addPostFrameCallback((_) { | ||
| 33 | + getDzSellerConf(); | ||
| 34 | + }); | ||
| 35 | + } | ||
| 36 | + | ||
| 37 | + getDzSellerConf() async { | ||
| 38 | + bool success = await marketingCenterProvider.getDzSellerConf(context); | ||
| 39 | + if (success && marketingCenterProvider.dzSellerConfModel != null) { | ||
| 40 | + selectShowPrice = | ||
| 41 | + marketingCenterProvider.dzSellerConfModel.isShowPrice == '1' | ||
| 42 | + ? true | ||
| 43 | + : false; | ||
| 44 | + setState(() {}); | ||
| 45 | + } | ||
| 46 | + } | ||
| 47 | + | ||
| 48 | + ///分享排菜单给客户时展示菜品价格 | ||
| 49 | + | ||
| 50 | + _setPriceShow() async { | ||
| 51 | + Map<String, String> params = { | ||
| 52 | + 'sid': Provider.of<UserModel>(context, listen: false).user.sellerid, | ||
| 53 | + 'key': 'is_show_price', | ||
| 54 | + 'value': selectShowPrice ? '1' : '0' | ||
| 55 | + }; | ||
| 56 | + | ||
| 57 | + await marketingCenterProvider.setConfing(context, params, needToast: true); | ||
| 58 | + | ||
| 59 | + // if (success) { | ||
| 60 | + // Utils.showToast('设置成功'); | ||
| 61 | + // return true; | ||
| 62 | + // } else { | ||
| 63 | + // Utils.showToast('设置失败,请重试'); | ||
| 64 | + // return false; | ||
| 65 | + // } | ||
| 66 | + } | ||
| 67 | + | ||
| 68 | + @override | ||
| 69 | + Widget build(BuildContext context) { | ||
| 70 | + marketingCenterProvider = | ||
| 71 | + Provider.of<MarketingCenterProvider>(context, listen: true); | ||
| 72 | + return Scaffold( | ||
| 73 | + backgroundColor: MyColours.color_ffffff, | ||
| 74 | + appBar: SystemAppBar('提前点菜'), | ||
| 75 | + body: Column( | ||
| 76 | + children: [ | ||
| 77 | + Expanded( | ||
| 78 | + child: SingleChildScrollView( | ||
| 79 | + child: Column( | ||
| 80 | + children: [ | ||
| 81 | + InkWell( | ||
| 82 | + onTap: () { | ||
| 83 | + setState(() { | ||
| 84 | + selectShowPrice = !selectShowPrice; | ||
| 85 | + }); | ||
| 86 | + }, | ||
| 87 | + child: Padding( | ||
| 88 | + padding: EdgeInsets.only( | ||
| 89 | + left: w(16), | ||
| 90 | + top: w(12), | ||
| 91 | + bottom: w(12), | ||
| 92 | + right: w(12)), | ||
| 93 | + child: Row( | ||
| 94 | + mainAxisAlignment: MainAxisAlignment.spaceBetween, | ||
| 95 | + children: [ | ||
| 96 | + Text( | ||
| 97 | + '分享排菜单给客户时展示菜品价格', | ||
| 98 | + style: TextStyle( | ||
| 99 | + color: MyColours.color_515151, | ||
| 100 | + fontSize: font(16)), | ||
| 101 | + ), | ||
| 102 | + Spacer(), | ||
| 103 | + Container( | ||
| 104 | + padding: EdgeInsets.symmetric( | ||
| 105 | + horizontal: w(7), vertical: w(4)), | ||
| 106 | + child: Image.asset( | ||
| 107 | + Utils.getImgPath(selectShowPrice | ||
| 108 | + ? 'swich_on' | ||
| 109 | + : 'swich_off'), | ||
| 110 | + width: w(44), | ||
| 111 | + ), | ||
| 112 | + ) | ||
| 113 | + // RoundButton( | ||
| 114 | + // text: '预览', | ||
| 115 | + // gradientStart: MyColours.color_ffffff, | ||
| 116 | + // gradientEnd: MyColours.color_ffffff, | ||
| 117 | + // borderColor: MyColours.color_438E93, | ||
| 118 | + // textColor: MyColours.color_438E93, | ||
| 119 | + // radius: ScreenUtil().setWidth(22), | ||
| 120 | + // fontSize: 24, | ||
| 121 | + // width: w(72), | ||
| 122 | + // height: ScreenUtil().setWidth(44), | ||
| 123 | + // isBold: true, | ||
| 124 | + // onPressed: () { | ||
| 125 | + // NavigatorUtil.goMarkingPreviewPage(context); | ||
| 126 | + // }, | ||
| 127 | + // ), | ||
| 128 | + ]))), | ||
| 129 | + Padding( | ||
| 130 | + padding: EdgeInsets.only(left: w(16)), | ||
| 131 | + child: MyDivider(double.infinity, w(0.5), | ||
| 132 | + color: MyColours.color_E7E7E7)), | ||
| 133 | + VEmptyView(20), | ||
| 134 | + ], | ||
| 135 | + ), | ||
| 136 | + )), | ||
| 137 | + RoundButton( | ||
| 138 | + text: '保存', | ||
| 139 | + gradientStart: MyColours.color_199095, | ||
| 140 | + gradientEnd: MyColours.color_199095, | ||
| 141 | + margin: | ||
| 142 | + EdgeInsets.symmetric(horizontal: w(40), vertical: w(25)), | ||
| 143 | + // borderColor: MyColours.color_999999, | ||
| 144 | + radius: r(5), | ||
| 145 | + fontSize: 32, | ||
| 146 | + height: w(40), | ||
| 147 | + isBold: true, | ||
| 148 | + onPressed: () async { | ||
| 149 | + //调用接口 | ||
| 150 | + _setPriceShow(); | ||
| 151 | + }) | ||
| 152 | + ], | ||
| 153 | + )); | ||
| 154 | + } | ||
| 155 | +} |
| @@ -1755,4 +1755,22 @@ class NavigatorUtil { | @@ -1755,4 +1755,22 @@ class NavigatorUtil { | ||
| 1755 | "${Routes.day_order_page}?year=${year}&month=${month}&day=${day}&uid=${uid}&daylist=${FluroConvertUtils.object2string(daylist)}", | 1755 | "${Routes.day_order_page}?year=${year}&month=${month}&day=${day}&uid=${uid}&daylist=${FluroConvertUtils.object2string(daylist)}", |
| 1756 | replace: replace); | 1756 | replace: replace); |
| 1757 | } | 1757 | } |
| 1758 | + | ||
| 1759 | + /// 提前点餐配置页 | ||
| 1760 | + static Future<dynamic> goOrderSettingPage( | ||
| 1761 | + BuildContext context, { | ||
| 1762 | + replace = false, | ||
| 1763 | + }) { | ||
| 1764 | + return _navigateTo(context, "${Routes.order_setting_page}", | ||
| 1765 | + replace: replace); | ||
| 1766 | + } | ||
| 1767 | + | ||
| 1768 | + /// 客户通知配置页 | ||
| 1769 | + static Future<dynamic> goCustomerNoticeSettingPage( | ||
| 1770 | + BuildContext context, { | ||
| 1771 | + replace = false, | ||
| 1772 | + }) { | ||
| 1773 | + return _navigateTo(context, "${Routes.customer_notice_setting_page}", | ||
| 1774 | + replace: replace); | ||
| 1775 | + } | ||
| 1758 | } | 1776 | } |
| @@ -204,7 +204,9 @@ import '../pages/my/marketing_center/book_notification/marking_coupon_select_pag | @@ -204,7 +204,9 @@ import '../pages/my/marketing_center/book_notification/marking_coupon_select_pag | ||
| 204 | import '../pages/my/marketing_center/book_notification/marking_preview_page.dart'; | 204 | import '../pages/my/marketing_center/book_notification/marking_preview_page.dart'; |
| 205 | import '../pages/my/marketing_center/book_notification/marking_recharge_select_page.dart'; | 205 | import '../pages/my/marketing_center/book_notification/marking_recharge_select_page.dart'; |
| 206 | import '../pages/my/marketing_center/book_notification/store_introduce_page.dart'; | 206 | import '../pages/my/marketing_center/book_notification/store_introduce_page.dart'; |
| 207 | +import '../pages/my/marketing_center/customer_notice_setting_page.dart'; | ||
| 207 | import '../pages/my/marketing_center/marketing_center_home_page.dart'; | 208 | import '../pages/my/marketing_center/marketing_center_home_page.dart'; |
| 209 | +import '../pages/my/marketing_center/order_setting_page.dart'; | ||
| 208 | import '../pages/my/marketing_center/recharge/recharge_detail_page.dart'; | 210 | import '../pages/my/marketing_center/recharge/recharge_detail_page.dart'; |
| 209 | import '../pages/my/marketing_center/recharge/recharge_edit_page.dart'; | 211 | import '../pages/my/marketing_center/recharge/recharge_edit_page.dart'; |
| 210 | import '../pages/my/marketing_center/recharge/recharge_history_page.dart'; | 212 | import '../pages/my/marketing_center/recharge/recharge_history_page.dart'; |
| @@ -2899,3 +2901,33 @@ var dayOrderPageHandle = new Handler( | @@ -2899,3 +2901,33 @@ var dayOrderPageHandle = new Handler( | ||
| 2899 | child: DayOrderPage( | 2901 | child: DayOrderPage( |
| 2900 | year: year, month: month, day: day, uid: uid, daylist: daylist)); | 2902 | year: year, month: month, day: day, uid: uid, daylist: daylist)); |
| 2901 | }); | 2903 | }); |
| 2904 | + | ||
| 2905 | +//提前点餐配置页 | ||
| 2906 | +var orderSettingPageHandle = new Handler( | ||
| 2907 | + handlerFunc: (BuildContext context, Map<String, List<Object>> params) { | ||
| 2908 | + // String year = params["year"].first; | ||
| 2909 | + // String month = params["month"].first; | ||
| 2910 | + // String day = params["day"].first; | ||
| 2911 | + // String uid = params["uid"].first; | ||
| 2912 | + | ||
| 2913 | + // DayList daylist = DayList.fromJson(json | ||
| 2914 | + // .decode(FluroConvertUtils.fluroCnParamsDecode(params["daylist"].first))); | ||
| 2915 | + | ||
| 2916 | + return ChangeNotifierProvider<MarketingCenterProvider>( | ||
| 2917 | + create: (_) => MarketingCenterProvider(), child: OrderSettingPage()); | ||
| 2918 | +}); | ||
| 2919 | + | ||
| 2920 | +//客户通知配置页 | ||
| 2921 | +var customerNoticeSettingPageHandle = new Handler( | ||
| 2922 | + handlerFunc: (BuildContext context, Map<String, List<Object>> params) { | ||
| 2923 | + // String year = params["year"].first; | ||
| 2924 | + // String month = params["month"].first; | ||
| 2925 | + // String day = params["day"].first; | ||
| 2926 | + // String uid = params["uid"].first; | ||
| 2927 | + | ||
| 2928 | + // DayList daylist = DayList.fromJson(json | ||
| 2929 | + // .decode(FluroConvertUtils.fluroCnParamsDecode(params["daylist"].first))); | ||
| 2930 | + | ||
| 2931 | + return ChangeNotifierProvider<MarketingCenterProvider>( | ||
| 2932 | + create: (_) => MarketingCenterProvider(), child: CustomerNoticeSettingPage()); | ||
| 2933 | +}); |
| @@ -274,11 +274,13 @@ class Routes { | @@ -274,11 +274,13 @@ class Routes { | ||
| 274 | */ | 274 | */ |
| 275 | static String wine_setting_page = "/wine_setting_page"; // 存酒设置 | 275 | static String wine_setting_page = "/wine_setting_page"; // 存酒设置 |
| 276 | 276 | ||
| 277 | - | ||
| 278 | static String month_order_page = "/month_order_page"; // 月度订单 | 277 | static String month_order_page = "/month_order_page"; // 月度订单 |
| 279 | static String day_order_page = "/day_order_page"; // 日订单 | 278 | static String day_order_page = "/day_order_page"; // 日订单 |
| 280 | - | ||
| 281 | - | 279 | + |
| 280 | + static String order_setting_page = "/order_setting_page"; // 提前点菜配置页 | ||
| 281 | + | ||
| 282 | + static String customer_notice_setting_page = | ||
| 283 | + "/customer_notice_setting_page"; // 客户通知配置页 | ||
| 282 | 284 | ||
| 283 | static void configureRoutes(FluroRouter router) { | 285 | static void configureRoutes(FluroRouter router) { |
| 284 | router.notFoundHandler = new Handler( | 286 | router.notFoundHandler = new Handler( |
| @@ -515,11 +517,10 @@ class Routes { | @@ -515,11 +517,10 @@ class Routes { | ||
| 515 | 517 | ||
| 516 | router.define(wine_setting_page, handler: wineSettingPageHandle); | 518 | router.define(wine_setting_page, handler: wineSettingPageHandle); |
| 517 | 519 | ||
| 518 | - | 520 | + router.define(month_order_page, handler: monthOrderPageHandle); |
| 521 | + router.define(day_order_page, handler: dayOrderPageHandle); | ||
| 522 | + router.define(order_setting_page, handler: orderSettingPageHandle); | ||
| 523 | + router.define(customer_notice_setting_page, handler: customerNoticeSettingPageHandle); | ||
| 519 | 524 | ||
| 520 | - router.define(month_order_page, handler: monthOrderPageHandle); | ||
| 521 | - router.define(day_order_page, handler: dayOrderPageHandle); | ||
| 522 | - | ||
| 523 | - | ||
| 524 | } | 525 | } |
| 525 | } | 526 | } |
-
Please register or login to post a comment