JLChen
2021-05-18 a869383e163a18cdedcf587383c1eca043129754
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
//
//  Copyright © 2018年 Zhejiang Dahua Technology Co.,Ltd. All rights reserved.
//    WIFI配置:设备指示灯检查
 
import UIKit
 
class DHDeviceLightCheckViewController: DHGuideBaseViewController {
 
    override func viewDidLoad() {
        super.viewDidLoad()
        self.baseAddOMSIntroductionObserver()
        self.ajustConstraints()
        
 
    }
 
    override func didReceiveMemoryWarning() {
        super.didReceiveMemoryWarning()
        // Dispose of any resources that can be recreated.
    }
    
    private func ajustConstraints() {
        if dh_screenHeight < 667 {
            guideView.updateTopImageViewConstraint(top: 20, width: 210, maxHeight: 210)
            guideView.updateContentLabelConstraint(top: 5)
        } else {
            guideView.updateContentLabelConstraint(top: 10)
        }
    }
    
    private func pushToPhoneVolumeCheckVC() {
        let controller = DHPhoneVolumeCheckViewController()
        self.navigationController?.pushViewController(controller, animated: true)
    }
    
    private func pushToResetDeviceVC() {
        let controller = DHResetDeviceViewController()
        let introductionParser = DHAddDeviceManager.sharedInstance.getIntroductionParser()
        controller.placeholderImage = DHIPCLightCheckDefault.imagename
        controller.imageUrl = introductionParser?.lightResetInfo.resetImageUrl
        controller.resetContent = introductionParser?.lightResetInfo.resetOperation ?? DHIPCLightResetDefault.operation
        self.navigationController?.pushViewController(controller, animated: true)
    }
    
    // MARK: - DHAddBaseVCProtocol
    override func rightActionType() -> [DHAddBaseRightAction] {
        var actions: [DHAddBaseRightAction] = [.restart]
        if DHAddDeviceManager.sharedInstance.supportConfigModes.contains(.wired) {
            actions.append(.switchToWired)
        }
        
        return actions
    }
    
    // MARK: - DHAddBaseVCProtocol(OMS Introduction)
    override func needUpdateCurrentOMSIntroduction() {
        LCProgressHUD.hideAllHuds(self.view)
        let parser = DHAddDeviceManager.sharedInstance.getIntroductionParser()
        if parser != nil {
            self.setupGuideView()
        }
    }
    
    // MARK: - DHGuideBaseVCProtocol
    override func tipText() -> String? {
        let introductionParser = DHAddDeviceManager.sharedInstance.getIntroductionParser()
        return introductionParser?.lightCheckInfo.lightTwinkleContent ?? DHIPCLightCheckDefault.twinkleContent
    }
    
    override func tipImageName() -> String? {
        return DHIPCLightCheckDefault.imagename
    }
    
    override func tipImageUrl() -> String? {
        let introductionParser = DHAddDeviceManager.sharedInstance.getIntroductionParser()
        return introductionParser?.lightCheckInfo.lightTwinkleImageUrl
    }
    
    override func detailText() -> String? {
        let introductionParser = DHAddDeviceManager.sharedInstance.getIntroductionParser()
        return introductionParser?.lightResetInfo.resetGuide ?? DHIPCLightResetDefault.guide
    }
    
    override func checkText() -> String? {
        let introductionParser = DHAddDeviceManager.sharedInstance.getIntroductionParser()
        return introductionParser?.lightCheckInfo.lightTwinklConfirm ?? DHIPCLightCheckDefault.twinkleConfirm
    }
    
    override func detailImageUrl() -> String? {
        return nil
    }
    
    override func isCheckHidden() -> Bool {
        return false
    }
    
    override func isDetailHidden() -> Bool {
        return false
    }
    
    override func doNext() {
        pushToPhoneVolumeCheckVC()
    }
    
    override func doDetail() {
        pushToResetDeviceVC()
    }
}