Commit 6050dcbe authored by lujunye's avatar lujunye

修改增值服务装车,卸车可多选

parent 030e2ce0
......@@ -17,6 +17,7 @@ class ZengZhiServicesViewController: BaseViewController,UITableViewDelegate,UITa
//MARK: - 数据汇总提交
@IBAction func submitAction(_ sender: Any) {
print("submit")
print("装车\(ZhuangChe),卸车\(XieChe)")
if price.count == 0 {
HUD.flash(.label("请输入保价金额"), delay: 1.2)
return
......@@ -29,7 +30,7 @@ class ZengZhiServicesViewController: BaseViewController,UITableViewDelegate,UITa
}
delegate?.ZengZhiServicesViewControllerFinish(price:str.floatValue, content: commend)
self.navigationController?.popViewController(animated: true)
}
......@@ -50,32 +51,29 @@ class ZengZhiServicesViewController: BaseViewController,UITableViewDelegate,UITa
@IBOutlet weak var rightB: UIButton!
@IBOutlet weak var leftB: UIButton!
//MARK: - 额外服务:2装车 1卸车 0不选
var selectNum = 0
var ZhuangChe = 0
var XieChe = 0
@IBAction func logistActionSelect(_ sender: UIButton) {
if sender.tag == 1 {
if leftB.isSelected == false {
leftB.isSelected = true
selectNum = 2
}else{
if leftB.isSelected {
leftB.isSelected = false
ZhuangChe = 0
}else{
leftB.isSelected = true
ZhuangChe = 1
}
rightB.isSelected = false
}else{
if rightB.isSelected == false {
rightB.isSelected = true
selectNum = 1
}else{
if rightB.isSelected {
rightB.isSelected = false
XieChe = 0
}else{
rightB.isSelected = true
XieChe = 1
}
leftB.isSelected = false
}
if rightB.isSelected == false && leftB.isSelected == false {
selectNum = 0
}
print(selectNum)
}
var selectIdx:Int?
var fanHuanIdx = 0
var price:String = ""
......@@ -97,7 +95,7 @@ class ZengZhiServicesViewController: BaseViewController,UITableViewDelegate,UITa
textView.text = commend
if commend.count > 0 {
textViewHolderLbl.isHidden = true
}
inputTF.addTarget(self, action: #selector(textViewEdit(sender:)), for: .allEditingEvents)
inputTF.text = price
......@@ -153,7 +151,7 @@ class ZengZhiServicesViewController: BaseViewController,UITableViewDelegate,UITa
return cell
}
func textViewDidChange(_ textView: UITextView) {
if textView.text.count != 0 {
textViewHolderLbl.isHidden = true
}else{
......@@ -165,7 +163,7 @@ class ZengZhiServicesViewController: BaseViewController,UITableViewDelegate,UITa
}
}
commend = textView.text
}
func textView(_ textView: UITextView, shouldChangeTextIn range: NSRange, replacementText text: String) -> Bool {
countingLbl.text = "\(textView.text.count)/50"
......@@ -202,27 +200,27 @@ class ZengZhiServicesViewController: BaseViewController,UITableViewDelegate,UITa
func nSet(){
pBtn.backgroundColor = UIColor.clear
pBtn.isSelected = false
pBtn.layer.borderWidth = 1
eBtn.backgroundColor = UIColor.clear
eBtn.isSelected = false
eBtn.layer.borderWidth = 1
nBtn.isSelected = true
nBtn.backgroundColor = UIColor(named: "蓝色字体颜色")
nBtn.layer.borderWidth = 0
pBtn.isSelected = false
pBtn.layer.borderWidth = 1
eBtn.backgroundColor = UIColor.clear
eBtn.isSelected = false
eBtn.layer.borderWidth = 1
nBtn.isSelected = true
nBtn.backgroundColor = UIColor(named: "蓝色字体颜色")
nBtn.layer.borderWidth = 0
}
func pSet(){
nBtn.backgroundColor = UIColor.clear
nBtn.isSelected = false
nBtn.layer.borderWidth = 1
eBtn.backgroundColor = UIColor.clear
eBtn.isSelected = false
eBtn.layer.borderWidth = 1
pBtn.isSelected = true
pBtn.backgroundColor = UIColor(named: "蓝色字体颜色")
pBtn.layer.borderWidth = 0
nBtn.isSelected = false
nBtn.layer.borderWidth = 1
eBtn.backgroundColor = UIColor.clear
eBtn.isSelected = false
eBtn.layer.borderWidth = 1
pBtn.isSelected = true
pBtn.backgroundColor = UIColor(named: "蓝色字体颜色")
pBtn.layer.borderWidth = 0
}
func eSet(){
nBtn.backgroundColor = UIColor.clear
......@@ -244,7 +242,7 @@ class ZengZhiServicesViewController: BaseViewController,UITableViewDelegate,UITa
nBtn.backgroundColor = UIColor.clear
nBtn.layer.borderWidth = 1
}else{
nSet()
nSet()
}
}
if sender == pBtn {
......@@ -253,7 +251,7 @@ class ZengZhiServicesViewController: BaseViewController,UITableViewDelegate,UITa
pBtn.backgroundColor = UIColor.clear
pBtn.layer.borderWidth = 1
}else{
pSet()
pSet()
}
}
if sender == eBtn{
......
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