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

UI细节调整

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