Commit eaf854fe authored by lujunye's avatar lujunye

asdf;lasdf/.lasd;ksadf?

parent 9771b2dc
...@@ -9,9 +9,14 @@ ...@@ -9,9 +9,14 @@
import UIKit import UIKit
import SwiftyJSON import SwiftyJSON
class P_P_H_Adr_VC: BaseViewController,SJMapViewControllerDelegate, UIPickerViewDataSource, UIPickerViewDelegate { class P_P_H_Adr_VC: BaseViewController,SJMapViewControllerDelegate, UIPickerViewDataSource, UIPickerViewDelegate,UITextViewDelegate {
var dzStr = ""
var detailDzStr = "" @IBOutlet weak var count_lbl: UILabel!
@IBOutlet weak var textTV: UITextView!
@IBOutlet weak var phoneTf: UITextField!
@IBOutlet weak var adrTf: UITextField!
@IBOutlet weak var nameTf: UITextField!
var btmView:UIView? var btmView:UIView?
var bgBtn:UIButton? var bgBtn:UIButton?
//选择的省索引 //选择的省索引
...@@ -22,7 +27,7 @@ class P_P_H_Adr_VC: BaseViewController,SJMapViewControllerDelegate, UIPickerView ...@@ -22,7 +27,7 @@ class P_P_H_Adr_VC: BaseViewController,SJMapViewControllerDelegate, UIPickerView
var areaIndex = 0 var areaIndex = 0
func SJMapViewControllerSelectArd(adr: String, cityData: String) { func SJMapViewControllerSelectArd(adr: String, cityData: String) {
dzStr = cityData city_lbl.text = cityData
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>
...@@ -45,7 +50,7 @@ class P_P_H_Adr_VC: BaseViewController,SJMapViewControllerDelegate, UIPickerView ...@@ -45,7 +50,7 @@ class P_P_H_Adr_VC: BaseViewController,SJMapViewControllerDelegate, UIPickerView
} }
} }
detailDzStr = adr adrTf.text = adr
} }
...@@ -83,7 +88,7 @@ class P_P_H_Adr_VC: BaseViewController,SJMapViewControllerDelegate, UIPickerView ...@@ -83,7 +88,7 @@ class P_P_H_Adr_VC: BaseViewController,SJMapViewControllerDelegate, UIPickerView
} }
} }
dzStr = selectAdr
bgBtn?.removeFromSuperview() bgBtn?.removeFromSuperview()
btmView?.subviews.forEach({ (view) in btmView?.subviews.forEach({ (view) in
view.removeFromSuperview() view.removeFromSuperview()
...@@ -91,7 +96,20 @@ class P_P_H_Adr_VC: BaseViewController,SJMapViewControllerDelegate, UIPickerView ...@@ -91,7 +96,20 @@ 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
}
func textViewDidChange(_ textView: UITextView) {
if textView.text.count > 200 {
if let str = textView.text {
let subStr = str.prefix(200)
textView.text = String(subStr)
}
}
count_lbl.text = "\(textView.text.count)/200"
} }
@objc func closeAction(sender:UIButton){ @objc func closeAction(sender:UIButton){
bgBtn?.removeFromSuperview() bgBtn?.removeFromSuperview()
btmView?.subviews.forEach({ (view) in btmView?.subviews.forEach({ (view) in
...@@ -167,6 +185,8 @@ class P_P_H_Adr_VC: BaseViewController,SJMapViewControllerDelegate, UIPickerView ...@@ -167,6 +185,8 @@ class P_P_H_Adr_VC: BaseViewController,SJMapViewControllerDelegate, UIPickerView
} }
getIndex() getIndex()
textTV.delegate = self
} }
...@@ -187,7 +207,7 @@ class P_P_H_Adr_VC: BaseViewController,SJMapViewControllerDelegate, UIPickerView ...@@ -187,7 +207,7 @@ class P_P_H_Adr_VC: BaseViewController,SJMapViewControllerDelegate, UIPickerView
let citys = item["city_list"] as! Array<Dictionary<String,Any>> let citys = item["city_list"] as! Array<Dictionary<String,Any>>
if citys.count == 0 { if citys.count == 0 {
provinceIndex = i provinceIndex = i
dzStr = item["area_name"]! as! String city_lbl.text = item["area_name"]! as! String
} }
for j in 0 ..< citys.count { for j in 0 ..< citys.count {
let cItem = citys[j] let cItem = citys[j]
...@@ -195,7 +215,7 @@ class P_P_H_Adr_VC: BaseViewController,SJMapViewControllerDelegate, UIPickerView ...@@ -195,7 +215,7 @@ class P_P_H_Adr_VC: BaseViewController,SJMapViewControllerDelegate, UIPickerView
let districts = cItem["district_list"] as! Array<Dictionary<String,Any>> let districts = cItem["district_list"] as! Array<Dictionary<String,Any>>
if districts.count == 0 { if districts.count == 0 {
cityIndex = j cityIndex = j
dzStr = "\(item["area_name"]!)-\(cItem["area_name"]!)" city_lbl.text = "\(item["area_name"]!)-\(cItem["area_name"]!)"
} }
for k in 0 ..< districts.count{ for k in 0 ..< districts.count{
let dItem = districts[k] let dItem = districts[k]
...@@ -203,7 +223,7 @@ class P_P_H_Adr_VC: BaseViewController,SJMapViewControllerDelegate, UIPickerView ...@@ -203,7 +223,7 @@ class P_P_H_Adr_VC: BaseViewController,SJMapViewControllerDelegate, UIPickerView
provinceIndex = i provinceIndex = i
cityIndex = j cityIndex = j
areaIndex = k areaIndex = k
dzStr = "\(item["area_name"]!)-\(cItem["area_name"]!)-\(dItem["area_name"]!)" city_lbl.text = "\(item["area_name"]!)-\(cItem["area_name"]!)-\(dItem["area_name"]!)"
break break
} }
} }
......
...@@ -12,7 +12,12 @@ ...@@ -12,7 +12,12 @@
<objects> <objects>
<placeholder placeholderIdentifier="IBFilesOwner" id="-1" userLabel="File's Owner" customClass="P_P_H_Adr_VC" customModule="TestClass" customModuleProvider="target"> <placeholder placeholderIdentifier="IBFilesOwner" id="-1" userLabel="File's Owner" customClass="P_P_H_Adr_VC" customModule="TestClass" customModuleProvider="target">
<connections> <connections>
<outlet property="adrTf" destination="c79-WN-La1" id="lqQ-rc-8Ck"/>
<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="count_lbl" destination="Vv5-0g-G5Q" id="j8d-11-Hua"/>
<outlet property="nameTf" destination="K6G-YC-k50" id="hRS-18-XCj"/>
<outlet property="phoneTf" destination="Xw0-ZF-SNA" id="2aS-a6-39Z"/>
<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"/>
</connections> </connections>
...@@ -317,7 +322,30 @@ ...@@ -317,7 +322,30 @@
</label> </label>
<view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="L26-Wm-cnn"> <view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="L26-Wm-cnn">
<rect key="frame" x="10" y="60.5" width="364" height="142"/> <rect key="frame" x="10" y="60.5" width="364" height="142"/>
<subviews>
<textView clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="scaleToFill" textAlignment="natural" translatesAutoresizingMaskIntoConstraints="NO" id="SOk-O6-8QU">
<rect key="frame" x="5" y="5" width="354" height="132"/>
<color key="backgroundColor" white="0.0" alpha="0.0" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
<color key="textColor" name="标题字颜色"/>
<fontDescription key="fontDescription" type="system" pointSize="13"/>
<textInputTraits key="textInputTraits" autocapitalizationType="sentences"/>
</textView>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="0/200" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="Vv5-0g-G5Q">
<rect key="frame" x="317.5" y="118.5" width="31.5" height="13.5"/>
<fontDescription key="fontDescription" type="system" pointSize="11"/>
<color key="textColor" name="#999999"/>
<nil key="highlightedColor"/>
</label>
</subviews>
<color key="backgroundColor" name="app底色"/> <color key="backgroundColor" name="app底色"/>
<constraints>
<constraint firstItem="SOk-O6-8QU" firstAttribute="leading" secondItem="L26-Wm-cnn" secondAttribute="leading" constant="5" id="8hS-gR-NxS"/>
<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 firstItem="SOk-O6-8QU" firstAttribute="top" secondItem="L26-Wm-cnn" secondAttribute="top" constant="5" id="JJF-RO-7ia"/>
<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"/>
</constraints>
<userDefinedRuntimeAttributes> <userDefinedRuntimeAttributes>
<userDefinedRuntimeAttribute type="number" keyPath="cornerRadius"> <userDefinedRuntimeAttribute type="number" keyPath="cornerRadius">
<real key="value" value="8"/> <real key="value" value="8"/>
......
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