Commit ad716461 authored by Alex朱枝文's avatar Alex朱枝文

UI细节调整

parent 3d3011b2
...@@ -52,9 +52,6 @@ class YHBaseCornerRadiusBorderView: UIView { ...@@ -52,9 +52,6 @@ class YHBaseCornerRadiusBorderView: UIView {
private var viewBounds = CGRect.zero { private var viewBounds = CGRect.zero {
didSet { didSet {
guard viewBounds != oldValue else {
return
}
boarderLayers?.forEach { boarderLayers?.forEach {
$0.removeFromSuperlayer() $0.removeFromSuperlayer()
} }
......
...@@ -34,9 +34,6 @@ class YHBaseDynamicCornerRadiusView: UIView { ...@@ -34,9 +34,6 @@ class YHBaseDynamicCornerRadiusView: UIView {
private var viewBounds = CGRect.zero { private var viewBounds = CGRect.zero {
didSet { didSet {
guard viewBounds != oldValue else {
return
}
boarderLayer?.removeFromSuperlayer() boarderLayer?.removeFromSuperlayer()
boarderLayer = nil boarderLayer = nil
if let corner = corner { if let corner = corner {
......
...@@ -309,9 +309,6 @@ extension YHButlerServiceManager: QYConversationManagerDelegate { ...@@ -309,9 +309,6 @@ extension YHButlerServiceManager: QYConversationManagerDelegate {
/// 会话列表变化;非平台电商用户,只有一个会话项,平台电商用户,有多个会话项 用这个方法可以拿到最新的完整的消息内容 /// 会话列表变化;非平台电商用户,只有一个会话项,平台电商用户,有多个会话项 用这个方法可以拿到最新的完整的消息内容
func onSessionListChanged(_ sessionList: [QYSessionInfo]!) { func onSessionListChanged(_ sessionList: [QYSessionInfo]!) {
printLog("$$$$onSessionListChanged \(sessionList.first?.lastMessageText ?? "") \(sessionList.first?.lastMessageType.rawValue ?? 0) \(sessionList.first?.lastMessageTimeStamp ?? 0) \(sessionList.first?.lastMessage?.messageId ?? "")") printLog("$$$$onSessionListChanged \(sessionList.first?.lastMessageText ?? "") \(sessionList.first?.lastMessageType.rawValue ?? 0) \(sessionList.first?.lastMessageTimeStamp ?? 0) \(sessionList.first?.lastMessage?.messageId ?? "")")
guard let message = sessionList.first else {
return
}
NotificationCenter.default.post(name: YhConstant.YhNotification.didQiYuReceiveNewMsgNotification, object: nil) NotificationCenter.default.post(name: YhConstant.YhNotification.didQiYuReceiveNewMsgNotification, object: nil)
} }
......
...@@ -49,7 +49,6 @@ class YHHKRecordsContentVC: YHBaseViewController { ...@@ -49,7 +49,6 @@ class YHHKRecordsContentVC: YHBaseViewController {
view.dataSource = self view.dataSource = self
view.backgroundColor = .clear view.backgroundColor = .clear
view.rowHeight = 52 view.rowHeight = 52
view.tableFooterView = UITableViewHeaderFooterView()
view.register(YHHKRecordsCustomerItemCell.self, forCellReuseIdentifier: YHHKRecordsCustomerItemCell.cellReuseIdentifier) view.register(YHHKRecordsCustomerItemCell.self, forCellReuseIdentifier: YHHKRecordsCustomerItemCell.cellReuseIdentifier)
view.register(YHHKRecordsInfoItemCell.self, forCellReuseIdentifier: YHHKRecordsInfoItemCell.cellReuseIdentifier) view.register(YHHKRecordsInfoItemCell.self, forCellReuseIdentifier: YHHKRecordsInfoItemCell.cellReuseIdentifier)
view.register(YHHKRecordsRemarkCell.self, forCellReuseIdentifier: YHHKRecordsRemarkCell.cellReuseIdentifier) view.register(YHHKRecordsRemarkCell.self, forCellReuseIdentifier: YHHKRecordsRemarkCell.cellReuseIdentifier)
......
...@@ -323,7 +323,8 @@ extension YHHKRecordsEditContentVC: UITableViewDelegate, UITableViewDataSource { ...@@ -323,7 +323,8 @@ extension YHHKRecordsEditContentVC: UITableViewDelegate, UITableViewDataSource {
guard let tableView = tableView else { guard let tableView = tableView else {
return return
} }
tableView.reloadRows(at: [indexPath], with: .none) // 解决在旧机器上没法准确更新cell造成界面重叠的问题, 新机器reloadRows(at: [indexPath], with: .none)没问题
tableView.reloadData()
} }
} }
cell.didFinishLoading = { [weak cell] in cell.didFinishLoading = { [weak cell] in
......
...@@ -29,8 +29,8 @@ class YHHKRecordsSummaryVC: YHBaseViewController { ...@@ -29,8 +29,8 @@ class YHHKRecordsSummaryVC: YHBaseViewController {
view.separatorStyle = .none view.separatorStyle = .none
view.rowHeight = UITableView.automaticDimension view.rowHeight = UITableView.automaticDimension
view.estimatedRowHeight = 52.0 view.estimatedRowHeight = 52.0
view.layer.cornerRadius = 6 // view.layer.cornerRadius = 6
view.clipsToBounds = true // view.clipsToBounds = true
view.dataSource = self view.dataSource = self
view.delegate = self view.delegate = self
view.showsVerticalScrollIndicator = false view.showsVerticalScrollIndicator = false
...@@ -78,8 +78,8 @@ extension YHHKRecordsSummaryVC { ...@@ -78,8 +78,8 @@ extension YHHKRecordsSummaryVC {
tableView.snp.makeConstraints { make in tableView.snp.makeConstraints { make in
make.left.equalToSuperview().offset(kMargin).priority(.high) make.left.equalToSuperview().offset(kMargin).priority(.high)
make.right.equalToSuperview().offset(-kMargin).priority(.high) make.right.equalToSuperview().offset(-kMargin).priority(.high)
make.top.equalToSuperview().offset(kMargin) make.top.equalToSuperview()
make.bottom.equalToSuperview().offset(-kMargin) make.bottom.equalToSuperview()
} }
noDataView.snp.makeConstraints { make in noDataView.snp.makeConstraints { make in
...@@ -88,6 +88,8 @@ extension YHHKRecordsSummaryVC { ...@@ -88,6 +88,8 @@ extension YHHKRecordsSummaryVC {
make.width.equalTo(KScreenWidth) make.width.equalTo(KScreenWidth)
make.height.equalTo(164) make.height.equalTo(164)
} }
tableView.tableHeaderView = UIView(frame: CGRect.init(x: 0, y: 0, width: KScreenWidth, height: kMargin))
tableView.tableFooterView = UIView(frame: CGRect.init(x: 0, y: 0, width: KScreenWidth, height: kMargin))
} }
private func requestData() { private func requestData() {
...@@ -219,7 +221,9 @@ extension YHHKRecordsSummaryVC: UITableViewDelegate, UITableViewDataSource { ...@@ -219,7 +221,9 @@ extension YHHKRecordsSummaryVC: UITableViewDelegate, UITableViewDataSource {
case let .expandedItem(model): case let .expandedItem(model):
if indexPath.row == 0, let cell = tableView.dequeueReusableCell(withIdentifier: YHHKRecordsExpandedCell.cellReuseIdentifier) as? YHHKRecordsExpandedCell { if indexPath.row == 0, let cell = tableView.dequeueReusableCell(withIdentifier: YHHKRecordsExpandedCell.cellReuseIdentifier) as? YHHKRecordsExpandedCell {
let isShowBottomLine = !model.isExpanded && (indexPath.section != datas.count - 1) let isShowBottomLine = !model.isExpanded && (indexPath.section != datas.count - 1)
cell.setupCellInfo(title: model.title, status: model.type, isExpanded: model.isExpanded, isShowBottomLine: isShowBottomLine) let isBottom = (indexPath.section == datas.count - 1) && !model.isExpanded
cell.setupCellInfo(title: model.title, status: model.type, isExpanded: model.isExpanded, isShowBottomLine: isShowBottomLine, isBottom: isBottom)
return cell return cell
} }
if model.isExpanded, model.subItems.count > indexPath.row - 1, indexPath.row - 1 >= 0 { if model.isExpanded, model.subItems.count > indexPath.row - 1, indexPath.row - 1 >= 0 {
...@@ -251,7 +255,8 @@ extension YHHKRecordsSummaryVC: UITableViewDelegate, UITableViewDataSource { ...@@ -251,7 +255,8 @@ extension YHHKRecordsSummaryVC: UITableViewDelegate, UITableViewDataSource {
case .occupyingSpace: case .occupyingSpace:
if let cell = tableView.dequeueReusableCell(withIdentifier: YHHKRecordsOccupyingSpaceCell.cellReuseIdentifier) as? YHHKRecordsOccupyingSpaceCell { if let cell = tableView.dequeueReusableCell(withIdentifier: YHHKRecordsOccupyingSpaceCell.cellReuseIdentifier) as? YHHKRecordsOccupyingSpaceCell {
let isShow = indexPath.row == model.subItems.count && (indexPath.section != datas.count - 1) let isShow = indexPath.row == model.subItems.count && (indexPath.section != datas.count - 1)
cell.setupCellInfo(isShow) let isBottom = indexPath.section == datas.count - 1
cell.setupCellInfo(isShow, isBottom: isBottom)
return cell return cell
} }
} }
......
...@@ -18,6 +18,12 @@ class YHHKRecordsExpandedCell: UITableViewCell { ...@@ -18,6 +18,12 @@ class YHHKRecordsExpandedCell: UITableViewCell {
} }
} }
private lazy var subContainerView: YHBaseDynamicCornerRadiusView = {
let view = YHBaseDynamicCornerRadiusView(cornerRadius: 8, corner: .none)
view.backgroundColor = .white
return view
}()
private lazy var tagView: UIView = { private lazy var tagView: UIView = {
let view = UIView() let view = UIView()
view.backgroundColor = .brandMainColor view.backgroundColor = .brandMainColor
...@@ -61,7 +67,7 @@ class YHHKRecordsExpandedCell: UITableViewCell { ...@@ -61,7 +67,7 @@ class YHHKRecordsExpandedCell: UITableViewCell {
fatalError("init(coder:) has not been implemented") fatalError("init(coder:) has not been implemented")
} }
func setupCellInfo(title: String?, status: YHHKNonPresenceRecordType, isExpanded: Bool, isShowBottomLine: Bool = false) { func setupCellInfo(title: String?, status: YHHKNonPresenceRecordType, isExpanded: Bool, isShowBottomLine: Bool = false, isBottom: Bool = false) {
infoTitleLabel.text = title infoTitleLabel.text = title
if status == .normal { if status == .normal {
statusLabel.isHidden = true statusLabel.isHidden = true
...@@ -77,6 +83,7 @@ class YHHKRecordsExpandedCell: UITableViewCell { ...@@ -77,6 +83,7 @@ class YHHKRecordsExpandedCell: UITableViewCell {
self.isExpanded = isExpanded self.isExpanded = isExpanded
bottomLineView.isHidden = !isShowBottomLine bottomLineView.isHidden = !isShowBottomLine
subContainerView.corner = isBottom ? [.bottomLeft, .bottomRight] : .none
} }
} }
...@@ -85,16 +92,22 @@ extension YHHKRecordsExpandedCell { ...@@ -85,16 +92,22 @@ extension YHHKRecordsExpandedCell {
private func setupUI() { private func setupUI() {
selectionStyle = .none selectionStyle = .none
backgroundColor = .white backgroundColor = .clear
contentView.addSubview(tagView) contentView.addSubview(subContainerView)
contentView.addSubview(infoTitleLabel) subContainerView.addSubview(tagView)
contentView.addSubview(statusLabel) subContainerView.addSubview(infoTitleLabel)
contentView.addSubview(infoDetailLabel) subContainerView.addSubview(statusLabel)
contentView.addSubview(bottomLineView) subContainerView.addSubview(infoDetailLabel)
subContainerView.addSubview(bottomLineView)
tagView.setContentCompressionResistancePriority(.required, for: .horizontal) tagView.setContentCompressionResistancePriority(.required, for: .horizontal)
infoTitleLabel.setContentCompressionResistancePriority(.defaultLow, for: .horizontal) infoTitleLabel.setContentCompressionResistancePriority(.defaultLow, for: .horizontal)
statusLabel.setContentCompressionResistancePriority(.defaultHigh, for: .horizontal) statusLabel.setContentCompressionResistancePriority(.defaultHigh, for: .horizontal)
infoDetailLabel.setContentCompressionResistancePriority(.required, for: .horizontal) infoDetailLabel.setContentCompressionResistancePriority(.required, for: .horizontal)
subContainerView.snp.makeConstraints { make in
make.edges.equalToSuperview()
}
bottomLineView.snp.makeConstraints { make in bottomLineView.snp.makeConstraints { make in
make.bottom.equalToSuperview() make.bottom.equalToSuperview()
make.left.equalToSuperview().offset(18) make.left.equalToSuperview().offset(18)
......
...@@ -11,6 +11,12 @@ import UIKit ...@@ -11,6 +11,12 @@ import UIKit
class YHHKRecordsHeaderCell: UITableViewCell { class YHHKRecordsHeaderCell: UITableViewCell {
static let cellReuseIdentifier = "YHHKRecordsHeaderCell" static let cellReuseIdentifier = "YHHKRecordsHeaderCell"
private lazy var subContainerView: YHBaseDynamicCornerRadiusView = {
let view = YHBaseDynamicCornerRadiusView(cornerRadius: 8, corner: [.topLeft, .topRight])
view.backgroundColor = .white
return view
}()
private lazy var infoTitleLabel: UILabel = { private lazy var infoTitleLabel: UILabel = {
let label = UILabel() let label = UILabel()
label.font = .PFSC_M(ofSize: 17) label.font = .PFSC_M(ofSize: 17)
...@@ -43,9 +49,14 @@ extension YHHKRecordsHeaderCell { ...@@ -43,9 +49,14 @@ extension YHHKRecordsHeaderCell {
private func setupUI() { private func setupUI() {
selectionStyle = .none selectionStyle = .none
backgroundColor = .white backgroundColor = .clear
contentView.addSubview(infoTitleLabel) contentView.addSubview(subContainerView)
contentView.addSubview(bottomLineView) subContainerView.addSubview(infoTitleLabel)
subContainerView.addSubview(bottomLineView)
subContainerView.snp.makeConstraints { make in
make.edges.equalToSuperview()
}
bottomLineView.snp.makeConstraints { make in bottomLineView.snp.makeConstraints { make in
make.left.right.bottom.equalToSuperview() make.left.right.bottom.equalToSuperview()
make.height.equalTo(1) make.height.equalTo(1)
......
...@@ -12,6 +12,12 @@ class YHHKRecordsOccupyingSpaceCell: UITableViewCell { ...@@ -12,6 +12,12 @@ class YHHKRecordsOccupyingSpaceCell: UITableViewCell {
static let cellReuseIdentifier = "YHHKRecordsOccupyingSpaceCell" static let cellReuseIdentifier = "YHHKRecordsOccupyingSpaceCell"
private lazy var subContainerView: YHBaseDynamicCornerRadiusView = {
let view = YHBaseDynamicCornerRadiusView(cornerRadius: 8, corner: .none)
view.backgroundColor = .white
return view
}()
private lazy var bottomLineView: UIView = { private lazy var bottomLineView: UIView = {
let view = UIView() let view = UIView()
view.isHidden = true view.isHidden = true
...@@ -28,8 +34,9 @@ class YHHKRecordsOccupyingSpaceCell: UITableViewCell { ...@@ -28,8 +34,9 @@ class YHHKRecordsOccupyingSpaceCell: UITableViewCell {
fatalError("init(coder:) has not been implemented") fatalError("init(coder:) has not been implemented")
} }
func setupCellInfo(_ isShowBottomLine: Bool = false) { func setupCellInfo(_ isShowBottomLine: Bool = false, isBottom: Bool = false) {
bottomLineView.isHidden = !isShowBottomLine bottomLineView.isHidden = !isShowBottomLine
subContainerView.corner = isBottom ? [.bottomLeft, .bottomRight] : .none
} }
} }
...@@ -37,8 +44,14 @@ extension YHHKRecordsOccupyingSpaceCell { ...@@ -37,8 +44,14 @@ extension YHHKRecordsOccupyingSpaceCell {
private func setupUI() { private func setupUI() {
selectionStyle = .none selectionStyle = .none
backgroundColor = .white backgroundColor = .clear
contentView.addSubview(bottomLineView) contentView.addSubview(subContainerView)
subContainerView.addSubview(bottomLineView)
subContainerView.snp.makeConstraints { make in
make.edges.equalToSuperview()
}
bottomLineView.snp.makeConstraints { make in bottomLineView.snp.makeConstraints { make in
make.bottom.equalToSuperview() make.bottom.equalToSuperview()
make.left.equalToSuperview().offset(18) make.left.equalToSuperview().offset(18)
......
...@@ -78,7 +78,7 @@ extension YHHKRecordsRemarkCell { ...@@ -78,7 +78,7 @@ extension YHHKRecordsRemarkCell {
remarkTextView.snp.makeConstraints { make in remarkTextView.snp.makeConstraints { make in
make.left.equalTo(infoTitleLabel) make.left.equalTo(infoTitleLabel)
make.right.equalToSuperview().offset(-18) make.right.equalToSuperview().offset(-18)
make.height.equalTo(86) make.height.equalTo(86).priority(.high)
make.top.equalTo(infoTitleLabel.snp.bottom).offset(8) make.top.equalTo(infoTitleLabel.snp.bottom).offset(8)
make.bottom.equalToSuperview().offset(-16) make.bottom.equalToSuperview().offset(-16)
} }
......
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