From d178e85e06d287ce8ca8b79811ec636fbc9d50e1 Mon Sep 17 00:00:00 2001
From: 杨锴 <841720330@qq.com>
Date: 星期三, 04 十二月 2024 09:29:22 +0800
Subject: [PATCH] fix bug

---
 XQMuse/Root/Me/VC/WatchHistoryDetailVC.swift |  110 +++++++++++++++++++++++++++++-------------------------
 1 files changed, 59 insertions(+), 51 deletions(-)

diff --git a/XQMuse/Root/Me/VC/WatchHistoryDetailVC.swift b/XQMuse/Root/Me/VC/WatchHistoryDetailVC.swift
index d9bc092..a662566 100644
--- a/XQMuse/Root/Me/VC/WatchHistoryDetailVC.swift
+++ b/XQMuse/Root/Me/VC/WatchHistoryDetailVC.swift
@@ -99,59 +99,67 @@
 
 								let item = viewModel.dataSource.value[indexPath.row]
 
-								if viewModel.state.value == 1{
-            //待支付
-            if item.paymentStatus == .yes{
-                Services.getMeditationDetail(id: item.businessId).subscribe(onNext: {data in
-                    if let m = data.data{
-                        let vc = PaymentOrderVC(museItemModel: m, type: .muse, giftToOther: false, showType: .horizontal,businessId: item.id)
-                        JQ_currentViewController().jq_push(vc: vc)
-                    }
-                }).disposed(by: disposeBag)
-                return
+        Services.gvieCourseAgain(id: item.id).subscribe(onNext: {[weak self]data in
+            guard let weakSelf = self else { return }
+            if let m = data.data{
+                let vc = PaymentOrderVC(pendingModel: m, type: weakSelf.viewModel.state.value == 1 ? .muse:.course)
+                JQ_currentViewController().jq_push(vc: vc)
             }
+        }).disposed(by: disposeBag)
 
-
-            Services.getMeditationDetail(id: item.businessId).subscribe(onNext: {data in
-                if let m = data.data{
-                    let vc = HomeItemDetailVC(model: m)
-                    JQ_currentViewController().jq_push(vc: vc)
-                }
-            }).disposed(by: disposeBag)
-								}else{
-            if item.courseType == .online{
-
-                //待支付
-                if item.paymentStatus == .yes{
-                    Services.getCourseDetail(courseId: item.businessId).subscribe(onNext: { data in
-                        if let m = data.data{
-                            let vc = PaymentOrderVC(courseItemModel: m, type: .course, giftToOther: false, showType: .horizontal,businessId: item.id)
-                            JQ_currentViewController().jq_push(vc: vc)
-                        }
-                    }).disposed(by: disposeBag)
-                    return
-                }
-
-
-                Services.getCourseDetail(courseId: item.businessId).subscribe(onNext: {data in
-                    if let m = data.data{
-                        if m.isVip == .no && m.chargeType == .vipFree{
-                            let vc = VIPCenterVC()
-                            JQ_currentNavigationController().pushViewController(vc)
-                        }else if m.courseType == .online{
-                            let vc = CourseDetialVC(courseModel: m)
-                            JQ_currentViewController().jq_push(vc: vc)
-                        }else{
-                            let vc = CourseDetialOfflineVC(courseId: m.id)
-                            JQ_currentViewController().jq_push(vc: vc)
-                        }
-                    }
-                }).disposed(by: disposeBag)
-            }else{
-                let vc = CourseDetialOfflineVC(courseId: item.businessId)
-                push(vc: vc)
-            }
-								}
+//								if viewModel.state.value == 1{
+//            //待支付
+//            if item.paymentStatus == .yes{
+//                Services.getMeditationDetail(id: item.businessId).subscribe(onNext: {data in
+//                    if let m = data.data{
+//                        let vc = PaymentOrderVC(museItemModel: m, type: .muse, giftToOther: false, showType: .horizontal,businessId: item.id)
+//                        JQ_currentViewController().jq_push(vc: vc)
+//                    }
+//                }).disposed(by: disposeBag)
+//                return
+//            }
+//
+//
+//            Services.getMeditationDetail(id: item.businessId).subscribe(onNext: {data in
+//                if let m = data.data{
+//                    let vc = HomeItemDetailVC(model: m)
+//                    JQ_currentViewController().jq_push(vc: vc)
+//                }
+//            }).disposed(by: disposeBag)
+//								}else{
+//            if item.courseType == .online{
+//
+//                //待支付
+//                if item.paymentStatus == .yes{
+//                    Services.getCourseDetail(courseId: item.businessId).subscribe(onNext: { data in
+//                        if let m = data.data{
+//                            let vc = PaymentOrderVC(courseItemModel: m, type: .course, giftToOther: false, showType: .horizontal,businessId: item.id)
+//                            JQ_currentViewController().jq_push(vc: vc)
+//                        }
+//                    }).disposed(by: disposeBag)
+//                    return
+//                }
+//
+//
+//                Services.getCourseDetail(courseId: item.businessId).subscribe(onNext: {data in
+//                    if let m = data.data{
+//                        if m.isVip == .no && m.chargeType == .vipFree{
+//                            let vc = VIPCenterVC()
+//                            JQ_currentNavigationController().pushViewController(vc)
+//                        }else if m.courseType == .online{
+//                            let vc = CourseDetialVC(courseModel: m)
+//                            JQ_currentViewController().jq_push(vc: vc)
+//                        }else{
+//                            let vc = CourseDetialOfflineVC(courseId: m.id)
+//                            JQ_currentViewController().jq_push(vc: vc)
+//                        }
+//                    }
+//                }).disposed(by: disposeBag)
+//            }else{
+//                let vc = CourseDetialOfflineVC(courseId: item.businessId)
+//                push(vc: vc)
+//            }
+//								}
 				}
 }
 

--
Gitblit v1.7.1