Преглед изворни кода

部分接口对接,数据展示调整

iOS-Abel пре 1 година
родитељ
комит
69b45b40df
39 измењених фајлова са 515 додато и 231 уклоњено
  1. 54 20
      Asteria.xcodeproj/project.pbxproj
  2. 1 1
      Asteria/AppDelegate.m
  3. 2 2
      Asteria/Fuction/Category/m/KWSearchSubTypeModel.h
  4. 4 4
      Asteria/Fuction/Category/m/KWSearchSubTypeModel.m
  5. 4 3
      Asteria/Fuction/Category/v/KWMoneyTypeHeadView.m
  6. 1 1
      Asteria/Fuction/Category/v/KWSearchMainTypeTableView.m
  7. 1 1
      Asteria/Fuction/Category/v/KWSearchSubTypeHeadView.m
  8. 6 5
      Asteria/Fuction/Category/v/KWSearchSubTypeTableView.m
  9. 0 22
      Asteria/Fuction/Category/vc/APCategoryViewController.h
  10. 0 87
      Asteria/Fuction/Category/vc/APCategoryViewController.m
  11. 27 51
      Asteria/Fuction/Category/vc/ASCategoryViewController.m
  12. 10 10
      Asteria/Fuction/Category/vc/KWSearchViewController.m
  13. 21 0
      Asteria/Fuction/Category/vm/ASCategoriesViewModel.h
  14. 57 0
      Asteria/Fuction/Category/vm/ASCategoriesViewModel.m
  15. 7 0
      Asteria/Fuction/UserCenter/ConponsAndGiftCard/ASCouponsListViewController.m
  16. 3 0
      Asteria/Fuction/UserCenter/ConponsAndGiftCard/v/ASCouponListCell.h
  17. 11 12
      Asteria/Fuction/UserCenter/ConponsAndGiftCard/v/ASCouponListCell.m
  18. 7 7
      Asteria/Fuction/UserCenter/Setting/ASInfomationSetController.m
  19. 1 0
      Asteria/Fuction/UserCenter/VipCenter/ASVipCenterViewController.m
  20. 26 0
      Asteria/Fuction/UserCenter/VipCenter/ASVipCouponModel.h
  21. 18 0
      Asteria/Fuction/UserCenter/VipCenter/ASVipCouponModel.m
  22. 2 0
      Asteria/Fuction/UserCenter/VipCenter/ASVipCouponsViewController.h
  23. 45 3
      Asteria/Fuction/UserCenter/VipCenter/ASVipCouponsViewController.m
  24. 23 0
      Asteria/Fuction/UserCenter/VipCenter/ASVipCouponsViewModel.h
  25. 74 0
      Asteria/Fuction/UserCenter/VipCenter/ASVipCouponsViewModel.m
  26. 29 0
      Asteria/Fuction/UserManager/currency/ASCurrencyManager.h
  27. 63 0
      Asteria/Fuction/UserManager/currency/ASCurrencyManager.m
  28. 0 0
      Asteria/Fuction/UserManager/info/ASUserInfoManager.h
  29. 0 1
      Asteria/Fuction/UserManager/ASUserInfoManager.m
  30. 0 0
      Asteria/Fuction/UserManager/info/ASUserModel.h
  31. 0 0
      Asteria/Fuction/UserManager/info/ASUserModel.m
  32. 0 0
      Asteria/Fuction/UserManager/info/ASVipModel.h
  33. 0 0
      Asteria/Fuction/UserManager/info/ASVipModel.m
  34. 0 0
      Asteria/Fuction/UserManager/info/ASVipUrlTempModel.h
  35. 0 0
      Asteria/Fuction/UserManager/info/ASVipUrlTempModel.m
  36. 9 0
      Asteria/NetTools/ASNetApis.h
  37. 8 0
      Asteria/NetTools/ASUserNotifyStatic.h
  38. 1 0
      Asteria/PreFixHeader.h
  39. 0 1
      Asteria/Tabber/AS_TabBarViewController.m

+ 54 - 20
Asteria.xcodeproj/project.pbxproj

@@ -89,8 +89,6 @@
 		81717D102A3C4AE000648139 /* KWHisAndHotWordsViewModel.m in Sources */ = {isa = PBXBuildFile; fileRef = 81717CE62A3C4ADE00648139 /* KWHisAndHotWordsViewModel.m */; };
 		81717D112A3C4AE000648139 /* KWSearchViewModel.m in Sources */ = {isa = PBXBuildFile; fileRef = 81717CE72A3C4ADE00648139 /* KWSearchViewModel.m */; };
 		81717D122A3C4AE000648139 /* APOnlySearchViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 81717CEB2A3C4ADE00648139 /* APOnlySearchViewController.m */; };
-		81717D132A3C4AE000648139 /* KWSearchViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 81717CEF2A3C4ADE00648139 /* KWSearchViewController.m */; };
-		81717D142A3C4AE000648139 /* APCategoryViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 81717CF02A3C4ADE00648139 /* APCategoryViewController.m */; };
 		81717D1C2A3C4AE000648139 /* KWSearchSubTypeModel.m in Sources */ = {isa = PBXBuildFile; fileRef = 81717D022A3C4ADF00648139 /* KWSearchSubTypeModel.m */; };
 		81717D1D2A3C4AE000648139 /* KWSearchSubTypeHeadView.m in Sources */ = {isa = PBXBuildFile; fileRef = 81717D042A3C4AE000648139 /* KWSearchSubTypeHeadView.m */; };
 		81717D1E2A3C4AE000648139 /* KWSearchMainTypeTableView.m in Sources */ = {isa = PBXBuildFile; fileRef = 81717D062A3C4AE000648139 /* KWSearchMainTypeTableView.m */; };
@@ -118,6 +116,11 @@
 		8186564D2A5BF6010049D861 /* ASCategoryViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 8186564C2A5BF6010049D861 /* ASCategoryViewController.m */; };
 		81932E2B29F7539B007C37AF /* UIColor+AS.m in Sources */ = {isa = PBXBuildFile; fileRef = 81932E2A29F7539B007C37AF /* UIColor+AS.m */; };
 		819900222A020A6F006FE68C /* LYTools.m in Sources */ = {isa = PBXBuildFile; fileRef = 819900212A020A6F006FE68C /* LYTools.m */; };
+		81AA11D02B23EA15008EB5C7 /* ASVipCouponsViewModel.m in Sources */ = {isa = PBXBuildFile; fileRef = 81AA11CF2B23EA15008EB5C7 /* ASVipCouponsViewModel.m */; };
+		81AA11D32B23EC20008EB5C7 /* ASVipCouponModel.m in Sources */ = {isa = PBXBuildFile; fileRef = 81AA11D22B23EC20008EB5C7 /* ASVipCouponModel.m */; };
+		81AA11D62B23FEF8008EB5C7 /* KWSearchViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 81AA11D52B23FEF8008EB5C7 /* KWSearchViewController.m */; };
+		81AA11D92B23FF1F008EB5C7 /* ASCategoriesViewModel.m in Sources */ = {isa = PBXBuildFile; fileRef = 81AA11D82B23FF1F008EB5C7 /* ASCategoriesViewModel.m */; };
+		81AA11DC2B23FF71008EB5C7 /* ASCurrencyManager.m in Sources */ = {isa = PBXBuildFile; fileRef = 81AA11DB2B23FF71008EB5C7 /* ASCurrencyManager.m */; };
 		81BEA6832A2D7CF3009D36C4 /* UITableView+ASBase.m in Sources */ = {isa = PBXBuildFile; fileRef = 81BEA6822A2D7CF3009D36C4 /* UITableView+ASBase.m */; };
 		81C3265F2A36B284002EF442 /* ASProductListViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 81C3265E2A36B284002EF442 /* ASProductListViewController.m */; };
 		81C326622A36B33B002EF442 /* ASHomeActiveView.m in Sources */ = {isa = PBXBuildFile; fileRef = 81C326612A36B33B002EF442 /* ASHomeActiveView.m */; };
@@ -413,11 +416,7 @@
 		81717CE82A3C4ADE00648139 /* KWSearchViewModel.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = KWSearchViewModel.h; sourceTree = "<group>"; };
 		81717CE92A3C4ADE00648139 /* KWHisAndHotWordsViewModel.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = KWHisAndHotWordsViewModel.h; sourceTree = "<group>"; };
 		81717CEB2A3C4ADE00648139 /* APOnlySearchViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = APOnlySearchViewController.m; sourceTree = "<group>"; };
-		81717CEC2A3C4ADE00648139 /* APCategoryViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = APCategoryViewController.h; sourceTree = "<group>"; };
-		81717CED2A3C4ADE00648139 /* KWSearchViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = KWSearchViewController.h; sourceTree = "<group>"; };
 		81717CEE2A3C4ADE00648139 /* APOnlySearchViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = APOnlySearchViewController.h; sourceTree = "<group>"; };
-		81717CEF2A3C4ADE00648139 /* KWSearchViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = KWSearchViewController.m; sourceTree = "<group>"; };
-		81717CF02A3C4ADE00648139 /* APCategoryViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = APCategoryViewController.m; sourceTree = "<group>"; };
 		81717D012A3C4ADF00648139 /* KWSearchSubTypeModel.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = KWSearchSubTypeModel.h; sourceTree = "<group>"; };
 		81717D022A3C4ADF00648139 /* KWSearchSubTypeModel.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = KWSearchSubTypeModel.m; sourceTree = "<group>"; };
 		81717D042A3C4AE000648139 /* KWSearchSubTypeHeadView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = KWSearchSubTypeHeadView.m; sourceTree = "<group>"; };
@@ -471,6 +470,16 @@
 		8199001E2A0206F7006FE68C /* SizeDefine.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = SizeDefine.h; sourceTree = "<group>"; };
 		819900202A020A6F006FE68C /* LYTools.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = LYTools.h; sourceTree = "<group>"; };
 		819900212A020A6F006FE68C /* LYTools.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = LYTools.m; sourceTree = "<group>"; };
+		81AA11CE2B23EA15008EB5C7 /* ASVipCouponsViewModel.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = ASVipCouponsViewModel.h; sourceTree = "<group>"; };
+		81AA11CF2B23EA15008EB5C7 /* ASVipCouponsViewModel.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = ASVipCouponsViewModel.m; sourceTree = "<group>"; };
+		81AA11D12B23EC20008EB5C7 /* ASVipCouponModel.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = ASVipCouponModel.h; sourceTree = "<group>"; };
+		81AA11D22B23EC20008EB5C7 /* ASVipCouponModel.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = ASVipCouponModel.m; sourceTree = "<group>"; };
+		81AA11D42B23FEF7008EB5C7 /* KWSearchViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = KWSearchViewController.h; sourceTree = "<group>"; };
+		81AA11D52B23FEF8008EB5C7 /* KWSearchViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = KWSearchViewController.m; sourceTree = "<group>"; };
+		81AA11D72B23FF1F008EB5C7 /* ASCategoriesViewModel.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = ASCategoriesViewModel.h; sourceTree = "<group>"; };
+		81AA11D82B23FF1F008EB5C7 /* ASCategoriesViewModel.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = ASCategoriesViewModel.m; sourceTree = "<group>"; };
+		81AA11DA2B23FF71008EB5C7 /* ASCurrencyManager.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = ASCurrencyManager.h; sourceTree = "<group>"; };
+		81AA11DB2B23FF71008EB5C7 /* ASCurrencyManager.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = ASCurrencyManager.m; sourceTree = "<group>"; };
 		81BEA6812A2D7CF3009D36C4 /* UITableView+ASBase.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "UITableView+ASBase.h"; sourceTree = "<group>"; };
 		81BEA6822A2D7CF3009D36C4 /* UITableView+ASBase.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = "UITableView+ASBase.m"; sourceTree = "<group>"; };
 		81C3265D2A36B284002EF442 /* ASProductListViewController.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = ASProductListViewController.h; sourceTree = "<group>"; };
@@ -762,14 +771,8 @@
 		812021122B14657D0026B8B5 /* UserManager */ = {
 			isa = PBXGroup;
 			children = (
-				812021132B14659A0026B8B5 /* ASUserInfoManager.h */,
-				812021142B14659A0026B8B5 /* ASUserInfoManager.m */,
-				812021162B1467410026B8B5 /* ASUserModel.h */,
-				812021172B1467410026B8B5 /* ASUserModel.m */,
-				812021192B15F03B0026B8B5 /* ASVipModel.h */,
-				8120211A2B15F03B0026B8B5 /* ASVipModel.m */,
-				8120211C2B15F2B30026B8B5 /* ASVipUrlTempModel.h */,
-				8120211D2B15F2B30026B8B5 /* ASVipUrlTempModel.m */,
+				81AA11DD2B23FF8B008EB5C7 /* info */,
+				81AA11DE2B23FF93008EB5C7 /* currency */,
 			);
 			path = UserManager;
 			sourceTree = "<group>";
@@ -1052,6 +1055,8 @@
 				81717CE62A3C4ADE00648139 /* KWHisAndHotWordsViewModel.m */,
 				81717CE82A3C4ADE00648139 /* KWSearchViewModel.h */,
 				81717CE72A3C4ADE00648139 /* KWSearchViewModel.m */,
+				81AA11D72B23FF1F008EB5C7 /* ASCategoriesViewModel.h */,
+				81AA11D82B23FF1F008EB5C7 /* ASCategoriesViewModel.m */,
 			);
 			path = vm;
 			sourceTree = "<group>";
@@ -1061,10 +1066,8 @@
 			children = (
 				81717CEE2A3C4ADE00648139 /* APOnlySearchViewController.h */,
 				81717CEB2A3C4ADE00648139 /* APOnlySearchViewController.m */,
-				81717CEC2A3C4ADE00648139 /* APCategoryViewController.h */,
-				81717CF02A3C4ADE00648139 /* APCategoryViewController.m */,
-				81717CED2A3C4ADE00648139 /* KWSearchViewController.h */,
-				81717CEF2A3C4ADE00648139 /* KWSearchViewController.m */,
+				81AA11D42B23FEF7008EB5C7 /* KWSearchViewController.h */,
+				81AA11D52B23FEF8008EB5C7 /* KWSearchViewController.m */,
 				818656482A5BE9790049D861 /* ASSearchViewController.h */,
 				818656492A5BE9790049D861 /* ASSearchViewController.m */,
 				8186564B2A5BF6010049D861 /* ASCategoryViewController.h */,
@@ -1183,6 +1186,30 @@
 			path = Tools;
 			sourceTree = "<group>";
 		};
+		81AA11DD2B23FF8B008EB5C7 /* info */ = {
+			isa = PBXGroup;
+			children = (
+				812021132B14659A0026B8B5 /* ASUserInfoManager.h */,
+				812021142B14659A0026B8B5 /* ASUserInfoManager.m */,
+				812021162B1467410026B8B5 /* ASUserModel.h */,
+				812021172B1467410026B8B5 /* ASUserModel.m */,
+				812021192B15F03B0026B8B5 /* ASVipModel.h */,
+				8120211A2B15F03B0026B8B5 /* ASVipModel.m */,
+				8120211C2B15F2B30026B8B5 /* ASVipUrlTempModel.h */,
+				8120211D2B15F2B30026B8B5 /* ASVipUrlTempModel.m */,
+			);
+			path = info;
+			sourceTree = "<group>";
+		};
+		81AA11DE2B23FF93008EB5C7 /* currency */ = {
+			isa = PBXGroup;
+			children = (
+				81AA11DA2B23FF71008EB5C7 /* ASCurrencyManager.h */,
+				81AA11DB2B23FF71008EB5C7 /* ASCurrencyManager.m */,
+			);
+			path = currency;
+			sourceTree = "<group>";
+		};
 		81C326632A36B6D9002EF442 /* TextRollIngView */ = {
 			isa = PBXGroup;
 			children = (
@@ -1416,6 +1443,10 @@
 				81E5EE8F2A498FC90075695F /* ASVipCenterViewController.m */,
 				81C796222A4FD63A003083B8 /* ASVipCouponsViewController.h */,
 				81C796232A4FD63A003083B8 /* ASVipCouponsViewController.m */,
+				81AA11CE2B23EA15008EB5C7 /* ASVipCouponsViewModel.h */,
+				81AA11CF2B23EA15008EB5C7 /* ASVipCouponsViewModel.m */,
+				81AA11D12B23EC20008EB5C7 /* ASVipCouponModel.h */,
+				81AA11D22B23EC20008EB5C7 /* ASVipCouponModel.m */,
 				81C796252A4FD898003083B8 /* ASBirthdayTreatViewController.h */,
 				81C796262A4FD898003083B8 /* ASBirthdayTreatViewController.m */,
 				81E5EE912A4A75DF0075695F /* Views */,
@@ -2129,7 +2160,9 @@
 				9A337E4E2A04F46600D058A5 /* AViewController.m in Sources */,
 				81601FFA2A2DC78300E4A8F1 /* WMZBannerFadeLayout.m in Sources */,
 				816020182A2F070B00E4A8F1 /* ASHomeCategoryModel.m in Sources */,
+				81AA11D92B23FF1F008EB5C7 /* ASCategoriesViewModel.m in Sources */,
 				8134C1B72A1359E6006EB0EC /* ASSignDayView.m in Sources */,
+				81AA11D32B23EC20008EB5C7 /* ASVipCouponModel.m in Sources */,
 				81601FF72A2DC78300E4A8F1 /* WMZBannerParam.m in Sources */,
 				81717CA22A3C0A3500648139 /* KWProductMenuFilterView.m in Sources */,
 				9AD346112A08D60F005CA070 /* ZFPlayerControlView.m in Sources */,
@@ -2162,6 +2195,7 @@
 				81354C0A2A289C350082C93A /* KWScrollOffsetView.m in Sources */,
 				81354C032A289A070082C93A /* HomeFilterModel.m in Sources */,
 				81717CAB2A3C359E00648139 /* ASProductlistFilterPriceCollectCell.m in Sources */,
+				81AA11D02B23EA15008EB5C7 /* ASVipCouponsViewModel.m in Sources */,
 				81717D352A3D322700648139 /* KWHisKeyWordCell.m in Sources */,
 				9AD364D12A05EC7800452C7A /* AS_TabBarViewController.m in Sources */,
 				9AD345FB2A08D60F005CA070 /* ZFOrientationObserver.m in Sources */,
@@ -2182,11 +2216,11 @@
 				9A1247942A1B082300126226 /* Fuction_Tool.m in Sources */,
 				81E5EE942A4A760D0075695F /* ASVipCenterLineItemView.m in Sources */,
 				81601FFF2A2DC8E700E4A8F1 /* ASHomeBannerCell.m in Sources */,
-				81717D132A3C4AE000648139 /* KWSearchViewController.m in Sources */,
 				812021212B16CD630026B8B5 /* ASSginViewModel.m in Sources */,
 				81CE28972AF4953C0012AA45 /* ASGiftCardModel.m in Sources */,
 				9AD6A5442A1218E8001DE3D9 /* PassWordSecureBtnV.m in Sources */,
 				811F42462A40533C00DA68F1 /* ASPointsHomeViewController.m in Sources */,
+				81AA11D62B23FEF8008EB5C7 /* KWSearchViewController.m in Sources */,
 				816D0C9A2AF3901C00395B5B /* ASGiftCardListViewController.m in Sources */,
 				81C796372A5517B0003083B8 /* ASSettingListCell.m in Sources */,
 				81717D392A3D322700648139 /* KWCustomLayout.m in Sources */,
@@ -2208,7 +2242,6 @@
 				812021252B185A610026B8B5 /* ASCouponsListViewModel.m in Sources */,
 				9AD345FE2A08D60F005CA070 /* UIScrollView+ZFPlayer.m in Sources */,
 				9A65DE512A132FB700BB1269 /* LoginThirdAuthV.m in Sources */,
-				81717D142A3C4AE000648139 /* APCategoryViewController.m in Sources */,
 				9A788C442A08A663003E0025 /* Target_Goods.m in Sources */,
 				81EC47692A33073100516573 /* ASHomeNewInProductItemView.m in Sources */,
 				81717D212A3C4AE000648139 /* KWSearchSubTypeTableView.m in Sources */,
@@ -2239,6 +2272,7 @@
 				9AD346122A08D60F005CA070 /* ZFSmallFloatControlView.m in Sources */,
 				81EC47752A3423FC00516573 /* ASHomeLookingCell.m in Sources */,
 				9AD3460E2A08D60F005CA070 /* ZFNetworkSpeedMonitor.m in Sources */,
+				81AA11DC2B23FF71008EB5C7 /* ASCurrencyManager.m in Sources */,
 				9AD346052A08D60F005CA070 /* ZFLandscapeViewController.m in Sources */,
 				81717D222A3C4AE000648139 /* KWSearchMainTypeCell.m in Sources */,
 				81DFA5672A46D60900DA708B /* ASPointDetailViewController.m in Sources */,

+ 1 - 1
Asteria/AppDelegate.m

@@ -26,7 +26,7 @@
     } else {
         // Fallback on earlier versions
     }
-    
+    [ASCurrencyManager.shared getAllCurrencyData];
 //    [self xxx_ytkNetConfig];
     [PPNetworkHelper openLog];
     self.window = [[UIWindow alloc] initWithFrame:UIScreen.mainScreen.bounds];

+ 2 - 2
Asteria/Fuction/Category/m/KWSearchSubTypeModel.h

@@ -27,7 +27,7 @@ NS_ASSUME_NONNULL_BEGIN
 @property (nonatomic, copy) NSString *Id;
 @property (nonatomic, copy) NSString *thumbnail_url;
 @property (nonatomic, assign) BOOL isOpen;
-@property (nonatomic, strong) NSArray<KWSearchSubTypeModel *>*children;
+@property (nonatomic, strong) NSArray<KWSearchSubTypeModel *>* children_data;
 
 @property (nonatomic, assign) BOOL isMoneyType;
 
@@ -40,7 +40,7 @@ NS_ASSUME_NONNULL_BEGIN
 @property (nonatomic, copy) NSString *title;
 @property (nonatomic, copy) NSString *Id;
 @property (nonatomic, copy) NSString *thumbnail_url;
-@property (nonatomic, strong) NSArray<KWSubTypeSectionModel *>*children;
+@property (nonatomic, strong) NSArray<KWSubTypeSectionModel *>*children_data;
 
 @property (nonatomic, assign) BOOL isMoneyType;
 

+ 4 - 4
Asteria/Fuction/Category/m/KWSearchSubTypeModel.m

@@ -40,7 +40,7 @@
     for (int i = 0; i<arc4random()%20; i++) {
         [tempArr addObject:[KWSearchSubTypeModel demoData]];
     }
-    m.children = tempArr;
+    m.children_data = tempArr;
     return m;
 }
 
@@ -56,7 +56,7 @@
     
     return @{
         
-        @"children" : [KWSearchSubTypeModel class],
+        @"children_data" : [KWSearchSubTypeModel class],
         
     };
     
@@ -78,7 +78,7 @@
     for (int i = 0; i<arc4random()%20; i++) {
         [tempArr addObject:[KWSubTypeSectionModel demoData]];
     }
-    m.children = tempArr;
+    m.children_data = tempArr;
     return m;
 }
 
@@ -87,7 +87,7 @@
     
     return @{
         
-        @"children" : [KWSubTypeSectionModel class],
+        @"children_data" : [KWSubTypeSectionModel class],
         
     };
     

+ 4 - 3
Asteria/Fuction/Category/v/KWMoneyTypeHeadView.m

@@ -20,10 +20,11 @@
 @implementation KWMoneyTypeHeadView
 
 - (void)setData:(KWSubTypeSectionModel *)m isSelect:(BOOL)isSelect {
-    self.titleLb.text = m.Id;
-    self.typeImgV.image = [UIImage imageNamed:m.Id];
+    self.titleLb.text = m.title;
+    self.typeImgV.image = [UIImage imageNamed:m.title];
     self.imgV.hidden = !isSelect;
     self.contentView.backgroundColor = isSelect ? Col_000 : Col_FFF;
+    self.titleLb.textColor = isSelect ? Col_FFF : _0B0B0B;
     
     
 }
@@ -90,7 +91,7 @@
     if (!_titleLb) {
         UILabel *lb = [[UILabel alloc] init];
         lb.font = [UIFont fontWithName:Rob_Bold size:12];
-        lb.textColor = [UIColor colorWithHexString:@"#0b0b0b"];
+        lb.textColor = _0B0B0B;
         lb.textAlignment = NSTextAlignmentLeft;
         lb.backgroundColor = [UIColor clearColor];
         lb.numberOfLines = 0;

+ 1 - 1
Asteria/Fuction/Category/v/KWSearchMainTypeTableView.m

@@ -48,7 +48,7 @@
     if (self.callBack) {
         self.callBack();
         KWMainTypeModel *tempM = self.arr[indexPath.row];
-        if (tempM.children.count == 0) {
+        if (tempM.children_data.count == 0) {
             self.selectIndex = tempSelect;
         }
     }

+ 1 - 1
Asteria/Fuction/Category/v/KWSearchSubTypeHeadView.m

@@ -29,7 +29,7 @@
     } else {
         self.imgV.image = [UIImage imageNamed:@"search_hadMore"];
     }
-    self.imgV.hidden = m.children.count == 0;
+    self.imgV.hidden = m.children_data.count == 0;
 }
 
 - (instancetype)initWithReuseIdentifier:(NSString *)reuseIdentifier {

+ 6 - 5
Asteria/Fuction/Category/v/KWSearchSubTypeTableView.m

@@ -56,12 +56,12 @@
 
 - (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section {
     KWSubTypeSectionModel * m = self.arr[section];
-    return m.isOpen ? m.children.count : 0;
+    return m.isOpen ? m.children_data.count : 0;
 }
 
 - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {
     KWSearchSubTypeCell *cell = [tableView dequeueReusableCellWithIdentifier:@"KWSearchSubTypeCell" forIndexPath:indexPath];
-    KWSearchSubTypeModel *tempM = self.arr[indexPath.section].children[indexPath.row];
+    KWSearchSubTypeModel *tempM = self.arr[indexPath.section].children_data[indexPath.row];
     [cell setData:tempM];
     return  cell;
 }
@@ -74,10 +74,11 @@
     KWSubTypeSectionModel *tempM = self.arr[section];
     if (tempM.isMoneyType) {
         KWMoneyTypeHeadView *vi = [tableView dequeueReusableHeaderFooterViewWithIdentifier:@"KWMoneyTypeHeadView"];
-        [vi setData:tempM isSelect:tempM.isOpen];
+        BOOL isSel = [tempM.title isEqualToString:ASCurrencyManager.shared.currentCur];
+        [vi setData:tempM isSelect: isSel];
         @weakify(self);
         [vi setCallBack:^{
-            if (tempM.isOpen) {
+            if (isSel) {
                 return;
             }
             if (weak_self.callBackSection) {
@@ -92,7 +93,7 @@
     @weakify(self);
     v.callBack = ^{
         KWSubTypeSectionModel *m = weak_self.arr[section];
-        if (m.children.count == 0) {
+        if (m.children_data.count == 0) {
             if (weak_self.callBackSection) {
                 weak_self.callBackSection(section);
             }

+ 0 - 22
Asteria/Fuction/Category/vc/APCategoryViewController.h

@@ -1,22 +0,0 @@
-//
-//  APCategoryViewController.h
-//  westkissMob
-//
-//  Created by iOS on 2023/5/27.
-//
-
-#import "KWSearchViewController.h"
-
-NS_ASSUME_NONNULL_BEGIN
-
-@interface APCategoryViewController : KWSearchViewController
-
-
-- (void)showAction;
-
-
-- (void)closeAction;
-
-@end
-
-NS_ASSUME_NONNULL_END

+ 0 - 87
Asteria/Fuction/Category/vc/APCategoryViewController.m

@@ -1,87 +0,0 @@
-//
-//  APCategoryViewController.m
-//  westkissMob
-//
-//  Created by iOS on 2023/5/27.
-//
-
-#import "APCategoryViewController.h"
-
-@interface APCategoryViewController ()
-
-@property (nonatomic, strong) UIButton *closeBt;
-@property (nonatomic, strong) UILabel *titleLB;
-
-@end
-
-@implementation APCategoryViewController
-
-- (void)viewDidLoad {
-    [super viewDidLoad];
-    
-    self.searchTf.hidden = true;
-    
-    [self.topV addSubview:self.closeBt];
-    [self.closeBt mas_makeConstraints:^(MASConstraintMaker *make) {
-        make.bottom.equalTo(self.topV).offset(-10);
-        make.right.equalTo(self.topV).offset(-22);
-        make.width.height.equalTo(@40);
-    }];
-    
-    [self.topV addSubview:self.titleLB];
-    [self.titleLB mas_makeConstraints:^(MASConstraintMaker *make) {
-        make.width.equalTo(@130);
-        make.height.equalTo(@40);
-        make.centerX.equalTo(self.topV);
-        make.bottom.equalTo(self.topV).offset(-10);
-    }];
-    
-    
-}
-
-- (void)showAction {
-    self.view.frame = CGRectMake(-SCREEN_WIDTH, 0, SCREEN_WIDTH, SCREEN_HEIGHT);
-    self.view.hidden = false;
-    [UIView animateWithDuration:0.24 animations:^{
-        self.view.frame = CGRectMake(0, 0, SCREEN_WIDTH, SCREEN_HEIGHT);
-    } completion:^(BOOL finished) {
-        self.view.frame = CGRectMake(0, 0, SCREEN_WIDTH, SCREEN_HEIGHT);
-    }];
-}
-
-
-- (void)closeAction {
-    self.view.frame = CGRectMake(0, 0, SCREEN_WIDTH, SCREEN_HEIGHT);
-    [UIView animateWithDuration:0.24 animations:^{
-        self.view.frame = CGRectMake(-SCREEN_WIDTH, 0, SCREEN_WIDTH, SCREEN_HEIGHT);
-    } completion:^(BOOL finished) {
-        self.view.frame = CGRectMake(-SCREEN_WIDTH, 0, SCREEN_WIDTH, SCREEN_HEIGHT);
-        self.view.hidden = true;
-    }];
-}
-
-- (UIButton *)closeBt {
-    if (!_closeBt) {
-        UIButton *bt = [UIButton buttonWithType:UIButtonTypeCustom];
-        [bt setImage:[UIImage imageNamed:@"productLsit_filter_close"] forState:UIControlStateNormal];
-        [bt addTarget:self action:@selector(closeAction) forControlEvents:UIControlEventTouchUpInside];
-        _closeBt = bt;
-    }
-    return _closeBt;
-}
-
-
-- (UILabel *)titleLB {
-    if (!_titleLB) {
-        UILabel *lb = [[UILabel alloc] init];
-        lb.text = @"MENU";
-        lb.textColor = UIColor.blackColor;
-        lb.font = [UIFont fontWithName:Rob_Regular size:20];
-        lb.textAlignment = NSTextAlignmentCenter;
-        _titleLB = lb;
-    }
-    return _titleLB;
-}
-
-
-@end

+ 27 - 51
Asteria/Fuction/Category/vc/ASCategoryViewController.m

@@ -8,9 +8,12 @@
 #import "ASCategoryViewController.h"
 #import "KWSearchMainTypeTableView.h"
 #import "KWSearchSubTypeTableView.h"
+#import "ASCategoriesViewModel.h"
 
 @interface ASCategoryViewController ()
 
+@property (nonatomic, strong) ASCategoriesViewModel *vm;
+
 @property (nonatomic, strong) KWSearchMainTypeTableView *leftTableV;
 @property (nonatomic, strong) KWSearchSubTypeTableView *rightTableV;
 @property (nonatomic, strong) UIView *bottomV;
@@ -21,43 +24,29 @@
 
 - (void)viewDidLoad {
     [super viewDidLoad];
+    self.vm = [ASCategoriesViewModel new];
     [self loadSubVs];
     
     
-    NSMutableArray<KWMainTypeModel *> *tempArr = [NSMutableArray array];
-    for (int i = 0; i<8; i++) {
-        [tempArr addObject:[KWMainTypeModel demoData]];
-    }
-    
-    NSMutableArray *subArr = [[NSMutableArray alloc] init];
-    
-    
-    for (NSString *dic in @[@"AUD",@"CAD",@"EUR",@"GBP",@"USD",@"ZAR"]) {
-        NSString *name = dic;
-        NSString *short_name = dic;
-        NSNumber *status =[NSNumber numberWithBool:[dic isEqualToString:@"USD"]];
-        
-        KWSubTypeSectionModel *m = [[KWSubTypeSectionModel alloc] init];
-        m.Id = short_name;
-        m.title = name;
-        m.isOpen = status.boolValue;
-        m.isMoneyType = true;
-        m.children = [[NSMutableArray alloc] init];
-        [subArr addObject:m];
-    }
-    
-    KWMainTypeModel *model = [KWMainTypeModel new];
-    model.title = @"CURRENCY";
-    model.isMoneyType = true;
-    model.children = subArr;
-    [tempArr addObject:model];
-    _leftTableV.arr = tempArr;
-    _rightTableV.arr = tempArr.firstObject.children;
-    [_leftTableV reloadData];
-    [_rightTableV reloadData];
-    
+    [self getData];
 }
 
+- (void)getData {
+    __weak typeof(self) weakSelf = self;
+    [self.vm getAllCateGories:@"" com:^(BOOL isSuc, NSString * _Nonnull msg) {
+        NSArray<KWMainTypeModel *> *tempArr = weakSelf.vm.totalDatas;
+        weakSelf.leftTableV.arr = tempArr;
+        weakSelf.rightTableV.arr = tempArr.firstObject.children_data;
+        [weakSelf.leftTableV reloadData];
+        [weakSelf.rightTableV reloadData];
+        if (!isSuc) {
+            [weakSelf.view makeToast:msg];
+        }
+    }];
+}
+
+
+
 - (void)loadSubVs {
     self.statusBgV.backgroundColor = _E0FFF5;
     self.customNavBar.backgroundColor = _E0FFF5;
@@ -109,17 +98,17 @@
         leftTab.callBack = ^{
             NSInteger selectIndex = weak_self.leftTableV.selectIndex;
             if (selectIndex >= weak_self.leftTableV.arr.count) {
-                weak_self.rightTableV.arr = weak_self.leftTableV.moneyType.children;
+                weak_self.rightTableV.arr = weak_self.leftTableV.moneyType.children_data;
                 [weak_self.rightTableV reloadData];
                 return;
             }
             
            KWMainTypeModel *m = weak_self.leftTableV.arr[selectIndex];
 
-            if (m.children.count == 0) {
+            if (m.children_data.count == 0) {
                 [self toResult:m.title type:m.Id keyWord:@""];
             } else {
-                weak_self.rightTableV.arr = m.children;
+                weak_self.rightTableV.arr = m.children_data;
                 [weak_self.rightTableV reloadData];
             }
         };
@@ -134,27 +123,14 @@
         _rightTableV = tab;
         @weakify(self);
         [_rightTableV setCallBack:^(NSIndexPath * _Nonnull indexP) {
-            KWSearchSubTypeModel *m = weak_self.rightTableV.arr[indexP.section].children[indexP.item];
+            KWSearchSubTypeModel *m = weak_self.rightTableV.arr[indexP.section].children_data[indexP.item];
             [weak_self toResult:m.title type:m.Id keyWord:@""];
         }];
         [_rightTableV setCallBackSection:^(NSInteger index) {
             KWSubTypeSectionModel *m = weak_self.rightTableV.arr[index];
             if (m.isMoneyType) {
-                [MBProgressHUD showHUDAddedTo:weak_self.view animated:true];
-//                [weak_self.vm switchCurrencie:m callback:^(BOOL flag) {
-//
-//                    if (flag) {
-//                        [[NSNotificationCenter defaultCenter] postNotificationName:MoneyTypeChanged object:nil];
-//                        [weak_self.vm reqCurrenciesList:^{
-//                            [MBProgressHUD hideHUDForView:weak_self.view animated:true];
-//                            weak_self.leftTableV.moneyType = weak_self.vm.moneyType;
-//                            weak_self.rightTableV.arr = weak_self.vm.moneyType.children;
-//                            [weak_self.rightTableV reloadData];
-//                        }];
-//                    } else {
-//                        [MBProgressHUD hideHUDForView:weak_self.view animated:true];
-//                    }
-//                }];
+                [ASCurrencyManager.shared setSelectCurrency:m.title];
+                [weak_self.rightTableV reloadData];
                 return;
             }
             [weak_self toResult:m.title type:m.Id keyWord:@""];

+ 10 - 10
Asteria/Fuction/Category/vc/KWSearchViewController.m

@@ -44,7 +44,7 @@
         weak_self.leftTableV.moneyType = weak_self.vm.moneyType;
         [weak_self.leftTableV reloadData];
         if (weak_self.leftTableV.selectIndex >= weak_self.leftTableV.arr.count) {
-            weak_self.rightTableV.arr = weak_self.vm.moneyType.children;
+            weak_self.rightTableV.arr = weak_self.vm.moneyType.children_data;
             [weak_self.rightTableV reloadData];
         }
     }];
@@ -68,9 +68,9 @@
     [self.vm reqProductTypeList:^() {
         weak_self.leftTableV.arr = weak_self.vm.arr;
         for (int i = 0; i < weak_self.vm.arr.count; i++) {
-            if (weak_self.vm.arr[i] && weak_self.vm.arr[i].children.count > 0) {
+            if (weak_self.vm.arr[i] && weak_self.vm.arr[i].children_data.count > 0) {
                 weak_self.leftTableV.selectIndex = i;
-                weak_self.rightTableV.arr = weak_self.vm.arr[i].children;
+                weak_self.rightTableV.arr = weak_self.vm.arr[i].children_data;
                 break;
             }
             
@@ -82,9 +82,9 @@
     if (self.vm.arr.count > 0) {
         self.leftTableV.arr = weak_self.vm.arr;
         for (int i = 0; i < weak_self.vm.arr.count; i++) {
-            if (weak_self.vm.arr[i] && weak_self.vm.arr[i].children.count > 0) {
+            if (weak_self.vm.arr[i] && weak_self.vm.arr[i].children_data.count > 0) {
                 weak_self.leftTableV.selectIndex = i;
-                weak_self.rightTableV.arr = weak_self.vm.arr[i].children;
+                weak_self.rightTableV.arr = weak_self.vm.arr[i].children_data;
                 break;
             }
             
@@ -162,17 +162,17 @@
         leftTab.callBack = ^{
             NSInteger selectIndex = weak_self.leftTableV.selectIndex;
             if (selectIndex >= weak_self.leftTableV.arr.count) {
-                weak_self.rightTableV.arr = weak_self.leftTableV.moneyType.children;
+                weak_self.rightTableV.arr = weak_self.leftTableV.moneyType.children_data;
                 [weak_self.rightTableV reloadData];
                 return;
             }
             
            KWMainTypeModel *m = weak_self.leftTableV.arr[selectIndex];
 
-            if (m.children.count == 0) {
+            if (m.children_data.count == 0) {
                 [self toResult:m.title type:m.Id keyWord:@""];
             } else {
-                weak_self.rightTableV.arr = m.children;
+                weak_self.rightTableV.arr = m.children_data;
                 [weak_self.rightTableV reloadData];
             }
         };
@@ -186,7 +186,7 @@
         _rightTableV = tab;
         @weakify(self);
         [_rightTableV setCallBack:^(NSIndexPath * _Nonnull indexP) {
-            KWSearchSubTypeModel *m = weak_self.rightTableV.arr[indexP.section].children[indexP.item];
+            KWSearchSubTypeModel *m = weak_self.rightTableV.arr[indexP.section].children_data[indexP.item];
             [weak_self toResult:m.title type:m.Id keyWord:@""];
         }];
         [_rightTableV setCallBackSection:^(NSInteger index) {
@@ -200,7 +200,7 @@
                         [weak_self.vm reqCurrenciesList:^{
                             [MBProgressHUD hideHUDForView:weak_self.view animated:true];
                             weak_self.leftTableV.moneyType = weak_self.vm.moneyType;
-                            weak_self.rightTableV.arr = weak_self.vm.moneyType.children;
+                            weak_self.rightTableV.arr = weak_self.vm.moneyType.children_data;
                             [weak_self.rightTableV reloadData];
                         }];
                     } else {

+ 21 - 0
Asteria/Fuction/Category/vm/ASCategoriesViewModel.h

@@ -0,0 +1,21 @@
+//
+//  ASCategoriesViewModel.h
+//  Asteria
+//
+//  Created by iOS on 2023/12/9.
+//
+
+#import <Foundation/Foundation.h>
+#import "KWSearchSubTypeModel.h"
+
+NS_ASSUME_NONNULL_BEGIN
+
+@interface ASCategoriesViewModel : NSObject
+
+@property (nonatomic, strong) NSMutableArray<KWMainTypeModel *> *totalDatas;
+
+- (void)getAllCateGories:(NSString *)baseID com:(void(^)(BOOL isSuc, NSString *msg))comp;
+
+@end
+
+NS_ASSUME_NONNULL_END

+ 57 - 0
Asteria/Fuction/Category/vm/ASCategoriesViewModel.m

@@ -0,0 +1,57 @@
+//
+//  ASCategoriesViewModel.m
+//  Asteria
+//
+//  Created by iOS on 2023/12/9.
+//
+
+#import "ASCategoriesViewModel.h"
+
+@implementation ASCategoriesViewModel
+
+
+- (void)getAllCateGories:(NSString *)baseID com:(void(^)(BOOL isSuc, NSString *msg))comp {
+    NSMutableDictionary *dic = [NSMutableDictionary dictionary];
+    if (baseID != nil && baseID.length > 0) {
+        dic[@"categoryId"] = baseID;
+    }
+    __weak typeof(self) weakSelf = self;
+    [ASNetTools.shared getWithPath:getAllCategoriesUrl param:dic success:^(id _Nonnull json) {
+        NSMutableArray *arr = [KWMainTypeModel mj_objectArrayWithKeyValuesArray:json[@"children_data"]];
+        
+        weakSelf.totalDatas = arr;
+        [weakSelf addCurrencyData];
+        comp(true, @"");
+    } faild:^(NSString * _Nonnull code, NSString * _Nonnull msg) {
+        NSMutableArray *arr = [NSMutableArray array];
+        
+        weakSelf.totalDatas = arr;
+        [weakSelf addCurrencyData];
+        comp(false, msg);
+    }];
+}
+
+- (void)addCurrencyData {
+    NSMutableArray *subArr = [[NSMutableArray alloc] init];
+    for (NSString *dic in ASCurrencyManager.shared.avaiCurencys) {
+        NSString *name = dic;
+        NSString *short_name = dic;
+        NSNumber *status =[NSNumber numberWithBool:[dic isEqualToString:ASCurrencyManager.shared.currentCur]];
+        
+        KWSubTypeSectionModel *m = [[KWSubTypeSectionModel alloc] init];
+        m.Id = short_name;
+        m.title = name;
+        m.isOpen = status.boolValue;
+        m.isMoneyType = true;
+        m.children_data = [[NSMutableArray alloc] init];
+        [subArr addObject:m];
+    }
+    
+    KWMainTypeModel *model = [KWMainTypeModel new];
+    model.title = @"CURRENCY";
+    model.isMoneyType = true;
+    model.children_data = subArr;
+    [self.totalDatas addObject:model];
+}
+
+@end

+ 7 - 0
Asteria/Fuction/UserCenter/ConponsAndGiftCard/ASCouponsListViewController.m

@@ -130,9 +130,16 @@
 - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {
     ASCouponListCell *cell = [tableView dequeueReusableCellWithIdentifier:@"ASCouponListCell" forIndexPath:indexPath];
     __weak typeof(self) weakSelf = self;
+    if (self.vm.couponList.count <= indexPath.row) {
+        return cell;
+    }
+    ASCouponsModel *m = self.vm.couponList[indexPath.row];
+    [cell setData:m];
     [cell setCopyCallBack:^{
+        UIPasteboard.generalPasteboard.string = m.code;
         [weakSelf.view makeToast:@"Code Copied"];
     }];
+    
     return cell;
 }
 

+ 3 - 0
Asteria/Fuction/UserCenter/ConponsAndGiftCard/v/ASCouponListCell.h

@@ -7,6 +7,7 @@
 
 #import <UIKit/UIKit.h>
 #import "ASCouponsModel.h"
+#import "ASVipCouponModel.h"
 
 NS_ASSUME_NONNULL_BEGIN
 
@@ -16,6 +17,8 @@ NS_ASSUME_NONNULL_BEGIN
 
 - (void)setData:(ASCouponsModel *)model;
 
+- (void)setVipData:(ASVipCouponModel *)model;
+
 - (void)setGiftCardStyle;
 - (void)setVipCouponStyle;
 

+ 11 - 12
Asteria/Fuction/UserCenter/ConponsAndGiftCard/v/ASCouponListCell.m

@@ -33,10 +33,20 @@
 
 @implementation ASCouponListCell
 
+- (void)setVipData:(ASVipCouponModel *)model {
+    self.titleLb.text = [NSString stringWithFormat:@"%@", model.title];//@"$10 off";
+    self.ruleLb.text = @"";
+    self.dateLb.text = [NSString stringWithFormat:@"%@", model.desc];
+    
+    self.codeLb.text = model.code;
+    
+    [self setStatus:model.used.integerValue != 0 ];
+}
+
 
 - (void)setData:(ASCouponsModel *)model {
     self.titleLb.text = [NSString stringWithFormat:@"%@", model.title];//@"$10 off";
-    self.ruleLb.text = [NSString stringWithFormat:@"%@", model.description];
+    self.ruleLb.text = [NSString stringWithFormat:@"%@", model.desc];
     self.dateLb.text = [NSString stringWithFormat:@"DATE:%@", model.activity_time];
     
     self.codeLb.text = model.code;
@@ -60,21 +70,10 @@
     if (self)
     {
         [self loadSubVs];
-        [self setDemoData];
     }
     return self;
 }
 
-- (void)setDemoData {
-    self.titleLb.text = @"$10 off";
-    self.ruleLb.text = @"For Order ≥ $99";
-    self.dateLb.text = @"DTAE:2022/09/01-2022/09/30";
-    
-    self.codeLb.text = @"3VIP55";
-    
-    [self setStatus:arc4random()%2==1];
-    
-}
 
 - (void)setVipCouponStyle {
     self.codeLb.hidden = true;

+ 7 - 7
Asteria/Fuction/UserCenter/Setting/ASInfomationSetController.m

@@ -59,16 +59,16 @@
 }
 
 - (void)setData {
-//    KWLoginedUserModel *m = [KWLoginedManager.shareInstance getCurrentLoginedUser];
-////    self.userModel = m;
-//    self.lastNTf.text = m.lastname;
-//    self.nameTf.text = m.firstname;
-//    self.currentDate = [NSDate dateWithString:m.dob format:@"yyyy-MM-dd HH:mm:ss"];
-//    self.birthTf.text = [self.currentDate stringWithFormat:@"MM/dd/yyyy"];
+    ASUserModel *m = ASUserInfoManager.shared.userInfo;
+    NSString *bob = ASUserInfoManager.shared.birthDay;
+    self.lastNTf.text = m.lastname;
+    self.nameTf.text = m.firstname;
+    self.currentDate = [NSDate dateWithString:bob format:@"MM dd, yyyy"];
+    self.birthTf.text = [self.currentDate stringWithFormat:@"MM/dd/yyyy"];
     
     self.showType = 0;
     
-//    self.emailTf.text = m.email;
+    self.emailTf.text = m.email;
     [self configViewsByShowType];
     
 }

+ 1 - 0
Asteria/Fuction/UserCenter/VipCenter/ASVipCenterViewController.m

@@ -208,6 +208,7 @@
         v.selectCallBack = ^{
             if (tempM.type.integerValue == 1) { // 优惠券
                 ASVipCouponsViewController *vc = [ASVipCouponsViewController new];
+                vc.level = vipM.level;
                 [self.navigationController pushViewController:vc animated:true];
             } else if (tempM.type.integerValue == 2) { // 生日
                 if (ASUserInfoManager.shared.birthStatus.integerValue == -1) {

+ 26 - 0
Asteria/Fuction/UserCenter/VipCenter/ASVipCouponModel.h

@@ -0,0 +1,26 @@
+//
+//  ASVipCouponModel.h
+//  Asteria
+//
+//  Created by iOS on 2023/12/9.
+//
+
+#import <Foundation/Foundation.h>
+
+NS_ASSUME_NONNULL_BEGIN
+
+@interface ASVipCouponModel : NSObject
+
+@property (nonatomic, copy) NSString *title;
+@property (nonatomic, copy) NSString *value;
+@property (nonatomic, copy) NSString *code;
+@property (nonatomic, copy) NSString *type;
+@property (nonatomic, copy) NSString *points;
+@property (nonatomic, copy) NSString *used;
+@property (nonatomic, copy) NSString *Id;
+
+@property (nonatomic, copy) NSString *desc;
+
+@end
+
+NS_ASSUME_NONNULL_END

+ 18 - 0
Asteria/Fuction/UserCenter/VipCenter/ASVipCouponModel.m

@@ -0,0 +1,18 @@
+//
+//  ASVipCouponModel.m
+//  Asteria
+//
+//  Created by iOS on 2023/12/9.
+//
+
+#import "ASVipCouponModel.h"
+
+@implementation ASVipCouponModel
+
++ (NSDictionary *)mj_replacedKeyFromPropertyName {
+    return @{
+        @"Id": @"id",
+    };
+}
+
+@end

+ 2 - 0
Asteria/Fuction/UserCenter/VipCenter/ASVipCouponsViewController.h

@@ -11,6 +11,8 @@ NS_ASSUME_NONNULL_BEGIN
 
 @interface ASVipCouponsViewController : ASBaseViewController
 
+@property (nonatomic, copy) NSString *level;
+
 @end
 
 NS_ASSUME_NONNULL_END

+ 45 - 3
Asteria/Fuction/UserCenter/VipCenter/ASVipCouponsViewController.m

@@ -8,9 +8,12 @@
 #import "ASVipCouponsViewController.h"
 #import "ASCouponListCell.h"
 #import "ASHomeAlertWindow.h"
+#import "ASVipCouponsViewModel.h"
 
 @interface ASVipCouponsViewController () <UITableViewDelegate,UITableViewDataSource>
 
+@property (nonatomic, strong) ASVipCouponsViewModel *vm;
+
 @property (nonatomic, strong) UIView *colorBgV;
 @property (nonatomic, strong) UITableView *tableV;
 
@@ -21,6 +24,7 @@
 
 - (void)viewDidLoad {
     [super viewDidLoad];
+    self.vm = [ASVipCouponsViewModel new];
     [self loadSubVs];
     [self configSubVs];
     
@@ -35,6 +39,32 @@
     self.statusBgV.backgroundColor = _E0FFF5;
     self.customNavBar.backgroundColor = _F0FFFA;
     
+    __weak typeof(self) weakSelf = self;
+    self.tableV.mj_header = [MJRefreshNormalHeader headerWithRefreshingBlock:^{
+        [weakSelf getNetData];
+    }];
+    [self.tableV.mj_header beginRefreshing];
+    
+}
+
+// MARK: - net
+
+- (void)getNetData {
+    [MBProgressHUD showHUDAddedTo:self.view animated:true];
+    __weak typeof(self) weakSelf = self;
+    [self.vm getVipCouponList:self.level com:^(BOOL isSuccess, NSString * _Nonnull msg) {
+        [MBProgressHUD hideHUDForView:weakSelf.view animated:true];
+        [weakSelf.tableV.mj_header endRefreshing];
+        if (weakSelf.vm.couponArr.count == 0) {
+            [weakSelf showEmptyV:weakSelf.tableV];
+        } else {
+            [weakSelf hiddenEmpty];
+        }
+        [weakSelf.tableV reloadData];
+        if (!isSuccess) {
+            [weakSelf.view makeToast:msg];
+        }
+    }];
 }
 
 // MARK: - loadSubVs
@@ -86,16 +116,28 @@
 
 // MARK: - UITableViewDelegate,UITableViewDataSource
 - (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section {
-    return 10;
+    return self.vm.couponArr.count;
 }
 
 - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {
     ASCouponListCell *cell = [tableView dequeueReusableCellWithIdentifier:@"ASCouponListCell" forIndexPath:indexPath];
     __weak typeof(self) weakSelf = self;
+    if (self.vm.couponArr.count <= indexPath.row) {
+        [cell setVipCouponStyle];
+        return cell;
+    }
+    ASVipCouponModel *vipM = self.vm.couponArr[indexPath.row];
     [cell setCopyCallBack:^{
-        [ASHomeAlertWindow alertMsg:@"Coupon Received Please Check In My Coupon"];
-         
+        [weakSelf.vm postGetCoupon:vipM.Id com:^(BOOL isSuccess, NSString * _Nonnull msg) {
+            if (isSuccess) {
+                [ASHomeAlertWindow alertMsg:@"Coupon Received Please Check In My Coupon"];
+            } else {
+                [weakSelf.view makeToast:msg];
+            }
+            [weakSelf getNetData];
+        }];
     }];
+    [cell setVipData:vipM];
     [cell setVipCouponStyle];
     return cell;
 }

+ 23 - 0
Asteria/Fuction/UserCenter/VipCenter/ASVipCouponsViewModel.h

@@ -0,0 +1,23 @@
+//
+//  ASVipCouponsViewModel.h
+//  Asteria
+//
+//  Created by iOS on 2023/12/9.
+//
+
+#import <Foundation/Foundation.h>
+#import "ASVipCouponModel.h"
+
+NS_ASSUME_NONNULL_BEGIN
+
+@interface ASVipCouponsViewModel : NSObject
+
+
+@property (nonatomic, strong) NSMutableArray<ASVipCouponModel *> *couponArr;
+
+- (void)getVipCouponList:(NSString *)v com:(void(^)(BOOL isSuccess, NSString *msg))com;
+- (void)postGetCoupon:(NSString *)ID com:(void(^)(BOOL isSuccess, NSString *msg))com;
+
+@end
+
+NS_ASSUME_NONNULL_END

+ 74 - 0
Asteria/Fuction/UserCenter/VipCenter/ASVipCouponsViewModel.m

@@ -0,0 +1,74 @@
+//
+//  ASVipCouponsViewModel.m
+//  Asteria
+//
+//  Created by iOS on 2023/12/9.
+//
+
+#import "ASVipCouponsViewModel.h"
+
+@implementation ASVipCouponsViewModel
+
+
+- (void)postGetCoupon:(NSString *)ID com:(void(^)(BOOL isSuccess, NSString *msg))com {
+    [ASNetTools.shared postWithPath:postAddVipCoupon param:@{@"id":ID} success:^(id _Nonnull json) {
+        com(true, @"");
+    } faild:^(NSString * _Nonnull code, NSString * _Nonnull msg) {
+        com(false, msg);
+    }];
+}
+
+- (void)getVipCouponList:(NSString *)v com:(void(^)(BOOL isSuccess, NSString *msg))com {
+    [ASNetTools.shared getWithPath:getVipCouponUrl param:@{@"v":v} success:^(id _Nonnull json) {
+        NSDictionary<NSString*, NSDictionary*> *coupsData = json;
+        if (![coupsData.allKeys containsObject:@"coupons"]) {
+            com(false, @"DATA ERROR!");
+            return;
+        }
+        NSDictionary<NSString*, NSDictionary*> *coups = [coupsData valueForKey:@"coupons"];
+        
+        NSMutableArray<ASVipCouponModel *> *arr = [NSMutableArray array];
+        if (coups != nil && coups.count != 0) {
+            NSArray *keys = coups.allKeys;
+            NSMutableArray *sortedArr = [NSMutableArray array];
+            for (NSString *key in keys) {
+                if (sortedArr.count == 0) {
+                    [sortedArr addObject:key];
+                    continue;
+                }
+                for (int i=0; i<sortedArr.count; i++) {
+                    NSString *this = sortedArr[i];
+                    if (sortedArr.count > i+1) {
+                        NSString *nx = sortedArr[i+1];
+                        if (key.intValue >= this.intValue && key.intValue < nx.intValue) {
+                            [sortedArr insertObject:key atIndex:i+1];
+                            break;
+                        }
+                    } else {
+                        if (sortedArr.count == 1 && key.intValue <= this.intValue) {
+                            [sortedArr insertObject:key atIndex:i];
+                        } else {
+                            [sortedArr addObject:key];
+                        }
+                        break;
+                    }
+                }
+                
+            }
+            for (int i=0; i<sortedArr.count; i++) {
+                ASVipCouponModel *coupM = [ASVipCouponModel mj_objectWithKeyValues: coups[sortedArr[i]]];
+                if (i+1<sortedArr.count) {
+                    ASVipCouponModel *tempNext = [ASVipCouponModel mj_objectWithKeyValues: coups[sortedArr[i+1]]];
+                }
+                
+                [arr addObject:coupM];
+            }
+        }
+        self.couponArr = arr;
+        com(true, @"");
+    } faild:^(NSString * _Nonnull code, NSString * _Nonnull msg) {
+        com(false, msg);
+    }];
+}
+
+@end

+ 29 - 0
Asteria/Fuction/UserManager/currency/ASCurrencyManager.h

@@ -0,0 +1,29 @@
+//
+//  ASCurrencyManager.h
+//  Asteria
+//
+//  Created by iOS on 2023/12/9.
+//
+
+#import <Foundation/Foundation.h>
+
+
+NS_ASSUME_NONNULL_BEGIN
+
+@interface ASCurrencyManager : NSObject
+
+/// 当前选中的货币
+@property (nonatomic, copy, readonly) NSString *currentCur;
+
+@property (nonatomic, strong) NSArray<NSString *> *avaiCurencys;
+
+- (void)setSelectCurrency:(NSString *)sel;
+
++ (instancetype)shared;
+- (void)getAllCurrencyData;
+
+
+
+@end
+
+NS_ASSUME_NONNULL_END

+ 63 - 0
Asteria/Fuction/UserManager/currency/ASCurrencyManager.m

@@ -0,0 +1,63 @@
+//
+//  ASCurrencyManager.m
+//  Asteria
+//
+//  Created by iOS on 2023/12/9.
+//
+
+#import "ASCurrencyManager.h"
+
+@interface ASCurrencyManager ()
+
+
+
+@end
+
+@implementation ASCurrencyManager
+
++ (instancetype)shared {
+    static id sharedInstance = nil;
+    static dispatch_once_t onceToken;
+    dispatch_once(&onceToken, ^{
+        sharedInstance = [[self alloc] init];
+    });
+    return sharedInstance;
+}
+
+- (instancetype)init
+{
+    self = [super init];
+    if (self) {
+        self.avaiCurencys = [NSArray array];
+    }
+    return self;
+}
+
+- (void)setSelectCurrency:(NSString *)sel {
+    [NSUserDefaults.standardUserDefaults setValue:sel forKey:UserLocalCur];
+    [NSNotificationCenter.defaultCenter postNotificationName:UserLocalCurUpdate object:nil userInfo:@{@"currency":sel}];
+}
+
+- (NSString *)currentCur {
+    NSString *localCur = [NSUserDefaults.standardUserDefaults stringForKey:UserLocalCur];
+    if (localCur == nil || localCur.length == 0) {
+        localCur = @"USD";
+    }
+    return localCur;
+}
+
+
+- (void)getAllCurrencyData {
+    __weak typeof(self) weakSelf = self;
+    [ASNetTools.shared getWithPath:getAllCurrencyUrl param:@{} success:^(id _Nonnull json) {
+        NSDictionary *dic = (NSDictionary *)json;
+        weakSelf.avaiCurencys = dic[@"available_currency_codes"];
+       
+    } faild:^(NSString * _Nonnull code, NSString * _Nonnull msg) {
+        
+        weakSelf.avaiCurencys = [NSMutableArray array];
+    }];
+}
+
+
+@end

Asteria/Fuction/UserManager/ASUserInfoManager.h → Asteria/Fuction/UserManager/info/ASUserInfoManager.h


+ 0 - 1
Asteria/Fuction/UserManager/ASUserInfoManager.m

@@ -54,7 +54,6 @@
     [ASNetTools.shared getWithPath:userBirthUrl param:@{} success:^(id _Nonnull json) {
         self.birthDay = [NSString stringWithFormat:@"%@", json[@"birthDay"]];
         self.birthStatus = [NSString stringWithFormat:@"%@", json[@"status"]];
-        NSLog(@"----userInfo:%@-----id:%@----issub:%u----address:%@----", self.userInfo, self.userInfo.Id, self.userInfo.is_subscribed, self.userInfo.addresses);
     } faild:^(NSString * _Nonnull code, NSString * _Nonnull msg) {
         [Current_normalTool.currentNav.topViewController.view makeToast:msg];
     }];

Asteria/Fuction/UserManager/ASUserModel.h → Asteria/Fuction/UserManager/info/ASUserModel.h


Asteria/Fuction/UserManager/ASUserModel.m → Asteria/Fuction/UserManager/info/ASUserModel.m


Asteria/Fuction/UserManager/ASVipModel.h → Asteria/Fuction/UserManager/info/ASVipModel.h


Asteria/Fuction/UserManager/ASVipModel.m → Asteria/Fuction/UserManager/info/ASVipModel.m


Asteria/Fuction/UserManager/ASVipUrlTempModel.h → Asteria/Fuction/UserManager/info/ASVipUrlTempModel.h


Asteria/Fuction/UserManager/ASVipUrlTempModel.m → Asteria/Fuction/UserManager/info/ASVipUrlTempModel.m


+ 9 - 0
Asteria/NetTools/ASNetApis.h

@@ -19,6 +19,14 @@
 
 // MARK: - path
 
+// MARK: - 货币
+#define getAllCurrencyUrl BaseRequestrUrl(@"directory/currency")
+
+// MARK: - 分类列表
+#define getAllCategoriesUrl BaseRequestrUrl(@"rewrite/categories")
+
+
+
 // MARK: - userinfo
 #define registerUrl BaseRequestrUrl(@"customers")
 #define loginUrl BaseRequestrUrl(@"integration/customer/token")
@@ -39,6 +47,7 @@
 
 // vip 优惠券
 #define getVipCouponUrl BaseRequestrUrl(@"vip/coupon")
+#define postAddVipCoupon BaseRequestrUrl(@"coupon/add")
 
 // MARK: 积分
 #define getPointsDetailUrl BaseRequestrUrl(@"points/index")

+ 8 - 0
Asteria/NetTools/ASUserNotifyStatic.h

@@ -8,6 +8,14 @@
 #ifndef ASUserNotifyStatic_h
 #define ASUserNotifyStatic_h
 
+/// 保存用户选择的货币
+#define UserLocalCur @"UserLocalCur"
+/// 保存用户选择的货币符号
+//#define UserLocalCurSymbol @"UserLocalCurSymbol"
+/// 通知用户选择的货币更新
+#define UserLocalCurUpdate @"UserLocalCurUpdate"
+
+/// 通知用户信息更新
 #define UserInfoUpdate @"ASUserInfoUpdate"
 
 

+ 1 - 0
Asteria/PreFixHeader.h

@@ -12,6 +12,7 @@
 #import "ASNetApis.h"
 #import "ASUserInfoManager.h"
 #import "ASUserNotifyStatic.h"
+#import "ASCurrencyManager.h"
 
 #import "CTMediator+Categorys.h"
 #import "CTMediator+Home.h"

+ 0 - 1
Asteria/Tabber/AS_TabBarViewController.m

@@ -10,7 +10,6 @@
 #import <UCMBaseC.h>
 #import "AViewController.h"
 
-@class APCategoryViewController;
 @interface AS_TabBarViewController ()<UITabBarControllerDelegate>
 
 @end