Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
G
GeliBusinessPlatform
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
CI / CD Analytics
Repository Analytics
Value Stream Analytics
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
ljy
GeliBusinessPlatform
Commits
62bf0c6b
Commit
62bf0c6b
authored
Jun 30, 2020
by
lujunye
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
品牌列表搜索
parent
5a0507fd
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
66 additions
and
24 deletions
+66
-24
GeliBusinessPlatform.xcworkspace/xcuserdata/junyelu.xcuserdatad/UserInterfaceState.xcuserstate
...erdata/junyelu.xcuserdatad/UserInterfaceState.xcuserstate
+0
-0
GeliBusinessPlatform/ViewController/新增、编辑品牌/PinPaiListViewController.swift
...orm/ViewController/新增、编辑品牌/PinPaiListViewController.swift
+66
-24
No files found.
GeliBusinessPlatform.xcworkspace/xcuserdata/junyelu.xcuserdatad/UserInterfaceState.xcuserstate
View file @
62bf0c6b
No preview for this file type
GeliBusinessPlatform/ViewController/新增、编辑品牌/PinPaiListViewController.swift
View file @
62bf0c6b
...
...
@@ -80,29 +80,8 @@ class PinPaiListViewController: BaseViewController,UISearchBarDelegate,SearchBar
self
.
navigationController
?
.
pushViewController
(
vc
,
animated
:
true
)
}
func
clearSearchAction
()
{
print
(
"清楚搜索文字"
)
dataModelArray
?
.
removeAll
()
dataModelArray
=
tempArr
listView
.
reloadData
()
}
func
searchBarSearchButtonClicked
(
_
searchBar
:
UISearchBar
)
{
print
(
"点击搜索进行--"
)
searchBar
.
resignFirstResponder
()
if
searchBar
.
text
!.
count
>
0
{
dataModelArray
?
.
removeAll
()
let
str
=
searchBar
.
text
for
item
in
tempArr
!
{
let
strName
=
item
.
brand_name
as!
NSString
if
strName
.
contains
(
str
!
){
dataModelArray
?
.
append
(
item
)
}
}
}
listView
.
reloadData
()
}
func
tableView
(
_
tableView
:
UITableView
,
heightForRowAt
indexPath
:
IndexPath
)
->
CGFloat
{
return
49
}
...
...
@@ -152,7 +131,7 @@ class PinPaiListViewController: BaseViewController,UISearchBarDelegate,SearchBar
let
model
=
datas
[
indexPath
.
row
]
let
vc
=
XinZengPinPaiViewController
()
vc
.
navTitle
=
"品牌详情"
// vc.navTitle = "编辑品牌"
// vc.navTitle = "编辑品牌"
vc
.
iconUrl
=
model
.
brand_img
!
vc
.
pinPaiUrl
=
model
.
site_url
!
vc
.
commend
=
model
.
brand_desc
!
...
...
@@ -228,4 +207,67 @@ class PinPaiListViewController: BaseViewController,UISearchBarDelegate,SearchBar
}
}
//MAKR:--调起搜索后添加个蒙版本
var
blackBtnView
:
UIButton
!
=
nil
func
searchBarSearchButtonClicked
(
_
searchBar
:
UISearchBar
)
{
print
(
"点击搜索进行--"
)
searchBar
.
resignFirstResponder
()
if
isSelectData
{
if
searchBar
.
text
!.
count
>
0
{
dataModelArray
?
.
removeAll
()
let
str
=
searchBar
.
text
for
item
in
tempArr
!
{
let
strName
=
item
.
brand_name
as!
NSString
if
strName
.
contains
(
str
!
){
dataModelArray
?
.
append
(
item
)
}
}
}
listView
.
reloadData
()
}
else
{
keyWord
=
searchBar
.
text
!
listView
.
mj_header
?
.
beginRefreshing
()
}
}
//MARK:--取消搜索代理
func
searchBarTextDidEndEditing
(
_
searchBar
:
UISearchBar
)
{
print
(
"编辑即将结束了--"
)
if
isSelectData
==
false
{
removeBlackBtnView
()
if
searchBar
.
text
?
.
count
==
0
&&
keyWord
.
count
!=
0
{
keyWord
=
searchBar
.
text
!
listView
.
mj_header
?
.
beginRefreshing
()
}
}
}
func
clearSearchAction
()
{
print
(
"清楚搜索文字"
)
if
isSelectData
{
dataModelArray
?
.
removeAll
()
dataModelArray
=
tempArr
listView
.
reloadData
()
}
}
func
searchBarShouldBeginEditing
(
_
searchBar
:
UISearchBar
)
->
Bool
{
print
(
"调起搜索后添加个蒙版本"
)
blackBtnView
=
UIButton
()
blackBtnView
.
backgroundColor
=
UIColor
.
init
(
named
:
"提示视图背景色"
)
self
.
view
.
addSubview
(
blackBtnView
)
blackBtnView
.
snp
.
makeConstraints
{
(
make
)
in
make
.
left
.
right
.
bottom
.
equalToSuperview
()
make
.
top
.
equalTo
(
topView
!.
snp_bottom
)
}
blackBtnView
.
addTarget
(
self
,
action
:
#selector(
removeBlackBtnView
)
,
for
:
.
touchUpInside
)
return
true
}
@objc
func
removeBlackBtnView
(){
if
blackBtnView
!=
nil
{
blackBtnView
.
removeFromSuperview
()
searchV
!.
resignFirstResponder
()
}
}
}
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