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
e574e7d7
Commit
e574e7d7
authored
Apr 12, 2021
by
lujunye
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
sdfsadfasdf323234234
parent
11aa1dd7
Changes
8
Show whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
570 additions
and
38 deletions
+570
-38
GeliBusinessPlatform.xcworkspace/xcuserdata/junyelu.xcuserdatad/UserInterfaceState.xcuserstate
...erdata/junyelu.xcuserdatad/UserInterfaceState.xcuserstate
+0
-0
GeliBusinessPlatform/Model/pph/getVehicleType_model.swift
GeliBusinessPlatform/Model/pph/getVehicleType_model.swift
+1
-1
GeliBusinessPlatform/ViewController/代客下单(货运)/下运单/XiaYunDanViewController.swift
...ViewController/代客下单(货运)/下运单/XiaYunDanViewController.swift
+393
-13
GeliBusinessPlatform/ViewController/代客下单(货运)/下运单/XiaYunDanViewController.xib
...m/ViewController/代客下单(货运)/下运单/XiaYunDanViewController.xib
+6
-0
GeliBusinessPlatform/ViewController/货拉拉/收发货地址/ToAndFormSelectViewController.xib
...iewController/货拉拉/收发货地址/ToAndFormSelectViewController.xib
+24
-15
GeliBusinessPlatform/ViewController/货拉拉/运单详情/cell/HLLTopCell.swift
...essPlatform/ViewController/货拉拉/运单详情/cell/HLLTopCell.swift
+105
-5
GeliBusinessPlatform/ViewController/货拉拉/运单详情/cell/OnlyViewCell.swift
...sPlatform/ViewController/货拉拉/运单详情/cell/OnlyViewCell.swift
+34
-1
GeliBusinessPlatform/ViewController/货拉拉/运单详情/cell/OnlyViewCell.xib
...essPlatform/ViewController/货拉拉/运单详情/cell/OnlyViewCell.xib
+7
-3
No files found.
GeliBusinessPlatform.xcworkspace/xcuserdata/junyelu.xcuserdatad/UserInterfaceState.xcuserstate
View file @
e574e7d7
No preview for this file type
GeliBusinessPlatform/Model/pph/getVehicleType_model.swift
View file @
e574e7d7
...
...
@@ -300,7 +300,7 @@ class getVehicleTypeData_model: Mappable {
var
truckVolume
:
String
?
//体积
var
img
:
String
?
//图片
var
truckWeight
:
Float
?
//载重
var
truckWeight
:
String
?
//载重
var
name
:
String
?
var
istailplate
:
Int
?
//是否有尾板车型0没有尾板1有尾板
...
...
GeliBusinessPlatform/ViewController/代客下单(货运)/下运单/XiaYunDanViewController.swift
View file @
e574e7d7
...
...
@@ -198,6 +198,81 @@ class XiaYunDanViewController: BaseViewController,UITableViewDelegate,UITableVie
}
@IBOutlet
weak
var
YuGuPriceLbl
:
UILabel
!
func
pph_showScrollUI
(){
//左右按钮
for
item
in
pph_lineArr
{
if
item
.
tag
==
pph_selectCarType
{
item
.
isHidden
=
false
}
else
{
item
.
isHidden
=
true
}
}
for
item
in
pph_btnArr
{
if
item
.
tag
==
pph_selectCarType
{
item
.
isSelected
=
true
item
.
setTitleColor
(
UIColor
(
named
:
"green"
),
for
:
.
normal
)
}
else
{
item
.
isSelected
=
false
item
.
setTitleColor
(
UIColor
(
named
:
"提示语字体颜色"
),
for
:
.
normal
)
}
}
let
btn
=
pph_btnArr
[
pph_selectCarType
]
let
idx
=
IndexPath
(
row
:
0
,
section
:
0
)
let
cell
=
pph_listView
.
cellForRow
(
at
:
idx
)
as!
HLLTopCell
let
w
=
cell
.
scViewBg
.
bounds
.
size
.
width
cell
.
scrollView
?
.
setContentOffset
(
CGPoint
(
x
:
pph_selectCarType
*
Int
(
w
),
y
:
0
),
animated
:
true
)
cell
.
idx
=
pph_selectCarType
let
x
=
btn
.
frame
.
minX
let
rect
=
CGRect
(
x
:
Int
(
x
),
y
:
0
,
width
:
Int
(
w
),
height
:
1
)
pph_topBtnScv
.
scrollRectToVisible
(
rect
,
animated
:
true
)
//刷新
// if adrArr.count > 0 {
// let firstData = adrArr.first! as NSDictionary
// if firstData["locName"] as! String != "空" && adrArr.count > 1 {
//
// var adrDs:Array<Any> = []
// adrDs.removeAll()
// for item in adrArr {
// let data = item["adr"] as! cityListDataModel
//
// let dict = ["lat":data.lat_lon!.lat!,"lon":data.lat_lon!.lon!,"city_id":data.city_id!] as [String : Any]
//
// adrDs.append(dict)
// }
//
// let lat_lon_arr = dataChangeString(sender: adrDs)
//
// let fD = adrArr.first!
// let cityData = fD["adr"] as! cityListDataModel
// let params = ["user_token":UserToken as Any,
// "nonce_str":nonce_str as Any,
// "city_id":cityData.city_id as Any,
// "city_info_revision":carModel?.revision as Any,
// "order_vehicle_id":carTypesArr[selectCarType].order_vehicle_id as Any,
// "std_tag_arr":"" as Any,
// "spec_req_arr":spec_select_arr as Any,
// "lat_lon_arr":lat_lon_arr as Any
// ]
// orderPriceCalculate(params, success: { (data) in
// let model = data as! orderPriceCalculateModel
// self.YuGuPriceLbl.text = "\(model.data!.total_price_fen!/100)"
// self.logisticsCostModel = model
// let view = self.hListView.footerView(forSection: 1)
//
// view?.layoutIfNeeded()
//
//
// self.hListView.reloadData()
// }) { (err) in
//
// }
// }
// }
self
.
pph_listView
.
reloadData
()
}
func
showScrollUI
(){
//左右按钮
for
item
in
lineArr
{
...
...
@@ -293,6 +368,7 @@ class XiaYunDanViewController: BaseViewController,UITableViewDelegate,UITableVie
var
carModel
:
cityCartDataModel
?
var
pph_carModel
:
getVehicleTypeData_model
?
fileprivate
func
extractedFunc
()
{
HUD
.
flash
(
.
progress
)
...
...
@@ -462,6 +538,7 @@ class XiaYunDanViewController: BaseViewController,UITableViewDelegate,UITableVie
var
bgBtn
:
UIButton
?
var
btmView
:
UIView
?
@IBOutlet
weak
var
pph_topCarBtnView
:
UIView
!
@IBOutlet
weak
var
topCarBtnSelectView
:
UIView
!
var
adrArr
:
Array
<
NSDictionary
>
=
[]
...
...
@@ -794,7 +871,14 @@ class XiaYunDanViewController: BaseViewController,UITableViewDelegate,UITableVie
var
selectCarType
=
0
var
carTypesArr
:
Array
<
vehicle_arr_data
>
=
[]
var
isPPH_Already
=
true
var
pph_selectCarType
=
0
var
pphCarTypesArr
:
Array
<
getVehicleTypeData_model
>
=
[]
@IBAction
func
selectAction
(
_
sender
:
UIButton
)
{
closeCarList
()
pph_closeCarList
()
lineV
.
frame
.
origin
.
x
=
fullScreenWidth
*
0.333
*
CGFloat
(
sender
.
tag
)
if
rightBtn
==
sender
{
//货拉拉
hBtnViewH
.
constant
=
CGFloat
(
TabHeight
)
...
...
@@ -834,6 +918,7 @@ class XiaYunDanViewController: BaseViewController,UITableViewDelegate,UITableVie
}
}
}
else
{
if
leftBtn
==
sender
{
//普通冷运
locBtn
.
isUserInteractionEnabled
=
false
rightBtn
.
isSelected
=
false
...
...
@@ -841,18 +926,71 @@ class XiaYunDanViewController: BaseViewController,UITableViewDelegate,UITableVie
p_p_view
.
isHidden
=
true
pin_pin_huo
.
isSelected
=
false
hllView
.
isHidden
=
true
closeCarList
()
}
else
{
//拼拼货
rightBtn
.
isSelected
=
false
leftBtn
.
isSelected
=
false
pin_pin_huo
.
isSelected
=
true
hllView
.
isHidden
=
true
p_p_view
.
isHidden
=
false
pphCarList
()
}
}
}
func
pphCarList
(){
rightBtn
.
isSelected
=
false
leftBtn
.
isSelected
=
false
hllView
.
isHidden
=
true
pin_pin_huo
.
isSelected
=
true
p_p_view
.
isHidden
=
false
locBtn
.
isUserInteractionEnabled
=
true
for
item
in
adrDatas
{
if
setCityId
(
name1
:
item
.
name
!
,
name2
:
item
.
name_en
!
){
city_id
=
item
.
city_id
!
}
}
getPPHCar
()
let
line
=
UIView
()
line
.
backgroundColor
=
UIColor
(
named
:
"灰色分界线"
)
topCarBtnSelectView
.
addSubview
(
line
)
line
.
snp_makeConstraints
{
(
make
)
in
make
.
height
.
equalTo
(
1
)
make
.
left
.
right
.
bottom
.
equalTo
(
0
)
}
}
fileprivate
func
getPPHCar
(){
getVehicleType
([
"user_token"
:
UserToken
as
Any
])
{
(
data
)
in
let
model
=
data
as!
getVehicleType_model
if
model
.
data
==
nil
{
HUD
.
flash
(
.
label
(
"暂无数据"
),
delay
:
1.2
)
return
}
self
.
pph_carModel
=
model
.
data
?
.
first
self
.
carTypesArr
.
removeAll
()
for
item
in
model
.
data
!
{
self
.
pphCarTypesArr
.
append
(
item
)
}
if
self
.
pphCarTypesArr
.
count
==
0
{
HUD
.
flash
(
.
label
(
"暂无车型可供选择"
),
delay
:
1.2
)
}
let
cell
=
self
.
pph_listView
.
cellForRow
(
at
:
IndexPath
(
row
:
0
,
section
:
0
))
as!
HLLTopCell
cell
.
idx
=
0
cell
.
scrollView
?
.
setContentOffset
(
CGPoint
(
x
:
0
,
y
:
0
),
animated
:
false
)
cell
.
tjLbl
.
text
=
"--"
cell
.
sizeLbl
.
text
=
"--"
cell
.
weightLbl
.
text
=
"--"
let
view
=
self
.
pph_listView
.
footerView
(
forSection
:
0
)
view
?
.
layoutIfNeeded
()
self
.
setPPHBtnUI
(
carTypesArr
:
self
.
pphCarTypesArr
,
view
:
self
.
pph_topCarBtnView
)
self
.
pph_listView
.
reloadData
()
HUD
.
hide
()
}
failture
:
{
(
err
)
in
}
}
func
setCityId
(
name1
:
String
,
name2
:
String
)
->
Bool
{
if
selectLoc
.
contains
(
name1
)
||
selectLoc
.
localizedLowercase
.
contains
(
name2
){
return
true
...
...
@@ -864,6 +1002,8 @@ class XiaYunDanViewController: BaseViewController,UITableViewDelegate,UITableVie
rightBtn
.
isSelected
=
true
leftBtn
.
isSelected
=
false
hllView
.
isHidden
=
false
pin_pin_huo
.
isSelected
=
false
p_p_view
.
isHidden
=
true
locBtn
.
isUserInteractionEnabled
=
true
for
item
in
adrDatas
{
if
setCityId
(
name1
:
item
.
name
!
,
name2
:
item
.
name_en
!
){
...
...
@@ -993,6 +1133,7 @@ class XiaYunDanViewController: BaseViewController,UITableViewDelegate,UITableVie
// }
}
@IBOutlet
weak
var
pph_listView
:
UITableView
!
override
func
viewDidLoad
()
{
super
.
viewDidLoad
()
...
...
@@ -1043,7 +1184,9 @@ class XiaYunDanViewController: BaseViewController,UITableViewDelegate,UITableVie
//MARK: - 拼拼货
pph_listView
.
register
(
UINib
(
nibName
:
"HLLTopCell"
,
bundle
:
nil
),
forCellReuseIdentifier
:
"HLLTopCell"
)
pph_listView
.
register
(
UINib
(
nibName
:
"OnlyViewCell"
,
bundle
:
nil
),
forCellReuseIdentifier
:
"OnlyViewCell"
)
pph_listView
.
register
(
UINib
(
nibName
:
"TitleAndTFBtnCell"
,
bundle
:
nil
),
forCellReuseIdentifier
:
"TitleAndTFBtnCell"
)
}
//MARK:--//冷运请求期望上门时间
...
...
@@ -1736,7 +1879,18 @@ class XiaYunDanViewController: BaseViewController,UITableViewDelegate,UITableVie
}
return
49
}
else
{
//货拉拉
}
else
if
tableView
==
hListView
{
//货拉拉
if
indexPath
.
section
==
0
{
if
indexPath
.
row
==
0
{
return
181
}
return
UITableView
.
automaticDimension
}
if
indexPath
.
section
==
1
{
return
UITableView
.
automaticDimension
}
return
49
}
else
{
//拼拼货
if
indexPath
.
section
==
0
{
if
indexPath
.
row
==
0
{
return
181
...
...
@@ -1841,7 +1995,7 @@ class XiaYunDanViewController: BaseViewController,UITableViewDelegate,UITableVie
cell
.
nameLbl
.
text
=
title2Arr
[
indexPath
.
row
]
return
cell
}
}
else
{
}
else
if
tableView
==
hListView
{
//MARK: - 货拉拉cell
if
indexPath
.
section
==
0
{
if
indexPath
.
row
==
1
{
...
...
@@ -1980,8 +2134,40 @@ class XiaYunDanViewController: BaseViewController,UITableViewDelegate,UITableVie
let
cell
=
tableView
.
dequeueReusableCell
(
withIdentifier
:
"TitleAndTFBtnCell"
)
as!
TitleAndTFBtnCell
cell
.
nameLbl
.
text
=
hPart3
[
indexPath
.
row
]
return
cell
}
else
{
//MARK: - 拼拼货
if
indexPath
.
section
==
0
{
if
indexPath
.
row
==
1
{
let
cell
=
tableView
.
dequeueReusableCell
(
withIdentifier
:
"OnlyViewCell"
)
as!
OnlyViewCell
cell
.
isPPH
=
true
cell
.
pph_datas
=
pphCarTypesArr
cell
.
delegate
=
self
return
cell
}
let
cell
=
tableView
.
dequeueReusableCell
(
withIdentifier
:
"HLLTopCell"
)
as!
HLLTopCell
cell
.
pph_datas
=
pphCarTypesArr
cell
.
isPPH
=
true
cell
.
delegate
=
self
cell
.
idx
=
pph_selectCarType
return
cell
}
let
cell
=
tableView
.
dequeueReusableCell
(
withIdentifier
:
"TitleAndTFBtnCell"
)
as!
TitleAndTFBtnCell
return
cell
}
}
@objc
func
pph_topBtnClick
(
btn
:
UIButton
){
//顶栏按钮
pph_selectCarType
=
btn
.
tag
pph_showScrollUI
()
let
idx
=
IndexPath
(
row
:
0
,
section
:
0
)
let
cell
=
hListView
.
cellForRow
(
at
:
idx
)
as!
HLLTopCell
cell
.
scrollView
?
.
setContentOffset
(
CGPoint
(
x
:
pph_selectCarType
*
Int
(
CGFloat
(
cell
.
scViewBg
.
bounds
.
size
.
width
)),
y
:
0
),
animated
:
true
)
}
@objc
func
topBtnClick
(
btn
:
UIButton
){
//顶栏按钮
...
...
@@ -1996,6 +2182,103 @@ class XiaYunDanViewController: BaseViewController,UITableViewDelegate,UITableVie
var
btnArr
:
Array
<
UIButton
>
=
[]
var
lineArr
:
Array
<
UIView
>
=
[]
var
topBtnScv
:
UIScrollView
!
var
pph_btnArr
:
Array
<
UIButton
>
=
[]
var
pph_lineArr
:
Array
<
UIView
>
=
[]
var
pph_topBtnScv
:
UIScrollView
!
//拼拼货
func
setPPHBtnUI
(
carTypesArr
:
Array
<
getVehicleTypeData_model
>
,
view
:
UIView
){
isPPH_Already
=
false
pph_btnArr
.
removeAll
()
pph_lineArr
.
removeAll
()
for
item
in
view
.
subviews
{
item
.
removeFromSuperview
()
}
let
scv
=
UIScrollView
(
frame
:
view
.
bounds
)
view
.
addSubview
(
scv
)
pph_topBtnScv
=
scv
var
scvContentWidth
=
0
scv
.
showsHorizontalScrollIndicator
=
false
scv
.
tag
=
99
for
i
in
0
..<
carTypesArr
.
count
{
let
btn
=
UIButton
()
let
model
=
carTypesArr
[
i
]
btn
.
setTitle
(
model
.
name
,
for
:
.
normal
)
btn
.
tag
=
i
scv
.
addSubview
(
btn
)
btn
.
sizeToFit
()
var
x
:
CGFloat
=
0
if
pph_btnArr
.
count
!=
0
{
let
button
=
pph_btnArr
[
i
-
1
]
x
=
button
.
frame
.
maxX
}
btn
.
frame
=
CGRect
(
x
:
x
,
y
:
0
,
width
:
btn
.
bounds
.
size
.
width
+
6
,
height
:
44
)
btn
.
titleLabel
?
.
font
=
UIFont
.
systemFont
(
ofSize
:
13
)
btn
.
setTitleColor
(
UIColor
(
named
:
"提示语字体颜色"
),
for
:
.
normal
)
btn
.
addTarget
(
self
,
action
:
#selector(
pph_topBtnClick(btn:)
)
,
for
:
.
touchUpInside
)
pph_btnArr
.
append
(
btn
)
scvContentWidth
+=
Int
(
btn
.
bounds
.
size
.
width
)
let
topBtnLine
=
UIView
()
topBtnLine
.
tag
=
btn
.
tag
topBtnLine
.
backgroundColor
=
UIColor
(
named
:
"green"
)
topBtnLine
.
layer
.
cornerRadius
=
1.25
topBtnLine
.
layer
.
masksToBounds
=
true
topBtnLine
.
isHidden
=
true
btn
.
addSubview
(
topBtnLine
)
topBtnLine
.
snp
.
makeConstraints
{
(
make
)
in
make
.
bottom
.
equalToSuperview
()
make
.
left
.
equalTo
(
10
)
make
.
right
.
equalTo
(
-
10
)
make
.
height
.
equalTo
(
3
)
}
pph_lineArr
.
append
(
topBtnLine
)
}
scv
.
contentSize
=
CGSize
(
width
:
scvContentWidth
,
height
:
1
)
if
carTypesArr
.
count
>
5
{
let
button
=
UIButton
(
frame
:
CGRect
(
x
:
fullScreenWidth
-
44
,
y
:
0
,
width
:
44
,
height
:
44
))
button
.
backgroundColor
=
UIColor
.
white
button
.
setImage
(
UIImage
(
named
:
"dot"
),
for
:
.
normal
)
view
.
addSubview
(
button
)
button
.
addTarget
(
self
,
action
:
#selector(
pph_selectAllCars
)
,
for
:
.
touchUpInside
)
let
line2
=
UIView
()
line2
.
backgroundColor
=
UIColor
(
named
:
"灰色分界线"
)
view
.
addSubview
(
line2
)
line2
.
snp_makeConstraints
{
(
make
)
in
make
.
height
.
equalTo
(
1
)
make
.
right
.
left
.
equalTo
(
0
)
make
.
bottom
.
equalTo
(
0
)
}
let
line
=
UIView
()
line
.
backgroundColor
=
UIColor
(
named
:
"灰色分界线"
)
view
.
addSubview
(
line
)
line
.
snp_makeConstraints
{
(
make
)
in
make
.
height
.
equalTo
(
30
)
make
.
width
.
equalTo
(
1
)
make
.
right
.
equalTo
(
button
.
snp_left
)
make
.
centerY
.
equalTo
(
view
.
snp_centerY
)
}
scv
.
snp
.
updateConstraints
{
(
make
)
in
make
.
top
.
left
.
bottom
.
equalToSuperview
()
make
.
right
.
equalTo
(
line
.
snp
.
left
)
}
}
if
pph_btnArr
.
count
>
0
{
let
btn
=
pph_btnArr
.
first
btn
!.
isSelected
=
true
btn
!.
setTitleColor
(
UIColor
(
named
:
"green"
),
for
:
.
normal
)
let
line
=
pph_lineArr
.
first
line
!.
isHidden
=
false
}
}
//货拉拉
func
setBtnUI
(
carTypesArr
:
Array
<
vehicle_arr_data
>
,
view
:
UIView
){
isAlready
=
false
btnArr
.
removeAll
()
...
...
@@ -2052,15 +2335,6 @@ class XiaYunDanViewController: BaseViewController,UITableViewDelegate,UITableVie
view
.
addSubview
(
button
)
button
.
addTarget
(
self
,
action
:
#selector(
selectAllCars
)
,
for
:
.
touchUpInside
)
// let line1 = UIView()
// line1.backgroundColor = UIColor(named: "灰色分界线")
// view.addSubview(line1)
// line1.snp_makeConstraints { (make) in
// make.height.equalTo(1)
// make.right.left.equalTo(0)
// make.top.equalTo(0)
// }
let
line2
=
UIView
()
line2
.
backgroundColor
=
UIColor
(
named
:
"灰色分界线"
)
view
.
addSubview
(
line2
)
...
...
@@ -2095,7 +2369,78 @@ class XiaYunDanViewController: BaseViewController,UITableViewDelegate,UITableVie
}
}
//MARK: - 拼拼货选所有车型
var
pph_carListView
:
UIView
?
var
pph_cBtn
:
UIButton
?
@objc
func
pph_closeCarList
(){
pph_carListView
?
.
isHidden
=
true
pph_cBtn
?
.
isHidden
=
true
// closeBtn?.isHidden = true
// changeCellSortView?.isHidden = true
}
@objc
func
pph_selectAllCars
(){
print
(
"pphCarTypesArr = "
,
pphCarTypesArr
.
count
)
pph_cBtn
?
.
isHidden
=
false
pph_carListView
?
.
isHidden
=
false
let
w
=
fullScreenWidth
/
3
var
a
=
0
if
pphCarTypesArr
.
count
%
3
!=
0
{
a
=
1
}
let
h
=
w
*
CGFloat
(
a
+
pphCarTypesArr
.
count
/
3
)
if
pph_carListView
==
nil
{
let
view
=
UIView
(
frame
:
CGRect
(
x
:
0
,
y
:
topBtnView
.
frame
.
maxY
,
width
:
fullScreenWidth
,
height
:
fullScreenHeight
*
0.8
))
view
.
backgroundColor
=
UIColor
.
white
self
.
view
.
addSubview
(
view
)
pph_carListView
=
view
let
pph_carListSCV
=
UIScrollView
(
frame
:
CGRect
(
x
:
0
,
y
:
44
,
width
:
ScreenWidth
,
height
:
(
pph_carListView
?
.
bounds
.
size
.
height
)
!
-
44
))
pph_carListView
?
.
addSubview
(
pph_carListSCV
)
pph_carListSCV
.
contentSize
=
CGSize
(
width
:
fullScreenWidth
,
height
:
h
)
let
lbl
=
UILabel
(
frame
:
CGRect
(
x
:
0
,
y
:
0
,
width
:
fullScreenWidth
,
height
:
44
))
lbl
.
text
=
"所有车型"
lbl
.
textAlignment
=
.
center
lbl
.
font
=
UIFont
.
systemFont
(
ofSize
:
13
)
lbl
.
textColor
=
UIColor
(
named
:
"标题字颜色"
)
pph_carListView
!.
addSubview
(
lbl
)
let
closeBtn
=
UIButton
(
frame
:
CGRect
(
x
:
fullScreenWidth
-
44
,
y
:
0
,
width
:
44
,
height
:
44
))
closeBtn
.
setImage
(
UIImage
(
named
:
"xx"
),
for
:
.
normal
)
closeBtn
.
addTarget
(
self
,
action
:
#selector(
pph_closeCarList
)
,
for
:
.
touchUpInside
)
pph_carListView
!.
addSubview
(
closeBtn
)
let
line
=
UIView
(
frame
:
CGRect
(
x
:
0
,
y
:
43.5
,
width
:
fullScreenWidth
,
height
:
0.5
))
line
.
backgroundColor
=
UIColor
(
named
:
"灰色分界线"
)
pph_carListView
!.
addSubview
(
line
)
for
i
in
0
..<
pphCarTypesArr
.
count
{
setPPHCarListUI
(
index
:
i
,
bg
:
pph_carListSCV
)
}
}
let
width
=
CGFloat
(
3
-
pphCarTypesArr
.
count
%
3
)
*
w
let
yValue
=
(
CGFloat
(
pphCarTypesArr
.
count
/
3
)
*
w
)
+
44
let
lineV
=
UIView
(
frame
:
CGRect
(
x
:
fullScreenWidth
-
width
,
y
:
yValue
,
width
:
width
,
height
:
w
))
lineV
.
layer
.
borderColor
=
UIColor
(
named
:
"灰色分界线"
)?
.
cgColor
lineV
.
layer
.
borderWidth
=
0.5
pph_carListView
!.
addSubview
(
lineV
)
if
pph_cBtn
==
nil
{
pph_cBtn
=
UIButton
()
pph_cBtn
!.
backgroundColor
=
UIColor
(
named
:
"标题字颜色"
)
pph_cBtn
!.
alpha
=
0.4
pph_cBtn
?
.
addTarget
(
self
,
action
:
#selector(
pph_closeCarList
)
,
for
:
.
touchUpInside
)
self
.
view
.
addSubview
(
pph_cBtn
!
)
pph_cBtn
?
.
snp_makeConstraints
({
(
make
)
in
make
.
top
.
equalTo
(
pph_carListView
!.
snp_bottom
)
.
offset
(
0
)
make
.
left
.
right
.
bottom
.
equalToSuperview
()
})
}
}
//MARK: - 选择所有车型
var
carListView
:
UIView
?
...
...
@@ -2106,6 +2451,7 @@ class XiaYunDanViewController: BaseViewController,UITableViewDelegate,UITableVie
closeBtn
?
.
isHidden
=
true
changeCellSortView
?
.
isHidden
=
true
}
@objc
func
selectAllCars
(){
cBtn
?
.
isHidden
=
false
carListView
?
.
isHidden
=
false
...
...
@@ -2164,7 +2510,41 @@ class XiaYunDanViewController: BaseViewController,UITableViewDelegate,UITableVie
})
}
}
func
setPPHCarListUI
(
index
:
Int
,
bg
:
UIView
){
let
w
=
fullScreenWidth
/
3
let
cols
=
3
let
col
=
index
%
cols
let
row
=
index
/
cols
let
shopX
=
CGFloat
(
col
)
*
w
let
shopY
=
CGFloat
(
row
)
*
w
let
btn
=
UIButton
(
frame
:
CGRect
(
x
:
shopX
,
y
:
shopY
,
width
:
w
,
height
:
w
))
btn
.
addTarget
(
self
,
action
:
#selector(
carSelect(sender:)
)
,
for
:
.
touchUpInside
)
btn
.
tag
=
index
btn
.
layer
.
borderColor
=
UIColor
(
named
:
"灰色分界线"
)?
.
cgColor
btn
.
layer
.
borderWidth
=
0.5
let
model
=
pphCarTypesArr
[
index
]
let
imgV
=
UIImageView
()
SDWebImageDownloader
.
shared
.
downloadImage
(
with
:
URL
(
string
:
model
.
img
!
),
options
:
.
continueInBackground
,
progress
:
{
(
a
,
b
,
nil
)
in
})
{
(
img
,
data
,
err
,
true
)
in
if
img
!=
nil
{
imgV
.
image
=
img
let
p
=
w
/
(
imgV
.
image
?
.
size
.
width
)
!
imgV
.
frame
=
CGRect
(
x
:
btn
.
frame
.
origin
.
x
,
y
:
btn
.
frame
.
origin
.
y
+
30
,
width
:
w
,
height
:
w
*
p
)
let
lbl
=
UILabel
(
frame
:
CGRect
(
x
:
btn
.
frame
.
origin
.
x
,
y
:
btn
.
frame
.
origin
.
y
+
imgV
.
bounds
.
size
.
height
,
width
:
w
,
height
:
w
-
(
w
*
p
*
0.5
)))
lbl
.
textColor
=
UIColor
(
named
:
"灰色字体颜色"
)
lbl
.
font
=
UIFont
.
systemFont
(
ofSize
:
13
)
lbl
.
textAlignment
=
.
center
lbl
.
text
=
model
.
name
bg
.
addSubview
(
lbl
)
}
bg
.
addSubview
(
imgV
)
}
btn
.
setTitleColor
(
UIColor
.
black
,
for
:
.
normal
)
bg
.
addSubview
(
btn
)
}
func
setCarListUI
(
index
:
Int
,
bg
:
UIView
){
let
w
=
fullScreenWidth
/
3
let
cols
=
3
...
...
GeliBusinessPlatform/ViewController/代客下单(货运)/下运单/XiaYunDanViewController.xib
View file @
e574e7d7
...
...
@@ -23,6 +23,8 @@
<outlet
property=
"listView"
destination=
"Try-UC-8fP"
id=
"plR-El-hxN"
/>
<outlet
property=
"p_p_view"
destination=
"Vf0-aT-43t"
id=
"BMv-xY-6z5"
/>
<outlet
property=
"pin_pin_huo"
destination=
"hwI-gN-CwU"
id=
"xHH-Jp-k0u"
/>
<outlet
property=
"pph_listView"
destination=
"lrw-DF-qzM"
id=
"QG0-fE-TaJ"
/>
<outlet
property=
"pph_topCarBtnView"
destination=
"dYD-zk-l4l"
id=
"D3e-D2-pIT"
/>
<outlet
property=
"priceLbl"
destination=
"TJP-xc-KTh"
id=
"NH7-PB-8a7"
/>
<outlet
property=
"rightBtn"
destination=
"X6m-t6-gdl"
id=
"yiF-bx-dJm"
/>
<outlet
property=
"topBtnView"
destination=
"3NL-zo-jTU"
id=
"7XJ-gu-PcZ"
/>
...
...
@@ -506,6 +508,10 @@
<tableView
clipsSubviews=
"YES"
contentMode=
"scaleToFill"
alwaysBounceVertical=
"YES"
style=
"plain"
separatorStyle=
"default"
rowHeight=
"-1"
estimatedRowHeight=
"-1"
sectionHeaderHeight=
"28"
sectionFooterHeight=
"28"
translatesAutoresizingMaskIntoConstraints=
"NO"
id=
"lrw-DF-qzM"
>
<rect
key=
"frame"
x=
"0.0"
y=
"44"
width=
"414"
height=
"636"
/>
<color
key=
"backgroundColor"
systemColor=
"systemBackgroundColor"
/>
<connections>
<outlet
property=
"dataSource"
destination=
"-1"
id=
"hRD-SE-jP6"
/>
<outlet
property=
"delegate"
destination=
"-1"
id=
"pH6-qu-Y2h"
/>
</connections>
</tableView>
</subviews>
<color
key=
"backgroundColor"
name=
"白色背景色"
/>
...
...
GeliBusinessPlatform/ViewController/货拉拉/收发货地址/ToAndFormSelectViewController.xib
View file @
e574e7d7
<?xml version="1.0" encoding="UTF-8"?>
<document
type=
"com.apple.InterfaceBuilder3.CocoaTouch.XIB"
version=
"3.0"
toolsVersion=
"1
6097.2
"
targetRuntime=
"iOS.CocoaTouch"
propertyAccessControl=
"none"
useAutolayout=
"YES"
useTraitCollections=
"YES"
useSafeAreas=
"YES"
colorMatched=
"YES"
>
<document
type=
"com.apple.InterfaceBuilder3.CocoaTouch.XIB"
version=
"3.0"
toolsVersion=
"1
7701
"
targetRuntime=
"iOS.CocoaTouch"
propertyAccessControl=
"none"
useAutolayout=
"YES"
useTraitCollections=
"YES"
useSafeAreas=
"YES"
colorMatched=
"YES"
>
<device
id=
"retina6_1"
orientation=
"portrait"
appearance=
"light"
/>
<dependencies>
<deployment
identifier=
"iOS"
/>
<plugIn
identifier=
"com.apple.InterfaceBuilder.IBCocoaTouchPlugin"
version=
"1
6087
"
/>
<plugIn
identifier=
"com.apple.InterfaceBuilder.IBCocoaTouchPlugin"
version=
"1
7703
"
/>
<capability
name=
"Named colors"
minToolsVersion=
"9.0"
/>
<capability
name=
"Safe area layout guides"
minToolsVersion=
"9.0"
/>
<capability
name=
"System colors in document resources"
minToolsVersion=
"11.0"
/>
<capability
name=
"documents saved in the Xcode 8 format"
minToolsVersion=
"8.0"
/>
</dependencies>
<objects>
...
...
@@ -49,7 +50,7 @@
<fontDescription
key=
"fontDescription"
type=
"system"
pointSize=
"19"
/>
<state
key=
"normal"
image=
"fanhui"
/>
</button>
<button
opaque=
"NO"
contentMode=
"scaleToFill"
contentHorizontalAlignment=
"center"
contentVerticalAlignment=
"center"
buttonType=
"
roundedRect
"
lineBreakMode=
"middleTruncation"
translatesAutoresizingMaskIntoConstraints=
"NO"
id=
"mc4-mS-8P7"
>
<button
opaque=
"NO"
contentMode=
"scaleToFill"
contentHorizontalAlignment=
"center"
contentVerticalAlignment=
"center"
buttonType=
"
system
"
lineBreakMode=
"middleTruncation"
translatesAutoresizingMaskIntoConstraints=
"NO"
id=
"mc4-mS-8P7"
>
<rect
key=
"frame"
x=
"0.0"
y=
"8"
width=
"46"
height=
"30"
/>
<constraints>
<constraint
firstAttribute=
"width"
constant=
"46"
id=
"4w1-lk-ryV"
/>
...
...
@@ -82,7 +83,7 @@
</constraints>
</view>
</subviews>
<color
key=
"backgroundColor"
systemColor=
"systemBackgroundColor"
cocoaTouchSystemColor=
"whiteColor"
/>
<color
key=
"backgroundColor"
systemColor=
"systemBackgroundColor"
/>
<constraints>
<constraint
firstAttribute=
"bottom"
secondItem=
"mc4-mS-8P7"
secondAttribute=
"bottom"
constant=
"7"
id=
"295-Ym-bWu"
/>
<constraint
firstItem=
"mc4-mS-8P7"
firstAttribute=
"top"
secondItem=
"gLT-4M-bfs"
secondAttribute=
"top"
constant=
"8"
id=
"6jl-8q-avT"
/>
...
...
@@ -99,7 +100,7 @@
</view>
<view
contentMode=
"scaleToFill"
translatesAutoresizingMaskIntoConstraints=
"NO"
id=
"Zku-OV-GRM"
customClass=
"LGButton"
customModule=
"LGButton"
>
<rect
key=
"frame"
x=
"0.0"
y=
"813"
width=
"414"
height=
"83"
/>
<color
key=
"backgroundColor"
systemColor=
"systemBackgroundColor"
cocoaTouchSystemColor=
"whiteColor"
/>
<color
key=
"backgroundColor"
systemColor=
"systemBackgroundColor"
/>
<userDefinedRuntimeAttributes>
<userDefinedRuntimeAttribute
type=
"color"
keyPath=
"gradientStartColor"
>
<color
key=
"value"
name=
"按钮渐变色上"
/>
...
...
@@ -147,7 +148,7 @@
</constraints>
</view>
<label
opaque=
"NO"
userInteractionEnabled=
"NO"
contentMode=
"left"
horizontalHuggingPriority=
"251"
verticalHuggingPriority=
"251"
text=
"发货人信息(选填)"
textAlignment=
"natural"
lineBreakMode=
"tailTruncation"
baselineAdjustment=
"alignBaselines"
adjustsFontSizeToFit=
"NO"
translatesAutoresizingMaskIntoConstraints=
"NO"
id=
"kjg-a9-QU1"
>
<rect
key=
"frame"
x=
"15"
y=
"11"
width=
"11
8
"
height=
"19"
/>
<rect
key=
"frame"
x=
"15"
y=
"11"
width=
"11
7
"
height=
"19"
/>
<fontDescription
key=
"fontDescription"
name=
"PingFangSC-Regular"
family=
"PingFang SC"
pointSize=
"13"
/>
<color
key=
"textColor"
name=
"标题字颜色"
/>
<nil
key=
"highlightedColor"
/>
...
...
@@ -178,7 +179,7 @@
<textInputTraits
key=
"textInputTraits"
/>
</textField>
</subviews>
<color
key=
"backgroundColor"
systemColor=
"systemBackgroundColor"
cocoaTouchSystemColor=
"whiteColor"
/>
<color
key=
"backgroundColor"
systemColor=
"systemBackgroundColor"
/>
<constraints>
<constraint
firstItem=
"Gh9-a6-8wp"
firstAttribute=
"leading"
secondItem=
"Lvk-JQ-tFy"
secondAttribute=
"leading"
id=
"1PB-XO-mET"
/>
<constraint
firstItem=
"1hY-wr-ip3"
firstAttribute=
"top"
secondItem=
"mLk-53-Hn6"
secondAttribute=
"bottom"
constant=
"8"
id=
"4dz-DW-x9E"
/>
...
...
@@ -213,7 +214,7 @@
<rect
key=
"frame"
x=
"0.0"
y=
"89"
width=
"414"
height=
"586"
/>
<color
key=
"backgroundColor"
name=
"app底色"
/>
</view>
<button
hidden=
"YES"
opaque=
"NO"
alpha=
"0.40000000000000002"
contentMode=
"scaleToFill"
contentHorizontalAlignment=
"center"
contentVerticalAlignment=
"center"
buttonType=
"
roundedRect
"
lineBreakMode=
"middleTruncation"
translatesAutoresizingMaskIntoConstraints=
"NO"
id=
"T9o-ZR-uVl"
>
<button
hidden=
"YES"
opaque=
"NO"
alpha=
"0.40000000000000002"
contentMode=
"scaleToFill"
contentHorizontalAlignment=
"center"
contentVerticalAlignment=
"center"
buttonType=
"
system
"
lineBreakMode=
"middleTruncation"
translatesAutoresizingMaskIntoConstraints=
"NO"
id=
"T9o-ZR-uVl"
>
<rect
key=
"frame"
x=
"0.0"
y=
"89"
width=
"414"
height=
"807"
/>
<color
key=
"backgroundColor"
name=
"标题字颜色"
/>
<color
key=
"tintColor"
white=
"0.0"
alpha=
"0.0"
colorSpace=
"custom"
customColorSpace=
"genericGamma22GrayColorSpace"
/>
...
...
@@ -227,7 +228,7 @@
<view
hidden=
"YES"
contentMode=
"scaleToFill"
translatesAutoresizingMaskIntoConstraints=
"NO"
id=
"c1E-9c-vVT"
>
<rect
key=
"frame"
x=
"0.0"
y=
"148"
width=
"414"
height=
"748"
/>
<subviews>
<button
opaque=
"NO"
contentMode=
"scaleToFill"
selected=
"YES"
contentHorizontalAlignment=
"center"
contentVerticalAlignment=
"center"
buttonType=
"
roundedRect
"
lineBreakMode=
"middleTruncation"
translatesAutoresizingMaskIntoConstraints=
"NO"
id=
"NcV-XI-uHx"
>
<button
opaque=
"NO"
contentMode=
"scaleToFill"
selected=
"YES"
contentHorizontalAlignment=
"center"
contentVerticalAlignment=
"center"
buttonType=
"
system
"
lineBreakMode=
"middleTruncation"
translatesAutoresizingMaskIntoConstraints=
"NO"
id=
"NcV-XI-uHx"
>
<rect
key=
"frame"
x=
"0.0"
y=
"0.0"
width=
"414"
height=
"51.5"
/>
<constraints>
<constraint
firstAttribute=
"height"
constant=
"51.5"
id=
"3FM-pF-Ev2"
/>
...
...
@@ -271,7 +272,7 @@
<constraint
firstAttribute=
"height"
constant=
"1"
id=
"bZ3-HO-AFP"
/>
</constraints>
</view>
<button
opaque=
"NO"
contentMode=
"scaleToFill"
contentHorizontalAlignment=
"center"
contentVerticalAlignment=
"center"
buttonType=
"
roundedRect
"
lineBreakMode=
"middleTruncation"
translatesAutoresizingMaskIntoConstraints=
"NO"
id=
"7b1-Dd-JY1"
>
<button
opaque=
"NO"
contentMode=
"scaleToFill"
contentHorizontalAlignment=
"center"
contentVerticalAlignment=
"center"
buttonType=
"
system
"
lineBreakMode=
"middleTruncation"
translatesAutoresizingMaskIntoConstraints=
"NO"
id=
"7b1-Dd-JY1"
>
<rect
key=
"frame"
x=
"0.0"
y=
"52.5"
width=
"414"
height=
"49"
/>
<color
key=
"backgroundColor"
white=
"0.0"
alpha=
"0.0"
colorSpace=
"custom"
customColorSpace=
"genericGamma22GrayColorSpace"
/>
<state
key=
"normal"
>
...
...
@@ -283,7 +284,7 @@
</button>
<tableView
clipsSubviews=
"YES"
contentMode=
"scaleToFill"
alwaysBounceVertical=
"YES"
style=
"plain"
separatorStyle=
"default"
rowHeight=
"-1"
estimatedRowHeight=
"-1"
sectionHeaderHeight=
"-1"
estimatedSectionHeaderHeight=
"-1"
sectionFooterHeight=
"-1"
estimatedSectionFooterHeight=
"-1"
translatesAutoresizingMaskIntoConstraints=
"NO"
id=
"FkD-95-sVW"
>
<rect
key=
"frame"
x=
"0.0"
y=
"101.5"
width=
"414"
height=
"646.5"
/>
<color
key=
"backgroundColor"
systemColor=
"systemBackgroundColor"
cocoaTouchSystemColor=
"whiteColor"
/>
<color
key=
"backgroundColor"
systemColor=
"systemBackgroundColor"
/>
<connections>
<outlet
property=
"dataSource"
destination=
"-1"
id=
"0q6-BW-cvc"
/>
<outlet
property=
"delegate"
destination=
"-1"
id=
"Abz-vu-2hp"
/>
...
...
@@ -291,14 +292,14 @@
</tableView>
<tableView
hidden=
"YES"
clipsSubviews=
"YES"
contentMode=
"scaleToFill"
alwaysBounceVertical=
"YES"
style=
"plain"
separatorStyle=
"default"
rowHeight=
"-1"
estimatedRowHeight=
"-1"
sectionHeaderHeight=
"28"
sectionFooterHeight=
"28"
translatesAutoresizingMaskIntoConstraints=
"NO"
id=
"WO7-AX-Flw"
>
<rect
key=
"frame"
x=
"0.0"
y=
"0.0"
width=
"414"
height=
"748"
/>
<color
key=
"backgroundColor"
systemColor=
"systemBackgroundColor"
cocoaTouchSystemColor=
"whiteColor"
/>
<color
key=
"backgroundColor"
systemColor=
"systemBackgroundColor"
/>
<connections>
<outlet
property=
"dataSource"
destination=
"-1"
id=
"jmz-eX-3c5"
/>
<outlet
property=
"delegate"
destination=
"-1"
id=
"f1a-0P-OnF"
/>
</connections>
</tableView>
</subviews>
<color
key=
"backgroundColor"
systemColor=
"systemBackgroundColor"
cocoaTouchSystemColor=
"whiteColor"
/>
<color
key=
"backgroundColor"
systemColor=
"systemBackgroundColor"
/>
<constraints>
<constraint
firstItem=
"0Ha-lY-Z5m"
firstAttribute=
"top"
secondItem=
"NcV-XI-uHx"
secondAttribute=
"bottom"
id=
"2nu-dJ-y63"
/>
<constraint
firstItem=
"FkD-95-sVW"
firstAttribute=
"leading"
secondItem=
"c1E-9c-vVT"
secondAttribute=
"leading"
id=
"5BV-xv-6A3"
/>
...
...
@@ -329,7 +330,8 @@
</constraints>
</view>
</subviews>
<color
key=
"backgroundColor"
systemColor=
"systemBackgroundColor"
cocoaTouchSystemColor=
"whiteColor"
/>
<viewLayoutGuide
key=
"safeArea"
id=
"fnl-2z-Ty3"
/>
<color
key=
"backgroundColor"
systemColor=
"systemBackgroundColor"
/>
<constraints>
<constraint
firstItem=
"8qa-oS-xtb"
firstAttribute=
"leading"
secondItem=
"fnl-2z-Ty3"
secondAttribute=
"leading"
id=
"0eG-SR-nwc"
/>
<constraint
firstItem=
"Zku-OV-GRM"
firstAttribute=
"leading"
secondItem=
"fnl-2z-Ty3"
secondAttribute=
"leading"
id=
"2Gr-Nv-AAd"
/>
...
...
@@ -361,10 +363,14 @@
<constraint
firstItem=
"T9o-ZR-uVl"
firstAttribute=
"leading"
secondItem=
"fnl-2z-Ty3"
secondAttribute=
"leading"
id=
"sUG-bR-zWb"
/>
<constraint
firstItem=
"gLT-4M-bfs"
firstAttribute=
"leading"
secondItem=
"fnl-2z-Ty3"
secondAttribute=
"leading"
id=
"zkb-lY-UXz"
/>
</constraints>
<viewLayoutGuide
key=
"safeArea"
id=
"fnl-2z-Ty3"
/>
<point
key=
"canvasLocation"
x=
"131.8840579710145"
y=
"89.732142857142847"
/>
</view>
</objects>
<designables>
<designable
name=
"Zku-OV-GRM"
>
<size
key=
"intrinsicContentSize"
width=
"10"
height=
"10"
/>
</designable>
</designables>
<resources>
<image
name=
"dzdingwei"
width=
"14"
height=
"17"
/>
<image
name=
"fanhui"
width=
"18"
height=
"35"
/>
...
...
@@ -399,5 +405,8 @@
<namedColor
name=
"蓝色字体颜色"
>
<color
red=
"0.27843137254901962"
green=
"0.5607843137254902"
blue=
"0.8901960784313725"
alpha=
"1"
colorSpace=
"custom"
customColorSpace=
"sRGB"
/>
</namedColor>
<systemColor
name=
"systemBackgroundColor"
>
<color
white=
"1"
alpha=
"1"
colorSpace=
"custom"
customColorSpace=
"genericGamma22GrayColorSpace"
/>
</systemColor>
</resources>
</document>
GeliBusinessPlatform/ViewController/货拉拉/运单详情/cell/HLLTopCell.swift
View file @
e574e7d7
...
...
@@ -12,7 +12,7 @@ import SDWebImage
protocol
HLLTopCellDelegate
{
func
HLLTopCellBtnClick
(
idx
:
Int
)
func
HLLTopCellScrollIdx
(
idx
:
Int
)
// func HLLTopCellOtherClick(isSelect:Bool)
// func HLLTopCellOtherClick(isSelect:Bool)
}
class
HLLTopCell
:
UITableViewCell
,
UIScrollViewDelegate
{
var
idx
=
0
...
...
@@ -62,8 +62,40 @@ class HLLTopCell: UITableViewCell,UIScrollViewDelegate {
}
func
scrollViewDidScroll
(
_
scrollView
:
UIScrollView
)
{
leftBtn
.
isHidden
=
false
rightBtn
.
isHidden
=
false
if
isPPH
{
if
scrollView
.
contentOffset
.
x
/
scViewBg
.
bounds
.
size
.
width
<
1
{
leftBtn
.
isHidden
=
true
}
let
num
=
pph_datas
.
count
-
1
if
scrollView
.
contentOffset
.
x
/
scViewBg
.
bounds
.
size
.
width
>=
CGFloat
(
num
)
{
rightBtn
.
isHidden
=
true
}
var
numIdx
=
Int
(
scrollView
.
contentOffset
.
x
/
scViewBg
.
bounds
.
size
.
width
-
1
)
if
numIdx
<
0
{
numIdx
=
0
}
if
numIdx
>
num
{
numIdx
=
num
}
let
model
=
pph_datas
[
numIdx
]
if
pph_datas
.
count
>
0
{
if
model
.
truckWeight
!=
nil
{
weightLbl
.
text
=
model
.
truckWeight
}
if
model
.
cubage
!=
nil
{
sizeLbl
.
text
=
"
\(
model
.
cubage
!
)
"
}
tjLbl
.
text
=
model
.
truckVolume
}
}
else
{
if
scrollView
.
contentOffset
.
x
/
scViewBg
.
bounds
.
size
.
width
<
1
{
leftBtn
.
isHidden
=
true
}
...
...
@@ -80,6 +112,7 @@ class HLLTopCell: UITableViewCell,UIScrollViewDelegate {
if
numIdx
>
num
{
numIdx
=
num
}
if
datas
.
count
>
0
{
let
model
=
datas
[
numIdx
]
if
(
model
.
vehicle_price_text_item
!.
text_weight
!.
contains
(
"/"
)){
let
arr
=
model
.
vehicle_price_text_item
?
.
text_weight
?
.
components
(
separatedBy
:
"/"
)
...
...
@@ -90,7 +123,8 @@ class HLLTopCell: UITableViewCell,UIScrollViewDelegate {
sizeLbl
.
text
=
model
.
vehicle_price_text_item
?
.
text_size
tjLbl
.
text
=
model
.
vehicle_price_text_item
?
.
text_volume
}
}
}
@IBOutlet
weak
var
rightBtn
:
UIButton
!
...
...
@@ -99,7 +133,25 @@ class HLLTopCell: UITableViewCell,UIScrollViewDelegate {
@IBOutlet
weak
var
tjLbl
:
UILabel
!
@IBOutlet
weak
var
sizeLbl
:
UILabel
!
@IBOutlet
weak
var
weightLbl
:
UILabel
!
var
pph_datas
:
Array
<
getVehicleTypeData_model
>
=
[]{
didSet
{
if
pph_datas
.
count
<
2
{
rightBtn
.
isHidden
=
true
}
else
{
rightBtn
.
isHidden
=
false
}
if
pph_datas
.
count
>
0
{
let
model
=
pph_datas
[
idx
]
if
model
.
truckWeight
!=
nil
{
weightLbl
.
text
=
model
.
truckWeight
}
if
model
.
cubage
!=
nil
{
sizeLbl
.
text
=
"
\(
model
.
cubage
!
)
"
}
tjLbl
.
text
=
model
.
truckVolume
}
}
}
var
datas
:
Array
<
vehicle_arr_data
>
=
[]{
didSet
{
if
datas
.
count
<
2
{
...
...
@@ -124,10 +176,59 @@ class HLLTopCell: UITableViewCell,UIScrollViewDelegate {
self
.
selectionStyle
=
.
none
}
var
isPPH
=
false
override
func
layoutIfNeeded
()
{
super
.
layoutIfNeeded
()
if
isPPH
{
if
scrollView
==
nil
{
scrollView
=
UIScrollView
(
frame
:
scViewBg
.
bounds
)
scViewBg
.
addSubview
(
scrollView
!
)
scrollView
?
.
isPagingEnabled
=
true
scrollView
?
.
showsHorizontalScrollIndicator
=
false
scrollView
?
.
delegate
=
self
}
if
(
scrollView
?
.
subviews
.
count
)
!
>
0
&&
scrollView
!=
nil
{
for
item
in
scrollView
!.
subviews
{
item
.
removeFromSuperview
()
}
}
let
num
=
pph_datas
.
count
scrollView
?
.
contentSize
=
CGSize
(
width
:
(
scViewBg
.
bounds
.
size
.
width
)
*
CGFloat
(
num
),
height
:
(
scViewBg
.
bounds
.
size
.
height
))
for
i
in
0
..<
num
{
let
view
=
UIView
(
frame
:
CGRect
(
x
:
CGFloat
(
i
)
*
(
scViewBg
.
bounds
.
size
.
width
),
y
:
0
,
width
:
scViewBg
.
bounds
.
size
.
width
,
height
:
scViewBg
.
bounds
.
size
.
height
))
let
model
=
pph_datas
[
i
]
let
imgV
=
UIImageView
()
view
.
addSubview
(
imgV
)
SDWebImageDownloader
.
shared
.
downloadImage
(
with
:
URL
(
string
:
model
.
img
!
),
options
:
.
continueInBackground
,
progress
:
{
(
a
,
b
,
nil
)
in
})
{
(
img
,
data
,
err
,
true
)
in
imgV
.
image
=
img
if
img
!=
nil
{
let
p
=
self
.
scViewBg
.
bounds
.
size
.
width
/
(
img
!.
size
.
width
)
imgV
.
snp
.
makeConstraints
{
(
make
)
in
make
.
width
.
equalTo
((
imgV
.
image
?
.
size
.
width
)
!
*
p
*
0.6
)
make
.
height
.
equalTo
((
imgV
.
image
?
.
size
.
height
)
!
*
p
*
0.5
)
make
.
centerX
.
equalTo
(
view
.
snp
.
centerX
)
make
.
centerY
.
equalTo
(
view
.
snp
.
centerY
)
}
}
else
{
imgV
.
image
=
UIImage
(
named
:
"lmn_tool_image"
)
imgV
.
snp
.
makeConstraints
{
(
make
)
in
make
.
width
.
equalTo
(
self
.
scViewBg
.
bounds
.
size
.
width
)
make
.
height
.
equalTo
(
self
.
scViewBg
.
bounds
.
size
.
height
)
make
.
centerX
.
equalTo
(
view
.
snp
.
centerX
)
make
.
centerY
.
equalTo
(
view
.
snp
.
centerY
)
}
}
}
scrollView
?
.
addSubview
(
view
)
}
return
}
if
scrollView
==
nil
{
scrollView
=
UIScrollView
(
frame
:
scViewBg
.
bounds
)
scViewBg
.
addSubview
(
scrollView
!
)
...
...
@@ -149,7 +250,6 @@ class HLLTopCell: UITableViewCell,UIScrollViewDelegate {
let
view
=
UIView
(
frame
:
CGRect
(
x
:
CGFloat
(
i
)
*
(
scViewBg
.
bounds
.
size
.
width
),
y
:
0
,
width
:
scViewBg
.
bounds
.
size
.
width
,
height
:
scViewBg
.
bounds
.
size
.
height
))
let
model
=
datas
[
i
]
let
imgV
=
UIImageView
()
// imgV.image =
view
.
addSubview
(
imgV
)
...
...
GeliBusinessPlatform/ViewController/货拉拉/运单详情/cell/OnlyViewCell.swift
View file @
e574e7d7
...
...
@@ -14,6 +14,9 @@ class OnlyViewCell: UITableViewCell {
var
delegate
:
OnlyViewCellDelegate
?
@IBOutlet
weak
var
btnViewH
:
NSLayoutConstraint
!
var
datas
:
Array
<
vehicle_std_arr_data
>
?
var
isPPH
=
false
var
pph_datas
:
Array
<
getVehicleTypeData_model
>
?
@IBOutlet
weak
var
btnView
:
UIView
!
override
func
awakeFromNib
()
{
super
.
awakeFromNib
()
...
...
@@ -24,6 +27,36 @@ class OnlyViewCell: UITableViewCell {
var
isNotReady
:
Bool
=
true
override
func
layoutSubviews
()
{
super
.
layoutSubviews
()
if
isPPH
{
if
isNotReady
{
for
index
in
0
..<
pph_datas
!.
count
{
let
item
=
pph_datas
!
[
index
]
let
width
=
fullScreenWidth
-
30
let
w
=
width
/
3
let
cols
=
3
let
col
=
index
%
cols
let
row
=
index
/
cols
let
shopX
=
CGFloat
(
col
)
*
(
w
+
10
)
let
shopY
=
CGFloat
(
row
)
*
(
20
+
5
)
let
btn
=
UIButton
(
frame
:
CGRect
(
x
:
shopX
,
y
:
shopY
,
width
:
w
,
height
:
20
))
btn
.
setImage
(
UIImage
(
named
:
"daixuan"
),
for
:
.
normal
)
btn
.
setImage
(
UIImage
(
named
:
"yuxuan"
),
for
:
.
selected
)
btn
.
addTarget
(
self
,
action
:
#selector(
carSelect(sender:)
)
,
for
:
.
touchUpInside
)
btn
.
tag
=
index
btn
.
setTitle
(
" "
+
item
.
name
!
,
for
:
.
normal
)
btn
.
titleLabel
?
.
font
=
UIFont
.
systemFont
(
ofSize
:
11
)
btn
.
setTitleColor
(
UIColor
(
named
:
"灰色字体颜色"
),
for
:
.
normal
)
btn
.
titleLabel
?
.
font
=
UIFont
.
systemFont
(
ofSize
:
13
)
btnView
.
addSubview
(
btn
)
if
index
==
pph_datas
!.
count
-
1
{
btnViewH
.
constant
=
shopY
+
20
isNotReady
=
false
}
}
}
}
else
{
if
isNotReady
{
for
index
in
0
..<
datas
!.
count
{
let
item
=
datas
!
[
index
]
...
...
@@ -52,7 +85,7 @@ class OnlyViewCell: UITableViewCell {
}
}
}
}
}
@objc
func
carSelect
(
sender
:
UIButton
){
if
sender
.
isSelected
{
...
...
GeliBusinessPlatform/ViewController/货拉拉/运单详情/cell/OnlyViewCell.xib
View file @
e574e7d7
<?xml version="1.0" encoding="UTF-8"?>
<document
type=
"com.apple.InterfaceBuilder3.CocoaTouch.XIB"
version=
"3.0"
toolsVersion=
"1
6097.2
"
targetRuntime=
"iOS.CocoaTouch"
propertyAccessControl=
"none"
useAutolayout=
"YES"
useTraitCollections=
"YES"
useSafeAreas=
"YES"
colorMatched=
"YES"
>
<document
type=
"com.apple.InterfaceBuilder3.CocoaTouch.XIB"
version=
"3.0"
toolsVersion=
"1
7701
"
targetRuntime=
"iOS.CocoaTouch"
propertyAccessControl=
"none"
useAutolayout=
"YES"
useTraitCollections=
"YES"
useSafeAreas=
"YES"
colorMatched=
"YES"
>
<device
id=
"retina6_1"
orientation=
"portrait"
appearance=
"light"
/>
<dependencies>
<deployment
identifier=
"iOS"
/>
<plugIn
identifier=
"com.apple.InterfaceBuilder.IBCocoaTouchPlugin"
version=
"1
6087
"
/>
<plugIn
identifier=
"com.apple.InterfaceBuilder.IBCocoaTouchPlugin"
version=
"1
7703
"
/>
<capability
name=
"Named colors"
minToolsVersion=
"9.0"
/>
<capability
name=
"Safe area layout guides"
minToolsVersion=
"9.0"
/>
<capability
name=
"System colors in document resources"
minToolsVersion=
"11.0"
/>
<capability
name=
"documents saved in the Xcode 8 format"
minToolsVersion=
"8.0"
/>
</dependencies>
<objects>
...
...
@@ -29,7 +30,7 @@
</label>
<view
contentMode=
"scaleToFill"
translatesAutoresizingMaskIntoConstraints=
"NO"
id=
"iu3-IV-bvt"
>
<rect
key=
"frame"
x=
"15"
y=
"35"
width=
"328"
height=
"20"
/>
<color
key=
"backgroundColor"
systemColor=
"systemBackgroundColor"
cocoaTouchSystemColor=
"whiteColor"
/>
<color
key=
"backgroundColor"
systemColor=
"systemBackgroundColor"
/>
<constraints>
<constraint
firstAttribute=
"height"
constant=
"20"
id=
"Em9-Te-Ur4"
/>
</constraints>
...
...
@@ -57,5 +58,8 @@
<namedColor
name=
"提示语字体颜色"
>
<color
red=
"0.70588235294117652"
green=
"0.70588235294117652"
blue=
"0.70588235294117652"
alpha=
"1"
colorSpace=
"custom"
customColorSpace=
"sRGB"
/>
</namedColor>
<systemColor
name=
"systemBackgroundColor"
>
<color
white=
"1"
alpha=
"1"
colorSpace=
"custom"
customColorSpace=
"genericGamma22GrayColorSpace"
/>
</systemColor>
</resources>
</document>
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