| | |
| | | @IBOutlet weak var view_container: UIView! |
| | | @IBOutlet weak var btn_rechargeInfo: UIButton! |
| | | @IBOutlet weak var collectionView: UICollectionView! |
| | | @IBOutlet weak var cons_collectHei: NSLayoutConstraint! |
| | | |
| | | private var items = [RechargeItem]() |
| | | private let cellW = (JQ_ScreenW - 88) / 3.0 |
| | |
| | | view_cion.textColor = .white |
| | | |
| | | Services.voucherCenter().subscribe(onNext: {[weak self] data in |
| | | guard let weakSelf = self else { return } |
| | | for v in data.data ?? []{ |
| | | self?.items.append(RechargeItem(coin: v.wpGold, money: v.amount)) |
| | | weakSelf.items.append(RechargeItem(coin: v.wpGold, money: v.amount)) |
| | | } |
| | | self?.collectionView.reloadData() |
| | | |
| | | let h = ceil(Double(weakSelf.items.count) / 3.0) * weakSelf.cellH + (floor(Double(weakSelf.items.count) / 3.0) - 1) * 18.0 |
| | | weakSelf.cons_collectHei.constant = h |
| | | weakSelf.collectionView.reloadData() |
| | | }).disposed(by: disposeBag) |
| | | } |
| | | |
| | |
| | | |
| | | @IBAction func rechargeAction(_ sender: UIButton) { |
| | | let item = items[selectIndex] |
| | | PaymentView.show(money: (ali:item.money,wx:item.money,coin:nil,course:nil)) {[weak self] type in |
| | | PaymentView.show(money: (ali:item.money,wx:item.money,coin:nil,course:nil,integral:nil)) {[weak self] type in |
| | | guard let weakSelf = self else { return } |
| | | Services.useBenefitPayment(amount: item.money, payType:type).subscribe(onNext: {data in |
| | | if let m = data.data{ |