1
0

2 Commits 92ed60722d ... 5a2d4914b7

Autor SHA1 Mensagem Data
  Abel 5a2d4914b7 Merge branch 'master' of http://gogs.hnwmzp.cn/nzk1/Asteria-APP há 1 ano atrás
  Abel 27f3f572ea 订单列表开发完成 há 1 ano atrás
30 ficheiros alterados com 1081 adições e 42 exclusões
  1. 32 0
      Asteria.xcodeproj/project.pbxproj
  2. 1 0
      Asteria/ASUI/ColorDefine.h
  3. 10 4
      Asteria/Fuction/Goods/Revies/GoodsReviewsWriteC.m
  4. 3 0
      Asteria/Fuction/Goods/Target/Target_Goods.h
  5. 11 0
      Asteria/Fuction/Goods/Target/Target_Goods.m
  6. 33 2
      Asteria/Fuction/UserCenter/Address/ASAddressViewModel.m
  7. 7 4
      Asteria/Fuction/UserCenter/Address/ASMineAddressModel.h
  8. 18 0
      Asteria/Fuction/UserCenter/Address/ASMineAddressModel.m
  9. 13 18
      Asteria/Fuction/UserCenter/Address/edit/ASEditAddressViewController.m
  10. 22 0
      Asteria/Fuction/UserCenter/Orders/ASOrderListCell.h
  11. 348 0
      Asteria/Fuction/UserCenter/Orders/ASOrderListCell.m
  12. 20 0
      Asteria/Fuction/UserCenter/Orders/ASOrderListSubController.h
  13. 144 0
      Asteria/Fuction/UserCenter/Orders/ASOrderListSubController.m
  14. 18 0
      Asteria/Fuction/UserCenter/Orders/ASOrderListViewController.h
  15. 267 0
      Asteria/Fuction/UserCenter/Orders/ASOrderListViewController.m
  16. 19 0
      Asteria/Fuction/UserCenter/Orders/ASOrderListViewModel.h
  17. 44 0
      Asteria/Fuction/UserCenter/Orders/ASOrderListViewModel.m
  18. 22 0
      Asteria/Fuction/UserCenter/UserCenter.xcassets/ucHome/mine_add_comment.imageset/Contents.json
  19. BIN
      Asteria/Fuction/UserCenter/UserCenter.xcassets/ucHome/mine_add_comment.imageset/评论@2x.png
  20. BIN
      Asteria/Fuction/UserCenter/UserCenter.xcassets/ucHome/mine_add_comment.imageset/评论@3x.png
  21. 4 6
      Asteria/Fuction/UserCenter/UserCenterHome/ASUserCenterViewController.m
  22. 0 1
      Asteria/Fuction/UserCenter/UserCenterHome/ASUserCenterViewModel.m
  23. 1 1
      Asteria/Fuction/UserCenter/UserCenterHome/models/KWMineHomeOrderModel.m
  24. 3 3
      Asteria/Fuction/UserCenter/UserCenterHome/views/KWMineHomeOrderListCell.m
  25. 3 1
      Asteria/Fuction/UserCenter/UserCenterHome/views/KWMineHomeOrderSubView.h
  26. 28 1
      Asteria/Fuction/UserCenter/UserCenterHome/views/KWMineHomeOrderSubView.m
  27. 1 1
      Asteria/Fuction/UserManager/info/ASUserModel.m
  28. 3 0
      Asteria/NetTools/ASNetApis.h
  29. 2 0
      Asteria/Product/CTMediatoaTargets/CTMediator+ASTargerts.h
  30. 4 0
      Asteria/Product/CTMediatoaTargets/CTMediator+ASTargerts.m

+ 32 - 0
Asteria.xcodeproj/project.pbxproj

@@ -124,6 +124,10 @@
 		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 */; };
 		8193D5C82BEA299F00B9AB11 /* ASAddressListViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 8193D5C72BEA299F00B9AB11 /* ASAddressListViewController.m */; };
 		8193D5CB2BEA2A0800B9AB11 /* ASMineAddressModel.m in Sources */ = {isa = PBXBuildFile; fileRef = 8193D5CA2BEA2A0800B9AB11 /* ASMineAddressModel.m */; };
 		8193D5CE2BEA2B8E00B9AB11 /* ASAddressViewModel.m in Sources */ = {isa = PBXBuildFile; fileRef = 8193D5CD2BEA2B8E00B9AB11 /* ASAddressViewModel.m */; };
@@ -566,6 +570,14 @@
 		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>"; };
 		8193D5C62BEA299F00B9AB11 /* ASAddressListViewController.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = ASAddressListViewController.h; sourceTree = "<group>"; };
 		8193D5C72BEA299F00B9AB11 /* ASAddressListViewController.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = ASAddressListViewController.m; sourceTree = "<group>"; };
 		8193D5C92BEA2A0800B9AB11 /* ASMineAddressModel.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = ASMineAddressModel.h; sourceTree = "<group>"; };
@@ -1461,6 +1473,21 @@
 			path = NotificationServiceExtension;
 			sourceTree = "<group>";
 		};
+		819349162BF1EB11009FDDB2 /* Orders */ = {
+			isa = PBXGroup;
+			children = (
+				819349172BF1EB59009FDDB2 /* ASOrderListViewController.h */,
+				819349182BF1EB59009FDDB2 /* ASOrderListViewController.m */,
+				8193491A2BF1EB6F009FDDB2 /* ASOrderListSubController.h */,
+				8193491B2BF1EB6F009FDDB2 /* ASOrderListSubController.m */,
+				8193491F2BF218B6009FDDB2 /* ASOrderListViewModel.h */,
+				819349202BF218B6009FDDB2 /* ASOrderListViewModel.m */,
+				819349242BF34722009FDDB2 /* ASOrderListCell.h */,
+				819349252BF34722009FDDB2 /* ASOrderListCell.m */,
+			);
+			path = Orders;
+			sourceTree = "<group>";
+		};
 		8193D5C52BEA1F9600B9AB11 /* Address */ = {
 			isa = PBXGroup;
 			children = (
@@ -1629,6 +1656,7 @@
 		81D484DD2A0F40510075DC43 /* UserCenter */ = {
 			isa = PBXGroup;
 			children = (
+				819349162BF1EB11009FDDB2 /* Orders */,
 				8193D5C52BEA1F9600B9AB11 /* Address */,
 				81C796312A55159B003083B8 /* Setting */,
 				81C796282A539E65003083B8 /* Message */,
@@ -2721,6 +2749,7 @@
 				9A2415BF2B678A1100A6E903 /* QtyCountV.m in Sources */,
 				9AD345FA2A08D60F005CA070 /* ZFLandscapeWindow.m in Sources */,
 				81E257EE2A120756004EEF71 /* ASUserCenterTopView.m in Sources */,
+				819349262BF34722009FDDB2 /* ASOrderListCell.m in Sources */,
 				81C326622A36B33B002EF442 /* ASHomeActiveView.m in Sources */,
 				81DFA56A2A46D82200DA708B /* ASPointDetailTableView.m in Sources */,
 				9AD346042A08D60F005CA070 /* ZFKVOController.m in Sources */,
@@ -2788,6 +2817,7 @@
 				9AD345F92A08D60F005CA070 /* ZFPlayerController.m in Sources */,
 				9AD345AC2A08D59A005CA070 /* WKM_goodsBanner.m in Sources */,
 				9AE3674D2B6CDDE50068F10B /* MyCartGrandTotalCell.m in Sources */,
+				819349212BF218B6009FDDB2 /* ASOrderListViewModel.m in Sources */,
 				81EC476F2A33F82C00516573 /* ASHomeImgCell.m in Sources */,
 				81717D3A2A3D322700648139 /* KWHisAndHotWordsView.m in Sources */,
 				81DFA5592A4681E900DA708B /* ASPointEranCell.m in Sources */,
@@ -2811,6 +2841,7 @@
 				9AD364D12A05EC7800452C7A /* AS_TabBarViewController.m in Sources */,
 				9AD345FB2A08D60F005CA070 /* ZFOrientationObserver.m in Sources */,
 				9AD346192A08D679005CA070 /* GoodsBannerModel.m in Sources */,
+				819349192BF1EB59009FDDB2 /* ASOrderListViewController.m in Sources */,
 				81717C942A3BE4E000648139 /* ASProductListSortFilterCell.m in Sources */,
 				81056D5C2B60F571009219A3 /* ASHelpListUrlModel.m in Sources */,
 				9AD346082A08D60F005CA070 /* ZFIJKPlayerManager.m in Sources */,
@@ -2858,6 +2889,7 @@
 				81C7963F2A551FB0003083B8 /* ASInfomationSetController.m in Sources */,
 				8131A27C2B365F7700A191BE /* ASProductListCategoryModel.m in Sources */,
 				9A98E5072B5A15A500E8C5C1 /* QDSingleImagePickerPreviewViewController.m in Sources */,
+				8193491C2BF1EB6F009FDDB2 /* ASOrderListSubController.m in Sources */,
 				9AD346062A08D60F005CA070 /* ZFReachabilityManager.m in Sources */,
 				81717CA52A3C0A5000648139 /* KWProductFilterItemCell.m in Sources */,
 				812021252B185A610026B8B5 /* ASCouponsListViewModel.m in Sources */,

+ 1 - 0
Asteria/ASUI/ColorDefine.h

@@ -20,6 +20,7 @@
 #define _E8E8E8 ([UIColor colorWithHexString:@"#E8E8E8"])
 #define _F8F8F8 ([UIColor colorWithHexString:@"#F8F8F8"])
 #define _F0F0F0 ([UIColor colorWithHexString:@"#F0F0F0"])
+#define _F4F4F4 ([UIColor colorWithHexString:@"#F4F4F4"])
 
 #define _1C1C1C ([UIColor colorWithHexString:@"#1C1C1C"])
 #define _6F4A4A ([UIColor colorWithHexString:@"#6F4A4A"])

+ 10 - 4
Asteria/Fuction/Goods/Revies/GoodsReviewsWriteC.m

@@ -50,15 +50,21 @@ RY_baseVMprotocol>
 }
 - (void)initSubviews {
     [super initSubviews];
-    [self.view addSubview:self.topBgV];
+    if (self.topBgV) {
+        [self.view addSubview:self.topBgV];
+    }
     [self.view addSubview:self.buyernameTF];
     [self.view addSubview:self.orderlengthTF];
     IPhoneXHeigh
-    self.topBgV.frame = CGRectMake(0, securitytop_Y, KScreenWidth, 60);
-    self.buyernameTF.mj_y = CGRectGetMaxY(self.topBgV.frame)+20;
+    if (self.topBgV) {
+        self.topBgV.frame = CGRectMake(0, securitytop_Y, KScreenWidth, 60);
+        self.buyernameTF.mj_y = CGRectGetMaxY(self.topBgV.frame)+20;
+    } else {
+        self.buyernameTF.mj_y = securitytop_Y+20;
+    }
     self.orderlengthTF.mj_y = CGRectGetMaxY(self.buyernameTF.frame)+20;
     NSArray *titileAry = @[@"QUALITY",@"SHIPPING",@"SERVICE"];
-    self.starValueAry = [NSMutableArray arrayWithArray:@[@"0.0",@"0.0",@"0.0"]];
+    self.starValueAry = [NSMutableArray arrayWithArray:@[@"5.0",@"5.0",@"5.0"]];
     UIView *lastView = nil;
     for (int i = 0; i<titileAry.count; i++) {
         UILabel *tipslab = [UILabel new];

+ 3 - 0
Asteria/Fuction/Goods/Target/Target_Goods.h

@@ -12,6 +12,9 @@ NS_ASSUME_NONNULL_BEGIN
 @interface Target_Goods : NSObject
 - (UIViewController *)Action_AS_GoodsDetailsC:(NSDictionary *)params;
 - (UIViewController *)Action_AS_GoodsSizeC:(NSDictionary *)params;
+
+- (UIViewController *)Action_WriteReview:(NSDictionary *)params;
+
 @end
 
 NS_ASSUME_NONNULL_END

+ 11 - 0
Asteria/Fuction/Goods/Target/Target_Goods.m

@@ -8,6 +8,7 @@
 #import "Target_Goods.h"
 #import "AS_GoodsDetailsC.h"
 #import "AS_GoodsSizeC.h"
+#import "GoodsReviewsWriteC.h"
 
 @implementation Target_Goods
 - (UIViewController *)Action_AS_GoodsDetailsC:(NSDictionary *)params{
@@ -21,4 +22,14 @@
     vc.model = params[@"model"];
     return vc;
 }
+
+- (UIViewController *)Action_WriteReview:(NSDictionary *)params {
+    GoodsReviewsWriteC *vc = [[GoodsReviewsWriteC alloc]init];
+    GoodsInformationM *info = [[GoodsInformationM alloc] init];
+    info.Id = params[@"entity_id"];
+    vc.goodsM = info;
+    vc.nav_title = @"REVIEWS";
+    return vc;
+}
+
 @end

+ 33 - 2
Asteria/Fuction/UserCenter/Address/ASAddressViewModel.m

@@ -18,17 +18,48 @@
 }
 
 - (void)getCountryList:(void(^)(void))success  {
-    success();
+    [ASNetTools.shared getWithPath:CountryList param:@{} success:^(id _Nonnull json) {
+        NSArray *list = json;
+        NSMutableArray *arr = [KWCountryAddressModel mj_objectArrayWithKeyValuesArray:list];
+        NSMutableArray *result = [NSMutableArray array];
+        for (KWCountryAddressModel *m in arr) {
+            if (m.full_name_english == nil || m.full_name_english.isEmpty) {
+                continue;
+            }
+            [result addObject:m];
+        }
+        self.countryArr = result;
+        success();
+    } faild:^(NSString * _Nonnull code, NSString * _Nonnull msg) {
+        self.countryArr = [NSMutableArray array];
+        success();
+    }];
 }
 
 - (void)getProvinceList:(NSString *)country_id  success:(void(^)(void))success {
+    self.hadGetProvince = false;
+    self.provinceArr = [NSMutableArray array];
+    if (country_id == nil || country_id.isEmpty) {
+        success();
+        return;
+    }
+    for (KWCountryAddressModel *m in self.countryArr) {
+        if (m.country_id == nil || m.country_id.isEmpty) {
+            continue;
+        }
+        if ([m.country_id isEqualToString:country_id] && m.available_regions != nil) {
+            self.hadGetProvince = true;
+            self.provinceArr = [NSMutableArray arrayWithArray:m.available_regions];
+            break;
+        }
+    }
     success();
 }
 
 - (NSArray *)countryNameList {
     NSMutableArray *arr = [NSMutableArray array];
     for (KWCountryAddressModel* item in self.countryArr) {
-        [arr addObject:item.name];
+        [arr addObject:item.full_name_english];
     }
     return arr;
 }

+ 7 - 4
Asteria/Fuction/UserCenter/Address/ASMineAddressModel.h

@@ -9,19 +9,22 @@
 
 NS_ASSUME_NONNULL_BEGIN
 
-
+@class KWProvinceAddressModel;
 @interface KWCountryAddressModel : NSObject
 
 @property (nonatomic, copy) NSString *country_id;
-@property (nonatomic, copy) NSString *iso2_code;
-@property (nonatomic, copy) NSString *iso3_code;
-@property (nonatomic, copy) NSString *name;
+@property (nonatomic, copy) NSString *two_letter_abbreviation;
+@property (nonatomic, copy) NSString *three_letter_abbreviation;
+@property (nonatomic, copy) NSString *full_name_english;
+@property (nonatomic, copy) NSString *full_name_locale;
+@property (nonatomic, strong) NSArray <KWProvinceAddressModel *>*available_regions;
 
 @end
 
 @interface KWProvinceAddressModel : NSObject
 
 @property (nonatomic, copy) NSString *Id;
+@property (nonatomic, copy) NSString *code;
 @property (nonatomic, copy) NSString *name;
 
 @end

+ 18 - 0
Asteria/Fuction/UserCenter/Address/ASMineAddressModel.m

@@ -11,6 +11,24 @@
 
 @implementation KWCountryAddressModel
 
++ (NSDictionary *)mj_replacedKeyFromPropertyName {
+    return @{
+        @"country_id": @"id",
+    };
+}
+
++ (NSDictionary *)mj_objectClassInArray{
+    
+    return @{
+        
+        @"available_regions" : [KWProvinceAddressModel class]
+        
+    };
+    
+    
+    
+}
+
 @end
 
 @implementation KWProvinceAddressModel

+ 13 - 18
Asteria/Fuction/UserCenter/Address/edit/ASEditAddressViewController.m

@@ -46,7 +46,10 @@
 - (instancetype)init {
     self = [super init];
     if (self) {
-        [self.vm getCountryList:^{}];
+        __weak typeof(self) weakSelf = self;
+        [self.vm getCountryList:^{
+            [weakSelf.vm getProvinceList:weakSelf.m.country_id success:^{}];
+        }];
     }
     return self;
 }
@@ -462,9 +465,14 @@
         [BRStringPickerView showPickerWithTitle:@"Select Country" dataSourceArr:self.vm.countryNameList selectIndex:index resultBlock:^(BRResultModel * _Nullable resultModel) {
             KWCountryAddressModel *item = weak_self.vm.countryArr[resultModel.index];
             weak_self.tfArr[6].text = @"";
-            textField.text = item.name;
-            weak_self.m.country = item.name;
+            textField.text = item.full_name_english;
+            weak_self.m.country = item.full_name_english;
             weak_self.m.country_id = item.country_id;
+            weak_self.m.region = [ASAddressReginModel new];
+            weak_self.m.region.region = @"";
+            weak_self.m.region.region_id = @"";
+            weak_self.m.region.region_code = @"";
+            weak_self.m.region_id = @"";
             [weak_self.vm getProvinceList:item.country_id success:^{}];
             
         }];
@@ -472,23 +480,10 @@
     if (tag == 6) {// province
         if (self.m.country_id && ![self.m.country_id isEqualToString:@""]) {
             
-            if (self.vm.hadGetProvince) {
-                if (self.vm.provinceArr.count > 0) {
+            if (self.vm.hadGetProvince && self.vm.provinceArr.count > 0) {
                     [self showProvincePick];
-                } else {
-                    return true;
-                }
             } else {
-                [MBProgressHUD showHUDAddedTo:self.view animated:true];
-                @weakify(self);
-                [self.vm getProvinceList:self.m.country_id success:^{
-                    [MBProgressHUD hideHUDForView:weak_self.view animated:true];
-                    if (weak_self.vm.provinceArr.count > 0) {
-                        [weak_self showProvincePick];
-                    } else {
-                        [weak_self.tfArr[6] becomeFirstResponder];
-                    }
-                }];
+                return true;
             }
         } else {
             [self.view makeToast:@"Please Select Country First"];

+ 22 - 0
Asteria/Fuction/UserCenter/Orders/ASOrderListCell.h

@@ -0,0 +1,22 @@
+//
+//  ASOrderListCell.h
+//  Asteria
+//
+//  Created by iOS on 2024/5/14.
+//
+
+#import <UIKit/UIKit.h>
+#import "KWMineHomeOrderModel.h"
+
+NS_ASSUME_NONNULL_BEGIN
+
+@interface ASOrderListCell : UITableViewCell
+
+// type 0: view Order 1: trackOrder 2: reorder  3: pay now 
+@property (nonatomic, copy) void(^viewOrderCall)(NSInteger type) ;
+
+- (void)setData:(KWMineHomeOrderModel *)model;
+
+@end
+
+NS_ASSUME_NONNULL_END

+ 348 - 0
Asteria/Fuction/UserCenter/Orders/ASOrderListCell.m

@@ -0,0 +1,348 @@
+//
+//  ASOrderListCell.m
+//  Asteria
+//
+//  Created by iOS on 2024/5/14.
+//
+
+#import "ASOrderListCell.h"
+#import "KWMineHomeOrderSubView.h"
+
+@interface ASOrderListCell ()
+
+@property (nonatomic, strong) UIStackView *prodStackV;
+
+@property (nonatomic, strong) UIView *bgV;
+
+@property (nonatomic, strong) UILabel *orderNoNameLB;
+@property (nonatomic, strong) UILabel *orderNoLB;
+@property (nonatomic, strong) UILabel *timeLB;
+@property (nonatomic, strong) UIButton *viewBt;
+
+@property (nonatomic, strong) UIButton *trackBt;
+@property (nonatomic, strong) UIButton *reorderBt;
+@property (nonatomic, strong) UIButton *paynowBt;
+@property (nonatomic, strong) UILabel *statusLb;
+@property (nonatomic, strong) UILabel *totalTiLb;
+@property (nonatomic, strong) UILabel *totalNumLb;
+
+@property (nonatomic, strong) UIView *lineV;
+
+
+@property (nonatomic, strong) KWMineHomeOrderModel *m;
+
+@end
+
+@implementation ASOrderListCell
+
+- (void)setData:(KWMineHomeOrderModel *)model {
+    self.m = model;
+    self.statusLb.text = model.state;
+    self.timeLB.text = [NSString stringWithFormat:@"Date: %@", model.created_at];
+    self.orderNoLB.text = model.increment_id;
+    self.totalNumLb.text = [NSString stringWithFormat:@"%@%@", model.currency_symbol, model.grand_total];
+    for (UIView*item in self.prodStackV.arrangedSubviews) {
+        if (item.superview) {
+            [item removeFromSuperview];
+        }
+    }
+    for (KWMineOrderProInfoModel *info in model.items) {
+        KWMineHomeOrderSubView *subV = [[KWMineHomeOrderSubView alloc] init];
+        [subV setData:info canEdit:true];
+        [self.prodStackV addArrangedSubview:subV];
+    }
+}
+
+- (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier {
+    self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
+    if (self) {
+        [self configSubV];
+    }
+    return self;
+}
+
+- (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)configSubV {
+    self.selectionStyle = UITableViewCellSelectionStyleNone;
+    
+    self.contentView.backgroundColor = _F8F8F8;
+    self.bgV = [UIView new];
+    self.bgV.layer.cornerRadius = 4;
+    self.bgV.layer.masksToBounds = true;
+    self.bgV.backgroundColor = Col_FFF;
+    
+    [self.contentView addSubview:self.bgV];
+    [self.bgV mas_makeConstraints:^(MASConstraintMaker *make) {
+        make.left.equalTo(self.contentView).offset(10);
+        make.right.equalTo(self.contentView).offset(-10);
+        make.top.equalTo(self.contentView).offset(0);
+        make.bottom.equalTo(self.contentView).offset(-10);
+    }];
+    
+    self.prodStackV = [[UIStackView alloc] init];
+    self.prodStackV.axis = UILayoutConstraintAxisVertical;
+    self.prodStackV.spacing = 20;
+    self.prodStackV.distribution = UIStackViewDistributionFillEqually;
+    self.prodStackV.alignment = UIStackViewAlignmentFill;
+    
+    [self.bgV addSubview:self.prodStackV];
+    
+    [self.bgV addSubview:self.orderNoNameLB];
+    [self.bgV addSubview:self.orderNoLB];
+    [self.bgV addSubview:self.timeLB];
+    [self.bgV addSubview:self.viewBt];
+    [self.bgV addSubview:self.statusLb];
+    [self.bgV addSubview:self.totalTiLb];
+    [self.bgV addSubview:self.totalNumLb];
+    [self.bgV addSubview:self.lineV];
+    
+    UIStackView *btStv = [[UIStackView alloc] init];
+    btStv.axis = UILayoutConstraintAxisHorizontal;
+    btStv.spacing = 20;
+    btStv.distribution = UIStackViewDistributionFillEqually;
+    btStv.alignment = UIStackViewAlignmentFill;
+    
+    [self.bgV addSubview:btStv];
+    [btStv addArrangedSubview:self.trackBt];
+    [btStv addArrangedSubview:self.reorderBt];
+    [btStv addArrangedSubview:self.viewBt];
+    [btStv addArrangedSubview:self.paynowBt];
+    
+    [self.statusLb mas_makeConstraints:^(MASConstraintMaker *make) {
+        make.left.equalTo(@10);
+        make.right.equalTo(@(-10));
+        make.top.equalTo(self.bgV).offset(20);
+        make.height.equalTo(@17);
+    }];
+    
+    [self.orderNoNameLB mas_makeConstraints:^(MASConstraintMaker *make) {
+        make.left.equalTo(self.statusLb);
+        make.top.equalTo(self.statusLb.mas_bottom).offset(10);
+        make.height.equalTo(@16);
+    }];
+    [self.orderNoLB mas_makeConstraints:^(MASConstraintMaker *make) {
+        make.left.equalTo(self.orderNoNameLB.mas_right);
+        make.centerY.equalTo(self.orderNoNameLB);
+        make.height.equalTo(@16);
+    }];
+    [self.orderNoLB setContentHuggingPriority:UILayoutPriorityRequired forAxis:UILayoutConstraintAxisHorizontal];
+    [self.orderNoNameLB setContentHuggingPriority:UILayoutPriorityRequired forAxis:UILayoutConstraintAxisHorizontal];
+    
+    [self.timeLB mas_makeConstraints:^(MASConstraintMaker *make) {
+        make.left.equalTo(self.orderNoLB.mas_right).offset(10);
+        make.centerY.equalTo(self.orderNoNameLB);
+        make.height.equalTo(@16);
+        make.right.equalTo(self.bgV).offset(-10);
+    }];
+    
+    [self.lineV mas_makeConstraints:^(MASConstraintMaker *make) {
+        make.left.right.equalTo(self.statusLb);
+        make.height.equalTo(@1);
+        make.top.equalTo(self.orderNoNameLB.mas_bottom).offset(10);
+    }];
+    
+    
+    
+    [self.prodStackV mas_makeConstraints:^(MASConstraintMaker *make) {
+        make.top.equalTo(self.lineV.mas_bottom).offset(10);
+        make.left.equalTo(self.bgV).offset(10);
+        make.right.equalTo(self.bgV).offset(-10);
+    }];
+    
+    [self.totalTiLb mas_makeConstraints:^(MASConstraintMaker *make) {
+        make.left.equalTo(self.prodStackV.mas_left);
+        make.top.equalTo(self.prodStackV.mas_bottom).offset(21);
+        make.height.equalTo(@16);
+    }];
+    [self.totalNumLb setContentHuggingPriority:UILayoutPriorityRequired forAxis:UILayoutConstraintAxisHorizontal];
+    [self.totalNumLb mas_makeConstraints:^(MASConstraintMaker *make) {
+        make.centerY.equalTo(self.totalTiLb);
+        make.left.equalTo(self.totalTiLb.mas_right);
+        make.right.equalTo(self.prodStackV.mas_right);
+        make.height.equalTo(@16);
+    }];
+    
+    [btStv mas_makeConstraints:^(MASConstraintMaker *make) {
+        make.right.equalTo(self.statusLb);
+        make.bottom.equalTo(self.bgV.mas_bottom).offset(-30);
+        make.height.equalTo(@36);
+        make.top.equalTo(self.totalTiLb.mas_bottom).offset(30);
+    }];
+    
+    [self.viewBt mas_makeConstraints:^(MASConstraintMaker *make) {
+        make.height.equalTo(@36);
+        make.width.equalTo(@76);
+    }];
+    
+
+    
+    
+}
+
+
+- (UIView *)lineV {
+    if (!_lineV) {
+        UIView *v = [UIView baseV];
+        v.backgroundColor = _F4F4F4;
+        _lineV = v;
+    }
+    return _lineV;
+}
+
+- (UILabel *)statusLb {
+    if (!_statusLb) {
+        UILabel *lb = [[UILabel alloc] init];
+        lb.font = [UIFont fontWithName:Rob_Bold size:14];
+        lb.textColor = Col_000;
+        lb.backgroundColor = [UIColor clearColor];
+        _statusLb = lb;
+    }
+    return _statusLb;
+}
+
+- (UILabel *)totalTiLb {
+    if (!_totalTiLb) {
+        UILabel *lb = [[UILabel alloc] init];
+        lb.font = [UIFont fontWithName:Rob_Regular size:14];
+        lb.textColor = Col_000;
+        lb.backgroundColor = [UIColor clearColor];
+        lb.textAlignment = NSTextAlignmentRight;
+        lb.text = @"Order Total:";
+        _totalTiLb = lb;
+    }
+    return _totalTiLb;
+}
+
+- (UILabel *)totalNumLb {
+    if (!_totalNumLb) {
+        UILabel *lb = [[UILabel alloc] init];
+        lb.font = [UIFont fontWithName:Rob_Bold size:14];
+        lb.textColor = Col_000;
+        lb.backgroundColor = [UIColor clearColor];
+        _totalNumLb = lb;
+    }
+    return _totalNumLb;
+}
+
+- (UILabel *)orderNoNameLB {
+    if (!_orderNoNameLB) {
+        UILabel *lb = [[UILabel alloc] init];
+        lb.font = [UIFont fontWithName:Rob_Regular size:12];
+        lb.textColor = [UIColor colorWithHexString:@"#666666"];
+        lb.backgroundColor = [UIColor clearColor];
+        lb.textAlignment = NSTextAlignmentLeft;
+        lb.text = @"Order Number:";
+        _orderNoNameLB = lb;
+    }
+    return _orderNoNameLB;
+}
+
+- (UILabel *)orderNoLB {
+    if (!_orderNoLB) {
+        UILabel *lb = [[UILabel alloc] init];
+        lb.font = [UIFont fontWithName:Rob_Regular size:12];
+        lb.textColor = [UIColor colorWithHexString:@"#666666"];
+        lb.backgroundColor = [UIColor clearColor];
+        _orderNoLB = lb;
+    }
+    return _orderNoLB;
+}
+- (UILabel *)timeLB {
+    if (!_timeLB) {
+        UILabel *lb = [[UILabel alloc] init];
+        lb.font = [UIFont fontWithName:Rob_Regular size:12];
+        lb.textColor = [UIColor colorWithHexString:@"#666666"];
+        lb.backgroundColor = [UIColor clearColor];
+        lb.textAlignment = NSTextAlignmentLeft;
+        _timeLB = lb;
+    }
+    return _timeLB;
+}
+
+- (UIButton *)viewBt {
+    if (!_viewBt) {
+        UIButton *bt = [UIButton buttonWithType:UIButtonTypeCustom];
+        NSMutableAttributedString *attStr = [[NSMutableAttributedString alloc] initWithString:@"View Order"];
+        [attStr addAttributes:@{
+            NSFontAttributeName:[UIFont fontWithName:Rob_Regular size:14],
+            NSUnderlineStyleAttributeName:@(NSUnderlineStyleSingle),
+            NSUnderlineColorAttributeName:[UIColor colorWithHexString:@"#000000"],
+            NSForegroundColorAttributeName:[UIColor colorWithHexString:@"#000000"],
+        } range:NSMakeRange(0, attStr.length)];
+        bt.tag = 10000;
+        [bt setAttributedTitle:attStr forState:UIControlStateNormal];
+        [bt addTarget:self action:@selector(viewBtAction:) forControlEvents:UIControlEventTouchUpInside];
+        _viewBt = bt;
+    }
+    return _viewBt;
+}
+
+- (UIButton *)trackBt {
+    if (!_trackBt) {
+        UIButton *bt = [UIButton buttonWithType:UIButtonTypeCustom];
+        NSMutableAttributedString *attStr = [[NSMutableAttributedString alloc] initWithString:@"Track Order"];
+        [attStr addAttributes:@{
+            NSFontAttributeName:[UIFont fontWithName:Rob_Regular size:14],
+            NSUnderlineStyleAttributeName:@(NSUnderlineStyleSingle),
+            NSUnderlineColorAttributeName:[UIColor colorWithHexString:@"#000000"],
+            NSForegroundColorAttributeName:[UIColor colorWithHexString:@"#000000"],
+        } range:NSMakeRange(0, attStr.length)];
+        bt.tag = 10001;
+        [bt setAttributedTitle:attStr forState:UIControlStateNormal];
+        [bt addTarget:self action:@selector(viewBtAction:) forControlEvents:UIControlEventTouchUpInside];
+        _trackBt = bt;
+    }
+    return _trackBt;
+}
+
+- (UIButton *)reorderBt {
+    if (!_reorderBt) {
+        UIButton *bt = [UIButton buttonWithType:UIButtonTypeCustom];
+        NSMutableAttributedString *attStr = [[NSMutableAttributedString alloc] initWithString:@"Reorder"];
+        [attStr addAttributes:@{
+            NSFontAttributeName:[UIFont fontWithName:Rob_Regular size:14],
+            NSUnderlineStyleAttributeName:@(NSUnderlineStyleSingle),
+            NSUnderlineColorAttributeName:[UIColor colorWithHexString:@"#000000"],
+            NSForegroundColorAttributeName:[UIColor colorWithHexString:@"#000000"],
+        } range:NSMakeRange(0, attStr.length)];
+        bt.tag = 10002;
+        [bt setAttributedTitle:attStr forState:UIControlStateNormal];
+        [bt addTarget:self action:@selector(viewBtAction:) forControlEvents:UIControlEventTouchUpInside];
+        _reorderBt = bt;
+    }
+    return _reorderBt;
+}
+
+- (UIButton *)paynowBt {
+    if (!_paynowBt) {
+        UIButton *bt = [UIButton buttonWithType:UIButtonTypeCustom];
+        bt.tag = 10003;
+        bt.hidden = true;
+        bt.titleLabel.font = [UIFont fontWithName:Rob_Regular size:14];
+        [bt setTitle:@"Pay Now" forState:UIControlStateNormal];
+        [bt addTarget:self action:@selector(viewBtAction:) forControlEvents:UIControlEventTouchUpInside];
+        _viewBt = bt;
+    }
+    return _viewBt;
+}
+
+-(void)viewBtAction:(UIButton *)bt {
+    
+    if (self.viewOrderCall) {
+        self.viewOrderCall(bt.tag-10000);
+    }
+    
+}
+
+@end
+

+ 20 - 0
Asteria/Fuction/UserCenter/Orders/ASOrderListSubController.h

@@ -0,0 +1,20 @@
+//
+//  ASOrderListSubController.h
+//  Asteria
+//
+//  Created by iOS on 2024/5/13.
+//
+
+#import "ASBaseViewController.h"
+
+NS_ASSUME_NONNULL_BEGIN
+
+@interface ASOrderListSubController : ASBaseViewController
+
+@property (nonatomic, copy) NSString *status;
+
+- (void)refreshListData;
+
+@end
+
+NS_ASSUME_NONNULL_END

+ 144 - 0
Asteria/Fuction/UserCenter/Orders/ASOrderListSubController.m

@@ -0,0 +1,144 @@
+//
+//  ASOrderListSubController.m
+//  Asteria
+//
+//  Created by iOS on 2024/5/13.
+//
+
+#import "ASOrderListSubController.h"
+#import "ASOrderListCell.h"
+#import "ASOrderListViewModel.h"
+
+@interface ASOrderListSubController ()<UITableViewDelegate, UITableViewDataSource>
+
+@property (nonatomic, strong) UITableView *tableV;
+@property (nonatomic, strong) NSMutableArray<KWMineHomeOrderModel *> *orderArr;
+@property (nonatomic, assign) NSInteger page;
+@property (nonatomic, strong) ASOrderListViewModel *vm;
+
+@end
+
+@implementation ASOrderListSubController
+
+- (void)viewDidLoad {
+    [super viewDidLoad];
+    self.customNavBar.hidden = true;
+    self.statusBgV.hidden = true;
+    self.vm = [ASOrderListViewModel new];
+    self.page = 1;
+    [self getOrderData];
+    [self loadSubV];
+    [self viewAction];
+    self.view.backgroundColor = _F8F8F8;
+    
+    
+}
+
+- (void)refreshListData {
+    [self.tableV.mj_header beginRefreshing];
+}
+
+- (void)checkEmpty {
+    if (self.orderArr.count == 0) {
+        [self showEmptyV: self.tableV];
+    } else {
+        [self hiddenEmpty];
+    }
+}
+
+- (void)viewAction {
+    __weak typeof(self) weakSelf = self;
+    self.tableV.mj_header = [MJRefreshNormalHeader headerWithRefreshingBlock:^{
+        weakSelf.page = 1;
+        [weakSelf getOrderData];
+    }];
+    self.tableV.mj_footer = [MJRefreshAutoNormalFooter footerWithRefreshingBlock:^{
+        weakSelf.page += 1;
+        [weakSelf getOrderData];
+    }];
+}
+// MARK: - net
+- (void)getOrderData {
+    [MBProgressHUD showHUDAddedTo:self.view animated:true];
+    __weak typeof(self) weakSelf = self;
+    [self.vm getOrderNet:self.status page:self.page com:^(NSArray<KWMineHomeOrderModel *> * _Nonnull arr) {
+        [MBProgressHUD hideHUDForView:weakSelf.view animated:true];
+        [weakSelf.tableV.mj_header endRefreshing];
+        if (arr.count < 10) {
+            [weakSelf.tableV.mj_footer endRefreshingWithNoMoreData];
+        } else {
+            [weakSelf.tableV.mj_footer endRefreshing];
+        }
+        if (weakSelf.page == 1) {
+            weakSelf.orderArr = [NSMutableArray arrayWithArray:arr];
+        } else {
+            [weakSelf.orderArr addObjectsFromArray:arr];
+        }
+        [weakSelf.tableV reloadData];
+        [weakSelf checkEmpty];
+    }];
+}
+
+// MARK: - loadSubv
+- (void)loadSubV {
+    [self.view addSubview:self.tableV];
+    [self.tableV mas_makeConstraints:^(MASConstraintMaker *make) {
+        make.edges.equalTo(self.view);
+    }];
+}
+
+
+
+// MARK: - subvs
+- (UITableView *)tableV {
+    if (!_tableV) {
+        UITableView *v = [[UITableView alloc] initWithFrame:CGRectZero style:UITableViewStylePlain];
+        [v registerClass:[ASOrderListCell class] forCellReuseIdentifier:@"ASOrderListCell"];
+        v.delegate = self;
+        v.dataSource = self;
+        [v baseSet];
+        v.backgroundColor = _F8F8F8;
+        
+        _tableV = v;
+    }
+    return _tableV;
+}
+
+
+#pragma mark - UITableViewDelegate,UITableViewDataSource
+
+- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath {
+
+}
+
+- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section {
+    return self.orderArr.count;
+    
+}
+
+- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {
+    
+    ASOrderListCell *cell = [tableView dequeueReusableCellWithIdentifier:@"ASOrderListCell" forIndexPath:indexPath];
+    if (self.orderArr.count <= indexPath.row) {
+        return cell;
+    }
+    KWMineHomeOrderModel *m = self.orderArr[indexPath.row];
+    [cell setData:m];
+    @weakify(self);
+    [cell setViewOrderCall:^(NSInteger type){
+        // type 0: view Order 1: trackOrder 2: reorder  3: pay now
+        if (![ASUserInfoManager.shared isLogin]) {
+            [self popAndToLogin];
+            return;
+        }
+        // 查看订单
+        NSLog(@"查看订单 view order");
+        //            KWM_OrderViewC *vc = [[KWM_OrderViewC alloc]init];
+        //            vc.order_id = m.orderId;
+        //            [[Current_normalTool topViewController].navigationController pushViewController:vc animated:YES];
+    }];
+    return cell;
+    
+}
+
+@end

+ 18 - 0
Asteria/Fuction/UserCenter/Orders/ASOrderListViewController.h

@@ -0,0 +1,18 @@
+//
+//  ASOrderListViewController.h
+//  Asteria
+//
+//  Created by iOS on 2024/5/13.
+//
+
+#import "ASBaseViewController.h"
+
+NS_ASSUME_NONNULL_BEGIN
+
+@interface ASOrderListViewController : ASBaseViewController
+
+@property (nonatomic, assign) NSInteger defualtIndex;
+
+@end
+
+NS_ASSUME_NONNULL_END

+ 267 - 0
Asteria/Fuction/UserCenter/Orders/ASOrderListViewController.m

@@ -0,0 +1,267 @@
+//
+//  ASOrderListViewController.m
+//  Asteria
+//
+//  Created by iOS on 2024/5/13.
+//
+
+#import "ASOrderListViewController.h"
+#import "ASOrderListSubController.h"
+
+@interface ASOrderListViewController () <UIScrollViewDelegate>
+
+@property (nonatomic, strong) NSArray <NSString *>*titles;
+@property (nonatomic, strong) NSArray <NSString *>*statuses;
+
+@property (nonatomic, strong) NSArray <UIButton *>*topBtns;
+@property (nonatomic, strong) NSArray <UIView *>*views;
+@property (nonatomic, strong) NSArray <ASOrderListSubController *>*vcs;
+@property (nonatomic, strong) UIView *topBgV;
+@property (nonatomic, strong) UIScrollView *topScrollV;
+@property (nonatomic, strong) UIView *bottomBgV;
+@property (nonatomic, strong) UIScrollView *scrollV;
+
+@end
+
+@implementation ASOrderListViewController
+
+- (void)viewDidLoad {
+    [super viewDidLoad];
+    self.titleStr = @"Orders";
+    [self setNavRightSearch:^{
+        
+    }];
+    self.statusBgV.backgroundColor = Col_FFF;
+    self.customNavBar.backgroundColor = Col_FFF;
+    [self loadSubV];
+    
+}
+
+
+// MARK: - funcs
+- (void)getBaseData {
+    self.titles = @[@"ALL", @"PENDING", @"PROCESSING", @"COMPLETE", @"CLOSED", @"CANCELED"];
+    self.statuses = @[@"all", @"pending", @"processing", @"complete", @"closed", @"canceled"];
+    NSMutableArray *vcs = [NSMutableArray array];
+    NSMutableArray *views = [NSMutableArray array];
+    NSMutableArray *btns = [NSMutableArray array];
+    for (int i=0; i<self.titles.count; i++) {
+        if (self.titles.count <= i || self.statuses.count <= i) {
+            return;
+        }
+        NSString *status = self.statuses[i];
+        NSString *title = self.titles[i];
+        ASOrderListSubController *vc = [[ASOrderListSubController alloc] init];
+        vc.status = status;
+        [self addChildViewController:vc];
+        [vcs addObject:vc];
+        UIView *bgV = [self getSubBgV];
+        [views addObject:bgV];
+        UIButton *bt = [self getTopBt:title index:i];
+        [btns addObject:bt];
+        
+        [self.topScrollV addSubview:bt];
+        [self.scrollV addSubview:bgV];
+        
+        CGRect titleRect = [title boundingRectWithSize:CGSizeMake(CGFLOAT_MAX, 18) options:NSStringDrawingTruncatesLastVisibleLine | NSStringDrawingUsesLineFragmentOrigin | NSStringDrawingUsesFontLeading attributes:@{NSFontAttributeName: [UIFont fontWithName:Rob_Bold size:12]} context:nil];
+        CGFloat titleW = titleRect.size.width + 30;
+        if (titleW < 60) {
+            titleW = 60;
+        }
+        [bt mas_makeConstraints:^(MASConstraintMaker *make) {
+            make.width.equalTo(@(titleW));
+            make.height.equalTo(@40);
+            make.top.equalTo(@10);
+            if (i == 0) {
+                make.leading.equalTo(self.topScrollV.mas_leading).offset(10);
+            } else {
+                if (i-1 >= btns.count) {
+                    return;
+                }
+                UIButton *lastBt = btns[i-1];
+                make.leading.equalTo(lastBt.mas_trailing).offset(10);
+            }
+            if (i == self.titles.count-1) {
+                make.trailing.equalTo(self.topScrollV.mas_trailing).offset(-10);
+            }
+        }];
+        IPhoneXHeigh;
+        [bgV mas_makeConstraints:^(MASConstraintMaker *make) {
+            make.width.equalTo(@(SCREEN_WIDTH));
+            make.height.equalTo(@(SCREEN_HEIGHT-kCustomNavBarH-StatusHeight-securityBottom_H-70));
+            make.top.bottom.equalTo(self.scrollV);
+            if (i == 0) {
+                make.leading.equalTo(self.scrollV);
+            } else {
+                if (i-1 >= views.count) {
+                    return;
+                }
+                UIView *lastv = views[i-1];
+                make.leading.equalTo(lastv.mas_trailing);
+            }
+            if (i == self.titles.count-1) {
+                make.trailing.equalTo(self.scrollV);
+            }
+        }];
+    }
+    self.vcs = vcs;
+    self.views = views;
+    self.topBtns = btns;
+    
+    if (self.defualtIndex < self.topBtns.count) {
+        UIButton *bt = self.topBtns[self.defualtIndex];
+        [self topBtAction:bt];
+    }
+}
+
+
+// MARK: - actions
+- (void)topBtAction:(UIButton *)bt {
+    NSInteger index = bt.tag - 10000;
+    if (self.topBtns.count <= index) {
+        return;
+    }
+    for (UIButton *tempBt in self.topBtns) {
+        BOOL isSelect = tempBt.tag == bt.tag;
+        tempBt.selected = isSelect;
+        tempBt.backgroundColor = isSelect ? _113632 : Col_FFF;
+        tempBt.titleLabel.font = [UIFont fontWithName:isSelect ? Rob_Bold : Rob_Regular size:12];
+    }
+    [self.scrollV setContentOffset:CGPointMake(KScreenWidth*index, 0) animated:true];
+    if (self.vcs.count <= index || self.views.count <= index) {
+        return;
+    }
+    ASOrderListSubController *tempVc = [self.vcs objectAtIndex:index];
+    UIView *v = self.views[index];
+    if (tempVc.view.superview == nil) {
+        [v addSubview:tempVc.view];
+        [tempVc.view mas_makeConstraints:^(MASConstraintMaker *make) {
+            make.edges.equalTo(v);
+        }];
+        [tempVc didMoveToParentViewController:self];
+    } else {
+        // 刷新子页面数据
+        [tempVc refreshListData];
+    }
+    
+}
+
+- (void)loadSubV {
+    [self.view addSubview:self.topBgV];
+    [self.view addSubview:self.bottomBgV];
+    
+    [self.topBgV addSubview:self.topScrollV];
+    [self.bottomBgV addSubview:self.scrollV];
+    
+    [self.topBgV mas_makeConstraints:^(MASConstraintMaker *make) {
+        make.top.equalTo(self.customNavBar.mas_bottom);
+        make.leading.trailing.equalTo(self.view);
+        make.height.equalTo(@60);
+    }];
+    
+    [self.bottomBgV mas_makeConstraints:^(MASConstraintMaker *make) {
+        make.top.equalTo(self.topBgV.mas_bottom);
+        make.leading.trailing.bottom.equalTo(self.view);
+    }];
+    
+    [self.scrollV mas_makeConstraints:^(MASConstraintMaker *make) {
+        make.top.equalTo(self.bottomBgV).offset(10);
+        make.leading.trailing.bottom.equalTo(self.bottomBgV);
+    }];
+    [self.topScrollV mas_makeConstraints:^(MASConstraintMaker *make) {
+        make.edges.equalTo(self.topBgV);
+    }];
+    [self getBaseData];
+}
+
+
+// MARK: - subvs
+
+- (UIView *)getSubBgV {
+    UIView *v = [UIView baseV];
+    v.backgroundColor = UIColor.clearColor;
+    return v;
+}
+
+- (UIView *)topBgV {
+    if (!_topBgV) {
+        UIView *v = [UIView baseV];
+        v.backgroundColor = _F8F8F8;
+        _topBgV = v;
+    }
+    return _topBgV;
+}
+
+- (UIView *)bottomBgV{
+    if (!_bottomBgV) {
+        UIView *v = [UIView baseV];
+        v.frame = CGRectMake(0, 0, KScreenWidth, KScreenHeight);
+        v.backgroundColor = _F8F8F8;
+        
+        _bottomBgV = v;
+    }
+    return _bottomBgV;
+}
+
+- (UIButton *)getTopBt:(NSString *)title index:(NSInteger)index {
+    UIButton *bt = [UIButton buttonWithType:UIButtonTypeCustom];
+    [bt addTarget:self action:@selector(topBtAction:) forControlEvents:UIControlEventTouchUpInside];
+    bt.tag = index + 10000;
+    bt.backgroundColor = _113632;
+    bt.titleLabel.font = [UIFont fontWithName:Rob_Bold size:12];
+    bt.layer.cornerRadius = 4;
+    bt.layer.masksToBounds = true;
+    [bt setTitleColor:Col_000 forState:UIControlStateNormal];
+    [bt setTitleColor:Col_FFF forState:UIControlStateSelected];
+    [bt setTitle:title forState:UIControlStateNormal];
+    
+    return bt;
+}
+
+
+- (UIScrollView *)scrollV {
+    if (!_scrollV) {
+        UIScrollView *v = [[UIScrollView alloc] init];
+        v.showsVerticalScrollIndicator = false;
+        v.showsHorizontalScrollIndicator = false;
+        v.delegate = self;
+        v.pagingEnabled = true;
+        v.backgroundColor = UIColor.clearColor;
+        v.alwaysBounceHorizontal = true;
+        _scrollV = v;
+    }
+    return _scrollV;
+}
+
+- (UIScrollView *)topScrollV {
+    if (!_topScrollV) {
+        UIScrollView *v = [[UIScrollView alloc] init];
+        v.showsVerticalScrollIndicator = false;
+        v.showsHorizontalScrollIndicator = false;
+        v.backgroundColor = UIColor.clearColor;
+        v.alwaysBounceHorizontal = true;
+        _topScrollV = v;
+    }
+    return _topScrollV;
+}
+
+- (void)scrollViewDidEndScrollingAnimation:(UIScrollView *)scrollView {
+    NSInteger index = (NSInteger)(scrollView.contentOffset.x/SCREEN_WIDTH);
+    if (self.topBtns.count <= index) {
+        return;
+    }
+    UIButton *bt = self.topBtns[index];
+    [self topBtAction:bt];
+    
+}
+
+- (void)scrollViewDidEndDecelerating:(UIScrollView *)scrollView {
+    NSInteger index = (NSInteger)(scrollView.contentOffset.x/SCREEN_WIDTH);
+    if (self.topBtns.count <= index) {
+        return;
+    }
+    UIButton *bt = self.topBtns[index];
+    [self topBtAction:bt];
+}
+
+@end

+ 19 - 0
Asteria/Fuction/UserCenter/Orders/ASOrderListViewModel.h

@@ -0,0 +1,19 @@
+//
+//  ASOrderListViewModel.h
+//  Asteria
+//
+//  Created by iOS on 2024/5/13.
+//
+
+#import <Foundation/Foundation.h>
+#import "KWMineHomeOrderModel.h"
+
+NS_ASSUME_NONNULL_BEGIN
+
+@interface ASOrderListViewModel : NSObject
+
+- (void)getOrderNet:(NSString *)status page:(NSInteger)page com:(void(^)(NSArray<KWMineHomeOrderModel *> *))com;
+
+@end
+
+NS_ASSUME_NONNULL_END

+ 44 - 0
Asteria/Fuction/UserCenter/Orders/ASOrderListViewModel.m

@@ -0,0 +1,44 @@
+//
+//  ASOrderListViewModel.m
+//  Asteria
+//
+//  Created by iOS on 2024/5/13.
+//
+
+#import "ASOrderListViewModel.h"
+
+@implementation ASOrderListViewModel
+
+- (void)getOrderNet:(NSString *)status page:(NSInteger)page com:(void(^)(NSArray<KWMineHomeOrderModel *> *))com {
+    NSMutableDictionary *para = [NSMutableDictionary dictionaryWithDictionary: @{
+        @"url": @"/V1/orders",
+    }];
+    NSMutableDictionary *paraDic = [NSMutableDictionary dictionaryWithDictionary:@{
+        @"searchCriteria[pageSize]":@10,
+        @"searchCriteria[currentPage]":@(page),
+    }];
+    if (![status.localizedLowercaseString isEqualToString:@"all"]) {
+        [paraDic addEntriesFromDictionary:@{
+            @"searchCriteria[filterGroups][0][filters][0][field]":@"status",
+            @"searchCriteria[filterGroups][0][filters][0][conditionType]":@"=",
+            @"searchCriteria[filterGroups][0][filters][0][value]":status,
+        }];
+    }
+    para[@"params"] = paraDic;
+    [ASNetTools.shared postWithPath:getAllOrders param:para success:^(id _Nonnull json) {
+        NSLog(@"---getAllOrders---result:%@------",json);
+        NSArray<KWMineHomeOrderModel *> *arr = [KWMineHomeOrderModel mj_objectArrayWithKeyValuesArray: json[@"items"]];
+        for (KWMineHomeOrderModel *m in arr) {
+            for (KWMineOrderProInfoModel *info in m.items) {
+                info.currency_symbol = m.currency_symbol;
+            }
+        }
+        com(arr);
+    } faild:^(NSString * _Nonnull code, NSString * _Nonnull msg) {
+        NSLog(@"---getAllOrders---code:%@--msg:%@----", code, msg);
+        com(@[]);
+    }];
+}
+
+
+@end

+ 22 - 0
Asteria/Fuction/UserCenter/UserCenter.xcassets/ucHome/mine_add_comment.imageset/Contents.json

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

BIN
Asteria/Fuction/UserCenter/UserCenter.xcassets/ucHome/mine_add_comment.imageset/评论@2x.png


BIN
Asteria/Fuction/UserCenter/UserCenter.xcassets/ucHome/mine_add_comment.imageset/评论@3x.png


+ 4 - 6
Asteria/Fuction/UserCenter/UserCenterHome/ASUserCenterViewController.m

@@ -17,6 +17,7 @@
 #import "ASMessageListViewController.h"
 #import "ASSettingViewController.h"
 #import "ASUserCenterViewModel.h"
+#import "ASOrderListViewController.h"
 
 
 @interface ASUserCenterViewController ()<UITableViewDelegate,UITableViewDataSource>
@@ -211,13 +212,10 @@
 - (UIView *)tableView:(UITableView *)tableView viewForHeaderInSection:(NSInteger)section {
     KWMineHomeOrderHeadView *v = [tableView dequeueReusableHeaderFooterViewWithIdentifier:@"KWMineHomeOrderHeadView"];
     v.backgroundColor = UIColor.whiteColor;
-//    @weakify(self);
+    __weak typeof(self) weakSelf = self;
     [v setToAllBlock:^{
-//        if (![weak_self checkLogin:true]) {
-//            return;
-//        }
-//        KWM_OrderListC *orderC = [[KWM_OrderListC alloc]init];
-//        [self.navigationController pushViewController:orderC animated:true];
+        ASOrderListViewController *orderC = [[ASOrderListViewController alloc]init];
+        [weakSelf.navigationController pushViewController:orderC animated:true];
 
     }];
     return v;

+ 0 - 1
Asteria/Fuction/UserCenter/UserCenterHome/ASUserCenterViewModel.m

@@ -16,7 +16,6 @@
         @"url": @"/V1/orders",
         @"params": @{@"searchCriteria[pageSize]":@4, @"searchCriteria[currentPage]":@1},
     };
-    __weak typeof(self) weakSelf = self;
     [ASNetTools.shared postWithPath:getAllOrders param:para success:^(id _Nonnull json) {
         NSLog(@"---getAllOrders---result:%@------",json);
         NSArray<KWMineHomeOrderModel *> *arr = [KWMineHomeOrderModel mj_objectArrayWithKeyValuesArray: json[@"items"]];

+ 1 - 1
Asteria/Fuction/UserCenter/UserCenterHome/models/KWMineHomeOrderModel.m

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

+ 3 - 3
Asteria/Fuction/UserCenter/UserCenterHome/views/KWMineHomeOrderListCell.m

@@ -37,7 +37,7 @@
     }
     for (KWMineOrderProInfoModel *info in model.items) {
         KWMineHomeOrderSubView *subV = [[KWMineHomeOrderSubView alloc] init];
-        [subV setData:info];
+        [subV setData:info canEdit:false];
         [self.prodStackV addArrangedSubview:subV];
     }
 }
@@ -105,7 +105,7 @@
         make.top.equalTo(self.prodStackV.mas_bottom).offset(21);
         make.height.equalTo(@16);
     }];
-    [self.orderNoLB setContentHuggingPriority:UILayoutPriorityRequired forAxis:UILayoutConstraintAxisHorizontal];
+    [self.orderNoNameLB setContentHuggingPriority:UILayoutPriorityRequired forAxis:UILayoutConstraintAxisHorizontal];
     [self.orderNoLB mas_makeConstraints:^(MASConstraintMaker *make) {
         make.centerY.equalTo(self.orderNoNameLB);
         make.left.equalTo(self.orderNoNameLB.mas_right);
@@ -139,7 +139,7 @@
         lb.font = [UIFont fontWithName:Rob_Regular size:12];
         lb.textColor = [UIColor colorWithHexString:@"#666666"];
         lb.backgroundColor = [UIColor clearColor];
-        lb.textAlignment = NSTextAlignmentRight;
+        lb.textAlignment = NSTextAlignmentLeft;
         lb.text = @"Order Number:";
         _orderNoNameLB = lb;
     }

+ 3 - 1
Asteria/Fuction/UserCenter/UserCenterHome/views/KWMineHomeOrderSubView.h

@@ -12,7 +12,9 @@ NS_ASSUME_NONNULL_BEGIN
 
 @interface KWMineHomeOrderSubView : UIView
 
-- (void)setData:(KWMineOrderProInfoModel *)model;
+@property (nonatomic, copy) void(^toAddCommentBlock)(KWMineOrderProInfoModel *model);
+
+- (void)setData:(KWMineOrderProInfoModel *)model canEdit:(BOOL)canEdit;
 
 @end
 

+ 28 - 1
Asteria/Fuction/UserCenter/UserCenterHome/views/KWMineHomeOrderSubView.m

@@ -16,19 +16,30 @@
 @property (nonatomic, strong) UILabel *numLB;
 @property (nonatomic, strong) UIImageView *imgV;
 
+@property (nonatomic, strong) UIButton *editBt;
+
 @property (nonatomic, strong) KWMineOrderProInfoModel *m;
 
 @end
 
 @implementation KWMineHomeOrderSubView
 
-- (void)setData:(KWMineOrderProInfoModel *)model {
+- (void)setData:(KWMineOrderProInfoModel *)model canEdit:(BOOL)canEdit {
     self.m = model;
     self.titleLB.text = model.name;
     self.priceLb.text = [NSString stringWithFormat:@"%@%@",  model.currency_symbol, model.price];
     self.numLB.text = model.qty_ordered;
     NSString *imageStr = [NSString stringWithFormat:@"https:%@%@%@",HostPath,ProductImgPath,model.image];
     [self.imgV sd_setImageWithURL:[NSURL URLWithString:imageStr.urlEncode] placeholderImage:[UIImage imageNamed:@"product_defualtImg"]];
+    self.editBt.hidden = !canEdit;
+}
+
+- (void)btAction:(UIButton *)bt {
+    if (self.m && self.toAddCommentBlock) {
+        self.toAddCommentBlock(self.m);
+    }
+    UIViewController *vc = [CTMediator.sharedInstance Goods_WriteReview:@{@"entity_id":self.m.product_id}];
+    [Current_normalTool.currentNav pushViewController:vc animated:true];
 }
 
 -(instancetype)init {
@@ -46,6 +57,7 @@
     [self addSubview:self.priceLb];
     [self addSubview:self.xLB];
     [self addSubview:self.numLB];
+    [self addSubview:self.editBt];
     
     
     [_imgV mas_makeConstraints:^(MASConstraintMaker *make) {
@@ -80,6 +92,11 @@
         make.left.equalTo(self.xLB.mas_right);
         make.centerY.equalTo(self.priceLb);
     }];
+    [self.editBt mas_makeConstraints:^(MASConstraintMaker *make) {
+        make.bottom.centerY.equalTo(self.priceLb);
+        make.width.height.equalTo(@24);
+        make.right.equalTo(self);
+    }];
 }
 
 
@@ -136,5 +153,15 @@
     return _numLB;
 }
 
+- (UIButton *)editBt {
+    if (!_editBt) {
+        UIButton *bt = [UIButton buttonWithType:UIButtonTypeCustom];
+        [bt setImage:[UIImage imageNamed:@"mine_add_comment"] forState:UIControlStateNormal];
+        [bt addTarget:self action:@selector(btAction:) forControlEvents:UIControlEventTouchUpInside];
+        _editBt = bt;
+    }
+    return _editBt;
+}
+
 
 @end

+ 1 - 1
Asteria/Fuction/UserManager/info/ASUserModel.m

@@ -56,7 +56,7 @@
     m.title = @"";
     m.firstname = @"";
     m.lastname = @"";
-    m.street = @"";
+    m.street = @[@""];
     m.postcode = @"";
     m.city = @"";
 //    m.region = @"";

+ 3 - 0
Asteria/NetTools/ASNetApis.h

@@ -29,6 +29,9 @@
 #define ProductImgPath @"/media/catalog/product"
 #define CategoryImgPath @"/media/catalog/category/"
 
+/// 国家列表
+#define CountryList BaseRequestrUrl(@"directory/countries")
+
 // MARK: - 商品列表
 #define getProductListUrl BaseRequestrUrl(@"rewrite/categories/%@/products")
 

+ 2 - 0
Asteria/Product/CTMediatoaTargets/CTMediator+ASTargerts.h

@@ -29,6 +29,8 @@ NS_ASSUME_NONNULL_BEGIN
 
 
 
+-(UIViewController *)Goods_WriteReview:(NSDictionary *)params;
+
 
 
 @end

+ 4 - 0
Asteria/Product/CTMediatoaTargets/CTMediator+ASTargerts.m

@@ -24,6 +24,10 @@
     return [self performTarget:@"Goods" action:@"AS_GoodsSizeC" params:params shouldCacheTarget:NO];
 }
 
+-(UIViewController *)Goods_WriteReview:(NSDictionary *)params{
+    return [self performTarget:@"Goods" action:@"WriteReview" params:params shouldCacheTarget:NO];
+}
+
 
 -(UIViewController*)Cart_MyCartC:(NSDictionary *)params{
     return [self performTarget:@"Cart" action:@"Cart_MyCartC" params:params shouldCacheTarget:NO];