Commit 054eb999 authored by David黄金龙's avatar David黄金龙

完成 入口的UI 及接口联调

parent b7ecc6a6
...@@ -86,6 +86,7 @@ ...@@ -86,6 +86,7 @@
A5573EF52B317C0100D98EC0 /* galaxyUITestsLaunchTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = A5573EF42B317C0100D98EC0 /* galaxyUITestsLaunchTests.swift */; }; A5573EF52B317C0100D98EC0 /* galaxyUITestsLaunchTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = A5573EF42B317C0100D98EC0 /* galaxyUITestsLaunchTests.swift */; };
A56D2D612B62020C009C83A8 /* YHContractMainItemStatusCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = A56D2D602B62020C009C83A8 /* YHContractMainItemStatusCell.swift */; }; A56D2D612B62020C009C83A8 /* YHContractMainItemStatusCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = A56D2D602B62020C009C83A8 /* YHContractMainItemStatusCell.swift */; };
A57F1F252B48F09200B644E6 /* ATAuthSDK_D.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 04808C032B4686510056D53C /* ATAuthSDK_D.framework */; }; A57F1F252B48F09200B644E6 /* ATAuthSDK_D.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 04808C032B4686510056D53C /* ATAuthSDK_D.framework */; };
A58556BA2B6BCF1A003746B2 /* YHPersonInfoFillStepModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = A58556B92B6BCF1A003746B2 /* YHPersonInfoFillStepModel.swift */; };
A58951C52B398D1000225C19 /* Launch Screen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = A58951C42B398D1000225C19 /* Launch Screen.storyboard */; }; A58951C52B398D1000225C19 /* Launch Screen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = A58951C42B398D1000225C19 /* Launch Screen.storyboard */; };
A5ACE9272B4564F7002C94D2 /* YHLoginViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = A5ACE8DB2B4564F7002C94D2 /* YHLoginViewController.swift */; }; A5ACE9272B4564F7002C94D2 /* YHLoginViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = A5ACE8DB2B4564F7002C94D2 /* YHLoginViewController.swift */; };
A5ACE9282B4564F7002C94D2 /* YHSmsCodeView.swift in Sources */ = {isa = PBXBuildFile; fileRef = A5ACE8DE2B4564F7002C94D2 /* YHSmsCodeView.swift */; }; A5ACE9282B4564F7002C94D2 /* YHSmsCodeView.swift in Sources */ = {isa = PBXBuildFile; fileRef = A5ACE8DE2B4564F7002C94D2 /* YHSmsCodeView.swift */; };
...@@ -302,6 +303,7 @@ ...@@ -302,6 +303,7 @@
A5573EF22B317C0100D98EC0 /* galaxyUITests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = galaxyUITests.swift; sourceTree = "<group>"; }; A5573EF22B317C0100D98EC0 /* galaxyUITests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = galaxyUITests.swift; sourceTree = "<group>"; };
A5573EF42B317C0100D98EC0 /* galaxyUITestsLaunchTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = galaxyUITestsLaunchTests.swift; sourceTree = "<group>"; }; A5573EF42B317C0100D98EC0 /* galaxyUITestsLaunchTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = galaxyUITestsLaunchTests.swift; sourceTree = "<group>"; };
A56D2D602B62020C009C83A8 /* YHContractMainItemStatusCell.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YHContractMainItemStatusCell.swift; sourceTree = "<group>"; }; A56D2D602B62020C009C83A8 /* YHContractMainItemStatusCell.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YHContractMainItemStatusCell.swift; sourceTree = "<group>"; };
A58556B92B6BCF1A003746B2 /* YHPersonInfoFillStepModel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YHPersonInfoFillStepModel.swift; sourceTree = "<group>"; };
A58951C42B398D1000225C19 /* Launch Screen.storyboard */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; path = "Launch Screen.storyboard"; sourceTree = "<group>"; }; A58951C42B398D1000225C19 /* Launch Screen.storyboard */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; path = "Launch Screen.storyboard"; sourceTree = "<group>"; };
A5ACE8DB2B4564F7002C94D2 /* YHLoginViewController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = YHLoginViewController.swift; sourceTree = "<group>"; }; A5ACE8DB2B4564F7002C94D2 /* YHLoginViewController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = YHLoginViewController.swift; sourceTree = "<group>"; };
A5ACE8DE2B4564F7002C94D2 /* YHSmsCodeView.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = YHSmsCodeView.swift; sourceTree = "<group>"; }; A5ACE8DE2B4564F7002C94D2 /* YHSmsCodeView.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = YHSmsCodeView.swift; sourceTree = "<group>"; };
...@@ -972,6 +974,7 @@ ...@@ -972,6 +974,7 @@
A5C382D02B5FAAB300C5E65C /* YHContactItemModel.swift */, A5C382D02B5FAAB300C5E65C /* YHContactItemModel.swift */,
A5FD63C02B62616D00D1D9DA /* YHInformationPerfectModel.swift */, A5FD63C02B62616D00D1D9DA /* YHInformationPerfectModel.swift */,
A5FD63C22B63438A00D1D9DA /* YHContactMainItemStatusModel.swift */, A5FD63C22B63438A00D1D9DA /* YHContactMainItemStatusModel.swift */,
A58556B92B6BCF1A003746B2 /* YHPersonInfoFillStepModel.swift */,
); );
path = M; path = M;
sourceTree = "<group>"; sourceTree = "<group>";
...@@ -1430,6 +1433,7 @@ ...@@ -1430,6 +1433,7 @@
A5C382CC2B5EA11800C5E65C /* YHContractCell.swift in Sources */, A5C382CC2B5EA11800C5E65C /* YHContractCell.swift in Sources */,
042FBBC12B63B21700F9DE23 /* YHFormItemDegreeInfoCell.swift in Sources */, 042FBBC12B63B21700F9DE23 /* YHFormItemDegreeInfoCell.swift in Sources */,
A5ACE9492B4564F7002C94D2 /* YHHUDSuccessView.swift in Sources */, A5ACE9492B4564F7002C94D2 /* YHHUDSuccessView.swift in Sources */,
A58556BA2B6BCF1A003746B2 /* YHPersonInfoFillStepModel.swift in Sources */,
A5FD63D42B65F99500D1D9DA /* YHScoreItemCell.swift in Sources */, A5FD63D42B65F99500D1D9DA /* YHScoreItemCell.swift in Sources */,
A5ACE9432B4564F7002C94D2 /* UILable+Extension.swift in Sources */, A5ACE9432B4564F7002C94D2 /* UILable+Extension.swift in Sources */,
A5ACE9382B4564F7002C94D2 /* UIApplication+Extension.swift in Sources */, A5ACE9382B4564F7002C94D2 /* UIApplication+Extension.swift in Sources */,
......
...@@ -12,11 +12,9 @@ import UIKit ...@@ -12,11 +12,9 @@ import UIKit
*信息完善列表 *信息完善列表
*/ */
class YHInformationPerfectListVC: YHBaseViewController { class YHInformationPerfectListVC: YHBaseViewController {
// private let serviceCenterMainReqVM : YHServiceCenterMainViewModel = YHServiceCenterMainViewModel() var orderId : Int?
private let serviceCenterMainReqVM : YHServiceCenterMainViewModel = YHServiceCenterMainViewModel()
private var arrData : [YHInformationPerfectModel] = []
private var myTargetIndex : Int32 = 3 //for test hjl
private var hasSubmitFlag : Bool = false { private var hasSubmitFlag : Bool = false {
didSet { didSet {
submitBtn.isHidden = hasSubmitFlag submitBtn.isHidden = hasSubmitFlag
...@@ -25,7 +23,7 @@ class YHInformationPerfectListVC: YHBaseViewController { ...@@ -25,7 +23,7 @@ class YHInformationPerfectListVC: YHBaseViewController {
if hasSubmitFlag == true { if hasSubmitFlag == true {
headerTitleDesLable.text = "您已提交信息表" headerTitleDesLable.text = "您已提交信息表"
} else { } else {
headerTitleDesLable.text = "您好,DavidHuang先生" headerTitleDesLable.text = "您好," + (serviceCenterMainReqVM.informationFillStepModel?.applicantName ?? "-")
} }
} }
} }
...@@ -81,27 +79,48 @@ class YHInformationPerfectListVC: YHBaseViewController { ...@@ -81,27 +79,48 @@ class YHInformationPerfectListVC: YHBaseViewController {
super.viewDidLoad() super.viewDidLoad()
setupUI() setupUI()
loadData() loadData()
}
}
extension YHInformationPerfectListVC {
func submitSweetNotify() {
let params = ["option":1,"orderId":orderId]
serviceCenterMainReqVM.submitSweetNotifyOp(params: params as [String : Any]) { success, error in
if success == true {
self.hasSubmitFlag = true
} else {
YHHUD.flash(message: error?.errorMsg ?? "发生错误,请重试")
}
}
}
func showTipsAlert() {
YHInformationFillTipsAlertView.showCheckView { agree in YHInformationFillTipsAlertView.showCheckView { agree in
if agree == true { if agree == true {
printLog("点击了 确认 按钮") printLog("点击了 确认 按钮")
self.submitSweetNotify()
} else { } else {
printLog("点击了 取消 按钮") printLog("点击了 取消 按钮")
} }
} }
} }
}
extension YHInformationPerfectListVC {
func loadData() { func loadData() {
// self.serviceCenterMainReqVM.getContactList { success, error in guard let orderId = orderId else { return}
// if success == true { self.serviceCenterMainReqVM.getPersonInfoFillStep(params: ["orderId":orderId]) { success, error in
// if success == true {
// } if self.serviceCenterMainReqVM.informationFillStepModel?.sweet_notify_status == 0 {
// self.homeTableView.reloadData() self.showTipsAlert()
// } }
if self.serviceCenterMainReqVM.myInfoFillStep > 6 {
self.hasSubmitFlag = true
} else {
self.hasSubmitFlag = false
}
}
self.homeTableView.reloadData()
}
} }
@objc func goScoreVC() { @objc func goScoreVC() {
...@@ -139,34 +158,6 @@ extension YHInformationPerfectListVC { ...@@ -139,34 +158,6 @@ extension YHInformationPerfectListVC {
gk_navBarAlpha = 1.0 gk_navBarAlpha = 1.0
gk_navLineHidden = true gk_navLineHidden = true
let arr = [1,2,3,4,5,6]
let target = myTargetIndex //for test hjl 待填写的项目
for item in arr {
let model = YHInformationPerfectModel()
model.type = item
arrData.append(model)
if item < target {
model.isFinished = true
} else {
model.isFinished = false
}
if item == target {
model.isDoing = true
}
if item == target + 1 {
model.isNextDoingCell = true
} else {
model.isNextDoingCell = false
}
}
view.addSubview(topBkg) view.addSubview(topBkg)
topBkg.snp.makeConstraints { make in topBkg.snp.makeConstraints { make in
make.top.left.right.equalToSuperview() make.top.left.right.equalToSuperview()
...@@ -302,7 +293,7 @@ extension YHInformationPerfectListVC : UITableViewDelegate,UITableViewDataSource ...@@ -302,7 +293,7 @@ extension YHInformationPerfectListVC : UITableViewDelegate,UITableViewDataSource
} }
func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -> Int { func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -> Int {
return 6 return serviceCenterMainReqVM.arrInfoFillStep.count
} }
func tableView(_ tableView: UITableView, heightForRowAt indexPath: IndexPath) -> CGFloat { func tableView(_ tableView: UITableView, heightForRowAt indexPath: IndexPath) -> CGFloat {
...@@ -312,15 +303,15 @@ extension YHInformationPerfectListVC : UITableViewDelegate,UITableViewDataSource ...@@ -312,15 +303,15 @@ extension YHInformationPerfectListVC : UITableViewDelegate,UITableViewDataSource
func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell { func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell {
let newCell = tableView.dequeueReusableCell(withClass: YHInformationPerfectCell.self) let newCell = tableView.dequeueReusableCell(withClass: YHInformationPerfectCell.self)
newCell.selectionStyle = .none newCell.selectionStyle = .none
newCell.dataModel = arrData[indexPath.row] newCell.dataModel = serviceCenterMainReqVM.arrInfoFillStep[indexPath.row]
return newCell return newCell
} }
func tableView(_ tableView: UITableView, didSelectRowAt indexPath: IndexPath) { func tableView(_ tableView: UITableView, didSelectRowAt indexPath: IndexPath) {
tableView.deselectRow(at: indexPath, animated: true) tableView.deselectRow(at: indexPath, animated: true)
printLog("点击了 \(indexPath.section)section --- \(indexPath.row)row") printLog("点击了 \(indexPath.section)section --- \(indexPath.row)row")
let model = arrData[indexPath.row] let model = serviceCenterMainReqVM.arrInfoFillStep[indexPath.row]
if (indexPath.row + 1 > myTargetIndex) { if (indexPath.row + 1 > serviceCenterMainReqVM.myInfoFillStep) {
let message = "请先完成" + model.name + "填写" let message = "请先完成" + model.name + "填写"
YHHUD.flash(message: message) YHHUD.flash(message: message)
} else { } else {
......
...@@ -161,7 +161,9 @@ extension YHServiceCenterSecondViewController : UITableViewDelegate,UITableViewD ...@@ -161,7 +161,9 @@ extension YHServiceCenterSecondViewController : UITableViewDelegate,UITableViewD
func tableView(_ tableView: UITableView, didSelectRowAt indexPath: IndexPath) { func tableView(_ tableView: UITableView, didSelectRowAt indexPath: IndexPath) {
tableView.deselectRow(at: indexPath, animated: true) tableView.deselectRow(at: indexPath, animated: true)
if indexPath.row == 0 { if indexPath.row == 0 {
navigationController?.pushViewController(YHInformationPerfectListVC()) let vc = YHInformationPerfectListVC()
vc.orderId = orderId
navigationController?.pushViewController(vc)
} else if indexPath.row == 1 { } else if indexPath.row == 1 {
} else { } else {
......
//
// YHPersonInfoFillStepModel.swift
// galaxy
//
// Created by davidhuangA on 2024/2/1.
// Copyright © 2024 https://www.galaxy-immi.com. All rights reserved.
//
import UIKit
import SmartCodable
struct YHPersonInfoFillStepModel: SmartCodable {
var step : Int = 0
var applicantName : String = ""
var sweet_notify_status : Int = 0
}
...@@ -17,6 +17,11 @@ class YHServiceCenterMainViewModel: YHBaseViewModel { ...@@ -17,6 +17,11 @@ class YHServiceCenterMainViewModel: YHBaseViewModel {
//合同对应的状态 //合同对应的状态
var arrContactStausItmes: [YHContactMainItemStatusModel] = [] var arrContactStausItmes: [YHContactMainItemStatusModel] = []
//信息完善列表
var arrInfoFillStep : [YHInformationPerfectModel] = []
var myInfoFillStep : Int = 0
var informationFillStepModel : YHPersonInfoFillStepModel?
} }
//请求接口 //请求接口
...@@ -35,12 +40,12 @@ extension YHServiceCenterMainViewModel { ...@@ -35,12 +40,12 @@ extension YHServiceCenterMainViewModel {
printLog("model 是 ==> \(model)") printLog("model 是 ==> \(model)")
let dic = model.data?.peel let dic = model.data?.peel
guard let resultModel = YHContactItemHoldModel.deserialize(dict: dic as? [AnyHashable : Any]) else { guard let resultModel = YHContactItemHoldModel.deserialize(dict: dic as? [AnyHashable : Any]) else {
self.arrContactList = [] arrContactList = []
callBackBlock(false,nil) callBackBlock(false,nil)
return return
} }
self.arrContactList = resultModel.orders arrContactList = resultModel.orders
callBackBlock(true,nil) callBackBlock(true,nil)
} failBlock: { err in } failBlock: { err in
callBackBlock(false,err) callBackBlock(false,err)
...@@ -102,6 +107,85 @@ extension YHServiceCenterMainViewModel { ...@@ -102,6 +107,85 @@ extension YHServiceCenterMainViewModel {
callBackBlock(false,err) callBackBlock(false,err)
} }
} }
//请求 信息表的填写状态
func getPersonInfoFillStep( params:[String : Any],callBackBlock:@escaping (_ success: Bool,_ error:YHErrorModel?)->()) {
let strUrl = YHBaseUrlManager.shared.curURL() + YHAllApiName.Order.informationStepApi
let _ = YHNetRequest.getRequest(url: strUrl,params: params) { [weak self] json, code in
//1. json字符串 转 对象
guard let self = self else { return }
guard let model = NetBaseModel.deserialize(dict: json) else {
let error : YHErrorModel = YHErrorModel(errorCode:YHErrorCode.dictParseError.rawValue,errorMsg: YHErrorCode.dictParseError.description())
self.arrInfoFillStep = []
informationFillStepModel = nil
callBackBlock(false,error)
return
}
printLog("model 是 ==> \(model)")
let dic = model.data?.peel
guard let resultModel = YHPersonInfoFillStepModel.deserialize(dict: dic as? [AnyHashable : Any]) else {
self.arrInfoFillStep = []
informationFillStepModel = nil
callBackBlock(false,nil)
return
}
informationFillStepModel = resultModel
myInfoFillStep = resultModel.step
let arr = [1,2,3,4,5,6]
let target = myInfoFillStep //for test hjl 待填写的项目
for item in arr {
let model = YHInformationPerfectModel()
model.type = item
arrInfoFillStep.append(model)
if item < target {
model.isFinished = true
} else {
model.isFinished = false
}
if item == target {
model.isDoing = true
}
if item == target + 1 {
model.isNextDoingCell = true
} else {
model.isNextDoingCell = false
}
}
callBackBlock(true,nil)
} failBlock: { err in
self.arrInfoFillStep = []
self.informationFillStepModel = nil
callBackBlock(false,err)
}
}
//提交 温馨提示弹窗
func submitSweetNotifyOp( params:[String : Any],callBackBlock:@escaping (_ success: Bool,_ error:YHErrorModel?)->()) {
let strUrl = YHBaseUrlManager.shared.curURL() + YHAllApiName.Users.submitSweetNotifyApi
let _ = YHNetRequest.postRequest(url: strUrl,params: params) {json, code in
//1. json字符串 转 对象
guard let model = NetBaseModel.deserialize(dict: json) else {
let error : YHErrorModel = YHErrorModel(errorCode:YHErrorCode.dictParseError.rawValue,errorMsg: YHErrorCode.dictParseError.description())
callBackBlock(false,error)
return
}
printLog("model 是 ==> \(model)")
callBackBlock(true,nil)
} failBlock: { err in
callBackBlock(false,err)
}
}
} }
//其他方法 //其他方法
......
...@@ -20,13 +20,21 @@ class YHAllApiName { ...@@ -20,13 +20,21 @@ class YHAllApiName {
struct Order { struct Order {
//合同列表 //合同列表
static let contractListApi = "frontend/order/list" static let contractListApi = "frontend/order/list"
//合同填写进度 //合同填写进度
static let contractStatusApi = "frontend/order/progress" static let contractStatusApi = "frontend/order/progress"
//信息表的填写进度
static let informationStepApi = "frontend/order/information/step"
// 获取家庭成员信息 添加家庭成员也用这个 // 获取家庭成员信息 添加家庭成员也用这个
static let familyInfoApi = "frontend/order/information/family" static let familyInfoApi = "frontend/order/information/family"
// 删除家庭成员信息 // 删除家庭成员信息
static let familyMemberDeleteApi = "frontend/order/information/family/delete" static let familyMemberDeleteApi = "frontend/order/information/family/delete"
} }
//Users
struct Users {
//提交 温馨提示信息
static let submitSweetNotifyApi = "frontend/users/sweet-notify/submit"
}
} }
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