浏览代码

feat:结算中心地址、邮寄方式联动、接口数据联调

“wangdongchao” 1 年之前
父节点
当前提交
a6effcda80

+ 18 - 0
Asteria.xcodeproj/project.pbxproj

@@ -188,6 +188,9 @@
 		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 */; };
+		8810F5182BEC548D00346FD4 /* ASCheckoutAddressCell.m in Sources */ = {isa = PBXBuildFile; fileRef = 8810F5172BEC548D00346FD4 /* ASCheckoutAddressCell.m */; };
+		8810F51B2BEC54B400346FD4 /* ASCheckoutShipMethodCell.m in Sources */ = {isa = PBXBuildFile; fileRef = 8810F51A2BEC54B400346FD4 /* ASCheckoutShipMethodCell.m */; };
+		8810F51E2BEC565F00346FD4 /* UILabel+Create.m in Sources */ = {isa = PBXBuildFile; fileRef = 8810F51C2BEC565F00346FD4 /* UILabel+Create.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 */; };
@@ -687,6 +690,12 @@
 		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>"; };
+		8810F5162BEC548D00346FD4 /* ASCheckoutAddressCell.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = ASCheckoutAddressCell.h; sourceTree = "<group>"; };
+		8810F5172BEC548D00346FD4 /* ASCheckoutAddressCell.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = ASCheckoutAddressCell.m; sourceTree = "<group>"; };
+		8810F5192BEC54B400346FD4 /* ASCheckoutShipMethodCell.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = ASCheckoutShipMethodCell.h; sourceTree = "<group>"; };
+		8810F51A2BEC54B400346FD4 /* ASCheckoutShipMethodCell.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = ASCheckoutShipMethodCell.m; sourceTree = "<group>"; };
+		8810F51C2BEC565F00346FD4 /* UILabel+Create.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "UILabel+Create.m"; sourceTree = "<group>"; };
+		8810F51D2BEC565F00346FD4 /* UILabel+Create.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "UILabel+Create.h"; 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>"; };
@@ -1536,6 +1545,8 @@
 		81C3B44B29F6691300D79294 /* Extensions */ = {
 			isa = PBXGroup;
 			children = (
+				8810F51D2BEC565F00346FD4 /* UILabel+Create.h */,
+				8810F51C2BEC565F00346FD4 /* UILabel+Create.m */,
 				81C3B45329F66C1700D79294 /* UIView+PublicInit.h */,
 				81C3B45429F66C1700D79294 /* UIView+PublicInit.m */,
 				81932E2929F7539B007C37AF /* UIColor+AS.h */,
@@ -2409,6 +2420,10 @@
 				8810F5082BEB159600346FD4 /* ASCheckoutTopView.m */,
 				8810F50A2BEB590C00346FD4 /* ASCheckoutPointApplyCell.h */,
 				8810F50B2BEB590C00346FD4 /* ASCheckoutPointApplyCell.m */,
+				8810F5162BEC548D00346FD4 /* ASCheckoutAddressCell.h */,
+				8810F5172BEC548D00346FD4 /* ASCheckoutAddressCell.m */,
+				8810F5192BEC54B400346FD4 /* ASCheckoutShipMethodCell.h */,
+				8810F51A2BEC54B400346FD4 /* ASCheckoutShipMethodCell.m */,
 				8810F5102BEB685500346FD4 /* ASCheckoutPaymentCell.h */,
 				8810F5112BEB685500346FD4 /* ASCheckoutPaymentCell.m */,
 			);
@@ -2708,6 +2723,7 @@
 				81601FFA2A2DC78300E4A8F1 /* WMZBannerFadeLayout.m in Sources */,
 				816020182A2F070B00E4A8F1 /* ASHomeCategoryModel.m in Sources */,
 				81AA11D92B23FF1F008EB5C7 /* ASCategoriesViewModel.m in Sources */,
+				8810F51B2BEC54B400346FD4 /* ASCheckoutShipMethodCell.m in Sources */,
 				8131A28C2B3692F300A191BE /* APHomeActiveViewController.m in Sources */,
 				9AD4D3972B48E8780086D6FB /* ReviewsTableHearV.m in Sources */,
 				8134C1B72A1359E6006EB0EC /* ASSignDayView.m in Sources */,
@@ -2725,6 +2741,7 @@
 				816020042A2DCC0200E4A8F1 /* ASHomeBannerModel.m in Sources */,
 				81717D3F2A3D5EAD00648139 /* ASDefualtAlertV.m in Sources */,
 				819900222A020A6F006FE68C /* LYTools.m in Sources */,
+				8810F51E2BEC565F00346FD4 /* UILabel+Create.m in Sources */,
 				816020072A2DD4FB00E4A8F1 /* Target_Home.m in Sources */,
 				81CE28942AF490C20012AA45 /* ASGiftCardTableView.m in Sources */,
 				81FC41A32BEB4D6E00EB0A85 /* InTableScrollView.m in Sources */,
@@ -2792,6 +2809,7 @@
 				9AD3460C2A08D60F005CA070 /* ZFVolumeBrightnessView.m in Sources */,
 				81DFA5752A47D97C00DA708B /* ASCouponsListViewController.m in Sources */,
 				9AD346072A08D60F005CA070 /* UIViewController+ZFPlayerRotation.m in Sources */,
+				8810F5182BEC548D00346FD4 /* ASCheckoutAddressCell.m in Sources */,
 				81C796462A5542B2003083B8 /* ASHelpListViewController.m in Sources */,
 				8160200D2A2DD5C000E4A8F1 /* CTMediator+UserCenter.m in Sources */,
 				81DFA5712A46D95400DA708B /* ASPointDetailCell.m in Sources */,

+ 19 - 0
Asteria/ASUI/Extensions/UILabel+Create.h

@@ -0,0 +1,19 @@
+//
+//  UILabel+Create.h
+//  HuoChat
+//
+//  Created by macWangDC on 2022/9/28.
+//  Copyright © 2022 Huobi. All rights reserved.
+//
+
+#import <UIKit/UIKit.h>
+
+NS_ASSUME_NONNULL_BEGIN
+
+@interface UILabel (Create)
+
++ (UILabel *)labelCreateWithText:(NSString *)text font:(UIFont *)font textColor:(UIColor *)color;
+
+@end
+
+NS_ASSUME_NONNULL_END

+ 21 - 0
Asteria/ASUI/Extensions/UILabel+Create.m

@@ -0,0 +1,21 @@
+//
+//  UILabel+Create.m
+//  HuoChat
+//
+//  Created by macWangDC on 2022/9/28.
+//  Copyright © 2022 Huobi. All rights reserved.
+//
+
+#import "UILabel+Create.h"
+
+@implementation UILabel (Create)
+
++ (UILabel *)labelCreateWithText:(NSString *)text font:(UIFont *)font textColor:(UIColor *)color {
+    UILabel *label = [[UILabel alloc] init];
+    label.text = text;
+    label.font = font;
+    label.textColor = color;
+    return label;
+}
+
+@end

+ 102 - 5
Asteria/Fuction/Cart/Cart_CheckoutC.m

@@ -6,11 +6,13 @@
 //
 
 #import "Cart_CheckoutC.h"
+#import "ASAddressListViewController.h"
+
+#import "ASCheckoutTopView.h"
 #import "CartCheckTableV.h"
 
 #import "CartVM.h"
-
-#import "ASCheckoutTopView.h"
+#import "ASUserModel.h"
 
 @interface Cart_CheckoutC ()<RY_baseVMprotocol>
 
@@ -23,6 +25,8 @@
 @property (nonatomic, strong) MyCartGrandTotalCellData *totalCellM;
 
 @property (nonatomic, strong) ASCheckoutPointData *pointCellM;
+@property (nonatomic, strong) ASCheckoutAddressData *addressCellM;
+
 
 //存放支付方式
 @property (nonatomic, strong) NSArray *paymentArray;
@@ -39,6 +43,10 @@
     
     //获取支付方式
     [self requestPaymentMode];
+    //获取运输方式
+    [self requestGetShipMethodByAddress];
+    //获取购物车信息(地址信息)
+    [self requestCartInfo];
 }
 
 - (void)initSubviews {
@@ -95,14 +103,63 @@
             [self updateData];
         }
     } else if ([mark isEqualToString:Chectout_getPaymentMode]) {
-        
         if(sucessOrFail){
-
             // 更新支付方式
             self.paymentArray = arry;
             //首次进入展示购物车数据UI
             [self updateData];
         }
+    } else if ([mark isEqualToString:Cart_cartInfo]) {
+        if(sucessOrFail){
+            // 获取上次下单地址
+            NSDictionary *dic = (NSDictionary *)data;
+            NSArray *array = [[dic objectForKey:@"extension_attributes"] objectForKey:@"shipping_assignments"];
+            
+            if (array.count > 0) {
+                NSDictionary *shipping_assignments = array[0];
+                NSDictionary *shippingDic = [shipping_assignments objectForKey:@"shipping"];
+                NSDictionary *addressDic = [shippingDic objectForKey:@"address"];
+//                ASAddressModel *addressModel = [ASAddressModel defualtData];
+                ASAddressModel *addressModel = [ASAddressModel mj_objectWithKeyValues:addressDic];
+                if (NIL(addressModel.postcode)) {
+                    self.addressCellM.addressInfoStr = @"";
+                    self.addressCellM.shipmethodStr = @"";
+                } else {
+                    self.addressCellM.addressInfoStr = [NSString stringWithFormat:@"%@ %@ %@ %@,%@ tel:%@", addressModel.firstname, addressModel.lastname, [addressModel.street componentsJoinedByString:@" "], addressModel.city, addressModel.postcode, addressModel.telephone];
+                    self.addressCellM.shipmethodStr = [shippingDic objectForKey:@"method"];
+                    self.addressCellM.addressId = [addressDic objectForKey:@"customer_address_id"];
+                }
+            }
+            //首次进入展示购物车数据UI
+            [self updateData];
+        }
+        
+    } else if ([mark isEqualToString:Chectout_addShipAddress_id]) {
+        
+        if(sucessOrFail){
+            NSArray *shipMethodArr = (NSArray *)data;
+            if (shipMethodArr.count > 0) {
+                NSDictionary *shipMethodDic = shipMethodArr[0];
+                self.addressCellM.shipmethodStr = [NSString stringWithFormat:@"%@ %@", shipMethodDic[@"method_title"], shipMethodDic[@"carrier_title"]];
+                self.addressCellM.shipmethodPrice = shipMethodDic[@"amount"];
+                self.addressCellM.shipmethodSymbol = self.totalsM.currency_symbol;
+            }
+            
+        }
+        [self updateData];
+        
+    } else if ([mark isEqualToString:Chectout_getShipMethod]) {
+        
+        if(sucessOrFail){
+            NSArray *shipMethodArr = (NSArray *)data;
+            if (shipMethodArr.count > 0) {
+                NSDictionary *shipMethodDic = shipMethodArr[0];
+                self.addressCellM.shipmethodStr = [NSString stringWithFormat:@"%@ %@", shipMethodDic[@"method_title"], shipMethodDic[@"carrier_title"]];
+                self.addressCellM.shipmethodPrice = shipMethodDic[@"amount"];
+                self.addressCellM.shipmethodSymbol = self.totalsM.currency_symbol;
+            }
+        }
+        [self updateData];
         
     } else if ([mark isEqualToString:Cart_cartsMineItems_Post]
               || [mark isEqualToString:DEL_cartsMineItems]
@@ -136,6 +193,11 @@
     self.pointCellM.pointBalance = @"10";
     [self.TableV.infodata addObject:self.pointCellM];
     
+    //邮寄地址--邮寄方式
+    [self.TableV.infodata addObject:self.addressCellM];
+    
+    
+    
 //    MyCartPayTypeCellData *data = [[MyCartPayTypeCellData alloc]init];
 //    data.final_prices_f = [self.totalsM.subtotal floatValue];
 //    data.currency_symbol = self.totalsM.currency_symbol;
@@ -177,6 +239,19 @@
         }
         
         [self.TableV reloadData];
+    } else if ([model isKindOfClass:[ASCheckoutAddressData class]]) {
+        ASAddressListViewController *vc = [ASAddressListViewController new];
+        vc.isSelMode = true;
+        vc.sel_Id = self.addressCellM.addressId;
+        @weakify(self)
+        vc.selectAddressBlock = ^(ASAddressModel * _Nonnull addressM) {
+            @strongify(self)
+            self.addressCellM.addressInfoStr = [NSString stringWithFormat:@"%@ %@ %@ %@,%@ tel:%@", addressM.firstname, addressM.lastname, [addressM.street componentsJoinedByString:@" "], addressM.city, addressM.postcode, addressM.telephone];
+            self.addressCellM.addressId = addressM.Id;
+            
+            [self requestAddShipAddress];
+        };
+        [self.navigationController pushViewController:vc animated:true];
     }
 }
 
@@ -185,7 +260,21 @@
 - (void)requestPaymentMode {
     [self.VM ry_requestGetApi:Chectout_getPaymentMode param:@{}];
 }
-///获取购物车
+//添加邮寄地址
+- (void)requestAddShipAddress {
+    [MBProgressHUD showHUDAddedTo:self.view animated:YES];
+    [self.VM ry_requestPostApi:Chectout_addShipAddress_id param:@{@"addressId":self.addressCellM.addressId}];
+}
+//根据邮寄地址获取邮寄方式
+- (void)requestGetShipMethodByAddress {
+    [self.VM ry_requestGetApi:Chectout_getShipMethod param:@{}];
+}
+//获取购物车信息(地址信息)
+- (void)requestCartInfo {
+    [MBProgressHUD showHUDAddedTo:self.view animated:YES];
+    [self.VM ry_requestGetApi:Cart_cartInfo param:@{}];
+}
+///获取购物车信息(报价整合)
 -(void)reqNet_Cart_cartsMineTotals{
     [MBProgressHUD showHUDAddedTo:self.view animated:YES];
     [self.VM ry_requestGetApi:Cart_cartsMineTotals param:@{}];
@@ -243,6 +332,14 @@
     }
     return _pointCellM;
 }
+- (ASCheckoutAddressData *)addressCellM {
+    if (!_addressCellM) {
+        _addressCellM = [[ASCheckoutAddressData alloc] init];
+        _addressCellM.addressInfoStr = @"";
+    }
+    return _addressCellM;
+}
+
 
 - (ASCheckoutTopView *)topView {
     if (!_topView) {

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

@@ -0,0 +1,27 @@
+//
+//  ASCheckoutAddressCell.h
+//  Asteria
+//
+//  Created by xingyu on 2024/5/9.
+//
+
+#import <WMBase/WMBase.h>
+
+NS_ASSUME_NONNULL_BEGIN
+
+@interface ASCheckoutAddressData : NSObject
+
+@property (nonatomic, copy) NSString *addressId;
+@property (nonatomic, copy) NSString *addressInfoStr;
+@property (nonatomic, copy) NSString *shipmethodStr;
+@property (nonatomic, copy) NSString *shipmethodPrice;
+@property (nonatomic, copy) NSString *shipmethodSymbol;
+
+@end
+
+
+@interface ASCheckoutAddressCell : TT_BaseCell
+
+@end
+
+NS_ASSUME_NONNULL_END

+ 134 - 0
Asteria/Fuction/Cart/Checkout/ASCheckoutAddressCell.m

@@ -0,0 +1,134 @@
+//
+//  ASCheckoutAddressCell.m
+//  Asteria
+//
+//  Created by xingyu on 2024/5/9.
+//
+
+#import "ASCheckoutAddressCell.h"
+
+@implementation ASCheckoutAddressData
+
+@end
+
+@interface ASCheckoutAddressCell()
+
+@property (nonatomic, strong) UILabel *addressLab;
+@property (nonatomic, strong) UILabel *shipMethodLab;
+@property (nonatomic, strong) UILabel *shipPriceLab;
+
+@end
+
+@implementation ASCheckoutAddressCell
+
+- (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.backgroundColor = [UIColor colorWithHexString:@"#F8F8F8"];
+    
+    UIView *backView = [[UIView alloc] init];
+    TT_ViewRadius(backView, 4);
+    backView.backgroundColor = [UIColor whiteColor];
+    [self.contentView addSubview:backView];
+    [backView mas_makeConstraints:^(MASConstraintMaker *make) {
+        make.left.top.mas_equalTo(10);
+        make.right.mas_equalTo(-10);
+    }];
+    
+    UIImageView *arrowRightImgV = [[UIImageView alloc] init];
+    arrowRightImgV.image = [UIImage imageNamed:@"productList_more_right"];
+    [backView addSubview:arrowRightImgV];
+    [arrowRightImgV mas_makeConstraints:^(MASConstraintMaker *make) {
+        make.right.mas_equalTo(-10);
+        make.centerY.equalTo(backView);
+        make.width.height.mas_equalTo(14);
+    }];
+    
+    UILabel *shipTitleLab = [UILabel labelCreateWithText:@"ship to" font:[UIFont fontWithName:Rob_Regular size:12] textColor:Col_666];
+    [backView addSubview:shipTitleLab];
+    [shipTitleLab mas_makeConstraints:^(MASConstraintMaker *make) {
+        make.left.mas_equalTo(10);
+        make.top.mas_equalTo(20);
+    }];
+    
+    _addressLab = [UILabel labelCreateWithText:@"" font:[UIFont fontWithName:Rob_Bold size:14] textColor:_0B0B0B];
+    [backView addSubview:_addressLab];
+    [_addressLab mas_makeConstraints:^(MASConstraintMaker *make) {
+        make.left.mas_equalTo(10);
+        make.right.mas_equalTo(-48);
+        make.top.equalTo(shipTitleLab.mas_bottom).offset(10);
+        make.height.mas_equalTo(18);
+        make.bottom.mas_equalTo(-20);
+    }];
+    
+    UIView *shipMethodView = [[UIView alloc] init];
+    TT_ViewRadius(shipMethodView, 4);
+    shipMethodView.backgroundColor = [UIColor whiteColor];
+    [self.contentView addSubview:shipMethodView];
+    [shipMethodView mas_makeConstraints:^(MASConstraintMaker *make) {
+        make.left.mas_equalTo(10);
+        make.top.equalTo(backView.mas_bottom).offset(10);
+        make.right.mas_equalTo(-10);
+        make.bottom.mas_equalTo(0);
+    }];
+    
+    UILabel *shipMethodLab1 = [UILabel labelCreateWithText:@"Shipping Method" font:[UIFont fontWithName:Rob_Bold size:14] textColor:_0B0B0B];
+    [shipMethodView addSubview:shipMethodLab1];
+    [shipMethodLab1 mas_makeConstraints:^(MASConstraintMaker *make) {
+        make.left.mas_equalTo(10);
+        make.top.mas_equalTo(20);
+    }];
+    
+    _shipPriceLab = [UILabel labelCreateWithText:@"" font:[UIFont fontWithName:Rob_Bold size:14] textColor:_0B0B0B];
+    _shipPriceLab.textAlignment = NSTextAlignmentRight;
+    _shipPriceLab.adjustsFontSizeToFitWidth = YES;
+    [shipMethodView addSubview:_shipPriceLab];
+    [_shipPriceLab mas_makeConstraints:^(MASConstraintMaker *make) {
+        make.right.mas_equalTo(-10);
+        make.centerY.mas_equalTo(shipMethodView);
+        make.width.mas_equalTo(64);
+    }];
+    
+    _shipMethodLab = [UILabel labelCreateWithText:@"" font:[UIFont fontWithName:Rob_Regular size:12] textColor:Col_666];
+    [shipMethodView addSubview:_shipMethodLab];
+    [_shipMethodLab mas_makeConstraints:^(MASConstraintMaker *make) {
+        make.left.mas_equalTo(10);
+        make.right.mas_equalTo(-84);
+        make.top.equalTo(shipMethodLab1.mas_bottom).offset(10);
+        make.height.mas_equalTo(18);
+        make.bottom.mas_equalTo(-20);
+    }];
+    
+}
+
+- (void)configData:(id)Data{
+    ASCheckoutAddressData *model = (ASCheckoutAddressData *)Data;
+    
+    if (NIL(model.addressInfoStr)) {
+        _addressLab.textColor = [UIColor getColor:@"#E60013"];
+        _addressLab.text = @"Please fill in your address";
+    } else {
+        _addressLab.textColor = _0B0B0B;
+        _addressLab.text = model.addressInfoStr;
+    }
+    
+    if (NIL(model.shipmethodStr)) {
+        _shipMethodLab.text = @"--";
+    } else {
+        _shipMethodLab.text = model.shipmethodStr;
+    }
+    
+    _shipPriceLab.text = [NSString stringWithFormat:@"%@%@", model.shipmethodSymbol, model.shipmethodPrice];
+}
+
+@end

+ 2 - 1
Asteria/Fuction/Cart/Checkout/ASCheckoutPointApplyCell.m

@@ -155,7 +155,8 @@
 -(TT_CustonTF *)codeTF{
     if(!_codeTF){
         _codeTF = [[TT_CustonTF alloc]initWithFrame:CGRectMake(10, 0, KScreenWidth-20-95, 45)];
-        _codeTF.placeholder = @"Enter Your Coupon Code";
+        _codeTF.keyboardType = UIKeyboardTypeNumberPad;
+        _codeTF.placeholder = @"Enter Your Reward Points";
         _codeTF.font = [UIFont fontWithName:Rob_Regular size:14];
     }
     return _codeTF;

+ 16 - 0
Asteria/Fuction/Cart/Checkout/ASCheckoutShipMethodCell.h

@@ -0,0 +1,16 @@
+//
+//  ASCheckoutShipMethodCell.h
+//  Asteria
+//
+//  Created by xingyu on 2024/5/9.
+//
+
+#import <WMBase/WMBase.h>
+
+NS_ASSUME_NONNULL_BEGIN
+
+@interface ASCheckoutShipMethodCell : TT_BaseCell
+
+@end
+
+NS_ASSUME_NONNULL_END

+ 23 - 0
Asteria/Fuction/Cart/Checkout/ASCheckoutShipMethodCell.m

@@ -0,0 +1,23 @@
+//
+//  ASCheckoutShipMethodCell.m
+//  Asteria
+//
+//  Created by xingyu on 2024/5/9.
+//
+
+#import "ASCheckoutShipMethodCell.h"
+
+@implementation ASCheckoutShipMethodCell
+
+- (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
+}
+
+@end

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

@@ -16,6 +16,7 @@
 #import "MyCartPayTypeCell.h"
 
 #import "ASCheckoutPointApplyCell.h"
+#import "ASCheckoutAddressCell.h"
 #import "ASCheckoutPaymentCell.h"
 
 NS_ASSUME_NONNULL_BEGIN

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

@@ -48,6 +48,15 @@
             [self generaltriggermethodType:type data:Data];
         };
         return cell;
+    }else if([objectM isKindOfClass:[ASCheckoutAddressData class]]){//地址
+        ASCheckoutAddressCell *cell = [ASCheckoutAddressCell cellWithTableView:tableView CellClass:[ASCheckoutAddressCell class]];
+        [cell configData:(ASCheckoutAddressData *)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];

+ 13 - 7
Asteria/Fuction/Cart/VM/CartVM.h

@@ -10,20 +10,26 @@
 #import "ASCheckoutModel.h"
 
 ///获取购物车列表
-#define Cart_cartsMineTotals   BaseRequestrUrl(@"carts/mine/totals")
+#define Cart_cartsMineTotals         BaseRequestrUrl(@"carts/mine/totals")
 //添加或修改商品数量
-#define Cart_cartsMineItems_Post   BaseRequestrUrl(@"carts/mine/items")
+#define Cart_cartsMineItems_Post     BaseRequestrUrl(@"carts/mine/items")
 //删除购物车商品
-#define DEL_cartsMineItems BaseRequestrUrl(@"carts/mine/items")
+#define DEL_cartsMineItems           BaseRequestrUrl(@"carts/mine/items")
 //添加优惠券
-#define PUT_cartsMineCoupons  BaseRequestrUrl(@"carts/mine/coupons")
+#define PUT_cartsMineCoupons         BaseRequestrUrl(@"carts/mine/coupons")
 //删除购物车优惠券
-#define DEL_cartsMineCoupons BaseRequestrUrl(@"carts/mine/coupons")
+#define DEL_cartsMineCoupons         BaseRequestrUrl(@"carts/mine/coupons")
+
+//购物车信息(获取邮寄地址)
+#define Cart_cartInfo                BaseRequestrUrl(@"carts/mine")
 
 //结算中心
 //获取支付方式
-#define Chectout_getPaymentMode BaseRequestrUrl(@"carts/mine/payment-methods")
-
+#define Chectout_getPaymentMode      BaseRequestrUrl(@"carts/mine/payment-methods")
+//添加邮寄地址
+#define Chectout_addShipAddress_id   BaseRequestrUrl(@"carts/mine/estimate-shipping-methods-by-address-id")
+//根据邮寄地址获取邮寄方式
+#define Chectout_getShipMethod       BaseRequestrUrl(@"carts/mine/shipping-methods")
 
 
 NS_ASSUME_NONNULL_BEGIN

+ 1 - 0
Asteria/PreFixHeader.h

@@ -22,6 +22,7 @@
 #import "CTMediator+UserCenter.h"
 #import "UITableView+ASBase.h"
 #import "UIView+PublicInit.h"
+#import "UILabel+Create.h"
 #import "UIColor+AS.h"
 #import "ColorDefine.h"
 #import "SizeDefine.h"