Przeglądaj źródła

商品列表接口,展示逻辑优化

Abel 1 rok temu
rodzic
commit
35cd1aada4

+ 6 - 0
Asteria.xcodeproj/project.pbxproj

@@ -18,6 +18,7 @@
 		812021252B185A610026B8B5 /* ASCouponsListViewModel.m in Sources */ = {isa = PBXBuildFile; fileRef = 812021242B185A610026B8B5 /* ASCouponsListViewModel.m */; };
 		812021282B185C000026B8B5 /* ASCouponsModel.m in Sources */ = {isa = PBXBuildFile; fileRef = 812021272B185C000026B8B5 /* ASCouponsModel.m */; };
 		8127ADDB2B1193A300464D27 /* ASNetTools.m in Sources */ = {isa = PBXBuildFile; fileRef = 8127ADDA2B1193A300464D27 /* ASNetTools.m */; };
+		8131A27C2B365F7700A191BE /* ASProductListCategoryModel.m in Sources */ = {isa = PBXBuildFile; fileRef = 8131A27B2B365F7600A191BE /* ASProductListCategoryModel.m */; };
 		8134C1AD2A13094F006EB0EC /* Target_userCenter.m in Sources */ = {isa = PBXBuildFile; fileRef = 8134C1AC2A13094F006EB0EC /* Target_userCenter.m */; };
 		8134C1B42A1358F3006EB0EC /* ASSginView.m in Sources */ = {isa = PBXBuildFile; fileRef = 8134C1B32A1358F3006EB0EC /* ASSginView.m */; };
 		8134C1B72A1359E6006EB0EC /* ASSignDayView.m in Sources */ = {isa = PBXBuildFile; fileRef = 8134C1B62A1359E6006EB0EC /* ASSignDayView.m */; };
@@ -289,6 +290,8 @@
 		8127ADD92B1193A300464D27 /* ASNetTools.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = ASNetTools.h; sourceTree = "<group>"; };
 		8127ADDA2B1193A300464D27 /* ASNetTools.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = ASNetTools.m; sourceTree = "<group>"; };
 		8127ADDC2B11973400464D27 /* ASNetApis.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = ASNetApis.h; sourceTree = "<group>"; };
+		8131A27A2B365F7600A191BE /* ASProductListCategoryModel.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = ASProductListCategoryModel.h; sourceTree = "<group>"; };
+		8131A27B2B365F7600A191BE /* ASProductListCategoryModel.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = ASProductListCategoryModel.m; sourceTree = "<group>"; };
 		8134C1AB2A13094F006EB0EC /* Target_userCenter.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = Target_userCenter.h; sourceTree = "<group>"; };
 		8134C1AC2A13094F006EB0EC /* Target_userCenter.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = Target_userCenter.m; sourceTree = "<group>"; };
 		8134C1B22A1358F3006EB0EC /* ASSginView.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = ASSginView.h; sourceTree = "<group>"; };
@@ -999,6 +1002,8 @@
 				816020242A2F1C9E00E4A8F1 /* ASHomeMainListModel.m */,
 				81717CA72A3C0AAA00648139 /* KWProductListFilterModel.h */,
 				81717CA62A3C0AA900648139 /* KWProductListFilterModel.m */,
+				8131A27A2B365F7600A191BE /* ASProductListCategoryModel.h */,
+				8131A27B2B365F7600A191BE /* ASProductListCategoryModel.m */,
 			);
 			path = Models;
 			sourceTree = "<group>";
@@ -2237,6 +2242,7 @@
 				9AD346142A08D60F005CA070 /* ZFSpeedLoadingView.m in Sources */,
 				81E5EE902A498FC90075695F /* ASVipCenterViewController.m in Sources */,
 				81C7963F2A551FB0003083B8 /* ASInfomationSetController.m in Sources */,
+				8131A27C2B365F7700A191BE /* ASProductListCategoryModel.m in Sources */,
 				9AD346062A08D60F005CA070 /* ZFReachabilityManager.m in Sources */,
 				81717CA52A3C0A5000648139 /* KWProductFilterItemCell.m in Sources */,
 				812021252B185A610026B8B5 /* ASCouponsListViewModel.m in Sources */,

+ 2 - 0
Asteria/ASUI/CustomView/productView/ASProductBaseModel.h

@@ -15,6 +15,8 @@ NS_ASSUME_NONNULL_BEGIN
 @property (nonatomic, copy) NSString *Id;
 @property (nonatomic, copy) NSString *title;
 
+@property (nonatomic, copy) NSString *currencySymbol;
+
 /// 真是折扣
 @property (nonatomic, copy) NSString *percent;
 /// 展示折扣

+ 25 - 3
Asteria/ASUI/CustomView/productView/ASProductBaseModel.m

@@ -30,12 +30,34 @@
     return m;
 }
 
+- (NSString *)nowPrice {
+    NSDecimalNumber *num = [NSDecimalNumber decimalNumberWithString:_nowPrice];
+    
+    return [NSString stringWithFormat:@"%@%.2f",self.currencySymbol, num.doubleValue];
+}
+
+- (NSString *)oldPrice {
+    NSDecimalNumber *num = [NSDecimalNumber decimalNumberWithString:_oldPrice];
+    return [NSString stringWithFormat:@"%@%.2f",self.currencySymbol, num.doubleValue];
+}
+
+- (NSString *)img {
+    return [NSString stringWithFormat:@"https://%@%@%@",HostPath, ProductImgPath, _img];
+}
+
+- (NSString *)sale_num {
+    return [NSString stringWithFormat:@"%ldK", _sale_num.integerValue/1000];
+}
+
 
 + (NSDictionary *)mj_replacedKeyFromPropertyName {
     return @{
-        @"Id": @"id",
-        @"oldPrice": @"price.price",
-        @"nowPrice":@"price.final_price",
+        @"Id": @"entity_id",
+        @"oldPrice": @"price",
+        @"nowPrice":@"final_price",
+        @"img":@"image",
+        @"title":@"name",
+        @"sketchy_app":@"short_description"
     };
 }
 

+ 13 - 1
Asteria/Fuction/Category/vc/ASCategoryViewController.m

@@ -36,7 +36,19 @@
     [self.vm getAllCateGories:@"" com:^(BOOL isSuc, NSString * _Nonnull msg) {
         NSArray<KWMainTypeModel *> *tempArr = weakSelf.vm.totalDatas;
         weakSelf.leftTableV.arr = tempArr;
-        weakSelf.rightTableV.arr = tempArr.firstObject.children_data;
+        NSInteger cusSelect = 0;
+        for (int i=0; i<tempArr.count; i++) {
+            KWMainTypeModel *temp = tempArr[i];
+            if (temp.children_data.count > 0) {
+                cusSelect = i;
+                break;
+            }
+        }
+        if (tempArr.count > cusSelect) {
+            weakSelf.rightTableV.arr = tempArr[cusSelect].children_data;
+        }
+        weakSelf.leftTableV.selectIndex = cusSelect;
+        
         [weakSelf.leftTableV reloadData];
         [weakSelf.rightTableV reloadData];
         if (!isSuc) {

+ 7 - 4
Asteria/Fuction/Category/vm/ASCategoriesViewModel.m

@@ -17,10 +17,13 @@
     }
     __weak typeof(self) weakSelf = self;
     [ASNetTools.shared getWithPath:getAllCategoriesUrl param:dic success:^(id _Nonnull json) {
-        NSMutableArray *arr = [KWMainTypeModel mj_objectArrayWithKeyValuesArray:json[@"children_data"]];
-        
-        weakSelf.totalDatas = arr;
-        [weakSelf addCurrencyData];
+        NSArray *arr = json;
+        if ([arr isKindOfClass:[NSArray class]] && arr != nil && arr.count > 0) {
+            NSMutableArray *arr = [KWMainTypeModel mj_objectArrayWithKeyValuesArray:json[0][@"children_data"]];
+            
+            weakSelf.totalDatas = arr;
+            [weakSelf addCurrencyData];            
+        }
         comp(true, @"");
     } faild:^(NSString * _Nonnull code, NSString * _Nonnull msg) {
         NSMutableArray *arr = [NSMutableArray array];

+ 121 - 59
Asteria/Fuction/Home/ASProductListViewController.m

@@ -21,7 +21,9 @@
 @property (nonatomic, strong) NSArray <ASHomeBannerModel *>*topLinkArr;
 
 @property (nonatomic, assign) BOOL desMoreOpen;
+@property (nonatomic, assign) BOOL canShowMoreBt;
 
+@property (nonatomic, assign) NSInteger page;
 
 
 
@@ -43,14 +45,14 @@
 
 - (void)viewDidLoad {
     [super viewDidLoad];
-    
+    self.currentSortType = 2;
     self.desMoreOpen = false;
     [self loadSubVs];
     [self loasActiveDataAndV];
     self.vm = [ASProductListViewModel new];
     [self.collectV reloadData];
     
-    
+    [self.collectV.mj_header beginRefreshing];
     
 }
 
@@ -85,6 +87,17 @@
     }];
     self.menuFilterV.hidden = true;
     
+    __weak typeof(self) weakSelf = self;
+    self.collectV.mj_header = [MJRefreshNormalHeader headerWithRefreshingBlock:^{
+        weakSelf.page = 1;
+        [weakSelf.collectV.mj_footer resetNoMoreData];
+        [weakSelf getNetData];
+    }];
+    self.collectV.mj_footer = [MJRefreshAutoNormalFooter footerWithRefreshingBlock:^{
+        weakSelf.page += 1;
+        [weakSelf getNetData];
+    }];
+    
 }
 
 - (void)loasActiveDataAndV {
@@ -98,6 +111,9 @@
     [self.collectV reloadData];
 }
 
+
+                               
+
 // MARK: - delegate datasource
 - (void)collectionView:(UICollectionView *)collectionView didSelectItemAtIndexPath:(NSIndexPath *)indexPath {
     
@@ -106,38 +122,45 @@
 
 // MARK: - UICollectionViewDataSource
 - (nonnull __kindof UICollectionViewCell *)collectionView:(nonnull UICollectionView *)collectionView cellForItemAtIndexPath:(nonnull NSIndexPath *)indexPath {
-    if (indexPath.section == 2 && indexPath.row == 0) {
-        ASProductListImageCell *c = [collectionView dequeueReusableCellWithReuseIdentifier:@"ASProductListImageCell" forIndexPath:indexPath];
-        [c setImgStr:@"https://img1.baidu.com/it/u=3005611618,1188581709&fm=253&fmt=auto&app=138&f=JPEG?w=500&h=313"];
-        return c;
-    }
-    if (indexPath.section == 3 && indexPath.item == 0)
-    {
-        ASMoreBtCell *btCell = [collectionView dequeueReusableCellWithReuseIdentifier:@"ASMoreBtCell" forIndexPath:indexPath];
-        return btCell;
-    }
-    
-    if (indexPath.section == 3 && indexPath.item == 1)
-    {
-        ASProductListTypeDesCell *desCell = [collectionView dequeueReusableCellWithReuseIdentifier:@"ASProductListTypeDesCell" forIndexPath:indexPath];
-        [desCell setData:@"LONG WIGS" des:@"Asteria Hair offers long length wigs with different hair colors and styles, find long lace front wig, long black hair wigs, long blonde wigs you’ve been dreaming of, long straight wig and long curly hair lace front wigs are featured, go shopping and find t" moreStatus:self.desMoreOpen];
-        desCell.moreStatusChange = ^{
-            self.desMoreOpen = !self.desMoreOpen;
-            [self.collectV reloadData];
-        };
-        return desCell;
+    switch (indexPath.section) {
+        case 3:{
+            if (self.canShowMoreBt) {
+                if (indexPath.row == 0) {
+                    ASMoreBtCell *btCell = [collectionView dequeueReusableCellWithReuseIdentifier:@"ASMoreBtCell" forIndexPath:indexPath];
+                    return btCell;
+                }
+            }
+            ASProductListTypeDesCell *desCell = [collectionView dequeueReusableCellWithReuseIdentifier:@"ASProductListTypeDesCell" forIndexPath:indexPath];
+            [desCell setData:self.vm.cateModel.name des:self.vm.cateModel.meta_description moreStatus:self.desMoreOpen];
+            desCell.moreStatusChange = ^{
+                self.desMoreOpen = !self.desMoreOpen;
+                [self.collectV reloadData];
+            };
+            return desCell;
+            
+        }
+            
+        default: {
+            if (indexPath.row == 0 && self.vm.cateModel.image.length > 0) {
+                ASProductListImageCell *c = [collectionView dequeueReusableCellWithReuseIdentifier:@"ASProductListImageCell" forIndexPath:indexPath];
+                [c setImgStr:[NSString stringWithFormat:@"https://%@%@%@",HostPath, CategoryImgPath, self.vm.cateModel.image]];
+                return c;
+                
+            }
+            HomeFlashDealSubCollectCell *cell = [collectionView dequeueReusableCellWithReuseIdentifier:@"HomeFlashDealSubCollectCell" forIndexPath:indexPath];
+            NSInteger tempOff = self.vm.cateModel.image.length > 0 ? 1 : 0;
+            if (self.vm.productList.count <= indexPath.row-tempOff)
+            {
+                return cell;
+            }
+            
+            ASProductBaseModel *m = self.vm.productList[indexPath.row-tempOff];
+            cell.model = m;
+            cell.contView.addCartBt.hidden = false;
+            return cell;
+        }
     }
     
-    HomeFlashDealSubCollectCell *cell = [collectionView dequeueReusableCellWithReuseIdentifier:@"HomeFlashDealSubCollectCell" forIndexPath:indexPath];
-    if (self.vm.productList.count <= indexPath.row-1)
-    {
-        return cell;
-    }
-   
-    ASProductBaseModel *m = self.vm.productList[indexPath.row-1];
-    cell.model = m;
-    cell.contView.addCartBt.hidden = true;
-    return cell;
 }
 
 - (NSInteger)numberOfSectionsInCollectionView:(UICollectionView *)collectionView {
@@ -149,9 +172,16 @@
         return 0;
     }
     if (section == 3) {
-        return 2;
+        NSInteger count = 0;
+        if (self.canShowMoreBt) {
+            count += 1;
+        }
+        if (self.vm.cateModel != nil && self.vm.cateModel.meta_description.length > 0) {
+            count += 1;
+        }
+        return count;
     }
-    return self.vm.productList.count + 1;
+    return self.vm.productList.count + (self.vm.cateModel.image.length > 0 ? 1 : 0);
 }
 
 - (CGSize)collectionView:(UICollectionView *)collectionView layout:(UICollectionViewLayout *)collectionViewLayout referenceSizeForHeaderInSection:(NSInteger)section {
@@ -200,29 +230,44 @@
 }
 
 - (CGSize)collectionView:(UICollectionView *)collectionView layout:(UICollectionViewLayout *)collectionViewLayout sizeForItemAtIndexPath:(NSIndexPath *)indexPath {
-    if (indexPath.row == 0) {
-        CGFloat w = KScreenWidth-20;
-        CGFloat collH = w/355.0*118;
-        return CGSizeMake(w, collH);;
-    }
-    if (indexPath.section == 3 && indexPath.item == 1) {
-        if (!self.desMoreOpen) {
-            return CGSizeMake(KScreenWidth-20, 35+60+24);
+    switch (indexPath.section) {
+        case 3:{
+            if (self.canShowMoreBt) {
+                if (indexPath.row == 0) {
+                    return CGSizeMake(KScreenWidth-20, 20+36+50);
+                }
+            }
+            
+            if (!self.desMoreOpen) {
+                return CGSizeMake(KScreenWidth-20, 35+60+24);
+            }
+            //设置行间距
+            NSMutableParagraphStyle *paragraphStyle1 = [[NSMutableParagraphStyle alloc] init];
+            [paragraphStyle1 setLineSpacing:12];
+            CGFloat h = [self.vm.cateModel.meta_description boundingRectWithSize:CGSizeMake(KScreenWidth-10-35, CGFLOAT_MAX) options:NSStringDrawingUsesLineFragmentOrigin attributes:@{NSParagraphStyleAttributeName : paragraphStyle1} context:nil].size.height;
+            return CGSizeMake(KScreenWidth-20, 35+60+(h > 24 ? h : 24));
+        }
+        case 2: {
+            if (indexPath.row == 0 && self.vm.cateModel.image.length > 0) {
+                CGFloat w = KScreenWidth-20;
+                CGFloat collH = w/355.0*118;
+                return CGSizeMake(w, collH);
+            }
+            CGFloat marg = 10;
+            CGFloat w = (KScreenWidth-3*marg)/2;
+            CGFloat collH = (KScreenWidth-30)/2 + productHWithOutImg;
+            return CGSizeMake(w, collH);
+        }
+
+            
+        default:{
+            CGFloat marg = 10;
+            CGFloat w = (KScreenWidth-3*marg)/2;
+            CGFloat collH = (KScreenWidth-30)/2 + productHWithOutImg;
+            return CGSizeMake(w, collH);
         }
-        //设置行间距
-        NSMutableParagraphStyle *paragraphStyle1 = [[NSMutableParagraphStyle alloc] init];
-        [paragraphStyle1 setLineSpacing:12];
-        CGFloat h = [@"Asteria Hair offers long length wigs with different hair colors and styles, find long lace front wig, long black hair wigs, long blonde wigs you’ve been dreaming of, long straight wig and long curly hair lace front wigs are featured, go shopping and find t" boundingRectWithSize:CGSizeMake(KScreenWidth-10-35, CGFLOAT_MAX) options:NSStringDrawingUsesLineFragmentOrigin attributes:@{NSParagraphStyleAttributeName : paragraphStyle1} context:nil].size.height;
-        return CGSizeMake(KScreenWidth-20, 35+60+(h > 24 ? h : 24));
-    }
-    
-    if (indexPath.section == 3 && indexPath.item == 0) {
-        return CGSizeMake(KScreenWidth-20, 20+36+50);
     }
-    CGFloat marg = 10;
-    CGFloat w = (KScreenWidth-3*marg)/2;
-    CGFloat collH = (KScreenWidth-30)/2 + productHWithOutImg;
-    return CGSizeMake(w, collH);
+   
 }
 
 -(CGFloat)collectionView:(UICollectionView *)collectionView layout:(UICollectionViewLayout *)collectionViewLayout minimumLineSpacingForSectionAtIndex:(NSInteger)section {
@@ -296,7 +341,7 @@
         [v setSelectIndex:^(NSInteger index) {
             weakself.currentSortType = index;
             [weakself.collectV reloadData];
-//            [weakself.collectV.mj_header beginRefreshing];
+            [weakself.collectV.mj_header beginRefreshing];
         }];
         _sortTypeV = v;
     }
@@ -312,8 +357,25 @@
     [self.menuFilterV showAnimate:self.vm.selectDic];
 }
 
-
-
-
+-(void)getNetData {
+    [MBProgressHUD showHUDAddedTo:self.view animated:true];
+    
+    __weak typeof(self) weakSelf = self;
+    [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];
+        [weakSelf.collectV.mj_header endRefreshing];
+        [weakSelf.collectV.mj_footer endRefreshing];
+        weakSelf.canShowMoreBt = true;
+        if (!hasNext) {
+            weakSelf.canShowMoreBt = false;
+            [weakSelf.collectV.mj_footer endRefreshingWithNoMoreData];
+        }
+        
+        [self.collectV reloadData];
+        if (!msg.isEmpty) {
+            [weakSelf.view makeToast:msg];
+        }
+    }];
+}
 
 @end

+ 21 - 0
Asteria/Fuction/Home/Models/ASProductListCategoryModel.h

@@ -0,0 +1,21 @@
+//
+//  ASProductListCategoryModel.h
+//  Asteria
+//
+//  Created by iOS on 2023/12/23.
+//
+
+#import <Foundation/Foundation.h>
+
+NS_ASSUME_NONNULL_BEGIN
+
+@interface ASProductListCategoryModel : NSObject
+
+@property (nonatomic, copy) NSString *name;
+@property (nonatomic, copy) NSString *image;
+@property (nonatomic, copy) NSString *meta_description;
+@property (nonatomic, copy) NSString *entity_id;
+
+@end
+
+NS_ASSUME_NONNULL_END

+ 12 - 0
Asteria/Fuction/Home/Models/ASProductListCategoryModel.m

@@ -0,0 +1,12 @@
+//
+//  ASProductListCategoryModel.m
+//  Asteria
+//
+//  Created by iOS on 2023/12/23.
+//
+
+#import "ASProductListCategoryModel.h"
+
+@implementation ASProductListCategoryModel
+
+@end

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

@@ -8,17 +8,21 @@
 #import <Foundation/Foundation.h>
 #import "ASProductBaseModel.h"
 #import "KWProductListFilterModel.h"
+#import "ASProductListCategoryModel.h"
 
 NS_ASSUME_NONNULL_BEGIN
 
 @interface ASProductListViewModel : NSObject
 
 @property (nonatomic, strong) NSArray <ASProductBaseModel *> *productList;
+@property (nonatomic, strong) ASProductListCategoryModel *cateModel;
 
 @property (nonatomic, strong) NSArray<KWProductListFilterModel *> *sourceArr;
 @property (nonatomic, strong) NSMutableDictionary<NSString *,KWProductListFilterSubModel *> *selectDic;
 @property (nonatomic, strong) NSMutableArray<KWProductListFilterModel *> *showArr;
 
+- (void)getProductListData:(NSString *)catId page:(NSInteger)page orderBy:(NSInteger)orderBy dir:(NSString *)dir com:(void(^)(BOOL hasNext, NSString *msg))com;
+
 @end
 
 NS_ASSUME_NONNULL_END

+ 47 - 3
Asteria/Fuction/Home/vm/ASProductListViewModel.m

@@ -12,9 +12,6 @@
 - (NSArray<ASProductBaseModel *> *)productList {
     if (!_productList) {
         NSMutableArray *arr = [NSMutableArray array];
-        for (int i=0; i<arc4random()%20*2; i++) {
-            [arr addObject:[ASProductBaseModel demoModel]];
-        }
         _productList = arr;
     }
     return _productList;
@@ -51,4 +48,51 @@
     return _sourceArr;
 }
 
+- (void)getProductListData:(NSString *)catId page:(NSInteger)page orderBy:(NSInteger)orderBy dir:(NSString *)dir com:(void(^)(BOOL hasNext, NSString *msg))com {
+    NSMutableDictionary *para = [NSMutableDictionary dictionary];
+    para[@"currencyCode"] = ASCurrencyManager.shared.currentCur;
+    para[@"page"] = @(page);
+    para[@"size"] = @20;
+    if (orderBy != 0) {
+        NSArray *arr = @[@"position", @"price", @"sold_qty"];
+        if (arr.count > orderBy && orderBy >= 0) {
+            para[@"order"] = arr[orderBy];
+        } else {
+            para[@"order"] = @"sold_qty";
+        }
+    } else {
+        para[@"order"] = @"sold_qty";
+    }
+    if (dir != nil && ![dir isEqualToString:@""]) {
+        para[@"dir"] = dir;
+    } else {
+        para[@"dir"] = @"DESC";
+    }
+    NSString *url = [NSString stringWithFormat:getProductListUrl, catId];
+    [ASNetTools.shared getWithPath:url param:para success:^(id _Nonnull json) {
+        ASProductListCategoryModel *m = [ASProductListCategoryModel mj_objectWithKeyValues:json[@"category"]];
+        self.cateModel = m;
+        NSArray *arr = json[@"product"];
+        NSMutableArray *products = [ASProductBaseModel mj_objectArrayWithKeyValuesArray:arr];
+        if (products.count > 0) {
+            if (page == 1) {
+                self.productList = products;
+            } else {
+                self.productList = [self.productList arrayByAddingObjectsFromArray:products];
+            }
+            if (products.count < 20) {
+                com(false, @"");
+            } else {
+                com(true, @"");
+            }
+        } else {
+            com(false, @"");
+        }
+    } faild:^(NSString * _Nonnull code, NSString * _Nonnull msg) {
+        com(false, msg);
+    }];
+    
+    
+}
+
 @end

+ 4 - 0
Asteria/Fuction/UserCenter/VipCenter/ASVipCenterViewController.m

@@ -205,7 +205,11 @@
         ASVipCenterLineItemView *v = [[ASVipCenterLineItemView alloc] initWithFrame:CGRectZero];
         [v setData:title canGoNext:true];
         v.tag = 90000+i;
+        __weak typeof(self) weakSelf = self;
         v.selectCallBack = ^{
+            if (vipM.level.integerValue != ASUserInfoManager.shared.curVipInfo.level.integerValue) {
+                return;
+            }
             if (tempM.type.integerValue == 1) { // 优惠券
                 ASVipCouponsViewController *vc = [ASVipCouponsViewController new];
                 vc.level = vipM.level;

+ 10 - 4
Asteria/NetTools/ASNetApis.h

@@ -11,14 +11,20 @@
 #define BaseRequestrUrl(url) ([NSString stringWithFormat:@"%@%@",@"rest/V1/",url])
 
 // MARK: - host
-#if (DEBUG)
-#define HostPath @"pc.bilisar.com"//@"www.bilisar.com"//@"https://www.bilisar.com/"  //测试
-#else
+//#if (DEBUG)
+//#define HostPath @"pc.bilisar.com"//@"www.bilisar.com"//@"https://www.bilisar.com/"  //测试
+//#else
 #define HostPath @"pc.bilisar.com"//@"https://pc.bilisar.com/"  //正式
-#endif
+//#endif
 
 // MARK: - path
 
+#define ProductImgPath @"/media/catalog/product"
+#define CategoryImgPath @"/media/catalog/category/"
+
+// MARK: - 商品列表
+#define getProductListUrl BaseRequestrUrl(@"rewrite/categories/%@/products")
+
 // MARK: - 货币
 #define getAllCurrencyUrl BaseRequestrUrl(@"directory/currency")