Commit ac4bdd2c by 刘卓鑫

bug修复代码

parent 4aec0d14
...@@ -28,7 +28,7 @@ ...@@ -28,7 +28,7 @@
ignoreCount = "0" ignoreCount = "0"
continueAfterRunningActions = "No" continueAfterRunningActions = "No"
filePath = "ColorfulSchool/Classes/CustomViews(自定义)/UIView+NineLayoutView.m" filePath = "ColorfulSchool/Classes/CustomViews(自定义)/UIView+NineLayoutView.m"
timestampString = "586861564.565377" timestampString = "587284767.389748"
startingColumnNumber = "9223372036854775807" startingColumnNumber = "9223372036854775807"
endingColumnNumber = "9223372036854775807" endingColumnNumber = "9223372036854775807"
startingLineNumber = "235" startingLineNumber = "235"
...@@ -37,5 +37,53 @@ ...@@ -37,5 +37,53 @@
landmarkType = "7"> landmarkType = "7">
</BreakpointContent> </BreakpointContent>
</BreakpointProxy> </BreakpointProxy>
<BreakpointProxy
BreakpointExtensionID = "Xcode.Breakpoint.FileBreakpoint">
<BreakpointContent
shouldBeEnabled = "Yes"
ignoreCount = "0"
continueAfterRunningActions = "No"
filePath = "ColorfulSchool/Classes/Login(&#x767b;&#x5f55;&#x6ce8;&#x518c;)/Register/Controller/ZXRegistorViewController.m"
timestampString = "586864596.901405"
startingColumnNumber = "9223372036854775807"
endingColumnNumber = "9223372036854775807"
startingLineNumber = "663"
endingLineNumber = "663"
landmarkName = "-OKAction:"
landmarkType = "7">
<Locations>
<Location
shouldBeEnabled = "Yes"
ignoreCount = "0"
continueAfterRunningActions = "No"
symbolName = "__37-[ZXRegistorViewController OKAction:]_block_invoke"
moduleName = "ColorfulSchool"
usesParentBreakpointCondition = "Yes"
urlString = "file:///Users/liuzhuoxin/codeStore/colorfulSchoolReconsitution/ColorfulSchool/ColorfulSchool/Classes/Login(%E7%99%BB%E5%BD%95%E6%B3%A8%E5%86%8C)/Register/Controller/ZXRegistorViewController.m"
timestampString = "587355366.1314549"
startingColumnNumber = "9223372036854775807"
endingColumnNumber = "9223372036854775807"
startingLineNumber = "663"
endingLineNumber = "663"
offsetFromSymbolStart = "96">
</Location>
<Location
shouldBeEnabled = "Yes"
ignoreCount = "0"
continueAfterRunningActions = "No"
symbolName = "__37-[ZXRegistorViewController OKAction:]_block_invoke_2"
moduleName = "ColorfulSchool"
usesParentBreakpointCondition = "Yes"
urlString = "file:///Users/liuzhuoxin/codeStore/colorfulSchoolReconsitution/ColorfulSchool/ColorfulSchool/Classes/Login(%E7%99%BB%E5%BD%95%E6%B3%A8%E5%86%8C)/Register/Controller/ZXRegistorViewController.m"
timestampString = "587355366.13421"
startingColumnNumber = "9223372036854775807"
endingColumnNumber = "9223372036854775807"
startingLineNumber = "663"
endingLineNumber = "663"
offsetFromSymbolStart = "32">
</Location>
</Locations>
</BreakpointContent>
</BreakpointProxy>
</Breakpoints> </Breakpoints>
</Bucket> </Bucket>
...@@ -197,7 +197,8 @@ ...@@ -197,7 +197,8 @@
[cache clearMemory]; [cache clearMemory];
} }
- (void)applicationWillResignActive:(UIApplication *)application { - (void)applicationWillResignActive:(UIApplication *)application {
if ([[ZXTool getCurrentVC] isKindOfClass:NSClassFromString(@"ZXSelfHelpViewController")]) { UIViewController *vc = [ZXTool getCurrentVC];
if ([vc isKindOfClass:NSClassFromString(@"ZXSelfHelpViewController")] || [vc isKindOfClass:NSClassFromString(@"UseCouponsView")] || [vc isKindOfClass:NSClassFromString(@"H5UseCouponsView")]) {
NSString *isNeedLight = [kUserDefaults objectForKey:@"isNeedLight"]; NSString *isNeedLight = [kUserDefaults objectForKey:@"isNeedLight"];
if (isNeedLight && [isNeedLight isEqualToString:@"yes"]) { if (isNeedLight && [isNeedLight isEqualToString:@"yes"]) {
CGFloat bre = [[kUserDefaults objectForKey:@"brightness"] floatValue]; CGFloat bre = [[kUserDefaults objectForKey:@"brightness"] floatValue];
...@@ -249,7 +250,7 @@ ...@@ -249,7 +250,7 @@
if ([vc isKindOfClass:NSClassFromString(@"ZXSelfHelpViewController")] || [vc isKindOfClass:NSClassFromString(@"ZXDrinkViewController")] || [vc isKindOfClass:NSClassFromString(@"ZXBathViewController")]) { if ([vc isKindOfClass:NSClassFromString(@"ZXSelfHelpViewController")] || [vc isKindOfClass:NSClassFromString(@"ZXDrinkViewController")] || [vc isKindOfClass:NSClassFromString(@"ZXBathViewController")]) {
[[NSNotificationCenter defaultCenter] postNotificationName:kSelf_help_start_timer object:nil]; [[NSNotificationCenter defaultCenter] postNotificationName:kSelf_help_start_timer object:nil];
} }
if ([vc isKindOfClass:NSClassFromString(@"ZXSelfHelpViewController")]) { if ([vc isKindOfClass:NSClassFromString(@"ZXSelfHelpViewController")] || [vc isKindOfClass:NSClassFromString(@"UseCouponsView")] || [vc isKindOfClass:NSClassFromString(@"H5UseCouponsView")]) {
NSString *isNeedLight = [kUserDefaults objectForKey:@"isNeedLight"]; NSString *isNeedLight = [kUserDefaults objectForKey:@"isNeedLight"];
if (isNeedLight && [isNeedLight isEqualToString:@"yes"]) { if (isNeedLight && [isNeedLight isEqualToString:@"yes"]) {
[[UIScreen mainScreen] setBrightness:1];//点亮 [[UIScreen mainScreen] setBrightness:1];//点亮
......
...@@ -60,6 +60,7 @@ ...@@ -60,6 +60,7 @@
dispatch_async(dispatch_get_main_queue(), ^{ dispatch_async(dispatch_get_main_queue(), ^{
[self.myTableView.mj_header endRefreshing]; [self.myTableView.mj_header endRefreshing];
[ZXTool hideLoadingAnimation]; [ZXTool hideLoadingAnimation];
if (isNeedReloadData) { if (isNeedReloadData) {
[self.myTableView reloadData]; [self.myTableView reloadData];
} }
......
...@@ -6,11 +6,11 @@ ...@@ -6,11 +6,11 @@
// Copyright © 2019 Colorful Any Door. All rights reserved. // Copyright © 2019 Colorful Any Door. All rights reserved.
// //
#import "ZXHomePageSupverViewController.h" #import <UIKit/UIKit.h>
NS_ASSUME_NONNULL_BEGIN NS_ASSUME_NONNULL_BEGIN
@interface ZXHomePageFeedBackViewController : ZXHomePageSupverViewController @interface ZXHomePageFeedBackViewController : UIViewController
@end @end
......
...@@ -24,43 +24,51 @@ ...@@ -24,43 +24,51 @@
@property (nonatomic, copy) NSString *lastId; @property (nonatomic, copy) NSString *lastId;
//当前页码 //当前页码
@property (nonatomic, assign) NSInteger pageNum; @property (nonatomic, assign) NSInteger pageNum;
@property (nonatomic, strong) UIImageView *footer;
@end @end
@implementation ZXHomePageFeedBackViewController @implementation ZXHomePageFeedBackViewController
- (void)viewDidLoad { - (void)viewDidLoad {
[super viewDidLoad]; [super viewDidLoad];
self.view.backgroundColor = [UIColor whiteColor];
self.titleStr = @"意见反馈"; self.title = @"意见反馈";
self.lastId = @""; self.lastId = @"";
self.pageNum = 1; self.pageNum = 1;
[self.contentView addSubview:self.myTableView]; [self.view addSubview:self.myTableView];
[self createMessageInput];
[self.myTableView mas_makeConstraints:^(MASConstraintMaker *make) { [self.myTableView mas_makeConstraints:^(MASConstraintMaker *make) {
make.left.right.top.equalTo(self.contentView); make.left.right.top.equalTo(self.view);
make.bottom.equalTo(self.contentView.mas_bottom).offset(-75 * k6Scale); make.bottom.equalTo(self.footer.mas_top);
}]; }];
[self createMessageInput];
[self loadNewData]; [self loadNewData];
} }
-(void)viewWillAppear:(BOOL)animated {
[super viewWillAppear:animated];
self.navigationController.navigationBar.hidden = NO;
}
//- (void)viewDidAppear:(BOOL)animated {
// NSIndexPath *indexPath = [NSIndexPath indexPathForRow:([self.myTableView numberOfRowsInSection:0]-1) inSection:0];
// [self.myTableView scrollToRowAtIndexPath:indexPath atScrollPosition:UITableViewScrollPositionBottom animated:NO];
//}
#pragma mark - ========== 聊天输入框 ========== #pragma mark - ========== 聊天输入框 ==========
- (void) createMessageInput { - (void) createMessageInput {
UIImageView *footer = [[UIImageView alloc] init]; self.footer = [[UIImageView alloc] init];
[self.contentView addSubview:footer]; [self.view addSubview:self.footer];
footer.userInteractionEnabled = YES; self.footer.userInteractionEnabled = YES;
footer.image = [UIImage imageNamed:@"bg_shurukuang"]; self.footer.image = [UIImage imageNamed:@"bg_shurukuang"];
[footer mas_makeConstraints:^(MASConstraintMaker *make) { [self.footer mas_makeConstraints:^(MASConstraintMaker *make) {
make.left.right.equalTo(self.view ); make.left.right.equalTo(self.view );
make.bottom.equalTo(self.view.mas_bottom); make.bottom.equalTo(self.view.mas_bottom);
}]; }];
UIView *content = [[UIView alloc] init]; UIView *content = [[UIView alloc] init];
[footer addSubview:content]; [self.footer addSubview:content];
[content mas_makeConstraints:^(MASConstraintMaker *make) { [content mas_makeConstraints:^(MASConstraintMaker *make) {
make.edges.equalTo(footer).insets(UIEdgeInsetsMake(15 * k6Scale, 15 * k6Scale, 15 * k6Scale, 15 * k6Scale)); make.edges.equalTo(self.footer).insets(UIEdgeInsetsMake(15 * k6Scale, 15 * k6Scale, 15 * k6Scale, 15 * k6Scale));
}]; }];
self.field = [[ZXTextView alloc] init]; self.field = [[ZXTextView alloc] init];
...@@ -199,38 +207,38 @@ ...@@ -199,38 +207,38 @@
return model.cellH; return model.cellH;
} }
- (UIView *) tableView:(UITableView *)tableView viewForHeaderInSection:(NSInteger)section { //- (UIView *) tableView:(UITableView *)tableView viewForHeaderInSection:(NSInteger)section {
UIView *header = [[UIView alloc] initWithFrame:CGRectMake(0, 0, kScreenWidth, 40 * k6Scale)]; // UIView *header = [[UIView alloc] initWithFrame:CGRectMake(0, 0, kScreenWidth, 40 * k6Scale)];
header.backgroundColor = [UIColor whiteColor]; // header.backgroundColor = [UIColor whiteColor];
//
UIView *holder = [[UIView alloc] init]; // UIView *holder = [[UIView alloc] init];
holder.backgroundColor = [UIColor colorWithHexString:@"#f93d3d"]; // holder.backgroundColor = [UIColor colorWithHexString:@"#f93d3d"];
holder.layer.cornerRadius = 16 * k6Scale; // holder.layer.cornerRadius = 16 * k6Scale;
holder.clipsToBounds = YES; // holder.clipsToBounds = YES;
[header addSubview:holder]; // [header addSubview:holder];
[holder mas_makeConstraints:^(MASConstraintMaker *make) { // [holder mas_makeConstraints:^(MASConstraintMaker *make) {
make.centerX.equalTo(header); // make.centerX.equalTo(header);
make.centerY.equalTo(header); // make.centerY.equalTo(header);
}]; // }];
UILabel *la = [[UILabel alloc] init]; // UILabel *la = [[UILabel alloc] init];
la.text = @"每天可反馈三条信息"; // la.text = @"每天可反馈三条信息";
la.backgroundColor = [UIColor colorWithHexString:@"#f93d3d"]; // la.backgroundColor = [UIColor colorWithHexString:@"#f93d3d"];
la.textColor = [UIColor whiteColor]; // la.textColor = [UIColor whiteColor];
la.font = kFontSize(13 * k6Scale); // la.font = kFontSize(13 * k6Scale);
[holder addSubview:la]; // [holder addSubview:la];
[la mas_makeConstraints:^(MASConstraintMaker *make) { // [la mas_makeConstraints:^(MASConstraintMaker *make) {
make.edges.equalTo(holder).insets(UIEdgeInsetsMake(5 * k6Scale, 10 * k6Scale, 5 * k6Scale, 10 * k6Scale)); // make.edges.equalTo(holder).insets(UIEdgeInsetsMake(5 * k6Scale, 10 * k6Scale, 5 * k6Scale, 10 * k6Scale));
make.height.mas_equalTo(22 * k6Scale); // make.height.mas_equalTo(22 * k6Scale);
}]; // }];
//
return header; // return header;
} //}
//
- (CGFloat) tableView:(UITableView *)tableView heightForHeaderInSection:(NSInteger)section { //- (CGFloat) tableView:(UITableView *)tableView heightForHeaderInSection:(NSInteger)section {
//
return 40 * k6Scale; // return 40 * k6Scale;
} //}
//
#pragma mark - ========== 发送按钮点击 ========== #pragma mark - ========== 发送按钮点击 ==========
-(BOOL)textView:(UITextView *)textView shouldChangeTextInRange:(NSRange)range replacementText:(NSString *)text{ -(BOOL)textView:(UITextView *)textView shouldChangeTextInRange:(NSRange)range replacementText:(NSString *)text{
...@@ -276,6 +284,8 @@ ...@@ -276,6 +284,8 @@
[ZXTool hideLoadingAnimation]; [ZXTool hideLoadingAnimation];
[self.dataSource addObject:model]; [self.dataSource addObject:model];
[self.myTableView reloadData]; [self.myTableView reloadData];
NSIndexPath *indexPath = [NSIndexPath indexPathForRow:([self.myTableView numberOfRowsInSection:0]-1) inSection:0];
[self.myTableView scrollToRowAtIndexPath:indexPath atScrollPosition:UITableViewScrollPositionBottom animated:NO];
}); });
} }
}); });
......
...@@ -41,7 +41,7 @@ ...@@ -41,7 +41,7 @@
[super viewDidLoad]; [super viewDidLoad];
// Do any additional setup after loading the view. // Do any additional setup after loading the view.
// //
[self createUI]; [self createUI];
} }
...@@ -50,13 +50,12 @@ ...@@ -50,13 +50,12 @@
[super viewWillAppear:animated]; [super viewWillAppear:animated];
self.navigationController.navigationBar.hidden = YES; self.navigationController.navigationBar.hidden = YES;
self.tabBarController.tabBar.hidden = NO; self.tabBarController.tabBar.hidden = NO;
[UIApplication sharedApplication].statusBarStyle = 0; [UIApplication sharedApplication].statusBarStyle = 1;
self.userNameLabel.text = [kUserDefaults objectForKey:@"username"]; self.userNameLabel.text = [kUserDefaults objectForKey:@"username"];
} }
- (void)viewWillDisappear:(BOOL)animated { - (void)viewWillDisappear:(BOOL)animated {
[super viewWillDisappear:animated]; [super viewWillDisappear:animated];
[UIApplication sharedApplication].statusBarStyle = 1;
} }
#pragma mark - 创建界面 #pragma mark - 创建界面
...@@ -68,14 +67,14 @@ ...@@ -68,14 +67,14 @@
} }
UIImageView *topImageView = [[UIImageView alloc] initWithFrame:CGRectMake(0, 0, kScreenWidth, 190 * k6Scale + margin)]; UIImageView *topImageView = [[UIImageView alloc] initWithFrame:CGRectMake(0, 0, kScreenWidth, 190 * k6Scale + margin)];
topImageView.userInteractionEnabled = YES; topImageView.userInteractionEnabled = YES;
topImageView.image = [UIImage imageNamed:@"bg_wode1"]; topImageView.image = [UIImage imageNamed:@"bg_wode"];
[self.view addSubview:topImageView]; [self.view addSubview:topImageView];
UITapGestureRecognizer *userCenter = [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(jumpUserCenter)]; UITapGestureRecognizer *userCenter = [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(jumpUserCenter)];
[topImageView addGestureRecognizer:userCenter]; [topImageView addGestureRecognizer:userCenter];
self.userNameLabel = [[UILabel alloc] init]; self.userNameLabel = [[UILabel alloc] init];
[topImageView addSubview:self.userNameLabel]; [topImageView addSubview:self.userNameLabel];
self.userNameLabel.font = [UIFont boldSystemFontOfSize:24 * k6Scale]; self.userNameLabel.font = [UIFont boldSystemFontOfSize:24 * k6Scale];
self.userNameLabel.textColor = [UIColor colorWithHexString:@"#333333"]; self.userNameLabel.textColor = [UIColor whiteColor];
[self.userNameLabel mas_makeConstraints:^(MASConstraintMaker *make) { [self.userNameLabel mas_makeConstraints:^(MASConstraintMaker *make) {
make.left.equalTo(topImageView.mas_left).offset(40 * k6Scale); make.left.equalTo(topImageView.mas_left).offset(40 * k6Scale);
make.top.equalTo(topImageView.mas_top).offset(kTopHeight); make.top.equalTo(topImageView.mas_top).offset(kTopHeight);
...@@ -93,7 +92,7 @@ ...@@ -93,7 +92,7 @@
self.telLabel = [[UILabel alloc] init]; self.telLabel = [[UILabel alloc] init];
[topImageView addSubview:self.telLabel]; [topImageView addSubview:self.telLabel];
self.telLabel.font = kFontSize(12 * k6Scale); self.telLabel.font = kFontSize(12 * k6Scale);
self.telLabel.textColor = [UIColor colorWithHexString:@"#888888"]; self.telLabel.textColor = [UIColor whiteColor];
[self.telLabel mas_makeConstraints:^(MASConstraintMaker *make) { [self.telLabel mas_makeConstraints:^(MASConstraintMaker *make) {
make.left.equalTo(topImageView.mas_left).offset(40 * k6Scale); make.left.equalTo(topImageView.mas_left).offset(40 * k6Scale);
make.top.equalTo(self.userNameLabel.mas_bottom).offset(4 * k6Scale); make.top.equalTo(self.userNameLabel.mas_bottom).offset(4 * k6Scale);
...@@ -102,7 +101,7 @@ ...@@ -102,7 +101,7 @@
self.campusLabel = [[UILabel alloc] init]; self.campusLabel = [[UILabel alloc] init];
[topImageView addSubview:self.campusLabel]; [topImageView addSubview:self.campusLabel];
self.campusLabel.font = kFontSize(12 * k6Scale); self.campusLabel.font = kFontSize(12 * k6Scale);
self.campusLabel.textColor = [UIColor colorWithHexString:@"#888888"]; self.campusLabel.textColor = [UIColor whiteColor];
[self.campusLabel mas_makeConstraints:^(MASConstraintMaker *make) { [self.campusLabel mas_makeConstraints:^(MASConstraintMaker *make) {
make.left.equalTo(topImageView.mas_left).offset(40 * k6Scale); make.left.equalTo(topImageView.mas_left).offset(40 * k6Scale);
make.top.equalTo(self.telLabel.mas_bottom).offset(4 * k6Scale); make.top.equalTo(self.telLabel.mas_bottom).offset(4 * k6Scale);
...@@ -135,30 +134,30 @@ ...@@ -135,30 +134,30 @@
bottomMargin = 83; bottomMargin = 83;
} }
// UITableView *scroll = [[UITableView alloc] init]; // UITableView *scroll = [[UITableView alloc] init];
// [self.view addSubview:scroll]; // [self.view addSubview:scroll];
// scroll.separatorStyle = UITableViewCellSeparatorStyleNone; // scroll.separatorStyle = UITableViewCellSeparatorStyleNone;
// [scroll mas_makeConstraints:^(MASConstraintMaker *make) { // [scroll mas_makeConstraints:^(MASConstraintMaker *make) {
// make.left.right.equalTo(self.view); // make.left.right.equalTo(self.view);
// make.top.equalTo(topImageView.mas_bottom); // make.top.equalTo(topImageView.mas_bottom);
// make.bottom.equalTo(self.view.mas_bottom).offset(-bottomMargin); // make.bottom.equalTo(self.view.mas_bottom).offset(-bottomMargin);
// }]; // }];
UIView *gridView = [[UIView alloc] init]; UIView *gridView = [[UIView alloc] init];
// scroll.tableHeaderView = gridView; // scroll.tableHeaderView = gridView;
[self.view addSubview:gridView]; [self.view addSubview:gridView];
[gridView mas_makeConstraints:^(MASConstraintMaker *make) { [gridView mas_makeConstraints:^(MASConstraintMaker *make) {
make.left.right.equalTo(self.view); make.left.right.equalTo(self.view);
make.top.equalTo(topImageView.mas_bottom); make.top.equalTo(topImageView.mas_bottom);
make.bottom.equalTo(self.view.mas_bottom).offset(-bottomMargin); make.bottom.equalTo(self.view.mas_bottom).offset(-bottomMargin);
}]; }];
NSArray *datas = @[@{@"title":@"多彩手册", @"index":@(0)}, @{@"title":@"意见反馈", @"index":@(1)},@{@"title":@"个人设置", @"index":@(2)},@{@"title":@"关于多彩", @"index":@(3)}]; NSArray *datas = @[@{@"title":@"校园生活卡", @"index":@(0), @"image":@"ic_xiaoyuanka"}, @{@"title":@"意见反馈", @"index":@(1), @"image":@"ic_fankui"},@{@"title":@"个人设置", @"index":@(2), @"image":@"ic_setting"},@{@"title":@"关于多彩", @"index":@(3), @"image":@"ic_duocai"}];
if ([UserManager sharedUserManager].user) { if ([UserManager sharedUserManager].user) {
datas = @[@{@"title":@"多彩手册", @"index":@(0)},@{@"title":@"我的订单", @"index":@(1)},@{@"title":@"意见反馈", @"index":@(2)},@{@"title":@"个人设置", @"index":@(3)},@{@"title":@"关于多彩", @"index":@(4)}]; datas = @[@{@"title":@"校园生活卡", @"index":@(0), @"image":@"ic_xiaoyuanka"},@{@"title":@"我的订单", @"index":@(1),@"image":@"ic_dingdan"},@{@"title":@"意见反馈", @"index":@(2), @"image":@"ic_fankui"},@{@"title":@"个人设置", @"index":@(3),@"image":@"ic_setting"},@{@"title":@"关于多彩", @"index":@(4),@"image":@"ic_duocai"}];
} }
gridView.delegate = self; gridView.delegate = self;
[gridView newHomeMePageGrid_itemWithCellWidth:kScreenWidth / 3.0f cellHeight:110 * k6Scale numPerRow:3 totalNum:datas.count viewPadding:0 viewPaddingCell:0 titles:datas]; [gridView newHomeMePageGrid_itemWithCellWidth:kScreenWidth / 3.0f cellHeight:110 * k6Scale numPerRow:3 totalNum:datas.count viewPadding:0 viewPaddingCell:0 titles:datas];
...@@ -238,26 +237,21 @@ ...@@ -238,26 +237,21 @@
} }
- (void)imageReshaperController:(AliImageReshapeController *)reshaper didFinishPickingMediaWithInfo:(UIImage *)image { - (void)imageReshaperController:(AliImageReshapeController *)reshaper didFinishPickingMediaWithInfo:(UIImage *)image {
NSData *data = UIImageJPEGRepresentation(image, 0.3); NSData *data = UIImageJPEGRepresentation(image, 0.3);
AFHTTPSessionManager *session = [AFHTTPSessionManager manager];
[XMCenter sendRequest:^(XMRequest *request) { [session.requestSerializer setValue:@"multipart/form-data" forHTTPHeaderField:@"Content-Type"];
NSString *url = [NSString stringWithFormat:@"%@/app/customer/headpic/upload", [kUserDefaults valueForKey:@"NEW_PAY"]]; [session.requestSerializer setValue:CacheToken forHTTPHeaderField:@"token"];
request.server = url; [session.requestSerializer setValue:@"app" forHTTPHeaderField:@"reqSource"];
request.requestType = kXMRequestUpload; [session.requestSerializer setValue:[ZXTool returnNormalHTTPHeaderJson] forHTTPHeaderField:@"clientSource"];
request.HttpBody = [[ZXTool dictionaryToJson:@{@"customerId":[kUserDefaults valueForKey:@"userId"]}] mj_JSONData];
request.headers = @{@"token": CacheToken,@"reqSource":@"app", @"Content-Type":@"multipart/form-data", @"clientSource":[ZXTool returnNormalHTTPHeaderJson]}; [session POST:[NSString stringWithFormat:@"%@/app/customer/headpic/upload?customerId=%@", [kUserDefaults valueForKey:@"NEW_PAY"], CacheUserId] parameters:@{@"customerId":[kUserDefaults valueForKey:@"userId"], @"token":CacheToken} constructingBodyWithBlock:^(id<AFMultipartFormData> _Nonnull formData) {
[request addFormDataWithName:@"temp.jpeg" fileName:@"file.jpeg" mimeType:@"image/jpeg" fileData:data]; [formData appendPartWithFileData:data name:@"file" fileName:@"temp.jpeg" mimeType:@"multipart/form-data"];
} onProgress:^(NSProgress *progress) { } success:^(NSURLSessionDataTask * _Nonnull task, id _Nonnull responseObject) {
// the progress block is running on the session queue.
if (progress) {
NSLog(@"onProgress: %f", progress.fractionCompleted);
}
} onSuccess:^(id responseObject) {
if ([responseObject[@"code"] integerValue] == 1000) { if ([responseObject[@"code"] integerValue] == 1000) {
dispatch_async(dispatch_get_main_queue(), ^{ dispatch_async(dispatch_get_main_queue(), ^{
[self.iconButton setBackgroundImage:image forState:UIControlStateNormal];; [self.iconButton setBackgroundImage:image forState:UIControlStateNormal];;
}); });
[UserManager sharedUserManager].user.customerHead = responseObject[@"data"][@"headPic"]; [UserManager sharedUserManager].user.customerHead = responseObject[@"data"][@"headPic"];
ZXUserModel *user = [ZXUserModel findAll].lastObject; ZXUserModel *user = [ZXUserModel findAll].lastObject;
...@@ -272,13 +266,10 @@ ...@@ -272,13 +266,10 @@
dispatch_async(dispatch_get_main_queue(), ^{ dispatch_async(dispatch_get_main_queue(), ^{
[self.navigationController popViewControllerAnimated:YES]; [self.navigationController popViewControllerAnimated:YES];
}); });
NSLog(@"onSuccess: %@", responseObject); } failure:^(NSURLSessionDataTask * _Nullable task, NSError * _Nonnull error) {
} onFailure:^(NSError *error) {
dispatch_async(dispatch_get_main_queue(), ^{ dispatch_async(dispatch_get_main_queue(), ^{
[ZXTool showText:error.userInfo[@"NSLocalizedDescription"]]; [ZXTool showText:error.userInfo[@"NSLocalizedDescription"]];
}); });
} onFinished:^(id responseObject, NSError *error) {
NSLog(@"onFinished");
}]; }];
} }
...@@ -369,12 +360,13 @@ ...@@ -369,12 +360,13 @@
[ZXTool checkCurrentUserModeCompleted:^(BOOL isOld) { [ZXTool checkCurrentUserModeCompleted:^(BOOL isOld) {
@strongify(self); @strongify(self);
dispatch_async(dispatch_get_main_queue(), ^{ dispatch_async(dispatch_get_main_queue(), ^{
if (isOld == NO) { if (isOld) {
UIViewController * VC=[[NSClassFromString(@"ZXHomePageFeedBackViewController") alloc] init];
FeedBackView * VC=[FeedBackView new];
VC.hidesBottomBarWhenPushed=YES; VC.hidesBottomBarWhenPushed=YES;
[self.navigationController pushViewController:VC animated:YES]; [self.navigationController pushViewController:VC animated:YES];
} else { } else {
FeedBackView * VC=[FeedBackView new]; UIViewController * VC=[[NSClassFromString(@"ZXHomePageFeedBackViewController") alloc] init];
VC.hidesBottomBarWhenPushed=YES; VC.hidesBottomBarWhenPushed=YES;
[self.navigationController pushViewController:VC animated:YES]; [self.navigationController pushViewController:VC animated:YES];
} }
......
...@@ -48,6 +48,9 @@ ...@@ -48,6 +48,9 @@
/** 是否已经显示过普通公告提醒 */ /** 是否已经显示过普通公告提醒 */
@property (nonatomic, assign) BOOL isShowNormalAnnouce; @property (nonatomic, assign) BOOL isShowNormalAnnouce;
/** 是否已经显示过首充提醒 */
@property (nonatomic, assign) BOOL isShowFirstRecharge;
@end @end
@implementation ZXHomePageViewController @implementation ZXHomePageViewController
...@@ -65,7 +68,7 @@ static NSInteger seq = 0; ...@@ -65,7 +68,7 @@ static NSInteger seq = 0;
[self createUserHeader]; [self createUserHeader];
//直接加载最新数据 //直接加载最新数据
[self loadNewData]; [self loadNewData];
//每次启动获取一次用户信息 //每次启动获取一次用户信息
[ZXTool fetchUserInfoCompleted:^(BOOL isOld) { [ZXTool fetchUserInfoCompleted:^(BOOL isOld) {
...@@ -74,7 +77,21 @@ static NSInteger seq = 0; ...@@ -74,7 +77,21 @@ static NSInteger seq = 0;
/*强更*/ /*强更*/
[self udateAppVersion]; [self udateAppVersion];
//切换头像的通知
[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(changeIconAction) name:@"changeIconNotification" object:nil]; [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(changeIconAction) name:@"changeIconNotification" object:nil];
//完成支付的通知
[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(payCompleted) name:kOrder_Completed_Pay object:nil];
}
- (void)viewWillLayoutSubviews {
[super viewWillLayoutSubviews];
self.tabBarController.tabBar.hidden = NO;
self.navigationController.navigationBar.hidden = YES;
[UIApplication sharedApplication].statusBarHidden = NO;
}
#pragma mark - 收到支付完成的通知
- (void) payCompleted {
self.naHeader.pub.hidden = YES;
} }
#pragma mark - 收到修改头像的通知 #pragma mark - 收到修改头像的通知
- (void) changeIconAction { - (void) changeIconAction {
...@@ -94,20 +111,27 @@ static NSInteger seq = 0; ...@@ -94,20 +111,27 @@ static NSInteger seq = 0;
self.tabBarController.tabBar.hidden = NO; self.tabBarController.tabBar.hidden = NO;
self.navigationController.navigationBar.hidden = YES; self.navigationController.navigationBar.hidden = YES;
[UIApplication sharedApplication].statusBarHidden = NO; [UIApplication sharedApplication].statusBarHidden = NO;
[UIApplication sharedApplication].statusBarStyle = 1;
if ([[kUserDefaults valueForKey:@"isUploadLog"] integerValue]) { //查看待支付订单和未读普通公告
NSArray *list = [ExpecptionModel findByCriteria:[NSString stringWithFormat:@"where uploadStatus <> 1"]]; [self createNotPayAndAnnouceView];
if (list.count>10) { if (self.isShowFirstRecharge) {
[ExpecptionModel clearTable]; self.isShowFirstRecharge = NO;
} else {
[self fetchFirstChargeConfig];
if ([[kUserDefaults valueForKey:@"isUploadLog"] integerValue]) {
NSArray *list = [ExpecptionModel findByCriteria:[NSString stringWithFormat:@"where uploadStatus <> 1"]];
if (list.count>10) {
[ExpecptionModel clearTable];
} else {
dispatch_async(dispatch_get_global_queue(0, 0), ^{
[self uploadExpectionWithList:list];
});
}
} else { } else {
dispatch_async(dispatch_get_global_queue(0, 0), ^{ [ExpecptionModel clearTable];
[self uploadExpectionWithList:list];
});
} }
} else {
[ExpecptionModel clearTable];
} }
[self fetchFirstChargeConfig];
} }
- (UITableView *)myTableView { - (UITableView *)myTableView {
...@@ -157,30 +181,9 @@ static NSInteger seq = 0; ...@@ -157,30 +181,9 @@ static NSInteger seq = 0;
[self showPublishWithItem:publish]; [self showPublishWithItem:publish];
}); });
}]; }];
//待支付订单view //待支付订单和普通公共提示view
[self.service loadNotPayOrderCompleted:^(BOOL isNeedReloadData) { [self createNotPayAndAnnouceView];
@strongify(self);
if (isNeedReloadData) {
ZXNotPay *order = [ZXNotPay findAll].lastObject;
dispatch_async(dispatch_get_main_queue(), ^{
self.naHeader.order = order;
});
} else {
if (self.isShowNormalAnnouce == NO) {//只显示一次
// -- 拉取最新的普通公告
[self.service loadLatestNewNormalAnnounceCompleted:^(ZXHomePageAnnouce * _Nullable publish) {
@strongify(self);
self.isShowNormalAnnouce = YES;
//显示
dispatch_async(dispatch_get_main_queue(), ^{
self.naHeader.annouce = publish;
});
}];
}
}
}];
} }
#pragma mark - ========== 显示公告 ========== #pragma mark - ========== 显示公告 ==========
...@@ -514,10 +517,14 @@ static NSInteger seq = 0; ...@@ -514,10 +517,14 @@ static NSInteger seq = 0;
} }
#pragma mark - 首冲 #pragma mark - 首冲
- (void) fetchFirstChargeConfig { - (void) fetchFirstChargeConfig {
if (self.isShowFirstRecharge) {
return;
}
self.isShowFirstRecharge = YES;
if ([CacherechargeStatus isKindOfClass:[NSString class]] && [CacherechargeStatus isEqualToString:@"1"]) { if ([CacherechargeStatus isKindOfClass:[NSString class]] && [CacherechargeStatus isEqualToString:@"1"]) {
return; return;
} }
@weakify(self); @weakify(self);
[ZXTool fetchUserInfoCompleted:^(BOOL isOld) { [ZXTool fetchUserInfoCompleted:^(BOOL isOld) {
@strongify(self); @strongify(self);
...@@ -530,21 +537,23 @@ static NSInteger seq = 0; ...@@ -530,21 +537,23 @@ static NSInteger seq = 0;
NSDictionary * dic=responseObject; NSDictionary * dic=responseObject;
if ([dic[@"code"] isEqualToString:@"0"]) { if ([dic[@"code"] isEqualToString:@"0"]) {
[self showFirstRechargeAlertByMsg:dic[@"data"][@"rechargeNotice"]]; dispatch_async(dispatch_get_main_queue(), ^{
[self showFirstRechargeAlertByMsg:dic[@"data"][@"rechargeNotice"]];
});
} }
} failure:^(AFHTTPRequestOperation *operation, NSError *error) { } failure:^(AFHTTPRequestOperation *operation, NSError *error) {
}]; }];
} }
}); });
} else { } else {
if ([CacherechargeStatus isEqualToString:@"1"]) {
return ;
}
[ZXTool requestDataHideLoadingToastWithType:kXMHTTPMethodGET url:[NSString stringWithFormat:@"%@/dcxy/api/paymentAndActiveConf/getFirstRechargeConfContent?areaId=%@", [kUserDefaults objectForKey:@"SX_MONEY"], CacheCampusId] para:nil completed:^(CommonModel *common, NSString *error) { [ZXTool requestDataHideLoadingToastWithType:kXMHTTPMethodGET url:[NSString stringWithFormat:@"%@/dcxy/api/paymentAndActiveConf/getFirstRechargeConfContent?areaId=%@", [kUserDefaults objectForKey:@"SX_MONEY"], CacheCampusId] para:nil completed:^(CommonModel *common, NSString *error) {
@strongify(self); @strongify(self);
if (error == nil) { dispatch_async(dispatch_get_main_queue(), ^{
[self showFirstRechargeAlertByMsg:common.data]; if (error == nil) {
} [self showFirstRechargeAlertByMsg:common.data];
}
});
}]; }];
} }
}]; }];
...@@ -554,9 +563,11 @@ static NSInteger seq = 0; ...@@ -554,9 +563,11 @@ static NSInteger seq = 0;
if (msg == nil || [msg isEqualToString:@""]) { if (msg == nil || [msg isEqualToString:@""]) {
return; return;
} }
@weakify(self); @weakify(self);
ZXHomePaeFirstRecahrgeView *firstRechargeView = [[ZXHomePaeFirstRecahrgeView alloc] initWithFirstRechargeDesc:msg rightAction:^{ ZXHomePaeFirstRecahrgeView *firstRechargeView = [[ZXHomePaeFirstRecahrgeView alloc] initWithFirstRechargeDesc:msg rightAction:^{
@strongify(self); @strongify(self);
self.isShowFirstRecharge = NO;
AimiWalletViewController * view = [[AimiWalletViewController alloc]init]; AimiWalletViewController * view = [[AimiWalletViewController alloc]init];
view.hidesBottomBarWhenPushed = YES; view.hidesBottomBarWhenPushed = YES;
view.comeFrom=@"firstTopUp"; view.comeFrom=@"firstTopUp";
...@@ -565,7 +576,31 @@ static NSInteger seq = 0; ...@@ -565,7 +576,31 @@ static NSInteger seq = 0;
firstRechargeView.frame = [UIScreen mainScreen].bounds; firstRechargeView.frame = [UIScreen mainScreen].bounds;
[self.tabBarController.view addSubview:firstRechargeView]; [self.tabBarController.view addSubview:firstRechargeView];
} }
- (void) createNotPayAndAnnouceView {
//待支付订单view
@weakify(self);
[self.service loadNotPayOrderCompleted:^(BOOL isNeedReloadData) {
@strongify(self);
if (isNeedReloadData) {
ZXNotPay *order = [ZXNotPay findAll].lastObject;
dispatch_async(dispatch_get_main_queue(), ^{
self.naHeader.order = order;
});
} else {
if (self.isShowNormalAnnouce == NO) {//只显示一次
// -- 拉取最新的普通公告
[self.service loadLatestNewNormalAnnounceCompleted:^(ZXHomePageAnnouce * _Nullable publish) {
@strongify(self);
self.isShowNormalAnnouce = YES;
//显示
dispatch_async(dispatch_get_main_queue(), ^{
self.naHeader.annouce = publish;
});
}];
}
}
}];
}
- (void) createScrollToTopBtn { - (void) createScrollToTopBtn {
if (self.goTop) { if (self.goTop) {
return; return;
......
...@@ -30,13 +30,16 @@ ...@@ -30,13 +30,16 @@
}); });
} }
if (self.htmlStr) { if (self.htmlStr) {
NSString *str = [NSString stringWithFormat:@"<html><header><meta name='viewport' content='width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0'></header><body>%@</body></html>", self.htmlStr]; NSString *str = [self getHtmlData:self.htmlStr];
[self.webView loadHTMLString:str baseURL:nil]; [self.webView loadHTMLString:str baseURL:nil];
} }
} }
-(NSString *) getHtmlData:(NSString *)bodyHTML {
NSString *head = [NSString stringWithFormat:@"<html>%@%@%@%@<body>%@ </body></html>", @"<head>", @"<meta name=\"viewport\" content=\"width=device-width, initial-scale=1.0, user-scalable=no\"> ", @"<style>body{word-wrap:break-word;font-family:Arial}img{max-width: 100%; width:auto; height:auto;}</style>", @"</head>", bodyHTML];
return head;
}
- (WKWebView *)webView { - (WKWebView *)webView {
if (!_webView) { if (!_webView) {
_webView = [[WKWebView alloc] init]; _webView = [[WKWebView alloc] init];
......
...@@ -65,6 +65,8 @@ NS_ASSUME_NONNULL_BEGIN ...@@ -65,6 +65,8 @@ NS_ASSUME_NONNULL_BEGIN
/** 来源平台 1腾讯 02百度 03瑞狮 04友盟 05多彩 06京东联盟 */ /** 来源平台 1腾讯 02百度 03瑞狮 04友盟 05多彩 06京东联盟 */
@property (nonatomic, copy) NSString *source; @property (nonatomic, copy) NSString *source;
@property (nonatomic, copy) NSString *sourceName;
/** 同步信息 */ /** 同步信息 */
@property (nonatomic, copy) NSString *synchWay; @property (nonatomic, copy) NSString *synchWay;
......
...@@ -44,7 +44,7 @@ ...@@ -44,7 +44,7 @@
} }
}]; }];
self.contentLabel = [[UILabel alloc] init]; self.contentLabel = [[UILabel alloc] init];
self.contentLabel.font = [UIFont boldSystemFontOfSize:16 * k6Scale]; self.contentLabel.font = [UIFont boldSystemFontOfSize:15 * k6Scale];
self.contentLabel.textColor = [UIColor colorWithHexString:@"#333333"]; self.contentLabel.textColor = [UIColor colorWithHexString:@"#333333"];
[self.contentView addSubview:self.contentLabel]; [self.contentView addSubview:self.contentLabel];
...@@ -65,29 +65,35 @@ ...@@ -65,29 +65,35 @@
[self.contentView addSubview:self.fromLabel]; [self.contentView addSubview:self.fromLabel];
[self.contentLabel mas_makeConstraints:^(MASConstraintMaker *make) {
make.left.equalTo(self.contentView.mas_left).offset(20 * k6Scale);
make.top.equalTo(self.contentView.mas_top).offset(10 * k6Scale);
make.right.equalTo(self.contentView.mas_right).offset(-20 * k6Scale);
}];
[self.imagesView mas_makeConstraints:^(MASConstraintMaker *make) { [self.imagesView mas_makeConstraints:^(MASConstraintMaker *make) {
make.left.equalTo(self.contentLabel.mas_left); make.left.equalTo(self.contentLabel.mas_left);
make.right.equalTo(self.contentLabel.mas_right); make.right.equalTo(self.contentLabel.mas_right);
make.top.equalTo(self.contentLabel.mas_bottom).offset(10 * k6Scale); make.top.equalTo(self.contentView.mas_top).offset(10 * k6Scale);
make.height.mas_equalTo(90 * k6Scale); make.height.mas_equalTo(90 * k6Scale);
}]; }];
[self.contentLabel mas_makeConstraints:^(MASConstraintMaker *make) {
make.left.equalTo(self.contentView.mas_left).offset(20 * k6Scale);
make.top.equalTo(self.imagesView.mas_bottom).offset(10 * k6Scale);
make.right.equalTo(self.contentView.mas_right).offset(-20 * k6Scale);
}];
[self.noteCountLabel mas_makeConstraints:^(MASConstraintMaker *make) { [self.noteCountLabel mas_makeConstraints:^(MASConstraintMaker *make) {
make.left.equalTo(self.contentLabel); make.left.equalTo(self.contentLabel);
make.top.equalTo(self.imagesView.mas_bottom).offset(10 * k6Scale); make.right.lessThanOrEqualTo(self.contentLabel.mas_right);
make.top.equalTo(self.contentLabel.mas_bottom).offset(10 * k6Scale);
}]; }];
[self.fromLabel mas_makeConstraints:^(MASConstraintMaker *make) { [self.fromLabel mas_makeConstraints:^(MASConstraintMaker *make) {
make.left.equalTo(self.noteCountLabel.mas_right).offset(20 * k6Scale); make.left.equalTo(self.noteCountLabel.mas_right).offset(10 * k6Scale);
make.top.equalTo(self.imagesView.mas_bottom).offset(10 * k6Scale); make.right.equalTo(self.contentLabel.mas_right);
make.centerY.equalTo(self.noteCountLabel.mas_centerY);
}]; }];
[self.noteCountLabel setContentCompressionResistancePriority:UILayoutPriorityRequired
forAxis:UILayoutConstraintAxisHorizontal];
UIView *line = [[UIView alloc] init]; UIView *line = [[UIView alloc] init];
line.backgroundColor = RGB(243, 243, 243); line.backgroundColor = RGB(243, 243, 243);
[self.contentView addSubview:line]; [self.contentView addSubview:line];
...@@ -107,6 +113,6 @@ ...@@ -107,6 +113,6 @@
self.imagesView.imageNameList = [_info.itemImgs componentsSeparatedByString:@","]; self.imagesView.imageNameList = [_info.itemImgs componentsSeparatedByString:@","];
self.contentLabel.text = _info.itemTitle; self.contentLabel.text = _info.itemTitle;
self.fromLabel.text = _info.itemCreateAt; self.fromLabel.text = _info.itemCreateAt;
self.noteCountLabel.text = [NSString stringWithFormat:@"来源: %@", _info.source];; self.noteCountLabel.text = [NSString stringWithFormat:@"来源: %@", _info.sourceName];;
} }
@end @end
...@@ -51,7 +51,7 @@ ...@@ -51,7 +51,7 @@
self.contentImageView = [[UIImageView alloc] init]; self.contentImageView = [[UIImageView alloc] init];
self.titleLabel = [[UILabel alloc] init]; self.titleLabel = [[UILabel alloc] init];
self.titleLabel.font = [UIFont boldSystemFontOfSize:16 * k6Scale];; self.titleLabel.font = [UIFont boldSystemFontOfSize:15 * k6Scale];
self.titleLabel.textColor = [UIColor colorWithHexString:@"#333333"]; self.titleLabel.textColor = [UIColor colorWithHexString:@"#333333"];
self.titleLabel.numberOfLines = 0; self.titleLabel.numberOfLines = 0;
...@@ -80,6 +80,8 @@ ...@@ -80,6 +80,8 @@
make.bottom.equalTo(self.contentView.mas_bottom); make.bottom.equalTo(self.contentView.mas_bottom);
make.height.mas_equalTo(1); make.height.mas_equalTo(1);
}]; }];
[self.fromLabel setContentCompressionResistancePriority:UILayoutPriorityRequired
forAxis:UILayoutConstraintAxisHorizontal];
} }
return self; return self;
} }
...@@ -88,9 +90,9 @@ ...@@ -88,9 +90,9 @@
_child = child; _child = child;
[self.contentImageView sd_setImageWithURL:[NSURL URLWithString:[_child.itemImgs componentsSeparatedByString:@","].firstObject] placeholderImage:[UIImage imageNamed:@"home_quanyuan_def_pic"]]; [self.contentImageView sd_setImageWithURL:[NSURL URLWithString:[_child.itemImgs componentsSeparatedByString:@","].firstObject] placeholderImage:[UIImage imageNamed:@"home_quanyuan_def_pic"]];
self.titleLabel.text = _child.itemTitle; self.titleLabel.text = _child.itemTitle;
self.fromLabel.text = [NSString stringWithFormat:@"来源: %@", _child.source]; self.fromLabel.text = [NSString stringWithFormat:@"来源: %@", _child.sourceName];
self.dateLabel.text = _child.itemCreateAt; self.dateLabel.text = _child.itemCreateAt;
if ([_child.imgPosition isEqualToString:@"2"]) {//上 if ([_child.imgPosition isEqualToString:@"2"]) {//上
...@@ -111,11 +113,13 @@ ...@@ -111,11 +113,13 @@
[self.fromLabel mas_remakeConstraints:^(MASConstraintMaker *make) { [self.fromLabel mas_remakeConstraints:^(MASConstraintMaker *make) {
make.top.equalTo(self.titleLabel.mas_bottom).offset(10 * k6Scale); make.top.equalTo(self.titleLabel.mas_bottom).offset(10 * k6Scale);
make.left.equalTo(self.contentImageView.mas_left); make.left.equalTo(self.contentImageView.mas_left);
make.right.lessThanOrEqualTo(self.contentView.mas_right).offset(-20 * k6Scale);
}]; }];
[self.dateLabel mas_remakeConstraints:^(MASConstraintMaker *make) { [self.dateLabel mas_remakeConstraints:^(MASConstraintMaker *make) {
make.centerY.equalTo(self.fromLabel); make.centerY.equalTo(self.fromLabel);
make.left.equalTo(self.fromLabel.mas_right).offset(20 * k6Scale); make.left.equalTo(self.fromLabel.mas_right).offset(10 * k6Scale);
make.right.equalTo(self.contentImageView.mas_right);
}]; }];
...@@ -133,12 +137,14 @@ ...@@ -133,12 +137,14 @@
make.bottom.equalTo(self.contentImageView.mas_bottom); make.bottom.equalTo(self.contentImageView.mas_bottom);
make.left.equalTo(self.contentView.mas_left).offset(20 * k6Scale); make.left.equalTo(self.contentView.mas_left).offset(20 * k6Scale);
make.height.mas_equalTo(15 * k6Scale); make.height.mas_equalTo(15 * k6Scale);
make.right.lessThanOrEqualTo(self.contentImageView.mas_left).offset(-20 * k6Scale);
}]; }];
[self.dateLabel mas_remakeConstraints:^(MASConstraintMaker *make) { [self.dateLabel mas_remakeConstraints:^(MASConstraintMaker *make) {
make.bottom.equalTo(self.contentImageView.mas_bottom); make.bottom.equalTo(self.contentImageView.mas_bottom);
make.left.equalTo(self.fromLabel.mas_right).offset(20 * k6Scale); make.left.equalTo(self.fromLabel.mas_right).offset(20 * k6Scale);
make.height.mas_equalTo(15 * k6Scale); make.height.mas_equalTo(15 * k6Scale);
make.right.lessThanOrEqualTo(self.contentImageView.mas_left).offset(-15 * k6Scale);
}]; }];
self.titleLabel.numberOfLines = 0; self.titleLabel.numberOfLines = 0;
...@@ -161,11 +167,13 @@ ...@@ -161,11 +167,13 @@
[self.fromLabel mas_remakeConstraints:^(MASConstraintMaker *make) { [self.fromLabel mas_remakeConstraints:^(MASConstraintMaker *make) {
make.bottom.equalTo(self.contentImageView.mas_top).offset(-10 * k6Scale); make.bottom.equalTo(self.contentImageView.mas_top).offset(-10 * k6Scale);
make.left.equalTo(self.contentImageView.mas_left); make.left.equalTo(self.contentImageView.mas_left);
make.right.lessThanOrEqualTo(self.contentView.mas_right).offset(-20 * k6Scale);
}]; }];
[self.dateLabel mas_remakeConstraints:^(MASConstraintMaker *make) { [self.dateLabel mas_remakeConstraints:^(MASConstraintMaker *make) {
make.centerY.equalTo(self.fromLabel); make.centerY.equalTo(self.fromLabel);
make.left.equalTo(self.fromLabel.mas_right).offset(20 * k6Scale); make.left.equalTo(self.fromLabel.mas_right).offset(20 * k6Scale);
make.right.equalTo(self.contentView.mas_right).offset(-20 * k6Scale);
}]; }];
self.titleLabel.numberOfLines = 1; self.titleLabel.numberOfLines = 1;
...@@ -185,6 +193,7 @@ ...@@ -185,6 +193,7 @@
[self.fromLabel mas_remakeConstraints:^(MASConstraintMaker *make) { [self.fromLabel mas_remakeConstraints:^(MASConstraintMaker *make) {
make.bottom.equalTo(self.contentImageView.mas_bottom); make.bottom.equalTo(self.contentImageView.mas_bottom);
make.left.equalTo(self.contentImageView.mas_right).offset(15 * k6Scale); make.left.equalTo(self.contentImageView.mas_right).offset(15 * k6Scale);
make.right.lessThanOrEqualTo(self.contentView.mas_right).offset(-20 * k6Scale);
make.height.mas_equalTo(15 * k6Scale); make.height.mas_equalTo(15 * k6Scale);
}]; }];
...@@ -192,13 +201,14 @@ ...@@ -192,13 +201,14 @@
make.bottom.equalTo(self.contentImageView.mas_bottom); make.bottom.equalTo(self.contentImageView.mas_bottom);
make.left.equalTo(self.fromLabel.mas_right).offset(20 * k6Scale); make.left.equalTo(self.fromLabel.mas_right).offset(20 * k6Scale);
make.height.mas_equalTo(15 * k6Scale); make.height.mas_equalTo(15 * k6Scale);
make.right.equalTo(self.contentView.mas_right).offset(-20 * k6Scale);
}]; }];
self.titleLabel.numberOfLines = 0; self.titleLabel.numberOfLines = 0;
[self.titleLabel mas_remakeConstraints:^(MASConstraintMaker *make) { [self.titleLabel mas_remakeConstraints:^(MASConstraintMaker *make) {
make.left.equalTo(self.contentImageView.mas_right).offset(15 * k6Scale); make.left.equalTo(self.contentImageView.mas_right).offset(15 * k6Scale);
make.top.equalTo(self.contentImageView.mas_top); make.top.equalTo(self.contentImageView.mas_top);
make.right.mas_equalTo(self.contentView.mas_right).offset(-20 * k6Scale); make.right.equalTo(self.contentView.mas_right).offset(-20 * k6Scale);
make.bottom.mas_lessThanOrEqualTo(self.fromLabel.mas_top).offset(-10 * k6Scale); make.bottom.mas_lessThanOrEqualTo(self.fromLabel.mas_top).offset(-10 * k6Scale);
}]; }];
} }
......
...@@ -77,7 +77,9 @@ ...@@ -77,7 +77,9 @@
}]; }];
@weakify(self); @weakify(self);
[[lelftBtn rac_signalForControlEvents:UIControlEventTouchUpInside] subscribeNext:^(id x) { [[lelftBtn rac_signalForControlEvents:UIControlEventTouchUpInside] subscribeNext:^(id x) {
@strongify(self);
self.hidden = YES;
[self removeFromSuperview];
[ZXTool showText:@"正在退出登录,请稍后"]; [ZXTool showText:@"正在退出登录,请稍后"];
[ZXTool backToLoginAndOperationInterface]; [ZXTool backToLoginAndOperationInterface];
}]; }];
...@@ -93,6 +95,8 @@ ...@@ -93,6 +95,8 @@
make.top.equalTo(bottomLine.mas_bottom); make.top.equalTo(bottomLine.mas_bottom);
}]; }];
[[rightBtn rac_signalForControlEvents:UIControlEventTouchUpInside] subscribeNext:^(id x) { [[rightBtn rac_signalForControlEvents:UIControlEventTouchUpInside] subscribeNext:^(id x) {
self.hidden = YES;
[self removeFromSuperview];
rightAction(); rightAction();
}]; }];
} }
......
...@@ -85,11 +85,34 @@ ...@@ -85,11 +85,34 @@
} }
- (void)setHtmlStr:(NSString *)htmlStr { - (void)setHtmlStr:(NSString *)htmlStr {
_htmlStr = htmlStr; _htmlStr = htmlStr;
NSString *str = [NSString stringWithFormat:@"<html><header><meta name='viewport' content='width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0'></header><body>%@</body></html>", _htmlStr]; // NSString *str = [NSString stringWithFormat:@"<html><header><meta name='viewport' content='width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0'></header><body>%@</body></html>", _htmlStr];
[self.webView loadHTMLString:str baseURL:nil]; [self.webView loadHTMLString:[self getHtmlData:_htmlStr] baseURL:nil];
} }
-(NSString *) getHtmlData:(NSString *)bodyHTML {
NSString *head = [NSString stringWithFormat:@"<html>%@%@%@%@<body>%@ </body></html>", @"<head>", @"<meta name=\"viewport\" content=\"width=device-width, initial-scale=1.0, user-scalable=no\"> ", @"<style>body{word-wrap:break-word;font-family:Arial}img{max-width: 100%; width:auto; height:auto;}</style>", @"</head>", bodyHTML];
return head;
}
- (void)webView:(WKWebView *)webView didFinishNavigation:(WKNavigation *)navigation {
@weakify(self);
[webView evaluateJavaScript:@"document.body.scrollHeight" completionHandler:^(id _Nullable content, NSError * _Nullable error) {
@strongify(self);
float height = [content floatValue];
CGFloat webH = self.webView.frame.size.height;
if (height <= webH) {
dispatch_async(dispatch_get_main_queue(), ^{
[self.agreedBtn mas_updateConstraints:^(MASConstraintMaker *make) {
make.height.mas_equalTo(40 * k6Scale);
}];
self.agreedBtn.hidden = NO;
});
}
}];
[ZXTool hideLoadingAnimation];
}
#pragma mark - ==========确定事件========== #pragma mark - ==========确定事件==========
- (void) okAction:(UIButton *) sender { - (void) okAction:(UIButton *) sender {
self.hidden =YES; self.hidden =YES;
......
...@@ -31,9 +31,9 @@ ...@@ -31,9 +31,9 @@
self.titleLabel = [[UILabel alloc] init]; self.titleLabel = [[UILabel alloc] init];
[self.contentView addSubview:self.titleLabel]; [self.contentView addSubview:self.titleLabel];
[self.titleLabel mas_makeConstraints:^(MASConstraintMaker *make) { [self.titleLabel mas_makeConstraints:^(MASConstraintMaker *make) {
make.edges.equalTo(self.contentView).insets(UIEdgeInsetsMake(0, 20 * k6Scale, 0, 0)); make.edges.equalTo(self.contentView).insets(UIEdgeInsetsMake(0, 20 * k6Scale, 0, 20 * k6Scale));
}]; }];
self.titleLabel.font = [UIFont boldSystemFontOfSize:16 * k6Scale]; self.titleLabel.font = [UIFont boldSystemFontOfSize:17 * k6Scale];
self.titleLabel.textColor = [UIColor blackColor]; self.titleLabel.textColor = [UIColor blackColor];
} }
......
...@@ -41,7 +41,7 @@ ...@@ -41,7 +41,7 @@
UILabel *label2 = [[UILabel alloc] initWithFrame:CGRectMake(32 * k6Scale, 80 * k6Scale, 100 , 20 * k6Scale)]; UILabel *label2 = [[UILabel alloc] initWithFrame:CGRectMake(32 * k6Scale, 80 * k6Scale, 100 , 20 * k6Scale)];
label2.textColor = [UIColor colorWithHexString:@"#8c95fa"]; label2.textColor = [UIColor colorWithHexString:@"#8c95fa"];
label2.font = kFontSize(13 * k6Scale); label2.font = [UIFont boldSystemFontOfSize:14 * k6Scale];
[bgView addSubview:label2]; [bgView addSubview:label2];
label2.text = [NSString stringWithFormat:@"V%@", model.version]; label2.text = [NSString stringWithFormat:@"V%@", model.version];
......
...@@ -9,6 +9,7 @@ ...@@ -9,6 +9,7 @@
#import <UIKit/UIKit.h> #import <UIKit/UIKit.h>
#import "ZXHomePageAnnouce.h" #import "ZXHomePageAnnouce.h"
#import "ZXNotPay.h" #import "ZXNotPay.h"
#import "ZXHomePagePublishView.h"
NS_ASSUME_NONNULL_BEGIN NS_ASSUME_NONNULL_BEGIN
@interface ZXHomePageUserInfoHeader : UIView @interface ZXHomePageUserInfoHeader : UIView
...@@ -23,6 +24,7 @@ NS_ASSUME_NONNULL_BEGIN ...@@ -23,6 +24,7 @@ NS_ASSUME_NONNULL_BEGIN
/** 待支付订单 */ /** 待支付订单 */
@property (nonatomic, strong) ZXNotPay *order; @property (nonatomic, strong) ZXNotPay *order;
@property (nonatomic, strong) ZXHomePagePublishView *pub;
......
...@@ -8,7 +8,7 @@ ...@@ -8,7 +8,7 @@
#import "ZXHomePageUserInfoHeader.h" #import "ZXHomePageUserInfoHeader.h"
#import "enlargeClickRegionBtn.h" #import "enlargeClickRegionBtn.h"
#import "ZXHomePagePublishView.h"
#import "ZXAnnouceListViewController.h" #import "ZXAnnouceListViewController.h"
#import "ZXHomePageService.h" #import "ZXHomePageService.h"
#import "ZXHomePageWebViewController.h" #import "ZXHomePageWebViewController.h"
...@@ -25,14 +25,13 @@ ...@@ -25,14 +25,13 @@
/** 学校 */ /** 学校 */
@property (nonatomic, strong) UILabel *schoolLabel; @property (nonatomic, strong) UILabel *schoolLabel;
@property (nonatomic, strong) ZXHomePagePublishView *pub;
/** 新的公告红点标记 */ /** 新的公告红点标记 */
@property (nonatomic, strong) UIView *annouceNode; @property (nonatomic, strong) UIView *annouceNode;
/** */ /** */
@property (nonatomic, strong) enlargeClickRegionBtn *userIconBtn; @property (nonatomic, strong) UIImageView *userIconBtn;
/** 当前是显示的订单还是公告 */ /** 当前是显示的订单还是公告 */
@property (nonatomic, assign) BOOL isShowPublish; @property (nonatomic, assign) BOOL isShowPublish;
...@@ -90,29 +89,29 @@ ...@@ -90,29 +89,29 @@
self.schoolLabel.textColor = [UIColor colorWithHexString:@"#ffffff"]; self.schoolLabel.textColor = [UIColor colorWithHexString:@"#ffffff"];
self.userIconBtn = [[enlargeClickRegionBtn alloc] init]; self.userIconBtn = [[UIImageView alloc] init];
[self addSubview:self.userIconBtn]; [self addSubview:self.userIconBtn];
[self.userIconBtn mas_makeConstraints:^(MASConstraintMaker *make) { [self.userIconBtn mas_makeConstraints:^(MASConstraintMaker *make) {
make.right.equalTo(self.mas_right).offset(-23 * k6Scale); make.right.equalTo(self.mas_right).offset(-23 * k6Scale);
make.centerY.equalTo(self.userNameLabel.mas_bottom); make.centerY.equalTo(self.userNameLabel.mas_bottom);
make.width.and.height.mas_equalTo(30 * k6Scale); make.width.and.height.mas_equalTo(30 * k6Scale);
}]; }];
[[self.userIconBtn rac_signalForControlEvents:UIControlEventTouchUpInside] subscribeNext:^(id x) { kViewRadius(self.userIconBtn, 15 * k6Scale);
// [[self.userIconBtn rac_signalForControlEvents:UIControlEventTouchUpInside] subscribeNext:^(id x) {
if ([UserManager sharedUserManager].user) { //
UserInfoViewController * VC=[UserInfoViewController new]; // if ([UserManager sharedUserManager].user) {
VC.hidesBottomBarWhenPushed=YES; // UserInfoViewController * VC=[UserInfoViewController new];
VC.user=[UserManager sharedUserManager].user; // VC.hidesBottomBarWhenPushed=YES;
[self.fromVc.navigationController pushViewController:VC animated:YES]; // VC.user=[UserManager sharedUserManager].user;
} else { // [self.fromVc.navigationController pushViewController:VC animated:YES];
Old_UserInfoViewController * VC=[Old_UserInfoViewController new]; // } else {
VC.hidesBottomBarWhenPushed=YES; // Old_UserInfoViewController * VC=[Old_UserInfoViewController new];
VC.userCenterItem=[UserManager sharedUserManager].oldUser; // VC.hidesBottomBarWhenPushed=YES;
[self.fromVc.navigationController pushViewController:VC animated:YES]; // VC.userCenterItem=[UserManager sharedUserManager].oldUser;
} // [self.fromVc.navigationController pushViewController:VC animated:YES];
// }
}]; //
// }];
enlargeClickRegionBtn *publishBtn = [[enlargeClickRegionBtn alloc] init]; enlargeClickRegionBtn *publishBtn = [[enlargeClickRegionBtn alloc] init];
...@@ -128,9 +127,10 @@ ...@@ -128,9 +127,10 @@
[[publishBtn rac_signalForControlEvents:UIControlEventTouchUpInside] subscribeNext:^(id x) { [[publishBtn rac_signalForControlEvents:UIControlEventTouchUpInside] subscribeNext:^(id x) {
kStrongSelf(self); kStrongSelf(self);
self.annouceNode.hidden = YES; self.annouceNode.hidden = YES;
self.pub.hidden = YES;
ZXAnnouceListViewController *annouces = [[ZXAnnouceListViewController alloc] init]; ZXAnnouceListViewController *annouces = [[ZXAnnouceListViewController alloc] init];
annouces.titleStr = @"公 告"; annouces.titleStr = @"公 告";
self.annouceNode.hidden = YES;
[self.fromVc.navigationController pushViewController:annouces animated:YES]; [self.fromVc.navigationController pushViewController:annouces animated:YES];
}]; }];
...@@ -166,14 +166,12 @@ ...@@ -166,14 +166,12 @@
if (self.annouce) { if (self.annouce) {
self.annouce.whetherClicked = YES; self.annouce.whetherClicked = YES;
self.annouce = self.annouce; self.annouce = self.annouce;
self.pub.hidden = YES;
[ZXHomePageService loadAnnouceAttbuitesMsgByNoticeCode:self.annouce.noticeCode completed:^(ZXHomePageAnnouce * _Nullable publish) { [ZXHomePageService loadAnnouceAttbuitesMsgByNoticeCode:self.annouce.noticeCode completed:^(ZXHomePageAnnouce * _Nullable publish) {
kStrongSelf(self); kStrongSelf(self);
dispatch_async(dispatch_get_main_queue(), ^{ dispatch_async(dispatch_get_main_queue(), ^{
[ZXTool hideLoadingAnimation]; [ZXTool hideLoadingAnimation];
//隐藏提示窗体
self.pub.hidden = YES;
//跳转H5页面 渲染富文本 //跳转H5页面 渲染富文本
ZXHomePageWebViewController *attVc = [[ZXHomePageWebViewController alloc] init]; ZXHomePageWebViewController *attVc = [[ZXHomePageWebViewController alloc] init];
...@@ -185,6 +183,7 @@ ...@@ -185,6 +183,7 @@
} else { } else {
self.order.whetherClicked = YES; self.order.whetherClicked = YES;
self.order = self.order; self.order = self.order;
self.pub.hidden = YES;
ZXOrderPayController *jumpPay = [[ZXOrderPayController alloc] init]; ZXOrderPayController *jumpPay = [[ZXOrderPayController alloc] init];
jumpPay.orderId = self.order.orderId; jumpPay.orderId = self.order.orderId;
[self.fromVc.navigationController pushViewController:jumpPay animated:YES]; [self.fromVc.navigationController pushViewController:jumpPay animated:YES];
...@@ -192,7 +191,7 @@ ...@@ -192,7 +191,7 @@
}; };
self.userNameLabel.text = [kUserDefaults valueForKey:@"username"]; self.userNameLabel.text = [kUserDefaults valueForKey:@"username"];
self.telLabel.text = CacheAccount; self.telLabel.text = [CacheAccount stringByReplacingOccurrencesOfString:[CacheAccount substringWithRange:NSMakeRange(3, 4)] withString:@"****"];
self.schoolLabel.text = [kUserDefaults valueForKey:@"campusName"]; self.schoolLabel.text = [kUserDefaults valueForKey:@"campusName"];
[self settingUserIcon]; [self settingUserIcon];
...@@ -209,7 +208,8 @@ ...@@ -209,7 +208,8 @@
} else { } else {
imageName = @"bg_touxiang_girl"; imageName = @"bg_touxiang_girl";
} }
[self.userIconBtn sd_setBackgroundImageWithURL:[NSURL URLWithString:[UserManager sharedUserManager].user.customerHead] forState:UIControlStateNormal placeholderImage:[UIImage imageNamed:imageName]]; [self.userIconBtn sd_setImageWithURL:[NSURL URLWithString:[UserManager sharedUserManager].user.customerHead] placeholderImage:[UIImage imageNamed:imageName]];
// [self.userIconBtn sd_setBackgroundImageWithURL:[NSURL URLWithString:[UserManager sharedUserManager].user.customerHead] forState:UIControlStateNormal placeholderImage:[UIImage imageNamed:imageName]];
} }
- (void)setAnnouce:(ZXHomePageAnnouce *)annouce { - (void)setAnnouce:(ZXHomePageAnnouce *)annouce {
...@@ -228,12 +228,13 @@ ...@@ -228,12 +228,13 @@
- (void)setOrder:(ZXNotPay *)order { - (void)setOrder:(ZXNotPay *)order {
_order = order; _order = order;
self.isShowPublish = NO; self.isShowPublish = NO;
self.annouceNode.hidden = YES;
if (_order == nil) { if (_order == nil) {
self.pub.hidden = YES; self.pub.hidden = YES;
} else { } else {
self.pub.hidden = NO; self.pub.hidden = NO;
self.pub.order = _order; self.pub.order = _order;
self.annouceNode.hidden = _order.whetherClicked;
} }
} }
......
...@@ -50,6 +50,14 @@ ...@@ -50,6 +50,14 @@
}); });
} else { } else {
NSArray *founctions = [ZXHomePageFouction mj_objectArrayWithKeyValuesArray:common.data[@"functionData"]]; NSArray *founctions = [ZXHomePageFouction mj_objectArrayWithKeyValuesArray:common.data[@"functionData"]];
founctions = [founctions sortedArrayUsingComparator:^NSComparisonResult(ZXHomePageFouction* _Nonnull obj1, ZXHomePageFouction *obj2) {
//此处的规则含义为:若前一元素比后一元素小,则返回降序(即后一元素在前,为从大到小排列)
if (obj1.sortId > obj2.sortId) {
return NSOrderedDescending;
} else {
return NSOrderedAscending;
}
}];
NSArray *sections = [ZXHomeSectionInfo mj_objectArrayWithKeyValuesArray:common.data[@"plateData"]]; NSArray *sections = [ZXHomeSectionInfo mj_objectArrayWithKeyValuesArray:common.data[@"plateData"]];
[self.functions removeAllObjects]; [self.functions removeAllObjects];
[self.functions addObject:founctions]; [self.functions addObject:founctions];
...@@ -74,7 +82,9 @@ ...@@ -74,7 +82,9 @@
} else { } else {
NSArray *arr = [ZXHomePageAnnouce mj_objectArrayWithKeyValuesArray:common.data]; NSArray *arr = [ZXHomePageAnnouce mj_objectArrayWithKeyValuesArray:common.data];
[self.announceSource removeAllObjects]; [self.announceSource removeAllObjects];
[self.announceSource addObjectsFromArray:arr]; [self.announceSource addObjectsFromArray:arr];
completed(YES); completed(YES);
} }
}]; }];
...@@ -91,9 +101,10 @@ ...@@ -91,9 +101,10 @@
}); });
} else { } else {
ZXHomePageAnnouce *an = [ZXHomePageAnnouce mj_objectWithKeyValues:common.data]; ZXHomePageAnnouce *an = [ZXHomePageAnnouce mj_objectWithKeyValues:common.data];
if (an) { dispatch_async(dispatch_get_main_queue(), ^{
completed(an); [ZXTool hideLoadingAnimation];
} });
completed(an);
} }
}]; }];
} }
......
// //
...@@ -156,7 +156,6 @@ ...@@ -156,7 +156,6 @@
-(void)viewWillAppear:(BOOL)animated { -(void)viewWillAppear:(BOOL)animated {
[super viewWillAppear:animated]; [super viewWillAppear:animated];
self.navigationController.navigationBar.hidden = NO; self.navigationController.navigationBar.hidden = NO;
// self.navigationController.navigationBar.translucent = YES;
self.tabBarController.tabBar.hidden = NO; self.tabBarController.tabBar.hidden = NO;
[self.tabBarController.tabBar hideBadgeOnItemIndex:1]; [self.tabBarController.tabBar hideBadgeOnItemIndex:1];
} }
......
// //
...@@ -289,7 +289,7 @@ static NSInteger seq = 0; ...@@ -289,7 +289,7 @@ static NSInteger seq = 0;
[super viewWillAppear:animated]; [super viewWillAppear:animated];
[UIApplication sharedApplication].statusBarStyle = 0; [UIApplication sharedApplication].statusBarStyle = 0;
[UIApplication sharedApplication].statusBarHidden = NO; self.navigationController.navigationBar.hidden = YES; [UIApplication sharedApplication].statusBarHidden = NO; self.navigationController.navigationBar.hidden = YES;
// self.navigationController.navigationBar.translucent = YES;
self.tabBarController.tabBar.hidden = NO; self.tabBarController.tabBar.hidden = NO;
......
// //
...@@ -312,11 +312,6 @@ ...@@ -312,11 +312,6 @@
#pragma mark - ========== 忘记密码 ========== #pragma mark - ========== 忘记密码 ==========
- (void) forgetPwd:(enlargeClickRegionBtn *) sender { - (void) forgetPwd:(enlargeClickRegionBtn *) sender {
forgetPasswordViewController *forgetVc = [[forgetPasswordViewController alloc] init]; forgetPasswordViewController *forgetVc = [[forgetPasswordViewController alloc] init];
@weakify(self);
forgetVc.backBlock = ^{
@strongify(self);
// self.navigationController.navigationBar.translucent = NO;
};
[self.navigationController pushViewController:forgetVc animated:YES]; [self.navigationController pushViewController:forgetVc animated:YES];
} }
#pragma mark - ========== UITableView/Delegate/Datasource ========== #pragma mark - ========== UITableView/Delegate/Datasource ==========
......
// //
...@@ -257,12 +257,7 @@ ...@@ -257,12 +257,7 @@
#pragma mark - ========== 忘记密码 ========== #pragma mark - ========== 忘记密码 ==========
- (void) forgetPwd:(enlargeClickRegionBtn *) sender { - (void) forgetPwd:(enlargeClickRegionBtn *) sender {
forgetPasswordViewController *forgetVc = [[forgetPasswordViewController alloc] init]; forgetPasswordViewController *forgetVc = [[forgetPasswordViewController alloc] init];
@weakify(self);
forgetVc.backBlock = ^{
@strongify(self);
// self.navigationController.navigationBar.translucent = NO;
};
[self.navigationController pushViewController:forgetVc animated:YES]; [self.navigationController pushViewController:forgetVc animated:YES];
} }
#pragma mark - ========== UITableView/Delegate/Datasource ========== #pragma mark - ========== UITableView/Delegate/Datasource ==========
......
// //
...@@ -266,11 +266,6 @@ ...@@ -266,11 +266,6 @@
#pragma mark - ========== 忘记密码 ========== #pragma mark - ========== 忘记密码 ==========
- (void) forgetPwd:(enlargeClickRegionBtn *) sender { - (void) forgetPwd:(enlargeClickRegionBtn *) sender {
forgetPasswordViewController *forgetVc = [[forgetPasswordViewController alloc] init]; forgetPasswordViewController *forgetVc = [[forgetPasswordViewController alloc] init];
@weakify(self);
forgetVc.backBlock = ^{
@strongify(self);
// self.navigationController.navigationBar.translucent = NO;
};
[self.navigationController pushViewController:forgetVc animated:YES]; [self.navigationController pushViewController:forgetVc animated:YES];
} }
#pragma mark - ========== UITableView/Delegate/Datasource ========== #pragma mark - ========== UITableView/Delegate/Datasource ==========
......
// //
...@@ -497,33 +497,42 @@ ...@@ -497,33 +497,42 @@
} }
- (void)imageReshaperController:(AliImageReshapeController *)reshaper didFinishPickingMediaWithInfo:(UIImage *)image { - (void)imageReshaperController:(AliImageReshapeController *)reshaper didFinishPickingMediaWithInfo:(UIImage *)image {
NSData *data = UIImageJPEGRepresentation(image, 0.3); NSData *data = UIImageJPEGRepresentation(image, 0.3);
self.iconImageView.image =image; AFHTTPSessionManager *session = [AFHTTPSessionManager manager];
[XMCenter sendRequest:^(XMRequest *request) { [session.requestSerializer setValue:@"multipart/form-data" forHTTPHeaderField:@"Content-Type"];
request.server = [NSString stringWithFormat:@"%@/app/customer/headpic/upload?customerId=%@", [kUserDefaults valueForKey:@"NEW_PAY"], [kUserDefaults valueForKey:@"userId"]]; [session.requestSerializer setValue:CacheToken forHTTPHeaderField:@"token"];
request.requestType = kXMRequestUpload; [session.requestSerializer setValue:@"app" forHTTPHeaderField:@"reqSource"];
[request addFormDataWithName:@"file" fileName:@"file.jpeg" mimeType:@"image/jpeg" fileData:data]; [session.requestSerializer setValue:[ZXTool returnNormalHTTPHeaderJson] forHTTPHeaderField:@"clientSource"];
} onProgress:^(NSProgress *progress) {
// the progress block is running on the session queue. [session POST:[NSString stringWithFormat:@"%@/app/customer/headpic/upload?customerId=%@", [kUserDefaults valueForKey:@"NEW_PAY"], CacheUserId] parameters:@{@"customerId":[kUserDefaults valueForKey:@"userId"], @"token":CacheToken} constructingBodyWithBlock:^(id<AFMultipartFormData> _Nonnull formData) {
if (progress) { [formData appendPartWithFileData:data name:@"file" fileName:@"temp.jpeg" mimeType:@"multipart/form-data"];
NSLog(@"onProgress: %f", progress.fractionCompleted); } success:^(NSURLSessionDataTask * _Nonnull task, id _Nonnull responseObject) {
}
} onSuccess:^(id responseObject) {
if ([responseObject[@"code"] integerValue] == 1000) { if ([responseObject[@"code"] integerValue] == 1000) {
self.user.customerHead = responseObject[@"data"][@"headPic"]; dispatch_async(dispatch_get_main_queue(), ^{
[self.user update]; self.iconImageView.image =image;
});
if ([responseObject[@"code"] integerValue] == 1000) {
self.user.customerHead = responseObject[@"data"][@"headPic"];
[self.user update];
}
dispatch_async(dispatch_get_main_queue(), ^{
self.completed();
[self.navigationController popViewControllerAnimated:YES];
});
} else {
dispatch_async(dispatch_get_main_queue(), ^{
[ZXTool showText:responseObject[@"msg"]];
});
} }
dispatch_async(dispatch_get_main_queue(), ^{ dispatch_async(dispatch_get_main_queue(), ^{
self.completed();
[self.navigationController popViewControllerAnimated:YES]; [self.navigationController popViewControllerAnimated:YES];
}); });
NSLog(@"onSuccess: %@", responseObject); } failure:^(NSURLSessionDataTask * _Nullable task, NSError * _Nonnull error) {
} onFailure:^(NSError *error) {
dispatch_async(dispatch_get_main_queue(), ^{ dispatch_async(dispatch_get_main_queue(), ^{
[ZXTool showText:error.userInfo[@"NSLocalizedDescription"]]; [ZXTool showText:error.userInfo[@"NSLocalizedDescription"]];
}); });
} onFinished:^(id responseObject, NSError *error) {
NSLog(@"onFinished");
}]; }];
} }
#pragma mark - ========== 上传头像 ========== #pragma mark - ========== 上传头像 ==========
......
// //
...@@ -123,7 +123,7 @@ kSINGLETON_FOR_CLASS(APIManager) ...@@ -123,7 +123,7 @@ kSINGLETON_FOR_CLASS(APIManager)
[userDefaults setObject:@"http://shower-app-server.dcrym.com" forKey:@"BATH"]; [userDefaults setObject:@"http://shower-app-server.dcrym.com" forKey:@"BATH"];
[userDefaults setObject:@"http://shower-app-server.dcrym.com" forKey:@"AppointBATH"]; [userDefaults setObject:@"http://shower-app-server.dcrym.com" forKey:@"AppointBATH"];
[userDefaults setObject:@"http://ex-test-dcxy-home-app.168cad.top" forKey:@"HomePage"]; [userDefaults setObject:@"http://dcxy-home-app.dcrym.com" forKey:@"HomePage"];
[userDefaults synchronize]; [userDefaults synchronize];
break; break;
} }
......
// //
...@@ -247,9 +247,10 @@ ...@@ -247,9 +247,10 @@
[button setImage:[UIImage imageNamed:normal] forState:UIControlStateNormal]; [button setImage:[UIImage imageNamed:normal] forState:UIControlStateNormal];
[button setImage:[UIImage imageNamed:select] forState:UIControlStateDisabled]; [button setImage:[UIImage imageNamed:select] forState:UIControlStateDisabled];
[button setTitle:title forState:UIControlStateNormal]; [button setTitle:title forState:UIControlStateNormal];
[button setTitleColor:[[UIColor darkTextColor] colorWithAlphaComponent:0.4] forState:UIControlStateNormal]; [button setTitle:@"●" forState:UIControlStateDisabled];
[button setTitleColor:[UIColor colorWithHexString:@"999999"] forState:UIControlStateNormal];
button.layoutStyle = style; button.layoutStyle = style;
[button setTitleColor:[UIColor colorWithHexString:@"#8c95fa"] forState:UIControlStateDisabled]; [button setTitleColor:RGB(255, 165, 80) forState:UIControlStateDisabled];
button.titleLabel.font = kFontSize(12 * k6Scale); button.titleLabel.font = kFontSize(12 * k6Scale);
button.midSpacing = 2; button.midSpacing = 2;
return button; return button;
......
// //
...@@ -476,7 +476,7 @@ ...@@ -476,7 +476,7 @@
[btn setTitleColor:[UIColor colorWithHexString:@"#333333"] forState:UIControlStateNormal]; [btn setTitleColor:[UIColor colorWithHexString:@"#333333"] forState:UIControlStateNormal];
[self addSubview:btn]; [self addSubview:btn];
//[btn sd_setImageWithURL:[NSURL URLWithString:[common.itemImgs componentsSeparatedByString:@","].firstObject] forState:UIControlStateNormal placeholderImage:[UIImage imageNamed:@"home_quanyuan_def_pic"]]; //[btn sd_setImageWithURL:[NSURL URLWithString:[common.itemImgs componentsSeparatedByString:@","].firstObject] forState:UIControlStateNormal placeholderImage:[UIImage imageNamed:@"home_quanyuan_def_pic"]];
[btn setImage:[UIImage imageNamed:@"home_quanyuan_def_pic"] forState:UIControlStateNormal]; [btn setImage:[UIImage imageNamed:common[@"image"]] forState:UIControlStateNormal];
objc_setAssociatedObject(btn, @selector(delegate), common, OBJC_ASSOCIATION_RETAIN_NONATOMIC); objc_setAssociatedObject(btn, @selector(delegate), common, OBJC_ASSOCIATION_RETAIN_NONATOMIC);
[btn addTarget:self action:@selector(touchMeItem:) forControlEvents:UIControlEventTouchUpInside]; [btn addTarget:self action:@selector(touchMeItem:) forControlEvents:UIControlEventTouchUpInside];
[btn setTitle:common[@"title"] forState:UIControlStateNormal]; [btn setTitle:common[@"title"] forState:UIControlStateNormal];
......
// //
...@@ -25,11 +25,11 @@ ...@@ -25,11 +25,11 @@
[navBar setTitleTextAttributes:@{NSForegroundColorAttributeName:[UIColor whiteColor]}]; [navBar setTitleTextAttributes:@{NSForegroundColorAttributeName:[UIColor whiteColor]}];
CGSize size = CGSizeMake(kWidth, kTopHeight); CGSize size = CGSizeMake(kWidth, kTopHeight);
// //设置颜色数组 // //设置颜色数组
//UIColor *leftColor = kRGB(171, 178, 247); UIColor *leftColor = kRGB(171, 178, 247);
//UIColor *rightColor = kRGB(144, 152, 247); UIColor *rightColor = kRGB(144, 152, 247);
UIColor *leftColor = [UIColor colorWithHexString:@"#ff8809"]; // UIColor *leftColor = [UIColor colorWithHexString:@"#ff8809"];
UIColor *rightColor = [UIColor colorWithHexString:@"#fe5b0b"]; // UIColor *rightColor = [UIColor colorWithHexString:@"#fe5b0b"];
//设置颜色 //设置颜色
NSArray * colors = @[leftColor, rightColor]; NSArray * colors = @[leftColor, rightColor];
......
// //
...@@ -117,7 +117,7 @@ ...@@ -117,7 +117,7 @@
[super viewWillAppear:animated]; [super viewWillAppear:animated];
self.tabBarController.tabBar.hidden = YES; self.tabBarController.tabBar.hidden = YES;
self.navigationController.navigationBar.hidden = NO; self.navigationController.navigationBar.hidden = NO;
// self.navigationController.navigationBar.translucent = NO;
[UIApplication sharedApplication].statusBarHidden = NO; [UIApplication sharedApplication].statusBarHidden = NO;
} }
-(void)webView:(WKWebView *)webView didFailNavigation:(WKNavigation *)navigation withError:(NSError *)error { -(void)webView:(WKWebView *)webView didFailNavigation:(WKNavigation *)navigation withError:(NSError *)error {
......
// //
...@@ -88,12 +88,10 @@ ...@@ -88,12 +88,10 @@
-(void)viewWillAppear:(BOOL)animated{ -(void)viewWillAppear:(BOOL)animated{
[super viewWillAppear:animated]; [super viewWillAppear:animated];
[[UIApplication sharedApplication] setStatusBarHidden:NO withAnimation:NO]; [[UIApplication sharedApplication] setStatusBarHidden:NO withAnimation:NO];
// self.navigationController.navigationBar.translucent = NO;
self.navigationController.navigationBar.hidden = NO; self.navigationController.navigationBar.hidden = NO;
} }
- (void)viewWillDisappear:(BOOL)animated { - (void)viewWillDisappear:(BOOL)animated {
[super viewWillDisappear:animated]; [super viewWillDisappear:animated];
// self.navigationController.navigationBar.translucent = YES;
if (self.backBlock) { if (self.backBlock) {
self.backBlock(); self.backBlock();
} }
......
// //
...@@ -143,8 +143,7 @@ ...@@ -143,8 +143,7 @@
-(void)viewWillAppear:(BOOL)animated{ -(void)viewWillAppear:(BOOL)animated{
[super viewWillAppear:animated]; [super viewWillAppear:animated];
if (self.isFromSimple) { if (self.isFromSimple) {
// self.navigationController.navigationBar.hidden = YES;
// self.navigationController.navigationBar.translucent = NO;
} else { } else {
[UIApplication sharedApplication].statusBarStyle = UIStatusBarStyleLightContent; [UIApplication sharedApplication].statusBarStyle = UIStatusBarStyleLightContent;
[[UIApplication sharedApplication] setStatusBarHidden:NO withAnimation:NO]; [[UIApplication sharedApplication] setStatusBarHidden:NO withAnimation:NO];
......
// //
...@@ -267,8 +267,8 @@ ...@@ -267,8 +267,8 @@
- (void)payWithData:(payModelItem*)payItem AliData:(NSString *)aliData{ - (void)payWithData:(payModelItem*)payItem AliData:(NSString *)aliData{
if ([self.payType isEqualToString:@"2"]) { if ([self.payType isEqualToString:@"2"]) {
// 微信支付 // 微信支付
[WXApi registerApp:payItem.appid]; [WXApi registerApp:payItem.appid];
if (![WXApi isWXAppInstalled]) { if (![WXApi isWXAppInstalled]) {
// 未安装微信 // 未安装微信
......
// //
...@@ -149,7 +149,7 @@ ...@@ -149,7 +149,7 @@
self.tableView.dataSource=self; self.tableView.dataSource=self;
self.tableView.tableFooterView=[UIView new]; self.tableView.tableFooterView=[UIView new];
kViewRadius(self.iconImageView, 40);
[self settingUserIcon]; [self settingUserIcon];
self.nameLabel.text=self.userCenterItem.username; self.nameLabel.text=self.userCenterItem.username;
self.countLabel.text=self.userCenterItem.account; self.countLabel.text=self.userCenterItem.account;
......
// //
...@@ -83,7 +83,7 @@ ...@@ -83,7 +83,7 @@
- (void)viewDidLoad { - (void)viewDidLoad {
[super viewDidLoad]; [super viewDidLoad];
[self loadData]; [self loadData];
kViewRadius(self.iconImageView, 40);
_allDataArray = [[NSArray alloc]init]; _allDataArray = [[NSArray alloc]init];
self.naConstant.constant = kStatusBarHeight + 6; self.naConstant.constant = kStatusBarHeight + 6;
......
// //
...@@ -176,11 +176,6 @@ ...@@ -176,11 +176,6 @@
- (IBAction)forgetPassword:(id)sender { - (IBAction)forgetPassword:(id)sender {
forgetPasswordViewController * VC=[forgetPasswordViewController new]; forgetPasswordViewController * VC=[forgetPasswordViewController new];
@weakify(self);
VC.backBlock = ^{
@strongify(self);
// self.navigationController.navigationBar.translucent = NO;
};
[self.navigationController pushViewController:VC animated:YES]; [self.navigationController pushViewController:VC animated:YES];
} }
- (IBAction)sureBtnClick:(id)sender { - (IBAction)sureBtnClick:(id)sender {
...@@ -241,11 +236,11 @@ ...@@ -241,11 +236,11 @@
[ZXTool checkCurrentUserModeCompleted:^(BOOL isOld) { [ZXTool checkCurrentUserModeCompleted:^(BOOL isOld) {
if (isOld) { if (isOld) {
dispatch_async(dispatch_get_main_queue(), ^{ dispatch_async(dispatch_get_main_queue(), ^{
[_changeDevicePwdModel changeDevicePasswordWithOldPassword:_currentPassword.text newPassword:str]; [self.changeDevicePwdModel changeDevicePasswordWithOldPassword:self.currentPassword.text newPassword:str];
}); });
} else { } else {
dispatch_async(dispatch_get_main_queue(), ^{ dispatch_async(dispatch_get_main_queue(), ^{
[ZXTool requestDataWithType:kXMHTTPMethodPOST url:[NSString stringWithFormat:@"%@/app/customer/hardware/pwd", [kUserDefaults valueForKey:@"NEW_PAY"]] para:@{@"customerId": CacheUserId,@"oldPassword": _currentPassword.text,@"password":self.seconBlockTextFeild1.text} completed:^(CommonModel *common, NSString *error) { [ZXTool requestDataWithType:kXMHTTPMethodPOST url:[NSString stringWithFormat:@"%@/app/customer/hardware/pwd", [kUserDefaults valueForKey:@"NEW_PAY"]] para:@{@"customerId": CacheUserId,@"oldPassword": self.currentPassword.text,@"password":self.seconBlockTextFeild1.text} completed:^(CommonModel *common, NSString *error) {
dispatch_async(dispatch_get_main_queue(), ^{ dispatch_async(dispatch_get_main_queue(), ^{
[ZXTool hideLoadingAnimation]; [ZXTool hideLoadingAnimation];
if (error) { if (error) {
...@@ -259,8 +254,6 @@ ...@@ -259,8 +254,6 @@
}); });
} }
}]; }];
}else{ }else{
//去掉首尾字符串空格; //去掉首尾字符串空格;
NSString * str1= [_seconBlockTextFeild1.text stringByTrimmingCharactersInSet:[NSCharacterSet whitespaceCharacterSet]]; NSString * str1= [_seconBlockTextFeild1.text stringByTrimmingCharactersInSet:[NSCharacterSet whitespaceCharacterSet]];
......
// //
...@@ -558,7 +558,7 @@ typedef void(^isCanChange)(BOOL iCan); ...@@ -558,7 +558,7 @@ typedef void(^isCanChange)(BOOL iCan);
self.navigationController.navigationBar.hidden = NO; self.navigationController.navigationBar.hidden = NO;
} }
#pragma mark - ========== 单独加载是否开启密支付 ========== #pragma mark - ========== 单独加载是否开启密支付 ==========
- (void) loadIsOpenFreePay { - (void) loadIsOpenFreePay {
[ZXTool requestDataWithType:kXMHTTPMethodGET url:[NSString stringWithFormat:@"%@/app/customer/balance/state?customerId=%@", [kUserDefaults valueForKey:@"NEW_PAY"],CacheUserId] para:nil completed:^(CommonModel *common, NSString *error) { [ZXTool requestDataWithType:kXMHTTPMethodGET url:[NSString stringWithFormat:@"%@/app/customer/balance/state?customerId=%@", [kUserDefaults valueForKey:@"NEW_PAY"],CacheUserId] para:nil completed:^(CommonModel *common, NSString *error) {
dispatch_async(dispatch_get_main_queue(), ^{ dispatch_async(dispatch_get_main_queue(), ^{
......
// //
...@@ -816,18 +816,29 @@ static NSInteger seq = 0; ...@@ -816,18 +816,29 @@ static NSInteger seq = 0;
if (isOld) { if (isOld) {
dispatch_async(dispatch_get_global_queue(0, 0), ^{ dispatch_async(dispatch_get_global_queue(0, 0), ^{
if ([CacherechargeStatus isEqualToString:@"0"]) { if ([CacherechargeStatus isEqualToString:@"0"]) {
[self.firstTopupModel JudgeFirstTopUp]; GetData * data=[GetData shareData];
[data JudgeFirstTopUpSuccess:^(AFHTTPRequestOperation *operation, id responseObject) {
NSDictionary * dic=responseObject;
if ([dic[@"code"] isEqualToString:@"0"]) {
dispatch_async(dispatch_get_main_queue(), ^{
[self showFirstRechargeAlertByMsg:dic[@"data"][@"rechargeNotice"]];
});
}
} failure:^(AFHTTPRequestOperation *operation, NSError *error) {
}];
} }
}); });
} else { } else {
if ([CacherechargeStatus isEqualToString:@"1"]) {
return ;
}
[ZXTool requestDataHideLoadingToastWithType:kXMHTTPMethodGET url:[NSString stringWithFormat:@"%@/dcxy/api/paymentAndActiveConf/getFirstRechargeConfContent?areaId=%@", [kUserDefaults objectForKey:@"SX_MONEY"], CacheCampusId] para:nil completed:^(CommonModel *common, NSString *error) { [ZXTool requestDataHideLoadingToastWithType:kXMHTTPMethodGET url:[NSString stringWithFormat:@"%@/dcxy/api/paymentAndActiveConf/getFirstRechargeConfContent?areaId=%@", [kUserDefaults objectForKey:@"SX_MONEY"], CacheCampusId] para:nil completed:^(CommonModel *common, NSString *error) {
@strongify(self); @strongify(self);
if (error == nil) { dispatch_async(dispatch_get_main_queue(), ^{
[self showFirstRechargeAlertByMsg:common.data]; if (error == nil) {
} [self showFirstRechargeAlertByMsg:common.data];
}
});
}]; }];
} }
}]; }];
......
// //
...@@ -113,7 +113,7 @@ ...@@ -113,7 +113,7 @@
self.tabBarController.tabBar.hidden = YES; self.tabBarController.tabBar.hidden = YES;
self.navigationController.navigationBar.hidden = YES; self.navigationController.navigationBar.hidden = YES;
self.navigationController.navigationBar.hidden = NO; self.navigationController.navigationBar.hidden = NO;
// self.navigationController.navigationBar.translucent = NO;
self.webView.scrollView.decelerationRate = UIScrollViewDecelerationRateNormal; self.webView.scrollView.decelerationRate = UIScrollViewDecelerationRateNormal;
if (@available(iOS 11.0, *)) { if (@available(iOS 11.0, *)) {
self.webView.scrollView.contentInsetAdjustmentBehavior = UIScrollViewContentInsetAdjustmentNever; self.webView.scrollView.contentInsetAdjustmentBehavior = UIScrollViewContentInsetAdjustmentNever;
...@@ -276,7 +276,7 @@ ...@@ -276,7 +276,7 @@
[super viewWillDisappear:animated]; [super viewWillDisappear:animated];
self.navigationController.navigationBar.hidden = NO; self.navigationController.navigationBar.hidden = NO;
self.tabBarController.tabBar.hidden = NO; self.tabBarController.tabBar.hidden = NO;
// self.navigationController.navigationBar.translucent = YES;
NSLog(@"已经清理所有的绑定"); NSLog(@"已经清理所有的绑定");
for (NSString *str in self.indentifierList) { for (NSString *str in self.indentifierList) {
[self.webView.configuration.userContentController removeScriptMessageHandlerForName:str]; [self.webView.configuration.userContentController removeScriptMessageHandlerForName:str];
......
// //
...@@ -51,9 +51,8 @@ ...@@ -51,9 +51,8 @@
/// 准备导航栏 /// 准备导航栏
- (void)prepareNavigationBar { - (void)prepareNavigationBar {
// 1> 背景颜色 // 1> 背景颜色
[self.navigationController.navigationBar setBarTintColor:[UIColor colorWithWhite:0.1 alpha:1.0]]; // [self.navigationController.navigationBar setBarTintColor:[UIColor colorWithWhite:0.1 alpha:1.0]];
// self.navigationController.navigationBar.translucent = YES; // self.navigationController.navigationBar.shadowImage = [[UIImage alloc] init];
self.navigationController.navigationBar.shadowImage = [[UIImage alloc] init];
// 2> 标题 // 2> 标题
self.title = @"我的名片"; self.title = @"我的名片";
......
// //
...@@ -122,37 +122,17 @@ ...@@ -122,37 +122,17 @@
} }
-(void)viewWillAppear:(BOOL)animated{ -(void)viewWillAppear:(BOOL)animated{
[super viewWillAppear:animated]; [super viewWillAppear:animated];
// 屏幕最亮
// AppDelegate *appDelegate=(AppDelegate *)[UIApplication sharedApplication].delegate;
// appDelegate.currentVC=NSStringFromClass([self class]);
NSString *defaultBright = [NSString stringWithFormat:@"%f", [UIScreen mainScreen].brightness]; CGFloat currentLight = [[UIScreen mainScreen] brightness];
[kUserDefaults setObject:@(currentLight) forKey:@"brightness"];
NSUserDefaults *defaults = [NSUserDefaults standardUserDefaults]; [[UIScreen mainScreen] setBrightness:1];//点亮
[kUserDefaults setObject:@"yes" forKey:@"isNeedLight"];
[defaults setObject:defaultBright forKey:@"defaultBright"];
[defaults setObject:@"1" forKey:@"isOnH5UsePage"];
[defaults synchronize];
[[UIScreen mainScreen] setBrightness:1];
} }
-(void)viewWillDisappear:(BOOL)animated{ -(void)viewWillDisappear:(BOOL)animated{
[super viewWillDisappear:animated]; [super viewWillDisappear:animated];
// 屏幕亮度默认 [[UIScreen mainScreen] setBrightness:[[kUserDefaults objectForKey:@"brightness"] floatValue]];//恢复
CGFloat defaultBright = [[[NSUserDefaults standardUserDefaults] objectForKey:@"defaultBright"] floatValue]; [kUserDefaults setObject:@"no" forKey:@"isNeedLight"];
NSUserDefaults *defaults = [NSUserDefaults standardUserDefaults];
[defaults setObject:@"0" forKey:@"isOnH5UsePage"];
if (defaultBright)
{
[[UIScreen mainScreen] setBrightness:defaultBright];
}
else
{
[[UIScreen mainScreen] setBrightness:0.5];
}
} }
- (void)didReceiveMemoryWarning { - (void)didReceiveMemoryWarning {
......
// //
...@@ -35,6 +35,19 @@ ...@@ -35,6 +35,19 @@
[self setInfo]; [self setInfo];
} }
- (void)viewWillDisappear:(BOOL)animated {
[super viewWillDisappear:animated];
[[UIScreen mainScreen] setBrightness:[[kUserDefaults objectForKey:@"brightness"] floatValue]];//恢复
[kUserDefaults setObject:@"no" forKey:@"isNeedLight"];
}
- (void)viewWillAppear:(BOOL)animated {
[super viewWillAppear:animated];
CGFloat currentLight = [[UIScreen mainScreen] brightness];
[kUserDefaults setObject:@(currentLight) forKey:@"brightness"];
[[UIScreen mainScreen] setBrightness:1];//点亮
[kUserDefaults setObject:@"yes" forKey:@"isNeedLight"];
}
-(void)setInfo -(void)setInfo
{ {
_label5.text = [NSString stringWithFormat:@"购买时间:%@", self.ticketItem.addtime]; _label5.text = [NSString stringWithFormat:@"购买时间:%@", self.ticketItem.addtime];
......
// //
...@@ -117,7 +117,7 @@ ...@@ -117,7 +117,7 @@
- (void)viewDidLoad { - (void)viewDidLoad {
[super viewDidLoad]; [super viewDidLoad];
// self.navigationController.navigationBar.translucent = NO;
[self loadData]; [self loadData];
[self addGestureForTopView]; [self addGestureForTopView];
self.fetchTicketDeviceModel =[FetchTicketAndDevice new]; self.fetchTicketDeviceModel =[FetchTicketAndDevice new];
......
// //
...@@ -1206,39 +1206,39 @@ void ProviderReleaseData (void *info, const void *data, size_t size){ ...@@ -1206,39 +1206,39 @@ void ProviderReleaseData (void *info, const void *data, size_t size){
+(void) firstPageRefreshAddNotPayView:(UIView *) v { +(void) firstPageRefreshAddNotPayView:(UIView *) v {
//暂时注释掉 //暂时注释掉
if ([ZXPayManager sharedZXPayManager].notPayOrderView == nil) { // if ([ZXPayManager sharedZXPayManager].notPayOrderView == nil) {
UIView *notPayView; // UIView *notPayView;
CGFloat bottomMargin = 49; // CGFloat bottomMargin = 49;
if (iPhoneX) { // if (iPhoneX) {
bottomMargin = 83; // bottomMargin = 83;
} // }
notPayView = [[UIView alloc] init]; // notPayView = [[UIView alloc] init];
notPayView.backgroundColor = [UIColor whiteColor]; // notPayView.backgroundColor = [UIColor whiteColor];
[v addSubview:notPayView]; // [v addSubview:notPayView];
[notPayView mas_makeConstraints:^(MASConstraintMaker *make) { // [notPayView mas_makeConstraints:^(MASConstraintMaker *make) {
make.left.right.equalTo(v); // make.left.right.equalTo(v);
make.height.mas_equalTo(0 * k6Scale); // make.height.mas_equalTo(0 * k6Scale);
make.bottom.equalTo(v.mas_bottom).offset(-bottomMargin); // make.bottom.equalTo(v.mas_bottom).offset(-bottomMargin);
}]; // }];
[ZXPayManager sharedZXPayManager].notPayOrderView = notPayView; // [ZXPayManager sharedZXPayManager].notPayOrderView = notPayView;
[self createNotPayOrderView:notPayView];//创建广告view // [self createNotPayOrderView:notPayView];//创建广告view
} // }
if ([ZXNotPay findByCriteria:[NSString stringWithFormat:@"where userId = '%@'", CacheUserId]].count) { // if ([ZXNotPay findByCriteria:[NSString stringWithFormat:@"where userId = '%@'", CacheUserId]].count) {
ZXNotPay *m = [ZXNotPay findByCriteria:[NSString stringWithFormat:@"where userId = '%@'", CacheUserId]].lastObject; // ZXNotPay *m = [ZXNotPay findByCriteria:[NSString stringWithFormat:@"where userId = '%@'", CacheUserId]].lastObject;
[ZXPayManager sharedZXPayManager].orderId = m.orderId; // [ZXPayManager sharedZXPayManager].orderId = m.orderId;
if ([ZXPayManager sharedZXPayManager].notPayOrderView.subviews.count) { // if ([ZXPayManager sharedZXPayManager].notPayOrderView.subviews.count) {
dispatch_async(dispatch_get_main_queue(), ^{ // dispatch_async(dispatch_get_main_queue(), ^{
[[ZXPayManager sharedZXPayManager].notPayOrderView mas_updateConstraints:^(MASConstraintMaker *make) { // [[ZXPayManager sharedZXPayManager].notPayOrderView mas_updateConstraints:^(MASConstraintMaker *make) {
make.height.mas_equalTo(50); // make.height.mas_equalTo(50);
}]; // }];
}); // });
//
} else { // } else {
[self createNotPayOrderView:[ZXPayManager sharedZXPayManager].notPayOrderView]; // [self createNotPayOrderView:[ZXPayManager sharedZXPayManager].notPayOrderView];
} // }
} else { // } else {
[self createNotPayOrderView:[ZXPayManager sharedZXPayManager].notPayOrderView]; // [self createNotPayOrderView:[ZXPayManager sharedZXPayManager].notPayOrderView];
} // }
} }
......
// //
...@@ -183,8 +183,7 @@ ...@@ -183,8 +183,7 @@
if (self.cancelButtonWidth == 0) { // Just adapt iOS 11.2 if (self.cancelButtonWidth == 0) { // Just adapt iOS 11.2
[self viewDidLayoutSubviews]; [self viewDidLayoutSubviews];
} }
// self.navigationController.navigationBar.translucent = NO;
// Adjust the view according to the `navigationBar.translucent`
if (NO == self.navigationController.navigationBar.translucent) { if (NO == self.navigationController.navigationBar.translucent) {
self.baseSearchTableView.contentInset = UIEdgeInsetsMake(0, 0, self.view.py_y, 0); self.baseSearchTableView.contentInset = UIEdgeInsetsMake(0, 0, self.view.py_y, 0);
self.searchSuggestionVC.view.frame = CGRectMake(0, CGRectGetMaxY(self.navigationController.navigationBar.frame) - self.view.py_y, self.view.py_width, self.view.py_height + self.view.py_y); self.searchSuggestionVC.view.frame = CGRectMake(0, CGRectGetMaxY(self.navigationController.navigationBar.frame) - self.view.py_y, self.view.py_width, self.view.py_height + self.view.py_y);
...@@ -197,7 +196,6 @@ ...@@ -197,7 +196,6 @@
- (void)viewWillDisappear:(BOOL)animated - (void)viewWillDisappear:(BOOL)animated
{ {
[super viewWillDisappear:animated]; [super viewWillDisappear:animated];
// self.navigationController.navigationBar.translucent = NO;
[self.searchBar resignFirstResponder]; [self.searchBar resignFirstResponder];
} }
......
// //
...@@ -33,7 +33,7 @@ ...@@ -33,7 +33,7 @@
// _markVC.title = @"书签"; // _markVC.title = @"书签";
self.viewControllers = @[_catalogueVC]; self.viewControllers = @[_catalogueVC];
// self.tabBar.translucent = NO;
[self.tabBar setBarTintColor:READ_BACKGROUND_COLOC]; [self.tabBar setBarTintColor:READ_BACKGROUND_COLOC];
for (UITabBarItem *item in self.tabBar.items) { for (UITabBarItem *item in self.tabBar.items) {
[item setTitlePositionAdjustment:UIOffsetMake(0, -13)]; [item setTitlePositionAdjustment:UIOffsetMake(0, -13)];
......
// //
...@@ -116,15 +116,18 @@ ...@@ -116,15 +116,18 @@
[confirmBtn setTitleColor:[UIColor whiteColor] forState:UIControlStateNormal]; [confirmBtn setTitleColor:[UIColor whiteColor] forState:UIControlStateNormal];
confirmBtn.titleLabel.font = [UIFont systemFontOfSize:17.0]; confirmBtn.titleLabel.font = [UIFont systemFontOfSize:17.0];
[confirmBtn addTarget:self action:@selector(confirmBtnFuc) forControlEvents:UIControlEventTouchUpInside]; [confirmBtn addTarget:self action:@selector(confirmBtnFuc:) forControlEvents:UIControlEventTouchUpInside];
confirmBtn.layer.cornerRadius = 4.0; confirmBtn.layer.cornerRadius = 4.0;
[footerView addSubview:confirmBtn]; [footerView addSubview:confirmBtn];
self.myTableView.tableFooterView = footerView; self.myTableView.tableFooterView = footerView;
} }
#pragma mark - ========== 确定支付事件 ========== #pragma mark - ========== 确定支付事件 ==========
- (void) confirmBtnFuc { - (void) confirmBtnFuc:(UIButton *) sender {
sender.enabled = NO;
dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(2.0 * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{
sender.enabled = YES;
});
int callType = 1; int callType = 1;
BOOL isCanOpenYWT = [kApplication canOpenURL:[NSURL URLWithString:@"cmbmobilebank://"]]; BOOL isCanOpenYWT = [kApplication canOpenURL:[NSURL URLWithString:@"cmbmobilebank://"]];
if ([self.payType.payType isEqualToString:@"5"] && !isCanOpenYWT) { if ([self.payType.payType isEqualToString:@"5"] && !isCanOpenYWT) {
......
// //
...@@ -176,9 +176,11 @@ ...@@ -176,9 +176,11 @@
self.deviceAddressLabel.font = kFontSize(14 * k6Scale); self.deviceAddressLabel.font = kFontSize(14 * k6Scale);
[self.deviceAddressLabel mas_makeConstraints:^(MASConstraintMaker *make) { [self.deviceAddressLabel mas_makeConstraints:^(MASConstraintMaker *make) {
make.right.equalTo(self.contentView.mas_right).offset(-16 * k6Scale); make.right.equalTo(self.contentView.mas_right).offset(-16 * k6Scale);
make.left.equalTo(label7.mas_right).offset(10 * k6Scale);
make.centerY.equalTo(label7); make.centerY.equalTo(label7);
}]; }];
[label7 setContentCompressionResistancePriority:UILayoutPriorityRequired
forAxis:UILayoutConstraintAxisHorizontal];
UIImageView *line = [[UIImageView alloc] init]; UIImageView *line = [[UIImageView alloc] init];
[self.contentView addSubview:line]; [self.contentView addSubview:line];
......
// //
...@@ -172,8 +172,11 @@ ...@@ -172,8 +172,11 @@
self.deviceAddressLabel.font = kFontSize(14 * k6Scale); self.deviceAddressLabel.font = kFontSize(14 * k6Scale);
[self.deviceAddressLabel mas_makeConstraints:^(MASConstraintMaker *make) { [self.deviceAddressLabel mas_makeConstraints:^(MASConstraintMaker *make) {
make.right.equalTo(self.contentView.mas_right).offset(-16 * k6Scale); make.right.equalTo(self.contentView.mas_right).offset(-16 * k6Scale);
make.left.equalTo(label7.mas_right).offset(10 * k6Scale);
make.centerY.equalTo(label7); make.centerY.equalTo(label7);
}]; }];
[label7 setContentCompressionResistancePriority:UILayoutPriorityRequired
forAxis:UILayoutConstraintAxisHorizontal];
UIView *bottomView = [[UIView alloc] init]; UIView *bottomView = [[UIView alloc] init];
[self.contentView addSubview:bottomView]; [self.contentView addSubview:bottomView];
bottomView.backgroundColor = [UIColor whiteColor]; bottomView.backgroundColor = [UIColor whiteColor];
......
{
"images" : [
{
"idiom" : "universal",
"filename" : "ic_dingdan.png",
"scale" : "1x"
},
{
"idiom" : "universal",
"filename" : "ic_dingdan@2x.png",
"scale" : "2x"
},
{
"idiom" : "universal",
"filename" : "ic_dingdan@3x.png",
"scale" : "3x"
}
],
"info" : {
"version" : 1,
"author" : "xcode"
}
}
\ No newline at end of file
{
"images" : [
{
"idiom" : "universal",
"filename" : "ic_duocai.png",
"scale" : "1x"
},
{
"idiom" : "universal",
"filename" : "ic_duocai@2x.png",
"scale" : "2x"
},
{
"idiom" : "universal",
"filename" : "ic_duocai@3x.png",
"scale" : "3x"
}
],
"info" : {
"version" : 1,
"author" : "xcode"
}
}
\ No newline at end of file
{
"images" : [
{
"idiom" : "universal",
"filename" : "ic_fankui.png",
"scale" : "1x"
},
{
"idiom" : "universal",
"filename" : "ic_fankui@2x.png",
"scale" : "2x"
},
{
"idiom" : "universal",
"filename" : "ic_fankui@3x.png",
"scale" : "3x"
}
],
"info" : {
"version" : 1,
"author" : "xcode"
}
}
\ No newline at end of file
{
"images" : [
{
"idiom" : "universal",
"filename" : "ic_setting.png",
"scale" : "1x"
},
{
"idiom" : "universal",
"filename" : "ic_setting@2x.png",
"scale" : "2x"
},
{
"idiom" : "universal",
"filename" : "ic_setting@3x.png",
"scale" : "3x"
}
],
"info" : {
"version" : 1,
"author" : "xcode"
}
}
\ No newline at end of file
{
"images" : [
{
"idiom" : "universal",
"filename" : "ic_wode_boy.png",
"scale" : "1x"
},
{
"idiom" : "universal",
"filename" : "ic_wode_boy@2x.png",
"scale" : "2x"
},
{
"idiom" : "universal",
"filename" : "ic_wode_boy@3x.png",
"scale" : "3x"
}
],
"info" : {
"version" : 1,
"author" : "xcode"
}
}
\ No newline at end of file
{
"images" : [
{
"idiom" : "universal",
"filename" : "ic_wode_girl.png",
"scale" : "1x"
},
{
"idiom" : "universal",
"filename" : "ic_wode_girl@2x.png",
"scale" : "2x"
},
{
"idiom" : "universal",
"filename" : "ic_wode_girl@3x.png",
"scale" : "3x"
}
],
"info" : {
"version" : 1,
"author" : "xcode"
}
}
\ No newline at end of file
{
"images" : [
{
"idiom" : "universal",
"filename" : "ic_xiaoyuanka.png",
"scale" : "1x"
},
{
"idiom" : "universal",
"filename" : "ic_xiaoyuanka@2x.png",
"scale" : "2x"
},
{
"idiom" : "universal",
"filename" : "ic_xiaoyuanka@3x.png",
"scale" : "3x"
}
],
"info" : {
"version" : 1,
"author" : "xcode"
}
}
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment