Commit 32bf8d02 by pierce

Merge branch 'feature/UI修改版本' of http://git.yabolive.net:88/pidan/FuSiLive into feature/UI修改版本

parents 62fb3e9e 2b5ec2c1
...@@ -73,6 +73,8 @@ ...@@ -73,6 +73,8 @@
@property (nonatomic, assign) BOOL isSearch; //是否是搜索内容 @property (nonatomic, assign) BOOL isSearch; //是否是搜索内容
@property (nonatomic, strong) NSMutableArray *searchArr; //搜索的数据源 @property (nonatomic, strong) NSMutableArray *searchArr; //搜索的数据源
@property (nonatomic, copy) NSString *currentSelectedCode; //当前选中的国家编号
@end @end
...@@ -121,9 +123,9 @@ ...@@ -121,9 +123,9 @@
_searchBar.semanticContentAttribute = [UIView appearance].semanticContentAttribute; _searchBar.semanticContentAttribute = [UIView appearance].semanticContentAttribute;
_searchBar.delegate = self; _searchBar.delegate = self;
// _searchBar.searchBarStyle = UISearchBarStyleDefault; // _searchBar.searchBarStyle = UISearchBarStyleDefault;
[_searchBar setImage:[UIImage imageNamed:@"icon_search_textfield"] forSearchBarIcon:UISearchBarIconSearch state:UIControlStateNormal]; // [_searchBar setImage:[UIImage imageNamed:@"icon_search_textfield"] forSearchBarIcon:UISearchBarIconSearch state:UIControlStateNormal];
[_searchBar setBarTintColor:UIColor.fus_appBGColor]; [_searchBar setBarTintColor:UIColor.fus_inpuContentColor];
UIImage *img = [UIImage imageWithColor:UIColor.fus_searchColor size:CGSizeMake(50, 30)]; UIImage *img = [UIImage imageWithColor:UIColor.fus_inpuContentColor size:CGSizeMake(50, 30)];
[_searchBar setSearchFieldBackgroundImage:[img jm_imageWithRoundedCornersAndSize:CGSizeMake(50, 30) andCornerRadius:8] forState:UIControlStateNormal]; [_searchBar setSearchFieldBackgroundImage:[img jm_imageWithRoundedCornersAndSize:CGSizeMake(50, 30) andCornerRadius:8] forState:UIControlStateNormal];
[_searchBar setBackgroundImage:[[UIImage alloc] init]]; [_searchBar setBackgroundImage:[[UIImage alloc] init]];
...@@ -131,7 +133,7 @@ ...@@ -131,7 +133,7 @@
UITextField *seachTextFild = [_searchBar valueForKey:@"searchField"]; UITextField *seachTextFild = [_searchBar valueForKey:@"searchField"];
//修改字体颜色 //修改字体颜色
seachTextFild.textColor = [UIColor colorWithHex:@"#CCCCCC"]; seachTextFild.textColor = [UIColor colorWithHex:@"#CCCCCC"];
seachTextFild.backgroundColor = UIColor.fus_searchColor; // seachTextFild.backgroundColor = UIColor.fus_searchColor;
seachTextFild.layer.cornerRadius = 2; seachTextFild.layer.cornerRadius = 2;
seachTextFild.layer.masksToBounds = YES; seachTextFild.layer.masksToBounds = YES;
seachTextFild.textAlignment = NSTextAlignmentLeft; seachTextFild.textAlignment = NSTextAlignmentLeft;
...@@ -154,7 +156,7 @@ ...@@ -154,7 +156,7 @@
UILabel *titlelb = [[UILabel alloc] init]; UILabel *titlelb = [[UILabel alloc] init];
titlelb.text = FUSLocalizationHelper.localString(@"选择国家/地区"); titlelb.text = FUSLocalizationHelper.localString(@"选择国家/地区");
titlelb.textColor = [UIColor whiteColor]; titlelb.textColor = [UIColor fus_textColorRich];
[titlelb sizeToFit]; [titlelb sizeToFit];
self.navigationItem.titleView = titlelb; self.navigationItem.titleView = titlelb;
_searchBar.placeholder = FUSLocalizationHelper.localString(@"请输入搜索内容"); _searchBar.placeholder = FUSLocalizationHelper.localString(@"请输入搜索内容");
...@@ -163,6 +165,14 @@ ...@@ -163,6 +165,14 @@
//分类数据源 //分类数据源
- (void)sortOutDataSource{ - (void)sortOutDataSource{
NSDictionary *countryInfoDict = [NSUserDefaults.standardUserDefaults dictionaryForKey:USER_COUNTRY_INFO];
if (!countryInfoDict) {
// 设置默认值
countryInfoDict = [[FUSCountryHelper sharedInstance] fus_getCountryInfoForCountryName:@"Taiwan"];
}
self.currentSelectedCode = [countryInfoDict objectForKey:FUSCountryCodeKey];
__block int index = 0; __block int index = 0;
//取出数据 //取出数据
_countryDic = [NSMutableDictionary dictionaryWithDictionary:[[FUSCountryHelper sharedInstance] fus_getAllCountries]]; _countryDic = [NSMutableDictionary dictionaryWithDictionary:[[FUSCountryHelper sharedInstance] fus_getAllCountries]];
...@@ -179,6 +189,9 @@ ...@@ -179,6 +189,9 @@
_countryDic[obj] = wordCountriesArr; _countryDic[obj] = wordCountriesArr;
}]; }];
__block NSInteger selectedSection = 0;
__block NSInteger selectedRow = 0;
[_countryDic enumerateKeysAndObjectsUsingBlock:^(id _Nonnull key, id _Nonnull obj, BOOL * _Nonnull stop) { [_countryDic enumerateKeysAndObjectsUsingBlock:^(id _Nonnull key, id _Nonnull obj, BOOL * _Nonnull stop) {
NSMutableArray *models = [NSMutableArray array]; NSMutableArray *models = [NSMutableArray array];
...@@ -193,6 +206,12 @@ ...@@ -193,6 +206,12 @@
for (NSDictionary *dic in objs) { for (NSDictionary *dic in objs) {
FUSContryModel *model = [FUSContryModel fus_modelWithDict:dic]; FUSContryModel *model = [FUSContryModel fus_modelWithDict:dic];
[models addObject:model]; [models addObject:model];
if ([model.country_code isEqualToString:self.currentSelectedCode]) {
selectedRow = models.count - 1;
selectedSection = index;
}
[_dataArr addObject:model]; [_dataArr addObject:model];
} }
...@@ -202,6 +221,20 @@ ...@@ -202,6 +221,20 @@
// FUSLogInfo(@"%@",[NSString stringWithFormat:@"%c", index+65]); // FUSLogInfo(@"%@",[NSString stringWithFormat:@"%c", index+65]);
index++; index++;
}]; }];
dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(0.1 * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{
if (selectedSection >= self.headers.count) {
return;
}
NSArray *countries = [self.dataDic objectForKey:self.headers[selectedSection]];
if (selectedRow >= countries.count) {
return;
}
[self.addressTableView scrollToRowAtIndexPath:[NSIndexPath indexPathForRow:selectedRow inSection:selectedSection] atScrollPosition:UITableViewScrollPositionTop animated:NO];
});
} }
...@@ -308,6 +341,12 @@ ...@@ -308,6 +341,12 @@
FUSContryModel *model = countries[indexPath.row]; FUSContryModel *model = countries[indexPath.row];
if ([model.country_code isEqualToString:self.currentSelectedCode]) {
cell.addressLb.textColor = [UIColor fus_themeColor];
}else {
cell.addressLb.textColor = [UIColor fus_textColorRich];
}
return cell; return cell;
} }
......
...@@ -69,6 +69,11 @@ ...@@ -69,6 +69,11 @@
// 初始化View // 初始化View
[self initView]; [self initView];
//fusi color
self.titleLabel.textColor = [UIColor fus_textColorRich];
_areaBgView.backgroundColor = [UIColor blackColor];
_teleBgView.backgroundColor = [UIColor fus_textInputBackgroundGrayColor];
} }
- (void)viewWillAppear:(BOOL)animated{ - (void)viewWillAppear:(BOOL)animated{
...@@ -137,10 +142,6 @@ ...@@ -137,10 +142,6 @@
[self fus_setupLocalStrings]; [self fus_setupLocalStrings];
[self fus_checkStateDidUpdate]; [self fus_checkStateDidUpdate];
//fusi color
self.titleLabel.textColor = [UIColor fus_textColorRich];
_areaBgView.backgroundColor = [UIColor fus_textInputBackgroundGrayColor];
_teleBgView.backgroundColor = [UIColor fus_textInputBackgroundGrayColor];
} }
- (void)fus_checkStateDidUpdate { - (void)fus_checkStateDidUpdate {
......
...@@ -72,17 +72,17 @@ ...@@ -72,17 +72,17 @@
// 初始化View // 初始化View
[self initView]; [self initView];
if ([NSString isNull:_phone] || [NSDictionary isNull:_countryInfoDict]) {
return;
}else {
[_passwordTextField becomeFirstResponder];
}
//fusi 客制化颜色 //fusi 客制化颜色
self.titleLabel.textColor = [UIColor fus_textColorRich]; self.titleLabel.textColor = [UIColor fus_textColorRich];
self.areaBgView.backgroundColor = [UIColor fus_textInputBackgroundGrayColor]; self.areaBgView.backgroundColor = [UIColor fus_textInputBackgroundGrayColor];
self.teleBgView.backgroundColor = [UIColor fus_textInputBackgroundGrayColor]; self.teleBgView.backgroundColor = [UIColor fus_textInputBackgroundGrayColor];
self.codeBgView.backgroundColor = [UIColor fus_textInputBackgroundGrayColor]; self.codeBgView.backgroundColor = [UIColor fus_textInputBackgroundGrayColor];
if ([NSString isNull:_phone] || [NSDictionary isNull:_countryInfoDict]) {
return;
}else {
[_passwordTextField becomeFirstResponder];
}
} }
- (void)viewWillAppear:(BOOL)animated{ - (void)viewWillAppear:(BOOL)animated{
......
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 sign in to comment