Browse Source

feat:订单详情赠品、商品详情推荐商品UI

“wangdongchao” 1 year ago
parent
commit
1c25744b46

+ 3 - 1
Asteria/Fuction/Cart/PayManager/ASCheckoutPayManager.m

@@ -79,9 +79,11 @@ static ASCheckoutPayManager *_instance = nil;
             } else if (statusInt == 1) {
                 //二次验证
                 [self stripePayCreateOrderid:orderid];
+            } else if (statusInt == 2) {
+//                [topVC.view makeToast:@"您已取消支付"];
             } else {
                 if (self.payFinishBlock) {
-                    self.payFinishBlock(self.payType, 0, @{@"msg":@"取消支付/支付失败"});
+                    self.payFinishBlock(self.payType, 0, @{@"msg":@"支付失败"});
                 }
             }
         };

+ 1 - 1
Asteria/Fuction/Cart/PayManager/ToolStripePayment.swift

@@ -100,7 +100,7 @@ public class ToolStripePayment: NSObject {
                   print(error)
 //                  completion!(2,error)
                   if self.payFinishBlock != nil {
-                      self.payFinishBlock!("2", "failed")
+                      self.payFinishBlock!("3", "failed")
                   }
               }
             }

+ 21 - 1
Asteria/Fuction/Goods/V/ASGoodsDetailsTableView.m

@@ -17,6 +17,9 @@
 #import "ASGoodsReviewHeadCell.h"
 #import "GoodsReviewsCell.h"
 #import "ASGoodsReviewFootCell.h"
+#import "KWMineMoreProductsCell.h"
+
+#import "KWMineMoreProductModel.h"
 
 @interface ASGoodsDetailsTableView()
 
@@ -130,6 +133,23 @@
             [self generaltriggermethodType:type data:Data];
         };
         return cell;
+    } else if ([typeStr isEqualToString:@"customer"]) {
+        KWMineMoreProductModel *model =  (KWMineMoreProductModel *)objectM;
+//        KWMineMoreProductsCell *cell = [tableView dequeueReusableCellWithIdentifier:@"KWMineMoreProductsCell" forIndexPath:indexPath];
+        KWMineMoreProductsCell *cell = [[KWMineMoreProductsCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:@"KWMineMoreProductsCell"];
+        
+        cell.topSpace = 20;
+//        KWMineMoreProductModel * model = [KWMineMoreProductModel demoData];
+        [cell setData: model];
+        @weakify(self);
+        [cell setProductClick:^(NSInteger i, ASProductBaseModel *m) {
+    //        if (![weak_self checkLogin:true]) {
+    //            return;
+    //        }
+           // 点击推荐商品
+    //        [weak_self goto_WKM_GoodsDetailsC:m.Id];
+        }];
+        return cell;
     }
     
     
@@ -151,7 +171,7 @@
         objectM = dataM;
     }
     
-    if (([typeStr isEqualToString:@"reviewHead"] || [objectM isKindOfClass:[GoodsReviewsListM class]] || [typeStr isEqualToString:@"reviewFoot"]) && !self.isReview) {
+    if (([typeStr isEqualToString:@"reviewHead"] || [objectM isKindOfClass:[GoodsReviewsListM class]] || [typeStr isEqualToString:@"reviewFoot"] || [typeStr isEqualToString:@"customer"]) && !self.isReview) {
         return 0;
     }
     

+ 0 - 7
Asteria/Fuction/Goods/V/ASGoodsGuaranteeInfoCell.m

@@ -75,13 +75,6 @@
             self.rightBtn = radBtn;
         }
     }
-//    RadioButton *firstBtn = self.radioBtnAry[0];
-//    [firstBtn setGroupButtons:self.radioBtnAry];
-//    [self.radioBtnAry[0] setSelected:YES];
-//    [self xxx_onRadioButtonValueChanged:self.radioBtnAry[0]];
-    
-    
-//    self.datails_payV.titleLab.text = [NSString stringWithFormat:@"Pay in 4 interest-free payments of %@%.2f with",model.currency_symbol,[model.final_prices floatValue]/4];
 
 }
 

+ 5 - 1
Asteria/Fuction/Goods/VC/ASGoodsDetailsViewController.m

@@ -18,6 +18,7 @@
 
 #import "GoodsInformationM.h"
 #import "GoodsReviewsListM.h"
+#import "KWMineMoreProductModel.h"
 
 
 
@@ -195,7 +196,10 @@
     //评论底部
     NSDictionary *reviewFoot = @{@"type":@"reviewFoot", @"data":self.model};
     [self.TableV.infodata addObject:reviewFoot];
-    
+    //推荐商品
+    KWMineMoreProductModel *model = [KWMineMoreProductModel demoData];
+    NSDictionary *customer = @{@"type":@"customer", @"data":model};
+    [self.TableV.infodata addObject:customer];
     
 //    if (self.isReview) {
 //        

+ 7 - 2
Asteria/Fuction/UserCenter/Orders/Controller/ASOrderDetailsViewController.m

@@ -32,7 +32,12 @@
 - (void)viewDidLoad {
     [super viewDidLoad];
     
-    self.titleStr = @"Orders inf";
+    if (self.isPay) {
+        self.titleStr = @"Orders Information";
+    } else {
+        self.titleStr = @"Payment";
+    }
+    
     self.statusBgV.backgroundColor = Col_FFF;
     self.customNavBar.backgroundColor = Col_FFF;
     
@@ -113,7 +118,7 @@
     if (self.isPay) {
         ASPayFinishHeadView *payFailedView = [[ASPayFinishHeadView alloc] initWithFrame:CGRectMake(0, 0, KScreenWidth, 100) status:1 desc:self.orderId];
         
-        K_WEAK_SELF;
+//        K_WEAK_SELF;
         payFailedView.clickBlock = ^(int type) {
     //        K_STRONG_SELF;
         };

+ 26 - 0
Asteria/Fuction/UserCenter/Orders/View/ASOrderDetailsItemsCell.m

@@ -16,6 +16,7 @@
 @property (nonatomic, strong) UILabel *priceLab;
 @property (nonatomic, strong) UILabel *optLab;
 
+@property (nonatomic, strong) UILabel *giftLab;
 
 @end
 
@@ -86,6 +87,17 @@
             make.right.mas_equalTo(-10);
             make.left.mas_equalTo(10);
         }];
+        
+        _giftLab = [UILabel labelCreateWithText:@"Gift" font:[UIFont fontWithName:Rob_Regular size:12] textColor:Col_000];
+        _giftLab.textAlignment = NSTextAlignmentCenter;
+        _giftLab.backgroundColor = _F0FFF9;
+        [backView addSubview:_giftLab];
+        [_giftLab mas_makeConstraints:^(MASConstraintMaker *make) {
+            make.left.equalTo(self.nameLab);
+            make.bottom.equalTo(self.goodsImage);
+            make.width.equalTo(@64);
+            make.height.equalTo(@23);
+        }];
     }
     return self;
 }
@@ -96,6 +108,20 @@
     NSString *imageAllStr = [NSString stringWithFormat:@"https:%@%@%@",HostPath,ProductImgPath,AS_String_NotNull(_itemModel.image)];
     [self.goodsImage sd_setImageWithURL:[NSURL URLWithString:imageAllStr] placeholderImage:UIImageDefaultImg_SD];
     
+    NSString *nameStr = AS_String_NotNull(_itemModel.name);
+    
+    if([nameStr hasPrefix:@"FREE"]){
+        _giftLab.hidden = NO;
+        _countLab.hidden = YES;
+        _realPriceLab.hidden = YES;
+        _priceLab.hidden = YES;
+    }else{
+        _giftLab.hidden = YES;
+        _countLab.hidden = NO;
+        _realPriceLab.hidden = NO;
+        _priceLab.hidden = NO;
+    }
+    
     _nameLab.text = AS_String_NotNull(_itemModel.name);
     _countLab.text = [NSString stringWithFormat:@"X%@", AS_String_NotNull(_itemModel.qty_ordered)];
     _realPriceLab.text = [NSString stringWithFormat:@"%@%@", AS_String_NotNull(_itemModel.currency_symbol), AS_String_NotNull(_itemModel.price)];

+ 2 - 2
Asteria/Fuction/UserCenter/Orders/View/ASPayFinishHeadView.m

@@ -171,11 +171,11 @@
         } else {
             _iconImage.image = [UIImage imageNamed:@"pay_success_icon"];
             _payStatusLab.text = @"Your Order Has Been Received";
-            _orderNumLab.text = @"Order #123";
+            _orderNumLab.text = [NSString stringWithFormat:@"Order #%@", desc];
             _descLab.text = @"Please try another card or refresh browser. Paypal gateway has rejected request. The buyer cannot pay with PayPal for this transaction(#13113: buyer cannot pay).";
             [_topBtn setTitle:@"Continue Shopping" forState:UIControlStateNormal];
         }
-        
+            
         [self layoutIfNeeded];
         [_bottomBackView layoutIfNeeded];