Forráskód Böngészése

Cart 功能开发,还差丢件险

wangmeng 1 éve
szülő
commit
901e71240a
41 módosított fájl, 722 hozzáadás és 67 törlés
  1. 16 0
      Asteria.xcodeproj/project.pbxproj
  2. 1 0
      Asteria/AppDelegate.m
  3. 0 0
      Asteria/Base/Assets/Base.xcassets/base_close_white.imageset/Contents.json
  4. 0 0
      Asteria/Base/Assets/Base.xcassets/base_close_white.imageset/组 9646.png
  5. 0 0
      Asteria/Base/Assets/Base.xcassets/base_close_white.imageset/组 9646@2x.png
  6. 0 0
      Asteria/Base/Assets/Base.xcassets/base_close_white.imageset/组 9646@3x.png
  7. 3 3
      Asteria/Fuction/Goods/Assets/Goods.xcassets/goods_close_black.imageset/Contents.json
  8. BIN
      Asteria/Base/Assets/Base.xcassets/base_radio_select.imageset/组 9776.png
  9. BIN
      Asteria/Base/Assets/Base.xcassets/base_radio_select.imageset/组 9776@2x.png
  10. BIN
      Asteria/Base/Assets/Base.xcassets/base_radio_select.imageset/组 9776@3x.png
  11. 3 3
      Asteria/Fuction/Goods/Assets/Goods.xcassets/goods_close_white.imageset/Contents.json
  12. BIN
      Asteria/Base/Assets/Base.xcassets/base_radio_unselect.imageset/组 8657.png
  13. BIN
      Asteria/Base/Assets/Base.xcassets/base_radio_unselect.imageset/组 8657@2x.png
  14. BIN
      Asteria/Base/Assets/Base.xcassets/base_radio_unselect.imageset/组 8657@3x.png
  15. 16 5
      Asteria/Base/RYNetWork/RYBaseVM.h
  16. 31 19
      Asteria/Base/RYNetWork/RYBaseVM.m
  17. 2 0
      Asteria/Category/NSMutableAttributedString+RYText.m
  18. 59 15
      Asteria/Fuction/Cart/Cart_MyCartC.m
  19. 23 0
      Asteria/Fuction/Cart/Cell/MyCartCouponCell.h
  20. 212 0
      Asteria/Fuction/Cart/Cell/MyCartCouponCell.m
  21. 39 0
      Asteria/Fuction/Cart/Cell/MyCartGrandTotalCell.h
  22. 249 0
      Asteria/Fuction/Cart/Cell/MyCartGrandTotalCell.m
  23. 5 0
      Asteria/Fuction/Cart/M/CartTotalsM.h
  24. 5 1
      Asteria/Fuction/Cart/V/MyCarlTableV.h
  25. 18 1
      Asteria/Fuction/Cart/V/MyCarlTableV.m
  26. 2 6
      Asteria/Fuction/Cart/VM/CartVM.h
  27. 3 3
      Asteria/Fuction/Cart/VM/CartVM.m
  28. BIN
      Asteria/Fuction/Goods/Assets/Goods.xcassets/goods_close_black.imageset/组 8609.png
  29. BIN
      Asteria/Fuction/Goods/Assets/Goods.xcassets/goods_close_black.imageset/组 8609@2x.png
  30. BIN
      Asteria/Fuction/Goods/Assets/Goods.xcassets/goods_close_black.imageset/组 8609@3x.png
  31. BIN
      Asteria/Fuction/Goods/Assets/Goods.xcassets/goods_close_white.imageset/组 9646.png
  32. BIN
      Asteria/Fuction/Goods/Assets/Goods.xcassets/goods_close_white.imageset/组 9646@2x.png
  33. BIN
      Asteria/Fuction/Goods/Assets/Goods.xcassets/goods_close_white.imageset/组 9646@3x.png
  34. 2 1
      Asteria/Fuction/Goods/Revies/GoodsReviewsWriteC.m
  35. 1 1
      Asteria/Fuction/Goods/V/GoodsDetailsPayV.m
  36. 2 1
      Asteria/Fuction/Goods/VC/AS_GoodsDetailsC.m
  37. 2 1
      Asteria/Fuction/Goods/VC/AS_GoodsReviewsListC.m
  38. 6 2
      Asteria/Fuction/Goods/VC/AS_GoodsSizeC.m
  39. 4 4
      Asteria/Fuction/Goods/VM/ASGoodsDetailsVM.m
  40. 3 0
      Asteria/NetTools/ASNetTools.h
  41. 15 1
      Asteria/NetTools/ASNetTools.m

+ 16 - 0
Asteria.xcodeproj/project.pbxproj

@@ -214,6 +214,7 @@
 		9A78E0182B6396D600CA4E32 /* CartVM.m in Sources */ = {isa = PBXBuildFile; fileRef = 9A78E0172B6396D600CA4E32 /* CartVM.m */; };
 		9A78E01C2B639F4700CA4E32 /* CartTotalsM.m in Sources */ = {isa = PBXBuildFile; fileRef = 9A78E01B2B639F4700CA4E32 /* CartTotalsM.m */; };
 		9A7DA6A12A0CE33500136974 /* Asteria.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 9A7DA6A02A0CE33500136974 /* Asteria.xcassets */; };
+		9A8BED332B6B86A30080DA36 /* MyCartCouponCell.m in Sources */ = {isa = PBXBuildFile; fileRef = 9A8BED322B6B86A20080DA36 /* MyCartCouponCell.m */; };
 		9A98E5072B5A15A500E8C5C1 /* QDSingleImagePickerPreviewViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 9A98E5052B5A15A400E8C5C1 /* QDSingleImagePickerPreviewViewController.m */; };
 		9A98E50A2B5A1EB700E8C5C1 /* Photos.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 9A98E5092B5A1EB700E8C5C1 /* Photos.framework */; };
 		9A98E50C2B5A1EC500E8C5C1 /* Security.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 9A98E50B2B5A1EC500E8C5C1 /* Security.framework */; };
@@ -233,6 +234,7 @@
 		9A98E5282B5A280700E8C5C1 /* SafariServices.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 9A98E5272B5A280700E8C5C1 /* SafariServices.framework */; };
 		9A98E52A2B5A281600E8C5C1 /* QuartzCore.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 9A98E5292B5A281600E8C5C1 /* QuartzCore.framework */; };
 		9A98E52C2B5A282800E8C5C1 /* CoreText.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 9A98E52B2B5A282800E8C5C1 /* CoreText.framework */; };
+		9AA0534A2B6E193D004B90BC /* Cart.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 9AA053492B6E193D004B90BC /* Cart.xcassets */; };
 		9AC2CC222B3A673B005187BD /* ASGoodsDetailsVM.m in Sources */ = {isa = PBXBuildFile; fileRef = 9AC2CC212B3A673B005187BD /* ASGoodsDetailsVM.m */; };
 		9ACBEC212A14585300A8F97A /* CTMediator+ASTargerts.m in Sources */ = {isa = PBXBuildFile; fileRef = 9ACBEC202A14585300A8F97A /* CTMediator+ASTargerts.m */; };
 		9ACBEC252A14707400A8F97A /* AS_SignUpC.m in Sources */ = {isa = PBXBuildFile; fileRef = 9ACBEC242A14707400A8F97A /* AS_SignUpC.m */; };
@@ -289,6 +291,7 @@
 		9AD6A5492A1237D0001DE3D9 /* Target_Login.m in Sources */ = {isa = PBXBuildFile; fileRef = 9AD6A5482A1237D0001DE3D9 /* Target_Login.m */; };
 		9ADA8A1E2B4E481E00BACDEA /* GoodsReviewsWriteC.m in Sources */ = {isa = PBXBuildFile; fileRef = 9ADA8A1D2B4E481E00BACDEA /* GoodsReviewsWriteC.m */; };
 		9ADA8A212B4E96C900BACDEA /* GoodWritUpImgV.m in Sources */ = {isa = PBXBuildFile; fileRef = 9ADA8A1F2B4E96C800BACDEA /* GoodWritUpImgV.m */; };
+		9AE3674D2B6CDDE50068F10B /* MyCartGrandTotalCell.m in Sources */ = {isa = PBXBuildFile; fileRef = 9AE3674C2B6CDDE50068F10B /* MyCartGrandTotalCell.m */; };
 		9AEFA7DE2B649F4000AE1974 /* MyCarlTableV.m in Sources */ = {isa = PBXBuildFile; fileRef = 9AEFA7DD2B649F3F00AE1974 /* MyCarlTableV.m */; };
 		9AF9085C2B397320008AC2D2 /* UIViewController+RY_configNet.m in Sources */ = {isa = PBXBuildFile; fileRef = 9AF9085B2B397320008AC2D2 /* UIViewController+RY_configNet.m */; };
 		9AF9085F2B3976F3008AC2D2 /* RYBaseVM.m in Sources */ = {isa = PBXBuildFile; fileRef = 9AF9085E2B3976F3008AC2D2 /* RYBaseVM.m */; };
@@ -717,6 +720,8 @@
 		9A78E01A2B639F4700CA4E32 /* CartTotalsM.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = CartTotalsM.h; sourceTree = "<group>"; };
 		9A78E01B2B639F4700CA4E32 /* CartTotalsM.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = CartTotalsM.m; sourceTree = "<group>"; };
 		9A7DA6A02A0CE33500136974 /* Asteria.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Asteria.xcassets; sourceTree = "<group>"; };
+		9A8BED312B6B86A20080DA36 /* MyCartCouponCell.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = MyCartCouponCell.h; sourceTree = "<group>"; };
+		9A8BED322B6B86A20080DA36 /* MyCartCouponCell.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = MyCartCouponCell.m; sourceTree = "<group>"; };
 		9A98E5052B5A15A400E8C5C1 /* QDSingleImagePickerPreviewViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = QDSingleImagePickerPreviewViewController.m; sourceTree = "<group>"; };
 		9A98E5062B5A15A400E8C5C1 /* QDSingleImagePickerPreviewViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = QDSingleImagePickerPreviewViewController.h; sourceTree = "<group>"; };
 		9A98E5092B5A1EB700E8C5C1 /* Photos.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Photos.framework; path = System/Library/Frameworks/Photos.framework; sourceTree = SDKROOT; };
@@ -737,6 +742,7 @@
 		9A98E5272B5A280700E8C5C1 /* SafariServices.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = SafariServices.framework; path = System/Library/Frameworks/SafariServices.framework; sourceTree = SDKROOT; };
 		9A98E5292B5A281600E8C5C1 /* QuartzCore.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = QuartzCore.framework; path = System/Library/Frameworks/QuartzCore.framework; sourceTree = SDKROOT; };
 		9A98E52B2B5A282800E8C5C1 /* CoreText.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreText.framework; path = System/Library/Frameworks/CoreText.framework; sourceTree = SDKROOT; };
+		9AA053492B6E193D004B90BC /* Cart.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Cart.xcassets; sourceTree = "<group>"; };
 		9AC2CC202B3A673B005187BD /* ASGoodsDetailsVM.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = ASGoodsDetailsVM.h; sourceTree = "<group>"; };
 		9AC2CC212B3A673B005187BD /* ASGoodsDetailsVM.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = ASGoodsDetailsVM.m; sourceTree = "<group>"; };
 		9ACBEC1F2A14585300A8F97A /* CTMediator+ASTargerts.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "CTMediator+ASTargerts.h"; sourceTree = "<group>"; };
@@ -851,6 +857,8 @@
 		9ADA8A1D2B4E481E00BACDEA /* GoodsReviewsWriteC.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = GoodsReviewsWriteC.m; sourceTree = "<group>"; };
 		9ADA8A1F2B4E96C800BACDEA /* GoodWritUpImgV.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = GoodWritUpImgV.m; sourceTree = "<group>"; };
 		9ADA8A202B4E96C900BACDEA /* GoodWritUpImgV.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = GoodWritUpImgV.h; sourceTree = "<group>"; };
+		9AE3674B2B6CDDE50068F10B /* MyCartGrandTotalCell.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = MyCartGrandTotalCell.h; sourceTree = "<group>"; };
+		9AE3674C2B6CDDE50068F10B /* MyCartGrandTotalCell.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = MyCartGrandTotalCell.m; sourceTree = "<group>"; };
 		9AEFA7DC2B649F3F00AE1974 /* MyCarlTableV.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = MyCarlTableV.h; sourceTree = "<group>"; };
 		9AEFA7DD2B649F3F00AE1974 /* MyCarlTableV.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = MyCarlTableV.m; sourceTree = "<group>"; };
 		9AF9085A2B397320008AC2D2 /* UIViewController+RY_configNet.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "UIViewController+RY_configNet.h"; sourceTree = "<group>"; };
@@ -1728,6 +1736,10 @@
 			children = (
 				9A2415BA2B6784A500A6E903 /* MyCartItemCell.h */,
 				9A2415BB2B6784A500A6E903 /* MyCartItemCell.m */,
+				9A8BED312B6B86A20080DA36 /* MyCartCouponCell.h */,
+				9A8BED322B6B86A20080DA36 /* MyCartCouponCell.m */,
+				9AE3674B2B6CDDE50068F10B /* MyCartGrandTotalCell.h */,
+				9AE3674C2B6CDDE50068F10B /* MyCartGrandTotalCell.m */,
 			);
 			path = Cell;
 			sourceTree = "<group>";
@@ -1940,6 +1952,7 @@
 				9A78E0152B63910A00CA4E32 /* VM */,
 				9A78E0122B6389FC00CA4E32 /* Cart_MyCartC.h */,
 				9A78E0132B6389FC00CA4E32 /* Cart_MyCartC.m */,
+				9AA053492B6E193D004B90BC /* Cart.xcassets */,
 			);
 			path = Cart;
 			sourceTree = "<group>";
@@ -2419,6 +2432,7 @@
 				814F5D0A2A11B76F003847A9 /* Roboto-BoldItalic.ttf in Resources */,
 				817244AA29F3B2EE005FA9C9 /* Assets.xcassets in Resources */,
 				9A5C645B2A1206E500CBB185 /* common.xcassets in Resources */,
+				9AA0534A2B6E193D004B90BC /* Cart.xcassets in Resources */,
 				81E257F62A12259B004EEF71 /* UserCenter.xcassets in Resources */,
 			);
 			runOnlyForDeploymentPostprocessing = 0;
@@ -2612,6 +2626,7 @@
 				9A3ADC0A2B60BAE200B04BA6 /* GoodsSizePayMentCell.m in Sources */,
 				9AD345F92A08D60F005CA070 /* ZFPlayerController.m in Sources */,
 				9AD345AC2A08D59A005CA070 /* WKM_goodsBanner.m in Sources */,
+				9AE3674D2B6CDDE50068F10B /* MyCartGrandTotalCell.m in Sources */,
 				81EC476F2A33F82C00516573 /* ASHomeImgCell.m in Sources */,
 				81717D3A2A3D322700648139 /* KWHisAndHotWordsView.m in Sources */,
 				81DFA5592A4681E900DA708B /* ASPointEranCell.m in Sources */,
@@ -2759,6 +2774,7 @@
 				81EC47782A3426CE00516573 /* ASHomeLookingCollCell.m in Sources */,
 				81DFA5782A47F28D00DA708B /* ASCouponListCell.m in Sources */,
 				8160201C2A2F101C00E4A8F1 /* ASHomeTipCell.m in Sources */,
+				9A8BED332B6B86A30080DA36 /* MyCartCouponCell.m in Sources */,
 				81717D1E2A3C4AE000648139 /* KWSearchMainTypeTableView.m in Sources */,
 				81EC47662A33035D00516573 /* ASHomeNewInCellTableViewCell.m in Sources */,
 				9AD346162A08D60F005CA070 /* UIImageView+ZFCache.m in Sources */,

+ 1 - 0
Asteria/AppDelegate.m

@@ -36,6 +36,7 @@
     if (ASUserInfoManager.shared.isLogin ) {
         [ASUserInfoManager.shared getInfo];
     }
+    [ASNetTools reqNet_getAdvCoupons];
     [self.window makeKeyAndVisible];
     
     return YES;

Asteria/Base/Assets/Base.xcassets/goods_close_white.imageset/Contents.json → Asteria/Base/Assets/Base.xcassets/base_close_white.imageset/Contents.json


Asteria/Base/Assets/Base.xcassets/goods_close_white.imageset/组 9646.png → Asteria/Base/Assets/Base.xcassets/base_close_white.imageset/组 9646.png


Asteria/Base/Assets/Base.xcassets/goods_close_white.imageset/组 9646@2x.png → Asteria/Base/Assets/Base.xcassets/base_close_white.imageset/组 9646@2x.png


Asteria/Base/Assets/Base.xcassets/goods_close_white.imageset/组 9646@3x.png → Asteria/Base/Assets/Base.xcassets/base_close_white.imageset/组 9646@3x.png


+ 3 - 3
Asteria/Fuction/Goods/Assets/Goods.xcassets/goods_close_black.imageset/Contents.json

@@ -1,17 +1,17 @@
 {
   "images" : [
     {
-      "filename" : "组 8609.png",
+      "filename" : "组 9776.png",
       "idiom" : "universal",
       "scale" : "1x"
     },
     {
-      "filename" : "组 8609@2x.png",
+      "filename" : "组 9776@2x.png",
       "idiom" : "universal",
       "scale" : "2x"
     },
     {
-      "filename" : "组 8609@3x.png",
+      "filename" : "组 9776@3x.png",
       "idiom" : "universal",
       "scale" : "3x"
     }

BIN
Asteria/Base/Assets/Base.xcassets/base_radio_select.imageset/组 9776.png


BIN
Asteria/Base/Assets/Base.xcassets/base_radio_select.imageset/组 9776@2x.png


BIN
Asteria/Base/Assets/Base.xcassets/base_radio_select.imageset/组 9776@3x.png


+ 3 - 3
Asteria/Fuction/Goods/Assets/Goods.xcassets/goods_close_white.imageset/Contents.json

@@ -1,17 +1,17 @@
 {
   "images" : [
     {
-      "filename" : "组 9646.png",
+      "filename" : "组 8657.png",
       "idiom" : "universal",
       "scale" : "1x"
     },
     {
-      "filename" : "组 9646@2x.png",
+      "filename" : "组 8657@2x.png",
       "idiom" : "universal",
       "scale" : "2x"
     },
     {
-      "filename" : "组 9646@3x.png",
+      "filename" : "组 8657@3x.png",
       "idiom" : "universal",
       "scale" : "3x"
     }

BIN
Asteria/Base/Assets/Base.xcassets/base_radio_unselect.imageset/组 8657.png


BIN
Asteria/Base/Assets/Base.xcassets/base_radio_unselect.imageset/组 8657@2x.png


BIN
Asteria/Base/Assets/Base.xcassets/base_radio_unselect.imageset/组 8657@3x.png


+ 16 - 5
Asteria/Base/RYNetWork/RYBaseVM.h

@@ -6,6 +6,14 @@
 //
 
 #import <Foundation/Foundation.h>
+typedef NS_ENUM(NSUInteger,ReqNetType){
+    GetReqNetType  ,
+    PostReqNetType  ,
+    FormDataPostReqNetType  ,
+    PutReqNetType  ,
+    DeleteReqNetType
+
+} ;
 
 NS_ASSUME_NONNULL_BEGIN
 @protocol RY_baseVMprotocol <NSObject>
@@ -13,7 +21,8 @@ NS_ASSUME_NONNULL_BEGIN
 -(void)ry_respnsData:(nullable id)data
             parseAry:(nullable NSMutableArray *)arry
               sucess:(BOOL)sucessOrFail
-                mark:(NSString *)mark;
+                mark:(NSString *)mark
+          reqNetType:(ReqNetType)reqNetType;
 
 
 ///batch 多个 网络请求同步的代理
@@ -33,19 +42,21 @@ NS_ASSUME_NONNULL_BEGIN
 -(void)ry_formDataRequestPostApi:(NSString *)mark param:(NSDictionary *)param;
 
 -(void)ry_requestGetApi:(NSString *)mark param:(NSDictionary *)param;
--(void)ry_requestDeleteApi:(NSString *)mark param:(NSDictionary *)param;
+-(void)ry_requestPutApi:(NSString *)mark param:(NSString *)paramStr;
+-(void)ry_requestDeleteApi:(NSString *)mark paramStr:(NSString *)paramStr;
 
  
 
 //重写的方法 解析之后再传给 VC
--(void)ry_respnsSucessWithPath:(NSString *)mark data:(id)data;
+-(void)ry_respnsSucessWithPath:(NSString *)mark data:(id)data reqNetType:(ReqNetType)reqNetType;
 
--(void)ry_reponsFaildWithPath:(NSString *)mark code:(NSString *)code msg:(NSString *)msg;
+-(void)ry_reponsFaildWithPath:(NSString *)mark code:(NSString *)code msg:(NSString *)msg reqNetType:(ReqNetType)reqNetType;
 
 - (void)ry_VMconfigDelegateData:(id)data
                        parseAry:(NSMutableArray *)ary
                         success:(BOOL)success
-                           mark:(NSString *)mark;
+                           mark:(NSString *)mark
+                     reqNetType:(ReqNetType)reqNetType;
 
 
 

+ 31 - 19
Asteria/Base/RYNetWork/RYBaseVM.m

@@ -23,50 +23,61 @@
 -(void)ry_formDataRequestPostApi:(NSString *)mark param:(NSDictionary *)param{
     [ASNetTools.shared formData_postWithPath:mark param:param success:^(id _Nonnull json) {
         NSLog(@"mark--%@--param-%@\n-json--%@",mark,param,json);
-        [self ry_respnsSucessWithPath:mark data:json];
+        [self ry_respnsSucessWithPath:mark data:json reqNetType:FormDataPostReqNetType];
     } faild:^(NSString * _Nonnull code, NSString * _Nonnull msg) {
         NSLog(@"mark--%@--param-%@\n-Error--%@",mark,param,msg);
-        [self ry_reponsFaildWithPath:mark code:code msg:msg];
+        [self ry_reponsFaildWithPath:mark code:code msg:msg reqNetType:FormDataPostReqNetType];
     }];
 }
 -(void)ry_requestPostApi:(NSString *)mark param:(NSDictionary *)param{
     [ASNetTools.shared postWithPath:mark param:param success:^(id _Nonnull json) {
         NSLog(@"mark--%@--param-%@\n-json--%@",mark,param,json);
-        [self ry_respnsSucessWithPath:mark data:json];
+        [self ry_respnsSucessWithPath:mark data:json reqNetType:PostReqNetType];
     } faild:^(NSString * _Nonnull code, NSString * _Nonnull msg) {
         NSLog(@"mark--%@--param-%@\n-Error--%@",mark,param,msg);
-        [self ry_reponsFaildWithPath:mark code:code msg:msg];
+        [self ry_reponsFaildWithPath:mark code:code msg:msg reqNetType:PostReqNetType];
     }];
 }
 -(void)ry_requestGetApi:(NSString *)mark param:(NSDictionary *)param{
     [ASNetTools.shared getWithPath:mark param:param success:^(id _Nonnull  json) {
         NSLog(@"mark--%@--param-%@\n-json--%@",mark,param,json);
-        [self ry_respnsSucessWithPath:mark data:json];
+        [self ry_respnsSucessWithPath:mark data:json reqNetType:GetReqNetType];
     } faild:^(NSString * _Nonnull code, NSString * _Nonnull msg) {
         NSLog(@"mark--%@--param-%@\n-Error--%@",mark,param,msg);
-        [self ry_reponsFaildWithPath:mark code:code msg:msg];
+        [self ry_reponsFaildWithPath:mark code:code msg:msg reqNetType:GetReqNetType];
+    }];
+}
+-(void)ry_requestPutApi:(NSString *)mark param:(NSString *)paramStr{
+    [ASNetTools.shared putWithPath:[NSString stringWithFormat:@"%@/%@",mark,paramStr] param:@{} success:^(id _Nonnull  json) {
+        NSLog(@"mark--%@--param-%@\n-json--%@",mark,paramStr,json);
+        [self ry_respnsSucessWithPath:mark data:json reqNetType:PutReqNetType];
+    } faild:^(NSString * _Nonnull code, NSString * _Nonnull msg) {
+        NSLog(@"mark--%@--param-%@\n-Error--%@",mark,paramStr,msg);
+        [self ry_reponsFaildWithPath:mark code:code msg:msg reqNetType:PutReqNetType];
     }];
 }
 
--(void)ry_requestDeleteApi:(NSString *)mark param:(NSDictionary *)param{
-    [ASNetTools.shared delWithPath:mark param:param success:^(id _Nonnull json) {
-        NSLog(@"mark--%@--param-%@\n-json--%@",mark,param,json);
-        [self ry_respnsSucessWithPath:mark data:json];
+
+-(void)ry_requestDeleteApi:(NSString *)mark paramStr:(NSString *)paramStr{
+    [ASNetTools.shared delWithPath:[NSString stringWithFormat:@"%@/%@",mark,paramStr] param:@{} success:^(id _Nonnull json) {
+        NSLog(@"mark--%@--param-%@\n-json--%@",mark,paramStr,json);
+        [self ry_respnsSucessWithPath:mark data:json reqNetType:DeleteReqNetType];
     } faild:^(NSString * _Nonnull code, NSString * _Nonnull msg) {
-        NSLog(@"mark--%@--param-%@\n-Error--%@",mark,param,msg);
-        [self ry_reponsFaildWithPath:mark code:code msg:msg];
+        NSLog(@"mark--%@--param-%@\n-Error--%@",mark,paramStr,msg);
+        [self ry_reponsFaildWithPath:mark code:code msg:msg reqNetType:DeleteReqNetType];
     }];
 }
 
 
 
+
 //重写的方法 解析之后再传给 VC
--(void)ry_respnsSucessWithPath:(NSString *)path data:(id)data{
-    [self ry_VMconfigDelegateData:data parseAry:[NSMutableArray arrayWithArray:@[data]] success:YES mark:path];
+-(void)ry_respnsSucessWithPath:(NSString *)path data:(id)data reqNetType:(ReqNetType)reqNetType{
+    [self ry_VMconfigDelegateData:data parseAry:[NSMutableArray arrayWithArray:@[data]] success:YES mark:path reqNetType:reqNetType];
 }
 
--(void)ry_reponsFaildWithPath:(NSString *)path code:(NSString *)code msg:(NSString *)msg{
-    [self ry_VMconfigDelegateData:msg parseAry:[NSMutableArray arrayWithArray:@[msg]] success:NO mark:path];
+-(void)ry_reponsFaildWithPath:(NSString *)path code:(NSString *)code msg:(NSString *)msg reqNetType:(ReqNetType)reqNetType{
+    [self ry_VMconfigDelegateData:msg parseAry:[NSMutableArray arrayWithArray:@[msg]] success:NO mark:path reqNetType:reqNetType];
 }
 
 
@@ -75,9 +86,10 @@
 - (void)ry_VMconfigDelegateData:(id)data
                        parseAry:(NSMutableArray *)ary
                         success:(BOOL)success
-                           mark:(NSString *)mark{
-    if([self.delegate respondsToSelector:@selector(ry_respnsData:parseAry:sucess:mark:)]){
-        [self.delegate ry_respnsData:data parseAry:ary sucess:success mark:mark];
+                           mark:(NSString *)mark
+                     reqNetType:(ReqNetType)reqNetType{
+    if([self.delegate respondsToSelector:@selector(ry_respnsData:parseAry:sucess:mark:reqNetType:)]){
+        [self.delegate ry_respnsData:data parseAry:ary sucess:success mark:mark reqNetType:reqNetType];
     }
     
  }

+ 2 - 0
Asteria/Category/NSMutableAttributedString+RYText.m

@@ -85,4 +85,6 @@
     return [self attribute:attributeName atIndex:index effectiveRange:NULL];
 }
 
+
+
 @end

+ 59 - 15
Asteria/Fuction/Cart/Cart_MyCartC.m

@@ -16,6 +16,8 @@
 
 @property (nonatomic, strong) MyCarlTableV *TableV;
 @property (nonatomic, strong) CartTotalsM *totalsM;
+@property (nonatomic, strong) MyCartCouponCellData *couponCellM;
+@property (nonatomic, strong) MyCartGrandTotalCellData *totalCellM;
 
 @end
 
@@ -54,21 +56,26 @@
 - (void)ucm_subVeiwsTapBlock{
     @weakify(self)
     self.TableV.tapClose = ^(NSInteger num, id data) {
-        //num = 0 删除 ,1 countV
+        //num = 0 删除商品 ,1 修改数量 countV
         @strongify(self)
-        if([data isKindOfClass:[ CartTotalsItemsM class]]){
-            switch (num) {  //展开删除的弹窗 wm_todo
-                case 0:{
+        if([data isKindOfClass:[CartTotalsItemsM class]]){
+            switch (num) {
+                case 0:
                     [self reqNet_DEL_cartsMineItems:(CartTotalsItemsM *)data];
-                }
                     break;
-                case 1:{
+                case 1:
                     [self reqnet_Cart_cartsMineItems_Post:(CartTotalsItemsM *)data];
-                }
                     break;
                 default:
                     break;
             }
+        }else if ([data isKindOfClass:[MyCartCouponCellData class]]){
+            MyCartCouponCellData *couponM = (MyCartCouponCellData *)data;
+            if(num ==0){ //使用优惠券
+                [self reqNet_PUT_cartsMineCoupons:couponM.coupon_code];
+            }else if(num == 1){//删除优惠券
+                [self reqNet_DEL_cartsMineCoupons];
+            }
         }
     };
 }
@@ -77,7 +84,7 @@
 }
 
 #pragma mark - **************** reqNet ****************
-
+///获取购物车
 -(void)reqNet_Cart_cartsMineTotals{
     [MBProgressHUD showHUDAddedTo:self.view animated:YES];
     [self.VM ry_requestGetApi:Cart_cartsMineTotals param:@{}];
@@ -98,14 +105,23 @@
 ///删除商品
 -(void)reqNet_DEL_cartsMineItems:(CartTotalsItemsM *)itemM{
     [MBProgressHUD showHUDAddedTo:self.view animated:YES];
-    NSDictionary *param = @{
-        @"itemId":itemM.item_id,
-    };
-    [self.VM ry_requestDeleteApi:DEL_cartsMineItems param:param];
+    [self.VM ry_requestDeleteApi:DEL_cartsMineItems paramStr:itemM.item_id];
 }
+-(void)reqNet_PUT_cartsMineCoupons:(NSString *)coupon{
+    [MBProgressHUD showHUDAddedTo:self.view animated:YES];
 
+    [self.VM ry_requestPutApi:PUT_cartsMineCoupons param:coupon];
+}
+-(void)reqNet_DEL_cartsMineCoupons{
+    [MBProgressHUD showHUDAddedTo:self.view animated:YES];
+    [self.VM ry_requestDeleteApi:DEL_cartsMineCoupons paramStr:@""];
+}
 
-- (void)ry_respnsData:(id)data parseAry:(NSMutableArray *)arry sucess:(BOOL)sucessOrFail mark:(NSString *)mark{
+- (void)ry_respnsData:(id)data 
+             parseAry:(NSMutableArray *)arry
+               sucess:(BOOL)sucessOrFail 
+                 mark:(NSString *)mark
+           reqNetType:(ReqNetType)reqNetType{
     [MBProgressHUD hideHUDForView:self.view animated:YES];
     if([mark isEqualToString:Cart_cartsMineTotals]){
         if(sucessOrFail){
@@ -115,10 +131,22 @@
             self.top_priceLab.text =[NSString stringWithFormat:@"%@%@",model.currency_symbol,model.subtotal];
             [self.TableV.infodata removeAllObjects];
             self.TableV.infodata = [NSMutableArray arrayWithArray:model.items];
+            
+            self.couponCellM.couponAry =[NSMutableArray arrayWithArray: [ASNetTools shared].xxx_couponAry];
+            self.couponCellM.coupon_code = model.coupon_code;
+            self.couponCellM.discount_amount = model.discount_amount;
+            self.couponCellM.currency_symbol = model.currency_symbol;
+            [self.TableV.infodata addObject:self.couponCellM];
+            
+            self.totalCellM.total_segments = [NSMutableArray arrayWithArray:model.total_segments];
+            self.totalCellM.currency_symbol = model.currency_symbol;
+            [self.TableV.infodata addObject:self.totalCellM];
+            
             [self.TableV reloadData];
         }
-    }else if ([mark isEqualToString:Cart_cartsMineItems_Post]){
-        [MBProgressHUD hideHUDForView:self.view animated:YES];
+    }else if ([mark isEqualToString:Cart_cartsMineItems_Post]
+              || [mark isEqualToString:DEL_cartsMineItems]
+              || [mark isEqualToString:PUT_cartsMineCoupons]){
         if(sucessOrFail){
             [self reqNet_Cart_cartsMineTotals];
         }else{
@@ -166,4 +194,20 @@
     return  _top_priceLab;
 }
 
+
+- (MyCartCouponCellData *)couponCellM {
+    if (!_couponCellM) {
+        _couponCellM = [[MyCartCouponCellData alloc] init];
+    }
+    return _couponCellM;
+}
+
+
+- (MyCartGrandTotalCellData *)totalCellM {
+    if (!_totalCellM) {
+        _totalCellM = [[MyCartGrandTotalCellData alloc] init];
+    }
+    return _totalCellM;
+}
+
 @end

+ 23 - 0
Asteria/Fuction/Cart/Cell/MyCartCouponCell.h

@@ -0,0 +1,23 @@
+//
+//  MyCartCouponCell.h
+//  Asteria
+//
+//  Created by 王猛 on 2024/2/1.
+//
+
+#import <WMBase/WMBase.h>
+
+NS_ASSUME_NONNULL_BEGIN
+@interface MyCartCouponCellData : NSObject
+@property (nonatomic, strong) NSMutableArray <NSDictionary*>*couponAry;
+@property (nonatomic, strong) NSString *coupon_code;
+@property (nonatomic, strong) NSString *discount_amount;
+@property (nonatomic, strong) NSString *currency_symbol;
+@end
+
+@interface MyCartCouponCell : TT_BaseCell
+@property (nonatomic, strong) MyCartCouponCellData *cellData;
+
+@end
+
+NS_ASSUME_NONNULL_END

+ 212 - 0
Asteria/Fuction/Cart/Cell/MyCartCouponCell.m

@@ -0,0 +1,212 @@
+//
+//  MyCartCouponCell.m
+//  Asteria
+//
+//  Created by 王猛 on 2024/2/1.
+//
+
+#import "MyCartCouponCell.h"
+@implementation MyCartCouponCellData
+@end
+@interface MyCartCouponCell ()
+@property (nonatomic, strong) UIView *bgView;
+@property (nonatomic, strong) UILabel *titleLab;
+@property (nonatomic, strong) UILabel *priceLab;
+@property (nonatomic, strong) TT_CustonTF  *codeTF;
+@property (nonatomic, strong) UIButton *applyBtn;
+@property (nonatomic, strong) QMUILabel *couponDesLab;
+@end
+@implementation MyCartCouponCell
+
+- (void)awakeFromNib {
+    [super awakeFromNib];
+    // Initialization code
+}
+
+- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
+    [super setSelected:selected animated:animated];
+
+    // Configure the view for the selected state
+}
+
+- (void)setupSubviewS{  //height 200
+    self.backgroundColor = [UIColor colorWithHexString:@"#F8F8F8"];
+    [self.contentView  addSubview:self.bgView];
+    [self.bgView addSubview:self.titleLab];
+    [self.bgView addSubview:self.priceLab];
+ 
+    UIView *applyTmpV = [[UIView alloc]init];
+    applyTmpV.layer.borderColor = [UIColor colorWithHexString:@"#0B0B0B"].CGColor;
+    applyTmpV.layer.cornerRadius = 4;
+    applyTmpV.layer.borderWidth = 1;
+    applyTmpV.clipsToBounds = YES;
+    [self.bgView addSubview:applyTmpV];
+    [applyTmpV addSubview:self.codeTF];
+    [applyTmpV addSubview:self.applyBtn];
+    
+    [self.bgView addSubview:self.couponDesLab];
+    
+    [self.bgView mas_makeConstraints:^(MASConstraintMaker *make) {
+        make.left.top.mas_equalTo(10);
+        make.right.mas_equalTo(-10);
+        make.bottom.mas_equalTo(0);
+    }];
+    [self.titleLab mas_makeConstraints:^(MASConstraintMaker *make) {
+        make.left.mas_equalTo(10);
+        make.top.mas_equalTo(20);
+        make.height.mas_equalTo(20);
+        make.width.mas_equalTo(150);
+    }];
+    [self.priceLab mas_makeConstraints:^(MASConstraintMaker *make) {
+        make.left.equalTo(self.titleLab.mas_right).offset(20);
+        make.right.mas_equalTo(-10);
+        make.top.mas_equalTo(20);
+        make.height.mas_equalTo(20);
+    }];
+    
+    [applyTmpV mas_makeConstraints:^(MASConstraintMaker *make) {
+        make.top.equalTo(self.titleLab.mas_bottom).offset(20);
+        make.left.mas_equalTo(10);
+        make.right.mas_equalTo(-10);
+        make.height.mas_equalTo(45);
+    }];
+    [self.codeTF mas_makeConstraints:^(MASConstraintMaker *make) {
+        make.left.top.bottom.equalTo(applyTmpV);
+        make.width.mas_equalTo(self.codeTF.mj_w);
+    }];
+    [self.applyBtn mas_makeConstraints:^(MASConstraintMaker *make) {
+        make.right.top.bottom.equalTo(applyTmpV);
+        make.width.mas_equalTo(self.applyBtn.mj_w);
+    }];
+    
+    [self.couponDesLab mas_makeConstraints:^(MASConstraintMaker *make) {
+        make.left.mas_equalTo(20);
+        make.width.mas_equalTo(KScreenWidth-60);
+        make.top.equalTo(applyTmpV.mas_bottom).offset(10);
+        make.bottom.mas_equalTo(-20);
+    }];
+    
+}
+#pragma mark - **************** handle_ApplyEvent ****************
+-(void)handle_ApplyEvent:(UIButton *)btn{
+    if( self.codeTF.text.length == 0){
+        [[Current_normalTool topViewController].view makeToast:@"Please fill in the coupon code first" duration:2 position:CSToastPositionCenter];
+        return;
+    }
+    if(btn.selected == NO){
+        self.cellData.coupon_code  = self.codeTF.text;
+        if(self.currencyparameterClose){
+            self.currencyparameterClose(0,self.cellData);
+        }
+    }else{
+        self.cellData.coupon_code  = @"";
+        if(self.currencyparameterClose){
+            self.currencyparameterClose(1, self.cellData);
+        }
+    }
+}
+
+- (void)configData:(id)Data{
+    MyCartCouponCellData *model = (MyCartCouponCellData *)Data;
+    self.cellData = model;
+    NSString *disountStr = @"0";
+    if([model.discount_amount floatValue] <0.00){
+        CGFloat temF =fabsf([model.discount_amount floatValue]);
+        disountStr =   [NSString stringWithFormat:@"-%@%.2f",model.currency_symbol,temF];
+    }
+    self.priceLab.text = disountStr;
+    if(![model.coupon_code isEmpty] && model.coupon_code.length>0){
+        self.codeTF.text = MM_str(model.coupon_code);
+        self.applyBtn.selected = YES;
+    }else{
+        self.codeTF.text = @"";
+        self.applyBtn.selected = NO;
+    }
+    NSMutableAttributedString *couponStr = [[NSMutableAttributedString alloc]init];
+    for (int i=0; i<model.couponAry.count; i++) {
+        NSDictionary *dic = model.couponAry[i];
+        NSString *temStr = [NSString stringWithFormat:@"%@,%@",dic[@"title"],dic[@"code"]];
+        [couponStr appendAttributedString:[[NSAttributedString alloc]initWithString:temStr]];
+        if(i != model.couponAry.count-1){
+            [couponStr appendAttributedString:[[NSAttributedString alloc]initWithString:@"\n"]];
+        }
+    }
+    
+    couponStr.color = [UIColor colorWithHexString:@"#B2B2B2"];
+    couponStr.font = [UIFont fontWithName:Rob_Regular size:12];
+    NSMutableParagraphStyle *paragraphStyle = [[NSMutableParagraphStyle alloc] init];
+    [paragraphStyle setLineSpacing:8];//设置距离
+    [couponStr addAttribute:NSParagraphStyleAttributeName
+    value:paragraphStyle
+    range:NSMakeRange(0, [couponStr length])];
+    self.couponDesLab.attributedText = couponStr;
+
+}
+
+
+#pragma mark - **************** lazy ****************
+-(UIView *)bgView{
+    if(!_bgView){
+        _bgView = [[UIView alloc]init];
+        _bgView.backgroundColor = [UIColor colorWithHexString:@"#FFFFFF"];
+        _bgView.layer.cornerRadius = 4;
+        _bgView.clipsToBounds = YES;
+    }
+    return _bgView;
+}
+-(UILabel *)titleLab{
+    if(!_titleLab){
+        _titleLab = [[UILabel alloc]init];
+        _titleLab.text = @"Discount Codes";
+        _titleLab.textColor = [UIColor colorWithHexString:@"#000000"];
+        _titleLab.font = [UIFont fontWithName:Rob_Bold size:16];
+    }
+    return _titleLab;
+}
+
+-(UILabel *)priceLab{
+    if(!_priceLab){
+        _priceLab = [[UILabel alloc]init];
+        _priceLab.textAlignment = NSTextAlignmentRight;
+        _priceLab.textColor = [UIColor colorWithHexString:@"#0B0B0B"];
+        _priceLab.font = [UIFont fontWithName:Rob_Bold size:14];
+    }
+    return _priceLab;
+}
+
+-(TT_CustonTF *)codeTF{
+    if(!_codeTF){
+        _codeTF = [[TT_CustonTF alloc]initWithFrame:CGRectMake(10, 0, KScreenWidth-20-95, 45)];
+        _codeTF.placeholder = @"Enter Your Coupon Code";
+        _codeTF.font = [UIFont fontWithName:Rob_Regular size:14];
+    }
+    return _codeTF;
+}
+-(UIButton *)applyBtn{
+    if(!_applyBtn){
+        _applyBtn = [UIButton buttonWithType:UIButtonTypeCustom];
+        _applyBtn.frame = CGRectMake(0, 0, 95, 45);
+        [_applyBtn setTitle:@"APPLY" forState:UIControlStateNormal];
+        [self.applyBtn setTitle:@"CANCEL" forState:UIControlStateSelected];
+        _applyBtn.backgroundColor = [UIColor colorWithHexString:@"#0B0B0B"];
+        [_applyBtn setTitleColor:[UIColor colorWithHexString:@"#FFFFFF"] forState:UIControlStateNormal];
+        [_applyBtn addTarget:self action:@selector(handle_ApplyEvent:) forControlEvents:UIControlEventTouchUpInside];
+        _applyBtn.titleLabel.font = [UIFont fontWithName:Rob_Regular size:16];
+        _applyBtn.layer.cornerRadius = 4;
+        
+    }
+    return _applyBtn;
+}
+
+
+-(QMUILabel *)couponDesLab{
+    if(!_couponDesLab){
+        _couponDesLab = [[QMUILabel alloc]init];
+        _couponDesLab.numberOfLines = 0;
+        _couponDesLab.font = [UIFont fontWithName:Rob_Regular size:12];
+        _couponDesLab.textColor = [UIColor colorWithHexString:@"#B2B2B2"];
+        _couponDesLab.preferredMaxLayoutWidth =KScreenWidth-40;
+    }
+    return _couponDesLab;
+}
+@end

+ 39 - 0
Asteria/Fuction/Cart/Cell/MyCartGrandTotalCell.h

@@ -0,0 +1,39 @@
+//
+//  MyCartGrandTotalCell.h
+//  Asteria
+//
+//  Created by 王猛 on 2024/2/2.
+//
+
+#import <WMBase/WMBase.h>
+
+NS_ASSUME_NONNULL_BEGIN
+@class SubtotalCellItemV;
+@class SubLoastSelectItemV;
+@interface MyCartGrandTotalCellData : NSObject
+@property (nonatomic, strong) NSMutableArray *total_segments;
+@property (nonatomic, strong) NSString *currency_symbol;
+@end
+@interface MyCartGrandTotalCell : TT_BaseCell
+
+@end
+
+
+@interface SubtotalCellItemV : TT_BaseV
+@property (nonatomic, strong) UILabel *tipsLab;
+@property (nonatomic, strong) UILabel *priceLab;
+-(void)xxx_configTips:(NSString *)tips price:(NSString *)priceStr;
+@end
+
+
+
+@interface SubLoastSelectItemV : TT_BaseV
+
+@property (nonatomic, strong) UILabel *tipsLab;
+@property (nonatomic, strong) UIButton *ridoBtn;
+- (void)xxx_configTips:(NSString *)tips isLost:(BOOL)isLost;
+@end
+
+
+
+NS_ASSUME_NONNULL_END

+ 249 - 0
Asteria/Fuction/Cart/Cell/MyCartGrandTotalCell.m

@@ -0,0 +1,249 @@
+//
+//  MyCartGrandTotalCell.m
+//  Asteria
+//
+//  Created by 王猛 on 2024/2/2.
+//
+
+#import "MyCartGrandTotalCell.h"
+
+
+@implementation MyCartGrandTotalCellData
+
+
+@end
+@interface MyCartGrandTotalCell  ()
+@property (nonatomic, strong) UIView *bgV;
+@property (nonatomic, strong) UIStackView *stackV;
+@property (nonatomic, strong) UIStackView *stackSubTopV;
+@property (nonatomic, strong) SubLoastSelectItemV *subLostV;
+@property (nonatomic, strong) SubtotalCellItemV *subBottomV;
+
+@end
+@implementation MyCartGrandTotalCell
+
+- (void)awakeFromNib {
+    [super awakeFromNib];
+    // Initialization code
+}
+
+- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
+    [super setSelected:selected animated:animated];
+    // Configure the view for the selected state
+}
+- (void)setupSubviewS{
+    self.contentView.backgroundColor = [UIColor colorWithHexString:@"#F8F8F8"];
+    [self.contentView addSubview:self.bgV];
+    [self.bgV mas_makeConstraints:^(MASConstraintMaker *make) {
+        make.edges.equalTo(self.contentView).insets(UIEdgeInsetsMake(10, 10, 0, 10));
+    }];
+    [self.bgV addSubview:self.stackV];
+    [self.stackV mas_makeConstraints:^(MASConstraintMaker *make) {
+        make.edges.equalTo(self.bgV).insets(UIEdgeInsetsMake(0, 10, 0, 10));
+    }];
+    
+    [self.stackV addArrangedSubview:self.stackSubTopV];
+    [self.stackV addArrangedSubview:self.subLostV];
+    [self.stackV addArrangedSubview:self.subBottomV];
+  
+    [self.subLostV mas_makeConstraints:^(MASConstraintMaker *make) {
+        make.height.mas_equalTo(60);
+    }];
+    [self.subBottomV mas_makeConstraints:^(MASConstraintMaker *make) {
+        make.height.mas_equalTo(60);
+    }];
+}
+
+- (void)configData:(id)Data{
+    MyCartGrandTotalCellData *model = (MyCartGrandTotalCellData *)Data;
+///当一个元素被 removeFromSuperview ,则 arrangedSubviews也会同步移除
+    [self.stackSubTopV.arrangedSubviews makeObjectsPerformSelector:@selector(removeFromSuperview)];
+    for (int i=0; i<model.total_segments.count; i++) {
+        NSDictionary *dic = model.total_segments[i];
+        NSString *code = MM_str(dic[@"code"]);
+        if([code isEqualToString:@"amasty_extrafee"]){ //subLostV
+            NSString *tips = [NSString stringWithFormat:@"%@%@%@",dic[@"title"],model.currency_symbol,dic[@"value"]];
+            //wm_todo 需要 获取丢件险状态 carts/mine/fees-information 
+            [self.subLostV xxx_configTips:tips isLost:[dic[@"value"] qmui_CGFloatValue] > 0 ? YES : NO];
+        }else if ([code isEqualToString:@"grand_total"]){ //subBottomV
+            NSString *priceStr = [NSString stringWithFormat:@"%@%@",model.currency_symbol,dic[@"value"]];
+            [self.subBottomV xxx_configTips:dic[@"title"] price:priceStr];
+        }else{ //stackSubTopV
+            NSString *priceStr = @"0";
+            if([code isEqualToString:@"discount"]){
+                if([dic[@"value"] floatValue] <0.00){
+                    CGFloat temF =fabsf([dic[@"value"] floatValue]);
+                    priceStr =   [NSString stringWithFormat:@"-%@%.2f",model.currency_symbol,temF];
+                }
+            }else{
+                priceStr = [NSString stringWithFormat:@"%@%@",model.currency_symbol,dic[@"value"]];
+            }
+            SubtotalCellItemV *itemV = [[SubtotalCellItemV alloc] init];
+            [self.stackSubTopV addArrangedSubview:itemV];
+            [itemV xxx_configTips:dic[@"title"] price:priceStr];
+            [itemV mas_makeConstraints:^(MASConstraintMaker *make) {
+                make.height.mas_equalTo(30);
+            }];
+            
+        }
+    }
+    
+}
+
+- (UIView *)bgV {
+    if (!_bgV) {
+        _bgV = [[UIView alloc] init];
+        _bgV.backgroundColor = [UIColor colorWithHexString:@"#FFFFFF"];
+        _bgV.layer.cornerRadius = 4;
+        _bgV.clipsToBounds = YES;
+    }
+    return _bgV;
+}
+- (UIStackView *)stackV { ///根据高度进行变化
+    if (!_stackV) {
+        UIStackView *stv = [[UIStackView alloc] init];
+        stv.backgroundColor = [UIColor colorWithHexString:@"#F4F4F4"];
+        stv.axis = UILayoutConstraintAxisVertical;
+        stv.distribution = UIStackViewDistributionFill;
+        stv.alignment = UIStackViewAlignmentFill;
+        stv.spacing = 1;
+        _stackV = stv;
+    }
+    return _stackV;
+}
+
+- (UIStackView *)stackSubTopV {
+    if (!_stackSubTopV) {
+        UIStackView *stv = [[UIStackView alloc] init];
+        stv.backgroundColor = [UIColor colorWithHexString:@"#FFFFFF"];
+        stv.axis = UILayoutConstraintAxisVertical;
+        stv.distribution = UIStackViewDistributionFill;
+        stv.alignment = UIStackViewAlignmentFill;
+        stv.spacing = 5;
+        _stackSubTopV = stv;
+    }
+    return _stackSubTopV;
+}
+
+
+- (SubLoastSelectItemV *)subLostV {
+    if (!_subLostV) {
+        _subLostV = [[SubLoastSelectItemV alloc] init];
+        _subLostV.backgroundColor = [UIColor colorWithHexString:@"#FFFFFF"];
+    }
+    return _subLostV;
+}
+
+
+- (SubtotalCellItemV *)subBottomV {
+    if (!_subBottomV) {
+        _subBottomV = [[SubtotalCellItemV alloc] init];
+        _subBottomV.backgroundColor = [UIColor colorWithHexString:@"#FFFFFF"];
+        _subBottomV.tipsLab.font = [UIFont fontWithName:Rob_Bold size:14];
+        _subBottomV.priceLab.font = [UIFont fontWithName:Rob_Bold size:24];
+    }
+    return _subBottomV;
+}
+@end
+
+@interface SubtotalCellItemV ()
+
+@end
+@implementation SubtotalCellItemV
+- (void)tt_setupViews{
+    [self addSubview:self.tipsLab];
+    [self addSubview:self.priceLab];
+    [self.tipsLab mas_makeConstraints:^(MASConstraintMaker *make) {
+        make.left.mas_equalTo(0);
+        make.top.mas_equalTo(0);
+        make.height.mas_equalTo(30);
+    }];
+    [self.priceLab mas_makeConstraints:^(MASConstraintMaker *make) {
+        make.left.equalTo(self.tipsLab.mas_right).offset(10);
+        make.right.mas_equalTo(0);
+        make.top.mas_equalTo(0);
+        make.height.mas_equalTo(30);
+    }];
+}
+-(void)xxx_configTips:(NSString *)tips price:(NSString *)priceStr{
+    self.tipsLab.text = tips;
+    self.priceLab.text = priceStr;
+}
+-(UILabel *)tipsLab{
+    if(!_tipsLab){
+        _tipsLab = [[UILabel alloc]init];
+        _tipsLab.textColor = [UIColor colorWithHexString:@"#0B0B0B"];
+        _tipsLab.font = [UIFont fontWithName:Rob_Regular size:14];
+        _tipsLab.numberOfLines =2;
+    }
+    return _tipsLab;
+}
+-(UILabel *)priceLab{
+    if(!_priceLab){
+        _priceLab = [[UILabel alloc]init];
+        _priceLab.textColor = [UIColor colorWithHexString:@"#0B0B0B"];
+        _priceLab.font = [UIFont fontWithName:Rob_Regular size:14];
+        _priceLab.textAlignment = NSTextAlignmentRight;
+    }
+    return _priceLab;
+}
+@end
+///点击cell
+@interface SubLoastSelectItemV ()
+
+@end
+@implementation SubLoastSelectItemV
+
+- (void)tt_setupViews{
+    [self addSubview:self.tipsLab];
+    [self addSubview:self.ridoBtn];
+    [self.tipsLab mas_makeConstraints:^(MASConstraintMaker *make) {
+        make.left.equalTo(self);
+        make.centerY.equalTo(self);
+        make.right.mas_equalTo(-50);
+    }];
+    [self.ridoBtn mas_makeConstraints:^(MASConstraintMaker *make) {
+        make.width.mas_equalTo(50);
+        make.height.mas_equalTo(50);
+        make.right.equalTo(self);
+    }];
+}
+
+-(void)handle_ridoBtnEvent:(UIButton *)btn{
+    btn.selected = !btn.selected;
+    if(self.ViewtapClose){
+        self.ViewtapClose(btn.selected, @"");
+    }
+}
+- (void)xxx_configTips:(NSString *)tips isLost:(BOOL)isLost{
+    self.tipsLab.text = tips;
+    self.ridoBtn.selected = isLost;
+}
+
+
+-(UILabel *)tipsLab{
+    if(!_tipsLab){
+        _tipsLab = [[UILabel alloc]init];
+        _tipsLab.textColor = [UIColor colorWithHexString:@"#0B0B0B"];
+        _tipsLab.font = [UIFont fontWithName:Rob_Regular size:14];
+        _tipsLab.numberOfLines =2;
+    }
+    return _tipsLab;
+}
+
+-(UIButton *)ridoBtn{
+    if(!_ridoBtn){
+        _ridoBtn = [UIButton buttonWithType:UIButtonTypeCustom];
+        [_ridoBtn setImage:[UIImage imageNamed:@"base_radio_unselect"] forState:UIControlStateNormal];
+        [_ridoBtn setImage:[UIImage imageNamed:@"base_radio_select"] forState:UIControlStateSelected];
+        [_ridoBtn addTarget:self action:@selector(handle_ridoBtnEvent:) forControlEvents:UIControlEventTouchUpInside];
+    }
+    return _ridoBtn;
+}
+@end
+
+
+
+
+
+

+ 5 - 0
Asteria/Fuction/Cart/M/CartTotalsM.h

@@ -13,11 +13,16 @@ NS_ASSUME_NONNULL_BEGIN
 @property (nonatomic, copy) NSString *subtotal;
 @property (nonatomic, copy) NSString *grand_total;
 @property (nonatomic, copy) NSString *items_qty;
+
+@property (nonatomic, copy) NSString *discount_amount;
+@property (nonatomic, copy) NSString *coupon_code;
 @property (nonatomic, strong) NSMutableArray <CartTotalsItemsM *>*items;
 
 @property (nonatomic, copy) NSDictionary *extension_attributes;
 @property (nonatomic, copy) NSString *currency_symbol;
 @property (nonatomic, copy) NSString *cart_id;
+///Grand total 相关内容
+@property (nonatomic, strong) NSArray *total_segments;
 
 
 @end

+ 5 - 1
Asteria/Fuction/Cart/V/MyCarlTableV.h

@@ -6,7 +6,11 @@
 //
 
 #import <WMBase/WMBase.h>
-
+#import "MyCartItemCell.h"
+#import "MyCartCouponCell.h"
+#import "MyCartGrandTotalCell.h"
+#import "GoodsSizePayMentCell.h"
+#import "MyCartGrandTotalCell.h"
 NS_ASSUME_NONNULL_BEGIN
 
 @interface MyCarlTableV : TT_BaseTableV

+ 18 - 1
Asteria/Fuction/Cart/V/MyCarlTableV.m

@@ -6,7 +6,6 @@
 //
 
 #import "MyCarlTableV.h"
-#import "MyCartItemCell.h"
 
 @implementation MyCarlTableV
 - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath{
@@ -20,6 +19,24 @@
             [self generaltriggermethodType:type data:Data];
         };
         return  cell;
+    }else if([objectM isKindOfClass:[MyCartCouponCellData class]]){
+        MyCartCouponCell *cell = [MyCartCouponCell cellWithTableView:tableView CellClass:[MyCartCouponCell class]];
+        [cell configData:(MyCartCouponCellData *)objectM];
+        @weakify(self)
+        cell.currencyparameterClose = ^(NSInteger type, id Data) {
+            @strongify(self)
+            [self generaltriggermethodType:type data:Data];
+        };
+        return cell;
+    }else if([objectM isKindOfClass:[MyCartGrandTotalCellData class]]){
+        MyCartGrandTotalCell *cell = [MyCartGrandTotalCell cellWithTableView:tableView CellClass:[MyCartGrandTotalCell class]];
+        [cell configData:(MyCartGrandTotalCellData *)objectM];
+        @weakify(self)
+        cell.currencyparameterClose = ^(NSInteger type, id Data) {
+            @strongify(self)
+            [self generaltriggermethodType:type data:Data];
+        };
+        return cell;
     }
     return  nil;
 }

+ 2 - 6
Asteria/Fuction/Cart/VM/CartVM.h

@@ -14,13 +14,9 @@
 //删除购物车商品
 #define DEL_cartsMineItems BaseRequestrUrl(@"carts/mine/items")
 //添加优惠券
-#define Cart_cartsMineCoupons_Get  BaseRequestrUrl(@"carts/mine/coupons")
+#define PUT_cartsMineCoupons  BaseRequestrUrl(@"carts/mine/coupons")
 //删除购物车优惠券
-#define Cart_cartsMineTotals_Del BaseRequestrUrl(@"carts/mine/coupons")
-
-
-
-
+#define DEL_cartsMineCoupons BaseRequestrUrl(@"carts/mine/coupons")
 
 
 NS_ASSUME_NONNULL_BEGIN

+ 3 - 3
Asteria/Fuction/Cart/VM/CartVM.m

@@ -8,7 +8,7 @@
 #import "CartVM.h"
 
 @implementation CartVM
-- (void)ry_respnsSucessWithPath:(NSString *)mark data:(id)data{
+- (void)ry_respnsSucessWithPath:(NSString *)mark data:(id)data reqNetType:(ReqNetType)reqNetType{
     if([mark isEqualToString:Cart_cartsMineTotals]){
         CartTotalsM *model = [CartTotalsM mj_objectWithKeyValues:data];
         if(model.extension_attributes){
@@ -32,9 +32,9 @@
             }
         }
         NSMutableArray *ary = [NSMutableArray arrayWithArray:@[model]];
-        [self ry_VMconfigDelegateData:data parseAry:ary success:YES mark:mark];
+        [self ry_VMconfigDelegateData:data parseAry:ary success:YES mark:mark reqNetType:reqNetType];
     }else{
-        [self ry_VMconfigDelegateData:data parseAry:[NSMutableArray array] success:YES mark:mark];
+        [self ry_VMconfigDelegateData:data parseAry:[NSMutableArray array] success:YES mark:mark reqNetType:reqNetType];
     }
 }
 @end

BIN
Asteria/Fuction/Goods/Assets/Goods.xcassets/goods_close_black.imageset/组 8609.png


BIN
Asteria/Fuction/Goods/Assets/Goods.xcassets/goods_close_black.imageset/组 8609@2x.png


BIN
Asteria/Fuction/Goods/Assets/Goods.xcassets/goods_close_black.imageset/组 8609@3x.png


BIN
Asteria/Fuction/Goods/Assets/Goods.xcassets/goods_close_white.imageset/组 9646.png


BIN
Asteria/Fuction/Goods/Assets/Goods.xcassets/goods_close_white.imageset/组 9646@2x.png


BIN
Asteria/Fuction/Goods/Assets/Goods.xcassets/goods_close_white.imageset/组 9646@3x.png


+ 2 - 1
Asteria/Fuction/Goods/Revies/GoodsReviewsWriteC.m

@@ -265,7 +265,8 @@ RY_baseVMprotocol>
 - (void)ry_respnsData:(nullable id)data
              parseAry:(nullable NSMutableArray *)arry
                sucess:(BOOL)sucessOrFail
-                 mark:(nonnull NSString *)mark {
+                 mark:(nonnull NSString *)mark 
+           reqNetType:(ReqNetType)reqNetType{
     [MBProgressHUD hideHUDForView:self.view animated:YES];
     if([mark isEqualToString:Reivews_rewriteProductAddImg]){
         if(sucessOrFail){

+ 1 - 1
Asteria/Fuction/Goods/V/GoodsDetailsPayV.m

@@ -27,7 +27,7 @@
 
 -(void)pay_payBtnType:(UIButton *)btn{
     NSArray *alertvImgAry = @[@"goods_alertv_paypal",@"goods_alertv_afterpay"];
-    NSArray *closeImgAry = @[@"goods_close_white",@"goods_close_black"];
+    NSArray *closeImgAry = @[@"base_close_white",@"base_close_black"];
     AlertMyCartDeleteV *payAlertV = [[AlertMyCartDeleteV alloc]initWithPaytypeAlertV:[UIImage imageNamed:alertvImgAry[btn.tag-GoodsInfoPayTypeTag]] closeBtnImg:[UIImage imageNamed:closeImgAry[btn.tag-GoodsInfoPayTypeTag]]];
     [payAlertV alertv_show];
     

+ 2 - 1
Asteria/Fuction/Goods/VC/AS_GoodsDetailsC.m

@@ -65,7 +65,8 @@
 -(void)ry_respnsData:(nullable id)data
             parseAry:(nullable NSMutableArray *)arry
               sucess:(BOOL)sucessOrFail
-                mark:(NSString *)mark{
+                mark:(NSString *)mark
+          reqNetType:(ReqNetType)reqNetType{
     [MBProgressHUD hideHUDForView:self.view animated:YES];
     if(sucessOrFail){
         if([mark isEqualToString:Goods_productGetProductsById]){

+ 2 - 1
Asteria/Fuction/Goods/VC/AS_GoodsReviewsListC.m

@@ -124,7 +124,8 @@
 -(void)ry_respnsData:(nullable id)data
             parseAry:(nullable NSMutableArray *)arry
               sucess:(BOOL)sucessOrFail
-                mark:(NSString *)mark{
+                mark:(NSString *)mark
+          reqNetType:(ReqNetType)reqNetType{
     [MBProgressHUD hideHUDForView:self.view animated:YES];
     if(sucessOrFail){ ///如何加载相关的评论页面
         if([mark isEqualToString:Goods_productGetProductsReview]){

+ 6 - 2
Asteria/Fuction/Goods/VC/AS_GoodsSizeC.m

@@ -44,7 +44,7 @@
 - (void)ucm_configNavbar{
     self.navigationController.navigationBar.hidden = YES;
     UIButton *closeBtn = [UIButton buttonWithType:UIButtonTypeCustom];
-    [closeBtn setImage:[UIImage imageNamed:@"goods_close_black"] forState:UIControlStateNormal];
+    [closeBtn setImage:[UIImage imageNamed:@"base_close_black"] forState:UIControlStateNormal];
     [closeBtn addTarget:self action:@selector(handle_closeVC) forControlEvents:UIControlEventTouchUpInside];
     [self.view addSubview:closeBtn];
     NSInteger top = IPHONEX ? 44 : 20;
@@ -190,7 +190,11 @@
     [MBProgressHUD showHUDAddedTo:self.view animated:YES];
     [self.VM ry_formDataRequestPostApi:Size_rewriteCartAddProducts param:params];
 }
-- (void)ry_respnsData:(id)data parseAry:(NSMutableArray *)arry sucess:(BOOL)sucessOrFail mark:(NSString *)mark{
+- (void)ry_respnsData:(id)data 
+             parseAry:(NSMutableArray *)arry
+               sucess:(BOOL)sucessOrFail
+                 mark:(NSString *)mark
+           reqNetType:(ReqNetType)reqNetType{
     [MBProgressHUD hideHUDForView:self.view animated:YES];
     if(sucessOrFail){
         [self.view makeToast:@"Success" duration:2 position:CSToastPositionCenter title:nil image:nil style:nil completion:^(BOOL didTap) {

+ 4 - 4
Asteria/Fuction/Goods/VM/ASGoodsDetailsVM.m

@@ -8,17 +8,17 @@
 #import "ASGoodsDetailsVM.h"
 
 @implementation ASGoodsDetailsVM
-- (void)ry_respnsSucessWithPath:(NSString *)mark data:(id)data{
+- (void)ry_respnsSucessWithPath:(NSString *)mark data:(id)data reqNetType:(ReqNetType)reqNetType{
     if([mark isEqualToString:Goods_productGetProductsById]){
         GoodsInformationM *model = [GoodsInformationM mj_objectWithKeyValues:data];
         [ASGoodsDetailsVM tool_addGooodsImgUrlValue:model];
         NSMutableArray *ary = [NSMutableArray arrayWithArray:@[model]];
-        [self ry_VMconfigDelegateData:data parseAry:ary success:YES mark:mark];
+        [self ry_VMconfigDelegateData:data parseAry:ary success:YES mark:mark reqNetType:reqNetType];
     }else if ([mark isEqualToString:Goods_productGetProductsReview]){
         NSMutableArray <GoodsReviewsListM *>*array = [GoodsReviewsListM mj_objectArrayWithKeyValuesArray:data[@"items"]];
-        [self ry_VMconfigDelegateData:data parseAry:array success:YES mark:mark];
+        [self ry_VMconfigDelegateData:data parseAry:array success:YES mark:mark reqNetType:reqNetType];
     }else{
-        [self ry_VMconfigDelegateData:data parseAry:nil success:YES mark:mark];
+        [self ry_VMconfigDelegateData:data parseAry:[NSMutableArray array] success:YES mark:mark reqNetType:reqNetType];
     }
 }
 

+ 3 - 0
Asteria/NetTools/ASNetTools.h

@@ -40,7 +40,10 @@ NS_ASSUME_NONNULL_BEGIN
 +(void)xxx_loginWithParam:(NSDictionary *)param
                  success:(void(^)(id))success
                    faild:(void(^)(NSString *code, NSString *msg))faild;
+///获取广告位优惠卷列表
++(void)reqNet_getAdvCoupons;
 
+@property (nonatomic, strong)NSMutableArray <NSDictionary *>*xxx_couponAry;
 
 @end
 

+ 15 - 1
Asteria/NetTools/ASNetTools.m

@@ -430,5 +430,19 @@
     }];
 }
 
-
+///获取广告位优惠卷列表
++(void)reqNet_getAdvCoupons{
+    [ASNetTools.shared getWithPath:BaseRequestrUrl(@"advCoupons") param:@{} success:^(id _Nonnull result) {
+        [ASNetTools shared].xxx_couponAry = result;
+    } faild:^(NSString * _Nonnull code, NSString * _Nonnull msg) {
+        
+    }];
+    
+}
+-(NSMutableArray *)xxx_couponAry{
+    if(!_xxx_couponAry){
+        _xxx_couponAry = [[NSMutableArray alloc]init];
+    }
+    return _xxx_couponAry;
+}
 @end