按照现有接口进行完善

This commit is contained in:
2014-09-22 23:47:25 +08:00
parent 30870c1ca1
commit 75269d1a20
32 changed files with 485 additions and 150 deletions
+16
View File
@@ -42,6 +42,8 @@
A93320D219C02F240090D640 /* FundAmountViewController.xib in Resources */ = {isa = PBXBuildFile; fileRef = A93320D019C02F240090D640 /* FundAmountViewController.xib */; };
A9354F5C19B870C700FDCB52 /* BaseListViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = A9354F5A19B870C700FDCB52 /* BaseListViewController.m */; };
A9354F5D19B870C700FDCB52 /* BaseListViewController.xib in Resources */ = {isa = PBXBuildFile; fileRef = A9354F5B19B870C700FDCB52 /* BaseListViewController.xib */; };
A936792B19D06A1B004F6EBE /* AuthenticationViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = A936792919D06A1B004F6EBE /* AuthenticationViewController.m */; };
A936792C19D06A1B004F6EBE /* AuthenticationViewController.xib in Resources */ = {isa = PBXBuildFile; fileRef = A936792A19D06A1B004F6EBE /* AuthenticationViewController.xib */; };
A93F87741999AA8300875287 /* ManagerUtil.m in Sources */ = {isa = PBXBuildFile; fileRef = A93F87731999AA8300875287 /* ManagerUtil.m */; };
A93F877C1999ACF600875287 /* MBProgressHUD+Util.m in Sources */ = {isa = PBXBuildFile; fileRef = A93F877B1999ACF600875287 /* MBProgressHUD+Util.m */; };
A93F87801999B92800875287 /* QCSlideSwitchView.m in Sources */ = {isa = PBXBuildFile; fileRef = A93F877F1999B92800875287 /* QCSlideSwitchView.m */; };
@@ -65,6 +67,7 @@
A95CEA4119B766F400D4605F /* MessageDetailViewController.xib in Resources */ = {isa = PBXBuildFile; fileRef = A95CEA3F19B766F400D4605F /* MessageDetailViewController.xib */; };
A95EAEE319C9BE2E00D1592B /* FundCaculateViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = A95EAEE119C9BE2E00D1592B /* FundCaculateViewController.m */; };
A95EAEE419C9BE2E00D1592B /* FundCaculateViewController.xib in Resources */ = {isa = PBXBuildFile; fileRef = A95EAEE219C9BE2E00D1592B /* FundCaculateViewController.xib */; };
A9623E2F19CBEB1A004F7D9D /* NSDictionary+ChangeNull.m in Sources */ = {isa = PBXBuildFile; fileRef = A9623E2E19CBEB1A004F7D9D /* NSDictionary+ChangeNull.m */; };
A96F2A7C199D008200608237 /* UIButton+Bootstrap.m in Sources */ = {isa = PBXBuildFile; fileRef = A96F2A7B199D008200608237 /* UIButton+Bootstrap.m */; };
A96F2A7F199D01C000608237 /* NSString+FontAwesome.m in Sources */ = {isa = PBXBuildFile; fileRef = A96F2A7E199D01C000608237 /* NSString+FontAwesome.m */; };
A97F9D1519B592E90073E7E6 /* get_ver_button_gry@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = A97F9D1219B592E90073E7E6 /* get_ver_button_gry@2x.png */; };
@@ -275,6 +278,9 @@
A9354F5919B870C700FDCB52 /* BaseListViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = BaseListViewController.h; sourceTree = "<group>"; };
A9354F5A19B870C700FDCB52 /* BaseListViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = BaseListViewController.m; sourceTree = "<group>"; };
A9354F5B19B870C700FDCB52 /* BaseListViewController.xib */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.xib; path = BaseListViewController.xib; sourceTree = "<group>"; };
A936792819D06A1B004F6EBE /* AuthenticationViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = AuthenticationViewController.h; sourceTree = "<group>"; };
A936792919D06A1B004F6EBE /* AuthenticationViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = AuthenticationViewController.m; sourceTree = "<group>"; };
A936792A19D06A1B004F6EBE /* AuthenticationViewController.xib */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.xib; path = AuthenticationViewController.xib; sourceTree = "<group>"; };
A93F87721999AA8300875287 /* ManagerUtil.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ManagerUtil.h; sourceTree = "<group>"; };
A93F87731999AA8300875287 /* ManagerUtil.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ManagerUtil.m; sourceTree = "<group>"; };
A93F877A1999AC9900875287 /* MBProgressHUD+Util.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "MBProgressHUD+Util.h"; sourceTree = "<group>"; };
@@ -312,6 +318,8 @@
A95EAEE019C9BE2E00D1592B /* FundCaculateViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = FundCaculateViewController.h; sourceTree = "<group>"; };
A95EAEE119C9BE2E00D1592B /* FundCaculateViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = FundCaculateViewController.m; sourceTree = "<group>"; };
A95EAEE219C9BE2E00D1592B /* FundCaculateViewController.xib */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.xib; path = FundCaculateViewController.xib; sourceTree = "<group>"; };
A9623E2D19CBEB1A004F7D9D /* NSDictionary+ChangeNull.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "NSDictionary+ChangeNull.h"; sourceTree = "<group>"; };
A9623E2E19CBEB1A004F7D9D /* NSDictionary+ChangeNull.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "NSDictionary+ChangeNull.m"; sourceTree = "<group>"; };
A96F2A7A199D008200608237 /* UIButton+Bootstrap.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "UIButton+Bootstrap.h"; sourceTree = "<group>"; };
A96F2A7B199D008200608237 /* UIButton+Bootstrap.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "UIButton+Bootstrap.m"; sourceTree = "<group>"; };
A96F2A7D199D01C000608237 /* NSString+FontAwesome.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "NSString+FontAwesome.h"; sourceTree = "<group>"; };
@@ -845,6 +853,8 @@
A93F87731999AA8300875287 /* ManagerUtil.m */,
A9EC95C119B55CF100681678 /* ManagerUser.h */,
A9EC95C219B55CF100681678 /* ManagerUser.m */,
A9623E2D19CBEB1A004F7D9D /* NSDictionary+ChangeNull.h */,
A9623E2E19CBEB1A004F7D9D /* NSDictionary+ChangeNull.m */,
);
path = Common;
sourceTree = "<group>";
@@ -1060,6 +1070,9 @@
A99FDB0719CAC16E00D2B3D3 /* SetPassWordViewController.h */,
A99FDB0819CAC16E00D2B3D3 /* SetPassWordViewController.m */,
A99FDB0919CAC16E00D2B3D3 /* SetPassWordViewController.xib */,
A936792819D06A1B004F6EBE /* AuthenticationViewController.h */,
A936792919D06A1B004F6EBE /* AuthenticationViewController.m */,
A936792A19D06A1B004F6EBE /* AuthenticationViewController.xib */,
);
path = LoginView;
sourceTree = "<group>";
@@ -1167,6 +1180,7 @@
A9EAA04019985EDE001A872A /* HomeMainView.xib in Resources */,
A988A902199A755300EB10AA /* FundListCell.xib in Resources */,
A9AF6C6919949CD30076C0EE /* icon_dock_session@2x.png in Resources */,
A936792C19D06A1B004F6EBE /* AuthenticationViewController.xib in Resources */,
A9AF6C5C19949CD30076C0EE /* icon_dock_forum_actived@2x.png in Resources */,
A9C2E4E519B6A0C900C659B3 /* icon_email@2x.png in Resources */,
A97F9D1E19B5931C0073E7E6 /* register_button_s@2x.png in Resources */,
@@ -1353,6 +1367,7 @@
A986269519B413D600FF9E2C /* DailyIncomeTableViewCell.m in Sources */,
A9A7948319C8AC4E00516C60 /* FundAmountTableViewCell.m in Sources */,
A986268A19B40AAC00FF9E2C /* SVModalWebViewController.m in Sources */,
A9623E2F19CBEB1A004F7D9D /* NSDictionary+ChangeNull.m in Sources */,
A9354F5C19B870C700FDCB52 /* BaseListViewController.m in Sources */,
A95CEA4019B766F400D4605F /* MessageDetailViewController.m in Sources */,
A96F2A7F199D01C000608237 /* NSString+FontAwesome.m in Sources */,
@@ -1378,6 +1393,7 @@
A97F9D2719B5974B0073E7E6 /* UIUnderlinedButton.m in Sources */,
A9AF6BFD19947DD00076C0EE /* AppDelegate.m in Sources */,
A9AF6C911994C5700076C0EE /* MJRefreshConst.m in Sources */,
A936792B19D06A1B004F6EBE /* AuthenticationViewController.m in Sources */,
A95CEA3419B754A800D4605F /* MessageCenterViewController.m in Sources */,
A9AF6C931994C5700076C0EE /* MJRefreshHeaderView.m in Sources */,
A95CEA3919B755C000D4605F /* MessageCenterTableViewCell.m in Sources */,
@@ -70,31 +70,57 @@
}
-(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) {
// 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) {
if ([[jsonRes objectForKey:@"resultflag"] integerValue] != 0) {
[MBProgressHUD errorHudWithView:self.view label:[jsonRes objectForKey:@"resultMsg"] hidesAfter:0.5];
}else{
[MBProgressHUD hideAllHUDsForView:self.view animated:YES];
// 刷新表格
if (_pageNum == 1) {
[_infoArray removeAllObjects];
[self.tableView addFooterWithTarget:self action:@selector(footerRereshing)];
}
if ([[jsonRes objectForKey:@"totalPages"] integerValue] <= [[jsonRes objectForKey:@"pageNum"] integerValue]) {
if ([[jsonRes objectForKey:@"totalNum"] integerValue] <= _pageNum*20) {
[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];
[MBProgressHUD errorHudWithView:self.view label:@"网络出错" hidesAfter:0.5];
[self headerEndRefreshing];
[self footerEndRefreshing];
failedBlock(error);
}];
}
#pragma mark UITableViewDelegate
@@ -18,7 +18,7 @@
<tableView clipsSubviews="YES" contentMode="scaleToFill" alwaysBounceVertical="YES" style="plain" separatorStyle="default" rowHeight="44" sectionHeaderHeight="22" sectionFooterHeight="22" id="yXs-Co-TeI">
<rect key="frame" x="0.0" y="0.0" width="320" height="568"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
<color key="backgroundColor" white="1" alpha="1" colorSpace="calibratedWhite"/>
<color key="backgroundColor" red="0.97560586729999998" green="0.97560586729999998" blue="0.97560586729999998" alpha="1" colorSpace="calibratedRGB"/>
</tableView>
</subviews>
<color key="backgroundColor" white="1" alpha="1" colorSpace="custom" customColorSpace="calibratedWhite"/>
@@ -0,0 +1,14 @@
//
// NSDictionary+ChangeNull.h
// ManagerDemo
//
// Created by xmfish on 14-9-19.
// Copyright (c) 2014年 ash. All rights reserved.
//
#import <Foundation/Foundation.h>
@interface NSDictionary (ChangeNull)
- (id)objectForKeyWithoutNull:(id)aKey;
@end
@@ -0,0 +1,24 @@
//
// NSDictionary+ChangeNull.m
// ManagerDemo
//
// Created by xmfish on 14-9-19.
// Copyright (c) 2014年 ash. All rights reserved.
//
#import "NSDictionary+ChangeNull.h"
@implementation NSDictionary (ChangeNull)
-(id)objectForKeyWithoutNull:(id)aKey
{
id result = [self objectForKey:aKey];
if ([result isKindOfClass:[NSNull class]]) {
result = @"";
}
if ([result isKindOfClass:[NSNumber class]]) {
return [result stringValue];
}
return result;
}
@end
+5 -5
View File
@@ -53,13 +53,13 @@
}
-(void)setInfoDic:(NSDictionary *)dic
{
self.productId = [dic objectForKey:@"jjdm"];
self.nameLabel.text = [dic objectForKey:@"jjmc"];
self.profitLabel.text = [NSString stringWithFormat:@"%@ + %@%%",[dic objectForKey:@"nhsy"],[dic objectForKey:@"fd"]];
self.totalLabel.text = [NSString stringWithFormat:@"已申购%@",[dic objectForKey:@"ygrs"]];
self.productId = [dic objectForKey:@"id"];
self.nameLabel.text = [dic objectForKey:@"proName"];
self.profitLabel.text = [NSString stringWithFormat:@"%.2f + %.2f%%",[[dic objectForKey:@"nhsy"] floatValue],[[dic objectForKeyWithoutNull:@"fd"] floatValue]];
self.totalLabel.text = [NSString stringWithFormat:@"已申购%.0f",[[dic objectForKeyWithoutNull:@"ygrs"] floatValue]];
self.priceLabel.text = [NSString stringWithFormat:@"%@元",[dic objectForKey:@"wfsy"]];
[self setLowestPriceWtihCount:[[dic objectForKey:@"startBuy"] integerValue]];
NSMutableString* timeStr = [[NSMutableString alloc] initWithString:[dic objectForKey:@"jjzq"]];
NSMutableString* timeStr = [[NSMutableString alloc] initWithString:@"随买随卖"];
[timeStr insertString:@"</span>" atIndex:1];
[timeStr insertString:@"<span style=\" color:green;\">" atIndex:0];
[self setBuyTypeWithString:timeStr];
@@ -33,19 +33,45 @@
#pragma mark MJRefreshDelegate
-(void)loadData
{
DaiDaiTongApi* daiDaiTongApi = [DaiDaiTongApi shareInstance];
[daiDaiTongApi productListForType:@"HW" withPageNum:_pageNum withCompletionBlock:^(id jsonRes) {
if ([[jsonRes objectForKey:@"succ"] integerValue] == 1) {
// DaiDaiTongApi* daiDaiTongApi = [DaiDaiTongApi shareInstance];
// [daiDaiTongApi productListForType:@"HW" withPageNum:_pageNum withCompletionBlock:^(id jsonRes) {
//
// if ([[jsonRes objectForKey:@"succ"] integerValue] == 1) {
// if (_pageNum == 1) {
// [_productInfoArray removeAllObjects];
// [self.tableView addFooterWithTarget:self action:@selector(footerRereshing)];
// }
// [_productInfoArray addObjectsFromArray:[jsonRes objectForKey:@"datas"]];
// // 刷新表格
// if ([[jsonRes objectForKey:@"totalPages"] integerValue] <= [[jsonRes objectForKey:@"pageNum"] integerValue]) {
// [self.tableView removeFooter];
// }
// [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];
// }];
DaiDaiTongTestApi* daiDaiTongTestApi = [DaiDaiTongTestApi shareInstance];
[daiDaiTongTestApi getApiWithParam:[NSDictionary dictionaryWithObjectsAndKeys:[NSNumber numberWithInteger:_pageNum],@"pageNum",@"JJ",@"type", nil] withApiType:@"proList" completionBlock:^(id jsonRes) {
if ([[jsonRes objectForKey:@"resultflag"] integerValue] == 0) {
if (_pageNum == 1) {
[_productInfoArray removeAllObjects];
[self.tableView addFooterWithTarget:self action:@selector(footerRereshing)];
}
[_productInfoArray addObjectsFromArray:[jsonRes objectForKey:@"datas"]];
[_productInfoArray addObjectsFromArray:[jsonRes objectForKey:@"proList"]];
// 刷新表格
if ([[jsonRes objectForKey:@"totalPages"] integerValue] <= [[jsonRes objectForKey:@"pageNum"] integerValue]) {
if ([[jsonRes objectForKey:@"totalNum"] integerValue] <= _pageNum*20) {
[self.tableView removeFooter];
}
[self.tableView reloadData];
}else{
[MBProgressHUD errorHudWithView:nil label:[jsonRes objectForKey:@"err_msg"] hidesAfter:0.5];
@@ -54,7 +80,7 @@
[self footerEndRefreshing];
} failedBlock:^(NSError *error) {
[MBProgressHUD errorHudWithView:self.view label:@"网络出错" hidesAfter:1.0];
[MBProgressHUD errorHudWithView:self.view label:@"网络出错" hidesAfter:0.5];
[self headerEndRefreshing];
[self footerEndRefreshing];
}];
@@ -63,7 +63,7 @@
// [self footerEndRefreshing];
// }];
DaiDaiTongTestApi* daiDaiTongTestApi = [DaiDaiTongTestApi shareInstance];
[daiDaiTongTestApi getApiWithParam:[NSDictionary dictionaryWithObjectsAndKeys:[NSNumber numberWithInteger:_pageNum],@"pageNum", nil] withApiType:@"proList" completionBlock:^(id jsonRes) {
[daiDaiTongTestApi getApiWithParam:[NSDictionary dictionaryWithObjectsAndKeys:[NSNumber numberWithInteger:_pageNum],@"pageNum",@"WYD",@"type", nil] withApiType:@"proList" completionBlock:^(id jsonRes) {
if ([[jsonRes objectForKey:@"resultflag"] integerValue] == 0) {
if (_pageNum == 1) {
[_productInfoArray removeAllObjects];
@@ -0,0 +1,17 @@
//
// AuthenticationViewController.h
// ManagerDemo
//
// Created by xmfish on 14-9-22.
// Copyright (c) 2014年 ash. All rights reserved.
//
#import <UIKit/UIKit.h>
@interface AuthenticationViewController : UIViewController<UITextFieldDelegate>
@property (weak, nonatomic) IBOutlet UITextField *nameTextFiel;
@property (weak, nonatomic) IBOutlet UITextField *numTextField;
@property (weak, nonatomic) IBOutlet UIButton *sureBtn;
- (IBAction)sureBtnClick:(id)sender;
@end
@@ -0,0 +1,117 @@
//
// AuthenticationViewController.m
// ManagerDemo
//
// Created by xmfish on 14-9-22.
// Copyright (c) 2014年 ash. All rights reserved.
//
#import "AuthenticationViewController.h"
@interface AuthenticationViewController ()
@end
@implementation AuthenticationViewController
- (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.
self.navigationItem.title = @"身份信息确认";
_nameTextFiel.leftViewMode = UITextFieldViewModeAlways;
_nameTextFiel.layer.masksToBounds=YES;
_nameTextFiel.layer.borderColor = [[UIColor lightGrayColor]CGColor];
_nameTextFiel.layer.borderWidth= 1.0f;
_nameTextFiel.clearButtonMode = UITextFieldViewModeWhileEditing;
[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(textFieldTextDidChange:) name:UITextFieldTextDidChangeNotification object:_nameTextFiel];
_nameTextFiel.delegate = self;
_numTextField.leftViewMode = UITextFieldViewModeAlways;
_numTextField.layer.masksToBounds=YES;
_numTextField.layer.borderColor = [[UIColor lightGrayColor]CGColor];
_numTextField.layer.borderWidth= 1.0f;
_numTextField.clearButtonMode = UITextFieldViewModeWhileEditing;
[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(textFieldTextDidChange:) name:UITextFieldTextDidChangeNotification object:_numTextField];
_numTextField.delegate = self;
_sureBtn.enabled = NO;
[_sureBtn setBackgroundImage:[ManagerUtil buttonImageFromColor:[UIColor lightGrayColor] withFrame:_sureBtn.frame] forState:UIControlStateDisabled];
}
-(void)touchesBegan:(NSSet *)touches withEvent:(UIEvent *)event
{
[super touchesMoved:touches withEvent:event];
[_nameTextFiel resignFirstResponder];
[_numTextField resignFirstResponder];
_nameTextFiel.layer.borderColor = [[UIColor grayColor] CGColor];
_numTextField.layer.borderColor = [[UIColor grayColor] CGColor];
}
#pragma mark UITextFieldDelegate
-(BOOL)textFieldShouldBeginEditing:(UITextField *)textField
{
_nameTextFiel.layer.borderColor = [[UIColor grayColor] CGColor];
_numTextField.layer.borderColor = [[UIColor grayColor] CGColor];
textField.layer.borderColor = [[UIColor orangeColor]CGColor];
return YES;
}
- (BOOL)textField:(UITextField *)textField shouldChangeCharactersInRange:(NSRange)range replacementString:(NSString *)string
{
if (range.location >= 18)
return NO; // return NO to not change text
return YES;
}
-(void)textFieldTextDidChange:(NSNotification *)sender
{
if (([_numTextField.text isEqualToString:@""] || [_nameTextFiel.text isEqualToString:@""] ) || _numTextField.text.length!=18) {
_sureBtn.enabled = NO;
}else{
_sureBtn.enabled = YES;
}
}
-(BOOL)textFieldShouldEndEditing:(UITextField *)textField
{
return YES;
}
- (void)didReceiveMemoryWarning
{
[super didReceiveMemoryWarning];
// Dispose of any resources that can be recreated.
}
- (IBAction)sureBtnClick:(id)sender {
[MBProgressHUD hudWithView:self.view label:@"安全加载中"];
DaiDaiTongTestApi* daiDaiTongTestApi = [DaiDaiTongTestApi shareInstance];
[daiDaiTongTestApi getApiWithParam:[NSDictionary dictionaryWithObjectsAndKeys:_nameTextFiel.text,@"realName",_numTextField.text,@"idcardNo", nil] withApiType:@"checkRealName" completionBlock:^(id jsonRes) {
[MBProgressHUD hideAllHUDsForView:self.view animated:YES];
if ([[jsonRes objectForKey:@"resultflag"] integerValue] == 1) {
[MBProgressHUD errorHudWithView:self.view label:[jsonRes objectForKey:@"resultMsg"] hidesAfter:1.0];
}else{
[self.navigationController popViewControllerAnimated:YES];
}
} failedBlock:^(NSError *error) {
[MBProgressHUD errorHudWithView:self.view label:@"网络出错" hidesAfter:1.0];
}];
}
@end
@@ -0,0 +1,57 @@
<?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">
<dependencies>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="3733"/>
</dependencies>
<objects>
<placeholder placeholderIdentifier="IBFilesOwner" id="-1" userLabel="File's Owner" customClass="AuthenticationViewController">
<connections>
<outlet property="nameTextFiel" destination="HzR-cA-16z" id="0wE-3q-mmZ"/>
<outlet property="numTextField" destination="hOz-kb-F4I" id="mht-Gd-fbH"/>
<outlet property="sureBtn" destination="bly-Bs-GdC" id="w9L-zP-RtM"/>
<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" flexibleMaxY="YES"/>
<subviews>
<label opaque="NO" clipsSubviews="YES" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="监管部门规定,购买理财产品需提供实名信息以确保投资安全" lineBreakMode="tailTruncation" numberOfLines="0" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" id="7qF-7l-Ygs">
<rect key="frame" x="20" y="20" width="280" height="42"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES" flexibleMaxY="YES"/>
<fontDescription key="fontDescription" type="system" pointSize="14"/>
<color key="textColor" white="0.33333333333333331" alpha="1" colorSpace="calibratedWhite"/>
<nil key="highlightedColor"/>
</label>
<textField opaque="NO" clipsSubviews="YES" contentMode="scaleToFill" contentHorizontalAlignment="left" contentVerticalAlignment="center" borderStyle="line" placeholder="请填写18位身份证好吗" minimumFontSize="17" id="hOz-kb-F4I">
<rect key="frame" x="15" y="122" width="280" height="44"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES" flexibleMaxY="YES"/>
<fontDescription key="fontDescription" type="system" pointSize="14"/>
<textInputTraits key="textInputTraits" keyboardType="numberPad"/>
</textField>
<textField opaque="NO" clipsSubviews="YES" contentMode="scaleToFill" contentHorizontalAlignment="left" contentVerticalAlignment="center" borderStyle="line" placeholder="请填写您的真实姓名" minimumFontSize="17" id="HzR-cA-16z">
<rect key="frame" x="15" y="70" width="280" height="44"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES" flexibleMaxY="YES"/>
<fontDescription key="fontDescription" type="system" pointSize="14"/>
<textInputTraits key="textInputTraits"/>
</textField>
<button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="roundedRect" lineBreakMode="middleTruncation" id="bly-Bs-GdC">
<rect key="frame" x="15" y="191" width="280" height="42"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES" flexibleMaxY="YES"/>
<color key="backgroundColor" red="1" green="0.0" blue="0.0" alpha="1" colorSpace="calibratedRGB"/>
<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="sureBtnClick:" destination="-1" eventType="touchUpInside" id="yIW-IV-CkF"/>
</connections>
</button>
</subviews>
<color key="backgroundColor" white="1" alpha="1" colorSpace="custom" customColorSpace="calibratedWhite"/>
<simulatedStatusBarMetrics key="simulatedStatusBarMetrics"/>
<simulatedScreenMetrics key="simulatedDestinationMetrics" type="retina4"/>
</view>
</objects>
</document>
@@ -7,7 +7,6 @@
//
#import "InputPassWordViewController.h"
@interface InputPassWordViewController ()
@end
@@ -56,27 +55,16 @@
- (IBAction)login:(id)sender {
if (_passwordTextField.text.length>0 && _phoneNum.length>0) {
// DaiDaiTongApi* daiDaiTongApi = [DaiDaiTongApi shareInstance];
// [daiDaiTongApi loginWithPhone:_phoneNum withPassWord:_passwordTextField.text withCompletionBlock:^(id jsonRes) {
// if ([[jsonRes objectForKey:@"succ"] integerValue] != 1) {
// }else{
// }
// [ManagerUser shareInstance].isLogin = YES;
// [self.navigationController dismissViewControllerAnimated:YES completion:nil];
//
// } failedBlock:^(NSError *error) {
// [MBProgressHUD errorHudWithView:nil label:@"网络出错" hidesAfter:1.0];
// }];
[MBProgressHUD hudWithView:self.view label:@"安全加载中"];
DaiDaiTongTestApi* daiDaiTongTestApi = [DaiDaiTongTestApi shareInstance];
[daiDaiTongTestApi getApiWithParam:[NSDictionary dictionaryWithObjectsAndKeys:_phoneNum,@"phoneNum",_passwordTextField.text, @"loginPsw", nil] withApiType:@"loginByPsw" completionBlock:^(id jsonRes) {
if (!([[jsonRes objectForKey:@"resultflag"] integerValue] == 0)) {
[MBProgressHUD errorHudWithView:self.view label:[jsonRes objectForKey:@"resultMsg"] hidesAfter:0.5];
}else{
[ManagerUser shareInstance].isLogin = YES;
[ManagerUser shareInstance].userId = [jsonRes objectForKey:@"userid"];
[ManagerUser shareInstance].token = [jsonRes objectForKey:@"token"];
[ManagerUser shareInstance].userId = [jsonRes objectForKeyWithoutNull:@"userid"];
[ManagerUser shareInstance].token = [jsonRes objectForKeyWithoutNull:@"token"];
[MBProgressHUD hideAllHUDsForView:self.view animated:YES];
[self.navigationController dismissViewControllerAnimated:YES completion:nil];
}
@@ -142,8 +142,8 @@
[MBProgressHUD errorHudWithView:self.view label:[jsonRes objectForKey:@"resultMsg"] hidesAfter:0.5];
}else{
[ManagerUser shareInstance].isLogin = YES;
[ManagerUser shareInstance].userId = [jsonRes objectForKey:@"userid"];
[ManagerUser shareInstance].token = [jsonRes objectForKey:@"token"];
[ManagerUser shareInstance].userId = [jsonRes objectForKeyWithoutNull:@"userid"];
[ManagerUser shareInstance].token = [jsonRes objectForKeyWithoutNull:@"token"];
[MBProgressHUD hideAllHUDsForView:self.view animated:YES];
UIAlertView *alertView = [[UIAlertView alloc] initWithTitle:@"提示" message:@"设置登录密码可以方便登录" delegate:self cancelButtonTitle:@"下一次设置" otherButtonTitles:@"设置", nil];
@@ -61,11 +61,15 @@
[super touchesMoved:touches withEvent:event];
[_surePassWordTextField resignFirstResponder];
[_passWordTextField resignFirstResponder];
_surePassWordTextField.layer.borderColor = [[UIColor grayColor] CGColor];
_passWordTextField.layer.borderColor = [[UIColor grayColor] CGColor];
}
#pragma mark UITextFieldDelegate
-(BOOL)textFieldShouldBeginEditing:(UITextField *)textField
{
_surePassWordTextField.layer.borderColor = [[UIColor grayColor] CGColor];
_passWordTextField.layer.borderColor = [[UIColor grayColor] CGColor];
textField.layer.borderColor = [[UIColor orangeColor]CGColor];
return YES;
}
@@ -35,8 +35,8 @@
-(void)loadDataWithDic:(NSDictionary *)dic withType:(NSString *)typeStr WithcompletionBlock:(CompletionBlock)completionBlock failedBlock:(FailedBlock)failedBlock
{
[super loadDataWithDic:nil withType:@"activeInfoQuery.do" WithcompletionBlock:^(id jsonRes){
[_infoArray addObjectsFromArray:[jsonRes objectForKey:@"datas"]];
[super loadDataWithDic:nil withType:@"activeList" WithcompletionBlock:^(id jsonRes){
[_infoArray addObjectsFromArray:[jsonRes objectForKey:@"activeList"]];
}failedBlock:^(NSError *error){
@@ -54,12 +54,13 @@
<color key="backgroundColor" white="0.66666666666666663" alpha="1" colorSpace="calibratedWhite"/>
</view>
<view alpha="0.5" contentMode="scaleToFill" id="MKf-vY-jQ4">
<rect key="frame" x="10" y="88" width="300" height="1"/>
<rect key="frame" x="10" y="89" width="300" height="1"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" flexibleMinY="YES"/>
<color key="backgroundColor" white="0.66666666666666663" alpha="1" colorSpace="calibratedWhite"/>
</view>
</subviews>
</tableViewCellContentView>
<color key="backgroundColor" white="0.0" alpha="0.0" colorSpace="calibratedWhite"/>
<connections>
<outlet property="helpTitle" destination="iqw-Us-kDH" id="AHU-xY-xtY"/>
<outlet property="infoTextView" destination="O4g-bd-5uC" id="iif-3u-0xO"/>
@@ -30,11 +30,12 @@
// Do any additional setup after loading the view from its nib.
self.navigationItem.title = @"帮助中心";
self.tableView.separatorStyle = UITableViewCellSelectionStyleNone;
// self.tableView.backgroundColor = [UIColor colorWithWhite:0.8 alpha:0.3];
}
-(void)loadDataWithDic:(NSDictionary *)dic withType:(NSString *)typeStr WithcompletionBlock:(CompletionBlock)completionBlock failedBlock:(FailedBlock)failedBlock
{
[super loadDataWithDic:nil withType:@"helpquery.do" WithcompletionBlock:^(id jsonRes){
[_infoArray addObjectsFromArray:[jsonRes objectForKey:@"datas"]];
[super loadDataWithDic:nil withType:@"helpList" WithcompletionBlock:^(id jsonRes){
[_infoArray addObjectsFromArray:[jsonRes objectForKey:@"helpList"]];
}failedBlock:^(NSError *error){
@@ -43,20 +44,10 @@
#pragma mark UITableViewDelegate
-(NSInteger)numberOfSectionsInTableView:(UITableView *)tableView
{
NSInteger count = 0;
for (int i=0; i<_infoArray.count; i++) {
if ([[[_infoArray objectAtIndex:i] objectForKey:@"top"]boolValue]) {
count++;
}
}
return count+1;
return _infoArray.count;
}
-(NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section
{
if (section == [self numberOfSectionsInTableView:tableView]-1) {
return _infoArray.count-[self numberOfSectionsInTableView:tableView];
}
return 1;
}
-(CGFloat)tableView:(UITableView *)tableView heightForHeaderInSection:(NSInteger)section
@@ -93,9 +84,9 @@
}else{
[((HelpCenterTableViewCell *)cell).infoTextView setHidden:NO];
}
cell.helpTitle.text = [[_infoArray objectAtIndex:indexPath.section+indexPath.row] objectForKey:@"title"];
cell.helpUrl = [[_infoArray objectAtIndex:indexPath.section+indexPath.row] objectForKey:@"url"];
cell.infoTextView.text = [[_infoArray objectAtIndex:indexPath.section+indexPath.row] objectForKey:@"titleDesc"];
cell.helpTitle.text = [[_infoArray objectAtIndex:indexPath.section+indexPath.row] objectForKey:@"helpTitle"];
cell.helpUrl = [[_infoArray objectAtIndex:indexPath.section+indexPath.row] objectForKey:@"helpUrl"];
cell.infoTextView.text = [[_infoArray objectAtIndex:indexPath.section+indexPath.row] objectForKey:@"helpDesc"];
return cell;
}
-(void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath
@@ -29,31 +29,11 @@
}
-(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){
// [_infoArray addObjectsFromArray:[jsonRes objectForKey:@"datas"]];
// }failedBlock:^(NSError *error){
//
// }];
DaiDaiTongTestApi* daiDaiTongTestApi = [DaiDaiTongTestApi shareInstance];
[daiDaiTongTestApi getApiWithParam:[NSDictionary dictionaryWithObjectsAndKeys:[NSNumber numberWithInteger:_pageNum],@"pageNum", nil] withApiType:@"tradeRecList" 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];
// 刷新表格
if ([[jsonRes objectForKey:@"totalNum"] integerValue] <= _pageNum*20) {
// [self.tableView removeFooter];
}
_infoArray = [[NSMutableArray alloc] initWithArray:[jsonRes objectForKey:@"recList"]];
[self.tableView reloadData];
}
[self headerEndRefreshing];
[self footerEndRefreshing];
} failedBlock:^(NSError *error) {
[MBProgressHUD errorHudWithView:self.view label:@"网络出错" hidesAfter:0.5];
[self headerEndRefreshing];
[self footerEndRefreshing];
[super loadDataWithDic:nil withType:@"tradeRecList" WithcompletionBlock:^(id jsonRes){
[_infoArray addObjectsFromArray:[jsonRes objectForKey:@"recList"]];
}failedBlock:^(NSError *error){
}];
}
#pragma mark UITableViewDelegate
@@ -87,7 +67,7 @@
[tableView registerNib:nib forCellReuseIdentifier:dailyIncomeTableViewCell];
cell = (TransactionRecordsTableViewCell *)[tableView dequeueReusableCellWithIdentifier:dailyIncomeTableViewCell];
}
// cell.nameLabel.text = [[_infoArray objectAtIndex:indexPath.section-1] objectForKey:@"name"];
cell.nameLabel.text = [[_infoArray objectAtIndex:indexPath.section] objectForKey:@"proName"];
cell.timeLabel.text = [ManagerUtil timeFromtimeSp:[[[_infoArray objectAtIndex:indexPath.section] objectForKey:@"tradeTime"] stringValue]];
cell.amountLabel.text = [NSString stringWithFormat:@"%.2f",[[[_infoArray objectAtIndex:indexPath.section] objectForKey:@"tradeMoney"] floatValue]];
return cell;
@@ -35,5 +35,6 @@
@property (weak, nonatomic) IBOutlet TableCellLineView *companyLabel;
@property (weak, nonatomic) IBOutlet TableCellLineView *fundStateLabel;
@property (weak, nonatomic) IBOutlet UITextView *moreInfoTextView;
@property (weak, nonatomic) IBOutlet TableCellLineView *topTimeLabel;
@end
@@ -9,6 +9,7 @@
#import "FundProductInfoViewController.h"
#import "MJRefresh.h"
#import "FundCaculateViewController.h"
#import "MainOrderViewController.h"
@interface FundProductInfoViewController ()
{
NSDictionary* _infoDic;
@@ -45,52 +46,58 @@
}
-(void)initData
{
self.navigationItem.title = [_infoDic objectForKey:@"jjmc"];
_startBuyLabel.text = [_infoDic objectForKey:@"sgbz"];
_qrnhLabel.text = [_infoDic objectForKey:@"qrsy"];
_sgrsLabel.text = [_infoDic objectForKey:@"ygrs"];
_wfsyLabel.text = [_infoDic objectForKey:@"wfsy"];
_detailLabel.text = [NSString stringWithFormat:@"额外%@%%积分奖励",[_infoDic objectForKey:@"fd"]];
[self setTypeLabelWithStr:[_infoDic objectForKey:@"jjzq"]];
self.navigationItem.title = [[_infoDic objectForKeyWithoutNull:@"proInfo"] objectForKeyWithoutNull:@"proName"];
_topTimeLabel.leftTitleLabel.text = @"概况";
_topTimeLabel.leftInfoLabel.hidden = YES;
_topTimeLabel.rightTitleLabel.hidden = YES;
_startBuyLabel.text = [[_infoDic objectForKeyWithoutNull:@"proInfo"] objectForKeyWithoutNull:@"startBuy"];
_qrnhLabel.text = [NSString stringWithFormat:@"%@%%",[[_infoDic objectForKeyWithoutNull:@"proInfo"] objectForKeyWithoutNull:@"qrsy"]];
_sgrsLabel.text = [[_infoDic objectForKeyWithoutNull:@"detail"] objectForKeyWithoutNull:@"buyPerNum"];
_wfsyLabel.text = [NSString stringWithFormat:@"%.4f%%",[[[_infoDic objectForKeyWithoutNull:@"proInfo"] objectForKeyWithoutNull:@"wfsy"] floatValue]];
_detailLabel.text = [NSString stringWithFormat:@"额外%@%%积分奖励",[[_infoDic objectForKeyWithoutNull:@"proInfo"] objectForKeyWithoutNull:@"extraPoint"]];
[self setTypeLabelWithStr:@"随买随卖"];
_ysgrsLabel.leftTitleLabel.text = @"已申购人数:";
_ysgrsLabel.leftInfoLabel.hidden = YES;
_ysgrsLabel.rightTitleLabel.hidden = YES;
_ysgrsLabel.rightInfoLabel.text = [NSString stringWithFormat:@"%@ 人",[_infoDic objectForKey:@"ygrs"]];
_ysgrsLabel.rightInfoLabel.text = [NSString stringWithFormat:@"%@ 人",[[_infoDic objectForKeyWithoutNull:@"detail"] objectForKeyWithoutNull:@"buyPerNum"]];
_gmbsLabel.leftTitleLabel.text = @"购买比数:";
_gmbsLabel.leftInfoLabel.hidden = YES;
_gmbsLabel.rightTitleLabel.hidden = YES;
_gmbsLabel.rightInfoLabel.text = [NSString stringWithFormat:@"%@ 笔",[_infoDic objectForKey:@"zgmbs"]];
_gmbsLabel.rightInfoLabel.text = [NSString stringWithFormat:@"%@ 笔",[[_infoDic objectForKeyWithoutNull:@"detail"] objectForKeyWithoutNull:@"buyNum"]];
_totalAmountLabel.leftTitleLabel.text = @"总申购金额:";
_totalAmountLabel.leftInfoLabel.hidden = YES;
_totalAmountLabel.rightTitleLabel.hidden = YES;
_totalAmountLabel.rightInfoLabel.text = [NSString stringWithFormat:@"%.2f 元",[[_infoDic objectForKey:@"zsgje"] floatValue]];
_totalAmountLabel.rightInfoLabel.text = [NSString stringWithFormat:@"%.2f 元",[[[_infoDic objectForKeyWithoutNull:@"detail"] objectForKeyWithoutNull:@"totalMoney"] floatValue]];
_rjsgLabel.leftTitleLabel.text = @"人均申购金额:";
_rjsgLabel.leftInfoLabel.hidden = YES;
_rjsgLabel.rightTitleLabel.hidden = YES;
_rjsgLabel.rightInfoLabel.text = [NSString stringWithFormat:@"%@ 元",[_infoDic objectForKey:@"rjje"]];
_rjsgLabel.rightInfoLabel.text = [NSString stringWithFormat:@"%@ 元",[[_infoDic objectForKeyWithoutNull:@"detail"] objectForKeyWithoutNull:@"avgMoney"]];
_qrnhwfsyLabel.leftTitleLabel.text = @"七日年化:";
_qrnhwfsyLabel.leftInfoLabel.text = [NSString stringWithFormat:@"%@ %%",[_infoDic objectForKey:@"qrsy"]];
_qrnhwfsyLabel.leftInfoLabel.text = [NSString stringWithFormat:@"%@ %%",[[_infoDic objectForKeyWithoutNull:@"fundcomp"] objectForKeyWithoutNull:@"qrnh"]];
_qrnhwfsyLabel.rightTitleLabel.text = @"万份收益:";
_qrnhwfsyLabel.rightInfoLabel.text = [NSString stringWithFormat:@"%@元",[_infoDic objectForKey:@"wfsy"]];
_qrnhwfsyLabel.rightInfoLabel.text = [NSString stringWithFormat:@"%@元",[[_infoDic objectForKeyWithoutNull:@"fundcomp"] objectForKeyWithoutNull:@"wfsy"]];
_zfLabel.leftTitleLabel.text = @"六个月涨幅:";
_zfLabel.leftInfoLabel.text = [NSString stringWithFormat:@"%@ %%",[_infoDic objectForKey:@"hb6y"]];
_zfLabel.leftInfoLabel.text = [NSString stringWithFormat:@"%@ %%",[[_infoDic objectForKeyWithoutNull:@"fundcomp"] objectForKeyWithoutNull:@"sixMonRose"]];
_zfLabel.rightTitleLabel.text = @"一年涨幅:";
_zfLabel.rightInfoLabel.text = [NSString stringWithFormat:@"%@ %%",[_infoDic objectForKey:@"hb1n"]];
_zfLabel.rightInfoLabel.text = [NSString stringWithFormat:@"%@ %%",[[_infoDic objectForKeyWithoutNull:@"fundcomp"] objectForKeyWithoutNull:@"yearRose"]];
_companyLabel.leftTitleLabel.text = @"基金公司:";
_companyLabel.leftInfoLabel.text = [_infoDic objectForKey:@"jjgs"];
_companyLabel.leftInfoLabel.text = [[_infoDic objectForKeyWithoutNull:@"fundcomp"] objectForKeyWithoutNull:@"comName"];
_companyLabel.rightTitleLabel.text = @"销售公司:";
_companyLabel.rightInfoLabel.text = [_infoDic objectForKey:@"ssgs"];
_companyLabel.rightInfoLabel.text = [[_infoDic objectForKeyWithoutNull:@"fundcomp"] objectForKeyWithoutNull:@"saleComName"];
_fundStateLabel.leftTitleLabel.text = @"基金规模:";
_fundStateLabel.leftInfoLabel.text = [_infoDic objectForKey:@"jjgm"];
_fundStateLabel.leftInfoLabel.text = [NSString stringWithFormat:@"%.2f 亿",[[[_infoDic objectForKeyWithoutNull:@"fundcomp"] objectForKeyWithoutNull:@"fundScale"] floatValue]/100000000.0];
_fundStateLabel.rightTitleLabel.text = @"销售类型:";
_fundStateLabel.rightInfoLabel.text = [_infoDic objectForKey:@"fundTypeName"];
_moreInfoTextView.text = [_infoDic objectForKey:@"fundIntroduce"];
if ([[[_infoDic objectForKeyWithoutNull:@"fundcomp"] objectForKeyWithoutNull:@"fundType"] integerValue] == 0) {
_fundStateLabel.rightInfoLabel.text = @"货币型";
}
_moreInfoTextView.text = [[_infoDic objectForKeyWithoutNull:@"fundcomp"] objectForKeyWithoutNull:@"detailDesc1"];
_moreInfoTextView.textColor = [UIColor redColor];
}
@@ -107,23 +114,27 @@
#pragma mark MJRefreshDelegate
- (void)headerRereshing
{
DaiDaiTongApi* daiDaiTongApi = [DaiDaiTongApi shareInstance];
[daiDaiTongApi getFundDetailWithFundId:_productId withCompletionBlock:^(id jsonRes) {
if ([[jsonRes objectForKey:@"succ"] integerValue] == 1) {
DaiDaiTongTestApi* daiDaiTongTestApi = [DaiDaiTongTestApi shareInstance];
[daiDaiTongTestApi getApiWithParam:[NSDictionary dictionaryWithObjectsAndKeys:_productId,@"proId", nil] withApiType:@"proDetail" completionBlock:^(id jsonRes) {
if ([[jsonRes objectForKey:@"resultflag"] integerValue] == 0) {
self.navigationItem.title = [jsonRes objectForKey:@"fundName"];
_infoDic = [NSDictionary dictionaryWithDictionary:jsonRes];
if ([[[jsonRes objectForKey:@"proInfo"] objectForKey:@"state"] integerValue] == 1) {
[_toolBarView setEnable:YES];
}else{
[_toolBarView setEnable:NO];
}
}else{
[MBProgressHUD errorHudWithView:nil label:[jsonRes objectForKey:@"err_msg"] hidesAfter:0.5];
}
[self initData];
[self.tableView reloadData];
[self initData];
[self.tableView headerEndRefreshing];
} failedBlock:^(NSError *error) {
[self.tableView headerEndRefreshing];
[MBProgressHUD errorHudWithView:self.view label:@"网络出错" hidesAfter:0.5];
}];
}
- (void)footerRereshing
@@ -148,10 +159,16 @@
#pragma mark UITableViewDelegate
-(NSInteger)numberOfSectionsInTableView:(UITableView *)tableView
{
return 4;
if (_infoDic) {
return 4;
}else{
return 0;
}
return 0;
}
-(NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section
{
return 1;
}
-(UIView*)tableView:(UITableView *)tableView viewForHeaderInSection:(NSInteger)section
@@ -263,7 +280,7 @@
{
FundCaculateViewController* fundCaculateViewController = [[FundCaculateViewController alloc] init];
fundCaculateViewController.qrnh = [[_infoDic objectForKey:@"qrsy"] floatValue]/100.0;
fundCaculateViewController.qrnh = [[[_infoDic objectForKeyWithoutNull:@"fundcomp"] objectForKeyWithoutNull:@"qrnh"] floatValue]/100.0;
// fundCaculateViewController.name =
[self.navigationController pushViewController:fundCaculateViewController animated:YES];
@@ -272,6 +289,14 @@
{
if (![ManagerUser shareInstance].isLogin) {
[ManagerUtil presentLoginView];
}else{
MainOrderViewController* mainOrderViewController = [[MainOrderViewController alloc] init];
mainOrderViewController.productId =[[_infoDic objectForKey:@"proInfo"] objectForKey:@"id"];
mainOrderViewController.productName = [[_infoDic objectForKey:@"proInfo"] objectForKey:@"proName"];
mainOrderViewController.timeLimitNum = [[[_infoDic objectForKey:@"proInfo"] objectForKey:@"timeLimit"] integerValue];
mainOrderViewController.startBuy = [[[_infoDic objectForKey:@"proInfo"] objectForKey:@"startBuy"] integerValue];
mainOrderViewController.type = 1;
[self.navigationController pushViewController:mainOrderViewController animated:YES];
}
}
- (void)didReceiveMemoryWarning
@@ -22,6 +22,7 @@
<outlet property="stateInfoCell" destination="xov-P4-9jT" id="Uhw-wB-zHL"/>
<outlet property="tableView" destination="ciS-rs-KfU" id="H95-2T-aWr"/>
<outlet property="toolBarView" destination="UNJ-f6-5he" id="1bt-SR-GRa"/>
<outlet property="topTimeLabel" destination="GTM-EO-LYx" id="XRV-bP-62W"/>
<outlet property="totalAmountLabel" destination="Kcj-yZ-GFL" id="OWr-sz-7gw"/>
<outlet property="typeLabel" destination="ZNb-ff-OEz" id="emO-WU-Llx"/>
<outlet property="view" destination="i5M-Pr-FkT" id="sfx-zR-JGt"/>
@@ -117,7 +118,7 @@
<nil key="highlightedColor"/>
</label>
<view contentMode="scaleToFill" id="ZNb-ff-OEz" customClass="DTAttributedLabel">
<rect key="frame" x="10" y="146" width="141" height="23"/>
<rect key="frame" x="10" y="155" width="141" height="23"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
<color key="backgroundColor" white="0.0" alpha="0.0" colorSpace="calibratedWhite"/>
</view>
@@ -199,7 +200,7 @@
<autoresizingMask key="autoresizingMask" widthSizable="YES" flexibleMaxY="YES"/>
<color key="backgroundColor" white="1" alpha="1" colorSpace="custom" customColorSpace="calibratedWhite"/>
</view>
<textView clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="scaleToFill" editable="NO" selectable="NO" id="RKS-9M-K1N">
<textView clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="scaleToFill" scrollEnabled="NO" editable="NO" selectable="NO" id="RKS-9M-K1N">
<rect key="frame" x="10" y="100" width="300" height="40"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" flexibleMinY="YES"/>
<color key="backgroundColor" white="0.0" alpha="0.0" colorSpace="calibratedWhite"/>
@@ -14,7 +14,9 @@
NSString* _productName;
NSInteger _timeLimitNum;
NSInteger _startBuy;
NSInteger _type;
}
@property (assign, nonatomic)NSInteger type;
@property (strong, nonatomic)NSString* productId;
@property (assign, nonatomic)NSInteger timeLimitNum;
@property (assign, nonatomic)NSInteger startBuy;
@@ -24,6 +26,7 @@
@property (weak, nonatomic) IBOutlet UILabel *timeLimit;
@property (weak, nonatomic) IBOutlet UITextField *orderAmountTextField;
@property (weak, nonatomic) IBOutlet UIView *backgroudView;
@property (weak, nonatomic) IBOutlet UILabel *infoLabel;
@property (weak, nonatomic) IBOutlet UIButton *completeBtn;
- (IBAction)completeBtnClick:(id)sender;
@@ -20,6 +20,7 @@
self = [super initWithNibName:nibNameOrNil bundle:nibBundleOrNil];
if (self) {
// Custom initialization
_type = 0;
}
return self;
}
@@ -37,9 +38,18 @@
[_completeBtn setBackgroundImage:[ManagerUtil buttonImageFromColor:[UIColor lightGrayColor] withFrame:_completeBtn.frame] forState:UIControlStateDisabled];
_nameLabel.text = _productName;
_startBuyLabel.text = [NSString stringWithFormat:@"%ld元",_startBuy];
_timeLimit.text = [NSString stringWithFormat:@"限%ld个月",_timeLimitNum];
_orderAmountTextField.placeholder = [NSString stringWithFormat:@"投标金额≤%ld",_startBuy];
_startBuyLabel.text = [NSString stringWithFormat:@"%d元",_startBuy];
if (_type == 0) {
_timeLimit.text = [NSString stringWithFormat:@"限%d个月",_timeLimitNum];
_infoLabel.hidden = NO;
_infoLabel.text = [NSString stringWithFormat:@"投标金额:%d的整数倍",_startBuy];
_orderAmountTextField.placeholder = [NSString stringWithFormat:@"投标金额≥%d",_startBuy];
}else{
_timeLimit.text = @"随买随卖";
_orderAmountTextField.placeholder = @"建议100元以上,以便收益计算";
_infoLabel.hidden = YES;
}
}
-(void)touchesBegan:(NSSet *)touches withEvent:(UIEvent *)event
@@ -82,7 +92,7 @@
{
UITextField* textField = [sender object];
if ([textField.text isEqualToString:@""] || [textField.text integerValue]%50 != 0) {
if ([textField.text isEqualToString:@""] || [textField.text integerValue]%_startBuy != 0) {
_completeBtn.enabled = NO;
}else{
@@ -104,15 +114,30 @@
}
- (IBAction)completeBtnClick:(id)sender {
if ([ManagerUser shareInstance].tradePsw.length>0) {
OrderPassWordViewController* orderPassWordViewController = [[OrderPassWordViewController alloc] init];
orderPassWordViewController.amount = [_orderAmountTextField.text integerValue];
orderPassWordViewController.proId = _productId;
[self.navigationController pushViewController:orderPassWordViewController animated:YES];
}else{
SetPassWordViewController* setPassWordViewController = [[SetPassWordViewController alloc] init];
setPassWordViewController.type = 1;
[self.navigationController pushViewController:setPassWordViewController animated:YES];
}
[MBProgressHUD hudWithView:self.view label:@"安全加载中"];
DaiDaiTongTestApi* daiDaiTongTestApi = [DaiDaiTongTestApi shareInstance];
[daiDaiTongTestApi getApiWithParam:nil withApiType:@"hasTradePsw" completionBlock:^(id jsonRes) {
if ([[jsonRes objectForKey:@"resultflag"] integerValue] == 1) {
[MBProgressHUD errorHudWithView:self.view label:@"还没设置交易密码" hidesAfter:1.0];
dispatch_after(dispatch_time(DISPATCH_TIME_NOW, NSEC_PER_SEC*1.0), dispatch_get_main_queue(), ^{
SetPassWordViewController* setPassWordViewController = [[SetPassWordViewController alloc] init];
setPassWordViewController.type = 1;
[self.navigationController pushViewController:setPassWordViewController animated:YES];
});
}else{
[MBProgressHUD hideAllHUDsForView:self.view animated:YES];
OrderPassWordViewController* orderPassWordViewController = [[OrderPassWordViewController alloc] init];
orderPassWordViewController.amount = [_orderAmountTextField.text integerValue];
orderPassWordViewController.proId = _productId;
[self.navigationController pushViewController:orderPassWordViewController animated:YES];
}
} failedBlock:^(NSError *error) {
[MBProgressHUD errorHudWithView:self.view label:@"网络出错" hidesAfter:0.5];
}];
}
@end
@@ -8,6 +8,7 @@
<connections>
<outlet property="backgroudView" destination="dUX-Wj-rrD" id="ZVH-rS-caI"/>
<outlet property="completeBtn" destination="NA0-Yc-lgR" id="Mjq-DE-CZO"/>
<outlet property="infoLabel" destination="jSo-Rl-B1x" id="muz-a0-NNK"/>
<outlet property="nameLabel" destination="cH3-xu-AqY" id="qP5-oH-wbO"/>
<outlet property="orderAmountTextField" destination="wtp-s8-tvh" id="HXt-pL-sYC"/>
<outlet property="startBuyLabel" destination="qO9-6h-Y38" id="aS2-6K-vX4"/>
@@ -110,7 +111,7 @@
<fontDescription key="fontDescription" type="system" pointSize="15"/>
<nil key="highlightedColor"/>
</label>
<textField opaque="NO" clipsSubviews="YES" contentMode="scaleToFill" contentHorizontalAlignment="left" contentVerticalAlignment="center" placeholder="投标金额50" minimumFontSize="17" id="wtp-s8-tvh">
<textField opaque="NO" clipsSubviews="YES" contentMode="scaleToFill" contentHorizontalAlignment="left" contentVerticalAlignment="center" placeholder="投标金额50" minimumFontSize="17" id="wtp-s8-tvh">
<rect key="frame" x="95" y="6" width="216" height="30"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES"/>
<fontDescription key="fontDescription" type="system" pointSize="14"/>
@@ -8,6 +8,7 @@
#import "OrderPassWordViewController.h"
#import "UPPayPlugin.h"
#import "AuthenticationViewController.h"
@interface OrderPassWordViewController ()
@end
@@ -52,7 +53,7 @@
- (BOOL)textField:(UITextField *)textField shouldChangeCharactersInRange:(NSRange)range replacementString:(NSString *)string
{
if (range.location >= 13)
if (range.location > 15)
return NO; // return NO to not change text
return YES;
@@ -87,15 +88,20 @@
[MBProgressHUD hudWithView:self.view label:@"安全加载中"];
DaiDaiTongTestApi* daiDaiTongTestApi = [DaiDaiTongTestApi shareInstance];
[daiDaiTongTestApi getApiWithParam:[NSDictionary dictionaryWithObjectsAndKeys:[NSNumber numberWithInteger:_amount],@"amount", _passwordTextField.text,@"tradePsw",_proId, @"proId", nil] withApiType:@"buyProduct" completionBlock:^(id jsonRes) {
[MBProgressHUD hideAllHUDsForView:self.view animated:YES];
if ([[jsonRes objectForKey:@"resultflag"] integerValue] == 1) {
[MBProgressHUD errorHudWithView:self.view label:[jsonRes objectForKey:@"resultMsg"] hidesAfter:1.0];
}else{
}else if([[jsonRes objectForKey:@"resultflag"] integerValue] == 2){
AuthenticationViewController* authenticationViewController = [[AuthenticationViewController alloc] init];
[self.navigationController pushViewController:authenticationViewController animated:YES];
}else if([[jsonRes objectForKey:@"resultflag"] integerValue] == 0){
NSString* tn = [jsonRes objectForKey:@"tn"];
if (tn) {
[UPPayPlugin startPay:tn mode:@"01" viewController:self delegate:self];
}
[MBProgressHUD hideAllHUDsForView:self.view animated:YES];
}
} failedBlock:^(NSError *error) {
[MBProgressHUD errorHudWithView:self.view label:@"网络出错" hidesAfter:1.0];
@@ -108,7 +114,7 @@
if ([result isEqualToString:@"success"]) {
[MBProgressHUD errorHudWithView:self.view label:@"投标成功" hidesAfter:1.0];
dispatch_after(dispatch_time(DISPATCH_TIME_NOW, NSEC_PER_SEC*1.0),
dispatch_get_current_queue(), ^(){
dispatch_get_main_queue(), ^(){
[self.navigationController popToRootViewControllerAnimated:YES];
});
@@ -15,27 +15,21 @@
self = [super initWithFrame:frame];
if (self) {
// Initialization code
}
return self;
}
// Only override drawRect: if you perform custom drawing.
// An empty implementation adversely affects performance during animation.
- (void)drawRect:(CGRect)rect
-(void)awakeFromNib
{
// Drawing code
_leftTitleLabel = [[UILabel alloc] initWithFrame:CGRectMake(10, self.bounds.size.height-20, 100, 20)];
_leftTitleLabel.font = Font_Black(12);
_leftTitleLabel.textColor = [UIColor grayColor];
_leftTitleLabel.text = @"左边名字";
_leftTitleLabel.text = @"";
_leftTitleLabel.textAlignment = NSTextAlignmentLeft;
[self addSubview:_leftTitleLabel];
_leftInfoLabel = [[UILabel alloc] initWithFrame:CGRectMake(40, self.bounds.size.height-20, 100, 20)];
_leftInfoLabel.font = Font_Black(12);
_leftInfoLabel.text = @"左边内容";
_leftInfoLabel.text = @"";
_leftInfoLabel.textColor = [UIColor grayColor];
_leftInfoLabel.textAlignment = NSTextAlignmentRight;
[self addSubview:_leftInfoLabel];
@@ -43,19 +37,27 @@
_rightTitleLabel = [[UILabel alloc] initWithFrame:CGRectMake(160, self.bounds.size.height-20, 100, 20)];
_rightTitleLabel.font = Font_Black(12);
_rightTitleLabel.textColor = [UIColor grayColor];
_rightTitleLabel.text = @"右边名字";
_rightTitleLabel.text = @"";
_rightTitleLabel.textAlignment = NSTextAlignmentLeft;
[self addSubview:_rightTitleLabel];
_rightInfoLabel = [[UILabel alloc] initWithFrame:CGRectMake(210, self.bounds.size.height-20, 100, 20)];
_rightInfoLabel.font = Font_Black(12);
_rightInfoLabel.textColor = [UIColor grayColor];
_rightInfoLabel.text = @"右边内容";
_rightInfoLabel.text = @"";
_rightInfoLabel.textAlignment = NSTextAlignmentRight;
[self addSubview:_rightInfoLabel];
[self addSubview:[ManagerUtil lineWithColor:Touch_BackGroudColor withAlpha:1.0 withFrame:CGRectMake(10, self.bounds.size.height-1, self.bounds.size.width-20, 1.0)]];
}
// Only override drawRect: if you perform custom drawing.
// An empty implementation adversely affects performance during animation.
- (void)drawRect:(CGRect)rect
{
// Drawing code
}
@end
@@ -17,7 +17,7 @@
<color key="textColor" red="0.70531728319999998" green="0.70531728319999998" blue="0.70531728319999998" alpha="1" colorSpace="calibratedRGB"/>
<nil key="highlightedColor"/>
</label>
<label opaque="NO" clipsSubviews="YES" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="62,000.00" textAlignment="center" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" id="yCh-FU-y40">
<label opaque="NO" clipsSubviews="YES" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="0" textAlignment="center" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" id="yCh-FU-y40">
<rect key="frame" x="0.0" y="41" width="320" height="21"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
<fontDescription key="fontDescription" type="system" pointSize="24"/>
@@ -66,7 +66,7 @@
<color key="textColor" red="1" green="0.0" blue="0.0" alpha="1" colorSpace="calibratedRGB"/>
<nil key="highlightedColor"/>
</label>
<label opaque="NO" clipsSubviews="YES" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="100" textAlignment="center" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" id="vln-TR-h3K">
<label opaque="NO" clipsSubviews="YES" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="0" textAlignment="center" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" id="vln-TR-h3K">
<rect key="frame" x="160" y="134" width="140" height="21"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
<fontDescription key="fontDescription" type="system" pointSize="20"/>
@@ -11,6 +11,7 @@
#import "MJRefresh.h"
#import "ProFitCaculateViewController.h"
#import "MainOrderViewController.h"
#import "SetPassWordViewController.h"
@interface WYDProductViewController ()
@@ -41,7 +42,7 @@
NSArray *nib=[[NSBundle mainBundle]loadNibNamed:@"WYDInfoHeadView" owner:self options:nil];
_wydInfoHedaView = (WYDInfoHeadView*)[nib objectAtIndex:0];
_tableView.tableHeaderView = _wydInfoHedaView;
_wydInfoHedaView.hidden = YES;
_toolBarView.delegate = self;
//加入刷新
@@ -84,13 +85,16 @@
}
self.navigationItem.title = [[jsonRes objectForKey:@"proInfo"] objectForKey:@"proName"];
[self.tableView reloadData];
_wydInfoHedaView.hidden = NO;
}else{
[MBProgressHUD errorHudWithView:nil label:[jsonRes objectForKey:@"err_msg"] hidesAfter:0.5];
_wydInfoHedaView.hidden = YES;
}
[self.tableView headerEndRefreshing];
} failedBlock:^(NSError *error) {
[self.tableView headerEndRefreshing];
_wydInfoHedaView.hidden = YES;
[MBProgressHUD errorHudWithView:self.view label:@"网络出错" hidesAfter:0.5];
}];
@@ -212,12 +216,15 @@
if (![ManagerUser shareInstance].isLogin) {
[ManagerUtil presentLoginView];
}else{
MainOrderViewController* mainOrderViewController = [[MainOrderViewController alloc] init];
mainOrderViewController.productId =[[_infoDic objectForKey:@"proInfo"] objectForKey:@"id"];
mainOrderViewController.productName = [[_infoDic objectForKey:@"proInfo"] objectForKey:@"proName"];
mainOrderViewController.timeLimitNum = [[[_infoDic objectForKey:@"proInfo"] objectForKey:@"timeLimit"] integerValue];
mainOrderViewController.startBuy = [[[_infoDic objectForKey:@"proInfo"] objectForKey:@"startBuy"] integerValue];
[self.navigationController pushViewController:mainOrderViewController animated:YES];
}
}
@@ -54,6 +54,7 @@
{
[super viewDidLoad];
// Do any additional setup after loading the view from its nib.
[[UITableViewHeaderFooterView appearance] setTintColor:[UIColor clearColor]];
}
@@ -82,6 +82,7 @@
[daiDaiTongTestApi getApiWithParam:nil withApiType:@"userMsg" completionBlock:^(id jsonRes) {
if ([[jsonRes objectForKey:@"resultflag"] integerValue] != 0) {
[MBProgressHUD errorHudWithView:self.view label:[jsonRes objectForKey:@"resultMsg"] hidesAfter:0.5];
[ManagerUtil presentLoginView];
}else{
[MBProgressHUD hideAllHUDsForView:self.view animated:YES];
_myInfoDic = [NSDictionary dictionaryWithDictionary:jsonRes];
@@ -156,7 +157,7 @@
-(UITableViewCell*)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
{
NSString* cellIdentifier = [NSString stringWithFormat:@"cell%ld%ld",indexPath.section,indexPath.row];
NSString* cellIdentifier = [NSString stringWithFormat:@"cell%d%d",indexPath.section,indexPath.row];
UITableViewCell* cell = [tableView dequeueReusableCellWithIdentifier:cellIdentifier];
if (!cell) {
+1
View File
@@ -25,4 +25,5 @@
#import <SDWebImage/UIImageView+WebCache.h>
#import<SDWebImage/SDImageCache.h>
#import "ManagerUser.h"
#import "NSDictionary+ChangeNull.h"
#endif