Commit 9dbd1e60 authored by David黄金龙's avatar David黄金龙

完成 正式批逻辑

parent db52c346
...@@ -83,7 +83,9 @@ class YHHomeHoldViewPageViewController: YHBaseViewController { ...@@ -83,7 +83,9 @@ class YHHomeHoldViewPageViewController: YHBaseViewController {
homePageVC.requestOrder() homePageVC.requestOrder()
} }
getUatRules() DispatchQueue.main.async {
self.getAlertStatus()
}
} }
override func viewWillDisappear(_ animated: Bool) { override func viewWillDisappear(_ animated: Bool) {
...@@ -120,11 +122,77 @@ class YHHomeHoldViewPageViewController: YHBaseViewController { ...@@ -120,11 +122,77 @@ class YHHomeHoldViewPageViewController: YHBaseViewController {
let vm = YHMsgViewModel() let vm = YHMsgViewModel()
return vm return vm
}() }()
lazy var princleVM : YHPrincleViewModel = {
let vm = YHPrincleViewModel()
return vm
}()
} }
//MARK: - 内部函数 //MARK: - 内部函数
extension YHHomeHoldViewPageViewController { extension YHHomeHoldViewPageViewController {
//获取原则批、正式批的弹窗状态
func getAlertStatus() {
if !YHLoginManager.shared.isLogin() {
return
}
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)
self.princleVM.postAlertStatus(6) { success, error in
}
}
if tag == 0 {
//跳转 正式批结果页面
//正式批已获批~
let vc = YHOfficialApprovalResultVC()
vc.showGuildViewFlag = true
self.navigationController?.pushViewController(vc)
}
}
} else if model.type == 2 {
//原则批弹窗
}
}
}
}
func getUatRules() { func getUatRules() {
DispatchQueue.global().async { DispatchQueue.global().async {
//灰度规则配置 //灰度规则配置
......
...@@ -133,6 +133,10 @@ class YHOfficialApprovalResultVC: YHBaseViewController { ...@@ -133,6 +133,10 @@ class YHOfficialApprovalResultVC: YHBaseViewController {
}() }()
//
var showGuildViewFlag : Bool = false
override func viewDidLoad() { override func viewDidLoad() {
super.viewDidLoad() super.viewDidLoad()
...@@ -140,6 +144,10 @@ class YHOfficialApprovalResultVC: YHBaseViewController { ...@@ -140,6 +144,10 @@ class YHOfficialApprovalResultVC: YHBaseViewController {
getAlertStatus() getAlertStatus()
getOfficalGuildCheckStatus() getOfficalGuildCheckStatus()
if showGuildViewFlag {
clickRightItemBtn()
}
} }
} }
...@@ -164,7 +172,7 @@ private extension YHOfficialApprovalResultVC { ...@@ -164,7 +172,7 @@ private extension YHOfficialApprovalResultVC {
} }
} }
//获取弹窗状态 //获取原则批、正式批的弹窗状态
func getAlertStatus() { func getAlertStatus() {
princleVM.getPrincleStatus { success, error in princleVM.getPrincleStatus { success, error in
if success { if success {
...@@ -172,10 +180,7 @@ private extension YHOfficialApprovalResultVC { ...@@ -172,10 +180,7 @@ private extension YHOfficialApprovalResultVC {
return return
} }
model.type = 1 //for test hjl
if model.type == 1 { if model.type == 1 {
let now = Date() let now = Date()
let timestamp = now.timeIntervalSince1970 let timestamp = now.timeIntervalSince1970
print("当前时间戳:\(timestamp)") print("当前时间戳:\(timestamp)")
...@@ -198,7 +203,6 @@ private extension YHOfficialApprovalResultVC { ...@@ -198,7 +203,6 @@ private extension YHOfficialApprovalResultVC {
} }
if tag == 0 { if tag == 0 {
//
self.clickRightItemBtn() self.clickRightItemBtn()
} }
} }
......
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