Commit b50a9da7 authored by David黄金龙's avatar David黄金龙

我的评价 UI 展示

parent 2f3cc4ef
......@@ -279,6 +279,7 @@ extension YHInformationPerfectListVC {
make.top.equalTo(headerTitleDesLable.snp.bottom).offset(10)
make.left.equalTo(24)
make.right.equalTo(-24)
make.bottom.equalToSuperview()
}
myHeadView.frame = CGRect(x: 0, y: 0, width: KScreenWidth, height: 96)
......
......@@ -52,12 +52,6 @@ class YHServiceCenterMainViewController: YHBaseViewController {
setupUI()
loadData()
}
}
extension YHServiceCenterMainViewController {
......@@ -108,7 +102,8 @@ extension YHServiceCenterMainViewController {
// MARK: - UITableViewDelegate 和 UITableViewDataSource
extension YHServiceCenterMainViewController : UITableViewDelegate,UITableViewDataSource {
func numberOfSections(in tableView: UITableView) -> Int {
return self.serviceCenterMainReqVM.arrContactList.count
// return self.serviceCenterMainReqVM.arrContactList.count
return 1 //for test hjl
}
func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -> Int {
......
......@@ -144,13 +144,13 @@ extension YHScoreItemCell {
for (index,item) in arrData.enumerated() {
if index == 0 {
scoreOptionsView1.nameLable.text = item.scoreName
scoreOptionsView1.dataModel = item
} else if index == 1 {
scoreOptionsView2.nameLable.text = item.scoreName
scoreOptionsView2.dataModel = item
} else if index == 2 {
scoreOptionsView3.nameLable.text = item.scoreName
scoreOptionsView3.dataModel = item
} else if index == 3 {
scoreOptionsView4.nameLable.text = item.scoreName
scoreOptionsView4.dataModel = item
}
}
}
......
......@@ -129,18 +129,16 @@ extension YHScoreItemCellForAge {
guard let arrData = optionData?.options else {
return
}
titleView.updateWith(optionData?.name, optionData?.score)
for (index,item) in arrData.enumerated() {
if index == 0 {
scoreOptionsView1.nameLable.text = item.scoreName
scoreOptionsView1.dataModel = item
} else if index == 1 {
scoreOptionsView2.nameLable.text = item.scoreName
scoreOptionsView2.dataModel = item
} else if index == 2 {
scoreOptionsView3.nameLable.text = item.scoreName
scoreOptionsView3.dataModel = item
} else if index == 3 {
scoreOptionsView4.nameLable.text = item.scoreName
scoreOptionsView4.dataModel = item
}
}
}
......
......@@ -19,13 +19,24 @@ class YHScoreOptionsView: UIView {
fatalError("init(coder:) has not been implemented")
}
lazy var nameLable : UILabel = {
let lable0 = UILabel()
// lazy var nameLable : UILabel = {
// let lable0 = UILabel()
// lable0.textColor = UIColor(hex: 0x4E4E4E)
// lable0.font = UIFont.PingFangScR(ofSize: 14)
// lable0.numberOfLines = 0
// lable0.lineBreakMode = .byWordWrapping
// return lable0
// }()
private lazy var nameTextView : UITextView = {
let lable0 = UITextView()
lable0.textColor = UIColor(hex: 0x4E4E4E)
lable0.font = UIFont.PingFangScR(ofSize: 14)
lable0.numberOfLines = 0
lable0.lineBreakMode = .byWordWrapping
lable0.isScrollEnabled = false
lable0.isEditable = false
lable0.isSelectable = false
return lable0
}()
......@@ -34,6 +45,25 @@ class YHScoreOptionsView: UIView {
view.backgroundColor = UIColor(hex:0xF0F0F0)
return view
}()
private lazy var customLabel : UILabel = {
let customLabel = UILabel(frame: CGRect(x: 0, y: 0, width: 40, height: 20))
customLabel.text = "-"
customLabel.font = .PingFangScR(ofSize: 12)
customLabel.backgroundColor = UIColor(hex:0xF8F9FB)
customLabel.textColor = UIColor(hex: 0x888F98)
customLabel.layer.cornerRadius = 4
customLabel.clipsToBounds = true
customLabel.textAlignment = .center
return customLabel
}()
var dataModel : YHScoreOptiosModel? {
didSet {
updateUI()
}
}
}
private extension YHScoreOptionsView {
......@@ -44,11 +74,44 @@ private extension YHScoreOptionsView {
make.height.equalTo(0.5)
}
addSubview(nameLable)
nameLable.snp.makeConstraints { make in
// addSubview(nameLable)
// nameLable.snp.makeConstraints { make in
// make.top.equalTo(16)
// make.left.right.equalToSuperview()
// make.bottom.equalTo(bottomLine.snp.top).offset(-16)
// }
addSubview(nameTextView)
nameTextView.snp.makeConstraints { make in
make.top.equalTo(16)
make.left.right.equalToSuperview()
make.bottom.equalTo(bottomLine.snp.top).offset(-16)
}
}
func updateUI() {
guard let model = dataModel else {
nameTextView.text = "-"
return
}
customLabel.text = model.scoreValue
if model.isSelected == true {
nameTextView.attributed.text = """
\(model.scoreName, .foreground(UIColor(hex: 0x3C86F8)), .font(UIFont.PingFangScR(ofSize: 14))) \(.view(customLabel, .original(.center)))
"""
customLabel.backgroundColor = UIColor(hex:0x3C86F8,alpha:0.12)
customLabel.textColor = UIColor(hex: 0x3C86F8)
} else {
nameTextView.attributed.text = """
\(model.scoreName, .foreground(UIColor(hex: 0x4E4E4E)), .font(UIFont.PingFangScR(ofSize: 14))) \(.view(customLabel, .original(.center)))
"""
customLabel.backgroundColor = UIColor(hex:0xF8F9FB)
customLabel.textColor = UIColor(hex: 0x888F98)
}
}
}
......@@ -18,8 +18,6 @@ class YHScorePersonInfoCell: UITableViewCell {
// }
// }
//头像
private lazy var headImagV : UIImageView = {
let imageV = UIImageView(image: UIImage(named: "score_header_default"))
......
......@@ -12,7 +12,7 @@
<key>scoreName</key>
<string>118-39</string>
<key>isSelected</key>
<false/>
<true/>
</dict>
<dict>
<key>scoreValue</key>
......@@ -36,7 +36,7 @@
<key>scoreName</key>
<string>450+</string>
<key>isSelected</key>
<false/>
<true/>
</dict>
</array>
<key>name</key>
......@@ -96,7 +96,7 @@
<key>scoreName</key>
<string>1)获得最低学位证以后,拥有不超过2年工作经验</string>
<key>isSelected</key>
<false/>
<true/>
</dict>
<dict>
<key>scoreValue</key>
......
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