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

Merge branch 'dev' into dev_yanxuyao

yanxuyao 2 өдөр өмнө
parent
commit
d14a0e683c

+ 6 - 0
Lanu/Assets.xcassets/Common/Security/Contents.json

@@ -0,0 +1,6 @@
+{
+  "info" : {
+    "author" : "xcode",
+    "version" : 1
+  }
+}

+ 22 - 0
Lanu/Assets.xcassets/Common/Security/ic_security.imageset/Contents.json

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

BIN
Lanu/Assets.xcassets/Common/Security/ic_security.imageset/ic_security@2x.png


BIN
Lanu/Assets.xcassets/Common/Security/ic_security.imageset/ic_security@3x.png


+ 8 - 0
Lanu/Manager/Purchase/LNPurchaseManager.swift

@@ -165,6 +165,14 @@ extension LNPurchaseManager {
             }
         }
     }
+    
+    func getBankAccountStatus(queue: DispatchQueue = .main, handler: @escaping(LNBankAccountStatus?) -> Void) {
+        LNHttpManager.shared.getBankAccountStatus { res, err in
+            queue.asyncIfNotGlobal {
+                handler(res?.bankCardState)
+            }
+        }
+    }
 }
 
 extension LNPurchaseManager: LNAccountManagerNotify {

+ 6 - 0
Lanu/Manager/Purchase/Network/LNHttpManager+Purchase.swift

@@ -19,6 +19,8 @@ private let kNetPath_Purchase_Verify = "/wallet/recharge/goods/payBak"
 private let kNetPath_Purchase_Exchange = "/wallet/exchange"
 private let kNetPath_Purchase_Pre = "/wallet/exchange/pre"
 
+private let kNetPath_Purchase_Bank_Account = "/wallet/withdraw/getRealNameAuthStatus"
+
 
 extension LNHttpManager {
     func getWalletInfo(completion: @escaping (LNUserWalletInfoResponse?, LNHttpError?) -> Void) {
@@ -64,4 +66,8 @@ extension LNHttpManager {
             "amount": count
         ], completion: completion)
     }
+    
+    func getBankAccountStatus(completion: @escaping(LNBankAccountStatusResponse?, LNHttpError?) -> Void) {
+        post(path: kNetPath_Purchase_Bank_Account, completion: completion)
+    }
 }

+ 12 - 0
Lanu/Manager/Purchase/Network/LNPurchaseResponse.swift

@@ -84,3 +84,15 @@ class LNPurchaseCreateOrderResponse: Decodable {
 class LNExchangeExpectResponse: Decodable {
     var amount: Double = 0.0
 }
+
+enum LNBankAccountStatus: Int, Decodable {
+    case none
+    case reviewing
+    case done
+    case notPass
+}
+
+@AutoCodable
+class LNBankAccountStatusResponse: Decodable {
+    var bankCardState: LNBankAccountStatus = .none
+}

+ 8 - 0
Lanu/SceneDelegate.swift

@@ -140,7 +140,15 @@ extension SceneDelegate: LNAccountManagerNotify {
             } else if curTime - LNUserDefaults[.updateCheckTime, 0] > 7 * 24 * 3600  {
                 LNAppConfig.shared.checkNewVersion { hasNew in
                     guard hasNew else { return }
+                    let cover = UIImageView(image: .icHomeTopBg)
+                    
                     let alert = LNCommonAlertView()
+                    alert.container.insertSubview(cover, at: 0)
+                    cover.snp.makeConstraints { make in
+                        make.horizontalEdges.equalToSuperview()
+                        make.top.equalToSuperview()
+                    }
+                    
                     alert.titleLabel.text = .init(key: "A00392")
                     alert.showConfirm(.init(key: "B00139")) {
                         LNAppConfig.shared.jumpToAppStore()

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

@@ -79,7 +79,7 @@ extension LNProfileUserInfoView {
     private func updateLikeView(animateLike: Bool = false) {
         guard let likeInfo else { return }
         likeIc.superview?.isHidden = false
-        scoreLabel.text = likeInfo.count.formattedAsShortNumber()
+        scoreLabel.text = likeInfo.count.formattedAsShortNumber(fractionDigits: 2)
         scoreLabel.isHidden = likeInfo.count == 0
         if likeInfo.liked {
             likeIc.image = .icLikeFilled

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

@@ -29,6 +29,7 @@ class LNBeanViewController: LNViewController {
         setupViews()
         
         updateContent()
+        loadBankStatus()
     }
     
     override func viewDidAppear(_ animated: Bool) {
@@ -38,6 +39,23 @@ class LNBeanViewController: LNViewController {
     }
 }
 
+extension LNBeanViewController {
+    private func loadBankStatus() {
+        guard myUserInfo.playmate, LNConfigManager.shared.isBeanAvailable else { return }
+        LNPurchaseManager.shared.getBankAccountStatus { [weak self] status in
+            guard let self else { return }
+            guard status == .done else { return }
+            let button = UIButton()
+            button.setImage(.icSecurity, for: .normal)
+            button.addAction(UIAction(handler: { [weak self] _ in
+                guard let self else { return }
+                view.pushToWebView(.init(url: .beanUrl))
+            }), for: .touchUpInside)
+            setRightButton(button)
+        }
+    }
+}
+
 extension LNBeanViewController: LNPurchaseManagerNotify {
     func onUserWalletInfoChanged(info: LNUserWalletInfo) {
         updateContent()