From 63f7ed967433acee3ae8764c7a077e15c29c41f2 Mon Sep 17 00:00:00 2001
From: 杨锴 <841720330@qq.com>
Date: 星期三, 06 十一月 2024 21:17:19 +0800
Subject: [PATCH] fix bug

---
 XQMuse/Root/Course/VC/CourseDetialVC.swift |   30 ++++++++++++++++--------------
 1 files changed, 16 insertions(+), 14 deletions(-)

diff --git a/XQMuse/Root/Course/VC/CourseDetialVC.swift b/XQMuse/Root/Course/VC/CourseDetialVC.swift
index 6c5f016..99ab290 100644
--- a/XQMuse/Root/Course/VC/CourseDetialVC.swift
+++ b/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()

--
Gitblit v1.7.1