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
9e4bd83f
Commit
9e4bd83f
authored
Aug 06, 2020
by
lujunye
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
输入搜索实现
parent
aa6d427a
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
43 additions
and
33 deletions
+43
-33
GeliBusinessPlatform.xcworkspace/xcuserdata/junyelu.xcuserdatad/UserInterfaceState.xcuserstate
...erdata/junyelu.xcuserdatad/UserInterfaceState.xcuserstate
+0
-0
GeliBusinessPlatform/ViewController/货拉拉/收发货地址/ToAndFormSelectViewController.swift
...wController/货拉拉/收发货地址/ToAndFormSelectViewController.swift
+43
-33
No files found.
GeliBusinessPlatform.xcworkspace/xcuserdata/junyelu.xcuserdatad/UserInterfaceState.xcuserstate
View file @
9e4bd83f
No preview for this file type
GeliBusinessPlatform/ViewController/货拉拉/收发货地址/ToAndFormSelectViewController.swift
View file @
9e4bd83f
...
...
@@ -20,12 +20,15 @@ protocol ToAndFormSelectViewControllerDelegate {
class
ToAndFormSelectViewController
:
BaseViewController
,
MAMapViewDelegate
,
CLLocationManagerDelegate
,
AMapSearchDelegate
,
UISearchBarDelegate
,
SearchBarViewDelegate
,
UITableViewDelegate
,
UITableViewDataSource
,
CityListViewControllerDelegate
,
HuoLaLaDiZhiCellDelegate
{
func
HuoLaLaDiZhiCellBtnClick
(
model
:
citySearchDataPoiChildrenModel
,
cityStr
:
String
)
{
citySelectBtn
.
setTitle
(
cityStr
,
for
:
.
normal
)
mapView
.
centerCoordinate
=
CLLocationCoordinate2DMake
((
model
.
location
?
.
lat
)
!
,(
model
.
location
?
.
lon
)
!
)
mapView
.
centerCoordinate
=
BLCoordinatesChangeHelper
.
shared
()?
.
bl_wgs84togcj02
((
model
.
location
?
.
lon
)
!
,
andLat
:
(
model
.
location
?
.
lat
)
!
)
as!
CLLocationCoordinate2D
isMove
=
false
adrName
=
model
.
name
!
detailAdr
=
model
.
address
!
searchList
.
isHidden
=
true
closeBtn
.
isHidden
=
true
listViewBG
.
isHidden
=
true
IQKeyboardManager
.
shared
.
resignFirstResponder
()
print
(
"1"
)
}
func
CityListViewControllerLocSelect
(
loc
:
cityListDataModel
)
{
...
...
@@ -39,12 +42,12 @@ class ToAndFormSelectViewController: BaseViewController, MAMapViewDelegate, CLLo
@IBAction
func
citySelectClick
(
_
sender
:
UIButton
)
{
let
vc
=
CityListViewController
()
vc
.
adrDatas
=
adrDatas
!
vc
.
locatStr
=
cityName
as
String
vc
.
delegate
=
self
self
.
navigationController
?
.
pushViewController
(
vc
,
animated
:
true
)
let
vc
=
CityListViewController
()
vc
.
adrDatas
=
adrDatas
!
vc
.
locatStr
=
cityName
as
String
vc
.
delegate
=
self
self
.
navigationController
?
.
pushViewController
(
vc
,
animated
:
true
)
}
...
...
@@ -166,7 +169,7 @@ class ToAndFormSelectViewController: BaseViewController, MAMapViewDelegate, CLLo
let
model
=
searchAdrDatas
[
indexPath
.
row
]
citySelectBtn
.
setTitle
(
model
.
city
!
,
for
:
.
normal
)
let
locData
=
BLCoordinatesChangeHelper
.
shared
()?
.
bl_wgs84togcj02
(
model
.
location
!.
lon
!
,
andLat
:
model
.
location
!.
lat
!
)
isMove
=
false
adrName
=
model
.
name
!
...
...
@@ -196,7 +199,7 @@ class ToAndFormSelectViewController: BaseViewController, MAMapViewDelegate, CLLo
searchBr
.
cornerRadius
=
35
/
2.0
searchBr
.
delegate
=
self
searchBr
.
delegateL
=
self
//
searchBr.returnKeyType = .done
searchBr
.
returnKeyType
=
.
done
if
idx
!=
0
{
sureSelectLbl
.
text
=
"确认收货地"
...
...
@@ -238,7 +241,7 @@ class ToAndFormSelectViewController: BaseViewController, MAMapViewDelegate, CLLo
mapView
.
zoomLevel
=
16
mapView
.
isZoomEnabled
=
true
self
.
mapView
.
centerCoordinate
=
CLLocationCoordinate2DMake
(
lat
,
lng
)
print
(
"=="
,
lat
,
lng
)
MapBgView
.
addSubview
(
mapView
!
)
...
...
@@ -337,7 +340,7 @@ class ToAndFormSelectViewController: BaseViewController, MAMapViewDelegate, CLLo
}
titleLbl
!.
text
=
response
.
pois
.
first
?
.
name
titleLbl
!.
text
=
response
.
pois
.
first
?
.
name
cityName
=
response
.
pois
.
first
?
.
city
as!
NSString
locName
=
response
.
pois
.
first
?
.
name
as!
String
...
...
@@ -437,7 +440,7 @@ class ToAndFormSelectViewController: BaseViewController, MAMapViewDelegate, CLLo
req
.
requireExtension
=
true
search
.
aMapPOIAroundSearch
(
req
)
print
(
"6"
)
}
var
annotation
:
MAPointAnnotation
?
=
nil
...
...
@@ -449,7 +452,7 @@ class ToAndFormSelectViewController: BaseViewController, MAMapViewDelegate, CLLo
print
(
"7"
,
mapView
.
centerCoordinate
.
latitude
)
search
.
aMapReGoecodeSearch
(
request
)
request
.
requireExtension
=
true
if
annotation
==
nil
{
let
pointAnnotation
=
MAPointAnnotation
()
...
...
@@ -503,27 +506,34 @@ class ToAndFormSelectViewController: BaseViewController, MAMapViewDelegate, CLLo
}
searchBar
.
resignFirstResponder
()
let
dict
=
[
"user_token"
:
UserToken
as
Any
,
"nonce_str"
:
String
.
randomStr
(
len
:
30
)
as
Any
,
"kw"
:
keyword
as
Any
]
citySearch
(
dict
,
success
:
{
(
data
)
in
let
model
=
data
as!
citySearchModel
self
.
searchAdrDatas
.
removeAll
()
if
(
model
.
data
?
.
poi
!.
count
)
!
>
0
{
for
item
in
model
.
data
!.
poi
!
{
self
.
searchAdrDatas
.
append
(
item
)
}
self
.
searchList
.
isHidden
=
false
self
.
searchList
.
reloadData
()
}
})
{
(
err
)
in
}
}
func
searchBar
(
_
searchBar
:
UISearchBar
,
textDidChange
searchText
:
String
)
{
// keyword = searchText
keyword
=
searchText
if
keyword
.
count
>
0
{
searchList
.
isHidden
=
false
let
dict
=
[
"user_token"
:
UserToken
as
Any
,
"nonce_str"
:
String
.
randomStr
(
len
:
30
)
as
Any
,
"kw"
:
keyword
as
Any
]
citySearch
(
dict
,
success
:
{
(
data
)
in
let
model
=
data
as!
citySearchModel
self
.
searchAdrDatas
.
removeAll
()
if
(
model
.
data
?
.
poi
!.
count
)
!
>
0
{
for
item
in
model
.
data
!.
poi
!
{
self
.
searchAdrDatas
.
append
(
item
)
}
self
.
searchList
.
isHidden
=
false
self
.
searchList
.
reloadData
()
}
})
{
(
err
)
in
}
}
else
{
searchList
.
isHidden
=
true
}
}
func
searchBarShouldBeginEditing
(
_
searchBar
:
UISearchBar
)
->
Bool
{
...
...
@@ -533,5 +543,5 @@ class ToAndFormSelectViewController: BaseViewController, MAMapViewDelegate, CLLo
return
true
}
}
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