Parcourir la source

feat: 调整部分展示逻辑

陈文艺 il y a 2 mois
Parent
commit
5af2c770e3

+ 1 - 0
Lanu/Common/Views/ImageUpload/LNUploadImageView.swift

@@ -136,6 +136,7 @@ class LNUploadImageView: UIImageView {
 extension LNUploadImageView {
     private func setupViews() {
         isUserInteractionEnabled = true
+        contentMode = .scaleAspectFill
         
         let noneView = buildDefault()
         addSubview(noneView)

+ 10 - 4
Lanu/Common/Views/TextView/LNCommonTextView.swift

@@ -11,7 +11,7 @@ import SnapKit
 
 
 class LNCommonTextView: UIView {
-    var maxInput = 800 {
+    var maxInput = 0 {
         didSet {
             textViewDidChange(textView)
         }
@@ -48,10 +48,15 @@ extension LNCommonTextView: UITextViewDelegate {
     func textViewDidChange(_ textView: UITextView) {
         placeholderLabel.isHidden = !textView.text.isEmpty
         
-        if textView.text.count > maxInput {
-            textView.text = String(textView.text.prefix(maxInput))
+        if maxInput > 0 {
+            if textView.text.count > maxInput {
+                textView.text = String(textView.text.prefix(maxInput))
+            }
+            textLengthLabel.text = "\(textView.text.count)/\(maxInput)"
+            textLengthLabel.isHidden = false
+        } else {
+            textLengthLabel.isHidden = true
         }
-        textLengthLabel.text = "\(textView.text.count)/\(maxInput)"
         
         delegate?.textViewDidChange?(textView)
     }
@@ -62,6 +67,7 @@ extension LNCommonTextView {
         backgroundColor = .fill_1
         layer.cornerRadius = 12
         
+        textLengthLabel.isHidden = true
         textLengthLabel.text = "0/\(maxInput)"
         textLengthLabel.font = .body_m
         textLengthLabel.textColor = .text_2

+ 5 - 1
Lanu/Common/Views/Toast/LNToastView.swift

@@ -41,8 +41,12 @@ class LNToastView: UIView {
         window.addSubview(self)
         self.snp.makeConstraints { make in
             make.centerX.equalToSuperview()
+            if LNKeyboardManager.shared.isEditing {
+                make.centerY.equalToSuperview().multipliedBy(0.8)
+            } else {
+                make.centerY.equalToSuperview().multipliedBy(1.1)
+            }
             make.leading.greaterThanOrEqualToSuperview().offset(56)
-            make.bottom.equalToSuperview().offset(-331)
         }
         
         allToast.add(self)

+ 1 - 1
Lanu/Manager/GameMate/Network/LNHttpManager+GameMate.swift

@@ -30,7 +30,7 @@ private let kNetPath_GameMate_Settings_Time = "/playmate/getAcceptSet"
 private let kNetPath_GameMate_Settings_Time_Set = "/playmate/acceptSet"
 private let kNetPath_GameMate_Settings_Skill_List = "/playmate/skill/list"
 
-private let kNetPath_GameMate_Visitors = "/playmate/visitors"
+private let kNetPath_GameMate_Visitors = "/user/visitors"
 
 private let kNetPath_GameMate_Skill_Switch = "/skill/switch/get"
 private let kNetPath_GameMate_Skill_Switch_Set = "/skill/switch/set"

+ 1 - 1
Lanu/Manager/Statistic/Network/LNHttpManager+Statistic.swift

@@ -9,7 +9,7 @@ import Foundation
 
 
 private let kNetPath_Statistic_GameMate_Exposure = "/playmate/exposure/report"
-private let kNetPath_Statistic_GameMate_Visitor = "/playmate/visitor/report"
+private let kNetPath_Statistic_GameMate_Visitor = "/user/visitor/report"
 
 
 extension LNHttpManager {

+ 0 - 1
Lanu/Views/Game/Join/Input/BindPhone/LNJoinUsInputCaptchaView.swift

@@ -131,7 +131,6 @@ extension LNJoinUsInputCaptchaView {
             make.top.equalToSuperview().offset(26)
         }
         
-        let descLabel = UILabel()
         descLabel.font = .body_m
         descLabel.textColor = .text_4
         descLabel.numberOfLines = 0

+ 6 - 1
Lanu/Views/Game/Join/Input/BindPhone/LNJoinUsInputPhoneView.swift

@@ -66,9 +66,14 @@ extension LNJoinUsInputPhoneView {
             sections.append((key, map[key]) as! (code: String, list: [LNCountryCodeVO]))
         }
         
-        let item: LNCountryCodeVO? = list.first {
+        var item: LNCountryCodeVO? = list.first {
             $0.code == LNAppConfig.shared.curLang.countryCode
         }
+        if item == nil {
+            item = list.first {
+                $0.code == LNAppLanguage.indonesian.countryCode
+            }
+        }
         if let item {
             countryIcon.sd_setImage(with: URL(string: item.icon))
             countryCodeLabel.text = item.num

+ 26 - 1
Lanu/Views/Game/Join/Input/SkillInfo/LNJoinUsSkillFieldsEditView.swift

@@ -8,6 +8,7 @@
 import Foundation
 import UIKit
 import SnapKit
+import Combine
 
 
 class LNJoinUsSkillFieldsEditView: UIView {
@@ -176,20 +177,44 @@ extension LNJoinUsSkillFieldsEditView {
             make.width.equalToSuperview()
         }
         
+        let bottomMenu = UIView()
+        addSubview(bottomMenu)
+        bottomMenu.snp.makeConstraints { make in
+            make.horizontalEdges.equalToSuperview()
+            make.bottom.equalToSuperview()
+        }
+        
+        let bottomGradient = CAGradientLayer()
+        bottomGradient.colors = [
+            UIColor.white.withAlphaComponent(0).cgColor,
+            UIColor.white.cgColor,
+            UIColor.white.cgColor
+        ]
+        bottomGradient.locations = [0, 0.5, 1]
+        bottomGradient.startPoint = .init(x: 0, y: 0)
+        bottomGradient.endPoint = .init(x: 0, y: 1)
+        bottomMenu.layer.addSublayer(bottomGradient)
+        bottomMenu.publisher(for: \.bounds).removeDuplicates().sink { [weak bottomGradient] newValue in
+            guard let bottomGradient else { return }
+            bottomGradient.frame = newValue
+        }.store(in: &bag)
+        
         applyButton.setTitle(.init(key: "A00240"), for: .normal)
         applyButton.setTitleColor(.text_1, for: .normal)
         applyButton.titleLabel?.font = .heading_h3
         applyButton.layer.cornerRadius = 23.5
         applyButton.backgroundColor = .fill_4
         applyButton.clipsToBounds = true
+        applyButton.isEnabled = false
         applyButton.addAction(UIAction(handler: { [weak self] _ in
             guard let self else { return }
             commit()
         }), for: .touchUpInside)
-        addSubview(applyButton)
+        bottomMenu.addSubview(applyButton)
         applyButton.snp.makeConstraints { make in
             make.horizontalEdges.equalToSuperview().inset(16)
             make.bottom.equalToSuperview().offset(commonBottomInset)
+            make.top.equalToSuperview()
             make.height.equalTo(47)
         }
     }

+ 1 - 1
Lanu/Views/Game/OrderCenter/LNOrderAcceptSettingsViewController.swift

@@ -83,7 +83,7 @@ extension LNOrderAcceptSettingsViewController {
     }
     
     private func saveConfig() {
-        let timeRange = String(format: "%02d:00", selectTime.from) + "-" + String(format: "%02d:00", selectTime.to > 24 ? selectTime.to - 24 : selectTime.to)
+        let timeRange = String(format: "%02d:00", selectTime.from) + "-" + String(format: "%02d:00", selectTime.to >= 24 ? selectTime.to - 24 : selectTime.to)
         if let config,
             config.weekNums == selectDate,
             config.timeRange == timeRange {

+ 1 - 0
Lanu/Views/Game/OrderCenter/Skill/LNSkillCreateViewController.swift

@@ -176,6 +176,7 @@ extension LNSkillCreateViewController {
         confirmButton.layer.cornerRadius = 23.5
         confirmButton.backgroundColor = .fill_4
         confirmButton.clipsToBounds = true
+        confirmButton.isEnabled = false
         confirmButton.addAction(UIAction(handler: { [weak self] _ in
             guard let self else { return }
             commit()

+ 1 - 1
Lanu/Views/Game/Skill/Edit/LNSkillFieldVoiceEditView.swift

@@ -42,7 +42,7 @@ class LNSkillFieldVoiceEditView: LNSkillFieldBaseEditView {
             maxDuration = Double(limit.max)
         }
         
-        if field.value as? String != nil {
+        if (field.value as? String)?.isEmpty == false {
             recordView.isHidden = true
             displayView.isHidden = false
             playDurationLabel.text = "\(field.duration)“"

+ 1 - 0
Lanu/Views/Game/Skill/LNSkillNaviBarView.swift

@@ -35,6 +35,7 @@ class LNSkillNaviBarView: UIView {
         avatar.sd_setImage(with: URL(string: detail.avatar))
         titleLabel.text = detail.nickname
         followButton.isHidden = detail.follow || detail.userNo.isMyUid
+        moreButton.isHidden = detail.userNo.isMyUid
         
         curDetail = detail
     }

+ 1 - 1
Lanu/Views/IM/Chat/Cells/LNIMChatOrderMessageCell.swift

@@ -38,7 +38,7 @@ class LNIMChatOrderMessageCell: UITableViewCell {
         menuButton.isHidden = true
         
         gameIc.sd_setImage(with: URL(string: order.categoryIcon))
-        billInfoLabel.text = "\(order.bizCategoryName)x\(order.purchaseQty)\(order.unit)"
+        billInfoLabel.text = "\(order.bizCategoryName)/\(order.unit) x \(order.purchaseQty)"
         
         curItem = data
         

+ 1 - 1
Lanu/Views/IM/Chat/GameMate/LNIMChatGameMateOrderView.swift

@@ -92,7 +92,7 @@ extension LNIMChatGameMateOrderView {
         let isCreator = order.buyerUserNo.isMyUid
         
         gameIc.sd_setImage(with: URL(string: order.categoryIcon))
-        descLabel.text = "\(order.bizCategoryName) x \(order.purchaseQty)\(order.unit)"
+        descLabel.text = "\(order.bizCategoryName)/\(order.unit) x \(order.purchaseQty)"
         extraLabel.text = .init(key: "A00056", order.customerRemark)
         
         actionView.isHidden = true

+ 1 - 5
Lanu/Views/Profile/Profile/LNProfileViewController.swift

@@ -102,11 +102,7 @@ extension LNProfileViewController {
         guard let detail else { return }
         fakeNavBar.update(detail)
         
-        if detail.cover.isEmpty {
-            cover.sd_setImage(with: URL(string: detail.avatar))
-        } else {
-            cover.sd_setImage(with: URL(string: detail.cover))
-        }
+        cover.sd_setImage(with: URL(string: detail.avatar))
         userInfoView.update(detail)
         voiceBar.update(detail.voiceBar)
         infoView.update(detail)

+ 3 - 3
Lanu/Views/Wallet/LNExchangePanel.swift

@@ -67,7 +67,7 @@ extension LNExchangePanel: UITextFieldDelegate {
             return false
         }
         
-        guard Double(newText) == nil else {
+        guard Double(newText) != nil else {
             return false
         }
         
@@ -240,7 +240,7 @@ extension LNExchangePanel {
             exchangeInput.text = switch exchangeType {
             case .coinToDiamond: myWalletInfo.coin.toDisplay
             case .diamondToCoin: myWalletInfo.diamond.toDisplay
-            case .beanToCoin, .beanToDiamond: myWalletInfo.bean.toDisplay
+            case .beanToCoin, .beanToDiamond: myWalletInfo.availableBean.toDisplay
             }
             checkExchangeButton()
         }), for: .touchUpInside)
@@ -265,7 +265,7 @@ extension LNExchangePanel {
         remainLabel.text = switch exchangeType {
         case .coinToDiamond: myWalletInfo.coin.toDisplay
         case .diamondToCoin: myWalletInfo.diamond.toDisplay
-        case .beanToCoin, .beanToDiamond: myWalletInfo.bean.toDisplay
+        case .beanToCoin, .beanToDiamond: myWalletInfo.availableBean.toDisplay
         }
         remainLabel.font = .heading_h1
         remainLabel.textColor = .text_5