Browse Source

Merge branch 'master' of http://gogs.hnwmzp.cn/nzk1/Asteria-APP

Abel 1 year ago
parent
commit
958ede4952

+ 25 - 0
Asteria.xcodeproj/project.pbxproj

@@ -184,6 +184,10 @@
 		81EC47782A3426CE00516573 /* ASHomeLookingCollCell.m in Sources */ = {isa = PBXBuildFile; fileRef = 81EC47772A3426CE00516573 /* ASHomeLookingCollCell.m */; };
 		81FC419C2BEB1E0200EB0A85 /* ASEditAddressViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 81FC419B2BEB1E0200EB0A85 /* ASEditAddressViewController.m */; };
 		81FC41A32BEB4D6E00EB0A85 /* InTableScrollView.m in Sources */ = {isa = PBXBuildFile; fileRef = 81FC41A22BEB4D6D00EB0A85 /* InTableScrollView.m */; };
+		8810F5092BEB159600346FD4 /* ASCheckoutTopView.m in Sources */ = {isa = PBXBuildFile; fileRef = 8810F5082BEB159600346FD4 /* ASCheckoutTopView.m */; };
+		8810F50C2BEB590C00346FD4 /* ASCheckoutPointApplyCell.m in Sources */ = {isa = PBXBuildFile; fileRef = 8810F50B2BEB590C00346FD4 /* ASCheckoutPointApplyCell.m */; };
+		8810F5122BEB685500346FD4 /* ASCheckoutPaymentCell.m in Sources */ = {isa = PBXBuildFile; fileRef = 8810F5112BEB685500346FD4 /* ASCheckoutPaymentCell.m */; };
+		8810F5152BEB754800346FD4 /* ASCheckoutModel.m in Sources */ = {isa = PBXBuildFile; fileRef = 8810F5142BEB754800346FD4 /* ASCheckoutModel.m */; };
 		8C24ECE114420CDEE7B9B22B /* Pods_Asteria.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 54DCE8001991D89B696E7D44 /* Pods_Asteria.framework */; };
 		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 */; };
@@ -675,6 +679,14 @@
 		81FC419B2BEB1E0200EB0A85 /* ASEditAddressViewController.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = ASEditAddressViewController.m; sourceTree = "<group>"; };
 		81FC41A12BEB4D6D00EB0A85 /* InTableScrollView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = InTableScrollView.h; sourceTree = "<group>"; };
 		81FC41A22BEB4D6D00EB0A85 /* InTableScrollView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = InTableScrollView.m; sourceTree = "<group>"; };
+		8810F5072BEB159600346FD4 /* ASCheckoutTopView.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = ASCheckoutTopView.h; sourceTree = "<group>"; };
+		8810F5082BEB159600346FD4 /* ASCheckoutTopView.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = ASCheckoutTopView.m; sourceTree = "<group>"; };
+		8810F50A2BEB590C00346FD4 /* ASCheckoutPointApplyCell.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = ASCheckoutPointApplyCell.h; sourceTree = "<group>"; };
+		8810F50B2BEB590C00346FD4 /* ASCheckoutPointApplyCell.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = ASCheckoutPointApplyCell.m; sourceTree = "<group>"; };
+		8810F5102BEB685500346FD4 /* ASCheckoutPaymentCell.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = ASCheckoutPaymentCell.h; sourceTree = "<group>"; };
+		8810F5112BEB685500346FD4 /* ASCheckoutPaymentCell.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = ASCheckoutPaymentCell.m; sourceTree = "<group>"; };
+		8810F5132BEB754800346FD4 /* ASCheckoutModel.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = ASCheckoutModel.h; sourceTree = "<group>"; };
+		8810F5142BEB754800346FD4 /* ASCheckoutModel.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = ASCheckoutModel.m; sourceTree = "<group>"; };
 		9A1247922A1B082300126226 /* Fuction_Tool.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = Fuction_Tool.h; sourceTree = "<group>"; };
 		9A1247932A1B082300126226 /* Fuction_Tool.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = Fuction_Tool.m; sourceTree = "<group>"; };
 		9A1247952A1B0A2800126226 /* AS_ForgotC.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = AS_ForgotC.h; sourceTree = "<group>"; };
@@ -2030,6 +2042,8 @@
 			children = (
 				9A78E01A2B639F4700CA4E32 /* CartTotalsM.h */,
 				9A78E01B2B639F4700CA4E32 /* CartTotalsM.m */,
+				8810F5132BEB754800346FD4 /* ASCheckoutModel.h */,
+				8810F5142BEB754800346FD4 /* ASCheckoutModel.m */,
 			);
 			path = M;
 			sourceTree = "<group>";
@@ -2391,6 +2405,12 @@
 			children = (
 				9AFCDAC02B809C5B003D3573 /* CartCheckTableV.h */,
 				9AFCDAC12B809C5B003D3573 /* CartCheckTableV.m */,
+				8810F5072BEB159600346FD4 /* ASCheckoutTopView.h */,
+				8810F5082BEB159600346FD4 /* ASCheckoutTopView.m */,
+				8810F50A2BEB590C00346FD4 /* ASCheckoutPointApplyCell.h */,
+				8810F50B2BEB590C00346FD4 /* ASCheckoutPointApplyCell.m */,
+				8810F5102BEB685500346FD4 /* ASCheckoutPaymentCell.h */,
+				8810F5112BEB685500346FD4 /* ASCheckoutPaymentCell.m */,
 			);
 			path = Checkout;
 			sourceTree = "<group>";
@@ -2809,6 +2829,7 @@
 				8127ADDB2B1193A300464D27 /* ASNetTools.m in Sources */,
 				812021152B14659A0026B8B5 /* ASUserInfoManager.m in Sources */,
 				9AD3460A2A08D60F005CA070 /* ZFUtilities.m in Sources */,
+				8810F5152BEB754800346FD4 /* ASCheckoutModel.m in Sources */,
 				81354BFC2A28998B0082C93A /* KWMineMoreProductTypeCell.m in Sources */,
 				9AD6A5492A1237D0001DE3D9 /* Target_Login.m in Sources */,
 				9A337E3A2A04EE1A00D058A5 /* Target_B.m in Sources */,
@@ -2822,6 +2843,7 @@
 				8131A2842B36882500A191BE /* ASCustomAlertViewController.m in Sources */,
 				81EC47752A3423FC00516573 /* ASHomeLookingCell.m in Sources */,
 				9AD3460E2A08D60F005CA070 /* ZFNetworkSpeedMonitor.m in Sources */,
+				8810F50C2BEB590C00346FD4 /* ASCheckoutPointApplyCell.m in Sources */,
 				81AA11DC2B23FF71008EB5C7 /* ASCurrencyManager.m in Sources */,
 				9AD346052A08D60F005CA070 /* ZFLandscapeViewController.m in Sources */,
 				9ADA8A1E2B4E481E00BACDEA /* GoodsReviewsWriteC.m in Sources */,
@@ -2838,6 +2860,7 @@
 				81354BED2A287AB50082C93A /* KWMineHomeOrderHeadView.m in Sources */,
 				81717D102A3C4AE000648139 /* KWHisAndHotWordsViewModel.m in Sources */,
 				9AD3460D2A08D60F005CA070 /* ZFLandScapeControlView.m in Sources */,
+				8810F5122BEB685500346FD4 /* ASCheckoutPaymentCell.m in Sources */,
 				9AD364C62A05E73E00452C7A /* AS_GoodsDetailsC.m in Sources */,
 				8120211E2B15F2B30026B8B5 /* ASVipUrlTempModel.m in Sources */,
 				8193D5CE2BEA2B8E00B9AB11 /* ASAddressViewModel.m in Sources */,
@@ -2851,6 +2874,7 @@
 				9AD345FD2A08D60F005CA070 /* ZFPersentInteractiveTransition.m in Sources */,
 				8160200A2A2DD59E00E4A8F1 /* CTMediator+Home.m in Sources */,
 				81717C9C2A3BF1F100648139 /* ASHomeAlertViewController.m in Sources */,
+				8810F5092BEB159600346FD4 /* ASCheckoutTopView.m in Sources */,
 				9AD345FC2A08D60F005CA070 /* ZFPlayerLogManager.m in Sources */,
 				8193D5C82BEA299F00B9AB11 /* ASAddressListViewController.m in Sources */,
 				9A78E0142B6389FC00CA4E32 /* Cart_MyCartC.m in Sources */,
@@ -3050,6 +3074,7 @@
 					"@executable_path/Frameworks",
 				);
 				MARKETING_VERSION = 1.0;
+				ONLY_ACTIVE_ARCH = NO;
 				PRODUCT_BUNDLE_IDENTIFIER = com.info.LYAsteria.Asteria;
 				PRODUCT_NAME = "$(TARGET_NAME)";
 				SWIFT_EMIT_LOC_STRINGS = YES;

+ 1 - 0
Asteria/Fuction/Cart/Cart_CheckoutC.h

@@ -10,6 +10,7 @@
 NS_ASSUME_NONNULL_BEGIN
 
 @interface Cart_CheckoutC : UCMBaseC
+
 @property (nonatomic, strong) CartTotalsM *totalsM;
 
 @end

+ 235 - 2
Asteria/Fuction/Cart/Cart_CheckoutC.m

@@ -8,8 +8,27 @@
 #import "Cart_CheckoutC.h"
 #import "CartCheckTableV.h"
 
-@interface Cart_CheckoutC ()
+#import "CartVM.h"
+
+#import "ASCheckoutTopView.h"
+
+@interface Cart_CheckoutC ()<RY_baseVMprotocol>
+
+@property (nonatomic, strong) CartVM *VM;
+
+@property (nonatomic, strong) ASCheckoutTopView *topView;
+
 @property (nonatomic, strong) CartCheckTableV *TableV;
+@property (nonatomic, strong) MyCartCouponCellData *couponCellM;
+@property (nonatomic, strong) MyCartGrandTotalCellData *totalCellM;
+
+@property (nonatomic, strong) ASCheckoutPointData *pointCellM;
+
+//存放支付方式
+@property (nonatomic, strong) NSArray *paymentArray;
+
+
+
 @end
 
 @implementation Cart_CheckoutC
@@ -17,14 +36,228 @@
 - (void)viewDidLoad {
     [super viewDidLoad];
     self.title = @"Checkout";
+    
+    //获取支付方式
+    [self requestPaymentMode];
 }
 
 - (void)initSubviews {
     [super initSubviews];
+    
+    //顶部
+    [self.view addSubview:self.topView];
+    
+    
+    
     IPhoneXHeigh
-    [self setupTableV:[CartCheckTableV class] Frame:CGRectMake(0, securitytop_Y , KScreenWidth, security_H)];
+    [self setupTableV:[CartCheckTableV class] Frame:CGRectMake(0, CGRectGetMaxY(self.topView.frame) , KScreenWidth, KScreenHeight-securityBottom_H - 65 - CGRectGetMaxY(self.topView.frame))];
+    self.TableV.backgroundColor = [UIColor colorWithHexString:@"#F8F8F8"];
+    
+    @weakify(self)
+    self.TableV.tapClose = ^(NSInteger num, id data) {
+        //num = 0 删除商品 ,1 修改数量 countV
+        @strongify(self)
+        if([data isKindOfClass:[CartTotalsItemsM class]]){
+            switch (num) {
+                case 0:
+                    [self reqNet_DEL_cartsMineItems:(CartTotalsItemsM *)data];
+                    break;
+                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];
+            }
+        }
+    };
+    
+//    [self updateData];
 }
 
+- (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){
+            CartTotalsM *model = [arry firstObject];
+            self.totalsM = model;
+            
+            [self updateData];
+        }
+    } else if ([mark isEqualToString:Chectout_getPaymentMode]) {
+        
+        if(sucessOrFail){
+
+            // 更新支付方式
+            self.paymentArray = arry;
+            //首次进入展示购物车数据UI
+            [self updateData];
+        }
+        
+    } else if ([mark isEqualToString:Cart_cartsMineItems_Post]
+              || [mark isEqualToString:DEL_cartsMineItems]
+              || [mark isEqualToString:PUT_cartsMineCoupons]){
+        if(sucessOrFail){
+            [self reqNet_Cart_cartsMineTotals];
+        }else{
+            [self.view makeToast:(NSString *)data duration:2 position:CSToastPositionCenter];
+        }
+    }
+}
+
+- (void)updateData{
+    
+    [self.topView setTopViewData:self.totalsM.items_qty price:[NSString stringWithFormat:@"%@%@",self.totalsM.currency_symbol,self.totalsM.subtotal]];
+    
+    [self.TableV.infodata removeAllObjects];
+    self.TableV.infodata = [NSMutableArray arrayWithArray:self.totalsM.items];
+    
+    self.totalCellM.total_segments = [NSMutableArray arrayWithArray:self.totalsM.total_segments];
+    self.totalCellM.currency_symbol = self.totalsM.currency_symbol;
+    [self.TableV.infodata addObject:self.totalCellM];
+    
+    self.couponCellM.couponAry =[NSMutableArray arrayWithArray: [ASNetTools shared].xxx_couponAry];
+    self.couponCellM.coupon_code = self.totalsM.coupon_code;
+    self.couponCellM.discount_amount = self.totalsM.discount_amount;
+    self.couponCellM.currency_symbol = self.totalsM.currency_symbol;
+    [self.TableV.infodata addObject:self.couponCellM];
+    
+    self.pointCellM.pointCountInput = @"20";
+    self.pointCellM.pointBalance = @"10";
+    [self.TableV.infodata addObject:self.pointCellM];
+    
+//    MyCartPayTypeCellData *data = [[MyCartPayTypeCellData alloc]init];
+//    data.final_prices_f = [self.totalsM.subtotal floatValue];
+//    data.currency_symbol = self.totalsM.currency_symbol;
+//    [self.TableV.infodata addObject:data];
+    
+    //支付方式数据
+    [self.TableV.infodata addObjectsFromArray:self.paymentArray];
+    
+    
+    [self.TableV reloadData];
+}
+
+
+- (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];
+    } else if ([model isKindOfClass:[ASCheckoutPaymentModel class]]) {
+        ASCheckoutPaymentModel *paymentModel = (ASCheckoutPaymentModel *)model;
+        if (paymentModel.isSelect) {
+            return;
+        }
+        
+        for (int i = 0; i < self.TableV.infodata.count; i++) {
+            id itemModel = self.TableV.infodata[i];
+            
+            if ([itemModel isKindOfClass:[ASCheckoutPaymentModel class]]) {
+                ASCheckoutPaymentModel *tempModel = (ASCheckoutPaymentModel *)itemModel;
+                if (index.row == i) {
+                    tempModel.isSelect = YES;
+                } else {
+                    tempModel.isSelect = NO;
+                }
+            }
+        }
+        
+        [self.TableV reloadData];
+    }
+}
+
+#pragma mark - **************** reqNet ****************
+//获取支付方式
+- (void)requestPaymentMode {
+    [self.VM ry_requestGetApi:Chectout_getPaymentMode param:@{}];
+}
+///获取购物车
+-(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];
+    [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:@""];
+}
+
+#pragma mark --- 懒加载 ---
+- (void)ucm_bindvmmodel{
+    self.VM = [[CartVM alloc] initDelegate:self];
+}
+
+- (MyCartCouponCellData *)couponCellM {
+    if (!_couponCellM) {
+        _couponCellM = [[MyCartCouponCellData alloc] init];
+    }
+    return _couponCellM;
+}
+
+- (MyCartGrandTotalCellData *)totalCellM {
+    if (!_totalCellM) {
+        _totalCellM = [[MyCartGrandTotalCellData alloc] init];
+    }
+    return _totalCellM;
+}
+
+- (ASCheckoutPointData *)pointCellM {
+    if (!_pointCellM) {
+        _pointCellM = [[ASCheckoutPointData alloc] init];
+    }
+    return _pointCellM;
+}
+
+- (ASCheckoutTopView *)topView {
+    if (!_topView) {
+        IPhoneXHeigh
+        _topView = [[ASCheckoutTopView alloc] initWithFrame:CGRectMake(0, securitytop_Y, KScreenWidth, 60)];
+        @weakify(self)
+        _topView.isFlodBlock = ^(BOOL isFlod) {
+            @strongify(self)
+            self.TableV.isFlod = isFlod;
+            [self.TableV reloadData];
+        };
+//
+    }
+    return _topView;
+}
 
 #pragma mark - **************** reqNet ****************
 

+ 1 - 1
Asteria/Fuction/Cart/Cart_MyCartC.m

@@ -86,7 +86,7 @@
     };
 }
 - (void)ucm_bindvmmodel{
-    self.VM = [[CartVM alloc]initDelegate:self];
+    self.VM = [[CartVM alloc] initDelegate:self];
 }
 
 #pragma mark - **************** reqNet ****************

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

@@ -19,6 +19,12 @@
 @property (nonatomic, strong) SubLoastSelectItemV *subLostV;
 @property (nonatomic, strong) SubtotalCellItemV *subBottomV;
 
+//总金额
+@property (nonatomic, copy) NSString *totalPriceStr;
+//丢件金额
+@property (nonatomic, copy) NSString *lostPriceStr;
+
+
 @end
 @implementation MyCartGrandTotalCell
 
@@ -130,6 +136,11 @@
     if (!_subLostV) {
         _subLostV = [[SubLoastSelectItemV alloc] init];
         _subLostV.backgroundColor = [UIColor colorWithHexString:@"#FFFFFF"];
+        _subLostV.ViewtapClose = ^(NSInteger num, id  _Nonnull data) {
+            NSLog(@"=====%ld=====%@", num, data);
+            
+            
+        };
     }
     return _subLostV;
 }

+ 17 - 0
Asteria/Fuction/Cart/Checkout/ASCheckoutPaymentCell.h

@@ -0,0 +1,17 @@
+//
+//  ASCheckoutPaymentCell.h
+//  Asteria
+//
+//  Created by xingyu on 2024/5/8.
+//
+
+#import <WMBase/WMBase.h>
+#import "ASCheckoutModel.h"
+
+NS_ASSUME_NONNULL_BEGIN
+
+@interface ASCheckoutPaymentCell : TT_BaseCell
+
+@end
+
+NS_ASSUME_NONNULL_END

+ 101 - 0
Asteria/Fuction/Cart/Checkout/ASCheckoutPaymentCell.m

@@ -0,0 +1,101 @@
+//
+//  ASCheckoutPaymentCell.m
+//  Asteria
+//
+//  Created by xingyu on 2024/5/8.
+//
+
+#import "ASCheckoutPaymentCell.h"
+
+
+@interface ASCheckoutPaymentCell()
+
+@property (nonatomic, strong) UIView *bgView;
+@property (nonatomic, strong) UILabel *titleLab;
+
+@property (nonatomic, strong) UIImageView *selectImageView;
+
+@end
+
+@implementation ASCheckoutPaymentCell
+
+- (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.selectImageView];
+    
+    
+    [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.right.mas_equalTo(-100);
+        make.bottom.mas_equalTo(-20);
+    }];
+    
+    [self.selectImageView mas_makeConstraints:^(MASConstraintMaker *make) {
+        make.centerY.equalTo(self.bgView);
+        make.width.height.mas_equalTo(24);
+        make.right.mas_equalTo(-12);
+    }];
+    
+}
+
+- (void)configData:(id)Data{
+    ASCheckoutPaymentModel *model = (ASCheckoutPaymentModel *)Data;
+    self.titleLab.text = model.title;
+    
+    if (model.isSelect) {
+        _selectImageView.image = [UIImage imageNamed:@"base_radio_select"];
+    } else {
+        _selectImageView.image = [UIImage imageNamed:@"base_radio_unselect"];
+    }
+}
+
+-(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 = @"";
+        _titleLab.textColor = [UIColor colorWithHexString:@"#000000"];
+        _titleLab.adjustsFontSizeToFitWidth = YES;
+        _titleLab.font = [UIFont fontWithName:Rob_Bold size:16];
+    }
+    return _titleLab;
+}
+
+- (UIImageView *)selectImageView{
+    if(!_selectImageView){
+        _selectImageView = [[UIImageView alloc] init];
+        _selectImageView.image = [UIImage imageNamed:@"base_radio_unselect"];
+    }
+    return _selectImageView;
+}
+
+@end

+ 25 - 0
Asteria/Fuction/Cart/Checkout/ASCheckoutPointApplyCell.h

@@ -0,0 +1,25 @@
+//
+//  ASCheckoutPointApplyCell.h
+//  Asteria
+//
+//  Created by xingyu on 2024/5/8.
+//
+
+#import <WMBase/WMBase.h>
+
+NS_ASSUME_NONNULL_BEGIN
+
+@interface ASCheckoutPointData : NSObject
+
+@property (nonatomic, copy) NSString *pointCountInput;
+@property (nonatomic, copy) NSString *pointBalance;
+
+@end
+
+@interface ASCheckoutPointApplyCell : TT_BaseCell
+
+@property (nonatomic, strong) ASCheckoutPointData *pointCellData;
+
+@end
+
+NS_ASSUME_NONNULL_END

+ 191 - 0
Asteria/Fuction/Cart/Checkout/ASCheckoutPointApplyCell.m

@@ -0,0 +1,191 @@
+//
+//  ASCheckoutPointApplyCell.m
+//  Asteria
+//
+//  Created by xingyu on 2024/5/8.
+//
+
+#import "ASCheckoutPointApplyCell.h"
+
+@implementation ASCheckoutPointData
+@end
+
+
+@interface ASCheckoutPointApplyCell ()
+@property (nonatomic, strong) UIView *bgView;
+@property (nonatomic, strong) UILabel *titleLab;
+@property (nonatomic, strong) TT_CustonTF  *codeTF;
+@property (nonatomic, strong) UIButton *applyBtn;
+@property (nonatomic, strong) QMUILabel *pointDesLab;
+@end
+
+
+@implementation ASCheckoutPointApplyCell
+
+- (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];
+ 
+    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.pointDesLab];
+    
+    [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.right.mas_equalTo(-100);
+    }];
+    
+    [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.pointDesLab 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 points count" duration:2 position:CSToastPositionCenter];
+        return;
+    }
+//    if(btn.selected == NO){
+//        self.pointCellData.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{
+    ASCheckoutPointData *model = (ASCheckoutPointData *)Data;
+    self.pointCellData = model;
+    
+//    if(![model.pointCountInput isEmpty] && model.pointCountInput.length>0){
+//        self.codeTF.text = MM_str(model.pointCountInput);
+//        self.applyBtn.selected = YES;
+//    }else{
+//        self.codeTF.text = @"";
+//        self.applyBtn.selected = NO;
+//    }
+    
+    NSString *pointStr = @"You have 10 Reward Points ($1.00) available. ";
+    NSString *pointLastStr = @"10 point = $1. Input points value below to redeem.";
+    
+    NSMutableAttributedString *couponStr = [[NSMutableAttributedString alloc] initWithString:[NSString stringWithFormat:@"%@%@", pointStr, pointLastStr]];
+//    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, [pointStr length])];
+    self.pointDesLab.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 = @"Redeem Your Reward Points";
+        _titleLab.textColor = [UIColor colorWithHexString:@"#000000"];
+        _titleLab.adjustsFontSizeToFitWidth = YES;
+        _titleLab.font = [UIFont fontWithName:Rob_Bold size:16];
+    }
+    return _titleLab;
+}
+
+-(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 *)pointDesLab{
+    if(!_pointDesLab){
+        _pointDesLab = [[QMUILabel alloc]init];
+        _pointDesLab.numberOfLines = 0;
+        _pointDesLab.font = [UIFont fontWithName:Rob_Regular size:12];
+        _pointDesLab.textColor = [UIColor colorWithHexString:@"#B2B2B2"];
+        _pointDesLab.preferredMaxLayoutWidth =KScreenWidth-40;
+    }
+    return _pointDesLab;
+}
+
+@end

+ 27 - 0
Asteria/Fuction/Cart/Checkout/ASCheckoutTopView.h

@@ -0,0 +1,27 @@
+//
+//  ASCheckoutTopView.h
+//  Asteria
+//
+//  Created by xingyu on 2024/5/8.
+//
+
+#import <UIKit/UIKit.h>
+
+NS_ASSUME_NONNULL_BEGIN
+
+
+typedef void(^ASCheckoutFlodBlock)(BOOL isFlod);
+
+@interface ASCheckoutTopView : UIView
+
+@property (nonatomic, copy) ASCheckoutFlodBlock isFlodBlock;
+
+@property (nonatomic, strong) UILabel *countLab;
+@property (nonatomic, strong) UIButton *arrowBtn;
+@property (nonatomic, strong) UILabel *priceLab;
+
+- (void)setTopViewData:(NSString *)itemCount price:(NSString *)priceStr;
+
+@end
+
+NS_ASSUME_NONNULL_END

+ 67 - 0
Asteria/Fuction/Cart/Checkout/ASCheckoutTopView.m

@@ -0,0 +1,67 @@
+//
+//  ASCheckoutTopView.m
+//  Asteria
+//
+//  Created by xingyu on 2024/5/8.
+//
+
+#import "ASCheckoutTopView.h"
+
+@implementation ASCheckoutTopView
+
+- (instancetype)initWithFrame:(CGRect)frame {
+    if (self = [super initWithFrame:frame]) {
+        self.backgroundColor = ThemeLightColor;
+        
+        _countLab = [[UILabel alloc] init];
+        _countLab.textColor = _0B0B0B;
+        _countLab.text = @"show order items";
+        _countLab.font = [UIFont fontWithName:Rob_Bold size:16];
+        [self addSubview:_countLab];
+        [_countLab mas_makeConstraints:^(MASConstraintMaker *make) {
+            make.left.mas_equalTo(20);
+            make.centerY.equalTo(self);
+        }];
+        
+        _arrowBtn = [UIButton buttonWithType:UIButtonTypeCustom];
+        [_arrowBtn setTitle:@"收起" forState:UIControlStateNormal];
+        [_arrowBtn setTitle:@"展开" forState:UIControlStateSelected];
+        _arrowBtn.titleLabel.font = [UIFont fontWithName:Rob_Bold size:12];
+        [_arrowBtn addTarget:self action:@selector(_isFlodClick:) forControlEvents:UIControlEventTouchUpInside];
+        [_arrowBtn setTitleColor:_0B0B0B forState:0];
+        [self addSubview:_arrowBtn];
+        [_arrowBtn mas_makeConstraints:^(MASConstraintMaker *make) {
+            make.right.mas_equalTo(-12);
+            make.centerY.equalTo(self);
+            make.width.mas_equalTo(35);
+            make.height.mas_equalTo(32);
+        }];
+        
+        _priceLab = [[UILabel alloc] init];
+        _priceLab.textColor = _0B0B0B;
+        _priceLab.font = [UIFont fontWithName:Rob_Bold size:16];
+        [self addSubview:_priceLab];
+        [_priceLab mas_makeConstraints:^(MASConstraintMaker *make) {
+            make.right.equalTo(_arrowBtn.mas_left).offset(-6);
+            make.centerY.equalTo(self);
+        }];
+        
+    }
+    return self;
+}
+- (void)setTopViewData:(NSString *)itemCount price:(NSString *)priceStr {
+    _countLab.text = [NSString stringWithFormat:@"show order items (%@)", itemCount];
+    
+    _priceLab.text = priceStr;
+}
+
+- (void)_isFlodClick:(UIButton *)button {
+    button.selected = !button.selected;
+    
+    if (self.isFlodBlock) {
+        self.isFlodBlock(button.selected);
+    }
+    
+}
+
+@end

+ 11 - 0
Asteria/Fuction/Cart/Checkout/CartCheckTableV.h

@@ -7,6 +7,17 @@
 
 #import <WMBase/WMBase.h>
 #import "CartTotalsM.h"
+
+#import "MyCartItemCell.h"
+#import "MyCartCouponCell.h"
+#import "MyCartGrandTotalCell.h"
+#import "GoodsSizePayMentCell.h"
+#import "MyCartGrandTotalCell.h"
+#import "MyCartPayTypeCell.h"
+
+#import "ASCheckoutPointApplyCell.h"
+#import "ASCheckoutPaymentCell.h"
+
 NS_ASSUME_NONNULL_BEGIN
 
 @interface CartCheckTableV : TT_BaseTableV

+ 69 - 0
Asteria/Fuction/Cart/Checkout/CartCheckTableV.m

@@ -9,4 +9,73 @@
 
 @implementation CartCheckTableV
 
+- (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;
+    }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;
+    }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:[ASCheckoutPointData class]]){
+        ASCheckoutPointApplyCell *cell = [ASCheckoutPointApplyCell cellWithTableView:tableView CellClass:[ASCheckoutPointApplyCell class]];
+        [cell configData:(ASCheckoutPointData *)objectM];
+        @weakify(self)
+        cell.currencyparameterClose = ^(NSInteger type, id Data) {
+            @strongify(self)
+            [self generaltriggermethodType:type data:Data];
+        };
+        return cell;
+    }else if([objectM isKindOfClass:[ASCheckoutPaymentModel class]]){
+        ASCheckoutPaymentCell *cell = [ASCheckoutPaymentCell cellWithTableView:tableView CellClass:[ASCheckoutPaymentCell class]];
+        [cell configData:(ASCheckoutPaymentModel *)objectM];
+        @weakify(self)
+        cell.currencyparameterClose = ^(NSInteger type, id Data) {
+            @strongify(self)
+            [self generaltriggermethodType:type data:Data];
+        };
+        return cell;
+    }else if([objectM isKindOfClass:[MyCartPayTypeCellData class]]){
+        MyCartPayTypeCell *cell = [MyCartPayTypeCell cellWithTableView:tableView CellClass:[MyCartPayTypeCell class]];
+        [cell configData:(MyCartPayTypeCellData *)objectM];
+        return cell;
+    }
+    return  nil;
+}
+- (CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath {
+    
+    NSObject *objectM = self.infodata[indexPath.row];
+    if([objectM isKindOfClass:[CartTotalsItemsM class]] && self.isFlod){
+        return 0;
+    }
+    
+    return UITableViewAutomaticDimension;
+}
+
+- (CGFloat)tableView:(UITableView *)tableView estimatedHeightForRowAtIndexPath:(NSIndexPath *)indexPath{
+    return 200;
+}
+
 @end

+ 25 - 0
Asteria/Fuction/Cart/M/ASCheckoutModel.h

@@ -0,0 +1,25 @@
+//
+//  ASCheckoutModel.h
+//  Asteria
+//
+//  Created by xingyu on 2024/5/8.
+//
+
+#import <Foundation/Foundation.h>
+
+NS_ASSUME_NONNULL_BEGIN
+
+@interface ASCheckoutModel : NSObject
+
+@end
+
+//支付方式model
+@interface ASCheckoutPaymentModel : NSObject
+
+@property (nonatomic, copy) NSString *title;
+@property (nonatomic, copy) NSString *code;
+@property (nonatomic, assign) BOOL isSelect;
+
+@end
+
+NS_ASSUME_NONNULL_END

+ 18 - 0
Asteria/Fuction/Cart/M/ASCheckoutModel.m

@@ -0,0 +1,18 @@
+//
+//  ASCheckoutModel.m
+//  Asteria
+//
+//  Created by xingyu on 2024/5/8.
+//
+
+#import "ASCheckoutModel.h"
+
+@implementation ASCheckoutModel
+
+@end
+
+
+
+@implementation ASCheckoutPaymentModel
+
+@end

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

@@ -19,5 +19,3 @@
 @implementation CartTotalsItemsM
 
 @end
-
-

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

@@ -36,6 +36,8 @@
             @strongify(self)
             [self generaltriggermethodType:type data:Data];
         };
+        
+        
         return cell;
     }else if([objectM isKindOfClass:[MyCartPayTypeCellData class]]){
         MyCartPayTypeCell *cell = [MyCartPayTypeCell cellWithTableView:tableView CellClass:[MyCartPayTypeCell class]];

+ 5 - 1
Asteria/Fuction/Cart/VM/CartVM.h

@@ -7,6 +7,8 @@
 
 #import "RYBaseVM.h"
 #import "CartTotalsM.h"
+#import "ASCheckoutModel.h"
+
 ///获取购物车列表
 #define Cart_cartsMineTotals   BaseRequestrUrl(@"carts/mine/totals")
 //添加或修改商品数量
@@ -18,7 +20,9 @@
 //删除购物车优惠券
 #define DEL_cartsMineCoupons BaseRequestrUrl(@"carts/mine/coupons")
 
-///购物车
+//结算中心
+//获取支付方式
+#define Chectout_getPaymentMode BaseRequestrUrl(@"carts/mine/payment-methods")
 
 
 

+ 15 - 1
Asteria/Fuction/Cart/VM/CartVM.m

@@ -33,7 +33,21 @@
         }
         NSMutableArray *ary = [NSMutableArray arrayWithArray:@[model]];
         [self ry_VMconfigDelegateData:data parseAry:ary success:YES mark:mark reqNetType:reqNetType];
-    }else{
+    } else if ([mark isEqualToString:Chectout_getPaymentMode]) {
+        
+        NSArray *paymentArray = [ASCheckoutPaymentModel mj_objectArrayWithKeyValuesArray:data];
+        for (int i = 0; i < paymentArray.count; i++) {
+            ASCheckoutPaymentModel *payModel = [paymentArray objectAtIndex:i];
+            if (i == 0) {
+                payModel.isSelect = YES;
+            } else {
+                payModel.isSelect = NO;
+            }
+        }
+        NSMutableArray *ary = [NSMutableArray arrayWithArray:paymentArray];
+        [self ry_VMconfigDelegateData:data parseAry:ary success:YES mark:mark reqNetType:reqNetType];
+        
+    } else{
         [self ry_VMconfigDelegateData:data parseAry:[NSMutableArray array] success:YES mark:mark reqNetType:reqNetType];
     }
 }

+ 2 - 0
Asteria/Fuction/Login/VC/AS_LoginC.m

@@ -169,6 +169,7 @@
 -(EamilTFmatchV *)xxx_emailTFV{
     if (!_xxx_emailTFV) {
         _xxx_emailTFV = [[EamilTFmatchV alloc]initWithFrame:CGRectMake(0, 0, KScreenWidth, 50)];
+        _xxx_emailTFV.xxx_emailTF.text = @"845600348@qq.com";
     }
     return _xxx_emailTFV;
 }
@@ -177,6 +178,7 @@
 - (PassWordSecureBtnV *)xxx_passwordV {
     if (!_xxx_passwordV) {
         _xxx_passwordV = [[PassWordSecureBtnV alloc]initWithFrame:CGRectMake(20, CGRectGetMaxY(self.xxx_emailTFV.frame)+30, KScreenWidth-40, 50+20)];
+        _xxx_passwordV.xxx_passwordTF.text = @"nuli322103";
     }
     return _xxx_passwordV;
 }

File diff suppressed because it is too large
+ 1583 - 1625
Pods/Pods.xcodeproj/project.pbxproj