//
//  SinglePointViewController.swift
//  MobilePortal
//
//  Created by caiyang on 2020/7/29.
//  Copyright © 2020 yin chen. All rights reserved.
//

import UIKit

class SinglePointViewController: BaseViewController,WXAuthDelegate,WXApiDelegate,UIAlertViewDelegate {

    lazy var loginView : LoginView = {
        let loginView = LoginView.init(frame: self.view.frame)
        loginView.weixinQQView.weixinBtn.addTarget(self, action: #selector(sendAuthRequest), for: .touchUpInside)
        return loginView;
    }()
    var httpViewModel = WeChatViewModel()
    
    var loginType:LoginType = .SinglePointLoginType
    var loginInitType:LoginInitType = .LoginNomType
    
    override func viewWillAppear(_ animated: Bool) {
        super.viewWillAppear(animated)
        self.wr_setNavBarBackgroundAlpha(0)
        if #available(iOS 13.0, *) {
            if SCREEN_HEIGHT() >= 812 {
                self.wr_setNavBarShadowImageHidden(true)
            }
        } else {
            self.wr_setNavBarShadowImageHidden(true)
        }
        self.loginInitType = .LoginNomType
        //        addNotificationCenter()
    }
    override func viewDidLoad() {
        super.viewDidLoad()
        self.view.backgroundColor = UIColor.white
        addInitLoginView()
        
        getNewVersionUpdateHttpCmd()
        getScopeListHttpCmd()
        // Do any additional setup after loading the view.
    }
    /// 微信绑定
    func gotoWeChatBinding(){
        let vc:WeChatBindingViewController = WeChatBindingViewController()
        self.pushViewController(viewController: vc, animated: true)
    }
}
