宽窄优行-由【嘉易行】项目成品而来
younger_times
2023-07-05 0d8f5fc8a516bfd07e425909e4a4432600572ee7
OKProject/Class/Home/ViewModel/EnterpriseViewModel.swift
@@ -11,8 +11,10 @@
import RxCocoa
class EnterpriseViewModel:YYViewModel{
    func queryEnterpriseInfo(_ clouse:@escaping (ResponseStatus<EnterpriseInfoModel>)->Void){
        show()
    func queryEnterpriseInfo(needShow:Bool = true,clouse:@escaping (ResponseStatus<EnterpriseInfoModel>)->Void){
        if needShow{
            show()
        }
        APIManager.shared.provider.rx.request(.queryCompany).mapTravelThenValidate(EnterpriseInfoModel.self).subscribe { result in
            self.hidden()
            switch result {
@@ -27,9 +29,9 @@
        }.disposed(by: disposeBag)
    }
    func submitEnterprise(id:Int? = nil,name:String,mailbox:String,legalName:String,legalPhone:String,identifier:String,contactAddress:String,businessLicense:String,clouse: @escaping (ResponseStatus<Nothing>)->Void){
    func submitEnterprise(id:Int? = nil,name:String,mailbox:String,legalName:String,legalPhone:String,identifier:String,contactAddress:String,businessLicense:String,pwd:String,clouse: @escaping (ResponseStatus<Nothing>)->Void){
        show()
        APIManager.shared.provider.rx.request(.submitCompany(name: name, mailbox: mailbox, legalName: legalName, legalPhone: legalPhone, identifier: identifier, contactAddress: contactAddress, businessLicense: businessLicense)).mapTravelThenValidate(Nothing.self).subscribe { result in
        APIManager.shared.provider.rx.request(.submitCompany(name: name, mailbox: mailbox, legalName: legalName, legalPhone: legalPhone, identifier: identifier, contactAddress: contactAddress, businessLicense: businessLicense,pwd: pwd)).mapTravelThenValidate(Nothing.self).subscribe { result in
            self.hidden()
            switch result {
                case .success(_):