Commit 9a46072bc180dd54e236a0066f54f803eb9ebd2e
1 parent
48fb7a35
新首页专辑
Showing
18 changed files
with
1819 additions
and
18 deletions
metaCode.xcodeproj/project.pbxproj
| @@ -75,6 +75,21 @@ | @@ -75,6 +75,21 @@ | ||
| 75 | 1926C28F2AE0D76C00C71DC3 /* CNLiveDownSlideViewModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = 1926C28E2AE0D76C00C71DC3 /* CNLiveDownSlideViewModel.swift */; }; | 75 | 1926C28F2AE0D76C00C71DC3 /* CNLiveDownSlideViewModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = 1926C28E2AE0D76C00C71DC3 /* CNLiveDownSlideViewModel.swift */; }; |
| 76 | 1926C2912AE0FD4500C71DC3 /* CNLiveDownSlideModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = 1926C2902AE0FD4500C71DC3 /* CNLiveDownSlideModel.swift */; }; | 76 | 1926C2912AE0FD4500C71DC3 /* CNLiveDownSlideModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = 1926C2902AE0FD4500C71DC3 /* CNLiveDownSlideModel.swift */; }; |
| 77 | 1938BD172B3D6C7F00390A34 /* CNLiveAuthViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 1938BD162B3D6C7F00390A34 /* CNLiveAuthViewController.swift */; }; | 77 | 1938BD172B3D6C7F00390A34 /* CNLiveAuthViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 1938BD162B3D6C7F00390A34 /* CNLiveAuthViewController.swift */; }; |
| 78 | + 1938BD202B46799A00390A34 /* CNLivePlayletHomePageController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 1938BD1F2B46799A00390A34 /* CNLivePlayletHomePageController.swift */; }; | ||
| 79 | + 1938BD222B467C1700390A34 /* CNLivePlayletHomePageCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = 1938BD212B467C1700390A34 /* CNLivePlayletHomePageCell.swift */; }; | ||
| 80 | + 1938BD242B468AC900390A34 /* CNLivePlayletHomePageHeaderCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = 1938BD232B468AC900390A34 /* CNLivePlayletHomePageHeaderCell.swift */; }; | ||
| 81 | + 1938BD262B479D3400390A34 /* UILabel+FormattedText.swift in Sources */ = {isa = PBXBuildFile; fileRef = 1938BD252B479D3400390A34 /* UILabel+FormattedText.swift */; }; | ||
| 82 | + 1938BD2A2B48014E00390A34 /* CNHomepageDetailViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 1938BD292B48014E00390A34 /* CNHomepageDetailViewController.swift */; }; | ||
| 83 | + 1938BD2C2B4801A700390A34 /* CNHomePageAnimationTransition.swift in Sources */ = {isa = PBXBuildFile; fileRef = 1938BD2B2B4801A700390A34 /* CNHomePageAnimationTransition.swift */; }; | ||
| 84 | + 1938BD2E2B48021E00390A34 /* CNHomePageBaseNavigationController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 1938BD2D2B48021E00390A34 /* CNHomePageBaseNavigationController.swift */; }; | ||
| 85 | + 1938BD302B4B8A3500390A34 /* CNLiveHomePageViewModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = 1938BD2F2B4B8A3500390A34 /* CNLiveHomePageViewModel.swift */; }; | ||
| 86 | + 1938BD322B4B8F0400390A34 /* CNLiveHomePageModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = 1938BD312B4B8F0400390A34 /* CNLiveHomePageModel.swift */; }; | ||
| 87 | + 1938BD342B4B968300390A34 /* CNLiveHomePageDuanJuCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = 1938BD332B4B968300390A34 /* CNLiveHomePageDuanJuCell.swift */; }; | ||
| 88 | + 1938BD362B4BCC7F00390A34 /* CNLiveAlbumModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = 1938BD352B4BCC7F00390A34 /* CNLiveAlbumModel.swift */; }; | ||
| 89 | + 1938BD382B4BDC2500390A34 /* CNLiveAlbumImageCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = 1938BD372B4BDC2500390A34 /* CNLiveAlbumImageCell.swift */; }; | ||
| 90 | + 1938BD3D2B4BDD4B00390A34 /* CNLiveAlbumCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = 1938BD3C2B4BDD4B00390A34 /* CNLiveAlbumCell.swift */; }; | ||
| 91 | + 1938BD3F2B4BE7C500390A34 /* CNLiveAlbumMsgModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = 1938BD3E2B4BE7C500390A34 /* CNLiveAlbumMsgModel.swift */; }; | ||
| 92 | + 1938BD412B4BEC6900390A34 /* CNLiveAlbumListModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = 1938BD402B4BEC6900390A34 /* CNLiveAlbumListModel.swift */; }; | ||
| 78 | 19565EC02AF4DE0E007D6727 /* CNLiveShopDetailBtnsCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = 19565EBF2AF4DE0E007D6727 /* CNLiveShopDetailBtnsCell.swift */; }; | 93 | 19565EC02AF4DE0E007D6727 /* CNLiveShopDetailBtnsCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = 19565EBF2AF4DE0E007D6727 /* CNLiveShopDetailBtnsCell.swift */; }; |
| 79 | 19565EC22AF616CA007D6727 /* CNLiveShopDetailOrderAssetCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = 19565EC12AF616CA007D6727 /* CNLiveShopDetailOrderAssetCell.swift */; }; | 94 | 19565EC22AF616CA007D6727 /* CNLiveShopDetailOrderAssetCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = 19565EC12AF616CA007D6727 /* CNLiveShopDetailOrderAssetCell.swift */; }; |
| 80 | 19565EC52AF8AD1F007D6727 /* CNLiveShopProductManagerController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 19565EC42AF8AD1F007D6727 /* CNLiveShopProductManagerController.swift */; }; | 95 | 19565EC52AF8AD1F007D6727 /* CNLiveShopProductManagerController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 19565EC42AF8AD1F007D6727 /* CNLiveShopProductManagerController.swift */; }; |
| @@ -312,6 +327,21 @@ | @@ -312,6 +327,21 @@ | ||
| 312 | 1926C28E2AE0D76C00C71DC3 /* CNLiveDownSlideViewModel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CNLiveDownSlideViewModel.swift; sourceTree = "<group>"; }; | 327 | 1926C28E2AE0D76C00C71DC3 /* CNLiveDownSlideViewModel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CNLiveDownSlideViewModel.swift; sourceTree = "<group>"; }; |
| 313 | 1926C2902AE0FD4500C71DC3 /* CNLiveDownSlideModel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CNLiveDownSlideModel.swift; sourceTree = "<group>"; }; | 328 | 1926C2902AE0FD4500C71DC3 /* CNLiveDownSlideModel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CNLiveDownSlideModel.swift; sourceTree = "<group>"; }; |
| 314 | 1938BD162B3D6C7F00390A34 /* CNLiveAuthViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CNLiveAuthViewController.swift; sourceTree = "<group>"; }; | 329 | 1938BD162B3D6C7F00390A34 /* CNLiveAuthViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CNLiveAuthViewController.swift; sourceTree = "<group>"; }; |
| 330 | + 1938BD1F2B46799A00390A34 /* CNLivePlayletHomePageController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CNLivePlayletHomePageController.swift; sourceTree = "<group>"; }; | ||
| 331 | + 1938BD212B467C1700390A34 /* CNLivePlayletHomePageCell.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CNLivePlayletHomePageCell.swift; sourceTree = "<group>"; }; | ||
| 332 | + 1938BD232B468AC900390A34 /* CNLivePlayletHomePageHeaderCell.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CNLivePlayletHomePageHeaderCell.swift; sourceTree = "<group>"; }; | ||
| 333 | + 1938BD252B479D3400390A34 /* UILabel+FormattedText.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "UILabel+FormattedText.swift"; sourceTree = "<group>"; }; | ||
| 334 | + 1938BD292B48014E00390A34 /* CNHomepageDetailViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CNHomepageDetailViewController.swift; sourceTree = "<group>"; }; | ||
| 335 | + 1938BD2B2B4801A700390A34 /* CNHomePageAnimationTransition.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CNHomePageAnimationTransition.swift; sourceTree = "<group>"; }; | ||
| 336 | + 1938BD2D2B48021E00390A34 /* CNHomePageBaseNavigationController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CNHomePageBaseNavigationController.swift; sourceTree = "<group>"; }; | ||
| 337 | + 1938BD2F2B4B8A3500390A34 /* CNLiveHomePageViewModel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CNLiveHomePageViewModel.swift; sourceTree = "<group>"; }; | ||
| 338 | + 1938BD312B4B8F0400390A34 /* CNLiveHomePageModel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CNLiveHomePageModel.swift; sourceTree = "<group>"; }; | ||
| 339 | + 1938BD332B4B968300390A34 /* CNLiveHomePageDuanJuCell.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CNLiveHomePageDuanJuCell.swift; sourceTree = "<group>"; }; | ||
| 340 | + 1938BD352B4BCC7F00390A34 /* CNLiveAlbumModel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CNLiveAlbumModel.swift; sourceTree = "<group>"; }; | ||
| 341 | + 1938BD372B4BDC2500390A34 /* CNLiveAlbumImageCell.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CNLiveAlbumImageCell.swift; sourceTree = "<group>"; }; | ||
| 342 | + 1938BD3C2B4BDD4B00390A34 /* CNLiveAlbumCell.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CNLiveAlbumCell.swift; sourceTree = "<group>"; }; | ||
| 343 | + 1938BD3E2B4BE7C500390A34 /* CNLiveAlbumMsgModel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CNLiveAlbumMsgModel.swift; sourceTree = "<group>"; }; | ||
| 344 | + 1938BD402B4BEC6900390A34 /* CNLiveAlbumListModel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CNLiveAlbumListModel.swift; sourceTree = "<group>"; }; | ||
| 315 | 19565EBF2AF4DE0E007D6727 /* CNLiveShopDetailBtnsCell.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CNLiveShopDetailBtnsCell.swift; sourceTree = "<group>"; }; | 345 | 19565EBF2AF4DE0E007D6727 /* CNLiveShopDetailBtnsCell.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CNLiveShopDetailBtnsCell.swift; sourceTree = "<group>"; }; |
| 316 | 19565EC12AF616CA007D6727 /* CNLiveShopDetailOrderAssetCell.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CNLiveShopDetailOrderAssetCell.swift; sourceTree = "<group>"; }; | 346 | 19565EC12AF616CA007D6727 /* CNLiveShopDetailOrderAssetCell.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CNLiveShopDetailOrderAssetCell.swift; sourceTree = "<group>"; }; |
| 317 | 19565EC42AF8AD1F007D6727 /* CNLiveShopProductManagerController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CNLiveShopProductManagerController.swift; sourceTree = "<group>"; }; | 347 | 19565EC42AF8AD1F007D6727 /* CNLiveShopProductManagerController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CNLiveShopProductManagerController.swift; sourceTree = "<group>"; }; |
| @@ -610,6 +640,7 @@ | @@ -610,6 +640,7 @@ | ||
| 610 | 1938BD122B3D6C4700390A34 /* ViewModel */ = { | 640 | 1938BD122B3D6C4700390A34 /* ViewModel */ = { |
| 611 | isa = PBXGroup; | 641 | isa = PBXGroup; |
| 612 | children = ( | 642 | children = ( |
| 643 | + 1938BD2F2B4B8A3500390A34 /* CNLiveHomePageViewModel.swift */, | ||
| 613 | ); | 644 | ); |
| 614 | path = ViewModel; | 645 | path = ViewModel; |
| 615 | sourceTree = "<group>"; | 646 | sourceTree = "<group>"; |
| @@ -617,6 +648,10 @@ | @@ -617,6 +648,10 @@ | ||
| 617 | 1938BD132B3D6C5700390A34 /* Model */ = { | 648 | 1938BD132B3D6C5700390A34 /* Model */ = { |
| 618 | isa = PBXGroup; | 649 | isa = PBXGroup; |
| 619 | children = ( | 650 | children = ( |
| 651 | + 1938BD312B4B8F0400390A34 /* CNLiveHomePageModel.swift */, | ||
| 652 | + 1938BD352B4BCC7F00390A34 /* CNLiveAlbumModel.swift */, | ||
| 653 | + 1938BD3E2B4BE7C500390A34 /* CNLiveAlbumMsgModel.swift */, | ||
| 654 | + 1938BD402B4BEC6900390A34 /* CNLiveAlbumListModel.swift */, | ||
| 620 | ); | 655 | ); |
| 621 | path = Model; | 656 | path = Model; |
| 622 | sourceTree = "<group>"; | 657 | sourceTree = "<group>"; |
| @@ -624,6 +659,9 @@ | @@ -624,6 +659,9 @@ | ||
| 624 | 1938BD142B3D6C5C00390A34 /* View */ = { | 659 | 1938BD142B3D6C5C00390A34 /* View */ = { |
| 625 | isa = PBXGroup; | 660 | isa = PBXGroup; |
| 626 | children = ( | 661 | children = ( |
| 662 | + 1938BD3B2B4BDC5700390A34 /* PlayletHomePage */, | ||
| 663 | + 1938BD3A2B4BDC4200390A34 /* HomePage */, | ||
| 664 | + 1938BD392B4BDC2900390A34 /* HomepageDetail */, | ||
| 627 | ); | 665 | ); |
| 628 | path = View; | 666 | path = View; |
| 629 | sourceTree = "<group>"; | 667 | sourceTree = "<group>"; |
| @@ -631,7 +669,8 @@ | @@ -631,7 +669,8 @@ | ||
| 631 | 1938BD152B3D6C6000390A34 /* Controller */ = { | 669 | 1938BD152B3D6C6000390A34 /* Controller */ = { |
| 632 | isa = PBXGroup; | 670 | isa = PBXGroup; |
| 633 | children = ( | 671 | children = ( |
| 634 | - 1938BD162B3D6C7F00390A34 /* CNLiveAuthViewController.swift */, | 672 | + 1938BD272B48009600390A34 /* AuthController */, |
| 673 | + 1938BD1D2B46791400390A34 /* PlayletHomePage */, | ||
| 635 | ); | 674 | ); |
| 636 | path = Controller; | 675 | path = Controller; |
| 637 | sourceTree = "<group>"; | 676 | sourceTree = "<group>"; |
| @@ -679,6 +718,59 @@ | @@ -679,6 +718,59 @@ | ||
| 679 | path = WebController; | 718 | path = WebController; |
| 680 | sourceTree = "<group>"; | 719 | sourceTree = "<group>"; |
| 681 | }; | 720 | }; |
| 721 | + 1938BD1D2B46791400390A34 /* PlayletHomePage */ = { | ||
| 722 | + isa = PBXGroup; | ||
| 723 | + children = ( | ||
| 724 | + 1938BD1F2B46799A00390A34 /* CNLivePlayletHomePageController.swift */, | ||
| 725 | + ); | ||
| 726 | + path = PlayletHomePage; | ||
| 727 | + sourceTree = "<group>"; | ||
| 728 | + }; | ||
| 729 | + 1938BD272B48009600390A34 /* AuthController */ = { | ||
| 730 | + isa = PBXGroup; | ||
| 731 | + children = ( | ||
| 732 | + 1938BD282B4800E500390A34 /* push相关 */, | ||
| 733 | + 1938BD162B3D6C7F00390A34 /* CNLiveAuthViewController.swift */, | ||
| 734 | + ); | ||
| 735 | + path = AuthController; | ||
| 736 | + sourceTree = "<group>"; | ||
| 737 | + }; | ||
| 738 | + 1938BD282B4800E500390A34 /* push相关 */ = { | ||
| 739 | + isa = PBXGroup; | ||
| 740 | + children = ( | ||
| 741 | + 1938BD292B48014E00390A34 /* CNHomepageDetailViewController.swift */, | ||
| 742 | + 1938BD2B2B4801A700390A34 /* CNHomePageAnimationTransition.swift */, | ||
| 743 | + 1938BD2D2B48021E00390A34 /* CNHomePageBaseNavigationController.swift */, | ||
| 744 | + ); | ||
| 745 | + path = "push相关"; | ||
| 746 | + sourceTree = "<group>"; | ||
| 747 | + }; | ||
| 748 | + 1938BD392B4BDC2900390A34 /* HomepageDetail */ = { | ||
| 749 | + isa = PBXGroup; | ||
| 750 | + children = ( | ||
| 751 | + 1938BD372B4BDC2500390A34 /* CNLiveAlbumImageCell.swift */, | ||
| 752 | + 1938BD3C2B4BDD4B00390A34 /* CNLiveAlbumCell.swift */, | ||
| 753 | + ); | ||
| 754 | + path = HomepageDetail; | ||
| 755 | + sourceTree = "<group>"; | ||
| 756 | + }; | ||
| 757 | + 1938BD3A2B4BDC4200390A34 /* HomePage */ = { | ||
| 758 | + isa = PBXGroup; | ||
| 759 | + children = ( | ||
| 760 | + 1938BD332B4B968300390A34 /* CNLiveHomePageDuanJuCell.swift */, | ||
| 761 | + ); | ||
| 762 | + path = HomePage; | ||
| 763 | + sourceTree = "<group>"; | ||
| 764 | + }; | ||
| 765 | + 1938BD3B2B4BDC5700390A34 /* PlayletHomePage */ = { | ||
| 766 | + isa = PBXGroup; | ||
| 767 | + children = ( | ||
| 768 | + 1938BD212B467C1700390A34 /* CNLivePlayletHomePageCell.swift */, | ||
| 769 | + 1938BD232B468AC900390A34 /* CNLivePlayletHomePageHeaderCell.swift */, | ||
| 770 | + ); | ||
| 771 | + path = PlayletHomePage; | ||
| 772 | + sourceTree = "<group>"; | ||
| 773 | + }; | ||
| 682 | 19565EC32AF8ACC2007D6727 /* GoodsManager */ = { | 774 | 19565EC32AF8ACC2007D6727 /* GoodsManager */ = { |
| 683 | isa = PBXGroup; | 775 | isa = PBXGroup; |
| 684 | children = ( | 776 | children = ( |
| @@ -797,6 +889,7 @@ | @@ -797,6 +889,7 @@ | ||
| 797 | 191732E62B0615C1007BCC04 /* UIScrollView+CNLiveExtensions.swift */, | 889 | 191732E62B0615C1007BCC04 /* UIScrollView+CNLiveExtensions.swift */, |
| 798 | 191733032B0F216E007BCC04 /* NSDictionary+CNLiveExtensions.swift */, | 890 | 191733032B0F216E007BCC04 /* NSDictionary+CNLiveExtensions.swift */, |
| 799 | 191733092B10864F007BCC04 /* Array+CNLiveExtensions.swift */, | 891 | 191733092B10864F007BCC04 /* Array+CNLiveExtensions.swift */, |
| 892 | + 1938BD252B479D3400390A34 /* UILabel+FormattedText.swift */, | ||
| 800 | ); | 893 | ); |
| 801 | path = Extensions; | 894 | path = Extensions; |
| 802 | sourceTree = "<group>"; | 895 | sourceTree = "<group>"; |
| @@ -1502,12 +1595,14 @@ | @@ -1502,12 +1595,14 @@ | ||
| 1502 | 191732F32B084DBC007BCC04 /* CNLiveShopClassifySwitchTableViewCell.swift in Sources */, | 1595 | 191732F32B084DBC007BCC04 /* CNLiveShopClassifySwitchTableViewCell.swift in Sources */, |
| 1503 | 191732E72B0615C1007BCC04 /* UIScrollView+CNLiveExtensions.swift in Sources */, | 1596 | 191732E72B0615C1007BCC04 /* UIScrollView+CNLiveExtensions.swift in Sources */, |
| 1504 | 1917328E2B032583007BCC04 /* CNLiveRoundedRectView.swift in Sources */, | 1597 | 1917328E2B032583007BCC04 /* CNLiveRoundedRectView.swift in Sources */, |
| 1598 | + 1938BD2E2B48021E00390A34 /* CNHomePageBaseNavigationController.swift in Sources */, | ||
| 1505 | 1917332F2B16C7C9007BCC04 /* CNLiveTimer.swift in Sources */, | 1599 | 1917332F2B16C7C9007BCC04 /* CNLiveTimer.swift in Sources */, |
| 1506 | 7CD675292A270F6A008354C1 /* WJColorChange.m in Sources */, | 1600 | 7CD675292A270F6A008354C1 /* WJColorChange.m in Sources */, |
| 1507 | 1938BD172B3D6C7F00390A34 /* CNLiveAuthViewController.swift in Sources */, | 1601 | 1938BD172B3D6C7F00390A34 /* CNLiveAuthViewController.swift in Sources */, |
| 1508 | 79F4B11C2A33036E00993C03 /* CNLiveMineInfoAlertView.swift in Sources */, | 1602 | 79F4B11C2A33036E00993C03 /* CNLiveMineInfoAlertView.swift in Sources */, |
| 1509 | 79BB96A82AF223FB00AEA4AC /* CNLiveConfigAlertManager.swift in Sources */, | 1603 | 79BB96A82AF223FB00AEA4AC /* CNLiveConfigAlertManager.swift in Sources */, |
| 1510 | 19BB1FF02AF0E5B30094D962 /* CNLiveShopDetailModel.swift in Sources */, | 1604 | 19BB1FF02AF0E5B30094D962 /* CNLiveShopDetailModel.swift in Sources */, |
| 1605 | + 1938BD382B4BDC2500390A34 /* CNLiveAlbumImageCell.swift in Sources */, | ||
| 1511 | 796398942A260C0100D045EB /* AppDelegate.swift in Sources */, | 1606 | 796398942A260C0100D045EB /* AppDelegate.swift in Sources */, |
| 1512 | 1917330D2B1096AB007BCC04 /* CNLivePlayerViewController.swift in Sources */, | 1607 | 1917330D2B1096AB007BCC04 /* CNLivePlayerViewController.swift in Sources */, |
| 1513 | 1917330F2B10989C007BCC04 /* CNLivePlayerView.swift in Sources */, | 1608 | 1917330F2B10989C007BCC04 /* CNLivePlayerView.swift in Sources */, |
| @@ -1536,12 +1631,15 @@ | @@ -1536,12 +1631,15 @@ | ||
| 1536 | 19BB202B2AF382150094D962 /* CNLiveAdaptTool.swift in Sources */, | 1631 | 19BB202B2AF382150094D962 /* CNLiveAdaptTool.swift in Sources */, |
| 1537 | 79E672032AFDFA9C00F2F768 /* CNLiveMineSignOutViewController.swift in Sources */, | 1632 | 79E672032AFDFA9C00F2F768 /* CNLiveMineSignOutViewController.swift in Sources */, |
| 1538 | 19565ECD2AF8D256007D6727 /* CNLiveShopGoodsListClassifyView.swift in Sources */, | 1633 | 19565ECD2AF8D256007D6727 /* CNLiveShopGoodsListClassifyView.swift in Sources */, |
| 1634 | + 1938BD322B4B8F0400390A34 /* CNLiveHomePageModel.swift in Sources */, | ||
| 1539 | 191732EF2B075C3A007BCC04 /* CNLiveCreateShopClassifyViewController.swift in Sources */, | 1635 | 191732EF2B075C3A007BCC04 /* CNLiveCreateShopClassifyViewController.swift in Sources */, |
| 1636 | + 1938BD302B4B8A3500390A34 /* CNLiveHomePageViewModel.swift in Sources */, | ||
| 1540 | 798A44F22A30674200815935 /* CNLiveMineSubBodyListView.swift in Sources */, | 1637 | 798A44F22A30674200815935 /* CNLiveMineSubBodyListView.swift in Sources */, |
| 1541 | 799172382AF090CD00DC01A8 /* CNLiveShopBodyListView.swift in Sources */, | 1638 | 799172382AF090CD00DC01A8 /* CNLiveShopBodyListView.swift in Sources */, |
| 1542 | 19565ED42AF9FEB4007D6727 /* CNLiveShopAddEditGoodsModel.swift in Sources */, | 1639 | 19565ED42AF9FEB4007D6727 /* CNLiveShopAddEditGoodsModel.swift in Sources */, |
| 1543 | 790D01822A2D88FC00C5978D /* CNLiveConfigMacro.swift in Sources */, | 1640 | 790D01822A2D88FC00C5978D /* CNLiveConfigMacro.swift in Sources */, |
| 1544 | 19CC4D4B2ADD086F00308E2A /* CNUpSlideDetailViewController.swift in Sources */, | 1641 | 19CC4D4B2ADD086F00308E2A /* CNUpSlideDetailViewController.swift in Sources */, |
| 1642 | + 1938BD362B4BCC7F00390A34 /* CNLiveAlbumModel.swift in Sources */, | ||
| 1545 | 7C83B4402A52BB2B004BF4A4 /* CNGlobalEnum.swift in Sources */, | 1643 | 7C83B4402A52BB2B004BF4A4 /* CNGlobalEnum.swift in Sources */, |
| 1546 | 7C83B4442A541F36004BF4A4 /* NSDate+CNLiveExtensions.swift in Sources */, | 1644 | 7C83B4442A541F36004BF4A4 /* NSDate+CNLiveExtensions.swift in Sources */, |
| 1547 | 1917332B2B15CDC6007BCC04 /* CNLivePlayerLandscapeViewController.swift in Sources */, | 1645 | 1917332B2B15CDC6007BCC04 /* CNLivePlayerLandscapeViewController.swift in Sources */, |
| @@ -1557,11 +1655,13 @@ | @@ -1557,11 +1655,13 @@ | ||
| 1557 | 790B1FB62A41938F0074CF00 /* UIImage+CNLiveExtensions.swift in Sources */, | 1655 | 790B1FB62A41938F0074CF00 /* UIImage+CNLiveExtensions.swift in Sources */, |
| 1558 | 19BB1FEA2AEF7B4A0094D962 /* CNLiveShopConsoleCell.swift in Sources */, | 1656 | 19BB1FEA2AEF7B4A0094D962 /* CNLiveShopConsoleCell.swift in Sources */, |
| 1559 | 191733132B109F7B007BCC04 /* CNLivePlayerGestureView.swift in Sources */, | 1657 | 191733132B109F7B007BCC04 /* CNLivePlayerGestureView.swift in Sources */, |
| 1658 | + 1938BD202B46799A00390A34 /* CNLivePlayletHomePageController.swift in Sources */, | ||
| 1560 | 790D019D2A2DCBD000C5978D /* UIView+CNLiveExtensions.swift in Sources */, | 1659 | 790D019D2A2DCBD000C5978D /* UIView+CNLiveExtensions.swift in Sources */, |
| 1561 | 790B1FB62A41938F0074CF00 /* UIImage+CNLiveExtensions.swift in Sources */, | 1660 | 790B1FB62A41938F0074CF00 /* UIImage+CNLiveExtensions.swift in Sources */, |
| 1562 | 191732F82B08AB9D007BCC04 /* CNLiveShopClassilyViewModel.swift in Sources */, | 1661 | 191732F82B08AB9D007BCC04 /* CNLiveShopClassilyViewModel.swift in Sources */, |
| 1563 | 79BB1C162B05C62900C5720C /* CNLiveShopBodyCouponView.swift in Sources */, | 1662 | 79BB1C162B05C62900C5720C /* CNLiveShopBodyCouponView.swift in Sources */, |
| 1564 | 798916E92B04532D00D08302 /* CNLiveSavePointDB.swift in Sources */, | 1663 | 798916E92B04532D00D08302 /* CNLiveSavePointDB.swift in Sources */, |
| 1664 | + 1938BD242B468AC900390A34 /* CNLivePlayletHomePageHeaderCell.swift in Sources */, | ||
| 1565 | 19FA20172AE22D3C001F7186 /* CNLiveDownSlideRecommendCell.swift in Sources */, | 1665 | 19FA20172AE22D3C001F7186 /* CNLiveDownSlideRecommendCell.swift in Sources */, |
| 1566 | 19123FC12ABC11170075C883 /* CNWebViewController.swift in Sources */, | 1666 | 19123FC12ABC11170075C883 /* CNWebViewController.swift in Sources */, |
| 1567 | 1926C28F2AE0D76C00C71DC3 /* CNLiveDownSlideViewModel.swift in Sources */, | 1667 | 1926C28F2AE0D76C00C71DC3 /* CNLiveDownSlideViewModel.swift in Sources */, |
| @@ -1572,6 +1672,7 @@ | @@ -1572,6 +1672,7 @@ | ||
| 1572 | 799172362AF08D4500DC01A8 /* CNLiveShopBaseModel.swift in Sources */, | 1672 | 799172362AF08D4500DC01A8 /* CNLiveShopBaseModel.swift in Sources */, |
| 1573 | 790B1FB62A41938F0074CF00 /* UIImage+CNLiveExtensions.swift in Sources */, | 1673 | 790B1FB62A41938F0074CF00 /* UIImage+CNLiveExtensions.swift in Sources */, |
| 1574 | 790D019D2A2DCBD000C5978D /* UIView+CNLiveExtensions.swift in Sources */, | 1674 | 790D019D2A2DCBD000C5978D /* UIView+CNLiveExtensions.swift in Sources */, |
| 1675 | + 1938BD3D2B4BDD4B00390A34 /* CNLiveAlbumCell.swift in Sources */, | ||
| 1575 | 19E9D1622B3BBB2E00D0FB30 /* CNLiveFileManager.swift in Sources */, | 1676 | 19E9D1622B3BBB2E00D0FB30 /* CNLiveFileManager.swift in Sources */, |
| 1576 | 79E496E82AB9674300127BF8 /* NSMutableAttributedString+CNLiveExtensions.swift in Sources */, | 1677 | 79E496E82AB9674300127BF8 /* NSMutableAttributedString+CNLiveExtensions.swift in Sources */, |
| 1577 | 19CC4D472ADD006600308E2A /* CNDownSlideSingleCourseCell.swift in Sources */, | 1678 | 19CC4D472ADD006600308E2A /* CNDownSlideSingleCourseCell.swift in Sources */, |
| @@ -1597,6 +1698,7 @@ | @@ -1597,6 +1698,7 @@ | ||
| 1597 | 191733582B319552007BCC04 /* CNLiveCouponGoodsListView.swift in Sources */, | 1698 | 191733582B319552007BCC04 /* CNLiveCouponGoodsListView.swift in Sources */, |
| 1598 | 7CD675402A2740B0008354C1 /* CNDownSlideView.swift in Sources */, | 1699 | 7CD675402A2740B0008354C1 /* CNDownSlideView.swift in Sources */, |
| 1599 | 19BB1FE32AEB8B7C0094D962 /* CNLiveShopConsoleViewModel.swift in Sources */, | 1700 | 19BB1FE32AEB8B7C0094D962 /* CNLiveShopConsoleViewModel.swift in Sources */, |
| 1701 | + 1938BD2A2B48014E00390A34 /* CNHomepageDetailViewController.swift in Sources */, | ||
| 1600 | 1965FA422AFB79EA00F0F435 /* CNLiveGoodsCategoryController.swift in Sources */, | 1702 | 1965FA422AFB79EA00F0F435 /* CNLiveGoodsCategoryController.swift in Sources */, |
| 1601 | 792E57D92A3AA2F2005834DB /* CNLiveCommonBaseModel.swift in Sources */, | 1703 | 792E57D92A3AA2F2005834DB /* CNLiveCommonBaseModel.swift in Sources */, |
| 1602 | 791C1C862AFB2EB4003E6362 /* CNLiveShopOrderExpressViewController.swift in Sources */, | 1704 | 791C1C862AFB2EB4003E6362 /* CNLiveShopOrderExpressViewController.swift in Sources */, |
| @@ -1627,9 +1729,12 @@ | @@ -1627,9 +1729,12 @@ | ||
| 1627 | 191733112B109EDC007BCC04 /* CNLivePlayerControlView.swift in Sources */, | 1729 | 191733112B109EDC007BCC04 /* CNLivePlayerControlView.swift in Sources */, |
| 1628 | 1917331F2B10A1BE007BCC04 /* CNLivePlayerEnum.swift in Sources */, | 1730 | 1917331F2B10A1BE007BCC04 /* CNLivePlayerEnum.swift in Sources */, |
| 1629 | 191733382B27FD66007BCC04 /* CNLiveShopClassifySectionHeaderView.swift in Sources */, | 1731 | 191733382B27FD66007BCC04 /* CNLiveShopClassifySectionHeaderView.swift in Sources */, |
| 1732 | + 1938BD222B467C1700390A34 /* CNLivePlayletHomePageCell.swift in Sources */, | ||
| 1733 | + 1938BD3F2B4BE7C500390A34 /* CNLiveAlbumMsgModel.swift in Sources */, | ||
| 1630 | 798A44FF2A30A0A800815935 /* CNLiveInputFeedBackViewController.swift in Sources */, | 1734 | 798A44FF2A30A0A800815935 /* CNLiveInputFeedBackViewController.swift in Sources */, |
| 1631 | 79282A442A2F1C1E00B5F8CF /* CNLiveLoginAuthView.swift in Sources */, | 1735 | 79282A442A2F1C1E00B5F8CF /* CNLiveLoginAuthView.swift in Sources */, |
| 1632 | 79BB96A62AF21E2800AEA4AC /* CNLiveShopOrderDetailViewController.swift in Sources */, | 1736 | 79BB96A62AF21E2800AEA4AC /* CNLiveShopOrderDetailViewController.swift in Sources */, |
| 1737 | + 1938BD2C2B4801A700390A34 /* CNHomePageAnimationTransition.swift in Sources */, | ||
| 1633 | 191733452B284DCD007BCC04 /* CNLiveShopCouponListModel.swift in Sources */, | 1738 | 191733452B284DCD007BCC04 /* CNLiveShopCouponListModel.swift in Sources */, |
| 1634 | 7C2703302A36CBE30061EC50 /* CNCertificationView.swift in Sources */, | 1739 | 7C2703302A36CBE30061EC50 /* CNCertificationView.swift in Sources */, |
| 1635 | 19CC4D542ADD163D00308E2A /* CNUpSlideCardPresentationController.swift in Sources */, | 1740 | 19CC4D542ADD163D00308E2A /* CNUpSlideCardPresentationController.swift in Sources */, |
| @@ -1649,6 +1754,7 @@ | @@ -1649,6 +1754,7 @@ | ||
| 1649 | 1917335C2B3283FF007BCC04 /* CNLiveCouponGoodsListSearchView.swift in Sources */, | 1754 | 1917335C2B3283FF007BCC04 /* CNLiveCouponGoodsListSearchView.swift in Sources */, |
| 1650 | 798A44F92A30835400815935 /* CNLiveHelpFeedBackViewController.swift in Sources */, | 1755 | 798A44F92A30835400815935 /* CNLiveHelpFeedBackViewController.swift in Sources */, |
| 1651 | 79A68C4A2A26E6CE00DC3B43 /* (null) in Sources */, | 1756 | 79A68C4A2A26E6CE00DC3B43 /* (null) in Sources */, |
| 1757 | + 1938BD262B479D3400390A34 /* UILabel+FormattedText.swift in Sources */, | ||
| 1652 | 790D01852A2D89E100C5978D /* UIColor+CNLiveExtensions.swift in Sources */, | 1758 | 790D01852A2D89E100C5978D /* UIColor+CNLiveExtensions.swift in Sources */, |
| 1653 | 794FF1092B02131300385E85 /* CNLiveSaveSearchDB.swift in Sources */, | 1759 | 794FF1092B02131300385E85 /* CNLiveSaveSearchDB.swift in Sources */, |
| 1654 | 79396EED2A319F220053E1AF /* NSObject+CNLiveExtensions.swift in Sources */, | 1760 | 79396EED2A319F220053E1AF /* NSObject+CNLiveExtensions.swift in Sources */, |
| @@ -1676,6 +1782,7 @@ | @@ -1676,6 +1782,7 @@ | ||
| 1676 | 7978A8432A396632007C86B8 /* CNLiveMineViewModel.swift in Sources */, | 1782 | 7978A8432A396632007C86B8 /* CNLiveMineViewModel.swift in Sources */, |
| 1677 | 191733022B0C4EAB007BCC04 /* CNLiveSelUplSingleImageView.swift in Sources */, | 1783 | 191733022B0C4EAB007BCC04 /* CNLiveSelUplSingleImageView.swift in Sources */, |
| 1678 | 798A44EE2A305AAC00815935 /* CNLiveBaseNavigationController.swift in Sources */, | 1784 | 798A44EE2A305AAC00815935 /* CNLiveBaseNavigationController.swift in Sources */, |
| 1785 | + 1938BD412B4BEC6900390A34 /* CNLiveAlbumListModel.swift in Sources */, | ||
| 1679 | 7CD675422A2740F8008354C1 /* CNCustomIndexView.swift in Sources */, | 1786 | 7CD675422A2740F8008354C1 /* CNCustomIndexView.swift in Sources */, |
| 1680 | 191733292B148BF7007BCC04 /* CNLivePlayerVolumeBrightnessView.swift in Sources */, | 1787 | 191733292B148BF7007BCC04 /* CNLivePlayerVolumeBrightnessView.swift in Sources */, |
| 1681 | 7C4931292A2D8BA8000E44B4 /* CNLiveBaseTabBarViewController.swift in Sources */, | 1788 | 7C4931292A2D8BA8000E44B4 /* CNLiveBaseTabBarViewController.swift in Sources */, |
| @@ -1704,6 +1811,7 @@ | @@ -1704,6 +1811,7 @@ | ||
| 1704 | 79282A462A2F457D00B5F8CF /* CNLiveMineViewController.swift in Sources */, | 1811 | 79282A462A2F457D00B5F8CF /* CNLiveMineViewController.swift in Sources */, |
| 1705 | 7991723A2AF091E100DC01A8 /* CNLiveShopOrderListViewController.swift in Sources */, | 1812 | 7991723A2AF091E100DC01A8 /* CNLiveShopOrderListViewController.swift in Sources */, |
| 1706 | 798A44F02A305BC200815935 /* UIButton+CNLiveExtensions.swift in Sources */, | 1813 | 798A44F02A305BC200815935 /* UIButton+CNLiveExtensions.swift in Sources */, |
| 1814 | + 1938BD342B4B968300390A34 /* CNLiveHomePageDuanJuCell.swift in Sources */, | ||
| 1707 | 191733522B2C4CEA007BCC04 /* CNLivePickerSelectDateTools.swift in Sources */, | 1815 | 191733522B2C4CEA007BCC04 /* CNLivePickerSelectDateTools.swift in Sources */, |
| 1708 | 1917333A2B27FDF3007BCC04 /* CNLiveShopClassilyManageTableViewCell.swift in Sources */, | 1816 | 1917333A2B27FDF3007BCC04 /* CNLiveShopClassilyManageTableViewCell.swift in Sources */, |
| 1709 | ); | 1817 | ); |
metaCode/Classes/Extensions/UILabel+FormattedText.swift
0 → 100644
| 1 | +// | ||
| 2 | +// UILabel+FormattedText.swift | ||
| 3 | +// metaCode | ||
| 4 | +// | ||
| 5 | +// Created by zx on 2024/1/5. | ||
| 6 | +// | ||
| 7 | + | ||
| 8 | +import Foundation | ||
| 9 | + | ||
| 10 | +extension UILabel { | ||
| 11 | + //计算label的行数 | ||
| 12 | + func getRealLabelTextLines() -> Int { | ||
| 13 | + guard let labelText = text else { | ||
| 14 | + return 0 | ||
| 15 | + } | ||
| 16 | + //计算理论上显示所有文字需要的尺寸 | ||
| 17 | + let rect = CGSize(width: self.bounds.width, height: CGFloat.greatestFiniteMagnitude) | ||
| 18 | + let labelTextSize = (labelText as NSString) | ||
| 19 | + .boundingRect(with: rect, options:.usesLineFragmentOrigin,attributes: [NSAttributedString.Key.font: self.font!], context: nil) | ||
| 20 | + | ||
| 21 | + //计算理论上需要的行数 | ||
| 22 | + let labelTextLines = Int(ceil(CGFloat(labelTextSize.height) / self.font.lineHeight)) | ||
| 23 | + return labelTextLines | ||
| 24 | + } | ||
| 25 | +} |
metaCode/Classes/Main/HomePages/Controller/AuthController/CNLiveAuthViewController.swift
0 → 100644
| 1 | +// | ||
| 2 | +// CNLiveAuthViewController.swift | ||
| 3 | +// metaCode | ||
| 4 | +// | ||
| 5 | +// Created by zx on 2023/12/28. | ||
| 6 | +// | ||
| 7 | + | ||
| 8 | +import Foundation | ||
| 9 | + | ||
| 10 | +class CNLiveAuthViewController:CNLiveBaseViewController,UITableViewDelegate,UITableViewDataSource{ | ||
| 11 | + | ||
| 12 | + //下滑tableview背景颜色 | ||
| 13 | + let kCNDownSlideBackgroundColorHex: String = "#F7F8FA" | ||
| 14 | + | ||
| 15 | + ///CNliveDownSlideModel Type | ||
| 16 | + let SlideModelTypeRecommend4: String = "4"//4一排两个 推荐课程&推荐活动 | ||
| 17 | + let SlideModelTypeTodayRecommend74: String = "74"//74今日推荐 | ||
| 18 | + let SlideModelTypeAllCourse12: String = "12"//12列表全部课程 | ||
| 19 | + let SlideModelTypeOneCourse75: String = "75"//75单课程大图 | ||
| 20 | + | ||
| 21 | + let kCNLiveDownSlideAllCourseCellIdentifier = "kCNLiveDownSlideAllCourseCellIdentifier" | ||
| 22 | + let kCNLiveDownSlideRecommendCellIdentifier = "kCNLiveDownSlideRecommendCellIdentifier" | ||
| 23 | + let kCNLiveDownSlideTodayRecommendCellIdentifier = "kCNLiveDownSlideTodayRecommendCellIdentifier" | ||
| 24 | + let kCNLiveDownSlideSingleCourseCellIdentifier = "kCNLiveDownSlideSingleCourseCellIdentifier" | ||
| 25 | + let kCNLiveHomePageDuanJuCellIdentifier = "kCNLiveHomePageDuanJuCellIdentifier" | ||
| 26 | + | ||
| 27 | + var isHaveDuanJU = false//是否有在追短剧 | ||
| 28 | + var totolNum = 0//一共显示多少行cell | ||
| 29 | + | ||
| 30 | + var selectedCell: CNDownSlideSingleCourseCell? | ||
| 31 | + | ||
| 32 | + var statusBarShouldBeHidden = false | ||
| 33 | + //we need to set `View controller-based status bar appearance = YES` in info.plist. | ||
| 34 | + //so we can be able to hide statusBar. | ||
| 35 | + override var prefersStatusBarHidden: Bool { | ||
| 36 | + return statusBarShouldBeHidden | ||
| 37 | + } | ||
| 38 | + | ||
| 39 | + override var preferredStatusBarUpdateAnimation: UIStatusBarAnimation { | ||
| 40 | + return .slide | ||
| 41 | + } | ||
| 42 | + | ||
| 43 | + var _downPath:String? | ||
| 44 | + var downPath:String? { | ||
| 45 | + get{ | ||
| 46 | + return _downPath | ||
| 47 | + } | ||
| 48 | + set{ | ||
| 49 | + _downPath = newValue! | ||
| 50 | + } | ||
| 51 | + } | ||
| 52 | + | ||
| 53 | + // MARK: - 懒加载 | ||
| 54 | + ///数据源 | ||
| 55 | + lazy var dataArray: NSMutableArray = { | ||
| 56 | + var dataArray = NSMutableArray() | ||
| 57 | + return dataArray | ||
| 58 | + }() | ||
| 59 | + | ||
| 60 | + override func viewWillAppear(_ animated: Bool) { | ||
| 61 | + super.viewWillAppear(animated) | ||
| 62 | + self.updateStatusBarAndTabbarFrame(visible: true) | ||
| 63 | + } | ||
| 64 | + override func viewDidLoad() { | ||
| 65 | + super.viewDidLoad() | ||
| 66 | + self.view.backgroundColor = .white | ||
| 67 | +// self.view.backgroundColor = HexColor(kCNDownSlideBackgroundColorHex) | ||
| 68 | + view.addSubview(tableView) | ||
| 69 | + tableView.frame = CGRect(x: 0, y: KStatusBarHeight, width: KSreenWidth, height: KSreenHeight-DownSlideBottomViewHeight-KStatusBarHeight) | ||
| 70 | + self.getHomePageConfigListApi() | ||
| 71 | + } | ||
| 72 | + | ||
| 73 | + lazy var tableView : UITableView = { | ||
| 74 | + let tableView = UITableView(frame: .zero, style: .plain) | ||
| 75 | + tableView.dataSource = self | ||
| 76 | + tableView.delegate = self | ||
| 77 | + tableView.separatorStyle = .none | ||
| 78 | + // tableView.register(CNDownSlideSingleCourseCell.self, forCellReuseIdentifier: kCNLiveDownSlideCellIdentifier) | ||
| 79 | + tableView.register(CNLiveHomePageDuanJuCell.self, forCellReuseIdentifier: kCNLiveHomePageDuanJuCellIdentifier) | ||
| 80 | + | ||
| 81 | + tableView.register(CNLiveDownSlideRecommendCell.self, forCellReuseIdentifier: kCNLiveDownSlideRecommendCellIdentifier) | ||
| 82 | + tableView.register(CNLiveDownSlideTodayRecommendCell.self, forCellReuseIdentifier: kCNLiveDownSlideTodayRecommendCellIdentifier) | ||
| 83 | + tableView.register(CNDownSlideSingleCourseCell.self, forCellReuseIdentifier: kCNLiveDownSlideAllCourseCellIdentifier) | ||
| 84 | + tableView.register(CNDownSlideSingleCourseCell.self, forCellReuseIdentifier:kCNLiveDownSlideSingleCourseCellIdentifier) | ||
| 85 | + tableView.backgroundColor = HexColor(kCNDownSlideBackgroundColorHex) | ||
| 86 | + return tableView | ||
| 87 | + }() | ||
| 88 | + | ||
| 89 | + private func updateStatusBarAndTabbarFrame(visible: Bool) { | ||
| 90 | + statusBarShouldBeHidden = !visible | ||
| 91 | + UIView.animate(withDuration: 0.25) { | ||
| 92 | + self.setNeedsStatusBarAppearanceUpdate() | ||
| 93 | + } | ||
| 94 | + } | ||
| 95 | + | ||
| 96 | + // MARK: - UITableViewDelegate | ||
| 97 | + func numberOfSections(in tableView: UITableView) -> Int { | ||
| 98 | + if self.isHaveDuanJU{ | ||
| 99 | + 2 | ||
| 100 | + }else{ | ||
| 101 | + 1 | ||
| 102 | + } | ||
| 103 | + } | ||
| 104 | + func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -> Int { | ||
| 105 | + if self.isHaveDuanJU && section == 0{ | ||
| 106 | + 1 | ||
| 107 | + }else{ | ||
| 108 | + self.dataArray.count | ||
| 109 | + } | ||
| 110 | + } | ||
| 111 | + | ||
| 112 | + func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell { | ||
| 113 | + if self.isHaveDuanJU && indexPath.section == 0{ | ||
| 114 | + guard let cell = tableView.dequeueReusableCell(withIdentifier: kCNLiveHomePageDuanJuCellIdentifier) as? CNLiveHomePageDuanJuCell | ||
| 115 | + else { | ||
| 116 | + return CNLiveHomePageDuanJuCell() | ||
| 117 | + } | ||
| 118 | + return cell | ||
| 119 | + }else{ | ||
| 120 | + let slideModel = self.dataArray[indexPath.row] as! CNLiveDownSlideModel | ||
| 121 | + | ||
| 122 | + //type=4一排两个 推荐课程&推荐活动; 74今日推荐; 12列表全部课程; 75单课程大图 | ||
| 123 | + if slideModel.type == SlideModelTypeRecommend4{ | ||
| 124 | + guard let cell = tableView.dequeueReusableCell(withIdentifier: kCNLiveDownSlideRecommendCellIdentifier) as? CNLiveDownSlideRecommendCell | ||
| 125 | + else { | ||
| 126 | + // let cell = CNLiveDownSlideRecommendCell() | ||
| 127 | + // cell.slideModel = slideModel | ||
| 128 | + return CNLiveDownSlideRecommendCell() | ||
| 129 | + } | ||
| 130 | + cell.slideModel = slideModel | ||
| 131 | + return cell | ||
| 132 | + }else if slideModel.type == SlideModelTypeTodayRecommend74{ | ||
| 133 | + guard let cell = tableView.dequeueReusableCell(withIdentifier: kCNLiveDownSlideTodayRecommendCellIdentifier) as? CNLiveDownSlideTodayRecommendCell | ||
| 134 | + else { | ||
| 135 | + let cell = CNLiveDownSlideTodayRecommendCell() | ||
| 136 | + cell.slideModel = slideModel | ||
| 137 | + return cell | ||
| 138 | + } | ||
| 139 | + cell.slideModel = slideModel | ||
| 140 | + return cell | ||
| 141 | + }else if slideModel.type == SlideModelTypeAllCourse12{ | ||
| 142 | + guard let cell = tableView.dequeueReusableCell(withIdentifier: kCNLiveDownSlideAllCourseCellIdentifier) as? CNDownSlideSingleCourseCell | ||
| 143 | + else { | ||
| 144 | + let cell = CNDownSlideSingleCourseCell() | ||
| 145 | + cell.slideModel = slideModel | ||
| 146 | + return cell | ||
| 147 | + } | ||
| 148 | + cell.slideModel = slideModel | ||
| 149 | + return cell | ||
| 150 | + }else if slideModel.type == SlideModelTypeOneCourse75{ | ||
| 151 | + guard let cell = tableView.dequeueReusableCell(withIdentifier: kCNLiveDownSlideSingleCourseCellIdentifier) as? CNDownSlideSingleCourseCell | ||
| 152 | + else { | ||
| 153 | + let cell = CNDownSlideSingleCourseCell() | ||
| 154 | + cell.slideModel = slideModel | ||
| 155 | + return cell | ||
| 156 | + } | ||
| 157 | + cell.slideModel = slideModel | ||
| 158 | + return cell | ||
| 159 | + }else{ | ||
| 160 | + return UITableViewCell() | ||
| 161 | + } | ||
| 162 | + } | ||
| 163 | + } | ||
| 164 | + | ||
| 165 | + | ||
| 166 | + func tableView(_ tableView: UITableView, didHighlightRowAt indexPath: IndexPath) { | ||
| 167 | + if self.isHaveDuanJU && indexPath.section == 0{ | ||
| 168 | + | ||
| 169 | + }else{ | ||
| 170 | + | ||
| 171 | + guard let row = tableView.cellForRow(at: indexPath) as? CNDownSlideSingleCourseCell else { return } | ||
| 172 | + UIView.animate(withDuration: 0.1) { | ||
| 173 | + row.bgBackView.transform = CGAffineTransform(scaleX: 0.95, y: 0.95) | ||
| 174 | + } | ||
| 175 | + } | ||
| 176 | + } | ||
| 177 | + | ||
| 178 | + func tableView(_ tableView: UITableView, didUnhighlightRowAt indexPath: IndexPath) { | ||
| 179 | + if self.isHaveDuanJU && indexPath.section == 0{ | ||
| 180 | + | ||
| 181 | + }else{ | ||
| 182 | + | ||
| 183 | + guard let row = tableView.cellForRow(at: indexPath) as? CNDownSlideSingleCourseCell else { return } | ||
| 184 | + UIView.animate(withDuration: 0.3) { | ||
| 185 | + row.bgBackView.transform = CGAffineTransform(scaleX: 1.0, y: 1.0) | ||
| 186 | + } | ||
| 187 | + } | ||
| 188 | + } | ||
| 189 | + | ||
| 190 | + func tableView(_ tableView: UITableView, didSelectRowAt indexPath: IndexPath) { | ||
| 191 | + if self.isHaveDuanJU && indexPath.section == 0{ | ||
| 192 | + | ||
| 193 | + }else{ | ||
| 194 | + | ||
| 195 | + let slideModel = self.dataArray[indexPath.row] as! CNLiveDownSlideModel | ||
| 196 | + //type=4一排两个 推荐课程&推荐活动; 74今日推荐; 12列表全部课程; 75单课程大图 | ||
| 197 | + if slideModel.type == SlideModelTypeRecommend4{ | ||
| 198 | + | ||
| 199 | + }else if slideModel.type == SlideModelTypeTodayRecommend74{ | ||
| 200 | + | ||
| 201 | + }else if slideModel.type == SlideModelTypeAllCourse12{ | ||
| 202 | + guard let cell = tableView.cellForRow(at: indexPath) as? CNDownSlideSingleCourseCell else { return } | ||
| 203 | + selectedCell = cell | ||
| 204 | + let detailVC = CNSlideBaseNavigationController(rootViewController: CNUpSlideDetailViewController(cell: cell,slideModel: slideModel)) | ||
| 205 | + detailVC.dismissClosure = { [weak self] in | ||
| 206 | + guard let StrongSelf = self else { return } | ||
| 207 | + StrongSelf.updateStatusBarAndTabbarFrame(visible: true) | ||
| 208 | + } | ||
| 209 | + updateStatusBarAndTabbarFrame(visible: false) | ||
| 210 | + | ||
| 211 | + present(detailVC, animated: true, completion: nil) | ||
| 212 | + }else if slideModel.type == SlideModelTypeOneCourse75{ | ||
| 213 | + guard let cell = tableView.cellForRow(at: indexPath) as? CNDownSlideSingleCourseCell else { return } | ||
| 214 | + selectedCell = cell | ||
| 215 | + | ||
| 216 | + let detailVC = CNHomePageBaseNavigationController(rootViewController:CNHomepageDetailViewController(cell: cell,slideModel: slideModel)) | ||
| 217 | + | ||
| 218 | + detailVC.dismissClosure = { [weak self] in | ||
| 219 | + guard let StrongSelf = self else { return } | ||
| 220 | + StrongSelf.updateStatusBarAndTabbarFrame(visible: true) | ||
| 221 | + } | ||
| 222 | + updateStatusBarAndTabbarFrame(visible: false) | ||
| 223 | + present(detailVC, animated: true, completion: nil) | ||
| 224 | + } | ||
| 225 | + } | ||
| 226 | + } | ||
| 227 | + | ||
| 228 | + func tableView(_ tableView: UITableView, heightForRowAt indexPath: IndexPath) -> CGFloat { | ||
| 229 | + if self.isHaveDuanJU && indexPath.section == 0{ | ||
| 230 | + return 300 | ||
| 231 | + }else{ | ||
| 232 | + let slideModel = self.dataArray[indexPath.row] as! CNLiveDownSlideModel | ||
| 233 | + return CGFloat(slideModel.cellH) | ||
| 234 | + } | ||
| 235 | + } | ||
| 236 | + | ||
| 237 | + func tableView(_ tableView: UITableView, heightForFooterInSection section: Int) -> CGFloat { | ||
| 238 | + return 0 | ||
| 239 | + } | ||
| 240 | + func tableView(_ tableView: UITableView, heightForHeaderInSection section: Int) -> CGFloat { | ||
| 241 | + return 0 | ||
| 242 | + } | ||
| 243 | + | ||
| 244 | + //MARK: - 获取首页配置 | ||
| 245 | + func getHomePageConfigListApi(){ | ||
| 246 | + CNLiveHomePageViewModel.requestGetHomePageConfigList{ result, status in | ||
| 247 | + if status == .success{ | ||
| 248 | + let dataModel = result as! CNLiveHomePageModel | ||
| 249 | + let homePageListMdls = dataModel.list | ||
| 250 | + for listModel in homePageListMdls { | ||
| 251 | + if listModel.type == 3{ | ||
| 252 | + //在追短剧 | ||
| 253 | + self.isHaveDuanJU = true | ||
| 254 | + }else if listModel.type == 1{ | ||
| 255 | + //页面 | ||
| 256 | + self.getPageApi(pageID: listModel.content) | ||
| 257 | + } | ||
| 258 | + } | ||
| 259 | + }else{ | ||
| 260 | + | ||
| 261 | + } | ||
| 262 | + } | ||
| 263 | + } | ||
| 264 | + | ||
| 265 | + //我的专辑收藏--在追短剧 | ||
| 266 | + func getMyAlbumCollection(){ | ||
| 267 | + CNLiveHomePageViewModel.requestGetHomePage { result, status in | ||
| 268 | + if status == .success{ | ||
| 269 | + | ||
| 270 | + }else{ | ||
| 271 | + | ||
| 272 | + } | ||
| 273 | + } | ||
| 274 | + } | ||
| 275 | + | ||
| 276 | + //MARK: - 网络请求获取区块详情页 | ||
| 277 | + func getPageApi(pageID:String) | ||
| 278 | + { | ||
| 279 | + // showLoading(message: "") | ||
| 280 | + CNLiveDownSlideViewModel.requestGetPage(pageId: pageID as NSString) { result, status in | ||
| 281 | + hiddenLoading() | ||
| 282 | + | ||
| 283 | + if status == .success{ | ||
| 284 | + self.dataArray.removeAllObjects() | ||
| 285 | + let array = result as! [Any] | ||
| 286 | + let newDataArray = NSMutableArray() | ||
| 287 | + for slideModel in array { | ||
| 288 | + if let model = slideModel as? CNLiveDownSlideModel{ | ||
| 289 | + | ||
| 290 | + let layout = CNLiveDownSlideModelLayout.init(model: model) | ||
| 291 | + newDataArray.addObjects(from: [layout.getCellHModel()]) | ||
| 292 | + } | ||
| 293 | + } | ||
| 294 | + self.dataArray.addObjects(from: newDataArray as! [Any]) | ||
| 295 | + | ||
| 296 | + self.tableView.reloadData() | ||
| 297 | + }else if (status == .failed){ | ||
| 298 | + // self.NetApiStatus = .apiError | ||
| 299 | + }else if (status == .noNetwork){ | ||
| 300 | + | ||
| 301 | + // self.NetApiStatus = .notNetwork | ||
| 302 | + } | ||
| 303 | + } | ||
| 304 | + // | ||
| 305 | + } | ||
| 306 | +} |
metaCode/Classes/Main/HomePages/Controller/AuthController/push相关/CNHomePageAnimationTransition.swift
0 → 100644
| 1 | +// | ||
| 2 | +// CNHomePageAnimationTransition.swift | ||
| 3 | +// metaCode | ||
| 4 | +// | ||
| 5 | +// Created by zx on 2024/1/5. | ||
| 6 | +// | ||
| 7 | + | ||
| 8 | +import Foundation | ||
| 9 | +import UIKit | ||
| 10 | + | ||
| 11 | +fileprivate let transitonDuration: TimeInterval = 1.0 | ||
| 12 | + | ||
| 13 | +class CNHomePageAnimationTransition: NSObject { | ||
| 14 | + let animationType: AnimationType! | ||
| 15 | + | ||
| 16 | + init(animationType: AnimationType) { | ||
| 17 | + self.animationType = animationType | ||
| 18 | + super.init() | ||
| 19 | + } | ||
| 20 | +} | ||
| 21 | + | ||
| 22 | +extension CNHomePageAnimationTransition: UIViewControllerAnimatedTransitioning { | ||
| 23 | + func transitionDuration(using transitionContext: UIViewControllerContextTransitioning?) -> TimeInterval { | ||
| 24 | + return transitonDuration | ||
| 25 | + } | ||
| 26 | + | ||
| 27 | + func animateTransition(using transitionContext: UIViewControllerContextTransitioning) { | ||
| 28 | + if animationType == .present { | ||
| 29 | + animationForPresent(using: transitionContext) | ||
| 30 | + } else { | ||
| 31 | + animationForDismiss(using: transitionContext) | ||
| 32 | + } | ||
| 33 | + } | ||
| 34 | + | ||
| 35 | + func animationForPresent(using transitionContext: UIViewControllerContextTransitioning) { | ||
| 36 | + let containerView = transitionContext.containerView | ||
| 37 | + //1.Get fromVC and toVC | ||
| 38 | + guard let fromVCtemp = transitionContext.viewController(forKey: .from) as? CNLiveBaseTabBarViewController else { return } | ||
| 39 | + let fromNavi = fromVCtemp.viewControllers![0] as! CNLiveBaseNavigationController | ||
| 40 | + let fromVC = fromNavi.viewControllers.first as! CNLiveAuthViewController | ||
| 41 | + guard let toNaviVC = transitionContext.viewController(forKey: .to) as? CNHomePageBaseNavigationController else { return } | ||
| 42 | + guard let selectedCell = fromVC.selectedCell else { return } | ||
| 43 | + let toVC = toNaviVC.topViewController as! CNHomepageDetailViewController | ||
| 44 | + let frame = selectedCell.convert(selectedCell.bgBackView.frame, to: fromVC.view) | ||
| 45 | + //2.Set presentation original size. | ||
| 46 | + toVC.view.frame = frame | ||
| 47 | + toVC.scrollView.imageView.frame.size.width = GlobalConstants.todayCardSize.width | ||
| 48 | + toVC.scrollView.imageView.frame.size.height = GlobalConstants.todayCardSize.height | ||
| 49 | + | ||
| 50 | + containerView.addSubview(toNaviVC.view) | ||
| 51 | + | ||
| 52 | + //3.Change original size to final size with animation. | ||
| 53 | + UIView.animate(withDuration: transitonDuration, delay: 0, usingSpringWithDamping: 0.5, initialSpringVelocity: 0, options: [], animations: { | ||
| 54 | + toVC.view.frame = UIScreen.main.bounds | ||
| 55 | + toVC.scrollView.imageView.frame.size.width = KSreenWidth | ||
| 56 | + toVC.scrollView.imageView.frame.size.height = KSreenWidth*DownSlideSingleCourseImgH/DownSlideSingleCourseW | ||
| 57 | + toVC.closeBtn.alpha = 1 | ||
| 58 | + | ||
| 59 | + }) { (completed) in | ||
| 60 | + transitionContext.completeTransition(completed) | ||
| 61 | + } | ||
| 62 | + } | ||
| 63 | + | ||
| 64 | + func animationForDismiss(using transitionContext: UIViewControllerContextTransitioning) { | ||
| 65 | + guard let fromNaviVC = transitionContext.viewController(forKey: .from) as? CNHomePageBaseNavigationController else { return } | ||
| 66 | + guard let toVCTabbar = transitionContext.viewController(forKey: .to) as? CNLiveBaseTabBarViewController else { return } | ||
| 67 | + let toVCNav = toVCTabbar.viewControllers?.first as! CNLiveBaseNavigationController | ||
| 68 | + let toVC = toVCNav.viewControllers.first as! CNLiveAuthViewController | ||
| 69 | + guard let selectedCell = toVC.selectedCell else { return } | ||
| 70 | + let fromVC = fromNaviVC.topViewController as! CNHomepageDetailViewController | ||
| 71 | + | ||
| 72 | + UIView.animate(withDuration: transitonDuration - 0.3, delay: 0, usingSpringWithDamping: 0.8, initialSpringVelocity: 0, options: [], animations: { | ||
| 73 | + let frame = selectedCell.convert(selectedCell.bgBackView.frame, to: toVC.view) | ||
| 74 | + fromVC.view.frame = frame | ||
| 75 | + fromVC.view.layer.cornerRadius = GlobalConstants.toDayCardCornerRadius | ||
| 76 | + fromVC.scrollView.imageView.frame.size.width = GlobalConstants.todayCardSize.width | ||
| 77 | + fromVC.scrollView.imageView.frame.size.height = GlobalConstants.todayCardSize.height | ||
| 78 | + fromVC.closeBtn.alpha = 0 | ||
| 79 | + | ||
| 80 | + }) { (completed) in | ||
| 81 | + transitionContext.completeTransition(completed) | ||
| 82 | + } | ||
| 83 | + } | ||
| 84 | + | ||
| 85 | +} |
metaCode/Classes/Main/HomePages/Controller/AuthController/push相关/CNHomePageBaseNavigationController.swift
0 → 100644
| 1 | +// | ||
| 2 | +// CNHomePageBaseNavigationController.swift | ||
| 3 | +// metaCode | ||
| 4 | +// | ||
| 5 | +// Created by zx on 2024/1/5. | ||
| 6 | +// | ||
| 7 | + | ||
| 8 | +import Foundation | ||
| 9 | +class CNHomePageBaseNavigationController: UINavigationController | ||
| 10 | + ,UIViewControllerTransitioningDelegate { | ||
| 11 | + var dismissClosure: (()->())? | ||
| 12 | + override func viewDidLoad() { | ||
| 13 | + super.viewDidLoad() | ||
| 14 | + modalPresentationStyle = .custom | ||
| 15 | + transitioningDelegate = self | ||
| 16 | + } | ||
| 17 | + | ||
| 18 | + func animationController(forPresented presented: UIViewController, presenting: UIViewController, source: UIViewController) -> UIViewControllerAnimatedTransitioning? { | ||
| 19 | + return CNHomePageAnimationTransition(animationType: .present) | ||
| 20 | + } | ||
| 21 | + | ||
| 22 | + func animationController(forDismissed dismissed: UIViewController) -> UIViewControllerAnimatedTransitioning? { | ||
| 23 | + return CNHomePageAnimationTransition(animationType: .dismiss) | ||
| 24 | + } | ||
| 25 | + | ||
| 26 | + func presentationController(forPresented presented: UIViewController, presenting: UIViewController?, source: UIViewController) -> UIPresentationController? { | ||
| 27 | + return CNUpSlideCardPresentationController(presentedViewController: presented, presenting: presenting) | ||
| 28 | + } | ||
| 29 | +} |
metaCode/Classes/Main/HomePages/Controller/AuthController/push相关/CNHomepageDetailViewController.swift
0 → 100644
| 1 | +// | ||
| 2 | +// CNHomepageDetailViewController.swift | ||
| 3 | +// metaCode | ||
| 4 | +// | ||
| 5 | +// Created by zx on 2024/1/5. | ||
| 6 | +// 首页短剧--大图点击详情页 | ||
| 7 | + | ||
| 8 | +import Foundation | ||
| 9 | + | ||
| 10 | +class CNHomepageDetailViewController: CNLiveBaseViewController ,UITableViewDataSource, UITableViewDelegate{ | ||
| 11 | + | ||
| 12 | + let kCNLiveAlbumImageCellIdentifier = "kCNLiveAlbumImageCellIdentifier" | ||
| 13 | + let kCNLiveAlbumCellIdentifier = "kCNLiveAlbumCellIdentifier" | ||
| 14 | + | ||
| 15 | + // MARK: - 懒加载 | ||
| 16 | + ///数据源 | ||
| 17 | + lazy var dataArray: NSMutableArray = { | ||
| 18 | + var dataArray = NSMutableArray() | ||
| 19 | + return dataArray | ||
| 20 | + }() | ||
| 21 | + lazy var tableView : UITableView = { | ||
| 22 | + let tableView = UITableView(frame: .zero, style: .plain) | ||
| 23 | + tableView.dataSource = self | ||
| 24 | + tableView.delegate = self | ||
| 25 | + tableView.separatorStyle = .none | ||
| 26 | + tableView.tableFooterView = UIView.init() | ||
| 27 | + tableView.register(CNLiveAlbumCell.self, forCellReuseIdentifier: kCNLiveAlbumCellIdentifier) | ||
| 28 | + tableView.register(CNLiveAlbumImageCell.self, forCellReuseIdentifier: kCNLiveAlbumImageCellIdentifier) | ||
| 29 | + return tableView | ||
| 30 | + }() | ||
| 31 | + | ||
| 32 | + //slideModel | ||
| 33 | + var _slideModel : CNLiveDownSlideModel? | ||
| 34 | + var slideModel : CNLiveDownSlideModel? { | ||
| 35 | + get{ | ||
| 36 | + _slideModel | ||
| 37 | + } | ||
| 38 | + set{ | ||
| 39 | + _slideModel = newValue! | ||
| 40 | + } | ||
| 41 | + } | ||
| 42 | + | ||
| 43 | + var dismissClosure: (()->())? | ||
| 44 | + //the point when start to interactive | ||
| 45 | + var interactiveStartingPoint: CGPoint? = nil | ||
| 46 | + | ||
| 47 | + var draggingDownToDismiss = false | ||
| 48 | + | ||
| 49 | + let cell: CNDownSlideSingleCourseCell! | ||
| 50 | + | ||
| 51 | + private lazy var dismissPanGesture: UIPanGestureRecognizer = { | ||
| 52 | + let ges = UIPanGestureRecognizer() | ||
| 53 | + ges.maximumNumberOfTouches = 1 | ||
| 54 | + ges.addTarget(self, action: #selector(handleDismissPan(gesture:))) | ||
| 55 | + ges.delegate = self | ||
| 56 | + return ges | ||
| 57 | + }() | ||
| 58 | + | ||
| 59 | + lazy var scrollView: CNUpSlideDetailScrollView = { | ||
| 60 | + let frame = self.view.bounds | ||
| 61 | + let view = CNUpSlideDetailScrollView(frame: frame) | ||
| 62 | + view.callBack = {(contentMdl:CNLiveDownSlideContentsModel)->Void in | ||
| 63 | + CNLiveDownSlideTool.detailPushWebVCWithContentsMdl(contentMdl: contentMdl, viewController: self) | ||
| 64 | + } | ||
| 65 | + view.delegate = self | ||
| 66 | + return view | ||
| 67 | + }() | ||
| 68 | + | ||
| 69 | + lazy var closeBtn: UIButton = { | ||
| 70 | + let btn = UIButton() | ||
| 71 | + btn.frame = CGRect(x: KSreenWidth - 20 - 30, y: KStatusBarHeight+20, width: 30, height: 30) | ||
| 72 | + btn.setImage(#imageLiteral(resourceName: "close_button"), for: .normal) | ||
| 73 | + btn.addTarget(self, action: #selector(closeAction), for: .touchUpInside) | ||
| 74 | + return btn | ||
| 75 | + }() | ||
| 76 | + | ||
| 77 | + init(cell: CNDownSlideSingleCourseCell,slideModel:CNLiveDownSlideModel) { | ||
| 78 | + self.cell = cell | ||
| 79 | + super.init(nibName: nil, bundle: nil) | ||
| 80 | + self.slideModel = slideModel | ||
| 81 | + self.setupTranstion() | ||
| 82 | + setNeedsStatusBarAppearanceUpdate() | ||
| 83 | + } | ||
| 84 | + | ||
| 85 | + private func setupTranstion() { | ||
| 86 | + modalPresentationStyle = .custom | ||
| 87 | + transitioningDelegate = self | ||
| 88 | + } | ||
| 89 | + | ||
| 90 | + required init?(coder aDecoder: NSCoder) { | ||
| 91 | + fatalError("init(coder:) has not been implemented") | ||
| 92 | + } | ||
| 93 | + | ||
| 94 | + override func viewDidLoad() { | ||
| 95 | + super.viewDidLoad() | ||
| 96 | + setupUI() | ||
| 97 | + getImageFromCell() | ||
| 98 | + self.getBlockContents() | ||
| 99 | + } | ||
| 100 | + | ||
| 101 | + private func setupUI() { | ||
| 102 | + self.view.layer.masksToBounds = true | ||
| 103 | +// view.addSubview(scrollView) | ||
| 104 | +// scrollView.slideModel = _slideModel | ||
| 105 | + self.view.addSubview(self.tableView) | ||
| 106 | + self.tableView.frame = CGRect(x: 0, y: 0, width: KSreenWidth, height: KSreenHeight) | ||
| 107 | + view.addSubview(closeBtn) | ||
| 108 | + view.addGestureRecognizer(dismissPanGesture) | ||
| 109 | + | ||
| 110 | + if #available(iOS 11.0, *) { | ||
| 111 | + scrollView.contentInsetAdjustmentBehavior = .never | ||
| 112 | + } else { | ||
| 113 | + automaticallyAdjustsScrollViewInsets = false | ||
| 114 | + } | ||
| 115 | + } | ||
| 116 | + | ||
| 117 | + private func getImageFromCell() { | ||
| 118 | + scrollView.imageView.image = cell.bgImageView.image | ||
| 119 | + } | ||
| 120 | + | ||
| 121 | + @objc private func closeAction() { | ||
| 122 | + dismiss(animated: true, completion: nil) | ||
| 123 | + let nav = self.navigationController as! CNHomePageBaseNavigationController | ||
| 124 | + nav.dismissClosure?() | ||
| 125 | + } | ||
| 126 | + | ||
| 127 | + func numberOfSections(in tableView: UITableView) -> Int { | ||
| 128 | + 2 | ||
| 129 | + } | ||
| 130 | + func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -> Int { | ||
| 131 | + if section == 0{ | ||
| 132 | + return 1 | ||
| 133 | + }else{ | ||
| 134 | + return self.dataArray.count | ||
| 135 | + } | ||
| 136 | + } | ||
| 137 | + | ||
| 138 | + func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell { | ||
| 139 | + | ||
| 140 | +// let goodsModel = self.dataArray[indexPath.row] as! CNLiveShopGoodsListModel | ||
| 141 | + if indexPath.section == 0{ | ||
| 142 | + guard let cell = tableView.dequeueReusableCell(withIdentifier: kCNLiveAlbumImageCellIdentifier) as? CNLiveAlbumImageCell | ||
| 143 | + else { | ||
| 144 | + let cell = CNLiveAlbumImageCell() | ||
| 145 | + return cell | ||
| 146 | + } | ||
| 147 | + cell.iconImgView.image = self.cell.bgImageView.image | ||
| 148 | + return cell | ||
| 149 | + }else{ | ||
| 150 | + let albumModel = self.dataArray[indexPath.row] as! CNLiveAlbumModel | ||
| 151 | + | ||
| 152 | + guard let cell = tableView.dequeueReusableCell(withIdentifier: kCNLiveAlbumCellIdentifier) as? CNLiveAlbumCell | ||
| 153 | + else { | ||
| 154 | + let cell = CNLiveAlbumCell() | ||
| 155 | + return cell | ||
| 156 | + } | ||
| 157 | + cell.albumModel = albumModel | ||
| 158 | + return cell | ||
| 159 | + } | ||
| 160 | + } | ||
| 161 | + func tableView(_ tableView: UITableView, heightForRowAt indexPath: IndexPath) -> CGFloat { | ||
| 162 | + if indexPath.section == 0{ | ||
| 163 | + return KSreenWidth | ||
| 164 | + }else{ | ||
| 165 | + return 75 | ||
| 166 | + } | ||
| 167 | + } | ||
| 168 | + | ||
| 169 | + // MARK: - 获取全部专辑列表 | ||
| 170 | + func getBlockContents(){ | ||
| 171 | + CNLiveHomePageViewModel.getBlockContents(blockId: self.slideModel!.blockId ?? "") { result, status in | ||
| 172 | + if status == .success{ | ||
| 173 | + let albumArr = result as! Array<CNLiveAlbumModel> | ||
| 174 | + self.dataArray = NSMutableArray(array: albumArr) | ||
| 175 | + self.tableView.reloadData() | ||
| 176 | + }else{ | ||
| 177 | + | ||
| 178 | + } | ||
| 179 | + } | ||
| 180 | + } | ||
| 181 | + | ||
| 182 | + @objc private func handleDismissPan(gesture: UIPanGestureRecognizer) { | ||
| 183 | + if !draggingDownToDismiss { | ||
| 184 | + return | ||
| 185 | + } | ||
| 186 | + | ||
| 187 | + let startingPoint: CGPoint | ||
| 188 | + | ||
| 189 | + if let p = interactiveStartingPoint { | ||
| 190 | + startingPoint = p | ||
| 191 | + } else { | ||
| 192 | + startingPoint = gesture.location(in: nil) | ||
| 193 | + interactiveStartingPoint = startingPoint | ||
| 194 | + } | ||
| 195 | + | ||
| 196 | + let currentLocation = gesture.location(in: nil) | ||
| 197 | + | ||
| 198 | + var progress = (currentLocation.y - startingPoint.y) / 100 | ||
| 199 | + | ||
| 200 | + //prevent viewController bigger when scrolling up | ||
| 201 | + if currentLocation.y <= startingPoint.y { | ||
| 202 | + progress = 0 | ||
| 203 | + } | ||
| 204 | + | ||
| 205 | + if progress >= 1.0 { | ||
| 206 | + dismiss(animated: true, completion: nil) | ||
| 207 | + let nav = self.navigationController as! CNHomePageBaseNavigationController | ||
| 208 | + nav.dismissClosure?() | ||
| 209 | +// dismissClosure?() | ||
| 210 | + stopDismissPanGesture(gesture) | ||
| 211 | + return | ||
| 212 | + } | ||
| 213 | + | ||
| 214 | + let targetShrinkScale: CGFloat = 0.86 | ||
| 215 | + let currentScale: CGFloat = 1 - (1 - targetShrinkScale) * progress | ||
| 216 | + | ||
| 217 | + switch gesture.state { | ||
| 218 | + case .began,.changed: | ||
| 219 | + scrollView.isScrollEnabled = false | ||
| 220 | + gesture.view?.transform = CGAffineTransform(scaleX: currentScale, y: currentScale) | ||
| 221 | + gesture.view?.layer.cornerRadius = GlobalConstants.toDayCardCornerRadius * (progress) | ||
| 222 | + scrollView.showsVerticalScrollIndicator = false | ||
| 223 | + case .cancelled,.ended: | ||
| 224 | + scrollView.isScrollEnabled = true | ||
| 225 | + stopDismissPanGesture(gesture) | ||
| 226 | + default: | ||
| 227 | + break | ||
| 228 | + } | ||
| 229 | + } | ||
| 230 | + | ||
| 231 | + //当下拉Offset超过100或取消下拉手势时,执行此方法 | ||
| 232 | + private func stopDismissPanGesture(_ gesture: UIPanGestureRecognizer) { | ||
| 233 | + draggingDownToDismiss = false | ||
| 234 | + interactiveStartingPoint = nil | ||
| 235 | + scrollView.showsVerticalScrollIndicator = true | ||
| 236 | + | ||
| 237 | + UIView.animate(withDuration: 0.2) { | ||
| 238 | + gesture.view?.transform = CGAffineTransform.identity | ||
| 239 | + } | ||
| 240 | + } | ||
| 241 | + | ||
| 242 | +} | ||
| 243 | + | ||
| 244 | +extension CNHomepageDetailViewController: UIViewControllerTransitioningDelegate { | ||
| 245 | + | ||
| 246 | + func animationController(forPresented presented: UIViewController, presenting: UIViewController, source: UIViewController) -> UIViewControllerAnimatedTransitioning? { | ||
| 247 | + return CNHomePageAnimationTransition(animationType: .present) | ||
| 248 | + } | ||
| 249 | + | ||
| 250 | + func animationController(forDismissed dismissed: UIViewController) -> UIViewControllerAnimatedTransitioning? { | ||
| 251 | + return CNHomePageAnimationTransition(animationType: .dismiss) | ||
| 252 | + } | ||
| 253 | + | ||
| 254 | + func presentationController(forPresented presented: UIViewController, presenting: UIViewController?, source: UIViewController) -> UIPresentationController? { | ||
| 255 | + return CNUpSlideCardPresentationController(presentedViewController: presented, presenting: presenting) | ||
| 256 | + } | ||
| 257 | +} | ||
| 258 | + | ||
| 259 | +extension CNHomepageDetailViewController: UIScrollViewDelegate { | ||
| 260 | + func scrollViewDidScroll(_ scrollView: UIScrollView) { | ||
| 261 | + | ||
| 262 | + if scrollView.contentOffset.y < 0 { | ||
| 263 | + scrollView.contentOffset = .zero | ||
| 264 | + draggingDownToDismiss = true | ||
| 265 | + } | ||
| 266 | + } | ||
| 267 | +} | ||
| 268 | + | ||
| 269 | +extension CNHomepageDetailViewController: UIGestureRecognizerDelegate { | ||
| 270 | + func gestureRecognizer(_ gestureRecognizer: UIGestureRecognizer, shouldRecognizeSimultaneouslyWith otherGestureRecognizer: UIGestureRecognizer) -> Bool { | ||
| 271 | + return true | ||
| 272 | + } | ||
| 273 | +} |
metaCode/Classes/Main/HomePages/Controller/CNLiveAuthViewController.swift deleted
100644 → 0
| 1 | -// | ||
| 2 | -// CNLiveAuthViewController.swift | ||
| 3 | -// metaCode | ||
| 4 | -// | ||
| 5 | -// Created by zx on 2023/12/28. | ||
| 6 | -// | ||
| 7 | - | ||
| 8 | -import Foundation | ||
| 9 | - | ||
| 10 | -class CNLiveAuthViewController:CNLiveBaseViewController{ | ||
| 11 | - override func viewDidLoad() { | ||
| 12 | - super.viewDidLoad() | ||
| 13 | - self.view.backgroundColor = .white | ||
| 14 | - } | ||
| 15 | - | ||
| 16 | - | ||
| 17 | -} |
metaCode/Classes/Main/HomePages/Controller/PlayletHomePage/CNLivePlayletHomePageController.swift
0 → 100644
| 1 | +// | ||
| 2 | +// CNLivePlayletHomePageController.swift | ||
| 3 | +// metaCode | ||
| 4 | +// | ||
| 5 | +// Created by zx on 2024/1/4. | ||
| 6 | +// 短剧主页 | ||
| 7 | + | ||
| 8 | +import Foundation | ||
| 9 | + | ||
| 10 | +class CNLivePlayletHomePageController:CNLiveBaseViewController, UITableViewDataSource, UITableViewDelegate{ | ||
| 11 | + | ||
| 12 | + let kCNLivePlayletCellIdentifier = "kCNLivePlayletCellIdentifier" | ||
| 13 | + let kCNLivePlayletHeaderCellIdentifier = "kCNLivePlayletHeaderCellIdentifier" | ||
| 14 | + | ||
| 15 | + // MARK: - 懒加载 | ||
| 16 | + ///数据源 | ||
| 17 | + lazy var dataArray: NSMutableArray = { | ||
| 18 | + var dataArray = NSMutableArray() | ||
| 19 | + return dataArray | ||
| 20 | + }() | ||
| 21 | + lazy var tableView : UITableView = { | ||
| 22 | + let tableView = UITableView(frame: .zero, style: .plain) | ||
| 23 | + tableView.dataSource = self | ||
| 24 | + tableView.delegate = self | ||
| 25 | + tableView.separatorStyle = .none | ||
| 26 | + tableView.tableFooterView = UIView.init() | ||
| 27 | + tableView.register(CNLivePlayletHomePageCell.self, forCellReuseIdentifier: kCNLivePlayletCellIdentifier) | ||
| 28 | + tableView.register(CNLivePlayletHomePageHeaderCell.self, forCellReuseIdentifier: kCNLivePlayletHeaderCellIdentifier) | ||
| 29 | + return tableView | ||
| 30 | + }() | ||
| 31 | + | ||
| 32 | + override func viewDidLoad() { | ||
| 33 | + super.viewDidLoad() | ||
| 34 | + self.setUI() | ||
| 35 | + } | ||
| 36 | + func setUI(){ | ||
| 37 | + navigationBarHidden = false | ||
| 38 | + self.view.addSubview(self.tableView) | ||
| 39 | + self.tableView.frame = CGRect(x: 0, y: KNavigationHeight, width: KSreenWidth, height: KSreenHeight-KNavigationHeight) | ||
| 40 | + } | ||
| 41 | + func numberOfSections(in tableView: UITableView) -> Int { | ||
| 42 | + 2 | ||
| 43 | + } | ||
| 44 | + func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -> Int { | ||
| 45 | + if section == 0{ | ||
| 46 | + return 1 | ||
| 47 | + } | ||
| 48 | + return 30 //self.dataArray.count | ||
| 49 | + } | ||
| 50 | + | ||
| 51 | + func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell { | ||
| 52 | + | ||
| 53 | +// let goodsModel = self.dataArray[indexPath.row] as! CNLiveShopGoodsListModel | ||
| 54 | + if indexPath.section == 0{ | ||
| 55 | + guard let cell = tableView.dequeueReusableCell(withIdentifier: kCNLivePlayletHeaderCellIdentifier) as? CNLivePlayletHomePageHeaderCell | ||
| 56 | + else { | ||
| 57 | + let cell = CNLivePlayletHomePageHeaderCell() | ||
| 58 | + return cell | ||
| 59 | + } | ||
| 60 | + | ||
| 61 | + return cell | ||
| 62 | + }else{ | ||
| 63 | + guard let cell = tableView.dequeueReusableCell(withIdentifier: kCNLivePlayletCellIdentifier) as? CNLivePlayletHomePageCell | ||
| 64 | + else { | ||
| 65 | + let cell = CNLivePlayletHomePageCell() | ||
| 66 | + return cell | ||
| 67 | + } | ||
| 68 | + cell.iconImgView.backgroundColor = .red | ||
| 69 | + return cell | ||
| 70 | + } | ||
| 71 | + } | ||
| 72 | + func tableView(_ tableView: UITableView, heightForRowAt indexPath: IndexPath) -> CGFloat { | ||
| 73 | + if indexPath.section == 0{ | ||
| 74 | + return 300 | ||
| 75 | + }else{ | ||
| 76 | + return 100 | ||
| 77 | + } | ||
| 78 | + } | ||
| 79 | +} |
metaCode/Classes/Main/HomePages/Model/CNLiveAlbumListModel.swift
0 → 100644
| 1 | +// | ||
| 2 | +// CNLiveAlbumListModel.swift | ||
| 3 | +// metaCode | ||
| 4 | +// | ||
| 5 | +// Created by zx on 2024/1/8. | ||
| 6 | +// 专辑视频列表详情(播放地址 ,点赞数等信息) | ||
| 7 | + | ||
| 8 | +import Foundation | ||
| 9 | + | ||
| 10 | +class CNLiveAlbumListModel:BaseModel{ | ||
| 11 | + var title = "" | ||
| 12 | + var shortTitle = "" | ||
| 13 | + var subTitle = "" | ||
| 14 | + var product:CNLiveAlbumProductModel? | ||
| 15 | + var poster = "" | ||
| 16 | + var model = "" | ||
| 17 | + var thirdUrl = "" | ||
| 18 | + var colours = "" | ||
| 19 | + var address = "" | ||
| 20 | + var contentId = "" | ||
| 21 | + var source = "" | ||
| 22 | + var sourceName = "" | ||
| 23 | + var pid = "" | ||
| 24 | + var witnessId = "" | ||
| 25 | + var videoUrl = "" | ||
| 26 | + var duration = "" | ||
| 27 | + var number = "" | ||
| 28 | + var goods = "" | ||
| 29 | + var icon : CNLiveAlbumListIconModel? | ||
| 30 | + var time = "" | ||
| 31 | + var tagId = "" | ||
| 32 | + var tagName = "" | ||
| 33 | + var tool :CNLiveAlbumListToolModel? | ||
| 34 | + var activityEndTime = "" | ||
| 35 | + var h5Url = "" | ||
| 36 | + var shareUrl = "" | ||
| 37 | + var album:CNLiveAlbumListAlbumModel? | ||
| 38 | + var block = "" | ||
| 39 | + var isHorizontalScreen = "" | ||
| 40 | + var videoShowType = "" | ||
| 41 | + //非接口数据 | ||
| 42 | + var albumMsgModel:CNLiveAlbumMsgModel? | ||
| 43 | +} | ||
| 44 | +class CNLiveAlbumListIconModel:BaseModel{ | ||
| 45 | + var face = "" | ||
| 46 | + var id = "" | ||
| 47 | + var name = "" | ||
| 48 | + var type = "" | ||
| 49 | + var desc = "" | ||
| 50 | + var focused = false | ||
| 51 | + var fansNum = "" | ||
| 52 | + var authInfos = "" | ||
| 53 | +} | ||
| 54 | +class CNLiveAlbumListToolModel:BaseModel{ | ||
| 55 | + var commentsNum = "" | ||
| 56 | + var commentList = "" | ||
| 57 | + var collectioned = false | ||
| 58 | + var likeList = "" | ||
| 59 | + var liked = false | ||
| 60 | + var likesNum = "" | ||
| 61 | + var voteNum = "" | ||
| 62 | + var shareNum = "" | ||
| 63 | + var playNum = "" | ||
| 64 | + var collectionNum = "" | ||
| 65 | + var sort = "" | ||
| 66 | + var voted = false | ||
| 67 | +} | ||
| 68 | +class CNLiveAlbumListAlbumModel:BaseModel{ | ||
| 69 | + var albumId = "" | ||
| 70 | + var icon = "" | ||
| 71 | + var name = "" | ||
| 72 | + var model = "" | ||
| 73 | + var product:CNLiveAlbumProductModel? | ||
| 74 | +} | ||
| 75 | + |
metaCode/Classes/Main/HomePages/Model/CNLiveAlbumModel.swift
0 → 100644
| 1 | +// | ||
| 2 | +// CNLiveAlbumModel.swift | ||
| 3 | +// metaCode | ||
| 4 | +// | ||
| 5 | +// Created by zx on 2024/1/8. | ||
| 6 | +// 全部专辑列表数据 | ||
| 7 | + | ||
| 8 | +import Foundation | ||
| 9 | + | ||
| 10 | +class CNLiveAlbumModel:BaseModel{ | ||
| 11 | + var title = "" | ||
| 12 | + var subTitle = "" | ||
| 13 | + var poster = "" | ||
| 14 | + var contentId = "" | ||
| 15 | + var pid = "" | ||
| 16 | + var tag = "" | ||
| 17 | + var model = "" | ||
| 18 | + var thirdUrl = "" | ||
| 19 | + var publishTime = "" | ||
| 20 | + var shareUrl = "" | ||
| 21 | + var spIcon = "" | ||
| 22 | + var product:CNLiveAlbumProductModel? | ||
| 23 | + //还有部分属性没写 | ||
| 24 | +} | ||
| 25 | +class CNLiveAlbumProductModel:BaseModel{ | ||
| 26 | + var productId = "" | ||
| 27 | + var productTitle = "" | ||
| 28 | + var productImg = "" | ||
| 29 | + var albumProductType = "" | ||
| 30 | + var productType = "" | ||
| 31 | + var androidRmb = "" | ||
| 32 | + var androidOriginalRmb = "" | ||
| 33 | + var iosOriginalRmb = "" | ||
| 34 | + var iosRmb = "" | ||
| 35 | + var point = "" | ||
| 36 | + var promCode = "" | ||
| 37 | + var orderingGuide = "" | ||
| 38 | + var activityDesc = "" | ||
| 39 | + var siteId = "" | ||
| 40 | + var validPeriod = "" | ||
| 41 | + var expiryDate = "" | ||
| 42 | + var effectiveDate = "" | ||
| 43 | + var check = false | ||
| 44 | +} | ||
| 45 | + | ||
| 46 | + |
metaCode/Classes/Main/HomePages/Model/CNLiveAlbumMsgModel.swift
0 → 100644
| 1 | +// | ||
| 2 | +// CNLiveAlbumMsgModel.swift | ||
| 3 | +// metaCode | ||
| 4 | +// | ||
| 5 | +// Created by zx on 2024/1/8. | ||
| 6 | +// 专辑简介详情 | ||
| 7 | + | ||
| 8 | +import Foundation | ||
| 9 | + | ||
| 10 | +class CNLiveAlbumMsgModel:BaseModel{ | ||
| 11 | + var albumId = "" | ||
| 12 | + var albumImg = "" | ||
| 13 | + var albumName = "" | ||
| 14 | + var product:CNLiveAlbumProductModel? | ||
| 15 | + var desc = "" | ||
| 16 | + var descImg = "" | ||
| 17 | + var subTitle = "" | ||
| 18 | + var actor = "" | ||
| 19 | + var actorName = "" | ||
| 20 | + var time = "" | ||
| 21 | + var spIcon = "" | ||
| 22 | + var siteId = "" | ||
| 23 | + var episodeNow = "" | ||
| 24 | + var episodeAll = "" | ||
| 25 | + var subscriptions = "" | ||
| 26 | + var subscribe = false | ||
| 27 | + var episodeLast = "" | ||
| 28 | + var contentIdLast = "" | ||
| 29 | + var collection = false //是否追剧 | ||
| 30 | +} |
metaCode/Classes/Main/HomePages/Model/CNLiveHomePageModel.swift
0 → 100644
| 1 | +// | ||
| 2 | +// CNLiveHomePageModel.swift | ||
| 3 | +// metaCode | ||
| 4 | +// | ||
| 5 | +// Created by zx on 2024/1/8. | ||
| 6 | +// 首页model | ||
| 7 | + | ||
| 8 | +import Foundation | ||
| 9 | + | ||
| 10 | +class CNLiveHomePageModel:BaseModel{ | ||
| 11 | + var endRow = 0 | ||
| 12 | + var firstPage = 0 | ||
| 13 | + var hasNextPage = false | ||
| 14 | + var hasPreviousPage = false | ||
| 15 | + var isFirstPage = true | ||
| 16 | + var isLastPage = true | ||
| 17 | + var lastPage = 0 | ||
| 18 | + var list = [CNLiveHomePageListModel]() | ||
| 19 | + var navigateFirstPage = 0 | ||
| 20 | + var navigateLastPage = 0 | ||
| 21 | + var navigatePages = 0 | ||
| 22 | + var navigatepageNums:Array<Any> = [] | ||
| 23 | + var nextPage = 0 | ||
| 24 | + var pageNum = 0 | ||
| 25 | + var pageSize = 0 | ||
| 26 | + var pages = 0 | ||
| 27 | + var prePage = 0 | ||
| 28 | + var size = 0 | ||
| 29 | + var startRow = 0 | ||
| 30 | + var total = 0 | ||
| 31 | +} | ||
| 32 | + | ||
| 33 | +class CNLiveHomePageListModel:BaseModel{ | ||
| 34 | + var enable = true | ||
| 35 | + var content = ""//页面id h5地址 type=3时 content为空 | ||
| 36 | + var sort = 0 | ||
| 37 | + var createTime = "" | ||
| 38 | + var id = "" | ||
| 39 | + var updateTime = "" | ||
| 40 | + var type = 0//1页面 2h5 3在追短剧 | ||
| 41 | +} |
metaCode/Classes/Main/HomePages/View/HomePage/CNLiveHomePageDuanJuCell.swift
0 → 100644
| 1 | +// | ||
| 2 | +// CNLiveHomePageDuanJuCell.swift | ||
| 3 | +// metaCode | ||
| 4 | +// | ||
| 5 | +// Created by zx on 2024/1/8. | ||
| 6 | +// 首页-在追短剧cell | ||
| 7 | + | ||
| 8 | +import Foundation | ||
| 9 | +//enum GlobalConstants { | ||
| 10 | +// static let leftMargin: CGFloat = 20 | ||
| 11 | +// | ||
| 12 | +// static let toDayCardRowH: CGFloat = 440 | ||
| 13 | +// static let toDayCardCornerRadius: CGFloat = 12.0 | ||
| 14 | +// static let todayCardSize: CGSize = CGSize(width: KSreenWidth - 2 * 15, height: DownSlideSingleCourseImgH) | ||
| 15 | +// static let cardDetailTopImageH: CGFloat = 500 | ||
| 16 | +// | ||
| 17 | +// static let iconBorderColor: CGColor = UIColor(red: 239/255.0, green: 240/255.0, blue: 241/255.0, alpha: 1).cgColor | ||
| 18 | +// static let iconBorderWidth: CGFloat = 0.8 | ||
| 19 | +// static let iconCornerRadius: CGFloat = 17.5 | ||
| 20 | +// | ||
| 21 | +// static let textBlueColor = UIColor(red: 0/255.0, green: 122/255.0, blue: 255/255.0, alpha: 1.0) //007AFF | ||
| 22 | +// static let speratorLineColor = UIColor(red: 224/255.0, green: 224/255.0, blue: 224/255.0, alpha: 1) | ||
| 23 | +// | ||
| 24 | +//} | ||
| 25 | +// | ||
| 26 | +/////全部课程 标题高度 | ||
| 27 | +//let DownSlideAllCourseTitleH: CGFloat = 55 | ||
| 28 | +////全部课程 每row_topY间距 | ||
| 29 | +//let DownSlideAllCourseRowTopYGap: CGFloat = 10 | ||
| 30 | +////全部课程 每row_topY间距 | ||
| 31 | +//let DownSlideAllCourseRowBottomYGap: CGFloat = 20 | ||
| 32 | +////全部课程 每row_img宽高 | ||
| 33 | +//let DownSlideAllCourseRowImageWH: CGFloat = 45 | ||
| 34 | +// | ||
| 35 | +/////全部课程 每row高度 | ||
| 36 | +//let DownSlideAllCourseRowH: CGFloat = DownSlideAllCourseRowTopYGap+DownSlideAllCourseRowBottomYGap + DownSlideAllCourseRowImageWH | ||
| 37 | +/////全部课程 宽度 | ||
| 38 | +//let DownSlideAllCourseW: CGFloat = KSreenWidth - DownSlideRecommendLeftGap*2 | ||
| 39 | +// | ||
| 40 | +/////单节课程 大图高度 | ||
| 41 | +//let DownSlideSingleCourseImgH: CGFloat = 345 | ||
| 42 | +/////单节课程 更多课程高度 | ||
| 43 | +//let DownSlideSingleCourseMoreH: CGFloat = 60 | ||
| 44 | +/////单节课程 宽度 | ||
| 45 | +//let DownSlideSingleCourseW: CGFloat = KSreenWidth - DownSlideRecommendLeftGap*2 | ||
| 46 | + | ||
| 47 | +class CNLiveHomePageDuanJuCell:UITableViewCell{ | ||
| 48 | + | ||
| 49 | + let bgBackView = UIView() | ||
| 50 | + let bgImageView = UIImageView() | ||
| 51 | + | ||
| 52 | + //slideModel | ||
| 53 | + var _slideModel : CNLiveDownSlideModel? | ||
| 54 | + var slideModel : CNLiveDownSlideModel? { | ||
| 55 | + get{ | ||
| 56 | + _slideModel | ||
| 57 | + } | ||
| 58 | + set{ | ||
| 59 | + _slideModel = newValue! | ||
| 60 | + self.setupNewUI(model: _slideModel!) | ||
| 61 | + } | ||
| 62 | + } | ||
| 63 | + | ||
| 64 | + override init(style: UITableViewCell.CellStyle, reuseIdentifier: String?) { | ||
| 65 | + super.init(style: style, reuseIdentifier: reuseIdentifier) | ||
| 66 | + self.selectionStyle = .none | ||
| 67 | + setupUI() | ||
| 68 | + } | ||
| 69 | + | ||
| 70 | + required init?(coder aDecoder: NSCoder) { | ||
| 71 | + fatalError("init(coder:) has not been implemented") | ||
| 72 | + } | ||
| 73 | + | ||
| 74 | + private func setupUI() { | ||
| 75 | + contentView.backgroundColor = HexColor(kCNDownSlideBackgroundColorHex) | ||
| 76 | + } | ||
| 77 | + | ||
| 78 | + func setupNewUI(model:CNLiveDownSlideModel){ | ||
| 79 | + if model.type == SlideModelTypeAllCourse12 { | ||
| 80 | + //全部课程列表 | ||
| 81 | + contentView.addSubview(bgBackView) | ||
| 82 | + | ||
| 83 | + bgBackView.frame = CGRect(x: DownSlideRecommendLeftGap, y: 0,width:DownSlideSingleCourseW , height:model.cellH-DownSlideRecommendLeftGap) | ||
| 84 | + bgBackView.layer.shadowColor = HexColor("#000000")?.cgColor | ||
| 85 | + bgBackView.layer.shadowRadius = 12 | ||
| 86 | + bgBackView.layer.shadowOpacity = 1 | ||
| 87 | + bgBackView.layer.shadowOffset = CGSize(width: 0, height: 0) | ||
| 88 | + bgBackView.layer.cornerRadius = 12 | ||
| 89 | + bgBackView.clipsToBounds = true | ||
| 90 | + bgBackView.backgroundColor = HexColor("#FFFFFF") | ||
| 91 | + | ||
| 92 | + let titleLbl = UILabel(frame: CGRect(x: DownSlideRecommendLeftGap, y: DownSlideRecommendLeftGap, width: DownSlideSingleCourseW-DownSlideRecommendLeftGap*2, height: 30)) | ||
| 93 | + titleLbl.text = model.blockName ?? "全部课程" | ||
| 94 | + titleLbl.font = BoldFont_21 | ||
| 95 | + titleLbl.textColor = HexColor("#333333") | ||
| 96 | + bgBackView.addSubview(titleLbl) | ||
| 97 | + | ||
| 98 | + //总块数 | ||
| 99 | + let contentsNum = model.contents.count | ||
| 100 | + //model行数 | ||
| 101 | + let row = model.rowNum | ||
| 102 | + //总显示块数 | ||
| 103 | + var totalNum = (contentsNum >= row) ? row : contentsNum | ||
| 104 | + if row == 0{//row为0 , contents全部显示 | ||
| 105 | + totalNum = contentsNum | ||
| 106 | + } | ||
| 107 | + for i in 0..<totalNum{//i是第几行 | ||
| 108 | + let contentMdl = model.contents[i] | ||
| 109 | + | ||
| 110 | + //小icon | ||
| 111 | + let imageView = UIImageView(frame: CGRectMake(DownSlideRecommendLeftGap, titleLbl.bottom+DownSlideRecommendLeftGap+CGFloat(i)*(DownSlideAllCourseRowTopYGap+DownSlideAllCourseRowImageWH+DownSlideAllCourseRowBottomYGap), CGFloat(DownSlideAllCourseRowImageWH), CGFloat(DownSlideAllCourseRowImageWH))) | ||
| 112 | + imageView.kf.setImage(with: URL(string:contentMdl.poster!)) | ||
| 113 | + bgBackView.addSubview(imageView) | ||
| 114 | + | ||
| 115 | + let titleLbl = UILabel(frame: CGRect(x: imageView.right+DownSlideRecommendLeftGap, y: imageView.top, width: DownSlideSingleCourseW-90-imageView.right, height: 21)) | ||
| 116 | + titleLbl.text = contentMdl.title ?? "婴儿课程" | ||
| 117 | + titleLbl.font = Font_15 | ||
| 118 | + titleLbl.textColor = HexColor("#333333") | ||
| 119 | + bgBackView.addSubview(titleLbl) | ||
| 120 | + | ||
| 121 | + let subTitleLbl = UILabel(frame: CGRect(x: titleLbl.left, y:titleLbl.bottom+3 , width: titleLbl.width, height: 17)) | ||
| 122 | + subTitleLbl.text = contentMdl.subTitle ?? "适应3-6岁" | ||
| 123 | + subTitleLbl.font = Font_12 | ||
| 124 | + subTitleLbl.textColor = HexColor("#999999") | ||
| 125 | + bgBackView.addSubview(subTitleLbl) | ||
| 126 | + | ||
| 127 | + let enterBtn = UIButton(type: .custom) | ||
| 128 | + enterBtn.frame = CGRect(x: bgBackView.right-25-65, y: 0, width: 65, height: 30) | ||
| 129 | + enterBtn.centerY = imageView.centerY | ||
| 130 | + enterBtn.setBackgroundImage(UIImage(named: "homepage_down_enter"), for: .normal) | ||
| 131 | + enterBtn.setTitle("进入", for: .normal) | ||
| 132 | + enterBtn.titleLabel?.font = BoldFont_13 | ||
| 133 | + enterBtn.setTitleColor(HexColor("#FFFFFF"), for: .normal) | ||
| 134 | + enterBtn.addTarget(self, action: #selector(enterBtnAction(_:)), for: .touchUpInside) | ||
| 135 | + enterBtn.tag = i | ||
| 136 | + bgBackView.addSubview(enterBtn) | ||
| 137 | + } | ||
| 138 | + }else if model.type == SlideModelTypeOneCourse75 { | ||
| 139 | + //单图课程 | ||
| 140 | + contentView.addSubview(bgBackView) | ||
| 141 | + bgBackView.addSubview(bgImageView) | ||
| 142 | + | ||
| 143 | + bgBackView.frame = CGRect(x: DownSlideRecommendLeftGap, y: 0,width:DownSlideSingleCourseW , height:DownSlideSingleCourseMoreH+DownSlideSingleCourseImgH) | ||
| 144 | + bgBackView.layer.shadowColor = UIColor.black.cgColor | ||
| 145 | + bgBackView.layer.shadowOpacity = 0.4 | ||
| 146 | + bgBackView.layer.shadowOffset = CGSize(width: 0, height: 1) | ||
| 147 | + | ||
| 148 | + bgImageView.frame = CGRect(x: 0, y: 0,width:DownSlideSingleCourseW , height:DownSlideSingleCourseImgH) | ||
| 149 | + bgImageView.contentMode = .scaleAspectFill | ||
| 150 | + bgImageView.layer.cornerRadius = GlobalConstants.toDayCardCornerRadius | ||
| 151 | + bgImageView.layer.maskedCorners = [.layerMinXMinYCorner, .layerMaxXMinYCorner] | ||
| 152 | + bgImageView.layer.masksToBounds = true | ||
| 153 | + bgImageView.kf.setImage(with: URL(string: model.contents[0].poster ?? "")) | ||
| 154 | + | ||
| 155 | + let titleLbl = UILabel(frame: CGRect(x: DownSlideRecommendLeftGap, y: DownSlideRecommendLeftGap, width: DownSlideSingleCourseW-DownSlideRecommendLeftGap*2, height: 30)) | ||
| 156 | + titleLbl.text = model.contents[0].title ?? "婴儿课程" | ||
| 157 | + titleLbl.font = BoldFont_21 | ||
| 158 | + titleLbl.textColor = HexColor("#FFFFFF") | ||
| 159 | + bgImageView.addSubview(titleLbl) | ||
| 160 | + | ||
| 161 | + let subTitleLbl = UILabel(frame: CGRect(x: DownSlideRecommendLeftGap, y:titleLbl.bottom , width: DownSlideSingleCourseW-DownSlideRecommendLeftGap*2, height: 30)) | ||
| 162 | + subTitleLbl.text = model.contents[0].subTitle ?? "适应3-6岁" | ||
| 163 | + subTitleLbl.font = Font_12 | ||
| 164 | + subTitleLbl.textColor = HexColor("#FFFFFF") | ||
| 165 | + bgImageView.addSubview(subTitleLbl) | ||
| 166 | + | ||
| 167 | + //单节底部视图 | ||
| 168 | + let singleCourseBottomView = UIView(frame: CGRect(x: 0, y: DownSlideSingleCourseImgH, width: DownSlideSingleCourseW, height: DownSlideSingleCourseMoreH)) | ||
| 169 | + singleCourseBottomView.layer.cornerRadius = 12 | ||
| 170 | + singleCourseBottomView.layer.maskedCorners = [.layerMinXMaxYCorner, .layerMaxXMaxYCorner] | ||
| 171 | + singleCourseBottomView.backgroundColor = .white | ||
| 172 | + singleCourseBottomView.isUserInteractionEnabled = true | ||
| 173 | + bgBackView.addSubview(singleCourseBottomView) | ||
| 174 | + | ||
| 175 | + let moreLabel = UILabel(frame: CGRect(x: DownSlideRecommendLeftGap, y: 15, width: DownSlideSingleCourseW - 50 - DownSlideRecommendLeftGap , height: 30)) | ||
| 176 | + moreLabel.text = model.blockName ?? "更多" | ||
| 177 | + moreLabel.font = Font_15 | ||
| 178 | + moreLabel.textColor = HexColor("#333333") | ||
| 179 | + singleCourseBottomView.addSubview(moreLabel) | ||
| 180 | + | ||
| 181 | + let moreImgView = UIImageView(image: UIImage(named: "homepage_down_more")) | ||
| 182 | + moreImgView.left = moreLabel.right | ||
| 183 | + moreImgView.centerY = moreLabel.centerY | ||
| 184 | + singleCourseBottomView.addSubview(moreImgView) | ||
| 185 | + } | ||
| 186 | + } | ||
| 187 | + | ||
| 188 | + //MARK: - 事件 | ||
| 189 | + @objc func enterBtnAction(_ sender: UIButton){ | ||
| 190 | + let tag = sender.tag | ||
| 191 | + let contentMdl = self.slideModel?.contents[tag] | ||
| 192 | + CNLiveDownSlideTool.pushWebVCWithContentsMdl(contentMdl: contentMdl!) | ||
| 193 | + } | ||
| 194 | +} |
metaCode/Classes/Main/HomePages/View/HomepageDetail/CNLiveAlbumCell.swift
0 → 100644
| 1 | +// | ||
| 2 | +// CNLiveAlbumCell.swift | ||
| 3 | +// metaCode | ||
| 4 | +// | ||
| 5 | +// Created by zx on 2024/1/8. | ||
| 6 | +// | ||
| 7 | + | ||
| 8 | +import Foundation | ||
| 9 | +import QMUIKit | ||
| 10 | +class CNLiveAlbumCell:UITableViewCell{ | ||
| 11 | + | ||
| 12 | + var albumModelArr:Array<CNLiveAlbumListModel>? | ||
| 13 | + //AlbumModel | ||
| 14 | + var _albumModel : CNLiveAlbumModel? | ||
| 15 | + var albumModel : CNLiveAlbumModel? { | ||
| 16 | + get{ | ||
| 17 | + _albumModel | ||
| 18 | + } | ||
| 19 | + set{ | ||
| 20 | + _albumModel = newValue! | ||
| 21 | + | ||
| 22 | + self.setupNewUI(model: _albumModel!) | ||
| 23 | + } | ||
| 24 | + } | ||
| 25 | + //MARK: - 懒加载 | ||
| 26 | + lazy var iconImgView :UIImageView = { | ||
| 27 | + let iconImgView = UIImageView(frame: CGRect(x: 15, y: 15, width: 45, height: 45)) | ||
| 28 | + iconImgView.layer.cornerRadius = 5 | ||
| 29 | + iconImgView.clipsToBounds = true | ||
| 30 | + return iconImgView | ||
| 31 | + }() | ||
| 32 | + ///标题 | ||
| 33 | + lazy var titleLabl: UILabel = { | ||
| 34 | + let titleLabel = UILabel.init(frame: CGRectMake(self.iconImgView.right+15, 15, KSreenWidth-(self.iconImgView.right+15)-80, 21)) | ||
| 35 | + titleLabel.textColor = HexColor("#333333") | ||
| 36 | + titleLabel.textAlignment = .left | ||
| 37 | + titleLabel.font = Font_15 | ||
| 38 | + titleLabel.text = "啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊" | ||
| 39 | + return titleLabel | ||
| 40 | + }() | ||
| 41 | + ///副标题 | ||
| 42 | + lazy var subTitleLabel: UILabel = { | ||
| 43 | + let titleLabel = UILabel.init(frame: CGRectMake(self.iconImgView.right+15, self.titleLabl.bottom+5, 60, 17)) | ||
| 44 | + titleLabel.textColor = HexColor("#999999") | ||
| 45 | + titleLabel.textAlignment = .left | ||
| 46 | + titleLabel.font = Font_12 | ||
| 47 | + titleLabel.text = "共68集" | ||
| 48 | + return titleLabel | ||
| 49 | + }() | ||
| 50 | + lazy var playBtn: QMUIButton = { | ||
| 51 | + let playBtn = QMUIButton.init(type: .custom) | ||
| 52 | + playBtn.frame = CGRect(x: KSreenWidth-80, y: 0, width: 65, height: 26) | ||
| 53 | + playBtn.centerY = self.iconImgView.centerY | ||
| 54 | + playBtn.layer.cornerRadius = 13 | ||
| 55 | + playBtn.clipsToBounds = true | ||
| 56 | + playBtn.setTitle("播放", for: .normal) | ||
| 57 | + playBtn.setTitleColor(HexColor("#FFFFFF"), for: .normal) | ||
| 58 | + playBtn.backgroundColor = HexColor("#609AFF") | ||
| 59 | + playBtn.titleLabel?.font = Font_13 | ||
| 60 | + playBtn.addTarget(self, action: #selector(playBtnAction), for: .touchUpInside) | ||
| 61 | + return playBtn | ||
| 62 | + }() | ||
| 63 | + override init(style: UITableViewCell.CellStyle, reuseIdentifier: String?) { | ||
| 64 | + super.init(style: style, reuseIdentifier: reuseIdentifier) | ||
| 65 | + self.selectionStyle = .none | ||
| 66 | + self.contentView.addSubview(self.iconImgView) | ||
| 67 | + self.contentView.addSubview(self.titleLabl) | ||
| 68 | + self.contentView.addSubview(self.subTitleLabel) | ||
| 69 | + self.contentView.addSubview(self.playBtn) | ||
| 70 | + } | ||
| 71 | + | ||
| 72 | + required init?(coder: NSCoder) { | ||
| 73 | + fatalError("init(coder:) has not been implemented") | ||
| 74 | + } | ||
| 75 | + func setupNewUI(model:CNLiveAlbumModel){ | ||
| 76 | + self.titleLabl.text = model.title | ||
| 77 | + self.subTitleLabel.text = model.subTitle | ||
| 78 | + self.iconImgView.kf.setImage(with: URL(string: model.poster)) | ||
| 79 | + } | ||
| 80 | + @objc func playBtnAction(){ | ||
| 81 | + showLoading(message: "") | ||
| 82 | + self.getAlbumList() | ||
| 83 | + } | ||
| 84 | + | ||
| 85 | + //获取专辑详情(简介等) | ||
| 86 | + func getAlbumMsg(){ | ||
| 87 | + CNLiveHomePageViewModel.getAlbumMsg(aid: self.albumModel!.contentId) { result, status in | ||
| 88 | + hiddenLoading() | ||
| 89 | + if status == .success{ | ||
| 90 | + let model = result as! CNLiveAlbumMsgModel | ||
| 91 | + for listModel in self.albumModelArr! { | ||
| 92 | + listModel.albumMsgModel = model | ||
| 93 | + } | ||
| 94 | + print("") | ||
| 95 | + }else{ | ||
| 96 | + | ||
| 97 | + } | ||
| 98 | + } | ||
| 99 | + } | ||
| 100 | + //获取专辑视频列表详情(播放地址 ,点赞数等信息) | ||
| 101 | + func getAlbumList(){ | ||
| 102 | + showLoading(message: "") | ||
| 103 | + CNLiveHomePageViewModel.getAlbumList(aid: self.albumModel!.contentId){ result, status in | ||
| 104 | + hiddenLoading() | ||
| 105 | + if status == .success{ | ||
| 106 | + let arr = result as! Array<CNLiveAlbumListModel> | ||
| 107 | + self.albumModelArr = Array(arr) | ||
| 108 | + self.getAlbumMsg() | ||
| 109 | + }else{ | ||
| 110 | + | ||
| 111 | + } | ||
| 112 | + } | ||
| 113 | + } | ||
| 114 | +} |
metaCode/Classes/Main/HomePages/View/HomepageDetail/CNLiveAlbumImageCell.swift
0 → 100644
| 1 | +// | ||
| 2 | +// CNLiveAlbumImageCell.swift | ||
| 3 | +// metaCode | ||
| 4 | +// | ||
| 5 | +// Created by zx on 2024/1/8. | ||
| 6 | +// | ||
| 7 | + | ||
| 8 | +import Foundation | ||
| 9 | + | ||
| 10 | +class CNLiveAlbumImageCell:UITableViewCell{ | ||
| 11 | + | ||
| 12 | + //MARK: - 懒加载 | ||
| 13 | + lazy var iconImgView :UIImageView = { | ||
| 14 | + let iconImgView = UIImageView(frame: CGRect(x: 0, y: 0, width: KSreenWidth, height: KSreenWidth)) | ||
| 15 | + return iconImgView | ||
| 16 | + }() | ||
| 17 | + | ||
| 18 | + override init(style: UITableViewCell.CellStyle, reuseIdentifier: String?) { | ||
| 19 | + super.init(style: style, reuseIdentifier: reuseIdentifier) | ||
| 20 | + self.selectionStyle = .none | ||
| 21 | + setupUI() | ||
| 22 | + } | ||
| 23 | + | ||
| 24 | + required init?(coder aDecoder: NSCoder) { | ||
| 25 | + fatalError("init(coder:) has not been implemented") | ||
| 26 | + } | ||
| 27 | + | ||
| 28 | + private func setupUI() { | ||
| 29 | + contentView.backgroundColor = HexColor(kCNDownSlideBackgroundColorHex) | ||
| 30 | + self.contentView.addSubview(self.iconImgView) | ||
| 31 | + } | ||
| 32 | + | ||
| 33 | + | ||
| 34 | +} |
metaCode/Classes/Main/HomePages/View/PlayletHomePage/CNLivePlayletHomePageCell.swift
0 → 100644
| 1 | +// | ||
| 2 | +// CNLivePlayletHomePageCell.swift | ||
| 3 | +// metaCode | ||
| 4 | +// | ||
| 5 | +// Created by zx on 2024/1/4. | ||
| 6 | +// | ||
| 7 | + | ||
| 8 | +import Foundation | ||
| 9 | +import QMUIKit | ||
| 10 | +class CNLivePlayletHomePageCell:UITableViewCell{ | ||
| 11 | + //MARK: - 懒加载 | ||
| 12 | + lazy var iconImgView :UIImageView = { | ||
| 13 | + let iconImgView = UIImageView(frame: CGRect(x: 20, y: 10, width: 60, height: 90)) | ||
| 14 | + return iconImgView | ||
| 15 | + }() | ||
| 16 | + ///标题 | ||
| 17 | + lazy var titleLabl: UILabel = { | ||
| 18 | + let titleLabel = UILabel.init(frame: CGRectMake(self.iconImgView.right+15, 15, KSreenWidth-(self.iconImgView.right+15)-10, 21)) | ||
| 19 | + titleLabel.textColor = HexColor("#333333") | ||
| 20 | + titleLabel.textAlignment = .left | ||
| 21 | + titleLabel.font = Font_15 | ||
| 22 | + titleLabel.numberOfLines = 2 | ||
| 23 | + titleLabel.text = "啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊" | ||
| 24 | + let height = titleLabel.qmui_lineHeight | ||
| 25 | + titleLabel.height = height*2 | ||
| 26 | + return titleLabel | ||
| 27 | + }() | ||
| 28 | + ///时长 | ||
| 29 | + lazy var timeLabel: UILabel = { | ||
| 30 | + let titleLabel = UILabel.init(frame: CGRectMake(self.iconImgView.right+15, self.titleLabl.bottom+10, 40, 21)) | ||
| 31 | + titleLabel.textColor = HexColor("#333333") | ||
| 32 | + titleLabel.textAlignment = .left | ||
| 33 | + titleLabel.font = Font_15 | ||
| 34 | + titleLabel.text = "04:31" | ||
| 35 | + let height = titleLabel.qmui_lineHeight | ||
| 36 | + titleLabel.height = height | ||
| 37 | + return titleLabel | ||
| 38 | + }() | ||
| 39 | + lazy var likeBtn: UIButton = { | ||
| 40 | + let likeBtn = UIButton.init(type: .custom) | ||
| 41 | + likeBtn.frame = CGRect(x: self.timeLabel.right+20, y: self.timeLabel.top, width: 60, height: 20) | ||
| 42 | + likeBtn.setTitle("24.0w", for: .normal) | ||
| 43 | + likeBtn.setTitleColor(HexColor("#333333"), for: .normal) | ||
| 44 | + likeBtn.setImage(UIImage(named: "DS_coupon_unSelect"), for: .normal) | ||
| 45 | + likeBtn.titleLabel?.font = Font_14 | ||
| 46 | + likeBtn.setupButtonImageAndTitlePossitionWith(padding: 5, style: .left) | ||
| 47 | + return likeBtn | ||
| 48 | + }() | ||
| 49 | + | ||
| 50 | + override init(style: UITableViewCell.CellStyle, reuseIdentifier: String?) { | ||
| 51 | + super.init(style: style, reuseIdentifier: reuseIdentifier) | ||
| 52 | + self.selectionStyle = .none | ||
| 53 | + self.addSubview(self.iconImgView) | ||
| 54 | + self.addSubview(self.titleLabl) | ||
| 55 | + self.addSubview(self.timeLabel) | ||
| 56 | + self.addSubview(self.likeBtn) | ||
| 57 | + } | ||
| 58 | + | ||
| 59 | + required init?(coder: NSCoder) { | ||
| 60 | + fatalError("init(coder:) has not been implemented") | ||
| 61 | + } | ||
| 62 | +} |
metaCode/Classes/Main/HomePages/View/PlayletHomePage/CNLivePlayletHomePageHeaderCell.swift
0 → 100644
| 1 | +// | ||
| 2 | +// CNLivePlayletHomePageHeaderCell.swift | ||
| 3 | +// metaCode | ||
| 4 | +// | ||
| 5 | +// Created by zx on 2024/1/4. | ||
| 6 | +// 短剧主页-头视图Cell | ||
| 7 | + | ||
| 8 | +import Foundation | ||
| 9 | +import QMUIKit | ||
| 10 | +import SwiftUI | ||
| 11 | +import SnapKit | ||
| 12 | +class CNLivePlayletHomePageHeaderCell:UITableViewCell{ | ||
| 13 | + //MARK: - 懒加载 | ||
| 14 | + lazy var iconImgView :UIImageView = { | ||
| 15 | + let iconImgView = UIImageView(frame: CGRect(x: 20, y: 20, width: 100, height: 100)) | ||
| 16 | + return iconImgView | ||
| 17 | + }() | ||
| 18 | + ///标题 | ||
| 19 | + lazy var titleLabl: UILabel = { | ||
| 20 | + let titleLabel = UILabel.init(frame: CGRectMake(self.iconImgView.right+10, self.iconImgView.top+20, KSreenWidth-(self.iconImgView.right+15)-10, 21)) | ||
| 21 | + titleLabel.textColor = HexColor("#333333") | ||
| 22 | + titleLabel.textAlignment = .left | ||
| 23 | + titleLabel.font = Font_20 | ||
| 24 | + titleLabel.text = "啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊" | ||
| 25 | + let height = titleLabel.qmui_lineHeight | ||
| 26 | + titleLabel.height = height | ||
| 27 | + return titleLabel | ||
| 28 | + }() | ||
| 29 | + ///集数 | ||
| 30 | + lazy var jishuLabel: UILabel = { | ||
| 31 | + let titleLabel = UILabel.init(frame: CGRectMake(self.titleLabl.left, self.titleLabl.bottom+20, 40, 21)) | ||
| 32 | + titleLabel.textColor = HexColor("#333333") | ||
| 33 | + titleLabel.textAlignment = .left | ||
| 34 | + titleLabel.font = Font_15 | ||
| 35 | + titleLabel.text = "45集" | ||
| 36 | + let height = titleLabel.qmui_lineHeight | ||
| 37 | + titleLabel.height = height | ||
| 38 | + return titleLabel | ||
| 39 | + }() | ||
| 40 | + ///简介 | ||
| 41 | + lazy var jianjieLabel: UILabel = { | ||
| 42 | + let titleLabel = UILabel.init(frame: CGRectMake(self.iconImgView.left, self.iconImgView.bottom+10, KSreenWidth-2*self.iconImgView.left, 21)) | ||
| 43 | + titleLabel.textColor = HexColor("#333333") | ||
| 44 | + titleLabel.textAlignment = .left | ||
| 45 | + titleLabel.font = Font_14 | ||
| 46 | + titleLabel.text = "啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈啊哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈" | ||
| 47 | + titleLabel.numberOfLines = 0 | ||
| 48 | + var lines = titleLabel.getRealLabelTextLines() | ||
| 49 | + let height = titleLabel.qmui_lineHeight | ||
| 50 | + if lines > 2 { | ||
| 51 | + lines = 2 | ||
| 52 | + } | ||
| 53 | + titleLabel.height = height*CGFloat(lines) | ||
| 54 | + return titleLabel | ||
| 55 | + }() | ||
| 56 | + //展开,收起 | ||
| 57 | + lazy var expandBtn: UIButton = { | ||
| 58 | + let expandBtn = UIButton.init(type: .custom) | ||
| 59 | + expandBtn.backgroundColor = .white | ||
| 60 | + | ||
| 61 | + expandBtn.frame = CGRect(x: self.jianjieLabel.right-60, y: self.jianjieLabel.bottom, width: 60, height: 30) | ||
| 62 | + expandBtn.setTitle("展开", for: .normal) | ||
| 63 | + expandBtn.setTitle("收起", for: .selected) | ||
| 64 | + | ||
| 65 | + expandBtn.setTitleColor(HexColor("#333333"), for: .normal) | ||
| 66 | + expandBtn.setImage(UIImage(named: "DS_coupon_unSelect"), for: .normal) | ||
| 67 | + expandBtn.setImage(UIImage(named: "DS_coupon_unSelect"), for: .selected) | ||
| 68 | + expandBtn.titleLabel?.font = Font_16 | ||
| 69 | + expandBtn.setupButtonImageAndTitlePossitionWith(padding: 5, style: .right) | ||
| 70 | + expandBtn.addTarget(self, action: #selector(expandBtnAction), for: .touchUpInside) | ||
| 71 | + return expandBtn | ||
| 72 | + }() | ||
| 73 | + //追剧|已追剧 | ||
| 74 | + lazy var followBtn: UIButton = { | ||
| 75 | + let followBtn = UIButton(type: .custom) | ||
| 76 | + followBtn.setTitle("追剧", for: .normal) | ||
| 77 | + followBtn.setTitleColor(.black, for: .normal) | ||
| 78 | + followBtn.setTitleColor(.black, for: .selected) | ||
| 79 | + followBtn.setTitle("已追剧", for: .selected) | ||
| 80 | + followBtn.layer.borderColor = UIColor.black.cgColor | ||
| 81 | + followBtn.layer.borderWidth = 1 | ||
| 82 | + followBtn.layer.cornerRadius = 3 | ||
| 83 | + followBtn.clipsToBounds = true | ||
| 84 | + followBtn.addTarget(self, action: #selector(followBtnAction), for: .touchUpInside) | ||
| 85 | + return followBtn | ||
| 86 | + }() | ||
| 87 | + //付费解锁全集|已购买 | ||
| 88 | + lazy var paymentBtn: UIButton = { | ||
| 89 | + let paymentBtn = UIButton(type: .custom) | ||
| 90 | + paymentBtn.setTitle("付费解锁全集", for: .normal) | ||
| 91 | + paymentBtn.setTitleColor(.white, for: .normal) | ||
| 92 | + paymentBtn.setTitle("已购买", for: .selected) | ||
| 93 | + paymentBtn.setTitleColor(.black, for: .selected) | ||
| 94 | + paymentBtn.backgroundColor = .blue | ||
| 95 | + paymentBtn.layer.borderColor = UIColor.black.cgColor | ||
| 96 | + paymentBtn.layer.borderWidth = 1 | ||
| 97 | + paymentBtn.layer.cornerRadius = 3 | ||
| 98 | + paymentBtn.clipsToBounds = true | ||
| 99 | + paymentBtn.addTarget(self, action: #selector(paymentBtnAction), for: .touchUpInside) | ||
| 100 | + return paymentBtn | ||
| 101 | + }() | ||
| 102 | + | ||
| 103 | + override init(style: UITableViewCell.CellStyle, reuseIdentifier: String?) { | ||
| 104 | + super.init(style: style, reuseIdentifier: reuseIdentifier) | ||
| 105 | + self.selectionStyle = .none | ||
| 106 | + self.setUI() | ||
| 107 | + } | ||
| 108 | + | ||
| 109 | + func setUI(){ | ||
| 110 | + self.contentView.addSubview(self.iconImgView) | ||
| 111 | + self.contentView.addSubview(self.titleLabl) | ||
| 112 | + self.contentView.addSubview(self.jishuLabel) | ||
| 113 | + self.contentView.addSubview(self.jianjieLabel) | ||
| 114 | + self.contentView.addSubview(self.expandBtn) | ||
| 115 | + self.contentView.addSubview(self.followBtn) | ||
| 116 | + self.contentView.addSubview(self.paymentBtn) | ||
| 117 | + | ||
| 118 | + let lines = jianjieLabel.getRealLabelTextLines() | ||
| 119 | + if lines <= 2{ | ||
| 120 | + self.expandBtn.isHidden = true | ||
| 121 | + }else{ | ||
| 122 | + self.expandBtn.isHidden = false | ||
| 123 | + } | ||
| 124 | + | ||
| 125 | + self.followBtn.snp.makeConstraints { make in | ||
| 126 | + make.top.equalTo(self.jianjieLabel.snp.bottom).offset(40) | ||
| 127 | + make.left.equalTo(self.jianjieLabel.snp.left).offset(30) | ||
| 128 | + make.width.equalTo(120) | ||
| 129 | + make.height.equalTo(30) | ||
| 130 | + } | ||
| 131 | + self.paymentBtn.snp.makeConstraints { make in | ||
| 132 | + make.top.equalTo(self.followBtn) | ||
| 133 | + make.left.equalTo(self.followBtn.snp.left).offset(KSreenWidth/2) | ||
| 134 | + make.width.equalTo(120) | ||
| 135 | + make.height.equalTo(30) | ||
| 136 | + } | ||
| 137 | + | ||
| 138 | + self.iconImgView.backgroundColor = .red | ||
| 139 | + } | ||
| 140 | + | ||
| 141 | + required init?(coder: NSCoder) { | ||
| 142 | + fatalError("init(coder:) has not been implemented") | ||
| 143 | + } | ||
| 144 | + | ||
| 145 | + // MARK: - Action | ||
| 146 | + @objc func expandBtnAction(button:UIButton){ | ||
| 147 | + button.isSelected = !button.isSelected | ||
| 148 | + let lines = jianjieLabel.getRealLabelTextLines() | ||
| 149 | + let height = jianjieLabel.qmui_lineHeight | ||
| 150 | + | ||
| 151 | + if button.isSelected{ | ||
| 152 | + //文本收起状态,点击展开 | ||
| 153 | + self.jianjieLabel.height = CGFloat(lines)*height | ||
| 154 | + }else{ | ||
| 155 | + //文本展开状态,点击收起 | ||
| 156 | + self.jianjieLabel.height = 2*height | ||
| 157 | + } | ||
| 158 | + self.expandBtn.top = self.jianjieLabel.bottom | ||
| 159 | + | ||
| 160 | + } | ||
| 161 | + @objc func followBtnAction(button:UIButton){ | ||
| 162 | + button.isSelected = !button.isSelected | ||
| 163 | + | ||
| 164 | + } | ||
| 165 | + @objc func paymentBtnAction(button:UIButton){ | ||
| 166 | + button.isSelected = !button.isSelected | ||
| 167 | + | ||
| 168 | + } | ||
| 169 | + | ||
| 170 | +} | ||
| 171 | + |
metaCode/Classes/Main/HomePages/ViewModel/CNLiveHomePageViewModel.swift
0 → 100644
| 1 | +// | ||
| 2 | +// CNLiveHomePageViewModel.swift | ||
| 3 | +// metaCode | ||
| 4 | +// | ||
| 5 | +// Created by zx on 2024/1/8. | ||
| 6 | +// | ||
| 7 | + | ||
| 8 | +import Foundation | ||
| 9 | +import CNLiveRequestBastKit | ||
| 10 | + | ||
| 11 | +class CNLiveHomePageViewModel:NSObject{ | ||
| 12 | + | ||
| 13 | + /// 获取首页原生页面数据 | ||
| 14 | + static func requestGetHomePageConfigList( resultBlock: @escaping downSlideResultBlock) { | ||
| 15 | + let param = NSMutableDictionary() | ||
| 16 | + CNLiveNetworking.setAllowRequestDefaultArgument(true) | ||
| 17 | + CNLiveNetworking.setupShowDataResult(false) | ||
| 18 | + CNLiveNetworking.requestNetwork(with: .GET, urlString: APPBaseMCUrl+"/commonApi/homePageConfigList", param: param as! [String : String], cacheType: .networkOnly) { task, result, error in | ||
| 19 | + hiddenLoading() | ||
| 20 | + if (error == nil) { | ||
| 21 | + let resp = result as! NSDictionary | ||
| 22 | + let errorCode = "\(resp["errorCode"] ?? "0")" | ||
| 23 | + if (errorCode == "0") { | ||
| 24 | + let dataDic = resp["data"] as! Dictionary<String, Any> | ||
| 25 | + let dataMdl = newDictionaryToModel(dataDic, CNLiveHomePageModel.self) | ||
| 26 | + | ||
| 27 | + resultBlock(dataMdl,.success) | ||
| 28 | + } | ||
| 29 | + else{ | ||
| 30 | + resultBlock(NSNull(),.failed) | ||
| 31 | + } | ||
| 32 | + } | ||
| 33 | + } | ||
| 34 | + } | ||
| 35 | + /// 获取首页我的专辑收藏数据 | ||
| 36 | + static func requestGetHomePage(resultBlock: @escaping downSlideResultBlock) { | ||
| 37 | + let param = NSMutableDictionary() | ||
| 38 | + param.setValue(UserInfoManager.shared.userInfo.uid, forKey: "sid") | ||
| 39 | + param.setValue("1", forKey: "page") | ||
| 40 | + param.setValue("50", forKey: "pageSize") | ||
| 41 | + | ||
| 42 | + CNLiveNetworking.setAllowRequestDefaultArgument(true) | ||
| 43 | + CNLiveNetworking.setupShowDataResult(false) | ||
| 44 | + CNLiveNetworking.requestNetwork(with: .GET, urlString: APPBaseCMSUrl+"/contentApi/myAlbum", param: param as! [String : String], cacheType: .networkOnly) { task, result, error in | ||
| 45 | + hiddenLoading() | ||
| 46 | + if (error == nil) { | ||
| 47 | + let resp = result as! NSDictionary | ||
| 48 | + let errorCode = "\(resp["errorCode"] ?? "0")" | ||
| 49 | + if (errorCode == "0") { | ||
| 50 | + let dataDic = resp["data"] as! Dictionary<String, Any> | ||
| 51 | + let dataMdl = newDictionaryToModel(dataDic, CNLiveHomePageModel.self) | ||
| 52 | + | ||
| 53 | + resultBlock(dataMdl,.success) | ||
| 54 | + } | ||
| 55 | + else{ | ||
| 56 | + resultBlock(NSNull(),.failed) | ||
| 57 | + } | ||
| 58 | + } | ||
| 59 | + } | ||
| 60 | + } | ||
| 61 | + /// 获取首页-全部专辑列表 | ||
| 62 | + static func getBlockContents(blockId:String,resultBlock: @escaping downSlideResultBlock) { | ||
| 63 | + let param = NSMutableDictionary() | ||
| 64 | + param.setValue(blockId, forKey: "blockId") | ||
| 65 | + CNLiveNetworking.setAllowRequestDefaultArgument(true) | ||
| 66 | + CNLiveNetworking.setupShowDataResult(false) | ||
| 67 | + CNLiveNetworking.requestNetwork(with: .GET, urlString: APPBaseCMSUrl+"/contentApi/getBlockContents", param: param as! [String : String], cacheType: .networkOnly) { task, result, error in | ||
| 68 | + hiddenLoading() | ||
| 69 | + if (error == nil) { | ||
| 70 | + let resp = result as! NSDictionary | ||
| 71 | + let errorCode = "\(resp["errorCode"] ?? "0")" | ||
| 72 | + if (errorCode == "0") { | ||
| 73 | + let dataDic = resp["data"] as! Dictionary<String, Any> | ||
| 74 | + let dataList = dataDic["list"] as! Array<Any> | ||
| 75 | + var listArr = Array<Any>() | ||
| 76 | + for listDic in dataList{ | ||
| 77 | + let dataMdl = newDictionaryToModel(listDic as! [String : Any], CNLiveAlbumModel.self) | ||
| 78 | + listArr.append(dataMdl) | ||
| 79 | + } | ||
| 80 | + | ||
| 81 | + resultBlock(listArr,.success) | ||
| 82 | + } | ||
| 83 | + else{ | ||
| 84 | + resultBlock(NSNull(),.failed) | ||
| 85 | + } | ||
| 86 | + } | ||
| 87 | + } | ||
| 88 | + } | ||
| 89 | + | ||
| 90 | + /// 获取首页-专辑详情简介 | ||
| 91 | + static func getAlbumMsg(aid:String,resultBlock: @escaping downSlideResultBlock) { | ||
| 92 | + let param = NSMutableDictionary() | ||
| 93 | + param.setValue(aid, forKey: "aid") | ||
| 94 | + param.setValue(UserInfoManager.shared.userInfo.uid, forKey: "sid") | ||
| 95 | + | ||
| 96 | + CNLiveNetworking.setAllowRequestDefaultArgument(true) | ||
| 97 | + CNLiveNetworking.setupShowDataResult(false) | ||
| 98 | + CNLiveNetworking.requestNetwork(with: .GET, urlString: APPBaseCMSUrl+"/contentApi/getAlbumMsg", param: param as! [String : String], cacheType: .networkOnly) { task, result, error in | ||
| 99 | + hiddenLoading() | ||
| 100 | + if (error == nil) { | ||
| 101 | + let resp = result as! NSDictionary | ||
| 102 | + let errorCode = "\(resp["errorCode"] ?? "0")" | ||
| 103 | + if (errorCode == "0") { | ||
| 104 | + let dataDic = resp["data"] as! Dictionary<String, Any> | ||
| 105 | + let dataMdl = newDictionaryToModel(dataDic, CNLiveAlbumMsgModel.self) | ||
| 106 | + | ||
| 107 | + resultBlock(dataMdl,.success) | ||
| 108 | + } | ||
| 109 | + else{ | ||
| 110 | + resultBlock(NSNull(),.failed) | ||
| 111 | + } | ||
| 112 | + } | ||
| 113 | + } | ||
| 114 | + } | ||
| 115 | + | ||
| 116 | + /// 获取首页-专辑视频列表详情 | ||
| 117 | + static func getAlbumList(aid:String,resultBlock: @escaping downSlideResultBlock) { | ||
| 118 | + let param = NSMutableDictionary() | ||
| 119 | + param.setValue(aid, forKey: "aid") | ||
| 120 | + param.setValue(UserInfoManager.shared.userInfo.uid, forKey: "sid") | ||
| 121 | + | ||
| 122 | + CNLiveNetworking.setAllowRequestDefaultArgument(true) | ||
| 123 | + CNLiveNetworking.setupShowDataResult(false) | ||
| 124 | + CNLiveNetworking.requestNetwork(with: .GET, urlString: APPBaseCMSUrl+"/ugcApi/albumList", param: param as! [String : String], cacheType: .networkOnly) { task, result, error in | ||
| 125 | + hiddenLoading() | ||
| 126 | + if (error == nil) { | ||
| 127 | + let resp = result as! NSDictionary | ||
| 128 | + let errorCode = "\(resp["errorCode"] ?? "0")" | ||
| 129 | + if (errorCode == "0") { | ||
| 130 | + let dataDic = resp["data"] as! Dictionary<String, Any> | ||
| 131 | + let dataList = dataDic["list"] as! Array<Any> | ||
| 132 | + var listArr = Array<Any>() | ||
| 133 | + for listDic in dataList{ | ||
| 134 | + let dataMdl = newDictionaryToModel(listDic as! [String : Any], CNLiveAlbumListModel.self) | ||
| 135 | + listArr.append(dataMdl) | ||
| 136 | + } | ||
| 137 | + | ||
| 138 | + resultBlock(listArr,.success) | ||
| 139 | + } | ||
| 140 | + else{ | ||
| 141 | + resultBlock(NSNull(),.failed) | ||
| 142 | + } | ||
| 143 | + } | ||
| 144 | + } | ||
| 145 | + } | ||
| 146 | +} |