Просмотр исходного кода

fix: 修复年龄选择少于 18 岁的问题

陈文艺 2 месяцев назад
Родитель
Сommit
34b802db2a

+ 1 - 1
Lanu/Common/Extension/Date+Extension.swift

@@ -106,7 +106,7 @@ extension Date {
     
     func yearAgo(_ year: Int) -> Date {
         let calendar = Calendar.current
-        let yearsAgoComponents = DateComponents(year: year, day: 1)
+        let yearsAgoComponents = DateComponents(year: year, day: -1)
         guard let yearsAgo = calendar.date(byAdding: yearsAgoComponents, to: Date()) else {
             return Date()
         }

+ 13 - 0
Lanu/Views/IM/Chat/GameMate/LNIMChatGameMateSkillCell.swift

@@ -93,6 +93,19 @@ extension LNIMChatGameMateSkillCell {
     private func buildGameView() -> UIView {
         gameView.isHidden = true
         
+        let tapView = UIView()
+        tapView.onTap { [weak self] in
+            guard let self else { return }
+            guard let curItem else { return }
+            delegate?.onIMChatGameMateSkillCell(cell: self, didClickOrder: curItem)
+        }
+        gameView.addSubview(tapView)
+        tapView.snp.makeConstraints { make in
+            make.verticalEdges.equalToSuperview()
+            make.trailing.equalToSuperview()
+            make.width.equalTo(100)
+        }
+        
         let order = UIButton()
         order.setBackgroundImage(.primary_8, for: .normal)
         order.layer.cornerRadius = 12