Commit 473e6fae authored by pete谢兆麟's avatar pete谢兆麟

delink 逻辑

parent 99d8b319
...@@ -153,10 +153,25 @@ class AppDelegate: UIResponder, UIApplicationDelegate, WXApiDelegate { ...@@ -153,10 +153,25 @@ class AppDelegate: UIResponder, UIApplicationDelegate, WXApiDelegate {
printLog("需要登录") printLog("需要登录")
return return
} }
let surveyViewModel = YHSurveyViewModel()
// 跳转分析 // 跳转分析
surveyViewModel.getRenewalPlanGenerated { state, error in
guard let state = state else {
if let msg = error?.errorMsg, !msg.isEmpty {
YHHUD.flash(message: msg)
}
return
}
if state.isGeneratePlan == true {
let vc = YHPlanViewController()
UIViewController.current?.navigationController?.pushViewController(vc)
} else {
let vc = YHCustomerInformationQuestionnaireVC()
UIViewController.current?.navigationController?.pushViewController(vc)
}
}
} }
} else if iType == 6 { } else if iType == 6 {
// 跳转方案商品 // 跳转方案商品
DispatchQueue.main.asyncAfter(deadline: .now() + 0.25) { DispatchQueue.main.asyncAfter(deadline: .now() + 0.25) {
// - 获取它对应的参数 // - 获取它对应的参数
...@@ -164,11 +179,24 @@ class AppDelegate: UIResponder, UIApplicationDelegate, WXApiDelegate { ...@@ -164,11 +179,24 @@ class AppDelegate: UIResponder, UIApplicationDelegate, WXApiDelegate {
printLog("需要登录") printLog("需要登录")
return return
} }
let surveyViewModel = YHSurveyViewModel()
let vc = YHMakePlanViewController() surveyViewModel.getRenewalPlanGenerated { state, error in
UIViewController.current?.navigationController?.pushViewController(vc, animated: true) guard let state = state else {
if let msg = error?.errorMsg, !msg.isEmpty {
YHHUD.flash(message: msg)
}
return
}
if state.isGeneratePlan == true {
let vc = YHMakePlanViewController()
UIViewController.current?.navigationController?.pushViewController(vc, animated: true)
} else {
let vc = YHCustomerInformationQuestionnaireVC()
UIViewController.current?.navigationController?.pushViewController(vc)
}
}
} }
} else { } else {
printLog("未处理的类型 \(iType)") printLog("未处理的类型 \(iType)")
} }
} }
......
...@@ -15,9 +15,10 @@ class YHMakePlanCardView: UIView { ...@@ -15,9 +15,10 @@ class YHMakePlanCardView: UIView {
// MARK: - UI Elements // MARK: - UI Elements
var data: YHMakePlanMainModel? var data: YHMakePlanMainModel?
private lazy var containerView: UIView = { private lazy var containerView: UIButton = {
let view = UIView() let view = UIButton()
view.backgroundColor = .white view.backgroundColor = .white
view.addTarget(self, action: #selector(gotoDetail), for: .touchUpInside)
return view return view
}() }()
...@@ -136,6 +137,33 @@ class YHMakePlanCardView: UIView { ...@@ -136,6 +137,33 @@ class YHMakePlanCardView: UIView {
} }
@objc func gotoDetail() {
var url = YHBaseUrlManager.shared.curH5URL() + "superAppBridge.html#/goods/sales-detail" + "?id=\(self.data?.product_id ?? 0)" + "&source=renewal_customize"
if YHLoginManager.shared.isLogin() {
let token = YHLoginManager.shared.h5Token
let urlHasParam = String.hasQueryParameters(urlString: url)
if urlHasParam {
url = url + "&param=" + token
} else {
url = url + "?param=" + token
}
}
// 2.增加导航栏高度 https://test-hklife.galaxy-immi.com/superAppBridge.html#/goods/sales-detail?id=
var tUrl = url
if !url.contains("navigationH=") {
tUrl = url + "?navigationH=\(k_Height_NavigationtBarAndStatuBar)"
if url.contains("?") {
tUrl = url + "&navigationH=\(k_Height_NavigationtBarAndStatuBar)"
}
}
let vc = YHH5WebViewVC()
vc.url = tUrl
vc.isHideNavigationBar = false
UIViewController.current?.navigationController?.pushViewController(vc)
}
@objc func selectAction() { @objc func selectAction() {
YHMakePlanSelectAlertView.show(dataSource: data ?? YHMakePlanMainModel()) { tag in YHMakePlanSelectAlertView.show(dataSource: data ?? YHMakePlanMainModel()) { tag in
self.actionHandler?(tag) self.actionHandler?(tag)
......
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