From 62a24b3c7cf92919a93ee575e9460037e1a53816 Mon Sep 17 00:00:00 2001
From: 杨锴 <841720330@qq.com>
Date: 星期四, 07 十一月 2024 19:10:20 +0800
Subject: [PATCH] fix bug

---
 XQMuse/Root/Me/VC/WalletRechargeVC.swift |   18 +++++++++++++++++-
 1 files changed, 17 insertions(+), 1 deletions(-)

diff --git a/XQMuse/Root/Me/VC/WalletRechargeVC.swift b/XQMuse/Root/Me/VC/WalletRechargeVC.swift
index 103b80e..d286d01 100644
--- a/XQMuse/Root/Me/VC/WalletRechargeVC.swift
+++ b/XQMuse/Root/Me/VC/WalletRechargeVC.swift
@@ -25,6 +25,11 @@
         super.viewDidLoad()
         title = "疗愈币充值"
 
+        btn_handle.isEnabled = false
+        btn_handle.alpha = 0.6
+
+        view.backgroundColor = .white
+
         for v in 0...5{
             productList.insert("com.XQMuse.p.\(v)")
         }
@@ -50,6 +55,10 @@
 
     override func setUI() {
         view.backgroundColor = UIColor(hexString: "f6f6f6")
+    }
+
+    override func viewDidLayoutSubviews() {
+        super.viewDidLayoutSubviews()
         btn_handle.jq_gradientNibColor(colorArr:  [UIColor(hexStr: "#8EA47A").cgColor,UIColor(hexStr: "#AFCA98").cgColor], cornerRadius: 20)
     }
 
@@ -61,7 +70,10 @@
 
         let product = products[selectIndexPath.row]
         InPurchaseManager.purchaseProduct(ID: product.productIdentifier, applicationUsername: userId.string) { model in
-
+            if model.status == 0{
+                //需要后端监听推送后,才会更新金额,可能延迟
+                NotificationCenter.default.post(name: Refreh_PaymentWallet_Noti, object: nil)
+            }
         } errorClouse: { error in
             alertError(msg: error.localizedDescription)
         }
@@ -84,6 +96,10 @@
         cell.selectAt(indexPath == selectIndexPath)
         let product = products[indexPath.row]
         cell.lable_title.text = product.localizedTitle
+
+        btn_handle.isEnabled = true
+        btn_handle.alpha = 1.0
+
         return cell
     }
 }

--
Gitblit v1.7.1