Commit 32b83258 authored by Alex朱枝文's avatar Alex朱枝文

1、首页初次登录订单相关的信息显示错误2、银河管家未读消息bug强杀消失bug修复 3、订单时间显示bug修复

parent 40ed6135
......@@ -18,14 +18,12 @@ class YHButlerServiceManager: NSObject {
// 调整UI
private weak var customUIConfig = QYSDK.shared().customUIConfig()
// 增加事件
private weak var customActionConfig = QYSDK.shared().customActionConfig()
private lazy var getUserInfoViewModel: YHButlerServiceViewModel = YHButlerServiceViewModel()
var lastMessage: YHButlerServiceMessage?
var unreadCount: Int = 0
var unreadCount: Int {
allUnreadCount()
}
private override init() {
super.init()
......@@ -44,8 +42,6 @@ class YHButlerServiceManager: NSObject {
let qyOption = QYSDKOption(appKey: YhConstant.QiYuSDK.appKey)
qyOption.appName = YhConstant.QiYuSDK.appName
QYSDK.shared().register(with: qyOption)
//setupCustomAction()
/*
QYSDK.shared().registerPushMessageNotification { pushMessage in
os_log("#####registerPushMessageNotification %@ %ld %f", (pushMessage?.text ?? ""), (pushMessage?.type.rawValue ?? 0), (pushMessage?.time ?? 0))
......@@ -136,7 +132,6 @@ extension YHButlerServiceManager {
return
}
initSDKAccountAndLastMessage()
NotificationCenter.default.post(name: YhConstant.YhNotification.didQiYuAccountUpdateNotification, object: nil)
}
@objc private func logoutSuccess() {
......@@ -149,7 +144,6 @@ extension YHButlerServiceManager {
}
*/
logoutCurrentUser { _ in
NotificationCenter.default.post(name: YhConstant.YhNotification.didQiYuAccountUpdateNotification, object: nil)
}
}
......@@ -207,14 +201,6 @@ extension YHButlerServiceManager {
completion(flag)
}
}
private func setupCustomAction() {
customActionConfig?.linkClickBlock = { linkAddress in
//
return QYLinkClickActionPolicy.open
}
}
}
extension YHButlerServiceManager {
......@@ -240,7 +226,7 @@ extension YHButlerServiceManager {
// 清空已读消息后刷新最新消息状态
lastMessage = getLastMessage()
printLog("$$$$clearUnreadCount")
unreadCount = 0
//unreadCount = 0
NotificationCenter.default.post(name: YhConstant.YhNotification.didQiYuUnReadMsgCountChangeNotification, object: nil)
}
......@@ -267,7 +253,7 @@ extension YHButlerServiceManager: QYConversationManagerDelegate {
/// 会话未读数变化(进聊天页面会刷新)
func onUnreadCountChanged(_ count: Int) {
printLog("$$$$onUnreadCountChanged \(count)")
unreadCount = count
//unreadCount = count
NotificationCenter.default.post(name: YhConstant.YhNotification.didQiYuUnReadMsgCountChangeNotification, object: nil)
}
}
......@@ -104,7 +104,7 @@ class YHHomePageViewController: YHBaseViewController {
private extension YHHomePageViewController {
func updateMgrItem() {
// 页面已经加载了
guard view.window != nil, isViewLoaded, homeHeaderView.superview != nil else {
guard isViewLoaded, homeHeaderView.superview != nil else {
return
}
guard YHButlerServiceManager.shared.isUatAllowed(), YHLoginManager.shared.isLogin() else {
......@@ -310,7 +310,7 @@ private extension YHHomePageViewController {
}
}
@objc func needUpdateYinheManager() {
func needUpdateYinheManager() {
if !isTopMostAndVisible {
// 需要回到页面再刷新已读,因为不在当前页
self.needUpdateMgrItem = true
......@@ -323,7 +323,7 @@ private extension YHHomePageViewController {
needUpdateYinheManager()
}
@objc func didRevUatParam() {
@objc private func didRevUatParam() {
guard serviceCenterMainReqVM.arrContactList.count > 0 else {
return
}
......@@ -335,8 +335,6 @@ private extension YHHomePageViewController {
// NotificationCenter.default.addObserver(self, selector: #selector(didQiYuReceiveNewMsg), name: YhConstant.YhNotification.didQiYuReceiveNewMsgNotification, object: nil)
NotificationCenter.default.addObserver(self, selector: #selector(didQiYuReceiveNewMsg), name: YhConstant.YhNotification.didQiYuUnReadMsgCountChangeNotification, object: nil)
NotificationCenter.default.addObserver(self, selector: #selector(didRevUatParam), name: YhConstant.YhNotification.didRevUatParam, object: nil)
NotificationCenter.default.addObserver(self, selector: #selector(needUpdateYinheManager), name: YhConstant.YhNotification.didQiYuAccountUpdateNotification, object: nil)
}
}
......@@ -377,8 +375,6 @@ extension YHHomePageViewController {
guard let self = self else { return }
let isShow = self.serviceCenterMainReqVM.arrContactList.count > 0
if isShow {
self.updateMgrItem()
self.viewModel.getBasicInfoForSigner { success, error in
if success {
self.homeHeaderView.orderTipsView.dataModelForBasicInfo = self.viewModel.signerModel
......@@ -387,13 +383,16 @@ extension YHHomePageViewController {
}
self.viewModel.getLastTwoMessagesForSigner { success, error in
self.showOrderTipsView(isShow)
if success {
self.homeHeaderView.orderTipsView.arrLastTwoMessage = self.viewModel.arrLastTwoMessages
self.updateMgrItem()
self.homeHeaderView.updateSubViewsConstraints()
} else {
self.updateMgrItem()
self.homeHeaderView.updateSubViewsConstraints()
}
self.showOrderTipsView(isShow)
}
}
} else {
......
......@@ -96,16 +96,21 @@ extension YHGalaxyManagerTipsItemView {
layer.borderColor = UIColor.white.cgColor
addSubview(lableGalaxyMgr)
addSubview(segmentationView)
addSubview(rightIconImageV)
addSubview(dotView)
addSubview(lableMessage)
lableGalaxyMgr.setContentCompressionResistancePriority(.required, for: .horizontal)
lableGalaxyMgr.setContentCompressionResistancePriority(.required, for: .horizontal)
rightIconImageV.setContentCompressionResistancePriority(.required, for: .horizontal)
dotView.setContentCompressionResistancePriority(.required, for: .horizontal)
lableMessage.setContentCompressionResistancePriority(.defaultLow, for: .horizontal)
lableGalaxyMgr.snp.makeConstraints { make in
make.centerY.equalToSuperview()
make.left.equalTo(12)
make.height.equalTo(18)
make.width.equalTo(60)
}
addSubview(segmentationView)
lableGalaxyMgr.setContentCompressionResistancePriority(.required, for: .horizontal)
segmentationView.snp.makeConstraints { make in
make.left.equalTo(lableGalaxyMgr.snp.right).offset(8)
make.height.equalTo(10)
......@@ -113,24 +118,18 @@ extension YHGalaxyManagerTipsItemView {
make.centerY.equalToSuperview()
}
addSubview(rightIconImageV)
rightIconImageV.setContentCompressionResistancePriority(.required, for: .horizontal)
rightIconImageV.snp.makeConstraints { make in
make.right.equalTo(-12)
make.centerY.equalToSuperview()
make.width.height.equalTo(12)
}
addSubview(dotView)
dotView.setContentCompressionResistancePriority(.required, for: .horizontal)
dotView.snp.makeConstraints { make in
make.width.height.equalTo(dotWidth)
make.right.equalTo(rightIconImageV.snp.left).offset(-12)
make.centerY.equalToSuperview()
}
addSubview(lableMessage)
lableMessage.setContentCompressionResistancePriority(.defaultLow, for: .horizontal)
lableMessage.snp.makeConstraints { make in
make.left.equalTo(segmentationView.snp.right).offset(8)
make.height.equalTo(18)
......
......@@ -127,7 +127,7 @@ class YHHomeHeadView: UIView {
}
orderTipsView.snp.removeConstraints()
// orderTipsView.snp.removeConstraints()
if self.orderTipsView.isHidden {
orderTipsView.isHidden = true
evaluationView.isHidden = false
......@@ -205,8 +205,8 @@ private extension YHHomeHeadView {
orderTipsView.snp.makeConstraints { make in
make.top.equalTo(bannerLineTop.snp.bottom).offset(20)
make.left.right.equalToSuperview()
make.height.equalTo(226)
// make.height.equalTo(orderTipsView.tipViewH)
// make.height.equalTo(226)
make.height.equalTo(orderTipsView.tipViewH)
}
//测评界面
......
......@@ -183,14 +183,22 @@ extension YHOrderTipsItemView {
addSubview(lableMyOrder)
addSubview(segmentationView)
addSubview(rightIconImageV)
addSubview(lableTime)
addSubview(lableName)
lableMyOrder.setContentCompressionResistancePriority(.required, for: .horizontal)
segmentationView.setContentCompressionResistancePriority(.required, for: .horizontal)
rightIconImageV.setContentCompressionResistancePriority(.required, for: .horizontal)
lableTime.setContentCompressionResistancePriority(.defaultHigh, for: .horizontal)
lableName.setContentCompressionResistancePriority(.defaultLow, for: .horizontal)
lableMyOrder.snp.makeConstraints { make in
make.centerY.equalToSuperview()
make.left.equalTo(12)
make.height.equalTo(18)
make.width.equalTo(60)
}
addSubview(segmentationView)
segmentationView.snp.makeConstraints { make in
make.left.equalTo(lableMyOrder.snp.right).offset(8)
make.height.equalTo(10)
......@@ -198,33 +206,23 @@ extension YHOrderTipsItemView {
make.centerY.equalToSuperview()
}
addSubview(rightIconImageV)
rightIconImageV.snp.makeConstraints { make in
make.right.equalTo(-12)
make.centerY.equalToSuperview()
make.width.height.equalTo(12)
}
addSubview(lableTime)
lableTime.snp.makeConstraints { make in
make.right.equalTo(rightIconImageV.snp.left)
make.right.equalTo(rightIconImageV.snp.left).offset(-2)
make.centerY.equalTo(rightIconImageV)
make.height.equalTo(18)
make.width.lessThanOrEqualTo(60)
}
addSubview(lableName)
lableName.snp.makeConstraints { make in
make.left.equalTo(segmentationView.snp.right).offset(8)
make.height.equalTo(18)
make.centerY.equalToSuperview()
make.right.equalTo(lableTime.snp.left).offset(-12)
make.right.lessThanOrEqualTo(lableTime.snp.left).offset(-12)
}
// let aa: ASAttributedString = .init("您有", .font(UIFont.PFSC_R(ofSize: 13)),.foreground(UIColor.mainTextColor70))
......
......@@ -194,6 +194,7 @@ private extension YHOrderTipsView {
orderTipsViewStyle = .none
}
layoutIfNeeded()
setNeedsLayout()
}
private func updateItemsStyle() {
......@@ -273,7 +274,7 @@ private extension YHOrderTipsView {
lableTip.snp.makeConstraints { make in
make.top.equalToSuperview().offset(21)
make.left.equalTo(iconImageV.snp.right).offset(12)
make.right.lessThanOrEqualToSuperview().offset(12)
make.right.lessThanOrEqualToSuperview().offset(-12)
}
addSubview(lableDays)
......
......@@ -292,10 +292,6 @@ extension YhConstant {
// 七鱼未读消息数量变化
public static let didQiYuUnReadMsgCountChangeNotification = Notification.Name(rawValue: "com.yinhe.qiyu.unReadMsgCountChange")
// 七鱼登录登出
public static let didQiYuAccountUpdateNotification = Notification.Name(rawValue: "com.yinhe.qiyu.accountUpdate")
//获取灰度参数
public static let didRevUatParam = Notification.Name(rawValue: "com.yinhe.didRevUatParam")
......
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