Эх сурвалжийг харах

[*] pk结果UI显示第一名图片

Steven 5 сар өмнө
parent
commit
7555da3e46

+ 1 - 0
MiMoLive/MiMoLive/Classes/Live/View/MOPKListView/NewPK/MOLineLastPKResultView.swift

@@ -95,6 +95,7 @@ extension MOLineLastPKResultView: UITableViewDataSource {
         let cell = tableView.dequeueReusableCell(withIdentifier: MOLinePkContributionCell.className())
         if let cell = cell as? MOLinePkContributionCell {
             cell.updateContent(indexPath.row, userList[indexPath.row], .mySide, false)
+            cell.showFirstNumPic()
         }
         return cell!
     }

+ 12 - 0
MiMoLive/MiMoLive/Classes/Live/View/MOPKListView/PKContribution/MOLinePkContributionCell.swift

@@ -17,6 +17,7 @@ class MOLinePkContributionCell: UITableViewCell {
     private let userInfoLabel = YYLabel()
     private let beans = UILabel()
     private var user: MOLivePkContributeUser? = nil
+    private var index: Int = 0
     
     override init(style: UITableViewCell.CellStyle, reuseIdentifier: String?) {
         super.init(style: style, reuseIdentifier: reuseIdentifier)
@@ -33,8 +34,19 @@ class MOLinePkContributionCell: UITableViewCell {
         updateUserName(data.user.nickname, data.user.gender, data.user.level, 0)
         beans.text = data.amount.toStrFormat(1)
         self.user = data
+        self.index = index
         updateIndexNum(index + 1, type, hightLightFirst)
     }
+    
+    func showFirstNumPic() {
+        if index == 0 {
+            numLabel.isHidden = true
+            firstNumIc.isHidden = false
+        } else {
+            numLabel.isHidden = false
+            firstNumIc.isHidden = true
+        }
+    }
 }
 
 extension MOLinePkContributionCell {