Showing
23 changed files
with
879 additions
and
321 deletions
assets/unit_del_black.png
0 → 100755
541 Bytes
assets/unit_del_white.png
0 → 100755
518 Bytes
| @@ -3,7 +3,7 @@ | @@ -3,7 +3,7 @@ | ||
| 3 | archiveVersion = 1; | 3 | archiveVersion = 1; |
| 4 | classes = { | 4 | classes = { |
| 5 | }; | 5 | }; |
| 6 | - objectVersion = 50; | 6 | + objectVersion = 46; |
| 7 | objects = { | 7 | objects = { |
| 8 | 8 | ||
| 9 | /* Begin PBXBuildFile section */ | 9 | /* Begin PBXBuildFile section */ |
| @@ -510,7 +510,7 @@ | @@ -510,7 +510,7 @@ | ||
| 510 | CODE_SIGN_ENTITLEMENTS = Runner/RunnerProfile.entitlements; | 510 | CODE_SIGN_ENTITLEMENTS = Runner/RunnerProfile.entitlements; |
| 511 | CODE_SIGN_IDENTITY = "Apple Development"; | 511 | CODE_SIGN_IDENTITY = "Apple Development"; |
| 512 | CODE_SIGN_STYLE = Automatic; | 512 | CODE_SIGN_STYLE = Automatic; |
| 513 | - CURRENT_PROJECT_VERSION = 466; | 513 | + CURRENT_PROJECT_VERSION = 476; |
| 514 | DEVELOPMENT_TEAM = 8J59HM8B82; | 514 | DEVELOPMENT_TEAM = 8J59HM8B82; |
| 515 | ENABLE_BITCODE = NO; | 515 | ENABLE_BITCODE = NO; |
| 516 | FLUTTER_BUILD_MODE = release; | 516 | FLUTTER_BUILD_MODE = release; |
| @@ -525,7 +525,7 @@ | @@ -525,7 +525,7 @@ | ||
| 525 | "$(inherited)", | 525 | "$(inherited)", |
| 526 | "$(PROJECT_DIR)/Flutter", | 526 | "$(PROJECT_DIR)/Flutter", |
| 527 | ); | 527 | ); |
| 528 | - MARKETING_VERSION = 4.6.6; | 528 | + MARKETING_VERSION = 4.8.0; |
| 529 | PRODUCT_BUNDLE_IDENTIFIER = com.naji.reserveLine; | 529 | PRODUCT_BUNDLE_IDENTIFIER = com.naji.reserveLine; |
| 530 | PRODUCT_NAME = Runner; | 530 | PRODUCT_NAME = Runner; |
| 531 | PROVISIONING_PROFILE_SPECIFIER = ""; | 531 | PROVISIONING_PROFILE_SPECIFIER = ""; |
| @@ -656,7 +656,7 @@ | @@ -656,7 +656,7 @@ | ||
| 656 | CODE_SIGN_ENTITLEMENTS = "Runner/一键订Debug.entitlements"; | 656 | CODE_SIGN_ENTITLEMENTS = "Runner/一键订Debug.entitlements"; |
| 657 | CODE_SIGN_IDENTITY = "Apple Development"; | 657 | CODE_SIGN_IDENTITY = "Apple Development"; |
| 658 | CODE_SIGN_STYLE = Automatic; | 658 | CODE_SIGN_STYLE = Automatic; |
| 659 | - CURRENT_PROJECT_VERSION = 466; | 659 | + CURRENT_PROJECT_VERSION = 476; |
| 660 | DEVELOPMENT_TEAM = 8J59HM8B82; | 660 | DEVELOPMENT_TEAM = 8J59HM8B82; |
| 661 | ENABLE_BITCODE = NO; | 661 | ENABLE_BITCODE = NO; |
| 662 | FLUTTER_BUILD_MODE = release; | 662 | FLUTTER_BUILD_MODE = release; |
| @@ -671,7 +671,7 @@ | @@ -671,7 +671,7 @@ | ||
| 671 | "$(inherited)", | 671 | "$(inherited)", |
| 672 | "$(PROJECT_DIR)/Flutter", | 672 | "$(PROJECT_DIR)/Flutter", |
| 673 | ); | 673 | ); |
| 674 | - MARKETING_VERSION = 4.6.6; | 674 | + MARKETING_VERSION = 4.8.0; |
| 675 | PRODUCT_BUNDLE_IDENTIFIER = com.naji.reserveLine; | 675 | PRODUCT_BUNDLE_IDENTIFIER = com.naji.reserveLine; |
| 676 | PRODUCT_NAME = Runner; | 676 | PRODUCT_NAME = Runner; |
| 677 | PROVISIONING_PROFILE_SPECIFIER = ""; | 677 | PROVISIONING_PROFILE_SPECIFIER = ""; |
| @@ -692,7 +692,7 @@ | @@ -692,7 +692,7 @@ | ||
| 692 | CODE_SIGN_ENTITLEMENTS = Runner/Runner.entitlements; | 692 | CODE_SIGN_ENTITLEMENTS = Runner/Runner.entitlements; |
| 693 | CODE_SIGN_IDENTITY = "Apple Development"; | 693 | CODE_SIGN_IDENTITY = "Apple Development"; |
| 694 | CODE_SIGN_STYLE = Automatic; | 694 | CODE_SIGN_STYLE = Automatic; |
| 695 | - CURRENT_PROJECT_VERSION = 466; | 695 | + CURRENT_PROJECT_VERSION = 476; |
| 696 | DEVELOPMENT_TEAM = 8J59HM8B82; | 696 | DEVELOPMENT_TEAM = 8J59HM8B82; |
| 697 | ENABLE_BITCODE = NO; | 697 | ENABLE_BITCODE = NO; |
| 698 | FLUTTER_BUILD_MODE = release; | 698 | FLUTTER_BUILD_MODE = release; |
| @@ -707,7 +707,7 @@ | @@ -707,7 +707,7 @@ | ||
| 707 | "$(inherited)", | 707 | "$(inherited)", |
| 708 | "$(PROJECT_DIR)/Flutter", | 708 | "$(PROJECT_DIR)/Flutter", |
| 709 | ); | 709 | ); |
| 710 | - MARKETING_VERSION = 4.6.6; | 710 | + MARKETING_VERSION = 4.8.0; |
| 711 | PRODUCT_BUNDLE_IDENTIFIER = com.naji.reserveLine; | 711 | PRODUCT_BUNDLE_IDENTIFIER = com.naji.reserveLine; |
| 712 | PRODUCT_NAME = Runner; | 712 | PRODUCT_NAME = Runner; |
| 713 | PROVISIONING_PROFILE_SPECIFIER = ""; | 713 | PROVISIONING_PROFILE_SPECIFIER = ""; |
| @@ -74,7 +74,7 @@ class GetDzSellerConfSunModel { | @@ -74,7 +74,7 @@ class GetDzSellerConfSunModel { | ||
| 74 | reserveMode = json['reserve_mode']; | 74 | reserveMode = json['reserve_mode']; |
| 75 | isDisplayDish = json['is_display_dish']; | 75 | isDisplayDish = json['is_display_dish']; |
| 76 | isNewTemplate = json['is_new_template']; | 76 | isNewTemplate = json['is_new_template']; |
| 77 | - cookStyle = AllCookStyle.fromJson(convert.json.decode(json['cook_style'])); | 77 | + cookStyle = json['cook_style'] == null ? null: AllCookStyle.fromJson(convert.json.decode(json['cook_style'])); |
| 78 | cdate = json['cdate']; | 78 | cdate = json['cdate']; |
| 79 | } | 79 | } |
| 80 | 80 |
| @@ -64,7 +64,9 @@ CookbookOneSunModel _$CookbookOneSunModelFromJson(Map<String, dynamic> json) { | @@ -64,7 +64,9 @@ CookbookOneSunModel _$CookbookOneSunModelFromJson(Map<String, dynamic> json) { | ||
| 64 | ?.toList(), | 64 | ?.toList(), |
| 65 | json['taste'] as String, | 65 | json['taste'] as String, |
| 66 | json['cooks'] as String, | 66 | json['cooks'] as String, |
| 67 | - DishCookStyle.fromJson(convert.json.decode(json['cook_style'])), | 67 | + json['cook_style'] == null |
| 68 | + ? null | ||
| 69 | + : DishCookStyle.fromJson(convert.json.decode(json['cook_style'])), | ||
| 68 | json['desc'] as String, | 70 | json['desc'] as String, |
| 69 | ); | 71 | ); |
| 70 | } | 72 | } |
| @@ -51,6 +51,8 @@ class RechargeListSunModel { | @@ -51,6 +51,8 @@ class RechargeListSunModel { | ||
| 51 | String isExamine; | 51 | String isExamine; |
| 52 | String cdate; | 52 | String cdate; |
| 53 | bool isCheck = false; | 53 | bool isCheck = false; |
| 54 | + String stime; | ||
| 55 | + String etime; | ||
| 54 | 56 | ||
| 55 | String get cdateStr { | 57 | String get cdateStr { |
| 56 | if (cdate.toString() == '0') { | 58 | if (cdate.toString() == '0') { |
| @@ -61,6 +63,24 @@ class RechargeListSunModel { | @@ -61,6 +63,24 @@ class RechargeListSunModel { | ||
| 61 | return DateUtil.formatDate(dateTime, format: DateFormats.y_mo_d); | 63 | return DateUtil.formatDate(dateTime, format: DateFormats.y_mo_d); |
| 62 | } | 64 | } |
| 63 | 65 | ||
| 66 | + String get stimeStr { | ||
| 67 | + if (stime == null || stime.toString() == '0') { | ||
| 68 | + return ''; | ||
| 69 | + } | ||
| 70 | + DateTime dateTime = | ||
| 71 | + DateTime.fromMillisecondsSinceEpoch(int.parse(stime.toString()) * 1000); | ||
| 72 | + return DateUtil.formatDate(dateTime, format: DateFormats.y_mo_d); | ||
| 73 | + } | ||
| 74 | + | ||
| 75 | + String get etimeStr { | ||
| 76 | + if (etime == null || etime.toString() == '0') { | ||
| 77 | + return ''; | ||
| 78 | + } | ||
| 79 | + DateTime dateTime = | ||
| 80 | + DateTime.fromMillisecondsSinceEpoch(int.parse(etime.toString()) * 1000); | ||
| 81 | + return DateUtil.formatDate(dateTime, format: DateFormats.y_mo_d); | ||
| 82 | + } | ||
| 83 | + | ||
| 64 | RechargeListSunModel( | 84 | RechargeListSunModel( |
| 65 | {this.id, | 85 | {this.id, |
| 66 | this.uid, | 86 | this.uid, |
| @@ -74,7 +94,9 @@ class RechargeListSunModel { | @@ -74,7 +94,9 @@ class RechargeListSunModel { | ||
| 74 | this.status, | 94 | this.status, |
| 75 | this.qrcode, | 95 | this.qrcode, |
| 76 | this.isExamine, | 96 | this.isExamine, |
| 77 | - this.cdate}); | 97 | + this.cdate, |
| 98 | + this.stime, | ||
| 99 | + this.etime}); | ||
| 78 | 100 | ||
| 79 | RechargeListSunModel.fromJson(Map<String, dynamic> json) { | 101 | RechargeListSunModel.fromJson(Map<String, dynamic> json) { |
| 80 | id = json['id']; | 102 | id = json['id']; |
| @@ -101,6 +123,8 @@ class RechargeListSunModel { | @@ -101,6 +123,8 @@ class RechargeListSunModel { | ||
| 101 | qrcode = json['qrcode']; | 123 | qrcode = json['qrcode']; |
| 102 | isExamine = json['is_examine']; | 124 | isExamine = json['is_examine']; |
| 103 | cdate = json['cdate']; | 125 | cdate = json['cdate']; |
| 126 | + stime = json['stime']; | ||
| 127 | + etime = json['etime']; | ||
| 104 | } | 128 | } |
| 105 | 129 | ||
| 106 | Map<String, dynamic> toJson() { | 130 | Map<String, dynamic> toJson() { |
| @@ -118,6 +142,8 @@ class RechargeListSunModel { | @@ -118,6 +142,8 @@ class RechargeListSunModel { | ||
| 118 | data['qrcode'] = this.qrcode; | 142 | data['qrcode'] = this.qrcode; |
| 119 | data['is_examine'] = this.isExamine; | 143 | data['is_examine'] = this.isExamine; |
| 120 | data['cdate'] = this.cdate; | 144 | data['cdate'] = this.cdate; |
| 145 | + data['stime'] = this.stime; | ||
| 146 | + data['etime'] = this.etime; | ||
| 121 | return data; | 147 | return data; |
| 122 | } | 148 | } |
| 123 | } | 149 | } |
| @@ -75,7 +75,12 @@ class _MarkingInteractionPageState extends State<MarkingInteractionPage> { | @@ -75,7 +75,12 @@ class _MarkingInteractionPageState extends State<MarkingInteractionPage> { | ||
| 75 | } | 75 | } |
| 76 | 76 | ||
| 77 | _getNewRechargeList() async { | 77 | _getNewRechargeList() async { |
| 78 | - await marketingCenterProvider.getNewRechargeList(context); | 78 | + UserModel userModel = Provider.of<UserModel>(context, listen: false); |
| 79 | + Map<String, String> params = { | ||
| 80 | + "sellerid": userModel.user.sellerid, | ||
| 81 | + // 'uid': userModel.user.openid | ||
| 82 | + }; | ||
| 83 | + await marketingCenterProvider.getNewRechargeList(context, params); | ||
| 79 | if (rechargeData == null && | 84 | if (rechargeData == null && |
| 80 | marketingCenterProvider.rechargeList != null && | 85 | marketingCenterProvider.rechargeList != null && |
| 81 | marketingCenterProvider.rechargeList.length > 0) { | 86 | marketingCenterProvider.rechargeList.length > 0) { |
| @@ -66,7 +66,12 @@ class _MarkingRechargeSelectPageState extends State<MarkingRechargeSelectPage> { | @@ -66,7 +66,12 @@ class _MarkingRechargeSelectPageState extends State<MarkingRechargeSelectPage> { | ||
| 66 | ///获取优惠券列表数据 | 66 | ///获取优惠券列表数据 |
| 67 | /// | 67 | /// |
| 68 | _getNewRechargeList() async { | 68 | _getNewRechargeList() async { |
| 69 | - await marketingCenterProvider.getNewRechargeList(context); | 69 | + UserModel userModel = Provider.of<UserModel>(context, listen: false); |
| 70 | + Map<String, String> params = { | ||
| 71 | + "sellerid": userModel.user.sellerid, | ||
| 72 | + // 'uid': userModel.user.openid | ||
| 73 | + }; | ||
| 74 | + await marketingCenterProvider.getNewRechargeList(context,params); | ||
| 70 | outerloop: | 75 | outerloop: |
| 71 | for (var i = 0; i < marketingCenterProvider.rechargeList.length; i++) { | 76 | for (var i = 0; i < marketingCenterProvider.rechargeList.length; i++) { |
| 72 | if (marketingCenterProvider.rechargeList[i].id == widget.selectid) { | 77 | if (marketingCenterProvider.rechargeList[i].id == widget.selectid) { |
| @@ -104,7 +104,10 @@ class _RechargeDetailPageState extends State<RechargeDetailPage> { | @@ -104,7 +104,10 @@ class _RechargeDetailPageState extends State<RechargeDetailPage> { | ||
| 104 | Padding( | 104 | Padding( |
| 105 | padding: EdgeInsets.only(left: w(20)), | 105 | padding: EdgeInsets.only(left: w(20)), |
| 106 | child: Text( | 106 | child: Text( |
| 107 | - marketingCenterProvider.rechargeDetail.explain, | 107 | + marketingCenterProvider.rechargeDetail.explain == '' || |
| 108 | + marketingCenterProvider.rechargeDetail.explain == null | ||
| 109 | + ? '无' | ||
| 110 | + : marketingCenterProvider.rechargeDetail.explain, | ||
| 108 | 111 | ||
| 109 | // maxLengthEnforced: true, | 112 | // maxLengthEnforced: true, |
| 110 | style: TextStyle( | 113 | style: TextStyle( |
| @@ -340,7 +343,7 @@ class _RechargeDetailPageState extends State<RechargeDetailPage> { | @@ -340,7 +343,7 @@ class _RechargeDetailPageState extends State<RechargeDetailPage> { | ||
| 340 | Row( | 343 | Row( |
| 341 | children: [ | 344 | children: [ |
| 342 | Text( | 345 | Text( |
| 343 | - '充值日期限制:', | 346 | + '使用限制:', |
| 344 | style: TextStyle( | 347 | style: TextStyle( |
| 345 | color: MyColours.color_515151, | 348 | color: MyColours.color_515151, |
| 346 | fontSize: ScreenUtil().setSp(32)), | 349 | fontSize: ScreenUtil().setSp(32)), |
| @@ -350,7 +353,7 @@ class _RechargeDetailPageState extends State<RechargeDetailPage> { | @@ -350,7 +353,7 @@ class _RechargeDetailPageState extends State<RechargeDetailPage> { | ||
| 350 | marketingCenterProvider | 353 | marketingCenterProvider |
| 351 | .rechargeDetail.expDate.isFix == | 354 | .rechargeDetail.expDate.isFix == |
| 352 | '1' | 355 | '1' |
| 353 | - ? '${marketingCenterProvider.rechargeDetail.expDate.fixSdate}至${marketingCenterProvider.rechargeDetail.expDate.fixEdate}' | 356 | + ? '无' |
| 354 | : marketingCenterProvider.rechargeDetail | 357 | : marketingCenterProvider.rechargeDetail |
| 355 | .expDate.isWeek == | 358 | .expDate.isWeek == |
| 356 | '1' | 359 | '1' |
| @@ -389,6 +392,35 @@ class _RechargeDetailPageState extends State<RechargeDetailPage> { | @@ -389,6 +392,35 @@ class _RechargeDetailPageState extends State<RechargeDetailPage> { | ||
| 389 | color: MyColours.color_E7E7E7, | 392 | color: MyColours.color_E7E7E7, |
| 390 | ), | 393 | ), |
| 391 | VEmptyView(48), | 394 | VEmptyView(48), |
| 395 | + Row( | ||
| 396 | + children: [ | ||
| 397 | + Text( | ||
| 398 | + '有效期:', | ||
| 399 | + style: TextStyle( | ||
| 400 | + color: MyColours.color_515151, | ||
| 401 | + fontSize: ScreenUtil().setSp(32)), | ||
| 402 | + ), | ||
| 403 | + Spacer(), | ||
| 404 | + Text( | ||
| 405 | + marketingCenterProvider | ||
| 406 | + .rechargeDetail.stimeStr + | ||
| 407 | + '至' + | ||
| 408 | + marketingCenterProvider | ||
| 409 | + .rechargeDetail.etimeStr, | ||
| 410 | + style: TextStyle( | ||
| 411 | + color: MyColours.color_999999, | ||
| 412 | + fontSize: ScreenUtil().setSp(32)), | ||
| 413 | + ), | ||
| 414 | + HEmptyView(32) | ||
| 415 | + ], | ||
| 416 | + ), | ||
| 417 | + VEmptyView(24), | ||
| 418 | + MyDivider( | ||
| 419 | + double.infinity, | ||
| 420 | + w(0.5), | ||
| 421 | + color: MyColours.color_E7E7E7, | ||
| 422 | + ), | ||
| 423 | + VEmptyView(48), | ||
| 392 | _explain( | 424 | _explain( |
| 393 | '备注', | 425 | '备注', |
| 394 | '请输入备注信息', | 426 | '请输入备注信息', |
| @@ -179,12 +179,12 @@ class _RechargeEditPageState extends State<RechargeEditPage> { | @@ -179,12 +179,12 @@ class _RechargeEditPageState extends State<RechargeEditPage> { | ||
| 179 | fixdate = marketingCenterProvider.rechargeDetail.expDate.isFix == '1' | 179 | fixdate = marketingCenterProvider.rechargeDetail.expDate.isFix == '1' |
| 180 | ? true | 180 | ? true |
| 181 | : false; | 181 | : false; |
| 182 | - if (marketingCenterProvider.rechargeDetail.expDate.fixSdate != '') { | ||
| 183 | - fromDate = marketingCenterProvider.rechargeDetail.expDate.fixSdate; | ||
| 184 | - } | ||
| 185 | - if (marketingCenterProvider.rechargeDetail.expDate.fixEdate != '') { | ||
| 186 | - endDate = marketingCenterProvider.rechargeDetail.expDate.fixEdate; | ||
| 187 | - } | 182 | + // if (marketingCenterProvider.rechargeDetail.expDate.fixSdate != '') { |
| 183 | + fromDate = marketingCenterProvider.rechargeDetail.stimeStr; | ||
| 184 | + // } | ||
| 185 | + // if (marketingCenterProvider.rechargeDetail.expDate.fixEdate != '') { | ||
| 186 | + endDate = marketingCenterProvider.rechargeDetail.etimeStr; | ||
| 187 | + // } | ||
| 188 | 188 | ||
| 189 | weekly = marketingCenterProvider.rechargeDetail.expDate.isWeek == '1' | 189 | weekly = marketingCenterProvider.rechargeDetail.expDate.isWeek == '1' |
| 190 | ? true | 190 | ? true |
| @@ -284,6 +284,49 @@ class _RechargeEditPageState extends State<RechargeEditPage> { | @@ -284,6 +284,49 @@ class _RechargeEditPageState extends State<RechargeEditPage> { | ||
| 284 | } | 284 | } |
| 285 | 285 | ||
| 286 | ///时间选择 | 286 | ///时间选择 |
| 287 | + Widget _selectTime(String title, String hintText, GestureTapCallback onTap) { | ||
| 288 | + return InkWell( | ||
| 289 | + onTap: onTap, | ||
| 290 | + child: Container( | ||
| 291 | + // padding: EdgeInsets.symmetric(vertical: ScreenUtil().setWidth(28)), | ||
| 292 | + child: Row( | ||
| 293 | + crossAxisAlignment: CrossAxisAlignment.center, | ||
| 294 | + mainAxisAlignment: MainAxisAlignment.center, | ||
| 295 | + children: [ | ||
| 296 | + Container( | ||
| 297 | + // height: ScreenUtil().setWidth(40), | ||
| 298 | + // color: Colors.red, | ||
| 299 | + child: Text( | ||
| 300 | + title, | ||
| 301 | + style: TextStyle( | ||
| 302 | + color: title == '点击设置可用日期' | ||
| 303 | + ? MyColours.color_438E93 | ||
| 304 | + : MyColours.color_515151, | ||
| 305 | + fontSize: ScreenUtil().setSp(32)), | ||
| 306 | + ), | ||
| 307 | + ), | ||
| 308 | + HEmptyView(20), | ||
| 309 | + Spacer(), | ||
| 310 | + Text(hintText, | ||
| 311 | + style: TextStyle( | ||
| 312 | + color: hintText == '点击设置开始日期' || hintText == '点击设置结束日期' | ||
| 313 | + ? MyColours.color_438E93 | ||
| 314 | + : MyColours.color_515151, | ||
| 315 | + fontSize: ScreenUtil().setSp(32), | ||
| 316 | + )), | ||
| 317 | + HEmptyView(20), | ||
| 318 | + Image.asset( | ||
| 319 | + Utils.getImgPath('arrow_right_new'), | ||
| 320 | + width: ScreenUtil().setWidth(20), | ||
| 321 | + ), | ||
| 322 | + HEmptyView(32), | ||
| 323 | + ], | ||
| 324 | + ), | ||
| 325 | + ), | ||
| 326 | + ); | ||
| 327 | + } | ||
| 328 | + | ||
| 329 | + ///时间选择 | ||
| 287 | Widget _select(String title, String hintText, GestureTapCallback onTap) { | 330 | Widget _select(String title, String hintText, GestureTapCallback onTap) { |
| 288 | return InkWell( | 331 | return InkWell( |
| 289 | onTap: onTap, | 332 | onTap: onTap, |
| @@ -776,7 +819,7 @@ class _RechargeEditPageState extends State<RechargeEditPage> { | @@ -776,7 +819,7 @@ class _RechargeEditPageState extends State<RechargeEditPage> { | ||
| 776 | Container( | 819 | Container( |
| 777 | alignment: Alignment.centerLeft, | 820 | alignment: Alignment.centerLeft, |
| 778 | child: Text( | 821 | child: Text( |
| 779 | - '有效期:', | 822 | + '使用限制:', |
| 780 | style: TextStyle( | 823 | style: TextStyle( |
| 781 | color: MyColours.color_515151, | 824 | color: MyColours.color_515151, |
| 782 | fontSize: ScreenUtil().setSp(32)), | 825 | fontSize: ScreenUtil().setSp(32)), |
| @@ -786,7 +829,7 @@ class _RechargeEditPageState extends State<RechargeEditPage> { | @@ -786,7 +829,7 @@ class _RechargeEditPageState extends State<RechargeEditPage> { | ||
| 786 | Row( | 829 | Row( |
| 787 | children: [ | 830 | children: [ |
| 788 | HEmptyView(30), | 831 | HEmptyView(30), |
| 789 | - _itemRadioWidget(fixdate, '固定时间段', onTap: () { | 832 | + _itemRadioWidget(fixdate, '无', onTap: () { |
| 790 | if (!fixdate) { | 833 | if (!fixdate) { |
| 791 | setState(() { | 834 | setState(() { |
| 792 | fixdate = true; | 835 | fixdate = true; |
| @@ -819,67 +862,67 @@ class _RechargeEditPageState extends State<RechargeEditPage> { | @@ -819,67 +862,67 @@ class _RechargeEditPageState extends State<RechargeEditPage> { | ||
| 819 | ], | 862 | ], |
| 820 | ), | 863 | ), |
| 821 | birthday ? SizedBox() : VEmptyView(24), | 864 | birthday ? SizedBox() : VEmptyView(24), |
| 822 | - fixdate | ||
| 823 | - ? Column( | ||
| 824 | - children: [ | ||
| 825 | - _select('有效期从', fromDate, () { | ||
| 826 | - FocusScope.of(context) | ||
| 827 | - .requestFocus(FocusNode()); //点击空白处隐藏键盘 | ||
| 828 | - //弹出时间选择器 | ||
| 829 | - // showPickerDateTime(context); | ||
| 830 | - showDateSelWidget = true; | ||
| 831 | - DialogUtil.showPickerDateTime24( | ||
| 832 | - context, | ||
| 833 | - scaffoldKey, | ||
| 834 | - (value) { | ||
| 835 | - // {'text': picker.adapter.text, 'select': selecteds} | ||
| 836 | - if (value != null) { | ||
| 837 | - setState(() { | ||
| 838 | - print(value); | ||
| 839 | - fromDate = DateUtil.formatDateStr( | ||
| 840 | - value, | ||
| 841 | - format: DateFormats.y_mo_d); | ||
| 842 | - }); | ||
| 843 | - } | ||
| 844 | - showDateSelWidget = false; | ||
| 845 | - }, | ||
| 846 | - dateTime: DateUtil.getDateTime(fromDate), | ||
| 847 | - pickerDateTimeType: PickerDateTimeType.kYMD, | ||
| 848 | - onCancel: () { | ||
| 849 | - showDateSelWidget = false; | ||
| 850 | - }); | ||
| 851 | - }), | ||
| 852 | - VEmptyView(24), | ||
| 853 | - _select('有效期至', endDate, () { | ||
| 854 | - FocusScope.of(context) | ||
| 855 | - .requestFocus(FocusNode()); //点击空白处隐藏键盘 | ||
| 856 | - //弹出时间选择器 | ||
| 857 | - // showPickerDateTime(context); | ||
| 858 | - showDateSelWidget = true; | ||
| 859 | - DialogUtil.showPickerDateTime24( | ||
| 860 | - context, | ||
| 861 | - scaffoldKey, | ||
| 862 | - (value) { | ||
| 863 | - // {'text': picker.adapter.text, 'select': selecteds} | ||
| 864 | - if (value != null) { | ||
| 865 | - setState(() { | ||
| 866 | - print(value); | ||
| 867 | - endDate = DateUtil.formatDateStr( | ||
| 868 | - value, | ||
| 869 | - format: DateFormats.y_mo_d); | ||
| 870 | - }); | ||
| 871 | - } | ||
| 872 | - showDateSelWidget = false; | ||
| 873 | - }, | ||
| 874 | - dateTime: DateUtil.getDateTime(endDate), | ||
| 875 | - pickerDateTimeType: PickerDateTimeType.kYMD, | ||
| 876 | - onCancel: () { | ||
| 877 | - showDateSelWidget = false; | ||
| 878 | - }); | ||
| 879 | - }) | ||
| 880 | - ], | ||
| 881 | - ) | ||
| 882 | - : SizedBox(), | 865 | + // fixdate |
| 866 | + // ? Column( | ||
| 867 | + // children: [ | ||
| 868 | + // _select('有效期从', fromDate, () { | ||
| 869 | + // FocusScope.of(context) | ||
| 870 | + // .requestFocus(FocusNode()); //点击空白处隐藏键盘 | ||
| 871 | + // //弹出时间选择器 | ||
| 872 | + // // showPickerDateTime(context); | ||
| 873 | + // showDateSelWidget = true; | ||
| 874 | + // DialogUtil.showPickerDateTime24( | ||
| 875 | + // context, | ||
| 876 | + // scaffoldKey, | ||
| 877 | + // (value) { | ||
| 878 | + // // {'text': picker.adapter.text, 'select': selecteds} | ||
| 879 | + // if (value != null) { | ||
| 880 | + // setState(() { | ||
| 881 | + // print(value); | ||
| 882 | + // fromDate = DateUtil.formatDateStr( | ||
| 883 | + // value, | ||
| 884 | + // format: DateFormats.y_mo_d); | ||
| 885 | + // }); | ||
| 886 | + // } | ||
| 887 | + // showDateSelWidget = false; | ||
| 888 | + // }, | ||
| 889 | + // dateTime: DateUtil.getDateTime(fromDate), | ||
| 890 | + // pickerDateTimeType: PickerDateTimeType.kYMD, | ||
| 891 | + // onCancel: () { | ||
| 892 | + // showDateSelWidget = false; | ||
| 893 | + // }); | ||
| 894 | + // }), | ||
| 895 | + // VEmptyView(24), | ||
| 896 | + // _select('有效期至', endDate, () { | ||
| 897 | + // FocusScope.of(context) | ||
| 898 | + // .requestFocus(FocusNode()); //点击空白处隐藏键盘 | ||
| 899 | + // //弹出时间选择器 | ||
| 900 | + // // showPickerDateTime(context); | ||
| 901 | + // showDateSelWidget = true; | ||
| 902 | + // DialogUtil.showPickerDateTime24( | ||
| 903 | + // context, | ||
| 904 | + // scaffoldKey, | ||
| 905 | + // (value) { | ||
| 906 | + // // {'text': picker.adapter.text, 'select': selecteds} | ||
| 907 | + // if (value != null) { | ||
| 908 | + // setState(() { | ||
| 909 | + // print(value); | ||
| 910 | + // endDate = DateUtil.formatDateStr( | ||
| 911 | + // value, | ||
| 912 | + // format: DateFormats.y_mo_d); | ||
| 913 | + // }); | ||
| 914 | + // } | ||
| 915 | + // showDateSelWidget = false; | ||
| 916 | + // }, | ||
| 917 | + // dateTime: DateUtil.getDateTime(endDate), | ||
| 918 | + // pickerDateTimeType: PickerDateTimeType.kYMD, | ||
| 919 | + // onCancel: () { | ||
| 920 | + // showDateSelWidget = false; | ||
| 921 | + // }); | ||
| 922 | + // }) | ||
| 923 | + // ], | ||
| 924 | + // ) | ||
| 925 | + // : SizedBox(), | ||
| 883 | weekly | 926 | weekly |
| 884 | ? _select(weekShow, '', () async { | 927 | ? _select(weekShow, '', () async { |
| 885 | FocusScope.of(context) | 928 | FocusScope.of(context) |
| @@ -921,6 +964,80 @@ class _RechargeEditPageState extends State<RechargeEditPage> { | @@ -921,6 +964,80 @@ class _RechargeEditPageState extends State<RechargeEditPage> { | ||
| 921 | color: MyColours.color_E7E7E7, | 964 | color: MyColours.color_E7E7E7, |
| 922 | ), | 965 | ), |
| 923 | VEmptyView(48), | 966 | VEmptyView(48), |
| 967 | + Container( | ||
| 968 | + alignment: Alignment.centerLeft, | ||
| 969 | + child: Text( | ||
| 970 | + '有效期:', | ||
| 971 | + style: TextStyle( | ||
| 972 | + color: MyColours.color_515151, | ||
| 973 | + fontSize: ScreenUtil().setSp(32)), | ||
| 974 | + ), | ||
| 975 | + ), | ||
| 976 | + VEmptyView(24), | ||
| 977 | + _selectTime('有效期从', fromDate, () { | ||
| 978 | + FocusScope.of(context) | ||
| 979 | + .requestFocus(FocusNode()); //点击空白处隐藏键盘 | ||
| 980 | + //弹出时间选择器 | ||
| 981 | + // showPickerDateTime(context); | ||
| 982 | + showDateSelWidget = true; | ||
| 983 | + DialogUtil.showPickerDateTime24( | ||
| 984 | + context, | ||
| 985 | + scaffoldKey, | ||
| 986 | + (value) { | ||
| 987 | + // {'text': picker.adapter.text, 'select': selecteds} | ||
| 988 | + if (value != null) { | ||
| 989 | + setState(() { | ||
| 990 | + print(value); | ||
| 991 | + fromDate = DateUtil.formatDateStr(value, | ||
| 992 | + format: DateFormats.y_mo_d); | ||
| 993 | + }); | ||
| 994 | + } | ||
| 995 | + showDateSelWidget = false; | ||
| 996 | + }, | ||
| 997 | + dateTime: DateUtil.getDateTime(fromDate), | ||
| 998 | + pickerDateTimeType: PickerDateTimeType.kYMD, | ||
| 999 | + onCancel: () { | ||
| 1000 | + showDateSelWidget = false; | ||
| 1001 | + }); | ||
| 1002 | + }), | ||
| 1003 | + // Container( | ||
| 1004 | + // height: ScreenUtil().setWidth(2), | ||
| 1005 | + // color: MyColours.color_E7E7E7, | ||
| 1006 | + // ), | ||
| 1007 | + VEmptyView(24), | ||
| 1008 | + _selectTime('有效期至', endDate, () { | ||
| 1009 | + FocusScope.of(context) | ||
| 1010 | + .requestFocus(FocusNode()); //点击空白处隐藏键盘 | ||
| 1011 | + //弹出时间选择器 | ||
| 1012 | + // showPickerDateTime(context); | ||
| 1013 | + showDateSelWidget = true; | ||
| 1014 | + DialogUtil.showPickerDateTime24( | ||
| 1015 | + context, | ||
| 1016 | + scaffoldKey, | ||
| 1017 | + (value) { | ||
| 1018 | + // {'text': picker.adapter.text, 'select': selecteds} | ||
| 1019 | + if (value != null) { | ||
| 1020 | + setState(() { | ||
| 1021 | + print(value); | ||
| 1022 | + endDate = DateUtil.formatDateStr(value, | ||
| 1023 | + format: DateFormats.y_mo_d); | ||
| 1024 | + }); | ||
| 1025 | + } | ||
| 1026 | + showDateSelWidget = false; | ||
| 1027 | + }, | ||
| 1028 | + dateTime: DateUtil.getDateTime(endDate), | ||
| 1029 | + pickerDateTimeType: PickerDateTimeType.kYMD, | ||
| 1030 | + onCancel: () { | ||
| 1031 | + showDateSelWidget = false; | ||
| 1032 | + }); | ||
| 1033 | + }), | ||
| 1034 | + VEmptyView(24), | ||
| 1035 | + MyDivider( | ||
| 1036 | + double.infinity, | ||
| 1037 | + w(1), | ||
| 1038 | + color: MyColours.color_E7E7E7, | ||
| 1039 | + ), | ||
| 1040 | + VEmptyView(48), | ||
| 924 | _explain('备注', '请输入备注信息', remarkC, remarkF), | 1041 | _explain('备注', '请输入备注信息', remarkC, remarkF), |
| 925 | VEmptyView(72), | 1042 | VEmptyView(72), |
| 926 | _canUse('立即启用', canUse, () { | 1043 | _canUse('立即启用', canUse, () { |
| @@ -1000,31 +1117,40 @@ class _RechargeEditPageState extends State<RechargeEditPage> { | @@ -1000,31 +1117,40 @@ class _RechargeEditPageState extends State<RechargeEditPage> { | ||
| 1000 | return; | 1117 | return; |
| 1001 | } | 1118 | } |
| 1002 | 1119 | ||
| 1003 | - if (fixdate) { | ||
| 1004 | - //固定时间段 | 1120 | + // if (fixdate) { |
| 1121 | + //固定时间段 | ||
| 1005 | 1122 | ||
| 1006 | - if (fromDate == '点击设置开始日期') { | ||
| 1007 | - Utils.showToast('请设置开始日期!'); | ||
| 1008 | - return; | ||
| 1009 | - } | 1123 | + if (fromDate == '点击设置开始日期') { |
| 1124 | + Utils.showToast('请设置有效期的开始日期!'); | ||
| 1125 | + return; | ||
| 1126 | + } | ||
| 1010 | 1127 | ||
| 1011 | - if (endDate == '点击设置结束日期') { | ||
| 1012 | - Utils.showToast('请设置结束日期!'); | ||
| 1013 | - return; | ||
| 1014 | - } | ||
| 1015 | - if (DateUtil.getDateTime(endDate) | ||
| 1016 | - .compareTo(DateUtil.getDateTime(fromDate)) < | ||
| 1017 | - 0) { | ||
| 1018 | - Utils.showToast('有效期结束日期不能早于开始日期!'); | ||
| 1019 | - return; | ||
| 1020 | - } | 1128 | + if (endDate == '点击设置结束日期') { |
| 1129 | + Utils.showToast('请设置有效期的结束日期!'); | ||
| 1130 | + return; | ||
| 1021 | } | 1131 | } |
| 1132 | + if (DateUtil.getDateTime(endDate) | ||
| 1133 | + .compareTo(DateUtil.getDateTime(fromDate)) < | ||
| 1134 | + 0) { | ||
| 1135 | + Utils.showToast('有效期结束日期不能早于开始日期!'); | ||
| 1136 | + return; | ||
| 1137 | + } | ||
| 1138 | + // } | ||
| 1022 | 1139 | ||
| 1023 | if (weekly && weekShow == '点击设置可用日期') { | 1140 | if (weekly && weekShow == '点击设置可用日期') { |
| 1024 | Utils.showToast('请设置可用日期!'); | 1141 | Utils.showToast('请设置可用日期!'); |
| 1025 | return; | 1142 | return; |
| 1026 | } | 1143 | } |
| 1027 | 1144 | ||
| 1145 | + String from = fromDate + ' 00:00:00'; | ||
| 1146 | + String end = endDate + ' 23:59:59'; | ||
| 1147 | + String stime = fromDate == '点击设置开始日期' | ||
| 1148 | + ? "" | ||
| 1149 | + : '${(DateUtil.getDateMsByTimeStr(from) / 1000).floor()}'; | ||
| 1150 | + String etime = endDate == '点击设置结束日期' | ||
| 1151 | + ? '' | ||
| 1152 | + : '${(DateUtil.getDateMsByTimeStr(end) / 1000).floor()}'; | ||
| 1153 | + | ||
| 1028 | Map discounts = { | 1154 | Map discounts = { |
| 1029 | 'is_price': givePriceSwich ? '1' : '0', //优惠活动,赠送金额 | 1155 | 'is_price': givePriceSwich ? '1' : '0', //优惠活动,赠送金额 |
| 1030 | 'is_score': giveScoreSwich ? '1' : '0', //赠送积分 | 1156 | 'is_score': giveScoreSwich ? '1' : '0', //赠送积分 |
| @@ -1043,8 +1169,8 @@ class _RechargeEditPageState extends State<RechargeEditPage> { | @@ -1043,8 +1169,8 @@ class _RechargeEditPageState extends State<RechargeEditPage> { | ||
| 1043 | 'is_fix': fixdate ? '1' : '0', | 1169 | 'is_fix': fixdate ? '1' : '0', |
| 1044 | 'is_week': weekly ? '1' : '0', | 1170 | 'is_week': weekly ? '1' : '0', |
| 1045 | 'is_birthday': birthday ? '1' : '0', | 1171 | 'is_birthday': birthday ? '1' : '0', |
| 1046 | - 'fix_sdate': fixdate ? fromDate : '', // 开始时间 | ||
| 1047 | - 'fix_edate': fixdate ? endDate : '', //结束时间 | 1172 | + // 'fix_sdate': fixdate ? fromDate : '', // 开始时间 |
| 1173 | + // 'fix_edate': fixdate ? endDate : '', //结束时间 | ||
| 1048 | 'week_date_show': weekly ? weekShow : '', | 1174 | 'week_date_show': weekly ? weekShow : '', |
| 1049 | 'week_date_data': weekly ? weekData : '' | 1175 | 'week_date_data': weekly ? weekData : '' |
| 1050 | }; | 1176 | }; |
| @@ -1063,7 +1189,9 @@ class _RechargeEditPageState extends State<RechargeEditPage> { | @@ -1063,7 +1189,9 @@ class _RechargeEditPageState extends State<RechargeEditPage> { | ||
| 1063 | 'recharge_list': discountsStr, | 1189 | 'recharge_list': discountsStr, |
| 1064 | 'exp_date': dateStr, | 1190 | 'exp_date': dateStr, |
| 1065 | 'explain': remarkC.text, | 1191 | 'explain': remarkC.text, |
| 1066 | - 'is_open': canUse ? '1' : '0' | 1192 | + 'is_open': canUse ? '1' : '0', |
| 1193 | + 'stime': stime, | ||
| 1194 | + 'etime': etime | ||
| 1067 | }; | 1195 | }; |
| 1068 | if (widget.idstr != null && widget.idstr != 'null') { | 1196 | if (widget.idstr != null && widget.idstr != 'null') { |
| 1069 | pramas['id'] = widget.idstr; | 1197 | pramas['id'] = widget.idstr; |
| 1 | +import 'package:flutter/material.dart'; | ||
| 2 | +import 'package:flutter_easyrefresh/easy_refresh.dart'; | ||
| 3 | +import 'package:one_key/constant/state.dart'; | ||
| 4 | +import 'package:one_key/pages/coupon/coupon_item.dart'; | ||
| 5 | +import 'package:one_key/pages/coupon/coupon_item_f.dart'; | ||
| 6 | +import 'package:one_key/pages/my/marketing_center/recharge/recharge_item.dart'; | ||
| 7 | +import 'package:one_key/provider/coupon_provider.dart'; | ||
| 8 | +import 'package:one_key/provider/user_model.dart'; | ||
| 9 | +import 'package:one_key/res/colors.dart'; | ||
| 10 | +import 'package:one_key/widgets/page_exception.dart'; | ||
| 11 | +import 'package:one_key/widgets/system_app_bar.dart'; | ||
| 12 | +import 'package:one_key/widgets/v_empty_view.dart'; | ||
| 13 | +import 'package:provider/provider.dart'; | ||
| 14 | + | ||
| 15 | +import '../../../../models/recharge_list_model.dart'; | ||
| 16 | +import '../../../../provider/marketing_center_provider.dart'; | ||
| 17 | + | ||
| 18 | +/** | ||
| 19 | + * 历史过期充值优惠 | ||
| 20 | + */ | ||
| 21 | +class RechargeHistoryPage extends StatefulWidget { | ||
| 22 | + RechargeHistoryPage({Key key}) : super(key: key); | ||
| 23 | + | ||
| 24 | + @override | ||
| 25 | + _RechargeHistoryPageState createState() => _RechargeHistoryPageState(); | ||
| 26 | +} | ||
| 27 | + | ||
| 28 | +class _RechargeHistoryPageState extends State<RechargeHistoryPage> { | ||
| 29 | + EasyRefreshController _controller = EasyRefreshController(); | ||
| 30 | + MarketingCenterProvider marketingCenterProvider; | ||
| 31 | + | ||
| 32 | + ///获取充值优惠历史列表数据 | ||
| 33 | + getNewRechargeListHistory() async { | ||
| 34 | + UserModel userModel = Provider.of<UserModel>(context, listen: false); | ||
| 35 | + Map<String, String> params = { | ||
| 36 | + "sellerid": userModel.user.sellerid, | ||
| 37 | + // 'uid': userModel.user.openid | ||
| 38 | + 'is_expire': '1' | ||
| 39 | + }; | ||
| 40 | + await marketingCenterProvider.getNewRechargeListHistory(context, params); | ||
| 41 | + } | ||
| 42 | + | ||
| 43 | + @override | ||
| 44 | + void initState() { | ||
| 45 | + // TODO: implement initState | ||
| 46 | + super.initState(); | ||
| 47 | + WidgetsBinding.instance.addPostFrameCallback((_) { | ||
| 48 | + getNewRechargeListHistory(); | ||
| 49 | + }); | ||
| 50 | + } | ||
| 51 | + | ||
| 52 | + @override | ||
| 53 | + Widget build(BuildContext context) { | ||
| 54 | + marketingCenterProvider = | ||
| 55 | + Provider.of<MarketingCenterProvider>(context, listen: true); | ||
| 56 | + return Scaffold( | ||
| 57 | + backgroundColor: MyColours.color_fefefe, | ||
| 58 | + appBar: SystemAppBar( | ||
| 59 | + '过期充值优惠', | ||
| 60 | + onTap: () { | ||
| 61 | + Navigator.of(context).pop(); | ||
| 62 | + }, | ||
| 63 | + ), | ||
| 64 | + body: Consumer<MarketingCenterProvider>( | ||
| 65 | + builder: (context, model, _) { | ||
| 66 | + if (model.pageStateHistory != PageState.Success) { | ||
| 67 | + return ExceptionPage( | ||
| 68 | + pageState: model.pageStateHistory, | ||
| 69 | + callback: () { | ||
| 70 | + // offset = 0; | ||
| 71 | + // getMessage(showLoading: true); | ||
| 72 | + getNewRechargeListHistory(); | ||
| 73 | + }, | ||
| 74 | + emptyMsg: "暂时没有列表信息哦", | ||
| 75 | + emptyImg: "empty_search", | ||
| 76 | + showMsg: "加载中,请稍后...", | ||
| 77 | + ); | ||
| 78 | + } else { | ||
| 79 | + return EasyRefresh.custom( | ||
| 80 | + controller: _controller, | ||
| 81 | + slivers: [ | ||
| 82 | + SliverList( | ||
| 83 | + delegate: SliverChildBuilderDelegate( | ||
| 84 | + (BuildContext context, int index) { | ||
| 85 | + return VEmptyView(40); | ||
| 86 | + }, childCount: 1), | ||
| 87 | + ), | ||
| 88 | + SliverList( | ||
| 89 | + delegate: SliverChildBuilderDelegate( | ||
| 90 | + (BuildContext context, int index) { | ||
| 91 | + // return CouponItem( | ||
| 92 | + // from: 'history', | ||
| 93 | + // couponSonModel: couponProvider.couponListHistory[index], | ||
| 94 | + // onPressed: () { | ||
| 95 | + // // couponProvider.couponListHistory[index] = | ||
| 96 | + // // !couponProvider.couponListHistory[index]; | ||
| 97 | + // // couponProvider.notifyListeners(); | ||
| 98 | + // }, | ||
| 99 | + // ); | ||
| 100 | + // return CouponItemF( | ||
| 101 | + // from: 'history', | ||
| 102 | + // couponSonModel: couponProvider.couponListHistory[index], | ||
| 103 | + // showBtn: true, | ||
| 104 | + // onPressedSwich: () { | ||
| 105 | + // // couponProvider.couponList[index].isOpenBool = | ||
| 106 | + // // !couponProvider.couponList[index].isOpenBool; | ||
| 107 | + // // _setCustomerActivity(index); | ||
| 108 | + // }, | ||
| 109 | + // onPressed: () { | ||
| 110 | + // // NavigatorUtil.goCouponDetailPage( | ||
| 111 | + // // context, couponProvider.couponList[index]); | ||
| 112 | + // }, | ||
| 113 | + // ); | ||
| 114 | + RechargeListSunModel rechargeListSunModel = | ||
| 115 | + marketingCenterProvider.rechargeListHistory[index]; | ||
| 116 | + return RechargeItem( | ||
| 117 | + from: 'history', | ||
| 118 | + rechargeListSunModel: rechargeListSunModel, | ||
| 119 | + showBtn: true, | ||
| 120 | + onPressedDel: () { | ||
| 121 | + //弹框确认是否删除 | ||
| 122 | + // DialogUtil.cupertinoAlertDialog(context, | ||
| 123 | + // title: "", | ||
| 124 | + // content: "确定要将该优惠删除吗?", | ||
| 125 | + // rTitle: "确定", rCallback: () async { | ||
| 126 | + // Map<String, String> pramas = { | ||
| 127 | + // 'id': rechargeListSunModel.id, | ||
| 128 | + // 'status': '1', | ||
| 129 | + // }; | ||
| 130 | + | ||
| 131 | + // bool success = await marketingCenterProvider | ||
| 132 | + // .createNewRecharge(context, pramas); | ||
| 133 | + // if (success) { | ||
| 134 | + // setState(() { | ||
| 135 | + // marketingCenterProvider.rechargeList | ||
| 136 | + // .removeAt(index); | ||
| 137 | + // if (marketingCenterProvider | ||
| 138 | + // .rechargeList.length == | ||
| 139 | + // 0) { | ||
| 140 | + // model.pageStateRechargeHome = | ||
| 141 | + // PageState.Empty; | ||
| 142 | + // } | ||
| 143 | + // }); | ||
| 144 | + // } | ||
| 145 | + // }); | ||
| 146 | + }, | ||
| 147 | + onPressedUse: () async { | ||
| 148 | + // if (rechargeListSunModel.isOpen == '1') { | ||
| 149 | + // //开启的,去禁用 | ||
| 150 | + | ||
| 151 | + // _openOrClose(rechargeListSunModel, '0'); | ||
| 152 | + // } else { | ||
| 153 | + // _openOrClose(rechargeListSunModel, '1'); | ||
| 154 | + // } | ||
| 155 | + }, | ||
| 156 | + onPressed: () { | ||
| 157 | + // if (showBtn || | ||
| 158 | + // rechargeListSunModel.uid == | ||
| 159 | + // Provider.of<UserModel>(context, | ||
| 160 | + // listen: false) | ||
| 161 | + // .user | ||
| 162 | + // .openid) { | ||
| 163 | + // //跳进编辑页,权限:管理员、店长、自己创建的券 | ||
| 164 | + // NavigatorUtil.goRechargeEditPage(context, | ||
| 165 | + // idstr: rechargeListSunModel.id); | ||
| 166 | + // } else { | ||
| 167 | + // //查看页 | ||
| 168 | + // NavigatorUtil.goRechargeDetailPage( | ||
| 169 | + // context, rechargeListSunModel.id); | ||
| 170 | + // } | ||
| 171 | + }, | ||
| 172 | + ); | ||
| 173 | + }, | ||
| 174 | + childCount: | ||
| 175 | + marketingCenterProvider.rechargeListHistory.length), | ||
| 176 | + ) | ||
| 177 | + ], | ||
| 178 | + // onRefresh: () async { | ||
| 179 | + // // offset = 0; | ||
| 180 | + // // getMessage(showLoading: false); | ||
| 181 | + // }, | ||
| 182 | + // onLoad: () async { | ||
| 183 | + // // offset++; | ||
| 184 | + // // getMessage(showLoading: false); | ||
| 185 | + // }, | ||
| 186 | + ); | ||
| 187 | + } | ||
| 188 | + }, | ||
| 189 | + )); | ||
| 190 | + } | ||
| 191 | +} |
| @@ -55,7 +55,12 @@ class _RechargeHomePageState extends State<RechargeHomePage> { | @@ -55,7 +55,12 @@ class _RechargeHomePageState extends State<RechargeHomePage> { | ||
| 55 | } | 55 | } |
| 56 | 56 | ||
| 57 | _getNewRechargeList() async { | 57 | _getNewRechargeList() async { |
| 58 | - await marketingCenterProvider.getNewRechargeList(context); | 58 | + UserModel userModel = Provider.of<UserModel>(context, listen: false); |
| 59 | + Map<String, String> params = { | ||
| 60 | + "sellerid": userModel.user.sellerid, | ||
| 61 | + // 'uid': userModel.user.openid | ||
| 62 | + }; | ||
| 63 | + await marketingCenterProvider.getNewRechargeList(context, params); | ||
| 59 | } | 64 | } |
| 60 | 65 | ||
| 61 | _openOrClose(RechargeListSunModel rechargeListSunModel, String isOpen) async { | 66 | _openOrClose(RechargeListSunModel rechargeListSunModel, String isOpen) async { |
| @@ -184,35 +189,37 @@ class _RechargeHomePageState extends State<RechargeHomePage> { | @@ -184,35 +189,37 @@ class _RechargeHomePageState extends State<RechargeHomePage> { | ||
| 184 | childCount: | 189 | childCount: |
| 185 | marketingCenterProvider.rechargeList.length), | 190 | marketingCenterProvider.rechargeList.length), |
| 186 | ), | 191 | ), |
| 187 | - // SliverList( | ||
| 188 | - // delegate: SliverChildBuilderDelegate( | ||
| 189 | - // (BuildContext context, int index) { | ||
| 190 | - // return Column( | ||
| 191 | - // children: [ | ||
| 192 | - // InkWell( | ||
| 193 | - // onTap: () { | ||
| 194 | - // // NavigatorUtil.goCouponHistoryPage(context); | ||
| 195 | - // }, | ||
| 196 | - // child: RichText( | ||
| 197 | - // text: TextSpan( | ||
| 198 | - // style: TextStyle( | ||
| 199 | - // fontSize: ScreenUtil().setSp(28), | ||
| 200 | - // ), | ||
| 201 | - // children: [ | ||
| 202 | - // TextSpan( | ||
| 203 | - // text: '没有更多了,', | ||
| 204 | - // style: TextStyle( | ||
| 205 | - // color: MyColours.color_000000)), | ||
| 206 | - // TextSpan( | ||
| 207 | - // text: '查看过期优惠券', | ||
| 208 | - // style: TextStyle( | ||
| 209 | - // color: MyColours.color_438E93)), | ||
| 210 | - // ]))), | ||
| 211 | - // VEmptyView(80) | ||
| 212 | - // ], | ||
| 213 | - // ); | ||
| 214 | - // }, childCount: 1), | ||
| 215 | - // ) | 192 | + SliverList( |
| 193 | + delegate: SliverChildBuilderDelegate( | ||
| 194 | + (BuildContext context, int index) { | ||
| 195 | + return Column( | ||
| 196 | + children: [ | ||
| 197 | + VEmptyView(40), | ||
| 198 | + InkWell( | ||
| 199 | + onTap: () { | ||
| 200 | + NavigatorUtil.goRechargeHistoryPage( | ||
| 201 | + context); | ||
| 202 | + }, | ||
| 203 | + child: RichText( | ||
| 204 | + text: TextSpan( | ||
| 205 | + style: TextStyle( | ||
| 206 | + fontSize: ScreenUtil().setSp(28), | ||
| 207 | + ), | ||
| 208 | + children: [ | ||
| 209 | + TextSpan( | ||
| 210 | + text: '没有更多了,', | ||
| 211 | + style: TextStyle( | ||
| 212 | + color: MyColours.color_000000)), | ||
| 213 | + TextSpan( | ||
| 214 | + text: '查看过期优惠活动', | ||
| 215 | + style: TextStyle( | ||
| 216 | + color: MyColours.color_438E93)), | ||
| 217 | + ]))), | ||
| 218 | + VEmptyView(80) | ||
| 219 | + ], | ||
| 220 | + ); | ||
| 221 | + }, childCount: 1), | ||
| 222 | + ) | ||
| 216 | ], | 223 | ], |
| 217 | // onRefresh: () async { | 224 | // onRefresh: () async { |
| 218 | // // offset = 0; | 225 | // // offset = 0; |
| @@ -310,11 +310,11 @@ class _RechargeItemState extends State<RechargeItem> { | @@ -310,11 +310,11 @@ class _RechargeItemState extends State<RechargeItem> { | ||
| 310 | // : Container() | 310 | // : Container() |
| 311 | // : | 311 | // : |
| 312 | ), | 312 | ), |
| 313 | - if (widget.showBtn) | 313 | + if (widget.showBtn && widget.from != 'history') |
| 314 | MySeparator( | 314 | MySeparator( |
| 315 | width: w(4), color: MyColours.color_BFC4D4), | 315 | width: w(4), color: MyColours.color_BFC4D4), |
| 316 | if (widget.showBtn) VEmptyView(15), | 316 | if (widget.showBtn) VEmptyView(15), |
| 317 | - if (widget.showBtn) | 317 | + if (widget.showBtn && widget.from != 'history') |
| 318 | Row( | 318 | Row( |
| 319 | mainAxisAlignment: MainAxisAlignment.end, | 319 | mainAxisAlignment: MainAxisAlignment.end, |
| 320 | children: [ | 320 | children: [ |
| @@ -352,7 +352,8 @@ class _RechargeItemState extends State<RechargeItem> { | @@ -352,7 +352,8 @@ class _RechargeItemState extends State<RechargeItem> { | ||
| 352 | HEmptyView(38), | 352 | HEmptyView(38), |
| 353 | ], | 353 | ], |
| 354 | ), | 354 | ), |
| 355 | - if (widget.showBtn) VEmptyView(15) | 355 | + if (widget.showBtn && widget.from != 'history') |
| 356 | + VEmptyView(15) | ||
| 356 | ], | 357 | ], |
| 357 | ), | 358 | ), |
| 358 | )), | 359 | )), |
| @@ -367,7 +368,26 @@ class _RechargeItemState extends State<RechargeItem> { | @@ -367,7 +368,26 @@ class _RechargeItemState extends State<RechargeItem> { | ||
| 367 | width: ScreenUtil().setWidth(50), | 368 | width: ScreenUtil().setWidth(50), |
| 368 | height: ScreenUtil().setWidth(50), | 369 | height: ScreenUtil().setWidth(50), |
| 369 | )) | 370 | )) |
| 370 | - : SizedBox() | 371 | + : SizedBox(), |
| 372 | + if (widget.from == 'history') | ||
| 373 | + Positioned( | ||
| 374 | + right: ScreenUtil().setWidth(100), | ||
| 375 | + top: ScreenUtil().setWidth(60 * 2), | ||
| 376 | + child: widget.showBtn | ||
| 377 | + ? RoundButton( | ||
| 378 | + width: widget.from == 'history' | ||
| 379 | + ? ScreenUtil().setWidth(44 * 2) | ||
| 380 | + : ScreenUtil().setWidth(32 * 2), | ||
| 381 | + height: ScreenUtil().setWidth(21 * 2), | ||
| 382 | + radius: ScreenUtil().setWidth(10), | ||
| 383 | + text: '已过期', | ||
| 384 | + fontSize: 24, | ||
| 385 | + textColor: MyColours.color_BFC4D4, | ||
| 386 | + gradientStart: MyColours.color_ffffff, | ||
| 387 | + gradientEnd: MyColours.color_ffffff, | ||
| 388 | + borderColor: MyColours.color_BFC4D4, | ||
| 389 | + ) | ||
| 390 | + : Container()) | ||
| 371 | ])); | 391 | ])); |
| 372 | } | 392 | } |
| 373 | } | 393 | } |
| @@ -59,7 +59,7 @@ class _MenuAddDishesPageState extends State<MenuAddDishesPage> { | @@ -59,7 +59,7 @@ class _MenuAddDishesPageState extends State<MenuAddDishesPage> { | ||
| 59 | List<String> specStrList = []; | 59 | List<String> specStrList = []; |
| 60 | String specStr = '请选择'; | 60 | String specStr = '请选择'; |
| 61 | String mid = ''; | 61 | String mid = ''; |
| 62 | - List<MenuUnitModel> data; //价格 | 62 | + List<MenuUnitModel> data = []; //价格 |
| 63 | String showPrice; | 63 | String showPrice; |
| 64 | String selectPracticeShow; | 64 | String selectPracticeShow; |
| 65 | String selectPracticeIds; | 65 | String selectPracticeIds; |
| @@ -90,8 +90,8 @@ class _MenuAddDishesPageState extends State<MenuAddDishesPage> { | @@ -90,8 +90,8 @@ class _MenuAddDishesPageState extends State<MenuAddDishesPage> { | ||
| 90 | selectPracticeIds = ''; | 90 | selectPracticeIds = ''; |
| 91 | selectPractice.forEach((element) { | 91 | selectPractice.forEach((element) { |
| 92 | // if (element.select) { | 92 | // if (element.select) { |
| 93 | - selectPracticeShow += '${element.name}、'; | ||
| 94 | - selectPracticeIds += '${element.id},'; | 93 | + selectPracticeShow += '${element.name}、'; |
| 94 | + selectPracticeIds += '${element.id},'; | ||
| 95 | // } | 95 | // } |
| 96 | }); | 96 | }); |
| 97 | if (selectPracticeShow.endsWith('、')) { | 97 | if (selectPracticeShow.endsWith('、')) { |
| @@ -112,8 +112,11 @@ class _MenuManagePageState extends State<MenuManagePage> { | @@ -112,8 +112,11 @@ class _MenuManagePageState extends State<MenuManagePage> { | ||
| 112 | _getDzSellerConf() async { | 112 | _getDzSellerConf() async { |
| 113 | bool success = await menuManageProvider.getDzSellerConf(context); | 113 | bool success = await menuManageProvider.getDzSellerConf(context); |
| 114 | if (success) { | 114 | if (success) { |
| 115 | - themeColerModel1 = themeColorData[ | ||
| 116 | - int.parse(menuManageProvider.dzSellerConfModel.cookStyle.index)]; | 115 | + themeColerModel1 = themeColorData[menuManageProvider |
| 116 | + .dzSellerConfModel.cookStyle == | ||
| 117 | + null | ||
| 118 | + ? 0 | ||
| 119 | + : int.parse(menuManageProvider.dzSellerConfModel.cookStyle.index)]; | ||
| 117 | } | 120 | } |
| 118 | } | 121 | } |
| 119 | 122 | ||
| @@ -265,20 +268,6 @@ class _MenuManagePageState extends State<MenuManagePage> { | @@ -265,20 +268,6 @@ class _MenuManagePageState extends State<MenuManagePage> { | ||
| 265 | model.cooks != '') || | 268 | model.cooks != '') || |
| 266 | (model.taste != null && model.taste != '') || | 269 | (model.taste != null && model.taste != '') || |
| 267 | (model.cooks != null && model.cooks != '')) | 270 | (model.cooks != null && model.cooks != '')) |
| 268 | - VEmptyView(20), | ||
| 269 | - if ((model.taste != null && | ||
| 270 | - model.taste != '' && | ||
| 271 | - model.cooks != null && | ||
| 272 | - model.cooks != '') || | ||
| 273 | - (model.taste != null && model.taste != '') || | ||
| 274 | - (model.cooks != null && model.cooks != '')) | ||
| 275 | - VEmptyView(20), | ||
| 276 | - if ((model.taste != null && | ||
| 277 | - model.taste != '' && | ||
| 278 | - model.cooks != null && | ||
| 279 | - model.cooks != '') || | ||
| 280 | - (model.taste != null && model.taste != '') || | ||
| 281 | - (model.cooks != null && model.cooks != '')) | ||
| 282 | Text( | 271 | Text( |
| 283 | model.taste != null && | 272 | model.taste != null && |
| 284 | model.taste != '' && | 273 | model.taste != '' && |
| @@ -303,7 +292,9 @@ class _MenuManagePageState extends State<MenuManagePage> { | @@ -303,7 +292,9 @@ class _MenuManagePageState extends State<MenuManagePage> { | ||
| 303 | ])), | 292 | ])), |
| 304 | VEmptyView(20), | 293 | VEmptyView(20), |
| 305 | model.price == null | 294 | model.price == null |
| 306 | - ? Column(children: _priceWidget(model)) | 295 | + ? Column( |
| 296 | + crossAxisAlignment: CrossAxisAlignment.start, | ||
| 297 | + children: _priceWidget(model)) | ||
| 307 | : Text( | 298 | : Text( |
| 308 | '¥${model.price}/${model.unit} 会员 ¥${model.price}/${model.unit} ', | 299 | '¥${model.price}/${model.unit} 会员 ¥${model.price}/${model.unit} ', |
| 309 | textAlign: TextAlign.right, | 300 | textAlign: TextAlign.right, |
| @@ -415,7 +406,9 @@ class _MenuManagePageState extends State<MenuManagePage> { | @@ -415,7 +406,9 @@ class _MenuManagePageState extends State<MenuManagePage> { | ||
| 415 | ])), | 406 | ])), |
| 416 | VEmptyView(20), | 407 | VEmptyView(20), |
| 417 | model.price == null | 408 | model.price == null |
| 418 | - ? Column(children: _priceWidget(model)) | 409 | + ? Column( |
| 410 | + crossAxisAlignment: CrossAxisAlignment.start, | ||
| 411 | + children: _priceWidget(model)) | ||
| 419 | : Text( | 412 | : Text( |
| 420 | '¥${model.price}/${model.unit} 会员 ¥${model.member_price ?? ''}/${model.unit} ', | 413 | '¥${model.price}/${model.unit} 会员 ¥${model.member_price ?? ''}/${model.unit} ', |
| 421 | textAlign: TextAlign.right, | 414 | textAlign: TextAlign.right, |
| @@ -442,8 +435,9 @@ class _MenuManagePageState extends State<MenuManagePage> { | @@ -442,8 +435,9 @@ class _MenuManagePageState extends State<MenuManagePage> { | ||
| 442 | mainAxisAlignment: MainAxisAlignment.spaceBetween, | 435 | mainAxisAlignment: MainAxisAlignment.spaceBetween, |
| 443 | crossAxisAlignment: CrossAxisAlignment.start, | 436 | crossAxisAlignment: CrossAxisAlignment.start, |
| 444 | children: [ | 437 | children: [ |
| 445 | - Container( | ||
| 446 | - width: w(134), | 438 | + Expanded( |
| 439 | + child: Container( | ||
| 440 | + // width: w(134), | ||
| 447 | child: Column( | 441 | child: Column( |
| 448 | crossAxisAlignment: CrossAxisAlignment.start, | 442 | crossAxisAlignment: CrossAxisAlignment.start, |
| 449 | children: [ | 443 | children: [ |
| @@ -474,20 +468,6 @@ class _MenuManagePageState extends State<MenuManagePage> { | @@ -474,20 +468,6 @@ class _MenuManagePageState extends State<MenuManagePage> { | ||
| 474 | model.cooks != '') || | 468 | model.cooks != '') || |
| 475 | (model.taste != null && model.taste != '') || | 469 | (model.taste != null && model.taste != '') || |
| 476 | (model.cooks != null && model.cooks != '')) | 470 | (model.cooks != null && model.cooks != '')) |
| 477 | - VEmptyView(20), | ||
| 478 | - if ((model.taste != null && | ||
| 479 | - model.taste != '' && | ||
| 480 | - model.cooks != null && | ||
| 481 | - model.cooks != '') || | ||
| 482 | - (model.taste != null && model.taste != '') || | ||
| 483 | - (model.cooks != null && model.cooks != '')) | ||
| 484 | - VEmptyView(20), | ||
| 485 | - if ((model.taste != null && | ||
| 486 | - model.taste != '' && | ||
| 487 | - model.cooks != null && | ||
| 488 | - model.cooks != '') || | ||
| 489 | - (model.taste != null && model.taste != '') || | ||
| 490 | - (model.cooks != null && model.cooks != '')) | ||
| 491 | Text( | 471 | Text( |
| 492 | model.taste != null && | 472 | model.taste != null && |
| 493 | model.taste != '' && | 473 | model.taste != '' && |
| @@ -512,10 +492,12 @@ class _MenuManagePageState extends State<MenuManagePage> { | @@ -512,10 +492,12 @@ class _MenuManagePageState extends State<MenuManagePage> { | ||
| 512 | ])) | 492 | ])) |
| 513 | ], | 493 | ], |
| 514 | ), | 494 | ), |
| 515 | - ), | 495 | + )), |
| 516 | HEmptyView(10), | 496 | HEmptyView(10), |
| 517 | model.price == null | 497 | model.price == null |
| 518 | - ? Column(children: _priceWidget(model)) | 498 | + ? Column( |
| 499 | + crossAxisAlignment: CrossAxisAlignment.start, | ||
| 500 | + children: _priceWidget(model)) | ||
| 519 | : Text( | 501 | : Text( |
| 520 | '¥${model.price}/${model.unit} 会员 ¥${model.price}/${model.unit} ', | 502 | '¥${model.price}/${model.unit} 会员 ¥${model.price}/${model.unit} ', |
| 521 | textAlign: TextAlign.right, | 503 | textAlign: TextAlign.right, |
| @@ -601,7 +583,9 @@ class _MenuManagePageState extends State<MenuManagePage> { | @@ -601,7 +583,9 @@ class _MenuManagePageState extends State<MenuManagePage> { | ||
| 601 | Padding( | 583 | Padding( |
| 602 | padding: EdgeInsets.symmetric(horizontal: w(10)), | 584 | padding: EdgeInsets.symmetric(horizontal: w(10)), |
| 603 | child: model.price == null | 585 | child: model.price == null |
| 604 | - ? Column(children: _priceWidget(model)) | 586 | + ? Column( |
| 587 | + crossAxisAlignment: CrossAxisAlignment.start, | ||
| 588 | + children: _priceWidget(model)) | ||
| 605 | : Text( | 589 | : Text( |
| 606 | '¥${model.price}/${model.unit} 会员 ¥${model.member_price}/${model.unit} ', | 590 | '¥${model.price}/${model.unit} 会员 ¥${model.member_price}/${model.unit} ', |
| 607 | textAlign: TextAlign.right, | 591 | textAlign: TextAlign.right, |
| @@ -630,6 +614,7 @@ class _MenuManagePageState extends State<MenuManagePage> { | @@ -630,6 +614,7 @@ class _MenuManagePageState extends State<MenuManagePage> { | ||
| 630 | padding: EdgeInsets.symmetric(horizontal: w(10), vertical: w(10)), | 614 | padding: EdgeInsets.symmetric(horizontal: w(10), vertical: w(10)), |
| 631 | child: Text( | 615 | child: Text( |
| 632 | model.desc ?? "", | 616 | model.desc ?? "", |
| 617 | + textAlign: TextAlign.left, | ||
| 633 | style: TextStyle( | 618 | style: TextStyle( |
| 634 | color: themeColerModel.name == '珍珠白' | 619 | color: themeColerModel.name == '珍珠白' |
| 635 | ? MyColours.color_515151 | 620 | ? MyColours.color_515151 |
| @@ -640,13 +625,16 @@ class _MenuManagePageState extends State<MenuManagePage> { | @@ -640,13 +625,16 @@ class _MenuManagePageState extends State<MenuManagePage> { | ||
| 640 | Align( | 625 | Align( |
| 641 | alignment: Alignment.centerRight, | 626 | alignment: Alignment.centerRight, |
| 642 | child: Padding( | 627 | child: Padding( |
| 643 | - padding: | ||
| 644 | - EdgeInsets.only(right: w(20), top: w(19), bottom: w(19)), | ||
| 645 | - child: Image.asset( | ||
| 646 | - Utils.getImgPath('add_store'), | ||
| 647 | - width: w(22), | ||
| 648 | - ), | ||
| 649 | - )), | 628 | + padding: |
| 629 | + EdgeInsets.only(right: w(20), top: w(19), bottom: w(19)), | ||
| 630 | + child: Text( | ||
| 631 | + '+', | ||
| 632 | + style: TextStyle( | ||
| 633 | + color: themeColerModel1.name == '珍珠白' | ||
| 634 | + ? MyColours.color_515151 | ||
| 635 | + : MyColours.color_FBF6F1, | ||
| 636 | + fontSize: font(36)), | ||
| 637 | + ))), | ||
| 650 | ], | 638 | ], |
| 651 | ), | 639 | ), |
| 652 | ); | 640 | ); |
| @@ -960,6 +948,8 @@ class _MenuManagePageState extends State<MenuManagePage> { | @@ -960,6 +948,8 @@ class _MenuManagePageState extends State<MenuManagePage> { | ||
| 960 | margin: EdgeInsets.only( | 948 | margin: EdgeInsets.only( |
| 961 | bottom: (w(2))), | 949 | bottom: (w(2))), |
| 962 | child: Column( | 950 | child: Column( |
| 951 | + // crossAxisAlignment: | ||
| 952 | + // CrossAxisAlignment.start, | ||
| 963 | crossAxisAlignment: model | 953 | crossAxisAlignment: model |
| 964 | .cookStyle | 954 | .cookStyle |
| 965 | .imageType != | 955 | .imageType != |
| @@ -1017,43 +1007,57 @@ class _MenuManagePageState extends State<MenuManagePage> { | @@ -1017,43 +1007,57 @@ class _MenuManagePageState extends State<MenuManagePage> { | ||
| 1017 | ), | 1007 | ), |
| 1018 | if (model.desc != null && | 1008 | if (model.desc != null && |
| 1019 | model.desc != '') | 1009 | model.desc != '') |
| 1020 | - Padding( | ||
| 1021 | - padding: EdgeInsets | ||
| 1022 | - .symmetric( | ||
| 1023 | - horizontal: | ||
| 1024 | - w(16), | ||
| 1025 | - vertical: | ||
| 1026 | - w(10)), | ||
| 1027 | - child: Text( | ||
| 1028 | - model.desc, | ||
| 1029 | - style: TextStyle( | ||
| 1030 | - color: themeColerModel1 | ||
| 1031 | - .name == | ||
| 1032 | - '珍珠白' | ||
| 1033 | - ? MyColours | ||
| 1034 | - .color_515151 | ||
| 1035 | - : MyColours | ||
| 1036 | - .color_FBF6F1, | ||
| 1037 | - fontSize: | ||
| 1038 | - font(12)), | ||
| 1039 | - ), | ||
| 1040 | - ), | 1010 | + Align( |
| 1011 | + alignment: Alignment | ||
| 1012 | + .centerLeft, | ||
| 1013 | + child: Padding( | ||
| 1014 | + padding: | ||
| 1015 | + EdgeInsets.symmetric( | ||
| 1016 | + horizontal: | ||
| 1017 | + w(16), | ||
| 1018 | + vertical: | ||
| 1019 | + w(10)), | ||
| 1020 | + child: Text( | ||
| 1021 | + model.desc, | ||
| 1022 | + textAlign: | ||
| 1023 | + TextAlign | ||
| 1024 | + .left, | ||
| 1025 | + style: TextStyle( | ||
| 1026 | + color: themeColerModel1 | ||
| 1027 | + .name == | ||
| 1028 | + '珍珠白' | ||
| 1029 | + ? MyColours | ||
| 1030 | + .color_515151 | ||
| 1031 | + : MyColours | ||
| 1032 | + .color_FBF6F1, | ||
| 1033 | + fontSize: | ||
| 1034 | + font(12)), | ||
| 1035 | + ), | ||
| 1036 | + )), | ||
| 1041 | Align( | 1037 | Align( |
| 1042 | alignment: Alignment | 1038 | alignment: Alignment |
| 1043 | .centerRight, | 1039 | .centerRight, |
| 1044 | child: Padding( | 1040 | child: Padding( |
| 1045 | - padding: | ||
| 1046 | - EdgeInsets.only( | ||
| 1047 | - right: w(40), | ||
| 1048 | - top: w(19), | ||
| 1049 | - bottom: | ||
| 1050 | - w(19)), | ||
| 1051 | - child: Image.asset( | ||
| 1052 | - Utils.getImgPath( | ||
| 1053 | - 'add_store'), | ||
| 1054 | - width: w(22), | ||
| 1055 | - ), | ||
| 1056 | - )) | 1041 | + padding: |
| 1042 | + EdgeInsets.only( | ||
| 1043 | + right: | ||
| 1044 | + w(40), | ||
| 1045 | + top: w(19), | ||
| 1046 | + bottom: | ||
| 1047 | + w(19)), | ||
| 1048 | + child: Text( | ||
| 1049 | + '+', | ||
| 1050 | + style: TextStyle( | ||
| 1051 | + color: themeColerModel1 | ||
| 1052 | + .name == | ||
| 1053 | + '珍珠白' | ||
| 1054 | + ? MyColours | ||
| 1055 | + .color_515151 | ||
| 1056 | + : MyColours | ||
| 1057 | + .color_FBF6F1, | ||
| 1058 | + fontSize: | ||
| 1059 | + font(36)), | ||
| 1060 | + ))) | ||
| 1057 | ], | 1061 | ], |
| 1058 | ), | 1062 | ), |
| 1059 | ), | 1063 | ), |
| @@ -1061,7 +1065,7 @@ class _MenuManagePageState extends State<MenuManagePage> { | @@ -1061,7 +1065,7 @@ class _MenuManagePageState extends State<MenuManagePage> { | ||
| 1061 | bottom: | 1065 | bottom: |
| 1062 | ScreenUtil().setWidth(14), | 1066 | ScreenUtil().setWidth(14), |
| 1063 | right: | 1067 | right: |
| 1064 | - ScreenUtil().setWidth(20), | 1068 | + ScreenUtil().setWidth(150), |
| 1065 | child: model.status == '1' | 1069 | child: model.status == '1' |
| 1066 | ? SizedBox() | 1070 | ? SizedBox() |
| 1067 | : Image.asset( | 1071 | : Image.asset( |
| @@ -300,9 +300,18 @@ class _MenuSetPricePageState extends State<MenuSetPricePage> { | @@ -300,9 +300,18 @@ class _MenuSetPricePageState extends State<MenuSetPricePage> { | ||
| 300 | data[index].specid == null | 300 | data[index].specid == null |
| 301 | ? '请选择销售单位' | 301 | ? '请选择销售单位' |
| 302 | : data[index].specs, () async { | 302 | : data[index].specs, () async { |
| 303 | + String specids = ''; | ||
| 304 | + data.forEach((element) { | ||
| 305 | + specids += '${element.specid},'; | ||
| 306 | + }); | ||
| 307 | + if (specids.endsWith(',')) { | ||
| 308 | + specids = specids.substring( | ||
| 309 | + 0, specids.length - 1); | ||
| 310 | + } | ||
| 311 | + | ||
| 303 | Map object = | 312 | Map object = |
| 304 | await NavigatorUtil.goMenuUnitPage( | 313 | await NavigatorUtil.goMenuUnitPage( |
| 305 | - context, data[index].specid); | 314 | + context, data[index].specid,specids); |
| 306 | if (object != null) { | 315 | if (object != null) { |
| 307 | // 'specs': menuManageProvider | 316 | // 'specs': menuManageProvider |
| 308 | // .specSunModel[index].name, | 317 | // .specSunModel[index].name, |
| 1 | import 'dart:convert'; | 1 | import 'dart:convert'; |
| 2 | -import 'dart:io'; | ||
| 3 | 2 | ||
| 4 | import 'package:cached_network_image/cached_network_image.dart'; | 3 | import 'package:cached_network_image/cached_network_image.dart'; |
| 5 | import 'package:flutter/material.dart'; | 4 | import 'package:flutter/material.dart'; |
| 6 | -import 'package:flutter_native_image/flutter_native_image.dart'; | ||
| 7 | import 'package:flutter_screenutil/flutter_screenutil.dart'; | 5 | import 'package:flutter_screenutil/flutter_screenutil.dart'; |
| 8 | import 'package:image_picker/image_picker.dart'; | 6 | import 'package:image_picker/image_picker.dart'; |
| 9 | import 'package:one_key/provider/marketing_center_provider.dart'; | 7 | import 'package:one_key/provider/marketing_center_provider.dart'; |
| @@ -73,6 +71,7 @@ class _MenuThemeColorSetPageState extends State<MenuThemeColorSetPage> { | @@ -73,6 +71,7 @@ class _MenuThemeColorSetPageState extends State<MenuThemeColorSetPage> { | ||
| 73 | WidgetsBinding.instance.addPostFrameCallback((_) { | 71 | WidgetsBinding.instance.addPostFrameCallback((_) { |
| 74 | // getSellerTemplateConf(); | 72 | // getSellerTemplateConf(); |
| 75 | // _getCookbookByClass(showLoading: true); | 73 | // _getCookbookByClass(showLoading: true); |
| 74 | + _getDzSellerConf(); | ||
| 76 | }); | 75 | }); |
| 77 | } | 76 | } |
| 78 | 77 | ||
| @@ -81,6 +80,16 @@ class _MenuThemeColorSetPageState extends State<MenuThemeColorSetPage> { | @@ -81,6 +80,16 @@ class _MenuThemeColorSetPageState extends State<MenuThemeColorSetPage> { | ||
| 81 | super.dispose(); | 80 | super.dispose(); |
| 82 | } | 81 | } |
| 83 | 82 | ||
| 83 | + _getDzSellerConf() async { | ||
| 84 | + bool success = await menuManageProvider.getDzSellerConf(context); | ||
| 85 | + if (success) { | ||
| 86 | + themeColorIndex = menuManageProvider.dzSellerConfModel.cookStyle == null | ||
| 87 | + ? 0 | ||
| 88 | + : int.parse(menuManageProvider.dzSellerConfModel.cookStyle.index); | ||
| 89 | + setState(() {}); | ||
| 90 | + } | ||
| 91 | + } | ||
| 92 | + | ||
| 84 | // getSellerTemplateConf() async { | 93 | // getSellerTemplateConf() async { |
| 85 | // bool success = | 94 | // bool success = |
| 86 | // await _marketingCenterProvider.getSellerTemplateConf(context); | 95 | // await _marketingCenterProvider.getSellerTemplateConf(context); |
| @@ -318,20 +327,6 @@ class _MenuThemeColorSetPageState extends State<MenuThemeColorSetPage> { | @@ -318,20 +327,6 @@ class _MenuThemeColorSetPageState extends State<MenuThemeColorSetPage> { | ||
| 318 | model.cooks != '') || | 327 | model.cooks != '') || |
| 319 | (model.taste != null && model.taste != '') || | 328 | (model.taste != null && model.taste != '') || |
| 320 | (model.cooks != null && model.cooks != '')) | 329 | (model.cooks != null && model.cooks != '')) |
| 321 | - VEmptyView(20), | ||
| 322 | - if ((model.taste != null && | ||
| 323 | - model.taste != '' && | ||
| 324 | - model.cooks != null && | ||
| 325 | - model.cooks != '') || | ||
| 326 | - (model.taste != null && model.taste != '') || | ||
| 327 | - (model.cooks != null && model.cooks != '')) | ||
| 328 | - VEmptyView(20), | ||
| 329 | - if ((model.taste != null && | ||
| 330 | - model.taste != '' && | ||
| 331 | - model.cooks != null && | ||
| 332 | - model.cooks != '') || | ||
| 333 | - (model.taste != null && model.taste != '') || | ||
| 334 | - (model.cooks != null && model.cooks != '')) | ||
| 335 | Text( | 330 | Text( |
| 336 | model.taste != null && | 331 | model.taste != null && |
| 337 | model.taste != '' && | 332 | model.taste != '' && |
| @@ -356,7 +351,9 @@ class _MenuThemeColorSetPageState extends State<MenuThemeColorSetPage> { | @@ -356,7 +351,9 @@ class _MenuThemeColorSetPageState extends State<MenuThemeColorSetPage> { | ||
| 356 | ])), | 351 | ])), |
| 357 | VEmptyView(20), | 352 | VEmptyView(20), |
| 358 | model.price == null | 353 | model.price == null |
| 359 | - ? Column(children: _priceWidget(model)) | 354 | + ? Column( |
| 355 | + crossAxisAlignment: CrossAxisAlignment.start, | ||
| 356 | + children: _priceWidget(model)) | ||
| 360 | : Text( | 357 | : Text( |
| 361 | '¥${model.price}/${model.unit} 会员 ¥${model.price}/${model.unit} ', | 358 | '¥${model.price}/${model.unit} 会员 ¥${model.price}/${model.unit} ', |
| 362 | textAlign: TextAlign.right, | 359 | textAlign: TextAlign.right, |
| @@ -468,7 +465,9 @@ class _MenuThemeColorSetPageState extends State<MenuThemeColorSetPage> { | @@ -468,7 +465,9 @@ class _MenuThemeColorSetPageState extends State<MenuThemeColorSetPage> { | ||
| 468 | ])), | 465 | ])), |
| 469 | VEmptyView(20), | 466 | VEmptyView(20), |
| 470 | model.price == null | 467 | model.price == null |
| 471 | - ? Column(children: _priceWidget(model)) | 468 | + ? Column( |
| 469 | + crossAxisAlignment: CrossAxisAlignment.start, | ||
| 470 | + children: _priceWidget(model)) | ||
| 472 | : Text( | 471 | : Text( |
| 473 | '¥${model.price}/${model.unit} 会员 ¥${model.member_price ?? ''}/${model.unit} ', | 472 | '¥${model.price}/${model.unit} 会员 ¥${model.member_price ?? ''}/${model.unit} ', |
| 474 | textAlign: TextAlign.right, | 473 | textAlign: TextAlign.right, |
| @@ -495,8 +494,9 @@ class _MenuThemeColorSetPageState extends State<MenuThemeColorSetPage> { | @@ -495,8 +494,9 @@ class _MenuThemeColorSetPageState extends State<MenuThemeColorSetPage> { | ||
| 495 | mainAxisAlignment: MainAxisAlignment.spaceBetween, | 494 | mainAxisAlignment: MainAxisAlignment.spaceBetween, |
| 496 | crossAxisAlignment: CrossAxisAlignment.start, | 495 | crossAxisAlignment: CrossAxisAlignment.start, |
| 497 | children: [ | 496 | children: [ |
| 498 | - Container( | ||
| 499 | - width: w(134), | 497 | + Expanded( |
| 498 | + child: Container( | ||
| 499 | + // width: w(134), | ||
| 500 | child: Column( | 500 | child: Column( |
| 501 | crossAxisAlignment: CrossAxisAlignment.start, | 501 | crossAxisAlignment: CrossAxisAlignment.start, |
| 502 | children: [ | 502 | children: [ |
| @@ -527,20 +527,6 @@ class _MenuThemeColorSetPageState extends State<MenuThemeColorSetPage> { | @@ -527,20 +527,6 @@ class _MenuThemeColorSetPageState extends State<MenuThemeColorSetPage> { | ||
| 527 | model.cooks != '') || | 527 | model.cooks != '') || |
| 528 | (model.taste != null && model.taste != '') || | 528 | (model.taste != null && model.taste != '') || |
| 529 | (model.cooks != null && model.cooks != '')) | 529 | (model.cooks != null && model.cooks != '')) |
| 530 | - VEmptyView(20), | ||
| 531 | - if ((model.taste != null && | ||
| 532 | - model.taste != '' && | ||
| 533 | - model.cooks != null && | ||
| 534 | - model.cooks != '') || | ||
| 535 | - (model.taste != null && model.taste != '') || | ||
| 536 | - (model.cooks != null && model.cooks != '')) | ||
| 537 | - VEmptyView(20), | ||
| 538 | - if ((model.taste != null && | ||
| 539 | - model.taste != '' && | ||
| 540 | - model.cooks != null && | ||
| 541 | - model.cooks != '') || | ||
| 542 | - (model.taste != null && model.taste != '') || | ||
| 543 | - (model.cooks != null && model.cooks != '')) | ||
| 544 | Text( | 530 | Text( |
| 545 | model.taste != null && | 531 | model.taste != null && |
| 546 | model.taste != '' && | 532 | model.taste != '' && |
| @@ -565,10 +551,12 @@ class _MenuThemeColorSetPageState extends State<MenuThemeColorSetPage> { | @@ -565,10 +551,12 @@ class _MenuThemeColorSetPageState extends State<MenuThemeColorSetPage> { | ||
| 565 | ])) | 551 | ])) |
| 566 | ], | 552 | ], |
| 567 | ), | 553 | ), |
| 568 | - ), | 554 | + )), |
| 569 | HEmptyView(10), | 555 | HEmptyView(10), |
| 570 | model.price == null | 556 | model.price == null |
| 571 | - ? Column(children: _priceWidget(model)) | 557 | + ? Column( |
| 558 | + crossAxisAlignment: CrossAxisAlignment.start, | ||
| 559 | + children: _priceWidget(model)) | ||
| 572 | : Text( | 560 | : Text( |
| 573 | '¥${model.price}/${model.unit} 会员 ¥${model.price}/${model.unit} ', | 561 | '¥${model.price}/${model.unit} 会员 ¥${model.price}/${model.unit} ', |
| 574 | textAlign: TextAlign.right, | 562 | textAlign: TextAlign.right, |
| @@ -654,7 +642,9 @@ class _MenuThemeColorSetPageState extends State<MenuThemeColorSetPage> { | @@ -654,7 +642,9 @@ class _MenuThemeColorSetPageState extends State<MenuThemeColorSetPage> { | ||
| 654 | Padding( | 642 | Padding( |
| 655 | padding: EdgeInsets.symmetric(horizontal: w(10)), | 643 | padding: EdgeInsets.symmetric(horizontal: w(10)), |
| 656 | child: model.price == null | 644 | child: model.price == null |
| 657 | - ? Column(children: _priceWidget(model)) | 645 | + ? Column( |
| 646 | + crossAxisAlignment: CrossAxisAlignment.start, | ||
| 647 | + children: _priceWidget(model)) | ||
| 658 | : Text( | 648 | : Text( |
| 659 | '¥${model.price}/${model.unit} 会员 ¥${model.member_price}/${model.unit} ', | 649 | '¥${model.price}/${model.unit} 会员 ¥${model.member_price}/${model.unit} ', |
| 660 | textAlign: TextAlign.right, | 650 | textAlign: TextAlign.right, |
| @@ -693,13 +683,16 @@ class _MenuThemeColorSetPageState extends State<MenuThemeColorSetPage> { | @@ -693,13 +683,16 @@ class _MenuThemeColorSetPageState extends State<MenuThemeColorSetPage> { | ||
| 693 | Align( | 683 | Align( |
| 694 | alignment: Alignment.centerRight, | 684 | alignment: Alignment.centerRight, |
| 695 | child: Padding( | 685 | child: Padding( |
| 696 | - padding: | ||
| 697 | - EdgeInsets.only(right: w(20), top: w(19), bottom: w(19)), | ||
| 698 | - child: Image.asset( | ||
| 699 | - Utils.getImgPath('add_store'), | ||
| 700 | - width: w(22), | ||
| 701 | - ), | ||
| 702 | - )), | 686 | + padding: |
| 687 | + EdgeInsets.only(right: w(20), top: w(19), bottom: w(19)), | ||
| 688 | + child: Text( | ||
| 689 | + '+', | ||
| 690 | + style: TextStyle( | ||
| 691 | + color: themeColerModel.name == '珍珠白' | ||
| 692 | + ? MyColours.color_515151 | ||
| 693 | + : MyColours.color_FBF6F1, | ||
| 694 | + fontSize: font(36)), | ||
| 695 | + ))), | ||
| 703 | ], | 696 | ], |
| 704 | ), | 697 | ), |
| 705 | ); | 698 | ); |
| @@ -867,6 +860,8 @@ class _MenuThemeColorSetPageState extends State<MenuThemeColorSetPage> { | @@ -867,6 +860,8 @@ class _MenuThemeColorSetPageState extends State<MenuThemeColorSetPage> { | ||
| 867 | margin: | 860 | margin: |
| 868 | EdgeInsets.only(bottom: (w(2))), | 861 | EdgeInsets.only(bottom: (w(2))), |
| 869 | child: Column( | 862 | child: Column( |
| 863 | + // crossAxisAlignment: | ||
| 864 | + // CrossAxisAlignment.start, | ||
| 870 | crossAxisAlignment: model.cookStyle | 865 | crossAxisAlignment: model.cookStyle |
| 871 | .imageType != | 866 | .imageType != |
| 872 | '2' && | 867 | '2' && |
| @@ -919,43 +914,54 @@ class _MenuThemeColorSetPageState extends State<MenuThemeColorSetPage> { | @@ -919,43 +914,54 @@ class _MenuThemeColorSetPageState extends State<MenuThemeColorSetPage> { | ||
| 919 | ), | 914 | ), |
| 920 | if (model.desc != null && | 915 | if (model.desc != null && |
| 921 | model.desc != '') | 916 | model.desc != '') |
| 922 | - Padding( | ||
| 923 | - padding: EdgeInsets.symmetric( | ||
| 924 | - horizontal: w(16), | ||
| 925 | - vertical: w(10)), | ||
| 926 | - child: Text( | ||
| 927 | - model.desc, | ||
| 928 | - style: TextStyle( | ||
| 929 | - color: themeColerModel | ||
| 930 | - .name == | ||
| 931 | - '珍珠白' | ||
| 932 | - ? MyColours | ||
| 933 | - .color_515151 | ||
| 934 | - : MyColours | ||
| 935 | - .color_FBF6F1, | ||
| 936 | - fontSize: font(12)), | ||
| 937 | - ), | ||
| 938 | - ), | 917 | + Align( |
| 918 | + alignment: | ||
| 919 | + Alignment.centerLeft, | ||
| 920 | + child: Padding( | ||
| 921 | + padding: | ||
| 922 | + EdgeInsets.symmetric( | ||
| 923 | + horizontal: w(16), | ||
| 924 | + vertical: w(10)), | ||
| 925 | + child: Text( | ||
| 926 | + model.desc, | ||
| 927 | + style: TextStyle( | ||
| 928 | + color: themeColerModel | ||
| 929 | + .name == | ||
| 930 | + '珍珠白' | ||
| 931 | + ? MyColours | ||
| 932 | + .color_515151 | ||
| 933 | + : MyColours | ||
| 934 | + .color_FBF6F1, | ||
| 935 | + fontSize: font(12)), | ||
| 936 | + ), | ||
| 937 | + )), | ||
| 939 | Align( | 938 | Align( |
| 940 | alignment: | 939 | alignment: |
| 941 | Alignment.centerRight, | 940 | Alignment.centerRight, |
| 942 | child: Padding( | 941 | child: Padding( |
| 943 | - padding: EdgeInsets.only( | ||
| 944 | - right: w(40), | ||
| 945 | - top: w(19), | ||
| 946 | - bottom: w(19)), | ||
| 947 | - child: Image.asset( | ||
| 948 | - Utils.getImgPath( | ||
| 949 | - 'add_store'), | ||
| 950 | - width: w(22), | ||
| 951 | - ), | ||
| 952 | - )) | 942 | + padding: EdgeInsets.only( |
| 943 | + right: w(40), | ||
| 944 | + top: w(19), | ||
| 945 | + bottom: w(19)), | ||
| 946 | + child: Text( | ||
| 947 | + '+', | ||
| 948 | + style: TextStyle( | ||
| 949 | + color: themeColerModel | ||
| 950 | + .name == | ||
| 951 | + '珍珠白' | ||
| 952 | + ? MyColours | ||
| 953 | + .color_515151 | ||
| 954 | + : MyColours | ||
| 955 | + .color_FBF6F1, | ||
| 956 | + fontSize: font(36)), | ||
| 957 | + ))) | ||
| 953 | ], | 958 | ], |
| 954 | ), | 959 | ), |
| 955 | ), | 960 | ), |
| 956 | Positioned( | 961 | Positioned( |
| 957 | bottom: ScreenUtil().setWidth(14), | 962 | bottom: ScreenUtil().setWidth(14), |
| 958 | - right: ScreenUtil().setWidth(20), | 963 | + right: |
| 964 | + ScreenUtil().setWidth(150), | ||
| 959 | child: model.status == '1' | 965 | child: model.status == '1' |
| 960 | ? SizedBox() | 966 | ? SizedBox() |
| 961 | : Image.asset( | 967 | : Image.asset( |
| @@ -20,7 +20,9 @@ import '../../../widgets/page_exception.dart'; | @@ -20,7 +20,9 @@ import '../../../widgets/page_exception.dart'; | ||
| 20 | class MenuUnitPage extends StatefulWidget { | 20 | class MenuUnitPage extends StatefulWidget { |
| 21 | final String specid; | 21 | final String specid; |
| 22 | 22 | ||
| 23 | - MenuUnitPage({Key key, this.specid}) : super(key: key); | 23 | + final String specids; |
| 24 | + | ||
| 25 | + MenuUnitPage({Key key, this.specid, this.specids}) : super(key: key); | ||
| 24 | 26 | ||
| 25 | @override | 27 | @override |
| 26 | _MenuUnitPageState createState() => _MenuUnitPageState(); | 28 | _MenuUnitPageState createState() => _MenuUnitPageState(); |
| @@ -178,9 +180,17 @@ class _MenuUnitPageState extends State<MenuUnitPage> { | @@ -178,9 +180,17 @@ class _MenuUnitPageState extends State<MenuUnitPage> { | ||
| 178 | DialogUtil.cupertinoAlertDialog( | 180 | DialogUtil.cupertinoAlertDialog( |
| 179 | context, | 181 | context, |
| 180 | content: | 182 | content: |
| 181 | - '确定要删除销售规格“条”吗?删除后,您可以通过添加新规格增加。\n如果有菜品使用该销售单位定价,则无法删除。', | 183 | + '确定要删除销售规格“${menuManageProvider.specSunModel[index].name}”吗?删除后,您可以通过添加新规格增加。\n如果有菜品使用该销售单位定价,则无法删除。', |
| 182 | textAlign: TextAlign.left, | 184 | textAlign: TextAlign.left, |
| 183 | rCallback: () async { | 185 | rCallback: () async { |
| 186 | + if (widget.specids | ||
| 187 | + .split(',') | ||
| 188 | + .contains(menuManageProvider | ||
| 189 | + .specSunModel[index].id)) { | ||
| 190 | + Utils.showToast( | ||
| 191 | + '该菜品正在使用该销售单位,不可删除!'); | ||
| 192 | + return; | ||
| 193 | + } | ||
| 184 | //确定删除 | 194 | //确定删除 |
| 185 | Map<String, String> pramas = { | 195 | Map<String, String> pramas = { |
| 186 | 'sellerid': | 196 | 'sellerid': |
| @@ -198,15 +208,36 @@ class _MenuUnitPageState extends State<MenuUnitPage> { | @@ -198,15 +208,36 @@ class _MenuUnitPageState extends State<MenuUnitPage> { | ||
| 198 | context, pramas); | 208 | context, pramas); |
| 199 | if (success) { | 209 | if (success) { |
| 200 | Utils.showToast('删除成功!'); | 210 | Utils.showToast('删除成功!'); |
| 211 | + | ||
| 212 | + if (App.sp | ||
| 213 | + .containsKey('specid')) { | ||
| 214 | + if (menuManageProvider | ||
| 215 | + .specSunModel[index] | ||
| 216 | + .name == | ||
| 217 | + App.sp.getString('specs')) { | ||
| 218 | + //清空销售计价 | ||
| 219 | + App.sp.remove('specid'); | ||
| 220 | + App.sp.remove('specs'); | ||
| 221 | + } | ||
| 222 | + } | ||
| 223 | + | ||
| 201 | getSpecBySellerid(); | 224 | getSpecBySellerid(); |
| 202 | } | 225 | } |
| 203 | }); | 226 | }); |
| 204 | }, | 227 | }, |
| 205 | - child: Image.asset( | ||
| 206 | - Utils.getImgPath('close'), | ||
| 207 | - width: w(15), | ||
| 208 | - )), | ||
| 209 | - HEmptyView(20) | 228 | + child: Container( |
| 229 | + height: w(48), | ||
| 230 | + padding: EdgeInsets.symmetric( | ||
| 231 | + horizontal: w(10)), | ||
| 232 | + child: Image.asset( | ||
| 233 | + Utils.getImgPath( | ||
| 234 | + menuManageProvider | ||
| 235 | + .specSunModel[index] | ||
| 236 | + .select | ||
| 237 | + ? 'unit_del_white' | ||
| 238 | + : 'unit_del_black'), | ||
| 239 | + width: w(15), | ||
| 240 | + ))), | ||
| 210 | ], | 241 | ], |
| 211 | ), | 242 | ), |
| 212 | )); | 243 | )); |
| @@ -248,9 +279,12 @@ class _MenuUnitPageState extends State<MenuUnitPage> { | @@ -248,9 +279,12 @@ class _MenuUnitPageState extends State<MenuUnitPage> { | ||
| 248 | child: Row( | 279 | child: Row( |
| 249 | mainAxisAlignment: MainAxisAlignment.center, | 280 | mainAxisAlignment: MainAxisAlignment.center, |
| 250 | children: [ | 281 | children: [ |
| 251 | - Image.asset( | ||
| 252 | - Utils.getImgPath('f_add_image'), | ||
| 253 | - width: w(15), | 282 | + Text( |
| 283 | + '+', | ||
| 284 | + style: TextStyle( | ||
| 285 | + fontWeight: FontWeight.w300, | ||
| 286 | + color: MyColours.color_515151, | ||
| 287 | + fontSize: font(26)), | ||
| 254 | ), | 288 | ), |
| 255 | HEmptyView(22), | 289 | HEmptyView(22), |
| 256 | Text( | 290 | Text( |
| @@ -69,7 +69,12 @@ class _OrderPreviewPageState extends State<OrderPreviewPage> { | @@ -69,7 +69,12 @@ class _OrderPreviewPageState extends State<OrderPreviewPage> { | ||
| 69 | } | 69 | } |
| 70 | 70 | ||
| 71 | _getNewRechargeList() async { | 71 | _getNewRechargeList() async { |
| 72 | - await marketingCenterProvider.getNewRechargeList(context); | 72 | + UserModel userModel = Provider.of<UserModel>(context, listen: false); |
| 73 | + Map<String, String> params = { | ||
| 74 | + "sellerid": userModel.user.sellerid, | ||
| 75 | + // 'uid': userModel.user.openid | ||
| 76 | + }; | ||
| 77 | + await marketingCenterProvider.getNewRechargeList(context, params); | ||
| 73 | if (marketingCenterProvider.rechargeList != null && | 78 | if (marketingCenterProvider.rechargeList != null && |
| 74 | marketingCenterProvider.rechargeList.length > 0) { | 79 | marketingCenterProvider.rechargeList.length > 0) { |
| 75 | index = 0; //默认展示第一个 | 80 | index = 0; //默认展示第一个 |
| @@ -5,6 +5,7 @@ import 'package:one_key/provider/user_model.dart'; | @@ -5,6 +5,7 @@ import 'package:one_key/provider/user_model.dart'; | ||
| 5 | import 'package:provider/provider.dart'; | 5 | import 'package:provider/provider.dart'; |
| 6 | 6 | ||
| 7 | import '../constant/constant.dart'; | 7 | import '../constant/constant.dart'; |
| 8 | +import '../constant/error.dart'; | ||
| 8 | import '../models/mark_data_model.dart'; | 9 | import '../models/mark_data_model.dart'; |
| 9 | import '../models/tableOuter.dart'; | 10 | import '../models/tableOuter.dart'; |
| 10 | import '../net/base_resp.dart'; | 11 | import '../net/base_resp.dart'; |
| @@ -22,9 +23,13 @@ class MarketingCenterProvider extends ChangeNotifier { | @@ -22,9 +23,13 @@ class MarketingCenterProvider extends ChangeNotifier { | ||
| 22 | 23 | ||
| 23 | List<RechargeListSunModel> rechargeList = []; | 24 | List<RechargeListSunModel> rechargeList = []; |
| 24 | 25 | ||
| 26 | + List<RechargeListSunModel> rechargeListHistory = []; | ||
| 27 | + | ||
| 25 | RechargeListSunModel rechargeDetail; //充值优惠详情 | 28 | RechargeListSunModel rechargeDetail; //充值优惠详情 |
| 26 | PageState pageStateDetail = PageState.Loading; | 29 | PageState pageStateDetail = PageState.Loading; |
| 27 | 30 | ||
| 31 | + PageState pageStateHistory = PageState.Loading; | ||
| 32 | + | ||
| 28 | //获取桌位列表 | 33 | //获取桌位列表 |
| 29 | getTableList(context, {needLoading = true}) async { | 34 | getTableList(context, {needLoading = true}) async { |
| 30 | UserModel userModel = Provider.of<UserModel>(context, listen: false); | 35 | UserModel userModel = Provider.of<UserModel>(context, listen: false); |
| @@ -90,7 +95,8 @@ class MarketingCenterProvider extends ChangeNotifier { | @@ -90,7 +95,8 @@ class MarketingCenterProvider extends ChangeNotifier { | ||
| 90 | Map<String, String> params = {"sid": userModel.user.sellerid}; | 95 | Map<String, String> params = {"sid": userModel.user.sellerid}; |
| 91 | BaseResp<dynamic> baseResp = await DioUtil() | 96 | BaseResp<dynamic> baseResp = await DioUtil() |
| 92 | .request<dynamic>(context, Method.get, HttpUrl.get_seller_template_conf, | 97 | .request<dynamic>(context, Method.get, HttpUrl.get_seller_template_conf, |
| 93 | - data: params, showLoading:pageState == PageState.Loading? false: showLoading) | 98 | + data: params, |
| 99 | + showLoading: pageState == PageState.Loading ? false : showLoading) | ||
| 94 | .catchError((error) { | 100 | .catchError((error) { |
| 95 | pageState = PageState.ConnectivityError; | 101 | pageState = PageState.ConnectivityError; |
| 96 | print(error.toString()); | 102 | print(error.toString()); |
| @@ -152,17 +158,66 @@ class MarketingCenterProvider extends ChangeNotifier { | @@ -152,17 +158,66 @@ class MarketingCenterProvider extends ChangeNotifier { | ||
| 152 | return false; | 158 | return false; |
| 153 | } | 159 | } |
| 154 | 160 | ||
| 161 | + ///客户经理获取所创建活动列表 | ||
| 162 | + Future<bool> getNewRechargeListHistory( | ||
| 163 | + BuildContext context, Map<String, String> params, | ||
| 164 | + {isShowLoading = true}) async { | ||
| 165 | + if (isShowLoading) { | ||
| 166 | + pageStateHistory = PageState.Loading; | ||
| 167 | + notifyListeners(); | ||
| 168 | + } | ||
| 169 | + | ||
| 170 | + BaseResp<dynamic> baseResp = await DioUtil() | ||
| 171 | + .request<dynamic>(context, Method.get, HttpUrl.get_new_recharge_list, | ||
| 172 | + data: params, | ||
| 173 | + showLoading: | ||
| 174 | + pageStateHistory == PageState.Loading ? false : isShowLoading) | ||
| 175 | + .catchError((error) { | ||
| 176 | + print(error.toString()); | ||
| 177 | + if (error is MyError) { | ||
| 178 | + switch (error.type) { | ||
| 179 | + case 1: | ||
| 180 | + pageStateHistory = PageState.ConnectivityError; | ||
| 181 | + break; | ||
| 182 | + case 2: | ||
| 183 | + pageStateHistory = PageState.ConnectivityTimeOut; | ||
| 184 | + break; | ||
| 185 | + default: | ||
| 186 | + pageStateHistory = PageState.ConnectivityError; | ||
| 187 | + break; | ||
| 188 | + } | ||
| 189 | + } | ||
| 190 | + notifyListeners(); | ||
| 191 | + return false; | ||
| 192 | + }); | ||
| 193 | + if (baseResp.code == Constant.status_success) { | ||
| 194 | + rechargeListHistory = | ||
| 195 | + RechargeListModel.fromJson(baseResp.responseData).data; | ||
| 196 | + if (rechargeListHistory.length == 0) { | ||
| 197 | + pageStateHistory = PageState.Empty; | ||
| 198 | + } else { | ||
| 199 | + pageStateHistory = PageState.Success; | ||
| 200 | + } | ||
| 201 | + notifyListeners(); | ||
| 202 | + return true; | ||
| 203 | + } else { | ||
| 204 | + Utils.showToast(baseResp.msg); | ||
| 205 | + pageStateHistory = PageState.ConnectivityError; | ||
| 206 | + } | ||
| 207 | + notifyListeners(); | ||
| 208 | + return false; | ||
| 209 | + } | ||
| 210 | + | ||
| 155 | // 获取新充值活动列表 | 211 | // 获取新充值活动列表 |
| 156 | - Future<bool> getNewRechargeList(BuildContext context, | 212 | + Future<bool> getNewRechargeList( |
| 213 | + BuildContext context, Map<String, String> params, | ||
| 157 | {bool showLoading = true}) async { | 214 | {bool showLoading = true}) async { |
| 158 | - UserModel userModel = Provider.of<UserModel>(context, listen: false); | ||
| 159 | - Map<String, String> params = { | ||
| 160 | - "sellerid": userModel.user.sellerid, | ||
| 161 | - // 'uid': userModel.user.openid | ||
| 162 | - }; | ||
| 163 | BaseResp<dynamic> baseResp = await DioUtil() | 215 | BaseResp<dynamic> baseResp = await DioUtil() |
| 164 | .request<dynamic>(context, Method.get, HttpUrl.get_new_recharge_list, | 216 | .request<dynamic>(context, Method.get, HttpUrl.get_new_recharge_list, |
| 165 | - data: params, showLoading:pageStateRechargeHome == PageState.Loading ? false: showLoading) | 217 | + data: params, |
| 218 | + showLoading: pageStateRechargeHome == PageState.Loading | ||
| 219 | + ? false | ||
| 220 | + : showLoading) | ||
| 166 | .catchError((error) { | 221 | .catchError((error) { |
| 167 | pageStateRechargeHome = PageState.ConnectivityError; | 222 | pageStateRechargeHome = PageState.ConnectivityError; |
| 168 | print(error.toString()); | 223 | print(error.toString()); |
| @@ -195,7 +250,9 @@ class MarketingCenterProvider extends ChangeNotifier { | @@ -195,7 +250,9 @@ class MarketingCenterProvider extends ChangeNotifier { | ||
| 195 | }; | 250 | }; |
| 196 | BaseResp<dynamic> baseResp = await DioUtil() | 251 | BaseResp<dynamic> baseResp = await DioUtil() |
| 197 | .request<dynamic>(context, Method.get, HttpUrl.get_new_recharge_detail, | 252 | .request<dynamic>(context, Method.get, HttpUrl.get_new_recharge_detail, |
| 198 | - data: params, showLoading:pageStateDetail == PageState.Loading?false: showLoading) | 253 | + data: params, |
| 254 | + showLoading: | ||
| 255 | + pageStateDetail == PageState.Loading ? false : showLoading) | ||
| 199 | .catchError((error) { | 256 | .catchError((error) { |
| 200 | pageStateDetail = PageState.ConnectivityError; | 257 | pageStateDetail = PageState.ConnectivityError; |
| 201 | print(error.toString()); | 258 | print(error.toString()); |
| @@ -215,7 +272,4 @@ class MarketingCenterProvider extends ChangeNotifier { | @@ -215,7 +272,4 @@ class MarketingCenterProvider extends ChangeNotifier { | ||
| 215 | notifyListeners(); | 272 | notifyListeners(); |
| 216 | return false; | 273 | return false; |
| 217 | } | 274 | } |
| 218 | - | ||
| 219 | - | ||
| 220 | - | ||
| 221 | } | 275 | } |
| @@ -1647,20 +1647,24 @@ class NavigatorUtil { | @@ -1647,20 +1647,24 @@ class NavigatorUtil { | ||
| 1647 | 1647 | ||
| 1648 | ///菜单管理------规格和价格设置 | 1648 | ///菜单管理------规格和价格设置 |
| 1649 | static Future<dynamic> goMenuSetPricePage( | 1649 | static Future<dynamic> goMenuSetPricePage( |
| 1650 | - BuildContext context, Map object, { | 1650 | + BuildContext context, |
| 1651 | + Map object, { | ||
| 1651 | replace = false, | 1652 | replace = false, |
| 1652 | }) { | 1653 | }) { |
| 1653 | - return _navigateTo(context, "${Routes.menu_set_price_page}?object=${FluroConvertUtils.object2string(object)}", | 1654 | + return _navigateTo(context, |
| 1655 | + "${Routes.menu_set_price_page}?object=${FluroConvertUtils.object2string(object)}", | ||
| 1654 | replace: replace); | 1656 | replace: replace); |
| 1655 | } | 1657 | } |
| 1656 | 1658 | ||
| 1657 | ///菜单管理-----配置销售单位 | 1659 | ///菜单管理-----配置销售单位 |
| 1658 | static Future<dynamic> goMenuUnitPage( | 1660 | static Future<dynamic> goMenuUnitPage( |
| 1659 | BuildContext context, | 1661 | BuildContext context, |
| 1660 | - String specid, { | 1662 | + String specid, |
| 1663 | + String specids, { | ||
| 1661 | replace = false, | 1664 | replace = false, |
| 1662 | }) { | 1665 | }) { |
| 1663 | - return _navigateTo(context, "${Routes.menu_unit_page}?specid=$specid", | 1666 | + return _navigateTo( |
| 1667 | + context, "${Routes.menu_unit_page}?specid=$specid&specids=$specids", | ||
| 1664 | replace: replace); | 1668 | replace: replace); |
| 1665 | } | 1669 | } |
| 1666 | 1670 | ||
| @@ -1685,4 +1689,9 @@ class NavigatorUtil { | @@ -1685,4 +1689,9 @@ class NavigatorUtil { | ||
| 1685 | "${Routes.menu_theme_color_set_page}?object=${FluroConvertUtils.object2string(object)}", | 1689 | "${Routes.menu_theme_color_set_page}?object=${FluroConvertUtils.object2string(object)}", |
| 1686 | replace: replace); | 1690 | replace: replace); |
| 1687 | } | 1691 | } |
| 1692 | + | ||
| 1693 | + /// 充值优惠历史列表 | ||
| 1694 | + static void goRechargeHistoryPage(BuildContext context, {replace = false}) { | ||
| 1695 | + _navigateTo(context, "${Routes.recharge_history_page}", replace: replace); | ||
| 1696 | + } | ||
| 1688 | } | 1697 | } |
| @@ -196,6 +196,7 @@ import '../pages/my/marketing_center/book_notification/store_introduce_page.dart | @@ -196,6 +196,7 @@ import '../pages/my/marketing_center/book_notification/store_introduce_page.dart | ||
| 196 | import '../pages/my/marketing_center/marketing_center_home_page.dart'; | 196 | import '../pages/my/marketing_center/marketing_center_home_page.dart'; |
| 197 | import '../pages/my/marketing_center/recharge/recharge_detail_page.dart'; | 197 | import '../pages/my/marketing_center/recharge/recharge_detail_page.dart'; |
| 198 | import '../pages/my/marketing_center/recharge/recharge_edit_page.dart'; | 198 | import '../pages/my/marketing_center/recharge/recharge_edit_page.dart'; |
| 199 | +import '../pages/my/marketing_center/recharge/recharge_history_page.dart'; | ||
| 199 | import '../pages/my/marketing_center/recharge/recharge_home_page.dart'; | 200 | import '../pages/my/marketing_center/recharge/recharge_home_page.dart'; |
| 200 | import '../pages/my/marketing_center/recharge/recharge_select_store_coupon_page.dart'; | 201 | import '../pages/my/marketing_center/recharge/recharge_select_store_coupon_page.dart'; |
| 201 | import '../pages/my/menu_type/menu_add_dishes_page.dart'; | 202 | import '../pages/my/menu_type/menu_add_dishes_page.dart'; |
| @@ -2703,11 +2704,15 @@ var menuSetPricePageHandle = new Handler( | @@ -2703,11 +2704,15 @@ var menuSetPricePageHandle = new Handler( | ||
| 2703 | var menuUnitPageHandle = new Handler( | 2704 | var menuUnitPageHandle = new Handler( |
| 2704 | handlerFunc: (BuildContext context, Map<dynamic, List<Object>> params) { | 2705 | handlerFunc: (BuildContext context, Map<dynamic, List<Object>> params) { |
| 2705 | String specid = params["specid"].first; | 2706 | String specid = params["specid"].first; |
| 2707 | + | ||
| 2708 | + | ||
| 2709 | + | ||
| 2710 | + String specids = params["specids"].first; | ||
| 2706 | // NotebookDetail detailEntity = NotebookDetail.fromJson(json | 2711 | // NotebookDetail detailEntity = NotebookDetail.fromJson(json |
| 2707 | // .decode(FluroConvertUtils.fluroCnParamsDecode(params["detail"].first))); | 2712 | // .decode(FluroConvertUtils.fluroCnParamsDecode(params["detail"].first))); |
| 2708 | 2713 | ||
| 2709 | return ChangeNotifierProvider<MenuManageProvider>( | 2714 | return ChangeNotifierProvider<MenuManageProvider>( |
| 2710 | - create: (_) => MenuManageProvider(), child: MenuUnitPage(specid: specid)); | 2715 | + create: (_) => MenuManageProvider(), child: MenuUnitPage(specid: specid,specids:specids)); |
| 2711 | }); | 2716 | }); |
| 2712 | 2717 | ||
| 2713 | ///菜单管理--做法 | 2718 | ///菜单管理--做法 |
| @@ -2737,3 +2742,13 @@ var menuThemeColorSetPageHandle = new Handler( | @@ -2737,3 +2742,13 @@ var menuThemeColorSetPageHandle = new Handler( | ||
| 2737 | create: (_) => MenuManageProvider(), | 2742 | create: (_) => MenuManageProvider(), |
| 2738 | child: MenuThemeColorSetPage(menuModel: res)); | 2743 | child: MenuThemeColorSetPage(menuModel: res)); |
| 2739 | }); | 2744 | }); |
| 2745 | + | ||
| 2746 | +///充值优惠过期历史 | ||
| 2747 | +var rechargeHistoryPageHandle = new Handler( | ||
| 2748 | + handlerFunc: (BuildContext context, Map<dynamic, List<Object>> params) { | ||
| 2749 | + // String idstr = params["idstr"].first; | ||
| 2750 | + // NotebookDetail detailEntity = NotebookDetail.fromJson(json | ||
| 2751 | + // .decode(FluroConvertUtils.fluroCnParamsDecode(params["detail"].first))); | ||
| 2752 | + return ChangeNotifierProvider<MarketingCenterProvider>( | ||
| 2753 | + create: (_) => MarketingCenterProvider(), child: RechargeHistoryPage()); | ||
| 2754 | +}); |
| @@ -237,6 +237,8 @@ class Routes { | @@ -237,6 +237,8 @@ class Routes { | ||
| 237 | "/marking_recharge_select_page"; //充值优惠单选择页面 | 237 | "/marking_recharge_select_page"; //充值优惠单选择页面 |
| 238 | static String order_share_page = "/order_share_page"; //排菜单微信分享截屏 | 238 | static String order_share_page = "/order_share_page"; //排菜单微信分享截屏 |
| 239 | 239 | ||
| 240 | + static String recharge_history_page = "/recharge_history_page"; //充值优惠过期券 | ||
| 241 | + | ||
| 240 | /** 菜单管理 | 242 | /** 菜单管理 |
| 241 | */ | 243 | */ |
| 242 | 244 | ||
| @@ -472,7 +474,11 @@ class Routes { | @@ -472,7 +474,11 @@ class Routes { | ||
| 472 | router.define(menu_set_price_page, handler: menuSetPricePageHandle); | 474 | router.define(menu_set_price_page, handler: menuSetPricePageHandle); |
| 473 | router.define(menu_unit_page, handler: menuUnitPageHandle); | 475 | router.define(menu_unit_page, handler: menuUnitPageHandle); |
| 474 | router.define(menu_dish_method_page, handler: menuDishMethodPageHandle); | 476 | router.define(menu_dish_method_page, handler: menuDishMethodPageHandle); |
| 475 | - router.define(menu_theme_color_set_page, handler: menuThemeColorSetPageHandle); | ||
| 476 | - | 477 | + router.define(menu_theme_color_set_page, |
| 478 | + handler: menuThemeColorSetPageHandle); | ||
| 479 | + router.define(recharge_history_page, | ||
| 480 | + handler: rechargeHistoryPageHandle); | ||
| 481 | + | ||
| 482 | + | ||
| 477 | } | 483 | } |
| 478 | } | 484 | } |
-
Please register or login to post a comment