| | |
| | | |
| | | }else if indexPath.row > 0 && indexPath.row < ((model?.vipList[selectIndex].couponList.count ?? 0) + 1) { |
| | | let cell = tableView.dequeueReusableCell(withIdentifier: "_WelfareCouponsTCell", for: indexPath) as! WelfareCouponsTCell |
| | | cell.indexPath = indexPath |
| | | // cell.moneyLab.text = model?.vipList[selectIndex].couponList[indexPath.row - 1].ruleModel?.deductionAmount |
| | | // cell.remarksLab.text = model?.vipList[selectIndex].couponList[indexPath.row - 1].ruleModel?.conditionalAmount |
| | | // cell.nameLab.text = model?.vipList[selectIndex].couponList[indexPath.row - 1].name |
| | |
| | | return 295 |
| | | |
| | | }else if indexPath.row > 0 && indexPath.row < ((model?.vipList[selectIndex].couponList.count ?? 0) + 1) { |
| | | return 170 |
| | | let model = model?.vipList[selectIndex].couponList[indexPath.row - 1] |
| | | if rows.contains(where: {$0 == indexPath.row}){ |
| | | let h = max(String.jq_getHeight(text: model?.instructionsForUse ?? "", width: UIScreen.main.bounds.size.width - 200, font: 12), 30) |
| | | return h + 125 |
| | | }else{ |
| | | return 125 |
| | | } |
| | | }else{ |
| | | return 110 |
| | | } |
| | |
| | | @IBOutlet weak var scrBackView: UIView! |
| | | var model: VipDataModel? |
| | | var selectIndex: Int = 0 |
| | | |
| | | private var rows = Set<Int>() |
| | | @IBOutlet weak var headerImg: UIImageView! |
| | | @IBOutlet weak var memberLab: UILabel! |
| | | @IBOutlet weak var nameLab: UILabel! |
| | |
| | | self?.model = data.data |
| | | self?.tabView.reloadData() |
| | | self?.nameLab.text = data.data?.name |
| | | if data.data?.isVip ?? 0 > 0 { |
| | | if data.data?.isVip ?? 0 == 0 { |
| | | self?.memberLab.text = "当前暂未开通会员" |
| | | }else{ |
| | | self?.memberLab.text = "Vip" |
| | | } |
| | | self?.headerImg.sd_setImage(with: URL(string: self?.model?.headImg ?? "")) |
| | | |
| | | self?.headerImg.sd_setImage(with: URL(string: self?.model?.headImg ?? "") ,placeholderImage: UIImage(named: "user_default")) |
| | | }).disposed(by: disposeBag) |
| | | |
| | | NotificationCenter.default.rx.notification(WelfareCoupons_Noti).take(until: self.rx.deallocated).subscribe(onNext: {noti in |
| | | if let row = noti.object as? Int{ |
| | | if self.rows.contains(row){ |
| | | self.rows.remove(row) |
| | | }else{ |
| | | self.rows.insert(row) |
| | | } |
| | | self.tabView.beginUpdates() |
| | | self.tabView.reloadRows(at: [IndexPath(row: row, section: 0)], with: .fade) |
| | | self.tabView.endUpdates() |
| | | } |
| | | }).disposed(by: disposeBag) |
| | | } |
| | | |
| | | |