Skip to content

Commit

Permalink
更换布局1.1.0
Browse files Browse the repository at this point in the history
  • Loading branch information
mgfjx committed Aug 10, 2019
1 parent 68cb02e commit 80ec50f
Show file tree
Hide file tree
Showing 27 changed files with 133 additions and 43 deletions.
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
/JAVBus.xcworkspace/xcuserdata
/JAVBus.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings
/JAVBus.xcodeproj/xcshareddata
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,29 @@
<key>orderHint</key>
<integer>16</integer>
</dict>
<key>JAVBus.xcscheme_^#shared#^_</key>
<dict>
<key>orderHint</key>
<integer>16</integer>
</dict>
</dict>
<key>SuppressBuildableAutocreation</key>
<dict>
<key>EC0BC43D21C2394900A6E50E</key>
<dict>
<key>primary</key>
<true/>
</dict>
<key>EC0BC45521C2394B00A6E50E</key>
<dict>
<key>primary</key>
<true/>
</dict>
<key>EC0BC46021C2394B00A6E50E</key>
<dict>
<key>primary</key>
<true/>
</dict>
</dict>
</dict>
</plist>
1 change: 0 additions & 1 deletion JAVBus/Actress/ActressModel.h
Original file line number Diff line number Diff line change
Expand Up @@ -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 ;
Expand Down
2 changes: 2 additions & 0 deletions JAVBus/BaseTools/BaseModel.h
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,6 @@

@interface BaseModel : NSObject

@property (nonatomic, strong) NSString *link ;

@end
16 changes: 16 additions & 0 deletions JAVBus/BaseTools/BaseModel.m
Original file line number Diff line number Diff line change
Expand Up @@ -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
3 changes: 3 additions & 0 deletions JAVBus/BaseTools/BaseViewController.m
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,9 @@ - (void)viewDidLoad {
self.automaticallyAdjustsScrollViewInsets = NO;
}
self.view.backgroundColor = [UIColor whiteColor];

// self.view.height = self.view.height - kTabBarHeight;

}

- (void)didReceiveMemoryWarning {
Expand Down
2 changes: 1 addition & 1 deletion JAVBus/BaseTools/GlobalTool.m
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down
13 changes: 11 additions & 2 deletions JAVBus/BaseTools/HtmlToJsonManager.m
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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"]);
Expand Down
2 changes: 1 addition & 1 deletion JAVBus/Controller/ActorListBaseController.m
Original file line number Diff line number Diff line change
Expand Up @@ -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];
}
Expand Down
2 changes: 1 addition & 1 deletion JAVBus/Controller/ActressSearchController.m
Original file line number Diff line number Diff line change
Expand Up @@ -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];
}
Expand Down
2 changes: 1 addition & 1 deletion JAVBus/Controller/CollectionViewController.m
Original file line number Diff line number Diff line change
Expand Up @@ -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];

/*
Expand Down
1 change: 0 additions & 1 deletion JAVBus/Controller/Model/CategoryModel.h
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,5 @@
@interface CategoryItemModel : BaseModel

@property (nonatomic, strong) NSString *title ;
@property (nonatomic, strong) NSString *link ;

@end
1 change: 0 additions & 1 deletion JAVBus/Controller/Model/RecommendModel.h
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,5 @@

@property (nonatomic, strong) NSString *title ;
@property (nonatomic, strong) NSString *imgUrl ;
@property (nonatomic, strong) NSString *link ;

@end
7 changes: 0 additions & 7 deletions JAVBus/Controller/Model/RecommendModel.m
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,6 @@

@implementation RecommendModel

- (NSString *)link {
if (!_link) {
_link = @"";
}
return _link;
}

- (NSString *)title {
if (!_title) {
_title = @"";
Expand Down
7 changes: 0 additions & 7 deletions JAVBus/Controller/Model/TitleLinkModel.m
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,6 @@

@implementation TitleLinkModel

- (NSString *)link {
if (!_link) {
_link = @"";
}
return _link;
}

- (NSString *)title {
if (!_title) {
_title = @"";
Expand Down
5 changes: 4 additions & 1 deletion JAVBus/Controller/MovieCachedController.m
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
10 changes: 5 additions & 5 deletions JAVBus/Controller/MovieCategoryController.m
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down Expand Up @@ -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];
}

Expand Down
5 changes: 4 additions & 1 deletion JAVBus/Controller/MovieCollectionController.m
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
3 changes: 2 additions & 1 deletion JAVBus/Controller/MovieDetailController.m
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
3 changes: 2 additions & 1 deletion JAVBus/Controller/MovieListBaseController.m
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down Expand Up @@ -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];
}

Expand Down
8 changes: 8 additions & 0 deletions JAVBus/Controller/MovieMainController.m
Original file line number Diff line number Diff line change
Expand Up @@ -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
5 changes: 4 additions & 1 deletion JAVBus/Controller/MovieSearchListController.m
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
13 changes: 8 additions & 5 deletions JAVBus/Controller/MovieUncensoredController.m
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down Expand Up @@ -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
33 changes: 31 additions & 2 deletions JAVBus/Controller/SearchViewController.m
Original file line number Diff line number Diff line change
Expand Up @@ -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 = @"搜尋 識別碼, 影片, 演員";
Expand Down Expand Up @@ -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) {
Expand Down
2 changes: 1 addition & 1 deletion JAVBus/Controller/SettingViewController.m
Original file line number Diff line number Diff line change
Expand Up @@ -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];

}
Expand Down
2 changes: 1 addition & 1 deletion JAVBus/MainViewController.m
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ - (void)createCategoryView {

- (void)settingClicked {
AddressSettingController *vc = [AddressSettingController new];
vc.hidesBottomBarWhenPushed = YES;
// vc.hidesBottomBarWhenPushed = YES;
[self.navigationController pushViewController:vc animated:YES];
}

Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1 +1 @@
### AVBus-iOS客户端 (声明:数据来源[AVBus](https://www.javbus.pw/), 本app只做展示)
### AVBus-iOS客户端 (声明:数据来源[AVBus](https://www.javbus.pw/), 本app只做展示)

0 comments on commit 80ec50f

Please sign in to comment.