diff --git a/WOKA.xcodeproj/project.pbxproj b/WOKA.xcodeproj/project.pbxproj index 6779dbe..5a5323c 100644 --- a/WOKA.xcodeproj/project.pbxproj +++ b/WOKA.xcodeproj/project.pbxproj @@ -41,6 +41,15 @@ 525327D92BFCDDF700F64283 /* AuthFuncStartupSoundHandling.swift in Sources */ = {isa = PBXBuildFile; fileRef = 525327D82BFCDDF700F64283 /* AuthFuncStartupSoundHandling.swift */; }; 5257B2652BDFB6F50086D79B /* CheckPhoneHomeBtnOrNotch.swift in Sources */ = {isa = PBXBuildFile; fileRef = 5257B2642BDFB6F50086D79B /* CheckPhoneHomeBtnOrNotch.swift */; }; 5258464F2C491829004F074B /* connectedness.swift in Sources */ = {isa = PBXBuildFile; fileRef = 5258464E2C491829004F074B /* connectedness.swift */; }; + 525861D02C4F9E3200C33C79 /* SwipeTableViewFont.swift in Sources */ = {isa = PBXBuildFile; fileRef = 525861CF2C4F9E3200C33C79 /* SwipeTableViewFont.swift */; }; + 525861D22C4FC6C000C33C79 /* CartPaymentOptionsVC.swift in Sources */ = {isa = PBXBuildFile; fileRef = 525861D12C4FC6C000C33C79 /* CartPaymentOptionsVC.swift */; }; + 525861D42C4FCCB500C33C79 /* CartPaymentOptionsVM.swift in Sources */ = {isa = PBXBuildFile; fileRef = 525861D32C4FCCB500C33C79 /* CartPaymentOptionsVM.swift */; }; + 525861D72C4FD38D00C33C79 /* CartPaymentOptionsCell.xib in Resources */ = {isa = PBXBuildFile; fileRef = 525861D62C4FD38D00C33C79 /* CartPaymentOptionsCell.xib */; }; + 525861D82C4FD38D00C33C79 /* CartPaymentOptionsCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = 525861D52C4FD38D00C33C79 /* CartPaymentOptionsCell.swift */; }; + 525861DA2C4FE71100C33C79 /* CouponListDM.swift in Sources */ = {isa = PBXBuildFile; fileRef = 525861D92C4FE71100C33C79 /* CouponListDM.swift */; }; + 525861DD2C4FE7A100C33C79 /* CouponCell.xib in Resources */ = {isa = PBXBuildFile; fileRef = 525861DC2C4FE7A100C33C79 /* CouponCell.xib */; }; + 525861DE2C4FE7A100C33C79 /* CouponCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = 525861DB2C4FE7A100C33C79 /* CouponCell.swift */; }; + 525861E02C4FF16700C33C79 /* CouponApplyDM.swift in Sources */ = {isa = PBXBuildFile; fileRef = 525861DF2C4FF16700C33C79 /* CouponApplyDM.swift */; }; 525953CF2BE8B28F00191286 /* Utilities.swift in Sources */ = {isa = PBXBuildFile; fileRef = 525953CE2BE8B28F00191286 /* Utilities.swift */; }; 525953D12BE8B2B200191286 /* LLSpinner.swift in Sources */ = {isa = PBXBuildFile; fileRef = 525953D02BE8B2B200191286 /* LLSpinner.swift */; }; 525953D42BE8B2DF00191286 /* UIApplication.swift in Sources */ = {isa = PBXBuildFile; fileRef = 525953D32BE8B2DF00191286 /* UIApplication.swift */; }; @@ -108,6 +117,12 @@ 52A6DCB82C4E754800F63C51 /* ShopProductDM.swift in Sources */ = {isa = PBXBuildFile; fileRef = 52A6DCB72C4E754800F63C51 /* ShopProductDM.swift */; }; 52A6DCBB2C4EA46400F63C51 /* ShopProductsCell.xib in Resources */ = {isa = PBXBuildFile; fileRef = 52A6DCBA2C4EA46400F63C51 /* ShopProductsCell.xib */; }; 52A6DCBC2C4EA46400F63C51 /* ShopProductsCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = 52A6DCB92C4EA46400F63C51 /* ShopProductsCell.swift */; }; + 52A6DCBF2C4F8E7C00F63C51 /* Cart.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 52A6DCBE2C4F8E7C00F63C51 /* Cart.storyboard */; }; + 52A6DCC52C4F8EA800F63C51 /* CartListVC.swift in Sources */ = {isa = PBXBuildFile; fileRef = 52A6DCC42C4F8EA800F63C51 /* CartListVC.swift */; }; + 52A6DCC72C4F8FD000F63C51 /* CartListVM.swift in Sources */ = {isa = PBXBuildFile; fileRef = 52A6DCC62C4F8FD000F63C51 /* CartListVM.swift */; }; + 52A6DCC92C4F906900F63C51 /* CartListingDM.swift in Sources */ = {isa = PBXBuildFile; fileRef = 52A6DCC82C4F906900F63C51 /* CartListingDM.swift */; }; + 52A6DCCC2C4F929B00F63C51 /* CartListCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = 52A6DCCA2C4F929B00F63C51 /* CartListCell.swift */; }; + 52A6DCCD2C4F929B00F63C51 /* CartListCell.xib in Resources */ = {isa = PBXBuildFile; fileRef = 52A6DCCB2C4F929B00F63C51 /* CartListCell.xib */; }; 52A981CE2C1AFE66000E0BEC /* FavouriteListingDM.swift in Sources */ = {isa = PBXBuildFile; fileRef = 52A981CD2C1AFE66000E0BEC /* FavouriteListingDM.swift */; }; 52A981D02C1AFEE8000E0BEC /* MyListVM.swift in Sources */ = {isa = PBXBuildFile; fileRef = 52A981CF2C1AFEE8000E0BEC /* MyListVM.swift */; }; 52A981D72C1B0E27000E0BEC /* FavouriteCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = 52A981D52C1B0E27000E0BEC /* FavouriteCell.swift */; }; @@ -341,6 +356,15 @@ 5257B2642BDFB6F50086D79B /* CheckPhoneHomeBtnOrNotch.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CheckPhoneHomeBtnOrNotch.swift; sourceTree = ""; }; 5258464E2C491829004F074B /* connectedness.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = connectedness.swift; sourceTree = ""; }; 525846502C491A9E004F074B /* speedchecker-sdk-ios-master */ = {isa = PBXFileReference; lastKnownFileType = wrapper; name = "speedchecker-sdk-ios-master"; path = "../../Downloads/speedchecker-sdk-ios-master"; sourceTree = ""; }; + 525861CF2C4F9E3200C33C79 /* SwipeTableViewFont.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SwipeTableViewFont.swift; sourceTree = ""; }; + 525861D12C4FC6C000C33C79 /* CartPaymentOptionsVC.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CartPaymentOptionsVC.swift; sourceTree = ""; }; + 525861D32C4FCCB500C33C79 /* CartPaymentOptionsVM.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CartPaymentOptionsVM.swift; sourceTree = ""; }; + 525861D52C4FD38D00C33C79 /* CartPaymentOptionsCell.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CartPaymentOptionsCell.swift; sourceTree = ""; }; + 525861D62C4FD38D00C33C79 /* CartPaymentOptionsCell.xib */ = {isa = PBXFileReference; lastKnownFileType = file.xib; path = CartPaymentOptionsCell.xib; sourceTree = ""; }; + 525861D92C4FE71100C33C79 /* CouponListDM.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CouponListDM.swift; sourceTree = ""; }; + 525861DB2C4FE7A100C33C79 /* CouponCell.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CouponCell.swift; sourceTree = ""; }; + 525861DC2C4FE7A100C33C79 /* CouponCell.xib */ = {isa = PBXFileReference; lastKnownFileType = file.xib; path = CouponCell.xib; sourceTree = ""; }; + 525861DF2C4FF16700C33C79 /* CouponApplyDM.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CouponApplyDM.swift; sourceTree = ""; }; 525953CE2BE8B28F00191286 /* Utilities.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Utilities.swift; sourceTree = ""; }; 525953D02BE8B2B200191286 /* LLSpinner.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = LLSpinner.swift; sourceTree = ""; }; 525953D32BE8B2DF00191286 /* UIApplication.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = UIApplication.swift; sourceTree = ""; }; @@ -409,6 +433,12 @@ 52A6DCB72C4E754800F63C51 /* ShopProductDM.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ShopProductDM.swift; sourceTree = ""; }; 52A6DCB92C4EA46400F63C51 /* ShopProductsCell.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ShopProductsCell.swift; sourceTree = ""; }; 52A6DCBA2C4EA46400F63C51 /* ShopProductsCell.xib */ = {isa = PBXFileReference; lastKnownFileType = file.xib; path = ShopProductsCell.xib; sourceTree = ""; }; + 52A6DCBE2C4F8E7C00F63C51 /* Cart.storyboard */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; path = Cart.storyboard; sourceTree = ""; }; + 52A6DCC42C4F8EA800F63C51 /* CartListVC.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CartListVC.swift; sourceTree = ""; }; + 52A6DCC62C4F8FD000F63C51 /* CartListVM.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CartListVM.swift; sourceTree = ""; }; + 52A6DCC82C4F906900F63C51 /* CartListingDM.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CartListingDM.swift; sourceTree = ""; }; + 52A6DCCA2C4F929B00F63C51 /* CartListCell.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CartListCell.swift; sourceTree = ""; }; + 52A6DCCB2C4F929B00F63C51 /* CartListCell.xib */ = {isa = PBXFileReference; lastKnownFileType = file.xib; path = CartListCell.xib; sourceTree = ""; }; 52A981CD2C1AFE66000E0BEC /* FavouriteListingDM.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = FavouriteListingDM.swift; sourceTree = ""; }; 52A981CF2C1AFEE8000E0BEC /* MyListVM.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MyListVM.swift; sourceTree = ""; }; 52A981D52C1B0E27000E0BEC /* FavouriteCell.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = FavouriteCell.swift; sourceTree = ""; }; @@ -722,6 +752,7 @@ 523ED25C2BDA2BC700CFED02 /* WOKA */ = { isa = PBXGroup; children = ( + 52A6DCBD2C4F8E7300F63C51 /* Cart */, 52A6DCAF2C4E621800F63C51 /* BadgedBarButtonItem.swift */, 52A6DC942C4E385500F63C51 /* Shop */, 9CB3D0832C37BA470062869D /* Karaoke */, @@ -1065,6 +1096,59 @@ path = Model; sourceTree = ""; }; + 52A6DCBD2C4F8E7300F63C51 /* Cart */ = { + isa = PBXGroup; + children = ( + 52A6DCC32C4F8E8900F63C51 /* Model */, + 52A6DCC22C4F8E8700F63C51 /* View */, + 52A6DCC12C4F8E8500F63C51 /* ViewModel */, + 52A6DCC02C4F8E8300F63C51 /* Controller */, + 52A6DCBE2C4F8E7C00F63C51 /* Cart.storyboard */, + ); + path = Cart; + sourceTree = ""; + }; + 52A6DCC02C4F8E8300F63C51 /* Controller */ = { + isa = PBXGroup; + children = ( + 52A6DCC42C4F8EA800F63C51 /* CartListVC.swift */, + 525861D12C4FC6C000C33C79 /* CartPaymentOptionsVC.swift */, + ); + path = Controller; + sourceTree = ""; + }; + 52A6DCC12C4F8E8500F63C51 /* ViewModel */ = { + isa = PBXGroup; + children = ( + 52A6DCC62C4F8FD000F63C51 /* CartListVM.swift */, + 525861D32C4FCCB500C33C79 /* CartPaymentOptionsVM.swift */, + ); + path = ViewModel; + sourceTree = ""; + }; + 52A6DCC22C4F8E8700F63C51 /* View */ = { + isa = PBXGroup; + children = ( + 52A6DCCA2C4F929B00F63C51 /* CartListCell.swift */, + 52A6DCCB2C4F929B00F63C51 /* CartListCell.xib */, + 525861D52C4FD38D00C33C79 /* CartPaymentOptionsCell.swift */, + 525861D62C4FD38D00C33C79 /* CartPaymentOptionsCell.xib */, + 525861DB2C4FE7A100C33C79 /* CouponCell.swift */, + 525861DC2C4FE7A100C33C79 /* CouponCell.xib */, + ); + path = View; + sourceTree = ""; + }; + 52A6DCC32C4F8E8900F63C51 /* Model */ = { + isa = PBXGroup; + children = ( + 52A6DCC82C4F906900F63C51 /* CartListingDM.swift */, + 525861D92C4FE71100C33C79 /* CouponListDM.swift */, + 525861DF2C4FF16700C33C79 /* CouponApplyDM.swift */, + ); + path = Model; + sourceTree = ""; + }; 52BFB52B2C33DA9700BAAE15 /* Audio Books */ = { isa = PBXGroup; children = ( @@ -1155,6 +1239,7 @@ 5219C2C12C086D9B00A1DF4D /* DataTypeConversion.swift */, 9C7939142C0F23AA00F5D6E6 /* NsNotificationExtension.swift */, 9CB4C5A82C118EF300737C00 /* NavBarColor.swift */, + 525861CF2C4F9E3200C33C79 /* SwipeTableViewFont.swift */, ); path = Helpers; sourceTree = ""; @@ -1709,11 +1794,13 @@ 527AC6FE2C173A5100434FB7 /* SongListCell.xib in Resources */, 523ED26A2BDA2BC900CFED02 /* Base in Resources */, 52C8B05B2BDA5924003B51D0 /* WokaSplashSound.m4a in Resources */, + 525861D72C4FD38D00C33C79 /* CartPaymentOptionsCell.xib in Resources */, 52D6A24B2C21B43300145908 /* WebSeriesCell.xib in Resources */, 52DAC6482C21762900E2F85B /* WebSeries.storyboard in Resources */, 527AC6F82C171C8F00434FB7 /* BlogsCell.xib in Resources */, 52A6DC962C4E387F00F63C51 /* Shop.storyboard in Resources */, 52A981D82C1B0E27000E0BEC /* FavouriteCell.xib in Resources */, + 52A6DCBF2C4F8E7C00F63C51 /* Cart.storyboard in Resources */, 52C1A4E82C05C95D007BAA50 /* Theme.storyboard in Resources */, 526A436F2C36A97400AE148F /* Games.storyboard in Resources */, 522D65652C1ACE9C0021E505 /* UserNotificationCell.xib in Resources */, @@ -1730,6 +1817,8 @@ 52BFB52D2C33DAA500BAAE15 /* AudioBooks.storyboard in Resources */, 52A6DC9F2C4E3AA600F63C51 /* ShopListingCell.xib in Resources */, 9C834ED52C1C1F9200B29A9C /* Exo2-Bold.ttf in Resources */, + 52A6DCCD2C4F929B00F63C51 /* CartListCell.xib in Resources */, + 525861DD2C4FE7A100C33C79 /* CouponCell.xib in Resources */, 9C834ED62C1C1F9200B29A9C /* Exo2-ExtraBold.ttf in Resources */, 9C834ED72C1C1F9200B29A9C /* Exo2-Regular.ttf in Resources */, 9C834ED82C1C1F9200B29A9C /* Exo2-Thin.ttf in Resources */, @@ -1818,6 +1907,7 @@ files = ( 9C535DC62C00BF2400DA6DCD /* HomeExploreCell.swift in Sources */, 52D774EF2BDFC50D001D87DE /* StringValidations.swift in Sources */, + 52A6DCC52C4F8EA800F63C51 /* CartListVC.swift in Sources */, 52D6A2512C22B58200145908 /* WebSeriesShowListingCell.swift in Sources */, 9C007F232C25603800F798C2 /* WebSeriesEpisodeCell.swift in Sources */, 5272FCE32BDFDB05000ECB1D /* UserDetailsRegisterVC.swift in Sources */, @@ -1833,9 +1923,11 @@ 529B0DD62C070C0F00CFC54B /* GuestDataDM.swift in Sources */, 5259545C2BEBB80400191286 /* AvatarDM.swift in Sources */, 52C8B06C2BDA6E87003B51D0 /* LocalizedString.swift in Sources */, + 52A6DCC72C4F8FD000F63C51 /* CartListVM.swift in Sources */, 525953D42BE8B2DF00191286 /* UIApplication.swift in Sources */, 52C8EC802C358E75002DC35C /* AudioBookDetailsVC.swift in Sources */, 52CC38C32BDF812F00B74C3E /* LocalisedElements.swift in Sources */, + 52A6DCCC2C4F929B00F63C51 /* CartListCell.swift in Sources */, 5259545E2BEBBA1A00191286 /* LoadingIndicatorImageView.swift in Sources */, 52B8D4DC2C04A25E00ED65F3 /* Delegate.swift in Sources */, 52CA28FC2BE11A0400708B49 /* UserIntrestVM.swift in Sources */, @@ -1850,6 +1942,7 @@ 52B8D4DF2C04A25E00ED65F3 /* StatusBar.swift in Sources */, 5259541D2BE8D94400191286 /* QueueHelper.swift in Sources */, 525954232BE8F00400191286 /* BaseResponseModel.swift in Sources */, + 525861E02C4FF16700C33C79 /* CouponApplyDM.swift in Sources */, 52A6DCB42C4E73F100F63C51 /* ShopProductsVM.swift in Sources */, 9C27E1692BDB76F200EC1DA9 /* OnBoardVM.swift in Sources */, 9C7939172C0F23E900F5D6E6 /* LinkTypeEnum.swift in Sources */, @@ -1881,6 +1974,7 @@ 52BC3BF22C170264002FACA6 /* MoreVM.swift in Sources */, 9CB3D08F2C37D0D60062869D /* KaraokeListingDM.swift in Sources */, 9CBE1B412C0F37B300CA6E61 /* DPDUIView+Extension.swift in Sources */, + 525861DE2C4FE7A100C33C79 /* CouponCell.swift in Sources */, 9C27E1632BDB6F1900EC1DA9 /* AuthFunc.swift in Sources */, 9C0A85412BEE35670093783D /* ResetPassUserNameVM.swift in Sources */, 52C6E0292BE3B52500E22D59 /* SelectAvatarVM.swift in Sources */, @@ -1897,6 +1991,8 @@ 52D774ED2BDFC13F001D87DE /* OTPVM.swift in Sources */, 52D23F112C465E6F003E743A /* LogoutPopupVC.swift in Sources */, 525327D62BFCC23600F64283 /* SideMenuVM.swift in Sources */, + 525861D22C4FC6C000C33C79 /* CartPaymentOptionsVC.swift in Sources */, + 525861DA2C4FE71100C33C79 /* CouponListDM.swift in Sources */, 9CBCB2A32BE50C95007D7934 /* ResetPassUserNameVC.swift in Sources */, 52A3F6A52BECBA8D0000BB0B /* LinkedChildDM.swift in Sources */, 52B8D4DE2C04A25E00ED65F3 /* SideMenuController.swift in Sources */, @@ -1940,6 +2036,7 @@ 522D655E2C1ACCF40021E505 /* UserNotificationDM.swift in Sources */, 9C1C69FC2C106C240035B2C7 /* ContactSupportVM.swift in Sources */, 52AF71F22C36B77B00BC5972 /* GamesDetailVC.swift in Sources */, + 525861D42C4FCCB500C33C79 /* CartPaymentOptionsVM.swift in Sources */, 52A3F6AF2BECC0690000BB0B /* LinkedChildVM.swift in Sources */, 52A6DCB02C4E621800F63C51 /* BadgedBarButtonItem.swift in Sources */, 52C8EC7D2C3536E5002DC35C /* ContinueAudioCell.swift in Sources */, @@ -1991,6 +2088,7 @@ 522242682BFC74380085C632 /* TabBarVC.swift in Sources */, 5242FE592C24203E0086A86D /* WebSeriesSeasonVC.swift in Sources */, 9C27E1722BDB86B600EC1DA9 /* OnBoardCell.swift in Sources */, + 525861D82C4FD38D00C33C79 /* CartPaymentOptionsCell.swift in Sources */, 529B0DD42C06156B00CFC54B /* LoginNavVC.swift in Sources */, 52A981D72C1B0E27000E0BEC /* FavouriteCell.swift in Sources */, 52C8B05F2BDA5AFA003B51D0 /* SplashVM.swift in Sources */, @@ -2014,11 +2112,13 @@ 525954342BEA620800191286 /* IntrestTopicDM.swift in Sources */, 52BC3BE52C0E0326002FACA6 /* FaqCell.swift in Sources */, 52663FF52BDFAB830001D8CE /* TextFieldErrorView.swift in Sources */, + 525861D02C4F9E3200C33C79 /* SwipeTableViewFont.swift in Sources */, 5258464F2C491829004F074B /* connectedness.swift in Sources */, 9CBE1B452C0F37B300CA6E61 /* DropDownCell.swift in Sources */, 9C27E16D2BDB852F00EC1DA9 /* GVar.swift in Sources */, 52B8D4E02C04A25E00ED65F3 /* UIView+Container.swift in Sources */, 9C56E8462BDBEE6400E4CA14 /* EmailVC.swift in Sources */, + 52A6DCC92C4F906900F63C51 /* CartListingDM.swift in Sources */, 522D65622C1ACDA40021E505 /* CommonNwCall.swift in Sources */, 52D6A2482C21A3A500145908 /* WebSeriesVM.swift in Sources */, 525327D92BFCDDF700F64283 /* AuthFuncStartupSoundHandling.swift in Sources */, diff --git a/WOKA/Assets/Assets.xcassets/Shop/DeleteIcon.imageset/Contents.json b/WOKA/Assets/Assets.xcassets/Shop/DeleteIcon.imageset/Contents.json new file mode 100644 index 0000000..8da5a98 --- /dev/null +++ b/WOKA/Assets/Assets.xcassets/Shop/DeleteIcon.imageset/Contents.json @@ -0,0 +1,26 @@ +{ + "images" : [ + { + "filename" : "delete-3-svgrepo-com.png", + "idiom" : "universal", + "scale" : "1x" + }, + { + "filename" : "delete-3-svgrepo-com@2x.png", + "idiom" : "universal", + "scale" : "2x" + }, + { + "filename" : "delete-3-svgrepo-com@3x.png", + "idiom" : "universal", + "scale" : "3x" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + }, + "properties" : { + "template-rendering-intent" : "template" + } +} diff --git a/WOKA/Assets/Assets.xcassets/Shop/DeleteIcon.imageset/delete-3-svgrepo-com.png b/WOKA/Assets/Assets.xcassets/Shop/DeleteIcon.imageset/delete-3-svgrepo-com.png new file mode 100644 index 0000000..0ba555f Binary files /dev/null and b/WOKA/Assets/Assets.xcassets/Shop/DeleteIcon.imageset/delete-3-svgrepo-com.png differ diff --git a/WOKA/Assets/Assets.xcassets/Shop/DeleteIcon.imageset/delete-3-svgrepo-com@2x.png b/WOKA/Assets/Assets.xcassets/Shop/DeleteIcon.imageset/delete-3-svgrepo-com@2x.png new file mode 100644 index 0000000..e57aa51 Binary files /dev/null and b/WOKA/Assets/Assets.xcassets/Shop/DeleteIcon.imageset/delete-3-svgrepo-com@2x.png differ diff --git a/WOKA/Assets/Assets.xcassets/Shop/DeleteIcon.imageset/delete-3-svgrepo-com@3x.png b/WOKA/Assets/Assets.xcassets/Shop/DeleteIcon.imageset/delete-3-svgrepo-com@3x.png new file mode 100644 index 0000000..e87ca96 Binary files /dev/null and b/WOKA/Assets/Assets.xcassets/Shop/DeleteIcon.imageset/delete-3-svgrepo-com@3x.png differ diff --git a/WOKA/Assets/Assets.xcassets/Shop/TrashCan.imageset/Contents.json b/WOKA/Assets/Assets.xcassets/Shop/TrashCan.imageset/Contents.json new file mode 100644 index 0000000..434e876 --- /dev/null +++ b/WOKA/Assets/Assets.xcassets/Shop/TrashCan.imageset/Contents.json @@ -0,0 +1,24 @@ +{ + "images" : [ + { + "filename" : "trash-bin.png", + "idiom" : "universal", + "scale" : "1x" + }, + { + "idiom" : "universal", + "scale" : "2x" + }, + { + "idiom" : "universal", + "scale" : "3x" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + }, + "properties" : { + "template-rendering-intent" : "template" + } +} diff --git a/WOKA/Assets/Assets.xcassets/Shop/TrashCan.imageset/trash-bin.png b/WOKA/Assets/Assets.xcassets/Shop/TrashCan.imageset/trash-bin.png new file mode 100644 index 0000000..0662cec Binary files /dev/null and b/WOKA/Assets/Assets.xcassets/Shop/TrashCan.imageset/trash-bin.png differ diff --git a/WOKA/Authentication/Base.lproj/AuthenticationSB.storyboard b/WOKA/Authentication/Base.lproj/AuthenticationSB.storyboard index 7ffe2e7..5f5439b 100644 --- a/WOKA/Authentication/Base.lproj/AuthenticationSB.storyboard +++ b/WOKA/Authentication/Base.lproj/AuthenticationSB.storyboard @@ -1329,17 +1329,17 @@ Sent to Your Parent’s Email - + - + - + - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/WOKA/Cart/Controller/CartListVC.swift b/WOKA/Cart/Controller/CartListVC.swift new file mode 100644 index 0000000..daac747 --- /dev/null +++ b/WOKA/Cart/Controller/CartListVC.swift @@ -0,0 +1,120 @@ +// +// CartListVC.swift +// WOKA +// +// Created by MacBook Pro on 23/07/24. +// + +import UIKit + +class CartListVC: UIViewController { + + @IBOutlet weak var tableView: UITableView! + @IBOutlet weak var totalPrice: LocalisedElementsLabel! + @IBOutlet weak var noDataStack: UIStackView! + @IBOutlet weak var checkoutBtn: LocalisedElementsButton! + var vm = CartListVM() + + // MARK: - Life Cycle + + override func viewDidLoad() { + super.viewDidLoad() + vm.vc = self + vm.initView() + navigationController?.navigationBar.setBackgroundImage(UIImage(), for: .default) + navigationController?.navigationBar.shadowImage = UIImage() + } + + override func viewWillAppear(_ animated: Bool) { + super.viewWillAppear(animated) + navigationController?.setNavigationBarHidden(false, animated: animated) + } + + override func viewDidAppear(_ animated: Bool) { + self.navigationController?.setColor(color: .white) + + } + + override func viewWillDisappear(_ animated: Bool) { + super.viewWillDisappear(animated) + self.navigationController?.setNavigationBarHidden(true, animated: animated) + } + + override func viewDidDisappear(_ animated: Bool) { + super.viewDidDisappear(animated) + + // Customize the navigation bar's appearance + self.navigationController?.setColor(color: .black) + } + + // MARK: - Tap Handler + + @IBAction func checkoutBtnTapped(_ sender: LocalisedElementsButton) { + let sb = UIStoryboard(name: K.StoryBoard.cart, bundle: nil) + let vcPush = sb.instantiateViewController(withIdentifier: K.StoryBoardID.Cart.cartPaymentOptionsVC) as! CartPaymentOptionsVC + vcPush.vm.cartListData = vm.cartListData + vcPush.vm.cartTotalPrice = vm.totalAmount + self.navigationController?.pushViewController(vcPush, animated: true) + } +} + +// MARK: - TableView DataSource , Delegates + +extension CartListVC : TableViewSRC{ + func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -> Int { + return vm.cartListData.count + } + + func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell { + let cell = tableView.dequeueReusableCell(withIdentifier: K.CellIdentifier.Cart.cartListCell) as! CartListCell + let data = vm.cartListData[indexPath.row] + cell.setData(data: data) + cell.btnTapped = { [weak self] () -> Void in + guard let self else{return} + handleMoveToTrash(indexPath: indexPath.row) + } + return cell + } + + func tableView(_ tableView: UITableView,trailingSwipeActionsConfigurationForRowAt indexPath: IndexPath) -> UISwipeActionsConfiguration?{ + + // Trash action + let trash = UIContextualAction(style: .destructive,title: "Delete") { [weak self] (action, view, completionHandler) in + self?.handleMoveToTrash(indexPath: indexPath.row) + completionHandler(true) + } + trash.backgroundColor = UIColor.red + trash.image = UIImage(named: "DeleteIcon")?.withTintColor(UIColor.white) + + tableView.swipeGestureFont(font: FontCustom.shareInstance.customFont(fontName: .Exo2_Medium, size: 14)) + + let configuration = UISwipeActionsConfiguration(actions: [trash]) + // If you do not want an action to run with a full swipe + configuration.performsFirstActionWithFullSwipe = false + return configuration + } + + private func handleMoveToTrash(indexPath : Int) { + let sb = UIStoryboard(name: K.StoryBoard.customAlerts, bundle: nil) + let vcPush = sb.instantiateViewController(withIdentifier: K.StoryBoardID.CustomAlerts.yesNoAlertVC) as! YesNoAlertVC + vcPush.mainTitleText = "Alert!" + vcPush.contentLabel = "Are you sure you want to remove item from cart?" + vcPush.yesBtnText = "Remove" + vcPush.noBtnText = "Cancel" + vcPush.onDoneBlock = { [weak self] mode in + switch mode{ + case .yes: + guard let self else{return} + if let shopMasterID = vm.cartListData[indexPath].id{ + vm.removeItemFromCart(shopMasterID: shopMasterID, index: indexPath) + } + case .no: + print("no") + } + } + vcPush.modalPresentationStyle = .overCurrentContext + vcPush.modalTransitionStyle = .crossDissolve + self.present(vcPush, animated: true) + print(indexPath) + } +} diff --git a/WOKA/Cart/Controller/CartPaymentOptionsVC.swift b/WOKA/Cart/Controller/CartPaymentOptionsVC.swift new file mode 100644 index 0000000..48f7b89 --- /dev/null +++ b/WOKA/Cart/Controller/CartPaymentOptionsVC.swift @@ -0,0 +1,124 @@ +// +// CartPaymentOptionsVC.swift +// WOKA +// +// Created by MacBook Pro on 23/07/24. +// + +import UIKit + +class CartPaymentOptionsVC: UIViewController { + + @IBOutlet weak var cartTableView: UITableView! + @IBOutlet weak var cartTableHeight: NSLayoutConstraint! + @IBOutlet weak var couponTableView: UITableView! + @IBOutlet weak var couponTableHeght: NSLayoutConstraint! + @IBOutlet weak var confirmBtn: LocalisedElementsButton! + @IBOutlet weak var couponCodeTF: TextFieldShadow! + @IBOutlet weak var totalCartPrice: LocalisedElementsLabel! + @IBOutlet weak var scrollView: UIScrollView! + + @IBOutlet weak var couponAplliedStack: UIStackView! + @IBOutlet weak var subtotalPrice: LocalisedElementsLabel! + @IBOutlet weak var discountPrice: LocalisedElementsLabel! + + var vm = CartPaymentOptionsVM() + + override func viewDidLoad() { + super.viewDidLoad() + vm.vc = self + vm.initView() + navigationController?.navigationBar.setBackgroundImage(UIImage(), for: .default) + navigationController?.navigationBar.shadowImage = UIImage() + } + + override func viewDidLayoutSubviews() { + vm.updateCart() + } + + override func viewWillAppear(_ animated: Bool) { + super.viewWillAppear(animated) + navigationController?.setNavigationBarHidden(false, animated: animated) + } + + override func viewDidAppear(_ animated: Bool) { + self.navigationController?.setColor(color: .white) + + } + + override func viewWillDisappear(_ animated: Bool) { + super.viewWillDisappear(animated) + self.navigationController?.setNavigationBarHidden(true, animated: animated) + } + + override func viewDidDisappear(_ animated: Bool) { + super.viewDidDisappear(animated) + + // Customize the navigation bar's appearance + self.navigationController?.setColor(color: .black) + } + + @IBAction func offerCouponBtnTapped(_ sender: UIButton) { + vm.isExpanded.toggle() + + if vm.isExpanded{ + sender.setImage(UIImage(systemName: "chevron.down.circle.fill"), for: .normal) + self.couponTableView.isHidden = false + }else{ + sender.setImage(UIImage(systemName: "chevron.forward.circle.fill"), for: .normal) + self.couponTableView.isHidden = true + } + } + + @IBAction func confirmBtnTapped(_ sender: LocalisedElementsButton) { + } + + @IBAction func applyBtnTapped(_ sender: LocalisedElementsButton) { + if self.couponCodeTF.text == "" { + Utilities.alertWithBtn(title: "", msgBody: "Please enter coupon code", okBtnStr: "OK", vc: self) + return + } + vm.applyCoupon(code: self.couponCodeTF.text!) + } +} +// MARK: - TableView DataSource , Delegates + +extension CartPaymentOptionsVC : TableViewSRC{ + func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -> Int { + if tableView == cartTableView{ + return vm.cartListData.count + }else{ + return vm.couponData.count + } + } + + func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell { + if tableView == cartTableView{ + let cell = tableView.dequeueReusableCell(withIdentifier: K.CellIdentifier.Cart.cartPaymentOptionsCell) as! CartPaymentOptionsCell + let data = vm.cartListData[indexPath.row] + cell.setData(data: data) + return cell + }else{ + let cell = tableView.dequeueReusableCell(withIdentifier: K.CellIdentifier.Cart.couponCell) as! CouponCell + let data = vm.couponData[indexPath.row] + cell.setData(data: data) + return cell + } + } + + func tableView(_ tableView: UITableView, heightForRowAt indexPath: IndexPath) -> CGFloat { + if tableView == couponTableView{ + return 60 + }else{ + return UITableView.automaticDimension + } + } + + func tableView(_ tableView: UITableView, didSelectRowAt indexPath: IndexPath) { + if tableView == couponTableView{ + let couponCode = vm.couponData[indexPath.row].couponCode + self.couponCodeTF.text = couponCode + } + } +} + diff --git a/WOKA/Cart/Model/CartListingDM.swift b/WOKA/Cart/Model/CartListingDM.swift new file mode 100644 index 0000000..ba6d62a --- /dev/null +++ b/WOKA/Cart/Model/CartListingDM.swift @@ -0,0 +1,76 @@ +// +// CartListingDM.swift +// WOKA +// +// Created by MacBook Pro on 23/07/24. +// + +import Foundation + +// MARK: - CartListingDM +struct CartListingDM: Codable { + let result: [ResultData]? + let cartTotalAmount: String? + let cartQuantity, totalRecords: Int? + var totalAmount : Double + let userType: String? + let addressAvailable: Bool? + + enum CodingKeys: String, CodingKey { + case result + case cartTotalAmount = "cart_total_amount" + case totalAmount = "total_amount" + case cartQuantity = "cart_quantity" + case totalRecords = "total_records" + case userType = "user_type" + case addressAvailable = "address_available" + } + + + // MARK: - Result + struct ResultData: Codable { + let id: Int? + let skuID, productName: String? + let categoryMasterID, subCategoryMasterID: Int? + let productPrice: String? + let remainStockQuantity: Int? + let stockStatus: String? +// let taxCategory: JSONNull? + let taxValue: String? + let productQuantity: Int? + let shopMasterDetail: ShopMasterDetail? + let shopImage: [String]? + let productFinalPrice : Double? + enum CodingKeys: String, CodingKey { + case id + case skuID = "sku_id" + case productName = "product_name" + case categoryMasterID = "category_master_id" + case subCategoryMasterID = "sub_category_master_id" + case productPrice = "product_price" + case remainStockQuantity = "remain_stock_quantity" + case stockStatus = "stock_status" + case productFinalPrice = "product_final_price" +// case taxCategory = "tax_category" + case taxValue = "tax_value" + case productQuantity = "product_quantity" + case shopMasterDetail = "shop_master_detail" + case shopImage = "shop_image" + } + } + + // MARK: - ShopMasterDetail + struct ShopMasterDetail: Codable { + let id, productID: Int? + let productNameEnglish, productNameHindi, descriptionEnglish, descriptionHindi: String? + + enum CodingKeys: String, CodingKey { + case id + case productID = "product_id" + case productNameEnglish = "product_name_english" + case productNameHindi = "product_name_hindi" + case descriptionEnglish = "description_english" + case descriptionHindi = "description_hindi" + } + } +} diff --git a/WOKA/Cart/Model/CouponApplyDM.swift b/WOKA/Cart/Model/CouponApplyDM.swift new file mode 100644 index 0000000..f6e9a3d --- /dev/null +++ b/WOKA/Cart/Model/CouponApplyDM.swift @@ -0,0 +1,19 @@ +// +// CouponApplyDM.swift +// WOKA +// +// Created by MacBook Pro on 23/07/24. +// + +import Foundation + +// MARK: - CouponApplyDM +struct CouponApplyDM: Codable { + let cartTotalAmount, discountValue, cartDiscountedAmount: String? + + enum CodingKeys: String, CodingKey { + case cartTotalAmount = "cart_total_amount" + case discountValue = "discount_value" + case cartDiscountedAmount = "cart_discounted_amount" + } +} diff --git a/WOKA/Cart/Model/CouponListDM.swift b/WOKA/Cart/Model/CouponListDM.swift new file mode 100644 index 0000000..43c2de9 --- /dev/null +++ b/WOKA/Cart/Model/CouponListDM.swift @@ -0,0 +1,51 @@ +// +// CouponListDM.swift +// WOKA +// +// Created by MacBook Pro on 23/07/24. +// + +import Foundation + +// MARK: - CouponListDM +struct CouponListDM: Codable { + let result: [ResultData]? + let totalRecords: Int? + + enum CodingKeys: String, CodingKey { + case result + case totalRecords = "total_records" + } + + // MARK: - Result + struct ResultData: Codable { + let id: Int? + let couponCode: String? + let categoryMasterID, usageLimit, discountType: Int? + let discountValue, startFrom, endDate: String? + let category: Category? + + enum CodingKeys: String, CodingKey { + case id + case couponCode = "coupon_code" + case categoryMasterID = "category_master_id" + case usageLimit = "usage_limit" + case discountType = "discount_type" + case discountValue = "discount_value" + case startFrom = "start_from" + case endDate = "end_date" + case category + } + } + + // MARK: - Category + struct Category: Codable { + let id: Int? + let categoryName: String? + + enum CodingKeys: String, CodingKey { + case id + case categoryName = "category_name" + } + } +} diff --git a/WOKA/Cart/View/CartListCell.swift b/WOKA/Cart/View/CartListCell.swift new file mode 100644 index 0000000..155027d --- /dev/null +++ b/WOKA/Cart/View/CartListCell.swift @@ -0,0 +1,49 @@ +// +// CartListCell.swift +// WOKA +// +// Created by MacBook Pro on 23/07/24. +// + +import UIKit + +class CartListCell: UITableViewCell { + + @IBOutlet weak var productImage: UIImageView! + @IBOutlet weak var productTitle: LocalisedElementsLabel! + @IBOutlet weak var productStatus: LocalisedElementsLabel! + @IBOutlet weak var productPrice: LocalisedElementsLabel! + @IBOutlet weak var productQty: LocalisedElementsLabel! + + typealias btnTappedBlock = () -> Void // 0 - plus 1 - minus + var btnTapped : btnTappedBlock! + + override func awakeFromNib() { + super.awakeFromNib() + self.backgroundColor = .clear + // Initialization code + } + + override func setSelected(_ selected: Bool, animated: Bool) { + super.setSelected(selected, animated: animated) + + // Configure the view for the selected state + } + + func setData(data : CartListingDM.ResultData){ + self.productTitle.text = data.productName ?? "NA" + self.productStatus.text = "Product_Status: " + (data.stockStatus ?? "NA") + self.productPrice.text = data.productPrice ?? "Rs. 0" + self.productQty.text = "Quantity: " + (data.productQuantity?.toString() ?? "1") + + if let imageURL = data.shopImage?.first{ + self.productImage.imageURL(imageURL, color: UIColor.appColor(.TextDarkBlue)!) + } + } + + @IBAction func deleteBtnTapped(_ sender: UIButton) { + if btnTapped != nil { + btnTapped() + } + } +} diff --git a/WOKA/Cart/View/CartListCell.xib b/WOKA/Cart/View/CartListCell.xib new file mode 100644 index 0000000..9c8baf3 --- /dev/null +++ b/WOKA/Cart/View/CartListCell.xib @@ -0,0 +1,141 @@ + + + + + + + + + + + + + + Exo2-Bold + + + Exo2-Medium + + + Exo2-Regular + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/WOKA/Cart/View/CartPaymentOptionsCell.swift b/WOKA/Cart/View/CartPaymentOptionsCell.swift new file mode 100644 index 0000000..2c42fff --- /dev/null +++ b/WOKA/Cart/View/CartPaymentOptionsCell.swift @@ -0,0 +1,36 @@ +// +// CartPaymentOptionsCell.swift +// WOKA +// +// Created by MacBook Pro on 23/07/24. +// + +import UIKit + +class CartPaymentOptionsCell: UITableViewCell { + + @IBOutlet weak var productTitle: LocalisedElementsLabel! + @IBOutlet weak var productPrice: LocalisedElementsLabel! + @IBOutlet weak var productImage: UIImageView! + + override func awakeFromNib() { + super.awakeFromNib() + self.backgroundColor = .clear + // Initialization code + } + + override func setSelected(_ selected: Bool, animated: Bool) { + super.setSelected(selected, animated: animated) + + // Configure the view for the selected state + } + + func setData(data : CartListingDM.ResultData){ + self.productTitle.text = data.productName ?? "NA" + self.productPrice.text = K.ConstantString.rupeeSign + " " + (data.productFinalPrice?.toString() ?? "0.0") + + if let imageURL = data.shopImage?.first{ + self.productImage.imageURL(imageURL, color: UIColor.appColor(.TextDarkBlue)!) + } + } +} diff --git a/WOKA/Cart/View/CartPaymentOptionsCell.xib b/WOKA/Cart/View/CartPaymentOptionsCell.xib new file mode 100644 index 0000000..16187d4 --- /dev/null +++ b/WOKA/Cart/View/CartPaymentOptionsCell.xib @@ -0,0 +1,108 @@ + + + + + + + + + + + + + + Exo2-Bold + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/WOKA/Cart/View/CouponCell.swift b/WOKA/Cart/View/CouponCell.swift new file mode 100644 index 0000000..c0a6862 --- /dev/null +++ b/WOKA/Cart/View/CouponCell.swift @@ -0,0 +1,34 @@ +// +// CouponCell.swift +// WOKA +// +// Created by MacBook Pro on 23/07/24. +// + +import UIKit + +class CouponCell: UITableViewCell { + + @IBOutlet weak var couponText: LocalisedElementsLabel! + + override func awakeFromNib() { + super.awakeFromNib() + self.backgroundColor = .clear + // Initialization code + } + + override func setSelected(_ selected: Bool, animated: Bool) { + super.setSelected(selected, animated: animated) + + } + + func setData(data : CouponListDM.ResultData){ +// let double = data.discountValue?.toDouble() + + if data.discountType == 1{ // Percentage + self.couponText.text = (data.discountValue ?? "0.0") + "% Off with Coupon Code: " + (data.couponCode ?? "NA") + }else{ // Amount + self.couponText.text = K.ConstantString.rupeeSign + " " + (data.discountValue ?? "0.0") + " Off with Coupon Code: " + (data.couponCode ?? "NA") + } + } +} diff --git a/WOKA/Cart/View/CouponCell.xib b/WOKA/Cart/View/CouponCell.xib new file mode 100644 index 0000000..086936d --- /dev/null +++ b/WOKA/Cart/View/CouponCell.xib @@ -0,0 +1,73 @@ + + + + + + + + + + + + + Exo2-Bold + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/WOKA/Cart/ViewModel/CartListVM.swift b/WOKA/Cart/ViewModel/CartListVM.swift new file mode 100644 index 0000000..2b03cd4 --- /dev/null +++ b/WOKA/Cart/ViewModel/CartListVM.swift @@ -0,0 +1,166 @@ +// +// CartListVM.swift +// WOKA +// +// Created by MacBook Pro on 23/07/24. +// + +import UIKit +import Alamofire + +class CartListVM{ + + weak var vc : CartListVC! + var cartListData = [CartListingDM.ResultData]() + + var totalAmount = 0.0 { + didSet{ + vc.totalPrice.text = K.ConstantString.rupeeSign + " " + totalAmount.toString() + } + } + + let refreshControl = UIRefreshControl() + let feedbackGenerator = UIImpactFeedbackGenerator(style: .light) + + func initView(){ + setupCell() + Utilities.startProgressHUD() + getCartList() + addGradient() + + vc.tableView.indicatorStyle = .white + refreshControl.attributedTitle = NSAttributedString(string: "Refreshing...",attributes: [.foregroundColor: UIColor.appColor(.TextDarkBlue)!]) + refreshControl.tintColor = UIColor.appColor(.TextDarkBlue)! + refreshControl.addTarget(self, action: #selector(self.refresh(_:)), for: .valueChanged) + vc.tableView.addSubview(refreshControl) + } + + @objc func refresh(_ sender: AnyObject) { + self.getCartList() + } + + func addGradient(){ + self.vc.title = "MY CART".localized(loc: AuthFunc.shareInstance.languageSelected.rawValue) + let color1 = #colorLiteral(red: 0.6745098039, green: 0.6235294118, blue: 0.1725490196, alpha: 1) + let color2 = #colorLiteral(red: 0.5450980392, green: 0.6745098039, blue: 0.1725490196, alpha: 1) + + vc.view.applyGradient(colors: [color2, color1], startPoint: CGPoint(x: 0, y: 0), endPoint: CGPoint(x: 0.8, y: 0)) + } + + func setupCell(){ + vc.tableView.register(UINib(nibName: K.CellIdentifier.Cart.cartListCell, bundle: nil), forCellReuseIdentifier: K.CellIdentifier.Cart.cartListCell) + vc.tableView.delegate = vc.self + vc.tableView.dataSource = vc.self + } + // MARK: - Get SuperCategory + + func getCartList(){ + let headers : HTTPHeaders = ["access-token" : AuthFunc.shareInstance.getAccessToken()] + + NetworkManager.shareInstance.apiRequest(url: APIEndPoints.Cart.cart_listing, method: .get,headers: headers) { [weak self](result : Result, NetworkManager.APIError>) in + switch result{ + case .success(let data): + guard let self else{ + Utilities.dismissProgressHUD() + return + } + switch data.success{ + case 0: + /* + Error + */ + Utilities.dismissProgressHUD() + self.refreshControl.endRefreshing() + self.checkCount() + case 1: + Utilities.dismissProgressHUD() + self.refreshControl.endRefreshing() + totalAmount = data.data?.totalAmount ?? 0.0 + + guard let data = data.data?.result else{return} + self.cartListData = data + self.vc.tableView.reloadData() + feedbackGenerator.impactOccurred() + self.checkCount() + default: + Utilities.dismissProgressHUD() + break + } + case .failure(let error): + guard let self else{ + Utilities.dismissProgressHUD() + self?.refreshControl.endRefreshing() + return + } + Utilities.dismissProgressHUD() + self.refreshControl.endRefreshing() + self.checkCount() + Utilities.alertWithBtnCompletion(title: "Error", msgBody: error.localizedDescription, okBtnStr: "Retry?", vc: self.vc) { isDone in + if isDone{ + self.getCartList() + } + } + } + } + } + + func checkCount(){ + if self.cartListData.count == 0 { + self.vc.noDataStack.isHidden = false + self.vc.checkoutBtn.isEnabled = false + self.vc.checkoutBtn.backgroundColor = #colorLiteral(red: 0.03529411765, green: 0, blue: 0.3647058824, alpha: 1).withAlphaComponent(0.7) + } else{ + self.vc.noDataStack.isHidden = true + self.vc.checkoutBtn.isEnabled = true + self.vc.checkoutBtn.backgroundColor = #colorLiteral(red: 0.03529411765, green: 0, blue: 0.3647058824, alpha: 1) + } + } + + func removeItemFromCart(shopMasterID : Int, index : Int){ + Utilities.startProgressHUD() + let headers : HTTPHeaders = ["access-token" : AuthFunc.shareInstance.getAccessToken()] + let params : Parameters = ["shop_master_id" : shopMasterID] + NetworkManager.shareInstance.apiRequest(url: APIEndPoints.Cart.remove_cart, method: .post,parameters: params,headers: headers) { [weak self](result : Result, NetworkManager.APIError>) in + switch result{ + case .success(let data): + guard let self else{ + Utilities.dismissProgressHUD() + return + } + switch data.success{ + case 0: + /* + Error + */ + Utilities.dismissProgressHUD() + Utilities.alertWithBtnCompletion(title: "Error", msgBody: data.message ?? K.ConstantString.unRecognised, okBtnStr: "Retry?", vc: self.vc) { isDone in + if isDone{ + self.getCartList() + } + } + case 1: + Utilities.dismissProgressHUD() + self.totalAmount = self.totalAmount - (self.cartListData[index].productFinalPrice ?? 0.0) + self.cartListData.remove(at: index) + self.vc.tableView.reloadData() + self.checkCount() + default: + Utilities.dismissProgressHUD() + break + } + case .failure(let error): + guard let self else{ + Utilities.dismissProgressHUD() + return + } + Utilities.dismissProgressHUD() + self.refreshControl.endRefreshing() + Utilities.alertWithBtnCompletion(title: "Error", msgBody: error.localizedDescription, okBtnStr: "Retry?", vc: self.vc) { isDone in + if isDone{ + self.getCartList() + } + } + } + } + } +} diff --git a/WOKA/Cart/ViewModel/CartPaymentOptionsVM.swift b/WOKA/Cart/ViewModel/CartPaymentOptionsVM.swift new file mode 100644 index 0000000..c7ac674 --- /dev/null +++ b/WOKA/Cart/ViewModel/CartPaymentOptionsVM.swift @@ -0,0 +1,147 @@ +// +// CartPaymentOptionsVM.swift +// WOKA +// +// Created by MacBook Pro on 23/07/24. +// + +import UIKit +import Alamofire + +class CartPaymentOptionsVM{ + + weak var vc : CartPaymentOptionsVC! + var cartListData = [CartListingDM.ResultData]() + var couponData = [CouponListDM.ResultData]() + var isExpanded = false + var cartTotalPrice = 0.0 + + func initView(){ + vc.couponCodeTF.roundCorner() + addGradient() + vc.scrollView.indicatorStyle = .white + setupCell() + updateCart() + getCouponAndOffers() + } + + func setupCell(){ + vc.cartTableView.register(UINib(nibName: K.CellIdentifier.Cart.cartPaymentOptionsCell, bundle: nil), forCellReuseIdentifier: K.CellIdentifier.Cart.cartPaymentOptionsCell) + vc.cartTableView.delegate = vc.self + vc.cartTableView.dataSource = vc.self + + vc.couponTableView.register(UINib(nibName: K.CellIdentifier.Cart.couponCell, bundle: nil), forCellReuseIdentifier: K.CellIdentifier.Cart.couponCell) + vc.couponTableView.delegate = vc.self + vc.couponTableView.dataSource = vc.self + } + + func addGradient(){ + self.vc.title = "PAYMENT OPTIONS".localized(loc: AuthFunc.shareInstance.languageSelected.rawValue) + let color1 = #colorLiteral(red: 0.6745098039, green: 0.6235294118, blue: 0.1725490196, alpha: 1) + let color2 = #colorLiteral(red: 0.5450980392, green: 0.6745098039, blue: 0.1725490196, alpha: 1) + + vc.view.applyGradient(colors: [color2, color1], startPoint: CGPoint(x: 0, y: 0), endPoint: CGPoint(x: 0.8, y: 0)) + } + + func updateCart(){ + self.vc.cartTableView.reloadData() + self.vc.cartTableHeight.constant = self.vc.cartTableView.contentSize.height + 100 + self.vc.cartTableView.layoutIfNeeded() + self.vc.cartTableHeight.constant = self.vc.cartTableView.contentSize.height + + self.vc.totalCartPrice.text = K.ConstantString.rupeeSign + " " + self.cartTotalPrice.toString() + } + + // MARK: - Get SuperCategory + + func getCouponAndOffers(){ + let headers : HTTPHeaders = ["access-token" : AuthFunc.shareInstance.getAccessToken()] + + NetworkManager.shareInstance.apiRequest(url: APIEndPoints.Cart.coupon_listing, method: .get,headers: headers) { [weak self](result : Result, NetworkManager.APIError>) in + switch result{ + case .success(let data): + guard let self else{ + Utilities.dismissProgressHUD() + return + } + switch data.success{ + case 0: + /* + Error + */ + Utilities.dismissProgressHUD() + + case 1: + Utilities.dismissProgressHUD() + guard let data = data.data?.result else{return} + self.couponData = data + + self.vc.couponTableView.reloadData() + self.vc.couponTableHeght.constant = self.vc.couponTableView.contentSize.height + 100 + self.vc.couponTableView.layoutIfNeeded() + self.vc.couponTableHeght.constant = self.vc.couponTableView.contentSize.height + default: + Utilities.dismissProgressHUD() + break + } + case .failure(let error): + guard let self else{ + Utilities.dismissProgressHUD() + return + } + Utilities.dismissProgressHUD() + Utilities.alertWithBtnCompletion(title: "Error", msgBody: error.localizedDescription, okBtnStr: "Retry?", vc: self.vc) { isDone in + if isDone{ + self.getCouponAndOffers() + } + } + } + } + } + + func applyCoupon(code : String){ + let headers : HTTPHeaders = ["access-token" : AuthFunc.shareInstance.getAccessToken()] + let params : Parameters = ["coupon_code" : "", + "total_amount" : self.cartTotalPrice] + self.vc.couponAplliedStack.isHidden = true + + NetworkManager.shareInstance.apiRequest(url: APIEndPoints.Cart.applied_coupon_discount, method: .post,parameters: params,headers: headers) { [weak self](result : Result, NetworkManager.APIError>) in + switch result{ + case .success(let data): + guard let self else{ + Utilities.dismissProgressHUD() + return + } + switch data.success{ + case 0: + /* + Error + */ + Utilities.dismissProgressHUD() + + case 1: + Utilities.dismissProgressHUD() + guard let data = data.data else{return} + self.vc.subtotalPrice.text = data.cartTotalAmount + self.vc.discountPrice.text = data.discountValue + self.vc.totalCartPrice.text = data.cartDiscountedAmount + self.vc.couponAplliedStack.isHidden = false + default: + Utilities.dismissProgressHUD() + break + } + case .failure(let error): + guard let self else{ + Utilities.dismissProgressHUD() + return + } + Utilities.dismissProgressHUD() + Utilities.alertWithBtnCompletion(title: "Error", msgBody: error.localizedDescription, okBtnStr: "Retry?", vc: self.vc) { isDone in + if isDone{ + self.applyCoupon(code: self.vc.couponCodeTF.text ?? "") + } + } + } + } + } +} diff --git a/WOKA/Constants K/CellIdentifier.swift b/WOKA/Constants K/CellIdentifier.swift index 8fdfc83..fbe81f2 100644 --- a/WOKA/Constants K/CellIdentifier.swift +++ b/WOKA/Constants K/CellIdentifier.swift @@ -53,5 +53,11 @@ extension K{ static let shopListingCell = "ShopListingCell" static let shopProductsCell = "ShopProductsCell" } + + struct Cart{ + static let cartListCell = "CartListCell" + static let cartPaymentOptionsCell = "CartPaymentOptionsCell" + static let couponCell = "CouponCell" + } } } diff --git a/WOKA/Constants K/ConstantString.swift b/WOKA/Constants K/ConstantString.swift index 956890c..e594bae 100644 --- a/WOKA/Constants K/ConstantString.swift +++ b/WOKA/Constants K/ConstantString.swift @@ -31,5 +31,7 @@ extension K{ static let registerUser = "Please wait registering user." static let error = "Error" + + static let rupeeSign = "₹" } } diff --git a/WOKA/Constants K/StoryBoard.swift b/WOKA/Constants K/StoryBoard.swift index 73d7fc5..4d8a9c2 100644 --- a/WOKA/Constants K/StoryBoard.swift +++ b/WOKA/Constants K/StoryBoard.swift @@ -21,5 +21,6 @@ extension K{ static let Games = "Games" static let Karaoke = "Karaoke" static let shop = "Shop" + static let cart = "Cart" } } diff --git a/WOKA/Constants K/StoryBoardID.swift b/WOKA/Constants K/StoryBoardID.swift index e15cec2..0257154 100644 --- a/WOKA/Constants K/StoryBoardID.swift +++ b/WOKA/Constants K/StoryBoardID.swift @@ -98,5 +98,13 @@ extension K{ static let shopCategoryVC = "ShopCategoryVC" static let shopProductsVC = "ShopProductsVC" } + + // MARK: - Cart + + struct Cart{ + static let cartListVC = "CartListVC" + static let cartPaymentOptionsVC = "CartPaymentOptionsVC" + } + } } diff --git a/WOKA/Helpers/ActivityToast&Indicator/Utilities.swift b/WOKA/Helpers/ActivityToast&Indicator/Utilities.swift index bcdfa4d..c6d60d0 100644 --- a/WOKA/Helpers/ActivityToast&Indicator/Utilities.swift +++ b/WOKA/Helpers/ActivityToast&Indicator/Utilities.swift @@ -49,7 +49,7 @@ class Utilities{ var messageMutableString = NSMutableAttributedString() - messageMutableString = NSMutableAttributedString(string: msgBody as String, attributes: [NSAttributedString.Key.font:UIFont(name: "Nunito-Regular", size: 18)!]) + messageMutableString = NSMutableAttributedString(string: msgBody as String, attributes: [NSAttributedString.Key.font: FontCustom.shareInstance.customFont(fontName: .Exo2_Medium, size: 16)]) messageMutableString.addAttribute(NSAttributedString.Key.foregroundColor, value: UIColor.black, range: NSRange(location:0,length:msgBody.count)) alert.setValue(messageMutableString, forKey: "attributedMessage") diff --git a/WOKA/Helpers/LoadingIndicatorImageView.swift b/WOKA/Helpers/LoadingIndicatorImageView.swift index 0c41ead..1e098a6 100644 --- a/WOKA/Helpers/LoadingIndicatorImageView.swift +++ b/WOKA/Helpers/LoadingIndicatorImageView.swift @@ -26,8 +26,8 @@ extension UIImageView { activityIndicator.autoresizingMask = (UIView.AutoresizingMask(rawValue: UIView.AutoresizingMask.RawValue(UInt8(UIView.AutoresizingMask.flexibleRightMargin.rawValue) | UInt8(UIView.AutoresizingMask.flexibleLeftMargin.rawValue) | UInt8(UIView.AutoresizingMask.flexibleBottomMargin.rawValue) | UInt8(UIView.AutoresizingMask.flexibleTopMargin.rawValue)))) self.addSubview(activityIndicator) - // Timer.scheduledTimer(withTimeInterval: 1.5, repeats: false) { _ in +// self.sd_setImage(with: <#T##URL?#>, placeholderImage: <#T##UIImage?#>) self.sd_setImage(with: URL(string: url.replacingOccurrences(of: " ", with: "%20"))) { (image, error, cacheType, url) in activityIndicator.stopAnimating() } diff --git a/WOKA/Helpers/SwipeTableViewFont.swift b/WOKA/Helpers/SwipeTableViewFont.swift new file mode 100644 index 0000000..f4f1381 --- /dev/null +++ b/WOKA/Helpers/SwipeTableViewFont.swift @@ -0,0 +1,35 @@ +// +// SwipeTableViewFont.swift +// WOKA +// +// Created by MacBook Pro on 23/07/24. +// + +import UIKit + +extension UITableView{ + + func swipeGestureFont(font : UIFont){ + if #available(iOS 13.0, *) { + for subview in self.subviews { + if NSStringFromClass(type(of: subview)) == "_UITableViewCellSwipeContainerView" { + for swipeContainerSubview in subview.subviews { + if NSStringFromClass(type(of: swipeContainerSubview)) == "UISwipeActionPullView" { + for case let button as UIButton in swipeContainerSubview.subviews { + button.titleLabel?.font = font + } + } + } + } + } + } else { + for subview in self.subviews { + if NSStringFromClass(type(of: subview)) == "UISwipeActionPullView" { + for case let button as UIButton in subview.subviews { + button.titleLabel?.font = font + } + } + } + } + } +} diff --git a/WOKA/Network Adapter/APIEndPoints.swift b/WOKA/Network Adapter/APIEndPoints.swift index 92ceeeb..ffb8c52 100644 --- a/WOKA/Network Adapter/APIEndPoints.swift +++ b/WOKA/Network Adapter/APIEndPoints.swift @@ -109,6 +109,13 @@ struct APIEndPoints { static let sub_category_listing = makeURL(path: "sub_category_listing") static let shop_product_listing = makeURL(path: "shop_product_listing") } + + struct Cart{ + static let cart_listing = makeURL(path: "cart_listing") + static let remove_cart = makeURL(path: "remove_cart") + static let coupon_listing = makeURL(path: "coupon_listing") + static let applied_coupon_discount = makeURL(path: "applied_coupon_discount") + } // Other endpoint categories... struct Links { diff --git a/WOKA/SideBarNav/Controller/MyOrdersVC.swift b/WOKA/SideBarNav/Controller/MyOrdersVC.swift index 54630f6..76005b8 100644 --- a/WOKA/SideBarNav/Controller/MyOrdersVC.swift +++ b/WOKA/SideBarNav/Controller/MyOrdersVC.swift @@ -23,8 +23,9 @@ class MyOrdersVC: UIViewController { btn.badgeAnimation = true btn.setBadge(with: 1) btn.tapAction = { - // do something - print("tapped") + let sb = UIStoryboard(name: K.StoryBoard.cart, bundle: nil) + let vcPush = sb.instantiateViewController(withIdentifier: K.StoryBoardID.Cart.cartListVC) as! CartListVC + self.navigationController?.pushViewController(vcPush, animated: true) } self.navigationItem.rightBarButtonItem = btn diff --git a/WOKA/Theme/ViewModel/ThemeOneVM.swift b/WOKA/Theme/ViewModel/ThemeOneVM.swift index 0175957..f4be426 100644 --- a/WOKA/Theme/ViewModel/ThemeOneVM.swift +++ b/WOKA/Theme/ViewModel/ThemeOneVM.swift @@ -192,9 +192,12 @@ class ThemeOneVM{ vc.gamesView.addTapGesture { ViewButtonAnimation.sharedInstance.btnTapped(in: self.vc, view: self.vc.gamesView) { [weak self] in guard let self else{return} - let sb = UIStoryboard(name: K.StoryBoard.Games, bundle: nil) - let vcPush = sb.instantiateViewController(withIdentifier: K.StoryBoardID.Games.gamesListVC) as! GamesListVC - vc.navigationController?.pushViewController(vcPush, animated: true) +// let sb = UIStoryboard(name: K.StoryBoard.Games, bundle: nil) +// let vcPush = sb.instantiateViewController(withIdentifier: K.StoryBoardID.Games.gamesListVC) as! GamesListVC +// vc.navigationController?.pushViewController(vcPush, animated: true) + let sb = UIStoryboard(name: K.StoryBoard.cart, bundle: nil) + let vcPush = sb.instantiateViewController(withIdentifier: K.StoryBoardID.Cart.cartListVC) as! CartListVC + self.vc.navigationController?.pushViewController(vcPush, animated: true) } }