Commit cab40a64 authored by Steven杜宇's avatar Steven杜宇

// 名片

parent 8d93d41c
......@@ -149,6 +149,8 @@ class YHUserNameCardInfo: SmartCodable {
self.honor = model.honor
self.authorization.public_education_experience = model.authorization.public_education_experience
self.authorization.public_work_experience = model.authorization.public_work_experience
self.authorization.friend_education_experience = model.authorization.friend_education_experience
self.authorization.friend_work_experience = model.authorization.friend_work_experience
self.topics.removeAll()
self.topics.append(contentsOf: model.topics)
}
......
......@@ -208,7 +208,16 @@ extension YHNameCardHomePageViewController: UITableViewDelegate, UITableViewData
eduCell.hiddenBtnBlock = {
[weak self] in
guard let self = self else { return }
YHWholeScreenTipsView.show(type: .nameCardEducation, targetView: eduCell.hiddenBtn)
var targetText = ""
if self.viewModel.nameCardInfo.authorization.friend_education_experience != 2 && self.viewModel.nameCardInfo.authorization.public_education_experience != 2 {
targetText = "好友与陌生人"
} else if self.viewModel.nameCardInfo.authorization.friend_education_experience != 2 {
targetText = "好友"
} else if self.viewModel.nameCardInfo.authorization.public_education_experience != 2 {
targetText = "陌生人"
}
let tips = "该栏目已对" + targetText + "隐藏,若需重新开启,请前往信息授权处更新设置"
YHWholeScreenTipsView.show(message: tips, targetView: eduCell.hiddenBtn)
}
eduCell.editBlock = { [weak self] in
guard let self = self else { return }
......@@ -225,7 +234,17 @@ extension YHNameCardHomePageViewController: UITableViewDelegate, UITableViewData
workCell.hiddenBtnBlock = {
[weak self] in
guard let self = self else { return }
YHWholeScreenTipsView.show(type: .nameCardWorkExperience, targetView: workCell.hiddenBtn)
var targetText = ""
if self.viewModel.nameCardInfo.authorization.friend_work_experience != 2 && self.viewModel.nameCardInfo.authorization.public_work_experience != 2 {
targetText = "好友与陌生人"
} else if self.viewModel.nameCardInfo.authorization.friend_work_experience != 2 {
targetText = "好友"
} else if self.viewModel.nameCardInfo.authorization.public_work_experience != 2 {
targetText = "陌生人"
}
let tips = "该栏目已对" + targetText + "隐藏,若需重新开启,请前往信息授权处更新设置"
YHWholeScreenTipsView.show(message: tips, targetView: workCell.hiddenBtn)
}
workCell.editBlock = { [weak self] in
guard let self = self else { return }
......
......@@ -71,6 +71,12 @@ class YHWholeScreenTipsView: UIView {
self.createUI(targetView: targetView)
}
init(message: String, targetView: UIView) {
super.init(frame: UIScreen.main.bounds)
contentLable.text = message
self.createUI(targetView: targetView)
}
required init?(coder: NSCoder) {
fatalError("init(coder:) has not been implemented")
}
......@@ -122,6 +128,11 @@ class YHWholeScreenTipsView: UIView {
view.show()
}
static func show(message: String, targetView: UIView) {
let view = YHWholeScreenTipsView(message: message, targetView: targetView)
view.show()
}
@objc func dismiss() {
self.removeFromSuperview()
}
......
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