浏览代码

列表加车、立即购买逻辑

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

+ 8 - 7
Asteria/Fuction/Cart/Cart_MyCartC.m

@@ -41,6 +41,8 @@
 //空页面
 @property (nonatomic, strong) ASMyCartNoDataView *noDataView;
 
+@property (nonatomic, strong) UITabBarItem *cartTabbarItem;
+
 @end
 
 @implementation Cart_MyCartC
@@ -48,11 +50,15 @@
 - (void)viewDidLoad {
     [super viewDidLoad];
     self.title = @"My Cart";
+    
+    self.cartTabbarItem  = self.tabBarController.tabBar.items[2];
+    
     [self ucm_subVeiwsTapBlock];
 }
 -(void)viewWillAppear:(BOOL)animated{
     [super viewWillAppear:animated];
     [self reqNet_Cart_cartsMineTotals];
+    
 }
 - (void)initSubviews {
     [super initSubviews];
@@ -193,7 +199,6 @@
 //请求赠品商品详情
 -(void)reqNet_GoodsDetails_productGetProduct:(NSString *)enterId{
     NSMutableDictionary * params = [[NSMutableDictionary alloc] init];
-//    [params setObject:@"55475" forKey:@"productId"];
     [params setObject:enterId forKey:@"productId"];
     [params setObject:ASCurrencyManager.shared.currentCur forKey:@"currencyCode"];
 //    [MBProgressHUD showHUDAddedTo:self.view animated:YES];
@@ -209,8 +214,6 @@
         self.index ++;
         [self.VM ry_formDataRequestPostApi:Chectout_giftAddCart param:param];
     }
-    
-    
 }
 
 - (void)ry_respnsData:(id)data 
@@ -222,13 +225,11 @@
     if([mark isEqualToString:Cart_cartsMineTotals]){
         if(sucessOrFail){
             
-            
-            
-            
-            
             CartTotalsM *model = [arry firstObject];
             self.totalsM = model;
             
+            self.cartTabbarItem.qmui_badgeInteger = [model.items_qty integerValue];
+            
             if (AS_Array_valid(self.totalsM.items)) {
                 //空页面
                 self.noDataView.hidden = YES;

+ 1 - 1
Asteria/Fuction/Goods/GoodsSize/Cell/GoosSizeSelectCell.m

@@ -52,7 +52,7 @@
 - (void)configData:(id)Data{
     OptionsModel *optionM = (OptionsModel *)Data;
     self.optionModel = optionM;
-    self.option_nameLab.text = [NSString stringWithFormat:@"%@",optionM.product_sku];
+    self.option_nameLab.text = [NSString stringWithFormat:@"%@",optionM.title];
     while (self.floatLayoutView.subviews.count) {
         [self.floatLayoutView.subviews.lastObject removeFromSuperview];
     }

+ 9 - 1
Asteria/Fuction/Goods/VC/AS_GoodsSizeC.m

@@ -10,6 +10,8 @@
 #import "GoodsDetailsBottomV.h"
 #import "ASGoodsDetailsVM.h"
 
+#import "Cart_CheckoutC.h"
+
 @interface AS_GoodsSizeC ()<RY_baseVMprotocol>
 @property (nonatomic, strong) UIImageView *sel_headImg;
 @property (nonatomic, strong) QMUILabel *sel_titleLab;
@@ -203,7 +205,13 @@
                     
                 }];
             }else{
-                [self handle_closeVC];
+//                [self handle_closeVC];
+                K_WEAK_SELF;
+                [self dismissViewControllerAnimated:YES completion:^{
+                    K_STRONG_SELF;
+                    Cart_CheckoutC *vc = [[Cart_CheckoutC alloc] init];
+                    [[Current_normalTool topViewController].navigationController pushViewController:vc animated:YES];
+                }];
             }
         }];
     }else{