|
|
@@ -97,6 +97,36 @@ static const int delta = 25;
|
|
|
-(void)cellDoubleTapAction:(UIGestureRecognizer*)gestureRecognizer
|
|
|
{
|
|
|
NSLog(@"cell double tap");
|
|
|
+
|
|
|
+ //strongSelf.content_action
|
|
|
+ if(self.content_action!=nil)
|
|
|
+ {
|
|
|
+ NSString * module = self.content_action[@"module"];
|
|
|
+ if([module isEqualToString:@"quick_look"])
|
|
|
+ {
|
|
|
+
|
|
|
+// +(NSString*)download_file : (NSMutableDictionary*) params url:(NSString*) url
|
|
|
+ NSMutableDictionary *params = self.content_action[@"params"];
|
|
|
+ NSString* URL =self.content_action[@"url"];
|
|
|
+ __weak typeof(self) weakSelf = self;
|
|
|
+ dispatch_async(dispatch_get_global_queue(0, 0), ^{
|
|
|
+
|
|
|
+
|
|
|
+ NSString *path = [RANetwork download_file:params url:URL];
|
|
|
+ weakSelf.documentPath = path;
|
|
|
+
|
|
|
+ if (path) {
|
|
|
+ dispatch_async(dispatch_get_main_queue(), ^{
|
|
|
+ [weakSelf.navigationController pushViewController:weakSelf.quickLook animated:YES];
|
|
|
+ });
|
|
|
+ }
|
|
|
+
|
|
|
+ });
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
}
|
|
|
-(void)labelTapAction:(UIGestureRecognizer*)gestureRecognizer
|
|
|
{
|
|
|
@@ -405,11 +435,21 @@ static const int delta = 25;
|
|
|
|
|
|
- (void)downloadItemClick:(UIBarButtonItem *)sender {
|
|
|
|
|
|
+
|
|
|
+
|
|
|
+ if(self.download_query )
|
|
|
+ {
|
|
|
+ self.documentPath = self.download_query;
|
|
|
+ [self.navigationController pushViewController:self.quickLook animated:YES];
|
|
|
+ return;
|
|
|
+ }
|
|
|
+
|
|
|
__weak typeof(self) weakSelf = self;
|
|
|
dispatch_async(dispatch_get_global_queue(0, 0), ^{
|
|
|
|
|
|
NSMutableDictionary *params = self.params.mutableCopy;
|
|
|
NSString *path = [RANetwork download_query:params];
|
|
|
+ weakSelf.download_query = path;
|
|
|
weakSelf.documentPath = path;
|
|
|
|
|
|
if (path) {
|
|
|
@@ -461,6 +501,7 @@ static const int delta = 25;
|
|
|
__strong typeof(weakSelf) strongSelf = weakSelf;
|
|
|
if (result == RESULT_TRUE) {
|
|
|
strongSelf.content_layout = [contentDic objectForKey:@"layout"];
|
|
|
+ strongSelf.content_action = [contentDic objectForKey:@"action"];
|
|
|
strongSelf.content_data = [contentDic objectForKey:@"data"];
|
|
|
[strongSelf updateTableFrame];
|
|
|
[strongSelf.tableview reloadData];
|
|
|
@@ -577,11 +618,16 @@ static const int delta = 25;
|
|
|
#pragma mark - Quick Look
|
|
|
|
|
|
- (QLPreviewController *)quickLook {
|
|
|
- if (!_quickLook) {
|
|
|
+ if (!_quickLook)
|
|
|
+ {
|
|
|
_quickLook = [[QLPreviewController alloc] init];
|
|
|
_quickLook.delegate = self;
|
|
|
_quickLook.dataSource = self;
|
|
|
}
|
|
|
+ else
|
|
|
+ {
|
|
|
+ [_quickLook reloadData];
|
|
|
+ }
|
|
|
return _quickLook;
|
|
|
}
|
|
|
|