Commit 7998d979 authored by lujunye's avatar lujunye

jasd;lkjasdf;ljsad jladjfpo34u859

parent 7a5a11ac
...@@ -1729,7 +1729,10 @@ class XiaYunDanViewController: BaseViewController,UITableViewDelegate,UITableVie ...@@ -1729,7 +1729,10 @@ class XiaYunDanViewController: BaseViewController,UITableViewDelegate,UITableVie
vc.delegate = self vc.delegate = self
vc.idx = indexPath.row vc.idx = indexPath.row
if pph_send_arr.count != 0 { if pph_send_arr.count != 0 {
vc.adrInfo = pph_send_arr[indexPath.row] let model = pph_send_arr[indexPath.row]
print(model.province_name)
vc.adrInfo = model
} }
self.navigationController?.pushViewController(vc, animated: true) self.navigationController?.pushViewController(vc, animated: true)
} }
......
...@@ -20,16 +20,7 @@ class P_P_H_Adr_VC: BaseViewController,SJMapViewControllerDelegate, UIPickerView ...@@ -20,16 +20,7 @@ class P_P_H_Adr_VC: BaseViewController,SJMapViewControllerDelegate, UIPickerView
var delegate:P_P_H_Adr_VC_Delegate? var delegate:P_P_H_Adr_VC_Delegate?
var lat:Double = 0 var lat:Double = 0
var lng:Double = 0 var lng:Double = 0
var adrInfo:addPinPinOrder_adrInfo?{ var adrInfo:addPinPinOrder_adrInfo?
didSet{
loc = "\(adrInfo?.lat!)-\(adrInfo?.lng!)"
city_lbl.text = "\(adrInfo?.province_name!)-\(adrInfo?.city_name!)-\(adrInfo?.district_name!)"
adrTf.text = adrInfo?.street_name!
textTV.text = adrInfo?.note!
nameTf.text = adrInfo?.linkman!
phoneTf.text = adrInfo?.mobile!
}
}
@IBOutlet weak var count_lbl: UILabel! @IBOutlet weak var count_lbl: UILabel!
@IBOutlet weak var textTV: UITextView! @IBOutlet weak var textTV: UITextView!
@IBOutlet weak var phoneTf: UITextField! @IBOutlet weak var phoneTf: UITextField!
...@@ -44,13 +35,12 @@ class P_P_H_Adr_VC: BaseViewController,SJMapViewControllerDelegate, UIPickerView ...@@ -44,13 +35,12 @@ class P_P_H_Adr_VC: BaseViewController,SJMapViewControllerDelegate, UIPickerView
var cityIndex = 0 var cityIndex = 0
//选择的区(县)索引 //选择的区(县)索引
var areaIndex = 0 var areaIndex = 0
var loc = ""
func SJMapViewControllerSelectArd(adr:String,cityData:String,loc:String) { func SJMapViewControllerSelectArd(adr:String,cityData:String,loc:String) {
city_lbl.text = cityData city_lbl.text = cityData
let ar = loc.components(separatedBy: "-") let ar = loc.components(separatedBy: "-")
self.lng = (ar.last as! NSString).doubleValue self.lng = (ar.last as! NSString).doubleValue
self.lat = (ar.first as! NSString).doubleValue self.lat = (ar.first as! NSString).doubleValue
self.loc = loc
let arr = cityData.components(separatedBy: "-") let arr = cityData.components(separatedBy: "-")
for i in 0 ..< addressArray.count { for i in 0 ..< addressArray.count {
let provinceData = addressArray[i] as! Dictionary<String,Any> let provinceData = addressArray[i] as! Dictionary<String,Any>
...@@ -80,7 +70,6 @@ class P_P_H_Adr_VC: BaseViewController,SJMapViewControllerDelegate, UIPickerView ...@@ -80,7 +70,6 @@ class P_P_H_Adr_VC: BaseViewController,SJMapViewControllerDelegate, UIPickerView
@IBAction func submit_action(_ sender: Any) { @IBAction func submit_action(_ sender: Any) {
let arr = city_lbl.text?.components(separatedBy: "-") let arr = city_lbl.text?.components(separatedBy: "-")
let arr2 = loc.components(separatedBy: "-")
if arr?.count == 0 { if arr?.count == 0 {
return return
} }
...@@ -97,8 +86,8 @@ class P_P_H_Adr_VC: BaseViewController,SJMapViewControllerDelegate, UIPickerView ...@@ -97,8 +86,8 @@ class P_P_H_Adr_VC: BaseViewController,SJMapViewControllerDelegate, UIPickerView
"shopName":adrTf.text as Any, "shopName":adrTf.text as Any,
"mobile":phoneTf.text as Any, "mobile":phoneTf.text as Any,
"type":type as Any, "type":type as Any,
"lat":arr2[0] as Any, "lat":lat as Any,
"lng":arr2[1] as Any, "lng":lng as Any,
"note":textTV.text as Any "note":textTV.text as Any
] ]
adrInfo = addPinPinOrder_adrInfo(JSON: dict) adrInfo = addPinPinOrder_adrInfo(JSON: dict)
...@@ -153,7 +142,6 @@ class P_P_H_Adr_VC: BaseViewController,SJMapViewControllerDelegate, UIPickerView ...@@ -153,7 +142,6 @@ class P_P_H_Adr_VC: BaseViewController,SJMapViewControllerDelegate, UIPickerView
btmView?.removeFromSuperview() btmView?.removeFromSuperview()
btmView = nil btmView = nil
bgBtn = nil bgBtn = nil
city_lbl.text = selectAdr city_lbl.text = selectAdr
} }
...@@ -179,7 +167,8 @@ class P_P_H_Adr_VC: BaseViewController,SJMapViewControllerDelegate, UIPickerView ...@@ -179,7 +167,8 @@ class P_P_H_Adr_VC: BaseViewController,SJMapViewControllerDelegate, UIPickerView
phoneTf.text = "" phoneTf.text = ""
nameTf.text = "" nameTf.text = ""
city_lbl.text = "请选择城市" city_lbl.text = "请选择城市"
loc = "" lat = 0
lng = 0
textTV.text = "" textTV.text = ""
checkInfo() checkInfo()
} }
...@@ -217,6 +206,7 @@ class P_P_H_Adr_VC: BaseViewController,SJMapViewControllerDelegate, UIPickerView ...@@ -217,6 +206,7 @@ class P_P_H_Adr_VC: BaseViewController,SJMapViewControllerDelegate, UIPickerView
} }
override func viewDidLoad() { override func viewDidLoad() {
super.viewDidLoad() super.viewDidLoad()
navbar.title = "信息填写" navbar.title = "信息填写"
self.view.addSubview(navbar) self.view.addSubview(navbar)
nameTf.addTarget(self, action: #selector(textChangeTf(tf:)), for: .allEditingEvents) nameTf.addTarget(self, action: #selector(textChangeTf(tf:)), for: .allEditingEvents)
...@@ -233,7 +223,22 @@ class P_P_H_Adr_VC: BaseViewController,SJMapViewControllerDelegate, UIPickerView ...@@ -233,7 +223,22 @@ class P_P_H_Adr_VC: BaseViewController,SJMapViewControllerDelegate, UIPickerView
getIndex() getIndex()
textTV.delegate = self textTV.delegate = self
if adrInfo != nil {
city_lbl.text = "\(adrInfo!.province_name!)-\(adrInfo!.city_name!)-\(adrInfo!.district_name!)"
textTV.text = adrInfo?.note
adrTf.text = adrInfo?.street_name
nameTf.text = adrInfo?.linkman
phoneTf.text = adrInfo?.mobile
lat = adrInfo!.lat!
lng = adrInfo!.lng!
if textTV.text.count != 0 {
holder_lbl.isHidden = true
}
}
checkInfo() checkInfo()
} }
......
...@@ -337,7 +337,7 @@ ...@@ -337,7 +337,7 @@
<nil key="highlightedColor"/> <nil key="highlightedColor"/>
</label> </label>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="请填写备注" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="sp6-3a-dQq"> <label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="请填写备注" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="sp6-3a-dQq">
<rect key="frame" x="10" y="10" width="65" height="19"/> <rect key="frame" x="10" y="12" width="65" height="19"/>
<fontDescription key="fontDescription" name="PingFangSC-Regular" family="PingFang SC" pointSize="13"/> <fontDescription key="fontDescription" name="PingFangSC-Regular" family="PingFang SC" pointSize="13"/>
<color key="textColor" name="9A9A9A"/> <color key="textColor" name="9A9A9A"/>
<nil key="highlightedColor"/> <nil key="highlightedColor"/>
...@@ -350,7 +350,7 @@ ...@@ -350,7 +350,7 @@
<constraint firstAttribute="bottom" secondItem="SOk-O6-8QU" secondAttribute="bottom" constant="5" id="Iin-MT-R3m"/> <constraint firstAttribute="bottom" secondItem="SOk-O6-8QU" secondAttribute="bottom" constant="5" id="Iin-MT-R3m"/>
<constraint firstItem="SOk-O6-8QU" firstAttribute="top" secondItem="L26-Wm-cnn" secondAttribute="top" constant="5" id="JJF-RO-7ia"/> <constraint firstItem="SOk-O6-8QU" firstAttribute="top" secondItem="L26-Wm-cnn" secondAttribute="top" constant="5" id="JJF-RO-7ia"/>
<constraint firstItem="sp6-3a-dQq" firstAttribute="leading" secondItem="L26-Wm-cnn" secondAttribute="leading" constant="10" id="UFO-g8-D41"/> <constraint firstItem="sp6-3a-dQq" firstAttribute="leading" secondItem="L26-Wm-cnn" secondAttribute="leading" constant="10" id="UFO-g8-D41"/>
<constraint firstItem="sp6-3a-dQq" firstAttribute="top" secondItem="L26-Wm-cnn" secondAttribute="top" constant="10" id="bKQ-WH-PY3"/> <constraint firstItem="sp6-3a-dQq" firstAttribute="top" secondItem="L26-Wm-cnn" secondAttribute="top" constant="12" id="bKQ-WH-PY3"/>
<constraint firstAttribute="bottom" secondItem="Vv5-0g-G5Q" secondAttribute="bottom" constant="10" id="nrz-b5-f8X"/> <constraint firstAttribute="bottom" secondItem="Vv5-0g-G5Q" secondAttribute="bottom" constant="10" id="nrz-b5-f8X"/>
<constraint firstAttribute="trailing" secondItem="Vv5-0g-G5Q" secondAttribute="trailing" constant="15" id="ryz-b0-dep"/> <constraint firstAttribute="trailing" secondItem="Vv5-0g-G5Q" secondAttribute="trailing" constant="15" id="ryz-b0-dep"/>
</constraints> </constraints>
......
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