|
|
@@ -2180,20 +2180,33 @@
|
|
|
UIApplication * app = [UIApplication sharedApplication];
|
|
|
AppDelegate *appDelegate = (AppDelegate *)[app delegate];
|
|
|
|
|
|
- JKLockController *lockVC = [[JKLockController alloc] init];
|
|
|
- [lockVC setPasswordKey:[NSString stringWithFormat:@"%@_password",appDelegate.user]];
|
|
|
- __weak typeof(self) weakself = self;
|
|
|
- lockVC.authoReturn = ^(BOOL failure) {
|
|
|
-
|
|
|
- if (weakself) {
|
|
|
- __strong typeof(weakself) strongself = weakself;
|
|
|
- [appDelegate set_priceHidden:false];
|
|
|
+ if (appDelegate.user_type == USER_ROLE_CUSTOMER) {
|
|
|
+
|
|
|
+ JKLockController *lockVC = [[JKLockController alloc] init];
|
|
|
+ [lockVC setPasswordKey:[NSString stringWithFormat:@"%@_password",appDelegate.user]];
|
|
|
+ __weak typeof(self) weakself = self;
|
|
|
+ lockVC.authoReturn = ^(BOOL failure) {
|
|
|
|
|
|
- [strongself initMenuItems];
|
|
|
- [strongself hideMenu];
|
|
|
- }
|
|
|
- };
|
|
|
- [self.navigationController pushViewController:lockVC animated:YES];
|
|
|
+ if (weakself) {
|
|
|
+ __strong typeof(weakself) strongself = weakself;
|
|
|
+ [appDelegate set_priceHidden:false];
|
|
|
+
|
|
|
+ [strongself initMenuItems];
|
|
|
+ [strongself hideMenu];
|
|
|
+ }
|
|
|
+ };
|
|
|
+ [self.navigationController pushViewController:lockVC animated:YES];
|
|
|
+
|
|
|
+ } else {
|
|
|
+
|
|
|
+ [appDelegate set_priceHidden:false];
|
|
|
+
|
|
|
+ [self initMenuItems];
|
|
|
+ [self hideMenu];
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
|
|
|
}
|
|
|
else if([title isEqualToString:@"Hide Price"])
|
|
|
@@ -2201,20 +2214,32 @@
|
|
|
UIApplication * app = [UIApplication sharedApplication];
|
|
|
AppDelegate *appDelegate = (AppDelegate *)[app delegate];
|
|
|
|
|
|
- JKLockController *lockVC = [[JKLockController alloc] init];
|
|
|
- [lockVC setPasswordKey:[NSString stringWithFormat:@"%@_password",appDelegate.user]];
|
|
|
- __weak typeof(self) weakself = self;
|
|
|
- lockVC.authoReturn = ^(BOOL failure) {
|
|
|
+ if (appDelegate.user_type == USER_ROLE_CUSTOMER) {
|
|
|
|
|
|
- if (weakself) {
|
|
|
- __strong typeof(weakself) strongself = weakself;
|
|
|
- [appDelegate set_priceHidden:true];
|
|
|
+ JKLockController *lockVC = [[JKLockController alloc] init];
|
|
|
+ [lockVC setPasswordKey:[NSString stringWithFormat:@"%@_password",appDelegate.user]];
|
|
|
+ __weak typeof(self) weakself = self;
|
|
|
+ lockVC.authoReturn = ^(BOOL failure) {
|
|
|
|
|
|
- [strongself initMenuItems];
|
|
|
- [strongself hideMenu];
|
|
|
- }
|
|
|
- };
|
|
|
- [self.navigationController pushViewController:lockVC animated:YES];
|
|
|
+ if (weakself) {
|
|
|
+ __strong typeof(weakself) strongself = weakself;
|
|
|
+ [appDelegate set_priceHidden:true];
|
|
|
+
|
|
|
+ [strongself initMenuItems];
|
|
|
+ [strongself hideMenu];
|
|
|
+ }
|
|
|
+ };
|
|
|
+ [self.navigationController pushViewController:lockVC animated:YES];
|
|
|
+
|
|
|
+ } else {
|
|
|
+
|
|
|
+ [appDelegate set_priceHidden:true];
|
|
|
+
|
|
|
+ [self initMenuItems];
|
|
|
+ [self hideMenu];
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
}
|
|
|
|
|
|
|