杨锴
2024-11-06 63f7ed967433acee3ae8764c7a077e15c29c41f2
XQMuse/Root/Course/VC/CourseDetialVC.swift
@@ -126,6 +126,21 @@
        share_bitem.tintColor = .white
        share_bitem.imageInsets = UIEdgeInsets(top: 0, left: 0, bottom: 0, right: 15)
        navigationItem.rightBarButtonItems = [share_bitem,collect_bitem]
        section0TCell.webView.scrollView.rx.observe(CGSize.self, "contentSize").map { (size) -> CGFloat? in
            if let size = size{
                return size.height
            }
            return nil
        }.subscribe(onNext: { [weak self](height) in
            if let height = height{
                if height > self?.section0Height ?? 0{
                    self?.section0Height = height
                    self?.section0TCell.cons_webHei.constant = height
                    self?.tableView?.reloadRows(at: [IndexPath(row: 0, section: 0)], with: .none)
                }
            }
        }).disposed(by: disposeBag)
            }
            private func getData(){
@@ -152,7 +167,7 @@
                    }
                    if needPayment{
                        let attribute    = AttributedStringbuilder.build().add(string: "    疗愈币", withFont: .systemFont(ofSize: 12,weight: .bold), withColor: UIColor(hexString: "#F6F6F6")!).add(string: "\(m.iosPrice.jq_formatFloat)", withFont: .systemFont(ofSize: 21.71, weight: .bold), withColor: UIColor(hexString: "#F6F6F6")!).add(string: "  立即购买     ", withFont: .systemFont(ofSize: 16, weight: .bold), withColor: UIColor(hexString: "#F6F6F6")!).mutableAttributedString
                        let attribute = AttributedStringbuilder.build().add(string: "    疗愈币", withFont: .systemFont(ofSize: 12,weight: .bold), withColor: UIColor(hexString: "#F6F6F6")!).add(string: "\(m.iosPrice.jq_formatFloat)", withFont: .systemFont(ofSize: 21.71, weight: .bold), withColor: UIColor(hexString: "#F6F6F6")!).add(string: "  立即购买     ", withFont: .systemFont(ofSize: 16, weight: .bold), withColor: UIColor(hexString: "#F6F6F6")!).mutableAttributedString
                        weakSelf.studyBtn.setAttributedTitle(attribute, for: .normal)
                    }else{
                        let attribute = AttributedStringbuilder.build().add(string: "    立即学习    ", withFont: .systemFont(ofSize: 16, weight: .bold), withColor: UIColor(hexString: "#F6F6F6")!).mutableAttributedString
@@ -213,19 +228,6 @@
            }
            override func setRx() {
                        section0TCell.webView.scrollView.rx.observe(CGSize.self, "contentSize").map { (size) -> CGFloat? in
                                    if let size = size{
                                                return size.height
                                    }
                                    return nil
                        }.subscribe(onNext: { [weak self](height) in
                                    if let height = height{
                if height > self?.section0Height ?? 0{
                                                            self?.section0Height = height
                                                            self?.tableView?.reloadData()
                                                }
                                    }
                        }).disposed(by: disposeBag)
                        NotificationCenter.default.rx.notification(CourseRefresh_Noti).take(until: self.rx.deallocated).subscribe(onNext: {[weak self]data in
                                    self?.getData()