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

Merge commit '1c81bb11' into xiezhaolin

parents 33875590 1c81bb11
......@@ -2240,9 +2240,9 @@
A5ACE95C2B457133002C94D2 /* C */ = {
isa = PBXGroup;
children = (
044413F62BC2786200784A14 /* YHHomeWebViewController.swift */,
A53D381F2BC243F1006AE6F7 /* YHStartPageViewController.swift */,
A5173D672BC399B9007D4E74 /* YHHomePageViewController.swift */,
A53D381F2BC243F1006AE6F7 /* YHStartPageViewController.swift */,
044413F62BC2786200784A14 /* YHHomeWebViewController.swift */,
044E1E802BC3BBC200A3B4AF /* YHSearchInfomationVC.swift */,
A5A4FD622BC79901001EF9F7 /* YHConfigManager.swift */,
048B2A472BC7CE4800A93BF0 /* YHFourKingViewController.swift */,
......@@ -2972,7 +2972,7 @@
CODE_SIGN_IDENTITY = "Apple Development";
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
CODE_SIGN_STYLE = Manual;
CURRENT_PROJECT_VERSION = 1;
CURRENT_PROJECT_VERSION = 10;
DEVELOPMENT_TEAM = "";
"DEVELOPMENT_TEAM[sdk=iphoneos*]" = RXHYW88XR7;
ENABLE_USER_SCRIPT_SANDBOXING = NO;
......@@ -2992,7 +2992,7 @@
"$(inherited)",
"@executable_path/Frameworks",
);
MARKETING_VERSION = 0.2.10;
MARKETING_VERSION = 0.2.9;
PRODUCT_BUNDLE_IDENTIFIER = com.intelligence.galaxy;
PRODUCT_NAME = "$(TARGET_NAME)";
PROVISIONING_PROFILE_SPECIFIER = "";
......@@ -3173,7 +3173,7 @@
CODE_SIGN_IDENTITY = "Apple Development";
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
CODE_SIGN_STYLE = Manual;
CURRENT_PROJECT_VERSION = 1;
CURRENT_PROJECT_VERSION = 10;
DEVELOPMENT_TEAM = "";
"DEVELOPMENT_TEAM[sdk=iphoneos*]" = RXHYW88XR7;
ENABLE_USER_SCRIPT_SANDBOXING = NO;
......@@ -3193,7 +3193,7 @@
"$(inherited)",
"@executable_path/Frameworks",
);
MARKETING_VERSION = 0.2.10;
MARKETING_VERSION = 0.2.9;
PRODUCT_BUNDLE_IDENTIFIER = com.intelligence.galaxy;
PRODUCT_NAME = "$(TARGET_NAME)";
PROVISIONING_PROFILE_SPECIFIER = "";
......@@ -3215,7 +3215,7 @@
CODE_SIGN_IDENTITY = "Apple Development";
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
CODE_SIGN_STYLE = Manual;
CURRENT_PROJECT_VERSION = 1;
CURRENT_PROJECT_VERSION = 10;
DEVELOPMENT_TEAM = "";
"DEVELOPMENT_TEAM[sdk=iphoneos*]" = RXHYW88XR7;
ENABLE_USER_SCRIPT_SANDBOXING = NO;
......@@ -3235,7 +3235,7 @@
"$(inherited)",
"@executable_path/Frameworks",
);
MARKETING_VERSION = 0.2.10;
MARKETING_VERSION = 0.2.9;
PRODUCT_BUNDLE_IDENTIFIER = com.intelligence.galaxy;
PRODUCT_NAME = "$(TARGET_NAME)";
PROVISIONING_PROFILE_SPECIFIER = "";
......
......@@ -52,13 +52,16 @@ extension AppDelegate: JPUSHRegisterDelegate {
func application(_ application: UIApplication, didReceiveRemoteNotification userInfo: [AnyHashable : Any], fetchCompletionHandler completionHandler: @escaping (UIBackgroundFetchResult) -> Void) {
JPUSHService.handleRemoteNotification(userInfo)
completionHandler(UIBackgroundFetchResult.newData)
// 转换到消息tab
NotificationCenter.default.post(name: YhConstant.YhNotification.didSwithToMsgTabNotification, object: nil)
}
//后台进前台
func applicationDidEnterBackground(_ application: UIApplication) {
//销毁通知红点
UIApplication.shared.applicationIconBadgeNumber = 0
JPUSHService.setBadge(0)
// UIApplication.shared.applicationIconBadgeNumber = 0
// JPUSHService.setBadge(0)
UNUserNotificationCenter.current().removeAllPendingNotificationRequests()
}
......
......@@ -26,6 +26,7 @@ class YHTabBarViewController: ESTabBarController {
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(clearAllUnreadMsg), name: YhConstant.YhNotification.didMarkAllMessagesReadedNotifiction, object: nil)
NotificationCenter.default.addObserver(self, selector: #selector(switchToMsgTab), name: YhConstant.YhNotification.didSwithToMsgTabNotification, object: nil)
}
}
......@@ -48,6 +49,22 @@ extension YHTabBarViewController {
printLog("登出成功")
}
// 转换到消息tab
@objc func switchToMsgTab() {
DispatchQueue.main.async {
self.selectedIndex = 2
}
}
@objc func clearAllUnreadMsg() {
DispatchQueue.main.async {
if let vcs = self.viewControllers, let msgListVC = vcs[safe: 2] {
msgListVC.tabBarItem.badgeValue = ""
UIApplication.shared.applicationIconBadgeNumber = 0
}
}
}
func getTotalUnreadMsgCount() {
self.viewModel.requestTotalUnreadMsgCount {
[weak self] success, error in
......@@ -55,27 +72,20 @@ extension YHTabBarViewController {
DispatchQueue.main.async {
if let vcs = self.viewControllers, let msgListVC = vcs[safe: 2] {
var count = self.viewModel.unreadTotalCount
var unreadText = String(count)
if count > 99 {
let count = self.viewModel.unreadTotalCount
var unreadText:String? = nil
if 0 < count && count <= 99 {
unreadText = String(count)
} else if count > 99 {
unreadText = "99+"
}
msgListVC.tabBarItem.badgeValue = unreadText
UIApplication.shared.applicationIconBadgeNumber = count
}
}
}
}
@objc func clearAllUnreadMsg() {
DispatchQueue.main.async {
if let vcs = self.viewControllers, let msgListVC = vcs[safe: 2] {
msgListVC.tabBarItem.badgeValue = ""
UIApplication.shared.applicationIconBadgeNumber = 0
}
}
}
}
extension YHTabBarViewController {
......@@ -94,6 +104,4 @@ extension YHTabBarViewController {
} completion: { Bool in
}
}
}
......@@ -212,13 +212,19 @@ extension YHHomePageViewController : UITabBarControllerDelegate {
}
}
self.tapTimestamp = timestamp
} else if tabBarController.selectedIndex == 2 {
// 点击消息tab 清空应用icon未读数
UIApplication.shared.applicationIconBadgeNumber = 0
}
}
func tabBarController(_ tabBarController: UITabBarController, shouldSelect viewController: UIViewController) -> Bool {
let index = tabBarController.viewControllers?.firstIndex(of: viewController)
if index == 1 {
guard let index = tabBarController.viewControllers?.firstIndex(of: viewController) else {
return false
}
if index == 1 || index == 2 {
if YHLoginManager.shared.isLogin() {
return true
} else {
......@@ -227,7 +233,7 @@ extension YHHomePageViewController : UITabBarControllerDelegate {
UIViewController.current?.navigationController?.present(vc, animated: true)
YHLoginManager.shared.loginSuccessActionBlock = {[weak self] in
guard let self = self else { return }
tabBarController.selectedIndex = 1
tabBarController.selectedIndex = index
YHLoginManager.shared.loginSuccessActionBlock = nil
}
return false
......
......@@ -70,13 +70,14 @@ private extension YHStartPageViewController {
}
func initView() {
gk_navigationBar.isHidden = true
imagV.image = UIImage(named: "start_page_bkg")
view.addSubview(imagV)
imagV.snp.makeConstraints { make in
make.edges.equalToSuperview()
}
view.addSubview(closeBtn)
closeBtn.layer.zPosition = 10
closeBtn.clipsToBounds = true
......
......@@ -86,7 +86,9 @@ private extension YHHomeBannerCollectionViewCell {
effectV.isHidden = false
if let url = URL(string: model.img_url) {
bannerImagV.kf.setImage(with: url)
// bannerImagV.kf.setImage(with: url)
bannerImagV.kf.setImage(with: url, placeholder: UIImage(named: "global_default_image"))
}
bannerTitleLable.text = model.name
}
......
......@@ -170,7 +170,9 @@ extension YHHomeCollectionViewCell {
make.height.equalTo(listModel.img_height_use)
}
if let url = URL(string: listModel.img_url) {
titleImageView.kf.setImage(with: url)
// titleImageView.kf.setImage(with: url)
titleImageView.kf.setImage(with: url, placeholder: UIImage(named: "global_default_image"))
}
descripeLable.text = listModel.title.defaultStringIfEmpty(detaultValue: "银河世纪")
descripeLable.snp.removeConstraints()
......
......@@ -18,7 +18,6 @@ class YHSearchInfoCell: UITableViewCell {
setupUI()
}
required init?(coder: NSCoder) {
fatalError("init(coder:) has not been implemented")
}
......@@ -51,9 +50,8 @@ class YHSearchInfoCell: UITableViewCell {
self.model = model
titleLabel.text = model.title
videoPlayImgView.isHidden = (model.type != 1)
if let url = URL(string: model.img_url) {
headImgView.kf.setImage(with: url)
}
let url = URL(string: model.img_url)
headImgView.kf.setImage(with: url, placeholder: UIImage(named: "global_default_image"))
}
func setupUI() {
......
......@@ -218,7 +218,9 @@ extension YHScorePersonInfoCell {
self.requestVM.getPublicImageUrl(url) {[weak self] success, error in
guard let self = self else { return }
guard success != nil else { return }
self.headImagV.kf.setImage(with: URL(string: success))
// self.headImagV.kf.setImage(with: URL(string: success))
self.headImagV.kf.setImage(with: URL(string: success), placeholder: UIImage(named: "global_default_image"))
}
}
}
......
......@@ -75,7 +75,8 @@ class YHImageViewController: YHBaseViewController {
self.back()
}
}
self.resultView.kf.setImage(with: URL(string: success))
// self.resultView.kf.setImage(with: URL(string: success))
self.resultView.kf.setImage(with: URL(string: success), placeholder: UIImage(named: "global_default_image"))
}
}
}
......@@ -122,7 +122,9 @@ extension YHServiceBannerView: FSPagerViewDataSource, FSPagerViewDelegate {
let model = dataArr[index]
if model.id != 0 {
if let url = URL(string: model.img_url) {
cell.imageView?.kf.setImage(with: url)
// cell.imageView?.kf.setImage(with: url)
cell.imageView?.kf.setImage(with: url, placeholder: UIImage(named: "global_default_image"))
}
} else {
cell.imageView?.image = UIImage(named: model.img_url)
......
......@@ -41,6 +41,10 @@ class YHPhoneLoginViewController: YHBaseViewController {
YHAnalytics.timeEnd("loginTime")
}
override func viewDidDisappear(_ animated: Bool) {
super.viewDidDisappear(animated)
}
func setView() {
view.backgroundColor = .white
bgImageView = {
......@@ -197,11 +201,6 @@ class YHPhoneLoginViewController: YHBaseViewController {
msg = String(error?.errorCode ?? 404)
}
YHHUD.flash(message: msg)
#if DEBUG
// let vc = YHCodeSueecssViewController()
// vc.phoneNumber = self.phoneMessageView.phoneTextField.text
// self.navigationController?.pushViewController(vc)
#endif
}
})
} else {
......@@ -222,6 +221,7 @@ class YHPhoneLoginViewController: YHBaseViewController {
}
@objc func close() {
YHLoginManager.shared.loginSuccessActionBlock = nil
self.dismiss(animated: true)
}
}
......@@ -171,7 +171,7 @@ class YHMessageListVC: YHBaseViewController {
}
self.tableView.reloadData()
// 发送清空所有未读消息通知
NotificationCenter.default.post(name: YhConstant.YhNotification.didLoginSuccessNotifiction, object: nil)
NotificationCenter.default.post(name: YhConstant.YhNotification.didMarkAllMessagesReadedNotifiction, object: nil)
return
}
......
......@@ -27,7 +27,7 @@ class YHMyLikeViewController: YHBaseViewController {
} else if id == 2{
title = "我的收藏"
} else {
title = "我的浏览"
title = "浏览记录"
}
gk_navTitle = title
setupUI()
......
......@@ -199,5 +199,8 @@ extension YhConstant {
//清空所有未读消息数
public static let didMarkAllMessagesReadedNotifiction = Notification.Name(rawValue: "com.yinhe.msgPage.readAll")
// 自动转换到消息tab
public static let didSwithToMsgTabNotification = Notification.Name(rawValue: "com.yinhe.msgPage.switch")
}
}
{
"images" : [
{
"idiom" : "universal",
"scale" : "1x"
},
{
"filename" : "Mask group@2x.png",
"idiom" : "universal",
"scale" : "2x"
},
{
"filename" : "Mask group@3x.png",
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}
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