mirror of
https://github.com/wu736139669/ManagerDemo.git
synced 2026-08-06 06:14:32 +00:00
增加一些接口
This commit is contained in:
@@ -193,6 +193,8 @@
|
||||
A9B9F14519AEF9BE001A1315 /* TableCellLineView.m in Sources */ = {isa = PBXBuildFile; fileRef = A9B9F14419AEF9BE001A1315 /* TableCellLineView.m */; };
|
||||
A9B9F14C19AF1493001A1315 /* OtherProductInfoViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = A9B9F14A19AF1493001A1315 /* OtherProductInfoViewController.m */; };
|
||||
A9B9F14D19AF1493001A1315 /* OtherProductInfoViewController.xib in Resources */ = {isa = PBXBuildFile; fileRef = A9B9F14B19AF1493001A1315 /* OtherProductInfoViewController.xib */; };
|
||||
A9BA324619D338C500B48A8F /* ModifyPassWordViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = A9BA324419D338C500B48A8F /* ModifyPassWordViewController.m */; };
|
||||
A9BA324719D338C500B48A8F /* ModifyPassWordViewController.xib in Resources */ = {isa = PBXBuildFile; fileRef = A9BA324519D338C500B48A8F /* ModifyPassWordViewController.xib */; };
|
||||
A9C053FE19AD706C002331A5 /* ToolBarView.m in Sources */ = {isa = PBXBuildFile; fileRef = A9C053FD19AD706C002331A5 /* ToolBarView.m */; };
|
||||
A9C0540519ADBCB2002331A5 /* FundProductInfoViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = A9C0540319ADBCB2002331A5 /* FundProductInfoViewController.m */; };
|
||||
A9C0540619ADBCB2002331A5 /* FundProductInfoViewController.xib in Resources */ = {isa = PBXBuildFile; fileRef = A9C0540419ADBCB2002331A5 /* FundProductInfoViewController.xib */; };
|
||||
@@ -514,6 +516,9 @@
|
||||
A9B9F14919AF1493001A1315 /* OtherProductInfoViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = OtherProductInfoViewController.h; sourceTree = "<group>"; };
|
||||
A9B9F14A19AF1493001A1315 /* OtherProductInfoViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = OtherProductInfoViewController.m; sourceTree = "<group>"; };
|
||||
A9B9F14B19AF1493001A1315 /* OtherProductInfoViewController.xib */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.xib; path = OtherProductInfoViewController.xib; sourceTree = "<group>"; };
|
||||
A9BA324319D338C500B48A8F /* ModifyPassWordViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ModifyPassWordViewController.h; sourceTree = "<group>"; };
|
||||
A9BA324419D338C500B48A8F /* ModifyPassWordViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ModifyPassWordViewController.m; sourceTree = "<group>"; };
|
||||
A9BA324519D338C500B48A8F /* ModifyPassWordViewController.xib */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.xib; path = ModifyPassWordViewController.xib; sourceTree = "<group>"; };
|
||||
A9C053FC19AD706C002331A5 /* ToolBarView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ToolBarView.h; sourceTree = "<group>"; };
|
||||
A9C053FD19AD706C002331A5 /* ToolBarView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ToolBarView.m; sourceTree = "<group>"; };
|
||||
A9C0540219ADBCB2002331A5 /* FundProductInfoViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = FundProductInfoViewController.h; sourceTree = "<group>"; };
|
||||
@@ -1136,6 +1141,9 @@
|
||||
A936792819D06A1B004F6EBE /* AuthenticationViewController.h */,
|
||||
A936792919D06A1B004F6EBE /* AuthenticationViewController.m */,
|
||||
A936792A19D06A1B004F6EBE /* AuthenticationViewController.xib */,
|
||||
A9BA324319D338C500B48A8F /* ModifyPassWordViewController.h */,
|
||||
A9BA324419D338C500B48A8F /* ModifyPassWordViewController.m */,
|
||||
A9BA324519D338C500B48A8F /* ModifyPassWordViewController.xib */,
|
||||
);
|
||||
path = LoginView;
|
||||
sourceTree = "<group>";
|
||||
@@ -1340,6 +1348,7 @@
|
||||
A9233E64199CA44700DA80D8 /* more_icon_5@2x.png in Resources */,
|
||||
A93320CD19C02F0B0090D640 /* WYDAmountViewController.xib in Resources */,
|
||||
A919056A19B07AAF002575DF /* pie_chart_arrow@2x.png in Resources */,
|
||||
A9BA324719D338C500B48A8F /* ModifyPassWordViewController.xib in Resources */,
|
||||
A99EBEBC19CBAFE3005E1AA0 /* Icon-114.png in Resources */,
|
||||
A9EAA052199879CC001A872A /* pie_chart_center@2x.png in Resources */,
|
||||
A9C69458199BD14D00B2CECE /* more_icon_10@2x.png in Resources */,
|
||||
@@ -1497,6 +1506,7 @@
|
||||
A9C0540519ADBCB2002331A5 /* FundProductInfoViewController.m in Sources */,
|
||||
A94FE51E199C9C3C00626DE5 /* MoveSocialCellView.m in Sources */,
|
||||
A93F8806199A077F00875287 /* OtherListViewController.m in Sources */,
|
||||
A9BA324619D338C500B48A8F /* ModifyPassWordViewController.m in Sources */,
|
||||
A99FDB0A19CAC16E00D2B3D3 /* SetPassWordViewController.m in Sources */,
|
||||
A9AF6C2E199483520076C0EE /* MainViewController.m in Sources */,
|
||||
A9EE5EE719C20CDA004E7A2C /* WYDAmountTableViewCell.m in Sources */,
|
||||
|
||||
BIN
Binary file not shown.
@@ -70,30 +70,6 @@
|
||||
}
|
||||
-(void)loadDataWithDic:(NSDictionary *)dic withType:(NSString *)typeStr WithcompletionBlock:(CompletionBlock)completionBlock failedBlock:(FailedBlock)failedBlock
|
||||
{
|
||||
// DaiDaiTongApi* daiDaiTongApi = [DaiDaiTongApi shareInstance];
|
||||
// [daiDaiTongApi getListwithPageNum:_pageNum withType:typeStr withParam:dic withCompletionBlock:^(id jsonRes) {
|
||||
// if ([[jsonRes objectForKey:@"succ"] integerValue] == 1) {
|
||||
// if (_pageNum == 1) {
|
||||
// [_infoArray removeAllObjects];
|
||||
// [self.tableView addFooterWithTarget:self action:@selector(footerRereshing)];
|
||||
// }
|
||||
// if ([[jsonRes objectForKey:@"totalPages"] integerValue] <= [[jsonRes objectForKey:@"pageNum"] integerValue]) {
|
||||
// [self.tableView removeFooter];
|
||||
// }
|
||||
// completionBlock(jsonRes);
|
||||
// [self.tableView reloadData];
|
||||
// }else{
|
||||
// [MBProgressHUD errorHudWithView:nil label:[jsonRes objectForKey:@"err_msg"] hidesAfter:0.5];
|
||||
// }
|
||||
// [self headerEndRefreshing];
|
||||
// [self footerEndRefreshing];
|
||||
//
|
||||
// } failedBlock:^(NSError *error) {
|
||||
// [MBProgressHUD errorHudWithView:self.view label:@"网络出错" hidesAfter:1.0];
|
||||
// [self headerEndRefreshing];
|
||||
// [self footerEndRefreshing];
|
||||
// failedBlock(error);
|
||||
// }];
|
||||
|
||||
DaiDaiTongTestApi* daiDaiTongTestApi = [DaiDaiTongTestApi shareInstance];
|
||||
[daiDaiTongTestApi getApiWithParam:[NSDictionary dictionaryWithObjectsAndKeys:[NSNumber numberWithInteger:_pageNum],@"pageNum", nil] withApiType:typeStr completionBlock:^(id jsonRes) {
|
||||
|
||||
@@ -17,6 +17,7 @@
|
||||
@property (strong, nonatomic)NSString* phoneNum;
|
||||
@property (weak, nonatomic) IBOutlet UITextField *passwordTextField;
|
||||
|
||||
- (IBAction)forgetBtnClick:(id)sender;
|
||||
@property (weak, nonatomic) IBOutlet UIButton *sureBtn;
|
||||
@property (weak, nonatomic) IBOutlet UIUnderlinedButton *forgetBtn;
|
||||
- (IBAction)login:(id)sender;
|
||||
|
||||
@@ -7,6 +7,7 @@
|
||||
//
|
||||
|
||||
#import "InputPassWordViewController.h"
|
||||
#import "ModifyPassWordViewController.h"
|
||||
@interface InputPassWordViewController ()
|
||||
|
||||
@end
|
||||
@@ -74,4 +75,11 @@
|
||||
}];
|
||||
}
|
||||
}
|
||||
- (IBAction)forgetBtnClick:(id)sender {
|
||||
ModifyPassWordViewController* modifyPassWordViewController = [[ModifyPassWordViewController alloc] init];
|
||||
modifyPassWordViewController.type = 0;
|
||||
modifyPassWordViewController.phoneNum = _phoneNum;
|
||||
modifyPassWordViewController.hidesBottomBarWhenPushed = YES;
|
||||
[self.navigationController pushViewController:modifyPassWordViewController animated:YES];
|
||||
}
|
||||
@end
|
||||
|
||||
@@ -41,6 +41,9 @@
|
||||
<state key="normal" title="忘记密码">
|
||||
<color key="titleShadowColor" white="0.5" alpha="1" colorSpace="calibratedWhite"/>
|
||||
</state>
|
||||
<connections>
|
||||
<action selector="forgetBtnClick:" destination="-1" eventType="touchUpInside" id="1El-GG-ikn"/>
|
||||
</connections>
|
||||
</button>
|
||||
</subviews>
|
||||
<color key="backgroundColor" white="1" alpha="1" colorSpace="custom" customColorSpace="calibratedWhite"/>
|
||||
|
||||
@@ -126,8 +126,9 @@
|
||||
if ([[jsonRes objectForKey:@"resultflag"] integerValue] == 1) {
|
||||
[MBProgressHUD errorHudWithView:self.view label:[jsonRes objectForKey:@"resultMsg"] hidesAfter:0.5];
|
||||
}else{
|
||||
[_timer fire];
|
||||
}
|
||||
_timer = [NSTimer scheduledTimerWithTimeInterval:1.0 target:self selector:@selector(reGetCodeTime) userInfo:nil repeats:YES];
|
||||
[_timer fire];
|
||||
} failedBlock:^(NSError *error) {
|
||||
|
||||
}];
|
||||
|
||||
@@ -0,0 +1,27 @@
|
||||
//
|
||||
// ModifyPassWordViewController.h
|
||||
// ManagerDemo
|
||||
//
|
||||
// Created by xmfish on 14-9-25.
|
||||
// Copyright (c) 2014年 ash. All rights reserved.
|
||||
//
|
||||
|
||||
#import <UIKit/UIKit.h>
|
||||
|
||||
@interface ModifyPassWordViewController : UIViewController<UITextFieldDelegate>
|
||||
{
|
||||
NSInteger _type;
|
||||
NSString* _phoneNum;
|
||||
}
|
||||
@property (strong, nonatomic)NSString* phoneNum;
|
||||
@property (weak, nonatomic) IBOutlet UITextField *nameTextFiel;
|
||||
@property (weak, nonatomic) IBOutlet UITextField *phoneTextField;
|
||||
@property (weak, nonatomic) IBOutlet UITextField *idCardTextField;
|
||||
@property (weak, nonatomic) IBOutlet UIButton *cmsBtn;
|
||||
- (IBAction)cmsBtnClick:(id)sender;
|
||||
@property (weak, nonatomic) IBOutlet UIView *blackGroudView;
|
||||
@property (weak, nonatomic) IBOutlet UITextField *cmsNumTextField;
|
||||
- (IBAction)nextBtnClick:(id)sender;
|
||||
@property (weak, nonatomic) IBOutlet UIButton *nextBtn;
|
||||
@property(assign, nonatomic)NSInteger type;
|
||||
@end
|
||||
@@ -0,0 +1,223 @@
|
||||
//
|
||||
// ModifyPassWordViewController.m
|
||||
// ManagerDemo
|
||||
//
|
||||
// Created by xmfish on 14-9-25.
|
||||
// Copyright (c) 2014年 ash. All rights reserved.
|
||||
//
|
||||
|
||||
#import "ModifyPassWordViewController.h"
|
||||
#import "SetPassWordViewController.h"
|
||||
@interface ModifyPassWordViewController ()
|
||||
{
|
||||
BOOL _isRealName;//是否实名
|
||||
NSTimer *_timer;
|
||||
NSInteger _timeSecond;
|
||||
}
|
||||
@end
|
||||
|
||||
@implementation ModifyPassWordViewController
|
||||
|
||||
- (id)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil
|
||||
{
|
||||
self = [super initWithNibName:nibNameOrNil bundle:nibBundleOrNil];
|
||||
if (self) {
|
||||
// Custom initialization
|
||||
}
|
||||
return self;
|
||||
}
|
||||
|
||||
- (void)viewDidLoad
|
||||
{
|
||||
[super viewDidLoad];
|
||||
// Do any additional setup after loading the view from its nib.
|
||||
_isRealName = YES;
|
||||
_timeSecond = 60;
|
||||
_cmsBtn.enabled = NO;
|
||||
[_cmsBtn setBackgroundImage:[ManagerUtil buttonImageFromColor:[UIColor lightGrayColor] withFrame:_cmsBtn.frame] forState:UIControlStateDisabled];
|
||||
|
||||
_nextBtn.enabled = NO;
|
||||
[_nextBtn setBackgroundImage:[ManagerUtil buttonImageFromColor:[UIColor lightGrayColor] withFrame:_nextBtn.frame] forState:UIControlStateDisabled];
|
||||
|
||||
_nameTextFiel.layer.masksToBounds=YES;
|
||||
_nameTextFiel.layer.borderColor = [[UIColor lightGrayColor]CGColor];
|
||||
_nameTextFiel.layer.borderWidth= 1.0f;
|
||||
_nameTextFiel.delegate = self;
|
||||
_nameTextFiel.clearButtonMode = UITextFieldViewModeWhileEditing;
|
||||
[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(textFieldTextDidChange:) name:UITextFieldTextDidChangeNotification object:_nameTextFiel];
|
||||
|
||||
_idCardTextField.layer.masksToBounds=YES;
|
||||
_idCardTextField.layer.borderColor = [[UIColor lightGrayColor]CGColor];
|
||||
_idCardTextField.layer.borderWidth= 1.0f;
|
||||
_idCardTextField.delegate = self;
|
||||
_idCardTextField.clearButtonMode = UITextFieldViewModeWhileEditing;
|
||||
[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(textFieldTextDidChange:) name:UITextFieldTextDidChangeNotification object:_idCardTextField];
|
||||
|
||||
_cmsNumTextField.layer.masksToBounds=YES;
|
||||
_cmsNumTextField.layer.borderColor = [[UIColor lightGrayColor]CGColor];
|
||||
_cmsNumTextField.layer.borderWidth= 1.0f;
|
||||
_cmsNumTextField.delegate = self;
|
||||
_cmsNumTextField.clearButtonMode = UITextFieldViewModeWhileEditing;
|
||||
[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(textFieldTextDidChange:) name:UITextFieldTextDidChangeNotification object:_cmsNumTextField];
|
||||
|
||||
_phoneTextField.text = _phoneNum;
|
||||
|
||||
_timer = [NSTimer scheduledTimerWithTimeInterval:1.0 target:self selector:@selector(reGetCodeTime) userInfo:nil repeats:YES];
|
||||
[_timer invalidate];
|
||||
[self realNameCheck];
|
||||
|
||||
}
|
||||
-(void)reGetCodeTime
|
||||
{
|
||||
if (_timeSecond > 0 && !_cmsBtn.enabled) {
|
||||
if (![_timer isValid]) {
|
||||
[_timer fire];
|
||||
}
|
||||
[_cmsBtn setTitle:[NSString stringWithFormat:@"%ld秒后重新获取",_timeSecond] forState:UIControlStateDisabled];
|
||||
_timeSecond--;
|
||||
}else{
|
||||
_cmsBtn.enabled = YES;
|
||||
_timeSecond = 60;
|
||||
[_timer invalidate];
|
||||
}
|
||||
}
|
||||
-(void)realNameCheck
|
||||
{
|
||||
DaiDaiTongTestApi* daiDaiTongTestApi = [DaiDaiTongTestApi shareInstance];
|
||||
[daiDaiTongTestApi getApiWithParam:[NSDictionary dictionaryWithObjectsAndKeys:_phoneNum,@"phoneNum", nil] withApiType:@"realNameCheck" completionBlock:^(id jsonRes) {
|
||||
[MBProgressHUD hideAllHUDsForView:self.view animated:YES];
|
||||
if ([[jsonRes objectForKey:@"resultflag"] integerValue] == 0) {
|
||||
}else if([[jsonRes objectForKey:@"resultflag"] integerValue] == 1){
|
||||
_nameTextFiel.hidden = YES;
|
||||
_idCardTextField.hidden = YES;
|
||||
CGRect frame = _blackGroudView.frame;
|
||||
frame.origin.y -= 100;
|
||||
_blackGroudView.frame = frame;
|
||||
_isRealName = NO;
|
||||
}else{
|
||||
[MBProgressHUD errorHudWithView:self.view label:[jsonRes objectForKey:@"resultMsg"] hidesAfter:0.5];
|
||||
}
|
||||
} failedBlock:^(NSError *error) {
|
||||
[MBProgressHUD errorHudWithView:self.view label:@"网络出错" hidesAfter:0.5];
|
||||
|
||||
}];
|
||||
}
|
||||
-(void)touchesBegan:(NSSet *)touches withEvent:(UIEvent *)event
|
||||
{
|
||||
|
||||
[super touchesMoved:touches withEvent:event];
|
||||
[_phoneTextField resignFirstResponder];
|
||||
[_nameTextFiel resignFirstResponder];
|
||||
[_idCardTextField resignFirstResponder];
|
||||
[_cmsNumTextField resignFirstResponder];
|
||||
// if (_phoneLabel.hidden == NO) {
|
||||
// _phoneLabel.hidden = YES;
|
||||
// CGRect frame = _infoView.frame;
|
||||
// frame.origin.y -= 40;
|
||||
// [UIView animateWithDuration:0.5 delay:0 options:0 animations:^(){
|
||||
// _infoView.frame = frame;
|
||||
// } completion:^(BOOL finished)
|
||||
// {
|
||||
//
|
||||
// }];
|
||||
// }
|
||||
}
|
||||
#pragma mark UITextFieldDelegate
|
||||
-(BOOL)textFieldShouldBeginEditing:(UITextField *)textField
|
||||
{
|
||||
_nameTextFiel.layer.borderColor = [[UIColor lightGrayColor]CGColor];
|
||||
_idCardTextField.layer.borderColor = [[UIColor lightGrayColor]CGColor];
|
||||
_cmsNumTextField.layer.borderColor = [[UIColor lightGrayColor]CGColor];
|
||||
textField.layer.borderColor = [[UIColor orangeColor]CGColor];
|
||||
return YES;
|
||||
}
|
||||
- (BOOL)textField:(UITextField *)textField shouldChangeCharactersInRange:(NSRange)range replacementString:(NSString *)string
|
||||
{
|
||||
if (_idCardTextField.text.length>=18 && _idCardTextField == textField) {
|
||||
return NO;
|
||||
}
|
||||
return YES;
|
||||
}
|
||||
-(void)textFieldTextDidChange:(NSNotification *)sender
|
||||
{
|
||||
|
||||
if (_isRealName) {
|
||||
if (_nameTextFiel.text.length>0 && _idCardTextField.text.length>0) {
|
||||
_cmsBtn.enabled = YES;
|
||||
if (_cmsNumTextField.text.length>0) {
|
||||
_nextBtn.enabled = YES;
|
||||
}else{
|
||||
_nextBtn.enabled = NO;
|
||||
}
|
||||
}else{
|
||||
_cmsBtn.enabled = NO;
|
||||
_nextBtn.enabled = NO;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
-(BOOL)textFieldShouldEndEditing:(UITextField *)textField
|
||||
{
|
||||
|
||||
return YES;
|
||||
}
|
||||
|
||||
- (void)didReceiveMemoryWarning
|
||||
{
|
||||
[super didReceiveMemoryWarning];
|
||||
// Dispose of any resources that can be recreated.
|
||||
}
|
||||
|
||||
- (IBAction)cmsBtnClick:(id)sender {
|
||||
_cmsBtn.enabled = NO;
|
||||
[MBProgressHUD hudWithView:self.view label:@"安全加载中"];
|
||||
DaiDaiTongTestApi* daiDaiTongTestApi = [DaiDaiTongTestApi shareInstance];
|
||||
NSDictionary* dic;
|
||||
if (_isRealName) {
|
||||
dic = [NSDictionary dictionaryWithObjectsAndKeys:_phoneNum,@"phoneNum",_idCardTextField.text,@"idcardNo", _nameTextFiel.text, @"realName", nil];
|
||||
}else{
|
||||
[NSDictionary dictionaryWithObjectsAndKeys:_phoneNum,@"phoneNum", nil];
|
||||
}
|
||||
[daiDaiTongTestApi getApiWithParam:dic withApiType:@"getVerCode" completionBlock:^(id jsonRes) {
|
||||
if ([[jsonRes objectForKey:@"resultflag"] integerValue] == 1) {
|
||||
[MBProgressHUD errorHudWithView:self.view label:[jsonRes objectForKey:@"resultMsg"] hidesAfter:0.5];
|
||||
}else{
|
||||
[MBProgressHUD hideAllHUDsForView:self.view animated:YES];
|
||||
[_cmsNumTextField becomeFirstResponder];
|
||||
_nameTextFiel.enabled = NO;
|
||||
_idCardTextField.enabled = NO;
|
||||
// [ManagerUser shareInstance].token = [jsonRes objectForKey:@"token"];
|
||||
}
|
||||
_timer = [NSTimer scheduledTimerWithTimeInterval:1.0 target:self selector:@selector(reGetCodeTime) userInfo:nil repeats:YES];
|
||||
[_timer fire];
|
||||
} failedBlock:^(NSError *error) {
|
||||
[MBProgressHUD errorHudWithView:self.view label:@"网络出错" hidesAfter:0.5];
|
||||
_timer = [NSTimer scheduledTimerWithTimeInterval:1.0 target:self selector:@selector(reGetCodeTime) userInfo:nil repeats:YES];
|
||||
[_timer fire];
|
||||
}];
|
||||
|
||||
}
|
||||
- (IBAction)nextBtnClick:(id)sender {
|
||||
|
||||
[MBProgressHUD hudWithView:self.view label:@"安全加载中"];
|
||||
DaiDaiTongTestApi* daiDaiTongTestApi = [DaiDaiTongTestApi shareInstance];
|
||||
|
||||
[daiDaiTongTestApi getApiWithParam:[NSDictionary dictionaryWithObjectsAndKeys:_cmsNumTextField.text,@"verCode", nil] withApiType:@"getVerCode" completionBlock:^(id jsonRes) {
|
||||
if ([[jsonRes objectForKey:@"resultflag"] integerValue] == 1) {
|
||||
[MBProgressHUD errorHudWithView:self.view label:[jsonRes objectForKey:@"resultMsg"] hidesAfter:0.5];
|
||||
}else{
|
||||
[MBProgressHUD hideAllHUDsForView:self.view animated:YES];
|
||||
if (_type == 0) {
|
||||
SetPassWordViewController* setPassWordViewController = [[SetPassWordViewController alloc] init];
|
||||
[self.navigationController pushViewController:setPassWordViewController animated:YES];
|
||||
}else{
|
||||
SetPassWordViewController* setPassWordViewController = [[SetPassWordViewController alloc] init];
|
||||
setPassWordViewController.type = 1;
|
||||
[self.navigationController pushViewController:setPassWordViewController animated:YES];
|
||||
}
|
||||
}
|
||||
} failedBlock:^(NSError *error) {
|
||||
[MBProgressHUD errorHudWithView:self.view label:@"网络出错" hidesAfter:0.5];
|
||||
}];
|
||||
}
|
||||
@end
|
||||
@@ -0,0 +1,88 @@
|
||||
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||
<document type="com.apple.InterfaceBuilder3.CocoaTouch.XIB" version="3.0" toolsVersion="5056" systemVersion="13E28" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES">
|
||||
<dependencies>
|
||||
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="3733"/>
|
||||
</dependencies>
|
||||
<objects>
|
||||
<placeholder placeholderIdentifier="IBFilesOwner" id="-1" userLabel="File's Owner" customClass="ModifyPassWordViewController">
|
||||
<connections>
|
||||
<outlet property="blackGroudView" destination="iXV-eh-jNr" id="eDY-3Z-tEg"/>
|
||||
<outlet property="cmsBtn" destination="Mnc-JV-36d" id="CAZ-a2-jpU"/>
|
||||
<outlet property="cmsNumTextField" destination="6bZ-wv-Ayz" id="sk5-qB-PW1"/>
|
||||
<outlet property="idCardTextField" destination="HnT-u2-4qv" id="x1C-t4-A3f"/>
|
||||
<outlet property="nameTextFiel" destination="D26-j2-ay9" id="sps-UP-3kT"/>
|
||||
<outlet property="nextBtn" destination="YJJ-rn-OXK" id="J9A-VV-REz"/>
|
||||
<outlet property="phoneTextField" destination="6Nn-bE-uWk" id="KlC-Vr-xht"/>
|
||||
<outlet property="view" destination="i5M-Pr-FkT" id="sfx-zR-JGt"/>
|
||||
</connections>
|
||||
</placeholder>
|
||||
<placeholder placeholderIdentifier="IBFirstResponder" id="-2" customClass="UIResponder"/>
|
||||
<view clearsContextBeforeDrawing="NO" contentMode="scaleToFill" id="i5M-Pr-FkT">
|
||||
<rect key="frame" x="0.0" y="0.0" width="320" height="568"/>
|
||||
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
|
||||
<subviews>
|
||||
<view contentMode="scaleToFill" fixedFrame="YES" translatesAutoresizingMaskIntoConstraints="NO" id="iXV-eh-jNr">
|
||||
<rect key="frame" x="0.0" y="54" width="320" height="568"/>
|
||||
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
|
||||
<subviews>
|
||||
<textField opaque="NO" clipsSubviews="YES" contentMode="scaleToFill" fixedFrame="YES" contentHorizontalAlignment="left" contentVerticalAlignment="center" borderStyle="line" placeholder="真实姓名" minimumFontSize="14" clearButtonMode="always" translatesAutoresizingMaskIntoConstraints="NO" id="D26-j2-ay9">
|
||||
<rect key="frame" x="9" y="20" width="300" height="40"/>
|
||||
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
|
||||
<fontDescription key="fontDescription" type="system" pointSize="14"/>
|
||||
<textInputTraits key="textInputTraits"/>
|
||||
</textField>
|
||||
<textField opaque="NO" clipsSubviews="YES" contentMode="scaleToFill" fixedFrame="YES" enabled="NO" contentHorizontalAlignment="left" contentVerticalAlignment="center" borderStyle="line" placeholder="手机号" minimumFontSize="14" translatesAutoresizingMaskIntoConstraints="NO" id="6Nn-bE-uWk">
|
||||
<rect key="frame" x="10" y="120" width="300" height="40"/>
|
||||
<autoresizingMask key="autoresizingMask" widthSizable="YES" flexibleMaxY="YES"/>
|
||||
<fontDescription key="fontDescription" type="system" pointSize="14"/>
|
||||
<textInputTraits key="textInputTraits" keyboardType="numberPad"/>
|
||||
</textField>
|
||||
<textField opaque="NO" clipsSubviews="YES" contentMode="scaleToFill" fixedFrame="YES" contentHorizontalAlignment="left" contentVerticalAlignment="center" borderStyle="line" placeholder="身份证号码" minimumFontSize="14" clearButtonMode="always" translatesAutoresizingMaskIntoConstraints="NO" id="HnT-u2-4qv">
|
||||
<rect key="frame" x="10" y="70" width="300" height="40"/>
|
||||
<autoresizingMask key="autoresizingMask" widthSizable="YES" flexibleMaxY="YES"/>
|
||||
<fontDescription key="fontDescription" type="system" pointSize="14"/>
|
||||
<textInputTraits key="textInputTraits" keyboardType="numberPad"/>
|
||||
</textField>
|
||||
<textField opaque="NO" clipsSubviews="YES" contentMode="scaleToFill" fixedFrame="YES" contentHorizontalAlignment="left" contentVerticalAlignment="center" borderStyle="line" placeholder="短信验证码" minimumFontSize="17" translatesAutoresizingMaskIntoConstraints="NO" id="6bZ-wv-Ayz">
|
||||
<rect key="frame" x="10" y="174" width="139" height="40"/>
|
||||
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
|
||||
<fontDescription key="fontDescription" type="system" pointSize="14"/>
|
||||
<textInputTraits key="textInputTraits" keyboardType="numberPad"/>
|
||||
</textField>
|
||||
<button opaque="NO" contentMode="scaleToFill" fixedFrame="YES" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="roundedRect" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="Mnc-JV-36d">
|
||||
<rect key="frame" x="166" y="174" width="143" height="40"/>
|
||||
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
|
||||
<color key="backgroundColor" red="1" green="0.0" blue="0.0" alpha="1" colorSpace="calibratedRGB"/>
|
||||
<fontDescription key="fontDescription" type="system" pointSize="14"/>
|
||||
<state key="normal" title="立即获取">
|
||||
<color key="titleColor" white="1" alpha="1" colorSpace="calibratedWhite"/>
|
||||
<color key="titleShadowColor" white="0.5" alpha="1" colorSpace="calibratedWhite"/>
|
||||
</state>
|
||||
<connections>
|
||||
<action selector="cmsBtnClick:" destination="-1" eventType="touchUpInside" id="PTR-oJ-wsJ"/>
|
||||
</connections>
|
||||
</button>
|
||||
<button opaque="NO" contentMode="scaleToFill" fixedFrame="YES" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="roundedRect" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="YJJ-rn-OXK">
|
||||
<rect key="frame" x="9" y="233" width="300" height="45"/>
|
||||
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
|
||||
<color key="backgroundColor" red="1" green="0.0" blue="0.0" alpha="1" colorSpace="calibratedRGB"/>
|
||||
<rect key="contentStretch" x="0.29999999999999999" y="0.29999999999999999" width="0.29999999999999999" height="0.29999999999999999"/>
|
||||
<state key="normal" title="下一步">
|
||||
<color key="titleColor" white="1" alpha="1" colorSpace="calibratedWhite"/>
|
||||
<color key="titleShadowColor" white="0.5" alpha="1" colorSpace="calibratedWhite"/>
|
||||
</state>
|
||||
<connections>
|
||||
<action selector="nextBtnClick:" destination="-1" eventType="touchUpInside" id="Ifh-dU-086"/>
|
||||
</connections>
|
||||
</button>
|
||||
</subviews>
|
||||
<color key="backgroundColor" white="1" alpha="1" colorSpace="custom" customColorSpace="calibratedWhite"/>
|
||||
</view>
|
||||
</subviews>
|
||||
<color key="backgroundColor" white="1" alpha="1" colorSpace="custom" customColorSpace="calibratedWhite"/>
|
||||
<simulatedStatusBarMetrics key="simulatedStatusBarMetrics"/>
|
||||
<simulatedNavigationBarMetrics key="simulatedTopBarMetrics" prompted="NO"/>
|
||||
<simulatedScreenMetrics key="simulatedDestinationMetrics" type="retina4"/>
|
||||
</view>
|
||||
</objects>
|
||||
</document>
|
||||
@@ -127,7 +127,7 @@
|
||||
[self.navigationController dismissViewControllerAnimated:YES completion:^{
|
||||
|
||||
}];
|
||||
[self.navigationController popViewControllerAnimated:YES];
|
||||
[self.navigationController popToRootViewControllerAnimated:YES];
|
||||
}
|
||||
} failedBlock:^(NSError *error) {
|
||||
|
||||
@@ -143,7 +143,9 @@
|
||||
[MBProgressHUD errorHudWithView:self.view label:[jsonRes objectForKey:@"resultMsg"] hidesAfter:0.5];
|
||||
}else{
|
||||
[[ManagerUser shareInstance] setTradePsw:_passWordTextField.text];
|
||||
[self.navigationController popViewControllerAnimated:YES];
|
||||
[self.navigationController dismissViewControllerAnimated:YES completion:^{
|
||||
}];
|
||||
[self.navigationController popToRootViewControllerAnimated:YES];
|
||||
}
|
||||
} failedBlock:^(NSError *error) {
|
||||
|
||||
|
||||
@@ -9,6 +9,14 @@
|
||||
#import "ViewController.h"
|
||||
|
||||
@interface AccountInfoViewController : ViewController<UITableViewDelegate, UITableViewDataSource>
|
||||
{
|
||||
NSString* _phoneNum;
|
||||
NSString* _name;
|
||||
NSString* _idCard;
|
||||
}
|
||||
@property (strong, nonatomic)NSString* phoneNum;
|
||||
@property (strong, nonatomic)NSString* name;
|
||||
@property (strong, nonatomic)NSString* idCard;
|
||||
@property (weak, nonatomic) IBOutlet UITableView *tableView;
|
||||
@property (weak, nonatomic) IBOutlet UIButton *topBtn;
|
||||
@property (weak, nonatomic) IBOutlet UIButton *bottomBtn;
|
||||
|
||||
@@ -8,6 +8,8 @@
|
||||
|
||||
#import "AccountInfoViewController.h"
|
||||
#import "SetPassWordViewController.h"
|
||||
#import "ModifyPassWordViewController.h"
|
||||
#import "AuthenticationViewController.h"
|
||||
@interface AccountInfoViewController ()
|
||||
{
|
||||
NSDictionary* _infoDic;
|
||||
@@ -35,7 +37,7 @@
|
||||
_tableView.dataSource = self;
|
||||
[_topBtn addTarget:self action:@selector(modifyLoginPassword:) forControlEvents:UIControlEventTouchUpInside];
|
||||
[_bottomBtn addTarget:self action:@selector(modifyTransactionsPassword:) forControlEvents:UIControlEventTouchUpInside];
|
||||
[self loadData];
|
||||
// [self loadData];
|
||||
}
|
||||
-(void)loadData
|
||||
{
|
||||
@@ -55,10 +57,7 @@
|
||||
#pragma mark UITableViewDelegate
|
||||
-(NSInteger)numberOfSectionsInTableView:(UITableView *)tableView
|
||||
{
|
||||
if (!_infoDic) {
|
||||
return 0;
|
||||
}
|
||||
return 5;
|
||||
return 4;
|
||||
}
|
||||
-(NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section
|
||||
{
|
||||
@@ -85,7 +84,7 @@
|
||||
}
|
||||
-(CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath
|
||||
{
|
||||
if (indexPath.section == 3) {
|
||||
if (indexPath.section == 2) {
|
||||
return 90;
|
||||
}
|
||||
return 44;
|
||||
@@ -111,7 +110,7 @@
|
||||
{
|
||||
cell.imageView.image = [UIImage imageNamed:@"icon_person_take_image"];
|
||||
cell.textLabel.text = @"账户";
|
||||
cell.detailTextLabel.text = [_infoDic objectForKey:@"cell"];
|
||||
cell.detailTextLabel.text = _phoneNum;
|
||||
cell.selectionStyle = UITableViewCellSelectionStyleNone;
|
||||
}
|
||||
break;
|
||||
@@ -121,25 +120,17 @@
|
||||
if (indexPath.row == 0) {
|
||||
cell.imageView.image = [UIImage imageNamed:@"icon_color_name"];
|
||||
cell.textLabel.text = @"实名认证";
|
||||
cell.detailTextLabel.text = [_infoDic objectForKey:@"realName"];
|
||||
cell.detailTextLabel.text = _name;
|
||||
}else{
|
||||
cell.imageView.image = [UIImage imageNamed:@"icon_color_idcard"];
|
||||
cell.textLabel.text = @"身份认证";
|
||||
cell.detailTextLabel.text = [_infoDic objectForKey:@"certNo"];
|
||||
cell.detailTextLabel.text = _idCard;
|
||||
}
|
||||
}
|
||||
|
||||
break;
|
||||
|
||||
case 2:
|
||||
{
|
||||
cell.imageView.image = [UIImage imageNamed:@"icon_color_bank"];
|
||||
cell.textLabel.text = @"银行卡管理";
|
||||
cell.accessoryType = UITableViewCellAccessoryDisclosureIndicator;
|
||||
cell.detailTextLabel.text = [NSString stringWithFormat:@"(%@)",[_infoDic objectForKey:@"cardNum"]];
|
||||
|
||||
}
|
||||
break;
|
||||
case 3:
|
||||
{
|
||||
_modifyInfoCell.selectionStyle = UITableViewCellSelectionStyleNone;
|
||||
[_topBtn setBackgroundImage:[ManagerUtil buttonImageFromColor:[UIColor lightGrayColor] withFrame:_topBtn.frame] forState:UIControlStateHighlighted];
|
||||
@@ -148,7 +139,7 @@
|
||||
return _modifyInfoCell;
|
||||
}
|
||||
break;
|
||||
case 4:
|
||||
case 3:
|
||||
{
|
||||
cell.selectionStyle = UITableViewCellSelectionStyleNone;
|
||||
cell.imageView.image = [UIImage imageNamed:@"hw_verifycard_info_icon"];
|
||||
@@ -158,6 +149,15 @@
|
||||
// [switchButton addTarget:self action:@selector(switchAction:) forControlEvents:UIControlEventValueChanged];
|
||||
cell.accessoryView = switchButton;
|
||||
|
||||
}
|
||||
break;
|
||||
case 4:
|
||||
{
|
||||
cell.imageView.image = [UIImage imageNamed:@"icon_color_bank"];
|
||||
cell.textLabel.text = @"银行卡管理";
|
||||
cell.accessoryType = UITableViewCellAccessoryDisclosureIndicator;
|
||||
cell.detailTextLabel.text = [NSString stringWithFormat:@"(%@)",[_infoDic objectForKey:@"cardNum"]];
|
||||
|
||||
}
|
||||
break;
|
||||
default:
|
||||
@@ -171,14 +171,24 @@
|
||||
}
|
||||
-(void)modifyLoginPassword:(id)sender
|
||||
{
|
||||
SetPassWordViewController* setPassWordViewController = [[SetPassWordViewController alloc] init];
|
||||
[self.navigationController pushViewController:setPassWordViewController animated:YES];
|
||||
ModifyPassWordViewController* modifyPassWordViewController = [[ModifyPassWordViewController alloc] init];
|
||||
modifyPassWordViewController.type = 0;
|
||||
modifyPassWordViewController.phoneNum = _phoneNum;
|
||||
[self.navigationController pushViewController:modifyPassWordViewController animated:YES];
|
||||
// SetPassWordViewController* setPassWordViewController = [[SetPassWordViewController alloc] init];
|
||||
// [self.navigationController pushViewController:setPassWordViewController animated:YES];
|
||||
}
|
||||
-(void)modifyTransactionsPassword:(id)sender
|
||||
{
|
||||
SetPassWordViewController* setPassWordViewController = [[SetPassWordViewController alloc] init];
|
||||
setPassWordViewController.type = 1;
|
||||
[self.navigationController pushViewController:setPassWordViewController animated:YES];
|
||||
ModifyPassWordViewController* modifyPassWordViewController = [[ModifyPassWordViewController alloc] init];
|
||||
modifyPassWordViewController.type = 1;
|
||||
modifyPassWordViewController.phoneNum = _phoneNum;
|
||||
[self.navigationController pushViewController:modifyPassWordViewController animated:YES];
|
||||
// AuthenticationViewController* authenticationViewController = [[AuthenticationViewController alloc] init];
|
||||
// [self.navigationController pushViewController:authenticationViewController animated:YES];
|
||||
// SetPassWordViewController* setPassWordViewController = [[SetPassWordViewController alloc] init];
|
||||
// setPassWordViewController.type = 1;
|
||||
// [self.navigationController pushViewController:setPassWordViewController animated:YES];
|
||||
}
|
||||
- (void)didReceiveMemoryWarning
|
||||
{
|
||||
|
||||
@@ -42,6 +42,7 @@
|
||||
<nil key="highlightedColor"/>
|
||||
</label>
|
||||
</subviews>
|
||||
<color key="backgroundColor" white="1" alpha="1" colorSpace="calibratedWhite"/>
|
||||
</tableViewCellContentView>
|
||||
<color key="backgroundColor" white="0.0" alpha="0.0" colorSpace="calibratedWhite"/>
|
||||
<connections>
|
||||
|
||||
@@ -11,6 +11,10 @@
|
||||
@interface DailyProfitViewController : BaseListViewController
|
||||
{
|
||||
NSString* _profitDate;
|
||||
float _totalProfit;
|
||||
NSInteger _type;
|
||||
}
|
||||
@property(assign, nonatomic)NSInteger type;
|
||||
@property(assign, nonatomic)float totalProfit;
|
||||
@property(strong, nonatomic)NSString* profitDate;
|
||||
@end
|
||||
|
||||
@@ -22,6 +22,7 @@
|
||||
self = [super initWithNibName:nibNameOrNil bundle:nibBundleOrNil];
|
||||
if (self) {
|
||||
// Custom initialization
|
||||
_type = 0;
|
||||
}
|
||||
return self;
|
||||
}
|
||||
@@ -31,21 +32,50 @@
|
||||
[super viewDidLoad];
|
||||
// Do any additional setup after loading the view.
|
||||
_topCell = [DatailProfitTopTableViewCell instance];
|
||||
self.navigationItem.title = @"每日收益";
|
||||
NSDate * senddate= [NSDate dateWithTimeIntervalSinceNow:-(24 * 60 * 60)];
|
||||
NSDateFormatter *dateformatter=[[NSDateFormatter alloc] init];
|
||||
[dateformatter setDateFormat:@"MM月dd日收益"];
|
||||
NSString * locationString=[dateformatter stringFromDate:senddate];
|
||||
|
||||
if (_type == 0) {
|
||||
self.navigationItem.title = locationString;
|
||||
}else{
|
||||
self.navigationItem.title = @"累计收益";
|
||||
}
|
||||
self.tableView.separatorStyle = UITableViewCellSeparatorStyleSingleLine;
|
||||
// [self headerBeginRefreshing];
|
||||
}
|
||||
-(void)loadDataWithDic:(NSDictionary *)dic withType:(NSString *)typeStr WithcompletionBlock:(CompletionBlock)completionBlock failedBlock:(FailedBlock)failedBlock
|
||||
{
|
||||
NSDictionary* tempDic = [[NSDictionary alloc] initWithObjectsAndKeys:_profitDate, @"profitDate", nil];
|
||||
[super loadDataWithDic:tempDic withType:@"profitDatedetail.do" WithcompletionBlock:^(id jsonRes){
|
||||
_topCell.profitLabel.text = [jsonRes objectForKey:@"dateProfit"];
|
||||
_topCell.timeLabel.text = [NSString stringWithFormat:@"%@收益(元)",[jsonRes objectForKey:@"profitShowDate"]];
|
||||
self.navigationItem.title = [NSString stringWithFormat:@"%@收益",[jsonRes objectForKey:@"profitShowDate"]];
|
||||
[_infoArray addObjectsFromArray:[jsonRes objectForKey:@"datas"]];
|
||||
}failedBlock:^(NSError *error){
|
||||
NSString* tempTypeStr = @"userTotalProfit";
|
||||
if (_type == 0) {
|
||||
tempTypeStr = @"userLastDayProfit";
|
||||
}
|
||||
[super loadDataWithDic:nil withType:tempTypeStr WithcompletionBlock:^(id jsonRes){
|
||||
|
||||
|
||||
if ([[jsonRes objectForKey:@"resultflag"] integerValue] == 0) {
|
||||
_topCell.profitLabel.text = [NSString stringWithFormat:@"%.2f",_totalProfit];
|
||||
|
||||
NSDate * senddate= [NSDate dateWithTimeIntervalSinceNow:-(24 * 60 * 60)];
|
||||
NSDateFormatter *dateformatter=[[NSDateFormatter alloc] init];
|
||||
[dateformatter setDateFormat:@"MM月dd日收益(元)"];
|
||||
NSString * locationString=[dateformatter stringFromDate:senddate];
|
||||
|
||||
if (_type == 0) {
|
||||
_topCell.timeLabel.text = locationString;
|
||||
}else{
|
||||
_topCell.timeLabel.text = @"稳赢贷累计收益";
|
||||
}
|
||||
|
||||
[_infoArray addObjectsFromArray:[jsonRes objectForKey:@"userProfits"]];
|
||||
}else{
|
||||
[MBProgressHUD errorHudWithView:self.view label:[jsonRes objectForKey:@"resultMsg"] hidesAfter:0.5];
|
||||
}
|
||||
}failedBlock:^(NSError *error){
|
||||
[MBProgressHUD errorHudWithView:self.view label:@"网络出错" hidesAfter:1.0];
|
||||
}];
|
||||
|
||||
}
|
||||
#pragma mark UITableViewDelegate
|
||||
-(NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section
|
||||
@@ -81,9 +111,13 @@
|
||||
if (indexPath.section == 0) {
|
||||
return _topCell;
|
||||
}
|
||||
cell.nameLabel.text = [[_infoArray objectAtIndex:indexPath.section-1] objectForKey:@"name"];
|
||||
cell.timeLabel.text = [[_infoArray objectAtIndex:indexPath.section-1] objectForKey:@"date"];
|
||||
cell.profitLabel.text = [[_infoArray objectAtIndex:indexPath.section-1] objectForKey:@"profit"];
|
||||
cell.nameLabel.text = [[_infoArray objectAtIndex:indexPath.section-1] objectForKeyWithoutNull:@"proName"];
|
||||
NSDate * senddate= [NSDate dateWithTimeIntervalSince1970:[[[_infoArray objectAtIndex:indexPath.section-1] objectForKeyWithoutNull:@"profitDate"] doubleValue]/1000];
|
||||
NSDateFormatter *dateformatter=[[NSDateFormatter alloc] init];
|
||||
[dateformatter setDateFormat:@"yyyy-MM-dd"];
|
||||
NSString * locationString=[dateformatter stringFromDate:senddate];
|
||||
cell.timeLabel.text = locationString;
|
||||
cell.profitLabel.text = [[_infoArray objectAtIndex:indexPath.section-1] objectForKeyWithoutNull:@"profitMoney"];
|
||||
return cell;
|
||||
}
|
||||
-(void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath
|
||||
|
||||
@@ -13,14 +13,14 @@
|
||||
<rect key="frame" x="0.0" y="0.0" width="320" height="89"/>
|
||||
<autoresizingMask key="autoresizingMask"/>
|
||||
<subviews>
|
||||
<label opaque="NO" clipsSubviews="YES" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" fixedFrame="YES" text="08月31日收益(元)" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="A7a-dh-9HW">
|
||||
<label opaque="NO" clipsSubviews="YES" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" fixedFrame="YES" text="" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="A7a-dh-9HW">
|
||||
<rect key="frame" x="10" y="14" width="290" height="21"/>
|
||||
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
|
||||
<fontDescription key="fontDescription" type="system" pointSize="14"/>
|
||||
<color key="textColor" white="0.66666666666666663" alpha="1" colorSpace="calibratedWhite"/>
|
||||
<nil key="highlightedColor"/>
|
||||
</label>
|
||||
<label opaque="NO" clipsSubviews="YES" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" fixedFrame="YES" text="0.03" textAlignment="right" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="6Iw-eX-jf5">
|
||||
<label opaque="NO" clipsSubviews="YES" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" fixedFrame="YES" text="" textAlignment="right" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="6Iw-eX-jf5">
|
||||
<rect key="frame" x="0.0" y="43" width="300" height="26"/>
|
||||
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
|
||||
<fontDescription key="fontDescription" type="system" pointSize="30"/>
|
||||
@@ -28,6 +28,7 @@
|
||||
<nil key="highlightedColor"/>
|
||||
</label>
|
||||
</subviews>
|
||||
<color key="backgroundColor" red="0.97560586729999998" green="0.97560586729999998" blue="0.97560586729999998" alpha="1" colorSpace="calibratedRGB"/>
|
||||
</tableViewCellContentView>
|
||||
<connections>
|
||||
<outlet property="profitLabel" destination="6Iw-eX-jf5" id="1c0-Xc-SnV"/>
|
||||
|
||||
@@ -31,7 +31,7 @@
|
||||
<rect key="frame" x="0.0" y="0.0" width="320" height="90"/>
|
||||
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
|
||||
<subviews>
|
||||
<label opaque="NO" clipsSubviews="YES" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="稳盈贷总资产(元)" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" id="T6x-E7-iLF">
|
||||
<label opaque="NO" clipsSubviews="YES" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="货币基金总资产(元)" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" id="T6x-E7-iLF">
|
||||
<rect key="frame" x="20" y="13" width="141" height="21"/>
|
||||
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
|
||||
<fontDescription key="fontDescription" type="system" pointSize="15"/>
|
||||
|
||||
@@ -11,7 +11,9 @@
|
||||
@interface MyHoldAmountViewController : UIViewController<QCSlideSwitchViewDelegate>
|
||||
{
|
||||
float _totalAmount;
|
||||
NSInteger _type;
|
||||
}
|
||||
@property (assign, nonatomic)NSInteger type;
|
||||
@property (assign, nonatomic)float totalAmount;
|
||||
@property (weak, nonatomic) IBOutlet QCSlideSwitchView *slideSwitchView;
|
||||
|
||||
|
||||
@@ -44,6 +44,7 @@
|
||||
_titleLabel.backgroundColor = [UIColor clearColor];
|
||||
_titleLabel.numberOfLines = 0;
|
||||
self.navigationItem.titleView = _titleLabel;
|
||||
_titleLabel.text = [NSString stringWithFormat:@"持有资产(元)\n%.2f",_totalAmount];
|
||||
[self initData];
|
||||
|
||||
}
|
||||
|
||||
@@ -32,7 +32,7 @@
|
||||
{
|
||||
[super viewDidLoad];
|
||||
// Do any additional setup after loading the view from its nib.
|
||||
|
||||
self.navigationItem.title = @"持有资产";
|
||||
_titleLabel = [[UILabel alloc] initWithFrame:CGRectMake(0, 0, 160, 49)];
|
||||
_titleLabel.textAlignment = NSTextAlignmentCenter;
|
||||
_titleLabel.backgroundColor = [UIColor clearColor];
|
||||
@@ -46,7 +46,28 @@
|
||||
_accBalanceView.wrapperColor = Touch_BackGroudColor;
|
||||
_accBalanceView.wrapperArcWidth = 5.0;
|
||||
_accBalanceView.progressArcWidth = 5.0;
|
||||
[self setTotalAmount:_totalAmount withHoldAmount:_holdAmount withAccBalance:_accBalance];
|
||||
|
||||
_holdAmountView.hidden = YES;
|
||||
_accBalanceView.hidden = YES;
|
||||
[self loadData];
|
||||
}
|
||||
-(void)loadData
|
||||
{
|
||||
DaiDaiTongTestApi* daiDaiTongTestApi = [DaiDaiTongTestApi shareInstance];
|
||||
[daiDaiTongTestApi getApiWithParam:nil withApiType:@"totalAssets" completionBlock:^(id jsonRes) {
|
||||
if ([[jsonRes objectForKey:@"resultflag"] integerValue] != 0) {
|
||||
[MBProgressHUD errorHudWithView:self.view label:[jsonRes objectForKey:@"resultMsg"] hidesAfter:1.0];
|
||||
|
||||
}else{
|
||||
[MBProgressHUD hideAllHUDsForView:self.view animated:YES];
|
||||
[self setTotalAmount:[[jsonRes objectForKey:@"totalAssets"] integerValue] withHoldAmount:[[jsonRes objectForKey:@"holdAssets"] integerValue] withAccBalance:[[jsonRes objectForKey:@"balance"] integerValue]];
|
||||
_holdAmountView.hidden = NO;
|
||||
_accBalanceView.hidden = NO;
|
||||
}
|
||||
} failedBlock:^(NSError *error) {
|
||||
[MBProgressHUD errorHudWithView:self.view label:@"网络出错" hidesAfter:1.0];
|
||||
}];
|
||||
|
||||
}
|
||||
-(void)setTotalAmount:(float)totalAmount withHoldAmount:(float)holdAmount withAccBalance:(float)accBalance
|
||||
{
|
||||
|
||||
@@ -11,6 +11,7 @@
|
||||
@protocol MyTotalProfitCellViewDelegate <NSObject>
|
||||
|
||||
-(void)totalMoneyClick;
|
||||
-(void)totalProfitClick;
|
||||
|
||||
@end
|
||||
@interface MyTotalProfitCellView : UIView
|
||||
|
||||
@@ -95,6 +95,8 @@
|
||||
}
|
||||
-(void)rightBtnClick:(id)sender
|
||||
{
|
||||
|
||||
if ([_delegate respondsToSelector:@selector(totalProfitClick)]) {
|
||||
[_delegate totalProfitClick];
|
||||
}
|
||||
}
|
||||
@end
|
||||
|
||||
@@ -68,7 +68,7 @@
|
||||
cell = (TransactionRecordsTableViewCell *)[tableView dequeueReusableCellWithIdentifier:dailyIncomeTableViewCell];
|
||||
}
|
||||
cell.nameLabel.text = [[_infoArray objectAtIndex:indexPath.section] objectForKey:@"proName"];
|
||||
cell.timeLabel.text = [ManagerUtil timeFromtimeSp:[[[_infoArray objectAtIndex:indexPath.section] objectForKey:@"tradeTime"] stringValue]];
|
||||
cell.timeLabel.text = [ManagerUtil timeFromtimeSp:[NSString stringWithFormat:@"%f",[[[_infoArray objectAtIndex:indexPath.section] objectForKey:@"tradeTime"] doubleValue]/1000.0]];
|
||||
cell.amountLabel.text = [NSString stringWithFormat:@"%.2f",[[[_infoArray objectAtIndex:indexPath.section] objectForKey:@"tradeMoney"] floatValue]];
|
||||
return cell;
|
||||
}
|
||||
|
||||
@@ -32,7 +32,7 @@
|
||||
<rect key="frame" x="0.0" y="0.0" width="320" height="90"/>
|
||||
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
|
||||
<subviews>
|
||||
<label opaque="NO" clipsSubviews="YES" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="货币基金总资产(元)" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" id="9gu-d3-HSc">
|
||||
<label opaque="NO" clipsSubviews="YES" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="稳赢贷总资产(元)" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" id="9gu-d3-HSc">
|
||||
<rect key="frame" x="20" y="13" width="141" height="21"/>
|
||||
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
|
||||
<fontDescription key="fontDescription" type="system" pointSize="15"/>
|
||||
|
||||
@@ -58,15 +58,22 @@
|
||||
_tableView.allowsSelection = YES;
|
||||
[_tableView addHeaderWithTarget:self action:@selector(headerRereshing)];
|
||||
[self headerRereshing];
|
||||
|
||||
[self.tableView headerBeginRefreshing];
|
||||
|
||||
}
|
||||
-(void)viewDidAppear:(BOOL)animated
|
||||
{
|
||||
[super viewDidAppear:animated];
|
||||
if (_myInfoDic == nil) {
|
||||
[self.tableView headerBeginRefreshing];
|
||||
}
|
||||
}
|
||||
#pragma mark MJRefreshDelegate
|
||||
- (void)headerRereshing
|
||||
{
|
||||
|
||||
DaiDaiTongTestApi* daiDaiTongTestApi = [DaiDaiTongTestApi shareInstance];
|
||||
[daiDaiTongTestApi getApiWithParam:nil withApiType:@"userMsg" completionBlock:^(id jsonRes) {
|
||||
[daiDaiTongTestApi getApiWithParam:nil withApiType:@"userAccount" completionBlock:^(id jsonRes) {
|
||||
if ([[jsonRes objectForKey:@"resultflag"] integerValue] != 0) {
|
||||
[MBProgressHUD errorHudWithView:self.view label:[jsonRes objectForKey:@"resultMsg"] hidesAfter:1.0];
|
||||
dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(1.0 * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{
|
||||
@@ -79,25 +86,29 @@
|
||||
|
||||
}
|
||||
[_tableView reloadData];
|
||||
[_tableView headerEndRefreshing];
|
||||
} failedBlock:^(NSError *error) {
|
||||
[_tableView reloadData];
|
||||
[_tableView headerEndRefreshing];
|
||||
[MBProgressHUD errorHudWithView:self.view label:@"网络出错" hidesAfter:0.5];
|
||||
}];
|
||||
|
||||
|
||||
[daiDaiTongTestApi getApiWithParam:nil withApiType:@"todayProfit" completionBlock:^(id jsonRes) {
|
||||
if ([[jsonRes objectForKey:@"resultflag"] integerValue] != 0) {
|
||||
[MBProgressHUD errorHudWithView:self.view label:[jsonRes objectForKey:@"resultMsg"] hidesAfter:0.5];
|
||||
}else{
|
||||
[MBProgressHUD hideAllHUDsForView:self.view animated:YES];
|
||||
_todayProfit = [[jsonRes objectForKey:@"todayProfit"] floatValue];
|
||||
|
||||
}
|
||||
[_tableView reloadData];
|
||||
[_tableView headerEndRefreshing];
|
||||
} failedBlock:^(NSError *error) {
|
||||
[MBProgressHUD errorHudWithView:self.view label:@"网络出错" hidesAfter:0.5];
|
||||
[_tableView reloadData];
|
||||
[_tableView headerEndRefreshing];
|
||||
}];
|
||||
// [daiDaiTongTestApi getApiWithParam:nil withApiType:@"todayProfit" completionBlock:^(id jsonRes) {
|
||||
// if ([[jsonRes objectForKey:@"resultflag"] integerValue] != 0) {
|
||||
// [MBProgressHUD errorHudWithView:self.view label:[jsonRes objectForKey:@"resultMsg"] hidesAfter:0.5];
|
||||
// }else{
|
||||
// [MBProgressHUD hideAllHUDsForView:self.view animated:YES];
|
||||
// _todayProfit = [[jsonRes objectForKey:@"todayProfit"] floatValue];
|
||||
//
|
||||
// }
|
||||
// [_tableView reloadData];
|
||||
// [_tableView headerEndRefreshing];
|
||||
// } failedBlock:^(NSError *error) {
|
||||
// [MBProgressHUD errorHudWithView:self.view label:@"网络出错" hidesAfter:0.5];
|
||||
// [_tableView reloadData];
|
||||
// [_tableView headerEndRefreshing];
|
||||
// }];
|
||||
}
|
||||
|
||||
- (void)footerRereshing
|
||||
@@ -147,7 +158,7 @@
|
||||
-(UITableViewCell*)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
|
||||
{
|
||||
|
||||
NSString* cellIdentifier = [NSString stringWithFormat:@"cell%d%d",indexPath.section,indexPath.row];
|
||||
NSString* cellIdentifier = [NSString stringWithFormat:@"cell%ld%ld",indexPath.section,indexPath.row];
|
||||
|
||||
UITableViewCell* cell = [tableView dequeueReusableCellWithIdentifier:cellIdentifier];
|
||||
if (!cell) {
|
||||
@@ -206,10 +217,10 @@
|
||||
switch (indexPath.section) {
|
||||
case 0:
|
||||
{
|
||||
cell.textLabel.text = [[_myInfoDic objectForKey:@"userMsg"] objectForKey:@"realName"];
|
||||
cell.textLabel.text = [_myInfoDic objectForKeyWithoutNull:@"realName"];
|
||||
cell.imageView.image = [UIImage imageNamed:@"icon_person_take_image"];
|
||||
cell.accessoryType = UITableViewCellAccessoryDisclosureIndicator;
|
||||
cell.detailTextLabel.text = [[_myInfoDic objectForKey:@"userMsg"] objectForKey:@"userName"];
|
||||
cell.detailTextLabel.text = [_myInfoDic objectForKeyWithoutNull:@"userName"];
|
||||
cell.selectedBackgroundView.backgroundColor = Touch_BackGroudColor;
|
||||
}
|
||||
break;
|
||||
@@ -217,24 +228,21 @@
|
||||
{
|
||||
NSDate * senddate= [NSDate dateWithTimeIntervalSinceNow:-(24 * 60 * 60)];
|
||||
NSDateFormatter *dateformatter=[[NSDateFormatter alloc] init];
|
||||
|
||||
[dateformatter setDateFormat:@"MM月dd日"];
|
||||
|
||||
NSString * locationString=[dateformatter stringFromDate:senddate];
|
||||
_timeLabel.text = [NSString stringWithFormat:@"%@收益(元)",locationString];
|
||||
_profitLabel.text = [NSString stringWithFormat:@"%.2f",_todayProfit];
|
||||
NSLog(@"%f",_todayProfit);
|
||||
_profitLabel.text = [NSString stringWithFormat:@"%.2f",[[_myInfoDic objectForKeyWithoutNull:@"lastDayProfit"] floatValue]];
|
||||
}
|
||||
break;
|
||||
case 2:
|
||||
{
|
||||
_myTotalProfitCellView.totalMoneyLabel.text = [[[_myInfoDic objectForKey:@"userMsg"] objectForKey:@"totalAssets"] stringValue];
|
||||
_myTotalProfitCellView.profitMoneyLabel.text = [[[_myInfoDic objectForKey:@"userMsg"] objectForKey:@"totalProfit"] stringValue];
|
||||
_myTotalProfitCellView.totalMoneyLabel.text = [_myInfoDic objectForKeyWithoutNull:@"totalAssets"] ;
|
||||
_myTotalProfitCellView.profitMoneyLabel.text = [_myInfoDic objectForKeyWithoutNull:@"totalProfit"];
|
||||
}
|
||||
break;
|
||||
case 4:
|
||||
{
|
||||
cell.detailTextLabel.text = [NSString stringWithFormat:@"%@分",[[[_myInfoDic objectForKey:@"userMsg"] objectForKey:@"totalIntegral"] stringValue]];
|
||||
cell.detailTextLabel.text = [NSString stringWithFormat:@"%@分",[_myInfoDic objectForKeyWithoutNull:@"totalIntegral"]];
|
||||
|
||||
}
|
||||
break;
|
||||
@@ -253,6 +261,9 @@
|
||||
case 0:
|
||||
{
|
||||
AccountInfoViewController* accountInfoViewController = [[AccountInfoViewController alloc] init];
|
||||
accountInfoViewController.name = [_myInfoDic objectForKey:@"realName"];
|
||||
accountInfoViewController.idCard = [_myInfoDic objectForKey:@"idcardNo"];
|
||||
accountInfoViewController.phoneNum = [_myInfoDic objectForKey:@"userName"];
|
||||
accountInfoViewController.hidesBottomBarWhenPushed = YES;
|
||||
[self.navigationController pushViewController:accountInfoViewController animated:YES];
|
||||
}
|
||||
@@ -261,7 +272,7 @@
|
||||
{
|
||||
DailyProfitViewController* dailyProfitViewController = [[DailyProfitViewController alloc] initWithNibName:@"BaseListViewController" bundle:nil];
|
||||
dailyProfitViewController.hidesBottomBarWhenPushed = YES;
|
||||
dailyProfitViewController.profitDate = [_myInfoDic objectForKey:@"profitDate"];
|
||||
dailyProfitViewController.totalProfit = [[_myInfoDic objectForKey:@"lastDayProfit"] floatValue];
|
||||
[self.navigationController pushViewController:dailyProfitViewController animated:YES];
|
||||
}
|
||||
break;
|
||||
@@ -281,9 +292,17 @@
|
||||
{
|
||||
MyTotalAmountViewController* myTotalAmountViewController = [[MyTotalAmountViewController alloc] init];
|
||||
myTotalAmountViewController.hidesBottomBarWhenPushed = YES;
|
||||
[myTotalAmountViewController setTotalAmount:[[_myInfoDic objectForKey:@"totalAmount"] floatValue] withHoldAmount:[[_myInfoDic objectForKey:@"holdAmount"] floatValue] withAccBalance:[[_myInfoDic objectForKey:@"accBalance"] floatValue]];
|
||||
// [myTotalAmountViewController setTotalAmount:[[_myInfoDic objectForKey:@"totalAmount"] floatValue] withHoldAmount:[[_myInfoDic objectForKey:@"holdAmount"] floatValue] withAccBalance:[[_myInfoDic objectForKey:@"accBalance"] floatValue]];
|
||||
[self.navigationController pushViewController:myTotalAmountViewController animated:YES];
|
||||
}
|
||||
-(void)totalProfitClick
|
||||
{
|
||||
DailyProfitViewController* dailyProfitViewController = [[DailyProfitViewController alloc] initWithNibName:@"BaseListViewController" bundle:nil];
|
||||
dailyProfitViewController.hidesBottomBarWhenPushed = YES;
|
||||
dailyProfitViewController.totalProfit = [[_myInfoDic objectForKey:@"totalProfit"] floatValue];
|
||||
dailyProfitViewController.type = 1;
|
||||
[self.navigationController pushViewController:dailyProfitViewController animated:YES];
|
||||
}
|
||||
#pragma mark - UIBarButtonClick 导航条两边按钮
|
||||
-(void)leftBarBtnClick:(id)sender
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user