Преглед изворни кода

【会员系统】DMG转档引导按钮检测是否登录

wanjun пре 2 дана
родитељ
комит
2e8605d2a3

+ 17 - 4
PDF Office/PDF Master/Class/GuideInfo/Controllers/FunctionGuide/KMConvertGuideView.swift

@@ -184,11 +184,24 @@ class KMConvertGuideView: NSView, NibLoadable {
     }
     
     @IBAction func convertAction(_ sender: Any) {
-        guard let callBack = self.clickHandle else {
-            return
+        if KMMemberInfo.shared.isLogin {
+            guard let callBack = self.clickHandle else {
+                return
+            }
+            callBack(self, .purchase)
+            FMTrackEventManager.defaultManager.trackOnceEvent(event: "PUW", withProperties: ["PUW_Btn":"Btn_PUW_StartGuideConvert_Buy"])
+        } else {
+            KMLoginWindowsController.shared.openWindow() { [weak self] success in
+                guard let self = self else { return }
+                if success {
+                    guard let callBack = self.clickHandle else {
+                        return
+                    }
+                    callBack(self, .purchase)
+                    FMTrackEventManager.defaultManager.trackOnceEvent(event: "PUW", withProperties: ["PUW_Btn":"Btn_PUW_StartGuideConvert_Buy"])
+                }
+            }
         }
-        callBack(self, .purchase)
-        FMTrackEventManager.defaultManager.trackOnceEvent(event: "PUW", withProperties: ["PUW_Btn":"Btn_PUW_StartGuideConvert_Buy"])
     }
     
     @objc func themeChange() {