CNLiveViewController.swift
3.57 KB
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
//
// 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))")
// }
}
}