Explorar el Código

Cart 页面开发

wangmeng hace 1 año
padre
commit
a72967ecfc

+ 90 - 0
Asteria.xcodeproj/project.pbxproj

@@ -181,6 +181,9 @@
 		9A1247942A1B082300126226 /* Fuction_Tool.m in Sources */ = {isa = PBXBuildFile; fileRef = 9A1247932A1B082300126226 /* Fuction_Tool.m */; };
 		9A1247972A1B0A2800126226 /* AS_ForgotC.m in Sources */ = {isa = PBXBuildFile; fileRef = 9A1247962A1B0A2800126226 /* AS_ForgotC.m */; };
 		9A2027F52A137B8600FF4DAF /* AuthenticationServices.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 9A2027F42A137B8600FF4DAF /* AuthenticationServices.framework */; };
+		9A2415B92B677DDF00A6E903 /* Target_Cart.m in Sources */ = {isa = PBXBuildFile; fileRef = 9A2415B82B677DDF00A6E903 /* Target_Cart.m */; };
+		9A2415BC2B6784A500A6E903 /* MyCartItemCell.m in Sources */ = {isa = PBXBuildFile; fileRef = 9A2415BB2B6784A500A6E903 /* MyCartItemCell.m */; };
+		9A2415BF2B678A1100A6E903 /* QtyCountV.m in Sources */ = {isa = PBXBuildFile; fileRef = 9A2415BD2B678A1000A6E903 /* QtyCountV.m */; };
 		9A31EDFD2B468A55009F11EE /* RadioButton.m in Sources */ = {isa = PBXBuildFile; fileRef = 9A31EDFC2B468A54009F11EE /* RadioButton.m */; };
 		9A31EE002B469A73009F11EE /* AS_GoodsReviewsListC.m in Sources */ = {isa = PBXBuildFile; fileRef = 9A31EDFF2B469A73009F11EE /* AS_GoodsReviewsListC.m */; };
 		9A32A2212B4BEA5C005A5831 /* GoodsReviewsCell.m in Sources */ = {isa = PBXBuildFile; fileRef = 9A32A2202B4BEA5C005A5831 /* GoodsReviewsCell.m */; };
@@ -206,6 +209,9 @@
 		9A5F52962B5F59EA007D3791 /* GoodsSizeCountCell.m in Sources */ = {isa = PBXBuildFile; fileRef = 9A5F52932B5F59EA007D3791 /* GoodsSizeCountCell.m */; };
 		9A65DE512A132FB700BB1269 /* LoginThirdAuthV.m in Sources */ = {isa = PBXBuildFile; fileRef = 9A65DE502A132FB700BB1269 /* LoginThirdAuthV.m */; };
 		9A788C442A08A663003E0025 /* Target_Goods.m in Sources */ = {isa = PBXBuildFile; fileRef = 9A788C432A08A663003E0025 /* Target_Goods.m */; };
+		9A78E0142B6389FC00CA4E32 /* Cart_MyCartC.m in Sources */ = {isa = PBXBuildFile; fileRef = 9A78E0132B6389FC00CA4E32 /* Cart_MyCartC.m */; };
+		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 */; };
 		9A98E5072B5A15A500E8C5C1 /* QDSingleImagePickerPreviewViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 9A98E5052B5A15A400E8C5C1 /* QDSingleImagePickerPreviewViewController.m */; };
 		9A98E50A2B5A1EB700E8C5C1 /* Photos.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 9A98E5092B5A1EB700E8C5C1 /* Photos.framework */; };
@@ -282,6 +288,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 */; };
+		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 */; };
 /* End PBXBuildFile section */
@@ -647,6 +654,12 @@
 		9A1247962A1B0A2800126226 /* AS_ForgotC.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = AS_ForgotC.m; sourceTree = "<group>"; };
 		9A2027F32A137B6A00FF4DAF /* Asteria.entitlements */ = {isa = PBXFileReference; lastKnownFileType = text.plist.entitlements; path = Asteria.entitlements; sourceTree = "<group>"; };
 		9A2027F42A137B8600FF4DAF /* AuthenticationServices.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = AuthenticationServices.framework; path = System/Library/Frameworks/AuthenticationServices.framework; sourceTree = SDKROOT; };
+		9A2415B72B677DDF00A6E903 /* Target_Cart.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = Target_Cart.h; sourceTree = "<group>"; };
+		9A2415B82B677DDF00A6E903 /* Target_Cart.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = Target_Cart.m; sourceTree = "<group>"; };
+		9A2415BA2B6784A500A6E903 /* MyCartItemCell.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = MyCartItemCell.h; sourceTree = "<group>"; };
+		9A2415BB2B6784A500A6E903 /* MyCartItemCell.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = MyCartItemCell.m; sourceTree = "<group>"; };
+		9A2415BD2B678A1000A6E903 /* QtyCountV.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = QtyCountV.m; sourceTree = "<group>"; };
+		9A2415BE2B678A1100A6E903 /* QtyCountV.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = QtyCountV.h; sourceTree = "<group>"; };
 		9A31EDFB2B468A54009F11EE /* RadioButton.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RadioButton.h; sourceTree = "<group>"; };
 		9A31EDFC2B468A54009F11EE /* RadioButton.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = RadioButton.m; sourceTree = "<group>"; };
 		9A31EDFE2B469A73009F11EE /* AS_GoodsReviewsListC.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = AS_GoodsReviewsListC.h; sourceTree = "<group>"; };
@@ -694,6 +707,12 @@
 		9A65DE502A132FB700BB1269 /* LoginThirdAuthV.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = LoginThirdAuthV.m; sourceTree = "<group>"; };
 		9A788C422A08A663003E0025 /* Target_Goods.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = Target_Goods.h; sourceTree = "<group>"; };
 		9A788C432A08A663003E0025 /* Target_Goods.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = Target_Goods.m; sourceTree = "<group>"; };
+		9A78E0122B6389FC00CA4E32 /* Cart_MyCartC.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = Cart_MyCartC.h; sourceTree = "<group>"; };
+		9A78E0132B6389FC00CA4E32 /* Cart_MyCartC.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = Cart_MyCartC.m; sourceTree = "<group>"; };
+		9A78E0162B6396D600CA4E32 /* CartVM.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = CartVM.h; sourceTree = "<group>"; };
+		9A78E0172B6396D600CA4E32 /* CartVM.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = CartVM.m; sourceTree = "<group>"; };
+		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>"; };
 		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>"; };
@@ -829,6 +848,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>"; };
+		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>"; };
 		9AF9085B2B397320008AC2D2 /* UIViewController+RY_configNet.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = "UIViewController+RY_configNet.m"; sourceTree = "<group>"; };
 		9AF9085D2B3976F3008AC2D2 /* RYBaseVM.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = RYBaseVM.h; sourceTree = "<group>"; };
@@ -1697,6 +1718,24 @@
 			path = Tool;
 			sourceTree = "<group>";
 		};
+		9A2415B52B6770D700A6E903 /* Cell */ = {
+			isa = PBXGroup;
+			children = (
+				9A2415BA2B6784A500A6E903 /* MyCartItemCell.h */,
+				9A2415BB2B6784A500A6E903 /* MyCartItemCell.m */,
+			);
+			path = Cell;
+			sourceTree = "<group>";
+		};
+		9A2415B62B677DC000A6E903 /* Target */ = {
+			isa = PBXGroup;
+			children = (
+				9A2415B72B677DDF00A6E903 /* Target_Cart.h */,
+				9A2415B82B677DDF00A6E903 /* Target_Cart.m */,
+			);
+			path = Target;
+			sourceTree = "<group>";
+		};
 		9A2646BA2A187B6100CBFBDC /* Product */ = {
 			isa = PBXGroup;
 			children = (
@@ -1886,6 +1925,38 @@
 			path = V;
 			sourceTree = "<group>";
 		};
+		9A78E0112B6388F500CA4E32 /* Cart */ = {
+			isa = PBXGroup;
+			children = (
+				9A2415B62B677DC000A6E903 /* Target */,
+				9A2415B52B6770D700A6E903 /* Cell */,
+				9AEFA7DB2B649EF700AE1974 /* V */,
+				9A78E0192B63973B00CA4E32 /* M */,
+				9A78E0152B63910A00CA4E32 /* VM */,
+				9A78E0122B6389FC00CA4E32 /* Cart_MyCartC.h */,
+				9A78E0132B6389FC00CA4E32 /* Cart_MyCartC.m */,
+			);
+			path = Cart;
+			sourceTree = "<group>";
+		};
+		9A78E0152B63910A00CA4E32 /* VM */ = {
+			isa = PBXGroup;
+			children = (
+				9A78E0162B6396D600CA4E32 /* CartVM.h */,
+				9A78E0172B6396D600CA4E32 /* CartVM.m */,
+			);
+			path = VM;
+			sourceTree = "<group>";
+		};
+		9A78E0192B63973B00CA4E32 /* M */ = {
+			isa = PBXGroup;
+			children = (
+				9A78E01A2B639F4700CA4E32 /* CartTotalsM.h */,
+				9A78E01B2B639F4700CA4E32 /* CartTotalsM.m */,
+			);
+			path = M;
+			sourceTree = "<group>";
+		};
 		9A8DD8CC2A0B9E0C00573324 /* Assets */ = {
 			isa = PBXGroup;
 			children = (
@@ -2129,6 +2200,7 @@
 		9AD364CC2A05EBE800452C7A /* Fuction */ = {
 			isa = PBXGroup;
 			children = (
+				9A78E0112B6388F500CA4E32 /* Cart */,
 				8131A27D2B3687CA00A191BE /* Windows */,
 				812021122B14657D0026B8B5 /* UserManager */,
 				81DFA55A2A46C44800DA708B /* WebView */,
@@ -2198,6 +2270,17 @@
 			path = Target;
 			sourceTree = "<group>";
 		};
+		9AEFA7DB2B649EF700AE1974 /* V */ = {
+			isa = PBXGroup;
+			children = (
+				9A2415BE2B678A1100A6E903 /* QtyCountV.h */,
+				9A2415BD2B678A1000A6E903 /* QtyCountV.m */,
+				9AEFA7DC2B649F3F00AE1974 /* MyCarlTableV.h */,
+				9AEFA7DD2B649F3F00AE1974 /* MyCarlTableV.m */,
+			);
+			path = V;
+			sourceTree = "<group>";
+		};
 		9AF908592B396BD1008AC2D2 /* RYNetWork */ = {
 			isa = PBXGroup;
 			children = (
@@ -2449,7 +2532,9 @@
 			files = (
 				81354BEE2A287AB50082C93A /* KWMineHomeOrderListCell.m in Sources */,
 				81601FE62A2DB19300E4A8F1 /* ASHomeViewController.m in Sources */,
+				9A2415BC2B6784A500A6E903 /* MyCartItemCell.m in Sources */,
 				81354BF22A287B120082C93A /* KWMineHomeOrderModel.m in Sources */,
+				9A2415B92B677DDF00A6E903 /* Target_Cart.m in Sources */,
 				81E73EBD2B1AABF300C10938 /* ASGiftCardListViewModel.m in Sources */,
 				9A31EE002B469A73009F11EE /* AS_GoodsReviewsListC.m in Sources */,
 				9AD345F82A08D60F005CA070 /* ZFPlayerGestureControl.m in Sources */,
@@ -2460,6 +2545,7 @@
 				81717C912A3BE39C00648139 /* ASProductSortFilterView.m in Sources */,
 				81C7962E2A539F4D003083B8 /* ASMessageListCell.m in Sources */,
 				81717D382A3D322700648139 /* KWNoHisWordsCell.m in Sources */,
+				9A2415BF2B678A1100A6E903 /* QtyCountV.m in Sources */,
 				9AD345FA2A08D60F005CA070 /* ZFLandscapeWindow.m in Sources */,
 				81E257EE2A120756004EEF71 /* ASUserCenterTopView.m in Sources */,
 				81C326622A36B33B002EF442 /* ASHomeActiveView.m in Sources */,
@@ -2486,6 +2572,7 @@
 				81717D202A3C4AE000648139 /* KWSearchSubTypeCell.m in Sources */,
 				9A3F5CAB2B3BBEAB00DDB6A7 /* GoodsDetailsPayV.m in Sources */,
 				81C796242A4FD63A003083B8 /* ASVipCouponsViewController.m in Sources */,
+				9AEFA7DE2B649F4000AE1974 /* MyCarlTableV.m in Sources */,
 				9AC2CC222B3A673B005187BD /* ASGoodsDetailsVM.m in Sources */,
 				816020252A2F1C9E00E4A8F1 /* ASHomeMainListModel.m in Sources */,
 				81717CA82A3C0AAA00648139 /* KWProductListFilterModel.m in Sources */,
@@ -2547,6 +2634,7 @@
 				9AD3459E2A08D545005CA070 /* GoodsDetailSrcView.m in Sources */,
 				81DFA56D2A46D86500DA708B /* ASPointDetailModel.m in Sources */,
 				9AD346022A08D60F005CA070 /* ZFPlayerView.m in Sources */,
+				9A78E01C2B639F4700CA4E32 /* CartTotalsM.m in Sources */,
 				81DFA55D2A46C46D00DA708B /* ASWebViewController.m in Sources */,
 				81BEA6832A2D7CF3009D36C4 /* UITableView+ASBase.m in Sources */,
 				81C7963A2A5517F7003083B8 /* KWSwitchButton.m in Sources */,
@@ -2555,6 +2643,7 @@
 				81C3B44429F6612800D79294 /* ASBaseViewController.m in Sources */,
 				81C3266A2A36F035002EF442 /* ASProductListViewModel.m in Sources */,
 				815DA3DF2A396BD300616EF7 /* ASMoreBtCell.m in Sources */,
+				9A78E0182B6396D600CA4E32 /* CartVM.m in Sources */,
 				9A1247942A1B082300126226 /* Fuction_Tool.m in Sources */,
 				81E5EE942A4A760D0075695F /* ASVipCenterLineItemView.m in Sources */,
 				9A3F5CBB2B3C192000DDB6A7 /* GoodsDetailsBottomV.m in Sources */,
@@ -2651,6 +2740,7 @@
 				8160200A2A2DD59E00E4A8F1 /* CTMediator+Home.m in Sources */,
 				81717C9C2A3BF1F100648139 /* ASHomeAlertViewController.m in Sources */,
 				9AD345FC2A08D60F005CA070 /* ZFPlayerLogManager.m in Sources */,
+				9A78E0142B6389FC00CA4E32 /* Cart_MyCartC.m in Sources */,
 				815970BA2B54DC830073041D /* ASUserCenterViewModel.m in Sources */,
 				816D0C9D2AF3988400395B5B /* ASGiftCardAvailabelCell.m in Sources */,
 				8120211B2B15F03B0026B8B5 /* ASVipModel.m in Sources */,

+ 5 - 3
Asteria/Base/AlertMyCartDeleteV.m

@@ -181,9 +181,9 @@
     }];
     
     [self.closeBtn mas_makeConstraints:^(MASConstraintMaker *make) {
-        make.top.mas_equalTo(20);
+        make.top.mas_equalTo(10);
         make.width.height.mas_equalTo(40);
-        make.centerX.mas_equalTo(0);
+        make.right.mas_equalTo(-10);
     }];
     
 }
@@ -211,7 +211,9 @@
 -(UIView *)bgView{
     if(!_bgView){
         _bgView = [[UIView alloc]init];
-        _bgView.backgroundColor = [UIColor colorWithHexString:@"#FFDEE2"];
+        _bgView.backgroundColor = [UIColor colorWithHexString:@"#FFFFFF"];
+        _bgView.layer.cornerRadius = 8;
+        _bgView.clipsToBounds = YES;
     }
     return _bgView;
 }

+ 1 - 0
Asteria/Base/RYNetWork/RYBaseVM.h

@@ -33,6 +33,7 @@ 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;
 
  
 

+ 9 - 0
Asteria/Base/RYNetWork/RYBaseVM.m

@@ -48,6 +48,15 @@
     }];
 }
 
+-(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];
+    } faild:^(NSString * _Nonnull code, NSString * _Nonnull msg) {
+        NSLog(@"mark--%@--param-%@\n-Error--%@",mark,param,msg);
+        [self ry_reponsFaildWithPath:mark code:code msg:msg];
+    }];
+}
 
 
 

+ 16 - 0
Asteria/Fuction/Cart/Cart_MyCartC.h

@@ -0,0 +1,16 @@
+//
+//  Cart_MyCartC.h
+//  Asteria
+//
+//  Created by 王猛 on 2024/1/26.
+//
+
+#import <WMBase/WMBase.h>
+
+NS_ASSUME_NONNULL_BEGIN
+
+@interface Cart_MyCartC : UCMBaseC
+
+@end
+
+NS_ASSUME_NONNULL_END

+ 169 - 0
Asteria/Fuction/Cart/Cart_MyCartC.m

@@ -0,0 +1,169 @@
+//
+//  Cart_MyCartC.m
+//  Asteria
+//
+//  Created by 王猛 on 2024/1/26.
+//
+
+#import "Cart_MyCartC.h"
+#import "CartVM.h"
+#import "MyCarlTableV.h"
+@interface Cart_MyCartC ()<RY_baseVMprotocol>
+@property (nonatomic, strong) CartVM *VM;
+@property (nonatomic, strong) UIView *topBgV;
+@property (nonatomic, strong) UILabel *top_totalLab;
+@property (nonatomic, strong) QMUILabel *top_priceLab;
+
+@property (nonatomic, strong) MyCarlTableV *TableV;
+@property (nonatomic, strong) CartTotalsM *totalsM;
+
+@end
+
+@implementation Cart_MyCartC
+
+- (void)viewDidLoad {
+    [super viewDidLoad];
+    self.title = @"My Cart";
+    [self ucm_subVeiwsTapBlock];
+}
+-(void)viewWillAppear:(BOOL)animated{
+    [super viewWillAppear:animated];
+    [self reqNet_Cart_cartsMineTotals];
+}
+- (void)initSubviews {
+    [super initSubviews];
+    [self.view addSubview:self.topBgV];
+    [self.topBgV addSubview:self.top_totalLab];
+    [self.topBgV addSubview:self.top_priceLab];
+    [self.top_totalLab mas_makeConstraints:^(MASConstraintMaker *make) {
+        make.left.mas_offset(20);
+        make.centerY.equalTo(self.topBgV);
+
+    }];
+    [self.top_priceLab mas_makeConstraints:^(MASConstraintMaker *make) {
+        make.left.equalTo(self.top_totalLab.mas_right).offset(20);
+        make.right.mas_equalTo(-20);
+        make.centerY.equalTo(self.topBgV);
+    }];
+    IPhoneXHeigh
+    [self setupTableV:[MyCarlTableV class] Frame:CGRectMake(0, CGRectGetMaxY(self.topBgV.frame), KScreenWidth, KScreenHeight-securityBottom_H - 65- CGRectGetMaxY(self.topBgV.frame))];
+    self.TableV.backgroundColor = [UIColor colorWithHexString:@"#F8F8F8"];
+}
+
+
+- (void)ucm_subVeiwsTapBlock{
+    @weakify(self)
+    self.TableV.tapClose = ^(NSInteger num, id data) {
+        //num = 0 删除 ,1 countV
+        @strongify(self)
+        if([data isKindOfClass:[ CartTotalsItemsM class]]){
+            switch (num) {  //展开删除的弹窗 wm_todo
+                case 0:{
+                    [self reqNet_DEL_cartsMineItems:(CartTotalsItemsM *)data];
+                }
+                    break;
+                case 1:{
+                    [self reqnet_Cart_cartsMineItems_Post:(CartTotalsItemsM *)data];
+                }
+                    break;
+                default:
+                    break;
+            }
+        }
+    };
+}
+- (void)ucm_bindvmmodel{
+    self.VM = [[CartVM alloc]initDelegate:self];
+}
+
+#pragma mark - **************** reqNet ****************
+
+-(void)reqNet_Cart_cartsMineTotals{
+    [MBProgressHUD showHUDAddedTo:self.view animated:YES];
+    [self.VM ry_requestGetApi:Cart_cartsMineTotals param:@{}];
+}
+///修改商品的数量
+-(void)reqnet_Cart_cartsMineItems_Post:(CartTotalsItemsM *)itemM{
+    [MBProgressHUD showHUDAddedTo:self.view animated:YES];
+    NSDictionary *cartItemDic = @{
+        @"item_id":itemM.item_id,
+        @"qty":itemM.qty,
+        @"quote_id":self.totalsM.cart_id
+    };
+    NSMutableDictionary *param = [NSMutableDictionary dictionaryWithDictionary:@{
+        @"cartItem":cartItemDic
+    }];
+    [self.VM ry_requestPostApi:Cart_cartsMineItems_Post param:param];
+}
+///删除商品
+-(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];
+}
+
+
+- (void)ry_respnsData:(id)data parseAry:(NSMutableArray *)arry sucess:(BOOL)sucessOrFail mark:(NSString *)mark{
+    [MBProgressHUD hideHUDForView:self.view animated:YES];
+    if([mark isEqualToString:Cart_cartsMineTotals]){
+        if(sucessOrFail){
+            CartTotalsM *model = [arry firstObject];
+            self.totalsM = model;
+            self.top_totalLab.text = [NSString stringWithFormat:@"%@ pcs | total",model.items_qty];
+            self.top_priceLab.text =[NSString stringWithFormat:@"%@%@",model.currency_symbol,model.subtotal];
+            [self.TableV.infodata removeAllObjects];
+            self.TableV.infodata = [NSMutableArray arrayWithArray:model.items];
+            [self.TableV reloadData];
+        }
+    }else if ([mark isEqualToString:Cart_cartsMineItems_Post]){
+        [MBProgressHUD hideHUDForView:self.view animated:YES];
+        if(sucessOrFail){
+            [self reqNet_Cart_cartsMineTotals];
+        }else{
+            [self.view makeToast:(NSString *)data duration:2 position:CSToastPositionCenter];
+        }
+    }
+}
+- (void)tapcellTriggereventIndex:(NSIndexPath *)index model:(id)model{
+    if([model isKindOfClass:[CartTotalsItemsM class]]){
+        CartTotalsItemsM *itemM = (CartTotalsItemsM *)model;
+        if(itemM.isGift){
+            return;
+        }
+        UIViewController *viewController = [[CTMediator sharedInstance] Goods_GoodsDetailsC:@{@"entity_id":itemM.product_id}];
+        [self.navigationController pushViewController:viewController animated:YES];
+    }
+}
+
+#pragma mark - **************** lazy ****************
+
+-(UIView *)topBgV{
+    if(!_topBgV){
+        IPhoneXHeigh
+        _topBgV = [[UIView alloc]initWithFrame:CGRectMake(0, securitytop_Y, KScreenWidth, 60)];
+        _topBgV.backgroundColor = [UIColor colorWithHexString:@"#E0FFF5"];
+    }
+    return _topBgV;
+}
+- (UILabel *)top_totalLab {
+    if (!_top_totalLab) {
+        _top_totalLab = [[UILabel alloc] initWithFrame:CGRectZero];
+        _top_totalLab.textAlignment = NSTextAlignmentLeft;
+        _top_totalLab.font = [UIFont fontWithName:Rob_Regular size:14];
+        _top_totalLab.textColor = [UIColor colorWithHexString:@"#000000"];
+    }
+    return  _top_totalLab;
+}
+
+- (QMUILabel *)top_priceLab {
+    if (!_top_priceLab) {
+        _top_priceLab = [[QMUILabel alloc] initWithFrame:CGRectZero];
+        _top_priceLab.textAlignment = NSTextAlignmentLeft;
+        _top_priceLab.font = [UIFont fontWithName:Rob_Bold size:16];
+    }
+    return  _top_priceLab;
+}
+
+@end

+ 18 - 0
Asteria/Fuction/Cart/Cell/MyCartItemCell.h

@@ -0,0 +1,18 @@
+//
+//  MyCartItemCell.h
+//  Asteria
+//
+//  Created by 王猛 on 2024/1/29.
+//
+
+#import <WMBase/WMBase.h>
+#import "CartTotalsM.h"
+
+
+NS_ASSUME_NONNULL_BEGIN
+
+@interface MyCartItemCell : TT_BaseCell
+
+@end
+
+NS_ASSUME_NONNULL_END

+ 297 - 0
Asteria/Fuction/Cart/Cell/MyCartItemCell.m

@@ -0,0 +1,297 @@
+//
+//  MyCartItemCell.m
+//  Asteria
+//
+//  Created by 王猛 on 2024/1/29.
+//
+
+#import "MyCartItemCell.h"
+#import "QtyCountV.h"
+#import "AlertMyCartDeleteV.h"
+@interface MyCartItemCell ()
+@property (nonatomic, strong) CartTotalsItemsM *itemM;
+@property (nonatomic, strong) UIView *bgV;
+@property (nonatomic, strong) UIStackView *stackV;
+
+@property (nonatomic, strong) UIView *topV;
+@property (nonatomic, strong) UIImageView *leftImg;
+@property (nonatomic, strong) UILabel *nameLab;
+@property (nonatomic, strong) UIButton *closeBtn;
+@property (nonatomic, strong) QMUILabel *optionsLab;
+@property (nonatomic, strong) QMUILabel *gitfLab;
+
+@property (nonatomic, strong) UIStackView *rowStackV;
+@property (nonatomic, strong) QMUILabel *priceLab;
+@property (nonatomic, strong) QtyCountV *countV;
+@property (nonatomic, strong) QMUILabel *bgDesLab;
+@end
+
+@implementation MyCartItemCell
+
+- (void)awakeFromNib {
+    [super awakeFromNib];
+    // Initialization code
+}
+- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
+    [super setSelected:selected animated:animated];
+}
+- (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(20, 10, 15, 10));
+    }];
+    
+    [self.stackV addArrangedSubview:self.topV];
+    [self.stackV addArrangedSubview:self.rowStackV];
+    [self.stackV addArrangedSubview:self.bgDesLab];
+    [self.topV mas_makeConstraints:^(MASConstraintMaker *make) {
+        make.width.mas_equalTo(KScreenWidth-40);
+        make.height.mas_equalTo(86+10);
+    }];
+    [self.rowStackV mas_makeConstraints:^(MASConstraintMaker *make) {
+        make.left.right.equalTo(self.stackV);
+        make.height.mas_equalTo(32);
+    }];
+    [self.bgDesLab mas_makeConstraints:^(MASConstraintMaker *make) {
+        make.height.mas_equalTo(23);
+        make.width.mas_greaterThanOrEqualTo(86);
+    }];
+    
+    [self.topV addSubview:self.leftImg];
+    [self.topV addSubview:self.nameLab];
+    [self.topV addSubview:self.closeBtn];
+    [self.topV addSubview:self.optionsLab];
+    [self.topV addSubview:self.gitfLab];
+    [self.leftImg mas_makeConstraints:^(MASConstraintMaker *make) {
+        make.left.top.mas_equalTo(0);
+        make.width.height.mas_equalTo(86);
+    }];
+    [self.closeBtn mas_makeConstraints:^(MASConstraintMaker *make) {
+        make.right.top.mas_equalTo(0);
+        make.width.height.mas_offset(40);
+    }];
+    [self.nameLab mas_makeConstraints:^(MASConstraintMaker *make) {
+        make.top.mas_equalTo(0);
+        make.left.equalTo(self.leftImg.mas_right).offset(10);
+        make.right.equalTo(self.closeBtn.mas_left).offset(-10);
+        make.height.mas_equalTo(36);
+    }];
+    [self.optionsLab mas_makeConstraints:^(MASConstraintMaker *make) {
+        make.top.equalTo(self.nameLab.mas_bottom).offset(10);;
+        make.left.equalTo(self.leftImg.mas_right).offset(10);
+        make.right.equalTo(self.closeBtn.mas_left).offset(-10);
+    }];
+    [self.gitfLab mas_makeConstraints:^(MASConstraintMaker *make) {
+        make.left.equalTo(self.leftImg.mas_right).offset(10);
+        make.bottom.equalTo(self.leftImg);
+        make.width.mas_equalTo(86);
+        make.height.mas_equalTo(23);
+    }];
+    
+    [self.rowStackV addArrangedSubview:self.priceLab];
+    [self.rowStackV addArrangedSubview:self.countV];
+    [self.priceLab mas_makeConstraints:^(MASConstraintMaker *make) {
+        make.height.mas_equalTo(20);
+    }];
+    [self.countV mas_makeConstraints:^(MASConstraintMaker *make) {
+        make.width.mas_equalTo(self.countV.mj_w);
+        make.height.mas_equalTo(self.countV.mj_h);
+    }];
+    [self subViewsTapBlock];
+}
+- (void)subViewsTapBlock{
+    @weakify(self)
+    self.countV.ViewtapClose = ^(NSInteger num, id  _Nonnull data) {//0 - ; 1+
+       @strongify(self)
+        NSString *qtyStr = (NSString *)data;
+        CartTotalsItemsM *itemM =[[CartTotalsItemsM alloc]init];
+        itemM =  self.itemM;
+        itemM.qty = qtyStr;
+        if(self.currencyparameterClose){
+            self.currencyparameterClose(1,itemM);
+        }
+    };
+}
+
+- (void)configData:(id)Data{
+    CartTotalsItemsM *itemM = (CartTotalsItemsM *)Data;
+    self.itemM = itemM;
+    NSString *imgStr =  [NSString stringWithFormat:@"https:%@%@%@",HostPath,ProductImgPath,itemM.image];
+    [self.leftImg sd_setImageWithURL:[NSURL URLWithString:imgStr] placeholderImage:UIImageDefaultImg_SD];
+    self.nameLab.text = itemM.name;
+    self.optionsLab.text = itemM.options;
+    self.priceLab.attributedText = [MyCartItemCell tool_changePriceAtr:itemM];
+    
+    self.closeBtn.hidden = itemM.isGift;
+    self.optionsLab.hidden = itemM.isGift;
+    self.gitfLab.hidden = !itemM.isGift;
+    self.rowStackV.hidden = itemM.isGift;
+
+    if(itemM.isGift){
+        self.bgDesLab.hidden = YES;
+    }else{
+        self.bgDesLab.hidden = NO;
+        self.bgDesLab.text = [NSString stringWithFormat:@"SAVE %@%.2f",itemM.currency_symbol,[itemM.initial_price floatValue]-[itemM.price floatValue]];
+        self.countV.numLab.text = MM_str(itemM.qty);
+        [self.countV xxx_changeBtnIsEnable:YES num:[self.countV.numLab.text integerValue]];
+    }
+}
+
+#pragma mark - **************** handle ****************
+-(void)handle_CloseEvent:(UIButton *)btn{ //进入删除弹窗
+    AlertMyCartDeleteV *alertV = [[AlertMyCartDeleteV alloc]initWithAlertVtitle:[[NSMutableAttributedString alloc] initWithString:@"Do You Want To Remove It?"]];
+    alertV.ViewtapClose = ^(NSInteger num, id  _Nonnull data) {
+        if(num ==1){
+            if(self.currencyparameterClose){
+              self.currencyparameterClose(0,self.itemM);
+          }
+        }
+    };
+}
+#pragma mark - **************** tool ****************
++(NSMutableAttributedString *)tool_changePriceAtr:(CartTotalsItemsM *)model{
+    NSMutableAttributedString *priceAtr = [[NSMutableAttributedString alloc]initWithString:[NSString stringWithFormat:@"%@%@",model.currency_symbol,model.price]];
+    [priceAtr addAttribute: NSForegroundColorAttributeName value:[UIColor colorWithHexString:@"#0B0B0B"] range:NSMakeRange(0, priceAtr.length)];
+    [priceAtr addAttribute:NSFontAttributeName value:[UIFont fontWithName:Rob_Bold size:20] range:NSMakeRange(0, priceAtr.length)];
+    [priceAtr appendAttributedString:[[NSAttributedString alloc]initWithString:@"  "]];
+    NSMutableAttributedString *priceAtrSub1 = [[NSMutableAttributedString alloc]initWithString:[NSString stringWithFormat:@"%@%@",model.currency_symbol,model.initial_price]];
+    [priceAtrSub1 addAttribute:NSForegroundColorAttributeName
+                    value:[UIColor colorWithHexString:@"#8c8c8c"]
+                    range:NSMakeRange(0, priceAtrSub1.length)];
+    [priceAtrSub1 addAttribute:NSFontAttributeName
+                    value:[UIFont fontWithName:Rob_Regular size:14]
+                    range:NSMakeRange(0, priceAtrSub1.length)];
+    [priceAtrSub1 addAttribute:NSStrikethroughStyleAttributeName
+                    value:[NSNumber numberWithInteger:NSUnderlineStyleSingle]
+                    range:NSMakeRange(0, priceAtrSub1.length)];
+    [priceAtr appendAttributedString:priceAtrSub1];
+    return  priceAtr;
+}
+
+#pragma mark - **************** lazy ****************
+- (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.axis = UILayoutConstraintAxisVertical;
+        stv.distribution = UIStackViewDistributionFill;
+        stv.alignment = UIStackViewAlignmentLeading;
+        stv.spacing = 5;
+        _stackV = stv;
+    }
+    return _stackV;
+}
+-(UIImageView *)leftImg{
+    if(!_leftImg){
+        _leftImg = [[UIImageView alloc]init];
+    }
+    return _leftImg;
+}
+-(UILabel *)nameLab{
+    if(!_nameLab){
+        _nameLab = [[UILabel alloc]init];
+        _nameLab.font = [UIFont fontWithName:Rob_Regular size:12];
+        _nameLab.textColor = [UIColor colorWithHexString:@"#000000"];
+        _nameLab.numberOfLines =2;
+    }
+    return _nameLab;
+}
+
+-(UIButton *)closeBtn{
+    if(!_closeBtn){
+        _closeBtn = [UIButton buttonWithType:UIButtonTypeCustom];
+        [_closeBtn setImage:[UIImage imageNamed:@"base_close_black"] forState:UIControlStateNormal];
+        [_closeBtn addTarget:self action:@selector(handle_CloseEvent:) forControlEvents:UIControlEventTouchUpInside];
+    }
+    return _closeBtn;
+}
+-(QtyCountV *)countV{
+    if(!_countV){
+        _countV = [[QtyCountV alloc]initWithFrame:CGRectMake(0, 0, 32*2+46, 32)];
+        _countV.goodsmaxNum = 10;
+    }
+    return _countV;
+}
+- (QMUILabel *)optionsLab {
+    if (!_optionsLab) {
+        _optionsLab = [[QMUILabel alloc] initWithFrame:CGRectZero];
+        _optionsLab.textAlignment = NSTextAlignmentLeft;
+        _optionsLab.textColor = [UIColor colorWithHexString:@"#B2B2B2"];
+        _optionsLab.numberOfLines = 0;
+        _optionsLab.font = [UIFont fontWithName:Rob_Regular size:12];
+    }
+    return  _optionsLab;
+}
+
+- (QMUILabel *)priceLab {
+    if (!_priceLab) {
+        _priceLab = [[QMUILabel alloc] initWithFrame:CGRectZero];
+        _priceLab.textAlignment = NSTextAlignmentLeft;
+        _priceLab.textColor = [UIColor colorWithHexString:@"#0B0B0B"];
+        _priceLab.font = [UIFont fontWithName:Rob_Bold size:14];
+    }
+    return  _priceLab;
+}
+
+- (QMUILabel *)bgDesLab {
+    if (!_bgDesLab) {
+        _bgDesLab = [[QMUILabel alloc] initWithFrame:CGRectZero];
+        _bgDesLab.textAlignment = NSTextAlignmentCenter;
+        _bgDesLab.backgroundColor = ThemeLightColor;
+        _bgDesLab.textColor = [UIColor colorWithHexString:@"#000000"];
+        _bgDesLab.font = [UIFont fontWithName:Rob_Regular size:12];
+        _bgDesLab.contentEdgeInsets = UIEdgeInsetsMake(0, 15, 0, 15);
+    }
+    return  _bgDesLab;
+}
+
+- (QMUILabel *)gitfLab {
+    if (!_gitfLab) {
+        _gitfLab = [[QMUILabel alloc] initWithFrame:CGRectZero];
+        _gitfLab.textAlignment = NSTextAlignmentCenter;
+        _gitfLab.textColor = [UIColor colorWithHexString:@"#000000"];
+        _gitfLab.font = [UIFont fontWithName:Rob_Regular size:12];
+        _gitfLab.text = @"Gift";
+        _gitfLab.backgroundColor = ThemeLightColor;
+    }
+    return  _gitfLab;
+}
+
+
+- (UIView *)topV {
+    if (!_topV) {
+        _topV = [[UIView alloc] init];
+    }
+    return _topV;
+}
+
+
+- (UIStackView *)rowStackV {
+    if (!_rowStackV) {
+        _rowStackV = [[UIStackView alloc] init];
+        UIStackView *stv = [[UIStackView alloc] init];
+        stv.axis = UILayoutConstraintAxisHorizontal;
+        stv.distribution = UIStackViewDistributionFill;
+        stv.alignment = UIStackViewAlignmentCenter;
+    }
+    return _rowStackV;
+}
+
+
+
+
+@end

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

@@ -0,0 +1,43 @@
+//
+//  CartTotalsM.h
+//  Asteria
+//
+//  Created by 王猛 on 2024/1/26.
+//
+
+#import <Foundation/Foundation.h>
+
+NS_ASSUME_NONNULL_BEGIN
+@class CartTotalsItemsM;
+@interface CartTotalsM : NSObject
+@property (nonatomic, copy) NSString *subtotal;
+@property (nonatomic, copy) NSString *grand_total;
+@property (nonatomic, copy) NSString *items_qty;
+@property (nonatomic, strong) NSMutableArray <CartTotalsItemsM *>*items;
+
+@property (nonatomic, copy) NSDictionary *extension_attributes;
+@property (nonatomic, copy) NSString *currency_symbol;
+@property (nonatomic, copy) NSString *cart_id;
+
+
+@end
+@interface CartTotalsItemsM : NSObject
+@property (nonatomic, copy) NSString *item_id;
+@property (nonatomic, copy) NSString *name;
+@property (nonatomic, copy) NSString *options;//json 需要解析
+@property (nonatomic, copy) NSString *price;
+@property (nonatomic, copy) NSString *subtotal;
+@property (nonatomic, copy) NSString *qty;
+@property (nonatomic, strong) NSDictionary *extension_attributes;
+@property (nonatomic, copy) NSString *currency_symbol;
+@property (nonatomic, copy) NSString *initial_price;
+@property (nonatomic, copy) NSString *image;
+@property (nonatomic, copy) NSString *product_id;
+
+
+@property (nonatomic, assign) BOOL isGift;
+
+@end
+
+
+NS_ASSUME_NONNULL_END

+ 23 - 0
Asteria/Fuction/Cart/M/CartTotalsM.m

@@ -0,0 +1,23 @@
+//
+//  CartTotalsM.m
+//  Asteria
+//
+//  Created by 王猛 on 2024/1/26.
+//
+
+#import "CartTotalsM.h"
+
+@implementation CartTotalsM
++ (NSDictionary *)mj_objectClassInArray
+{
+    return @{
+        @"items": @"CartTotalsItemsM",
+    };
+}
+@end
+
+@implementation CartTotalsItemsM
+
+@end
+
+

+ 17 - 0
Asteria/Fuction/Cart/Target/Target_Cart.h

@@ -0,0 +1,17 @@
+//
+//  Target_Cart.h
+//  Asteria
+//
+//  Created by 王猛 on 2024/1/29.
+//
+
+#import <Foundation/Foundation.h>
+
+NS_ASSUME_NONNULL_BEGIN
+
+@interface Target_Cart : NSObject
+- (UIViewController *)Action_Cart_MyCartC:(NSDictionary *)params;
+
+@end
+
+NS_ASSUME_NONNULL_END

+ 16 - 0
Asteria/Fuction/Cart/Target/Target_Cart.m

@@ -0,0 +1,16 @@
+//
+//  Target_Cart.m
+//  Asteria
+//
+//  Created by 王猛 on 2024/1/29.
+//
+
+#import "Target_Cart.h"
+#import "Cart_MyCartC.h"
+
+@implementation Target_Cart
+- (UIViewController *)Action_Cart_MyCartC:(NSDictionary *)params{
+    Cart_MyCartC  *vc = [[Cart_MyCartC alloc]init];
+    return vc;
+}
+@end

+ 16 - 0
Asteria/Fuction/Cart/V/MyCarlTableV.h

@@ -0,0 +1,16 @@
+//
+//  MyCarlTableV.h
+//  Asteria
+//
+//  Created by 王猛 on 2024/1/27.
+//
+
+#import <WMBase/WMBase.h>
+
+NS_ASSUME_NONNULL_BEGIN
+
+@interface MyCarlTableV : TT_BaseTableV
+
+@end
+
+NS_ASSUME_NONNULL_END

+ 34 - 0
Asteria/Fuction/Cart/V/MyCarlTableV.m

@@ -0,0 +1,34 @@
+//
+//  MyCarlTableV.m
+//  Asteria
+//
+//  Created by 王猛 on 2024/1/27.
+//
+
+#import "MyCarlTableV.h"
+#import "MyCartItemCell.h"
+
+@implementation MyCarlTableV
+- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath{
+    NSObject *objectM = self.infodata[indexPath.row];
+    if([objectM isKindOfClass:[CartTotalsItemsM class]]){
+        MyCartItemCell *cell = [MyCartItemCell cellWithTableView:tableView CellClass:[MyCartItemCell class]];
+        [cell configData:(CartTotalsItemsM *)objectM];
+        @weakify(self)
+        cell.currencyparameterClose = ^(NSInteger type, id Data) {
+            @strongify(self)
+            [self generaltriggermethodType:type data:Data];
+        };
+        return  cell;
+    }
+    return  nil;
+}
+- (CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath {
+    return UITableViewAutomaticDimension;
+}
+
+- (CGFloat)tableView:(UITableView *)tableView estimatedHeightForRowAtIndexPath:(NSIndexPath *)indexPath{
+    return 200;
+}
+
+@end

+ 22 - 0
Asteria/Fuction/Cart/V/QtyCountV.h

@@ -0,0 +1,22 @@
+//
+//  QtyCountV.h
+//  westkissMob
+//
+//  Created by 王猛 on 2022/10/10.
+//
+
+#import "TT_BaseV.h"
+
+NS_ASSUME_NONNULL_BEGIN
+
+@interface QtyCountV : TT_BaseV
+@property(nonatomic, strong) UIButton *cutBtn;
+@property(nonatomic, strong) UILabel *numLab;
+@property(nonatomic, strong) UIButton *addBtn;
+@property (nonatomic, assign) NSInteger goodsmaxNum;
+
+-(void)xxx_changeBtnIsEnable:(BOOL)isEnabled num:(NSInteger)num;
+
+@end
+
+NS_ASSUME_NONNULL_END

+ 130 - 0
Asteria/Fuction/Cart/V/QtyCountV.m

@@ -0,0 +1,130 @@
+//
+//  QtyCountV.m
+//  westkissMob
+//
+//  Created by 王猛 on 2022/10/10.
+//
+
+#import "QtyCountV.h"
+
+@implementation QtyCountV
+- (void)tt_setupViews{
+    [self addSubview:self.numLab];
+    [self addSubview:self.cutBtn];
+    [self addSubview:self.addBtn];
+    [self tt_setupViewsFrame];
+}
+
+- (void)tt_setupViewsFrame{
+    [self.numLab mas_makeConstraints:^(MASConstraintMaker *make) {
+        make.top.mas_equalTo(0);
+        make.height.mas_equalTo(32);
+        make.width.mas_equalTo(46);
+        make.centerX.mas_equalTo(0);
+    }];
+    [self.cutBtn mas_makeConstraints:^(MASConstraintMaker *make) {
+        make.top.mas_equalTo(0);
+        make.right.equalTo(self.numLab.mas_left);
+        make.height.mas_equalTo(32);
+        make.width.mas_equalTo(32);
+    }];
+    [self.addBtn mas_makeConstraints:^(MASConstraintMaker *make) {
+        make.top.mas_equalTo(0);
+        make.left.equalTo(self.numLab.mas_right);
+        make.height.mas_equalTo(32);
+        make.width.mas_equalTo(32);
+    }];
+}
+
+#pragma mark - *************** handle ****************
+-(void)handle_addNumEvent:(UIButton *)btn{
+    NSInteger num = [self.numLab.text integerValue] +1;
+    [self tool_btnChangeNum:num];
+//    self.numLab.text = [NSString stringWithFormat:@"%ld",num];
+    if(self.ViewtapClose){
+        self.ViewtapClose(1, [NSString stringWithFormat:@"%ld",num]);
+    }
+}
+-(void)handle_cutNumEvent:(UIButton *)btn{
+    NSInteger num = [self.numLab.text integerValue] -1;
+    [self tool_btnChangeNum:num];
+//    self.numLab.text = [NSString stringWithFormat:@"%ld", num];
+    if(self.ViewtapClose){
+        self.ViewtapClose(0, [NSString stringWithFormat:@"%ld",num]);
+    }
+}
+
+
+-(void)xxx_changeBtnIsEnable:(BOOL)isEnabled num:(NSInteger)num{
+    if(isEnabled){
+        [self tool_btnChangeNum:num];
+    }else{
+        [self.addBtn setTitleColor:[UIColor colorWithHexString:@"#E6E6E6"] forState:UIControlStateNormal];
+        self.addBtn.userInteractionEnabled = NO;
+        [self.cutBtn setTitleColor:[UIColor colorWithHexString:@"#E6E6E6"] forState:UIControlStateNormal];
+        self.cutBtn.userInteractionEnabled = NO;
+    }
+    
+}
+
+-(void)tool_btnChangeNum:(NSInteger )num{
+    if(num >= self.goodsmaxNum){
+        [self.addBtn setTitleColor:[UIColor colorWithHexString:@"#E6E6E6"] forState:UIControlStateNormal];
+        self.addBtn.userInteractionEnabled = NO;
+    }else{
+        [self.addBtn setTitleColor:[UIColor colorWithHexString:@"#0B0B0B"] forState:UIControlStateNormal];
+        self.addBtn.userInteractionEnabled = YES;
+    }
+    if(num >= 2){
+        [self.cutBtn setTitleColor:[UIColor colorWithHexString:@"#0B0B0B"] forState:UIControlStateNormal];
+        self.cutBtn.userInteractionEnabled = YES;
+    }else{
+        [self.cutBtn setTitleColor:[UIColor colorWithHexString:@"#E6E6E6"] forState:UIControlStateNormal];
+        self.cutBtn.userInteractionEnabled = NO;
+    }
+}
+-(UIButton *)cutBtn{
+    if(!_cutBtn){
+        _cutBtn = [UIButton buttonWithType:UIButtonTypeCustom];
+        [_cutBtn setTitle:@"-" forState:UIControlStateNormal];
+        [_cutBtn setTitleColor:[UIColor colorWithHexString:@"#E6E6E6"] forState:UIControlStateNormal];
+        _cutBtn.titleLabel.font = [UIFont fontWithName:Rob_Bold size:18];
+        _cutBtn.layer.borderWidth = 0.5;
+        [_cutBtn addTarget:self action:@selector(handle_cutNumEvent:) forControlEvents:UIControlEventTouchUpInside];
+        _cutBtn.layer.borderColor = [UIColor colorWithHexString:@"#E6E6E6"].CGColor;
+        _cutBtn.userInteractionEnabled = NO;
+
+    }
+    return _cutBtn;
+}
+-(UILabel *)numLab{
+    if(!_numLab){
+        _numLab = [[UILabel alloc]init];
+        _numLab.text = @"1";
+        _numLab.font = [UIFont fontWithName:Rob_Bold size:12];
+        _numLab.textAlignment = NSTextAlignmentCenter;
+        _numLab.layer.borderWidth = 0.5;
+        _numLab.layer.borderColor = [UIColor colorWithHexString:@"#E6E6E6"].CGColor;
+    }
+    return _numLab;
+}
+
+-(UIButton *)addBtn{
+    if(!_addBtn){
+        _addBtn = [UIButton buttonWithType:UIButtonTypeCustom];
+        [_addBtn setTitle:@"+" forState:UIControlStateNormal];
+        [_addBtn setTitleColor:[UIColor colorWithHexString:@"#0B0B0B"] forState:UIControlStateNormal];
+        _addBtn.titleLabel.font = [UIFont fontWithName:Rob_Bold size:18];
+        _addBtn.layer.borderWidth = 0.5;
+        _addBtn.layer.borderColor = [UIColor colorWithHexString:@"#E6E6E6"].CGColor;
+        [_addBtn addTarget:self action:@selector(handle_addNumEvent:) forControlEvents:UIControlEventTouchUpInside];
+        
+    }
+    return _addBtn;
+}
+
+
+
+
+
+@end

+ 32 - 0
Asteria/Fuction/Cart/VM/CartVM.h

@@ -0,0 +1,32 @@
+//
+//  CartVM.h
+//  Asteria
+//
+//  Created by 王猛 on 2024/1/26.
+//
+
+#import "RYBaseVM.h"
+#import "CartTotalsM.h"
+///获取购物车列表
+#define Cart_cartsMineTotals   BaseRequestrUrl(@"carts/mine/totals")
+//添加或修改商品数量
+#define Cart_cartsMineItems_Post   BaseRequestrUrl(@"carts/mine/items")
+//删除购物车商品
+#define DEL_cartsMineItems BaseRequestrUrl(@"carts/mine/items")
+//添加优惠券
+#define Cart_cartsMineCoupons_Get  BaseRequestrUrl(@"carts/mine/coupons")
+//删除购物车优惠券
+#define Cart_cartsMineTotals_Del BaseRequestrUrl(@"carts/mine/coupons")
+
+
+
+
+
+
+NS_ASSUME_NONNULL_BEGIN
+
+@interface CartVM : RYBaseVM
+
+@end
+
+NS_ASSUME_NONNULL_END

+ 40 - 0
Asteria/Fuction/Cart/VM/CartVM.m

@@ -0,0 +1,40 @@
+//
+//  CartVM.m
+//  Asteria
+//
+//  Created by 王猛 on 2024/1/26.
+//
+
+#import "CartVM.h"
+
+@implementation CartVM
+- (void)ry_respnsSucessWithPath:(NSString *)mark data:(id)data{
+    if([mark isEqualToString:Cart_cartsMineTotals]){
+        CartTotalsM *model = [CartTotalsM mj_objectWithKeyValues:data];
+        if(model.extension_attributes){
+            model.currency_symbol = model.extension_attributes[@"currency_symbol"];
+            model.cart_id = model.extension_attributes[@"cart_id"];
+        }
+        if(model.items.count>0){
+            for(CartTotalsItemsM *item in model.items){
+                if(item.extension_attributes){
+                    NSDictionary *tepDic = [FTT_Helper dictionaryWithJsonString:item.extension_attributes[@"mposc"]];
+                    item.image = tepDic[@"image"];
+                    item.initial_price =  tepDic[@"initial_price"];
+                    item.product_id = tepDic[@"product_id"];
+                    item.currency_symbol =  model.currency_symbol;
+                    if([item.name hasPrefix:@"FREE"]){
+                        item.isGift = YES;
+                    }else{
+                        item.isGift = NO;
+                    }
+                }
+            }
+        }
+        NSMutableArray *ary = [NSMutableArray arrayWithArray:@[model]];
+        [self ry_VMconfigDelegateData:data parseAry:ary success:YES mark:mark];
+    }else{
+        [self ry_VMconfigDelegateData:data parseAry:[NSMutableArray array] success:YES mark:mark];
+    }
+}
+@end

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

@@ -57,7 +57,7 @@
 -(void)reqNet_GoodsDetails_productGetProduct{
     NSMutableDictionary * params = [[NSMutableDictionary alloc] init];
 //    [params setObject:@"55475" forKey:@"productId"];
-    [params setObject:@"31556" forKey:@"productId"];
+    [params setObject:self.entity_id forKey:@"productId"];
     [params setObject:@"USD" forKey:@"currencyCode"];
     [MBProgressHUD showHUDAddedTo:self.view animated:YES];
     [self.VM ry_requestGetApi:Goods_productGetProductsById param:params];

+ 1 - 1
Asteria/Fuction/UserCenter/ConponsAndGiftCard/m/ASGiftCardModel.h

@@ -22,7 +22,7 @@ typedef enum : NSUInteger {
 @property (nonatomic, copy) NSString *gitfcard_template_id;
 /// 礼品卡金额
 @property (nonatomic, copy) NSString *giftcard_amount;
-@property (nonatomic, copy) NSString *quote_id;
+@property (nonatomic, copy) NSString *cart_id;
 @property (nonatomic, copy) NSString *order_id;
 /// 添加时间
 @property (nonatomic, copy) NSString *addtime;

+ 2 - 2
Asteria/NetTools/ASNetApis.h

@@ -18,8 +18,8 @@
 
 // MARK: - host
 #if (DEBUG)
-//#define HostPath @"www.bilisar.com"  //测试
-#define HostPath @"pc.bilisar.com"  //正式
+#define HostPath @"www.bilisar.com"  //测试
+//#define HostPath @"pc.bilisar.com"  //正式
 #else
 #define HostPath @"pc.bilisar.com" //正式
 #endif

+ 6 - 2
Asteria/Product/CTMediatoaTargets/CTMediator+ASTargerts.h

@@ -16,13 +16,17 @@ NS_ASSUME_NONNULL_BEGIN
 @interface CTMediator (ASTargerts)
 
 -(UIViewController *)B_viewControllerWithContentText:(NSDictionary *)params;
+///登录页面
+-(UIViewController *)Login_LoginC:(NSDictionary *)params;
+
 
 ///商品详情页面
 -(UIViewController *)Goods_GoodsDetailsC:(NSDictionary *)params;
 /// required model 和 present
 -(UIViewController *)Goods_GoodsSizeC:(NSDictionary *)params;
-///登录页面
--(UIViewController *)Login_LoginC:(NSDictionary *)params;
+///购物车页面
+-(UIViewController*)Cart_MyCartC:(NSDictionary *)params;
+
 
 
 

+ 5 - 5
Asteria/Product/CTMediatoaTargets/CTMediator+ASTargerts.m

@@ -13,6 +13,9 @@
 -(UIViewController *)B_viewControllerWithContentText:(NSDictionary *)params{
     return [self performTarget:@"B" action:@"viewController" params:params shouldCacheTarget:NO];
 }
+-(UIViewController *)Login_LoginC:(NSDictionary *)params{
+    return [self performTarget:@"Login" action:@"AS_LoginC" params:params shouldCacheTarget:NO];
+}
 
 -(UIViewController *)Goods_GoodsDetailsC:(NSDictionary *)params{
     return [self performTarget:@"Goods" action:@"AS_GoodsDetailsC" params:params shouldCacheTarget:NO];
@@ -22,13 +25,10 @@
 }
 
 
-
--(UIViewController *)Login_LoginC:(NSDictionary *)params{
-    return [self performTarget:@"Login" action:@"AS_LoginC" params:params shouldCacheTarget:NO];
+-(UIViewController*)Cart_MyCartC:(NSDictionary *)params{
+    return [self performTarget:@"Cart" action:@"Cart_MyCartC" params:params shouldCacheTarget:NO];
 }
 
 
 
-
-
 @end

+ 1 - 0
Asteria/Product/Tool/Fuction_Tool.h

@@ -13,6 +13,7 @@ NS_ASSUME_NONNULL_BEGIN
 @interface Fuction_Tool : NSObject
 +(void)push_BaseWebUrl:(NSString *)url webTitle:(NSString *)title;
 +(void)push_JSBaseWebUrl:(NSString *)url webTitle:(NSString *)title;
++(void)pop_toLoginVC;
 @end
 
 NS_ASSUME_NONNULL_END

+ 8 - 0
Asteria/Product/Tool/Fuction_Tool.m

@@ -21,6 +21,14 @@
 //    [vc tool_dsWebViewAddJS];
     [[Current_normalTool topViewController].navigationController pushViewController:vc animated:true];
 }
++ (void)pop_toLoginVC {
+    UIViewController *loginC = [[CTMediator sharedInstance] Login_LoginC:@{}];
+    QMUINavigationController *uikitNavController = [[QMUINavigationController alloc] initWithRootViewController:loginC];
+    uikitNavController.navigationBar.hidden = YES;
+    uikitNavController.modalPresentationStyle = UIModalPresentationFullScreen;
+    [[Current_normalTool topViewController] presentViewController:uikitNavController animated:YES completion:nil];
+}
+
 
 
 

+ 7 - 9
Asteria/Tabber/AS_TabBarViewController.m

@@ -25,7 +25,7 @@
     
     UIViewController *vc1 = [[CTMediator sharedInstance] getCategoryListVc:@{}];
     UIViewController *vc2 = [[CTMediator sharedInstance] getHomeVc:@{}];
-    AViewController *cartv = [AViewController new];
+    UIViewController *cartv = [CTMediator.sharedInstance Cart_MyCartC:@{}];
     UIViewController *vc3 = [[CTMediator sharedInstance] getUserCenterVc:@{}];
     NSArray *vcAry = @[vc2, vc1, cartv, vc3];
     
@@ -67,25 +67,23 @@
         QMUINavigationController *nav = (QMUINavigationController *)viewController;
         UIViewController *vc = nav.qmui_rootViewController;
         if ([vc isKindOfClass:[CTMediator.sharedInstance categoryListVcClass]]) {
-            
             UIViewController *vc1 = [[CTMediator sharedInstance] getCategoryListVc:@{}];
-            
             [self.selectedViewController pushViewController:vc1 animated:true];
             
             return false;
         }
         if ([vc isKindOfClass:[CTMediator.sharedInstance userCenterVcClass]]) {
             if (![ASUserInfoManager.shared isLogin]) {
-                UIViewController *loginC = [[CTMediator sharedInstance] Login_LoginC:@{}];
-                
-                QMUINavigationController *uikitNavController = [[QMUINavigationController alloc] initWithRootViewController:loginC];
-                uikitNavController.navigationBar.hidden = YES;
-                uikitNavController.modalPresentationStyle =UIModalPresentationFullScreen;
-                [self.selectedViewController presentViewController:uikitNavController animated:YES completion:nil];
+                [Fuction_Tool pop_toLoginVC];
                 return false;
             } else {
                 [ASUserInfoManager.shared getInfo];
             }
+        }else if ([vc isKindOfClass:[[CTMediator.sharedInstance Cart_MyCartC:@{}] class]]){
+            if (![ASUserInfoManager.shared isLogin]) {
+                [Fuction_Tool pop_toLoginVC];
+                return false;
+            }
         }
         
     }