Showing
6 changed files
with
209 additions
and
173 deletions
| @@ -449,7 +449,7 @@ | @@ -449,7 +449,7 @@ | ||
| 449 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; | 449 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; |
| 450 | CLANG_ENABLE_MODULES = YES; | 450 | CLANG_ENABLE_MODULES = YES; |
| 451 | CODE_SIGN_ENTITLEMENTS = Runner/Runner.entitlements; | 451 | CODE_SIGN_ENTITLEMENTS = Runner/Runner.entitlements; |
| 452 | - CURRENT_PROJECT_VERSION = 5550; | 452 | + CURRENT_PROJECT_VERSION = 5551; |
| 453 | DEVELOPMENT_TEAM = 8J59HM8B82; | 453 | DEVELOPMENT_TEAM = 8J59HM8B82; |
| 454 | ENABLE_BITCODE = NO; | 454 | ENABLE_BITCODE = NO; |
| 455 | INFOPLIST_FILE = Runner/Info.plist; | 455 | INFOPLIST_FILE = Runner/Info.plist; |
| @@ -632,7 +632,7 @@ | @@ -632,7 +632,7 @@ | ||
| 632 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; | 632 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; |
| 633 | CLANG_ENABLE_MODULES = YES; | 633 | CLANG_ENABLE_MODULES = YES; |
| 634 | CODE_SIGN_ENTITLEMENTS = Runner/Runner.entitlements; | 634 | CODE_SIGN_ENTITLEMENTS = Runner/Runner.entitlements; |
| 635 | - CURRENT_PROJECT_VERSION = 5550; | 635 | + CURRENT_PROJECT_VERSION = 5551; |
| 636 | DEVELOPMENT_TEAM = 8J59HM8B82; | 636 | DEVELOPMENT_TEAM = 8J59HM8B82; |
| 637 | ENABLE_BITCODE = NO; | 637 | ENABLE_BITCODE = NO; |
| 638 | INFOPLIST_FILE = Runner/Info.plist; | 638 | INFOPLIST_FILE = Runner/Info.plist; |
| @@ -658,7 +658,7 @@ | @@ -658,7 +658,7 @@ | ||
| 658 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; | 658 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; |
| 659 | CLANG_ENABLE_MODULES = YES; | 659 | CLANG_ENABLE_MODULES = YES; |
| 660 | CODE_SIGN_ENTITLEMENTS = Runner/Runner.entitlements; | 660 | CODE_SIGN_ENTITLEMENTS = Runner/Runner.entitlements; |
| 661 | - CURRENT_PROJECT_VERSION = 5550; | 661 | + CURRENT_PROJECT_VERSION = 5551; |
| 662 | DEVELOPMENT_TEAM = 8J59HM8B82; | 662 | DEVELOPMENT_TEAM = 8J59HM8B82; |
| 663 | ENABLE_BITCODE = NO; | 663 | ENABLE_BITCODE = NO; |
| 664 | INFOPLIST_FILE = Runner/Info.plist; | 664 | INFOPLIST_FILE = Runner/Info.plist; |
| @@ -211,17 +211,29 @@ class _CouponDetailPageState extends State<CouponDetailPage> { | @@ -211,17 +211,29 @@ class _CouponDetailPageState extends State<CouponDetailPage> { | ||
| 211 | fontSize: ScreenUtil().setSp(32)), | 211 | fontSize: ScreenUtil().setSp(32)), |
| 212 | ), | 212 | ), |
| 213 | ), | 213 | ), |
| 214 | - Spacer(), | ||
| 215 | - Image.asset( | ||
| 216 | - swich | ||
| 217 | - ? Utils.getImgPath(title == '立即启用' || title == '是否核销' | ||
| 218 | - ? 'swich_on' | ||
| 219 | - : 'swich_on_lit') | ||
| 220 | - : Utils.getImgPath(title == '立即启用' || title == '是否核销' | ||
| 221 | - ? 'swich_off' | ||
| 222 | - : 'swich_off_lit'), | ||
| 223 | - width: ScreenUtil().setWidth(44 * 2), | ||
| 224 | - ) | 214 | + HEmptyView(10), |
| 215 | + Expanded( | ||
| 216 | + child: Text( | ||
| 217 | + swich ? '是' : '否', | ||
| 218 | + maxLines: 1, | ||
| 219 | + textAlign: TextAlign.right, | ||
| 220 | + overflow: TextOverflow.ellipsis, | ||
| 221 | + style: TextStyle( | ||
| 222 | + color: Color.fromRGBO(0, 0, 0, 0.4), | ||
| 223 | + fontSize: ScreenUtil().setSp(32), | ||
| 224 | + ), | ||
| 225 | + )) | ||
| 226 | + | ||
| 227 | + // Image.asset( | ||
| 228 | + // swich | ||
| 229 | + // ? Utils.getImgPath(title == '立即启用' || title == '是否核销' | ||
| 230 | + // ? 'swich_on' | ||
| 231 | + // : 'swich_on_lit') | ||
| 232 | + // : Utils.getImgPath(title == '立即启用' || title == '是否核销' | ||
| 233 | + // ? 'swich_off' | ||
| 234 | + // : 'swich_off_lit'), | ||
| 235 | + // width: ScreenUtil().setWidth(44 * 2), | ||
| 236 | + // ) | ||
| 225 | ], | 237 | ], |
| 226 | ), | 238 | ), |
| 227 | ); | 239 | ); |
| @@ -837,7 +849,7 @@ class _CouponDetailPageState extends State<CouponDetailPage> { | @@ -837,7 +849,7 @@ class _CouponDetailPageState extends State<CouponDetailPage> { | ||
| 837 | // ), | 849 | // ), |
| 838 | // VEmptyView(24), | 850 | // VEmptyView(24), |
| 839 | _canUse( | 851 | _canUse( |
| 840 | - '立即启用', | 852 | + '是否启用', |
| 841 | couponProvider.couponSunModel!.status == '1' | 853 | couponProvider.couponSunModel!.status == '1' |
| 842 | ? true | 854 | ? true |
| 843 | : false), | 855 | : false), |
| @@ -875,107 +887,92 @@ class _CouponDetailPageState extends State<CouponDetailPage> { | @@ -875,107 +887,92 @@ class _CouponDetailPageState extends State<CouponDetailPage> { | ||
| 875 | width: w(100), | 887 | width: w(100), |
| 876 | gradientStart: MyColours.color_ffffff, | 888 | gradientStart: MyColours.color_ffffff, |
| 877 | gradientEnd: MyColours.color_ffffff, | 889 | gradientEnd: MyColours.color_ffffff, |
| 878 | - borderColor: canOperate | ||
| 879 | - ? MyColours.color_438E93 | ||
| 880 | - : MyColours.color_999999, | ||
| 881 | - textColor: canOperate | ||
| 882 | - ? MyColours.color_438E93 | ||
| 883 | - : MyColours.color_999999, | 890 | + borderColor: MyColours.color_438E93, |
| 891 | + textColor: MyColours.color_438E93, | ||
| 884 | height: ScreenUtil().setWidth(80), | 892 | height: ScreenUtil().setWidth(80), |
| 885 | radius: ScreenUtil().setWidth(14), | 893 | radius: ScreenUtil().setWidth(14), |
| 886 | isBold: true, | 894 | isBold: true, |
| 887 | fontSize: 28, | 895 | fontSize: 28, |
| 888 | onPressed: () async { | 896 | onPressed: () async { |
| 889 | - if (canOperate) { | ||
| 890 | - if (couponProvider.couponSunModel!.status != | ||
| 891 | - '1') { | ||
| 892 | - Utils.showToast('请先启用优惠券后再进行操作!'); | ||
| 893 | - return; | ||
| 894 | - } | 897 | + if (couponProvider.couponSunModel!.status != '1') { |
| 898 | + Utils.showToast('请先启用优惠券后再进行操作!'); | ||
| 899 | + return; | ||
| 900 | + } | ||
| 895 | 901 | ||
| 896 | - if (couponProvider.couponSunModel!.isType == | ||
| 897 | - '3') { | 902 | + if (couponProvider.couponSunModel!.isType == '3') { |
| 903 | + NavigatorUtil.goCouponPosterPage( | ||
| 904 | + context, | ||
| 905 | + widget.idstr, | ||
| 906 | + couponProvider.couponSunModel!.use, | ||
| 907 | + couponProvider.couponSunModel); | ||
| 908 | + } else { | ||
| 909 | + // 谁可以发放 | ||
| 910 | + // 可以发放的才能分享 | ||
| 911 | + if (couponProvider.couponSunModel!.uidList! | ||
| 912 | + .split(',') | ||
| 913 | + .contains(Provider.of<UserModel>(context, | ||
| 914 | + listen: false) | ||
| 915 | + .user! | ||
| 916 | + .openid)) { | ||
| 898 | NavigatorUtil.goCouponPosterPage( | 917 | NavigatorUtil.goCouponPosterPage( |
| 899 | context, | 918 | context, |
| 900 | widget.idstr, | 919 | widget.idstr, |
| 901 | couponProvider.couponSunModel!.use, | 920 | couponProvider.couponSunModel!.use, |
| 902 | couponProvider.couponSunModel); | 921 | couponProvider.couponSunModel); |
| 903 | } else { | 922 | } else { |
| 904 | - // 谁可以发放 | ||
| 905 | - // 可以发放的才能分享 | ||
| 906 | - if (couponProvider.couponSunModel!.uidList! | ||
| 907 | - .split(',') | ||
| 908 | - .contains(Provider.of<UserModel>(context, | ||
| 909 | - listen: false) | ||
| 910 | - .user! | ||
| 911 | - .openid)) { | ||
| 912 | - NavigatorUtil.goCouponPosterPage( | ||
| 913 | - context, | ||
| 914 | - widget.idstr, | ||
| 915 | - couponProvider.couponSunModel!.use, | ||
| 916 | - couponProvider.couponSunModel); | ||
| 917 | - } else { | ||
| 918 | - Utils.showToast('您没有此权限'); | ||
| 919 | - } | 923 | + Utils.showToast('您没有此权限'); |
| 920 | } | 924 | } |
| 921 | } | 925 | } |
| 922 | }, | 926 | }, |
| 923 | ), | 927 | ), |
| 924 | if (couponProvider.couponSunModel!.liteQrcode != null) | 928 | if (couponProvider.couponSunModel!.liteQrcode != null) |
| 925 | HEmptyView(30), | 929 | HEmptyView(30), |
| 926 | - if (couponProvider.couponSunModel!.isType == '3' || | ||
| 927 | - couponProvider.couponSunModel!.isType == '1') | 930 | + if ((couponProvider.couponSunModel!.isType == '3' || |
| 931 | + couponProvider.couponSunModel!.isType == '1') && | ||
| 932 | + canOperate) | ||
| 928 | RoundButton( | 933 | RoundButton( |
| 929 | text: '复用', | 934 | text: '复用', |
| 930 | width: w(100), | 935 | width: w(100), |
| 931 | gradientStart: MyColours.color_ffffff, | 936 | gradientStart: MyColours.color_ffffff, |
| 932 | gradientEnd: MyColours.color_ffffff, | 937 | gradientEnd: MyColours.color_ffffff, |
| 933 | - borderColor: canOperate | ||
| 934 | - ? MyColours.color_438E93 | ||
| 935 | - : MyColours.color_999999, | ||
| 936 | - textColor: canOperate | ||
| 937 | - ? MyColours.color_438E93 | ||
| 938 | - : MyColours.color_999999, | 938 | + borderColor: MyColours.color_438E93, |
| 939 | + textColor: MyColours.color_438E93, | ||
| 939 | height: ScreenUtil().setWidth(80), | 940 | height: ScreenUtil().setWidth(80), |
| 940 | radius: ScreenUtil().setWidth(14), | 941 | radius: ScreenUtil().setWidth(14), |
| 941 | isBold: true, | 942 | isBold: true, |
| 942 | fontSize: 28, | 943 | fontSize: 28, |
| 943 | onPressed: () async { | 944 | onPressed: () async { |
| 944 | - if (canOperate) { | ||
| 945 | - if (couponProvider.couponSunModel!.isType == | ||
| 946 | - '3') { | ||
| 947 | - //复用,跳转至编辑页面 | ||
| 948 | - dynamic needRefresh = | ||
| 949 | - await NavigatorUtil.goCouponEditPage( | ||
| 950 | - context, | ||
| 951 | - isMine: couponProvider | ||
| 952 | - .couponSunModel!.isType == | ||
| 953 | - '1' | ||
| 954 | - ? false | ||
| 955 | - : true, | ||
| 956 | - couponSunModel: | ||
| 957 | - couponProvider.couponSunModel); | ||
| 958 | - if (needRefresh != null && needRefresh) { | ||
| 959 | - if (Navigator.canPop(context)) { | ||
| 960 | - Navigator.pop(context); | ||
| 961 | - } | 945 | + if (couponProvider.couponSunModel!.isType == '3') { |
| 946 | + //复用,跳转至编辑页面 | ||
| 947 | + dynamic needRefresh = | ||
| 948 | + await NavigatorUtil.goCouponEditPage(context, | ||
| 949 | + isMine: couponProvider | ||
| 950 | + .couponSunModel!.isType == | ||
| 951 | + '1' | ||
| 952 | + ? false | ||
| 953 | + : true, | ||
| 954 | + couponSunModel: | ||
| 955 | + couponProvider.couponSunModel); | ||
| 956 | + if (needRefresh != null && needRefresh) { | ||
| 957 | + if (Navigator.canPop(context)) { | ||
| 958 | + Navigator.pop(context); | ||
| 962 | } | 959 | } |
| 963 | - } else { | ||
| 964 | - //复用,跳转至编辑页面 | ||
| 965 | - dynamic needRefresh = | ||
| 966 | - await NavigatorUtil.goCouponEditPayPage( | ||
| 967 | - context, | ||
| 968 | - isMine: couponProvider | ||
| 969 | - .couponSunModel!.isType == | ||
| 970 | - '1' | ||
| 971 | - ? false | ||
| 972 | - : true, | ||
| 973 | - couponSunModel: | ||
| 974 | - couponProvider.couponSunModel); | ||
| 975 | - if (needRefresh != null && needRefresh) { | ||
| 976 | - if (Navigator.canPop(context)) { | ||
| 977 | - Navigator.pop(context); | ||
| 978 | - } | 960 | + } |
| 961 | + } else { | ||
| 962 | + //复用,跳转至编辑页面 | ||
| 963 | + dynamic needRefresh = | ||
| 964 | + await NavigatorUtil.goCouponEditPayPage( | ||
| 965 | + context, | ||
| 966 | + isMine: couponProvider | ||
| 967 | + .couponSunModel!.isType == | ||
| 968 | + '1' | ||
| 969 | + ? false | ||
| 970 | + : true, | ||
| 971 | + couponSunModel: | ||
| 972 | + couponProvider.couponSunModel); | ||
| 973 | + if (needRefresh != null && needRefresh) { | ||
| 974 | + if (Navigator.canPop(context)) { | ||
| 975 | + Navigator.pop(context); | ||
| 979 | } | 976 | } |
| 980 | } | 977 | } |
| 981 | } | 978 | } |
| @@ -987,25 +984,34 @@ class _CouponDetailPageState extends State<CouponDetailPage> { | @@ -987,25 +984,34 @@ class _CouponDetailPageState extends State<CouponDetailPage> { | ||
| 987 | text: '分享给客户', | 984 | text: '分享给客户', |
| 988 | height: ScreenUtil().setWidth(80), | 985 | height: ScreenUtil().setWidth(80), |
| 989 | radius: ScreenUtil().setWidth(14), | 986 | radius: ScreenUtil().setWidth(14), |
| 990 | - gradientStart: canOperate | ||
| 991 | - ? MyColours.color_438E93 | ||
| 992 | - : MyColours.color_999999, | ||
| 993 | - gradientEnd: canOperate | ||
| 994 | - ? MyColours.color_438E93 | ||
| 995 | - : MyColours.color_999999, | 987 | + gradientStart: MyColours.color_438E93, |
| 988 | + gradientEnd: MyColours.color_438E93, | ||
| 996 | isBold: false, | 989 | isBold: false, |
| 997 | fontSize: 28, | 990 | fontSize: 28, |
| 998 | onPressed: () { | 991 | onPressed: () { |
| 999 | - if (canOperate) { | ||
| 1000 | - if (couponProvider.couponSunModel!.status != | ||
| 1001 | - '1') { | ||
| 1002 | - Utils.showToast('请先启用优惠券后再进行操作!'); | ||
| 1003 | - return; | ||
| 1004 | - } | ||
| 1005 | - if (couponProvider.couponSunModel!.status == | ||
| 1006 | - '1') { | ||
| 1007 | - if (couponProvider.couponSunModel!.isType == | ||
| 1008 | - '3') { | 992 | + if (couponProvider.couponSunModel!.status != '1') { |
| 993 | + Utils.showToast('请先启用优惠券后再进行操作!'); | ||
| 994 | + return; | ||
| 995 | + } | ||
| 996 | + if (couponProvider.couponSunModel!.status == '1') { | ||
| 997 | + if (couponProvider.couponSunModel!.isType == | ||
| 998 | + '3') { | ||
| 999 | + Utils.goShareBuyCouponToWeChat( | ||
| 1000 | + context, | ||
| 1001 | + widget.idstr, | ||
| 1002 | + couponProvider.couponSunModel!.isType, | ||
| 1003 | + couponProvider.couponSunModel!.use, | ||
| 1004 | + couponProvider.couponSunModel); | ||
| 1005 | + } else { | ||
| 1006 | + // 谁可以发放 | ||
| 1007 | + // 可以发放的才能分享 | ||
| 1008 | + if (couponProvider.couponSunModel!.uidList! | ||
| 1009 | + .split(',') | ||
| 1010 | + .contains(Provider.of<UserModel>(context, | ||
| 1011 | + listen: false) | ||
| 1012 | + .user! | ||
| 1013 | + .openid)) { | ||
| 1014 | + //包含当前登录人 | ||
| 1009 | Utils.goShareBuyCouponToWeChat( | 1015 | Utils.goShareBuyCouponToWeChat( |
| 1010 | context, | 1016 | context, |
| 1011 | widget.idstr, | 1017 | widget.idstr, |
| @@ -1013,37 +1019,20 @@ class _CouponDetailPageState extends State<CouponDetailPage> { | @@ -1013,37 +1019,20 @@ class _CouponDetailPageState extends State<CouponDetailPage> { | ||
| 1013 | couponProvider.couponSunModel!.use, | 1019 | couponProvider.couponSunModel!.use, |
| 1014 | couponProvider.couponSunModel); | 1020 | couponProvider.couponSunModel); |
| 1015 | } else { | 1021 | } else { |
| 1016 | - // 谁可以发放 | ||
| 1017 | - // 可以发放的才能分享 | ||
| 1018 | - if (couponProvider.couponSunModel!.uidList! | ||
| 1019 | - .split(',') | ||
| 1020 | - .contains(Provider.of<UserModel>(context, | ||
| 1021 | - listen: false) | ||
| 1022 | - .user! | ||
| 1023 | - .openid)) { | ||
| 1024 | - //包含当前登录人 | ||
| 1025 | - Utils.goShareBuyCouponToWeChat( | ||
| 1026 | - context, | ||
| 1027 | - widget.idstr, | ||
| 1028 | - couponProvider.couponSunModel!.isType, | ||
| 1029 | - couponProvider.couponSunModel!.use, | ||
| 1030 | - couponProvider.couponSunModel); | ||
| 1031 | - } else { | ||
| 1032 | - Utils.showToast('您没有此权限'); | ||
| 1033 | - } | 1022 | + Utils.showToast('您没有此权限'); |
| 1034 | } | 1023 | } |
| 1035 | } | 1024 | } |
| 1036 | - // else if (couponProvider.couponSunModel.isType == | ||
| 1037 | - // '2' && | ||
| 1038 | - // couponProvider.couponSunModel.status == '1') { | ||
| 1039 | - // // 我的优惠券 | ||
| 1040 | - // Utils.goShareBuyCouponToWeChatMy( | ||
| 1041 | - // context, | ||
| 1042 | - // widget.idstr, | ||
| 1043 | - // managerName, | ||
| 1044 | - // couponProvider.couponSunModel); | ||
| 1045 | - // } | ||
| 1046 | } | 1025 | } |
| 1026 | + // else if (couponProvider.couponSunModel.isType == | ||
| 1027 | + // '2' && | ||
| 1028 | + // couponProvider.couponSunModel.status == '1') { | ||
| 1029 | + // // 我的优惠券 | ||
| 1030 | + // Utils.goShareBuyCouponToWeChatMy( | ||
| 1031 | + // context, | ||
| 1032 | + // widget.idstr, | ||
| 1033 | + // managerName, | ||
| 1034 | + // couponProvider.couponSunModel); | ||
| 1035 | + // } | ||
| 1047 | }, | 1036 | }, |
| 1048 | ), | 1037 | ), |
| 1049 | ) | 1038 | ) |
| @@ -242,7 +242,10 @@ class HomePageState extends State<HomePage> with WidgetsBindingObserver { | @@ -242,7 +242,10 @@ class HomePageState extends State<HomePage> with WidgetsBindingObserver { | ||
| 242 | child: ChangeNotifierProvider<CustomerProvider>( | 242 | child: ChangeNotifierProvider<CustomerProvider>( |
| 243 | create: (_) => CustomerProvider(), | 243 | create: (_) => CustomerProvider(), |
| 244 | child: ChangeNotifierProvider<UserModel>( | 244 | child: ChangeNotifierProvider<UserModel>( |
| 245 | - create: (_) => UserModel(), child: MyPage()))), | 245 | + create: (_) => UserModel(), |
| 246 | + child: ChangeNotifierProvider<PersonnelProvider>( | ||
| 247 | + create: (_) => PersonnelProvider(), | ||
| 248 | + child: MyPage())))), | ||
| 246 | ))); | 249 | ))); |
| 247 | WidgetsBinding.instance.addPostFrameCallback((_) async { | 250 | WidgetsBinding.instance.addPostFrameCallback((_) async { |
| 248 | // bus.on('refresh_token', (arg) { | 251 | // bus.on('refresh_token', (arg) { |
| 1 | - | ||
| 2 | import 'package:flutter/material.dart'; | 1 | import 'package:flutter/material.dart'; |
| 3 | 2 | ||
| 4 | import 'package:flutter_screenutil/flutter_screenutil.dart'; | 3 | import 'package:flutter_screenutil/flutter_screenutil.dart'; |
| @@ -48,8 +47,8 @@ class _RechargeDetailPageState extends State<RechargeDetailPage> { | @@ -48,8 +47,8 @@ class _RechargeDetailPageState extends State<RechargeDetailPage> { | ||
| 48 | } | 47 | } |
| 49 | 48 | ||
| 50 | _getNewRechargeDetail() async { | 49 | _getNewRechargeDetail() async { |
| 51 | - bool success = await marketingCenterProvider!.getNewRechargeDetail( | ||
| 52 | - context, widget.idstr); | 50 | + bool success = await marketingCenterProvider! |
| 51 | + .getNewRechargeDetail(context, widget.idstr); | ||
| 53 | } | 52 | } |
| 54 | 53 | ||
| 55 | ///输入框 | 54 | ///输入框 |
| @@ -133,18 +132,18 @@ class _RechargeDetailPageState extends State<RechargeDetailPage> { | @@ -133,18 +132,18 @@ class _RechargeDetailPageState extends State<RechargeDetailPage> { | ||
| 133 | children: [ | 132 | children: [ |
| 134 | Container( | 133 | Container( |
| 135 | child: Text( | 134 | child: Text( |
| 136 | - '立即启用', | 135 | + '是否启用', |
| 137 | style: TextStyle( | 136 | style: TextStyle( |
| 138 | color: MyColours.color_515151, | 137 | color: MyColours.color_515151, |
| 139 | fontSize: ScreenUtil().setSp(32)), | 138 | fontSize: ScreenUtil().setSp(32)), |
| 140 | ), | 139 | ), |
| 141 | ), | 140 | ), |
| 142 | Spacer(), | 141 | Spacer(), |
| 143 | - Image.asset( | ||
| 144 | - marketingCenterProvider!.rechargeDetail!.isOpen == '1' | ||
| 145 | - ? Utils.getImgPath('swich_on') | ||
| 146 | - : Utils.getImgPath('swich_off'), | ||
| 147 | - width: ScreenUtil().setWidth(44 * 2), | 142 | + Text( |
| 143 | + marketingCenterProvider!.rechargeDetail!.isOpen == '1' ? '是' : '否', | ||
| 144 | + style: TextStyle( | ||
| 145 | + color: MyColours.color_999999, | ||
| 146 | + fontSize: ScreenUtil().setSp(32)), | ||
| 148 | ), | 147 | ), |
| 149 | HEmptyView(16) | 148 | HEmptyView(16) |
| 150 | ], | 149 | ], |
| @@ -171,7 +170,8 @@ class _RechargeDetailPageState extends State<RechargeDetailPage> { | @@ -171,7 +170,8 @@ class _RechargeDetailPageState extends State<RechargeDetailPage> { | ||
| 171 | if (widget.idstr != null && | 170 | if (widget.idstr != null && |
| 172 | widget.idstr != 'null' && | 171 | widget.idstr != 'null' && |
| 173 | marketingCenterProvider!.rechargeDetail!.isOpen == '1') { | 172 | marketingCenterProvider!.rechargeDetail!.isOpen == '1') { |
| 174 | - Utils.goShareBuyRechargeToWeChat(context, widget.idstr,marketingCenterProvider!.rechargeDetail!); | 173 | + Utils.goShareBuyRechargeToWeChat(context, widget.idstr, |
| 174 | + marketingCenterProvider!.rechargeDetail!); | ||
| 175 | } | 175 | } |
| 176 | }, | 176 | }, |
| 177 | ), | 177 | ), |
| @@ -245,8 +245,8 @@ class _RechargeDetailPageState extends State<RechargeDetailPage> { | @@ -245,8 +245,8 @@ class _RechargeDetailPageState extends State<RechargeDetailPage> { | ||
| 245 | crossAxisAlignment: CrossAxisAlignment.start, | 245 | crossAxisAlignment: CrossAxisAlignment.start, |
| 246 | // mainAxisAlignment: MainAxisAlignment.start, | 246 | // mainAxisAlignment: MainAxisAlignment.start, |
| 247 | children: [ | 247 | children: [ |
| 248 | - if (marketingCenterProvider! | ||
| 249 | - .rechargeDetail!.rechargeList!.isPrice == | 248 | + if (marketingCenterProvider!.rechargeDetail! |
| 249 | + .rechargeList!.isPrice == | ||
| 250 | '1') | 250 | '1') |
| 251 | Row( | 251 | Row( |
| 252 | mainAxisAlignment: | 252 | mainAxisAlignment: |
| @@ -268,12 +268,12 @@ class _RechargeDetailPageState extends State<RechargeDetailPage> { | @@ -268,12 +268,12 @@ class _RechargeDetailPageState extends State<RechargeDetailPage> { | ||
| 268 | HEmptyView(32) | 268 | HEmptyView(32) |
| 269 | ], | 269 | ], |
| 270 | ), | 270 | ), |
| 271 | - if (marketingCenterProvider! | ||
| 272 | - .rechargeDetail!.rechargeList!.isPrice == | 271 | + if (marketingCenterProvider!.rechargeDetail! |
| 272 | + .rechargeList!.isPrice == | ||
| 273 | '1') | 273 | '1') |
| 274 | VEmptyView(26), | 274 | VEmptyView(26), |
| 275 | - if (marketingCenterProvider! | ||
| 276 | - .rechargeDetail!.rechargeList!.isScore == | 275 | + if (marketingCenterProvider!.rechargeDetail! |
| 276 | + .rechargeList!.isScore == | ||
| 277 | '1') | 277 | '1') |
| 278 | Row( | 278 | Row( |
| 279 | mainAxisAlignment: | 279 | mainAxisAlignment: |
| @@ -295,8 +295,8 @@ class _RechargeDetailPageState extends State<RechargeDetailPage> { | @@ -295,8 +295,8 @@ class _RechargeDetailPageState extends State<RechargeDetailPage> { | ||
| 295 | HEmptyView(32) | 295 | HEmptyView(32) |
| 296 | ], | 296 | ], |
| 297 | ), | 297 | ), |
| 298 | - if (marketingCenterProvider! | ||
| 299 | - .rechargeDetail!.rechargeList!.isScore == | 298 | + if (marketingCenterProvider!.rechargeDetail! |
| 299 | + .rechargeList!.isScore == | ||
| 300 | '1') | 300 | '1') |
| 301 | VEmptyView(26), | 301 | VEmptyView(26), |
| 302 | if (marketingCenterProvider!.rechargeDetail! | 302 | if (marketingCenterProvider!.rechargeDetail! |
| @@ -335,7 +335,9 @@ class _RechargeDetailPageState extends State<RechargeDetailPage> { | @@ -335,7 +335,9 @@ class _RechargeDetailPageState extends State<RechargeDetailPage> { | ||
| 335 | alignment: WrapAlignment.start, | 335 | alignment: WrapAlignment.start, |
| 336 | runAlignment: WrapAlignment.start, | 336 | runAlignment: WrapAlignment.start, |
| 337 | children: marketingCenterProvider! | 337 | children: marketingCenterProvider! |
| 338 | - .rechargeDetail!.rechargeList!.coupons! | 338 | + .rechargeDetail! |
| 339 | + .rechargeList! | ||
| 340 | + .coupons! | ||
| 339 | .map((e) { | 341 | .map((e) { |
| 340 | return InkWell( | 342 | return InkWell( |
| 341 | onTap: () { | 343 | onTap: () { |
| @@ -399,8 +401,8 @@ class _RechargeDetailPageState extends State<RechargeDetailPage> { | @@ -399,8 +401,8 @@ class _RechargeDetailPageState extends State<RechargeDetailPage> { | ||
| 399 | child: Padding( | 401 | child: Padding( |
| 400 | padding: EdgeInsets.only(right: w(16)), | 402 | padding: EdgeInsets.only(right: w(16)), |
| 401 | child: Text( | 403 | child: Text( |
| 402 | - marketingCenterProvider! | ||
| 403 | - .rechargeDetail!.expDate!.weekDateShow!, | 404 | + marketingCenterProvider!.rechargeDetail! |
| 405 | + .expDate!.weekDateShow!, | ||
| 404 | maxLines: 10, | 406 | maxLines: 10, |
| 405 | style: TextStyle( | 407 | style: TextStyle( |
| 406 | color: MyColours.color_999999, | 408 | color: MyColours.color_999999, |
| @@ -31,9 +31,11 @@ import '../../app.dart'; | @@ -31,9 +31,11 @@ import '../../app.dart'; | ||
| 31 | 31 | ||
| 32 | import '../../constant/constant.dart'; | 32 | import '../../constant/constant.dart'; |
| 33 | import '../../models/get_seller_info_model.dart'; | 33 | import '../../models/get_seller_info_model.dart'; |
| 34 | +import '../../models/personnel_manage_model.dart'; | ||
| 34 | import '../../models/seller_version_model.dart'; | 35 | import '../../models/seller_version_model.dart'; |
| 35 | import '../../provider/collect_store_provider.dart'; | 36 | import '../../provider/collect_store_provider.dart'; |
| 36 | import '../../provider/customer_provider.dart'; | 37 | import '../../provider/customer_provider.dart'; |
| 38 | +import '../../provider/personnel_provider.dart'; | ||
| 37 | import '../../provider/store_base_info_provider.dart'; | 39 | import '../../provider/store_base_info_provider.dart'; |
| 38 | import '../../utils/dialog_util.dart'; | 40 | import '../../utils/dialog_util.dart'; |
| 39 | import '../../utils/screen_util.dart'; | 41 | import '../../utils/screen_util.dart'; |
| @@ -59,6 +61,7 @@ class MyPageState extends State<MyPage> with WidgetsBindingObserver { | @@ -59,6 +61,7 @@ class MyPageState extends State<MyPage> with WidgetsBindingObserver { | ||
| 59 | DateTime? edate; //过期时间 | 61 | DateTime? edate; //过期时间 |
| 60 | 62 | ||
| 61 | late CollectStoreProvider collectStoreProvider; | 63 | late CollectStoreProvider collectStoreProvider; |
| 64 | + bool isStoreWine = false; | ||
| 62 | 65 | ||
| 63 | @override | 66 | @override |
| 64 | void initState() { | 67 | void initState() { |
| @@ -97,6 +100,10 @@ class MyPageState extends State<MyPage> with WidgetsBindingObserver { | @@ -97,6 +100,10 @@ class MyPageState extends State<MyPage> with WidgetsBindingObserver { | ||
| 97 | // _getMyIntegral(context); | 100 | // _getMyIntegral(context); |
| 98 | 101 | ||
| 99 | // _getSellerById(); | 102 | // _getSellerById(); |
| 103 | + | ||
| 104 | + if (Provider.of<UserModel>(context,listen: false).user!.role_name_addition == '迎宾') { | ||
| 105 | + _getAuthUserLists(showLoading: false); | ||
| 106 | + } | ||
| 100 | getMyPageCountData(); | 107 | getMyPageCountData(); |
| 101 | 108 | ||
| 102 | ///apk版本检测 | 109 | ///apk版本检测 |
| @@ -174,6 +181,33 @@ class MyPageState extends State<MyPage> with WidgetsBindingObserver { | @@ -174,6 +181,33 @@ class MyPageState extends State<MyPage> with WidgetsBindingObserver { | ||
| 174 | // } | 181 | // } |
| 175 | // } | 182 | // } |
| 176 | 183 | ||
| 184 | +//获取员工信息列表 | ||
| 185 | + _getAuthUserLists({bool showLoading = true}) async { | ||
| 186 | + Map<String, String?> params = { | ||
| 187 | + "sellerid": Provider.of<UserModel>(context, listen: false).user!.sellerid, | ||
| 188 | + }; | ||
| 189 | + PersonnelProvider personnelProvider = | ||
| 190 | + Provider.of<PersonnelProvider>(context, listen: false); | ||
| 191 | + late PersonnelManageSunModel data; | ||
| 192 | + await personnelProvider.getAuthUserLists(context, params, | ||
| 193 | + showLoading: showLoading); | ||
| 194 | + UserModel userModel = Provider.of<UserModel>(context, listen: false); | ||
| 195 | + | ||
| 196 | + if (personnelProvider.dataMap != null) { | ||
| 197 | + if (userModel.user!.role_name == '迎宾') { | ||
| 198 | + personnelProvider.dataMap!.welcome!.listdata!.forEach((element) { | ||
| 199 | + if (element!.id == userModel.user!.openid) { | ||
| 200 | + //找到自己 | ||
| 201 | + data = element; | ||
| 202 | + } | ||
| 203 | + }); | ||
| 204 | + } | ||
| 205 | + | ||
| 206 | + isStoreWine = data.isStoreWine == '1' ? true : false; | ||
| 207 | + setState(() {}); | ||
| 208 | + } | ||
| 209 | + } | ||
| 210 | + | ||
| 177 | getMyPageCountData() async { | 211 | getMyPageCountData() async { |
| 178 | Map<String, String?> params = { | 212 | Map<String, String?> params = { |
| 179 | 'sellerid': Provider.of<UserModel>(context, listen: false).user!.sellerid, | 213 | 'sellerid': Provider.of<UserModel>(context, listen: false).user!.sellerid, |
| @@ -1262,7 +1296,8 @@ class MyPageState extends State<MyPage> with WidgetsBindingObserver { | @@ -1262,7 +1296,8 @@ class MyPageState extends State<MyPage> with WidgetsBindingObserver { | ||
| 1262 | return; | 1296 | return; |
| 1263 | } | 1297 | } |
| 1264 | if (Utils.getAuthority( | 1298 | if (Utils.getAuthority( |
| 1265 | - context, '客户存酒')) { | 1299 | + context, '客户存酒') || |
| 1300 | + isStoreWine) { | ||
| 1266 | NavigatorUtil | 1301 | NavigatorUtil |
| 1267 | .goStoreWineManageHomePage( | 1302 | .goStoreWineManageHomePage( |
| 1268 | context); | 1303 | context); |
| @@ -1270,14 +1305,16 @@ class MyPageState extends State<MyPage> with WidgetsBindingObserver { | @@ -1270,14 +1305,16 @@ class MyPageState extends State<MyPage> with WidgetsBindingObserver { | ||
| 1270 | }, | 1305 | }, |
| 1271 | child: _item( | 1306 | child: _item( |
| 1272 | outDay == '0' || | 1307 | outDay == '0' || |
| 1273 | - !Utils.getAuthority( | ||
| 1274 | - context, '客户存酒') | 1308 | + !(Utils.getAuthority( |
| 1309 | + context, '客户存酒') || | ||
| 1310 | + isStoreWine) | ||
| 1275 | ? Utils.getImgPath('khcj_un') | 1311 | ? Utils.getImgPath('khcj_un') |
| 1276 | : Utils.getImgPath('khcj'), | 1312 | : Utils.getImgPath('khcj'), |
| 1277 | '客户存酒', | 1313 | '客户存酒', |
| 1278 | isRowLow: outDay == '0' || | 1314 | isRowLow: outDay == '0' || |
| 1279 | - !Utils.getAuthority( | ||
| 1280 | - context, '客户存酒'))), | 1315 | + !(Utils.getAuthority( |
| 1316 | + context, '客户存酒') || | ||
| 1317 | + isStoreWine))), | ||
| 1281 | InkWell( | 1318 | InkWell( |
| 1282 | onTap: () {}, child: _item('', '空空空空')), | 1319 | onTap: () {}, child: _item('', '空空空空')), |
| 1283 | InkWell( | 1320 | InkWell( |
| @@ -1627,8 +1664,7 @@ class MyPageState extends State<MyPage> with WidgetsBindingObserver { | @@ -1627,8 +1664,7 @@ class MyPageState extends State<MyPage> with WidgetsBindingObserver { | ||
| 1627 | outDay == '0' || | 1664 | outDay == '0' || |
| 1628 | !Utils.getAuthority( | 1665 | !Utils.getAuthority( |
| 1629 | context, '收银管理') | 1666 | context, '收银管理') |
| 1630 | - ? Utils.getImgPath( | ||
| 1631 | - 'finance_un') | 1667 | + ? Utils.getImgPath('finance_un') |
| 1632 | : Utils.getImgPath('finance'), | 1668 | : Utils.getImgPath('finance'), |
| 1633 | '收银管理', | 1669 | '收银管理', |
| 1634 | isRowLow: outDay == '0' || | 1670 | isRowLow: outDay == '0' || |
| 1 | - | ||
| 2 | import 'dart:convert'; | 1 | import 'dart:convert'; |
| 3 | 2 | ||
| 4 | import 'package:dio/dio.dart'; | 3 | import 'package:dio/dio.dart'; |
| @@ -97,7 +96,7 @@ class _PlanDishEidtPageState extends State<PlanDishEidtPage> { | @@ -97,7 +96,7 @@ class _PlanDishEidtPageState extends State<PlanDishEidtPage> { | ||
| 97 | } | 96 | } |
| 98 | if (widget.sunListPlan != null) { | 97 | if (widget.sunListPlan != null) { |
| 99 | if (widget.isEdit) { | 98 | if (widget.isEdit) { |
| 100 | - _dishNameEditControl.text = widget.sunListPlan!.pname??""; | 99 | + _dishNameEditControl.text = widget.sunListPlan!.pname ?? ""; |
| 101 | } else {} | 100 | } else {} |
| 102 | 101 | ||
| 103 | if (widget.sunListPlan!.type == '1') { | 102 | if (widget.sunListPlan!.type == '1') { |
| @@ -107,11 +106,11 @@ class _PlanDishEidtPageState extends State<PlanDishEidtPage> { | @@ -107,11 +106,11 @@ class _PlanDishEidtPageState extends State<PlanDishEidtPage> { | ||
| 107 | } | 106 | } |
| 108 | labelSelIndex = labelList.indexOf(labelShow); | 107 | labelSelIndex = labelList.indexOf(labelShow); |
| 109 | swichState = widget.sunListPlan!.status == '1' ? true : false; | 108 | swichState = widget.sunListPlan!.status == '1' ? true : false; |
| 110 | - pNumC.text = widget.sunListPlan!.pnum??""; | ||
| 111 | - pNum = int.parse(widget.sunListPlan!.pnum??"0"); | 109 | + pNumC.text = widget.sunListPlan!.pnum ?? ""; |
| 110 | + pNum = int.parse(widget.sunListPlan!.pnum ?? "0"); | ||
| 112 | priceSum = widget.sunListPlan!.menuPrice; | 111 | priceSum = widget.sunListPlan!.menuPrice; |
| 113 | memberPriceSum = widget.sunListPlan!.memberPrice; | 112 | memberPriceSum = widget.sunListPlan!.memberPrice; |
| 114 | - dishPriceC.text = widget.sunListPlan!.planPrice??""; | 113 | + dishPriceC.text = widget.sunListPlan!.planPrice ?? ""; |
| 115 | menuModel = widget.sunListPlan!.cookList; | 114 | menuModel = widget.sunListPlan!.cookList; |
| 116 | String dish = ''; | 115 | String dish = ''; |
| 117 | menuModel!.forEach((element) { | 116 | menuModel!.forEach((element) { |
| @@ -414,12 +413,19 @@ class _PlanDishEidtPageState extends State<PlanDishEidtPage> { | @@ -414,12 +413,19 @@ class _PlanDishEidtPageState extends State<PlanDishEidtPage> { | ||
| 414 | ), | 413 | ), |
| 415 | ), | 414 | ), |
| 416 | Spacer(), | 415 | Spacer(), |
| 417 | - Image.asset( | ||
| 418 | - swich | ||
| 419 | - ? Utils.getImgPath('swich_on') | ||
| 420 | - : Utils.getImgPath('swich_off'), | ||
| 421 | - width: ScreenUtil().setWidth(44 * 2), | ||
| 422 | - ) | 416 | + widget.onlyShow |
| 417 | + ? Text( | ||
| 418 | + swich ? '是' : '否', | ||
| 419 | + style: TextStyle( | ||
| 420 | + color: MyColours.color_515151, | ||
| 421 | + fontSize: ScreenUtil().setSp(32)), | ||
| 422 | + ) | ||
| 423 | + : Image.asset( | ||
| 424 | + swich | ||
| 425 | + ? Utils.getImgPath('swich_on') | ||
| 426 | + : Utils.getImgPath('swich_off'), | ||
| 427 | + width: ScreenUtil().setWidth(44 * 2), | ||
| 428 | + ) | ||
| 423 | ], | 429 | ], |
| 424 | ), | 430 | ), |
| 425 | ), | 431 | ), |
| @@ -819,13 +825,13 @@ class _PlanDishEidtPageState extends State<PlanDishEidtPage> { | @@ -819,13 +825,13 @@ class _PlanDishEidtPageState extends State<PlanDishEidtPage> { | ||
| 819 | temp = | 825 | temp = |
| 820 | await NavigatorUtil.goPlanNewDishPage( | 826 | await NavigatorUtil.goPlanNewDishPage( |
| 821 | context, | 827 | context, |
| 822 | - ) ; | 828 | + ); |
| 823 | } else { | 829 | } else { |
| 824 | temp = | 830 | temp = |
| 825 | await NavigatorUtil.goPlanNewDishPage( | 831 | await NavigatorUtil.goPlanNewDishPage( |
| 826 | context, | 832 | context, |
| 827 | object: {'object': menuModel}, | 833 | object: {'object': menuModel}, |
| 828 | - planDishPrice: dishPriceC.text) ; | 834 | + planDishPrice: dishPriceC.text); |
| 829 | } | 835 | } |
| 830 | 836 | ||
| 831 | if (temp != null) { | 837 | if (temp != null) { |
-
Please register or login to post a comment