Commit e91a4282 authored by lujunye's avatar lujunye

加载补转圈

parent b192caa5
...@@ -33,7 +33,6 @@ class XiaYunDanViewController: BaseViewController,UITableViewDelegate,UITableVie ...@@ -33,7 +33,6 @@ class XiaYunDanViewController: BaseViewController,UITableViewDelegate,UITableVie
}else{ }else{
serviceSelect.remove(at: num!) serviceSelect.remove(at: num!)
} }
print(serviceSelect)
hListView.reloadData() hListView.reloadData()
} }
...@@ -73,14 +72,7 @@ class XiaYunDanViewController: BaseViewController,UITableViewDelegate,UITableVie ...@@ -73,14 +72,7 @@ class XiaYunDanViewController: BaseViewController,UITableViewDelegate,UITableVie
adrDs.append(dict) adrDs.append(dict)
} }
let lat_lon_arr = dataChangeString(sender: adrDs) let lat_lon_arr = dataChangeString(sender: adrDs)
// var std_tag_arr = ""
// if isSpecCar {
// std_tag_arr = "带尾板"
// }
let fD = adrArr.first! let fD = adrArr.first!
let cityData = fD["adr"] as! cityListDataModel let cityData = fD["adr"] as! cityListDataModel
let params = ["user_token":UserToken as Any, let params = ["user_token":UserToken as Any,
...@@ -92,6 +84,7 @@ class XiaYunDanViewController: BaseViewController,UITableViewDelegate,UITableVie ...@@ -92,6 +84,7 @@ class XiaYunDanViewController: BaseViewController,UITableViewDelegate,UITableVie
"spec_req_arr":spec_select_arr as Any, "spec_req_arr":spec_select_arr as Any,
"lat_lon_arr":lat_lon_arr as Any "lat_lon_arr":lat_lon_arr as Any
] ]
orderPriceCalculate(params, success: { (data) in orderPriceCalculate(params, success: { (data) in
let model = data as! orderPriceCalculateModel let model = data as! orderPriceCalculateModel
self.YuGuPriceLbl.text = "\(model.data!.total_price_fen!/100)" self.YuGuPriceLbl.text = "\(model.data!.total_price_fen!/100)"
...@@ -100,7 +93,6 @@ class XiaYunDanViewController: BaseViewController,UITableViewDelegate,UITableVie ...@@ -100,7 +93,6 @@ class XiaYunDanViewController: BaseViewController,UITableViewDelegate,UITableVie
view?.layoutIfNeeded() view?.layoutIfNeeded()
self.hListView.reloadData() self.hListView.reloadData()
return return
}) { (err) in }) { (err) in
...@@ -130,23 +122,16 @@ class XiaYunDanViewController: BaseViewController,UITableViewDelegate,UITableVie ...@@ -130,23 +122,16 @@ class XiaYunDanViewController: BaseViewController,UITableViewDelegate,UITableVie
if adrArr.count > 1 && dict!["locName"] as! String != "空" { if adrArr.count > 1 && dict!["locName"] as! String != "空" {
let firstDict = adrArr.first let firstDict = adrArr.first
let firstCity = firstDict!["adr"] as! cityListDataModel let firstCity = firstDict!["adr"] as! cityListDataModel
let firstArr = (firstDict!["detailAdr"] as! NSString).components(separatedBy: "_")
let lastDict = adrArr.last let lastDict = adrArr.last
let lastArr = (firstDict!["detailAdr"] as! NSString).components(separatedBy: "_")
var addr_info_arr:Array<Any> = [] var addr_info_arr:Array<Any> = []
//
addr_info_arr.removeAll() addr_info_arr.removeAll()
for i in 0 ..< adrArr.count { for i in 0 ..< adrArr.count {
let item = adrArr[i] let item = adrArr[i]
let itemModel = item["adr"] as! cityListDataModel let itemModel = item["adr"] as! cityListDataModel
print("itemModel",itemModel.lat_lon?.lat,itemModel.lat_lon?.lon)
let itemData = (item["detailAdr"] as! NSString).components(separatedBy: "_") let itemData = (item["detailAdr"] as! NSString).components(separatedBy: "_")
let dict = ["name":(itemData.last)! as Any, let dict = ["name":(itemData.last)! as Any,
"addr":itemData[2] as Any, "addr":itemData[2] as Any,
"city_name":itemData.first as Any, "city_name":itemData.first as Any,
...@@ -160,23 +145,6 @@ class XiaYunDanViewController: BaseViewController,UITableViewDelegate,UITableVie ...@@ -160,23 +145,6 @@ class XiaYunDanViewController: BaseViewController,UITableViewDelegate,UITableVie
addr_info_arr.append(dict) addr_info_arr.append(dict)
} }
var s_consignee = ""
if (firstDict!["shouHuoRen"] as! String).count > 0 {
s_consignee = firstDict!["shouHuoRen"] as! String
}
var s_mobile = ""
if (firstDict!["phoneNum"] as! String).count > 0 {
s_mobile = firstDict!["shouHuoRen"] as! String
}
var r_mobile = ""
if (lastDict!["phoneNum"] as! String).count > 0 {
r_mobile = lastDict!["phoneNum"] as! String
}
var r_consignee = ""
if (lastDict!["shouHuoRen"] as! String).count > 0 {
r_consignee = lastDict!["shouHuoRen"] as! String
}
let total = YuGuPriceLbl.text! as NSString let total = YuGuPriceLbl.text! as NSString
var spec_select_arr_str = "" var spec_select_arr_str = ""
if spec_select_arr.count > 0 { if spec_select_arr.count > 0 {
...@@ -202,9 +170,6 @@ class XiaYunDanViewController: BaseViewController,UITableViewDelegate,UITableVie ...@@ -202,9 +170,6 @@ class XiaYunDanViewController: BaseViewController,UITableViewDelegate,UITableVie
"addr_info":dataChangeString(sender: addr_info_arr) as Any "addr_info":dataChangeString(sender: addr_info_arr) as Any
] ]
return
shopsAuthList(dict1, success: { (data) in shopsAuthList(dict1, success: { (data) in
let model = data as! shopsAuthListModel let model = data as! shopsAuthListModel
HUD.flash(.success) HUD.flash(.success)
...@@ -318,20 +283,25 @@ class XiaYunDanViewController: BaseViewController,UITableViewDelegate,UITableVie ...@@ -318,20 +283,25 @@ class XiaYunDanViewController: BaseViewController,UITableViewDelegate,UITableVie
var carModel:cityCartDataModel? var carModel:cityCartDataModel?
fileprivate func extractedFunc() { fileprivate func extractedFunc() {
HUD.flash(.progress) HUD.flash(.progress)
cityCart(["user_token":UserToken as Any,"nonce_str":String.randomStr(len: 30) as Any,"city_id":city_id as Any], success: { (data) in cityCart(["user_token":UserToken as Any,"nonce_str":String.randomStr(len: 30) as Any,"city_id":city_id as Any], success: { (data) in
HUD.hide()
let model = data as! cityCartModel let model = data as! cityCartModel
self.carModel = model.data self.carModel = model.data
self.carTypesArr.removeAll() self.carTypesArr.removeAll()
for item in model.data!.vehicle_arr! { for item in model.data!.vehicle_arr! {
self.carTypesArr.append(item) self.carTypesArr.append(item)
} }
if self.carTypesArr.count == 0 {
HUD.flash(.label("暂无车型可供选择"), delay: 1.2)
return
}
let view = self.hListView.footerView(forSection: 0) let view = self.hListView.footerView(forSection: 0)
view?.layoutIfNeeded() view?.layoutIfNeeded()
self.setBtnUI(carTypesArr: self.carTypesArr,view: self.topCarBtnSelectView) self.setBtnUI(carTypesArr: self.carTypesArr,view: self.topCarBtnSelectView)
self.hListView.reloadData() self.hListView.reloadData()
HUD.hide()
}) { (err) in }) { (err) in
} }
...@@ -752,6 +722,7 @@ class XiaYunDanViewController: BaseViewController,UITableViewDelegate,UITableVie ...@@ -752,6 +722,7 @@ class XiaYunDanViewController: BaseViewController,UITableViewDelegate,UITableVie
} }
if isAlready { if isAlready {
for item in adrDatas { for item in adrDatas {
if item.name == selectLoc { if item.name == selectLoc {
city_id = item.city_id! city_id = item.city_id!
...@@ -791,7 +762,7 @@ class XiaYunDanViewController: BaseViewController,UITableViewDelegate,UITableVie ...@@ -791,7 +762,7 @@ class XiaYunDanViewController: BaseViewController,UITableViewDelegate,UITableVie
HUD.flash(.progress) HUD.flash(.progress)
cityList(["user_token":UserToken as Any,"nonce_str":String.randomStr(len: 30) as Any], success: { (data) in cityList(["user_token":UserToken as Any,"nonce_str":String.randomStr(len: 30) as Any], success: { (data) in
let model = data as! cityListModel let model = data as! cityListModel
HUD.hide()
self.adrDatas.removeAll() self.adrDatas.removeAll()
for item in model.data! { for item in model.data! {
if item.name_en == self.selectLoc.localizedLowercase || item.name == self.selectLoc { if item.name_en == self.selectLoc.localizedLowercase || item.name == self.selectLoc {
...@@ -804,7 +775,7 @@ class XiaYunDanViewController: BaseViewController,UITableViewDelegate,UITableVie ...@@ -804,7 +775,7 @@ class XiaYunDanViewController: BaseViewController,UITableViewDelegate,UITableVie
vc.locatStr = self.selectLoc vc.locatStr = self.selectLoc
vc.delegate = self vc.delegate = self
self.navigationController?.pushViewController(vc, animated: true) self.navigationController?.pushViewController(vc, animated: true)
HUD.hide()
}) { (err) in }) { (err) in
} }
...@@ -818,9 +789,6 @@ class XiaYunDanViewController: BaseViewController,UITableViewDelegate,UITableVie ...@@ -818,9 +789,6 @@ class XiaYunDanViewController: BaseViewController,UITableViewDelegate,UITableVie
} }
var manger:CLLocationManager = CLLocationManager() var manger:CLLocationManager = CLLocationManager()
var selectLoc = "" var selectLoc = ""
lazy var geoCoder: CLGeocoder = { lazy var geoCoder: CLGeocoder = {
...@@ -847,8 +815,6 @@ class XiaYunDanViewController: BaseViewController,UITableViewDelegate,UITableVie ...@@ -847,8 +815,6 @@ class XiaYunDanViewController: BaseViewController,UITableViewDelegate,UITableVie
self.locBtn.sizeToFit() self.locBtn.sizeToFit()
self.view.addSubview(self.locBtn) self.view.addSubview(self.locBtn)
self.locBtn.snp_makeConstraints({ (make) in self.locBtn.snp_makeConstraints({ (make) in
make.right.equalTo(-15) make.right.equalTo(-15)
make.bottom.equalTo(self.navbar.snp_bottom).offset(-7) make.bottom.equalTo(self.navbar.snp_bottom).offset(-7)
...@@ -892,9 +858,7 @@ class XiaYunDanViewController: BaseViewController,UITableViewDelegate,UITableVie ...@@ -892,9 +858,7 @@ class XiaYunDanViewController: BaseViewController,UITableViewDelegate,UITableVie
override func viewDidLoad() { override func viewDidLoad() {
super.viewDidLoad() super.viewDidLoad()
// locSelect()
checkLocation() checkLocation()
needsLocation() needsLocation()
...@@ -933,7 +897,7 @@ class XiaYunDanViewController: BaseViewController,UITableViewDelegate,UITableVie ...@@ -933,7 +897,7 @@ class XiaYunDanViewController: BaseViewController,UITableViewDelegate,UITableVie
appointmentTime(["user_token":UserToken as Any], success: { (data) in appointmentTime(["user_token":UserToken as Any], success: { (data) in
let dataModel = data as! appointmentTimeModel let dataModel = data as! appointmentTimeModel
self.timeData = dataModel.data self.timeData = dataModel.data
HUD.hide()
if dataModel.data?.today == nil { if dataModel.data?.today == nil {
...@@ -959,6 +923,7 @@ class XiaYunDanViewController: BaseViewController,UITableViewDelegate,UITableVie ...@@ -959,6 +923,7 @@ class XiaYunDanViewController: BaseViewController,UITableViewDelegate,UITableVie
self.pickup_time = rightText! self.pickup_time = rightText!
self.day = 0 self.day = 0
} }
HUD.hide()
}) { (error) in }) { (error) in
HUD.flash(.label("获取期望上门时间失败"),delay: 1.2) HUD.flash(.label("获取期望上门时间失败"),delay: 1.2)
...@@ -1190,7 +1155,7 @@ class XiaYunDanViewController: BaseViewController,UITableViewDelegate,UITableVie ...@@ -1190,7 +1155,7 @@ class XiaYunDanViewController: BaseViewController,UITableViewDelegate,UITableVie
HUD.flash(.progress) HUD.flash(.progress)
cityList(["user_token":UserToken as Any,"nonce_str":String.randomStr(len: 30) as Any], success: { (data) in cityList(["user_token":UserToken as Any,"nonce_str":String.randomStr(len: 30) as Any], success: { (data) in
let model = data as! cityListModel let model = data as! cityListModel
HUD.hide()
self.adrDatas.removeAll() self.adrDatas.removeAll()
for item in model.data! { for item in model.data! {
if item.name_en == self.selectLoc.localizedLowercase || item.name == self.selectLoc { if item.name_en == self.selectLoc.localizedLowercase || item.name == self.selectLoc {
...@@ -1202,10 +1167,8 @@ class XiaYunDanViewController: BaseViewController,UITableViewDelegate,UITableVie ...@@ -1202,10 +1167,8 @@ class XiaYunDanViewController: BaseViewController,UITableViewDelegate,UITableVie
vc.idx = 10086 vc.idx = 10086
vc.adrDatasArr = self.adrDatas vc.adrDatasArr = self.adrDatas
vc.delegate = self vc.delegate = self
// if self.loc != nil{
// vc.loc = self.loc
self.navigationController?.pushViewController(vc, animated: true) self.navigationController?.pushViewController(vc, animated: true)
// } HUD.hide()
}) { (err) in }) { (err) in
} }
...@@ -1215,7 +1178,6 @@ class XiaYunDanViewController: BaseViewController,UITableViewDelegate,UITableVie ...@@ -1215,7 +1178,6 @@ class XiaYunDanViewController: BaseViewController,UITableViewDelegate,UITableVie
vc.adrDatasArr = adrDatas vc.adrDatasArr = adrDatas
vc.delegate = self vc.delegate = self
if adrDatas.count > 0 { if adrDatas.count > 0 {
// vc.loc = loc
self.navigationController?.pushViewController(vc, animated: true) self.navigationController?.pushViewController(vc, animated: true)
} }
} }
...@@ -1356,7 +1318,7 @@ class XiaYunDanViewController: BaseViewController,UITableViewDelegate,UITableVie ...@@ -1356,7 +1318,7 @@ class XiaYunDanViewController: BaseViewController,UITableViewDelegate,UITableVie
HUD.flash(.progress) HUD.flash(.progress)
cityList(["user_token":UserToken as Any,"nonce_str":String.randomStr(len: 30) as Any], success: { (data) in cityList(["user_token":UserToken as Any,"nonce_str":String.randomStr(len: 30) as Any], success: { (data) in
let model = data as! cityListModel let model = data as! cityListModel
HUD.hide()
self.adrDatas.removeAll() self.adrDatas.removeAll()
for item in model.data! { for item in model.data! {
if item.name_en == self.selectLoc.localizedLowercase || item.name == self.selectLoc { if item.name_en == self.selectLoc.localizedLowercase || item.name == self.selectLoc {
...@@ -1383,7 +1345,7 @@ class XiaYunDanViewController: BaseViewController,UITableViewDelegate,UITableVie ...@@ -1383,7 +1345,7 @@ class XiaYunDanViewController: BaseViewController,UITableViewDelegate,UITableVie
} }
self.navigationController?.pushViewController(vc, animated: true) self.navigationController?.pushViewController(vc, animated: true)
HUD.hide()
}) { (err) in }) { (err) in
} }
...@@ -1445,6 +1407,7 @@ class XiaYunDanViewController: BaseViewController,UITableViewDelegate,UITableVie ...@@ -1445,6 +1407,7 @@ class XiaYunDanViewController: BaseViewController,UITableViewDelegate,UITableVie
} }
//时间 //时间
if indexPath.row == 0 { if indexPath.row == 0 {
HUD.flash(.progress)
getHllTime(["user_token":UserToken as Any], success: { (data) in getHllTime(["user_token":UserToken as Any], success: { (data) in
let model = data as! getHllTimeModel let model = data as! getHllTimeModel
if self.bgBtn == nil { if self.bgBtn == nil {
...@@ -1476,8 +1439,8 @@ class XiaYunDanViewController: BaseViewController,UITableViewDelegate,UITableVie ...@@ -1476,8 +1439,8 @@ class XiaYunDanViewController: BaseViewController,UITableViewDelegate,UITableVie
for item in model.data! { for item in model.data! {
self.dayArr.append(item) self.dayArr.append(item)
} }
print(model.data?.count)
self.showTimeSelect(view: self.btmView!) self.showTimeSelect(view: self.btmView!)
HUD.hide()
}) { (err) in }) { (err) in
} }
...@@ -1786,7 +1749,6 @@ class XiaYunDanViewController: BaseViewController,UITableViewDelegate,UITableVie ...@@ -1786,7 +1749,6 @@ class XiaYunDanViewController: BaseViewController,UITableViewDelegate,UITableVie
for item in view.subviews { for item in view.subviews {
item.removeFromSuperview() item.removeFromSuperview()
} }
print("carCount = ",carTypesArr.count)
let scv = UIScrollView(frame: view.bounds) let scv = UIScrollView(frame: view.bounds)
view.addSubview(scv) view.addSubview(scv)
topBtnScv = scv topBtnScv = scv
...@@ -1858,6 +1820,7 @@ class XiaYunDanViewController: BaseViewController,UITableViewDelegate,UITableVie ...@@ -1858,6 +1820,7 @@ class XiaYunDanViewController: BaseViewController,UITableViewDelegate,UITableVie
let line = lineArr.first let line = lineArr.first
line!.isHidden = false line!.isHidden = false
} }
} }
//MARK: - 选择所有车型 //MARK: - 选择所有车型
......
...@@ -25,7 +25,7 @@ class LogisticsCostDetailViewController: BaseViewController { ...@@ -25,7 +25,7 @@ class LogisticsCostDetailViewController: BaseViewController {
self.view.addSubview(navbar) self.view.addSubview(navbar)
priceLbl.text = "\(model!.data!.total_price_fen!/100)" priceLbl.text = "\(model!.data!.total_price_fen!/100)"
roadKM.text = "(总里程\(model!.data!.distance_total!)公里)" roadKM.text = "(总里程\(Double(model!.data!.distance_total!)/1000.0)公里)"
SetTopFrameView(view: contentV, btmView: self.view) SetTopFrameView(view: contentV, btmView: self.view)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment