Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
pidan
/
FuSiLive
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Snippets
Members
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit
78c39f20
authored
Jun 25, 2024
by
ludi
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
1.登录选择地区可以复选。
2.修复手机登录没显示正确ui的bug
parent
a0440a61
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
55 additions
and
15 deletions
FuSiLive/Classes/Login/Controller/FUSAreaSelectViewController.m
FuSiLive/Classes/Login/Controller/FUSLoginPhoneViewController.m
FuSiLive/Classes/Login/Controller/FUSLoginViewController.m
FuSiLive/Classes/Login/Controller/FUSAreaSelectViewController.m
View file @
78c39f20
...
...
@@ -73,6 +73,8 @@
@property
(
nonatomic
,
assign
)
BOOL
isSearch
;
//是否是搜索内容
@property
(
nonatomic
,
strong
)
NSMutableArray
*
searchArr
;
//搜索的数据源
@property
(
nonatomic
,
copy
)
NSString
*
currentSelectedCode
;
//当前选中的国家编号
@end
...
...
@@ -121,9 +123,9 @@
_searchBar
.
semanticContentAttribute
=
[
UIView
appearance
].
semanticContentAttribute
;
_searchBar
.
delegate
=
self
;
// _searchBar.searchBarStyle = UISearchBarStyleDefault;
[
_searchBar
setImage
:[
UIImage
imageNamed
:
@"icon_search_textfield"
]
forSearchBarIcon
:
UISearchBarIconSearch
state
:
UIControlStateNormal
];
[
_searchBar
setBarTintColor
:
UIColor
.
fus_
appBG
Color
];
UIImage
*
img
=
[
UIImage
imageWithColor
:
UIColor
.
fus_
search
Color
size
:
CGSizeMake
(
50
,
30
)];
//
[_searchBar setImage:[UIImage imageNamed:@"icon_search_textfield"] forSearchBarIcon:UISearchBarIconSearch state:UIControlStateNormal];
[
_searchBar
setBarTintColor
:
UIColor
.
fus_
inpuContent
Color
];
UIImage
*
img
=
[
UIImage
imageWithColor
:
UIColor
.
fus_
inpuContent
Color
size
:
CGSizeMake
(
50
,
30
)];
[
_searchBar
setSearchFieldBackgroundImage
:[
img
jm_imageWithRoundedCornersAndSize
:
CGSizeMake
(
50
,
30
)
andCornerRadius
:
8
]
forState
:
UIControlStateNormal
];
[
_searchBar
setBackgroundImage
:[[
UIImage
alloc
]
init
]];
...
...
@@ -131,7 +133,7 @@
UITextField
*
seachTextFild
=
[
_searchBar
valueForKey
:
@"searchField"
];
//修改字体颜色
seachTextFild
.
textColor
=
[
UIColor
colorWithHex
:
@"#CCCCCC"
];
seachTextFild
.
backgroundColor
=
UIColor
.
fus_searchColor
;
//
seachTextFild.backgroundColor = UIColor.fus_searchColor;
seachTextFild
.
layer
.
cornerRadius
=
2
;
seachTextFild
.
layer
.
masksToBounds
=
YES
;
seachTextFild
.
textAlignment
=
NSTextAlignmentLeft
;
...
...
@@ -154,7 +156,7 @@
UILabel
*
titlelb
=
[[
UILabel
alloc
]
init
];
titlelb
.
text
=
FUSLocalizationHelper
.
localString
(
@"选择国家/地区"
);
titlelb
.
textColor
=
[
UIColor
whiteColor
];
titlelb
.
textColor
=
[
UIColor
fus_textColorRich
];
[
titlelb
sizeToFit
];
self
.
navigationItem
.
titleView
=
titlelb
;
_searchBar
.
placeholder
=
FUSLocalizationHelper
.
localString
(
@"请输入搜索内容"
);
...
...
@@ -163,6 +165,14 @@
//分类数据源
-
(
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
;
//取出数据
_countryDic
=
[
NSMutableDictionary
dictionaryWithDictionary
:[[
FUSCountryHelper
sharedInstance
]
fus_getAllCountries
]];
...
...
@@ -179,6 +189,9 @@
_countryDic
[
obj
]
=
wordCountriesArr
;
}];
__block
NSInteger
selectedSection
=
0
;
__block
NSInteger
selectedRow
=
0
;
[
_countryDic
enumerateKeysAndObjectsUsingBlock
:
^
(
id
_Nonnull
key
,
id
_Nonnull
obj
,
BOOL
*
_Nonnull
stop
)
{
NSMutableArray
*
models
=
[
NSMutableArray
array
];
...
...
@@ -193,6 +206,12 @@
for
(
NSDictionary
*
dic
in
objs
)
{
FUSContryModel
*
model
=
[
FUSContryModel
fus_modelWithDict
:
dic
];
[
models
addObject
:
model
];
if
([
model
.
country_code
isEqualToString
:
self
.
currentSelectedCode
])
{
selectedRow
=
models
.
count
-
1
;
selectedSection
=
index
;
}
[
_dataArr
addObject
:
model
];
}
...
...
@@ -202,6 +221,20 @@
// FUSLogInfo(@"%@",[NSString stringWithFormat:@"%c", index+65]);
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 @@
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
;
}
...
...
FuSiLive/Classes/Login/Controller/FUSLoginPhoneViewController.m
View file @
78c39f20
...
...
@@ -69,6 +69,11 @@
// 初始化View
[
self
initView
];
//fusi color
self
.
titleLabel
.
textColor
=
[
UIColor
fus_textColorRich
];
_areaBgView
.
backgroundColor
=
[
UIColor
blackColor
];
_teleBgView
.
backgroundColor
=
[
UIColor
fus_textInputBackgroundGrayColor
];
}
-
(
void
)
viewWillAppear
:
(
BOOL
)
animated
{
...
...
@@ -137,10 +142,6 @@
[
self
fus_setupLocalStrings
];
[
self
fus_checkStateDidUpdate
];
//fusi color
self
.
titleLabel
.
textColor
=
[
UIColor
fus_textColorRich
];
_areaBgView
.
backgroundColor
=
[
UIColor
fus_textInputBackgroundGrayColor
];
_teleBgView
.
backgroundColor
=
[
UIColor
fus_textInputBackgroundGrayColor
];
}
-
(
void
)
fus_checkStateDidUpdate
{
...
...
FuSiLive/Classes/Login/Controller/FUSLoginViewController.m
View file @
78c39f20
...
...
@@ -72,17 +72,17 @@
// 初始化View
[
self
initView
];
if
([
NSString
isNull
:
_phone
]
||
[
NSDictionary
isNull
:
_countryInfoDict
])
{
return
;
}
else
{
[
_passwordTextField
becomeFirstResponder
];
}
//fusi 客制化颜色
self
.
titleLabel
.
textColor
=
[
UIColor
fus_textColorRich
];
self
.
areaBgView
.
backgroundColor
=
[
UIColor
fus_textInputBackgroundGrayColor
];
self
.
teleBgView
.
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
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment