Commit 87385d08 authored by pete谢兆麟's avatar pete谢兆麟

防止多次点击下一步

parent a821025a
......@@ -92,11 +92,13 @@ class YHMainApplicantInformationViewController: YHBaseViewController {
bottomView = {
let bottom = YHBottomNextView()
bottom.nextblock = { [weak self] in
bottom.nextButton.isEnabled = false
guard let self = self else { return }
if self.viewModel.isCanNext(self.stepView.currentIndex) {
self.viewModel.mainModel.step = self.stepView.currentIndex
self.viewModel.updateMainInformation(.submit, self.orderId, self.stepView.currentIndex) {[weak self] success, error in
guard let self = self else { return }
bottom.nextButton.isEnabled = true
if let error = error {
YHHUD.flash(message: error.errorMsg )
} else {
......@@ -113,6 +115,7 @@ class YHMainApplicantInformationViewController: YHBaseViewController {
}
}
} else {
bottom.nextButton.isEnabled = true
self.isShowPrompt = true
self.updateDataSource()
YHHUD.flash(message: "您还有信息未填写")
......
......@@ -115,11 +115,13 @@ class YHWorkExperienceViewController: YHBaseViewController {
bottomView = {
let bottom = YHBottomNextView()
bottom.nextblock = { [weak self] in
bottom.nextButton.isEnabled = false
guard let self = self else { return }
if self.viewModel.isCanNext(self.stepView.currentIndex) {
self.viewModel.mainModel.step = self.stepView.currentIndex
self.viewModel.saveWorkDetail(1, orderID: self.orderID, callBackBlock: {[weak self] flag, error in
guard let self = self else { return }
bottom.nextButton.isEnabled = true
if let error = error {
YHHUD.flash(message: error.errorMsg )
} else {
......@@ -134,6 +136,7 @@ class YHWorkExperienceViewController: YHBaseViewController {
}
})
} else {
bottom.nextButton.isEnabled = true
self.isShowPrompt = true
self.updateDataSource()
YHHUD.flash(message: "您还有信息未填写")
......
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