Showing
11 changed files
with
224 additions
and
105 deletions
| @@ -124,5 +124,42 @@ class Constant { | @@ -124,5 +124,42 @@ class Constant { | ||
| 124 | '到店': ['管理员', '店长', '前台', '迎宾'], | 124 | '到店': ['管理员', '店长', '前台', '迎宾'], |
| 125 | '离店': ['管理员', '店长', '前台', '迎宾'], | 125 | '离店': ['管理员', '店长', '前台', '迎宾'], |
| 126 | '全店任务': ['管理员', '店长', '客户经理', '收银员', '服务员', '前台'], | 126 | '全店任务': ['管理员', '店长', '客户经理', '收银员', '服务员', '前台'], |
| 127 | + '创建新的优惠券': [ | ||
| 128 | + '管理员', | ||
| 129 | + '店长', | ||
| 130 | + ], | ||
| 131 | + '电话': ['管理员', '店长', '前台', '迎宾'], | ||
| 132 | + '新建优惠': [ | ||
| 133 | + '管理员', | ||
| 134 | + '店长', | ||
| 135 | + ], | ||
| 136 | + '编辑优惠': [ | ||
| 137 | + '管理员', | ||
| 138 | + '店长', | ||
| 139 | + ], | ||
| 140 | + '指派为存酒管理员': [ | ||
| 141 | + '管理员', | ||
| 142 | + '店长', | ||
| 143 | + ], | ||
| 144 | + '创建新排菜': [ | ||
| 145 | + '管理员', | ||
| 146 | + '店长', | ||
| 147 | + ], | ||
| 148 | + '删除排菜': [ | ||
| 149 | + '管理员', | ||
| 150 | + '店长', | ||
| 151 | + ], | ||
| 152 | + '复用排菜': [ | ||
| 153 | + '管理员', | ||
| 154 | + '店长', | ||
| 155 | + ], | ||
| 156 | + '编辑排菜': [ | ||
| 157 | + '管理员', | ||
| 158 | + '店长', | ||
| 159 | + ], | ||
| 160 | + '存酒管理设置': [ | ||
| 161 | + '管理员', | ||
| 162 | + '店长', | ||
| 163 | + ], | ||
| 127 | }; | 164 | }; |
| 128 | } | 165 | } |
| @@ -272,12 +272,16 @@ class _CouponPageState extends State<CouponPage> with TickerProviderStateMixin { | @@ -272,12 +272,16 @@ class _CouponPageState extends State<CouponPage> with TickerProviderStateMixin { | ||
| 272 | isBold: false, | 272 | isBold: false, |
| 273 | fontSize: 28, | 273 | fontSize: 28, |
| 274 | onPressed: () async { | 274 | onPressed: () async { |
| 275 | - UserModel userModel = | ||
| 276 | - Provider.of<UserModel>(context, listen: false); | ||
| 277 | - if (userModel.user.role_name == '管理员' || | ||
| 278 | - userModel.user.role_name == '店长') { | 275 | + // UserModel userModel = |
| 276 | + // Provider.of<UserModel>(context, listen: false); | ||
| 277 | + if (Utils.getAuthority(context, '创建新的优惠券')) { | ||
| 279 | NavigatorUtil.goCouponCreateSelectTypePage(context); | 278 | NavigatorUtil.goCouponCreateSelectTypePage(context); |
| 280 | - } else { | 279 | + } |
| 280 | + // if (userModel.user.role_name == '管理员' || | ||
| 281 | + // userModel.user.role_name == '店长') { | ||
| 282 | + // NavigatorUtil.goCouponCreateSelectTypePage(context); | ||
| 283 | + // } | ||
| 284 | + else { | ||
| 281 | bool needRefresh = | 285 | bool needRefresh = |
| 282 | await NavigatorUtil.goCouponEditPage(context); | 286 | await NavigatorUtil.goCouponEditPage(context); |
| 283 | print(needRefresh); | 287 | print(needRefresh); |
| @@ -1244,17 +1244,17 @@ class NotebookDetailPageState extends State<NotebookDetailPage> { | @@ -1244,17 +1244,17 @@ class NotebookDetailPageState extends State<NotebookDetailPage> { | ||
| 1244 | print(userModel.user.openid); | 1244 | print(userModel.user.openid); |
| 1245 | print(widget.rid); | 1245 | print(widget.rid); |
| 1246 | print(widget.uid); | 1246 | print(widget.uid); |
| 1247 | - bool notDo = userModel.user.role_name != '管理员' && | ||
| 1248 | - userModel.user.role_name != '店长' && | ||
| 1249 | - widget.uid != "null" && | ||
| 1250 | - (widget.uid != userModel.user.openid && | ||
| 1251 | - userModel.user.role_name != '前台') && | ||
| 1252 | - userModel.user.role_name != '前台'; | ||
| 1253 | - | ||
| 1254 | - bool notDoWechat = userModel.user.role_name != '管理员' && | ||
| 1255 | - userModel.user.role_name != '店长' && | ||
| 1256 | - widget.uid != "null" && | ||
| 1257 | - widget.uid != userModel.user.openid; | 1247 | + // bool notDo = userModel.user.role_name != '管理员' && |
| 1248 | + // userModel.user.role_name != '店长' && | ||
| 1249 | + // widget.uid != "null" && | ||
| 1250 | + // (widget.uid != userModel.user.openid && | ||
| 1251 | + // userModel.user.role_name != '前台') && | ||
| 1252 | + // userModel.user.role_name != '前台'; | ||
| 1253 | + | ||
| 1254 | + // bool notDoWechat = userModel.user.role_name != '管理员' && | ||
| 1255 | + // userModel.user.role_name != '店长' && | ||
| 1256 | + // widget.uid != "null" && | ||
| 1257 | + // widget.uid != userModel.user.openid; | ||
| 1258 | return Scaffold( | 1258 | return Scaffold( |
| 1259 | resizeToAvoidBottomInset: false, | 1259 | resizeToAvoidBottomInset: false, |
| 1260 | backgroundColor: MyColours.color_ffffff, | 1260 | backgroundColor: MyColours.color_ffffff, |
| @@ -1628,9 +1628,11 @@ class NotebookDetailPageState extends State<NotebookDetailPage> { | @@ -1628,9 +1628,11 @@ class NotebookDetailPageState extends State<NotebookDetailPage> { | ||
| 1628 | detailEntity.cusdem ?? | 1628 | detailEntity.cusdem ?? |
| 1629 | "", | 1629 | "", |
| 1630 | callback: () { | 1630 | callback: () { |
| 1631 | - if (notDo) { | ||
| 1632 | - return; | ||
| 1633 | - } else { | 1631 | + if (Utils.getAuthority( |
| 1632 | + context, '备注') || | ||
| 1633 | + widget.uid == | ||
| 1634 | + userModel.user | ||
| 1635 | + .openid) { | ||
| 1634 | //备注弹窗 | 1636 | //备注弹窗 |
| 1635 | _showCusdemDialog( | 1637 | _showCusdemDialog( |
| 1636 | context, | 1638 | context, |
| @@ -2191,7 +2193,13 @@ class NotebookDetailPageState extends State<NotebookDetailPage> { | @@ -2191,7 +2193,13 @@ class NotebookDetailPageState extends State<NotebookDetailPage> { | ||
| 2191 | text: '填写预订人信息', | 2193 | text: '填写预订人信息', |
| 2192 | fontSize: 28, | 2194 | fontSize: 28, |
| 2193 | isBold: false, | 2195 | isBold: false, |
| 2194 | - textColor: notDo | 2196 | + textColor: !(Utils.getAuthority( |
| 2197 | + context, | ||
| 2198 | + '填写预订人信息') || | ||
| 2199 | + widget.uid == | ||
| 2200 | + userModel | ||
| 2201 | + .user | ||
| 2202 | + .openid) | ||
| 2195 | ? MyColours | 2203 | ? MyColours |
| 2196 | .color_999999 | 2204 | .color_999999 |
| 2197 | : Colors.white, | 2205 | : Colors.white, |
| @@ -2201,17 +2209,35 @@ class NotebookDetailPageState extends State<NotebookDetailPage> { | @@ -2201,17 +2209,35 @@ class NotebookDetailPageState extends State<NotebookDetailPage> { | ||
| 2201 | .setWidth(240), | 2209 | .setWidth(240), |
| 2202 | radius: ScreenUtil() | 2210 | radius: ScreenUtil() |
| 2203 | .setWidth(10), | 2211 | .setWidth(10), |
| 2204 | - borderColor: notDo | 2212 | + borderColor: !(Utils.getAuthority( |
| 2213 | + context, | ||
| 2214 | + '填写预订人信息') || | ||
| 2215 | + widget.uid == | ||
| 2216 | + userModel | ||
| 2217 | + .user | ||
| 2218 | + .openid) | ||
| 2205 | ? MyColours | 2219 | ? MyColours |
| 2206 | .color_999999 | 2220 | .color_999999 |
| 2207 | : MyColours | 2221 | : MyColours |
| 2208 | .color_199095, | 2222 | .color_199095, |
| 2209 | - gradientStart: notDo | 2223 | + gradientStart: !(Utils.getAuthority( |
| 2224 | + context, | ||
| 2225 | + '填写预订人信息') || | ||
| 2226 | + widget.uid == | ||
| 2227 | + userModel | ||
| 2228 | + .user | ||
| 2229 | + .openid) | ||
| 2210 | ? MyColours | 2230 | ? MyColours |
| 2211 | .color_ffffff | 2231 | .color_ffffff |
| 2212 | : MyColours | 2232 | : MyColours |
| 2213 | .color_199095, | 2233 | .color_199095, |
| 2214 | - gradientEnd: notDo | 2234 | + gradientEnd: !(Utils.getAuthority( |
| 2235 | + context, | ||
| 2236 | + '填写预订人信息') || | ||
| 2237 | + widget.uid == | ||
| 2238 | + userModel | ||
| 2239 | + .user | ||
| 2240 | + .openid) | ||
| 2215 | ? MyColours | 2241 | ? MyColours |
| 2216 | .color_ffffff | 2242 | .color_ffffff |
| 2217 | : MyColours | 2243 | : MyColours |
| @@ -2220,9 +2246,13 @@ class NotebookDetailPageState extends State<NotebookDetailPage> { | @@ -2220,9 +2246,13 @@ class NotebookDetailPageState extends State<NotebookDetailPage> { | ||
| 2220 | // setState(() { | 2246 | // setState(() { |
| 2221 | // setTop = true; | 2247 | // setTop = true; |
| 2222 | // }); | 2248 | // }); |
| 2223 | - if (notDo) { | ||
| 2224 | - return; | ||
| 2225 | - } else { | 2249 | + if (Utils.getAuthority( |
| 2250 | + context, | ||
| 2251 | + '填写预订人信息') || | ||
| 2252 | + widget.uid == | ||
| 2253 | + userModel | ||
| 2254 | + .user | ||
| 2255 | + .openid) { | ||
| 2226 | NavigatorUtil | 2256 | NavigatorUtil |
| 2227 | .goEditReserverPage( | 2257 | .goEditReserverPage( |
| 2228 | context, | 2258 | context, |
| @@ -2472,8 +2502,13 @@ class NotebookDetailPageState extends State<NotebookDetailPage> { | @@ -2472,8 +2502,13 @@ class NotebookDetailPageState extends State<NotebookDetailPage> { | ||
| 2472 | null && | 2502 | null && |
| 2473 | formatPhone != | 2503 | formatPhone != |
| 2474 | '') { | 2504 | '') { |
| 2475 | - if (notDo) { | ||
| 2476 | - } else { | 2505 | + if (Utils.getAuthority( |
| 2506 | + context, | ||
| 2507 | + '电话') || | ||
| 2508 | + widget.uid == | ||
| 2509 | + userModel | ||
| 2510 | + .user | ||
| 2511 | + .openid) { | ||
| 2477 | DialogUtil | 2512 | DialogUtil |
| 2478 | .goPhone( | 2513 | .goPhone( |
| 2479 | formatPhone); | 2514 | formatPhone); |
| @@ -2637,7 +2672,11 @@ class NotebookDetailPageState extends State<NotebookDetailPage> { | @@ -2637,7 +2672,11 @@ class NotebookDetailPageState extends State<NotebookDetailPage> { | ||
| 2637 | flex: 1, | 2672 | flex: 1, |
| 2638 | child: InkWell( | 2673 | child: InkWell( |
| 2639 | onTap: () { | 2674 | onTap: () { |
| 2640 | - if (!notDoWechat) { | 2675 | + if (Utils.getAuthority( |
| 2676 | + context, '预点菜') || | ||
| 2677 | + widget.uid == | ||
| 2678 | + userModel | ||
| 2679 | + .user.openid) { | ||
| 2641 | NavigatorUtil | 2680 | NavigatorUtil |
| 2642 | .goOrderAdvanceHomePage( | 2681 | .goOrderAdvanceHomePage( |
| 2643 | context, | 2682 | context, |
| @@ -2654,7 +2693,14 @@ class NotebookDetailPageState extends State<NotebookDetailPage> { | @@ -2654,7 +2693,14 @@ class NotebookDetailPageState extends State<NotebookDetailPage> { | ||
| 2654 | MyColours.color_ffffff, | 2693 | MyColours.color_ffffff, |
| 2655 | border: Border.all( | 2694 | border: Border.all( |
| 2656 | width: w(1), | 2695 | width: w(1), |
| 2657 | - color: notDoWechat | 2696 | + color: !(Utils |
| 2697 | + .getAuthority( | ||
| 2698 | + context, | ||
| 2699 | + '预点菜') || | ||
| 2700 | + widget.uid == | ||
| 2701 | + userModel | ||
| 2702 | + .user | ||
| 2703 | + .openid) | ||
| 2658 | ? MyColours | 2704 | ? MyColours |
| 2659 | .color_999999 | 2705 | .color_999999 |
| 2660 | : MyColours | 2706 | : MyColours |
| @@ -2668,7 +2714,13 @@ class NotebookDetailPageState extends State<NotebookDetailPage> { | @@ -2668,7 +2714,13 @@ class NotebookDetailPageState extends State<NotebookDetailPage> { | ||
| 2668 | alignment: Alignment.center, | 2714 | alignment: Alignment.center, |
| 2669 | child: Text('预点菜', | 2715 | child: Text('预点菜', |
| 2670 | style: TextStyle( | 2716 | style: TextStyle( |
| 2671 | - color: notDoWechat | 2717 | + color: !(Utils.getAuthority( |
| 2718 | + context, | ||
| 2719 | + '预点菜') || | ||
| 2720 | + widget.uid == | ||
| 2721 | + userModel | ||
| 2722 | + .user | ||
| 2723 | + .openid) | ||
| 2672 | ? MyColours | 2724 | ? MyColours |
| 2673 | .color_999999 | 2725 | .color_999999 |
| 2674 | : MyColours | 2726 | : MyColours |
| @@ -2709,7 +2761,11 @@ class NotebookDetailPageState extends State<NotebookDetailPage> { | @@ -2709,7 +2761,11 @@ class NotebookDetailPageState extends State<NotebookDetailPage> { | ||
| 2709 | // _nameStr.length - | 2761 | // _nameStr.length - |
| 2710 | // 1); | 2762 | // 1); |
| 2711 | // } | 2763 | // } |
| 2712 | - if (!notDoWechat) { | 2764 | + if (Utils.getAuthority( |
| 2765 | + context, '通知客户') || | ||
| 2766 | + widget.uid == | ||
| 2767 | + userModel | ||
| 2768 | + .user.openid) { | ||
| 2713 | NavigatorUtil | 2769 | NavigatorUtil |
| 2714 | .goInvicationPage( | 2770 | .goInvicationPage( |
| 2715 | context, | 2771 | context, |
| @@ -2719,7 +2775,12 @@ class NotebookDetailPageState extends State<NotebookDetailPage> { | @@ -2719,7 +2775,12 @@ class NotebookDetailPageState extends State<NotebookDetailPage> { | ||
| 2719 | }, | 2775 | }, |
| 2720 | child: Container( | 2776 | child: Container( |
| 2721 | decoration: BoxDecoration( | 2777 | decoration: BoxDecoration( |
| 2722 | - color: notDoWechat | 2778 | + color: !(Utils.getAuthority( |
| 2779 | + context, | ||
| 2780 | + '通知客户') || | ||
| 2781 | + widget.uid == | ||
| 2782 | + userModel.user | ||
| 2783 | + .openid) | ||
| 2723 | ? MyColours.color_999999 | 2784 | ? MyColours.color_999999 |
| 2724 | : MyColours | 2785 | : MyColours |
| 2725 | .color_199095, | 2786 | .color_199095, |
| @@ -3141,7 +3202,9 @@ class NotebookDetailPageState extends State<NotebookDetailPage> { | @@ -3141,7 +3202,9 @@ class NotebookDetailPageState extends State<NotebookDetailPage> { | ||
| 3141 | horizontal: ScreenUtil().setHeight(40)), | 3202 | horizontal: ScreenUtil().setHeight(40)), |
| 3142 | decoration: BoxDecoration( | 3203 | decoration: BoxDecoration( |
| 3143 | border: Border.all( | 3204 | border: Border.all( |
| 3144 | - color: notDo | 3205 | + color: !(Utils.getAuthority( |
| 3206 | + context, '变更预订') || | ||
| 3207 | + widget.uid == userModel.user.openid) | ||
| 3145 | ? MyColours.color_999999 | 3208 | ? MyColours.color_999999 |
| 3146 | : MyColours.color_199095, | 3209 | : MyColours.color_199095, |
| 3147 | width: ScreenUtil().setWidth(2)), | 3210 | width: ScreenUtil().setWidth(2)), |
| @@ -3156,32 +3219,45 @@ class NotebookDetailPageState extends State<NotebookDetailPage> { | @@ -3156,32 +3219,45 @@ class NotebookDetailPageState extends State<NotebookDetailPage> { | ||
| 3156 | Expanded( | 3219 | Expanded( |
| 3157 | child: _cancelAndChangeBtn(() { | 3220 | child: _cancelAndChangeBtn(() { |
| 3158 | print('点击变更预订'); | 3221 | print('点击变更预订'); |
| 3159 | - if (notDo) { | ||
| 3160 | - } else { | 3222 | + if (Utils.getAuthority( |
| 3223 | + context, '变更预订') || | ||
| 3224 | + widget.uid == | ||
| 3225 | + userModel.user.openid) { | ||
| 3161 | NavigatorUtil.goNoteBookChangeFPage( | 3226 | NavigatorUtil.goNoteBookChangeFPage( |
| 3162 | context, | 3227 | context, |
| 3163 | detailEntity, | 3228 | detailEntity, |
| 3164 | widget.rid); | 3229 | widget.rid); |
| 3165 | } | 3230 | } |
| 3166 | }, '变更预订', | 3231 | }, '变更预订', |
| 3167 | - fontColor: notDo | 3232 | + fontColor: !(Utils.getAuthority( |
| 3233 | + context, '变更预订') || | ||
| 3234 | + widget.uid == | ||
| 3235 | + userModel.user.openid) | ||
| 3168 | ? MyColours.color_999999 | 3236 | ? MyColours.color_999999 |
| 3169 | : MyColours.color_199095)), | 3237 | : MyColours.color_199095)), |
| 3170 | MyDivider( | 3238 | MyDivider( |
| 3171 | ScreenUtil().setWidth(2), | 3239 | ScreenUtil().setWidth(2), |
| 3172 | ScreenUtil().setWidth(50), | 3240 | ScreenUtil().setWidth(50), |
| 3173 | - color: notDo | 3241 | + color: !(Utils.getAuthority( |
| 3242 | + context, '取消预订') || | ||
| 3243 | + widget.uid == | ||
| 3244 | + userModel.user.openid) | ||
| 3174 | ? MyColours.color_999999 | 3245 | ? MyColours.color_999999 |
| 3175 | : MyColours.color_199095, | 3246 | : MyColours.color_199095, |
| 3176 | ), | 3247 | ), |
| 3177 | Expanded( | 3248 | Expanded( |
| 3178 | child: _cancelAndChangeBtn(() { | 3249 | child: _cancelAndChangeBtn(() { |
| 3179 | - if (notDo) { | ||
| 3180 | - } else { | 3250 | + if (Utils.getAuthority( |
| 3251 | + context, '取消预订') || | ||
| 3252 | + widget.uid == | ||
| 3253 | + userModel.user.openid) { | ||
| 3181 | _showCancelWidget(context); | 3254 | _showCancelWidget(context); |
| 3182 | } | 3255 | } |
| 3183 | }, '取消预订', | 3256 | }, '取消预订', |
| 3184 | - fontColor: notDo | 3257 | + fontColor: !(Utils.getAuthority( |
| 3258 | + context, '取消预订') || | ||
| 3259 | + widget.uid == | ||
| 3260 | + userModel.user.openid) | ||
| 3185 | ? MyColours.color_999999 | 3261 | ? MyColours.color_999999 |
| 3186 | : MyColours.color_199095)), | 3262 | : MyColours.color_199095)), |
| 3187 | ], | 3263 | ], |
| @@ -1480,7 +1480,7 @@ class InvicationPageState extends State<InvicationPage> | @@ -1480,7 +1480,7 @@ class InvicationPageState extends State<InvicationPage> | ||
| 1480 | ], | 1480 | ], |
| 1481 | ))); | 1481 | ))); |
| 1482 | } | 1482 | } |
| 1483 | - | 1483 | +/** |
| 1484 | ///优惠券选择 | 1484 | ///优惠券选择 |
| 1485 | Widget _couponWidget() { | 1485 | Widget _couponWidget() { |
| 1486 | return Stack( | 1486 | return Stack( |
| @@ -1602,6 +1602,8 @@ class InvicationPageState extends State<InvicationPage> | @@ -1602,6 +1602,8 @@ class InvicationPageState extends State<InvicationPage> | ||
| 1602 | ); | 1602 | ); |
| 1603 | } | 1603 | } |
| 1604 | 1604 | ||
| 1605 | + */ | ||
| 1606 | + | ||
| 1605 | // 客情信息变更 | 1607 | // 客情信息变更 |
| 1606 | _setInsGuest() async { | 1608 | _setInsGuest() async { |
| 1607 | CustomerProvider customerProvider = | 1609 | CustomerProvider customerProvider = |
| @@ -2664,11 +2666,8 @@ class InvicationPageState extends State<InvicationPage> | @@ -2664,11 +2666,8 @@ class InvicationPageState extends State<InvicationPage> | ||
| 2664 | print('点击变更预订'); | 2666 | print('点击变更预订'); |
| 2665 | UserModel userModel = | 2667 | UserModel userModel = |
| 2666 | Provider.of<UserModel>(context, listen: false); | 2668 | Provider.of<UserModel>(context, listen: false); |
| 2667 | - if (userModel.user.role_name != '管理员' && | ||
| 2668 | - userModel.user.role_name != '店长' && | ||
| 2669 | - detailEntity.uid != "null" && | ||
| 2670 | - detailEntity.uid != userModel.user.openid) { | ||
| 2671 | - } else { | 2669 | + if (Utils.getAuthority(context, '变更预订') || |
| 2670 | + detailEntity.uid == userModel.user.openid) { | ||
| 2672 | NavigatorUtil.goNoteBookChangeFPage( | 2671 | NavigatorUtil.goNoteBookChangeFPage( |
| 2673 | context, detailEntity, widget.rid, | 2672 | context, detailEntity, widget.rid, |
| 2674 | back: true); | 2673 | back: true); |
| @@ -3099,7 +3098,7 @@ class InvicationPageState extends State<InvicationPage> | @@ -3099,7 +3098,7 @@ class InvicationPageState extends State<InvicationPage> | ||
| 3099 | } | 3098 | } |
| 3100 | return tables; | 3099 | return tables; |
| 3101 | } | 3100 | } |
| 3102 | - | 3101 | +/* |
| 3103 | ///预订信息 | 3102 | ///预订信息 |
| 3104 | Widget _orderInfoWidget() { | 3103 | Widget _orderInfoWidget() { |
| 3105 | return Stack(clipBehavior: Clip.none, children: [ | 3104 | return Stack(clipBehavior: Clip.none, children: [ |
| @@ -3661,6 +3660,7 @@ class InvicationPageState extends State<InvicationPage> | @@ -3661,6 +3660,7 @@ class InvicationPageState extends State<InvicationPage> | ||
| 3661 | ) | 3660 | ) |
| 3662 | ]); | 3661 | ]); |
| 3663 | } | 3662 | } |
| 3663 | + */ | ||
| 3664 | 3664 | ||
| 3665 | showOverlay(BuildContext context) { | 3665 | showOverlay(BuildContext context) { |
| 3666 | if (overlayEntry != null || MediaQuery.of(context).viewInsets.bottom == 0) | 3666 | if (overlayEntry != null || MediaQuery.of(context).viewInsets.bottom == 0) |
| @@ -83,11 +83,12 @@ class _RechargeHomePageState extends State<RechargeHomePage> { | @@ -83,11 +83,12 @@ class _RechargeHomePageState extends State<RechargeHomePage> { | ||
| 83 | Widget build(BuildContext context) { | 83 | Widget build(BuildContext context) { |
| 84 | marketingCenterProvider = | 84 | marketingCenterProvider = |
| 85 | Provider.of<MarketingCenterProvider>(context, listen: true); | 85 | Provider.of<MarketingCenterProvider>(context, listen: true); |
| 86 | - bool showBtn = Provider.of<UserModel>(context, listen: false) | ||
| 87 | - .user | ||
| 88 | - .role_name == | ||
| 89 | - '管理员' || | ||
| 90 | - Provider.of<UserModel>(context, listen: false).user.role_name == '店长'; | 86 | + // bool showBtn = Provider.of<UserModel>(context, listen: false) |
| 87 | + // .user | ||
| 88 | + // .role_name == | ||
| 89 | + // '管理员' || | ||
| 90 | + // Provider.of<UserModel>(context, listen: false).user.role_name == '店长'; | ||
| 91 | + bool showBtn = Utils.getAuthority(context, '编辑优惠'); | ||
| 91 | return Scaffold( | 92 | return Scaffold( |
| 92 | backgroundColor: MyColours.color_f3f3f3, | 93 | backgroundColor: MyColours.color_f3f3f3, |
| 93 | appBar: SystemAppBar( | 94 | appBar: SystemAppBar( |
| @@ -237,10 +238,11 @@ class _RechargeHomePageState extends State<RechargeHomePage> { | @@ -237,10 +238,11 @@ class _RechargeHomePageState extends State<RechargeHomePage> { | ||
| 237 | } | 238 | } |
| 238 | }), | 239 | }), |
| 239 | )), | 240 | )), |
| 240 | - if (Provider.of<UserModel>(context, listen: false).user.role_name == | ||
| 241 | - '管理员' || | ||
| 242 | - Provider.of<UserModel>(context, listen: false).user.role_name == | ||
| 243 | - '店长') | 241 | + // if (Provider.of<UserModel>(context, listen: false).user.role_name == |
| 242 | + // '管理员' || | ||
| 243 | + // Provider.of<UserModel>(context, listen: false).user.role_name == | ||
| 244 | + // '店长') | ||
| 245 | + if (Utils.getAuthority(context, '新建优惠')) | ||
| 244 | Container( | 246 | Container( |
| 245 | height: ScreenUtil().setWidth(91 * 2), | 247 | height: ScreenUtil().setWidth(91 * 2), |
| 246 | width: double.infinity, | 248 | width: double.infinity, |
| @@ -494,37 +494,37 @@ class _PersonnelDetailPageState extends State<PersonnelDetailPage> { | @@ -494,37 +494,37 @@ class _PersonnelDetailPageState extends State<PersonnelDetailPage> { | ||
| 494 | )), | 494 | )), |
| 495 | VEmptyView(40), | 495 | VEmptyView(40), |
| 496 | 496 | ||
| 497 | - (userModel.user.role_name == '管理员' || | ||
| 498 | - userModel.user.role_name == '店长') | ||
| 499 | - ? InkWell( | ||
| 500 | - onTap: () async { | ||
| 501 | - Map<String, String> pramams = { | ||
| 502 | - 'sid': Provider.of<UserModel>(context, listen: false) | ||
| 503 | - .user | ||
| 504 | - .sellerid, | ||
| 505 | - 'uid': uid, | ||
| 506 | - 'is_store_wine': isStoreWine == '1' ? '0' : '1' | ||
| 507 | - }; | ||
| 508 | - StoreWineProvider storeWineProvider = | ||
| 509 | - Provider.of<StoreWineProvider>(context, | ||
| 510 | - listen: false); | ||
| 511 | - bool success = await storeWineProvider | ||
| 512 | - .setStoreWineBySellerUser(context, pramams, | ||
| 513 | - showLoading: true); | ||
| 514 | - if (success) { | ||
| 515 | - setState(() { | ||
| 516 | - isStoreWine = isStoreWine == '1' ? '0' : '1'; | ||
| 517 | - }); | ||
| 518 | - } | ||
| 519 | - }, | ||
| 520 | - child: Text( | ||
| 521 | - isStoreWine == '1' ? '解除指派存酒管理员' : '指派为存酒管理员', | ||
| 522 | - style: TextStyle( | ||
| 523 | - decoration: TextDecoration.underline, | ||
| 524 | - color: MyColours.color_438E93, | ||
| 525 | - fontSize: ScreenUtil().setSp(28)), | ||
| 526 | - )) | ||
| 527 | - : SizedBox(), | 497 | + // (userModel.user.role_name == '管理员' || |
| 498 | + // userModel.user.role_name == '店长') | ||
| 499 | + if (Utils.getAuthority(context, '指派为存酒管理员')) | ||
| 500 | + InkWell( | ||
| 501 | + onTap: () async { | ||
| 502 | + Map<String, String> pramams = { | ||
| 503 | + 'sid': Provider.of<UserModel>(context, listen: false) | ||
| 504 | + .user | ||
| 505 | + .sellerid, | ||
| 506 | + 'uid': uid, | ||
| 507 | + 'is_store_wine': isStoreWine == '1' ? '0' : '1' | ||
| 508 | + }; | ||
| 509 | + StoreWineProvider storeWineProvider = | ||
| 510 | + Provider.of<StoreWineProvider>(context, | ||
| 511 | + listen: false); | ||
| 512 | + bool success = await storeWineProvider | ||
| 513 | + .setStoreWineBySellerUser(context, pramams, | ||
| 514 | + showLoading: true); | ||
| 515 | + if (success) { | ||
| 516 | + setState(() { | ||
| 517 | + isStoreWine = isStoreWine == '1' ? '0' : '1'; | ||
| 518 | + }); | ||
| 519 | + } | ||
| 520 | + }, | ||
| 521 | + child: Text( | ||
| 522 | + isStoreWine == '1' ? '解除指派存酒管理员' : '指派为存酒管理员', | ||
| 523 | + style: TextStyle( | ||
| 524 | + decoration: TextDecoration.underline, | ||
| 525 | + color: MyColours.color_438E93, | ||
| 526 | + fontSize: ScreenUtil().setSp(28)), | ||
| 527 | + )), | ||
| 528 | // Container( | 528 | // Container( |
| 529 | // margin: EdgeInsets.all(ScreenUtil().setWidth(40)), | 529 | // margin: EdgeInsets.all(ScreenUtil().setWidth(40)), |
| 530 | // child: Column( | 530 | // child: Column( |
| @@ -10,6 +10,7 @@ import 'package:one_key/provider/user_model.dart'; | @@ -10,6 +10,7 @@ import 'package:one_key/provider/user_model.dart'; | ||
| 10 | import 'package:one_key/res/colors.dart'; | 10 | import 'package:one_key/res/colors.dart'; |
| 11 | import 'package:one_key/utils/event_bus.dart'; | 11 | import 'package:one_key/utils/event_bus.dart'; |
| 12 | import 'package:one_key/route/navigator_util.dart'; | 12 | import 'package:one_key/route/navigator_util.dart'; |
| 13 | +import 'package:one_key/utils/utils.dart'; | ||
| 13 | import 'package:one_key/widgets/round_button.dart'; | 14 | import 'package:one_key/widgets/round_button.dart'; |
| 14 | import 'package:one_key/widgets/system_app_bar.dart'; | 15 | import 'package:one_key/widgets/system_app_bar.dart'; |
| 15 | import 'package:one_key/widgets/v_empty_view.dart'; | 16 | import 'package:one_key/widgets/v_empty_view.dart'; |
| @@ -240,10 +241,9 @@ class _MyPlanDishHomePageState extends State<MyPlanDishHomePage> | @@ -240,10 +241,9 @@ class _MyPlanDishHomePageState extends State<MyPlanDishHomePage> | ||
| 240 | isBold: false, | 241 | isBold: false, |
| 241 | fontSize: 28, | 242 | fontSize: 28, |
| 242 | onPressed: () async { | 243 | onPressed: () async { |
| 243 | - UserModel userModel = | ||
| 244 | - Provider.of<UserModel>(context, listen: false); | ||
| 245 | - if (userModel.user.role_name == '管理员' || | ||
| 246 | - userModel.user.role_name == '店长') { | 244 | + // UserModel userModel = |
| 245 | + // Provider.of<UserModel>(context, listen: false); | ||
| 246 | + if (Utils.getAuthority(context, '创建新排菜')){ | ||
| 247 | NavigatorUtil.goPlanDishCreateSelectTypePage(context); | 247 | NavigatorUtil.goPlanDishCreateSelectTypePage(context); |
| 248 | } else { | 248 | } else { |
| 249 | bool needRefresh = await NavigatorUtil.goPlanDishEditPage( | 249 | bool needRefresh = await NavigatorUtil.goPlanDishEditPage( |
| @@ -217,8 +217,7 @@ class _PlanDishItemState extends State<PlanDishItem> { | @@ -217,8 +217,7 @@ class _PlanDishItemState extends State<PlanDishItem> { | ||
| 217 | Spacer(), | 217 | Spacer(), |
| 218 | //私,则是自己的,可删除 | 218 | //私,则是自己的,可删除 |
| 219 | widget.sunList.type == '2' || | 219 | widget.sunList.type == '2' || |
| 220 | - userModel.user.role_name == '管理员' || | ||
| 221 | - userModel.user.role_name == '店长' | 220 | + Utils.getAuthority(context, '删除排菜') |
| 222 | ? RoundButton( | 221 | ? RoundButton( |
| 223 | width: ScreenUtil().setWidth(50 * 2), | 222 | width: ScreenUtil().setWidth(50 * 2), |
| 224 | height: ScreenUtil().setWidth(20 * 2), | 223 | height: ScreenUtil().setWidth(20 * 2), |
| @@ -234,8 +233,7 @@ class _PlanDishItemState extends State<PlanDishItem> { | @@ -234,8 +233,7 @@ class _PlanDishItemState extends State<PlanDishItem> { | ||
| 234 | : SizedBox(), | 233 | : SizedBox(), |
| 235 | HEmptyView(34), | 234 | HEmptyView(34), |
| 236 | widget.sunList.type == '2' || | 235 | widget.sunList.type == '2' || |
| 237 | - userModel.user.role_name == '管理员' || | ||
| 238 | - userModel.user.role_name == '店长' | 236 | + Utils.getAuthority(context, '复用排菜') |
| 239 | ? RoundButton( | 237 | ? RoundButton( |
| 240 | width: ScreenUtil().setWidth(50 * 2), | 238 | width: ScreenUtil().setWidth(50 * 2), |
| 241 | height: ScreenUtil().setWidth(20 * 2), | 239 | height: ScreenUtil().setWidth(20 * 2), |
| @@ -12,6 +12,7 @@ import 'package:one_key/provider/user_model.dart'; | @@ -12,6 +12,7 @@ import 'package:one_key/provider/user_model.dart'; | ||
| 12 | import 'package:one_key/res/colors.dart'; | 12 | import 'package:one_key/res/colors.dart'; |
| 13 | import 'package:one_key/route/navigator_util.dart'; | 13 | import 'package:one_key/route/navigator_util.dart'; |
| 14 | import 'package:one_key/utils/event_bus.dart'; | 14 | import 'package:one_key/utils/event_bus.dart'; |
| 15 | +import 'package:one_key/utils/utils.dart'; | ||
| 15 | import 'package:one_key/widgets/page_exception.dart'; | 16 | import 'package:one_key/widgets/page_exception.dart'; |
| 16 | import 'package:one_key/widgets/v_empty_view.dart'; | 17 | import 'package:one_key/widgets/v_empty_view.dart'; |
| 17 | import 'package:provider/provider.dart'; | 18 | import 'package:provider/provider.dart'; |
| @@ -115,11 +116,10 @@ class _PlanDishSunPageState extends State<PlanDishSunPage> { | @@ -115,11 +116,10 @@ class _PlanDishSunPageState extends State<PlanDishSunPage> { | ||
| 115 | (BuildContext context, int index) { | 116 | (BuildContext context, int index) { |
| 116 | return InkWell( | 117 | return InkWell( |
| 117 | onTap: () async { | 118 | onTap: () async { |
| 118 | - UserModel userModel = | ||
| 119 | - Provider.of<UserModel>(context, listen: false); | 119 | + // UserModel userModel = |
| 120 | + // Provider.of<UserModel>(context, listen: false); | ||
| 120 | bool canedit = widget.data[index].type == '2' || | 121 | bool canedit = widget.data[index].type == '2' || |
| 121 | - userModel.user.role_name == '管理员' || | ||
| 122 | - userModel.user.role_name == '店长'; | 122 | + Utils.getAuthority(context, '编辑排菜'); |
| 123 | 123 | ||
| 124 | bool needRefresh = | 124 | bool needRefresh = |
| 125 | await NavigatorUtil.goPlanDishEditPage(context, | 125 | await NavigatorUtil.goPlanDishEditPage(context, |
| @@ -403,10 +403,11 @@ class _StoreWineManageHomePageState extends State<StoreWineManageHomePage> | @@ -403,10 +403,11 @@ class _StoreWineManageHomePageState extends State<StoreWineManageHomePage> | ||
| 403 | rightImgName: 'set_g.png', | 403 | rightImgName: 'set_g.png', |
| 404 | onTapRight: () { | 404 | onTapRight: () { |
| 405 | UserModel userModel = Provider.of<UserModel>(context, listen: false); | 405 | UserModel userModel = Provider.of<UserModel>(context, listen: false); |
| 406 | - bool isRole = userModel.user.role_name == '管理员' || | ||
| 407 | - userModel.user.role_name == '店长' | ||
| 408 | - ? true | ||
| 409 | - : false; | 406 | + // bool isRole = userModel.user.role_name == '管理员' || |
| 407 | + // userModel.user.role_name == '店长' | ||
| 408 | + // ? true | ||
| 409 | + // : false; | ||
| 410 | + bool isRole= Utils.getAuthority(context, '存酒管理设置'); | ||
| 410 | if (isRole) { | 411 | if (isRole) { |
| 411 | NavigatorUtil.goWineSettingPage(context); | 412 | NavigatorUtil.goWineSettingPage(context); |
| 412 | } else { | 413 | } else { |
| @@ -1553,7 +1553,7 @@ class TableManagerPageState extends State<TableManagerPage> { | @@ -1553,7 +1553,7 @@ class TableManagerPageState extends State<TableManagerPage> { | ||
| 1553 | ], | 1553 | ], |
| 1554 | )); | 1554 | )); |
| 1555 | } | 1555 | } |
| 1556 | - | 1556 | +/* |
| 1557 | ///优惠券选择 | 1557 | ///优惠券选择 |
| 1558 | Widget _couponWidget() { | 1558 | Widget _couponWidget() { |
| 1559 | return Padding( | 1559 | return Padding( |
| @@ -1676,6 +1676,7 @@ class TableManagerPageState extends State<TableManagerPage> { | @@ -1676,6 +1676,7 @@ class TableManagerPageState extends State<TableManagerPage> { | ||
| 1676 | ], | 1676 | ], |
| 1677 | )); | 1677 | )); |
| 1678 | } | 1678 | } |
| 1679 | + */ | ||
| 1679 | 1680 | ||
| 1680 | ///选中的桌子widget | 1681 | ///选中的桌子widget |
| 1681 | Widget _selectTableWidgetWechat() { | 1682 | Widget _selectTableWidgetWechat() { |
-
Please register or login to post a comment