Commit b1c3cae4 authored by Steven杜宇's avatar Steven杜宇

// 去掉OCR loading

parent 38582e2c
......@@ -305,6 +305,9 @@ class YHIdentityCardCell: UITableViewCell {
self.frontImageButton.startRotationAnimation()
self.viewModel.uploadImage(image) {[weak self] success, error in
guard let self = self else { return }
self.frontImageButton.stopRotationAnimation()
self.frontImageButton.setContent("", "")
guard let url = success else { return }
self.viewModel.updateModel(self.type, isFront: true, url: url)
self.frontImageButton.setBackgroundImage(image, for: .normal)
......@@ -312,24 +315,18 @@ class YHIdentityCardCell: UITableViewCell {
self.viewModel.getPublicImageUrl(url) {[weak self] success, error in
guard let self = self else { return }
guard let url = success else { return }
if self.type == .identity {
self.viewModel.requestCnIDCardMessage(url, isBack: 0) {[weak self] success, error in
guard let self = self else { return }
self.frontImageButton.stopRotationAnimation()
self.frontImageButton.setContent("", "")
if success {
} else {
if !success {
YHHUD.flash(message: error?.errorMsg ?? "")
}
}
} else {
self.viewModel.requestHkIDCardMessage(url, isBack: 0) {[weak self] success, error in
guard let self = self else { return }
self.frontImageButton.stopRotationAnimation()
self.frontImageButton.setContent("", "")
if success {
} else {
if !success {
YHHUD.flash(message: error?.errorMsg ?? "")
}
}
......@@ -361,6 +358,9 @@ class YHIdentityCardCell: UITableViewCell {
self.backSurfaceImageButton.startRotationAnimation()
self.viewModel.uploadImage(image) {[weak self] success, error in
guard let self = self else { return }
self.backSurfaceImageButton.stopRotationAnimation()
self.backSurfaceImageButton.setContent("", "")
guard let url = success else { return }
self.backSurfaceImageButton.setBackgroundImage(image, for: .normal)
self.viewModel.updateModel(self.type, isFront: false, url: url)
......@@ -371,22 +371,14 @@ class YHIdentityCardCell: UITableViewCell {
if self.type == .identity {
self.viewModel.requestCnIDCardMessage(url, isBack: 1) {[weak self] success, error in
guard let self = self else { return }
self.backSurfaceImageButton.stopRotationAnimation()
self.backSurfaceImageButton.setContent("", "")
if success {
} else {
YHHUD.flash(message: error?.errorMsg ?? "")
if !success {
YHHUD.flash(message: error?.errorMsg ?? "")
}
}
} else {
self.viewModel.requestHkIDCardMessage(url, isBack: 1 ) {[weak self] success, error in
guard let self = self else { return }
self.backSurfaceImageButton.stopRotationAnimation()
self.backSurfaceImageButton.setContent("", "")
if success {
} else {
if !success {
YHHUD.flash(message: error?.errorMsg ?? "")
}
}
......
......@@ -313,31 +313,27 @@ class YHMainInformationCardTableViewCell: UITableViewCell {
self.frontImageButton.startRotationAnimation()
self.viewModel.uploadImage(image) {[weak self] success, error in
guard let self = self else { return }
self.frontImageButton.stopRotationAnimation()
self.frontImageButton.setContent("", "")
guard let url = success else { return }
self.viewModel.updateModel(self.type, isFront: true, url: url)
self.frontImageButton.setBackgroundImage(image, for: .normal)
self.frontDeleteButton.isHidden = false
self.viewModel.getPublicImageUrl(url) {[weak self] success, error in
guard let self = self else { return }
guard let url = success else { return }
if self.type == .identity {
self.viewModel.requestCnIDCardMessage(url, isBack: 0) {[weak self] success, error in
guard let self = self else { return }
self.frontImageButton.stopRotationAnimation()
self.frontImageButton.setContent("", "")
if success {
} else {
if !success {
YHHUD.flash(message: error?.errorMsg ?? "")
}
}
} else {
self.viewModel.requestHkIDCardMessage(url, isBack: 0) {[weak self] success, error in
guard let self = self else { return }
self.frontImageButton.stopRotationAnimation()
self.frontImageButton.setContent("", "")
if success {
} else {
if !success {
YHHUD.flash(message: error?.errorMsg ?? "")
}
}
......@@ -369,6 +365,9 @@ class YHMainInformationCardTableViewCell: UITableViewCell {
self.backSurfaceImageButton.startRotationAnimation()
self.viewModel.uploadImage(image) {[weak self] success, error in
guard let self = self else { return }
self.backSurfaceImageButton.stopRotationAnimation()
self.backSurfaceImageButton.setContent("", "")
guard let url = success else { return }
self.backSurfaceImageButton.setBackgroundImage(image, for: .normal)
self.viewModel.updateModel(self.type, isFront: false, url: url)
......@@ -378,23 +377,13 @@ class YHMainInformationCardTableViewCell: UITableViewCell {
guard let url = success else { return }
if self.type == .identity {
self.viewModel.requestCnIDCardMessage(url, isBack: 1) {[weak self] success, error in
guard let self = self else { return }
self.backSurfaceImageButton.stopRotationAnimation()
self.backSurfaceImageButton.setContent("", "")
if success {
} else {
if !success {
YHHUD.flash(message: error?.errorMsg ?? "")
}
}
} else {
self.viewModel.requestHkIDCardMessage(url, isBack: 1 ) {[weak self] success, error in
guard let self = self else { return }
self.backSurfaceImageButton.stopRotationAnimation()
self.backSurfaceImageButton.setContent("", "")
if success {
} else {
if !success {
YHHUD.flash(message: error?.errorMsg ?? "")
}
}
......
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