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 XQMuse/Root/Home/View/HomeHeaderVC.swift | 1 XQMuse/Root/Course/VC/CourseDetialOfflineVC.swift | 196 +++++++ XQMuse/Assets.xcassets/Btns/btn_play.imageset/btn_play@2x.png | 0 XQMuse/Base/BaseTabBarVC.swift | 1 XQMuse/Root/TreeGroup/TreeTeskVC.swift | 16 XQMuse/Root/Course/TCell/CourseDetail_2_TCell.xib | 11 XQMuse/Root/Me/VC/BindAccountVC.swift | 13 XQMuse/Root/Me/VC/WatchHistoryDetailVC.swift | 11 XQMuse/.DS_Store | 0 XQMuse/Base/BaseNav.swift | 2 XQMuse/Root/Home/CCell/HomeRelaxBanner_2_CCell.xib | 13 XQMuse.xcodeproj/project.pbxproj | 16 XQMuse/Root/Course/VC/CourseDetialOfflineVC.xib | 202 ++++++++ XQMuse/Root/Course/View/CourseDetialCustomerView.xib | 106 ++++ XQMuse/Assets.xcassets/Icons/mini_logo.imageset/Contents.json | 22 XQMuse/Root/Home/View/PaymentOrderResultTopView.swift | 4 XQMuse/Root/Login/VC/ForgotPasswordChangeVC.swift | 9 XQMuse/Root/TreeGroup/TreeTeskVC.xib | 13 XQMuse/Root/Me/VC/UserProfileVC.swift | 5 XQMuse/Root/Course/TCell/CourseDetail_1_TCell.xib | 22 XQMuse/Root/Home/CCell/HomeRelaxBanner_2_1_CCell.swift | 2 XQMuse/Root/Home/CCell/HomeRelaxBanner_2_CCell.swift | 4 XQMuse/Root/Home/VC/HomeItemDetailVC.swift | 29 + XQMuse/Assets.xcassets/Icons/icon_vip.imageset/组 5@2x.png | 0 XQMuse/Assets.xcassets/Btns/btn_pause.imageset/Contents.json | 22 XQMuse/Assets.xcassets/Icons/icon_empty.imageset/Contents.json | 21 XQMuse/SceneDelegate.swift | 33 XQMuse/Root/Other/View/ShareView.xib | 5 XQMuse/Assets.xcassets/Btns/btn_customer.imageset/Contents.json | 22 XQMuse/Assets.xcassets/Icons/mini_logo.imageset/mini_logo@2x.png | 0 XQMuse/Root/Plans/PlanGuideVC.swift | 6 XQMuse/Assets.xcassets/Icons/icon_local_1.imageset/icon_local_1@3x.png | 0 XQMuse/Root/Home/HomeVC.swift | 14 XQMuse/Assets.xcassets/Btns/btn_pause.imageset/btn_pause@2x.png | 0 XQMuse/Root/Home/VC/CommentListVC.xib | 8 XQMuse/Root/Me/VC/InviteVC.xib | 1 XQMuse/Assets.xcassets/Btns/btn_customer.imageset/btn_customer@3x.png | 0 XQMuse/Root/Course/VC/CourseDetialVideoVC.swift | 4 XQMuse/Assets.xcassets/Btns/btn_play.imageset/btn_play@3x.png | 0 XQMuse/Root/Network/Services.swift | 17 XQMuse/Assets.xcassets/Icons/icon_vip.imageset/组 5@3x.png | 0 XQMuse/Root/Home/TCell/Home_Style_1_TCell.swift | 2 XQMuse/Root/Me/VC/InviteVC.swift | 7 XQMuse/Root/TreeGroup/View/TreeTeskExchangeSuccessView.xib | 1 XQMuse/Root/Course/VC/CourseMenuVC.swift | 42 + XQMuse/Root/Course/VC/CourseVCTeacherSpecialVC.swift | 31 XQMuse/Assets.xcassets/Icons/icon_local_1.imageset/Contents.json | 22 XQMuse/Root/Home/VC/PaymentOrderVC.swift | 4 XQMuse/Assets.xcassets/Btns/btn_customer.imageset/btn_customer@2x.png | 0 XQMuse/Root/Home/CCell/Home_Style_4_Inner_CCell.swift | 2 XQMuse/Root/Home/View/CommentCommentHeaderView.swift | 4 XQMuse/Root/Me/VC/VIPCenterVC.xib | 14 XQMuse/Root/Home/VC/SearchContentVC.swift | 10 XQMuse/Root/TreeGroup/TCell/TreeTeskEnergyExchangeRecordTCell.swift | 6 XQMuse/Assets.xcassets/Icons/.DS_Store | 0 XQMuse/Root/Course/View/CourseDetialCustomerView.swift | 52 ++ XQMuse/Assets.xcassets/Icons/icon_local_1.imageset/icon_local_1@2x.png | 0 XQMuse/Root/Other/View/CountdownChooseListView.swift | 53 + XQMuse/Assets.xcassets/Btns/btn_pause.imageset/btn_pause@3x.png | 0 XQMuse/Root/TreeGroup/View/TreeTeskExchangeSuccessView.swift | 6 XQMuse/Root/Home/VC/PaymentOrderResultVC.swift | 10 XQMuse/Root/Home/View/PaymentOrderResultTopView.xib | 10 XQMuse/Root/Home/CCell/HomeRelaxBannerCCell.swift | 6 XQMuse/Root/Home/CCell/HomeRelaxBannerCCell.xib | 8 XQMuse/Root/TreeGroup/VC/TreeTeskEnergyExchangeVC.swift | 13 XQMuse/Assets.xcassets/Icons/mini_logo.imageset/mini_logo@3x.png | 0 XQMuse/Assets.xcassets/Btns/btn_play.imageset/Contents.json | 22 XQMuse/Root/Me/VC/BindAccountVC.xib | 3 XQMuse/Root/Course/TCell/CourseDetail_2_Inner_TCell.swift | 3 XQMuse/Root/PayMusicView/PayMusicVC.swift | 116 +++- /dev/null | 0 XQMuse/Root/Course/TCell/CourseDetail_3_TCell.swift | 9 XQMuse/Root/Course/VC/CourseVCOfficalCommentVC.swift | 20 XQMuse/Root/Me/VC/VIPCenterVC.swift | 23 XQMuse/Assets.xcassets/Icons/icon_vip.imageset/Contents.json | 4 XQMuse/Root/Other/View/CountdownChooseListView.xib | 39 + XQMuse/Root/Home/VC/HomeItemDetailVC.xib | 4 XQMuse/Assets.xcassets/Btns/.DS_Store | 0 XQMuse/Assets.xcassets/.DS_Store | 0 XQMuse/Assets.xcassets/Icons/icon_empty.imageset/icon_empty.png | 0 XQMuse/Root/Course/TCell/CourseDetail_1_TCell.swift | 4 XQMuse/Root/Other/View/ShareView.swift | 13 83 files changed, 1,211 insertions(+), 233 deletions(-) diff --git a/XQMuse.xcodeproj/project.pbxproj b/XQMuse.xcodeproj/project.pbxproj index 9a6a464..576d215 100644 --- a/XQMuse.xcodeproj/project.pbxproj +++ b/XQMuse.xcodeproj/project.pbxproj @@ -9,6 +9,10 @@ /* Begin PBXBuildFile section */ 1300BD3B2C6DFB1C000BCA5E /* VIPCenterVC.xib in Resources */ = {isa = PBXBuildFile; fileRef = 1300BD3A2C6DFB1C000BCA5E /* VIPCenterVC.xib */; }; 1300BD3C2C6DFB1C000BCA5E /* VIPCenterVC.swift in Sources */ = {isa = PBXBuildFile; fileRef = 1300BD392C6DFB1C000BCA5E /* VIPCenterVC.swift */; }; + 1302F9A22CDB19C90066AF22 /* CourseDetialOfflineVC.xib in Resources */ = {isa = PBXBuildFile; fileRef = 1302F9A12CDB19C90066AF22 /* CourseDetialOfflineVC.xib */; }; + 1302F9A32CDB19C90066AF22 /* CourseDetialOfflineVC.swift in Sources */ = {isa = PBXBuildFile; fileRef = 1302F9A02CDB19C90066AF22 /* CourseDetialOfflineVC.swift */; }; + 1302F9A52CDB46000066AF22 /* CourseDetialCustomerView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 1302F9A42CDB46000066AF22 /* CourseDetialCustomerView.swift */; }; + 1302F9A72CDB460B0066AF22 /* CourseDetialCustomerView.xib in Resources */ = {isa = PBXBuildFile; fileRef = 1302F9A62CDB460B0066AF22 /* CourseDetialCustomerView.xib */; }; 1304526A2CB4CA310049FB3A /* XQMuseStoreKit.storekit in Resources */ = {isa = PBXBuildFile; fileRef = 130452692CB4CA310049FB3A /* XQMuseStoreKit.storekit */; }; 1304526C2CB4CB210049FB3A /* StoreKitTestCertificate.cer in Resources */ = {isa = PBXBuildFile; fileRef = 1304526B2CB4CB210049FB3A /* StoreKitTestCertificate.cer */; }; 1304526F2CB4FF280049FB3A /* InPurchaseManager.swift in Sources */ = {isa = PBXBuildFile; fileRef = 1304526E2CB4FF280049FB3A /* InPurchaseManager.swift */; }; @@ -313,6 +317,10 @@ /* Begin PBXFileReference section */ 1300BD392C6DFB1C000BCA5E /* VIPCenterVC.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = VIPCenterVC.swift; sourceTree = "<group>"; }; 1300BD3A2C6DFB1C000BCA5E /* VIPCenterVC.xib */ = {isa = PBXFileReference; lastKnownFileType = file.xib; path = VIPCenterVC.xib; sourceTree = "<group>"; }; + 1302F9A02CDB19C90066AF22 /* CourseDetialOfflineVC.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CourseDetialOfflineVC.swift; sourceTree = "<group>"; }; + 1302F9A12CDB19C90066AF22 /* CourseDetialOfflineVC.xib */ = {isa = PBXFileReference; lastKnownFileType = file.xib; path = CourseDetialOfflineVC.xib; sourceTree = "<group>"; }; + 1302F9A42CDB46000066AF22 /* CourseDetialCustomerView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CourseDetialCustomerView.swift; sourceTree = "<group>"; }; + 1302F9A62CDB460B0066AF22 /* CourseDetialCustomerView.xib */ = {isa = PBXFileReference; lastKnownFileType = file.xib; path = CourseDetialCustomerView.xib; sourceTree = "<group>"; }; 130452692CB4CA310049FB3A /* XQMuseStoreKit.storekit */ = {isa = PBXFileReference; lastKnownFileType = text; path = XQMuseStoreKit.storekit; sourceTree = "<group>"; }; 1304526B2CB4CB210049FB3A /* StoreKitTestCertificate.cer */ = {isa = PBXFileReference; lastKnownFileType = file; path = StoreKitTestCertificate.cer; sourceTree = "<group>"; }; 1304526D2CB4D1190049FB3A /* XQMuse.entitlements */ = {isa = PBXFileReference; lastKnownFileType = text.plist.entitlements; path = XQMuse.entitlements; sourceTree = "<group>"; }; @@ -772,6 +780,8 @@ 13FB6D862C6EF9DE00A0685D /* CourseDetialVC.swift */, 130AA4A62C72F71700F20944 /* CourseDetialVideoVC.swift */, 130AA4A72C72F71700F20944 /* CourseDetialVideoVC.xib */, + 1302F9A02CDB19C90066AF22 /* CourseDetialOfflineVC.swift */, + 1302F9A12CDB19C90066AF22 /* CourseDetialOfflineVC.xib */, ); path = VC; sourceTree = "<group>"; @@ -1341,6 +1351,8 @@ 13FB6D8B2C6EFB5400A0685D /* CourseDetailHeaderView.xib */, 1333DC7B2C72E78F00D8ACAE /* CourseSendGiftView.swift */, 1333DC7D2C72E7A500D8ACAE /* CourseSendGiftView.xib */, + 1302F9A42CDB46000066AF22 /* CourseDetialCustomerView.swift */, + 1302F9A62CDB460B0066AF22 /* CourseDetialCustomerView.xib */, ); path = View; sourceTree = "<group>"; @@ -1453,6 +1465,8 @@ 130C07092C76D51900ADB098 /* SpendingDetailHeaderVC.xib in Resources */, 138995412C943AA700BC7F78 /* static-level-5.png in Resources */, 1327C6832C81D107005DA44B /* PlanGuide_3_VC.xib in Resources */, + 1302F9A22CDB19C90066AF22 /* CourseDetialOfflineVC.xib in Resources */, + 1302F9A72CDB460B0066AF22 /* CourseDetialCustomerView.xib in Resources */, 138FE0DF2C757B2A00A964E8 /* BindPhone_1_VC.xib in Resources */, 138995402C943AA700BC7F78 /* static-level-3.png in Resources */, 13FB6D842C6EEFE900A0685D /* MenuListTCell.xib in Resources */, @@ -1712,6 +1726,7 @@ 137ABE382C6B6641003A91C5 /* WebVC.swift in Sources */, 135C2A6C2C7F033300CC2A67 /* CLPlayerContentViewDelegate.swift in Sources */, 13985DB12C69B7B00046B6DC /* BaseVC.swift in Sources */, + 1302F9A32CDB19C90066AF22 /* CourseDetialOfflineVC.swift in Sources */, 13985DD52C69FC1F0046B6DC /* Home_Style_1_TCell.swift in Sources */, 132EB01C2C6B32B200990429 /* RegisterVC.swift in Sources */, 134803DC2C7707BA00F4FDDA /* ContactCustomerVC.swift in Sources */, @@ -1770,6 +1785,7 @@ 135D091C2C91674700658880 /* TreeTeskDetailListVC.swift in Sources */, 134803D32C76E29E00F4FDDA /* MyCommentListVC.swift in Sources */, 13DC34EE2C913E77007E1B61 /* TreeTeskFirstRuleView.swift in Sources */, + 1302F9A52CDB46000066AF22 /* CourseDetialCustomerView.swift in Sources */, 1377768D2C6AFD25004FF994 /* LoginVC.swift in Sources */, 13FB6D852C6EEFE900A0685D /* MenuListTCell.swift in Sources */, 134803D92C76ED6400F4FDDA /* WatchHistoryDetailVC.swift in Sources */, diff --git a/XQMuse/.DS_Store b/XQMuse/.DS_Store index f021544..94f690c 100644 --- a/XQMuse/.DS_Store +++ b/XQMuse/.DS_Store Binary files differ diff --git a/XQMuse/Assets.xcassets/.DS_Store b/XQMuse/Assets.xcassets/.DS_Store index 8c18d87..d2907be 100644 --- a/XQMuse/Assets.xcassets/.DS_Store +++ b/XQMuse/Assets.xcassets/.DS_Store Binary files differ diff --git a/XQMuse/Assets.xcassets/Btns/.DS_Store b/XQMuse/Assets.xcassets/Btns/.DS_Store new file mode 100644 index 0000000..12ef8b5 --- /dev/null +++ b/XQMuse/Assets.xcassets/Btns/.DS_Store Binary files differ diff --git a/XQMuse/Assets.xcassets/Btns/btn_customer.imageset/Contents.json b/XQMuse/Assets.xcassets/Btns/btn_customer.imageset/Contents.json new file mode 100644 index 0000000..fc287b8 --- /dev/null +++ b/XQMuse/Assets.xcassets/Btns/btn_customer.imageset/Contents.json @@ -0,0 +1,22 @@ +{ + "images" : [ + { + "idiom" : "universal", + "scale" : "1x" + }, + { + "filename" : "btn_customer@2x.png", + "idiom" : "universal", + "scale" : "2x" + }, + { + "filename" : "btn_customer@3x.png", + "idiom" : "universal", + "scale" : "3x" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/XQMuse/Assets.xcassets/Btns/btn_customer.imageset/btn_customer@2x.png b/XQMuse/Assets.xcassets/Btns/btn_customer.imageset/btn_customer@2x.png new file mode 100644 index 0000000..d9fa3b5 --- /dev/null +++ b/XQMuse/Assets.xcassets/Btns/btn_customer.imageset/btn_customer@2x.png Binary files differ diff --git a/XQMuse/Assets.xcassets/Btns/btn_customer.imageset/btn_customer@3x.png b/XQMuse/Assets.xcassets/Btns/btn_customer.imageset/btn_customer@3x.png new file mode 100644 index 0000000..7807681 --- /dev/null +++ b/XQMuse/Assets.xcassets/Btns/btn_customer.imageset/btn_customer@3x.png Binary files differ diff --git a/XQMuse/Assets.xcassets/Btns/btn_pause.imageset/Contents.json b/XQMuse/Assets.xcassets/Btns/btn_pause.imageset/Contents.json new file mode 100644 index 0000000..6df4ab8 --- /dev/null +++ b/XQMuse/Assets.xcassets/Btns/btn_pause.imageset/Contents.json @@ -0,0 +1,22 @@ +{ + "images" : [ + { + "idiom" : "universal", + "scale" : "1x" + }, + { + "filename" : "btn_pause@2x.png", + "idiom" : "universal", + "scale" : "2x" + }, + { + "filename" : "btn_pause@3x.png", + "idiom" : "universal", + "scale" : "3x" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/XQMuse/Assets.xcassets/Btns/btn_pause.imageset/btn_pause@2x.png b/XQMuse/Assets.xcassets/Btns/btn_pause.imageset/btn_pause@2x.png new file mode 100644 index 0000000..29d8101 --- /dev/null +++ b/XQMuse/Assets.xcassets/Btns/btn_pause.imageset/btn_pause@2x.png Binary files differ diff --git a/XQMuse/Assets.xcassets/Btns/btn_pause.imageset/btn_pause@3x.png b/XQMuse/Assets.xcassets/Btns/btn_pause.imageset/btn_pause@3x.png new file mode 100644 index 0000000..5968f48 --- /dev/null +++ b/XQMuse/Assets.xcassets/Btns/btn_pause.imageset/btn_pause@3x.png Binary files differ diff --git a/XQMuse/Assets.xcassets/Btns/btn_play.imageset/Contents.json b/XQMuse/Assets.xcassets/Btns/btn_play.imageset/Contents.json new file mode 100644 index 0000000..d04b5d1 --- /dev/null +++ b/XQMuse/Assets.xcassets/Btns/btn_play.imageset/Contents.json @@ -0,0 +1,22 @@ +{ + "images" : [ + { + "idiom" : "universal", + "scale" : "1x" + }, + { + "filename" : "btn_play@2x.png", + "idiom" : "universal", + "scale" : "2x" + }, + { + "filename" : "btn_play@3x.png", + "idiom" : "universal", + "scale" : "3x" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/XQMuse/Assets.xcassets/Btns/btn_play.imageset/btn_play@2x.png b/XQMuse/Assets.xcassets/Btns/btn_play.imageset/btn_play@2x.png new file mode 100644 index 0000000..f1c6c6a --- /dev/null +++ b/XQMuse/Assets.xcassets/Btns/btn_play.imageset/btn_play@2x.png Binary files differ diff --git a/XQMuse/Assets.xcassets/Btns/btn_play.imageset/btn_play@3x.png b/XQMuse/Assets.xcassets/Btns/btn_play.imageset/btn_play@3x.png new file mode 100644 index 0000000..e340688 --- /dev/null +++ b/XQMuse/Assets.xcassets/Btns/btn_play.imageset/btn_play@3x.png Binary files differ diff --git a/XQMuse/Assets.xcassets/Icons/.DS_Store b/XQMuse/Assets.xcassets/Icons/.DS_Store index e2d3f79..94be443 100644 --- a/XQMuse/Assets.xcassets/Icons/.DS_Store +++ b/XQMuse/Assets.xcassets/Icons/.DS_Store Binary files differ diff --git a/XQMuse/Assets.xcassets/Icons/icon_empty.imageset/Contents.json b/XQMuse/Assets.xcassets/Icons/icon_empty.imageset/Contents.json new file mode 100644 index 0000000..c5fe248 --- /dev/null +++ b/XQMuse/Assets.xcassets/Icons/icon_empty.imageset/Contents.json @@ -0,0 +1,21 @@ +{ + "images" : [ + { + "idiom" : "universal", + "scale" : "1x" + }, + { + "filename" : "icon_empty.png", + "idiom" : "universal", + "scale" : "2x" + }, + { + "idiom" : "universal", + "scale" : "3x" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/XQMuse/Assets.xcassets/Icons/icon_empty.imageset/icon_empty.png b/XQMuse/Assets.xcassets/Icons/icon_empty.imageset/icon_empty.png new file mode 100644 index 0000000..e773985 --- /dev/null +++ b/XQMuse/Assets.xcassets/Icons/icon_empty.imageset/icon_empty.png Binary files differ diff --git a/XQMuse/Assets.xcassets/Icons/icon_local_1.imageset/Contents.json b/XQMuse/Assets.xcassets/Icons/icon_local_1.imageset/Contents.json new file mode 100644 index 0000000..d9d3da3 --- /dev/null +++ b/XQMuse/Assets.xcassets/Icons/icon_local_1.imageset/Contents.json @@ -0,0 +1,22 @@ +{ + "images" : [ + { + "idiom" : "universal", + "scale" : "1x" + }, + { + "filename" : "icon_local_1@2x.png", + "idiom" : "universal", + "scale" : "2x" + }, + { + "filename" : "icon_local_1@3x.png", + "idiom" : "universal", + "scale" : "3x" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/XQMuse/Assets.xcassets/Icons/icon_local_1.imageset/icon_local_1@2x.png b/XQMuse/Assets.xcassets/Icons/icon_local_1.imageset/icon_local_1@2x.png new file mode 100644 index 0000000..b307573 --- /dev/null +++ b/XQMuse/Assets.xcassets/Icons/icon_local_1.imageset/icon_local_1@2x.png Binary files differ diff --git a/XQMuse/Assets.xcassets/Icons/icon_local_1.imageset/icon_local_1@3x.png b/XQMuse/Assets.xcassets/Icons/icon_local_1.imageset/icon_local_1@3x.png new file mode 100644 index 0000000..becb7a2 --- /dev/null +++ b/XQMuse/Assets.xcassets/Icons/icon_local_1.imageset/icon_local_1@3x.png Binary files differ diff --git a/XQMuse/Assets.xcassets/Icons/icon_vip.imageset/Contents.json b/XQMuse/Assets.xcassets/Icons/icon_vip.imageset/Contents.json index 34d77b3..9aa71f9 100644 --- a/XQMuse/Assets.xcassets/Icons/icon_vip.imageset/Contents.json +++ b/XQMuse/Assets.xcassets/Icons/icon_vip.imageset/Contents.json @@ -5,12 +5,12 @@ "scale" : "1x" }, { - "filename" : "icon_vip@2x.png", + "filename" : "组 5@2x.png", "idiom" : "universal", "scale" : "2x" }, { - "filename" : "icon_vip@3x.png", + "filename" : "组 5@3x.png", "idiom" : "universal", "scale" : "3x" } diff --git a/XQMuse/Assets.xcassets/Icons/icon_vip.imageset/icon_vip@2x.png b/XQMuse/Assets.xcassets/Icons/icon_vip.imageset/icon_vip@2x.png deleted file mode 100644 index 1a7a4d3..0000000 --- a/XQMuse/Assets.xcassets/Icons/icon_vip.imageset/icon_vip@2x.png +++ /dev/null Binary files differ diff --git a/XQMuse/Assets.xcassets/Icons/icon_vip.imageset/icon_vip@3x.png b/XQMuse/Assets.xcassets/Icons/icon_vip.imageset/icon_vip@3x.png deleted file mode 100644 index 32075c8..0000000 --- a/XQMuse/Assets.xcassets/Icons/icon_vip.imageset/icon_vip@3x.png +++ /dev/null Binary files differ diff --git "a/XQMuse/Assets.xcassets/Icons/icon_vip.imageset/\347\273\204 5@2x.png" "b/XQMuse/Assets.xcassets/Icons/icon_vip.imageset/\347\273\204 5@2x.png" new file mode 100644 index 0000000..d426b21 --- /dev/null +++ "b/XQMuse/Assets.xcassets/Icons/icon_vip.imageset/\347\273\204 5@2x.png" Binary files differ diff --git "a/XQMuse/Assets.xcassets/Icons/icon_vip.imageset/\347\273\204 5@3x.png" "b/XQMuse/Assets.xcassets/Icons/icon_vip.imageset/\347\273\204 5@3x.png" new file mode 100644 index 0000000..4d2cef5 --- /dev/null +++ "b/XQMuse/Assets.xcassets/Icons/icon_vip.imageset/\347\273\204 5@3x.png" Binary files differ diff --git a/XQMuse/Assets.xcassets/Icons/mini_logo.imageset/Contents.json b/XQMuse/Assets.xcassets/Icons/mini_logo.imageset/Contents.json new file mode 100644 index 0000000..ef52599 --- /dev/null +++ b/XQMuse/Assets.xcassets/Icons/mini_logo.imageset/Contents.json @@ -0,0 +1,22 @@ +{ + "images" : [ + { + "idiom" : "universal", + "scale" : "1x" + }, + { + "filename" : "mini_logo@2x.png", + "idiom" : "universal", + "scale" : "2x" + }, + { + "filename" : "mini_logo@3x.png", + "idiom" : "universal", + "scale" : "3x" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/XQMuse/Assets.xcassets/Icons/mini_logo.imageset/mini_logo@2x.png b/XQMuse/Assets.xcassets/Icons/mini_logo.imageset/mini_logo@2x.png new file mode 100644 index 0000000..ddb46a8 --- /dev/null +++ b/XQMuse/Assets.xcassets/Icons/mini_logo.imageset/mini_logo@2x.png Binary files differ diff --git a/XQMuse/Assets.xcassets/Icons/mini_logo.imageset/mini_logo@3x.png b/XQMuse/Assets.xcassets/Icons/mini_logo.imageset/mini_logo@3x.png new file mode 100644 index 0000000..6ce91c9 --- /dev/null +++ b/XQMuse/Assets.xcassets/Icons/mini_logo.imageset/mini_logo@3x.png Binary files differ diff --git a/XQMuse/Base/BaseNav.swift b/XQMuse/Base/BaseNav.swift index 3c8a0b6..6a97b3c 100644 --- a/XQMuse/Base/BaseNav.swift +++ b/XQMuse/Base/BaseNav.swift @@ -12,7 +12,7 @@ /// 需要透明Nav的VC private var lucencyVCs = [LoginVC.self] - private var whiteStyleVCs = [HomeItemDetailVC.self,CourseDetialVC.self,CourseDetialVideoVC.self,PavilionDetailVC.self] + private var whiteStyleVCs = [HomeItemDetailVC.self,CourseDetialVC.self,CourseDetialOfflineVC.self,CourseDetialVideoVC.self,PavilionDetailVC.self] open override func viewDidLoad() { super.viewDidLoad() diff --git a/XQMuse/Base/BaseTabBarVC.swift b/XQMuse/Base/BaseTabBarVC.swift index 520b9af..bce67cc 100644 --- a/XQMuse/Base/BaseTabBarVC.swift +++ b/XQMuse/Base/BaseTabBarVC.swift @@ -32,7 +32,6 @@ viewControllers = [home_nav,course_nav,tree_nav,pavilion_nav,me_nav] setValue(customBar, forKey: "tabBar") - customBar.unselectedItemTintColor = UIColor(hexStr: "#4E4E4E") if #available(iOS 15.0, *) { let bar = UITabBarAppearance() diff --git a/XQMuse/Root/Course/TCell/CourseDetail_1_TCell.swift b/XQMuse/Root/Course/TCell/CourseDetail_1_TCell.swift index af7b5e0..7a29358 100644 --- a/XQMuse/Root/Course/TCell/CourseDetail_1_TCell.swift +++ b/XQMuse/Root/Course/TCell/CourseDetail_1_TCell.swift @@ -14,8 +14,7 @@ @IBOutlet weak var label_title: UILabel! @IBOutlet weak var webView: WKWebView! @IBOutlet weak var cons_webHei: NSLayoutConstraint! - - private var disposeBag = DisposeBag() + override func awakeFromNib() { super.awakeFromNib() @@ -25,7 +24,6 @@ webView.scrollView.isScrollEnabled = false webView.scrollView.backgroundColor = .clear webView.isOpaque = false - } diff --git a/XQMuse/Root/Course/TCell/CourseDetail_1_TCell.xib b/XQMuse/Root/Course/TCell/CourseDetail_1_TCell.xib index be16fa8..6a044bb 100644 --- a/XQMuse/Root/Course/TCell/CourseDetail_1_TCell.xib +++ b/XQMuse/Root/Course/TCell/CourseDetail_1_TCell.xib @@ -1,23 +1,23 @@ <?xml version="1.0" encoding="UTF-8"?> -<document type="com.apple.InterfaceBuilder3.CocoaTouch.XIB" version="3.0" toolsVersion="32700.99.1234" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" useSafeAreas="YES" colorMatched="YES"> +<document type="com.apple.InterfaceBuilder3.CocoaTouch.XIB" version="3.0" toolsVersion="23094" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" useSafeAreas="YES" colorMatched="YES"> <device id="retina6_12" orientation="portrait" appearance="light"/> <dependencies> <deployment identifier="iOS"/> - <plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="22685"/> + <plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="23084"/> <capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/> </dependencies> <objects> <placeholder placeholderIdentifier="IBFilesOwner" id="-1" userLabel="File's Owner"/> <placeholder placeholderIdentifier="IBFirstResponder" id="-2" customClass="UIResponder"/> - <tableViewCell contentMode="scaleToFill" selectionStyle="default" indentationWidth="10" reuseIdentifier="_CourseDetail_1_TCell" rowHeight="183" id="KGk-i7-Jjw" customClass="CourseDetail_1_TCell" customModule="XQMuse" customModuleProvider="target"> - <rect key="frame" x="0.0" y="0.0" width="501" height="183"/> + <tableViewCell contentMode="scaleToFill" selectionStyle="default" indentationWidth="10" reuseIdentifier="_CourseDetail_1_TCell" rowHeight="325" id="KGk-i7-Jjw" customClass="CourseDetail_1_TCell" customModule="XQMuse" customModuleProvider="target"> + <rect key="frame" x="0.0" y="0.0" width="501" height="325"/> <autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/> - <tableViewCellContentView key="contentView" opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center" ambiguous="YES" tableViewCell="KGk-i7-Jjw" id="H2p-sc-9uM"> - <rect key="frame" x="0.0" y="0.0" width="501" height="183"/> + <tableViewCellContentView key="contentView" opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center" tableViewCell="KGk-i7-Jjw" id="H2p-sc-9uM"> + <rect key="frame" x="0.0" y="0.0" width="501" height="325"/> <autoresizingMask key="autoresizingMask"/> <subviews> <label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="课程介绍" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="Lg9-70-w3n"> - <rect key="frame" x="21.666666666666668" y="35" width="61.333333333333329" height="20"/> + <rect key="frame" x="21.666666666666668" y="5" width="59.666666666666657" height="20"/> <constraints> <constraint firstAttribute="height" constant="20" id="8dQ-Gi-hJh"/> </constraints> @@ -26,9 +26,9 @@ <nil key="highlightedColor"/> </label> <wkWebView contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="WYV-JQ-E3S"> - <rect key="frame" x="0.0" y="74.666666666666671" width="501" height="100.00000000000001"/> + <rect key="frame" x="0.0" y="44.666666666666657" width="501" height="280.33333333333337"/> <constraints> - <constraint firstAttribute="height" constant="100" id="hfa-qQ-TpS"/> + <constraint firstAttribute="height" relation="greaterThanOrEqual" constant="100" id="hfa-qQ-TpS"/> </constraints> <wkWebViewConfiguration key="configuration"> <audiovisualMediaTypes key="mediaTypesRequiringUserActionForPlayback" none="YES"/> @@ -37,7 +37,7 @@ </wkWebView> </subviews> <constraints> - <constraint firstItem="Lg9-70-w3n" firstAttribute="top" secondItem="H2p-sc-9uM" secondAttribute="top" constant="35" id="4D5-on-wj2"/> + <constraint firstItem="Lg9-70-w3n" firstAttribute="top" secondItem="H2p-sc-9uM" secondAttribute="top" constant="5" id="4D5-on-wj2"/> <constraint firstItem="WYV-JQ-E3S" firstAttribute="top" secondItem="Lg9-70-w3n" secondAttribute="bottom" constant="19.5" id="Ar0-7c-kQM"/> <constraint firstAttribute="trailing" secondItem="WYV-JQ-E3S" secondAttribute="trailing" id="BSc-yJ-F5G"/> <constraint firstItem="WYV-JQ-E3S" firstAttribute="leading" secondItem="H2p-sc-9uM" secondAttribute="leading" id="Mbt-TS-KCB"/> @@ -50,7 +50,7 @@ <outlet property="label_title" destination="Lg9-70-w3n" id="NPf-Sa-PgL"/> <outlet property="webView" destination="WYV-JQ-E3S" id="wJi-nk-vgm"/> </connections> - <point key="canvasLocation" x="200.76335877862596" y="68.661971830985919"/> + <point key="canvasLocation" x="200.76335877862596" y="118.66197183098592"/> </tableViewCell> </objects> </document> diff --git a/XQMuse/Root/Course/TCell/CourseDetail_2_Inner_TCell.swift b/XQMuse/Root/Course/TCell/CourseDetail_2_Inner_TCell.swift index cf16393..49103e3 100644 --- a/XQMuse/Root/Course/TCell/CourseDetail_2_Inner_TCell.swift +++ b/XQMuse/Root/Course/TCell/CourseDetail_2_Inner_TCell.swift @@ -23,9 +23,10 @@ } func setModel(_ item:CourseItemModel,index:IndexPath){ + let tuple = Date.jq_formateToTime_tuple(item.duration) label_index.text = "\(index.row + 1)" label_title.text = item.chapterTitle - label_time.text = Date.jq_formateToTime(item.duration) + label_time.text = String(format: "%02ld:%02ld", tuple.hour * 60 + tuple.minute,tuple.second) label_people.text = "\(item.realLearnedNum + item.virtualLearnedNum)" } diff --git a/XQMuse/Root/Course/TCell/CourseDetail_2_TCell.xib b/XQMuse/Root/Course/TCell/CourseDetail_2_TCell.xib index 944af2c..df31e17 100644 --- a/XQMuse/Root/Course/TCell/CourseDetail_2_TCell.xib +++ b/XQMuse/Root/Course/TCell/CourseDetail_2_TCell.xib @@ -1,9 +1,9 @@ <?xml version="1.0" encoding="UTF-8"?> -<document type="com.apple.InterfaceBuilder3.CocoaTouch.XIB" version="3.0" toolsVersion="32700.99.1234" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" useSafeAreas="YES" colorMatched="YES"> +<document type="com.apple.InterfaceBuilder3.CocoaTouch.XIB" version="3.0" toolsVersion="23094" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" useSafeAreas="YES" colorMatched="YES"> <device id="retina6_12" orientation="portrait" appearance="light"/> <dependencies> <deployment identifier="iOS"/> - <plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="22685"/> + <plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="23084"/> <capability name="System colors in document resources" minToolsVersion="11.0"/> <capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/> </dependencies> @@ -18,7 +18,10 @@ <autoresizingMask key="autoresizingMask"/> <subviews> <label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="课程目录" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="EsS-2x-ooJ"> - <rect key="frame" x="21.666666666666668" y="35" width="61.333333333333329" height="114"/> + <rect key="frame" x="21.666666666666668" y="25" width="59.666666666666657" height="124"/> + <constraints> + <constraint firstAttribute="height" constant="20" id="jlv-rk-giE"/> + </constraints> <fontDescription key="fontDescription" type="boldSystem" pointSize="15"/> <color key="textColor" red="0.15686274510000001" green="0.15686274510000001" blue="0.15686274510000001" alpha="1" colorSpace="custom" customColorSpace="sRGB"/> <nil key="highlightedColor"/> @@ -32,7 +35,7 @@ </tableView> </subviews> <constraints> - <constraint firstItem="EsS-2x-ooJ" firstAttribute="top" secondItem="H2p-sc-9uM" secondAttribute="top" constant="35" id="Hlp-1k-lzl"/> + <constraint firstItem="EsS-2x-ooJ" firstAttribute="top" secondItem="H2p-sc-9uM" secondAttribute="top" constant="25" id="Hlp-1k-lzl"/> <constraint firstItem="EsS-2x-ooJ" firstAttribute="leading" secondItem="H2p-sc-9uM" secondAttribute="leading" constant="21.5" id="jO0-ZH-hJ9"/> <constraint firstItem="Rxb-3O-BKc" firstAttribute="top" secondItem="EsS-2x-ooJ" secondAttribute="bottom" constant="30" id="jV2-gZ-CKK"/> <constraint firstAttribute="bottom" secondItem="Rxb-3O-BKc" secondAttribute="bottom" id="mI0-cL-zMy"/> diff --git a/XQMuse/Root/Course/TCell/CourseDetail_3_TCell.swift b/XQMuse/Root/Course/TCell/CourseDetail_3_TCell.swift index cfcf5a8..bb43d94 100644 --- a/XQMuse/Root/Course/TCell/CourseDetail_3_TCell.swift +++ b/XQMuse/Root/Course/TCell/CourseDetail_3_TCell.swift @@ -50,8 +50,13 @@ func collectionView(_ collectionView: UICollectionView, didSelectItemAt indexPath: IndexPath) { let model = items[indexPath.row] - let vc = CourseDetialVC(courseId: model.id) - JQ_currentViewController().jq_push(vc: vc) + if model.courseType == .online{ + let vc = CourseDetialVC(courseId: model.id) + JQ_currentViewController().jq_push(vc: vc) + }else{ + let vc = CourseDetialOfflineVC(courseId: model.id) + JQ_currentViewController().jq_push(vc: vc) + } } } diff --git a/XQMuse/Root/Course/VC/CourseDetialOfflineVC.swift b/XQMuse/Root/Course/VC/CourseDetialOfflineVC.swift new file mode 100644 index 0000000..d569c77 --- /dev/null +++ b/XQMuse/Root/Course/VC/CourseDetialOfflineVC.swift @@ -0,0 +1,196 @@ +// +// CourseDetialOfflineVC.swift +// XQMuse +// +// Created by 无故事王国 on 2024/11/6. +// + +import UIKit +import WebKit +import JQTools + +class CourseDetialOfflineVC: BaseVC { + @IBOutlet weak var scrollView: UIScrollView! + @IBOutlet weak var img_cover: UIImageView! + @IBOutlet weak var view_video: UIView! + @IBOutlet weak var label_title: UILabel! + @IBOutlet weak var label_tutor: UILabel! + @IBOutlet weak var label_address: UILabel! + @IBOutlet weak var webView: WKWebView! + @IBOutlet weak var cons_webHei: NSLayoutConstraint! + @IBOutlet weak var img_cusomter: UIImageView! + @IBOutlet weak var view_customer: UIView! + + private var videoView:VideoView? + private var barStyle:UIStatusBarStyle = .lightContent + private var courseId:Int! + private var courseDetailModel:CourseModel? + private var collect_bitem:UIBarButtonItem! + private var share_bitem:UIBarButtonItem! + private var section0Height:Double = 0 + + init(courseId:Int) { + super.init(nibName: nil, bundle: nil) + self.courseId = courseId + } + + required init?(coder: NSCoder) { + fatalError("init(coder:) has not been implemented") + } + + override func viewWillAppear(_ animated: Bool) { + super.viewWillAppear(animated) + (navigationItem.leftBarButtonItem?.customView as? UIButton)?.setImage(UIImage(named: "btn_back")?.withTintColor(.white), for: .normal) + navigationController?.navigationBar.scrollEdgeAppearance?.backgroundColor = .clear + navigationController?.navigationBar.standardAppearance.backgroundColor = .clear + } + + override func viewDidLoad() { + super.viewDidLoad() + title = "课程详情" + + getData() + } + + override func setUI() { + scrollView.delegate = self + collect_bitem = UIBarButtonItem(image: UIImage(named: "btn_collect"), style: .plain, target: self, action: #selector(collectionAction)) + collect_bitem.tintColor = .white + share_bitem = UIBarButtonItem(image: UIImage(named: "btn_share"), style: .plain, target: self, action: #selector(shareAction)) + share_bitem.tintColor = .white + share_bitem.imageInsets = UIEdgeInsets(top: 0, left: 0, bottom: 0, right: 15) + navigationItem.rightBarButtonItems = [share_bitem,collect_bitem] + + webView.scrollView.isScrollEnabled = false + webView.scrollView.backgroundColor = .clear + webView.isOpaque = false + view_customer.jq_cornerRadius = 10 + scrollView.contentInsetAdjustmentBehavior = .never + + let customerBtn = UIButton(type: .custom) + customerBtn.setImage(UIImage(named: "btn_customer"), for: .normal) + customerBtn.addTarget(self, action: #selector(showCustomerAction), for: .touchUpInside) + view.addSubview(customerBtn) + customerBtn.snp.makeConstraints { make in + make.right.equalToSuperview() + make.centerY.equalToSuperview() + } + } + + override func setRx() { + 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?.cons_webHei.constant = height + } + } + }).disposed(by: disposeBag) + } + + private func getData(){ + Services.getCourseDetail(courseId: courseId).subscribe(onNext: {[weak self] data in + guard let weakSelf = self else { return } + if let m = data.data{ + weakSelf.courseDetailModel = m + weakSelf.collect_bitem.image = m.isCollect == .yes ? UIImage(named: "btn_collect_1_s"):UIImage(named: "btn_collect") + weakSelf.collect_bitem.tintColor = m.isCollect == .yes ? UIColor(hexString: "#fe5b60"):.white + + weakSelf.label_title.text = m.courseTitle + weakSelf.label_tutor.text = "导师 " + m.tutor + weakSelf.label_address.text = m.address + m.addressDetail + weakSelf.img_cover.sd_setImage(with: URL(string: m.coverUrl)) + weakSelf.webView.loadHTMLString(m.briefIntroduction.jq_wrapHtml(edge: UIEdgeInsets(top: 0, left: 5, bottom: 0, right: 5)), baseURL: nil) + + weakSelf.img_cusomter.sd_setImage(with: URL(string: m.wxQrCode)) + + if m.detailUrl.jq_isVideo{ + weakSelf.videoView = VideoView(url: m.detailUrl.jq_urlEncoded(),autoPlay: false, placeHoderImageUrl: m.coverUrl.jq_urlEncoded(), delegate: self!) +// weakSelf.videoView!.player.play() + weakSelf.view_video.addSubview(weakSelf.videoView!) + weakSelf.videoView!.snp.makeConstraints { make in + make.edges.equalToSuperview() + } + } + } + }).disposed(by: disposeBag) + } + + @objc func showCustomerAction(){ + if let image = img_cusomter.image{ + CourseDetialCustomerView.show(customerImage: image) + } + } + + + @objc func collectionAction(){ + Services.clouseFavorite(id: courseId).subscribe(onNext: {[weak self]data in + self?.courseDetailModel?.isCollect.troggle() + if self?.courseDetailModel?.isCollect == .yes{ + alertSuccess(msg: "收藏成功") + self?.collect_bitem.image = UIImage(named: "btn_collect_1_s") + self?.collect_bitem.tintColor = UIColor(hexString: "fe5b60") + }else{ + alertSuccess(msg: "已取消收藏") + self?.collect_bitem.image = UIImage(named: "btn_collect") + self?.collect_bitem.tintColor = .white + } + }).disposed(by: disposeBag) + } + + @objc func shareAction(){ + guard let m = courseDetailModel else{return} + + let path = courseDetailModel!.courseType == .offline ? "/courseDetail/offLine":"/courseDetail/onLine" + let string = String(format: "%@%@?courseId=%ld", ShareUrl,path,m.id) + ShareView.show(URL(string: string)!,title: m.courseTitle,desc: m.description) + } + + override var preferredStatusBarStyle: UIStatusBarStyle{ + return barStyle + } +} + +extension CourseDetialOfflineVC:UIScrollViewDelegate{ + + func scrollViewDidScroll(_ scrollView: UIScrollView) { + + let v = min(scrollView.contentOffset.y / JQ_NavBarHeight, 1) + navigationController?.navigationBar.standardAppearance.backgroundColor = .white.withAlphaComponent(v) + + if v > 0{ + (navigationItem.leftBarButtonItem?.customView as? UIButton)?.setImage(UIImage(named: "btn_back")?.withTintColor(.black.withAlphaComponent(v)), for: .normal) + + (navigationItem.rightBarButtonItem?.customView as? UIButton)?.setImage(UIImage(named: "btn_back")?.withTintColor(.black.withAlphaComponent(v)), for: .normal) + collect_bitem.tintColor = .black + share_bitem.tintColor = .black + + self.navigationController?.navigationBar.titleTextAttributes = [.foregroundColor:Def_NavFontColor.withAlphaComponent(v),.font:Def_NavFont] + barStyle = .darkContent + + }else{ + collect_bitem.tintColor = self.courseDetailModel?.isCollect == .yes ? UIColor(hexString: "#fe5b60"):.white + share_bitem.tintColor = .white + + (navigationItem.leftBarButtonItem?.customView as? UIButton)?.setImage(UIImage(named: "btn_back")?.withTintColor(.white), for: .normal) + self.navigationController?.navigationBar.titleTextAttributes = [.foregroundColor:UIColor.white,.font:Def_NavFont] + } + + if v == 1{ + barStyle = .darkContent + setNeedsStatusBarAppearanceUpdate() + }else{ + barStyle = .lightContent + setNeedsStatusBarAppearanceUpdate() + } + } +} + +extension CourseDetialOfflineVC:CLPlayerDelegate{ + +} diff --git a/XQMuse/Root/Course/VC/CourseDetialOfflineVC.xib b/XQMuse/Root/Course/VC/CourseDetialOfflineVC.xib new file mode 100644 index 0000000..3c3144b --- /dev/null +++ b/XQMuse/Root/Course/VC/CourseDetialOfflineVC.xib @@ -0,0 +1,202 @@ +<?xml version="1.0" encoding="UTF-8"?> +<document type="com.apple.InterfaceBuilder3.CocoaTouch.XIB" version="3.0" toolsVersion="23094" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" useSafeAreas="YES" colorMatched="YES"> + <device id="retina6_12" orientation="portrait" appearance="light"/> + <dependencies> + <deployment identifier="iOS"/> + <plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="23084"/> + <capability name="System colors in document resources" minToolsVersion="11.0"/> + <capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/> + </dependencies> + <objects> + <placeholder placeholderIdentifier="IBFilesOwner" id="-1" userLabel="File's Owner" customClass="CourseDetialOfflineVC" customModule="XQMuse" customModuleProvider="target"> + <connections> + <outlet property="cons_webHei" destination="daa-AS-pyV" id="CO6-bA-ZYo"/> + <outlet property="img_cover" destination="UEf-YH-aLK" id="Rs1-0g-vML"/> + <outlet property="img_cusomter" destination="zlO-OX-u5S" id="7Ui-X5-Hz8"/> + <outlet property="label_address" destination="C98-ml-jRI" id="4rj-KK-xfC"/> + <outlet property="label_title" destination="QJB-dH-vTR" id="wSy-Rp-wMW"/> + <outlet property="label_tutor" destination="Rfd-fp-6pw" id="DuZ-vX-lcI"/> + <outlet property="scrollView" destination="4KE-wb-44W" id="H7r-e1-ifF"/> + <outlet property="view" destination="i5M-Pr-FkT" id="sfx-zR-JGt"/> + <outlet property="view_customer" destination="i03-rW-DQq" id="YZZ-n9-ewh"/> + <outlet property="view_video" destination="hDw-D7-a6I" id="9hf-mx-O4w"/> + <outlet property="webView" destination="UmN-R4-VrQ" id="AYI-9T-gMS"/> + </connections> + </placeholder> + <placeholder placeholderIdentifier="IBFirstResponder" id="-2" customClass="UIResponder"/> + <view clearsContextBeforeDrawing="NO" contentMode="scaleToFill" id="i5M-Pr-FkT"> + <rect key="frame" x="0.0" y="0.0" width="393" height="852"/> + <autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/> + <subviews> + <scrollView clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="4KE-wb-44W"> + <rect key="frame" x="0.0" y="0.0" width="393" height="852"/> + <subviews> + <view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="lz1-9S-TY8"> + <rect key="frame" x="0.0" y="0.0" width="393" height="805"/> + <subviews> + <view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="hDw-D7-a6I"> + <rect key="frame" x="0.0" y="0.0" width="393" height="314.33333333333331"/> + <subviews> + <imageView clipsSubviews="YES" userInteractionEnabled="NO" contentMode="scaleAspectFill" horizontalHuggingPriority="251" verticalHuggingPriority="251" translatesAutoresizingMaskIntoConstraints="NO" id="UEf-YH-aLK"> + <rect key="frame" x="0.0" y="0.0" width="393" height="314.33333333333331"/> + </imageView> + </subviews> + <color key="backgroundColor" systemColor="systemBackgroundColor"/> + <constraints> + <constraint firstItem="UEf-YH-aLK" firstAttribute="leading" secondItem="hDw-D7-a6I" secondAttribute="leading" id="3Zx-Uu-0ja"/> + <constraint firstAttribute="trailing" secondItem="UEf-YH-aLK" secondAttribute="trailing" id="69R-e0-330"/> + <constraint firstAttribute="bottom" secondItem="UEf-YH-aLK" secondAttribute="bottom" id="GaK-gZ-9ly"/> + <constraint firstItem="UEf-YH-aLK" firstAttribute="top" secondItem="hDw-D7-a6I" secondAttribute="top" id="Hpq-h5-YmU"/> + <constraint firstAttribute="width" secondItem="hDw-D7-a6I" secondAttribute="height" multiplier="1:0.8" id="NJP-Xx-lgz"/> + </constraints> + </view> + <view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="itL-Yu-biN"> + <rect key="frame" x="0.0" y="314.33333333333331" width="393" height="99.666666666666686"/> + <subviews> + <label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="1000" verticalHuggingPriority="251" text="导师 --" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="Rfd-fp-6pw"> + <rect key="frame" x="334" y="26.999999999999996" width="38.666666666666686" height="14.333333333333332"/> + <fontDescription key="fontDescription" type="system" weight="medium" pointSize="12"/> + <color key="textColor" red="0.27058823529411763" green="0.27058823529411763" blue="0.27058823529411763" alpha="1" colorSpace="custom" customColorSpace="sRGB"/> + <nil key="highlightedColor"/> + </label> + <label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Label" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="QJB-dH-vTR"> + <rect key="frame" x="20.666666666666657" y="25" width="303.33333333333337" height="23"/> + <fontDescription key="fontDescription" type="boldSystem" pointSize="19"/> + <nil key="textColor"/> + <nil key="highlightedColor"/> + </label> + <imageView clipsSubviews="YES" userInteractionEnabled="NO" contentMode="scaleAspectFit" horizontalHuggingPriority="251" verticalHuggingPriority="251" image="icon_local_1" translatesAutoresizingMaskIntoConstraints="NO" id="hGs-kS-EWt"> + <rect key="frame" x="20.666666666666668" y="69" width="9.6666666666666679" height="12"/> + <constraints> + <constraint firstAttribute="height" constant="12" id="aKR-KK-x9Z"/> + <constraint firstAttribute="width" constant="9.6699999999999999" id="mVa-VF-gle"/> + </constraints> + </imageView> + <label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="--" textAlignment="natural" lineBreakMode="tailTruncation" numberOfLines="2" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="C98-ml-jRI"> + <rect key="frame" x="36.333333333333343" y="69" width="350.66666666666663" height="12"/> + <fontDescription key="fontDescription" type="system" weight="medium" pointSize="10"/> + <color key="textColor" red="0.80392156862745101" green="0.80392156862745101" blue="0.80392156862745101" alpha="1" colorSpace="custom" customColorSpace="sRGB"/> + <nil key="highlightedColor"/> + </label> + </subviews> + <color key="backgroundColor" systemColor="systemBackgroundColor"/> + <constraints> + <constraint firstItem="hGs-kS-EWt" firstAttribute="top" secondItem="QJB-dH-vTR" secondAttribute="bottom" constant="21" id="1te-rE-wb5"/> + <constraint firstAttribute="trailing" secondItem="C98-ml-jRI" secondAttribute="trailing" constant="6" id="4Hx-aZ-Nva"/> + <constraint firstItem="hGs-kS-EWt" firstAttribute="leading" secondItem="QJB-dH-vTR" secondAttribute="leading" id="6Db-id-Dyt"/> + <constraint firstItem="Rfd-fp-6pw" firstAttribute="top" secondItem="itL-Yu-biN" secondAttribute="top" constant="27" id="8IL-fr-X8t"/> + <constraint firstAttribute="height" constant="99.5" id="CJ9-R7-jch"/> + <constraint firstItem="C98-ml-jRI" firstAttribute="leading" secondItem="hGs-kS-EWt" secondAttribute="trailing" constant="6" id="JO5-t8-awj"/> + <constraint firstItem="C98-ml-jRI" firstAttribute="centerY" secondItem="hGs-kS-EWt" secondAttribute="centerY" id="KEh-Pn-Qbh"/> + <constraint firstItem="QJB-dH-vTR" firstAttribute="leading" secondItem="itL-Yu-biN" secondAttribute="leading" constant="20.5" id="Nbs-UY-vlZ"/> + <constraint firstItem="QJB-dH-vTR" firstAttribute="top" secondItem="itL-Yu-biN" secondAttribute="top" constant="25" id="ZtU-Nw-puN"/> + <constraint firstAttribute="trailing" secondItem="Rfd-fp-6pw" secondAttribute="trailing" constant="20.5" id="me8-5a-oym"/> + <constraint firstItem="Rfd-fp-6pw" firstAttribute="leading" secondItem="QJB-dH-vTR" secondAttribute="trailing" constant="10" id="t31-5e-UUE"/> + </constraints> + </view> + <view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="SHG-A0-P8Y"> + <rect key="frame" x="0.0" y="414" width="393" height="391"/> + <subviews> + <label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="简介" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="7hg-kN-gqy"> + <rect key="frame" x="22" y="39" width="30" height="18"/> + <constraints> + <constraint firstAttribute="height" constant="18" id="wWl-0I-sFw"/> + </constraints> + <fontDescription key="fontDescription" type="system" weight="medium" pointSize="15"/> + <nil key="textColor"/> + <nil key="highlightedColor"/> + </label> + <wkWebView contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="UmN-R4-VrQ"> + <rect key="frame" x="10" y="76.333333333333314" width="373" height="100"/> + <constraints> + <constraint firstAttribute="height" constant="100" id="daa-AS-pyV"/> + </constraints> + <wkWebViewConfiguration key="configuration"> + <audiovisualMediaTypes key="mediaTypesRequiringUserActionForPlayback" none="YES"/> + <wkPreferences key="preferences"/> + </wkWebViewConfiguration> + </wkWebView> + <view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="i03-rW-DQq"> + <rect key="frame" x="137.66666666666666" y="211.33333333333337" width="117.66666666666666" height="144.66666666666663"/> + <subviews> + <imageView clipsSubviews="YES" userInteractionEnabled="NO" contentMode="scaleAspectFit" horizontalHuggingPriority="251" verticalHuggingPriority="251" translatesAutoresizingMaskIntoConstraints="NO" id="zlO-OX-u5S"> + <rect key="frame" x="10" y="10" width="97.666666666666671" height="97.666666666666671"/> + <constraints> + <constraint firstAttribute="width" secondItem="zlO-OX-u5S" secondAttribute="height" multiplier="1:1" id="s2S-ez-cbK"/> + </constraints> + </imageView> + <label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" textAlignment="center" lineBreakMode="tailTruncation" numberOfLines="2" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="Xfl-IA-8RW"> + <rect key="frame" x="19" y="117.66666666666663" width="79.666666666666671" height="24"/> + <string key="text">添加助教老师微信 +了解详情</string> + <fontDescription key="fontDescription" type="system" pointSize="10"/> + <color key="textColor" red="0.47450980392156861" green="0.47450980392156861" blue="0.47450980392156861" alpha="1" colorSpace="custom" customColorSpace="sRGB"/> + <nil key="highlightedColor"/> + </label> + </subviews> + <color key="backgroundColor" systemColor="systemBackgroundColor"/> + <constraints> + <constraint firstAttribute="width" secondItem="i03-rW-DQq" secondAttribute="height" multiplier="1:1.23" id="58K-8U-RIV"/> + <constraint firstItem="zlO-OX-u5S" firstAttribute="leading" secondItem="i03-rW-DQq" secondAttribute="leading" constant="10" id="Cj3-tR-bTf"/> + <constraint firstAttribute="trailing" secondItem="zlO-OX-u5S" secondAttribute="trailing" constant="10" id="GvU-Oj-We6"/> + <constraint firstItem="Xfl-IA-8RW" firstAttribute="top" secondItem="zlO-OX-u5S" secondAttribute="bottom" constant="10" id="WvR-C0-f6R"/> + <constraint firstAttribute="width" constant="117.5" id="dMh-nw-j5I"/> + <constraint firstItem="Xfl-IA-8RW" firstAttribute="centerX" secondItem="i03-rW-DQq" secondAttribute="centerX" id="tzt-Kd-i7R"/> + <constraint firstItem="zlO-OX-u5S" firstAttribute="top" secondItem="i03-rW-DQq" secondAttribute="top" constant="10" id="uK2-L2-0LK"/> + </constraints> + </view> + </subviews> + <color key="backgroundColor" red="0.96470588235294119" green="0.96470588235294119" blue="0.96470588235294119" alpha="1" colorSpace="custom" customColorSpace="sRGB"/> + <constraints> + <constraint firstAttribute="bottomMargin" secondItem="i03-rW-DQq" secondAttribute="bottom" constant="27" id="05h-sZ-B6g"/> + <constraint firstItem="7hg-kN-gqy" firstAttribute="leading" secondItem="SHG-A0-P8Y" secondAttribute="leading" constant="22" id="3GA-vl-BWj"/> + <constraint firstItem="UmN-R4-VrQ" firstAttribute="top" secondItem="7hg-kN-gqy" secondAttribute="bottom" constant="19.5" id="Egk-vS-HfY"/> + <constraint firstItem="i03-rW-DQq" firstAttribute="top" secondItem="UmN-R4-VrQ" secondAttribute="bottom" constant="35" id="Ewn-Db-3aO"/> + <constraint firstItem="7hg-kN-gqy" firstAttribute="top" secondItem="SHG-A0-P8Y" secondAttribute="top" constant="39" id="HOe-iO-2bP"/> + <constraint firstItem="UmN-R4-VrQ" firstAttribute="leading" secondItem="SHG-A0-P8Y" secondAttribute="leading" constant="10" id="RP6-OF-MMB"/> + <constraint firstItem="i03-rW-DQq" firstAttribute="centerX" secondItem="SHG-A0-P8Y" secondAttribute="centerX" id="cDU-Lm-sXe"/> + <constraint firstAttribute="trailing" secondItem="UmN-R4-VrQ" secondAttribute="trailing" constant="10" id="fOj-gF-2g4"/> + </constraints> + </view> + </subviews> + <color key="backgroundColor" systemColor="systemBackgroundColor"/> + <constraints> + <constraint firstItem="hDw-D7-a6I" firstAttribute="leading" secondItem="lz1-9S-TY8" secondAttribute="leading" id="0mN-Fo-mZK"/> + <constraint firstAttribute="bottom" secondItem="SHG-A0-P8Y" secondAttribute="bottom" id="1Rg-BU-RUg"/> + <constraint firstItem="SHG-A0-P8Y" firstAttribute="top" secondItem="itL-Yu-biN" secondAttribute="bottom" id="6Vj-YI-r8v"/> + <constraint firstItem="itL-Yu-biN" firstAttribute="top" secondItem="hDw-D7-a6I" secondAttribute="bottom" id="8Kp-ew-YkB"/> + <constraint firstAttribute="trailing" secondItem="SHG-A0-P8Y" secondAttribute="trailing" id="H2A-Ro-NAo"/> + <constraint firstAttribute="trailing" secondItem="itL-Yu-biN" secondAttribute="trailing" id="Pid-wb-6gd"/> + <constraint firstAttribute="trailing" secondItem="hDw-D7-a6I" secondAttribute="trailing" id="Utc-n1-bfU"/> + <constraint firstItem="itL-Yu-biN" firstAttribute="leading" secondItem="lz1-9S-TY8" secondAttribute="leading" id="V4t-oq-1Ah"/> + <constraint firstItem="hDw-D7-a6I" firstAttribute="top" secondItem="lz1-9S-TY8" secondAttribute="top" id="t0r-Ir-cV2"/> + <constraint firstItem="SHG-A0-P8Y" firstAttribute="leading" secondItem="lz1-9S-TY8" secondAttribute="leading" id="xFo-88-xVp"/> + </constraints> + </view> + </subviews> + <constraints> + <constraint firstAttribute="trailing" secondItem="lz1-9S-TY8" secondAttribute="trailing" id="7KE-Lx-IvF"/> + <constraint firstItem="lz1-9S-TY8" firstAttribute="leading" secondItem="4KE-wb-44W" secondAttribute="leading" id="Cbm-CQ-9IT"/> + <constraint firstAttribute="bottom" secondItem="lz1-9S-TY8" secondAttribute="bottom" id="YEL-In-TvY"/> + <constraint firstItem="lz1-9S-TY8" firstAttribute="centerX" secondItem="4KE-wb-44W" secondAttribute="centerX" id="Zwt-e5-4Pm"/> + <constraint firstItem="lz1-9S-TY8" firstAttribute="top" secondItem="4KE-wb-44W" secondAttribute="top" id="nXF-Q2-0xj"/> + </constraints> + </scrollView> + </subviews> + <color key="backgroundColor" systemColor="systemBackgroundColor"/> + <constraints> + <constraint firstAttribute="trailing" secondItem="4KE-wb-44W" secondAttribute="trailing" id="LXY-D6-QCg"/> + <constraint firstItem="4KE-wb-44W" firstAttribute="leading" secondItem="i5M-Pr-FkT" secondAttribute="leading" id="ihN-jr-zqy"/> + <constraint firstItem="4KE-wb-44W" firstAttribute="top" secondItem="i5M-Pr-FkT" secondAttribute="top" id="r2w-8v-ZZG"/> + <constraint firstAttribute="bottom" secondItem="4KE-wb-44W" secondAttribute="bottom" id="x0Q-YS-Trw"/> + </constraints> + <point key="canvasLocation" x="-22.137404580152669" y="20.422535211267608"/> + </view> + </objects> + <resources> + <image name="icon_local_1" width="9.6666669845581055" height="12"/> + <systemColor name="systemBackgroundColor"> + <color white="1" alpha="1" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/> + </systemColor> + </resources> +</document> 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() diff --git a/XQMuse/Root/Course/VC/CourseDetialVideoVC.swift b/XQMuse/Root/Course/VC/CourseDetialVideoVC.swift index 4dffa91..ee4bba3 100644 --- a/XQMuse/Root/Course/VC/CourseDetialVideoVC.swift +++ b/XQMuse/Root/Course/VC/CourseDetialVideoVC.swift @@ -6,6 +6,7 @@ // import UIKit +import JQTools class CourseDetialVideoVC: BaseVC { @@ -38,7 +39,6 @@ let item = items[selectIndex.row] guard secondLook > 0 else {return} - Services.watchClouse(chapterId: item.id, isOver: isOver, secondLook: secondLook).subscribe(onNext: { _ in }).disposed(by: disposeBag) @@ -48,7 +48,7 @@ super.viewDidLoad() title = "课程详情" - videoView = VideoView(url: items[selectIndex.row].videoUrl,delegate: self) + videoView = VideoView(url: items[selectIndex.row].videoUrl.jq_urlEncoded(),delegate: self) videoView?.player.play() view_bg_video.addSubview(videoView!) videoView!.snp.makeConstraints { make in diff --git a/XQMuse/Root/Course/VC/CourseMenuVC.swift b/XQMuse/Root/Course/VC/CourseMenuVC.swift index 65b7fcc..56a2a8d 100644 --- a/XQMuse/Root/Course/VC/CourseMenuVC.swift +++ b/XQMuse/Root/Course/VC/CourseMenuVC.swift @@ -7,6 +7,7 @@ import UIKit import JQTools +import EmptyDataSet_Swift class CourseMenuVC: BaseVC { @@ -56,6 +57,15 @@ make.top.equalTo(self.view.safeAreaLayoutGuide.snp.top).offset(18) make.bottom.equalTo(tableView) } + + collectionView.emptyDataSetSource = self + collectionView.emptyDataSetDelegate = self +// collectionView.emptyDataSetView { v in +// let v = UIView() +// v.backgroundColor = .red +// +// return +// } } func setTitleItem(_ items:[TitleItem],defaultSelectIndex:Int = 0){ @@ -95,8 +105,14 @@ func collectionView(_ collectionView: UICollectionView, didSelectItemAt indexPath: IndexPath) { let model = viewModel.dataSource.value!.list[indexPath.row] - let vc = CourseDetialVC(courseId: model.id) - push(vc: vc) + + if model.courseType == .online{ + let vc = CourseDetialVC(courseId: model.id) + push(vc: vc) + }else{ + let vc = CourseDetialOfflineVC(courseId: model.id) + push(vc: vc) + } } func collectionView(_ collectionView: UICollectionView, cellForItemAt indexPath: IndexPath) -> UICollectionViewCell { @@ -124,3 +140,25 @@ return CGSize(width: w, height: w * 1.313) } } + +extension CourseMenuVC:EmptyDataSetSource{ + func image(forEmptyDataSet scrollView: UIScrollView) -> UIImage? { + return UIImage(named: "icon_empty") + } + + func title(forEmptyDataSet scrollView: UIScrollView) -> NSAttributedString? { + return AttributedStringbuilder.build().add(string: "暂无数据", withFont: .systemFont(ofSize: 12, weight: .medium), withColor: .gray).mutableAttributedString + } + + func verticalOffset(forEmptyDataSet scrollView: UIScrollView) -> CGFloat { + return 300 + } + + func spaceHeight(forEmptyDataSet scrollView: UIScrollView) -> CGFloat { + return 200 + } +} + +extension CourseMenuVC:EmptyDataSetDelegate{ + +} diff --git a/XQMuse/Root/Course/VC/CourseVCOfficalCommentVC.swift b/XQMuse/Root/Course/VC/CourseVCOfficalCommentVC.swift index b17c83b..1d57422 100644 --- a/XQMuse/Root/Course/VC/CourseVCOfficalCommentVC.swift +++ b/XQMuse/Root/Course/VC/CourseVCOfficalCommentVC.swift @@ -78,17 +78,14 @@ func collectionView(_ collectionView: UICollectionView, didSelectItemAt indexPath: IndexPath) { let model = viewModel.dataSource.value!.list[indexPath.row] - let vc = CourseDetialVC(courseId: model.id) - JQ_currentViewController().jq_push(vc: vc) -// let isVip = UserViewModel.getAvatarInfo().isVip == .yes -// if model.isBuy == .yes || model.chargeType == .free || (model.chargeType == .vipFree && isVip){ -// -// return -// }else{ -// let vc = CourseDetialVC(courseId: model.id) -// JQ_currentViewController().jq_push(vc: vc) -// } + if model.courseType == .online{ + let vc = CourseDetialVC(courseId: model.id) + JQ_currentViewController().jq_push(vc: vc) + }else{ + let vc = CourseDetialOfflineVC(courseId: model.id) + JQ_currentViewController().jq_push(vc: vc) + } } @@ -157,6 +154,9 @@ } func collectionView(_ collectionView: UICollectionView, layout collectionViewLayout: UICollectionViewLayout, referenceSizeForHeaderInSection section: Int) -> CGSize { + if section == 0{ + return .zero + } return CGSize(width: JQ_ScreenW, height: 80.5) } } diff --git a/XQMuse/Root/Course/VC/CourseVCTeacherSpecialVC.swift b/XQMuse/Root/Course/VC/CourseVCTeacherSpecialVC.swift index 2912e66..a01d5b8 100644 --- a/XQMuse/Root/Course/VC/CourseVCTeacherSpecialVC.swift +++ b/XQMuse/Root/Course/VC/CourseVCTeacherSpecialVC.swift @@ -8,6 +8,8 @@ import UIKit import JQTools +let CourseVCTeacherSpecial_Update = Notification.Name.init("CourseVCTeacherSpecial_Update") + class CourseVCTeacherSpecialVC: BaseVC { private var tableView:UITableView? private var headerView:VideoView! @@ -39,6 +41,21 @@ self.headerView.updateVideoUrl(m.videoUrl,autoPlay: false,placeHoderImageUrl: m.coverUrl.jq_urlEncoded()) } }).disposed(by: disposeBag) + + + self.cell0?.webView.scrollView.rx.observe(CGSize.self, "contentSize").map { (size) -> CGFloat? in + if let size = size{ + return size.height + } + return nil + }.subscribe(onNext: { [unowned self](height) in + if let height = height{ + if height > self.cell0?.cons_webHei.constant ?? 0{ + self.cell0?.cons_webHei.constant = height + self.tableView?.reloadData() + } + } + }).disposed(by: disposeBag) } override func setUI() { @@ -70,19 +87,7 @@ } override func setRx() { - self.cell0?.webView.scrollView.rx.observe(CGSize.self, "contentSize").map { (size) -> CGFloat? in - if let size = size{ - return size.height - } - return nil - }.subscribe(onNext: { [unowned self](height) in - if let height = height{ - if height > self.cell0?.cons_webHei.constant ?? 0{ - self.cell0?.cons_webHei.constant = height - self.tableView?.reloadData() - } - } - }).disposed(by: disposeBag) + } override var shouldAutorotate: Bool{ diff --git a/XQMuse/Root/Course/View/CourseDetialCustomerView.swift b/XQMuse/Root/Course/View/CourseDetialCustomerView.swift new file mode 100644 index 0000000..5b31de8 --- /dev/null +++ b/XQMuse/Root/Course/View/CourseDetialCustomerView.swift @@ -0,0 +1,52 @@ +// +// CourseDetialCustomerView.swift +// XQMuse +// +// Created by 无故事王国 on 2024/11/6. +// + +import UIKit +import JQTools + +class CourseDetialCustomerView: UIView,JQNibView{ + + @IBOutlet weak var image_qrCode: UIImageView! + @IBOutlet weak var btn_known: UIButton! + @IBOutlet weak var view_container: UIView! + + override func awakeFromNib() { + super.awakeFromNib() + view_container.jq_cornerRadius = 10 + view_container.transform = .init(scaleX: 0.1, y: 0.1) + alpha = 0 + } + + static func show(customerImage:UIImage){ + let view = CourseDetialCustomerView.jq_loadNibView() + sceneDelegate?.window?.addSubview(view) + view.image_qrCode.image = customerImage + view.frame = sceneDelegate?.window?.frame ?? .zero + + UIView.animate(withDuration: 0.5, delay: 0.1, usingSpringWithDamping: 0.5, initialSpringVelocity: 1.0, options: .curveEaseIn) { + view.view_container.transform = .init(scaleX: 1.0, y: 1.0) + view.alpha = 1 + } completion: { _ in + + } + } + + override func layoutSubviews() { + super.layoutSubviews() + btn_known.localGradientColor(cornerRadius: 20) + } + + + @IBAction func closeAction(_ sender: UIButton) { + UIView.animate(withDuration: 0.3) { + self.view_container.transform = .init(scaleX: 0.1, y: 0.1) + self.alpha = 0 + } completion: { _ in + self.removeFromSuperview() + } + } +} diff --git a/XQMuse/Root/Course/View/CourseDetialCustomerView.xib b/XQMuse/Root/Course/View/CourseDetialCustomerView.xib new file mode 100644 index 0000000..185affc --- /dev/null +++ b/XQMuse/Root/Course/View/CourseDetialCustomerView.xib @@ -0,0 +1,106 @@ +<?xml version="1.0" encoding="UTF-8"?> +<document type="com.apple.InterfaceBuilder3.CocoaTouch.XIB" version="3.0" toolsVersion="23094" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" useSafeAreas="YES" colorMatched="YES"> + <device id="retina6_12" orientation="portrait" appearance="light"/> + <dependencies> + <deployment identifier="iOS"/> + <plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="23084"/> + <capability name="System colors in document resources" minToolsVersion="11.0"/> + <capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/> + </dependencies> + <objects> + <placeholder placeholderIdentifier="IBFilesOwner" id="-1" userLabel="File's Owner"/> + <placeholder placeholderIdentifier="IBFirstResponder" id="-2" customClass="UIResponder"/> + <view contentMode="scaleToFill" id="iN0-l3-epB" customClass="CourseDetialCustomerView" customModule="XQMuse" customModuleProvider="target"> + <rect key="frame" x="0.0" y="0.0" width="393" height="852"/> + <autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/> + <subviews> + <view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="18z-bc-FIb"> + <rect key="frame" x="25" y="223.66666666666663" width="343" height="405"/> + <subviews> + <label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="添加微信" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="hph-HD-MEq"> + <rect key="frame" x="135.66666666666666" y="17" width="71.666666666666657" height="21"/> + <fontDescription key="fontDescription" type="system" weight="semibold" pointSize="18"/> + <color key="textColor" red="0.0" green="0.0" blue="0.0" alpha="0.80000000000000004" colorSpace="custom" customColorSpace="sRGB"/> + <nil key="highlightedColor"/> + <userDefinedRuntimeAttributes> + <userDefinedRuntimeAttribute type="boolean" keyPath="ld_maskToBoundsXIB" value="YES"/> + <userDefinedRuntimeAttribute type="number" keyPath="ld_cornerRadiusXIB"> + <real key="value" value="10"/> + </userDefinedRuntimeAttribute> + </userDefinedRuntimeAttributes> + </label> + <imageView clipsSubviews="YES" userInteractionEnabled="NO" contentMode="scaleAspectFit" horizontalHuggingPriority="251" verticalHuggingPriority="251" translatesAutoresizingMaskIntoConstraints="NO" id="jka-lR-tvX"> + <rect key="frame" x="52" y="52.000000000000028" width="239" height="238.99999999999997"/> + <constraints> + <constraint firstAttribute="width" secondItem="jka-lR-tvX" secondAttribute="height" multiplier="1:1" id="Ev0-h2-etg"/> + </constraints> + </imageView> + <label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="可添加助教微信,了解课程详情" textAlignment="center" lineBreakMode="tailTruncation" numberOfLines="2" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="Jvg-TG-dvH"> + <rect key="frame" x="74.333333333333329" y="300" width="194.66666666666669" height="17"/> + <fontDescription key="fontDescription" type="system" weight="medium" pointSize="14"/> + <color key="textColor" red="0.0" green="0.0" blue="0.0" alpha="0.59999999999999998" colorSpace="custom" customColorSpace="sRGB"/> + <nil key="highlightedColor"/> + </label> + <button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="kpk-28-Amk"> + <rect key="frame" x="37" y="341" width="269" height="40"/> + <color key="backgroundColor" red="0.56470588239999997" green="0.65490196079999996" blue="0.48627450979999998" alpha="1" colorSpace="custom" customColorSpace="sRGB"/> + <constraints> + <constraint firstAttribute="height" constant="40" id="XyZ-FL-gye"/> + </constraints> + <fontDescription key="fontDescription" type="system" weight="medium" pointSize="15"/> + <inset key="imageEdgeInsets" minX="0.0" minY="0.0" maxX="2.2250738585072014e-308" maxY="0.0"/> + <state key="normal" title="知道了"/> + <userDefinedRuntimeAttributes> + <userDefinedRuntimeAttribute type="boolean" keyPath="ld_maskToBoundsXIB" value="YES"/> + <userDefinedRuntimeAttribute type="number" keyPath="ld_cornerRadiusXIB"> + <real key="value" value="20"/> + </userDefinedRuntimeAttribute> + </userDefinedRuntimeAttributes> + <connections> + <action selector="closeAction:" destination="iN0-l3-epB" eventType="touchUpInside" id="haG-rI-iNF"/> + </connections> + </button> + </subviews> + <color key="backgroundColor" systemColor="systemBackgroundColor"/> + <constraints> + <constraint firstItem="kpk-28-Amk" firstAttribute="top" secondItem="Jvg-TG-dvH" secondAttribute="bottom" constant="24" id="6yc-ZL-Exc"/> + <constraint firstItem="Jvg-TG-dvH" firstAttribute="top" secondItem="jka-lR-tvX" secondAttribute="bottom" constant="9" id="F8m-vL-hmJ"/> + <constraint firstAttribute="trailing" secondItem="kpk-28-Amk" secondAttribute="trailing" constant="37" id="GfC-EX-Zz4"/> + <constraint firstItem="jka-lR-tvX" firstAttribute="top" secondItem="hph-HD-MEq" secondAttribute="bottom" constant="14" id="Mya-VC-XTg"/> + <constraint firstItem="hph-HD-MEq" firstAttribute="top" secondItem="18z-bc-FIb" secondAttribute="top" constant="17" id="W5K-LK-P1H"/> + <constraint firstItem="jka-lR-tvX" firstAttribute="leading" secondItem="18z-bc-FIb" secondAttribute="leading" constant="52" id="WlJ-nj-HPf"/> + <constraint firstItem="kpk-28-Amk" firstAttribute="leading" secondItem="18z-bc-FIb" secondAttribute="leading" constant="37" id="ZxO-A9-YLd"/> + <constraint firstAttribute="bottom" secondItem="kpk-28-Amk" secondAttribute="bottom" constant="24" id="cHL-9X-Qka"/> + <constraint firstItem="hph-HD-MEq" firstAttribute="centerX" secondItem="18z-bc-FIb" secondAttribute="centerX" id="iFf-s4-Rai"/> + <constraint firstAttribute="trailing" secondItem="jka-lR-tvX" secondAttribute="trailing" constant="52" id="ngt-lg-cI7"/> + <constraint firstItem="Jvg-TG-dvH" firstAttribute="centerX" secondItem="18z-bc-FIb" secondAttribute="centerX" id="weG-Tk-jiP"/> + </constraints> + <userDefinedRuntimeAttributes> + <userDefinedRuntimeAttribute type="boolean" keyPath="ld_maskToBoundsXIB" value="YES"/> + <userDefinedRuntimeAttribute type="number" keyPath="ld_cornerRadiusXIB"> + <real key="value" value="10"/> + </userDefinedRuntimeAttribute> + </userDefinedRuntimeAttributes> + </view> + </subviews> + <color key="backgroundColor" red="0.0" green="0.0" blue="0.0" alpha="0.69999999999999996" colorSpace="custom" customColorSpace="sRGB"/> + <constraints> + <constraint firstItem="18z-bc-FIb" firstAttribute="centerX" secondItem="iN0-l3-epB" secondAttribute="centerX" id="1Dh-Kh-yoj"/> + <constraint firstItem="18z-bc-FIb" firstAttribute="centerY" secondItem="iN0-l3-epB" secondAttribute="centerY" id="99i-tH-2hN"/> + <constraint firstItem="18z-bc-FIb" firstAttribute="leading" secondItem="iN0-l3-epB" secondAttribute="leading" constant="25" id="mtD-0k-fhX"/> + <constraint firstAttribute="trailing" secondItem="18z-bc-FIb" secondAttribute="trailing" constant="25" id="wO6-IB-6uo"/> + </constraints> + <connections> + <outlet property="btn_known" destination="kpk-28-Amk" id="NLI-7a-nps"/> + <outlet property="image_qrCode" destination="jka-lR-tvX" id="n5y-r8-ibA"/> + <outlet property="view_container" destination="18z-bc-FIb" id="SWz-lK-Rdd"/> + </connections> + <point key="canvasLocation" x="-24" y="21"/> + </view> + </objects> + <resources> + <systemColor name="systemBackgroundColor"> + <color white="1" alpha="1" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/> + </systemColor> + </resources> +</document> diff --git a/XQMuse/Root/Home/CCell/HomeRelaxBannerCCell.swift b/XQMuse/Root/Home/CCell/HomeRelaxBannerCCell.swift index e07fb87..aa04c5e 100644 --- a/XQMuse/Root/Home/CCell/HomeRelaxBannerCCell.swift +++ b/XQMuse/Root/Home/CCell/HomeRelaxBannerCCell.swift @@ -24,7 +24,7 @@ override func awakeFromNib() { super.awakeFromNib() // Initialization code - jq_cornerRadius = 25 + jq_cornerRadius = 15 view_price.jq_cornerRadius = 12.55 } @@ -60,7 +60,9 @@ } func setCourseModel(_ model:CourseModel){ - img_cover.sd_setImage(with: URL(string: model.coverUrl.jq_urlEncoded())) + + let imgUrl = model.coverUrl.components(separatedBy: ",").last! + img_cover.sd_setImage(with: URL(string: imgUrl.jq_urlEncoded())) label_title.text = model.courseTitle label_subTitle.text = model.briefIntroduction label_num.text = "\(model.count)" diff --git a/XQMuse/Root/Home/CCell/HomeRelaxBannerCCell.xib b/XQMuse/Root/Home/CCell/HomeRelaxBannerCCell.xib index 9bd8ef5..21ca465 100644 --- a/XQMuse/Root/Home/CCell/HomeRelaxBannerCCell.xib +++ b/XQMuse/Root/Home/CCell/HomeRelaxBannerCCell.xib @@ -102,11 +102,7 @@ </constraints> </view> <imageView clipsSubviews="YES" userInteractionEnabled="NO" contentMode="scaleAspectFit" horizontalHuggingPriority="251" verticalHuggingPriority="251" image="icon_vip" translatesAutoresizingMaskIntoConstraints="NO" id="qF4-sn-dec"> - <rect key="frame" x="14.000000000000002" y="15.000000000000002" width="21.666666666666671" height="21.666666666666671"/> - <constraints> - <constraint firstAttribute="width" constant="21.5" id="Ng1-iW-jL8"/> - <constraint firstAttribute="height" constant="21.5" id="xz7-i6-Qq3"/> - </constraints> + <rect key="frame" x="14.000000000000002" y="15.000000000000002" width="25.666666666666671" height="25.666666666666671"/> </imageView> </subviews> </view> @@ -147,6 +143,6 @@ <image name="icon_offline" width="34" height="18"/> <image name="icon_play" width="46" height="46"/> <image name="icon_use_small" width="10" height="10.666666984558105"/> - <image name="icon_vip" width="21.666666030883789" height="21.666666030883789"/> + <image name="icon_vip" width="25.666666030883789" height="25.666666030883789"/> </resources> </document> diff --git a/XQMuse/Root/Home/CCell/HomeRelaxBanner_2_1_CCell.swift b/XQMuse/Root/Home/CCell/HomeRelaxBanner_2_1_CCell.swift index 7424f9d..95f8c3d 100644 --- a/XQMuse/Root/Home/CCell/HomeRelaxBanner_2_1_CCell.swift +++ b/XQMuse/Root/Home/CCell/HomeRelaxBanner_2_1_CCell.swift @@ -26,7 +26,7 @@ // Initialization code - jq_cornerRadius = 10 + jq_cornerRadius = 15 view_price.jq_cornerRadius = 12.55 let blurEffect = UIBlurEffect(style: .light) let visualEffectView = UIVisualEffectView(effect: blurEffect) diff --git a/XQMuse/Root/Home/CCell/HomeRelaxBanner_2_CCell.swift b/XQMuse/Root/Home/CCell/HomeRelaxBanner_2_CCell.swift index f829cc0..24a30ef 100644 --- a/XQMuse/Root/Home/CCell/HomeRelaxBanner_2_CCell.swift +++ b/XQMuse/Root/Home/CCell/HomeRelaxBanner_2_CCell.swift @@ -28,7 +28,7 @@ super.awakeFromNib() // Initialization code - jq_cornerRadius = 10 + jq_cornerRadius = 15 let blurEffect = UIBlurEffect(style: .light) let visualEffectView = UIVisualEffectView(effect: blurEffect) @@ -56,7 +56,7 @@ func setCourseModel(_ model:CourseModel){ img_cover.sd_setImage(with: URL(string: model.coverUrl.jq_urlEncoded().components(separatedBy: ",").last)) label_title.text = model.courseTitle - label_subTitle.text = model.briefIntroduction + label_subTitle.text = model.briefIntroduction.jq_filterFromHTML_1() label_num.text = "\(model.count)" img_vip.isHidden = model.isVip != .yes diff --git a/XQMuse/Root/Home/CCell/HomeRelaxBanner_2_CCell.xib b/XQMuse/Root/Home/CCell/HomeRelaxBanner_2_CCell.xib index 8696632..b499a60 100644 --- a/XQMuse/Root/Home/CCell/HomeRelaxBanner_2_CCell.xib +++ b/XQMuse/Root/Home/CCell/HomeRelaxBanner_2_CCell.xib @@ -31,10 +31,9 @@ <color key="textColor" white="1" alpha="1" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/> <nil key="highlightedColor"/> </label> - <label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="--" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="z5u-My-91l"> - <rect key="frame" x="20" y="34.666666666666686" width="10.666666666666664" height="10.333333333333336"/> + <label opaque="NO" userInteractionEnabled="NO" contentMode="left" verticalHuggingPriority="251" horizontalCompressionResistancePriority="1000" text="--" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="z5u-My-91l"> + <rect key="frame" x="20" y="34.666666666666686" width="106" height="10.333333333333336"/> <constraints> - <constraint firstAttribute="width" relation="lessThanOrEqual" constant="100" id="Fam-ne-FM1"/> <constraint firstAttribute="height" constant="10.57" id="epJ-Xi-ukn"/> </constraints> <fontDescription key="fontDescription" type="system" pointSize="11"/> @@ -44,7 +43,7 @@ <imageView clipsSubviews="YES" userInteractionEnabled="NO" contentMode="scaleAspectFit" horizontalHuggingPriority="251" verticalHuggingPriority="251" image="icon_use_small" translatesAutoresizingMaskIntoConstraints="NO" id="hE1-AV-t8f"> <rect key="frame" x="136" y="34.666666666666686" width="10" height="10.333333333333336"/> </imageView> - <label opaque="NO" userInteractionEnabled="NO" contentMode="left" verticalHuggingPriority="251" horizontalCompressionResistancePriority="1000" text="0" textAlignment="right" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="JaY-19-IAL"> + <label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="1000" verticalHuggingPriority="251" horizontalCompressionResistancePriority="1000" text="0" textAlignment="right" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="JaY-19-IAL"> <rect key="frame" x="148" y="33" width="7" height="13.333333333333336"/> <fontDescription key="fontDescription" type="system" pointSize="11"/> <color key="textColor" red="1" green="1" blue="1" alpha="1" colorSpace="calibratedRGB"/> @@ -62,10 +61,11 @@ <constraint firstItem="hE1-AV-t8f" firstAttribute="centerY" secondItem="z5u-My-91l" secondAttribute="centerY" id="lIq-lg-iPk"/> <constraint firstAttribute="height" constant="65" id="mM2-ih-U9T"/> <constraint firstItem="z5u-My-91l" firstAttribute="leading" secondItem="byc-Ar-sJL" secondAttribute="leading" id="q6f-hc-Nga"/> + <constraint firstItem="hE1-AV-t8f" firstAttribute="leading" secondItem="z5u-My-91l" secondAttribute="trailing" constant="10" id="wgV-ti-lnF"/> </constraints> </view> <imageView clipsSubviews="YES" userInteractionEnabled="NO" contentMode="scaleAspectFit" horizontalHuggingPriority="251" verticalHuggingPriority="251" image="icon_vip" translatesAutoresizingMaskIntoConstraints="NO" id="yBF-fO-fwz"> - <rect key="frame" x="14.666666666666666" y="7.6666666666666661" width="21.333333333333336" height="21.333333333333336"/> + <rect key="frame" x="14.666666666666666" y="7.6666666666666661" width="25.666666666666671" height="25.666666666666671"/> </imageView> <view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="rmi-DQ-cp9"> <rect key="frame" x="14.666666666666668" y="7.6666666666666679" width="38.666666666666657" height="25.000000000000004"/> @@ -111,7 +111,6 @@ </constraints> <size key="customSize" width="178" height="301"/> <connections> - <outlet property="cons_maxSubTitle" destination="Fam-ne-FM1" id="L5X-GP-uev"/> <outlet property="image_free" destination="deT-IZ-PtZ" id="kI7-7g-aIM"/> <outlet property="img_cover" destination="cCC-0f-GSV" id="85x-ue-edy"/> <outlet property="img_offline" destination="IJ3-94-7an" id="EYY-vi-GGP"/> @@ -131,6 +130,6 @@ <image name="icon_freee" width="50" height="18"/> <image name="icon_offline" width="34" height="18"/> <image name="icon_use_small" width="10" height="10.666666984558105"/> - <image name="icon_vip" width="21.666666030883789" height="21.666666030883789"/> + <image name="icon_vip" width="25.666666030883789" height="25.666666030883789"/> </resources> </document> diff --git a/XQMuse/Root/Home/CCell/Home_Style_4_Inner_CCell.swift b/XQMuse/Root/Home/CCell/Home_Style_4_Inner_CCell.swift index 25b4c82..736e991 100644 --- a/XQMuse/Root/Home/CCell/Home_Style_4_Inner_CCell.swift +++ b/XQMuse/Root/Home/CCell/Home_Style_4_Inner_CCell.swift @@ -27,7 +27,7 @@ // Initialization code - cover_bgImage.jq_cornerRadius = 10 + cover_bgImage.jq_cornerRadius = 15 view_price.jq_cornerRadius = 12.55 let blurEffect = UIBlurEffect(style: .light) diff --git a/XQMuse/Root/Home/HomeVC.swift b/XQMuse/Root/Home/HomeVC.swift index 296ad1f..c6c5390 100644 --- a/XQMuse/Root/Home/HomeVC.swift +++ b/XQMuse/Root/Home/HomeVC.swift @@ -42,7 +42,7 @@ titleItems.removeAll() titleItems.append(TitleItem(title: "每日疗愈", subTitle: "Daily Meditation")) - titleItems.append(TitleItem(title: "私人订制", subTitle: "Private Meditation",hasMore: true)) + titleItems.append(TitleItem(title: "私人订制", subTitle: "Private Customization",hasMore: true)) titleItems.append(TitleItem(title: "新手冥想指南", subTitle: "Meditation guide")) if let setting = UserDefaultSettingViewModel.getSetting(){ @@ -55,13 +55,11 @@ self.getData() }) - getData() + if let m = UserDefaultSettingViewModel.getSetting()?.bgm { + topMenuView.image_top.sd_setImage(with: URL(string: m.imageUrl)) + } -// DispatchQueue.main.asyncAfter(delay: 3.0) { -// Popup_1_View.show(state: .success, title: "修改成功", subtitle: "您的密码已修改成功,快去登录账户吧") { -// self.navigationController?.popToRootViewController(animated: true) -// } -// } + getData() } override func setUI() { @@ -209,7 +207,7 @@ self.viewModel.meditationList.removeAll() self.titleItems.removeAll() self.titleItems.append(TitleItem(title: "每日疗愈", subTitle: "Daily Meditation")) - self.titleItems.append(TitleItem(title: "私人订制", subTitle: "Private Meditation",hasMore: true)) + self.titleItems.append(TitleItem(title: "私人订制", subTitle: "Private Customization",hasMore: true)) self.titleItems.append(TitleItem(title: "新手冥想指南", subTitle: "Meditation guide")) diff --git a/XQMuse/Root/Home/TCell/Home_Style_1_TCell.swift b/XQMuse/Root/Home/TCell/Home_Style_1_TCell.swift index a294564..12ca2b0 100644 --- a/XQMuse/Root/Home/TCell/Home_Style_1_TCell.swift +++ b/XQMuse/Root/Home/TCell/Home_Style_1_TCell.swift @@ -14,7 +14,7 @@ if let m = model{ img_cover.sd_setImage(with: URL(string: m.backgroundUrl)) label_title.text = "\(m.meditationTitle) | 00:00" - label_joinNum.text = "\(m.realLearnedNum)人已参加学习" + label_joinNum.text = "\(m.realLearnedNum + m.virtualLearnedNum)人已参加学习" } } } diff --git a/XQMuse/Root/Home/VC/CommentListVC.xib b/XQMuse/Root/Home/VC/CommentListVC.xib index b9160c7..6c23c9d 100644 --- a/XQMuse/Root/Home/VC/CommentListVC.xib +++ b/XQMuse/Root/Home/VC/CommentListVC.xib @@ -1,9 +1,9 @@ <?xml version="1.0" encoding="UTF-8"?> -<document type="com.apple.InterfaceBuilder3.CocoaTouch.XIB" version="3.0" toolsVersion="32700.99.1234" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" useSafeAreas="YES" colorMatched="YES"> +<document type="com.apple.InterfaceBuilder3.CocoaTouch.XIB" version="3.0" toolsVersion="23094" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" useSafeAreas="YES" colorMatched="YES"> <device id="retina6_12" orientation="portrait" appearance="light"/> <dependencies> <deployment identifier="iOS"/> - <plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="22685"/> + <plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="23084"/> <capability name="Safe area layout guides" minToolsVersion="9.0"/> <capability name="System colors in document resources" minToolsVersion="11.0"/> <capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/> @@ -50,7 +50,7 @@ <view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="Stl-8O-SW3"> <rect key="frame" x="48.999999999999986" y="18.666666666666629" width="232.66666666666663" height="29"/> <subviews> - <textField opaque="NO" contentMode="scaleToFill" horizontalHuggingPriority="248" contentHorizontalAlignment="left" contentVerticalAlignment="center" placeholder="留下你的精彩评论吧" textAlignment="natural" minimumFontSize="17" translatesAutoresizingMaskIntoConstraints="NO" id="p6F-O6-dow" customClass="QMUITextField"> + <textField opaque="NO" contentMode="scaleToFill" horizontalHuggingPriority="248" contentHorizontalAlignment="left" contentVerticalAlignment="center" placeholder="请输入内容" textAlignment="natural" minimumFontSize="17" translatesAutoresizingMaskIntoConstraints="NO" id="p6F-O6-dow" customClass="QMUITextField"> <rect key="frame" x="16" y="0.0" width="208.66666666666666" height="29"/> <fontDescription key="fontDescription" type="system" weight="medium" pointSize="11"/> <textInputTraits key="textInputTraits"/> @@ -97,7 +97,7 @@ <rect key="frame" x="0.0" y="329" width="393" height="400"/> <subviews> <label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="0条提问" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="tJL-SB-mev"> - <rect key="frame" x="169.66666666666666" y="24" width="54" height="17"/> + <rect key="frame" x="170.33333333333334" y="24" width="52.666666666666657" height="17"/> <fontDescription key="fontDescription" type="system" weight="semibold" pointSize="14"/> <color key="textColor" red="0.2196078431372549" green="0.2196078431372549" blue="0.2196078431372549" alpha="1" colorSpace="custom" customColorSpace="sRGB"/> <nil key="highlightedColor"/> diff --git a/XQMuse/Root/Home/VC/HomeItemDetailVC.swift b/XQMuse/Root/Home/VC/HomeItemDetailVC.swift index 061e2b2..0dc9ef1 100644 --- a/XQMuse/Root/Home/VC/HomeItemDetailVC.swift +++ b/XQMuse/Root/Home/VC/HomeItemDetailVC.swift @@ -31,6 +31,11 @@ private var id:Int! private var timeLook:Int = 0 //观看时间记录 private var settingViewModel = UserDefaultSettingViewModel.getSetting() + + private var currentInterval:TimeInterval = 0 + private var totalInterval:TimeInterval = 0 + + private var model:MeditationModel?{ didSet{ if let m = model{ @@ -140,6 +145,13 @@ } }.disposed(by: disposeBag) + + + slider_voice.rx.value.changed.subscribe(onNext: {[weak self] v in + guard let weakSelf = self else { return } + let value = (v.double / 100.0) * weakSelf.totalInterval + self?.audioPlayer.setBGMRate(value: value) + }).disposed(by: disposeBag) } private func startMiniRunloop(){ @@ -159,8 +171,14 @@ } @IBAction func playAction(_ sender: UIButton) { + sender.isSelected = !sender.isSelected if let m = model{ - audioPlayer.playBGMAt(firstPlayIndex: 0, model: m, delegate: self) + + if sender.isSelected{ + audioPlayer.playBGMAt(firstPlayIndex: 0, model: m, delegate: self,coverImage: img_background.image) + }else{ + audioPlayer.bgmPlayer?.pause() + } } } @@ -281,11 +299,18 @@ guard !totalInterval.isNaN else {return} guard !currentInterval.isNaN else {return} + self.currentInterval = currentInterval + self.totalInterval = totalInterval + timeLook += 1 let v = currentInterval / totalInterval * 100 print("music:当前时间:\(currentInterval) ---- \(totalInterval) -- \(v)%") - self.slider_voice.value = Float(v) + + if !self.slider_voice.isTracking{ + self.slider_voice.value = Float(v) + } + let current = Date.jq_formateToTime_tuple(Int(currentInterval)) label_currentTime.text = String(format: "%02ld:%02ld", current.hour * 60 + current.minute,current.second) diff --git a/XQMuse/Root/Home/VC/HomeItemDetailVC.xib b/XQMuse/Root/Home/VC/HomeItemDetailVC.xib index 7e95c61..12743c2 100644 --- a/XQMuse/Root/Home/VC/HomeItemDetailVC.xib +++ b/XQMuse/Root/Home/VC/HomeItemDetailVC.xib @@ -169,7 +169,7 @@ <constraint firstAttribute="width" constant="65.5" id="YnH-gC-sgS"/> </constraints> <inset key="imageEdgeInsets" minX="0.0" minY="0.0" maxX="2.2250738585072014e-308" maxY="0.0"/> - <state key="normal" image="icon_play"/> + <state key="normal" image="btn_play"/> <connections> <action selector="playAction:" destination="-1" eventType="touchUpInside" id="DT7-8R-5nM"/> </connections> @@ -252,11 +252,11 @@ <resources> <image name="btn_comment" width="18.666666030883789" height="19"/> <image name="btn_list" width="17" height="13.666666984558105"/> + <image name="btn_play" width="65.666664123535156" height="65.666664123535156"/> <image name="btn_roll" width="22.666666030883789" height="19.666666030883789"/> <image name="btn_roll_loop" width="22.666666030883789" height="19.666666030883789"/> <image name="btn_time" width="20.666666030883789" height="20.666666030883789"/> <image name="demo_bg" width="621" height="1064"/> - <image name="icon_play" width="46" height="46"/> <image name="icon_time_3" width="16" height="16"/> <systemColor name="systemBackgroundColor"> <color white="1" alpha="1" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/> diff --git a/XQMuse/Root/Home/VC/PaymentOrderResultVC.swift b/XQMuse/Root/Home/VC/PaymentOrderResultVC.swift index fa83395..8b2afac 100644 --- a/XQMuse/Root/Home/VC/PaymentOrderResultVC.swift +++ b/XQMuse/Root/Home/VC/PaymentOrderResultVC.swift @@ -138,8 +138,14 @@ switch type { case .course: let model = models[indexPath.row] as! CourseModel - let vc = CourseDetialVC(courseId: model.id) - push(vc: vc) + if model.courseType == .online{ + let vc = CourseDetialVC(courseId: model.id) + push(vc: vc) + }else{ + let vc = CourseDetialOfflineVC(courseId: model.id) + push(vc: vc) + } + case .muse: let model = models[indexPath.row] as! MeditationModel let vc = HomeItemDetailVC(id: model.id) diff --git a/XQMuse/Root/Home/VC/PaymentOrderVC.swift b/XQMuse/Root/Home/VC/PaymentOrderVC.swift index 7275c78..e3c880a 100644 --- a/XQMuse/Root/Home/VC/PaymentOrderVC.swift +++ b/XQMuse/Root/Home/VC/PaymentOrderVC.swift @@ -74,8 +74,8 @@ self.image_cover.sd_setImage(with: URL(string: m.coverUrl.jq_urlEncoded())) self.label_courseName.text = m.courseTitle self.label_price.text = "愈疗币\(m.iosPrice.jq_formatFloat)" - self.label_teacher.text = "导师\(m.tutor)" - self.label_paymentCount.text = "x\(m.count)" + self.label_teacher.text = "导师 \(m.tutor)" + self.label_paymentCount.text = "x\(m.count == 0 ? 1:m.count)" self.label_orderPrice.text = "愈疗币\(m.iosPrice.jq_formatFloat)" self.label_totalPrice.text = "愈疗币\(m.iosPrice.jq_formatFloat)" } diff --git a/XQMuse/Root/Home/VC/SearchContentVC.swift b/XQMuse/Root/Home/VC/SearchContentVC.swift index d285ae3..7e689a5 100644 --- a/XQMuse/Root/Home/VC/SearchContentVC.swift +++ b/XQMuse/Root/Home/VC/SearchContentVC.swift @@ -134,8 +134,14 @@ case .course: let m = courseViewModel!.dataSource.value!.list[indexPath.row] if m.chargeType == .free || (m.chargeType == .vipFree && isVip == .yes) || (m.chargeType == .payment && m.isBuy == .yes){ - let vc = CourseDetialVC(courseId: m.id) - JQ_currentViewController().jq_push(vc: vc) + + if m.courseType == .online{ + let vc = CourseDetialVC(courseId: m.id) + JQ_currentViewController().jq_push(vc: vc) + }else{ + let vc = CourseDetialOfflineVC(courseId: m.id) + JQ_currentViewController().jq_push(vc: vc) + } }else{ if m.chargeType == .vipFree{ let vc = VIPCenterVC() diff --git a/XQMuse/Root/Home/View/CommentCommentHeaderView.swift b/XQMuse/Root/Home/View/CommentCommentHeaderView.swift index 4aaf5b8..321bad4 100644 --- a/XQMuse/Root/Home/View/CommentCommentHeaderView.swift +++ b/XQMuse/Root/Home/View/CommentCommentHeaderView.swift @@ -51,7 +51,7 @@ } btn_belike = UIButton(type: .custom) - btn_belike.setImage(UIImage(named: "btn_good")?.withTintColor(UIColor(hexStr: "fe5b60")), for: .selected) + btn_belike.setImage(UIImage(named: "btn_good_1")?.withTintColor(UIColor(hexStr: "fe5b60")), for: .selected) btn_belike.setImage(UIImage(named: "btn_good"), for: .normal) btn_belike.addTarget(self, action: #selector(belike), for: .touchUpInside) contentView.addSubview(btn_belike) @@ -87,7 +87,7 @@ func setCommentModel(_ model:CommentModel){ self.model = model - img_userCover.sd_setImage(with: URL(string: model.nickname)) + img_userCover.sd_setImage(with: URL(string: model.avatar.jq_urlEncoded())) label_content.text = model.content label_userName.text = model.nickname btn_belike.isSelected = model.like == .yes diff --git a/XQMuse/Root/Home/View/HomeHeaderVC.swift b/XQMuse/Root/Home/View/HomeHeaderVC.swift index 7e5fd0c..4df2d75 100644 --- a/XQMuse/Root/Home/View/HomeHeaderVC.swift +++ b/XQMuse/Root/Home/View/HomeHeaderVC.swift @@ -93,7 +93,6 @@ label_subTitle.snp.makeConstraints { make in make.left.equalTo(19) make.top.equalTo(label_title.snp.bottom).offset(9) - make.height.equalTo(5.5) } btn_more = UIButton(type: .custom) diff --git a/XQMuse/Root/Home/View/PaymentOrderResultTopView.swift b/XQMuse/Root/Home/View/PaymentOrderResultTopView.swift index d935306..c48490a 100644 --- a/XQMuse/Root/Home/View/PaymentOrderResultTopView.swift +++ b/XQMuse/Root/Home/View/PaymentOrderResultTopView.swift @@ -22,7 +22,9 @@ func setPrice(type:PaymentOrderVC.PaymentOrderType,id:Int,price:Double){ self.id = id self.type = type - label_price.text = "\(price.jq_formatFloat)" + + label_price.attributedText = AttributedStringbuilder.build().add(string: "疗愈币", withFont: .systemFont(ofSize: 18, weight: .semibold), withColor: UIColor(hexStr: "#FF9000")) + .add(string: String(format: "%.2lf", price), withFont: UIFont(name: "DIN Alternate", size: 30)!, withColor: UIColor(hexStr: "#FF9000")).mutableAttributedString switch type { case .course:btn_lookCourse.setTitle("查看课程", for: .normal) diff --git a/XQMuse/Root/Home/View/PaymentOrderResultTopView.xib b/XQMuse/Root/Home/View/PaymentOrderResultTopView.xib index cc97225..5ba513d 100644 --- a/XQMuse/Root/Home/View/PaymentOrderResultTopView.xib +++ b/XQMuse/Root/Home/View/PaymentOrderResultTopView.xib @@ -1,9 +1,9 @@ <?xml version="1.0" encoding="UTF-8"?> -<document type="com.apple.InterfaceBuilder3.CocoaTouch.XIB" version="3.0" toolsVersion="32700.99.1234" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" useSafeAreas="YES" colorMatched="YES"> +<document type="com.apple.InterfaceBuilder3.CocoaTouch.XIB" version="3.0" toolsVersion="23094" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" useSafeAreas="YES" colorMatched="YES"> <device id="retina6_12" orientation="portrait" appearance="light"/> <dependencies> <deployment identifier="iOS"/> - <plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="22685"/> + <plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="23084"/> <capability name="System colors in document resources" minToolsVersion="11.0"/> <capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/> </dependencies> @@ -22,7 +22,7 @@ </constraints> </imageView> <label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="支付成功" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="Vka-pM-ru5"> - <rect key="frame" x="194.33333333333334" y="109" width="57.333333333333343" height="20"/> + <rect key="frame" x="195.33333333333334" y="109" width="55.666666666666657" height="20"/> <constraints> <constraint firstAttribute="height" constant="20" id="SWT-Sd-K2H"/> </constraints> @@ -31,11 +31,11 @@ <nil key="highlightedColor"/> </label> <label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="0" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="hDa-VO-Vzk"> - <rect key="frame" x="213" y="165" width="20.333333333333343" height="37"/> + <rect key="frame" x="214.66666666666666" y="165" width="17" height="37"/> <constraints> <constraint firstAttribute="height" constant="37" id="9iu-Ck-Y6k"/> </constraints> - <fontDescription key="fontDescription" type="boldSystem" pointSize="30"/> + <fontDescription key="fontDescription" name="HelveticaNeue-Bold" family="Helvetica Neue" pointSize="30"/> <color key="textColor" red="1" green="0.56470588235294117" blue="0.0" alpha="1" colorSpace="custom" customColorSpace="sRGB"/> <nil key="highlightedColor"/> </label> diff --git a/XQMuse/Root/Login/VC/ForgotPasswordChangeVC.swift b/XQMuse/Root/Login/VC/ForgotPasswordChangeVC.swift index cc85409..1ff5971 100644 --- a/XQMuse/Root/Login/VC/ForgotPasswordChangeVC.swift +++ b/XQMuse/Root/Login/VC/ForgotPasswordChangeVC.swift @@ -32,6 +32,15 @@ override func viewDidLoad() { super.viewDidLoad() title = "修改密码" + + yy_popBlock = {[weak self] in + guard let weakSelf = self else { return } + for vc in weakSelf.navigationController?.viewControllers ?? []{ + if vc is ForgotPasswordVC{ + weakSelf.navigationController?.popToViewController(vc, animated: true);break + } + } + } } override func setUI() { diff --git a/XQMuse/Root/Me/VC/BindAccountVC.swift b/XQMuse/Root/Me/VC/BindAccountVC.swift index 0e1888c..515099e 100644 --- a/XQMuse/Root/Me/VC/BindAccountVC.swift +++ b/XQMuse/Root/Me/VC/BindAccountVC.swift @@ -7,6 +7,8 @@ import UIKit +let BindWechat_Noti = Notification.Name.init("BindWechat_Noti") + class BindAccountVC: BaseVC { @IBOutlet weak var label_phone: UILabel! @IBOutlet weak var label_wchatBindState: UILabel! @@ -17,6 +19,12 @@ title = "账号绑定" label_phone.text = UserViewModel.getAvatarInfo().cellPhone label_wechatBind.text = UserViewModel.getAvatarInfo().wxOpenId.isEmpty ? "未绑定":"已绑定" + } + + override func setRx() { + NotificationCenter.default.rx.notification(BindWechat_Noti).take(until: self.rx.deallocated).subscribe(onNext: {[weak self] _ in + self?.label_wechatBind.text = UserViewModel.getAvatarInfo().wxOpenId.isEmpty ? "未绑定":"已绑定" + }).disposed(by: disposeBag) } @IBAction func bindPhoneAction(_ sender: Any) { @@ -31,5 +39,8 @@ let vc = ForgotPasswordVC() push(vc: vc) } - + + @IBAction func bindWechatAction(_ sender: TapBtn) { + WeChatTools.sendAuthRequest() + } } diff --git a/XQMuse/Root/Me/VC/BindAccountVC.xib b/XQMuse/Root/Me/VC/BindAccountVC.xib index 065abda..55e98dd 100644 --- a/XQMuse/Root/Me/VC/BindAccountVC.xib +++ b/XQMuse/Root/Me/VC/BindAccountVC.xib @@ -115,6 +115,9 @@ <constraint firstItem="rnP-eo-8fV" firstAttribute="centerY" secondItem="Wgk-EY-Mp1" secondAttribute="centerY" id="t59-mZ-wZl"/> <constraint firstAttribute="bottom" secondItem="8Ba-ju-fm8" secondAttribute="bottom" id="zUS-gF-Qtl"/> </constraints> + <connections> + <action selector="bindWechatAction:" destination="-1" eventType="touchUpInside" id="ghw-d3-txO"/> + </connections> </view> <view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="Dao-ey-Pqx" customClass="TapBtn" customModule="XQMuse" customModuleProvider="target"> <rect key="frame" x="0.0" y="102" width="393" height="51"/> diff --git a/XQMuse/Root/Me/VC/InviteVC.swift b/XQMuse/Root/Me/VC/InviteVC.swift index 6de0983..c304b18 100644 --- a/XQMuse/Root/Me/VC/InviteVC.swift +++ b/XQMuse/Root/Me/VC/InviteVC.swift @@ -10,6 +10,7 @@ class InviteVC: BaseVC { + @IBOutlet weak var scrollView: UIScrollView! @IBOutlet weak var label_title: UILabel! @IBOutlet weak var btn_share: UIButton! @IBOutlet weak var view_role: UIView! @@ -42,7 +43,9 @@ @IBAction func shareAction(_ sender: UIButton) { let string = String(format: "%@%@?userId=%ld", ShareUrl,"/poster/poster",UserViewModel.getAvatarInfo().id) - ShareView.show(URL(string: string)!, title: "心泉·疗愈", desc: "心泉疗愈1") - + ShareView.show(URL(string: string)!, title: "心泉·疗愈", desc: "心泉疗愈1",hasSave: true) {[weak self] in + self?.scrollView.jq_captureAsLongImage(saveToAlbum: true) + alertSuccess(msg: "已保存至相册") + } } } diff --git a/XQMuse/Root/Me/VC/InviteVC.xib b/XQMuse/Root/Me/VC/InviteVC.xib index 49341e1..7e39a4f 100644 --- a/XQMuse/Root/Me/VC/InviteVC.xib +++ b/XQMuse/Root/Me/VC/InviteVC.xib @@ -16,6 +16,7 @@ <outlet property="img_qrCode" destination="bff-wn-eyk" id="FV9-RT-3rK"/> <outlet property="label_role" destination="PXe-Ef-0Zn" id="E0d-R5-kBO"/> <outlet property="label_title" destination="oFE-SE-88r" id="C2L-3T-B60"/> + <outlet property="scrollView" destination="Kj8-pf-QQp" id="30y-rn-UUc"/> <outlet property="view" destination="i5M-Pr-FkT" id="sfx-zR-JGt"/> <outlet property="view_role" destination="nfc-1h-yql" id="FWd-fZ-91R"/> </connections> diff --git a/XQMuse/Root/Me/VC/UserProfileVC.swift b/XQMuse/Root/Me/VC/UserProfileVC.swift index eb95c22..88679d5 100644 --- a/XQMuse/Root/Me/VC/UserProfileVC.swift +++ b/XQMuse/Root/Me/VC/UserProfileVC.swift @@ -172,7 +172,10 @@ if textField == tf_birthday{ view.endEditing(true) - BitrhdayPickerView.show(title: "", type: .YMD) {[weak self] date in + + let date = tf_birthday.text?.date(withFormat: "yyyy-MM-dd") //默认回填 + + BitrhdayPickerView.show(title: "", type: .YMD,defaultYear: date?.year,defaultMonth: date?.month,defaultDay: date?.day) {[weak self] date in self?.tf_birthday.text = date.jq_format("yyyy-MM-dd") } return false diff --git a/XQMuse/Root/Me/VC/VIPCenterVC.swift b/XQMuse/Root/Me/VC/VIPCenterVC.swift index a9d2e2a..cf0694e 100644 --- a/XQMuse/Root/Me/VC/VIPCenterVC.swift +++ b/XQMuse/Root/Me/VC/VIPCenterVC.swift @@ -8,6 +8,7 @@ import UIKit import JQTools import StoreKit +import WebKit class VIPCenterVC: BaseVC { @@ -16,6 +17,8 @@ @IBOutlet weak var collectionView: UICollectionView! @IBOutlet weak var btn_isRead: UIButton! @IBOutlet weak var label_expirtTime: UILabel! + @IBOutlet weak var webView: WKWebView! + @IBOutlet weak var webViewHeiCons: NSLayoutConstraint! private var selectIndex = 0 private var productList = Set<String>() @@ -54,6 +57,26 @@ self.label_vipHint.text = "升级为会员,解锁会员专属体验" self.label_expirtTime.text = "你还未开通会员服务" } + + Services.getVipContent(type: 1).subscribe(onNext: { data in + if let string = data.data{ + self.webView.loadHTMLString(string.jq_wrapHtml(), baseURL: nil) + } + }).disposed(by: disposeBag) + } + + override func setRx() { + webView.scrollView.rx.observe(CGSize.self, "contentSize").map { (size) -> CGFloat? in + if let size = size{ + return size.height + } + return nil + }.subscribe(onNext: { [unowned self](height) in + if let height = height{ + self.webViewHeiCons.constant = height + } + }).disposed(by: disposeBag) + } @IBAction func completeAction(_ sender: UIButton) { diff --git a/XQMuse/Root/Me/VC/VIPCenterVC.xib b/XQMuse/Root/Me/VC/VIPCenterVC.xib index 0aee0e1..0948409 100644 --- a/XQMuse/Root/Me/VC/VIPCenterVC.xib +++ b/XQMuse/Root/Me/VC/VIPCenterVC.xib @@ -17,6 +17,8 @@ <outlet property="label_expirtTime" destination="9TG-o4-3iP" id="gfB-ZZ-lSf"/> <outlet property="label_vipHint" destination="teL-7U-G1S" id="PaY-O3-zF6"/> <outlet property="view" destination="i5M-Pr-FkT" id="sfx-zR-JGt"/> + <outlet property="webView" destination="a9D-PO-axc" id="gQy-Z6-lY3"/> + <outlet property="webViewHeiCons" destination="AWY-C0-cXO" id="PWS-gA-rpV"/> </connections> </placeholder> <placeholder placeholderIdentifier="IBFirstResponder" id="-2" customClass="UIResponder"/> @@ -27,11 +29,11 @@ <imageView clipsSubviews="YES" userInteractionEnabled="NO" contentMode="scaleAspectFit" horizontalHuggingPriority="251" verticalHuggingPriority="251" image="bg_voice_top" translatesAutoresizingMaskIntoConstraints="NO" id="VLP-Hy-naC"> <rect key="frame" x="0.0" y="0.0" width="393" height="297"/> </imageView> - <scrollView clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="bkf-bh-gzu"> - <rect key="frame" x="0.0" y="59" width="393" height="759"/> + <scrollView clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="scaleToFill" showsHorizontalScrollIndicator="NO" showsVerticalScrollIndicator="NO" translatesAutoresizingMaskIntoConstraints="NO" id="bkf-bh-gzu"> + <rect key="frame" x="0.0" y="59" width="393" height="656"/> <subviews> <view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="L2t-aS-dfp"> - <rect key="frame" x="0.0" y="0.0" width="393" height="462.66666666666669"/> + <rect key="frame" x="0.0" y="0.0" width="393" height="482.66666666666669"/> <subviews> <view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="h8a-aO-hri"> <rect key="frame" x="14" y="54.666666666666679" width="365" height="113.33333333333331"/> @@ -95,7 +97,7 @@ </collectionViewFlowLayout> </collectionView> <wkWebView contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="a9D-PO-axc"> - <rect key="frame" x="0.0" y="362.66666666666669" width="393" height="100"/> + <rect key="frame" x="0.0" y="382.66666666666669" width="393" height="100"/> <constraints> <constraint firstAttribute="height" constant="100" id="AWY-C0-cXO"/> </constraints> @@ -106,7 +108,7 @@ </wkWebView> </subviews> <constraints> - <constraint firstItem="a9D-PO-axc" firstAttribute="top" secondItem="Ue5-Zy-CjC" secondAttribute="bottom" id="15v-6A-0ji"/> + <constraint firstItem="a9D-PO-axc" firstAttribute="top" secondItem="Ue5-Zy-CjC" secondAttribute="bottom" constant="20" id="15v-6A-0ji"/> <constraint firstItem="Ue5-Zy-CjC" firstAttribute="top" secondItem="yWI-Sm-wHz" secondAttribute="bottom" constant="12.5" id="8id-05-Hve"/> <constraint firstItem="yWI-Sm-wHz" firstAttribute="top" secondItem="h8a-aO-hri" secondAttribute="bottom" constant="29" id="G5O-gM-Ih2"/> <constraint firstAttribute="trailing" secondItem="h8a-aO-hri" secondAttribute="trailing" constant="14" id="Hkp-e9-iFe"/> @@ -203,10 +205,10 @@ <constraint firstItem="fnl-2z-Ty3" firstAttribute="trailing" secondItem="Qa1-cj-VoU" secondAttribute="trailing" id="17Q-Ar-AY7"/> <constraint firstItem="VLP-Hy-naC" firstAttribute="top" secondItem="i5M-Pr-FkT" secondAttribute="top" id="DUD-QX-KBG"/> <constraint firstItem="bkf-bh-gzu" firstAttribute="top" secondItem="fnl-2z-Ty3" secondAttribute="top" id="GX4-yE-DfY"/> + <constraint firstItem="Qa1-cj-VoU" firstAttribute="top" secondItem="bkf-bh-gzu" secondAttribute="bottom" id="NdD-Eg-nQL"/> <constraint firstAttribute="bottom" secondItem="Qa1-cj-VoU" secondAttribute="bottom" id="ORB-Sa-yIO"/> <constraint firstItem="VLP-Hy-naC" firstAttribute="leading" secondItem="fnl-2z-Ty3" secondAttribute="leading" id="TTg-Kg-sh0"/> <constraint firstItem="fnl-2z-Ty3" firstAttribute="trailing" secondItem="bkf-bh-gzu" secondAttribute="trailing" id="bNU-bF-fJd"/> - <constraint firstItem="fnl-2z-Ty3" firstAttribute="bottom" secondItem="bkf-bh-gzu" secondAttribute="bottom" id="gKn-YZ-1jy"/> <constraint firstItem="bkf-bh-gzu" firstAttribute="leading" secondItem="fnl-2z-Ty3" secondAttribute="leading" id="kpV-5I-DMc"/> <constraint firstItem="Qa1-cj-VoU" firstAttribute="leading" secondItem="i5M-Pr-FkT" secondAttribute="leading" id="m1A-Bv-NWm"/> <constraint firstItem="fnl-2z-Ty3" firstAttribute="trailing" secondItem="VLP-Hy-naC" secondAttribute="trailing" id="ul0-Xj-7Nb"/> diff --git a/XQMuse/Root/Me/VC/WatchHistoryDetailVC.swift b/XQMuse/Root/Me/VC/WatchHistoryDetailVC.swift index fd33903..dff0996 100644 --- a/XQMuse/Root/Me/VC/WatchHistoryDetailVC.swift +++ b/XQMuse/Root/Me/VC/WatchHistoryDetailVC.swift @@ -84,11 +84,16 @@ let m = viewModel.dataSource.value[indexPath.row] if viewModel.state.value == 1{ - let vc = CourseDetialVC(courseId: m.businessId) - JQ_currentViewController().jq_push(vc: vc) - }else{ let vc = HomeItemDetailVC(id: m.businessId) JQ_currentViewController().jq_push(vc: vc) + }else{ + if m.courseType == .online{ + let vc = CourseDetialVC(courseId: m.businessId) + JQ_currentViewController().jq_push(vc: vc) + }else{ + let vc = CourseDetialOfflineVC(courseId: m.businessId) + push(vc: vc) + } } } } diff --git a/XQMuse/Root/Network/Services.swift b/XQMuse/Root/Network/Services.swift index 2369e36..cc3e720 100644 --- a/XQMuse/Root/Network/Services.swift +++ b/XQMuse/Root/Network/Services.swift @@ -99,7 +99,7 @@ .append(key: "cellPhone", value: cellPhone) .append(key: "captcha", value: captcha) .append(key: "inviteUserId", value: inviteUserId) - .append(key: "password", value: password.jq_md5String().uppercased()) + .append(key: "password", value: password.jq_md5String().lowercased()) .append(key: "apipost_id", value: "246d7806b0e268") return NetworkRequest.request(params: params, method: .post,encoding: JSONEncoding(), progress: true) } @@ -598,6 +598,12 @@ return NetworkRequest.request(params: params, method: .post, progress: false) } + class func sowAgain()->Observable<BaseResponse<SimpleModel>>{ + let params = ParamsAppender.build(url: All_Url) + params.interface(url: "/user/client/app-user-tree/restart") + return NetworkRequest.request(params: params, method: .post,encoding: JSONEncoding(), progress: true) + } + //浇水 class func watering()->Observable<BaseResponse<WateringModel>>{ let params = ParamsAppender.build(url: All_Url) @@ -756,4 +762,13 @@ .interface(url: "/system/system/page/getPage") return NetworkRequest.request(params: params, method: .post,encoding: JSONEncoding(), progress: false) } + + /// 获取会员权益介绍-获取会员用户协议-获取续费管理说明 + /// - Parameter type: 内容类型 1=会员权益介绍 2=会员用户协议 3=续费管理说明 + class func getVipContent(type:Int)->Observable<BaseResponse<String>>{ + let params = ParamsAppender.build(url: All_Url) + .interface(url: "/system/system/vip-setting/getVipContent") + .append(key: "type", value: type) + return NetworkRequest.request(params: params, method: .post, progress: false) + } } diff --git a/XQMuse/Root/Other/View/CountdownChooseListView.swift b/XQMuse/Root/Other/View/CountdownChooseListView.swift index 255602c..61006b7 100644 --- a/XQMuse/Root/Other/View/CountdownChooseListView.swift +++ b/XQMuse/Root/Other/View/CountdownChooseListView.swift @@ -64,6 +64,7 @@ tf_input.rx.text.orEmpty.subscribe(onNext: {[unowned self] text in self.numberMinutes = text.int ?? 1 + self.status = .choose(self.numberMinutes) }).disposed(by: disposeBag) } @@ -88,33 +89,39 @@ btn_cancel.jq_gradientNibColor(colorArr: [UIColor(hexStr: "#8EA47A").cgColor,UIColor(hexStr: "#AFCA98").cgColor], cornerRadius: 18.5) } - - @IBAction func customReduceAction(_ sender: Any) { - userCustomer() - numberMinutes-=1 - - numberMinutes = max(1,numberMinutes) - tf_input.text = numberMinutes.string - } - - @IBAction func customAddAction(_ sender: Any) { - userCustomer() - numberMinutes+=1 - tf_input.text = numberMinutes.string - } - - @IBAction func cancelAction(_ sender: UIButton) { - endEditing(true) - - if case .choose(let v) = status { - clouse?(status) - } - + private func closeAni(){ cons_bottom.constant = -JQ_ScreenH UIView.animate(withDuration: 0.4) { self.alpha = 0 self.layoutIfNeeded() } + } + + + @IBAction func customReduceAction(_ sender: Any) { + userCustomer() + var t = tf_input.text?.int ?? 1 + t = max(1,t) + status = .choose(t) + tf_input.text = t.string + } + + @IBAction func customAddAction(_ sender: Any) { + userCustomer() + var t = tf_input.text?.int ?? 1 + t += 1 + status = .choose(t) + tf_input.text = t.string + } + + @IBAction func closeAction(_ sender: UIButton) { + closeAni() + } + + @IBAction func cancelAction(_ sender: UIButton) { + endEditing(true) + clouse?(status) + closeAni() } private func userCustomer(){ @@ -177,7 +184,7 @@ status = .choose(numberMinutes) default: numberMinutes = text!.jq_filterNum().int ?? 0 - tf_input.text = numberMinutes.string +// tf_input.text = numberMinutes.string status = .choose(numberMinutes) } }else{ diff --git a/XQMuse/Root/Other/View/CountdownChooseListView.xib b/XQMuse/Root/Other/View/CountdownChooseListView.xib index cf87c42..0c0c819 100644 --- a/XQMuse/Root/Other/View/CountdownChooseListView.xib +++ b/XQMuse/Root/Other/View/CountdownChooseListView.xib @@ -1,9 +1,9 @@ <?xml version="1.0" encoding="UTF-8"?> -<document type="com.apple.InterfaceBuilder3.CocoaTouch.XIB" version="3.0" toolsVersion="32700.99.1234" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" useSafeAreas="YES" colorMatched="YES"> +<document type="com.apple.InterfaceBuilder3.CocoaTouch.XIB" version="3.0" toolsVersion="23094" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" useSafeAreas="YES" colorMatched="YES"> <device id="retina6_12" orientation="portrait" appearance="light"/> <dependencies> <deployment identifier="iOS"/> - <plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="22685"/> + <plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="23084"/> <capability name="Safe area layout guides" minToolsVersion="9.0"/> <capability name="System colors in document resources" minToolsVersion="11.0"/> <capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/> @@ -44,7 +44,7 @@ <rect key="frame" x="0.0" y="0.0" width="338" height="60"/> <subviews> <label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="5分钟" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="R6N-pc-KFT"> - <rect key="frame" x="0.0" y="20.333333333333343" width="44.666666666666664" height="19.333333333333329"/> + <rect key="frame" x="0.0" y="20.333333333333343" width="43.666666666666664" height="19.333333333333329"/> <fontDescription key="fontDescription" type="system" weight="medium" pointSize="16"/> <color key="textColor" red="0.36078431370000003" green="0.36078431370000003" blue="0.36078431370000003" alpha="1" colorSpace="custom" customColorSpace="sRGB"/> <nil key="highlightedColor"/> @@ -69,7 +69,7 @@ <rect key="frame" x="0.0" y="60.000000000000028" width="338" height="60"/> <subviews> <label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="10分钟" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="4dF-XD-wTF"> - <rect key="frame" x="0.0" y="20.333333333333314" width="52.333333333333336" height="19.333333333333329"/> + <rect key="frame" x="0.0" y="20.333333333333314" width="51.333333333333336" height="19.333333333333329"/> <fontDescription key="fontDescription" type="system" weight="medium" pointSize="16"/> <color key="textColor" red="0.36078431370000003" green="0.36078431370000003" blue="0.36078431370000003" alpha="1" colorSpace="custom" customColorSpace="sRGB"/> <nil key="highlightedColor"/> @@ -94,7 +94,7 @@ <rect key="frame" x="0.0" y="120.00000000000003" width="338" height="60"/> <subviews> <label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="15分钟" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="c3J-LT-iKQ"> - <rect key="frame" x="0.0" y="20.333333333333314" width="52" height="19.333333333333329"/> + <rect key="frame" x="0.0" y="20.333333333333314" width="51" height="19.333333333333329"/> <fontDescription key="fontDescription" type="system" weight="medium" pointSize="16"/> <color key="textColor" red="0.36078431370000003" green="0.36078431370000003" blue="0.36078431370000003" alpha="1" colorSpace="custom" customColorSpace="sRGB"/> <nil key="highlightedColor"/> @@ -119,7 +119,7 @@ <rect key="frame" x="0.0" y="180.00000000000003" width="338" height="60"/> <subviews> <label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="30分钟" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="VZp-Te-BRo"> - <rect key="frame" x="0.0" y="20.333333333333314" width="54.666666666666664" height="19.333333333333329"/> + <rect key="frame" x="0.0" y="20.333333333333314" width="54" height="19.333333333333329"/> <fontDescription key="fontDescription" type="system" weight="medium" pointSize="16"/> <color key="textColor" red="0.36078431370000003" green="0.36078431370000003" blue="0.36078431370000003" alpha="1" colorSpace="custom" customColorSpace="sRGB"/> <nil key="highlightedColor"/> @@ -144,7 +144,7 @@ <rect key="frame" x="0.0" y="240" width="338" height="60"/> <subviews> <label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="60分钟" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="MAb-Aa-TfD"> - <rect key="frame" x="0.0" y="20.333333333333314" width="55" height="19.333333333333329"/> + <rect key="frame" x="0.0" y="20.333333333333314" width="54" height="19.333333333333329"/> <fontDescription key="fontDescription" type="system" weight="medium" pointSize="16"/> <color key="textColor" red="0.36078431370000003" green="0.36078431370000003" blue="0.36078431370000003" alpha="1" colorSpace="custom" customColorSpace="sRGB"/> <nil key="highlightedColor"/> @@ -169,7 +169,7 @@ <rect key="frame" x="0.0" y="300" width="338" height="60"/> <subviews> <label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="90分钟" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="yau-63-b2F"> - <rect key="frame" x="0.0" y="20.333333333333371" width="55" height="19.333333333333329"/> + <rect key="frame" x="0.0" y="20.333333333333371" width="54" height="19.333333333333329"/> <fontDescription key="fontDescription" type="system" weight="medium" pointSize="16"/> <color key="textColor" red="0.36078431370000003" green="0.36078431370000003" blue="0.36078431370000003" alpha="1" colorSpace="custom" customColorSpace="sRGB"/> <nil key="highlightedColor"/> @@ -194,19 +194,19 @@ <rect key="frame" x="0.0" y="360" width="338" height="60"/> <subviews> <label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="自定义" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="13t-bq-ZrI"> - <rect key="frame" x="0.0" y="20.333333333333371" width="49" height="19.333333333333329"/> + <rect key="frame" x="0.0" y="20.333333333333371" width="47.666666666666664" height="19.333333333333329"/> <fontDescription key="fontDescription" type="system" weight="medium" pointSize="16"/> <color key="textColor" red="0.36078431370000003" green="0.36078431370000003" blue="0.36078431370000003" alpha="1" colorSpace="custom" customColorSpace="sRGB"/> <nil key="highlightedColor"/> </label> <label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="分钟" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="7t6-hs-qy2"> - <rect key="frame" x="305.33333333333331" y="20.333333333333371" width="32.666666666666686" height="19.333333333333329"/> + <rect key="frame" x="306" y="20.333333333333371" width="32" height="19.333333333333329"/> <fontDescription key="fontDescription" type="system" weight="medium" pointSize="16"/> <color key="textColor" red="0.36078431370000003" green="0.36078431370000003" blue="0.36078431370000003" alpha="1" colorSpace="custom" customColorSpace="sRGB"/> <nil key="highlightedColor"/> </label> <view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="pco-QS-K6g"> - <rect key="frame" x="183.33333333333334" y="13.333333333333371" width="111.00000000000003" height="33"/> + <rect key="frame" x="184" y="13.333333333333371" width="111" height="33"/> <subviews> <view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="nZz-b9-hm4"> <rect key="frame" x="34.333333333333343" y="7" width="0.6666666666666643" height="19"/> @@ -216,14 +216,14 @@ </constraints> </view> <view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="Gdb-Sf-7En"> - <rect key="frame" x="80.333333333333314" y="7" width="1" height="19"/> + <rect key="frame" x="80.333333333333343" y="7" width="1" height="19"/> <color key="backgroundColor" red="0.74509803919999995" green="0.74509803919999995" blue="0.74509803919999995" alpha="1" colorSpace="custom" customColorSpace="sRGB"/> <constraints> <constraint firstAttribute="width" constant="0.90000000000000002" id="4Ak-wJ-Pn9"/> </constraints> </view> <button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="3gc-AH-OlI"> - <rect key="frame" x="81.333333333333314" y="0.0" width="29.666666666666671" height="33"/> + <rect key="frame" x="81.333333333333343" y="0.0" width="29.666666666666671" height="33"/> <inset key="imageEdgeInsets" minX="0.0" minY="0.0" maxX="2.2250738585072014e-308" maxY="0.0"/> <state key="normal" title="+"> <color key="titleColor" red="0.36078431370000003" green="0.36078431370000003" blue="0.36078431370000003" alpha="1" colorSpace="custom" customColorSpace="sRGB"/> @@ -304,7 +304,7 @@ <rect key="frame" x="0.0" y="420" width="338" height="60"/> <subviews> <label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="关闭倒计时" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="nEw-Jm-F5g"> - <rect key="frame" x="0.0" y="20.333333333333371" width="81.666666666666671" height="19.333333333333329"/> + <rect key="frame" x="0.0" y="20.333333333333371" width="79.666666666666671" height="19.333333333333329"/> <fontDescription key="fontDescription" type="system" weight="medium" pointSize="16"/> <color key="textColor" red="0.36078431370000003" green="0.36078431370000003" blue="0.36078431370000003" alpha="1" colorSpace="custom" customColorSpace="sRGB"/> <nil key="highlightedColor"/> @@ -339,12 +339,23 @@ <constraint firstAttribute="trailing" secondItem="Frj-KE-ITo" secondAttribute="trailing" constant="47.5" id="bYf-d0-Klo"/> </constraints> </view> + <button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="RIb-w0-AAo"> + <rect key="frame" x="0.0" y="58.999999999999986" width="393" height="166.66666666666663"/> + <inset key="imageEdgeInsets" minX="0.0" minY="0.0" maxX="2.2250738585072014e-308" maxY="0.0"/> + <connections> + <action selector="closeAction:" destination="iN0-l3-epB" eventType="touchUpInside" id="sJU-dJ-ta7"/> + </connections> + </button> </subviews> <viewLayoutGuide key="safeArea" id="vUN-kp-3ea"/> <color key="backgroundColor" red="0.36078431370000003" green="0.36078431370000003" blue="0.36078431370000003" alpha="0.14999999999999999" colorSpace="custom" customColorSpace="sRGB"/> <constraints> + <constraint firstItem="RIb-w0-AAo" firstAttribute="top" secondItem="vUN-kp-3ea" secondAttribute="top" id="5p4-ej-zMc"/> + <constraint firstItem="USh-pc-rFX" firstAttribute="top" secondItem="RIb-w0-AAo" secondAttribute="bottom" id="EO7-Qd-AWU"/> <constraint firstItem="USh-pc-rFX" firstAttribute="leading" secondItem="vUN-kp-3ea" secondAttribute="leading" id="WYh-EN-7oF"/> + <constraint firstItem="vUN-kp-3ea" firstAttribute="trailing" secondItem="RIb-w0-AAo" secondAttribute="trailing" id="ZQn-HF-W3Y"/> <constraint firstAttribute="bottom" secondItem="USh-pc-rFX" secondAttribute="bottom" id="ayY-u1-OKu"/> + <constraint firstItem="RIb-w0-AAo" firstAttribute="leading" secondItem="vUN-kp-3ea" secondAttribute="leading" id="id4-Yj-gvW"/> <constraint firstItem="vUN-kp-3ea" firstAttribute="trailing" secondItem="USh-pc-rFX" secondAttribute="trailing" id="qs6-ux-Wne"/> </constraints> <connections> diff --git a/XQMuse/Root/Other/View/ShareView.swift b/XQMuse/Root/Other/View/ShareView.swift index 17da856..f7ea292 100644 --- a/XQMuse/Root/Other/View/ShareView.swift +++ b/XQMuse/Root/Other/View/ShareView.swift @@ -20,6 +20,8 @@ private var title:String! private var desc:String! + private var saveAction:(()->Void)? + override func awakeFromNib() { super.awakeFromNib() @@ -32,11 +34,13 @@ btn_save.isHidden = true } - static func show(_ content:Any,title:String,desc:String){ + static func show(_ content:Any,title:String,desc:String,hasSave:Bool = false,saveAction:(()->Void)? = nil){ let shareView = ShareView.jq_loadNibView() shareView.shareContent = content shareView.title = title shareView.desc = desc + shareView.saveAction = saveAction + shareView.btn_save.isHidden = !hasSave sceneDelegate?.window?.addSubview(shareView) shareView.frame = sceneDelegate?.window?.frame ?? .zero shareView.cons_bottom.constant = 0 @@ -67,13 +71,18 @@ share() } + @IBAction func saveAction(_ sender: Any) { + saveAction?() + } + + private func share(){ if let text = shareContent as? String{ WeChatTools.shareText(text) } if let url = shareContent as? URL{ - WeChatTools.shareUrl(url.absoluteString, title: title, desc: desc, thumb:UIImage()) + WeChatTools.shareUrl(url.absoluteString, title: title, desc: desc, thumb:UIImage(named: "mini_logo")!,scene: scene) } } } diff --git a/XQMuse/Root/Other/View/ShareView.xib b/XQMuse/Root/Other/View/ShareView.xib index 3cf8d6f..2577ce4 100644 --- a/XQMuse/Root/Other/View/ShareView.xib +++ b/XQMuse/Root/Other/View/ShareView.xib @@ -113,6 +113,9 @@ <constraint firstItem="TFY-Ai-5mf" firstAttribute="top" secondItem="YWd-mA-5l0" secondAttribute="top" id="wSS-km-sdb"/> <constraint firstItem="TFY-Ai-5mf" firstAttribute="leading" secondItem="YWd-mA-5l0" secondAttribute="leading" id="ysx-fS-W3X"/> </constraints> + <connections> + <action selector="saveAction:" destination="iN0-l3-epB" eventType="touchUpInside" id="4Ab-aC-JOh"/> + </connections> </view> </subviews> <color key="backgroundColor" white="1" alpha="1" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/> @@ -202,7 +205,7 @@ </view> </objects> <resources> - <image name="btn_close" width="21.333333969116211" height="21.333333969116211"/> + <image name="btn_close" width="20" height="20"/> <image name="btn_download" width="51" height="51"/> <image name="btn_wechat_1" width="50" height="50"/> <image name="btn_wechat_fri" width="51" height="51"/> diff --git a/XQMuse/Root/PayMusicView/PayMusicVC.swift b/XQMuse/Root/PayMusicView/PayMusicVC.swift index 49a0c82..87d3bf2 100644 --- a/XQMuse/Root/PayMusicView/PayMusicVC.swift +++ b/XQMuse/Root/PayMusicView/PayMusicVC.swift @@ -28,6 +28,11 @@ class PayMusicVC: BaseVC{ + enum PayMuiscState { + case playing + case pause + } + private var coverImage:UIImageView! private var label_name:UILabel! private var btn_handle:UIButton! @@ -37,7 +42,7 @@ private var meditationModel:MeditationModel?{ didSet{ if let m = meditationModel{ - coverImage.sd_setImage(with: URL(string: m.coverUrl.jq_urlEncoded()),placeholderImage: UIImage(named: "login_top_bg")) + coverImage.sd_setImage(with: URL(string: m.coverUrl.components(separatedBy: ",").first!.jq_urlEncoded()),placeholderImage: UIImage(named: "login_top_bg")) label_name.text = m.meditationTitle } } @@ -75,6 +80,28 @@ make.centerY.equalToSuperview() } + btn_handle = UIButton(type: .custom) + btn_handle.setImage(UIImage(named: "icon_play_purse"), for: .normal) + btn_handle.setImage(UIImage(named: "icon_play_small"), for: .selected) + btn_handle.addTarget(self, action: #selector(tapHandleAction), for: .touchUpInside) + view.addSubview(btn_handle) + + btn_handleClose = UIButton(type: .custom) + btn_handleClose.setImage(UIImage(named: "icon_play_close"), for: .normal) + btn_handleClose.addTarget(self, action: #selector(closeAction), for: .touchUpInside) + view.addSubview(btn_handleClose) + + let statckView = UIStackView(arrangedSubviews: [btn_handle,btn_handleClose]) + statckView.axis = .horizontal + statckView.distribution = .equalSpacing + statckView.spacing = 18 + view.addSubview(statckView) + statckView.snp.makeConstraints { make in + make.right.equalToSuperview().offset(-24.5) + make.centerY.equalToSuperview() + make.width.equalTo(73.5) + } + label_name = UILabel() label_name.text = "--" label_name.font = .systemFont(ofSize: 14.8, weight: .bold) @@ -83,27 +110,7 @@ label_name.snp.makeConstraints { make in make.left.equalTo(self.coverImage.snp.right).offset(17.5) make.centerY.equalToSuperview() - } - - btn_handle = UIButton(type: .custom) - btn_handle.setImage(UIImage(named: "icon_play_purse"), for: .normal) - btn_handle.setImage(UIImage(named: "icon_play_small"), for: .selected) - btn_handle.addTarget(self, action: #selector(tapHandleAction), for: .touchUpInside) - view.addSubview(btn_handle) - - btn_handleClose = UIButton(type: .custom) - btn_handleClose.setImage(UIImage(named: "icon_play_close"), for: .normal) - btn_handleClose.addTarget(self, action: #selector(closeAction), for: .touchUpInside) - view.addSubview(btn_handleClose) - - let statckView = UIStackView(arrangedSubviews: [btn_handle,btn_handleClose]) - statckView.axis = .horizontal - statckView.distribution = .equalSpacing - statckView.spacing = 18 - view.addSubview(statckView) - statckView.snp.makeConstraints { make in - make.right.equalToSuperview().offset(-24.5) - make.centerY.equalToSuperview() + make.right.equalTo(statckView.snp.left) } } @@ -123,9 +130,25 @@ make.bottom.equalToSuperview().offset(-(tabBarHeight)) } vc.startRunloopAni() - } + }else{ + PayMusicVC.updateStatus(.playing) + } } } + + static func updateStatus(_ state:PayMuiscState){ + if let tabBarVC = JQ_currentViewController().navigationController?.tabBarController as? BaseTabBarVC{ + if let vc = tabBarVC.children.filter({$0 is PayMusicVC}).first as? PayMusicVC{ + vc.btn_handle.isSelected = state == .pause + switch state { + case .playing: + MPNowPlayingInfoCenter.default().playbackState = .playing + case .pause: + MPNowPlayingInfoCenter.default().playbackState = .paused + } + } + } + } static func hidden(){ if let tabBarVC = JQ_currentViewController().navigationController?.tabBarController as? BaseTabBarVC{ @@ -133,6 +156,7 @@ AudioPlayer.destroy() vc.view.removeFromSuperview() vc.removeFromParent() + MPNowPlayingInfoCenter.default().nowPlayingInfo = nil } } } @@ -169,11 +193,13 @@ self.audioPlayer.bgmPlayer?.pause() self.audioPlayer.masterPlayer?.pause() self.stopRunloopAni() + PayMusicVC.updateStatus(.pause) }else{ self.audioPlayer.bgmPlayer?.play() self.audioPlayer.masterPlayer?.play() self.audioPlayer.masterPlayer?.volume = Float(UserDefaultSettingViewModel.getSetting()?.masterVolume ?? 0.5) self.startRunloopAni() + PayMusicVC.updateStatus(.playing) } } @@ -239,7 +265,15 @@ AudioPlayer.destroy() } - func playBGMAt(firstPlayIndex:Int,model:MeditationModel,delegate:PayMusicDelegate?){ + func playBGMAt(firstPlayIndex:Int,model:MeditationModel,delegate:PayMusicDelegate?,coverImage:UIImage? = nil){ + + //清除之前的 + self.urls.removeAll() + self.masterPlayer?.pause() + self.bgmPlayer?.pause() + self.masterPlayer = nil + self.bgmPlayer = nil + self.delegate = delegate self.playIndex = firstPlayIndex self.meditationModel = model @@ -263,7 +297,6 @@ self.bgmPlayer = AVPlayer(url: self.urls[firstPlayIndex]) self.bgmPlayer?.play() - if masterUrl != nil{ self.masterPlayer = AVPlayer(url: masterUrl!) self.masterPlayer?.volume = Float(UserDefaultSettingViewModel.getSetting()?.masterVolume ?? 0.5) @@ -286,9 +319,14 @@ weakSelf.next() weakSelf.delegate?.playState(.next) }else{ - weakSelf.delegate?.playState(.end) - PayMusicVC.hidden() - MPNowPlayingInfoCenter.default().nowPlayingInfo = nil + weakSelf.bgmPlayer?.pause() + weakSelf.playIndex = 0 + weakSelf.bgmPlayer?.replaceCurrentItem(with: AVPlayerItem(url: urls[0])) + weakSelf.bgmPlayer?.play() + +// weakSelf.delegate?.playState(.end) +// PayMusicVC.hidden() +// MPNowPlayingInfoCenter.default().nowPlayingInfo = nil } } @@ -305,14 +343,16 @@ let asset = weakSelf.bgmPlayer?.currentItem?.asset dic[MPMediaItemPropertyPlaybackDuration] = CMTimeGetSeconds(asset!.duration) dic[MPMediaItemPropertyArtwork] = MPMediaItemArtwork(boundsSize: CGSize(width: 50, height: 50), requestHandler: { s in - return UIImage(named: "home_top_bg")! + + if let coverImage{ + return coverImage + }else{ + return UIImage(named: "home_top_bg")! + } }) MPNowPlayingInfoCenter.default().nowPlayingInfo = dic } } - - //播放完成 -// NotificationCenter.default.addObserver(self, selector: #selector(playbackEnd), name:NSNotification.Name.AVPlayerItemDidPlayToEndTime, object: nil) setLockScreen() @@ -326,6 +366,12 @@ } } + func setBGMRate(value:CGFloat){ + if let v = bgmPlayer?.currentItem?.duration.timescale,v > 0{ + bgmPlayer?.seek(to: CMTime(seconds: value, preferredTimescale: v)) + } + } + /// 播放场景音乐 func playSceneAt(_ url:String){ guard let URL = URL(string: url) else { return } @@ -336,13 +382,13 @@ }else{ scenePlayer?.replaceCurrentItem(with: AVPlayerItem(url: URL)) } - DispatchQueue.main.asyncAfter(delay: 3.0) { + DispatchQueue.main.asyncAfter(delay: 0.5) { self.scenePlayer?.play() self.scenePlayer?.volume = Float(UserDefaultSettingViewModel.getSetting()?.volume ?? 0.5) } //播放完成 -// NotificationCenter.default.addObserver(self, selector: #selector(playBGMbackEnd), name:NSNotification.Name.AVPlayerItemDidPlayToEndTime, object: nil) + NotificationCenter.default.addObserver(self, selector: #selector(playBGMbackEnd), name:NSNotification.Name.AVPlayerItemDidPlayToEndTime, object: nil) } func dellocScene(){ @@ -402,12 +448,14 @@ // 播放 center.playCommand.addTarget {[unowned self] event in self.bgmPlayer?.play() + PayMusicVC.updateStatus(.playing) return .success } // 暂停 center.pauseCommand.addTarget {[unowned self] event in self.bgmPlayer?.pause() + PayMusicVC.updateStatus(.pause) return .success } diff --git a/XQMuse/Root/Plans/PlanGuideVC.swift b/XQMuse/Root/Plans/PlanGuideVC.swift index 3fb11b0..b099f4d 100644 --- a/XQMuse/Root/Plans/PlanGuideVC.swift +++ b/XQMuse/Root/Plans/PlanGuideVC.swift @@ -65,14 +65,14 @@ override func viewWillAppear(_ animated: Bool) { super.viewWillAppear(animated) - player.play() - bgplayer.play() + if player.actionAtItemEnd == .pause{ + player.play() + } } override func viewDidDisappear(_ animated: Bool) { super.viewDidDisappear(animated) player.pause() -// bgplayer.pause() } override func setUI() { diff --git a/XQMuse/Root/TreeGroup/TCell/TreeTeskEnergyExchangeRecordTCell.swift b/XQMuse/Root/TreeGroup/TCell/TreeTeskEnergyExchangeRecordTCell.swift index 9c12e30..0754ef6 100644 --- a/XQMuse/Root/TreeGroup/TCell/TreeTeskEnergyExchangeRecordTCell.swift +++ b/XQMuse/Root/TreeGroup/TCell/TreeTeskEnergyExchangeRecordTCell.swift @@ -33,10 +33,10 @@ image_cover.sd_setImage(with: URL(string: model.coverUrl.jq_urlEncoded())) label_price.text = String(format: "奖品价值:¥%.2lf", model.worth) label_energy.text = "所需能量值:\(model.energyValue)" - label_state.text = model.status == .yes ? "已领取":"待领取" - view_state.backgroundColor = model.status == .yes ? UIColor(hexString: "#B1CA99")! : UIColor(hexString: "#D0D0D0")! + label_state.text = model.status == .no ? "已领取":"待领取" + view_state.backgroundColor = model.status == .no ? UIColor(hexString: "#B1CA99")! : UIColor(hexString: "#D0D0D0")! - view_code.isHidden = model.code.isEmpty || model.status == .yes + view_code.isHidden = model.code.isEmpty || model.status == .no label_code.text = "领取验证码:\(model.code)" } diff --git a/XQMuse/Root/TreeGroup/TreeTeskVC.swift b/XQMuse/Root/TreeGroup/TreeTeskVC.swift index 76ca601..09abd50 100644 --- a/XQMuse/Root/TreeGroup/TreeTeskVC.swift +++ b/XQMuse/Root/TreeGroup/TreeTeskVC.swift @@ -174,7 +174,7 @@ } private func updateTreeInfo(){ - btn_seedingAgain.isHidden = treeInfoModel!.sowAgain == .no + btn_seedingAgain.isHidden = treeInfoModel!.treeLevelType != .level_10 // if treeLevel.rawValue != treeInfoModel?.treeLevelType.rawValue{ // treeLevel = treeInfoModel!.treeLevelType @@ -182,6 +182,16 @@ icon_energy.text = String(format: "当前能量值:%ld", treeInfoModel!.energyValue) setProgress(current: treeInfoModel!.growthValue, total: treeInfoModel!.nextLevel) } + + @IBAction func sowAgainAction(_ sender: UIButton) { + Services.sowAgain().subscribe(onNext: {[weak self] _ in + self?.getTreeData() + if let soundURL = URL(string:TreeLevel.level_1.sound){ + self?.voicePlayer.replaceCurrentItem(with: AVPlayerItem(url: soundURL)) + self?.voicePlayer.play() + } + }).disposed(by: disposeBag) + } override func setRx() { NotificationCenter.default.addObserver(forName: .AVPlayerItemDidPlayToEndTime, object: nil, queue: nil) { [weak self] _ in @@ -239,6 +249,10 @@ // 0 - 100 private func setProgress(current:Int,total:Int){ + guard total != 0 else { + self.label_progress.attributedText = AttributedStringbuilder.build().add(string: "0", withFont: .systemFont(ofSize: 12, weight: .bold), withColor: .white, indent: 0, lineSpace: 0).add(string: "\n/NAN", withFont: .systemFont(ofSize: 11,weight: .thin), withColor: .white).mutableAttributedString + return + } let pix = view_progressTotal.height / Double(total) let px = Double(current) * pix diff --git a/XQMuse/Root/TreeGroup/TreeTeskVC.xib b/XQMuse/Root/TreeGroup/TreeTeskVC.xib index a78fab8..bbd7d94 100644 --- a/XQMuse/Root/TreeGroup/TreeTeskVC.xib +++ b/XQMuse/Root/TreeGroup/TreeTeskVC.xib @@ -1,9 +1,9 @@ <?xml version="1.0" encoding="UTF-8"?> -<document type="com.apple.InterfaceBuilder3.CocoaTouch.XIB" version="3.0" toolsVersion="32700.99.1234" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" useSafeAreas="YES" colorMatched="YES"> +<document type="com.apple.InterfaceBuilder3.CocoaTouch.XIB" version="3.0" toolsVersion="23094" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" useSafeAreas="YES" colorMatched="YES"> <device id="retina6_12" orientation="portrait" appearance="light"/> <dependencies> <deployment identifier="iOS"/> - <plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="22685"/> + <plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="23084"/> <capability name="Safe area layout guides" minToolsVersion="9.0"/> <capability name="System colors in document resources" minToolsVersion="11.0"/> <capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/> @@ -37,7 +37,7 @@ <rect key="frame" x="0.0" y="0.0" width="35" height="35"/> </imageView> <label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="礼品兑换" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="u3e-Oh-9NT"> - <rect key="frame" x="38" y="9" width="57.333333333333343" height="17"/> + <rect key="frame" x="38" y="9" width="55.666666666666657" height="17"/> <fontDescription key="fontDescription" type="system" weight="medium" pointSize="14"/> <color key="textColor" red="1" green="1" blue="1" alpha="1" colorSpace="calibratedRGB"/> <nil key="highlightedColor"/> @@ -66,13 +66,13 @@ </connections> </button> <view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="fz4-8h-sWT" customClass="TapBtn" customModule="XQMuse" customModuleProvider="target"> - <rect key="frame" x="13.999999999999993" y="79" width="119.33333333333331" height="35"/> + <rect key="frame" x="14.000000000000007" y="79" width="117.66666666666669" height="35"/> <subviews> <imageView clipsSubviews="YES" userInteractionEnabled="NO" contentMode="scaleAspectFit" horizontalHuggingPriority="251" verticalHuggingPriority="251" image="icon_energy" translatesAutoresizingMaskIntoConstraints="NO" id="HhA-mI-eXr"> <rect key="frame" x="0.0" y="0.0" width="35" height="35"/> </imageView> <label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="当前能量值:0" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="9Xg-17-kuV"> - <rect key="frame" x="37.999999999999993" y="10.333333333333329" width="81.333333333333314" height="14.333333333333336"/> + <rect key="frame" x="38.000000000000007" y="10.333333333333329" width="79.666666666666686" height="14.333333333333336"/> <fontDescription key="fontDescription" type="system" weight="medium" pointSize="12"/> <color key="textColor" red="0.46274509800000002" green="0.5568627451" blue="0.37647058820000001" alpha="1" colorSpace="calibratedRGB"/> <nil key="highlightedColor"/> @@ -192,6 +192,9 @@ <real key="value" value="1"/> </userDefinedRuntimeAttribute> </userDefinedRuntimeAttributes> + <connections> + <action selector="sowAgainAction:" destination="-1" eventType="touchUpInside" id="HBk-Se-NxL"/> + </connections> </button> </subviews> <viewLayoutGuide key="safeArea" id="fnl-2z-Ty3"/> diff --git a/XQMuse/Root/TreeGroup/VC/TreeTeskEnergyExchangeVC.swift b/XQMuse/Root/TreeGroup/VC/TreeTeskEnergyExchangeVC.swift index 04ef4a6..1af0033 100644 --- a/XQMuse/Root/TreeGroup/VC/TreeTeskEnergyExchangeVC.swift +++ b/XQMuse/Root/TreeGroup/VC/TreeTeskEnergyExchangeVC.swift @@ -33,10 +33,7 @@ viewModel.configure(tableView) viewModel.beginRefresh() - Services.getTotalEnergy().subscribe(onNext: {[weak self] data in - self?.viewModel.energyValue.accept(data.data ?? 0) - self?.label_energy.text = "\(data.data ?? 0)" - }).disposed(by: disposeBag) + getData() Services.getCustomerCode().subscribe(onNext: {[weak self] data in self?.image_qrCode.sd_setImage(with: URL(string: data.data ?? "")) @@ -63,6 +60,13 @@ tableView.separatorStyle = .none tableView.register(UINib(nibName: "TreeTeskEnergyTCell", bundle: nil), forCellReuseIdentifier: "_TreeTeskEnergyTCell") } + + private func getData(){ + Services.getTotalEnergy().subscribe(onNext: {[weak self] data in + self?.viewModel.energyValue.accept(data.data ?? 0) + self?.label_energy.text = "\(data.data ?? 0)" + }).disposed(by: disposeBag) + } @objc func exchangeRecordAction(){ let vc = TreeTeskEnergyExchangeRecordVC() @@ -107,6 +111,7 @@ Services.exchangeGift(prizeId: m.id).subscribe(onNext: {data in TreeTeskExchangeSuccessView.show(code: data.data ?? "",customerImage: self.image_qrCode.image ?? UIImage()) self.viewModel.beginRefresh() + self.getData() }).disposed(by: self.disposeBag) } } diff --git a/XQMuse/Root/TreeGroup/View/TreeTeskExchangeSuccessView.swift b/XQMuse/Root/TreeGroup/View/TreeTeskExchangeSuccessView.swift index 5ae9443..a90637c 100644 --- a/XQMuse/Root/TreeGroup/View/TreeTeskExchangeSuccessView.swift +++ b/XQMuse/Root/TreeGroup/View/TreeTeskExchangeSuccessView.swift @@ -12,6 +12,7 @@ @IBOutlet weak var view_container: UIView! @IBOutlet weak var image_qrCode: UIImageView! @IBOutlet weak var label_code: UILabel! + @IBOutlet weak var btn_known: UIButton! override func awakeFromNib() { super.awakeFromNib() @@ -39,6 +40,11 @@ } } + override func layoutSubviews() { + super.layoutSubviews() + btn_known.localGradientColor(cornerRadius: 20) + } + @objc private func longPressCopyAction(_ gesture:UILongPressGestureRecognizer){ if gesture.state == .began{ if let img = image_qrCode.image{ diff --git a/XQMuse/Root/TreeGroup/View/TreeTeskExchangeSuccessView.xib b/XQMuse/Root/TreeGroup/View/TreeTeskExchangeSuccessView.xib index 31fce08..36344bf 100644 --- a/XQMuse/Root/TreeGroup/View/TreeTeskExchangeSuccessView.xib +++ b/XQMuse/Root/TreeGroup/View/TreeTeskExchangeSuccessView.xib @@ -120,6 +120,7 @@ <constraint firstItem="4ru-7s-yUN" firstAttribute="centerX" secondItem="iN0-l3-epB" secondAttribute="centerX" id="zt7-Tt-vce"/> </constraints> <connections> + <outlet property="btn_known" destination="h25-4Z-I8T" id="Cms-nO-DiU"/> <outlet property="image_qrCode" destination="GQk-cT-1IF" id="U2k-zg-3wi"/> <outlet property="label_code" destination="psN-sL-6pq" id="IdT-sk-KdH"/> <outlet property="view_container" destination="4ru-7s-yUN" id="C6v-VX-yVc"/> diff --git a/XQMuse/SceneDelegate.swift b/XQMuse/SceneDelegate.swift index 6215f3d..9559df3 100644 --- a/XQMuse/SceneDelegate.swift +++ b/XQMuse/SceneDelegate.swift @@ -95,19 +95,28 @@ if let m = model{ WeChatTools.getUserInfo(access_token: m.access_token, openId: m.openid) { userInfoModel in if let u = userInfoModel{ - Services.loginByWechat(headImgUrl: u.headimgurl, nickname: u.nickname, sex: u.sex, wxOpenId: u.openid).subscribe(onNext: {data in - if let model = data.data{ - sceneDelegate?.loginSuccess() - JQ_currentViewController().dismiss(animated:true) - UserViewModel.saveLoginInfo(model) + if UserViewModel.getToken()?.isEmpty ?? true{ + Services.loginByWechat(headImgUrl: u.headimgurl, nickname: u.nickname, sex: u.sex, wxOpenId: u.openid).subscribe(onNext: {data in + if let model = data.data{ + sceneDelegate?.loginSuccess() + JQ_currentViewController().dismiss(animated:true) + UserViewModel.saveLoginInfo(model) - Services.getUserInfo().subscribe(onNext: {data in - if let model = data.data{ - UserViewModel.saveAvatarInfo(model) - } - }).disposed(by: JQ_disposeBag) - } - }).disposed(by: JQ_disposeBag) + Services.getUserInfo().subscribe(onNext: {data in + if let model = data.data{ + UserViewModel.saveAvatarInfo(model) + } + }).disposed(by: JQ_disposeBag) + } + }).disposed(by: JQ_disposeBag) + }else{ + + +// NotificationCenter.default.post(name: BindWechat_Noti, object: nil) +// let v = UserViewModel.getAvatarInfo() +// v.wxOpenId = u.openid +// UserViewModel.saveAvatarInfo(v) + } }else{ alertError(msg: "获取信息失败") } -- Gitblit v1.7.1