Commit 3b75f97fbb7f309bd9121e211b6a6163aae72fe9

Authored by wdn127929
1 parent 7cca3e39

存酒超期配置

@@ -60,6 +60,9 @@ class GetDzSellerConfSunModel { @@ -60,6 +60,9 @@ class GetDzSellerConfSunModel {
60 String depositPrice; 60 String depositPrice;
61 String liteStyle; 61 String liteStyle;
62 62
  63 + String storePushMeg;
  64 + String storePushSms;
  65 +
63 GetDzSellerConfSunModel( 66 GetDzSellerConfSunModel(
64 {this.id, 67 {this.id,
65 this.sid, 68 this.sid,
@@ -88,7 +91,9 @@ class GetDzSellerConfSunModel { @@ -88,7 +91,9 @@ class GetDzSellerConfSunModel {
88 this.isShowRnamePhone, 91 this.isShowRnamePhone,
89 this.isShowNoticeDeposit, 92 this.isShowNoticeDeposit,
90 this.depositPrice, 93 this.depositPrice,
91 - this.liteStyle}); 94 + this.liteStyle,
  95 + this.storePushMeg,
  96 + this.storePushSms});
92 97
93 GetDzSellerConfSunModel.fromJson(Map<String, dynamic> json) { 98 GetDzSellerConfSunModel.fromJson(Map<String, dynamic> json) {
94 id = json['id']; 99 id = json['id'];
@@ -131,6 +136,9 @@ class GetDzSellerConfSunModel { @@ -131,6 +136,9 @@ class GetDzSellerConfSunModel {
131 isShowNoticeDeposit = json['is_show_notice_deposit']; 136 isShowNoticeDeposit = json['is_show_notice_deposit'];
132 depositPrice = json['deposit_price']; 137 depositPrice = json['deposit_price'];
133 liteStyle = json['lite_style']; 138 liteStyle = json['lite_style'];
  139 +
  140 + storePushMeg = json['store_push_meg'];
  141 + storePushSms = json['store_push_sms'];
134 } 142 }
135 143
136 Map<String, dynamic> toJson() { 144 Map<String, dynamic> toJson() {
@@ -165,7 +173,8 @@ class GetDzSellerConfSunModel { @@ -165,7 +173,8 @@ class GetDzSellerConfSunModel {
165 data['is_show_notice_deposit'] = this.isShowNoticeDeposit; 173 data['is_show_notice_deposit'] = this.isShowNoticeDeposit;
166 data['deposit_price'] = this.depositPrice; 174 data['deposit_price'] = this.depositPrice;
167 data['lite_style'] = this.liteStyle; 175 data['lite_style'] = this.liteStyle;
168 - 176 + data['store_push_meg'] = this.storePushMeg;
  177 + data['store_push_sms'] = this.storePushSms;
169 return data; 178 return data;
170 } 179 }
171 } 180 }
@@ -394,6 +394,9 @@ class HttpUrl { @@ -394,6 +394,9 @@ class HttpUrl {
394 static const String set_confing = 394 static const String set_confing =
395 "?service=App.Reserve.SetConfing"; // 设置订座商家配置信息 395 "?service=App.Reserve.SetConfing"; // 设置订座商家配置信息
396 396
  397 + static const String set_confings =
  398 + "?service=App.Reserve.SetConfings"; // 一次设置多个订座商家配置信息
  399 +
397 // static const String send_vc_code = 400 // static const String send_vc_code =
398 // "?service=App.SendSMS.SendVcCode"; // 向指定手机号码发送验证码 401 // "?service=App.SendSMS.SendVcCode"; // 向指定手机号码发送验证码
399 402
@@ -565,4 +568,9 @@ class HttpUrl { @@ -565,4 +568,9 @@ class HttpUrl {
565 static const String qiniu_delete_img = 568 static const String qiniu_delete_img =
566 "?service=App.Qiniu.DeleteImg"; // 删除七牛图片资源 569 "?service=App.Qiniu.DeleteImg"; // 删除七牛图片资源
567 570
  571 + static const get_store_wine_sai_you_text =
  572 + "?service=App.Reserve.GetStoreWineSaiYouText"; // 存酒短信可变内容
  573 + static const set_store_wine_sai_you_text =
  574 + "?service=App.Reserve.SetStoreWineSaiYouText"; // 配置商家存酒短信可变内容
  575 +
568 } 576 }
@@ -7,6 +7,7 @@ import 'package:one_key/widgets/system_app_bar.dart'; @@ -7,6 +7,7 @@ import 'package:one_key/widgets/system_app_bar.dart';
7 import 'package:provider/provider.dart'; 7 import 'package:provider/provider.dart';
8 8
9 import '../../../provider/customer_provider.dart'; 9 import '../../../provider/customer_provider.dart';
  10 +import '../../../provider/menu_provider.dart';
10 import '../../../res/colors.dart'; 11 import '../../../res/colors.dart';
11 import '../../../route/navigator_util.dart'; 12 import '../../../route/navigator_util.dart';
12 import '../../../utils/dialog_util.dart'; 13 import '../../../utils/dialog_util.dart';
@@ -36,12 +37,14 @@ class _WineSettingMsgPageState extends State<WineSettingMsgPage> { @@ -36,12 +37,14 @@ class _WineSettingMsgPageState extends State<WineSettingMsgPage> {
36 bool isUse = false; 37 bool isUse = false;
37 String youhui = '选择优惠'; 38 String youhui = '选择优惠';
38 int couponSelectIndex = 0; 39 int couponSelectIndex = 0;
  40 + MenuManageProvider menuManageProvider;
39 41
40 @override 42 @override
41 void initState() { 43 void initState() {
42 super.initState(); 44 super.initState();
43 WidgetsBinding.instance.addPostFrameCallback((_) async { 45 WidgetsBinding.instance.addPostFrameCallback((_) async {
44 _couponNetworkData(); 46 _couponNetworkData();
  47 + _getStoreWineSaiYouText();
45 }); 48 });
46 bus.on('refresh_wine_msg', (arg) { 49 bus.on('refresh_wine_msg', (arg) {
47 _couponNetworkData(); 50 _couponNetworkData();
@@ -54,6 +57,26 @@ class _WineSettingMsgPageState extends State<WineSettingMsgPage> { @@ -54,6 +57,26 @@ class _WineSettingMsgPageState extends State<WineSettingMsgPage> {
54 bus.off('refresh_wine_msg'); 57 bus.off('refresh_wine_msg');
55 } 58 }
56 59
  60 + _getStoreWineSaiYouText() async {
  61 + String text = await menuManageProvider.getStoreWineSaiYouText(context);
  62 + if (text != null && text.trim().length > 0) {
  63 + controller.text = text;
  64 + setState(() {});
  65 + }
  66 + }
  67 +
  68 + _setStoreWineSaiYouText() async {
  69 + Map<String, dynamic> params = {
  70 + 'sid': Provider.of<UserModel>(context, listen: false).user.sellerid,
  71 + 'notetext': controller.text.trim()
  72 + };
  73 + bool success =
  74 + await menuManageProvider.setStoreWineSaiYouText(context, params);
  75 + if (success) {
  76 + Navigator.pop(context);
  77 + }
  78 + }
  79 +
57 ///消费券 80 ///消费券
58 _couponNetworkData({bool isShowLoading = true}) async { 81 _couponNetworkData({bool isShowLoading = true}) async {
59 // customerMakingProvider.couponSelectIndex = 0; 82 // customerMakingProvider.couponSelectIndex = 0;
@@ -145,8 +168,10 @@ class _WineSettingMsgPageState extends State<WineSettingMsgPage> { @@ -145,8 +168,10 @@ class _WineSettingMsgPageState extends State<WineSettingMsgPage> {
145 @override 168 @override
146 Widget build(BuildContext context) { 169 Widget build(BuildContext context) {
147 customerProvider = Provider.of<CustomerProvider>(context, listen: true); 170 customerProvider = Provider.of<CustomerProvider>(context, listen: true);
  171 +
  172 + menuManageProvider = Provider.of<MenuManageProvider>(context, listen: true);
148 return Scaffold( 173 return Scaffold(
149 - backgroundColor: MyColours.color_ffffff, 174 + backgroundColor: MyColours.color_ffffff,
150 appBar: SystemAppBar('存酒超期通知短信内容设置'), 175 appBar: SystemAppBar('存酒超期通知短信内容设置'),
151 body: Column(children: [ 176 body: Column(children: [
152 Expanded( 177 Expanded(
@@ -381,6 +406,11 @@ class _WineSettingMsgPageState extends State<WineSettingMsgPage> { @@ -381,6 +406,11 @@ class _WineSettingMsgPageState extends State<WineSettingMsgPage> {
381 onPressed: () { 406 onPressed: () {
382 //群发短信 407 //群发短信
383 // _createMarketing(); 408 // _createMarketing();
  409 + // if (controller.text.trim().length == 0) {
  410 + // Utils.showToast('请编辑短信内容后再保存!');
  411 + // return;
  412 + // }
  413 + _setStoreWineSaiYouText();
384 }, 414 },
385 )), 415 )),
386 ], 416 ],
@@ -33,8 +33,8 @@ class _WineSettingPageState extends State<WineSettingPage> { @@ -33,8 +33,8 @@ class _WineSettingPageState extends State<WineSettingPage> {
33 FocusNode dayF = FocusNode(); 33 FocusNode dayF = FocusNode();
34 bool swich = true; 34 bool swich = true;
35 35
36 - bool swichNotice = true; //推送消息  
37 - bool swichMsg = true; //发短信 36 + bool swichNotice = false; //推送消息
  37 + bool swichMsg = false; //发短信
38 MenuManageProvider menuManageProvider; 38 MenuManageProvider menuManageProvider;
39 39
40 @override 40 @override
@@ -51,6 +51,13 @@ class _WineSettingPageState extends State<WineSettingPage> { @@ -51,6 +51,13 @@ class _WineSettingPageState extends State<WineSettingPage> {
51 if (success) { 51 if (success) {
52 swich = 52 swich =
53 menuManageProvider.dzSellerConfModel.isStoreSms == '0' ? false : true; 53 menuManageProvider.dzSellerConfModel.isStoreSms == '0' ? false : true;
  54 +
  55 + swichNotice = menuManageProvider.dzSellerConfModel.storePushMeg == '1'
  56 + ? true
  57 + : false;
  58 + swichMsg = menuManageProvider.dzSellerConfModel.storePushSms == '1'
  59 + ? true
  60 + : false;
54 dayC.text = menuManageProvider.dzSellerConfModel.storeDate ?? ''; 61 dayC.text = menuManageProvider.dzSellerConfModel.storeDate ?? '';
55 setState(() {}); 62 setState(() {});
56 } 63 }
@@ -149,66 +156,71 @@ class _WineSettingPageState extends State<WineSettingPage> { @@ -149,66 +156,71 @@ class _WineSettingPageState extends State<WineSettingPage> {
149 } 156 }
150 157
151 ///获取经理数据 158 ///获取经理数据
152 - Future<bool> _setIsStoreSms() async { 159 + _setData() async {
  160 + Map<String, dynamic> data = {
  161 + "is_store_sms": swich ? '1' : '0',
  162 + "store_date": dayC.text.trim(),
  163 + "store_push_meg": swichNotice ? '1' : '0',
  164 + "store_push_sms": swichMsg ? '1' : '0'
  165 + };
153 Map<String, String> params = { 166 Map<String, String> params = {
154 'sid': Provider.of<UserModel>(context, listen: false).user.sellerid, 167 'sid': Provider.of<UserModel>(context, listen: false).user.sellerid,
155 - 'key': 'is_store_sms',  
156 - 'value': swich ? '1' : '0' 168 + 'data': jsonEncode(data),
157 }; 169 };
158 170
159 bool success = 171 bool success =
160 - await menuManageProvider.setConfing(context, params, needToast: false);  
161 - if (success) {  
162 - return true;  
163 - } else {  
164 - return false;  
165 - } 172 + await menuManageProvider.setConfings(context, params, needToast: true);
  173 + // if (success) {
  174 + // return true;
  175 + // } else {
  176 + // return false;
  177 + // }
166 } 178 }
167 179
168 /// 180 ///
169 - Future<bool> _setStoreDate() async {  
170 - Map<String, String> params = {  
171 - 'sid': Provider.of<UserModel>(context, listen: false).user.sellerid,  
172 - 'key': 'store_date',  
173 - 'value': dayC.text.trim()  
174 - }; 181 + // Future<bool> _setStoreDate() async {
  182 + // Map<String, String> params = {
  183 + // 'sid': Provider.of<UserModel>(context, listen: false).user.sellerid,
  184 + // 'key': 'store_date',
  185 + // 'value': dayC.text.trim()
  186 + // };
175 187
176 - bool success =  
177 - await menuManageProvider.setConfing(context, params, needToast: false);  
178 - if (success) {  
179 - return true;  
180 - } else {  
181 - return false;  
182 - }  
183 - } 188 + // bool success =
  189 + // await menuManageProvider.setConfing(context, params, needToast: false);
  190 + // if (success) {
  191 + // return true;
  192 + // } else {
  193 + // return false;
  194 + // }
  195 + // }
184 196
185 - _setData() async {  
186 - await Future.wait<bool>([_setIsStoreSms(), _setStoreDate()])  
187 - .then((results) async {  
188 - print(results[0]);  
189 - if (results[0] && results[1]) {  
190 - //都成功  
191 - Utils.showToast('设置成功');  
192 - } else {  
193 - if (results[0]) {  
194 - //取酒是否需要短信验证码成功  
195 - Utils.showToast('取酒需要提供短信验证码设置成功');  
196 - } else {  
197 - //取酒是否需要短信验证码成功失败  
198 - Utils.showToast('取酒需要提供短信验证码设置失败');  
199 - }  
200 - if (results[1]) {  
201 - //超期提醒天数成功  
202 - Utils.showToast('超期提醒天数设置成功');  
203 - } else {  
204 - //超期提醒天数失败  
205 - Utils.showToast('超期提醒天数设置失败');  
206 - }  
207 - }  
208 - }).catchError((e) {  
209 - print(e);  
210 - });  
211 - } 197 + // _setData() async {
  198 + // await Future.wait<bool>([_setIsStoreSms(), _setStoreDate()])
  199 + // .then((results) async {
  200 + // print(results[0]);
  201 + // if (results[0] && results[1]) {
  202 + // //都成功
  203 + // Utils.showToast('设置成功');
  204 + // } else {
  205 + // if (results[0]) {
  206 + // //取酒是否需要短信验证码成功
  207 + // Utils.showToast('取酒需要提供短信验证码设置成功');
  208 + // } else {
  209 + // //取酒是否需要短信验证码成功失败
  210 + // Utils.showToast('取酒需要提供短信验证码设置失败');
  211 + // }
  212 + // if (results[1]) {
  213 + // //超期提醒天数成功
  214 + // Utils.showToast('超期提醒天数设置成功');
  215 + // } else {
  216 + // //超期提醒天数失败
  217 + // Utils.showToast('超期提醒天数设置失败');
  218 + // }
  219 + // }
  220 + // }).catchError((e) {
  221 + // print(e);
  222 + // });
  223 + // }
212 224
213 @override 225 @override
214 Widget build(BuildContext context) { 226 Widget build(BuildContext context) {
@@ -259,100 +271,99 @@ class _WineSettingPageState extends State<WineSettingPage> { @@ -259,100 +271,99 @@ class _WineSettingPageState extends State<WineSettingPage> {
259 inputType: 271 inputType:
260 TextInputType.numberWithOptions(decimal: true))), 272 TextInputType.numberWithOptions(decimal: true))),
261 _divider(), 273 _divider(),
262 - // VEmptyView(20),  
263 - // InkWell(  
264 - // onTap: () {  
265 - // setState(() {  
266 - // swichNotice = !swichNotice;  
267 - // });  
268 - // },  
269 - // child: Container(  
270 - // height: w(48),  
271 - // padding: EdgeInsets.only(left: w(30), right: w(26)),  
272 - // child: Row(  
273 - // mainAxisAlignment: MainAxisAlignment.spaceBetween,  
274 - // children: [  
275 - // Text(  
276 - // '存酒超期时发送超期消息',  
277 - // style: TextStyle(  
278 - // fontSize: font(16),  
279 - // color: MyColours.color_515151),  
280 - // ),  
281 - // Image.asset(  
282 - // Utils.getImgPath(  
283 - // swichNotice ? 'swich_on' : 'swich_off'),  
284 - // width: w(44),  
285 - // )  
286 - // ],  
287 - // ),  
288 - // )),  
289 - // Padding(  
290 - // padding: EdgeInsets.only(left: w(15), right: w(10)),  
291 - // child: _divider(),  
292 - // ),  
293 - // VEmptyView(20),  
294 - // InkWell(  
295 - // onTap: () {  
296 - // setState(() {  
297 - // swichMsg = !swichMsg;  
298 - // });  
299 - // },  
300 - // child: Container(  
301 - // height: w(48),  
302 - // padding: EdgeInsets.only(left: w(30), right: w(26)),  
303 - // child: Row(  
304 - // mainAxisAlignment: MainAxisAlignment.spaceBetween,  
305 - // children: [  
306 - // Text(  
307 - // '存酒超期时自动给客户发送短信',  
308 - // style: TextStyle(  
309 - // fontSize: font(16),  
310 - // color: MyColours.color_515151),  
311 - // ),  
312 - // Image.asset(  
313 - // Utils.getImgPath(  
314 - // swichMsg ? 'swich_on' : 'swich_off'),  
315 - // width: w(44),  
316 - // )  
317 - // ],  
318 - // ),  
319 - // )),  
320 - // Padding(  
321 - // padding: EdgeInsets.only(left: w(15), right: w(10)),  
322 - // child: _divider(),  
323 - // ),  
324 - // VEmptyView(20),  
325 - // InkWell(  
326 - // onTap: () {  
327 - // NavigatorUtil.goWineSettingMsgPage(  
328 - // context);  
329 - // },  
330 - // child: Container(  
331 - // height: w(48),  
332 - // padding: EdgeInsets.only(left: w(30), right: w(26)),  
333 - // child: Row(  
334 - // mainAxisAlignment: MainAxisAlignment.spaceBetween,  
335 - // children: [  
336 - // Text(  
337 - // '存酒超期通知短信设置',  
338 - // style: TextStyle(  
339 - // color: MyColours.color_515151,  
340 - // fontSize: font(16)),  
341 - // ),  
342 - // Container(  
343 - // padding: EdgeInsets.symmetric(  
344 - // horizontal: w(11), vertical: w(4)),  
345 - // child: Image.asset(  
346 - // "assets/arrow_right_new.png",  
347 - // width: w(9),  
348 - // height: w(16),  
349 - // ),  
350 - // )  
351 - // ]))),  
352 - // Padding(  
353 - // padding: EdgeInsets.only(left: w(15), right: w(10)),  
354 - // child: _divider(),  
355 - // ), 274 + VEmptyView(20),
  275 + InkWell(
  276 + onTap: () {
  277 + setState(() {
  278 + swichNotice = !swichNotice;
  279 + });
  280 + },
  281 + child: Container(
  282 + height: w(48),
  283 + padding: EdgeInsets.only(left: w(30), right: w(26)),
  284 + child: Row(
  285 + mainAxisAlignment: MainAxisAlignment.spaceBetween,
  286 + children: [
  287 + Text(
  288 + '存酒超期时发送超期消息',
  289 + style: TextStyle(
  290 + fontSize: font(16),
  291 + color: MyColours.color_515151),
  292 + ),
  293 + Image.asset(
  294 + Utils.getImgPath(
  295 + swichNotice ? 'swich_on' : 'swich_off'),
  296 + width: w(44),
  297 + )
  298 + ],
  299 + ),
  300 + )),
  301 + Padding(
  302 + padding: EdgeInsets.only(left: w(15), right: w(10)),
  303 + child: _divider(),
  304 + ),
  305 + VEmptyView(20),
  306 + InkWell(
  307 + onTap: () {
  308 + setState(() {
  309 + swichMsg = !swichMsg;
  310 + });
  311 + },
  312 + child: Container(
  313 + height: w(48),
  314 + padding: EdgeInsets.only(left: w(30), right: w(26)),
  315 + child: Row(
  316 + mainAxisAlignment: MainAxisAlignment.spaceBetween,
  317 + children: [
  318 + Text(
  319 + '存酒超期时自动给客户发送短信',
  320 + style: TextStyle(
  321 + fontSize: font(16),
  322 + color: MyColours.color_515151),
  323 + ),
  324 + Image.asset(
  325 + Utils.getImgPath(
  326 + swichMsg ? 'swich_on' : 'swich_off'),
  327 + width: w(44),
  328 + )
  329 + ],
  330 + ),
  331 + )),
  332 + Padding(
  333 + padding: EdgeInsets.only(left: w(15), right: w(10)),
  334 + child: _divider(),
  335 + ),
  336 + VEmptyView(20),
  337 + InkWell(
  338 + onTap: () {
  339 + NavigatorUtil.goWineSettingMsgPage(context);
  340 + },
  341 + child: Container(
  342 + height: w(48),
  343 + padding: EdgeInsets.only(left: w(30), right: w(26)),
  344 + child: Row(
  345 + mainAxisAlignment: MainAxisAlignment.spaceBetween,
  346 + children: [
  347 + Text(
  348 + '存酒超期通知短信设置',
  349 + style: TextStyle(
  350 + color: MyColours.color_515151,
  351 + fontSize: font(16)),
  352 + ),
  353 + Container(
  354 + padding: EdgeInsets.symmetric(
  355 + horizontal: w(11), vertical: w(4)),
  356 + child: Image.asset(
  357 + "assets/arrow_right_new.png",
  358 + width: w(9),
  359 + height: w(16),
  360 + ),
  361 + )
  362 + ]))),
  363 + Padding(
  364 + padding: EdgeInsets.only(left: w(15), right: w(10)),
  365 + child: _divider(),
  366 + ),
356 ], 367 ],
357 )), 368 )),
358 ), 369 ),
@@ -455,6 +455,39 @@ class MarketingCenterProvider extends ChangeNotifier { @@ -455,6 +455,39 @@ class MarketingCenterProvider extends ChangeNotifier {
455 return false; 455 return false;
456 } 456 }
457 457
  458 + // 设置订座商家配置信息
  459 + Future<bool> setConfings(BuildContext context, Map<String, String> params,
  460 + {bool showLoading = true, bool needToast = true}) async {
  461 + BaseResp<dynamic> baseResp = await DioUtil()
  462 + .request<dynamic>(context, Method.post, HttpUrl.set_confings,
  463 + data: params, showLoading: showLoading)
  464 + .catchError((error) {
  465 + print(error.toString());
  466 + if (needToast) {
  467 + Utils.showToast('设置失败,请重试');
  468 + }
  469 +
  470 + return false;
  471 + });
  472 + if (baseResp.code == Constant.status_success) {
  473 + if (baseResp.data == 0 || baseResp.data == 1) {
  474 + if (needToast) {
  475 + Utils.showToast('设置成功');
  476 + }
  477 + return true;
  478 + } else {
  479 + if (needToast) {
  480 + Utils.showToast('设置失败,请重试');
  481 + }
  482 + }
  483 + } else {
  484 + if (needToast) {
  485 + Utils.showToast(baseResp.msg ?? '设置失败,请重试');
  486 + }
  487 + }
  488 + return false;
  489 + }
  490 +
458 // 设置订座商家配置信息 491 // 设置订座商家配置信息
459 Future<bool> setConfing(BuildContext context, Map<String, String> params, 492 Future<bool> setConfing(BuildContext context, Map<String, String> params,
460 {bool showLoading = true, bool needToast = true}) async { 493 {bool showLoading = true, bool needToast = true}) async {
@@ -170,6 +170,106 @@ class MenuManageProvider extends ChangeNotifier { @@ -170,6 +170,106 @@ class MenuManageProvider extends ChangeNotifier {
170 } 170 }
171 171
172 // 设置订座商家配置信息 172 // 设置订座商家配置信息
  173 + Future<bool> setConfings(BuildContext context, Map<String, String> params,
  174 + {bool showLoading = true, bool needToast = true}) async {
  175 + BaseResp<dynamic> baseResp = await DioUtil()
  176 + .request<dynamic>(context, Method.post, HttpUrl.set_confings,
  177 + data: params, showLoading: showLoading)
  178 + .catchError((error) {
  179 + print(error.toString());
  180 + if (needToast) {
  181 + Utils.showToast('设置失败,请重试');
  182 + }
  183 +
  184 + return false;
  185 + });
  186 + if (baseResp.code == Constant.status_success) {
  187 + if (baseResp.data == 0 || baseResp.data == 1) {
  188 + if (needToast) {
  189 + Utils.showToast('设置成功');
  190 + }
  191 + return true;
  192 + } else {
  193 + if (needToast) {
  194 + Utils.showToast('设置失败,请重试');
  195 + }
  196 + }
  197 + } else {
  198 + if (needToast) {
  199 + Utils.showToast(baseResp.msg ?? '设置失败,请重试');
  200 + }
  201 + }
  202 + return false;
  203 + }
  204 +
  205 + // 获取存酒短信可变内容
  206 + Future<String> getStoreWineSaiYouText(BuildContext context,
  207 + {bool showLoading = true, bool needToast = true}) async {
  208 + Map<String, String> params = {
  209 + 'sid': Provider.of<UserModel>(context,listen: false).user.sellerid
  210 + };
  211 + BaseResp<dynamic> baseResp = await DioUtil()
  212 + .request<dynamic>(
  213 + context, Method.post, HttpUrl.get_store_wine_sai_you_text,
  214 + data: params, showLoading: showLoading)
  215 + .catchError((error) {
  216 + print(error.toString());
  217 +
  218 + return '';
  219 + });
  220 + if (baseResp.code == Constant.status_success) {
  221 + if (baseResp.data is bool) {
  222 + //没有值
  223 +
  224 + } else {
  225 + return baseResp.data['notetext'];
  226 + }
  227 + } else {
  228 + // if (needToast) {
  229 + // Utils.showToast(baseResp.msg ?? '设置失败,请重试');
  230 + // }
  231 + }
  232 + return '';
  233 + }
  234 +
  235 +
  236 +
  237 + // 配置商家存酒短信可变内容
  238 + Future<bool> setStoreWineSaiYouText(BuildContext context, Map<String, dynamic> params,
  239 + {bool showLoading = true, bool needToast = true}) async {
  240 + BaseResp<dynamic> baseResp = await DioUtil()
  241 + .request<dynamic>(context, Method.post, HttpUrl.set_store_wine_sai_you_text,
  242 + data: params, showLoading: showLoading)
  243 + .catchError((error) {
  244 + print(error.toString());
  245 + if (needToast) {
  246 + Utils.showToast('设置失败,请重试');
  247 + }
  248 +
  249 + return false;
  250 + });
  251 + if (baseResp.code == Constant.status_success) {
  252 + if (baseResp.data is Map || baseResp.data == 0 || baseResp.data == 1) {
  253 + if (needToast) {
  254 + Utils.showToast('设置成功');
  255 + }
  256 +
  257 + return true;
  258 + } else {
  259 + if (needToast) {
  260 + Utils.showToast('设置失败,请重试');
  261 + }
  262 + }
  263 + } else {
  264 + if (needToast) {
  265 + Utils.showToast(baseResp.msg ?? '设置失败,请重试');
  266 + }
  267 + }
  268 + return false;
  269 + }
  270 +
  271 +
  272 + // 设置订座商家配置信息
173 Future<bool> setConfing(BuildContext context, Map<String, String> params, 273 Future<bool> setConfing(BuildContext context, Map<String, String> params,
174 {bool showLoading = true, bool needToast = true}) async { 274 {bool showLoading = true, bool needToast = true}) async {
175 BaseResp<dynamic> baseResp = await DioUtil() 275 BaseResp<dynamic> baseResp = await DioUtil()
@@ -409,7 +509,8 @@ class MenuManageProvider extends ChangeNotifier { @@ -409,7 +509,8 @@ class MenuManageProvider extends ChangeNotifier {
409 BuildContext context, Map<String, String> params, 509 BuildContext context, Map<String, String> params,
410 {showLoading = false}) async { 510 {showLoading = false}) async {
411 BaseResp<dynamic> baseResp = await DioUtil() 511 BaseResp<dynamic> baseResp = await DioUtil()
412 - .request<dynamic>(context, Method.post, HttpUrl.set_cookbook_class_by_id, 512 + .request<dynamic>(
  513 + context, Method.post, HttpUrl.set_cookbook_class_by_id,
413 data: params, showLoading: showLoading) 514 data: params, showLoading: showLoading)
414 .catchError((error) { 515 .catchError((error) {
415 print(error.toString()); 516 print(error.toString());