瀏覽代碼

【综合】登陆窗口埋点补充

tangchao 3 月之前
父節點
當前提交
90f64a6f34

+ 10 - 0
PDF Office/PDF Master/MemberCenter/View/KMSignUpView.swift

@@ -100,6 +100,10 @@ class KMSignUpView: KMBaseXibView {
         return attributedString
     }()
     
+    var sendCodeBlock: KMCommonBlock?
+    var signInBlock: KMCommonBlock?
+    var signFinishBlock: KMCommonBlock?
+    
     convenience init(model: KMSignUpViewModel, superView: NSView) {
         self.init(frame: superView.bounds)
         viewModel = model
@@ -246,6 +250,8 @@ class KMSignUpView: KMBaseXibView {
             if downEntered {
                 self.sendBox.fillColor = NSColor(named: "273C62_0.4") ?? NSColor.blue
                 self.viewModel.countDown(type: .login, callback: nil)
+                
+                self.sendCodeBlock?()
             }
         }
     }
@@ -502,6 +508,8 @@ class KMSignUpView: KMBaseXibView {
     @IBAction func signUpAction(_ sender: NSButton) {
         self.window?.makeFirstResponder(nil)
         
+        signInBlock?(viewModel.signUpState)
+        
         viewModel.emailErrorMessage = ""
         viewModel.passwordErrorMessage = ""
         
@@ -509,6 +517,8 @@ class KMSignUpView: KMBaseXibView {
         viewModel.signUpAction { [weak self] result, _ in
             self?.window?.hideWaitingView()
             
+            self?.signFinishBlock?(self?.viewModel.signUpState as Any ,result as Any)
+            
 #if VERSION_DMG
             if result == nil || result == false {
                 return

+ 52 - 1
PDF Office/PDF Master/MemberCenter/WindowsController/KMLoginWindowsController.swift

@@ -34,7 +34,6 @@ class KMLoginWindowsController: NSWindowController {
         return windowC
     }()
 
-
     override func windowDidLoad() {
         super.windowDidLoad()
 
@@ -51,11 +50,17 @@ class KMLoginWindowsController: NSWindowController {
         NotificationCenter.default.addObserver(self, selector: #selector(logoutSuccessNotification), name: NSNotification.Name(rawValue: "MemberCenterLogoutSuccess"), object: nil)
         
         rightBox.addObserver(self, forKeyPath: "contentView", options: [.new, .old], context: nil)
+        
+        let closeButton = window?.standardWindowButton(.closeButton)
+        closeButton?.target = self
+        closeButton?.action = #selector(closeAction)
     }
     
     override func showWindow(_ sender: Any?) {
         super.showWindow(sender)
         
+        _trackSignInEvent(params: ["Exposure" : "Exposure_Signin"])
+        
         loginResult = nil
         
         initializeUI()
@@ -82,6 +87,35 @@ class KMLoginWindowsController: NSWindowController {
             signUpView.frame = rightBox.frame
             rightBox.contentView = signUpView
             rightBox.fillColor = NSColor(named: "membercentercolor") ?? NSColor.white
+            
+            signUpView.sendCodeBlock = { [weak self] _ in
+                self?._trackSignInEvent(params: ["Btn" : "Btn_SendCode"])
+            }
+            signUpView.signInBlock = { [weak self] params in
+                let state = params.first as? KMSignUpState
+                if state == .password {
+                    
+                } else if state == .verificationCode {
+                    self?._trackSignInEvent(params: ["Btn" : "Btn_Code_Signin"])
+                }
+            }
+            signUpView.signFinishBlock = { [weak self] params in
+                let state = params.first as? KMSignUpState
+                let result = params.last as? Bool ?? false
+                if state == .password {
+                    if result {
+                        self?._trackSignInEvent(params: ["Btn" : "Btn_Password_SigninSuccess"])
+                    } else {
+                        self?._trackSignInEvent(params: ["Btn" : "Btn_Password_SigninFail"])
+                    }
+                } else if state == .verificationCode {
+                    if result {
+                        self?._trackSignInEvent(params: ["Btn" : "Btn_Code_SigninSuccess"])
+                    } else {
+                        self?._trackSignInEvent(params: ["Btn" : "Btn_Code_SigninFail"])
+                    }
+                }
+            }
         }
     }
     
@@ -126,6 +160,15 @@ class KMLoginWindowsController: NSWindowController {
         }
     }
     
+    private func _trackSignInEvent(params: [String : String]) {
+#if VERSION_FREE
+#if VERSION_DMG
+#else
+        FMTrackEventManager.defaultManager.trackEvent(event: "Signin", withProperties: params)
+#endif
+#endif
+    }
+    
     // MARK: public Action
     
     @objc func loginSuccessNotification() -> Void {
@@ -144,6 +187,14 @@ class KMLoginWindowsController: NSWindowController {
         loginResult = complete
     }
     
+    // MARK: - Actions
+    
+    @objc func closeAction() {
+        _trackSignInEvent(params: ["Btn" : "Btn_SigninCancel"])
+        
+        self.window?.close()
+    }
+    
     // MARK: Bind Method
     
     func bindViewModel() -> Void {

+ 0 - 8
PDF Office/PDF Reader Pro.xcodeproj/project.pbxproj

@@ -16,9 +16,6 @@
 		037A787F2CE9FEC400B025FE /* KMProductCompareWC.xib in Resources */ = {isa = PBXBuildFile; fileRef = 037A787E2CE9FEC400B025FE /* KMProductCompareWC.xib */; };
 		037A78802CE9FEC400B025FE /* KMProductCompareWC.xib in Resources */ = {isa = PBXBuildFile; fileRef = 037A787E2CE9FEC400B025FE /* KMProductCompareWC.xib */; };
 		037A78812CE9FEC400B025FE /* KMProductCompareWC.xib in Resources */ = {isa = PBXBuildFile; fileRef = 037A787E2CE9FEC400B025FE /* KMProductCompareWC.xib */; };
-		037A78832CE9FEED00B025FE /* AIConfigWindowController.xib in Resources */ = {isa = PBXBuildFile; fileRef = 037A78822CE9FEED00B025FE /* AIConfigWindowController.xib */; };
-		037A78842CE9FEED00B025FE /* AIConfigWindowController.xib in Resources */ = {isa = PBXBuildFile; fileRef = 037A78822CE9FEED00B025FE /* AIConfigWindowController.xib */; };
-		037A78852CE9FEED00B025FE /* AIConfigWindowController.xib in Resources */ = {isa = PBXBuildFile; fileRef = 037A78822CE9FEED00B025FE /* AIConfigWindowController.xib */; };
 		651A59822C8EA20F005A35FB /* KMPurchaseEmbeddedWindowController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9F3A48C32C8017FA0047F565 /* KMPurchaseEmbeddedWindowController.swift */; };
 		651A59832C8EA210005A35FB /* KMPurchaseEmbeddedWindowController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9F3A48C32C8017FA0047F565 /* KMPurchaseEmbeddedWindowController.swift */; };
 		652E953D2C6670CE0061FA40 /* KMFreehandAnnotationController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 652E953C2C6670CE0061FA40 /* KMFreehandAnnotationController.swift */; };
@@ -5783,7 +5780,6 @@
 		03063B5B2CE3908C006DB603 /* KMMemberCenterWindowController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = KMMemberCenterWindowController.swift; sourceTree = "<group>"; };
 		03063B5C2CE3908C006DB603 /* KMMemberCenterWindowController.xib */ = {isa = PBXFileReference; lastKnownFileType = file.xib; path = KMMemberCenterWindowController.xib; sourceTree = "<group>"; };
 		037A787E2CE9FEC400B025FE /* KMProductCompareWC.xib */ = {isa = PBXFileReference; lastKnownFileType = file.xib; path = KMProductCompareWC.xib; sourceTree = "<group>"; };
-		037A78822CE9FEED00B025FE /* AIConfigWindowController.xib */ = {isa = PBXFileReference; lastKnownFileType = file.xib; path = AIConfigWindowController.xib; sourceTree = "<group>"; };
 		652E953C2C6670CE0061FA40 /* KMFreehandAnnotationController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = KMFreehandAnnotationController.swift; sourceTree = "<group>"; };
 		652E95412C6913C20061FA40 /* KMLineAndBorderItemView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = KMLineAndBorderItemView.swift; sourceTree = "<group>"; };
 		652E95512C6914770061FA40 /* KMLineAndBorderItemView.xib */ = {isa = PBXFileReference; lastKnownFileType = file.xib; path = KMLineAndBorderItemView.xib; sourceTree = "<group>"; };
@@ -11875,7 +11871,6 @@
 			children = (
 				653F389E2CE9FDF1009E97B2 /* AIConfigWindowController.xib */,
 				BB0FE0222B734DD1001E0F88 /* AIConfigWindowController.swift */,
-				037A78822CE9FEED00B025FE /* AIConfigWindowController.xib */,
 				BBB789632BE8BF2300F7E09C /* AINewConfigWindowController.swift */,
 				BBB789602BE8BF2300F7E09C /* AINewConfigWindowController.xib */,
 				BBB789612BE8BF2300F7E09C /* AIChatInfoManager */,
@@ -15327,7 +15322,6 @@
 				AD1CA4032A06040B0070541F /* KMAnnotationScreenCollectionView.xib in Resources */,
 				BB8F455A295AA1270037EA22 /* KMHeaderFooterPropertyInfoController.xib in Resources */,
 				BB8810AC2B4F7D7500AFA63E /* KMVerificationViewController.xib in Resources */,
-				037A78852CE9FEED00B025FE /* AIConfigWindowController.xib in Resources */,
 				BBB376A42B10A7FD009539CC /* a_4b.png in Resources */,
 				BB853C952AF8DCC7009C20C1 /* KMBatchOperateRemovePasswordViewController.xib in Resources */,
 				BB52372A29C313CA00663BD7 /* KMAnnotationPropertyBaseController.xib in Resources */,
@@ -15916,7 +15910,6 @@
 				BBAFC8402985194800D0648E /* KMPDFEditAppendWindow.xib in Resources */,
 				BBFDFAA32AF3815C00E08AA2 /* KMTextHintWindowController.xib in Resources */,
 				BB031B7F2C47BB090099F7AD /* KMUserListItemCellView.xib in Resources */,
-				037A78842CE9FEED00B025FE /* AIConfigWindowController.xib in Resources */,
 				F3B7DF9E2948565000333201 /* CPDFListHoverAnnotationViewController.xib in Resources */,
 				BBADCF592AF3C7B3004ECE0C /* KMBatchOperateAddWatermarkViewController.xib in Resources */,
 				BB1B0AF02B4FC6E900889528 /* KMFunctionGuideNameItemView.xib in Resources */,
@@ -16366,7 +16359,6 @@
 				89E4E7432964160F002DBA6F /* KMAnnotationLinkViewController.xib in Resources */,
 				ADBC373929CA975B00D93208 /* KMCompatative.xcassets in Resources */,
 				BBB376A02B10A7FD009539CC /* a_4a.png in Resources */,
-				037A78832CE9FEED00B025FE /* AIConfigWindowController.xib in Resources */,
 				ADD5AE5B2A64DD2600C14249 /* KMPurchaseAlertView.xib in Resources */,
 				BB8F454C295A9CDC0037EA22 /* KMHeaderFooterListController.xib in Resources */,
 				AD0FA51029A9E75000EDEB50 /* KMLoginInputPasswordView.xib in Resources */,