Commit 7a5a11ac authored by lujunye's avatar lujunye

收到发发生

parent 08380a7b
...@@ -24,7 +24,6 @@ class XiaYunDanViewController: BaseViewController,UITableViewDelegate,UITableVie ...@@ -24,7 +24,6 @@ class XiaYunDanViewController: BaseViewController,UITableViewDelegate,UITableVie
pph_send_arr.insert(adrData, at: idx) pph_send_arr.insert(adrData, at: idx)
pph_send_arr.remove(at: idx + 1) pph_send_arr.remove(at: idx + 1)
} }
// pph_listView.reloadSections([1], with: .none)
}else{ }else{
if pph_receive_arr.count == 0 { if pph_receive_arr.count == 0 {
pph_receive_arr.append(adrData) pph_receive_arr.append(adrData)
...@@ -32,7 +31,6 @@ class XiaYunDanViewController: BaseViewController,UITableViewDelegate,UITableVie ...@@ -32,7 +31,6 @@ class XiaYunDanViewController: BaseViewController,UITableViewDelegate,UITableVie
pph_receive_arr.insert(adrData, at: idx) pph_receive_arr.insert(adrData, at: idx)
pph_receive_arr.remove(at: idx + 1) pph_receive_arr.remove(at: idx + 1)
} }
// pph_listView.reloadSections([2], with: .none)
} }
pph_listView.reloadData() pph_listView.reloadData()
} }
...@@ -1725,17 +1723,23 @@ class XiaYunDanViewController: BaseViewController,UITableViewDelegate,UITableVie ...@@ -1725,17 +1723,23 @@ class XiaYunDanViewController: BaseViewController,UITableViewDelegate,UITableVie
view.delegate = self view.delegate = self
self.view.addSubview(view) self.view.addSubview(view)
} }
if indexPath.section == 1 && pph_send_arr.count == 0 { if indexPath.section == 1 {
let vc = P_P_H_Adr_VC() let vc = P_P_H_Adr_VC()
vc.isSend = true vc.isSend = true
vc.delegate = self vc.delegate = self
vc.idx = indexPath.row vc.idx = indexPath.row
if pph_send_arr.count != 0 {
vc.adrInfo = pph_send_arr[indexPath.row]
}
self.navigationController?.pushViewController(vc, animated: true) self.navigationController?.pushViewController(vc, animated: true)
} }
if indexPath.section == 2 && pph_receive_arr.count == 0 { if indexPath.section == 2 {
let vc = P_P_H_Adr_VC() let vc = P_P_H_Adr_VC()
vc.delegate = self vc.delegate = self
vc.idx = indexPath.row vc.idx = indexPath.row
if pph_receive_arr.count != 0 {
vc.adrInfo = pph_receive_arr[indexPath.row]
}
self.navigationController?.pushViewController(vc, animated: true) self.navigationController?.pushViewController(vc, animated: true)
} }
return return
......
...@@ -33,24 +33,31 @@ class SJMapViewController: UIViewController,NavBarViewDelegate,AMapLocationManag ...@@ -33,24 +33,31 @@ class SJMapViewController: UIViewController,NavBarViewDelegate,AMapLocationManag
var searchV : SearchBarView? = nil var searchV : SearchBarView? = nil
var listView:UITableView? = nil var listView:UITableView? = nil
override func viewWillAppear(_ animated: Bool) { override func viewWillAppear(_ animated: Bool) {
self.navigationController?.navigationBar.isHidden = true self.navigationController?.navigationBar.isHidden = true
IQKeyboardManager.shared.shouldPlayInputClicks = true IQKeyboardManager.shared.shouldPlayInputClicks = true
IQKeyboardManager.shared.enable = true IQKeyboardManager.shared.enable = true
IQKeyboardManager.shared.shouldResignOnTouchOutside = true IQKeyboardManager.shared.shouldResignOnTouchOutside = true
} }
var isFirst = false
func locationManager(_ manager: CLLocationManager, didUpdateLocations locations: [CLLocation]) { func locationManager(_ manager: CLLocationManager, didUpdateLocations locations: [CLLocation]) {
manger.stopUpdatingLocation() manger.stopUpdatingLocation()
if isFirst {
isFirst = false
print("have data")
initMapView(lat: lat, lng: lng)
initSearch()
}else{
print("no data")
let location = locations.last let location = locations.last
lat = location?.coordinate.latitude as! CLLocationDegrees lat = location?.coordinate.latitude as! CLLocationDegrees
lng = location?.coordinate.longitude as! CLLocationDegrees lng = location?.coordinate.longitude as! CLLocationDegrees
let coo = JZLocationConverter.wgs84(toGcj02: CLLocationCoordinate2D(latitude: lat, longitude: lng)) let coo = JZLocationConverter.wgs84(toGcj02: CLLocationCoordinate2D(latitude: lat, longitude: lng))
initMapView(lat: coo.latitude, lng: coo.longitude) initMapView(lat: coo.latitude, lng: coo.longitude)
initSearch() initSearch()
// initUI() }
} }
func backAction() { func backAction() {
self.navigationController?.popViewController(animated: true) self.navigationController?.popViewController(animated: true)
...@@ -88,6 +95,8 @@ class SJMapViewController: UIViewController,NavBarViewDelegate,AMapLocationManag ...@@ -88,6 +95,8 @@ class SJMapViewController: UIViewController,NavBarViewDelegate,AMapLocationManag
manger.startUpdatingLocation() manger.startUpdatingLocation()
manger.requestAlwaysAuthorization() manger.requestAlwaysAuthorization()
NotificationCenter.default.addObserver(self, selector: #selector(keyboardShow(note:)), name:UIResponder.keyboardWillShowNotification,object: nil) NotificationCenter.default.addObserver(self, selector: #selector(keyboardShow(note:)), name:UIResponder.keyboardWillShowNotification,object: nil)
// 监听键盘隐藏通知 // 监听键盘隐藏通知
NotificationCenter.default.addObserver(self,selector: #selector(keyboardHidden(note:)), NotificationCenter.default.addObserver(self,selector: #selector(keyboardHidden(note:)),
......
...@@ -8,16 +8,28 @@ ...@@ -8,16 +8,28 @@
import UIKit import UIKit
import SwiftyJSON import SwiftyJSON
import LGButton
protocol P_P_H_Adr_VC_Delegate { protocol P_P_H_Adr_VC_Delegate {
func P_P_H_Adr_VC_Data(adrData:addPinPinOrder_adrInfo,isSend:Bool,idx:Int) func P_P_H_Adr_VC_Data(adrData:addPinPinOrder_adrInfo,isSend:Bool,idx:Int)
} }
class P_P_H_Adr_VC: BaseViewController,SJMapViewControllerDelegate, UIPickerViewDataSource, UIPickerViewDelegate,UITextViewDelegate { class P_P_H_Adr_VC: BaseViewController,SJMapViewControllerDelegate, UIPickerViewDataSource, UIPickerViewDelegate,UITextViewDelegate {
@IBOutlet weak var submit_btn: LGButton!
var isSend = false var isSend = false
var idx = 0 var idx = 0
var delegate:P_P_H_Adr_VC_Delegate? var delegate:P_P_H_Adr_VC_Delegate?
var adrInfo:addPinPinOrder_adrInfo? var lat:Double = 0
var lng:Double = 0
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!
...@@ -35,6 +47,9 @@ class P_P_H_Adr_VC: BaseViewController,SJMapViewControllerDelegate, UIPickerView ...@@ -35,6 +47,9 @@ class P_P_H_Adr_VC: BaseViewController,SJMapViewControllerDelegate, UIPickerView
var loc = "" 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: "-")
self.lng = (ar.last as! NSString).doubleValue
self.lat = (ar.first as! NSString).doubleValue
self.loc = loc 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 {
...@@ -97,6 +112,11 @@ class P_P_H_Adr_VC: BaseViewController,SJMapViewControllerDelegate, UIPickerView ...@@ -97,6 +112,11 @@ class P_P_H_Adr_VC: BaseViewController,SJMapViewControllerDelegate, UIPickerView
adrTf.resignFirstResponder() adrTf.resignFirstResponder()
let vc = SJMapViewController() let vc = SJMapViewController()
vc.delegate = self vc.delegate = self
if lat != 0 {
vc.isFirst = true
vc.lat = lat
vc.lng = lng
}
self.navigationController?.pushViewController(vc, animated: true) self.navigationController?.pushViewController(vc, animated: true)
} }
...@@ -138,6 +158,11 @@ class P_P_H_Adr_VC: BaseViewController,SJMapViewControllerDelegate, UIPickerView ...@@ -138,6 +158,11 @@ class P_P_H_Adr_VC: BaseViewController,SJMapViewControllerDelegate, UIPickerView
} }
func textViewDidChange(_ textView: UITextView) { func textViewDidChange(_ textView: UITextView) {
if textView.text.count != 0 {
holder_lbl.isHidden = true
}else{
holder_lbl.isHidden = false
}
if textView.text.count > 200 { if textView.text.count > 200 {
if let str = textView.text { if let str = textView.text {
let subStr = str.prefix(200) let subStr = str.prefix(200)
...@@ -167,66 +192,20 @@ class P_P_H_Adr_VC: BaseViewController,SJMapViewControllerDelegate, UIPickerView ...@@ -167,66 +192,20 @@ class P_P_H_Adr_VC: BaseViewController,SJMapViewControllerDelegate, UIPickerView
btmView = nil btmView = nil
bgBtn = nil bgBtn = nil
} }
@IBAction func adr_select_action(_ sender: UIButton) {
let vc = SJMapViewController() @IBOutlet weak var holder_lbl: UILabel!
vc.delegate = self
self.navigationController?.pushViewController(vc, animated: true)
// if bgBtn == nil {
// let btn = UIButton()
// self.view.addSubview(btn)
// btn.backgroundColor = UIColor.black
// btn.alpha = 0.4
// btn.addTarget(self, action: #selector(closeAction(sender:)), for: .touchUpInside)
// btn.snp.makeConstraints { (make) in
// make.top.right.bottom.left.equalTo(0)
// }
// bgBtn = btn
// }
// if btmView == nil {
// let view = UIView()
// view.backgroundColor = UIColor.white
// btmView = view
// self.view.addSubview(btmView!)
// btmView!.snp.makeConstraints { (make) in
// make.left.bottom.right.equalTo(0)
// make.height.equalTo(230)
// }
// showAreaSelect(view:btmView!)
//
// let rightBtn = UIButton()
// rightBtn.setTitle("确定", for: .normal)
// rightBtn.setTitleColor(UIColor(named: "蓝色字体颜色"), for: .normal)
// rightBtn.titleLabel?.font = UIFont.systemFont(ofSize: 15)
// rightBtn.addTarget(self, action: #selector(adrSelectFinish(sender:)), for: .touchUpInside)
// btmView?.addSubview(rightBtn)
// rightBtn.snp.makeConstraints { (make) in
// make.right.equalTo(-15)
// make.top.equalTo(0)
// make.height.equalTo(30)
// make.width.equalTo(50)
// }
//
// let leftBtn = UIButton()
// leftBtn.setTitle("取消", for: .normal)
// leftBtn.setTitleColor(UIColor(named: "多选按钮字体颜色"), for: .normal)
// leftBtn.titleLabel?.font = UIFont.systemFont(ofSize: 15)
// leftBtn.addTarget(self, action: #selector(closeAction(sender:)), for: .touchUpInside)
// btmView?.addSubview(leftBtn)
// leftBtn.snp.makeConstraints { (make) in
// make.left.equalTo(15)
// make.top.equalTo(0)
// make.height.equalTo(30)
// make.width.equalTo(50)
// }
// }
}
func checkInfo(){ func checkInfo(){
if adrTf.text?.count != 0 && phoneTf.text?.count != 0 && nameTf.text?.count != 0 && city_lbl.text != "请选择城市" {
submit_btn.isUserInteractionEnabled = true
submit_btn.alpha = 1
}else{
submit_btn.isUserInteractionEnabled = false
submit_btn.alpha = 0.5
}
if adrTf.text?.count != 0 || phoneTf.text?.count != 0 || nameTf.text?.count != 0 || textTV.text.count != 0 || city_lbl.text != "请选择城市" { if adrTf.text?.count != 0 || phoneTf.text?.count != 0 || nameTf.text?.count != 0 || textTV.text.count != 0 || city_lbl.text != "请选择城市" {
clearBtn.isUserInteractionEnabled = true clearBtn.isUserInteractionEnabled = true
clearBtn.alpha = 1 clearBtn.alpha = 1
}else{ }else{
print("abc === ")
clearBtn.isUserInteractionEnabled = false clearBtn.isUserInteractionEnabled = false
clearBtn.alpha = 0.5 clearBtn.alpha = 0.5
} }
......
...@@ -16,8 +16,10 @@ ...@@ -16,8 +16,10 @@
<outlet property="city_lbl" destination="qSB-h2-bQB" id="IgF-C6-mjv"/> <outlet property="city_lbl" destination="qSB-h2-bQB" id="IgF-C6-mjv"/>
<outlet property="clearBtn" destination="Sya-Y4-SHc" id="U7f-h0-3kb"/> <outlet property="clearBtn" destination="Sya-Y4-SHc" id="U7f-h0-3kb"/>
<outlet property="count_lbl" destination="Vv5-0g-G5Q" id="j8d-11-Hua"/> <outlet property="count_lbl" destination="Vv5-0g-G5Q" id="j8d-11-Hua"/>
<outlet property="holder_lbl" destination="sp6-3a-dQq" id="8Xt-Bw-J4Q"/>
<outlet property="nameTf" destination="K6G-YC-k50" id="hRS-18-XCj"/> <outlet property="nameTf" destination="K6G-YC-k50" id="hRS-18-XCj"/>
<outlet property="phoneTf" destination="Xw0-ZF-SNA" id="2aS-a6-39Z"/> <outlet property="phoneTf" destination="Xw0-ZF-SNA" id="2aS-a6-39Z"/>
<outlet property="submit_btn" destination="fEM-0H-CMj" id="47G-R2-kvZ"/>
<outlet property="textTV" destination="SOk-O6-8QU" id="7Cb-eJ-PdP"/> <outlet property="textTV" destination="SOk-O6-8QU" id="7Cb-eJ-PdP"/>
<outlet property="top_view" destination="Hje-Lv-QT9" id="Oan-uX-vYR"/> <outlet property="top_view" destination="Hje-Lv-QT9" id="Oan-uX-vYR"/>
<outlet property="view" destination="i5M-Pr-FkT" id="sfx-zR-JGt"/> <outlet property="view" destination="i5M-Pr-FkT" id="sfx-zR-JGt"/>
...@@ -334,6 +336,12 @@ ...@@ -334,6 +336,12 @@
<color key="textColor" name="#999999"/> <color key="textColor" name="#999999"/>
<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">
<rect key="frame" x="10" y="10" width="65" height="19"/>
<fontDescription key="fontDescription" name="PingFangSC-Regular" family="PingFang SC" pointSize="13"/>
<color key="textColor" name="9A9A9A"/>
<nil key="highlightedColor"/>
</label>
</subviews> </subviews>
<color key="backgroundColor" name="app底色"/> <color key="backgroundColor" name="app底色"/>
<constraints> <constraints>
...@@ -341,6 +349,8 @@ ...@@ -341,6 +349,8 @@
<constraint firstAttribute="trailing" secondItem="SOk-O6-8QU" secondAttribute="trailing" constant="5" id="Dls-aX-kjm"/> <constraint firstAttribute="trailing" secondItem="SOk-O6-8QU" secondAttribute="trailing" constant="5" id="Dls-aX-kjm"/>
<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="top" secondItem="L26-Wm-cnn" secondAttribute="top" constant="10" 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>
...@@ -432,6 +442,9 @@ ...@@ -432,6 +442,9 @@
<namedColor name="#F57575"> <namedColor name="#F57575">
<color red="0.96100002527236938" green="0.45899999141693115" blue="0.45899999141693115" alpha="1" colorSpace="custom" customColorSpace="sRGB"/> <color red="0.96100002527236938" green="0.45899999141693115" blue="0.45899999141693115" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
</namedColor> </namedColor>
<namedColor name="9A9A9A">
<color red="0.60392156862745094" green="0.60392156862745094" blue="0.60392156862745094" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
</namedColor>
<namedColor name="app底色"> <namedColor name="app底色">
<color red="0.94509803921568625" green="0.94509803921568625" blue="0.94509803921568625" alpha="1" colorSpace="custom" customColorSpace="sRGB"/> <color red="0.94509803921568625" green="0.94509803921568625" blue="0.94509803921568625" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
</namedColor> </namedColor>
......
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