Commit f3a97633 authored by 吕繁刚's avatar 吕繁刚 💬

提交

parent 7d10e1ad
...@@ -115,13 +115,45 @@ ...@@ -115,13 +115,45 @@
shouldBeEnabled = "Yes" shouldBeEnabled = "Yes"
ignoreCount = "0" ignoreCount = "0"
continueAfterRunningActions = "No" continueAfterRunningActions = "No"
filePath = "BenYueWallet/Class/home/Controller/SLHomeNewVC.m" filePath = "BenYueWallet/Tools/LLContactUtilies.m"
timestampString = "584601911.277411" timestampString = "584611878.873239"
startingColumnNumber = "9223372036854775807" startingColumnNumber = "9223372036854775807"
endingColumnNumber = "9223372036854775807" endingColumnNumber = "9223372036854775807"
startingLineNumber = "288" startingLineNumber = "47"
endingLineNumber = "288" endingLineNumber = "47"
landmarkName = "-layoutNoTest" landmarkName = "-checkAuthorizationStatusAndDeniedShowAlertWithController:CompleteContactInfo:"
landmarkType = "7">
</BreakpointContent>
</BreakpointProxy>
<BreakpointProxy
BreakpointExtensionID = "Xcode.Breakpoint.FileBreakpoint">
<BreakpointContent
shouldBeEnabled = "Yes"
ignoreCount = "0"
continueAfterRunningActions = "No"
filePath = "BenYueWallet/Tools/LLContactUtilies.m"
timestampString = "584611878.873286"
startingColumnNumber = "9223372036854775807"
endingColumnNumber = "9223372036854775807"
startingLineNumber = "37"
endingLineNumber = "37"
landmarkName = "-checkAuthorizationStatusAndDeniedShowAlertWithController:CompleteContactInfo:"
landmarkType = "7">
</BreakpointContent>
</BreakpointProxy>
<BreakpointProxy
BreakpointExtensionID = "Xcode.Breakpoint.FileBreakpoint">
<BreakpointContent
shouldBeEnabled = "Yes"
ignoreCount = "0"
continueAfterRunningActions = "No"
filePath = "BenYueWallet/Tools/LLContactUtilies.m"
timestampString = "584611878.8733259"
startingColumnNumber = "9223372036854775807"
endingColumnNumber = "9223372036854775807"
startingLineNumber = "34"
endingLineNumber = "34"
landmarkName = "-checkAuthorizationStatusAndDeniedShowAlertWithController:CompleteContactInfo:"
landmarkType = "7"> landmarkType = "7">
</BreakpointContent> </BreakpointContent>
</BreakpointProxy> </BreakpointProxy>
......
...@@ -31,6 +31,10 @@ ...@@ -31,6 +31,10 @@
#import "SLJiekuanViewController.h" #import "SLJiekuanViewController.h"
#import "SLMyAllBillViewController.h" #import "SLMyAllBillViewController.h"
#import <Contacts/Contacts.h>
#import <AssetsLibrary/AssetsLibrary.h>
//各种状态下子视图的标志 //各种状态下子视图的标志
#define OPERATE_SUBVIEW_NOTEST_VIEW_TAG 151 #define OPERATE_SUBVIEW_NOTEST_VIEW_TAG 151
#define OPERATE_SUBVIEW_TESTING_VIEW_TAG 152 #define OPERATE_SUBVIEW_TESTING_VIEW_TAG 152
...@@ -113,7 +117,7 @@ ...@@ -113,7 +117,7 @@
@property (nonatomic,strong) NSString * creatAmtStr;//信用额度 @property (nonatomic,strong) NSString * creatAmtStr;//信用额度
@property (nonatomic,strong) NSString * lilvStr;//贷款利率 @property (nonatomic,strong) NSString * lilvStr;//贷款利率
@property (nonatomic,strong) NSString * qixianDaysStr,* needPayMoneyStr;// 还款期限 距离还款日 @property (nonatomic,strong) NSString * qixianDaysStr,* needPayMoneyStr,*hasBorrowMoneyStr;// 还款期限 距离还款日 打款中申请额度
@property (nonatomic, strong) SLHomeModel *model; @property (nonatomic, strong) SLHomeModel *model;
...@@ -134,12 +138,13 @@ ...@@ -134,12 +138,13 @@
self.navigationBar.hidden = YES; self.navigationBar.hidden = YES;
_renzhengSuccess = NO; _renzhengSuccess = NO;
_renzhengDic = [NSMutableDictionary dictionary]; _renzhengDic = [NSMutableDictionary dictionary];
_contactAllArray = [NSMutableArray array];
[self createUI]; [self createUI];
if ([LLPasswordManagerUtilies getToken].length > 0) { if ([LLPasswordManagerUtilies getToken].length > 0) {
// 如果已登录,上传通讯录 // 如果已登录,上传通讯录
[self getContactInfo]; // [self getContactInfo];
} }
} }
...@@ -150,9 +155,17 @@ ...@@ -150,9 +155,17 @@
[self confirmBtnClick]; [self confirmBtnClick];
// [self referUserEDu]; // [self referUserEDu];
[self createNetwork]; [self createNetwork];
// [self getContactInfo];
[self requestContactAuthorAfterSystemVersion]; //上传通讯录
}else{ }else{
if (_backgroundView && _bottomView) { if (_backgroundView && _bottomView) {
[_scrollview removeAllSubviews]; [_scrollview removeAllSubviews];
__weak typeof (self) weakSelf = self;
_scrollview.mj_header = [MJRefreshNormalHeader headerWithRefreshingBlock:^{
[weakSelf confirmBtnClick];
}];
} }
[self layoutHeaderview]; [self layoutHeaderview];
...@@ -160,17 +173,29 @@ ...@@ -160,17 +173,29 @@
} }
} }
// 获取通讯录上传 // 获取通讯录上传
//- (void)getContactInfo{
// [self.contactUtilis checkAuthorizationStatusAndDeniedShowAlertWithController:nil CompleteContactInfo:^(NSMutableArray *contactArray) {
// //TODO: 把通讯录数据传给后台
// NSDictionary *dic = @{@"userPhoneLists" : contactArray};
//
// [[LLNetworkManagerTool sharedManager] postJsonWithUrlString:@"user/saveUserPhoneList" parameters:dic success:^(NSURLSessionDataTask * _Nonnull task, id _Nullable responseObject) {
// [USER_DEFAULT setBool:YES forKey:@"linkmanuploadsuccess"];
// [USER_DEFAULT synchronize];
// NSLog(@"上传成功");
// } failure:^(NSURLSessionDataTask * _Nonnull task, NSError * _Nonnull error) {
// }];
// }];
//}
- (void)getContactInfo{ - (void)getContactInfo{
[self.contactUtilis checkAuthorizationStatusAndDeniedShowAlertWithController:nil CompleteContactInfo:^(NSMutableArray *contactArray) {
//TODO: 把通讯录数据传给后台 //TODO: 把通讯录数据传给后台
NSDictionary *dic = @{@"userPhoneLists" : contactArray}; NSDictionary *dic = @{@"userPhoneLists" : _contactAllArray};
[[LLNetworkManagerTool sharedManager] postJsonWithUrlString:@"user/saveUserPhoneList" parameters:dic success:^(NSURLSessionDataTask * _Nonnull task, id _Nullable responseObject) { [[LLNetworkManagerTool sharedManager] postJsonWithUrlString:@"user/saveUserPhoneList" parameters:dic success:^(NSURLSessionDataTask * _Nonnull task, id _Nullable responseObject) {
[USER_DEFAULT setBool:YES forKey:@"linkmanuploadsuccess"]; [USER_DEFAULT setBool:YES forKey:@"linkmanuploadsuccess"];
[USER_DEFAULT synchronize]; [USER_DEFAULT synchronize];
NSLog(@"上传成功"); NSLog(@"上传成功");
} failure:^(NSURLSessionDataTask * _Nonnull task, NSError * _Nonnull error) { } failure:^(NSURLSessionDataTask * _Nonnull task, NSError * _Nonnull error) {
}];
}]; }];
} }
-(void)createNetwork{ -(void)createNetwork{
...@@ -271,19 +296,19 @@ ...@@ -271,19 +296,19 @@
-(void)layoutNoTest{ -(void)layoutNoTest{
if ([LLPasswordManagerUtilies getToken].length > 0) { // if ([LLPasswordManagerUtilies getToken].length > 0) {
if (_renzhengSuccess) { // if (_renzhengSuccess ) {
_eduLab.text = [NSString stringWithFormat:@"¥%@",_creatAmtStr]; // _eduLab.text = [NSString stringWithFormat:@"¥%@",_creatAmtStr];
// _lilvLab.text = [NSString stringWithFormat:@"贷款利率%@.00%%",_lilvStr]; //// _lilvLab.text = [NSString stringWithFormat:@"贷款利率%@.00%%",_lilvStr];
//
NSMutableAttributedString * str = [[NSMutableAttributedString alloc]initWithString:_eduLab.text]; // NSMutableAttributedString * str = [[NSMutableAttributedString alloc]initWithString:_eduLab.text];
[str addAttribute:NSFontAttributeName value:[UIFont systemFontOfSize:24*Iphone6_WIDE_SCALE] range:NSMakeRange(0,1)]; // [str addAttribute:NSFontAttributeName value:[UIFont systemFontOfSize:24*Iphone6_WIDE_SCALE] range:NSMakeRange(0,1)];
[str addAttribute:NSFontAttributeName value:[UIFont systemFontOfSize:50*Iphone6_WIDE_SCALE] range:NSMakeRange(1,str.length-1)]; // [str addAttribute:NSFontAttributeName value:[UIFont systemFontOfSize:50*Iphone6_WIDE_SCALE] range:NSMakeRange(1,str.length-1)];
_eduLab.attributedText = str; // _eduLab.attributedText = str;
//
return; // return;
} // }
} // }
if (_backgroundView && _bottomView) { if (_backgroundView && _bottomView) {
[_backgroundView removeFromSuperview]; [_backgroundView removeFromSuperview];
[_bottomView removeFromSuperview]; [_bottomView removeFromSuperview];
...@@ -318,6 +343,20 @@ ...@@ -318,6 +343,20 @@
make.centerX.equalTo(self.backgroundView); make.centerX.equalTo(self.backgroundView);
make.size.mas_equalTo(CGSizeMake(280, 56*Iphone6_HEIGHT_SCALE)); make.size.mas_equalTo(CGSizeMake(280, 56*Iphone6_HEIGHT_SCALE));
}]; }];
if ([LLPasswordManagerUtilies getToken].length > 0) {
if (_renzhengSuccess ) {
_eduLab.text = [NSString stringWithFormat:@"¥%@",_creatAmtStr];
// _lilvLab.text = [NSString stringWithFormat:@"贷款利率%@.00%%",_lilvStr];
NSMutableAttributedString * str = [[NSMutableAttributedString alloc]initWithString:_eduLab.text];
[str addAttribute:NSFontAttributeName value:[UIFont systemFontOfSize:24*Iphone6_WIDE_SCALE] range:NSMakeRange(0,1)];
[str addAttribute:NSFontAttributeName value:[UIFont systemFontOfSize:50*Iphone6_WIDE_SCALE] range:NSMakeRange(1,str.length-1)];
_eduLab.attributedText = str;
}
}
NSMutableAttributedString * str = [[NSMutableAttributedString alloc]initWithString:_eduLab.text]; NSMutableAttributedString * str = [[NSMutableAttributedString alloc]initWithString:_eduLab.text];
[str addAttribute:NSFontAttributeName value:[UIFont systemFontOfSize:24*Iphone6_WIDE_SCALE] range:NSMakeRange(0,1)]; [str addAttribute:NSFontAttributeName value:[UIFont systemFontOfSize:24*Iphone6_WIDE_SCALE] range:NSMakeRange(0,1)];
[str addAttribute:NSFontAttributeName value:[UIFont systemFontOfSize:50*Iphone6_WIDE_SCALE] range:NSMakeRange(1,str.length-1)]; [str addAttribute:NSFontAttributeName value:[UIFont systemFontOfSize:50*Iphone6_WIDE_SCALE] range:NSMakeRange(1,str.length-1)];
...@@ -401,7 +440,7 @@ ...@@ -401,7 +440,7 @@
}]; }];
} }
-(void)refuseUI{ -(void)refreshUISetView{ //刷新页面状态
[_backgroundView removeAllSubviews]; [_backgroundView removeAllSubviews];
[_bottomView removeAllSubviews]; [_bottomView removeAllSubviews];
...@@ -539,7 +578,9 @@ ...@@ -539,7 +578,9 @@
if(_orderStatusNum == 2 || _orderStatusNum ==8 || _orderStatusNum == 1){ // 打款中 if(_orderStatusNum == 2 || _orderStatusNum ==8 || _orderStatusNum == 1){ // 打款中
firstMutableLab.text = @"申请额度"; firstMutableLab.text = @"申请额度";
secondMutableLab.text = @"借款期限"; secondMutableLab.text = @"借款期限";
_eduLab.text = [NSString stringWithFormat:@"¥%@",_creatAmtStr]; // _eduLab.text = [NSString stringWithFormat:@"¥%@",_creatAmtStr];
CGFloat yhNum = [_hasBorrowMoneyStr floatValue];
_eduLab.text = [NSString stringWithFormat:@"¥%.2f",yhNum];
topImage.image = [UIImage imageNamed:@"payingStatus"]; topImage.image = [UIImage imageNamed:@"payingStatus"];
tipStatusLab.text = @"等候打款中"; tipStatusLab.text = @"等候打款中";
...@@ -551,7 +592,9 @@ ...@@ -551,7 +592,9 @@
} else if (_orderStatusNum == 6){ // 被拒绝 } else if (_orderStatusNum == 6){ // 被拒绝
firstMutableLab.text = @"申请额度"; firstMutableLab.text = @"申请额度";
secondMutableLab.text = @"借款期限"; secondMutableLab.text = @"借款期限";
_eduLab.text = [NSString stringWithFormat:@"¥%@",_creatAmtStr]; // _eduLab.text = [NSString stringWithFormat:@"¥%@",_creatAmtStr];
CGFloat yhNum = [_creatAmtStr floatValue];
_eduLab.text = [NSString stringWithFormat:@"¥%.2f",yhNum];
topImage.image = [UIImage imageNamed:@"refusedStatus"]; topImage.image = [UIImage imageNamed:@"refusedStatus"];
tipStatusLab.hidden = YES; tipStatusLab.hidden = YES;
...@@ -609,6 +652,7 @@ ...@@ -609,6 +652,7 @@
self.renzhengSuccess = YES; self.renzhengSuccess = YES;
} else { } else {
self.renzhengDic = responseObject; self.renzhengDic = responseObject;
self.renzhengSuccess = NO;
} }
[self referUserEDu]; [self referUserEDu];
} failure:^(NSURLSessionDataTask * _Nonnull task, NSError * _Nonnull error) { } failure:^(NSURLSessionDataTask * _Nonnull task, NSError * _Nonnull error) {
...@@ -632,7 +676,7 @@ ...@@ -632,7 +676,7 @@
if (self.renzhengSuccess) { if (self.renzhengSuccess) {
self.model = [SLHomeModel modelWithJSON:responseObject]; self.model = [SLHomeModel modelWithJSON:responseObject];
self.creatAmtStr = responseObject[@"maxBorrowMoney"]; self.creatAmtStr = responseObject[@"maxBorrowMoney"];
self.lilvStr = responseObject[@"msgAuthPercent"]; // self.lilvStr = responseObject[@"msgAuthPercent"];
} }
[self checkAllOrderIng]; [self checkAllOrderIng];
...@@ -661,7 +705,7 @@ ...@@ -661,7 +705,7 @@
NSInteger orderStatus = [dic[@"orderStatus"] integerValue]; NSInteger orderStatus = [dic[@"orderStatus"] integerValue];
self.orderStatusNum = orderStatus; self.orderStatusNum = orderStatus;
if(orderStatus == 2 || orderStatus == 2 || orderStatus ==8){ // 打款中 if(orderStatus == 1 || orderStatus == 2 || orderStatus ==8){ // 打款中
self.qixianDaysStr = dic[@"limitDays"]; self.qixianDaysStr = dic[@"limitDays"];
} else if (orderStatus == 3 || orderStatus == 9){ // 待还款 } else if (orderStatus == 3 || orderStatus == 9){ // 待还款
self.qixianDaysStr = dic[@"limitDays"]; self.qixianDaysStr = dic[@"limitDays"];
...@@ -673,8 +717,9 @@ ...@@ -673,8 +717,9 @@
} }
self.needPayMoneyStr = dic[@"needPayMoney"]; self.needPayMoneyStr = dic[@"needPayMoney"];
self.hasBorrowMoneyStr = dic[@"borrowMoney"];
[self refuseUI]; [self refreshUISetView];
} }
} failure:^(NSURLSessionDataTask * _Nonnull task, NSError * _Nonnull error) { } failure:^(NSURLSessionDataTask * _Nonnull task, NSError * _Nonnull error) {
...@@ -733,4 +778,108 @@ ...@@ -733,4 +778,108 @@
backView.layer.shadowRadius = cornerRadius; backView.layer.shadowRadius = cornerRadius;
} }
//请求通讯录权限
#pragma mark 请求通讯录权限
- (void)requestContactAuthorAfterSystemVersion{
CNAuthorizationStatus status = [CNContactStore authorizationStatusForEntityType:CNEntityTypeContacts];
if (status == CNAuthorizationStatusNotDetermined) {
CNContactStore *store = [[CNContactStore alloc] init];
[store requestAccessForEntityType:CNEntityTypeContacts completionHandler:^(BOOL granted, NSError* _Nullable error) {
if (error) {
NSLog(@"授权失败");
}else {
NSLog(@"成功授权");
[self openContact];
}
}];
}
else if(status == CNAuthorizationStatusRestricted)
{
NSLog(@"用户拒绝");
[self showAlertViewAboutNotAuthorAccessContact];
}
else if (status == CNAuthorizationStatusDenied)
{
NSLog(@"用户拒绝");
[self showAlertViewAboutNotAuthorAccessContact];
}
else if (status == CNAuthorizationStatusAuthorized)//已经授权
{
//有通讯录权限-- 进行下一步操作
[self openContact];
}
}
//有通讯录权限-- 进行下一步操作
- (void)openContact{
// 获取指定的字段,并不是要获取所有字段,需要指定具体的字段
NSArray *keysToFetch = @[CNContactGivenNameKey, CNContactFamilyNameKey, CNContactPhoneNumbersKey];
CNContactFetchRequest *fetchRequest = [[CNContactFetchRequest alloc] initWithKeysToFetch:keysToFetch];
CNContactStore *contactStore = [[CNContactStore alloc] init];
[_contactAllArray removeAllObjects];
__block typeof(self) weakSelf = self;
[contactStore enumerateContactsWithFetchRequest:fetchRequest error:nil usingBlock:^(CNContact * _Nonnull contact, BOOL * _Nonnull stop) {
// NSLog(@"-------------------------------------------------------");
// NSString *givenName = contact.givenName;
// NSString *familyName = contact.familyName;
// NSLog(@"givenName=%@, familyName=%@", givenName, familyName);
//拼接姓名
NSString *nameStr = [NSString stringWithFormat:@"%@%@",contact.familyName,contact.givenName];
NSArray *phoneNumbers = contact.phoneNumbers;
// CNPhoneNumber * cnphoneNumber = contact.phoneNumbers[0];
// NSString * phoneNumber = cnphoneNumber.stringValue;
NSDictionary * contactDict = [[NSDictionary alloc]init];
for (CNLabeledValue *labelValue in phoneNumbers) {
//遍历一个人名下的多个电话号码
CNPhoneNumber *phoneNumber = labelValue.value;
NSString * string = phoneNumber.stringValue ;
//去掉电话中的特殊字符
string = [string stringByReplacingOccurrencesOfString:@"+86" withString:@""];
string = [string stringByReplacingOccurrencesOfString:@"-" withString:@""];
string = [string stringByReplacingOccurrencesOfString:@"(" withString:@""];
string = [string stringByReplacingOccurrencesOfString:@")" withString:@""];
string = [string stringByReplacingOccurrencesOfString:@" " withString:@""];
string = [string stringByReplacingOccurrencesOfString:@" " withString:@""];
// NSLog(@"姓名=%@, 电话号码是=%@", nameStr, string);
// contactDict = @{@"linkerName":nameStr,@"linkerCell":string};
contactDict = @{@"personName":nameStr,@"personPhone":string};
// contactDict = @{nameStr:string};
// NSLog(@"***%@ ***",contactDict);
[weakSelf.contactAllArray addObject:contactDict];
}
}];
// NSLog(@"%@------%lu",self.contactAllArray,(unsigned long)self.contactAllArray.count);
NSString * tempString = [_contactAllArray componentsJoinedByString:@","];//分隔符逗号
[[NSUserDefaults standardUserDefaults] setObject:tempString forKey:BENYUE_USER_CONTACT]; // 存通讯录
[[NSUserDefaults standardUserDefaults] synchronize];// 强制立即存入沙盒
[self getContactInfo];
}
//提示没有通讯录权限
- (void)showAlertViewAboutNotAuthorAccessContact{
UIAlertController *alertController = [UIAlertController
alertControllerWithTitle:@"请先授权通讯录权限"
message:@"请在iPhone的\"设置-隐私-通讯录\"选项中,允许富贵钱包访问你的通讯录"
preferredStyle: UIAlertControllerStyleAlert];
UIAlertAction *OKAction = [UIAlertAction actionWithTitle:@"好的" style:UIAlertActionStyleDefault handler:nil];
[alertController addAction:OKAction];
[self presentViewController:alertController animated:YES completion:nil];
}
@end @end
...@@ -95,7 +95,7 @@ ...@@ -95,7 +95,7 @@
if (!_nextBtn) { if (!_nextBtn) {
// _nextBtn = [UIButton createButtonWithTitle:@"下一步" titleColor:[UIColor whiteColor] titleFont:[UIFont systemFontOfSize:18] normalBackgroundImage:[UIImage imageNamed:@"anniu"] disabledBackgroundImage:[UIImage imageNamed:@"灰色按钮"] target:self action:@selector(nextBtnClick)]; // _nextBtn = [UIButton createButtonWithTitle:@"下一步" titleColor:[UIColor whiteColor] titleFont:[UIFont systemFontOfSize:18] normalBackgroundImage:[UIImage imageNamed:@"anniu"] disabledBackgroundImage:[UIImage imageNamed:@"灰色按钮"] target:self action:@selector(nextBtnClick)];
_nextBtn = [UIButton createButtonWithTitle:@"下一步" titleColor:[UIColor whiteColor] titleFont:[UIFont systemFontOfSize:20*Iphone6_WIDE_SCALE] backgroundColor:BENYUE_NONMAL_BLUE cornerRadius:22 target:self action:@selector(nextBtnClick)]; _nextBtn = [UIButton createButtonWithTitle:@"完成" titleColor:[UIColor whiteColor] titleFont:[UIFont systemFontOfSize:20*Iphone6_WIDE_SCALE] backgroundColor:BENYUE_NONMAL_BLUE cornerRadius:22 target:self action:@selector(nextBtnClick)];
_nextBtn.frame = CGRectMake(60, self.pwdTF.bottom + 50, SCREEN_WIDTH - 120, 50); _nextBtn.frame = CGRectMake(60, self.pwdTF.bottom + 50, SCREEN_WIDTH - 120, 50);
} }
return _nextBtn; return _nextBtn;
......
...@@ -17,8 +17,7 @@ static NSString *chooseCellIdentifier = @"contactchoosecell"; ...@@ -17,8 +17,7 @@ static NSString *chooseCellIdentifier = @"contactchoosecell";
static NSString *tfCellIdentifier = @"contacttfcell"; static NSString *tfCellIdentifier = @"contacttfcell";
static NSString *phoneCellIdentifier = @"contactphonecell"; static NSString *phoneCellIdentifier = @"contactphonecell";
@interface SLContactViewController ()<UITableViewDelegate, UITableViewDataSource, LLLocationManagerDelegate> @interface SLContactViewController ()<UITableViewDelegate, UITableViewDataSource, LLLocationManagerDelegate>{
{
CGFloat _longitude; // 经度 CGFloat _longitude; // 经度
CGFloat _latitude; // 纬度 CGFloat _latitude; // 纬度
} }
...@@ -61,8 +60,7 @@ static NSString *phoneCellIdentifier = @"contactphonecell"; ...@@ -61,8 +60,7 @@ static NSString *phoneCellIdentifier = @"contactphonecell";
} }
// 获取通讯录上传 // 获取通讯录上传
- (void)getContactInfo - (void)getContactInfo{
{
[self.contactUtilis checkAuthorizationStatusAndDeniedShowAlertWithController:nil CompleteContactInfo:^(NSMutableArray *contactArray) { [self.contactUtilis checkAuthorizationStatusAndDeniedShowAlertWithController:nil CompleteContactInfo:^(NSMutableArray *contactArray) {
//TODO: 把通讯录数据传给后台 //TODO: 把通讯录数据传给后台
NSDictionary *dic = @{@"userPhoneLists" : contactArray}; NSDictionary *dic = @{@"userPhoneLists" : contactArray};
......
...@@ -23,7 +23,7 @@ ...@@ -23,7 +23,7 @@
_orderTypeLab.textColor = [UIColor colorWithHexString:@"#F5A623"]; _orderTypeLab.textColor = [UIColor colorWithHexString:@"#F5A623"];
} }
self.amountLab.text = [NSString stringWithFormat:@"%.2f",model.borrowMoney]; self.amountLab.text = [NSString stringWithFormat:@"%.2f",model.borrowMoney];
self.daysLab.text = [NSString stringWithFormat:@"%.2f",model.realPayMoney]; self.daysLab.text = [NSString stringWithFormat:@"%.2f",model.needPayMoney];
self.repaymentLab.text = model.limitDays; self.repaymentLab.text = model.limitDays;
} }
......
...@@ -18,16 +18,22 @@ ...@@ -18,16 +18,22 @@
_orderImageView.image = [UIImage imageNamed:@"orderDetOverdue"]; //u逾期还款 _orderImageView.image = [UIImage imageNamed:@"orderDetOverdue"]; //u逾期还款
_orderStatusLab.text = @"订单已逾期"; _orderStatusLab.text = @"订单已逾期";
_orderStatusLab.textColor = [UIColor colorWithHexString:@"#EB4542"]; _orderStatusLab.textColor = [UIColor colorWithHexString:@"#EB4542"];
_yuqiDaysLab.textColor = [UIColor colorWithHexString:@"#EB4542"];
_yuqiMoneyLab.textColor = [UIColor colorWithHexString:@"#EB4542"];
}else{ }else{
_orderImageView.image = [UIImage imageNamed:@"orderDetNormal"]; //正常还款 _orderImageView.image = [UIImage imageNamed:@"orderDetNormal"]; //正常还款
_orderStatusLab.text = @"订单已完成"; _orderStatusLab.text = @"订单已完成";
_orderStatusLab.textColor = [UIColor colorWithHexString:@"#20B759"]; _orderStatusLab.textColor = [UIColor colorWithHexString:@"#20B759"];
_yuqiMoneyLab.textColor = [UIColor colorWithHexString:@"#333333"];
_yuqiDaysLab.textColor = [UIColor colorWithHexString:@"#333333"];
} }
}else if ([dataArray[0] isEqualToString:@"6"]){ }else if ([dataArray[0] isEqualToString:@"6"]){
_orderImageView.image = [UIImage imageNamed:@"orderDetPass"]; //订单被拒 _orderImageView.image = [UIImage imageNamed:@"orderDetPass"]; //订单被拒
_orderStatusLab.text = @"审核未通过"; _orderStatusLab.text = @"审核未通过";
_orderStatusLab.textColor = [UIColor colorWithHexString:@"#F5A623"]; _orderStatusLab.textColor = [UIColor colorWithHexString:@"#F5A623"];
_yuqiMoneyLab.textColor = [UIColor colorWithHexString:@"#333333"];
_yuqiDaysLab.textColor = [UIColor colorWithHexString:@"#333333"];
} }
_orderNoLab.text = dataArray[2]; _orderNoLab.text = dataArray[2];
......
...@@ -32,6 +32,17 @@ ...@@ -32,6 +32,17 @@
_protocolLab.text = dataArray[4]; _protocolLab.text = dataArray[4];
CGFloat allMoney = [[NSString stringWithFormat:@"%@",dataArray[5]] floatValue]; CGFloat allMoney = [[NSString stringWithFormat:@"%@",dataArray[5]] floatValue];
_allMoneyLab.text = [NSString stringWithFormat:@"%.2f元",allMoney]; _allMoneyLab.text = [NSString stringWithFormat:@"%.2f元",allMoney];
NSInteger yuqiDays = [dataArray[2] integerValue];
if (yuqiDays > 0) {
_orderStatusLab.textColor = [UIColor colorWithHexString:@"#EB4542"];
_yuqiDaysLab.textColor = [UIColor colorWithHexString:@"#EB4542"];
_yuqiMoneyLab.textColor = [UIColor colorWithHexString:@"#EB4542"];
}else{
_orderStatusLab.textColor = [UIColor colorWithHexString:@"#333333"];
_yuqiDaysLab.textColor = [UIColor colorWithHexString:@"#333333"];
_yuqiMoneyLab.textColor = [UIColor colorWithHexString:@"#333333"];
}
} }
- (void)awakeFromNib { - (void)awakeFromNib {
......
...@@ -51,7 +51,7 @@ ...@@ -51,7 +51,7 @@
</label> </label>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="tsD-gV-cwG"> <label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="tsD-gV-cwG">
<rect key="frame" x="15" y="95" width="297" height="1"/> <rect key="frame" x="15" y="95" width="297" height="1"/>
<color key="backgroundColor" red="0.60784313729999995" green="0.60784313729999995" blue="0.60784313729999995" alpha="1" colorSpace="calibratedRGB"/> <color key="backgroundColor" red="0.95890945196151733" green="0.95963555574417114" blue="0.95902186632156372" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
<constraints> <constraints>
<constraint firstAttribute="height" constant="1" id="MFD-p5-hJm"/> <constraint firstAttribute="height" constant="1" id="MFD-p5-hJm"/>
</constraints> </constraints>
...@@ -79,7 +79,7 @@ ...@@ -79,7 +79,7 @@
</label> </label>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="xuz-h4-dgb"> <label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="xuz-h4-dgb">
<rect key="frame" x="15" y="258" width="297" height="1"/> <rect key="frame" x="15" y="258" width="297" height="1"/>
<color key="backgroundColor" white="0.66666666669999997" alpha="1" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/> <color key="backgroundColor" red="0.95890945196151733" green="0.95963555574417114" blue="0.95902186632156372" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
<constraints> <constraints>
<constraint firstAttribute="height" constant="1" id="ByB-Uj-0nm"/> <constraint firstAttribute="height" constant="1" id="ByB-Uj-0nm"/>
</constraints> </constraints>
......
...@@ -342,19 +342,22 @@ ...@@ -342,19 +342,22 @@
if (!self.isBind) { if (!self.isBind) {
[self confirmBindCard]; [self confirmBindCard];
} else { } else {
// 先解绑,再绑卡 // // 先解绑,再绑卡
dispatch_semaphore_t semaphore = dispatch_semaphore_create(0); // dispatch_semaphore_t semaphore = dispatch_semaphore_create(0);
dispatch_queue_global_t queue = dispatch_get_global_queue(0, 0); // dispatch_queue_global_t queue = dispatch_get_global_queue(0, 0);
dispatch_group_t group = dispatch_group_create(); // dispatch_group_t group = dispatch_group_create();
dispatch_group_async(group, queue, ^{ // dispatch_group_async(group, queue, ^{
[self unbindCardWithSemaphore:semaphore]; // [self unbindCardWithSemaphore:semaphore];
}); // });
dispatch_group_notify(group, queue, ^{ // dispatch_group_notify(group, queue, ^{
[self confirmBindCard]; // [self confirmBindCard];
}); // });
[self resetBindCard];
} }
} }
// 绑定银行卡 // 绑定银行卡
- (void)confirmBindCard{ - (void)confirmBindCard{
NSString * idStr = [USER_DEFAULT objectForKey:BENYUE_USER_ID_NUM]; NSString * idStr = [USER_DEFAULT objectForKey:BENYUE_USER_ID_NUM];
...@@ -374,10 +377,29 @@ ...@@ -374,10 +377,29 @@
} failure:^(NSURLSessionDataTask * _Nonnull task, NSError * _Nonnull error) { } failure:^(NSURLSessionDataTask * _Nonnull task, NSError * _Nonnull error) {
NSLog(@"绑卡失败"); NSLog(@"绑卡失败");
}]; }];
}
- (void)resetBindCard{
NSString * idStr = [USER_DEFAULT objectForKey:BENYUE_USER_ID_NUM];
__block __typeof(self) weakself = self;
NSDictionary * dict = @{@"bankCardNo":weakself.bankNumTF.text,
@"bankName":weakself.bankNameStr,
@"bankPhone":weakself.phoneNumTF.text,
@"userName":weakself.userNameLab.text,
@"idCardNo":idStr,
@"msgCode":weakself.smsNumTF.text};
[[LLNetworkManagerTool sharedManager] postJsonWithUrlString:@"userBank/changeBind" parameters:dict success:^(NSURLSessionDataTask * _Nonnull task, id _Nullable responseObject) {
NSLog(@"换绑成功");
[MBProgressHUD showAutoHideMessage:@"换绑成功"];
[[NSNotificationCenter defaultCenter] postNotificationName:changeVerifyStatus object:@(self.index)];
[self.navigationController popViewControllerAnimated:YES];
} failure:^(NSURLSessionDataTask * _Nonnull task, NSError * _Nonnull error) {
NSLog(@"换绑失败");
}];
} }
// 解绑银行卡 // 解绑银行卡
- (void)unbindCardWithSemaphore:(dispatch_semaphore_t)semaphore{ - (void)unbindCardWithSemaphore:(dispatch_semaphore_t)semaphore{
[[LLNetworkManagerTool sharedManager] requestMethod:POST urlString:@"userBank/unBind" parameters:nil success:^(NSURLSessionDataTask * _Nonnull task, id _Nullable responseObject) { [[LLNetworkManagerTool sharedManager] requestMethod:POST urlString:@"userBank/unBind" parameters:nil success:^(NSURLSessionDataTask * _Nonnull task, id _Nullable responseObject) {
......
...@@ -96,7 +96,11 @@ static NSString *labelCellIdentifier = @"finishOrderDetailCell"; ...@@ -96,7 +96,11 @@ static NSString *labelCellIdentifier = @"finishOrderDetailCell";
[self.dataArray addObject:self.model.gmtDatetime]; [self.dataArray addObject:self.model.gmtDatetime];
[self.dataArray addObject:[NSString stringWithFormat:@"%.2f元", self.model.needPayMoney]]; [self.dataArray addObject:[NSString stringWithFormat:@"%.2f元", self.model.needPayMoney]];
[self.dataArray addObject:self.model.limitPayTime]; [self.dataArray addObject:self.model.limitPayTime];
if (_model.realPayTime) {
[self.dataArray addObject:self.model.realPayTime]; [self.dataArray addObject:self.model.realPayTime];
}else{
[self.dataArray addObject:@""];
}
[self.dataArray addObject:[NSString stringWithFormat:@"%@天", self.model.overdueDays]]; [self.dataArray addObject:[NSString stringWithFormat:@"%@天", self.model.overdueDays]];
[self.dataArray addObject:[NSString stringWithFormat:@"%@元", self.model.overdueMoney]]; [self.dataArray addObject:[NSString stringWithFormat:@"%@元", self.model.overdueMoney]];
[self.dataArray addObject:[NSString stringWithFormat:@"%.2f元", self.model.realPayMoney]]; [self.dataArray addObject:[NSString stringWithFormat:@"%.2f元", self.model.realPayMoney]];
......
...@@ -149,6 +149,7 @@ ...@@ -149,6 +149,7 @@
[MBProgressHUD showAutoHideMessage:@"还款成功"]; [MBProgressHUD showAutoHideMessage:@"还款成功"];
[[SLLoginSingle sharedSingle].orderStatusSubject sendNext:@(YES)]; [[SLLoginSingle sharedSingle].orderStatusSubject sendNext:@(YES)];
[self.navigationController popToRootViewControllerAnimated:YES]; [self.navigationController popToRootViewControllerAnimated:YES];
self.navigationController.tabBarController.selectedIndex = 0;
} failure:^(NSURLSessionDataTask * _Nonnull task, NSError * _Nonnull error) { } failure:^(NSURLSessionDataTask * _Nonnull task, NSError * _Nonnull error) {
......
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