Commit b65580f149f593cdbf77b42bd40cef45b627bd94

Authored by liushiyu
2 parents 340fbb99 29260fdd
Showing 34 changed files with 1114 additions and 181 deletions
metaCode.xcodeproj/project.pbxproj
@@ -110,6 +110,11 @@ @@ -110,6 +110,11 @@
110 19AD65AA2BA041210045A444 /* CNLiveGoodsDetailsTableViewCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = 19AD65A92BA041210045A444 /* CNLiveGoodsDetailsTableViewCell.swift */; }; 110 19AD65AA2BA041210045A444 /* CNLiveGoodsDetailsTableViewCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = 19AD65A92BA041210045A444 /* CNLiveGoodsDetailsTableViewCell.swift */; };
111 19AD65AC2BA16CF20045A444 /* CNLiveShopCommentRequestShareModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = 19AD65AB2BA16CF20045A444 /* CNLiveShopCommentRequestShareModel.swift */; }; 111 19AD65AC2BA16CF20045A444 /* CNLiveShopCommentRequestShareModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = 19AD65AB2BA16CF20045A444 /* CNLiveShopCommentRequestShareModel.swift */; };
112 19AD65AE2BA177C20045A444 /* CNLiveShopGoodsDetailsTableHeaderView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 19AD65AD2BA177C20045A444 /* CNLiveShopGoodsDetailsTableHeaderView.swift */; }; 112 19AD65AE2BA177C20045A444 /* CNLiveShopGoodsDetailsTableHeaderView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 19AD65AD2BA177C20045A444 /* CNLiveShopGoodsDetailsTableHeaderView.swift */; };
  113 + 19B153CB2BC3E1870018906C /* CNLiveShopPayController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 19B153CA2BC3E1870018906C /* CNLiveShopPayController.swift */; };
  114 + 19B153CD2BC3EB690018906C /* CNLiveShoph5ViewModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = 19B153CC2BC3EB690018906C /* CNLiveShoph5ViewModel.swift */; };
  115 + 19B153CF2BC540FF0018906C /* CNLivePayOrderInfoModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = 19B153CE2BC540FF0018906C /* CNLivePayOrderInfoModel.swift */; };
  116 + 19B153D22BC623980018906C /* CNLiveShopPayNeedPaymentCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = 19B153D12BC623980018906C /* CNLiveShopPayNeedPaymentCell.swift */; };
  117 + 19B153D42BC623BE0018906C /* CNLiveShopPayWeChatAlipayCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = 19B153D32BC623BE0018906C /* CNLiveShopPayWeChatAlipayCell.swift */; };
113 19BB1FDF2AEA3A450094D962 /* CNSlideBaseNavigationController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 19BB1FDE2AEA3A450094D962 /* CNSlideBaseNavigationController.swift */; }; 118 19BB1FDF2AEA3A450094D962 /* CNSlideBaseNavigationController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 19BB1FDE2AEA3A450094D962 /* CNSlideBaseNavigationController.swift */; };
114 19BB1FE12AEB5C220094D962 /* CNLiveShopConsoleController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 19BB1FE02AEB5C220094D962 /* CNLiveShopConsoleController.swift */; }; 119 19BB1FE12AEB5C220094D962 /* CNLiveShopConsoleController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 19BB1FE02AEB5C220094D962 /* CNLiveShopConsoleController.swift */; };
115 19BB1FE32AEB8B7C0094D962 /* CNLiveShopConsoleViewModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = 19BB1FE22AEB8B7C0094D962 /* CNLiveShopConsoleViewModel.swift */; }; 120 19BB1FE32AEB8B7C0094D962 /* CNLiveShopConsoleViewModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = 19BB1FE22AEB8B7C0094D962 /* CNLiveShopConsoleViewModel.swift */; };
@@ -129,6 +134,7 @@ @@ -129,6 +134,7 @@
129 19CC4D542ADD163D00308E2A /* CNUpSlideCardPresentationController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 19CC4D532ADD163D00308E2A /* CNUpSlideCardPresentationController.swift */; }; 134 19CC4D542ADD163D00308E2A /* CNUpSlideCardPresentationController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 19CC4D532ADD163D00308E2A /* CNUpSlideCardPresentationController.swift */; };
130 19CC4D562ADD19C200308E2A /* String+Extension.swift in Sources */ = {isa = PBXBuildFile; fileRef = 19CC4D552ADD19C200308E2A /* String+Extension.swift */; }; 135 19CC4D562ADD19C200308E2A /* String+Extension.swift in Sources */ = {isa = PBXBuildFile; fileRef = 19CC4D552ADD19C200308E2A /* String+Extension.swift */; };
131 19D2CE632AE8B65D00691757 /* CNLiveDownSlideTool.swift in Sources */ = {isa = PBXBuildFile; fileRef = 19D2CE622AE8B65D00691757 /* CNLiveDownSlideTool.swift */; }; 136 19D2CE632AE8B65D00691757 /* CNLiveDownSlideTool.swift in Sources */ = {isa = PBXBuildFile; fileRef = 19D2CE622AE8B65D00691757 /* CNLiveDownSlideTool.swift */; };
  137 + 19E302672BC8FEBC00F6B8BD /* CNLliveShopDetailCloseCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = 19E302662BC8FEBC00F6B8BD /* CNLliveShopDetailCloseCell.swift */; };
132 19E9D1602B3A98C200D0FB30 /* CNLiveShopAssociatedGoodsTableViewCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = 19E9D15F2B3A98C200D0FB30 /* CNLiveShopAssociatedGoodsTableViewCell.swift */; }; 138 19E9D1602B3A98C200D0FB30 /* CNLiveShopAssociatedGoodsTableViewCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = 19E9D15F2B3A98C200D0FB30 /* CNLiveShopAssociatedGoodsTableViewCell.swift */; };
133 19E9D1622B3BBB2E00D0FB30 /* CNLiveFileManager.swift in Sources */ = {isa = PBXBuildFile; fileRef = 19E9D1612B3BBB2E00D0FB30 /* CNLiveFileManager.swift */; }; 139 19E9D1622B3BBB2E00D0FB30 /* CNLiveFileManager.swift in Sources */ = {isa = PBXBuildFile; fileRef = 19E9D1612B3BBB2E00D0FB30 /* CNLiveFileManager.swift */; };
134 19F1C2332AB5728B0083D06C /* CNIDCardView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 19F1C2322AB5728B0083D06C /* CNIDCardView.swift */; }; 140 19F1C2332AB5728B0083D06C /* CNIDCardView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 19F1C2322AB5728B0083D06C /* CNIDCardView.swift */; };
@@ -379,6 +385,11 @@ @@ -379,6 +385,11 @@
379 19AD65A92BA041210045A444 /* CNLiveGoodsDetailsTableViewCell.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CNLiveGoodsDetailsTableViewCell.swift; sourceTree = "<group>"; }; 385 19AD65A92BA041210045A444 /* CNLiveGoodsDetailsTableViewCell.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CNLiveGoodsDetailsTableViewCell.swift; sourceTree = "<group>"; };
380 19AD65AB2BA16CF20045A444 /* CNLiveShopCommentRequestShareModel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CNLiveShopCommentRequestShareModel.swift; sourceTree = "<group>"; }; 386 19AD65AB2BA16CF20045A444 /* CNLiveShopCommentRequestShareModel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CNLiveShopCommentRequestShareModel.swift; sourceTree = "<group>"; };
381 19AD65AD2BA177C20045A444 /* CNLiveShopGoodsDetailsTableHeaderView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CNLiveShopGoodsDetailsTableHeaderView.swift; sourceTree = "<group>"; }; 387 19AD65AD2BA177C20045A444 /* CNLiveShopGoodsDetailsTableHeaderView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CNLiveShopGoodsDetailsTableHeaderView.swift; sourceTree = "<group>"; };
  388 + 19B153CA2BC3E1870018906C /* CNLiveShopPayController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CNLiveShopPayController.swift; sourceTree = "<group>"; };
  389 + 19B153CC2BC3EB690018906C /* CNLiveShoph5ViewModel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CNLiveShoph5ViewModel.swift; sourceTree = "<group>"; };
  390 + 19B153CE2BC540FF0018906C /* CNLivePayOrderInfoModel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CNLivePayOrderInfoModel.swift; sourceTree = "<group>"; };
  391 + 19B153D12BC623980018906C /* CNLiveShopPayNeedPaymentCell.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CNLiveShopPayNeedPaymentCell.swift; sourceTree = "<group>"; };
  392 + 19B153D32BC623BE0018906C /* CNLiveShopPayWeChatAlipayCell.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CNLiveShopPayWeChatAlipayCell.swift; sourceTree = "<group>"; };
382 19BB1FDE2AEA3A450094D962 /* CNSlideBaseNavigationController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CNSlideBaseNavigationController.swift; sourceTree = "<group>"; }; 393 19BB1FDE2AEA3A450094D962 /* CNSlideBaseNavigationController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CNSlideBaseNavigationController.swift; sourceTree = "<group>"; };
383 19BB1FE02AEB5C220094D962 /* CNLiveShopConsoleController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CNLiveShopConsoleController.swift; sourceTree = "<group>"; }; 394 19BB1FE02AEB5C220094D962 /* CNLiveShopConsoleController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CNLiveShopConsoleController.swift; sourceTree = "<group>"; };
384 19BB1FE22AEB8B7C0094D962 /* CNLiveShopConsoleViewModel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CNLiveShopConsoleViewModel.swift; sourceTree = "<group>"; }; 395 19BB1FE22AEB8B7C0094D962 /* CNLiveShopConsoleViewModel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CNLiveShopConsoleViewModel.swift; sourceTree = "<group>"; };
@@ -398,6 +409,7 @@ @@ -398,6 +409,7 @@
398 19CC4D532ADD163D00308E2A /* CNUpSlideCardPresentationController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CNUpSlideCardPresentationController.swift; sourceTree = "<group>"; }; 409 19CC4D532ADD163D00308E2A /* CNUpSlideCardPresentationController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CNUpSlideCardPresentationController.swift; sourceTree = "<group>"; };
399 19CC4D552ADD19C200308E2A /* String+Extension.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "String+Extension.swift"; sourceTree = "<group>"; }; 410 19CC4D552ADD19C200308E2A /* String+Extension.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "String+Extension.swift"; sourceTree = "<group>"; };
400 19D2CE622AE8B65D00691757 /* CNLiveDownSlideTool.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CNLiveDownSlideTool.swift; sourceTree = "<group>"; }; 411 19D2CE622AE8B65D00691757 /* CNLiveDownSlideTool.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CNLiveDownSlideTool.swift; sourceTree = "<group>"; };
  412 + 19E302662BC8FEBC00F6B8BD /* CNLliveShopDetailCloseCell.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CNLliveShopDetailCloseCell.swift; sourceTree = "<group>"; };
401 19E9D15F2B3A98C200D0FB30 /* CNLiveShopAssociatedGoodsTableViewCell.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CNLiveShopAssociatedGoodsTableViewCell.swift; sourceTree = "<group>"; }; 413 19E9D15F2B3A98C200D0FB30 /* CNLiveShopAssociatedGoodsTableViewCell.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CNLiveShopAssociatedGoodsTableViewCell.swift; sourceTree = "<group>"; };
402 19E9D1612B3BBB2E00D0FB30 /* CNLiveFileManager.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CNLiveFileManager.swift; sourceTree = "<group>"; }; 414 19E9D1612B3BBB2E00D0FB30 /* CNLiveFileManager.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CNLiveFileManager.swift; sourceTree = "<group>"; };
403 19F1C2322AB5728B0083D06C /* CNIDCardView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CNIDCardView.swift; sourceTree = "<group>"; }; 415 19F1C2322AB5728B0083D06C /* CNIDCardView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CNIDCardView.swift; sourceTree = "<group>"; };
@@ -711,20 +723,20 @@ @@ -711,20 +723,20 @@
711 path = Controller; 723 path = Controller;
712 sourceTree = "<group>"; 724 sourceTree = "<group>";
713 }; 725 };
714 - 1938BD182B454DB100390A34 /* ShopUpConsole */ = { 726 + 1938BD182B454DB100390A34 /* ShopDownConsole */ = {
715 isa = PBXGroup; 727 isa = PBXGroup;
716 children = ( 728 children = (
717 19BB1FE02AEB5C220094D962 /* CNLiveShopConsoleController.swift */, 729 19BB1FE02AEB5C220094D962 /* CNLiveShopConsoleController.swift */,
718 ); 730 );
719 - path = ShopUpConsole; 731 + path = ShopDownConsole;
720 sourceTree = "<group>"; 732 sourceTree = "<group>";
721 }; 733 };
722 - 1938BD192B454E1500390A34 /* ShopDownDetail */ = { 734 + 1938BD192B454E1500390A34 /* ShopUpDetail */ = {
723 isa = PBXGroup; 735 isa = PBXGroup;
724 children = ( 736 children = (
725 19BB1FEB2AF0AB8E0094D962 /* CNLiveDownShopDetailController.swift */, 737 19BB1FEB2AF0AB8E0094D962 /* CNLiveDownShopDetailController.swift */,
726 ); 738 );
727 - path = ShopDownDetail; 739 + path = ShopUpDetail;
728 sourceTree = "<group>"; 740 sourceTree = "<group>";
729 }; 741 };
730 1938BD1A2B4554A800390A34 /* AuthMainController */ = { 742 1938BD1A2B4554A800390A34 /* AuthMainController */ = {
@@ -851,6 +863,7 @@ @@ -851,6 +863,7 @@
851 191733402B284D4A007BCC04 /* ShopCoupon */, 863 191733402B284D4A007BCC04 /* ShopCoupon */,
852 19565ED02AF8D904007D6727 /* GoodsManager */, 864 19565ED02AF8D904007D6727 /* GoodsManager */,
853 1938BD4D2B512F4600390A34 /* ShopDetail */, 865 1938BD4D2B512F4600390A34 /* ShopDetail */,
  866 + 19B153D02BC623780018906C /* Shoph5Pay */,
854 ); 867 );
855 path = Shop; 868 path = Shop;
856 sourceTree = "<group>"; 869 sourceTree = "<group>";
@@ -866,6 +879,7 @@ @@ -866,6 +879,7 @@
866 1938BD4D2B512F4600390A34 /* ShopDetail */ = { 879 1938BD4D2B512F4600390A34 /* ShopDetail */ = {
867 isa = PBXGroup; 880 isa = PBXGroup;
868 children = ( 881 children = (
  882 + 19E302662BC8FEBC00F6B8BD /* CNLliveShopDetailCloseCell.swift */,
869 19BB1FF12AF21A950094D962 /* CNLliveShopDetailBannerCell.swift */, 883 19BB1FF12AF21A950094D962 /* CNLliveShopDetailBannerCell.swift */,
870 19565EBF2AF4DE0E007D6727 /* CNLiveShopDetailBtnsCell.swift */, 884 19565EBF2AF4DE0E007D6727 /* CNLiveShopDetailBtnsCell.swift */,
871 19565EC12AF616CA007D6727 /* CNLiveShopDetailOrderAssetCell.swift */, 885 19565EC12AF616CA007D6727 /* CNLiveShopDetailOrderAssetCell.swift */,
@@ -961,6 +975,23 @@ @@ -961,6 +975,23 @@
961 path = CNLiveDownslideOperationManager; 975 path = CNLiveDownslideOperationManager;
962 sourceTree = "<group>"; 976 sourceTree = "<group>";
963 }; 977 };
  978 + 19B153C92BC3E1550018906C /* ShopPayController */ = {
  979 + isa = PBXGroup;
  980 + children = (
  981 + 19B153CA2BC3E1870018906C /* CNLiveShopPayController.swift */,
  982 + );
  983 + path = ShopPayController;
  984 + sourceTree = "<group>";
  985 + };
  986 + 19B153D02BC623780018906C /* Shoph5Pay */ = {
  987 + isa = PBXGroup;
  988 + children = (
  989 + 19B153D12BC623980018906C /* CNLiveShopPayNeedPaymentCell.swift */,
  990 + 19B153D32BC623BE0018906C /* CNLiveShopPayWeChatAlipayCell.swift */,
  991 + );
  992 + path = Shoph5Pay;
  993 + sourceTree = "<group>";
  994 + };
964 19BB1FE42AEB93850094D962 /* Model */ = { 995 19BB1FE42AEB93850094D962 /* Model */ = {
965 isa = PBXGroup; 996 isa = PBXGroup;
966 children = ( 997 children = (
@@ -972,6 +1003,7 @@ @@ -972,6 +1003,7 @@
972 19BB1FE52AEB93B80094D962 /* CNLiveShopUserInfoModel.swift */, 1003 19BB1FE52AEB93B80094D962 /* CNLiveShopUserInfoModel.swift */,
973 19BB1FE72AECAD060094D962 /* CNLiveShopConsoleModel.swift */, 1004 19BB1FE72AECAD060094D962 /* CNLiveShopConsoleModel.swift */,
974 19BB1FEF2AF0E5B30094D962 /* CNLiveShopDetailModel.swift */, 1005 19BB1FEF2AF0E5B30094D962 /* CNLiveShopDetailModel.swift */,
  1006 + 19B153CE2BC540FF0018906C /* CNLivePayOrderInfoModel.swift */,
975 ); 1007 );
976 path = Model; 1008 path = Model;
977 sourceTree = "<group>"; 1009 sourceTree = "<group>";
@@ -1406,6 +1438,7 @@ @@ -1406,6 +1438,7 @@
1406 1926C28E2AE0D76C00C71DC3 /* CNLiveDownSlideViewModel.swift */, 1438 1926C28E2AE0D76C00C71DC3 /* CNLiveDownSlideViewModel.swift */,
1407 19BB1FE22AEB8B7C0094D962 /* CNLiveShopConsoleViewModel.swift */, 1439 19BB1FE22AEB8B7C0094D962 /* CNLiveShopConsoleViewModel.swift */,
1408 19BB1FED2AF0E1EC0094D962 /* CNLiveShopDetailViewModel.swift */, 1440 19BB1FED2AF0E1EC0094D962 /* CNLiveShopDetailViewModel.swift */,
  1441 + 19B153CC2BC3EB690018906C /* CNLiveShoph5ViewModel.swift */,
1409 ); 1442 );
1410 name = ViewModel; 1443 name = ViewModel;
1411 path = HomePage/ViewModel; 1444 path = HomePage/ViewModel;
@@ -1439,11 +1472,12 @@ @@ -1439,11 +1472,12 @@
1439 1938BD1A2B4554A800390A34 /* AuthMainController */, 1472 1938BD1A2B4554A800390A34 /* AuthMainController */,
1440 1938BD1C2B4555A000390A34 /* WebController */, 1473 1938BD1C2B4555A000390A34 /* WebController */,
1441 1938BD1B2B45557700390A34 /* DownSlideController */, 1474 1938BD1B2B45557700390A34 /* DownSlideController */,
1442 - 1938BD192B454E1500390A34 /* ShopDownDetail */,  
1443 - 1938BD182B454DB100390A34 /* ShopUpConsole */, 1475 + 1938BD192B454E1500390A34 /* ShopUpDetail */,
  1476 + 1938BD182B454DB100390A34 /* ShopDownConsole */,
1444 1917333D2B284C6B007BCC04 /* ShopCoupon */, 1477 1917333D2B284C6B007BCC04 /* ShopCoupon */,
1445 191732FC2B0B3EB4007BCC04 /* GoodsDetail */, 1478 191732FC2B0B3EB4007BCC04 /* GoodsDetail */,
1446 19565EC32AF8ACC2007D6727 /* GoodsManager */, 1479 19565EC32AF8ACC2007D6727 /* GoodsManager */,
  1480 + 19B153C92BC3E1550018906C /* ShopPayController */,
1447 ); 1481 );
1448 name = Controller; 1482 name = Controller;
1449 path = HomePage/Controller; 1483 path = HomePage/Controller;
@@ -1755,6 +1789,7 @@ @@ -1755,6 +1789,7 @@
1755 19BB202B2AF382150094D962 /* CNLiveAdaptTool.swift in Sources */, 1789 19BB202B2AF382150094D962 /* CNLiveAdaptTool.swift in Sources */,
1756 79E672032AFDFA9C00F2F768 /* CNLiveMineSignOutViewController.swift in Sources */, 1790 79E672032AFDFA9C00F2F768 /* CNLiveMineSignOutViewController.swift in Sources */,
1757 19565ECD2AF8D256007D6727 /* CNLiveShopGoodsListClassifyView.swift in Sources */, 1791 19565ECD2AF8D256007D6727 /* CNLiveShopGoodsListClassifyView.swift in Sources */,
  1792 + 19E302672BC8FEBC00F6B8BD /* CNLliveShopDetailCloseCell.swift in Sources */,
1758 1938BD322B4B8F0400390A34 /* CNLiveHomePageModel.swift in Sources */, 1793 1938BD322B4B8F0400390A34 /* CNLiveHomePageModel.swift in Sources */,
1759 191732EF2B075C3A007BCC04 /* CNLiveCreateShopClassifyViewController.swift in Sources */, 1794 191732EF2B075C3A007BCC04 /* CNLiveCreateShopClassifyViewController.swift in Sources */,
1760 1938BD302B4B8A3500390A34 /* CNLiveHomePageViewModel.swift in Sources */, 1795 1938BD302B4B8A3500390A34 /* CNLiveHomePageViewModel.swift in Sources */,
@@ -1788,10 +1823,12 @@ @@ -1788,10 +1823,12 @@
1788 79BB1C162B05C62900C5720C /* CNLiveShopBodyCouponView.swift in Sources */, 1823 79BB1C162B05C62900C5720C /* CNLiveShopBodyCouponView.swift in Sources */,
1789 798916E92B04532D00D08302 /* CNLiveSavePointDB.swift in Sources */, 1824 798916E92B04532D00D08302 /* CNLiveSavePointDB.swift in Sources */,
1790 1938BD242B468AC900390A34 /* CNLivePlayletHomePageHeaderCell.swift in Sources */, 1825 1938BD242B468AC900390A34 /* CNLivePlayletHomePageHeaderCell.swift in Sources */,
  1826 + 19B153D42BC623BE0018906C /* CNLiveShopPayWeChatAlipayCell.swift in Sources */,
1791 19FA20172AE22D3C001F7186 /* CNLiveDownSlideRecommendCell.swift in Sources */, 1827 19FA20172AE22D3C001F7186 /* CNLiveDownSlideRecommendCell.swift in Sources */,
1792 19123FC12ABC11170075C883 /* CNWebViewController.swift in Sources */, 1828 19123FC12ABC11170075C883 /* CNWebViewController.swift in Sources */,
1793 1926C28F2AE0D76C00C71DC3 /* CNLiveDownSlideViewModel.swift in Sources */, 1829 1926C28F2AE0D76C00C71DC3 /* CNLiveDownSlideViewModel.swift in Sources */,
1794 790D019D2A2DCBD000C5978D /* UIView+CNLiveExtensions.swift in Sources */, 1830 790D019D2A2DCBD000C5978D /* UIView+CNLiveExtensions.swift in Sources */,
  1831 + 19B153CF2BC540FF0018906C /* CNLivePayOrderInfoModel.swift in Sources */,
1795 7C7C62F62A4D72E9007A912E /* CNLiveIdentityDB.swift in Sources */, 1832 7C7C62F62A4D72E9007A912E /* CNLiveIdentityDB.swift in Sources */,
1796 191732E52B05FFE8007BCC04 /* CNLiveModalPresentationViewController.swift in Sources */, 1833 191732E52B05FFE8007BCC04 /* CNLiveModalPresentationViewController.swift in Sources */,
1797 799172342AF08D3200DC01A8 /* CNLiveShopViewModel.swift in Sources */, 1834 799172342AF08D3200DC01A8 /* CNLiveShopViewModel.swift in Sources */,
@@ -1811,6 +1848,7 @@ @@ -1811,6 +1848,7 @@
1811 19565EC72AF8AD38007D6727 /* CNLiveShopNewProductController.swift in Sources */, 1848 19565EC72AF8AD38007D6727 /* CNLiveShopNewProductController.swift in Sources */,
1812 798A44F72A3077ED00815935 /* CNLiveHotButton.swift in Sources */, 1849 798A44F72A3077ED00815935 /* CNLiveHotButton.swift in Sources */,
1813 7CD6753D2A2740B0008354C1 /* CNMainView.swift in Sources */, 1850 7CD6753D2A2740B0008354C1 /* CNMainView.swift in Sources */,
  1851 + 19B153CB2BC3E1870018906C /* CNLiveShopPayController.swift in Sources */,
1814 191733662B39237D007BCC04 /* CNLiveShopGoodsManageListTableViewCell.swift in Sources */, 1852 191733662B39237D007BCC04 /* CNLiveShopGoodsManageListTableViewCell.swift in Sources */,
1815 793CAF522A58FCA200882EF4 /* CNLiveMineExchangeViewController.swift in Sources */, 1853 793CAF522A58FCA200882EF4 /* CNLiveMineExchangeViewController.swift in Sources */,
1816 1917334E2B2C1A08007BCC04 /* CNLiveSelectCouponTapView.swift in Sources */, 1854 1917334E2B2C1A08007BCC04 /* CNLiveSelectCouponTapView.swift in Sources */,
@@ -1861,7 +1899,9 @@ @@ -1861,7 +1899,9 @@
1861 1938BD222B467C1700390A34 /* CNLivePlayletHomePageCell.swift in Sources */, 1899 1938BD222B467C1700390A34 /* CNLivePlayletHomePageCell.swift in Sources */,
1862 1938BD3F2B4BE7C500390A34 /* CNLiveAlbumMsgModel.swift in Sources */, 1900 1938BD3F2B4BE7C500390A34 /* CNLiveAlbumMsgModel.swift in Sources */,
1863 798A44FF2A30A0A800815935 /* CNLiveInputFeedBackViewController.swift in Sources */, 1901 798A44FF2A30A0A800815935 /* CNLiveInputFeedBackViewController.swift in Sources */,
  1902 + 19B153D22BC623980018906C /* CNLiveShopPayNeedPaymentCell.swift in Sources */,
1864 79282A442A2F1C1E00B5F8CF /* CNLiveLoginAuthView.swift in Sources */, 1903 79282A442A2F1C1E00B5F8CF /* CNLiveLoginAuthView.swift in Sources */,
  1904 + 19B153CD2BC3EB690018906C /* CNLiveShoph5ViewModel.swift in Sources */,
1865 79BB96A62AF21E2800AEA4AC /* CNLiveShopOrderDetailViewController.swift in Sources */, 1905 79BB96A62AF21E2800AEA4AC /* CNLiveShopOrderDetailViewController.swift in Sources */,
1866 194455A12B6B3310006C5A2A /* CNWebView.swift in Sources */, 1906 194455A12B6B3310006C5A2A /* CNWebView.swift in Sources */,
1867 1938BD2C2B4801A700390A34 /* CNHomePageAnimationTransition.swift in Sources */, 1907 1938BD2C2B4801A700390A34 /* CNHomePageAnimationTransition.swift in Sources */,
@@ -2132,7 +2172,7 @@ @@ -2132,7 +2172,7 @@
2132 CODE_SIGN_ENTITLEMENTS = metaCode/metaCode.entitlements; 2172 CODE_SIGN_ENTITLEMENTS = metaCode/metaCode.entitlements;
2133 CODE_SIGN_IDENTITY = "Apple Development"; 2173 CODE_SIGN_IDENTITY = "Apple Development";
2134 CODE_SIGN_STYLE = Automatic; 2174 CODE_SIGN_STYLE = Automatic;
2135 - CURRENT_PROJECT_VERSION = 1.0.9.24.03.29.15; 2175 + CURRENT_PROJECT_VERSION = 1.1.0.24.04.15.12;
2136 DEBUG_INFORMATION_FORMAT = dwarf; 2176 DEBUG_INFORMATION_FORMAT = dwarf;
2137 DEVELOPMENT_TEAM = 94X49GG3ZW; 2177 DEVELOPMENT_TEAM = 94X49GG3ZW;
2138 ENABLE_BITCODE = NO; 2178 ENABLE_BITCODE = NO;
@@ -2205,7 +2245,7 @@ @@ -2205,7 +2245,7 @@
2205 "$(inherited)", 2245 "$(inherited)",
2206 "@executable_path/Frameworks", 2246 "@executable_path/Frameworks",
2207 ); 2247 );
2208 - MARKETING_VERSION = 1.0.9; 2248 + MARKETING_VERSION = 1.1.0;
2209 OTHER_LDFLAGS = ( 2249 OTHER_LDFLAGS = (
2210 "$(inherited)", 2250 "$(inherited)",
2211 "-all_load", 2251 "-all_load",
@@ -2388,7 +2428,7 @@ @@ -2388,7 +2428,7 @@
2388 CODE_SIGN_ENTITLEMENTS = metaCode/metaCode.entitlements; 2428 CODE_SIGN_ENTITLEMENTS = metaCode/metaCode.entitlements;
2389 CODE_SIGN_IDENTITY = "Apple Development"; 2429 CODE_SIGN_IDENTITY = "Apple Development";
2390 CODE_SIGN_STYLE = Automatic; 2430 CODE_SIGN_STYLE = Automatic;
2391 - CURRENT_PROJECT_VERSION = 1.0.9.24.03.29.15; 2431 + CURRENT_PROJECT_VERSION = 1.1.0.24.04.15.12;
2392 DEVELOPMENT_TEAM = 94X49GG3ZW; 2432 DEVELOPMENT_TEAM = 94X49GG3ZW;
2393 ENABLE_BITCODE = NO; 2433 ENABLE_BITCODE = NO;
2394 ENABLE_MODULE_VERIFIER = NO; 2434 ENABLE_MODULE_VERIFIER = NO;
@@ -2460,7 +2500,7 @@ @@ -2460,7 +2500,7 @@
2460 "$(inherited)", 2500 "$(inherited)",
2461 "@executable_path/Frameworks", 2501 "@executable_path/Frameworks",
2462 ); 2502 );
2463 - MARKETING_VERSION = 1.0.9; 2503 + MARKETING_VERSION = 1.1.0;
2464 OTHER_LDFLAGS = ( 2504 OTHER_LDFLAGS = (
2465 "$(inherited)", 2505 "$(inherited)",
2466 "-all_load", 2506 "-all_load",
metaCode/Classes/Config/CNLiveConfigManager.swift
@@ -95,4 +95,9 @@ extension Notification.Name { @@ -95,4 +95,9 @@ extension Notification.Name {
95 //认证页垂直方向是哪个页面的通知 1上面页 2中间页 3下面页 95 //认证页垂直方向是哪个页面的通知 1上面页 2中间页 3下面页
96 public static let kAuthVNumPageChangedNotification = Notification.Name("kAuthVNumPageChangedNotification") 96 public static let kAuthVNumPageChangedNotification = Notification.Name("kAuthVNumPageChangedNotification")
97 } 97 }
  98 + struct ShopOrderManage{
  99 + //电商h5订单支付成功通知
  100 + public static let kDSSuccessPayOrderNotification = Notification.Name("kDSSuccessPayOrderNotification")
  101 + }
  102 +
98 } 103 }
metaCode/Classes/Main/HomePage/Controller/AuthMainController/CNMetaCodeHomePageController.swift
@@ -245,6 +245,7 @@ class CNMetaCodeHomePageController:CNLiveBaseViewController, NewPagedFlowViewDel @@ -245,6 +245,7 @@ class CNMetaCodeHomePageController:CNLiveBaseViewController, NewPagedFlowViewDel
245 super.viewWillAppear(animated) 245 super.viewWillAppear(animated)
246 self.view.height = KSreenHeight 246 self.view.height = KSreenHeight
247 self.topNavView.isHidden = true 247 self.topNavView.isHidden = true
  248 + self.hiddenLeftRightView()
248 // print("22222222currentPageIndex:\(self.pageFlowView.currentPageIndex)") 249 // print("22222222currentPageIndex:\(self.pageFlowView.currentPageIndex)")
249 switch vNumPage { 250 switch vNumPage {
250 case .VNumPageMain://中间主页 251 case .VNumPageMain://中间主页
@@ -263,10 +264,16 @@ class CNMetaCodeHomePageController:CNLiveBaseViewController, NewPagedFlowViewDel @@ -263,10 +264,16 @@ class CNMetaCodeHomePageController:CNLiveBaseViewController, NewPagedFlowViewDel
263 override func viewDidLayoutSubviews() { 264 override func viewDidLayoutSubviews() {
264 super.viewDidLayoutSubviews() 265 super.viewDidLayoutSubviews()
265 //解决self.view变成KSreenHeight-KTabBarHeight的问题 266 //解决self.view变成KSreenHeight-KTabBarHeight的问题
266 - if self.view.height == KSreenHeight-KTabBarHeight{ 267 + switch vNumPage {
  268 + case .VNumPageMain://中间主页
  269 + break
  270 + case .VNumPageUp://上滑页
  271 + self.view.height = KSreenHeight
  272 + case .VNumPageDown://下滑页
267 self.view.height = KSreenHeight 273 self.view.height = KSreenHeight
268 } 274 }
269 } 275 }
  276 +
270 deinit { 277 deinit {
271 /// 移除通知 278 /// 移除通知
272 NotificationCenter.default.removeObserver(self) 279 NotificationCenter.default.removeObserver(self)
@@ -505,6 +512,7 @@ class CNMetaCodeHomePageController:CNLiveBaseViewController, NewPagedFlowViewDel @@ -505,6 +512,7 @@ class CNMetaCodeHomePageController:CNLiveBaseViewController, NewPagedFlowViewDel
505 512
506 let identityModel = dataArray[toIndex] as! StandListModel 513 let identityModel = dataArray[toIndex] as! StandListModel
507 if let toBannerView = self.pageFlowView.cells[toIndex] as? CNCustomIndexView{ 514 if let toBannerView = self.pageFlowView.cells[toIndex] as? CNCustomIndexView{
  515 + self.pageFlowView.scrollView.bringSubviewToFront(toBannerView)
508 UIView.animate(withDuration: 0.2) { 516 UIView.animate(withDuration: 0.2) {
509 toBannerView.downSlideView.frame = CGRectMake(-LeftGap, 0, KSreenWidth, KSreenHeight) 517 toBannerView.downSlideView.frame = CGRectMake(-LeftGap, 0, KSreenWidth, KSreenHeight)
510 toBannerView.downSlideView.upSlideVC.view.height = KSreenHeight-DownSlideBottomViewHeight 518 toBannerView.downSlideView.upSlideVC.view.height = KSreenHeight-DownSlideBottomViewHeight
@@ -515,32 +523,22 @@ class CNMetaCodeHomePageController:CNLiveBaseViewController, NewPagedFlowViewDel @@ -515,32 +523,22 @@ class CNMetaCodeHomePageController:CNLiveBaseViewController, NewPagedFlowViewDel
515 } 523 }
516 524
517 } 525 }
518 - if let toBannerViewLeftView = self.pageFlowView.cells[toIndex-1] as? CNCustomIndexView{  
519 - UIView.animate(withDuration: 0.2) {  
520 - toBannerViewLeftView.downSlideView.frame = CGRectMake(-LeftGap, 0, 0, 0)  
521 - toBannerViewLeftView.upSlideView.frame = CGRectMake(-LeftGap, KSreenHeight*2,0, 0) 526 + if toIndex-1 >= 0{
  527 + if let toBannerViewLeftView = self.pageFlowView.cells[toIndex-1] as? CNCustomIndexView{
  528 + UIView.animate(withDuration: 0.2) {
  529 + toBannerViewLeftView.downSlideView.frame = CGRectMake(-LeftGap, 0, 0, 0)
  530 + toBannerViewLeftView.upSlideView.frame = CGRectMake(-LeftGap, KSreenHeight*2,0, 0)
  531 + }
522 } 532 }
523 } 533 }
524 - if let toBannerViewRightView = self.pageFlowView.cells[toIndex+1] as? CNCustomIndexView{  
525 - UIView.animate(withDuration: 0.2) {  
526 - toBannerViewRightView.downSlideView.frame = CGRectMake(-LeftGap, 0, 0, 0)  
527 - toBannerViewRightView.upSlideView.frame = CGRectMake(-LeftGap, KSreenHeight*2,0, 0) 534 + if toIndex+1 < self.pageFlowView.cells.count{
  535 + if let toBannerViewRightView = self.pageFlowView.cells[toIndex+1] as? CNCustomIndexView{
  536 + UIView.animate(withDuration: 0.2) {
  537 + toBannerViewRightView.downSlideView.frame = CGRectMake(-LeftGap, 0, 0, 0)
  538 + toBannerViewRightView.upSlideView.frame = CGRectMake(-LeftGap, KSreenHeight*2,0, 0)
  539 + }
528 } 540 }
529 } 541 }
530 -  
531 -// for (idx,obj) in self.pageFlowView.cells.enumerated(){  
532 -// let bannerView = obj as? CNCustomIndexView  
533 -// if idx == toIndex{  
534 -// bannerView?.downSlideView.frame = CGRectMake(-LeftGap, 0, KSreenWidth, KSreenHeight)  
535 -// bannerView?.downSlideView.upSlideVC.view.height = KSreenHeight-DownSlideBottomViewHeight  
536 -// bannerView?.downSlideView.shopConsoleVC.view.height = KSreenHeight-DownSlideBottomViewHeight  
537 -//  
538 -// bannerView?.upSlideView.frame = CGRectMake(-LeftGap, KSreenHeight*2,KSreenWidth, KSreenHeight)  
539 -// }else{  
540 -// bannerView?.downSlideView.frame = CGRectMake(-LeftGap, 0, 0, 0)  
541 -// bannerView?.upSlideView.frame = CGRectMake(-LeftGap, KSreenHeight*2,0, 0)  
542 -// }  
543 -// }  
544 } 542 }
545 543
546 544
@@ -611,6 +609,9 @@ class CNMetaCodeHomePageController:CNLiveBaseViewController, NewPagedFlowViewDel @@ -611,6 +609,9 @@ class CNMetaCodeHomePageController:CNLiveBaseViewController, NewPagedFlowViewDel
611 vNumPage = .VNumPageUp 609 vNumPage = .VNumPageUp
612 } 610 }
613 611
  612 + //左右上角遮盖的视图 宽高设为0
  613 + self.hiddenLeftRightView()
  614 +
614 if scrollView.contentOffset.y == KSreenHeight { 615 if scrollView.contentOffset.y == KSreenHeight {
615 self.view.height = self.tabBarY 616 self.view.height = self.tabBarY
616 617
@@ -626,6 +627,42 @@ class CNMetaCodeHomePageController:CNLiveBaseViewController, NewPagedFlowViewDel @@ -626,6 +627,42 @@ class CNMetaCodeHomePageController:CNLiveBaseViewController, NewPagedFlowViewDel
626 // } 627 // }
627 } 628 }
628 } 629 }
  630 + // MARK: - 左右上角遮盖的视图 宽高设为0
  631 + func hiddenLeftRightView(){
  632 + let toIndex:Int = self.pageFlowView.currentPageIndex
  633 + if dataArray.count > toIndex{
  634 + if let identityModel = dataArray[toIndex] as? StandListModel{
  635 + if let toBannerView = self.pageFlowView.cells[toIndex] as? CNCustomIndexView{
  636 + self.pageFlowView.scrollView.bringSubviewToFront(toBannerView)
  637 + UIView.animate(withDuration: 0.2) {
  638 + toBannerView.downSlideView.frame = CGRectMake(-LeftGap, 0, KSreenWidth, KSreenHeight)
  639 + toBannerView.downSlideView.upSlideVC.view.height = KSreenHeight-DownSlideBottomViewHeight
  640 + if identityModel.id == 9{
  641 + toBannerView.downSlideView.shopConsoleVC.view.height = KSreenHeight-DownSlideBottomViewHeight
  642 + }
  643 + toBannerView.upSlideView.frame = CGRectMake(-LeftGap, KSreenHeight*2,KSreenWidth, KSreenHeight)
  644 + }
  645 +
  646 + }
  647 + }
  648 + }
  649 + if toIndex-1 >= 0{
  650 + if let toBannerViewLeftView = self.pageFlowView.cells[toIndex-1] as? CNCustomIndexView{
  651 + UIView.animate(withDuration: 0.2) {
  652 + toBannerViewLeftView.downSlideView.frame = CGRectMake(-LeftGap, 0, 0, 0)
  653 + toBannerViewLeftView.upSlideView.frame = CGRectMake(-LeftGap, KSreenHeight*2,0, 0)
  654 + }
  655 + }
  656 + }
  657 + if toIndex+1 < self.pageFlowView.cells.count{
  658 + if let toBannerViewRightView = self.pageFlowView.cells[toIndex+1] as? CNCustomIndexView{
  659 + UIView.animate(withDuration: 0.2) {
  660 + toBannerViewRightView.downSlideView.frame = CGRectMake(-LeftGap, 0, 0, 0)
  661 + toBannerViewRightView.upSlideView.frame = CGRectMake(-LeftGap, KSreenHeight*2,0, 0)
  662 + }
  663 + }
  664 + }
  665 + }
629 666
630 //MARK: - 网络请求获取身份列表 667 //MARK: - 网络请求获取身份列表
631 func getUserIdentityApi() 668 func getUserIdentityApi()
metaCode/Classes/Main/HomePage/Controller/DownSlideController/CNUpSlideDetailViewController.swift
@@ -230,54 +230,41 @@ class CNUpSlideDetailViewController: CNLiveBaseViewController,UITableViewDataSou @@ -230,54 +230,41 @@ class CNUpSlideDetailViewController: CNLiveBaseViewController,UITableViewDataSou
230 func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell { 230 func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell {
231 231
232 if indexPath.section == 0{ 232 if indexPath.section == 0{
233 - if self.cellType == .playlet{  
234 - //短剧大图  
235 - guard let cell = tableView.dequeueReusableCell(withIdentifier: kCNLiveAlbumImageCellIdentifier) as? CNLiveAlbumImageCell 233 + if self.cellType == .courseToMyCurriculum{
  234 + //我的课程
  235 + guard let cell = tableView.dequeueReusableCell(withIdentifier: kCNLiveCourseTitleCellIdentifier) as? CNLiveDuanjuTitleCell
236 else { 236 else {
237 - let cell = CNLiveAlbumImageCell() 237 + let cell = CNLiveDuanjuTitleCell()
238 return cell 238 return cell
239 } 239 }
240 - cell.iconImgView.image = self.cell.bgImageView.image  
241 - cell.titleLabel.text = self.cell.slideModel?.contents[0].title ?? "" 240 + cell.cellType = .courseToMyCurriculum
  241 + cell.blockName = "我的课程"
242 return cell 242 return cell
243 - }else if self.cellType == .course || self.cellType == .playletToCourse || self.cellType == .courseToMyCurriculum{  
244 - if self.cellType == .courseToMyCurriculum{  
245 - //我的课程 243 + }else{
  244 + if self.slideModel?.type == SlideModelTypeAllCourse12{
  245 + //全部课程
246 guard let cell = tableView.dequeueReusableCell(withIdentifier: kCNLiveCourseTitleCellIdentifier) as? CNLiveDuanjuTitleCell 246 guard let cell = tableView.dequeueReusableCell(withIdentifier: kCNLiveCourseTitleCellIdentifier) as? CNLiveDuanjuTitleCell
247 else { 247 else {
248 let cell = CNLiveDuanjuTitleCell() 248 let cell = CNLiveDuanjuTitleCell()
249 return cell 249 return cell
250 } 250 }
251 - cell.cellType = .courseToMyCurriculum  
252 - cell.blockName = "我的课程" 251 + cell.cellType = .course
  252 + cell.blockName = self.slideModel?.blockName
253 return cell 253 return cell
254 - }else{  
255 - if self.slideModel?.type == SlideModelTypeAllCourse12{  
256 - //全部课程  
257 - guard let cell = tableView.dequeueReusableCell(withIdentifier: kCNLiveCourseTitleCellIdentifier) as? CNLiveDuanjuTitleCell  
258 - else {  
259 - let cell = CNLiveDuanjuTitleCell()  
260 - return cell  
261 - }  
262 - cell.cellType = .course  
263 - cell.blockName = self.slideModel?.blockName  
264 - return cell  
265 -  
266 - }else if self.slideModel?.type == SlideModelTypeOneCourse75{  
267 - //大图课程  
268 - guard let cell = tableView.dequeueReusableCell(withIdentifier: kCNLiveAlbumImageCellIdentifier) as? CNLiveAlbumImageCell  
269 - else {  
270 - let cell = CNLiveAlbumImageCell()  
271 - return cell  
272 - }  
273 - cell.iconImgView.image = self.cell.bgImageView.image  
274 - cell.titleLabel.text = self.cell.slideModel?.contents[0].title ?? "" 254 +
  255 + }else if self.slideModel?.type == SlideModelTypeOneCourse75{
  256 + //大图课程
  257 + guard let cell = tableView.dequeueReusableCell(withIdentifier: kCNLiveAlbumImageCellIdentifier) as? CNLiveAlbumImageCell
  258 + else {
  259 + let cell = CNLiveAlbumImageCell()
275 return cell 260 return cell
276 -  
277 } 261 }
  262 + cell.iconImgView.image = self.cell.bgImageView.image
  263 + cell.titleLabel.text = self.cell.slideModel?.contents[0].title ?? ""
  264 + return cell
  265 +
278 } 266 }
279 } 267 }
280 -  
281 }else{ 268 }else{
282 //列表cell 269 //列表cell
283 let albumModel = self.dataArray[indexPath.row] as! CNLiveAlbumModel 270 let albumModel = self.dataArray[indexPath.row] as! CNLiveAlbumModel
@@ -297,17 +284,12 @@ class CNUpSlideDetailViewController: CNLiveBaseViewController,UITableViewDataSou @@ -297,17 +284,12 @@ class CNUpSlideDetailViewController: CNLiveBaseViewController,UITableViewDataSou
297 } 284 }
298 func tableView(_ tableView: UITableView, heightForRowAt indexPath: IndexPath) -> CGFloat { 285 func tableView(_ tableView: UITableView, heightForRowAt indexPath: IndexPath) -> CGFloat {
299 if indexPath.section == 0{ 286 if indexPath.section == 0{
300 - if self.cellType == .playlet{  
301 - //短剧大图 287 + if self.slideModel?.type == SlideModelTypeAllCourse12{
  288 + //全部课程
  289 + return allCourseCellHeight+get_system_statusBar_height()
  290 + }else if self.slideModel?.type == SlideModelTypeOneCourse75{
  291 + //大图课程
302 return KSreenWidth 292 return KSreenWidth
303 - }else if self.cellType == .course || self.cellType == .playletToCourse{  
304 - if self.slideModel?.type == SlideModelTypeAllCourse12{  
305 - //全部课程  
306 - return allCourseCellHeight+get_system_statusBar_height()  
307 - }else if self.slideModel?.type == SlideModelTypeOneCourse75{  
308 - //大图课程  
309 - return KSreenWidth  
310 - }  
311 } 293 }
312 }else{ 294 }else{
313 return 75 295 return 75
@@ -319,16 +301,11 @@ class CNUpSlideDetailViewController: CNLiveBaseViewController,UITableViewDataSou @@ -319,16 +301,11 @@ class CNUpSlideDetailViewController: CNLiveBaseViewController,UITableViewDataSou
319 let albumModel = self.dataArray[indexPath.row] as! CNLiveAlbumModel 301 let albumModel = self.dataArray[indexPath.row] as! CNLiveAlbumModel
320 if indexPath.section == 0{ 302 if indexPath.section == 0{
321 //大图统一不能点击跳转 303 //大图统一不能点击跳转
322 - if self.cellType == .playlet{  
323 - //短剧大图,跳转播放页  
324 -// navigationViewController().visibleViewController?.navigationController?.pushViewController(CNLiveShortVideoViewController(aid: albumModel.contentId), animated: pushAnimated)  
325 - }else if self.cellType == .course || self.cellType == .playletToCourse{  
326 - if self.slideModel?.type == SlideModelTypeAllCourse12{  
327 - //全部课程,跳转h5 304 + if self.slideModel?.type == SlideModelTypeAllCourse12{
  305 + //全部课程,跳转h5
328 306
329 - }else if self.slideModel?.type == SlideModelTypeOneCourse75{  
330 - //大图课程,跳转h5  
331 - } 307 + }else if self.slideModel?.type == SlideModelTypeOneCourse75{
  308 + //大图课程,跳转h5
332 } 309 }
333 }else{ 310 }else{
334 CNLiveDownSlideTool.pushWebVCWithContentsMdl(model: albumModel.model, contentId: albumModel.contentId, pid: albumModel.pid, shareUrl: albumModel.shareUrl, thirdUrl: albumModel.thirdUrl, title: albumModel.title, s_to: albumModel.s_to, trailerId: albumModel.trailerId, controller: self) 311 CNLiveDownSlideTool.pushWebVCWithContentsMdl(model: albumModel.model, contentId: albumModel.contentId, pid: albumModel.pid, shareUrl: albumModel.shareUrl, thirdUrl: albumModel.thirdUrl, title: albumModel.title, s_to: albumModel.s_to, trailerId: albumModel.trailerId, controller: self)
metaCode/Classes/Main/HomePage/Controller/DownSlideController/CNUpSlideViewController.swift
@@ -380,7 +380,9 @@ class CNUpSlideViewController: CNLiveBaseViewController,UITableViewDelegate,UITa @@ -380,7 +380,9 @@ class CNUpSlideViewController: CNLiveBaseViewController,UITableViewDelegate,UITa
380 if status == .success{ 380 if status == .success{
381 self.myCurriculumDataArray.removeAllObjects() 381 self.myCurriculumDataArray.removeAllObjects()
382 let albumBaseModel = result as! CNLiveAlbumBaseModel 382 let albumBaseModel = result as! CNLiveAlbumBaseModel
383 - self.myCurriculumDataArray.addObjects(from: [albumBaseModel]) 383 + if albumBaseModel.list.count > 0{
  384 + self.myCurriculumDataArray.addObjects(from: [albumBaseModel])
  385 + }
384 self.myCurriculumIndex = -1 386 self.myCurriculumIndex = -1
385 if self.myCurriculumDataArray.count>0{ 387 if self.myCurriculumDataArray.count>0{
386 //有我的课程 388 //有我的课程
@@ -395,7 +397,9 @@ class CNUpSlideViewController: CNLiveBaseViewController,UITableViewDelegate,UITa @@ -395,7 +397,9 @@ class CNUpSlideViewController: CNLiveBaseViewController,UITableViewDelegate,UITa
395 //没有我的课程 397 //没有我的课程
396 self.myCurriculumIndex = -1 398 self.myCurriculumIndex = -1
397 } 399 }
398 - self.dataArray.insert(albumBaseModel, at: self.myCurriculumIndex) 400 + if self.myCurriculumIndex > -1{
  401 + self.dataArray.insert(albumBaseModel, at: self.myCurriculumIndex)
  402 + }
399 self.tableView.reloadData() 403 self.tableView.reloadData()
400 }else if (status == .failed){ 404 }else if (status == .failed){
401 // self.NetApiStatus = .apiError 405 // self.NetApiStatus = .apiError
metaCode/Classes/Main/HomePage/Controller/ShopUpConsole/CNLiveShopConsoleController.swift renamed to metaCode/Classes/Main/HomePage/Controller/ShopDownConsole/CNLiveShopConsoleController.swift
metaCode/Classes/Main/HomePage/Controller/ShopPayController/CNLiveShopPayController.swift 0 → 100644
  1 +//
  2 +// CNLiveShopPayController.swift
  3 +// metaCode
  4 +//
  5 +// Created by zx on 2024/4/8.
  6 +// 支付页面
  7 +
  8 +import Foundation
  9 +import CNLivePayCostModule
  10 +
  11 +///支付类型
  12 +enum CNLivePayType {
  13 + //支付宝
  14 + case alipay
  15 + //微信
  16 + case weChat
  17 +}
  18 +//支付状态
  19 +enum CNLivePayResult {
  20 + //成功
  21 + case success
  22 + //失败
  23 + case failure
  24 + //取消支付
  25 + case cancel
  26 +}
  27 +
  28 +//支付完成回调
  29 +typealias FinishPayCallBack = (_ orderInfoModel:CNLivePayOrderInfoModel,_ payType:CNLivePayType,_ payResult:CNLivePayResult)->Void
  30 +
  31 +class CNLiveShopPayController:CNLiveBaseViewController,UITableViewDelegate,UITableViewDataSource{
  32 +
  33 + var finishPayCallBack:FinishPayCallBack?
  34 + var orderNumber:String
  35 + var orderInfoModel:CNLivePayOrderInfoModel?
  36 + var currentSeleWechat = true
  37 + var wechatIsInstall = true //微信是否安装
  38 + var alipayIsInstall = true //支付宝是否安装
  39 + var payType:CNLivePayType?
  40 +
  41 + let kCNLiveShopPayNeedPaymentCellIdentifier = "kCNLiveShopPayNeedPaymentCellIdentifier"
  42 + let kCNLiveShopPayWeChatAlipayCellIdentifier = "kCNLiveShopPayWeChatAlipayCellIdentifier"
  43 +
  44 + // MARK: - 懒加载
  45 + lazy var tableView : UITableView = {
  46 + let tableView = UITableView(frame: CGRect(x: 0, y: KNavigationHeight, width: KSreenWidth, height: KSreenHeight-KNavigationHeight-KTabBarHeight), style: .plain)
  47 + tableView.dataSource = self
  48 + tableView.delegate = self
  49 + tableView.separatorStyle = .singleLine
  50 + tableView.tableFooterView = UIView.init()
  51 + tableView.register(CNLiveShopPayNeedPaymentCell.self, forCellReuseIdentifier: kCNLiveShopPayNeedPaymentCellIdentifier)
  52 + tableView.register(CNLiveShopPayWeChatAlipayCell.self, forCellReuseIdentifier: kCNLiveShopPayWeChatAlipayCellIdentifier)
  53 + return tableView
  54 + }()
  55 +
  56 + lazy var payBtn: UIButton = {
  57 + let payBtn = UIButton(type: .custom)
  58 + payBtn.frame = CGRect(x: 0, y: self.tableView.bottom, width: KSreenWidth, height: KTabBarHeight)
  59 + payBtn.backgroundColor = UIColor(red:0.29, green:0.64, blue:0.25, alpha:1.00)
  60 + payBtn.setTitleColor(.white, for: .normal)
  61 + payBtn.setTitle("支付", for: .normal)
  62 + payBtn.addTarget(self, action: #selector(payBtnAction), for: .touchUpInside)
  63 + return payBtn
  64 + }()
  65 +
  66 +
  67 + init(orderNumber:String) {
  68 + self.orderNumber = orderNumber
  69 + super.init(nibName: nil, bundle: nil)
  70 + }
  71 +
  72 + required init?(coder: NSCoder) {
  73 + fatalError("init(coder:) has not been implemented")
  74 + }
  75 +
  76 + deinit {
  77 + NotificationCenter.default.removeObserver(self, name: UIApplication.didBecomeActiveNotification, object: nil)
  78 + }
  79 +
  80 + override func viewDidLoad() {
  81 + super.viewDidLoad()
  82 + navigationBarHidden = false
  83 + titleName = "收银台"
  84 + self.view.backgroundColor = .white
  85 + NotificationCenter.default.addObserver(self, selector: #selector(didBecomeActiveNotification(_:)), name: UIApplication.didBecomeActiveNotification, object: nil)
  86 + self.getOrderInfoMessage()
  87 + self.initUI()
  88 +
  89 + if WXApi.isWXAppInstalled(){
  90 + self.wechatIsInstall = true
  91 + }else{
  92 + self.wechatIsInstall = false
  93 + }
  94 +
  95 + let urlScheme = "alipay://"
  96 + if UIApplication.shared.canOpenURL(URL(string: urlScheme)!) {
  97 + self.alipayIsInstall = true
  98 + } else {
  99 + self.alipayIsInstall = false
  100 + }
  101 +
  102 + }
  103 + // MARK: - 获取订单信息 并且进行检测
  104 + func getOrderInfoMessage(){
  105 + if self.orderNumber.count == 0{
  106 + return
  107 + }
  108 + showLoading(message: "")
  109 + CNLiveShoph5ViewModel.postOrderPayWithParams(orderId: self.orderNumber) { result, status in
  110 + hiddenLoading()
  111 + if status == .success{
  112 + let orderInfoModel = result as! CNLivePayOrderInfoModel
  113 + self.orderInfoModel = orderInfoModel
  114 + self.tableView.reloadData()
  115 + }else{
  116 + }
  117 + }
  118 +
  119 + }
  120 +
  121 + func initUI(){
  122 + self.view.addSubview(self.tableView)
  123 + self.view.addSubview(self.payBtn)
  124 + }
  125 +
  126 + @objc func payBtnAction(){
  127 +
  128 + if self.currentSeleWechat == true && self.wechatIsInstall == false{
  129 + showMessage(message: "请安装微信")
  130 + return
  131 + }
  132 + if self.currentSeleWechat == false && self.alipayIsInstall == false{
  133 + showMessage(message: "请安装支付宝")
  134 + return
  135 + }
  136 + showLoading(message: "")
  137 + let orderId = self.orderInfoModel?.orderId
  138 + var userId = self.orderInfoModel?.user_id
  139 + if userId?.count == 0{
  140 + userId = UserInfoManager.shared.userInfo.uid
  141 + }
  142 + let descStr = self.orderInfoModel?.body
  143 + let price = self.orderInfoModel?.totalMoney
  144 + let body = self.orderInfoModel?.body
  145 + let coupon_fee = self.orderInfoModel?.couponMoney
  146 + let notifyUrl = self.orderInfoModel?.notify_url
  147 +
  148 + let paramDict = NSMutableDictionary()
  149 + paramDict.setValue(orderId, forKey: "orderId")
  150 + paramDict.setValue(userId, forKey: "user_id")
  151 + paramDict.setValue(descStr, forKey: "descStr")
  152 + paramDict.setValue(price, forKey: "price")
  153 + paramDict.setValue("1", forKey: "orderType")
  154 + paramDict.setValue("1", forKey: "type")
  155 + paramDict.setValue(body, forKey: "body")
  156 + paramDict.setValue(coupon_fee, forKey: "coupon_fee")
  157 + paramDict.setValue(notifyUrl, forKey: "notifyUrl")
  158 + paramDict.setValue("", forKey: "password")
  159 +
  160 + var payCostType:CNLivePayCostPayType?
  161 + if self.currentSeleWechat == true{
  162 + self.payType = .weChat
  163 + payCostType = CNLivePayCostPayTypeWeChatPay
  164 + }else{
  165 + self.payType = .alipay
  166 + payCostType = CNLivePayCostPayTypeAliPay
  167 + }
  168 +
  169 + CNLivePayCostModule.showShopPayViw(withParamDict: paramDict as! [String : Any], payType: payCostType!) { resultCode in
  170 + hiddenLoading()
  171 + if resultCode == 0{
  172 + self.checkPayIsSuccessful(lastCount: 5)
  173 + }else if resultCode == 3{
  174 + showMessage(message: "取消支付")
  175 + }else {
  176 + showMessage(message: "支付失败")
  177 + }
  178 + }
  179 +
  180 + }
  181 +
  182 + @objc func didBecomeActiveNotification(_ notification: Notification) {
  183 + // 处理应用变得活跃的逻辑
  184 + DispatchQueue.main.asyncAfter(deadline: .now() + 0.5) {
  185 + // 这里写你想要在 0.5 秒后执行的代码
  186 + self.checkPayIsSuccessful(lastCount: 0)
  187 + }
  188 +
  189 + }
  190 +
  191 + // MARK: - 检测是否支付成功
  192 + /// 检测是否支付成功
  193 + /// @param lastCount 剩余检测次数
  194 + func checkPayIsSuccessful(lastCount:NSInteger){
  195 + showLoading(message: "")
  196 + CNLiveShoph5ViewModel.postIsOrderPayWithOrderId(orderId: self.orderNumber) { result, status in
  197 + hiddenLoading()
  198 + if status == .success{
  199 + self.finishPayCallBack?(self.orderInfoModel!, self.payType!, .success)
  200 +// NotificationCenter.default.post(name: Notification.Name.ShopOrderManage.kDSSuccessPayOrderNotification, object: nil)
  201 + self.navigationController?.popViewController(animated: true)
  202 + }else{
  203 + if lastCount > 0{
  204 + DispatchQueue.main.asyncAfter(deadline: .now() + 1) {
  205 + // 这里写你想要在 0.5 秒后执行的代码
  206 + self.checkPayIsSuccessful(lastCount: lastCount-1)
  207 + }
  208 + }
  209 + }
  210 + }
  211 +
  212 + }
  213 +
  214 + // MARK: - UITableViewDelegate
  215 + func numberOfSections(in tableView: UITableView) -> Int {
  216 + 2
  217 + }
  218 + func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -> Int {
  219 + if section == 0{
  220 + return 1
  221 + }else{
  222 + return 2
  223 + }
  224 + }
  225 +
  226 + func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell {
  227 + if indexPath.section == 0{
  228 + guard let cell = tableView.dequeueReusableCell(withIdentifier: kCNLiveShopPayNeedPaymentCellIdentifier) as? CNLiveShopPayNeedPaymentCell
  229 + else {
  230 + let cell = CNLiveShopPayNeedPaymentCell()
  231 + return cell
  232 + }
  233 + let monStr = String(format: "需要付款: ¥%.2f", (Double(self.orderInfoModel?.totalMoney ?? "0.00") ?? 0.00) / 100)
  234 + let attribute = NSMutableAttributedString.init(string:monStr)
  235 + let attIndex = 6
  236 + attribute.addAttributes([NSAttributedString.Key.foregroundColor: HexColor("#222222")!], range: NSRange.init(location: 0, length: attIndex))
  237 + attribute.addAttributes([NSAttributedString.Key.foregroundColor: UIColor(red:0.29, green:0.64, blue:0.25, alpha:1.00)], range: NSRange.init(location: attIndex, length: monStr.count-attIndex))
  238 + cell.titleLabel.attributedText = attribute
  239 + return cell
  240 + }else{
  241 + guard let cell = tableView.dequeueReusableCell(withIdentifier: kCNLiveShopPayWeChatAlipayCellIdentifier) as? CNLiveShopPayWeChatAlipayCell
  242 + else {
  243 + let cell = CNLiveShopPayWeChatAlipayCell()
  244 + return cell
  245 + }
  246 + if indexPath.row == 0{
  247 + //微信支付
  248 +
  249 + cell.iconImgView.image = UIImage(named: "dd_weixin")
  250 + if self.currentSeleWechat == true{
  251 + cell.selectImgView.isHidden = false
  252 + }else{
  253 + cell.selectImgView.isHidden = true
  254 + }
  255 + if self.wechatIsInstall{
  256 + cell.titleLabel.text = "微信支付"
  257 + }else{
  258 + cell.titleLabel.text = "微信未安装,无法使用微信支付"
  259 + }
  260 + }else{
  261 + //支付宝支付
  262 + cell.iconImgView.image = UIImage(named: "dd_zhifubao")
  263 + if self.currentSeleWechat == true{
  264 + cell.selectImgView.isHidden = true
  265 + }else{
  266 + cell.selectImgView.isHidden = false
  267 + }
  268 + if self.alipayIsInstall{
  269 + cell.titleLabel.text = "支付宝支付"
  270 + }else{
  271 + cell.titleLabel.text = "支付宝未安装,无法使用支付宝支付"
  272 + }
  273 + }
  274 + return cell
  275 + }
  276 + }
  277 + func tableView(_ tableView: UITableView, didSelectRowAt indexPath: IndexPath) {
  278 + if indexPath.section == 1{
  279 + if indexPath.row == 0{
  280 + if self.wechatIsInstall == false{
  281 + showMessage(message: "请安装微信")
  282 + return
  283 + }
  284 + if self.currentSeleWechat == true{
  285 + return
  286 + }
  287 + self.currentSeleWechat = true
  288 + }else{
  289 + if self.alipayIsInstall == false{
  290 + showMessage(message: "请安装支付宝")
  291 + return
  292 + }
  293 + if self.currentSeleWechat == false{
  294 + return
  295 + }
  296 + self.currentSeleWechat = false
  297 + }
  298 + self.tableView.reloadData()
  299 + }
  300 + }
  301 + func tableView(_ tableView: UITableView, heightForRowAt indexPath: IndexPath) -> CGFloat {
  302 + return 60
  303 + }
  304 +
  305 +}
metaCode/Classes/Main/HomePage/Controller/ShopDownDetail/CNLiveDownShopDetailController.swift renamed to metaCode/Classes/Main/HomePage/Controller/ShopUpDetail/CNLiveDownShopDetailController.swift
@@ -13,6 +13,7 @@ class CNLiveDownShopDetailController:CNLiveBaseViewController, UICollectionViewD @@ -13,6 +13,7 @@ class CNLiveDownShopDetailController:CNLiveBaseViewController, UICollectionViewD
13 let kCNLiveShopDetailDefaultCellID = "kCNLiveShopDetailDefaultCellID" 13 let kCNLiveShopDetailDefaultCellID = "kCNLiveShopDetailDefaultCellID"
14 let kCNLiveShopDetailHeaderViewID = "kCNLiveShopDetailHeaderViewID" 14 let kCNLiveShopDetailHeaderViewID = "kCNLiveShopDetailHeaderViewID"
15 15
  16 + let kCNLiveShopDetailCloseCellID = "kCNLiveShopDetailCloseCellID"
16 let kCNLiveShopDetailBannerCellID = "kCNLiveShopDetailBannerCellID" 17 let kCNLiveShopDetailBannerCellID = "kCNLiveShopDetailBannerCellID"
17 let kCNLiveShopDetailBtnsCellID = "kCNLiveShopDetailBtnsCellID" 18 let kCNLiveShopDetailBtnsCellID = "kCNLiveShopDetailBtnsCellID"
18 let kCNLiveShopDetailOrderAssetCellID = "kCNLiveShopDetailOrderAssetCellID" 19 let kCNLiveShopDetailOrderAssetCellID = "kCNLiveShopDetailOrderAssetCellID"
@@ -22,56 +23,21 @@ class CNLiveDownShopDetailController:CNLiveBaseViewController, UICollectionViewD @@ -22,56 +23,21 @@ class CNLiveDownShopDetailController:CNLiveBaseViewController, UICollectionViewD
22 let shopDetailModel = CNLiveShopDetailModel() 23 let shopDetailModel = CNLiveShopDetailModel()
23 return shopDetailModel 24 return shopDetailModel
24 }() 25 }()
25 - override func touchesBegan(_ touches: Set<UITouch>, with event: UIEvent?) {  
26 - let upSlideView = self.view.superview as! CNUpSlideView  
27 - let scrollView = upSlideView.superview as! UIScrollView  
28 - scrollView.setContentOffset(CGPoint(x: 0, y: scrollView.height), animated: true)  
29 -  
30 - let result:Dictionary = ["AuthVNumPage":2]  
31 - NotificationCenter.default.post(name: Notification.Name.AuthVNumPageManage.kAuthVNumPageChangedNotification, object: nil, userInfo: result)  
32 -  
33 - currentViewController()?.tabBarController?.tabBar.isHidden = false  
34 -  
35 - let metaVC = currentViewController() as! CNMetaCodeHomePageController  
36 - let index = metaVC.pageFlowView.currentPageIndex  
37 - let customIndexView = metaVC.pageFlowView.viewWithTag(100+index) as! CNCustomIndexView  
38 - customIndexView.superScrollView?.isScrollEnabled = true  
39 - }  
40 -// lazy var closeBtn: UIButton = {  
41 -// let closeBtn = UIButton(type: .custom)  
42 -// closeBtn.frame = CGRect(x: KSreenWidth-50, y: KStatusBarHeight, width: 50, height: KNavigationHeight-KStatusBarHeight)  
43 -// closeBtn.setImage(UIImage(named: "mine_header_icon_close"), for: .normal)  
44 -// closeBtn.addTarget(self, action: #selector(closeBtnAction), for: .touchUpInside)  
45 -// closeBtn.isUserInteractionEnabled = false  
46 -// return closeBtn  
47 -// }()  
48 -  
49 -// lazy var navView: UIView = {  
50 -// let closeBtn = UIView(frame: CGRect(x: 0, y: KStatusBarHeight, width: KSreenWidth-50, height: KNavigationHeight-KStatusBarHeight))  
51 -// closeBtn.backgroundColor = .yellow  
52 -// return closeBtn  
53 -// }()  
54 - lazy var closeBtn: UIImageView = {  
55 - let closeBtn = UIImageView(frame: CGRect(x: KSreenWidth-35, y: KStatusBarHeight+(KNavigationHeight-KStatusBarHeight-20)*0.5, width: 20, height: 20))  
56 - closeBtn.image = UIImage(named: "mine_header_icon_close")  
57 -// closeBtn.isUserInteractionEnabled = true  
58 -// let tap = UITapGestureRecognizer.init(target: self, action: #selector(closeBtnAction))  
59 -// closeBtn.addGestureRecognizer(tap)  
60 - return closeBtn  
61 - }()  
62 -  
63 lazy var collectionView: UICollectionView = { 26 lazy var collectionView: UICollectionView = {
64 let layout = UICollectionViewFlowLayout.init() 27 let layout = UICollectionViewFlowLayout.init()
65 let collectionView = UICollectionView(frame: .zero, collectionViewLayout: layout) 28 let collectionView = UICollectionView(frame: .zero, collectionViewLayout: layout)
66 collectionView.delegate = self 29 collectionView.delegate = self
67 collectionView.dataSource = self 30 collectionView.dataSource = self
68 collectionView.backgroundColor = .white 31 collectionView.backgroundColor = .white
69 -// collectionView.register(CNLiveShopConsoleHeaderView.self, forSupplementaryViewOfKind: UICollectionView.elementKindSectionHeader, withReuseIdentifier: kCNLiveShopConsoleCollectionReusableHeaderViewID) 32 +
  33 + collectionView.register(CNLliveShopDetailCloseCell.self, forCellWithReuseIdentifier: kCNLiveShopDetailCloseCellID)
  34 +
70 collectionView.register(CNLliveShopDetailBannerCell.self, forCellWithReuseIdentifier: kCNLiveShopDetailBannerCellID) 35 collectionView.register(CNLliveShopDetailBannerCell.self, forCellWithReuseIdentifier: kCNLiveShopDetailBannerCellID)
71 collectionView.register(UICollectionViewCell.self, forCellWithReuseIdentifier: kCNLiveShopDetailDefaultCellID) 36 collectionView.register(UICollectionViewCell.self, forCellWithReuseIdentifier: kCNLiveShopDetailDefaultCellID)
72 collectionView.register(CNLiveShopDetailBtnsCell.self, forCellWithReuseIdentifier: kCNLiveShopDetailBtnsCellID) 37 collectionView.register(CNLiveShopDetailBtnsCell.self, forCellWithReuseIdentifier: kCNLiveShopDetailBtnsCellID)
73 collectionView.register(CNLiveShopDetailOrderAssetCell.self, forCellWithReuseIdentifier: kCNLiveShopDetailOrderAssetCellID) 38 collectionView.register(CNLiveShopDetailOrderAssetCell.self, forCellWithReuseIdentifier: kCNLiveShopDetailOrderAssetCellID)
74 39
  40 +
75 return collectionView 41 return collectionView
76 }() 42 }()
77 43
@@ -80,12 +46,8 @@ class CNLiveDownShopDetailController:CNLiveBaseViewController, UICollectionViewD @@ -80,12 +46,8 @@ class CNLiveDownShopDetailController:CNLiveBaseViewController, UICollectionViewD
80 self.getShopDetailApi() 46 self.getShopDetailApi()
81 self.view.addSubview(collectionView) 47 self.view.addSubview(collectionView)
82 collectionView.snp.makeConstraints { make in 48 collectionView.snp.makeConstraints { make in
83 - make.top.equalToSuperview().offset(KNavigationHeight)  
84 - make.left.bottom.right.equalToSuperview() 49 + make.top.left.bottom.right.equalToSuperview()
85 } 50 }
86 - self.view.addSubview(self.closeBtn)  
87 -// self.view.addSubview(navView)  
88 -  
89 } 51 }
90 52
91 // MARK: BtnAction 53 // MARK: BtnAction
@@ -102,15 +64,13 @@ class CNLiveDownShopDetailController:CNLiveBaseViewController, UICollectionViewD @@ -102,15 +64,13 @@ class CNLiveDownShopDetailController:CNLiveBaseViewController, UICollectionViewD
102 let index = metaVC.pageFlowView.currentPageIndex 64 let index = metaVC.pageFlowView.currentPageIndex
103 let customIndexView = metaVC.pageFlowView.viewWithTag(100+index) as! CNCustomIndexView 65 let customIndexView = metaVC.pageFlowView.viewWithTag(100+index) as! CNCustomIndexView
104 customIndexView.superScrollView?.isScrollEnabled = true 66 customIndexView.superScrollView?.isScrollEnabled = true
105 -// customIndexView.baseScrollView.setContentOffset(CGPoint(x: 0, y: customIndexView.baseScrollView.height), animated: true)  
106 -// currentViewController()?.tabBarController?.tabBar.isHidden = false  
107 } 67 }
108 - 68 +
109 // MARK: - UICollectionViewDelegate 69 // MARK: - UICollectionViewDelegate
110 func numberOfSections(in collectionView: UICollectionView) -> Int { 70 func numberOfSections(in collectionView: UICollectionView) -> Int {
111 if self.shopDetailModel.is_seller != nil{ 71 if self.shopDetailModel.is_seller != nil{
112 if self.shopDetailModel.is_seller == true{ 72 if self.shopDetailModel.is_seller == true{
113 - return 5 73 + return 6
114 }else{//非商家,不处理 74 }else{//非商家,不处理
115 return 3 75 return 3
116 } 76 }
@@ -121,7 +81,7 @@ class CNLiveDownShopDetailController:CNLiveBaseViewController, UICollectionViewD @@ -121,7 +81,7 @@ class CNLiveDownShopDetailController:CNLiveBaseViewController, UICollectionViewD
121 func collectionView(_ collectionView: UICollectionView, numberOfItemsInSection section: Int) -> Int { 81 func collectionView(_ collectionView: UICollectionView, numberOfItemsInSection section: Int) -> Int {
122 if self.shopDetailModel.is_seller != nil { 82 if self.shopDetailModel.is_seller != nil {
123 if (self.shopDetailModel.is_seller == true) { 83 if (self.shopDetailModel.is_seller == true) {
124 - if (section == 4) { 84 + if (section == 5) {
125 let count = self.shopDetailModel.dynamic.count 85 let count = self.shopDetailModel.dynamic.count
126 return count == 0 ? 1 : count 86 return count == 0 ? 1 : count
127 }else { 87 }else {
@@ -144,12 +104,15 @@ class CNLiveDownShopDetailController:CNLiveBaseViewController, UICollectionViewD @@ -144,12 +104,15 @@ class CNLiveDownShopDetailController:CNLiveBaseViewController, UICollectionViewD
144 // } 104 // }
145 func collectionView(_ collectionView: UICollectionView, cellForItemAt indexPath: IndexPath) -> UICollectionViewCell { 105 func collectionView(_ collectionView: UICollectionView, cellForItemAt indexPath: IndexPath) -> UICollectionViewCell {
146 switch indexPath.section { 106 switch indexPath.section {
147 - case 0://banner轮播图 107 + case 0://close关闭
  108 + let cell = collectionView.dequeueReusableCell(withReuseIdentifier: kCNLiveShopDetailCloseCellID, for: indexPath) as! CNLliveShopDetailCloseCell
  109 + return cell
  110 + case 1://banner轮播图
148 let cell = collectionView.dequeueReusableCell(withReuseIdentifier: kCNLiveShopDetailBannerCellID, for: indexPath) as! CNLliveShopDetailBannerCell 111 let cell = collectionView.dequeueReusableCell(withReuseIdentifier: kCNLiveShopDetailBannerCellID, for: indexPath) as! CNLliveShopDetailBannerCell
149 112
150 cell.shopDetailModel = self.shopDetailModel 113 cell.shopDetailModel = self.shopDetailModel
151 return cell 114 return cell
152 - case 1://btn 115 + case 2://btn
153 if (self.shopDetailModel.is_seller != nil && self.shopDetailModel.is_seller == true) { 116 if (self.shopDetailModel.is_seller != nil && self.shopDetailModel.is_seller == true) {
154 let cell = collectionView.dequeueReusableCell(withReuseIdentifier: kCNLiveShopDetailBtnsCellID, for: indexPath) as! CNLiveShopDetailBtnsCell 117 let cell = collectionView.dequeueReusableCell(withReuseIdentifier: kCNLiveShopDetailBtnsCellID, for: indexPath) as! CNLiveShopDetailBtnsCell
155 cell.shopDetailModel = self.shopDetailModel 118 cell.shopDetailModel = self.shopDetailModel
@@ -158,7 +121,7 @@ class CNLiveDownShopDetailController:CNLiveBaseViewController, UICollectionViewD @@ -158,7 +121,7 @@ class CNLiveDownShopDetailController:CNLiveBaseViewController, UICollectionViewD
158 let cell = collectionView.dequeueReusableCell(withReuseIdentifier: kCNLiveShopDetailDefaultCellID, for: indexPath) 121 let cell = collectionView.dequeueReusableCell(withReuseIdentifier: kCNLiveShopDetailDefaultCellID, for: indexPath)
159 return cell 122 return cell
160 } 123 }
161 - case 2://我的订单 124 + case 3://我的订单
162 if (self.shopDetailModel.is_seller != nil && self.shopDetailModel.is_seller == true) { 125 if (self.shopDetailModel.is_seller != nil && self.shopDetailModel.is_seller == true) {
163 let cell = collectionView.dequeueReusableCell(withReuseIdentifier: kCNLiveShopDetailOrderAssetCellID, for: indexPath) as! CNLiveShopDetailOrderAssetCell 126 let cell = collectionView.dequeueReusableCell(withReuseIdentifier: kCNLiveShopDetailOrderAssetCellID, for: indexPath) as! CNLiveShopDetailOrderAssetCell
164 cell.displayType = .CNLiveShopDetailDisplayTypeOrder 127 cell.displayType = .CNLiveShopDetailDisplayTypeOrder
@@ -168,7 +131,7 @@ class CNLiveDownShopDetailController:CNLiveBaseViewController, UICollectionViewD @@ -168,7 +131,7 @@ class CNLiveDownShopDetailController:CNLiveBaseViewController, UICollectionViewD
168 let cell = collectionView.dequeueReusableCell(withReuseIdentifier: kCNLiveShopDetailDefaultCellID, for: indexPath) 131 let cell = collectionView.dequeueReusableCell(withReuseIdentifier: kCNLiveShopDetailDefaultCellID, for: indexPath)
169 return cell 132 return cell
170 } 133 }
171 - case 3://我的资产 134 + case 4://我的资产
172 if (self.shopDetailModel.is_seller != nil && self.shopDetailModel.is_seller == true) { 135 if (self.shopDetailModel.is_seller != nil && self.shopDetailModel.is_seller == true) {
173 let cell = collectionView.dequeueReusableCell(withReuseIdentifier: kCNLiveShopDetailOrderAssetCellID, for: indexPath) as! CNLiveShopDetailOrderAssetCell 136 let cell = collectionView.dequeueReusableCell(withReuseIdentifier: kCNLiveShopDetailOrderAssetCellID, for: indexPath) as! CNLiveShopDetailOrderAssetCell
174 cell.displayType = .CNLiveShopDetailDisplayTypeAsset 137 cell.displayType = .CNLiveShopDetailDisplayTypeAsset
@@ -178,7 +141,6 @@ class CNLiveDownShopDetailController:CNLiveBaseViewController, UICollectionViewD @@ -178,7 +141,6 @@ class CNLiveDownShopDetailController:CNLiveBaseViewController, UICollectionViewD
178 let cell = collectionView.dequeueReusableCell(withReuseIdentifier: kCNLiveShopDetailDefaultCellID, for: indexPath) 141 let cell = collectionView.dequeueReusableCell(withReuseIdentifier: kCNLiveShopDetailDefaultCellID, for: indexPath)
179 return cell 142 return cell
180 } 143 }
181 -// case 4:  
182 default: 144 default:
183 let cell = collectionView.dequeueReusableCell(withReuseIdentifier: kCNLiveShopDetailDefaultCellID, for: indexPath) 145 let cell = collectionView.dequeueReusableCell(withReuseIdentifier: kCNLiveShopDetailDefaultCellID, for: indexPath)
184 return cell 146 return cell
@@ -186,19 +148,27 @@ class CNLiveDownShopDetailController:CNLiveBaseViewController, UICollectionViewD @@ -186,19 +148,27 @@ class CNLiveDownShopDetailController:CNLiveBaseViewController, UICollectionViewD
186 148
187 } 149 }
188 150
  151 + func collectionView(_ collectionView: UICollectionView, didSelectItemAt indexPath: IndexPath) {
  152 + if indexPath.section == 0{
  153 + self.closeBtnAction()
  154 + }
  155 + }
  156 +
189 // MARK: - UICollectionViewDelegateFlowLayout 157 // MARK: - UICollectionViewDelegateFlowLayout
190 func collectionView(_ collectionView: UICollectionView, layout collectionViewLayout: UICollectionViewLayout, sizeForItemAt indexPath: IndexPath) -> CGSize { 158 func collectionView(_ collectionView: UICollectionView, layout collectionViewLayout: UICollectionViewLayout, sizeForItemAt indexPath: IndexPath) -> CGSize {
191 if (self.shopDetailModel.is_seller != nil && self.shopDetailModel.is_seller == true) { 159 if (self.shopDetailModel.is_seller != nil && self.shopDetailModel.is_seller == true) {
192 switch (indexPath.section) { 160 switch (indexPath.section) {
193 - case 0://banner 161 + case 0://close
  162 + return CGSize(width: KSreenWidth, height: KNavigationHeight)
  163 + case 1://banner
194 return CGSize(width: KSreenWidth, height: CNLiveAdaptTool.adaptLength(length: 210)) 164 return CGSize(width: KSreenWidth, height: CNLiveAdaptTool.adaptLength(length: 210))
195 - case 1://btn 165 + case 2://btn
196 return CGSize(width: KSreenWidth, height: 10+45+5+17+15) 166 return CGSize(width: KSreenWidth, height: 10+45+5+17+15)
197 - case 2://我的订单 167 + case 3://我的订单
198 return CGSize(width: KSreenWidth, height: 10+25+15+CNLiveAdaptTool.adaptLength(length: tempOrderZiChanHeight)+15) 168 return CGSize(width: KSreenWidth, height: 10+25+15+CNLiveAdaptTool.adaptLength(length: tempOrderZiChanHeight)+15)
199 - case 3://我的资产 169 + case 4://我的资产
200 return CGSize(width: KSreenWidth, height: 10+25+15+CNLiveAdaptTool.adaptLength(length: tempOrderZiChanHeight)+15) 170 return CGSize(width: KSreenWidth, height: 10+25+15+CNLiveAdaptTool.adaptLength(length: tempOrderZiChanHeight)+15)
201 - case 4:// 171 + case 5://
202 return CGSize(width: KSreenWidth, height: 50) 172 return CGSize(width: KSreenWidth, height: 50)
203 default: 173 default:
204 return CGSizeZero 174 return CGSizeZero
metaCode/Classes/Main/HomePage/Controller/WebController/CNWebView.swift
@@ -13,13 +13,16 @@ import CommonCrypto @@ -13,13 +13,16 @@ import CommonCrypto
13 import CNLiveBusinessTools 13 import CNLiveBusinessTools
14 import SKPhotoBrowser 14 import SKPhotoBrowser
15 15
  16 +//返回 Web控制器回调
  17 +typealias cnWebControllerBackNavBlock = ()->Void
  18 +
16 //更新Web控制器导航回调 19 //更新Web控制器导航回调
17 typealias cnWebControllerUpdateNavBlock = (_ isFinish:Bool , _ titleName:String ,_ isDecidePolicy:Bool , _ urlStr:String)->Void 20 typealias cnWebControllerUpdateNavBlock = (_ isFinish:Bool , _ titleName:String ,_ isDecidePolicy:Bool , _ urlStr:String)->Void
18 21
19 //更新Web控制器 currentUrl 22 //更新Web控制器 currentUrl
20 typealias cnWebControllerUpdateCurrentUrlBlock = (_ currentUrl:String)->Void 23 typealias cnWebControllerUpdateCurrentUrlBlock = (_ currentUrl:String)->Void
21 24
22 -class CNWebView:UIView,WKNavigationDelegate{ 25 +class CNWebView:UIView,WKNavigationDelegate, WKScriptMessageHandler{
23 26
24 var configuration:WKWebViewConfiguration? 27 var configuration:WKWebViewConfiguration?
25 28
@@ -28,15 +31,35 @@ class CNWebView:UIView,WKNavigationDelegate{ @@ -28,15 +31,35 @@ class CNWebView:UIView,WKNavigationDelegate{
28 return cnWebView 31 return cnWebView
29 }() 32 }()
30 33
31 - var webUrl:URL?//初始URL 34 + var _webUrl:URL?//初始URL
  35 + var webUrl:URL?{
  36 + get{
  37 + _webUrl
  38 + }set{
  39 + _webUrl = newValue!
  40 + }
  41 + }
  42 +
32 var currentUrl:String = ""//当前网页的url 43 var currentUrl:String = ""//当前网页的url
33 var bridge:WKWebViewJavascriptBridge? 44 var bridge:WKWebViewJavascriptBridge?
  45 + var customUserAgent:String = ""
34 46
35 //CNWebController 47 //CNWebController
36 var isCNWebController:Bool = false//是否网页控制器 48 var isCNWebController:Bool = false//是否网页控制器
37 - var webControllerUpdateNavBlock:cnWebControllerUpdateNavBlock? 49 + var webControllerBackNavBlock:cnWebControllerBackNavBlock?//back返回
  50 +
  51 + var webControllerUpdateNavBlock:cnWebControllerUpdateNavBlock?//刷新
38 var webControllerUpdateCurrentUrlBlock:cnWebControllerUpdateCurrentUrlBlock? 52 var webControllerUpdateCurrentUrlBlock:cnWebControllerUpdateCurrentUrlBlock?
39 53
  54 + required init?(coder: NSCoder) {
  55 + fatalError("init(coder:) has not been implemented")
  56 + }
  57 +
  58 + func loadUrl(url:String){
  59 + let urlStr = self.checkURLWithStr(urlStr: url)
  60 + self.currentUrl = urlStr
  61 + self.cnWebView.load(URLRequest.init(url:URL(string: urlStr)!))
  62 + }
40 63
41 init(frame: CGRect, configuration: WKWebViewConfiguration ,url:URL?) { 64 init(frame: CGRect, configuration: WKWebViewConfiguration ,url:URL?) {
42 super.init(frame: frame) 65 super.init(frame: frame)
@@ -49,26 +72,154 @@ class CNWebView:UIView,WKNavigationDelegate{ @@ -49,26 +72,154 @@ class CNWebView:UIView,WKNavigationDelegate{
49 if !userAgent.contains(CNLiveMCEnvironmentManager.shared.base_web_UA) { 72 if !userAgent.contains(CNLiveMCEnvironmentManager.shared.base_web_UA) {
50 let newUserAgent = userAgent + CNLiveMCEnvironmentManager.shared.base_web_UA 73 let newUserAgent = userAgent + CNLiveMCEnvironmentManager.shared.base_web_UA
51 self.cnWebView.customUserAgent = newUserAgent 74 self.cnWebView.customUserAgent = newUserAgent
  75 + self.customUserAgent = newUserAgent
52 76
53 if (self.webUrl != nil){ 77 if (self.webUrl != nil){
54 let urlStr = self.checkURLWithStr(urlStr: self.webUrl!.absoluteString) 78 let urlStr = self.checkURLWithStr(urlStr: self.webUrl!.absoluteString)
55 self.currentUrl = urlStr 79 self.currentUrl = urlStr
56 80
57 self.cnWebView.load(URLRequest.init(url:URL(string: urlStr)!)) 81 self.cnWebView.load(URLRequest.init(url:URL(string: urlStr)!))
  82 + self.configBridge()
  83 + self.configBridgeRegister()
  84 + self.webViewAddScriptMessageHandler()
58 } 85 }
59 - self.configBridge()  
60 - self.configBridgeRegister()  
61 } 86 }
62 } 87 }
63 } 88 }
64 } 89 }
65 90
  91 + // MARK: - 电商h5的交互回调调用
  92 + //电商 js 交互原生
  93 + func webViewAddScriptMessageHandler(){
  94 + self.cnWebView.configuration.userContentController.add(self, name: "pop")
  95 + self.cnWebView.configuration.userContentController.add(self, name: "toShare")
  96 + self.cnWebView.configuration.userContentController.add(self, name: "openAppPayment")
  97 + }
  98 +
  99 + func webViewRemoveScriptMessageHandler(){
  100 + self.cnWebView.configuration.userContentController.removeScriptMessageHandler(forName: "pop")
  101 + self.cnWebView.configuration.userContentController.removeScriptMessageHandler(forName: "toShare")
  102 + self.cnWebView.configuration.userContentController.removeScriptMessageHandler(forName: "openAppPayment")
  103 + }
  104 + //电商h5的回调
  105 + func userContentController(_ userContentController: WKUserContentController, didReceive message: WKScriptMessage) {
  106 + // 初始化 body 为 nil
  107 + var body: Any? = nil
  108 + // 检查 message.body 是否不是 NSNull 并且是 NSDictionary 的实例
  109 + if let dictionary = message.body as? [String: Any], !dictionary.isEmpty {
  110 + // 获取所有的键
  111 + let allKeys = dictionary.keys
  112 + // 检查是否包含 "body" 键
  113 + if allKeys.contains("body") {
  114 + // 取出 "body" 键对应的值
  115 + body = dictionary["body"]
  116 + }
  117 + }
  118 + if message.name == "openAppPayment" {
  119 + // 跳转支付页面
  120 + if let json = body as? [String: Any] {
  121 + // 检查 json 是否非空
  122 + guard !json.isEmpty else {
  123 + print("json 字典是空的")
  124 + return
  125 + }
  126 + // 使用可选链获取 orderNumber,如果不存在则返回空字符串
  127 + let orderNumber = json["orderNumber"] as? String ?? ""
  128 + let vc = CNLiveShopPayController(orderNumber: orderNumber)
  129 + vc.finishPayCallBack = { [weak self] orderInfoModel ,payType ,payResult in
  130 + let params = NSMutableDictionary()
  131 + let jsonStr = orderInfoModel.toJSONString() ?? ""
  132 + params.setValue(jsonStr, forKey: "orderInfo")
  133 + params.setValue(payType.hashValue, forKey: "payType")
  134 + params.setValue(payResult.hashValue, forKey: "payResult")
  135 +
  136 + let sparams = self!.stringByJson(params as? [String : Any])
  137 + let appPaymentCallbackJS = String(format: "appPaymentCallback('%@')", sparams ?? "")
  138 + self?.cnWebView.evaluateJavaScript(appPaymentCallbackJS, completionHandler: { result, error in
  139 +// print("error \(error)")
  140 + })
  141 + }
  142 + // 跳转支付页面
  143 + navigationViewController().pushViewController(vc, animated: pushAnimated)
  144 + }
  145 + }else if message.name == "pop" {
  146 + //返回上一级控制器
  147 + if self.cnWebView.canGoBack{
  148 + self.cnWebView.goBack()
  149 + }else{
  150 + self.webControllerBackNavBlock?()
  151 + }
  152 + }else if message.name == "toShare" {
  153 + //拉起分享
  154 + if let json = body as? [String: Any] {
  155 + // 检查 json 是否非空
  156 + guard !json.isEmpty else {
  157 + print("json 字典是空的")
  158 + return
  159 + }
  160 + // 使用可选链和条件绑定获取 type,如果不存在或不是数字,则使用默认值 0
  161 + let type: UInt = (json["type"] as? NSNumber)?.uintValue ?? 0
  162 + // 使用可选链获取 id 和 ext,如果不存在则返回空字符串
  163 + let targetId = json["id"] as? String ?? ""
  164 + let ext = json["ext"] as? String ?? ""
  165 + //请求分享参数
  166 + showLoading(message: "")
  167 + CNLiveShoph5ViewModel.postGetShareDataWithType(type: NSInteger(type), targetId: targetId, ext: ext) { result, status in
  168 + let shareModel = result as! CNLiveShopCommentRequestShareModel
  169 +
  170 + let shareTitle = shareModel.share_title
  171 + let shareUrl = shareModel.url
  172 + let shareDesc = shareModel.share_desc
  173 + let shareImage = shareModel.share_img
  174 + CNLiveShareManager.showShareViewWithParam(forShareTitle: shareTitle, shareUrl: shareUrl, shareDesc: shareDesc, shareImage: shareImage, screenFull: false, hiddenWjj: true, hiddenQQ: false, hiddenWB: true, hiddenLifeCircle: true, hiddenWechatCircle: false, hiddenWechat: false, hiddenSafari: true, formVC: currentViewController(), topImage: [], topTitles: [], platformType: .all) { title in
  175 +
  176 + } completerBlock: { resultType, platformType, typeString in
  177 + if resultType == .succ{
  178 +
  179 + }
  180 + }
  181 +
  182 + }
  183 +
  184 + }
  185 + }
  186 + }
  187 + // MARK: - 字典转字符串
  188 + func stringByJson(_ json: [String: Any]?) -> String? {
  189 + guard let json = json else {
  190 + return nil
  191 + }
  192 +
  193 + do {
  194 + let data = try JSONSerialization.data(withJSONObject: json, options: .prettyPrinted)
  195 + if let string = String(data: data, encoding: .utf8) {
  196 + // 去掉字符串中的空格
  197 + let stringWithoutSpaces = string.replacingOccurrences(of: " ", with: "", options: .literal, range: nil)
  198 +
  199 + // 去掉字符串中的换行符
  200 + let stringWithoutNewlines = stringWithoutSpaces.replacingOccurrences(of: "\n", with: "", options: .literal, range: nil)
  201 +
  202 + // 去掉字符串中的转义字符 "\"
  203 + // 注意:在标准的JSON字符串中,转义字符 "\" 是必要的,因此通常不会移除它们。
  204 + // 如果你确实需要移除它们,请确保这样做不会导致JSON字符串格式错误。
  205 + let stringWithoutEscapes = stringWithoutNewlines.replacingOccurrences(of: "\\", with: "", options: .literal, range: nil)
  206 +
  207 + return stringWithoutEscapes
  208 + }
  209 + } catch {
  210 + // 处理JSONSerialization的错误
  211 + return nil
  212 + }
  213 +
  214 + return nil
  215 + }
  216 + // MARK: - wjjh5的交互回调调用
66 func configBridge(){ 217 func configBridge(){
67 WKWebViewJavascriptBridge.enableLogging() 218 WKWebViewJavascriptBridge.enableLogging()
68 self.bridge = WKWebViewJavascriptBridge(for: self.cnWebView) 219 self.bridge = WKWebViewJavascriptBridge(for: self.cnWebView)
69 self.bridge?.setWebViewDelegate(self) 220 self.bridge?.setWebViewDelegate(self)
70 } 221 }
71 - //h5拉起原生 222 + //wjjh5拉起原生
72 func configBridgeRegister() -> Void { 223 func configBridgeRegister() -> Void {
73 //h5拉起原生分享 js call oc 224 //h5拉起原生分享 js call oc
74 self.bridge?.registerHandler("wjjylzgVideoShare", handler: { data, responseCallback in 225 self.bridge?.registerHandler("wjjylzgVideoShare", handler: { data, responseCallback in
@@ -90,7 +241,7 @@ class CNWebView:UIView,WKNavigationDelegate{ @@ -90,7 +241,7 @@ class CNWebView:UIView,WKNavigationDelegate{
90 let dic = data as! Dictionary<String, Any> 241 let dic = data as! Dictionary<String, Any>
91 let index = (dic["index"] as! NSString).integerValue 242 let index = (dic["index"] as! NSString).integerValue
92 let imageArray = dic["imgArr"] as! NSArray 243 let imageArray = dic["imgArr"] as! NSArray
93 - var imgArray = NSMutableArray() 244 + let imgArray = NSMutableArray()
94 for dict in imageArray { 245 for dict in imageArray {
95 var imgUrl = "" 246 var imgUrl = ""
96 if let dictemp = dict as? String{ 247 if let dictemp = dict as? String{
@@ -124,15 +275,83 @@ class CNWebView:UIView,WKNavigationDelegate{ @@ -124,15 +275,83 @@ class CNWebView:UIView,WKNavigationDelegate{
124 CNLiveShareImageManager.pushWeChatMiniProgrem(withMiniAppId: miniAppId, path: miniPath, extMsg: "", extDic: [:]) 275 CNLiveShareImageManager.pushWeChatMiniProgrem(withMiniAppId: miniAppId, path: miniPath, extMsg: "", extDic: [:])
125 } 276 }
126 }) 277 })
  278 +
  279 + //h5拉起原生跳转苹果内购
  280 + self.bridge?.registerHandler("wjjHtmlPullApplePay", handler: { data, responseCallback in
  281 +// print("js call oc\(data)")
  282 +// let dataDic = data as! Dictionary<String, Any>
  283 +// let body = dataDic["body"] as? String
  284 +// let notify_url = dataDic["notify_url"] as? String
  285 +// let orderId = dataDic["orderId"] as? String
  286 +// let prdId = dataDic["prdId"] as? String
  287 +// let total_fee = dataDic["total_fee"] as? Int
  288 +// print("拉起苹果内购")
  289 +
  290 + })
  291 +
  292 + //h5拉起原生支付(iOS不加,虚拟付费视频都内购)
  293 +// self.bridge?.registerHandler("wjjHtmlPullAppPay", handler: { data, responseCallback in
  294 +// print("js call oc\(data)")
  295 +// let dic = data as! Dictionary<String, Any>
  296 +//
  297 +//// [CNLivePayCostModule showDefaultPayViwWithParamDict:htmlDict PayCostType:CNLivePayCostTypeHtml FromVC:formVC ResultBlock:^(CNLivePayCostTypeResult resultType) {
  298 +//// if (resultType == CNLivePayCostTypeResultSucc) {
  299 +//// NSString * orderId = [resultParam stringValueForKey:@"orderId" default:@""];
  300 +//// [weakSelf.bridge callHandler:@"wjjHtmlPullAppPayCallback" data:@{@"orderId":orderId,@"payStatus":payResult == CNLiveContentPayResultSucc?@"0":@"1"} responseCallback:^(id responseData) {
  301 +//// NSLog(@"成功");
  302 +//// }];
  303 +// // }
  304 +//// }];
  305 +//
  306 +// })
  307 +
127 } 308 }
128 309
129 - required init?(coder: NSCoder) {  
130 - fatalError("init(coder:) has not been implemented")  
131 - }  
132 - 310 + // MARK: - 检查url
133 func checkURLWithStr(urlStr:String) -> String{ 311 func checkURLWithStr(urlStr:String) -> String{
134 if URL(string: urlStr)?.host != WjjH5 { 312 if URL(string: urlStr)?.host != WjjH5 {
135 - return urlStr//不是wjjh5不作处理 313 + if URL(string: urlStr)?.host == ManageshopH5 || URL(string: urlStr)?.host == ManagemallshopH5{
  314 + //是电商url,拼接uid
  315 + var str = urlStr
  316 + let sourceArray = str.components(separatedBy: "?")
  317 + if sourceArray.count == 1{
  318 + //是电商h5且无参数
  319 + str = String(format: "%@?uid=%@", str,UserInfoManager.shared.userInfo.uid)
  320 + return str
  321 + }
  322 + //是电商h5且有参数
  323 + let paraArr = NSMutableArray(array: ["uid="])
  324 + let valueArr = NSMutableArray(array:[UserInfoManager.shared.userInfo.uid])
  325 + var i = 0
  326 + for paraStr in paraArr{
  327 + let tempStr = paraStr as! String
  328 + let paramStr = "&".appending(tempStr)
  329 + let paramStr2 = "?".appending(tempStr)
  330 +
  331 + if str.contains(paramStr){
  332 + //包含则替换 &sid=
  333 + let lastStr = str.components(separatedBy: tempStr).last
  334 + let lastSeparatedStr = (lastStr?.components(separatedBy: "&").first)!
  335 + let oldStr = tempStr.appending(lastSeparatedStr)
  336 + let tempValueStr = tempStr.appending(valueArr[i] as! String)
  337 + str = str.replacingOccurrences(of: oldStr, with: tempValueStr)
  338 + }else if str.contains(paramStr2){
  339 + //包含则替换 &sid=
  340 + let lastStr = str.components(separatedBy: tempStr).last
  341 + let lastSeparatedStr = (lastStr?.components(separatedBy: "&").first)!
  342 + let oldStr = tempStr.appending(lastSeparatedStr)
  343 + let tempValueStr = tempStr.appending(valueArr[i] as! String)
  344 + str = str.replacingOccurrences(of: oldStr, with: tempValueStr)
  345 + }else{
  346 + //不包含则拼接
  347 + str = String(format: "%@&%@%@", str,tempStr,valueArr[i] as! String)
  348 + }
  349 + i = i + 1
  350 + }
  351 + return str
  352 + }else{
  353 + return urlStr//不是wjjh5且不是电商h5不作处理
  354 + }
136 } 355 }
137 var str = urlStr 356 var str = urlStr
138 let date = Date() 357 let date = Date()
metaCode/Classes/Main/HomePage/Controller/WebController/CNWebViewController.swift
@@ -16,6 +16,7 @@ import SKPhotoBrowser @@ -16,6 +16,7 @@ import SKPhotoBrowser
16 16
17 let WjjH5 = "wjjh5.cnlive.com" 17 let WjjH5 = "wjjh5.cnlive.com"
18 let ManageshopH5 = "manageshop.cnlive.com" 18 let ManageshopH5 = "manageshop.cnlive.com"
  19 +let ManagemallshopH5 = "managemall.cnlive.com"
19 20
20 class CNWebViewController:CNLiveBaseViewController ,WKNavigationDelegate{ 21 class CNWebViewController:CNLiveBaseViewController ,WKNavigationDelegate{
21 22
@@ -46,7 +47,6 @@ class CNWebViewController:CNLiveBaseViewController ,WKNavigationDelegate{ @@ -46,7 +47,6 @@ class CNWebViewController:CNLiveBaseViewController ,WKNavigationDelegate{
46 moreNavBtn.addTarget(self, action: #selector(moreNavBtnAction), for: .touchUpInside) 47 moreNavBtn.addTarget(self, action: #selector(moreNavBtnAction), for: .touchUpInside)
47 return moreNavBtn 48 return moreNavBtn
48 }() 49 }()
49 -  
50 50
51 var _url:URL? 51 var _url:URL?
52 var url:URL? { 52 var url:URL? {
@@ -62,6 +62,7 @@ class CNWebViewController:CNLiveBaseViewController ,WKNavigationDelegate{ @@ -62,6 +62,7 @@ class CNWebViewController:CNLiveBaseViewController ,WKNavigationDelegate{
62 self.webView.cnWebView.stopLoading() 62 self.webView.cnWebView.stopLoading()
63 self.webView.cnWebView.navigationDelegate = nil 63 self.webView.cnWebView.navigationDelegate = nil
64 self.webView.cnWebView.uiDelegate = nil 64 self.webView.cnWebView.uiDelegate = nil
  65 + self.webView.webViewRemoveScriptMessageHandler()
65 print("WKWebView dealloc") 66 print("WKWebView dealloc")
66 } 67 }
67 68
@@ -70,7 +71,6 @@ class CNWebViewController:CNLiveBaseViewController ,WKNavigationDelegate{ @@ -70,7 +71,6 @@ class CNWebViewController:CNLiveBaseViewController ,WKNavigationDelegate{
70 self.h5StopVideoPlayer() 71 self.h5StopVideoPlayer()
71 } 72 }
72 73
73 -  
74 override func viewDidLoad() { 74 override func viewDidLoad() {
75 super.viewDidLoad() 75 super.viewDidLoad()
76 navigationBarHidden = false 76 navigationBarHidden = false
@@ -87,6 +87,9 @@ class CNWebViewController:CNLiveBaseViewController ,WKNavigationDelegate{ @@ -87,6 +87,9 @@ class CNWebViewController:CNLiveBaseViewController ,WKNavigationDelegate{
87 } 87 }
88 } 88 }
89 } 89 }
  90 + self.webView.webControllerBackNavBlock = { [weak self] in
  91 + self?.navigationController?.popViewController(animated: true)
  92 + }
90 self.webView.webControllerUpdateCurrentUrlBlock = { [weak self] currentUrlStr in 93 self.webView.webControllerUpdateCurrentUrlBlock = { [weak self] currentUrlStr in
91 self!.currentUrl = currentUrlStr 94 self!.currentUrl = currentUrlStr
92 } 95 }
@@ -98,9 +101,9 @@ class CNWebViewController:CNLiveBaseViewController ,WKNavigationDelegate{ @@ -98,9 +101,9 @@ class CNWebViewController:CNLiveBaseViewController ,WKNavigationDelegate{
98 101
99 func h5StopVideoPlayer(){ 102 func h5StopVideoPlayer(){
100 // call h5停止播放视频 103 // call h5停止播放视频
101 - let data = ["stop": true] 104 + let data: [String: Any] = ["stop": true]
102 self.bridge?.callHandler("wjjStopVideoPlayer", data: data, responseCallback: { responseData in 105 self.bridge?.callHandler("wjjStopVideoPlayer", data: data, responseCallback: { responseData in
103 - print("\(responseData ?? "")") 106 + print("wjjStopVideoPlayer:\(responseData ?? "")")
104 }) 107 })
105 } 108 }
106 109
metaCode/Classes/Main/HomePage/View/Shop/GoodsManager/CNLiveShopClassifySectionHeaderView.swift
@@ -26,6 +26,8 @@ class CNLiveShopClassifySectionHeaderView:UITableViewHeaderFooterView{ @@ -26,6 +26,8 @@ class CNLiveShopClassifySectionHeaderView:UITableViewHeaderFooterView{
26 _classifyModel = newValue 26 _classifyModel = newValue
27 self.classifyNameBtn.isSelected = _classifyModel!.showChild 27 self.classifyNameBtn.isSelected = _classifyModel!.showChild
28 self.classifyNameBtn.setTitle(_classifyModel!.title, for: .normal) 28 self.classifyNameBtn.setTitle(_classifyModel!.title, for: .normal)
  29 + self.classifyNameBtn.setupButtonImageAndTitlePossitionWith(padding: 5, style: .right)
  30 +
29 self.sortLab.text = _classifyModel!.ord 31 self.sortLab.text = _classifyModel!.ord
30 if Int(_classifyModel!.state ?? "") == 2{ 32 if Int(_classifyModel!.state ?? "") == 2{
31 self.showSwitch.isOn = true 33 self.showSwitch.isOn = true
metaCode/Classes/Main/HomePage/View/Shop/ShopDetail/CNLliveShopDetailCloseCell.swift 0 → 100644
  1 +//
  2 +// CNLliveShopDetailCloseCell.swift
  3 +// metaCode
  4 +//
  5 +// Created by zx on 2024/4/12.
  6 +// 电商上滑页-close cell
  7 +
  8 +import Foundation
  9 +
  10 +class CNLliveShopDetailCloseCell: UICollectionViewCell {
  11 + lazy var closeBtn: UIImageView = {
  12 + let closeBtn = UIImageView(frame: CGRect(x: KSreenWidth-35, y: KStatusBarHeight+(KNavigationHeight-KStatusBarHeight-20)*0.5, width: 20, height: 20))
  13 + closeBtn.image = UIImage(named: "mine_header_icon_close")
  14 + return closeBtn
  15 + }()
  16 +
  17 + override init(frame: CGRect) {
  18 + super.init(frame: frame)
  19 + self.setUI()
  20 + }
  21 +
  22 + required init?(coder: NSCoder) {
  23 + fatalError("init(coder:) has not been implemented")
  24 + }
  25 +
  26 + func setUI(){
  27 + self.backgroundColor = .white
  28 + self.contentView.addSubview(self.closeBtn)
  29 + }
  30 +
  31 +}
metaCode/Classes/Main/HomePage/View/Shop/Shoph5Pay/CNLiveShopPayNeedPaymentCell.swift 0 → 100644
  1 +//
  2 +// CNLiveShopPayNeedPaymentCell.swift
  3 +// metaCode
  4 +//
  5 +// Created by zx on 2024/4/10.
  6 +// 电商h5支付 需要付款cell
  7 +
  8 +import Foundation
  9 +
  10 +class CNLiveShopPayNeedPaymentCell:UITableViewCell{
  11 +
  12 + lazy var titleLabel: UILabel = {
  13 + let titleLabel = UILabel.init(frame: CGRectMake(10, 0, KSreenWidth-20, 60))
  14 + titleLabel.textColor = UIColor(red:0.25, green:0.23, blue:0.28, alpha:1.00)
  15 + titleLabel.textAlignment = .left
  16 + titleLabel.font = Font_16
  17 + titleLabel.adjustsFontSizeToFitWidth=true
  18 + return titleLabel
  19 + }()
  20 +
  21 + override init(style: UITableViewCell.CellStyle, reuseIdentifier: String?) {
  22 + super.init(style: style, reuseIdentifier: reuseIdentifier)
  23 + self.selectionStyle = .none
  24 + self.initUI()
  25 + }
  26 +
  27 + required init?(coder: NSCoder) {
  28 + fatalError("init(coder:) has not been implemented")
  29 + }
  30 +
  31 + // MARK: - initUI
  32 + func initUI(){
  33 + self.contentView.addSubview(self.titleLabel)
  34 + }
  35 +}
  36 +
metaCode/Classes/Main/HomePage/View/Shop/Shoph5Pay/CNLiveShopPayWeChatAlipayCell.swift 0 → 100644
  1 +//
  2 +// CNLiveShopPayWeChatAlipayCell.swift
  3 +// metaCode
  4 +//
  5 +// Created by zx on 2024/4/10.
  6 +// 电商h5支付 微信支付宝cell
  7 +
  8 +import Foundation
  9 +import SnapKit
  10 +
  11 +class CNLiveShopPayWeChatAlipayCell:UITableViewCell{
  12 +
  13 + lazy var selectImgView :UIImageView = {
  14 + let selectImgView = UIImageView(image: UIImage(named: "tsq_xz"))
  15 + return selectImgView
  16 + }()
  17 +
  18 + lazy var iconImgView :UIImageView = {
  19 + let iconImgView = UIImageView()
  20 + return iconImgView
  21 + }()
  22 +
  23 + lazy var titleLabel: UILabel = {
  24 + let titleLabel = UILabel.init(frame: CGRectZero)
  25 + titleLabel.textColor = UIColor(red:0.04, green:0.02, blue:0.07, alpha:1.00)
  26 + titleLabel.textAlignment = .left
  27 + titleLabel.font = BoldFont_16
  28 + titleLabel.adjustsFontSizeToFitWidth=true
  29 + return titleLabel
  30 + }()
  31 +
  32 + override init(style: UITableViewCell.CellStyle, reuseIdentifier: String?) {
  33 + super.init(style: style, reuseIdentifier: reuseIdentifier)
  34 + self.selectionStyle = .none
  35 + self.initUI()
  36 + self.layout()
  37 + }
  38 +
  39 + required init?(coder: NSCoder) {
  40 + fatalError("init(coder:) has not been implemented")
  41 + }
  42 +
  43 + // MARK: - initUI
  44 + func initUI(){
  45 + self.contentView.addSubview(self.titleLabel)
  46 + self.contentView.addSubview(self.iconImgView)
  47 + self.contentView.addSubview(self.selectImgView)
  48 + self.selectImgView.isHidden = true
  49 + }
  50 + func layout(){
  51 + self.iconImgView.snp.makeConstraints { make in
  52 + make.left.equalToSuperview().offset(10)
  53 + make.centerY.equalToSuperview()
  54 + }
  55 + self.titleLabel.snp.makeConstraints { make in
  56 + make.left.equalTo(self.iconImgView.snp.right).offset(20)
  57 + make.centerY.equalToSuperview()
  58 + }
  59 + self.selectImgView.snp.makeConstraints { make in
  60 + make.right.equalToSuperview().offset(-30)
  61 + make.centerY.equalToSuperview()
  62 + }
  63 + }
  64 +}
metaCode/Classes/Main/HomePage/View/VerticalViews/DownSlide/CNDownSlideSingleCourseCell.swift
@@ -120,7 +120,7 @@ class CNDownSlideSingleCourseCell: UITableViewCell { @@ -120,7 +120,7 @@ class CNDownSlideSingleCourseCell: UITableViewCell {
120 bgBackView.backgroundColor = .white 120 bgBackView.backgroundColor = .white
121 121
122 var titleTop:CGFloat = DownSlideRecommendLeftGap 122 var titleTop:CGFloat = DownSlideRecommendLeftGap
123 - if model.blockSubTitle.count ?? 0 > 0{ 123 + if model.blockSubTitle.count > 0{
124 let subtitleLbl = UILabel(frame: CGRect(x: DownSlideRecommendLeftGap, y: DownSlideRecommendLeftGap, width: DownSlideSingleCourseW-DownSlideRecommendLeftGap*2, height: 17)) 124 let subtitleLbl = UILabel(frame: CGRect(x: DownSlideRecommendLeftGap, y: DownSlideRecommendLeftGap, width: DownSlideSingleCourseW-DownSlideRecommendLeftGap*2, height: 17))
125 subtitleLbl.text = model.blockSubTitle 125 subtitleLbl.text = model.blockSubTitle
126 subtitleLbl.font = Font_12 126 subtitleLbl.font = Font_12
@@ -148,20 +148,20 @@ class CNDownSlideSingleCourseCell: UITableViewCell { @@ -148,20 +148,20 @@ class CNDownSlideSingleCourseCell: UITableViewCell {
148 148
149 //小icon 149 //小icon
150 let imageView = UIImageView(frame: CGRectMake(DownSlideRecommendLeftGap, titleLbl.bottom+DownSlideRecommendLeftGap+CGFloat(i)*(DownSlideAllCourseRowTopYGap+DownSlideAllCourseRowImageWH+DownSlideAllCourseRowBottomYGap), CGFloat(DownSlideAllCourseRowImageWH), CGFloat(DownSlideAllCourseRowImageWH))) 150 let imageView = UIImageView(frame: CGRectMake(DownSlideRecommendLeftGap, titleLbl.bottom+DownSlideRecommendLeftGap+CGFloat(i)*(DownSlideAllCourseRowTopYGap+DownSlideAllCourseRowImageWH+DownSlideAllCourseRowBottomYGap), CGFloat(DownSlideAllCourseRowImageWH), CGFloat(DownSlideAllCourseRowImageWH)))
151 - imageView.kf.setImage(with: URL(string:contentMdl.poster ?? "")) 151 + imageView.kf.setImage(with: URL(string:contentMdl.poster ))
152 imageView.layer.cornerRadius = 12 152 imageView.layer.cornerRadius = 12
153 imageView.clipsToBounds = true 153 imageView.clipsToBounds = true
154 imageView.contentMode = .scaleAspectFill 154 imageView.contentMode = .scaleAspectFill
155 bgBackView.addSubview(imageView) 155 bgBackView.addSubview(imageView)
156 156
157 let titleLbl = UILabel(frame: CGRect(x: imageView.right+DownSlideRecommendLeftGap, y: imageView.top, width: DownSlideSingleCourseW-90-imageView.right, height: 21)) 157 let titleLbl = UILabel(frame: CGRect(x: imageView.right+DownSlideRecommendLeftGap, y: imageView.top, width: DownSlideSingleCourseW-90-imageView.right, height: 21))
158 - titleLbl.text = contentMdl.title ?? "" 158 + titleLbl.text = contentMdl.title
159 titleLbl.font = Font_15 159 titleLbl.font = Font_15
160 titleLbl.textColor = HexColor("#333333") 160 titleLbl.textColor = HexColor("#333333")
161 bgBackView.addSubview(titleLbl) 161 bgBackView.addSubview(titleLbl)
162 162
163 let subTitleLbl = UILabel(frame: CGRect(x: titleLbl.left, y:titleLbl.bottom+3 , width: titleLbl.width, height: 17)) 163 let subTitleLbl = UILabel(frame: CGRect(x: titleLbl.left, y:titleLbl.bottom+3 , width: titleLbl.width, height: 17))
164 - subTitleLbl.text = contentMdl.subTitle ?? "" 164 + subTitleLbl.text = contentMdl.subTitle
165 subTitleLbl.font = Font_12 165 subTitleLbl.font = Font_12
166 subTitleLbl.textColor = HexColor("#999999") 166 subTitleLbl.textColor = HexColor("#999999")
167 bgBackView.addSubview(subTitleLbl) 167 bgBackView.addSubview(subTitleLbl)
@@ -170,7 +170,12 @@ class CNDownSlideSingleCourseCell: UITableViewCell { @@ -170,7 +170,12 @@ class CNDownSlideSingleCourseCell: UITableViewCell {
170 enterBtn.frame = CGRect(x: bgBackView.right-25-65, y: 0, width: 65, height: 30) 170 enterBtn.frame = CGRect(x: bgBackView.right-25-65, y: 0, width: 65, height: 30)
171 enterBtn.centerY = imageView.centerY 171 enterBtn.centerY = imageView.centerY
172 enterBtn.setBackgroundImage(UIImage(named: "homepage_down_enter"), for: .normal) 172 enterBtn.setBackgroundImage(UIImage(named: "homepage_down_enter"), for: .normal)
173 - enterBtn.setTitle("进入", for: .normal) 173 + if contentMdl.model == kCNDownSlideContentsModelModelAlbum_ugc{
  174 + enterBtn.setTitle("播放", for: .normal)
  175 + }else{
  176 + enterBtn.setTitle("进入", for: .normal)
  177 + }
  178 +
174 enterBtn.titleLabel?.font = BoldFont_13 179 enterBtn.titleLabel?.font = BoldFont_13
175 enterBtn.setTitleColor(HexColor("#FFFFFF"), for: .normal) 180 enterBtn.setTitleColor(HexColor("#FFFFFF"), for: .normal)
176 enterBtn.addTarget(self, action: #selector(enterBtnAction(_:)), for: .touchUpInside) 181 enterBtn.addTarget(self, action: #selector(enterBtnAction(_:)), for: .touchUpInside)
@@ -255,6 +260,9 @@ class CNDownSlideSingleCourseCell: UITableViewCell { @@ -255,6 +260,9 @@ class CNDownSlideSingleCourseCell: UITableViewCell {
255 contentView.addSubview(bgBackView) 260 contentView.addSubview(bgBackView)
256 261
257 let contentsNum = model.list.count 262 let contentsNum = model.list.count
  263 + if contentsNum == 0{
  264 + return
  265 + }
258 //总显示块数/循环数 266 //总显示块数/循环数
259 var totalNum = (contentsNum >= 4) ? 4 : contentsNum 267 var totalNum = (contentsNum >= 4) ? 4 : contentsNum
260 var cellH = DownSlideAllCourseTitleH + DownSlideAllCourseRowH * CGFloat(totalNum)+DownSlideRecommendLeftGap 268 var cellH = DownSlideAllCourseTitleH + DownSlideAllCourseRowH * CGFloat(totalNum)+DownSlideRecommendLeftGap
metaCode/Classes/Main/HomePage/View/VerticalViews/DownSlide/CNDownSlideView.swift
@@ -39,7 +39,7 @@ class CNDownSlideView:UIView{ @@ -39,7 +39,7 @@ class CNDownSlideView:UIView{
39 39
40 var url:URL? 40 var url:URL?
41 if (_downPath != ""){ 41 if (_downPath != ""){
42 - url = URL.init(string: _downPath!) 42 + url = URL.init(string:_downPath!)//"https://managemall.cnlive.com/html/mall/1/#/pages/main/goodsList/goodsList?scene=app"cn)//_downPath!)//
43 }else{ 43 }else{
44 url = nil 44 url = nil
45 } 45 }
@@ -96,6 +96,9 @@ class CNDownSlideView:UIView{ @@ -96,6 +96,9 @@ class CNDownSlideView:UIView{
96 if(type == UpDownTypeH5){ 96 if(type == UpDownTypeH5){
97 if _downPath?.count ?? 0 > 0{ 97 if _downPath?.count ?? 0 > 0{
98 self.addSubview(self.webView) 98 self.addSubview(self.webView)
  99 + if self.webView.cnWebView.url?.absoluteString.contains(_downPath) == false && self.webView.cnWebView.url != nil{
  100 + self.webView.loadUrl(url: _downPath!)
  101 + }
99 } 102 }
100 }else if(type == UpDownTypePage){ 103 }else if(type == UpDownTypePage){
101 self.addSubview(self.upSlideVC.view) 104 self.addSubview(self.upSlideVC.view)
metaCode/Classes/Main/HomePage/View/VerticalViews/UpSlide/CNUpSlideView.swift
@@ -29,13 +29,13 @@ class CNUpSlideView:UIView{ @@ -29,13 +29,13 @@ class CNUpSlideView:UIView{
29 configuration.userContentController = WKUserContentController() 29 configuration.userContentController = WKUserContentController()
30 30
31 var url:URL? 31 var url:URL?
32 - if (_downPath != ""){  
33 - url = URL.init(string: _downPath!) 32 + if (self.downPath != ""){
  33 + url = URL.init(string: _downPath!)//"https://managemall.cnlive.com/html/mall/1/#/pages/main/goodsList/goodsList?scene=app")//
34 }else{ 34 }else{
35 url = nil 35 url = nil
36 } 36 }
37 - let webView = CNWebView(frame: CGRectMake(10, KNavigationHeight+KStatusBarHeight+10, self.width - 20, self.height-KNavigationHeight-KStatusBarHeight-10), configuration: configuration,url: url)  
38 37
  38 + let webView = CNWebView(frame: CGRectMake(10, KNavigationHeight+KStatusBarHeight+10, KSreenWidth - 20, KSreenHeight-KNavigationHeight-KStatusBarHeight-10), configuration: configuration,url: url)
39 webView.cnWebView.scrollView.showsVerticalScrollIndicator = false 39 webView.cnWebView.scrollView.showsVerticalScrollIndicator = false
40 webView.cnWebView.scrollView.showsHorizontalScrollIndicator = false 40 webView.cnWebView.scrollView.showsHorizontalScrollIndicator = false
41 webView.cnWebView.backgroundColor = .clear 41 webView.cnWebView.backgroundColor = .clear
@@ -78,9 +78,13 @@ class CNUpSlideView:UIView{ @@ -78,9 +78,13 @@ class CNUpSlideView:UIView{
78 view.removeFromSuperview() 78 view.removeFromSuperview()
79 } 79 }
80 if(type == UpDownTypeH5){ 80 if(type == UpDownTypeH5){
81 - self.addSubview(self.webView)  
82 - }  
83 - else if(type == UpDownTypePage){ 81 + if _downPath?.count ?? 0 > 0{
  82 + self.addSubview(self.webView)
  83 + if self.webView.cnWebView.url?.absoluteString.contains(_downPath) == false && self.webView.cnWebView.url != nil{
  84 + self.webView.loadUrl(url: _downPath!)
  85 + }
  86 + }
  87 + }else if(type == UpDownTypePage){
84 88
85 }else if(type == UpDownTypeShopDetail){ 89 }else if(type == UpDownTypeShopDetail){
86 currentViewController()?.addChild(self.upSlideVC)//看行不行 90 currentViewController()?.addChild(self.upSlideVC)//看行不行
metaCode/Classes/Main/HomePage/ViewModel/CNLiveShoph5ViewModel.swift 0 → 100644
  1 +//
  2 +// CNLiveShoph5ViewModel.swift
  3 +// metaCode
  4 +//
  5 +// Created by zx on 2024/4/8.
  6 +// 电商h5请求
  7 +
  8 +import Foundation
  9 +import CNLiveRequestBastKit
  10 +
  11 +class CNLiveShoph5ViewModel:NSObject{
  12 + /// 获取分享数据
  13 + /// @param type 分享类型 1 文创商品详情 2普通商品详情 3主题活动列表 4店铺首页 5达人详情 6动态详情 7达人列表 8礼物详情 9优选库首页 10电影作品详情 11电影作品列表 12 服务号详情 13 抽奖详情 14 电影作品活动 15电影作品个人中心 16 新店铺首页 17 大众体育活动列表 18 活动首页分享 19 抽奖活动 20抽奖活动列表 21开箱子活动 22崇学向善活动页面 23获取大众体育类型列表 24活动首页 25折扣活动列表分享 26折扣活动分享商品 27崇学向善活动页面2 28领头雁首页 29领头雁成绩查询 30领头雁证书分享 31武汉活动小家音响 32抗议扶贫活动 33领头雁新闻分享 34领头雁招募 35美食中国 36公共加载页面 37领头雁电商活动 38活动专区 39成长活动 40成长商品详情 41成长活动订单列表
  14 + /// @param targetId 目标id
  15 + /// @param ext 后台要求的附加参数
  16 + /// @param result 结果
  17 + static func postGetShareDataWithType(type:NSInteger,targetId:String,ext:String,resultBlock: @escaping downSlideResultBlock) {
  18 + let param = NSMutableDictionary()
  19 + param.setValue("\(type)", forKey: "type")
  20 + param.setValue(targetId, forKey: "id")
  21 + param.setValue(ext, forKey: "ext")
  22 +
  23 + CNLiveNetworking.setAllowRequestDefaultArgument(true)
  24 + CNLiveNetworking.setupShowDataResult(false)
  25 + CNLiveNetworking.setupDSRequest(true)
  26 + let custom_param = NSMutableDictionary()
  27 + custom_param.setValue(CNLiveMCEnvironmentManager.shared.appId_wjj, forKey: "appId")
  28 + custom_param.setValue(CNLiveMCEnvironmentManager.shared.appKey_wjj, forKey: "appKey")
  29 + CNLiveNetworking.setupCustomParam(custom_param as? [String : String])
  30 + CNLiveNetworking.requestNetwork(with: .POST, urlString: APPBaseWjjShopUrl+"/Api/Index3/getShareData", param: param as! [String : String], cacheType: .networkOnly) { task, result, error in
  31 + hiddenLoading()
  32 + if (error == nil) {
  33 + let resp = result as! NSDictionary
  34 + let dataDic = resp["data"] as! NSDictionary
  35 + let shopDetailModel = newDictionaryToModel(dataDic as! [String : Any], CNLiveShopCommentRequestShareModel.self)
  36 + resultBlock(shopDetailModel,.success)
  37 + }else{
  38 + resultBlock(NSNull(),.failed)
  39 + }
  40 + }
  41 + }
  42 +
  43 + /*
  44 + 支付订单信息
  45 + 参数 orderId 订单号
  46 + */
  47 + static func postOrderPayWithParams(orderId:String,resultBlock: @escaping downSlideResultBlock) {
  48 + let param = NSMutableDictionary()
  49 + param.setValue(orderId, forKey: "orderId")
  50 +
  51 + CNLiveNetworking.setAllowRequestDefaultArgument(true)
  52 + CNLiveNetworking.setupShowDataResult(false)
  53 + CNLiveNetworking.setupDSRequest(true)
  54 + let custom_param = NSMutableDictionary()
  55 + custom_param.setValue(CNLiveMCEnvironmentManager.shared.appId_wjj, forKey: "appId")
  56 + custom_param.setValue(CNLiveMCEnvironmentManager.shared.appKey_wjj, forKey: "appKey")
  57 + CNLiveNetworking.setupCustomParam(custom_param as? [String : String])
  58 + CNLiveNetworking.requestNetwork(with: .POST, urlString: APPBaseWjjShopUrl+"/Api/Index3/orderPay", param: param as! [String : String], cacheType: .networkOnly) { task, result, error in
  59 + hiddenLoading()
  60 + if (error == nil) {
  61 + let resp = result as! NSDictionary
  62 + let dataDic = resp["data"] as! NSDictionary
  63 + let orderModel = newDictionaryToModel(dataDic as! [String : Any], CNLivePayOrderInfoModel.self)
  64 + resultBlock(orderModel,.success)
  65 + }else{
  66 + resultBlock(NSNull(),.failed)
  67 + }
  68 + }
  69 + }
  70 +
  71 + /**
  72 + 请求订单是否支付成功
  73 +
  74 + @param orderId 订单号
  75 + @param result 结果 //dic: NSString * score, NSString * desc
  76 + */
  77 + static func postIsOrderPayWithOrderId(orderId:String,resultBlock: @escaping downSlideResultBlock) {
  78 +
  79 + let param = NSMutableDictionary()
  80 + param.setValue(orderId, forKey: "orderId")
  81 +
  82 + CNLiveNetworking.setAllowRequestDefaultArgument(true)
  83 + CNLiveNetworking.setupShowDataResult(false)
  84 + CNLiveNetworking.setupDSRequest(true)
  85 + let custom_param = NSMutableDictionary()
  86 + custom_param.setValue(CNLiveMCEnvironmentManager.shared.appId_wjj, forKey: "appId")
  87 + custom_param.setValue(CNLiveMCEnvironmentManager.shared.appKey_wjj, forKey: "appKey")
  88 + CNLiveNetworking.setupCustomParam(custom_param as? [String : String])
  89 + CNLiveNetworking.requestNetwork(with: .POST, urlString: APPBaseWjjShopUrl+"/Api/Index3/isOrderPay", param: param as! [String : String], cacheType: .networkOnly) { task, result, error in
  90 + hiddenLoading()
  91 + let resp = result as! NSDictionary
  92 + let dataDic = resp["data"] as! NSDictionary
  93 + let code = resp["code"] as? String
  94 + if (code == "200") {
  95 + resultBlock(dataDic,.success)
  96 + }else{
  97 + resultBlock(NSNull(),.failed)
  98 + }
  99 + }
  100 + }
  101 +}
metaCode/Classes/Main/Model/CNLiveDownSlideModel.swift
@@ -39,14 +39,13 @@ class CNLiveDownSlideModel: BaseModel { @@ -39,14 +39,13 @@ class CNLiveDownSlideModel: BaseModel {
39 39
40 } 40 }
41 41
42 -//下滑tableview背景颜色  
43 let kCNDownSlideContentsModelModel1: String = "1" 42 let kCNDownSlideContentsModelModel1: String = "1"
44 let kCNDownSlideContentsModelModel2: String = "2" 43 let kCNDownSlideContentsModelModel2: String = "2"
45 let kCNDownSlideContentsModelModel3: String = "3" 44 let kCNDownSlideContentsModelModel3: String = "3"
46 let kCNDownSlideContentsModelModel4: String = "4" 45 let kCNDownSlideContentsModelModel4: String = "4"
47 let kCNDownSlideContentsModelModelAlbum: String = "album" 46 let kCNDownSlideContentsModelModelAlbum: String = "album"
48 let kCNDownSlideContentsModelModelAlbum_video: String = "album_video" 47 let kCNDownSlideContentsModelModelAlbum_video: String = "album_video"
49 -let kCNDownSlideContentsModelModelAlbum_ugc: String = "album_ugc" 48 +let kCNDownSlideContentsModelModelAlbum_ugc: String = "album_ugc"//短剧
50 let kCNDownSlideContentsModelModelServing: String = "serving"//微信小程序 49 let kCNDownSlideContentsModelModelServing: String = "serving"//微信小程序
51 50
52 51
metaCode/Classes/Main/Model/CNLivePayOrderInfoModel.swift 0 → 100644
  1 +//
  2 +// CNLivePayOrderInfoModel.swift
  3 +// metaCode
  4 +//
  5 +// Created by zx on 2024/4/9.
  6 +// 电商h5支付订单model
  7 +
  8 +import Foundation
  9 +
  10 +class CNLivePayOrderInfoModel:BaseModel{
  11 + ///订单id
  12 + var id: String = ""
  13 + ///订单号
  14 + var orderId: String = ""
  15 + ///订单信息
  16 + var body: String = ""
  17 + ///总价(分)
  18 + var totalMoney: String = ""
  19 + ///回调地址
  20 + var notify_url: String = ""
  21 + ///优惠金额(分)
  22 + var couponMoney: String = ""
  23 + ///用户id
  24 + var user_id: String = ""
  25 + ///收款人id
  26 + var toId: String = ""
  27 + ///收款人类型(1个人 2群组 3达人)
  28 + var toType: String = ""
  29 + ///支付人类型(1个人 2群组 3达人)
  30 + var fromType: String = ""
  31 + ///支付类型 foods_order餐厅订单 mall_order商城订单
  32 + var sourceType: String = ""
  33 + ///是否为公会限购订单(1:是 0:不是)
  34 + var is_limit: String = ""
  35 + ///integral > 0 为积分订单
  36 + var integral: String = ""
  37 +}
metaCode/Classes/Main/Util/CNLiveDownSlideTool.swift
@@ -43,6 +43,7 @@ class CNLiveDownSlideTool:NSObject{ @@ -43,6 +43,7 @@ class CNLiveDownSlideTool:NSObject{
43 } 43 }
44 }else if (model == kCNDownSlideContentsModelModel3) || (model == kCNDownSlideContentsModelModel4){ 44 }else if (model == kCNDownSlideContentsModelModel3) || (model == kCNDownSlideContentsModelModel4){
45 let webVC = CNWebViewController() 45 let webVC = CNWebViewController()
  46 +// webVC.url = URL(string: "http://wjjh5.cnlive.com/cnBlockMore.html?channelName=yjzg&pageId=&isShowTitle=true&blockType=28&contentType=13&title=%E5%9B%AD%E9%95%BF%E8%AF%BE%E7%A8%8B&pageName=&moreUrl=https%3A%2F%2Fcmsapi.cnlive.com%2FcontentApi%2FgetBlockContents%3FblockId%3D12165")//"https://managemall.cnlive.com/html/mall/1/#/pages/main/goodsList/goodsList?scene=app")
46 webVC.url = URL(string: thirdUrl) 47 webVC.url = URL(string: thirdUrl)
47 if controller != nil{ 48 if controller != nil{
48 controller!.navigationController?.pushViewController(webVC, animated: pushAnimated) 49 controller!.navigationController?.pushViewController(webVC, animated: pushAnimated)
metaCode/Classes/Other/AppDelegate.swift
@@ -105,7 +105,7 @@ class AppDelegate: UIResponder, UIApplicationDelegate { @@ -105,7 +105,7 @@ class AppDelegate: UIResponder, UIApplicationDelegate {
105 105
106 let shop_dic : Dictionary = ["Phone-Model":"iPhone","Uid":UserInfoManager.shared.userInfo.uid ,"CFBundleShortVersionString":ver,"Shop-Version":"0.6.2"] 106 let shop_dic : Dictionary = ["Phone-Model":"iPhone","Uid":UserInfoManager.shared.userInfo.uid ,"CFBundleShortVersionString":ver,"Shop-Version":"0.6.2"]
107 CNLiveNetworking.setupDSShopParam(shop_dic) 107 CNLiveNetworking.setupDSShopParam(shop_dic)
108 - CNLiveNetworking.setRequestTimeoutInterval(20) 108 + CNLiveNetworking.setRequestTimeoutInterval(60)
109 CNLiveNetworking.setupShowDataResult(false) 109 CNLiveNetworking.setupShowDataResult(false)
110 CNLiveNetworking.setupSignKey(APPKey) 110 CNLiveNetworking.setupSignKey(APPKey)
111 CNLiveNetworking.setAllowRequestDefaultArgument(true) 111 CNLiveNetworking.setAllowRequestDefaultArgument(true)
metaCode/Classes/Vendors/NewPagedFlowView.m
@@ -557,6 +557,22 @@ static NSString *subviewClassName; @@ -557,6 +557,22 @@ static NSString *subviewClassName;
557 newPoint.y = point.y - _scrollView.frame.origin.y + _scrollView.contentOffset.y; 557 newPoint.y = point.y - _scrollView.frame.origin.y + _scrollView.contentOffset.y;
558 if ([_scrollView pointInside:newPoint withEvent:event]) { 558 if ([_scrollView pointInside:newPoint withEvent:event]) {
559 return [_scrollView hitTest:newPoint withEvent:event]; 559 return [_scrollView hitTest:newPoint withEvent:event];
  560 + }else{
  561 + //24年4-12,多层的子视图超过了父视图,如果有子视图内点击,传递给子视图点击事件
  562 + PGIndexBannerSubiew *cell = [_cells objectAtIndex:self.currentPageIndex];
  563 + for (UIView *view in cell.subviews) {
  564 + if ([view isKindOfClass:[UIScrollView class]]){
  565 + UIScrollView *scrollView = (UIScrollView *)view;
  566 + for (UIView *subView in [scrollView subviews]) {
  567 + // 将父类point点转换成子类坐标系下的点
  568 + CGPoint convertedPoint = [subView convertPoint:point fromView:self];
  569 + UIView *targetView = [subView hitTest:convertedPoint withEvent:event];
  570 + if (targetView != nil) {
  571 + return targetView;
  572 + }
  573 + }
  574 + }
  575 + }
560 } 576 }
561 577
562 return _scrollView; 578 return _scrollView;
metaCode/Info.plist
@@ -54,6 +54,8 @@ @@ -54,6 +54,8 @@
54 <key>LSApplicationQueriesSchemes</key> 54 <key>LSApplicationQueriesSchemes</key>
55 <array> 55 <array>
56 <string>wechat</string> 56 <string>wechat</string>
  57 + <string>alipay</string>
  58 + <string>alipays</string>
57 <string>weixin</string> 59 <string>weixin</string>
58 <string>weixinULAPI</string> 60 <string>weixinULAPI</string>
59 <string>mqqOpensdkSSoLogin</string> 61 <string>mqqOpensdkSSoLogin</string>
@@ -74,9 +76,6 @@ @@ -74,9 +76,6 @@
74 <string>mqqwpa</string> 76 <string>mqqwpa</string>
75 <string>mqzone</string> 77 <string>mqzone</string>
76 <string>mqqopensdkminiapp</string> 78 <string>mqqopensdkminiapp</string>
77 -  
78 -<!-- <string>sinaweibo</string>-->  
79 -<!-- <string>sinaweibohd</string>-->  
80 </array> 79 </array>
81 <key>NSAppTransportSecurity</key> 80 <key>NSAppTransportSecurity</key>
82 <dict> 81 <dict>
metaCode/Supporting Files/Assets.xcassets/Shoph5/Contents.json 0 → 100644
  1 +{
  2 + "info" : {
  3 + "author" : "xcode",
  4 + "version" : 1
  5 + }
  6 +}
metaCode/Supporting Files/Assets.xcassets/Shoph5/dd_weixin.imageset/Contents.json 0 → 100644
  1 +{
  2 + "images" : [
  3 + {
  4 + "idiom" : "universal",
  5 + "scale" : "1x"
  6 + },
  7 + {
  8 + "filename" : "dd_weixin@2x.png",
  9 + "idiom" : "universal",
  10 + "scale" : "2x"
  11 + },
  12 + {
  13 + "filename" : "dd_weixin@3x.png",
  14 + "idiom" : "universal",
  15 + "scale" : "3x"
  16 + }
  17 + ],
  18 + "info" : {
  19 + "author" : "xcode",
  20 + "version" : 1
  21 + }
  22 +}
metaCode/Supporting Files/Assets.xcassets/Shoph5/dd_weixin.imageset/dd_weixin@2x.png 0 → 100644

1.89 KB

metaCode/Supporting Files/Assets.xcassets/Shoph5/dd_weixin.imageset/dd_weixin@3x.png 0 → 100644

2.46 KB

metaCode/Supporting Files/Assets.xcassets/Shoph5/dd_zhifubao.imageset/Contents.json 0 → 100644
  1 +{
  2 + "images" : [
  3 + {
  4 + "idiom" : "universal",
  5 + "scale" : "1x"
  6 + },
  7 + {
  8 + "filename" : "dd_zhifubao@2x.png",
  9 + "idiom" : "universal",
  10 + "scale" : "2x"
  11 + },
  12 + {
  13 + "filename" : "dd_zhifubao@3x.png",
  14 + "idiom" : "universal",
  15 + "scale" : "3x"
  16 + }
  17 + ],
  18 + "info" : {
  19 + "author" : "xcode",
  20 + "version" : 1
  21 + }
  22 +}
metaCode/Supporting Files/Assets.xcassets/Shoph5/dd_zhifubao.imageset/dd_zhifubao@2x.png 0 → 100644

1.9 KB

metaCode/Supporting Files/Assets.xcassets/Shoph5/dd_zhifubao.imageset/dd_zhifubao@3x.png 0 → 100644

2.38 KB

metaCode/Supporting Files/Assets.xcassets/Shoph5/tsq_xz.imageset/Contents.json 0 → 100644
  1 +{
  2 + "images" : [
  3 + {
  4 + "idiom" : "universal",
  5 + "scale" : "1x"
  6 + },
  7 + {
  8 + "filename" : "tsq_xz@2x.png",
  9 + "idiom" : "universal",
  10 + "scale" : "2x"
  11 + },
  12 + {
  13 + "filename" : "tsq_xz@3x.png",
  14 + "idiom" : "universal",
  15 + "scale" : "3x"
  16 + }
  17 + ],
  18 + "info" : {
  19 + "author" : "xcode",
  20 + "version" : 1
  21 + }
  22 +}
metaCode/Supporting Files/Assets.xcassets/Shoph5/tsq_xz.imageset/tsq_xz@2x.png 0 → 100644

1.5 KB

metaCode/Supporting Files/Assets.xcassets/Shoph5/tsq_xz.imageset/tsq_xz@3x.png 0 → 100644

1.83 KB