CNLiveViewController.swift 3.57 KB
//
//  CNLiveViewController.swift
//  metaCode
//
//  Created by iOS on 2023/5/30.
//  此为测试界面

import UIKit
import CNLiveRequestBastKit

class CNLiveViewController: CNLiveBaseViewController {

    override func viewDidLoad() {
        super.viewDidLoad()
        // Do any additional setup after loading the view.

        self.view.backgroundColor = KVCBackgroupColor
        
        
        let button = UIButton()
        button.frame = CGRect(x: 0, y: 100, width: KSreenWidth, height: 40)
        button.setTitle("请求吧", for: .normal)
        button.setTitle("请求吧", for: .highlighted)
        button.backgroundColor = UIColor.red
        button.setTitleColor(UIColor.gray, for: .normal)
        button.addTarget(self, action: #selector(touchButton), for: .touchUpInside)
        self.view.addSubview(button)
        
        let button_sha = UIButton()
        button_sha.frame = CGRect(x: 0, y: 150, width: KSreenWidth, height: 40)
        button_sha.setTitle("验证码", for: .normal)
        button_sha.setTitle("验证码", for: .highlighted)
        button_sha.backgroundColor = UIColor.red
        button_sha.setTitleColor(UIColor.gray, for: .normal)
        button_sha.addTarget(self, action: #selector(shaButton), for: .touchUpInside)
        self.view.addSubview(button_sha)
        
        let button_q = UIButton()
        button_q.frame = CGRect(x: 0, y: 200, width: KSreenWidth, height: 40)
        button_q.setTitle("显示弹框", for: .normal)
        button_q.setTitle("显示弹框", for: .highlighted)
        button_q.backgroundColor = UIColor.red
        button_q.setTitleColor(UIColor.gray, for: .normal)
        button_q.addTarget(self, action: #selector(qButton), for: .touchUpInside)
        self.view.addSubview(button_q)
        
        let button_i = UIButton()
        button_i.frame = CGRect(x: 0, y: 250, width: KSreenWidth, height: 40)
        button_i.setTitle("获取用户信息", for: .normal)
        button_i.setTitle("获取用户信息", for: .highlighted)
        button_i.backgroundColor = UIColor.red
        button_i.setTitleColor(UIColor.gray, for: .normal)
        button_i.addTarget(self, action: #selector(infoButton), for: .touchUpInside)
        self.view.addSubview(button_i)
    }
    
    
//    override func viewDidAppear(_ animated: Bool) {
//        LoginAuthInfoView.showAuthView()
//    }
    
    
    @objc func qButton() -> Void {
        
        LoginAuthInfoView.showAuthView()
        
    }
    @objc func infoButton() -> Void {
//        let user = UserInfoManager.shared.userInfo
//        print("\(user)")
    }
    
    @objc func shaButton() -> Void {
//        let param = ["mobile":"18519714533","countryCode":"86"]
//        CNLiveNetworking.setAllowRequestDefaultArgument(true)
//        CNLiveNetworking.setupShowDataResult(true)
//        CNLiveNetworking.requestNetwork(with: .POST, urlString: "https://api.cnlive.com/open/api2/user/sendVerifyCode4server", param: param, cacheType: .networkOnly) { task, result, error in
//            print("\(String(describing: result))")
//        }
    }
    
    @objc func touchButton() {
//        let param = ["userName":"18519714533","countryCode":"86","verificationCode":"599011","inviterId":"","ver":"1"]
//        CNLiveNetworking.setAllowRequestDefaultArgument(true)
//        CNLiveNetworking.setupShowDataResult(true)
//        CNLiveNetworking.requestNetwork(with: .POST, urlString: "https://api.cnlive.com/open/api2/user/loginInMetaCode", param: param, cacheType: .networkOnly) { task, result, error in
//            print("\(String(describing: result))")
//        }
        
        
 
    }


}