|
@@ -7,14 +7,15 @@
|
|
|
//
|
|
|
|
|
|
import UIKit
|
|
|
+import RxSwift
|
|
|
+import IQKeyboardManagerSwift
|
|
|
|
|
|
class OrderApplyRefundNoteInfoCell: UITableViewCell {
|
|
|
|
|
|
- var orderModel: OrderModel? {
|
|
|
- didSet {
|
|
|
- noteLabel.text = orderModel?.remark
|
|
|
- }
|
|
|
- }
|
|
|
+ let disposeBag = DisposeBag()
|
|
|
+
|
|
|
+ typealias NoteTextViewClosure = (_ text: String) -> Void
|
|
|
+ var noteTextViewClosure : NoteTextViewClosure?
|
|
|
|
|
|
class func cellWith(tableView:UITableView,indexPath:IndexPath) -> OrderApplyRefundNoteInfoCell {
|
|
|
let ID = "OrderApplyRefundNoteInfoCell"
|
|
@@ -43,7 +44,7 @@ class OrderApplyRefundNoteInfoCell: UITableViewCell {
|
|
|
private func setupViews() {
|
|
|
self.selectionStyle = .none
|
|
|
addSubview(titleLabel)
|
|
|
- addSubview(noteLabel)
|
|
|
+ addSubview(noteTextView)
|
|
|
}
|
|
|
|
|
|
private func setupLayouts() {
|
|
@@ -52,9 +53,10 @@ class OrderApplyRefundNoteInfoCell: UITableViewCell {
|
|
|
make.width.equalTo(56)
|
|
|
make.height.equalTo(20)
|
|
|
}
|
|
|
- noteLabel.snp.makeConstraints { (make) in
|
|
|
+ noteTextView.snp.remakeConstraints { (make) in
|
|
|
make.top.equalTo(14)
|
|
|
make.left.equalTo(titleLabel.snp_right).offset(20)
|
|
|
+ make.right.equalToSuperview().offset(-14)
|
|
|
make.bottom.right.equalTo(-14)
|
|
|
make.height.greaterThanOrEqualTo(20)
|
|
|
}
|
|
@@ -68,13 +70,23 @@ class OrderApplyRefundNoteInfoCell: UITableViewCell {
|
|
|
return titleLabel
|
|
|
}()
|
|
|
|
|
|
- lazy var noteLabel: UILabel = {
|
|
|
- let noteLabel = UILabel()
|
|
|
- noteLabel.textColor = k999999Color
|
|
|
- noteLabel.font = kRegularFont14
|
|
|
- noteLabel.text = "对于做移动端开发而言,算法,数据结构似乎只用于面试装B用,数据的查找,排序,增加,删除,如果一个for循环不能解决,那么再嵌套一层循环"
|
|
|
- noteLabel.numberOfLines = 0
|
|
|
- return noteLabel
|
|
|
+ lazy var noteTextView: IQTextView = {
|
|
|
+ let noteTextView = IQTextView()
|
|
|
+ noteTextView.backgroundColor = kffffffColor
|
|
|
+ noteTextView.textColor = k999999Color
|
|
|
+ noteTextView.font = kRegularFont14
|
|
|
+ noteTextView.placeholder = "输入备注信息..."
|
|
|
+ noteTextView.placeholderTextColor = k999999Color
|
|
|
+ noteTextView.rx.text.orEmpty.changed.subscribe(onNext: {
|
|
|
+ [weak self] (text) in
|
|
|
+
|
|
|
+ self?.noteTextView.text = String(text.prefix(150)) as String
|
|
|
+
|
|
|
+ if let noteTextViewClosure = self?.noteTextViewClosure {
|
|
|
+ noteTextViewClosure(self?.noteTextView.text ?? "")
|
|
|
+ }
|
|
|
+ }).disposed(by: disposeBag)
|
|
|
+ return noteTextView
|
|
|
}()
|
|
|
|
|
|
}
|