|
|
@@ -36,8 +36,12 @@
|
|
|
#define UNZIP_NO_SPACE 2
|
|
|
#define UNZIP_FILE_DAMAGE 3
|
|
|
|
|
|
+
|
|
|
+
|
|
|
@interface AppDelegate ()
|
|
|
|
|
|
+@property (nonatomic,strong) NSMutableDictionary *globalParameters;
|
|
|
+
|
|
|
@property (nonatomic,strong) NSDate *forgroundDate;
|
|
|
|
|
|
@end
|
|
|
@@ -54,16 +58,73 @@
|
|
|
@synthesize ScanApiConsumer;
|
|
|
@synthesize scanApiVersion;
|
|
|
//@synthesize devices;
|
|
|
--(void) set_priceHidden:(bool)price_hidden
|
|
|
-{
|
|
|
+
|
|
|
+#pragma mark - Global Parameter
|
|
|
+
|
|
|
+- (NSMutableDictionary *)globalParameters {
|
|
|
+ if (!_globalParameters) {
|
|
|
+ _globalParameters = [NSMutableDictionary dictionary];
|
|
|
+ }
|
|
|
+ return _globalParameters;
|
|
|
+}
|
|
|
+
|
|
|
+
|
|
|
+- (void)setGlobalParameter:(id)param forKey:(NSString *)key {
|
|
|
+ if (param == nil || key == nil) {
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ [self.globalParameters setObject:param forKey:key];
|
|
|
+}
|
|
|
+
|
|
|
+- (id)globalParameterForKey:(NSString *)key {
|
|
|
+ if (key == nil) {
|
|
|
+ return nil;
|
|
|
+ }
|
|
|
+ return [self.globalParameters objectForKey:key];
|
|
|
+}
|
|
|
+
|
|
|
+#pragma mark - Setter
|
|
|
+
|
|
|
+- (void)setUrgencyDic:(NSMutableDictionary *)urgencyDic {
|
|
|
+ _urgencyDic = urgencyDic;
|
|
|
+ [self setGlobalParameter:_urgencyDic forKey:@"urgencyDic"];
|
|
|
+}
|
|
|
+
|
|
|
+- (void)setCan_see_price:(bool)can_see_price {
|
|
|
+ _can_see_price = can_see_price;
|
|
|
+ [self setGlobalParameter:@(_can_see_price) forKey:@"can_see_price"];
|
|
|
+}
|
|
|
+
|
|
|
+- (void)setPrice_hidden:(bool)price_hidden {
|
|
|
_price_hidden = price_hidden;
|
|
|
+ [self setGlobalParameter:@(_price_hidden) forKey:@"price_hidden"];
|
|
|
|
|
|
ActiveViewController* avc=(ActiveViewController*)self.active_controller;
|
|
|
|
|
|
- // NSObject* obj;
|
|
|
- // [obj isEqual:@""];
|
|
|
-
|
|
|
[avc showHidePrice];
|
|
|
+
|
|
|
+}
|
|
|
+
|
|
|
+- (void)setOffline_mode:(bool)offline_mode {
|
|
|
+ _offline_mode = offline_mode;
|
|
|
+ [self setGlobalParameter:@(_offline_mode) forKey:@"offline_mode"];
|
|
|
+}
|
|
|
+
|
|
|
+- (void)setUser:(NSString *)user {
|
|
|
+ _user = user;
|
|
|
+ [self setGlobalParameter:_user forKey:@"user"];
|
|
|
+}
|
|
|
+
|
|
|
+- (void)setPassword:(NSString *)password {
|
|
|
+ _password = password;
|
|
|
+ [self setGlobalParameter:_password forKey:@"password"];
|
|
|
+}
|
|
|
+
|
|
|
+#pragma mark - Normal
|
|
|
+
|
|
|
+-(void) set_priceHidden:(bool)price_hidden
|
|
|
+{
|
|
|
+ [self setPrice_hidden:price_hidden];
|
|
|
}
|
|
|
|
|
|
-(void) setCustomerInfo:(NSMutableDictionary*)customerInfo
|
|
|
@@ -789,7 +850,7 @@ void UncaughtExceptionHandler(NSException *exception) {
|
|
|
|
|
|
}
|
|
|
|
|
|
- _urgencyDic = [NSMutableDictionary dictionary];
|
|
|
+ self.urgencyDic = [NSMutableDictionary dictionary];
|
|
|
|
|
|
return resultDic;
|
|
|
}
|