|
|
@@ -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()
|