Commit 1cb110ed authored by lmj_521aiau@163.com's avatar lmj_521aiau@163.com

1.UI fix

parent edb85a3f
...@@ -1830,7 +1830,7 @@ ...@@ -1830,7 +1830,7 @@
CODE_SIGN_ENTITLEMENTS = ZhiJi/ZhiJi.entitlements; CODE_SIGN_ENTITLEMENTS = ZhiJi/ZhiJi.entitlements;
CODE_SIGN_IDENTITY = "iPhone Developer"; CODE_SIGN_IDENTITY = "iPhone Developer";
CODE_SIGN_STYLE = Manual; CODE_SIGN_STYLE = Manual;
CURRENT_PROJECT_VERSION = 150; CURRENT_PROJECT_VERSION = 102;
DEVELOPMENT_TEAM = KQ4CS767WC; DEVELOPMENT_TEAM = KQ4CS767WC;
FRAMEWORK_SEARCH_PATHS = ( FRAMEWORK_SEARCH_PATHS = (
"$(inherited)", "$(inherited)",
...@@ -1928,7 +1928,7 @@ ...@@ -1928,7 +1928,7 @@
CODE_SIGN_ENTITLEMENTS = ZhiJi/ZhiJi.entitlements; CODE_SIGN_ENTITLEMENTS = ZhiJi/ZhiJi.entitlements;
CODE_SIGN_IDENTITY = "iPhone Developer"; CODE_SIGN_IDENTITY = "iPhone Developer";
CODE_SIGN_STYLE = Manual; CODE_SIGN_STYLE = Manual;
CURRENT_PROJECT_VERSION = 150; CURRENT_PROJECT_VERSION = 102;
DEBUG_INFORMATION_FORMAT = dwarf; DEBUG_INFORMATION_FORMAT = dwarf;
DEFINES_MODULE = YES; DEFINES_MODULE = YES;
DEVELOPMENT_TEAM = KQ4CS767WC; DEVELOPMENT_TEAM = KQ4CS767WC;
......
...@@ -9,7 +9,7 @@ ...@@ -9,7 +9,7 @@
"scale" : "2x" "scale" : "2x"
}, },
{ {
"filename" : "guide_1.png", "filename" : "411594089529_.pic_hd.jpg",
"idiom" : "universal", "idiom" : "universal",
"scale" : "3x" "scale" : "3x"
} }
......
...@@ -9,7 +9,7 @@ ...@@ -9,7 +9,7 @@
"scale" : "2x" "scale" : "2x"
}, },
{ {
"filename" : "x3.png", "filename" : "421594089533_.pic_hd.jpg",
"idiom" : "universal", "idiom" : "universal",
"scale" : "3x" "scale" : "3x"
} }
......
...@@ -25,6 +25,8 @@ ...@@ -25,6 +25,8 @@
@property (nonatomic, strong) UILabel * hintLab; @property (nonatomic, strong) UILabel * hintLab;
@property (nonatomic, strong) UIView * headerView;
@property (nonatomic, strong) UIView * footer_firstView; @property (nonatomic, strong) UIView * footer_firstView;
@property (nonatomic, strong) UILabel * footer_detailsLab_0; @property (nonatomic, strong) UILabel * footer_detailsLab_0;
...@@ -91,7 +93,7 @@ ...@@ -91,7 +93,7 @@
make.left.right.bottom.equalTo(self.view); make.left.right.bottom.equalTo(self.view);
make.top.equalTo(bgView.mas_bottom); make.top.equalTo(bgView.mas_bottom);
}]; }];
self.memberTableView.rowHeight = KScaleWidth(129+14); self.memberTableView.rowHeight = KScaleWidth(129+6);
self.memberTableView.dataSource = self; self.memberTableView.dataSource = self;
self.memberTableView.delegate = self; self.memberTableView.delegate = self;
self.memberTableView.backgroundColor = self.view.backgroundColor; self.memberTableView.backgroundColor = self.view.backgroundColor;
...@@ -99,11 +101,20 @@ ...@@ -99,11 +101,20 @@
self.memberTableView.separatorStyle = UITableViewCellSeparatorStyleNone; self.memberTableView.separatorStyle = UITableViewCellSeparatorStyleNone;
[self.memberTableView registerClass:[ZJTableViewCell class] forCellReuseIdentifier:ID]; [self.memberTableView registerClass:[ZJTableViewCell class] forCellReuseIdentifier:ID];
self.memberTableView.tableHeaderView = self.headerView;
self.memberTableView.tableFooterView = self.footerView_style2; self.memberTableView.tableFooterView = self.footerView_style2;
[self.view bringSubviewToFront:self.memberTableView]; [self.view bringSubviewToFront:self.memberTableView];
} }
- (UIView *)headerView{
if (!_headerView) {
_headerView = [[UIView alloc] initWithFrame:CGRectMake(0, 0, KScreenWidth, KScaleWidth(14))];
_headerView.backgroundColor = [UIColor clearColor];
}
return _headerView;
}
- (UIView *)footerView_style2{ - (UIView *)footerView_style2{
if (!_footerView_style2) { if (!_footerView_style2) {
_footerView_style2 = [[UIView alloc] initWithFrame:CGRectMake(0, 0, KScreenWidth, KScaleWidth(260))]; _footerView_style2 = [[UIView alloc] initWithFrame:CGRectMake(0, 0, KScreenWidth, KScaleWidth(260))];
...@@ -145,7 +156,7 @@ ...@@ -145,7 +156,7 @@
}]; }];
self.phoneTF = [[UITextField alloc] init]; self.phoneTF = [[UITextField alloc] init];
self.phoneTF.backgroundColor = [UIColor whiteColor]; self.phoneTF.backgroundColor = [UIColor clearColor];
self.phoneTF.placeholder = kLocalizedString(@"emergency_enter_phone"); self.phoneTF.placeholder = kLocalizedString(@"emergency_enter_phone");
self.phoneTF.borderStyle = UITextBorderStyleNone; self.phoneTF.borderStyle = UITextBorderStyleNone;
self.phoneTF.layer.cornerRadius = KScaleWidth(50)/2; self.phoneTF.layer.cornerRadius = KScaleWidth(50)/2;
...@@ -163,8 +174,8 @@ ...@@ -163,8 +174,8 @@
make.size.mas_offset(CGSizeMake(KScaleWidth(310), KScaleWidth(50))); make.size.mas_offset(CGSizeMake(KScaleWidth(310), KScaleWidth(50)));
}]; }];
UIView * leftView = [[UIView alloc] initWithFrame:CGRectMake(0, 0, KScaleWidth(99), KScaleWidth(50))]; UIView * leftView = [[UIView alloc] initWithFrame:CGRectMake(0, 0, KScaleWidth(80), KScaleWidth(50))];
UIButton * areaCodeBtn = [[UIButton alloc] initWithFrame:CGRectMake(0, 0, KScaleWidth(99-24), KScaleWidth(50))]; UIButton * areaCodeBtn = [[UIButton alloc] initWithFrame:CGRectMake(0, 0, KScaleWidth(80-24), KScaleWidth(50))];
areaCodeBtn.titleLabel.adjustsFontSizeToFitWidth = YES; areaCodeBtn.titleLabel.adjustsFontSizeToFitWidth = YES;
areaCodeBtn.titleLabel.font = [UIFont systemFontOfSize:KFont(18)]; areaCodeBtn.titleLabel.font = [UIFont systemFontOfSize:KFont(18)];
[areaCodeBtn setTitleColor:kMassColor forState:(UIControlStateNormal)]; [areaCodeBtn setTitleColor:kMassColor forState:(UIControlStateNormal)];
...@@ -173,8 +184,8 @@ ...@@ -173,8 +184,8 @@
currentCountryCode = [[self.data Read] objectForKey:@"currentCountryCode"]; currentCountryCode = [[self.data Read] objectForKey:@"currentCountryCode"];
[areaCodeBtn setTitle:[NSString stringWithFormat:@"+%@", [[self.data Read] objectForKey:@"currentCountryCode"]] forState:(UIControlStateNormal)]; [areaCodeBtn setTitle:[NSString stringWithFormat:@"+%@", [[self.data Read] objectForKey:@"currentCountryCode"]] forState:(UIControlStateNormal)];
}else{ }else{
currentCountryCode = @"86"; currentCountryCode = @"1";
[areaCodeBtn setTitle:@"+86" forState:(UIControlStateNormal)]; [areaCodeBtn setTitle:@"+1" forState:(UIControlStateNormal)];
} }
[areaCodeBtn addTarget:self action:@selector(areaBtnClick:) forControlEvents:(UIControlEventTouchUpInside)]; [areaCodeBtn addTarget:self action:@selector(areaBtnClick:) forControlEvents:(UIControlEventTouchUpInside)];
[leftView addSubview:areaCodeBtn]; [leftView addSubview:areaCodeBtn];
...@@ -194,7 +205,7 @@ ...@@ -194,7 +205,7 @@
self.addBtn = [[UIButton alloc] init]; self.addBtn = [[UIButton alloc] init];
self.addBtn.backgroundColor = kMassColor; self.addBtn.backgroundColor = kMassColor;
self.addBtn.layer.cornerRadius = KScaleWidth(50)/2; self.addBtn.layer.cornerRadius = KScaleWidth(50)/2;
self.addBtn.titleLabel.font = [UIFont systemFontOfSize:KFont(16)]; self.addBtn.titleLabel.font = [UIFont systemFontOfSize:KFont(18)];
[self.addBtn setTitleColor:[UIColor whiteColor] forState:0]; [self.addBtn setTitleColor:[UIColor whiteColor] forState:0];
[self.addBtn setTitleColor:[UIColor whiteColor] forState:UIControlStateSelected]; [self.addBtn setTitleColor:[UIColor whiteColor] forState:UIControlStateSelected];
[self.addBtn setTitle:kLocalizedString(@"care_add") forState:(UIControlStateNormal)]; [self.addBtn setTitle:kLocalizedString(@"care_add") forState:(UIControlStateNormal)];
...@@ -510,7 +521,7 @@ ...@@ -510,7 +521,7 @@
} }
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath{ - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath{
ZJTableViewCell *tabCell = [tableView dequeueReusableCellWithIdentifier:ID forIndexPath:indexPath]; ZJTableViewCell *tabCell = [tableView dequeueReusableCellWithIdentifier:ID forIndexPath:indexPath];
tabCell.model = self.friendDataSource[indexPath.row]; tabCell.model = self.friendDataSource[indexPath.row];
tabCell.sheZhiButton.hidden = NO; tabCell.sheZhiButton.hidden = NO;
......
...@@ -55,8 +55,8 @@ ...@@ -55,8 +55,8 @@
[imageView mas_makeConstraints:^(MASConstraintMaker *make) { [imageView mas_makeConstraints:^(MASConstraintMaker *make) {
make.left.equalTo(self.contentView).mas_offset(KScaleWidth(17)); make.left.equalTo(self.contentView).mas_offset(KScaleWidth(17));
make.right.equalTo(self.contentView.mas_right).mas_offset(-KScaleWidth(17)); make.right.equalTo(self.contentView.mas_right).mas_offset(-KScaleWidth(17));
make.top.equalTo(self.contentView).mas_offset(KScaleWidth(7)); make.top.equalTo(self.contentView).mas_offset(KScaleWidth(3));
make.bottom.equalTo(self.contentView.mas_bottom).mas_offset(-KScaleWidth(7)); make.bottom.equalTo(self.contentView.mas_bottom).mas_offset(-KScaleWidth(3));
}]; }];
//touXiangImageView //touXiangImageView
...@@ -109,19 +109,22 @@ ...@@ -109,19 +109,22 @@
self.weiZhiImageView.contentMode = UIViewContentModeScaleAspectFit; self.weiZhiImageView.contentMode = UIViewContentModeScaleAspectFit;
[imageView addSubview:self.weiZhiImageView]; [imageView addSubview:self.weiZhiImageView];
[self.weiZhiImageView mas_makeConstraints:^(MASConstraintMaker *make) {
make.top.equalTo(hengXianView.mas_bottom).mas_offset(KScaleWidth(13));
make.left.equalTo(self.touXiangImageView).offset(KScaleWidth(0));
make.size.mas_offset(CGSizeMake(KScaleWidth(9), KScaleWidth(12.5)));
}];
//weiZhiLabel //weiZhiLabel
self.weiZhiLabel = [UILabel labelWithtext:@"北京市朝阳区建国门外大街甲14号广播大厦" font:[UIFont systemFontOfSize:KFont(12)] textColor:[UIColor colorWithHex:0x999999] alignment:NSTextAlignmentCenter]; self.weiZhiLabel = [UILabel labelWithtext:@"北京市朝阳区建国门外大街甲14号广播大厦" font:[UIFont systemFontOfSize:KFont(12)] textColor:[UIColor colorWithHex:0x999999] alignment:NSTextAlignmentLeft];
self.weiZhiLabel.numberOfLines = 0;
self.weiZhiLabel.adjustsFontSizeToFitWidth = YES;
[imageView addSubview:self.weiZhiLabel]; [imageView addSubview:self.weiZhiLabel];
[self.weiZhiLabel mas_makeConstraints:^(MASConstraintMaker *make) { [self.weiZhiLabel mas_makeConstraints:^(MASConstraintMaker *make) {
make.top.equalTo(self.weiZhiImageView).mas_offset(KScaleWidth(0)); make.top.equalTo(hengXianView.mas_bottom).mas_offset(KScaleWidth(0));
make.left.equalTo(self.weiZhiImageView.mas_right).mas_offset(8); make.left.equalTo(self.weiZhiImageView.mas_right).mas_offset(8);
make.bottom.equalTo(self.weiZhiImageView).mas_offset(0); make.bottom.equalTo(imageView).mas_offset(-KScaleWidth(4));
make.right.equalTo(imageView.mas_right).mas_offset(-23);
}];
[self.weiZhiImageView mas_makeConstraints:^(MASConstraintMaker *make) {
make.centerY.equalTo(self.weiZhiLabel.mas_centerY);
make.left.equalTo(self.touXiangImageView).offset(KScaleWidth(0));
make.size.mas_offset(CGSizeMake(KScaleWidth(9), KScaleWidth(12.5)));
}]; }];
//sheZhiButton //sheZhiButton
......
...@@ -192,7 +192,7 @@ ...@@ -192,7 +192,7 @@
} }
} }
weakSelf.currentProduct = weakSelf.products.firstObject; weakSelf.currentProduct = weakSelf.products.firstObject;
weakSelf.orderLab.text = [NSString stringWithFormat:@"%.0f",weakSelf.currentProduct.cash]; weakSelf.orderLab.text = [NSString stringWithFormat:@"%.0f",weakSelf.currentProduct.cash];
self.productID = weakSelf.currentProduct.productId; self.productID = weakSelf.currentProduct.productId;
[self updateScrollView:weakSelf.orderLab.text des:nil]; [self updateScrollView:weakSelf.orderLab.text des:nil];
......
...@@ -27,12 +27,20 @@ import UIKit ...@@ -27,12 +27,20 @@ import UIKit
rightButton.setTitle(NSLocalizedString("location_check_tutorial_cancel", comment: ""), for: .normal) rightButton.setTitle(NSLocalizedString("location_check_tutorial_cancel", comment: ""), for: .normal)
} }
override func layoutIfNeeded() {
super.layoutIfNeeded()
leftButton.layer.cornerRadius = leftButton.frame.size.height/2;
rightButton.layer.cornerRadius = rightButton.frame.size.height/2;
}
/// 展示 /// 展示
@objc func show() { @objc func show() {
guard let view = UIApplication.shared.keyWindow else { return } guard let view = UIApplication.shared.keyWindow else { return }
self.frame = view.bounds; self.frame = view.bounds;
view.addSubview(self) view.addSubview(self)
self.layoutIfNeeded()
} }
/// 消失 /// 消失
......
...@@ -238,6 +238,10 @@ ...@@ -238,6 +238,10 @@
if (_areaCodeCallBack) { if (_areaCodeCallBack) {
_areaCodeCallBack([NSString stringWithFormat:@"%@", model.phoneCode]); _areaCodeCallBack([NSString stringWithFormat:@"%@", model.phoneCode]);
} }
if (self.presentingViewController) {
[self.navigationController dismissViewControllerAnimated:YES completion:nil];
return;
}
[self.navigationController popViewControllerAnimated:YES]; [self.navigationController popViewControllerAnimated:YES];
} }
......
...@@ -18,6 +18,7 @@ ...@@ -18,6 +18,7 @@
UITextField * phoneTextfield; UITextField * phoneTextfield;
UITextField * codeTextfield; UITextField * codeTextfield;
UITextField * currentTextfield; UITextField * currentTextfield;
UIButton * loginBtn;
UITextView *textview; UITextView *textview;
BOOL isSelect; BOOL isSelect;
...@@ -109,8 +110,8 @@ ...@@ -109,8 +110,8 @@
}]; }];
[phoneTextfield becomeFirstResponder]; [phoneTextfield becomeFirstResponder];
UIView * leftView = [[UIView alloc] initWithFrame:CGRectMake(0, 0, KScaleWidth(99), KScaleWidth(50))]; UIView * leftView = [[UIView alloc] initWithFrame:CGRectMake(0, 0, KScaleWidth(80), KScaleWidth(50))];
UIButton * areaCodeBtn = [[UIButton alloc] initWithFrame:CGRectMake(0, 0, KScaleWidth(99-24), KScaleWidth(50))]; UIButton * areaCodeBtn = [[UIButton alloc] initWithFrame:CGRectMake(0, 0, KScaleWidth(80-24), KScaleWidth(50))];
areaCodeBtn.titleLabel.adjustsFontSizeToFitWidth = YES; areaCodeBtn.titleLabel.adjustsFontSizeToFitWidth = YES;
areaCodeBtn.titleLabel.font = [UIFont systemFontOfSize:KFont(18)]; areaCodeBtn.titleLabel.font = [UIFont systemFontOfSize:KFont(18)];
[areaCodeBtn setTitleColor:kMassColor forState:(UIControlStateNormal)]; [areaCodeBtn setTitleColor:kMassColor forState:(UIControlStateNormal)];
...@@ -119,8 +120,8 @@ ...@@ -119,8 +120,8 @@
currentCountryCode = [[self.data Read] objectForKey:@"currentCountryCode"]; currentCountryCode = [[self.data Read] objectForKey:@"currentCountryCode"];
[areaCodeBtn setTitle:[NSString stringWithFormat:@"+%@", [[self.data Read] objectForKey:@"currentCountryCode"]] forState:(UIControlStateNormal)]; [areaCodeBtn setTitle:[NSString stringWithFormat:@"+%@", [[self.data Read] objectForKey:@"currentCountryCode"]] forState:(UIControlStateNormal)];
}else{ }else{
currentCountryCode = @"86"; currentCountryCode = @"1";
[areaCodeBtn setTitle:@"+86" forState:(UIControlStateNormal)]; [areaCodeBtn setTitle:@"+1" forState:(UIControlStateNormal)];
} }
[areaCodeBtn addTarget:self action:@selector(areaBtnClick:) forControlEvents:(UIControlEventTouchUpInside)]; [areaCodeBtn addTarget:self action:@selector(areaBtnClick:) forControlEvents:(UIControlEventTouchUpInside)];
[leftView addSubview:areaCodeBtn]; [leftView addSubview:areaCodeBtn];
...@@ -206,12 +207,14 @@ ...@@ -206,12 +207,14 @@
// }]; // }];
} }
UIButton * loginBtn = [[UIButton alloc] init]; loginBtn = [[UIButton alloc] init];
// [loginBtn setBackgroundImage:[UIImage imageNamed:@"login_phone_loginBtn_bg"] forState:(UIControlStateNormal)]; // [loginBtn setBackgroundImage:[UIImage imageNamed:@"login_phone_loginBtn_bg"] forState:(UIControlStateNormal)];
// [loginBtn setBackgroundImage:[UIImage imageNamed:@"login_phone_loginBtn_bg"] forState:(UIControlStateSelected)]; // [loginBtn setBackgroundImage:[UIImage imageNamed:@"login_phone_loginBtn_bg"] forState:(UIControlStateSelected)];
[loginBtn setTitle:kLocalizedString(@"login") forState:UIControlStateNormal]; [loginBtn setTitle:kLocalizedString(@"login") forState:UIControlStateNormal];
[loginBtn setTitle:kLocalizedString(@"login") forState:UIControlStateSelected]; [loginBtn setTitle:kLocalizedString(@"login") forState:UIControlStateSelected];
loginBtn.backgroundColor = kMassColor; // loginBtn.backgroundColor = kMassColor;
loginBtn.userInteractionEnabled = NO;
loginBtn.backgroundColor = kColorWithRGBA(86, 142, 252, 0.5f);
loginBtn.titleLabel.font = [UIFont systemFontOfSize:KFont(18)]; loginBtn.titleLabel.font = [UIFont systemFontOfSize:KFont(18)];
loginBtn.layer.cornerRadius = KScaleWidth(50)/2; loginBtn.layer.cornerRadius = KScaleWidth(50)/2;
[loginBtn addTarget:self action:@selector(login) forControlEvents:(UIControlEventTouchUpInside)]; [loginBtn addTarget:self action:@selector(login) forControlEvents:(UIControlEventTouchUpInside)];
...@@ -265,6 +268,14 @@ ...@@ -265,6 +268,14 @@
lab.text = @""; lab.text = @"";
} }
} }
if (textField.text.length == 4 && phoneTextfield.text.length != 0) {
loginBtn.userInteractionEnabled = YES;
loginBtn.backgroundColor = kMassColor;
}else{
loginBtn.userInteractionEnabled = NO;
loginBtn.backgroundColor = kColorWithRGBA(86, 142, 252, 0.5f);
}
} }
- (void)codeTap:(UITapGestureRecognizer *)tap{ - (void)codeTap:(UITapGestureRecognizer *)tap{
...@@ -432,7 +443,7 @@ ...@@ -432,7 +443,7 @@
BaseWebViewController * web = [[BaseWebViewController alloc] init]; BaseWebViewController * web = [[BaseWebViewController alloc] init];
// web.url = [dic objectForKey:@"user"]; // web.url = [dic objectForKey:@"user"];
web.url = [dic objectForKey:@""]; web.url = [dic objectForKey:@"privacy"];
[self.navigationController pushViewController:web animated:YES]; [self.navigationController pushViewController:web animated:YES];
return NO; return NO;
...@@ -441,7 +452,7 @@ ...@@ -441,7 +452,7 @@
BaseWebViewController * web = [[BaseWebViewController alloc] init]; BaseWebViewController * web = [[BaseWebViewController alloc] init];
// web.url = [dic objectForKey:@"privacy"]; // web.url = [dic objectForKey:@"privacy"];
web.url = [dic objectForKey:@""]; web.url = [dic objectForKey:@"privacy"];
[self.navigationController pushViewController:web animated:YES]; [self.navigationController pushViewController:web animated:YES];
return NO; return NO;
......
...@@ -13,8 +13,7 @@ ...@@ -13,8 +13,7 @@
@implementation Protocol { @implementation Protocol {
UIView *_bgView; UIView *_bgView;
UILabel *_biaoTiLabel; UILabel *_biaoTiLabel;
UILabel *_neiRongLabel;
UIScrollView * scrollView;
UITextView *_textView; UITextView *_textView;
UIButton *_lBtn; UIButton *_lBtn;
...@@ -56,91 +55,42 @@ ...@@ -56,91 +55,42 @@
make.height.mas_offset(KScaleWidth(16)); make.height.mas_offset(KScaleWidth(16));
}]; }];
//neiRongLabel //textView
NSString *str = kLocalizedString(@"alert_procotol"); NSString *str = kLocalizedString(@"alert_procotol");
_neiRongLabel = [UILabel labelWithtext:str font:[UIFont systemFontOfSize:KFont(13)] textColor:[UIColor colorWithHex:0x333333] alignment:NSTextAlignmentLeft]; NSString * privacy = kLocalizedString(@"setting_privacy");
//设置行间距
NSMutableAttributedString *attributedStr = [[NSMutableAttributedString alloc] initWithString:str];
NSMutableParagraphStyle *paragraphStyle = [[NSMutableParagraphStyle alloc] init];
paragraphStyle.lineSpacing = 1;
[attributedStr addAttribute:NSParagraphStyleAttributeName value:paragraphStyle range:NSMakeRange(0, attributedStr.length)];
_neiRongLabel.attributedText = attributedStr; NSMutableParagraphStyle *paragraphStyle = [[NSMutableParagraphStyle alloc] init];
_neiRongLabel.numberOfLines = 0; paragraphStyle.lineSpacing = 2;
// [_bgView addSubview:_neiRongLabel];
CGRect rect = [str boundingRectWithSize:CGSizeMake(KScaleWidth(320)-KScaleWidth(50), MAXFLOAT) options:(NSStringDrawingUsesLineFragmentOrigin|NSStringDrawingUsesFontLeading) attributes:@{NSFontAttributeName:[UIFont systemFontOfSize:KFont(13)], NSParagraphStyleAttributeName:paragraphStyle} context:nil];
scrollView = [[UIScrollView alloc] init];
[_bgView addSubview:scrollView];
CGFloat labHeight = rect.size.height;
if (rect.size.height > KScreenHeight*3/5){
labHeight = KScreenHeight*3/5;
}
scrollView.contentSize = CGSizeMake(0, rect.size.height);
[scrollView mas_makeConstraints:^(MASConstraintMaker *make) {
make.top.mas_equalTo(_biaoTiLabel.mas_bottom).mas_offset(KScaleWidth(8));
make.left.equalTo(_bgView).mas_offset(KScaleWidth(25));
make.right.equalTo(_bgView).mas_offset(KScaleWidth(-25));
make.height.mas_equalTo(labHeight);
}];
UIView * containerView = [UIView new]; NSMutableAttributedString * attributeStr1 = [[NSMutableAttributedString alloc] initWithString:str];
[scrollView addSubview:containerView]; [attributeStr1 addAttribute:NSLinkAttributeName value:@"click1://" range:[str rangeOfString:privacy]];
[containerView mas_makeConstraints:^(MASConstraintMaker *make) {
make.edges.equalTo(scrollView);
make.width.equalTo(scrollView);
}];
[containerView addSubview:_neiRongLabel];
[_neiRongLabel mas_makeConstraints:^(MASConstraintMaker *make) { [attributeStr1 addAttributes:@{NSFontAttributeName:[UIFont systemFontOfSize:KFont(13)], NSParagraphStyleAttributeName:paragraphStyle} range:NSMakeRange(0, attributeStr1.length)];
make.edges.mas_equalTo(containerView);
}];
[containerView mas_makeConstraints:^(MASConstraintMaker *make) {
make.bottom.equalTo(_neiRongLabel.mas_bottom);
}];
//textView
_textView = [[UITextView alloc] initWithFrame:CGRectMake(10, 100, 400, 100)]; // [attributeStr1 addAttribute:NSForegroundColorAttributeName value:[UIColor colorWithRed:51/225.0 green:51/225.0 blue:51/225.0 alpha:1] range:NSMakeRange(0, attributeStr1.length)];
[_bgView addSubview:_textView];
NSString *text1 = kLocalizedString(@"alert_read");
NSString *text2 = [NSString stringWithFormat:@"《%@》", kLocalizedString(@"setting_privacy")];
NSString *text3 = kLocalizedString(@"alert_and");
NSString *text4 = [NSString stringWithFormat:@"《%@》", kLocalizedString(@"setting_service")];
NSString *text5 = kLocalizedString(@"alert_learn");
NSMutableAttributedString * attributeStr1 = [[NSMutableAttributedString alloc] initWithString:[NSString stringWithFormat:@"%@%@%@%@%@", text1, text2, text3, text4, text5]];
[attributeStr1 addAttribute:NSLinkAttributeName value:@"click1://" range:NSMakeRange(text1.length, text2.length)];
[attributeStr1 addAttribute:NSLinkAttributeName value:@"click2://" range:NSMakeRange(text1.length + text2.length + text3.length, text4.length)];
[attributeStr1 addAttribute:NSParagraphStyleAttributeName value:paragraphStyle range:NSMakeRange(0, attributeStr1.length)];
[attributeStr1 addAttribute:NSForegroundColorAttributeName value:[UIColor colorWithRed:51/225.0 green:51/225.0 blue:51/225.0 alpha:1] range:NSMakeRange(0, attributeStr1.length)]; CGRect rect = [str boundingRectWithSize:CGSizeMake(KScaleWidth(320)-KScaleWidth(50), MAXFLOAT) options:(NSStringDrawingUsesLineFragmentOrigin|NSStringDrawingUsesFontLeading) attributes:@{NSFontAttributeName:[UIFont systemFontOfSize:KFont(13)], NSParagraphStyleAttributeName:paragraphStyle} context:nil];
_textView = [[UITextView alloc] init];
_textView.attributedText = attributeStr1; _textView.attributedText = attributeStr1;
_textView.linkTextAttributes = @{NSUnderlineStyleAttributeName:@1, NSUnderlineColorAttributeName:[UIColor blackColor], NSForegroundColorAttributeName:[UIColor blackColor]};
_textView.delegate = self; _textView.delegate = self;
_textView.font = [UIFont systemFontOfSize:KFont(13)];
_textView.textColor = [UIColor blackColor];
_textView.textAlignment = NSTextAlignmentLeft; _textView.textAlignment = NSTextAlignmentLeft;
_textView.showsHorizontalScrollIndicator = NO;
_textView.showsVerticalScrollIndicator = NO;
_textView.editable = NO; //必须禁止输入,否则点击将弹出输入键盘 _textView.editable = NO; //必须禁止输入,否则点击将弹出输入键盘
// _textView.scrollEnabled = NO; [_bgView addSubview:_textView];
// [_textView mas_makeConstraints:^(MASConstraintMaker *make) {
// make.top.equalTo(_bgView).mas_offset(KScaleWidth(335.5));
// make.left.equalTo(_bgView).mas_offset(KScaleWidth(25));
// make.right.equalTo(_bgView).mas_offset(KScaleWidth(-38));
// make.bottom.equalTo(_bgView).mas_offset(KScaleWidth(-98));
// }];
[_textView mas_makeConstraints:^(MASConstraintMaker *make) { [_textView mas_makeConstraints:^(MASConstraintMaker *make) {
make.top.mas_lessThanOrEqualTo(scrollView.mas_bottom).mas_offset(KScaleWidth(5)); make.top.mas_equalTo(_biaoTiLabel.mas_bottom).mas_offset(KScaleWidth(8));
make.left.equalTo(scrollView).mas_offset(KScaleWidth(0)); make.left.equalTo(_bgView).mas_offset(KScaleWidth(25));
make.right.equalTo(scrollView).mas_offset(KScaleWidth(-0)); make.right.equalTo(_bgView).mas_offset(KScaleWidth(-20));
make.height.mas_equalTo(KScaleWidth(44)); // make.centerY.mas_equalTo(_bgView);
make.height.mas_equalTo(rect.size.height+24);
}]; }];
// 左侧按钮 // 左侧按钮
_lBtn = [UIButton buttonWithType:UIButtonTypeCustom]; _lBtn = [UIButton buttonWithType:UIButtonTypeCustom];
[_lBtn setTitle:kLocalizedString(@"alert_disagree") forState:0]; [_lBtn setTitle:kLocalizedString(@"alert_disagree") forState:0];
...@@ -149,7 +99,7 @@ ...@@ -149,7 +99,7 @@
[_lBtn setBackgroundColor:[UIColor colorWithHex:0xffffff]]; [_lBtn setBackgroundColor:[UIColor colorWithHex:0xffffff]];
[_bgView addSubview:_lBtn]; [_bgView addSubview:_lBtn];
[_lBtn mas_makeConstraints:^(MASConstraintMaker *make) { [_lBtn mas_makeConstraints:^(MASConstraintMaker *make) {
make.top.equalTo(_textView.mas_bottom).mas_offset(KScaleWidth(10)); make.top.equalTo(_textView.mas_bottom).mas_offset(KScaleWidth(15));
make.left.equalTo(_bgView).mas_offset(KScaleWidth(25)); make.left.equalTo(_bgView).mas_offset(KScaleWidth(25));
make.bottom.mas_lessThanOrEqualTo(_bgView.mas_bottom).mas_offset(KScaleWidth(-9)); make.bottom.mas_lessThanOrEqualTo(_bgView.mas_bottom).mas_offset(KScaleWidth(-9));
make.size.mas_offset(CGSizeMake(KScaleWidth(125), KScaleWidth(40))); make.size.mas_offset(CGSizeMake(KScaleWidth(125), KScaleWidth(40)));
...@@ -168,7 +118,7 @@ ...@@ -168,7 +118,7 @@
[_rBtn setBackgroundColor:[UIColor colorWithHex:0x568EFC]]; [_rBtn setBackgroundColor:[UIColor colorWithHex:0x568EFC]];
[_bgView addSubview:_rBtn]; [_bgView addSubview:_rBtn];
[_rBtn mas_makeConstraints:^(MASConstraintMaker *make) { [_rBtn mas_makeConstraints:^(MASConstraintMaker *make) {
make.top.equalTo(_textView.mas_bottom).mas_offset(KScaleWidth(10)); make.top.equalTo(_textView.mas_bottom).mas_offset(KScaleWidth(15));
make.right.equalTo(_bgView).mas_offset(KScaleWidth(-25)); make.right.equalTo(_bgView).mas_offset(KScaleWidth(-25));
make.bottom.mas_lessThanOrEqualTo(_bgView.mas_bottom).mas_offset(KScaleWidth(-9)); make.bottom.mas_lessThanOrEqualTo(_bgView.mas_bottom).mas_offset(KScaleWidth(-9));
make.size.mas_offset(CGSizeMake(KScaleWidth(125), KScaleWidth(40))); make.size.mas_offset(CGSizeMake(KScaleWidth(125), KScaleWidth(40)));
......
...@@ -73,8 +73,8 @@ ...@@ -73,8 +73,8 @@
currentCountryCode = [[self.data Read] objectForKey:@"currentCountryCode"]; currentCountryCode = [[self.data Read] objectForKey:@"currentCountryCode"];
[areaCodeBtn setTitle:[NSString stringWithFormat:@"+%@", [[self.data Read] objectForKey:@"currentCountryCode"]] forState:(UIControlStateNormal)]; [areaCodeBtn setTitle:[NSString stringWithFormat:@"+%@", [[self.data Read] objectForKey:@"currentCountryCode"]] forState:(UIControlStateNormal)];
}else{ }else{
currentCountryCode = @"86"; currentCountryCode = @"1";
[areaCodeBtn setTitle:@"+86" forState:(UIControlStateNormal)]; [areaCodeBtn setTitle:@"+1" forState:(UIControlStateNormal)];
} }
[areaCodeBtn setTitleColor:kColorWithRGB(33, 33, 33) forState:(UIControlStateNormal)]; [areaCodeBtn setTitleColor:kColorWithRGB(33, 33, 33) forState:(UIControlStateNormal)];
[areaCodeBtn addTarget:self action:@selector(areaBtnClick:) forControlEvents:(UIControlEventTouchUpInside)]; [areaCodeBtn addTarget:self action:@selector(areaBtnClick:) forControlEvents:(UIControlEventTouchUpInside)];
......
...@@ -16,10 +16,7 @@ ...@@ -16,10 +16,7 @@
#import "ZJFriendModel.h" #import "ZJFriendModel.h"
#import "ZJOauthLoginConfig.h" #import "ZJOauthLoginConfig.h"
@interface ZJEmergencyContactViewController ()<UITableViewDelegate,UITableViewDataSource>{ @interface ZJEmergencyContactViewController ()<UITableViewDelegate,UITableViewDataSource>
NSString * currentCountryCode;
}
@property (nonatomic, strong) ZJBasetableView *tableView; @property (nonatomic, strong) ZJBasetableView *tableView;
...@@ -47,11 +44,6 @@ ...@@ -47,11 +44,6 @@
self.navigationItem.title = kLocalizedString(@"mine_emergenry_contacts"); self.navigationItem.title = kLocalizedString(@"mine_emergenry_contacts");
[self setUI]; [self setUI];
if ([[self.data Read] objectForKey:@"currentCountryCode"]) {
currentCountryCode = [[self.data Read] objectForKey:@"currentCountryCode"];
}else{
currentCountryCode = @"86";
}
} }
- (void)setUI{ - (void)setUI{
...@@ -199,8 +191,8 @@ ...@@ -199,8 +191,8 @@
}; };
}; };
add.phoneTFCallBack = ^(NSString * phoneNum) { add.phoneTFCallBack = ^(NSString * phoneNum, NSString * areaCode) {
[self addEmergencyContactWithPhone:phoneNum]; [self addEmergencyContactWithPhone:phoneNum area:areaCode];
}; };
} }
...@@ -249,14 +241,14 @@ ...@@ -249,14 +241,14 @@
} }
#pragma mark 添加紧急联系人 通过phoneNum #pragma mark 添加紧急联系人 通过phoneNum
- (void)addEmergencyContactWithPhone:(NSString *)phone{ - (void)addEmergencyContactWithPhone:(NSString *)phone area:(NSString *)code{
if (![ZJUserInfoManager shared].isLogin) { if (![ZJUserInfoManager shared].isLogin) {
//未登录 //未登录
return; return;
} }
[[TQNetworkTools shared] postWithAction:addFriendContactByPhoneNo parameters:@{@"phoneNo":phone/*, @"phoneCode":currentCountryCode*/} success:^(id _Nonnull response) { [[TQNetworkTools shared] postWithAction:addFriendContactByPhoneNo parameters:@{@"phoneNo":phone, @"phoneCode":code} success:^(id _Nonnull response) {
if([[response objectForKey:@"status"] integerValue] == 200){ if([[response objectForKey:@"status"] integerValue] == 200){
[self getEmergencyContactList]; [self getEmergencyContactList];
......
...@@ -198,27 +198,27 @@ static NSString *ID = @"mineID"; ...@@ -198,27 +198,27 @@ static NSString *ID = @"mineID";
if (_isVip) { if (_isVip) {
dataSource = @[@{@"icon":@"Mine_Cell_Icon_2", @"title":kLocalizedString(@"mine_track")}, dataSource = @[@{@"icon":@"Mine_Cell_Icon_2", @"title":kLocalizedString(@"mine_track")},
@{@"icon":@"Mine_Cell_Icon_3", @"title":kLocalizedString(@"mine_emergenry_contacts")}, @{@"icon":@"Mine_Cell_Icon_3", @"title":kLocalizedString(@"mine_emergenry_contacts")},
@{@"icon":@"Mine_Cell_Icon_4", @"title":kLocalizedString(@"mine_guides")}, /*@{@"icon":@"Mine_Cell_Icon_4", @"title":kLocalizedString(@"mine_guides")},*/
@{@"icon":@"Mine_Cell_Icon_5", @"title":kLocalizedString(@"mine_share")}, @{@"icon":@"Mine_Cell_Icon_5", @"title":kLocalizedString(@"mine_share")},
@{@"icon":@"Mine_Cell_Icon_6", @"title":kLocalizedString(@"mine_location_setting")}, @{@"icon":@"Mine_Cell_Icon_6", @"title":kLocalizedString(@"mine_location_setting")},
@{@"icon":@"Mine_Cell_Icon_7", @"title":kLocalizedString(@"mine_online_service")}]; @{@"icon":@"Mine_Cell_Icon_7", @"title":kLocalizedString(@"mine_online_service")}];
if(![ZJShareManager installed]){ if(![ZJShareManager installed]){
dataSource = @[@{@"icon":@"Mine_Cell_Icon_2", @"title":kLocalizedString(@"mine_track")}, dataSource = @[@{@"icon":@"Mine_Cell_Icon_2", @"title":kLocalizedString(@"mine_track")},
@{@"icon":@"Mine_Cell_Icon_3", @"title":kLocalizedString(@"mine_emergenry_contacts")}, @{@"icon":@"Mine_Cell_Icon_3", @"title":kLocalizedString(@"mine_emergenry_contacts")},
@{@"icon":@"Mine_Cell_Icon_4", @"title":kLocalizedString(@"mine_guides")}, /*@{@"icon":@"Mine_Cell_Icon_4", @"title":kLocalizedString(@"mine_guides")},*/
@{@"icon":@"Mine_Cell_Icon_6", @"title":kLocalizedString(@"mine_location_setting")}, @{@"icon":@"Mine_Cell_Icon_6", @"title":kLocalizedString(@"mine_location_setting")},
@{@"icon":@"Mine_Cell_Icon_7", @"title":kLocalizedString(@"mine_online_service")}]; @{@"icon":@"Mine_Cell_Icon_7", @"title":kLocalizedString(@"mine_online_service")}];
} }
}else { }else {
dataSource = @[@{@"icon":@"Mine_Cell_Icon_2", @"title":kLocalizedString(@"mine_track")}, dataSource = @[@{@"icon":@"Mine_Cell_Icon_2", @"title":kLocalizedString(@"mine_track")},
@{@"icon":@"Mine_Cell_Icon_3", @"title":kLocalizedString(@"mine_emergenry_contacts")}, @{@"icon":@"Mine_Cell_Icon_3", @"title":kLocalizedString(@"mine_emergenry_contacts")},
@{@"icon":@"Mine_Cell_Icon_4", @"title":kLocalizedString(@"mine_guides")}, /*@{@"icon":@"Mine_Cell_Icon_4", @"title":kLocalizedString(@"mine_guides")},*/
@{@"icon":@"Mine_Cell_Icon_5", @"title":kLocalizedString(@"mine_share")}, @{@"icon":@"Mine_Cell_Icon_5", @"title":kLocalizedString(@"mine_share")},
@{@"icon":@"Mine_Cell_Icon_6", @"title":kLocalizedString(@"mine_location_setting")}]; @{@"icon":@"Mine_Cell_Icon_6", @"title":kLocalizedString(@"mine_location_setting")}];
if(![ZJShareManager installed]){ if(![ZJShareManager installed]){
dataSource = @[@{@"icon":@"Mine_Cell_Icon_2", @"title":kLocalizedString(@"mine_track")}, dataSource = @[@{@"icon":@"Mine_Cell_Icon_2", @"title":kLocalizedString(@"mine_track")},
@{@"icon":@"Mine_Cell_Icon_3", @"title":kLocalizedString(@"mine_emergenry_contacts")}, @{@"icon":@"Mine_Cell_Icon_3", @"title":kLocalizedString(@"mine_emergenry_contacts")},
@{@"icon":@"Mine_Cell_Icon_4", @"title":kLocalizedString(@"mine_guides")}, /*@{@"icon":@"Mine_Cell_Icon_4", @"title":kLocalizedString(@"mine_guides")},*/
@{@"icon":@"Mine_Cell_Icon_6", @"title":kLocalizedString(@"mine_location_setting")}]; @{@"icon":@"Mine_Cell_Icon_6", @"title":kLocalizedString(@"mine_location_setting")}];
} }
} }
...@@ -308,23 +308,23 @@ static NSString *ID = @"mineID"; ...@@ -308,23 +308,23 @@ static NSString *ID = @"mineID";
case 1: case 1:
[self urgencyPerson]; [self urgencyPerson];
break; break;
// case 2:
// [self useHandler:indexPath.row];
// break;
case 2: case 2:
[self useHandler:indexPath.row];
break;
case 3:
[self share]; [self share];
break; break;
case 4: case 3:
[self locationSet]; [self locationSet];
break; break;
case 5: case 4:
if (self.isVip){ if (self.isVip){
[self onlineKefu:indexPath.row]; [self onlineKefu:indexPath.row];
}else { }else {
[self feedBack]; [self feedBack];
} }
break; break;
case 6: case 5:
[self feedBack]; [self feedBack];
break; break;
default: default:
...@@ -338,23 +338,23 @@ static NSString *ID = @"mineID"; ...@@ -338,23 +338,23 @@ static NSString *ID = @"mineID";
case 1: case 1:
[self urgencyPerson]; [self urgencyPerson];
break; break;
// case 2:
// [self useHandler:indexPath.row];
// break;
case 2: case 2:
[self useHandler:indexPath.row];
break;
case 3:
[self locationSet]; [self locationSet];
break; break;
case 4: case 3:
if (self.isVip){ if (self.isVip){
[self onlineKefu:indexPath.row]; [self onlineKefu:indexPath.row];
}else { }else {
[self feedBack]; [self feedBack];
} }
break; break;
case 5: case 4:
[self feedBack]; [self feedBack];
break; break;
case 6: case 5:
break; break;
default: default:
break; break;
......
...@@ -16,10 +16,12 @@ NS_ASSUME_NONNULL_BEGIN ...@@ -16,10 +16,12 @@ NS_ASSUME_NONNULL_BEGIN
@property (nonatomic, copy) void(^senderCallBack)(id); @property (nonatomic, copy) void(^senderCallBack)(id);
@property (nonatomic, copy) void(^phoneTFCallBack)(id); @property (nonatomic, copy) void(^phoneTFCallBack)(id, id);
@property (nonatomic, copy) NSString * phoneNumStr; @property (nonatomic, copy) NSString * phoneNumStr;
@property (nonatomic, copy) NSString * phoneCodeStr;
- (void)show; - (void)show;
@end @end
......
...@@ -11,6 +11,7 @@ ...@@ -11,6 +11,7 @@
#import <ContactsUI/ContactsUI.h> #import <ContactsUI/ContactsUI.h>
#import "ZJSelectEmergencyPersonVC.h" #import "ZJSelectEmergencyPersonVC.h"
#import "AlertControllerTool.h" #import "AlertControllerTool.h"
#import "ZJAreaCodeSearchVC.h"
@interface ZJAddEmergencyContactView()<UITextFieldDelegate, CNContactPickerDelegate>{ @interface ZJAddEmergencyContactView()<UITextFieldDelegate, CNContactPickerDelegate>{
UIView * bgview; UIView * bgview;
...@@ -18,8 +19,14 @@ ...@@ -18,8 +19,14 @@
UITextField * friendTextField; UITextField * friendTextField;
//通讯录 //通讯录
CNContactPickerViewController * _peoplePickVC; CNContactPickerViewController * _peoplePickVC;
UIButton * areaCodeBtn;
NSString * currentCountryCode;
Data * data;
} }
@property (nonatomic, strong) ZJAreaCodeSearchVC * searchVC;
@end @end
@implementation ZJAddEmergencyContactView @implementation ZJAddEmergencyContactView
...@@ -34,6 +41,7 @@ ...@@ -34,6 +41,7 @@
} }
- (void)setUI{ - (void)setUI{
data = [[Data alloc] init];
self.backgroundColor = [UIColor colorWithRed:0 green:0 blue:0 alpha:0.0]; self.backgroundColor = [UIColor colorWithRed:0 green:0 blue:0 alpha:0.0];
bgview = [[UIView alloc] initWithFrame:CGRectMake(0, KScreenHeight, KScreenWidth, KScaleWidth(265))]; bgview = [[UIView alloc] initWithFrame:CGRectMake(0, KScreenHeight, KScreenWidth, KScaleWidth(265))];
...@@ -78,12 +86,31 @@ ...@@ -78,12 +86,31 @@
[phoneTextField limitTextLength:11]; [phoneTextField limitTextLength:11];
[bgview addSubview:phoneTextField]; [bgview addSubview:phoneTextField];
UIView * phoneTFLeftBgView = [[UIView alloc] initWithFrame:CGRectMake(0, 0, KScaleWidth(29), KScaleWidth(29))]; UIView * phoneTFLeftBgView = [[UIView alloc] initWithFrame:CGRectMake(0, 0, KScaleWidth(29+56+4), KScaleWidth(53))];
UIImageView * phoneTFLeftImageView = [[UIImageView alloc] initWithFrame:phoneTFLeftBgView.frame]; UIImageView * phoneTFLeftImageView = [[UIImageView alloc] initWithFrame:CGRectMake(0, KScaleWidth(12), KScaleWidth(29), KScaleWidth(29))];
phoneTFLeftImageView.image = [UIImage imageNamed:@"mine_emergency_contact_add_tf_leftView_icon"]; phoneTFLeftImageView.image = [UIImage imageNamed:@"mine_emergency_contact_add_tf_leftView_icon"];
phoneTFLeftImageView.contentMode = UIViewContentModeCenter; phoneTFLeftImageView.contentMode = UIViewContentModeCenter;
[phoneTFLeftBgView addSubview:phoneTFLeftImageView]; [phoneTFLeftBgView addSubview:phoneTFLeftImageView];
// UIButton * areaCodeBtn = [[UIButton alloc] initWithFrame:CGRectMake(CGRectGetMaxX(phoneTFLeftImageView.frame), KScaleWidth(9), KScaleWidth(56), KScaleWidth(35))];
areaCodeBtn = [[UIButton alloc] initWithFrame:CGRectMake(CGRectGetMaxX(phoneTFLeftImageView.frame), KScaleWidth(12), KScaleWidth(56), KScaleWidth(29))];
areaCodeBtn.titleLabel.adjustsFontSizeToFitWidth = YES;
areaCodeBtn.titleLabel.font = [UIFont systemFontOfSize:KFont(18)];
areaCodeBtn.layer.cornerRadius = areaCodeBtn.frame.size.height/2;
areaCodeBtn.layer.borderColor = kMassColor.CGColor;
areaCodeBtn.layer.borderWidth = 1.f;
[areaCodeBtn setTitleColor:kMassColor forState:(UIControlStateNormal)];
// areaCodeBtn.contentHorizontalAlignment = UIControlContentHorizontalAlignmentRight;
if ([[data Read] objectForKey:@"currentCountryCode"]) {
currentCountryCode = [[data Read] objectForKey:@"currentCountryCode"];
[areaCodeBtn setTitle:[NSString stringWithFormat:@"+%@", [[data Read] objectForKey:@"currentCountryCode"]] forState:(UIControlStateNormal)];
}else{
currentCountryCode = @"1";
[areaCodeBtn setTitle:@"+1" forState:(UIControlStateNormal)];
}
[areaCodeBtn addTarget:self action:@selector(areaBtnClick:) forControlEvents:(UIControlEventTouchUpInside)];
[phoneTFLeftBgView addSubview:areaCodeBtn];
phoneTextField.leftView = phoneTFLeftBgView; phoneTextField.leftView = phoneTFLeftBgView;
phoneTextField.leftViewMode = UITextFieldViewModeAlways; phoneTextField.leftViewMode = UITextFieldViewModeAlways;
// //
...@@ -187,6 +214,32 @@ ...@@ -187,6 +214,32 @@
phoneTextField.text = phoneNumStr; phoneTextField.text = phoneNumStr;
} }
- (void)setPhoneCodeStr:(NSString *)phoneCodeStr{
_phoneNumStr = phoneCodeStr;
[data WirteDic:phoneCodeStr Key:@"currentCountryCode"];
[areaCodeBtn setTitle:[NSString stringWithFormat:@"+%@", phoneCodeStr] forState:(UIControlStateNormal)];
currentCountryCode = phoneCodeStr;
}
- (void)areaBtnClick:(UIButton *)sender{
dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0), ^{
dispatch_async(dispatch_get_main_queue(), ^{
self.searchVC = [[ZJAreaCodeSearchVC alloc] init];
BaseNavigationViewController * nav = [[BaseNavigationViewController alloc] initWithRootViewController:self.searchVC];
[self.currentVC presentViewController:nav animated:YES completion:nil];
__weak typeof(self) weakSelf = self;
self.searchVC.areaCodeCallBack = ^(NSString * _Nonnull code) {
weakSelf.phoneCodeStr = code;
};
});
});
}
- (void)addressList{ - (void)addressList{
[self getMailListAction]; [self getMailListAction];
} }
...@@ -199,7 +252,7 @@ ...@@ -199,7 +252,7 @@
[self endAnimationWithDispose:YES]; [self endAnimationWithDispose:YES];
if (_phoneTFCallBack) { if (_phoneTFCallBack) {
_phoneTFCallBack(phoneTextField.text); _phoneTFCallBack(phoneTextField.text, currentCountryCode);
} }
}else{ }else{
[MBProgressHUD showMessage:kLocalizedString(@"emergency_enter_phone") toView:self]; [MBProgressHUD showMessage:kLocalizedString(@"emergency_enter_phone") toView:self];
......
...@@ -35,7 +35,8 @@ ...@@ -35,7 +35,8 @@
} }
- (void)setUI { - (void)setUI {
self.setTitleLabel = [UILabel labelWithtext:@"" font:[UIFont fontWithName:@"PingFangSC-Regular" size:15] textColor:[UIColor colorWithHex:0x222222] alignment:NSTextAlignmentLeft];
self.setTitleLabel = [UILabel labelWithtext:@"" font:[UIFont fontWithName:@"PingFangSC-Regular" size:15] textColor:[UIColor colorWithHex:0x222222] alignment:NSTextAlignmentLeft];
self.versionLab = [UILabel labelWithtext:@"" font:[UIFont fontWithName:@"PingFangSC-Regular" size:14] textColor:[UIColor colorWithHex:0x999999] alignment:NSTextAlignmentRight]; self.versionLab = [UILabel labelWithtext:@"" font:[UIFont fontWithName:@"PingFangSC-Regular" size:14] textColor:[UIColor colorWithHex:0x999999] alignment:NSTextAlignmentRight];
...@@ -54,7 +55,7 @@ ...@@ -54,7 +55,7 @@
self.versionLab.sd_layout.centerYEqualToView(self.contentView).rightSpaceToView(self.pushIcon, 4).heightIs(11).widthIs(90); self.versionLab.sd_layout.centerYEqualToView(self.contentView).rightSpaceToView(self.pushIcon, 4).heightIs(11).widthIs(90);
self.setTitleLabel.sd_layout.centerYEqualToView(self.contentView).leftSpaceToView(self.contentView, 18).heightIs(15).widthIs(360); self.setTitleLabel.sd_layout.centerYEqualToView(self.contentView).leftSpaceToView(self.contentView, 18).heightIs(20).widthIs(360);
} }
......
...@@ -86,11 +86,11 @@ ...@@ -86,11 +86,11 @@
switch ([num integerValue]) { switch ([num integerValue]) {
case 1: case 1:
// path = [dic objectForKey:@"privacy"]; // path = [dic objectForKey:@"privacy"];
path = [dic objectForKey:@""]; path = [dic objectForKey:@"privacy"];
break; break;
case 2: case 2:
// path = [dic objectForKey:@"user"]; // path = [dic objectForKey:@"user"];
path = [dic objectForKey:@""]; path = [dic objectForKey:@"privacy"];
break; break;
default: default:
break; break;
......
...@@ -23,7 +23,7 @@ ...@@ -23,7 +23,7 @@
self.window = [[UIWindow alloc] initWithWindowScene:(UIWindowScene *)scene]; self.window = [[UIWindow alloc] initWithWindowScene:(UIWindowScene *)scene];
self.window.frame = [UIScreen mainScreen].bounds; self.window.frame = [UIScreen mainScreen].bounds;
self.window.backgroundColor = [UIColor whiteColor]; self.window.backgroundColor = [UIColor whiteColor];
self.window.rootViewController = [[BaseViewController alloc] init]; // self.window.rootViewController = [[BaseViewController alloc] init];
[self.window makeKeyAndVisible]; [self.window makeKeyAndVisible];
......
...@@ -51,7 +51,7 @@ appName = "Family Mapp"; ...@@ -51,7 +51,7 @@ appName = "Family Mapp";
"alert_loading"="Loading..."; "alert_loading"="Loading...";
"alert_noMore"="No more data"; "alert_noMore"="No more data";
"alert_procotol"=" We intend to provide transparency and ensureuser privacy. Please learn more about how weprocess the data can be obtained about you oryour device. By continuing you confirm that you acknowledge and accept our Privacy Policy."; "alert_procotol"="We intend to provide transparency and ensureuser privacy. Please learn more about how weprocess the data can be obtained about you oryour device. By continuing you confirm that you acknowledge and accept our Privacy Policy.";
//tabbar //tabbar
"tabbar_care"="Friends"; "tabbar_care"="Friends";
...@@ -61,9 +61,9 @@ appName = "Family Mapp"; ...@@ -61,9 +61,9 @@ appName = "Family Mapp";
//login //login
"login"="Accept"; "login"="Accept";
"login_title"="Sign in"; "login_title"="Sign in";
"login_send_code"="Send confirmation code"; "login_send_code"="Get confirmation code";
"login_send_code_again"="Resend"; "login_send_code_again"="Get confirmation code";
"login_already_send_code"="Send confirmation code"; "login_already_send_code"="Get again in";
"login_read"="View"; "login_read"="View";
"area"="Select the area"; "area"="Select the area";
......
...@@ -50,7 +50,7 @@ appName = "Family Mapp"; ...@@ -50,7 +50,7 @@ appName = "Family Mapp";
"alert_loading"="加载中..."; "alert_loading"="加载中...";
"alert_noMore"="没有更多了"; "alert_noMore"="没有更多了";
"alert_procotol"=" 我们打算提供透明度并确保用户隐私,请详细了解我们如何处理有关您的设备的数据。点击同意并继续,即代表您确认您确认并接受我们的隐私政策。"; "alert_procotol"="我们打算提供透明度并确保用户隐私,请详细了解我们如何处理有关您的设备的数据。点击同意并继续,即代表您确认您确认并接受我们的隐私政策。";
//tabbar //tabbar
"tabbar_care"="我关心的人"; "tabbar_care"="我关心的人";
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment