Răsfoiți Sursa

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

* origin/feat/from_bean:
  fix: 修复提现多语言图片没生效的问题
  feat: 补充金豆刷新余额的场景
  feat: 补充金豆提现功能
陈文艺 2 luni în urmă
părinte
comite
0501a4c0ac

+ 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

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

@@ -10,7 +10,15 @@ 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 }
+        guard let iVersion = Int(version) else { return false }
+        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() { }
 }

+ 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