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

完成 正式批逻辑

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