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
b51d374a
Commit
b51d374a
authored
Aug 05, 2020
by
lujunye
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
地址选择(待完善详细出口)
parent
c24c3e12
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
258 additions
and
75 deletions
+258
-75
GeliBusinessPlatform.xcworkspace/xcuserdata/junyelu.xcuserdatad/UserInterfaceState.xcuserstate
...erdata/junyelu.xcuserdatad/UserInterfaceState.xcuserstate
+0
-0
GeliBusinessPlatform/ViewController/代客下单(货运)/下运单/XiaYunDanViewController.swift
...ViewController/代客下单(货运)/下运单/XiaYunDanViewController.swift
+195
-56
GeliBusinessPlatform/ViewController/货拉拉/收发货地址/ToAndFormSelectViewController.swift
...wController/货拉拉/收发货地址/ToAndFormSelectViewController.swift
+51
-17
GeliBusinessPlatform/ViewController/货拉拉/运单详情/cell/WayBillAddressCanDelItemCell.swift
...ntroller/货拉拉/运单详情/cell/WayBillAddressCanDelItemCell.swift
+8
-2
GeliBusinessPlatform/ViewController/货拉拉/运单详情/cell/WayBillAddressCanDelItemCell.xib
...Controller/货拉拉/运单详情/cell/WayBillAddressCanDelItemCell.xib
+4
-0
No files found.
GeliBusinessPlatform.xcworkspace/xcuserdata/junyelu.xcuserdatad/UserInterfaceState.xcuserstate
View file @
b51d374a
No preview for this file type
GeliBusinessPlatform/ViewController/代客下单(货运)/下运单/XiaYunDanViewController.swift
View file @
b51d374a
...
@@ -12,7 +12,56 @@ import MAMapKit
...
@@ -12,7 +12,56 @@ import MAMapKit
import
SwiftyJSON
import
SwiftyJSON
import
SwiftDate
import
SwiftDate
class
XiaYunDanViewController
:
BaseViewController
,
UITableViewDelegate
,
UITableViewDataSource
,
JiTuoWuXinXiViewDelegate
,
JiPaiFangShiViewControllerDelegate
,
ZengZhiServicesViewControllerDelegate
,
AdressSelectCellDelegate
,
DZGLViewControllerDelegate
,
XinZengDiZhiViewControllerDelegate
,
TitleAndTFBtnCellDelegate
,
WenDuCellDelegate
,
LogisticalSelectViewDelegate
,
UIPickerViewDataSource
,
UIPickerViewDelegate
,
GLAlertSelectViewDelegate
,
CLLocationManagerDelegate
,
CityListViewControllerDelegate
{
class
XiaYunDanViewController
:
BaseViewController
,
UITableViewDelegate
,
UITableViewDataSource
,
JiTuoWuXinXiViewDelegate
,
JiPaiFangShiViewControllerDelegate
,
ZengZhiServicesViewControllerDelegate
,
AdressSelectCellDelegate
,
DZGLViewControllerDelegate
,
XinZengDiZhiViewControllerDelegate
,
TitleAndTFBtnCellDelegate
,
WenDuCellDelegate
,
LogisticalSelectViewDelegate
,
UIPickerViewDataSource
,
UIPickerViewDelegate
,
GLAlertSelectViewDelegate
,
CLLocationManagerDelegate
,
CityListViewControllerDelegate
,
ToAndFormSelectViewControllerDelegate
,
WayBillAddressCanDelItemCellDelegate
{
func
WayBillAddressCanDelItemCellDelAc
(
idx
:
Int
)
{
adrArr
.
remove
(
at
:
idx
)
let
view
=
hListView
.
footerView
(
forSection
:
1
)
view
?
.
layoutIfNeeded
()
hListView
.
reloadData
()
}
func
ToAndFormSelectViewControllerSelectAdr
(
dict
:
Dictionary
<
String
,
Any
>
,
idx
:
Int
)
{
print
(
idx
)
if
idx
!=
10086
{
if
idx
!=
0
{
if
idx
==
1
&&
adrArr
.
count
==
0
{
let
dic
=
NSMutableDictionary
()
dic
[
"locName"
]
=
"空"
adrArr
.
append
(
dic
)
adrArr
.
append
(
dict
as
NSDictionary
)
}
else
{
if
adrArr
.
count
<
2
{
adrArr
.
append
(
dict
as
NSDictionary
)
}
else
{
if
adrArr
.
count
>
idx
{
adrArr
.
insert
(
dict
as
NSDictionary
,
at
:
idx
)
adrArr
.
remove
(
at
:
idx
+
1
)
}
}
}
}
else
{
if
idx
==
0
&&
adrArr
.
count
>
1
{
adrArr
.
insert
(
dict
as
NSDictionary
,
at
:
0
)
adrArr
.
remove
(
at
:
1
)
}
else
{
adrArr
.
append
(
dict
as
NSDictionary
)
}
}
}
else
{
adrArr
.
append
(
dict
as
NSDictionary
)
}
print
(
adrArr
)
let
view
=
hListView
.
footerView
(
forSection
:
1
)
view
?
.
layoutIfNeeded
()
hListView
.
reloadData
()
}
func
CityListViewControllerLocSelect
(
loc
:
cityListDataModel
)
{
func
CityListViewControllerLocSelect
(
loc
:
cityListDataModel
)
{
selectLoc
=
loc
.
name
!
selectLoc
=
loc
.
name
!
locBtn
.
setTitle
(
" "
+
loc
.
name
!
,
for
:
.
normal
)
locBtn
.
setTitle
(
" "
+
loc
.
name
!
,
for
:
.
normal
)
...
@@ -33,7 +82,8 @@ class XiaYunDanViewController: BaseViewController,UITableViewDelegate,UITableVie
...
@@ -33,7 +82,8 @@ class XiaYunDanViewController: BaseViewController,UITableViewDelegate,UITableVie
@IBOutlet
weak
var
topCarBtnSelectView
:
UIView
!
@IBOutlet
weak
var
topCarBtnSelectView
:
UIView
!
var
adrArr
:
Array
<
String
>
=
[]
var
adrArr
:
Array
<
NSDictionary
>
=
[]
var
tempadrArr
:
Array
<
NSDictionary
>
=
[]
//MARK:--地址信息
//MARK:--地址信息
var
sender
:
String
?
var
sender
:
String
?
var
sendPhone
:
String
?
var
sendPhone
:
String
?
...
@@ -563,21 +613,31 @@ class XiaYunDanViewController: BaseViewController,UITableViewDelegate,UITableVie
...
@@ -563,21 +613,31 @@ class XiaYunDanViewController: BaseViewController,UITableViewDelegate,UITableVie
let
lineC
=
UIView
(
frame
:
CGRect
(
x
:
fullScreenWidth
*
0.5
-
0.5
,
y
:
7
,
width
:
1
,
height
:
35
))
let
lineC
=
UIView
(
frame
:
CGRect
(
x
:
fullScreenWidth
*
0.5
-
0.5
,
y
:
7
,
width
:
1
,
height
:
35
))
lineC
.
backgroundColor
=
UIColor
(
named
:
"灰色分界线"
)
lineC
.
backgroundColor
=
UIColor
(
named
:
"灰色分界线"
)
view
.
addSubview
(
lineC
)
view
.
addSubview
(
lineC
)
if
adrArr
.
count
>
2
{
let
leftBtn
=
UIButton
(
frame
:
CGRect
(
x
:
0
,
y
:
0
,
width
:
fullScreenWidth
*
0.5
,
height
:
44
))
let
leftBtn
=
UIButton
(
frame
:
CGRect
(
x
:
0
,
y
:
0
,
width
:
fullScreenWidth
*
0.5
,
height
:
44
))
leftBtn
.
titleLabel
?
.
font
=
UIFont
.
systemFont
(
ofSize
:
13
)
leftBtn
.
titleLabel
?
.
font
=
UIFont
.
systemFont
(
ofSize
:
13
)
leftBtn
.
setTitle
(
"调整收货地顺序"
,
for
:
.
normal
)
leftBtn
.
setTitle
(
"调整收货地顺序"
,
for
:
.
normal
)
leftBtn
.
addTarget
(
self
,
action
:
#selector(
huoLLAdrAction(sender:)
)
,
for
:
.
touchUpInside
)
leftBtn
.
addTarget
(
self
,
action
:
#selector(
huoLLAdrAction(sender:)
)
,
for
:
.
touchUpInside
)
leftBtn
.
tag
=
0
leftBtn
.
tag
=
0
leftBtn
.
setTitleColor
(
UIColor
(
named
:
"灰色字体颜色"
),
for
:
.
normal
)
leftBtn
.
setTitleColor
(
UIColor
(
named
:
"灰色字体颜色"
),
for
:
.
normal
)
view
.
addSubview
(
leftBtn
)
view
.
addSubview
(
leftBtn
)
let
rightBtn
=
UIButton
(
frame
:
CGRect
(
x
:
fullScreenWidth
*
0.5
,
y
:
0
,
width
:
fullScreenWidth
*
0.5
,
height
:
44
))
let
rightBtn
=
UIButton
(
frame
:
CGRect
(
x
:
fullScreenWidth
*
0.5
,
y
:
0
,
width
:
fullScreenWidth
*
0.5
,
height
:
44
))
rightBtn
.
titleLabel
?
.
font
=
UIFont
.
systemFont
(
ofSize
:
13
)
rightBtn
.
titleLabel
?
.
font
=
UIFont
.
systemFont
(
ofSize
:
13
)
rightBtn
.
setTitle
(
"添加收货地址"
,
for
:
.
normal
)
rightBtn
.
setTitle
(
"添加收货地址"
,
for
:
.
normal
)
rightBtn
.
tag
=
1
rightBtn
.
tag
=
1
rightBtn
.
addTarget
(
self
,
action
:
#selector(
huoLLAdrAction(sender:)
)
,
for
:
.
touchUpInside
)
rightBtn
.
addTarget
(
self
,
action
:
#selector(
huoLLAdrAction(sender:)
)
,
for
:
.
touchUpInside
)
rightBtn
.
setTitleColor
(
UIColor
(
named
:
"蓝色字体颜色"
),
for
:
.
normal
)
rightBtn
.
setTitleColor
(
UIColor
(
named
:
"蓝色字体颜色"
),
for
:
.
normal
)
view
.
addSubview
(
rightBtn
)
view
.
addSubview
(
rightBtn
)
}
else
{
let
addBtn
=
UIButton
(
frame
:
view
.
bounds
)
addBtn
.
titleLabel
?
.
font
=
UIFont
.
systemFont
(
ofSize
:
13
)
addBtn
.
backgroundColor
=
UIColor
.
white
addBtn
.
setTitle
(
"添加收货地址"
,
for
:
.
normal
)
addBtn
.
tag
=
1
addBtn
.
addTarget
(
self
,
action
:
#selector(
huoLLAdrAction(sender:)
)
,
for
:
.
touchUpInside
)
addBtn
.
setTitleColor
(
UIColor
(
named
:
"蓝色字体颜色"
),
for
:
.
normal
)
view
.
addSubview
(
addBtn
)
}
return
view
return
view
}
}
let
view
=
UIView
()
let
view
=
UIView
()
...
@@ -591,25 +651,29 @@ class XiaYunDanViewController: BaseViewController,UITableViewDelegate,UITableVie
...
@@ -591,25 +651,29 @@ class XiaYunDanViewController: BaseViewController,UITableViewDelegate,UITableVie
@objc
func
huoLLAdrAction
(
sender
:
UIButton
){
@objc
func
huoLLAdrAction
(
sender
:
UIButton
){
if
sender
.
tag
==
0
{
if
sender
.
tag
==
0
{
print
(
"调位置"
)
print
(
"调位置"
)
var
h
=
CGFloat
(
adrArr
.
count
+
2
)
*
49
if
h
>
CGFloat
(
fullScreenHeight
)
*
0.65
{
tempadrArr
=
adrArr
h
=
CGFloat
(
fullScreenHeight
)
*
0.65
var
h
=
CGFloat
(
adrArr
.
count
+
2
)
*
49
}
if
h
>
CGFloat
(
fullScreenHeight
)
*
0.65
{
h
=
CGFloat
(
fullScreenHeight
)
*
0.65
changeCellSortView
?
.
isHidden
=
false
}
closeBtn
?
.
isHidden
=
false
if
closeBtn
==
nil
{
closeBtn
=
UIButton
(
frame
:
self
.
view
.
bounds
)
closeBtn
?
.
backgroundColor
=
UIColor
(
named
:
"标题字颜色"
)
closeBtn
?
.
alpha
=
0.4
closeBtn
?
.
addTarget
(
self
,
action
:
#selector(
closeCarList
)
,
for
:
.
touchUpInside
)
self
.
view
.
addSubview
(
closeBtn
!
)
changeCellSortView
=
UIView
(
frame
:
CGRect
(
x
:
0
,
y
:
fullScreenHeight
-
CGFloat
(
h
),
width
:
fullScreenWidth
,
height
:
CGFloat
(
h
)))
changeCellSortView
?
.
isHidden
=
false
changeCellSortView
?
.
backgroundColor
=
UIColor
.
white
closeBtn
?
.
isHidden
=
false
changeCellSortView
?
.
layer
.
cornerRadius
=
5
if
closeBtn
==
nil
{
changeCellSortView
?
.
layer
.
maskedCorners
=
[
CACornerMask
.
layerMinXMinYCorner
,
CACornerMask
.
layerMaxXMinYCorner
]
closeBtn
=
UIButton
(
frame
:
self
.
view
.
bounds
)
self
.
view
.
addSubview
(
changeCellSortView
!
)
closeBtn
?
.
backgroundColor
=
UIColor
(
named
:
"标题字颜色"
)
closeBtn
?
.
alpha
=
0.4
closeBtn
?
.
addTarget
(
self
,
action
:
#selector(
closeCarList
)
,
for
:
.
touchUpInside
)
self
.
view
.
addSubview
(
closeBtn
!
)
changeCellSortView
=
UIView
()
changeCellSortView
?
.
backgroundColor
=
UIColor
.
white
changeCellSortView
?
.
layer
.
cornerRadius
=
5
changeCellSortView
?
.
layer
.
maskedCorners
=
[
CACornerMask
.
layerMinXMinYCorner
,
CACornerMask
.
layerMaxXMinYCorner
]
self
.
view
.
addSubview
(
changeCellSortView
!
)
}
changeCellSortView
?
.
frame
=
CGRect
(
x
:
0
,
y
:
fullScreenHeight
-
CGFloat
(
h
),
width
:
fullScreenWidth
,
height
:
CGFloat
(
h
))
let
leftBtn
=
UIButton
()
let
leftBtn
=
UIButton
()
leftBtn
.
addTarget
(
self
,
action
:
#selector(
changeCellSortAc(sender:)
)
,
for
:
.
touchUpInside
)
leftBtn
.
addTarget
(
self
,
action
:
#selector(
changeCellSortAc(sender:)
)
,
for
:
.
touchUpInside
)
...
@@ -672,7 +736,10 @@ class XiaYunDanViewController: BaseViewController,UITableViewDelegate,UITableVie
...
@@ -672,7 +736,10 @@ class XiaYunDanViewController: BaseViewController,UITableViewDelegate,UITableVie
}
}
let
adrFisrtLbl
=
UILabel
()
let
adrFisrtLbl
=
UILabel
()
adrFisrtLbl
.
text
=
adrArr
.
first
if
adrArr
.
count
>
0
{
let
dict
=
adrArr
.
first
!
as!
NSDictionary
adrFisrtLbl
.
text
=
dict
[
"locName"
]
as!
String
}
adrFisrtLbl
.
textColor
=
UIColor
(
named
:
"标题字颜色"
)
adrFisrtLbl
.
textColor
=
UIColor
(
named
:
"标题字颜色"
)
adrFisrtLbl
.
font
=
UIFont
.
systemFont
(
ofSize
:
13
)
adrFisrtLbl
.
font
=
UIFont
.
systemFont
(
ofSize
:
13
)
changeCellSortView
?
.
addSubview
(
adrFisrtLbl
)
changeCellSortView
?
.
addSubview
(
adrFisrtLbl
)
...
@@ -706,11 +773,17 @@ class XiaYunDanViewController: BaseViewController,UITableViewDelegate,UITableVie
...
@@ -706,11 +773,17 @@ class XiaYunDanViewController: BaseViewController,UITableViewDelegate,UITableVie
make
.
left
.
right
.
equalTo
(
0
)
make
.
left
.
right
.
equalTo
(
0
)
make
.
bottom
.
equalTo
(
leftBtn
.
snp
.
top
)
make
.
bottom
.
equalTo
(
leftBtn
.
snp
.
top
)
}
}
}
}
else
{
}
else
{
print
(
"添加"
)
print
(
"添加"
)
let
vc
=
ToAndFormSelectViewController
()
vc
.
idx
=
10086
vc
.
adrDatas
=
adrDatas
vc
.
delegate
=
self
if
adrDatas
.
count
>
0
{
self
.
navigationController
?
.
pushViewController
(
vc
,
animated
:
true
)
}
}
}
}
}
@objc
func
changeCellSortAc
(
sender
:
UIButton
){
@objc
func
changeCellSortAc
(
sender
:
UIButton
){
...
@@ -718,9 +791,10 @@ class XiaYunDanViewController: BaseViewController,UITableViewDelegate,UITableVie
...
@@ -718,9 +791,10 @@ class XiaYunDanViewController: BaseViewController,UITableViewDelegate,UITableVie
closeBtn
?
.
isHidden
=
true
closeBtn
?
.
isHidden
=
true
if
sender
.
tag
==
0
{
if
sender
.
tag
==
0
{
print
(
"左边"
)
print
(
"左边"
)
}
else
{
adrArr
=
tempadrArr
print
(
"右边"
)
}
}
print
(
"abc ="
,
adrArr
)
hListView
.
reloadData
()
}
}
func
tableView
(
_
tableView
:
UITableView
,
heightForFooterInSection
section
:
Int
)
->
CGFloat
{
func
tableView
(
_
tableView
:
UITableView
,
heightForFooterInSection
section
:
Int
)
->
CGFloat
{
if
tableView
==
listView
{
if
tableView
==
listView
{
...
@@ -763,7 +837,7 @@ class XiaYunDanViewController: BaseViewController,UITableViewDelegate,UITableVie
...
@@ -763,7 +837,7 @@ class XiaYunDanViewController: BaseViewController,UITableViewDelegate,UITableVie
}
else
{
//货拉拉
}
else
{
//货拉拉
switch
section
{
switch
section
{
case
1
:
case
1
:
if
adrArr
.
count
==
0
{
if
adrArr
.
count
<
2
{
return
2
return
2
}
}
return
adrArr
.
count
return
adrArr
.
count
...
@@ -828,7 +902,19 @@ class XiaYunDanViewController: BaseViewController,UITableViewDelegate,UITableVie
...
@@ -828,7 +902,19 @@ class XiaYunDanViewController: BaseViewController,UITableViewDelegate,UITableVie
if
indexPath
.
section
==
1
{
if
indexPath
.
section
==
1
{
let
vc
=
ToAndFormSelectViewController
()
let
vc
=
ToAndFormSelectViewController
()
vc
.
idx
=
indexPath
.
row
vc
.
idx
=
indexPath
.
row
self
.
navigationController
?
.
pushViewController
(
vc
,
animated
:
true
)
vc
.
adrDatas
=
adrDatas
vc
.
delegate
=
self
if
adrArr
.
count
>
indexPath
.
row
{
let
dict
=
adrArr
[
indexPath
.
row
]
as!
NSDictionary
if
dict
[
"locName"
]
as!
String
!=
"空"
&&
dict
[
"locName"
]
!=
nil
{
vc
.
nameStr
=
(
dict
[
"shouHuoRen"
]
as!
String
)
vc
.
phoneNum
=
(
dict
[
"phoneNum"
]
as!
String
)
vc
.
adrStr
=
(
dict
[
"menPai"
]
as!
String
)
}
}
if
adrDatas
.
count
>
0
{
self
.
navigationController
?
.
pushViewController
(
vc
,
animated
:
true
)
}
}
}
...
@@ -940,7 +1026,8 @@ class XiaYunDanViewController: BaseViewController,UITableViewDelegate,UITableVie
...
@@ -940,7 +1026,8 @@ class XiaYunDanViewController: BaseViewController,UITableViewDelegate,UITableVie
if
tableView
.
tag
==
999
{
if
tableView
.
tag
==
999
{
let
cell
=
tableView
.
dequeueReusableCell
(
withIdentifier
:
"ToFormChangeTableViewCell"
)
as!
ToFormChangeTableViewCell
let
cell
=
tableView
.
dequeueReusableCell
(
withIdentifier
:
"ToFormChangeTableViewCell"
)
as!
ToFormChangeTableViewCell
cell
.
accessoryType
=
UITableViewCell
.
AccessoryType
.
disclosureIndicator
cell
.
accessoryType
=
UITableViewCell
.
AccessoryType
.
disclosureIndicator
cell
.
titleLbl
.
text
=
self
.
adrArr
[
indexPath
.
row
+
1
]
let
dict
=
adrArr
[
indexPath
.
row
+
1
]
as!
NSDictionary
cell
.
titleLbl
.
text
=
dict
[
"locName"
]
as!
String
return
cell
return
cell
}
}
...
@@ -1028,18 +1115,37 @@ class XiaYunDanViewController: BaseViewController,UITableViewDelegate,UITableVie
...
@@ -1028,18 +1115,37 @@ class XiaYunDanViewController: BaseViewController,UITableViewDelegate,UITableVie
}
}
if
indexPath
.
section
==
1
{
if
indexPath
.
section
==
1
{
let
cell
=
tableView
.
dequeueReusableCell
(
withIdentifier
:
"WayBillAddressCanDelItemCell"
)
as!
WayBillAddressCanDelItemCell
let
cell
=
tableView
.
dequeueReusableCell
(
withIdentifier
:
"WayBillAddressCanDelItemCell"
)
as!
WayBillAddressCanDelItemCell
cell
.
tag
=
indexPath
.
row
cell
.
delegate
=
self
cell
.
iconW
.
constant
=
22
cell
.
iconW
.
constant
=
22
cell
.
iconH
.
constant
=
22
cell
.
iconH
.
constant
=
22
cell
.
iconLbl
.
layer
.
cornerRadius
=
11
cell
.
iconLbl
.
layer
.
cornerRadius
=
11
cell
.
lineTopView
.
isHidden
=
false
cell
.
lineTopView
.
isHidden
=
false
cell
.
delBtn
.
isHidden
=
true
cell
.
delBtn
.
isHidden
=
true
if
adrArr
.
count
>
1
{
if
adrArr
.
count
>
1
&&
indexPath
.
row
!=
0
{
cell
.
delBtn
.
isHidden
=
false
cell
.
delBtn
.
isHidden
=
false
cell
.
nodataLbl
.
isHidden
=
true
let
dict
=
adrArr
[
indexPath
.
row
]
as!
NSDictionary
cell
.
addressLbl
.
text
=
adrArr
[
indexPath
.
row
]
cell
.
addressDetailLbl
.
text
=
adrArr
[
indexPath
.
row
]
cell
.
addressLbl
.
text
=
dict
[
"locName"
]
as!
String
cell
.
namePhoneLbl
.
text
=
adrArr
[
indexPath
.
row
]
let
menPai
=
(
dict
[
"menPai"
]
!
as!
String
)
cell
.
topH
.
constant
=
5
let
shouHuoRen
=
(
dict
[
"shouHuoRen"
]
!
as!
String
)
let
phoneNum
=
(
dict
[
"phoneNum"
]
!
as!
String
)
cell
.
addressDetailLbl
.
text
=
menPai
cell
.
namePhoneLbl
.
text
=
shouHuoRen
+
" "
+
phoneNum
cell
.
delBtnTop
.
constant
=
-
25
if
menPai
.
count
>
0
||
(
phoneNum
.
count
>
0
||
shouHuoRen
.
count
>
0
)
{
cell
.
topH
.
constant
=
5
cell
.
delBtnTop
.
constant
=
-
13
}
if
menPai
.
count
>
0
&&
(
phoneNum
.
count
>
0
||
shouHuoRen
.
count
>
0
)
{
cell
.
topH
.
constant
=
5
cell
.
delBtnTop
.
constant
=
0
}
}
else
{
}
else
{
cell
.
topH
.
constant
=
25
cell
.
topH
.
constant
=
25
}
}
...
@@ -1050,12 +1156,34 @@ class XiaYunDanViewController: BaseViewController,UITableViewDelegate,UITableVie
...
@@ -1050,12 +1156,34 @@ class XiaYunDanViewController: BaseViewController,UITableViewDelegate,UITableVie
cell
.
iconLbl
.
text
=
"发"
cell
.
iconLbl
.
text
=
"发"
cell
.
iconLbl
.
backgroundColor
=
UIColor
.
init
(
named
:
"蓝色字体颜色"
)
cell
.
iconLbl
.
backgroundColor
=
UIColor
.
init
(
named
:
"蓝色字体颜色"
)
cell
.
lineTopView
.
isHidden
=
true
cell
.
lineTopView
.
isHidden
=
true
if
adrArr
.
count
>
0
{
if
adrArr
.
count
>
0
{
cell
.
topH
.
constant
=
5
let
dict
=
adrArr
[
indexPath
.
row
]
as!
NSDictionary
if
(
dict
[
"locName"
]
as!
String
)
!=
"空"
{
cell
.
addressDetailLbl
.
isHidden
=
false
cell
.
namePhoneLbl
.
isHidden
=
false
cell
.
nodataLbl
.
isHidden
=
true
cell
.
addressLbl
.
isHidden
=
false
cell
.
addressLbl
.
text
=
dict
[
"locName"
]
as!
String
let
menPai
=
(
dict
[
"menPai"
]
!
as!
String
)
let
shouHuoRen
=
(
dict
[
"shouHuoRen"
]
!
as!
String
)
let
phoneNum
=
(
dict
[
"phoneNum"
]
!
as!
String
)
cell
.
addressDetailLbl
.
text
=
menPai
cell
.
namePhoneLbl
.
text
=
shouHuoRen
+
" "
+
phoneNum
if
menPai
.
count
>
0
||
(
phoneNum
.
count
>
0
||
shouHuoRen
.
count
>
0
)
{
cell
.
topH
.
constant
=
5
}
}
else
{
cell
.
addressDetailLbl
.
isHidden
=
true
cell
.
namePhoneLbl
.
isHidden
=
true
cell
.
addressLbl
.
isHidden
=
true
}
}
}
}
}
if
indexPath
.
row
!=
adrArr
.
count
-
1
&&
indexPath
.
row
!=
0
&&
adrArr
.
count
!=
0
{
if
indexPath
.
row
!=
adrArr
.
count
-
1
&&
indexPath
.
row
!=
0
&&
adrArr
.
count
>
2
{
cell
.
iconLbl
.
text
=
""
cell
.
iconLbl
.
text
=
""
cell
.
iconLbl
.
backgroundColor
=
UIColor
.
init
(
named
:
"虚线分界线颜色"
)
cell
.
iconLbl
.
backgroundColor
=
UIColor
.
init
(
named
:
"虚线分界线颜色"
)
cell
.
iconW
.
constant
=
12
cell
.
iconW
.
constant
=
12
...
@@ -1063,17 +1191,29 @@ class XiaYunDanViewController: BaseViewController,UITableViewDelegate,UITableVie
...
@@ -1063,17 +1191,29 @@ class XiaYunDanViewController: BaseViewController,UITableViewDelegate,UITableVie
cell
.
iconLbl
.
layer
.
cornerRadius
=
6
cell
.
iconLbl
.
layer
.
cornerRadius
=
6
}
}
if
(
indexPath
.
row
==
adrArr
.
count
-
1
||
adrArr
.
count
<=
1
)
&&
indexPath
.
row
!=
0
{
if
indexPath
.
row
==
adrArr
.
count
-
1
||
adrArr
.
count
==
0
&&
indexPath
.
row
!=
0
{
//最后的不显示lineview
//最后的不显示lineview
cell
.
lineView
.
isHidden
=
true
cell
.
lineView
.
isHidden
=
true
cell
.
iconLbl
.
text
=
"收"
cell
.
iconLbl
.
text
=
"收"
cell
.
nodataLbl
.
text
=
"请选择或填写收货信息"
cell
.
nodataLbl
.
text
=
"请选择或填写收货信息"
if
adrArr
.
count
>
1
{
cell
.
nodataLbl
.
isHidden
=
true
cell
.
addressDetailLbl
.
isHidden
=
false
cell
.
namePhoneLbl
.
isHidden
=
false
cell
.
addressLbl
.
isHidden
=
false
}
else
{
cell
.
addressDetailLbl
.
isHidden
=
true
cell
.
namePhoneLbl
.
isHidden
=
true
cell
.
addressLbl
.
isHidden
=
true
cell
.
nodataLbl
.
isHidden
=
false
}
cell
.
iconLbl
.
backgroundColor
=
UIColor
.
init
(
named
:
"企业、预售字体"
)
cell
.
iconLbl
.
backgroundColor
=
UIColor
.
init
(
named
:
"企业、预售字体"
)
}
else
{
}
else
{
cell
.
lineView
.
isHidden
=
false
cell
.
lineView
.
isHidden
=
false
}
}
return
cell
return
cell
}
}
if
indexPath
.
section
==
2
{
if
indexPath
.
section
==
2
{
...
@@ -1579,8 +1719,6 @@ class XiaYunDanViewController: BaseViewController,UITableViewDelegate,UITableVie
...
@@ -1579,8 +1719,6 @@ class XiaYunDanViewController: BaseViewController,UITableViewDelegate,UITableVie
var
dList
:
Array
<
NSMutableDictionary
>
=
[]
var
dList
:
Array
<
NSMutableDictionary
>
=
[]
if
i
==
0
{
//首日
if
i
==
0
{
//首日
for
j
in
0
..<
tempArr
.
count
{
for
j
in
0
..<
tempArr
.
count
{
if
tempArr
[
j
]
.
integerValue
>
item
.
hour
{
if
tempArr
[
j
]
.
integerValue
>
item
.
hour
{
hourArr
.
append
(
tempArr
[
j
])
hourArr
.
append
(
tempArr
[
j
])
...
@@ -1665,9 +1803,10 @@ class XiaYunDanViewController: BaseViewController,UITableViewDelegate,UITableVie
...
@@ -1665,9 +1803,10 @@ class XiaYunDanViewController: BaseViewController,UITableViewDelegate,UITableVie
//移动cell事件
//移动cell事件
func
tableView
(
_
tableView
:
UITableView
,
moveRowAt
sourceIndexPath
:
IndexPath
,
func
tableView
(
_
tableView
:
UITableView
,
moveRowAt
sourceIndexPath
:
IndexPath
,
to
destinationIndexPath
:
IndexPath
)
{
to
destinationIndexPath
:
IndexPath
)
{
if
sourceIndexPath
!=
destinationIndexPath
{
if
sourceIndexPath
!=
destinationIndexPath
{
//获取移动行对应的值
//获取移动行对应的值
let
itemValue
:
String
=
adrArr
[
sourceIndexPath
.
row
+
1
]
let
itemValue
:
NSDictionary
=
adrArr
[
sourceIndexPath
.
row
+
1
]
as!
NSDictionary
//删除移动的值
//删除移动的值
adrArr
.
remove
(
at
:
sourceIndexPath
.
row
+
1
)
adrArr
.
remove
(
at
:
sourceIndexPath
.
row
+
1
)
//如果移动区域大于现有行数,直接在最后添加移动的值
//如果移动区域大于现有行数,直接在最后添加移动的值
...
...
GeliBusinessPlatform/ViewController/货拉拉/收发货地址/ToAndFormSelectViewController.swift
View file @
b51d374a
...
@@ -13,7 +13,9 @@ import AMapFoundationKit
...
@@ -13,7 +13,9 @@ import AMapFoundationKit
import
MAMapKit
import
MAMapKit
import
AMapSearchKit
import
AMapSearchKit
import
IQKeyboardManagerSwift
import
IQKeyboardManagerSwift
protocol
ToAndFormSelectViewControllerDelegate
{
func
ToAndFormSelectViewControllerSelectAdr
(
dict
:
Dictionary
<
String
,
Any
>
,
idx
:
Int
)
}
class
ToAndFormSelectViewController
:
BaseViewController
,
MAMapViewDelegate
,
CLLocationManagerDelegate
,
AMapSearchDelegate
,
UISearchBarDelegate
,
SearchBarViewDelegate
,
UITableViewDelegate
,
UITableViewDataSource
{
class
ToAndFormSelectViewController
:
BaseViewController
,
MAMapViewDelegate
,
CLLocationManagerDelegate
,
AMapSearchDelegate
,
UISearchBarDelegate
,
SearchBarViewDelegate
,
UITableViewDelegate
,
UITableViewDataSource
{
func
tableView
(
_
tableView
:
UITableView
,
numberOfRowsInSection
section
:
Int
)
->
Int
{
func
tableView
(
_
tableView
:
UITableView
,
numberOfRowsInSection
section
:
Int
)
->
Int
{
if
tableView
==
searchList
{
if
tableView
==
searchList
{
...
@@ -21,6 +23,14 @@ class ToAndFormSelectViewController: BaseViewController, MAMapViewDelegate, CLLo
...
@@ -21,6 +23,14 @@ class ToAndFormSelectViewController: BaseViewController, MAMapViewDelegate, CLLo
}
}
return
5
return
5
}
}
var
delegate
:
ToAndFormSelectViewControllerDelegate
?
var
dict
:
Dictionary
<
String
,
Any
>
=
Dictionary
()
var
nameStr
=
""
var
phoneNum
=
""
var
adrStr
=
""
var
idx
:
Int
?
var
idx
:
Int
?
func
tableView
(
_
tableView
:
UITableView
,
heightForRowAt
indexPath
:
IndexPath
)
->
CGFloat
{
func
tableView
(
_
tableView
:
UITableView
,
heightForRowAt
indexPath
:
IndexPath
)
->
CGFloat
{
return
UITableView
.
automaticDimension
return
UITableView
.
automaticDimension
...
@@ -30,7 +40,7 @@ class ToAndFormSelectViewController: BaseViewController, MAMapViewDelegate, CLLo
...
@@ -30,7 +40,7 @@ class ToAndFormSelectViewController: BaseViewController, MAMapViewDelegate, CLLo
let
cell
=
tableView
.
dequeueReusableCell
(
withIdentifier
:
"HuoLaLaDiZhiCell"
)
as!
HuoLaLaDiZhiCell
let
cell
=
tableView
.
dequeueReusableCell
(
withIdentifier
:
"HuoLaLaDiZhiCell"
)
as!
HuoLaLaDiZhiCell
cell
.
nameLbl
.
text
=
"1"
cell
.
nameLbl
.
text
=
"1"
if
tableView
==
searchList
{
if
tableView
==
searchList
{
let
data
=
adrArr
[
indexPath
.
row
]
let
data
=
adrArr
[
indexPath
.
row
]
cell
.
nameLbl
.
text
=
data
.
name
cell
.
nameLbl
.
text
=
data
.
name
}
}
...
@@ -69,15 +79,15 @@ class ToAndFormSelectViewController: BaseViewController, MAMapViewDelegate, CLLo
...
@@ -69,15 +79,15 @@ class ToAndFormSelectViewController: BaseViewController, MAMapViewDelegate, CLLo
@IBOutlet
weak
var
leftBtn
:
UIButton
!
@IBOutlet
weak
var
leftBtn
:
UIButton
!
@IBAction
func
listViewRefresh
(
_
sender
:
UIButton
)
{
@IBAction
func
listViewRefresh
(
_
sender
:
UIButton
)
{
// if sender == leftBtn {
// if sender == leftBtn {
// leftBtn.isSelected = true
// leftBtn.isSelected = true
// rightBtn.isSelected = false
// rightBtn.isSelected = false
// lineX.constant = 0
// lineX.constant = 0
// }else{
// }else{
// leftBtn.isSelected = false
// leftBtn.isSelected = false
// rightBtn.isSelected = true
// rightBtn.isSelected = true
// lineX.constant = fullScreenWidth * 0.5
// lineX.constant = fullScreenWidth * 0.5
// }
// }
}
}
@IBOutlet
weak
var
listViewBG
:
UIView
!
@IBOutlet
weak
var
listViewBG
:
UIView
!
...
@@ -97,7 +107,7 @@ class ToAndFormSelectViewController: BaseViewController, MAMapViewDelegate, CLLo
...
@@ -97,7 +107,7 @@ class ToAndFormSelectViewController: BaseViewController, MAMapViewDelegate, CLLo
override
func
viewDidLoad
()
{
override
func
viewDidLoad
()
{
super
.
viewDidLoad
()
super
.
viewDidLoad
()
let
searchBr
=
SearchBarView
.
init
()
let
searchBr
=
SearchBarView
.
init
()
navBgView
.
addSubview
(
searchBr
)
navBgView
.
addSubview
(
searchBr
)
searchBr
.
snp
.
makeConstraints
{
(
make
)
in
searchBr
.
snp
.
makeConstraints
{
(
make
)
in
...
@@ -126,6 +136,10 @@ class ToAndFormSelectViewController: BaseViewController, MAMapViewDelegate, CLLo
...
@@ -126,6 +136,10 @@ class ToAndFormSelectViewController: BaseViewController, MAMapViewDelegate, CLLo
searchList
.
register
(
UINib
(
nibName
:
"HuoLaLaDiZhiCell"
,
bundle
:
nil
),
forCellReuseIdentifier
:
"HuoLaLaDiZhiCell"
)
searchList
.
register
(
UINib
(
nibName
:
"HuoLaLaDiZhiCell"
,
bundle
:
nil
),
forCellReuseIdentifier
:
"HuoLaLaDiZhiCell"
)
nameTF
.
text
=
nameStr
phoneTF
.
text
=
phoneNum
addressDetailTF
.
text
=
adrStr
}
}
func
initMapView
(){
func
initMapView
(){
...
@@ -153,7 +167,7 @@ class ToAndFormSelectViewController: BaseViewController, MAMapViewDelegate, CLLo
...
@@ -153,7 +167,7 @@ class ToAndFormSelectViewController: BaseViewController, MAMapViewDelegate, CLLo
@objc
func
cancelKeyboard
(){
@objc
func
cancelKeyboard
(){
IQKeyboardManager
.
shared
.
resignFirstResponder
()
IQKeyboardManager
.
shared
.
resignFirstResponder
()
}
}
var
adrDatas
:
Array
<
cityListDataModel
>
?
func
initSearch
()
{
func
initSearch
()
{
search
=
AMapSearchAPI
()
search
=
AMapSearchAPI
()
search
.
delegate
=
self
search
.
delegate
=
self
...
@@ -163,9 +177,28 @@ class ToAndFormSelectViewController: BaseViewController, MAMapViewDelegate, CLLo
...
@@ -163,9 +177,28 @@ class ToAndFormSelectViewController: BaseViewController, MAMapViewDelegate, CLLo
request
.
requireExtension
=
true
request
.
requireExtension
=
true
search
.
aMapPOIAroundSearch
(
request
)
search
.
aMapPOIAroundSearch
(
request
)
}
}
var
adrData
:
cityListDataModel
?
var
cityName
:
NSString
=
""
@IBAction
func
sureSelectAddressAction
(
_
sender
:
LGButton
)
{
@IBAction
func
sureSelectAddressAction
(
_
sender
:
LGButton
)
{
print
(
"sureSelectAddressAction"
)
print
(
"sureSelectAddressAction"
)
print
(
cityName
)
if
adrDatas
!.
count
>
0
{
for
item
in
adrDatas
!
{
if
cityName
.
contains
(
item
.
name
!
)
{
adrData
=
item
}
}
dict
[
"menPai"
]
=
addressDetailTF
.
text
dict
[
"shouHuoRen"
]
=
nameTF
.
text
dict
[
"phoneNum"
]
=
phoneTF
.
text
dict
[
"adr"
]
=
adrData
if
locName
.
count
>
0
{
dict
[
"locName"
]
=
titleLbl
!.
text
delegate
?
.
ToAndFormSelectViewControllerSelectAdr
(
dict
:
dict
,
idx
:
idx
!
)
self
.
navigationController
?
.
popViewController
(
animated
:
true
)
}
}
}
}
//MARK: - 高德地图delegate
//MARK: - 高德地图delegate
var
introView
:
UIView
?
var
introView
:
UIView
?
...
@@ -173,6 +206,7 @@ class ToAndFormSelectViewController: BaseViewController, MAMapViewDelegate, CLLo
...
@@ -173,6 +206,7 @@ class ToAndFormSelectViewController: BaseViewController, MAMapViewDelegate, CLLo
var
contentLbl
:
UILabel
?
var
contentLbl
:
UILabel
?
var
adrArr
:
Array
<
AMapPOI
>
=
[]
var
adrArr
:
Array
<
AMapPOI
>
=
[]
var
keyword
=
""
var
keyword
=
""
var
locName
=
""
func
onPOISearchDone
(
_
request
:
AMapPOISearchBaseRequest
!
,
response
:
AMapPOISearchResponse
!
)
{
func
onPOISearchDone
(
_
request
:
AMapPOISearchBaseRequest
!
,
response
:
AMapPOISearchResponse
!
)
{
if
response
.
count
==
0
{
if
response
.
count
==
0
{
...
@@ -208,8 +242,8 @@ class ToAndFormSelectViewController: BaseViewController, MAMapViewDelegate, CLLo
...
@@ -208,8 +242,8 @@ class ToAndFormSelectViewController: BaseViewController, MAMapViewDelegate, CLLo
introView
?
.
addSubview
(
contentLbl
!
)
introView
?
.
addSubview
(
contentLbl
!
)
}
}
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
//通过富文本来设置行间距
//通过富文本来设置行间距
let
paraph
=
NSMutableParagraphStyle
()
let
paraph
=
NSMutableParagraphStyle
()
...
@@ -344,7 +378,7 @@ class ToAndFormSelectViewController: BaseViewController, MAMapViewDelegate, CLLo
...
@@ -344,7 +378,7 @@ class ToAndFormSelectViewController: BaseViewController, MAMapViewDelegate, CLLo
}
}
func
searchBarSearchButtonClicked
(
_
searchBar
:
UISearchBar
)
{
func
searchBarSearchButtonClicked
(
_
searchBar
:
UISearchBar
)
{
keyword
=
searchBar
.
text
!
keyword
=
searchBar
.
text
!
print
(
"点击搜索进行--"
)
print
(
"点击搜索进行--"
)
if
searchBar
.
text
!.
count
==
0
{
if
searchBar
.
text
!.
count
==
0
{
...
...
GeliBusinessPlatform/ViewController/货拉拉/运单详情/cell/WayBillAddressCanDelItemCell.swift
View file @
b51d374a
...
@@ -7,9 +7,12 @@
...
@@ -7,9 +7,12 @@
//
//
import
UIKit
import
UIKit
protocol
WayBillAddressCanDelItemCellDelegate
{
func
WayBillAddressCanDelItemCellDelAc
(
idx
:
Int
)
}
class
WayBillAddressCanDelItemCell
:
UITableViewCell
{
class
WayBillAddressCanDelItemCell
:
UITableViewCell
{
@IBOutlet
weak
var
delBtnTop
:
NSLayoutConstraint
!
var
delegate
:
WayBillAddressCanDelItemCellDelegate
?
@IBOutlet
weak
var
topH
:
NSLayoutConstraint
!
@IBOutlet
weak
var
topH
:
NSLayoutConstraint
!
@IBOutlet
weak
var
nodataLbl
:
UILabel
!
@IBOutlet
weak
var
nodataLbl
:
UILabel
!
@IBOutlet
weak
var
delBtn
:
UIButton
!
@IBOutlet
weak
var
delBtn
:
UIButton
!
...
@@ -26,6 +29,9 @@ class WayBillAddressCanDelItemCell: UITableViewCell {
...
@@ -26,6 +29,9 @@ class WayBillAddressCanDelItemCell: UITableViewCell {
self
.
selectionStyle
=
.
none
self
.
selectionStyle
=
.
none
}
}
@IBAction
func
delAction
(
_
sender
:
Any
)
{
delegate
?
.
WayBillAddressCanDelItemCellDelAc
(
idx
:
self
.
tag
)
}
open
override
func
layoutSubviews
()
{
open
override
func
layoutSubviews
()
{
super
.
layoutSubviews
()
super
.
layoutSubviews
()
self
.
contentView
.
setNeedsLayout
()
self
.
contentView
.
setNeedsLayout
()
...
...
GeliBusinessPlatform/ViewController/货拉拉/运单详情/cell/WayBillAddressCanDelItemCell.xib
View file @
b51d374a
...
@@ -96,6 +96,9 @@
...
@@ -96,6 +96,9 @@
<real
key=
"value"
value=
"3"
/>
<real
key=
"value"
value=
"3"
/>
</userDefinedRuntimeAttribute>
</userDefinedRuntimeAttribute>
</userDefinedRuntimeAttributes>
</userDefinedRuntimeAttributes>
<connections>
<action
selector=
"delAction:"
destination=
"KGk-i7-Jjw"
eventType=
"touchUpInside"
id=
"0Z7-GB-Z7c"
/>
</connections>
</button>
</button>
<label
opaque=
"NO"
userInteractionEnabled=
"NO"
contentMode=
"left"
horizontalHuggingPriority=
"251"
verticalHuggingPriority=
"251"
text=
"请选择或填写发货信息"
textAlignment=
"natural"
lineBreakMode=
"tailTruncation"
baselineAdjustment=
"alignBaselines"
adjustsFontSizeToFit=
"NO"
translatesAutoresizingMaskIntoConstraints=
"NO"
id=
"xQh-lb-yiJ"
>
<label
opaque=
"NO"
userInteractionEnabled=
"NO"
contentMode=
"left"
horizontalHuggingPriority=
"251"
verticalHuggingPriority=
"251"
text=
"请选择或填写发货信息"
textAlignment=
"natural"
lineBreakMode=
"tailTruncation"
baselineAdjustment=
"alignBaselines"
adjustsFontSizeToFit=
"NO"
translatesAutoresizingMaskIntoConstraints=
"NO"
id=
"xQh-lb-yiJ"
>
<rect
key=
"frame"
x=
"46"
y=
"6.5"
width=
"133"
height=
"16"
/>
<rect
key=
"frame"
x=
"46"
y=
"6.5"
width=
"133"
height=
"16"
/>
...
@@ -135,6 +138,7 @@
...
@@ -135,6 +138,7 @@
<outlet
property=
"addressDetailLbl"
destination=
"JfY-Q9-10Q"
id=
"Xi4-mV-0hL"
/>
<outlet
property=
"addressDetailLbl"
destination=
"JfY-Q9-10Q"
id=
"Xi4-mV-0hL"
/>
<outlet
property=
"addressLbl"
destination=
"wxD-2W-Kct"
id=
"OPZ-UV-8Wi"
/>
<outlet
property=
"addressLbl"
destination=
"wxD-2W-Kct"
id=
"OPZ-UV-8Wi"
/>
<outlet
property=
"delBtn"
destination=
"gIq-zy-KC4"
id=
"2h5-bf-ftd"
/>
<outlet
property=
"delBtn"
destination=
"gIq-zy-KC4"
id=
"2h5-bf-ftd"
/>
<outlet
property=
"delBtnTop"
destination=
"WFS-QX-fNC"
id=
"qLd-qa-ekh"
/>
<outlet
property=
"iconH"
destination=
"PTZ-fe-NB0"
id=
"UMp-8r-8hy"
/>
<outlet
property=
"iconH"
destination=
"PTZ-fe-NB0"
id=
"UMp-8r-8hy"
/>
<outlet
property=
"iconLbl"
destination=
"JJG-L3-lyj"
id=
"ZQ1-MD-9C6"
/>
<outlet
property=
"iconLbl"
destination=
"JJG-L3-lyj"
id=
"ZQ1-MD-9C6"
/>
<outlet
property=
"iconW"
destination=
"Bp5-x3-dmY"
id=
"blT-9t-em8"
/>
<outlet
property=
"iconW"
destination=
"Bp5-x3-dmY"
id=
"blT-9t-em8"
/>
...
...
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