|
@@ -616,7 +616,10 @@
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
- (void)checkProductAvailable:(NSArray *)contents {
|
|
- (void)checkProductAvailable:(NSArray *)contents {
|
|
|
-
|
|
|
|
|
|
|
+ if (contents == nil) {
|
|
|
|
|
+ self.available = NO;
|
|
|
|
|
+ return;
|
|
|
|
|
+ }
|
|
|
[contents enumerateObjectsUsingBlock:^(id _Nonnull obj, NSUInteger idx, BOOL * _Nonnull stop) {
|
|
[contents enumerateObjectsUsingBlock:^(id _Nonnull obj, NSUInteger idx, BOOL * _Nonnull stop) {
|
|
|
|
|
|
|
|
if ([obj isKindOfClass:[NSDictionary class]]) {
|
|
if ([obj isKindOfClass:[NSDictionary class]]) {
|
|
@@ -630,11 +633,35 @@
|
|
|
}];
|
|
}];
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
+- (void)clearContent {
|
|
|
|
|
+ dispatch_async(dispatch_get_main_queue(), ^{
|
|
|
|
|
+ self.freejson = nil;
|
|
|
|
|
+ self.notes = nil;
|
|
|
|
|
+ self.content_arr = nil;
|
|
|
|
|
+ self.currentOrderIsMerged = nil;
|
|
|
|
|
+ self.cart_json = nil;
|
|
|
|
|
+ [Singleton sharedInstance].currentOrderIsMerged = NO;
|
|
|
|
|
+ self.print_url = nil;
|
|
|
|
|
+
|
|
|
|
|
+ [self checkProductAvailable:self.content_arr];
|
|
|
|
|
+ [self refresh_total];
|
|
|
|
|
+ [self.itemListTable reloadData];
|
|
|
|
|
+ });
|
|
|
|
|
+}
|
|
|
|
|
+
|
|
|
-(void) operation_reload_data
|
|
-(void) operation_reload_data
|
|
|
{
|
|
{
|
|
|
if (self.dataOperationQueue.operationCount > 1) {
|
|
if (self.dataOperationQueue.operationCount > 1) {
|
|
|
return;
|
|
return;
|
|
|
}
|
|
}
|
|
|
|
|
+
|
|
|
|
|
+ AppDelegate *appDelegate = (AppDelegate *)[UIApplication sharedApplication].delegate;
|
|
|
|
|
+ if (appDelegate.order_code == nil || appDelegate.order_code.length == 0) {
|
|
|
|
|
+ [self clearContent];
|
|
|
|
|
+ return;
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
__weak typeof(self) weakself = self;
|
|
__weak typeof(self) weakself = self;
|
|
|
dispatch_async(dispatch_get_main_queue(), ^{
|
|
dispatch_async(dispatch_get_main_queue(), ^{
|
|
|
if(weakself.isrefreshing)
|
|
if(weakself.isrefreshing)
|