//
//  WeChatBindingVC.swift
//  MobilePortal
//
//  Created by caiyang on 2020/8/24.
//  Copyright © 2020 yin chen. All rights reserved.
//

import UIKit

class WeChatBindingVC: BaseViewController {

    lazy var loginView : LoginViewTwo = {
        let loginView = LoginViewTwo.init(frame: self.view.frame)
        //        loginView.weixinQQView.weixinBtn.addTarget(self, action: #selector(sendAuthRequest), for: .touchUpInside)
        return loginView;
    }()
    var httpViewModel = WeChatViewModel()
    // 是否是按钮响应事件
    var loginInitType:LoginInitType = .LoginNomType
    var loginType:LoginType = .OldLoginType {
        didSet {
            if loginType == .OldLoginType {
//                loginView.buttonAutoLogin.isHidden = true
            }else{
//                loginView.buttonAutoLogin.isHidden = false
            }
        }
    }
    
    
    override func viewWillAppear(_ animated: Bool) {
        super.viewWillAppear(animated)
        if (loginView.passTextView != nil) {
            loginView.passTextView.text = nil
        }
    }
    override func viewDidLoad() {
        super.viewDidLoad()
        self.view.backgroundColor = UIColor.white
        self.title = "绑定账号"
        addInitLoginView()
        initRightBtn()
        //        getNewVersionUpdateHttpCmd()
        // Do any additional setup after loading the view.
    }
    ///左侧返回按钮
    func initRightBtn(){
        let leftN = UIBarButtonItem.init(image: UIImage.init(named: "return_image")?.withRenderingMode(.alwaysOriginal), style: .plain, target: self, action: #selector(arrowResponse))
        self.navigationItem.leftBarButtonItem = leftN
    }
    override func arrowResponse(){
        AccountInfo.sharedInstance().clearAccount()
        AccountInfo.sharedInstance().clearWeChatInfoAccount()
        self.navigationController?.popViewController(animated: true)
    }

}
