| | |
| | | import JQTools |
| | | import StoreKit |
| | | import RxSwift |
| | | import SwiftyStoreKit |
| | | |
| | | class WalletRechargeVC: BaseVC { |
| | | |
| | |
| | | super.viewDidLoad() |
| | | title = "疗愈币充值" |
| | | |
| | | Services.getTurn(progress: false).subscribe(onNext: {[weak self]data in |
| | | guard let weakSelf = self else { return } |
| | | if let m = data.data,m == true{ |
| | | weakSelf.isShowMore = m |
| | | weakSelf.tap_other.isHidden = false |
| | | weakSelf.tap_other_title.text = "支".appending("付").appending("宝") |
| | | } |
| | | }).disposed(by: disposeBag) |
| | | if !isSimulator{ |
| | | Services.getTurn(progress: false).subscribe(onNext: {[weak self]data in |
| | | guard let weakSelf = self else { return } |
| | | if let m = data.data,m == true{ |
| | | weakSelf.isShowMore = m |
| | | weakSelf.tap_other.isHidden = false |
| | | weakSelf.tap_other_title.text = "支".appending("付").appending("宝") |
| | | } |
| | | }).disposed(by: disposeBag) |
| | | } |
| | | |
| | | |
| | | |
| | | btn_handle.isEnabled = false |
| | |
| | | InPurchaseManager.purchaseProduct(ID: product.productIdentifier, applicationUsername: userId.string) {[weak self] result in |
| | | guard let weakSelf = self else { return } |
| | | if result.status == 0{ |
| | | let transactionId = result.receipt?.in_app.first?.original_transaction_id ?? "" |
| | | let transactionId = result.receipt?.in_app.first?.transaction_id ?? "" |
| | | Services.placeOrderApple(amount: product.price.doubleValue, balanceFlag: .no, orderFrom: 4, transactionIdentifier: transactionId, vipType: nil).subscribe(onNext: { data in |
| | | showHUD("正在查询购买结果") |
| | | let observable = Observable<Int>.interval(RxTimeInterval.seconds(5), scheduler: MainScheduler.instance) |