小说绘上架版本
This commit is contained in:
+20
@@ -0,0 +1,20 @@
|
||||
//
|
||||
// TFBannerActionManager.h
|
||||
// TFReader
|
||||
//
|
||||
// Created by 谢腾飞 on 2020/12/11.
|
||||
// Copyright © 2020 xtfei_2011@126.com. All rights reserved.
|
||||
//
|
||||
|
||||
#import <Foundation/Foundation.h>
|
||||
#import <UIKit/UIKit.h>
|
||||
|
||||
NS_ASSUME_NONNULL_BEGIN
|
||||
|
||||
@interface TFBannerActionManager : NSObject
|
||||
|
||||
+ (TFBasicViewController *_Nullable)getBannerActionWithBannerModel:(TFBannerModel *)bannerModel productionType:(TFProductionType)type;
|
||||
|
||||
@end
|
||||
|
||||
NS_ASSUME_NONNULL_END
|
||||
+96
@@ -0,0 +1,96 @@
|
||||
//
|
||||
// TFBannerActionManager.m
|
||||
// TFReader
|
||||
//
|
||||
// Created by 谢腾飞 on 2020/12/11.
|
||||
// Copyright © 2020 xtfei_2011@126.com. All rights reserved.
|
||||
//
|
||||
|
||||
#import "TFBannerActionManager.h"
|
||||
#import "TFMemberViewController.h"
|
||||
#import "TFTaskViewController.h"
|
||||
#import "TFTaskViewController.h"
|
||||
#import "TFRechargeViewController.h"
|
||||
#import "WXYZ_FeedbackSubViewController.h"
|
||||
#import "TFSetViewController.h"
|
||||
#import "TFWebViewController.h"
|
||||
|
||||
@implementation TFBannerActionManager
|
||||
|
||||
+ (TFBasicViewController *_Nullable)getBannerActionWithBannerModel:(TFBannerModel *)bannerModel productionType:(TFProductionType)type
|
||||
{
|
||||
switch (bannerModel.action) {
|
||||
case 1:
|
||||
switch (type) {
|
||||
#if TF_Enable_Book
|
||||
case TFProductionTypeNovel: {
|
||||
TFNovelDetailViewController *novelDetail = [[TFNovelDetailViewController alloc] init];
|
||||
novelDetail.book_id = [bannerModel.content integerValue];
|
||||
|
||||
return novelDetail;
|
||||
}
|
||||
break;
|
||||
#endif
|
||||
|
||||
#if TF_Enable_Comic
|
||||
case TFProductionTypeComic: {
|
||||
TFComicDetailViewController *comicDetail = [[TFComicDetailViewController alloc] init];
|
||||
comicDetail.comic_id = [bannerModel.content integerValue];
|
||||
|
||||
return comicDetail;
|
||||
}
|
||||
break;
|
||||
#endif
|
||||
|
||||
#if TF_Enable_Audio
|
||||
case TFProductionTypeAudio: {
|
||||
TFAudioDetailViewController *audioDetail = [[TFAudioDetailViewController alloc] init];
|
||||
audioDetail.audio_id = [bannerModel.content integerValue];
|
||||
return audioDetail;
|
||||
}
|
||||
break;
|
||||
#endif
|
||||
default:
|
||||
break;
|
||||
}
|
||||
break;
|
||||
|
||||
case 2: {
|
||||
if ([bannerModel.content isEqualToString:@"vip"]) { // 会员中心
|
||||
return [[TFMemberViewController alloc] init];
|
||||
|
||||
} else if ([bannerModel.content isEqualToString:@"task"]) { // 任务
|
||||
return [[TFTaskViewController alloc] init];
|
||||
|
||||
} else if ([bannerModel.content isEqualToString:@"sign"]) { // 签到
|
||||
return [[TFTaskViewController alloc] init];
|
||||
|
||||
} else if ([bannerModel.content isEqualToString:@"recharge"]) { // 金币充值
|
||||
return [[TFRechargeViewController alloc] init];
|
||||
|
||||
} else if ([bannerModel.content isEqualToString:@"feedback"]) { // 意见反馈
|
||||
return [[WXYZ_FeedbackSubViewController alloc] init];
|
||||
|
||||
} else if ([bannerModel.content isEqualToString:@"setting"]) { // 设置
|
||||
return [[TFSetViewController alloc] init];
|
||||
}
|
||||
}
|
||||
break;
|
||||
|
||||
case 3: {
|
||||
TFWebViewController *vc = [[TFWebViewController alloc] init];
|
||||
vc.URLString = bannerModel.content;
|
||||
return vc;
|
||||
}
|
||||
break;
|
||||
|
||||
case 4:
|
||||
[[UIApplication sharedApplication] openURL:[NSURL URLWithString:bannerModel.content] options:@{} completionHandler:nil];
|
||||
break;
|
||||
|
||||
default:
|
||||
break;
|
||||
}
|
||||
return nil;
|
||||
}
|
||||
@end
|
||||
Reference in New Issue
Block a user