宽窄优行-由【嘉易行】项目成品而来
无故事王国
2023-05-23 a2ca0e4e77e880eb328c82a37e7ae67fb09198bc
新增
24个文件已修改
4个文件已添加
875 ■■■■■ 已修改文件
OKProject.xcodeproj/project.pbxproj 16 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
OKProject/API/API.swift 66 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
OKProject/Class/Enums.swift 55 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
OKProject/Class/Home/Controller/EnterpriseAuthApplyVC.swift 66 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
OKProject/Class/Home/Controller/EnterpriseAuthApplyVC.xib 14 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
OKProject/Class/Home/Controller/EnterpriseAuthVC.swift 61 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
OKProject/Class/Home/Controller/EnterpriseAuthVC.xib 48 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
OKProject/Class/Home/Controller/EnterpriseInfoVC.swift 26 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
OKProject/Class/Home/Controller/EnterpriseInfoVC.xib 6 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
OKProject/Class/Home/Controller/EnterpriseMembersDetailVC.swift 30 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
OKProject/Class/Home/Controller/EnterpriseMembersDetailVC.xib 8 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
OKProject/Class/Home/Controller/EnterpriseMembersVC.swift 38 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
OKProject/Class/Home/Controller/EnterpriseMembersVC.xib 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
OKProject/Class/Home/Controller/LinesOfCreditListVC.swift 14 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
OKProject/Class/Home/Model/EnterpriseModel.swift 47 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
OKProject/Class/Home/Model/UserInfoModel.swift 6 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
OKProject/Class/Home/View/EnterpriseMembersTCell.swift 10 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
OKProject/Class/Home/View/EnterpriseMembersTCell.xib 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
OKProject/Class/Home/View/LineOfCredictTCell.swift 19 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
OKProject/Class/Home/View/LineOfCredictTCell.xib 12 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
OKProject/Class/Home/ViewModel/EnterpriseViewModel.swift 61 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
OKProject/Class/LeftMenu/Controller/MineBusinessCreditVC.swift 34 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
OKProject/Class/LeftMenu/Controller/MineBusinessCreditVC.xib 3 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
OKProject/Class/LeftMenu/Controller/MineCreditApplyVC.swift 35 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
OKProject/Class/LeftMenu/Controller/MineWalletVC.swift 63 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
OKProject/Class/LeftMenu/View/MineApplyRecordTCell.swift 41 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
OKProject/Class/LeftMenu/View/MineApplyRecordTCell.xib 71 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
OKProject/Main/ViewModel/YYViewModel.swift 19 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
OKProject.xcodeproj/project.pbxproj
@@ -93,6 +93,8 @@
        13652FC227CD021E00D7EA05 /* LD_Def.swift in Sources */ = {isa = PBXBuildFile; fileRef = 13652FC127CD021E00D7EA05 /* LD_Def.swift */; };
        13652FC527CE042C00D7EA05 /* Common_SingleText_CCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = 13652FC327CE042C00D7EA05 /* Common_SingleText_CCell.swift */; };
        13652FC627CE042C00D7EA05 /* Common_SingleText_CCell.xib in Resources */ = {isa = PBXBuildFile; fileRef = 13652FC427CE042C00D7EA05 /* Common_SingleText_CCell.xib */; };
        136E3D012A1B03A6006C3C00 /* EnterpriseViewModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = 136E3D002A1B03A6006C3C00 /* EnterpriseViewModel.swift */; };
        136E3D032A1B13A2006C3C00 /* EnterpriseModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = 136E3D022A1B13A2006C3C00 /* EnterpriseModel.swift */; };
        136F513A282510BD009AAD9E /* MinePublishVC.swift in Sources */ = {isa = PBXBuildFile; fileRef = 136F5139282510BD009AAD9E /* MinePublishVC.swift */; };
        136F513C2825124A009AAD9E /* MinePublishHireListVC.swift in Sources */ = {isa = PBXBuildFile; fileRef = 136F513B2825124A009AAD9E /* MinePublishHireListVC.swift */; };
        136F513E2825127F009AAD9E /* MinePublishSaleListVC.swift in Sources */ = {isa = PBXBuildFile; fileRef = 136F513D2825127F009AAD9E /* MinePublishSaleListVC.swift */; };
@@ -148,6 +150,8 @@
        13978A72282B660B002FB738 /* CarContractVC.xib in Resources */ = {isa = PBXBuildFile; fileRef = 13978A70282B660B002FB738 /* CarContractVC.xib */; };
        13978A74282B8EF8002FB738 /* PublishCommentView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 13978A73282B8EF8002FB738 /* PublishCommentView.swift */; };
        13978A76282B8F02002FB738 /* PublishCommentView.xib in Resources */ = {isa = PBXBuildFile; fileRef = 13978A75282B8F02002FB738 /* PublishCommentView.xib */; };
        13987A8C2A1C9471002C1751 /* MineApplyRecordTCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = 13987A8A2A1C9471002C1751 /* MineApplyRecordTCell.swift */; };
        13987A8D2A1C9471002C1751 /* MineApplyRecordTCell.xib in Resources */ = {isa = PBXBuildFile; fileRef = 13987A8B2A1C9471002C1751 /* MineApplyRecordTCell.xib */; };
        139F887128446B9100D8C4BA /* InvoiceViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 139F886F28446B9100D8C4BA /* InvoiceViewController.swift */; };
        139F887228446B9100D8C4BA /* InvoiceViewController.xib in Resources */ = {isa = PBXBuildFile; fileRef = 139F887028446B9100D8C4BA /* InvoiceViewController.xib */; };
        139F887528446BDB00D8C4BA /* InvoiceApplyViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 139F887328446BDB00D8C4BA /* InvoiceApplyViewController.swift */; };
@@ -758,6 +762,8 @@
        13652FC127CD021E00D7EA05 /* LD_Def.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = LD_Def.swift; sourceTree = "<group>"; };
        13652FC327CE042C00D7EA05 /* Common_SingleText_CCell.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Common_SingleText_CCell.swift; sourceTree = "<group>"; };
        13652FC427CE042C00D7EA05 /* Common_SingleText_CCell.xib */ = {isa = PBXFileReference; lastKnownFileType = file.xib; path = Common_SingleText_CCell.xib; sourceTree = "<group>"; };
        136E3D002A1B03A6006C3C00 /* EnterpriseViewModel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = EnterpriseViewModel.swift; sourceTree = "<group>"; };
        136E3D022A1B13A2006C3C00 /* EnterpriseModel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = EnterpriseModel.swift; sourceTree = "<group>"; };
        136F5139282510BD009AAD9E /* MinePublishVC.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MinePublishVC.swift; sourceTree = "<group>"; };
        136F513B2825124A009AAD9E /* MinePublishHireListVC.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MinePublishHireListVC.swift; sourceTree = "<group>"; };
        136F513D2825127F009AAD9E /* MinePublishSaleListVC.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MinePublishSaleListVC.swift; sourceTree = "<group>"; };
@@ -813,6 +819,8 @@
        13978A70282B660B002FB738 /* CarContractVC.xib */ = {isa = PBXFileReference; lastKnownFileType = file.xib; path = CarContractVC.xib; sourceTree = "<group>"; };
        13978A73282B8EF8002FB738 /* PublishCommentView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = PublishCommentView.swift; sourceTree = "<group>"; };
        13978A75282B8F02002FB738 /* PublishCommentView.xib */ = {isa = PBXFileReference; lastKnownFileType = file.xib; path = PublishCommentView.xib; sourceTree = "<group>"; };
        13987A8A2A1C9471002C1751 /* MineApplyRecordTCell.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MineApplyRecordTCell.swift; sourceTree = "<group>"; };
        13987A8B2A1C9471002C1751 /* MineApplyRecordTCell.xib */ = {isa = PBXFileReference; lastKnownFileType = file.xib; path = MineApplyRecordTCell.xib; sourceTree = "<group>"; };
        139F886F28446B9100D8C4BA /* InvoiceViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = InvoiceViewController.swift; sourceTree = "<group>"; };
        139F887028446B9100D8C4BA /* InvoiceViewController.xib */ = {isa = PBXFileReference; lastKnownFileType = file.xib; path = InvoiceViewController.xib; sourceTree = "<group>"; };
        139F887328446BDB00D8C4BA /* InvoiceApplyViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = InvoiceApplyViewController.swift; sourceTree = "<group>"; };
@@ -1637,6 +1645,7 @@
                13E27D75282E5CEC00E3503B /* CommentViewModel.swift */,
                132D8AF62831EF8F00739B0D /* CarContractViewModel.swift */,
                13E6435828339D56005E601E /* JobViewModel.swift */,
                136E3D002A1B03A6006C3C00 /* EnterpriseViewModel.swift */,
            );
            path = ViewModel;
            sourceTree = "<group>";
@@ -1666,6 +1675,7 @@
                13B69FE227B9F18300489BA6 /* MerchantModel.swift */,
                13E27D77282E5DF100E3503B /* CommentModel.swift */,
                13E6435A28339D8B005E601E /* JobModel.swift */,
                136E3D022A1B13A2006C3C00 /* EnterpriseModel.swift */,
            );
            path = Model;
            sourceTree = "<group>";
@@ -2190,6 +2200,8 @@
                D953BB352499EEB9002BA5EF /* MineLeaveMessageRecordCell.swift */,
                D9ED9F3624AED36F00B7D753 /* MineWithdrawalRecordCell.swift */,
                D9ED9F3724AED36F00B7D753 /* MineWithdrawalRecordCell.xib */,
                13987A8A2A1C9471002C1751 /* MineApplyRecordTCell.swift */,
                13987A8B2A1C9471002C1751 /* MineApplyRecordTCell.xib */,
            );
            path = View;
            sourceTree = "<group>";
@@ -3192,6 +3204,7 @@
                D927C4672490E270002BB108 /* TravelServicePayVC.xib in Resources */,
                138987E929E930D900ED0EAC /* Reason_Content_TCell.xib in Resources */,
                D94983DE2494D1B00057F5D5 /* MineInfoView.xib in Resources */,
                13987A8D2A1C9471002C1751 /* MineApplyRecordTCell.xib in Resources */,
                D9142F0824C7043F0076DE26 /* YYCostDetailViewController.xib in Resources */,
                F3830814255932620060BA72 /* blank_button@3x.png in Resources */,
                13B96B4E29E3ECE000EEF378 /* EnterpriseMembersVC.xib in Resources */,
@@ -3602,6 +3615,7 @@
                D9726C16248B3133008057FA /* PDKeyChain.m in Sources */,
                138A187A282A5FC1004705F5 /* CarDetailMenuVC.swift in Sources */,
                1323879827B4BFB700D2BD1F /* TravelCardTCell.swift in Sources */,
                136E3D032A1B13A2006C3C00 /* EnterpriseModel.swift in Sources */,
                D953BB142499A730002BA5EF /* MineTopUpCell.swift in Sources */,
                D9A09B442498CC2B0077B756 /* MineTripRedEnvelopeCell.swift in Sources */,
                D982D5A42474CDD500FB5A09 /* IntExtension.swift in Sources */,
@@ -3661,6 +3675,7 @@
                D9ED9F3524AED2C000B7D753 /* WithdrawalRecordModel.swift in Sources */,
                D99BBBC224750DE00054BD52 /* NSError.swift in Sources */,
                13978A74282B8EF8002FB738 /* PublishCommentView.swift in Sources */,
                136E3D012A1B03A6006C3C00 /* EnterpriseViewModel.swift in Sources */,
                D9223618252C0500004672AF /* ActivityView.swift in Sources */,
                D982D5A72474CDD500FB5A09 /* NSAttributedStringExtension.swift in Sources */,
                138E5FAB27B4B117004DAACE /* BindRelationFootView.swift in Sources */,
@@ -3673,6 +3688,7 @@
                D953BB202499C88D002BA5EF /* MineFeedbackViewModel.swift in Sources */,
                13BF49362852085C00A5CFDF /* InvoiceInputViewController.swift in Sources */,
                D9278A142493604800EABE46 /* QueryServingOrderModel.swift in Sources */,
                13987A8C2A1C9471002C1751 /* MineApplyRecordTCell.swift in Sources */,
                D9E8AB1A2488CEA6007B4E9D /* LocationAnnotationView.swift in Sources */,
                D982D56C2474C3F100FB5A09 /* AppDelegate.swift in Sources */,
                F34494CC2546663C009891D0 /* TravelChooseEndAddressVC.swift in Sources */,
OKProject/API/API.swift
@@ -672,6 +672,19 @@
    case queryMyInvoice(pageNum:Int)
    case queryRegions(parentId:Int = 0)
    case queryCompany
    case submitCompany(id:Int? = nil,name:String,mailbox:String,legalName:String,legalPhone:String,identifier:String,contactAddress:String,businessLicense:String)
    case queryStaffList(pageNum:Int,staffName:String?)
    case companyLimitList(pageNum:Int)
    case mineLimitList(pageNum:Int)
    case saveCompanyLimit(applyQuota:String,applyReason:String)
}
@@ -971,6 +984,18 @@
                return "/api/invoice/queryMyInvoice"
            case .queryRegions:
                return "/base/orderLogistics/queryRegions"
            case .queryCompany:
                return "/api/user/queryCompany"
            case .submitCompany:
                return "/api/user/submitCompany"
            case .queryStaffList:
                return "/api/user/queryStaffList"
            case .companyLimitList:
                return "/api/user/getCompanyLimitList"
            case .mineLimitList:
                return "/api/user/getMineLimitList"
            case .saveCompanyLimit:
                return "/api/user/saveCompanyLimit"
        }
    }
    
@@ -1925,6 +1950,47 @@
                let params = APIParamsAppender()
                    .append(key: "parentId", value: parentId)
                return .requestParameters(parameters: params.done(), encoding: URLEncoding.queryString)
            case .queryCompany:
                let params = APIParamsAppender()
                return .requestParameters(parameters: params.done(), encoding: URLEncoding.queryString)
            case .submitCompany(let id, let name, let mailbox, let legalName, let legalPhone, let identifier, let contactAddress, let businessLicense):
                let params = APIParamsAppender()
                    .append(key: "id", value: id)
                    .append(key: "name", value: name)
                    .append(key: "mailbox", value: mailbox)
                    .append(key: "legalName", value: legalName)
                    .append(key: "legalPhone", value: legalPhone)
                    .append(key: "identifier", value: identifier)
                    .append(key: "contactAddress", value: contactAddress)
                    .append(key: "businessLicense", value: businessLicense)
                return .requestParameters(parameters: params.done(), encoding: URLEncoding.queryString)
            case .queryStaffList(let pageNum, let staffName):
                let params = APIParamsAppender()
                    .append(key: "pageNum", value: pageNum)
                    .append(key: "staffName", value: staffName)
                    .append(key: "size", value: 20)
                return .requestParameters(parameters: params.done(), encoding: URLEncoding.queryString)
            case .companyLimitList(let pageNum):
                let params = APIParamsAppender()
                    .append(key: "pageNum", value: pageNum)
                    .append(key: "size", value: 20)
                return .requestParameters(parameters: params.done(), encoding: URLEncoding.queryString)
            case .mineLimitList(let pageNum):
                let params = APIParamsAppender()
                    .append(key: "pageNum", value: pageNum)
                    .append(key: "size", value: 20)
                return .requestParameters(parameters: params.done(), encoding: URLEncoding.queryString)
            case .saveCompanyLimit(let applyQuota, let applyReason):
                let params = APIParamsAppender()
                    .append(key: "applyQuota", value: applyQuota)
                    .append(key: "applyReason", value: applyReason)
                return .requestParameters(parameters: params.done(), encoding: URLEncoding.queryString)
        }
    }
}
OKProject/Class/Enums.swift
@@ -123,3 +123,58 @@
    case driver = 2 //司机
    case business = 3 //企业
}
enum EnterpriseAuthStatus:Int,HandyJSONEnum{
    case none = -1
    case Pending = 0
    case Review = 1
    case Pass = 2
    case Reject = 3
    var rawString:String{
        switch self {
            case .Pending:return "待提交"
            case .Review:return "待审核"
            case .Pass:return "通过"
            case .Reject:return "拒绝"
            case .none:return "--"
        }
    }
}
enum GenderType:Int,HandyJSONEnum{
    case man = 1
    case woman = 2
    var rawString:String{
        switch self{
            case .man:return "男"
            case .woman:return "女"
        }
    }
}
enum LinesType:Int,HandyJSONEnum{
    case none = -1
    case pending = 0
    case pass = 1
    case reject = 2
    var rawString:String{
        switch self{
            case .pass:return "已处理"
            case .reject:return "已拒绝"
            case .pending:return "待处理"
            case .none:return "未知"
        }
    }
    var rawTextColor:UIColor{
        switch self{
            case .pass:return UIColor(hexString: "#626262")!
            case .reject:return UIColor.red
            case .pending:return UIColor(hexString: "#45B494")!
            case .none:return UIColor(hexString: "#626262")!
        }
    }
}
OKProject/Class/Home/Controller/EnterpriseAuthApplyVC.swift
@@ -21,11 +21,37 @@
    @IBOutlet weak var btn_submit: UIButton!
    @IBOutlet weak var lb_uploadAuth: UILabel!
    private var viewModel = EnterpriseViewModel()
    private var uploadImgUrl = ""
    var model:EnterpriseInfoModel?
    init(model:EnterpriseInfoModel? = nil) {
        super.init(nibName: nil, bundle: nil)
        self.model = model
    }
    required init?(coder: NSCoder) {
        fatalError("init(coder:) has not been implemented")
    }
    override func viewDidLoad() {
        super.viewDidLoad()
        title = "企业认证"
        btn_submit.isEnabled = false
        lb_uploadAuth.isHidden = true
        if let m = model{
            tf_enterprise.text = m.name
            tf_mail.text = m.mailbox
            tf_legalPerson.text = m.legalName
            tf_legalPersonPhone.text = m.legalPhone
            tf_code.text = m.identifier
            tf_address.text = m.contactAddress
            uploadImgUrl = m.businessLicense
            lb_uploadAuth.isHidden = m.businessLicense.isEmpty
            btn_submit.setTitle("修改", for: .normal)
        }
        check()
    }
@@ -71,6 +97,30 @@
        guard !tf_address.text!.isEmpty else {
            alert(text: tf_address.placeholder ?? "");return
        }
        guard !uploadImgUrl.isEmpty else {
            alert(text: "请上传三证合一");return
        }
        viewModel.submitEnterprise(id:model?.id,name: tf_enterprise.text!, mailbox: tf_mail.text!, legalName: tf_legalPerson.text!, legalPhone: tf_legalPersonPhone.text!, identifier: tf_code.text!, contactAddress: tf_address.text!, businessLicense: uploadImgUrl) { response in
            switch response {
                case .success(_):
                    let contentText =  self.model == nil ? "提交成功!":"修改成功!"
                    alert(popup: .single, title: "提示", text: contentText, submitTitle: "确定",cancelTitle: nil) {
                        NotificationCenter.default.post(name: EnterPriseAuth_Noti, object: nil)
                        for (index,subVC) in (self.navigationController?.viewControllers ?? []).enumerated(){
                            if subVC is EnterpriseAuthApplyVC{
                                self.yy_popToVC(index: index);break
                            }
                        }
                    } cancelClick: {
                    }
                case .error(let error):
                    alert(text: error.localizedDescription)
            }
        }
    }
@@ -91,12 +141,13 @@
    }
        /// 上传头像
    func uploadAvatar()  {
//        YYAliyunOSSManager.shared.uploadImage(key: "avatar\(Date().timeStamp())", image: image).subscribe(onNext: {[unowned self] (url) in
//
//        }, onError: {[unowned self] (error) in
//
//        }).disposed(by: disposeBag)
    func uploadAvatar(_ image:UIImage)  {
        YYAliyunOSSManager.shared.uploadImage(key: "\(Date().timeStamp())", image: image).subscribe(onNext: {[unowned self] (url) in
            self.uploadImgUrl = url
            self.lb_uploadAuth.isHidden = false
        }, onError: { (error) in
            alert(text: error.localizedDescription)
        }).disposed(by: disposeBag)
    }
}
@@ -105,8 +156,7 @@
    func imagePickerController(_ picker: UIImagePickerController, didFinishPickingMediaWithInfo info: [UIImagePickerController.InfoKey : Any]) {
        self.dismiss(animated: true)
        let image =  info[UIImagePickerController.InfoKey.editedImage] as! UIImage
        self.uploadAvatar()
        self.uploadAvatar(image)
        if #available(iOS 11.0, *) {
            UIScrollView.appearance().contentInsetAdjustmentBehavior = .never
        }
OKProject/Class/Home/Controller/EnterpriseAuthApplyVC.xib
@@ -197,12 +197,7 @@
                                        <textField opaque="NO" contentMode="scaleToFill" horizontalHuggingPriority="248" contentHorizontalAlignment="left" contentVerticalAlignment="center" placeholder="请输入信用代码" textAlignment="right" minimumFontSize="17" translatesAutoresizingMaskIntoConstraints="NO" id="A4M-25-tJ9" customClass="QMUITextField">
                                            <rect key="frame" x="110" y="15.666666666666687" width="270" height="18.666666666666679"/>
                                            <fontDescription key="fontDescription" type="system" pointSize="14"/>
                                            <textInputTraits key="textInputTraits" keyboardType="alphabet"/>
                                            <userDefinedRuntimeAttributes>
                                                <userDefinedRuntimeAttribute type="number" keyPath="maximumTextLength">
                                                    <integer key="value" value="11"/>
                                                </userDefinedRuntimeAttribute>
                                            </userDefinedRuntimeAttributes>
                                            <textInputTraits key="textInputTraits"/>
                                        </textField>
                                    </subviews>
                                    <color key="backgroundColor" systemColor="systemBackgroundColor"/>
@@ -237,12 +232,7 @@
                                        <textField opaque="NO" contentMode="scaleToFill" horizontalHuggingPriority="248" contentHorizontalAlignment="left" contentVerticalAlignment="center" placeholder="请输入地址" textAlignment="right" minimumFontSize="17" translatesAutoresizingMaskIntoConstraints="NO" id="xx2-0E-lBX" customClass="QMUITextField">
                                            <rect key="frame" x="81.333333333333343" y="15.666666666666687" width="298.66666666666663" height="18.666666666666679"/>
                                            <fontDescription key="fontDescription" type="system" pointSize="14"/>
                                            <textInputTraits key="textInputTraits" keyboardType="alphabet"/>
                                            <userDefinedRuntimeAttributes>
                                                <userDefinedRuntimeAttribute type="number" keyPath="maximumTextLength">
                                                    <integer key="value" value="11"/>
                                                </userDefinedRuntimeAttribute>
                                            </userDefinedRuntimeAttributes>
                                            <textInputTraits key="textInputTraits"/>
                                        </textField>
                                    </subviews>
                                    <color key="backgroundColor" systemColor="systemBackgroundColor"/>
OKProject/Class/Home/Controller/EnterpriseAuthVC.swift
@@ -8,19 +8,76 @@
import UIKit
let EnterPriseAuth_Noti = Notification.Name.init("EnterPriseAuth_Noti")
class EnterpriseAuthVC: YYViewController {
    private var viewModel = EnterpriseViewModel()
    @IBOutlet weak var label_authStatus: UILabel!
    @IBOutlet weak var btn_authStatus: TapButton!
    @IBOutlet weak var btn_enterprisename: TapButton!
    @IBOutlet weak var btn_enterpriseMembers: TapButton!
    @IBOutlet weak var btn_enterpriseInfo: TapButton!
    @IBOutlet weak var btn_apply: TapButton!
    @IBOutlet weak var label_apply: UILabel!
    private var model:EnterpriseInfoModel!{
        didSet{
            label_authStatus.text = model.authStatus.rawString
            btn_authStatus.isHidden = model.authStatus == .Pass
            btn_enterprisename.isHidden = model.authStatus != .Pass
            btn_enterpriseMembers.isHidden = model.authStatus != .Pass
            btn_enterpriseInfo.isHidden = model.authStatus != .Pass
            btn_apply.isHidden = model.moneyLimit == 0
            label_apply.text = String(format: "额度申请(%ld)", model.moneyLimitCount)
        }
    }
    override func viewDidLoad() {
        super.viewDidLoad()
        title = "企业认证"
        
        btn_enterprisename.isHidden = true
        btn_enterpriseMembers.isHidden = true
        btn_enterpriseInfo.isHidden = true
        btn_apply.isHidden = true
        getData()
    }
    override func bindRx() {
        NotificationCenter.default.rx.notification(EnterPriseAuth_Noti).takeUntil(self.rx.deallocated).subscribe(onNext: {noti in
            self.getData()
        }).disposed(by: disposeBag)
    }
    private func getData(){
        viewModel.queryEnterpriseInfo { status in
            switch status {
                case .success(let model):
                    self.model = model
                case .error(let error):
                    alert(text: error.localizedDescription)
            }
        }
    }
    @IBAction func handleAction(_ sender: TapButton) {
        print("--->\(sender.tag)")
        if sender.tag == 10{
            switch model.authStatus{
                case .Pending:
            let vc = EnterpriseAuthApplyVC()
            yy_push(vc: vc)
                case .Review:
                    alert(popup: .single, title: "提示", text: "请耐心等待,审核通过后会通过短信的形式通知", submitTitle: "确定",cancelTitle: nil) {
                    } cancelClick: {
                    }
                default:break
            }
        }
        if sender.tag == 12{
@@ -29,7 +86,7 @@
        }
        if sender.tag == 13{
            let vc = EnterpriseInfoVC()
            let vc = EnterpriseInfoVC(model: model)
            yy_push(vc: vc)
        }
OKProject/Class/Home/Controller/EnterpriseAuthVC.xib
@@ -11,6 +11,13 @@
    <objects>
        <placeholder placeholderIdentifier="IBFilesOwner" id="-1" userLabel="File's Owner" customClass="EnterpriseAuthVC" customModule="OK出行" customModuleProvider="target">
            <connections>
                <outlet property="btn_apply" destination="jCd-5P-JqG" id="5EQ-lG-Ov4"/>
                <outlet property="btn_authStatus" destination="ncK-gi-LQ4" id="J5R-49-wgv"/>
                <outlet property="btn_enterpriseInfo" destination="bW8-ol-XnC" id="7zM-E4-KZ3"/>
                <outlet property="btn_enterpriseMembers" destination="1zP-ki-ZG3" id="YhZ-Uk-U8G"/>
                <outlet property="btn_enterprisename" destination="dXy-xx-7dC" id="fhL-SR-3Yx"/>
                <outlet property="label_apply" destination="0rX-dU-kQ7" id="jCV-xF-AXO"/>
                <outlet property="label_authStatus" destination="D4O-DN-F4f" id="Voi-zm-0Gb"/>
                <outlet property="view" destination="i5M-Pr-FkT" id="sfx-zR-JGt"/>
            </connections>
        </placeholder>
@@ -23,7 +30,7 @@
                    <rect key="frame" x="0.0" y="59" width="393" height="759"/>
                    <subviews>
                        <stackView opaque="NO" contentMode="scaleToFill" axis="vertical" translatesAutoresizingMaskIntoConstraints="NO" id="TwK-1q-9im">
                            <rect key="frame" x="0.0" y="0.0" width="393" height="300"/>
                            <rect key="frame" x="0.0" y="0.0" width="393" height="250"/>
                            <subviews>
                                <view tag="10" contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="ncK-gi-LQ4" customClass="TapButton" customModule="OK出行" customModuleProvider="target">
                                    <rect key="frame" x="0.0" y="0.0" width="393" height="50"/>
@@ -37,7 +44,7 @@
                                        <imageView clipsSubviews="YES" userInteractionEnabled="NO" alpha="0.40000000000000002" contentMode="scaleAspectFit" horizontalHuggingPriority="251" verticalHuggingPriority="251" image="icon_more_black" translatesAutoresizingMaskIntoConstraints="NO" id="Sti-HH-ywc">
                                            <rect key="frame" x="371" y="18.666666666666671" width="8" height="13"/>
                                        </imageView>
                                        <label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="待验证" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="D4O-DN-F4f">
                                        <label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="查询中" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="D4O-DN-F4f">
                                            <rect key="frame" x="319" y="16.666666666666671" width="43" height="17"/>
                                            <fontDescription key="fontDescription" type="system" pointSize="14"/>
                                            <color key="textColor" red="0.20000000000000001" green="0.20000000000000001" blue="0.20000000000000001" alpha="0.40000000000000002" colorSpace="custom" customColorSpace="sRGB"/>
@@ -176,43 +183,8 @@
                                        <action selector="handleAction:" destination="-1" eventType="touchUpInside" id="YrP-5A-obA"/>
                                    </connections>
                                </view>
                                <view tag="14" contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="Cgb-lm-ax7" customClass="TapButton" customModule="OK出行" customModuleProvider="target">
                                    <rect key="frame" x="0.0" y="200" width="393" height="50"/>
                                    <subviews>
                                        <label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="订单审核(0)" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="qr7-RB-Th6">
                                            <rect key="frame" x="14" y="16.666666666666686" width="94.666666666666671" height="17"/>
                                            <fontDescription key="fontDescription" type="system" weight="medium" pointSize="14"/>
                                            <color key="textColor" red="0.20000000000000001" green="0.20000000000000001" blue="0.20000000000000001" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
                                            <nil key="highlightedColor"/>
                                        </label>
                                        <view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="hPT-R0-Qyi">
                                            <rect key="frame" x="14" y="49.333333333333314" width="365" height="0.6666666666666643"/>
                                            <color key="backgroundColor" red="0.0" green="0.0" blue="0.0" alpha="0.059999999999999998" colorSpace="custom" customColorSpace="sRGB"/>
                                            <constraints>
                                                <constraint firstAttribute="height" constant="0.59999999999999998" id="Zx3-Of-Zib"/>
                                            </constraints>
                                        </view>
                                        <imageView clipsSubviews="YES" userInteractionEnabled="NO" alpha="0.40000000596046448" contentMode="scaleAspectFit" horizontalHuggingPriority="251" verticalHuggingPriority="251" image="icon_more_black" translatesAutoresizingMaskIntoConstraints="NO" id="mH1-5y-aDr">
                                            <rect key="frame" x="371" y="18.666666666666686" width="8" height="13"/>
                                        </imageView>
                                    </subviews>
                                    <color key="backgroundColor" systemColor="systemBackgroundColor"/>
                                    <constraints>
                                        <constraint firstItem="qr7-RB-Th6" firstAttribute="centerY" secondItem="Cgb-lm-ax7" secondAttribute="centerY" id="3rT-TE-n1T"/>
                                        <constraint firstAttribute="height" constant="50" id="47s-8p-hXP"/>
                                        <constraint firstAttribute="trailing" secondItem="hPT-R0-Qyi" secondAttribute="trailing" constant="14" id="GYQ-8b-WW9"/>
                                        <constraint firstItem="qr7-RB-Th6" firstAttribute="leading" secondItem="Cgb-lm-ax7" secondAttribute="leading" constant="14" id="Tle-M7-jc0"/>
                                        <constraint firstAttribute="bottom" secondItem="hPT-R0-Qyi" secondAttribute="bottom" id="caU-dG-Jq4"/>
                                        <constraint firstItem="hPT-R0-Qyi" firstAttribute="leading" secondItem="Cgb-lm-ax7" secondAttribute="leading" constant="14" id="efh-45-mbW"/>
                                        <constraint firstItem="mH1-5y-aDr" firstAttribute="centerY" secondItem="qr7-RB-Th6" secondAttribute="centerY" id="etm-Bc-LmI"/>
                                        <constraint firstAttribute="trailing" secondItem="mH1-5y-aDr" secondAttribute="trailing" constant="14" id="u7p-Xi-3g6"/>
                                    </constraints>
                                    <connections>
                                        <action selector="handleAction:" destination="-1" eventType="touchUpInside" id="ffV-Sv-MMg"/>
                                    </connections>
                                </view>
                                <view tag="15" contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="jCd-5P-JqG" customClass="TapButton" customModule="OK出行" customModuleProvider="target">
                                    <rect key="frame" x="0.0" y="250" width="393" height="50"/>
                                    <rect key="frame" x="0.0" y="200" width="393" height="50"/>
                                    <subviews>
                                        <label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="额度申请(0)" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="0rX-dU-kQ7">
                                            <rect key="frame" x="14" y="16.666666666666686" width="94.666666666666671" height="17"/>
OKProject/Class/Home/Controller/EnterpriseInfoVC.swift
@@ -10,13 +10,37 @@
class EnterpriseInfoVC: YYViewController {
    @IBOutlet weak var label_name: UILabel!
    @IBOutlet weak var label_email: UILabel!
    @IBOutlet weak var label_legalName: UILabel!
    @IBOutlet weak var label_legalPhone: UILabel!
    @IBOutlet weak var label_businessLicense: UILabel!
    @IBOutlet weak var label_address: UILabel!
    var model:EnterpriseInfoModel!
    init(model:EnterpriseInfoModel) {
        super.init(nibName: nil, bundle: nil)
        self.model = model
    }
    required init?(coder: NSCoder) {
        fatalError("init(coder:) has not been implemented")
    }
    override func viewDidLoad() {
        super.viewDidLoad()
        title = "企业资料"
        label_name.text = model.name
        label_email.text = model.mailbox
        label_legalName.text = model.legalName
        label_legalPhone.text = model.legalPhone
        label_businessLicense.text = model.identifier
        label_address.text = model.contactAddress
    }
    @IBAction func updateAction(_ sender: UIButton) {
        let vc = EnterpriseAuthApplyVC()
        let vc = EnterpriseAuthApplyVC(model: model)
        yy_push(vc: vc)
    }
}
OKProject/Class/Home/Controller/EnterpriseInfoVC.xib
@@ -12,6 +12,12 @@
    <objects>
        <placeholder placeholderIdentifier="IBFilesOwner" id="-1" userLabel="File's Owner" customClass="EnterpriseInfoVC" customModule="OK出行" customModuleProvider="target">
            <connections>
                <outlet property="label_address" destination="GV0-EN-J6S" id="6RV-Kl-8hT"/>
                <outlet property="label_businessLicense" destination="TRi-pP-E4A" id="JSG-1i-sz5"/>
                <outlet property="label_email" destination="pWg-V8-Sx8" id="BzK-ox-CPq"/>
                <outlet property="label_legalName" destination="1GP-cI-Ktq" id="5cu-dT-Ul9"/>
                <outlet property="label_legalPhone" destination="dRv-cS-kEY" id="cSv-Xp-bq0"/>
                <outlet property="label_name" destination="jdR-By-cLJ" id="eSH-TX-WQS"/>
                <outlet property="view" destination="i5M-Pr-FkT" id="sfx-zR-JGt"/>
            </connections>
        </placeholder>
OKProject/Class/Home/Controller/EnterpriseMembersDetailVC.swift
@@ -10,8 +10,38 @@
class EnterpriseMembersDetailVC: YYViewController {
    var enterpriseMembersModel:EnterpriseMembersModel!
    @IBOutlet weak var label_name: UILabel!
    @IBOutlet weak var label_number: UILabel!
    @IBOutlet weak var label_phone: UILabel!
    @IBOutlet weak var label_position: UILabel!
    @IBOutlet weak var label_gender: UILabel!
    @IBOutlet weak var label_department: UILabel!
    @IBOutlet weak var label_joinTime: UILabel!
    @IBOutlet weak var label_edu: UILabel!
    init(model: EnterpriseMembersModel!) {
        super.init(nibName: nil, bundle: nil)
        self.enterpriseMembersModel = model
    }
    required init?(coder: NSCoder) {
        fatalError("init(coder:) has not been implemented")
    }
    override func viewDidLoad() {
        super.viewDidLoad()
        title = "成员详情"
        label_name.text = enterpriseMembersModel.staffName
        label_number.text = enterpriseMembersModel.staffNo
        label_phone.text = enterpriseMembersModel.phone
        label_position.text = enterpriseMembersModel.position
        label_gender.text = enterpriseMembersModel.sex.rawString
        label_department.text = enterpriseMembersModel.deptName
        label_joinTime.text = enterpriseMembersModel.enjoyTime
        label_edu.text = enterpriseMembersModel.education
    }
}
OKProject/Class/Home/Controller/EnterpriseMembersDetailVC.xib
@@ -11,6 +11,14 @@
    <objects>
        <placeholder placeholderIdentifier="IBFilesOwner" id="-1" userLabel="File's Owner" customClass="EnterpriseMembersDetailVC" customModule="OK出行" customModuleProvider="target">
            <connections>
                <outlet property="label_department" destination="64b-Dx-TuW" id="D5k-lP-EDe"/>
                <outlet property="label_edu" destination="bC0-p8-i3H" id="lU6-sB-P73"/>
                <outlet property="label_gender" destination="Nd3-2i-KIK" id="5tS-Sq-0S2"/>
                <outlet property="label_joinTime" destination="WsH-Pe-ltt" id="yy0-Lh-5H1"/>
                <outlet property="label_name" destination="ck2-Ns-csl" id="XRq-uo-YCU"/>
                <outlet property="label_number" destination="iF9-4j-Eer" id="gNf-OI-mE3"/>
                <outlet property="label_phone" destination="of6-sT-wCl" id="5qN-zT-yeO"/>
                <outlet property="label_position" destination="1UI-ic-g9Z" id="2OU-Fz-M0N"/>
                <outlet property="view" destination="i5M-Pr-FkT" id="sfx-zR-JGt"/>
            </connections>
        </placeholder>
OKProject/Class/Home/Controller/EnterpriseMembersVC.swift
@@ -7,11 +7,22 @@
//
import UIKit
import RxRelay
class  EnterpriseMembersViewModel:YYRefreshViewModel<EnterpriseMembersModel>{
    var staffName = BehaviorRelay(value: "")
    override func api() -> API! {
        return .queryStaffList(pageNum: currentPage, staffName: staffName.value)
    }
}
class EnterpriseMembersVC: YYViewController {
    @IBOutlet weak var tf_name: UITextField!
    @IBOutlet weak var tableView: UITableView!
    private var viewModel = EnterpriseMembersViewModel()
    override func viewDidLoad() {
        super.viewDidLoad()
@@ -21,18 +32,31 @@
        tableView.dataSource = self
        tableView.separatorStyle = .none
        tableView.register(UINib(nibName: "EnterpriseMembersTCell", bundle: nil), forCellReuseIdentifier: "_EnterpriseMembersTCell")
        viewModel.configure(tableView: tableView)
        tf_name.delegate = self
        tf_name.returnKeyType = .search
        tableView.beginRefreshing()
    }
    override func bindRx() {
        tf_name.rx.text.orEmpty.subscribe(onNext: {[weak self] text in
            self?.viewModel.staffName.accept(text)
        }).disposed(by: disposeBag)
    }
    @IBAction func queryAction(_ sender: Any) {
        guard !tf_name.isEmpty else {
            alert(text: "请输入姓名");return
        }
        tf_name.resignFirstResponder()
        tableView.beginRefreshing()
    }
}
extension EnterpriseMembersVC:UITableViewDelegate{
    func tableView(_ tableView: UITableView, didSelectRowAt indexPath: IndexPath) {
        let vc = EnterpriseMembersDetailVC()
         let model = viewModel.dataSource.value[indexPath.row]
        let vc = EnterpriseMembersDetailVC(model: model)
        yy_push(vc: vc)
    }
}
@@ -40,11 +64,19 @@
extension EnterpriseMembersVC:UITableViewDataSource{
    func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell {
        let cell = tableView.dequeueReusableCell(withIdentifier: "_EnterpriseMembersTCell") as! EnterpriseMembersTCell
        cell.model = viewModel.dataSource.value[indexPath.row]
        return cell
    }
    func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -> Int {
        return 30
        return viewModel.dataSource.value.count
    }
}
extension EnterpriseMembersVC:UITextFieldDelegate{
    func textFieldShouldReturn(_ textField: UITextField) -> Bool {
        textField.resignFirstResponder()
        tableView.beginRefreshing()
        return true
    }
}
OKProject/Class/Home/Controller/EnterpriseMembersVC.xib
@@ -70,7 +70,7 @@
                        </userDefinedRuntimeAttribute>
                    </userDefinedRuntimeAttributes>
                </view>
                <tableView clipsSubviews="YES" contentMode="scaleToFill" alwaysBounceVertical="YES" style="plain" separatorStyle="default" rowHeight="-1" estimatedRowHeight="-1" sectionHeaderHeight="-1" estimatedSectionHeaderHeight="-1" sectionFooterHeight="-1" estimatedSectionFooterHeight="-1" translatesAutoresizingMaskIntoConstraints="NO" id="eIT-BB-46L">
                <tableView clipsSubviews="YES" contentMode="scaleToFill" alwaysBounceVertical="YES" style="plain" separatorStyle="default" rowHeight="-1" estimatedRowHeight="-1" sectionHeaderHeight="-1" estimatedSectionHeaderHeight="-1" sectionFooterHeight="-1" estimatedSectionFooterHeight="-1" translatesAutoresizingMaskIntoConstraints="NO" id="eIT-BB-46L" customClass="RefreshTableView" customModule="OK出行" customModuleProvider="target">
                    <rect key="frame" x="0.0" y="125" width="393" height="693"/>
                    <color key="backgroundColor" systemColor="systemBackgroundColor"/>
                </tableView>
OKProject/Class/Home/Controller/LinesOfCreditListVC.swift
@@ -7,8 +7,17 @@
//
import UIKit
import RxRelay
class LinesOfCreditViewModel:YYRefreshViewModel<LinesModel>{
    override func api() -> API! {
        return .companyLimitList(pageNum: currentPage)
    }
}
class LinesOfCreditListVC: YYTableViewController {
    private var viewModel = LinesOfCreditViewModel()
    override func viewDidLoad() {
        super.viewDidLoad()
@@ -17,6 +26,8 @@
        tableView.dataSource = self
        tableView.separatorStyle = .none
        tableView.register(UINib(nibName: "LineOfCredictTCell", bundle: nil), forCellReuseIdentifier: "_LineOfCredictTCell")
        viewModel.configure(tableView: tableView)
        tableView.beginRefreshing()
    }
}
@@ -26,12 +37,13 @@
extension LinesOfCreditListVC:UITableViewDataSource{
    func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -> Int {
        return 10
        return viewModel.dataSource.value.count
    }
    func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell {
        let cell = tableView.dequeueReusableCell(withIdentifier: "_LineOfCredictTCell") as! LineOfCredictTCell
        cell.backgroundColor = .clear
        cell.lineModel = viewModel.dataSource.value[indexPath.row]
        return cell
    }
}
OKProject/Class/Home/Model/EnterpriseModel.swift
New file
@@ -0,0 +1,47 @@
//
//  EnterpriseModel.swift
//  OKProject
//
//  Created by 无故事王国 on 2023/5/22.
//  Copyright © 2023 yangwang. All rights reserved.
//
import Foundation
import HandyJSON
struct EnterpriseInfoModel:HandyJSON{
    var authStatus:EnterpriseAuthStatus = .none
    var businessLicense: String = ""
    var contactAddress: String = ""
    var id: Int = 0
    var identifier: String = ""
    var legalName: String = ""
    var legalPhone: String = ""
    var mailbox: String = ""
    var moneyLimit: Int = 0
    var moneyLimitCount: Int = 0
    var name: String = ""
}
struct EnterpriseMembersModel:HandyJSON{
    var deptName = ""
    var education = ""
    var enjoyTime = ""
    var id = 0
    var phone = ""
    var position = ""
    var sex:GenderType = .man
    var staffName = ""
    var staffNo = ""
}
struct LinesModel:HandyJSON {
    var applyQuota:Double = 0
    var applyReason = ""
    var createTime = ""
    var id = 0
    var phone = ""
    var remark = ""
    var staffName = ""
    var status:LinesType = .none
}
OKProject/Class/Home/Model/UserInfoModel.swift
@@ -23,6 +23,12 @@
    /// 账户余额
    var balance: Double = 0
    
    /// 总额度
    var enterpriseQuota:Double = 0
    /// 本月剩余额度
    var balanceQuota:Double = 0
    /// 生日
    var birthday: String = ""
    
OKProject/Class/Home/View/EnterpriseMembersTCell.swift
@@ -10,6 +10,16 @@
class EnterpriseMembersTCell: UITableViewCell {
    @IBOutlet weak var label_name: UILabel!
    @IBOutlet weak var label_number: UILabel!
    var model:EnterpriseMembersModel!{
        didSet{
            label_name.text = model.staffName
            label_number.text = model.staffNo
        }
    }
    override func awakeFromNib() {
        super.awakeFromNib()
        selectionStyle = .none
OKProject/Class/Home/View/EnterpriseMembersTCell.xib
@@ -53,6 +53,10 @@
                </constraints>
            </tableViewCellContentView>
            <viewLayoutGuide key="safeArea" id="njF-e1-oar"/>
            <connections>
                <outlet property="label_name" destination="eWo-7e-KfI" id="SiK-HI-UZA"/>
                <outlet property="label_number" destination="QRy-ca-ANw" id="qmX-kq-cO3"/>
            </connections>
            <point key="canvasLocation" x="164.12213740458014" y="49.295774647887328"/>
        </tableViewCell>
    </objects>
OKProject/Class/Home/View/LineOfCredictTCell.swift
@@ -10,6 +10,25 @@
class LineOfCredictTCell: UITableViewCell {
    @IBOutlet weak var label_time: UILabel!
    @IBOutlet weak var label_status: UILabel!
    @IBOutlet weak var label_stuffName: UILabel!
    @IBOutlet weak var label_phone: UILabel!
    @IBOutlet weak var label_applyAccount: UILabel!
    @IBOutlet weak var label_remark: UILabel!
    var lineModel:LinesModel!{
        didSet{
            label_time.text = lineModel.createTime
            label_status.text = lineModel.status.rawString
            label_status.textColor = lineModel.status.rawTextColor
            label_stuffName.text = String(format: "员工姓名:%@", lineModel.staffName)
            label_phone.text = String(format: "电话:%@", lineModel.phone)
            label_applyAccount.text = String(format: "申请额度:¥%.2lf", lineModel.applyQuota)
            label_remark.text = lineModel.remark
        }
    }
    override func awakeFromNib() {
        super.awakeFromNib()
        selectionStyle = .none
OKProject/Class/Home/View/LineOfCredictTCell.xib
@@ -72,7 +72,7 @@
                                        <nil key="highlightedColor"/>
                                    </label>
                                    <label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="申请额度:--" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="9NT-h2-SMM">
                                        <rect key="frame" x="0.0" y="58" width="308" height="17"/>
                                        <rect key="frame" x="0.0" y="58" width="308" height="20"/>
                                        <constraints>
                                            <constraint firstAttribute="height" constant="20" id="0F4-93-lGI"/>
                                        </constraints>
@@ -81,7 +81,7 @@
                                        <nil key="highlightedColor"/>
                                    </label>
                                    <label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="备注:--" textAlignment="natural" lineBreakMode="tailTruncation" numberOfLines="0" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="fv0-Aq-yU8">
                                        <rect key="frame" x="0.0" y="84" width="308" height="20"/>
                                        <rect key="frame" x="0.0" y="87" width="308" height="17"/>
                                        <constraints>
                                            <constraint firstAttribute="height" constant="20" id="aEV-Pp-bkP"/>
                                        </constraints>
@@ -152,6 +152,14 @@
                </constraints>
            </tableViewCellContentView>
            <viewLayoutGuide key="safeArea" id="njF-e1-oar"/>
            <connections>
                <outlet property="label_applyAccount" destination="9NT-h2-SMM" id="Rp3-px-8dg"/>
                <outlet property="label_phone" destination="N1W-7a-ScM" id="WLc-G6-Pg0"/>
                <outlet property="label_remark" destination="fv0-Aq-yU8" id="kRv-pa-f8w"/>
                <outlet property="label_status" destination="oTm-PA-7mF" id="piS-II-dYf"/>
                <outlet property="label_stuffName" destination="rcf-Nb-SaK" id="0vV-jy-ATK"/>
                <outlet property="label_time" destination="Sjy-gV-eg6" id="d2V-F2-I29"/>
            </connections>
            <point key="canvasLocation" x="181.67938931297709" y="85.563380281690144"/>
        </tableViewCell>
    </objects>
OKProject/Class/Home/ViewModel/EnterpriseViewModel.swift
New file
@@ -0,0 +1,61 @@
//
//  EnterpriseViewModel.swift
//  OKProject
//
//  Created by 无故事王国 on 2023/5/22.
//  Copyright © 2023 yangwang. All rights reserved.
//
import Foundation
import RxSwift
import RxCocoa
class EnterpriseViewModel:YYViewModel{
    func queryEnterpriseInfo(_ clouse:@escaping (ResponseStatus<EnterpriseInfoModel>)->Void){
        show()
        APIManager.shared.provider.rx.request(.queryCompany).mapTravelThenValidate(EnterpriseInfoModel.self).subscribe { result in
            self.hidden()
            switch result {
                case .success(let element):
                    clouse(ResponseStatus.success(element!))
                case .failure(let e):
                    clouse(ResponseStatus.error(e))
            }
        } onError: { error in
            self.hidden()
            clouse(ResponseStatus.error(error))
        }.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){
        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
            self.hidden()
            switch result {
                case .success(_):
                    clouse(ResponseStatus.success(nil))
                case .failure(let e):
                    clouse(ResponseStatus.error(e))
            }
        } onError: { error in
            self.hidden()
            clouse(ResponseStatus.error(error))
        }.disposed(by: disposeBag)
    }
    func saveCompanyLimit(applyQuota:String,applyReason:String,clouse: @escaping (ResponseStatus<Nothing>)->Void){
        show()
        APIManager.shared.provider.rx.request(.saveCompanyLimit(applyQuota: applyQuota, applyReason: applyReason)).mapTravelThenValidate(Nothing.self).subscribe { result in
            self.hidden()
            switch result {
                case .success(_):
                    clouse(ResponseStatus.success(nil))
                case .failure(let e):
                    clouse(ResponseStatus.error(e))
            }
        } onError: { error in
            self.hidden()
            clouse(ResponseStatus.error(error))
        }.disposed(by: disposeBag)
    }
}
OKProject/Class/LeftMenu/Controller/MineBusinessCreditVC.swift
@@ -8,7 +8,19 @@
import UIKit
class MineBusinessCreditViewModel:YYRefreshViewModel<LinesModel>{
    override func api() -> API! {
        return .mineLimitList(pageNum: currentPage)
    }
}
class MineBusinessCreditVC: YYViewController {
    @IBOutlet weak var label_quotaAccount: UILabel!
    @IBOutlet weak var label_account: UILabel!
    @IBOutlet weak var tableview: UITableView!
    private var viewModel:MineBusinessCreditViewModel!
    override func viewWillAppear(_ animated: Bool) {
        super.viewWillAppear(animated)
@@ -54,6 +66,12 @@
    override func viewDidLoad() {
        super.viewDidLoad()
        title = "企业额度"
        viewModel = MineBusinessCreditViewModel()
        tableview.register(UINib(nibName: "MineApplyRecordTCell", bundle: nil), forCellReuseIdentifier:"_MineApplyRecordTCell")
        tableview.delegate = self
        tableview.dataSource = self
        viewModel.configure(tableView: tableview)
        tableview.beginRefreshing()
    }
    @IBAction func applyAction(_ sender: UIButton) {
@@ -66,3 +84,19 @@
        return .lightContent
    }
}
extension MineBusinessCreditVC:UITableViewDelegate{
}
extension MineBusinessCreditVC:UITableViewDataSource{
    func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -> Int {
        return viewModel.dataSource.value.count
    }
    func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell {
        let cell = tableView.dequeueReusableCell(withIdentifier: "_MineApplyRecordTCell") as! MineApplyRecordTCell
        cell.model = viewModel.dataSource.value[indexPath.row]
        return cell
    }
}
OKProject/Class/LeftMenu/Controller/MineBusinessCreditVC.xib
@@ -12,6 +12,9 @@
    <objects>
        <placeholder placeholderIdentifier="IBFilesOwner" id="-1" userLabel="File's Owner" customClass="MineBusinessCreditVC" customModule="OK出行" customModuleProvider="target">
            <connections>
                <outlet property="label_account" destination="iQf-W5-avs" id="QjI-1p-Jhr"/>
                <outlet property="label_quotaAccount" destination="kEi-Ob-oaJ" id="NNz-h2-WmY"/>
                <outlet property="tableview" destination="KXA-ui-Cvi" id="7br-os-vlX"/>
                <outlet property="view" destination="i5M-Pr-FkT" id="sfx-zR-JGt"/>
            </connections>
        </placeholder>
OKProject/Class/LeftMenu/Controller/MineCreditApplyVC.swift
@@ -8,6 +8,7 @@
import UIKit
import QMUIKit
import RxSwift
class MineCreditApplyVC: YYViewController {
@@ -15,12 +16,44 @@
    @IBOutlet weak var textview_reason: QMUITextView!
    @IBOutlet weak var btn_submit: UIButton!
    
    private let viewModel = EnterpriseViewModel()
    override func viewDidLoad() {
        super.viewDidLoad()
        title = "申请"
    }
    @IBAction func submitAction(_ sender: UIButton) {
    override func bindRx() {
       let sequeue = Observable.combineLatest(tf_apply_amount.rx.text.orEmpty, textview_reason.rx.text.orEmpty)
        sequeue.subscribe {[weak self] t1,t2 in
            let status = !(t1.isEmpty || t2.isEmpty)
            self?.btn_submit.isEnabled = status
            if status{
                self?.btn_submit.backgroundColor = UIColor(hexString: "#45B494")
            }else{
                self?.btn_submit.backgroundColor = UIColor(hexString: "#818287")
            }
        }.disposed(by: disposeBag)
    }
    @IBAction func submitAction(_ sender: UIButton) {
        guard let v = Int(tf_apply_amount.text!) else { alert(text: "请输入申请额度");return }
        guard !textview_reason.text.isEmpty else {
            alert(text: "请输入申请理由");return
            }
        viewModel.saveCompanyLimit(applyQuota: tf_apply_amount.text!, applyReason: textview_reason.text!) { status in
            switch status {
                case .success(_):
                    alert(popup: .single, title: "提示!", text: "申请提交成功", submitTitle: "确定", cancelTitle: "取消") {
                        self.yy_pop()
                    } cancelClick: {
                    }
                case .error(let e):
                    alert(text: e.localizedDescription)
                    break
            }
        }
    }
}
OKProject/Class/LeftMenu/Controller/MineWalletVC.swift
@@ -34,6 +34,12 @@
    
    /// 数据源
    private let dataSource = ["消费记录","打车红包","企业额度"]
    private var viewModel = EnterpriseViewModel()
    private var model:EnterpriseInfoModel?{
        didSet{
            tableView.reloadData()
        }
    }
    
    override func viewDidLoad() {
        super.viewDidLoad()
@@ -43,12 +49,13 @@
        let attribute2 = NSAttributedString(string: "申请", attributes: [NSAttributedString.Key.underlineStyle:1])
        btn_apply.setAttributedTitle(attribute2, for: .normal)
        getData()
    }
    
    override func viewWillAppear(_ animated: Bool) {
        super.viewWillAppear(animated)
        label_balance.text = "\(app.userInfo.balance.remain2Digits())"
//        yy_nav_back_img = UIImage.init(named: "icon_back_white")!
        label_credit_balance.text = "\(app.userInfo.balanceQuota.remain2Digits())"
        self.navigationController?.navigationBar.titleTextAttributes = [NSAttributedString.Key.foregroundColor:UIColor.color(light: UIColor.color(hexString: "#000000"), dark: UIColor.color(hexString: "#FFFFFF")),NSAttributedString.Key.font: UIFont.init(name: Medium, size: 18) ?? UIFont.systemFont(ofSize: 18)]
        self.navigationController?.navigationBar.barTintColor = UIColor.color(light: UIColor.color(hexString: "#FFFFFF"), dark: UIColor.color(hexString: "#191919"))
        self.navigationController?.navigationBar.barTintColor = ThemeColor
@@ -59,19 +66,33 @@
        self.navigationController?.navigationBar.titleTextAttributes = [NSAttributedString.Key.foregroundColor:UIColor.color(light: UIColor.color(hexString: "#000000"), dark: UIColor.color(hexString: "#FFFFFF")),NSAttributedString.Key.font: UIFont.init(name: Medium, size: 18) ?? UIFont.systemFont(ofSize: 18)]
        self.navigationController?.navigationBar.barTintColor = UIColor.color(light: UIColor.color(hexString: "#FFFFFF"), dark: UIColor.color(hexString: "#191919"))
    }
    override func viewDidAppear(_ animated: Bool) {
        super.viewDidAppear(animated)
        label_balance.text = app.userInfo.balance.remain2Digits()
        label_credit_balance.text = app.userInfo.balanceQuota.remain2Digits()
    }
    //MARK: - UI
    override func setupViews() {
        super.setupViews()
        navigationItem.title = "钱包"
//        navigationItem.rightBarButtonItem = UIBarButtonItem.yy_creat(title: "提现", UIFont.systemFont(ofSize: 14), .black, target: self, action: #selector(withdrawal)).item
//        label_balanceDesc.attributedText = AttributedStringbuilder.build()
//            .add(string: "余额", withFont: UIFont.systemFont(ofSize: 14), withColor: .white)
//            .add(string: "(元)", withFont: UIFont.systemFont(ofSize: 12), withColor: .white).mutableAttributedString
        tableView.delegate = self
        tableView.dataSource = self
        tableView.tableFooterView = UIView()
        tableView.register(UITableViewCell.self, forCellReuseIdentifier: "item")
        tableView.separatorColor = UIColor.color(light: UIColor.color(hexString: "#F6F6F6"), dark: UIColor.color(hexString: "#F6F6F6"))
    }
    private func getData(){
        viewModel.queryEnterpriseInfo { status in
            switch status{
                case .success(let m):
                    self.model = m
                case .error(let error):break
            }
        }
    }
   
    //MARK: - Rx
@@ -89,8 +110,37 @@
    }
    @IBAction func applyAction(_ sender: Any) {
        guard let m = model else {
            alert(text: "数据获取失败,请稍候")
            getData()
            return
        }
        switch m.authStatus{
            case .Pass:
        let vc = MineCreditApplyVC()
        self.yy_push(vc: vc)
            case .Pending:
                alert(popup: .single, title: "提示", text: "请先进行企业认证", submitTitle: "确定",cancelTitle: nil) {
                } cancelClick: {
                }
            case .Reject:
                alert(popup: .single, title: "提示", text: "企业认证审核失败,请重新提交", submitTitle: "确定",cancelTitle: nil) {
                } cancelClick: {
                }
            case .none:break
            case .Review:
                alert(popup: .single, title: "提示", text: "请耐心等待,审核通过后会通过短信的形式通知", submitTitle: "确定",cancelTitle: nil) {
                } cancelClick: {
                }
        }
    }
}
@@ -123,6 +173,9 @@
// MARK: - UITableViewDelegate
extension MineWalletVC:UITableViewDataSource{
    func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -> Int {
        if model == nil{
            return 2
        }
        return dataSource.count
    }
    
OKProject/Class/LeftMenu/View/MineApplyRecordTCell.swift
New file
@@ -0,0 +1,41 @@
//
//  MineApplyRecordTCell.swift
//  OKProject
//
//  Created by 无故事王国 on 2023/5/23.
//  Copyright © 2023 yangwang. All rights reserved.
//
import UIKit
class MineApplyRecordTCell: UITableViewCell {
    var model:LinesModel!{
        didSet{
            label_datetime.text = model.createTime
            label_account.text = "¥\(model.applyQuota.remain2Digits())"
            switch model.status{
                case .pass:
                    label_status.text = "成功"
                    label_status.textColor = UIColor(hexString: "#F01D1D")
                case .reject:
                    label_status.text = "失败"
                    label_status.textColor = UIColor(hexString: "#888888")
                case .pending:
                    label_status.text = "申请中"
                    label_status.textColor = UIColor(hexString: "#888888")
                case .none:
                    label_status.text = "未知"
            }
        }
    }
    @IBOutlet weak var label_datetime: UILabel!
    @IBOutlet weak var label_account: UILabel!
    @IBOutlet weak var label_status: UILabel!
    override func awakeFromNib() {
        super.awakeFromNib()
    }
}
OKProject/Class/LeftMenu/View/MineApplyRecordTCell.xib
New file
@@ -0,0 +1,71 @@
<?xml version="1.0" encoding="UTF-8"?>
<document type="com.apple.InterfaceBuilder3.CocoaTouch.XIB" version="3.0" toolsVersion="21701" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" useSafeAreas="YES" colorMatched="YES">
    <device id="retina6_12" orientation="portrait" appearance="light"/>
    <dependencies>
        <deployment identifier="iOS"/>
        <plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="21678"/>
        <capability name="Safe area layout guides" minToolsVersion="9.0"/>
        <capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
    </dependencies>
    <objects>
        <placeholder placeholderIdentifier="IBFilesOwner" id="-1" userLabel="File's Owner"/>
        <placeholder placeholderIdentifier="IBFirstResponder" id="-2" customClass="UIResponder"/>
        <tableViewCell contentMode="scaleToFill" selectionStyle="default" indentationWidth="10" reuseIdentifier="_MineApplyRecordTCell" rowHeight="52" id="KGk-i7-Jjw" customClass="MineApplyRecordTCell" customModule="OK出行" customModuleProvider="target">
            <rect key="frame" x="0.0" y="0.0" width="341" height="52"/>
            <autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
            <tableViewCellContentView key="contentView" opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center" ambiguous="YES" tableViewCell="KGk-i7-Jjw" id="H2p-sc-9uM">
                <rect key="frame" x="0.0" y="0.0" width="341" height="52"/>
                <autoresizingMask key="autoresizingMask"/>
                <subviews>
                    <label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Label" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="lYW-Ns-9os">
                        <rect key="frame" x="14" y="10" width="36" height="30"/>
                        <constraints>
                            <constraint firstAttribute="height" constant="30" id="Inl-Hv-Tf4"/>
                        </constraints>
                        <fontDescription key="fontDescription" type="system" weight="medium" pointSize="14"/>
                        <nil key="textColor"/>
                        <nil key="highlightedColor"/>
                    </label>
                    <view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="ggy-Yu-HtK">
                        <rect key="frame" x="14" y="50" width="313" height="0.3333333333333357"/>
                        <color key="backgroundColor" red="0.59215686274509804" green="0.59215686274509804" blue="0.59215686274509804" alpha="0.29999999999999999" colorSpace="custom" customColorSpace="sRGB"/>
                        <constraints>
                            <constraint firstAttribute="height" constant="0.40000000000000002" id="8ov-6m-TPU"/>
                        </constraints>
                    </view>
                    <label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Label" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="YL2-xl-Pf9">
                        <rect key="frame" x="291" y="16.666666666666668" width="36" height="17.000000000000004"/>
                        <fontDescription key="fontDescription" type="system" weight="medium" pointSize="14"/>
                        <nil key="textColor"/>
                        <nil key="highlightedColor"/>
                    </label>
                    <label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="¥0.00" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="YLf-0b-nhX">
                        <rect key="frame" x="151" y="16.666666666666668" width="39" height="17.000000000000004"/>
                        <fontDescription key="fontDescription" type="system" weight="medium" pointSize="14"/>
                        <nil key="textColor"/>
                        <nil key="highlightedColor"/>
                    </label>
                </subviews>
                <constraints>
                    <constraint firstItem="ggy-Yu-HtK" firstAttribute="leading" secondItem="H2p-sc-9uM" secondAttribute="leading" constant="14" id="3G9-hu-l5n"/>
                    <constraint firstAttribute="trailing" secondItem="YL2-xl-Pf9" secondAttribute="trailing" constant="14" id="7U1-FW-Saz"/>
                    <constraint firstItem="lYW-Ns-9os" firstAttribute="top" secondItem="H2p-sc-9uM" secondAttribute="top" constant="10" id="81n-K8-CCV"/>
                    <constraint firstAttribute="trailing" secondItem="ggy-Yu-HtK" secondAttribute="trailing" constant="14" id="KVm-X9-csj"/>
                    <constraint firstItem="ggy-Yu-HtK" firstAttribute="top" secondItem="lYW-Ns-9os" secondAttribute="bottom" constant="10" id="chE-Ws-QJE"/>
                    <constraint firstItem="YLf-0b-nhX" firstAttribute="centerY" secondItem="lYW-Ns-9os" secondAttribute="centerY" id="eqp-8D-71e"/>
                    <constraint firstAttribute="bottom" secondItem="ggy-Yu-HtK" secondAttribute="bottom" id="muQ-wU-rqy"/>
                    <constraint firstItem="YL2-xl-Pf9" firstAttribute="centerY" secondItem="lYW-Ns-9os" secondAttribute="centerY" id="ns7-Cu-Qlr"/>
                    <constraint firstItem="YLf-0b-nhX" firstAttribute="centerX" secondItem="H2p-sc-9uM" secondAttribute="centerX" id="vpe-US-iPx"/>
                    <constraint firstItem="lYW-Ns-9os" firstAttribute="leading" secondItem="H2p-sc-9uM" secondAttribute="leading" constant="14" id="yxQ-rk-Fk0"/>
                </constraints>
            </tableViewCellContentView>
            <viewLayoutGuide key="safeArea" id="njF-e1-oar"/>
            <connections>
                <outlet property="label_account" destination="YLf-0b-nhX" id="pSn-QB-uGr"/>
                <outlet property="label_datetime" destination="lYW-Ns-9os" id="xif-Ol-gys"/>
                <outlet property="label_status" destination="YL2-xl-Pf9" id="bK8-Os-qKj"/>
            </connections>
            <point key="canvasLocation" x="96.946564885496173" y="23.239436619718312"/>
        </tableViewCell>
    </objects>
</document>
OKProject/Main/ViewModel/YYViewModel.swift
@@ -10,6 +10,7 @@
import RxSwift
import RxCocoa
import HandyJSON
import MBProgressHUD
// 假设这是服务端返回的统一定义的response格式
struct BaseResponse<T :HandyJSON>: HandyJSON {
@@ -24,12 +25,30 @@
    case error(_ error: Error)
}
enum ResponseStatus<T:HandyJSON> {
    case success(_ model: T? = nil)
    case error(_ error: Error)
}
class YYViewModel {
    
    lazy var requestSubject = PublishSubject<RequestStatus>()
    
    
    let disposeBag = DisposeBag()
    var hud : MBProgressHUD?
    
    func show(){
        let hud = MBProgressHUD.showAdded(to: UIApplication.shared.keyWindow!, animated: true)
        hud.mode = .indeterminate
        hud.bezelView.style = .solidColor
        hud.bezelView.color = #colorLiteral(red: 0, green: 0, blue: 0, alpha: 0.7)
        hud.customView?.frame = CGRect(x: 0, y: 0, width: 50, height: 50)
        self.hud = hud
    }
    func hidden(){
        hud?.hide(animated: true)
    }
    
}