Commit af9ea1a3a1c16707c73067ad0e9ba72a312f5ec7
Merge branch 'master' of bj.gitlab.cnlive.com:ios-team/ScioLive
Showing
10 changed files
with
248 additions
and
76 deletions
CNLiveScioLive.xcodeproj/project.pbxproj
| @@ -50,6 +50,7 @@ | @@ -50,6 +50,7 @@ | ||
| 50 | 0838487D215CF6FC00186618 /* BaseViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 0838487C215CF6FB00186618 /* BaseViewController.m */; }; | 50 | 0838487D215CF6FC00186618 /* BaseViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 0838487C215CF6FB00186618 /* BaseViewController.m */; }; |
| 51 | 0838487E215CF6FC00186618 /* BaseViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 0838487C215CF6FB00186618 /* BaseViewController.m */; }; | 51 | 0838487E215CF6FC00186618 /* BaseViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 0838487C215CF6FB00186618 /* BaseViewController.m */; }; |
| 52 | 0838487F215CF6FC00186618 /* BaseViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 0838487C215CF6FB00186618 /* BaseViewController.m */; }; | 52 | 0838487F215CF6FC00186618 /* BaseViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 0838487C215CF6FB00186618 /* BaseViewController.m */; }; |
| 53 | + 08471A9F25E7864E0043FC2D /* VideoDetailPresent.m in Sources */ = {isa = PBXBuildFile; fileRef = 08471A9E25E7864E0043FC2D /* VideoDetailPresent.m */; }; | ||
| 53 | 084ACDFD21547AE80089E035 /* CNLiveContactUsViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 084ACDFC21547AE80089E035 /* CNLiveContactUsViewController.m */; }; | 54 | 084ACDFD21547AE80089E035 /* CNLiveContactUsViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 084ACDFC21547AE80089E035 /* CNLiveContactUsViewController.m */; }; |
| 54 | 084ACDFE21547AE80089E035 /* CNLiveContactUsViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 084ACDFC21547AE80089E035 /* CNLiveContactUsViewController.m */; }; | 55 | 084ACDFE21547AE80089E035 /* CNLiveContactUsViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 084ACDFC21547AE80089E035 /* CNLiveContactUsViewController.m */; }; |
| 55 | 084ACDFF21547AE80089E035 /* CNLiveContactUsViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 084ACDFC21547AE80089E035 /* CNLiveContactUsViewController.m */; }; | 56 | 084ACDFF21547AE80089E035 /* CNLiveContactUsViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 084ACDFC21547AE80089E035 /* CNLiveContactUsViewController.m */; }; |
| @@ -781,6 +782,8 @@ | @@ -781,6 +782,8 @@ | ||
| 781 | 08384877215CC9E400186618 /* GraphicLiveViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = GraphicLiveViewController.h; sourceTree = "<group>"; }; | 782 | 08384877215CC9E400186618 /* GraphicLiveViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = GraphicLiveViewController.h; sourceTree = "<group>"; }; |
| 782 | 0838487B215CF6FB00186618 /* BaseViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = BaseViewController.h; sourceTree = "<group>"; }; | 783 | 0838487B215CF6FB00186618 /* BaseViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = BaseViewController.h; sourceTree = "<group>"; }; |
| 783 | 0838487C215CF6FB00186618 /* BaseViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = BaseViewController.m; sourceTree = "<group>"; }; | 784 | 0838487C215CF6FB00186618 /* BaseViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = BaseViewController.m; sourceTree = "<group>"; }; |
| 785 | + 08471A9D25E7864E0043FC2D /* VideoDetailPresent.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = VideoDetailPresent.h; sourceTree = "<group>"; }; | ||
| 786 | + 08471A9E25E7864E0043FC2D /* VideoDetailPresent.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = VideoDetailPresent.m; sourceTree = "<group>"; }; | ||
| 784 | 084ACDFB21547AE80089E035 /* CNLiveContactUsViewController.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = CNLiveContactUsViewController.h; sourceTree = "<group>"; }; | 787 | 084ACDFB21547AE80089E035 /* CNLiveContactUsViewController.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = CNLiveContactUsViewController.h; sourceTree = "<group>"; }; |
| 785 | 084ACDFC21547AE80089E035 /* CNLiveContactUsViewController.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = CNLiveContactUsViewController.m; sourceTree = "<group>"; }; | 788 | 084ACDFC21547AE80089E035 /* CNLiveContactUsViewController.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = CNLiveContactUsViewController.m; sourceTree = "<group>"; }; |
| 786 | 084ACE0021547B4D0089E035 /* CNLiveMyCollectionViewController.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = CNLiveMyCollectionViewController.h; sourceTree = "<group>"; }; | 789 | 084ACE0021547B4D0089E035 /* CNLiveMyCollectionViewController.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = CNLiveMyCollectionViewController.h; sourceTree = "<group>"; }; |
| @@ -1288,6 +1291,7 @@ | @@ -1288,6 +1291,7 @@ | ||
| 1288 | 0838484A215CA71C00186618 /* OldController */ = { | 1291 | 0838484A215CA71C00186618 /* OldController */ = { |
| 1289 | isa = PBXGroup; | 1292 | isa = PBXGroup; |
| 1290 | children = ( | 1293 | children = ( |
| 1294 | + 08471A8F25E785B50043FC2D /* Present */, | ||
| 1291 | 0838487B215CF6FB00186618 /* BaseViewController.h */, | 1295 | 0838487B215CF6FB00186618 /* BaseViewController.h */, |
| 1292 | 0838487C215CF6FB00186618 /* BaseViewController.m */, | 1296 | 0838487C215CF6FB00186618 /* BaseViewController.m */, |
| 1293 | 0838484B215CA73A00186618 /* OldArticleDetailViewController.h */, | 1297 | 0838484B215CA73A00186618 /* OldArticleDetailViewController.h */, |
| @@ -1316,6 +1320,15 @@ | @@ -1316,6 +1320,15 @@ | ||
| 1316 | path = Html5Utils; | 1320 | path = Html5Utils; |
| 1317 | sourceTree = "<group>"; | 1321 | sourceTree = "<group>"; |
| 1318 | }; | 1322 | }; |
| 1323 | + 08471A8F25E785B50043FC2D /* Present */ = { | ||
| 1324 | + isa = PBXGroup; | ||
| 1325 | + children = ( | ||
| 1326 | + 08471A9D25E7864E0043FC2D /* VideoDetailPresent.h */, | ||
| 1327 | + 08471A9E25E7864E0043FC2D /* VideoDetailPresent.m */, | ||
| 1328 | + ); | ||
| 1329 | + path = Present; | ||
| 1330 | + sourceTree = "<group>"; | ||
| 1331 | + }; | ||
| 1319 | 084ACE0A21547F9F0089E035 /* DBAction */ = { | 1332 | 084ACE0A21547F9F0089E035 /* DBAction */ = { |
| 1320 | isa = PBXGroup; | 1333 | isa = PBXGroup; |
| 1321 | children = ( | 1334 | children = ( |
| @@ -2659,6 +2672,7 @@ | @@ -2659,6 +2672,7 @@ | ||
| 2659 | TargetAttributes = { | 2672 | TargetAttributes = { |
| 2660 | 08C08F6D214F997E00E23D16 = { | 2673 | 08C08F6D214F997E00E23D16 = { |
| 2661 | CreatedOnToolsVersion = 9.4.1; | 2674 | CreatedOnToolsVersion = 9.4.1; |
| 2675 | + LastSwiftMigration = 1240; | ||
| 2662 | SystemCapabilities = { | 2676 | SystemCapabilities = { |
| 2663 | com.apple.BackgroundModes = { | 2677 | com.apple.BackgroundModes = { |
| 2664 | enabled = 1; | 2678 | enabled = 1; |
| @@ -3015,6 +3029,7 @@ | @@ -3015,6 +3029,7 @@ | ||
| 3015 | 08B5C5962153490B00F5476E /* CNMyAnnouncementsModel.m in Sources */, | 3029 | 08B5C5962153490B00F5476E /* CNMyAnnouncementsModel.m in Sources */, |
| 3016 | 08FB8777215DD3C600DA5423 /* NewsVoiceTableViewCell.m in Sources */, | 3030 | 08FB8777215DD3C600DA5423 /* NewsVoiceTableViewCell.m in Sources */, |
| 3017 | 08FB8774215DD3C600DA5423 /* SelectedTableViewCell.m in Sources */, | 3031 | 08FB8774215DD3C600DA5423 /* SelectedTableViewCell.m in Sources */, |
| 3032 | + 08471A9F25E7864E0043FC2D /* VideoDetailPresent.m in Sources */, | ||
| 3018 | C3E502DA2152432700DA4320 /* CNHomeRightTableViewCell.m in Sources */, | 3033 | C3E502DA2152432700DA4320 /* CNHomeRightTableViewCell.m in Sources */, |
| 3019 | 08C090AB215103C400E23D16 /* CNLiveHeaderView.m in Sources */, | 3034 | 08C090AB215103C400E23D16 /* CNLiveHeaderView.m in Sources */, |
| 3020 | 08585D56215B4C7200FC2CA2 /* PGDatePicker+Time.m in Sources */, | 3035 | 08585D56215B4C7200FC2CA2 /* PGDatePicker+Time.m in Sources */, |
| @@ -3597,6 +3612,7 @@ | @@ -3597,6 +3612,7 @@ | ||
| 3597 | buildSettings = { | 3612 | buildSettings = { |
| 3598 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; | 3613 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; |
| 3599 | ASSETCATALOG_COMPILER_LAUNCHIMAGE_NAME = LaunchImage; | 3614 | ASSETCATALOG_COMPILER_LAUNCHIMAGE_NAME = LaunchImage; |
| 3615 | + CLANG_ENABLE_MODULES = YES; | ||
| 3600 | CODE_SIGN_ENTITLEMENTS = CNLiveScioLive/CNLiveScioLive.entitlements; | 3616 | CODE_SIGN_ENTITLEMENTS = CNLiveScioLive/CNLiveScioLive.entitlements; |
| 3601 | CODE_SIGN_IDENTITY = "Apple Development"; | 3617 | CODE_SIGN_IDENTITY = "Apple Development"; |
| 3602 | CODE_SIGN_STYLE = Automatic; | 3618 | CODE_SIGN_STYLE = Automatic; |
| @@ -3639,6 +3655,9 @@ | @@ -3639,6 +3655,9 @@ | ||
| 3639 | PRODUCT_BUNDLE_IDENTIFIER = cn.gov.scio.live1; | 3655 | PRODUCT_BUNDLE_IDENTIFIER = cn.gov.scio.live1; |
| 3640 | PRODUCT_NAME = "$(TARGET_NAME)"; | 3656 | PRODUCT_NAME = "$(TARGET_NAME)"; |
| 3641 | PROVISIONING_PROFILE_SPECIFIER = ""; | 3657 | PROVISIONING_PROFILE_SPECIFIER = ""; |
| 3658 | + SWIFT_OBJC_BRIDGING_HEADER = "CNLiveScioLive/Pages/Home/新闻详情/OldController/Present/CNLiveScioLive-Bridging-Header.h"; | ||
| 3659 | + SWIFT_OPTIMIZATION_LEVEL = "-Onone"; | ||
| 3660 | + SWIFT_VERSION = 5.0; | ||
| 3642 | TARGETED_DEVICE_FAMILY = 1; | 3661 | TARGETED_DEVICE_FAMILY = 1; |
| 3643 | VALID_ARCHS = "arm64 arm64e armv7s"; | 3662 | VALID_ARCHS = "arm64 arm64e armv7s"; |
| 3644 | }; | 3663 | }; |
| @@ -3650,6 +3669,7 @@ | @@ -3650,6 +3669,7 @@ | ||
| 3650 | buildSettings = { | 3669 | buildSettings = { |
| 3651 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; | 3670 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; |
| 3652 | ASSETCATALOG_COMPILER_LAUNCHIMAGE_NAME = LaunchImage; | 3671 | ASSETCATALOG_COMPILER_LAUNCHIMAGE_NAME = LaunchImage; |
| 3672 | + CLANG_ENABLE_MODULES = YES; | ||
| 3653 | CODE_SIGN_ENTITLEMENTS = CNLiveScioLive/CNLiveScioLive.entitlements; | 3673 | CODE_SIGN_ENTITLEMENTS = CNLiveScioLive/CNLiveScioLive.entitlements; |
| 3654 | CODE_SIGN_IDENTITY = "Apple Development"; | 3674 | CODE_SIGN_IDENTITY = "Apple Development"; |
| 3655 | CODE_SIGN_STYLE = Automatic; | 3675 | CODE_SIGN_STYLE = Automatic; |
| @@ -3692,6 +3712,8 @@ | @@ -3692,6 +3712,8 @@ | ||
| 3692 | PRODUCT_BUNDLE_IDENTIFIER = cn.gov.scio.live1; | 3712 | PRODUCT_BUNDLE_IDENTIFIER = cn.gov.scio.live1; |
| 3693 | PRODUCT_NAME = "$(TARGET_NAME)"; | 3713 | PRODUCT_NAME = "$(TARGET_NAME)"; |
| 3694 | PROVISIONING_PROFILE_SPECIFIER = ""; | 3714 | PROVISIONING_PROFILE_SPECIFIER = ""; |
| 3715 | + SWIFT_OBJC_BRIDGING_HEADER = "CNLiveScioLive/Pages/Home/新闻详情/OldController/Present/CNLiveScioLive-Bridging-Header.h"; | ||
| 3716 | + SWIFT_VERSION = 5.0; | ||
| 3695 | TARGETED_DEVICE_FAMILY = 1; | 3717 | TARGETED_DEVICE_FAMILY = 1; |
| 3696 | VALID_ARCHS = "arm64 arm64e armv7s"; | 3718 | VALID_ARCHS = "arm64 arm64e armv7s"; |
| 3697 | }; | 3719 | }; |
CNLiveScioLive/Pages/Header/SystemMacro.h
| @@ -9,6 +9,13 @@ | @@ -9,6 +9,13 @@ | ||
| 9 | #ifndef SystemMacro_h | 9 | #ifndef SystemMacro_h |
| 10 | #define SystemMacro_h | 10 | #define SystemMacro_h |
| 11 | 11 | ||
| 12 | +#ifndef AppKeyWindow | ||
| 13 | +#define AppKeyWindow ((AppDelegate *)[UIApplication sharedApplication].delegate).window | ||
| 14 | +#endif | ||
| 15 | + | ||
| 16 | +//协议调取方法 | ||
| 17 | +#define CNMessageSend(instance,protocol,message) [(id<protocol>)(instance) message] | ||
| 18 | + | ||
| 12 | // 系统语言 | 19 | // 系统语言 |
| 13 | #define SYSTEM_LANGUAGE [[[NSUserDefaults standardUserDefaults] objectForKey:@"AppleLanguages"] objectAtIndex:0] | 20 | #define SYSTEM_LANGUAGE [[[NSUserDefaults standardUserDefaults] objectForKey:@"AppleLanguages"] objectAtIndex:0] |
| 14 | #define IS_CHINESE ([SYSTEM_LANGUAGE isEqualToString:@"zh-Hans-CN"]||[SYSTEM_LANGUAGE isEqualToString:@"zh-Hant-CN"]||[SYSTEM_LANGUAGE isEqualToString:@"zh-Hans"] ||[SYSTEM_LANGUAGE isEqualToString:@"zh-hans"]) | 21 | #define IS_CHINESE ([SYSTEM_LANGUAGE isEqualToString:@"zh-Hans-CN"]||[SYSTEM_LANGUAGE isEqualToString:@"zh-Hant-CN"]||[SYSTEM_LANGUAGE isEqualToString:@"zh-Hans"] ||[SYSTEM_LANGUAGE isEqualToString:@"zh-hans"]) |
CNLiveScioLive/Pages/Home/新闻详情/OldController/OldVideoDetailViewController.m
| @@ -12,9 +12,12 @@ | @@ -12,9 +12,12 @@ | ||
| 12 | #import "VideoTableViewCell.h" | 12 | #import "VideoTableViewCell.h" |
| 13 | #import "ArticleTableViewCell.h" | 13 | #import "ArticleTableViewCell.h" |
| 14 | #import "SearchResultViewController.h" | 14 | #import "SearchResultViewController.h" |
| 15 | -@interface OldVideoDetailViewController ()<CNLivePlayerControllerDelegate>{ | 15 | +#import "VideoDetailPresent.h" |
| 16 | +@interface OldVideoDetailViewController ()<CNLivePlayerControllerDelegate,ProgramDelegate>{ | ||
| 16 | UIButton *_shareBtn; | 17 | UIButton *_shareBtn; |
| 17 | } | 18 | } |
| 19 | +@property (nonatomic,strong)VideoDetailPresent *present; | ||
| 20 | +@property (nonatomic,strong)NSString *content; | ||
| 18 | 21 | ||
| 19 | @end | 22 | @end |
| 20 | @implementation OldVideoDetailViewController | 23 | @implementation OldVideoDetailViewController |
| @@ -43,8 +46,8 @@ | @@ -43,8 +46,8 @@ | ||
| 43 | movieUrl = [NSURL URLWithString:url]; | 46 | movieUrl = [NSURL URLWithString:url]; |
| 44 | videoHeight = MainScreenWidth * (9.0 / 16.0); | 47 | videoHeight = MainScreenWidth * (9.0 / 16.0); |
| 45 | dispatch_async(dispatch_get_global_queue(0, 0), ^{ | 48 | dispatch_async(dispatch_get_global_queue(0, 0), ^{ |
| 46 | - if(!(0 == [self->_dictionary[@"img"] length])){ | ||
| 47 | - NSData *data = [NSData dataWithContentsOfURL:[NSURL URLWithString:self->_dictionary[@"img"]]]; | 49 | + if(!(0 == [self->_dictionary[@"imgSmall"] length])){ |
| 50 | + NSData *data = [NSData dataWithContentsOfURL:[NSURL URLWithString:self->_dictionary[@"imgSmall"]]]; | ||
| 48 | self->bgImg = [UIImage imageWithData:data]; | 51 | self->bgImg = [UIImage imageWithData:data]; |
| 49 | dispatch_async(dispatch_get_main_queue(), ^{ | 52 | dispatch_async(dispatch_get_main_queue(), ^{ |
| 50 | if (self.videoController && self->bgImg) { | 53 | if (self.videoController && self->bgImg) { |
| @@ -63,10 +66,14 @@ | @@ -63,10 +66,14 @@ | ||
| 63 | 66 | ||
| 64 | NSString* htmldate = @""; | 67 | NSString* htmldate = @""; |
| 65 | NSString* htmlForm = @""; | 68 | NSString* htmlForm = @""; |
| 69 | + NSString* content = @""; | ||
| 66 | if ([_dictionary objectForKey:@"publishDate"] && [_dictionary objectForKey:@"author"]) { | 70 | if ([_dictionary objectForKey:@"publishDate"] && [_dictionary objectForKey:@"author"]) { |
| 67 | htmldate = [[NSString alloc] initWithFormat:@"<html><p>%@</p><body>",[NSString stringWithFormat:@"%@",[_dictionary objectForKey:@"publishDate"]]]; | 71 | htmldate = [[NSString alloc] initWithFormat:@"<html><p>%@</p><body>",[NSString stringWithFormat:@"%@",[_dictionary objectForKey:@"publishDate"]]]; |
| 68 | htmlForm = [[NSString alloc] initWithFormat:@"<html><p>%@:%@</p><body>", CustomStr(@"Source"), _dictionary[@"author"]]; | 72 | htmlForm = [[NSString alloc] initWithFormat:@"<html><p>%@:%@</p><body>", CustomStr(@"Source"), _dictionary[@"author"]]; |
| 69 | self.authorName = _dictionary[@"author"]; | 73 | self.authorName = _dictionary[@"author"]; |
| 74 | + if (self.content&&![self.content isEqualToString:@""]) { | ||
| 75 | + content = [[NSString alloc] initWithFormat:@"<div class=\"logo\" style=\"text-indent:2em\"><font style=\"font-size:%@px;\">%@</font></div>",fontArray[fontIndex],self.content]; | ||
| 76 | + } | ||
| 70 | } else { | 77 | } else { |
| 71 | htmldate = [[NSString alloc] initWithFormat:@"<html><p>%@</p><body>",[NSString stringWithFormat:@"%@",[_dictionary objectForKey:@"publishDate"]]]; | 78 | htmldate = [[NSString alloc] initWithFormat:@"<html><p>%@</p><body>",[NSString stringWithFormat:@"%@",[_dictionary objectForKey:@"publishDate"]]]; |
| 72 | NSDictionary *author = [NSDictionary dictionaryWithContentsOfFile:FavouriteAuthors_PATH]; | 79 | NSDictionary *author = [NSDictionary dictionaryWithContentsOfFile:FavouriteAuthors_PATH]; |
| @@ -76,7 +83,7 @@ | @@ -76,7 +83,7 @@ | ||
| 76 | 83 | ||
| 77 | NSString* htmlBody = [[NSString alloc] initWithFormat:@"<div class=\"logo\" style=\"text-indent:2em\"><font style=\"font-size:%@px;\">%@</font></div>",fontArray[fontIndex],[_dictionary objectForKey:@"desc"]]; | 84 | NSString* htmlBody = [[NSString alloc] initWithFormat:@"<div class=\"logo\" style=\"text-indent:2em\"><font style=\"font-size:%@px;\">%@</font></div>",fontArray[fontIndex],[_dictionary objectForKey:@"desc"]]; |
| 78 | NSString* htmlFooter = @"</body></html>"; | 85 | NSString* htmlFooter = @"</body></html>"; |
| 79 | - NSString* strHtml = [[NSString alloc] initWithFormat:@"%@%@%@%@%@",htmlHeader,htmldate,htmlForm,htmlBody,htmlFooter]; | 86 | + NSString* strHtml = [[NSString alloc] initWithFormat:@"%@%@%@%@%@%@",htmlHeader,htmldate,htmlForm,content,htmlBody,htmlFooter]; |
| 80 | return strHtml; | 87 | return strHtml; |
| 81 | } | 88 | } |
| 82 | 89 | ||
| @@ -238,8 +245,11 @@ | @@ -238,8 +245,11 @@ | ||
| 238 | _webView.UIDelegate = self; | 245 | _webView.UIDelegate = self; |
| 239 | _webView.opaque = NO; | 246 | _webView.opaque = NO; |
| 240 | [backgroundView addSubview:_webView]; | 247 | [backgroundView addSubview:_webView]; |
| 248 | + if ([_dictionary objectForKey:@"publishDate"] && [_dictionary objectForKey:@"author"]) { | ||
| 249 | + [self.present requestProgram:_dictionary[@"cmsContentId"]]; | ||
| 250 | + }else{ | ||
| 241 | [_webView loadHTMLString:[self setHTMLString] baseURL:nil]; | 251 | [_webView loadHTMLString:[self setHTMLString] baseURL:nil]; |
| 242 | - | 252 | + } |
| 243 | self.tableView = [[UITableView alloc] initWithFrame:CGRectZero style:UITableViewStyleGrouped]; | 253 | self.tableView = [[UITableView alloc] initWithFrame:CGRectZero style:UITableViewStyleGrouped]; |
| 244 | self.tableView.backgroundColor = [UIColor whiteColor]; | 254 | self.tableView.backgroundColor = [UIColor whiteColor]; |
| 245 | self.tableView.backgroundView = nil; | 255 | self.tableView.backgroundView = nil; |
| @@ -252,6 +262,7 @@ | @@ -252,6 +262,7 @@ | ||
| 252 | if ([self.tableView respondsToSelector:@selector(setSeparatorInset:)]) { | 262 | if ([self.tableView respondsToSelector:@selector(setSeparatorInset:)]) { |
| 253 | [self.tableView setSeparatorInset:UIEdgeInsetsZero]; | 263 | [self.tableView setSeparatorInset:UIEdgeInsetsZero]; |
| 254 | } | 264 | } |
| 265 | + [self.present loadRelatedInformation:_dictionary[@"cmsContentId"]]; | ||
| 255 | self.errorLabe = [[UILabel alloc] initWithFrame:CGRectZero]; | 266 | self.errorLabe = [[UILabel alloc] initWithFrame:CGRectZero]; |
| 256 | self.errorLabe.backgroundColor = [UIColor clearColor]; | 267 | self.errorLabe.backgroundColor = [UIColor clearColor]; |
| 257 | self.errorLabe.textColor = HEXCOLOR(0x333333); | 268 | self.errorLabe.textColor = HEXCOLOR(0x333333); |
| @@ -270,17 +281,18 @@ | @@ -270,17 +281,18 @@ | ||
| 270 | - (void)observeValueForKeyPath:(NSString *)keyPath ofObject:(id)object change:(NSDictionary *)change context:(void *)context { | 281 | - (void)observeValueForKeyPath:(NSString *)keyPath ofObject:(id)object change:(NSDictionary *)change context:(void *)context { |
| 271 | 282 | ||
| 272 | if ([keyPath isEqualToString:@"contentSize"] && !_webView.loading && _webView.height != _webView.scrollView.contentSize.height) { | 283 | if ([keyPath isEqualToString:@"contentSize"] && !_webView.loading && _webView.height != _webView.scrollView.contentSize.height) { |
| 273 | - CGRect frame = self->_webView.frame; | 284 | + CGRect frame = _webView.frame; |
| 274 | frame.size.width = MainScreenWidth; | 285 | frame.size.width = MainScreenWidth; |
| 275 | frame.size.height = 1; | 286 | frame.size.height = 1; |
| 276 | CGFloat graphicLiveHeight = self->_webView.scrollView.contentSize.height; | 287 | CGFloat graphicLiveHeight = self->_webView.scrollView.contentSize.height; |
| 277 | - frame.size.height = self->_webView.scrollView.contentSize.height; | ||
| 278 | - NSLog(@"YYYYYYYYYYY%f",self->_webView.scrollView.contentSize.height); | ||
| 279 | - self->_webView.frame = frame; | ||
| 280 | - if (0 == [self->heightArr[self->fontIndex] floatValue]) { | ||
| 281 | - [self->heightArr replaceObjectAtIndex:self->fontIndex withObject:[NSString stringWithFormat:@"%f",graphicLiveHeight]]; | 288 | + frame.size.height = _webView.scrollView.contentSize.height; |
| 289 | + NSLog(@"YYYYYYYYYYY%f",_webView.scrollView.contentSize.height); | ||
| 290 | + _webView.frame = frame; | ||
| 291 | + [heightArr replaceObjectAtIndex:fontIndex withObject:[NSString stringWithFormat:@"%f",graphicLiveHeight]]; | ||
| 292 | + if (_newsArray.count != 0) { | ||
| 293 | + [self.tableView setFrame:CGRectMake(0, [heightArr[fontIndex] floatValue], MainScreenWidth, 36 + 86*_newsArray.count)]; | ||
| 282 | } | 294 | } |
| 283 | - [self loadRelatedInformation]; | 295 | + [backgroundView setContentSize:CGSizeMake(MainScreenWidth, [heightArr[fontIndex] floatValue] + self.tableView.frame.size.height)]; |
| 284 | } | 296 | } |
| 285 | } | 297 | } |
| 286 | // CNLivePlayer | 298 | // CNLivePlayer |
| @@ -444,48 +456,30 @@ | @@ -444,48 +456,30 @@ | ||
| 444 | NSLog(@"value: %@ error: %@", response, error); | 456 | NSLog(@"value: %@ error: %@", response, error); |
| 445 | 457 | ||
| 446 | }]; | 458 | }]; |
| 459 | + | ||
| 447 | } | 460 | } |
| 448 | -- (void)loadRelatedInformation { | ||
| 449 | - if (![[Reachability reachabilityForInternetConnection] currentReachabilityStatus]) { | ||
| 450 | - [AlertViewTool showHUDViewText:CustomStr(@"NetworkiInterruption")]; | ||
| 451 | - return; | 461 | + |
| 462 | +#pragma mark - ProgramDelegate | ||
| 463 | +-(void)programDetail:(NSString *)content | ||
| 464 | +{ | ||
| 465 | + self.content = content; | ||
| 466 | + [_webView loadHTMLString:[self setHTMLString] baseURL:nil]; | ||
| 467 | +} | ||
| 468 | + | ||
| 469 | +- (void)reloadWithData:(NSArray *)dataArray | ||
| 470 | +{ | ||
| 471 | + if (0 != [dataArray count]) { | ||
| 472 | + _newsArray = [NSArray arrayWithArray:dataArray]; | ||
| 473 | + [self.tableView setFrame:CGRectMake(0, [heightArr[fontIndex] floatValue], MainScreenWidth, 36 + 86*_newsArray.count)]; | ||
| 474 | + } else { | ||
| 475 | + // [self.errorLabe setFrame:CGRectMake(12, [heightArr[fontIndex] floatValue], MainScreenWidth - 24, 20)]; | ||
| 476 | + // self.errorLabe.hidden = NO; | ||
| 452 | } | 477 | } |
| 453 | - NSString *strUrl = @"http://app.phonemovie.cnlive.com/gxb/api/programRelative"; | ||
| 454 | - NSLog(@"%@",strUrl); | ||
| 455 | - NSString *categoryId = [NSString stringWithFormat:@"{\"plat\":\"i\",\"version\":\"5.0\",\"appid\":\"gxb\",\"cmsContentId\":\"%@\"}",_dictionary[@"cmsContentId"]]; | ||
| 456 | - NSLog(@"%@",categoryId); | ||
| 457 | - NSDictionary *parameters = @{@"params":categoryId}; | ||
| 458 | - AFHTTPSessionManager *manager = [AFHTTPSessionManager manager]; | ||
| 459 | - [manager POST:strUrl | ||
| 460 | - parameters:parameters headers:nil | ||
| 461 | - progress:^(NSProgress * _Nonnull uploadProgress) {} | ||
| 462 | - success:^(NSURLSessionDataTask * _Nonnull task, id _Nullable responseObject) { | ||
| 463 | - // 请求成功,解析数据 | ||
| 464 | - NSLog(@"%@", responseObject); | ||
| 465 | - NSDictionary *_dic = [NSDictionary dictionaryWithDictionary:responseObject]; | ||
| 466 | - if ([_dic[@"errorCode"] isEqualToString:@"0"]) { | ||
| 467 | - NSArray *array = _dic[@"programs"]; | ||
| 468 | - if (0 != [array count]) { | ||
| 469 | - self->_newsArray = [NSArray arrayWithArray:array]; | ||
| 470 | - [self.tableView setFrame:CGRectMake(0, [self->heightArr[self->fontIndex] floatValue], MainScreenWidth, 36 + 86*self->_newsArray.count)]; | ||
| 471 | - } else { | ||
| 472 | - // [self.errorLabe setFrame:CGRectMake(12, [heightArr[fontIndex] floatValue], MainScreenWidth - 24, 20)]; | ||
| 473 | - // self.errorLabe.hidden = NO; | ||
| 474 | - } | ||
| 475 | - NSLog(@"%@",NSStringFromCGRect(self.tableView.frame)); | ||
| 476 | - [self->backgroundView setContentSize:CGSizeMake(MainScreenWidth, [self->heightArr[self->fontIndex] floatValue] + self.tableView.frame.size.height)]; | ||
| 477 | - [self.tableView reloadData]; | ||
| 478 | - } else { | ||
| 479 | - [AlertViewTool showHUDViewText:_dic[@"errorMessage"]]; | ||
| 480 | - } | ||
| 481 | - } | ||
| 482 | - failure:^(NSURLSessionDataTask * _Nullable task, NSError * _Nonnull error) { | ||
| 483 | - // 请求失败 | ||
| 484 | - NSLog(@"%@", [error localizedDescription]); | ||
| 485 | - [SVProgressHUD dismiss]; | ||
| 486 | - [AlertViewTool showHUDAddedToView:self.view text:CustomStr(@"ServerBusy")]; | ||
| 487 | - }]; | 478 | + NSLog(@"%@",NSStringFromCGRect(self.tableView.frame)); |
| 479 | + [backgroundView setContentSize:CGSizeMake(MainScreenWidth, [heightArr[fontIndex] floatValue] + self.tableView.frame.size.height)]; | ||
| 480 | + [self.tableView reloadData]; | ||
| 488 | } | 481 | } |
| 482 | +#pragma mark - UITableViewDelegate And UITableViewDataSource | ||
| 489 | - (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section { | 483 | - (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section { |
| 490 | return [_newsArray count]; | 484 | return [_newsArray count]; |
| 491 | } | 485 | } |
| @@ -605,4 +599,15 @@ | @@ -605,4 +599,15 @@ | ||
| 605 | 599 | ||
| 606 | } | 600 | } |
| 607 | 601 | ||
| 602 | +#pragma mark - Lazy | ||
| 603 | +- (VideoDetailPresent *)present | ||
| 604 | +{ | ||
| 605 | + if (!_present) { | ||
| 606 | + _present = [[VideoDetailPresent alloc] init]; | ||
| 607 | + _present.currentView = self; | ||
| 608 | + _present.delegate = self; | ||
| 609 | + } | ||
| 610 | + return _present; | ||
| 611 | +} | ||
| 612 | + | ||
| 608 | @end | 613 | @end |
CNLiveScioLive/Pages/Home/新闻详情/OldController/Present/VideoDetailPresent.h
0 → 100644
| 1 | +// | ||
| 2 | +// VideoDetailPresent.h | ||
| 3 | +// CNLiveScioLive | ||
| 4 | +// | ||
| 5 | +// Created by CNLive on 2021/2/25. | ||
| 6 | +// Copyright © 2021 CNLive. All rights reserved. | ||
| 7 | +// | ||
| 8 | + | ||
| 9 | +#import <Foundation/Foundation.h> | ||
| 10 | + | ||
| 11 | +NS_ASSUME_NONNULL_BEGIN | ||
| 12 | +@protocol ProgramDelegate<NSObject> | ||
| 13 | +@required | ||
| 14 | +-(void)programDetail:(NSString *)content; | ||
| 15 | +-(void)reloadWithData:(NSArray *)dataArray; | ||
| 16 | +@end | ||
| 17 | + | ||
| 18 | +@interface VideoDetailPresent : NSObject | ||
| 19 | +@property(nonatomic,weak) id currentView; | ||
| 20 | +@property(nonatomic,weak)id<ProgramDelegate> delegate; | ||
| 21 | + | ||
| 22 | +-(void)requestProgram:(NSString *)reportId; | ||
| 23 | +-(void)loadRelatedInformation:(NSString *)reportId; | ||
| 24 | +@end | ||
| 25 | + | ||
| 26 | +NS_ASSUME_NONNULL_END |
CNLiveScioLive/Pages/Home/新闻详情/OldController/Present/VideoDetailPresent.m
0 → 100644
| 1 | +// | ||
| 2 | +// VideoDetailPresent.m | ||
| 3 | +// CNLiveScioLive | ||
| 4 | +// | ||
| 5 | +// Created by CNLive on 2021/2/25. | ||
| 6 | +// Copyright © 2021 CNLive. All rights reserved. | ||
| 7 | +// | ||
| 8 | + | ||
| 9 | +#import "VideoDetailPresent.h" | ||
| 10 | + | ||
| 11 | +@implementation VideoDetailPresent | ||
| 12 | + | ||
| 13 | +-(void)requestProgram:(NSString *)reportId | ||
| 14 | +{ | ||
| 15 | + if (![[Reachability reachabilityForInternetConnection] currentReachabilityStatus]) { | ||
| 16 | + [AlertViewTool showHUDViewText:CustomStr(@"NetworkiInterruption")]; | ||
| 17 | + return; | ||
| 18 | + } | ||
| 19 | + NSString *strUrl = @"http://app.phonemovie.cnlive.com/gxb/api/programDetail"; | ||
| 20 | + NSLog(@"%@",strUrl); | ||
| 21 | + NSString *categoryId = [NSString stringWithFormat:@"{\"plat\":\"i\",\"version\":\"5.0\",\"appid\":\"gxb\",\"type\":\"program\",\"id\":\"%@\"}",reportId]; | ||
| 22 | + NSLog(@"%@",categoryId); | ||
| 23 | + NSDictionary *parameters = @{@"params":categoryId}; | ||
| 24 | + AFHTTPSessionManager *manager = [AFHTTPSessionManager manager]; | ||
| 25 | + [manager POST:strUrl | ||
| 26 | + parameters:parameters headers:nil | ||
| 27 | + progress:^(NSProgress * _Nonnull uploadProgress) {} | ||
| 28 | + success:^(NSURLSessionDataTask * _Nonnull task, id _Nullable responseObject) { | ||
| 29 | + // 请求成功,解析数据 | ||
| 30 | + NSLog(@"%@", responseObject); | ||
| 31 | + NSDictionary *_dic = [NSDictionary dictionaryWithDictionary:responseObject]; | ||
| 32 | + if ([_dic[@"errorCode"] isEqualToString:@"0"]) { | ||
| 33 | + NSString *content = _dic[@"content"]; | ||
| 34 | + CNMessageSend(self.currentView, ProgramDelegate, programDetail:content); | ||
| 35 | + | ||
| 36 | + } else { | ||
| 37 | + [AlertViewTool showHUDViewText:_dic[@"errorMessage"]]; | ||
| 38 | + } | ||
| 39 | + } | ||
| 40 | + failure:^(NSURLSessionDataTask * _Nullable task, NSError * _Nonnull error) { | ||
| 41 | + // 请求失败 | ||
| 42 | + NSLog(@"%@", [error localizedDescription]); | ||
| 43 | + [SVProgressHUD dismiss]; | ||
| 44 | + [AlertViewTool showHUDAddedToView:AppKeyWindow text:CustomStr(@"ServerBusy")]; | ||
| 45 | + }]; | ||
| 46 | +} | ||
| 47 | +- (void)loadRelatedInformation:(NSString *)reportId { | ||
| 48 | + if (![[Reachability reachabilityForInternetConnection] currentReachabilityStatus]) { | ||
| 49 | + [AlertViewTool showHUDViewText:CustomStr(@"NetworkiInterruption")]; | ||
| 50 | + return; | ||
| 51 | + } | ||
| 52 | + NSString *strUrl = @"http://app.phonemovie.cnlive.com/gxb/api/programRelative"; | ||
| 53 | + NSLog(@"%@",strUrl); | ||
| 54 | + NSString *categoryId = [NSString stringWithFormat:@"{\"plat\":\"i\",\"version\":\"5.0\",\"appid\":\"gxb\",\"cmsContentId\":\"%@\"}",reportId]; | ||
| 55 | + NSLog(@"%@",categoryId); | ||
| 56 | + NSDictionary *parameters = @{@"params":categoryId}; | ||
| 57 | + AFHTTPSessionManager *manager = [AFHTTPSessionManager manager]; | ||
| 58 | + [manager POST:strUrl | ||
| 59 | + parameters:parameters headers:nil | ||
| 60 | + progress:^(NSProgress * _Nonnull uploadProgress) {} | ||
| 61 | + success:^(NSURLSessionDataTask * _Nonnull task, id _Nullable responseObject) { | ||
| 62 | + // 请求成功,解析数据 | ||
| 63 | + NSLog(@"%@", responseObject); | ||
| 64 | + NSDictionary *_dic = [NSDictionary dictionaryWithDictionary:responseObject]; | ||
| 65 | + if ([_dic[@"errorCode"] isEqualToString:@"0"]) { | ||
| 66 | + NSArray *array = _dic[@"programs"]; | ||
| 67 | + CNMessageSend(self.currentView, ProgramDelegate, reloadWithData:array); | ||
| 68 | + } else { | ||
| 69 | + [AlertViewTool showHUDViewText:_dic[@"errorMessage"]]; | ||
| 70 | + } | ||
| 71 | + } | ||
| 72 | + failure:^(NSURLSessionDataTask * _Nullable task, NSError * _Nonnull error) { | ||
| 73 | + // 请求失败 | ||
| 74 | + NSLog(@"%@", [error localizedDescription]); | ||
| 75 | + [SVProgressHUD dismiss]; | ||
| 76 | + [AlertViewTool showHUDAddedToView:AppKeyWindow text:CustomStr(@"ServerBusy")]; | ||
| 77 | + }]; | ||
| 78 | +} | ||
| 79 | +@end |
CNLiveScioLive/Pages/Newsound/OldController/VoiceViewController.m
| @@ -29,6 +29,8 @@ | @@ -29,6 +29,8 @@ | ||
| 29 | UIButton *shareBtn;//分享 | 29 | UIButton *shareBtn;//分享 |
| 30 | UIButton *favoriteBtn;//收藏 | 30 | UIButton *favoriteBtn;//收藏 |
| 31 | 31 | ||
| 32 | + UIImageView *reviewImage;//预览图片 | ||
| 33 | + | ||
| 32 | UIButton *playBackBtn;//15s | 34 | UIButton *playBackBtn;//15s |
| 33 | UIButton *playBtn;//播放 | 35 | UIButton *playBtn;//播放 |
| 34 | UIButton *playNextBtn;//下一首 | 36 | UIButton *playNextBtn;//下一首 |
| @@ -645,6 +647,17 @@ static const NSInteger margin = 34; | @@ -645,6 +647,17 @@ static const NSInteger margin = 34; | ||
| 645 | playProgress.backgroundColor = HEXCOLOR(0x1959C9); | 647 | playProgress.backgroundColor = HEXCOLOR(0x1959C9); |
| 646 | [self.view addSubview:playProgress]; | 648 | [self.view addSubview:playProgress]; |
| 647 | 649 | ||
| 650 | + reviewImage = [[UIImageView alloc] initWithFrame:CGRectMake(0, 0, 0, 0)]; | ||
| 651 | + reviewImage.backgroundColor = [UIColor whiteColor]; | ||
| 652 | + reviewImage.contentMode = UIViewContentModeScaleAspectFit; | ||
| 653 | + [self.view addSubview:reviewImage]; | ||
| 654 | + [reviewImage mas_makeConstraints:^(MASConstraintMaker *make) { | ||
| 655 | + make.left.equalTo(self->titleLabel.mas_left); | ||
| 656 | + make.right.equalTo(self->titleLabel.mas_right); | ||
| 657 | + make.top.equalTo(self->favoriteBtn.mas_bottom).with.offset(5); | ||
| 658 | + make.bottom.equalTo(self->playBtn.mas_top).with.offset(-5); | ||
| 659 | + }]; | ||
| 660 | + | ||
| 648 | } | 661 | } |
| 649 | //2个列表UI | 662 | //2个列表UI |
| 650 | - (void)createUI{ | 663 | - (void)createUI{ |
| @@ -847,6 +860,7 @@ static const NSInteger margin = 34; | @@ -847,6 +860,7 @@ static const NSInteger margin = 34; | ||
| 847 | } else { | 860 | } else { |
| 848 | sourceLabel.text = [NSString stringWithFormat:@"Source: %@",dic[@"author"]]; | 861 | sourceLabel.text = [NSString stringWithFormat:@"Source: %@",dic[@"author"]]; |
| 849 | } | 862 | } |
| 863 | + [reviewImage sd_setImageWithURL:dic[@"imgSmall"]]; | ||
| 850 | // 判断收藏按钮状态 | 864 | // 判断收藏按钮状态 |
| 851 | TableData *notice = [[TableData alloc] initWithJSONDictionary:_dictionary]; | 865 | TableData *notice = [[TableData alloc] initWithJSONDictionary:_dictionary]; |
| 852 | BOOL isIn = [[DBAction sharedDBAction] isInTable:[User_Defaults objectForKey:Language_Local] notice:notice]; | 866 | BOOL isIn = [[DBAction sharedDBAction] isInTable:[User_Defaults objectForKey:Language_Local] notice:notice]; |
CNLiveScioLive/Pages/Tools/DBAction/DBAction.m
| @@ -127,15 +127,15 @@ static DBAction *instance = nil; | @@ -127,15 +127,15 @@ static DBAction *instance = nil; | ||
| 127 | - (void)createTable:(NSString *)tableName{ | 127 | - (void)createTable:(NSString *)tableName{ |
| 128 | if ([db open]) { | 128 | if ([db open]) { |
| 129 | tableName = [tableName substringToIndex:2]; | 129 | tableName = [tableName substringToIndex:2]; |
| 130 | - NSString * sql = [NSString stringWithFormat:@"CREATE TABLE %@DATATABLE (cmsColumnName varchar, cmsColumnId varchar, cmsContentId int, createDate varchar, desc varchar, gxbArticleId int, gxbVideoId int, img varchar, pageUrl varchar, picType varchar, playType varchar, publishDate varchar, subTitle varchar, title varchar, type varchar, uploadVideoUrl varchar, videoUrl varchar, vipFlag int, uuid varchar)",tableName.uppercaseString]; | 130 | + NSString * sql = [NSString stringWithFormat:@"CREATE TABLE IF NOT EXISTS %@SDATATABLE (cmsColumnName varchar, cmsColumnId varchar, cmsContentId int, createDate varchar, desc varchar, gxbArticleId int, gxbVideoId int, img varchar,imgSmall varchar, pageUrl varchar, picType varchar, playType varchar, publishDate varchar, subTitle varchar, title varchar, type varchar, uploadVideoUrl varchar, videoUrl varchar, vipFlag int, uuid varchar,author varchar)",tableName.uppercaseString]; |
| 131 | BOOL res = [db executeUpdate:sql]; | 131 | BOOL res = [db executeUpdate:sql]; |
| 132 | if (!res) { | 132 | if (!res) { |
| 133 | NSLog(@"建表失败"); | 133 | NSLog(@"建表失败"); |
| 134 | 134 | ||
| 135 | - NSString *sql1 = [NSString stringWithFormat:@"ALTER TABLE %@DATATABLE ADD %@ VARCHAR",tableName,@"playType"]; | 135 | + NSString *sql1 = [NSString stringWithFormat:@"ALTER TABLE %@SDATATABLE ADD %@ VARCHAR",tableName,@"playType"]; |
| 136 | BOOL result1 = [db executeUpdate:sql1]; | 136 | BOOL result1 = [db executeUpdate:sql1]; |
| 137 | 137 | ||
| 138 | - NSString *sql2 = [NSString stringWithFormat:@"ALTER TABLE %@DATATABLE ADD %@ VARCHAR",tableName,@"uuid"]; | 138 | + NSString *sql2 = [NSString stringWithFormat:@"ALTER TABLE %@SDATATABLE ADD %@ VARCHAR",tableName,@"uuid"]; |
| 139 | BOOL result2 = [db executeUpdate:sql2]; | 139 | BOOL result2 = [db executeUpdate:sql2]; |
| 140 | 140 | ||
| 141 | } else { | 141 | } else { |
| @@ -150,7 +150,7 @@ static DBAction *instance = nil; | @@ -150,7 +150,7 @@ static DBAction *instance = nil; | ||
| 150 | - (BOOL)isInTable:(NSString *)tableName notice:(TableData*)notice{ | 150 | - (BOOL)isInTable:(NSString *)tableName notice:(TableData*)notice{ |
| 151 | if ([db open]) { | 151 | if ([db open]) { |
| 152 | tableName = [tableName substringToIndex:2]; | 152 | tableName = [tableName substringToIndex:2]; |
| 153 | - NSString * check = [NSString stringWithFormat:@"SELECT * FROM %@DATATABLE where cmsContentId = %d",tableName.uppercaseString,notice.cmsContentId]; | 153 | + NSString * check = [NSString stringWithFormat:@"SELECT * FROM %@SDATATABLE where cmsContentId = %d",tableName.uppercaseString,notice.cmsContentId]; |
| 154 | FMResultSet * re = [db executeQuery:check]; | 154 | FMResultSet * re = [db executeQuery:check]; |
| 155 | while ([re next]) { | 155 | while ([re next]) { |
| 156 | return YES; | 156 | return YES; |
| @@ -163,12 +163,12 @@ static DBAction *instance = nil; | @@ -163,12 +163,12 @@ static DBAction *instance = nil; | ||
| 163 | - (BOOL)insertTable:(NSString *)tableName notice:(TableData*)notice{ | 163 | - (BOOL)insertTable:(NSString *)tableName notice:(TableData*)notice{ |
| 164 | if ([db open]) { | 164 | if ([db open]) { |
| 165 | tableName = [tableName substringToIndex:2]; | 165 | tableName = [tableName substringToIndex:2]; |
| 166 | - NSString * check = [NSString stringWithFormat:@"SELECT * FROM %@DATATABLE where cmsContentId = %d",tableName.uppercaseString,notice.cmsContentId]; | 166 | + NSString * check = [NSString stringWithFormat:@"SELECT * FROM %@SDATATABLE where cmsContentId = %d",tableName.uppercaseString,notice.cmsContentId]; |
| 167 | FMResultSet * re = [db executeQuery:check]; | 167 | FMResultSet * re = [db executeQuery:check]; |
| 168 | if (![re next]) { | 168 | if (![re next]) { |
| 169 | NSString *desc = [notice.desc stringByReplacingOccurrencesOfString:@"'" withString:@"''"]; | 169 | NSString *desc = [notice.desc stringByReplacingOccurrencesOfString:@"'" withString:@"''"]; |
| 170 | NSString *title = [notice.title stringByReplacingOccurrencesOfString:@"'" withString:@"‘"]; | 170 | NSString *title = [notice.title stringByReplacingOccurrencesOfString:@"'" withString:@"‘"]; |
| 171 | - NSString * sql = [NSString stringWithFormat:@"INSERT INTO %@DATATABLE (cmsColumnName, cmsColumnId, cmsContentId, createDate, desc, gxbArticleId, gxbVideoId, img, pageUrl, picType, playType, publishDate, subTitle, title, type, uploadVideoUrl, videoUrl, vipFlag, uuid) values('%@','%@','%d', '%@','%@','%d','%d', '%@','%@','%@','%@','%@','%@','%@','%@','%@','%@','%d', '%@')",tableName.uppercaseString, notice.cmsColumnName, notice.cmsColumnId, notice.cmsContentId, notice.createDate, desc, notice.gxbArticleId, notice.gxbVideoId, notice.img, notice.pageUrl, notice.picType, notice.playType, notice.publishDate, notice.subTitle, title, notice.type, notice.uploadVideoUrl, notice.videoUrl, notice.vipFlag, notice.uuid?notice.uuid:@""]; | 171 | + NSString * sql = [NSString stringWithFormat:@"INSERT INTO %@SDATATABLE (cmsColumnName, cmsColumnId, cmsContentId, createDate, desc, gxbArticleId, gxbVideoId, img, imgSmall, pageUrl, picType, playType, publishDate, subTitle, title, type, uploadVideoUrl, videoUrl, vipFlag, uuid,author) values('%@','%@','%d', '%@','%@','%d','%d', '%@','%@','%@','%@','%@','%@','%@','%@','%@','%@','%@','%d', '%@','%@')",tableName.uppercaseString, notice.cmsColumnName, notice.cmsColumnId, notice.cmsContentId, notice.createDate, desc, notice.gxbArticleId, notice.gxbVideoId, notice.img, notice.imgSmall, notice.pageUrl, notice.picType, notice.playType, notice.publishDate, notice.subTitle, title, notice.type, notice.uploadVideoUrl, notice.videoUrl, notice.vipFlag, notice.uuid?notice.uuid:@"",notice.author]; |
| 172 | BOOL res = [db executeUpdate:sql]; | 172 | BOOL res = [db executeUpdate:sql]; |
| 173 | if (!res) { | 173 | if (!res) { |
| 174 | return NO; | 174 | return NO; |
| @@ -184,7 +184,7 @@ static DBAction *instance = nil; | @@ -184,7 +184,7 @@ static DBAction *instance = nil; | ||
| 184 | - (BOOL)deleteTable:(NSString *)tableName notice:(TableData*)notice{ | 184 | - (BOOL)deleteTable:(NSString *)tableName notice:(TableData*)notice{ |
| 185 | if ([db open]) { | 185 | if ([db open]) { |
| 186 | tableName = [tableName substringToIndex:2]; | 186 | tableName = [tableName substringToIndex:2]; |
| 187 | - NSString * sql = [NSString stringWithFormat:@"DELETE FROM %@DATATABLE where cmsContentId = %d",tableName.uppercaseString,notice.cmsContentId]; | 187 | + NSString * sql = [NSString stringWithFormat:@"DELETE FROM %@SDATATABLE where cmsContentId = %d",tableName.uppercaseString,notice.cmsContentId]; |
| 188 | BOOL res = [db executeUpdate:sql]; | 188 | BOOL res = [db executeUpdate:sql]; |
| 189 | if (!res) { | 189 | if (!res) { |
| 190 | return NO; | 190 | return NO; |
| @@ -200,7 +200,7 @@ static DBAction *instance = nil; | @@ -200,7 +200,7 @@ static DBAction *instance = nil; | ||
| 200 | NSMutableArray *list = [[NSMutableArray alloc] init]; | 200 | NSMutableArray *list = [[NSMutableArray alloc] init]; |
| 201 | if ([db open]) { | 201 | if ([db open]) { |
| 202 | tableName = [tableName substringToIndex:2]; | 202 | tableName = [tableName substringToIndex:2]; |
| 203 | - NSString *sql = [NSString stringWithFormat:@"SELECT * FROM %@DATATABLE",tableName.uppercaseString]; | 203 | + NSString *sql = [NSString stringWithFormat:@"SELECT * FROM %@SDATATABLE",tableName.uppercaseString]; |
| 204 | FMResultSet * rs = [db executeQuery:sql]; | 204 | FMResultSet * rs = [db executeQuery:sql]; |
| 205 | while ([rs next]) { | 205 | while ([rs next]) { |
| 206 | TableData * notice = [[TableData alloc] init]; | 206 | TableData * notice = [[TableData alloc] init]; |
| @@ -212,6 +212,7 @@ static DBAction *instance = nil; | @@ -212,6 +212,7 @@ static DBAction *instance = nil; | ||
| 212 | notice.gxbArticleId = [rs intForColumn:@"gxbArticleId"]; | 212 | notice.gxbArticleId = [rs intForColumn:@"gxbArticleId"]; |
| 213 | notice.gxbVideoId = [rs intForColumn:@"gxbVideoId"]; | 213 | notice.gxbVideoId = [rs intForColumn:@"gxbVideoId"]; |
| 214 | notice.img = [rs stringForColumn:@"img"]; | 214 | notice.img = [rs stringForColumn:@"img"]; |
| 215 | + notice.imgSmall = [rs stringForColumn:@"imgSmall"]; | ||
| 215 | notice.pageUrl = [rs stringForColumn:@"pageUrl"]; | 216 | notice.pageUrl = [rs stringForColumn:@"pageUrl"]; |
| 216 | notice.picType = [rs stringForColumn:@"picType"]; | 217 | notice.picType = [rs stringForColumn:@"picType"]; |
| 217 | notice.playType = [rs stringForColumn:@"playType"]; | 218 | notice.playType = [rs stringForColumn:@"playType"]; |
| @@ -224,6 +225,7 @@ static DBAction *instance = nil; | @@ -224,6 +225,7 @@ static DBAction *instance = nil; | ||
| 224 | notice.uploadVideoUrl= [rs stringForColumn:@"uploadVideoUrl"]; | 225 | notice.uploadVideoUrl= [rs stringForColumn:@"uploadVideoUrl"]; |
| 225 | notice.videoUrl = [rs stringForColumn:@"videoUrl"]; | 226 | notice.videoUrl = [rs stringForColumn:@"videoUrl"]; |
| 226 | notice.vipFlag = [rs intForColumn:@"vipFlag"]; | 227 | notice.vipFlag = [rs intForColumn:@"vipFlag"]; |
| 228 | + notice.author = [rs stringForColumn:@"author"]; | ||
| 227 | [list addObject:notice]; | 229 | [list addObject:notice]; |
| 228 | } | 230 | } |
| 229 | [db close]; | 231 | [db close]; |
CNLiveScioLive/Pages/Tools/DBAction/NoticeData.h
| @@ -24,6 +24,7 @@ | @@ -24,6 +24,7 @@ | ||
| 24 | @property(nonatomic, assign) int gxbArticleId; | 24 | @property(nonatomic, assign) int gxbArticleId; |
| 25 | @property(nonatomic, assign) int gxbVideoId; | 25 | @property(nonatomic, assign) int gxbVideoId; |
| 26 | @property(nonatomic, copy) NSString *img; | 26 | @property(nonatomic, copy) NSString *img; |
| 27 | +@property(nonatomic, copy) NSString *imgSmall; | ||
| 27 | @property(nonatomic, copy) NSString *pageUrl; | 28 | @property(nonatomic, copy) NSString *pageUrl; |
| 28 | @property(nonatomic, copy) NSString *picType; | 29 | @property(nonatomic, copy) NSString *picType; |
| 29 | @property(nonatomic, copy) NSString *playType; | 30 | @property(nonatomic, copy) NSString *playType; |
CNLiveScioLive/Pages/Tools/DBAction/NoticeData.m
| @@ -102,6 +102,11 @@ | @@ -102,6 +102,11 @@ | ||
| 102 | }else{ | 102 | }else{ |
| 103 | self.img = [jsonDic objectForKey:@"img"]; | 103 | self.img = [jsonDic objectForKey:@"img"]; |
| 104 | } | 104 | } |
| 105 | + if ([jsonDic objectForKey:@"imgSmall"] == [NSNull null]) { | ||
| 106 | + self.imgSmall = @""; | ||
| 107 | + }else{ | ||
| 108 | + self.imgSmall = [jsonDic objectForKey:@"imgSmall"]; | ||
| 109 | + } | ||
| 105 | if ([jsonDic objectForKey:@"pageUrl"] == [NSNull null]) { | 110 | if ([jsonDic objectForKey:@"pageUrl"] == [NSNull null]) { |
| 106 | self.pageUrl = @""; | 111 | self.pageUrl = @""; |
| 107 | }else{ | 112 | }else{ |
| @@ -167,11 +172,11 @@ | @@ -167,11 +172,11 @@ | ||
| 167 | self.uuid = [jsonDic objectForKey:@"uuid"]; | 172 | self.uuid = [jsonDic objectForKey:@"uuid"]; |
| 168 | } | 173 | } |
| 169 | 174 | ||
| 170 | -// if ([jsonDic objectForKey:@"author"] == [NSNull null]) { | ||
| 171 | -// self.author = @""; | ||
| 172 | -// }else{ | ||
| 173 | -// self.author = [jsonDic objectForKey:@"author"]; | ||
| 174 | -// } | 175 | + if ([jsonDic objectForKey:@"author"] == [NSNull null]) { |
| 176 | + self.author = @""; | ||
| 177 | + }else{ | ||
| 178 | + self.author = [jsonDic objectForKey:@"author"]; | ||
| 179 | + } | ||
| 175 | return self; | 180 | return self; |
| 176 | } | 181 | } |
| 177 | 182 | ||
| @@ -186,6 +191,7 @@ | @@ -186,6 +191,7 @@ | ||
| 186 | [dic setObject:[NSNumber numberWithInt:self.gxbArticleId] forKey:@"gxbArticleId"]; | 191 | [dic setObject:[NSNumber numberWithInt:self.gxbArticleId] forKey:@"gxbArticleId"]; |
| 187 | [dic setObject:[NSNumber numberWithInt:self.gxbVideoId] forKey:@"gxbVideoId"]; | 192 | [dic setObject:[NSNumber numberWithInt:self.gxbVideoId] forKey:@"gxbVideoId"]; |
| 188 | [dic setObject:self.img forKey:@"img"]; | 193 | [dic setObject:self.img forKey:@"img"]; |
| 194 | + [dic setObject:self.imgSmall forKey:@"imgSmall"]; | ||
| 189 | [dic setObject:self.pageUrl forKey:@"pageUrl"]; | 195 | [dic setObject:self.pageUrl forKey:@"pageUrl"]; |
| 190 | [dic setObject:self.picType forKey:@"picType"]; | 196 | [dic setObject:self.picType forKey:@"picType"]; |
| 191 | [dic setObject:self.playType?self.playType:@"" forKey:@"playType"]; | 197 | [dic setObject:self.playType?self.playType:@"" forKey:@"playType"]; |
| @@ -199,7 +205,7 @@ | @@ -199,7 +205,7 @@ | ||
| 199 | [dic setObject:self.uploadVideoUrl forKey:@"uploadVideoUrl"]; | 205 | [dic setObject:self.uploadVideoUrl forKey:@"uploadVideoUrl"]; |
| 200 | [dic setObject:self.videoUrl forKey:@"videoUrl"]; | 206 | [dic setObject:self.videoUrl forKey:@"videoUrl"]; |
| 201 | [dic setObject:[NSNumber numberWithInt:self.vipFlag] forKey:@"vipFlag"]; | 207 | [dic setObject:[NSNumber numberWithInt:self.vipFlag] forKey:@"vipFlag"]; |
| 202 | -// [dic setObject:self.author forKey:@"author"]; | 208 | + [dic setObject:self.author forKey:@"author"]; |
| 203 | return [NSDictionary dictionaryWithDictionary:dic]; | 209 | return [NSDictionary dictionaryWithDictionary:dic]; |
| 204 | } | 210 | } |
| 205 | @end | 211 | @end |
CNLiveScioLive/Pages/Tools/ZXVideoPlayer/Classes/ZXVideoPlayerController.m
No preview for this file type