Commit d6b1f678 authored by lujunye's avatar lujunye

完善修改价格界面逻辑

parent f8c7710e
...@@ -18,10 +18,13 @@ class TitleAndTfYuanCell: UITableViewCell,UITextFieldDelegate { ...@@ -18,10 +18,13 @@ class TitleAndTfYuanCell: UITableViewCell,UITextFieldDelegate {
override func awakeFromNib() { override func awakeFromNib() {
super.awakeFromNib() super.awakeFromNib()
self.selectionStyle = .none self.selectionStyle = .none
textTF.delegate = self
// Initialization code // Initialization code
} }
func textFieldDidEndEditing(_ textField: UITextField) { func textFieldDidEndEditing(_ textField: UITextField) {
if textField.text?.count == 0 {
textField.text = "0"
}
delegate?.TitleAndTfYuanCellGetData(price: textField.text!, idx: self.tag) delegate?.TitleAndTfYuanCellGetData(price: textField.text!, idx: self.tag)
} }
override func setSelected(_ selected: Bool, animated: Bool) { override func setSelected(_ selected: Bool, animated: Bool) {
......
...@@ -57,9 +57,6 @@ ...@@ -57,9 +57,6 @@
<real key="value" value="1"/> <real key="value" value="1"/>
</userDefinedRuntimeAttribute> </userDefinedRuntimeAttribute>
</userDefinedRuntimeAttributes> </userDefinedRuntimeAttributes>
<connections>
<outlet property="delegate" destination="-1" id="7h2-A8-F1h"/>
</connections>
</textField> </textField>
</subviews> </subviews>
<constraints> <constraints>
......
...@@ -23,6 +23,7 @@ class ChangeGoodsPriceVC: BaseViewController , UITableViewDelegate, UITableView ...@@ -23,6 +23,7 @@ class ChangeGoodsPriceVC: BaseViewController , UITableViewDelegate, UITableView
}else{ }else{
qtPrice = price qtPrice = price
} }
print("abc == ",wlPrice)
var total = Float(0) var total = Float(0)
dataArr?.forEach({ (item) in dataArr?.forEach({ (item) in
let price = item.goods_subtotal as! NSString let price = item.goods_subtotal as! NSString
...@@ -31,6 +32,7 @@ class ChangeGoodsPriceVC: BaseViewController , UITableViewDelegate, UITableView ...@@ -31,6 +32,7 @@ class ChangeGoodsPriceVC: BaseViewController , UITableViewDelegate, UITableView
let wl = wlPrice as NSString let wl = wlPrice as NSString
let qt = qtPrice as NSString let qt = qtPrice as NSString
btnTitle.text = "确定(合计¥\(total + wl.floatValue + qt.floatValue))" btnTitle.text = "确定(合计¥\(total + wl.floatValue + qt.floatValue))"
tableV.reloadData()
} }
var orderID:Int? = 0 var orderID:Int? = 0
...@@ -181,6 +183,7 @@ class ChangeGoodsPriceVC: BaseViewController , UITableViewDelegate, UITableView ...@@ -181,6 +183,7 @@ class ChangeGoodsPriceVC: BaseViewController , UITableViewDelegate, UITableView
func tableView(_ tableView: UITableView, viewForFooterInSection section: Int) -> UIView? { func tableView(_ tableView: UITableView, viewForFooterInSection section: Int) -> UIView? {
let view = UIView(frame: CGRect(x: 0, y: 0, width: fullScreenWidth, height: 5)) let view = UIView(frame: CGRect(x: 0, y: 0, width: fullScreenWidth, height: 5))
view.backgroundColor = UIColor(named: "app底色")
return view return view
} }
func tableView(_ tableView: UITableView, heightForFooterInSection section: Int) -> CGFloat { func tableView(_ tableView: UITableView, heightForFooterInSection section: Int) -> CGFloat {
......
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