diff --git a/.gitignore b/.gitignore
new file mode 100644
index 0000000..127a4b1
--- /dev/null
+++ b/.gitignore
@@ -0,0 +1,3 @@
+/JAVBus.xcworkspace/xcuserdata
+/JAVBus.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings
+/JAVBus.xcodeproj/xcshareddata
diff --git a/JAVBus.xcodeproj/xcuserdata/xiexiaolong1.xcuserdatad/xcschemes/xcschememanagement.plist b/JAVBus.xcodeproj/xcuserdata/xiexiaolong1.xcuserdatad/xcschemes/xcschememanagement.plist
index d0c0373..1fd2090 100644
--- a/JAVBus.xcodeproj/xcuserdata/xiexiaolong1.xcuserdatad/xcschemes/xcschememanagement.plist
+++ b/JAVBus.xcodeproj/xcuserdata/xiexiaolong1.xcuserdatad/xcschemes/xcschememanagement.plist
@@ -9,6 +9,29 @@
orderHint
16
+ JAVBus.xcscheme_^#shared#^_
+
+ orderHint
+ 16
+
+
+ SuppressBuildableAutocreation
+
+ EC0BC43D21C2394900A6E50E
+
+ primary
+
+
+ EC0BC45521C2394B00A6E50E
+
+ primary
+
+
+ EC0BC46021C2394B00A6E50E
+
+ primary
+
+
diff --git a/JAVBus/Actress/ActressModel.h b/JAVBus/Actress/ActressModel.h
index 16f1bb8..f50ba8e 100644
--- a/JAVBus/Actress/ActressModel.h
+++ b/JAVBus/Actress/ActressModel.h
@@ -12,7 +12,6 @@
@property (nonatomic, strong) NSString *name ;
@property (nonatomic, strong) NSString *avatarUrl ;
-@property (nonatomic, strong) NSString *link ;
@property (nonatomic, strong) NSString *birthday ;
@property (nonatomic, strong) NSString *age ;
diff --git a/JAVBus/BaseTools/BaseModel.h b/JAVBus/BaseTools/BaseModel.h
index 292f263..c812964 100644
--- a/JAVBus/BaseTools/BaseModel.h
+++ b/JAVBus/BaseTools/BaseModel.h
@@ -10,4 +10,6 @@
@interface BaseModel : NSObject
+@property (nonatomic, strong) NSString *link ;
+
@end
diff --git a/JAVBus/BaseTools/BaseModel.m b/JAVBus/BaseTools/BaseModel.m
index cc29545..9e9dab3 100644
--- a/JAVBus/BaseTools/BaseModel.m
+++ b/JAVBus/BaseTools/BaseModel.m
@@ -10,4 +10,20 @@
@implementation BaseModel
+@synthesize link = _link;
+
+- (NSString *)link {
+ if (!_link) {
+ _link = @"";
+ }
+ return _link;
+}
+
+- (void)setLink:(NSString *)link {
+ //替换某个字符
+ NSString *baseUrl = [GlobalTool shareInstance].baseUrl;
+ link = [link stringByReplacingOccurrencesOfString:baseUrl withString:@""];
+ _link = link;
+}
+
@end
diff --git a/JAVBus/BaseTools/BaseViewController.m b/JAVBus/BaseTools/BaseViewController.m
index ea39b05..588edeb 100644
--- a/JAVBus/BaseTools/BaseViewController.m
+++ b/JAVBus/BaseTools/BaseViewController.m
@@ -21,6 +21,9 @@ - (void)viewDidLoad {
self.automaticallyAdjustsScrollViewInsets = NO;
}
self.view.backgroundColor = [UIColor whiteColor];
+
+// self.view.height = self.view.height - kTabBarHeight;
+
}
- (void)didReceiveMemoryWarning {
diff --git a/JAVBus/BaseTools/GlobalTool.m b/JAVBus/BaseTools/GlobalTool.m
index d3b93af..b2d9181 100644
--- a/JAVBus/BaseTools/GlobalTool.m
+++ b/JAVBus/BaseTools/GlobalTool.m
@@ -38,7 +38,7 @@ - (void)setBaseUrl:(NSString *)baseUrl {
- (NSString *)baseUrl {
NSString *url = [[NSUserDefaults standardUserDefaults] objectForKey:@"kBaseUrl"];
if (!url || url.length == 0) {
- url = @"https://www.javbus.pw";
+ url = @"https://www.javbus.com";
}
return url;
}
diff --git a/JAVBus/BaseTools/HtmlToJsonManager.m b/JAVBus/BaseTools/HtmlToJsonManager.m
index 489afa1..0081a13 100644
--- a/JAVBus/BaseTools/HtmlToJsonManager.m
+++ b/JAVBus/BaseTools/HtmlToJsonManager.m
@@ -137,7 +137,12 @@ - (void)parseBaseActorList:(NSString *)url callback:(void (^)(NSArray *array))ca
NSString *imgUrl = [imgElement objectForKey:@"src"];
NSString *name = [imgElement objectForKey:@"title"];
NSString *link = [href objectForKey:@"href"];
- // NSLog(@"\n %@ \n %@ \n %@", imgUrl, name, link);
+
+// NSLog(@"\n %@ \n %@ \n %@", imgUrl, name, link);
+
+ //替换某个字符
+ NSString *baseUrl = [GlobalTool shareInstance].baseUrl;
+ link = [link stringByReplacingOccurrencesOfString:baseUrl withString:@""];
ActressModel *model = [ActressModel new];
model.avatarUrl = imgUrl;
@@ -448,7 +453,11 @@ - (void)parseMovieDetailByUrl:(NSString *)url callback:(void (^)(MovieDetailMode
TFHppleElement *e = [ele childrenWithTagName:@"a"].firstObject;
TitleLinkModel *model = [TitleLinkModel new];
model.title = e.text;
- model.link = [e objectForKey:@"href"];
+ NSString *link = [e objectForKey:@"href"];
+ //替换某个字符
+ NSString *baseUrl = [GlobalTool shareInstance].baseUrl;
+ link = [link stringByReplacingOccurrencesOfString:baseUrl withString:@""];
+ model.link = link;
model.type = LinkTypeActor;
[arr2 addObject:model];
NSLog(@"演员: %@", [e objectForKey:@"title"]);
diff --git a/JAVBus/Controller/ActorListBaseController.m b/JAVBus/Controller/ActorListBaseController.m
index dfbbfc8..ca24d90 100644
--- a/JAVBus/Controller/ActorListBaseController.m
+++ b/JAVBus/Controller/ActorListBaseController.m
@@ -104,7 +104,7 @@ - (void)collectionView:(UICollectionView *)collectionView didSelectItemAtIndexPa
ActressDetailController *vc = [[ActressDetailController alloc] init];
vc.model = model;
- vc.hidesBottomBarWhenPushed = YES;
+// vc.hidesBottomBarWhenPushed = YES;
vc.showSortBar = YES;
[self.navigationController pushViewController:vc animated:YES];
}
diff --git a/JAVBus/Controller/ActressSearchController.m b/JAVBus/Controller/ActressSearchController.m
index d1f1e0c..302ffe5 100644
--- a/JAVBus/Controller/ActressSearchController.m
+++ b/JAVBus/Controller/ActressSearchController.m
@@ -127,7 +127,7 @@ - (void)collectionView:(UICollectionView *)collectionView didSelectItemAtIndexPa
ActressDetailController *vc = [[ActressDetailController alloc] init];
vc.model = model;
- vc.hidesBottomBarWhenPushed = YES;
+// vc.hidesBottomBarWhenPushed = YES;
vc.showSortBar = YES;
[self.navigationController pushViewController:vc animated:YES];
}
diff --git a/JAVBus/Controller/CollectionViewController.m b/JAVBus/Controller/CollectionViewController.m
index 47856e5..e5caa7b 100644
--- a/JAVBus/Controller/CollectionViewController.m
+++ b/JAVBus/Controller/CollectionViewController.m
@@ -142,7 +142,7 @@ - (void)gotoForum {
NSString *url = [NSString stringWithFormat:@"%@/forum/forum.php", [GlobalTool shareInstance].baseUrl];
RxWebViewController* webViewController = [[RxWebViewController alloc] initWithUrl:[NSURL URLWithString:url]];
- webViewController.hidesBottomBarWhenPushed = YES;
+// webViewController.hidesBottomBarWhenPushed = YES;
[self.navigationController pushViewController:webViewController animated:YES];
/*
diff --git a/JAVBus/Controller/Model/CategoryModel.h b/JAVBus/Controller/Model/CategoryModel.h
index 92ec7c3..d010112 100644
--- a/JAVBus/Controller/Model/CategoryModel.h
+++ b/JAVBus/Controller/Model/CategoryModel.h
@@ -18,6 +18,5 @@
@interface CategoryItemModel : BaseModel
@property (nonatomic, strong) NSString *title ;
-@property (nonatomic, strong) NSString *link ;
@end
diff --git a/JAVBus/Controller/Model/RecommendModel.h b/JAVBus/Controller/Model/RecommendModel.h
index 2b2ea2d..d5b4920 100644
--- a/JAVBus/Controller/Model/RecommendModel.h
+++ b/JAVBus/Controller/Model/RecommendModel.h
@@ -12,6 +12,5 @@
@property (nonatomic, strong) NSString *title ;
@property (nonatomic, strong) NSString *imgUrl ;
-@property (nonatomic, strong) NSString *link ;
@end
diff --git a/JAVBus/Controller/Model/RecommendModel.m b/JAVBus/Controller/Model/RecommendModel.m
index 7bac5ec..bbc35d4 100644
--- a/JAVBus/Controller/Model/RecommendModel.m
+++ b/JAVBus/Controller/Model/RecommendModel.m
@@ -10,13 +10,6 @@
@implementation RecommendModel
-- (NSString *)link {
- if (!_link) {
- _link = @"";
- }
- return _link;
-}
-
- (NSString *)title {
if (!_title) {
_title = @"";
diff --git a/JAVBus/Controller/Model/TitleLinkModel.m b/JAVBus/Controller/Model/TitleLinkModel.m
index c55eb55..82fb582 100644
--- a/JAVBus/Controller/Model/TitleLinkModel.m
+++ b/JAVBus/Controller/Model/TitleLinkModel.m
@@ -10,13 +10,6 @@
@implementation TitleLinkModel
-- (NSString *)link {
- if (!_link) {
- _link = @"";
- }
- return _link;
-}
-
- (NSString *)title {
if (!_title) {
_title = @"";
diff --git a/JAVBus/Controller/MovieCachedController.m b/JAVBus/Controller/MovieCachedController.m
index 57a017f..1571bed 100644
--- a/JAVBus/Controller/MovieCachedController.m
+++ b/JAVBus/Controller/MovieCachedController.m
@@ -19,7 +19,10 @@ @implementation MovieCachedController
- (void)viewDidLoad {
[super viewDidLoad];
- // Do any additional setup after loading the view.
+
+ [self.collectionView mas_updateConstraints:^(MASConstraintMaker *make) {
+ make.left.bottom.right.mas_equalTo(0);
+ }];
}
- (void)didReceiveMemoryWarning {
diff --git a/JAVBus/Controller/MovieCategoryController.m b/JAVBus/Controller/MovieCategoryController.m
index 62d0680..6961e33 100644
--- a/JAVBus/Controller/MovieCategoryController.m
+++ b/JAVBus/Controller/MovieCategoryController.m
@@ -94,17 +94,17 @@ - (void)createViews {
LinkButton *button = [LinkButton buttonWithType:UIButtonTypeCustom];
[button addTarget:self action:@selector(linkBtnClicked:) forControlEvents:UIControlEventTouchUpInside];
[button setTitle:item.title forState:UIControlStateNormal];
- [button setTitleColor:[UIColor colorWithHexString:@"#555555"] forState:UIControlStateNormal];
+ [button setTitleColor:[UIColor colorWithHexString:@"#666666"] forState:UIControlStateNormal];
[button setTitleColor:[UIColor colorWithHexString:@"#aaaaaa"] forState:UIControlStateHighlighted];
button.model = item;
button.backgroundColor = [UIColor colorWithHexString:@"#1d65ee"];
- button.backgroundColor = [UIColor randomColorWithAlpha:0.2];
+ button.backgroundColor = [UIColor randomColorWithAlpha:0.3];
button.titleLabel.font = [UIFont systemFontOfSize:14];
[bgView addSubview:button];
[button sizeToFit];
- button.layer.cornerRadius = button.height/4;
+ button.layer.cornerRadius = button.height*0.382;
button.layer.masksToBounds = YES;
- button.layer.borderColor = [UIColor colorWithHexString:@"#aaaaaa"].CGColor;
+ button.layer.borderColor = [UIColor colorWithHexString:@"#eeeeee"].CGColor;
button.layer.borderWidth = 0.5;
button.width = button.width + 2*offset;
if (xPosition + offset + button.width > bgView.width - offset) {
@@ -137,7 +137,7 @@ - (void)linkBtnClicked:(LinkButton *)sender {
CategoryItemListController *vc = [CategoryItemListController new];
vc.model = itemModel;
vc.showSortBar = YES;
- vc.hidesBottomBarWhenPushed = YES;
+// vc.hidesBottomBarWhenPushed = YES;
[self.navigationController pushViewController:vc animated:YES];
}
diff --git a/JAVBus/Controller/MovieCollectionController.m b/JAVBus/Controller/MovieCollectionController.m
index d49dbca..8f5f989 100644
--- a/JAVBus/Controller/MovieCollectionController.m
+++ b/JAVBus/Controller/MovieCollectionController.m
@@ -16,7 +16,10 @@ @implementation MovieCollectionController
- (void)viewDidLoad {
[super viewDidLoad];
- // Do any additional setup after loading the view.
+
+ [self.collectionView mas_updateConstraints:^(MASConstraintMaker *make) {
+ make.left.bottom.right.mas_equalTo(0);
+ }];
}
- (void)didReceiveMemoryWarning {
diff --git a/JAVBus/Controller/MovieDetailController.m b/JAVBus/Controller/MovieDetailController.m
index d465016..6a327b8 100644
--- a/JAVBus/Controller/MovieDetailController.m
+++ b/JAVBus/Controller/MovieDetailController.m
@@ -104,7 +104,8 @@ - (void)createScrollView {
[scrollView mas_makeConstraints:^(MASConstraintMaker *make) {
make.top.mas_equalTo(kNavigationBarHeight);
- make.left.bottom.right.mas_equalTo(0);
+ make.left.right.mas_equalTo(0);
+ make.bottom.mas_equalTo(-kTabBarHeight);
}];
scrollView.canPullDown = YES;
diff --git a/JAVBus/Controller/MovieListBaseController.m b/JAVBus/Controller/MovieListBaseController.m
index c020381..3872d86 100644
--- a/JAVBus/Controller/MovieListBaseController.m
+++ b/JAVBus/Controller/MovieListBaseController.m
@@ -86,6 +86,7 @@ - (void)createCollectionView {
[collection mas_makeConstraints:^(MASConstraintMaker *make) {
make.top.mas_equalTo(topOffset);
make.left.bottom.right.mas_equalTo(0);
+ make.bottom.mas_equalTo(-kTabBarHeight);
}];
layout.headerReferenceSize = CGSizeMake(MainWidth, 30);
@@ -152,7 +153,7 @@ - (void)collectionView:(UICollectionView *)collectionView didSelectItemAtIndexPa
MovieListModel *model = self.dataArray[indexPath.row];
MovieDetailController *vc = [MovieDetailController new];
vc.model = model;
- vc.hidesBottomBarWhenPushed = YES;
+// vc.hidesBottomBarWhenPushed = YES;
[self.navigationController pushViewController:vc animated:YES];
}
diff --git a/JAVBus/Controller/MovieMainController.m b/JAVBus/Controller/MovieMainController.m
index b205452..24a08dd 100644
--- a/JAVBus/Controller/MovieMainController.m
+++ b/JAVBus/Controller/MovieMainController.m
@@ -38,4 +38,12 @@ - (void)requestData:(BOOL)refresh {
}
+- (void)viewDidLoad {
+ [super viewDidLoad];
+
+ [self.collectionView mas_updateConstraints:^(MASConstraintMaker *make) {
+ make.left.bottom.right.mas_equalTo(0);
+ }];
+}
+
@end
diff --git a/JAVBus/Controller/MovieSearchListController.m b/JAVBus/Controller/MovieSearchListController.m
index 045a000..60d4a89 100644
--- a/JAVBus/Controller/MovieSearchListController.m
+++ b/JAVBus/Controller/MovieSearchListController.m
@@ -16,7 +16,10 @@ @implementation MovieSearchListController
- (void)viewDidLoad {
[super viewDidLoad];
- // Do any additional setup after loading the view.
+
+ [self.collectionView mas_updateConstraints:^(MASConstraintMaker *make) {
+ make.left.bottom.right.mas_equalTo(0);
+ }];
}
- (void)didReceiveMemoryWarning {
diff --git a/JAVBus/Controller/MovieUncensoredController.m b/JAVBus/Controller/MovieUncensoredController.m
index 0c8cf87..eed1d4b 100644
--- a/JAVBus/Controller/MovieUncensoredController.m
+++ b/JAVBus/Controller/MovieUncensoredController.m
@@ -14,11 +14,6 @@ @interface MovieUncensoredController ()
@implementation MovieUncensoredController
-- (void)viewDidLoad {
- [super viewDidLoad];
- // Do any additional setup after loading the view.
-}
-
- (void)didReceiveMemoryWarning {
[super didReceiveMemoryWarning];
// Dispose of any resources that can be recreated.
@@ -52,4 +47,12 @@ - (void)requestData:(BOOL)refresh {
}
+- (void)viewDidLoad {
+ [super viewDidLoad];
+
+ [self.collectionView mas_updateConstraints:^(MASConstraintMaker *make) {
+ make.left.bottom.right.mas_equalTo(0);
+ }];
+}
+
@end
diff --git a/JAVBus/Controller/SearchViewController.m b/JAVBus/Controller/SearchViewController.m
index a77671a..b8dbd06 100644
--- a/JAVBus/Controller/SearchViewController.m
+++ b/JAVBus/Controller/SearchViewController.m
@@ -53,7 +53,16 @@ - (void)initViews {
- (void)createSearchView {
- UISearchBar *search = [[UISearchBar alloc] initWithFrame:CGRectMake(0, 0, MainWidth*0.8, 40)];
+ BOOL isChineseSimple = [[NSUserDefaults standardUserDefaults] boolForKey:@"kIsChineseSimple"];
+ NSString *title = @"繁体";
+ if (isChineseSimple) {
+ title = @"简体";
+ }
+
+ UIBarButtonItem *item = [[UIBarButtonItem alloc] initWithTitle:title style:UIBarButtonItemStylePlain target:self action:@selector(changeSearchTextEncode)];
+ self.navigationItem.leftBarButtonItem = item;
+
+ UISearchBar *search = [[UISearchBar alloc] initWithFrame:CGRectMake(0, 0, MainWidth*0.6, 40)];
search.barStyle = UIBarStyleDefault;
search.showsScopeBar = YES;
search.placeholder = @"搜尋 識別碼, 影片, 演員";
@@ -109,11 +118,31 @@ - (void)createCategoryView {
}
+- (void)changeSearchTextEncode {
+
+ BOOL value = [[NSUserDefaults standardUserDefaults] boolForKey:@"kIsChineseSimple"];
+ [[NSUserDefaults standardUserDefaults] setBool:!value forKey:@"kIsChineseSimple"];
+
+ NSString *title = @"繁体";
+ if (!value) {
+ title = @"简体";
+ }
+
+ self.navigationItem.leftBarButtonItem.title = title;
+
+}
+
- (void)addChildControllers {
NSMutableArray *array = [NSMutableArray array];
NSString *searchText = self.searchBar.text;
- searchText = [ZHChineseConvert convertSimplifiedToTraditional:searchText];
+ BOOL isChineseSimple = [[NSUserDefaults standardUserDefaults] boolForKey:@"kIsChineseSimple"];
+ if (!isChineseSimple) {
+ searchText = [ZHChineseConvert convertSimplifiedToTraditional:searchText];
+ }else{
+ searchText = [ZHChineseConvert convertTraditionalToSimplified:searchText];
+ }
+ self.searchBar.text = searchText;
for (int i = 0; i < self.categoryView.titles.count; i++) {
NSString *url ;
switch (i) {
diff --git a/JAVBus/Controller/SettingViewController.m b/JAVBus/Controller/SettingViewController.m
index fff8251..e4272b6 100644
--- a/JAVBus/Controller/SettingViewController.m
+++ b/JAVBus/Controller/SettingViewController.m
@@ -98,7 +98,7 @@ - (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath
if (indexPath.section == 1) {
AddressSettingController * vc = [AddressSettingController new];
- vc.hidesBottomBarWhenPushed = YES;
+// vc.hidesBottomBarWhenPushed = YES;
[self.navigationController pushViewController:vc animated:YES];
}
diff --git a/JAVBus/MainViewController.m b/JAVBus/MainViewController.m
index cfe4121..23e2d01 100644
--- a/JAVBus/MainViewController.m
+++ b/JAVBus/MainViewController.m
@@ -108,7 +108,7 @@ - (void)createCategoryView {
- (void)settingClicked {
AddressSettingController *vc = [AddressSettingController new];
- vc.hidesBottomBarWhenPushed = YES;
+// vc.hidesBottomBarWhenPushed = YES;
[self.navigationController pushViewController:vc animated:YES];
}
diff --git a/README.md b/README.md
index 4ce5b06..9318da3 100644
--- a/README.md
+++ b/README.md
@@ -1 +1 @@
-### AVBus-iOS客户端 (声明:数据来源[AVBus](https://www.javbus.pw/), 本app只做展示)
\ No newline at end of file
+### AVBus-iOS客户端 (声明:数据来源[AVBus](https://www.javbus.pw/), 本app只做展示)