Showing
14 changed files
with
757 additions
and
17 deletions
assets/comments.png
0 → 100644
3.55 KB
| @@ -319,6 +319,10 @@ class MarkMarketingModel { | @@ -319,6 +319,10 @@ class MarkMarketingModel { | ||
| 319 | 319 | ||
| 320 | List<CouponSunModel> couponDataList; | 320 | List<CouponSunModel> couponDataList; |
| 321 | 321 | ||
| 322 | + String isComments; | ||
| 323 | + String isCommentsCoupon; | ||
| 324 | + List<CouponSunModel> couponDataListComments; | ||
| 325 | + | ||
| 322 | MarkMarketingModel( | 326 | MarkMarketingModel( |
| 323 | {this.isArrival, | 327 | {this.isArrival, |
| 324 | this.isLink, | 328 | this.isLink, |
| @@ -328,7 +332,12 @@ class MarkMarketingModel { | @@ -328,7 +332,12 @@ class MarkMarketingModel { | ||
| 328 | this.logo, | 332 | this.logo, |
| 329 | this.wecomle, | 333 | this.wecomle, |
| 330 | this.isCoupon, | 334 | this.isCoupon, |
| 331 | - this.isRecharge}); | 335 | + this.isRecharge, |
| 336 | + this.rechargeData, | ||
| 337 | + this.couponDataList, | ||
| 338 | + this.isComments, | ||
| 339 | + this.isCommentsCoupon, | ||
| 340 | + this.couponDataListComments}); | ||
| 332 | 341 | ||
| 333 | MarkMarketingModel.fromJson(Map<String, dynamic> json) { | 342 | MarkMarketingModel.fromJson(Map<String, dynamic> json) { |
| 334 | isTranspond = json['is_transpond']; | 343 | isTranspond = json['is_transpond']; |
| @@ -365,6 +374,32 @@ class MarkMarketingModel { | @@ -365,6 +374,32 @@ class MarkMarketingModel { | ||
| 365 | } | 374 | } |
| 366 | } | 375 | } |
| 367 | } | 376 | } |
| 377 | + isComments = json['is_comments']; | ||
| 378 | + | ||
| 379 | + isCommentsCoupon = json['is_comments_coupon']; | ||
| 380 | + if (json['coupon_data_comments'] != null) { | ||
| 381 | + couponDataListComments = <CouponSunModel>[]; | ||
| 382 | + if (json['coupon_data_comments'] is Map) { | ||
| 383 | + //旧数据map | ||
| 384 | + couponDataListComments | ||
| 385 | + .add(CouponSunModel.fromJson(json['coupon_data_comments'])); | ||
| 386 | + } else { | ||
| 387 | + var couponData = convert.jsonDecode(json['coupon_data_comments']); | ||
| 388 | + if (couponData is List) { | ||
| 389 | + couponData.forEach((v) { | ||
| 390 | + couponDataListComments.add(CouponSunModel.fromJson(v)); | ||
| 391 | + }); | ||
| 392 | + } else if (couponData is Map) { | ||
| 393 | + // json['coupon_data'].forEach((v) { | ||
| 394 | + couponDataListComments.add(CouponSunModel.fromJson(couponData)); | ||
| 395 | + // }); | ||
| 396 | + } else { | ||
| 397 | + couponData.forEach((v) { | ||
| 398 | + couponDataListComments.add(v); | ||
| 399 | + }); | ||
| 400 | + } | ||
| 401 | + } | ||
| 402 | + } | ||
| 368 | } | 403 | } |
| 369 | 404 | ||
| 370 | Map<String, dynamic> toJson() { | 405 | Map<String, dynamic> toJson() { |
| @@ -380,6 +415,9 @@ class MarkMarketingModel { | @@ -380,6 +415,9 @@ class MarkMarketingModel { | ||
| 380 | data['is_recharge'] = this.isRecharge; | 415 | data['is_recharge'] = this.isRecharge; |
| 381 | data['recharge_data'] = this.rechargeData; | 416 | data['recharge_data'] = this.rechargeData; |
| 382 | data['coupon_data'] = this.couponDataList; | 417 | data['coupon_data'] = this.couponDataList; |
| 418 | + data['is_comments'] = this.isComments; | ||
| 419 | + data['is_comments_coupon'] = this.isCommentsCoupon; | ||
| 420 | + data['coupon_data_comments'] = this.couponDataListComments; | ||
| 383 | 421 | ||
| 384 | return data; | 422 | return data; |
| 385 | } | 423 | } |
| @@ -48,6 +48,9 @@ class _CouponSettingPageState extends State<CouponSettingPage> { | @@ -48,6 +48,9 @@ class _CouponSettingPageState extends State<CouponSettingPage> { | ||
| 48 | String rechargeContent = ''; | 48 | String rechargeContent = ''; |
| 49 | 49 | ||
| 50 | List<CouponSunModel> couponDataList = []; | 50 | List<CouponSunModel> couponDataList = []; |
| 51 | + bool isComments = false; //启用评价设置 | ||
| 52 | + bool isCommentsCoupon = false; //启用评价送券 | ||
| 53 | + List<CouponSunModel> couponDataListComments = []; | ||
| 51 | @override | 54 | @override |
| 52 | void initState() { | 55 | void initState() { |
| 53 | super.initState(); | 56 | super.initState(); |
| @@ -93,7 +96,18 @@ class _CouponSettingPageState extends State<CouponSettingPage> { | @@ -93,7 +96,18 @@ class _CouponSettingPageState extends State<CouponSettingPage> { | ||
| 93 | marketingCenterProvider.markDataModel.marketing.rechargeData; | 96 | marketingCenterProvider.markDataModel.marketing.rechargeData; |
| 94 | couponDataList = | 97 | couponDataList = |
| 95 | marketingCenterProvider.markDataModel.marketing.couponDataList ?? []; | 98 | marketingCenterProvider.markDataModel.marketing.couponDataList ?? []; |
| 96 | - | 99 | + couponDataListComments = marketingCenterProvider |
| 100 | + .markDataModel.marketing.couponDataListComments ?? | ||
| 101 | + []; | ||
| 102 | + isComments = | ||
| 103 | + marketingCenterProvider.markDataModel.marketing.isComments == '1' | ||
| 104 | + ? true | ||
| 105 | + : false; | ||
| 106 | + isCommentsCoupon = | ||
| 107 | + marketingCenterProvider.markDataModel.marketing.isCommentsCoupon == | ||
| 108 | + '1' | ||
| 109 | + ? true | ||
| 110 | + : false; | ||
| 97 | qiniuUrl = marketingCenterProvider.markDataModel.marketing.logo ?? null; | 111 | qiniuUrl = marketingCenterProvider.markDataModel.marketing.logo ?? null; |
| 98 | 112 | ||
| 99 | welcome = marketingCenterProvider.markDataModel.marketing.wecomle; | 113 | welcome = marketingCenterProvider.markDataModel.marketing.wecomle; |
| @@ -118,7 +132,10 @@ class _CouponSettingPageState extends State<CouponSettingPage> { | @@ -118,7 +132,10 @@ class _CouponSettingPageState extends State<CouponSettingPage> { | ||
| 118 | 'wecomle': welcome ?? '', | 132 | 'wecomle': welcome ?? '', |
| 119 | 'logo': qiniuUrl, | 133 | 'logo': qiniuUrl, |
| 120 | 'recharge_data': rechargeData, | 134 | 'recharge_data': rechargeData, |
| 121 | - 'coupon_data': json.encode(couponDataList) | 135 | + 'coupon_data': json.encode(couponDataList), |
| 136 | + 'is_comments': isComments ? '1' : '0', | ||
| 137 | + 'is_comments_coupon': isCommentsCoupon ? '1' : '0', | ||
| 138 | + 'coupon_data_comments': json.encode(couponDataListComments), | ||
| 122 | }; | 139 | }; |
| 123 | Map<String, String> params = { | 140 | Map<String, String> params = { |
| 124 | 'sid': Provider.of<UserModel>(context, listen: false).user.sellerid, | 141 | 'sid': Provider.of<UserModel>(context, listen: false).user.sellerid, |
| @@ -372,16 +372,16 @@ class _CommentManageHomePageState extends State<CommentManageHomePage> { | @@ -372,16 +372,16 @@ class _CommentManageHomePageState extends State<CommentManageHomePage> { | ||
| 372 | itemBuilder: | 372 | itemBuilder: |
| 373 | (context, | 373 | (context, |
| 374 | index) { | 374 | index) { |
| 375 | - return Image | ||
| 376 | - .asset( | ||
| 377 | - Utils.getImgPath(index <= | 375 | + return CachedNetworkImage( |
| 376 | + imageUrl: index <= | ||
| 378 | int.parse(sunModel.grade) - 1 | 377 | int.parse(sunModel.grade) - 1 |
| 379 | - ? 'zwzp' | ||
| 380 | - : 'apple'), | 378 | + ? 'http://nosqn.colorcun.com/pinglun/p%20%283%29.png' |
| 379 | + : 'http://nosqn.colorcun.com/pinglun/p%20%284%29.png', | ||
| 381 | width: w( | 380 | width: w( |
| 382 | 15), | 381 | 15), |
| 383 | ); | 382 | ); |
| 384 | })), | 383 | })), |
| 384 | + HEmptyView(3), | ||
| 385 | Container( | 385 | Container( |
| 386 | padding: EdgeInsets | 386 | padding: EdgeInsets |
| 387 | .symmetric( | 387 | .symmetric( |
| @@ -58,6 +58,9 @@ class _MarkingInteractionPageState extends State<MarkingInteractionPage> { | @@ -58,6 +58,9 @@ class _MarkingInteractionPageState extends State<MarkingInteractionPage> { | ||
| 58 | String rechargeContent = ''; | 58 | String rechargeContent = ''; |
| 59 | 59 | ||
| 60 | List<CouponSunModel> couponDataList = []; | 60 | List<CouponSunModel> couponDataList = []; |
| 61 | + bool isComments = false; //启用评价设置 | ||
| 62 | + bool isCommentsCoupon = false; //启用评价送券 | ||
| 63 | + List<CouponSunModel> couponDataListComments = []; | ||
| 61 | List<RechargeListSunModel> rechargeListCanUse = []; | 64 | List<RechargeListSunModel> rechargeListCanUse = []; |
| 62 | ScrollController controller = ScrollController(); | 65 | ScrollController controller = ScrollController(); |
| 63 | 66 | ||
| @@ -162,6 +165,18 @@ class _MarkingInteractionPageState extends State<MarkingInteractionPage> { | @@ -162,6 +165,18 @@ class _MarkingInteractionPageState extends State<MarkingInteractionPage> { | ||
| 162 | marketingCenterProvider.markDataModel.marketing.rechargeData; | 165 | marketingCenterProvider.markDataModel.marketing.rechargeData; |
| 163 | couponDataList = | 166 | couponDataList = |
| 164 | marketingCenterProvider.markDataModel.marketing.couponDataList ?? []; | 167 | marketingCenterProvider.markDataModel.marketing.couponDataList ?? []; |
| 168 | + couponDataListComments = marketingCenterProvider | ||
| 169 | + .markDataModel.marketing.couponDataListComments ?? | ||
| 170 | + []; | ||
| 171 | + isComments = | ||
| 172 | + marketingCenterProvider.markDataModel.marketing.isComments == '1' | ||
| 173 | + ? true | ||
| 174 | + : false; | ||
| 175 | + isCommentsCoupon = | ||
| 176 | + marketingCenterProvider.markDataModel.marketing.isCommentsCoupon == | ||
| 177 | + '1' | ||
| 178 | + ? true | ||
| 179 | + : false; | ||
| 165 | 180 | ||
| 166 | _uploadImageProvider.firstImage.qiniuUrl = | 181 | _uploadImageProvider.firstImage.qiniuUrl = |
| 167 | marketingCenterProvider.markDataModel.marketing.logo ?? null; | 182 | marketingCenterProvider.markDataModel.marketing.logo ?? null; |
| @@ -1122,7 +1137,10 @@ class _MarkingInteractionPageState extends State<MarkingInteractionPage> { | @@ -1122,7 +1137,10 @@ class _MarkingInteractionPageState extends State<MarkingInteractionPage> { | ||
| 1122 | 'wecomle': welcomeTextC.text ?? '', | 1137 | 'wecomle': welcomeTextC.text ?? '', |
| 1123 | 'logo': _uploadImageProvider.firstImage.qiniuUrl, | 1138 | 'logo': _uploadImageProvider.firstImage.qiniuUrl, |
| 1124 | 'recharge_data': rechargeData, | 1139 | 'recharge_data': rechargeData, |
| 1125 | - 'coupon_data': json.encode(couponDataList) | 1140 | + 'coupon_data': json.encode(couponDataList), |
| 1141 | + 'is_comments': isComments ? '1' : '0', | ||
| 1142 | + 'is_comments_coupon': isCommentsCoupon ? '1' : '0', | ||
| 1143 | + 'coupon_data_comments': json.encode(couponDataListComments), | ||
| 1126 | }; | 1144 | }; |
| 1127 | Map<String, String> params = { | 1145 | Map<String, String> params = { |
| 1128 | 'sid': Provider.of<UserModel>(context, listen: false) | 1146 | 'sid': Provider.of<UserModel>(context, listen: false) |
| @@ -451,13 +451,13 @@ class _MarkingPreviewPageState extends State<MarkingPreviewPage> { | @@ -451,13 +451,13 @@ class _MarkingPreviewPageState extends State<MarkingPreviewPage> { | ||
| 451 | margin: EdgeInsets.symmetric(horizontal: w(20)), | 451 | margin: EdgeInsets.symmetric(horizontal: w(20)), |
| 452 | padding: EdgeInsets.symmetric(horizontal: w(15), vertical: w(12)), | 452 | padding: EdgeInsets.symmetric(horizontal: w(15), vertical: w(12)), |
| 453 | decoration: BoxDecoration( | 453 | decoration: BoxDecoration( |
| 454 | - color: MyColours.color_d9d9d9, | 454 | + color: MyColours.color_F8F9FD, |
| 455 | borderRadius: BorderRadius.circular(r(5))), | 455 | borderRadius: BorderRadius.circular(r(5))), |
| 456 | child: Row( | 456 | child: Row( |
| 457 | children: [ | 457 | children: [ |
| 458 | Image.asset( | 458 | Image.asset( |
| 459 | Utils.getImgPath('location_blue'), | 459 | Utils.getImgPath('location_blue'), |
| 460 | - width: w(36), | 460 | + width: w(30), |
| 461 | ), | 461 | ), |
| 462 | HEmptyView(28), | 462 | HEmptyView(28), |
| 463 | Expanded( | 463 | Expanded( |
| @@ -1539,6 +1539,33 @@ class _MarkingPreviewPageState extends State<MarkingPreviewPage> { | @@ -1539,6 +1539,33 @@ class _MarkingPreviewPageState extends State<MarkingPreviewPage> { | ||
| 1539 | '1') | 1539 | '1') |
| 1540 | ? _rechargeWiddget() | 1540 | ? _rechargeWiddget() |
| 1541 | : SizedBox(), | 1541 | : SizedBox(), |
| 1542 | + _marketingCenterProvider.markDataModel.marketing != null && | ||
| 1543 | + (_marketingCenterProvider | ||
| 1544 | + .markDataModel.marketing.isComments == | ||
| 1545 | + '1') | ||
| 1546 | + ? Container( | ||
| 1547 | + padding: EdgeInsets.symmetric( | ||
| 1548 | + horizontal: w(20), vertical: w(8)), | ||
| 1549 | + child: Row( | ||
| 1550 | + mainAxisAlignment: MainAxisAlignment.spaceBetween, | ||
| 1551 | + children: [ | ||
| 1552 | + Text( | ||
| 1553 | + _marketingCenterProvider.markDataModel | ||
| 1554 | + .marketing.isCommentsCoupon == | ||
| 1555 | + '1' | ||
| 1556 | + ? '想吐槽?戳这里填写意见反馈赢好礼!-->' | ||
| 1557 | + : '想吐槽?戳这里填写意见!-->', | ||
| 1558 | + style: TextStyle( | ||
| 1559 | + color: MyColours.color_000000, | ||
| 1560 | + fontSize: font(14)), | ||
| 1561 | + ), | ||
| 1562 | + Image.asset( | ||
| 1563 | + Utils.getImgPath('comments'), | ||
| 1564 | + width: w(30), | ||
| 1565 | + ) | ||
| 1566 | + ], | ||
| 1567 | + )) | ||
| 1568 | + : SizedBox(), | ||
| 1542 | _marketingCenterProvider.markDataModel.marketing != null | 1569 | _marketingCenterProvider.markDataModel.marketing != null |
| 1543 | ? _logoWidget() | 1570 | ? _logoWidget() |
| 1544 | : SizedBox() | 1571 | : SizedBox() |
| 1 | +import 'dart:convert'; | ||
| 2 | + | ||
| 3 | +import 'package:flutter/material.dart'; | ||
| 4 | +import 'package:flutter_screenutil/flutter_screenutil.dart'; | ||
| 5 | +import 'package:one_key/widgets/system_app_bar.dart'; | ||
| 6 | +import 'package:provider/provider.dart'; | ||
| 7 | + | ||
| 8 | +import '../../../models/coupon_model.dart'; | ||
| 9 | +import '../../../models/recharge_list_model.dart'; | ||
| 10 | +import '../../../provider/coupon_provider.dart'; | ||
| 11 | +import '../../../provider/marketing_center_provider.dart'; | ||
| 12 | +import '../../../provider/user_model.dart'; | ||
| 13 | +import '../../../res/colors.dart'; | ||
| 14 | +import '../../../route/navigator_util.dart'; | ||
| 15 | +import '../../../utils/screen_util.dart'; | ||
| 16 | +import '../../../utils/utils.dart'; | ||
| 17 | +import '../../../widgets/h_empty_view.dart'; | ||
| 18 | +import '../../../widgets/round_button.dart'; | ||
| 19 | +import '../../../widgets/v_empty_view.dart'; | ||
| 20 | + | ||
| 21 | +/** | ||
| 22 | + * 优惠券设置页面 | ||
| 23 | + * */ | ||
| 24 | + | ||
| 25 | +class CommentsSettingPage extends StatefulWidget { | ||
| 26 | + CommentsSettingPage({Key key}) : super(key: key); | ||
| 27 | + | ||
| 28 | + @override | ||
| 29 | + _CommentsSettingPageState createState() => _CommentsSettingPageState(); | ||
| 30 | +} | ||
| 31 | + | ||
| 32 | +class _CommentsSettingPageState extends State<CommentsSettingPage> { | ||
| 33 | + ScrollController controller = ScrollController(); | ||
| 34 | + CouponProvider couponProvider; | ||
| 35 | + MarketingCenterProvider marketingCenterProvider; | ||
| 36 | + bool isTranspond = false; //转发邀请函 | ||
| 37 | + bool isArrival = false; //确认到店 | ||
| 38 | + bool isOnlineBook = false; //在线预订 | ||
| 39 | + bool isOrder = false; //提前点餐 | ||
| 40 | + bool isLink = false; //充值优惠活动链接 | ||
| 41 | + bool isCoupon = false; // 代金券 | ||
| 42 | + bool isRecharge = false; //充值券 | ||
| 43 | + String welcome = ''; | ||
| 44 | + String qiniuUrl = ''; | ||
| 45 | + | ||
| 46 | + RechargeListSunModel rechargeData; | ||
| 47 | + String rechargeContent = ''; | ||
| 48 | + | ||
| 49 | + List<CouponSunModel> couponDataList = []; | ||
| 50 | + bool isComments = false; //启用评价设置 | ||
| 51 | + bool isCommentsCoupon = false; //启用评价送券 | ||
| 52 | + List<CouponSunModel> couponDataListComments = []; | ||
| 53 | + @override | ||
| 54 | + void initState() { | ||
| 55 | + super.initState(); | ||
| 56 | + WidgetsBinding.instance.addPostFrameCallback((_) async { | ||
| 57 | + _couponNetworkData(); | ||
| 58 | + getSellerTemplateConf(); | ||
| 59 | + }); | ||
| 60 | + } | ||
| 61 | + | ||
| 62 | + getSellerTemplateConf() async { | ||
| 63 | + bool success = await marketingCenterProvider.getSellerTemplateConf(context); | ||
| 64 | + if (success && marketingCenterProvider.markDataModel.marketing != null) { | ||
| 65 | + isTranspond = | ||
| 66 | + marketingCenterProvider.markDataModel.marketing.isTranspond == '1' | ||
| 67 | + ? true | ||
| 68 | + : false; | ||
| 69 | + | ||
| 70 | + isArrival = | ||
| 71 | + marketingCenterProvider.markDataModel.marketing.isArrival == '1' | ||
| 72 | + ? true | ||
| 73 | + : false; | ||
| 74 | + isOnlineBook = | ||
| 75 | + marketingCenterProvider.markDataModel.marketing.isOnlineBook == '1' | ||
| 76 | + ? true | ||
| 77 | + : false; | ||
| 78 | + isOrder = marketingCenterProvider.markDataModel.marketing.isOrder == '1' | ||
| 79 | + ? true | ||
| 80 | + : false; | ||
| 81 | + isLink = marketingCenterProvider.markDataModel.marketing.isLink == '1' | ||
| 82 | + ? true | ||
| 83 | + : false; | ||
| 84 | + | ||
| 85 | + isCoupon = marketingCenterProvider.markDataModel.marketing.isCoupon == '1' | ||
| 86 | + ? true | ||
| 87 | + : false; | ||
| 88 | + | ||
| 89 | + isRecharge = | ||
| 90 | + marketingCenterProvider.markDataModel.marketing.isRecharge == '1' | ||
| 91 | + ? true | ||
| 92 | + : false; | ||
| 93 | + | ||
| 94 | + rechargeData = | ||
| 95 | + marketingCenterProvider.markDataModel.marketing.rechargeData; | ||
| 96 | + couponDataList = | ||
| 97 | + marketingCenterProvider.markDataModel.marketing.couponDataList ?? []; | ||
| 98 | + | ||
| 99 | + couponDataListComments = marketingCenterProvider | ||
| 100 | + .markDataModel.marketing.couponDataListComments ?? | ||
| 101 | + []; | ||
| 102 | + | ||
| 103 | + isCommentsCoupon = | ||
| 104 | + marketingCenterProvider.markDataModel.marketing.isCommentsCoupon == | ||
| 105 | + '1' | ||
| 106 | + ? true | ||
| 107 | + : false; | ||
| 108 | + isComments = | ||
| 109 | + marketingCenterProvider.markDataModel.marketing.isComments == '1' | ||
| 110 | + ? true | ||
| 111 | + : false; | ||
| 112 | + | ||
| 113 | + qiniuUrl = marketingCenterProvider.markDataModel.marketing.logo ?? null; | ||
| 114 | + | ||
| 115 | + welcome = marketingCenterProvider.markDataModel.marketing.wecomle; | ||
| 116 | + | ||
| 117 | + setState(() {}); | ||
| 118 | + } | ||
| 119 | + } | ||
| 120 | + | ||
| 121 | + ///优惠券设置 | ||
| 122 | + | ||
| 123 | + _setCouponShow() async { | ||
| 124 | + //接口 | ||
| 125 | + Map marketingData = { | ||
| 126 | + // 'isTranspond': isTranspond ? '1' : '0', //转发同行客人 | ||
| 127 | + 'is_transpond': '1', //转发同行客人 | ||
| 128 | + 'is_arrival': isArrival ? '1' : '0', //确认到店 | ||
| 129 | + 'is_online_book': isOnlineBook ? '1' : '0', //在线预订 | ||
| 130 | + 'is_order': isOrder ? '1' : '0', //去点餐 | ||
| 131 | + 'is_coupon': isCoupon ? '1' : '0', //代金券暂时 | ||
| 132 | + 'is_recharge': isRecharge ? '1' : '0', //充值券暂时 | ||
| 133 | + 'is_link': isLink ? '1' : '0', | ||
| 134 | + 'wecomle': welcome ?? '', | ||
| 135 | + 'logo': qiniuUrl, | ||
| 136 | + 'recharge_data': rechargeData, | ||
| 137 | + 'coupon_data': json.encode(couponDataList), | ||
| 138 | + 'is_comments': isComments ? '1' : '0', | ||
| 139 | + 'is_comments_coupon': isCommentsCoupon ? '1' : '0', | ||
| 140 | + 'coupon_data_comments': json.encode(couponDataListComments), | ||
| 141 | + }; | ||
| 142 | + Map<String, String> params = { | ||
| 143 | + 'sid': Provider.of<UserModel>(context, listen: false).user.sellerid, | ||
| 144 | + 'marketing': json.encode(marketingData) | ||
| 145 | + }; | ||
| 146 | + | ||
| 147 | + bool success = await marketingCenterProvider | ||
| 148 | + .setSellerTemplateConf(context, params, showLoading: true); | ||
| 149 | + if (success) { | ||
| 150 | + // bus.emit('refresh_coupon_list_f'); | ||
| 151 | + Utils.showToast('保存成功'); | ||
| 152 | + Navigator.pop(context); | ||
| 153 | + } | ||
| 154 | + } | ||
| 155 | + | ||
| 156 | + ///获取优惠券列表数据(status == 1) | ||
| 157 | + | ||
| 158 | + _couponNetworkData({bool isShowLoading = true}) async { | ||
| 159 | + Map<String, String> params = { | ||
| 160 | + "uid": Provider.of<UserModel>(context, listen: false).user.openid, | ||
| 161 | + }; | ||
| 162 | + params['status'] = '1'; | ||
| 163 | + | ||
| 164 | + await couponProvider.getCustomerSelectActivityMarking(context, params, | ||
| 165 | + isShowLoading: isShowLoading); | ||
| 166 | + if (couponDataListComments == null || couponDataListComments.length == 0) { | ||
| 167 | + if (couponProvider.couponListSelect != null && | ||
| 168 | + couponProvider.couponListSelect.length > 0) { | ||
| 169 | + couponDataListComments.add(couponProvider.couponListSelect[0]); | ||
| 170 | + } | ||
| 171 | + } | ||
| 172 | + setState(() {}); | ||
| 173 | + } | ||
| 174 | + | ||
| 175 | + ///标题 | ||
| 176 | + Widget _headItem(String title) { | ||
| 177 | + return Container( | ||
| 178 | + width: double.infinity, | ||
| 179 | + alignment: Alignment.centerLeft, | ||
| 180 | + decoration: BoxDecoration( | ||
| 181 | + border: Border( | ||
| 182 | + bottom: | ||
| 183 | + BorderSide(color: MyColours.color_E7E7E7, width: w(0.5)))), | ||
| 184 | + margin: EdgeInsets.only(left: w(16)), | ||
| 185 | + padding: EdgeInsets.only(top: w(12), bottom: w(12), right: w(16)), | ||
| 186 | + child: Text( | ||
| 187 | + title, | ||
| 188 | + style: TextStyle( | ||
| 189 | + color: MyColours.color_515151, fontSize: ScreenUtil().setWidth(32)), | ||
| 190 | + ), | ||
| 191 | + ); | ||
| 192 | + } | ||
| 193 | + | ||
| 194 | + ///优惠券 | ||
| 195 | + Widget _markingCupon({ | ||
| 196 | + VoidCallback onPressed, | ||
| 197 | + bool select = false, | ||
| 198 | + VoidCallback onPressedSelect, | ||
| 199 | + }) { | ||
| 200 | + return Container( | ||
| 201 | + margin: EdgeInsets.only(left: w(21), top: w(12), right: w(21)), | ||
| 202 | + child: Column( | ||
| 203 | + children: [ | ||
| 204 | + InkWell( | ||
| 205 | + onTap: onPressedSelect, | ||
| 206 | + child: Row( | ||
| 207 | + children: [ | ||
| 208 | + Image.asset( | ||
| 209 | + Utils.getImgPath(select ? 'f_select' : 'f_select_not'), | ||
| 210 | + width: w(20), | ||
| 211 | + ), | ||
| 212 | + HEmptyView(20), | ||
| 213 | + Text( | ||
| 214 | + '顾客点评后赠送优惠券', | ||
| 215 | + style: TextStyle( | ||
| 216 | + fontSize: font(14), color: MyColours.color_515151), | ||
| 217 | + ), | ||
| 218 | + Spacer(), | ||
| 219 | + RoundButton( | ||
| 220 | + text: '选择活动', | ||
| 221 | + width: w(72), | ||
| 222 | + height: w(22), | ||
| 223 | + gradientStart: MyColours.color_ffffff, | ||
| 224 | + gradientEnd: MyColours.color_ffffff, | ||
| 225 | + borderColor: MyColours.color_438E93, | ||
| 226 | + textColor: MyColours.color_438E93, | ||
| 227 | + radius: r(11), | ||
| 228 | + fontSize: 24, | ||
| 229 | + isBold: true, | ||
| 230 | + onPressed: onPressed, | ||
| 231 | + ) | ||
| 232 | + ], | ||
| 233 | + )), | ||
| 234 | + VEmptyView(20), | ||
| 235 | + ListView.builder( | ||
| 236 | + shrinkWrap: true, | ||
| 237 | + controller: controller, | ||
| 238 | + itemCount: couponDataListComments.length, | ||
| 239 | + itemBuilder: (BuildContext context, int index) { | ||
| 240 | + CouponSunModel couponData = couponDataListComments[index]; | ||
| 241 | + return _markingCuponItem( | ||
| 242 | + couponData.aname, | ||
| 243 | + _getCouponsDesc(couponData), | ||
| 244 | + couponData.price ?? '', | ||
| 245 | + couponData.use != null && couponData.use.isCash | ||
| 246 | + ? '${(double.parse(couponData.price) / double.parse(couponData.use.cash)) * 10}折' | ||
| 247 | + : '', | ||
| 248 | + '切换活动', | ||
| 249 | + select: isCommentsCoupon, onPressedSelect: () { | ||
| 250 | + setState(() { | ||
| 251 | + isCommentsCoupon = !isCommentsCoupon; | ||
| 252 | + }); | ||
| 253 | + }); | ||
| 254 | + }) | ||
| 255 | + ], | ||
| 256 | + ), | ||
| 257 | + ); | ||
| 258 | + } | ||
| 259 | + | ||
| 260 | + String _getCouponsDesc(couponData) { | ||
| 261 | + String couponsDesc = ''; | ||
| 262 | + if (couponData != null) { | ||
| 263 | + if (couponData.expDate == null) { | ||
| 264 | + couponsDesc = couponData.desc; | ||
| 265 | + } else { | ||
| 266 | + if (couponData.expDate.isNone) { | ||
| 267 | + couponsDesc = '无限制,' + couponData.desc ?? ''; | ||
| 268 | + } else if (couponData.expDate.isBirthday) { | ||
| 269 | + couponsDesc = '会员生日当天可用,' + couponData.desc ?? ''; | ||
| 270 | + } else if (couponData.expDate.isWeek) { | ||
| 271 | + couponsDesc = | ||
| 272 | + '${couponData.expDate.weekShow},' + couponData.desc ?? ''; | ||
| 273 | + } | ||
| 274 | + } | ||
| 275 | + } | ||
| 276 | + return couponsDesc; | ||
| 277 | + } | ||
| 278 | + | ||
| 279 | + ///优惠券 | ||
| 280 | + Widget _markingCuponItem( | ||
| 281 | + String title, | ||
| 282 | + String content, | ||
| 283 | + String subtile, | ||
| 284 | + String discount, | ||
| 285 | + String btnTitle, { | ||
| 286 | + VoidCallback onPressed, | ||
| 287 | + bool select = false, | ||
| 288 | + VoidCallback onPressedSelect, | ||
| 289 | + }) { | ||
| 290 | + return Container( | ||
| 291 | + margin: EdgeInsets.only(left: w(21), top: w(12), right: w(21)), | ||
| 292 | + child: Container( | ||
| 293 | + padding: EdgeInsets.all(w(12)), | ||
| 294 | + decoration: BoxDecoration( | ||
| 295 | + borderRadius: BorderRadiusDirectional.circular(r(8)), | ||
| 296 | + border: Border.all(width: w(1), color: MyColours.color_DBDBDB)), | ||
| 297 | + child: Row( | ||
| 298 | + mainAxisAlignment: MainAxisAlignment.spaceBetween, | ||
| 299 | + children: [ | ||
| 300 | + Expanded( | ||
| 301 | + child: Column( | ||
| 302 | + crossAxisAlignment: CrossAxisAlignment.start, | ||
| 303 | + children: [ | ||
| 304 | + Row( | ||
| 305 | + children: [ | ||
| 306 | + Container( | ||
| 307 | + constraints: BoxConstraints(maxWidth: w(150)), | ||
| 308 | + child: Text( | ||
| 309 | + title, | ||
| 310 | + style: TextStyle( | ||
| 311 | + fontSize: font(14), | ||
| 312 | + fontWeight: FontWeight.bold, | ||
| 313 | + color: MyColours.color_515151), | ||
| 314 | + )), | ||
| 315 | + HEmptyView(20), | ||
| 316 | + subtile != '' | ||
| 317 | + ? Text( | ||
| 318 | + '¥${subtile}', | ||
| 319 | + style: TextStyle( | ||
| 320 | + fontSize: font(7), | ||
| 321 | + fontWeight: FontWeight.bold, | ||
| 322 | + color: MyColours.color_E34D59), | ||
| 323 | + ) | ||
| 324 | + : SizedBox(), | ||
| 325 | + HEmptyView(10), | ||
| 326 | + discount != '' | ||
| 327 | + ? Container( | ||
| 328 | + padding: EdgeInsets.symmetric( | ||
| 329 | + horizontal: w(3), vertical: w(2)), | ||
| 330 | + decoration: BoxDecoration( | ||
| 331 | + borderRadius: BorderRadius.circular(r(3)), | ||
| 332 | + border: Border.all( | ||
| 333 | + width: w(0.5), | ||
| 334 | + color: MyColours.color_E34D59)), | ||
| 335 | + child: Text( | ||
| 336 | + discount, | ||
| 337 | + style: TextStyle( | ||
| 338 | + color: MyColours.color_E34D59, | ||
| 339 | + fontSize: font(7)), | ||
| 340 | + ), | ||
| 341 | + ) | ||
| 342 | + : SizedBox(), | ||
| 343 | + ], | ||
| 344 | + ), | ||
| 345 | + if (content != '') VEmptyView(20), | ||
| 346 | + if (content != '') | ||
| 347 | + Text( | ||
| 348 | + content, | ||
| 349 | + style: TextStyle( | ||
| 350 | + height: 1.2, | ||
| 351 | + fontSize: font(10), | ||
| 352 | + fontWeight: FontWeight.bold, | ||
| 353 | + color: MyColours.color_515151), | ||
| 354 | + ) | ||
| 355 | + ], | ||
| 356 | + )), | ||
| 357 | + ], | ||
| 358 | + ), | ||
| 359 | + ), | ||
| 360 | + ); | ||
| 361 | + } | ||
| 362 | + | ||
| 363 | + ///营销推广 | ||
| 364 | + Widget _markingItem( | ||
| 365 | + String selectTitle, | ||
| 366 | + String title, { | ||
| 367 | + bool select = false, | ||
| 368 | + VoidCallback onPressedSelect, | ||
| 369 | + }) { | ||
| 370 | + return Container( | ||
| 371 | + margin: EdgeInsets.only(left: w(18), top: w(12), right: w(18)), | ||
| 372 | + child: Column( | ||
| 373 | + children: [ | ||
| 374 | + InkWell( | ||
| 375 | + onTap: onPressedSelect, | ||
| 376 | + child: Row( | ||
| 377 | + children: [ | ||
| 378 | + Image.asset( | ||
| 379 | + Utils.getImgPath(select ? 'f_select' : 'f_select_not'), | ||
| 380 | + width: w(20), | ||
| 381 | + ), | ||
| 382 | + HEmptyView(20), | ||
| 383 | + Text( | ||
| 384 | + selectTitle, | ||
| 385 | + style: TextStyle( | ||
| 386 | + fontSize: font(14), color: MyColours.color_515151), | ||
| 387 | + ) | ||
| 388 | + ], | ||
| 389 | + )), | ||
| 390 | + VEmptyView(20), | ||
| 391 | + Container( | ||
| 392 | + height: w(76), | ||
| 393 | + padding: EdgeInsets.all(w(12)), | ||
| 394 | + decoration: BoxDecoration( | ||
| 395 | + borderRadius: BorderRadiusDirectional.circular(r(8)), | ||
| 396 | + border: | ||
| 397 | + Border.all(width: w(1), color: MyColours.color_DBDBDB)), | ||
| 398 | + child: Text( | ||
| 399 | + title, | ||
| 400 | + maxLines: 2, | ||
| 401 | + style: TextStyle( | ||
| 402 | + fontSize: font(14), | ||
| 403 | + // fontWeight: FontWeight.bold, | ||
| 404 | + color: MyColours.color_515151), | ||
| 405 | + )) | ||
| 406 | + ], | ||
| 407 | + ), | ||
| 408 | + ); | ||
| 409 | + } | ||
| 410 | + | ||
| 411 | + @override | ||
| 412 | + Widget build(BuildContext context) { | ||
| 413 | + couponProvider = Provider.of<CouponProvider>(context, listen: false); | ||
| 414 | + | ||
| 415 | + marketingCenterProvider = | ||
| 416 | + Provider.of<MarketingCenterProvider>(context, listen: false); | ||
| 417 | + return Scaffold( | ||
| 418 | + backgroundColor: MyColours.color_ffffff, | ||
| 419 | + appBar: SystemAppBar('用户评价设置'), | ||
| 420 | + body: Column( | ||
| 421 | + children: [ | ||
| 422 | + Expanded( | ||
| 423 | + child: SingleChildScrollView( | ||
| 424 | + controller: controller, | ||
| 425 | + child: Column( | ||
| 426 | + children: [ | ||
| 427 | + // _headItem('预订安排启用顾客反馈评价功能'), | ||
| 428 | + InkWell( | ||
| 429 | + onTap: () { | ||
| 430 | + setState(() { | ||
| 431 | + isComments = !isComments; | ||
| 432 | + }); | ||
| 433 | + }, | ||
| 434 | + child: Padding( | ||
| 435 | + padding: EdgeInsets.only( | ||
| 436 | + left: w(16), | ||
| 437 | + top: w(12), | ||
| 438 | + bottom: w(12), | ||
| 439 | + right: w(12)), | ||
| 440 | + child: Row( | ||
| 441 | + mainAxisAlignment: | ||
| 442 | + MainAxisAlignment.spaceBetween, | ||
| 443 | + children: [ | ||
| 444 | + Text( | ||
| 445 | + '预订安排启用顾客反馈评价功能', | ||
| 446 | + style: TextStyle( | ||
| 447 | + color: MyColours.color_515151, | ||
| 448 | + fontSize: font(16)), | ||
| 449 | + ), | ||
| 450 | + Spacer(), | ||
| 451 | + Container( | ||
| 452 | + padding: EdgeInsets.symmetric( | ||
| 453 | + horizontal: w(7), vertical: w(4)), | ||
| 454 | + child: Image.asset( | ||
| 455 | + Utils.getImgPath(isComments | ||
| 456 | + ? 'swich_on' | ||
| 457 | + : 'swich_off'), | ||
| 458 | + width: w(44), | ||
| 459 | + ), | ||
| 460 | + ) | ||
| 461 | + // RoundButton( | ||
| 462 | + // text: '预览', | ||
| 463 | + // gradientStart: MyColours.color_ffffff, | ||
| 464 | + // gradientEnd: MyColours.color_ffffff, | ||
| 465 | + // borderColor: MyColours.color_438E93, | ||
| 466 | + // textColor: MyColours.color_438E93, | ||
| 467 | + // radius: ScreenUtil().setWidth(22), | ||
| 468 | + // fontSize: 24, | ||
| 469 | + // width: w(72), | ||
| 470 | + // height: ScreenUtil().setWidth(44), | ||
| 471 | + // isBold: true, | ||
| 472 | + // onPressed: () { | ||
| 473 | + // NavigatorUtil.goMarkingPreviewPage(context); | ||
| 474 | + // }, | ||
| 475 | + // ), | ||
| 476 | + ]))), | ||
| 477 | + VEmptyView(24), | ||
| 478 | + couponProvider.couponListSelect != null && | ||
| 479 | + couponProvider.couponListSelect.length > 0 | ||
| 480 | + ? _markingCupon( | ||
| 481 | + select: isCommentsCoupon, | ||
| 482 | + onPressedSelect: () { | ||
| 483 | + setState(() { | ||
| 484 | + isCommentsCoupon = !isCommentsCoupon; | ||
| 485 | + }); | ||
| 486 | + }, | ||
| 487 | + onPressed: () async { | ||
| 488 | + //切换活动 | ||
| 489 | + Map temp = | ||
| 490 | + await NavigatorUtil.goMarkingCouponSelectPage( | ||
| 491 | + context, | ||
| 492 | + {'object': couponDataListComments}); | ||
| 493 | + if (temp['coupon'] != null) { | ||
| 494 | + couponDataListComments = temp['coupon']; | ||
| 495 | + | ||
| 496 | + setState(() {}); | ||
| 497 | + } | ||
| 498 | + }) | ||
| 499 | + : (couponProvider.couponListSelect == null || | ||
| 500 | + couponProvider.couponListSelect.length == 0) | ||
| 501 | + ? _markingItem( | ||
| 502 | + '顾客点评后赠送优惠券', | ||
| 503 | + '当前没有可用优惠券,请创建优惠券后再来尝试。', | ||
| 504 | + select: false, | ||
| 505 | + ) | ||
| 506 | + : SizedBox(), | ||
| 507 | + ], | ||
| 508 | + ), | ||
| 509 | + ), | ||
| 510 | + ), | ||
| 511 | + Container( | ||
| 512 | + color: MyColours.color_ffffff, | ||
| 513 | + padding: EdgeInsets.only( | ||
| 514 | + left: w(45), right: w(45), top: w(12), bottom: w(25)), | ||
| 515 | + child: RoundButton( | ||
| 516 | + text: '保存', | ||
| 517 | + gradientStart: MyColours.color_199095, | ||
| 518 | + gradientEnd: MyColours.color_199095, | ||
| 519 | + // borderColor: MyColours.color_999999, | ||
| 520 | + radius: r(5), | ||
| 521 | + fontSize: 34, | ||
| 522 | + height: w(40), | ||
| 523 | + isBold: true, | ||
| 524 | + onPressed: () async { | ||
| 525 | + _setCouponShow(); | ||
| 526 | + }, | ||
| 527 | + ), | ||
| 528 | + ) | ||
| 529 | + ], | ||
| 530 | + )); | ||
| 531 | + } | ||
| 532 | +} |
| @@ -269,6 +269,41 @@ class _MarketingCenterHomePageState extends State<MarketingCenterHomePage> { | @@ -269,6 +269,41 @@ class _MarketingCenterHomePageState extends State<MarketingCenterHomePage> { | ||
| 269 | VEmptyView(24), | 269 | VEmptyView(24), |
| 270 | InkWell( | 270 | InkWell( |
| 271 | onTap: () { | 271 | onTap: () { |
| 272 | + NavigatorUtil.goCommentsSettingPage(context); | ||
| 273 | + }, | ||
| 274 | + child: Padding( | ||
| 275 | + padding: EdgeInsets.only( | ||
| 276 | + left: w(16), | ||
| 277 | + top: w(12), | ||
| 278 | + bottom: w(12), | ||
| 279 | + right: w(12)), | ||
| 280 | + child: Row( | ||
| 281 | + children: [ | ||
| 282 | + Text( | ||
| 283 | + '用户评价反馈', | ||
| 284 | + style: TextStyle( | ||
| 285 | + color: MyColours.color_515151, | ||
| 286 | + fontSize: ScreenUtil().setWidth(32)), | ||
| 287 | + ), | ||
| 288 | + Spacer(), | ||
| 289 | + Container( | ||
| 290 | + padding: EdgeInsets.symmetric( | ||
| 291 | + horizontal: w(7), vertical: w(4)), | ||
| 292 | + child: Image.asset( | ||
| 293 | + "assets/arrow_right_new.png", | ||
| 294 | + width: ScreenUtil().setWidth(18), | ||
| 295 | + height: ScreenUtil().setWidth(32), | ||
| 296 | + ), | ||
| 297 | + ) | ||
| 298 | + ], | ||
| 299 | + ))), | ||
| 300 | + Padding( | ||
| 301 | + padding: EdgeInsets.only(left: w(16)), | ||
| 302 | + child: MyDivider(double.infinity, w(0.5), | ||
| 303 | + color: MyColours.color_E7E7E7)), | ||
| 304 | + VEmptyView(24), | ||
| 305 | + InkWell( | ||
| 306 | + onTap: () { | ||
| 272 | NavigatorUtil.goCustomerNoticeSettingPage(context); | 307 | NavigatorUtil.goCustomerNoticeSettingPage(context); |
| 273 | }, | 308 | }, |
| 274 | child: Padding( | 309 | child: Padding( |
| @@ -27,7 +27,6 @@ class OrderSettingPage extends StatefulWidget { | @@ -27,7 +27,6 @@ class OrderSettingPage extends StatefulWidget { | ||
| 27 | 27 | ||
| 28 | class _OrderSettingPageState extends State<OrderSettingPage> { | 28 | class _OrderSettingPageState extends State<OrderSettingPage> { |
| 29 | MarketingCenterProvider marketingCenterProvider; | 29 | MarketingCenterProvider marketingCenterProvider; |
| 30 | - | ||
| 31 | 30 | ||
| 32 | bool isTranspond = false; //转发邀请函 | 31 | bool isTranspond = false; //转发邀请函 |
| 33 | bool isArrival = false; //确认到店 | 32 | bool isArrival = false; //确认到店 |
| @@ -44,6 +43,9 @@ class _OrderSettingPageState extends State<OrderSettingPage> { | @@ -44,6 +43,9 @@ class _OrderSettingPageState extends State<OrderSettingPage> { | ||
| 44 | String welcome = ''; | 43 | String welcome = ''; |
| 45 | 44 | ||
| 46 | List<CouponSunModel> couponDataList = []; | 45 | List<CouponSunModel> couponDataList = []; |
| 46 | + bool isComments = false; //启用评价设置 | ||
| 47 | + bool isCommentsCoupon = false; //启用评价送券 | ||
| 48 | + List<CouponSunModel> couponDataListComments = []; | ||
| 47 | 49 | ||
| 48 | @override | 50 | @override |
| 49 | void initState() { | 51 | void initState() { |
| @@ -90,6 +92,18 @@ class _OrderSettingPageState extends State<OrderSettingPage> { | @@ -90,6 +92,18 @@ class _OrderSettingPageState extends State<OrderSettingPage> { | ||
| 90 | marketingCenterProvider.markDataModel.marketing.rechargeData; | 92 | marketingCenterProvider.markDataModel.marketing.rechargeData; |
| 91 | couponDataList = | 93 | couponDataList = |
| 92 | marketingCenterProvider.markDataModel.marketing.couponDataList ?? []; | 94 | marketingCenterProvider.markDataModel.marketing.couponDataList ?? []; |
| 95 | + couponDataListComments = marketingCenterProvider | ||
| 96 | + .markDataModel.marketing.couponDataListComments ?? | ||
| 97 | + []; | ||
| 98 | + isComments = | ||
| 99 | + marketingCenterProvider.markDataModel.marketing.isComments == '1' | ||
| 100 | + ? true | ||
| 101 | + : false; | ||
| 102 | + isCommentsCoupon = | ||
| 103 | + marketingCenterProvider.markDataModel.marketing.isCommentsCoupon == | ||
| 104 | + '1' | ||
| 105 | + ? true | ||
| 106 | + : false; | ||
| 93 | 107 | ||
| 94 | qiniuUrl = marketingCenterProvider.markDataModel.marketing.logo ?? null; | 108 | qiniuUrl = marketingCenterProvider.markDataModel.marketing.logo ?? null; |
| 95 | 109 | ||
| @@ -115,7 +129,10 @@ class _OrderSettingPageState extends State<OrderSettingPage> { | @@ -115,7 +129,10 @@ class _OrderSettingPageState extends State<OrderSettingPage> { | ||
| 115 | 'wecomle': welcome ?? '', | 129 | 'wecomle': welcome ?? '', |
| 116 | 'logo': qiniuUrl, | 130 | 'logo': qiniuUrl, |
| 117 | 'recharge_data': rechargeData, | 131 | 'recharge_data': rechargeData, |
| 118 | - 'coupon_data': json.encode(couponDataList) | 132 | + 'coupon_data': json.encode(couponDataList), |
| 133 | + 'is_comments': isComments ? '1' : '0', | ||
| 134 | + 'is_comments_coupon': isCommentsCoupon ? '1' : '0', | ||
| 135 | + 'coupon_data_comments': json.encode(couponDataListComments), | ||
| 119 | }; | 136 | }; |
| 120 | Map<String, String> params = { | 137 | Map<String, String> params = { |
| 121 | 'sid': Provider.of<UserModel>(context, listen: false).user.sellerid, | 138 | 'sid': Provider.of<UserModel>(context, listen: false).user.sellerid, |
| @@ -169,9 +186,8 @@ class _OrderSettingPageState extends State<OrderSettingPage> { | @@ -169,9 +186,8 @@ class _OrderSettingPageState extends State<OrderSettingPage> { | ||
| 169 | padding: EdgeInsets.symmetric( | 186 | padding: EdgeInsets.symmetric( |
| 170 | horizontal: w(7), vertical: w(4)), | 187 | horizontal: w(7), vertical: w(4)), |
| 171 | child: Image.asset( | 188 | child: Image.asset( |
| 172 | - Utils.getImgPath(isOrder | ||
| 173 | - ? 'swich_on' | ||
| 174 | - : 'swich_off'), | 189 | + Utils.getImgPath( |
| 190 | + isOrder ? 'swich_on' : 'swich_off'), | ||
| 175 | width: w(44), | 191 | width: w(44), |
| 176 | ), | 192 | ), |
| 177 | ) | 193 | ) |
| @@ -48,6 +48,9 @@ class _RechargeSettingPageState extends State<RechargeSettingPage> { | @@ -48,6 +48,9 @@ class _RechargeSettingPageState extends State<RechargeSettingPage> { | ||
| 48 | 48 | ||
| 49 | List<CouponSunModel> couponDataList = []; | 49 | List<CouponSunModel> couponDataList = []; |
| 50 | List<RechargeListSunModel> rechargeListCanUse = []; | 50 | List<RechargeListSunModel> rechargeListCanUse = []; |
| 51 | + bool isComments = false; //启用评价设置 | ||
| 52 | + bool isCommentsCoupon = false; //启用评价送券 | ||
| 53 | + List<CouponSunModel> couponDataListComments = []; | ||
| 51 | @override | 54 | @override |
| 52 | void initState() { | 55 | void initState() { |
| 53 | super.initState(); | 56 | super.initState(); |
| @@ -93,6 +96,18 @@ class _RechargeSettingPageState extends State<RechargeSettingPage> { | @@ -93,6 +96,18 @@ class _RechargeSettingPageState extends State<RechargeSettingPage> { | ||
| 93 | marketingCenterProvider.markDataModel.marketing.rechargeData; | 96 | marketingCenterProvider.markDataModel.marketing.rechargeData; |
| 94 | couponDataList = | 97 | couponDataList = |
| 95 | marketingCenterProvider.markDataModel.marketing.couponDataList ?? []; | 98 | marketingCenterProvider.markDataModel.marketing.couponDataList ?? []; |
| 99 | + couponDataListComments = marketingCenterProvider | ||
| 100 | + .markDataModel.marketing.couponDataListComments ?? | ||
| 101 | + []; | ||
| 102 | + isComments = | ||
| 103 | + marketingCenterProvider.markDataModel.marketing.isComments == '1' | ||
| 104 | + ? true | ||
| 105 | + : false; | ||
| 106 | + isCommentsCoupon = | ||
| 107 | + marketingCenterProvider.markDataModel.marketing.isCommentsCoupon == | ||
| 108 | + '1' | ||
| 109 | + ? true | ||
| 110 | + : false; | ||
| 96 | 111 | ||
| 97 | qiniuUrl = marketingCenterProvider.markDataModel.marketing.logo ?? null; | 112 | qiniuUrl = marketingCenterProvider.markDataModel.marketing.logo ?? null; |
| 98 | 113 | ||
| @@ -118,7 +133,10 @@ class _RechargeSettingPageState extends State<RechargeSettingPage> { | @@ -118,7 +133,10 @@ class _RechargeSettingPageState extends State<RechargeSettingPage> { | ||
| 118 | 'wecomle': welcome ?? '', | 133 | 'wecomle': welcome ?? '', |
| 119 | 'logo': qiniuUrl, | 134 | 'logo': qiniuUrl, |
| 120 | 'recharge_data': rechargeData, | 135 | 'recharge_data': rechargeData, |
| 121 | - 'coupon_data': json.encode(couponDataList) | 136 | + 'coupon_data': json.encode(couponDataList), |
| 137 | + 'is_comments': isComments ? '1' : '0', | ||
| 138 | + 'is_comments_coupon': isCommentsCoupon ? '1' : '0', | ||
| 139 | + 'coupon_data_comments': json.encode(couponDataListComments), | ||
| 122 | }; | 140 | }; |
| 123 | Map<String, String> params = { | 141 | Map<String, String> params = { |
| 124 | 'sid': Provider.of<UserModel>(context, listen: false).user.sellerid, | 142 | 'sid': Provider.of<UserModel>(context, listen: false).user.sellerid, |
| @@ -1806,4 +1806,13 @@ class NavigatorUtil { | @@ -1806,4 +1806,13 @@ class NavigatorUtil { | ||
| 1806 | return _navigateTo(context, "${Routes.comment_manage_home_page}", | 1806 | return _navigateTo(context, "${Routes.comment_manage_home_page}", |
| 1807 | replace: replace); | 1807 | replace: replace); |
| 1808 | } | 1808 | } |
| 1809 | + | ||
| 1810 | + /// 客户通知配置页----评价配置页 | ||
| 1811 | + static Future<dynamic> goCommentsSettingPage( | ||
| 1812 | + BuildContext context, { | ||
| 1813 | + replace = false, | ||
| 1814 | + }) { | ||
| 1815 | + return _navigateTo(context, "${Routes.comments_setting_page}", | ||
| 1816 | + replace: replace); | ||
| 1817 | + } | ||
| 1809 | } | 1818 | } |
| @@ -206,6 +206,7 @@ import '../pages/my/marketing_center/book_notification/marking_coupon_select_pag | @@ -206,6 +206,7 @@ import '../pages/my/marketing_center/book_notification/marking_coupon_select_pag | ||
| 206 | import '../pages/my/marketing_center/book_notification/marking_preview_page.dart'; | 206 | import '../pages/my/marketing_center/book_notification/marking_preview_page.dart'; |
| 207 | import '../pages/my/marketing_center/book_notification/marking_recharge_select_page.dart'; | 207 | import '../pages/my/marketing_center/book_notification/marking_recharge_select_page.dart'; |
| 208 | import '../pages/my/marketing_center/book_notification/store_introduce_page.dart'; | 208 | import '../pages/my/marketing_center/book_notification/store_introduce_page.dart'; |
| 209 | +import '../pages/my/marketing_center/comments_setting_page.dart'; | ||
| 209 | import '../pages/my/marketing_center/customer_notice_setting_page.dart'; | 210 | import '../pages/my/marketing_center/customer_notice_setting_page.dart'; |
| 210 | import '../pages/my/marketing_center/marketing_center_home_page.dart'; | 211 | import '../pages/my/marketing_center/marketing_center_home_page.dart'; |
| 211 | import '../pages/my/marketing_center/order_setting_manager_page.dart'; | 212 | import '../pages/my/marketing_center/order_setting_manager_page.dart'; |
| @@ -3015,3 +3016,23 @@ var commentManageHomePageHandle = new Handler( | @@ -3015,3 +3016,23 @@ var commentManageHomePageHandle = new Handler( | ||
| 3015 | return ChangeNotifierProvider<CommentManageProvider>( | 3016 | return ChangeNotifierProvider<CommentManageProvider>( |
| 3016 | create: (_) => CommentManageProvider(), child: CommentManageHomePage()); | 3017 | create: (_) => CommentManageProvider(), child: CommentManageHomePage()); |
| 3017 | }); | 3018 | }); |
| 3019 | + | ||
| 3020 | + | ||
| 3021 | + | ||
| 3022 | + | ||
| 3023 | +//客户通知----评价配置页 | ||
| 3024 | +var commentsSettingPageHandle = new Handler( | ||
| 3025 | + handlerFunc: (BuildContext context, Map<String, List<Object>> params) { | ||
| 3026 | + // String year = params["year"].first; | ||
| 3027 | + // String month = params["month"].first; | ||
| 3028 | + // String day = params["day"].first; | ||
| 3029 | + // String uid = params["uid"].first; | ||
| 3030 | + | ||
| 3031 | + // DayList daylist = DayList.fromJson(json | ||
| 3032 | + // .decode(FluroConvertUtils.fluroCnParamsDecode(params["daylist"].first))); | ||
| 3033 | + | ||
| 3034 | + return ChangeNotifierProvider<MarketingCenterProvider>( | ||
| 3035 | + create: (_) => MarketingCenterProvider(), | ||
| 3036 | + child: ChangeNotifierProvider<CouponProvider>( | ||
| 3037 | + create: (_) => CouponProvider(), child: CommentsSettingPage())); | ||
| 3038 | +}); |
| @@ -289,6 +289,10 @@ class Routes { | @@ -289,6 +289,10 @@ class Routes { | ||
| 289 | static String recharge_setting_page = "/recharge_setting_page"; // 充值优惠设置页 | 289 | static String recharge_setting_page = "/recharge_setting_page"; // 充值优惠设置页 |
| 290 | static String comment_manage_home_page = "/comment_manage_home_page"; // 评价管理 | 290 | static String comment_manage_home_page = "/comment_manage_home_page"; // 评价管理 |
| 291 | 291 | ||
| 292 | + | ||
| 293 | + static String comments_setting_page = "/comments_setting_page"; // 评价管理设置 | ||
| 294 | + | ||
| 295 | + | ||
| 292 | static void configureRoutes(FluroRouter router) { | 296 | static void configureRoutes(FluroRouter router) { |
| 293 | router.notFoundHandler = new Handler( | 297 | router.notFoundHandler = new Handler( |
| 294 | handlerFunc: (BuildContext context, Map<String, List<String>> params) { | 298 | handlerFunc: (BuildContext context, Map<String, List<String>> params) { |
| @@ -538,5 +542,10 @@ class Routes { | @@ -538,5 +542,10 @@ class Routes { | ||
| 538 | router.define(recharge_setting_page, handler: rechargeSettingPageHandle); | 542 | router.define(recharge_setting_page, handler: rechargeSettingPageHandle); |
| 539 | router.define(comment_manage_home_page, | 543 | router.define(comment_manage_home_page, |
| 540 | handler: commentManageHomePageHandle); | 544 | handler: commentManageHomePageHandle); |
| 545 | + | ||
| 546 | + router.define(comments_setting_page, | ||
| 547 | + handler: commentsSettingPageHandle); | ||
| 548 | + | ||
| 549 | + | ||
| 541 | } | 550 | } |
| 542 | } | 551 | } |
-
Please register or login to post a comment