|
@@ -20,6 +20,12 @@ class CommonPayView: FWPopupView {
|
|
|
|
|
|
let disposeBag = DisposeBag()
|
|
let disposeBag = DisposeBag()
|
|
|
|
|
|
|
|
+ typealias DismissTransBlock = () -> Void
|
|
|
|
+ var disTransBlock : DismissTransBlock?
|
|
|
|
+
|
|
|
|
+ typealias ConfirmPayBlock = (_ pType: PayType) -> Void
|
|
|
|
+ var confirmPayBlock : ConfirmPayBlock?
|
|
|
|
+
|
|
var curPayType : PayType = PayType.wechatPay
|
|
var curPayType : PayType = PayType.wechatPay
|
|
|
|
|
|
override init(frame: CGRect) {
|
|
override init(frame: CGRect) {
|
|
@@ -67,8 +73,9 @@ class CommonPayView: FWPopupView {
|
|
confirmPayBtn.setTitleColor(kffffffColor, for: UIControl.State.normal)
|
|
confirmPayBtn.setTitleColor(kffffffColor, for: UIControl.State.normal)
|
|
confirmPayBtn.titleLabel?.font = kScaleRegularFont16
|
|
confirmPayBtn.titleLabel?.font = kScaleRegularFont16
|
|
confirmPayBtn.rx.tap.subscribe(onNext: { [weak self] (data) in
|
|
confirmPayBtn.rx.tap.subscribe(onNext: { [weak self] (data) in
|
|
-
|
|
|
|
- print("点击--确认支付")
|
|
|
|
|
|
+ if let confirmPayBlock = self?.confirmPayBlock {
|
|
|
|
+ confirmPayBlock(self!.curPayType)
|
|
|
|
+ }
|
|
}).disposed(by: disposeBag)
|
|
}).disposed(by: disposeBag)
|
|
return confirmPayBtn
|
|
return confirmPayBtn
|
|
}()
|
|
}()
|
|
@@ -133,6 +140,12 @@ extension CommonPayView : UITableViewDelegate, UITableViewDataSource {
|
|
func tableView(_ tableView: UITableView, viewForHeaderInSection section: Int) -> UIView? {
|
|
func tableView(_ tableView: UITableView, viewForHeaderInSection section: Int) -> UIView? {
|
|
let headerView = CommonPayHeader(frame: CGRect(x: 0, y: 0, width: kScreenWidth, height: 50))
|
|
let headerView = CommonPayHeader(frame: CGRect(x: 0, y: 0, width: kScreenWidth, height: 50))
|
|
headerView.payAmount = 155
|
|
headerView.payAmount = 155
|
|
|
|
+ headerView.dismissBlock = {
|
|
|
|
+ [weak self] in
|
|
|
|
+ if let disTransBlock = self?.disTransBlock {
|
|
|
|
+ disTransBlock()
|
|
|
|
+ }
|
|
|
|
+ }
|
|
return headerView
|
|
return headerView
|
|
}
|
|
}
|
|
|
|
|