浏览代码

feat:运输方式(获取/设置)、下单

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

+ 104 - 23
Asteria/Fuction/Cart/Cart_CheckoutC.m

@@ -29,6 +29,7 @@
 
 @property (nonatomic, strong) ASCheckoutPointData *pointCellM;
 @property (nonatomic, strong) ASCheckoutAddressData *addressCellM;
+@property (nonatomic, strong) ASCheckoutShipMethodData *shipmethodCellM;
 @property (nonatomic, strong) ASCheckoutCommentData *commentCellM;
 
 //存放支付方式
@@ -96,6 +97,20 @@
             if(num ==0){ //使用积分
                 self.commentCellM.commentStr = commentData.commentStr;
             }
+        } else if ([data isKindOfClass:[ASCheckoutShipMethodData class]]) {
+            //选择运输方式、、、、并设置
+            ASCheckoutShipMethodData *shipMethodData = (ASCheckoutShipMethodData *)data;
+            self.shipmethodCellM = shipMethodData;
+            for (int i = 0; i < self.shipmethodCellM.shipMethodArray.count; i++) {
+                ASCheckoutShipMethodModel *shipModel = [self.shipmethodCellM.shipMethodArray objectAtIndex:i];
+                if (i == num) {
+                    shipModel.isSelect = YES;
+                    self.shipmethodCellM.shipMethodModel = shipModel;
+                } else {
+                    shipModel.isSelect = NO;
+                }
+            }
+            [self requestSetShipMethodByAddress];
         }
     };
     
@@ -136,14 +151,16 @@
                 NSDictionary *shippingDic = [shipping_assignments objectForKey:@"shipping"];
                 NSDictionary *addressDic = [shippingDic objectForKey:@"address"];
 //                ASAddressModel *addressModel = [ASAddressModel defualtData];
+                ASAddressReginModel *reginModel = [ASAddressReginModel mj_objectWithKeyValues:addressDic];
                 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"];
+                addressModel.region = reginModel;
+                if (!NIL(addressModel.postcode)) {
+                    self.addressCellM.addressModel = addressModel;
+                    
+                    if (self.shipmethodCellM.shipMethodModel) {
+                        //默认设置第一个运输方式
+                        [self requestSetShipMethodByAddress];
+                    }
                 }
             }
             //首次进入展示购物车数据UI
@@ -155,10 +172,18 @@
         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.shipmethodCellM.shipMethodArray = [ASCheckoutShipMethodModel mj_objectArrayWithKeyValuesArray:shipMethodArr];
+                ASCheckoutShipMethodModel *firstModel = self.shipmethodCellM.shipMethodArray[0];
+                firstModel.isSelect = YES;
+                
+                self.shipmethodCellM.shipMethodModel = firstModel;
+                self.shipmethodCellM.shipmethodSymbol = self.totalsM.currency_symbol;
+                
+                //默认设置第一个运输方式
+                [self requestSetShipMethodByAddress];
+                
+                
             }
             [self reqNet_Cart_cartsMineTotals];
         }
@@ -167,11 +192,20 @@
         
         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.shipmethodCellM.shipMethodArray = [ASCheckoutShipMethodModel mj_objectArrayWithKeyValuesArray:shipMethodArr];
+                ASCheckoutShipMethodModel *firstModel = self.shipmethodCellM.shipMethodArray[0];
+                firstModel.isSelect = YES;
+                self.shipmethodCellM.shipMethodModel = firstModel;
+                
+                self.shipmethodCellM.shipmethodSymbol = self.totalsM.currency_symbol;
+                
+                if (self.addressCellM.addressModel) {
+                    //默认设置第一个运输方式
+                    [self requestSetShipMethodByAddress];
+                }
             }
         }
         [self updateData];
@@ -180,7 +214,8 @@
               || [mark isEqualToString:DEL_cartsMineItems]
               || [mark isEqualToString:PUT_cartsMineCoupons]
               || [mark isEqualToString:Chectout_PUT_usePoints]
-              || [mark isEqualToString:Chectout_DEL_cancelusePoints]){
+              || [mark isEqualToString:Chectout_DEL_cancelusePoints]
+              || [mark isEqualToString:Chectout_setShipMethod]){
         if(sucessOrFail){
             [self reqNet_Cart_cartsMineTotals];
         }else{
@@ -197,7 +232,12 @@
     self.TableV.infodata = [NSMutableArray arrayWithArray:self.totalsM.items];
     
     //邮寄地址--邮寄方式
-    [self.TableV.infodata addObject:self.addressCellM];
+    if (self.addressCellM.addressModel) {
+        [self.TableV.infodata addObject:self.addressCellM];
+    }
+    
+    //运输方式
+    [self.TableV.infodata addObject:self.shipmethodCellM];
     
     //优惠券
     self.couponCellM.couponAry =[NSMutableArray arrayWithArray: [ASNetTools shared].xxx_couponAry];
@@ -267,14 +307,15 @@
         
         [self.TableV reloadData];
     } else if ([model isKindOfClass:[ASCheckoutAddressData class]]) {
+        
         ASAddressListViewController *vc = [ASAddressListViewController new];
         vc.isSelMode = true;
-        vc.sel_Id = self.addressCellM.addressId;
+        vc.sel_Id = self.addressCellM.addressModel.Id;
         @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.addressCellM.addressModel = addressM;
             
             [self requestAddShipAddress];
         };
@@ -290,12 +331,30 @@
 //添加邮寄地址
 - (void)requestAddShipAddress {
     [MBProgressHUD showHUDAddedTo:self.view animated:YES];
-    [self.VM ry_requestPostApi:Chectout_addShipAddress_id param:@{@"addressId":self.addressCellM.addressId}];
+    [self.VM ry_requestPostApi:Chectout_addShipAddress_id param:@{@"addressId":self.addressCellM.addressModel.Id}];
 }
 //根据邮寄地址获取邮寄方式
 - (void)requestGetShipMethodByAddress {
+    [MBProgressHUD showHUDAddedTo:self.view animated:YES];
     [self.VM ry_requestGetApi:Chectout_getShipMethod param:@{}];
 }
+//设置邮寄方式
+- (void)requestSetShipMethodByAddress {
+    
+    NSDictionary *addressDic1 = (NSDictionary *)[self.addressCellM.addressModel.region mj_JSONObject];
+    NSDictionary *addressDic = (NSDictionary *)[self.addressCellM.addressModel mj_JSONObject];
+    NSMutableDictionary *param = [NSMutableDictionary dictionaryWithDictionary:addressDic];
+    [param addEntriesFromDictionary:addressDic1];
+    
+    [param removeObjectForKey:@"extension_attributes"];//移除格式不正确的无用参数
+    
+    NSDictionary *params = @{@"shipping_address":param,
+                             @"shipping_method_code":self.shipmethodCellM.shipMethodModel.method_code,
+                             @"shipping_carrier_code":self.shipmethodCellM.shipMethodModel.carrier_code};
+    
+    [MBProgressHUD showHUDAddedTo:self.view animated:YES];
+    [self.VM ry_requestPostApi:Chectout_setShipMethod param:@{@"addressInformation":params}];
+}
 //获取购物车信息(地址信息)
 - (void)requestCartInfo {
     [MBProgressHUD showHUDAddedTo:self.view animated:YES];
@@ -343,6 +402,21 @@
     [MBProgressHUD showHUDAddedTo:self.view animated:YES];
     [self.VM ry_requestDeleteApi:Chectout_DEL_cancelusePoints paramStr:@""];
 }
+//下单
+-(void)requestSureOrder{
+    [MBProgressHUD showHUDAddedTo:self.view animated:YES];
+    NSDictionary *param = @{@"method":self.paymentModel.code};
+    
+    [ASNetTools.shared putWithPath:Chectout_PUT_sureOrder param:@{@"paymentMethod":param} success:^(id _Nonnull json) {
+        [MBProgressHUD hideHUDForView:self.view animated:YES];
+        NSLog(@"=======%@", json);
+        
+    } faild:^(NSString * _Nonnull code, NSString * _Nonnull msg) {
+        [MBProgressHUD hideHUDForView:self.view animated:YES];
+        NSLog(@"=======%@=====%@", code, msg);
+    }];
+    
+}
 
 #pragma mark --- 懒加载 ---
 - (void)ucm_bindvmmodel{
@@ -372,10 +446,16 @@
 - (ASCheckoutAddressData *)addressCellM {
     if (!_addressCellM) {
         _addressCellM = [[ASCheckoutAddressData alloc] init];
-        _addressCellM.addressInfoStr = @"";
     }
     return _addressCellM;
 }
+- (ASCheckoutShipMethodData *)shipmethodCellM {
+    if (!_shipmethodCellM) {
+        _shipmethodCellM = [[ASCheckoutShipMethodData alloc] init];
+    }
+    return _shipmethodCellM;
+}
+
 - (ASCheckoutCommentData *)commentCellM {
     if (!_commentCellM) {
         _commentCellM = [[ASCheckoutCommentData alloc] init];
@@ -404,7 +484,8 @@
         @weakify(self)
         _bottomView.bottomBlock = ^{
             @strongify(self)
-            [self.view makeToast:@"调起支付"];
+//            [self.view makeToast:@"调起支付"];
+            [self requestSureOrder];
         };
     }
     return _bottomView;

+ 1 - 7
Asteria/Fuction/Cart/Checkout/ASCheckoutAddressCell.h

@@ -12,13 +12,7 @@ NS_ASSUME_NONNULL_BEGIN
 @interface ASCheckoutAddressData : NSObject
 
 //地址
-@property (nonatomic, copy) NSString *addressId;
-@property (nonatomic, copy) NSString *addressInfoStr;
-//邮寄方式
-@property (nonatomic, strong) NSArray *shipMethodArray;
-@property (nonatomic, copy) NSString *shipmethodStr;
-@property (nonatomic, copy) NSString *shipmethodPrice;
-@property (nonatomic, copy) NSString *shipmethodSymbol;
+@property (nonatomic, strong) ASAddressModel *addressModel;
 
 @end
 

+ 14 - 51
Asteria/Fuction/Cart/Checkout/ASCheckoutAddressCell.m

@@ -14,8 +14,6 @@
 @interface ASCheckoutAddressCell()
 
 @property (nonatomic, strong) UILabel *addressLab;
-@property (nonatomic, strong) UILabel *shipMethodLab;
-@property (nonatomic, strong) UILabel *shipPriceLab;
 
 @end
 
@@ -43,6 +41,7 @@
     [backView mas_makeConstraints:^(MASConstraintMaker *make) {
         make.left.top.mas_equalTo(10);
         make.right.mas_equalTo(-10);
+        make.bottom.mas_equalTo(0);
     }];
     
     UIImageView *arrowRightImgV = [[UIImageView alloc] init];
@@ -71,64 +70,28 @@
         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;
-    }
+    ASAddressModel *addressModel = model.addressModel;
     
-    if (NIL(model.shipmethodStr)) {
-        _shipMethodLab.text = @"--";
+    if (addressModel) {
+        NSString *addressInfoStr = [NSString stringWithFormat:@"%@ %@ %@ %@,%@ tel:%@", addressModel.firstname, addressModel.lastname, [addressModel.street componentsJoinedByString:@" "], addressModel.city, addressModel.postcode, addressModel.telephone];
+        
+        if (NIL(addressInfoStr)) {
+            _addressLab.textColor = [UIColor getColor:@"#E60013"];
+            _addressLab.text = @"Please fill in your address";
+        } else {
+            _addressLab.textColor = _0B0B0B;
+            _addressLab.text = addressInfoStr;
+        }
     } else {
-        _shipMethodLab.text = model.shipmethodStr;
+        _addressLab.text = @"--";
     }
     
-    _shipPriceLab.text = [NSString stringWithFormat:@"%@%@", model.shipmethodSymbol, model.shipmethodPrice];
+    
 }
 
 @end

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

@@ -6,11 +6,32 @@
 //
 
 #import <WMBase/WMBase.h>
+#import "ASCheckoutModel.h"
 
 NS_ASSUME_NONNULL_BEGIN
 
+@interface ASCheckoutShipMethodData : NSObject
+
+//邮寄方式
+@property (nonatomic, strong) NSArray *shipMethodArray;
+@property (nonatomic, strong) ASCheckoutShipMethodModel *shipMethodModel;
+@property (nonatomic, copy) NSString *shipmethodSymbol;
+
+@end
+
 @interface ASCheckoutShipMethodCell : TT_BaseCell
 
+@property (nonatomic, strong) ASCheckoutShipMethodData *cellData;
+
+@end
+
+
+@interface ASShipMethodItem : UIView
+
+@property (nonatomic, strong) UIButton *selectBtn;
+
+- (void)setShipItemData:(ASCheckoutShipMethodModel *)shipModel symbol:(NSString *)symbol;
+
 @end
 
 NS_ASSUME_NONNULL_END

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

@@ -7,6 +7,20 @@
 
 #import "ASCheckoutShipMethodCell.h"
 
+
+@implementation ASCheckoutShipMethodData
+
+@end
+
+@interface ASCheckoutShipMethodCell()
+
+@property (nonatomic, strong) UIView *shipMethodView;
+
+@property (nonatomic, strong) UILabel *shipMethodLab;
+@property (nonatomic, strong) UILabel *shipPriceLab;
+
+@end
+
 @implementation ASCheckoutShipMethodCell
 
 - (void)awakeFromNib {
@@ -20,4 +34,126 @@
     // Configure the view for the selected state
 }
 
+- (void)setupSubviewS {
+    
+    self.backgroundColor = [UIColor colorWithHexString:@"#F8F8F8"];
+    
+    _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.mas_equalTo(10);
+        make.right.mas_equalTo(-10);
+        make.height.mas_equalTo(50);
+        make.bottom.mas_equalTo(0);
+    }];
+}
+
+- (void)configData:(id)Data{
+    ASCheckoutShipMethodData *model = (ASCheckoutShipMethodData *)Data;
+    
+    self.cellData = model;
+    
+    float floatY = 0;
+    
+    for (int i = 0; i < model.shipMethodArray.count; i++) {
+        ASCheckoutShipMethodModel *shipModel = model.shipMethodArray[i];
+        
+        ASShipMethodItem *shipItem = [[ASShipMethodItem alloc] initWithFrame:CGRectMake(0, floatY, KScreenWidth - 20, 53)];
+        [_shipMethodView addSubview:shipItem];
+        
+        [shipItem setShipItemData:shipModel symbol:model.shipmethodSymbol];
+        shipItem.selectBtn.tag = i;
+        [shipItem.selectBtn addTarget:self action:@selector(_selectShipMethod:) forControlEvents:UIControlEventTouchUpInside];
+        
+        
+        floatY = floatY + 53;
+        
+    }
+    
+    [_shipMethodView mas_updateConstraints:^(MASConstraintMaker *make) {
+        make.height.mas_equalTo(floatY);
+    }];
+    
+}
+
+- (void)_selectShipMethod:(UIButton *)button {
+    
+    if (button.selected) {
+        return;
+    }
+    
+    button.selected = !button.selected;
+    
+    
+    if (self.currencyparameterClose) {
+        self.currencyparameterClose(button.tag, self.cellData);
+    }
+}
+
+
+@end
+
+
+
+
+@interface ASShipMethodItem()
+
+@property (nonatomic, strong) UILabel *shipMethodLab;
+@property (nonatomic, strong) UILabel *shipPriceLab;
+
+
+@end
+
+@implementation ASShipMethodItem
+
+- (instancetype)initWithFrame:(CGRect)frame {
+    if (self = [super initWithFrame:frame]) {
+        
+        _selectBtn = [UIButton buttonWithType:UIButtonTypeCustom];
+        [_selectBtn setImage:[UIImage imageNamed:@"base_radio_unselect"] forState:UIControlStateNormal];
+        [_selectBtn setImage:[UIImage imageNamed:@"base_radio_select"] forState:UIControlStateSelected];
+        
+        [self addSubview:_selectBtn];
+        [_selectBtn mas_makeConstraints:^(MASConstraintMaker *make) {
+            make.right.mas_equalTo(-10);
+            make.width.height.mas_equalTo(26);
+            make.centerY.equalTo(self);
+        }];
+        
+        _shipPriceLab = [UILabel labelCreateWithText:@"" font:[UIFont fontWithName:Rob_Bold size:14] textColor:_0B0B0B];
+        _shipPriceLab.textAlignment = NSTextAlignmentRight;
+        _shipPriceLab.adjustsFontSizeToFitWidth = YES;
+        [self addSubview:_shipPriceLab];
+        [_shipPriceLab mas_makeConstraints:^(MASConstraintMaker *make) {
+            make.right.mas_equalTo(_selectBtn.mas_left).offset(-8);
+            make.centerY.mas_equalTo(self);
+        }];
+        
+        _shipMethodLab = [UILabel labelCreateWithText:@"" font:[UIFont fontWithName:Rob_Bold size:14] textColor:_0B0B0B];
+        [self addSubview:_shipMethodLab];
+        [_shipMethodLab mas_makeConstraints:^(MASConstraintMaker *make) {
+            make.left.mas_equalTo(10);
+            make.right.mas_equalTo(_shipPriceLab.mas_left).offset(-8);
+            make.centerY.mas_equalTo(self);
+            make.height.mas_equalTo(18);
+            make.bottom.mas_equalTo(-20);
+        }];
+        
+       
+    }
+    return self;
+}
+
+
+- (void)setShipItemData:(ASCheckoutShipMethodModel *)shipModel symbol:(NSString *)symbol {
+    
+    _shipMethodLab.text = [NSString stringWithFormat:@"%@ %@", shipModel.method_title, shipModel.carrier_title];
+    _shipPriceLab.text = [NSString stringWithFormat:@"%@%@", symbol, shipModel.amount];
+    
+    _selectBtn.selected = shipModel.isSelect;
+}
+
 @end

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

@@ -18,6 +18,7 @@
 
 #import "ASCheckoutPointApplyCell.h"
 #import "ASCheckoutAddressCell.h"
+#import "ASCheckoutShipMethodCell.h"
 #import "ASCheckoutPaymentCell.h"
 #import "ASCheckoutCommentCell.h"
 

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

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

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

@@ -28,6 +28,8 @@ NS_ASSUME_NONNULL_BEGIN
 @property (nonatomic, copy) NSString *method_title;
 @property (nonatomic, copy) NSString *carrier_title;
 @property (nonatomic, copy) NSString *amount;
+@property (nonatomic, copy) NSString *carrier_code;
+@property (nonatomic, copy) NSString *method_code;
 @property (nonatomic, assign) BOOL isSelect;
 
 @end

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

@@ -30,10 +30,14 @@
 #define Chectout_addShipAddress_id   BaseRequestrUrl(@"carts/mine/estimate-shipping-methods-by-address-id")
 //根据邮寄地址获取邮寄方式
 #define Chectout_getShipMethod       BaseRequestrUrl(@"carts/mine/shipping-methods")
+//根据邮寄地址设置邮寄方式
+#define Chectout_setShipMethod       BaseRequestrUrl(@"carts/mine/shipping-information")
 //使用指定积分
 #define Chectout_PUT_usePoints       BaseRequestrUrl(@"mw-rewardpoints/mine/points")
 ////取消使用积分
 #define Chectout_DEL_cancelusePoints BaseRequestrUrl(@"mw-rewardpoints/mine/points")
+//下单
+#define Chectout_PUT_sureOrder       BaseRequestrUrl(@"carts/mine/order")
 
 NS_ASSUME_NONNULL_BEGIN
 

+ 1 - 0
Asteria/Fuction/UserManager/info/ASUserModel.h

@@ -41,6 +41,7 @@ NS_ASSUME_NONNULL_BEGIN
 @property (nonatomic, copy) NSString *lastname;
 @property (nonatomic, copy) NSString *default_shipping;
 @property (nonatomic, copy) NSString *default_billing;
+@property (nonatomic, copy) NSString *email;
 
 + (ASAddressModel *)defualtData;