Commit 194545a3 authored by Steven杜宇's avatar Steven杜宇

Merge branch 'youhua-dev' of http://gitlab.galaxy-immi.com/mobile-group/galaxy-iOS into youhua-dev

parents 9fbce6b9 4be1d955
......@@ -230,8 +230,6 @@
0477E17A2BA41C7E00436346 /* YHCertificateModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0477E1792BA41C7E00436346 /* YHCertificateModel.swift */; };
0477E17C2BA4238400436346 /* YHCertificateListContainerVC.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0477E17B2BA4238400436346 /* YHCertificateListContainerVC.swift */; };
0477E17E2BA4362A00436346 /* YHCustomNavigationBar.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0477E17D2BA4362A00436346 /* YHCustomNavigationBar.swift */; };
04808C062B4686510056D53C /* ATAuthSDK.bundle in Resources */ = {isa = PBXBuildFile; fileRef = 04808C042B4686510056D53C /* ATAuthSDK.bundle */; };
04808C082B4686C10056D53C /* ATAuthSDK_D.framework in Embed Frameworks */ = {isa = PBXBuildFile; fileRef = 04808C032B4686510056D53C /* ATAuthSDK_D.framework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; };
0480976B2BA15269000B9DCA /* YHCertificateInfoCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0480976A2BA15269000B9DCA /* YHCertificateInfoCell.swift */; };
0480976D2BA158A1000B9DCA /* YHCertificateListVC.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0480976C2BA158A1000B9DCA /* YHCertificateListVC.swift */; };
048097712BA18D66000B9DCA /* YHCertificateSearchBar.swift in Sources */ = {isa = PBXBuildFile; fileRef = 048097702BA18D66000B9DCA /* YHCertificateSearchBar.swift */; };
......@@ -340,7 +338,6 @@
A567E5B72BD7643D00D5D5A0 /* YHHkLifeAndIdItemView.swift in Sources */ = {isa = PBXBuildFile; fileRef = A567E5902BD7643D00D5D5A0 /* YHHkLifeAndIdItemView.swift */; };
A567E5B82BD7643D00D5D5A0 /* YHSearchItemLayout.swift in Sources */ = {isa = PBXBuildFile; fileRef = A567E5912BD7643D00D5D5A0 /* YHSearchItemLayout.swift */; };
A56D2D612B62020C009C83A8 /* YHContractMainItemStatusCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = A56D2D602B62020C009C83A8 /* YHContractMainItemStatusCell.swift */; };
A57F1F252B48F09200B644E6 /* ATAuthSDK_D.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 04808C032B4686510056D53C /* ATAuthSDK_D.framework */; };
A580371E2BAD784B0031C312 /* YHMySchemeViewModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = A580371D2BAD784B0031C312 /* YHMySchemeViewModel.swift */; };
A58037212BAD7B2A0031C312 /* YHMySchemeModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = A58037202BAD7B2A0031C312 /* YHMySchemeModel.swift */; };
A582B23D2BB944ED009D098C /* YHHKPlanDoctumentVC.swift in Sources */ = {isa = PBXBuildFile; fileRef = A582B23C2BB944ED009D098C /* YHHKPlanDoctumentVC.swift */; };
......@@ -457,7 +454,6 @@
dstPath = "";
dstSubfolderSpec = 10;
files = (
04808C082B4686C10056D53C /* ATAuthSDK_D.framework in Embed Frameworks */,
);
name = "Embed Frameworks";
runOnlyForDeploymentPostprocessing = 0;
......@@ -691,8 +687,6 @@
0477E1792BA41C7E00436346 /* YHCertificateModel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YHCertificateModel.swift; sourceTree = "<group>"; };
0477E17B2BA4238400436346 /* YHCertificateListContainerVC.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YHCertificateListContainerVC.swift; sourceTree = "<group>"; };
0477E17D2BA4362A00436346 /* YHCustomNavigationBar.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YHCustomNavigationBar.swift; sourceTree = "<group>"; };
04808C032B4686510056D53C /* ATAuthSDK_D.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; path = ATAuthSDK_D.framework; sourceTree = "<group>"; };
04808C042B4686510056D53C /* ATAuthSDK.bundle */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.plug-in"; path = ATAuthSDK.bundle; sourceTree = "<group>"; };
0480976A2BA15269000B9DCA /* YHCertificateInfoCell.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YHCertificateInfoCell.swift; sourceTree = "<group>"; };
0480976C2BA158A1000B9DCA /* YHCertificateListVC.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YHCertificateListVC.swift; sourceTree = "<group>"; };
048097702BA18D66000B9DCA /* YHCertificateSearchBar.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YHCertificateSearchBar.swift; sourceTree = "<group>"; };
......@@ -912,7 +906,6 @@
04EA376D2BEA06EF00DBAF64 /* WebKit.framework in Frameworks */,
0468D4312B5654C100CFB916 /* libresolv.tbd in Frameworks */,
0468D4302B5654B500CFB916 /* SystemConfiguration.framework in Frameworks */,
A57F1F252B48F09200B644E6 /* ATAuthSDK_D.framework in Frameworks */,
);
runOnlyForDeploymentPostprocessing = 0;
};
......@@ -1667,8 +1660,6 @@
04808C022B4686510056D53C /* Frameworks */ = {
isa = PBXGroup;
children = (
04808C032B4686510056D53C /* ATAuthSDK_D.framework */,
04808C042B4686510056D53C /* ATAuthSDK.bundle */,
);
path = Frameworks;
sourceTree = "<group>";
......@@ -2469,7 +2460,6 @@
files = (
045EEED42B9F171A0022A143 /* scoreOptionData.plist in Resources */,
045EEED62B9F171A0022A143 /* YHQuestionList.plist in Resources */,
04808C062B4686510056D53C /* ATAuthSDK.bundle in Resources */,
A5C5B2EE2B4F9B8800A7C5D1 /* Localizable.xcstrings in Resources */,
A58951C52B398D1000225C19 /* Launch Screen.storyboard in Resources */,
A51044182B493675006B60BB /* README.md in Resources */,
......@@ -3049,7 +3039,7 @@
CODE_SIGN_IDENTITY = "Apple Development";
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
CODE_SIGN_STYLE = Manual;
CURRENT_PROJECT_VERSION = 11;
CURRENT_PROJECT_VERSION = 13;
DEVELOPMENT_TEAM = "";
"DEVELOPMENT_TEAM[sdk=iphoneos*]" = RXHYW88XR7;
ENABLE_USER_SCRIPT_SANDBOXING = NO;
......@@ -3083,7 +3073,7 @@
SWIFT_EMIT_LOC_STRINGS = YES;
SWIFT_OBJC_BRIDGING_HEADER = "$(SRCROOT)/$(TARGET_NAME)/Res/galaxy-Bridge-Header.h";
SWIFT_VERSION = 5.0;
TARGETED_DEVICE_FAMILY = "1,2";
TARGETED_DEVICE_FAMILY = 1;
};
name = TestEnv;
};
......@@ -3255,7 +3245,7 @@
CODE_SIGN_IDENTITY = "Apple Development";
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
CODE_SIGN_STYLE = Manual;
CURRENT_PROJECT_VERSION = 11;
CURRENT_PROJECT_VERSION = 13;
DEVELOPMENT_TEAM = "";
"DEVELOPMENT_TEAM[sdk=iphoneos*]" = RXHYW88XR7;
ENABLE_USER_SCRIPT_SANDBOXING = NO;
......@@ -3288,7 +3278,7 @@
SWIFT_EMIT_LOC_STRINGS = YES;
SWIFT_OBJC_BRIDGING_HEADER = "$(SRCROOT)/$(TARGET_NAME)/Res/galaxy-Bridge-Header.h";
SWIFT_VERSION = 5.0;
TARGETED_DEVICE_FAMILY = "1,2";
TARGETED_DEVICE_FAMILY = 1;
};
name = Debug;
};
......@@ -3303,7 +3293,7 @@
CODE_SIGN_IDENTITY = "Apple Development";
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
CODE_SIGN_STYLE = Manual;
CURRENT_PROJECT_VERSION = 11;
CURRENT_PROJECT_VERSION = 13;
DEVELOPMENT_TEAM = "";
"DEVELOPMENT_TEAM[sdk=iphoneos*]" = RXHYW88XR7;
ENABLE_USER_SCRIPT_SANDBOXING = NO;
......@@ -3336,7 +3326,7 @@
SWIFT_EMIT_LOC_STRINGS = YES;
SWIFT_OBJC_BRIDGING_HEADER = "$(SRCROOT)/$(TARGET_NAME)/Res/galaxy-Bridge-Header.h";
SWIFT_VERSION = 5.0;
TARGETED_DEVICE_FAMILY = "1,2";
TARGETED_DEVICE_FAMILY = 1;
};
name = Release;
};
......
......@@ -14,7 +14,7 @@ class YHHKEventViewController: YHBaseViewController {
let homeViewModel: YHHomePageViewModel = YHHomePageViewModel()
var sectionView: YHServiceSectionView!
var webview = WKWebView()
var model: YHHKEventModel = YHHKEventModel()
override func viewDidLoad() {
super.viewDidLoad()
view.backgroundColor = .white
......@@ -27,8 +27,6 @@ class YHHKEventViewController: YHBaseViewController {
// loadData()
}
lazy var bottomViewForSavePic: YHHomeWebViewBottomForSavePicView = {
let view = YHHomeWebViewBottomForSavePicView()
view.isHidden = true
......@@ -57,6 +55,9 @@ extension YHHKEventViewController {
func setupUI() {
gk_navBarAlpha = 1
gk_navTitle = "香港办事"
let rightButtonItem = UIBarButtonItem(image: UIImage(named: "share_item")?.withRenderingMode(.alwaysOriginal), style: .plain, target: self, action: #selector(share))
gk_navRightBarButtonItem = rightButtonItem
gk_navItemRightSpace = 16
printLog(gk_navigationBar.isHidden)
sectionView = {
......@@ -64,6 +65,7 @@ extension YHHKEventViewController {
view.hkBlock = {[weak self] model in
guard let self = self else { return }
guard let urlString = model.list.first else { return }
self.model = model
let url = NSURL(string: urlString)
// 创建请求
let request = NSURLRequest(url: url! as URL)
......@@ -113,6 +115,31 @@ extension YHHKEventViewController {
self.saveImageToPhotoLib()
}
}
@objc func share() {
if YHLoginManager.shared.isLogin() {
if model.tag.contains("日历") {
guard let urlString = model.list.first, let url = URL(string: urlString) else {
return
}
let task = URLSession.shared.dataTask(with: url) { data, response, error in
DispatchQueue.main.async {
guard let data = data, error == nil else { return }
let image = UIImage(data: data)
if let image = image {
YHShareManager.shared.sendImageContent(image)
}
}
}
task.resume()
} else {
guard let urlString = model.list.first else {
return
}
YHShareManager.shared.sendLinkContent("一图看清香港办事", "", UIImage(named: "AppIcon") ?? UIImage(), link: urlString)
}
}
}
}
......
......@@ -25,7 +25,7 @@ class YHHomeWebViewController: YHBaseViewController, WKUIDelegate, WKNavigationD
var url = ""
var id: Int = 0
var vcTitle : String?
var model: YHWebModel = YHWebModel()
lazy var bottomViewForSavePic: YHHomeWebViewBottomForSavePicView = {
let view = YHHomeWebViewBottomForSavePicView()
view.isHidden = true
......@@ -41,7 +41,11 @@ class YHHomeWebViewController: YHBaseViewController, WKUIDelegate, WKNavigationD
gk_navBarAlpha = 1.0
gk_navLineHidden = false
gk_navTitle = vcTitle
if !(vcTitle == "积分中心" || vcTitle == "预约银河湾") {
let rightButtonItem = UIBarButtonItem(image: UIImage(named: "share_item")?.withRenderingMode(.alwaysOriginal), style: .plain, target: self, action: #selector(share))
gk_navRightBarButtonItem = rightButtonItem
gk_navItemRightSpace = 16
}
view.backgroundColor = .white
viewModel = YHHomeWebViewModel()
//获取导航栏高度
......@@ -191,6 +195,7 @@ class YHHomeWebViewController: YHBaseViewController, WKUIDelegate, WKNavigationD
guard let self = self else { return }
if success {
guard let model = self.viewModel.mainModel else { return }
self.model = model
bottomView.likeCount = model.like_count
bottomView.starCount = model.collect_count
bottomView.isStar = model.is_collect
......@@ -204,6 +209,40 @@ class YHHomeWebViewController: YHBaseViewController, WKUIDelegate, WKNavigationD
}
}
@objc func share() {
if YHLoginManager.shared.isLogin() {
if vcTitle == "香港身份测评码" {
guard let url = URL(string: url) else {
return
}
let task = URLSession.shared.dataTask(with: url) { data, response, error in
DispatchQueue.main.async {
guard let data = data, error == nil else { return }
let image = UIImage(data: data)
if let image = image {
YHShareManager.shared.sendImageContent(image)
}
}
}
task.resume()
} else {
guard let url = URL(string: self.model.img_url) else {
return
}
let task = URLSession.shared.dataTask(with: url) { data, response, error in
DispatchQueue.main.async {
guard let data = data, error == nil else { return }
let image = UIImage(data: data)
if let image = image {
YHShareManager.shared.sendLinkContent(self.model.title, "", image, link: self.url)
}
}
}
task.resume()
}
}
}
// MARK: - WKNavigationDelegate
func webView(_ webView: WKWebView, didFinish navigation: WKNavigation!) {
// if vcTitle == nil {
......
......@@ -15,4 +15,7 @@ class YHWebModel: YHBaseModel {
var view_count: Int = 0
var is_collect: Bool = false
var collect_count: Int = 0
var media_url: String = ""
var title: String = ""
var img_url: String = ""
}
......@@ -188,7 +188,7 @@ extension YHServerHKLifeViewController : UITableViewDelegate,UITableViewDataSour
cell.tableFootView.items = dataSouce
// cell.tableFootView.myCollectView.es.removeRefreshFooter()
cell.selectionStyle = .none
cell.tableFootView.myCollectView.isScrollEnabled = false
// cell.tableFootView.myCollectView.isScrollEnabled = false
cell.tableFootView.isNeedScrollBlock = true
return cell
}
......@@ -197,46 +197,46 @@ extension YHServerHKLifeViewController : UITableViewDelegate,UITableViewDataSour
}
func scrollViewDidScroll(_ scrollView: UIScrollView) {
if scrollView == homeTableView {
let offsetY = homeTableView.contentOffset.y
if offsetY >= 365 {
homeTableView.isScrollEnabled = false
cell.tableFootView.myCollectView.isScrollEnabled = true
} else {
homeTableView.isScrollEnabled = true
cell.tableFootView.myCollectView.isScrollEnabled = false
}
}
}
func scrollViewDidEndDragging(_ scrollView: UIScrollView, willDecelerate decelerate: Bool) {
// 用户停止拖拽时调用,可以执行一些后续操作
if scrollView == homeTableView {
let offsetY = homeTableView.contentOffset.y
if offsetY >= 365 {
homeTableView.isScrollEnabled = false
cell.tableFootView.myCollectView.isScrollEnabled = true
} else {
homeTableView.isScrollEnabled = true
cell.tableFootView.myCollectView.isScrollEnabled = false
}
}
}
func scrollViewDidEndDecelerating(_ scrollView: UIScrollView) {
// 滚动减速完成时调用,表示滚动完全停止
if scrollView == homeTableView {
let offsetY = homeTableView.contentOffset.y
if offsetY >= 365 {
homeTableView.isScrollEnabled = false
cell.tableFootView.myCollectView.isScrollEnabled = true
} else {
homeTableView.isScrollEnabled = true
cell.tableFootView.myCollectView.isScrollEnabled = false
}
}
}
// func scrollViewDidScroll(_ scrollView: UIScrollView) {
// if scrollView == homeTableView {
// let offsetY = homeTableView.contentOffset.y
// if offsetY >= 365 {
// homeTableView.isScrollEnabled = false
// cell.tableFootView.myCollectView.isScrollEnabled = true
// } else {
// homeTableView.isScrollEnabled = true
// cell.tableFootView.myCollectView.isScrollEnabled = false
// }
// }
// }
//
// func scrollViewDidEndDragging(_ scrollView: UIScrollView, willDecelerate decelerate: Bool) {
// // 用户停止拖拽时调用,可以执行一些后续操作
// if scrollView == homeTableView {
// let offsetY = homeTableView.contentOffset.y
// if offsetY >= 365 {
// homeTableView.isScrollEnabled = false
// cell.tableFootView.myCollectView.isScrollEnabled = true
// } else {
// homeTableView.isScrollEnabled = true
// cell.tableFootView.myCollectView.isScrollEnabled = false
// }
// }
// }
//
// func scrollViewDidEndDecelerating(_ scrollView: UIScrollView) {
// // 滚动减速完成时调用,表示滚动完全停止
// if scrollView == homeTableView {
// let offsetY = homeTableView.contentOffset.y
// if offsetY >= 365 {
// homeTableView.isScrollEnabled = false
// cell.tableFootView.myCollectView.isScrollEnabled = true
// } else {
// homeTableView.isScrollEnabled = true
// cell.tableFootView.myCollectView.isScrollEnabled = false
// }
// }
// }
}
extension YHServerHKLifeViewController: JXSegmentedListContainerViewListDelegate {
......
......@@ -187,7 +187,7 @@ extension YHServiceListViewController : UITableViewDelegate,UITableViewDataSourc
}
cell.tableFootView.items = dataSouce
cell.selectionStyle = .none
cell.tableFootView.myCollectView.isScrollEnabled = false
// cell.tableFootView.myCollectView.isScrollEnabled = false
cell.tableFootView.isNeedScrollBlock = true
return cell
}
......@@ -196,46 +196,46 @@ extension YHServiceListViewController : UITableViewDelegate,UITableViewDataSourc
}
func scrollViewDidScroll(_ scrollView: UIScrollView) {
if scrollView == homeTableView {
let offsetY = homeTableView.contentOffset.y
if offsetY >= 365 {
homeTableView.isScrollEnabled = false
cell.tableFootView.myCollectView.isScrollEnabled = true
} else {
homeTableView.isScrollEnabled = true
cell.tableFootView.myCollectView.isScrollEnabled = false
}
}
}
func scrollViewDidEndDragging(_ scrollView: UIScrollView, willDecelerate decelerate: Bool) {
// 用户停止拖拽时调用,可以执行一些后续操作
if scrollView == homeTableView {
let offsetY = homeTableView.contentOffset.y
if offsetY >= 365 {
homeTableView.isScrollEnabled = false
cell.tableFootView.myCollectView.isScrollEnabled = true
} else {
homeTableView.isScrollEnabled = true
cell.tableFootView.myCollectView.isScrollEnabled = false
}
}
}
func scrollViewDidEndDecelerating(_ scrollView: UIScrollView) {
// 滚动减速完成时调用,表示滚动完全停止
if scrollView == homeTableView {
let offsetY = homeTableView.contentOffset.y
if offsetY >= 365 {
homeTableView.isScrollEnabled = false
cell.tableFootView.myCollectView.isScrollEnabled = true
} else {
homeTableView.isScrollEnabled = true
cell.tableFootView.myCollectView.isScrollEnabled = false
}
}
}
// func scrollViewDidScroll(_ scrollView: UIScrollView) {
// if scrollView == homeTableView {
// let offsetY = homeTableView.contentOffset.y
// if offsetY >= 365 {
// homeTableView.isScrollEnabled = false
// cell.tableFootView.myCollectView.isScrollEnabled = true
// } else {
// homeTableView.isScrollEnabled = true
// cell.tableFootView.myCollectView.isScrollEnabled = false
// }
// }
// }
//
// func scrollViewDidEndDragging(_ scrollView: UIScrollView, willDecelerate decelerate: Bool) {
// // 用户停止拖拽时调用,可以执行一些后续操作
// if scrollView == homeTableView {
// let offsetY = homeTableView.contentOffset.y
// if offsetY >= 365 {
// homeTableView.isScrollEnabled = false
// cell.tableFootView.myCollectView.isScrollEnabled = true
// } else {
// homeTableView.isScrollEnabled = true
// cell.tableFootView.myCollectView.isScrollEnabled = false
// }
// }
// }
//
// func scrollViewDidEndDecelerating(_ scrollView: UIScrollView) {
// // 滚动减速完成时调用,表示滚动完全停止
// if scrollView == homeTableView {
// let offsetY = homeTableView.contentOffset.y
// if offsetY >= 365 {
// homeTableView.isScrollEnabled = false
// cell.tableFootView.myCollectView.isScrollEnabled = true
// } else {
// homeTableView.isScrollEnabled = true
// cell.tableFootView.myCollectView.isScrollEnabled = false
// }
// }
// }
}
extension YHServiceListViewController: JXSegmentedListContainerViewListDelegate {
......
......@@ -36,7 +36,7 @@ class YHCertificateSearchBar: UIView {
textField.backgroundColor = .clear
textField.attributedPlaceholder = NSAttributedString(string: "请输入关键词搜索".local, attributes: [NSAttributedString.Key.foregroundColor : UIColor.placeHolderColor])
textField.font = UIFont.PFSC_M(ofSize: 12)
textField.tintColor = UIColor(hexString: "#3D88F8")
textField.tintColor = UIColor.brandMainColor
textField.textColor = UIColor.mainTextColor
textField.clearButtonMode = .whileEditing
textField.addTarget(self, action: #selector(textFieldChanged(textField:)), for: .editingChanged)
......@@ -49,7 +49,7 @@ class YHCertificateSearchBar: UIView {
btn.setTitle("搜索".local, for: .normal)
btn.titleLabel?.font = UIFont.PFSC_M(ofSize: 12)
btn.setTitleColor(.white, for: .normal)
btn.backgroundColor = UIColor(hexString: "#3D88F8")
btn.backgroundColor = UIColor.brandMainColor
btn.layer.cornerRadius = Self.cancelBtnHeight/2.0
btn.addTarget(self, action: #selector(searchBtnClicked), for: .touchUpInside)
return btn
......
......@@ -60,7 +60,7 @@ class YHDocumentPromptTableViewCell: UITableViewCell {
promptImageView = {
let view = UIImageView()
view.image = UIImage(named: "document_prompt_icon")
view.image = UIImage(named: "tips_icon")
return view
}()
centerView.addSubview(promptImageView)
......
......@@ -35,7 +35,7 @@ class YHCollegeSearchBar: UIView {
textField.backgroundColor = .clear
textField.attributedPlaceholder = NSAttributedString(string: "请输入学校全称", attributes: [NSAttributedString.Key.foregroundColor : UIColor.placeHolderColor])
textField.font = UIFont.PFSC_M(ofSize: 12)
textField.tintColor = UIColor(hexString: "#3D88F8")
textField.tintColor = UIColor.brandMainColor
textField.textColor = UIColor.mainTextColor
textField.addTarget(self, action: #selector(textFieldChanged(textField:)), for: .editingChanged)
return textField
......@@ -46,7 +46,7 @@ class YHCollegeSearchBar: UIView {
btn.setTitle("确认".local, for: .normal)
btn.titleLabel?.font = UIFont.PFSC_M(ofSize: 12)
btn.setTitleColor(.white, for: .normal)
btn.backgroundColor = UIColor(hexString: "#3D88F8")
btn.backgroundColor = UIColor.brandMainColor
btn.layer.cornerRadius = Self.confirmBtnHeight/2.0
btn.addTarget(self, action: #selector(confirmBtnClicked), for: .touchUpInside)
return btn
......
......@@ -184,7 +184,7 @@ class YHCardExampleView: UIView {
let array = ["四角完整", "照片清晰", "亮度均匀"]
for i in 0 ..< array.count {
let imageView = UIImageView()
imageView.image = UIImage(named: "service_card_complete")
imageView.image = UIImage(named: "mid_image")
centerView.addSubview(imageView)
imageView.snp.makeConstraints { make in
make.top.equalTo(76)
......
......@@ -121,7 +121,7 @@ class YHDatePickView: UIView {
button.titleLabel?.font = UIFont.PFSC_M(ofSize: 14)
button.contentHorizontalAlignment = .center
button.setTitle("确定", for: .normal)
button.setTitleColor( UIColor(hex:0x4487f9), for: .normal)
button.setTitleColor( UIColor.brandMainColor, for: .normal)
button.addTarget(self, action: #selector(sure), for: .touchUpInside)
return button
}()
......
......@@ -141,7 +141,7 @@ class YHItemView: UIView {
longTimeButton = {
let button = UIButton(type: .custom)
button.setImage(UIImage(named: "main_time_normal"), for: .normal)
button.setImage(UIImage(named: "main_time_select"), for: .selected)
button.setImage(UIImage(named: "login_privacy_agree"), for: .selected)
button.setTitleColor(UIColor.mainTextColor, for: .normal)
button.setTitle("长期", for: .normal)
button.titleLabel?.font = UIFont.PFSC_M(ofSize: 14)
......
......@@ -67,7 +67,7 @@ class YHStepView: UIScrollView {
self.removeSubviews()
for i in 0 ..< array.count {
let button = UIButton(type: .custom)
button.setBackgroundImage(UIImage(named: "service_step_fail"), for: .normal)
button.setBackgroundImage(UIImage(named: "mid_image2"), for: .normal)
button.tag = 1000 + i
button.addTarget(self, action: #selector(buttonClick(_:)), for: .touchUpInside)
addSubview(button)
......@@ -110,13 +110,13 @@ class YHStepView: UIScrollView {
}
if currentIndex == i {
button.setBackgroundImage(UIImage(named: "service_step_now"), for: .normal)
button.setBackgroundImage(UIImage(named: "mid_image1"), for: .normal)
label.textColor = UIColor.brandMainColor
} else if i < currentIndex {
button.setBackgroundImage(UIImage(named: "service_step_success"), for: .normal)
button.setBackgroundImage(UIImage(named: "mid_image"), for: .normal)
label.textColor = UIColor.mainTextColor
} else {
button.setBackgroundImage(UIImage(named: "service_step_fail"), for: .normal)
button.setBackgroundImage(UIImage(named: "mid_image2"), for: .normal)
label.textColor = UIColor.placeHolderColor
}
}
......@@ -135,15 +135,15 @@ class YHStepView: UIScrollView {
}
}
if currentIndex == i {
button?.setBackgroundImage(UIImage(named: "service_step_now"), for: .normal)
button?.setBackgroundImage(UIImage(named: "mid_image1"), for: .normal)
lable?.textColor = UIColor.brandMainColor
lable?.font = UIFont.PFSC_M(ofSize: 13)
} else if i < currentIndex {
button?.setBackgroundImage(UIImage(named: "service_step_success"), for: .normal)
button?.setBackgroundImage(UIImage(named: "mid_image"), for: .normal)
lable?.textColor = UIColor.mainTextColor
lable?.font = UIFont.PFSC_R(ofSize: 13)
} else {
button?.setBackgroundImage(UIImage(named: "service_step_fail"), for: .normal)
button?.setBackgroundImage(UIImage(named: "mid_image2"), for: .normal)
lable?.textColor = UIColor.placeHolderColor
lable?.font = UIFont.PFSC_R(ofSize: 13)
}
......
......@@ -48,7 +48,7 @@ class YHOtherSelecteItemView: UIView {
lazy var longTimeButton = {
let button = UIButton(type: .custom)
button.setImage(UIImage(named: "main_time_normal"), for: .normal)
button.setImage(UIImage(named: "main_time_select"), for: .selected)
button.setImage(UIImage(named: "login_privacy_agree"), for: .selected)
button.setTitleColor(UIColor.mainTextColor, for: .normal)
button.setTitle("至今", for: .normal)
button.titleLabel?.font = UIFont.PFSC_M(ofSize: 14)
......
......@@ -143,7 +143,7 @@ class YHWorkExperienceItemView: UIView {
longTimeButton = {
let button = UIButton(type: .custom)
button.setImage(UIImage(named: "main_time_normal"), for: .normal)
button.setImage(UIImage(named: "main_time_select"), for: .selected)
button.setImage(UIImage(named: "login_privacy_agree"), for: .selected)
button.setTitleColor(UIColor.mainTextColor, for: .normal)
button.setTitle("至今", for: .normal)
button.titleLabel?.font = UIFont.PFSC_M(ofSize: 14)
......
......@@ -160,7 +160,7 @@ class YHWorkHighlightsTableViewCell: UITableViewCell {
detailSwitch = {
let switchView = UISwitch()
switchView.onTintColor = UIColor(hex: 0x4d9ff8)
switchView.onTintColor = UIColor.brandMainColor
switchView.addTarget(self, action: #selector(switchViewChange), for: .valueChanged)
return switchView
}()
......
......@@ -7,8 +7,6 @@
//
import UIKit
//import SwifterSwift
class YHContractMainItemStatusCell: UITableViewCell {
static let cellReuseIdentifier = "YHContractMainItemStatusCell"
......
......@@ -205,8 +205,8 @@ class YHInformationFillTipsAlertView: UIView {
}
let selectedBtn = UIButton(type: .custom)
selectedBtn.setImage(UIImage(named: "login_privacy_agree"), for: .normal)
selectedBtn.setImage(UIImage(named: "login_privacy_disagree"), for: .selected)
selectedBtn.setImage(UIImage(named: "login_privacy_disagree"), for: .normal)
selectedBtn.setImage(UIImage(named: "login_privacy_agree"), for: .selected)
selectedBtn.addTarget(self, action: #selector(onClickAgree), for: .touchUpInside)
footer.addSubview(selectedBtn)
selectedBtn.snp.makeConstraints { make in
......
......@@ -26,7 +26,7 @@ class YHServiceTableFootView: UIView {
flowLayout.minimumInteritemSpacing = 7.0
flowLayout.minimumColumnSpacing = 7.0
flowLayout.sectionInset = UIEdgeInsets(top: 20, left: 20, bottom: 20, right: 20)
let collectinoView = UICollectionView(frame: .zero, collectionViewLayout: flowLayout)
let collectinoView = YHGestureCollectionView(frame: .zero, collectionViewLayout: flowLayout)
collectinoView.backgroundColor = .white
collectinoView.register(YHHomeCollectionViewCell.self, forCellWithReuseIdentifier:YHHomeCollectionViewCell.cellReuseIdentifier)
collectinoView.delegate = self
......@@ -106,58 +106,58 @@ extension YHServiceTableFootView: UICollectionViewDelegate, UICollectionViewData
}
}
func scrollViewDidScroll(_ scrollView: UIScrollView) {
if scrollView == myCollectView, isNeedScrollBlock == true {
let offsetY = myCollectView.contentOffset.y
if offsetY <= 0 {
myCollectView.isScrollEnabled = false
if let block = scrollBlock {
block(true)
}
} else {
myCollectView.isScrollEnabled = true
if let block = scrollBlock {
block(false)
}
}
}
}
func scrollViewDidEndDragging(_ scrollView: UIScrollView, willDecelerate decelerate: Bool) {
// 用户停止拖拽时调用,可以执行一些后续操作
if scrollView == myCollectView, isNeedScrollBlock == true {
let offsetY = myCollectView.contentOffset.y
if offsetY <= 0 {
myCollectView.isScrollEnabled = false
if let block = scrollBlock {
block(true)
}
} else {
myCollectView.isScrollEnabled = true
if let block = scrollBlock {
block(false)
}
}
}
}
func scrollViewDidEndDecelerating(_ scrollView: UIScrollView) {
// 滚动减速完成时调用,表示滚动完全停止
if scrollView == myCollectView, isNeedScrollBlock == true {
let offsetY = myCollectView.contentOffset.y
if offsetY <= 0 {
myCollectView.isScrollEnabled = false
if let block = scrollBlock {
block(true)
}
} else {
myCollectView.isScrollEnabled = true
if let block = scrollBlock {
block(false)
}
}
}
}
// func scrollViewDidScroll(_ scrollView: UIScrollView) {
// if scrollView == myCollectView, isNeedScrollBlock == true {
// let offsetY = myCollectView.contentOffset.y
// if offsetY <= 0 {
// myCollectView.isScrollEnabled = false
// if let block = scrollBlock {
// block(true)
// }
// } else {
// myCollectView.isScrollEnabled = true
// if let block = scrollBlock {
// block(false)
// }
// }
// }
// }
//
// func scrollViewDidEndDragging(_ scrollView: UIScrollView, willDecelerate decelerate: Bool) {
// // 用户停止拖拽时调用,可以执行一些后续操作
// if scrollView == myCollectView, isNeedScrollBlock == true {
// let offsetY = myCollectView.contentOffset.y
// if offsetY <= 0 {
// myCollectView.isScrollEnabled = false
// if let block = scrollBlock {
// block(true)
// }
// } else {
// myCollectView.isScrollEnabled = true
// if let block = scrollBlock {
// block(false)
// }
// }
// }
// }
//
// func scrollViewDidEndDecelerating(_ scrollView: UIScrollView) {
// // 滚动减速完成时调用,表示滚动完全停止
// if scrollView == myCollectView, isNeedScrollBlock == true {
// let offsetY = myCollectView.contentOffset.y
// if offsetY <= 0 {
// myCollectView.isScrollEnabled = false
// if let block = scrollBlock {
// block(true)
// }
// } else {
// myCollectView.isScrollEnabled = true
// if let block = scrollBlock {
// block(false)
// }
// }
// }
// }
}
......
......@@ -12,7 +12,6 @@ class YHSubmitAllInfoCheckView: UIView {
typealias Block = (Bool) -> ()
var block: Block?
var centerView: UIView!
// var titleLabel: UILabel!
var messageLabel: UILabel!
var agreeButton: UIButton!
var disAgressButton: UIButton!
......
......@@ -220,36 +220,33 @@ extension YHLoginViewController {
@objc func aliCloudLogin() {
if Device.current.isSimulator == false {
let handler = TXCommonHandler.sharedInstance()
handler.accelerateLoginPage(withTimeout:10) { dic in
// guard self != nil else { return }
let resultCode = dic["resultCode"] as? String ?? ""
print("resultCode:\(resultCode)")
}
let model = TXCustomModel()
model.navColor = .orange
let attributes = [
NSAttributedString.Key.font: UIFont.systemFont(ofSize: 20),
NSAttributedString.Key.foregroundColor: UIColor.white,
]
model.navTitle = NSAttributedString(string: "一键登录", attributes: attributes)
model.supportedInterfaceOrientations = UIInterfaceOrientationMask.portrait
handler.getLoginToken(withTimeout: 10.0, controller:self, model:model) { dic in
printLog(dic)
// guard let self = self else { return }
}
}
// if Device.current.isSimulator == false {
//
// let handler = TXCommonHandler.sharedInstance()
// handler.accelerateLoginPage(withTimeout:10) { dic in
//
// let resultCode = dic["resultCode"] as? String ?? ""
// print("resultCode:\(resultCode)")
// }
//
//
// let model = TXCustomModel()
// model.navColor = .orange
// let attributes = [
// NSAttributedString.Key.font: UIFont.systemFont(ofSize: 20),
// NSAttributedString.Key.foregroundColor: UIColor.white,
// ]
//
// model.navTitle = NSAttributedString(string: "一键登录", attributes: attributes)
// model.supportedInterfaceOrientations = UIInterfaceOrientationMask.portrait
//
// handler.getLoginToken(withTimeout: 10.0, controller:self, model:model) { dic in
// printLog(dic)
//
// }
//
//
// }
}
......
......@@ -66,7 +66,6 @@ extension YHShareManager {
var imageObject = WXImageObject()
imageObject.imageData = image.pngData() ?? Data()
message.mediaObject = imageObject
//图片缩略图
var width = 240.0 as CGFloat
var height = width*image.size.height/image.size.width
......
......@@ -5,12 +5,12 @@
"scale" : "1x"
},
{
"filename" : "Group 3040@2x.png",
"filename" : "share_item@2x.png",
"idiom" : "universal",
"scale" : "2x"
},
{
"filename" : "Group 3040@3x.png",
"filename" : "share_item@3x.png",
"idiom" : "universal",
"scale" : "3x"
}
......
......@@ -5,12 +5,12 @@
"scale" : "1x"
},
{
"filename" : "card_upload@2x.png",
"filename" : "xinxi_Upload@2x.png",
"idiom" : "universal",
"scale" : "2x"
},
{
"filename" : "card_upload@3x.png",
"filename" : "xinxi_Upload@3x.png",
"idiom" : "universal",
"scale" : "3x"
}
......
{
"images" : [
{
"idiom" : "universal",
"scale" : "1x"
},
{
"filename" : "main_time_select@2x.png",
"idiom" : "universal",
"scale" : "2x"
},
{
"filename" : "main_time_select@3x.png",
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}
{
"images" : [
{
"idiom" : "universal",
"scale" : "1x"
},
{
"filename" : "service_card_complete@2x.png",
"idiom" : "universal",
"scale" : "2x"
},
{
"filename" : "service_card_complete@3x.png",
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}
{
"images" : [
{
"idiom" : "universal",
"scale" : "1x"
},
{
"filename" : "service_step_fail@2x.png",
"idiom" : "universal",
"scale" : "2x"
},
{
"filename" : "service_step_fail@3x.png",
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}
{
"images" : [
{
"idiom" : "universal",
"scale" : "1x"
},
{
"filename" : "service_step_now@2x.png",
"idiom" : "universal",
"scale" : "2x"
},
{
"filename" : "service_step_now@3x.png",
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}
{
"images" : [
{
"idiom" : "universal",
"scale" : "1x"
},
{
"filename" : "service_step_success@2x.png",
"idiom" : "universal",
"scale" : "2x"
},
{
"filename" : "service_step_success@3x.png",
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}
{
"images" : [
{
"idiom" : "universal",
"scale" : "1x"
},
{
"filename" : "Rectangle 2490@2x.png",
"idiom" : "universal",
"scale" : "2x"
},
{
"filename" : "Rectangle 2490@3x.png",
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}
{
"images" : [
{
"idiom" : "universal",
"scale" : "1x"
},
{
"filename" : "document_prompt_icon@2x.png",
"idiom" : "universal",
"scale" : "2x"
},
{
"filename" : "document_prompt_icon@3x.png",
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}
//
// ATAuthSDK.h
// ATAuthSDK
//
// Created by yangli on 2020/11/11.
// Copyright © 2020. All rights reserved.
//
#import <Foundation/Foundation.h>
//! Project version number for ATAuthSDK.
FOUNDATION_EXPORT double ATAuthSDKVersionNumber;
//! Project version string for ATAuthSDK.
FOUNDATION_EXPORT const unsigned char ATAuthSDKVersionString[];
// In this header, you should import all the public headers of your framework using statements like #import <ATAuthSDK/PublicHeader.h>
#import "TXCommonHandler.h"
#import "TXCommonUtils.h"
#import "PNSReturnCode.h"
#import "TXCustomModel.h"
#import "PNSReporter.h"
//
// PNSReporter.h
// ATAuthSDK
//
// Created by 刘超的MacBook on 2020/5/21.
// Copyright © 2020. All rights reserved.
//
#import <Foundation/Foundation.h>
NS_ASSUME_NONNULL_BEGIN
typedef NS_ENUM(NSInteger, PNSLoggerLevel) {
PNSLoggerLevelVerbose = 1,
PNSLoggerLevelDebug,
PNSLoggerLevelInfo,
PNSLoggerLevelWarn,
PNSLoggerLevelError
};
@interface PNSReporter : NSObject
/**
* 控制台日志输出开关,若开启会以PNS_LOGGER为开始标记对日志进行输出,Release模式记得关闭!
* @param enable 开关参数,默认为NO
*/
- (void)setConsolePrintLoggerEnable:(BOOL)enable;
/**
* 设置埋点上传开关,但不会对通过 setupUploader: 接口实现的自定义上传方法起作用
* @param enable 开关设置BOOL值,默认为YES
*/
- (void)setUploadEnable:(BOOL)enable DEPRECATED_MSG_ATTRIBUTE("日志不再上传");
@end
NS_ASSUME_NONNULL_END
//
// PNSReturnCode.h
// ATAuthSDK
//
// Created by 刘超的MacBook on 2019/9/4.
// Copyright © 2019. All rights reserved.
//
#ifndef PNSReturnCode_h
#define PNSReturnCode_h
#import <Foundation/Foundation.h>
#pragma mark - 该返回码为阿里云号码认证SDK⾃身的返回码,请注意600011及600012错误内均含有运营商返回码,具体错误在碰到之后查阅 https://help.aliyun.com/document_detail/85351.html?spm=a2c4g.11186623.6.561.32a7360cxvWk6H
/// 接口成功
static NSString * const PNSCodeSuccess = @"600000";
/// 获取运营商配置信息失败
static NSString * const PNSCodeGetOperatorInfoFailed = @"600004";
/// 未检测到sim卡
static NSString * const PNSCodeNoSIMCard = @"600007";
/// 蜂窝网络未开启或不稳定
static NSString * const PNSCodeNoCellularNetwork = @"600008";
/// 无法判运营商
static NSString * const PNSCodeUnknownOperator = @"600009";
/// 未知异常
static NSString * const PNSCodeUnknownError = @"600010";
/// 获取token失败
static NSString * const PNSCodeGetTokenFailed = @"600011";
/// 预取号失败
static NSString * const PNSCodeGetMaskPhoneFailed = @"600012";
/// 运营商维护升级,该功能不可用
static NSString * const PNSCodeInterfaceDemoted = @"600013";
/// 运营商维护升级,该功能已达最大调用次数
static NSString * const PNSCodeInterfaceLimited = @"600014";
/// 接口超时
static NSString * const PNSCodeInterfaceTimeout = @"600015";
/// AppID、Appkey解析失败
static NSString * const PNSCodeDecodeAppInfoFailed = @"600017";
/// 该号码已被运营商管控,目前只有联通号码有该功能
static NSString * const PNSCodePhoneBlack = @"600018";
/// 运营商已切换
static NSString * const PNSCodeCarrierChanged = @"600021";
/// 终端环境检测失败(终端不支持认证 / 终端检测参数错误)
static NSString * const PNSCodeEnvCheckFail = @"600025";
/*************** 号码认证授权页相关返回码 START ***************/
/// 唤起授权页成功
static NSString * const PNSCodeLoginControllerPresentSuccess = @"600001";
/// 唤起授权页失败
static NSString * const PNSCodeLoginControllerPresentFailed = @"600002";
/// 授权页已加载时不允许调用加速或预取号接口
static NSString * const PNSCodeCallPreLoginInAuthPage = @"600026";
/// 点击返回,⽤户取消一键登录
static NSString * const PNSCodeLoginControllerClickCancel = @"700000";
/// 点击切换按钮,⽤户取消免密登录
static NSString * const PNSCodeLoginControllerClickChangeBtn = @"700001";
/// 点击登录按钮事件
static NSString * const PNSCodeLoginControllerClickLoginBtn = @"700002";
/// 点击CheckBox事件
static NSString * const PNSCodeLoginControllerClickCheckBoxBtn = @"700003";
/// 点击协议富文本文字
static NSString * const PNSCodeLoginControllerClickProtocol = @"700004";
/// 中断页面消失的时候,也就是suspendDisMissVC设置为YES的时候,点击左上角返回按钮时透出的状态码
static NSString * const PNSCodeLoginControllerSuspendDisMissVC = @"700010";
/*************** 号码认证授权页相关返回码 FINISH ***************/
/*************** 二次授权页返回code码 START ***************/
/// 点击一键登录拉起授权页二次弹窗
static NSString * const PNSCodeLoginClickPrivacyAlertView = @"700006";
/// 隐私协议二次弹窗关闭
static NSString * const PNSCodeLoginPrivacyAlertViewClose = @"700007";
/// 隐私协议二次弹窗点击确认并继续
static NSString * const PNSCodeLoginPrivacyAlertViewClickContinue = @"700008";
/// 点击隐私协议二次弹窗上的协议富文本文字
static NSString * const PNSCodeLoginPrivacyAlertViewPrivacyContentClick = @"700009";
/*************** 二次授权页返回code码 FINISH ***************/
#endif /* PNSReturnCode_h */
//
// TXCommonHandler.h
// ATAuthSDK
//
// Created by yangli on 15/03/2018.
#import <Foundation/Foundation.h>
#import "TXCustomModel.h"
#import "PNSReporter.h"
typedef NS_ENUM(NSInteger, PNSAuthType) {
PNSAuthTypeVerifyToken = 1, //本机号码校验
PNSAuthTypeLoginToken = 2 //一键登录
};
@interface TXCommonHandler : NSObject
/**
* 获取该类的单例实例对象
* @return 单例实例对象
*/
+ (instancetype _Nonnull )sharedInstance;
/**
* 获取当前SDK版本号
* @return 字符串,sdk版本号
*/
- (NSString *_Nonnull)getVersion;
/**
* SDK鉴权,app生命周期内调用一次
* @param info app对应的秘钥
* @param complete 结果异步回调到主线程,成功时resultDic=@{resultCode:600000, msg:...},其他情况时"resultCode"值请参考PNSReturnCode
*/
- (void)setAuthSDKInfo:(NSString * _Nonnull)info complete:(void(^_Nullable)(NSDictionary * _Nonnull resultDic))complete;
/**
* 检查当前环境是否支持一键登录或号码认证,resultDic 返回 PNSCodeSuccess 说明当前环境支持
* @param authType 服务类型 PNSAuthTypeVerifyToken 本机号码校验流程,PNSAuthTypeLoginToken 一键登录流程
* @param complete 结果异步回调到主线程,成功时resultDic=@{resultCode:600000, msg:...},其他情况时"resultCode"值请参考PNSReturnCode,只有成功回调才能保障后续接口调用
*/
- (void)checkEnvAvailableWithAuthType:(PNSAuthType)authType complete:(void (^_Nullable)(NSDictionary * _Nullable resultDic))complete;
/**
* 加速获取本机号码校验token,防止调用 getVerifyTokenWithTimeout:complete: 获取token时间过长
* @param timeout 接口超时时间,单位s,默认为3.0s
* @param complete 结果异步回调到主线程,成功时resultDic=@{resultCode:600000, token:..., msg:...},其他情况时"resultCode"值请参考PNSReturnCode
*/
- (void)accelerateVerifyWithTimeout:(NSTimeInterval)timeout complete:(void (^_Nullable)(NSDictionary * _Nonnull resultDic))complete;
/**
* 获取本机号码校验Token
* @param timeout 接口超时时间,单位s,默认为3.0s
* @param complete 结果异步回调到主线程,成功时resultDic=@{resultCode:600000, token:..., msg:...},其他情况时"resultCode"值请参考PNSReturnCode
*/
- (void)getVerifyTokenWithTimeout:(NSTimeInterval)timeout complete:(void (^_Nullable)(NSDictionary * _Nonnull resultDic))complete;
/**
* 加速一键登录授权页弹起,防止调用 getLoginTokenWithTimeout:controller:model:complete: 等待弹起授权页时间过长
* @param timeout 接口超时时间,单位s,默认为3.0s
* @param complete 结果异步回调到主线程,成功时resultDic=@{resultCode:600000, msg:...},其他情况时"resultCode"值请参考PNSReturnCode
*/
- (void)accelerateLoginPageWithTimeout:(NSTimeInterval)timeout complete:(void (^_Nullable)(NSDictionary * _Nonnull resultDic))complete;
/**
* 获取一键登录Token,调用该接口首先会弹起授权页,点击授权页的登录按钮获取Token
* @warning 注意的是,如果前面没有调用 accelerateLoginPageWithTimeout:complete: 接口,该接口内部会自动先帮我们调用,成功后才会弹起授权页,所以有一个明显的等待过程
* @param timeout 接口超时时间,单位s,默认为3.0s
* @param controller 唤起自定义授权页的容器,内部会对其进行验证,检查是否符合条件
* @param model 自定义授权页面选项,可为nil,采用默认的授权页面,具体请参考TXCustomModel.h文件
* @param complete 结果异步回调到主线程,"resultDic"里面的"resultCode"值请参考PNSReturnCode,如下:
*
* 授权页控件点击事件:700000(点击授权页返回按钮)、700001(点击切换其他登录方式)、
* 700002(点击登录按钮事件,根据返回字典里面的 "isChecked"字段来区分check box是否被选中,只有被选中的时候内部才会去获取Token)、700003(点击check box事件)、700004(点击协议富文本文字)
接口回调其他事件:600001(授权页唤起成功)、600002(授权页唤起失败)、600000(成功获取Token)、600011(获取Token失败)、
* 600015(获取Token超时)、600013(运营商维护升级,该功能不可用)、600014(运营商维护升级,该功能已达最大调用次数).....
*/
- (void)getLoginTokenWithTimeout:(NSTimeInterval)timeout controller:(UIViewController *_Nonnull)controller model:(TXCustomModel *_Nullable)model complete:(void (^_Nullable)(NSDictionary * _Nonnull resultDic))complete;
/**
* 此接口仅用于开发期间用于一键登录页面不同机型尺寸适配调试(可支持模拟器),非正式页面,手机掩码为0,不能正常登录,请开发者注意下
* @param controller 唤起自定义授权页的容器,内部会对其进行验证,检查是否符合条件
* @param model 自定义授权页面选项,可为nil,采用默认的授权页面,具体请参考TXCustomModel.h文件
* @param complete 结果异步回调到主线程,"resultDic"里面的"resultCode"值请参考PNSReturnCode
*/
- (void)debugLoginUIWithController:(UIViewController *_Nonnull)controller model:(TXCustomModel *_Nullable)model complete:(void (^_Nullable)(NSDictionary * _Nonnull resultDic))complete;
/**
* 授权页弹起后,修改checkbox按钮选中状态,当checkout按钮隐藏时,设置不生效
*/
- (void)setCheckboxIsChecked:(BOOL)isChecked;
/**
* 查询授权页checkbox是否勾选,YES:勾选,NO:未勾选
*/
- (BOOL)queryCheckBoxIsChecked;
/**
* 授权页协议内容动画执行,注意:必须设置privacyAnimation属性,才会执行动画
*/
- (void)privacyAnimationStart;
/**
* 授权页checkbox动画执行,注意:必须设置checkboxAnimation属性,才会执行动画
*/
- (void)checkboxAnimationStart;
/**
* 手动隐藏一键登录获取登录Token之后的等待动画,默认为自动隐藏,当设置 TXCustomModel 实例 autoHideLoginLoading = NO 时, 可调用该方法手动隐藏
*/
- (void)hideLoginLoading;
/**
* 注销授权页,建议用此方法,对于移动卡授权页的消失会清空一些数据
* @param flag 是否添加动画
* @param complete 成功返回
*/
- (void)cancelLoginVCAnimated:(BOOL)flag complete:(void (^_Nullable)(void))complete;
/**
* 获取日志埋点相关控制对象
*/
- (PNSReporter * _Nonnull)getReporter;
/**
* 关闭二次授权弹窗页
*/
- (void)closePrivactAlertView;
/**
* 检查及准备调用环境,resultDic返回PNSCodeSuccess才能调用下面的功能接口
* @param complete 结果异步回调到主线程,成功时resultDic=@{resultCode:600000, msg:...},其他情况时"resultCode"值请参考PNSReturnCode,只有成功回调才能保障后续接口调用
*/
- (void)checkEnvAvailableWithComplete:(void (^_Nullable)(NSDictionary * _Nullable resultDic))complete DEPRECATED_MSG_ATTRIBUTE("Please use checkEnvAvailableWithAuthType:complete: instead");
@end
//
// TXCommonUtils.h
// authsdk
//
// Created by yangli on 12/03/2018.
#import <Foundation/Foundation.h>
@interface TXCommonUtils : NSObject
/**
判断当前设备蜂窝数据网络是否开启,即3G/4G
@return 结果
*/
+ (BOOL)checkDeviceCellularDataEnable;
/**
判断当前上网卡运营商是否是中国联通
@return 结果
*/
+ (BOOL)isChinaUnicom;
/**
判断当前上网卡运营商是否是中国移动
@return 结果
*/
+ (BOOL)isChinaMobile;
/**
判断当前上网卡运营商是否是中国电信
@return 结果
*/
+ (BOOL)isChinaTelecom;
/**
获取当前上网卡运营商名称,比如中国移动、中国电信、中国联通
@return 结果
*/
+ (NSString *)getCurrentCarrierName;
/**
获取当前上网卡网络类型,比如WiFi,4G
@return 结果
*/
+ (NSString *)getNetworktype;
/**
判断当前设备是否有SIM卡
@return 结果
*/
+ (BOOL)simSupportedIsOK;
/**
判断wwan是否开着(通过p0网卡判断,无wifi或有wifi情况下都能检测到)
@return 结果
*/
+ (BOOL)isWWANOpen;
/**
判断wwan是否开着(仅无wifi情况下)
@return 结果
*/
+ (BOOL)reachableViaWWAN;
/**
获取设备当前网络私网IP地址
@return 结果
*/
+ (NSString *)getMobilePrivateIPAddress:(BOOL)preferIPv4;
/**
获取当前设备的唯一标识ID
*/
+ (NSString *)getUniqueID;
/**
通过颜色设置生成图片,支持弧度设置,比如一键登录按钮背景图片
*/
+ (UIImage *)imageWithColor:(UIColor *)color size:(CGSize)size isRoundedCorner:(BOOL )isRounded radius:(CGFloat)radius;
@end
......@@ -9,7 +9,7 @@
#define galaxy_Bridge_Header_h
#import <Bugly/Bugly.h>
#import <ATAuthSDK_D/ATAuthSDK.h>
//#import <ATAuthSDK_D/ATAuthSDK.h>
//#import <AliyunOSSiOS/OSSService.h>
#import "WXApi.h"
#import "JPUSHService.h"
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment