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

Merge remote-tracking branch 'origin/dev' into feat/adjust

* origin/dev:
  fix: 修复编译错误
  feat: 如果体现入口配置为空或者 0 ,则表示不限制
  fix: 修复提现多语言图片没生效的问题
  feat: 补充金豆刷新余额的场景
  feat: 补充访客为空时的缺省界面展示逻辑
  feat: 补充金豆提现功能
  fix: 修复个人页底部菜单界面底部镂空的问题
  fix: 修复在手机输入页面进行其他方式登录后,没有返回首页的问题
  feat: 补充正式环境的 APNs 推送配置
  feat: 调整技能示例图的展示方式
陈文艺 2 месяцев назад
Родитель
Сommit
6cc669ac44
23 измененных файлов с 176 добавлено и 19 удалено
  1. 22 0
      Lanu/Assets.xcassets/Wallet/ic_bean_value_bg_cn.imageset/Contents.json
  2. BIN
      Lanu/Assets.xcassets/Wallet/ic_bean_value_bg_cn.imageset/ic_bean_value_bg_cn@2x.png
  3. BIN
      Lanu/Assets.xcassets/Wallet/ic_bean_value_bg_cn.imageset/ic_bean_value_bg_cn@3x.png
  4. 25 0
      Lanu/Assets.xcassets/Wallet/ic_bean_value_bg_en.imageset/Contents.json
  5. BIN
      Lanu/Assets.xcassets/Wallet/ic_bean_value_bg_en.imageset/ic_bean_value_bg@2x.png
  6. BIN
      Lanu/Assets.xcassets/Wallet/ic_bean_value_bg_en.imageset/ic_bean_value_bg@3x.png
  7. 22 0
      Lanu/Assets.xcassets/Wallet/ic_bean_value_bg_id.imageset/Contents.json
  8. BIN
      Lanu/Assets.xcassets/Wallet/ic_bean_value_bg_id.imageset/ic_bean_value_bg_id@2x.png
  9. BIN
      Lanu/Assets.xcassets/Wallet/ic_bean_value_bg_id.imageset/ic_bean_value_bg_id@3x.png
  10. 1 1
      Lanu/Common/Config/LNAppConfig.swift
  11. 12 1
      Lanu/Manager/Config/LNConfigManager.swift
  12. 6 0
      Lanu/Manager/Config/Network/LNConfigResponse.swift
  13. 9 5
      Lanu/Manager/IM/LNIMManager.swift
  14. 13 0
      Lanu/SceneDelegate.swift
  15. 2 2
      Lanu/Views/Game/Join/Input/Example/LNJoinUsPhotoExamplePanel.swift
  16. 13 0
      Lanu/Views/Game/OrderCenter/Visitors/LNVisitorsViewController.swift
  17. 13 2
      Lanu/Views/Game/Skill/LNSkillBottomMenuView.swift
  18. 5 1
      Lanu/Views/Game/Skill/LNSkillDetailViewController.swift
  19. 0 4
      Lanu/Views/Login/Phone/LNLoginCaptchaInputViewController.swift
  20. 1 1
      Lanu/Views/Profile/Profile/LNProfileBottomMenu.swift
  21. 1 1
      Lanu/Views/Profile/Profile/LNProfileViewController.swift
  22. 7 1
      Lanu/Views/Settings/LNAboutViewController.swift
  23. 24 0
      Lanu/Views/Wallet/Bean/LNBeanViewController.swift

+ 22 - 0
Lanu/Assets.xcassets/Wallet/ic_bean_value_bg_cn.imageset/Contents.json

@@ -0,0 +1,22 @@
+{
+  "images" : [
+    {
+      "idiom" : "universal",
+      "scale" : "1x"
+    },
+    {
+      "filename" : "ic_bean_value_bg_cn@2x.png",
+      "idiom" : "universal",
+      "scale" : "2x"
+    },
+    {
+      "filename" : "ic_bean_value_bg_cn@3x.png",
+      "idiom" : "universal",
+      "scale" : "3x"
+    }
+  ],
+  "info" : {
+    "author" : "xcode",
+    "version" : 1
+  }
+}

BIN
Lanu/Assets.xcassets/Wallet/ic_bean_value_bg_cn.imageset/ic_bean_value_bg_cn@2x.png


BIN
Lanu/Assets.xcassets/Wallet/ic_bean_value_bg_cn.imageset/ic_bean_value_bg_cn@3x.png


+ 25 - 0
Lanu/Assets.xcassets/Wallet/ic_bean_value_bg_en.imageset/Contents.json

@@ -0,0 +1,25 @@
+{
+  "images" : [
+    {
+      "idiom" : "universal",
+      "scale" : "1x"
+    },
+    {
+      "filename" : "ic_bean_value_bg@2x.png",
+      "idiom" : "universal",
+      "scale" : "2x"
+    },
+    {
+      "filename" : "ic_bean_value_bg@3x.png",
+      "idiom" : "universal",
+      "scale" : "3x"
+    }
+  ],
+  "info" : {
+    "author" : "xcode",
+    "version" : 1
+  },
+  "properties" : {
+    "localizable" : true
+  }
+}

BIN
Lanu/Assets.xcassets/Wallet/ic_bean_value_bg_en.imageset/ic_bean_value_bg@2x.png


BIN
Lanu/Assets.xcassets/Wallet/ic_bean_value_bg_en.imageset/ic_bean_value_bg@3x.png


+ 22 - 0
Lanu/Assets.xcassets/Wallet/ic_bean_value_bg_id.imageset/Contents.json

@@ -0,0 +1,22 @@
+{
+  "images" : [
+    {
+      "idiom" : "universal",
+      "scale" : "1x"
+    },
+    {
+      "filename" : "ic_bean_value_bg_id@2x.png",
+      "idiom" : "universal",
+      "scale" : "2x"
+    },
+    {
+      "filename" : "ic_bean_value_bg_id@3x.png",
+      "idiom" : "universal",
+      "scale" : "3x"
+    }
+  ],
+  "info" : {
+    "author" : "xcode",
+    "version" : 1
+  }
+}

BIN
Lanu/Assets.xcassets/Wallet/ic_bean_value_bg_id.imageset/ic_bean_value_bg_id@2x.png


BIN
Lanu/Assets.xcassets/Wallet/ic_bean_value_bg_id.imageset/ic_bean_value_bg_id@3x.png


+ 1 - 1
Lanu/Common/Config/LNAppConfig.swift

@@ -99,7 +99,7 @@ class LNAppConfig {
     var languageBundleMap: [LNAppLanguage: Bundle] = {
         LNAppLanguage.available.reduce(into: [LNAppLanguage: Bundle](), { result, language in
             let bundle = if let path = Bundle.main.path(forResource: language.bundleName, ofType: "lproj"),
-                  let bundle = Bundle(path: path) {
+                            let bundle = Bundle(path: path) {
                 bundle
             } else {
                 Bundle.main

+ 12 - 1
Lanu/Manager/Config/LNConfigManager.swift

@@ -10,7 +10,18 @@ import Foundation
 
 class LNConfigManager {
     static let shared = LNConfigManager()
-    private(set) var commonConfig: LNConfigResponse = LNConfigResponse()
+    private(set) var commonConfig = LNConfigResponse()
+    
+    var isBeanAvailable: Bool {
+        guard let version = commonConfig.appReviewSpecialVersionConfig?.ios else { return false }
+        if version.isEmpty { return true }
+        
+        guard let iVersion = Int(version) else { return false }
+        if iVersion == 0 { return true }
+        
+        guard let curVersion = Int(curBuildVersion) else { return false }
+        return curVersion < iVersion
+    }
     
     private init() {
         LNEventDeliver.addObserver(self)

+ 6 - 0
Lanu/Manager/Config/Network/LNConfigResponse.swift

@@ -29,11 +29,17 @@ class LNLanguageConstsVO: Decodable {
     var name: String = ""
 }
 
+@AutoCodable
+class LNAppVersionConfigVO: Decodable {
+    var ios: String = ""
+}
+
 @AutoCodable
 class LNConfigResponse: Decodable {
     var commonCoinExchangeConsts: [LNCurrenyExchangeConstsVO] = []
     var commonAreaConsts: [LNCommonAreaConstsVO] = []
     var commonLanguageConsts: [LNLanguageConstsVO] = []
+    var appReviewSpecialVersionConfig: LNAppVersionConfigVO?
     
     init() { }
 }

+ 9 - 5
Lanu/Manager/IM/LNIMManager.swift

@@ -45,11 +45,15 @@ class LNIMManager: NSObject {
         }
     }
     var offlinePushAppId: Int32 {
-//#if DEBUG
-//        17229
-//#else
-        17249
-//#endif
+        if LNAppConfig.shared.curEnv == .test {
+            //#if DEBUG
+            //        17229 // 本地调试使用这个
+            //#else
+            17249 // 打包 ipa 只能用这个
+            //#endif
+        } else {
+            15845
+        }
     }
     
     static var shared = LNIMManager()

+ 13 - 0
Lanu/SceneDelegate.swift

@@ -103,6 +103,19 @@ extension SceneDelegate: LNAccountManagerNotify {
     func onUserLogout() {
         window?.rootViewController = LNNavigationController(rootViewController: LNMainViewController())
     }
+    
+    func onUserLogin() {
+        guard let nav = window?.rootViewController as? UINavigationController else {
+            return
+        }
+        
+        if let index = nav.viewControllers.lastIndex(where: {
+            !($0 is LNLoginPhoneInputViewController
+              || $0 is LNLoginCaptchaInputViewController) }) {
+            let viewControllers = Array(nav.viewControllers[0...index])
+            nav.setViewControllers(viewControllers, animated: true)
+        }
+    }
 }
 
 extension SceneDelegate {

+ 2 - 2
Lanu/Views/Game/Join/Input/Example/LNJoinUsPhotoExamplePanel.swift

@@ -34,7 +34,7 @@ class LNJoinUsPhotoExamplePanel: LNPopupView {
             guard let image else { return }
             imageView.snp.makeConstraints { make in
                 make.height.equalTo(self.imageView.snp.width)
-                    .multipliedBy(image.size.height / image.size.width).priority(.medium)
+                    .multipliedBy(image.size.height / image.size.width).priority(.high)
             }
         }
         
@@ -57,7 +57,7 @@ extension LNJoinUsPhotoExamplePanel {
         
         imageView.layer.cornerRadius = 12
         imageView.clipsToBounds = true
-        imageView.contentMode = .scaleAspectFill
+        imageView.contentMode = .scaleAspectFit
         imageView.isUserInteractionEnabled = true
         imageView.onTap { [weak self] in
             guard let self else { return }

+ 13 - 0
Lanu/Views/Game/OrderCenter/Visitors/LNVisitorsViewController.swift

@@ -21,6 +21,7 @@ extension UIView {
 
 
 class LNVisitorsViewController: LNViewController {
+    private let emptyView = LNNoMoreDataView()
     private let permissionView = LNIMNotificationPermissionView()
     private let tableView = UITableView()
     
@@ -53,6 +54,12 @@ extension LNVisitorsViewController {
             }
             nextTag = next
             
+            if visitors.isEmpty {
+                emptyView.showNoData(icon: .icNoDataRelationEmpty)
+            } else {
+                emptyView.hide()
+            }
+            
             tableView.reloadData()
             
             self.tableView.mj_header?.endRefreshing()
@@ -85,6 +92,12 @@ extension LNVisitorsViewController {
         title = .init(key: "B00091")
         view.backgroundColor = .primary_1
         
+        view.addSubview(emptyView)
+        emptyView.snp.makeConstraints { make in
+            make.centerX.equalToSuperview()
+            make.centerY.equalToSuperview().multipliedBy(0.6)
+        }
+        
         let stackView = UIStackView()
         stackView.axis = .vertical
         view.addSubview(stackView)

+ 13 - 2
Lanu/Views/Game/Skill/LNSkillBottomMenuView.swift

@@ -17,7 +17,18 @@ class LNSkillBottomMenuView: UIView {
     
     private var curDetail: LNGameMateSkillDetailVO?
     
+    override init(frame: CGRect) {
+        super.init(frame: frame)
+        
+        setupViews()
+    }
+    
+    required init?(coder: NSCoder) {
+        fatalError("init(coder:) has not been implemented")
+    }
+    
     func update(_ detail: LNGameMateSkillDetailVO) {
+        isHidden = false
         priceLabel.text = detail.price.toDisplay
         unitLabel.text = "/\(detail.unit)"
         
@@ -27,7 +38,7 @@ class LNSkillBottomMenuView: UIView {
                 addSubview(editView)
                 editView.snp.makeConstraints { make in
                     make.leading.equalToSuperview().inset(16)
-                    make.bottom.equalToSuperview().offset(-4)
+                    make.bottom.equalToSuperview().offset(commonBottomInset)
                     make.top.equalToSuperview().offset(16)
                 }
                 
@@ -43,7 +54,7 @@ class LNSkillBottomMenuView: UIView {
                 addSubview(orderView)
                 orderView.snp.makeConstraints { make in
                     make.leading.equalToSuperview().inset(16)
-                    make.bottom.equalToSuperview().offset(-4)
+                    make.bottom.equalToSuperview().offset(commonBottomInset)
                     make.top.equalToSuperview().offset(16)
                 }
                 

+ 5 - 1
Lanu/Views/Game/Skill/LNSkillDetailViewController.swift

@@ -209,7 +209,11 @@ extension LNSkillDetailViewController {
         }
         
         let menu = buildBottomMenu()
-        stackView.addArrangedSubview(menu)
+        view.addSubview(menu)
+        menu.snp.makeConstraints { make in
+            make.horizontalEdges.equalToSuperview()
+            make.bottom.equalToSuperview()
+        }
     }
     
     private func setupNavBar() {

+ 0 - 4
Lanu/Views/Login/Phone/LNLoginCaptchaInputViewController.swift

@@ -65,10 +65,6 @@ extension LNLoginCaptchaInputViewController: LNAccountManagerNotify {
             ])
         }
     }
-    
-    func onUserLogin() {
-        navigationController?.popToRootViewController(animated: true)
-    }
 }
 
 extension LNLoginCaptchaInputViewController: UITextViewDelegate {

+ 1 - 1
Lanu/Views/Profile/Profile/LNProfileBottomMenu.swift

@@ -104,7 +104,7 @@ extension LNProfileBottomMenu {
         stackView.snp.makeConstraints { make in
             make.horizontalEdges.equalToSuperview().inset(16)
             make.top.equalToSuperview().offset(16)
-            make.bottom.equalToSuperview().offset(-4)
+            make.bottom.equalToSuperview().offset(commonBottomInset)
         }
         
         let follow = buildFollowView()

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

@@ -248,7 +248,7 @@ extension LNProfileViewController {
         view.addSubview(menu)
         menu.snp.makeConstraints { make in
             make.horizontalEdges.equalToSuperview()
-            make.bottom.equalToSuperview().offset(-view.safeBottomInset)
+            make.bottom.equalToSuperview()
         }
         
         scoreView.isHidden = true

+ 7 - 1
Lanu/Views/Settings/LNAboutViewController.swift

@@ -50,8 +50,14 @@ extension LNAboutViewController {
             make.top.equalTo(icon.snp.bottom).offset(7)
         }
         
+        var versionStr: String = .init(key: "A00248", curAppVersion)
+        
+#if DEBUG
+        versionStr += "(\(curBuildVersion)"
+#endif
+        
         let versionLabel = UILabel()
-        versionLabel.text = .init(key: "A00248", curAppVersion)
+        versionLabel.text = versionStr
         versionLabel.font = .body_s
         versionLabel.textColor = .text_5
         view.addSubview(versionLabel)

+ 24 - 0
Lanu/Views/Wallet/Bean/LNBeanViewController.swift

@@ -30,6 +30,12 @@ class LNBeanViewController: LNViewController {
         
         updateContent()
     }
+    
+    override func viewDidAppear(_ animated: Bool) {
+        super.viewDidAppear(animated)
+        
+        LNPurchaseManager.shared.reloadWalletInfo()
+    }
 }
 
 extension LNBeanViewController: LNPurchaseManagerNotify {
@@ -76,6 +82,24 @@ extension LNBeanViewController {
             make.edges.equalToSuperview()
         }
         
+        if LNConfigManager.shared.isBeanAvailable {
+            let tag = UIImageView()
+            tag.image = switch LNAppConfig.shared.curLang {
+            case .chiness: .icBeanValueBgCn
+            case .english: .icBeanValueBgEn
+            case .indonesian: .icBeanValueBgId
+            }
+            tag.isUserInteractionEnabled = true
+            tag.onTap { [weak self] in
+                guard let self else { return }
+                view.pushToWebView(.init(url: .beanUrl))
+            }
+            container.addSubview(tag)
+            tag.snp.makeConstraints { make in
+                make.top.trailing.equalToSuperview()
+            }
+        }
+        
         let totalView = UIView()
         container.addSubview(totalView)
         totalView.snp.makeConstraints { make in