Преглед изворни кода

feat:支付成功、失败页面

“wangdongchao” пре 1 година
родитељ
комит
aed0ba382d
17 измењених фајлова са 432 додато и 23 уклоњено
  1. 12 12
      Asteria.xcodeproj/project.pbxproj
  2. 22 0
      Asteria/Fuction/Cart/Cart.xcassets/Checkout/pay_failed_icon.imageset/Contents.json
  3. BIN
      Asteria/Fuction/Cart/Cart.xcassets/Checkout/pay_failed_icon.imageset/pay_failed_icon@2x.png
  4. BIN
      Asteria/Fuction/Cart/Cart.xcassets/Checkout/pay_failed_icon.imageset/pay_failed_icon@3x.png
  5. 22 0
      Asteria/Fuction/Cart/Cart.xcassets/Checkout/pay_success_icon.imageset/Contents.json
  6. BIN
      Asteria/Fuction/Cart/Cart.xcassets/Checkout/pay_success_icon.imageset/pay_success_icon@2x.png
  7. BIN
      Asteria/Fuction/Cart/Cart.xcassets/Checkout/pay_success_icon.imageset/pay_success_icon@3x.png
  8. 20 2
      Asteria/Fuction/Cart/Cart_CheckoutC.m
  9. 1 0
      Asteria/Fuction/UserCenter/Orders/Controller/ASOrderDetailsViewController.h
  10. 19 0
      Asteria/Fuction/UserCenter/Orders/Controller/ASOrderDetailsViewController.m
  11. 18 0
      Asteria/Fuction/UserCenter/Orders/Controller/ASPayFailedViewController.h
  12. 47 0
      Asteria/Fuction/UserCenter/Orders/Controller/ASPayFailedViewController.m
  13. 5 2
      Asteria/Fuction/UserCenter/Orders/Model/ASOrderDetailsModel.h
  14. 6 1
      Asteria/Fuction/UserCenter/Orders/Model/ASOrderDetailsModel.m
  15. 24 6
      Asteria/Fuction/UserCenter/Orders/View/ASOrderDetailsPriceCell.m
  16. 25 0
      Asteria/Fuction/UserCenter/Orders/View/ASPayFinishHeadView.h
  17. 211 0
      Asteria/Fuction/UserCenter/Orders/View/ASPayFinishHeadView.m

+ 12 - 12
Asteria.xcodeproj/project.pbxproj

@@ -124,10 +124,6 @@
 		8186564A2A5BE9790049D861 /* ASSearchViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 818656492A5BE9790049D861 /* ASSearchViewController.m */; };
 		8186564D2A5BF6010049D861 /* ASCategoryViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 8186564C2A5BF6010049D861 /* ASCategoryViewController.m */; };
 		81932E2B29F7539B007C37AF /* UIColor+AS.m in Sources */ = {isa = PBXBuildFile; fileRef = 81932E2A29F7539B007C37AF /* UIColor+AS.m */; };
-		819349192BF1EB59009FDDB2 /* ASOrderListViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 819349182BF1EB59009FDDB2 /* ASOrderListViewController.m */; };
-		8193491C2BF1EB6F009FDDB2 /* ASOrderListSubController.m in Sources */ = {isa = PBXBuildFile; fileRef = 8193491B2BF1EB6F009FDDB2 /* ASOrderListSubController.m */; };
-		819349212BF218B6009FDDB2 /* ASOrderListViewModel.m in Sources */ = {isa = PBXBuildFile; fileRef = 819349202BF218B6009FDDB2 /* ASOrderListViewModel.m */; };
-		819349262BF34722009FDDB2 /* ASOrderListCell.m in Sources */ = {isa = PBXBuildFile; fileRef = 819349252BF34722009FDDB2 /* ASOrderListCell.m */; };
 		819349302BF59000009FDDB2 /* ASHomeViewModel.m in Sources */ = {isa = PBXBuildFile; fileRef = 8193492F2BF59000009FDDB2 /* ASHomeViewModel.m */; };
 		819349352BF5A679009FDDB2 /* ASJumpModel.m in Sources */ = {isa = PBXBuildFile; fileRef = 819349342BF5A679009FDDB2 /* ASJumpModel.m */; };
 		8193D5C82BEA299F00B9AB11 /* ASAddressListViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 8193D5C72BEA299F00B9AB11 /* ASAddressListViewController.m */; };
@@ -214,6 +210,8 @@
 		8810F5652BF5EBF400346FD4 /* ASOrderDetailsViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 8810F5582BF5EBF400346FD4 /* ASOrderDetailsViewController.m */; };
 		8810F5662BF5EBF400346FD4 /* ASOrderListSubController.m in Sources */ = {isa = PBXBuildFile; fileRef = 8810F55A2BF5EBF400346FD4 /* ASOrderListSubController.m */; };
 		8810F5672BF5EBF400346FD4 /* ASOrderListViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 8810F55C2BF5EBF400346FD4 /* ASOrderListViewController.m */; };
+		8810F56A2BF5F86D00346FD4 /* ASPayFailedViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 8810F5692BF5F86D00346FD4 /* ASPayFailedViewController.m */; };
+		8810F56D2BF5F8D800346FD4 /* ASPayFinishHeadView.m in Sources */ = {isa = PBXBuildFile; fileRef = 8810F56C2BF5F8D800346FD4 /* ASPayFinishHeadView.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 */; };
@@ -583,14 +581,6 @@
 		8186564C2A5BF6010049D861 /* ASCategoryViewController.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = ASCategoryViewController.m; sourceTree = "<group>"; };
 		81932E2929F7539B007C37AF /* UIColor+AS.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "UIColor+AS.h"; sourceTree = "<group>"; };
 		81932E2A29F7539B007C37AF /* UIColor+AS.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = "UIColor+AS.m"; sourceTree = "<group>"; };
-		819349172BF1EB59009FDDB2 /* ASOrderListViewController.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = ASOrderListViewController.h; sourceTree = "<group>"; };
-		819349182BF1EB59009FDDB2 /* ASOrderListViewController.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = ASOrderListViewController.m; sourceTree = "<group>"; };
-		8193491A2BF1EB6F009FDDB2 /* ASOrderListSubController.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = ASOrderListSubController.h; sourceTree = "<group>"; };
-		8193491B2BF1EB6F009FDDB2 /* ASOrderListSubController.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = ASOrderListSubController.m; sourceTree = "<group>"; };
-		8193491F2BF218B6009FDDB2 /* ASOrderListViewModel.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = ASOrderListViewModel.h; sourceTree = "<group>"; };
-		819349202BF218B6009FDDB2 /* ASOrderListViewModel.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = ASOrderListViewModel.m; sourceTree = "<group>"; };
-		819349242BF34722009FDDB2 /* ASOrderListCell.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = ASOrderListCell.h; sourceTree = "<group>"; };
-		819349252BF34722009FDDB2 /* ASOrderListCell.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = ASOrderListCell.m; sourceTree = "<group>"; };
 		8193492E2BF58FFF009FDDB2 /* ASHomeViewModel.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = ASHomeViewModel.h; sourceTree = "<group>"; };
 		8193492F2BF59000009FDDB2 /* ASHomeViewModel.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = ASHomeViewModel.m; sourceTree = "<group>"; };
 		819349332BF5A679009FDDB2 /* ASJumpModel.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = ASJumpModel.h; sourceTree = "<group>"; };
@@ -763,6 +753,10 @@
 		8810F55A2BF5EBF400346FD4 /* ASOrderListSubController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ASOrderListSubController.m; sourceTree = "<group>"; };
 		8810F55B2BF5EBF400346FD4 /* ASOrderListViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ASOrderListViewController.h; sourceTree = "<group>"; };
 		8810F55C2BF5EBF400346FD4 /* ASOrderListViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ASOrderListViewController.m; sourceTree = "<group>"; };
+		8810F5682BF5F86D00346FD4 /* ASPayFailedViewController.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = ASPayFailedViewController.h; sourceTree = "<group>"; };
+		8810F5692BF5F86D00346FD4 /* ASPayFailedViewController.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = ASPayFailedViewController.m; sourceTree = "<group>"; };
+		8810F56B2BF5F8D800346FD4 /* ASPayFinishHeadView.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = ASPayFinishHeadView.h; sourceTree = "<group>"; };
+		8810F56C2BF5F8D800346FD4 /* ASPayFinishHeadView.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = ASPayFinishHeadView.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>"; };
@@ -1905,6 +1899,8 @@
 				8810F5492BF5EBF400346FD4 /* ASOrderDetailsItemsCell.m */,
 				8810F54A2BF5EBF400346FD4 /* ASOrderDetailsPriceCell.h */,
 				8810F54B2BF5EBF400346FD4 /* ASOrderDetailsPriceCell.m */,
+				8810F56B2BF5F8D800346FD4 /* ASPayFinishHeadView.h */,
+				8810F56C2BF5F8D800346FD4 /* ASPayFinishHeadView.m */,
 			);
 			path = View;
 			sourceTree = "<group>";
@@ -1938,6 +1934,8 @@
 				8810F55C2BF5EBF400346FD4 /* ASOrderListViewController.m */,
 				8810F5572BF5EBF400346FD4 /* ASOrderDetailsViewController.h */,
 				8810F5582BF5EBF400346FD4 /* ASOrderDetailsViewController.m */,
+				8810F5682BF5F86D00346FD4 /* ASPayFailedViewController.h */,
+				8810F5692BF5F86D00346FD4 /* ASPayFailedViewController.m */,
 			);
 			path = Controller;
 			sourceTree = "<group>";
@@ -2918,6 +2916,7 @@
 				9AD346002A08D60F005CA070 /* ZFPresentTransition.m in Sources */,
 				81717D112A3C4AE000648139 /* KWSearchViewModel.m in Sources */,
 				9A337E3B2A04EE1A00D058A5 /* BViewController.m in Sources */,
+				8810F56A2BF5F86D00346FD4 /* ASPayFailedViewController.m in Sources */,
 				8810F52C2BF1A1CD00346FD4 /* ASAddGiftGoodsView.m in Sources */,
 				9A31EDFD2B468A55009F11EE /* RadioButton.m in Sources */,
 				9AD345A72A08D571005CA070 /* TYPageControl.m in Sources */,
@@ -2980,6 +2979,7 @@
 				81C7963F2A551FB0003083B8 /* ASInfomationSetController.m in Sources */,
 				8131A27C2B365F7700A191BE /* ASProductListCategoryModel.m in Sources */,
 				9A98E5072B5A15A500E8C5C1 /* QDSingleImagePickerPreviewViewController.m in Sources */,
+				8810F56D2BF5F8D800346FD4 /* ASPayFinishHeadView.m in Sources */,
 				9AD346062A08D60F005CA070 /* ZFReachabilityManager.m in Sources */,
 				81717CA52A3C0A5000648139 /* KWProductFilterItemCell.m in Sources */,
 				812021252B185A610026B8B5 /* ASCouponsListViewModel.m in Sources */,

+ 22 - 0
Asteria/Fuction/Cart/Cart.xcassets/Checkout/pay_failed_icon.imageset/Contents.json

@@ -0,0 +1,22 @@
+{
+  "images" : [
+    {
+      "idiom" : "universal",
+      "scale" : "1x"
+    },
+    {
+      "filename" : "pay_failed_icon@2x.png",
+      "idiom" : "universal",
+      "scale" : "2x"
+    },
+    {
+      "filename" : "pay_failed_icon@3x.png",
+      "idiom" : "universal",
+      "scale" : "3x"
+    }
+  ],
+  "info" : {
+    "author" : "xcode",
+    "version" : 1
+  }
+}

BIN
Asteria/Fuction/Cart/Cart.xcassets/Checkout/pay_failed_icon.imageset/pay_failed_icon@2x.png


BIN
Asteria/Fuction/Cart/Cart.xcassets/Checkout/pay_failed_icon.imageset/pay_failed_icon@3x.png


+ 22 - 0
Asteria/Fuction/Cart/Cart.xcassets/Checkout/pay_success_icon.imageset/Contents.json

@@ -0,0 +1,22 @@
+{
+  "images" : [
+    {
+      "idiom" : "universal",
+      "scale" : "1x"
+    },
+    {
+      "filename" : "pay_success_icon@2x.png",
+      "idiom" : "universal",
+      "scale" : "2x"
+    },
+    {
+      "filename" : "pay_success_icon@3x.png",
+      "idiom" : "universal",
+      "scale" : "3x"
+    }
+  ],
+  "info" : {
+    "author" : "xcode",
+    "version" : 1
+  }
+}

BIN
Asteria/Fuction/Cart/Cart.xcassets/Checkout/pay_success_icon.imageset/pay_success_icon@2x.png


BIN
Asteria/Fuction/Cart/Cart.xcassets/Checkout/pay_success_icon.imageset/pay_success_icon@3x.png


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

@@ -7,6 +7,8 @@
 
 #import "Cart_CheckoutC.h"
 #import "ASAddressListViewController.h"
+#import "ASPayFailedViewController.h"
+#import "ASOrderDetailsViewController.h"
 
 #import "ASCheckoutTopView.h"
 #import "ASCheckoutBottomView.h"
@@ -496,16 +498,32 @@
     
     [MBProgressHUD showHUDAddedTo:self.view animated:YES];
     NSDictionary *param = @{@"method":paymentCode};
-    
+    K_WEAK_SELF;
     [ASNetTools.shared putWithPath:Chectout_PUT_sureOrder param:@{@"paymentMethod":param} success:^(id _Nonnull json) {
+        K_STRONG_SELF;
         [MBProgressHUD hideHUDForView:self.view animated:YES];
         NSLog(@"=======%@", json);
         
+        [self paymentResultStatus:[json objectForKey:@"data"]];
+        
     } faild:^(NSString * _Nonnull code, NSString * _Nonnull msg) {
+        K_STRONG_SELF;
         [MBProgressHUD hideHUDForView:self.view animated:YES];
         NSLog(@"=======%@=====%@", code, msg);
+        [self paymentResultStatus:@""];
     }];
-    
+}
+
+- (void)paymentResultStatus:(NSString *)orderid {
+    if (AS_String_valid(orderid)) {
+        ASOrderDetailsViewController *paySuccessVC = [[ASOrderDetailsViewController alloc] init];
+        paySuccessVC.orderId = orderid;
+        paySuccessVC.isPay = YES;
+        [self.navigationController pushViewController:paySuccessVC animated:YES];
+    } else {
+        ASPayFailedViewController *payFailedVC = [[ASPayFailedViewController alloc] init];
+        [self.navigationController pushViewController:payFailedVC animated:YES];
+    }
 }
 
 //请求赠品商品详情

+ 1 - 0
Asteria/Fuction/UserCenter/Orders/Controller/ASOrderDetailsViewController.h

@@ -11,6 +11,7 @@ NS_ASSUME_NONNULL_BEGIN
 
 @interface ASOrderDetailsViewController : ASBaseViewController
 
+@property (nonatomic, assign) BOOL isPay;//是否支付过来
 @property (nonatomic, copy) NSString *orderId;
 
 @end

+ 19 - 0
Asteria/Fuction/UserCenter/Orders/Controller/ASOrderDetailsViewController.m

@@ -15,6 +15,8 @@
 #import "ASOrderDetailsItemsCell.h"
 #import "ASOrderDetailsPriceCell.h"
 
+#import "ASPayFinishHeadView.h"
+
 @interface ASOrderDetailsViewController ()<UITableViewDelegate, UITableViewDataSource>
 
 @property (nonatomic, strong) UITableView *tableView;
@@ -100,11 +102,28 @@
 
 // MARK: - loadSubv
 - (void)loadSubV {
+    
+    
     [self.view addSubview:self.tableView];
     [self.tableView mas_makeConstraints:^(MASConstraintMaker *make) {
         make.top.equalTo(self.customNavBar.mas_bottom);
         make.leading.trailing.bottom.equalTo(self.view);
     }];
+    
+    if (self.isPay) {
+        ASPayFinishHeadView *payFailedView = [[ASPayFinishHeadView alloc] initWithFrame:CGRectMake(0, 0, KScreenWidth, 100) status:1 desc:self.orderId];
+        
+        K_WEAK_SELF;
+        payFailedView.clickBlock = ^(int type) {
+    //        K_STRONG_SELF;
+        };
+        
+        float viewHeight = [payFailedView getViewHeight];
+        payFailedView.frame = CGRectMake(0, 0, KScreenWidth, viewHeight);
+        
+        self.tableView.tableHeaderView = payFailedView;
+    }
+    
 }
 
 // MARK: - subvs

+ 18 - 0
Asteria/Fuction/UserCenter/Orders/Controller/ASPayFailedViewController.h

@@ -0,0 +1,18 @@
+//
+//  ASPayFailedViewController.h
+//  Asteria
+//
+//  Created by xingyu on 2024/5/16.
+//
+
+#import "ASBaseViewController.h"
+
+NS_ASSUME_NONNULL_BEGIN
+
+@interface ASPayFailedViewController : ASBaseViewController
+
+
+
+@end
+
+NS_ASSUME_NONNULL_END

+ 47 - 0
Asteria/Fuction/UserCenter/Orders/Controller/ASPayFailedViewController.m

@@ -0,0 +1,47 @@
+//
+//  ASPayFailedViewController.m
+//  Asteria
+//
+//  Created by xingyu on 2024/5/16.
+//
+
+#import "ASPayFailedViewController.h"
+#import "ASPayFinishHeadView.h"
+
+@interface ASPayFailedViewController ()
+
+@property (nonatomic, strong) UIScrollView *scrollView;
+
+@end
+
+@implementation ASPayFailedViewController
+
+- (void)viewDidLoad {
+    [super viewDidLoad];
+    self.statusBgV.backgroundColor = Col_FFF;
+    self.customNavBar.backgroundColor = Col_FFF;
+    
+    _scrollView = [[UIScrollView alloc] init];
+    [self.view addSubview:_scrollView];
+    [_scrollView mas_makeConstraints:^(MASConstraintMaker *make) {
+        make.top.equalTo(self.customNavBar.mas_bottom);
+        make.leading.trailing.bottom.equalTo(self.view);
+    }];
+    
+    ASPayFinishHeadView *payFailedView = [[ASPayFinishHeadView alloc] initWithFrame:CGRectMake(0, 0, KScreenWidth, 100) status:0 desc:@""];
+    [self.scrollView addSubview:payFailedView];
+    K_WEAK_SELF;
+    payFailedView.clickBlock = ^(int type) {
+//        K_STRONG_SELF;
+    };
+    
+    float viewHeight = [payFailedView getViewHeight];
+    payFailedView.frame = CGRectMake(0, 0, KScreenWidth, viewHeight);
+    
+    self.scrollView.contentSize = CGSizeMake(KScreenWidth, viewHeight);
+    
+    
+}
+
+
+@end

+ 5 - 2
Asteria/Fuction/UserCenter/Orders/Model/ASOrderDetailsModel.h

@@ -21,10 +21,13 @@ NS_ASSUME_NONNULL_BEGIN
 @property (nonatomic, copy) NSString *status; //订单状态
 @property (nonatomic, strong) NSArray<ASOrderDetailsItemModel *> *items;
 @property (nonatomic, copy) NSString *currency_symbol; //币种符号
-
-
+//积分相关
+@property (nonatomic, copy) NSString *mw_rwrdpoints_cur_amnt; //积分抵扣金额
+@property (nonatomic, copy) NSString *mw_rwrdpoints_amnt; //使用积分数量
+@property (nonatomic, copy) NSString *amextrafee_fee_amount;//丢件险
 @property (nonatomic, copy) NSString *subtotal;//初始总价格
 @property (nonatomic, copy) NSString *discount_amount;//优惠券
+@property (nonatomic, copy) NSString *discount_description;//优惠券描述
 @property (nonatomic, copy) NSString *shipping_tax_amount;//邮费
 @property (nonatomic, copy) NSString *grand_total;//最终价格
 

+ 6 - 1
Asteria/Fuction/UserCenter/Orders/Model/ASOrderDetailsModel.m

@@ -19,7 +19,12 @@
 
 + (NSDictionary *)mj_replacedKeyFromPropertyName {
     return @{
-        @"currency_symbol":@"extension_attributes.currency_symbol"
+        @"currency_symbol":@"extension_attributes.currency_symbol",
+        @"mw_rwrdpoints_cur_amnt":@"extension_attributes.mw_rwrdpoints_cur_amnt",
+        @"mw_rwrdpoints_amnt":@"extension_attributes.mw_rwrdpoints_amnt",
+        @"amextrafee_fee_amount":@"extension_attributes.amextrafee_fee_amount"
+        
+        
         
     };
 }

+ 24 - 6
Asteria/Fuction/UserCenter/Orders/View/ASOrderDetailsPriceCell.m

@@ -41,16 +41,35 @@
     
     NSMutableArray *listArr = [[NSMutableArray alloc] initWithCapacity:1];
     
+    //subtotal
     if (AS_String_valid(_orderModel.subtotal)) {
-        NSDictionary *dic = @{@"title":@"Subtotal", @"value":_orderModel.subtotal};
+        NSDictionary *dic = @{@"title":@"Subtotal", @"value":[NSString stringWithFormat:@"%@%@", _orderModel.currency_symbol, _orderModel.subtotal]};
         [listArr addObject:dic];
     }
+    //优惠券
+    if (AS_String_valid(_orderModel.discount_amount) && ![_orderModel.discount_amount isEqualToString:@"0"]) {
+        
+        float discount_amount = fabsf([_orderModel.discount_amount floatValue]);
+        
+        NSDictionary *dic = @{@"title":@"Discount", @"value":[NSString stringWithFormat:@"-%@%.2lf", _orderModel.currency_symbol, discount_amount]};
+        [listArr addObject:dic];
+    }
+    
+    //地址
     if (AS_String_valid(_orderModel.shipping_tax_amount)) {
-        NSDictionary *dic = @{@"title":@"Shipping", @"value":_orderModel.shipping_tax_amount};
+        NSDictionary *dic = @{@"title":@"Shipping & Handling", @"value":[NSString stringWithFormat:@"%@%@", _orderModel.currency_symbol, _orderModel.shipping_tax_amount]};
         [listArr addObject:dic];
     }
-    if (AS_String_valid(_orderModel.discount_amount)) {
-        NSDictionary *dic = @{@"title":@"Gift Card", @"value":_orderModel.discount_amount};
+    
+    //丢件险
+    if (AS_String_valid(_orderModel.amextrafee_fee_amount)) {
+        NSDictionary *dic = @{@"title":@"Extra Fee (Insurance For Lost)", @"value":[NSString stringWithFormat:@"%@%@", _orderModel.currency_symbol, _orderModel.amextrafee_fee_amount]};
+        [listArr addObject:dic];
+    }
+    
+    //积分抵扣
+    if (AS_String_valid(_orderModel.mw_rwrdpoints_amnt) && [AS_String_NotNull(_orderModel.mw_rwrdpoints_amnt) floatValue] > 0) {
+        NSDictionary *dic = @{@"title":[NSString stringWithFormat:@"Reward Points(%@)", _orderModel.mw_rwrdpoints_amnt], @"value":[NSString stringWithFormat:@"-%@%@", _orderModel.currency_symbol, _orderModel.mw_rwrdpoints_cur_amnt]};
         [listArr addObject:dic];
     }
     
@@ -94,11 +113,10 @@
         make.right.mas_equalTo(-10);
         make.height.mas_equalTo(1);
         make.top.equalTo(tempLab.mas_bottom).offset(20);
-//        make.bottom.mas_equalTo(-20);
     }];
     
     
-    UILabel *grandRightLab = [UILabel labelCreateWithText:AS_String_NotNull(_orderModel.grand_total) font:[UIFont fontWithName:Rob_Bold size:24] textColor:Col_000];
+    UILabel *grandRightLab = [UILabel labelCreateWithText:[NSString stringWithFormat:@"%@%@", _orderModel.currency_symbol, _orderModel.grand_total] font:[UIFont fontWithName:Rob_Bold size:24] textColor:Col_000];
     grandRightLab.textAlignment = NSTextAlignmentRight;
     [_backView addSubview:grandRightLab];
     [grandRightLab mas_makeConstraints:^(MASConstraintMaker *make) {

+ 25 - 0
Asteria/Fuction/UserCenter/Orders/View/ASPayFinishHeadView.h

@@ -0,0 +1,25 @@
+//
+//  ASPayFinishHeadView.h
+//  Asteria
+//
+//  Created by xingyu on 2024/5/16.
+//
+
+#import <UIKit/UIKit.h>
+
+NS_ASSUME_NONNULL_BEGIN
+
+typedef void(^ASPayFinishClickBlock)(int type);
+
+@interface ASPayFinishHeadView : UIView
+
+@property (nonatomic, copy) ASPayFinishClickBlock clickBlock;
+
+// 0 失败 1 成功
+- (instancetype)initWithFrame:(CGRect)frame status:(int)status desc:(NSString *)desc;
+
+- (float)getViewHeight;
+
+@end
+
+NS_ASSUME_NONNULL_END

+ 211 - 0
Asteria/Fuction/UserCenter/Orders/View/ASPayFinishHeadView.m

@@ -0,0 +1,211 @@
+//
+//  ASPayFinishHeadView.m
+//  Asteria
+//
+//  Created by xingyu on 2024/5/16.
+//
+
+#import "ASPayFinishHeadView.h"
+
+@interface ASPayFinishHeadView()
+
+@property (nonatomic, strong) UIView *topBackView;
+
+@property (nonatomic, strong) UIImageView *iconImage;
+@property (nonatomic, strong) UILabel *payStatusLab;
+@property (nonatomic, strong) UILabel *orderNumLab;
+@property (nonatomic, strong) UILabel *descLab;
+
+@property (nonatomic, strong) UIButton *topBtn;
+
+@property (nonatomic, strong) UIView *bottomBackView;
+
+@property (nonatomic, assign) float viewHeight;
+
+@end
+
+@implementation ASPayFinishHeadView
+
+- (instancetype)initWithFrame:(CGRect)frame status:(int)status desc:(NSString *)desc{
+    if (self = [super initWithFrame:frame]) {
+        
+        _topBackView = [[UIView alloc] init];
+        _topBackView.backgroundColor = Col_FFF;
+        TT_ViewRadius(_topBackView, 4);
+        [self addSubview:_topBackView];
+        [_topBackView mas_makeConstraints:^(MASConstraintMaker *make) {
+            make.left.top.mas_equalTo(10);
+            make.right.mas_equalTo(-10);
+        }];
+        
+        _iconImage = [[UIImageView alloc] init];
+        [_topBackView addSubview:_iconImage];
+        [_iconImage mas_makeConstraints:^(MASConstraintMaker *make) {
+            make.centerX.equalTo(_topBackView);
+            make.top.mas_equalTo(30);
+            make.width.height.mas_equalTo(50);
+        }];
+        
+        _payStatusLab = [UILabel labelCreateWithText:@"" font:[UIFont fontWithName:Rob_Bold size:16] textColor:_0B0B0B];
+        _payStatusLab.textAlignment = NSTextAlignmentCenter;
+        [_topBackView addSubview:_payStatusLab];
+        [_payStatusLab mas_makeConstraints:^(MASConstraintMaker *make) {
+            make.left.mas_equalTo(20);
+            make.right.mas_equalTo(-20);
+            make.top.equalTo(_iconImage.mas_bottom).offset(20);
+        }];
+        
+        
+        
+        if (status == 0) {
+            _descLab = [UILabel labelCreateWithText:@"" font:[UIFont fontWithName:Rob_Regular size:12] textColor:_0B0B0B];
+            _descLab.numberOfLines = 0;
+            [_topBackView addSubview:_descLab];
+            [_descLab mas_makeConstraints:^(MASConstraintMaker *make) {
+                make.left.mas_equalTo(20);
+                make.right.mas_equalTo(-20);
+                make.top.mas_equalTo(_payStatusLab.mas_bottom).offset(10);
+            }];
+        } else {
+            _orderNumLab = [UILabel labelCreateWithText:@"" font:[UIFont fontWithName:Rob_Bold size:12] textColor:_0B0B0B];
+            _orderNumLab.textAlignment = NSTextAlignmentCenter;
+            [_topBackView addSubview:_orderNumLab];
+            [_orderNumLab mas_makeConstraints:^(MASConstraintMaker *make) {
+                make.left.mas_equalTo(20);
+                make.right.mas_equalTo(-20);
+                make.top.mas_equalTo(_payStatusLab.mas_bottom).offset(10);
+            }];
+            
+            _descLab = [UILabel labelCreateWithText:@"" font:[UIFont fontWithName:Rob_Regular size:12] textColor:_0B0B0B];
+            _descLab.numberOfLines = 0;
+            [_topBackView addSubview:_descLab];
+            [_descLab mas_makeConstraints:^(MASConstraintMaker *make) {
+                make.left.mas_equalTo(20);
+                make.right.mas_equalTo(-20);
+                make.top.mas_equalTo(_orderNumLab.mas_bottom).offset(10);
+            }];
+        }
+        
+        _topBtn = [UIButton buttonWithType:UIButtonTypeCustom];
+        _topBtn.titleLabel.font = [UIFont fontWithName:Rob_Regular size:14];
+        _topBtn.titleLabel.adjustsFontSizeToFitWidth = YES;
+        [_topBtn setTitleColor:Col_000 forState:UIControlStateNormal];
+        TT_ViewBorderRadius(_topBtn, 0, 1, Col_000);
+        [_topBtn addTarget:self action:@selector(_topClick) forControlEvents:UIControlEventTouchUpInside];
+        [_topBackView addSubview:_topBtn];
+        [_topBtn mas_makeConstraints:^(MASConstraintMaker *make) {
+            make.top.mas_equalTo(_descLab.mas_bottom).offset(10);
+            make.height.mas_equalTo(35);
+            make.width.mas_equalTo(200);
+            make.centerX.equalTo(_topBackView);
+            make.bottom.mas_equalTo(-30);
+        }];
+        
+        _bottomBackView = [[UIView alloc] init];
+        _bottomBackView.backgroundColor = _E0FFF5;
+        TT_ViewRadius(_bottomBackView, 4);
+        [self addSubview:_bottomBackView];
+        [_bottomBackView mas_makeConstraints:^(MASConstraintMaker *make) {
+            make.top.equalTo(_topBackView.mas_bottom).offset(20);
+            make.left.mas_equalTo(10);
+            make.right.mas_equalTo(-10);
+            make.height.mas_equalTo(80);
+        }];
+        UITapGestureRecognizer *tap = [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(_bottomClick)];
+        [_bottomBackView addGestureRecognizer:tap];
+        
+        UILabel *faqsLab = [UILabel labelCreateWithText:@"Faqs" font:[UIFont fontWithName:Rob_Regular size:12] textColor:_0B0B0B];
+        [_bottomBackView addSubview:faqsLab];
+        [faqsLab mas_makeConstraints:^(MASConstraintMaker *make) {
+            make.left.mas_equalTo(10);
+            make.top.mas_equalTo(20);
+        }];
+        
+        UILabel *faqsLab1 = [UILabel labelCreateWithText:@"Please contact customer service if need any help" font:[UIFont fontWithName:Rob_Regular size:12] textColor:_0B0B0B];
+        faqsLab1.adjustsFontSizeToFitWidth = YES;
+        [_bottomBackView addSubview:faqsLab1];
+        [faqsLab1 mas_makeConstraints:^(MASConstraintMaker *make) {
+            make.left.mas_equalTo(10);
+            make.right.mas_equalTo(-30);
+            make.top.mas_equalTo(faqsLab.mas_bottom).offset(10);
+        }];
+        
+        UIImageView *arrowRightImgV = [[UIImageView alloc] init];
+        arrowRightImgV.image = [UIImage imageNamed:@"productList_more_right"];
+        [_bottomBackView addSubview:arrowRightImgV];
+        [arrowRightImgV mas_makeConstraints:^(MASConstraintMaker *make) {
+            make.right.mas_equalTo(-10);
+            make.centerY.equalTo(_bottomBackView);
+            make.width.height.mas_equalTo(14);
+        }];
+        
+        float bottomHeight = 20;
+        if (status == 0) {
+            bottomHeight = 85;
+            
+            UIButton *contactBtn = [UIButton buttonWithType:UIButtonTypeCustom];
+            contactBtn.titleLabel.font = [UIFont fontWithName:Rob_Regular size:14];
+            [contactBtn setTitle:@"Contact Us" forState:UIControlStateNormal];
+            contactBtn.backgroundColor = Col_000;
+            [contactBtn addTarget:self action:@selector(_contactBtnClick) forControlEvents:UIControlEventTouchUpInside];
+            TT_ViewRadius(contactBtn, 4);
+            [contactBtn setTitleColor:Col_FFF forState:UIControlStateNormal];
+            [self addSubview:contactBtn];
+            [contactBtn mas_makeConstraints:^(MASConstraintMaker *make) {
+                make.top.mas_equalTo(_bottomBackView.mas_bottom).offset(20);
+                make.height.mas_equalTo(45);
+                make.left.mas_equalTo(10);
+                make.right.mas_equalTo(-10);
+                
+            }];
+            
+            _iconImage.image = [UIImage imageNamed:@"pay_failed_icon"];
+            _payStatusLab.text = @"Payment Failed.";
+            _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:@"Edit the payment information" forState:UIControlStateNormal];
+            
+            [_topBtn mas_updateConstraints:^(MASConstraintMaker *make) {
+                make.width.mas_equalTo(260);
+            }];
+            
+        } else {
+            _iconImage.image = [UIImage imageNamed:@"pay_success_icon"];
+            _payStatusLab.text = @"Your Order Has Been Received";
+            _orderNumLab.text = @"Order #123";
+            _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];
+        
+        self.viewHeight = CGRectGetMaxY(_bottomBackView.frame) + bottomHeight;
+        
+    }
+    return self;
+}
+
+
+- (float)getViewHeight {
+    return self.viewHeight;
+}
+
+- (void)_topClick {
+    if (self.clickBlock) {
+        self.clickBlock(1);
+    }
+}
+
+- (void)_bottomClick {
+    if (self.clickBlock) {
+        self.clickBlock(2);
+    }
+}
+
+- (void)_contactBtnClick {
+    if (self.clickBlock) {
+        self.clickBlock(3);
+    }
+}
+
+@end