Commit 0d81c224 authored by 刘俊宏's avatar 刘俊宏

取消货拉拉运单原因Vc修正

parent b636f122
...@@ -488,6 +488,7 @@ class orderCancelReasonDataModel: Mappable { ...@@ -488,6 +488,7 @@ class orderCancelReasonDataModel: Mappable {
var id:Int? var id:Int?
var category:String? //分类名称;示例:自己原因 var category:String? //分类名称;示例:自己原因
var sub_cat:Array<orderCancelReasonSubCatDataModel>? var sub_cat:Array<orderCancelReasonSubCatDataModel>?
var isShow:Bool = false
required init?( map: Map) { required init?( map: Map) {
......
<?xml version="1.0" encoding="UTF-8"?> <?xml version="1.0" encoding="UTF-8"?>
<document type="com.apple.InterfaceBuilder3.CocoaTouch.XIB" version="3.0" toolsVersion="16096" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" useSafeAreas="YES" colorMatched="YES"> <document type="com.apple.InterfaceBuilder3.CocoaTouch.XIB" version="3.0" toolsVersion="16097" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" useSafeAreas="YES" colorMatched="YES">
<device id="retina6_1" orientation="portrait" appearance="light"/> <device id="retina6_1" orientation="portrait" appearance="light"/>
<dependencies> <dependencies>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="16086"/> <deployment identifier="iOS"/>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="16087"/>
<capability name="Named colors" minToolsVersion="9.0"/> <capability name="Named colors" minToolsVersion="9.0"/>
<capability name="Safe area layout guides" minToolsVersion="9.0"/> <capability name="Safe area layout guides" minToolsVersion="9.0"/>
<capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/> <capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
...@@ -10,7 +11,7 @@ ...@@ -10,7 +11,7 @@
<objects> <objects>
<placeholder placeholderIdentifier="IBFilesOwner" id="-1" userLabel="File's Owner"/> <placeholder placeholderIdentifier="IBFilesOwner" id="-1" userLabel="File's Owner"/>
<placeholder placeholderIdentifier="IBFirstResponder" id="-2" customClass="UIResponder"/> <placeholder placeholderIdentifier="IBFirstResponder" id="-2" customClass="UIResponder"/>
<tableViewCell contentMode="scaleToFill" selectionStyle="default" indentationWidth="10" id="KGk-i7-Jjw" customClass="SecondCell" customModule="GeliBusinessPlatform" customModuleProvider="target"> <tableViewCell contentMode="scaleToFill" selectionStyle="default" indentationWidth="10" id="KGk-i7-Jjw" customClass="SecondCell" customModule="TestClass" customModuleProvider="target">
<rect key="frame" x="0.0" y="0.0" width="375" height="49"/> <rect key="frame" x="0.0" y="0.0" width="375" height="49"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/> <autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
<tableViewCellContentView key="contentView" opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center" tableViewCell="KGk-i7-Jjw" id="H2p-sc-9uM"> <tableViewCellContentView key="contentView" opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center" tableViewCell="KGk-i7-Jjw" id="H2p-sc-9uM">
......
...@@ -61,26 +61,29 @@ class HuolalaCancelViewController: BaseViewController ,UITableViewDelegate,UITab ...@@ -61,26 +61,29 @@ class HuolalaCancelViewController: BaseViewController ,UITableViewDelegate,UITab
return reasonArr.count return reasonArr.count
} }
func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -> Int { func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -> Int {
let sectionModel = reasonArr[section] let sectionModel = reasonArr[section]
if reasonArr.count == 1 {
return sectionModel.sub_cat!.count
}
if sectionModel.isShow {
return sectionModel.sub_cat!.count
}else{
return 0
}
return sectionModel.sub_cat!.count
} }
func tableView(_ tableView: UITableView, heightForRowAt indexPath: IndexPath) -> CGFloat { func tableView(_ tableView: UITableView, heightForRowAt indexPath: IndexPath) -> CGFloat {
let sectionModel = reasonArr[indexPath.section] let sectionModel = reasonArr[indexPath.section]
let rowModel = sectionModel.sub_cat![indexPath.row] let rowModel = sectionModel.sub_cat![indexPath.row]
if rowModel.sub_name == "其他" || sectionModel.category == "其他"{ if rowModel.sub_name == "其他" || sectionModel.category == "其他"{
if reasonArr.count == 1 { if selectID == rowModel.sub_id {
if selectID == rowModel.sub_id { return 175
return 175 }else{
return 50
}else{
return 50
}
} }
return 50
} }
return 50 return 50
} }
...@@ -93,21 +96,18 @@ class HuolalaCancelViewController: BaseViewController ,UITableViewDelegate,UITab ...@@ -93,21 +96,18 @@ class HuolalaCancelViewController: BaseViewController ,UITableViewDelegate,UITab
if rowModel.sub_name == "其他" || sectionModel.category == "其他"{ if rowModel.sub_name == "其他" || sectionModel.category == "其他"{
let cell = tableView.dequeueReusableCell(withIdentifier: "OtherInfoTextViewTableViewCell") as! OtherInfoTextViewTableViewCell let cell = tableView.dequeueReusableCell(withIdentifier: "OtherInfoTextViewTableViewCell") as! OtherInfoTextViewTableViewCell
if reasonArr.count == 1 { if rowModel.sub_id == selectID {
if rowModel.sub_id == selectID { cell.iconImV.image = UIImage.init(named: "yuxuan")
cell.iconImV.image = UIImage.init(named: "yuxuan") cell.nameLbl.textColor = UIColor.init(named: "蓝色字体颜色")
cell.nameLbl.textColor = UIColor.init(named: "蓝色字体颜色") cell.textCountLbl.textColor = UIColor.init(named: "蓝色字体颜色")
cell.textCountLbl.textColor = UIColor.init(named: "蓝色字体颜色") cell.textViewBgV.isHidden = false
cell.textViewBgV.isHidden = false
}else{
cell.iconImV.image = UIImage.init(named: "daixuan")
cell.nameLbl.textColor = UIColor.init(named: "标题字颜色")
cell.textCountLbl.textColor = UIColor.init(named: "标题字颜色")
cell.textViewBgV.isHidden = true
}
}else{ }else{
cell.iconImV.image = UIImage.init(named: "daixuan")
cell.nameLbl.textColor = UIColor.init(named: "标题字颜色")
cell.textCountLbl.textColor = UIColor.init(named: "标题字颜色")
cell.textViewBgV.isHidden = true
} }
return cell return cell
} }
let cell = tableView.dequeueReusableCell(withIdentifier: "FirstCell") as! FirstCell let cell = tableView.dequeueReusableCell(withIdentifier: "FirstCell") as! FirstCell
...@@ -121,23 +121,91 @@ class HuolalaCancelViewController: BaseViewController ,UITableViewDelegate,UITab ...@@ -121,23 +121,91 @@ class HuolalaCancelViewController: BaseViewController ,UITableViewDelegate,UITab
cell.nameLbl.textColor = UIColor.init(named: "标题字颜色") cell.nameLbl.textColor = UIColor.init(named: "标题字颜色")
} }
}else{ }else{
let cellS = tableView.dequeueReusableCell(withIdentifier: "SecondCell") as! SecondCell
cellS.nameLbl.text = rowModel.sub_name
if rowModel.sub_id == selectID {
cellS.imgView.image = UIImage.init(named: "yuxuan")
cellS.nameLbl.textColor = UIColor.init(named: "蓝色字体颜色")
}else{
cellS.imgView.image = UIImage.init(named: "daixuan")
cellS.nameLbl.textColor = UIColor.init(named: "标题字颜色")
}
cellS.contentView.backgroundColor = UIColor.white
cellS.line.backgroundColor = UIColor.init(named: "灰色分界线")
return cellS
} }
return cell return cell
} }
func tableView(_ tableView: UITableView, didSelectRowAt indexPath: IndexPath) { func tableView(_ tableView: UITableView, didSelectRowAt indexPath: IndexPath) {
let sectionModel = reasonArr[indexPath.section] let sectionModel = reasonArr[indexPath.section]
let rowModel = sectionModel.sub_cat![indexPath.row] let rowModel = sectionModel.sub_cat![indexPath.row]
selectID = rowModel.sub_id!
reason_id = selectID
reason = rowModel.sub_name!
listView.reloadData()
bottomLbl.text = "确定"
}
func tableView(_ tableView: UITableView, viewForHeaderInSection section: Int) -> UIView? {
if reasonArr.count == 1 { if reasonArr.count == 1 {
selectID = rowModel.sub_id! return nil
reason_id = selectID }
reason = rowModel.sub_name! let model = reasonArr[section]
listView.reloadData() let view = UIView(frame: CGRect(x: 0, y: 0, width: fullScreenWidth, height: 50))
}else{
view.backgroundColor = UIColor.white
let nameLbl = UILabel()
nameLbl.textColor = UIColor.init(named: "标题字颜色")
nameLbl.font = UIFont.systemFont(ofSize: 13)
view.addSubview(nameLbl)
nameLbl.snp.makeConstraints { (make) in
make.centerY.equalToSuperview()
make.left.equalTo(15)
}
var img = UIImage.init(named: "3")
if model.isShow {
img = UIImage.init(named: "1")
}
let imgV = UIImageView.init(image: img)
view.addSubview(imgV)
imgV.snp.makeConstraints { (make) in
make.centerY.equalToSuperview()
make.right.equalTo(-15)
}
let line = UIView()
line.backgroundColor = UIColor.init(named: "灰色分界线")
view.addSubview(line)
line.snp.makeConstraints { (make) in
make.left.equalTo(15)
make.right.equalToSuperview()
make.bottom.equalToSuperview()
make.height.equalTo(1)
}
let showBtn = UIButton()
showBtn.tag = section
view.addSubview(showBtn)
showBtn.snp.makeConstraints { (make) in
make.left.right.top.bottom.equalToSuperview()
} }
bottomLbl.text = "确定"
showBtn.addTarget(self, action: #selector(headerShowBtnAction(sender:)), for: .touchUpInside)
nameLbl.text = model.category
return view
}
@objc func headerShowBtnAction(sender:UIButton) {
reasonArr[sender.tag].isShow = !reasonArr[sender.tag].isShow
listView.reloadData()
}
func tableView(_ tableView: UITableView, heightForHeaderInSection section: Int) -> CGFloat {
if reasonArr.count == 1 {
return 0.01
}
return 50
} }
//MARK:--取消货拉拉运单 //MARK:--取消货拉拉运单
func orderCancelOrder (){ func orderCancelOrder (){
......
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