Explorar o código

个人中心订单列表对接

Abel hai 1 ano
pai
achega
e4757082c2
Modificáronse 28 ficheiros con 1928 adicións e 1744 borrados
  1. 6 0
      Asteria.xcodeproj/project.pbxproj
  2. 0 1
      Asteria/AppDelegate.m
  3. 27 5
      Asteria/Base.lproj/LaunchScreen.storyboard
  4. 5 5
      Asteria/Fuction/Category/vc/ASSearchViewController.m
  5. 32 18
      Asteria/Fuction/Home/ASHomeViewController.m
  6. 11 6
      Asteria/Fuction/Home/ASProductListViewController.m
  7. 5 0
      Asteria/Fuction/Home/Views/ASHomeActiveView.h
  8. 17 1
      Asteria/Fuction/Home/Views/ASHomeActiveView.m
  9. 2 1
      Asteria/Fuction/Home/Views/productList/ASProductListActiveHeaderView.h
  10. 6 0
      Asteria/Fuction/Home/Views/productList/ASProductListActiveHeaderView.m
  11. 5 0
      Asteria/Fuction/Home/vm/ASProductListViewModel.h
  12. 15 0
      Asteria/Fuction/Home/vm/ASProductListViewModel.m
  13. 1 1
      Asteria/Fuction/UserCenter/Points/ASPointsHomeViewController.m
  14. 27 48
      Asteria/Fuction/UserCenter/Setting/ASSettingViewController.m
  15. 24 10
      Asteria/Fuction/UserCenter/UserCenterHome/ASUserCenterViewController.m
  16. 19 0
      Asteria/Fuction/UserCenter/UserCenterHome/ASUserCenterViewModel.h
  17. 36 0
      Asteria/Fuction/UserCenter/UserCenterHome/ASUserCenterViewModel.m
  18. 12 10
      Asteria/Fuction/UserCenter/UserCenterHome/models/KWMineHomeOrderModel.h
  19. 14 2
      Asteria/Fuction/UserCenter/UserCenterHome/models/KWMineHomeOrderModel.m
  20. 11 11
      Asteria/Fuction/UserCenter/UserCenterHome/views/KWMineHomeOrderListCell.m
  21. 5 4
      Asteria/Fuction/UserCenter/UserCenterHome/views/KWMineHomeOrderSubView.m
  22. 7 3
      Asteria/NetTools/ASNetApis.h
  23. 2 2
      Asteria/NetTools/ASNetTools.m
  24. 1 1
      Podfile.lock
  25. 1 1
      Pods/MKNetworkKit/MKNetworkKit/MKNetworkOperation.m
  26. 1 1
      Pods/Manifest.lock
  27. 1635 1612
      Pods/Pods.xcodeproj/project.pbxproj
  28. 1 1
      Pods/Target Support Files/Pods-Asteria/Pods-Asteria-frameworks.sh

+ 6 - 0
Asteria.xcodeproj/project.pbxproj

@@ -60,6 +60,7 @@
 		814F5D0F2A11B76F003847A9 /* Roboto-Bold.ttf in Resources */ = {isa = PBXBuildFile; fileRef = 814F5D022A11B76F003847A9 /* Roboto-Bold.ttf */; };
 		814F5D0F2A11B76F003847A9 /* Roboto-Bold.ttf in Resources */ = {isa = PBXBuildFile; fileRef = 814F5D022A11B76F003847A9 /* Roboto-Bold.ttf */; };
 		814F5D102A11B76F003847A9 /* Roboto-Thin.ttf in Resources */ = {isa = PBXBuildFile; fileRef = 814F5D032A11B76F003847A9 /* Roboto-Thin.ttf */; };
 		814F5D102A11B76F003847A9 /* Roboto-Thin.ttf in Resources */ = {isa = PBXBuildFile; fileRef = 814F5D032A11B76F003847A9 /* Roboto-Thin.ttf */; };
 		814F5D112A11B76F003847A9 /* Roboto-Black.ttf in Resources */ = {isa = PBXBuildFile; fileRef = 814F5D042A11B76F003847A9 /* Roboto-Black.ttf */; };
 		814F5D112A11B76F003847A9 /* Roboto-Black.ttf in Resources */ = {isa = PBXBuildFile; fileRef = 814F5D042A11B76F003847A9 /* Roboto-Black.ttf */; };
+		815970BA2B54DC830073041D /* ASUserCenterViewModel.m in Sources */ = {isa = PBXBuildFile; fileRef = 815970B92B54DC830073041D /* ASUserCenterViewModel.m */; };
 		815DA3D92A39575100616EF7 /* ASProductListImageCell.m in Sources */ = {isa = PBXBuildFile; fileRef = 815DA3D82A39575100616EF7 /* ASProductListImageCell.m */; };
 		815DA3D92A39575100616EF7 /* ASProductListImageCell.m in Sources */ = {isa = PBXBuildFile; fileRef = 815DA3D82A39575100616EF7 /* ASProductListImageCell.m */; };
 		815DA3DC2A39625200616EF7 /* ASProductListTypeDesCell.m in Sources */ = {isa = PBXBuildFile; fileRef = 815DA3DB2A39625200616EF7 /* ASProductListTypeDesCell.m */; };
 		815DA3DC2A39625200616EF7 /* ASProductListTypeDesCell.m in Sources */ = {isa = PBXBuildFile; fileRef = 815DA3DB2A39625200616EF7 /* ASProductListTypeDesCell.m */; };
 		815DA3DF2A396BD300616EF7 /* ASMoreBtCell.m in Sources */ = {isa = PBXBuildFile; fileRef = 815DA3DE2A396BD300616EF7 /* ASMoreBtCell.m */; };
 		815DA3DF2A396BD300616EF7 /* ASMoreBtCell.m in Sources */ = {isa = PBXBuildFile; fileRef = 815DA3DE2A396BD300616EF7 /* ASMoreBtCell.m */; };
@@ -376,6 +377,8 @@
 		814F5D022A11B76F003847A9 /* Roboto-Bold.ttf */ = {isa = PBXFileReference; lastKnownFileType = file; path = "Roboto-Bold.ttf"; sourceTree = "<group>"; };
 		814F5D022A11B76F003847A9 /* Roboto-Bold.ttf */ = {isa = PBXFileReference; lastKnownFileType = file; path = "Roboto-Bold.ttf"; sourceTree = "<group>"; };
 		814F5D032A11B76F003847A9 /* Roboto-Thin.ttf */ = {isa = PBXFileReference; lastKnownFileType = file; path = "Roboto-Thin.ttf"; sourceTree = "<group>"; };
 		814F5D032A11B76F003847A9 /* Roboto-Thin.ttf */ = {isa = PBXFileReference; lastKnownFileType = file; path = "Roboto-Thin.ttf"; sourceTree = "<group>"; };
 		814F5D042A11B76F003847A9 /* Roboto-Black.ttf */ = {isa = PBXFileReference; lastKnownFileType = file; path = "Roboto-Black.ttf"; sourceTree = "<group>"; };
 		814F5D042A11B76F003847A9 /* Roboto-Black.ttf */ = {isa = PBXFileReference; lastKnownFileType = file; path = "Roboto-Black.ttf"; sourceTree = "<group>"; };
+		815970B82B54DC830073041D /* ASUserCenterViewModel.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = ASUserCenterViewModel.h; sourceTree = "<group>"; };
+		815970B92B54DC830073041D /* ASUserCenterViewModel.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = ASUserCenterViewModel.m; sourceTree = "<group>"; };
 		815DA3D72A39575100616EF7 /* ASProductListImageCell.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = ASProductListImageCell.h; sourceTree = "<group>"; };
 		815DA3D72A39575100616EF7 /* ASProductListImageCell.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = ASProductListImageCell.h; sourceTree = "<group>"; };
 		815DA3D82A39575100616EF7 /* ASProductListImageCell.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = ASProductListImageCell.m; sourceTree = "<group>"; };
 		815DA3D82A39575100616EF7 /* ASProductListImageCell.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = ASProductListImageCell.m; sourceTree = "<group>"; };
 		815DA3DA2A39625200616EF7 /* ASProductListTypeDesCell.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = ASProductListTypeDesCell.h; sourceTree = "<group>"; };
 		815DA3DA2A39625200616EF7 /* ASProductListTypeDesCell.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = ASProductListTypeDesCell.h; sourceTree = "<group>"; };
@@ -794,6 +797,8 @@
 			children = (
 			children = (
 				814F5CED2A11B1F2003847A9 /* ASUserCenterViewController.h */,
 				814F5CED2A11B1F2003847A9 /* ASUserCenterViewController.h */,
 				814F5CEE2A11B1F2003847A9 /* ASUserCenterViewController.m */,
 				814F5CEE2A11B1F2003847A9 /* ASUserCenterViewController.m */,
+				815970B82B54DC830073041D /* ASUserCenterViewModel.h */,
+				815970B92B54DC830073041D /* ASUserCenterViewModel.m */,
 				8120211F2B16CD630026B8B5 /* ASSginViewModel.h */,
 				8120211F2B16CD630026B8B5 /* ASSginViewModel.h */,
 				812021202B16CD630026B8B5 /* ASSginViewModel.m */,
 				812021202B16CD630026B8B5 /* ASSginViewModel.m */,
 				81354BEF2A287B040082C93A /* models */,
 				81354BEF2A287B040082C93A /* models */,
@@ -2451,6 +2456,7 @@
 				8160200A2A2DD59E00E4A8F1 /* CTMediator+Home.m in Sources */,
 				8160200A2A2DD59E00E4A8F1 /* CTMediator+Home.m in Sources */,
 				81717C9C2A3BF1F100648139 /* ASHomeAlertViewController.m in Sources */,
 				81717C9C2A3BF1F100648139 /* ASHomeAlertViewController.m in Sources */,
 				9AD345FC2A08D60F005CA070 /* ZFPlayerLogManager.m in Sources */,
 				9AD345FC2A08D60F005CA070 /* ZFPlayerLogManager.m in Sources */,
+				815970BA2B54DC830073041D /* ASUserCenterViewModel.m in Sources */,
 				816D0C9D2AF3988400395B5B /* ASGiftCardAvailabelCell.m in Sources */,
 				816D0C9D2AF3988400395B5B /* ASGiftCardAvailabelCell.m in Sources */,
 				8120211B2B15F03B0026B8B5 /* ASVipModel.m in Sources */,
 				8120211B2B15F03B0026B8B5 /* ASVipModel.m in Sources */,
 				81354C0E2A297D6A0082C93A /* HomeFlashDealSubCollectCell.m in Sources */,
 				81354C0E2A297D6A0082C93A /* HomeFlashDealSubCollectCell.m in Sources */,

+ 0 - 1
Asteria/AppDelegate.m

@@ -37,7 +37,6 @@
         [ASUserInfoManager.shared getInfo];
         [ASUserInfoManager.shared getInfo];
     }
     }
     [self.window makeKeyAndVisible];
     [self.window makeKeyAndVisible];
-    [UIApplication.sharedApplication setNetworkActivityIndicatorVisible:true];
     
     
     return YES;
     return YES;
 }
 }

+ 27 - 5
Asteria/Base.lproj/LaunchScreen.storyboard

@@ -1,8 +1,11 @@
-<?xml version="1.0" encoding="UTF-8" standalone="no"?>
-<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="13122.16" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" launchScreen="YES" useTraitCollections="YES" useSafeAreas="YES" colorMatched="YES" initialViewController="01J-lp-oVM">
+<?xml version="1.0" encoding="UTF-8"?>
+<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="22154" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" launchScreen="YES" useTraitCollections="YES" useSafeAreas="YES" colorMatched="YES" initialViewController="01J-lp-oVM">
+    <device id="retina6_12" orientation="portrait" appearance="light"/>
     <dependencies>
     <dependencies>
-        <plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="13104.12"/>
+        <deployment identifier="iOS"/>
+        <plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="22130"/>
         <capability name="Safe area layout guides" minToolsVersion="9.0"/>
         <capability name="Safe area layout guides" minToolsVersion="9.0"/>
+        <capability name="System colors in document resources" minToolsVersion="11.0"/>
         <capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
         <capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
     </dependencies>
     </dependencies>
     <scenes>
     <scenes>
@@ -11,10 +14,23 @@
             <objects>
             <objects>
                 <viewController id="01J-lp-oVM" sceneMemberID="viewController">
                 <viewController id="01J-lp-oVM" sceneMemberID="viewController">
                     <view key="view" contentMode="scaleToFill" id="Ze5-6b-2t3">
                     <view key="view" contentMode="scaleToFill" id="Ze5-6b-2t3">
-                        <rect key="frame" x="0.0" y="0.0" width="375" height="667"/>
+                        <rect key="frame" x="0.0" y="0.0" width="393" height="852"/>
                         <autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
                         <autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
-                        <color key="backgroundColor" xcode11CocoaTouchSystemColor="systemBackgroundColor" cocoaTouchSystemColor="whiteColor"/>
+                        <subviews>
+                            <imageView clipsSubviews="YES" userInteractionEnabled="NO" contentMode="scaleAspectFit" horizontalHuggingPriority="251" verticalHuggingPriority="251" image="name_icon" translatesAutoresizingMaskIntoConstraints="NO" id="bvj-bw-8Dw">
+                                <rect key="frame" x="30" y="413.66666666666669" width="333" height="50"/>
+                                <constraints>
+                                    <constraint firstAttribute="height" constant="50" id="xG0-e1-KdJ"/>
+                                </constraints>
+                            </imageView>
+                        </subviews>
                         <viewLayoutGuide key="safeArea" id="6Tk-OE-BBY"/>
                         <viewLayoutGuide key="safeArea" id="6Tk-OE-BBY"/>
+                        <color key="backgroundColor" systemColor="systemBackgroundColor"/>
+                        <constraints>
+                            <constraint firstItem="bvj-bw-8Dw" firstAttribute="leading" secondItem="6Tk-OE-BBY" secondAttribute="leading" constant="30" id="MdZ-CY-jgd"/>
+                            <constraint firstItem="bvj-bw-8Dw" firstAttribute="centerX" secondItem="6Tk-OE-BBY" secondAttribute="centerX" id="Yeu-Fd-XGh"/>
+                            <constraint firstItem="bvj-bw-8Dw" firstAttribute="centerY" secondItem="6Tk-OE-BBY" secondAttribute="centerY" id="fgO-Lg-Sw5"/>
+                        </constraints>
                     </view>
                     </view>
                 </viewController>
                 </viewController>
                 <placeholder placeholderIdentifier="IBFirstResponder" id="iYj-Kq-Ea1" userLabel="First Responder" sceneMemberID="firstResponder"/>
                 <placeholder placeholderIdentifier="IBFirstResponder" id="iYj-Kq-Ea1" userLabel="First Responder" sceneMemberID="firstResponder"/>
@@ -22,4 +38,10 @@
             <point key="canvasLocation" x="53" y="375"/>
             <point key="canvasLocation" x="53" y="375"/>
         </scene>
         </scene>
     </scenes>
     </scenes>
+    <resources>
+        <image name="name_icon" width="198.66667175292969" height="45"/>
+        <systemColor name="systemBackgroundColor">
+            <color white="1" alpha="1" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
+        </systemColor>
+    </resources>
 </document>
 </document>

+ 5 - 5
Asteria/Fuction/Category/vc/ASSearchViewController.m

@@ -105,13 +105,13 @@
         }];
         }];
         [v setHotCallBack:^(KWSearchHotKeyModel * _Nonnull hot) {
         [v setHotCallBack:^(KWSearchHotKeyModel * _Nonnull hot) {
             NSString *word = hot.title;
             NSString *word = hot.title;
-//            if ([hot.type isEqualToString:@"1"]) {
+            if (hot.code != nil && ![hot.code isEqualToString:@""]) {
                 [self.hisWordV.vm addSearchData:word];
                 [self.hisWordV.vm addSearchData:word];
                 [weak_self toResult:word type:hot.code keyWord:@""];
                 [weak_self toResult:word type:hot.code keyWord:@""];
-//                return;
-//            }
-//            [self.hisWordV.vm addSearchData:word];
-//            [weak_self toResult:word type:@"" keyWord:word];
+                return;
+            }
+            [self.hisWordV.vm addSearchData:word];
+            [weak_self toResult:word type:@"" keyWord:word];
         }];
         }];
         _hisWordV = v;
         _hisWordV = v;
     }
     }

+ 32 - 18
Asteria/Fuction/Home/ASHomeViewController.m

@@ -16,13 +16,15 @@
 #import "ASHomeLookingCell.h"
 #import "ASHomeLookingCell.h"
 #import "ASHomeActiveView.h"
 #import "ASHomeActiveView.h"
 #import "ASProductListViewController.h"
 #import "ASProductListViewController.h"
+#import "ASProductListViewModel.h"
 
 
 @interface ASHomeViewController ()<UITableViewDelegate,UITableViewDataSource>
 @interface ASHomeViewController ()<UITableViewDelegate,UITableViewDataSource>
 
 
+@property (nonatomic, strong) ASProductListViewModel *topVm;
+
 @property (nonatomic, strong) UITableView *tableV;
 @property (nonatomic, strong) UITableView *tableV;
 @property (nonatomic, strong) NSArray <ASHomeMainListModel*>*listArr;
 @property (nonatomic, strong) NSArray <ASHomeMainListModel*>*listArr;
 
 
-@property (nonatomic, strong) NSArray <ASHomeBannerModel *>*topLinkArr;
 @property (nonatomic, strong, nullable) ASHomeActiveView *activeV;
 @property (nonatomic, strong, nullable) ASHomeActiveView *activeV;
 
 
 @end
 @end
@@ -32,21 +34,40 @@
 - (void)viewDidLoad {
 - (void)viewDidLoad {
     [super viewDidLoad];
     [super viewDidLoad];
     
     
+    self.topVm = [ASProductListViewModel new];
+    
     __block typeof(self) wSelf = self;
     __block typeof(self) wSelf = self;
     [self ucHomeStyle:^{
     [self ucHomeStyle:^{
         // TODO: 跳转搜索模块
         // TODO: 跳转搜索模块
     }];
     }];
     [self addSubV];
     [self addSubV];
     [self demoData];
     [self demoData];
-    [self.tableV reloadData];
+    [self.tableV.mj_header beginRefreshing];
+    
+    [self updateTopLinkData];
+}
+
+
+- (void)demoData {
+    _listArr = [ASHomeMainListModel homeDemoDatas];
     
     
-    if (self.topLinkArr.count > 0) {
+}
+
+- (void)getTopLinkData {
+    __weak typeof(self) weakSelf = self;
+    [self.topVm getTopLinkList:^{
+        [weakSelf updateTopLinkData];
+    }];
+}
+
+- (void)updateTopLinkData {
+    if (self.topVm.topLinks.count > 0) {
         self.activeV = [[ASHomeActiveView alloc] initWithFrame:CGRectZero];
         self.activeV = [[ASHomeActiveView alloc] initWithFrame:CGRectZero];
-        self.activeV.tapBlock = ^(ASHomeBannerModel * _Nullable m) {
-            
-        };
+        [self.activeV setTapTopBlock:^(KWSearchHotKeyModel * _Nullable m) {
+            NSLog(@"---toplink:-%@--", m.code);
+        }];
         self.tableV.tableHeaderView = self.activeV;
         self.tableV.tableHeaderView = self.activeV;
-        [self.activeV setData:self.topLinkArr];
+        [self.activeV setTopData:self.topVm.topLinks];
         
         
     } else {
     } else {
         self.activeV.tapBlock = nil;
         self.activeV.tapBlock = nil;
@@ -55,17 +76,6 @@
     }
     }
 }
 }
 
 
-
-- (void)demoData {
-    _listArr = [ASHomeMainListModel homeDemoDatas];
-    NSMutableArray *tempArr = [NSMutableArray array];
-    for (int i=0;i < (arc4random()%6); i++) {
-        ASHomeBannerModel *m = [ASHomeBannerModel demoModelWithType:i%3+1];
-        [tempArr addObject:m];
-    }
-    self.topLinkArr = tempArr;
-}
-
 - (void)addSubV {
 - (void)addSubV {
     [self.view addSubview:self.tableV];
     [self.view addSubview:self.tableV];
     [self.tableV mas_makeConstraints:^(MASConstraintMaker *make) {
     [self.tableV mas_makeConstraints:^(MASConstraintMaker *make) {
@@ -73,8 +83,12 @@
         make.leading.trailing.equalTo(self.view);
         make.leading.trailing.equalTo(self.view);
         make.bottom.equalTo(self.view);
         make.bottom.equalTo(self.view);
     }];
     }];
+    __weak typeof(self) weakSelf = self;
     self.tableV.mj_header = [MJRefreshNormalHeader headerWithRefreshingBlock:^{
     self.tableV.mj_header = [MJRefreshNormalHeader headerWithRefreshingBlock:^{
+        [weakSelf getTopLinkData];
+        
         dispatch_after(dispatch_time(DISPATCH_TIME_NOW, 1), dispatch_get_main_queue(), ^{
         dispatch_after(dispatch_time(DISPATCH_TIME_NOW, 1), dispatch_get_main_queue(), ^{
+            
             [self.tableV.mj_header endRefreshing];
             [self.tableV.mj_header endRefreshing];
             [self.tableV reloadData];
             [self.tableV reloadData];
         });
         });

+ 11 - 6
Asteria/Fuction/Home/ASProductListViewController.m

@@ -18,8 +18,6 @@
 
 
 @interface ASProductListViewController ()<UICollectionViewDelegate, UICollectionViewDataSource, UICollectionViewDelegateFlowLayout>
 @interface ASProductListViewController ()<UICollectionViewDelegate, UICollectionViewDataSource, UICollectionViewDelegateFlowLayout>
 
 
-@property (nonatomic, strong) NSArray <ASHomeBannerModel *>*topLinkArr;
-
 @property (nonatomic, assign) BOOL desMoreOpen;
 @property (nonatomic, assign) BOOL desMoreOpen;
 @property (nonatomic, assign) BOOL canShowMoreBt;
 @property (nonatomic, assign) BOOL canShowMoreBt;
 
 
@@ -174,7 +172,7 @@
         ASHomeBannerModel *m = [ASHomeBannerModel demoModelWithType:i%3+1];
         ASHomeBannerModel *m = [ASHomeBannerModel demoModelWithType:i%3+1];
         [tempArr addObject:m];
         [tempArr addObject:m];
     }
     }
-    self.topLinkArr = tempArr;
+//    self.topLinkArr = tempArr;
     
     
     [self.collectV reloadData];
     [self.collectV reloadData];
 }
 }
@@ -255,7 +253,7 @@
 - (CGSize)collectionView:(UICollectionView *)collectionView layout:(UICollectionViewLayout *)collectionViewLayout referenceSizeForHeaderInSection:(NSInteger)section {
 - (CGSize)collectionView:(UICollectionView *)collectionView layout:(UICollectionViewLayout *)collectionViewLayout referenceSizeForHeaderInSection:(NSInteger)section {
     if (section == 0) {
     if (section == 0) {
         CGSize size = CGSizeZero;
         CGSize size = CGSizeZero;
-        if (self.topLinkArr.count > 0) {
+        if (self.vm.topLinks.count > 0) {
             size = CGSizeMake(KScreenWidth, 40);
             size = CGSizeMake(KScreenWidth, 40);
         }
         }
         return size;
         return size;
@@ -269,8 +267,8 @@
 - (UICollectionReusableView *)collectionView:(UICollectionView *)collectionView viewForSupplementaryElementOfKind:(NSString *)kind atIndexPath:(NSIndexPath *)indexPath {
 - (UICollectionReusableView *)collectionView:(UICollectionView *)collectionView viewForSupplementaryElementOfKind:(NSString *)kind atIndexPath:(NSIndexPath *)indexPath {
     if (indexPath.section == 0 && [kind isEqualToString:UICollectionElementKindSectionHeader]) {
     if (indexPath.section == 0 && [kind isEqualToString:UICollectionElementKindSectionHeader]) {
         ASProductListActiveHeaderView *v = [collectionView dequeueReusableSupplementaryViewOfKind:UICollectionElementKindSectionHeader withReuseIdentifier:@"ASProductListActiveHeaderView" forIndexPath:indexPath];
         ASProductListActiveHeaderView *v = [collectionView dequeueReusableSupplementaryViewOfKind:UICollectionElementKindSectionHeader withReuseIdentifier:@"ASProductListActiveHeaderView" forIndexPath:indexPath];
-        [v setData:self.topLinkArr tapBlock:^(ASHomeBannerModel * _Nullable m) {
-            
+        [v setTopLinkData:self.vm.topLinks tapBlock:^(KWSearchHotKeyModel * _Nullable m) {
+            NSLog(@"---toplink:-%@--", m.code);
         }];
         }];
         return v;
         return v;
     }
     }
@@ -462,6 +460,13 @@
     [MBProgressHUD showHUDAddedTo:self.view animated:true];
     [MBProgressHUD showHUDAddedTo:self.view animated:true];
     
     
     __weak typeof(self) weakSelf = self;
     __weak typeof(self) weakSelf = self;
+    [self.vm getTopLinkList:^{
+        [weakSelf.collectV reloadData];
+    }];
+    
+    
+    
+    
     [self.vm getProductListData:self.type page:self.page orderBy:self.currentSortType dir:@"DESC" com:^(BOOL hasNext, NSString * _Nonnull msg) {
     [self.vm getProductListData:self.type page:self.page orderBy:self.currentSortType dir:@"DESC" com:^(BOOL hasNext, NSString * _Nonnull msg) {
         [MBProgressHUD hideHUDForView:weakSelf.view animated:true];
         [MBProgressHUD hideHUDForView:weakSelf.view animated:true];
         [weakSelf.collectV.mj_header endRefreshing];
         [weakSelf.collectV.mj_header endRefreshing];

+ 5 - 0
Asteria/Fuction/Home/Views/ASHomeActiveView.h

@@ -7,6 +7,7 @@
 
 
 #import <UIKit/UIKit.h>
 #import <UIKit/UIKit.h>
 #import "ASHomeBannerModel.h"
 #import "ASHomeBannerModel.h"
+#import "KWSearchSubTypeModel.h"
 
 
 NS_ASSUME_NONNULL_BEGIN
 NS_ASSUME_NONNULL_BEGIN
 
 
@@ -16,6 +17,10 @@ NS_ASSUME_NONNULL_BEGIN
 
 
 - (void)setData:(NSArray <ASHomeBannerModel *>*)arr;
 - (void)setData:(NSArray <ASHomeBannerModel *>*)arr;
 
 
+@property (nonatomic, copy, nullable) void(^tapTopBlock)(KWSearchHotKeyModel * _Nullable m);
+
+- (void)setTopData:(NSArray <KWSearchHotKeyModel *>*)arr;
+
 @end
 @end
 
 
 NS_ASSUME_NONNULL_END
 NS_ASSUME_NONNULL_END

+ 17 - 1
Asteria/Fuction/Home/Views/ASHomeActiveView.m

@@ -15,6 +15,8 @@
 
 
 @property (nonatomic, strong) NSArray <ASHomeBannerModel *>*topLinkModels;
 @property (nonatomic, strong) NSArray <ASHomeBannerModel *>*topLinkModels;
 
 
+@property (nonatomic, strong) NSArray <KWSearchHotKeyModel *>*topKeyModels;
+
 @end
 @end
 
 
 @implementation ASHomeActiveView
 @implementation ASHomeActiveView
@@ -28,6 +30,15 @@
     self.rollingV.sxArry = tempArr;
     self.rollingV.sxArry = tempArr;
 }
 }
 
 
+- (void)setTopData:(NSArray <KWSearchHotKeyModel *>*)arr; {
+    self.topKeyModels = arr;
+    NSMutableArray *tempArr = [NSMutableArray array];
+    for (KWSearchHotKeyModel *m in self.topKeyModels) {
+        [tempArr addObject:m.title];
+    }
+    self.rollingV.sxArry = tempArr;
+}
+
 - (instancetype)initWithFrame:(CGRect)frame {
 - (instancetype)initWithFrame:(CGRect)frame {
     self = [super initWithFrame:CGRectMake(0, 0, KScreenWidth, 40)];
     self = [super initWithFrame:CGRectMake(0, 0, KScreenWidth, 40)];
     if (self) {
     if (self) {
@@ -77,7 +88,12 @@
             ASHomeBannerModel * m = self.topLinkModels[self.rollingV.arrNum];
             ASHomeBannerModel * m = self.topLinkModels[self.rollingV.arrNum];
             self.tapBlock(m);
             self.tapBlock(m);
         }
         }
-        
+    }
+    if (self.topKeyModels.count > 0 && self.rollingV.arrNum < self.topKeyModels.count) {
+        if (self.tapBlock) {
+            KWSearchHotKeyModel * m = self.topKeyModels[self.rollingV.arrNum];
+            self.tapTopBlock(m);
+        }
     }
     }
 //        HomeBanerModel * m = self.vm.topLinkModels[self.topLinkV.arrNum];
 //        HomeBanerModel * m = self.vm.topLinkModels[self.topLinkV.arrNum];
 //        if (m.type == 1) {
 //        if (m.type == 1) {

+ 2 - 1
Asteria/Fuction/Home/Views/productList/ASProductListActiveHeaderView.h

@@ -7,12 +7,13 @@
 
 
 #import <UIKit/UIKit.h>
 #import <UIKit/UIKit.h>
 #import "ASHomeActiveView.h"
 #import "ASHomeActiveView.h"
+#import "KWSearchSubTypeModel.h"
 
 
 NS_ASSUME_NONNULL_BEGIN
 NS_ASSUME_NONNULL_BEGIN
 
 
 @interface ASProductListActiveHeaderView : UICollectionReusableView
 @interface ASProductListActiveHeaderView : UICollectionReusableView
 
 
-
+- (void)setTopLinkData:(NSArray <KWSearchHotKeyModel *>*)arr tapBlock: (void(^)(KWSearchHotKeyModel * _Nullable m))tapBlock;
 
 
 - (void)setData:(NSArray <ASHomeBannerModel *>*)arr tapBlock: (void(^)(ASHomeBannerModel * _Nullable m))tapBlock;
 - (void)setData:(NSArray <ASHomeBannerModel *>*)arr tapBlock: (void(^)(ASHomeBannerModel * _Nullable m))tapBlock;
 
 

+ 6 - 0
Asteria/Fuction/Home/Views/productList/ASProductListActiveHeaderView.m

@@ -32,6 +32,10 @@
     }];
     }];
 }
 }
 
 
+- (void)setTopLinkData:(NSArray <KWSearchHotKeyModel *>*)arr tapBlock: (void(^)(KWSearchHotKeyModel * _Nullable m))tapBlock {
+    self.activeV.tapTopBlock = tapBlock;
+    [self.activeV setTopData:arr];
+}
 
 
 - (void)setData:(NSArray <ASHomeBannerModel *>*)arr tapBlock: (void(^)(ASHomeBannerModel * _Nullable m))tapBlock {
 - (void)setData:(NSArray <ASHomeBannerModel *>*)arr tapBlock: (void(^)(ASHomeBannerModel * _Nullable m))tapBlock {
     self.activeV.tapBlock = tapBlock;
     self.activeV.tapBlock = tapBlock;
@@ -46,4 +50,6 @@
     return _activeV;
     return _activeV;
 }
 }
 
 
+
+
 @end
 @end

+ 5 - 0
Asteria/Fuction/Home/vm/ASProductListViewModel.h

@@ -9,11 +9,14 @@
 #import "ASProductBaseModel.h"
 #import "ASProductBaseModel.h"
 #import "KWProductListFilterModel.h"
 #import "KWProductListFilterModel.h"
 #import "ASProductListCategoryModel.h"
 #import "ASProductListCategoryModel.h"
+#import "KWSearchSubTypeModel.h"
 
 
 NS_ASSUME_NONNULL_BEGIN
 NS_ASSUME_NONNULL_BEGIN
 
 
 @interface ASProductListViewModel : NSObject
 @interface ASProductListViewModel : NSObject
 
 
+
+@property (nonatomic, strong) NSArray <KWSearchHotKeyModel *> *topLinks;
 @property (nonatomic, strong) NSArray <ASProductBaseModel *> *productList;
 @property (nonatomic, strong) NSArray <ASProductBaseModel *> *productList;
 @property (nonatomic, strong) ASProductListCategoryModel *cateModel;
 @property (nonatomic, strong) ASProductListCategoryModel *cateModel;
 
 
@@ -25,6 +28,8 @@ NS_ASSUME_NONNULL_BEGIN
 
 
 - (void)getPoint:(NSString *)pointType com:(void(^)(BOOL isSuc, NSString *msg))com;
 - (void)getPoint:(NSString *)pointType com:(void(^)(BOOL isSuc, NSString *msg))com;
 
 
+-(void)getTopLinkList:(btnClickBlock)success;
+
 @end
 @end
 
 
 NS_ASSUME_NONNULL_END
 NS_ASSUME_NONNULL_END

+ 15 - 0
Asteria/Fuction/Home/vm/ASProductListViewModel.m

@@ -104,4 +104,19 @@
     }];
     }];
 }
 }
 
 
+-(void)getTopLinkList:(btnClickBlock)success {
+    __weak typeof(self) weakSelf = self;
+    [ASNetTools.shared getWithPath:getHotList param:@{@"type":@"banner"} success:^(id _Nonnull json) {
+        NSLog(@"------url:%@---json:%@------", getHotList, json);
+        NSArray *arr = [KWSearchHotKeyModel mj_objectArrayWithKeyValuesArray:json];
+        weakSelf.topLinks = arr;
+        success();
+    } faild:^(NSString * _Nonnull code, NSString * _Nonnull msg) {
+        NSLog(@"------url:%@---code:%@---msg:%@---", getHotList, code, msg);
+        weakSelf.topLinks = @[];
+        success();
+    }];
+}
+
+
 @end
 @end

+ 1 - 1
Asteria/Fuction/UserCenter/Points/ASPointsHomeViewController.m

@@ -52,7 +52,7 @@
     [self.headV setRuleCallBack:^{
     [self.headV setRuleCallBack:^{
         UIViewController *vc = [CTMediator.sharedInstance getWebViewVc:@{
         UIViewController *vc = [CTMediator.sharedInstance getWebViewVc:@{
             @"title":@"Points Rules",
             @"title":@"Points Rules",
-            @"url":@"https://baidu.com"
+            @"url":PointRuleWebUrl,
         }];
         }];
         [weakSelf.navigationController pushViewController:vc animated:true];
         [weakSelf.navigationController pushViewController:vc animated:true];
         
         

+ 27 - 48
Asteria/Fuction/UserCenter/Setting/ASSettingViewController.m

@@ -9,7 +9,6 @@
 #import "ASSettingListCell.h"
 #import "ASSettingListCell.h"
 #import "ASInfomationSetController.h"
 #import "ASInfomationSetController.h"
 #import "ASHelpListViewController.h"
 #import "ASHelpListViewController.h"
-#import "AppDelegate.h"
 
 
 @interface ASSettingViewController () <UITableViewDelegate,UITableViewDataSource>
 @interface ASSettingViewController () <UITableViewDelegate,UITableViewDataSource>
 
 
@@ -20,7 +19,6 @@
 @property (nonatomic, strong) NSArray *titleArr;
 @property (nonatomic, strong) NSArray *titleArr;
 @property (nonatomic, strong) NSArray *detailArr;
 @property (nonatomic, strong) NSArray *detailArr;
 
 
-//@property (nonatomic, strong) KWLoginedUserModel *userInfo;
 
 
 @end
 @end
 
 
@@ -38,19 +36,11 @@
     
     
     [self loadSubVs];
     [self loadSubVs];
     
     
-//    [self configData];
 }
 }
 
 
 - (void)viewWillAppear:(BOOL)animated {
 - (void)viewWillAppear:(BOOL)animated {
     [super viewWillAppear:animated];
     [super viewWillAppear:animated];
-    
-//    self.userInfo = [KWLoginedManager.shareInstance getCurrentLoginedUser];
     [self configData];
     [self configData];
-//    @weakify(self);
-//    [KWLoginedManager.shareInstance getUserInfo:^(bool flag) {
-//        weak_self.userInfo = [KWLoginedManager.shareInstance getCurrentLoginedUser];
-//        [weak_self configData];
-//    }];
 }
 }
 
 
 - (void)configData {
 - (void)configData {
@@ -153,9 +143,6 @@
 - (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath {
 - (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath {
     switch (indexPath.row) {
     switch (indexPath.row) {
         case 0:{
         case 0:{
-//            if (![self checkLogin:true]) {
-//                return;
-//            }
             ASInfomationSetController *vc = [ASInfomationSetController new];
             ASInfomationSetController *vc = [ASInfomationSetController new];
             [self.navigationController pushViewController:vc animated:true];
             [self.navigationController pushViewController:vc animated:true];
             break;
             break;
@@ -186,7 +173,7 @@
             break;
             break;
         }
         }
         case 6: {
         case 6: {
-//            [self showDeleteAccountAlert];
+            [self showDeleteAccountAlert];
             break;
             break;
         }
         }
         default:
         default:
@@ -202,8 +189,7 @@
    
    
     ASSettingListCell *cell = [tableView dequeueReusableCellWithIdentifier:@"ASSettingListCell" forIndexPath:indexPath];
     ASSettingListCell *cell = [tableView dequeueReusableCellWithIdentifier:@"ASSettingListCell" forIndexPath:indexPath];
     [cell setTitle:self.titleArr[indexPath.row] points:self.detailArr[indexPath.row] enable:true];
     [cell setTitle:self.titleArr[indexPath.row] points:self.detailArr[indexPath.row] enable:true];
-    if (//KWLoginedManager.shareInstance.isLogined &&
-        ((indexPath.row == _titleArr.count - 1) || (indexPath.row == _titleArr.count - 2))) {
+    if (((indexPath.row == _titleArr.count - 1) || (indexPath.row == _titleArr.count - 2))) {
         cell.moreIcon.hidden = true;
         cell.moreIcon.hidden = true;
     } else  {
     } else  {
         cell.moreIcon.hidden = false;
         cell.moreIcon.hidden = false;
@@ -228,11 +214,11 @@
     [MBProgressHUD showHUDAddedTo:self.view animated:true];
     [MBProgressHUD showHUDAddedTo:self.view animated:true];
     __weak typeof(self) weak_self = self;
     __weak typeof(self) weak_self = self;
     [ASNetTools.shared postWithPath:postLogOut param:@{} success:^(id _Nonnull json) {
     [ASNetTools.shared postWithPath:postLogOut param:@{} success:^(id _Nonnull json) {
-        [MBProgressHUD hideHUDForView:self.view animated:true];
+        [MBProgressHUD hideHUDForView:weak_self.view animated:true];
         [weak_self popAndToLogin];
         [weak_self popAndToLogin];
         
         
     } faild:^(NSString * _Nonnull code, NSString * _Nonnull msg) {
     } faild:^(NSString * _Nonnull code, NSString * _Nonnull msg) {
-        [MBProgressHUD hideHUDForView:self.view animated:true];
+        [MBProgressHUD hideHUDForView:weak_self.view animated:true];
         NSLog(@"err:%@",code);
         NSLog(@"err:%@",code);
         [weak_self.view makeToast:@"Oh No, Bad Net"];
         [weak_self.view makeToast:@"Oh No, Bad Net"];
     }];
     }];
@@ -275,7 +261,8 @@
     __weak typeof(self) weakSelf = self;
     __weak typeof(self) weakSelf = self;
     ASCustomWindow *window = [ASCustomWindow show:@"Are You Sure To Delete Your Account?\n(This action can't be undone. All the data of your account will be delete)" isMast:false upBlock:^{
     ASCustomWindow *window = [ASCustomWindow show:@"Are You Sure To Delete Your Account?\n(This action can't be undone. All the data of your account will be delete)" isMast:false upBlock:^{
     } cancelBlock:^{
     } cancelBlock:^{
-        [weakSelf showDeletedReasonInput];
+        [weakSelf deleteAccount:@""];
+//        [weakSelf showDeletedReasonInput];
         
         
     }];
     }];
     window.vc.titleLb.text = @"Delete Account?";
     window.vc.titleLb.text = @"Delete Account?";
@@ -300,37 +287,29 @@
     
     
 }
 }
 
 
-- (void)showDeletedReasonInput {
-    __weak typeof(self) weakSelf = self;
-    [APHomeActiveWindow show:@"Deleted Account" des:@"Dear user, could you tell me the reason for leaving?" sureBlock:^(NSString *reason) {
-        NSString *str = @"";
-        if (!reason.isEmpty) {
-            str = reason;
-        }
-        [weakSelf deleteAccount:str];
-    } cancelBlock:^{
-    }];
-}
-
-- (void)deleteAccount:(NSString *)msg {
-//    [MBProgressHUD showHUDAddedTo:self.view animated:true];
-//    @weakify(self);
-//    [PPNetworkHelper POST:DeleteAccount parameters:@{@"deleteReason":msg} success:^(id responseObject) {
-//        [MBProgressHUD hideHUDForView:self.view animated:true];
-//        if (RequestSuccess) {
-//            NSLog(@"success:%@",responseObject);
-//            [XXX_Tabber shareInstance].xxx_barCartBtn.badgeValue = @"0";
-//            [weak_self popAndToLogin];
-//            
-//        } else {
-//            NSLog(@"fail:%@",RequestErrorMsg);
-//            [weak_self.view makeToast:RequestErrorMsg];
+//- (void)showDeletedReasonInput {
+//    __weak typeof(self) weakSelf = self;
+//    [APHomeActiveWindow show:@"Deleted Account" des:@"Dear user, could you tell me the reason for leaving?" sureBlock:^(NSString *reason) {
+//        NSString *str = @"";
+//        if (!reason.isEmpty) {
+//            str = reason;
 //        }
 //        }
-//    } failure:^(NSError *error) {
-//        [MBProgressHUD hideHUDForView:self.view animated:true];
-//        NSLog(@"err:%@",error);
-//        [weak_self.view makeToast:@"Oh No, Bad Net"];
+//        [weakSelf deleteAccount:str];
+//    } cancelBlock:^{
 //    }];
 //    }];
+//}
+
+- (void)deleteAccount:(NSString *)msg {
+    
+    [MBProgressHUD showHUDAddedTo:self.view animated:true];
+    __weak typeof(self) weakSelf = self;
+    [ASNetTools.shared delWithPath:deleteUser param:@{} success:^(id _Nonnull json) {
+        [MBProgressHUD hideHUDForView:weakSelf.view animated:true];
+        [weakSelf popAndToLogin];
+    } faild:^(NSString * _Nonnull code, NSString * _Nonnull msg) {
+        [MBProgressHUD hideHUDForView:weakSelf.view animated:true];
+        [weakSelf.view makeToast:@"Oh No, Bad Net"];
+    }];
 }
 }
 
 
 @end
 @end

+ 24 - 10
Asteria/Fuction/UserCenter/UserCenterHome/ASUserCenterViewController.m

@@ -16,6 +16,7 @@
 #import "ASVipCenterViewController.h"
 #import "ASVipCenterViewController.h"
 #import "ASMessageListViewController.h"
 #import "ASMessageListViewController.h"
 #import "ASSettingViewController.h"
 #import "ASSettingViewController.h"
+#import "ASUserCenterViewModel.h"
 
 
 
 
 @interface ASUserCenterViewController ()<UITableViewDelegate,UITableViewDataSource>
 @interface ASUserCenterViewController ()<UITableViewDelegate,UITableViewDataSource>
@@ -23,6 +24,9 @@
 @property (nonatomic,strong) UITableView *tableV;
 @property (nonatomic,strong) UITableView *tableV;
 
 
 @property (nonatomic,strong) ASUserCenterTableHeadView *tableHeadV;
 @property (nonatomic,strong) ASUserCenterTableHeadView *tableHeadV;
+@property (nonatomic, strong) ASUserCenterViewModel *vm;
+
+@property (nonatomic, strong) NSArray<KWMineHomeOrderModel *> *orderArr;
 
 
 @end
 @end
 
 
@@ -30,6 +34,7 @@
 
 
 - (void)viewDidLoad {
 - (void)viewDidLoad {
     [super viewDidLoad];
     [super viewDidLoad];
+    self.vm = [ASUserCenterViewModel new];
     [self configSubVs];
     [self configSubVs];
     [NSNotificationCenter.defaultCenter addObserver:self selector:@selector(setData) name:UserInfoUpdate object:nil];
     [NSNotificationCenter.defaultCenter addObserver:self selector:@selector(setData) name:UserInfoUpdate object:nil];
     
     
@@ -38,6 +43,7 @@
 - (void)viewWillAppear:(BOOL)animated {
 - (void)viewWillAppear:(BOOL)animated {
     [super viewWillAppear:animated];
     [super viewWillAppear:animated];
     [self setData];
     [self setData];
+    [self getOrders];
 }
 }
 
 
 // MARK: - setData
 // MARK: - setData
@@ -46,6 +52,13 @@
     [self.tableHeadV.signV refreshData];
     [self.tableHeadV.signV refreshData];
 }
 }
 
 
+- (void)getOrders {
+    [self.vm getAllOrderNet:^(NSArray<KWMineHomeOrderModel *> * _Nonnull arr) {
+        self.orderArr = arr;
+        [self.tableV reloadData];
+    }];
+}
+
 
 
 // MARK: - subVs
 // MARK: - subVs
 - (void)configSubVs {
 - (void)configSubVs {
@@ -123,7 +136,7 @@
 
 
 - (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section {
 - (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section {
     if (section == 0) {
     if (section == 0) {
-        return 3; //self.orderVm.orderList.count;
+        return self.orderArr.count; //self.orderVm.orderList.count;
     }
     }
     if (section == 1) {
     if (section == 1) {
         return 1;
         return 1;
@@ -136,16 +149,17 @@
     
     
     if (indexPath.section == 0) {
     if (indexPath.section == 0) {
         KWMineHomeOrderListCell *cell = [tableView dequeueReusableCellWithIdentifier:@"KWMineHomeOrderListCell" forIndexPath:indexPath];
         KWMineHomeOrderListCell *cell = [tableView dequeueReusableCellWithIdentifier:@"KWMineHomeOrderListCell" forIndexPath:indexPath];
-//        if (self.orderVm.orderList.count <= indexPath.row) {
-//            return cell;
-//        }
-//        KWMineHomeOrderModel *m = self.orderVm.orderList[indexPath.row];
-//        [cell setData:m];
-//        @weakify(self);
+        if (self.orderArr.count <= indexPath.row) {
+            return cell;
+        }
+        KWMineHomeOrderModel *m = self.orderArr[indexPath.row];
+        [cell setData:m];
+        @weakify(self);
         [cell setViewOrderCall:^{
         [cell setViewOrderCall:^{
-//            if (![weak_self checkLogin:true]) {
-//                return;
-//            }
+            if (![ASUserInfoManager.shared isLogin]) {
+                [self popAndToLogin];
+                return;
+            }
             // 查看订单
             // 查看订单
             NSLog(@"查看订单 view order");
             NSLog(@"查看订单 view order");
 //            KWM_OrderViewC *vc = [[KWM_OrderViewC alloc]init];
 //            KWM_OrderViewC *vc = [[KWM_OrderViewC alloc]init];

+ 19 - 0
Asteria/Fuction/UserCenter/UserCenterHome/ASUserCenterViewModel.h

@@ -0,0 +1,19 @@
+//
+//  ASUserCenterViewModel.h
+//  Asteria
+//
+//  Created by iOS on 2024/1/15.
+//
+
+#import <Foundation/Foundation.h>
+#import "KWMineHomeOrderModel.h"
+
+NS_ASSUME_NONNULL_BEGIN
+
+@interface ASUserCenterViewModel : NSObject
+
+- (void)getAllOrderNet:(void(^)(NSArray<KWMineHomeOrderModel *> *))com;
+
+@end
+
+NS_ASSUME_NONNULL_END

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

@@ -0,0 +1,36 @@
+//
+//  ASUserCenterViewModel.m
+//  Asteria
+//
+//  Created by iOS on 2024/1/15.
+//
+
+#import "ASUserCenterViewModel.h"
+
+
+@implementation ASUserCenterViewModel
+
+
+- (void)getAllOrderNet:(void(^)(NSArray<KWMineHomeOrderModel *> *))com {
+    NSDictionary *para = @{
+        @"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"]];
+        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

+ 12 - 10
Asteria/Fuction/UserCenter/UserCenterHome/models/KWMineHomeOrderModel.h

@@ -13,26 +13,28 @@ NS_ASSUME_NONNULL_BEGIN
 @interface KWMineHomeOrderModel : NSObject
 @interface KWMineHomeOrderModel : NSObject
 
 
 /// 状态
 /// 状态
-@property (nonatomic, copy) NSString *status;
+@property (nonatomic, copy) NSString *state;
 /// 编号
 /// 编号
-@property (nonatomic, copy) NSString *orderNumber;
-@property (nonatomic, copy) NSString *orderId;
+@property (nonatomic, copy) NSString *increment_id;
 /// 时间
 /// 时间
-@property (nonatomic, copy) NSString *orderData;
+@property (nonatomic, copy) NSString *created_at;
 /// 金额
 /// 金额
-@property (nonatomic, copy) NSString *orderTotal;
+@property (nonatomic, copy) NSString *grand_total;
 
 
-@property (nonatomic, strong) NSArray<KWMineOrderProInfoModel *> *info;
+@property (nonatomic, copy) NSString *currency_symbol;
+
+@property (nonatomic, strong) NSArray<KWMineOrderProInfoModel *> *items;
 
 
 @end
 @end
 
 
 @interface KWMineOrderProInfoModel : NSObject
 @interface KWMineOrderProInfoModel : NSObject
 
 
-@property (nonatomic, copy) NSString *product_img;
-@property (nonatomic, copy) NSString *product_name;
-@property (nonatomic, copy) NSString *product_price;
+@property (nonatomic, copy) NSString *image;
+@property (nonatomic, copy) NSString *name;
+@property (nonatomic, copy) NSString *price;
 @property (nonatomic, copy) NSString *product_id;
 @property (nonatomic, copy) NSString *product_id;
-@property (nonatomic, copy) NSString *qty;
+@property (nonatomic, copy) NSString *qty_ordered;
+@property (nonatomic, copy) NSString *currency_symbol;
 
 
 @end
 @end
 
 

+ 14 - 2
Asteria/Fuction/UserCenter/UserCenterHome/models/KWMineHomeOrderModel.m

@@ -12,7 +12,14 @@
 + (NSDictionary *)mj_objectClassInArray{
 + (NSDictionary *)mj_objectClassInArray{
     return @{
     return @{
         
         
-        @"info" : [KWMineOrderProInfoModel class],
+        @"items" : [KWMineOrderProInfoModel class],
+        
+    };
+}
+
++ (NSDictionary *)mj_replacedKeyFromPropertyName {
+    return @{
+        @"currency_symbol":@"extension_attributes.currency_symbol",
         
         
     };
     };
 }
 }
@@ -21,6 +28,11 @@
 
 
 @implementation KWMineOrderProInfoModel
 @implementation KWMineOrderProInfoModel
 
 
-
++ (NSDictionary *)mj_replacedKeyFromPropertyName {
+    return @{
+        @"image":@"extension_attributes.image",
+        
+    };
+}
 
 
 @end
 @end

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

@@ -28,14 +28,14 @@
 
 
 - (void)setData:(KWMineHomeOrderModel *)model {
 - (void)setData:(KWMineHomeOrderModel *)model {
     self.m = model;
     self.m = model;
-    self.timeLB.text = model.orderData;
-    self.orderNoLB.text = model.orderNumber;
+    self.timeLB.text = model.created_at;
+    self.orderNoLB.text = model.increment_id;
     for (UIView*item in self.prodStackV.arrangedSubviews) {
     for (UIView*item in self.prodStackV.arrangedSubviews) {
         if (item.superview) {
         if (item.superview) {
             [item removeFromSuperview];
             [item removeFromSuperview];
         }
         }
     }
     }
-    for (KWMineOrderProInfoModel *info in model.info) {
+    for (KWMineOrderProInfoModel *info in model.items) {
         KWMineHomeOrderSubView *subV = [[KWMineHomeOrderSubView alloc] init];
         KWMineHomeOrderSubView *subV = [[KWMineHomeOrderSubView alloc] init];
         [subV setData:info];
         [subV setData:info];
         [self.prodStackV addArrangedSubview:subV];
         [self.prodStackV addArrangedSubview:subV];
@@ -101,27 +101,27 @@
     
     
     
     
     [self.orderNoNameLB mas_makeConstraints:^(MASConstraintMaker *make) {
     [self.orderNoNameLB mas_makeConstraints:^(MASConstraintMaker *make) {
-        make.left.greaterThanOrEqualTo(self.prodStackV.mas_left);
-        make.centerY.equalTo(self.timeLB);
+        make.left.equalTo(self.prodStackV.mas_left);
+        make.top.equalTo(self.prodStackV.mas_bottom).offset(21);
         make.height.equalTo(@16);
         make.height.equalTo(@16);
     }];
     }];
     [self.orderNoLB setContentHuggingPriority:UILayoutPriorityRequired forAxis:UILayoutConstraintAxisHorizontal];
     [self.orderNoLB setContentHuggingPriority:UILayoutPriorityRequired forAxis:UILayoutConstraintAxisHorizontal];
     [self.orderNoLB mas_makeConstraints:^(MASConstraintMaker *make) {
     [self.orderNoLB mas_makeConstraints:^(MASConstraintMaker *make) {
-        make.centerY.equalTo(self.timeLB);
+        make.centerY.equalTo(self.orderNoNameLB);
         make.left.equalTo(self.orderNoNameLB.mas_right);
         make.left.equalTo(self.orderNoNameLB.mas_right);
+        make.right.equalTo(self.prodStackV.mas_right);
         make.height.equalTo(@16);
         make.height.equalTo(@16);
     }];
     }];
     
     
-    [self.timeLB setContentHuggingPriority:UILayoutPriorityRequired forAxis:UILayoutConstraintAxisHorizontal];
     [self.timeLB mas_makeConstraints:^(MASConstraintMaker *make) {
     [self.timeLB mas_makeConstraints:^(MASConstraintMaker *make) {
-        make.right.equalTo(self.prodStackV);
-        make.top.equalTo(self.prodStackV.mas_bottom).offset(10);
+        make.left.equalTo(self.prodStackV);
+        make.top.equalTo(self.orderNoNameLB.mas_bottom).offset(5);
         make.height.equalTo(@14);
         make.height.equalTo(@14);
-        make.left.equalTo(self.orderNoLB.mas_right).offset(20);
+        make.bottom.equalTo(self.bgV.mas_bottom).offset(-20);
     }];
     }];
     
     
     [self.viewBt mas_makeConstraints:^(MASConstraintMaker *make) {
     [self.viewBt mas_makeConstraints:^(MASConstraintMaker *make) {
-        make.top.equalTo(self.timeLB.mas_bottom).offset(10);
+        make.left.equalTo(self.timeLB.mas_right).offset(10);
         make.right.equalTo(self.prodStackV);
         make.right.equalTo(self.prodStackV);
         make.bottom.equalTo(self.bgV.mas_bottom).offset(-20);
         make.bottom.equalTo(self.bgV.mas_bottom).offset(-20);
         make.height.equalTo(@17);
         make.height.equalTo(@17);

+ 5 - 4
Asteria/Fuction/UserCenter/UserCenterHome/views/KWMineHomeOrderSubView.m

@@ -24,10 +24,11 @@
 
 
 - (void)setData:(KWMineOrderProInfoModel *)model {
 - (void)setData:(KWMineOrderProInfoModel *)model {
     self.m = model;
     self.m = model;
-    self.titleLB.text = model.product_name;
-    self.priceLb.text = [NSString stringWithFormat:@"%@",model.product_price];
-    self.numLB.text = model.qty;
-    [self.imgV sd_setImageWithURL:[NSURL URLWithString:model.product_img.urlEncode]];
+    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"]];
 }
 }
 
 
 -(instancetype)init {
 -(instancetype)init {

+ 7 - 3
Asteria/NetTools/ASNetApis.h

@@ -13,13 +13,14 @@
 #define BaseRequestrUrl(url) ([NSString stringWithFormat:@"%@%@",@"rest/V1/",url])
 #define BaseRequestrUrl(url) ([NSString stringWithFormat:@"%@%@",@"rest/V1/",url])
 #define BaseWebUrl(url) ([NSString stringWithFormat:@"%@%@",@"rest/V1/",url])
 #define BaseWebUrl(url) ([NSString stringWithFormat:@"%@%@",@"rest/V1/",url])
 
 
+#define PointRuleWebUrl @"https://m.bilisar.com/pointsrule"
 
 
 // MARK: - host
 // MARK: - host
 #if (DEBUG)
 #if (DEBUG)
-//#define HostPath @"www.bilisar.com"//@"https://www.bilisar.com/"  //测试
-#define HostPath @"pc.bilisar.com"  //正式
+#define HostPath @"www.bilisar.com"  //测试
+//#define HostPath @"pc.bilisar.com"  //正式
 #else
 #else
-#define HostPath @"pc.bilisar.com"//@"https://pc.bilisar.com/"  //正式
+#define HostPath @"pc.bilisar.com" //正式
 #endif
 #endif
 
 
 // MARK: - path
 // MARK: - path
@@ -54,6 +55,9 @@
 #define postLogOut BaseRequestrUrl(@"integration/customer/revoke-customer-token")
 #define postLogOut BaseRequestrUrl(@"integration/customer/revoke-customer-token")
 #define getSignStateUrl BaseRequestrUrl(@"sign/index")
 #define getSignStateUrl BaseRequestrUrl(@"sign/index")
 #define postSignUrl BaseRequestrUrl(@"sign/add")
 #define postSignUrl BaseRequestrUrl(@"sign/add")
+#define deleteUser BaseRequestrUrl(@"customers/remove")
+/// 通用接口
+#define getAllOrders BaseRequestrUrl(@"format")
 
 
 // MARK: 优惠券/礼品卡
 // MARK: 优惠券/礼品卡
 #define getUserCouponUrl BaseRequestrUrl(@"coupon/index")
 #define getUserCouponUrl BaseRequestrUrl(@"coupon/index")

+ 2 - 2
Asteria/NetTools/ASNetTools.m

@@ -333,8 +333,8 @@
 
 
 + (void)login {
 + (void)login {
     NSDictionary *param = @{
     NSDictionary *param = @{
-        @"username" :@"abc123456789@qq.com",
-        @"password":@"A123456a"
+        @"username" :@"Britneyngwafa@gmail.com",//@"abc123456789@qq.com",
+        @"password":@"1qazXSW@123"//@"A123456a"
     };
     };
     [ASNetTools.shared postWithPath:loginUrl param:param success:^(id _Nonnull result) {
     [ASNetTools.shared postWithPath:loginUrl param:param success:^(id _Nonnull result) {
         NSString *token = [NSString stringWithFormat:@"Bearer %@", result];
         NSString *token = [NSString stringWithFormat:@"Bearer %@", result];

+ 1 - 1
Podfile.lock

@@ -1277,4 +1277,4 @@ SPEC CHECKSUMS:
 
 
 PODFILE CHECKSUM: 5d955d5ce86f96810ca16fd7acd16a89ff2750e0
 PODFILE CHECKSUM: 5d955d5ce86f96810ca16fd7acd16a89ff2750e0
 
 
-COCOAPODS: 1.12.1
+COCOAPODS: 1.13.0

+ 1 - 1
Pods/MKNetworkKit/MKNetworkKit/MKNetworkOperation.m

@@ -587,7 +587,7 @@
     if (([method isEqualToString:@"POST"] ||
     if (([method isEqualToString:@"POST"] ||
          [method isEqualToString:@"PUT"]) && (params && [params count] > 0)) {
          [method isEqualToString:@"PUT"]) && (params && [params count] > 0)) {
       
       
-        self.postDataEncoding = MKNKPostDataEncodingTypeURL;
+      self.postDataEncoding = MKNKPostDataEncodingTypeURL;
     }
     }
     
     
     self.state = MKNetworkOperationStateReady;
     self.state = MKNetworkOperationStateReady;

+ 1 - 1
Pods/Manifest.lock

@@ -1277,4 +1277,4 @@ SPEC CHECKSUMS:
 
 
 PODFILE CHECKSUM: 5d955d5ce86f96810ca16fd7acd16a89ff2750e0
 PODFILE CHECKSUM: 5d955d5ce86f96810ca16fd7acd16a89ff2750e0
 
 
-COCOAPODS: 1.12.1
+COCOAPODS: 1.13.0

A diferenza do arquivo foi suprimida porque é demasiado grande
+ 1635 - 1612
Pods/Pods.xcodeproj/project.pbxproj


+ 1 - 1
Pods/Target Support Files/Pods-Asteria/Pods-Asteria-frameworks.sh

@@ -18,7 +18,7 @@ echo "mkdir -p ${CONFIGURATION_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}"
 mkdir -p "${CONFIGURATION_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}"
 mkdir -p "${CONFIGURATION_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}"
 
 
 COCOAPODS_PARALLEL_CODE_SIGN="${COCOAPODS_PARALLEL_CODE_SIGN:-false}"
 COCOAPODS_PARALLEL_CODE_SIGN="${COCOAPODS_PARALLEL_CODE_SIGN:-false}"
-SWIFT_STDLIB_PATH="${DT_TOOLCHAIN_DIR}/usr/lib/swift/${PLATFORM_NAME}"
+SWIFT_STDLIB_PATH="${TOOLCHAIN_DIR}/usr/lib/swift/${PLATFORM_NAME}"
 BCSYMBOLMAP_DIR="BCSymbolMaps"
 BCSYMBOLMAP_DIR="BCSymbolMaps"