Commit da73d624 authored by David黄金龙's avatar David黄金龙

tabbar 上的shareView

parent a0dbf94b
...@@ -5,6 +5,8 @@ platform :ios, '13.0' ...@@ -5,6 +5,8 @@ platform :ios, '13.0'
target 'galaxy' do target 'galaxy' do
use_frameworks! use_frameworks!
#与H5进行交互
pod "dsBridge",'3.0.6'
#网络检查 #网络检查
pod 'ReachabilitySwift','5.0.0' pod 'ReachabilitySwift','5.0.0'
#键盘处理 #键盘处理
......
...@@ -20,7 +20,7 @@ class AppDelegate: UIResponder, UIApplicationDelegate, WXApiDelegate { ...@@ -20,7 +20,7 @@ class AppDelegate: UIResponder, UIApplicationDelegate, WXApiDelegate {
func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool { func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool {
Thread.sleep(forTimeInterval: 0.25) // 应产品同学Nick要求 启动页时间展示长点 Thread.sleep(forTimeInterval: 0.5) // 应产品同学Nick要求 启动页时间展示长点
setupAudionConfig() setupAudionConfig()
......
...@@ -16,6 +16,20 @@ class YHTabBarViewController: ESTabBarController { ...@@ -16,6 +16,20 @@ class YHTabBarViewController: ESTabBarController {
return model return model
}() }()
lazy var testView: UIView = {
let view = UIView()
view.backgroundColor = .purple
view.isHidden = true
return view
}()
override func viewDidLayoutSubviews() {
super.viewDidLayoutSubviews()
testView.frame = self.tabBar.frame
testView.bringSubviewToFront(testView)
}
override func viewDidLoad() { override func viewDidLoad() {
super.viewDidLoad() super.viewDidLoad()
handleTabBarLine() handleTabBarLine()
...@@ -23,12 +37,18 @@ class YHTabBarViewController: ESTabBarController { ...@@ -23,12 +37,18 @@ class YHTabBarViewController: ESTabBarController {
if YHLoginManager.shared.isLogin() { if YHLoginManager.shared.isLogin() {
reportDeviceInfo() reportDeviceInfo()
} }
testView.frame = self.tabBar.frame
view.addSubview(testView)
} }
func addObservers() { func addObservers() {
NotificationCenter.default.addObserver(self, selector: #selector(loginSuccess), name: YhConstant.YhNotification.didLoginSuccessNotifiction, object: nil) NotificationCenter.default.addObserver(self, selector: #selector(loginSuccess), name: YhConstant.YhNotification.didLoginSuccessNotifiction, object: nil)
NotificationCenter.default.addObserver(self, selector: #selector(logoutSuccess), name: YhConstant.YhNotification.didLogoutSuccessNotifiction, object: nil) NotificationCenter.default.addObserver(self, selector: #selector(logoutSuccess), name: YhConstant.YhNotification.didLogoutSuccessNotifiction, object: nil)
NotificationCenter.default.addObserver(self, selector: #selector(clearAllUnreadBadge), name: YhConstant.YhNotification.didMarkAllMessagesReadedNotifiction, object: nil)
NotificationCenter.default.addObserver(self, selector: #selector(changeShareViewStatus(_ :)), name: YhConstant.YhNotification.changeShareViewStatusOnTabBarNotifiction, object: nil)
} }
} }
...@@ -50,6 +70,29 @@ extension YHTabBarViewController { ...@@ -50,6 +70,29 @@ extension YHTabBarViewController {
printLog("登出成功") printLog("登出成功")
} }
@objc func changeShareViewStatus(_ notification: Notification) {
if let dic = notification.object as? [String : Any] {
let show = dic["show"] as? Int ?? 0
if show == 0 {
testView.isHidden = true
testView.layer.opacity = 1.0
UIView.animate(withDuration: 0.25, delay: 0, options: [.curveEaseOut]) {
self.testView.layer.opacity = 0.0
} completion: { finish in }
} else if show == 1 {
self.testView.isHidden = false
self.testView.layer.opacity = 0.0
UIView.animate(withDuration: 0.25, delay: 0, options: [.curveEaseIn]) {
self.testView.layer.opacity = 1.0
} completion: { finish in }
} else {
testView.isHidden = true
}
}
}
@objc func clearAllUnreadBadge() { @objc func clearAllUnreadBadge() {
DispatchQueue.main.async { DispatchQueue.main.async {
......
...@@ -69,6 +69,7 @@ private extension YHStatusAdvantageVC { ...@@ -69,6 +69,7 @@ private extension YHStatusAdvantageVC {
webview = WKWebView(frame: CGRect(x: 0, y: statusHeight + navHeight!, width: self.view.frame.width, height: self.view.frame.height - statusHeight - navHeight! - 59 - k_Height_safeAreaInsetsBottom())) webview = WKWebView(frame: CGRect(x: 0, y: statusHeight + navHeight!, width: self.view.frame.width, height: self.view.frame.height - statusHeight - navHeight! - 59 - k_Height_safeAreaInsetsBottom()))
webview.navigationDelegate = self webview.navigationDelegate = self
webview.scrollView.contentInsetAdjustmentBehavior = .never webview.scrollView.contentInsetAdjustmentBehavior = .never
webview.scrollView.bounces = false
// 创建网址 // 创建网址
let url = NSURL(string: url) let url = NSURL(string: url)
// 创建请求 // 创建请求
......
...@@ -13,6 +13,9 @@ class YHMessageBellView: UIView { ...@@ -13,6 +13,9 @@ class YHMessageBellView: UIView {
static let width = 53.0 static let width = 53.0
static let height = 36.0 static let height = 36.0
var testNumber : Int = 0 //for test hjl
var unreadCount:Int = 0 { var unreadCount:Int = 0 {
didSet { didSet {
self.unreadLabel.isHidden = (self.unreadCount <= 0) self.unreadLabel.isHidden = (self.unreadCount <= 0)
...@@ -92,9 +95,19 @@ class YHMessageBellView: UIView { ...@@ -92,9 +95,19 @@ class YHMessageBellView: UIView {
return return
} }
NotificationCenter.default.post(name: YhConstant.YhNotification.clickHomeMsgNotifiction, object: nil) // NotificationCenter.default.post(name: YhConstant.YhNotification.clickHomeMsgNotifiction, object: nil)
let vc = YHMessageListVC() // let vc = YHMessageListVC()
UIViewController.current?.navigationController?.pushViewController(vc) // UIViewController.current?.navigationController?.pushViewController(vc)
}
//todo: for test hjl
testNumber = testNumber + 1
if testNumber % 2 == 0 {
let dic = ["show":0,"other":"https://www.baidu.com"] as [String : Any]
NotificationCenter.default.post(name: YhConstant.YhNotification.changeShareViewStatusOnTabBarNotifiction, object: dic)
} else {
let dic = ["show":1,"other":"https://www.baidu.com"] as [String : Any]
NotificationCenter.default.post(name: YhConstant.YhNotification.changeShareViewStatusOnTabBarNotifiction, object: dic)
}
}
} }
...@@ -263,5 +263,8 @@ extension YhConstant { ...@@ -263,5 +263,8 @@ extension YhConstant {
// 去看一看点击后开始匹配用户 // 去看一看点击后开始匹配用户
public static let didLookPeopleSuccessNotifiction = Notification.Name(rawValue: "com.yinhe.look.people.success") public static let didLookPeopleSuccessNotifiction = Notification.Name(rawValue: "com.yinhe.look.people.success")
// 改变底部tabbar上 分享View的展示状态
public static let changeShareViewStatusOnTabBarNotifiction = Notification.Name(rawValue: "com.yinhe.change.shareView.status")
} }
} }
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