Commit 1c306395 authored by pete谢兆麟's avatar pete谢兆麟

isback

parent f4a5934e
...@@ -141,9 +141,10 @@ class YHFamilyMemberViewModel : YHBaseViewModel{ ...@@ -141,9 +141,10 @@ class YHFamilyMemberViewModel : YHBaseViewModel{
} }
} }
func requestCnIDCardMessage(_ url: String, callBackBlock:@escaping (_ success: Bool, _ error:YHErrorModel?)->()) { func requestCnIDCardMessage(_ url: String, isBack: Int, callBackBlock:@escaping (_ success: Bool, _ error:YHErrorModel?)->()) {
let strUrl = YHBaseUrlManager.shared.curURL() + YHAllApiName.OrderInformation.cnIdCard let strUrl = YHBaseUrlManager.shared.curURL() + YHAllApiName.OrderInformation.cnIdCard
let params: [String : Any] = ["url": url] let params: [String : Any] = ["url": url,
"is_back": isBack]
let _ = YHNetRequest.postRequest(url: strUrl, params: params) { [weak self] json, code in let _ = YHNetRequest.postRequest(url: strUrl, params: params) { [weak self] json, code in
//1. json字符串 转 对象 //1. json字符串 转 对象
guard let self = self else { return } guard let self = self else { return }
...@@ -164,9 +165,10 @@ class YHFamilyMemberViewModel : YHBaseViewModel{ ...@@ -164,9 +165,10 @@ class YHFamilyMemberViewModel : YHBaseViewModel{
} }
} }
func requestHkIDCardMessage(_ url: String, callBackBlock:@escaping (_ success: Bool, _ error:YHErrorModel?)->()) { func requestHkIDCardMessage(_ url: String, isBack: Int, callBackBlock:@escaping (_ success: Bool, _ error:YHErrorModel?)->()) {
let strUrl = YHBaseUrlManager.shared.curURL() + YHAllApiName.OrderInformation.hkIdCard let strUrl = YHBaseUrlManager.shared.curURL() + YHAllApiName.OrderInformation.hkIdCard
let params: [String : Any] = ["url": url] let params: [String : Any] = ["url": url,
"is_back": isBack]
let _ = YHNetRequest.postRequest(url: strUrl, params: params) { [weak self] json, code in let _ = YHNetRequest.postRequest(url: strUrl, params: params) { [weak self] json, code in
//1. json字符串 转 对象 //1. json字符串 转 对象
guard let self = self else { return } guard let self = self else { return }
......
...@@ -28,7 +28,7 @@ class YHIdentityCardCell: UITableViewCell { ...@@ -28,7 +28,7 @@ class YHIdentityCardCell: UITableViewCell {
if viewModel.mainModel.certificates.cnIdentityCard.imgFront.count != 0 { if viewModel.mainModel.certificates.cnIdentityCard.imgFront.count != 0 {
self.viewModel.getPublicImageUrl(viewModel.mainModel.certificates.cnIdentityCard.imgFront) {[weak self] success, error in self.viewModel.getPublicImageUrl(viewModel.mainModel.certificates.cnIdentityCard.imgFront) {[weak self] success, error in
guard let self = self else { return } guard let self = self else { return }
guard let url = success else { return } guard let _ = success else { return }
self.frontImageButton.kf.setBackgroundImage(with: URL(string: success), for: .normal) self.frontImageButton.kf.setBackgroundImage(with: URL(string: success), for: .normal)
self.frontDeleteButton.isHidden = false self.frontDeleteButton.isHidden = false
} }
...@@ -36,7 +36,7 @@ class YHIdentityCardCell: UITableViewCell { ...@@ -36,7 +36,7 @@ class YHIdentityCardCell: UITableViewCell {
if viewModel.mainModel.certificates.cnIdentityCard.imgBack.count != 0 { if viewModel.mainModel.certificates.cnIdentityCard.imgBack.count != 0 {
self.viewModel.getPublicImageUrl(viewModel.mainModel.certificates.cnIdentityCard.imgBack) {[weak self] success, error in self.viewModel.getPublicImageUrl(viewModel.mainModel.certificates.cnIdentityCard.imgBack) {[weak self] success, error in
guard let self = self else { return } guard let self = self else { return }
guard let url = success else { return } guard let _ = success else { return }
self.backSurfaceImageButton.kf.setBackgroundImage(with: URL(string: success), for: .normal) self.backSurfaceImageButton.kf.setBackgroundImage(with: URL(string: success), for: .normal)
self.backSurfaceDeleteButton.isHidden = false self.backSurfaceDeleteButton.isHidden = false
} }
...@@ -45,7 +45,7 @@ class YHIdentityCardCell: UITableViewCell { ...@@ -45,7 +45,7 @@ class YHIdentityCardCell: UITableViewCell {
if viewModel.mainModel.certificates.hkMacaoPass.imgFront.count != 0 { if viewModel.mainModel.certificates.hkMacaoPass.imgFront.count != 0 {
self.viewModel.getPublicImageUrl(viewModel.mainModel.certificates.hkMacaoPass.imgFront) {[weak self] success, error in self.viewModel.getPublicImageUrl(viewModel.mainModel.certificates.hkMacaoPass.imgFront) {[weak self] success, error in
guard let self = self else { return } guard let self = self else { return }
guard let url = success else { return } guard let _ = success else { return }
self.frontImageButton.kf.setBackgroundImage(with: URL(string: success), for: .normal) self.frontImageButton.kf.setBackgroundImage(with: URL(string: success), for: .normal)
self.frontDeleteButton.isHidden = false self.frontDeleteButton.isHidden = false
} }
...@@ -53,7 +53,7 @@ class YHIdentityCardCell: UITableViewCell { ...@@ -53,7 +53,7 @@ class YHIdentityCardCell: UITableViewCell {
if viewModel.mainModel.certificates.hkMacaoPass.imgBack.count != 0 { if viewModel.mainModel.certificates.hkMacaoPass.imgBack.count != 0 {
self.viewModel.getPublicImageUrl(viewModel.mainModel.certificates.hkMacaoPass.imgBack) {[weak self] success, error in self.viewModel.getPublicImageUrl(viewModel.mainModel.certificates.hkMacaoPass.imgBack) {[weak self] success, error in
guard let self = self else { return } guard let self = self else { return }
guard let url = success else { return } guard let _ = success else { return }
self.backSurfaceImageButton.kf.setBackgroundImage(with: URL(string: success), for: .normal) self.backSurfaceImageButton.kf.setBackgroundImage(with: URL(string: success), for: .normal)
self.backSurfaceDeleteButton.isHidden = false self.backSurfaceDeleteButton.isHidden = false
} }
...@@ -298,7 +298,7 @@ class YHIdentityCardCell: UITableViewCell { ...@@ -298,7 +298,7 @@ class YHIdentityCardCell: UITableViewCell {
guard let self = self else { return } guard let self = self else { return }
guard let url = success else { return } guard let url = success else { return }
if self.type == .identity { if self.type == .identity {
self.viewModel.requestCnIDCardMessage(url) {[weak self] success, error in self.viewModel.requestCnIDCardMessage(url, isBack: 0) {[weak self] success, error in
guard let self = self else { return } guard let self = self else { return }
self.activityIndicator.stopAnimating() self.activityIndicator.stopAnimating()
if success { if success {
...@@ -307,7 +307,7 @@ class YHIdentityCardCell: UITableViewCell { ...@@ -307,7 +307,7 @@ class YHIdentityCardCell: UITableViewCell {
} }
} }
} else { } else {
self.viewModel.requestHkIDCardMessage(url) {[weak self] success, error in self.viewModel.requestHkIDCardMessage(url, isBack: 0) {[weak self] success, error in
guard let self = self else { return } guard let self = self else { return }
self.activityIndicator.stopAnimating() self.activityIndicator.stopAnimating()
if success { if success {
...@@ -353,7 +353,7 @@ class YHIdentityCardCell: UITableViewCell { ...@@ -353,7 +353,7 @@ class YHIdentityCardCell: UITableViewCell {
guard let self = self else { return } guard let self = self else { return }
guard let url = success else { return } guard let url = success else { return }
if self.type == .identity { if self.type == .identity {
self.viewModel.requestCnIDCardMessage(url) {[weak self] success, error in self.viewModel.requestCnIDCardMessage(url, isBack: 1) {[weak self] success, error in
guard let self = self else { return } guard let self = self else { return }
self.activityIndicator.stopAnimating() self.activityIndicator.stopAnimating()
if success { if success {
...@@ -363,7 +363,7 @@ class YHIdentityCardCell: UITableViewCell { ...@@ -363,7 +363,7 @@ class YHIdentityCardCell: UITableViewCell {
} }
} }
} else { } else {
self.viewModel.requestHkIDCardMessage(url) {[weak self] success, error in self.viewModel.requestHkIDCardMessage(url, isBack: 1) {[weak self] success, error in
guard let self = self else { return } guard let self = self else { return }
self.activityIndicator.stopAnimating() self.activityIndicator.stopAnimating()
if success { if success {
......
...@@ -18,4 +18,5 @@ class YHCNIDCardModel: YHBaseModel { ...@@ -18,4 +18,5 @@ class YHCNIDCardModel: YHBaseModel {
var end_of_term: String = "" var end_of_term: String = ""
var nationality: String = "" var nationality: String = ""
var name: String = "" var name: String = ""
var is_back: String = ""
} }
...@@ -17,4 +17,5 @@ class YHHKIDCardModel: YHBaseModel { ...@@ -17,4 +17,5 @@ class YHHKIDCardModel: YHBaseModel {
var end_of_term: String = "" var end_of_term: String = ""
var issuing_authority: String = "" var issuing_authority: String = ""
var card_num: String = "" var card_num: String = ""
var is_back: String = ""
} }
...@@ -310,7 +310,7 @@ class YHMainInformationCardTableViewCell: UITableViewCell { ...@@ -310,7 +310,7 @@ class YHMainInformationCardTableViewCell: UITableViewCell {
guard let self = self else { return } guard let self = self else { return }
guard let url = success else { return } guard let url = success else { return }
if self.type == .identity { if self.type == .identity {
self.viewModel.requestCnIDCardMessage(url) {[weak self] success, error in self.viewModel.requestCnIDCardMessage(url, isBack: 0) {[weak self] success, error in
guard let self = self else { return } guard let self = self else { return }
self.activityIndicator.stopAnimating() self.activityIndicator.stopAnimating()
if success { if success {
...@@ -319,7 +319,7 @@ class YHMainInformationCardTableViewCell: UITableViewCell { ...@@ -319,7 +319,7 @@ class YHMainInformationCardTableViewCell: UITableViewCell {
} }
} }
} else { } else {
self.viewModel.requestHkIDCardMessage(url) {[weak self] success, error in self.viewModel.requestHkIDCardMessage(url, isBack: 0) {[weak self] success, error in
guard let self = self else { return } guard let self = self else { return }
self.activityIndicator.stopAnimating() self.activityIndicator.stopAnimating()
if success { if success {
...@@ -368,7 +368,7 @@ class YHMainInformationCardTableViewCell: UITableViewCell { ...@@ -368,7 +368,7 @@ class YHMainInformationCardTableViewCell: UITableViewCell {
guard let self = self else { return } guard let self = self else { return }
guard let url = success else { return } guard let url = success else { return }
if self.type == .identity { if self.type == .identity {
self.viewModel.requestCnIDCardMessage(url) {[weak self] success, error in self.viewModel.requestCnIDCardMessage(url, isBack: 1) {[weak self] success, error in
guard let self = self else { return } guard let self = self else { return }
self.activityIndicator.stopAnimating() self.activityIndicator.stopAnimating()
if success { if success {
...@@ -378,7 +378,7 @@ class YHMainInformationCardTableViewCell: UITableViewCell { ...@@ -378,7 +378,7 @@ class YHMainInformationCardTableViewCell: UITableViewCell {
} }
} }
} else { } else {
self.viewModel.requestHkIDCardMessage(url) {[weak self] success, error in self.viewModel.requestHkIDCardMessage(url, isBack: 1 ) {[weak self] success, error in
guard let self = self else { return } guard let self = self else { return }
self.activityIndicator.stopAnimating() self.activityIndicator.stopAnimating()
if success { if success {
......
...@@ -390,9 +390,10 @@ class YHMainApplicantInformationViewModel: YHBaseViewModel { ...@@ -390,9 +390,10 @@ class YHMainApplicantInformationViewModel: YHBaseViewModel {
} }
} }
func requestCnIDCardMessage(_ url: String, callBackBlock:@escaping (_ success: Bool, _ error:YHErrorModel?)->()) { func requestCnIDCardMessage(_ url: String, isBack: Int, callBackBlock:@escaping (_ success: Bool, _ error:YHErrorModel?)->()) {
let strUrl = YHBaseUrlManager.shared.curURL() + YHAllApiName.OrderInformation.cnIdCard let strUrl = YHBaseUrlManager.shared.curURL() + YHAllApiName.OrderInformation.cnIdCard
let params: [String : Any] = ["url": url] let params: [String : Any] = ["url": url,
"is_back": isBack]
let _ = YHNetRequest.postRequest(url: strUrl, params: params) { [weak self] json, code in let _ = YHNetRequest.postRequest(url: strUrl, params: params) { [weak self] json, code in
//1. json字符串 转 对象 //1. json字符串 转 对象
guard let self = self else { return } guard let self = self else { return }
...@@ -413,9 +414,10 @@ class YHMainApplicantInformationViewModel: YHBaseViewModel { ...@@ -413,9 +414,10 @@ class YHMainApplicantInformationViewModel: YHBaseViewModel {
} }
} }
func requestHkIDCardMessage(_ url: String, callBackBlock:@escaping (_ success: Bool, _ error:YHErrorModel?)->()) { func requestHkIDCardMessage(_ url: String, isBack: Int, callBackBlock:@escaping (_ success: Bool, _ error:YHErrorModel?)->()) {
let strUrl = YHBaseUrlManager.shared.curURL() + YHAllApiName.OrderInformation.hkIdCard let strUrl = YHBaseUrlManager.shared.curURL() + YHAllApiName.OrderInformation.hkIdCard
let params: [String : Any] = ["url": url] let params: [String : Any] = ["url": url,
"is_back": isBack]
let _ = YHNetRequest.postRequest(url: strUrl, params: params) { [weak self] json, code in let _ = YHNetRequest.postRequest(url: strUrl, params: params) { [weak self] json, code in
//1. json字符串 转 对象 //1. json字符串 转 对象
guard let self = self else { return } guard let self = self else { return }
......
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