Commit 2e91a52f authored by Steven杜宇's avatar Steven杜宇

// 预约接口

parent 2d5b2929
......@@ -72,6 +72,8 @@
04256E172C75BD2700A37BA4 /* YHVisaPaymentTipsCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = 04256E0A2C75BD2400A37BA4 /* YHVisaPaymentTipsCell.swift */; };
04256E182C75BD2700A37BA4 /* YHVisaPayTypeCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = 04256E0B2C75BD2400A37BA4 /* YHVisaPayTypeCell.swift */; };
04256E192C75BD2700A37BA4 /* YHUploadCertificateViewModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = 04256E0D2C75BD2400A37BA4 /* YHUploadCertificateViewModel.swift */; };
04256E1B2C75C60C00A37BA4 /* YHHKMemberModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = 04256E1A2C75C60C00A37BA4 /* YHHKMemberModel.swift */; };
04256E1D2C75C74200A37BA4 /* YHAppointHKResultModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = 04256E1C2C75C74200A37BA4 /* YHAppointHKResultModel.swift */; };
0425E63D2BA9345200A5E763 /* YHSchemeTableViewCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0425E63C2BA9345200A5E763 /* YHSchemeTableViewCell.swift */; };
0425E6402BA9357D00A5E763 /* YHScemeItemModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0425E63F2BA9357D00A5E763 /* YHScemeItemModel.swift */; };
0425E6422BA95B1B00A5E763 /* YHSchemeTableFooterView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0425E6412BA95B1B00A5E763 /* YHSchemeTableFooterView.swift */; };
......@@ -796,6 +798,8 @@
04256E0A2C75BD2400A37BA4 /* YHVisaPaymentTipsCell.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = YHVisaPaymentTipsCell.swift; sourceTree = "<group>"; };
04256E0B2C75BD2400A37BA4 /* YHVisaPayTypeCell.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = YHVisaPayTypeCell.swift; sourceTree = "<group>"; };
04256E0D2C75BD2400A37BA4 /* YHUploadCertificateViewModel.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = YHUploadCertificateViewModel.swift; sourceTree = "<group>"; };
04256E1A2C75C60C00A37BA4 /* YHHKMemberModel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YHHKMemberModel.swift; sourceTree = "<group>"; };
04256E1C2C75C74200A37BA4 /* YHAppointHKResultModel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YHAppointHKResultModel.swift; sourceTree = "<group>"; };
0425E63C2BA9345200A5E763 /* YHSchemeTableViewCell.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YHSchemeTableViewCell.swift; sourceTree = "<group>"; };
0425E63F2BA9357D00A5E763 /* YHScemeItemModel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YHScemeItemModel.swift; sourceTree = "<group>"; };
0425E6412BA95B1B00A5E763 /* YHSchemeTableFooterView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YHSchemeTableFooterView.swift; sourceTree = "<group>"; };
......@@ -1596,6 +1600,8 @@
04256DD92C72D9F800A37BA4 /* M */ = {
isa = PBXGroup;
children = (
04256E1A2C75C60C00A37BA4 /* YHHKMemberModel.swift */,
04256E1C2C75C74200A37BA4 /* YHAppointHKResultModel.swift */,
);
path = M;
sourceTree = "<group>";
......@@ -4361,6 +4367,7 @@
0430E6682C749128000511E2 /* YHAdopterChinaViewController.swift in Sources */,
045EEE9F2B9F171A0022A143 /* YHWorkExperienceModel.swift in Sources */,
A5FF0F3C2C32F2460069852B /* YHActivityDetailCell1.swift in Sources */,
04256E1B2C75C60C00A37BA4 /* YHHKMemberModel.swift in Sources */,
045EEF232B9F171A0022A143 /* YHItemView.swift in Sources */,
04256E192C75BD2700A37BA4 /* YHUploadCertificateViewModel.swift in Sources */,
04754A952B96FF3D00F8ADCA /* UITextField+Extension.swift in Sources */,
......@@ -4387,6 +4394,7 @@
044413FF2BC391F000784A14 /* YHServiceListViewController.swift in Sources */,
0493B3DC2BA7EFE600AF9393 /* YHCertificateSearchViewController.swift in Sources */,
0430E65A2C7436CD000511E2 /* YHAdopterNewPeopleViewModel.swift in Sources */,
04256E1D2C75C74200A37BA4 /* YHAppointHKResultModel.swift in Sources */,
04CE1ADB2C2AD91F001CB80A /* YHActivityTitleItemView.swift in Sources */,
A5FD63BF2B6250BC00D1D9DA /* YHInformationPerfectCell.swift in Sources */,
045EEE942B9F171A0022A143 /* YHPreviewInfoQuestionAndAnswerItemView.swift in Sources */,
......
//
// YHAppointHKResultModel.swift
// galaxy
//
// Created by edy on 2024/8/21.
// Copyright © 2024 https://www.galaxy-immi.com. All rights reserved.
//
import UIKit
import SmartCodable
class YHAppointHKResultModel: SmartCodable {
var waiting: [YHAppointMemberGroupModel] = []
var success: [YHAppointMemberGroupModel] = []
enum CodingKeys: String, CodingKey {
case waiting = "waiting"
case success = "success"
}
required init() {
}
init(waiting: [YHAppointMemberGroupModel], success: [YHAppointMemberGroupModel]) {
self.waiting = waiting
self.success = success
}
}
class YHAppointMemberGroupModel: SmartCodable {
var id: Int = 0
var orderid: Int = 0
var userList: [YHAppointMemberModel] = []
var wantMinTime: String = ""
var wantMaxTime: String = ""
var wantImmigrationOffice: String = ""
var goTime: String = ""
var receipts: [String] = []
var submitTime: String = ""
enum CodingKeys: String, CodingKey {
case id = "id"
case orderid = "order_id"
case userList = "user_list"
case wantMinTime = "want_min_time"
case wantMaxTime = "want_max_time"
case wantImmigrationOffice = "want_immigration_office"
case goTime = "go_time"
case receipts = "receipts"
case submitTime = "submit_time"
}
required init() {
}
init(id: Int, orderid: Int, userList: [YHAppointMemberModel], wantMinTime: String, wantMaxTime: String, wantImmigrationOffice: String, goTime: String, receipts: [String], submitTime: String) {
self.id = id
self.orderid = orderid
self.userList = userList
self.wantMinTime = wantMinTime
self.wantMaxTime = wantMaxTime
self.wantImmigrationOffice = wantImmigrationOffice
self.goTime = goTime
self.receipts = receipts
self.submitTime = submitTime
}
}
// MARK: - UserList
class YHAppointMemberModel: SmartCodable {
var id: Int = 0
var name: String = ""
var type: String = ""
var fileNum: String = ""
var birthday: String = ""
var isCheck: Int = 0
var url: String = ""
var approvalDate: String = ""
var relation: String = ""
enum CodingKeys: String, CodingKey {
case id = "id"
case name = "name"
case type = "type"
case fileNum = "file_num"
case birthday = "birthday"
case isCheck = "is_check"
case url = "url"
case approvalDate = "approval_date"
case relation = "relation"
}
required init() {
}
init(id: Int, name: String, type: String, fileNum: String, birthday: String, isCheck: Int, url: String, approvalDate: String, relation: String) {
self.id = id
self.name = name
self.type = type
self.fileNum = fileNum
self.birthday = birthday
self.isCheck = isCheck
self.url = url
self.approvalDate = approvalDate
self.relation = relation
}
}
//
// YHHKMemberModel.swift
// galaxy
//
// Created by edy on 2024/8/21.
// Copyright © 2024 https://www.galaxy-immi.com. All rights reserved.
//
import UIKit
import SmartCodable
class YHHKMemberModel: SmartCodable {
var id: Int = 0
var name: String = ""
var type: String = ""
var fileNum: String = ""
var birthday: String = ""
var isCheck: Int = 0
var url: String = ""
var approvalDate: String = ""
enum CodingKeys: String, CodingKey {
case id = "id"
case name = "name"
case type = "type"
case fileNum = "file_num"
case birthday = "birthday"
case isCheck = "is_check"
case url = "url"
case approvalDate = "approval_date"
}
required init() {
}
init(id: Int, name: String, type: String, fileNum: String, birthday: String, isCheck: Int, url: String, approvalDate: String) {
self.id = id
self.name = name
self.type = type
self.fileNum = fileNum
self.birthday = birthday
self.isCheck = isCheck
self.url = url
self.approvalDate = approvalDate
}
}
......@@ -10,10 +10,13 @@ import UIKit
class YHCerAppointViewModel: NSObject {
var serviceArr:[YHServiceItem] = []
var serviceArr: [YHServiceItem] = []
var hkUsers: [YHHKMemberModel] = []
var appointResult: YHAppointHKResultModel = YHAppointHKResultModel()
// 获取香港服务列表
func getServicelist(_ callBack: @escaping (_ success: Bool,_ error: YHErrorModel?)->()) {
let strUrl = YHBaseUrlManager.shared.curURL() + YHAllApiName.MakeCertificate.servicelist
let _ = YHNetRequest.getRequest(url: strUrl) {
[weak self] json, code in
......@@ -48,4 +51,128 @@ class YHCerAppointViewModel: NSObject {
callBack(false, err)
}
}
// 所有赴港人员列表
func getGoHKFamilyMembers(orderId: Int, callback:((_ success: Bool, _ error: YHErrorModel?)->())?) {
let strUrl = YHBaseUrlManager.shared.curURL() + YHAllApiName.AppointHK.hkMembers
let _ = YHNetRequest.getRequest(url: strUrl,params: ["order_id" : orderId]) { [weak self] json, code in
//1. json字符串 转 对象
guard let self = self else { return }
printLog("model 是 ==> \(json)")
if json.code == 200 {
let dic = json.data
guard let arr = [YHHKMemberModel].deserialize(array: dic as? [Any]) else {
let err = YHErrorModel(errorCode: YHErrorCode.dictParseError.rawValue, errorMsg: YHErrorCode.dictParseError.description())
self.hkUsers = []
callback?(false, err)
return
}
self.hkUsers.removeAll()
for user in arr {
if let user = user {
self.hkUsers.append(user)
}
}
callback?(true, nil)
} else {
let err = YHErrorModel(errorCode: Int32(json.code), errorMsg: json.msg.isEmpty ? "" : json.msg)
self.hkUsers = []
callback?(false, err)
}
} failBlock: { err in
self.hkUsers = []
callback?(false, err)
}
}
// 获取港府预约结果
func getAppointResult(orderId: Int, callback:((_ success: Bool, _ error: YHErrorModel?)->())?) {
let strUrl = YHBaseUrlManager.shared.curURL() + YHAllApiName.AppointHK.appointResult
let _ = YHNetRequest.getRequest(url: strUrl,params: ["order_id" : orderId]) { [weak self] json, code in
//1. json字符串 转 对象
guard let self = self else { return }
printLog("model 是 ==> \(json)")
if json.code == 200 {
let dic = json.data
guard let resultModel = YHAppointHKResultModel.deserialize(dict: dic as? [AnyHashable : Any]) else {
let err = YHErrorModel(errorCode: YHErrorCode.dictParseError.rawValue, errorMsg: YHErrorCode.dictParseError.description())
callback?(false, err)
return
}
self.appointResult = resultModel
callback?(true, nil)
} else {
let err = YHErrorModel(errorCode: Int32(json.code), errorMsg: json.msg.isEmpty ? "" : json.msg)
callback?(false, err)
}
} failBlock: { err in
callback?(false, err)
}
}
// 是否需要赴港
func getIsNeedGoToHK(orderId: Int, callback:((_ needGoHK: Int)->())?) {
// 1需要赴港 0不需要 2没有选择
let strUrl = YHBaseUrlManager.shared.curURL() + YHAllApiName.AppointHK.isNeedGoHK
let _ = YHNetRequest.postRequest(url: strUrl,params: ["order_id" : orderId]) {
[weak self] json, code in
guard let self = self else { return }
printLog("model 是 ==> \(json)")
if json.code == 200 {
//
} else {
let err = YHErrorModel(errorCode: Int32(json.code), errorMsg: json.msg.isEmpty ? "" : json.msg)
callback?(2)
}
} failBlock: { err in
callback?(2)
}
}
// 保存是否需要赴港
func saveNeedGoHK(orderId: Int, need: Bool, callback:((_ success: Bool)->())?) {
// is_need_to_hk 是否需要赴港 1需要 0不需要
let strUrl = YHBaseUrlManager.shared.curURL() + YHAllApiName.AppointHK.saveNeedGoHK
let _ = YHNetRequest.postRequest(url: strUrl,params: ["order_id" : orderId]) {
[weak self] json, code in
guard let self = self else { return }
printLog("model 是 ==> \(json)")
if json.code == 200 {
callback?(true)
} else {
let err = YHErrorModel(errorCode: Int32(json.code), errorMsg: json.msg.isEmpty ? "" : json.msg)
callback?(false)
}
} failBlock: { err in
callback?(false)
}
}
}
......@@ -17,7 +17,7 @@ class YHFamilyMemberInfoCell: UITableViewCell {
self.nameLabel.text = model.info.name
self.pinyinLabel.text = "\(model.info.familyName) \(model.info.givenName)"
self.statusLabel.text = model.confirmStatus == 1 ? "已确认" : "待核对"
let textColor: UIColor = model.confirmStatus == 1 ? .brandMainColor : .init(hex: 0x3CC694)
let textColor: UIColor = model.confirmStatus == 1 ? .init(hex: 0x3CC694) : .brandMainColor
self.statusLabel.textColor = textColor
let img = UIImage(named: "family_info_status_arrow")?.withRenderingMode(.alwaysTemplate)
......
......@@ -427,4 +427,16 @@ class YHAllApiName {
}
struct AppointHK {
// 所有赴港人员列表
static let hkMembers = "super-app/order/hk/user"
// 获取港府预约结果
static let appointResult = "super-app/order/hk/reservation"
// 是否需要赴港
static let isNeedGoHK = "super-app/order/hk/get-need-to-hk"
// 保存是否需要赴港
static let saveNeedGoHK = "super-app/order/hk/save-need-to-hk"
}
}
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