Commit d9e4e9d7 authored by pete谢兆麟's avatar pete谢兆麟

Merge commit '95525c33' into xiezhaolin

parents 4a577b82 95525c33
......@@ -20,7 +20,7 @@ class YHHomePageViewController: YHBaseViewController {
// 设置布局方向
let flowLayout = YHHomeCollectionLayout()
flowLayout.minimumInteritemSpacing = 7.0
flowLayout.minimumColumnSpacing = 10.0
flowLayout.minimumColumnSpacing = 7.0
flowLayout.sectionInset = UIEdgeInsets(top: 0, left: 20, bottom: 0, right: 20)
let collectinoView = UICollectionView(frame: .zero, collectionViewLayout: flowLayout)
......
......@@ -75,10 +75,7 @@ class YHSearchInfomationVC: YHBaseViewController {
lazy var tableView: UITableView = {
let tableView = UITableView(frame:.zero, style:.grouped)
if #available(iOS 11.0, *) {
tableView.contentInsetAdjustmentBehavior = .never
}
tableView.contentInsetAdjustmentBehavior = .never
tableView.estimatedSectionHeaderHeight = 0.1
tableView.estimatedSectionFooterHeight = 20.0
tableView.showsVerticalScrollIndicator = false
......
......@@ -32,7 +32,7 @@ class YHHomeBannerView: UIView {
let view = FSPagerView()
view.delegate = self
view.dataSource = self
view.automaticSlidingInterval = 4
view.automaticSlidingInterval = 3
view.register(YHHomeBannerCollectionViewCell.self, forCellWithReuseIdentifier: "cell")
view.itemSize = CGSizeMake(YHHomeBannerView.viewH, YHHomeBannerView.viewH)//FSPagerView.automaticSize
return view
......
......@@ -39,7 +39,7 @@ class YHSearchInfoCell: UITableViewCell {
lazy var titleLabel: UILabel = {
var label = UILabel()
label.font = .PFSC_R(ofSize: 12)
label.font = .PFSC_R(ofSize: 15)
label.textAlignment = .left
label.textColor = UIColor(hex: 0x121A26)
label.numberOfLines = 2
......
......@@ -81,4 +81,27 @@ extension YHLoginViewModel {
callBackBlock(false,err)
}
}
func logout(_ callBackBlock: @escaping (_ success: Bool,_ error: YHErrorModel?)->()) {
let strUrl = YHBaseUrlManager.shared.curURL() + YHAllApiName.Auth.logout
let _ = YHNetRequest.postRequest(url: strUrl) {
[weak self] json, code in
//1. json字符串 转 对象
guard let self = self else { return }
printLog(json)
let dic = json.data
if json.code == 200 {
callBackBlock(true, nil)
} else {
let error : YHErrorModel = YHErrorModel(errorCode:Int32(json.code), errorMsg: json.msg)
callBackBlock(false, error)
}
} failBlock: { error in
callBackBlock(false, error)
}
}
}
......@@ -14,6 +14,7 @@ class YHMyNotifySettingVC: YHBaseViewController {
lazy var tableView: UITableView = {
let tableView = UITableView(frame:.zero, style:.grouped)
tableView.contentInsetAdjustmentBehavior = .never
tableView.estimatedSectionFooterHeight = 1.0
tableView.showsVerticalScrollIndicator = false
tableView.separatorStyle = .none
......
......@@ -38,6 +38,7 @@ class YHMyPermissionSettingVC: YHBaseViewController {
lazy var tableView: UITableView = {
let tableView = UITableView(frame:.zero, style:.grouped)
tableView.contentInsetAdjustmentBehavior = .never
tableView.estimatedSectionFooterHeight = 1.0
tableView.showsVerticalScrollIndicator = false
tableView.separatorStyle = .none
......
......@@ -11,11 +11,10 @@ import SnapKit
class YHMySettingViewController: YHBaseViewController, ConstraintRelatableTarget {
let viewModel: YHLoginViewModel = YHLoginViewModel()
lazy var tableView: UITableView = {
let tableView = UITableView(frame: CGRect.zero, style:.plain)
if #available(iOS 11.0, *) {
tableView.contentInsetAdjustmentBehavior = .never
}
tableView.contentInsetAdjustmentBehavior = .never
tableView.backgroundColor = .white
tableView.separatorStyle = .none
tableView.register(YHMySettingCell.self, forCellReuseIdentifier: YHMySettingCell.cellReuseIdentifier)
......@@ -114,10 +113,27 @@ class YHMySettingViewController: YHBaseViewController, ConstraintRelatableTarget
}
@objc func logout() {
YHLoginManager.shared.clearUserInfo()
NotificationCenter.default.post(name: YhConstant.YhNotification.didLogoutSuccessNotifiction, object: nil)
YHHUD.flash(message: "退出成功")
self.navigationController?.popViewController(animated: true)
YHHUD.show(.progress(message: "退出登录中..."))
self.viewModel.logout() {
[weak self] success, error in
guard let self = self else { return }
YHHUD.hide()
if success {
DispatchQueue.main.async {
YHHUD.flash(message: "退出成功")
YHLoginManager.shared.clearUserInfo()
NotificationCenter.default.post(name: YhConstant.YhNotification.didLogoutSuccessNotifiction, object: nil)
self.navigationController?.popViewController(animated: true)
}
return
}
var msg = "退出失败"
if let error = error, !error.errorMsg.isEmpty {
msg = error.errorMsg
}
YHHUD.flash(message: msg)
}
}
}
......
......@@ -45,12 +45,10 @@ class YHMyViewController: YHBaseViewController, ConstraintRelatableTarget {
let likeViewModel: YHMyLikeViewModel = YHMyLikeViewModel()
let msgViewModel: YHMsgViewModel = YHMsgViewModel()
lazy var tableView: UITableView = {
let tableView = UITableView(frame: CGRect.zero, style:.grouped)
if #available(iOS 11.0, *) {
tableView.contentInsetAdjustmentBehavior = .never
}
tableView.contentInsetAdjustmentBehavior = .never
tableView.estimatedSectionHeaderHeight = 1.0
tableView.showsVerticalScrollIndicator = false
tableView.tableHeaderView = headerView
......@@ -156,6 +154,7 @@ class YHMyViewController: YHBaseViewController, ConstraintRelatableTarget {
gk_navigationBar.isHidden = true
view.addSubview(tableView)
self.view.backgroundColor = .white
updateUserUI()
......@@ -239,12 +238,17 @@ extension YHMyViewController : UITableViewDelegate, UITableViewDataSource {
var token : String = param
//待h5端同学提供
var url = "https:www.baidu.com"
#if DEBUG
var url = "https://test-hkdiy-h5.galaxy-immi.com/superApp/integral"
#elseif TESTNEV
var url = "https://test-hkdiy-h5.galaxy-immi.com/superApp/integral"
#else
var url = "https://thkdiy-h5.galaxy-immi.com/superApp/integral"
#endif
let addtionString = randomAlphanumericString(6)//随机6个字母或者数字
let indexToInsert = token.index(token.startIndex, offsetBy: 6) //插入位置,这里以第六个字符后面为例
token.insert(contentsOf: addtionString, at: indexToInsert)
url = url + "?param=" + token
YHHUD.flash(message: "还需要H5同学给URL")
printLog(url)
......@@ -270,14 +274,32 @@ extension YHMyViewController : UITableViewDelegate, UITableViewDataSource {
printLog("不需要响应")
}
}
private func tableView(_ tableView: UITableView, viewForHeaderInSection section: Int) -> CGFloat {
return 1.0
}
private func tableView(_ tableView: UITableView, viewForFooterInSection section: Int) -> CGFloat {
return 1.0
}
func tableView(_ tableView: UITableView, viewForFooterInSection section: Int) -> UIView? {
return UIView()
}
func tableView(_ tableView: UITableView, viewForHeaderInSection section: Int) -> UIView? {
return UIView()
}
}
extension YHMyViewController {
func randomAlphanumericString(_ length: Int) -> String {
let letters = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789"
let randomString = (0..<length).map{ _ in String(letters.randomElement()!) }.reduce("", +)
return randomString
let letters = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789"
let randomString = (0..<length).map{ _ in String(letters.randomElement()!) }.reduce("", +)
return randomString
}
@objc func loginSuccess() {
......
......@@ -12,10 +12,10 @@ import UIKit
extension UIColor {
//品牌主色
static let brandMainColor : UIColor = UIColor(hexString: "#2F7EF6")!
static let brandMainColor : UIColor = UIColor(hexString: "#3570DC")!
//品牌渐变色
static let arrBrandGradaterColors : [UIColor] = [UIColor(hexString: "#2274EE")!,UIColor(hexString: "#3A85FC")!]
static let arrBrandGradaterColors : [UIColor] = [UIColor(hexString: "#3570DC")!,UIColor(hexString: "#3A85FC")!]
//品牌主色 16
static let brandMainColor16 : UIColor = UIColor(hexString: "#2F7EF6",transparency: 0.16)!
......
......@@ -162,6 +162,7 @@ class YHAllApiName {
//登录
struct Auth {
static let login = "infoflow/auth/login"
static let logout = "infoflow/auth/logout"
}
//获取验证
......
......@@ -5,12 +5,12 @@
"scale" : "1x"
},
{
"filename" : "更多内容敬请期待@2x.png",
"filename" : "Group 3098@2x.png",
"idiom" : "universal",
"scale" : "2x"
},
{
"filename" : "更多内容敬请期待@3x.png",
"filename" : "Group 3098@3x.png",
"idiom" : "universal",
"scale" : "3x"
}
......
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