Commit 658b4bb3 authored by Steven杜宇's avatar Steven杜宇

Merge branch 'develop' of http://gitlab.galaxy-immi.com/mobile-group/galaxy-iOS into develop

parents 168f4cab d47f5cf3
......@@ -20,6 +20,8 @@ class YHOfficialApprovalResultVC: YHBaseViewController {
override func viewDidLoad() {
super.viewDidLoad()
setupUI()
getAlertStatus()
}
//背景
......@@ -133,9 +135,67 @@ class YHOfficialApprovalResultVC: YHBaseViewController {
}
}
lazy var princleVM : YHPrincleViewModel = {
let vm = YHPrincleViewModel()
return vm
}()
}
private extension YHOfficialApprovalResultVC {
//上报弹窗状态
func postAlertStatus(_ type : Int) {
princleVM.postAlertStatus(type) { success, error in
if success {
} else {
}
}
}
//获取弹窗状态
func getAlertStatus() {
princleVM.getPrincleStatus { success, error in
if success {
guard let model = self.princleVM.alertStatusModel else {
return
}
model.type = 1 //for test hjl
if model.type == 1 {
let now = Date()
let timestamp = now.timeIntervalSince1970
print("当前时间戳:\(timestamp)")
let offsetSecond = CGFloat(Int64(timestamp) - Int64(model.date))
var roundedUp = 0
if offsetSecond > 0 {
roundedUp = Int(ceil(offsetSecond / (24 * 60 * 60)))
printLog(roundedUp)
}
let view = YHOffivialApprovalSuccessCheckView.sheetView()
view.days = roundedUp
view.show()
view.block = { tag in
DispatchQueue.main.async {
self.postAlertStatus(6)
}
if tag == 0 {
//
self.clickRightItemBtn()
}
}
}
}
}
}
func setupUI() {
gk_navBarAlpha = 0.0
......@@ -275,12 +335,8 @@ private extension YHOfficialApprovalResultVC {
@objc func clickRightItemBtn() {
// let view = YHOffivialApprovalGuildLineCheckView.sheetView()
// view.show()
let view = YHOffivialApprovalSuccessCheckView.sheetView()
view.show()//for test hjl
let view = YHOffivialApprovalGuildLineCheckView.sheetView()
view.show()
}
}
......@@ -296,7 +352,7 @@ extension YHOfficialApprovalResultVC: FSPagerViewDataSource, FSPagerViewDelegate
let cell = pagerView.dequeueReusableCell(withReuseIdentifier: "cell", at: index) as! YHHomeBannerCollectionViewCell
if index < dataArr.count {
// cell.dataModel = dataArr[index]
cell.contentView.backgroundColor = .red//for test hjl
// cell.contentView.backgroundColor = .red//for test hjl
}
return cell
}
......
......@@ -12,6 +12,10 @@ import Lottie
import YYImage
class YHOffivialApprovalSuccessCheckView: UIView {
typealias Block = (Int) -> ()
var block: Block?
lazy var blackMaskView: UIView = {
let view = UIView()
view.backgroundColor = UIColor(hex: 0x0F1214, alpha: 0.6)
......@@ -96,6 +100,12 @@ class YHOffivialApprovalSuccessCheckView: UIView {
private var fullText: String = "恭喜您申请的【优秀人才入境计划】"
private var centerText: String = "已获得港府的正式批准!"
private var lastText: String = "从递交资料伊始,经历了235天,感谢您这一路以来对银河的信赖与包容!"
var days : Int = 0 {
didSet {
lastText = "从递交资料伊始,经历了" + String(days) + "天,感谢您这一路以来对银河的信赖与包容!"
}
}
}
extension YHOffivialApprovalSuccessCheckView {
......@@ -114,11 +124,12 @@ extension YHOffivialApprovalSuccessCheckView {
}
@objc func clickSureBtn() {
YHHUD.flash(message: "点击了 xx")
self.block?(0)
dismiss()
}
@objc func clickCloseBtn() {
self.block?(1)
dismiss()
}
}
......
......@@ -16,6 +16,17 @@ enum YHPrincipleWaitItemType: Int {
case profile = 3 // 申请资料已递交港府留档
}
// MARK: - Applicant
class YHPrincipleAlertStatusModel: SmartCodable {
var type: Int = 0 //1-展示正式批已获批弹窗 2-展示原则批已获批弹窗 0-不展示
var date: Int = 0 //正式批获批时间
required init() {
}
}
class YHPrincipleWaitResultModel: SmartCodable {
var lastQueryAt: String = ""
......
......@@ -14,10 +14,86 @@ class YHPrincleViewModel: YHBaseViewModel {
var waitResultModel = YHPrincipleWaitResultModel()
var envelopModel = YHPrincipleEnvelopeModel()
var uploadDetailModel = YHPrincipleUploadDetailModel()
//原则批、正式批弹窗状态
var alertStatusModel : YHPrincipleAlertStatusModel?
}
extension YHPrincleViewModel {
//上报弹窗状态
func postAlertStatus(_ type : Int, callback:((_ success: Bool, _ error:YHErrorModel?)->())?) {
var params: [String : Any] = [:]
if type == 14 {
//IdentifyPrincipleApprovalCongratulation = 14 // 原则批获批祝贺弹窗
params = ["IdentifyPrincipleApprovalCongratulation":14]
} else if type == 6 {
//IdentifyApprovalCongratulation = 6 // 赴港获批祝贺弹窗 - 正式批
params = ["IdentifyApprovalCongratulation":6]
} else if type == 2 {
//IdentifyGetHKAcceptOperateGuid = 2 // 香港身份获批操作指引
params = ["IdentifyGetHKAcceptOperateGuid":2]
} else {
return
}
let strUrl = YHBaseUrlManager.shared.curURL() + YHAllApiName.Principle.postAlertStatusApi
let _ = YHNetRequest.postRequest(url: strUrl, params: params) {
json, code in
//1. json字符串 转 对象
printLog("model 是 ==> \(json)")
if json.code == 200 {
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 getPrincleStatus(callback:((_ success: Bool,_ error:YHErrorModel?)->())?) {
let strUrl = YHBaseUrlManager.shared.curURL() + YHAllApiName.Principle.getAlertStatusApi
let _ = YHNetRequest.getRequest(url: strUrl) { [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 = YHPrincipleAlertStatusModel.deserialize(dict: dic as? [AnyHashable : Any]) else {
let err = YHErrorModel(errorCode: YHErrorCode.dictParseError.rawValue, errorMsg: YHErrorCode.dictParseError.description())
callback?(false, err)
return
}
self.alertStatusModel = 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 getPrincipleWaitReviewResult(params:[String : Any], callback:((_ success: Bool,_ error:YHErrorModel?)->())?) {
let strUrl = YHBaseUrlManager.shared.curURL() + YHAllApiName.Principle.getProfileList
......
......@@ -378,6 +378,11 @@ class YHAllApiName {
}
struct Principle {
//上报原则批弹窗已展示
static let postAlertStatusApi = "super-app/common/agreement/add"
//原则批弹窗状态
static let getAlertStatusApi = "super-app/home/agreement-check"
// 原则批审批结果
static let getReviewResult = "super-app/order/approval/principle"
// 获取档案号列表
......
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