Commit 7bbe2bcb authored by Steven杜宇's avatar Steven杜宇

// 缴费

parent cfec4509
......@@ -432,6 +432,12 @@ extension YHResignAppointScheduleListViewController: UITableViewDelegate, UITabl
guard let self = self else { return }
self.clickConfirmHKButton(status: status, model)
}
cell.applyPaymentBlock = {
[weak self] in
guard let self = self else { return }
let vc = YHHKVisaRenewalApplicationVC(id: model.id, isEdit:model.is_edit)
self.navigationController?.pushViewController(vc)
}
cell.modifyBtn.isHidden = self.isHiddenModifyBtn
// 点击修改按钮
cell.modifyBtnBlock = {
......@@ -451,6 +457,13 @@ extension YHResignAppointScheduleListViewController: UITableViewDelegate, UITabl
guard let self = self else { return }
self.clickConfirmHKButton(status: status, model)
}
cell2.applyPaymentBlock = {
[weak self] in
guard let self = self else { return }
let vc = YHHKVisaRenewalApplicationVC(id: model.id, isEdit:model.is_edit)
self.navigationController?.pushViewController(vc)
}
let isShowCorner = (indexPath.row == scheduleArr.count-1)
cell2.showBottomCorner(isShowCorner)
return cell2
......
......@@ -40,6 +40,11 @@ class YHResignAppointGroup: SmartCodable {
var is_edit: Int = 0
// 自定义 第几批
var batchIndex: Int = 0
var apply_payment: Int = 0 // 0不需要缴费,1需要缴费
func isNeedPayment() -> Bool {
return apply_payment == 1
}
func getSubmitHKTime() -> String {
let format = "yyyy-MM-dd HH:mm"
......@@ -59,6 +64,8 @@ class YHResignAppointGroup: SmartCodable {
func getConfirmInHKStatus() -> YHResignConfirmHKStatus {
// test return .haveConfirmHK
let dateFormatter = DateFormatter()
dateFormatter.dateFormat = "yyyy-MM-dd HH:mm"
let nowDateString = dateFormatter.string(from: Date())
......
......@@ -11,6 +11,7 @@ import UIKit
class YHResignAppointedScheduleSingleItemView: UIView {
var clickConfirmBtnBlock: ((YHResignConfirmHKStatus)->())?
var applyPaymentBlock: (()->())?
var confirmHKStatus: YHResignConfirmHKStatus = .waitConfirmHK
......@@ -50,6 +51,17 @@ class YHResignAppointedScheduleSingleItemView: UIView {
return btn
}()
lazy var applyFeeBtn: UIButton = {
let btn = UIButton()
btn.layer.cornerRadius = 2.0
btn.backgroundColor = .brandMainColor
btn.setTitleColor(.white, for: .normal)
btn.setTitle("申请缴费", for: .normal)
btn.titleLabel?.font = .PFSC_M(ofSize: 11)
btn.addTarget(self, action: #selector(didApplyFeeBtnClicked), for: .touchUpInside)
return btn
}()
lazy var submitTimeLabel: UILabel = {
let label = UILabel()
label.numberOfLines = 0
......@@ -86,6 +98,10 @@ class YHResignAppointedScheduleSingleItemView: UIView {
clickConfirmBtnBlock?(self.confirmHKStatus)
}
@objc func didApplyFeeBtnClicked() {
applyPaymentBlock?()
}
func updateModel(_ model: YHResignAppointGroup) {
var names = "申请人:"
for (index, user) in model.user_list.enumerated() {
......@@ -110,6 +126,8 @@ class YHResignAppointedScheduleSingleItemView: UIView {
statusWidth = 68.0
} else if self.confirmHKStatus == .haveConfirmHK {
statusWidth = 65.0
let applyWidth = model.isNeedPayment() ? 68.0 : 0.0
statusWidth += applyWidth
}
applicantNamesLabel.snp.updateConstraints { make in
make.right.equalTo(-18-statusWidth-18)
......@@ -135,6 +153,17 @@ class YHResignAppointedScheduleSingleItemView: UIView {
confirmHKTimeLabel.isHidden = true
confirmHKTimeLabel.snp.removeConstraints()
applyFeeBtn.isHidden = !model.isNeedPayment()
haveConfirmInHKLabel.snp.remakeConstraints { make in
if model.isNeedPayment() {
make.right.equalTo(applyFeeBtn.snp.left).offset(-8)
} else {
make.right.equalTo(-18)
}
make.top.equalTo(lineView.snp.bottom).offset(18)
make.height.equalTo(18)
}
if self.confirmHKStatus == .haveConfirmHK { // 已确认在港 需要显示确认在港时间
confirmHKTimeLabel.isHidden = false
......@@ -172,6 +201,7 @@ class YHResignAppointedScheduleSingleItemView: UIView {
self.addSubview(lineView)
self.addSubview(applicantNamesLabel)
self.addSubview(confirmInHKBtn)
self.addSubview(applyFeeBtn)
self.addSubview(haveConfirmInHKLabel)
self.addSubview(submitTimeLabel)
self.addSubview(confirmHKTimeLabel)
......@@ -195,6 +225,13 @@ class YHResignAppointedScheduleSingleItemView: UIView {
make.top.equalTo(lineView.snp.bottom).offset(18)
}
applyFeeBtn.snp.makeConstraints { make in
make.right.equalTo(-18)
make.width.equalTo(68)
make.height.equalTo(28)
make.centerY.equalTo(haveConfirmInHKLabel)
}
haveConfirmInHKLabel.snp.makeConstraints { make in
make.right.equalTo(-18)
make.top.equalTo(lineView.snp.bottom).offset(18)
......
......@@ -14,6 +14,7 @@ class YHResignScheduleMultipleInfoCell: UITableViewCell {
var confirmHKStatus: YHResignConfirmHKStatus = .waitConfirmHK
var clickConfirmBtnBlock: ((YHResignConfirmHKStatus)->())?
var applyPaymentBlock: (()->())?
lazy var whiteCornerView: UIView = {
let view = UIView()
......@@ -62,6 +63,17 @@ class YHResignScheduleMultipleInfoCell: UITableViewCell {
return btn
}()
lazy var applyFeeBtn: UIButton = {
let btn = UIButton()
btn.layer.cornerRadius = 2.0
btn.backgroundColor = .brandMainColor
btn.setTitleColor(.white, for: .normal)
btn.setTitle("申请缴费", for: .normal)
btn.titleLabel?.font = .PFSC_M(ofSize: 11)
btn.addTarget(self, action: #selector(didApplyFeeBtnClicked), for: .touchUpInside)
return btn
}()
lazy var applicantNamesLabel: UILabel = {
let label = UILabel()
label.font = UIFont.PFSC_M(ofSize: 14)
......@@ -105,6 +117,10 @@ class YHResignScheduleMultipleInfoCell: UITableViewCell {
clickConfirmBtnBlock?(self.confirmHKStatus)
}
@objc func didApplyFeeBtnClicked() {
applyPaymentBlock?()
}
func updateModel(_ model: YHResignAppointGroup) {
var lineMargin = 0.0
......@@ -153,6 +169,17 @@ class YHResignScheduleMultipleInfoCell: UITableViewCell {
confirmHKTimeLabel.snp.removeConstraints()
confirmHKTimeLabel.isHidden = true
applyFeeBtn.isHidden = !model.isNeedPayment()
haveConfirmInHKLabel.snp.remakeConstraints { make in
if model.isNeedPayment() {
make.right.equalTo(applyFeeBtn.snp.left).offset(-8)
} else {
make.right.equalTo(-18)
}
make.centerY.equalTo(titleLabel)
make.height.equalTo(18)
}
if self.confirmHKStatus == .haveConfirmHK { // 已确认在港 需要显示确认在港时间
confirmHKTimeLabel.isHidden = false
......@@ -197,6 +224,7 @@ class YHResignScheduleMultipleInfoCell: UITableViewCell {
contentView.addSubview(markView)
contentView.addSubview(titleLabel)
contentView.addSubview(confirmInHKBtn)
contentView.addSubview(applyFeeBtn)
contentView.addSubview(haveConfirmInHKLabel)
contentView.addSubview(confirmHKTimeLabel)
contentView.addSubview(applicantNamesLabel)
......@@ -225,7 +253,6 @@ class YHResignScheduleMultipleInfoCell: UITableViewCell {
make.left.equalTo(markView.snp.right).offset(8)
make.height.equalTo(22)
make.top.equalTo(18)
}
confirmInHKBtn.snp.makeConstraints { make in
......@@ -235,6 +262,13 @@ class YHResignScheduleMultipleInfoCell: UITableViewCell {
make.top.equalTo(18)
}
applyFeeBtn.snp.makeConstraints { make in
make.right.equalTo(-18)
make.width.equalTo(68)
make.height.equalTo(28)
make.centerY.equalTo(haveConfirmInHKLabel)
}
haveConfirmInHKLabel.snp.makeConstraints { make in
make.right.equalTo(-18)
make.centerY.equalTo(titleLabel)
......
......@@ -19,6 +19,7 @@ class YHResignScheduleSingleInfoCell: UITableViewCell {
static let cellReuseIdentifier = "YHResignScheduleSingleInfoCell"
var clickConfirmBtnBlock: ((YHResignConfirmHKStatus)->())?
var applyPaymentBlock: (()->())?
var modifyBtnBlock: (()->())?
lazy var whiteContentView: UIView = {
......@@ -53,6 +54,11 @@ class YHResignScheduleSingleInfoCell: UITableViewCell {
guard let self = self else { return }
self.clickConfirmBtnBlock?(status)
}
view.applyPaymentBlock = {
[weak self] in
guard let self = self else { return }
self.applyPaymentBlock?()
}
return view
}()
......
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